Documentation
¶
Index ¶
- Constants
- Variables
- type Platform
- func (p *Platform) Activate(moduleID string)
- func (p *Platform) IconSvg() *sprite.Sprite
- func (p *Platform) Init(ctx Ctx)
- func (p *Platform) Notify(t MessageType, msg string, durationMs int)
- func (p *Platform) Render() *Element
- func (p *Platform) RenderCSS() *css.Stylesheet
- func (p *Platform) WidgetKind() widget.Kind
- func (p *Platform) WidgetName() widget.Name
- type UIModule
Constants ¶
const ( IconHome = svg.Icon("home") IconProducts = svg.Icon("products") IconInfo = svg.Icon("info") )
const NamePlatform widget.Name = "pd"
Variables ¶
var (
)
Functions ¶
This section is empty.
Types ¶
type Platform ¶
type Platform struct {
Element
// AppName appears in the header (left side, near UserBlock).
AppName string
// UserBlock slot — the logged-in user (name/avatar), shown at the header LEFT.
UserBlock Component
// HeaderActions slot — shown at the header RIGHT, next to the work-area name
// (e.g. the light/dark theme toggle). Optional.
HeaderActions Component
// Modules registered in order — appearance order in the nav rail.
Modules []UIModule
// CanView filters which modules the shell presents. nil = show all.
CanView func(resource string) bool
// DefaultID is the ModelName() of the module to show initially.
// If empty, the first module is used.
DefaultID string
// contains filtered or unexported fields
}
Platform is the typed skeleton root.
func (*Platform) Activate ¶
Activate programmatically switches to a module by ID (also updates window.location.hash on wasm builds).
func (*Platform) IconSvg ¶ added in v0.0.5
IconSvg registers the default platform navigation icons. The full page sprite is the MERGE of every module's IconSvg() (platformd + crudview + components), assembled by tinywasm/ssr and injected inline in <body>.
func (*Platform) Init ¶ added in v0.0.6
func (p *Platform) Init(ctx Ctx)
Init initializes the platform state and routing.
func (*Platform) Notify ¶
Notify queues a typed notification in the proper viewport slot. Any non-zero durationMs → schedule dismissal; duration 0 → persistent message.
func (*Platform) Render ¶
func (p *Platform) Render() *Element
Render builds the DOM tree (implements ViewRenderer).
func (*Platform) RenderCSS ¶
func (p *Platform) RenderCSS() *css.Stylesheet
RenderCSS implements the visual contract for platformd using the style DSL.
func (*Platform) WidgetKind ¶ added in v0.0.23
func (*Platform) WidgetName ¶ added in v0.0.23
type UIModule ¶ added in v0.0.7
type UIModule interface {
layout.Module // identity: ModelName() → used as ID
Label() string // text in the nav rail
Icon() svg.Icon // chassis renders via the sprite
View() Component // module content (often a *rightpanel.RightPanel)
}
UIModule is a module that provides its UI to the platform chassis. The chassis takes id/hash/route from ModelName() and the rest of the presentation from these methods.