Documentation
¶
Overview ¶
Package uicompiler lowers KartUI UI sources into presentation assets and typed client bindings. It never evaluates user Go expressions during build.
Index ¶
- func DecodeSource(source string, data []byte) (ui.Template, error)
- func DecodeSourceWithTheme(source string, data []byte, theme Theme) (ui.Template, error)
- func ReadSource(directory, source string) ([]byte, error)
- type Binding
- type Component
- func Compile(source string, data []byte) (Component, error)
- func CompileWithTheme(source string, data []byte, theme Theme) (Component, error)
- func Load(directory string, entries []Source) ([]Component, error)
- func LoadProjectWithTheme(directory string, entries []Source, layoutEntries []LayoutSource, ...) ([]Component, error)
- func LoadWithTheme(directory string, entries []Source, themeSource string) ([]Component, error)
- type Layout
- type LayoutSource
- type Parameter
- type Source
- type Theme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeSource ¶
DecodeSource preserves legacy JSON assets while accepting the new authoring format. Only the canonical bounded asset is embedded; markup never ships loose.
func DecodeSourceWithTheme ¶
func ReadSource ¶
Types ¶
type Component ¶
type Component struct {
Name, Source, Asset string
Local bool
Composition, ChildFactory, Conditional bool
Setup, Preamble string
Back string
Parameters []Parameter
Bindings []Binding
Template ui.Template
// contains filtered or unexported fields
}
func Compile ¶
Compile accepts one KartUI component with optional Go imports/types and setup. Legacy exported scalar props remain supported; local models compile with the client.
func CompileWithTheme ¶
CompileWithTheme resolves style tokens into the bounded presentation asset.
func LoadProjectWithTheme ¶
func LoadProjectWithTheme( directory string, entries []Source, layoutEntries []LayoutSource, themeSource string, ) ([]Component, error)
LoadProjectWithTheme compiles runtime components after loading build-time layouts.
type Layout ¶
type Layout struct {
Name, Source, Style string
// contains filtered or unexported fields
}
Layout is a build-time-only reusable panel tree. Its markup and scoped style are projected into each consuming component; no layout lookup ships at runtime.
type LayoutSource ¶
type LayoutSource struct{ Source string }
LayoutSource identifies a build-time layout document.
type Source ¶
type Source struct{ Name, Source string }
Source identifies a named UI document without depending on a build tool.
type Theme ¶
Theme contains build-time tokens and resolved asset references. The host never parses authoring TOML or performs theme-token lookups.
func DefaultTheme ¶
func DefaultTheme() Theme
func ParseTheme ¶
ParseTheme accepts a bounded theme.toml with a built-in base and typed groups.
func (Theme) ImageNames ¶
ImageNames returns the statically referenced project textures in a theme.