tempo-sdk 0.0.69 → 0.0.76
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 +2 -2
- package/dist/astro.js +24 -14
- package/dist/astro.js.map +1 -1
- package/dist/canvas/astro.d.ts +1 -1
- package/dist/canvas/astro.js +2 -2
- package/dist/canvas/editor.d.ts +15 -5
- package/dist/canvas/editor.js +13 -8
- package/dist/canvas/editor.js.map +1 -1
- package/dist/canvas/flutter-preview.d.ts +18 -0
- package/dist/canvas/flutter-preview.js +9 -0
- package/dist/canvas/flutter-preview.js.map +1 -0
- package/dist/canvas/index.d.ts +33 -2
- package/dist/canvas/index.js +1134 -26
- package/dist/canvas/index.js.map +1 -1
- package/dist/canvas/interact-projection.js +5 -4
- package/dist/canvas/parser.d.ts +142 -3
- package/dist/canvas/parser.js +14 -1
- package/dist/canvas/svelte.d.ts +1 -1
- package/dist/canvas/svelte.js +2 -2
- package/dist/canvas/vue.d.ts +74 -0
- package/dist/canvas/vue.js +264 -0
- package/dist/canvas/vue.js.map +1 -0
- package/dist/{chunk-6BSLP7P3.js → chunk-3W4CVWTK.js} +49 -7
- package/dist/chunk-3W4CVWTK.js.map +1 -0
- package/dist/chunk-5HIIF354.js +67 -0
- package/dist/chunk-5HIIF354.js.map +1 -0
- package/dist/chunk-5LUQSXSP.js +342 -0
- package/dist/chunk-5LUQSXSP.js.map +1 -0
- package/dist/{chunk-FE6TYCLF.js → chunk-5VIBKVFO.js} +2 -2
- package/dist/{chunk-FE6TYCLF.js.map → chunk-5VIBKVFO.js.map} +1 -1
- package/dist/{chunk-77DZCV5Z.js → chunk-CXIW4IKC.js} +2 -2
- package/dist/chunk-CYQE3TLC.js +37 -0
- package/dist/chunk-CYQE3TLC.js.map +1 -0
- package/dist/chunk-EGRHWZRV.js +1 -0
- package/dist/chunk-EGRHWZRV.js.map +1 -0
- package/dist/chunk-GCGRJTTS.js +285 -0
- package/dist/chunk-GCGRJTTS.js.map +1 -0
- package/dist/{chunk-EYKOOLPL.js → chunk-GKDDNDG3.js} +1039 -134
- package/dist/chunk-GKDDNDG3.js.map +1 -0
- package/dist/{chunk-KOSJXE4G.js → chunk-H6BQZOAW.js} +4 -3
- package/dist/chunk-HOBTDB6G.js +112 -0
- package/dist/chunk-HOBTDB6G.js.map +1 -0
- package/dist/{chunk-WTQQOLXM.js → chunk-R3RYGAPB.js} +1571 -1410
- package/dist/chunk-R3RYGAPB.js.map +1 -0
- package/dist/chunk-SGN7BDRE.js +16 -0
- package/dist/chunk-SGN7BDRE.js.map +1 -0
- package/dist/{chunk-F23JGM4U.js → chunk-UBTL6JUF.js} +6 -2
- package/dist/{chunk-F23JGM4U.js.map → chunk-UBTL6JUF.js.map} +1 -1
- package/dist/{chunk-2JRAG36X.js → chunk-WBMO4ZYO.js} +2 -2
- package/dist/chunk-WBMO4ZYO.js.map +1 -0
- package/dist/{chunk-K3EYTZLL.js → chunk-WTXOWQ7N.js} +3 -1
- package/dist/chunk-WTXOWQ7N.js.map +1 -0
- package/dist/{chunk-Q2A46HHW.js → chunk-XFPFWTWX.js} +276 -43
- package/dist/chunk-XFPFWTWX.js.map +1 -0
- package/dist/{chunk-PXDTH36X.js → chunk-Y72PIE3I.js} +212 -20
- package/dist/chunk-Y72PIE3I.js.map +1 -0
- package/dist/{chunk-6IR5JY6W.js → chunk-YECMP34I.js} +41 -9
- package/dist/chunk-YECMP34I.js.map +1 -0
- package/dist/{chunk-NSKYOKG5.js → chunk-ZXC7SZIT.js} +278 -26
- package/dist/chunk-ZXC7SZIT.js.map +1 -0
- package/dist/{controls-reader-SNMI2UY7.js → controls-reader-Z7OQWYWQ.js} +4 -3
- package/dist/{controls-reader-SNMI2UY7.js.map → controls-reader-Z7OQWYWQ.js.map} +1 -1
- package/dist/expo/plugin.cjs +301 -58
- package/dist/expo/plugin.cjs.map +1 -1
- package/dist/expo/plugin.js +1 -1
- package/dist/expo-babel-plugin.cjs +301 -58
- package/dist/expo-babel-plugin.cjs.map +1 -1
- package/dist/expo-babel-plugin.js +1 -1
- package/dist/flutter-preview-path.d.ts +9 -0
- package/dist/flutter-preview-path.js +16 -0
- package/dist/flutter-preview-path.js.map +1 -0
- package/dist/index.d.ts +16 -15
- package/dist/index.js +9 -6
- package/dist/nextjs/plugin.cjs +46 -5
- package/dist/nextjs/plugin.cjs.map +1 -1
- package/dist/nextjs/plugin.js +1 -1
- package/dist/nextjs-loader.cjs +343 -68
- package/dist/nextjs-loader.cjs.map +1 -1
- package/dist/nextjs.cjs +48 -6
- package/dist/nextjs.cjs.map +1 -1
- package/dist/nextjs.d.cts +9 -1
- package/dist/nextjs.d.ts +9 -1
- package/dist/nextjs.js +1 -1
- package/dist/nuxt/runtime/identity.d.ts +24 -0
- package/dist/nuxt/runtime/identity.js +18 -0
- package/dist/nuxt/runtime/identity.js.map +1 -0
- package/dist/nuxt.d.ts +102 -0
- package/dist/nuxt.js +5673 -0
- package/dist/nuxt.js.map +1 -0
- package/dist/{storyboard-4YdTYq_e.d.ts → storyboard-CMJVBSXn.d.ts} +9 -3
- package/dist/svelte.d.ts +4 -2
- package/dist/svelte.js +21 -88
- package/dist/svelte.js.map +1 -1
- package/dist/vue.d.ts +66 -0
- package/dist/vue.js +1403 -0
- package/dist/vue.js.map +1 -0
- package/package.json +48 -5
- package/dist/chunk-2JRAG36X.js.map +0 -1
- package/dist/chunk-6BSLP7P3.js.map +0 -1
- package/dist/chunk-6IR5JY6W.js.map +0 -1
- package/dist/chunk-EYKOOLPL.js.map +0 -1
- package/dist/chunk-K3EYTZLL.js.map +0 -1
- package/dist/chunk-NSKYOKG5.js.map +0 -1
- package/dist/chunk-PXDTH36X.js.map +0 -1
- package/dist/chunk-Q2A46HHW.js.map +0 -1
- package/dist/chunk-WTQQOLXM.js.map +0 -1
- /package/dist/{chunk-77DZCV5Z.js.map → chunk-CXIW4IKC.js.map} +0 -0
- /package/dist/{chunk-KOSJXE4G.js.map → chunk-H6BQZOAW.js.map} +0 -0
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TEMPO_VUE_SOURCE_REGISTRY_GLOBAL,
|
|
3
|
+
readTempoVueInvocationMarker
|
|
4
|
+
} from "./chunk-SGN7BDRE.js";
|
|
1
5
|
import {
|
|
2
6
|
captureHead,
|
|
3
7
|
getHeadTracker
|
|
4
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WBMO4ZYO.js";
|
|
9
|
+
import {
|
|
10
|
+
isTempoInteractFrameName
|
|
11
|
+
} from "./chunk-65B52AR7.js";
|
|
5
12
|
import {
|
|
6
13
|
DOM_ID_ATTR,
|
|
7
14
|
DOM_LAYER_ROOT_ID,
|
|
@@ -12,6 +19,7 @@ import {
|
|
|
12
19
|
PROJECTION_SCOPE_TARGET,
|
|
13
20
|
ProjectionObservedFileAccumulator,
|
|
14
21
|
REALM_DOCUMENT_EPOCH,
|
|
22
|
+
SOURCE_ANNOTATION_ATTRIBUTES,
|
|
15
23
|
ascendToAnnotatedComponentRoot,
|
|
16
24
|
capturePortalCoordinateSpace,
|
|
17
25
|
captureProjectionAncestorIds,
|
|
@@ -29,6 +37,7 @@ import {
|
|
|
29
37
|
drainProjectionDomMutations,
|
|
30
38
|
drainProjectionStateEvents,
|
|
31
39
|
ensureProjectionDomId,
|
|
40
|
+
flutterViewRootOf,
|
|
32
41
|
getCommittedFiberRoots,
|
|
33
42
|
getDisplayName,
|
|
34
43
|
getDomElement,
|
|
@@ -37,29 +46,36 @@ import {
|
|
|
37
46
|
getProps,
|
|
38
47
|
getTag,
|
|
39
48
|
initHook,
|
|
49
|
+
invocationSourceLayerProps,
|
|
50
|
+
isFlutterViewRoot,
|
|
40
51
|
isProjectionLayerFiber,
|
|
41
52
|
isProjectionPendingOnly,
|
|
42
53
|
isProjectionRootFiber,
|
|
54
|
+
isProjectionUnavailableOnly,
|
|
43
55
|
isTransientFiberResolutionError,
|
|
56
|
+
layerPropsEqual,
|
|
44
57
|
nextProjectionId,
|
|
45
58
|
nextRealmCaptureSequence,
|
|
59
|
+
parseInlineStyle,
|
|
46
60
|
projectedElements,
|
|
47
61
|
projectionLayerRoots,
|
|
48
62
|
readAstroMarker,
|
|
49
63
|
readProjectionDomId,
|
|
64
|
+
recordEqual,
|
|
50
65
|
resolveCommittedFiber,
|
|
51
66
|
sanitizeProps,
|
|
52
67
|
seedProjectionIds,
|
|
53
68
|
serializeDomLayerNode,
|
|
54
69
|
serializeTree,
|
|
55
70
|
stripSourceAnnotations,
|
|
71
|
+
svgLayerAttributesOf,
|
|
56
72
|
syncProjectionDomIdsToClone,
|
|
57
73
|
trackAstroSources,
|
|
58
74
|
underForeignProjectionRoot,
|
|
59
75
|
watchDom,
|
|
60
76
|
watchPortal,
|
|
61
77
|
watchState
|
|
62
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-ZXC7SZIT.js";
|
|
63
79
|
import {
|
|
64
80
|
captureAttributes,
|
|
65
81
|
captureWithSupplementalRoots,
|
|
@@ -74,9 +90,6 @@ import {
|
|
|
74
90
|
removeScriptTags,
|
|
75
91
|
resetCaptureFlushCounters
|
|
76
92
|
} from "./chunk-6AAE4LYV.js";
|
|
77
|
-
import {
|
|
78
|
-
isTempoInteractFrameName
|
|
79
|
-
} from "./chunk-65B52AR7.js";
|
|
80
93
|
|
|
81
94
|
// ../../modules/iframe-projection/combined/projection-repair-paths.ts
|
|
82
95
|
function isProjectionRepairPaths(value) {
|
|
@@ -615,15 +628,15 @@ var SANITIZED_MARKER_PATTERNS = [
|
|
|
615
628
|
},
|
|
616
629
|
{
|
|
617
630
|
match: /^\[Symbol:.*\]$/,
|
|
618
|
-
reason: (
|
|
631
|
+
reason: (raw2) => `Symbols cannot be serialized to JSX: ${raw2}`
|
|
619
632
|
},
|
|
620
633
|
{
|
|
621
634
|
match: /^\[Element:.*\]$/,
|
|
622
|
-
reason: (
|
|
635
|
+
reason: (raw2) => `DOM elements cannot be serialized to JSX: ${raw2}`
|
|
623
636
|
},
|
|
624
637
|
{
|
|
625
638
|
match: /^\[Node:.*\]$/,
|
|
626
|
-
reason: (
|
|
639
|
+
reason: (raw2) => `DOM nodes cannot be serialized to JSX: ${raw2}`
|
|
627
640
|
},
|
|
628
641
|
{
|
|
629
642
|
match: /^\[Object\]$/,
|
|
@@ -631,19 +644,19 @@ var SANITIZED_MARKER_PATTERNS = [
|
|
|
631
644
|
},
|
|
632
645
|
{
|
|
633
646
|
match: /^\[Array\(\d+\)\]$/,
|
|
634
|
-
reason: (
|
|
647
|
+
reason: (raw2) => `Large array cannot be serialized: ${raw2}`
|
|
635
648
|
},
|
|
636
649
|
{
|
|
637
650
|
match: /^\[ReactElement\]$/,
|
|
638
651
|
reason: () => "Inline React elements in props cannot be reconstructed"
|
|
639
652
|
}
|
|
640
653
|
];
|
|
641
|
-
function classifyMaybeMarker(
|
|
654
|
+
function classifyMaybeMarker(raw2) {
|
|
642
655
|
for (const { match, reason, value_type } of SANITIZED_MARKER_PATTERNS) {
|
|
643
|
-
if (match.test(
|
|
656
|
+
if (match.test(raw2)) {
|
|
644
657
|
const marker = {
|
|
645
658
|
__type: "unsupported",
|
|
646
|
-
reason: reason(
|
|
659
|
+
reason: reason(raw2)
|
|
647
660
|
};
|
|
648
661
|
if (value_type) marker.value_type = value_type;
|
|
649
662
|
return marker;
|
|
@@ -1021,9 +1034,9 @@ function collectSvelteSourceRegistry(root) {
|
|
|
1021
1034
|
for (const element of root.querySelectorAll(
|
|
1022
1035
|
`template[${TEMPO_SVELTE_SOURCE_REGISTRY_ATTRIBUTE}]`
|
|
1023
1036
|
)) {
|
|
1024
|
-
const
|
|
1025
|
-
if (!
|
|
1026
|
-
const parsed = parseRegistryRecord(
|
|
1037
|
+
const raw2 = element.getAttribute(TEMPO_SVELTE_SOURCE_REGISTRY_ATTRIBUTE);
|
|
1038
|
+
if (!raw2) continue;
|
|
1039
|
+
const parsed = parseRegistryRecord(raw2);
|
|
1027
1040
|
if (parsed) records.push(parsed);
|
|
1028
1041
|
}
|
|
1029
1042
|
return {
|
|
@@ -1361,16 +1374,7 @@ function serializeHostNode(element, chain, resolvedHost, serializeElementList, i
|
|
|
1361
1374
|
}
|
|
1362
1375
|
function serializeComponentNode(resolved, children, id) {
|
|
1363
1376
|
const { source, component } = resolved;
|
|
1364
|
-
const props =
|
|
1365
|
-
...component.className ? { className: component.className } : {},
|
|
1366
|
-
...component.style ? { style: parseInlineStyle(component.style) } : {},
|
|
1367
|
-
...component.locked !== void 0 ? { "data-tempo-locked": component.locked } : {},
|
|
1368
|
-
...component.expressions !== void 0 ? { "data-tempo-expr": component.expressions } : {},
|
|
1369
|
-
"data-tempo-filepath": source.filepath,
|
|
1370
|
-
"data-tempo-position": component.position,
|
|
1371
|
-
"data-tempo-modifiedts": source.modifiedTs,
|
|
1372
|
-
"data-tempo-source-version": source.sourceVersion
|
|
1373
|
-
};
|
|
1377
|
+
const props = invocationSourceLayerProps(source, component);
|
|
1374
1378
|
return {
|
|
1375
1379
|
kind: "component",
|
|
1376
1380
|
runtime: "svelte",
|
|
@@ -1411,10 +1415,11 @@ function captureSvelteHostProps(element, resolved, observedFiles) {
|
|
|
1411
1415
|
const live = captureProjectionDomLayerProps(element, observedFiles);
|
|
1412
1416
|
if (!resolved) return live;
|
|
1413
1417
|
const { source, host } = resolved;
|
|
1418
|
+
const recordedStyle = host.style && live?.style === void 0 ? parseInlineStyle(host.style) : void 0;
|
|
1414
1419
|
return {
|
|
1415
1420
|
...live,
|
|
1416
1421
|
...host.className && live?.className === void 0 ? { className: host.className } : {},
|
|
1417
|
-
...
|
|
1422
|
+
...recordedStyle ? { style: recordedStyle } : {},
|
|
1418
1423
|
"data-tempo-filepath": source.filepath,
|
|
1419
1424
|
"data-tempo-position": host.position,
|
|
1420
1425
|
"data-tempo-modifiedts": source.modifiedTs,
|
|
@@ -1432,16 +1437,878 @@ function firstNewComponent(chain, active) {
|
|
|
1432
1437
|
}
|
|
1433
1438
|
return null;
|
|
1434
1439
|
}
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1440
|
+
|
|
1441
|
+
// ../../modules/iframe-projection/combined/projection-vue-metadata.ts
|
|
1442
|
+
var SHAPE_ELEMENT = 1;
|
|
1443
|
+
var SHAPE_COMPONENT = 2 | 4;
|
|
1444
|
+
var SHAPE_TEXT_CHILDREN = 8;
|
|
1445
|
+
var SHAPE_ARRAY_CHILDREN = 16;
|
|
1446
|
+
var SHAPE_TELEPORT = 64;
|
|
1447
|
+
var SHAPE_SUSPENSE = 128;
|
|
1448
|
+
var FRAGMENT = /* @__PURE__ */ Symbol.for("v-fgt");
|
|
1449
|
+
var TEXT = /* @__PURE__ */ Symbol.for("v-txt");
|
|
1450
|
+
var STATIC = /* @__PURE__ */ Symbol.for("v-stc");
|
|
1451
|
+
var COMMENT = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
1452
|
+
var V_IF_PLACEHOLDER_TEXT = "v-if";
|
|
1453
|
+
var MAX_DEPTH = 512;
|
|
1454
|
+
var SUPPORTED_RUNTIME = "Vue Canvas layers require a Vue 3.3+ development build served with Tempo's Vue plugin (tempoVuePlugin from tempo-sdk/vue).";
|
|
1455
|
+
function validateVueRuntimeMetadata(root) {
|
|
1456
|
+
const containers = readVueAppContainers(root);
|
|
1457
|
+
if (containers.length === 0) {
|
|
1458
|
+
return unavailable(
|
|
1459
|
+
`${SUPPORTED_RUNTIME} No mounted Vue 3 app was found in the rendered root: the Vue app that rendered it is no longer mounted (it was unmounted, or failed during an update or hot reload, while its elements stayed in the page). Reload the board and read the page's console for the error that stopped the app; on a component board, confirm the storyboard is a VueStoryboard from tempo-sdk/canvas/vue.`
|
|
1460
|
+
);
|
|
1461
|
+
}
|
|
1462
|
+
if (readVueSourceRegistry(root) === null && containers.some(carriesTempoVueStamps)) {
|
|
1463
|
+
return unavailable(
|
|
1464
|
+
`${SUPPORTED_RUNTIME} The page carries Tempo's Vue source stamps but no Vue source registry, so the stamps cannot be resolved; reload the document, and confirm every .vue module is served by the same Vite server that stamped it.`
|
|
1465
|
+
);
|
|
1466
|
+
}
|
|
1467
|
+
for (const container of containers) {
|
|
1468
|
+
const version = readAppVersion(container);
|
|
1469
|
+
if (version !== null && !isSupportedVueVersion(version)) {
|
|
1470
|
+
return unavailable(
|
|
1471
|
+
`${SUPPORTED_RUNTIME} The rendered app runs Vue ${version}; upgrade the app to Vue 3.3 or newer.`
|
|
1472
|
+
);
|
|
1473
|
+
}
|
|
1474
|
+
const instance2 = readRawRootInstance(container);
|
|
1475
|
+
if (instance2 === null) {
|
|
1476
|
+
return unavailable(
|
|
1477
|
+
`${SUPPORTED_RUNTIME} A Vue app container has no live root component; confirm the app mounted without an error.`
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
if (instance2.vapor === true) {
|
|
1481
|
+
return unavailable(
|
|
1482
|
+
`${SUPPORTED_RUNTIME} Vue Vapor components are not supported on the Canvas yet; render this storyboard with the virtual-DOM runtime (createApp, no vapor attribute).`
|
|
1483
|
+
);
|
|
1484
|
+
}
|
|
1485
|
+
if (!hasDevelopmentHooks(root, container)) {
|
|
1486
|
+
return unavailable(
|
|
1487
|
+
`${SUPPORTED_RUNTIME} The rendered app carries no Vue element metadata; confirm the app is not serving a production/minified build.`
|
|
1488
|
+
);
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
return { kind: "supported" };
|
|
1492
|
+
}
|
|
1493
|
+
function readVueAppContainers(root) {
|
|
1494
|
+
const containers = [];
|
|
1495
|
+
const visit2 = (element) => {
|
|
1496
|
+
const isForeignRoot = element !== root && element.hasAttribute(PROJECTION_ROOT_ATTRIBUTE);
|
|
1497
|
+
if (isForeignRoot) return;
|
|
1498
|
+
if (isVueAppContainer(element)) {
|
|
1499
|
+
containers.push(element);
|
|
1500
|
+
return;
|
|
1501
|
+
}
|
|
1502
|
+
for (const child of Array.from(element.children)) visit2(child);
|
|
1503
|
+
};
|
|
1504
|
+
visit2(root);
|
|
1505
|
+
return containers;
|
|
1506
|
+
}
|
|
1507
|
+
function carriesTempoVueStamps(container) {
|
|
1508
|
+
return container.querySelector("[data-tempo-filepath][data-tempo-position]") !== null;
|
|
1509
|
+
}
|
|
1510
|
+
function isVueAppContainer(element) {
|
|
1511
|
+
return isRecord2(element.__vue_app__);
|
|
1512
|
+
}
|
|
1513
|
+
function isVueRenderedElement(element) {
|
|
1514
|
+
return isRecord2(element.__vnode);
|
|
1515
|
+
}
|
|
1516
|
+
function readVueRootInstance(container) {
|
|
1517
|
+
return opaque(readRawRootInstance(container));
|
|
1518
|
+
}
|
|
1519
|
+
function readVueOwnerInstance(node) {
|
|
1520
|
+
let element = node.nodeType === 1 ? node : node.parentElement;
|
|
1521
|
+
for (let depth = 0; element && depth < MAX_DEPTH; depth += 1) {
|
|
1522
|
+
const owner = element.__vueParentComponent;
|
|
1523
|
+
if (isRawInstance(owner)) return opaque(owner);
|
|
1524
|
+
if (isVueAppContainer(element)) return readVueRootInstance(element);
|
|
1525
|
+
element = element.parentElement;
|
|
1526
|
+
}
|
|
1527
|
+
return null;
|
|
1528
|
+
}
|
|
1529
|
+
function readVueParentInstance(instance2) {
|
|
1530
|
+
const parent = raw(instance2).parent;
|
|
1531
|
+
return isRawInstance(parent) ? opaque(parent) : null;
|
|
1532
|
+
}
|
|
1533
|
+
function isVueInstanceUnmounted(instance2) {
|
|
1534
|
+
return raw(instance2).isUnmounted === true;
|
|
1535
|
+
}
|
|
1536
|
+
function isVueAnonymousAppRoot(instance2) {
|
|
1537
|
+
return readVueParentInstance(instance2) === null && readDefinitionFile(raw(instance2).type) === null;
|
|
1538
|
+
}
|
|
1539
|
+
function readVueHotUpdateId(instance2) {
|
|
1540
|
+
const type = raw(instance2).type;
|
|
1541
|
+
const id = isRecord2(type) ? type.__hmrId : void 0;
|
|
1542
|
+
return typeof id === "string" && id.length > 0 ? id : null;
|
|
1543
|
+
}
|
|
1544
|
+
function readVueInstanceOutput(instance2) {
|
|
1545
|
+
const value = raw(instance2);
|
|
1546
|
+
if (value.vapor === true) return [];
|
|
1547
|
+
const output = [];
|
|
1548
|
+
visit(value.subTree, output, 0);
|
|
1549
|
+
return output;
|
|
1550
|
+
}
|
|
1551
|
+
function readVueElementOutput(element) {
|
|
1552
|
+
const vnode = readElementVNode(element);
|
|
1553
|
+
if (!vnode) return null;
|
|
1554
|
+
if (shapeFlag(vnode) & SHAPE_ARRAY_CHILDREN && Array.isArray(vnode.children)) {
|
|
1555
|
+
const output2 = [];
|
|
1556
|
+
for (const child of vnode.children) visit(child, output2, 1);
|
|
1557
|
+
return output2;
|
|
1558
|
+
}
|
|
1559
|
+
const props = isRecord2(vnode.props) ? vnode.props : {};
|
|
1560
|
+
const markup = props.innerHTML != null;
|
|
1561
|
+
const text = Boolean(shapeFlag(vnode) & SHAPE_TEXT_CHILDREN) || props.textContent != null;
|
|
1562
|
+
const output = [];
|
|
1563
|
+
for (const node of Array.from(element.childNodes)) {
|
|
1564
|
+
if (node.nodeType === 3) {
|
|
1565
|
+
if (markup) output.push({ kind: "dom", node, authored: false });
|
|
1566
|
+
else if (text || node.nodeValue)
|
|
1567
|
+
output.push({ kind: "text", node });
|
|
1568
|
+
} else if (node.nodeType === 8) {
|
|
1569
|
+
if (markup) output.push({ kind: "dom", node, authored: false });
|
|
1570
|
+
} else if (node.nodeType === 1 && !isVueRenderedElement(node)) {
|
|
1571
|
+
output.push({ kind: "dom", node, authored: false });
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
return output;
|
|
1575
|
+
}
|
|
1576
|
+
function readVueDefinition(instance2) {
|
|
1577
|
+
const type = raw(instance2).type;
|
|
1578
|
+
const named = type;
|
|
1579
|
+
const filename = readDefinitionFile(type);
|
|
1580
|
+
const declared = typeof type === "function" ? nonEmptyString(named.displayName) ?? nonEmptyString(named.name) : nonEmptyString(named.name);
|
|
1581
|
+
return {
|
|
1582
|
+
filename,
|
|
1583
|
+
name: declared ?? nonEmptyString(named.__name) ?? (filename ? basename(filename) : null) ?? "Anonymous"
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1586
|
+
function readVueInvocation(instance2, registry) {
|
|
1587
|
+
const vnode = raw(instance2).vnode;
|
|
1588
|
+
if (!isRecord2(vnode)) return null;
|
|
1589
|
+
const position = readInvocationPosition(vnode.props);
|
|
1590
|
+
if (position === null) return null;
|
|
1591
|
+
let owner = vnode.ctx;
|
|
1592
|
+
for (let depth = 0; isRawInstance(owner) && isTransparentWrapper(owner) && depth < MAX_DEPTH; depth += 1) {
|
|
1593
|
+
owner = isRecord2(owner.vnode) ? owner.vnode.ctx : null;
|
|
1594
|
+
}
|
|
1595
|
+
if (!isRawInstance(owner)) return null;
|
|
1596
|
+
const filename = readDefinitionFile(owner.type);
|
|
1597
|
+
const source = filename ? registry.byFilename(filename) : null;
|
|
1598
|
+
const component = source ? componentAt(source, position) : null;
|
|
1599
|
+
return source && component ? { source, component } : null;
|
|
1600
|
+
}
|
|
1601
|
+
function readVueHostRecord(element, registry) {
|
|
1602
|
+
const filepath = element.getAttribute("data-tempo-filepath");
|
|
1603
|
+
const position = Number(element.getAttribute("data-tempo-position") ?? "");
|
|
1604
|
+
if (!filepath || !Number.isInteger(position)) return null;
|
|
1605
|
+
const source = registry.byFilepath(filepath);
|
|
1606
|
+
const host = source ? hostAt(source, position) : null;
|
|
1607
|
+
return source && host ? { source, host } : null;
|
|
1608
|
+
}
|
|
1609
|
+
function readVueComponentStyleCapability(instance2, invocation, registry) {
|
|
1610
|
+
const forwards = forwardsRootAttributes(raw(instance2), registry);
|
|
1611
|
+
return {
|
|
1612
|
+
supportsClassName: invocation.component.supportsClassName && forwards,
|
|
1613
|
+
supportsStyle: invocation.component.supportsStyle && forwards
|
|
1614
|
+
};
|
|
1615
|
+
}
|
|
1616
|
+
var parsedRecords = /* @__PURE__ */ new WeakMap();
|
|
1617
|
+
function readVueSourceRegistry(root) {
|
|
1618
|
+
const view = root.ownerDocument.defaultView;
|
|
1619
|
+
const value = view?.[TEMPO_VUE_SOURCE_REGISTRY_GLOBAL];
|
|
1620
|
+
if (!isRecord2(value)) return null;
|
|
1621
|
+
const byFilepath = /* @__PURE__ */ new Map();
|
|
1622
|
+
for (const entry of Object.values(value)) {
|
|
1623
|
+
const parsed = parseRecordCached(entry);
|
|
1624
|
+
if (parsed) byFilepath.set(parsed.filepath, parsed);
|
|
1625
|
+
}
|
|
1626
|
+
let byFilename = null;
|
|
1627
|
+
return {
|
|
1628
|
+
byFilepath: (filepath) => byFilepath.get(filepath) ?? null,
|
|
1629
|
+
byFilename(filename) {
|
|
1630
|
+
if (!byFilename) {
|
|
1631
|
+
byFilename = /* @__PURE__ */ new Map();
|
|
1632
|
+
for (const record of byFilepath.values())
|
|
1633
|
+
byFilename.set(normalizeFile2(record.filename), record);
|
|
1634
|
+
}
|
|
1635
|
+
return byFilename.get(normalizeFile2(filename)) ?? null;
|
|
1636
|
+
}
|
|
1637
|
+
};
|
|
1638
|
+
}
|
|
1639
|
+
var HOT_UPDATE_LISTENERS = /* @__PURE__ */ Symbol.for(
|
|
1640
|
+
"tempo.iframe-projection.vue-hot-update-listeners"
|
|
1641
|
+
);
|
|
1642
|
+
function createVueHotUpdateObserver(listener) {
|
|
1643
|
+
const attached = /* @__PURE__ */ new Set();
|
|
1644
|
+
return {
|
|
1645
|
+
sync(root) {
|
|
1646
|
+
const view = root.ownerDocument.defaultView;
|
|
1647
|
+
const runtime = view ? view.__VUE_HMR_RUNTIME__ : void 0;
|
|
1648
|
+
if (!view || !isRecord2(runtime)) return;
|
|
1649
|
+
const listeners = hotUpdateListeners(view, runtime);
|
|
1650
|
+
listeners.add(listener);
|
|
1651
|
+
attached.add(listeners);
|
|
1652
|
+
},
|
|
1653
|
+
stop() {
|
|
1654
|
+
for (const listeners of attached) listeners.delete(listener);
|
|
1655
|
+
attached.clear();
|
|
1656
|
+
}
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1659
|
+
function hotUpdateListeners(view, runtime) {
|
|
1660
|
+
const existing = runtime[HOT_UPDATE_LISTENERS];
|
|
1661
|
+
if (typeof existing?.add === "function") return existing;
|
|
1662
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
1663
|
+
Object.defineProperty(runtime, HOT_UPDATE_LISTENERS, {
|
|
1664
|
+
value: listeners,
|
|
1665
|
+
configurable: true
|
|
1666
|
+
});
|
|
1667
|
+
for (const method of ["rerender", "reload"]) {
|
|
1668
|
+
const original = runtime[method];
|
|
1669
|
+
if (typeof original !== "function") continue;
|
|
1670
|
+
runtime[method] = function observedHotUpdate(...args) {
|
|
1671
|
+
try {
|
|
1672
|
+
return original.apply(this, args);
|
|
1673
|
+
} finally {
|
|
1674
|
+
const hotUpdateId = String(args[0]);
|
|
1675
|
+
if (listeners.size > 0)
|
|
1676
|
+
view.setTimeout(() => {
|
|
1677
|
+
for (const notify of [...listeners]) {
|
|
1678
|
+
try {
|
|
1679
|
+
notify(hotUpdateId);
|
|
1680
|
+
} catch {
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
}, 0);
|
|
1684
|
+
}
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
return listeners;
|
|
1688
|
+
}
|
|
1689
|
+
function raw(instance2) {
|
|
1690
|
+
return instance2;
|
|
1691
|
+
}
|
|
1692
|
+
function opaque(instance2) {
|
|
1693
|
+
return instance2;
|
|
1694
|
+
}
|
|
1695
|
+
function isRawInstance(value) {
|
|
1696
|
+
return isRecord2(value) && (isRecord2(value.type) || typeof value.type === "function") && (isRecord2(value.vnode) || value.vapor === true);
|
|
1697
|
+
}
|
|
1698
|
+
function readRawRootInstance(container) {
|
|
1699
|
+
const vnode = container._vnode;
|
|
1700
|
+
const instance2 = isRecord2(vnode) ? vnode.component : null;
|
|
1701
|
+
return isRawInstance(instance2) ? instance2 : null;
|
|
1702
|
+
}
|
|
1703
|
+
function isTransparentWrapper(instance2) {
|
|
1704
|
+
const type = instance2.type;
|
|
1705
|
+
if (!isRecord2(type) && typeof type !== "function") return false;
|
|
1706
|
+
const wrapper = type;
|
|
1707
|
+
return wrapper.__isKeepAlive === true || typeof wrapper.__asyncLoader === "function";
|
|
1708
|
+
}
|
|
1709
|
+
function visit(value, output, depth) {
|
|
1710
|
+
if (!isRecord2(value) || depth > MAX_DEPTH) return;
|
|
1711
|
+
const flags = shapeFlag(value);
|
|
1712
|
+
if (flags & SHAPE_COMPONENT) {
|
|
1713
|
+
const instance2 = value.component;
|
|
1714
|
+
if (!isRawInstance(instance2)) return;
|
|
1715
|
+
if (isTransparentWrapper(instance2)) {
|
|
1716
|
+
if (instance2.vapor !== true) visit(instance2.subTree, output, depth + 1);
|
|
1717
|
+
return;
|
|
1718
|
+
}
|
|
1719
|
+
output.push({
|
|
1720
|
+
kind: "component",
|
|
1721
|
+
instance: instance2
|
|
1722
|
+
});
|
|
1723
|
+
return;
|
|
1724
|
+
}
|
|
1725
|
+
if (flags & SHAPE_SUSPENSE) {
|
|
1726
|
+
const suspense = value.suspense;
|
|
1727
|
+
if (isRecord2(suspense)) visit(suspense.activeBranch, output, depth + 1);
|
|
1728
|
+
return;
|
|
1729
|
+
}
|
|
1730
|
+
if (flags & SHAPE_TELEPORT) {
|
|
1731
|
+
visitChildren(value.children, output, depth);
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
if (flags & SHAPE_ELEMENT) {
|
|
1735
|
+
if (isNode(value.el) && value.el.nodeType === 1)
|
|
1736
|
+
output.push({ kind: "element", element: value.el });
|
|
1737
|
+
return;
|
|
1738
|
+
}
|
|
1739
|
+
if (value.type === FRAGMENT) {
|
|
1740
|
+
pushTextNode(value.el, output);
|
|
1741
|
+
visitChildren(value.children, output, depth);
|
|
1742
|
+
pushTextNode(value.anchor, output);
|
|
1743
|
+
return;
|
|
1744
|
+
}
|
|
1745
|
+
if (value.type === TEXT) {
|
|
1746
|
+
pushTextNode(value.el, output);
|
|
1747
|
+
return;
|
|
1748
|
+
}
|
|
1749
|
+
if (value.type === COMMENT) {
|
|
1750
|
+
if (isAuthoredComment(value) && isNode(value.el) && value.el.nodeType === 8)
|
|
1751
|
+
output.push({ kind: "comment", node: value.el });
|
|
1752
|
+
return;
|
|
1753
|
+
}
|
|
1754
|
+
if (value.type === STATIC) {
|
|
1755
|
+
let node = isNode(value.el) ? value.el : null;
|
|
1756
|
+
for (let count = 0; node && count < 1e5; count += 1) {
|
|
1757
|
+
if (node.nodeType === 1 || node.nodeType === 3 || node.nodeType === 8)
|
|
1758
|
+
output.push({ kind: "dom", node, authored: true });
|
|
1759
|
+
if (node === value.anchor) break;
|
|
1760
|
+
node = node.nextSibling;
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
function isAuthoredComment(vnode) {
|
|
1765
|
+
const text = vnode.children;
|
|
1766
|
+
if (typeof text !== "string") return false;
|
|
1767
|
+
if (Array.isArray(vnode.dynamicChildren)) return false;
|
|
1768
|
+
return text !== V_IF_PLACEHOLDER_TEXT;
|
|
1769
|
+
}
|
|
1770
|
+
function readElementVNode(element) {
|
|
1771
|
+
let vnode = element.__vnode;
|
|
1772
|
+
for (let depth = 0; isRecord2(vnode) && shapeFlag(vnode) & SHAPE_COMPONENT && depth < MAX_DEPTH; depth += 1) {
|
|
1773
|
+
const instance2 = vnode.component;
|
|
1774
|
+
vnode = isRecord2(instance2) ? instance2.subTree : null;
|
|
1775
|
+
}
|
|
1776
|
+
return isRecord2(vnode) && vnode.el === element ? vnode : null;
|
|
1777
|
+
}
|
|
1778
|
+
function pushTextNode(value, output) {
|
|
1779
|
+
if (isNode(value) && value.nodeType === 3)
|
|
1780
|
+
output.push({ kind: "text", node: value });
|
|
1781
|
+
}
|
|
1782
|
+
function visitChildren(children, output, depth) {
|
|
1783
|
+
if (!Array.isArray(children)) return;
|
|
1784
|
+
for (const child of children) visit(child, output, depth + 1);
|
|
1785
|
+
}
|
|
1786
|
+
function readInvocationPosition(props) {
|
|
1787
|
+
if (!isRecord2(props)) return null;
|
|
1788
|
+
const hook = props.onVnodeBeforeMount;
|
|
1789
|
+
for (const handler of Array.isArray(hook) ? hook : [hook]) {
|
|
1790
|
+
if (typeof handler !== "function") continue;
|
|
1791
|
+
const position = readTempoVueInvocationMarker(handler.name);
|
|
1792
|
+
if (position !== null) return position;
|
|
1793
|
+
}
|
|
1794
|
+
return null;
|
|
1795
|
+
}
|
|
1796
|
+
function forwardsRootAttributes(instance2, registry) {
|
|
1797
|
+
let current = instance2;
|
|
1798
|
+
for (let depth = 0; current && depth < MAX_DEPTH; depth += 1) {
|
|
1799
|
+
const filename = readDefinitionFile(current.type);
|
|
1800
|
+
const record = filename ? registry.byFilename(filename) : null;
|
|
1801
|
+
if (record?.rootFallthrough === "single-element") return true;
|
|
1802
|
+
if (record?.rootFallthrough !== "single-component") return false;
|
|
1803
|
+
current = rootComponentInstance(current);
|
|
1443
1804
|
}
|
|
1444
|
-
return
|
|
1805
|
+
return false;
|
|
1806
|
+
}
|
|
1807
|
+
function rootComponentInstance(instance2) {
|
|
1808
|
+
let vnode = instance2.subTree;
|
|
1809
|
+
for (let depth = 0; isRecord2(vnode) && depth < MAX_DEPTH; depth += 1) {
|
|
1810
|
+
if (!(shapeFlag(vnode) & SHAPE_COMPONENT)) return null;
|
|
1811
|
+
const child = vnode.component;
|
|
1812
|
+
if (!isRawInstance(child)) return null;
|
|
1813
|
+
if (!isTransparentWrapper(child)) return child;
|
|
1814
|
+
vnode = child.subTree;
|
|
1815
|
+
}
|
|
1816
|
+
return null;
|
|
1817
|
+
}
|
|
1818
|
+
function hasDevelopmentHooks(root, container) {
|
|
1819
|
+
const view = root.ownerDocument.defaultView;
|
|
1820
|
+
if (isRecord2(view?.__VUE_HMR_RUNTIME__)) return true;
|
|
1821
|
+
const elements = container.querySelectorAll("*");
|
|
1822
|
+
if (elements.length === 0) return true;
|
|
1823
|
+
for (const element of elements) {
|
|
1824
|
+
if (isRecord2(element.__vnode)) return true;
|
|
1825
|
+
}
|
|
1826
|
+
return false;
|
|
1827
|
+
}
|
|
1828
|
+
function readAppVersion(container) {
|
|
1829
|
+
const app = container.__vue_app__;
|
|
1830
|
+
return isRecord2(app) && typeof app.version === "string" ? app.version : null;
|
|
1831
|
+
}
|
|
1832
|
+
function isSupportedVueVersion(version) {
|
|
1833
|
+
const [major, minor] = version.split(".").map(Number);
|
|
1834
|
+
return major === 3 && (minor ?? 0) >= 3;
|
|
1835
|
+
}
|
|
1836
|
+
function parseRecordCached(value) {
|
|
1837
|
+
if (!isRecord2(value)) return null;
|
|
1838
|
+
let parsed = parsedRecords.get(value);
|
|
1839
|
+
if (parsed === void 0) {
|
|
1840
|
+
parsed = parseRecord(value);
|
|
1841
|
+
parsedRecords.set(value, parsed);
|
|
1842
|
+
}
|
|
1843
|
+
return parsed?.record ?? null;
|
|
1844
|
+
}
|
|
1845
|
+
function componentAt(record, position) {
|
|
1846
|
+
return indexFor(record)?.components.get(position) ?? null;
|
|
1847
|
+
}
|
|
1848
|
+
function hostAt(record, position) {
|
|
1849
|
+
return indexFor(record)?.hosts.get(position) ?? null;
|
|
1850
|
+
}
|
|
1851
|
+
var recordIndexes = /* @__PURE__ */ new WeakMap();
|
|
1852
|
+
function indexFor(record) {
|
|
1853
|
+
return recordIndexes.get(record) ?? null;
|
|
1854
|
+
}
|
|
1855
|
+
function parseRecord(value) {
|
|
1856
|
+
if (typeof value.filename !== "string" || value.filename.length === 0 || typeof value.filepath !== "string" || value.filepath.length === 0 || !isNonNegativeInteger2(value.modifiedTs) || typeof value.sourceVersion !== "string" || value.sourceVersion.length === 0 || !Array.isArray(value.components) || !Array.isArray(value.hosts)) {
|
|
1857
|
+
return null;
|
|
1858
|
+
}
|
|
1859
|
+
const components = value.components.map(parseComponent).filter((entry) => entry !== null);
|
|
1860
|
+
const hosts = value.hosts.map(parseHost).filter((entry) => entry !== null);
|
|
1861
|
+
const record = {
|
|
1862
|
+
filename: value.filename,
|
|
1863
|
+
filepath: value.filepath,
|
|
1864
|
+
modifiedTs: value.modifiedTs,
|
|
1865
|
+
sourceVersion: value.sourceVersion,
|
|
1866
|
+
components,
|
|
1867
|
+
hosts,
|
|
1868
|
+
rootFallthrough: isRootFallthrough(value.rootFallthrough) ? value.rootFallthrough : "unknown"
|
|
1869
|
+
};
|
|
1870
|
+
const parsed = {
|
|
1871
|
+
record,
|
|
1872
|
+
hosts: new Map(hosts.map((host) => [host.position, host])),
|
|
1873
|
+
components: new Map(
|
|
1874
|
+
components.map((component) => [component.position, component])
|
|
1875
|
+
)
|
|
1876
|
+
};
|
|
1877
|
+
recordIndexes.set(record, parsed);
|
|
1878
|
+
return parsed;
|
|
1879
|
+
}
|
|
1880
|
+
function readTargetFields(value, kind) {
|
|
1881
|
+
if (!isRecord2(value) || value.kind !== kind || typeof value.name !== "string" || !isNonNegativeInteger2(value.position) || typeof value.supportsClassName !== "boolean" || typeof value.supportsStyle !== "boolean") {
|
|
1882
|
+
return null;
|
|
1883
|
+
}
|
|
1884
|
+
return {
|
|
1885
|
+
name: value.name,
|
|
1886
|
+
position: value.position,
|
|
1887
|
+
className: typeof value.className === "string" ? value.className : void 0,
|
|
1888
|
+
style: typeof value.style === "string" ? value.style : void 0,
|
|
1889
|
+
supportsClassName: value.supportsClassName,
|
|
1890
|
+
supportsStyle: value.supportsStyle
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1893
|
+
function parseHost(value) {
|
|
1894
|
+
const fields = readTargetFields(value, "host");
|
|
1895
|
+
return fields && { kind: "host", ...fields };
|
|
1896
|
+
}
|
|
1897
|
+
function parseComponent(value) {
|
|
1898
|
+
const fields = readTargetFields(value, "component");
|
|
1899
|
+
if (!fields || !isRecord2(value)) return null;
|
|
1900
|
+
return {
|
|
1901
|
+
kind: "component",
|
|
1902
|
+
...fields,
|
|
1903
|
+
locked: typeof value.locked === "boolean" ? value.locked : void 0,
|
|
1904
|
+
expressions: typeof value.expressions === "string" ? value.expressions : void 0,
|
|
1905
|
+
literalProps: readLiteralProps(value.literalProps)
|
|
1906
|
+
};
|
|
1907
|
+
}
|
|
1908
|
+
function readLiteralProps(value) {
|
|
1909
|
+
if (!isRecord2(value) || !Object.values(value).every(isJsonValue))
|
|
1910
|
+
return void 0;
|
|
1911
|
+
return value;
|
|
1912
|
+
}
|
|
1913
|
+
function isJsonValue(value, depth = 0) {
|
|
1914
|
+
if (depth > MAX_DEPTH) return false;
|
|
1915
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
1916
|
+
return true;
|
|
1917
|
+
if (typeof value === "number") return Number.isFinite(value);
|
|
1918
|
+
if (Array.isArray(value))
|
|
1919
|
+
return value.every((item) => isJsonValue(item, depth + 1));
|
|
1920
|
+
return isRecord2(value) && Object.getPrototypeOf(value) === Object.prototype && Object.values(value).every((item) => isJsonValue(item, depth + 1));
|
|
1921
|
+
}
|
|
1922
|
+
var ROOT_FALLTHROUGHS = /* @__PURE__ */ new Set([
|
|
1923
|
+
"single-element",
|
|
1924
|
+
"single-component",
|
|
1925
|
+
"multi-root",
|
|
1926
|
+
"inherit-attrs-false",
|
|
1927
|
+
"explicit-attrs",
|
|
1928
|
+
"unknown"
|
|
1929
|
+
]);
|
|
1930
|
+
function isRootFallthrough(value) {
|
|
1931
|
+
return ROOT_FALLTHROUGHS.has(value);
|
|
1932
|
+
}
|
|
1933
|
+
function readDefinitionFile(type) {
|
|
1934
|
+
if (!isRecord2(type) && typeof type !== "function") return null;
|
|
1935
|
+
const file = type.__file;
|
|
1936
|
+
return typeof file === "string" && file.length > 0 ? normalizeFile2(file) : null;
|
|
1937
|
+
}
|
|
1938
|
+
function shapeFlag(vnode) {
|
|
1939
|
+
return typeof vnode.shapeFlag === "number" ? vnode.shapeFlag : 0;
|
|
1940
|
+
}
|
|
1941
|
+
function basename(filename) {
|
|
1942
|
+
return filename.slice(filename.lastIndexOf("/") + 1).replace(/\.[^.]+$/, "");
|
|
1943
|
+
}
|
|
1944
|
+
function normalizeFile2(value) {
|
|
1945
|
+
return value.replace(/^file:\/\//, "").replace(/\\/g, "/");
|
|
1946
|
+
}
|
|
1947
|
+
function nonEmptyString(value) {
|
|
1948
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
1949
|
+
}
|
|
1950
|
+
function unavailable(message) {
|
|
1951
|
+
return { kind: "unavailable", message };
|
|
1952
|
+
}
|
|
1953
|
+
function isNode(value) {
|
|
1954
|
+
return isRecord2(value) && typeof value.nodeType === "number";
|
|
1955
|
+
}
|
|
1956
|
+
function isRecord2(value) {
|
|
1957
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1958
|
+
}
|
|
1959
|
+
function isNonNegativeInteger2(value) {
|
|
1960
|
+
return Number.isInteger(value) && value >= 0;
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
// ../../modules/iframe-projection/combined/projection-vue-layers.ts
|
|
1964
|
+
var VUE_LAYER_ROOT_ID = "vue:$projection-root";
|
|
1965
|
+
var ROOT_ANCHOR = { kind: "root" };
|
|
1966
|
+
function createProjectionVueLayerSerializer() {
|
|
1967
|
+
const ids = /* @__PURE__ */ new WeakMap();
|
|
1968
|
+
let publishedInstances = /* @__PURE__ */ new WeakSet();
|
|
1969
|
+
let publishedHosts = /* @__PURE__ */ new WeakMap();
|
|
1970
|
+
let publishedHotUpdateIds = /* @__PURE__ */ new Set();
|
|
1971
|
+
let requestBaseline = null;
|
|
1972
|
+
const hotUpdates = createVueHotUpdateObserver((hotUpdateId) => {
|
|
1973
|
+
if (publishedHotUpdateIds.has(hotUpdateId)) requestBaseline?.();
|
|
1974
|
+
});
|
|
1975
|
+
function id(value) {
|
|
1976
|
+
const existing = ids.get(value);
|
|
1977
|
+
if (existing) return existing;
|
|
1978
|
+
const assigned = nextProjectionId();
|
|
1979
|
+
ids.set(value, assigned);
|
|
1980
|
+
return assigned;
|
|
1981
|
+
}
|
|
1982
|
+
function hostLayerId(session, element) {
|
|
1983
|
+
return domIdFor(session, element) ?? id(element);
|
|
1984
|
+
}
|
|
1985
|
+
function domIdFor(session, element) {
|
|
1986
|
+
return session.root.contains(element) ? ensureProjectionDomId(element) : null;
|
|
1987
|
+
}
|
|
1988
|
+
function createSession(root, observedFiles) {
|
|
1989
|
+
if (requestBaseline) hotUpdates.sync(root);
|
|
1990
|
+
const observed = new ProjectionObservedFileAccumulator();
|
|
1991
|
+
observed.merge(observedFiles);
|
|
1992
|
+
return { root, registry: readVueSourceRegistry(root), observed };
|
|
1993
|
+
}
|
|
1994
|
+
function rootNode(session) {
|
|
1995
|
+
const { root } = session;
|
|
1996
|
+
return {
|
|
1997
|
+
kind: "fragment",
|
|
1998
|
+
runtime: "vue",
|
|
1999
|
+
id: id(root),
|
|
2000
|
+
key: null,
|
|
2001
|
+
name: "vue-root",
|
|
2002
|
+
domId: null,
|
|
2003
|
+
elementTag: null,
|
|
2004
|
+
source: {
|
|
2005
|
+
kind: "react-fiber",
|
|
2006
|
+
fiber: {
|
|
2007
|
+
tag: FiberTag.HostRoot,
|
|
2008
|
+
name: "vue-root",
|
|
2009
|
+
id: VUE_LAYER_ROOT_ID
|
|
2010
|
+
}
|
|
2011
|
+
},
|
|
2012
|
+
children: isVueAppContainer(root) ? appChildren(session, root) : outsideAppChildren(session, root)
|
|
2013
|
+
};
|
|
2014
|
+
}
|
|
2015
|
+
function outsideAppChildren(session, parent) {
|
|
2016
|
+
const nodes = [];
|
|
2017
|
+
for (const child of Array.from(parent.childNodes)) {
|
|
2018
|
+
if (child.nodeType === 3 || child.nodeType === 8) {
|
|
2019
|
+
const text = serializeDomLayerNode(session.root, child);
|
|
2020
|
+
if (text) nodes.push(text);
|
|
2021
|
+
continue;
|
|
2022
|
+
}
|
|
2023
|
+
if (child.nodeType !== 1) continue;
|
|
2024
|
+
const element = child;
|
|
2025
|
+
if (element.localName === "script" || element.hasAttribute(PROJECTION_ROOT_ATTRIBUTE))
|
|
2026
|
+
continue;
|
|
2027
|
+
if (isVueAppContainer(element)) {
|
|
2028
|
+
nodes.push(hostNode(session, element, appChildren(session, element)));
|
|
2029
|
+
continue;
|
|
2030
|
+
}
|
|
2031
|
+
if (isVueRenderedElement(element)) continue;
|
|
2032
|
+
nodes.push(
|
|
2033
|
+
hostNode(session, element, outsideAppChildren(session, element))
|
|
2034
|
+
);
|
|
2035
|
+
}
|
|
2036
|
+
return nodes;
|
|
2037
|
+
}
|
|
2038
|
+
function appChildren(session, container) {
|
|
2039
|
+
const instance2 = readVueRootInstance(container);
|
|
2040
|
+
if (!instance2) return outsideAppChildren(session, container);
|
|
2041
|
+
return isVueAnonymousAppRoot(instance2) ? rendered(session, readVueInstanceOutput(instance2)) : [componentNode(session, instance2)];
|
|
2042
|
+
}
|
|
2043
|
+
function rendered(session, nodes) {
|
|
2044
|
+
const layers = [];
|
|
2045
|
+
for (const node of nodes) {
|
|
2046
|
+
if (node.kind === "component")
|
|
2047
|
+
layers.push(componentNode(session, node.instance));
|
|
2048
|
+
else if (node.kind === "element")
|
|
2049
|
+
layers.push(
|
|
2050
|
+
hostNode(
|
|
2051
|
+
session,
|
|
2052
|
+
node.element,
|
|
2053
|
+
rendered(session, readVueElementOutput(node.element) ?? [])
|
|
2054
|
+
)
|
|
2055
|
+
);
|
|
2056
|
+
else if (node.kind === "text" || node.kind === "comment")
|
|
2057
|
+
layers.push(...characterDataNode(session, node.node));
|
|
2058
|
+
else layers.push(...unownedDom(session, node.node, node.authored));
|
|
2059
|
+
}
|
|
2060
|
+
return layers;
|
|
2061
|
+
}
|
|
2062
|
+
function unownedDom(session, node, authored) {
|
|
2063
|
+
if (node.nodeType === 3 || node.nodeType === 8)
|
|
2064
|
+
return characterDataNode(session, node);
|
|
2065
|
+
if (node.nodeType !== 1) return [];
|
|
2066
|
+
const element = node;
|
|
2067
|
+
if (element.localName === "script") return [];
|
|
2068
|
+
const children = Array.from(element.childNodes).flatMap(
|
|
2069
|
+
(child) => unownedDom(session, child, authored)
|
|
2070
|
+
);
|
|
2071
|
+
return [hostNode(session, element, children, authored)];
|
|
2072
|
+
}
|
|
2073
|
+
function characterDataNode(session, node) {
|
|
2074
|
+
if (!session.root.contains(node)) return [];
|
|
2075
|
+
const text = serializeDomLayerNode(session.root, node);
|
|
2076
|
+
return text ? [text] : [];
|
|
2077
|
+
}
|
|
2078
|
+
function componentNode(session, instance2) {
|
|
2079
|
+
publishedInstances.add(instance2);
|
|
2080
|
+
const hotUpdateId = readVueHotUpdateId(instance2);
|
|
2081
|
+
if (hotUpdateId) publishedHotUpdateIds.add(hotUpdateId);
|
|
2082
|
+
const { name } = readVueDefinition(instance2);
|
|
2083
|
+
const layerId = id(instance2);
|
|
2084
|
+
const props = componentProps(session, instance2);
|
|
2085
|
+
return {
|
|
2086
|
+
kind: "component",
|
|
2087
|
+
runtime: "vue",
|
|
2088
|
+
id: layerId,
|
|
2089
|
+
key: null,
|
|
2090
|
+
name,
|
|
2091
|
+
domId: null,
|
|
2092
|
+
elementTag: null,
|
|
2093
|
+
...props ? { props } : {},
|
|
2094
|
+
source: {
|
|
2095
|
+
kind: "react-fiber",
|
|
2096
|
+
fiber: { tag: FiberTag.FunctionComponent, name, id: layerId }
|
|
2097
|
+
},
|
|
2098
|
+
children: rendered(session, readVueInstanceOutput(instance2))
|
|
2099
|
+
};
|
|
2100
|
+
}
|
|
2101
|
+
function componentProps(session, instance2) {
|
|
2102
|
+
const { registry } = session;
|
|
2103
|
+
const invocation = registry ? readVueInvocation(instance2, registry) : null;
|
|
2104
|
+
if (!registry || !invocation) return void 0;
|
|
2105
|
+
const { source, component } = invocation;
|
|
2106
|
+
session.observed.add(
|
|
2107
|
+
source.filepath,
|
|
2108
|
+
source.modifiedTs,
|
|
2109
|
+
source.sourceVersion
|
|
2110
|
+
);
|
|
2111
|
+
const capability = readVueComponentStyleCapability(
|
|
2112
|
+
instance2,
|
|
2113
|
+
invocation,
|
|
2114
|
+
registry
|
|
2115
|
+
);
|
|
2116
|
+
return {
|
|
2117
|
+
...invocationSourceLayerProps(source, component),
|
|
2118
|
+
"data-tempo-supports-classname": capability.supportsClassName,
|
|
2119
|
+
"data-tempo-supports-style": capability.supportsStyle
|
|
2120
|
+
};
|
|
2121
|
+
}
|
|
2122
|
+
function hostNode(session, element, children, authored = true) {
|
|
2123
|
+
publishedHosts.set(element, authored);
|
|
2124
|
+
const name = element.tagName.toLowerCase();
|
|
2125
|
+
const domId = domIdFor(session, element);
|
|
2126
|
+
const layerId = domId ?? id(element);
|
|
2127
|
+
return {
|
|
2128
|
+
kind: "host",
|
|
2129
|
+
runtime: "vue",
|
|
2130
|
+
id: layerId,
|
|
2131
|
+
key: null,
|
|
2132
|
+
name,
|
|
2133
|
+
domId,
|
|
2134
|
+
elementTag: name,
|
|
2135
|
+
props: hostProps(session, element, authored),
|
|
2136
|
+
source: {
|
|
2137
|
+
kind: "react-fiber",
|
|
2138
|
+
fiber: { tag: FiberTag.HostComponent, name, id: layerId }
|
|
2139
|
+
},
|
|
2140
|
+
children
|
|
2141
|
+
};
|
|
2142
|
+
}
|
|
2143
|
+
function hostProps(session, element, authored) {
|
|
2144
|
+
if (!authored) {
|
|
2145
|
+
const live2 = captureProjectionDomLayerProps(element);
|
|
2146
|
+
const unlocated = Object.fromEntries(
|
|
2147
|
+
Object.entries(live2 ?? {}).filter(
|
|
2148
|
+
([key]) => !SOURCE_ANNOTATION_ATTRIBUTES.has(key)
|
|
2149
|
+
)
|
|
2150
|
+
);
|
|
2151
|
+
return Object.keys(unlocated).length > 0 ? unlocated : void 0;
|
|
2152
|
+
}
|
|
2153
|
+
const live = captureProjectionDomLayerProps(element, session.observed);
|
|
2154
|
+
const resolved = session.registry ? readVueHostRecord(element, session.registry) : null;
|
|
2155
|
+
if (!resolved) return live;
|
|
2156
|
+
const { host } = resolved;
|
|
2157
|
+
return {
|
|
2158
|
+
...live,
|
|
2159
|
+
"data-tempo-supports-classname": host.supportsClassName,
|
|
2160
|
+
"data-tempo-supports-style": host.supportsStyle
|
|
2161
|
+
};
|
|
2162
|
+
}
|
|
2163
|
+
function regionAnchorFor(session, target) {
|
|
2164
|
+
const { root } = session;
|
|
2165
|
+
if (target === root) return ROOT_ANCHOR;
|
|
2166
|
+
const container = nearestContainer(root, target);
|
|
2167
|
+
if (!container) return ROOT_ANCHOR;
|
|
2168
|
+
const appAnchor = container === root ? ROOT_ANCHOR : { kind: "container", container };
|
|
2169
|
+
if (target === container) return appAnchor;
|
|
2170
|
+
for (let instance2 = readVueOwnerInstance(target); instance2; instance2 = readVueParentInstance(instance2)) {
|
|
2171
|
+
if (isVueInstanceUnmounted(instance2)) continue;
|
|
2172
|
+
if (publishedInstances.has(instance2))
|
|
2173
|
+
return { kind: "component", instance: instance2, container };
|
|
2174
|
+
}
|
|
2175
|
+
return appAnchor;
|
|
2176
|
+
}
|
|
2177
|
+
function serializeRegion(session, anchor) {
|
|
2178
|
+
switch (anchor.kind) {
|
|
2179
|
+
case "root":
|
|
2180
|
+
return {
|
|
2181
|
+
targetFiberId: VUE_LAYER_ROOT_ID,
|
|
2182
|
+
targetId: id(session.root),
|
|
2183
|
+
tree: rootNode(session)
|
|
2184
|
+
};
|
|
2185
|
+
case "container": {
|
|
2186
|
+
const layerId = hostLayerId(session, anchor.container);
|
|
2187
|
+
return {
|
|
2188
|
+
targetFiberId: layerId,
|
|
2189
|
+
targetId: layerId,
|
|
2190
|
+
tree: hostNode(
|
|
2191
|
+
session,
|
|
2192
|
+
anchor.container,
|
|
2193
|
+
appChildren(session, anchor.container)
|
|
2194
|
+
)
|
|
2195
|
+
};
|
|
2196
|
+
}
|
|
2197
|
+
case "component": {
|
|
2198
|
+
const layerId = id(anchor.instance);
|
|
2199
|
+
return {
|
|
2200
|
+
targetFiberId: layerId,
|
|
2201
|
+
targetId: layerId,
|
|
2202
|
+
tree: componentNode(session, anchor.instance)
|
|
2203
|
+
};
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
return {
|
|
2208
|
+
serializeRoot(root, observedFiles = {}) {
|
|
2209
|
+
publishedInstances = /* @__PURE__ */ new WeakSet();
|
|
2210
|
+
publishedHosts = /* @__PURE__ */ new WeakMap();
|
|
2211
|
+
publishedHotUpdateIds = /* @__PURE__ */ new Set();
|
|
2212
|
+
const session = createSession(root, observedFiles);
|
|
2213
|
+
const tree = rootNode(session);
|
|
2214
|
+
return {
|
|
2215
|
+
semantic: { kind: "layers", tree },
|
|
2216
|
+
observedFiles: session.observed.snapshot()
|
|
2217
|
+
};
|
|
2218
|
+
},
|
|
2219
|
+
capturePatch(root, targets, observedFiles = {}) {
|
|
2220
|
+
if (targets.structural.length === 0 && targets.metadata.length === 0) {
|
|
2221
|
+
return void 0;
|
|
2222
|
+
}
|
|
2223
|
+
const session = createSession(root, observedFiles);
|
|
2224
|
+
const inRoot = (element) => element === root || root.contains(element);
|
|
2225
|
+
const anchors = targets.structural.filter(inRoot).map((target) => regionAnchorFor(session, target));
|
|
2226
|
+
const metadataTargets = targets.metadata.filter(
|
|
2227
|
+
(target) => target !== root && inRoot(target) && publishedHosts.has(target)
|
|
2228
|
+
);
|
|
2229
|
+
const regions = widestAnchors(anchors);
|
|
2230
|
+
const regionTrees = regions.map(
|
|
2231
|
+
(anchor) => serializeRegion(session, anchor)
|
|
2232
|
+
);
|
|
2233
|
+
const metadata = metadataTargets.filter(
|
|
2234
|
+
(target) => !regions.some((anchor) => anchorCovers(anchor, target, root))
|
|
2235
|
+
).map((target) => {
|
|
2236
|
+
const layerId = hostLayerId(session, target);
|
|
2237
|
+
return {
|
|
2238
|
+
targetFiberId: layerId,
|
|
2239
|
+
targetId: layerId,
|
|
2240
|
+
props: hostProps(
|
|
2241
|
+
session,
|
|
2242
|
+
target,
|
|
2243
|
+
publishedHosts.get(target) === true
|
|
2244
|
+
)
|
|
2245
|
+
};
|
|
2246
|
+
});
|
|
2247
|
+
if (regionTrees.length === 0 && metadata.length === 0) return void 0;
|
|
2248
|
+
const patchObservedFiles = session.observed.snapshot();
|
|
2249
|
+
return {
|
|
2250
|
+
...regionTrees.length > 0 ? {
|
|
2251
|
+
regions: regionTrees.map((region) => ({
|
|
2252
|
+
...region,
|
|
2253
|
+
observedFiles: patchObservedFiles
|
|
2254
|
+
}))
|
|
2255
|
+
} : {},
|
|
2256
|
+
...metadata.length > 0 ? { metadata } : {}
|
|
2257
|
+
};
|
|
2258
|
+
},
|
|
2259
|
+
observeBaselineRequests(request) {
|
|
2260
|
+
requestBaseline = request;
|
|
2261
|
+
return () => {
|
|
2262
|
+
if (requestBaseline === request) requestBaseline = null;
|
|
2263
|
+
hotUpdates.stop();
|
|
2264
|
+
};
|
|
2265
|
+
}
|
|
2266
|
+
};
|
|
2267
|
+
}
|
|
2268
|
+
function nearestContainer(root, target) {
|
|
2269
|
+
for (let current = target; current; current = current.parentElement) {
|
|
2270
|
+
if (isVueAppContainer(current)) return current;
|
|
2271
|
+
if (current === root) return null;
|
|
2272
|
+
}
|
|
2273
|
+
return null;
|
|
2274
|
+
}
|
|
2275
|
+
function widestAnchors(anchors) {
|
|
2276
|
+
if (anchors.some((anchor) => anchor.kind === "root")) return [ROOT_ANCHOR];
|
|
2277
|
+
const unique = anchors.filter(
|
|
2278
|
+
(anchor, index) => anchors.findIndex((other) => sameAnchor(other, anchor)) === index
|
|
2279
|
+
);
|
|
2280
|
+
return unique.filter(
|
|
2281
|
+
(anchor) => !unique.some(
|
|
2282
|
+
(other) => !sameAnchor(other, anchor) && anchorContains(other, anchor)
|
|
2283
|
+
)
|
|
2284
|
+
);
|
|
2285
|
+
}
|
|
2286
|
+
function sameAnchor(left, right) {
|
|
2287
|
+
if (left.kind === "root" || right.kind === "root")
|
|
2288
|
+
return left.kind === right.kind;
|
|
2289
|
+
if (left.kind === "container" && right.kind === "container")
|
|
2290
|
+
return left.container === right.container;
|
|
2291
|
+
return left.kind === "component" && right.kind === "component" && left.instance === right.instance;
|
|
2292
|
+
}
|
|
2293
|
+
function anchorContains(outer, inner) {
|
|
2294
|
+
if (outer.kind === "root") return true;
|
|
2295
|
+
if (inner.kind === "root") return false;
|
|
2296
|
+
if (outer.kind === "container") return outer.container === inner.container;
|
|
2297
|
+
if (inner.kind === "container") return false;
|
|
2298
|
+
for (let instance2 = readVueParentInstance(inner.instance); instance2; instance2 = readVueParentInstance(instance2)) {
|
|
2299
|
+
if (instance2 === outer.instance) return true;
|
|
2300
|
+
}
|
|
2301
|
+
return false;
|
|
2302
|
+
}
|
|
2303
|
+
function anchorCovers(anchor, target, root) {
|
|
2304
|
+
if (anchor.kind === "root") return true;
|
|
2305
|
+
if (anchor.kind === "container")
|
|
2306
|
+
return anchor.container === target || anchor.container.contains(target);
|
|
2307
|
+
if (!root.contains(target)) return false;
|
|
2308
|
+
for (let instance2 = readVueOwnerInstance(target); instance2; instance2 = readVueParentInstance(instance2)) {
|
|
2309
|
+
if (instance2 === anchor.instance) return true;
|
|
2310
|
+
}
|
|
2311
|
+
return false;
|
|
1445
2312
|
}
|
|
1446
2313
|
|
|
1447
2314
|
// ../../modules/iframe-projection/combined/projection-layer-adapter.ts
|
|
@@ -1467,6 +2334,20 @@ function createProjectionLayerAdapter(layerFramework, watchedRoot, scope) {
|
|
|
1467
2334
|
},
|
|
1468
2335
|
scope
|
|
1469
2336
|
);
|
|
2337
|
+
case "vue":
|
|
2338
|
+
return createDomBackedLayerAdapter(
|
|
2339
|
+
"vue",
|
|
2340
|
+
createProjectionVueLayerSerializer(),
|
|
2341
|
+
(root) => {
|
|
2342
|
+
const validation = validateVueRuntimeMetadata(root);
|
|
2343
|
+
return validation.kind === "unavailable" ? {
|
|
2344
|
+
reason: "layer-metadata-unavailable",
|
|
2345
|
+
framework: "vue",
|
|
2346
|
+
message: validation.message
|
|
2347
|
+
} : null;
|
|
2348
|
+
},
|
|
2349
|
+
scope
|
|
2350
|
+
);
|
|
1470
2351
|
case "astro": {
|
|
1471
2352
|
if (!watchedRoot)
|
|
1472
2353
|
throw new Error("The Astro layer adapter needs its watched root");
|
|
@@ -1577,11 +2458,11 @@ function createReactLayerAdapter(watchedRoot, scope) {
|
|
|
1577
2458
|
return fiber;
|
|
1578
2459
|
},
|
|
1579
2460
|
resolveElementCandidate(element) {
|
|
1580
|
-
let
|
|
1581
|
-
for (let parent = element.parentElement; !
|
|
1582
|
-
|
|
1583
|
-
if (!
|
|
1584
|
-
const committed = resolveCommittedFiberOrNull(
|
|
2461
|
+
let raw2 = getFiberFromElement(element);
|
|
2462
|
+
for (let parent = element.parentElement; !raw2 && parent; parent = parent.parentElement)
|
|
2463
|
+
raw2 = getFiberFromElement(parent);
|
|
2464
|
+
if (!raw2) return null;
|
|
2465
|
+
const committed = resolveCommittedFiberOrNull(raw2);
|
|
1585
2466
|
if (!committed) return null;
|
|
1586
2467
|
let current = committed;
|
|
1587
2468
|
while (current && !isProjectionLayerFiber(current)) {
|
|
@@ -1652,9 +2533,9 @@ function resolveFullCaptureFiber(root, fiberTarget) {
|
|
|
1652
2533
|
if (!isText && !isElement) continue;
|
|
1653
2534
|
if (isElement && endpoint.getAttribute("data-tempo-hide-fiber") === "true")
|
|
1654
2535
|
continue;
|
|
1655
|
-
const
|
|
1656
|
-
if (!
|
|
1657
|
-
const committed = resolveCommittedFiber(
|
|
2536
|
+
const raw2 = getFiberFromElement(endpoint);
|
|
2537
|
+
if (!raw2) continue;
|
|
2538
|
+
const committed = resolveCommittedFiber(raw2);
|
|
1658
2539
|
others.push(committed);
|
|
1659
2540
|
}
|
|
1660
2541
|
if (others.length === 0) return ascendToAnnotatedComponentRoot(first);
|
|
@@ -1684,8 +2565,23 @@ function fiberOrAncestor(fiber, candidate) {
|
|
|
1684
2565
|
}
|
|
1685
2566
|
function createObservedLayerAdapter(watchedRoot, scope) {
|
|
1686
2567
|
const react = createReactLayerAdapter(watchedRoot, scope);
|
|
1687
|
-
const svelte = createProjectionLayerAdapter("svelte", watchedRoot, scope);
|
|
1688
2568
|
const astro = createProjectionLayerAdapter("astro", watchedRoot, scope);
|
|
2569
|
+
const probes = [
|
|
2570
|
+
{
|
|
2571
|
+
adapter: createProjectionLayerAdapter("vue", watchedRoot, scope),
|
|
2572
|
+
// `__vue_app__` marks a mounted app's container in every build.
|
|
2573
|
+
claims: isVueAppContainer,
|
|
2574
|
+
// A Vue mount writes nothing beside the app's container.
|
|
2575
|
+
isTransparent: () => false,
|
|
2576
|
+
authorsFile: (filepath) => filepath.endsWith(".vue")
|
|
2577
|
+
},
|
|
2578
|
+
{
|
|
2579
|
+
adapter: createProjectionLayerAdapter("svelte", watchedRoot, scope),
|
|
2580
|
+
claims: (element) => readSvelteElementMetadata(element) !== null,
|
|
2581
|
+
isTransparent: (element) => element.hasAttribute(TEMPO_SVELTE_SOURCE_REGISTRY_ATTRIBUTE),
|
|
2582
|
+
authorsFile: (filepath) => filepath.endsWith(".svelte")
|
|
2583
|
+
}
|
|
2584
|
+
];
|
|
1689
2585
|
let active = react;
|
|
1690
2586
|
return {
|
|
1691
2587
|
portalClosure: (fiber) => active.portalClosure?.(fiber) ?? { required: false, nodesVisited: 0 },
|
|
@@ -1696,31 +2592,20 @@ function createObservedLayerAdapter(watchedRoot, scope) {
|
|
|
1696
2592
|
return active.retainDomMutationTargets;
|
|
1697
2593
|
},
|
|
1698
2594
|
readProblem: (root) => active.readProblem(root),
|
|
2595
|
+
observeBaselineRequests(request) {
|
|
2596
|
+
const stops = [react, astro, ...probes.map((probe) => probe.adapter)].map(
|
|
2597
|
+
(adapter) => adapter.observeBaselineRequests?.(() => {
|
|
2598
|
+
if (active === adapter) request();
|
|
2599
|
+
})
|
|
2600
|
+
);
|
|
2601
|
+
return () => {
|
|
2602
|
+
for (const stop of stops) stop?.();
|
|
2603
|
+
};
|
|
2604
|
+
},
|
|
1699
2605
|
captureFull: (root, target, files) => active.captureFull(root, target, files),
|
|
1700
2606
|
capturePatch: (root, targets, files) => active.capturePatch(root, targets, files),
|
|
1701
2607
|
resolveCommittedRoot(fiberRoot, target) {
|
|
1702
|
-
|
|
1703
|
-
if (trackAstroSources(root.ownerDocument).hasAstro()) {
|
|
1704
|
-
active = astro;
|
|
1705
|
-
return active.resolveCommittedRoot(fiberRoot, target);
|
|
1706
|
-
}
|
|
1707
|
-
let element = root;
|
|
1708
|
-
let svelteRoot = false;
|
|
1709
|
-
while (element) {
|
|
1710
|
-
if (readSvelteElementMetadata(element) !== null) {
|
|
1711
|
-
svelteRoot = true;
|
|
1712
|
-
break;
|
|
1713
|
-
}
|
|
1714
|
-
const filepath = element.getAttribute("data-tempo-filepath");
|
|
1715
|
-
if (filepath && element.hasAttribute("data-tempo-position")) {
|
|
1716
|
-
svelteRoot = active === svelte && filepath.endsWith(".svelte");
|
|
1717
|
-
break;
|
|
1718
|
-
}
|
|
1719
|
-
element = Array.from(element.children).find(
|
|
1720
|
-
(child) => !child.hasAttribute(TEMPO_SVELTE_SOURCE_REGISTRY_ATTRIBUTE)
|
|
1721
|
-
);
|
|
1722
|
-
}
|
|
1723
|
-
active = svelteRoot ? svelte : react;
|
|
2608
|
+
active = trackAstroSources(target.element.ownerDocument).hasAstro() ? astro : probeTransparentPrefix(target.element, probes, active) ?? react;
|
|
1724
2609
|
return active.resolveCommittedRoot(fiberRoot, target);
|
|
1725
2610
|
},
|
|
1726
2611
|
resolveElementCandidate: (element) => active.resolveElementCandidate(element),
|
|
@@ -1730,11 +2615,31 @@ function createObservedLayerAdapter(watchedRoot, scope) {
|
|
|
1730
2615
|
captureSemanticSubtree: (target, id, options) => active.captureSemanticSubtree(target, id, options)
|
|
1731
2616
|
};
|
|
1732
2617
|
}
|
|
2618
|
+
function probeTransparentPrefix(root, probes, active) {
|
|
2619
|
+
let element = root;
|
|
2620
|
+
while (element) {
|
|
2621
|
+
const current = element;
|
|
2622
|
+
const claimed = probes.find((probe) => probe.claims(current));
|
|
2623
|
+
if (claimed) return claimed.adapter;
|
|
2624
|
+
const filepath = current.getAttribute("data-tempo-filepath");
|
|
2625
|
+
if (filepath && current.hasAttribute("data-tempo-position")) {
|
|
2626
|
+
const keeper = probes.find(
|
|
2627
|
+
(probe) => probe.adapter === active && probe.authorsFile(filepath)
|
|
2628
|
+
);
|
|
2629
|
+
return keeper?.adapter ?? null;
|
|
2630
|
+
}
|
|
2631
|
+
element = Array.from(current.children).find(
|
|
2632
|
+
(child) => !probes.some((probe) => probe.isTransparent(child))
|
|
2633
|
+
);
|
|
2634
|
+
}
|
|
2635
|
+
return null;
|
|
2636
|
+
}
|
|
1733
2637
|
function createDomBackedLayerAdapter(layerFramework, serializer, readProblem, scope) {
|
|
1734
2638
|
return {
|
|
1735
2639
|
layerFramework,
|
|
1736
2640
|
retainDomMutationTargets: true,
|
|
1737
2641
|
readProblem,
|
|
2642
|
+
observeBaselineRequests: serializer.observeBaselineRequests?.bind(serializer),
|
|
1738
2643
|
captureFull(root, _fiberTarget, observedFiles) {
|
|
1739
2644
|
const snapshot = serializer.serializeRoot(root, observedFiles);
|
|
1740
2645
|
return {
|
|
@@ -1791,9 +2696,9 @@ function createDomBackedLayerAdapter(layerFramework, serializer, readProblem, sc
|
|
|
1791
2696
|
};
|
|
1792
2697
|
}
|
|
1793
2698
|
function countLayerNodes(snapshot) {
|
|
1794
|
-
const
|
|
2699
|
+
const visit2 = (node) => 1 + (node.children ?? []).reduce((total, child) => total + visit2(child), 0);
|
|
1795
2700
|
return projectionLayerRoots(snapshot).reduce(
|
|
1796
|
-
(sum, node) => sum +
|
|
2701
|
+
(sum, node) => sum + visit2(node),
|
|
1797
2702
|
0
|
|
1798
2703
|
);
|
|
1799
2704
|
}
|
|
@@ -1832,8 +2737,8 @@ function resolveCommittedFiberOrNull(fiber) {
|
|
|
1832
2737
|
}
|
|
1833
2738
|
}
|
|
1834
2739
|
function resolveScopeFiber(root) {
|
|
1835
|
-
const
|
|
1836
|
-
return
|
|
2740
|
+
const raw2 = getFiberFromElement(root);
|
|
2741
|
+
return raw2 ? resolveCommittedFiberOrNull(raw2) : null;
|
|
1837
2742
|
}
|
|
1838
2743
|
function contentsSnapshot(snapshot, includeRoot = false) {
|
|
1839
2744
|
if (snapshot.semantic.kind !== "layers") return snapshot;
|
|
@@ -1854,7 +2759,7 @@ function normalizeContentsPatch(patch, scope) {
|
|
|
1854
2759
|
return {
|
|
1855
2760
|
...patch,
|
|
1856
2761
|
regions: patch.regions?.map(
|
|
1857
|
-
(region) => region.targetFiberId === DOM_LAYER_ROOT_ID || region.targetFiberId === SVELTE_LAYER_ROOT_ID || region.targetFiberId === ASTRO_LAYER_ROOT_ID ? {
|
|
2762
|
+
(region) => region.targetFiberId === DOM_LAYER_ROOT_ID || region.targetFiberId === SVELTE_LAYER_ROOT_ID || region.targetFiberId === VUE_LAYER_ROOT_ID || region.targetFiberId === ASTRO_LAYER_ROOT_ID ? {
|
|
1858
2763
|
...region,
|
|
1859
2764
|
targetId: PROJECTION_SCOPE_TARGET,
|
|
1860
2765
|
tree: null,
|
|
@@ -2303,16 +3208,16 @@ function findOwnedPortalRoots(root) {
|
|
|
2303
3208
|
const body = root.ownerDocument?.body;
|
|
2304
3209
|
if (!body) return [];
|
|
2305
3210
|
const portals = [];
|
|
2306
|
-
const
|
|
3211
|
+
const visit2 = (candidate) => {
|
|
2307
3212
|
if (candidate === root || root.contains(candidate)) return;
|
|
2308
3213
|
if (isElementOwnedByRoot(candidate, root)) {
|
|
2309
3214
|
portals.push(candidate);
|
|
2310
3215
|
return;
|
|
2311
3216
|
}
|
|
2312
3217
|
if (candidate.hasAttribute(PROJECTION_ROOT_ATTRIBUTE)) return;
|
|
2313
|
-
for (const child of Array.from(candidate.children))
|
|
3218
|
+
for (const child of Array.from(candidate.children)) visit2(child);
|
|
2314
3219
|
};
|
|
2315
|
-
for (const child of Array.from(body.children))
|
|
3220
|
+
for (const child of Array.from(body.children)) visit2(child);
|
|
2316
3221
|
return portals;
|
|
2317
3222
|
}
|
|
2318
3223
|
var PortalTrackerImpl = class {
|
|
@@ -3000,11 +3905,13 @@ function createCombinedDocumentProducer(options) {
|
|
|
3000
3905
|
}
|
|
3001
3906
|
const recoveredFromLayerProblem = runtime.layerProblem !== null;
|
|
3002
3907
|
runtime.layerProblem = null;
|
|
3003
|
-
|
|
3908
|
+
const waiting = isProjectionUnavailableOnly(runtime.options.element) ? "unavailable" : isProjectionPendingOnly(runtime.options.element) ? "suspended" : null;
|
|
3909
|
+
if (waiting !== null) {
|
|
3004
3910
|
runtime.deferredFullRequest || (runtime.deferredFullRequest = flushContext.fullRequested);
|
|
3005
|
-
if (runtime.
|
|
3006
|
-
|
|
3007
|
-
|
|
3911
|
+
if (runtime.waitingEpisode === waiting && !flushContext.fullRequested)
|
|
3912
|
+
return null;
|
|
3913
|
+
runtime.waitingEpisode = waiting;
|
|
3914
|
+
const problem = { reason: waiting };
|
|
3008
3915
|
captureStats.set(problem, {
|
|
3009
3916
|
perf: makePerf({
|
|
3010
3917
|
flushContext,
|
|
@@ -3022,8 +3929,8 @@ function createCombinedDocumentProducer(options) {
|
|
|
3022
3929
|
});
|
|
3023
3930
|
return { kind: "problem", problem };
|
|
3024
3931
|
}
|
|
3025
|
-
const endedSuspendedEpisode = runtime.
|
|
3026
|
-
runtime.
|
|
3932
|
+
const endedSuspendedEpisode = runtime.waitingEpisode !== null;
|
|
3933
|
+
runtime.waitingEpisode = null;
|
|
3027
3934
|
if (runtime.committedFiber === null && runtime.layerAdapter.layerFramework === "react")
|
|
3028
3935
|
clearPublishedHostProps(runtime);
|
|
3029
3936
|
const fullRequested = flushContext.fullRequested || runtime.deferredFullRequest || endedSuspendedEpisode || recoveredFromLayerProblem || runtime.publishedLayerFramework !== runtime.layerAdapter.layerFramework;
|
|
@@ -3168,7 +4075,9 @@ function createCombinedDocumentProducer(options) {
|
|
|
3168
4075
|
}
|
|
3169
4076
|
if (accumulated.kind === "patch" && runtime.layerAdapter.layerFramework === "react") {
|
|
3170
4077
|
const targets = accumulated.localDomLayerTargets;
|
|
3171
|
-
|
|
4078
|
+
const atFlutterRoot = (target) => flutterViewRootOf(target) ?? target;
|
|
4079
|
+
for (const target of targets?.structural ?? []) {
|
|
4080
|
+
const element = atFlutterRoot(target);
|
|
3172
4081
|
let candidate = runtime.layerAdapter.resolveElementCandidate(element);
|
|
3173
4082
|
if (!candidate) continue;
|
|
3174
4083
|
for (const child of Array.from(element.children)) {
|
|
@@ -3181,10 +4090,16 @@ function createCombinedDocumentProducer(options) {
|
|
|
3181
4090
|
}
|
|
3182
4091
|
addRegion(runtime, candidate);
|
|
3183
4092
|
}
|
|
3184
|
-
for (const
|
|
3185
|
-
|
|
4093
|
+
for (const target of targets?.metadata ?? []) {
|
|
4094
|
+
const element = atFlutterRoot(target);
|
|
3186
4095
|
const candidate = runtime.layerAdapter.resolveElementCandidate(element);
|
|
3187
|
-
if (candidate)
|
|
4096
|
+
if (!candidate) continue;
|
|
4097
|
+
if (isFlutterViewRoot(element)) {
|
|
4098
|
+
addRegion(runtime, candidate);
|
|
4099
|
+
continue;
|
|
4100
|
+
}
|
|
4101
|
+
if (getFiberFromElement(element)) continue;
|
|
4102
|
+
addRegion(runtime, candidate);
|
|
3188
4103
|
}
|
|
3189
4104
|
}
|
|
3190
4105
|
if (runtime.deferredFullRequest) return serveFull(false);
|
|
@@ -3371,10 +4286,15 @@ function createCombinedDocumentProducer(options) {
|
|
|
3371
4286
|
}
|
|
3372
4287
|
});
|
|
3373
4288
|
runtime.accumulator = accumulator;
|
|
4289
|
+
const stopBaselineRequests = runtime.layerAdapter.observeBaselineRequests?.(() => {
|
|
4290
|
+
if (stopped || runtime.dormant) return;
|
|
4291
|
+
core.requestFull(rootId, { trigger: "runtime-hot-update" });
|
|
4292
|
+
}) ?? null;
|
|
3374
4293
|
runtime.stopObserver = () => {
|
|
3375
4294
|
try {
|
|
3376
4295
|
accumulator.stop();
|
|
3377
4296
|
} finally {
|
|
4297
|
+
stopBaselineRequests?.();
|
|
3378
4298
|
unregisterRootObserver();
|
|
3379
4299
|
if (runtime.accumulator === accumulator) runtime.accumulator = null;
|
|
3380
4300
|
runtime.stopObserver = null;
|
|
@@ -3409,7 +4329,7 @@ function createCombinedDocumentProducer(options) {
|
|
|
3409
4329
|
publishedHostProps: /* @__PURE__ */ new Map(),
|
|
3410
4330
|
pendingMetadata: /* @__PURE__ */ new Map(),
|
|
3411
4331
|
semanticDiscoveryNodesVisited: 0,
|
|
3412
|
-
|
|
4332
|
+
waitingEpisode: null,
|
|
3413
4333
|
deferredFullRequest: false,
|
|
3414
4334
|
publishedLayerFramework: null
|
|
3415
4335
|
};
|
|
@@ -3432,7 +4352,7 @@ function createCombinedDocumentProducer(options) {
|
|
|
3432
4352
|
runtime.pendingRegions.clear();
|
|
3433
4353
|
runtime.pendingMetadata.clear();
|
|
3434
4354
|
runtime.semanticDiscoveryNodesVisited = 0;
|
|
3435
|
-
runtime.
|
|
4355
|
+
runtime.waitingEpisode = null;
|
|
3436
4356
|
runtime.deferredFullRequest = false;
|
|
3437
4357
|
}
|
|
3438
4358
|
function rebindRoot(rootId, previous, rootOptions, references) {
|
|
@@ -3754,7 +4674,7 @@ function retainSemanticCandidate(candidates, candidate) {
|
|
|
3754
4674
|
}
|
|
3755
4675
|
function collectChangedSemanticFibers(previous, current, runtime) {
|
|
3756
4676
|
let nodesVisited = 0;
|
|
3757
|
-
const
|
|
4677
|
+
const visit2 = (before, after, boundary2) => {
|
|
3758
4678
|
nodesVisited += 1;
|
|
3759
4679
|
if (before === after) return;
|
|
3760
4680
|
if (isProjectionRootFiber(after) && !(runtime.options.scope !== void 0 && runtime.committedFiber && fiberPair(after, runtime.committedFiber)))
|
|
@@ -3784,14 +4704,14 @@ function collectChangedSemanticFibers(previous, current, runtime) {
|
|
|
3784
4704
|
addRegion(runtime, nextBoundary);
|
|
3785
4705
|
return;
|
|
3786
4706
|
}
|
|
3787
|
-
|
|
4707
|
+
visit2(oldChild, newChild, nextBoundary);
|
|
3788
4708
|
oldChild = oldChild.sibling;
|
|
3789
4709
|
newChild = newChild.sibling;
|
|
3790
4710
|
}
|
|
3791
4711
|
if (oldChild || newChild) addRegion(runtime, nextBoundary);
|
|
3792
4712
|
};
|
|
3793
4713
|
const boundary = nearestProjectionBoundary(runtime, current);
|
|
3794
|
-
if (boundary)
|
|
4714
|
+
if (boundary) visit2(previous, current, boundary);
|
|
3795
4715
|
return nodesVisited;
|
|
3796
4716
|
}
|
|
3797
4717
|
function fiberPair(left, right) {
|
|
@@ -3889,34 +4809,9 @@ function projectionPropsEqual(before, after, adapter, publishedHostProps) {
|
|
|
3889
4809
|
const layoutMode = published?.layoutMode ?? null;
|
|
3890
4810
|
const right = adapter.captureMetadata(after, { layoutMode })?.props;
|
|
3891
4811
|
const left = adapter.captureMetadata(before, { layoutMode })?.props;
|
|
3892
|
-
const liveHostPropsEqual = published === void 0 || published.className === right?.className && published.layoutMode === right?.layoutMode && recordEqual(published.style, right?.style);
|
|
4812
|
+
const liveHostPropsEqual = published === void 0 || published.className === right?.className && published.layoutMode === right?.layoutMode && recordEqual(published.style, right?.style) && recordEqual(published.svg, svgLayerAttributesOf(right));
|
|
3893
4813
|
return liveHostPropsEqual && layerPropsEqual(left, right);
|
|
3894
4814
|
}
|
|
3895
|
-
function layerPropsEqual(left, right) {
|
|
3896
|
-
if (left === right) return true;
|
|
3897
|
-
if (!left || !right) return left === right;
|
|
3898
|
-
const leftEntries = Object.entries(left);
|
|
3899
|
-
const rightEntries = Object.entries(right);
|
|
3900
|
-
if (leftEntries.length !== rightEntries.length) return false;
|
|
3901
|
-
for (const [key, value] of leftEntries) {
|
|
3902
|
-
const other = right[key];
|
|
3903
|
-
if (key === "style") {
|
|
3904
|
-
if (!recordEqual(
|
|
3905
|
-
value,
|
|
3906
|
-
other
|
|
3907
|
-
)) {
|
|
3908
|
-
return false;
|
|
3909
|
-
}
|
|
3910
|
-
} else if (value !== other) return false;
|
|
3911
|
-
}
|
|
3912
|
-
return true;
|
|
3913
|
-
}
|
|
3914
|
-
function recordEqual(left, right) {
|
|
3915
|
-
if (left === right) return true;
|
|
3916
|
-
if (!left || !right) return left === right;
|
|
3917
|
-
const keys = Object.keys(left);
|
|
3918
|
-
return keys.length === Object.keys(right).length && keys.every((key) => left[key] === right[key]);
|
|
3919
|
-
}
|
|
3920
4815
|
function replacePublishedFile(runtime, previous, next) {
|
|
3921
4816
|
if (previous === next) return;
|
|
3922
4817
|
if (previous) {
|
|
@@ -3962,6 +4857,7 @@ function rememberPublishedHostProps(runtime, tree) {
|
|
|
3962
4857
|
className: node.props?.className,
|
|
3963
4858
|
layoutMode: node.props?.layoutMode,
|
|
3964
4859
|
style: node.props?.style,
|
|
4860
|
+
svg: svgLayerAttributesOf(node.props),
|
|
3965
4861
|
children: (node.children ?? []).map(
|
|
3966
4862
|
(child) => child.source?.fiber.id ?? child.id
|
|
3967
4863
|
)
|
|
@@ -3980,6 +4876,7 @@ function updatePublishedMetadata(runtime, metadata) {
|
|
|
3980
4876
|
className: metadata.props.className,
|
|
3981
4877
|
layoutMode: metadata.props.layoutMode,
|
|
3982
4878
|
style: metadata.props.style,
|
|
4879
|
+
svg: svgLayerAttributesOf(metadata.props),
|
|
3983
4880
|
children: previous.children
|
|
3984
4881
|
});
|
|
3985
4882
|
}
|
|
@@ -4176,8 +5073,16 @@ function aggregateBatchPerf(roots, head, context, capturedHeadMs, rootsPerBatch,
|
|
|
4176
5073
|
}
|
|
4177
5074
|
|
|
4178
5075
|
// ../../modules/iframe-projection/combined/layer-framework.ts
|
|
5076
|
+
var LAYER_FRAMEWORKS = [
|
|
5077
|
+
"react",
|
|
5078
|
+
"svelte",
|
|
5079
|
+
"vue",
|
|
5080
|
+
"astro",
|
|
5081
|
+
"dom",
|
|
5082
|
+
"auto"
|
|
5083
|
+
];
|
|
4179
5084
|
function isLayerFramework(value) {
|
|
4180
|
-
return value
|
|
5085
|
+
return LAYER_FRAMEWORKS.includes(value);
|
|
4181
5086
|
}
|
|
4182
5087
|
|
|
4183
5088
|
// ../../modules/iframe-projection/combined/projection-batch.ts
|
|
@@ -4305,7 +5210,7 @@ function finalizeDeclaration(hosts, missingDomIdCount) {
|
|
|
4305
5210
|
function declareFiberHostIdentity(tree) {
|
|
4306
5211
|
const hosts = [];
|
|
4307
5212
|
let missingDomIdCount = 0;
|
|
4308
|
-
const
|
|
5213
|
+
const visit2 = (node) => {
|
|
4309
5214
|
countIdentityNodeVisited();
|
|
4310
5215
|
if (node.insideContentEditable) return;
|
|
4311
5216
|
const renderNode = node;
|
|
@@ -4322,17 +5227,17 @@ function declareFiberHostIdentity(tree) {
|
|
|
4322
5227
|
if (isContentEditableBoundary(node.props)) return;
|
|
4323
5228
|
}
|
|
4324
5229
|
for (const child of node.children) {
|
|
4325
|
-
|
|
5230
|
+
visit2(child);
|
|
4326
5231
|
}
|
|
4327
5232
|
};
|
|
4328
|
-
|
|
5233
|
+
visit2(tree);
|
|
4329
5234
|
return finalizeDeclaration(hosts, missingDomIdCount);
|
|
4330
5235
|
}
|
|
4331
5236
|
function declareDomHostIdentity(captureRoot, supplementalRoots) {
|
|
4332
5237
|
const hosts = [];
|
|
4333
5238
|
let missingDomIdCount = 0;
|
|
4334
5239
|
const seenElements = /* @__PURE__ */ new Set();
|
|
4335
|
-
const
|
|
5240
|
+
const visit2 = (element) => {
|
|
4336
5241
|
if (seenElements.has(element)) return;
|
|
4337
5242
|
seenElements.add(element);
|
|
4338
5243
|
countIdentityNodeVisited();
|
|
@@ -4358,10 +5263,10 @@ function declareDomHostIdentity(captureRoot, supplementalRoots) {
|
|
|
4358
5263
|
}
|
|
4359
5264
|
}
|
|
4360
5265
|
if (element.getAttribute("contenteditable") !== null) return;
|
|
4361
|
-
for (const child of element.children)
|
|
5266
|
+
for (const child of element.children) visit2(child);
|
|
4362
5267
|
};
|
|
4363
|
-
for (const child of captureRoot.children)
|
|
4364
|
-
for (const root of supplementalRoots)
|
|
5268
|
+
for (const child of captureRoot.children) visit2(child);
|
|
5269
|
+
for (const root of supplementalRoots) visit2(root);
|
|
4365
5270
|
return finalizeDeclaration(hosts, missingDomIdCount);
|
|
4366
5271
|
}
|
|
4367
5272
|
function hostIdentityDeclarationsMatch(left, right) {
|
|
@@ -4405,7 +5310,7 @@ function computeObservedVersionsFromFiber(tree) {
|
|
|
4405
5310
|
}
|
|
4406
5311
|
}
|
|
4407
5312
|
};
|
|
4408
|
-
const
|
|
5313
|
+
const visit2 = (node) => {
|
|
4409
5314
|
const props = node.props;
|
|
4410
5315
|
record(
|
|
4411
5316
|
props?.["data-tempo-filepath"],
|
|
@@ -4413,10 +5318,10 @@ function computeObservedVersionsFromFiber(tree) {
|
|
|
4413
5318
|
props?.["data-tempo-source-version"]
|
|
4414
5319
|
);
|
|
4415
5320
|
for (const child of node.children) {
|
|
4416
|
-
|
|
5321
|
+
visit2(child);
|
|
4417
5322
|
}
|
|
4418
5323
|
};
|
|
4419
|
-
|
|
5324
|
+
visit2(tree);
|
|
4420
5325
|
return { observedVersions, observedSourceVersions };
|
|
4421
5326
|
}
|
|
4422
5327
|
function computeRenderDeclarations(fiber, html, hasReactRenderer, document2, identityScope) {
|
|
@@ -4459,7 +5364,7 @@ function fiberHostIdentitiesAreLive(fiber, document2) {
|
|
|
4459
5364
|
Array.from(document2.querySelectorAll("[data-dom-id]")).filter((element) => element.isConnected).map((element) => element.getAttribute("data-dom-id")).filter((domId) => domId !== null)
|
|
4460
5365
|
);
|
|
4461
5366
|
const seenFiberDomIds = /* @__PURE__ */ new Set();
|
|
4462
|
-
const
|
|
5367
|
+
const visit2 = (node) => {
|
|
4463
5368
|
if (node.domId) {
|
|
4464
5369
|
if (seenFiberDomIds.has(node.domId) || !liveDomIds.has(node.domId)) {
|
|
4465
5370
|
return false;
|
|
@@ -4467,10 +5372,10 @@ function fiberHostIdentitiesAreLive(fiber, document2) {
|
|
|
4467
5372
|
seenFiberDomIds.add(node.domId);
|
|
4468
5373
|
}
|
|
4469
5374
|
return node.children.every(
|
|
4470
|
-
(child) =>
|
|
5375
|
+
(child) => visit2(child)
|
|
4471
5376
|
);
|
|
4472
5377
|
};
|
|
4473
|
-
return
|
|
5378
|
+
return visit2(fiber);
|
|
4474
5379
|
}
|
|
4475
5380
|
|
|
4476
5381
|
// ../../modules/element-overlay/render/layout-kind.ts
|
|
@@ -4933,7 +5838,7 @@ function installWhenDocumentBodyReady(install2) {
|
|
|
4933
5838
|
installedCleanup = null;
|
|
4934
5839
|
};
|
|
4935
5840
|
}
|
|
4936
|
-
function
|
|
5841
|
+
function isRecord3(value) {
|
|
4937
5842
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4938
5843
|
}
|
|
4939
5844
|
function createProjectionSourceController(options) {
|
|
@@ -4998,7 +5903,7 @@ function createProjectionSourceController(options) {
|
|
|
4998
5903
|
};
|
|
4999
5904
|
return {
|
|
5000
5905
|
handleCommand(payload) {
|
|
5001
|
-
if (stopped || !
|
|
5906
|
+
if (stopped || !isRecord3(payload) || typeof payload.type !== "string") {
|
|
5002
5907
|
return false;
|
|
5003
5908
|
}
|
|
5004
5909
|
if (payload.type === "start-projection-watcher") {
|
|
@@ -6195,11 +7100,11 @@ function watchCanvasFrames(root, emitter, options = {}) {
|
|
|
6195
7100
|
}
|
|
6196
7101
|
|
|
6197
7102
|
// ../../modules/iframe-projection/canvas-frames/port-protocol.ts
|
|
6198
|
-
function
|
|
7103
|
+
function isRecord4(value) {
|
|
6199
7104
|
return typeof value === "object" && value !== null;
|
|
6200
7105
|
}
|
|
6201
7106
|
function isLaneCommand(value) {
|
|
6202
|
-
return
|
|
7107
|
+
return isRecord4(value) && typeof value.kind === "string" && value.kind.startsWith("canvas-frames:");
|
|
6203
7108
|
}
|
|
6204
7109
|
var DEFAULT_ROOT_POLL_MS = 250;
|
|
6205
7110
|
function serveCanvasFramesOverPort(port, options) {
|
|
@@ -6419,4 +7324,4 @@ function installTempoInteractProjectionSource() {
|
|
|
6419
7324
|
export {
|
|
6420
7325
|
installTempoInteractProjectionSource
|
|
6421
7326
|
};
|
|
6422
|
-
//# sourceMappingURL=chunk-
|
|
7327
|
+
//# sourceMappingURL=chunk-GKDDNDG3.js.map
|