tempo-sdk 0.0.99 → 0.0.102

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 (170) hide show
  1. package/README.md +3 -403
  2. package/dist/assets/editor.d.ts +43 -65
  3. package/dist/assets/editor.js +1 -573
  4. package/dist/assets/index.d.ts +11 -61
  5. package/dist/assets/index.js +1 -338
  6. package/dist/assets/parser.d.ts +68 -78
  7. package/dist/assets/parser.js +1 -33
  8. package/dist/astro/asset-preview-client.d.ts +3 -2
  9. package/dist/astro/asset-preview-client.js +1 -93
  10. package/dist/astro/controls.d.ts +1 -3
  11. package/dist/astro/controls.js +1 -7
  12. package/dist/astro/document-client.d.ts +5 -6
  13. package/dist/astro/document-client.js +1 -78
  14. package/dist/astro/runtime.d.ts +23 -11
  15. package/dist/astro/runtime.js +1 -86
  16. package/dist/astro.d.ts +19 -13
  17. package/dist/astro.js +1 -818
  18. package/dist/canvas/astro-contract.d.ts +0 -3
  19. package/dist/canvas/astro-contract.js +1 -9
  20. package/dist/canvas/astro.d.ts +3 -4
  21. package/dist/canvas/astro.js +1 -42
  22. package/dist/canvas/editor.d.ts +187 -183
  23. package/dist/canvas/editor.js +1 -1094
  24. package/dist/canvas/flutter-preview.d.ts +0 -1
  25. package/dist/canvas/flutter-preview.js +1 -9
  26. package/dist/canvas/index.d.ts +46 -100
  27. package/dist/canvas/index.js +1 -3926
  28. package/dist/canvas/interact-projection.d.ts +7 -5
  29. package/dist/canvas/interact-projection.js +1 -12
  30. package/dist/canvas/parser.d.ts +10 -303
  31. package/dist/canvas/parser.js +1 -30
  32. package/dist/canvas/svelte.d.ts +6 -7
  33. package/dist/canvas/svelte.js +1 -91
  34. package/dist/canvas/vue.d.ts +9 -49
  35. package/dist/canvas/vue.js +1 -264
  36. package/dist/chunk-CXCUJCXD.js +1 -0
  37. package/dist/chunk-FH6TMWFA.js +1 -0
  38. package/dist/chunk-FL7FSJSL.js +1 -0
  39. package/dist/chunk-GQIOB5SV.js +1 -0
  40. package/dist/chunk-HBQ7FFH7.js +1 -0
  41. package/dist/chunk-JRJOWLCN.js +1 -0
  42. package/dist/chunk-LJCBFTMP.js +1 -0
  43. package/dist/chunk-M3GN2KUH.js +1 -0
  44. package/dist/chunk-MPIHFFML.js +1 -0
  45. package/dist/chunk-T5TY3U2H.js +1 -0
  46. package/dist/chunk-XO2BSHWM.js +1 -0
  47. package/dist/chunk-XUSV3KOD.js +1 -0
  48. package/dist/chunk-ZXBMP6RV.js +1 -0
  49. package/dist/{controls-uCaQ3CNX.d.ts → controls-DKslABtM.d.ts} +0 -3
  50. package/dist/expo/plugin.cjs +1 -1928
  51. package/dist/expo/plugin.js +1 -8
  52. package/dist/expo-babel-plugin.cjs +1 -1928
  53. package/dist/expo-babel-plugin.d.cts +46 -40
  54. package/dist/expo-babel-plugin.d.ts +46 -40
  55. package/dist/expo-babel-plugin.js +1 -8
  56. package/dist/flutter-preview-path.d.ts +23 -7
  57. package/dist/flutter-preview-path.js +1 -16
  58. package/dist/index.d.ts +33 -45
  59. package/dist/index.js +1 -20
  60. package/dist/nextjs/plugin.cjs +1 -413
  61. package/dist/nextjs/plugin.js +1 -7
  62. package/dist/nextjs-loader.cjs +1 -2277
  63. package/dist/nextjs.cjs +1 -484
  64. package/dist/nextjs.d.cts +2 -58
  65. package/dist/nextjs.d.ts +2 -58
  66. package/dist/nextjs.js +1 -17
  67. package/dist/nuxt/runtime/identity.d.ts +2 -4
  68. package/dist/nuxt/runtime/identity.js +1 -18
  69. package/dist/nuxt.d.ts +31 -92
  70. package/dist/nuxt.js +1 -5854
  71. package/dist/{page-DwLnOM5d.d.ts → page-Bc8PekIX.d.ts} +1 -5
  72. package/dist/parser.d-MO5ciJ5n.d.ts +236 -0
  73. package/dist/{storyboard-CMJVBSXn.d.ts → storyboard.contract.d-UQ4MUYN5.d.ts} +3 -25
  74. package/dist/svelte.d.ts +8 -18
  75. package/dist/svelte.js +1 -917
  76. package/dist/types-CfUgM2w4.d.ts +57 -0
  77. package/dist/v1-client-compat-n0E0XxuX.d.ts +5 -0
  78. package/dist/vue.d.ts +17 -58
  79. package/dist/vue.js +1 -1501
  80. package/package.json +12 -62
  81. package/dist/assets/editor.js.map +0 -1
  82. package/dist/assets/index.js.map +0 -1
  83. package/dist/assets/parser.js.map +0 -1
  84. package/dist/astro/asset-preview-client.js.map +0 -1
  85. package/dist/astro/controls.js.map +0 -1
  86. package/dist/astro/document-client.js.map +0 -1
  87. package/dist/astro/runtime.js.map +0 -1
  88. package/dist/astro.js.map +0 -1
  89. package/dist/canvas/astro-contract.js.map +0 -1
  90. package/dist/canvas/astro.js.map +0 -1
  91. package/dist/canvas/editor.js.map +0 -1
  92. package/dist/canvas/flutter-preview.js.map +0 -1
  93. package/dist/canvas/index.js.map +0 -1
  94. package/dist/canvas/interact-projection.js.map +0 -1
  95. package/dist/canvas/parser.js.map +0 -1
  96. package/dist/canvas/svelte.js.map +0 -1
  97. package/dist/canvas/vue.js.map +0 -1
  98. package/dist/chunk-27WT3XUG.js +0 -455
  99. package/dist/chunk-27WT3XUG.js.map +0 -1
  100. package/dist/chunk-5HIIF354.js +0 -67
  101. package/dist/chunk-5HIIF354.js.map +0 -1
  102. package/dist/chunk-65B52AR7.js +0 -11
  103. package/dist/chunk-65B52AR7.js.map +0 -1
  104. package/dist/chunk-6HYKKP5N.js +0 -2658
  105. package/dist/chunk-6HYKKP5N.js.map +0 -1
  106. package/dist/chunk-6SOP4XU6.js +0 -1891
  107. package/dist/chunk-6SOP4XU6.js.map +0 -1
  108. package/dist/chunk-AFXE462X.js +0 -1253
  109. package/dist/chunk-AFXE462X.js.map +0 -1
  110. package/dist/chunk-BQPKOVI5.js +0 -115
  111. package/dist/chunk-BQPKOVI5.js.map +0 -1
  112. package/dist/chunk-CYDF4LYJ.js +0 -342
  113. package/dist/chunk-CYDF4LYJ.js.map +0 -1
  114. package/dist/chunk-CYQE3TLC.js +0 -37
  115. package/dist/chunk-CYQE3TLC.js.map +0 -1
  116. package/dist/chunk-DI2ZFAWL.js +0 -14
  117. package/dist/chunk-DI2ZFAWL.js.map +0 -1
  118. package/dist/chunk-EGRHWZRV.js +0 -1
  119. package/dist/chunk-EGRHWZRV.js.map +0 -1
  120. package/dist/chunk-FGWGY3G3.js +0 -157
  121. package/dist/chunk-FGWGY3G3.js.map +0 -1
  122. package/dist/chunk-HOBTDB6G.js +0 -112
  123. package/dist/chunk-HOBTDB6G.js.map +0 -1
  124. package/dist/chunk-I7VF4ZOV.js +0 -630
  125. package/dist/chunk-I7VF4ZOV.js.map +0 -1
  126. package/dist/chunk-JVVHU3A7.js +0 -1077
  127. package/dist/chunk-JVVHU3A7.js.map +0 -1
  128. package/dist/chunk-MIXQVPDH.js +0 -8606
  129. package/dist/chunk-MIXQVPDH.js.map +0 -1
  130. package/dist/chunk-MU7S7NU7.js +0 -183
  131. package/dist/chunk-MU7S7NU7.js.map +0 -1
  132. package/dist/chunk-OX2YKYSL.js +0 -13
  133. package/dist/chunk-OX2YKYSL.js.map +0 -1
  134. package/dist/chunk-PYAJHLXO.js +0 -903
  135. package/dist/chunk-PYAJHLXO.js.map +0 -1
  136. package/dist/chunk-SGN7BDRE.js +0 -16
  137. package/dist/chunk-SGN7BDRE.js.map +0 -1
  138. package/dist/chunk-SGTGDLOX.js +0 -285
  139. package/dist/chunk-SGTGDLOX.js.map +0 -1
  140. package/dist/chunk-T364NBR3.js +0 -1440
  141. package/dist/chunk-T364NBR3.js.map +0 -1
  142. package/dist/chunk-U66QI3EN.js +0 -1524
  143. package/dist/chunk-U66QI3EN.js.map +0 -1
  144. package/dist/chunk-WTXOWQ7N.js +0 -47
  145. package/dist/chunk-WTXOWQ7N.js.map +0 -1
  146. package/dist/chunk-X5DJKVBT.js +0 -1308
  147. package/dist/chunk-X5DJKVBT.js.map +0 -1
  148. package/dist/chunk-ZT7HJ6YU.js +0 -38
  149. package/dist/chunk-ZT7HJ6YU.js.map +0 -1
  150. package/dist/chunk-ZW26VZHX.js +0 -3169
  151. package/dist/chunk-ZW26VZHX.js.map +0 -1
  152. package/dist/controls-reader-5MFHYBZZ.js +0 -192
  153. package/dist/controls-reader-5MFHYBZZ.js.map +0 -1
  154. package/dist/expo/plugin.cjs.map +0 -1
  155. package/dist/expo/plugin.js.map +0 -1
  156. package/dist/expo-babel-plugin.cjs.map +0 -1
  157. package/dist/expo-babel-plugin.js.map +0 -1
  158. package/dist/flutter-preview-path.js.map +0 -1
  159. package/dist/index.js.map +0 -1
  160. package/dist/nextjs/plugin.cjs.map +0 -1
  161. package/dist/nextjs/plugin.js.map +0 -1
  162. package/dist/nextjs-loader.cjs.map +0 -1
  163. package/dist/nextjs.cjs.map +0 -1
  164. package/dist/nextjs.js.map +0 -1
  165. package/dist/nuxt/runtime/identity.js.map +0 -1
  166. package/dist/nuxt.js.map +0 -1
  167. package/dist/svelte.js.map +0 -1
  168. package/dist/types-C8OIU-kc.d.ts +0 -106
  169. package/dist/v1-client-compat-qxaXEDm_.d.ts +0 -23
  170. package/dist/vue.js.map +0 -1
