tempo-sdk 0.0.18 → 0.0.19
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 +79 -0
- package/dist/assets/editor.js +571 -0
- package/dist/assets/editor.js.map +1 -0
- package/dist/assets/index.d.ts +83 -0
- package/dist/assets/index.js +26 -0
- package/dist/assets/index.js.map +1 -0
- package/dist/assets/parser.d.ts +78 -0
- package/dist/assets/parser.js +29 -0
- package/dist/assets/parser.js.map +1 -0
- package/dist/canvas/editor.js +1 -1
- package/dist/canvas/index.js +87 -14
- package/dist/canvas/index.js.map +1 -1
- package/dist/canvas/parser.d.ts +25 -1
- package/dist/canvas/parser.js +3 -1
- package/dist/chunk-IWULHYPW.js +650 -0
- package/dist/chunk-IWULHYPW.js.map +1 -0
- package/dist/{chunk-6Q4I3RFN.js → chunk-P277UVZE.js} +244 -33
- package/dist/chunk-P277UVZE.js.map +1 -0
- package/dist/types-B-dRoF2T.d.ts +102 -0
- package/package.json +13 -1
- package/dist/chunk-6Q4I3RFN.js.map +0 -1
package/dist/canvas/parser.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ type CanvasSourceSpan = {
|
|
|
5
5
|
type CanvasParseError = {
|
|
6
6
|
message: string;
|
|
7
7
|
span?: CanvasSourceSpan;
|
|
8
|
+
/** "structural": the file's storyboard identity/structure cannot be
|
|
9
|
+
* trusted — readers must fail closed. "degraded": a single storyboard
|
|
10
|
+
* (or the canvas display name) is not statically readable/editable but
|
|
11
|
+
* identity is intact — readers keep working with fallback values. */
|
|
12
|
+
kind: "structural" | "degraded";
|
|
8
13
|
};
|
|
9
14
|
type ParsedCanvasImport = {
|
|
10
15
|
localName: string;
|
|
@@ -19,6 +24,23 @@ type ParsedCanvasImport = {
|
|
|
19
24
|
hasDefaultSpecifier: boolean;
|
|
20
25
|
hasNamespaceSpecifier: boolean;
|
|
21
26
|
};
|
|
27
|
+
/** An import statement that names Tempo SDK canvas components but uses the
|
|
28
|
+
* wrong tempo-sdk specifier (e.g. `import { Canvas } from "tempo-sdk"`).
|
|
29
|
+
* Neither the main entry nor the other subpaths export the components, so
|
|
30
|
+
* the file both fails at runtime and is invisible to this parser's <Canvas>
|
|
31
|
+
* detection — migrate-on-read uses these records to repair the specifier. */
|
|
32
|
+
type MisimportedSdkCanvasImport = {
|
|
33
|
+
/** Import source exactly as written, e.g. "tempo-sdk". */
|
|
34
|
+
source: string;
|
|
35
|
+
/** Span of the source string literal INCLUDING its quote characters. */
|
|
36
|
+
sourceSpan: CanvasSourceSpan;
|
|
37
|
+
/** Imported names of every value specifier on the statement. */
|
|
38
|
+
importedNames: string[];
|
|
39
|
+
/** True when every value specifier on the statement is a named import of a
|
|
40
|
+
* value actually exported by "tempo-sdk/canvas" — rewriting the source
|
|
41
|
+
* string to "tempo-sdk/canvas" provably fixes the statement. */
|
|
42
|
+
rewritable: boolean;
|
|
43
|
+
};
|
|
22
44
|
type ParsedCanvasLayout = {
|
|
23
45
|
x: number;
|
|
24
46
|
y: number;
|
|
@@ -98,11 +120,13 @@ type ParsedCanvasFile = {
|
|
|
98
120
|
backgroundColorSpan?: CanvasSourceSpan;
|
|
99
121
|
backgroundColorAttributeSpan?: CanvasSourceSpan;
|
|
100
122
|
imports: ParsedCanvasImport[];
|
|
123
|
+
misimportedSdkCanvasImports: MisimportedSdkCanvasImport[];
|
|
101
124
|
storyboards: ParsedCanvasStoryboard[];
|
|
102
125
|
errors: CanvasParseError[];
|
|
103
126
|
};
|
|
104
127
|
declare function parseCanvasFile(filePath: string, source: string): ParsedCanvasFile;
|
|
128
|
+
declare function misimportedSdkCanvasImportMessage(entry: MisimportedSdkCanvasImport): string;
|
|
105
129
|
declare function unwrapTsExpression(node: any): any;
|
|
106
130
|
declare function fallbackPageName(filePath: string): string;
|
|
107
131
|
|
|
108
|
-
export { type CanvasParseError, type CanvasSourceSpan, type ParsedCanvasComponentReference, type ParsedCanvasExpressionReference, type ParsedCanvasFile, type ParsedCanvasImport, type ParsedCanvasLayout, type ParsedCanvasLayoutSpans, type ParsedCanvasStoryboard, fallbackPageName, parseCanvasFile, unwrapTsExpression };
|
|
132
|
+
export { type CanvasParseError, type CanvasSourceSpan, type MisimportedSdkCanvasImport, type ParsedCanvasComponentReference, type ParsedCanvasExpressionReference, type ParsedCanvasFile, type ParsedCanvasImport, type ParsedCanvasLayout, type ParsedCanvasLayoutSpans, type ParsedCanvasStoryboard, fallbackPageName, misimportedSdkCanvasImportMessage, parseCanvasFile, unwrapTsExpression };
|
package/dist/canvas/parser.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fallbackPageName,
|
|
3
|
+
misimportedSdkCanvasImportMessage,
|
|
3
4
|
parseCanvasFile,
|
|
4
5
|
unwrapTsExpression
|
|
5
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-P277UVZE.js";
|
|
6
7
|
export {
|
|
7
8
|
fallbackPageName,
|
|
9
|
+
misimportedSdkCanvasImportMessage,
|
|
8
10
|
parseCanvasFile,
|
|
9
11
|
unwrapTsExpression
|
|
10
12
|
};
|