tempo-sdk 0.0.93 → 0.0.99

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 (48) hide show
  1. package/dist/assets/index.js +3 -3
  2. package/dist/astro/asset-preview-client.js +3 -3
  3. package/dist/astro.js +2 -2
  4. package/dist/canvas/astro.js +3 -3
  5. package/dist/canvas/index.js +36 -7
  6. package/dist/canvas/index.js.map +1 -1
  7. package/dist/canvas/interact-projection.js +4 -4
  8. package/dist/canvas/svelte.js +3 -3
  9. package/dist/canvas/vue.js +3 -3
  10. package/dist/{chunk-Y7EHQREO.js → chunk-27WT3XUG.js} +2 -2
  11. package/dist/{chunk-Y7EHQREO.js.map → chunk-27WT3XUG.js.map} +1 -1
  12. package/dist/{chunk-M7OOVEAR.js → chunk-6HYKKP5N.js} +3 -2
  13. package/dist/{chunk-M7OOVEAR.js.map → chunk-6HYKKP5N.js.map} +1 -1
  14. package/dist/{chunk-N5MWY4H6.js → chunk-CYDF4LYJ.js} +2 -2
  15. package/dist/{chunk-N5MWY4H6.js.map → chunk-CYDF4LYJ.js.map} +1 -1
  16. package/dist/{chunk-XB6GU4CE.js → chunk-I7VF4ZOV.js} +48 -37
  17. package/dist/chunk-I7VF4ZOV.js.map +1 -0
  18. package/dist/{chunk-HNNZM2XM.js → chunk-MIXQVPDH.js} +461 -185
  19. package/dist/chunk-MIXQVPDH.js.map +1 -0
  20. package/dist/{chunk-GHNHPVEI.js → chunk-SGTGDLOX.js} +2 -2
  21. package/dist/{chunk-GHNHPVEI.js.map → chunk-SGTGDLOX.js.map} +1 -1
  22. package/dist/chunk-T364NBR3.js +1440 -0
  23. package/dist/chunk-T364NBR3.js.map +1 -0
  24. package/dist/{chunk-FZVJVL3T.js → chunk-X5DJKVBT.js} +10 -17
  25. package/dist/chunk-X5DJKVBT.js.map +1 -0
  26. package/dist/{chunk-CVUNZBRV.js → chunk-ZT7HJ6YU.js} +3 -3
  27. package/dist/{chunk-3L4RRKC3.js → chunk-ZW26VZHX.js} +42 -3
  28. package/dist/chunk-ZW26VZHX.js.map +1 -0
  29. package/dist/index.js +2 -2
  30. package/dist/nextjs/plugin.cjs +1 -1
  31. package/dist/nextjs/plugin.cjs.map +1 -1
  32. package/dist/nextjs/plugin.js +1 -1
  33. package/dist/nextjs-loader.cjs +1 -1
  34. package/dist/nextjs-loader.cjs.map +1 -1
  35. package/dist/nextjs.cjs +1 -1
  36. package/dist/nextjs.cjs.map +1 -1
  37. package/dist/nextjs.js +1 -1
  38. package/dist/nuxt/runtime/identity.js +1 -1
  39. package/dist/nuxt.js +1 -1
  40. package/dist/vue.js +1 -1
  41. package/package.json +1 -1
  42. package/dist/chunk-3L4RRKC3.js.map +0 -1
  43. package/dist/chunk-FZVJVL3T.js.map +0 -1
  44. package/dist/chunk-HNNZM2XM.js.map +0 -1
  45. package/dist/chunk-LEBVQBDH.js +0 -643
  46. package/dist/chunk-LEBVQBDH.js.map +0 -1
  47. package/dist/chunk-XB6GU4CE.js.map +0 -1
  48. /package/dist/{chunk-CVUNZBRV.js.map → chunk-ZT7HJ6YU.js.map} +0 -0
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  captureAssetPreview
3
- } from "../chunk-CVUNZBRV.js";
3
+ } from "../chunk-ZT7HJ6YU.js";
4
4
  import {
5
5
  UNRESOLVED_VALUE
6
6
  } from "../chunk-DI2ZFAWL.js";
