@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.
- package/dist/avl/index.cjs +45062 -40654
- package/dist/avl/index.js +44844 -40436
- 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 +28618 -24075
- package/dist/runtime/index.js +25140 -20597
- package/dist/runtime/useTraitStateMachine.d.ts +3 -2
- package/package.json +5 -5
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trait-binding resolver for the interpreted runtime path.
|
|
3
|
+
*
|
|
4
|
+
* When a pattern tree contains a string like `"@trait.ItemSearch"` or
|
|
5
|
+
* `"@trait.ItemSearch.main"` inside a `children:` array (or a
|
|
6
|
+
* `node`-typed prop), the `SlotContentRenderer` walker calls this
|
|
7
|
+
* resolver to transform those string leaves into `<TraitFrame>` React
|
|
8
|
+
* elements before rendering.
|
|
9
|
+
*
|
|
10
|
+
* This module only handles the INTERPRETED path — compiled apps bake
|
|
11
|
+
* `<TraitFrame>` into JSX at build time via the TypeScript shell
|
|
12
|
+
* codegen (`orbital-shell-typescript/src/backend.rs`). Both paths land
|
|
13
|
+
* on the same component.
|
|
14
|
+
*
|
|
15
|
+
* Scope:
|
|
16
|
+
* - string values `"@trait.X[.slot]"` are replaced with
|
|
17
|
+
* `<TraitFrame traitName="X" slot={...} />`.
|
|
18
|
+
* - strings that don't match the `@trait.*` shape pass through
|
|
19
|
+
* verbatim (they may be `@entity.X` bindings resolved elsewhere,
|
|
20
|
+
* or plain text content).
|
|
21
|
+
* - recurses into arrays and objects so nested children are covered.
|
|
22
|
+
*
|
|
23
|
+
* @see docs/Almadar_Std_Gaps.md §3.8
|
|
24
|
+
*/
|
|
25
|
+
export interface ResolveTraitBindingsContext {
|
|
26
|
+
/**
|
|
27
|
+
* Depth cap — the walker refuses to descend deeper than this to
|
|
28
|
+
* protect against deeply nested patterns (real or adversarial).
|
|
29
|
+
* Default 8; roughly matches the deepest layout trees seen in the
|
|
30
|
+
* std catalog plus head-room.
|
|
31
|
+
*/
|
|
32
|
+
depth?: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Walk a pattern-tree value, returning a structurally-identical tree
|
|
36
|
+
* with `@trait.*` string leaves replaced by `<TraitFrame>` React
|
|
37
|
+
* elements.
|
|
38
|
+
*
|
|
39
|
+
* The walker preserves insertion order of object keys and array
|
|
40
|
+
* positions — it only transforms the narrow subset of string values
|
|
41
|
+
* that match the `@trait.X[.slot]` form. Other strings are copied as-is.
|
|
42
|
+
*
|
|
43
|
+
* Call from `SlotContentRenderer` once per render, pointed at
|
|
44
|
+
* `content.props` with `currentSlot` bound to the slot whose render-ui
|
|
45
|
+
* is being composed.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveTraitBindingsInPattern(value: unknown, ctx: ResolveTraitBindingsContext): unknown;
|
|
48
|
+
/**
|
|
49
|
+
* Lower-level helper: is this string a `@trait.*` binding the resolver
|
|
50
|
+
* would handle? Useful for consumers that need to treat the trait case
|
|
51
|
+
* specially before handing the string back to the walker.
|
|
52
|
+
*/
|
|
53
|
+
export declare function isTraitBinding(value: unknown): value is string;
|