Documentation
¶
Overview ¶
Package view defines shared declarative product-view definitions and rendering primitives for Facet Studio and its consumer products.
Layer 1 of view architecture:
- Primitive: rendering shapes (video, audio, markdown, slides, etc.)
- Card: host presentation of one artifact with provenance
- ViewDefinition: product-owned declarative workbench screens shared identically between standalone apps (F-APP, M-APP) and Studio module views (F-MOD, M-MOD).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionDefinition ¶
type ActionDefinition struct {
ID string `json:"id"`
Label string `json:"label"`
Tool string `json:"tool"`
InputTemplate map[string]any `json:"input_template,omitempty"`
RequiresApproval bool `json:"requires_approval,omitempty"`
KeyboardShortcut string `json:"keyboard_shortcut,omitempty"`
DisabledWhen string `json:"disabled_when,omitempty"`
}
ActionDefinition defines an explicit user action mapped to a product tool.
type Card ¶
type Card struct {
ArtifactID string `json:"artifact_id"`
Kind string `json:"kind"`
Module string `json:"module"`
Primitive Primitive `json:"primitive"`
MediaType string `json:"media_type"`
Bytes int64 `json:"bytes"`
Digest string `json:"digest"`
Title string `json:"title,omitempty"`
URL string `json:"url"`
Inline json.RawMessage `json:"inline,omitempty"`
}
Card is the host presentation of one artifact.
type Primitive ¶
type Primitive string
Primitive is a rendering shape the host UI knows how to draw.
const ( Video Primitive = "video" Audio Primitive = "audio" Image Primitive = "image" ImageGrid Primitive = "image_grid" Timeline Primitive = "timeline" Markdown Primitive = "markdown" Text Primitive = "text" JSON Primitive = "json" Document Primitive = "document" Diagram Primitive = "diagram" Slides Primitive = "slides" Table Primitive = "table" Download Primitive = "download" )
func FromMediaType ¶
FromMediaType maps a MIME content type to a standard rendering primitive.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages primitive activation state per user.
func (*Registry) SetEnabled ¶
SetEnabled toggles a primitive on or off.
type SectionDefinition ¶
type SectionDefinition struct {
ID string `json:"id"`
Title string `json:"title,omitempty"`
Type string `json:"type"` // "tab", "row", "col", "viewer", "card"
Primitive Primitive `json:"primitive,omitempty"`
Binding string `json:"binding,omitempty"` // json path into state or artifact
EmptyText string `json:"empty_text,omitempty"`
Children []SectionDefinition `json:"children,omitempty"`
}
SectionDefinition is a node in the view composition tree.
type ViewDefinition ¶
type ViewDefinition struct {
ID string `json:"id"`
SchemaVersion string `json:"schema_version"`
Title string `json:"title"`
Module string `json:"module"`
ArtifactSchema string `json:"artifact_schema,omitempty"`
Sections []SectionDefinition `json:"sections"`
Actions []ActionDefinition `json:"actions,omitempty"`
}
ViewDefinition is the shared declarative specification of a product workbench.
func (*ViewDefinition) Digest ¶
func (v *ViewDefinition) Digest() string
Digest returns the deterministic sha256: prefix digest of the canonical JSON definition. F-APP/F-MOD and M-APP/M-MOD use this to verify matching view definitions.