@almadar/ui 2.58.0 → 2.59.1

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.
@@ -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";