@cueframe/kernel 0.2.3 → 0.2.5

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.
Files changed (41) hide show
  1. package/dist/_members/component-runtime/bake.d.ts +14 -0
  2. package/dist/_members/component-runtime/bake.d.ts.map +1 -1
  3. package/dist/_members/compose/primitiveRegistry.d.ts +2 -6
  4. package/dist/_members/composition/primitive-catalog/index.d.ts +4 -0
  5. package/dist/_members/mcp/generated/harness.d.ts +1 -1
  6. package/dist/_members/mcp/generated/inputSchemas.d.ts +1 -0
  7. package/dist/_members/mcp/inputSchemas.d.ts +6 -0
  8. package/dist/_members/mcp/server.d.ts +4 -1
  9. package/dist/_members/render-harness/prepareSceneBake.d.ts +5 -0
  10. package/dist/_members/render-harness/prepareSceneBake.d.ts.map +1 -0
  11. package/dist/authoring/build-tools.js +3 -3
  12. package/dist/authoring/tools.js +2 -2
  13. package/dist/authoring.js +4 -4
  14. package/dist/{chunk-AS5EXBNS.js → chunk-7AZLFN26.js} +12 -1
  15. package/dist/chunk-KQDZAHLP.js +3637 -0
  16. package/dist/{chunk-NUKDEOK6.js → chunk-MN6D3U5N.js} +1 -1
  17. package/dist/{chunk-32TH76H3.js → chunk-SC55VDLC.js} +2 -2
  18. package/dist/{chunk-X74EEFXV.js → chunk-TBNTAQJA.js} +1 -1
  19. package/dist/{chunk-UY77TMKD.js → chunk-VCSSJLOU.js} +24 -4
  20. package/dist/{chunk-F2DJL7P7.js → chunk-W6B7BMLO.js} +1 -1
  21. package/dist/component-runtime.js +1 -1
  22. package/dist/compose.js +181 -28
  23. package/dist/composition/primitive-catalog.js +3 -1
  24. package/dist/composition-ops.js +1 -1
  25. package/dist/core/render.js +1 -1
  26. package/dist/core.js +1 -1
  27. package/dist/mcp/adapter.js +1 -1
  28. package/dist/mcp/curation.js +1 -1
  29. package/dist/mcp/server.js +2 -2
  30. package/dist/mcp.js +2 -2
  31. package/dist/nle-export.js +1 -33
  32. package/dist/primitives/effects.js +2 -2
  33. package/dist/primitives/ui-blocks.js +4 -4
  34. package/dist/primitives.js +9 -9
  35. package/dist/render-harness/renderInputAssets.js +2 -2
  36. package/dist/render-harness.js +4 -4
  37. package/package.json +10 -10
  38. package/dist/chunk-E6WHXIDF.js +0 -3619
  39. package/dist/chunk-SX523NDS.js +0 -202
  40. package/dist/{chunk-YHC3RXS7.js → chunk-7W6ZIKWV.js} +3 -3
  41. package/dist/{chunk-B3GSTQLR.js → chunk-VLJOIUHL.js} +6 -6
