@rindo/core 4.22.3 → 4.23.1
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/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/rindo.js +1730 -158
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +1506 -1161
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +1468 -1156
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +53 -39
- package/internal/package.json +1 -1
- package/internal/rindo-private.d.ts +72 -3
- package/internal/rindo-public-docs.d.ts +8 -0
- package/internal/testing/index.js +1478 -1166
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +20 -9
- package/mock-doc/index.js +20 -9
- package/mock-doc/package.json +1 -1
- package/package.json +2 -2
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +13 -13
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +12 -3
- package/testing/package.json +1 -1
|
@@ -31,7 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var platform_exports = {};
|
|
32
32
|
__export(platform_exports, {
|
|
33
33
|
Build: () => Build,
|
|
34
|
-
Env: () =>
|
|
34
|
+
Env: () => import_app_data22.Env,
|
|
35
35
|
Fragment: () => Fragment,
|
|
36
36
|
Host: () => Host,
|
|
37
37
|
addHostEventListeners: () => addHostEventListeners,
|
|
@@ -380,7 +380,7 @@ var isMemberInElement = (elm, memberName) => {
|
|
|
380
380
|
};
|
|
381
381
|
|
|
382
382
|
// src/testing/platform/index.ts
|
|
383
|
-
var
|
|
383
|
+
var import_app_data22 = require("@rindo/core/internal/app-data");
|
|
384
384
|
|
|
385
385
|
// src/runtime/asset-path.ts
|
|
386
386
|
var getAssetPath = (path) => {
|
|
@@ -390,7 +390,7 @@ var getAssetPath = (path) => {
|
|
|
390
390
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
391
391
|
|
|
392
392
|
// src/runtime/bootstrap-custom-element.ts
|
|
393
|
-
var
|
|
393
|
+
var import_app_data19 = require("@rindo/core/internal/app-data");
|
|
394
394
|
|
|
395
395
|
// src/utils/constants.ts
|
|
396
396
|
var EMPTY_OBJ = {};
|
|
@@ -398,7 +398,7 @@ var SVG_NS = "http://www.w3.org/2000/svg";
|
|
|
398
398
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
399
399
|
|
|
400
400
|
// src/utils/helpers.ts
|
|
401
|
-
var isDef = (v) => v != null;
|
|
401
|
+
var isDef = (v) => v != null && v !== void 0;
|
|
402
402
|
var isComplexType = (o) => {
|
|
403
403
|
o = typeof o;
|
|
404
404
|
return o === "object" || o === "function";
|
|
@@ -460,102 +460,20 @@ var unwrapErr = (result) => {
|
|
|
460
460
|
};
|
|
461
461
|
|
|
462
462
|
// src/runtime/connected-callback.ts
|
|
463
|
-
var
|
|
463
|
+
var import_app_data17 = require("@rindo/core/internal/app-data");
|
|
464
464
|
|
|
465
465
|
// src/runtime/client-hydrate.ts
|
|
466
|
-
var
|
|
466
|
+
var import_app_data8 = require("@rindo/core/internal/app-data");
|
|
467
467
|
|
|
468
|
-
// src/runtime/
|
|
469
|
-
var
|
|
470
|
-
var i = 0;
|
|
471
|
-
var createTime = (fnName, tagName = "") => {
|
|
472
|
-
if (import_app_data.BUILD.profile && performance.mark) {
|
|
473
|
-
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
474
|
-
performance.mark(key);
|
|
475
|
-
return () => performance.measure(`[Rindo] ${fnName}() <${tagName}>`, key);
|
|
476
|
-
} else {
|
|
477
|
-
return () => {
|
|
478
|
-
return;
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
};
|
|
482
|
-
var uniqueTime = (key, measureText) => {
|
|
483
|
-
if (import_app_data.BUILD.profile && performance.mark) {
|
|
484
|
-
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
485
|
-
performance.mark(key);
|
|
486
|
-
}
|
|
487
|
-
return () => {
|
|
488
|
-
if (performance.getEntriesByName(measureText, "measure").length === 0) {
|
|
489
|
-
performance.measure(measureText, key);
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
} else {
|
|
493
|
-
return () => {
|
|
494
|
-
return;
|
|
495
|
-
};
|
|
496
|
-
}
|
|
497
|
-
};
|
|
498
|
-
var inspect = (ref) => {
|
|
499
|
-
const hostRef = getHostRef(ref);
|
|
500
|
-
if (!hostRef) {
|
|
501
|
-
return void 0;
|
|
502
|
-
}
|
|
503
|
-
const flags = hostRef.$flags$;
|
|
504
|
-
const hostElement = hostRef.$hostElement$;
|
|
505
|
-
return {
|
|
506
|
-
renderCount: hostRef.$renderCount$,
|
|
507
|
-
flags: {
|
|
508
|
-
hasRendered: !!(flags & 2 /* hasRendered */),
|
|
509
|
-
hasConnected: !!(flags & 1 /* hasConnected */),
|
|
510
|
-
isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
|
|
511
|
-
isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
|
|
512
|
-
isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
|
|
513
|
-
hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
|
|
514
|
-
hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
|
|
515
|
-
isWatchReady: !!(flags & 128 /* isWatchReady */),
|
|
516
|
-
isListenReady: !!(flags & 256 /* isListenReady */),
|
|
517
|
-
needsRerender: !!(flags & 512 /* needsRerender */)
|
|
518
|
-
},
|
|
519
|
-
instanceValues: hostRef.$instanceValues$,
|
|
520
|
-
ancestorComponent: hostRef.$ancestorComponent$,
|
|
521
|
-
hostElement,
|
|
522
|
-
lazyInstance: hostRef.$lazyInstance$,
|
|
523
|
-
vnode: hostRef.$vnode$,
|
|
524
|
-
modeName: hostRef.$modeName$,
|
|
525
|
-
onReadyPromise: hostRef.$onReadyPromise$,
|
|
526
|
-
onReadyResolve: hostRef.$onReadyResolve$,
|
|
527
|
-
onInstancePromise: hostRef.$onInstancePromise$,
|
|
528
|
-
onInstanceResolve: hostRef.$onInstanceResolve$,
|
|
529
|
-
onRenderResolve: hostRef.$onRenderResolve$,
|
|
530
|
-
queuedListeners: hostRef.$queuedListeners$,
|
|
531
|
-
rmListeners: hostRef.$rmListeners$,
|
|
532
|
-
["s-id"]: hostElement["s-id"],
|
|
533
|
-
["s-cr"]: hostElement["s-cr"],
|
|
534
|
-
["s-lr"]: hostElement["s-lr"],
|
|
535
|
-
["s-p"]: hostElement["s-p"],
|
|
536
|
-
["s-rc"]: hostElement["s-rc"],
|
|
537
|
-
["s-sc"]: hostElement["s-sc"]
|
|
538
|
-
};
|
|
539
|
-
};
|
|
540
|
-
var installDevTools = () => {
|
|
541
|
-
if (import_app_data.BUILD.devTools) {
|
|
542
|
-
const rindo = win.rindo = win.rindo || {};
|
|
543
|
-
const originalInspect = rindo.inspect;
|
|
544
|
-
rindo.inspect = (ref) => {
|
|
545
|
-
let result = inspect(ref);
|
|
546
|
-
if (!result && typeof originalInspect === "function") {
|
|
547
|
-
result = originalInspect(ref);
|
|
548
|
-
}
|
|
549
|
-
return result;
|
|
550
|
-
};
|
|
551
|
-
}
|
|
552
|
-
};
|
|
468
|
+
// src/runtime/dom-extras.ts
|
|
469
|
+
var import_app_data6 = require("@rindo/core/internal/app-data");
|
|
553
470
|
|
|
554
471
|
// src/runtime/runtime-constants.ts
|
|
555
472
|
var CONTENT_REF_ID = "r";
|
|
556
473
|
var ORG_LOCATION_ID = "o";
|
|
557
474
|
var SLOT_NODE_ID = "s";
|
|
558
475
|
var TEXT_NODE_ID = "t";
|
|
476
|
+
var COMMENT_NODE_ID = "c";
|
|
559
477
|
var HYDRATE_ID = "s-id";
|
|
560
478
|
var HYDRATED_STYLE_ID = "sty-id";
|
|
561
479
|
var HYDRATE_CHILD_ID = "c-id";
|
|
@@ -575,6 +493,112 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
|
575
493
|
"formStateRestoreCallback"
|
|
576
494
|
];
|
|
577
495
|
|
|
496
|
+
// src/runtime/slot-polyfill-utils.ts
|
|
497
|
+
var import_app_data = require("@rindo/core/internal/app-data");
|
|
498
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
499
|
+
const childNodes = elm.__childNodes || elm.childNodes;
|
|
500
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
501
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
502
|
+
var _a;
|
|
503
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
504
|
+
if ((_a = getHostSlotChildNodes(slotNode, slotNode["s-sn"], false)) == null ? void 0 : _a.length) {
|
|
505
|
+
slotNode.hidden = true;
|
|
506
|
+
} else {
|
|
507
|
+
slotNode.hidden = false;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
for (const childNode of childNodes) {
|
|
513
|
+
if (childNode.nodeType === 1 /* ElementNode */ && (childNode.__childNodes || childNode.childNodes).length) {
|
|
514
|
+
updateFallbackSlotVisibility(childNode);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
519
|
+
const result = [];
|
|
520
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
521
|
+
const slottedNode = childNodes[i2]["s-nr"];
|
|
522
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
523
|
+
result.push(slottedNode);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
return result;
|
|
527
|
+
};
|
|
528
|
+
var getHostSlotNodes = (childNodes, hostName, slotName) => {
|
|
529
|
+
let i2 = 0;
|
|
530
|
+
let slottedNodes = [];
|
|
531
|
+
let childNode;
|
|
532
|
+
for (; i2 < childNodes.length; i2++) {
|
|
533
|
+
childNode = childNodes[i2];
|
|
534
|
+
if (childNode["s-sr"] && childNode["s-hn"] === hostName && (!slotName || childNode["s-sn"] === slotName)) {
|
|
535
|
+
slottedNodes.push(childNode);
|
|
536
|
+
if (typeof slotName !== "undefined") return slottedNodes;
|
|
537
|
+
}
|
|
538
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
539
|
+
}
|
|
540
|
+
return slottedNodes;
|
|
541
|
+
};
|
|
542
|
+
var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
|
|
543
|
+
const childNodes = [];
|
|
544
|
+
if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
|
|
545
|
+
while ((node = node.nextSibling) && node["s-sn"] === slotName) {
|
|
546
|
+
childNodes.push(node);
|
|
547
|
+
}
|
|
548
|
+
return childNodes;
|
|
549
|
+
};
|
|
550
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
551
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
552
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
553
|
+
return true;
|
|
554
|
+
}
|
|
555
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
556
|
+
return true;
|
|
557
|
+
}
|
|
558
|
+
return false;
|
|
559
|
+
}
|
|
560
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
561
|
+
return true;
|
|
562
|
+
}
|
|
563
|
+
return slotName === "";
|
|
564
|
+
};
|
|
565
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
566
|
+
let slottedNodeLocation;
|
|
567
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
568
|
+
slottedNodeLocation = newChild["s-ol"];
|
|
569
|
+
} else {
|
|
570
|
+
slottedNodeLocation = document.createTextNode("");
|
|
571
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
572
|
+
}
|
|
573
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
574
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
575
|
+
const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
|
|
576
|
+
if (typeof position !== "undefined") {
|
|
577
|
+
if (import_app_data.BUILD.hydrateClientSide) {
|
|
578
|
+
slottedNodeLocation["s-oo"] = position;
|
|
579
|
+
const childNodes = parent.__childNodes || parent.childNodes;
|
|
580
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
581
|
+
childNodes.forEach((n) => {
|
|
582
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
583
|
+
});
|
|
584
|
+
slotRelocateNodes.sort((a, b) => {
|
|
585
|
+
if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
|
|
586
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
587
|
+
return 0;
|
|
588
|
+
});
|
|
589
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
590
|
+
}
|
|
591
|
+
} else {
|
|
592
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
593
|
+
}
|
|
594
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
595
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
596
|
+
};
|
|
597
|
+
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
598
|
+
|
|
599
|
+
// src/runtime/vdom/vdom-render.ts
|
|
600
|
+
var import_app_data5 = require("@rindo/core/internal/app-data");
|
|
601
|
+
|
|
578
602
|
// src/runtime/vdom/h.ts
|
|
579
603
|
var import_app_data2 = require("@rindo/core/internal/app-data");
|
|
580
604
|
var h = (nodeName, vnodeData, ...children) => {
|
|
@@ -715,416 +739,58 @@ var validateInputProperties = (inputElm) => {
|
|
|
715
739
|
}
|
|
716
740
|
};
|
|
717
741
|
|
|
718
|
-
// src/runtime/
|
|
719
|
-
var
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
node["s-ol"] = orgLocationNode;
|
|
743
|
-
node["s-ol"]["s-nr"] = node;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
plt.$orgLocNodes$.delete(orgLocationId);
|
|
747
|
-
});
|
|
748
|
-
if (import_app_data3.BUILD.shadowDom && shadowRoot) {
|
|
749
|
-
shadowRootNodes.map((shadowRootNode) => {
|
|
750
|
-
if (shadowRootNode) {
|
|
751
|
-
shadowRoot.appendChild(shadowRootNode);
|
|
742
|
+
// src/runtime/vdom/update-element.ts
|
|
743
|
+
var import_app_data4 = require("@rindo/core/internal/app-data");
|
|
744
|
+
|
|
745
|
+
// src/runtime/vdom/set-accessor.ts
|
|
746
|
+
var import_app_data3 = require("@rindo/core/internal/app-data");
|
|
747
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
748
|
+
if (oldValue !== newValue) {
|
|
749
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
750
|
+
let ln = memberName.toLowerCase();
|
|
751
|
+
if (import_app_data3.BUILD.vdomClass && memberName === "class") {
|
|
752
|
+
const classList = elm.classList;
|
|
753
|
+
const oldClasses = parseClassList(oldValue);
|
|
754
|
+
let newClasses = parseClassList(newValue);
|
|
755
|
+
if (elm["s-si"]) {
|
|
756
|
+
newClasses.push(elm["s-si"]);
|
|
757
|
+
oldClasses.forEach((c) => {
|
|
758
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
759
|
+
});
|
|
760
|
+
newClasses = [...new Set(newClasses)];
|
|
761
|
+
classList.add(...newClasses);
|
|
762
|
+
delete elm["s-si"];
|
|
763
|
+
} else {
|
|
764
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
765
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
752
766
|
}
|
|
753
|
-
})
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
764
|
-
if (childNodeType) {
|
|
765
|
-
childIdSplt = childNodeType.split(".");
|
|
766
|
-
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
767
|
-
childVNode = {
|
|
768
|
-
$flags$: 0,
|
|
769
|
-
$hostId$: childIdSplt[0],
|
|
770
|
-
$nodeId$: childIdSplt[1],
|
|
771
|
-
$depth$: childIdSplt[2],
|
|
772
|
-
$index$: childIdSplt[3],
|
|
773
|
-
$tag$: node.tagName.toLowerCase(),
|
|
774
|
-
$elm$: node,
|
|
775
|
-
$attrs$: null,
|
|
776
|
-
$children$: null,
|
|
777
|
-
$key$: null,
|
|
778
|
-
$name$: null,
|
|
779
|
-
$text$: null
|
|
780
|
-
};
|
|
781
|
-
childRenderNodes.push(childVNode);
|
|
782
|
-
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
783
|
-
if (!parentVNode.$children$) {
|
|
784
|
-
parentVNode.$children$ = [];
|
|
767
|
+
} else if (import_app_data3.BUILD.vdomStyle && memberName === "style") {
|
|
768
|
+
if (import_app_data3.BUILD.updatable) {
|
|
769
|
+
for (const prop in oldValue) {
|
|
770
|
+
if (!newValue || newValue[prop] == null) {
|
|
771
|
+
if (!import_app_data3.BUILD.hydrateServerSide && prop.includes("-")) {
|
|
772
|
+
elm.style.removeProperty(prop);
|
|
773
|
+
} else {
|
|
774
|
+
elm.style[prop] = "";
|
|
775
|
+
}
|
|
776
|
+
}
|
|
785
777
|
}
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
if (
|
|
789
|
-
|
|
778
|
+
}
|
|
779
|
+
for (const prop in newValue) {
|
|
780
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
781
|
+
if (!import_app_data3.BUILD.hydrateServerSide && prop.includes("-")) {
|
|
782
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
783
|
+
} else {
|
|
784
|
+
elm.style[prop] = newValue[prop];
|
|
785
|
+
}
|
|
790
786
|
}
|
|
791
787
|
}
|
|
792
|
-
}
|
|
793
|
-
if (
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
parentVNode,
|
|
797
|
-
childRenderNodes,
|
|
798
|
-
slotNodes,
|
|
799
|
-
shadowRootNodes,
|
|
800
|
-
hostElm,
|
|
801
|
-
node.shadowRoot.childNodes[i2],
|
|
802
|
-
hostId
|
|
803
|
-
);
|
|
788
|
+
} else if (import_app_data3.BUILD.vdomKey && memberName === "key") {
|
|
789
|
+
} else if (import_app_data3.BUILD.vdomRef && memberName === "ref") {
|
|
790
|
+
if (newValue) {
|
|
791
|
+
newValue(elm);
|
|
804
792
|
}
|
|
805
|
-
}
|
|
806
|
-
for (i2 = node.childNodes.length - 1; i2 >= 0; i2--) {
|
|
807
|
-
clientHydrate(
|
|
808
|
-
parentVNode,
|
|
809
|
-
childRenderNodes,
|
|
810
|
-
slotNodes,
|
|
811
|
-
shadowRootNodes,
|
|
812
|
-
hostElm,
|
|
813
|
-
node.childNodes[i2],
|
|
814
|
-
hostId
|
|
815
|
-
);
|
|
816
|
-
}
|
|
817
|
-
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
818
|
-
childIdSplt = node.nodeValue.split(".");
|
|
819
|
-
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
820
|
-
childNodeType = childIdSplt[0];
|
|
821
|
-
childVNode = {
|
|
822
|
-
$flags$: 0,
|
|
823
|
-
$hostId$: childIdSplt[1],
|
|
824
|
-
$nodeId$: childIdSplt[2],
|
|
825
|
-
$depth$: childIdSplt[3],
|
|
826
|
-
$index$: childIdSplt[4],
|
|
827
|
-
$elm$: node,
|
|
828
|
-
$attrs$: null,
|
|
829
|
-
$children$: null,
|
|
830
|
-
$key$: null,
|
|
831
|
-
$name$: null,
|
|
832
|
-
$tag$: null,
|
|
833
|
-
$text$: null
|
|
834
|
-
};
|
|
835
|
-
if (childNodeType === TEXT_NODE_ID) {
|
|
836
|
-
childVNode.$elm$ = node.nextSibling;
|
|
837
|
-
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
838
|
-
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
839
|
-
childRenderNodes.push(childVNode);
|
|
840
|
-
node.remove();
|
|
841
|
-
if (!parentVNode.$children$) {
|
|
842
|
-
parentVNode.$children$ = [];
|
|
843
|
-
}
|
|
844
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
845
|
-
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
846
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
} else if (childVNode.$hostId$ === hostId) {
|
|
850
|
-
if (childNodeType === SLOT_NODE_ID) {
|
|
851
|
-
childVNode.$tag$ = "slot";
|
|
852
|
-
if (childIdSplt[5]) {
|
|
853
|
-
node["s-sn"] = childVNode.$name$ = childIdSplt[5];
|
|
854
|
-
} else {
|
|
855
|
-
node["s-sn"] = "";
|
|
856
|
-
}
|
|
857
|
-
node["s-sr"] = true;
|
|
858
|
-
if (import_app_data3.BUILD.shadowDom && shadowRootNodes) {
|
|
859
|
-
childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
860
|
-
if (childVNode.$name$) {
|
|
861
|
-
childVNode.$elm$.setAttribute("name", childVNode.$name$);
|
|
862
|
-
}
|
|
863
|
-
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
864
|
-
node.remove();
|
|
865
|
-
if (childVNode.$depth$ === "0") {
|
|
866
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
slotNodes.push(childVNode);
|
|
870
|
-
if (!parentVNode.$children$) {
|
|
871
|
-
parentVNode.$children$ = [];
|
|
872
|
-
}
|
|
873
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
874
|
-
} else if (childNodeType === CONTENT_REF_ID) {
|
|
875
|
-
if (import_app_data3.BUILD.shadowDom && shadowRootNodes) {
|
|
876
|
-
node.remove();
|
|
877
|
-
} else if (import_app_data3.BUILD.slotRelocation) {
|
|
878
|
-
hostElm["s-cr"] = node;
|
|
879
|
-
node["s-cn"] = true;
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
885
|
-
const vnode = newVNode(null, node.textContent);
|
|
886
|
-
vnode.$elm$ = node;
|
|
887
|
-
vnode.$index$ = "0";
|
|
888
|
-
parentVNode.$children$ = [vnode];
|
|
889
|
-
}
|
|
890
|
-
};
|
|
891
|
-
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
892
|
-
if (node.nodeType === 1 /* ElementNode */) {
|
|
893
|
-
let i2 = 0;
|
|
894
|
-
if (node.shadowRoot) {
|
|
895
|
-
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
896
|
-
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
for (i2 = 0; i2 < node.childNodes.length; i2++) {
|
|
900
|
-
initializeDocumentHydrate(node.childNodes[i2], orgLocNodes);
|
|
901
|
-
}
|
|
902
|
-
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
903
|
-
const childIdSplt = node.nodeValue.split(".");
|
|
904
|
-
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
905
|
-
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
906
|
-
node.nodeValue = "";
|
|
907
|
-
node["s-en"] = childIdSplt[3];
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
};
|
|
911
|
-
|
|
912
|
-
// src/runtime/initialize-component.ts
|
|
913
|
-
var import_app_data14 = require("@rindo/core/internal/app-data");
|
|
914
|
-
|
|
915
|
-
// src/runtime/mode.ts
|
|
916
|
-
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
917
|
-
var setMode = (handler) => modeResolutionChain.push(handler);
|
|
918
|
-
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
919
|
-
|
|
920
|
-
// src/runtime/proxy-component.ts
|
|
921
|
-
var import_app_data13 = require("@rindo/core/internal/app-data");
|
|
922
|
-
|
|
923
|
-
// src/runtime/set-value.ts
|
|
924
|
-
var import_app_data12 = require("@rindo/core/internal/app-data");
|
|
925
|
-
|
|
926
|
-
// src/runtime/parse-property-value.ts
|
|
927
|
-
var import_app_data4 = require("@rindo/core/internal/app-data");
|
|
928
|
-
var parsePropertyValue = (propValue, propType) => {
|
|
929
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
930
|
-
if (import_app_data4.BUILD.propBoolean && propType & 4 /* Boolean */) {
|
|
931
|
-
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
932
|
-
}
|
|
933
|
-
if (import_app_data4.BUILD.propNumber && propType & 2 /* Number */) {
|
|
934
|
-
return parseFloat(propValue);
|
|
935
|
-
}
|
|
936
|
-
if (import_app_data4.BUILD.propString && propType & 1 /* String */) {
|
|
937
|
-
return String(propValue);
|
|
938
|
-
}
|
|
939
|
-
return propValue;
|
|
940
|
-
}
|
|
941
|
-
return propValue;
|
|
942
|
-
};
|
|
943
|
-
|
|
944
|
-
// src/runtime/update-component.ts
|
|
945
|
-
var import_app_data11 = require("@rindo/core/internal/app-data");
|
|
946
|
-
|
|
947
|
-
// src/runtime/event-emitter.ts
|
|
948
|
-
var import_app_data6 = require("@rindo/core/internal/app-data");
|
|
949
|
-
|
|
950
|
-
// src/runtime/element.ts
|
|
951
|
-
var import_app_data5 = require("@rindo/core/internal/app-data");
|
|
952
|
-
var getElement = (ref) => import_app_data5.BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
953
|
-
|
|
954
|
-
// src/runtime/event-emitter.ts
|
|
955
|
-
var createEvent = (ref, name, flags) => {
|
|
956
|
-
const elm = getElement(ref);
|
|
957
|
-
return {
|
|
958
|
-
emit: (detail) => {
|
|
959
|
-
if (import_app_data6.BUILD.isDev && !elm.isConnected) {
|
|
960
|
-
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
961
|
-
}
|
|
962
|
-
return emitEvent(elm, name, {
|
|
963
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
964
|
-
composed: !!(flags & 2 /* Composed */),
|
|
965
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
966
|
-
detail
|
|
967
|
-
});
|
|
968
|
-
}
|
|
969
|
-
};
|
|
970
|
-
};
|
|
971
|
-
var emitEvent = (elm, name, opts) => {
|
|
972
|
-
const ev = plt.ce(name, opts);
|
|
973
|
-
elm.dispatchEvent(ev);
|
|
974
|
-
return ev;
|
|
975
|
-
};
|
|
976
|
-
|
|
977
|
-
// src/runtime/styles.ts
|
|
978
|
-
var import_app_data7 = require("@rindo/core/internal/app-data");
|
|
979
|
-
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
980
|
-
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
981
|
-
let style = styles.get(scopeId2);
|
|
982
|
-
if (supportsConstructableStylesheets && allowCS) {
|
|
983
|
-
style = style || new CSSStyleSheet();
|
|
984
|
-
if (typeof style === "string") {
|
|
985
|
-
style = cssText;
|
|
986
|
-
} else {
|
|
987
|
-
style.replaceSync(cssText);
|
|
988
|
-
}
|
|
989
|
-
} else {
|
|
990
|
-
style = cssText;
|
|
991
|
-
}
|
|
992
|
-
styles.set(scopeId2, style);
|
|
993
|
-
};
|
|
994
|
-
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
995
|
-
var _a;
|
|
996
|
-
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
997
|
-
const style = styles.get(scopeId2);
|
|
998
|
-
if (!import_app_data7.BUILD.attachStyles) {
|
|
999
|
-
return scopeId2;
|
|
1000
|
-
}
|
|
1001
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
1002
|
-
if (style) {
|
|
1003
|
-
if (typeof style === "string") {
|
|
1004
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
1005
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
1006
|
-
let styleElm;
|
|
1007
|
-
if (!appliedStyles) {
|
|
1008
|
-
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
1009
|
-
}
|
|
1010
|
-
if (!appliedStyles.has(scopeId2)) {
|
|
1011
|
-
if (import_app_data7.BUILD.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
1012
|
-
styleElm.innerHTML = style;
|
|
1013
|
-
} else {
|
|
1014
|
-
styleElm = doc.createElement("style");
|
|
1015
|
-
styleElm.innerHTML = style;
|
|
1016
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
1017
|
-
if (nonce != null) {
|
|
1018
|
-
styleElm.setAttribute("nonce", nonce);
|
|
1019
|
-
}
|
|
1020
|
-
if ((import_app_data7.BUILD.hydrateServerSide || import_app_data7.BUILD.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1021
|
-
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
1022
|
-
}
|
|
1023
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
1024
|
-
if (styleContainerNode.nodeName === "HEAD") {
|
|
1025
|
-
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
1026
|
-
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
1027
|
-
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
1028
|
-
} else if ("host" in styleContainerNode) {
|
|
1029
|
-
if (supportsConstructableStylesheets) {
|
|
1030
|
-
const stylesheet = new CSSStyleSheet();
|
|
1031
|
-
stylesheet.replaceSync(style);
|
|
1032
|
-
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
1033
|
-
} else {
|
|
1034
|
-
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
1035
|
-
if (existingStyleContainer) {
|
|
1036
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
1037
|
-
} else {
|
|
1038
|
-
styleContainerNode.prepend(styleElm);
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
} else {
|
|
1042
|
-
styleContainerNode.append(styleElm);
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
|
|
1046
|
-
styleContainerNode.insertBefore(styleElm, null);
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
1050
|
-
styleElm.innerHTML += SLOT_FB_CSS;
|
|
1051
|
-
}
|
|
1052
|
-
if (appliedStyles) {
|
|
1053
|
-
appliedStyles.add(scopeId2);
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
} else if (import_app_data7.BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
1057
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
return scopeId2;
|
|
1061
|
-
};
|
|
1062
|
-
var attachStyles = (hostRef) => {
|
|
1063
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
1064
|
-
const elm = hostRef.$hostElement$;
|
|
1065
|
-
const flags = cmpMeta.$flags$;
|
|
1066
|
-
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
1067
|
-
const scopeId2 = addStyle(
|
|
1068
|
-
import_app_data7.BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
1069
|
-
cmpMeta,
|
|
1070
|
-
hostRef.$modeName$
|
|
1071
|
-
);
|
|
1072
|
-
if ((import_app_data7.BUILD.shadowDom || import_app_data7.BUILD.scoped) && import_app_data7.BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
1073
|
-
elm["s-sc"] = scopeId2;
|
|
1074
|
-
elm.classList.add(scopeId2 + "-h");
|
|
1075
|
-
if (import_app_data7.BUILD.scoped && flags & 2 /* scopedCssEncapsulation */) {
|
|
1076
|
-
elm.classList.add(scopeId2 + "-s");
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
endAttachStyles();
|
|
1080
|
-
};
|
|
1081
|
-
var getScopeId = (cmp, mode) => "sc-" + (import_app_data7.BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
1082
|
-
|
|
1083
|
-
// src/runtime/vdom/vdom-render.ts
|
|
1084
|
-
var import_app_data10 = require("@rindo/core/internal/app-data");
|
|
1085
|
-
|
|
1086
|
-
// src/runtime/vdom/update-element.ts
|
|
1087
|
-
var import_app_data9 = require("@rindo/core/internal/app-data");
|
|
1088
|
-
|
|
1089
|
-
// src/runtime/vdom/set-accessor.ts
|
|
1090
|
-
var import_app_data8 = require("@rindo/core/internal/app-data");
|
|
1091
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
1092
|
-
if (oldValue !== newValue) {
|
|
1093
|
-
let isProp = isMemberInElement(elm, memberName);
|
|
1094
|
-
let ln = memberName.toLowerCase();
|
|
1095
|
-
if (import_app_data8.BUILD.vdomClass && memberName === "class") {
|
|
1096
|
-
const classList = elm.classList;
|
|
1097
|
-
const oldClasses = parseClassList(oldValue);
|
|
1098
|
-
const newClasses = parseClassList(newValue);
|
|
1099
|
-
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
1100
|
-
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
1101
|
-
} else if (import_app_data8.BUILD.vdomStyle && memberName === "style") {
|
|
1102
|
-
if (import_app_data8.BUILD.updatable) {
|
|
1103
|
-
for (const prop in oldValue) {
|
|
1104
|
-
if (!newValue || newValue[prop] == null) {
|
|
1105
|
-
if (!import_app_data8.BUILD.hydrateServerSide && prop.includes("-")) {
|
|
1106
|
-
elm.style.removeProperty(prop);
|
|
1107
|
-
} else {
|
|
1108
|
-
elm.style[prop] = "";
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
|
-
for (const prop in newValue) {
|
|
1114
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
1115
|
-
if (!import_app_data8.BUILD.hydrateServerSide && prop.includes("-")) {
|
|
1116
|
-
elm.style.setProperty(prop, newValue[prop]);
|
|
1117
|
-
} else {
|
|
1118
|
-
elm.style[prop] = newValue[prop];
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
} else if (import_app_data8.BUILD.vdomKey && memberName === "key") {
|
|
1123
|
-
} else if (import_app_data8.BUILD.vdomRef && memberName === "ref") {
|
|
1124
|
-
if (newValue) {
|
|
1125
|
-
newValue(elm);
|
|
1126
|
-
}
|
|
1127
|
-
} else if (import_app_data8.BUILD.vdomListener && (import_app_data8.BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
793
|
+
} else if (import_app_data3.BUILD.vdomListener && (import_app_data3.BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
1128
794
|
if (memberName[2] === "-") {
|
|
1129
795
|
memberName = memberName.slice(3);
|
|
1130
796
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -1142,7 +808,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1142
808
|
plt.ael(elm, memberName, newValue, capture);
|
|
1143
809
|
}
|
|
1144
810
|
}
|
|
1145
|
-
} else if (
|
|
811
|
+
} else if (import_app_data3.BUILD.vdomPropOrAttr) {
|
|
1146
812
|
const isComplex = isComplexType(newValue);
|
|
1147
813
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
1148
814
|
try {
|
|
@@ -1164,7 +830,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1164
830
|
}
|
|
1165
831
|
}
|
|
1166
832
|
let xlink = false;
|
|
1167
|
-
if (
|
|
833
|
+
if (import_app_data3.BUILD.vdomXlink) {
|
|
1168
834
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
1169
835
|
memberName = ln;
|
|
1170
836
|
xlink = true;
|
|
@@ -1172,7 +838,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1172
838
|
}
|
|
1173
839
|
if (newValue == null || newValue === false) {
|
|
1174
840
|
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
1175
|
-
if (
|
|
841
|
+
if (import_app_data3.BUILD.vdomXlink && xlink) {
|
|
1176
842
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
1177
843
|
} else {
|
|
1178
844
|
elm.removeAttribute(memberName);
|
|
@@ -1180,7 +846,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1180
846
|
}
|
|
1181
847
|
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
1182
848
|
newValue = newValue === true ? "" : newValue;
|
|
1183
|
-
if (
|
|
849
|
+
if (import_app_data3.BUILD.vdomXlink && xlink) {
|
|
1184
850
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
1185
851
|
} else {
|
|
1186
852
|
elm.setAttribute(memberName, newValue);
|
|
@@ -1190,7 +856,15 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1190
856
|
}
|
|
1191
857
|
};
|
|
1192
858
|
var parseClassListRegex = /\s/;
|
|
1193
|
-
var parseClassList = (value) =>
|
|
859
|
+
var parseClassList = (value) => {
|
|
860
|
+
if (typeof value === "object" && "baseVal" in value) {
|
|
861
|
+
value = value.baseVal;
|
|
862
|
+
}
|
|
863
|
+
if (!value) {
|
|
864
|
+
return [];
|
|
865
|
+
}
|
|
866
|
+
return value.split(parseClassListRegex);
|
|
867
|
+
};
|
|
1194
868
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
1195
869
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
1196
870
|
|
|
@@ -1199,7 +873,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
|
1199
873
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
1200
874
|
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
|
|
1201
875
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
1202
|
-
if (
|
|
876
|
+
if (import_app_data4.BUILD.updatable) {
|
|
1203
877
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
1204
878
|
if (!(memberName in newVnodeAttrs)) {
|
|
1205
879
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
@@ -1228,19 +902,16 @@ var useNativeShadowDom = false;
|
|
|
1228
902
|
var checkSlotFallbackVisibility = false;
|
|
1229
903
|
var checkSlotRelocate = false;
|
|
1230
904
|
var isSvgMode = false;
|
|
1231
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
905
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
1232
906
|
var _a;
|
|
1233
907
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
1234
908
|
let i2 = 0;
|
|
1235
909
|
let elm;
|
|
1236
910
|
let childNode;
|
|
1237
911
|
let oldVNode;
|
|
1238
|
-
if (
|
|
912
|
+
if (import_app_data5.BUILD.slotRelocation && !useNativeShadowDom) {
|
|
1239
913
|
checkSlotRelocate = true;
|
|
1240
914
|
if (newVNode2.$tag$ === "slot") {
|
|
1241
|
-
if (scopeId) {
|
|
1242
|
-
parentElm.classList.add(scopeId + "-s");
|
|
1243
|
-
}
|
|
1244
915
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
1245
916
|
// slot element has fallback content
|
|
1246
917
|
// still create an element that "mocks" the slot element
|
|
@@ -1253,48 +924,43 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1253
924
|
);
|
|
1254
925
|
}
|
|
1255
926
|
}
|
|
1256
|
-
if (
|
|
927
|
+
if (import_app_data5.BUILD.isDev && newVNode2.$elm$) {
|
|
1257
928
|
consoleDevError(
|
|
1258
929
|
`The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://rindojs.web.app/docs/templating-jsx#avoid-shared-jsx-nodes`
|
|
1259
930
|
);
|
|
1260
931
|
}
|
|
1261
|
-
if (
|
|
932
|
+
if (import_app_data5.BUILD.vdomText && newVNode2.$text$ !== null) {
|
|
1262
933
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
1263
|
-
} else if (
|
|
1264
|
-
elm = newVNode2.$elm$ =
|
|
934
|
+
} else if (import_app_data5.BUILD.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
935
|
+
elm = newVNode2.$elm$ = import_app_data5.BUILD.isDebug || import_app_data5.BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
|
|
1265
936
|
} else {
|
|
1266
|
-
if (
|
|
937
|
+
if (import_app_data5.BUILD.svg && !isSvgMode) {
|
|
1267
938
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
1268
939
|
}
|
|
1269
|
-
elm = newVNode2.$elm$ =
|
|
940
|
+
elm = newVNode2.$elm$ = import_app_data5.BUILD.svg ? doc.createElementNS(
|
|
1270
941
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
1271
|
-
!useNativeShadowDom &&
|
|
942
|
+
!useNativeShadowDom && import_app_data5.BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1272
943
|
) : doc.createElement(
|
|
1273
|
-
!useNativeShadowDom &&
|
|
944
|
+
!useNativeShadowDom && import_app_data5.BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1274
945
|
);
|
|
1275
|
-
if (
|
|
946
|
+
if (import_app_data5.BUILD.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
1276
947
|
isSvgMode = false;
|
|
1277
948
|
}
|
|
1278
|
-
if (
|
|
949
|
+
if (import_app_data5.BUILD.vdomAttribute) {
|
|
1279
950
|
updateElement(null, newVNode2, isSvgMode);
|
|
1280
951
|
}
|
|
1281
|
-
|
|
1282
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
1283
|
-
if (!isElementWithinShadowRoot && import_app_data10.BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
952
|
+
if (import_app_data5.BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
1284
953
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
1285
954
|
}
|
|
1286
|
-
if (import_app_data10.BUILD.scoped) {
|
|
1287
|
-
updateElementScopeIds(elm, parentElm);
|
|
1288
|
-
}
|
|
1289
955
|
if (newVNode2.$children$) {
|
|
1290
956
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
1291
|
-
childNode = createElm(oldParentVNode, newVNode2, i2
|
|
957
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
1292
958
|
if (childNode) {
|
|
1293
959
|
elm.appendChild(childNode);
|
|
1294
960
|
}
|
|
1295
961
|
}
|
|
1296
962
|
}
|
|
1297
|
-
if (
|
|
963
|
+
if (import_app_data5.BUILD.svg) {
|
|
1298
964
|
if (newVNode2.$tag$ === "svg") {
|
|
1299
965
|
isSvgMode = false;
|
|
1300
966
|
} else if (elm.tagName === "foreignObject") {
|
|
@@ -1303,7 +969,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1303
969
|
}
|
|
1304
970
|
}
|
|
1305
971
|
elm["s-hn"] = hostTagName;
|
|
1306
|
-
if (
|
|
972
|
+
if (import_app_data5.BUILD.slotRelocation) {
|
|
1307
973
|
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
1308
974
|
elm["s-sr"] = true;
|
|
1309
975
|
elm["s-cr"] = contentRef;
|
|
@@ -1311,12 +977,15 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1311
977
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
1312
978
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
1313
979
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
1314
|
-
if (
|
|
980
|
+
if (import_app_data5.BUILD.experimentalSlotFixes) {
|
|
1315
981
|
relocateToHostRoot(oldParentVNode.$elm$);
|
|
1316
982
|
} else {
|
|
1317
983
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
1318
984
|
}
|
|
1319
985
|
}
|
|
986
|
+
if (import_app_data5.BUILD.scoped) {
|
|
987
|
+
addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
|
|
988
|
+
}
|
|
1320
989
|
}
|
|
1321
990
|
}
|
|
1322
991
|
return elm;
|
|
@@ -1325,8 +994,12 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1325
994
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1326
995
|
const host = parentElm.closest(hostTagName.toLowerCase());
|
|
1327
996
|
if (host != null) {
|
|
1328
|
-
const contentRefNode = Array.from(host.childNodes).find(
|
|
1329
|
-
|
|
997
|
+
const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
|
|
998
|
+
(ref) => ref["s-cr"]
|
|
999
|
+
);
|
|
1000
|
+
const childNodeArray = Array.from(
|
|
1001
|
+
parentElm.__childNodes || parentElm.childNodes
|
|
1002
|
+
);
|
|
1330
1003
|
for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
|
|
1331
1004
|
if (childNode["s-sh"] != null) {
|
|
1332
1005
|
insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
|
|
@@ -1339,8 +1012,8 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1339
1012
|
};
|
|
1340
1013
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
1341
1014
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1342
|
-
const oldSlotChildNodes = Array.from(parentElm.childNodes);
|
|
1343
|
-
if (parentElm["s-sr"] &&
|
|
1015
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
1016
|
+
if (parentElm["s-sr"] && import_app_data5.BUILD.experimentalSlotFixes) {
|
|
1344
1017
|
let node = parentElm;
|
|
1345
1018
|
while (node = node.nextSibling) {
|
|
1346
1019
|
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
@@ -1351,7 +1024,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
1351
1024
|
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
1352
1025
|
const childNode = oldSlotChildNodes[i2];
|
|
1353
1026
|
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
1354
|
-
insertBefore(
|
|
1027
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
1355
1028
|
childNode["s-ol"].remove();
|
|
1356
1029
|
childNode["s-ol"] = void 0;
|
|
1357
1030
|
childNode["s-sh"] = void 0;
|
|
@@ -1364,17 +1037,17 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
1364
1037
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1365
1038
|
};
|
|
1366
1039
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
1367
|
-
let containerElm =
|
|
1040
|
+
let containerElm = import_app_data5.BUILD.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
1368
1041
|
let childNode;
|
|
1369
|
-
if (
|
|
1042
|
+
if (import_app_data5.BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
1370
1043
|
containerElm = containerElm.shadowRoot;
|
|
1371
1044
|
}
|
|
1372
1045
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
1373
1046
|
if (vnodes[startIdx]) {
|
|
1374
|
-
childNode = createElm(null, parentVNode, startIdx
|
|
1047
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
1375
1048
|
if (childNode) {
|
|
1376
1049
|
vnodes[startIdx].$elm$ = childNode;
|
|
1377
|
-
insertBefore(containerElm, childNode,
|
|
1050
|
+
insertBefore(containerElm, childNode, import_app_data5.BUILD.slotRelocation ? referenceNode(before) : before);
|
|
1378
1051
|
}
|
|
1379
1052
|
}
|
|
1380
1053
|
}
|
|
@@ -1386,7 +1059,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
1386
1059
|
const elm = vnode.$elm$;
|
|
1387
1060
|
nullifyVNodeRefs(vnode);
|
|
1388
1061
|
if (elm) {
|
|
1389
|
-
if (
|
|
1062
|
+
if (import_app_data5.BUILD.slotRelocation) {
|
|
1390
1063
|
checkSlotFallbackVisibility = true;
|
|
1391
1064
|
if (elm["s-ol"]) {
|
|
1392
1065
|
elm["s-ol"].remove();
|
|
@@ -1430,7 +1103,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1430
1103
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
1431
1104
|
newEndVnode = newCh[--newEndIdx];
|
|
1432
1105
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
1433
|
-
if (
|
|
1106
|
+
if (import_app_data5.BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1434
1107
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1435
1108
|
}
|
|
1436
1109
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -1438,7 +1111,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1438
1111
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1439
1112
|
newEndVnode = newCh[--newEndIdx];
|
|
1440
1113
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
1441
|
-
if (
|
|
1114
|
+
if (import_app_data5.BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1442
1115
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1443
1116
|
}
|
|
1444
1117
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -1447,7 +1120,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1447
1120
|
newStartVnode = newCh[++newStartIdx];
|
|
1448
1121
|
} else {
|
|
1449
1122
|
idxInOld = -1;
|
|
1450
|
-
if (
|
|
1123
|
+
if (import_app_data5.BUILD.vdomKey) {
|
|
1451
1124
|
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
1452
1125
|
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
1453
1126
|
idxInOld = i2;
|
|
@@ -1455,10 +1128,10 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1455
1128
|
}
|
|
1456
1129
|
}
|
|
1457
1130
|
}
|
|
1458
|
-
if (
|
|
1131
|
+
if (import_app_data5.BUILD.vdomKey && idxInOld >= 0) {
|
|
1459
1132
|
elmToMove = oldCh[idxInOld];
|
|
1460
1133
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
1461
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld
|
|
1134
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
1462
1135
|
} else {
|
|
1463
1136
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
1464
1137
|
oldCh[idxInOld] = void 0;
|
|
@@ -1466,12 +1139,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1466
1139
|
}
|
|
1467
1140
|
newStartVnode = newCh[++newStartIdx];
|
|
1468
1141
|
} else {
|
|
1469
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx
|
|
1142
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
1470
1143
|
newStartVnode = newCh[++newStartIdx];
|
|
1471
1144
|
}
|
|
1472
1145
|
if (node) {
|
|
1473
|
-
if (
|
|
1474
|
-
insertBefore(
|
|
1146
|
+
if (import_app_data5.BUILD.slotRelocation) {
|
|
1147
|
+
insertBefore(
|
|
1148
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1149
|
+
node,
|
|
1150
|
+
referenceNode(oldStartVnode.$elm$)
|
|
1151
|
+
);
|
|
1475
1152
|
} else {
|
|
1476
1153
|
insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
|
|
1477
1154
|
}
|
|
@@ -1487,35 +1164,26 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1487
1164
|
newStartIdx,
|
|
1488
1165
|
newEndIdx
|
|
1489
1166
|
);
|
|
1490
|
-
} else if (
|
|
1167
|
+
} else if (import_app_data5.BUILD.updatable && newStartIdx > newEndIdx) {
|
|
1491
1168
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
1492
1169
|
}
|
|
1493
1170
|
};
|
|
1494
1171
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
1495
1172
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1496
|
-
if (
|
|
1497
|
-
if (
|
|
1498
|
-
// The component gets hydrated and no VDOM has been initialized.
|
|
1499
|
-
// Here the comparison can't happen as $name$ property is not set for `leftNode`.
|
|
1500
|
-
"$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many
|
|
1501
|
-
// hydration comments to be removed
|
|
1502
|
-
leftVNode.$elm$.nodeType !== 8
|
|
1503
|
-
) {
|
|
1504
|
-
return false;
|
|
1505
|
-
}
|
|
1173
|
+
if (import_app_data5.BUILD.slotRelocation && leftVNode.$tag$ === "slot") {
|
|
1506
1174
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
1507
1175
|
}
|
|
1508
|
-
if (
|
|
1176
|
+
if (import_app_data5.BUILD.vdomKey && !isInitialRender) {
|
|
1509
1177
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
1510
1178
|
}
|
|
1179
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
1180
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
1181
|
+
}
|
|
1511
1182
|
return true;
|
|
1512
1183
|
}
|
|
1513
1184
|
return false;
|
|
1514
1185
|
};
|
|
1515
|
-
var referenceNode = (node) =>
|
|
1516
|
-
return node && node["s-ol"] || node;
|
|
1517
|
-
};
|
|
1518
|
-
var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
|
|
1186
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
1519
1187
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
1520
1188
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
1521
1189
|
const oldChildren = oldVNode.$children$;
|
|
@@ -1523,13 +1191,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1523
1191
|
const tag = newVNode2.$tag$;
|
|
1524
1192
|
const text = newVNode2.$text$;
|
|
1525
1193
|
let defaultHolder;
|
|
1526
|
-
if (!
|
|
1527
|
-
if (
|
|
1194
|
+
if (!import_app_data5.BUILD.vdomText || text === null) {
|
|
1195
|
+
if (import_app_data5.BUILD.svg) {
|
|
1528
1196
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1529
1197
|
}
|
|
1530
|
-
if (
|
|
1531
|
-
if (
|
|
1532
|
-
if (
|
|
1198
|
+
if (import_app_data5.BUILD.vdomAttribute || import_app_data5.BUILD.reflect) {
|
|
1199
|
+
if (import_app_data5.BUILD.slot && tag === "slot" && !useNativeShadowDom) {
|
|
1200
|
+
if (import_app_data5.BUILD.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
|
|
1533
1201
|
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
1534
1202
|
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
1535
1203
|
}
|
|
@@ -1537,67 +1205,41 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1537
1205
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
1538
1206
|
}
|
|
1539
1207
|
}
|
|
1540
|
-
if (
|
|
1208
|
+
if (import_app_data5.BUILD.updatable && oldChildren !== null && newChildren !== null) {
|
|
1541
1209
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
1542
1210
|
} else if (newChildren !== null) {
|
|
1543
|
-
if (
|
|
1211
|
+
if (import_app_data5.BUILD.updatable && import_app_data5.BUILD.vdomText && oldVNode.$text$ !== null) {
|
|
1544
1212
|
elm.textContent = "";
|
|
1545
1213
|
}
|
|
1546
1214
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
1547
1215
|
} else if (
|
|
1548
1216
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
1549
|
-
!isInitialRender &&
|
|
1217
|
+
!isInitialRender && import_app_data5.BUILD.updatable && oldChildren !== null
|
|
1550
1218
|
) {
|
|
1551
1219
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1552
1220
|
}
|
|
1553
|
-
if (
|
|
1221
|
+
if (import_app_data5.BUILD.svg && isSvgMode && tag === "svg") {
|
|
1554
1222
|
isSvgMode = false;
|
|
1555
1223
|
}
|
|
1556
|
-
} else if (
|
|
1224
|
+
} else if (import_app_data5.BUILD.vdomText && import_app_data5.BUILD.slotRelocation && (defaultHolder = elm["s-cr"])) {
|
|
1557
1225
|
defaultHolder.parentNode.textContent = text;
|
|
1558
|
-
} else if (
|
|
1226
|
+
} else if (import_app_data5.BUILD.vdomText && oldVNode.$text$ !== text) {
|
|
1559
1227
|
elm.data = text;
|
|
1560
1228
|
}
|
|
1561
1229
|
};
|
|
1562
|
-
var updateFallbackSlotVisibility = (elm) => {
|
|
1563
|
-
const childNodes = elm.childNodes;
|
|
1564
|
-
for (const childNode of childNodes) {
|
|
1565
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1566
|
-
if (childNode["s-sr"]) {
|
|
1567
|
-
const slotName = childNode["s-sn"];
|
|
1568
|
-
childNode.hidden = false;
|
|
1569
|
-
for (const siblingNode of childNodes) {
|
|
1570
|
-
if (siblingNode !== childNode) {
|
|
1571
|
-
if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
|
|
1572
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
|
|
1573
|
-
childNode.hidden = true;
|
|
1574
|
-
break;
|
|
1575
|
-
}
|
|
1576
|
-
} else {
|
|
1577
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
|
|
1578
|
-
childNode.hidden = true;
|
|
1579
|
-
break;
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
}
|
|
1584
|
-
}
|
|
1585
|
-
updateFallbackSlotVisibility(childNode);
|
|
1586
|
-
}
|
|
1587
|
-
}
|
|
1588
|
-
};
|
|
1589
1230
|
var relocateNodes = [];
|
|
1590
1231
|
var markSlotContentForRelocation = (elm) => {
|
|
1591
1232
|
let node;
|
|
1592
1233
|
let hostContentNodes;
|
|
1593
1234
|
let j;
|
|
1594
|
-
|
|
1235
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1236
|
+
for (const childNode of children) {
|
|
1595
1237
|
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1596
|
-
hostContentNodes = node.parentNode.childNodes;
|
|
1238
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1597
1239
|
const slotName = childNode["s-sn"];
|
|
1598
1240
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1599
1241
|
node = hostContentNodes[j];
|
|
1600
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!
|
|
1242
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!import_app_data5.BUILD.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
1601
1243
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1602
1244
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1603
1245
|
checkSlotFallbackVisibility = true;
|
|
@@ -1635,60 +1277,40 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1635
1277
|
}
|
|
1636
1278
|
}
|
|
1637
1279
|
};
|
|
1638
|
-
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
1639
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1640
|
-
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
1641
|
-
return true;
|
|
1642
|
-
}
|
|
1643
|
-
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
1644
|
-
return true;
|
|
1645
|
-
}
|
|
1646
|
-
return false;
|
|
1647
|
-
}
|
|
1648
|
-
if (nodeToRelocate["s-sn"] === slotName) {
|
|
1649
|
-
return true;
|
|
1650
|
-
}
|
|
1651
|
-
return slotName === "";
|
|
1652
|
-
};
|
|
1653
1280
|
var nullifyVNodeRefs = (vNode) => {
|
|
1654
|
-
if (
|
|
1281
|
+
if (import_app_data5.BUILD.vdomRef) {
|
|
1655
1282
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1656
1283
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1657
1284
|
}
|
|
1658
1285
|
};
|
|
1659
1286
|
var insertBefore = (parent, newNode, reference) => {
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
updateElementScopeIds(newNode, parent);
|
|
1287
|
+
if (import_app_data5.BUILD.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
1288
|
+
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
1663
1289
|
}
|
|
1290
|
+
const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1664
1291
|
return inserted;
|
|
1665
1292
|
};
|
|
1666
|
-
|
|
1667
|
-
const scopeIds = [];
|
|
1668
|
-
if (element) {
|
|
1669
|
-
scopeIds.push(
|
|
1670
|
-
...element["s-scs"] || [],
|
|
1671
|
-
element["s-si"],
|
|
1672
|
-
element["s-sc"],
|
|
1673
|
-
...findScopeIds(element.parentElement)
|
|
1674
|
-
);
|
|
1675
|
-
}
|
|
1676
|
-
return scopeIds;
|
|
1677
|
-
};
|
|
1678
|
-
var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
|
|
1293
|
+
function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
|
|
1679
1294
|
var _a;
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1295
|
+
let scopeId2;
|
|
1296
|
+
if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
|
|
1297
|
+
const scopeName = slotNode["s-sn"];
|
|
1298
|
+
const hostName = slotNode["s-hn"];
|
|
1299
|
+
(_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
|
|
1300
|
+
if (oldParent && oldParent.classList.contains(scopeId2 + "-s")) {
|
|
1301
|
+
let child = (oldParent.__childNodes || oldParent.childNodes)[0];
|
|
1302
|
+
let found = false;
|
|
1303
|
+
while (child) {
|
|
1304
|
+
if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
|
|
1305
|
+
found = true;
|
|
1306
|
+
break;
|
|
1687
1307
|
}
|
|
1308
|
+
child = child.nextSibling;
|
|
1688
1309
|
}
|
|
1310
|
+
if (!found) oldParent.classList.remove(scopeId2 + "-s");
|
|
1689
1311
|
}
|
|
1690
1312
|
}
|
|
1691
|
-
}
|
|
1313
|
+
}
|
|
1692
1314
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1693
1315
|
var _a, _b, _c, _d, _e;
|
|
1694
1316
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -1696,7 +1318,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1696
1318
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1697
1319
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1698
1320
|
hostTagName = hostElm.tagName;
|
|
1699
|
-
if (
|
|
1321
|
+
if (import_app_data5.BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
1700
1322
|
throw new Error(`The <Host> must be the single root component.
|
|
1701
1323
|
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
1702
1324
|
|
|
@@ -1710,7 +1332,7 @@ render() {
|
|
|
1710
1332
|
}
|
|
1711
1333
|
`);
|
|
1712
1334
|
}
|
|
1713
|
-
if (
|
|
1335
|
+
if (import_app_data5.BUILD.reflect && cmpMeta.$attrsToReflect$) {
|
|
1714
1336
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1715
1337
|
cmpMeta.$attrsToReflect$.map(
|
|
1716
1338
|
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
@@ -1726,24 +1348,24 @@ render() {
|
|
|
1726
1348
|
rootVnode.$tag$ = null;
|
|
1727
1349
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1728
1350
|
hostRef.$vnode$ = rootVnode;
|
|
1729
|
-
rootVnode.$elm$ = oldVNode.$elm$ =
|
|
1730
|
-
if (
|
|
1351
|
+
rootVnode.$elm$ = oldVNode.$elm$ = import_app_data5.BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
|
|
1352
|
+
if (import_app_data5.BUILD.scoped || import_app_data5.BUILD.shadowDom) {
|
|
1731
1353
|
scopeId = hostElm["s-sc"];
|
|
1732
1354
|
}
|
|
1733
1355
|
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1734
|
-
if (
|
|
1356
|
+
if (import_app_data5.BUILD.slotRelocation) {
|
|
1735
1357
|
contentRef = hostElm["s-cr"];
|
|
1736
1358
|
checkSlotFallbackVisibility = false;
|
|
1737
1359
|
}
|
|
1738
1360
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1739
|
-
if (
|
|
1361
|
+
if (import_app_data5.BUILD.slotRelocation) {
|
|
1740
1362
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1741
1363
|
if (checkSlotRelocate) {
|
|
1742
1364
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1743
1365
|
for (const relocateData of relocateNodes) {
|
|
1744
1366
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1745
1367
|
if (!nodeToRelocate["s-ol"]) {
|
|
1746
|
-
const orgLocationNode =
|
|
1368
|
+
const orgLocationNode = import_app_data5.BUILD.isDebug || import_app_data5.BUILD.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
|
|
1747
1369
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1748
1370
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1749
1371
|
}
|
|
@@ -1754,7 +1376,7 @@ render() {
|
|
|
1754
1376
|
if (slotRefNode) {
|
|
1755
1377
|
const parentNodeRef = slotRefNode.parentNode;
|
|
1756
1378
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1757
|
-
if (!
|
|
1379
|
+
if (!import_app_data5.BUILD.hydrateServerSide && (!import_app_data5.BUILD.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
1758
1380
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1759
1381
|
while (orgLocationNode) {
|
|
1760
1382
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
@@ -1773,11 +1395,11 @@ render() {
|
|
|
1773
1395
|
}
|
|
1774
1396
|
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
1775
1397
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1776
|
-
if (!
|
|
1398
|
+
if (!import_app_data5.BUILD.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1777
1399
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1778
1400
|
}
|
|
1779
1401
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1780
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1402
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1781
1403
|
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1782
1404
|
}
|
|
1783
1405
|
}
|
|
@@ -1793,53 +1415,1000 @@ render() {
|
|
|
1793
1415
|
}
|
|
1794
1416
|
}
|
|
1795
1417
|
}
|
|
1796
|
-
if (checkSlotFallbackVisibility) {
|
|
1797
|
-
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1798
|
-
}
|
|
1799
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1800
|
-
relocateNodes.length = 0;
|
|
1418
|
+
if (checkSlotFallbackVisibility) {
|
|
1419
|
+
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1420
|
+
}
|
|
1421
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1422
|
+
relocateNodes.length = 0;
|
|
1423
|
+
}
|
|
1424
|
+
if (import_app_data5.BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1425
|
+
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1426
|
+
for (const childNode of children) {
|
|
1427
|
+
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
1428
|
+
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
1429
|
+
childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
|
|
1430
|
+
}
|
|
1431
|
+
childNode.hidden = true;
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
contentRef = void 0;
|
|
1436
|
+
};
|
|
1437
|
+
var slotReferenceDebugNode = (slotVNode) => doc.createComment(
|
|
1438
|
+
`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
|
|
1439
|
+
);
|
|
1440
|
+
var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
|
|
1441
|
+
`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
|
|
1442
|
+
);
|
|
1443
|
+
|
|
1444
|
+
// src/runtime/dom-extras.ts
|
|
1445
|
+
var patchPseudoShadowDom = (hostElementPrototype) => {
|
|
1446
|
+
patchCloneNode(hostElementPrototype);
|
|
1447
|
+
patchSlotAppendChild(hostElementPrototype);
|
|
1448
|
+
patchSlotAppend(hostElementPrototype);
|
|
1449
|
+
patchSlotPrepend(hostElementPrototype);
|
|
1450
|
+
patchSlotInsertAdjacentElement(hostElementPrototype);
|
|
1451
|
+
patchSlotInsertAdjacentHTML(hostElementPrototype);
|
|
1452
|
+
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
1453
|
+
patchTextContent(hostElementPrototype);
|
|
1454
|
+
patchChildSlotNodes(hostElementPrototype);
|
|
1455
|
+
patchSlotRemoveChild(hostElementPrototype);
|
|
1456
|
+
};
|
|
1457
|
+
var patchCloneNode = (HostElementPrototype) => {
|
|
1458
|
+
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
1459
|
+
HostElementPrototype.cloneNode = function(deep) {
|
|
1460
|
+
const srcNode = this;
|
|
1461
|
+
const isShadowDom = import_app_data6.BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
1462
|
+
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
1463
|
+
if (import_app_data6.BUILD.slot && !isShadowDom && deep) {
|
|
1464
|
+
let i2 = 0;
|
|
1465
|
+
let slotted, nonRindoNode;
|
|
1466
|
+
const rindoPrivates = [
|
|
1467
|
+
"s-id",
|
|
1468
|
+
"s-cr",
|
|
1469
|
+
"s-lr",
|
|
1470
|
+
"s-rc",
|
|
1471
|
+
"s-sc",
|
|
1472
|
+
"s-p",
|
|
1473
|
+
"s-cn",
|
|
1474
|
+
"s-sr",
|
|
1475
|
+
"s-sn",
|
|
1476
|
+
"s-hn",
|
|
1477
|
+
"s-ol",
|
|
1478
|
+
"s-nr",
|
|
1479
|
+
"s-si",
|
|
1480
|
+
"s-rf",
|
|
1481
|
+
"s-scs"
|
|
1482
|
+
];
|
|
1483
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
1484
|
+
for (; i2 < childNodes.length; i2++) {
|
|
1485
|
+
slotted = childNodes[i2]["s-nr"];
|
|
1486
|
+
nonRindoNode = rindoPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
1487
|
+
if (slotted) {
|
|
1488
|
+
if (import_app_data6.BUILD.appendChildSlotFix && clonedNode.__appendChild) {
|
|
1489
|
+
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
1490
|
+
} else {
|
|
1491
|
+
clonedNode.appendChild(slotted.cloneNode(true));
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
if (nonRindoNode) {
|
|
1495
|
+
clonedNode.appendChild(childNodes[i2].cloneNode(true));
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
return clonedNode;
|
|
1500
|
+
};
|
|
1501
|
+
};
|
|
1502
|
+
var patchSlotAppendChild = (HostElementPrototype) => {
|
|
1503
|
+
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
1504
|
+
HostElementPrototype.appendChild = function(newChild) {
|
|
1505
|
+
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1506
|
+
const slotNode = getHostSlotNodes(this.__childNodes || this.childNodes, this.tagName, slotName)[0];
|
|
1507
|
+
if (slotNode) {
|
|
1508
|
+
addSlotRelocateNode(newChild, slotNode);
|
|
1509
|
+
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
1510
|
+
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
1511
|
+
const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
1512
|
+
updateFallbackSlotVisibility(this);
|
|
1513
|
+
return insertedNode;
|
|
1514
|
+
}
|
|
1515
|
+
return this.__appendChild(newChild);
|
|
1516
|
+
};
|
|
1517
|
+
};
|
|
1518
|
+
var patchSlotRemoveChild = (ElementPrototype) => {
|
|
1519
|
+
ElementPrototype.__removeChild = ElementPrototype.removeChild;
|
|
1520
|
+
ElementPrototype.removeChild = function(toRemove) {
|
|
1521
|
+
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
1522
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
1523
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
|
|
1524
|
+
if (slotNode && toRemove.isConnected) {
|
|
1525
|
+
toRemove.remove();
|
|
1526
|
+
updateFallbackSlotVisibility(this);
|
|
1527
|
+
return;
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
return this.__removeChild(toRemove);
|
|
1531
|
+
};
|
|
1532
|
+
};
|
|
1533
|
+
var patchSlotPrepend = (HostElementPrototype) => {
|
|
1534
|
+
HostElementPrototype.__prepend = HostElementPrototype.prepend;
|
|
1535
|
+
HostElementPrototype.prepend = function(...newChildren) {
|
|
1536
|
+
newChildren.forEach((newChild) => {
|
|
1537
|
+
if (typeof newChild === "string") {
|
|
1538
|
+
newChild = this.ownerDocument.createTextNode(newChild);
|
|
1539
|
+
}
|
|
1540
|
+
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1541
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
1542
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];
|
|
1543
|
+
if (slotNode) {
|
|
1544
|
+
addSlotRelocateNode(newChild, slotNode, true);
|
|
1545
|
+
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
1546
|
+
const appendAfter = slotChildNodes[0];
|
|
1547
|
+
return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
1548
|
+
}
|
|
1549
|
+
if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
|
|
1550
|
+
newChild.hidden = true;
|
|
1551
|
+
}
|
|
1552
|
+
return HostElementPrototype.__prepend(newChild);
|
|
1553
|
+
});
|
|
1554
|
+
};
|
|
1555
|
+
};
|
|
1556
|
+
var patchSlotAppend = (HostElementPrototype) => {
|
|
1557
|
+
HostElementPrototype.__append = HostElementPrototype.append;
|
|
1558
|
+
HostElementPrototype.append = function(...newChildren) {
|
|
1559
|
+
newChildren.forEach((newChild) => {
|
|
1560
|
+
if (typeof newChild === "string") {
|
|
1561
|
+
newChild = this.ownerDocument.createTextNode(newChild);
|
|
1562
|
+
}
|
|
1563
|
+
this.appendChild(newChild);
|
|
1564
|
+
});
|
|
1565
|
+
};
|
|
1566
|
+
};
|
|
1567
|
+
var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
|
|
1568
|
+
const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
|
|
1569
|
+
HostElementPrototype.insertAdjacentHTML = function(position, text) {
|
|
1570
|
+
if (position !== "afterbegin" && position !== "beforeend") {
|
|
1571
|
+
return originalInsertAdjacentHtml.call(this, position, text);
|
|
1572
|
+
}
|
|
1573
|
+
const container = this.ownerDocument.createElement("_");
|
|
1574
|
+
let node;
|
|
1575
|
+
container.innerHTML = text;
|
|
1576
|
+
if (position === "afterbegin") {
|
|
1577
|
+
while (node = container.firstChild) {
|
|
1578
|
+
this.prepend(node);
|
|
1579
|
+
}
|
|
1580
|
+
} else if (position === "beforeend") {
|
|
1581
|
+
while (node = container.firstChild) {
|
|
1582
|
+
this.append(node);
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
};
|
|
1586
|
+
};
|
|
1587
|
+
var patchSlotInsertAdjacentText = (HostElementPrototype) => {
|
|
1588
|
+
HostElementPrototype.insertAdjacentText = function(position, text) {
|
|
1589
|
+
this.insertAdjacentHTML(position, text);
|
|
1590
|
+
};
|
|
1591
|
+
};
|
|
1592
|
+
var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
1593
|
+
const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
|
|
1594
|
+
HostElementPrototype.insertAdjacentElement = function(position, element) {
|
|
1595
|
+
if (position !== "afterbegin" && position !== "beforeend") {
|
|
1596
|
+
return originalInsertAdjacentElement.call(this, position, element);
|
|
1597
|
+
}
|
|
1598
|
+
if (position === "afterbegin") {
|
|
1599
|
+
this.prepend(element);
|
|
1600
|
+
return element;
|
|
1601
|
+
} else if (position === "beforeend") {
|
|
1602
|
+
this.append(element);
|
|
1603
|
+
return element;
|
|
1604
|
+
}
|
|
1605
|
+
return element;
|
|
1606
|
+
};
|
|
1607
|
+
};
|
|
1608
|
+
var patchTextContent = (hostElementPrototype) => {
|
|
1609
|
+
patchHostOriginalAccessor("textContent", hostElementPrototype);
|
|
1610
|
+
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
1611
|
+
get: function() {
|
|
1612
|
+
let text = "";
|
|
1613
|
+
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
1614
|
+
childNodes.forEach((node) => text += node.textContent || "");
|
|
1615
|
+
return text;
|
|
1616
|
+
},
|
|
1617
|
+
set: function(value) {
|
|
1618
|
+
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
1619
|
+
childNodes.forEach((node) => {
|
|
1620
|
+
if (node["s-ol"]) node["s-ol"].remove();
|
|
1621
|
+
node.remove();
|
|
1622
|
+
});
|
|
1623
|
+
this.insertAdjacentHTML("beforeend", value);
|
|
1624
|
+
}
|
|
1625
|
+
});
|
|
1626
|
+
};
|
|
1627
|
+
var patchChildSlotNodes = (elm) => {
|
|
1628
|
+
class FakeNodeList extends Array {
|
|
1629
|
+
item(n) {
|
|
1630
|
+
return this[n];
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
patchHostOriginalAccessor("children", elm);
|
|
1634
|
+
Object.defineProperty(elm, "children", {
|
|
1635
|
+
get() {
|
|
1636
|
+
return this.childNodes.filter((n) => n.nodeType === 1);
|
|
1637
|
+
}
|
|
1638
|
+
});
|
|
1639
|
+
Object.defineProperty(elm, "childElementCount", {
|
|
1640
|
+
get() {
|
|
1641
|
+
return this.children.length;
|
|
1642
|
+
}
|
|
1643
|
+
});
|
|
1644
|
+
patchHostOriginalAccessor("firstChild", elm);
|
|
1645
|
+
Object.defineProperty(elm, "firstChild", {
|
|
1646
|
+
get() {
|
|
1647
|
+
return this.childNodes[0];
|
|
1648
|
+
}
|
|
1649
|
+
});
|
|
1650
|
+
patchHostOriginalAccessor("lastChild", elm);
|
|
1651
|
+
Object.defineProperty(elm, "lastChild", {
|
|
1652
|
+
get() {
|
|
1653
|
+
return this.childNodes[this.childNodes.length - 1];
|
|
1654
|
+
}
|
|
1655
|
+
});
|
|
1656
|
+
patchHostOriginalAccessor("childNodes", elm);
|
|
1657
|
+
Object.defineProperty(elm, "childNodes", {
|
|
1658
|
+
get() {
|
|
1659
|
+
var _a, _b;
|
|
1660
|
+
if (!plt.$flags$ || !((_a = getHostRef(this)) == null ? void 0 : _a.$flags$) || (plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && ((_b = getHostRef(this)) == null ? void 0 : _b.$flags$) & 2 /* hasRendered */) {
|
|
1661
|
+
const result = new FakeNodeList();
|
|
1662
|
+
const nodes = getSlottedChildNodes(this.__childNodes);
|
|
1663
|
+
result.push(...nodes);
|
|
1664
|
+
return result;
|
|
1665
|
+
}
|
|
1666
|
+
return FakeNodeList.from(this.__childNodes);
|
|
1667
|
+
}
|
|
1668
|
+
});
|
|
1669
|
+
};
|
|
1670
|
+
var patchNextPrev = (node) => {
|
|
1671
|
+
if (!node || node.__nextSibling || !globalThis.Node) return;
|
|
1672
|
+
patchNextSibling(node);
|
|
1673
|
+
patchPreviousSibling(node);
|
|
1674
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
1675
|
+
patchNextElementSibling(node);
|
|
1676
|
+
patchPreviousElementSibling(node);
|
|
1677
|
+
}
|
|
1678
|
+
};
|
|
1679
|
+
var patchNextSibling = (node) => {
|
|
1680
|
+
if (!node || node.__nextSibling) return;
|
|
1681
|
+
patchHostOriginalAccessor("nextSibling", node);
|
|
1682
|
+
Object.defineProperty(node, "nextSibling", {
|
|
1683
|
+
get: function() {
|
|
1684
|
+
var _a;
|
|
1685
|
+
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
|
|
1686
|
+
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
1687
|
+
if (parentNodes && index > -1) {
|
|
1688
|
+
return parentNodes[index + 1];
|
|
1689
|
+
}
|
|
1690
|
+
return this.__nextSibling;
|
|
1691
|
+
}
|
|
1692
|
+
});
|
|
1693
|
+
};
|
|
1694
|
+
var patchNextElementSibling = (element) => {
|
|
1695
|
+
if (!element || element.__nextElementSibling) return;
|
|
1696
|
+
patchHostOriginalAccessor("nextElementSibling", element);
|
|
1697
|
+
Object.defineProperty(element, "nextElementSibling", {
|
|
1698
|
+
get: function() {
|
|
1699
|
+
var _a;
|
|
1700
|
+
const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
|
|
1701
|
+
const index = parentEles == null ? void 0 : parentEles.indexOf(this);
|
|
1702
|
+
if (parentEles && index > -1) {
|
|
1703
|
+
return parentEles[index + 1];
|
|
1704
|
+
}
|
|
1705
|
+
return this.__nextElementSibling;
|
|
1706
|
+
}
|
|
1707
|
+
});
|
|
1708
|
+
};
|
|
1709
|
+
var patchPreviousSibling = (node) => {
|
|
1710
|
+
if (!node || node.__previousSibling) return;
|
|
1711
|
+
patchHostOriginalAccessor("previousSibling", node);
|
|
1712
|
+
Object.defineProperty(node, "previousSibling", {
|
|
1713
|
+
get: function() {
|
|
1714
|
+
var _a;
|
|
1715
|
+
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
|
|
1716
|
+
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
1717
|
+
if (parentNodes && index > -1) {
|
|
1718
|
+
return parentNodes[index - 1];
|
|
1719
|
+
}
|
|
1720
|
+
return this.__previousSibling;
|
|
1721
|
+
}
|
|
1722
|
+
});
|
|
1723
|
+
};
|
|
1724
|
+
var patchPreviousElementSibling = (element) => {
|
|
1725
|
+
if (!element || element.__previousElementSibling) return;
|
|
1726
|
+
patchHostOriginalAccessor("previousElementSibling", element);
|
|
1727
|
+
Object.defineProperty(element, "previousElementSibling", {
|
|
1728
|
+
get: function() {
|
|
1729
|
+
var _a;
|
|
1730
|
+
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
|
|
1731
|
+
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
1732
|
+
if (parentNodes && index > -1) {
|
|
1733
|
+
return parentNodes[index - 1];
|
|
1734
|
+
}
|
|
1735
|
+
return this.__previousElementSibling;
|
|
1736
|
+
}
|
|
1737
|
+
});
|
|
1738
|
+
};
|
|
1739
|
+
var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
|
|
1740
|
+
var validNodesPatches = [
|
|
1741
|
+
"childNodes",
|
|
1742
|
+
"firstChild",
|
|
1743
|
+
"lastChild",
|
|
1744
|
+
"nextSibling",
|
|
1745
|
+
"previousSibling",
|
|
1746
|
+
"textContent"
|
|
1747
|
+
];
|
|
1748
|
+
function patchHostOriginalAccessor(accessorName, node) {
|
|
1749
|
+
let accessor;
|
|
1750
|
+
if (validElementPatches.includes(accessorName)) {
|
|
1751
|
+
accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
|
|
1752
|
+
} else if (validNodesPatches.includes(accessorName)) {
|
|
1753
|
+
accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);
|
|
1754
|
+
}
|
|
1755
|
+
if (!accessor) {
|
|
1756
|
+
accessor = Object.getOwnPropertyDescriptor(node, accessorName);
|
|
1757
|
+
}
|
|
1758
|
+
if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
// src/runtime/profile.ts
|
|
1762
|
+
var import_app_data7 = require("@rindo/core/internal/app-data");
|
|
1763
|
+
var i = 0;
|
|
1764
|
+
var createTime = (fnName, tagName = "") => {
|
|
1765
|
+
if (import_app_data7.BUILD.profile && performance.mark) {
|
|
1766
|
+
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
1767
|
+
performance.mark(key);
|
|
1768
|
+
return () => performance.measure(`[Rindo] ${fnName}() <${tagName}>`, key);
|
|
1769
|
+
} else {
|
|
1770
|
+
return () => {
|
|
1771
|
+
return;
|
|
1772
|
+
};
|
|
1773
|
+
}
|
|
1774
|
+
};
|
|
1775
|
+
var uniqueTime = (key, measureText) => {
|
|
1776
|
+
if (import_app_data7.BUILD.profile && performance.mark) {
|
|
1777
|
+
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
1778
|
+
performance.mark(key);
|
|
1779
|
+
}
|
|
1780
|
+
return () => {
|
|
1781
|
+
if (performance.getEntriesByName(measureText, "measure").length === 0) {
|
|
1782
|
+
performance.measure(measureText, key);
|
|
1783
|
+
}
|
|
1784
|
+
};
|
|
1785
|
+
} else {
|
|
1786
|
+
return () => {
|
|
1787
|
+
return;
|
|
1788
|
+
};
|
|
1789
|
+
}
|
|
1790
|
+
};
|
|
1791
|
+
var inspect = (ref) => {
|
|
1792
|
+
const hostRef = getHostRef(ref);
|
|
1793
|
+
if (!hostRef) {
|
|
1794
|
+
return void 0;
|
|
1795
|
+
}
|
|
1796
|
+
const flags = hostRef.$flags$;
|
|
1797
|
+
const hostElement = hostRef.$hostElement$;
|
|
1798
|
+
return {
|
|
1799
|
+
renderCount: hostRef.$renderCount$,
|
|
1800
|
+
flags: {
|
|
1801
|
+
hasRendered: !!(flags & 2 /* hasRendered */),
|
|
1802
|
+
hasConnected: !!(flags & 1 /* hasConnected */),
|
|
1803
|
+
isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
|
|
1804
|
+
isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
|
|
1805
|
+
isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
|
|
1806
|
+
hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
|
|
1807
|
+
hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
|
|
1808
|
+
isWatchReady: !!(flags & 128 /* isWatchReady */),
|
|
1809
|
+
isListenReady: !!(flags & 256 /* isListenReady */),
|
|
1810
|
+
needsRerender: !!(flags & 512 /* needsRerender */)
|
|
1811
|
+
},
|
|
1812
|
+
instanceValues: hostRef.$instanceValues$,
|
|
1813
|
+
ancestorComponent: hostRef.$ancestorComponent$,
|
|
1814
|
+
hostElement,
|
|
1815
|
+
lazyInstance: hostRef.$lazyInstance$,
|
|
1816
|
+
vnode: hostRef.$vnode$,
|
|
1817
|
+
modeName: hostRef.$modeName$,
|
|
1818
|
+
onReadyPromise: hostRef.$onReadyPromise$,
|
|
1819
|
+
onReadyResolve: hostRef.$onReadyResolve$,
|
|
1820
|
+
onInstancePromise: hostRef.$onInstancePromise$,
|
|
1821
|
+
onInstanceResolve: hostRef.$onInstanceResolve$,
|
|
1822
|
+
onRenderResolve: hostRef.$onRenderResolve$,
|
|
1823
|
+
queuedListeners: hostRef.$queuedListeners$,
|
|
1824
|
+
rmListeners: hostRef.$rmListeners$,
|
|
1825
|
+
["s-id"]: hostElement["s-id"],
|
|
1826
|
+
["s-cr"]: hostElement["s-cr"],
|
|
1827
|
+
["s-lr"]: hostElement["s-lr"],
|
|
1828
|
+
["s-p"]: hostElement["s-p"],
|
|
1829
|
+
["s-rc"]: hostElement["s-rc"],
|
|
1830
|
+
["s-sc"]: hostElement["s-sc"]
|
|
1831
|
+
};
|
|
1832
|
+
};
|
|
1833
|
+
var installDevTools = () => {
|
|
1834
|
+
if (import_app_data7.BUILD.devTools) {
|
|
1835
|
+
const rindo = win.rindo = win.rindo || {};
|
|
1836
|
+
const originalInspect = rindo.inspect;
|
|
1837
|
+
rindo.inspect = (ref) => {
|
|
1838
|
+
let result = inspect(ref);
|
|
1839
|
+
if (!result && typeof originalInspect === "function") {
|
|
1840
|
+
result = originalInspect(ref);
|
|
1841
|
+
}
|
|
1842
|
+
return result;
|
|
1843
|
+
};
|
|
1844
|
+
}
|
|
1845
|
+
};
|
|
1846
|
+
|
|
1847
|
+
// src/runtime/client-hydrate.ts
|
|
1848
|
+
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
1849
|
+
const endHydrate = createTime("hydrateClient", tagName);
|
|
1850
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
1851
|
+
const childRenderNodes = [];
|
|
1852
|
+
const slotNodes = [];
|
|
1853
|
+
const slottedNodes = [];
|
|
1854
|
+
const shadowRootNodes = import_app_data8.BUILD.shadowDom && shadowRoot ? [] : null;
|
|
1855
|
+
const vnode = newVNode(tagName, null);
|
|
1856
|
+
vnode.$elm$ = hostElm;
|
|
1857
|
+
let scopeId2;
|
|
1858
|
+
if (import_app_data8.BUILD.scoped) {
|
|
1859
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1860
|
+
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
1861
|
+
scopeId2 = hostElm["s-sc"];
|
|
1862
|
+
hostElm.classList.add(scopeId2 + "-h");
|
|
1863
|
+
} else if (hostElm["s-sc"]) {
|
|
1864
|
+
delete hostElm["s-sc"];
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
if (!plt.$orgLocNodes$) {
|
|
1868
|
+
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
1869
|
+
}
|
|
1870
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
1871
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
1872
|
+
hostRef.$vnode$ = clientHydrate(
|
|
1873
|
+
vnode,
|
|
1874
|
+
childRenderNodes,
|
|
1875
|
+
slotNodes,
|
|
1876
|
+
shadowRootNodes,
|
|
1877
|
+
hostElm,
|
|
1878
|
+
hostElm,
|
|
1879
|
+
hostId,
|
|
1880
|
+
slottedNodes
|
|
1881
|
+
);
|
|
1882
|
+
let crIndex = 0;
|
|
1883
|
+
const crLength = childRenderNodes.length;
|
|
1884
|
+
let childRenderNode;
|
|
1885
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
|
1886
|
+
childRenderNode = childRenderNodes[crIndex];
|
|
1887
|
+
const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
|
|
1888
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
1889
|
+
const node = childRenderNode.$elm$;
|
|
1890
|
+
if (!shadowRoot) {
|
|
1891
|
+
node["s-hn"] = tagName.toUpperCase();
|
|
1892
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
1893
|
+
node["s-cr"] = hostElm["s-cr"];
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
1897
|
+
if (childRenderNode.$children$) {
|
|
1898
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
1899
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
1900
|
+
childRenderNode.$children$.forEach((c) => {
|
|
1901
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
1902
|
+
});
|
|
1903
|
+
}
|
|
1904
|
+
} else {
|
|
1905
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
1909
|
+
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
1910
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
1911
|
+
}
|
|
1912
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
1913
|
+
if (!shadowRoot) {
|
|
1914
|
+
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1918
|
+
}
|
|
1919
|
+
const hosts = [];
|
|
1920
|
+
const snLen = slottedNodes.length;
|
|
1921
|
+
let snIndex = 0;
|
|
1922
|
+
let slotGroup;
|
|
1923
|
+
let snGroupIdx;
|
|
1924
|
+
let snGroupLen;
|
|
1925
|
+
let slottedItem;
|
|
1926
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
|
1927
|
+
slotGroup = slottedNodes[snIndex];
|
|
1928
|
+
if (!slotGroup || !slotGroup.length) continue;
|
|
1929
|
+
snGroupLen = slotGroup.length;
|
|
1930
|
+
snGroupIdx = 0;
|
|
1931
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
1932
|
+
slottedItem = slotGroup[snGroupIdx];
|
|
1933
|
+
if (!hosts[slottedItem.hostId]) {
|
|
1934
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
1935
|
+
}
|
|
1936
|
+
if (!hosts[slottedItem.hostId]) continue;
|
|
1937
|
+
const hostEle = hosts[slottedItem.hostId];
|
|
1938
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
1939
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
1940
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
1941
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
1942
|
+
} else {
|
|
1943
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1944
|
+
}
|
|
1945
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1946
|
+
if (import_app_data8.BUILD.experimentalSlotFixes) {
|
|
1947
|
+
patchNextPrev(slottedItem.node);
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
1951
|
+
hostEle.appendChild(slottedItem.node);
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
if (import_app_data8.BUILD.scoped && scopeId2 && slotNodes.length) {
|
|
1956
|
+
slotNodes.forEach((slot) => {
|
|
1957
|
+
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
if (import_app_data8.BUILD.shadowDom && shadowRoot) {
|
|
1961
|
+
let rnIdex = 0;
|
|
1962
|
+
const rnLen = shadowRootNodes.length;
|
|
1963
|
+
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
1964
|
+
shadowRoot.appendChild(shadowRootNodes[rnIdex]);
|
|
1965
|
+
}
|
|
1966
|
+
Array.from(hostElm.childNodes).forEach((node) => {
|
|
1967
|
+
if (node.nodeType === 8 /* CommentNode */ && typeof node["s-sn"] !== "string") {
|
|
1968
|
+
node.parentNode.removeChild(node);
|
|
1969
|
+
}
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1972
|
+
hostRef.$hostElement$ = hostElm;
|
|
1973
|
+
endHydrate();
|
|
1974
|
+
};
|
|
1975
|
+
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
|
1976
|
+
let childNodeType;
|
|
1977
|
+
let childIdSplt;
|
|
1978
|
+
let childVNode;
|
|
1979
|
+
let i2;
|
|
1980
|
+
const scopeId2 = hostElm["s-sc"];
|
|
1981
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
1982
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
1983
|
+
if (childNodeType) {
|
|
1984
|
+
childIdSplt = childNodeType.split(".");
|
|
1985
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
1986
|
+
childVNode = createSimpleVNode({
|
|
1987
|
+
$flags$: 0,
|
|
1988
|
+
$hostId$: childIdSplt[0],
|
|
1989
|
+
$nodeId$: childIdSplt[1],
|
|
1990
|
+
$depth$: childIdSplt[2],
|
|
1991
|
+
$index$: childIdSplt[3],
|
|
1992
|
+
$tag$: node.tagName.toLowerCase(),
|
|
1993
|
+
$elm$: node,
|
|
1994
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
1995
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
1996
|
+
$attrs$: { class: node.className || "" }
|
|
1997
|
+
});
|
|
1998
|
+
childRenderNodes.push(childVNode);
|
|
1999
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
2000
|
+
if (!parentVNode.$children$) {
|
|
2001
|
+
parentVNode.$children$ = [];
|
|
2002
|
+
}
|
|
2003
|
+
if (import_app_data8.BUILD.scoped && scopeId2) {
|
|
2004
|
+
node["s-si"] = scopeId2;
|
|
2005
|
+
childVNode.$attrs$.class += " " + scopeId2;
|
|
2006
|
+
}
|
|
2007
|
+
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
2008
|
+
if (typeof slotName === "string") {
|
|
2009
|
+
if (childVNode.$tag$ === "slot-fb") {
|
|
2010
|
+
addSlot(
|
|
2011
|
+
slotName,
|
|
2012
|
+
childIdSplt[2],
|
|
2013
|
+
childVNode,
|
|
2014
|
+
node,
|
|
2015
|
+
parentVNode,
|
|
2016
|
+
childRenderNodes,
|
|
2017
|
+
slotNodes,
|
|
2018
|
+
shadowRootNodes,
|
|
2019
|
+
slottedNodes
|
|
2020
|
+
);
|
|
2021
|
+
if (import_app_data8.BUILD.scoped && scopeId2) {
|
|
2022
|
+
node.classList.add(scopeId2);
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
childVNode.$elm$["s-sn"] = slotName;
|
|
2026
|
+
childVNode.$elm$.removeAttribute("s-sn");
|
|
2027
|
+
}
|
|
2028
|
+
if (childVNode.$index$ !== void 0) {
|
|
2029
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
2030
|
+
}
|
|
2031
|
+
parentVNode = childVNode;
|
|
2032
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
2033
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
if (node.shadowRoot) {
|
|
2038
|
+
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
2039
|
+
clientHydrate(
|
|
2040
|
+
parentVNode,
|
|
2041
|
+
childRenderNodes,
|
|
2042
|
+
slotNodes,
|
|
2043
|
+
shadowRootNodes,
|
|
2044
|
+
hostElm,
|
|
2045
|
+
node.shadowRoot.childNodes[i2],
|
|
2046
|
+
hostId,
|
|
2047
|
+
slottedNodes
|
|
2048
|
+
);
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
2052
|
+
for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
|
|
2053
|
+
clientHydrate(
|
|
2054
|
+
parentVNode,
|
|
2055
|
+
childRenderNodes,
|
|
2056
|
+
slotNodes,
|
|
2057
|
+
shadowRootNodes,
|
|
2058
|
+
hostElm,
|
|
2059
|
+
nonShadowNodes[i2],
|
|
2060
|
+
hostId,
|
|
2061
|
+
slottedNodes
|
|
2062
|
+
);
|
|
2063
|
+
}
|
|
2064
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
2065
|
+
childIdSplt = node.nodeValue.split(".");
|
|
2066
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
2067
|
+
childNodeType = childIdSplt[0];
|
|
2068
|
+
childVNode = createSimpleVNode({
|
|
2069
|
+
$hostId$: childIdSplt[1],
|
|
2070
|
+
$nodeId$: childIdSplt[2],
|
|
2071
|
+
$depth$: childIdSplt[3],
|
|
2072
|
+
$index$: childIdSplt[4] || "0",
|
|
2073
|
+
$elm$: node,
|
|
2074
|
+
$attrs$: null,
|
|
2075
|
+
$children$: null,
|
|
2076
|
+
$key$: null,
|
|
2077
|
+
$name$: null,
|
|
2078
|
+
$tag$: null,
|
|
2079
|
+
$text$: null
|
|
2080
|
+
});
|
|
2081
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
2082
|
+
childVNode.$elm$ = node.nextSibling;
|
|
2083
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
2084
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
2085
|
+
childRenderNodes.push(childVNode);
|
|
2086
|
+
node.remove();
|
|
2087
|
+
if (hostId === childVNode.$hostId$) {
|
|
2088
|
+
if (!parentVNode.$children$) {
|
|
2089
|
+
parentVNode.$children$ = [];
|
|
2090
|
+
}
|
|
2091
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
2092
|
+
}
|
|
2093
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
2094
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
} else if (childNodeType === COMMENT_NODE_ID) {
|
|
2098
|
+
childVNode.$elm$ = node.nextSibling;
|
|
2099
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
|
|
2100
|
+
childRenderNodes.push(childVNode);
|
|
2101
|
+
node.remove();
|
|
2102
|
+
}
|
|
2103
|
+
} else if (childVNode.$hostId$ === hostId) {
|
|
2104
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
2105
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
2106
|
+
addSlot(
|
|
2107
|
+
slotName,
|
|
2108
|
+
childIdSplt[2],
|
|
2109
|
+
childVNode,
|
|
2110
|
+
node,
|
|
2111
|
+
parentVNode,
|
|
2112
|
+
childRenderNodes,
|
|
2113
|
+
slotNodes,
|
|
2114
|
+
shadowRootNodes,
|
|
2115
|
+
slottedNodes
|
|
2116
|
+
);
|
|
2117
|
+
} else if (childNodeType === CONTENT_REF_ID) {
|
|
2118
|
+
if (import_app_data8.BUILD.shadowDom && shadowRootNodes) {
|
|
2119
|
+
node.remove();
|
|
2120
|
+
} else if (import_app_data8.BUILD.slotRelocation) {
|
|
2121
|
+
hostElm["s-cr"] = node;
|
|
2122
|
+
node["s-cn"] = true;
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
2128
|
+
const vnode = newVNode(null, node.textContent);
|
|
2129
|
+
vnode.$elm$ = node;
|
|
2130
|
+
vnode.$index$ = "0";
|
|
2131
|
+
parentVNode.$children$ = [vnode];
|
|
2132
|
+
}
|
|
2133
|
+
return parentVNode;
|
|
2134
|
+
};
|
|
2135
|
+
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
2136
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
2137
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
|
2138
|
+
if (componentId) {
|
|
2139
|
+
orgLocNodes.set(componentId, node);
|
|
2140
|
+
}
|
|
2141
|
+
let i2 = 0;
|
|
2142
|
+
if (node.shadowRoot) {
|
|
2143
|
+
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
2144
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
2148
|
+
for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
|
|
2149
|
+
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
2150
|
+
}
|
|
2151
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
2152
|
+
const childIdSplt = node.nodeValue.split(".");
|
|
2153
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
2154
|
+
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
2155
|
+
node.nodeValue = "";
|
|
2156
|
+
node["s-en"] = childIdSplt[3];
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
};
|
|
2160
|
+
var createSimpleVNode = (vnode) => {
|
|
2161
|
+
const defaultVNode = {
|
|
2162
|
+
$flags$: 0,
|
|
2163
|
+
$hostId$: null,
|
|
2164
|
+
$nodeId$: null,
|
|
2165
|
+
$depth$: null,
|
|
2166
|
+
$index$: "0",
|
|
2167
|
+
$elm$: null,
|
|
2168
|
+
$attrs$: null,
|
|
2169
|
+
$children$: null,
|
|
2170
|
+
$key$: null,
|
|
2171
|
+
$name$: null,
|
|
2172
|
+
$tag$: null,
|
|
2173
|
+
$text$: null
|
|
2174
|
+
};
|
|
2175
|
+
return { ...defaultVNode, ...vnode };
|
|
2176
|
+
};
|
|
2177
|
+
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
2178
|
+
node["s-sr"] = true;
|
|
2179
|
+
childVNode.$name$ = slotName || null;
|
|
2180
|
+
childVNode.$tag$ = "slot";
|
|
2181
|
+
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
2182
|
+
if (import_app_data8.BUILD.shadowDom && shadowRootNodes) {
|
|
2183
|
+
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
2184
|
+
if (childVNode.$name$) {
|
|
2185
|
+
childVNode.$elm$.setAttribute("name", slotName);
|
|
2186
|
+
}
|
|
2187
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
2188
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
2189
|
+
} else {
|
|
2190
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
2191
|
+
}
|
|
2192
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
2193
|
+
node.remove();
|
|
2194
|
+
if (childVNode.$depth$ === "0") {
|
|
2195
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
2196
|
+
}
|
|
2197
|
+
} else {
|
|
2198
|
+
const slot = childVNode.$elm$;
|
|
2199
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
2200
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
2201
|
+
if (shouldMove) {
|
|
2202
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
2203
|
+
}
|
|
2204
|
+
childRenderNodes.push(childVNode);
|
|
2205
|
+
}
|
|
2206
|
+
slotNodes.push(childVNode);
|
|
2207
|
+
if (!parentVNode.$children$) {
|
|
2208
|
+
parentVNode.$children$ = [];
|
|
2209
|
+
}
|
|
2210
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
2211
|
+
}
|
|
2212
|
+
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
2213
|
+
let slottedNode = slotNode.nextSibling;
|
|
2214
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
2215
|
+
while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
|
|
2216
|
+
slottedNode["s-sn"] = slotName;
|
|
2217
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
2218
|
+
slottedNode = slottedNode.nextSibling;
|
|
2219
|
+
}
|
|
2220
|
+
};
|
|
2221
|
+
|
|
2222
|
+
// src/runtime/initialize-component.ts
|
|
2223
|
+
var import_app_data16 = require("@rindo/core/internal/app-data");
|
|
2224
|
+
|
|
2225
|
+
// src/runtime/mode.ts
|
|
2226
|
+
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
2227
|
+
var setMode = (handler) => modeResolutionChain.push(handler);
|
|
2228
|
+
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
2229
|
+
|
|
2230
|
+
// src/runtime/proxy-component.ts
|
|
2231
|
+
var import_app_data15 = require("@rindo/core/internal/app-data");
|
|
2232
|
+
|
|
2233
|
+
// src/runtime/set-value.ts
|
|
2234
|
+
var import_app_data14 = require("@rindo/core/internal/app-data");
|
|
2235
|
+
|
|
2236
|
+
// src/runtime/parse-property-value.ts
|
|
2237
|
+
var import_app_data9 = require("@rindo/core/internal/app-data");
|
|
2238
|
+
var parsePropertyValue = (propValue, propType) => {
|
|
2239
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
2240
|
+
if (import_app_data9.BUILD.propBoolean && propType & 4 /* Boolean */) {
|
|
2241
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
2242
|
+
}
|
|
2243
|
+
if (import_app_data9.BUILD.propNumber && propType & 2 /* Number */) {
|
|
2244
|
+
return parseFloat(propValue);
|
|
2245
|
+
}
|
|
2246
|
+
if (import_app_data9.BUILD.propString && propType & 1 /* String */) {
|
|
2247
|
+
return String(propValue);
|
|
2248
|
+
}
|
|
2249
|
+
return propValue;
|
|
2250
|
+
}
|
|
2251
|
+
return propValue;
|
|
2252
|
+
};
|
|
2253
|
+
|
|
2254
|
+
// src/runtime/update-component.ts
|
|
2255
|
+
var import_app_data13 = require("@rindo/core/internal/app-data");
|
|
2256
|
+
|
|
2257
|
+
// src/runtime/event-emitter.ts
|
|
2258
|
+
var import_app_data11 = require("@rindo/core/internal/app-data");
|
|
2259
|
+
|
|
2260
|
+
// src/runtime/element.ts
|
|
2261
|
+
var import_app_data10 = require("@rindo/core/internal/app-data");
|
|
2262
|
+
var getElement = (ref) => import_app_data10.BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
2263
|
+
|
|
2264
|
+
// src/runtime/event-emitter.ts
|
|
2265
|
+
var createEvent = (ref, name, flags) => {
|
|
2266
|
+
const elm = getElement(ref);
|
|
2267
|
+
return {
|
|
2268
|
+
emit: (detail) => {
|
|
2269
|
+
if (import_app_data11.BUILD.isDev && !elm.isConnected) {
|
|
2270
|
+
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
2271
|
+
}
|
|
2272
|
+
return emitEvent(elm, name, {
|
|
2273
|
+
bubbles: !!(flags & 4 /* Bubbles */),
|
|
2274
|
+
composed: !!(flags & 2 /* Composed */),
|
|
2275
|
+
cancelable: !!(flags & 1 /* Cancellable */),
|
|
2276
|
+
detail
|
|
2277
|
+
});
|
|
2278
|
+
}
|
|
2279
|
+
};
|
|
2280
|
+
};
|
|
2281
|
+
var emitEvent = (elm, name, opts) => {
|
|
2282
|
+
const ev = plt.ce(name, opts);
|
|
2283
|
+
elm.dispatchEvent(ev);
|
|
2284
|
+
return ev;
|
|
2285
|
+
};
|
|
2286
|
+
|
|
2287
|
+
// src/runtime/styles.ts
|
|
2288
|
+
var import_app_data12 = require("@rindo/core/internal/app-data");
|
|
2289
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
2290
|
+
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
2291
|
+
let style = styles.get(scopeId2);
|
|
2292
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
2293
|
+
style = style || new CSSStyleSheet();
|
|
2294
|
+
if (typeof style === "string") {
|
|
2295
|
+
style = cssText;
|
|
2296
|
+
} else {
|
|
2297
|
+
style.replaceSync(cssText);
|
|
2298
|
+
}
|
|
2299
|
+
} else {
|
|
2300
|
+
style = cssText;
|
|
2301
|
+
}
|
|
2302
|
+
styles.set(scopeId2, style);
|
|
2303
|
+
};
|
|
2304
|
+
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
2305
|
+
var _a;
|
|
2306
|
+
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
2307
|
+
const style = styles.get(scopeId2);
|
|
2308
|
+
if (!import_app_data12.BUILD.attachStyles) {
|
|
2309
|
+
return scopeId2;
|
|
2310
|
+
}
|
|
2311
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
2312
|
+
if (style) {
|
|
2313
|
+
if (typeof style === "string") {
|
|
2314
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
2315
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
2316
|
+
let styleElm;
|
|
2317
|
+
if (!appliedStyles) {
|
|
2318
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
2319
|
+
}
|
|
2320
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
2321
|
+
if (import_app_data12.BUILD.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
2322
|
+
styleElm.innerHTML = style;
|
|
2323
|
+
} else {
|
|
2324
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
2325
|
+
styleElm.innerHTML = style;
|
|
2326
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
2327
|
+
if (nonce != null) {
|
|
2328
|
+
styleElm.setAttribute("nonce", nonce);
|
|
2329
|
+
}
|
|
2330
|
+
if ((import_app_data12.BUILD.hydrateServerSide || import_app_data12.BUILD.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2331
|
+
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
2332
|
+
}
|
|
2333
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
2334
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
2335
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
2336
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
2337
|
+
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
2338
|
+
} else if ("host" in styleContainerNode) {
|
|
2339
|
+
if (supportsConstructableStylesheets) {
|
|
2340
|
+
const stylesheet = new CSSStyleSheet();
|
|
2341
|
+
stylesheet.replaceSync(style);
|
|
2342
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
2343
|
+
} else {
|
|
2344
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
2345
|
+
if (existingStyleContainer) {
|
|
2346
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
2347
|
+
} else {
|
|
2348
|
+
styleContainerNode.prepend(styleElm);
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
} else {
|
|
2352
|
+
styleContainerNode.append(styleElm);
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
|
|
2356
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
2360
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
2361
|
+
}
|
|
2362
|
+
if (appliedStyles) {
|
|
2363
|
+
appliedStyles.add(scopeId2);
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
} else if (import_app_data12.BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
2367
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
2368
|
+
}
|
|
1801
2369
|
}
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
2370
|
+
return scopeId2;
|
|
2371
|
+
};
|
|
2372
|
+
var attachStyles = (hostRef) => {
|
|
2373
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
2374
|
+
const elm = hostRef.$hostElement$;
|
|
2375
|
+
const flags = cmpMeta.$flags$;
|
|
2376
|
+
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
2377
|
+
const scopeId2 = addStyle(
|
|
2378
|
+
import_app_data12.BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
2379
|
+
cmpMeta,
|
|
2380
|
+
hostRef.$modeName$
|
|
2381
|
+
);
|
|
2382
|
+
if ((import_app_data12.BUILD.shadowDom || import_app_data12.BUILD.scoped) && import_app_data12.BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
2383
|
+
elm["s-sc"] = scopeId2;
|
|
2384
|
+
elm.classList.add(scopeId2 + "-h");
|
|
1811
2385
|
}
|
|
1812
|
-
|
|
2386
|
+
endAttachStyles();
|
|
1813
2387
|
};
|
|
1814
|
-
var
|
|
1815
|
-
`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
|
|
1816
|
-
);
|
|
1817
|
-
var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
|
|
1818
|
-
`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
|
|
1819
|
-
);
|
|
2388
|
+
var getScopeId = (cmp, mode) => "sc-" + (import_app_data12.BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
1820
2389
|
|
|
1821
2390
|
// src/runtime/update-component.ts
|
|
1822
2391
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1823
|
-
if (
|
|
2392
|
+
if (import_app_data13.BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
1824
2393
|
ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
|
|
1825
2394
|
}
|
|
1826
2395
|
};
|
|
1827
2396
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1828
|
-
if (
|
|
2397
|
+
if (import_app_data13.BUILD.taskQueue && import_app_data13.BUILD.updatable) {
|
|
1829
2398
|
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1830
2399
|
}
|
|
1831
|
-
if (
|
|
2400
|
+
if (import_app_data13.BUILD.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1832
2401
|
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1833
2402
|
return;
|
|
1834
2403
|
}
|
|
1835
2404
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
1836
2405
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
1837
|
-
return
|
|
2406
|
+
return import_app_data13.BUILD.taskQueue ? writeTask(dispatch) : dispatch();
|
|
1838
2407
|
};
|
|
1839
2408
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
1840
2409
|
const elm = hostRef.$hostElement$;
|
|
1841
2410
|
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
1842
|
-
const instance =
|
|
2411
|
+
const instance = import_app_data13.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1843
2412
|
if (!instance) {
|
|
1844
2413
|
throw new Error(
|
|
1845
2414
|
`Can't render component <${elm.tagName.toLowerCase()} /> with invalid Rindo runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://rindojs.web.app/docs/custom-elements#externalruntime`
|
|
@@ -1847,7 +2416,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1847
2416
|
}
|
|
1848
2417
|
let maybePromise;
|
|
1849
2418
|
if (isInitialLoad) {
|
|
1850
|
-
if (
|
|
2419
|
+
if (import_app_data13.BUILD.lazyLoad && import_app_data13.BUILD.hostListener) {
|
|
1851
2420
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1852
2421
|
if (hostRef.$queuedListeners$) {
|
|
1853
2422
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
@@ -1855,17 +2424,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1855
2424
|
}
|
|
1856
2425
|
}
|
|
1857
2426
|
emitLifecycleEvent(elm, "componentWillLoad");
|
|
1858
|
-
if (
|
|
2427
|
+
if (import_app_data13.BUILD.cmpWillLoad) {
|
|
1859
2428
|
maybePromise = safeCall(instance, "componentWillLoad");
|
|
1860
2429
|
}
|
|
1861
2430
|
} else {
|
|
1862
2431
|
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
1863
|
-
if (
|
|
2432
|
+
if (import_app_data13.BUILD.cmpWillUpdate) {
|
|
1864
2433
|
maybePromise = safeCall(instance, "componentWillUpdate");
|
|
1865
2434
|
}
|
|
1866
2435
|
}
|
|
1867
2436
|
emitLifecycleEvent(elm, "componentWillRender");
|
|
1868
|
-
if (
|
|
2437
|
+
if (import_app_data13.BUILD.cmpWillRender) {
|
|
1869
2438
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
1870
2439
|
}
|
|
1871
2440
|
endSchedule();
|
|
@@ -1881,23 +2450,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1881
2450
|
const elm = hostRef.$hostElement$;
|
|
1882
2451
|
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
1883
2452
|
const rc = elm["s-rc"];
|
|
1884
|
-
if (
|
|
2453
|
+
if (import_app_data13.BUILD.style && isInitialLoad) {
|
|
1885
2454
|
attachStyles(hostRef);
|
|
1886
2455
|
}
|
|
1887
2456
|
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
1888
|
-
if (
|
|
2457
|
+
if (import_app_data13.BUILD.isDev) {
|
|
1889
2458
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1890
2459
|
}
|
|
1891
|
-
if (
|
|
2460
|
+
if (import_app_data13.BUILD.hydrateServerSide) {
|
|
1892
2461
|
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
1893
2462
|
} else {
|
|
1894
2463
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
1895
2464
|
}
|
|
1896
|
-
if (
|
|
2465
|
+
if (import_app_data13.BUILD.isDev) {
|
|
1897
2466
|
hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
|
|
1898
2467
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1899
2468
|
}
|
|
1900
|
-
if (
|
|
2469
|
+
if (import_app_data13.BUILD.hydrateServerSide) {
|
|
1901
2470
|
try {
|
|
1902
2471
|
serverSideConnected(elm);
|
|
1903
2472
|
if (isInitialLoad) {
|
|
@@ -1911,13 +2480,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1911
2480
|
consoleError(e, elm);
|
|
1912
2481
|
}
|
|
1913
2482
|
}
|
|
1914
|
-
if (
|
|
2483
|
+
if (import_app_data13.BUILD.asyncLoading && rc) {
|
|
1915
2484
|
rc.map((cb) => cb());
|
|
1916
2485
|
elm["s-rc"] = void 0;
|
|
1917
2486
|
}
|
|
1918
2487
|
endRender();
|
|
1919
2488
|
endUpdate();
|
|
1920
|
-
if (
|
|
2489
|
+
if (import_app_data13.BUILD.asyncLoading) {
|
|
1921
2490
|
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
1922
2491
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1923
2492
|
if (childrenPromises.length === 0) {
|
|
@@ -1933,10 +2502,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1933
2502
|
};
|
|
1934
2503
|
var renderingRef = null;
|
|
1935
2504
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
1936
|
-
const allRenderFn =
|
|
1937
|
-
const lazyLoad =
|
|
1938
|
-
const taskQueue =
|
|
1939
|
-
const updatable =
|
|
2505
|
+
const allRenderFn = import_app_data13.BUILD.allRenderFn ? true : false;
|
|
2506
|
+
const lazyLoad = import_app_data13.BUILD.lazyLoad ? true : false;
|
|
2507
|
+
const taskQueue = import_app_data13.BUILD.taskQueue ? true : false;
|
|
2508
|
+
const updatable = import_app_data13.BUILD.updatable ? true : false;
|
|
1940
2509
|
try {
|
|
1941
2510
|
renderingRef = instance;
|
|
1942
2511
|
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
@@ -1946,9 +2515,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
1946
2515
|
if (updatable || lazyLoad) {
|
|
1947
2516
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1948
2517
|
}
|
|
1949
|
-
if (
|
|
1950
|
-
if (
|
|
1951
|
-
if (
|
|
2518
|
+
if (import_app_data13.BUILD.hasRenderFn || import_app_data13.BUILD.reflect) {
|
|
2519
|
+
if (import_app_data13.BUILD.vdomRender || import_app_data13.BUILD.reflect) {
|
|
2520
|
+
if (import_app_data13.BUILD.hydrateServerSide) {
|
|
1952
2521
|
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
1953
2522
|
} else {
|
|
1954
2523
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
@@ -1973,57 +2542,57 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1973
2542
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1974
2543
|
const elm = hostRef.$hostElement$;
|
|
1975
2544
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1976
|
-
const instance =
|
|
2545
|
+
const instance = import_app_data13.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1977
2546
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1978
|
-
if (
|
|
1979
|
-
if (
|
|
2547
|
+
if (import_app_data13.BUILD.cmpDidRender) {
|
|
2548
|
+
if (import_app_data13.BUILD.isDev) {
|
|
1980
2549
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1981
2550
|
}
|
|
1982
2551
|
safeCall(instance, "componentDidRender");
|
|
1983
|
-
if (
|
|
2552
|
+
if (import_app_data13.BUILD.isDev) {
|
|
1984
2553
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1985
2554
|
}
|
|
1986
2555
|
}
|
|
1987
2556
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
1988
2557
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1989
2558
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1990
|
-
if (
|
|
2559
|
+
if (import_app_data13.BUILD.asyncLoading && import_app_data13.BUILD.cssAnnotations) {
|
|
1991
2560
|
addHydratedFlag(elm);
|
|
1992
2561
|
}
|
|
1993
|
-
if (
|
|
1994
|
-
if (
|
|
2562
|
+
if (import_app_data13.BUILD.cmpDidLoad) {
|
|
2563
|
+
if (import_app_data13.BUILD.isDev) {
|
|
1995
2564
|
hostRef.$flags$ |= 2048 /* devOnDidLoad */;
|
|
1996
2565
|
}
|
|
1997
2566
|
safeCall(instance, "componentDidLoad");
|
|
1998
|
-
if (
|
|
2567
|
+
if (import_app_data13.BUILD.isDev) {
|
|
1999
2568
|
hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
|
|
2000
2569
|
}
|
|
2001
2570
|
}
|
|
2002
2571
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
2003
2572
|
endPostUpdate();
|
|
2004
|
-
if (
|
|
2573
|
+
if (import_app_data13.BUILD.asyncLoading) {
|
|
2005
2574
|
hostRef.$onReadyResolve$(elm);
|
|
2006
2575
|
if (!ancestorComponent) {
|
|
2007
2576
|
appDidLoad(tagName);
|
|
2008
2577
|
}
|
|
2009
2578
|
}
|
|
2010
2579
|
} else {
|
|
2011
|
-
if (
|
|
2012
|
-
if (
|
|
2580
|
+
if (import_app_data13.BUILD.cmpDidUpdate) {
|
|
2581
|
+
if (import_app_data13.BUILD.isDev) {
|
|
2013
2582
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2014
2583
|
}
|
|
2015
2584
|
safeCall(instance, "componentDidUpdate");
|
|
2016
|
-
if (
|
|
2585
|
+
if (import_app_data13.BUILD.isDev) {
|
|
2017
2586
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2018
2587
|
}
|
|
2019
2588
|
}
|
|
2020
2589
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
2021
2590
|
endPostUpdate();
|
|
2022
2591
|
}
|
|
2023
|
-
if (
|
|
2592
|
+
if (import_app_data13.BUILD.method && import_app_data13.BUILD.lazyLoad) {
|
|
2024
2593
|
hostRef.$onInstanceResolve$(elm);
|
|
2025
2594
|
}
|
|
2026
|
-
if (
|
|
2595
|
+
if (import_app_data13.BUILD.asyncLoading) {
|
|
2027
2596
|
if (hostRef.$onRenderResolve$) {
|
|
2028
2597
|
hostRef.$onRenderResolve$();
|
|
2029
2598
|
hostRef.$onRenderResolve$ = void 0;
|
|
@@ -2035,7 +2604,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2035
2604
|
}
|
|
2036
2605
|
};
|
|
2037
2606
|
var forceUpdate = (ref) => {
|
|
2038
|
-
if (
|
|
2607
|
+
if (import_app_data13.BUILD.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
2039
2608
|
const hostRef = getHostRef(ref);
|
|
2040
2609
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
2041
2610
|
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
@@ -2046,15 +2615,15 @@ var forceUpdate = (ref) => {
|
|
|
2046
2615
|
return false;
|
|
2047
2616
|
};
|
|
2048
2617
|
var appDidLoad = (who) => {
|
|
2049
|
-
if (
|
|
2618
|
+
if (import_app_data13.BUILD.cssAnnotations) {
|
|
2050
2619
|
addHydratedFlag(doc.documentElement);
|
|
2051
2620
|
}
|
|
2052
|
-
if (
|
|
2621
|
+
if (import_app_data13.BUILD.asyncQueue) {
|
|
2053
2622
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2054
2623
|
}
|
|
2055
|
-
nextTick(() => emitEvent(win, "appload", { detail: { namespace:
|
|
2056
|
-
if (
|
|
2057
|
-
performance.measure(`[Rindo] ${
|
|
2624
|
+
nextTick(() => emitEvent(win, "appload", { detail: { namespace: import_app_data13.NAMESPACE } }));
|
|
2625
|
+
if (import_app_data13.BUILD.profile && performance.measure) {
|
|
2626
|
+
performance.measure(`[Rindo] ${import_app_data13.NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
2058
2627
|
}
|
|
2059
2628
|
};
|
|
2060
2629
|
var safeCall = (instance, method, arg) => {
|
|
@@ -2068,19 +2637,19 @@ var safeCall = (instance, method, arg) => {
|
|
|
2068
2637
|
return void 0;
|
|
2069
2638
|
};
|
|
2070
2639
|
var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
2071
|
-
if (
|
|
2640
|
+
if (import_app_data13.BUILD.lifecycleDOMEvents) {
|
|
2072
2641
|
emitEvent(elm, "rindo_" + lifecycleName, {
|
|
2073
2642
|
bubbles: true,
|
|
2074
2643
|
composed: true,
|
|
2075
2644
|
detail: {
|
|
2076
|
-
namespace:
|
|
2645
|
+
namespace: import_app_data13.NAMESPACE
|
|
2077
2646
|
}
|
|
2078
2647
|
});
|
|
2079
2648
|
}
|
|
2080
2649
|
};
|
|
2081
2650
|
var addHydratedFlag = (elm) => {
|
|
2082
2651
|
var _a, _b;
|
|
2083
|
-
return
|
|
2652
|
+
return import_app_data13.BUILD.hydratedClass ? elm.classList.add((_a = import_app_data13.BUILD.hydratedSelectorName) != null ? _a : "hydrated") : import_app_data13.BUILD.hydratedAttribute ? elm.setAttribute((_b = import_app_data13.BUILD.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
|
|
2084
2653
|
};
|
|
2085
2654
|
var serverSideConnected = (elm) => {
|
|
2086
2655
|
const children = elm.children;
|
|
@@ -2099,21 +2668,21 @@ var serverSideConnected = (elm) => {
|
|
|
2099
2668
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
2100
2669
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
2101
2670
|
const hostRef = getHostRef(ref);
|
|
2102
|
-
if (
|
|
2671
|
+
if (import_app_data14.BUILD.lazyLoad && !hostRef) {
|
|
2103
2672
|
throw new Error(
|
|
2104
2673
|
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Rindo runtime. This usually happens when integrating a 3rd party Rindo component with another Rindo component or application.`
|
|
2105
2674
|
);
|
|
2106
2675
|
}
|
|
2107
|
-
const elm =
|
|
2676
|
+
const elm = import_app_data14.BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
2108
2677
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
2109
2678
|
const flags = hostRef.$flags$;
|
|
2110
|
-
const instance =
|
|
2679
|
+
const instance = import_app_data14.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2111
2680
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
2112
2681
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
2113
2682
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
2114
|
-
if ((!
|
|
2683
|
+
if ((!import_app_data14.BUILD.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
2115
2684
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
2116
|
-
if (
|
|
2685
|
+
if (import_app_data14.BUILD.isDev) {
|
|
2117
2686
|
if (hostRef.$flags$ & 1024 /* devOnRender */) {
|
|
2118
2687
|
consoleDevWarn(
|
|
2119
2688
|
`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
|
|
@@ -2136,8 +2705,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2136
2705
|
);
|
|
2137
2706
|
}
|
|
2138
2707
|
}
|
|
2139
|
-
if (!
|
|
2140
|
-
if (
|
|
2708
|
+
if (!import_app_data14.BUILD.lazyLoad || instance) {
|
|
2709
|
+
if (import_app_data14.BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
2141
2710
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
2142
2711
|
if (watchMethods) {
|
|
2143
2712
|
watchMethods.map((watchMethodName) => {
|
|
@@ -2149,8 +2718,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2149
2718
|
});
|
|
2150
2719
|
}
|
|
2151
2720
|
}
|
|
2152
|
-
if (
|
|
2153
|
-
if (
|
|
2721
|
+
if (import_app_data14.BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
2722
|
+
if (import_app_data14.BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
2154
2723
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2155
2724
|
return;
|
|
2156
2725
|
}
|
|
@@ -2165,59 +2734,105 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2165
2734
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2166
2735
|
var _a, _b;
|
|
2167
2736
|
const prototype = Cstr.prototype;
|
|
2168
|
-
if (
|
|
2737
|
+
if (import_app_data15.BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
2169
2738
|
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2170
2739
|
const originalFormAssociatedCallback = prototype[cbName];
|
|
2171
2740
|
Object.defineProperty(prototype, cbName, {
|
|
2172
2741
|
value(...args) {
|
|
2173
2742
|
const hostRef = getHostRef(this);
|
|
2174
|
-
const instance =
|
|
2743
|
+
const instance = import_app_data15.BUILD.lazyLoad ? hostRef.$lazyInstance$ : this;
|
|
2175
2744
|
if (!instance) {
|
|
2176
2745
|
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2177
2746
|
const cb = asyncInstance[cbName];
|
|
2178
2747
|
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
2179
2748
|
});
|
|
2180
2749
|
} else {
|
|
2181
|
-
const cb =
|
|
2750
|
+
const cb = import_app_data15.BUILD.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
|
|
2182
2751
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
2183
2752
|
}
|
|
2184
2753
|
}
|
|
2185
2754
|
});
|
|
2186
2755
|
});
|
|
2187
2756
|
}
|
|
2188
|
-
if (
|
|
2189
|
-
if (
|
|
2757
|
+
if (import_app_data15.BUILD.member && cmpMeta.$members$ || import_app_data15.BUILD.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
2758
|
+
if (import_app_data15.BUILD.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
|
|
2190
2759
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2191
2760
|
}
|
|
2192
2761
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
2193
2762
|
members.map(([memberName, [memberFlags]]) => {
|
|
2194
|
-
if ((
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2763
|
+
if ((import_app_data15.BUILD.prop || import_app_data15.BUILD.state) && (memberFlags & 31 /* Prop */ || (!import_app_data15.BUILD.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2764
|
+
if ((memberFlags & 2048 /* Getter */) === 0) {
|
|
2765
|
+
Object.defineProperty(prototype, memberName, {
|
|
2766
|
+
get() {
|
|
2767
|
+
return getValue(this, memberName);
|
|
2768
|
+
},
|
|
2769
|
+
set(newValue) {
|
|
2770
|
+
if (import_app_data15.BUILD.isDev) {
|
|
2771
|
+
const ref = getHostRef(this);
|
|
2772
|
+
if (
|
|
2773
|
+
// we are proxying the instance (not element)
|
|
2774
|
+
(flags & 1 /* isElementConstructor */) === 0 && // the element is not constructing
|
|
2775
|
+
(ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
|
|
2776
|
+
(memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
|
|
2777
|
+
(memberFlags & 1024 /* Mutable */) === 0
|
|
2778
|
+
) {
|
|
2779
|
+
consoleDevWarn(
|
|
2780
|
+
`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
|
|
2211
2781
|
More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
2212
|
-
|
|
2782
|
+
);
|
|
2783
|
+
}
|
|
2213
2784
|
}
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
})
|
|
2220
|
-
|
|
2785
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
2786
|
+
},
|
|
2787
|
+
configurable: true,
|
|
2788
|
+
enumerable: true
|
|
2789
|
+
});
|
|
2790
|
+
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
|
|
2791
|
+
if (import_app_data15.BUILD.lazyLoad) {
|
|
2792
|
+
Object.defineProperty(prototype, memberName, {
|
|
2793
|
+
get() {
|
|
2794
|
+
const ref = getHostRef(this);
|
|
2795
|
+
const instance = import_app_data15.BUILD.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
|
|
2796
|
+
if (!instance) return;
|
|
2797
|
+
return instance[memberName];
|
|
2798
|
+
},
|
|
2799
|
+
configurable: true,
|
|
2800
|
+
enumerable: true
|
|
2801
|
+
});
|
|
2802
|
+
}
|
|
2803
|
+
if (memberFlags & 4096 /* Setter */) {
|
|
2804
|
+
const origSetter = Object.getOwnPropertyDescriptor(prototype, memberName).set;
|
|
2805
|
+
Object.defineProperty(prototype, memberName, {
|
|
2806
|
+
set(newValue) {
|
|
2807
|
+
const ref = getHostRef(this);
|
|
2808
|
+
if (origSetter) {
|
|
2809
|
+
const currentValue = ref.$hostElement$[memberName];
|
|
2810
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2811
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2812
|
+
}
|
|
2813
|
+
origSetter.apply(this, [parsePropertyValue(newValue, cmpMeta.$members$[memberName][0])]);
|
|
2814
|
+
setValue(this, memberName, ref.$hostElement$[memberName], cmpMeta);
|
|
2815
|
+
return;
|
|
2816
|
+
}
|
|
2817
|
+
if (!ref) return;
|
|
2818
|
+
const setterSetVal = () => {
|
|
2819
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
2820
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2821
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2822
|
+
}
|
|
2823
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, cmpMeta.$members$[memberName][0]);
|
|
2824
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
2825
|
+
};
|
|
2826
|
+
if (ref.$lazyInstance$) {
|
|
2827
|
+
setterSetVal();
|
|
2828
|
+
} else {
|
|
2829
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
});
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
} else if (import_app_data15.BUILD.lazyLoad && import_app_data15.BUILD.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
2221
2836
|
Object.defineProperty(prototype, memberName, {
|
|
2222
2837
|
value(...args) {
|
|
2223
2838
|
var _a2;
|
|
@@ -2230,13 +2845,13 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2230
2845
|
});
|
|
2231
2846
|
}
|
|
2232
2847
|
});
|
|
2233
|
-
if (
|
|
2848
|
+
if (import_app_data15.BUILD.observeAttribute && (!import_app_data15.BUILD.lazyLoad || flags & 1 /* isElementConstructor */)) {
|
|
2234
2849
|
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
2235
2850
|
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
2236
2851
|
plt.jmp(() => {
|
|
2237
2852
|
var _a2;
|
|
2238
2853
|
const propName = attrNameToPropName.get(attrName);
|
|
2239
|
-
if (this.hasOwnProperty(propName)) {
|
|
2854
|
+
if (this.hasOwnProperty(propName) && import_app_data15.BUILD.lazyLoad) {
|
|
2240
2855
|
newValue = this[propName];
|
|
2241
2856
|
delete this[propName];
|
|
2242
2857
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -2246,8 +2861,8 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2246
2861
|
const hostRef = getHostRef(this);
|
|
2247
2862
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
2248
2863
|
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
2249
|
-
const elm =
|
|
2250
|
-
const instance =
|
|
2864
|
+
const elm = import_app_data15.BUILD.lazyLoad ? hostRef.$hostElement$ : this;
|
|
2865
|
+
const instance = import_app_data15.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2251
2866
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
2252
2867
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
2253
2868
|
if (instance[callbackName] != null) {
|
|
@@ -2257,7 +2872,10 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2257
2872
|
}
|
|
2258
2873
|
return;
|
|
2259
2874
|
}
|
|
2260
|
-
|
|
2875
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
2876
|
+
if (!propDesc.get || !!propDesc.set) {
|
|
2877
|
+
this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
2878
|
+
}
|
|
2261
2879
|
});
|
|
2262
2880
|
};
|
|
2263
2881
|
Cstr.observedAttributes = Array.from(
|
|
@@ -2267,7 +2885,7 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2267
2885
|
var _a2;
|
|
2268
2886
|
const attrName = m[1] || propName;
|
|
2269
2887
|
attrNameToPropName.set(attrName, propName);
|
|
2270
|
-
if (
|
|
2888
|
+
if (import_app_data15.BUILD.reflect && m[0] & 512 /* ReflectAttr */) {
|
|
2271
2889
|
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
2272
2890
|
}
|
|
2273
2891
|
return attrName;
|
|
@@ -2285,7 +2903,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2285
2903
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
2286
2904
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
2287
2905
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
2288
|
-
if ((
|
|
2906
|
+
if ((import_app_data16.BUILD.lazyLoad || import_app_data16.BUILD.hydrateClientSide) && bundleId) {
|
|
2289
2907
|
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
2290
2908
|
if (CstrImport && "then" in CstrImport) {
|
|
2291
2909
|
const endLoad = uniqueTime(
|
|
@@ -2300,15 +2918,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2300
2918
|
if (!Cstr) {
|
|
2301
2919
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2302
2920
|
}
|
|
2303
|
-
if (
|
|
2304
|
-
if (
|
|
2921
|
+
if (import_app_data16.BUILD.member && !Cstr.isProxied) {
|
|
2922
|
+
if (import_app_data16.BUILD.watchCallback) {
|
|
2305
2923
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2306
2924
|
}
|
|
2307
2925
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
2308
2926
|
Cstr.isProxied = true;
|
|
2309
2927
|
}
|
|
2310
2928
|
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
2311
|
-
if (
|
|
2929
|
+
if (import_app_data16.BUILD.member) {
|
|
2312
2930
|
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
2313
2931
|
}
|
|
2314
2932
|
try {
|
|
@@ -2316,10 +2934,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2316
2934
|
} catch (e) {
|
|
2317
2935
|
consoleError(e);
|
|
2318
2936
|
}
|
|
2319
|
-
if (
|
|
2937
|
+
if (import_app_data16.BUILD.member) {
|
|
2320
2938
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
2321
2939
|
}
|
|
2322
|
-
if (
|
|
2940
|
+
if (import_app_data16.BUILD.watchCallback) {
|
|
2323
2941
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
2324
2942
|
}
|
|
2325
2943
|
endNewInstance();
|
|
@@ -2329,24 +2947,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2329
2947
|
const cmpTag = elm.localName;
|
|
2330
2948
|
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
2331
2949
|
}
|
|
2332
|
-
if (
|
|
2950
|
+
if (import_app_data16.BUILD.style && Cstr && Cstr.style) {
|
|
2333
2951
|
let style;
|
|
2334
2952
|
if (typeof Cstr.style === "string") {
|
|
2335
2953
|
style = Cstr.style;
|
|
2336
|
-
} else if (
|
|
2954
|
+
} else if (import_app_data16.BUILD.mode && typeof Cstr.style !== "string") {
|
|
2337
2955
|
hostRef.$modeName$ = computeMode(elm);
|
|
2338
2956
|
if (hostRef.$modeName$) {
|
|
2339
2957
|
style = Cstr.style[hostRef.$modeName$];
|
|
2340
2958
|
}
|
|
2341
|
-
if (
|
|
2959
|
+
if (import_app_data16.BUILD.hydrateServerSide && hostRef.$modeName$) {
|
|
2342
2960
|
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
2343
2961
|
}
|
|
2344
2962
|
}
|
|
2345
2963
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2346
2964
|
if (!styles.has(scopeId2)) {
|
|
2347
2965
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
2348
|
-
if (!
|
|
2349
|
-
|
|
2966
|
+
if (!import_app_data16.BUILD.hydrateServerSide && import_app_data16.BUILD.shadowDom && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
|
|
2967
|
+
import_app_data16.BUILD.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2350
2968
|
style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
|
|
2351
2969
|
}
|
|
2352
2970
|
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
@@ -2356,14 +2974,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2356
2974
|
}
|
|
2357
2975
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2358
2976
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2359
|
-
if (
|
|
2977
|
+
if (import_app_data16.BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
2360
2978
|
ancestorComponent["s-rc"].push(schedule);
|
|
2361
2979
|
} else {
|
|
2362
2980
|
schedule();
|
|
2363
2981
|
}
|
|
2364
2982
|
};
|
|
2365
2983
|
var fireConnectedCallback = (instance) => {
|
|
2366
|
-
if (
|
|
2984
|
+
if (import_app_data16.BUILD.lazyLoad && import_app_data16.BUILD.connectedCallback) {
|
|
2367
2985
|
safeCall(instance, "connectedCallback");
|
|
2368
2986
|
}
|
|
2369
2987
|
};
|
|
@@ -2374,38 +2992,41 @@ var connectedCallback = (elm) => {
|
|
|
2374
2992
|
const hostRef = getHostRef(elm);
|
|
2375
2993
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2376
2994
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
2377
|
-
if (
|
|
2995
|
+
if (import_app_data17.BUILD.hostListenerTargetParent) {
|
|
2378
2996
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2379
2997
|
}
|
|
2380
2998
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
2381
2999
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2382
3000
|
let hostId;
|
|
2383
|
-
if (
|
|
3001
|
+
if (import_app_data17.BUILD.hydrateClientSide) {
|
|
2384
3002
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2385
3003
|
if (hostId) {
|
|
2386
|
-
if (
|
|
2387
|
-
const scopeId2 =
|
|
3004
|
+
if (import_app_data17.BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3005
|
+
const scopeId2 = import_app_data17.BUILD.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
|
|
2388
3006
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
3007
|
+
} else if (import_app_data17.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3008
|
+
const scopeId2 = getScopeId(cmpMeta, import_app_data17.BUILD.mode ? elm.getAttribute("s-mode") : void 0);
|
|
3009
|
+
elm["s-sc"] = scopeId2;
|
|
2389
3010
|
}
|
|
2390
3011
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2391
3012
|
}
|
|
2392
3013
|
}
|
|
2393
|
-
if (
|
|
2394
|
-
if (
|
|
3014
|
+
if (import_app_data17.BUILD.slotRelocation && !hostId) {
|
|
3015
|
+
if (import_app_data17.BUILD.hydrateServerSide || (import_app_data17.BUILD.slot || import_app_data17.BUILD.shadowDom) && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
|
|
2395
3016
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
2396
3017
|
setContentReference(elm);
|
|
2397
3018
|
}
|
|
2398
3019
|
}
|
|
2399
|
-
if (
|
|
3020
|
+
if (import_app_data17.BUILD.asyncLoading) {
|
|
2400
3021
|
let ancestorComponent = elm;
|
|
2401
3022
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
2402
|
-
if (
|
|
3023
|
+
if (import_app_data17.BUILD.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
2403
3024
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
2404
3025
|
break;
|
|
2405
3026
|
}
|
|
2406
3027
|
}
|
|
2407
3028
|
}
|
|
2408
|
-
if (
|
|
3029
|
+
if (import_app_data17.BUILD.prop && !import_app_data17.BUILD.hydrateServerSide && cmpMeta.$members$) {
|
|
2409
3030
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2410
3031
|
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2411
3032
|
const value = elm[memberName];
|
|
@@ -2414,7 +3035,7 @@ var connectedCallback = (elm) => {
|
|
|
2414
3035
|
}
|
|
2415
3036
|
});
|
|
2416
3037
|
}
|
|
2417
|
-
if (
|
|
3038
|
+
if (import_app_data17.BUILD.initializeNextTick) {
|
|
2418
3039
|
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2419
3040
|
} else {
|
|
2420
3041
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
@@ -2432,32 +3053,32 @@ var connectedCallback = (elm) => {
|
|
|
2432
3053
|
};
|
|
2433
3054
|
var setContentReference = (elm) => {
|
|
2434
3055
|
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
2435
|
-
|
|
3056
|
+
import_app_data17.BUILD.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
2436
3057
|
);
|
|
2437
3058
|
contentRefElm["s-cn"] = true;
|
|
2438
3059
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
2439
3060
|
};
|
|
2440
3061
|
|
|
2441
3062
|
// src/runtime/disconnected-callback.ts
|
|
2442
|
-
var
|
|
3063
|
+
var import_app_data18 = require("@rindo/core/internal/app-data");
|
|
2443
3064
|
var disconnectInstance = (instance) => {
|
|
2444
|
-
if (
|
|
3065
|
+
if (import_app_data18.BUILD.lazyLoad && import_app_data18.BUILD.disconnectedCallback) {
|
|
2445
3066
|
safeCall(instance, "disconnectedCallback");
|
|
2446
3067
|
}
|
|
2447
|
-
if (
|
|
3068
|
+
if (import_app_data18.BUILD.cmpDidUnload) {
|
|
2448
3069
|
safeCall(instance, "componentDidUnload");
|
|
2449
3070
|
}
|
|
2450
3071
|
};
|
|
2451
3072
|
var disconnectedCallback = async (elm) => {
|
|
2452
3073
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2453
3074
|
const hostRef = getHostRef(elm);
|
|
2454
|
-
if (
|
|
3075
|
+
if (import_app_data18.BUILD.hostListener) {
|
|
2455
3076
|
if (hostRef.$rmListeners$) {
|
|
2456
3077
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2457
3078
|
hostRef.$rmListeners$ = void 0;
|
|
2458
3079
|
}
|
|
2459
3080
|
}
|
|
2460
|
-
if (!
|
|
3081
|
+
if (!import_app_data18.BUILD.lazyLoad) {
|
|
2461
3082
|
disconnectInstance(elm);
|
|
2462
3083
|
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2463
3084
|
disconnectInstance(hostRef.$lazyInstance$);
|
|
@@ -2467,325 +3088,6 @@ var disconnectedCallback = async (elm) => {
|
|
|
2467
3088
|
}
|
|
2468
3089
|
};
|
|
2469
3090
|
|
|
2470
|
-
// src/runtime/dom-extras.ts
|
|
2471
|
-
var import_app_data17 = require("@rindo/core/internal/app-data");
|
|
2472
|
-
var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
|
|
2473
|
-
patchCloneNode(hostElementPrototype);
|
|
2474
|
-
patchSlotAppendChild(hostElementPrototype);
|
|
2475
|
-
patchSlotAppend(hostElementPrototype);
|
|
2476
|
-
patchSlotPrepend(hostElementPrototype);
|
|
2477
|
-
patchSlotInsertAdjacentElement(hostElementPrototype);
|
|
2478
|
-
patchSlotInsertAdjacentHTML(hostElementPrototype);
|
|
2479
|
-
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
2480
|
-
patchTextContent(hostElementPrototype);
|
|
2481
|
-
patchChildSlotNodes(hostElementPrototype, descriptorPrototype);
|
|
2482
|
-
patchSlotRemoveChild(hostElementPrototype);
|
|
2483
|
-
};
|
|
2484
|
-
var patchCloneNode = (HostElementPrototype) => {
|
|
2485
|
-
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
2486
|
-
HostElementPrototype.cloneNode = function(deep) {
|
|
2487
|
-
const srcNode = this;
|
|
2488
|
-
const isShadowDom = import_app_data17.BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
2489
|
-
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
2490
|
-
if (import_app_data17.BUILD.slot && !isShadowDom && deep) {
|
|
2491
|
-
let i2 = 0;
|
|
2492
|
-
let slotted, nonRindoNode;
|
|
2493
|
-
const rindoPrivates = [
|
|
2494
|
-
"s-id",
|
|
2495
|
-
"s-cr",
|
|
2496
|
-
"s-lr",
|
|
2497
|
-
"s-rc",
|
|
2498
|
-
"s-sc",
|
|
2499
|
-
"s-p",
|
|
2500
|
-
"s-cn",
|
|
2501
|
-
"s-sr",
|
|
2502
|
-
"s-sn",
|
|
2503
|
-
"s-hn",
|
|
2504
|
-
"s-ol",
|
|
2505
|
-
"s-nr",
|
|
2506
|
-
"s-si",
|
|
2507
|
-
"s-rf",
|
|
2508
|
-
"s-scs"
|
|
2509
|
-
];
|
|
2510
|
-
for (; i2 < srcNode.childNodes.length; i2++) {
|
|
2511
|
-
slotted = srcNode.childNodes[i2]["s-nr"];
|
|
2512
|
-
nonRindoNode = rindoPrivates.every((privateField) => !srcNode.childNodes[i2][privateField]);
|
|
2513
|
-
if (slotted) {
|
|
2514
|
-
if (import_app_data17.BUILD.appendChildSlotFix && clonedNode.__appendChild) {
|
|
2515
|
-
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
2516
|
-
} else {
|
|
2517
|
-
clonedNode.appendChild(slotted.cloneNode(true));
|
|
2518
|
-
}
|
|
2519
|
-
}
|
|
2520
|
-
if (nonRindoNode) {
|
|
2521
|
-
clonedNode.appendChild(srcNode.childNodes[i2].cloneNode(true));
|
|
2522
|
-
}
|
|
2523
|
-
}
|
|
2524
|
-
}
|
|
2525
|
-
return clonedNode;
|
|
2526
|
-
};
|
|
2527
|
-
};
|
|
2528
|
-
var patchSlotAppendChild = (HostElementPrototype) => {
|
|
2529
|
-
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
2530
|
-
HostElementPrototype.appendChild = function(newChild) {
|
|
2531
|
-
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
2532
|
-
const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
|
|
2533
|
-
if (slotNode) {
|
|
2534
|
-
const slotPlaceholder = document.createTextNode("");
|
|
2535
|
-
slotPlaceholder["s-nr"] = newChild;
|
|
2536
|
-
slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
|
|
2537
|
-
newChild["s-ol"] = slotPlaceholder;
|
|
2538
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
2539
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2540
|
-
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
2541
|
-
const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
2542
|
-
updateFallbackSlotVisibility(this);
|
|
2543
|
-
return insertedNode;
|
|
2544
|
-
}
|
|
2545
|
-
return this.__appendChild(newChild);
|
|
2546
|
-
};
|
|
2547
|
-
};
|
|
2548
|
-
var patchSlotRemoveChild = (ElementPrototype) => {
|
|
2549
|
-
ElementPrototype.__removeChild = ElementPrototype.removeChild;
|
|
2550
|
-
ElementPrototype.removeChild = function(toRemove) {
|
|
2551
|
-
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
2552
|
-
const slotNode = getHostSlotNode(this.childNodes, toRemove["s-sn"], this.tagName);
|
|
2553
|
-
if (slotNode) {
|
|
2554
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, toRemove["s-sn"]);
|
|
2555
|
-
const existingNode = slotChildNodes.find((n) => n === toRemove);
|
|
2556
|
-
if (existingNode) {
|
|
2557
|
-
existingNode.remove();
|
|
2558
|
-
updateFallbackSlotVisibility(this);
|
|
2559
|
-
return;
|
|
2560
|
-
}
|
|
2561
|
-
}
|
|
2562
|
-
}
|
|
2563
|
-
return this.__removeChild(toRemove);
|
|
2564
|
-
};
|
|
2565
|
-
};
|
|
2566
|
-
var patchSlotPrepend = (HostElementPrototype) => {
|
|
2567
|
-
const originalPrepend = HostElementPrototype.prepend;
|
|
2568
|
-
HostElementPrototype.prepend = function(...newChildren) {
|
|
2569
|
-
newChildren.forEach((newChild) => {
|
|
2570
|
-
if (typeof newChild === "string") {
|
|
2571
|
-
newChild = this.ownerDocument.createTextNode(newChild);
|
|
2572
|
-
}
|
|
2573
|
-
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
2574
|
-
const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
|
|
2575
|
-
if (slotNode) {
|
|
2576
|
-
const slotPlaceholder = document.createTextNode("");
|
|
2577
|
-
slotPlaceholder["s-nr"] = newChild;
|
|
2578
|
-
slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
|
|
2579
|
-
newChild["s-ol"] = slotPlaceholder;
|
|
2580
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
2581
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2582
|
-
const appendAfter = slotChildNodes[0];
|
|
2583
|
-
return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
2584
|
-
}
|
|
2585
|
-
if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
|
|
2586
|
-
newChild.hidden = true;
|
|
2587
|
-
}
|
|
2588
|
-
return originalPrepend.call(this, newChild);
|
|
2589
|
-
});
|
|
2590
|
-
};
|
|
2591
|
-
};
|
|
2592
|
-
var patchSlotAppend = (HostElementPrototype) => {
|
|
2593
|
-
HostElementPrototype.append = function(...newChildren) {
|
|
2594
|
-
newChildren.forEach((newChild) => {
|
|
2595
|
-
if (typeof newChild === "string") {
|
|
2596
|
-
newChild = this.ownerDocument.createTextNode(newChild);
|
|
2597
|
-
}
|
|
2598
|
-
this.appendChild(newChild);
|
|
2599
|
-
});
|
|
2600
|
-
};
|
|
2601
|
-
};
|
|
2602
|
-
var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
|
|
2603
|
-
const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
|
|
2604
|
-
HostElementPrototype.insertAdjacentHTML = function(position, text) {
|
|
2605
|
-
if (position !== "afterbegin" && position !== "beforeend") {
|
|
2606
|
-
return originalInsertAdjacentHtml.call(this, position, text);
|
|
2607
|
-
}
|
|
2608
|
-
const container = this.ownerDocument.createElement("_");
|
|
2609
|
-
let node;
|
|
2610
|
-
container.innerHTML = text;
|
|
2611
|
-
if (position === "afterbegin") {
|
|
2612
|
-
while (node = container.firstChild) {
|
|
2613
|
-
this.prepend(node);
|
|
2614
|
-
}
|
|
2615
|
-
} else if (position === "beforeend") {
|
|
2616
|
-
while (node = container.firstChild) {
|
|
2617
|
-
this.append(node);
|
|
2618
|
-
}
|
|
2619
|
-
}
|
|
2620
|
-
};
|
|
2621
|
-
};
|
|
2622
|
-
var patchSlotInsertAdjacentText = (HostElementPrototype) => {
|
|
2623
|
-
HostElementPrototype.insertAdjacentText = function(position, text) {
|
|
2624
|
-
this.insertAdjacentHTML(position, text);
|
|
2625
|
-
};
|
|
2626
|
-
};
|
|
2627
|
-
var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
2628
|
-
const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
|
|
2629
|
-
HostElementPrototype.insertAdjacentElement = function(position, element) {
|
|
2630
|
-
if (position !== "afterbegin" && position !== "beforeend") {
|
|
2631
|
-
return originalInsertAdjacentElement.call(this, position, element);
|
|
2632
|
-
}
|
|
2633
|
-
if (position === "afterbegin") {
|
|
2634
|
-
this.prepend(element);
|
|
2635
|
-
return element;
|
|
2636
|
-
} else if (position === "beforeend") {
|
|
2637
|
-
this.append(element);
|
|
2638
|
-
return element;
|
|
2639
|
-
}
|
|
2640
|
-
return element;
|
|
2641
|
-
};
|
|
2642
|
-
};
|
|
2643
|
-
var patchTextContent = (hostElementPrototype) => {
|
|
2644
|
-
const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
|
|
2645
|
-
Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
|
|
2646
|
-
if (import_app_data17.BUILD.experimentalScopedSlotChanges) {
|
|
2647
|
-
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
2648
|
-
// To mimic shadow root behavior, we need to return the text content of all
|
|
2649
|
-
// nodes in a slot reference node
|
|
2650
|
-
get() {
|
|
2651
|
-
const slotRefNodes = getAllChildSlotNodes(this.childNodes);
|
|
2652
|
-
const textContent = slotRefNodes.map((node) => {
|
|
2653
|
-
var _a, _b;
|
|
2654
|
-
const text = [];
|
|
2655
|
-
let slotContent = node.nextSibling;
|
|
2656
|
-
while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
|
|
2657
|
-
if (slotContent.nodeType === 3 /* TEXT_NODE */ || slotContent.nodeType === 1 /* ELEMENT_NODE */) {
|
|
2658
|
-
text.push((_b = (_a = slotContent.textContent) == null ? void 0 : _a.trim()) != null ? _b : "");
|
|
2659
|
-
}
|
|
2660
|
-
slotContent = slotContent.nextSibling;
|
|
2661
|
-
}
|
|
2662
|
-
return text.filter((ref) => ref !== "").join(" ");
|
|
2663
|
-
}).filter((text) => text !== "").join(" ");
|
|
2664
|
-
return " " + textContent + " ";
|
|
2665
|
-
},
|
|
2666
|
-
// To mimic shadow root behavior, we need to overwrite all nodes in a slot
|
|
2667
|
-
// reference node. If a default slot reference node exists, the text content will be
|
|
2668
|
-
// placed there. Otherwise, the new text node will be hidden
|
|
2669
|
-
set(value) {
|
|
2670
|
-
const slotRefNodes = getAllChildSlotNodes(this.childNodes);
|
|
2671
|
-
slotRefNodes.forEach((node) => {
|
|
2672
|
-
let slotContent = node.nextSibling;
|
|
2673
|
-
while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
|
|
2674
|
-
const tmp = slotContent;
|
|
2675
|
-
slotContent = slotContent.nextSibling;
|
|
2676
|
-
tmp.remove();
|
|
2677
|
-
}
|
|
2678
|
-
if (node["s-sn"] === "") {
|
|
2679
|
-
const textNode = this.ownerDocument.createTextNode(value);
|
|
2680
|
-
textNode["s-sn"] = "";
|
|
2681
|
-
insertBefore(node.parentElement, textNode, node.nextSibling);
|
|
2682
|
-
} else {
|
|
2683
|
-
node.remove();
|
|
2684
|
-
}
|
|
2685
|
-
});
|
|
2686
|
-
}
|
|
2687
|
-
});
|
|
2688
|
-
} else {
|
|
2689
|
-
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
2690
|
-
get() {
|
|
2691
|
-
var _a;
|
|
2692
|
-
const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
|
|
2693
|
-
if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
|
|
2694
|
-
return slotNode.nextSibling.textContent;
|
|
2695
|
-
} else if (slotNode) {
|
|
2696
|
-
return slotNode.textContent;
|
|
2697
|
-
} else {
|
|
2698
|
-
return this.__textContent;
|
|
2699
|
-
}
|
|
2700
|
-
},
|
|
2701
|
-
set(value) {
|
|
2702
|
-
var _a;
|
|
2703
|
-
const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
|
|
2704
|
-
if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
|
|
2705
|
-
slotNode.nextSibling.textContent = value;
|
|
2706
|
-
} else if (slotNode) {
|
|
2707
|
-
slotNode.textContent = value;
|
|
2708
|
-
} else {
|
|
2709
|
-
this.__textContent = value;
|
|
2710
|
-
const contentRefElm = this["s-cr"];
|
|
2711
|
-
if (contentRefElm) {
|
|
2712
|
-
insertBefore(this, contentRefElm, this.firstChild);
|
|
2713
|
-
}
|
|
2714
|
-
}
|
|
2715
|
-
}
|
|
2716
|
-
});
|
|
2717
|
-
}
|
|
2718
|
-
};
|
|
2719
|
-
var patchChildSlotNodes = (elm, cmpMeta) => {
|
|
2720
|
-
class FakeNodeList extends Array {
|
|
2721
|
-
item(n) {
|
|
2722
|
-
return this[n];
|
|
2723
|
-
}
|
|
2724
|
-
}
|
|
2725
|
-
if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2726
|
-
const childNodesFn = elm.__lookupGetter__("childNodes");
|
|
2727
|
-
Object.defineProperty(elm, "children", {
|
|
2728
|
-
get() {
|
|
2729
|
-
return this.childNodes.map((n) => n.nodeType === 1);
|
|
2730
|
-
}
|
|
2731
|
-
});
|
|
2732
|
-
Object.defineProperty(elm, "childElementCount", {
|
|
2733
|
-
get() {
|
|
2734
|
-
return elm.children.length;
|
|
2735
|
-
}
|
|
2736
|
-
});
|
|
2737
|
-
Object.defineProperty(elm, "childNodes", {
|
|
2738
|
-
get() {
|
|
2739
|
-
const childNodes = childNodesFn.call(this);
|
|
2740
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && getHostRef(this).$flags$ & 2 /* hasRendered */) {
|
|
2741
|
-
const result = new FakeNodeList();
|
|
2742
|
-
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
2743
|
-
const slot = childNodes[i2]["s-nr"];
|
|
2744
|
-
if (slot) {
|
|
2745
|
-
result.push(slot);
|
|
2746
|
-
}
|
|
2747
|
-
}
|
|
2748
|
-
return result;
|
|
2749
|
-
}
|
|
2750
|
-
return FakeNodeList.from(childNodes);
|
|
2751
|
-
}
|
|
2752
|
-
});
|
|
2753
|
-
}
|
|
2754
|
-
};
|
|
2755
|
-
var getAllChildSlotNodes = (childNodes) => {
|
|
2756
|
-
const slotRefNodes = [];
|
|
2757
|
-
for (const childNode of Array.from(childNodes)) {
|
|
2758
|
-
if (childNode["s-sr"]) {
|
|
2759
|
-
slotRefNodes.push(childNode);
|
|
2760
|
-
}
|
|
2761
|
-
slotRefNodes.push(...getAllChildSlotNodes(childNode.childNodes));
|
|
2762
|
-
}
|
|
2763
|
-
return slotRefNodes;
|
|
2764
|
-
};
|
|
2765
|
-
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
2766
|
-
var getHostSlotNode = (childNodes, slotName, hostName) => {
|
|
2767
|
-
let i2 = 0;
|
|
2768
|
-
let childNode;
|
|
2769
|
-
for (; i2 < childNodes.length; i2++) {
|
|
2770
|
-
childNode = childNodes[i2];
|
|
2771
|
-
if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) {
|
|
2772
|
-
return childNode;
|
|
2773
|
-
}
|
|
2774
|
-
childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
|
|
2775
|
-
if (childNode) {
|
|
2776
|
-
return childNode;
|
|
2777
|
-
}
|
|
2778
|
-
}
|
|
2779
|
-
return null;
|
|
2780
|
-
};
|
|
2781
|
-
var getHostSlotChildNodes = (n, slotName) => {
|
|
2782
|
-
const childNodes = [n];
|
|
2783
|
-
while ((n = n.nextSibling) && n["s-sn"] === slotName) {
|
|
2784
|
-
childNodes.push(n);
|
|
2785
|
-
}
|
|
2786
|
-
return childNodes;
|
|
2787
|
-
};
|
|
2788
|
-
|
|
2789
3091
|
// src/runtime/bootstrap-custom-element.ts
|
|
2790
3092
|
var defineCustomElement = (Cstr, compactMeta) => {
|
|
2791
3093
|
customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
|
|
@@ -2795,67 +3097,67 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2795
3097
|
$flags$: compactMeta[0],
|
|
2796
3098
|
$tagName$: compactMeta[1]
|
|
2797
3099
|
};
|
|
2798
|
-
if (
|
|
3100
|
+
if (import_app_data19.BUILD.member) {
|
|
2799
3101
|
cmpMeta.$members$ = compactMeta[2];
|
|
2800
3102
|
}
|
|
2801
|
-
if (
|
|
3103
|
+
if (import_app_data19.BUILD.hostListener) {
|
|
2802
3104
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2803
3105
|
}
|
|
2804
|
-
if (
|
|
3106
|
+
if (import_app_data19.BUILD.watchCallback) {
|
|
2805
3107
|
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
2806
3108
|
}
|
|
2807
|
-
if (
|
|
3109
|
+
if (import_app_data19.BUILD.reflect) {
|
|
2808
3110
|
cmpMeta.$attrsToReflect$ = [];
|
|
2809
3111
|
}
|
|
2810
|
-
if (
|
|
3112
|
+
if (import_app_data19.BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2811
3113
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2812
3114
|
}
|
|
2813
|
-
if (
|
|
2814
|
-
if (
|
|
2815
|
-
patchPseudoShadowDom(Cstr.prototype
|
|
3115
|
+
if (import_app_data19.BUILD.experimentalSlotFixes) {
|
|
3116
|
+
if (import_app_data19.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3117
|
+
patchPseudoShadowDom(Cstr.prototype);
|
|
2816
3118
|
}
|
|
2817
3119
|
} else {
|
|
2818
|
-
if (
|
|
2819
|
-
patchChildSlotNodes(Cstr.prototype
|
|
3120
|
+
if (import_app_data19.BUILD.slotChildNodesFix) {
|
|
3121
|
+
patchChildSlotNodes(Cstr.prototype);
|
|
2820
3122
|
}
|
|
2821
|
-
if (
|
|
3123
|
+
if (import_app_data19.BUILD.cloneNodeFix) {
|
|
2822
3124
|
patchCloneNode(Cstr.prototype);
|
|
2823
3125
|
}
|
|
2824
|
-
if (
|
|
3126
|
+
if (import_app_data19.BUILD.appendChildSlotFix) {
|
|
2825
3127
|
patchSlotAppendChild(Cstr.prototype);
|
|
2826
3128
|
}
|
|
2827
|
-
if (
|
|
3129
|
+
if (import_app_data19.BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2828
3130
|
patchTextContent(Cstr.prototype);
|
|
2829
3131
|
}
|
|
2830
3132
|
}
|
|
2831
3133
|
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
2832
3134
|
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
2833
|
-
let hasHostListenerAttached = false;
|
|
2834
3135
|
Object.assign(Cstr.prototype, {
|
|
3136
|
+
__hasHostListenerAttached: false,
|
|
2835
3137
|
__registerHost() {
|
|
2836
3138
|
registerHost(this, cmpMeta);
|
|
2837
3139
|
},
|
|
2838
3140
|
connectedCallback() {
|
|
2839
|
-
if (!
|
|
3141
|
+
if (!this.__hasHostListenerAttached) {
|
|
2840
3142
|
const hostRef = getHostRef(this);
|
|
2841
3143
|
addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
|
|
2842
|
-
|
|
3144
|
+
this.__hasHostListenerAttached = true;
|
|
2843
3145
|
}
|
|
2844
3146
|
connectedCallback(this);
|
|
2845
|
-
if (
|
|
3147
|
+
if (import_app_data19.BUILD.connectedCallback && originalConnectedCallback) {
|
|
2846
3148
|
originalConnectedCallback.call(this);
|
|
2847
3149
|
}
|
|
2848
3150
|
},
|
|
2849
3151
|
disconnectedCallback() {
|
|
2850
3152
|
disconnectedCallback(this);
|
|
2851
|
-
if (
|
|
3153
|
+
if (import_app_data19.BUILD.disconnectedCallback && originalDisconnectedCallback) {
|
|
2852
3154
|
originalDisconnectedCallback.call(this);
|
|
2853
3155
|
}
|
|
2854
3156
|
},
|
|
2855
3157
|
__attachShadow() {
|
|
2856
3158
|
if (supportsShadow) {
|
|
2857
3159
|
if (!this.shadowRoot) {
|
|
2858
|
-
if (
|
|
3160
|
+
if (import_app_data19.BUILD.shadowDelegatesFocus) {
|
|
2859
3161
|
this.attachShadow({
|
|
2860
3162
|
mode: "open",
|
|
2861
3163
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -2879,7 +3181,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2879
3181
|
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
2880
3182
|
};
|
|
2881
3183
|
var forceModeUpdate = (elm) => {
|
|
2882
|
-
if (
|
|
3184
|
+
if (import_app_data19.BUILD.style && import_app_data19.BUILD.mode && !import_app_data19.BUILD.lazyLoad) {
|
|
2883
3185
|
const mode = computeMode(elm);
|
|
2884
3186
|
const hostRef = getHostRef(elm);
|
|
2885
3187
|
if (hostRef.$modeName$ !== mode) {
|
|
@@ -2902,7 +3204,7 @@ var forceModeUpdate = (elm) => {
|
|
|
2902
3204
|
};
|
|
2903
3205
|
|
|
2904
3206
|
// src/runtime/bootstrap-lazy.ts
|
|
2905
|
-
var
|
|
3207
|
+
var import_app_data20 = require("@rindo/core/internal/app-data");
|
|
2906
3208
|
|
|
2907
3209
|
// src/runtime/hmr-component.ts
|
|
2908
3210
|
var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
@@ -2914,7 +3216,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
|
2914
3216
|
// src/runtime/bootstrap-lazy.ts
|
|
2915
3217
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
2916
3218
|
var _a;
|
|
2917
|
-
if (
|
|
3219
|
+
if (import_app_data20.BUILD.profile && performance.mark) {
|
|
2918
3220
|
performance.mark("st:app:start");
|
|
2919
3221
|
}
|
|
2920
3222
|
installDevTools();
|
|
@@ -2930,12 +3232,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2930
3232
|
let isBootstrapping = true;
|
|
2931
3233
|
Object.assign(plt, options);
|
|
2932
3234
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
|
|
2933
|
-
if (
|
|
3235
|
+
if (import_app_data20.BUILD.asyncQueue) {
|
|
2934
3236
|
if (options.syncQueue) {
|
|
2935
3237
|
plt.$flags$ |= 4 /* queueSync */;
|
|
2936
3238
|
}
|
|
2937
3239
|
}
|
|
2938
|
-
if (
|
|
3240
|
+
if (import_app_data20.BUILD.hydrateClientSide) {
|
|
2939
3241
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2940
3242
|
}
|
|
2941
3243
|
let hasSlotRelocation = false;
|
|
@@ -2951,22 +3253,22 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2951
3253
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
2952
3254
|
hasSlotRelocation = true;
|
|
2953
3255
|
}
|
|
2954
|
-
if (
|
|
3256
|
+
if (import_app_data20.BUILD.member) {
|
|
2955
3257
|
cmpMeta.$members$ = compactMeta[2];
|
|
2956
3258
|
}
|
|
2957
|
-
if (
|
|
3259
|
+
if (import_app_data20.BUILD.hostListener) {
|
|
2958
3260
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2959
3261
|
}
|
|
2960
|
-
if (
|
|
3262
|
+
if (import_app_data20.BUILD.reflect) {
|
|
2961
3263
|
cmpMeta.$attrsToReflect$ = [];
|
|
2962
3264
|
}
|
|
2963
|
-
if (
|
|
3265
|
+
if (import_app_data20.BUILD.watchCallback) {
|
|
2964
3266
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
2965
3267
|
}
|
|
2966
|
-
if (
|
|
3268
|
+
if (import_app_data20.BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2967
3269
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2968
3270
|
}
|
|
2969
|
-
const tagName =
|
|
3271
|
+
const tagName = import_app_data20.BUILD.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
|
|
2970
3272
|
const HostElement = class extends HTMLElement {
|
|
2971
3273
|
// RindoLazyHost
|
|
2972
3274
|
constructor(self) {
|
|
@@ -2974,10 +3276,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2974
3276
|
this.hasRegisteredEventListeners = false;
|
|
2975
3277
|
self = this;
|
|
2976
3278
|
registerHost(self, cmpMeta);
|
|
2977
|
-
if (
|
|
3279
|
+
if (import_app_data20.BUILD.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2978
3280
|
if (supportsShadow) {
|
|
2979
3281
|
if (!self.shadowRoot) {
|
|
2980
|
-
if (
|
|
3282
|
+
if (import_app_data20.BUILD.shadowDelegatesFocus) {
|
|
2981
3283
|
self.attachShadow({
|
|
2982
3284
|
mode: "open",
|
|
2983
3285
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -2992,7 +3294,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2992
3294
|
);
|
|
2993
3295
|
}
|
|
2994
3296
|
}
|
|
2995
|
-
} else if (!
|
|
3297
|
+
} else if (!import_app_data20.BUILD.hydrateServerSide && !("shadowRoot" in self)) {
|
|
2996
3298
|
self.shadowRoot = self;
|
|
2997
3299
|
}
|
|
2998
3300
|
}
|
|
@@ -3020,28 +3322,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3020
3322
|
return getHostRef(this).$onReadyPromise$;
|
|
3021
3323
|
}
|
|
3022
3324
|
};
|
|
3023
|
-
if (
|
|
3024
|
-
if (
|
|
3025
|
-
patchPseudoShadowDom(HostElement.prototype
|
|
3325
|
+
if (import_app_data20.BUILD.experimentalSlotFixes) {
|
|
3326
|
+
if (import_app_data20.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3327
|
+
patchPseudoShadowDom(HostElement.prototype);
|
|
3026
3328
|
}
|
|
3027
3329
|
} else {
|
|
3028
|
-
if (
|
|
3029
|
-
patchChildSlotNodes(HostElement.prototype
|
|
3330
|
+
if (import_app_data20.BUILD.slotChildNodesFix) {
|
|
3331
|
+
patchChildSlotNodes(HostElement.prototype);
|
|
3030
3332
|
}
|
|
3031
|
-
if (
|
|
3333
|
+
if (import_app_data20.BUILD.cloneNodeFix) {
|
|
3032
3334
|
patchCloneNode(HostElement.prototype);
|
|
3033
3335
|
}
|
|
3034
|
-
if (
|
|
3336
|
+
if (import_app_data20.BUILD.appendChildSlotFix) {
|
|
3035
3337
|
patchSlotAppendChild(HostElement.prototype);
|
|
3036
3338
|
}
|
|
3037
|
-
if (
|
|
3339
|
+
if (import_app_data20.BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3038
3340
|
patchTextContent(HostElement.prototype);
|
|
3039
3341
|
}
|
|
3040
3342
|
}
|
|
3041
|
-
if (
|
|
3343
|
+
if (import_app_data20.BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
|
|
3042
3344
|
HostElement.formAssociated = true;
|
|
3043
3345
|
}
|
|
3044
|
-
if (
|
|
3346
|
+
if (import_app_data20.BUILD.hotModuleReplacement) {
|
|
3045
3347
|
HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
3046
3348
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
3047
3349
|
};
|
|
@@ -3060,7 +3362,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3060
3362
|
if (hasSlotRelocation) {
|
|
3061
3363
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
3062
3364
|
}
|
|
3063
|
-
if (
|
|
3365
|
+
if (import_app_data20.BUILD.invisiblePrehydration && (import_app_data20.BUILD.hydratedClass || import_app_data20.BUILD.hydratedAttribute)) {
|
|
3064
3366
|
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
3065
3367
|
}
|
|
3066
3368
|
if (dataStyles.innerHTML.length) {
|
|
@@ -3076,7 +3378,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3076
3378
|
if (deferredConnectedCallbacks.length) {
|
|
3077
3379
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
3078
3380
|
} else {
|
|
3079
|
-
if (
|
|
3381
|
+
if (import_app_data20.BUILD.profile) {
|
|
3080
3382
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
|
|
3081
3383
|
} else {
|
|
3082
3384
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
|
|
@@ -3089,10 +3391,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3089
3391
|
var Fragment = (_, children) => children;
|
|
3090
3392
|
|
|
3091
3393
|
// src/runtime/host-listener.ts
|
|
3092
|
-
var
|
|
3394
|
+
var import_app_data21 = require("@rindo/core/internal/app-data");
|
|
3093
3395
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
3094
|
-
if (
|
|
3095
|
-
if (
|
|
3396
|
+
if (import_app_data21.BUILD.hostListener && listeners) {
|
|
3397
|
+
if (import_app_data21.BUILD.hostListenerTargetParent) {
|
|
3096
3398
|
if (attachParentListeners) {
|
|
3097
3399
|
listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
|
|
3098
3400
|
} else {
|
|
@@ -3100,7 +3402,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3100
3402
|
}
|
|
3101
3403
|
}
|
|
3102
3404
|
listeners.map(([flags, name, method]) => {
|
|
3103
|
-
const target =
|
|
3405
|
+
const target = import_app_data21.BUILD.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
|
|
3104
3406
|
const handler = hostListenerProxy(hostRef, method);
|
|
3105
3407
|
const opts = hostListenerOpts(flags);
|
|
3106
3408
|
plt.ael(target, name, handler, opts);
|
|
@@ -3111,7 +3413,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3111
3413
|
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
3112
3414
|
var _a;
|
|
3113
3415
|
try {
|
|
3114
|
-
if (
|
|
3416
|
+
if (import_app_data21.BUILD.lazyLoad) {
|
|
3115
3417
|
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
3116
3418
|
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
3117
3419
|
} else {
|
|
@@ -3125,10 +3427,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
3125
3427
|
}
|
|
3126
3428
|
};
|
|
3127
3429
|
var getHostListenerTarget = (elm, flags) => {
|
|
3128
|
-
if (
|
|
3129
|
-
if (
|
|
3130
|
-
if (
|
|
3131
|
-
if (
|
|
3430
|
+
if (import_app_data21.BUILD.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
|
|
3431
|
+
if (import_app_data21.BUILD.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
|
|
3432
|
+
if (import_app_data21.BUILD.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
|
|
3433
|
+
if (import_app_data21.BUILD.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
|
|
3132
3434
|
return elm.parentElement;
|
|
3133
3435
|
return elm;
|
|
3134
3436
|
};
|
|
@@ -3164,6 +3466,9 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
|
|
|
3164
3466
|
childId = `${hostId}.${nodeId}`;
|
|
3165
3467
|
if (nodeRef.nodeType === 1 /* ElementNode */) {
|
|
3166
3468
|
nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
|
|
3469
|
+
if (typeof nodeRef["s-sn"] === "string" && !nodeRef.getAttribute("slot")) {
|
|
3470
|
+
nodeRef.setAttribute("s-sn", nodeRef["s-sn"]);
|
|
3471
|
+
}
|
|
3167
3472
|
} else if (nodeRef.nodeType === 3 /* TextNode */) {
|
|
3168
3473
|
if (hostId === 0) {
|
|
3169
3474
|
const textContent = (_a = nodeRef.nodeValue) == null ? void 0 : _a.trim();
|
|
@@ -3175,6 +3480,10 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
|
|
|
3175
3480
|
const commentBeforeTextNode = doc2.createComment(childId);
|
|
3176
3481
|
commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
|
|
3177
3482
|
insertBefore(nodeRef.parentNode, commentBeforeTextNode, nodeRef);
|
|
3483
|
+
} else if (nodeRef.nodeType === 8 /* CommentNode */) {
|
|
3484
|
+
const commentBeforeTextNode = doc2.createComment(childId);
|
|
3485
|
+
commentBeforeTextNode.nodeValue = `${COMMENT_NODE_ID}.${childId}`;
|
|
3486
|
+
nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
|
|
3178
3487
|
}
|
|
3179
3488
|
}
|
|
3180
3489
|
let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
|
|
@@ -3255,6 +3564,9 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
|
|
|
3255
3564
|
childElm["s-node-id"] = nodeId;
|
|
3256
3565
|
if (childElm.nodeType === 1 /* ElementNode */) {
|
|
3257
3566
|
childElm.setAttribute(HYDRATE_CHILD_ID, childId);
|
|
3567
|
+
if (typeof childElm["s-sn"] === "string" && !childElm.getAttribute("slot")) {
|
|
3568
|
+
childElm.setAttribute("s-sn", childElm["s-sn"]);
|
|
3569
|
+
}
|
|
3258
3570
|
} else if (childElm.nodeType === 3 /* TextNode */) {
|
|
3259
3571
|
const parentNode = childElm.parentNode;
|
|
3260
3572
|
const nodeName = parentNode == null ? void 0 : parentNode.nodeName;
|