tempo-sdk 0.0.57 → 0.0.66
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/astro/client.d.ts +4 -0
- package/dist/assets/editor.js +1 -1
- package/dist/assets/index.d.ts +10 -63
- package/dist/assets/index.js +12 -32
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/parser.js +1 -1
- package/dist/astro/asset-preview-client.d.ts +4 -0
- package/dist/astro/asset-preview-client.js +93 -0
- package/dist/astro/asset-preview-client.js.map +1 -0
- package/dist/astro/controls.d.ts +7 -0
- package/dist/astro/controls.js +7 -0
- package/dist/astro/controls.js.map +1 -0
- package/dist/astro/document-client.d.ts +10 -0
- package/dist/astro/document-client.js +78 -0
- package/dist/astro/document-client.js.map +1 -0
- package/dist/astro/runtime.d.ts +15 -0
- package/dist/astro/runtime.js +86 -0
- package/dist/astro/runtime.js.map +1 -0
- package/dist/astro.d.ts +21 -0
- package/dist/astro.js +749 -0
- package/dist/astro.js.map +1 -0
- package/dist/canvas/astro-contract.d.ts +21 -0
- package/dist/canvas/astro-contract.js +9 -0
- package/dist/canvas/astro-contract.js.map +1 -0
- package/dist/canvas/astro.d.ts +18 -0
- package/dist/canvas/astro.js +42 -0
- package/dist/canvas/astro.js.map +1 -0
- package/dist/canvas/editor.d.ts +1 -1
- package/dist/canvas/editor.js +3 -2
- package/dist/canvas/editor.js.map +1 -1
- package/dist/canvas/index.d.ts +4 -2
- package/dist/canvas/index.js +138 -34
- package/dist/canvas/index.js.map +1 -1
- package/dist/canvas/interact-projection.js +4 -4
- package/dist/canvas/parser.d.ts +3 -1
- package/dist/canvas/parser.js +1 -1
- package/dist/canvas/svelte.d.ts +1 -1
- package/dist/canvas/svelte.js +3 -3
- package/dist/{chunk-5BHIHP25.js → chunk-2JRAG36X.js} +37 -11
- package/dist/chunk-2JRAG36X.js.map +1 -0
- package/dist/{chunk-N2TYN3RB.js → chunk-6AAE4LYV.js} +123 -123
- package/dist/chunk-6AAE4LYV.js.map +1 -0
- package/dist/{chunk-U3SLJNRS.js → chunk-6IR5JY6W.js} +106 -7
- package/dist/chunk-6IR5JY6W.js.map +1 -0
- package/dist/{chunk-QXL6GL2P.js → chunk-6W6UKDSY.js} +46 -5
- package/dist/chunk-6W6UKDSY.js.map +1 -0
- package/dist/chunk-77DZCV5Z.js +38 -0
- package/dist/chunk-77DZCV5Z.js.map +1 -0
- package/dist/chunk-DELFOKU3.js +2495 -0
- package/dist/chunk-DELFOKU3.js.map +1 -0
- package/dist/{chunk-U64AHDHZ.js → chunk-EYKOOLPL.js} +380 -34
- package/dist/chunk-EYKOOLPL.js.map +1 -0
- package/dist/chunk-F23JGM4U.js +107 -0
- package/dist/chunk-F23JGM4U.js.map +1 -0
- package/dist/chunk-FE6TYCLF.js +1514 -0
- package/dist/chunk-FE6TYCLF.js.map +1 -0
- package/dist/chunk-H6OZIX2U.js +133 -0
- package/dist/chunk-H6OZIX2U.js.map +1 -0
- package/dist/chunk-JVVHU3A7.js +1077 -0
- package/dist/chunk-JVVHU3A7.js.map +1 -0
- package/dist/{chunk-2IQD2KPS.js → chunk-KOSJXE4G.js} +3 -102
- package/dist/chunk-KOSJXE4G.js.map +1 -0
- package/dist/{chunk-TL4MGN7E.js → chunk-NSKYOKG5.js} +254 -10
- package/dist/chunk-NSKYOKG5.js.map +1 -0
- package/dist/chunk-OX2YKYSL.js +13 -0
- package/dist/chunk-OX2YKYSL.js.map +1 -0
- package/dist/{chunk-RHHVVWAC.js → chunk-PXDTH36X.js} +14 -12
- package/dist/chunk-PXDTH36X.js.map +1 -0
- package/dist/{chunk-XLEKCOB7.js → chunk-PYAJHLXO.js} +56 -1
- package/dist/chunk-PYAJHLXO.js.map +1 -0
- package/dist/{chunk-EMYYTS6D.js → chunk-Q2A46HHW.js} +19 -14
- package/dist/chunk-Q2A46HHW.js.map +1 -0
- package/dist/controls-reader-SNMI2UY7.js +191 -0
- package/dist/controls-reader-SNMI2UY7.js.map +1 -0
- package/dist/controls-uCaQ3CNX.d.ts +61 -0
- package/dist/expo/plugin.cjs +18 -13
- package/dist/expo/plugin.cjs.map +1 -1
- package/dist/expo/plugin.js +1 -1
- package/dist/expo-babel-plugin.cjs +18 -13
- package/dist/expo-babel-plugin.cjs.map +1 -1
- package/dist/expo-babel-plugin.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +10 -2294
- package/dist/index.js.map +1 -1
- package/dist/nextjs/plugin.cjs +45 -4
- package/dist/nextjs/plugin.cjs.map +1 -1
- package/dist/nextjs/plugin.js +1 -1
- package/dist/nextjs-loader.cjs +63 -17
- package/dist/nextjs-loader.cjs.map +1 -1
- package/dist/nextjs.cjs +45 -4
- package/dist/nextjs.cjs.map +1 -1
- package/dist/nextjs.d.cts +4 -4
- package/dist/nextjs.d.ts +4 -4
- package/dist/nextjs.js +1 -1
- package/dist/{storyboard-BtQuVGpl.d.ts → storyboard-4YdTYq_e.d.ts} +3 -1
- package/dist/svelte.js +7 -1075
- package/dist/svelte.js.map +1 -1
- package/package.json +45 -4
- package/dist/chunk-2IQD2KPS.js.map +0 -1
- package/dist/chunk-5BHIHP25.js.map +0 -1
- package/dist/chunk-EMYYTS6D.js.map +0 -1
- package/dist/chunk-N2TYN3RB.js.map +0 -1
- package/dist/chunk-QXL6GL2P.js.map +0 -1
- package/dist/chunk-RHHVVWAC.js.map +0 -1
- package/dist/chunk-TL4MGN7E.js.map +0 -1
- package/dist/chunk-U3SLJNRS.js.map +0 -1
- package/dist/chunk-U64AHDHZ.js.map +0 -1
- package/dist/chunk-XLEKCOB7.js.map +0 -1
package/dist/expo/plugin.js
CHANGED
|
@@ -33,12 +33,14 @@ var import_node_path = require("path");
|
|
|
33
33
|
var import_oxc_parser = require("oxc-parser");
|
|
34
34
|
var SDK_IMPORT_SOURCES = /* @__PURE__ */ new Set([
|
|
35
35
|
"tempo-sdk/canvas",
|
|
36
|
-
"tempo-sdk/canvas/svelte"
|
|
36
|
+
"tempo-sdk/canvas/svelte",
|
|
37
|
+
"tempo-sdk/canvas/astro"
|
|
37
38
|
]);
|
|
38
39
|
var SDK_COMPONENTS = /* @__PURE__ */ new Set([
|
|
39
40
|
"Canvas",
|
|
40
41
|
"Storyboard",
|
|
41
42
|
"SvelteStoryboard",
|
|
43
|
+
"AstroStoryboard",
|
|
42
44
|
"LegacyStoryboardV1",
|
|
43
45
|
"RouteStoryboard",
|
|
44
46
|
"HtmlStoryboard"
|
|
@@ -430,7 +432,7 @@ function readStoryboard(element, component, imports, legacyObjects, source, glob
|
|
|
430
432
|
}
|
|
431
433
|
])
|
|
432
434
|
} : readLayout(openingElement, component);
|
|
433
|
-
const kind = component === "Storyboard" || component === "SvelteStoryboard" || component === "LegacyStoryboardV1" ? "component" : component === "RouteStoryboard" ? "route" : "html";
|
|
435
|
+
const kind = component === "Storyboard" || component === "SvelteStoryboard" || component === "AstroStoryboard" || component === "LegacyStoryboardV1" ? "component" : component === "RouteStoryboard" ? "route" : "html";
|
|
434
436
|
if (!id) {
|
|
435
437
|
errors.push({
|
|
436
438
|
message: `<${component}> must include a literal "id" prop`,
|
|
@@ -445,7 +447,7 @@ function readStoryboard(element, component, imports, legacyObjects, source, glob
|
|
|
445
447
|
storyboardKey: id?.value ?? "",
|
|
446
448
|
displayName: name?.value ?? legacyObject?.displayName,
|
|
447
449
|
kind,
|
|
448
|
-
...component === "SvelteStoryboard" ? { uiFramework: "svelte" } : {},
|
|
450
|
+
...component === "SvelteStoryboard" ? { uiFramework: "svelte" } : component === "AstroStoryboard" ? { runtimeFramework: "astro" } : {},
|
|
449
451
|
layout: layout.value,
|
|
450
452
|
editable: Boolean(id) && layout.errors.length === 0,
|
|
451
453
|
jsxElementSpan: toSpan(element) ?? { start: 0, end: 0 },
|
|
@@ -468,7 +470,7 @@ function readStoryboard(element, component, imports, legacyObjects, source, glob
|
|
|
468
470
|
} : void 0,
|
|
469
471
|
errors
|
|
470
472
|
};
|
|
471
|
-
if (component === "Storyboard" || component === "SvelteStoryboard") {
|
|
473
|
+
if (component === "Storyboard" || component === "SvelteStoryboard" || component === "AstroStoryboard") {
|
|
472
474
|
const componentReference = readComponentReference(
|
|
473
475
|
openingElement,
|
|
474
476
|
imports,
|
|
@@ -484,7 +486,7 @@ function readStoryboard(element, component, imports, legacyObjects, source, glob
|
|
|
484
486
|
});
|
|
485
487
|
}
|
|
486
488
|
}
|
|
487
|
-
if (component === "Storyboard" || component === "SvelteStoryboard" || component === "HtmlStoryboard") {
|
|
489
|
+
if (component === "Storyboard" || component === "SvelteStoryboard" || component === "AstroStoryboard" || component === "HtmlStoryboard") {
|
|
488
490
|
const vrt = readVrt(openingElement, errors);
|
|
489
491
|
if (vrt) {
|
|
490
492
|
if (vrt.value) {
|
|
@@ -510,13 +512,13 @@ function readStoryboard(element, component, imports, legacyObjects, source, glob
|
|
|
510
512
|
if (component === "HtmlStoryboard") {
|
|
511
513
|
const filepath = readStringAttribute(openingElement, "filepath");
|
|
512
514
|
const src = readStringAttribute(openingElement, "src");
|
|
513
|
-
storyboard.filepath = filepath?.value;
|
|
515
|
+
storyboard.filepath = filepath?.value.trim() ? filepath.value : void 0;
|
|
514
516
|
storyboard.filepathSpan = filepath?.valueSpan;
|
|
515
517
|
storyboard.filepathAttributeSpan = filepath?.attributeSpan;
|
|
516
518
|
storyboard.src = src?.value;
|
|
517
519
|
storyboard.srcSpan = src?.valueSpan;
|
|
518
520
|
storyboard.srcAttributeSpan = src?.attributeSpan;
|
|
519
|
-
if (!filepath && !src) {
|
|
521
|
+
if (!filepath?.value.trim() && !src?.value.trim()) {
|
|
520
522
|
errors.push({
|
|
521
523
|
message: '<HtmlStoryboard> must include a literal "filepath" or "src" prop',
|
|
522
524
|
span: toSpan(openingElement),
|
|
@@ -583,12 +585,12 @@ function validateCanvasChildren(canvasElement, imports) {
|
|
|
583
585
|
child.openingElement?.name,
|
|
584
586
|
imports
|
|
585
587
|
);
|
|
586
|
-
if (component === "Storyboard" || component === "SvelteStoryboard" || component === "LegacyStoryboardV1" || component === "RouteStoryboard" || component === "HtmlStoryboard") {
|
|
588
|
+
if (component === "Storyboard" || component === "SvelteStoryboard" || component === "AstroStoryboard" || component === "LegacyStoryboardV1" || component === "RouteStoryboard" || component === "HtmlStoryboard") {
|
|
587
589
|
continue;
|
|
588
590
|
}
|
|
589
591
|
}
|
|
590
592
|
errors.push({
|
|
591
|
-
message: "<Canvas> children must be <Storyboard>, <SvelteStoryboard>, <RouteStoryboard>, <HtmlStoryboard>, or <LegacyStoryboardV1> declarations",
|
|
593
|
+
message: "<Canvas> children must be <Storyboard>, <SvelteStoryboard>, <AstroStoryboard>, <RouteStoryboard>, <HtmlStoryboard>, or <LegacyStoryboardV1> declarations",
|
|
592
594
|
span: toSpan(child),
|
|
593
595
|
kind: "structural"
|
|
594
596
|
});
|
|
@@ -960,7 +962,7 @@ function resolveMisimportedNamespaceSdkComponent(nameNode, imports, misimportedS
|
|
|
960
962
|
) ?? null;
|
|
961
963
|
}
|
|
962
964
|
function isStoryboardSdkComponent(component) {
|
|
963
|
-
return component === "Storyboard" || component === "SvelteStoryboard" || component === "LegacyStoryboardV1" || component === "RouteStoryboard" || component === "HtmlStoryboard";
|
|
965
|
+
return component === "Storyboard" || component === "SvelteStoryboard" || component === "AstroStoryboard" || component === "LegacyStoryboardV1" || component === "RouteStoryboard" || component === "HtmlStoryboard";
|
|
964
966
|
}
|
|
965
967
|
function readImportedName(specifier) {
|
|
966
968
|
if (specifier.type === "ImportDefaultSpecifier") return "default";
|
|
@@ -973,7 +975,7 @@ function readImportKind(specifier) {
|
|
|
973
975
|
return "named";
|
|
974
976
|
}
|
|
975
977
|
function isSdkImportSource(source) {
|
|
976
|
-
return SDK_IMPORT_SOURCES.has(source) || source.endsWith("/tempo-sdk/canvas") || source.endsWith("/tempo-sdk/canvas/svelte");
|
|
978
|
+
return SDK_IMPORT_SOURCES.has(source) || source.endsWith("/tempo-sdk/canvas") || source.endsWith("/tempo-sdk/canvas/svelte") || source.endsWith("/tempo-sdk/canvas/astro");
|
|
977
979
|
}
|
|
978
980
|
function isWrongTempoSdkCanvasImportSource(source) {
|
|
979
981
|
return (source === "tempo-sdk" || source.startsWith("tempo-sdk/")) && !isSdkImportSource(source);
|
|
@@ -1014,7 +1016,10 @@ function walk(node, visitor, seen = /* @__PURE__ */ new Set()) {
|
|
|
1014
1016
|
// canvas-component-reference.ts
|
|
1015
1017
|
var COMPONENT_REFERENCE_ATTRIBUTE = "data-tempo-component-reference";
|
|
1016
1018
|
function moduleIdentity(file, specifier, resolved) {
|
|
1017
|
-
const
|
|
1019
|
+
const resolvedId = resolved?.get(specifier);
|
|
1020
|
+
const bundled = resolvedId?.startsWith("\0tempo:astro-component:") ? decodeURIComponent(
|
|
1021
|
+
resolvedId.slice("\0tempo:astro-component:".length, -3)
|
|
1022
|
+
) : resolvedId;
|
|
1018
1023
|
const target = bundled === void 0 ? specifier : bundled.replace(/\bt=\d{13}&?\b/, "").replace(/[?&]$/, "");
|
|
1019
1024
|
if (target.startsWith("\0")) return target;
|
|
1020
1025
|
const suffixAt = target.search(/[?#]/);
|
|
@@ -1022,7 +1027,7 @@ function moduleIdentity(file, specifier, resolved) {
|
|
|
1022
1027
|
/\\/g,
|
|
1023
1028
|
"/"
|
|
1024
1029
|
);
|
|
1025
|
-
const suffix = suffixAt < 0 ? "" : target.slice(suffixAt);
|
|
1030
|
+
const suffix = suffixAt < 0 || target.endsWith(".astro?tempo-component") ? "" : target.slice(suffixAt);
|
|
1026
1031
|
if (bundled === void 0 && path.startsWith("."))
|
|
1027
1032
|
path = (0, import_node_path.resolve)((0, import_node_path.dirname)(file), path);
|
|
1028
1033
|
if (!(0, import_node_path.isAbsolute)(path) && !/^[A-Za-z]:\//.test(path)) return target;
|