@@ -1,202 +0,0 @@
1
- import {
2
- isContrastCritical
3
- } from "./chunk-YLDMAZZE.js";
4
- import {
5
- catalog
6
- } from "./chunk-ZS3A3QUM.js";
7
- import {
8
- catalog as catalog3
9
- } from "./chunk-FVDFPJHT.js";
10
- import {
11
- catalog as catalog6
12
- } from "./chunk-B3GSTQLR.js";
13
- import {
14
- catalog as catalog5
15
- } from "./chunk-RAXHCRVV.js";
16
- import {
17
- catalog as catalog2
18
- } from "./chunk-YHC3RXS7.js";
19
- import {
20
- catalog as catalog8
21
- } from "./chunk-RL5SO653.js";
22
- import {
23
- catalog as catalog4
24
- } from "./chunk-6EWRIAZA.js";
25
- import {
26
- catalog as catalog7
27
- } from "./chunk-I5QWBM3M.js";
28
- import {
29
- getPrimitiveSubtextParam,
30
- getPrimitiveTextParam
31
- } from "./chunk-AS5EXBNS.js";
32
- import {
33
- NEUTRAL_RAMP
34
- } from "./chunk-JF4JJAFP.js";
35
- import {
36
- CueframeError,
37
- encodeError
38
- } from "./chunk-J3DIUG24.js";
39
-
40
- // ../execution/compose/src/primitiveRegistry.ts
41
- var allCatalogs = [
42
- ...catalog,
43
- ...catalog2,
44
- ...catalog3,
45
- ...catalog4,
46
- ...catalog5,
47
- ...catalog6,
48
- ...catalog7,
49
- ...catalog8
50
- ];
51
- var registryMap = new Map(
52
- allCatalogs.map((meta) => [meta.id, meta])
53
- );
54
- var overrideMap = /* @__PURE__ */ new Map();
55
- var overrideOwner = null;
56
- function registerPrimitiveOverride(meta, owner) {
57
- if (overrideOwner !== null && overrideOwner !== owner) {
58
- throw new Error(
59
- `primitive override registry is single-tenant per process: owner '${overrideOwner}' already registered overrides; '${owner}' must call resetPrimitiveOverrides() first (or render in its own process). Registering a second tenant's overrides into the shared map would leak across tenants.`
60
- );
61
- }
62
- overrideOwner = owner;
63
- overrideMap.set(meta.id, meta);
64
- }
65
- function resetPrimitiveOverrides() {
66
- overrideMap.clear();
67
- overrideOwner = null;
68
- }
69
- function resolvePrimitive(id) {
70
- return overrideMap.get(id) ?? registryMap.get(id);
71
- }
72
- function listPrimitives() {
73
- return [...registryMap.keys()];
74
- }
75
- function resolveTransitionPresentation(id, params = {}) {
76
- const meta = resolvePrimitive(id);
77
- if (!meta) return void 0;
78
- if (meta.kind !== "transition") return void 0;
79
- if (typeof meta.createPresentation !== "function") return void 0;
80
- const validated = meta.paramsSchema ? meta.paramsSchema.parse(params) : params;
81
- return meta.createPresentation(validated);
82
- }
83
- function isRegisteredTransition(id) {
84
- const meta = resolvePrimitive(id);
85
- return !!meta && meta.kind === "transition";
86
- }
87
- function getPrimitiveText(overlay) {
88
- const canonical = overlay.params.text;
89
- if (typeof canonical === "string" && canonical.length > 0) return canonical;
90
- const textParam = getPrimitiveTextParam(overlay.template);
91
- if (typeof textParam === "string") {
92
- const native = overlay.params[textParam];
93
- if (typeof native === "string") return native;
94
- }
95
- return void 0;
96
- }
97
- function getPrimitiveSubtext(overlay) {
98
- const canonical = overlay.params.subtext;
99
- if (typeof canonical === "string" && canonical.length > 0) return canonical;
100
- const subtextParam = getPrimitiveSubtextParam(overlay.template);
101
- if (typeof subtextParam === "string") {
102
- const native = overlay.params[subtextParam];
103
- if (typeof native === "string") return native;
104
- }
105
- return void 0;
106
- }
107
- var BRAND_REF_PREFIX = "$brand:";
108
- var SAFE_NONCRITICAL_DEFAULT = "transparent";
109
- var HYPHEN_PATH_ALIASES = {
110
- "colors.text-on-accent": "colors.textOnAccent",
111
- "colors.text-on-surface": "colors.textOnSurface"
112
- };
113
- function lookupBrandPath(kit, path) {
114
- const normalized = HYPHEN_PATH_ALIASES[path] ?? path;
115
- const segments = normalized.split(".");
116
- let current = kit;
117
- for (const segment of segments) {
118
- if (current == null || typeof current !== "object") return void 0;
119
- current = current[segment];
120
- }
121
- return current;
122
- }
123
- function fallbackForMiss(path, binding) {
124
- const normalized = HYPHEN_PATH_ALIASES[path] ?? path;
125
- if (isContrastCritical(normalized)) {
126
- return NEUTRAL_RAMP.onDark;
127
- }
128
- if (binding?.fallback != null) {
129
- return binding.fallback;
130
- }
131
- return SAFE_NONCRITICAL_DEFAULT;
132
- }
133
- function resolveBrandValue(value, brandKit, binding, onUnresolved) {
134
- if (typeof value !== "string" || !value.startsWith(BRAND_REF_PREFIX)) return value;
135
- const path = value.slice(BRAND_REF_PREFIX.length);
136
- if (!brandKit) {
137
- onUnresolved?.({ path });
138
- return fallbackForMiss(path, binding);
139
- }
140
- const resolved = lookupBrandPath(brandKit, path);
141
- if (resolved === void 0) {
142
- onUnresolved?.({ path });
143
- return fallbackForMiss(path, binding);
144
- }
145
- return resolved;
146
- }
147
- function bindingsByBrandPath(meta) {
148
- const map = /* @__PURE__ */ new Map();
149
- if (!meta?.tokens) return map;
150
- for (const binding of meta.tokens) {
151
- if (binding.brandKitPath && !map.has(binding.brandKitPath)) {
152
- map.set(binding.brandKitPath, binding);
153
- }
154
- }
155
- return map;
156
- }
157
- function inflatePrimitiveProps(overlay, brandKit, onUnresolved) {
158
- const meta = resolvePrimitive(overlay.template);
159
- const { text, subtext, ...rest } = overlay.params;
160
- const result = {};
161
- const bindingForPath = bindingsByBrandPath(meta);
162
- for (const [key, value] of Object.entries(rest)) {
163
- const binding = typeof value === "string" && value.startsWith(BRAND_REF_PREFIX) ? bindingForPath.get(value.slice(BRAND_REF_PREFIX.length)) : void 0;
164
- result[key] = resolveBrandValue(value, brandKit, binding, onUnresolved);
165
- }
166
- if (meta?.textParam && typeof text === "string") {
167
- result[meta.textParam] = text;
168
- }
169
- if (meta?.subtextParam && typeof subtext === "string") {
170
- result[meta.subtextParam] = subtext;
171
- }
172
- if (meta?.paramsSchema) {
173
- const parsed = meta.paramsSchema.safeParse(result);
174
- if (!parsed.success) {
175
- const issues = parsed.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; ");
176
- throw new Error(
177
- encodeError(
178
- new CueframeError(
179
- "invalid_primitive_params",
180
- `${meta.id}: invalid params \u2014 ${issues}`,
181
- { primitiveId: meta.id }
182
- )
183
- )
184
- );
185
- }
186
- return parsed.data;
187
- }
188
- return result;
189
- }
190
-
191
- export {
192
- allCatalogs,
193
- registerPrimitiveOverride,
194
- resetPrimitiveOverrides,
195
- resolvePrimitive,
196
- listPrimitives,
197
- resolveTransitionPresentation,
198
- isRegisteredTransition,
199
- getPrimitiveText,
200
- getPrimitiveSubtext,
201
- inflatePrimitiveProps
202
- };
@@ -1,9 +1,9 @@
1
- import {
2
- FitText
3
- } from "./chunk-XHGZ2E77.js";
4
1
  import {
5
2
  EASING_BY_INTENT
6
3
  } from "./chunk-MFHXCHRI.js";
4
+ import {
5
+ FitText
6
+ } from "./chunk-XHGZ2E77.js";
7
7
  import {
8
8
  ACCENT,
9
9
  ACCENT_STRONG,
@@ -1,3 +1,9 @@
1
+ import {
2
+ DashboardPopulate
3
+ } from "./chunk-S5H6GH6M.js";
4
+ import {
5
+ useFrameScale
6
+ } from "./chunk-QAGGJHAF.js";
1
7
  import {
2
8
  resolveTypeface
3
9
  } from "./chunk-LT4PWSR2.js";
@@ -8,12 +14,6 @@ import {
8
14
  FitText,
9
15
  resolveFitFontSize
10
16
  } from "./chunk-XHGZ2E77.js";
11
- import {
12
- DashboardPopulate
13
- } from "./chunk-S5H6GH6M.js";
14
- import {
15
- useFrameScale
16
- } from "./chunk-QAGGJHAF.js";
17
17
  import {
18
18
  ACCENT,
19
19
  ACCENT_DEEP,