tempo-sdk 0.0.20 → 0.0.22

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.
@@ -1,3 +1,6 @@
1
+ import {
2
+ PROJECTION_PENDING_ATTRIBUTE
3
+ } from "../chunk-ZT2REPH4.js";
1
4
  import {
2
5
  TEMPO_INTERACT_FRAME_NAME,
3
6
  isTempoInteractFrameName
@@ -89,7 +92,7 @@ function CanvasContext({
89
92
  }
90
93
 
91
94
  // canvas/canvas-host.tsx
92
- import { useMemo as useMemo4 } from "react";
95
+ import { useEffect as useEffect3, useMemo as useMemo4 } from "react";
93
96
 
94
97
  // canvas/canvas-import-boundary.tsx
95
98
  import {
@@ -104,6 +107,19 @@ import {
104
107
  useState
105
108
  } from "react";
106
109
 
110
+ // canvas/canvas-pending-marker.tsx
111
+ import { jsx as jsx2 } from "react/jsx-runtime";
112
+ function CanvasPendingMarker() {
113
+ return /* @__PURE__ */ jsx2(
114
+ "div",
115
+ {
116
+ ...{ [PROJECTION_PENDING_ATTRIBUTE]: "" },
117
+ style: { display: "none" },
118
+ "aria-hidden": "true"
119
+ }
120
+ );
121
+ }
122
+
107
123
  // canvas/host-recovery-feed.ts
108
124
  var FEED_KEY = "__tempoCanvasHostRecoveryFeed";
109
125
  function createFeed() {
@@ -185,7 +201,7 @@ function useStoryboardPlacement(storyboardId) {
185
201
  }
186
202
 
187
203
  // canvas/canvas-import-boundary.tsx
188
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
204
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
189
205
  var CanvasImportErrorBoundary = class extends Component {
190
206
  constructor() {
191
207
  super(...arguments);
@@ -234,7 +250,7 @@ function CanvasImportBoundary({
234
250
  const LazyCanvas = useMemo2(() => {
235
251
  void lazyIdentity;
236
252
  return lazy(
237
- () => loadRef.current().catch((error) => {
253
+ () => Promise.resolve().then(() => loadRef.current()).catch((error) => {
238
254
  getCanvasHostRecoveryFeed().publish({
239
255
  type: "module-load-failure",
240
256
  path: canvasPath,
@@ -272,9 +288,9 @@ function CanvasImportBoundary({
272
288
  () => registerCanvasProblemScope(canvasPath),
273
289
  [canvasPath, registerCanvasProblemScope]
274
290
  );
275
- return /* @__PURE__ */ jsx2(CanvasImportErrorBoundary, { reportError, children: /* @__PURE__ */ jsx2(Suspense, { fallback: null, children: /* @__PURE__ */ jsxs(CanvasContext, { path: canvasPath, children: [
276
- /* @__PURE__ */ jsx2(LazyCanvas, {}),
277
- /* @__PURE__ */ jsx2(CanvasCommitSignal, { onCommit: markCommitted })
291
+ return /* @__PURE__ */ jsx3(CanvasImportErrorBoundary, { reportError, children: /* @__PURE__ */ jsx3(Suspense, { fallback: /* @__PURE__ */ jsx3(CanvasPendingMarker, {}), children: /* @__PURE__ */ jsxs(CanvasContext, { path: canvasPath, children: [
292
+ /* @__PURE__ */ jsx3(LazyCanvas, {}),
293
+ /* @__PURE__ */ jsx3(CanvasCommitSignal, { onCommit: markCommitted })
278
294
  ] }) }) }, retryRevision);
279
295
  }
280
296
 
@@ -639,11 +655,14 @@ async function captureStoryboardImage(renderId, options) {
639
655
  ...options?.portalSelectors ?? [],
640
656
  ...getStoryboardPortalSelectors(renderId)
641
657
  ];
658
+ const renderSelector = buildRenderSelector(renderId);
659
+ const { childSelector, ...captureOptions } = options ?? {};
660
+ const captureSelector = childSelector ? `${renderSelector} ${childSelector}` : renderSelector;
642
661
  await nextAnimationFrame();
643
662
  await nextAnimationFrame();
644
663
  return await getCanvasHostRuntime().captureSelector(
645
- buildRenderSelector(renderId),
646
- portalSelectors.length > 0 ? { ...options, portalSelectors: [...new Set(portalSelectors)] } : options
664
+ captureSelector,
665
+ portalSelectors.length > 0 ? { ...captureOptions, portalSelectors: [...new Set(portalSelectors)] } : captureOptions
647
666
  );
648
667
  }
649
668
  async function captureStoryboardHtml(renderId, options) {
@@ -919,8 +938,9 @@ function evictCachedRenders(entries, maxCached) {
919
938
  }
920
939
  return next;
921
940
  }
922
- function buildRenderStatePayload(entries, maxCached) {
941
+ function buildRenderStatePayload(entries, maxCached, canvasPaths = []) {
923
942
  return {
943
+ canvasPaths: [...canvasPaths],
924
944
  renders: [...entries.values()].map(
925
945
  ({
926
946
  activeCount: _activeCount,
@@ -1882,7 +1902,7 @@ function setRuntimeWatchPaused(watch, paused, resumeOptions) {
1882
1902
  }
1883
1903
  }
1884
1904
  }
1885
- function useCanvasHostPostMessage() {
1905
+ function useCanvasHostPostMessage(registeredCanvasPaths = []) {
1886
1906
  const [renderEntriesById, setRenderEntriesById] = useState2(
1887
1907
  () => /* @__PURE__ */ new Map()
1888
1908
  );
@@ -1894,6 +1914,8 @@ function useCanvasHostPostMessage() {
1894
1914
  );
1895
1915
  const renderEntriesRef = useRef2(renderEntriesById);
1896
1916
  const watchRequestsRef = useRef2(watchRequestsById);
1917
+ const registeredCanvasPathsRef = useRef2([]);
1918
+ registeredCanvasPathsRef.current = registeredCanvasPaths;
1897
1919
  const maxCachedRef = useRef2(DEFAULT_MAX_CACHED_RENDERS);
1898
1920
  const legacyHealthRef = useRef2(createLegacyHostHealth());
1899
1921
  const renderedRenderIdsRef = useRef2(/* @__PURE__ */ new Set());
@@ -2027,7 +2049,11 @@ function useCanvasHostPostMessage() {
2027
2049
  [stopRuntimeWatch]
2028
2050
  );
2029
2051
  const buildState = useCallback3(
2030
- () => buildRenderStatePayload(renderEntriesRef.current, maxCachedRef.current),
2052
+ () => buildRenderStatePayload(
2053
+ renderEntriesRef.current,
2054
+ maxCachedRef.current,
2055
+ registeredCanvasPathsRef.current
2056
+ ),
2031
2057
  []
2032
2058
  );
2033
2059
  const markStoryboardRendered = useCallback3((storyboardId) => {
@@ -2329,6 +2355,7 @@ function useCanvasHostPostMessage() {
2329
2355
  void withRenderLease(
2330
2356
  request,
2331
2357
  () => captureStoryboardImage(request.renderId, {
2358
+ childSelector: typeof payload.childSelector === "string" ? payload.childSelector : void 0,
2332
2359
  overlaySelector: typeof payload.overlaySelector === "string" ? payload.overlaySelector : void 0,
2333
2360
  format: payload.format === "jpeg" || payload.format === "png" ? payload.format : void 0,
2334
2361
  quality: readOptionalNumber(payload, "quality"),
@@ -2565,7 +2592,28 @@ function buildWatchBindingKey(commandType, payload) {
2565
2592
  }
2566
2593
 
2567
2594
  // canvas/canvas-host.tsx
2568
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
2595
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
2596
+ var CANVAS_HOST_DOCUMENT_TITLE = "INTERNAL tempo-host \u2014 Tempo component host, do not interact";
2597
+ function protectCanvasHostDocumentTitle(doc) {
2598
+ const restoreTitle = () => {
2599
+ if (doc.title !== CANVAS_HOST_DOCUMENT_TITLE) {
2600
+ doc.title = CANVAS_HOST_DOCUMENT_TITLE;
2601
+ }
2602
+ };
2603
+ restoreTitle();
2604
+ const Observer = doc.defaultView?.MutationObserver;
2605
+ const observer = Observer ? new Observer(restoreTitle) : null;
2606
+ observer?.observe(doc.head ?? doc.documentElement, {
2607
+ childList: true,
2608
+ subtree: true,
2609
+ characterData: true
2610
+ });
2611
+ const interval = doc.defaultView?.setInterval(restoreTitle, 250);
2612
+ return () => {
2613
+ observer?.disconnect();
2614
+ if (interval !== void 0) doc.defaultView?.clearInterval(interval);
2615
+ };
2616
+ }
2569
2617
  var CanvasHostContractError = class extends Error {
2570
2618
  constructor() {
2571
2619
  super(...arguments);
@@ -2624,6 +2672,14 @@ function CanvasHost({
2624
2672
  "CanvasHost cannot receive both children and canvasModules."
2625
2673
  );
2626
2674
  }
2675
+ const registeredCanvasPaths = useMemo4(
2676
+ () => [
2677
+ ...new Set(
2678
+ canvasModules?.map(({ canvasPath }) => canvasPath.trim()) ?? []
2679
+ )
2680
+ ].filter(Boolean),
2681
+ [canvasModules]
2682
+ );
2627
2683
  const {
2628
2684
  renderStatusById: renderStatusById2,
2629
2685
  renderSizeById,
@@ -2634,7 +2690,11 @@ function CanvasHost({
2634
2690
  reportCanvasImportError,
2635
2691
  clearCanvasImportError,
2636
2692
  registerCanvasProblemScope
2637
- } = useCanvasHostPostMessage();
2693
+ } = useCanvasHostPostMessage(registeredCanvasPaths);
2694
+ useEffect3(() => {
2695
+ if (typeof document === "undefined") return;
2696
+ return protectCanvasHostDocumentTitle(document);
2697
+ }, []);
2638
2698
  const directUrlSearch = typeof window === "undefined" ? "" : window.location.search;
2639
2699
  const directUrlRender = useMemo4(() => {
2640
2700
  void directUrlSearch;
@@ -2689,7 +2749,7 @@ function CanvasHost({
2689
2749
  );
2690
2750
  return /* @__PURE__ */ jsxs2(CanvasHostContext.Provider, { value: runtime, children: [
2691
2751
  children,
2692
- canvasModules?.map(({ canvasPath, load }) => /* @__PURE__ */ jsx3(
2752
+ canvasModules?.map(({ canvasPath, load }) => /* @__PURE__ */ jsx4(
2693
2753
  CanvasImportBoundary,
2694
2754
  {
2695
2755
  canvasPath,
@@ -2714,15 +2774,74 @@ import {
2714
2774
  isValidElement as isValidElement2,
2715
2775
  Suspense as Suspense2,
2716
2776
  useCallback as useCallback5,
2717
- useEffect as useEffect4,
2777
+ useEffect as useEffect5,
2718
2778
  useLayoutEffect as useLayoutEffect3,
2719
2779
  useMemo as useMemo5,
2720
2780
  useRef as useRef4,
2721
2781
  useState as useState3
2722
2782
  } from "react";
2723
2783
 
2784
+ // canvas/admission-budget.ts
2785
+ import * as React from "react";
2786
+ var admissionRenderStepBudget = 1e5;
2787
+ var AdmissionBudgetError = class extends Error {
2788
+ constructor() {
2789
+ super(
2790
+ "This storyboard renders itself recursively: it kept creating components without ever finishing a render. Check for a component that returns itself, or two components that render each other."
2791
+ );
2792
+ this.name = "AdmissionBudgetError";
2793
+ }
2794
+ };
2795
+ function findDispatcherSlot() {
2796
+ const react = React;
2797
+ const modern = react.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
2798
+ if (modern && "H" in modern) return { holder: modern, key: "H" };
2799
+ const legacy = react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentDispatcher;
2800
+ if (legacy && "current" in legacy) return { holder: legacy, key: "current" };
2801
+ return null;
2802
+ }
2803
+ var stepsRemaining = admissionRenderStepBudget;
2804
+ var rearmScheduled = false;
2805
+ var counterState = "uninstalled";
2806
+ function scheduleRearm() {
2807
+ if (rearmScheduled) return;
2808
+ rearmScheduled = true;
2809
+ queueMicrotask(() => {
2810
+ rearmScheduled = false;
2811
+ stepsRemaining = admissionRenderStepBudget;
2812
+ });
2813
+ }
2814
+ function installCounter() {
2815
+ if (counterState !== "uninstalled") return counterState === "installed";
2816
+ const slot = findDispatcherSlot();
2817
+ if (!slot) {
2818
+ counterState = "unavailable";
2819
+ return false;
2820
+ }
2821
+ const { holder, key } = slot;
2822
+ let dispatcher = holder[key];
2823
+ Object.defineProperty(holder, key, {
2824
+ configurable: true,
2825
+ get: () => dispatcher,
2826
+ set: (value) => {
2827
+ dispatcher = value;
2828
+ scheduleRearm();
2829
+ stepsRemaining -= 1;
2830
+ if (stepsRemaining > 0) return;
2831
+ stepsRemaining = admissionRenderStepBudget;
2832
+ throw new AdmissionBudgetError();
2833
+ }
2834
+ });
2835
+ counterState = "installed";
2836
+ return true;
2837
+ }
2838
+ function beginAdmissionWindow() {
2839
+ if (!installCounter()) return;
2840
+ stepsRemaining = admissionRenderStepBudget;
2841
+ }
2842
+
2724
2843
  // canvas/render-error-recovery.ts
2725
- import { useCallback as useCallback4, useEffect as useEffect3, useRef as useRef3 } from "react";
2844
+ import { useCallback as useCallback4, useEffect as useEffect4, useRef as useRef3 } from "react";
2726
2845
  var renderErrorRetryBaseDelayMs = 1e3;
2727
2846
  var renderErrorRetryMaxDelayMs = 8e3;
2728
2847
  var beatListeners = /* @__PURE__ */ new Set();
@@ -2757,7 +2876,7 @@ function useRenderErrorRecovery(retryNow) {
2757
2876
  nextDelayRef.current = renderErrorRetryBaseDelayMs;
2758
2877
  clearTimer();
2759
2878
  }, [clearTimer]);
2760
- useEffect3(() => {
2879
+ useEffect4(() => {
2761
2880
  const onBeat = () => {
2762
2881
  nextDelayRef.current = renderErrorRetryBaseDelayMs;
2763
2882
  if (!erroredRef.current) return;
@@ -2774,7 +2893,7 @@ function useRenderErrorRecovery(retryNow) {
2774
2893
  }
2775
2894
 
2776
2895
  // canvas/storyboard.tsx
2777
- import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
2896
+ import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
2778
2897
  function Storyboard({
2779
2898
  id,
2780
2899
  name,
@@ -2783,27 +2902,27 @@ function Storyboard({
2783
2902
  props
2784
2903
  }) {
2785
2904
  const Component3 = component;
2786
- return /* @__PURE__ */ jsx4(StoryboardSlot, { id, name, layout, kind: "component", children: /* @__PURE__ */ jsx4(Component3, { ...props ?? {} }) });
2905
+ return /* @__PURE__ */ jsx5(StoryboardSlot, { id, name, layout, kind: "component", children: /* @__PURE__ */ jsx5(Component3, { ...props ?? {} }) });
2787
2906
  }
2788
2907
  function LegacyStoryboardV1({
2789
2908
  id,
2790
2909
  storyboard
2791
2910
  }) {
2792
- return /* @__PURE__ */ jsx4(
2911
+ return /* @__PURE__ */ jsx5(
2793
2912
  StoryboardSlot,
2794
2913
  {
2795
2914
  id,
2796
2915
  name: storyboard.name,
2797
2916
  layout: storyboard.layout,
2798
2917
  kind: "component",
2799
- children: /* @__PURE__ */ jsx4(LegacyStoryboardV1Render, { render: storyboard.render })
2918
+ children: /* @__PURE__ */ jsx5(LegacyStoryboardV1Render, { render: storyboard.render })
2800
2919
  }
2801
2920
  );
2802
2921
  }
2803
2922
  function LegacyStoryboardV1Render({
2804
2923
  render
2805
2924
  }) {
2806
- return /* @__PURE__ */ jsx4(Fragment, { children: render() });
2925
+ return /* @__PURE__ */ jsx5(Fragment, { children: render() });
2807
2926
  }
2808
2927
  function RouteStoryboard({
2809
2928
  id,
@@ -2811,7 +2930,7 @@ function RouteStoryboard({
2811
2930
  route,
2812
2931
  layout
2813
2932
  }) {
2814
- return /* @__PURE__ */ jsx4(
2933
+ return /* @__PURE__ */ jsx5(
2815
2934
  StoryboardSlot,
2816
2935
  {
2817
2936
  id,
@@ -2829,7 +2948,7 @@ function HtmlStoryboard({
2829
2948
  src,
2830
2949
  layout
2831
2950
  }) {
2832
- return /* @__PURE__ */ jsx4(
2951
+ return /* @__PURE__ */ jsx5(
2833
2952
  StoryboardSlot,
2834
2953
  {
2835
2954
  id,
@@ -2865,6 +2984,10 @@ function StoryboardSlot({
2865
2984
  const intrinsicSize = renderSize?.intrinsicSize ?? (kind === "component" && layout.intrinsicSizing === "root-element");
2866
2985
  const resetKey = `${renderId}:${renderRevision}`;
2867
2986
  const contentRef = useRef4(null);
2987
+ const [admittedRenderId, setAdmittedRenderId] = useState3(
2988
+ typeof document === "undefined" ? renderId : null
2989
+ );
2990
+ const admitted = admittedRenderId === renderId;
2868
2991
  const errorBoundaryRef = useRef4(null);
2869
2992
  const lastReportedCommitRef = useRef4(null);
2870
2993
  const previousChildrenRef = useRef4(children);
@@ -2883,16 +3006,35 @@ function StoryboardSlot({
2883
3006
  },
2884
3007
  [noteRenderError, reportError]
2885
3008
  );
3009
+ const pendingRenderedReportRef = useRef4(
3010
+ null
3011
+ );
2886
3012
  const handleRendered = useCallback5(
2887
3013
  (reportedCommitKey) => {
2888
- noteRecovered();
2889
- if (lastReportedCommitRef.current === reportedCommitKey) return;
2890
- lastReportedCommitRef.current = reportedCommitKey;
2891
- clearError();
2892
- markRendered();
3014
+ if (pendingRenderedReportRef.current !== null) {
3015
+ clearTimeout(pendingRenderedReportRef.current);
3016
+ }
3017
+ pendingRenderedReportRef.current = setTimeout(() => {
3018
+ pendingRenderedReportRef.current = null;
3019
+ if (errorBoundaryRef.current?.hasError()) return;
3020
+ noteRecovered();
3021
+ if (lastReportedCommitRef.current === reportedCommitKey) return;
3022
+ lastReportedCommitRef.current = reportedCommitKey;
3023
+ clearError();
3024
+ markRendered();
3025
+ }, 0);
2893
3026
  },
2894
3027
  [clearError, markRendered, noteRecovered]
2895
3028
  );
3029
+ useEffect5(
3030
+ () => () => {
3031
+ if (pendingRenderedReportRef.current !== null) {
3032
+ clearTimeout(pendingRenderedReportRef.current);
3033
+ pendingRenderedReportRef.current = null;
3034
+ }
3035
+ },
3036
+ []
3037
+ );
2896
3038
  const renderChildren = useMemo5(() => {
2897
3039
  if (isValidElement2(children)) return cloneElement2(children);
2898
3040
  return Children2.map(
@@ -2900,22 +3042,25 @@ function StoryboardSlot({
2900
3042
  (child) => isValidElement2(child) ? cloneElement2(child) : child
2901
3043
  );
2902
3044
  }, [children]);
2903
- useEffect4(() => markUnmounted, [markUnmounted]);
2904
- useEffect4(() => {
3045
+ useEffect5(() => markUnmounted, [markUnmounted]);
3046
+ useEffect5(() => {
3047
+ setAdmittedRenderId(renderId);
3048
+ }, [renderId]);
3049
+ useEffect5(() => {
2905
3050
  const childrenChanged = previousChildrenRef.current !== children;
2906
3051
  previousChildrenRef.current = children;
2907
3052
  if (childrenChanged) retryRenderNow();
2908
3053
  }, [children, retryRenderNow]);
2909
- useEffect4(() => {
3054
+ useEffect5(() => {
2910
3055
  if (!contentRef.current || status === "unmounted") return;
2911
3056
  return trackStoryboardPortals(renderId, contentRef.current, status);
2912
3057
  }, [renderId, status]);
2913
- useEffect4(() => {
3058
+ useEffect5(() => {
2914
3059
  if (status === "unmounted") return;
2915
3060
  syncStoryboardPortals(renderId, status);
2916
3061
  }, [renderId, status]);
2917
3062
  if (status === "unmounted") return null;
2918
- return /* @__PURE__ */ jsx4(
3063
+ return /* @__PURE__ */ jsx5(
2919
3064
  "div",
2920
3065
  {
2921
3066
  "data-render-id": renderId,
@@ -2940,23 +3085,24 @@ function StoryboardSlot({
2940
3085
  visibility: status === "active" ? "visible" : "hidden",
2941
3086
  pointerEvents: status === "active" ? "auto" : "none"
2942
3087
  },
2943
- children: /* @__PURE__ */ jsx4(
3088
+ children: /* @__PURE__ */ jsx5(
2944
3089
  "div",
2945
3090
  {
2946
3091
  "data-render-content": renderId,
3092
+ "data-render-admitted": admitted ? "true" : void 0,
2947
3093
  "data-tempo-render-mode": kind === "html" ? "static-dom" : void 0,
2948
3094
  "data-tempo-hide-fiber": "true",
2949
3095
  ref: contentRef,
2950
3096
  style: { width: "100%", height: "100%" },
2951
- children: /* @__PURE__ */ jsx4(
3097
+ children: /* @__PURE__ */ jsx5(
2952
3098
  StoryboardErrorBoundary,
2953
3099
  {
2954
3100
  ref: errorBoundaryRef,
2955
3101
  onError: handleRenderError,
2956
3102
  resetKey,
2957
- children: /* @__PURE__ */ jsxs3(Suspense2, { fallback: null, children: [
2958
- renderChildren,
2959
- /* @__PURE__ */ jsx4(
3103
+ children: admitted ? /* @__PURE__ */ jsxs3(Suspense2, { fallback: /* @__PURE__ */ jsx5(CanvasPendingMarker, {}), children: [
3104
+ /* @__PURE__ */ jsx5(StoryboardAdmission, { children: renderChildren }),
3105
+ /* @__PURE__ */ jsx5(
2960
3106
  StoryboardCommitSignal,
2961
3107
  {
2962
3108
  commitKey,
@@ -2964,7 +3110,7 @@ function StoryboardSlot({
2964
3110
  },
2965
3111
  commitKey
2966
3112
  )
2967
- ] })
3113
+ ] }) : null
2968
3114
  }
2969
3115
  )
2970
3116
  }
@@ -2972,6 +3118,10 @@ function StoryboardSlot({
2972
3118
  }
2973
3119
  );
2974
3120
  }
3121
+ function StoryboardAdmission({ children }) {
3122
+ beginAdmissionWindow();
3123
+ return children;
3124
+ }
2975
3125
  function StoryboardCommitSignal({
2976
3126
  commitKey,
2977
3127
  onCommit
@@ -2981,6 +3131,17 @@ function StoryboardCommitSignal({
2981
3131
  useLayoutEffect3(() => onCommitRef.current(commitKey), [commitKey]);
2982
3132
  return null;
2983
3133
  }
3134
+ var maxReportedComponentStackFrames = 40;
3135
+ function boundComponentStack(componentStack) {
3136
+ if (!componentStack) return void 0;
3137
+ const frames = componentStack.split("\n");
3138
+ if (frames.length <= maxReportedComponentStackFrames) return componentStack;
3139
+ const dropped = frames.length - maxReportedComponentStackFrames;
3140
+ return [
3141
+ ...frames.slice(0, maxReportedComponentStackFrames),
3142
+ ` ... ${dropped} more frames`
3143
+ ].join("\n");
3144
+ }
2984
3145
  var StoryboardErrorBoundary = class extends Component2 {
2985
3146
  constructor() {
2986
3147
  super(...arguments);
@@ -3004,11 +3165,12 @@ var StoryboardErrorBoundary = class extends Component2 {
3004
3165
  return null;
3005
3166
  }
3006
3167
  componentDidCatch(error, info) {
3007
- this.setState({ componentStack: info.componentStack ?? void 0 });
3168
+ const componentStack = boundComponentStack(info.componentStack);
3169
+ this.setState({ componentStack });
3008
3170
  this.props.onError({
3009
3171
  message: error.message,
3010
3172
  stack: error.stack,
3011
- componentStack: info.componentStack ?? void 0
3173
+ componentStack
3012
3174
  });
3013
3175
  }
3014
3176
  hasError() {
@@ -3023,7 +3185,7 @@ var StoryboardErrorBoundary = class extends Component2 {
3023
3185
  }
3024
3186
  render() {
3025
3187
  if (this.state.error) {
3026
- return /* @__PURE__ */ jsx4(
3188
+ return /* @__PURE__ */ jsx5(
3027
3189
  "div",
3028
3190
  {
3029
3191
  "data-render-error": "true",
@@ -3036,6 +3198,7 @@ var StoryboardErrorBoundary = class extends Component2 {
3036
3198
  }
3037
3199
  };
3038
3200
  export {
3201
+ CANVAS_HOST_DOCUMENT_TITLE,
3039
3202
  Canvas,
3040
3203
  CanvasContext,
3041
3204
  CanvasHost,