model

package
v0.0.0-...-8bc919e Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NAME = iota
	DIR
	EXT
)
View Source
const (
	LANDING = iota
	QUICK
	CREATE
	SEARCH
	BROWSE
	EDIT
	QUIT
)

Variables

View Source
var (
	ButtonStyle = lipgloss.NewStyle().Padding(0, 2).Border(lipgloss.RoundedBorder()).Align(lipgloss.Center)
	// ActiveButton   = ButtonStyle.Foreground(lipgloss.Color("#FFFFFF")).Background(lipgloss.Color("#5A56E0"))
	ActiveButton = ButtonStyle.
					BorderStyle(lipgloss.RoundedBorder()).
					BorderForeground(lipgloss.Color("2")).
					Foreground(lipgloss.Color("default")).
					Background(lipgloss.Color("2"))
	InactiveButton = ButtonStyle.Foreground(lipgloss.Color("default"))

	HeaderStyle = lipgloss.NewStyle().
				Padding(0, 1).
				Background(lipgloss.Color("2")).
				Foreground(lipgloss.Color("default"))

	InputHeaderStyle = lipgloss.NewStyle().
						Foreground(lipgloss.Color("4"))

	InputStyle = lipgloss.NewStyle().
				BorderStyle(lipgloss.RoundedBorder()).
				BorderForeground(lipgloss.Color("3"))

	ContinueStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("1"))
)
View Source
var MatchaStyle = lipgloss.NewStyle().Margin(1, 2).
	Foreground(lipgloss.Color("default"))

Functions

This section is empty.

Types

type Model

type Model struct {
	// model mode
	Mode int

	// landing page fields
	ModeChosen bool

	// browse/search mode fields
	List         list.Model
	NoteSources  []string
	SelectedNote data.Note

	// inputs for create mode
	Inputs []textinput.Model

	Templates []config.NoteTemplate
	// contains filtered or unexported fields
}

TODO: add new fields to allow multi-stage application

func InitialModel

func InitialModel() Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type Styles

type Styles struct {
	Foreground  lipgloss.Color
	BorderColor lipgloss.Color
	InputField  lipgloss.Style
}

TODO: handle all the style stuff better

func DefaultStyles

func DefaultStyles() *Styles

Jump to

Keyboard shortcuts

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