Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTextArea ¶
NewTextArea creates a textarea.Model with sensible defaults for use inside TUI overlays: no prompt prefix, no line numbers, and dynamic height. The caller should configure styles after creation.
Types ¶
type BodyFetchFunc ¶
BodyFetchFunc fetches the body for an entry at the given index.
type Editor ¶
Editor is a Bubble Tea model for editing multiple title+body entries.
func NewEditor ¶
func NewEditor(entries []EditorEntry, opts ...EditorOption) Editor
NewEditor creates an Editor for the given entries.
func (Editor) Results ¶
func (m Editor) Results() []EditorResult
Results returns the outcome for all entries.
type EditorEntry ¶
type EditorEntry struct {
Label string // display label (e.g. "owner/repo#123")
Title string // initial title value
}
EditorEntry defines an item to edit.
type EditorOption ¶
type EditorOption func(*editorConfig)
EditorOption configures an Editor created by NewEditor.
func WithBodyFetch ¶
func WithBodyFetch(fn BodyFetchFunc) EditorOption
WithBodyFetch sets the function used to lazily fetch entry bodies.
func WithEditorBodyMinHeight ¶
func WithEditorBodyMinHeight(h int) EditorOption
WithEditorBodyMinHeight sets the minimum body textarea height.
func WithEditorStyles ¶
func WithEditorStyles(s EditorStyles) EditorOption
WithEditorStyles sets the editor styles.
func WithEditorWidth ¶
func WithEditorWidth(w int) EditorOption
WithEditorWidth sets the editor width.
type EditorResult ¶
EditorResult holds the outcome for a single edited entry.
func Run ¶
func Run(entries []EditorEntry, opts ...EditorOption) ([]EditorResult, bool, error)
Run launches the editor as a standalone Bubble Tea program and returns results.
type EditorStyles ¶
type EditorStyles struct {
BlurredText lg.Style
Counter lg.Style
Dirty lg.Style
DimLabel lg.Style
FocusedText lg.Style
Header lg.Style
HelpKey lg.Style
HelpText lg.Style
Label lg.Style
}
EditorStyles controls the visual appearance of the editor.
type Option ¶
type Option func(*config)
Option configures a textarea created by NewTextArea.
func WithMaxHeight ¶
WithMaxHeight sets the maximum height of the textarea.
func WithMinHeight ¶
WithMinHeight sets the minimum height of the textarea.
func WithPlaceholder ¶
WithPlaceholder sets the placeholder text shown when the textarea is empty.