Documentation
¶
Overview ¶
Package pluginapi defines the experimental external plugin bundle contract. It has no dependency on the desktop UI or mtools' internal packages. The runtime protocol is experimental; the surface schema is not frozen yet.
Index ¶
- Constants
- Variables
- func CompareVersions(a, b string) (int, error)
- func DecodePayload(data []byte, dst any) error
- func DecodeProps[T any](n UINode) (T, error)
- func Serve(ctx context.Context, input io.ReadCloser, output io.Writer, ...) error
- func ServeLive(ctx context.Context, input io.ReadCloser, output io.Writer, ...) error
- func ValidBundlePath(name string) bool
- func ValidJobID(id string) bool
- func ValidPluginID(id PluginID) bool
- func ValidUIAssetRef(src string) bool
- func WriteMessage(w io.Writer, m Message) error
- type CancelParams
- type Capability
- type Entry
- type FileInfo
- type HelperStatus
- type InitializeParams
- type InitializeResult
- type InputError
- type InspectFieldUpdate
- type InspectParams
- type InspectPreview
- type InspectResult
- type Inspector
- type InspectorFunc
- type LiveUI
- type Manifest
- type Message
- type PluginID
- type Progress
- type Publisher
- type RPCError
- type RunParams
- type RunResult
- type Runner
- type RunnerFunc
- type SurfaceAction
- type SurfaceCondition
- type SurfaceDocument
- type SurfaceField
- type SurfaceFieldAction
- type SurfaceHelper
- type SurfaceHistory
- type SurfaceHistoryButton
- type SurfaceLive
- type SurfaceMode
- type SurfaceOption
- type SurfaceSection
- type Tool
- type ToolID
- type ToolSurface
- type UIButtonProps
- type UICanvasOp
- type UICanvasProps
- type UICloseParams
- type UIContainerProps
- type UIDialogProps
- type UIDirPickerProps
- type UIDraggableProps
- type UIEmptyProps
- type UIEvent
- type UIFilePickerProps
- type UIIconProps
- type UIImageProps
- type UIListProps
- type UINode
- type UIOpenParams
- type UIProgressProps
- type UIScrollTarget
- type UISelectProps
- type UISession
- type UISliderProps
- type UISplitProps
- type UITabsProps
- type UITextInputProps
- type UITextProps
- type UIToggleProps
- type UITree
- type UIViewport
Constants ¶
const ( MethodUIOpen = "ui.open" MethodUITree = "ui.tree" MethodUIEvent = "ui.event" MethodUIClose = "ui.close" MaxUINodes = 2048 MaxUIDepth = 32 MaxUITextBytes = 8192 MaxUIAssetBytes = 32 << 20 MaxUICanvasOps = 4096 )
const ( UINodeColumn = "column" UINodeRow = "row" UINodeScroll = "scroll" UINodeText = "text" UINodeButton = "button" UINodeTextInput = "text_input" UINodeImage = "image" UINodeSplit = "split" UINodeList = "list" UINodeProgress = "progress" UINodeEmpty = "empty" UINodeSelect = "select" UINodeToggle = "toggle" UINodeTabs = "tabs" UINodeFilePicker = "file_picker" UINodeDirPicker = "dir_picker" UINodeDraggable = "draggable" UINodeCanvas = "canvas" UINodeStack = "stack" UINodeSlider = "slider" UINodeDialog = "dialog" UINodeIcon = "icon" )
const ( UIEventClick = "click" UIEventDoubleClick = "double_click" UIEventChange = "change" UIEventSubmit = "submit" UIEventSelect = "select" UIEventToggle = "toggle" UIEventResize = "resize" UIEventDragEnd = "drag_end" UIEventDrop = "drop" UIEventStroke = "stroke" UIEventView = "viewport" UIEventScroll = "scroll" UIEventZoom = "zoom" UIEventShortcut = "shortcut" UIEventClose = "close" )
const ( SchemaVersion = 1 Protocol = "jsonrpc-stdio-v1" MaxManifestBytes = 256 << 10 MaxFiles = 2048 MaxFileBytes = 128 << 20 MaxExpandedBytes = 512 << 20 MaxArchiveBytes = 256 << 20 )
const ( MaxMessageBytes = 1 << 20 // includes the terminating LF MethodInitialize = "initialize" MethodInspect = "inspect" MethodRun = "run" MethodProgress = "progress" MethodCancel = "cancel" )
const ( SurfaceFile = "surfaces.json" MaxSurfaceBytes = 64 << 10 )
Variables ¶
var ( ErrManifest = errors.New("invalid plugin manifest") ErrCompatibility = errors.New("incompatible plugin") )
var ErrProtocol = errors.New("invalid plugin protocol")
var ErrSurface = errors.New("invalid plugin surface")
var ErrUITree = errors.New("invalid plugin live UI tree")
Functions ¶
func CompareVersions ¶
CompareVersions compares release versions. Prerelease/build suffixes are not supported in schema 1, so version order has no channel-dependent ambiguity.
func DecodePayload ¶
DecodePayload applies the same strict JSON rules to a typed wire payload. Callers must then validate semantic bounds and job/manifest identity.
func DecodeProps ¶ added in v0.2.0
DecodeProps decodes a node's Props map into one of the typed prop structs, rejecting unknown fields.
func Serve ¶
func Serve(ctx context.Context, input io.ReadCloser, output io.Writer, identity InitializeResult, runner Runner) error
Serve is the optional Go sidecar SDK, independent of the desktop host. It owns and closes input so cancellation can interrupt a blocked read. output must be protocol-only and must not block forever (the host closes it on termination). Any diagnostics belong on stderr, never output.
func ServeLive ¶ added in v0.2.0
func ServeLive(ctx context.Context, input io.ReadCloser, output io.Writer, identity InitializeResult, runner Runner, live LiveUI) error
ServeLive runs a jsonrpc-stdio-v1 sidecar that supports both standard action execution (Runner / Inspector) and Live UI sessions (LiveUI).
func ValidBundlePath ¶
ValidBundlePath accepts only portable, slash-separated regular file paths. Reject aliases on case-insensitive/Windows filesystems before extraction.
func ValidJobID ¶
func ValidPluginID ¶
func ValidUIAssetRef ¶ added in v0.2.0
ValidUIAssetRef validates an "asset:<name>" reference for live UI images.
Types ¶
type CancelParams ¶
type CancelParams struct {
JobID string `json:"job_id"`
}
type Capability ¶
type Capability string
const ( FilesRead Capability = "files.read" FilesWrite Capability = "files.write" Network Capability = "network" Process Capability = "process" Clipboard Capability = "clipboard" UILive Capability = "ui.live" )
type HelperStatus ¶
type InitializeParams ¶
type InitializeParams struct {
Protocol string `json:"protocol"`
PluginID PluginID `json:"plugin_id"`
Version string `json:"version"`
}
func (InitializeParams) Validate ¶
func (p InitializeParams) Validate() error
type InitializeResult ¶
type InitializeResult = InitializeParams
type InputError ¶
type InputError struct{ Field string }
InputError identifies a field without retaining or exposing its value.
func (*InputError) Error ¶
func (e *InputError) Error() string
type InspectFieldUpdate ¶
type InspectFieldUpdate struct {
Options []SurfaceOption `json:"options,omitempty"`
Value string `json:"value,omitempty"`
Info string `json:"info,omitempty"`
}
type InspectParams ¶
type InspectParams struct {
Tool ToolID `json:"tool"`
Action string `json:"action,omitempty"`
Inputs map[string][]string `json:"inputs"`
Settings map[string]string `json:"settings,omitempty"`
}
func (InspectParams) Validate ¶
func (p InspectParams) Validate() error
type InspectPreview ¶ added in v0.1.2
type InspectResult ¶
type InspectResult struct {
Fields map[string]InspectFieldUpdate `json:"fields,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
Preview *InspectPreview `json:"preview,omitempty"`
IsPlaylist bool `json:"is_playlist,omitempty"`
CommandPreview string `json:"command_preview,omitempty"`
HelperStatus map[string]HelperStatus `json:"helper_status,omitempty"`
Logs []string `json:"logs,omitempty"`
Error string `json:"error,omitempty"`
}
func (InspectResult) Validate ¶
func (r InspectResult) Validate() error
type Inspector ¶
type Inspector interface {
Inspect(context.Context, InspectParams) (InspectResult, error)
}
Inspector is an optional interface a Runner may implement to support dynamic schema inspection, previews, and helper binary checks.
type InspectorFunc ¶
type InspectorFunc func(context.Context, InspectParams) (InspectResult, error)
func (InspectorFunc) Inspect ¶
func (f InspectorFunc) Inspect(ctx context.Context, p InspectParams) (InspectResult, error)
type LiveUI ¶ added in v0.2.0
type LiveUI interface {
Open(ctx context.Context, params UIOpenParams, session *UISession) (UITree, error)
Event(ctx context.Context, event UIEvent, session *UISession) error
}
LiveUI is implemented by sidecars that drive a dynamic native UI tree while their workspace is open. Open and Event are called sequentially by ServeLive.
type Manifest ¶
type Manifest struct {
Schema int `json:"schema"`
ID PluginID `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Platform string `json:"platform"`
Publisher Publisher `json:"publisher"`
Capabilities []Capability `json:"capabilities"`
Entry Entry `json:"entry"`
Tools []Tool `json:"tools"`
Files map[string]FileInfo `json:"files"`
}
Manifest is signed as exact UTF-8 JSON bytes, not re-encoded JSON. Files inventories every ZIP payload except manifest.json and SIGNATURE.
func DecodeManifest ¶
DecodeManifest rejects unknown and duplicate members, trailing JSON, excessive nesting, invalid UTF-8, and metadata beyond the schema's bounds.
type Message ¶
type Message struct {
JSONRPC string `json:"jsonrpc"`
ID uint64 `json:"id,omitempty"`
Method string `json:"method,omitempty"`
Params json.RawMessage `json:"params,omitempty"`
Result json.RawMessage `json:"result,omitempty"`
Error *RPCError `json:"error,omitempty"`
}
Message is a deliberately small JSON-RPC 2.0 subset. IDs are positive integers; notifications omit ID. Batches, reverse requests and arbitrary error data are not supported. Stdout carries only LF-terminated messages.
func DecodeMessage ¶
type Progress ¶
type Publisher ¶
type Publisher struct {
Name string `json:"name"`
PublicKey string `json:"public_key"` // standard padded base64, Ed25519
}
func (Publisher) Fingerprint ¶
Fingerprint identifies a key, not a verified real-world publisher identity.
type RunParams ¶
type RunResult ¶
type Runner ¶
Runner handles one action at a time. It must honor ctx and finish before returning. emit is safe from multiple goroutines, but must not be retained.
type RunnerFunc ¶
type SurfaceAction ¶
type SurfaceCondition ¶ added in v0.1.2
type SurfaceCondition struct {
Field string `json:"field"`
Equals string `json:"equals,omitempty"`
NotEquals string `json:"not_equals,omitempty"`
}
SurfaceCondition declares when a field should be visible based on another field's value.
type SurfaceDocument ¶
type SurfaceDocument struct {
Schema int `json:"schema"`
Tools []ToolSurface `json:"tools"`
}
SurfaceDocument is a signed, static description, not executable UI code.
func DecodeSurfaces ¶
func DecodeSurfaces(data []byte, manifest Manifest) (SurfaceDocument, error)
func (SurfaceDocument) Validate ¶
func (d SurfaceDocument) Validate(m Manifest) error
type SurfaceField ¶
type SurfaceField struct {
ID string `json:"id"`
Kind string `json:"kind"` // text, choice, select, toggle, file, files, directory, checklist, chips
Label string `json:"label"`
Hint string `json:"hint,omitempty"`
HideLabel bool `json:"hide_label,omitempty"`
Required bool `json:"required"`
Default string `json:"default"`
Options []SurfaceOption `json:"options,omitempty"`
Dynamic bool `json:"dynamic,omitempty"`
Grow bool `json:"grow,omitempty"`
Flex int `json:"flex,omitempty"`
Style string `json:"style,omitempty"` // "" or "chip"
VisibleWhen *SurfaceCondition `json:"visible_when,omitempty"`
// Description, Placeholder and Action are only meaningful for settings (or text/file placeholders).
Description string `json:"description,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
Action *SurfaceFieldAction `json:"action,omitempty"`
}
type SurfaceFieldAction ¶
type SurfaceFieldAction struct {
ID string `json:"id"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
}
SurfaceFieldAction attaches one button to a setting. It either opens an https URL through the host, or runs a declared tool action whose first output becomes the setting's value. It never carries executable UI code.
type SurfaceHelper ¶
type SurfaceHistory ¶ added in v0.1.2
type SurfaceHistory struct {
Disabled bool `json:"disabled,omitempty"`
Title string `json:"title,omitempty"`
EmptyTitle string `json:"empty_title,omitempty"`
EmptySubtitle string `json:"empty_subtitle,omitempty"`
ShowHide bool `json:"show_hide,omitempty"`
HideClearAll bool `json:"hide_clear_all,omitempty"`
DefaultWidth int `json:"default_width,omitempty"`
Buttons []SurfaceHistoryButton `json:"buttons,omitempty"`
}
SurfaceHistory configures the declarative history sidebar for a tool workspace.
type SurfaceHistoryButton ¶ added in v0.1.2
type SurfaceHistoryButton struct {
ID string `json:"id"`
Label string `json:"label"`
Action string `json:"action,omitempty"`
URL string `json:"url,omitempty"`
}
SurfaceHistoryButton attaches a custom action button to the history sidebar header. It can trigger a declared tool action, reveal the output folder ("open_output_dir"), or open an https URL.
type SurfaceLive ¶ added in v0.2.0
type SurfaceLive struct {
InitialTitle string `json:"initial_title,omitempty"`
Mode string `json:"mode,omitempty"`
FullBleed bool `json:"full_bleed,omitempty"`
}
SurfaceLive marks a tool workspace as driven by a long-lived sidecar via ui.open / ui.tree / ui.event / ui.close while keeping actions and settings host-owned. Mode is "tree" (default, host-rendered UITree).
type SurfaceMode ¶
type SurfaceOption ¶
type SurfaceSection ¶ added in v0.1.2
type SurfaceSection struct {
ID string `json:"id"`
Label string `json:"label,omitempty"`
Layout string `json:"layout"` // vertical, horizontal, wrap, grid, primary, tabs, collapsible, card, input_row
Columns int `json:"columns,omitempty"`
DefaultOpen bool `json:"default_open,omitempty"`
Fields []string `json:"fields,omitempty"`
Actions []string `json:"actions,omitempty"`
Groups []SurfaceSection `json:"groups,omitempty"`
}
SurfaceSection groups fields and actions into a declarative layout.
type ToolSurface ¶
type ToolSurface struct {
ID ToolID `json:"id"`
Live *SurfaceLive `json:"live,omitempty"`
Modes []SurfaceMode `json:"modes,omitempty"`
Sections []SurfaceSection `json:"sections,omitempty"`
Fields []SurfaceField `json:"fields"`
Actions []SurfaceAction `json:"actions"`
Helpers []SurfaceHelper `json:"helpers,omitempty"`
Settings []SurfaceField `json:"settings,omitempty"`
History *SurfaceHistory `json:"history,omitempty"`
}
type UIButtonProps ¶ added in v0.2.0
type UIButtonProps struct {
Label string `json:"label"`
Variant string `json:"variant,omitempty"` // "", "primary", "secondary", "danger", "ghost", "swatch", "success"
Action string `json:"action,omitempty"` // optional declared run action ID
Icon string `json:"icon,omitempty"` // optional registered icon name
IconOnly bool `json:"icon_only,omitempty"`
IconSize int `json:"icon_size,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
PaddingX int `json:"padding_x,omitempty"`
PaddingY int `json:"padding_y,omitempty"`
SwatchToken string `json:"swatch_token,omitempty"` // "", "ink", "blue_ink", "danger", "accent", "paper"
BorderToken string `json:"border_token,omitempty"`
BorderSize int `json:"border_size,omitempty"`
Selected bool `json:"selected,omitempty"`
FillWidth bool `json:"fill_width,omitempty"`
FillHeight bool `json:"fill_height,omitempty"`
Grow bool `json:"grow,omitempty"`
Tooltip string `json:"tooltip,omitempty"`
PickFile *UIFilePickerProps `json:"pick_file,omitempty"`
ShellAction string `json:"shell_action,omitempty"` // "", "reveal", "open"
ShellPath string `json:"shell_path,omitempty"`
HostAction string `json:"host_action,omitempty"` // "", "open_app_settings", "run_app_setting_action"
HostSettingKey string `json:"host_setting_key,omitempty"` // e.g. "pdfium_wasm_path"
DragPayload string `json:"drag_payload,omitempty"`
DragImage string `json:"drag_image,omitempty"`
DragW int `json:"drag_w,omitempty"`
DragH int `json:"drag_h,omitempty"`
Disabled bool `json:"disabled,omitempty"`
}
type UICanvasOp ¶ added in v0.2.0
type UICanvasOp struct {
Kind string `json:"kind"` // "rect", "line", "stroke_path", "image", "text"
Token string `json:"token,omitempty"` // "", "ink", "blue_ink", "muted", "paper", "ground", "accent", "field_support", "warning", "danger"
X float64 `json:"x,omitempty"`
Y float64 `json:"y,omitempty"`
W float64 `json:"w,omitempty"`
H float64 `json:"h,omitempty"`
Width float64 `json:"width,omitempty"`
Points []float64 `json:"points,omitempty"`
Src string `json:"src,omitempty"`
Text string `json:"text,omitempty"`
}
type UICanvasProps ¶ added in v0.2.0
type UICanvasProps struct {
Width int `json:"width"`
Height int `json:"height"`
Src string `json:"src,omitempty"` // optional background "asset:<name>"
Interactive bool `json:"interactive,omitempty"`
BrushToken string `json:"brush_token,omitempty"` // "", "ink", "blue_ink", "danger", "accent", "paper"
BrushWidth float64 `json:"brush_width,omitempty"`
Eraser bool `json:"eraser,omitempty"`
Surface string `json:"surface,omitempty"` // "", "paper", "ground"
BorderWidth int `json:"border_width,omitempty"`
BorderToken string `json:"border_token,omitempty"`
Shadow [2]int `json:"shadow,omitempty"`
DropTarget bool `json:"drop_target,omitempty"`
DropHighlight bool `json:"drop_highlight,omitempty"`
Clickable bool `json:"clickable,omitempty"`
Ops []UICanvasOp `json:"ops,omitempty"`
}
type UICloseParams ¶ added in v0.2.0
type UICloseParams struct {
Tool ToolID `json:"tool"`
}
func (UICloseParams) Validate ¶ added in v0.2.0
func (p UICloseParams) Validate() error
type UIContainerProps ¶ added in v0.2.0
type UIContainerProps struct {
Gap int `json:"gap,omitempty"`
Padding int `json:"padding,omitempty"`
PaddingV int `json:"padding_v,omitempty"`
PaddingH int `json:"padding_h,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
MinWidth int `json:"min_width,omitempty"`
MinHeight int `json:"min_height,omitempty"`
MaxWidth int `json:"max_width,omitempty"`
MaxHeight int `json:"max_height,omitempty"`
Wrap bool `json:"wrap,omitempty"`
Grow bool `json:"grow,omitempty"`
Fill bool `json:"fill,omitempty"`
FillHeight bool `json:"fill_height,omitempty"`
NoFillWidth bool `json:"no_fill_width,omitempty"`
Absolute bool `json:"absolute,omitempty"`
Left *float64 `json:"left,omitempty"`
Top *float64 `json:"top,omitempty"`
Right *float64 `json:"right,omitempty"`
Bottom *float64 `json:"bottom,omitempty"`
Justify string `json:"justify,omitempty"` // "", "start", "center", "end", "between"
Align string `json:"align,omitempty"` // "", "start", "center", "end", "stretch"
Surface string `json:"surface,omitempty"` // "", "ground", "paper", "field_support", "accent", "danger", "success"
Border bool `json:"border,omitempty"`
BorderSize int `json:"border_size,omitempty"`
BorderSides [4]int `json:"border_sides,omitempty"` // top, right, bottom, left
BorderToken string `json:"border_token,omitempty"` // "", "ink", "quiet", "accent", "danger", "success"
Shadow [2]int `json:"shadow,omitempty"`
Circle bool `json:"circle,omitempty"`
Radius int `json:"radius,omitempty"`
ScrollBoth bool `json:"scroll_both,omitempty"`
TrackScroll bool `json:"track_scroll,omitempty"`
ScrollTarget *UIScrollTarget `json:"scroll_target,omitempty"`
DropTarget bool `json:"drop_target,omitempty"`
DropHighlight bool `json:"drop_highlight,omitempty"`
Clickable bool `json:"clickable,omitempty"`
Shortcuts []string `json:"shortcuts,omitempty"`
Tooltip string `json:"tooltip,omitempty"`
}
type UIDialogProps ¶ added in v0.2.0
type UIDialogProps struct {
Title string `json:"title,omitempty"`
Subtitle string `json:"subtitle,omitempty"`
Open bool `json:"open"`
Width int `json:"width,omitempty"`
MaxWidth int `json:"max_width,omitempty"`
BorderWidth int `json:"border_width,omitempty"`
Shadow [2]int `json:"shadow,omitempty"`
Padding int `json:"padding,omitempty"`
}
type UIDirPickerProps ¶ added in v0.2.0
type UIDraggableProps ¶ added in v0.2.0
type UIDraggableProps struct {
X float64 `json:"x"`
Y float64 `json:"y"`
Width int `json:"width"`
Height int `json:"height"`
BoundW int `json:"bound_w,omitempty"`
BoundH int `json:"bound_h,omitempty"`
Selected bool `json:"selected,omitempty"`
Resizable bool `json:"resizable,omitempty"`
Handles string `json:"handles,omitempty"` // "", "se", "all", "none"
KeepAspect bool `json:"keep_aspect,omitempty"`
AspectRatio float64 `json:"aspect_ratio,omitempty"`
ShowLockBadge bool `json:"show_lock_badge,omitempty"`
Disabled bool `json:"disabled,omitempty"`
}
type UIEmptyProps ¶ added in v0.2.0
type UIEmptyProps struct {
Title string `json:"title"`
Subtitle string `json:"subtitle,omitempty"`
ActionLabel string `json:"action_label,omitempty"`
Icon string `json:"icon,omitempty"`
IconSize int `json:"icon_size,omitempty"`
Width int `json:"width,omitempty"`
BorderWidth int `json:"border_width,omitempty"`
Shadow [2]int `json:"shadow,omitempty"`
PickFile *UIFilePickerProps `json:"pick_file,omitempty"`
}
type UIEvent ¶ added in v0.2.0
type UIFilePickerProps ¶ added in v0.2.0
type UIIconProps ¶ added in v0.2.0
type UIImageProps ¶ added in v0.2.0
type UIImageProps struct {
Src string `json:"src"` // "asset:<relative-path>"
Fit string `json:"fit,omitempty"` // "", "contain", "cover"
Alt string `json:"alt,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
MaxWidth int `json:"max_width,omitempty"`
MaxHeight int `json:"max_height,omitempty"`
Grow bool `json:"grow,omitempty"`
}
type UIListProps ¶ added in v0.2.0
type UIOpenParams ¶ added in v0.2.0
type UIOpenParams struct {
Tool ToolID `json:"tool"`
Viewport UIViewport `json:"viewport"`
Lang string `json:"lang,omitempty"`
Theme string `json:"theme,omitempty"` // "light" or "dark"
Settings map[string]string `json:"settings,omitempty"`
}
func (UIOpenParams) Validate ¶ added in v0.2.0
func (p UIOpenParams) Validate() error
type UIProgressProps ¶ added in v0.2.0
type UIScrollTarget ¶ added in v0.2.0
type UISelectProps ¶ added in v0.2.0
type UISelectProps struct {
Label string `json:"label,omitempty"`
Value string `json:"value,omitempty"`
Options []SurfaceOption `json:"options"`
Disabled bool `json:"disabled,omitempty"`
}
type UISession ¶ added in v0.2.0
type UISession struct {
// contains filtered or unexported fields
}
UISession lets a LiveUI plugin push updated UI trees and locate its private asset directory ($MTOOLS_UI_ASSETS).
type UISliderProps ¶ added in v0.2.0
type UISliderProps struct {
Label string `json:"label,omitempty"`
Min float64 `json:"min"`
Max float64 `json:"max"`
Step float64 `json:"step,omitempty"`
Value float64 `json:"value"`
Width int `json:"width,omitempty"`
ValueScale float64 `json:"value_scale,omitempty"`
ValueSuffix string `json:"value_suffix,omitempty"`
Disabled bool `json:"disabled,omitempty"`
}
type UISplitProps ¶ added in v0.2.0
type UISplitProps struct {
Axis string `json:"axis,omitempty"` // "", "h", "v"
Size float32 `json:"size,omitempty"`
Min float32 `json:"min,omitempty"`
Max float32 `json:"max,omitempty"`
DefaultSize float32 `json:"default_size,omitempty"`
Collapsible bool `json:"collapsible,omitempty"`
Collapsed bool `json:"collapsed,omitempty"`
ResetOnDoubleClick bool `json:"reset_on_double_click,omitempty"`
}
type UITabsProps ¶ added in v0.2.0
type UITabsProps struct {
Active string `json:"active"`
Tabs []SurfaceOption `json:"tabs"`
}
type UITextInputProps ¶ added in v0.2.0
type UITextProps ¶ added in v0.2.0
type UITextProps struct {
Text string `json:"text"`
Variant string `json:"variant,omitempty"` // "", "title", "heading", "body", "muted", "accent", "danger", "success", "on_field"
FontSize int `json:"font_size,omitempty"`
FontWeight int `json:"font_weight,omitempty"`
Align string `json:"align,omitempty"` // "", "left", "center", "right"
SingleLine bool `json:"single_line,omitempty"`
TabularNums bool `json:"tabular_nums,omitempty"`
PaddingV int `json:"padding_v,omitempty"`
PaddingH int `json:"padding_h,omitempty"`
Tooltip string `json:"tooltip,omitempty"`
Grow bool `json:"grow,omitempty"`
}
type UIToggleProps ¶ added in v0.2.0
type UITree ¶ added in v0.2.0
func DecodeTree ¶ added in v0.2.0
DecodeTree decodes and validates a UITree payload from raw JSON bytes.