views

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IssuePaddingLeft = 2
	OptionPadding    = 2
)

Color constants used across TUI components

Variables

This section is empty.

Functions

func NewKeymapChangesModel

func NewKeymapChangesModel(changes *importapi.KeymapChanges, confirm *bool) tea.Model

func NewKeymapViewModel

func NewKeymapViewModel(setting *keymapv1.Keymap, mc *mappings.MappingConfig, filePath string) tea.Model

Types

type ActionDetailsViewModel added in v0.3.0

type ActionDetailsViewModel struct {
	// contains filtered or unexported fields
}

func (*ActionDetailsViewModel) View added in v0.3.0

func (d *ActionDetailsViewModel) View() string

type ExportFormModel added in v0.2.0

type ExportFormModel struct {
	Editor                   *string
	OnekeymapConfigInput     *string
	EditorKeymapConfigOutput *string

	OnekeymapConfigPlaceHolder string
	// contains filtered or unexported fields
}

ExportFormModel collects inputs for exporting onekeymap.json to a target editor.

func NewOutputFormModel

func NewOutputFormModel(
	registry *plugins.Registry,
	needSelectEditor, needInput, needOutput bool,
	editor, onekeymapConfigInput, editorKeymapConfigOutput *string,
	onekeymapConfigPlaceHolder string,
) (*ExportFormModel, error)

func (*ExportFormModel) Init added in v0.2.0

func (m *ExportFormModel) Init() tea.Cmd

func (*ExportFormModel) Update added in v0.2.0

func (m *ExportFormModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*ExportFormModel) View added in v0.2.0

func (m *ExportFormModel) View() string

type FileChangedMsg added in v0.4.0

type FileChangedMsg struct {
	Path string
}

FileChangedMsg is sent when the watched file changes

type FileErrorMsg added in v0.4.0

type FileErrorMsg struct {
	Err error
}

FileErrorMsg is sent when there's an error watching the file

type ImportFormModel added in v0.2.0

type ImportFormModel struct {
	Editor                     *string
	EditorKeymapConfigInput    *string
	OnekeymapConfigOutput      *string
	OnekeymapConfigPlaceHolder string
	// contains filtered or unexported fields
}

ImportFormModel represents the import form UI model.

func NewImportFormModel

func NewImportFormModel(
	registry *plugins.Registry,
	needSelectEditor, needInput, needOutput bool,
	editor, editorKeymapConfigInput, onekeymapConfigOutput *string,
	onekeymapConfigPlaceHolder string,
) (*ImportFormModel, error)

func (*ImportFormModel) Init added in v0.2.0

func (m *ImportFormModel) Init() tea.Cmd

Init initializes the import form model.

func (*ImportFormModel) Update added in v0.2.0

func (m *ImportFormModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*ImportFormModel) View added in v0.2.0

func (m *ImportFormModel) View() string

type KeymapViewModel

type KeymapViewModel struct {
	// contains filtered or unexported fields
}

KeymapViewModel is a read-only TUI model to present current OneKeymapSetting.

func (*KeymapViewModel) Init

func (m *KeymapViewModel) Init() tea.Cmd

func (*KeymapViewModel) Update

func (m *KeymapViewModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*KeymapViewModel) View

func (m *KeymapViewModel) View() string

type MigrateFormModel

type MigrateFormModel struct {
	EditorFrom *string
	EditorTo   *string
	Input      *string
	Output     *string
	// contains filtered or unexported fields
}

func NewMigrateFormModel

func NewMigrateFormModel(registry *plugins.Registry, from, to, input, output *string) *MigrateFormModel

func (*MigrateFormModel) Init

func (m *MigrateFormModel) Init() tea.Cmd

func (*MigrateFormModel) Update

func (m *MigrateFormModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*MigrateFormModel) View

func (m *MigrateFormModel) View() string

type TelemetryPromptModel added in v0.5.0

type TelemetryPromptModel struct {
	// contains filtered or unexported fields
}

TelemetryPromptModel represents the telemetry consent prompt

func NewTelemetryPrompt added in v0.5.0

func NewTelemetryPrompt() TelemetryPromptModel

NewTelemetryPrompt creates a new telemetry prompt model

func (TelemetryPromptModel) GetChoice added in v0.5.0

func (m TelemetryPromptModel) GetChoice() bool

GetChoice returns the user's choice: true for enabled, false for disabled

func (TelemetryPromptModel) Init added in v0.5.0

func (m TelemetryPromptModel) Init() tea.Cmd

func (TelemetryPromptModel) Update added in v0.5.0

func (m TelemetryPromptModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (TelemetryPromptModel) View added in v0.5.0

func (m TelemetryPromptModel) View() string

func (TelemetryPromptModel) WasSelected added in v0.5.0

func (m TelemetryPromptModel) WasSelected() bool

WasSelected returns whether the user made a selection (vs quitting)

type ValidationReportModel

type ValidationReportModel struct {
	// contains filtered or unexported fields
}

func NewValidationReportModel

func NewValidationReportModel(report *keymapv1.ValidationReport) ValidationReportModel

func (ValidationReportModel) Init

func (m ValidationReportModel) Init() tea.Cmd

func (ValidationReportModel) Update

func (m ValidationReportModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ValidationReportModel) View

func (m ValidationReportModel) View() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL