tempo-sdk 0.0.92 → 0.0.93
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 +3 -3
- package/dist/astro/asset-preview-client.js +3 -3
- package/dist/astro.js +2 -2
- package/dist/canvas/astro.js +3 -3
- package/dist/canvas/index.js +157 -7
- package/dist/canvas/index.js.map +1 -1
- package/dist/canvas/interact-projection.js +4 -4
- package/dist/canvas/svelte.js +3 -3
- package/dist/canvas/vue.js +3 -3
- package/dist/{chunk-DNERBE7A.js → chunk-3L4RRKC3.js} +17 -11
- package/dist/chunk-3L4RRKC3.js.map +1 -0
- package/dist/{chunk-I5MJ342V.js → chunk-CVUNZBRV.js} +3 -3
- package/dist/{chunk-NXPP3CSM.js → chunk-FZVJVL3T.js} +2 -2
- package/dist/{chunk-RZ3TG6MV.js → chunk-GHNHPVEI.js} +2 -2
- package/dist/{chunk-RZ3TG6MV.js.map → chunk-GHNHPVEI.js.map} +1 -1
- package/dist/{chunk-3XEEVCM3.js → chunk-HNNZM2XM.js} +127 -66
- package/dist/chunk-HNNZM2XM.js.map +1 -0
- package/dist/{chunk-5M45Z7K6.js → chunk-LEBVQBDH.js} +83 -51
- package/dist/chunk-LEBVQBDH.js.map +1 -0
- package/dist/{chunk-KQSOE4KZ.js → chunk-M7OOVEAR.js} +2 -2
- package/dist/{chunk-TWW2DL7E.js → chunk-N5MWY4H6.js} +2 -2
- package/dist/{chunk-TWW2DL7E.js.map → chunk-N5MWY4H6.js.map} +1 -1
- package/dist/{chunk-XN2K7GED.js → chunk-XB6GU4CE.js} +32 -8
- package/dist/{chunk-XN2K7GED.js.map → chunk-XB6GU4CE.js.map} +1 -1
- package/dist/{chunk-FENUT2N2.js → chunk-Y7EHQREO.js} +2 -2
- package/dist/{chunk-FENUT2N2.js.map → chunk-Y7EHQREO.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/nextjs/plugin.cjs +1 -1
- package/dist/nextjs/plugin.cjs.map +1 -1
- package/dist/nextjs/plugin.js +1 -1
- package/dist/nextjs-loader.cjs +1 -1
- package/dist/nextjs-loader.cjs.map +1 -1
- package/dist/nextjs.cjs +1 -1
- package/dist/nextjs.cjs.map +1 -1
- package/dist/nextjs.js +1 -1
- package/dist/nuxt/runtime/identity.js +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/vue.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3XEEVCM3.js.map +0 -1
- package/dist/chunk-5M45Z7K6.js.map +0 -1
- package/dist/chunk-DNERBE7A.js.map +0 -1
- /package/dist/{chunk-I5MJ342V.js.map → chunk-CVUNZBRV.js.map} +0 -0
- /package/dist/{chunk-NXPP3CSM.js.map → chunk-FZVJVL3T.js.map} +0 -0
- /package/dist/{chunk-KQSOE4KZ.js.map → chunk-M7OOVEAR.js.map} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
captureHead
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XB6GU4CE.js";
|
|
4
4
|
import {
|
|
5
5
|
capture
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LEBVQBDH.js";
|
|
7
7
|
|
|
8
8
|
// assets/preview-snapshot.ts
|
|
9
9
|
function captureAssetPreview(root) {
|
|
@@ -35,4 +35,4 @@ function captureAssetPreview(root) {
|
|
|
35
35
|
export {
|
|
36
36
|
captureAssetPreview
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
38
|
+
//# sourceMappingURL=chunk-CVUNZBRV.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
PROJECTION_ROOT_ATTRIBUTE,
|
|
4
4
|
PROJECTION_SCOPE_ROLE,
|
|
5
5
|
PROJECTION_UNAVAILABLE_ATTRIBUTE
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3L4RRKC3.js";
|
|
7
7
|
|
|
8
8
|
// canvas/ids.ts
|
|
9
9
|
function normalizeId(value, label) {
|
|
@@ -1312,4 +1312,4 @@ export {
|
|
|
1312
1312
|
HtmlStoryboard,
|
|
1313
1313
|
StoryboardSlot
|
|
1314
1314
|
};
|
|
1315
|
-
//# sourceMappingURL=chunk-
|
|
1315
|
+
//# sourceMappingURL=chunk-FZVJVL3T.js.map
|
|
@@ -5,7 +5,7 @@ import { resolve } from "path";
|
|
|
5
5
|
// package.json
|
|
6
6
|
var package_default = {
|
|
7
7
|
name: "tempo-sdk",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.93",
|
|
9
9
|
publishConfig: {
|
|
10
10
|
tag: "sdk-v2-latest"
|
|
11
11
|
},
|
|
@@ -282,4 +282,4 @@ export {
|
|
|
282
282
|
readTempoWorkspaceNonce,
|
|
283
283
|
createTempoHostIdentity
|
|
284
284
|
};
|
|
285
|
-
//# sourceMappingURL=chunk-
|
|
285
|
+
//# sourceMappingURL=chunk-GHNHPVEI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../host-identity.ts","../package.json","../release-channel.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\n\nimport { TEMPO_SDK_CHANNEL } from \"./release-channel\";\n\nimport sdkPackage from \"./package.json\" with { type: \"json\" };\n\nexport const TEMPO_HOST_IDENTITY_ENDPOINT = \"/__tempo/identity\";\nexport const TEMPO_HOST_IDENTITY_CAPABILITY_HEADER = \"x-tempo-host-identity\";\nexport const TEMPO_HOST_IDENTITY_CONTRACT_VERSION = 1;\nexport const TEMPO_WORKSPACE_NONCE_ENV = \"TEMPO_WORKSPACE_NONCE\";\nexport const TEMPO_WORKSPACE_NONCE_META_NAME = \"tempo-workspace-nonce\";\n\nconst WORKSPACE_NONCE_RELATIVE_PATH = \".tempo/workspace-nonce\";\nconst MAX_WORKSPACE_NONCE_LENGTH = 128;\n\nexport type TempoHostFramework = \"vite\" | \"nextjs\" | \"nuxt\" | \"astro\";\n\n/**\n * The name of `tempoVuePlugin()`'s annotating plugin. A Vite server that runs\n * it reports the `vueSourceAnnotation` capability, which is what proves an\n * app's Vue templates are stamped: `pluginActive` only proves\n * `tempoVitePlugin()`, and a Vue app with that alone serves route documents\n * whose layers carry no `.vue` source.\n */\nexport const TEMPO_VUE_ANNOTATION_PLUGIN_NAME = \"tempo-vue-source-annotation\";\n\n/** Optional features a host's served identity vouches for. */\nexport interface TempoHostIdentityCapabilities {\n /** 1 when the server renders Astro components for the canvas. */\n astroComponents?: number;\n /** 1 when `tempoVuePlugin()` annotates this Vite server's `.vue` files. */\n vueSourceAnnotation?: number;\n}\n\nexport interface TempoHostIdentity<\n Framework extends TempoHostFramework = TempoHostFramework,\n> {\n tempoHost: true;\n contractVersion: number;\n workspaceNonce: string;\n sdkVersion: string;\n sdkChannel: string;\n pluginActive: boolean;\n framework: Framework;\n capabilities?: TempoHostIdentityCapabilities;\n}\n\nfunction normalizeWorkspaceNonce(value: string | undefined): string {\n const nonce = value?.trim() ?? \"\";\n return nonce.length > 0 && nonce.length <= MAX_WORKSPACE_NONCE_LENGTH\n ? nonce\n : \"\";\n}\n\nexport function readTempoWorkspaceNonce(root = process.cwd()): string {\n const fromEnvironment = normalizeWorkspaceNonce(\n process.env[TEMPO_WORKSPACE_NONCE_ENV],\n );\n if (fromEnvironment) return fromEnvironment;\n try {\n return normalizeWorkspaceNonce(\n readFileSync(resolve(root, WORKSPACE_NONCE_RELATIVE_PATH), \"utf-8\"),\n );\n } catch {\n return \"\";\n }\n}\n\nexport function createTempoHostIdentity<Framework extends TempoHostFramework>(\n framework: Framework,\n options: {\n root?: string;\n pluginActive?: boolean;\n capabilities?: TempoHostIdentityCapabilities;\n } = {},\n): TempoHostIdentity<Framework> {\n return {\n tempoHost: true,\n contractVersion: TEMPO_HOST_IDENTITY_CONTRACT_VERSION,\n workspaceNonce: readTempoWorkspaceNonce(options.root),\n sdkVersion: sdkPackage.version,\n sdkChannel: TEMPO_SDK_CHANNEL,\n pluginActive: options.pluginActive ?? Boolean(process.env.TEMPO),\n framework,\n ...(options.capabilities ? { capabilities: options.capabilities } : {}),\n };\n}\n","{\n \"name\": \"tempo-sdk\",\n \"version\": \"0.0.92\",\n\n \"publishConfig\": {\n \"tag\": \"sdk-v2-latest\"\n },\n \"type\": \"module\",\n \"description\": \"Tempo SDK \\u2014 Vite, Next.js, Nuxt, Expo, Svelte, Vue and Astro canvas integration, source annotations and storyboard types\",\n\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/TempoLabsAI/tempo-monorepo.git\",\n \"directory\": \"tempo-modules/tempo-sdk\"\n },\n \"exports\": {\n \"./astro/controls\": {\n \"types\": \"./dist/astro/controls.d.ts\",\n \"import\": \"./dist/astro/controls.js\",\n \"default\": \"./dist/astro/controls.js\"\n },\n \"./astro\": {\n \"types\": \"./dist/astro.d.ts\",\n \"import\": \"./dist/astro.js\"\n },\n \"./astro/client\": {\n \"types\": \"./astro/client.d.ts\"\n },\n \"./canvas/astro\": {\n \"types\": \"./dist/canvas/astro.d.ts\",\n \"import\": \"./dist/canvas/astro.js\"\n },\n \"./canvas/astro-contract\": {\n \"types\": \"./dist/canvas/astro-contract.d.ts\",\n \"import\": \"./dist/canvas/astro-contract.js\"\n },\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"./canvas\": {\n \"types\": \"./dist/canvas/index.d.ts\",\n \"import\": \"./dist/canvas/index.js\"\n },\n \"./canvas/svelte\": {\n \"types\": \"./dist/canvas/svelte.d.ts\",\n \"import\": \"./dist/canvas/svelte.js\"\n },\n \"./canvas/vue\": {\n \"types\": \"./dist/canvas/vue.d.ts\",\n \"import\": \"./dist/canvas/vue.js\"\n },\n \"./canvas/interact-projection\": {\n \"types\": \"./dist/canvas/interact-projection.d.ts\",\n \"import\": \"./dist/canvas/interact-projection.js\"\n },\n \"./canvas/parser\": {\n \"types\": \"./dist/canvas/parser.d.ts\",\n \"import\": \"./dist/canvas/parser.js\"\n },\n \"./canvas/editor\": {\n \"types\": \"./dist/canvas/editor.d.ts\",\n \"import\": \"./dist/canvas/editor.js\"\n },\n \"./assets\": {\n \"types\": \"./dist/assets/index.d.ts\",\n \"import\": \"./dist/assets/index.js\"\n },\n \"./assets/parser\": {\n \"types\": \"./dist/assets/parser.d.ts\",\n \"import\": \"./dist/assets/parser.js\"\n },\n \"./assets/editor\": {\n \"types\": \"./dist/assets/editor.d.ts\",\n \"import\": \"./dist/assets/editor.js\"\n },\n \"./nextjs\": {\n \"types\": \"./dist/nextjs.d.ts\",\n \"import\": \"./dist/nextjs.js\",\n \"require\": \"./dist/nextjs.cjs\"\n },\n \"./nextjs/plugin\": {\n \"types\": \"./dist/nextjs/plugin.d.ts\",\n \"import\": \"./dist/nextjs/plugin.js\"\n },\n \"./nuxt\": {\n \"types\": \"./dist/nuxt.d.ts\",\n \"import\": \"./dist/nuxt.js\"\n },\n \"./expo\": {\n \"types\": \"./dist/expo-babel-plugin.d.ts\",\n \"import\": \"./dist/expo-babel-plugin.js\",\n \"require\": \"./dist/expo-babel-plugin.cjs\"\n },\n \"./expo/plugin\": {\n \"types\": \"./dist/expo/plugin.d.ts\",\n \"import\": \"./dist/expo/plugin.js\",\n \"require\": \"./dist/expo/plugin.cjs\"\n },\n \"./svelte\": {\n \"types\": \"./dist/svelte.d.ts\",\n \"import\": \"./dist/svelte.js\"\n },\n \"./vue\": {\n \"types\": \"./dist/vue.d.ts\",\n \"import\": \"./dist/vue.js\"\n },\n \"./astro/asset-preview-client\": {\n \"types\": \"./dist/astro/asset-preview-client.d.ts\",\n \"import\": \"./dist/astro/asset-preview-client.js\"\n },\n \"./flutter-preview-path\": {\n \"types\": \"./dist/flutter-preview-path.d.ts\",\n \"import\": \"./dist/flutter-preview-path.js\"\n },\n \"./canvas/flutter-preview\": {\n \"types\": \"./dist/canvas/flutter-preview.d.ts\",\n \"import\": \"./dist/canvas/flutter-preview.js\"\n }\n },\n \"files\": [\n \"dist\",\n \"astro/client.d.ts\"\n ],\n \"scripts\": {\n \"clean\": \"rm -rf dist\",\n \"build\": \"pnpm run clean && tsup\",\n \"build:if-missing\": \"test -f dist/index.js || pnpm run build\",\n \"prepare\": \"pnpm run build\",\n \"prepublishOnly\": \"pnpm build\",\n \"demo\": \"TEMPO=true pnpm --filter @tempo-modules/vite-annotate-plugin-demo dev\",\n \"demo:nextjs\": \"TEMPO=true pnpm --filter @tempo-modules/tempo-sdk-nextjs-demo dev\",\n \"demo:nuxt\": \"pnpm --filter @tempo-modules/tempo-sdk-nuxt-demo dev\",\n \"test\": \"vitest run\",\n \"test:browser\": \"vitest run canvas-dependency-scan-browser.test.ts pruned-module-deletion-browser.test.ts asset-live-preview-browser.test.ts asset-popover-lifecycle-browser.test.ts component-controls-browser.test.ts canvas-controls-browser.test.ts canvas-capture-determinism-browser.test.ts flutter-storyboard-browser.test.ts canvas-host-vite-e2e.test.ts canvas-host-packed-sdk-e2e.test.ts error-tracking-e2e.test.ts astro-integration.test.ts astro-storyboard-routing.test.ts astro-react-integration.test.ts astro-descriptor-browser.test.ts astro-packed.test.ts\",\n \"test:watch\": \"vitest\",\n \"test:nextjs:unit\": \"vitest run nextjs-loader.test.ts nextjs-wrapper.test.ts nextjs-fixtures.test.ts nextjs-published.test.ts\",\n \"test:nextjs:integration\": \"vitest run nextjs-e2e-correctness.test.ts\",\n \"test:nextjs:production\": \"vitest run nextjs-production.test.ts\",\n \"test:nextjs\": \"vitest run nextjs-loader.test.ts nextjs-wrapper.test.ts nextjs-fixtures.test.ts nextjs-published.test.ts nextjs-e2e-correctness.test.ts nextjs-production.test.ts\"\n },\n \"dependencies\": {\n \"@rollup/pluginutils\": \"^5.1.0\",\n \"oxc-parser\": \"^0.110.0\"\n },\n \"optionalDependencies\": {\n \"@astrojs/compiler-rs\": \"0.5.1\"\n },\n \"peerDependencies\": {\n \"astro\": \"^7.0.0\",\n \"@babel/core\": \"^7.0.0\",\n \"h3\": \"^1.12.0\",\n \"next\": \"^13 || ^14 || ^15 || ^16\",\n \"nuxt\": \"^3.18.0 || ^4.0.0\",\n \"react\": \"^18 || ^19\",\n \"svelte\": \"^5.0.0\",\n \"vite\": \"^5 || ^6 || ^7 || ^8\",\n \"vue\": \"^3.3.0\"\n },\n \"peerDependenciesMeta\": {\n \"astro\": {\n \"optional\": true\n },\n \"react\": {\n \"optional\": true\n },\n \"@babel/core\": {\n \"optional\": true\n },\n \"h3\": {\n \"optional\": true\n },\n \"next\": {\n \"optional\": true\n },\n \"nuxt\": {\n \"optional\": true\n },\n \"svelte\": {\n \"optional\": true\n },\n \"vite\": {\n \"optional\": true\n },\n \"vue\": {\n \"optional\": true\n }\n },\n \"devDependencies\": {\n \"@astrojs/react\": \"7.0.1\",\n \"@babel/core\": \"^7.29.0\",\n \"@babel/types\": \"^7.29.0\",\n \"@modules/annotation\": \"workspace:*\",\n \"@modules/astro-editor\": \"workspace:*\",\n \"@modules/file-parser\": \"workspace:*\",\n \"@modules/frame-pool\": \"workspace:*\",\n \"@modules/iframe-projection\": \"workspace:*\",\n \"@modules/svelte-editor\": \"workspace:*\",\n \"@modules/vue-editor\": \"workspace:*\",\n \"@nuxt/kit\": \"^4.6.2\",\n \"@types/babel__core\": \"^7.20.5\",\n \"@types/node\": \"^25.0.8\",\n \"@types/react\": \"catalog:\",\n \"@types/react-dom\": \"catalog:\",\n \"@vitejs/plugin-react\": \"catalog:\",\n \"@vitejs/plugin-vue\": \"6.0.10\",\n \"astro\": \"7.3.8\",\n \"h3\": \"^1.15.11\",\n \"magic-string\": \"^0.30.21\",\n \"nuxt\": \"^4.6.2\",\n \"playwright\": \"^1.58.2\",\n \"react-dom\": \"catalog:\",\n \"react-dom18\": \"npm:react-dom@18.3.1\",\n \"react18\": \"npm:react@18.3.1\",\n \"svelte\": \"5.56.9\",\n \"tsup\": \"^8.5.1\",\n \"typescript\": \"catalog:\",\n \"vite\": \"catalog:\",\n \"vitest\": \"catalog:\",\n \"vue\": \"3.5.44\"\n }\n}\n","import sdkPackage from \"./package.json\" with { type: \"json\" };\n\n/** Shared by the app, generated projects and the SDK host identity. */\nexport const TEMPO_SDK_CHANNEL = sdkPackage.publishConfig.tag;\n\nexport function sdkChannelGeneration(channel: unknown): number | null {\n if (typeof channel !== \"string\") return null;\n const match = /^sdk-v([1-9]\\d*)-latest$/.exec(channel);\n return match ? Number(match[1]) : null;\n}\n\nif (sdkChannelGeneration(TEMPO_SDK_CHANNEL) === null) {\n throw new Error(\"tempo-sdk publishConfig.tag must be sdk-v<N>-latest\");\n}\n\n/** Preserve local development links; registry installs follow the app channel. */\nexport function managedTempoSdkSpec(spec: string): string {\n const generation = sdkChannelGeneration(spec);\n if (\n generation !== null &&\n generation > sdkChannelGeneration(TEMPO_SDK_CHANNEL)!\n ) {\n throw new Error(\n `This project requires tempo-sdk@${spec}. Update Tempo before opening it; this app supports ${TEMPO_SDK_CHANNEL}.`,\n );\n }\n if (/^(workspace:|file:|link:|portal:|git|https?:|ssh:|github:)/.test(spec))\n return spec;\n return TEMPO_SDK_CHANNEL;\n}\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,eAAe;;;ACDxB;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EAEX,eAAiB;AAAA,IACf,KAAO;AAAA,EACT;AAAA,EACA,MAAQ;AAAA,EACR,aAAe;AAAA,EAEf,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,IACP,WAAa;AAAA,EACf;AAAA,EACA,SAAW;AAAA,IACT,oBAAoB;AAAA,MAClB,OAAS;AAAA,MACT,QAAU;AAAA,MACV,SAAW;AAAA,IACb;AAAA,IACA,WAAW;AAAA,MACT,OAAS;AAAA,MACT,QAAU;AAAA,IACZ;AAAA,IACA,kBAAkB;AAAA,MAChB,OAAS;AAAA,IACX;AAAA,IACA,kBAAkB;AAAA,MAChB,OAAS;AAAA,MACT,QAAU;AAAA,IACZ;AAAA,IACA,2BAA2B;AAAA,MACzB,OAAS;AAAA,MACT,QAAU;AAAA,IACZ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ACpE,QAAM,kBAAkB;AAAA,IACtB,QAAQ,IAAI,yBAAyB;AAAA,EACvC;AACA,MAAI,gBAAiB,QAAO;AAC5B,MAAI;AACF,WAAO;AAAA,MACL,aAAa,QAAQ,MAAM,6BAA6B,GAAG,OAAO;AAAA,IACpE;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,wBACd,WACA,UAII,CAAC,GACyB;AAC9B,SAAO;AAAA,IACL,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,gBAAgB,wBAAwB,QAAQ,IAAI;AAAA,IACpD,YAAY,gBAAW;AAAA,IACvB,YAAY;AAAA,IACZ,cAAc,QAAQ,gBAAgB,QAAQ,QAAQ,IAAI,KAAK;AAAA,IAC/D;AAAA,IACA,GAAI,QAAQ,eAAe,EAAE,cAAc,QAAQ,aAAa,IAAI,CAAC;AAAA,EACvE;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../host-identity.ts","../package.json","../release-channel.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\n\nimport { TEMPO_SDK_CHANNEL } from \"./release-channel\";\n\nimport sdkPackage from \"./package.json\" with { type: \"json\" };\n\nexport const TEMPO_HOST_IDENTITY_ENDPOINT = \"/__tempo/identity\";\nexport const TEMPO_HOST_IDENTITY_CAPABILITY_HEADER = \"x-tempo-host-identity\";\nexport const TEMPO_HOST_IDENTITY_CONTRACT_VERSION = 1;\nexport const TEMPO_WORKSPACE_NONCE_ENV = \"TEMPO_WORKSPACE_NONCE\";\nexport const TEMPO_WORKSPACE_NONCE_META_NAME = \"tempo-workspace-nonce\";\n\nconst WORKSPACE_NONCE_RELATIVE_PATH = \".tempo/workspace-nonce\";\nconst MAX_WORKSPACE_NONCE_LENGTH = 128;\n\nexport type TempoHostFramework = \"vite\" | \"nextjs\" | \"nuxt\" | \"astro\";\n\n/**\n * The name of `tempoVuePlugin()`'s annotating plugin. A Vite server that runs\n * it reports the `vueSourceAnnotation` capability, which is what proves an\n * app's Vue templates are stamped: `pluginActive` only proves\n * `tempoVitePlugin()`, and a Vue app with that alone serves route documents\n * whose layers carry no `.vue` source.\n */\nexport const TEMPO_VUE_ANNOTATION_PLUGIN_NAME = \"tempo-vue-source-annotation\";\n\n/** Optional features a host's served identity vouches for. */\nexport interface TempoHostIdentityCapabilities {\n /** 1 when the server renders Astro components for the canvas. */\n astroComponents?: number;\n /** 1 when `tempoVuePlugin()` annotates this Vite server's `.vue` files. */\n vueSourceAnnotation?: number;\n}\n\nexport interface TempoHostIdentity<\n Framework extends TempoHostFramework = TempoHostFramework,\n> {\n tempoHost: true;\n contractVersion: number;\n workspaceNonce: string;\n sdkVersion: string;\n sdkChannel: string;\n pluginActive: boolean;\n framework: Framework;\n capabilities?: TempoHostIdentityCapabilities;\n}\n\nfunction normalizeWorkspaceNonce(value: string | undefined): string {\n const nonce = value?.trim() ?? \"\";\n return nonce.length > 0 && nonce.length <= MAX_WORKSPACE_NONCE_LENGTH\n ? nonce\n : \"\";\n}\n\nexport function readTempoWorkspaceNonce(root = process.cwd()): string {\n const fromEnvironment = normalizeWorkspaceNonce(\n process.env[TEMPO_WORKSPACE_NONCE_ENV],\n );\n if (fromEnvironment) return fromEnvironment;\n try {\n return normalizeWorkspaceNonce(\n readFileSync(resolve(root, WORKSPACE_NONCE_RELATIVE_PATH), \"utf-8\"),\n );\n } catch {\n return \"\";\n }\n}\n\nexport function createTempoHostIdentity<Framework extends TempoHostFramework>(\n framework: Framework,\n options: {\n root?: string;\n pluginActive?: boolean;\n capabilities?: TempoHostIdentityCapabilities;\n } = {},\n): TempoHostIdentity<Framework> {\n return {\n tempoHost: true,\n contractVersion: TEMPO_HOST_IDENTITY_CONTRACT_VERSION,\n workspaceNonce: readTempoWorkspaceNonce(options.root),\n sdkVersion: sdkPackage.version,\n sdkChannel: TEMPO_SDK_CHANNEL,\n pluginActive: options.pluginActive ?? Boolean(process.env.TEMPO),\n framework,\n ...(options.capabilities ? { capabilities: options.capabilities } : {}),\n };\n}\n","{\n \"name\": \"tempo-sdk\",\n \"version\": \"0.0.93\",\n\n \"publishConfig\": {\n \"tag\": \"sdk-v2-latest\"\n },\n \"type\": \"module\",\n \"description\": \"Tempo SDK \\u2014 Vite, Next.js, Nuxt, Expo, Svelte, Vue and Astro canvas integration, source annotations and storyboard types\",\n\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/TempoLabsAI/tempo-monorepo.git\",\n \"directory\": \"tempo-modules/tempo-sdk\"\n },\n \"exports\": {\n \"./astro/controls\": {\n \"types\": \"./dist/astro/controls.d.ts\",\n \"import\": \"./dist/astro/controls.js\",\n \"default\": \"./dist/astro/controls.js\"\n },\n \"./astro\": {\n \"types\": \"./dist/astro.d.ts\",\n \"import\": \"./dist/astro.js\"\n },\n \"./astro/client\": {\n \"types\": \"./astro/client.d.ts\"\n },\n \"./canvas/astro\": {\n \"types\": \"./dist/canvas/astro.d.ts\",\n \"import\": \"./dist/canvas/astro.js\"\n },\n \"./canvas/astro-contract\": {\n \"types\": \"./dist/canvas/astro-contract.d.ts\",\n \"import\": \"./dist/canvas/astro-contract.js\"\n },\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"./canvas\": {\n \"types\": \"./dist/canvas/index.d.ts\",\n \"import\": \"./dist/canvas/index.js\"\n },\n \"./canvas/svelte\": {\n \"types\": \"./dist/canvas/svelte.d.ts\",\n \"import\": \"./dist/canvas/svelte.js\"\n },\n \"./canvas/vue\": {\n \"types\": \"./dist/canvas/vue.d.ts\",\n \"import\": \"./dist/canvas/vue.js\"\n },\n \"./canvas/interact-projection\": {\n \"types\": \"./dist/canvas/interact-projection.d.ts\",\n \"import\": \"./dist/canvas/interact-projection.js\"\n },\n \"./canvas/parser\": {\n \"types\": \"./dist/canvas/parser.d.ts\",\n \"import\": \"./dist/canvas/parser.js\"\n },\n \"./canvas/editor\": {\n \"types\": \"./dist/canvas/editor.d.ts\",\n \"import\": \"./dist/canvas/editor.js\"\n },\n \"./assets\": {\n \"types\": \"./dist/assets/index.d.ts\",\n \"import\": \"./dist/assets/index.js\"\n },\n \"./assets/parser\": {\n \"types\": \"./dist/assets/parser.d.ts\",\n \"import\": \"./dist/assets/parser.js\"\n },\n \"./assets/editor\": {\n \"types\": \"./dist/assets/editor.d.ts\",\n \"import\": \"./dist/assets/editor.js\"\n },\n \"./nextjs\": {\n \"types\": \"./dist/nextjs.d.ts\",\n \"import\": \"./dist/nextjs.js\",\n \"require\": \"./dist/nextjs.cjs\"\n },\n \"./nextjs/plugin\": {\n \"types\": \"./dist/nextjs/plugin.d.ts\",\n \"import\": \"./dist/nextjs/plugin.js\"\n },\n \"./nuxt\": {\n \"types\": \"./dist/nuxt.d.ts\",\n \"import\": \"./dist/nuxt.js\"\n },\n \"./expo\": {\n \"types\": \"./dist/expo-babel-plugin.d.ts\",\n \"import\": \"./dist/expo-babel-plugin.js\",\n \"require\": \"./dist/expo-babel-plugin.cjs\"\n },\n \"./expo/plugin\": {\n \"types\": \"./dist/expo/plugin.d.ts\",\n \"import\": \"./dist/expo/plugin.js\",\n \"require\": \"./dist/expo/plugin.cjs\"\n },\n \"./svelte\": {\n \"types\": \"./dist/svelte.d.ts\",\n \"import\": \"./dist/svelte.js\"\n },\n \"./vue\": {\n \"types\": \"./dist/vue.d.ts\",\n \"import\": \"./dist/vue.js\"\n },\n \"./astro/asset-preview-client\": {\n \"types\": \"./dist/astro/asset-preview-client.d.ts\",\n \"import\": \"./dist/astro/asset-preview-client.js\"\n },\n \"./flutter-preview-path\": {\n \"types\": \"./dist/flutter-preview-path.d.ts\",\n \"import\": \"./dist/flutter-preview-path.js\"\n },\n \"./canvas/flutter-preview\": {\n \"types\": \"./dist/canvas/flutter-preview.d.ts\",\n \"import\": \"./dist/canvas/flutter-preview.js\"\n }\n },\n \"files\": [\n \"dist\",\n \"astro/client.d.ts\"\n ],\n \"scripts\": {\n \"clean\": \"rm -rf dist\",\n \"build\": \"pnpm run clean && tsup\",\n \"build:if-missing\": \"test -f dist/index.js || pnpm run build\",\n \"prepare\": \"pnpm run build\",\n \"prepublishOnly\": \"pnpm build\",\n \"demo\": \"TEMPO=true pnpm --filter @tempo-modules/vite-annotate-plugin-demo dev\",\n \"demo:nextjs\": \"TEMPO=true pnpm --filter @tempo-modules/tempo-sdk-nextjs-demo dev\",\n \"demo:nuxt\": \"pnpm --filter @tempo-modules/tempo-sdk-nuxt-demo dev\",\n \"test\": \"vitest run\",\n \"test:browser\": \"vitest run canvas-dependency-scan-browser.test.ts pruned-module-deletion-browser.test.ts asset-live-preview-browser.test.ts asset-popover-lifecycle-browser.test.ts component-controls-browser.test.ts canvas-controls-browser.test.ts canvas-capture-determinism-browser.test.ts flutter-storyboard-browser.test.ts canvas-host-vite-e2e.test.ts canvas-host-packed-sdk-e2e.test.ts error-tracking-e2e.test.ts astro-integration.test.ts astro-storyboard-routing.test.ts astro-react-integration.test.ts astro-descriptor-browser.test.ts astro-packed.test.ts\",\n \"test:watch\": \"vitest\",\n \"test:nextjs:unit\": \"vitest run nextjs-loader.test.ts nextjs-wrapper.test.ts nextjs-fixtures.test.ts nextjs-published.test.ts\",\n \"test:nextjs:integration\": \"vitest run nextjs-e2e-correctness.test.ts\",\n \"test:nextjs:production\": \"vitest run nextjs-production.test.ts\",\n \"test:nextjs\": \"vitest run nextjs-loader.test.ts nextjs-wrapper.test.ts nextjs-fixtures.test.ts nextjs-published.test.ts nextjs-e2e-correctness.test.ts nextjs-production.test.ts\"\n },\n \"dependencies\": {\n \"@rollup/pluginutils\": \"^5.1.0\",\n \"oxc-parser\": \"^0.110.0\"\n },\n \"optionalDependencies\": {\n \"@astrojs/compiler-rs\": \"0.5.1\"\n },\n \"peerDependencies\": {\n \"astro\": \"^7.0.0\",\n \"@babel/core\": \"^7.0.0\",\n \"h3\": \"^1.12.0\",\n \"next\": \"^13 || ^14 || ^15 || ^16\",\n \"nuxt\": \"^3.18.0 || ^4.0.0\",\n \"react\": \"^18 || ^19\",\n \"svelte\": \"^5.0.0\",\n \"vite\": \"^5 || ^6 || ^7 || ^8\",\n \"vue\": \"^3.3.0\"\n },\n \"peerDependenciesMeta\": {\n \"astro\": {\n \"optional\": true\n },\n \"react\": {\n \"optional\": true\n },\n \"@babel/core\": {\n \"optional\": true\n },\n \"h3\": {\n \"optional\": true\n },\n \"next\": {\n \"optional\": true\n },\n \"nuxt\": {\n \"optional\": true\n },\n \"svelte\": {\n \"optional\": true\n },\n \"vite\": {\n \"optional\": true\n },\n \"vue\": {\n \"optional\": true\n }\n },\n \"devDependencies\": {\n \"@astrojs/react\": \"7.0.1\",\n \"@babel/core\": \"^7.29.0\",\n \"@babel/types\": \"^7.29.0\",\n \"@modules/annotation\": \"workspace:*\",\n \"@modules/astro-editor\": \"workspace:*\",\n \"@modules/file-parser\": \"workspace:*\",\n \"@modules/frame-pool\": \"workspace:*\",\n \"@modules/iframe-projection\": \"workspace:*\",\n \"@modules/svelte-editor\": \"workspace:*\",\n \"@modules/vue-editor\": \"workspace:*\",\n \"@nuxt/kit\": \"^4.6.2\",\n \"@types/babel__core\": \"^7.20.5\",\n \"@types/node\": \"^25.0.8\",\n \"@types/react\": \"catalog:\",\n \"@types/react-dom\": \"catalog:\",\n \"@vitejs/plugin-react\": \"catalog:\",\n \"@vitejs/plugin-vue\": \"6.0.10\",\n \"astro\": \"7.3.8\",\n \"h3\": \"^1.15.11\",\n \"magic-string\": \"^0.30.21\",\n \"nuxt\": \"^4.6.2\",\n \"playwright\": \"^1.58.2\",\n \"react-dom\": \"catalog:\",\n \"react-dom18\": \"npm:react-dom@18.3.1\",\n \"react18\": \"npm:react@18.3.1\",\n \"svelte\": \"5.56.9\",\n \"tsup\": \"^8.5.1\",\n \"typescript\": \"catalog:\",\n \"vite\": \"catalog:\",\n \"vitest\": \"catalog:\",\n \"vue\": \"3.5.44\"\n }\n}\n","import sdkPackage from \"./package.json\" with { type: \"json\" };\n\n/** Shared by the app, generated projects and the SDK host identity. */\nexport const TEMPO_SDK_CHANNEL = sdkPackage.publishConfig.tag;\n\nexport function sdkChannelGeneration(channel: unknown): number | null {\n if (typeof channel !== \"string\") return null;\n const match = /^sdk-v([1-9]\\d*)-latest$/.exec(channel);\n return match ? Number(match[1]) : null;\n}\n\nif (sdkChannelGeneration(TEMPO_SDK_CHANNEL) === null) {\n throw new Error(\"tempo-sdk publishConfig.tag must be sdk-v<N>-latest\");\n}\n\n/** Preserve local development links; registry installs follow the app channel. */\nexport function managedTempoSdkSpec(spec: string): string {\n const generation = sdkChannelGeneration(spec);\n if (\n generation !== null &&\n generation > sdkChannelGeneration(TEMPO_SDK_CHANNEL)!\n ) {\n throw new Error(\n `This project requires tempo-sdk@${spec}. Update Tempo before opening it; this app supports ${TEMPO_SDK_CHANNEL}.`,\n );\n }\n if (/^(workspace:|file:|link:|portal:|git|https?:|ssh:|github:)/.test(spec))\n return spec;\n return TEMPO_SDK_CHANNEL;\n}\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,eAAe;;;ACDxB;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EAEX,eAAiB;AAAA,IACf,KAAO;AAAA,EACT;AAAA,EACA,MAAQ;AAAA,EACR,aAAe;AAAA,EAEf,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,IACP,WAAa;AAAA,EACf;AAAA,EACA,SAAW;AAAA,IACT,oBAAoB;AAAA,MAClB,OAAS;AAAA,MACT,QAAU;AAAA,MACV,SAAW;AAAA,IACb;AAAA,IACA,WAAW;AAAA,MACT,OAAS;AAAA,MACT,QAAU;AAAA,IACZ;AAAA,IACA,kBAAkB;AAAA,MAChB,OAAS;AAAA,IACX;AAAA,IACA,kBAAkB;AAAA,MAChB,OAAS;AAAA,MACT,QAAU;AAAA,IACZ;AAAA,IACA,2BAA2B;AAAA,MACzB,OAAS;AAAA,MACT,QAAU;AAAA,IACZ;AAAA,IACA,KAAK;AAAA,MACH,OAAS;AAAA,MACT,QAAU;AAAA,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,EACvC;AACA,MAAI,gBAAiB,QAAO;AAC5B,MAAI;AACF,WAAO;AAAA,MACL,aAAa,QAAQ,MAAM,6BAA6B,GAAG,OAAO;AAAA,IACpE;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,wBACd,WACA,UAII,CAAC,GACyB;AAC9B,SAAO;AAAA,IACL,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,gBAAgB,wBAAwB,QAAQ,IAAI;AAAA,IACpD,YAAY,gBAAW;AAAA,IACvB,YAAY;AAAA,IACZ,cAAc,QAAQ,gBAAgB,QAAQ,QAAQ,IAAI,KAAK;AAAA,IAC/D;AAAA,IACA,GAAI,QAAQ,eAAe,EAAE,cAAc,QAAQ,aAAa,IAAI,CAAC;AAAA,EACvE;AACF;","names":[]}
|
|
@@ -3,15 +3,17 @@ import {
|
|
|
3
3
|
readTempoVueInvocationMarker
|
|
4
4
|
} from "./chunk-SGN7BDRE.js";
|
|
5
5
|
import {
|
|
6
|
+
absolutifyCssReferences,
|
|
6
7
|
beginHeadCapture,
|
|
7
8
|
beginHeadSheet,
|
|
8
9
|
captureHead,
|
|
10
|
+
extractStyleSourceEvidence,
|
|
9
11
|
finishHeadCapture,
|
|
10
12
|
getHeadTracker,
|
|
11
13
|
isDisabledStylesheet,
|
|
12
14
|
resolveUrls,
|
|
13
15
|
shouldIncludeLink
|
|
14
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XB6GU4CE.js";
|
|
15
17
|
import {
|
|
16
18
|
isTempoInteractFrameName
|
|
17
19
|
} from "./chunk-65B52AR7.js";
|
|
@@ -81,7 +83,7 @@ import {
|
|
|
81
83
|
watchDom,
|
|
82
84
|
watchPortal,
|
|
83
85
|
watchState
|
|
84
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-3L4RRKC3.js";
|
|
85
87
|
import {
|
|
86
88
|
captureAttributes,
|
|
87
89
|
captureWithSupplementalRoots,
|
|
@@ -95,7 +97,7 @@ import {
|
|
|
95
97
|
registerDocumentCaptureProducer,
|
|
96
98
|
removeScriptTags,
|
|
97
99
|
resetCaptureFlushCounters
|
|
98
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-LEBVQBDH.js";
|
|
99
101
|
|
|
100
102
|
// ../../modules/iframe-projection/combined/projection-repair-paths.ts
|
|
101
103
|
function isProjectionRepairPaths(value) {
|
|
@@ -505,8 +507,40 @@ function createWorkScheduler(options = {}) {
|
|
|
505
507
|
return scheduler;
|
|
506
508
|
}
|
|
507
509
|
|
|
510
|
+
// ../../modules/iframe-projection/html/head-text-process.ts
|
|
511
|
+
async function processHeadText(input) {
|
|
512
|
+
const stages = {};
|
|
513
|
+
const measure = (name, work) => {
|
|
514
|
+
if (!input.measure) return work();
|
|
515
|
+
const start2 = performance.now();
|
|
516
|
+
const value = work();
|
|
517
|
+
stages[name] = performance.now() - start2;
|
|
518
|
+
return value;
|
|
519
|
+
};
|
|
520
|
+
const metadata = input.metadata ?? measure(
|
|
521
|
+
"sourceMetadata",
|
|
522
|
+
() => extractStyleSourceEvidence(input.authored ?? "")
|
|
523
|
+
);
|
|
524
|
+
const rawCss = measure("joinRules", () => input.rules.join("\n"));
|
|
525
|
+
const css = measure(
|
|
526
|
+
"resolveUrls",
|
|
527
|
+
() => absolutifyCssReferences(rawCss, input.base)
|
|
528
|
+
);
|
|
529
|
+
const start = input.measure ? performance.now() : 0;
|
|
530
|
+
const digest = await crypto.subtle.digest(
|
|
531
|
+
"SHA-256",
|
|
532
|
+
new TextEncoder().encode(css)
|
|
533
|
+
);
|
|
534
|
+
const hash = Array.from(
|
|
535
|
+
new Uint8Array(digest),
|
|
536
|
+
(byte) => byte.toString(16).padStart(2, "0")
|
|
537
|
+
).join("");
|
|
538
|
+
if (input.measure) stages.resourceHash = performance.now() - start;
|
|
539
|
+
return { css, hash, metadata, stages };
|
|
540
|
+
}
|
|
541
|
+
|
|
508
542
|
// ../../modules/iframe-projection/html/head-worker-source.ts
|
|
509
|
-
var HEAD_WORKER_SOURCE = '(function() {\n "use strict";\n function extractStyleSourceEvidence(text) {\n const attributes = {};\n const clone = {\n setAttribute: (key, value) => {\n attributes[key] = value;\n }\n };\n const reference = [\n ...text.matchAll(/\\/\\*[#@]\\s*sourceMappingURL\\s*=\\s*(\\S+?)\\s*\\*\\//g)\n ].slice(-1)[0]?.[1];\n if (!reference || reference.length > 1024 * 1024) return attributes;\n const inline = /^data:application\\/json(?:;charset=[\\w-]+)?(;base64)?,(.*)$/is.exec(\n reference\n );\n if (!inline) {\n try {\n const url = new URL(reference);\n if (/^https?:$/.test(url.protocol))\n clone.setAttribute("data-projection-css-source-map-url", url.href);\n } catch {\n }\n return attributes;\n }\n function compact(raw, depth) {\n if (!raw || typeof raw !== "object" || depth > 16) return null;\n const map = raw;\n if (map.version !== 3) return null;\n const sources = Array.isArray(map.sources) && map.sources.length <= 4096 && map.sources.every((source) => typeof source === "string") ? map.sources : void 0;\n const sections = Array.isArray(map.sections) && map.sections.length <= 256 ? map.sections.flatMap((section) => {\n const nested = section && typeof section === "object" ? compact(section.map, depth + 1) : null;\n return nested ? [{ map: nested }] : [];\n }) : void 0;\n return {\n version: 3,\n ...typeof map.file === "string" ? { file: map.file } : {},\n ...typeof map.sourceRoot === "string" ? { sourceRoot: map.sourceRoot } : {},\n ...sources ? { sources } : {},\n ...sections ? { sections } : {}\n };\n }\n try {\n const json = inline[1] ? new TextDecoder().decode(\n Uint8Array.from(\n atob(inline[2]),\n (character) => character.charCodeAt(0)\n )\n ) : decodeURIComponent(inline[2]);\n const metadata = compact(JSON.parse(json), 0);\n if (!metadata) return attributes;\n const serialized = JSON.stringify(metadata);\n if (serialized.length <= 64 * 1024)\n clone.setAttribute("data-projection-css-source-map", serialized);\n } catch {\n }\n return attributes;\n }\n function absolutifyCssReferences(cssText, baseHref) {\n const resolve = (value) => {\n const trimmed = value.trim();\n if (!trimmed || trimmed.startsWith("#") || /^(?:data|blob|javascript):/i.test(trimmed)) {\n return /^javascript:/i.test(trimmed) ? "" : trimmed;\n }\n try {\n return new URL(trimmed, baseHref).href;\n } catch {\n return trimmed;\n }\n };\n return cssText.replace(\n /url\\(\\s*(["\']?)([^"\')]+)\\1\\s*\\)/gi,\n (_match, quote, value) => `url(${quote}${resolve(value)}${quote})`\n ).replace(\n /@import\\s+(["\'])([^"\']+)\\1/gi,\n (_match, quote, value) => `@import ${quote}${resolve(value)}${quote}`\n );\n }\n
|
|
543
|
+
var HEAD_WORKER_SOURCE = '(function() {\n "use strict";\n function extractStyleSourceEvidence(text) {\n const attributes = {};\n const clone = {\n setAttribute: (key, value) => {\n attributes[key] = value;\n }\n };\n const reference = [\n ...text.matchAll(/\\/\\*[#@]\\s*sourceMappingURL\\s*=\\s*(\\S+?)\\s*\\*\\//g)\n ].slice(-1)[0]?.[1];\n if (!reference || reference.length > 1024 * 1024) return attributes;\n const inline = /^data:application\\/json(?:;charset=[\\w-]+)?(;base64)?,(.*)$/is.exec(\n reference\n );\n if (!inline) {\n try {\n const url = new URL(reference);\n if (/^https?:$/.test(url.protocol))\n clone.setAttribute("data-projection-css-source-map-url", url.href);\n } catch {\n }\n return attributes;\n }\n function compact(raw, depth) {\n if (!raw || typeof raw !== "object" || depth > 16) return null;\n const map = raw;\n if (map.version !== 3) return null;\n const sources = Array.isArray(map.sources) && map.sources.length <= 4096 && map.sources.every((source) => typeof source === "string") ? map.sources : void 0;\n const sections = Array.isArray(map.sections) && map.sections.length <= 256 ? map.sections.flatMap((section) => {\n const nested = section && typeof section === "object" ? compact(section.map, depth + 1) : null;\n return nested ? [{ map: nested }] : [];\n }) : void 0;\n return {\n version: 3,\n ...typeof map.file === "string" ? { file: map.file } : {},\n ...typeof map.sourceRoot === "string" ? { sourceRoot: map.sourceRoot } : {},\n ...sources ? { sources } : {},\n ...sections ? { sections } : {}\n };\n }\n try {\n const json = inline[1] ? new TextDecoder().decode(\n Uint8Array.from(\n atob(inline[2]),\n (character) => character.charCodeAt(0)\n )\n ) : decodeURIComponent(inline[2]);\n const metadata = compact(JSON.parse(json), 0);\n if (!metadata) return attributes;\n const serialized = JSON.stringify(metadata);\n if (serialized.length <= 64 * 1024)\n clone.setAttribute("data-projection-css-source-map", serialized);\n } catch {\n }\n return attributes;\n }\n function absolutifyCssReferences(cssText, baseHref) {\n const resolve = (value) => {\n const trimmed = value.trim();\n if (!trimmed || trimmed.startsWith("#") || /^(?:data|blob|javascript):/i.test(trimmed)) {\n return /^javascript:/i.test(trimmed) ? "" : trimmed;\n }\n try {\n return new URL(trimmed, baseHref).href;\n } catch {\n return trimmed;\n }\n };\n return cssText.replace(\n /url\\(\\s*(["\']?)([^"\')]+)\\1\\s*\\)/gi,\n (_match, quote, value) => `url(${quote}${resolve(value)}${quote})`\n ).replace(\n /@import\\s+(["\'])([^"\']+)\\1/gi,\n (_match, quote, value) => `@import ${quote}${resolve(value)}${quote}`\n );\n }\n async function processHeadText(input) {\n const stages = {};\n const measure = (name, work) => {\n if (!input.measure) return work();\n const start2 = performance.now();\n const value = work();\n stages[name] = performance.now() - start2;\n return value;\n };\n const metadata = input.metadata ?? measure(\n "sourceMetadata",\n () => extractStyleSourceEvidence(input.authored ?? "")\n );\n const rawCss = measure("joinRules", () => input.rules.join("\\n"));\n const css = measure(\n "resolveUrls",\n () => absolutifyCssReferences(rawCss, input.base)\n );\n const start = input.measure ? performance.now() : 0;\n const digest = await crypto.subtle.digest(\n "SHA-256",\n new TextEncoder().encode(css)\n );\n const hash = Array.from(\n new Uint8Array(digest),\n (byte) => byte.toString(16).padStart(2, "0")\n ).join("");\n if (input.measure) stages.resourceHash = performance.now() - start;\n return { css, hash, metadata, stages };\n }\n const scope = globalThis;\n scope.onmessage = async ({ data }) => {\n try {\n scope.postMessage({ id: data.id, result: await processHeadText(data) });\n } catch (error) {\n scope.postMessage({ id: data.id, error: String(error) });\n }\n };\n})();\n';
|
|
510
544
|
|
|
511
545
|
// ../../modules/iframe-projection/html/head-worker.ts
|
|
512
546
|
var WORKER_TIMEOUT_MS = 3e4;
|
|
@@ -515,6 +549,8 @@ function createHeadWorker() {
|
|
|
515
549
|
let url;
|
|
516
550
|
let sequence = 0;
|
|
517
551
|
const pending = /* @__PURE__ */ new Map();
|
|
552
|
+
let refused = false;
|
|
553
|
+
const runInline = (input) => processHeadText(input);
|
|
518
554
|
const dispose = (error = new Error("Head worker stopped")) => {
|
|
519
555
|
if (worker) {
|
|
520
556
|
worker.onmessage = null;
|
|
@@ -531,17 +567,29 @@ function createHeadWorker() {
|
|
|
531
567
|
}
|
|
532
568
|
pending.clear();
|
|
533
569
|
};
|
|
570
|
+
const fallBack = () => {
|
|
571
|
+
refused = true;
|
|
572
|
+
const owed = [...pending.values()];
|
|
573
|
+
pending.clear();
|
|
574
|
+
for (const job of owed) {
|
|
575
|
+
clearTimeout(job.timer);
|
|
576
|
+
void runInline(job.input).then(job.resolve, job.reject);
|
|
577
|
+
}
|
|
578
|
+
dispose();
|
|
579
|
+
};
|
|
534
580
|
return {
|
|
535
581
|
process(input) {
|
|
582
|
+
if (refused) return runInline(input);
|
|
536
583
|
if (!worker) {
|
|
537
|
-
url = URL.createObjectURL(
|
|
538
|
-
new Blob([HEAD_WORKER_SOURCE], { type: "text/javascript" })
|
|
539
|
-
);
|
|
540
584
|
try {
|
|
585
|
+
url = URL.createObjectURL(
|
|
586
|
+
new Blob([HEAD_WORKER_SOURCE], { type: "text/javascript" })
|
|
587
|
+
);
|
|
541
588
|
worker = new Worker(url);
|
|
542
|
-
} catch
|
|
589
|
+
} catch {
|
|
590
|
+
refused = true;
|
|
543
591
|
dispose();
|
|
544
|
-
return
|
|
592
|
+
return runInline(input);
|
|
545
593
|
}
|
|
546
594
|
worker.onmessage = ({ data }) => {
|
|
547
595
|
const job = pending.get(data.id);
|
|
@@ -551,15 +599,18 @@ function createHeadWorker() {
|
|
|
551
599
|
if (data.error) job.reject(new Error(data.error));
|
|
552
600
|
else job.resolve(data.result);
|
|
553
601
|
};
|
|
554
|
-
worker.onerror = () =>
|
|
555
|
-
|
|
602
|
+
worker.onerror = (event) => {
|
|
603
|
+
event?.preventDefault?.();
|
|
604
|
+
fallBack();
|
|
605
|
+
};
|
|
606
|
+
worker.onmessageerror = fallBack;
|
|
556
607
|
}
|
|
557
608
|
return new Promise((resolve, reject) => {
|
|
558
609
|
const id = ++sequence;
|
|
559
610
|
const timer = setTimeout(() => {
|
|
560
611
|
dispose(new Error("Head worker timed out after 30000ms"));
|
|
561
612
|
}, WORKER_TIMEOUT_MS);
|
|
562
|
-
pending.set(id, { resolve, reject, timer });
|
|
613
|
+
pending.set(id, { resolve, reject, timer, input });
|
|
563
614
|
try {
|
|
564
615
|
worker.postMessage({ ...input, id });
|
|
565
616
|
} catch (error) {
|
|
@@ -1022,6 +1073,10 @@ function buildProjectionCapturePerf(input) {
|
|
|
1022
1073
|
|
|
1023
1074
|
// ../../modules/iframe-projection/html/root-coordinates.ts
|
|
1024
1075
|
var ROOT_COORDINATES_ATTRIBUTE = "data-projection-root-coordinates";
|
|
1076
|
+
function changesFixedCoordinates(css) {
|
|
1077
|
+
const active = (value) => Boolean(value && value !== "none");
|
|
1078
|
+
return active(css.transform) || active(css.translate) || active(css.rotate) || active(css.scale) || active(css.perspective) || active(css.filter) || active(css.backdropFilter) || /layout|paint|strict|content/.test(css.contain) || /transform|perspective|filter/.test(css.willChange);
|
|
1079
|
+
}
|
|
1025
1080
|
function captureRootCoordinates(root, portals = []) {
|
|
1026
1081
|
const doc = root.ownerDocument, view = doc.defaultView;
|
|
1027
1082
|
if (!view || root === doc.body || root === doc.documentElement) return;
|
|
@@ -1034,12 +1089,9 @@ function captureRootCoordinates(root, portals = []) {
|
|
|
1034
1089
|
}
|
|
1035
1090
|
const rect = root.getBoundingClientRect();
|
|
1036
1091
|
if (!rect.width || !rect.height) return;
|
|
1037
|
-
const containingBlock = [doc.body, doc.documentElement].find(
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
const active = (value) => Boolean(value && value !== "none");
|
|
1041
|
-
return active(css.transform) || active(css.translate) || active(css.rotate) || active(css.scale) || active(css.perspective) || active(css.filter) || active(css.backdropFilter) || /layout|paint|strict|content/.test(css.contain) || /transform|perspective|filter/.test(css.willChange);
|
|
1042
|
-
});
|
|
1092
|
+
const containingBlock = [doc.body, doc.documentElement].find(
|
|
1093
|
+
(element) => element && changesFixedCoordinates(view.getComputedStyle(element))
|
|
1094
|
+
);
|
|
1043
1095
|
let layout;
|
|
1044
1096
|
if (containingBlock) {
|
|
1045
1097
|
let element = root, left = 0, top = 0;
|
|
@@ -1107,14 +1159,17 @@ function captureProjectionFullSnapshot(options) {
|
|
|
1107
1159
|
hostDomIdCount
|
|
1108
1160
|
};
|
|
1109
1161
|
}
|
|
1110
|
-
function captureFullDom(root, portals, observedFiles
|
|
1162
|
+
function captureFullDom(root, portals, observedFiles, identity = {
|
|
1163
|
+
readId: (element) => ensureProjectionDomId(element),
|
|
1164
|
+
syncClone: syncProjectionDomIdsToClone
|
|
1165
|
+
}) {
|
|
1111
1166
|
for (const scope of [root, ...portals]) {
|
|
1112
1167
|
for (const element of projectedElements(scope)) {
|
|
1113
|
-
|
|
1168
|
+
identity.readId(element);
|
|
1114
1169
|
}
|
|
1115
1170
|
}
|
|
1116
1171
|
const clone = cloneProjectionDom(root);
|
|
1117
|
-
|
|
1172
|
+
identity.syncClone(root, clone);
|
|
1118
1173
|
for (const script of clone.querySelectorAll("script")) script.remove();
|
|
1119
1174
|
const hostDomIds = stripSourceAnnotations(clone, observedFiles, false);
|
|
1120
1175
|
const portalPatches = [];
|
|
@@ -1123,7 +1178,7 @@ function captureFullDom(root, portals, observedFiles) {
|
|
|
1123
1178
|
const portalId = portal.getAttribute(PORTAL_ID_ATTR);
|
|
1124
1179
|
if (!portalId) continue;
|
|
1125
1180
|
const portalClone = cloneProjectionDom(portal);
|
|
1126
|
-
|
|
1181
|
+
identity.syncClone(portal, portalClone);
|
|
1127
1182
|
for (const script of portalClone.querySelectorAll("script"))
|
|
1128
1183
|
script.remove();
|
|
1129
1184
|
for (const domId of stripSourceAnnotations(
|
|
@@ -1142,7 +1197,7 @@ function captureFullDom(root, portals, observedFiles) {
|
|
|
1142
1197
|
});
|
|
1143
1198
|
}
|
|
1144
1199
|
const body = root.ownerDocument.body;
|
|
1145
|
-
const rootDomId =
|
|
1200
|
+
const rootDomId = identity.readId(root);
|
|
1146
1201
|
const coordinates = captureRootCoordinates(root, portals);
|
|
1147
1202
|
const dom = {
|
|
1148
1203
|
...coordinates ? { coordinates } : {},
|
|
@@ -1154,18 +1209,18 @@ function captureFullDom(root, portals, observedFiles) {
|
|
|
1154
1209
|
},
|
|
1155
1210
|
...body ? { bodyAttributes: captureAttributes(body) } : {},
|
|
1156
1211
|
baseUrl: root.ownerDocument.baseURI,
|
|
1157
|
-
state: collectFullRuntimeState(root, portals),
|
|
1212
|
+
state: collectFullRuntimeState(root, portals, identity.readId),
|
|
1158
1213
|
portals: portalPatches
|
|
1159
1214
|
};
|
|
1160
1215
|
return { dom, hostDomIdCount: hostDomIds.size };
|
|
1161
1216
|
}
|
|
1162
|
-
function collectFullRuntimeState(root, portals) {
|
|
1217
|
+
function collectFullRuntimeState(root, portals, readId = (element) => ensureProjectionDomId(element)) {
|
|
1163
1218
|
const states = [];
|
|
1164
1219
|
for (const scope of [root, ...portals]) {
|
|
1165
1220
|
for (const element of projectedElements(scope)) {
|
|
1166
1221
|
if (element !== scope && element.hasAttribute(PROJECTION_ROOT_ATTRIBUTE))
|
|
1167
1222
|
continue;
|
|
1168
|
-
const targetId =
|
|
1223
|
+
const targetId = readId(element);
|
|
1169
1224
|
if (!targetId) continue;
|
|
1170
1225
|
if (element.scrollTop !== 0 || element.scrollLeft !== 0) {
|
|
1171
1226
|
states.push({
|
|
@@ -1175,25 +1230,27 @@ function collectFullRuntimeState(root, portals) {
|
|
|
1175
1230
|
scrollLeft: element.scrollLeft
|
|
1176
1231
|
});
|
|
1177
1232
|
}
|
|
1178
|
-
if (element
|
|
1179
|
-
|
|
1180
|
-
|
|
1233
|
+
if (element.namespaceURI !== "http://www.w3.org/1999/xhtml") continue;
|
|
1234
|
+
if (element.localName === "input") {
|
|
1235
|
+
const input = element;
|
|
1236
|
+
if (input.type === "checkbox" || input.type === "radio") {
|
|
1237
|
+
if (input.checked !== input.defaultChecked) {
|
|
1181
1238
|
states.push({
|
|
1182
1239
|
targetId,
|
|
1183
1240
|
kind: "checked",
|
|
1184
|
-
checked:
|
|
1241
|
+
checked: input.checked
|
|
1185
1242
|
});
|
|
1186
1243
|
}
|
|
1187
|
-
} else if (
|
|
1244
|
+
} else if (input.value !== input.defaultValue) {
|
|
1188
1245
|
states.push({
|
|
1189
1246
|
targetId,
|
|
1190
1247
|
kind: "value",
|
|
1191
|
-
value:
|
|
1192
|
-
selectionStart:
|
|
1193
|
-
selectionEnd:
|
|
1248
|
+
value: input.value,
|
|
1249
|
+
selectionStart: input.selectionStart,
|
|
1250
|
+
selectionEnd: input.selectionEnd
|
|
1194
1251
|
});
|
|
1195
1252
|
}
|
|
1196
|
-
} else if (element
|
|
1253
|
+
} else if (element.localName === "textarea" && element.value !== element.defaultValue) {
|
|
1197
1254
|
states.push({
|
|
1198
1255
|
targetId,
|
|
1199
1256
|
kind: "value",
|
|
@@ -1201,11 +1258,12 @@ function collectFullRuntimeState(root, portals) {
|
|
|
1201
1258
|
selectionStart: element.selectionStart,
|
|
1202
1259
|
selectionEnd: element.selectionEnd
|
|
1203
1260
|
});
|
|
1204
|
-
} else if (element
|
|
1261
|
+
} else if (element.localName === "select") {
|
|
1262
|
+
const select = element;
|
|
1205
1263
|
const selectedIndices = [];
|
|
1206
1264
|
let changed = false;
|
|
1207
|
-
for (let optionIndex = 0; optionIndex <
|
|
1208
|
-
const option =
|
|
1265
|
+
for (let optionIndex = 0; optionIndex < select.options.length; optionIndex += 1) {
|
|
1266
|
+
const option = select.options[optionIndex];
|
|
1209
1267
|
if (!option) continue;
|
|
1210
1268
|
if (option.selected) selectedIndices.push(optionIndex);
|
|
1211
1269
|
if (option.selected !== option.defaultSelected) changed = true;
|
|
@@ -4087,14 +4145,23 @@ function getPortalTracker() {
|
|
|
4087
4145
|
}
|
|
4088
4146
|
return instance;
|
|
4089
4147
|
}
|
|
4148
|
+
function fiberHostElement(fiber) {
|
|
4149
|
+
const state = fiber.stateNode;
|
|
4150
|
+
if (state instanceof Element) return state;
|
|
4151
|
+
if (fiber.tag === FiberTag.HostPortal && state && "containerInfo" in state && state.containerInfo instanceof Element)
|
|
4152
|
+
return state.containerInfo;
|
|
4153
|
+
return null;
|
|
4154
|
+
}
|
|
4090
4155
|
function isElementOwnedByRoot(candidate, root) {
|
|
4091
4156
|
const fiber = getFiberFromElement(candidate);
|
|
4092
4157
|
if (!fiber) return false;
|
|
4093
4158
|
let current = fiber.return;
|
|
4094
4159
|
while (current) {
|
|
4095
|
-
|
|
4160
|
+
const host = fiberHostElement(current);
|
|
4161
|
+
if (host && (host === root || root.contains(host) && !underForeignProjectionRoot(host, root))) {
|
|
4096
4162
|
return true;
|
|
4097
4163
|
}
|
|
4164
|
+
if (host?.hasAttribute(PROJECTION_ROOT_ATTRIBUTE)) break;
|
|
4098
4165
|
current = current.return;
|
|
4099
4166
|
}
|
|
4100
4167
|
return false;
|
|
@@ -4268,8 +4335,8 @@ var PortalTrackerImpl = class {
|
|
|
4268
4335
|
if (!fiber) return matched;
|
|
4269
4336
|
let current = fiber.return;
|
|
4270
4337
|
while (current && matched.size < watchers.length) {
|
|
4271
|
-
const host = current
|
|
4272
|
-
if (host
|
|
4338
|
+
const host = fiberHostElement(current);
|
|
4339
|
+
if (host) {
|
|
4273
4340
|
for (const watcher of watchers) {
|
|
4274
4341
|
if (!matched.has(watcher) && (host === watcher.element || watcher.element.contains(host) && !underForeignProjectionRoot(host, watcher.element))) {
|
|
4275
4342
|
matched.add(watcher);
|
|
@@ -6744,7 +6811,7 @@ var combinedWatchers = /* @__PURE__ */ new Map();
|
|
|
6744
6811
|
var nextCombinedWatcherId = 1;
|
|
6745
6812
|
var combinedSourceInitialized = false;
|
|
6746
6813
|
var combinedSourceCleanup = null;
|
|
6747
|
-
function installWhenDocumentBodyReady(
|
|
6814
|
+
function installWhenDocumentBodyReady(install) {
|
|
6748
6815
|
let cancelled = false;
|
|
6749
6816
|
let installedCleanup = null;
|
|
6750
6817
|
let animationFrameId = null;
|
|
@@ -6754,7 +6821,7 @@ function installWhenDocumentBodyReady(install2) {
|
|
|
6754
6821
|
animationFrameId = null;
|
|
6755
6822
|
if (cancelled) return;
|
|
6756
6823
|
if (document.body) {
|
|
6757
|
-
installedCleanup =
|
|
6824
|
+
installedCleanup = install();
|
|
6758
6825
|
return;
|
|
6759
6826
|
}
|
|
6760
6827
|
animationFrameId = requestAnimationFrame(init);
|
|
@@ -8180,37 +8247,31 @@ function serveCanvasFrameLanes(subscribePorts, options) {
|
|
|
8180
8247
|
};
|
|
8181
8248
|
}
|
|
8182
8249
|
|
|
8183
|
-
// ../../modules/iframe-projection/canvas-frames/preserve-drawing-buffer.
|
|
8184
|
-
|
|
8185
|
-
const WEBGL_CONTEXT_IDS = new Set(["webgl", "webgl2", "experimental-webgl"]);
|
|
8250
|
+
// ../../modules/iframe-projection/canvas-frames/preserve-drawing-buffer-runtime.js
|
|
8251
|
+
function installPreserveDrawingBufferRuntime(scope) {
|
|
8252
|
+
const WEBGL_CONTEXT_IDS = /* @__PURE__ */ new Set(["webgl", "webgl2", "experimental-webgl"]);
|
|
8186
8253
|
const prototype = scope.HTMLCanvasElement?.prototype;
|
|
8187
|
-
if (!prototype) return () => {
|
|
8254
|
+
if (!prototype) return () => {
|
|
8255
|
+
};
|
|
8188
8256
|
const original = prototype.getContext;
|
|
8189
|
-
if (typeof original !== "function") return () => {
|
|
8190
|
-
|
|
8191
|
-
const patched = function
|
|
8192
|
-
const forced = WEBGL_CONTEXT_IDS.has(contextId)
|
|
8193
|
-
? {
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
: {}),
|
|
8197
|
-
preserveDrawingBuffer: true,
|
|
8198
|
-
}
|
|
8199
|
-
: attributes;
|
|
8257
|
+
if (typeof original !== "function") return () => {
|
|
8258
|
+
};
|
|
8259
|
+
const patched = function(contextId, attributes, ...rest) {
|
|
8260
|
+
const forced = WEBGL_CONTEXT_IDS.has(contextId) ? {
|
|
8261
|
+
...typeof attributes === "object" && attributes !== null ? attributes : {},
|
|
8262
|
+
preserveDrawingBuffer: true
|
|
8263
|
+
} : attributes;
|
|
8200
8264
|
return original.call(this, contextId, forced, ...rest);
|
|
8201
8265
|
};
|
|
8202
8266
|
prototype.getContext = patched;
|
|
8203
|
-
|
|
8204
8267
|
return () => {
|
|
8205
8268
|
if (prototype.getContext === patched) prototype.getContext = original;
|
|
8206
8269
|
};
|
|
8207
|
-
}
|
|
8208
|
-
|
|
8270
|
+
}
|
|
8271
|
+
|
|
8272
|
+
// ../../modules/iframe-projection/canvas-frames/preserve-drawing-buffer.ts
|
|
8209
8273
|
function installPreserveDrawingBuffer(scope = globalThis) {
|
|
8210
|
-
|
|
8211
|
-
`return ${PRESERVE_DRAWING_BUFFER_SOURCE}`
|
|
8212
|
-
)());
|
|
8213
|
-
return install(scope);
|
|
8274
|
+
return installPreserveDrawingBufferRuntime(scope);
|
|
8214
8275
|
}
|
|
8215
8276
|
|
|
8216
8277
|
// canvas/interact-canvas-frames.ts
|
|
@@ -8266,4 +8327,4 @@ function installTempoInteractProjectionSource() {
|
|
|
8266
8327
|
export {
|
|
8267
8328
|
installTempoInteractProjectionSource
|
|
8268
8329
|
};
|
|
8269
|
-
//# sourceMappingURL=chunk-
|
|
8330
|
+
//# sourceMappingURL=chunk-HNNZM2XM.js.map
|