tempo-sdk 0.0.66 → 0.0.75
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/index.js +27 -5
- package/dist/assets/index.js.map +1 -1
- package/dist/astro/asset-preview-client.js +2 -2
- package/dist/astro.js +96 -31
- package/dist/astro.js.map +1 -1
- package/dist/canvas/astro.d.ts +1 -1
- package/dist/canvas/astro.js +2 -2
- package/dist/canvas/editor.d.ts +15 -5
- package/dist/canvas/editor.js +13 -8
- package/dist/canvas/editor.js.map +1 -1
- package/dist/canvas/flutter-preview.d.ts +18 -0
- package/dist/canvas/flutter-preview.js +9 -0
- package/dist/canvas/flutter-preview.js.map +1 -0
- package/dist/canvas/index.d.ts +33 -2
- package/dist/canvas/index.js +1134 -26
- package/dist/canvas/index.js.map +1 -1
- package/dist/canvas/interact-projection.js +5 -4
- package/dist/canvas/parser.d.ts +142 -3
- package/dist/canvas/parser.js +14 -1
- package/dist/canvas/svelte.d.ts +1 -1
- package/dist/canvas/svelte.js +2 -2
- package/dist/canvas/vue.d.ts +74 -0
- package/dist/canvas/vue.js +264 -0
- package/dist/canvas/vue.js.map +1 -0
- package/dist/{chunk-6W6UKDSY.js → chunk-2YX4WVFH.js} +49 -7
- package/dist/chunk-2YX4WVFH.js.map +1 -0
- package/dist/chunk-5HIIF354.js +67 -0
- package/dist/chunk-5HIIF354.js.map +1 -0
- package/dist/{chunk-FE6TYCLF.js → chunk-5VIBKVFO.js} +2 -2
- package/dist/{chunk-FE6TYCLF.js.map → chunk-5VIBKVFO.js.map} +1 -1
- package/dist/{chunk-77DZCV5Z.js → chunk-CXIW4IKC.js} +2 -2
- package/dist/chunk-CYQE3TLC.js +37 -0
- package/dist/chunk-CYQE3TLC.js.map +1 -0
- package/dist/{chunk-DELFOKU3.js → chunk-DNSCVLKV.js} +1571 -1410
- package/dist/chunk-DNSCVLKV.js.map +1 -0
- package/dist/chunk-EGRHWZRV.js +1 -0
- package/dist/chunk-EGRHWZRV.js.map +1 -0
- package/dist/{chunk-EYKOOLPL.js → chunk-GKDDNDG3.js} +1039 -134
- package/dist/chunk-GKDDNDG3.js.map +1 -0
- package/dist/{chunk-KOSJXE4G.js → chunk-H6BQZOAW.js} +4 -3
- package/dist/chunk-HOBTDB6G.js +112 -0
- package/dist/chunk-HOBTDB6G.js.map +1 -0
- package/dist/chunk-HZXQPM4W.js +285 -0
- package/dist/chunk-HZXQPM4W.js.map +1 -0
- package/dist/chunk-SGN7BDRE.js +16 -0
- package/dist/chunk-SGN7BDRE.js.map +1 -0
- package/dist/{chunk-F23JGM4U.js → chunk-UBTL6JUF.js} +6 -2
- package/dist/{chunk-F23JGM4U.js.map → chunk-UBTL6JUF.js.map} +1 -1
- package/dist/{chunk-2JRAG36X.js → chunk-WBMO4ZYO.js} +2 -2
- package/dist/chunk-WBMO4ZYO.js.map +1 -0
- package/dist/{chunk-K3EYTZLL.js → chunk-WTXOWQ7N.js} +3 -1
- package/dist/chunk-WTXOWQ7N.js.map +1 -0
- package/dist/{chunk-Q2A46HHW.js → chunk-XFPFWTWX.js} +276 -43
- package/dist/chunk-XFPFWTWX.js.map +1 -0
- package/dist/chunk-XMFVWJUY.js +342 -0
- package/dist/chunk-XMFVWJUY.js.map +1 -0
- package/dist/{chunk-PXDTH36X.js → chunk-Y72PIE3I.js} +212 -20
- package/dist/chunk-Y72PIE3I.js.map +1 -0
- package/dist/{chunk-6IR5JY6W.js → chunk-YECMP34I.js} +41 -9
- package/dist/chunk-YECMP34I.js.map +1 -0
- package/dist/{chunk-NSKYOKG5.js → chunk-ZXC7SZIT.js} +278 -26
- package/dist/chunk-ZXC7SZIT.js.map +1 -0
- package/dist/{controls-reader-SNMI2UY7.js → controls-reader-Z7OQWYWQ.js} +4 -3
- package/dist/{controls-reader-SNMI2UY7.js.map → controls-reader-Z7OQWYWQ.js.map} +1 -1
- package/dist/expo/plugin.cjs +301 -58
- package/dist/expo/plugin.cjs.map +1 -1
- package/dist/expo/plugin.js +1 -1
- package/dist/expo-babel-plugin.cjs +301 -58
- package/dist/expo-babel-plugin.cjs.map +1 -1
- package/dist/expo-babel-plugin.js +1 -1
- package/dist/flutter-preview-path.d.ts +9 -0
- package/dist/flutter-preview-path.js +16 -0
- package/dist/flutter-preview-path.js.map +1 -0
- package/dist/index.d.ts +16 -15
- package/dist/index.js +9 -6
- package/dist/nextjs/plugin.cjs +46 -5
- package/dist/nextjs/plugin.cjs.map +1 -1
- package/dist/nextjs/plugin.js +1 -1
- package/dist/nextjs-loader.cjs +343 -68
- package/dist/nextjs-loader.cjs.map +1 -1
- package/dist/nextjs.cjs +48 -6
- package/dist/nextjs.cjs.map +1 -1
- package/dist/nextjs.d.cts +9 -1
- package/dist/nextjs.d.ts +9 -1
- package/dist/nextjs.js +1 -1
- package/dist/nuxt/runtime/identity.d.ts +24 -0
- package/dist/nuxt/runtime/identity.js +18 -0
- package/dist/nuxt/runtime/identity.js.map +1 -0
- package/dist/nuxt.d.ts +102 -0
- package/dist/nuxt.js +5673 -0
- package/dist/nuxt.js.map +1 -0
- package/dist/{storyboard-4YdTYq_e.d.ts → storyboard-CMJVBSXn.d.ts} +9 -3
- package/dist/svelte.d.ts +4 -2
- package/dist/svelte.js +21 -88
- package/dist/svelte.js.map +1 -1
- package/dist/vue.d.ts +66 -0
- package/dist/vue.js +1403 -0
- package/dist/vue.js.map +1 -0
- package/package.json +48 -5
- package/dist/chunk-2JRAG36X.js.map +0 -1
- package/dist/chunk-6IR5JY6W.js.map +0 -1
- package/dist/chunk-6W6UKDSY.js.map +0 -1
- package/dist/chunk-DELFOKU3.js.map +0 -1
- package/dist/chunk-EYKOOLPL.js.map +0 -1
- package/dist/chunk-K3EYTZLL.js.map +0 -1
- package/dist/chunk-NSKYOKG5.js.map +0 -1
- package/dist/chunk-PXDTH36X.js.map +0 -1
- package/dist/chunk-Q2A46HHW.js.map +0 -1
- /package/dist/{chunk-77DZCV5Z.js.map → chunk-CXIW4IKC.js.map} +0 -0
- /package/dist/{chunk-KOSJXE4G.js.map → chunk-H6BQZOAW.js.map} +0 -0
|
@@ -72,10 +72,16 @@ declare function HtmlStoryboard({ id, name, filepath, src, layout, vrt, ...annot
|
|
|
72
72
|
* public component as the shell's parent, which the canvas reads as the
|
|
73
73
|
* storyboard's root layer.
|
|
74
74
|
*/
|
|
75
|
-
declare function StoryboardSlot({ children, id, kind, layout, name, route, filepath, src, vrt, uiFramework, }: {
|
|
75
|
+
declare function StoryboardSlot({ children, id, kind, layout, name, route, filepath, src, vrt, uiFramework, preview, previewKey, keepLayoutWhenParked, }: {
|
|
76
76
|
"data-tempo-hide-fiber": "true";
|
|
77
77
|
vrt?: boolean;
|
|
78
|
-
uiFramework?: "svelte" | "astro";
|
|
78
|
+
uiFramework?: "svelte" | "vue" | "astro";
|
|
79
|
+
preview?: string;
|
|
80
|
+
previewKey?: string;
|
|
81
|
+
/** A parked (cached) board stays hidden but keeps its layout box instead of
|
|
82
|
+
* leaving layout. For content an engine renders from that box; see where
|
|
83
|
+
* the shell's `display` is chosen. */
|
|
84
|
+
keepLayoutWhenParked?: boolean;
|
|
79
85
|
children?: ReactNode;
|
|
80
86
|
id: string;
|
|
81
87
|
kind: "component" | "route" | "html";
|
|
@@ -87,4 +93,4 @@ declare function StoryboardSlot({ children, id, kind, layout, name, route, filep
|
|
|
87
93
|
src?: string;
|
|
88
94
|
}): react.JSX.Element;
|
|
89
95
|
|
|
90
|
-
export { HtmlStoryboard as H, LegacyStoryboardV1 as L, RouteStoryboard as R,
|
|
96
|
+
export { HtmlStoryboard as H, LegacyStoryboardV1 as L, RouteStoryboard as R, type StoryboardLayout as S, type StoryboardVrtConfig as a, Storyboard as b, StoryboardSlot as c, type StoryboardVrtIgnoreRegion as d };
|
package/dist/svelte.d.ts
CHANGED
|
@@ -11,8 +11,10 @@ import { PreprocessorGroup } from 'svelte/compiler';
|
|
|
11
11
|
interface TempoSveltePreprocessOptions {
|
|
12
12
|
/** Annotation identity root. Defaults to the process working directory. */
|
|
13
13
|
root?: string;
|
|
14
|
-
/** Allowed source boundary. Defaults to
|
|
15
|
-
*
|
|
14
|
+
/** Allowed source boundary. Defaults to the package-manager workspace
|
|
15
|
+
* around `root`, else `root` (see defaultSourceRoot); host sidecars set
|
|
16
|
+
* this to the project root while annotations remain relative to the host
|
|
17
|
+
* root. */
|
|
16
18
|
sourceRoot?: string;
|
|
17
19
|
/** Override the normal TEMPO environment gate, primarily for tests. */
|
|
18
20
|
enabled?: boolean;
|
package/dist/svelte.js
CHANGED
|
@@ -1,83 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
applyStringEdits,
|
|
3
|
+
defaultSourceRoot,
|
|
4
|
+
mapOffsetThroughStringEdits,
|
|
5
|
+
readModifiedTs,
|
|
6
|
+
resolveAnnotationIdentity
|
|
7
|
+
} from "./chunk-HOBTDB6G.js";
|
|
1
8
|
import {
|
|
2
9
|
MagicString
|
|
3
10
|
} from "./chunk-JVVHU3A7.js";
|
|
4
11
|
import {
|
|
5
12
|
appendModuleVersionRecord
|
|
6
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UBTL6JUF.js";
|
|
7
14
|
import {
|
|
8
15
|
sourceVersionHash
|
|
9
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-H6BQZOAW.js";
|
|
10
17
|
|
|
11
18
|
// svelte.ts
|
|
12
|
-
import { readFileSync
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
// ../../modules/svelte-editor/annotate.ts
|
|
16
|
-
import { compile as compile2 } from "svelte/compiler";
|
|
19
|
+
import { readFileSync } from "fs";
|
|
20
|
+
import { resolve } from "path";
|
|
17
21
|
|
|
18
|
-
// ../../modules/svelte-editor/
|
|
19
|
-
|
|
20
|
-
constructor(message) {
|
|
21
|
-
super(message);
|
|
22
|
-
this.name = "InvalidStringEditError";
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
function applyStringEdits(source, edits) {
|
|
26
|
-
const sorted = validateStringEdits(source, edits);
|
|
27
|
-
let nextSource = source;
|
|
28
|
-
for (const edit of sorted) {
|
|
29
|
-
nextSource = nextSource.slice(0, edit.start) + edit.replacement + nextSource.slice(edit.end);
|
|
30
|
-
}
|
|
31
|
-
return nextSource;
|
|
32
|
-
}
|
|
33
|
-
function validateStringEdits(source, edits) {
|
|
34
|
-
return validateEditShape(edits, source.length);
|
|
35
|
-
}
|
|
36
|
-
function validateEditShape(edits, sourceLength) {
|
|
37
|
-
const sorted = [...edits].sort(
|
|
38
|
-
(left, right) => right.start - left.start || right.end - left.end
|
|
39
|
-
);
|
|
40
|
-
for (const edit of sorted) {
|
|
41
|
-
if (!Number.isInteger(edit.start) || !Number.isInteger(edit.end)) {
|
|
42
|
-
throw new InvalidStringEditError("edit offsets must be integers");
|
|
43
|
-
}
|
|
44
|
-
if (edit.start < 0 || edit.end < edit.start || sourceLength !== void 0 && edit.end > sourceLength) {
|
|
45
|
-
throw new InvalidStringEditError(
|
|
46
|
-
sourceLength === void 0 ? `edit [${edit.start}, ${edit.end}) is not a valid source range` : `edit [${edit.start}, ${edit.end}) is outside source length ${sourceLength}`
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
for (let index = 0; index < sorted.length - 1; index += 1) {
|
|
51
|
-
const later = sorted[index];
|
|
52
|
-
const earlier = sorted[index + 1];
|
|
53
|
-
if (!later || !earlier) continue;
|
|
54
|
-
if (earlier.start === later.start && (earlier.start === earlier.end || later.start === later.end)) {
|
|
55
|
-
throw new InvalidStringEditError(
|
|
56
|
-
`an insertion and another edit at offset ${earlier.start} have ambiguous order`
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
if (earlier.end > later.start) {
|
|
60
|
-
throw new InvalidStringEditError(
|
|
61
|
-
`edits [${earlier.start}, ${earlier.end}) and [${later.start}, ${later.end}) overlap`
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return sorted;
|
|
66
|
-
}
|
|
67
|
-
function mapOffsetThroughStringEdits(offset, edits) {
|
|
68
|
-
if (!Number.isInteger(offset) || offset < 0) {
|
|
69
|
-
throw new InvalidStringEditError(
|
|
70
|
-
"the mapped source offset must be a non-negative integer"
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
let delta = 0;
|
|
74
|
-
for (const edit of [...validateEditShape(edits)].reverse()) {
|
|
75
|
-
if (offset < edit.start) break;
|
|
76
|
-
if (offset < edit.end) return null;
|
|
77
|
-
delta += edit.replacement.length - (edit.end - edit.start);
|
|
78
|
-
}
|
|
79
|
-
return offset + delta;
|
|
80
|
-
}
|
|
22
|
+
// ../../modules/svelte-editor/compiler.ts
|
|
23
|
+
import { compile, parse } from "svelte/compiler";
|
|
81
24
|
|
|
82
25
|
// ../../modules/svelte-editor/escape.ts
|
|
83
26
|
function escapeSvelteAttributeValue(value, quote) {
|
|
@@ -239,7 +182,6 @@ function walk(ast, { enter, leave }) {
|
|
|
239
182
|
}
|
|
240
183
|
|
|
241
184
|
// ../../modules/svelte-editor/parse.ts
|
|
242
|
-
import { compile, parse } from "svelte/compiler";
|
|
243
185
|
function parseSvelteSourceInternal(source, filename, validation = "compiler") {
|
|
244
186
|
const cacheKey = `${validation}\0${filename}\0${source}`;
|
|
245
187
|
const cached = parseCache.get(cacheKey);
|
|
@@ -616,7 +558,7 @@ function annotateSvelteSource(options) {
|
|
|
616
558
|
const code = applyStringEdits(inputSource, transformEdits);
|
|
617
559
|
try {
|
|
618
560
|
if (validation === "compiler") {
|
|
619
|
-
|
|
561
|
+
compile(code, { filename: options.filename, generate: false });
|
|
620
562
|
} else {
|
|
621
563
|
const parsedOutput = parseSvelteSourceInternal(
|
|
622
564
|
code,
|
|
@@ -839,31 +781,22 @@ function serializeAnnotations(metadata) {
|
|
|
839
781
|
).join("");
|
|
840
782
|
}
|
|
841
783
|
|
|
842
|
-
// ../../modules/svelte-editor/
|
|
843
|
-
import {
|
|
844
|
-
|
|
845
|
-
// ../../modules/svelte-editor/transfer.ts
|
|
846
|
-
import { parse as parse3 } from "svelte/compiler";
|
|
784
|
+
// ../../modules/svelte-editor/markup-transfer.ts
|
|
785
|
+
import { parse as parse2 } from "svelte/compiler";
|
|
847
786
|
|
|
848
787
|
// svelte.ts
|
|
849
788
|
var MODULE_SCRIPT = /<script\b[^>]*\b(?:module\b|context\s*=\s*["']module["'])[^>]*>/;
|
|
850
789
|
function tempoSveltePreprocess(options = {}) {
|
|
851
790
|
const root = resolve(options.root ?? process.cwd());
|
|
852
|
-
const sourceRoot = resolve(options.sourceRoot ?? root);
|
|
791
|
+
const sourceRoot = resolve(options.sourceRoot ?? defaultSourceRoot(root));
|
|
853
792
|
const enabled = options.enabled ?? Boolean(process.env.TEMPO);
|
|
854
793
|
const metadata = ({ filename }) => {
|
|
855
794
|
if (!enabled || !filename) return null;
|
|
856
|
-
const
|
|
857
|
-
if (!absoluteFilename.endsWith(".svelte")) return null;
|
|
858
|
-
const sourcePath = relative(sourceRoot, absoluteFilename);
|
|
859
|
-
if (!sourcePath || sourcePath.startsWith("../") || isAbsolute(sourcePath) || sourcePath.split(/[\\/]/).includes("node_modules")) {
|
|
860
|
-
return null;
|
|
861
|
-
}
|
|
862
|
-
const filepath = relative(root, absoluteFilename).replace(/\\/g, "/");
|
|
863
|
-
if (!filepath || isAbsolute(filepath)) return null;
|
|
795
|
+
const identity = resolveAnnotationIdentity(filename, { root, sourceRoot });
|
|
796
|
+
if (!identity?.absoluteFilename.endsWith(".svelte")) return null;
|
|
864
797
|
return {
|
|
865
|
-
filepath,
|
|
866
|
-
modifiedTs:
|
|
798
|
+
filepath: identity.filepath,
|
|
799
|
+
modifiedTs: readModifiedTs(identity.absoluteFilename)
|
|
867
800
|
};
|
|
868
801
|
};
|
|
869
802
|
const annotation = createSvelteAnnotationPreprocessor({ metadata });
|