tempo-sdk 0.0.94 → 0.0.101
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/README.md +3 -403
- package/dist/assets/editor.d.ts +43 -65
- package/dist/assets/editor.js +1 -573
- package/dist/assets/index.d.ts +11 -61
- package/dist/assets/index.js +1 -338
- package/dist/assets/parser.d.ts +68 -78
- package/dist/assets/parser.js +1 -33
- package/dist/astro/asset-preview-client.d.ts +3 -2
- package/dist/astro/asset-preview-client.js +1 -93
- package/dist/astro/controls.d.ts +1 -3
- package/dist/astro/controls.js +1 -7
- package/dist/astro/document-client.d.ts +5 -6
- package/dist/astro/document-client.js +1 -78
- package/dist/astro/runtime.d.ts +23 -11
- package/dist/astro/runtime.js +1 -86
- package/dist/astro.d.ts +19 -13
- package/dist/astro.js +1 -818
- package/dist/canvas/astro-contract.d.ts +0 -3
- package/dist/canvas/astro-contract.js +1 -9
- package/dist/canvas/astro.d.ts +3 -4
- package/dist/canvas/astro.js +1 -42
- package/dist/canvas/editor.d.ts +187 -183
- package/dist/canvas/editor.js +1 -1094
- package/dist/canvas/flutter-preview.d.ts +0 -1
- package/dist/canvas/flutter-preview.js +1 -9
- package/dist/canvas/index.d.ts +46 -100
- package/dist/canvas/index.js +1 -3897
- package/dist/canvas/interact-projection.d.ts +7 -5
- package/dist/canvas/interact-projection.js +1 -12
- package/dist/canvas/parser.d.ts +10 -303
- package/dist/canvas/parser.js +1 -30
- package/dist/canvas/svelte.d.ts +6 -7
- package/dist/canvas/svelte.js +1 -91
- package/dist/canvas/vue.d.ts +9 -49
- package/dist/canvas/vue.js +1 -264
- package/dist/chunk-FH6TMWFA.js +1 -0
- package/dist/chunk-GQIOB5SV.js +1 -0
- package/dist/chunk-HBQ7FFH7.js +1 -0
- package/dist/chunk-JRJOWLCN.js +1 -0
- package/dist/chunk-M3GN2KUH.js +1 -0
- package/dist/chunk-MPIHFFML.js +1 -0
- package/dist/chunk-N2V6XXRK.js +1 -0
- package/dist/chunk-QNVQ7U2W.js +1 -0
- package/dist/chunk-T5TY3U2H.js +1 -0
- package/dist/chunk-TK37FQAR.js +1 -0
- package/dist/chunk-XO2BSHWM.js +1 -0
- package/dist/chunk-XUSV3KOD.js +1 -0
- package/dist/chunk-YRBEBVG4.js +1 -0
- package/dist/{controls-uCaQ3CNX.d.ts → controls-DKslABtM.d.ts} +0 -3
- package/dist/expo/plugin.cjs +1 -1928
- package/dist/expo/plugin.js +1 -8
- package/dist/expo-babel-plugin.cjs +1 -1928
- package/dist/expo-babel-plugin.d.cts +46 -40
- package/dist/expo-babel-plugin.d.ts +46 -40
- package/dist/expo-babel-plugin.js +1 -8
- package/dist/flutter-preview-path.d.ts +23 -7
- package/dist/flutter-preview-path.js +1 -16
- package/dist/index.d.ts +33 -45
- package/dist/index.js +1 -20
- package/dist/nextjs/plugin.cjs +1 -413
- package/dist/nextjs/plugin.js +1 -7
- package/dist/nextjs-loader.cjs +1 -2277
- package/dist/nextjs.cjs +1 -484
- package/dist/nextjs.d.cts +2 -58
- package/dist/nextjs.d.ts +2 -58
- package/dist/nextjs.js +1 -17
- package/dist/nuxt/runtime/identity.d.ts +2 -4
- package/dist/nuxt/runtime/identity.js +1 -18
- package/dist/nuxt.d.ts +31 -92
- package/dist/nuxt.js +1 -5854
- package/dist/{page-DwLnOM5d.d.ts → page-Bc8PekIX.d.ts} +1 -5
- package/dist/parser.d-MO5ciJ5n.d.ts +236 -0
- package/dist/{storyboard-CMJVBSXn.d.ts → storyboard.contract.d-UQ4MUYN5.d.ts} +3 -25
- package/dist/svelte.d.ts +8 -18
- package/dist/svelte.js +1 -917
- package/dist/types-CfUgM2w4.d.ts +57 -0
- package/dist/v1-client-compat-n0E0XxuX.d.ts +5 -0
- package/dist/vue.d.ts +17 -58
- package/dist/vue.js +1 -1501
- package/package.json +12 -62
- package/dist/assets/editor.js.map +0 -1
- package/dist/assets/index.js.map +0 -1
- package/dist/assets/parser.js.map +0 -1
- package/dist/astro/asset-preview-client.js.map +0 -1
- package/dist/astro/controls.js.map +0 -1
- package/dist/astro/document-client.js.map +0 -1
- package/dist/astro/runtime.js.map +0 -1
- package/dist/astro.js.map +0 -1
- package/dist/canvas/astro-contract.js.map +0 -1
- package/dist/canvas/astro.js.map +0 -1
- package/dist/canvas/editor.js.map +0 -1
- package/dist/canvas/flutter-preview.js.map +0 -1
- package/dist/canvas/index.js.map +0 -1
- package/dist/canvas/interact-projection.js.map +0 -1
- package/dist/canvas/parser.js.map +0 -1
- package/dist/canvas/svelte.js.map +0 -1
- package/dist/canvas/vue.js.map +0 -1
- package/dist/chunk-3W6B75UK.js +0 -455
- package/dist/chunk-3W6B75UK.js.map +0 -1
- package/dist/chunk-5HIIF354.js +0 -67
- package/dist/chunk-5HIIF354.js.map +0 -1
- package/dist/chunk-65B52AR7.js +0 -11
- package/dist/chunk-65B52AR7.js.map +0 -1
- package/dist/chunk-6QGMLNO3.js +0 -8337
- package/dist/chunk-6QGMLNO3.js.map +0 -1
- package/dist/chunk-6SOP4XU6.js +0 -1891
- package/dist/chunk-6SOP4XU6.js.map +0 -1
- package/dist/chunk-AFXE462X.js +0 -1253
- package/dist/chunk-AFXE462X.js.map +0 -1
- package/dist/chunk-BQPKOVI5.js +0 -115
- package/dist/chunk-BQPKOVI5.js.map +0 -1
- package/dist/chunk-CYQE3TLC.js +0 -37
- package/dist/chunk-CYQE3TLC.js.map +0 -1
- package/dist/chunk-DI2ZFAWL.js +0 -14
- package/dist/chunk-DI2ZFAWL.js.map +0 -1
- package/dist/chunk-EGRHWZRV.js +0 -1
- package/dist/chunk-EGRHWZRV.js.map +0 -1
- package/dist/chunk-FGWGY3G3.js +0 -157
- package/dist/chunk-FGWGY3G3.js.map +0 -1
- package/dist/chunk-HOBTDB6G.js +0 -112
- package/dist/chunk-HOBTDB6G.js.map +0 -1
- package/dist/chunk-JVVHU3A7.js +0 -1077
- package/dist/chunk-JVVHU3A7.js.map +0 -1
- package/dist/chunk-KY52JZZL.js +0 -3130
- package/dist/chunk-KY52JZZL.js.map +0 -1
- package/dist/chunk-LEW24RRZ.js +0 -1315
- package/dist/chunk-LEW24RRZ.js.map +0 -1
- package/dist/chunk-MU7S7NU7.js +0 -183
- package/dist/chunk-MU7S7NU7.js.map +0 -1
- package/dist/chunk-OX2YKYSL.js +0 -13
- package/dist/chunk-OX2YKYSL.js.map +0 -1
- package/dist/chunk-OYNR6D7K.js +0 -342
- package/dist/chunk-OYNR6D7K.js.map +0 -1
- package/dist/chunk-PYAJHLXO.js +0 -903
- package/dist/chunk-PYAJHLXO.js.map +0 -1
- package/dist/chunk-REYOX4JT.js +0 -285
- package/dist/chunk-REYOX4JT.js.map +0 -1
- package/dist/chunk-SGN7BDRE.js +0 -16
- package/dist/chunk-SGN7BDRE.js.map +0 -1
- package/dist/chunk-T364NBR3.js +0 -1440
- package/dist/chunk-T364NBR3.js.map +0 -1
- package/dist/chunk-U66QI3EN.js +0 -1524
- package/dist/chunk-U66QI3EN.js.map +0 -1
- package/dist/chunk-VRNJI4Y6.js +0 -2657
- package/dist/chunk-VRNJI4Y6.js.map +0 -1
- package/dist/chunk-WRILG6GR.js +0 -38
- package/dist/chunk-WRILG6GR.js.map +0 -1
- package/dist/chunk-WTXOWQ7N.js +0 -47
- package/dist/chunk-WTXOWQ7N.js.map +0 -1
- package/dist/chunk-YHGUAOBM.js +0 -621
- package/dist/chunk-YHGUAOBM.js.map +0 -1
- package/dist/controls-reader-5MFHYBZZ.js +0 -192
- package/dist/controls-reader-5MFHYBZZ.js.map +0 -1
- package/dist/expo/plugin.cjs.map +0 -1
- package/dist/expo/plugin.js.map +0 -1
- package/dist/expo-babel-plugin.cjs.map +0 -1
- package/dist/expo-babel-plugin.js.map +0 -1
- package/dist/flutter-preview-path.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/nextjs/plugin.cjs.map +0 -1
- package/dist/nextjs/plugin.js.map +0 -1
- package/dist/nextjs-loader.cjs.map +0 -1
- package/dist/nextjs.cjs.map +0 -1
- package/dist/nextjs.js.map +0 -1
- package/dist/nuxt/runtime/identity.js.map +0 -1
- package/dist/nuxt.js.map +0 -1
- package/dist/svelte.js.map +0 -1
- package/dist/types-C8OIU-kc.d.ts +0 -106
- package/dist/v1-client-compat-qxaXEDm_.d.ts +0 -23
- package/dist/vue.js.map +0 -1
|
@@ -1,78 +1 @@
|
|
|
1
|
-
|
|
2
|
-
function needsAstroDocumentReload(document2, paths) {
|
|
3
|
-
const changed = paths.map((path) => {
|
|
4
|
-
try {
|
|
5
|
-
return decodeURIComponent(path.split(/[?#]/)[0]);
|
|
6
|
-
} catch {
|
|
7
|
-
return path;
|
|
8
|
-
}
|
|
9
|
-
});
|
|
10
|
-
const matches = (file) => {
|
|
11
|
-
file = file.replaceAll("\\", "/").replace(/^\/+/, "");
|
|
12
|
-
return changed.some((path) => path === file || path.endsWith(`/${file}`));
|
|
13
|
-
};
|
|
14
|
-
if ([
|
|
15
|
-
...document2.querySelectorAll(
|
|
16
|
-
"[data-tempo-filepath][data-tempo-source-version]"
|
|
17
|
-
)
|
|
18
|
-
].some((element) => {
|
|
19
|
-
if (!matches(element.getAttribute("data-tempo-filepath"))) return false;
|
|
20
|
-
const island = element.closest("astro-island");
|
|
21
|
-
return !island || island.hasAttribute("ssr");
|
|
22
|
-
}))
|
|
23
|
-
return true;
|
|
24
|
-
const marker = (node, kind) => {
|
|
25
|
-
if (node.nodeType !== 8 || !node.textContent?.startsWith(`tempo:astro:${kind}:`))
|
|
26
|
-
return null;
|
|
27
|
-
try {
|
|
28
|
-
return JSON.parse(decodeURIComponent(node.textContent.slice(14)));
|
|
29
|
-
} catch {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const comments = document2.createTreeWalker(document2, 128);
|
|
34
|
-
for (let begin = comments.nextNode(); begin; begin = comments.nextNode()) {
|
|
35
|
-
const value = marker(begin, "b");
|
|
36
|
-
const definition = value?.definition;
|
|
37
|
-
if (typeof value?.occurrence !== "string" || typeof definition?.filepath !== "string" || !definition.sourceVersion || !matches(definition.filepath))
|
|
38
|
-
continue;
|
|
39
|
-
let hydrated = false, server = false;
|
|
40
|
-
for (let node = begin.nextSibling; node; node = node.nextSibling) {
|
|
41
|
-
if (marker(node, "e")?.occurrence === value.occurrence) {
|
|
42
|
-
if (server || !hydrated) return true;
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
if (node.nodeType === 1) {
|
|
46
|
-
const element = node;
|
|
47
|
-
if (element.localName === "astro-island") {
|
|
48
|
-
hydrated = true;
|
|
49
|
-
server || (server = element.hasAttribute("ssr"));
|
|
50
|
-
} else if (!["script", "style", "link", "template"].includes(element.localName))
|
|
51
|
-
server = true;
|
|
52
|
-
} else if (node.nodeType === 3 && node.textContent?.trim()) server = true;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
function startAstroDocumentClient(hot) {
|
|
58
|
-
if (!hot) return;
|
|
59
|
-
const update = (payload) => {
|
|
60
|
-
const paths = payload.updates.filter((update2) => update2.type === "js-update").map((update2) => update2.path);
|
|
61
|
-
if (paths.length && needsAstroDocumentReload(document, paths))
|
|
62
|
-
location.reload();
|
|
63
|
-
};
|
|
64
|
-
const restore = (event) => {
|
|
65
|
-
if (event.persisted) location.reload();
|
|
66
|
-
};
|
|
67
|
-
hot.on("vite:afterUpdate", update);
|
|
68
|
-
window.addEventListener("pageshow", restore);
|
|
69
|
-
hot.dispose(() => {
|
|
70
|
-
hot.off("vite:afterUpdate", update);
|
|
71
|
-
window.removeEventListener("pageshow", restore);
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
export {
|
|
75
|
-
needsAstroDocumentReload,
|
|
76
|
-
startAstroDocumentClient
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=document-client.js.map
|
|
1
|
+
import{a as e}from"../chunk-MPIHFFML.js";import"../chunk-XO2BSHWM.js";import{a as o}from"../chunk-XUSV3KOD.js";var r=o(((...t)=>e("astro/document-client").needsAstroDocumentReload(...t)),"needsAstroDocumentReload"),c=o(((...t)=>e("astro/document-client").startAstroDocumentClient(...t)),"startAstroDocumentClient");export{r as needsAstroDocumentReload,c as startAstroDocumentClient};
|
package/dist/astro/runtime.d.ts
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare function instrumentFrameworkComponent<T>(
|
|
1
|
+
interface AstroModuleSource {
|
|
2
|
+
filepath: string;
|
|
3
|
+
sourceVersion: string;
|
|
4
|
+
modifiedTs: number;
|
|
5
|
+
}
|
|
6
|
+
declare function instrumentFrameworkComponent$1<T>(
|
|
7
|
+
component: T,
|
|
8
|
+
metadata: AstroModuleSource & {
|
|
7
9
|
exportName?: string;
|
|
8
|
-
}
|
|
10
|
+
},
|
|
11
|
+
): T;
|
|
9
12
|
type AnyFunction = (...args: any[]) => any;
|
|
10
|
-
|
|
11
|
-
declare function
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
declare function astroHostId$1(): string;
|
|
14
|
+
declare function instrumentCreateComponent$1(
|
|
15
|
+
original: AnyFunction,
|
|
16
|
+
metadata: AstroModuleSource,
|
|
17
|
+
): AnyFunction;
|
|
18
|
+
declare function instrumentRenderComponent$1(
|
|
19
|
+
original: AnyFunction,
|
|
20
|
+
): AnyFunction;
|
|
21
|
+
|
|
22
|
+
declare const instrumentFrameworkComponent: typeof instrumentFrameworkComponent$1;
|
|
23
|
+
declare const astroHostId: typeof astroHostId$1;
|
|
24
|
+
declare const instrumentCreateComponent: typeof instrumentCreateComponent$1;
|
|
25
|
+
declare const instrumentRenderComponent: typeof instrumentRenderComponent$1;
|
|
14
26
|
|
|
15
27
|
export { astroHostId, instrumentCreateComponent, instrumentFrameworkComponent, instrumentRenderComponent };
|
package/dist/astro/runtime.js
CHANGED
|
@@ -1,86 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { markHTMLString } from "astro/runtime/server/index.js";
|
|
3
|
-
var CALLSITE_PROP = "__tempo_astro_callsite__";
|
|
4
|
-
var definition = /* @__PURE__ */ Symbol.for("tempo.astro.definition");
|
|
5
|
-
var template = /* @__PURE__ */ Symbol.for("astro.renderTemplateResult");
|
|
6
|
-
var headAndContent = /* @__PURE__ */ Symbol.for("astro.headAndContent");
|
|
7
|
-
function instrumentFrameworkComponent(component, metadata) {
|
|
8
|
-
if ((typeof component === "function" || component && typeof component === "object" && "$$typeof" in component) && Object.isExtensible(component) && !Object.prototype.hasOwnProperty.call(component, definition))
|
|
9
|
-
Object.defineProperty(component, definition, { value: metadata });
|
|
10
|
-
return component;
|
|
11
|
-
}
|
|
12
|
-
function astroHostId() {
|
|
13
|
-
return globalThis.crypto.randomUUID();
|
|
14
|
-
}
|
|
15
|
-
function comment(kind, data) {
|
|
16
|
-
return `<!--tempo:astro:${kind}${data === void 0 ? "" : `:${encodeURIComponent(JSON.stringify(data)).replaceAll("-", "%2D")}`}-->`;
|
|
17
|
-
}
|
|
18
|
-
function thenOrValue(value, fn) {
|
|
19
|
-
return value && typeof value.then === "function" ? Promise.resolve(value).then(fn) : fn(value);
|
|
20
|
-
}
|
|
21
|
-
function withReceipt(value, metadata) {
|
|
22
|
-
if (!value || typeof value !== "object") return value;
|
|
23
|
-
if (value[headAndContent] && value.content) {
|
|
24
|
-
return { ...value, content: withReceipt(value.content, metadata) };
|
|
25
|
-
}
|
|
26
|
-
if (!value[template]) return value;
|
|
27
|
-
const parts = [...value.htmlParts];
|
|
28
|
-
parts[parts.length - 1] += comment("m", metadata);
|
|
29
|
-
return Object.assign(Object.create(Object.getPrototypeOf(value)), value, {
|
|
30
|
-
htmlParts: parts
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function instrumentCreateComponent(original, metadata) {
|
|
34
|
-
return (...args) => {
|
|
35
|
-
const wrap = (factory) => function(...factoryArgs) {
|
|
36
|
-
return thenOrValue(
|
|
37
|
-
factory.apply(this, factoryArgs),
|
|
38
|
-
(value) => withReceipt(value, metadata)
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
const first = args[0];
|
|
42
|
-
const component = typeof first === "function" ? original(wrap(first), ...args.slice(1)) : original(
|
|
43
|
-
{ ...first, factory: wrap(first.factory) },
|
|
44
|
-
...args.slice(1)
|
|
45
|
-
);
|
|
46
|
-
Object.defineProperty(component, definition, { value: metadata });
|
|
47
|
-
return component;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function instrumentRenderComponent(original) {
|
|
51
|
-
return (result, displayName, component, props = {}, ...rest) => {
|
|
52
|
-
const source = props[CALLSITE_PROP];
|
|
53
|
-
if (!source)
|
|
54
|
-
return original(result, displayName, component, props, ...rest);
|
|
55
|
-
const cleanProps = { ...props };
|
|
56
|
-
delete cleanProps[CALLSITE_PROP];
|
|
57
|
-
return thenOrValue(
|
|
58
|
-
original(result, displayName, component, cleanProps, ...rest),
|
|
59
|
-
(instance) => ({
|
|
60
|
-
render(destination) {
|
|
61
|
-
const occurrence = astroHostId();
|
|
62
|
-
destination.write(
|
|
63
|
-
markHTMLString(
|
|
64
|
-
comment("b", {
|
|
65
|
-
occurrence,
|
|
66
|
-
source,
|
|
67
|
-
definition: component?.[definition] ?? null
|
|
68
|
-
})
|
|
69
|
-
)
|
|
70
|
-
);
|
|
71
|
-
return thenOrValue(
|
|
72
|
-
instance.render(destination),
|
|
73
|
-
() => destination.write(markHTMLString(comment("e", { occurrence })))
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
export {
|
|
81
|
-
astroHostId,
|
|
82
|
-
instrumentCreateComponent,
|
|
83
|
-
instrumentFrameworkComponent,
|
|
84
|
-
instrumentRenderComponent
|
|
85
|
-
};
|
|
86
|
-
//# sourceMappingURL=runtime.js.map
|
|
1
|
+
import{b as t}from"../chunk-QNVQ7U2W.js";import"../chunk-XUSV3KOD.js";var o=t("astro/runtime","instrumentFrameworkComponent"),e=t("astro/runtime","astroHostId"),r=t("astro/runtime","instrumentCreateComponent"),m=t("astro/runtime","instrumentRenderComponent");export{e as astroHostId,r as instrumentCreateComponent,o as instrumentFrameworkComponent,m as instrumentRenderComponent};
|
package/dist/astro.d.ts
CHANGED
|
@@ -2,20 +2,26 @@ import { AstroIntegration, AstroUserConfig } from 'astro';
|
|
|
2
2
|
import { Plugin } from 'vite';
|
|
3
3
|
|
|
4
4
|
interface TempoAstroOptions {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
canvasesRoot?: string;
|
|
10
|
-
/** App-relative CSS entries for isolated components. Defaults to layout/global CSS discovery. */
|
|
11
|
-
styles?: string[];
|
|
5
|
+
root?: string;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
canvasesRoot?: string;
|
|
8
|
+
styles?: string[];
|
|
12
9
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
declare function tempoAstro$1(
|
|
11
|
+
options?: TempoAstroOptions,
|
|
12
|
+
): AstroIntegration;
|
|
13
|
+
declare function astroAnnotationPlugins$1(
|
|
14
|
+
root: string,
|
|
15
|
+
generatedRoot?: string,
|
|
16
|
+
): Plugin[];
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
declare function withTempoAstro<T extends AstroUserConfig>(
|
|
19
|
-
|
|
18
|
+
declare function withTempoAstro$1<T extends AstroUserConfig>(config: T): T;
|
|
19
|
+
declare function withTempoAstro$1<T extends AstroUserConfig>(
|
|
20
|
+
config: Promise<T>,
|
|
21
|
+
): Promise<T>;
|
|
22
|
+
|
|
23
|
+
declare const tempoAstro: typeof tempoAstro$1;
|
|
24
|
+
declare const astroAnnotationPlugins: typeof astroAnnotationPlugins$1;
|
|
25
|
+
declare const withTempoAstro: typeof withTempoAstro$1;
|
|
20
26
|
|
|
21
27
|
export { type TempoAstroOptions, astroAnnotationPlugins, tempoAstro as default, tempoAstro, withTempoAstro };
|