Documentation
¶
Overview ¶
Package panels contains JSON TUI panel components.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyPalette ¶
ApplyPalette updates all panel style variables to match the given palette.
func PrettyNode ¶
PrettyNode pretty-prints a node's value for the preview panel.
Types ¶
type LensPanel ¶
type LensPanel struct {
// contains filtered or unexported fields
}
LensPanel is the bottom-right panel — shows output from the active analysis lens.
func NewLensPanel ¶
NewLensPanel creates a lens panel.
func (*LensPanel) ActiveLens ¶
ActiveLens returns the current lens ID.
func (*LensPanel) HandleKey ¶
HandleKey processes keypresses when the lens panel is focused. Returns true if a key was consumed.
func (*LensPanel) SetCursorNode ¶
func (*LensPanel) SetFocused ¶
type PreviewPanel ¶
type PreviewPanel struct {
// contains filtered or unexported fields
}
PreviewPanel shows the value of the currently selected tree node.
func NewPreviewPanel ¶
func NewPreviewPanel(w, h int) PreviewPanel
NewPreviewPanel creates a preview panel.
func (*PreviewPanel) HandleKey ¶
func (p *PreviewPanel) HandleKey(key string) bool
HandleKey handles scrolling when this panel is focused.
func (*PreviewPanel) Resize ¶
func (p *PreviewPanel) Resize(w, h int)
func (*PreviewPanel) SetFocused ¶
func (p *PreviewPanel) SetFocused(f bool)
func (*PreviewPanel) SetNode ¶
func (p *PreviewPanel) SetNode(n *node.Node)
SetNode updates the preview to show the given node's value.
func (*PreviewPanel) View ¶
func (p *PreviewPanel) View() string
View returns the rendered preview content.
type TreeNode ¶
type TreeNode struct {
Node *node.Node
Depth int
IsLast bool
Collapsed bool // only valid for KindObject and KindArray
}
TreeNode is a flattened representation of a node for the tree panel. The flat list is pre-computed on expand/collapse; View() just slices it.
type TreePanel ¶
type TreePanel struct {
// contains filtered or unexported fields
}
TreePanel is the left panel — a navigable, collapsible JSON tree.
func NewTreePanel ¶
NewTreePanel creates a tree panel from the root node.
func (*TreePanel) CursorNode ¶
CursorNode returns the currently highlighted node.
func (*TreePanel) SetFocused ¶
type TypeGenSubMode ¶
type TypeGenSubMode int
TypeGenSubMode selects the typegen output language.
const ( TypeGenGo TypeGenSubMode = iota TypeGenTS TypeGenJSONSchema )