tempo-sdk 0.0.16 → 0.0.18
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/canvas/editor.d.ts +44 -9
- package/dist/canvas/editor.js +116 -416
- package/dist/canvas/editor.js.map +1 -1
- package/dist/canvas/index.d.ts +1 -0
- package/dist/canvas/index.js +152 -44
- package/dist/canvas/index.js.map +1 -1
- package/dist/canvas/parser.d.ts +1 -2
- package/dist/canvas/parser.js +1 -3
- package/dist/{chunk-ICP7LCPJ.js → chunk-6Q4I3RFN.js} +37 -9
- package/dist/chunk-6Q4I3RFN.js.map +1 -0
- package/dist/{chunk-77BNMPBS.js → chunk-CB5NJJJT.js} +31 -5
- package/dist/chunk-CB5NJJJT.js.map +1 -0
- package/dist/expo/plugin.cjs +30 -4
- package/dist/expo/plugin.cjs.map +1 -1
- package/dist/expo/plugin.js +1 -1
- package/dist/expo-babel-plugin.cjs +30 -4
- package/dist/expo-babel-plugin.cjs.map +1 -1
- package/dist/expo-babel-plugin.d.cts +1 -1
- package/dist/expo-babel-plugin.d.ts +1 -1
- package/dist/expo-babel-plugin.js +1 -1
- package/dist/index.js +26 -6
- package/dist/index.js.map +1 -1
- package/dist/nextjs-loader.cjs +29 -4
- package/dist/nextjs-loader.cjs.map +1 -1
- package/package.json +4 -3
- package/dist/annotation-strategy-DCJHc--2.d.cts +0 -13
- package/dist/annotation-strategy-DCJHc--2.d.ts +0 -13
- package/dist/chunk-2LP5G6CD.js +0 -748
- package/dist/chunk-2LP5G6CD.js.map +0 -1
- package/dist/chunk-77BNMPBS.js.map +0 -1
- package/dist/chunk-B3PHU7XX.js +0 -571
- package/dist/chunk-B3PHU7XX.js.map +0 -1
- package/dist/chunk-EJBWZCEE.js +0 -434
- package/dist/chunk-EJBWZCEE.js.map +0 -1
- package/dist/chunk-F64WRL4H.js +0 -884
- package/dist/chunk-F64WRL4H.js.map +0 -1
- package/dist/chunk-G7M57ARC.js +0 -902
- package/dist/chunk-G7M57ARC.js.map +0 -1
- package/dist/chunk-GHPL4LGE.js +0 -205
- package/dist/chunk-GHPL4LGE.js.map +0 -1
- package/dist/chunk-ICP7LCPJ.js.map +0 -1
- package/dist/chunk-IG3JZVZI.js +0 -846
- package/dist/chunk-IG3JZVZI.js.map +0 -1
- package/dist/chunk-MBTLXFNP.js +0 -605
- package/dist/chunk-MBTLXFNP.js.map +0 -1
- package/dist/chunk-MD3HJ7L3.js +0 -457
- package/dist/chunk-MD3HJ7L3.js.map +0 -1
- package/dist/chunk-O3HYJ6BU.js +0 -433
- package/dist/chunk-O3HYJ6BU.js.map +0 -1
- package/dist/chunk-WGGLHHC5.js +0 -337
- package/dist/chunk-WGGLHHC5.js.map +0 -1
- package/dist/chunk-X3K7Z2BH.js +0 -900
- package/dist/chunk-X3K7Z2BH.js.map +0 -1
- package/dist/chunk-ZHORRCQG.js +0 -756
- package/dist/chunk-ZHORRCQG.js.map +0 -1
- package/dist/index.cjs +0 -1170
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -99
- package/dist/page-BokkL6FZ.d.ts +0 -35
package/dist/canvas/editor.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ParsedCanvasFile } from './parser.js';
|
|
1
|
+
import { ParsedCanvasFile, CanvasSourceSpan } from './parser.js';
|
|
2
2
|
|
|
3
3
|
type CanvasSourceEdit = {
|
|
4
4
|
start: number;
|
|
@@ -10,9 +10,6 @@ type CanvasEditResult = {
|
|
|
10
10
|
edits: CanvasSourceEdit[];
|
|
11
11
|
parsed: ParsedCanvasFile;
|
|
12
12
|
};
|
|
13
|
-
type LegacyCanvasMigrationResult = CanvasEditResult & {
|
|
14
|
-
migrated: boolean;
|
|
15
|
-
};
|
|
16
13
|
type CanvasEditorLayout = {
|
|
17
14
|
x: number;
|
|
18
15
|
y: number;
|
|
@@ -27,11 +24,16 @@ type AddCanvasStoryboardInput = {
|
|
|
27
24
|
layout: CanvasEditorLayout;
|
|
28
25
|
name?: string;
|
|
29
26
|
componentExpression?: string;
|
|
27
|
+
props?: string;
|
|
30
28
|
componentImport?: {
|
|
31
29
|
localName: string;
|
|
32
30
|
source: string;
|
|
33
31
|
importedName?: string;
|
|
34
32
|
};
|
|
33
|
+
} | {
|
|
34
|
+
kind: "legacy-v1";
|
|
35
|
+
id: string;
|
|
36
|
+
storyboardExpression: string;
|
|
35
37
|
} | {
|
|
36
38
|
kind: "route";
|
|
37
39
|
id: string;
|
|
@@ -47,10 +49,6 @@ type AddCanvasStoryboardInput = {
|
|
|
47
49
|
src?: string;
|
|
48
50
|
};
|
|
49
51
|
declare function applyCanvasSourceEdits(source: string, edits: readonly CanvasSourceEdit[]): string;
|
|
50
|
-
declare function migrateLegacyCanvasToReact(options: {
|
|
51
|
-
filePath: string;
|
|
52
|
-
source: string;
|
|
53
|
-
}): LegacyCanvasMigrationResult;
|
|
54
52
|
declare function updateCanvasName(options: {
|
|
55
53
|
filePath: string;
|
|
56
54
|
source: string;
|
|
@@ -125,5 +123,42 @@ declare function removeCanvasStoryboard(options: {
|
|
|
125
123
|
storyboardId: string;
|
|
126
124
|
removeUnusedComponentImport?: boolean;
|
|
127
125
|
}): CanvasEditResult;
|
|
126
|
+
/**
|
|
127
|
+
* Format a JSX string attribute. Prefers the idiomatic plain form
|
|
128
|
+
* (`name="value"`) and falls back to the expression form (`name={"value"}`)
|
|
129
|
+
* when the plain form can't represent the value faithfully: JSX string
|
|
130
|
+
* attributes don't process backslash escapes but DO decode HTML entities, so
|
|
131
|
+
* any value that JSON-escapes (quotes, backslashes, control characters) or
|
|
132
|
+
* contains `&` must go through a braced string literal.
|
|
133
|
+
*/
|
|
134
|
+
declare function formatJsxStringAttribute(name: string, value: string): string;
|
|
135
|
+
declare function expandToFullLines(source: string, span: CanvasSourceSpan): CanvasSourceSpan;
|
|
136
|
+
declare function expandStatementForward(source: string, span: CanvasSourceSpan): CanvasSourceSpan;
|
|
137
|
+
declare function collapseBlankLines(source: string, newline: string): string;
|
|
138
|
+
declare function detectNewline(source: string): "\n" | "\r\n";
|
|
139
|
+
declare function topLevelInsertionOffset(source: string): number;
|
|
140
|
+
/**
|
|
141
|
+
* Cheap word-boundary text scan. It matches occurrences inside string literals
|
|
142
|
+
* and comments too, so it is SAFE-DIRECTION ONLY: use it where a false positive
|
|
143
|
+
* is harmless (conservatively keeping an import that might still be used), NEVER
|
|
144
|
+
* for a collision check that throws or blocks an edit — those must use
|
|
145
|
+
* {@link sourceContainsIdentifierNode}, which counts real identifier nodes only.
|
|
146
|
+
*/
|
|
147
|
+
declare function hasIdentifier(source: string, identifier: string): boolean;
|
|
148
|
+
/**
|
|
149
|
+
* True when `name` appears as a real identifier node (`Identifier` /
|
|
150
|
+
* `JSXIdentifier`) anywhere in `source` — a binding or reference, never a
|
|
151
|
+
* string-literal or comment occurrence. Use this for collision checks that
|
|
152
|
+
* throw or block an edit, so a name appearing only inside a string (e.g.
|
|
153
|
+
* `<Canvas name="Card Demo">` vs a `Card` import) can't masquerade as a
|
|
154
|
+
* declared identifier.
|
|
155
|
+
*/
|
|
156
|
+
declare function sourceContainsIdentifierNode(filePath: string, source: string, name: string): boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Depth-first walk that hands each AST node to `visit` along with its parent and
|
|
159
|
+
* the parent field it was reached through — the context callers need to tell a
|
|
160
|
+
* value reference from a property key or member access.
|
|
161
|
+
*/
|
|
162
|
+
declare function walkWithParent(node: any, visit: (node: any, parent: any, key: string | null) => void, parent?: any, key?: string | null, seen?: Set<any>): void;
|
|
128
163
|
|
|
129
|
-
export { type AddCanvasStoryboardInput, type CanvasEditResult, type CanvasEditorLayout, type CanvasSourceEdit,
|
|
164
|
+
export { type AddCanvasStoryboardInput, type CanvasEditResult, type CanvasEditorLayout, type CanvasSourceEdit, addCanvasStoryboard, applyCanvasSourceEdits, collapseBlankLines, detectNewline, expandStatementForward, expandToFullLines, formatJsxStringAttribute, hasIdentifier, removeCanvasStoryboard, sourceContainsIdentifierNode, topLevelInsertionOffset, updateCanvasBackgroundColor, updateCanvasName, updateCanvasPath, updateHtmlStoryboardSource, updateRouteStoryboardRoute, updateStoryboardComponent, updateStoryboardId, updateStoryboardLayout, updateStoryboardName, updateStoryboardProps, walkWithParent };
|