tempo-sdk 0.0.52 → 0.0.57
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 +4 -2
- package/dist/assets/index.js.map +1 -1
- package/dist/canvas/editor.d.ts +11 -16
- package/dist/canvas/editor.js +79 -49
- package/dist/canvas/editor.js.map +1 -1
- package/dist/canvas/index.d.ts +10 -6
- package/dist/canvas/index.js +130 -47
- package/dist/canvas/index.js.map +1 -1
- package/dist/canvas/interact-projection.js +4 -3
- package/dist/canvas/parser.d.ts +10 -5
- package/dist/canvas/parser.js +3 -1
- package/dist/canvas/svelte.d.ts +8 -5
- package/dist/canvas/svelte.js +20 -5
- package/dist/canvas/svelte.js.map +1 -1
- package/dist/chunk-2IQD2KPS.js +219 -0
- package/dist/chunk-2IQD2KPS.js.map +1 -0
- package/dist/chunk-5BHIHP25.js +410 -0
- package/dist/chunk-5BHIHP25.js.map +1 -0
- package/dist/chunk-EMYYTS6D.js +1585 -0
- package/dist/chunk-EMYYTS6D.js.map +1 -0
- package/dist/{chunk-DX6XAXCK.js → chunk-N2TYN3RB.js} +189 -420
- package/dist/chunk-N2TYN3RB.js.map +1 -0
- package/dist/{chunk-7Y7XNHUM.js → chunk-QXL6GL2P.js} +18 -3
- package/dist/chunk-QXL6GL2P.js.map +1 -0
- package/dist/{chunk-QP2NTODB.js → chunk-RHHVVWAC.js} +115 -25
- package/dist/chunk-RHHVVWAC.js.map +1 -0
- package/dist/chunk-TL4MGN7E.js +2570 -0
- package/dist/chunk-TL4MGN7E.js.map +1 -0
- package/dist/{chunk-PULSTDX2.js → chunk-U3SLJNRS.js} +284 -46
- package/dist/chunk-U3SLJNRS.js.map +1 -0
- package/dist/{chunk-ZZYNOX24.js → chunk-U64AHDHZ.js} +1708 -2461
- package/dist/chunk-U64AHDHZ.js.map +1 -0
- package/dist/expo/plugin.cjs +1256 -16
- package/dist/expo/plugin.cjs.map +1 -1
- package/dist/expo/plugin.d.cts +0 -1
- package/dist/expo/plugin.d.ts +0 -1
- package/dist/expo/plugin.js +1 -1
- package/dist/expo-babel-plugin.cjs +1258 -16
- package/dist/expo-babel-plugin.cjs.map +1 -1
- package/dist/expo-babel-plugin.d.cts +8 -5
- package/dist/expo-babel-plugin.d.ts +8 -5
- package/dist/expo-babel-plugin.js +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +463 -153
- package/dist/index.js.map +1 -1
- package/dist/nextjs/plugin.cjs +151 -0
- package/dist/nextjs/plugin.cjs.map +1 -1
- package/dist/nextjs/plugin.d.cts +1 -1
- package/dist/nextjs/plugin.d.ts +1 -1
- package/dist/nextjs/plugin.js +1 -1
- package/dist/nextjs-loader.cjs +1432 -35
- package/dist/nextjs-loader.cjs.map +1 -1
- package/dist/nextjs.cjs +17 -2
- package/dist/nextjs.cjs.map +1 -1
- package/dist/nextjs.d.cts +14 -3
- package/dist/nextjs.d.ts +14 -3
- package/dist/nextjs.js +1 -1
- package/dist/{page-xi1aI5a7.d.ts → page-DwLnOM5d.d.ts} +12 -6
- package/dist/{storyboard-DbtzTPvI.d.ts → storyboard-BtQuVGpl.d.ts} +33 -15
- package/dist/svelte.d.ts +3 -2
- package/dist/svelte.js +103 -29
- package/dist/svelte.js.map +1 -1
- package/dist/v1-client-compat-qxaXEDm_.d.ts +23 -0
- package/package.json +5 -2
- package/dist/chunk-57KAYXHF.js +0 -19
- package/dist/chunk-57KAYXHF.js.map +0 -1
- package/dist/chunk-7Y7XNHUM.js.map +0 -1
- package/dist/chunk-CB5NJJJT.js +0 -345
- package/dist/chunk-CB5NJJJT.js.map +0 -1
- package/dist/chunk-DX6XAXCK.js.map +0 -1
- package/dist/chunk-F3KJDCMU.js +0 -19
- package/dist/chunk-F3KJDCMU.js.map +0 -1
- package/dist/chunk-PULSTDX2.js.map +0 -1
- package/dist/chunk-QP2NTODB.js.map +0 -1
- package/dist/chunk-ZZYNOX24.js.map +0 -1
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
PROJECTION_PENDING_ATTRIBUTE
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
Children,
|
|
8
|
-
cloneElement,
|
|
9
|
-
createContext,
|
|
10
|
-
isValidElement,
|
|
11
|
-
useContext,
|
|
12
|
-
useMemo
|
|
13
|
-
} from "react";
|
|
2
|
+
PROJECTION_PENDING_ATTRIBUTE,
|
|
3
|
+
PROJECTION_ROOT_ATTRIBUTE,
|
|
4
|
+
PROJECTION_SCOPE_ROLE
|
|
5
|
+
} from "./chunk-TL4MGN7E.js";
|
|
14
6
|
|
|
15
7
|
// canvas/ids.ts
|
|
16
8
|
function normalizeId(value, label) {
|
|
@@ -20,8 +12,19 @@ function normalizeId(value, label) {
|
|
|
20
12
|
}
|
|
21
13
|
return normalized;
|
|
22
14
|
}
|
|
15
|
+
function getStoryboardKey(id) {
|
|
16
|
+
return `storyboard:${id}`;
|
|
17
|
+
}
|
|
23
18
|
|
|
24
19
|
// canvas/canvas.tsx
|
|
20
|
+
import {
|
|
21
|
+
Children,
|
|
22
|
+
cloneElement,
|
|
23
|
+
createContext,
|
|
24
|
+
isValidElement,
|
|
25
|
+
useContext,
|
|
26
|
+
useMemo
|
|
27
|
+
} from "react";
|
|
25
28
|
import { jsx } from "react/jsx-runtime";
|
|
26
29
|
var CanvasIdentityContext = createContext(null);
|
|
27
30
|
function getCanvasStoryboardRenderId(canvasPath, storyboardId) {
|
|
@@ -48,7 +51,7 @@ function Canvas({
|
|
|
48
51
|
...sourceAnnotations
|
|
49
52
|
}) {
|
|
50
53
|
const contextIdentity = useCanvasIdentity();
|
|
51
|
-
const canvasName =
|
|
54
|
+
const canvasName = name?.trim() || void 0;
|
|
52
55
|
const canvasPath = path === void 0 ? contextIdentity?.path : normalizeId(path, "Canvas path");
|
|
53
56
|
if (!canvasPath) {
|
|
54
57
|
throw new Error(
|
|
@@ -56,24 +59,34 @@ function Canvas({
|
|
|
56
59
|
);
|
|
57
60
|
}
|
|
58
61
|
const identity = useMemo(() => ({ path: canvasPath }), [canvasPath]);
|
|
59
|
-
const
|
|
60
|
-
|
|
62
|
+
const declaration = {
|
|
63
|
+
path: canvasPath,
|
|
64
|
+
...canvasName ? { name: canvasName } : {},
|
|
65
|
+
backgroundColor,
|
|
66
|
+
defaultViewport
|
|
67
|
+
};
|
|
68
|
+
const keyedChildren = useMemo(() => {
|
|
69
|
+
const automatic = /* @__PURE__ */ new Set();
|
|
70
|
+
const flattened = Children.map(children, (child) => {
|
|
71
|
+
if (isValidElement(child) && child.key == null) {
|
|
72
|
+
const id = child.props.id;
|
|
73
|
+
if (typeof id === "string" && id.length) automatic.add(id);
|
|
74
|
+
}
|
|
75
|
+
return child;
|
|
76
|
+
});
|
|
77
|
+
return flattened?.map((child) => {
|
|
61
78
|
if (!isValidElement(child)) return child;
|
|
62
|
-
if (child.key != null) return child;
|
|
63
79
|
const id = child.props.id;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
[children]
|
|
68
|
-
);
|
|
80
|
+
return typeof id === "string" && automatic.has(id) ? cloneElement(child, { key: getStoryboardKey(id) }) : child;
|
|
81
|
+
});
|
|
82
|
+
}, [children]);
|
|
69
83
|
return /* @__PURE__ */ jsx(CanvasIdentityContext.Provider, { value: identity, children: /* @__PURE__ */ jsx(
|
|
70
84
|
"div",
|
|
71
85
|
{
|
|
72
86
|
...sourceAnnotations,
|
|
73
87
|
"data-tempo-canvas": canvasName,
|
|
74
88
|
"data-tempo-canvas-path": canvasPath,
|
|
75
|
-
"data-tempo-canvas-
|
|
76
|
-
"data-tempo-canvas-viewport": defaultViewport ? JSON.stringify(defaultViewport) : void 0,
|
|
89
|
+
"data-tempo-canvas-declaration": JSON.stringify(declaration),
|
|
77
90
|
children: keyedChildren
|
|
78
91
|
}
|
|
79
92
|
) });
|
|
@@ -229,11 +242,13 @@ function CanvasPendingMarker() {
|
|
|
229
242
|
"div",
|
|
230
243
|
{
|
|
231
244
|
...{ [PROJECTION_PENDING_ATTRIBUTE]: "" },
|
|
245
|
+
"data-tempo-hide-fiber": "true",
|
|
232
246
|
style: { display: "none" },
|
|
233
247
|
"aria-hidden": "true"
|
|
234
248
|
}
|
|
235
249
|
);
|
|
236
250
|
}
|
|
251
|
+
Object.assign(CanvasPendingMarker, { [PROJECTION_SCOPE_ROLE]: "transparent" });
|
|
237
252
|
|
|
238
253
|
// canvas/portal-tracking.ts
|
|
239
254
|
var PORTAL_MANAGED_PROPERTIES = [
|
|
@@ -594,6 +609,146 @@ function useRenderErrorRecovery(retryNow) {
|
|
|
594
609
|
return { noteRenderError, noteRecovered };
|
|
595
610
|
}
|
|
596
611
|
|
|
612
|
+
// canvas/responsive-slot-size.ts
|
|
613
|
+
function observeResponsiveSlotSize(content) {
|
|
614
|
+
const slot = content.parentElement;
|
|
615
|
+
const view = content.ownerDocument.defaultView;
|
|
616
|
+
if (!slot || !view) return () => {
|
|
617
|
+
};
|
|
618
|
+
const previousWidth = slot.style.minWidth;
|
|
619
|
+
const previousHeight = slot.style.minHeight;
|
|
620
|
+
const previousContentHeight = content.style.minHeight;
|
|
621
|
+
content.style.minHeight = "inherit";
|
|
622
|
+
const roots = /* @__PURE__ */ new Set();
|
|
623
|
+
let disposed = false;
|
|
624
|
+
let scheduledFrame = null;
|
|
625
|
+
const measure = () => {
|
|
626
|
+
if (disposed) return;
|
|
627
|
+
for (const root of roots) {
|
|
628
|
+
if (root.parentElement !== content) {
|
|
629
|
+
resize.unobserve(root);
|
|
630
|
+
roots.delete(root);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
for (const root of content.children) {
|
|
634
|
+
if (!roots.has(root)) {
|
|
635
|
+
roots.add(root);
|
|
636
|
+
resize.observe(root, { box: "border-box" });
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
slot.style.minWidth = previousWidth;
|
|
640
|
+
slot.style.minHeight = previousHeight;
|
|
641
|
+
const natural = slot.getBoundingClientRect();
|
|
642
|
+
let width = natural.width;
|
|
643
|
+
let height = natural.height;
|
|
644
|
+
for (const root of roots) {
|
|
645
|
+
if (view.getComputedStyle(root).position !== "absolute") continue;
|
|
646
|
+
const rect = root.getBoundingClientRect();
|
|
647
|
+
if (rect.width <= 0 || rect.height <= 0) continue;
|
|
648
|
+
width = Math.max(width, rect.right - natural.left);
|
|
649
|
+
height = Math.max(height, rect.bottom - natural.top);
|
|
650
|
+
}
|
|
651
|
+
if (width > natural.width) slot.style.minWidth = `${Math.ceil(width)}px`;
|
|
652
|
+
if (height > natural.height)
|
|
653
|
+
slot.style.minHeight = `${Math.ceil(height)}px`;
|
|
654
|
+
};
|
|
655
|
+
const scheduleMeasure = () => {
|
|
656
|
+
if (disposed || scheduledFrame !== null) return;
|
|
657
|
+
scheduledFrame = view.requestAnimationFrame(() => {
|
|
658
|
+
scheduledFrame = null;
|
|
659
|
+
measure();
|
|
660
|
+
});
|
|
661
|
+
};
|
|
662
|
+
const resize = new view.ResizeObserver(scheduleMeasure);
|
|
663
|
+
const mutations = new view.MutationObserver((records) => {
|
|
664
|
+
if (records.some(
|
|
665
|
+
(record) => record.type === "childList" ? record.target === content : record.target.parentElement === content
|
|
666
|
+
))
|
|
667
|
+
scheduleMeasure();
|
|
668
|
+
});
|
|
669
|
+
resize.observe(slot, { box: "border-box" });
|
|
670
|
+
mutations.observe(content, {
|
|
671
|
+
childList: true,
|
|
672
|
+
subtree: true,
|
|
673
|
+
attributes: true
|
|
674
|
+
});
|
|
675
|
+
measure();
|
|
676
|
+
return () => {
|
|
677
|
+
disposed = true;
|
|
678
|
+
if (scheduledFrame !== null) view.cancelAnimationFrame(scheduledFrame);
|
|
679
|
+
resize.disconnect();
|
|
680
|
+
mutations.disconnect();
|
|
681
|
+
content.style.minHeight = previousContentHeight;
|
|
682
|
+
slot.style.minWidth = previousWidth;
|
|
683
|
+
slot.style.minHeight = previousHeight;
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
// canvas/client-protocol.ts
|
|
688
|
+
var CANVAS_CLIENT_PROTOCOL_PARAM = "canvasProtocol";
|
|
689
|
+
function canvasClientProtocol() {
|
|
690
|
+
if (typeof window === "undefined") return 1;
|
|
691
|
+
const value = new URLSearchParams(window.location.search).get(
|
|
692
|
+
CANVAS_CLIENT_PROTOCOL_PARAM
|
|
693
|
+
);
|
|
694
|
+
if (value === null) return 1;
|
|
695
|
+
const protocol = Number(value.trim());
|
|
696
|
+
return Number.isInteger(protocol) && protocol >= 1 ? protocol : 1;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
// canvas/v1-client-compat.ts
|
|
700
|
+
function isV1CanvasClient() {
|
|
701
|
+
return canvasClientProtocol() < 2;
|
|
702
|
+
}
|
|
703
|
+
function v1RenderRequestSize(payload) {
|
|
704
|
+
return { intrinsicSize: payload.intrinsicSize === true ? true : void 0 };
|
|
705
|
+
}
|
|
706
|
+
function readDirectUrlFlag(value) {
|
|
707
|
+
if (value === null) return false;
|
|
708
|
+
const normalized = value.trim().toLowerCase();
|
|
709
|
+
return normalized !== "0" && normalized !== "false";
|
|
710
|
+
}
|
|
711
|
+
function v1DirectUrlSize(params, readDimension) {
|
|
712
|
+
const width = params.get("width")?.trim();
|
|
713
|
+
const height = params.get("height")?.trim();
|
|
714
|
+
const intrinsicSize = readDirectUrlFlag(params.get("intrinsicSize"));
|
|
715
|
+
if (!width && !height) {
|
|
716
|
+
return intrinsicSize ? { intrinsicSize: true, revision: 1 } : void 0;
|
|
717
|
+
}
|
|
718
|
+
if (!width || !height) {
|
|
719
|
+
throw new Error("Direct URL width and height must be provided together");
|
|
720
|
+
}
|
|
721
|
+
return {
|
|
722
|
+
width: readDimension(width),
|
|
723
|
+
height: readDimension(height),
|
|
724
|
+
...intrinsicSize ? { intrinsicSize: true } : {},
|
|
725
|
+
revision: 1
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
function v1SourceAnnotations(props) {
|
|
729
|
+
return Object.fromEntries(
|
|
730
|
+
Object.entries(props).filter(([key]) => key.startsWith("data-tempo-"))
|
|
731
|
+
);
|
|
732
|
+
}
|
|
733
|
+
function v1StoryboardSlotStyle(slot) {
|
|
734
|
+
const { kind, layout, renderSize, placement, status } = slot;
|
|
735
|
+
const renderWidth = renderSize?.width;
|
|
736
|
+
const renderHeight = renderSize?.height;
|
|
737
|
+
const intrinsicSize = renderSize?.intrinsicSize ?? (kind === "component" && layout.intrinsicSizing === "root-element");
|
|
738
|
+
return {
|
|
739
|
+
position: "absolute",
|
|
740
|
+
left: placement?.left ?? layout.x,
|
|
741
|
+
top: placement?.top ?? layout.y,
|
|
742
|
+
width: intrinsicSize ? "max-content" : renderWidth ?? layout.width,
|
|
743
|
+
height: intrinsicSize ? "max-content" : renderHeight ?? layout.height,
|
|
744
|
+
minWidth: intrinsicSize ? renderWidth : void 0,
|
|
745
|
+
minHeight: intrinsicSize ? renderHeight : void 0,
|
|
746
|
+
zIndex: layout.zIndex,
|
|
747
|
+
visibility: status === "active" ? "visible" : "hidden",
|
|
748
|
+
pointerEvents: status === "active" ? "auto" : "none"
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
|
|
597
752
|
// canvas/storyboard.tsx
|
|
598
753
|
import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
599
754
|
function Storyboard({
|
|
@@ -602,15 +757,29 @@ function Storyboard({
|
|
|
602
757
|
component,
|
|
603
758
|
layout,
|
|
604
759
|
props,
|
|
760
|
+
vrt,
|
|
605
761
|
...annotations
|
|
606
762
|
}) {
|
|
607
763
|
const Component2 = component;
|
|
608
|
-
const
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
764
|
+
const content = isV1CanvasClient() ? /* @__PURE__ */ jsx3(
|
|
765
|
+
Component2,
|
|
766
|
+
{
|
|
767
|
+
...props ?? {},
|
|
768
|
+
...v1SourceAnnotations(annotations)
|
|
769
|
+
}
|
|
770
|
+
) : /* @__PURE__ */ jsx3(Component2, { ...props ?? {} });
|
|
771
|
+
return /* @__PURE__ */ jsx3(
|
|
772
|
+
StoryboardSlot,
|
|
773
|
+
{
|
|
774
|
+
"data-tempo-hide-fiber": "true",
|
|
775
|
+
id,
|
|
776
|
+
name,
|
|
777
|
+
layout,
|
|
778
|
+
kind: "component",
|
|
779
|
+
vrt: !!vrt,
|
|
780
|
+
children: /* @__PURE__ */ jsx3(ProjectionContent, { children: content })
|
|
781
|
+
}
|
|
612
782
|
);
|
|
613
|
-
return /* @__PURE__ */ jsx3(StoryboardSlot, { id, name, layout, kind: "component", children: /* @__PURE__ */ jsx3(Component2, { ...props ?? {}, ...sourceAnnotations }) });
|
|
614
783
|
}
|
|
615
784
|
function LegacyStoryboardV1({
|
|
616
785
|
id,
|
|
@@ -619,6 +788,7 @@ function LegacyStoryboardV1({
|
|
|
619
788
|
return /* @__PURE__ */ jsx3(
|
|
620
789
|
StoryboardSlot,
|
|
621
790
|
{
|
|
791
|
+
"data-tempo-hide-fiber": "true",
|
|
622
792
|
id,
|
|
623
793
|
name: storyboard.name,
|
|
624
794
|
layout: storyboard.layout,
|
|
@@ -636,11 +806,13 @@ function RouteStoryboard({
|
|
|
636
806
|
id,
|
|
637
807
|
name,
|
|
638
808
|
route,
|
|
639
|
-
layout
|
|
809
|
+
layout,
|
|
810
|
+
...annotations
|
|
640
811
|
}) {
|
|
641
812
|
return /* @__PURE__ */ jsx3(
|
|
642
813
|
StoryboardSlot,
|
|
643
814
|
{
|
|
815
|
+
"data-tempo-hide-fiber": "true",
|
|
644
816
|
id,
|
|
645
817
|
name,
|
|
646
818
|
layout,
|
|
@@ -654,17 +826,21 @@ function HtmlStoryboard({
|
|
|
654
826
|
name,
|
|
655
827
|
filepath,
|
|
656
828
|
src,
|
|
657
|
-
layout
|
|
829
|
+
layout,
|
|
830
|
+
vrt,
|
|
831
|
+
...annotations
|
|
658
832
|
}) {
|
|
659
833
|
return /* @__PURE__ */ jsx3(
|
|
660
834
|
StoryboardSlot,
|
|
661
835
|
{
|
|
836
|
+
"data-tempo-hide-fiber": "true",
|
|
662
837
|
id,
|
|
663
838
|
name,
|
|
664
839
|
layout,
|
|
665
840
|
kind: "html",
|
|
666
841
|
filepath,
|
|
667
|
-
src
|
|
842
|
+
src,
|
|
843
|
+
vrt: !!vrt
|
|
668
844
|
}
|
|
669
845
|
);
|
|
670
846
|
}
|
|
@@ -676,7 +852,9 @@ function StoryboardSlot({
|
|
|
676
852
|
name,
|
|
677
853
|
route,
|
|
678
854
|
filepath,
|
|
679
|
-
src
|
|
855
|
+
src,
|
|
856
|
+
vrt,
|
|
857
|
+
uiFramework
|
|
680
858
|
}) {
|
|
681
859
|
const renderId = useCanvasStoryboardRenderId(id);
|
|
682
860
|
const canvas = useCanvasIdentity();
|
|
@@ -686,10 +864,13 @@ function StoryboardSlot({
|
|
|
686
864
|
const markRendered = useStoryboardRendered(id);
|
|
687
865
|
const markUnmounted = useStoryboardUnmounted(id);
|
|
688
866
|
const { reportError, clearError } = useStoryboardErrorReporter(id);
|
|
689
|
-
const
|
|
690
|
-
const
|
|
867
|
+
const legacyResponsive = layout.intrinsicSizing === "root-element";
|
|
868
|
+
const declaredWidth = legacyResponsive ? void 0 : layout.width;
|
|
869
|
+
const declaredHeight = legacyResponsive ? void 0 : layout.height;
|
|
870
|
+
const renderWidth = renderSize === void 0 ? declaredWidth : renderSize.width;
|
|
871
|
+
const renderHeight = renderSize === void 0 ? declaredHeight : renderSize.height;
|
|
872
|
+
const fixed = renderWidth !== void 0 && renderHeight !== void 0;
|
|
691
873
|
const renderRevision = renderSize?.revision ?? 0;
|
|
692
|
-
const intrinsicSize = renderSize?.intrinsicSize ?? (kind === "component" && layout.intrinsicSizing === "root-element");
|
|
693
874
|
const resetKey = `${renderId}:${renderRevision}`;
|
|
694
875
|
const contentRef = useRef2(null);
|
|
695
876
|
const [admittedRenderId, setAdmittedRenderId] = useState(
|
|
@@ -758,6 +939,11 @@ function StoryboardSlot({
|
|
|
758
939
|
(child) => isValidElement2(child) ? cloneElement2(child) : child
|
|
759
940
|
);
|
|
760
941
|
}, [children]);
|
|
942
|
+
useLayoutEffect(() => {
|
|
943
|
+
if (isV1CanvasClient() || fixed || status === "unmounted" || !contentRef.current)
|
|
944
|
+
return;
|
|
945
|
+
return observeResponsiveSlotSize(contentRef.current);
|
|
946
|
+
}, [fixed, renderId, status]);
|
|
761
947
|
useEffect2(() => markUnmounted, [markUnmounted]);
|
|
762
948
|
useEffect2(() => {
|
|
763
949
|
setAdmittedRenderId(renderId);
|
|
@@ -775,13 +961,39 @@ function StoryboardSlot({
|
|
|
775
961
|
if (status === "unmounted") return;
|
|
776
962
|
syncStoryboardPortals(renderId, status);
|
|
777
963
|
}, [renderId, status]);
|
|
778
|
-
|
|
964
|
+
const declaration = JSON.stringify({
|
|
965
|
+
id: id.trim(),
|
|
966
|
+
name,
|
|
967
|
+
kind,
|
|
968
|
+
layout: {
|
|
969
|
+
x: layout.x,
|
|
970
|
+
y: layout.y,
|
|
971
|
+
width: declaredWidth,
|
|
972
|
+
height: declaredHeight,
|
|
973
|
+
zIndex: layout.zIndex
|
|
974
|
+
},
|
|
975
|
+
route,
|
|
976
|
+
filepath,
|
|
977
|
+
src,
|
|
978
|
+
vrt,
|
|
979
|
+
uiFramework
|
|
980
|
+
});
|
|
981
|
+
if (status === "unmounted")
|
|
982
|
+
return /* @__PURE__ */ jsx3(
|
|
983
|
+
"div",
|
|
984
|
+
{
|
|
985
|
+
"data-tempo-storyboard-declaration": declaration,
|
|
986
|
+
"data-tempo-storyboard-id": id,
|
|
987
|
+
hidden: true
|
|
988
|
+
}
|
|
989
|
+
);
|
|
779
990
|
return /* @__PURE__ */ jsx3(
|
|
780
991
|
"div",
|
|
781
992
|
{
|
|
782
993
|
"data-render-id": renderId,
|
|
783
994
|
"data-render-status": status,
|
|
784
995
|
"data-tempo-storyboard-render-id": renderId,
|
|
996
|
+
"data-tempo-storyboard-declaration": declaration,
|
|
785
997
|
"data-tempo-storyboard-id": id,
|
|
786
998
|
"data-tempo-canvas-path": canvas?.path,
|
|
787
999
|
"data-tempo-storyboard-name": name,
|
|
@@ -789,17 +1001,24 @@ function StoryboardSlot({
|
|
|
789
1001
|
"data-tempo-storyboard-route": route,
|
|
790
1002
|
"data-tempo-storyboard-filepath": filepath,
|
|
791
1003
|
"data-tempo-storyboard-src": src,
|
|
792
|
-
style: {
|
|
1004
|
+
style: isV1CanvasClient() ? v1StoryboardSlotStyle({
|
|
1005
|
+
kind,
|
|
1006
|
+
layout,
|
|
1007
|
+
renderSize,
|
|
1008
|
+
placement,
|
|
1009
|
+
status
|
|
1010
|
+
}) : {
|
|
793
1011
|
position: "absolute",
|
|
794
|
-
left: placement?.left ?? layout.x,
|
|
795
|
-
top: placement?.top ?? layout.y,
|
|
796
|
-
|
|
797
|
-
height: intrinsicSize ? "max-content" : renderHeight ?? layout.height,
|
|
798
|
-
minWidth: intrinsicSize ? renderWidth : void 0,
|
|
799
|
-
minHeight: intrinsicSize ? renderHeight : void 0,
|
|
1012
|
+
left: placement?.left ?? (fixed ? layout.x : 0),
|
|
1013
|
+
top: placement?.top ?? (fixed ? layout.y : 0),
|
|
1014
|
+
...fixed ? { width: renderWidth, height: renderHeight } : {},
|
|
800
1015
|
zIndex: layout.zIndex,
|
|
801
|
-
|
|
802
|
-
|
|
1016
|
+
// A hidden shell is already out of hit testing. It must not also
|
|
1017
|
+
// say pointer-events none: the producer records every element's
|
|
1018
|
+
// computed pointer-events as an app fact, and a full taken while
|
|
1019
|
+
// a restored shell is still cached would mark all of its content
|
|
1020
|
+
// click-through.
|
|
1021
|
+
visibility: status === "active" ? "visible" : "hidden"
|
|
803
1022
|
},
|
|
804
1023
|
children: /* @__PURE__ */ jsx3(
|
|
805
1024
|
"div",
|
|
@@ -808,6 +1027,7 @@ function StoryboardSlot({
|
|
|
808
1027
|
"data-render-admitted": admitted ? "true" : void 0,
|
|
809
1028
|
"data-tempo-render-mode": kind === "html" ? "static-dom" : void 0,
|
|
810
1029
|
"data-tempo-hide-fiber": "true",
|
|
1030
|
+
...{ [PROJECTION_ROOT_ATTRIBUTE]: "true" },
|
|
811
1031
|
ref: contentRef,
|
|
812
1032
|
style: { width: "100%", height: "100%" },
|
|
813
1033
|
children: /* @__PURE__ */ jsx3(
|
|
@@ -924,9 +1144,23 @@ var StoryboardErrorBoundary = class extends Component {
|
|
|
924
1144
|
return this.props.children;
|
|
925
1145
|
}
|
|
926
1146
|
};
|
|
1147
|
+
var ProjectionContent = Object.assign(
|
|
1148
|
+
function ProjectionContent2({ children }) {
|
|
1149
|
+
return children;
|
|
1150
|
+
},
|
|
1151
|
+
{ [PROJECTION_SCOPE_ROLE]: "output" }
|
|
1152
|
+
);
|
|
1153
|
+
Object.assign(StoryboardAdmission, { [PROJECTION_SCOPE_ROLE]: "transparent" });
|
|
1154
|
+
Object.assign(StoryboardCommitSignal, {
|
|
1155
|
+
[PROJECTION_SCOPE_ROLE]: "transparent"
|
|
1156
|
+
});
|
|
1157
|
+
Object.assign(StoryboardErrorBoundary, {
|
|
1158
|
+
[PROJECTION_SCOPE_ROLE]: "transparent"
|
|
1159
|
+
});
|
|
927
1160
|
|
|
928
1161
|
export {
|
|
929
1162
|
normalizeId,
|
|
1163
|
+
getStoryboardKey,
|
|
930
1164
|
getCanvasStoryboardRenderId,
|
|
931
1165
|
Canvas,
|
|
932
1166
|
CanvasContext,
|
|
@@ -936,10 +1170,14 @@ export {
|
|
|
936
1170
|
useRequiredCanvasHost,
|
|
937
1171
|
useActiveState,
|
|
938
1172
|
getStoryboardPortalSelectors,
|
|
1173
|
+
isV1CanvasClient,
|
|
1174
|
+
v1RenderRequestSize,
|
|
1175
|
+
v1DirectUrlSize,
|
|
1176
|
+
AdmissionBudgetError,
|
|
939
1177
|
Storyboard,
|
|
940
1178
|
LegacyStoryboardV1,
|
|
941
1179
|
RouteStoryboard,
|
|
942
1180
|
HtmlStoryboard,
|
|
943
1181
|
StoryboardSlot
|
|
944
1182
|
};
|
|
945
|
-
//# sourceMappingURL=chunk-
|
|
1183
|
+
//# sourceMappingURL=chunk-U3SLJNRS.js.map
|