message

package
v0.7.11 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ID = "message"

ID identifies the message input for focus management.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	*State
	// contains filtered or unexported fields
}

Component implements the message editor.

func NewComponent

func NewComponent(m Model, s State) *Component

NewComponent creates a message editor component.

func (*Component) Blur

func (c *Component) Blur()

func (*Component) Focus

func (c *Component) Focus() tea.Cmd

func (*Component) Focusables

func (c *Component) Focusables() map[string]focus.Focusable

Focusables exposes focusable elements for the message component.

func (*Component) Init

func (c *Component) Init() tea.Cmd

func (*Component) Input

func (c *Component) Input() *textarea.Model

Input returns the textarea model.

func (*Component) SetPayload

func (c *Component) SetPayload(payload string)

SetPayload updates the textarea with the provided payload.

func (*Component) Update

func (c *Component) Update(msg tea.Msg) tea.Cmd

Update handles textarea updates when editing messages.

func (*Component) View

func (c *Component) View() string

View renders the message editor box.

type Model

type Model interface {
	Width() int
	MessageHeight() int
	FocusedID() string
	HoveredID() string
	MessageTargetPreview() string
	OverlayHelp(view string) string
}

Model defines the host model behavior required by the Component.

type State

type State struct {
	TA textarea.Model
}

State holds the textarea model for composing messages.

Jump to

Keyboard shortcuts

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