@@ -1,78 +1 @@
1
- // astro/document-client.ts
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};
@@ -1,15 +1,27 @@
1
- import { AstroModuleSource } from '@modules/astro-editor';
2
-
3
- /** Attach the defining module's exact transform receipt to server component
4
- * exports. Re-exports keep the original receipt, and client modules are never
5
- * transformed by this path. No request-global component registry is needed. */
6
- declare function instrumentFrameworkComponent<T>(component: T, metadata: AstroModuleSource & {
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
- }): T;
10
+ },
11
+ ): T;
9
12
  type AnyFunction = (...args: any[]) => any;
10
- /** Each server-emitted occurrence gets a token. Browser clones copy it, not its ownership. */
11
- declare function astroHostId(): string;
12
- declare function instrumentCreateComponent(original: AnyFunction, metadata: AstroModuleSource): AnyFunction;
13
- declare function instrumentRenderComponent(original: AnyFunction): AnyFunction;
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 };
@@ -1,86 +1 @@
1
- // astro/runtime.ts
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-ZXBMP6RV.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
- /** Annotation root; the application root by default. */
6
- root?: string;
7
- enabled?: boolean;
8
- /** Canvas declarations to expose as isolated documents. Defaults to tempo/designs. */
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
- /** Native Astro server instrumentation. Inert for builds, previews and normal dev. */
14
- declare function tempoAstro(options?: TempoAstroOptions): AstroIntegration;
15
- declare function astroAnnotationPlugins(root: string, generatedRoot?: string): Plugin[];
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
- /** Preserve the app's complete config and integrate only at Astro's dev hook. */
18
- declare function withTempoAstro<T extends AstroUserConfig>(config: T): T;
19
- declare function withTempoAstro<T extends AstroUserConfig>(config: Promise<T>): Promise<T>;
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 };