7
- import "../chunk-XB6GU4CE.js";
8
- import "../chunk-LEBVQBDH.js";
7
+ import "../chunk-I7VF4ZOV.js";
8
+ import "../chunk-T364NBR3.js";
9
9
 
10
10
  // assets/controls.ts
11
11
  function normalizeAssetControl(control) {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  captureAssetPreview
3
- } from "../chunk-CVUNZBRV.js";
4
- import "../chunk-XB6GU4CE.js";
5
- import "../chunk-LEBVQBDH.js";
3
+ } from "../chunk-ZT7HJ6YU.js";
4
+ import "../chunk-I7VF4ZOV.js";
5
+ import "../chunk-T364NBR3.js";
6
6
 
7
7
  // astro/asset-preview-client.ts
8
8
  var messageType = "tempo:asset-live-preview";
package/dist/astro.js CHANGED
@@ -8,14 +8,14 @@ import {
8
8
  } from "./chunk-JVVHU3A7.js";
9
9
  import {
10
10
  tempoVitePlugin
11
- } from "./chunk-M7OOVEAR.js";
11
+ } from "./chunk-6HYKKP5N.js";
12
12
  import "./chunk-PYAJHLXO.js";
13
13
  import "./chunk-DI2ZFAWL.js";
14
14
  import {
15
15
  TEMPO_HOST_IDENTITY_CAPABILITY_HEADER,
16
16
  TEMPO_HOST_IDENTITY_ENDPOINT,
17
17
  createTempoHostIdentity
18
- } from "./chunk-N5MWY4H6.js";
18
+ } from "./chunk-CYDF4LYJ.js";
19
19
  import "./chunk-BQPKOVI5.js";
20
20
  import "./chunk-FGWGY3G3.js";
21
21
  import {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  StoryboardSlot
3
- } from "../chunk-FZVJVL3T.js";
4
- import "../chunk-3L4RRKC3.js";
5
- import "../chunk-LEBVQBDH.js";
3
+ } from "../chunk-X5DJKVBT.js";
4
+ import "../chunk-ZW26VZHX.js";
5
+ import "../chunk-T364NBR3.js";
6
6
  import {
7
7
  astroStoryboardPath,
8
8
  isAstroComponent
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  installTempoInteractProjectionSource
3
- } from "../chunk-HNNZM2XM.js";
3
+ } from "../chunk-MIXQVPDH.js";
4
4
  import "../chunk-SGN7BDRE.js";
5
- import "../chunk-XB6GU4CE.js";
5
+ import "../chunk-I7VF4ZOV.js";
6
6
  import {
7
7
  VITE_ERROR_FEED_KEY
8
8
  } from "../chunk-WTXOWQ7N.js";
@@ -38,13 +38,14 @@ import {
38
38
  useStoryboardSize,
39
39
  v1DirectUrlSize,
40
40
  v1RenderRequestSize
41
- } from "../chunk-FZVJVL3T.js";
41
+ } from "../chunk-X5DJKVBT.js";
42
42
  import {
43
43
  PROJECTION_PENDING_ATTRIBUTE,
44
44
  PROJECTION_SCOPE_ROLE,
45
+ isPreV3CanvasClient,
45
46
  isProjectionUnavailableOnly
46
- } from "../chunk-3L4RRKC3.js";
47
- import "../chunk-LEBVQBDH.js";
47
+ } from "../chunk-ZW26VZHX.js";
48
+ import "../chunk-T364NBR3.js";
48
49
 
49
50
  // canvas/canvas-host.tsx
