tui

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DialogBoxStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(lipgloss.Color("#874BFD")).
					Padding(1, 0).
					BorderTop(true).
					BorderLeft(true).
					BorderRight(true).
					BorderBottom(true)

	HelpStyle    = lipgloss.NewStyle().Foreground(lipgloss.Color("240"))
	SuccessStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("42")).Bold(true)
	InfoStyle    = lipgloss.NewStyle().Foreground(lipgloss.Color("205")).Bold(true)

	H1Style = lipgloss.NewStyle().
			Foreground(lipgloss.Color("205")).
			Bold(true).
			Align(lipgloss.Center)

	H2Style = lipgloss.NewStyle().
			Foreground(lipgloss.Color("205")).
			Bold(false).
			Align(lipgloss.Center)

	BodyStyle = lipgloss.NewStyle().
				Bold(true) // A bit bold
)
View Source
var DocStyle = lipgloss.NewStyle().Margin(1, 2)

Functions

This section is empty.

Types

type ArchiveEmailMsg

type ArchiveEmailMsg struct {
	UID uint32
}

type AttachmentDownloadedMsg

type AttachmentDownloadedMsg struct {
	Path string
	Err  error
}

type BackToInboxMsg

type BackToInboxMsg struct{}

type CancelFilePickerMsg

type CancelFilePickerMsg struct{}

type Choice

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

func NewChoice

func NewChoice(hasCachedDraft bool) Choice

func (Choice) Init

func (m Choice) Init() tea.Cmd

func (Choice) Update

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

func (Choice) View

func (m Choice) View() string

type ChooseServiceMsg

type ChooseServiceMsg struct {
	Service string
}

type ClearStatusMsg

type ClearStatusMsg struct{}

type Composer

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

Composer model holds the state of the email composition UI.

func NewComposer

func NewComposer(from, to, subject, body string) *Composer

NewComposer initializes a new composer model.

func (*Composer) Init

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

func (*Composer) ResetConfirmation

func (m *Composer) ResetConfirmation()

ResetConfirmation ensures a restored draft isn't stuck in the exit prompt.

func (*Composer) Update

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

func (*Composer) View

func (m *Composer) View() string

type Credentials

type Credentials struct {
	Provider string
	Name     string
	Email    string
	Password string
}

type DeleteEmailMsg

type DeleteEmailMsg struct {
	UID uint32
}

type DiscardDraftMsg

type DiscardDraftMsg struct {
	ComposerState *Composer
}

DiscardDraftMsg signals that a draft should be cached.

type DownloadAttachmentMsg

type DownloadAttachmentMsg struct {
	Index    int
	Filename string
	PartID   string
	Data     []byte
}

type EmailActionDoneMsg

type EmailActionDoneMsg struct {
	UID uint32
	Err error
}

type EmailBodyFetchedMsg

type EmailBodyFetchedMsg struct {
	Index       int
	Body        string
	Attachments []fetcher.Attachment
	Err         error
}

type EmailResultMsg

type EmailResultMsg struct {
	Err error
}

type EmailView

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

func NewEmailView

func NewEmailView(email fetcher.Email, width, height int) *EmailView

func (*EmailView) Init

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

func (*EmailView) Update

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

func (*EmailView) View

func (m *EmailView) View() string

type EmailsAppendedMsg

type EmailsAppendedMsg struct {
	Emails []fetcher.Email
}

type EmailsFetchedMsg

type EmailsFetchedMsg struct {
	Emails []fetcher.Email
}

type FetchErr

type FetchErr error

type FetchMoreEmailsMsg

type FetchMoreEmailsMsg struct {
	Offset uint32
}

type FetchingMoreEmailsMsg

type FetchingMoreEmailsMsg struct{}

type FilePicker

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

func NewFilePicker

func NewFilePicker(startPath string) *FilePicker

func (*FilePicker) Init

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

func (*FilePicker) Update

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

func (*FilePicker) View

func (m *FilePicker) View() string

type FileSelectedMsg

type FileSelectedMsg struct {
	Path string
}

type GoToChoiceMenuMsg

type GoToChoiceMenuMsg struct{}

type GoToFilePickerMsg

type GoToFilePickerMsg struct{}

type GoToInboxMsg

type GoToInboxMsg struct{}

type GoToSendMsg

type GoToSendMsg struct {
	To      string
	Subject string
	Body    string
}

type GoToSettingsMsg

type GoToSettingsMsg struct{}

type Inbox

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

func NewInbox

func NewInbox(emails []fetcher.Email) *Inbox

func (*Inbox) Init

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

func (*Inbox) Update

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

func (*Inbox) View

func (m *Inbox) View() string

type Login

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

Login holds the state for the login form.

func NewLogin

func NewLogin() *Login

NewLogin creates a new login model.

func (*Login) Init

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

Init initializes the login model.

func (*Login) Update

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

Update handles messages for the login model.

func (*Login) View

func (m *Login) View() string

View renders the login form.

type ReplyToEmailMsg

type ReplyToEmailMsg struct {
	Email fetcher.Email
}

type RestoreDraftMsg

type RestoreDraftMsg struct{}

RestoreDraftMsg signals that the cached draft should be restored.

type RestoreViewMsg

type RestoreViewMsg struct{}

type SendEmailMsg

type SendEmailMsg struct {
	To             string
	Subject        string
	Body           string
	AttachmentPath string
	InReplyTo      string
	References     []string
}

type SetComposerCursorToStartMsg

type SetComposerCursorToStartMsg struct{}

type Status

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

A simple model for showing a status message

func NewStatus

func NewStatus(msg string) Status

func (Status) Init

func (m Status) Init() tea.Cmd

func (Status) Update

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

func (Status) View

func (m Status) View() string

type ViewEmailMsg

type ViewEmailMsg struct {
	Index int
}

Jump to

Keyboard shortcuts

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