diff --git a/site/src/content/api/button-state.json b/site/src/content/api/button-state.json new file mode 100644 index 000000000..3ae7c6901 --- /dev/null +++ b/site/src/content/api/button-state.json @@ -0,0 +1,87 @@ +{ + "title": "ButtonState", + "description": "The states a button paints in.", + "symbol": "ButtonState", + "kind": "type", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 0, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 0, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "The states a button paints in." + ], + "importLine": "import { ButtonState } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "definition", + "title": "Definition", + "members": [ + { + "name": "ButtonState", + "signature": "\"disabled\" | \"hover\" | \"normal\" | \"pressed\"", + "signatureTokens": [ + { + "text": "\"disabled\"", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "\"hover\"", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "\"normal\"", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "\"pressed\"", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/Button.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/Button.ts" + } + } + ], + "sourcePath": "src/ui/Button.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/Button.ts" +} diff --git a/site/src/content/api/button.json b/site/src/content/api/button.json index a2aef64de..9d715c6fb 100644 --- a/site/src/content/api/button.json +++ b/site/src/content/api/button.json @@ -1,16 +1,16 @@ { "title": "Button", - "description": "Clickable button with a rounded background, a centered label, hover/pressed visual states, and keyboard activation (Enter / Space while focused). Listen to Button.onClick for activation.", + "description": "Clickable button with a rounded background, a centered label, hover/pressed visual states, and keyboard activation (Enter / Space while focused). Listen to Button.onClick for activation. The button paints the `button` role of its inherited theme, one skin per state. Constructor options and the setters below are per-button overrides on top of that skin.", "symbol": "Button", "kind": "class", "subsystem": "ui", "importPath": "@codexo/exojs", "tier": "stable", - "memberCount": 108, + "memberCount": 127, "counts": { "constructors": 1, - "methods": 46, - "properties": 46, + "methods": 60, + "properties": 51, "events": 15 }, "sections": [ @@ -19,7 +19,8 @@ "title": "Import", "members": [], "paragraphs": [ - "Clickable button with a rounded background, a centered label, hover/pressed visual states, and keyboard activation (Enter / Space while focused). Listen to Button.onClick for activation." + "Clickable button with a rounded background, a centered label, hover/pressed visual states, and keyboard activation (Enter / Space while focused). Listen to Button.onClick for activation.", + "The button paints the `button` role of its inherited theme, one skin per state. Constructor options and the setters below are per-button overrides on top of that skin." ], "importLine": "import { Button } from '@codexo/exojs'", "sourceLink": null @@ -152,6 +153,93 @@ "returnType": "void", "description": "" }, + { + "name": "_cascadeTheme", + "signature": "_cascadeTheme(): void", + "signatureTokens": [ + { + "text": "_cascadeTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Push a theme refresh into every themed descendant." + }, + { + "name": "_invalidateLayout", + "signature": "_invalidateLayout(): void", + "signatureTokens": [ + { + "text": "_invalidateLayout", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Re-lay out and repaint, then re-apply screen anchoring. This is the right invalidation for anything a skin's insets or a font size can move, and for every size change." + }, + { + "name": "_invalidatePaint", + "signature": "_invalidatePaint(): void", + "signatureTokens": [ + { + "text": "_invalidatePaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Repaint without re-laying out - for a change that cannot move anything, such as a colour or a state flip. Applied immediately, not batched." + }, { "name": "_onEnabledChanged", "signature": "_onEnabledChanged(effectiveEnabled: boolean): void", @@ -199,6 +287,35 @@ "returnType": "void", "description": "React to an effectiveEnabled change - fired whenever it flips, whether the widget's own enabled flag changed or an ancestor widget's did. Override in subclasses." }, + { + "name": "_onThemeChanged", + "signature": "_onThemeChanged(): void", + "signatureTokens": [ + { + "text": "_onThemeChanged", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "React to a resolved-theme change. The default re-lays out and repaints; override to re-read skin values that are cached elsewhere first, then call super._onThemeChanged()." + }, { "name": "_relayout", "signature": "_relayout(): void", @@ -226,7 +343,159 @@ ], "params": [], "returnType": "void", - "description": "Redraw size-dependent content (background, child positions). Override in subclasses." + "description": "Re-place size-dependent content and repaint. Override in subclasses that position children; call super._relayout() to keep the repaint." + }, + { + "name": "_repaint", + "signature": "_repaint(): void", + "signatureTokens": [ + { + "text": "_repaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Redraw this widget's own painted surfaces for the current size and skin. Override in subclasses that draw a background." + }, + { + "name": "_resolveInheritedTheme", + "signature": "_resolveInheritedTheme(): UITheme", + "signatureTokens": [ + { + "text": "_resolveInheritedTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": "UITheme", + "description": "The nearest themed ancestor's theme, or the built-in default when this node has none." + }, + { + "name": "_setSkinState", + "signature": "_setSkinState(state: UIWidgetState): void", + "signatureTokens": [ + { + "text": "_setSkinState", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "state", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [ + { + "name": "state", + "type": "UIWidgetState", + "optional": false + } + ], + "returnType": "void", + "description": "Switch the state skins resolve for, repainting when it actually changes." + }, + { + "name": "_skin", + "signature": "_skin(role: UIThemeRole): UISkin", + "signatureTokens": [ + { + "text": "_skin", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "role", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + } + ], + "params": [ + { + "name": "role", + "type": "UIThemeRole", + "optional": false + } + ], + "returnType": "UISkin", + "description": "The skin role paints with in this widget's current state." }, { "name": "[iterator]", @@ -546,17 +815,29 @@ "description": "Anchor this widget within root's screen box at anchor, offset by (offsetX, offsetY). The position is recomputed whenever the screen resizes. E.g. widget.anchorIn(scene.ui, 'bottom-right', -20, -20) pins it to the bottom-right corner with a 20px margin." }, { - "name": "blur", - "signature": "blur(): this", + "name": "backgroundIn", + "signature": "backgroundIn(state: UIWidgetState): UIBackground", "signatureTokens": [ { - "text": "blur", + "text": "backgroundIn", "kind": "name" }, { "text": "(", "kind": "punctuation" }, + { + "text": "state", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, { "text": ")", "kind": "punctuation" @@ -566,20 +847,26 @@ "kind": "punctuation" }, { - "text": "this", - "kind": "keyword" + "text": "UIBackground", + "kind": "type" } ], - "params": [], - "returnType": "this", - "description": "Release keyboard focus from this node if it currently holds it." + "params": [ + { + "name": "state", + "type": "UIWidgetState", + "optional": false + } + ], + "returnType": "UIBackground", + "description": "The background painted in state: this button's overrides over its skin." }, { - "name": "clearFilters", - "signature": "clearFilters(): this", + "name": "blur", + "signature": "blur(): this", "signatureTokens": [ { - "text": "clearFilters", + "text": "blur", "kind": "name" }, { @@ -601,7 +888,36 @@ ], "params": [], "returnType": "this", - "description": "" + "description": "Release keyboard focus from this node if it currently holds it." + }, + { + "name": "clearFilters", + "signature": "clearFilters(): this", + "signatureTokens": [ + { + "text": "clearFilters", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [], + "returnType": "this", + "description": "" }, { "name": "collidesWith", @@ -755,6 +1071,61 @@ "returnType": "void", "description": "Destroy this container and every node beneath it. Ownership is by containment: detaching a subtree only unlinks it, so the descendants' GPU-backed resources (cached textures, filters, render textures) and signal listeners would outlive the tree that owned them and leak on every scene change." }, + { + "name": "fillOverridesIn", + "signature": "fillOverridesIn(state: UIWidgetState): UIFillPatch | null", + "signatureTokens": [ + { + "text": "fillOverridesIn", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "state", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIFillPatch", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [ + { + "name": "state", + "type": "UIWidgetState", + "optional": false + } + ], + "returnType": "UIFillPatch | null", + "description": "The fill overrides carried for state, or null when it takes its skin as is." + }, { "name": "focus", "signature": "focus(): this", @@ -1422,11 +1793,435 @@ "kind": "name" }, { - "text": "(", + "text": "(", + "kind": "punctuation" + }, + { + "text": "index", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "index", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "removeChildren", + "signature": "removeChildren(begin: number, end: number): this", + "signatureTokens": [ + { + "text": "removeChildren", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "begin", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "end", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "begin", + "type": "number", + "optional": false + }, + { + "name": "end", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "Remove children in the half-open range [begin, end). Defaults to the entire child list. Throws if the range is invalid." + }, + { + "name": "removeFilter", + "signature": "removeFilter(filter: Filter): this", + "signatureTokens": [ + { + "text": "removeFilter", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "filter", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Filter", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "filter", + "type": "Filter", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "render", + "signature": "render(backend: RenderBackend): this", + "signatureTokens": [ + { + "text": "render", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "backend", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderBackend", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "backend", + "type": "RenderBackend", + "optional": false + } + ], + "returnType": "this", + "description": "Raw rendering entry point. Direct backend access - bypasses the RenderPlan pipeline machinery. Prefer the high-level RenderingContext.render path via the owning RenderingContext wherever possible." + }, + { + "name": "rotate", + "signature": "rotate(degrees: number): this", + "signatureTokens": [ + { + "text": "rotate", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "degrees", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "degrees", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "setBackground", + "signature": "setBackground(background: UIBackground | null, state: UIWidgetState): this", + "signatureTokens": [ + { + "text": "setBackground", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "background", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIBackground", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "state", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "background", + "type": "UIBackground | null", + "optional": false + }, + { + "name": "state", + "type": "UIWidgetState", + "optional": false + } + ], + "returnType": "this", + "description": "Replace one state's whole background descriptor; null restores the skin's." + }, + { + "name": "setChildIndex", + "signature": "setChildIndex(child: RenderNode, index: number): this", + "signatureTokens": [ + { + "text": "setChildIndex", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "child", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "index", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "child", + "type": "RenderNode", + "optional": false + }, + { + "name": "index", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "setFill", + "signature": "setFill(patch: UIFillPatch | null, state: UIWidgetState): this", + "signatureTokens": [ + { + "text": "setFill", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "patch", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIFillPatch", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": ", ", "kind": "punctuation" }, { - "text": "index", + "text": "state", "kind": "param" }, { @@ -1434,8 +2229,8 @@ "kind": "punctuation" }, { - "text": "number", - "kind": "keyword" + "text": "UIWidgetState", + "kind": "type" }, { "text": ")", @@ -1452,20 +2247,25 @@ ], "params": [ { - "name": "index", - "type": "number", + "name": "patch", + "type": "UIFillPatch | null", + "optional": false + }, + { + "name": "state", + "type": "UIWidgetState", "optional": false } ], "returnType": "this", - "description": "" + "description": "Override fill properties for one state on top of its skin. null drops that state's overrides." }, { - "name": "removeChildren", - "signature": "removeChildren(begin: number, end: number): this", + "name": "setOrigin", + "signature": "setOrigin(x: number, y: number): this", "signatureTokens": [ { - "text": "removeChildren", + "text": "setOrigin", "kind": "name" }, { @@ -1473,7 +2273,7 @@ "kind": "punctuation" }, { - "text": "begin", + "text": "x", "kind": "param" }, { @@ -1489,7 +2289,7 @@ "kind": "punctuation" }, { - "text": "end", + "text": "y", "kind": "param" }, { @@ -1515,25 +2315,25 @@ ], "params": [ { - "name": "begin", + "name": "x", "type": "number", "optional": false }, { - "name": "end", + "name": "y", "type": "number", "optional": false } ], "returnType": "this", - "description": "Remove children in the half-open range [begin, end). Defaults to the entire child list. Throws if the range is invalid." + "description": "" }, { - "name": "removeFilter", - "signature": "removeFilter(filter: Filter): this", + "name": "setPosition", + "signature": "setPosition(x: number, y: number): this", "signatureTokens": [ { - "text": "removeFilter", + "text": "setPosition", "kind": "name" }, { @@ -1541,7 +2341,7 @@ "kind": "punctuation" }, { - "text": "filter", + "text": "x", "kind": "param" }, { @@ -1549,46 +2349,15 @@ "kind": "punctuation" }, { - "text": "Filter", - "kind": "type" - }, - { - "text": ")", - "kind": "punctuation" - }, - { - "text": ": ", - "kind": "punctuation" - }, - { - "text": "this", + "text": "number", "kind": "keyword" - } - ], - "params": [ - { - "name": "filter", - "type": "Filter", - "optional": false - } - ], - "returnType": "this", - "description": "" - }, - { - "name": "render", - "signature": "render(backend: RenderBackend): this", - "signatureTokens": [ - { - "text": "render", - "kind": "name" }, { - "text": "(", + "text": ", ", "kind": "punctuation" }, { - "text": "backend", + "text": "y", "kind": "param" }, { @@ -1596,8 +2365,8 @@ "kind": "punctuation" }, { - "text": "RenderBackend", - "kind": "type" + "text": "number", + "kind": "keyword" }, { "text": ")", @@ -1614,20 +2383,25 @@ ], "params": [ { - "name": "backend", - "type": "RenderBackend", + "name": "x", + "type": "number", + "optional": false + }, + { + "name": "y", + "type": "number", "optional": false } ], "returnType": "this", - "description": "Raw rendering entry point. Direct backend access - bypasses the RenderPlan pipeline machinery. Prefer the high-level RenderingContext.render path via the owning RenderingContext wherever possible." + "description": "" }, { - "name": "rotate", - "signature": "rotate(degrees: number): this", + "name": "setRotation", + "signature": "setRotation(degrees: number): this", "signatureTokens": [ { - "text": "rotate", + "text": "setRotation", "kind": "name" }, { @@ -1670,11 +2444,11 @@ "description": "" }, { - "name": "setChildIndex", - "signature": "setChildIndex(child: RenderNode, index: number): this", + "name": "setScale", + "signature": "setScale(x: number, y: number): this", "signatureTokens": [ { - "text": "setChildIndex", + "text": "setScale", "kind": "name" }, { @@ -1682,7 +2456,7 @@ "kind": "punctuation" }, { - "text": "child", + "text": "x", "kind": "param" }, { @@ -1690,15 +2464,15 @@ "kind": "punctuation" }, { - "text": "RenderNode", - "kind": "type" + "text": "number", + "kind": "keyword" }, { "text": ", ", "kind": "punctuation" }, { - "text": "index", + "text": "y", "kind": "param" }, { @@ -1724,12 +2498,12 @@ ], "params": [ { - "name": "child", - "type": "RenderNode", + "name": "x", + "type": "number", "optional": false }, { - "name": "index", + "name": "y", "type": "number", "optional": false } @@ -1738,11 +2512,11 @@ "description": "" }, { - "name": "setOrigin", - "signature": "setOrigin(x: number, y: number): this", + "name": "setSize", + "signature": "setSize(width: number, height: number): this", "signatureTokens": [ { - "text": "setOrigin", + "text": "setSize", "kind": "name" }, { @@ -1750,7 +2524,7 @@ "kind": "punctuation" }, { - "text": "x", + "text": "width", "kind": "param" }, { @@ -1766,7 +2540,7 @@ "kind": "punctuation" }, { - "text": "y", + "text": "height", "kind": "param" }, { @@ -1792,25 +2566,25 @@ ], "params": [ { - "name": "x", + "name": "width", "type": "number", "optional": false }, { - "name": "y", + "name": "height", "type": "number", "optional": false } ], "returnType": "this", - "description": "" + "description": "Set the widget's layout size; triggers a redraw and re-anchors if anchored." }, { - "name": "setPosition", - "signature": "setPosition(x: number, y: number): this", + "name": "setSkew", + "signature": "setSkew(x: number, y: number): this", "signatureTokens": [ { - "text": "setPosition", + "text": "setSkew", "kind": "name" }, { @@ -1874,11 +2648,11 @@ "description": "" }, { - "name": "setRotation", - "signature": "setRotation(degrees: number): this", + "name": "setTextStyle", + "signature": "setTextStyle(style: TextStyleOptions | null): this", "signatureTokens": [ { - "text": "setRotation", + "text": "setTextStyle", "kind": "name" }, { @@ -1886,7 +2660,7 @@ "kind": "punctuation" }, { - "text": "degrees", + "text": "style", "kind": "param" }, { @@ -1894,7 +2668,15 @@ "kind": "punctuation" }, { - "text": "number", + "text": "TextStyleOptions", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", "kind": "keyword" }, { @@ -1912,20 +2694,20 @@ ], "params": [ { - "name": "degrees", - "type": "number", + "name": "style", + "type": "TextStyleOptions | null", "optional": false } ], "returnType": "this", - "description": "" + "description": "Override label text style on top of the skin's; null returns to it. Layout-invalidating - the label is re-measured and re-centered." }, { - "name": "setScale", - "signature": "setScale(x: number, y: number): this", + "name": "setTheme", + "signature": "setTheme(patch: Partial>>>>>> | null): this", "signatureTokens": [ { - "text": "setScale", + "text": "setTheme", "kind": "name" }, { @@ -1933,7 +2715,7 @@ "kind": "punctuation" }, { - "text": "x", + "text": "patch", "kind": "param" }, { @@ -1941,159 +2723,115 @@ "kind": "punctuation" }, { - "text": "number", - "kind": "keyword" + "text": "Partial", + "kind": "type" }, { - "text": ", ", + "text": "<", "kind": "punctuation" }, { - "text": "y", - "kind": "param" + "text": "Readonly", + "kind": "type" }, { - "text": ": ", + "text": "<", "kind": "punctuation" }, { - "text": "number", - "kind": "keyword" - }, - { - "text": ")", - "kind": "punctuation" + "text": "Record", + "kind": "type" }, { - "text": ": ", + "text": "<", "kind": "punctuation" }, { - "text": "this", - "kind": "keyword" - } - ], - "params": [ - { - "name": "x", - "type": "number", - "optional": false - }, - { - "name": "y", - "type": "number", - "optional": false - } - ], - "returnType": "this", - "description": "" - }, - { - "name": "setSize", - "signature": "setSize(width: number, height: number): this", - "signatureTokens": [ - { - "text": "setSize", - "kind": "name" + "text": "UIThemeRole", + "kind": "type" }, { - "text": "(", + "text": ", ", "kind": "punctuation" }, { - "text": "width", - "kind": "param" + "text": "Partial", + "kind": "type" }, { - "text": ": ", + "text": "<", "kind": "punctuation" }, { - "text": "number", - "kind": "keyword" + "text": "Readonly", + "kind": "type" }, { - "text": ", ", + "text": "<", "kind": "punctuation" }, { - "text": "height", - "kind": "param" + "text": "Record", + "kind": "type" }, { - "text": ": ", + "text": "<", "kind": "punctuation" }, { - "text": "number", - "kind": "keyword" - }, - { - "text": ")", - "kind": "punctuation" + "text": "UIWidgetState", + "kind": "type" }, { - "text": ": ", + "text": ", ", "kind": "punctuation" }, { - "text": "this", - "kind": "keyword" - } - ], - "params": [ - { - "name": "width", - "type": "number", - "optional": false - }, - { - "name": "height", - "type": "number", - "optional": false - } - ], - "returnType": "this", - "description": "Set the widget's layout size; triggers a redraw and re-anchors if anchored." - }, - { - "name": "setSkew", - "signature": "setSkew(x: number, y: number): this", - "signatureTokens": [ + "text": "Partial", + "kind": "type" + }, { - "text": "setSkew", - "kind": "name" + "text": "<", + "kind": "punctuation" }, { - "text": "(", + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", "kind": "punctuation" }, { - "text": "x", - "kind": "param" + "text": ">", + "kind": "punctuation" }, { - "text": ": ", + "text": ">", "kind": "punctuation" }, { - "text": "number", - "kind": "keyword" + "text": ">", + "kind": "punctuation" }, { - "text": ", ", + "text": ">", "kind": "punctuation" }, { - "text": "y", - "kind": "param" + "text": ">", + "kind": "punctuation" }, { - "text": ": ", + "text": ">", "kind": "punctuation" }, { - "text": "number", + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", "kind": "keyword" }, { @@ -2111,18 +2849,13 @@ ], "params": [ { - "name": "x", - "type": "number", - "optional": false - }, - { - "name": "y", - "type": "number", + "name": "patch", + "type": "Partial>>>>>> | null", "optional": false } ], "returnType": "this", - "description": "" + "description": "Override parts of the inherited theme for this widget and its descendants. null clears the override. Repaints and re-lays out every widget in the subtree that the change reaches - skin insets are layout input, so a theme change is never paint-only." }, { "name": "swapChildren", @@ -2682,7 +3415,7 @@ }, { "name": "colors", - "signature": "colors: Readonly>", + "signature": "colors: Readonly>", "signatureTokens": [ { "text": "colors", @@ -2709,41 +3442,25 @@ "kind": "punctuation" }, { - "text": "\"disabled\"", - "kind": "keyword" - }, - { - "text": " | ", - "kind": "punctuation" - }, - { - "text": "\"hover\"", - "kind": "keyword" + "text": "ButtonState", + "kind": "type" }, { - "text": " | ", + "text": ", ", "kind": "punctuation" }, { - "text": "\"normal\"", - "kind": "keyword" + "text": "Color", + "kind": "type" }, { "text": " | ", "kind": "punctuation" }, { - "text": "\"pressed\"", + "text": "null", "kind": "keyword" }, - { - "text": ", ", - "kind": "punctuation" - }, - { - "text": "Color", - "kind": "type" - }, { "text": ">", "kind": "punctuation" @@ -2755,7 +3472,7 @@ ], "params": [], "returnType": null, - "description": "The per-state fill colours (normal / hover / pressed / disabled)." + "description": "The per-state fill colours; null for a state that does not paint a fill." }, { "name": "cornerRadius", @@ -2776,7 +3493,7 @@ ], "params": [], "returnType": null, - "description": "Corner radius in pixels." + "description": "Corner radius in pixels of the normal state; 0 when it paints no fill." }, { "name": "cullable", @@ -3029,6 +3746,27 @@ "returnType": null, "description": "" }, + { + "name": "labelNode", + "signature": "labelNode: Text", + "signatureTokens": [ + { + "text": "labelNode", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Text", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The Text node drawing the label, for advanced styling." + }, { "name": "left", "signature": "left: number", @@ -3268,6 +4006,27 @@ "returnType": null, "description": "Vertical skew angle in degrees. Shears the node along the Y axis (positive values lean the left edge downward). Combines correctly with rotation and scale." }, + { + "name": "state", + "signature": "state: ButtonState", + "signatureTokens": [ + { + "text": "state", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "ButtonState", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The state the button currently paints in." + }, { "name": "textColor", "signature": "textColor: Color", @@ -3289,6 +4048,185 @@ "returnType": null, "description": "Label fill colour." }, + { + "name": "textStyleOverrides", + "signature": "textStyleOverrides: TextStyleOptions | null", + "signatureTokens": [ + { + "text": "textStyleOverrides", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "TextStyleOptions", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "The text-style overrides this button carries, or null when it takes the skin's." + }, + { + "name": "theme", + "signature": "theme: UITheme", + "signatureTokens": [ + { + "text": "theme", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The theme in effect for this node and everything below it." + }, + { + "name": "themeOverrides", + "signature": "themeOverrides: Partial>>>>>> | null", + "signatureTokens": [ + { + "text": "themeOverrides", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "This widget's own theme overrides, or null when it purely inherits." + }, { "name": "top", "signature": "top: number", diff --git a/site/src/content/api/functions.json b/site/src/content/api/functions.json index 5eacba124..d8dfd2fda 100644 --- a/site/src/content/api/functions.json +++ b/site/src/content/api/functions.json @@ -6,11 +6,11 @@ "subsystem": "core", "importPath": "@codexo/exojs", "tier": "stable", - "memberCount": 63, + "memberCount": 66, "counts": { "constructors": 0, - "methods": 34, - "properties": 29, + "methods": 36, + "properties": 30, "events": 0 }, "sections": [ @@ -549,6 +549,74 @@ "returnType": "GamepadMapping", "description": "Nintendo Switch Pro Controller over USB or Bluetooth. Index 17 is the Capture button (SWITCH_PRO_BUTTON_CAPTURE == BUTTON_INDEX_COUNT); Home maps to Guide, Minus/Plus to Select/Start. Some browsers only recognise the controller after it has been paired through Steam or a dedicated driver." }, + { + "name": "createUITheme", + "signature": "createUITheme(patch: UIThemePatch, base: UITheme): UITheme", + "signatureTokens": [ + { + "text": "createUITheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "patch", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIThemePatch", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "base", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [ + { + "name": "patch", + "type": "UIThemePatch", + "optional": false + }, + { + "name": "base", + "type": "UITheme", + "optional": false + } + ], + "returnType": "UITheme", + "description": "Resolve patch against base, role by role and state by state. Roles the patch does not name keep the base object itself, so an unchanged theme stays identical by reference - which is what makes a cascade refresh a pointer comparison rather than a deep diff." + }, { "name": "createXboxGamepadMapping", "signature": "createXboxGamepadMapping(): GamepadMapping", @@ -1672,6 +1740,74 @@ "returnType": "RenderStats", "description": "Advance the frame counter and zero all per-frame accumulators in place. Call once at the start of each render tick before recording new data. Note: RenderStats.gpuMemoryBytes is intentionally **not** reset here. It is a running total of live GPU resources owned by the backend's resource accountant, which persists across frames; zeroing it each tick would make it read 0 after the first frame." }, + { + "name": "resolveUISkin", + "signature": "resolveUISkin(set: UISkinSet, state: UIWidgetState): UISkin", + "signatureTokens": [ + { + "text": "resolveUISkin", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "set", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UISkinSet", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "state", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + } + ], + "params": [ + { + "name": "set", + "type": "UISkinSet", + "optional": false + }, + { + "name": "state", + "type": "UIWidgetState", + "optional": false + } + ], + "returnType": "UISkin", + "description": "The skin a state paints with, falling back to normal where undefined." + }, { "name": "serializeCacheRecordKey", "signature": "serializeCacheRecordKey(key: CacheRecordKey): string", @@ -2017,6 +2153,27 @@ "returnType": null, "description": "The built-in csv asset type." }, + { + "name": "defaultUITheme", + "signature": "defaultUITheme: UITheme", + "signatureTokens": [ + { + "text": "defaultUITheme", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The theme a UI layer uses until one is assigned. It reproduces the widgets' built-in look, so assigning a patch changes only what the patch names." + }, { "name": "fontType", "signature": "fontType: FontAssetType", diff --git a/site/src/content/api/label.json b/site/src/content/api/label.json index d720a112b..c234b8a1e 100644 --- a/site/src/content/api/label.json +++ b/site/src/content/api/label.json @@ -1,16 +1,16 @@ { "title": "Label", - "description": "Text label widget. Wraps a Text node and keeps the widget's layout size in sync with the measured text, so it anchors and stacks correctly.", + "description": "Text label widget. Wraps a Text node and keeps the widget's layout size in sync with the measured text, so it anchors and stacks correctly. The label takes its text style from the `label` role of its inherited theme; the constructor style and Label.setTextStyle override parts of it for this label only.", "symbol": "Label", "kind": "class", "subsystem": "ui", "importPath": "@codexo/exojs", "tier": "stable", - "memberCount": 104, + "memberCount": 117, "counts": { "constructors": 1, - "methods": 46, - "properties": 43, + "methods": 56, + "properties": 46, "events": 14 }, "sections": [ @@ -19,7 +19,8 @@ "title": "Import", "members": [], "paragraphs": [ - "Text label widget. Wraps a Text node and keeps the widget's layout size in sync with the measured text, so it anchors and stacks correctly." + "Text label widget. Wraps a Text node and keeps the widget's layout size in sync with the measured text, so it anchors and stacks correctly.", + "The label takes its text style from the `label` role of its inherited theme; the constructor style and Label.setTextStyle override parts of it for this label only." ], "importLine": "import { Label } from '@codexo/exojs'", "sourceLink": null @@ -173,6 +174,93 @@ "returnType": "void", "description": "" }, + { + "name": "_cascadeTheme", + "signature": "_cascadeTheme(): void", + "signatureTokens": [ + { + "text": "_cascadeTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Push a theme refresh into every themed descendant." + }, + { + "name": "_invalidateLayout", + "signature": "_invalidateLayout(): void", + "signatureTokens": [ + { + "text": "_invalidateLayout", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Re-lay out and repaint, then re-apply screen anchoring. This is the right invalidation for anything a skin's insets or a font size can move, and for every size change." + }, + { + "name": "_invalidatePaint", + "signature": "_invalidatePaint(): void", + "signatureTokens": [ + { + "text": "_invalidatePaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Repaint without re-laying out - for a change that cannot move anything, such as a colour or a state flip. Applied immediately, not batched." + }, { "name": "_onEnabledChanged", "signature": "_onEnabledChanged(_effectiveEnabled: boolean): void", @@ -220,6 +308,35 @@ "returnType": "void", "description": "React to an effectiveEnabled change - fired whenever it flips, whether the widget's own enabled flag changed or an ancestor widget's did. Override in subclasses." }, + { + "name": "_onThemeChanged", + "signature": "_onThemeChanged(): void", + "signatureTokens": [ + { + "text": "_onThemeChanged", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "React to a resolved-theme change. The default re-lays out and repaints; override to re-read skin values that are cached elsewhere first, then call super._onThemeChanged()." + }, { "name": "_relayout", "signature": "_relayout(): void", @@ -247,7 +364,159 @@ ], "params": [], "returnType": "void", - "description": "Redraw size-dependent content (background, child positions). Override in subclasses." + "description": "Re-place size-dependent content and repaint. Override in subclasses that position children; call super._relayout() to keep the repaint." + }, + { + "name": "_repaint", + "signature": "_repaint(): void", + "signatureTokens": [ + { + "text": "_repaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Redraw this widget's own painted surfaces for the current size and skin. Override in subclasses that draw a background." + }, + { + "name": "_resolveInheritedTheme", + "signature": "_resolveInheritedTheme(): UITheme", + "signatureTokens": [ + { + "text": "_resolveInheritedTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": "UITheme", + "description": "The nearest themed ancestor's theme, or the built-in default when this node has none." + }, + { + "name": "_setSkinState", + "signature": "_setSkinState(state: UIWidgetState): void", + "signatureTokens": [ + { + "text": "_setSkinState", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "state", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [ + { + "name": "state", + "type": "UIWidgetState", + "optional": false + } + ], + "returnType": "void", + "description": "Switch the state skins resolve for, repainting when it actually changes." + }, + { + "name": "_skin", + "signature": "_skin(role: UIThemeRole): UISkin", + "signatureTokens": [ + { + "text": "_skin", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "role", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + } + ], + "params": [ + { + "name": "role", + "type": "UIThemeRole", + "optional": false + } + ], + "returnType": "UISkin", + "description": "The skin role paints with in this widget's current state." }, { "name": "[iterator]", @@ -2146,11 +2415,11 @@ "description": "" }, { - "name": "swapChildren", - "signature": "swapChildren(firstChild: RenderNode, secondChild: RenderNode): this", + "name": "setTextStyle", + "signature": "setTextStyle(style: TextStyleOptions | null): this", "signatureTokens": [ { - "text": "swapChildren", + "text": "setTextStyle", "kind": "name" }, { @@ -2158,7 +2427,7 @@ "kind": "punctuation" }, { - "text": "firstChild", + "text": "style", "kind": "param" }, { @@ -2166,24 +2435,16 @@ "kind": "punctuation" }, { - "text": "RenderNode", + "text": "TextStyleOptions", "kind": "type" }, { - "text": ", ", - "kind": "punctuation" - }, - { - "text": "secondChild", - "kind": "param" - }, - { - "text": ": ", + "text": " | ", "kind": "punctuation" }, { - "text": "RenderNode", - "kind": "type" + "text": "null", + "kind": "keyword" }, { "text": ")", @@ -2200,22 +2461,240 @@ ], "params": [ { - "name": "firstChild", - "type": "RenderNode", - "optional": false - }, - { - "name": "secondChild", - "type": "RenderNode", + "name": "style", + "type": "TextStyleOptions | null", "optional": false } ], "returnType": "this", - "description": "" + "description": "Override text style on top of the skin's; null returns to it. The label is re-measured, so its layout size follows the new style." }, { - "name": "updateBounds", - "signature": "updateBounds(): this", + "name": "setTheme", + "signature": "setTheme(patch: Partial>>>>>> | null): this", + "signatureTokens": [ + { + "text": "setTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "patch", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "patch", + "type": "Partial>>>>>> | null", + "optional": false + } + ], + "returnType": "this", + "description": "Override parts of the inherited theme for this widget and its descendants. null clears the override. Repaints and re-lays out every widget in the subtree that the change reaches - skin insets are layout input, so a theme change is never paint-only." + }, + { + "name": "swapChildren", + "signature": "swapChildren(firstChild: RenderNode, secondChild: RenderNode): this", + "signatureTokens": [ + { + "text": "swapChildren", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "firstChild", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "secondChild", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "firstChild", + "type": "RenderNode", + "optional": false + }, + { + "name": "secondChild", + "type": "RenderNode", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "updateBounds", + "signature": "updateBounds(): this", "signatureTokens": [ { "text": "updateBounds", @@ -3191,6 +3670,185 @@ "returnType": null, "description": "The underlying Text node, for advanced styling." }, + { + "name": "textStyleOverrides", + "signature": "textStyleOverrides: TextStyleOptions | null", + "signatureTokens": [ + { + "text": "textStyleOverrides", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "TextStyleOptions", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "The text-style overrides this label carries, or null when it takes the skin's." + }, + { + "name": "theme", + "signature": "theme: UITheme", + "signatureTokens": [ + { + "text": "theme", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The theme in effect for this node and everything below it." + }, + { + "name": "themeOverrides", + "signature": "themeOverrides: Partial>>>>>> | null", + "signatureTokens": [ + { + "text": "themeOverrides", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "This widget's own theme overrides, or null when it purely inherits." + }, { "name": "top", "signature": "top: number", diff --git a/site/src/content/api/panel-options.json b/site/src/content/api/panel-options.json index 4130cd933..55d1bf986 100644 --- a/site/src/content/api/panel-options.json +++ b/site/src/content/api/panel-options.json @@ -6,11 +6,11 @@ "subsystem": "ui", "importPath": "@codexo/exojs", "tier": "stable", - "memberCount": 6, + "memberCount": 7, "counts": { "constructors": 0, "methods": 0, - "properties": 6, + "properties": 7, "events": 0 }, "sections": [ @@ -26,6 +26,31 @@ "id": "properties", "title": "Properties", "members": [ + { + "name": "background", + "signature": "background?: UIBackground", + "signatureTokens": [ + { + "text": "background", + "kind": "name" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIBackground", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "Whole-background override, e.g. a nine-slice skin, replacing the theme's." + }, { "name": "borderColor", "signature": "borderColor?: Color", @@ -49,7 +74,7 @@ ], "params": [], "returnType": null, - "description": "Border color (only drawn when borderWidth > 0)." + "description": "Border color override (only drawn when borderWidth > 0)." }, { "name": "borderWidth", @@ -99,7 +124,7 @@ ], "params": [], "returnType": null, - "description": "Fill color. Default: a translucent dark slate." + "description": "Fill color override. Default: the theme's panel fill." }, { "name": "cornerRadius", diff --git a/site/src/content/api/panel.json b/site/src/content/api/panel.json index cc8bb36b8..5a22b0d8c 100644 --- a/site/src/content/api/panel.json +++ b/site/src/content/api/panel.json @@ -1,16 +1,16 @@ { "title": "Panel", - "description": "Rectangular background container with rounded corners and an optional border. The base building block for HUD boxes, dialogs, and menus - add content with `panel.addChild(...)`.", + "description": "Rectangular background container with rounded corners and an optional border. The base building block for HUD boxes, dialogs, and menus - add content with `panel.addChild(...)`. The panel paints the `panel` role of its inherited theme. Constructor options and the setters below are per-panel overrides on top of it; each one repaints immediately.", "symbol": "Panel", "kind": "class", "subsystem": "ui", "importPath": "@codexo/exojs", "tier": "stable", - "memberCount": 107, + "memberCount": 122, "counts": { "constructors": 1, - "methods": 46, - "properties": 46, + "methods": 57, + "properties": 50, "events": 14 }, "sections": [ @@ -19,7 +19,8 @@ "title": "Import", "members": [], "paragraphs": [ - "Rectangular background container with rounded corners and an optional border. The base building block for HUD boxes, dialogs, and menus - add content with `panel.addChild(...)`." + "Rectangular background container with rounded corners and an optional border. The base building block for HUD boxes, dialogs, and menus - add content with `panel.addChild(...)`.", + "The panel paints the `panel` role of its inherited theme. Constructor options and the setters below are per-panel overrides on top of it; each one repaints immediately." ], "importLine": "import { Panel } from '@codexo/exojs'", "sourceLink": null @@ -152,6 +153,93 @@ "returnType": "void", "description": "" }, + { + "name": "_cascadeTheme", + "signature": "_cascadeTheme(): void", + "signatureTokens": [ + { + "text": "_cascadeTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Push a theme refresh into every themed descendant." + }, + { + "name": "_invalidateLayout", + "signature": "_invalidateLayout(): void", + "signatureTokens": [ + { + "text": "_invalidateLayout", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Re-lay out and repaint, then re-apply screen anchoring. This is the right invalidation for anything a skin's insets or a font size can move, and for every size change." + }, + { + "name": "_invalidatePaint", + "signature": "_invalidatePaint(): void", + "signatureTokens": [ + { + "text": "_invalidatePaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Repaint without re-laying out - for a change that cannot move anything, such as a colour or a state flip. Applied immediately, not batched." + }, { "name": "_onEnabledChanged", "signature": "_onEnabledChanged(_effectiveEnabled: boolean): void", @@ -199,6 +287,35 @@ "returnType": "void", "description": "React to an effectiveEnabled change - fired whenever it flips, whether the widget's own enabled flag changed or an ancestor widget's did. Override in subclasses." }, + { + "name": "_onThemeChanged", + "signature": "_onThemeChanged(): void", + "signatureTokens": [ + { + "text": "_onThemeChanged", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "React to a resolved-theme change. The default re-lays out and repaints; override to re-read skin values that are cached elsewhere first, then call super._onThemeChanged()." + }, { "name": "_relayout", "signature": "_relayout(): void", @@ -226,7 +343,159 @@ ], "params": [], "returnType": "void", - "description": "Redraw size-dependent content (background, child positions). Override in subclasses." + "description": "Re-place size-dependent content and repaint. Override in subclasses that position children; call super._relayout() to keep the repaint." + }, + { + "name": "_repaint", + "signature": "_repaint(): void", + "signatureTokens": [ + { + "text": "_repaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Redraw this widget's own painted surfaces for the current size and skin. Override in subclasses that draw a background." + }, + { + "name": "_resolveInheritedTheme", + "signature": "_resolveInheritedTheme(): UITheme", + "signatureTokens": [ + { + "text": "_resolveInheritedTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": "UITheme", + "description": "The nearest themed ancestor's theme, or the built-in default when this node has none." + }, + { + "name": "_setSkinState", + "signature": "_setSkinState(state: UIWidgetState): void", + "signatureTokens": [ + { + "text": "_setSkinState", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "state", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [ + { + "name": "state", + "type": "UIWidgetState", + "optional": false + } + ], + "returnType": "void", + "description": "Switch the state skins resolve for, repainting when it actually changes." + }, + { + "name": "_skin", + "signature": "_skin(role: UIThemeRole): UISkin", + "signatureTokens": [ + { + "text": "_skin", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "role", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + } + ], + "params": [ + { + "name": "role", + "type": "UIThemeRole", + "optional": false + } + ], + "returnType": "UISkin", + "description": "The skin role paints with in this widget's current state." }, { "name": "[iterator]", @@ -1670,11 +1939,11 @@ "description": "" }, { - "name": "setChildIndex", - "signature": "setChildIndex(child: RenderNode, index: number): this", + "name": "setBackground", + "signature": "setBackground(background: UIBackground | null): this", "signatureTokens": [ { - "text": "setChildIndex", + "text": "setBackground", "kind": "name" }, { @@ -1682,7 +1951,7 @@ "kind": "punctuation" }, { - "text": "child", + "text": "background", "kind": "param" }, { @@ -1690,23 +1959,15 @@ "kind": "punctuation" }, { - "text": "RenderNode", + "text": "UIBackground", "kind": "type" }, { - "text": ", ", - "kind": "punctuation" - }, - { - "text": "index", - "kind": "param" - }, - { - "text": ": ", + "text": " | ", "kind": "punctuation" }, { - "text": "number", + "text": "null", "kind": "keyword" }, { @@ -1724,25 +1985,143 @@ ], "params": [ { - "name": "child", - "type": "RenderNode", - "optional": false - }, - { - "name": "index", - "type": "number", + "name": "background", + "type": "UIBackground | null", "optional": false } ], "returnType": "this", - "description": "" + "description": "Replace the whole background descriptor, ignoring the skin's. null restores it. Layout-invalidating: a nine-slice and a fill can imply different content boxes." }, { - "name": "setOrigin", - "signature": "setOrigin(x: number, y: number): this", + "name": "setChildIndex", + "signature": "setChildIndex(child: RenderNode, index: number): this", "signatureTokens": [ { - "text": "setOrigin", + "text": "setChildIndex", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "child", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "index", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "child", + "type": "RenderNode", + "optional": false + }, + { + "name": "index", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "setFill", + "signature": "setFill(patch: UIFillPatch | null): this", + "signatureTokens": [ + { + "text": "setFill", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "patch", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIFillPatch", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "patch", + "type": "UIFillPatch | null", + "optional": false + } + ], + "returnType": "this", + "description": "Override fill properties on top of the skin. Overriding a colour on a panel whose skin paints a texture switches it to a fill. Passing null drops the overrides and returns the panel to its skin." + }, + { + "name": "setOrigin", + "signature": "setOrigin(x: number, y: number): this", + "signatureTokens": [ + { + "text": "setOrigin", "kind": "name" }, { @@ -2124,6 +2503,161 @@ "returnType": "this", "description": "" }, + { + "name": "setTheme", + "signature": "setTheme(patch: Partial>>>>>> | null): this", + "signatureTokens": [ + { + "text": "setTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "patch", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "patch", + "type": "Partial>>>>>> | null", + "optional": false + } + ], + "returnType": "this", + "description": "Override parts of the inherited theme for this widget and its descendants. null clears the override. Repaints and re-lays out every widget in the subtree that the change reaches - skin insets are layout input, so a theme change is never paint-only." + }, { "name": "swapChildren", "signature": "swapChildren(firstChild: RenderNode, secondChild: RenderNode): this", @@ -2528,7 +3062,7 @@ }, { "name": "background", - "signature": "background: Graphics", + "signature": "background: UIBackground", "signatureTokens": [ { "text": "background", @@ -2538,18 +3072,55 @@ "text": ": ", "kind": "punctuation" }, + { + "text": "UIBackground", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The background actually painted: this panel's overrides over its skin." + }, + { + "name": "backgroundNode", + "signature": "backgroundNode: Graphics | NineSliceSprite | null", + "signatureTokens": [ + { + "text": "backgroundNode", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, { "text": "Graphics", "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "NineSliceSprite", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" } ], "params": [], "returnType": null, - "description": "The background Graphics, for advanced customization." + "description": "The node painting the background, or null while it paints nothing." }, { "name": "borderColor", - "signature": "borderColor: Color", + "signature": "borderColor: Color | null", "signatureTokens": [ { "text": "borderColor", @@ -2562,11 +3133,19 @@ { "text": "Color", "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" } ], "params": [], "returnType": null, - "description": "Border colour (drawn only when borderWidth is greater than 0)." + "description": "Border colour, or null when the panel does not paint a fill." }, { "name": "borderWidth", @@ -2587,7 +3166,7 @@ ], "params": [], "returnType": null, - "description": "Border thickness in pixels." + "description": "Border thickness in pixels; 0 when the panel does not paint a fill." }, { "name": "bottom", @@ -2745,7 +3324,7 @@ }, { "name": "color", - "signature": "color: Color", + "signature": "color: Color | null", "signatureTokens": [ { "text": "color", @@ -2758,11 +3337,19 @@ { "text": "Color", "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" } ], "params": [], "returnType": null, - "description": "Fill colour." + "description": "Fill colour, or null when the panel does not paint a fill." }, { "name": "cornerRadius", @@ -2783,7 +3370,7 @@ ], "params": [], "returnType": null, - "description": "Corner radius in pixels." + "description": "Corner radius in pixels; 0 when the panel does not paint a fill." }, { "name": "cullable", @@ -2898,6 +3485,35 @@ "returnType": null, "description": "The widget's own enabled flag, independent of any ancestor's. Disabling a container widget does not change this on its children - see effectiveEnabled for the value interaction and keyboard focus actually consult, and for what disabling a container does to them." }, + { + "name": "fillOverrides", + "signature": "fillOverrides: UIFillPatch | null", + "signatureTokens": [ + { + "text": "fillOverrides", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIFillPatch", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "The fill overrides this panel carries, or null when it takes its skin as is." + }, { "name": "filters", "signature": "filters: readonly Filter[]", @@ -3233,6 +3849,156 @@ "returnType": null, "description": "Vertical skew angle in degrees. Shears the node along the Y axis (positive values lean the left edge downward). Combines correctly with rotation and scale." }, + { + "name": "theme", + "signature": "theme: UITheme", + "signatureTokens": [ + { + "text": "theme", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The theme in effect for this node and everything below it." + }, + { + "name": "themeOverrides", + "signature": "themeOverrides: Partial>>>>>> | null", + "signatureTokens": [ + { + "text": "themeOverrides", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "This widget's own theme overrides, or null when it purely inherits." + }, { "name": "top", "signature": "top: number", diff --git a/site/src/content/api/progress-bar.json b/site/src/content/api/progress-bar.json index f1556a7c9..cc23ebb5e 100644 --- a/site/src/content/api/progress-bar.json +++ b/site/src/content/api/progress-bar.json @@ -1,16 +1,16 @@ { "title": "ProgressBar", - "description": "Horizontal progress / health bar. ProgressBar.value is the fill fraction in `[0, 1]`; setting it redraws only the fill.", + "description": "Horizontal progress / health bar. ProgressBar.value is the fill fraction in `[0, 1]`; setting it redraws only the bar. The two surfaces are themed independently: the groove paints the `progressBarTrack` role, the bar `progressBarFill`.", "symbol": "ProgressBar", "kind": "class", "subsystem": "ui", "importPath": "@codexo/exojs", "tier": "stable", - "memberCount": 106, + "memberCount": 124, "counts": { "constructors": 1, - "methods": 46, - "properties": 45, + "methods": 59, + "properties": 50, "events": 14 }, "sections": [ @@ -19,7 +19,8 @@ "title": "Import", "members": [], "paragraphs": [ - "Horizontal progress / health bar. ProgressBar.value is the fill fraction in `[0, 1]`; setting it redraws only the fill." + "Horizontal progress / health bar. ProgressBar.value is the fill fraction in `[0, 1]`; setting it redraws only the bar.", + "The two surfaces are themed independently: the groove paints the `progressBarTrack` role, the bar `progressBarFill`." ], "importLine": "import { ProgressBar } from '@codexo/exojs'", "sourceLink": null @@ -152,6 +153,93 @@ "returnType": "void", "description": "" }, + { + "name": "_cascadeTheme", + "signature": "_cascadeTheme(): void", + "signatureTokens": [ + { + "text": "_cascadeTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Push a theme refresh into every themed descendant." + }, + { + "name": "_invalidateLayout", + "signature": "_invalidateLayout(): void", + "signatureTokens": [ + { + "text": "_invalidateLayout", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Re-lay out and repaint, then re-apply screen anchoring. This is the right invalidation for anything a skin's insets or a font size can move, and for every size change." + }, + { + "name": "_invalidatePaint", + "signature": "_invalidatePaint(): void", + "signatureTokens": [ + { + "text": "_invalidatePaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Repaint without re-laying out - for a change that cannot move anything, such as a colour or a state flip. Applied immediately, not batched." + }, { "name": "_onEnabledChanged", "signature": "_onEnabledChanged(_effectiveEnabled: boolean): void", @@ -199,6 +287,35 @@ "returnType": "void", "description": "React to an effectiveEnabled change - fired whenever it flips, whether the widget's own enabled flag changed or an ancestor widget's did. Override in subclasses." }, + { + "name": "_onThemeChanged", + "signature": "_onThemeChanged(): void", + "signatureTokens": [ + { + "text": "_onThemeChanged", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "React to a resolved-theme change. The default re-lays out and repaints; override to re-read skin values that are cached elsewhere first, then call super._onThemeChanged()." + }, { "name": "_relayout", "signature": "_relayout(): void", @@ -226,7 +343,159 @@ ], "params": [], "returnType": "void", - "description": "Redraw size-dependent content (background, child positions). Override in subclasses." + "description": "Re-place size-dependent content and repaint. Override in subclasses that position children; call super._relayout() to keep the repaint." + }, + { + "name": "_repaint", + "signature": "_repaint(): void", + "signatureTokens": [ + { + "text": "_repaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Redraw this widget's own painted surfaces for the current size and skin. Override in subclasses that draw a background." + }, + { + "name": "_resolveInheritedTheme", + "signature": "_resolveInheritedTheme(): UITheme", + "signatureTokens": [ + { + "text": "_resolveInheritedTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": "UITheme", + "description": "The nearest themed ancestor's theme, or the built-in default when this node has none." + }, + { + "name": "_setSkinState", + "signature": "_setSkinState(state: UIWidgetState): void", + "signatureTokens": [ + { + "text": "_setSkinState", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "state", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [ + { + "name": "state", + "type": "UIWidgetState", + "optional": false + } + ], + "returnType": "void", + "description": "Switch the state skins resolve for, repainting when it actually changes." + }, + { + "name": "_skin", + "signature": "_skin(role: UIThemeRole): UISkin", + "signatureTokens": [ + { + "text": "_skin", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "role", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + } + ], + "params": [ + { + "name": "role", + "type": "UIThemeRole", + "optional": false + } + ], + "returnType": "UISkin", + "description": "The skin role paints with in this widget's current state." }, { "name": "[iterator]", @@ -1670,11 +1939,11 @@ "description": "" }, { - "name": "setChildIndex", - "signature": "setChildIndex(child: RenderNode, index: number): this", + "name": "setBarBackground", + "signature": "setBarBackground(background: UIBackground | null): this", "signatureTokens": [ { - "text": "setChildIndex", + "text": "setBarBackground", "kind": "name" }, { @@ -1682,7 +1951,7 @@ "kind": "punctuation" }, { - "text": "child", + "text": "background", "kind": "param" }, { @@ -1690,23 +1959,15 @@ "kind": "punctuation" }, { - "text": "RenderNode", + "text": "UIBackground", "kind": "type" }, { - "text": ", ", - "kind": "punctuation" - }, - { - "text": "index", - "kind": "param" - }, - { - "text": ": ", + "text": " | ", "kind": "punctuation" }, { - "text": "number", + "text": "null", "kind": "keyword" }, { @@ -1724,25 +1985,20 @@ ], "params": [ { - "name": "child", - "type": "RenderNode", - "optional": false - }, - { - "name": "index", - "type": "number", + "name": "background", + "type": "UIBackground | null", "optional": false } ], "returnType": "this", - "description": "" + "description": "Replace the bar's whole background descriptor; null restores the skin's." }, { - "name": "setOrigin", - "signature": "setOrigin(x: number, y: number): this", + "name": "setBarFill", + "signature": "setBarFill(patch: UIFillPatch | null): this", "signatureTokens": [ { - "text": "setOrigin", + "text": "setBarFill", "kind": "name" }, { @@ -1750,7 +2006,7 @@ "kind": "punctuation" }, { - "text": "x", + "text": "patch", "kind": "param" }, { @@ -1758,8 +2014,131 @@ "kind": "punctuation" }, { - "text": "number", - "kind": "keyword" + "text": "UIFillPatch", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "patch", + "type": "UIFillPatch | null", + "optional": false + } + ], + "returnType": "this", + "description": "Override fill properties of the bar on top of its skin; null drops them." + }, + { + "name": "setChildIndex", + "signature": "setChildIndex(child: RenderNode, index: number): this", + "signatureTokens": [ + { + "text": "setChildIndex", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "child", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "index", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "child", + "type": "RenderNode", + "optional": false + }, + { + "name": "index", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "setOrigin", + "signature": "setOrigin(x: number, y: number): this", + "signatureTokens": [ + { + "text": "setOrigin", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" }, { "text": ", ", @@ -2085,7 +2464,269 @@ "kind": "punctuation" }, { - "text": "y", + "text": "y", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "x", + "type": "number", + "optional": false + }, + { + "name": "y", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "setTheme", + "signature": "setTheme(patch: Partial>>>>>> | null): this", + "signatureTokens": [ + { + "text": "setTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "patch", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "patch", + "type": "Partial>>>>>> | null", + "optional": false + } + ], + "returnType": "this", + "description": "Override parts of the inherited theme for this widget and its descendants. null clears the override. Repaints and re-lays out every widget in the subtree that the change reaches - skin insets are layout input, so a theme change is never paint-only." + }, + { + "name": "setTrackBackground", + "signature": "setTrackBackground(background: UIBackground | null): this", + "signatureTokens": [ + { + "text": "setTrackBackground", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "background", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIBackground", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "background", + "type": "UIBackground | null", + "optional": false + } + ], + "returnType": "this", + "description": "Replace the track's whole background descriptor; null restores the skin's." + }, + { + "name": "setTrackFill", + "signature": "setTrackFill(patch: UIFillPatch | null): this", + "signatureTokens": [ + { + "text": "setTrackFill", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "patch", "kind": "param" }, { @@ -2093,7 +2734,15 @@ "kind": "punctuation" }, { - "text": "number", + "text": "UIFillPatch", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", "kind": "keyword" }, { @@ -2111,18 +2760,13 @@ ], "params": [ { - "name": "x", - "type": "number", - "optional": false - }, - { - "name": "y", - "type": "number", + "name": "patch", + "type": "UIFillPatch | null", "optional": false } ], "returnType": "this", - "description": "" + "description": "Override fill properties of the track on top of its skin; null drops them." }, { "name": "swapChildren", @@ -2526,6 +3170,27 @@ "returnType": null, "description": "Tab-traversal order among focusable nodes in the same focus scope. Lower values are visited first; equal values keep document (tree) order." }, + { + "name": "barBackground", + "signature": "barBackground: UIBackground", + "signatureTokens": [ + { + "text": "barBackground", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIBackground", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The background painted for the filled portion." + }, { "name": "bottom", "signature": "bottom: number", @@ -2699,7 +3364,7 @@ ], "params": [], "returnType": null, - "description": "Corner radius in pixels." + "description": "Corner radius in pixels of the track; 0 when it paints no fill." }, { "name": "cullable", @@ -2816,7 +3481,7 @@ }, { "name": "fillColor", - "signature": "fillColor: Color", + "signature": "fillColor: Color | null", "signatureTokens": [ { "text": "fillColor", @@ -2829,11 +3494,88 @@ { "text": "Color", "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Bar colour, or null when the bar does not paint a fill." + }, + { + "name": "fillOverrides", + "signature": "fillOverrides: { bar: UIFillPatch | null; track: UIFillPatch | null }", + "signatureTokens": [ + { + "text": "fillOverrides", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "{ ", + "kind": "punctuation" + }, + { + "text": "bar", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIFillPatch", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": "; ", + "kind": "punctuation" + }, + { + "text": "track", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIFillPatch", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": " }", + "kind": "punctuation" } ], "params": [], "returnType": null, - "description": "Fill (foreground) colour." + "description": "The fill overrides carried by the track and the bar, null where none." }, { "name": "filters", @@ -3170,6 +3912,156 @@ "returnType": null, "description": "Vertical skew angle in degrees. Shears the node along the Y axis (positive values lean the left edge downward). Combines correctly with rotation and scale." }, + { + "name": "theme", + "signature": "theme: UITheme", + "signatureTokens": [ + { + "text": "theme", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The theme in effect for this node and everything below it." + }, + { + "name": "themeOverrides", + "signature": "themeOverrides: Partial>>>>>> | null", + "signatureTokens": [ + { + "text": "themeOverrides", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "This widget's own theme overrides, or null when it purely inherits." + }, { "name": "top", "signature": "top: number", @@ -3191,9 +4083,30 @@ "returnType": null, "description": "Topmost edge of the subtree - see left." }, + { + "name": "trackBackground", + "signature": "trackBackground: UIBackground", + "signatureTokens": [ + { + "text": "trackBackground", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIBackground", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The background painted behind the bar." + }, { "name": "trackColor", - "signature": "trackColor: Color", + "signature": "trackColor: Color | null", "signatureTokens": [ { "text": "trackColor", @@ -3206,11 +4119,19 @@ { "text": "Color", "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" } ], "params": [], "returnType": null, - "description": "Track (background) colour." + "description": "Track colour, or null when the track does not paint a fill." }, { "name": "uiHeight", diff --git a/site/src/content/api/scroll-container.json b/site/src/content/api/scroll-container.json index cb6fac942..c23ead804 100644 --- a/site/src/content/api/scroll-container.json +++ b/site/src/content/api/scroll-container.json @@ -6,11 +6,11 @@ "subsystem": "ui", "importPath": "@codexo/exojs", "tier": "stable", - "memberCount": 108, + "memberCount": 119, "counts": { "constructors": 1, - "methods": 48, - "properties": 45, + "methods": 57, + "properties": 47, "events": 14 }, "sections": [ @@ -154,6 +154,93 @@ "returnType": "void", "description": "" }, + { + "name": "_cascadeTheme", + "signature": "_cascadeTheme(): void", + "signatureTokens": [ + { + "text": "_cascadeTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Push a theme refresh into every themed descendant." + }, + { + "name": "_invalidateLayout", + "signature": "_invalidateLayout(): void", + "signatureTokens": [ + { + "text": "_invalidateLayout", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Re-lay out and repaint, then re-apply screen anchoring. This is the right invalidation for anything a skin's insets or a font size can move, and for every size change." + }, + { + "name": "_invalidatePaint", + "signature": "_invalidatePaint(): void", + "signatureTokens": [ + { + "text": "_invalidatePaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Repaint without re-laying out - for a change that cannot move anything, such as a colour or a state flip. Applied immediately, not batched." + }, { "name": "_onEnabledChanged", "signature": "_onEnabledChanged(_effectiveEnabled: boolean): void", @@ -201,6 +288,35 @@ "returnType": "void", "description": "React to an effectiveEnabled change - fired whenever it flips, whether the widget's own enabled flag changed or an ancestor widget's did. Override in subclasses." }, + { + "name": "_onThemeChanged", + "signature": "_onThemeChanged(): void", + "signatureTokens": [ + { + "text": "_onThemeChanged", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "React to a resolved-theme change. The default re-lays out and repaints; override to re-read skin values that are cached elsewhere first, then call super._onThemeChanged()." + }, { "name": "_relayout", "signature": "_relayout(): void", @@ -228,7 +344,159 @@ ], "params": [], "returnType": "void", - "description": "Redraw size-dependent content (background, child positions). Override in subclasses." + "description": "Re-place size-dependent content and repaint. Override in subclasses that position children; call super._relayout() to keep the repaint." + }, + { + "name": "_repaint", + "signature": "_repaint(): void", + "signatureTokens": [ + { + "text": "_repaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Redraw this widget's own painted surfaces for the current size and skin. Override in subclasses that draw a background." + }, + { + "name": "_resolveInheritedTheme", + "signature": "_resolveInheritedTheme(): UITheme", + "signatureTokens": [ + { + "text": "_resolveInheritedTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": "UITheme", + "description": "The nearest themed ancestor's theme, or the built-in default when this node has none." + }, + { + "name": "_setSkinState", + "signature": "_setSkinState(state: UIWidgetState): void", + "signatureTokens": [ + { + "text": "_setSkinState", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "state", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [ + { + "name": "state", + "type": "UIWidgetState", + "optional": false + } + ], + "returnType": "void", + "description": "Switch the state skins resolve for, repainting when it actually changes." + }, + { + "name": "_skin", + "signature": "_skin(role: UIThemeRole): UISkin", + "signatureTokens": [ + { + "text": "_skin", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "role", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + } + ], + "params": [ + { + "name": "role", + "type": "UIThemeRole", + "optional": false + } + ], + "returnType": "UISkin", + "description": "The skin role paints with in this widget's current state." }, { "name": "[iterator]", @@ -2262,6 +2530,161 @@ "returnType": "this", "description": "" }, + { + "name": "setTheme", + "signature": "setTheme(patch: Partial>>>>>> | null): this", + "signatureTokens": [ + { + "text": "setTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "patch", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "patch", + "type": "Partial>>>>>> | null", + "optional": false + } + ], + "returnType": "this", + "description": "Override parts of the inherited theme for this widget and its descendants. null clears the override. Repaints and re-lays out every widget in the subtree that the change reaches - skin insets are layout input, so a theme change is never paint-only." + }, { "name": "swapChildren", "signature": "swapChildren(firstChild: RenderNode, secondChild: RenderNode): this", @@ -3350,6 +3773,156 @@ "returnType": null, "description": "Vertical skew angle in degrees. Shears the node along the Y axis (positive values lean the left edge downward). Combines correctly with rotation and scale." }, + { + "name": "theme", + "signature": "theme: UITheme", + "signatureTokens": [ + { + "text": "theme", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The theme in effect for this node and everything below it." + }, + { + "name": "themeOverrides", + "signature": "themeOverrides: Partial>>>>>> | null", + "signatureTokens": [ + { + "text": "themeOverrides", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "This widget's own theme overrides, or null when it purely inherits." + }, { "name": "top", "signature": "top: number", diff --git a/site/src/content/api/stack.json b/site/src/content/api/stack.json index da5a6fdef..9b31fabe5 100644 --- a/site/src/content/api/stack.json +++ b/site/src/content/api/stack.json @@ -6,11 +6,11 @@ "subsystem": "ui", "importPath": "@codexo/exojs", "tier": "stable", - "memberCount": 107, + "memberCount": 118, "counts": { "constructors": 1, - "methods": 48, - "properties": 44, + "methods": 57, + "properties": 46, "events": 14 }, "sections": [ @@ -152,6 +152,93 @@ "returnType": "void", "description": "" }, + { + "name": "_cascadeTheme", + "signature": "_cascadeTheme(): void", + "signatureTokens": [ + { + "text": "_cascadeTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Push a theme refresh into every themed descendant." + }, + { + "name": "_invalidateLayout", + "signature": "_invalidateLayout(): void", + "signatureTokens": [ + { + "text": "_invalidateLayout", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Re-lay out and repaint, then re-apply screen anchoring. This is the right invalidation for anything a skin's insets or a font size can move, and for every size change." + }, + { + "name": "_invalidatePaint", + "signature": "_invalidatePaint(): void", + "signatureTokens": [ + { + "text": "_invalidatePaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Repaint without re-laying out - for a change that cannot move anything, such as a colour or a state flip. Applied immediately, not batched." + }, { "name": "_onEnabledChanged", "signature": "_onEnabledChanged(_effectiveEnabled: boolean): void", @@ -199,6 +286,35 @@ "returnType": "void", "description": "React to an effectiveEnabled change - fired whenever it flips, whether the widget's own enabled flag changed or an ancestor widget's did. Override in subclasses." }, + { + "name": "_onThemeChanged", + "signature": "_onThemeChanged(): void", + "signatureTokens": [ + { + "text": "_onThemeChanged", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "React to a resolved-theme change. The default re-lays out and repaints; override to re-read skin values that are cached elsewhere first, then call super._onThemeChanged()." + }, { "name": "_relayout", "signature": "_relayout(): void", @@ -226,7 +342,159 @@ ], "params": [], "returnType": "void", - "description": "Redraw size-dependent content (background, child positions). Override in subclasses." + "description": "Re-place size-dependent content and repaint. Override in subclasses that position children; call super._relayout() to keep the repaint." + }, + { + "name": "_repaint", + "signature": "_repaint(): void", + "signatureTokens": [ + { + "text": "_repaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Redraw this widget's own painted surfaces for the current size and skin. Override in subclasses that draw a background." + }, + { + "name": "_resolveInheritedTheme", + "signature": "_resolveInheritedTheme(): UITheme", + "signatureTokens": [ + { + "text": "_resolveInheritedTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": "UITheme", + "description": "The nearest themed ancestor's theme, or the built-in default when this node has none." + }, + { + "name": "_setSkinState", + "signature": "_setSkinState(state: UIWidgetState): void", + "signatureTokens": [ + { + "text": "_setSkinState", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "state", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [ + { + "name": "state", + "type": "UIWidgetState", + "optional": false + } + ], + "returnType": "void", + "description": "Switch the state skins resolve for, repainting when it actually changes." + }, + { + "name": "_skin", + "signature": "_skin(role: UIThemeRole): UISkin", + "signatureTokens": [ + { + "text": "_skin", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "role", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + } + ], + "params": [ + { + "name": "role", + "type": "UIThemeRole", + "optional": false + } + ], + "returnType": "UISkin", + "description": "The skin role paints with in this widget's current state." }, { "name": "[iterator]", @@ -2200,6 +2468,161 @@ "returnType": "this", "description": "" }, + { + "name": "setTheme", + "signature": "setTheme(patch: Partial>>>>>> | null): this", + "signatureTokens": [ + { + "text": "setTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "patch", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "patch", + "type": "Partial>>>>>> | null", + "optional": false + } + ], + "returnType": "this", + "description": "Override parts of the inherited theme for this widget and its descendants. null clears the override. Repaints and re-lays out every widget in the subtree that the change reaches - skin insets are layout input, so a theme change is never paint-only." + }, { "name": "swapChildren", "signature": "swapChildren(firstChild: RenderNode, secondChild: RenderNode): this", @@ -3267,6 +3690,156 @@ "returnType": null, "description": "Gap between items in pixels." }, + { + "name": "theme", + "signature": "theme: UITheme", + "signatureTokens": [ + { + "text": "theme", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The theme in effect for this node and everything below it." + }, + { + "name": "themeOverrides", + "signature": "themeOverrides: Partial>>>>>> | null", + "signatureTokens": [ + { + "text": "themeOverrides", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "This widget's own theme overrides, or null when it purely inherits." + }, { "name": "top", "signature": "top: number", diff --git a/site/src/content/api/themed-container.json b/site/src/content/api/themed-container.json new file mode 100644 index 000000000..d1cc81cc2 --- /dev/null +++ b/site/src/content/api/themed-container.json @@ -0,0 +1,3556 @@ +{ + "title": "ThemedContainer", + "description": "A container that carries a UITheme for the subtree below it. Widgets resolve their skins from the nearest themed ancestor, which is how a theme assigned on a UIRoot reaches every widget in that layer without a global registry.", + "symbol": "ThemedContainer", + "kind": "class", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 96, + "counts": { + "constructors": 1, + "methods": 43, + "properties": 38, + "events": 14 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "A container that carries a UITheme for the subtree below it. Widgets resolve their skins from the nearest themed ancestor, which is how a theme assigned on a UIRoot reaches every widget in that layer without a global registry." + ], + "importLine": "import { ThemedContainer } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "constructors", + "title": "Constructors", + "members": [ + { + "name": "new", + "signature": "new(): ThemedContainer", + "signatureTokens": [ + { + "text": "new", + "kind": "keyword" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "ThemedContainer", + "kind": "type" + } + ], + "params": [], + "returnType": "ThemedContainer", + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "methods", + "title": "Methods", + "members": [ + { + "name": "_cascadeTheme", + "signature": "_cascadeTheme(): void", + "signatureTokens": [ + { + "text": "_cascadeTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Push a theme refresh into every themed descendant." + }, + { + "name": "_resolveInheritedTheme", + "signature": "_resolveInheritedTheme(): UITheme", + "signatureTokens": [ + { + "text": "_resolveInheritedTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": "UITheme", + "description": "The nearest themed ancestor's theme, or the built-in default when this node has none." + }, + { + "name": "[iterator]", + "signature": "[iterator](): IterableIterator", + "signatureTokens": [ + { + "text": "[iterator]", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "IterableIterator", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": "IterableIterator", + "description": "Iterate the same frozen, cached document-order snapshot children returns - mutating the container after obtaining this iterator does not change what it yields (see children's doc comment for the full snapshot/invalidation contract)." + }, + { + "name": "addChild", + "signature": "addChild(children: RenderNode[]): this", + "signatureTokens": [ + { + "text": "addChild", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "children", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": "[]", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "children", + "type": "RenderNode[]", + "optional": false + } + ], + "returnType": "this", + "description": "Append one or more children to the end of the child list. Each child is detached from its previous parent (if any) before being added." + }, + { + "name": "addChildAt", + "signature": "addChildAt(child: RenderNode, index: number): this", + "signatureTokens": [ + { + "text": "addChildAt", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "child", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "index", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "child", + "type": "RenderNode", + "optional": false + }, + { + "name": "index", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "Insert child at index in the child list. The child is detached from any previous parent first. Throws if index is out of bounds, if child has already been destroy()ed, or if child is an ancestor of this container (would create a cycle). Self-as-child is a no-op. When child already belongs to this container the call is a pure reorder: the node keeps its parent, its stage and its keyboard focus." + }, + { + "name": "addFilter", + "signature": "addFilter(filter: Filter): this", + "signatureTokens": [ + { + "text": "addFilter", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "filter", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Filter", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "filter", + "type": "Filter", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "blur", + "signature": "blur(): this", + "signatureTokens": [ + { + "text": "blur", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [], + "returnType": "this", + "description": "Release keyboard focus from this node if it currently holds it." + }, + { + "name": "clearFilters", + "signature": "clearFilters(): this", + "signatureTokens": [ + { + "text": "clearFilters", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [], + "returnType": "this", + "description": "" + }, + { + "name": "collidesWith", + "signature": "collidesWith(target: Collidable): CollisionResponse | null", + "signatureTokens": [ + { + "text": "collidesWith", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "target", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Collidable", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "CollisionResponse", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [ + { + "name": "target", + "type": "Collidable", + "optional": false + } + ], + "returnType": "CollisionResponse | null", + "description": "Compute a full CollisionResponse between this shape and target. Returns null in two cases: - the shapes do not overlap, **or** - the specific shape-pair combination does not support response generation (e.g. Line against any shape, Ellipse against Ellipse or Polygon). Use intersectsWith for a universal boolean overlap check that works across all supported shape pairs." + }, + { + "name": "contains", + "signature": "contains(x: number, y: number): boolean", + "signatureTokens": [ + { + "text": "contains", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "y", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [ + { + "name": "x", + "type": "number", + "optional": false + }, + { + "name": "y", + "type": "number", + "optional": false + } + ], + "returnType": "boolean", + "description": "Hit-test the world-space point (x, y) against this node. For world-axis-aligned nodes (own and inherited rotation a multiple of 90° and no skew) the AABB equals the oriented box, so the cheap getBounds test is exact. For rotated or skewed nodes the point is mapped back into local space with the inverse of the global transform and tested against the untransformed getLocalBounds - i.e. a true oriented-box test. This is the exact inverse of the forward map that getBounds and the renderer use to place the node's corners, so picking matches the rendered quad instead of over-reporting hits in the empty AABB corners of a rotated node." + }, + { + "name": "destroy", + "signature": "destroy(): void", + "signatureTokens": [ + { + "text": "destroy", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Destroy this container and every node beneath it. Ownership is by containment: detaching a subtree only unlinks it, so the descendants' GPU-backed resources (cached textures, filters, render textures) and signal listeners would outlive the tree that owned them and leak on every scene change." + }, + { + "name": "focus", + "signature": "focus(): this", + "signatureTokens": [ + { + "text": "focus", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [], + "returnType": "this", + "description": "Request keyboard focus for this node through its owning focus service." + }, + { + "name": "getBounds", + "signature": "getBounds(out?: Rectangle): Rectangle", + "signatureTokens": [ + { + "text": "getBounds", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "out", + "kind": "param" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Rectangle", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Rectangle", + "kind": "type" + } + ], + "params": [ + { + "name": "out", + "type": "Rectangle", + "optional": true + } + ], + "returnType": "Rectangle", + "description": "Axis-aligned bounding box of this node in its GLOBAL-transform space. That is world space for ordinary nodes, but GROUP-LOCAL space for nodes inside an engaged RetainedContainer transform group (the group matrix is applied on the GPU, not here) - this is deliberate and matches the rendering convention. For a true world-space extent of such a node, lift this rect by the group's getWorldTransform matrix. Pass out to receive a copy you own. Without it the return value is this node's **cached** rectangle, rebuilt in place whenever the transform or the local extent changes - retaining it across frames hands you a value that silently moves. The cache is why the no-arg form does not allocate: this runs per node per frame for culling and hit-testing." + }, + { + "name": "getChildAt", + "signature": "getChildAt(index: number): RenderNode", + "signatureTokens": [ + { + "text": "getChildAt", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "index", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + } + ], + "params": [ + { + "name": "index", + "type": "number", + "optional": false + } + ], + "returnType": "RenderNode", + "description": "" + }, + { + "name": "getChildIndex", + "signature": "getChildIndex(child: RenderNode): number", + "signatureTokens": [ + { + "text": "getChildIndex", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "child", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [ + { + "name": "child", + "type": "RenderNode", + "optional": false + } + ], + "returnType": "number", + "description": "" + }, + { + "name": "getGlobalTransform", + "signature": "getGlobalTransform(): Matrix", + "signatureTokens": [ + { + "text": "getGlobalTransform", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Matrix", + "kind": "type" + } + ], + "params": [], + "returnType": "Matrix", + "description": "" + }, + { + "name": "getLocalBounds", + "signature": "getLocalBounds(): ReadonlyRectangle", + "signatureTokens": [ + { + "text": "getLocalBounds", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "ReadonlyRectangle", + "kind": "type" + } + ], + "params": [], + "returnType": "ReadonlyRectangle", + "description": "This node's untransformed extent in its own local coordinate space. Returns the LIVE internal rectangle, not a copy: it is read on hot paths (updateBounds re-reads it on every transform-dirty recompute, i.e. potentially every frame for a moving node), so copying it here would add a per-frame allocation. It is therefore typed as a ReadonlyRectangle - reads are unchanged, writes are rejected at compile time. Writing to it directly would skip the bounds/content invalidation the engine needs, leaving culling, hit-testing and retained render fragments on a stale extent. A custom Drawable that owns its own size sets it through _setLocalBounds, which writes and invalidates in one step." + }, + { + "name": "getNormals", + "signature": "getNormals(): Vector[]", + "signatureTokens": [ + { + "text": "getNormals", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Vector", + "kind": "type" + }, + { + "text": "[]", + "kind": "punctuation" + } + ], + "params": [], + "returnType": "Vector[]", + "description": "Return the outward-facing edge normals used by the SAT solver. The array should be cached and reused across calls." + }, + { + "name": "getTransform", + "signature": "getTransform(): Matrix", + "signatureTokens": [ + { + "text": "getTransform", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Matrix", + "kind": "type" + } + ], + "params": [], + "returnType": "Matrix", + "description": "" + }, + { + "name": "getWorldTransform", + "signature": "getWorldTransform(): Matrix", + "signatureTokens": [ + { + "text": "getWorldTransform", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Matrix", + "kind": "type" + } + ], + "params": [], + "returnType": "Matrix", + "description": "The node's TRUE world-space transform, composed through every transform-group boundary (RetainedContainer) in the ancestor chain. getGlobalTransform deliberately stops at the nearest engaged boundary (descendants resolve group-RELATIVE transforms; the renderer multiplies the group matrix back in on the GPU), so it is the right space for rendering but the wrong one for spatial queries. Use THIS accessor whenever a real world position/orientation is needed - picking, spatial audio, physics, world-space math against nodes outside the group. Without any engaged boundary ancestor it returns the exact getGlobalTransform matrix (same instance, no extra work). With one, it lazily caches groupLocal × groupWorld and revalidates on read via version/stamp compares - including runtime space flips such as RetainedContainer's deep-barrier sub-branch escape." + }, + { + "name": "intersectsWith", + "signature": "intersectsWith(target: Collidable): boolean", + "signatureTokens": [ + { + "text": "intersectsWith", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "target", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Collidable", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [ + { + "name": "target", + "type": "Collidable", + "optional": false + } + ], + "returnType": "boolean", + "description": "Test whether this shape overlaps target using a fast boolean algorithm (no penetration depth or normal computed). Prefer this over collidesWith when only the yes/no result is needed." + }, + { + "name": "invalidateCache", + "signature": "invalidateCache(): this", + "signatureTokens": [ + { + "text": "invalidateCache", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [], + "returnType": "this", + "description": "" + }, + { + "name": "invalidateContent", + "signature": "invalidateContent(): this", + "signatureTokens": [ + { + "text": "invalidateContent", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [], + "returnType": "this", + "description": "Mark this node's visual content dirty without going through a standard setter - e.g. a custom Drawable subclass backed by externally mutable data (the pattern TileChunkNode in @codexo/exojs-tilemap already uses via its own _chunk.revision compare). Call this after mutating such state so the Track-B retained-plan skip does not serve a stale frame for this node." + }, + { + "name": "inView", + "signature": "inView(view: View): boolean", + "signatureTokens": [ + { + "text": "inView", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "view", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "View", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [ + { + "name": "view", + "type": "View", + "optional": false + } + ], + "returnType": "boolean", + "description": "" + }, + { + "name": "move", + "signature": "move(x: number, y: number): this", + "signatureTokens": [ + { + "text": "move", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "y", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "x", + "type": "number", + "optional": false + }, + { + "name": "y", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "project", + "signature": "project(axis: Vector, result: Interval): Interval", + "signatureTokens": [ + { + "text": "project", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "axis", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Vector", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "result", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Interval", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Interval", + "kind": "type" + } + ], + "params": [ + { + "name": "axis", + "type": "Vector", + "optional": false + }, + { + "name": "result", + "type": "Interval", + "optional": false + } + ], + "returnType": "Interval", + "description": "Project this shape onto axis and write the scalar min/max into interval. Used internally by the SAT solver." + }, + { + "name": "removeChild", + "signature": "removeChild(child: RenderNode): this", + "signatureTokens": [ + { + "text": "removeChild", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "child", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "child", + "type": "RenderNode", + "optional": false + } + ], + "returnType": "this", + "description": "Remove child from this container. No-op if not present." + }, + { + "name": "removeChildAt", + "signature": "removeChildAt(index: number): this", + "signatureTokens": [ + { + "text": "removeChildAt", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "index", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "index", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "removeChildren", + "signature": "removeChildren(begin: number, end: number): this", + "signatureTokens": [ + { + "text": "removeChildren", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "begin", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "end", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "begin", + "type": "number", + "optional": false + }, + { + "name": "end", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "Remove children in the half-open range [begin, end). Defaults to the entire child list. Throws if the range is invalid." + }, + { + "name": "removeFilter", + "signature": "removeFilter(filter: Filter): this", + "signatureTokens": [ + { + "text": "removeFilter", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "filter", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Filter", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "filter", + "type": "Filter", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "render", + "signature": "render(backend: RenderBackend): this", + "signatureTokens": [ + { + "text": "render", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "backend", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderBackend", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "backend", + "type": "RenderBackend", + "optional": false + } + ], + "returnType": "this", + "description": "Raw rendering entry point. Direct backend access - bypasses the RenderPlan pipeline machinery. Prefer the high-level RenderingContext.render path via the owning RenderingContext wherever possible." + }, + { + "name": "rotate", + "signature": "rotate(degrees: number): this", + "signatureTokens": [ + { + "text": "rotate", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "degrees", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "degrees", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "setChildIndex", + "signature": "setChildIndex(child: RenderNode, index: number): this", + "signatureTokens": [ + { + "text": "setChildIndex", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "child", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "index", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "child", + "type": "RenderNode", + "optional": false + }, + { + "name": "index", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "setOrigin", + "signature": "setOrigin(x: number, y: number): this", + "signatureTokens": [ + { + "text": "setOrigin", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "y", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "x", + "type": "number", + "optional": false + }, + { + "name": "y", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "setPosition", + "signature": "setPosition(x: number, y: number): this", + "signatureTokens": [ + { + "text": "setPosition", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "y", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "x", + "type": "number", + "optional": false + }, + { + "name": "y", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "setRotation", + "signature": "setRotation(degrees: number): this", + "signatureTokens": [ + { + "text": "setRotation", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "degrees", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "degrees", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "setScale", + "signature": "setScale(x: number, y: number): this", + "signatureTokens": [ + { + "text": "setScale", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "y", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "x", + "type": "number", + "optional": false + }, + { + "name": "y", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "setSkew", + "signature": "setSkew(x: number, y: number): this", + "signatureTokens": [ + { + "text": "setSkew", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "y", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "x", + "type": "number", + "optional": false + }, + { + "name": "y", + "type": "number", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "swapChildren", + "signature": "swapChildren(firstChild: RenderNode, secondChild: RenderNode): this", + "signatureTokens": [ + { + "text": "swapChildren", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "firstChild", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "secondChild", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "firstChild", + "type": "RenderNode", + "optional": false + }, + { + "name": "secondChild", + "type": "RenderNode", + "optional": false + } + ], + "returnType": "this", + "description": "" + }, + { + "name": "updateBounds", + "signature": "updateBounds(): this", + "signatureTokens": [ + { + "text": "updateBounds", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [], + "returnType": "this", + "description": "" + }, + { + "name": "updateParentTransform", + "signature": "updateParentTransform(): this", + "signatureTokens": [ + { + "text": "updateParentTransform", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [], + "returnType": "this", + "description": "" + }, + { + "name": "updateTransform", + "signature": "updateTransform(): this", + "signatureTokens": [ + { + "text": "updateTransform", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [], + "returnType": "this", + "description": "" + }, + { + "name": "setInternalSpriteFactory", + "signature": "setInternalSpriteFactory(factory: () => RenderNodeSpriteLike | null): void", + "signatureTokens": [ + { + "text": "setInternalSpriteFactory", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "factory", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ") => ", + "kind": "punctuation" + }, + { + "text": "RenderNodeSpriteLike", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [ + { + "name": "factory", + "type": "() => RenderNodeSpriteLike | null", + "optional": false + } + ], + "returnType": "void", + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "properties", + "title": "Properties", + "members": [ + { + "name": "collisionType", + "signature": "collisionType: CollisionType", + "signatureTokens": [ + { + "text": "collisionType", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "CollisionType", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "cursor", + "signature": "cursor: null | string", + "signatureTokens": [ + { + "text": "cursor", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "draggable", + "signature": "draggable: boolean", + "signatureTokens": [ + { + "text": "draggable", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "When true and interactive is also true, this node will be automatically repositioned to follow the pointer during a drag gesture. The framework captures the pointer offset at drag-start so the node doesn't snap to the cursor position. Both interactive and draggable must be set for dragging to work - a draggable but non-interactive node will never receive pointerdown and therefore cannot start a drag." + }, + { + "name": "flags", + "signature": "flags: Flags", + "signatureTokens": [ + { + "text": "flags", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Flags", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "SceneNodeTransformFlags", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "focusable", + "signature": "focusable: boolean", + "signatureTokens": [ + { + "text": "focusable", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "When true, this node can receive keyboard focus - via focus, Tab traversal, or app.interaction.focus(node) - and is delivered key events through onKeyDown / onKeyUp while focused, or while any of its descendants holds focus (key events bubble up the parent chain like pointer InteractionEvents do). A Widget additionally has to be enabled: disabling one takes it out of the Tab order and rejects programmatic focus, without touching this flag." + }, + { + "name": "name", + "signature": "name: null | string", + "signatureTokens": [ + { + "text": "name", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Optional human-readable identity for this node. Defaults to null. Purely a label the engine never interprets: useful for debugging, find-by-name lookups, prefab references, and as a stable key when merging serialized state back onto an existing tree. Not required to be unique." + }, + { + "name": "tabIndex", + "signature": "tabIndex: number", + "signatureTokens": [ + { + "text": "tabIndex", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Tab-traversal order among focusable nodes in the same focus scope. Lower values are visited first; equal values keep document (tree) order." + }, + { + "name": "bottom", + "signature": "bottom: number", + "signatureTokens": [ + { + "text": "bottom", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Bottommost edge of the subtree - see left." + }, + { + "name": "cacheAsTexture", + "signature": "cacheAsTexture: boolean", + "signatureTokens": [ + { + "text": "cacheAsTexture", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Bake this node's subtree into a RenderTexture once and replay that texture until the subtree changes, instead of walking and drawing it every frame. Worth it for a subtree that is expensive to draw and rarely changes. The cache is invalidated by anything that moves the node's world bounds - the node's own transform included - so a node that animates re-bakes every frame and is strictly slower than not caching it at all. Setting it to false frees the texture immediately." + }, + { + "name": "cacheResolution", + "signature": "cacheResolution: TargetResolution", + "signatureTokens": [ + { + "text": "cacheResolution", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "TargetResolution", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "Resolution the cacheAsTexture texture is baked at, in device pixels per logical unit. 'inherit' (the default) matches the surface the cache is composited into, so enabling the cache does not soften the picture on a HiDPI display. Pin it to a number to trade sharpness for memory and bake cost - a cache is resolution² texels, so 1 on a DPR-3 phone is a ninth of the VRAM and a ninth of the fill per re-bake. Changing it invalidates the cache." + }, + { + "name": "children", + "signature": "children: readonly RenderNode[]", + "signatureTokens": [ + { + "text": "children", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "readonly", + "kind": "keyword" + }, + { + "text": " ", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": "[]", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "Snapshot of the current children in document order. Frozen and cached - repeated reads return the same array reference until the next structural change (addChild/removeChild/setChildIndex/ swapChildren/etc.), which invalidates it. A reference to a previous snapshot is unaffected by later changes - it keeps reflecting the child list as it was at the time of the read. Mutating methods (push, splice, ...) throw in normal (strict-mode) usage; go through addChild/removeChild instead so parent linkage, stage propagation, and bounds invalidation stay consistent." + }, + { + "name": "clip", + "signature": "clip: boolean", + "signatureTokens": [ + { + "text": "clip", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "When true, descendants are geometrically clipped to clipShape. Unlike mask (which is alpha/visibility masking), clip is a hard geometric boundary: - clipShape === null - clip to this node's world-space bounds (getBounds), using the GPU scissor fast path. - clipShape is a Rectangle - clip to that world-space rectangle via scissor. - clipShape is a Geometry - clip to the geometry's silhouette via the stencil buffer (WebGL2). Only fragments inside the shape survive. Clipping wraps the node's final (filtered/masked) output and acts as a render barrier: draw commands are never reordered or batched across the clip boundary." + }, + { + "name": "clipShape", + "signature": "clipShape: Geometry | Rectangle | null", + "signatureTokens": [ + { + "text": "clipShape", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Geometry", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "Rectangle", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Clip region used when clip is true. A Rectangle (or null for the node's bounds) maps to the scissor fast path; a Geometry maps to the stencil path. Has no effect while clip is false." + }, + { + "name": "cullable", + "signature": "cullable: boolean", + "signatureTokens": [ + { + "text": "cullable", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "When false, this node is never culled by the viewport check and is always considered in-view. Defaults to true." + }, + { + "name": "cullArea", + "signature": "cullArea: Rectangle | null", + "signatureTokens": [ + { + "text": "cullArea", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Rectangle", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Custom rectangle used for viewport cull intersection test. When set, replaces the default node bounds in cull checks. Set to null to restore default bounds-based culling." + }, + { + "name": "destroyed", + "signature": "destroyed: boolean", + "signatureTokens": [ + { + "text": "destroyed", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "true once destroy has run on this node. A destroyed node has released its pooled resources (transform/bounds), has been unlinked from its parent, renders nothing, and must not be reused or re-attached. The render plan skips a destroyed node, so even one handed straight to a renderer as a detached root contributes nothing." + }, + { + "name": "filters", + "signature": "filters: readonly Filter[]", + "signatureTokens": [ + { + "text": "filters", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "readonly", + "kind": "keyword" + }, + { + "text": " ", + "kind": "punctuation" + }, + { + "text": "Filter", + "kind": "type" + }, + { + "text": "[]", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "height", + "signature": "height: number", + "signatureTokens": [ + { + "text": "height", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Rendered height of the whole subtree - see width." + }, + { + "name": "interactive", + "signature": "interactive: boolean", + "signatureTokens": [ + { + "text": "interactive", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "isAlignedBox", + "signature": "isAlignedBox: boolean", + "signatureTokens": [ + { + "text": "isAlignedBox", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "left", + "signature": "left: number", + "signatureTokens": [ + { + "text": "left", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Leftmost edge of the subtree in the node's global-transform space. These four edges are read straight off the aggregate bounds so they always span exactly width/height and agree with each other. They cannot be reconstructed from position and origin: origin is in local pixels and a container's own local bounds are empty, so the rendered extent comes entirely from the children." + }, + { + "name": "mask", + "signature": "mask: MaskSource", + "signatureTokens": [ + { + "text": "mask", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "MaskSource", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The mask source that controls visibility of this node's render output. See MaskSource for accepted source types and their semantics. Setting to null removes any active mask. Setting a RenderNode that is this is rejected (a node cannot mask itself). Indirect cycles (a.mask = b; b.mask = a) are rejected as well: the candidate's mask chain is walked and any cycle - whether it closes on this or was already present in the chain - fails the assignment." + }, + { + "name": "origin", + "signature": "origin: ObservableVector", + "signatureTokens": [ + { + "text": "origin", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "ObservableVector", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "parent", + "signature": "parent: Container | null", + "signatureTokens": [ + { + "text": "parent", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Container", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "position", + "signature": "position: ObservableVector", + "signatureTokens": [ + { + "text": "position", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "ObservableVector", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "preserveDrawOrder", + "signature": "preserveDrawOrder: boolean", + "signatureTokens": [ + { + "text": "preserveDrawOrder", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "When true, material-aware overlap reordering is disabled for this node's draw-order scope. Draw commands are submitted in exact document order (after scope-local z-sorting), preserving the painter's guarantee irrespective of material compatibility or AABB safety analysis. Adjacency coalescing of consecutive same-material draws still applies; it does not change visual output order." + }, + { + "name": "right", + "signature": "right: number", + "signatureTokens": [ + { + "text": "right", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Rightmost edge of the subtree - see left." + }, + { + "name": "rotation", + "signature": "rotation: number", + "signatureTokens": [ + { + "text": "rotation", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Rotation angle in degrees. Wraps via trimRotation on assignment." + }, + { + "name": "scale", + "signature": "scale: ObservableVector", + "signatureTokens": [ + { + "text": "scale", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "ObservableVector", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "skewX", + "signature": "skewX: number", + "signatureTokens": [ + { + "text": "skewX", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Horizontal skew angle in degrees. Shears the node along the X axis (positive values lean the top edge right). Combines correctly with rotation and scale." + }, + { + "name": "skewY", + "signature": "skewY: number", + "signatureTokens": [ + { + "text": "skewY", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Vertical skew angle in degrees. Shears the node along the Y axis (positive values lean the left edge downward). Combines correctly with rotation and scale." + }, + { + "name": "theme", + "signature": "theme: UITheme", + "signatureTokens": [ + { + "text": "theme", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The theme in effect for this node and everything below it." + }, + { + "name": "top", + "signature": "top: number", + "signatureTokens": [ + { + "text": "top", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Topmost edge of the subtree - see left." + }, + { + "name": "visible", + "signature": "visible: boolean", + "signatureTokens": [ + { + "text": "visible", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "width", + "signature": "width: number", + "signatureTokens": [ + { + "text": "width", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Rendered width of the whole subtree, in the node's global-transform space. Unlike Sprite.width - which scales an unscaled texture frame - a container has no intrinsic local size, so this reads the aggregate bounds directly. Those are already scaled, so multiplying by scale again would count it twice. Writing rescales scale.x to make the subtree render at the requested width." + }, + { + "name": "x", + "signature": "x: number", + "signatureTokens": [ + { + "text": "x", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "y", + "signature": "y: number", + "signatureTokens": [ + { + "text": "y", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "zIndex", + "signature": "zIndex: number", + "signatureTokens": [ + { + "text": "zIndex", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "events", + "title": "Events", + "members": [ + { + "name": "onBlur", + "signature": "onBlur: Signal<[RenderNode]>", + "signatureTokens": [ + { + "text": "onBlur", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "Fired when this node loses keyboard focus." + }, + { + "name": "onContextMenu", + "signature": "onContextMenu: Signal<[InteractionEvent]>", + "signatureTokens": [ + { + "text": "onContextMenu", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "InteractionEvent", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "Fired when a pointer requests a context menu over this node - right-click, or a long-press/touch gesture that has an attributable pointer. Bubbles like the other pointer events, so a scene-wide fallback can listen on an ancestor. Carries no native event - whether the browser's own menu appears is decided by ApplicationOptions.input.allowNativeContextMenu, independently of this. Requires an attributable pointer: a pointerless keyboard-only request (the context-menu key, or Shift+F10, with no pointer ever having touched the surface - see ContextMenuRequest's doc comment) has nothing to hit-test or bubble with, so it never reaches this per-node event. It only ever reaches the engine-wide, scene-graph-independent app.input.onContextMenu." + }, + { + "name": "onDrag", + "signature": "onDrag: Signal<[InteractionEvent]>", + "signatureTokens": [ + { + "text": "onDrag", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "InteractionEvent", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "Fired on every pointer-move while this node is being dragged. Does not bubble." + }, + { + "name": "onDragEnd", + "signature": "onDragEnd: Signal<[InteractionEvent]>", + "signatureTokens": [ + { + "text": "onDragEnd", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "InteractionEvent", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "Fired when the drag gesture ends (pointer-up or cancel). Does not bubble." + }, + { + "name": "onDragStart", + "signature": "onDragStart: Signal<[InteractionEvent]>", + "signatureTokens": [ + { + "text": "onDragStart", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "InteractionEvent", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "Fired once when a drag gesture begins on this node. Does not bubble." + }, + { + "name": "onFocus", + "signature": "onFocus: Signal<[RenderNode]>", + "signatureTokens": [ + { + "text": "onFocus", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "RenderNode", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "Fired when this node gains keyboard focus." + }, + { + "name": "onKeyDown", + "signature": "onKeyDown: Signal<[KeyEvent]>", + "signatureTokens": [ + { + "text": "onKeyDown", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "KeyEvent", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "Fired for each key pressed while this node - or a descendant of it - holds focus. Bubbles; see KeyEvent." + }, + { + "name": "onKeyUp", + "signature": "onKeyUp: Signal<[KeyEvent]>", + "signatureTokens": [ + { + "text": "onKeyUp", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "KeyEvent", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "Fired for each key released while this node - or a descendant of it - holds focus. Bubbles; see KeyEvent." + }, + { + "name": "onPointerDown", + "signature": "onPointerDown: Signal<[InteractionEvent]>", + "signatureTokens": [ + { + "text": "onPointerDown", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "InteractionEvent", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "onPointerMove", + "signature": "onPointerMove: Signal<[InteractionEvent]>", + "signatureTokens": [ + { + "text": "onPointerMove", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "InteractionEvent", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "onPointerOut", + "signature": "onPointerOut: Signal<[InteractionEvent]>", + "signatureTokens": [ + { + "text": "onPointerOut", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "InteractionEvent", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "onPointerOver", + "signature": "onPointerOver: Signal<[InteractionEvent]>", + "signatureTokens": [ + { + "text": "onPointerOver", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "InteractionEvent", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "onPointerTap", + "signature": "onPointerTap: Signal<[InteractionEvent]>", + "signatureTokens": [ + { + "text": "onPointerTap", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "InteractionEvent", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "onPointerUp", + "signature": "onPointerUp: Signal<[InteractionEvent]>", + "signatureTokens": [ + { + "text": "onPointerUp", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Signal", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "InteractionEvent", + "kind": "type" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/ThemedContainer.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/ThemedContainer.ts" + } + } + ], + "sourcePath": "src/ui/ThemedContainer.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/ThemedContainer.ts" +} diff --git a/site/src/content/api/uibackground.json b/site/src/content/api/uibackground.json new file mode 100644 index 000000000..256609483 --- /dev/null +++ b/site/src/content/api/uibackground.json @@ -0,0 +1,79 @@ +{ + "title": "UIBackground", + "description": "How a widget paints its body.", + "symbol": "UIBackground", + "kind": "type", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 0, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 0, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "How a widget paints its body." + ], + "importLine": "import { UIBackground } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "definition", + "title": "Definition", + "members": [ + { + "name": "UIBackground", + "signature": "UIFillBackground | UINineSliceBackground | UINoBackground", + "signatureTokens": [ + { + "text": "UIFillBackground", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "UINineSliceBackground", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "UINoBackground", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uifill-background.json b/site/src/content/api/uifill-background.json new file mode 100644 index 000000000..92c5971be --- /dev/null +++ b/site/src/content/api/uifill-background.json @@ -0,0 +1,155 @@ +{ + "title": "UIFillBackground", + "description": "Vector background: a rounded rectangle with an optional stroked border.", + "symbol": "UIFillBackground", + "kind": "interface", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 5, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 5, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "Vector background: a rounded rectangle with an optional stroked border." + ], + "importLine": "import { UIFillBackground } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "properties", + "title": "Properties", + "members": [ + { + "name": "borderColor", + "signature": "borderColor: Color", + "signatureTokens": [ + { + "text": "borderColor", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Color", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "borderWidth", + "signature": "borderWidth: number", + "signatureTokens": [ + { + "text": "borderWidth", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Border thickness in pixels; 0 draws no border." + }, + { + "name": "color", + "signature": "color: Color", + "signatureTokens": [ + { + "text": "color", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Color", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "cornerRadius", + "signature": "cornerRadius: number", + "signatureTokens": [ + { + "text": "cornerRadius", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Corner radius in pixels, clamped to half the widget's smaller side." + }, + { + "name": "kind", + "signature": "kind: \"fill\"", + "signatureTokens": [ + { + "text": "kind", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "\"fill\"", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uifill-patch.json b/site/src/content/api/uifill-patch.json new file mode 100644 index 000000000..97789582d --- /dev/null +++ b/site/src/content/api/uifill-patch.json @@ -0,0 +1,150 @@ +{ + "title": "UIFillPatch", + "description": "Fill properties to override on a widget's background; omitted ones keep the skin's value.", + "symbol": "UIFillPatch", + "kind": "interface", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 4, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 4, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "Fill properties to override on a widget's background; omitted ones keep the skin's value." + ], + "importLine": "import { UIFillPatch } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "properties", + "title": "Properties", + "members": [ + { + "name": "borderColor", + "signature": "borderColor?: Color", + "signatureTokens": [ + { + "text": "borderColor", + "kind": "name" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Color", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "borderWidth", + "signature": "borderWidth?: number", + "signatureTokens": [ + { + "text": "borderWidth", + "kind": "name" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "color", + "signature": "color?: Color", + "signatureTokens": [ + { + "text": "color", + "kind": "name" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Color", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "cornerRadius", + "signature": "cornerRadius?: number", + "signatureTokens": [ + { + "text": "cornerRadius", + "kind": "name" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uiinsets.json b/site/src/content/api/uiinsets.json new file mode 100644 index 000000000..f37ce9344 --- /dev/null +++ b/site/src/content/api/uiinsets.json @@ -0,0 +1,134 @@ +{ + "title": "UIInsets", + "description": "Per-edge pixel insets. A skin's insets are layout input, not decoration: they describe the content box a widget positions its content in, so changing them re-lays out the widget rather than only repainting it.", + "symbol": "UIInsets", + "kind": "interface", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 4, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 4, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "Per-edge pixel insets. A skin's insets are layout input, not decoration: they describe the content box a widget positions its content in, so changing them re-lays out the widget rather than only repainting it." + ], + "importLine": "import { UIInsets } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "properties", + "title": "Properties", + "members": [ + { + "name": "bottom", + "signature": "bottom: number", + "signatureTokens": [ + { + "text": "bottom", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "left", + "signature": "left: number", + "signatureTokens": [ + { + "text": "left", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "right", + "signature": "right: number", + "signatureTokens": [ + { + "text": "right", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "top", + "signature": "top: number", + "signatureTokens": [ + { + "text": "top", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uinine-slice-background.json b/site/src/content/api/uinine-slice-background.json new file mode 100644 index 000000000..75a8e03d1 --- /dev/null +++ b/site/src/content/api/uinine-slice-background.json @@ -0,0 +1,211 @@ +{ + "title": "UINineSliceBackground", + "description": "Textured background drawn as a nine-slice, so corners stay pixel-perfect while edges and center fill the widget's layout size.", + "symbol": "UINineSliceBackground", + "kind": "interface", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 5, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 5, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "Textured background drawn as a nine-slice, so corners stay pixel-perfect while edges and center fill the widget's layout size." + ], + "importLine": "import { UINineSliceBackground } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "properties", + "title": "Properties", + "members": [ + { + "name": "border", + "signature": "border?: Partial | number", + "signatureTokens": [ + { + "text": "border", + "kind": "name" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "NineSliceInsets", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Destination border widths; defaults to slices (1:1 corners)." + }, + { + "name": "kind", + "signature": "kind: \"nineSlice\"", + "signatureTokens": [ + { + "text": "kind", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "\"nineSlice\"", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "modes", + "signature": "modes?: NineSliceModes", + "signatureTokens": [ + { + "text": "modes", + "kind": "name" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "NineSliceModes", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "slices", + "signature": "slices: Partial | number", + "signatureTokens": [ + { + "text": "slices", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "NineSliceInsets", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "Source-texture slice widths, in texels." + }, + { + "name": "texture", + "signature": "texture: Texture | TextureRegion", + "signatureTokens": [ + { + "text": "texture", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Texture", + "kind": "type" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "TextureRegion", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uino-background.json b/site/src/content/api/uino-background.json new file mode 100644 index 000000000..48601d5b7 --- /dev/null +++ b/site/src/content/api/uino-background.json @@ -0,0 +1,71 @@ +{ + "title": "UINoBackground", + "description": "Widget surface that paints nothing - the whole node is its content.", + "symbol": "UINoBackground", + "kind": "interface", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 1, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 1, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "Widget surface that paints nothing - the whole node is its content." + ], + "importLine": "import { UINoBackground } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "properties", + "title": "Properties", + "members": [ + { + "name": "kind", + "signature": "kind: \"none\"", + "signatureTokens": [ + { + "text": "kind", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "\"none\"", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uiroot.json b/site/src/content/api/uiroot.json index 58c1de693..d6e9d41ca 100644 --- a/site/src/content/api/uiroot.json +++ b/site/src/content/api/uiroot.json @@ -1,16 +1,16 @@ { "title": "UIRoot", - "description": "Root of a scene's screen-fixed UI layer. Reached through Scene.ui; you do not construct it directly. Unlike Scene.root, the UI layer is **auto-rendered** by the SceneDirector after `Scene.draw()`, through the RenderingContext.screenView - so its children live in screen space (origin top-left, `0..width` × `0..height`) and never scroll with the camera. Pointer hit-testing and keyboard focus are routed to UI nodes in that same screen space, ahead of the world layer. Add widgets with `scene.ui.addChild(...)`. The UIRoot.onResize signal fires whenever the screen size changes, so anchored widgets can re-layout.", + "description": "Root of a scene's screen-fixed UI layer. Reached through Scene.ui; you do not construct it directly. Unlike Scene.root, the UI layer is **auto-rendered** by the SceneDirector after `Scene.draw()`, through the RenderingContext.screenView - so its children live in screen space (origin top-left, `0..width` × `0..height`) and never scroll with the camera. Pointer hit-testing and keyboard focus are routed to UI nodes in that same screen space, ahead of the world layer. Add widgets with `scene.ui.addChild(...)`. The UIRoot.onResize signal fires whenever the screen size changes, so anchored widgets can re-layout. The root also carries the layer's UIRoot.theme: widgets resolve their skins from the nearest themed ancestor, so assigning a theme here restyles every widget below that does not override it.", "symbol": "UIRoot", "kind": "class", "subsystem": "ui", "importPath": "@codexo/exojs", "tier": "stable", - "memberCount": 96, + "memberCount": 99, "counts": { "constructors": 1, - "methods": 41, - "properties": 39, + "methods": 43, + "properties": 40, "events": 15 }, "sections": [ @@ -21,7 +21,8 @@ "paragraphs": [ "Root of a scene's screen-fixed UI layer. Reached through Scene.ui; you do not construct it directly.", "Unlike Scene.root, the UI layer is **auto-rendered** by the SceneDirector after `Scene.draw()`, through the RenderingContext.screenView - so its children live in screen space (origin top-left, `0..width` × `0..height`) and never scroll with the camera. Pointer hit-testing and keyboard focus are routed to UI nodes in that same screen space, ahead of the world layer.", - "Add widgets with `scene.ui.addChild(...)`. The UIRoot.onResize signal fires whenever the screen size changes, so anchored widgets can re-layout." + "Add widgets with `scene.ui.addChild(...)`. The UIRoot.onResize signal fires whenever the screen size changes, so anchored widgets can re-layout.", + "The root also carries the layer's UIRoot.theme: widgets resolve their skins from the nearest themed ancestor, so assigning a theme here restyles every widget below that does not override it." ], "importLine": "import { UIRoot } from '@codexo/exojs'", "sourceLink": null @@ -68,6 +69,64 @@ "id": "methods", "title": "Methods", "members": [ + { + "name": "_cascadeTheme", + "signature": "_cascadeTheme(): void", + "signatureTokens": [ + { + "text": "_cascadeTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Push a theme refresh into every themed descendant." + }, + { + "name": "_resolveInheritedTheme", + "signature": "_resolveInheritedTheme(): UITheme", + "signatureTokens": [ + { + "text": "_resolveInheritedTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": "UITheme", + "description": "The nearest themed ancestor's theme, or the built-in default when this node has none." + }, { "name": "[iterator]", "signature": "[iterator](): IterableIterator", @@ -2790,6 +2849,27 @@ "returnType": null, "description": "Vertical skew angle in degrees. Shears the node along the Y axis (positive values lean the left edge downward). Combines correctly with rotation and scale." }, + { + "name": "theme", + "signature": "theme: UITheme", + "signatureTokens": [ + { + "text": "theme", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "Base theme for every widget in this layer. Widgets override parts of it per subtree with Widget.setTheme; there is no global theme, so two UI layers can carry different ones. Assigning restyles the whole layer at once - every widget below repaints and re-lays out." + }, { "name": "top", "signature": "top: number", diff --git a/site/src/content/api/uiskin-patch.json b/site/src/content/api/uiskin-patch.json new file mode 100644 index 000000000..c5d49d2e0 --- /dev/null +++ b/site/src/content/api/uiskin-patch.json @@ -0,0 +1,75 @@ +{ + "title": "UISkinPatch", + "description": "Skin fields to override; an omitted field keeps the inherited one.", + "symbol": "UISkinPatch", + "kind": "type", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 0, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 0, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "Skin fields to override; an omitted field keeps the inherited one." + ], + "importLine": "import { UISkinPatch } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "definition", + "title": "Definition", + "members": [ + { + "name": "UISkinPatch", + "signature": "Partial", + "signatureTokens": [ + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uiskin-set-patch.json b/site/src/content/api/uiskin-set-patch.json new file mode 100644 index 000000000..f980f80d3 --- /dev/null +++ b/site/src/content/api/uiskin-set-patch.json @@ -0,0 +1,107 @@ +{ + "title": "UISkinSetPatch", + "description": "Per-state skin overrides.", + "symbol": "UISkinSetPatch", + "kind": "type", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 0, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 0, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "Per-state skin overrides." + ], + "importLine": "import { UISkinSetPatch } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "definition", + "title": "Definition", + "members": [ + { + "name": "UISkinSetPatch", + "signature": "Partial>>", + "signatureTokens": [ + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "UISkinPatch", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uiskin-set.json b/site/src/content/api/uiskin-set.json new file mode 100644 index 000000000..94862baa9 --- /dev/null +++ b/site/src/content/api/uiskin-set.json @@ -0,0 +1,151 @@ +{ + "title": "UISkinSet", + "description": "One skin per state. Only `normal` is required - resolveUISkin falls back to it for every state a set does not define.", + "symbol": "UISkinSet", + "kind": "type", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 0, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 0, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "One skin per state. Only `normal` is required - resolveUISkin falls back to it for every state a set does not define." + ], + "importLine": "import { UISkinSet } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "definition", + "title": "Definition", + "members": [ + { + "name": "UISkinSet", + "signature": "{ normal: UISkin } & Partial, UISkin>>>", + "signatureTokens": [ + { + "text": "{ ", + "kind": "punctuation" + }, + { + "text": "normal", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": " }", + "kind": "punctuation" + }, + { + "text": " & ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Exclude", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "\"normal\"", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uiskin.json b/site/src/content/api/uiskin.json new file mode 100644 index 000000000..e096d66c0 --- /dev/null +++ b/site/src/content/api/uiskin.json @@ -0,0 +1,113 @@ +{ + "title": "UISkin", + "description": "The look of one widget surface in one state: what it paints, how its text is styled, and the content box its layout works against.", + "symbol": "UISkin", + "kind": "interface", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 3, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 3, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "The look of one widget surface in one state: what it paints, how its text is styled, and the content box its layout works against." + ], + "importLine": "import { UISkin } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "properties", + "title": "Properties", + "members": [ + { + "name": "background", + "signature": "background: UIBackground", + "signatureTokens": [ + { + "text": "background", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIBackground", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "insets", + "signature": "insets: UIInsets", + "signatureTokens": [ + { + "text": "insets", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIInsets", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + }, + { + "name": "text", + "signature": "text: TextStyleOptions", + "signatureTokens": [ + { + "text": "text", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "TextStyleOptions", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uitheme-patch.json b/site/src/content/api/uitheme-patch.json new file mode 100644 index 000000000..4c5fdabac --- /dev/null +++ b/site/src/content/api/uitheme-patch.json @@ -0,0 +1,107 @@ +{ + "title": "UIThemePatch", + "description": "Theme overrides applied on top of an inherited theme. Fields are replaced whole: naming `background` replaces the entire descriptor, since blending half a fill into a nine-slice has no meaning. Single-property tweaks belong on the widget (`panel.setFill({ color })`), not in a theme patch.", + "symbol": "UIThemePatch", + "kind": "type", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 0, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 0, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "Theme overrides applied on top of an inherited theme. Fields are replaced whole: naming `background` replaces the entire descriptor, since blending half a fill into a nine-slice has no meaning. Single-property tweaks belong on the widget (`panel.setFill({ color })`), not in a theme patch." + ], + "importLine": "import { UIThemePatch } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "definition", + "title": "Definition", + "members": [ + { + "name": "UIThemePatch", + "signature": "Partial>>", + "signatureTokens": [ + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "UISkinSetPatch", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uitheme-role.json b/site/src/content/api/uitheme-role.json new file mode 100644 index 000000000..acccc724a --- /dev/null +++ b/site/src/content/api/uitheme-role.json @@ -0,0 +1,95 @@ +{ + "title": "UIThemeRole", + "description": "A themed surface. Roles are per painted surface, not per widget class: a progress bar draws its track and its fill from two independent roles.", + "symbol": "UIThemeRole", + "kind": "type", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 0, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 0, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "A themed surface. Roles are per painted surface, not per widget class: a progress bar draws its track and its fill from two independent roles." + ], + "importLine": "import { UIThemeRole } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "definition", + "title": "Definition", + "members": [ + { + "name": "UIThemeRole", + "signature": "\"button\" | \"label\" | \"panel\" | \"progressBarFill\" | \"progressBarTrack\"", + "signatureTokens": [ + { + "text": "\"button\"", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "\"label\"", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "\"panel\"", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "\"progressBarFill\"", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "\"progressBarTrack\"", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uitheme.json b/site/src/content/api/uitheme.json new file mode 100644 index 000000000..155a118b9 --- /dev/null +++ b/site/src/content/api/uitheme.json @@ -0,0 +1,95 @@ +{ + "title": "UITheme", + "description": "Skins for every role, as resolved for a widget.", + "symbol": "UITheme", + "kind": "type", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 0, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 0, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "Skins for every role, as resolved for a widget." + ], + "importLine": "import { UITheme } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "definition", + "title": "Definition", + "members": [ + { + "name": "UITheme", + "signature": "Readonly>", + "signatureTokens": [ + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "UISkinSet", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/uiwidget-state.json b/site/src/content/api/uiwidget-state.json new file mode 100644 index 000000000..a5cd461ea --- /dev/null +++ b/site/src/content/api/uiwidget-state.json @@ -0,0 +1,95 @@ +{ + "title": "UIWidgetState", + "description": "Visual state a widget paints in. A widget that tracks no interaction stays on `'normal'`; states a skin set leaves undefined fall back to `'normal'`.", + "symbol": "UIWidgetState", + "kind": "type", + "subsystem": "ui", + "importPath": "@codexo/exojs", + "tier": "stable", + "memberCount": 0, + "counts": { + "constructors": 0, + "methods": 0, + "properties": 0, + "events": 0 + }, + "sections": [ + { + "id": "import", + "title": "Import", + "members": [], + "paragraphs": [ + "Visual state a widget paints in. A widget that tracks no interaction stays on `'normal'`; states a skin set leaves undefined fall back to `'normal'`." + ], + "importLine": "import { UIWidgetState } from '@codexo/exojs'", + "sourceLink": null + }, + { + "id": "definition", + "title": "Definition", + "members": [ + { + "name": "UIWidgetState", + "signature": "\"disabled\" | \"focused\" | \"hover\" | \"normal\" | \"pressed\"", + "signatureTokens": [ + { + "text": "\"disabled\"", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "\"focused\"", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "\"hover\"", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "\"normal\"", + "kind": "keyword" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "\"pressed\"", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "" + } + ], + "paragraphs": [], + "importLine": null, + "sourceLink": null + }, + { + "id": "source", + "title": "Source", + "members": [], + "paragraphs": [], + "importLine": null, + "sourceLink": { + "label": "src/ui/theme.ts", + "href": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" + } + } + ], + "sourcePath": "src/ui/theme.ts", + "sourceUrl": "https://github.com/Exoridus/ExoJS/blob/main/src/ui/theme.ts" +} diff --git a/site/src/content/api/widget.json b/site/src/content/api/widget.json index 4e633ebfd..2cbf283d8 100644 --- a/site/src/content/api/widget.json +++ b/site/src/content/api/widget.json @@ -1,16 +1,16 @@ { "title": "Widget", - "description": "Base class for UI widgets - a Container with an explicit layout size (independent of child bounds / scale), an `enabled` flag, and optional screen-edge anchoring that re-applies on resize. Subclasses redraw size-dependent content in Widget._relayout and react to enable/disable in Widget._onEnabledChanged.", + "description": "Base class for UI widgets - a Container with an explicit layout size (independent of child bounds / scale), an `enabled` flag, and optional screen-edge anchoring that re-applies on resize. Widgets read their look from the theme of the nearest themed ancestor - the layer's UIRoot, or any widget above them that set overrides with Widget.setTheme. Subclasses paint in Widget._repaint, place size-dependent content in Widget._relayout, and react to enable/disable in Widget._onEnabledChanged.", "symbol": "Widget", "kind": "class", "subsystem": "ui", "importPath": "@codexo/exojs", "tier": "stable", - "memberCount": 102, + "memberCount": 113, "counts": { "constructors": 1, - "methods": 46, - "properties": 41, + "methods": 55, + "properties": 43, "events": 14 }, "sections": [ @@ -20,7 +20,8 @@ "members": [], "paragraphs": [ "Base class for UI widgets - a Container with an explicit layout size (independent of child bounds / scale), an `enabled` flag, and optional screen-edge anchoring that re-applies on resize.", - "Subclasses redraw size-dependent content in Widget._relayout and react to enable/disable in Widget._onEnabledChanged." + "Widgets read their look from the theme of the nearest themed ancestor - the layer's UIRoot, or any widget above them that set overrides with Widget.setTheme.", + "Subclasses paint in Widget._repaint, place size-dependent content in Widget._relayout, and react to enable/disable in Widget._onEnabledChanged." ], "importLine": "import { Widget } from '@codexo/exojs'", "sourceLink": null @@ -135,6 +136,93 @@ "returnType": "void", "description": "" }, + { + "name": "_cascadeTheme", + "signature": "_cascadeTheme(): void", + "signatureTokens": [ + { + "text": "_cascadeTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Push a theme refresh into every themed descendant." + }, + { + "name": "_invalidateLayout", + "signature": "_invalidateLayout(): void", + "signatureTokens": [ + { + "text": "_invalidateLayout", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Re-lay out and repaint, then re-apply screen anchoring. This is the right invalidation for anything a skin's insets or a font size can move, and for every size change." + }, + { + "name": "_invalidatePaint", + "signature": "_invalidatePaint(): void", + "signatureTokens": [ + { + "text": "_invalidatePaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Repaint without re-laying out - for a change that cannot move anything, such as a colour or a state flip. Applied immediately, not batched." + }, { "name": "_onEnabledChanged", "signature": "_onEnabledChanged(_effectiveEnabled: boolean): void", @@ -182,6 +270,35 @@ "returnType": "void", "description": "React to an effectiveEnabled change - fired whenever it flips, whether the widget's own enabled flag changed or an ancestor widget's did. Override in subclasses." }, + { + "name": "_onThemeChanged", + "signature": "_onThemeChanged(): void", + "signatureTokens": [ + { + "text": "_onThemeChanged", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "React to a resolved-theme change. The default re-lays out and repaints; override to re-read skin values that are cached elsewhere first, then call super._onThemeChanged()." + }, { "name": "_relayout", "signature": "_relayout(): void", @@ -209,7 +326,159 @@ ], "params": [], "returnType": "void", - "description": "Redraw size-dependent content (background, child positions). Override in subclasses." + "description": "Re-place size-dependent content and repaint. Override in subclasses that position children; call super._relayout() to keep the repaint." + }, + { + "name": "_repaint", + "signature": "_repaint(): void", + "signatureTokens": [ + { + "text": "_repaint", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [], + "returnType": "void", + "description": "Redraw this widget's own painted surfaces for the current size and skin. Override in subclasses that draw a background." + }, + { + "name": "_resolveInheritedTheme", + "signature": "_resolveInheritedTheme(): UITheme", + "signatureTokens": [ + { + "text": "_resolveInheritedTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": "UITheme", + "description": "The nearest themed ancestor's theme, or the built-in default when this node has none." + }, + { + "name": "_setSkinState", + "signature": "_setSkinState(state: UIWidgetState): void", + "signatureTokens": [ + { + "text": "_setSkinState", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "state", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "params": [ + { + "name": "state", + "type": "UIWidgetState", + "optional": false + } + ], + "returnType": "void", + "description": "Switch the state skins resolve for, repainting when it actually changes." + }, + { + "name": "_skin", + "signature": "_skin(role: UIThemeRole): UISkin", + "signatureTokens": [ + { + "text": "_skin", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "role", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + } + ], + "params": [ + { + "name": "role", + "type": "UIThemeRole", + "optional": false + } + ], + "returnType": "UISkin", + "description": "The skin role paints with in this widget's current state." }, { "name": "[iterator]", @@ -2107,6 +2376,161 @@ "returnType": "this", "description": "" }, + { + "name": "setTheme", + "signature": "setTheme(patch: Partial>>>>>> | null): this", + "signatureTokens": [ + { + "text": "setTheme", + "kind": "name" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "patch", + "kind": "param" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "keyword" + } + ], + "params": [ + { + "name": "patch", + "type": "Partial>>>>>> | null", + "optional": false + } + ], + "returnType": "this", + "description": "Override parts of the inherited theme for this widget and its descendants. null clears the override. Repaints and re-lays out every widget in the subtree that the change reaches - skin insets are layout input, so a theme change is never paint-only." + }, { "name": "swapChildren", "signature": "swapChildren(firstChild: RenderNode, secondChild: RenderNode): this", @@ -3111,6 +3535,156 @@ "returnType": null, "description": "Vertical skew angle in degrees. Shears the node along the Y axis (positive values lean the left edge downward). Combines correctly with rotation and scale." }, + { + "name": "theme", + "signature": "theme: UITheme", + "signatureTokens": [ + { + "text": "theme", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "UITheme", + "kind": "type" + } + ], + "params": [], + "returnType": null, + "description": "The theme in effect for this node and everything below it." + }, + { + "name": "themeOverrides", + "signature": "themeOverrides: Partial>>>>>> | null", + "signatureTokens": [ + { + "text": "themeOverrides", + "kind": "name" + }, + { + "text": ": ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIThemeRole", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Readonly", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "Record", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UIWidgetState", + "kind": "type" + }, + { + "text": ", ", + "kind": "punctuation" + }, + { + "text": "Partial", + "kind": "type" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "UISkin", + "kind": "type" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " | ", + "kind": "punctuation" + }, + { + "text": "null", + "kind": "keyword" + } + ], + "params": [], + "returnType": null, + "description": "This widget's own theme overrides, or null when it purely inherits." + }, { "name": "top", "signature": "top: number", diff --git a/site/src/content/guide/runtime/ui-and-widgets.mdx b/site/src/content/guide/runtime/ui-and-widgets.mdx index 68751e380..f97728e96 100644 --- a/site/src/content/guide/runtime/ui-and-widgets.mdx +++ b/site/src/content/guide/runtime/ui-and-widgets.mdx @@ -35,6 +35,38 @@ start.onClick.add(() => console.log('clicked')); A `Label` wraps a runtime [`Text`](/ExoJS/en/api/text/), so it accepts the same style options (`fontSize`, `fillColor`, `align`, …). A `Panel` is a rounded background you can add children to. A `Button` is a clickable panel with a centered label and hover / pressed / disabled states. +## Theming + +A widget does not carry its own colours: it paints a **skin** it resolves from the theme of the nearest themed ancestor — the layer's [`UIRoot`](/ExoJS/en/api/uiroot/), or any widget above it that set overrides. A [`UITheme`](/ExoJS/en/api/uitheme/) holds one [`UISkinSet`](/ExoJS/en/api/uiskin-set/) per role (`panel`, `button`, `label`, `progressBarTrack`, `progressBarFill`), and each skin carries a [`UIBackground`](/ExoJS/en/api/uibackground/) descriptor, a text style, and insets. Insets are layout input, so a theme change re-lays out as well as repaints. + +`createUITheme` resolves a patch against the built-in default, which reproduces the widgets' stock look. Assign the result to `scene.ui.theme` to restyle a whole layer, or call `widget.setTheme(patch)` to restyle one subtree: + +```ts +import { Color, createUITheme, Panel } from '@codexo/exojs'; + +const dark = createUITheme({ + panel: { + normal: { + background: { kind: 'fill', color: new Color(18, 20, 28, 1), borderColor: new Color(255, 255, 255, 0.08), borderWidth: 1, cornerRadius: 12 }, + }, + }, + button: { + hover: { + background: { kind: 'fill', color: new Color(90, 160, 250, 1), borderColor: Color.transparent, borderWidth: 0, cornerRadius: 8 }, + }, + }, +}); + +const dialog = new Panel({ width: 280, height: 160 }); + +dialog.setTheme({ panel: { normal: { background: dark.panel.normal.background } } }); +dialog.setFill({ color: new Color(40, 44, 60, 1) }); // this panel only, on top of its skin +``` + +A background descriptor is either a fill (the rounded rectangle above), `{ kind: 'none' }`, or a nine-slice: `{ kind: 'nineSlice', texture, slices: 8 }` paints a texture that stretches without distorting its corners. + +Per-widget style always goes through a setter — `setFill`, `setBackground`, `setTextStyle` — so a change repaints (and re-lays out where it can move something) immediately. Reading `panel.color` gives the value in effect, including the theme's; `panel.fillOverrides` gives only what this panel overrides. + ## Anchoring to the screen Widgets extend [`Widget`](/ExoJS/en/api/widget/), which adds an explicit layout size and screen-edge anchoring. `widget.anchorIn(scene.ui, anchor, offsetX, offsetY)` pins a widget to a corner or edge and re-applies the position whenever the canvas resizes: diff --git a/src/core/serialization/serializerHelpers.ts b/src/core/serialization/serializerHelpers.ts index e90b63144..ff7e6db37 100644 --- a/src/core/serialization/serializerHelpers.ts +++ b/src/core/serialization/serializerHelpers.ts @@ -84,6 +84,36 @@ export const serializeStyle = (style: { }; /** Rebuild {@link TextStyleOptions} from serialized style data, or `undefined`. */ +/** + * Serialize a partial text style - a widget's own style overrides - writing + * exactly the fields it names, so a widget that takes its style from a theme + * round-trips as "no override" instead of baking that theme's values in. A + * `FontFace` has no serialized form and is skipped. + */ +export const serializeStyleOptions = (options: TextStyleOptions | null): Record | undefined => { + if (options === null) { + return undefined; + } + + const out: Record = {}; + + for (const [key, value] of Object.entries(options)) { + if (value === undefined || key === 'font') { + continue; + } + + if (value instanceof Color) { + out[key] = colorToArray(value); + } else if (Array.isArray(value)) { + out[key] = (value as unknown[]).map(entry => (entry instanceof Color ? colorToArray(entry) : entry)); + } else { + out[key] = value; + } + } + + return Object.keys(out).length > 0 ? out : undefined; +}; + export const deserializeStyleOptions = (data: unknown): TextStyleOptions | undefined => { if (typeof data !== 'object' || data === null) { return undefined; diff --git a/src/core/serialization/uiSerializers.ts b/src/core/serialization/uiSerializers.ts index f2c1ce56e..982fc72b3 100644 --- a/src/core/serialization/uiSerializers.ts +++ b/src/core/serialization/uiSerializers.ts @@ -5,15 +5,28 @@ import { Panel } from '#ui/Panel'; import { ProgressBar } from '#ui/ProgressBar'; import { ScrollContainer, type ScrollDirection } from '#ui/ScrollContainer'; import { Stack } from '#ui/Stack'; +import type { UIFillPatch } from '#ui/theme'; import { UIRoot } from '#ui/UIRoot'; import type { NodeSerializer } from './NodeSerializer'; import { asSerializedNode } from './read'; import type { SerializationRegistry } from './SerializationRegistry'; -import { arrayToColor, colorToArray, compact, deserializeStyleOptions, serializeStyle } from './serializerHelpers'; +import { arrayToColor, colorToArray, compact, deserializeStyleOptions, serializeStyleOptions } from './serializerHelpers'; const num = (value: unknown): number | undefined => (typeof value === 'number' && Number.isFinite(value) ? value : undefined); +/** The fields a widget's fill overrides contribute, omitting what it does not override. */ +const serializeFill = (fill: UIFillPatch | null): Record => ({ + ...(fill?.color !== undefined && { color: colorToArray(fill.color) }), + ...(fill?.borderColor !== undefined && { borderColor: colorToArray(fill.borderColor) }), + ...(fill?.borderWidth !== undefined && { borderWidth: fill.borderWidth }), + ...(fill?.cornerRadius !== undefined && { cornerRadius: fill.cornerRadius }), +}); + +/** Just the colour of a fill override, under the key the widget's options use for it. */ +const serializeFillColor = (key: string, fill: UIFillPatch | null): Record => + fill?.color !== undefined ? { [key]: colorToArray(fill.color) } : {}; + // Widget composition note: widgets own internal children (a Label's Text, a // Panel's background Graphics, a ScrollContainer's content Container, etc.) that // their constructors rebuild - those are never serialized. Only user-added @@ -21,13 +34,18 @@ const num = (value: unknown): number | undefined => (typeof value === 'number' & // round-trip; for ScrollContainer those live one level down, inside `content`. // Anchoring (anchorIn) references a UIRoot and is not serialized; the resolved // position still round-trips via the common fields. +// +// Style: only a widget's OWN overrides round-trip, never the values it resolved +// from a theme - otherwise loading a scene under a different theme would replay +// the theme it was saved under. Whole-background overrides (`setBackground`) +// are skipped as well: a texture reference has no serialized form here. // ── Label ──────────────────────────────────────────────────────────────────── const labelSerializer: NodeSerializer