ui

package
v0.0.0-...-de24375 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StepStyle            = lipgloss.NewStyle().Foreground(ComplementaryColor)
	DebugViewBorderStyle = lipgloss.NewStyle().Border(lipgloss.RoundedBorder(), false, false, false, true).BorderForeground(SecondaryColor)
)
View Source
var (
	SpinnerStyle         = lipgloss.NewStyle()
	ProgressMessageStyle = lipgloss.NewStyle()
	PrimaryColor         = lipgloss.AdaptiveColor{Light: "#0b3954", Dark: "#239be2"}
	ComplementaryColor   = lipgloss.AdaptiveColor{Light: "#df9a0a", Dark: "#e2c923"}
	SecondaryColor       = lipgloss.AdaptiveColor{Light: "#087e8b", Dark: "#31e0f3"}
)

Functions

func Indent

func Indent(str string, n int) string

func Run

func Run(ctx context.Context, p *tea.Program) (context.Context, error)

Types

type App

type App struct {
	Children []tea.Model
	OnReady  chan bool
	Help     *HelpModel
	// contains filtered or unexported fields
}

func NewApp

func NewApp(children ...tea.Model) *App

func (*App) Init

func (b *App) Init() tea.Cmd

func (*App) Update

func (b *App) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*App) View

func (b *App) View() string

type DebugComponent

type DebugComponent struct {
	SC            *ScriptComponent
	Debug         debug.Controller
	DebugView     *DebugView
	UpdateHistory *UpdateHistory
}

func NewDebugComponent

func NewDebugComponent(s debug.Controller, sc *ScriptComponent) *DebugComponent

func (*DebugComponent) Init

func (d *DebugComponent) Init() tea.Cmd

func (*DebugComponent) Update

func (d *DebugComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*DebugComponent) View

func (d *DebugComponent) View() string

type DebugView

type DebugView struct {
	Inst       engine.Instruction
	ActionData *engine.TemplateData
	Width      int
	Height     int
	// contains filtered or unexported fields
}

func (*DebugView) String

func (d *DebugView) String() string

type HelpModel

type HelpModel struct {
	Help help.Model
	Keys help.KeyMap
	// contains filtered or unexported fields
}

func (*HelpModel) Init

func (h *HelpModel) Init() tea.Cmd

func (*HelpModel) Update

func (h *HelpModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*HelpModel) View

func (h *HelpModel) View() string

type MessageFilter

type MessageFilter func(msg tea.Msg) bool

func DefaultUpdateFilter

func DefaultUpdateFilter() MessageFilter

type OnRenderFunc

type OnRenderFunc func(id string)

type OnScriptEventMsg

type OnScriptEventMsg struct {
	Event engine.Event
}

func (OnScriptEventMsg) String

func (o OnScriptEventMsg) String() string

type RenderModelMsg

type RenderModelMsg struct {
	Model renderer.Model
}

func (RenderModelMsg) String

func (r RenderModelMsg) String() string

type ScriptComponent

type ScriptComponent struct {
	Stream       renderer.Stream
	ScriptEvents engine.EventQueue
	OnRenderFunc OnRenderFunc
	Logger       *slog.Logger

	// visual components
	Child                  tea.Model
	Spinner                *Spinner
	ProgressMessage        string
	DefaultProgressMessage string
	// contains filtered or unexported fields
}

func NewScriptComponent

func NewScriptComponent(accountName string, str renderer.Stream, eq engine.EventQueue, logger *slog.Logger) *ScriptComponent

func (*ScriptComponent) Init

func (s *ScriptComponent) Init() tea.Cmd

func (*ScriptComponent) Update

func (s *ScriptComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*ScriptComponent) View

func (s *ScriptComponent) View() string

type Spinner

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

func NewSpinner

func NewSpinner() *Spinner

func (*Spinner) Init

func (s *Spinner) Init() tea.Cmd

func (*Spinner) Update

func (s *Spinner) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Spinner) View

func (s *Spinner) View() string

type UpdateEntry

type UpdateEntry struct {
	Time time.Time
	Msg  fmt.Stringer
}

func (*UpdateEntry) String

func (e *UpdateEntry) String() string

type UpdateHistory

type UpdateHistory struct {
	Limit         int
	UpdateHistory []*UpdateEntry
	MessageFilter MessageFilter
	Style         lipgloss.Style
}

func NewUpdateHistory

func NewUpdateHistory(limit int) *UpdateHistory

func (*UpdateHistory) Init

func (u *UpdateHistory) Init() tea.Cmd

func (*UpdateHistory) Update

func (u *UpdateHistory) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*UpdateHistory) View

func (u *UpdateHistory) View() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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