@almadar/ui 2.58.0 → 2.59.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +45078 -40666
- package/dist/avl/index.js +44821 -40409
- package/dist/components/atoms/TraitFrame.d.ts +54 -0
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/components/index.cjs +37022 -34434
- package/dist/components/index.js +36700 -33935
- package/dist/context/index.cjs +73 -5
- package/dist/context/index.js +73 -5
- package/dist/hooks/index.cjs +73 -5
- package/dist/hooks/index.js +73 -5
- package/dist/hooks/useUISlots.d.ts +28 -0
- package/dist/providers/index.cjs +37905 -4379
- package/dist/providers/index.js +37925 -4399
- package/dist/renderer/trait-binding-resolver.d.ts +53 -0
- package/dist/runtime/index.cjs +28622 -24075
- package/dist/runtime/index.js +25143 -20596
- package/dist/runtime/useTraitStateMachine.d.ts +3 -2
- package/package.json +5 -5
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TraitFrame — renders the current frame of a referenced trait.
|
|
3
|
+
*
|
|
4
|
+
* Resolves the `@trait.X[.slot]` binding at render time by looking up the
|
|
5
|
+
* referenced trait's last `render-ui` payload from the orbital's
|
|
6
|
+
* `UISlotManager`. Re-renders automatically when that trait transitions
|
|
7
|
+
* via the per-trait subscription channel (`subscribeTrait`).
|
|
8
|
+
*
|
|
9
|
+
* This is the single rendering primitive both runtime paths converge on:
|
|
10
|
+
*
|
|
11
|
+
* - **Interpreted path** — the trait-binding resolver in
|
|
12
|
+
* `renderer/trait-binding-resolver.ts` walks pattern trees at render
|
|
13
|
+
* time, substituting `"@trait.X"` string children with this component.
|
|
14
|
+
* - **Compiled path** — the TypeScript shell codegen in
|
|
15
|
+
* `orbital-shell-typescript/src/backend.rs::pattern_to_jsx_with_data`
|
|
16
|
+
* emits this component directly into generated JSX wherever a
|
|
17
|
+
* `@trait.*` string appears in a pattern tree.
|
|
18
|
+
*
|
|
19
|
+
* Embedding is passive: the referenced trait's state machine runs
|
|
20
|
+
* unchanged; TraitFrame is only a read-only lens on its current frame.
|
|
21
|
+
* Event propagation happens over the shared event bus, not through this
|
|
22
|
+
* component.
|
|
23
|
+
*
|
|
24
|
+
* @see docs/Almadar_Std_Gaps.md §3.8 for the full language design.
|
|
25
|
+
*/
|
|
26
|
+
import React from "react";
|
|
27
|
+
export interface TraitFrameProps {
|
|
28
|
+
/**
|
|
29
|
+
* Name of the trait whose current frame to embed. Must match a trait
|
|
30
|
+
* declared in the current orbital. Compiler validates that the name
|
|
31
|
+
* exists at build time (see `ORB_BINDING_TRAIT_UNKNOWN`).
|
|
32
|
+
*/
|
|
33
|
+
traitName: string;
|
|
34
|
+
/**
|
|
35
|
+
* Rendered when the referenced trait has not (yet) emitted any
|
|
36
|
+
* render-ui. Use a skeleton, spinner, or message. Defaults to `null`
|
|
37
|
+
* (renders nothing), so an unfulfilled reference drops cleanly out of
|
|
38
|
+
* a parent `children:` array.
|
|
39
|
+
*/
|
|
40
|
+
fallback?: React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Render the embedded trait's current frame via the registered pattern
|
|
44
|
+
* component for its `SlotContent.pattern` + `props`. Falls back when the
|
|
45
|
+
* referenced trait has no content in the target slot.
|
|
46
|
+
*
|
|
47
|
+
* The import path for pattern rendering matches what `SlotContentRenderer`
|
|
48
|
+
* uses, so both the top-level slot render path and this embedded path go
|
|
49
|
+
* through the same resolver (`getComponentForPattern` + prop handling).
|
|
50
|
+
*/
|
|
51
|
+
export declare function TraitFrame({ traitName, fallback, }: TraitFrameProps): React.ReactElement | null;
|
|
52
|
+
export declare namespace TraitFrame {
|
|
53
|
+
var displayName: string;
|
|
54
|
+
}
|
|
@@ -40,4 +40,5 @@ export { ContentSection, type ContentSectionProps, type ContentSectionBackground
|
|
|
40
40
|
export { PatternTile, getTileDimensions, type PatternTileProps, type PatternVariant } from "./PatternTile";
|
|
41
41
|
export { AnimatedReveal, type AnimatedRevealProps, type RevealTrigger, type RevealAnimation } from "./AnimatedReveal";
|
|
42
42
|
export { AnimatedGraphic, type AnimatedGraphicProps, type GraphicAnimation } from "./AnimatedGraphic";
|
|
43
|
+
export { TraitFrame, type TraitFrameProps } from "./TraitFrame";
|
|
43
44
|
export * from "./game";
|