FG UI 1.3 development

Public Theme API 1.3

Canonical context inspection and single-event integration lifecycle hooks.

PHASE 6
ACTIVE FG UI 1.3 DEVELOPMENT

FG UI 1.2.0 remains Stable. This page exercises additive 1.3 theme-composition work against the live /dev runtime.

FG UI 1.3 · Phase 6

Public Theme API + Events

Inspect the resolved semantic context and connect charts, maps, editors or other integrations without reaching into FG UI internals.

+0.0.7 COMPLETE

Resolved context

FGUI.theme.getContext(target) returns the target's effective Light/Dark mode, colour scheme, current Theme, Accent, site settings and a read-only copy of resolved semantic token values.

Dark integration target

Used by the automated API audit.

Canonical lifecycle event

fgui:theme-context-change is the one public appearance lifecycle event. Its detail contains a reason, monotonic sequence, target and fresh context snapshot.

The 1.3 clean-break contract intentionally removes the old Theme, Accent and package event aliases.

Subscribe

FGUI.theme.subscribe(callback) immediately supplies the current context and returns an unsubscribe function.

Use this for application-wide integrations that need one refresh whenever FGUI appearance changes.

Bind a widget

FGUI.theme.bind(target, callback) binds a specific chart, map or editor target. Each callback receives the target's freshly resolved local context.

Third-party widget target

Explicit local refresh

If application code changes local surface classes or attributes directly, call FGUI.theme.refreshContext(target, 'application'). This publishes the same unified event without exposing token mutation APIs.

Read-only integration boundary

The Phase 6 API exposes context snapshots and events. It does not make internal semantic tokens writable.

Documented event contract

Context lifecycle
FGUI.theme.events.contextChange → fgui:theme-context-change

Integration recipes

The same read-only context contract works across common third-party surfaces.

PUBLIC API ONLY

Chart adapter

Use semantic.surface, semantic.text, semantic.border and semantic.accent, then redraw.

Map adapter

Select a Light/Dark map style from context.mode and use the semantic Accent for controls.

Editor adapter

Synchronise editor scheme, background, text and selection without writing FGUI tokens.

7-step batch: +0.0.7 final checkpoint: public context inspection, lifecycle events, filtered subscriptions, integration bindings and documentation are complete.