tempo-sdk 0.0.15 → 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.
Files changed (50) hide show
  1. package/dist/canvas/editor.d.ts +164 -0
  2. package/dist/canvas/editor.js +898 -0
  3. package/dist/canvas/editor.js.map +1 -0
  4. package/dist/canvas/index.d.ts +174 -0
  5. package/dist/canvas/index.js +2301 -0
  6. package/dist/canvas/index.js.map +1 -0
  7. package/dist/canvas/parser.d.ts +108 -0
  8. package/dist/canvas/parser.js +11 -0
  9. package/dist/canvas/parser.js.map +1 -0
  10. package/dist/chunk-6Q4I3RFN.js +643 -0
  11. package/dist/chunk-6Q4I3RFN.js.map +1 -0
  12. package/dist/{chunk-77BNMPBS.js → chunk-CB5NJJJT.js} +31 -5
  13. package/dist/chunk-CB5NJJJT.js.map +1 -0
  14. package/dist/expo/plugin.cjs +30 -4
  15. package/dist/expo/plugin.cjs.map +1 -1
  16. package/dist/expo/plugin.js +1 -1
  17. package/dist/expo-babel-plugin.cjs +30 -4
  18. package/dist/expo-babel-plugin.cjs.map +1 -1
  19. package/dist/expo-babel-plugin.d.cts +1 -1
  20. package/dist/expo-babel-plugin.d.ts +1 -1
  21. package/dist/expo-babel-plugin.js +1 -1
  22. package/dist/index.d.ts +3 -34
  23. package/dist/index.js +26 -6
  24. package/dist/index.js.map +1 -1
  25. package/dist/nextjs-loader.cjs +29 -4
  26. package/dist/nextjs-loader.cjs.map +1 -1
  27. package/dist/page-xi1aI5a7.d.ts +36 -0
  28. package/package.json +18 -3
  29. package/dist/annotation-strategy-DCJHc--2.d.cts +0 -13
  30. package/dist/annotation-strategy-DCJHc--2.d.ts +0 -13
  31. package/dist/chunk-2LP5G6CD.js +0 -748
  32. package/dist/chunk-2LP5G6CD.js.map +0 -1
  33. package/dist/chunk-77BNMPBS.js.map +0 -1
  34. package/dist/chunk-F64WRL4H.js +0 -884
  35. package/dist/chunk-F64WRL4H.js.map +0 -1
  36. package/dist/chunk-G7M57ARC.js +0 -902
  37. package/dist/chunk-G7M57ARC.js.map +0 -1
  38. package/dist/chunk-GHPL4LGE.js +0 -205
  39. package/dist/chunk-GHPL4LGE.js.map +0 -1
  40. package/dist/chunk-IG3JZVZI.js +0 -846
  41. package/dist/chunk-IG3JZVZI.js.map +0 -1
  42. package/dist/chunk-WGGLHHC5.js +0 -337
  43. package/dist/chunk-WGGLHHC5.js.map +0 -1
  44. package/dist/chunk-X3K7Z2BH.js +0 -900
  45. package/dist/chunk-X3K7Z2BH.js.map +0 -1
  46. package/dist/chunk-ZHORRCQG.js +0 -756
  47. package/dist/chunk-ZHORRCQG.js.map +0 -1
  48. package/dist/index.cjs +0 -1170
  49. package/dist/index.cjs.map +0 -1
  50. package/dist/index.d.cts +0 -99
@@ -0,0 +1,164 @@
1
+ import { ParsedCanvasFile, CanvasSourceSpan } from './parser.js';
2
+
3
+ type CanvasSourceEdit = {
4
+ start: number;
5
+ end: number;
6
+ value: string;
7
+ };
8
+ type CanvasEditResult = {
9
+ source: string;
10
+ edits: CanvasSourceEdit[];
11
+ parsed: ParsedCanvasFile;
12
+ };
13
+ type CanvasEditorLayout = {
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ zIndex?: number;
19
+ intrinsicSizing?: "root-element";
20
+ };
21
+ type AddCanvasStoryboardInput = {
22
+ kind: "component";
23
+ id: string;
24
+ layout: CanvasEditorLayout;
25
+ name?: string;
26
+ componentExpression?: string;
27
+ props?: string;
28
+ componentImport?: {
29
+ localName: string;
30
+ source: string;
31
+ importedName?: string;
32
+ };
33
+ } | {
34
+ kind: "legacy-v1";
35
+ id: string;
36
+ storyboardExpression: string;
37
+ } | {
38
+ kind: "route";
39
+ id: string;
40
+ route: string;
41
+ layout: CanvasEditorLayout;
42
+ name?: string;
43
+ } | {
44
+ kind: "html";
45
+ id: string;
46
+ layout: CanvasEditorLayout;
47
+ name?: string;
48
+ filepath?: string;
49
+ src?: string;
50
+ };
51
+ declare function applyCanvasSourceEdits(source: string, edits: readonly CanvasSourceEdit[]): string;
52
+ declare function updateCanvasName(options: {
53
+ filePath: string;
54
+ source: string;
55
+ name: string;
56
+ }): CanvasEditResult;
57
+ declare function updateCanvasPath(options: {
58
+ filePath: string;
59
+ source: string;
60
+ path: string;
61
+ }): CanvasEditResult;
62
+ declare function updateCanvasBackgroundColor(options: {
63
+ filePath: string;
64
+ source: string;
65
+ backgroundColor?: string;
66
+ }): CanvasEditResult;
67
+ declare function updateStoryboardName(options: {
68
+ filePath: string;
69
+ source: string;
70
+ storyboardId: string;
71
+ name?: string;
72
+ }): CanvasEditResult;
73
+ declare function updateStoryboardId(options: {
74
+ filePath: string;
75
+ source: string;
76
+ storyboardId: string;
77
+ nextId: string;
78
+ }): CanvasEditResult;
79
+ declare function updateStoryboardLayout(options: {
80
+ filePath: string;
81
+ source: string;
82
+ storyboardId: string;
83
+ layout: Partial<CanvasEditorLayout>;
84
+ }): CanvasEditResult;
85
+ declare function updateStoryboardComponent(options: {
86
+ filePath: string;
87
+ source: string;
88
+ storyboardId: string;
89
+ componentExpression: string;
90
+ componentImport?: {
91
+ localName: string;
92
+ source: string;
93
+ importedName?: string;
94
+ };
95
+ }): CanvasEditResult;
96
+ declare function updateStoryboardProps(options: {
97
+ filePath: string;
98
+ source: string;
99
+ storyboardId: string;
100
+ propsExpression?: string;
101
+ }): CanvasEditResult;
102
+ declare function updateRouteStoryboardRoute(options: {
103
+ filePath: string;
104
+ source: string;
105
+ storyboardId: string;
106
+ route: string;
107
+ }): CanvasEditResult;
108
+ declare function updateHtmlStoryboardSource(options: {
109
+ filePath: string;
110
+ source: string;
111
+ storyboardId: string;
112
+ filepath?: string;
113
+ src?: string;
114
+ }): CanvasEditResult;
115
+ declare function addCanvasStoryboard(options: {
116
+ filePath: string;
117
+ source: string;
118
+ storyboard: AddCanvasStoryboardInput;
119
+ }): CanvasEditResult;
120
+ declare function removeCanvasStoryboard(options: {
121
+ filePath: string;
122
+ source: string;
123
+ storyboardId: string;
124
+ removeUnusedComponentImport?: boolean;
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;
163
+
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 };