tempo-sdk 0.0.45 → 0.0.51
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/assets/editor.d.ts +1 -1
- package/dist/assets/editor.js +4 -2
- package/dist/assets/editor.js.map +1 -1
- package/dist/assets/index.d.ts +112 -24
- package/dist/assets/index.js +309 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/parser.d.ts +14 -3
- package/dist/assets/parser.js +7 -3
- package/dist/canvas/index.d.ts +1 -1
- package/dist/canvas/index.js +3 -2
- package/dist/canvas/index.js.map +1 -1
- package/dist/canvas/interact-projection.js +2 -1
- package/dist/canvas/svelte.d.ts +1 -1
- package/dist/canvas/svelte.js +1 -1
- package/dist/chunk-DI2ZFAWL.js +14 -0
- package/dist/chunk-DI2ZFAWL.js.map +1 -0
- package/dist/chunk-DX6XAXCK.js +827 -0
- package/dist/chunk-DX6XAXCK.js.map +1 -0
- package/dist/{chunk-7AJVPFFG.js → chunk-LFYKJJC5.js} +3 -3
- package/dist/{chunk-7AJVPFFG.js.map → chunk-LFYKJJC5.js.map} +1 -1
- package/dist/{chunk-IWULHYPW.js → chunk-O65OD3NA.js} +216 -19
- package/dist/chunk-O65OD3NA.js.map +1 -0
- package/dist/{chunk-7O6DPEMF.js → chunk-PULSTDX2.js} +9 -3
- package/dist/chunk-PULSTDX2.js.map +1 -0
- package/dist/{chunk-FIIU52RN.js → chunk-ZZYNOX24.js} +22 -810
- package/dist/chunk-ZZYNOX24.js.map +1 -0
- package/dist/index.js +86 -13
- package/dist/index.js.map +1 -1
- package/dist/nextjs/plugin.js +1 -1
- package/dist/nextjs.cjs +2 -2
- package/dist/nextjs.cjs.map +1 -1
- package/dist/nextjs.js +1 -1
- package/dist/{storyboard-xVaRTJAu.d.ts → storyboard-CBHki7Aw.d.ts} +2 -1
- package/dist/{types-B-dRoF2T.d.ts → types-C7cvcY6T.d.ts} +5 -1
- package/package.json +2 -2
- package/dist/chunk-7O6DPEMF.js.map +0 -1
- package/dist/chunk-FIIU52RN.js.map +0 -1
- package/dist/chunk-IWULHYPW.js.map +0 -1
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var UNRESOLVED_VALUE = Object.freeze({
|
|
6
|
-
$unresolved: true
|
|
7
|
-
});
|
|
8
|
-
function isUnresolvedValue(value) {
|
|
9
|
-
return typeof value === "object" && value !== null && $unresolvedKey in value && value.$unresolved === true;
|
|
10
|
-
}
|
|
11
|
-
var $unresolvedKey = "$unresolved";
|
|
1
|
+
import {
|
|
2
|
+
UNRESOLVED_VALUE,
|
|
3
|
+
isUnresolvedValue
|
|
4
|
+
} from "./chunk-DI2ZFAWL.js";
|
|
12
5
|
|
|
13
6
|
// assets/parser.ts
|
|
7
|
+
import { parseSync } from "oxc-parser";
|
|
14
8
|
var ASSET_SDK_IMPORT_SOURCE = "tempo-sdk/assets";
|
|
15
9
|
function parseAssetFile(filePath, source) {
|
|
16
10
|
const { program, errors } = parseAssetProgram(filePath, source);
|
|
@@ -26,6 +20,118 @@ function parseAssetFile(filePath, source) {
|
|
|
26
20
|
span: misimport.span
|
|
27
21
|
});
|
|
28
22
|
}
|
|
23
|
+
const constants = /* @__PURE__ */ new Map();
|
|
24
|
+
for (const statement of program.body) {
|
|
25
|
+
const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : statement;
|
|
26
|
+
if (declaration?.type !== "VariableDeclaration" || declaration.kind !== "const")
|
|
27
|
+
continue;
|
|
28
|
+
for (const binding of declaration.declarations)
|
|
29
|
+
if (binding.id.type === "Identifier" && binding.init)
|
|
30
|
+
constants.set(binding.id.name, binding.init);
|
|
31
|
+
}
|
|
32
|
+
const resolveConstants = (node, seen = /* @__PURE__ */ new Set(), depth = 0) => {
|
|
33
|
+
if (!node || depth > 16) return node;
|
|
34
|
+
if (node.type === "Identifier" && constants.has(node.name) && !seen.has(node.name))
|
|
35
|
+
return resolveConstants(
|
|
36
|
+
constants.get(node.name),
|
|
37
|
+
new Set(seen).add(node.name),
|
|
38
|
+
depth + 1
|
|
39
|
+
);
|
|
40
|
+
if (node.type === "JSXElement" || node.type === "JSXFragment") {
|
|
41
|
+
const element = node.openingElement;
|
|
42
|
+
const tag = element?.name?.type === "JSXIdentifier" ? element.name.name : "";
|
|
43
|
+
if (element && !tag) return node;
|
|
44
|
+
const reference = tag && /^[A-Z]/.test(tag) ? imports.referenceableImports.get(tag) : void 0;
|
|
45
|
+
if (tag && /^[A-Z]/.test(tag) && !reference) return node;
|
|
46
|
+
const props = {};
|
|
47
|
+
for (const attribute of element?.attributes ?? []) {
|
|
48
|
+
if (attribute.type !== "JSXAttribute" || attribute.name.type !== "JSXIdentifier")
|
|
49
|
+
return node;
|
|
50
|
+
props[attribute.name.name] = !attribute.value ? true : readStaticValue(
|
|
51
|
+
resolveConstants(
|
|
52
|
+
attribute.value.type === "JSXExpressionContainer" ? attribute.value.expression : attribute.value,
|
|
53
|
+
seen,
|
|
54
|
+
depth + 1
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
const children = [];
|
|
59
|
+
for (const child of node.children) {
|
|
60
|
+
if (child.type === "JSXText") {
|
|
61
|
+
const lines = child.value.replace(/\t/g, " ").split(/\r\n|\n|\r/);
|
|
62
|
+
const text = lines.map(
|
|
63
|
+
(line, i) => (i ? line.trimStart() : line).replace(
|
|
64
|
+
i < lines.length - 1 ? / +$/ : /$^/,
|
|
65
|
+
""
|
|
66
|
+
)
|
|
67
|
+
).filter(Boolean).join(" ");
|
|
68
|
+
if (text) children.push(text);
|
|
69
|
+
} else if (child.type === "JSXExpressionContainer" && child.expression.type === "JSXEmptyExpression")
|
|
70
|
+
continue;
|
|
71
|
+
else
|
|
72
|
+
children.push(
|
|
73
|
+
readStaticValue(
|
|
74
|
+
resolveConstants(
|
|
75
|
+
child.type === "JSXExpressionContainer" ? child.expression : child,
|
|
76
|
+
seen,
|
|
77
|
+
depth + 1
|
|
78
|
+
)
|
|
79
|
+
)
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
if (children.length)
|
|
83
|
+
props.children = children.length === 1 ? children[0] : children;
|
|
84
|
+
let source2 = reference?.importSpecifier;
|
|
85
|
+
if (source2?.startsWith(".")) {
|
|
86
|
+
const parts = filePath.replace(/\\/g, "/").split("/").slice(0, -1);
|
|
87
|
+
for (const part of source2.split("/")) {
|
|
88
|
+
if (part === "..") parts.pop();
|
|
89
|
+
else if (part !== ".") parts.push(part);
|
|
90
|
+
}
|
|
91
|
+
source2 = parts.join("/");
|
|
92
|
+
} else if (source2) source2 = `pkg:${source2}`;
|
|
93
|
+
return {
|
|
94
|
+
type: "TempoJsxValue",
|
|
95
|
+
value: {
|
|
96
|
+
$jsx: {
|
|
97
|
+
tag,
|
|
98
|
+
...reference ? { reference: { source: source2, importedName: reference.importedName } } : {},
|
|
99
|
+
props
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
if (node.type === "ArrowFunctionExpression" && !node.async && node.params.length === 0)
|
|
105
|
+
return { ...node, body: resolveConstants(node.body, seen, depth + 1) };
|
|
106
|
+
if (node.type === "ObjectExpression")
|
|
107
|
+
return {
|
|
108
|
+
...node,
|
|
109
|
+
properties: node.properties.map(
|
|
110
|
+
(property) => property.type === "Property" ? {
|
|
111
|
+
...property,
|
|
112
|
+
value: resolveConstants(property.value, seen, depth + 1),
|
|
113
|
+
shorthand: false
|
|
114
|
+
} : property
|
|
115
|
+
)
|
|
116
|
+
};
|
|
117
|
+
if (node.type === "ArrayExpression")
|
|
118
|
+
return {
|
|
119
|
+
...node,
|
|
120
|
+
elements: node.elements.map(
|
|
121
|
+
(item) => resolveConstants(item, seen, depth + 1)
|
|
122
|
+
)
|
|
123
|
+
};
|
|
124
|
+
if ([
|
|
125
|
+
"TSAsExpression",
|
|
126
|
+
"TSSatisfiesExpression",
|
|
127
|
+
"ParenthesizedExpression"
|
|
128
|
+
].includes(node.type))
|
|
129
|
+
return {
|
|
130
|
+
...node,
|
|
131
|
+
expression: resolveConstants(node.expression, seen, depth + 1)
|
|
132
|
+
};
|
|
133
|
+
return node;
|
|
134
|
+
};
|
|
29
135
|
const scope = collectTopLevelScope(program);
|
|
30
136
|
const declarations = [];
|
|
31
137
|
const declaredBindings = /* @__PURE__ */ new Set();
|
|
@@ -39,7 +145,19 @@ function parseAssetFile(filePath, source) {
|
|
|
39
145
|
topLevelCalls.add(call);
|
|
40
146
|
const declaration = readAssetDeclaration({
|
|
41
147
|
statement,
|
|
42
|
-
call
|
|
148
|
+
call: {
|
|
149
|
+
...call,
|
|
150
|
+
arguments: call.arguments.map(
|
|
151
|
+
(argument, index) => index === 1 && argument.type === "ObjectExpression" ? {
|
|
152
|
+
...argument,
|
|
153
|
+
properties: argument.properties.map(
|
|
154
|
+
(property) => property.type === "Property" && ["controls", "variants"].includes(
|
|
155
|
+
property.key.name ?? property.key.value
|
|
156
|
+
) ? { ...property, value: resolveConstants(property.value) } : property
|
|
157
|
+
)
|
|
158
|
+
} : argument
|
|
159
|
+
)
|
|
160
|
+
},
|
|
43
161
|
scope,
|
|
44
162
|
imports,
|
|
45
163
|
program,
|
|
@@ -59,6 +177,16 @@ function parseAssetFile(filePath, source) {
|
|
|
59
177
|
});
|
|
60
178
|
}
|
|
61
179
|
});
|
|
180
|
+
for (const declaration of declarations) {
|
|
181
|
+
const duplicate = errors.find(
|
|
182
|
+
(error) => error.code === "duplicate_declaration" && error.message.includes(`"${declaration.bindingName}"`)
|
|
183
|
+
);
|
|
184
|
+
if (duplicate)
|
|
185
|
+
declaration.warnings.push({
|
|
186
|
+
...duplicate,
|
|
187
|
+
code: "duplicate_asset_declaration"
|
|
188
|
+
});
|
|
189
|
+
}
|
|
62
190
|
return { filePath, declarations, errors };
|
|
63
191
|
}
|
|
64
192
|
function parseAssetProgram(filePath, source) {
|
|
@@ -105,6 +233,7 @@ function readSourceComments(filePath, source) {
|
|
|
105
233
|
}
|
|
106
234
|
function readAssetImports(program) {
|
|
107
235
|
const info = {
|
|
236
|
+
trustedDefineControlsNames: /* @__PURE__ */ new Set(),
|
|
108
237
|
trustedDefineAssetNames: /* @__PURE__ */ new Set(),
|
|
109
238
|
importedBindings: /* @__PURE__ */ new Map(),
|
|
110
239
|
referenceableImports: /* @__PURE__ */ new Map(),
|
|
@@ -138,6 +267,8 @@ function readAssetImports(program) {
|
|
|
138
267
|
importSpecifier: source,
|
|
139
268
|
importedName
|
|
140
269
|
});
|
|
270
|
+
if (trusted && importedName === "defineControls")
|
|
271
|
+
info.trustedDefineControlsNames.add(localName);
|
|
141
272
|
if (importedName !== "defineAsset") continue;
|
|
142
273
|
if (trusted) {
|
|
143
274
|
info.trustedDefineAssetNames.add(localName);
|
|
@@ -151,6 +282,29 @@ function readAssetImports(program) {
|
|
|
151
282
|
}
|
|
152
283
|
return info;
|
|
153
284
|
}
|
|
285
|
+
function parseControlsFile(filePath, source) {
|
|
286
|
+
const { program } = parseAssetProgram(filePath, source);
|
|
287
|
+
const imports = readAssetImports(program);
|
|
288
|
+
const scope = program ? collectTopLevelScope(program) : null;
|
|
289
|
+
return (program?.body ?? []).flatMap((statement) => {
|
|
290
|
+
const call = statement.type === "ExpressionStatement" ? statement.expression : null;
|
|
291
|
+
if (call?.type !== "CallExpression" || call.callee.type !== "Identifier" || !imports.trustedDefineControlsNames?.has(call.callee.name) || call.arguments.length !== 2 || call.arguments[0]?.type !== "Identifier")
|
|
292
|
+
return [];
|
|
293
|
+
const bindingName = call.arguments[0].name;
|
|
294
|
+
const reference = imports.referenceableImports.get(bindingName);
|
|
295
|
+
const binding = scope?.bindings.get(bindingName);
|
|
296
|
+
if (!reference && !binding) return [];
|
|
297
|
+
return [
|
|
298
|
+
{
|
|
299
|
+
bindingName,
|
|
300
|
+
reference,
|
|
301
|
+
exportKind: reference?.importedName === "default" ? "default" : binding?.exportKind ?? "named",
|
|
302
|
+
start: call.start,
|
|
303
|
+
end: call.end
|
|
304
|
+
}
|
|
305
|
+
];
|
|
306
|
+
});
|
|
307
|
+
}
|
|
154
308
|
function isTrustedAssetImportSource(source) {
|
|
155
309
|
return source === ASSET_SDK_IMPORT_SOURCE || source.endsWith(`/${ASSET_SDK_IMPORT_SOURCE}`);
|
|
156
310
|
}
|
|
@@ -335,7 +489,7 @@ function readAssetDeclaration(input) {
|
|
|
335
489
|
errors.push({
|
|
336
490
|
code: "duplicate_declaration",
|
|
337
491
|
severity: "structural",
|
|
338
|
-
message: `duplicate defineAsset call for "${bindingName}" \u2014
|
|
492
|
+
message: `duplicate defineAsset call for "${bindingName}" \u2014 keep one asset declaration`,
|
|
339
493
|
span: callSpan
|
|
340
494
|
});
|
|
341
495
|
return null;
|
|
@@ -350,6 +504,21 @@ function readAssetDeclaration(input) {
|
|
|
350
504
|
const usageInstructions = readUsageInstructions(configArg);
|
|
351
505
|
const libraries = readLibraries(configArg, spans, warnings);
|
|
352
506
|
const variants = readVariants(configArg, warnings);
|
|
507
|
+
if (getObjectProperty(configArg, "controls")) {
|
|
508
|
+
errors.push({
|
|
509
|
+
code: "invalid_control",
|
|
510
|
+
severity: "structural",
|
|
511
|
+
message: "Move controls to defineControls(Component, controls) in the component file or tempo/controls.ts."
|
|
512
|
+
});
|
|
513
|
+
return null;
|
|
514
|
+
}
|
|
515
|
+
const structural = warnings.filter(
|
|
516
|
+
(warning) => warning.severity === "structural"
|
|
517
|
+
);
|
|
518
|
+
if (structural.length) {
|
|
519
|
+
errors.push(...structural);
|
|
520
|
+
return null;
|
|
521
|
+
}
|
|
353
522
|
if (binding && binding.exportKind === "none") {
|
|
354
523
|
warnings.push({
|
|
355
524
|
code: "not_exported",
|
|
@@ -516,8 +685,31 @@ function readVariants(configNode, warnings) {
|
|
|
516
685
|
}
|
|
517
686
|
function readVariant(name, entry, warnings) {
|
|
518
687
|
const value = unwrapTsExpression(entry.value);
|
|
688
|
+
for (const property of value?.type === "ObjectExpression" ? value.properties : []) {
|
|
689
|
+
if (property.type !== "Property" || property.computed || !["props", "render"].includes(readPropertyKeyName(property.key) ?? "")) {
|
|
690
|
+
warnings.push({
|
|
691
|
+
code: "invalid_variant_config",
|
|
692
|
+
severity: "structural",
|
|
693
|
+
message: `Variant "${name}" accepts either props or render, with explicit keys and no spreads or inheritance`,
|
|
694
|
+
span: toSourceSpan(property)
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
const renderProperty = value?.type === "ObjectExpression" ? getObjectProperty(value, "render") : null;
|
|
519
699
|
const propsProperty = value?.type === "ObjectExpression" ? getObjectProperty(value, "props") : null;
|
|
520
|
-
const
|
|
700
|
+
const fn = unwrapTsExpression(renderProperty?.value);
|
|
701
|
+
const body = unwrapTsExpression(fn?.body);
|
|
702
|
+
const jsx = body?.type === "TempoJsxValue" ? readStaticValue(body) : UNRESOLVED_VALUE;
|
|
703
|
+
const validRender = fn?.type === "ArrowFunctionExpression" && !fn.async && fn.params.length === 0 && !propsProperty && !containsUnresolvedValue(jsx);
|
|
704
|
+
if (renderProperty && !validRender)
|
|
705
|
+
warnings.push({
|
|
706
|
+
code: "invalid_variant_config",
|
|
707
|
+
severity: "structural",
|
|
708
|
+
message: `Variant "${name}" render must be a parameterless arrow returning static JSX, without props, statements, hooks, callbacks, or computed expressions. Move logic into an imported component.`,
|
|
709
|
+
span: toSourceSpan(renderProperty)
|
|
710
|
+
});
|
|
711
|
+
const render = renderProperty && validRender ? { jsx } : void 0;
|
|
712
|
+
const propsValue = propsProperty ? readStaticValue(propsProperty.value) : render ? {} : UNRESOLVED_VALUE;
|
|
521
713
|
const props = isPlainRecord(propsValue) ? propsValue : {};
|
|
522
714
|
const hasUnresolvedValues = !isPlainRecord(propsValue) || containsUnresolvedValue(propsValue);
|
|
523
715
|
if (hasUnresolvedValues) {
|
|
@@ -528,12 +720,14 @@ function readVariant(name, entry, warnings) {
|
|
|
528
720
|
span: toSourceSpan(entry)
|
|
529
721
|
});
|
|
530
722
|
}
|
|
531
|
-
return { name, props, hasUnresolvedValues };
|
|
723
|
+
return { name, props, hasUnresolvedValues, ...render ? { render } : {} };
|
|
532
724
|
}
|
|
533
725
|
function readStaticValue(node) {
|
|
534
726
|
const expression = unwrapTsExpression(node);
|
|
535
727
|
if (!expression) return UNRESOLVED_VALUE;
|
|
536
728
|
switch (expression.type) {
|
|
729
|
+
case "TempoJsxValue":
|
|
730
|
+
return expression.value;
|
|
537
731
|
case "Literal": {
|
|
538
732
|
if (expression.regex || expression.bigint) return UNRESOLVED_VALUE;
|
|
539
733
|
const { value } = expression;
|
|
@@ -561,7 +755,11 @@ function readStaticValue(node) {
|
|
|
561
755
|
}
|
|
562
756
|
const key = readPropertyKeyName(property.key);
|
|
563
757
|
if (key === null) return UNRESOLVED_VALUE;
|
|
564
|
-
record
|
|
758
|
+
Object.defineProperty(record, key, {
|
|
759
|
+
value: readStaticValue(property.value),
|
|
760
|
+
enumerable: true,
|
|
761
|
+
configurable: true
|
|
762
|
+
});
|
|
565
763
|
}
|
|
566
764
|
return record;
|
|
567
765
|
}
|
|
@@ -634,17 +832,16 @@ function walk(node, visitor, seen = /* @__PURE__ */ new Set()) {
|
|
|
634
832
|
}
|
|
635
833
|
|
|
636
834
|
export {
|
|
637
|
-
UNRESOLVED_VALUE,
|
|
638
|
-
isUnresolvedValue,
|
|
639
835
|
ASSET_SDK_IMPORT_SOURCE,
|
|
640
836
|
parseAssetFile,
|
|
641
837
|
parseAssetProgram,
|
|
642
838
|
readSourceComments,
|
|
643
839
|
readAssetImports,
|
|
840
|
+
parseControlsFile,
|
|
644
841
|
collectTopLevelScope,
|
|
645
842
|
hasTopLevelDefineAssetCallFor,
|
|
646
843
|
collectIdentifierNames,
|
|
647
844
|
unwrapTsExpression,
|
|
648
845
|
toSourceSpan
|
|
649
846
|
};
|
|
650
|
-
//# sourceMappingURL=chunk-
|
|
847
|
+
//# sourceMappingURL=chunk-O65OD3NA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../assets/parser.ts"],"sourcesContent":["/**\n * Static parser for `defineAsset` declarations (specs/asset-libraries.md §3).\n *\n * Mirrors the construction of canvas/parser.ts: oxc-parser `parseSync`, an\n * import map that only trusts `defineAsset` imported from \"tempo-sdk/assets\"\n * (or a local path ending \"/tempo-sdk/assets\"), and a manual walk over\n * module-top-level statements. Never executes user code — the whole pipeline\n * is text → AST → data.\n *\n * Alongside `parseAssetFile`, this module exports the program-level analysis\n * helpers (`parseAssetProgram`, `readAssetImports`, `collectTopLevelScope`,\n * `hasTopLevelDefineAssetCallFor`, `collectIdentifierNames`) that the\n * colocated span-based editor (./editor.ts) shares, so import-trust rules and\n * binding resolution cannot drift between the two.\n */\nimport { parseSync } from \"oxc-parser\";\n\nimport {\n UNRESOLVED_VALUE,\n isUnresolvedValue,\n type AssetExportKind,\n type AssetParseError,\n type AssetSourceSpan,\n type AssetSpans,\n type ParsedAssetDeclaration,\n type ParsedAssetFile,\n type ParsedAssetReference,\n type ParsedAssetVariant,\n type StaticValue,\n} from \"./types\";\n\nexport * from \"./types\";\n\n/** The one module specifier `defineAsset` may be imported from. */\nexport const ASSET_SDK_IMPORT_SOURCE = \"tempo-sdk/assets\";\n\nexport function parseAssetFile(\n filePath: string,\n source: string,\n): ParsedAssetFile {\n const { program, errors } = parseAssetProgram(filePath, source);\n if (!program) {\n return { filePath, declarations: [], errors };\n }\n\n const imports = readAssetImports(program);\n for (const misimport of imports.misimports) {\n errors.push({\n code: \"misimported_define_asset\",\n severity: \"structural\",\n message: `defineAsset must be imported from \"${ASSET_SDK_IMPORT_SOURCE}\" — found import from \"${misimport.source}\"`,\n span: misimport.span,\n });\n }\n\n const constants = new Map<string, any>();\n for (const statement of program.body) {\n const declaration =\n statement.type === \"ExportNamedDeclaration\"\n ? statement.declaration\n : statement;\n if (\n declaration?.type !== \"VariableDeclaration\" ||\n declaration.kind !== \"const\"\n )\n continue;\n for (const binding of declaration.declarations)\n if (binding.id.type === \"Identifier\" && binding.init)\n constants.set(binding.id.name, binding.init);\n }\n const resolveConstants = (\n node: any,\n seen = new Set<string>(),\n depth = 0,\n ): any => {\n if (!node || depth > 16) return node;\n if (\n node.type === \"Identifier\" &&\n constants.has(node.name) &&\n !seen.has(node.name)\n )\n return resolveConstants(\n constants.get(node.name),\n new Set(seen).add(node.name),\n depth + 1,\n );\n if (node.type === \"JSXElement\" || node.type === \"JSXFragment\") {\n const element = node.openingElement;\n const tag =\n element?.name?.type === \"JSXIdentifier\" ? element.name.name : \"\";\n if (element && !tag) return node;\n const reference =\n tag && /^[A-Z]/.test(tag)\n ? imports.referenceableImports.get(tag)\n : undefined;\n if (tag && /^[A-Z]/.test(tag) && !reference) return node;\n const props: Record<string, StaticValue> = {};\n for (const attribute of element?.attributes ?? []) {\n if (\n attribute.type !== \"JSXAttribute\" ||\n attribute.name.type !== \"JSXIdentifier\"\n )\n return node;\n props[attribute.name.name] = !attribute.value\n ? true\n : readStaticValue(\n resolveConstants(\n attribute.value.type === \"JSXExpressionContainer\"\n ? attribute.value.expression\n : attribute.value,\n seen,\n depth + 1,\n ),\n );\n }\n const children: StaticValue[] = [];\n for (const child of node.children) {\n if (child.type === \"JSXText\") {\n const lines = child.value.replace(/\\t/g, \" \").split(/\\r\\n|\\n|\\r/);\n const text = lines\n .map((line: string, i: number) =>\n (i ? line.trimStart() : line).replace(\n i < lines.length - 1 ? / +$/ : /$^/,\n \"\",\n ),\n )\n .filter(Boolean)\n .join(\" \");\n if (text) children.push(text);\n } else if (\n child.type === \"JSXExpressionContainer\" &&\n child.expression.type === \"JSXEmptyExpression\"\n )\n continue;\n else\n children.push(\n readStaticValue(\n resolveConstants(\n child.type === \"JSXExpressionContainer\"\n ? child.expression\n : child,\n seen,\n depth + 1,\n ),\n ),\n );\n }\n if (children.length)\n props.children = children.length === 1 ? children[0]! : children;\n let source = reference?.importSpecifier;\n if (source?.startsWith(\".\")) {\n const parts = filePath.replace(/\\\\/g, \"/\").split(\"/\").slice(0, -1);\n for (const part of source.split(\"/\")) {\n if (part === \"..\") parts.pop();\n else if (part !== \".\") parts.push(part);\n }\n source = parts.join(\"/\");\n } else if (source) source = `pkg:${source}`;\n return {\n type: \"TempoJsxValue\",\n value: {\n $jsx: {\n tag,\n ...(reference\n ? { reference: { source, importedName: reference.importedName } }\n : {}),\n props,\n },\n },\n };\n }\n // Only expression-bodied, parameterless arrows are render templates.\n // Preserve the function shape so readVariant can reject every other form.\n if (\n node.type === \"ArrowFunctionExpression\" &&\n !node.async &&\n node.params.length === 0\n )\n return { ...node, body: resolveConstants(node.body, seen, depth + 1) };\n if (node.type === \"ObjectExpression\")\n return {\n ...node,\n properties: node.properties.map((property: any) =>\n property.type === \"Property\"\n ? {\n ...property,\n value: resolveConstants(property.value, seen, depth + 1),\n shorthand: false,\n }\n : property,\n ),\n };\n if (node.type === \"ArrayExpression\")\n return {\n ...node,\n elements: node.elements.map((item: any) =>\n resolveConstants(item, seen, depth + 1),\n ),\n };\n if (\n [\n \"TSAsExpression\",\n \"TSSatisfiesExpression\",\n \"ParenthesizedExpression\",\n ].includes(node.type)\n )\n return {\n ...node,\n expression: resolveConstants(node.expression, seen, depth + 1),\n };\n return node;\n };\n const scope = collectTopLevelScope(program);\n const declarations: ParsedAssetDeclaration[] = [];\n const declaredBindings = new Set<string>();\n const topLevelCalls = new Set<any>();\n\n for (const statement of program.body ?? []) {\n const call = readTopLevelTrustedCall(\n statement,\n imports.trustedDefineAssetNames,\n );\n if (!call) continue;\n topLevelCalls.add(call);\n const declaration = readAssetDeclaration({\n statement,\n call: {\n ...call,\n arguments: call.arguments.map((argument: any, index: number) =>\n index === 1 && argument.type === \"ObjectExpression\"\n ? {\n ...argument,\n properties: argument.properties.map((property: any) =>\n property.type === \"Property\" &&\n [\"controls\", \"variants\"].includes(\n property.key.name ?? property.key.value,\n )\n ? { ...property, value: resolveConstants(property.value) }\n : property,\n ),\n }\n : argument,\n ),\n },\n scope,\n imports,\n program,\n source,\n errors,\n declaredBindings,\n });\n if (declaration) declarations.push(declaration);\n }\n\n // A trusted defineAsset call anywhere but a module-top-level statement\n // (inside a function, wrapped in another expression, …) has no stable\n // identity — report it rather than silently ignoring it (§3.4).\n walk(program, (node) => {\n if (\n node.type === \"CallExpression\" &&\n node.callee?.type === \"Identifier\" &&\n imports.trustedDefineAssetNames.has(node.callee.name) &&\n !topLevelCalls.has(node)\n ) {\n errors.push({\n code: \"non_top_level_call\",\n severity: \"structural\",\n message:\n \"defineAsset must be called as a top-level statement — in the file that defines the component, or in a canvas file that imports it\",\n span: toSourceSpan(node),\n });\n }\n });\n\n for (const declaration of declarations) {\n const duplicate = errors.find(\n (error) =>\n error.code === \"duplicate_declaration\" &&\n error.message.includes(`\"${declaration.bindingName}\"`),\n );\n if (duplicate)\n declaration.warnings.push({\n ...duplicate,\n code: \"duplicate_asset_declaration\",\n });\n }\n return { filePath, declarations, errors };\n}\n\n/**\n * Editor-support: parse and return the raw oxc program. A file with syntax\n * errors returns `program: null` plus structural `unparseable_source` errors\n * — a recovered AST has untrustworthy spans, so both parser and editor fail\n * closed on it.\n */\nexport function parseAssetProgram(\n filePath: string,\n source: string,\n): { program: any | null; errors: AssetParseError[] } {\n try {\n const result = parseSync(filePath, source) as any;\n const errors: AssetParseError[] = (result.errors ?? []).map(\n (error: any) => ({\n code: \"unparseable_source\" as const,\n severity: \"structural\" as const,\n message: error?.message ?? \"Unable to parse asset source\",\n span: toSourceSpan(error) ?? toSourceSpan(error?.labels?.[0]),\n }),\n );\n if (errors.length > 0) return { program: null, errors };\n return { program: result.program, errors: [] };\n } catch (error) {\n return {\n program: null,\n errors: [\n {\n code: \"unparseable_source\",\n severity: \"structural\",\n message:\n error instanceof Error\n ? error.message\n : \"Unable to parse asset source\",\n },\n ],\n };\n }\n}\n\n/** One comment's text (delimiters stripped) and source span. */\nexport type SourceComment = {\n value: string;\n span: AssetSourceSpan;\n};\n\n/**\n * Every comment (line and block) in a source file, for consumers that\n * validate documentation conventions (e.g. the asset index's canvas-pointer\n * check). Returns `null` when the file does not parse — comments recovered\n * from a broken AST are untrustworthy, so callers must treat the file as\n * uninspectable rather than comment-free.\n */\nexport function readSourceComments(\n filePath: string,\n source: string,\n): SourceComment[] | null {\n try {\n const result = parseSync(filePath, source) as any;\n if ((result.errors ?? []).length > 0) return null;\n return (result.comments ?? []).flatMap((comment: any) =>\n typeof comment?.value === \"string\"\n ? [\n {\n value: comment.value,\n span: toSourceSpan(comment) ?? { start: 0, end: 0 },\n },\n ]\n : [],\n );\n } catch {\n return null;\n }\n}\n\nexport type AssetImportInfo = {\n /** Added after the original public parser contract; optional so existing\n * callers can continue constructing `AssetImportInfo` object literals. */\n trustedDefineControlsNames?: Set<string>;\n /** Local names bound to `defineAsset` imported from tempo-sdk/assets. */\n trustedDefineAssetNames: Set<string>;\n /** Every value-import local name → its module specifier. */\n importedBindings: Map<string, string>;\n /** Named/default value imports a reference declaration may target: local\n * name → specifier + imported name (\"default\" for default imports).\n * Namespace imports are excluded — they cannot name one component. */\n referenceableImports: Map<string, ParsedAssetReference>;\n /** Span of every import declaration, in source order (editor placement). */\n importDeclarationSpans: AssetSourceSpan[];\n /** `defineAsset` imports using a wrong tempo-sdk-family specifier. The span\n * covers the source string literal, quotes included. */\n misimports: { source: string; span: AssetSourceSpan }[];\n};\n\nexport function readAssetImports(program: any): AssetImportInfo {\n const info: AssetImportInfo = {\n trustedDefineControlsNames: new Set(),\n trustedDefineAssetNames: new Set(),\n importedBindings: new Map(),\n referenceableImports: new Map(),\n importDeclarationSpans: [],\n misimports: [],\n };\n\n for (const statement of program?.body ?? []) {\n if (\n statement?.type !== \"ImportDeclaration\" ||\n typeof statement.source?.value !== \"string\"\n ) {\n continue;\n }\n const declarationSpan = toSourceSpan(statement);\n if (declarationSpan) info.importDeclarationSpans.push(declarationSpan);\n if (statement.importKind === \"type\") continue;\n\n const source = statement.source.value;\n const trusted = isTrustedAssetImportSource(source);\n\n for (const specifier of statement.specifiers ?? []) {\n if (specifier?.importKind === \"type\") continue;\n const localName = specifier?.local?.name;\n if (typeof localName !== \"string\") continue;\n info.importedBindings.set(localName, source);\n\n if (specifier.type === \"ImportDefaultSpecifier\") {\n info.referenceableImports.set(localName, {\n importSpecifier: source,\n importedName: \"default\",\n });\n continue;\n }\n if (specifier.type !== \"ImportSpecifier\") continue;\n const importedName =\n specifier.imported?.name ?? specifier.imported?.value ?? localName;\n info.referenceableImports.set(localName, {\n importSpecifier: source,\n importedName,\n });\n if (trusted && importedName === \"defineControls\")\n info.trustedDefineControlsNames!.add(localName);\n if (importedName !== \"defineAsset\") continue;\n\n if (trusted) {\n info.trustedDefineAssetNames.add(localName);\n } else if (isMisimportedAssetSdkSource(source)) {\n info.misimports.push({\n source,\n span: toSourceSpan(statement.source) ??\n declarationSpan ?? { start: 0, end: 0 },\n });\n }\n }\n }\n\n return info;\n}\n\n/** Discover control owners without evaluating their config or requiring an asset. */\nexport function parseControlsFile(\n filePath: string,\n source: string,\n): {\n bindingName: string;\n reference?: ParsedAssetReference;\n exportKind: AssetExportKind;\n start: number;\n end: number;\n}[] {\n const { program } = parseAssetProgram(filePath, source);\n const imports = readAssetImports(program);\n const scope = program ? collectTopLevelScope(program) : null;\n return (program?.body ?? []).flatMap((statement: any) => {\n const call =\n statement.type === \"ExpressionStatement\" ? statement.expression : null;\n if (\n call?.type !== \"CallExpression\" ||\n call.callee.type !== \"Identifier\" ||\n !imports.trustedDefineControlsNames?.has(call.callee.name) ||\n call.arguments.length !== 2 ||\n call.arguments[0]?.type !== \"Identifier\"\n )\n return [];\n const bindingName = call.arguments[0].name as string;\n const reference = imports.referenceableImports.get(bindingName);\n const binding = scope?.bindings.get(bindingName);\n if (!reference && !binding) return [];\n return [\n {\n bindingName,\n reference,\n exportKind:\n reference?.importedName === \"default\"\n ? (\"default\" as const)\n : (binding?.exportKind ?? (\"named\" as const)),\n start: call.start as number,\n end: call.end as number,\n },\n ];\n });\n}\n\nfunction isTrustedAssetImportSource(source: string): boolean {\n return (\n source === ASSET_SDK_IMPORT_SOURCE ||\n source.endsWith(`/${ASSET_SDK_IMPORT_SOURCE}`)\n );\n}\n\nfunction isMisimportedAssetSdkSource(source: string): boolean {\n return (\n (source === \"tempo-sdk\" || source.startsWith(\"tempo-sdk/\")) &&\n !isTrustedAssetImportSource(source)\n );\n}\n\nexport type AssetTopLevelBinding = {\n name: string;\n /** Whole top-level statement declaring the binding, export keyword\n * included — the editor inserts defineAsset statements after it. */\n statementSpan: AssetSourceSpan;\n exportKind: AssetExportKind;\n};\n\nexport type AssetTopLevelScope = {\n /** Plain top-level bindings defineAsset may target: function/class\n * declarations and initialized `const`/`let`/`var` declarators. */\n bindings: Map<string, AssetTopLevelBinding>;\n /** Top-level names bound only via destructuring patterns or uninitialized\n * declarators — they exist, but defineAsset cannot target them; kept so\n * error messages can say why. */\n nonSimpleNames: Set<string>;\n};\n\nexport function collectTopLevelScope(program: any): AssetTopLevelScope {\n const bindings = new Map<string, AssetTopLevelBinding>();\n const nonSimpleNames = new Set<string>();\n const namedExports = new Set<string>();\n const defaultExports = new Set<string>();\n\n const register = (\n declaration: any,\n statementSpan: AssetSourceSpan,\n exported: \"named\" | \"default\" | null,\n ) => {\n const markExported = (name: string) => {\n if (exported === \"named\") namedExports.add(name);\n if (exported === \"default\") defaultExports.add(name);\n };\n\n if (\n declaration?.type === \"FunctionDeclaration\" ||\n declaration?.type === \"ClassDeclaration\"\n ) {\n const name = declaration.id?.name;\n if (typeof name === \"string\") {\n bindings.set(name, { name, statementSpan, exportKind: \"none\" });\n markExported(name);\n }\n return;\n }\n\n if (declaration?.type === \"VariableDeclaration\") {\n for (const declarator of declaration.declarations ?? []) {\n if (declarator?.id?.type === \"Identifier\") {\n const name = declarator.id.name;\n if (declarator.init) {\n bindings.set(name, { name, statementSpan, exportKind: \"none\" });\n markExported(name);\n } else {\n nonSimpleNames.add(name);\n }\n } else {\n collectPatternNames(declarator?.id, nonSimpleNames);\n }\n }\n }\n };\n\n for (const statement of program?.body ?? []) {\n const statementSpan = toSourceSpan(statement) ?? { start: 0, end: 0 };\n\n if (statement?.type === \"ExportNamedDeclaration\") {\n if (statement.declaration) {\n register(statement.declaration, statementSpan, \"named\");\n }\n // `export { X } from \"./y\"` re-exports another module's binding, not a\n // local one — only sourceless specifier lists mark local bindings.\n if (!statement.source) {\n for (const specifier of statement.specifiers ?? []) {\n if (specifier?.type !== \"ExportSpecifier\") continue;\n const localName = specifier.local?.name;\n if (typeof localName !== \"string\") continue;\n const exportedName =\n specifier.exported?.name ?? specifier.exported?.value;\n (exportedName === \"default\" ? defaultExports : namedExports).add(\n localName,\n );\n }\n }\n continue;\n }\n\n if (statement?.type === \"ExportDefaultDeclaration\") {\n const declaration = statement.declaration;\n if (\n declaration?.type === \"FunctionDeclaration\" ||\n declaration?.type === \"ClassDeclaration\"\n ) {\n register(declaration, statementSpan, \"default\");\n } else {\n const expression = unwrapTsExpression(declaration);\n if (expression?.type === \"Identifier\") {\n defaultExports.add(expression.name);\n }\n }\n continue;\n }\n\n register(statement, statementSpan, null);\n }\n\n // A binding exported both ways reports \"default\" — the module's primary\n // export identity wins over the incidental named alias.\n for (const binding of bindings.values()) {\n binding.exportKind = defaultExports.has(binding.name)\n ? \"default\"\n : namedExports.has(binding.name)\n ? \"named\"\n : \"none\";\n }\n\n return { bindings, nonSimpleNames };\n}\n\nfunction collectPatternNames(pattern: any, names: Set<string>): void {\n if (!pattern || typeof pattern !== \"object\") return;\n if (pattern.type === \"Identifier\" && typeof pattern.name === \"string\") {\n names.add(pattern.name);\n return;\n }\n if (pattern.type === \"ObjectPattern\") {\n for (const property of pattern.properties ?? []) {\n collectPatternNames(property?.value ?? property?.argument, names);\n }\n return;\n }\n if (pattern.type === \"ArrayPattern\") {\n for (const element of pattern.elements ?? []) {\n collectPatternNames(element, names);\n }\n return;\n }\n if (pattern.type === \"AssignmentPattern\") {\n collectPatternNames(pattern.left, names);\n return;\n }\n if (pattern.type === \"RestElement\") {\n collectPatternNames(pattern.argument, names);\n }\n}\n\n/**\n * Editor-support: true when any module-top-level trusted defineAsset call\n * targets `bindingName`, regardless of whether the call parses cleanly —\n * the editor must not insert a second declaration next to a broken one.\n */\nexport function hasTopLevelDefineAssetCallFor(\n program: any,\n trustedNames: Set<string>,\n bindingName: string,\n): boolean {\n for (const statement of program?.body ?? []) {\n const call = readTopLevelTrustedCall(statement, trustedNames);\n if (!call) continue;\n const componentArg = unwrapTsExpression(call.arguments?.[0]);\n if (\n componentArg?.type === \"Identifier\" &&\n componentArg.name === bindingName\n ) {\n return true;\n }\n }\n return false;\n}\n\n/** Editor-support: every Identifier/JSXIdentifier name appearing anywhere in\n * the program — used to deconflict generated binding names. */\nexport function collectIdentifierNames(program: any): Set<string> {\n const names = new Set<string>();\n walk(program, (node) => {\n if (\n (node.type === \"Identifier\" || node.type === \"JSXIdentifier\") &&\n typeof node.name === \"string\"\n ) {\n names.add(node.name);\n }\n });\n return names;\n}\n\nfunction readTopLevelTrustedCall(\n statement: any,\n trustedNames: Set<string>,\n): any | null {\n if (statement?.type !== \"ExpressionStatement\") return null;\n const expression = unwrapTsExpression(statement.expression);\n if (\n expression?.type === \"CallExpression\" &&\n expression.callee?.type === \"Identifier\" &&\n trustedNames.has(expression.callee.name)\n ) {\n return expression;\n }\n return null;\n}\n\nfunction readAssetDeclaration(input: {\n statement: any;\n call: any;\n scope: AssetTopLevelScope;\n imports: AssetImportInfo;\n program: any;\n source: string;\n errors: AssetParseError[];\n declaredBindings: Set<string>;\n}): ParsedAssetDeclaration | null {\n const { statement, call, scope, imports, program, source, errors } = input;\n const callSpan = statementSpanWithSemicolon(source, statement);\n const args = call.arguments ?? [];\n\n if (args.length !== 2) {\n errors.push({\n code: \"invalid_call_arguments\",\n severity: \"structural\",\n message: `defineAsset takes exactly two arguments (component, config) — found ${args.length}`,\n span: callSpan,\n });\n return null;\n }\n\n const componentArg = unwrapTsExpression(args[0]);\n if (componentArg?.type !== \"Identifier\") {\n errors.push({\n code: \"non_identifier_component\",\n severity: \"structural\",\n message:\n \"defineAsset's first argument must be an identifier naming a component defined in this file\",\n span: toSourceSpan(args[0]) ?? callSpan,\n });\n return null;\n }\n\n const bindingName = componentArg.name;\n const binding = scope.bindings.get(bindingName);\n // A named/default import target makes this a reference declaration: the\n // asset's identity is the import itself, resolved downstream where\n // workspace context exists (§2.7).\n const reference = binding\n ? undefined\n : imports.referenceableImports.get(bindingName);\n if (!binding && !reference) {\n errors.push(\n classifyMissingBinding(\n bindingName,\n scope,\n imports,\n program,\n toSourceSpan(componentArg) ?? callSpan,\n ),\n );\n return null;\n }\n\n const configArg = unwrapTsExpression(args[1]);\n if (configArg?.type !== \"ObjectExpression\") {\n errors.push({\n code: \"config_not_object_literal\",\n severity: \"structural\",\n message:\n \"defineAsset's config must be an inline object literal — the span-based editor needs literal spans to mutate\",\n span: toSourceSpan(args[1]) ?? callSpan,\n });\n return null;\n }\n\n if (input.declaredBindings.has(bindingName)) {\n errors.push({\n code: \"duplicate_declaration\",\n severity: \"structural\",\n message: `duplicate defineAsset call for \"${bindingName}\" — keep one asset declaration`,\n span: callSpan,\n });\n return null;\n }\n input.declaredBindings.add(bindingName);\n\n const warnings: AssetParseError[] = [];\n const spans: AssetSpans = {\n call: callSpan,\n config: toSourceSpan(configArg) ?? callSpan,\n libraryItems: [],\n };\n\n const usageInstructions = readUsageInstructions(configArg);\n const libraries = readLibraries(configArg, spans, warnings);\n const variants = readVariants(configArg, warnings);\n if (getObjectProperty(configArg, \"controls\")) {\n errors.push({\n code: \"invalid_control\",\n severity: \"structural\",\n message:\n \"Move controls to defineControls(Component, controls) in the component file or tempo/controls.ts.\",\n });\n return null;\n }\n const structural = warnings.filter(\n (warning) => warning.severity === \"structural\",\n );\n if (structural.length) {\n errors.push(...structural);\n return null;\n }\n\n // Reference declarations skip the not_exported warning — the target lives\n // in another module, and the import form already proves it is importable.\n if (binding && binding.exportKind === \"none\") {\n warnings.push({\n code: \"not_exported\",\n severity: \"degraded\",\n message: `\"${bindingName}\" is not exported — other files cannot import this asset`,\n span: callSpan,\n });\n }\n\n return {\n bindingName,\n exportKind: binding\n ? binding.exportKind\n : referenceExportKind(reference as ParsedAssetReference),\n libraries,\n ...(usageInstructions === undefined ? {} : { usageInstructions }),\n variants,\n ...(reference ? { reference } : {}),\n spans,\n warnings,\n };\n}\n\n/** How the target is exported from its module, read straight off the import\n * form — a default import can only bind a default export, a named import a\n * named one. */\nfunction referenceExportKind(reference: ParsedAssetReference): AssetExportKind {\n return reference.importedName === \"default\" ? \"default\" : \"named\";\n}\n\nfunction classifyMissingBinding(\n name: string,\n scope: AssetTopLevelScope,\n imports: AssetImportInfo,\n program: any,\n span: AssetSourceSpan,\n): AssetParseError {\n // Named/default imports parse as reference declarations before reaching\n // here, so an import landing in this branch is a namespace import.\n const importSource = imports.importedBindings.get(name);\n if (importSource !== undefined) {\n return {\n code: \"imported_binding\",\n severity: \"structural\",\n message: `\"${name}\" is a namespace import from \"${importSource}\" — declare the asset on a named or default import of the component instead`,\n span,\n };\n }\n if (scope.nonSimpleNames.has(name)) {\n return {\n code: \"unknown_binding\",\n severity: \"structural\",\n message: `\"${name}\" is not a plain initialized top-level binding — destructured and uninitialized declarations are not supported`,\n span,\n };\n }\n if (hasNestedBinding(program, name)) {\n return {\n code: \"non_top_level_binding\",\n severity: \"structural\",\n message: `\"${name}\" is not declared at the top level of the module`,\n span,\n };\n }\n return {\n code: \"unknown_binding\",\n severity: \"structural\",\n message: `no top-level declaration of \"${name}\" found in this file`,\n span,\n };\n}\n\nfunction hasNestedBinding(program: any, name: string): boolean {\n let found = false;\n walk(program, (node) => {\n if (found) return;\n if (\n (node.type === \"VariableDeclarator\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"ClassDeclaration\") &&\n node.id?.type === \"Identifier\" &&\n node.id.name === name\n ) {\n found = true;\n }\n });\n return found;\n}\n\nfunction readUsageInstructions(configNode: any): string | undefined {\n return readStaticStringProperty(configNode, \"usageInstructions\");\n}\n\nfunction readStaticStringProperty(\n configNode: any,\n name: string,\n): string | undefined {\n const property = getObjectProperty(configNode, name);\n if (!property) return undefined;\n const value = readStaticValue(property.value);\n return typeof value === \"string\" ? value : undefined;\n}\n\nfunction readLibraries(\n configNode: any,\n spans: AssetSpans,\n warnings: AssetParseError[],\n): string[] {\n const property = getObjectProperty(configNode, \"libraries\");\n if (!property) return [];\n spans.librariesProperty = toSourceSpan(property);\n\n const value = unwrapTsExpression(property.value);\n if (value?.type !== \"ArrayExpression\") {\n warnings.push({\n code: \"non_literal_library\",\n severity: \"degraded\",\n message:\n \"libraries must be an inline array literal of string literals — its entries were dropped\",\n span: toSourceSpan(property.value) ?? spans.librariesProperty,\n });\n return [];\n }\n spans.libraries = toSourceSpan(value);\n\n const names: string[] = [];\n for (const element of value.elements ?? []) {\n const elementSpan = toSourceSpan(element) ?? spans.libraries;\n const name = readStaticString(element);\n if (name === null) {\n warnings.push({\n code: \"non_literal_library\",\n severity: \"degraded\",\n message:\n \"libraries entries must be string literals — dropped a non-literal entry\",\n span: elementSpan,\n });\n continue;\n }\n if (name === \"\") {\n warnings.push({\n code: \"empty_library_name\",\n severity: \"degraded\",\n message: \"libraries entries must be non-empty — dropped an empty entry\",\n span: elementSpan,\n });\n continue;\n }\n if (names.includes(name)) {\n warnings.push({\n code: \"duplicate_library\",\n severity: \"degraded\",\n message: `duplicate library name \"${name}\" — deduplicated`,\n span: elementSpan,\n });\n continue;\n }\n names.push(name);\n if (elementSpan) spans.libraryItems.push(elementSpan);\n }\n return names;\n}\n\nfunction readVariants(\n configNode: any,\n warnings: AssetParseError[],\n): ParsedAssetVariant[] {\n const property = getObjectProperty(configNode, \"variants\");\n if (!property) return [];\n\n const value = unwrapTsExpression(property.value);\n if (value?.type !== \"ObjectExpression\") {\n warnings.push({\n code: \"unresolved_prop_value\",\n severity: \"degraded\",\n message:\n \"variants is not an inline object literal — variant props are not statically readable\",\n span: toSourceSpan(property.value) ?? toSourceSpan(property),\n });\n return [];\n }\n\n const properties = value.properties ?? [];\n if (properties.length === 0) {\n warnings.push({\n code: \"empty_variants\",\n severity: \"degraded\",\n message: \"variants is present but empty\",\n span: toSourceSpan(value),\n });\n return [];\n }\n\n const variants: ParsedAssetVariant[] = [];\n for (const entry of properties) {\n const name =\n entry?.type === \"Property\" && !entry.computed\n ? readPropertyKeyName(entry.key)\n : null;\n if (name === null) {\n warnings.push({\n code: \"unresolved_prop_value\",\n severity: \"degraded\",\n message:\n \"variant names must be identifier or string keys — skipped an entry that is not statically readable\",\n span: toSourceSpan(entry) ?? toSourceSpan(value),\n });\n continue;\n }\n variants.push(readVariant(name, entry, warnings));\n }\n return variants;\n}\n\nfunction readVariant(\n name: string,\n entry: any,\n warnings: AssetParseError[],\n): ParsedAssetVariant {\n const value = unwrapTsExpression(entry.value);\n for (const property of value?.type === \"ObjectExpression\"\n ? value.properties\n : []) {\n if (\n property.type !== \"Property\" ||\n property.computed ||\n ![\"props\", \"render\"].includes(readPropertyKeyName(property.key) ?? \"\")\n ) {\n warnings.push({\n code: \"invalid_variant_config\",\n severity: \"structural\",\n message: `Variant \"${name}\" accepts either props or render, with explicit keys and no spreads or inheritance`,\n span: toSourceSpan(property),\n });\n }\n }\n const renderProperty =\n value?.type === \"ObjectExpression\"\n ? getObjectProperty(value, \"render\")\n : null;\n const propsProperty =\n value?.type === \"ObjectExpression\"\n ? getObjectProperty(value, \"props\")\n : null;\n const fn = unwrapTsExpression(renderProperty?.value);\n const body = unwrapTsExpression(fn?.body);\n const jsx =\n body?.type === \"TempoJsxValue\" ? readStaticValue(body) : UNRESOLVED_VALUE;\n const validRender =\n fn?.type === \"ArrowFunctionExpression\" &&\n !fn.async &&\n fn.params.length === 0 &&\n !propsProperty &&\n !containsUnresolvedValue(jsx);\n if (renderProperty && !validRender)\n warnings.push({\n code: \"invalid_variant_config\",\n severity: \"structural\",\n message: `Variant \"${name}\" render must be a parameterless arrow returning static JSX, without props, statements, hooks, callbacks, or computed expressions. Move logic into an imported component.`,\n span: toSourceSpan(renderProperty),\n });\n const render = renderProperty && validRender ? { jsx } : undefined;\n const propsValue = propsProperty\n ? readStaticValue(propsProperty.value)\n : render\n ? {}\n : UNRESOLVED_VALUE;\n const props = isPlainRecord(propsValue) ? propsValue : {};\n const hasUnresolvedValues =\n !isPlainRecord(propsValue) || containsUnresolvedValue(propsValue);\n\n if (hasUnresolvedValues) {\n warnings.push({\n code: \"unresolved_prop_value\",\n severity: \"degraded\",\n message: `variant \"${name}\" has prop values that are not statically readable`,\n span: toSourceSpan(entry),\n });\n }\n\n return { name, props, hasUnresolvedValues, ...(render ? { render } : {}) };\n}\n\n/** Static value model (§3.2): literals, interpolation-free templates, unary\n * minus on numbers, array/object literals; anything else degrades to the\n * UNRESOLVED sentinel in place, preserving the surrounding structure. */\nfunction readStaticValue(node: any): StaticValue {\n const expression = unwrapTsExpression(node);\n if (!expression) return UNRESOLVED_VALUE;\n\n switch (expression.type) {\n case \"TempoJsxValue\":\n return expression.value;\n case \"Literal\": {\n if (expression.regex || expression.bigint) return UNRESOLVED_VALUE;\n const { value } = expression;\n return value === null ||\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n ? value\n : UNRESOLVED_VALUE;\n }\n case \"TemplateLiteral\": {\n if ((expression.expressions ?? []).length > 0) return UNRESOLVED_VALUE;\n const cooked = expression.quasis?.[0]?.value?.cooked;\n return typeof cooked === \"string\" ? cooked : UNRESOLVED_VALUE;\n }\n case \"UnaryExpression\": {\n if (expression.operator !== \"-\") return UNRESOLVED_VALUE;\n const argument = unwrapTsExpression(expression.argument);\n return argument?.type === \"Literal\" &&\n typeof argument.value === \"number\" &&\n Number.isFinite(argument.value)\n ? -argument.value\n : UNRESOLVED_VALUE;\n }\n case \"ArrayExpression\":\n return (expression.elements ?? []).map((element: any) =>\n element == null || element.type === \"SpreadElement\"\n ? UNRESOLVED_VALUE\n : readStaticValue(element),\n );\n case \"ObjectExpression\": {\n const record: Record<string, StaticValue> = {};\n for (const property of expression.properties ?? []) {\n // A spread or computed key makes the object's final shape unknowable\n // statically, so the whole object degrades to UNRESOLVED rather than\n // presenting a misleading partial record.\n if (property?.type !== \"Property\" || property.computed) {\n return UNRESOLVED_VALUE;\n }\n const key = readPropertyKeyName(property.key);\n if (key === null) return UNRESOLVED_VALUE;\n Object.defineProperty(record, key, {\n value: readStaticValue(property.value),\n enumerable: true,\n configurable: true,\n });\n }\n return record;\n }\n default:\n return UNRESOLVED_VALUE;\n }\n}\n\nfunction readStaticString(node: any): string | null {\n const value = node == null ? UNRESOLVED_VALUE : readStaticValue(node);\n return typeof value === \"string\" ? value : null;\n}\n\nfunction isPlainRecord(\n value: StaticValue,\n): value is Record<string, StaticValue> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n !Array.isArray(value) &&\n !isUnresolvedValue(value)\n );\n}\n\nfunction containsUnresolvedValue(value: StaticValue): boolean {\n if (isUnresolvedValue(value)) return true;\n if (Array.isArray(value)) return value.some(containsUnresolvedValue);\n if (typeof value === \"object\" && value !== null) {\n return Object.values(value).some(containsUnresolvedValue);\n }\n return false;\n}\n\n/** ExpressionStatement spans normally include the terminating semicolon, but\n * a semicolon separated by inline whitespace still belongs to the call. */\nfunction statementSpanWithSemicolon(\n source: string,\n statement: any,\n): AssetSourceSpan {\n const span = toSourceSpan(statement) ?? { start: 0, end: 0 };\n if (source[span.end - 1] === \";\") return span;\n let end = span.end;\n while (end < source.length && (source[end] === \" \" || source[end] === \"\\t\")) {\n end++;\n }\n return source[end] === \";\" ? { start: span.start, end: end + 1 } : span;\n}\n\nexport function unwrapTsExpression(node: any): any {\n let current = node;\n while (\n current?.type === \"TSSatisfiesExpression\" ||\n current?.type === \"TSAsExpression\" ||\n current?.type === \"TSNonNullExpression\" ||\n current?.type === \"ParenthesizedExpression\"\n ) {\n current = current.expression;\n }\n return current;\n}\n\nfunction readPropertyKeyName(key: any): string | null {\n if (key?.type === \"Identifier\") return key.name;\n if (key?.type === \"Literal\") {\n if (typeof key.value === \"string\") return key.value;\n if (typeof key.value === \"number\") return String(key.value);\n }\n return null;\n}\n\nfunction getObjectProperty(objectExpression: any, name: string): any | null {\n if (objectExpression?.type !== \"ObjectExpression\") return null;\n for (const property of objectExpression.properties ?? []) {\n if (property?.type !== \"Property\" || property.computed) continue;\n if (readPropertyKeyName(property.key) === name) return property;\n }\n return null;\n}\n\nexport function toSourceSpan(node: any): AssetSourceSpan | undefined {\n return typeof node?.start === \"number\" &&\n Number.isFinite(node.start) &&\n typeof node?.end === \"number\" &&\n Number.isFinite(node.end)\n ? { start: node.start, end: node.end }\n : undefined;\n}\n\nfunction walk(\n node: any,\n visitor: (node: any) => void,\n seen = new Set<any>(),\n): void {\n if (!node || typeof node !== \"object\" || seen.has(node)) return;\n seen.add(node);\n if (typeof node.type === \"string\") visitor(node);\n\n for (const value of Object.values(node)) {\n if (!value || typeof value !== \"object\") continue;\n if (Array.isArray(value)) {\n for (const item of value) walk(item, visitor, seen);\n } else {\n walk(value, visitor, seen);\n }\n }\n}\n"],"mappings":";;;;;;AAeA,SAAS,iBAAiB;AAmBnB,IAAM,0BAA0B;AAEhC,SAAS,eACd,UACA,QACiB;AACjB,QAAM,EAAE,SAAS,OAAO,IAAI,kBAAkB,UAAU,MAAM;AAC9D,MAAI,CAAC,SAAS;AACZ,WAAO,EAAE,UAAU,cAAc,CAAC,GAAG,OAAO;AAAA,EAC9C;AAEA,QAAM,UAAU,iBAAiB,OAAO;AACxC,aAAW,aAAa,QAAQ,YAAY;AAC1C,WAAO,KAAK;AAAA,MACV,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS,sCAAsC,uBAAuB,+BAA0B,UAAU,MAAM;AAAA,MAChH,MAAM,UAAU;AAAA,IAClB,CAAC;AAAA,EACH;AAEA,QAAM,YAAY,oBAAI,IAAiB;AACvC,aAAW,aAAa,QAAQ,MAAM;AACpC,UAAM,cACJ,UAAU,SAAS,2BACf,UAAU,cACV;AACN,QACE,aAAa,SAAS,yBACtB,YAAY,SAAS;AAErB;AACF,eAAW,WAAW,YAAY;AAChC,UAAI,QAAQ,GAAG,SAAS,gBAAgB,QAAQ;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AO;AAC1D,aAAW,YAAY,iBAAiB,cAAc,CAAC,GAAG;AACxD,QAAI,UAAU,SAAS,cAAc,SAAS,SAAU;AACxD,QAAI,oBAAoB,SAAS,GAAG,MAAM,KAAM,QAAO;AAAA,EACzD;AACA,SAAO;AACT;AAEO,SAAS,aAAa,MAAwC;AACnE,SAAO,OAAO,MAAM,UAAU,YAC5B,OAAO,SAAS,KAAK,KAAK,KAC1B,OAAO,MAAM,QAAQ,YACrB,OAAO,SAAS,KAAK,GAAG,IACtB,EAAE,OAAO,KAAK,OAAO,KAAK,KAAK,IAAI,IACnC;AACN;AAEA,SAAS,KACP,MACA,SACA,OAAO,oBAAI,IAAS,GACd;AACN,MAAI,CAAC,QAAQ,OAAO,SAAS,YAAY,KAAK,IAAI,IAAI,EAAG;AACzD,OAAK,IAAI,IAAI;AACb,MAAI,OAAO,KAAK,SAAS,SAAU,SAAQ,IAAI;AAE/C,aAAW,SAAS,OAAO,OAAO,IAAI,GAAG;AACvC,QAAI,CAAC,SAAS,OAAO,UAAU,SAAU;AACzC,QAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,iBAAW,QAAQ,MAAO,MAAK,MAAM,SAAS,IAAI;AAAA,IACpD,OAAO;AACL,WAAK,OAAO,SAAS,IAAI;AAAA,IAC3B;AAAA,EACF;AACF;","names":["source"]}
|
|
@@ -601,10 +601,16 @@ function Storyboard({
|
|
|
601
601
|
name,
|
|
602
602
|
component,
|
|
603
603
|
layout,
|
|
604
|
-
props
|
|
604
|
+
props,
|
|
605
|
+
...annotations
|
|
605
606
|
}) {
|
|
606
607
|
const Component2 = component;
|
|
607
|
-
|
|
608
|
+
const sourceAnnotations = Object.fromEntries(
|
|
609
|
+
Object.entries(annotations).filter(
|
|
610
|
+
([key]) => key.startsWith("data-tempo-")
|
|
611
|
+
)
|
|
612
|
+
);
|
|
613
|
+
return /* @__PURE__ */ jsx3(StoryboardSlot, { id, name, layout, kind: "component", children: /* @__PURE__ */ jsx3(Component2, { ...props ?? {}, ...sourceAnnotations }) });
|
|
608
614
|
}
|
|
609
615
|
function LegacyStoryboardV1({
|
|
610
616
|
id,
|
|
@@ -936,4 +942,4 @@ export {
|
|
|
936
942
|
HtmlStoryboard,
|
|
937
943
|
StoryboardSlot
|
|
938
944
|
};
|
|
939
|
-
//# sourceMappingURL=chunk-
|
|
945
|
+
//# sourceMappingURL=chunk-PULSTDX2.js.map
|