50
51
  import {
@@ -209,7 +210,11 @@ function CanvasImportBoundary({
209
210
  const getFamily = globalThis[/* @__PURE__ */ Symbol.for("tempo.react-refresh.family")];
210
211
  if (typeof getFamily === "function") {
211
212
  const family = getFamily(currentExportRef.current);
212
- if (family && family === getFamily(module.default)) return;
213
+ if (family && family === getFamily(module.default)) {
214
+ const flush = globalThis[/* @__PURE__ */ Symbol.for("tempo.react-refresh.flush")];
215
+ if (typeof flush === "function") flush();
216
+ return;
217
+ }
213
218
  }
214
219
  currentExportRef.current = module.default;
215
220
  setReplacement(() => module.default);
@@ -1864,8 +1869,10 @@ function useCanvasHostPostMessage(registeredCanvasPaths = [], urlPinnedRenderId
1864
1869
  },
1865
1870
  [stopRuntimeWatch]
1866
1871
  );
1872
+ const runtimeIdRef = useRef2(void 0);
1867
1873
  const buildState = useCallback2(
1868
1874
  () => ({
1875
+ runtimeId: runtimeIdRef.current,
1869
1876
  sourceCapturePins: true,
1870
1877
  ...registerCanvasRef.current ? { incrementalCanvasRegistration: true } : {},
1871
1878
  ...buildRenderStatePayload(
@@ -2129,6 +2136,9 @@ function useCanvasHostPostMessage(registeredCanvasPaths = [], urlPinnedRenderId
2129
2136
  ]);
2130
2137
  useEffect2(() => {
2131
2138
  if (typeof window === "undefined") return;
2139
+ runtimeIdRef.current = Array.from(
2140
+ crypto.getRandomValues(new Uint32Array(4))
2141
+ ).join("-");
2132
2142
  const waitForRenderLease = async (request) => {
2133
2143
  try {
2134
2144
  await waitForRender(request);
@@ -2482,7 +2492,10 @@ function useCanvasHostPostMessage(registeredCanvasPaths = [], urlPinnedRenderId
2482
2492
  const stopProblemPublisher = problemTrackerRef.current.watch(
2483
2493
  publishProblemSnapshot
2484
2494
  );
2485
- window.postMessage({ type: "render-pool:ready" }, "*");
2495
+ window.postMessage(
2496
+ { type: "render-pool:ready", runtimeId: runtimeIdRef.current },
2497
+ "*"
2498
+ );
2486
2499
  return () => {
2487
2500
  window.removeEventListener("message", onMessage);
2488
2501
  window.removeEventListener("__render-pool:command", onBridgeCommand);
@@ -2560,6 +2573,16 @@ function protectCanvasHostDocumentTitle(doc) {
2560
2573
  if (interval !== void 0) doc.defaultView?.clearInterval(interval);
2561
2574
  };
2562
2575
  }
2576
+ function keepSharedHostUnscrolled(view) {
2577
+ const reset = () => {
2578
+ if (view.scrollX !== 0 || view.scrollY !== 0) {
2579
+ view.scrollTo({ left: 0, top: 0, behavior: "instant" });
2580
+ }
2581
+ };
2582
+ reset();
2583
+ view.addEventListener("scroll", reset);
2584
+ return () => view.removeEventListener("scroll", reset);
2585
+ }
2563
2586
  var CanvasHostContractError = class extends Error {
2564
2587
  constructor() {
2565
2588
  super(...arguments);
@@ -2725,6 +2748,12 @@ function CanvasHost({
2725
2748
  if (typeof document === "undefined") return;
2726
2749
  return protectCanvasHostDocumentTitle(document);
2727
2750
  }, []);
2751
+ const isSharedHost = directUrlRender === null && !isPreV3CanvasClient();
2752
+ useEffect3(() => {
2753
+ if (typeof window === "undefined") return;
2754
+ if (!isSharedHost) return;
2755
+ return keepSharedHostUnscrolled(window);
2756
+ }, [isSharedHost]);
2728
2757
  const propActiveIds = useMemo3(
2729
2758
  () => new Set(activeStoryboardIds ?? []),
2730
2759
  [activeStoryboardIds]