@stencil/core 4.23.0-dev.1735880502.9e6483a → 4.23.0-dev.1736139708.13ee704
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/stencil.js +4 -4
- 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 +464 -446
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +468 -450
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +27 -22
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +8 -3
- package/internal/testing/index.js +466 -448
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +3 -1
- package/mock-doc/index.js +3 -1
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +1 -1
- package/testing/package.json +1 -1
package/internal/client/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Client Platform v4.23.0-dev.
|
|
2
|
+
Stencil Client Platform v4.23.0-dev.1736139708.13ee704 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -280,7 +280,7 @@ var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
|
|
|
280
280
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
281
281
|
|
|
282
282
|
// src/client/index.ts
|
|
283
|
-
import { BUILD as
|
|
283
|
+
import { BUILD as BUILD28, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
|
|
284
284
|
|
|
285
285
|
// src/runtime/asset-path.ts
|
|
286
286
|
var getAssetPath = (path) => {
|
|
@@ -290,10 +290,10 @@ var getAssetPath = (path) => {
|
|
|
290
290
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
291
291
|
|
|
292
292
|
// src/runtime/bootstrap-custom-element.ts
|
|
293
|
-
import { BUILD as
|
|
293
|
+
import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
|
|
294
294
|
|
|
295
295
|
// src/utils/helpers.ts
|
|
296
|
-
var isDef = (v) => v != null;
|
|
296
|
+
var isDef = (v) => v != null && v !== void 0;
|
|
297
297
|
var isComplexType = (o) => {
|
|
298
298
|
o = typeof o;
|
|
299
299
|
return o === "object" || o === "function";
|
|
@@ -355,19 +355,122 @@ var unwrapErr = (result) => {
|
|
|
355
355
|
};
|
|
356
356
|
|
|
357
357
|
// src/runtime/connected-callback.ts
|
|
358
|
-
import { BUILD as
|
|
358
|
+
import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
|
|
359
359
|
|
|
360
360
|
// src/runtime/client-hydrate.ts
|
|
361
|
-
import { BUILD as
|
|
361
|
+
import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
|
|
362
362
|
|
|
363
363
|
// src/runtime/dom-extras.ts
|
|
364
|
-
import { BUILD as
|
|
364
|
+
import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
|
|
365
|
+
|
|
366
|
+
// src/runtime/slot-polyfill-utils.ts
|
|
367
|
+
import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
|
|
368
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
369
|
+
const childNodes = elm.__childNodes || elm.childNodes;
|
|
370
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
371
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
372
|
+
var _a;
|
|
373
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
374
|
+
if ((_a = getHostSlotChildNodes(slotNode, slotNode["s-sn"], false)) == null ? void 0 : _a.length) {
|
|
375
|
+
slotNode.hidden = true;
|
|
376
|
+
} else {
|
|
377
|
+
slotNode.hidden = false;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
for (const childNode of childNodes) {
|
|
383
|
+
if (childNode.nodeType === 1 /* ElementNode */ && (childNode.__childNodes || childNode.childNodes).length) {
|
|
384
|
+
updateFallbackSlotVisibility(childNode);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
389
|
+
const result = [];
|
|
390
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
391
|
+
const slottedNode = childNodes[i2]["s-nr"];
|
|
392
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
393
|
+
result.push(slottedNode);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return result;
|
|
397
|
+
};
|
|
398
|
+
var getHostSlotNodes = (childNodes, hostName, slotName) => {
|
|
399
|
+
let i2 = 0;
|
|
400
|
+
let slottedNodes = [];
|
|
401
|
+
let childNode;
|
|
402
|
+
for (; i2 < childNodes.length; i2++) {
|
|
403
|
+
childNode = childNodes[i2];
|
|
404
|
+
if (childNode["s-sr"] && childNode["s-hn"] === hostName && (!slotName || childNode["s-sn"] === slotName)) {
|
|
405
|
+
slottedNodes.push(childNode);
|
|
406
|
+
if (typeof slotName !== "undefined") return slottedNodes;
|
|
407
|
+
}
|
|
408
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
409
|
+
}
|
|
410
|
+
return slottedNodes;
|
|
411
|
+
};
|
|
412
|
+
var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
|
|
413
|
+
const childNodes = [];
|
|
414
|
+
if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
|
|
415
|
+
while ((node = node.nextSibling) && node["s-sn"] === slotName) {
|
|
416
|
+
childNodes.push(node);
|
|
417
|
+
}
|
|
418
|
+
return childNodes;
|
|
419
|
+
};
|
|
420
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
421
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
422
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
423
|
+
return true;
|
|
424
|
+
}
|
|
425
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
return false;
|
|
429
|
+
}
|
|
430
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
431
|
+
return true;
|
|
432
|
+
}
|
|
433
|
+
return slotName === "";
|
|
434
|
+
};
|
|
435
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
436
|
+
let slottedNodeLocation;
|
|
437
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
438
|
+
slottedNodeLocation = newChild["s-ol"];
|
|
439
|
+
} else {
|
|
440
|
+
slottedNodeLocation = document.createTextNode("");
|
|
441
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
442
|
+
}
|
|
443
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
444
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
445
|
+
const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
|
|
446
|
+
if (typeof position !== "undefined") {
|
|
447
|
+
if (BUILD7.hydrateClientSide) {
|
|
448
|
+
slottedNodeLocation["s-oo"] = position;
|
|
449
|
+
const childNodes = parent.__childNodes || parent.childNodes;
|
|
450
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
451
|
+
childNodes.forEach((n) => {
|
|
452
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
453
|
+
});
|
|
454
|
+
slotRelocateNodes.sort((a, b) => {
|
|
455
|
+
if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
|
|
456
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
457
|
+
return 0;
|
|
458
|
+
});
|
|
459
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
460
|
+
}
|
|
461
|
+
} else {
|
|
462
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
463
|
+
}
|
|
464
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
465
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
466
|
+
};
|
|
467
|
+
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
365
468
|
|
|
366
469
|
// src/runtime/vdom/vdom-render.ts
|
|
367
|
-
import { BUILD as
|
|
470
|
+
import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
|
|
368
471
|
|
|
369
472
|
// src/runtime/vdom/h.ts
|
|
370
|
-
import { BUILD as
|
|
473
|
+
import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
|
|
371
474
|
var h = (nodeName, vnodeData, ...children) => {
|
|
372
475
|
let child = null;
|
|
373
476
|
let key = null;
|
|
@@ -383,7 +486,7 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
383
486
|
} else if (child != null && typeof child !== "boolean") {
|
|
384
487
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
385
488
|
child = String(child);
|
|
386
|
-
} else if (
|
|
489
|
+
} else if (BUILD8.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
387
490
|
consoleDevError(`vNode passed as children has unexpected type.
|
|
388
491
|
Make sure it's using the correct h() function.
|
|
389
492
|
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
@@ -399,28 +502,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
399
502
|
};
|
|
400
503
|
walk(children);
|
|
401
504
|
if (vnodeData) {
|
|
402
|
-
if (
|
|
505
|
+
if (BUILD8.isDev && nodeName === "input") {
|
|
403
506
|
validateInputProperties(vnodeData);
|
|
404
507
|
}
|
|
405
|
-
if (
|
|
508
|
+
if (BUILD8.vdomKey && vnodeData.key) {
|
|
406
509
|
key = vnodeData.key;
|
|
407
510
|
}
|
|
408
|
-
if (
|
|
511
|
+
if (BUILD8.slotRelocation && vnodeData.name) {
|
|
409
512
|
slotName = vnodeData.name;
|
|
410
513
|
}
|
|
411
|
-
if (
|
|
514
|
+
if (BUILD8.vdomClass) {
|
|
412
515
|
const classData = vnodeData.className || vnodeData.class;
|
|
413
516
|
if (classData) {
|
|
414
517
|
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
415
518
|
}
|
|
416
519
|
}
|
|
417
520
|
}
|
|
418
|
-
if (
|
|
521
|
+
if (BUILD8.isDev && vNodeChildren.some(isHost)) {
|
|
419
522
|
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
420
523
|
- You are NOT using hostData() and <Host> in the same component.
|
|
421
524
|
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
422
525
|
}
|
|
423
|
-
if (
|
|
526
|
+
if (BUILD8.vdomFunctional && typeof nodeName === "function") {
|
|
424
527
|
return nodeName(
|
|
425
528
|
vnodeData === null ? {} : vnodeData,
|
|
426
529
|
vNodeChildren,
|
|
@@ -432,10 +535,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
432
535
|
if (vNodeChildren.length > 0) {
|
|
433
536
|
vnode.$children$ = vNodeChildren;
|
|
434
537
|
}
|
|
435
|
-
if (
|
|
538
|
+
if (BUILD8.vdomKey) {
|
|
436
539
|
vnode.$key$ = key;
|
|
437
540
|
}
|
|
438
|
-
if (
|
|
541
|
+
if (BUILD8.slotRelocation) {
|
|
439
542
|
vnode.$name$ = slotName;
|
|
440
543
|
}
|
|
441
544
|
return vnode;
|
|
@@ -448,13 +551,13 @@ var newVNode = (tag, text) => {
|
|
|
448
551
|
$elm$: null,
|
|
449
552
|
$children$: null
|
|
450
553
|
};
|
|
451
|
-
if (
|
|
554
|
+
if (BUILD8.vdomAttribute) {
|
|
452
555
|
vnode.$attrs$ = null;
|
|
453
556
|
}
|
|
454
|
-
if (
|
|
557
|
+
if (BUILD8.vdomKey) {
|
|
455
558
|
vnode.$key$ = null;
|
|
456
559
|
}
|
|
457
|
-
if (
|
|
560
|
+
if (BUILD8.slotRelocation) {
|
|
458
561
|
vnode.$name$ = null;
|
|
459
562
|
}
|
|
460
563
|
return vnode;
|
|
@@ -507,28 +610,35 @@ var validateInputProperties = (inputElm) => {
|
|
|
507
610
|
};
|
|
508
611
|
|
|
509
612
|
// src/runtime/vdom/update-element.ts
|
|
510
|
-
import { BUILD as
|
|
613
|
+
import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
|
|
511
614
|
|
|
512
615
|
// src/runtime/vdom/set-accessor.ts
|
|
513
|
-
import { BUILD as
|
|
616
|
+
import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
|
|
514
617
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
515
618
|
if (oldValue !== newValue) {
|
|
516
619
|
let isProp = isMemberInElement(elm, memberName);
|
|
517
620
|
let ln = memberName.toLowerCase();
|
|
518
|
-
if (
|
|
621
|
+
if (BUILD9.vdomClass && memberName === "class") {
|
|
519
622
|
const classList = elm.classList;
|
|
520
623
|
const oldClasses = parseClassList(oldValue);
|
|
521
|
-
|
|
522
|
-
if (elm["s-si"]
|
|
624
|
+
let newClasses = parseClassList(newValue);
|
|
625
|
+
if (elm["s-si"]) {
|
|
523
626
|
newClasses.push(elm["s-si"]);
|
|
627
|
+
oldClasses.forEach((c) => {
|
|
628
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
629
|
+
});
|
|
630
|
+
newClasses = [...new Set(newClasses)];
|
|
631
|
+
classList.add(...newClasses);
|
|
632
|
+
delete elm["s-si"];
|
|
633
|
+
} else {
|
|
634
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
635
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
524
636
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
} else if (BUILD8.vdomStyle && memberName === "style") {
|
|
528
|
-
if (BUILD8.updatable) {
|
|
637
|
+
} else if (BUILD9.vdomStyle && memberName === "style") {
|
|
638
|
+
if (BUILD9.updatable) {
|
|
529
639
|
for (const prop in oldValue) {
|
|
530
640
|
if (!newValue || newValue[prop] == null) {
|
|
531
|
-
if (!
|
|
641
|
+
if (!BUILD9.hydrateServerSide && prop.includes("-")) {
|
|
532
642
|
elm.style.removeProperty(prop);
|
|
533
643
|
} else {
|
|
534
644
|
elm.style[prop] = "";
|
|
@@ -538,19 +648,19 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
538
648
|
}
|
|
539
649
|
for (const prop in newValue) {
|
|
540
650
|
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
541
|
-
if (!
|
|
651
|
+
if (!BUILD9.hydrateServerSide && prop.includes("-")) {
|
|
542
652
|
elm.style.setProperty(prop, newValue[prop]);
|
|
543
653
|
} else {
|
|
544
654
|
elm.style[prop] = newValue[prop];
|
|
545
655
|
}
|
|
546
656
|
}
|
|
547
657
|
}
|
|
548
|
-
} else if (
|
|
549
|
-
} else if (
|
|
658
|
+
} else if (BUILD9.vdomKey && memberName === "key") {
|
|
659
|
+
} else if (BUILD9.vdomRef && memberName === "ref") {
|
|
550
660
|
if (newValue) {
|
|
551
661
|
newValue(elm);
|
|
552
662
|
}
|
|
553
|
-
} else if (
|
|
663
|
+
} else if (BUILD9.vdomListener && (BUILD9.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
554
664
|
if (memberName[2] === "-") {
|
|
555
665
|
memberName = memberName.slice(3);
|
|
556
666
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -568,7 +678,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
568
678
|
plt.ael(elm, memberName, newValue, capture);
|
|
569
679
|
}
|
|
570
680
|
}
|
|
571
|
-
} else if (
|
|
681
|
+
} else if (BUILD9.vdomPropOrAttr) {
|
|
572
682
|
const isComplex = isComplexType(newValue);
|
|
573
683
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
574
684
|
try {
|
|
@@ -590,7 +700,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
590
700
|
}
|
|
591
701
|
}
|
|
592
702
|
let xlink = false;
|
|
593
|
-
if (
|
|
703
|
+
if (BUILD9.vdomXlink) {
|
|
594
704
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
595
705
|
memberName = ln;
|
|
596
706
|
xlink = true;
|
|
@@ -598,7 +708,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
598
708
|
}
|
|
599
709
|
if (newValue == null || newValue === false) {
|
|
600
710
|
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
601
|
-
if (
|
|
711
|
+
if (BUILD9.vdomXlink && xlink) {
|
|
602
712
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
603
713
|
} else {
|
|
604
714
|
elm.removeAttribute(memberName);
|
|
@@ -606,7 +716,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
606
716
|
}
|
|
607
717
|
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
608
718
|
newValue = newValue === true ? "" : newValue;
|
|
609
|
-
if (
|
|
719
|
+
if (BUILD9.vdomXlink && xlink) {
|
|
610
720
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
611
721
|
} else {
|
|
612
722
|
elm.setAttribute(memberName, newValue);
|
|
@@ -633,7 +743,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
|
633
743
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
634
744
|
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
|
|
635
745
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
636
|
-
if (
|
|
746
|
+
if (BUILD10.updatable) {
|
|
637
747
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
638
748
|
if (!(memberName in newVnodeAttrs)) {
|
|
639
749
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
@@ -662,19 +772,16 @@ var useNativeShadowDom = false;
|
|
|
662
772
|
var checkSlotFallbackVisibility = false;
|
|
663
773
|
var checkSlotRelocate = false;
|
|
664
774
|
var isSvgMode = false;
|
|
665
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
775
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
666
776
|
var _a;
|
|
667
777
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
668
778
|
let i2 = 0;
|
|
669
779
|
let elm;
|
|
670
780
|
let childNode;
|
|
671
781
|
let oldVNode;
|
|
672
|
-
if (
|
|
782
|
+
if (BUILD11.slotRelocation && !useNativeShadowDom) {
|
|
673
783
|
checkSlotRelocate = true;
|
|
674
784
|
if (newVNode2.$tag$ === "slot") {
|
|
675
|
-
if (scopeId) {
|
|
676
|
-
parentElm.classList.add(scopeId + "-s");
|
|
677
|
-
}
|
|
678
785
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
679
786
|
// slot element has fallback content
|
|
680
787
|
// still create an element that "mocks" the slot element
|
|
@@ -687,48 +794,43 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
687
794
|
);
|
|
688
795
|
}
|
|
689
796
|
}
|
|
690
|
-
if (
|
|
797
|
+
if (BUILD11.isDev && newVNode2.$elm$) {
|
|
691
798
|
consoleDevError(
|
|
692
799
|
`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://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`
|
|
693
800
|
);
|
|
694
801
|
}
|
|
695
|
-
if (
|
|
802
|
+
if (BUILD11.vdomText && newVNode2.$text$ !== null) {
|
|
696
803
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
697
|
-
} else if (
|
|
698
|
-
elm = newVNode2.$elm$ =
|
|
804
|
+
} else if (BUILD11.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
805
|
+
elm = newVNode2.$elm$ = BUILD11.isDebug || BUILD11.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
|
|
699
806
|
} else {
|
|
700
|
-
if (
|
|
807
|
+
if (BUILD11.svg && !isSvgMode) {
|
|
701
808
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
702
809
|
}
|
|
703
|
-
elm = newVNode2.$elm$ =
|
|
810
|
+
elm = newVNode2.$elm$ = BUILD11.svg ? doc.createElementNS(
|
|
704
811
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
705
|
-
!useNativeShadowDom &&
|
|
812
|
+
!useNativeShadowDom && BUILD11.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
706
813
|
) : doc.createElement(
|
|
707
|
-
!useNativeShadowDom &&
|
|
814
|
+
!useNativeShadowDom && BUILD11.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
708
815
|
);
|
|
709
|
-
if (
|
|
816
|
+
if (BUILD11.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
710
817
|
isSvgMode = false;
|
|
711
818
|
}
|
|
712
|
-
if (
|
|
819
|
+
if (BUILD11.vdomAttribute) {
|
|
713
820
|
updateElement(null, newVNode2, isSvgMode);
|
|
714
821
|
}
|
|
715
|
-
|
|
716
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
717
|
-
if (!isElementWithinShadowRoot && BUILD10.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
822
|
+
if (BUILD11.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
718
823
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
719
824
|
}
|
|
720
|
-
if (BUILD10.scoped) {
|
|
721
|
-
updateElementScopeIds(elm, parentElm);
|
|
722
|
-
}
|
|
723
825
|
if (newVNode2.$children$) {
|
|
724
826
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
725
|
-
childNode = createElm(oldParentVNode, newVNode2, i2
|
|
827
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
726
828
|
if (childNode) {
|
|
727
829
|
elm.appendChild(childNode);
|
|
728
830
|
}
|
|
729
831
|
}
|
|
730
832
|
}
|
|
731
|
-
if (
|
|
833
|
+
if (BUILD11.svg) {
|
|
732
834
|
if (newVNode2.$tag$ === "svg") {
|
|
733
835
|
isSvgMode = false;
|
|
734
836
|
} else if (elm.tagName === "foreignObject") {
|
|
@@ -737,7 +839,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
737
839
|
}
|
|
738
840
|
}
|
|
739
841
|
elm["s-hn"] = hostTagName;
|
|
740
|
-
if (
|
|
842
|
+
if (BUILD11.slotRelocation) {
|
|
741
843
|
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
742
844
|
elm["s-sr"] = true;
|
|
743
845
|
elm["s-cr"] = contentRef;
|
|
@@ -745,12 +847,15 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
745
847
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
746
848
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
747
849
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
748
|
-
if (
|
|
850
|
+
if (BUILD11.experimentalSlotFixes) {
|
|
749
851
|
relocateToHostRoot(oldParentVNode.$elm$);
|
|
750
852
|
} else {
|
|
751
853
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
752
854
|
}
|
|
753
855
|
}
|
|
856
|
+
if (BUILD11.scoped) {
|
|
857
|
+
addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
|
|
858
|
+
}
|
|
754
859
|
}
|
|
755
860
|
}
|
|
756
861
|
return elm;
|
|
@@ -778,7 +883,7 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
778
883
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
779
884
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
780
885
|
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
781
|
-
if (parentElm["s-sr"] &&
|
|
886
|
+
if (parentElm["s-sr"] && BUILD11.experimentalSlotFixes) {
|
|
782
887
|
let node = parentElm;
|
|
783
888
|
while (node = node.nextSibling) {
|
|
784
889
|
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
@@ -789,7 +894,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
789
894
|
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
790
895
|
const childNode = oldSlotChildNodes[i2];
|
|
791
896
|
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
792
|
-
insertBefore(
|
|
897
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
793
898
|
childNode["s-ol"].remove();
|
|
794
899
|
childNode["s-ol"] = void 0;
|
|
795
900
|
childNode["s-sh"] = void 0;
|
|
@@ -802,17 +907,17 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
802
907
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
803
908
|
};
|
|
804
909
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
805
|
-
let containerElm =
|
|
910
|
+
let containerElm = BUILD11.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
806
911
|
let childNode;
|
|
807
|
-
if (
|
|
912
|
+
if (BUILD11.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
808
913
|
containerElm = containerElm.shadowRoot;
|
|
809
914
|
}
|
|
810
915
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
811
916
|
if (vnodes[startIdx]) {
|
|
812
|
-
childNode = createElm(null, parentVNode, startIdx
|
|
917
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
813
918
|
if (childNode) {
|
|
814
919
|
vnodes[startIdx].$elm$ = childNode;
|
|
815
|
-
insertBefore(containerElm, childNode,
|
|
920
|
+
insertBefore(containerElm, childNode, BUILD11.slotRelocation ? referenceNode(before) : before);
|
|
816
921
|
}
|
|
817
922
|
}
|
|
818
923
|
}
|
|
@@ -824,7 +929,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
824
929
|
const elm = vnode.$elm$;
|
|
825
930
|
nullifyVNodeRefs(vnode);
|
|
826
931
|
if (elm) {
|
|
827
|
-
if (
|
|
932
|
+
if (BUILD11.slotRelocation) {
|
|
828
933
|
checkSlotFallbackVisibility = true;
|
|
829
934
|
if (elm["s-ol"]) {
|
|
830
935
|
elm["s-ol"].remove();
|
|
@@ -868,7 +973,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
868
973
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
869
974
|
newEndVnode = newCh[--newEndIdx];
|
|
870
975
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
871
|
-
if (
|
|
976
|
+
if (BUILD11.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
872
977
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
873
978
|
}
|
|
874
979
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -876,7 +981,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
876
981
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
877
982
|
newEndVnode = newCh[--newEndIdx];
|
|
878
983
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
879
|
-
if (
|
|
984
|
+
if (BUILD11.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
880
985
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
881
986
|
}
|
|
882
987
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -885,7 +990,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
885
990
|
newStartVnode = newCh[++newStartIdx];
|
|
886
991
|
} else {
|
|
887
992
|
idxInOld = -1;
|
|
888
|
-
if (
|
|
993
|
+
if (BUILD11.vdomKey) {
|
|
889
994
|
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
890
995
|
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
891
996
|
idxInOld = i2;
|
|
@@ -893,10 +998,10 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
893
998
|
}
|
|
894
999
|
}
|
|
895
1000
|
}
|
|
896
|
-
if (
|
|
1001
|
+
if (BUILD11.vdomKey && idxInOld >= 0) {
|
|
897
1002
|
elmToMove = oldCh[idxInOld];
|
|
898
1003
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
899
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld
|
|
1004
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
900
1005
|
} else {
|
|
901
1006
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
902
1007
|
oldCh[idxInOld] = void 0;
|
|
@@ -904,12 +1009,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
904
1009
|
}
|
|
905
1010
|
newStartVnode = newCh[++newStartIdx];
|
|
906
1011
|
} else {
|
|
907
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx
|
|
1012
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
908
1013
|
newStartVnode = newCh[++newStartIdx];
|
|
909
1014
|
}
|
|
910
1015
|
if (node) {
|
|
911
|
-
if (
|
|
912
|
-
insertBefore(
|
|
1016
|
+
if (BUILD11.slotRelocation) {
|
|
1017
|
+
insertBefore(
|
|
1018
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1019
|
+
node,
|
|
1020
|
+
referenceNode(oldStartVnode.$elm$)
|
|
1021
|
+
);
|
|
913
1022
|
} else {
|
|
914
1023
|
insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
|
|
915
1024
|
}
|
|
@@ -925,35 +1034,26 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
925
1034
|
newStartIdx,
|
|
926
1035
|
newEndIdx
|
|
927
1036
|
);
|
|
928
|
-
} else if (
|
|
1037
|
+
} else if (BUILD11.updatable && newStartIdx > newEndIdx) {
|
|
929
1038
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
930
1039
|
}
|
|
931
1040
|
};
|
|
932
1041
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
933
1042
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
934
|
-
if (
|
|
935
|
-
if (
|
|
936
|
-
// The component gets hydrated and no VDOM has been initialized.
|
|
937
|
-
// Here the comparison can't happen as $name$ property is not set for `leftNode`.
|
|
938
|
-
"$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many
|
|
939
|
-
// hydration comments to be removed
|
|
940
|
-
leftVNode.$elm$.nodeType !== 8
|
|
941
|
-
) {
|
|
942
|
-
return false;
|
|
943
|
-
}
|
|
1043
|
+
if (BUILD11.slotRelocation && leftVNode.$tag$ === "slot") {
|
|
944
1044
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
945
1045
|
}
|
|
946
|
-
if (
|
|
1046
|
+
if (BUILD11.vdomKey && !isInitialRender) {
|
|
947
1047
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
948
1048
|
}
|
|
1049
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
1050
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
1051
|
+
}
|
|
949
1052
|
return true;
|
|
950
1053
|
}
|
|
951
1054
|
return false;
|
|
952
1055
|
};
|
|
953
|
-
var referenceNode = (node) =>
|
|
954
|
-
return node && node["s-ol"] || node;
|
|
955
|
-
};
|
|
956
|
-
var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
|
|
1056
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
957
1057
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
958
1058
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
959
1059
|
const oldChildren = oldVNode.$children$;
|
|
@@ -961,13 +1061,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
961
1061
|
const tag = newVNode2.$tag$;
|
|
962
1062
|
const text = newVNode2.$text$;
|
|
963
1063
|
let defaultHolder;
|
|
964
|
-
if (!
|
|
965
|
-
if (
|
|
1064
|
+
if (!BUILD11.vdomText || text === null) {
|
|
1065
|
+
if (BUILD11.svg) {
|
|
966
1066
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
967
1067
|
}
|
|
968
|
-
if (
|
|
969
|
-
if (
|
|
970
|
-
if (
|
|
1068
|
+
if (BUILD11.vdomAttribute || BUILD11.reflect) {
|
|
1069
|
+
if (BUILD11.slot && tag === "slot" && !useNativeShadowDom) {
|
|
1070
|
+
if (BUILD11.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
|
|
971
1071
|
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
972
1072
|
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
973
1073
|
}
|
|
@@ -975,55 +1075,28 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
975
1075
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
976
1076
|
}
|
|
977
1077
|
}
|
|
978
|
-
if (
|
|
1078
|
+
if (BUILD11.updatable && oldChildren !== null && newChildren !== null) {
|
|
979
1079
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
980
1080
|
} else if (newChildren !== null) {
|
|
981
|
-
if (
|
|
1081
|
+
if (BUILD11.updatable && BUILD11.vdomText && oldVNode.$text$ !== null) {
|
|
982
1082
|
elm.textContent = "";
|
|
983
1083
|
}
|
|
984
1084
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
985
1085
|
} else if (
|
|
986
1086
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
987
|
-
!isInitialRender &&
|
|
1087
|
+
!isInitialRender && BUILD11.updatable && oldChildren !== null
|
|
988
1088
|
) {
|
|
989
1089
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
990
1090
|
}
|
|
991
|
-
if (
|
|
1091
|
+
if (BUILD11.svg && isSvgMode && tag === "svg") {
|
|
992
1092
|
isSvgMode = false;
|
|
993
1093
|
}
|
|
994
|
-
} else if (
|
|
1094
|
+
} else if (BUILD11.vdomText && BUILD11.slotRelocation && (defaultHolder = elm["s-cr"])) {
|
|
995
1095
|
defaultHolder.parentNode.textContent = text;
|
|
996
|
-
} else if (
|
|
1096
|
+
} else if (BUILD11.vdomText && oldVNode.$text$ !== text) {
|
|
997
1097
|
elm.data = text;
|
|
998
1098
|
}
|
|
999
1099
|
};
|
|
1000
|
-
var updateFallbackSlotVisibility = (elm) => {
|
|
1001
|
-
const childNodes = elm.__childNodes || elm.childNodes;
|
|
1002
|
-
for (const childNode of childNodes) {
|
|
1003
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1004
|
-
if (childNode["s-sr"]) {
|
|
1005
|
-
const slotName = childNode["s-sn"];
|
|
1006
|
-
childNode.hidden = false;
|
|
1007
|
-
for (const siblingNode of childNodes) {
|
|
1008
|
-
if (siblingNode !== childNode) {
|
|
1009
|
-
if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
|
|
1010
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
|
|
1011
|
-
childNode.hidden = true;
|
|
1012
|
-
break;
|
|
1013
|
-
}
|
|
1014
|
-
} else if (slotName === siblingNode["s-sn"]) {
|
|
1015
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
|
|
1016
|
-
childNode.hidden = true;
|
|
1017
|
-
break;
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
updateFallbackSlotVisibility(childNode);
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
};
|
|
1027
1100
|
var relocateNodes = [];
|
|
1028
1101
|
var markSlotContentForRelocation = (elm) => {
|
|
1029
1102
|
let node;
|
|
@@ -1036,7 +1109,7 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1036
1109
|
const slotName = childNode["s-sn"];
|
|
1037
1110
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1038
1111
|
node = hostContentNodes[j];
|
|
1039
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!
|
|
1112
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD11.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
1040
1113
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1041
1114
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1042
1115
|
checkSlotFallbackVisibility = true;
|
|
@@ -1074,60 +1147,40 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1074
1147
|
}
|
|
1075
1148
|
}
|
|
1076
1149
|
};
|
|
1077
|
-
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
1078
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1079
|
-
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
1080
|
-
return true;
|
|
1081
|
-
}
|
|
1082
|
-
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
1083
|
-
return true;
|
|
1084
|
-
}
|
|
1085
|
-
return false;
|
|
1086
|
-
}
|
|
1087
|
-
if (nodeToRelocate["s-sn"] === slotName) {
|
|
1088
|
-
return true;
|
|
1089
|
-
}
|
|
1090
|
-
return slotName === "";
|
|
1091
|
-
};
|
|
1092
1150
|
var nullifyVNodeRefs = (vNode) => {
|
|
1093
|
-
if (
|
|
1151
|
+
if (BUILD11.vdomRef) {
|
|
1094
1152
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1095
1153
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1096
1154
|
}
|
|
1097
1155
|
};
|
|
1098
1156
|
var insertBefore = (parent, newNode, reference) => {
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
updateElementScopeIds(newNode, parent);
|
|
1157
|
+
if (BUILD11.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
1158
|
+
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
1102
1159
|
}
|
|
1160
|
+
const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1103
1161
|
return inserted;
|
|
1104
1162
|
};
|
|
1105
|
-
|
|
1106
|
-
const scopeIds = [];
|
|
1107
|
-
if (element) {
|
|
1108
|
-
scopeIds.push(
|
|
1109
|
-
...element["s-scs"] || [],
|
|
1110
|
-
element["s-si"],
|
|
1111
|
-
element["s-sc"],
|
|
1112
|
-
...findScopeIds(element.parentElement)
|
|
1113
|
-
);
|
|
1114
|
-
}
|
|
1115
|
-
return scopeIds;
|
|
1116
|
-
};
|
|
1117
|
-
var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
|
|
1163
|
+
function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
|
|
1118
1164
|
var _a;
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1165
|
+
let scopeId2;
|
|
1166
|
+
if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
|
|
1167
|
+
const scopeName = slotNode["s-sn"];
|
|
1168
|
+
const hostName = slotNode["s-hn"];
|
|
1169
|
+
(_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
|
|
1170
|
+
if (oldParent && oldParent.classList.contains(scopeId2 + "-s")) {
|
|
1171
|
+
let child = (oldParent.__childNodes || oldParent.childNodes)[0];
|
|
1172
|
+
let found = false;
|
|
1173
|
+
while (child) {
|
|
1174
|
+
if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
|
|
1175
|
+
found = true;
|
|
1176
|
+
break;
|
|
1126
1177
|
}
|
|
1178
|
+
child = child.nextSibling;
|
|
1127
1179
|
}
|
|
1180
|
+
if (!found) oldParent.classList.remove(scopeId2 + "-s");
|
|
1128
1181
|
}
|
|
1129
1182
|
}
|
|
1130
|
-
}
|
|
1183
|
+
}
|
|
1131
1184
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1132
1185
|
var _a, _b, _c, _d, _e;
|
|
1133
1186
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -1135,7 +1188,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1135
1188
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1136
1189
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1137
1190
|
hostTagName = hostElm.tagName;
|
|
1138
|
-
if (
|
|
1191
|
+
if (BUILD11.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
1139
1192
|
throw new Error(`The <Host> must be the single root component.
|
|
1140
1193
|
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
1141
1194
|
|
|
@@ -1149,7 +1202,7 @@ render() {
|
|
|
1149
1202
|
}
|
|
1150
1203
|
`);
|
|
1151
1204
|
}
|
|
1152
|
-
if (
|
|
1205
|
+
if (BUILD11.reflect && cmpMeta.$attrsToReflect$) {
|
|
1153
1206
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1154
1207
|
cmpMeta.$attrsToReflect$.map(
|
|
1155
1208
|
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
@@ -1165,24 +1218,24 @@ render() {
|
|
|
1165
1218
|
rootVnode.$tag$ = null;
|
|
1166
1219
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1167
1220
|
hostRef.$vnode$ = rootVnode;
|
|
1168
|
-
rootVnode.$elm$ = oldVNode.$elm$ =
|
|
1169
|
-
if (
|
|
1221
|
+
rootVnode.$elm$ = oldVNode.$elm$ = BUILD11.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
|
|
1222
|
+
if (BUILD11.scoped || BUILD11.shadowDom) {
|
|
1170
1223
|
scopeId = hostElm["s-sc"];
|
|
1171
1224
|
}
|
|
1172
1225
|
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1173
|
-
if (
|
|
1226
|
+
if (BUILD11.slotRelocation) {
|
|
1174
1227
|
contentRef = hostElm["s-cr"];
|
|
1175
1228
|
checkSlotFallbackVisibility = false;
|
|
1176
1229
|
}
|
|
1177
1230
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1178
|
-
if (
|
|
1231
|
+
if (BUILD11.slotRelocation) {
|
|
1179
1232
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1180
1233
|
if (checkSlotRelocate) {
|
|
1181
1234
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1182
1235
|
for (const relocateData of relocateNodes) {
|
|
1183
1236
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1184
1237
|
if (!nodeToRelocate["s-ol"]) {
|
|
1185
|
-
const orgLocationNode =
|
|
1238
|
+
const orgLocationNode = BUILD11.isDebug || BUILD11.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
|
|
1186
1239
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1187
1240
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1188
1241
|
}
|
|
@@ -1193,7 +1246,7 @@ render() {
|
|
|
1193
1246
|
if (slotRefNode) {
|
|
1194
1247
|
const parentNodeRef = slotRefNode.parentNode;
|
|
1195
1248
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1196
|
-
if (!
|
|
1249
|
+
if (!BUILD11.hydrateServerSide && (!BUILD11.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
1197
1250
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1198
1251
|
while (orgLocationNode) {
|
|
1199
1252
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
@@ -1212,11 +1265,11 @@ render() {
|
|
|
1212
1265
|
}
|
|
1213
1266
|
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
1214
1267
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1215
|
-
if (!
|
|
1268
|
+
if (!BUILD11.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1216
1269
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1217
1270
|
}
|
|
1218
1271
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1219
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1272
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1220
1273
|
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1221
1274
|
}
|
|
1222
1275
|
}
|
|
@@ -1238,7 +1291,7 @@ render() {
|
|
|
1238
1291
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1239
1292
|
relocateNodes.length = 0;
|
|
1240
1293
|
}
|
|
1241
|
-
if (
|
|
1294
|
+
if (BUILD11.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1242
1295
|
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1243
1296
|
for (const childNode of children) {
|
|
1244
1297
|
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
@@ -1275,9 +1328,9 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
1275
1328
|
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
1276
1329
|
HostElementPrototype.cloneNode = function(deep) {
|
|
1277
1330
|
const srcNode = this;
|
|
1278
|
-
const isShadowDom =
|
|
1331
|
+
const isShadowDom = BUILD12.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
1279
1332
|
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
1280
|
-
if (
|
|
1333
|
+
if (BUILD12.slot && !isShadowDom && deep) {
|
|
1281
1334
|
let i2 = 0;
|
|
1282
1335
|
let slotted, nonStencilNode;
|
|
1283
1336
|
const stencilPrivates = [
|
|
@@ -1302,7 +1355,7 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
1302
1355
|
slotted = childNodes[i2]["s-nr"];
|
|
1303
1356
|
nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
1304
1357
|
if (slotted) {
|
|
1305
|
-
if (
|
|
1358
|
+
if (BUILD12.appendChildSlotFix && clonedNode.__appendChild) {
|
|
1306
1359
|
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
1307
1360
|
} else {
|
|
1308
1361
|
clonedNode.appendChild(slotted.cloneNode(true));
|
|
@@ -1320,7 +1373,7 @@ var patchSlotAppendChild = (HostElementPrototype) => {
|
|
|
1320
1373
|
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
1321
1374
|
HostElementPrototype.appendChild = function(newChild) {
|
|
1322
1375
|
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1323
|
-
const slotNode =
|
|
1376
|
+
const slotNode = getHostSlotNodes(this.__childNodes || this.childNodes, this.tagName, slotName)[0];
|
|
1324
1377
|
if (slotNode) {
|
|
1325
1378
|
addSlotRelocateNode(newChild, slotNode);
|
|
1326
1379
|
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
@@ -1337,7 +1390,7 @@ var patchSlotRemoveChild = (ElementPrototype) => {
|
|
|
1337
1390
|
ElementPrototype.removeChild = function(toRemove) {
|
|
1338
1391
|
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
1339
1392
|
const childNodes = this.__childNodes || this.childNodes;
|
|
1340
|
-
const slotNode =
|
|
1393
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
|
|
1341
1394
|
if (slotNode && toRemove.isConnected) {
|
|
1342
1395
|
toRemove.remove();
|
|
1343
1396
|
updateFallbackSlotVisibility(this);
|
|
@@ -1356,7 +1409,7 @@ var patchSlotPrepend = (HostElementPrototype) => {
|
|
|
1356
1409
|
}
|
|
1357
1410
|
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1358
1411
|
const childNodes = this.__childNodes || this.childNodes;
|
|
1359
|
-
const slotNode =
|
|
1412
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];
|
|
1360
1413
|
if (slotNode) {
|
|
1361
1414
|
addSlotRelocateNode(newChild, slotNode, true);
|
|
1362
1415
|
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
@@ -1574,77 +1627,12 @@ function patchHostOriginalAccessor(accessorName, node) {
|
|
|
1574
1627
|
}
|
|
1575
1628
|
if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
|
|
1576
1629
|
}
|
|
1577
|
-
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
1578
|
-
let slottedNodeLocation;
|
|
1579
|
-
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
1580
|
-
slottedNodeLocation = newChild["s-ol"];
|
|
1581
|
-
} else {
|
|
1582
|
-
slottedNodeLocation = document.createTextNode("");
|
|
1583
|
-
slottedNodeLocation["s-nr"] = newChild;
|
|
1584
|
-
}
|
|
1585
|
-
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
1586
|
-
const parent = slotNode["s-cr"].parentNode;
|
|
1587
|
-
const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
|
|
1588
|
-
if (typeof position !== "undefined") {
|
|
1589
|
-
if (BUILD11.hydrateClientSide) {
|
|
1590
|
-
slottedNodeLocation["s-oo"] = position;
|
|
1591
|
-
const childNodes = parent.__childNodes || parent.childNodes;
|
|
1592
|
-
const slotRelocateNodes = [slottedNodeLocation];
|
|
1593
|
-
childNodes.forEach((n) => {
|
|
1594
|
-
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
1595
|
-
});
|
|
1596
|
-
slotRelocateNodes.sort((a, b) => {
|
|
1597
|
-
if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
|
|
1598
|
-
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
1599
|
-
return 0;
|
|
1600
|
-
});
|
|
1601
|
-
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
1602
|
-
}
|
|
1603
|
-
} else {
|
|
1604
|
-
appendMethod.call(parent, slottedNodeLocation);
|
|
1605
|
-
}
|
|
1606
|
-
newChild["s-ol"] = slottedNodeLocation;
|
|
1607
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
1608
|
-
};
|
|
1609
|
-
var getSlottedChildNodes = (childNodes) => {
|
|
1610
|
-
const result = [];
|
|
1611
|
-
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
1612
|
-
const slottedNode = childNodes[i2]["s-nr"];
|
|
1613
|
-
if (slottedNode && slottedNode.isConnected) {
|
|
1614
|
-
result.push(slottedNode);
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
return result;
|
|
1618
|
-
};
|
|
1619
|
-
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
1620
|
-
var getHostSlotNode = (childNodes, slotName, hostName) => {
|
|
1621
|
-
let i2 = 0;
|
|
1622
|
-
let childNode;
|
|
1623
|
-
for (; i2 < childNodes.length; i2++) {
|
|
1624
|
-
childNode = childNodes[i2];
|
|
1625
|
-
if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) {
|
|
1626
|
-
return childNode;
|
|
1627
|
-
}
|
|
1628
|
-
childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
|
|
1629
|
-
if (childNode) {
|
|
1630
|
-
return childNode;
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
return null;
|
|
1634
|
-
};
|
|
1635
|
-
var getHostSlotChildNodes = (n, slotName) => {
|
|
1636
|
-
const childNodes = [n];
|
|
1637
|
-
while ((n = n.nextSibling) && n["s-sn"] === slotName) {
|
|
1638
|
-
childNodes.push(n);
|
|
1639
|
-
}
|
|
1640
|
-
return childNodes;
|
|
1641
|
-
};
|
|
1642
1630
|
|
|
1643
1631
|
// src/runtime/profile.ts
|
|
1644
|
-
import { BUILD as
|
|
1632
|
+
import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
|
|
1645
1633
|
var i = 0;
|
|
1646
1634
|
var createTime = (fnName, tagName = "") => {
|
|
1647
|
-
if (
|
|
1635
|
+
if (BUILD13.profile && performance.mark) {
|
|
1648
1636
|
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
1649
1637
|
performance.mark(key);
|
|
1650
1638
|
return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
|
|
@@ -1655,7 +1643,7 @@ var createTime = (fnName, tagName = "") => {
|
|
|
1655
1643
|
}
|
|
1656
1644
|
};
|
|
1657
1645
|
var uniqueTime = (key, measureText) => {
|
|
1658
|
-
if (
|
|
1646
|
+
if (BUILD13.profile && performance.mark) {
|
|
1659
1647
|
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
1660
1648
|
performance.mark(key);
|
|
1661
1649
|
}
|
|
@@ -1713,7 +1701,7 @@ var inspect = (ref) => {
|
|
|
1713
1701
|
};
|
|
1714
1702
|
};
|
|
1715
1703
|
var installDevTools = () => {
|
|
1716
|
-
if (
|
|
1704
|
+
if (BUILD13.devTools) {
|
|
1717
1705
|
const stencil = win.stencil = win.stencil || {};
|
|
1718
1706
|
const originalInspect = stencil.inspect;
|
|
1719
1707
|
stencil.inspect = (ref) => {
|
|
@@ -1733,9 +1721,19 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1733
1721
|
const childRenderNodes = [];
|
|
1734
1722
|
const slotNodes = [];
|
|
1735
1723
|
const slottedNodes = [];
|
|
1736
|
-
const shadowRootNodes =
|
|
1724
|
+
const shadowRootNodes = BUILD14.shadowDom && shadowRoot ? [] : null;
|
|
1737
1725
|
const vnode = newVNode(tagName, null);
|
|
1738
1726
|
vnode.$elm$ = hostElm;
|
|
1727
|
+
let scopeId2;
|
|
1728
|
+
if (BUILD14.scoped) {
|
|
1729
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1730
|
+
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
1731
|
+
scopeId2 = hostElm["s-sc"];
|
|
1732
|
+
hostElm.classList.add(scopeId2 + "-h");
|
|
1733
|
+
} else if (hostElm["s-sc"]) {
|
|
1734
|
+
delete hostElm["s-sc"];
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1739
1737
|
if (!plt.$orgLocNodes$) {
|
|
1740
1738
|
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
1741
1739
|
}
|
|
@@ -1765,6 +1763,18 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1765
1763
|
node["s-cr"] = hostElm["s-cr"];
|
|
1766
1764
|
}
|
|
1767
1765
|
}
|
|
1766
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
1767
|
+
if (childRenderNode.$children$) {
|
|
1768
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
1769
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
1770
|
+
childRenderNode.$children$.forEach((c) => {
|
|
1771
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
} else {
|
|
1775
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1768
1778
|
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
1769
1779
|
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
1770
1780
|
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
@@ -1777,8 +1787,8 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1777
1787
|
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1778
1788
|
}
|
|
1779
1789
|
const hosts = [];
|
|
1780
|
-
let snIndex = 0;
|
|
1781
1790
|
const snLen = slottedNodes.length;
|
|
1791
|
+
let snIndex = 0;
|
|
1782
1792
|
let slotGroup;
|
|
1783
1793
|
let snGroupIdx;
|
|
1784
1794
|
let snGroupLen;
|
|
@@ -1800,11 +1810,10 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1800
1810
|
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
1801
1811
|
slottedItem.slot["s-cr"] = hostEle;
|
|
1802
1812
|
} else {
|
|
1803
|
-
|
|
1804
|
-
slottedItem.slot["s-cr"] = hostChildren[0];
|
|
1813
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1805
1814
|
}
|
|
1806
1815
|
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1807
|
-
if (
|
|
1816
|
+
if (BUILD14.experimentalSlotFixes) {
|
|
1808
1817
|
patchNextPrev(slottedItem.node);
|
|
1809
1818
|
}
|
|
1810
1819
|
}
|
|
@@ -1813,7 +1822,12 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1813
1822
|
}
|
|
1814
1823
|
}
|
|
1815
1824
|
}
|
|
1816
|
-
if (
|
|
1825
|
+
if (BUILD14.scoped && scopeId2 && slotNodes.length) {
|
|
1826
|
+
slotNodes.forEach((slot) => {
|
|
1827
|
+
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
if (BUILD14.shadowDom && shadowRoot) {
|
|
1817
1831
|
let rnIdex = 0;
|
|
1818
1832
|
const rnLen = shadowRootNodes.length;
|
|
1819
1833
|
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
@@ -1847,15 +1861,19 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1847
1861
|
$index$: childIdSplt[3],
|
|
1848
1862
|
$tag$: node.tagName.toLowerCase(),
|
|
1849
1863
|
$elm$: node,
|
|
1850
|
-
// If we don't add the initial classes to the VNode, the first `vdom-render.ts`
|
|
1851
|
-
//
|
|
1852
|
-
$attrs$: { class: node.className }
|
|
1864
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
1865
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
1866
|
+
$attrs$: { class: node.className || "" }
|
|
1853
1867
|
});
|
|
1854
1868
|
childRenderNodes.push(childVNode);
|
|
1855
1869
|
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
1856
1870
|
if (!parentVNode.$children$) {
|
|
1857
1871
|
parentVNode.$children$ = [];
|
|
1858
1872
|
}
|
|
1873
|
+
if (BUILD14.scoped && scopeId2) {
|
|
1874
|
+
node["s-si"] = scopeId2;
|
|
1875
|
+
childVNode.$attrs$.class += " " + scopeId2;
|
|
1876
|
+
}
|
|
1859
1877
|
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
1860
1878
|
if (typeof slotName === "string") {
|
|
1861
1879
|
if (childVNode.$tag$ === "slot-fb") {
|
|
@@ -1870,6 +1888,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1870
1888
|
shadowRootNodes,
|
|
1871
1889
|
slottedNodes
|
|
1872
1890
|
);
|
|
1891
|
+
if (BUILD14.scoped && scopeId2) {
|
|
1892
|
+
node.classList.add(scopeId2);
|
|
1893
|
+
}
|
|
1873
1894
|
}
|
|
1874
1895
|
childVNode.$elm$["s-sn"] = slotName;
|
|
1875
1896
|
childVNode.$elm$.removeAttribute("s-sn");
|
|
@@ -1877,7 +1898,6 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1877
1898
|
if (childVNode.$index$ !== void 0) {
|
|
1878
1899
|
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1879
1900
|
}
|
|
1880
|
-
if (scopeId2) node["s-si"] = scopeId2;
|
|
1881
1901
|
parentVNode = childVNode;
|
|
1882
1902
|
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1883
1903
|
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
@@ -1952,8 +1972,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1952
1972
|
}
|
|
1953
1973
|
} else if (childVNode.$hostId$ === hostId) {
|
|
1954
1974
|
if (childNodeType === SLOT_NODE_ID) {
|
|
1955
|
-
|
|
1956
|
-
const slotName = node["s-sn"] = childVNode.$name$ = childIdSplt[5] || "";
|
|
1975
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
1957
1976
|
addSlot(
|
|
1958
1977
|
slotName,
|
|
1959
1978
|
childIdSplt[2],
|
|
@@ -1966,9 +1985,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1966
1985
|
slottedNodes
|
|
1967
1986
|
);
|
|
1968
1987
|
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1969
|
-
if (
|
|
1988
|
+
if (BUILD14.shadowDom && shadowRootNodes) {
|
|
1970
1989
|
node.remove();
|
|
1971
|
-
} else if (
|
|
1990
|
+
} else if (BUILD14.slotRelocation) {
|
|
1972
1991
|
hostElm["s-cr"] = node;
|
|
1973
1992
|
node["s-cn"] = true;
|
|
1974
1993
|
}
|
|
@@ -2027,8 +2046,10 @@ var createSimpleVNode = (vnode) => {
|
|
|
2027
2046
|
};
|
|
2028
2047
|
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
2029
2048
|
node["s-sr"] = true;
|
|
2049
|
+
childVNode.$name$ = slotName || null;
|
|
2050
|
+
childVNode.$tag$ = "slot";
|
|
2030
2051
|
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
2031
|
-
if (
|
|
2052
|
+
if (BUILD14.shadowDom && shadowRootNodes) {
|
|
2032
2053
|
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
2033
2054
|
if (childVNode.$name$) {
|
|
2034
2055
|
childVNode.$elm$.setAttribute("name", slotName);
|
|
@@ -2069,7 +2090,7 @@ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) =>
|
|
|
2069
2090
|
};
|
|
2070
2091
|
|
|
2071
2092
|
// src/runtime/initialize-component.ts
|
|
2072
|
-
import { BUILD as
|
|
2093
|
+
import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
|
|
2073
2094
|
|
|
2074
2095
|
// src/runtime/mode.ts
|
|
2075
2096
|
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
@@ -2077,22 +2098,22 @@ var setMode = (handler) => modeResolutionChain.push(handler);
|
|
|
2077
2098
|
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
2078
2099
|
|
|
2079
2100
|
// src/runtime/proxy-component.ts
|
|
2080
|
-
import { BUILD as
|
|
2101
|
+
import { BUILD as BUILD21 } from "@stencil/core/internal/app-data";
|
|
2081
2102
|
|
|
2082
2103
|
// src/runtime/set-value.ts
|
|
2083
|
-
import { BUILD as
|
|
2104
|
+
import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
|
|
2084
2105
|
|
|
2085
2106
|
// src/runtime/parse-property-value.ts
|
|
2086
|
-
import { BUILD as
|
|
2107
|
+
import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
|
|
2087
2108
|
var parsePropertyValue = (propValue, propType) => {
|
|
2088
2109
|
if (propValue != null && !isComplexType(propValue)) {
|
|
2089
|
-
if (
|
|
2110
|
+
if (BUILD15.propBoolean && propType & 4 /* Boolean */) {
|
|
2090
2111
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
2091
2112
|
}
|
|
2092
|
-
if (
|
|
2113
|
+
if (BUILD15.propNumber && propType & 2 /* Number */) {
|
|
2093
2114
|
return parseFloat(propValue);
|
|
2094
2115
|
}
|
|
2095
|
-
if (
|
|
2116
|
+
if (BUILD15.propString && propType & 1 /* String */) {
|
|
2096
2117
|
return String(propValue);
|
|
2097
2118
|
}
|
|
2098
2119
|
return propValue;
|
|
@@ -2101,21 +2122,21 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
2101
2122
|
};
|
|
2102
2123
|
|
|
2103
2124
|
// src/runtime/update-component.ts
|
|
2104
|
-
import { BUILD as
|
|
2125
|
+
import { BUILD as BUILD19, NAMESPACE } from "@stencil/core/internal/app-data";
|
|
2105
2126
|
|
|
2106
2127
|
// src/runtime/event-emitter.ts
|
|
2107
|
-
import { BUILD as
|
|
2128
|
+
import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
|
|
2108
2129
|
|
|
2109
2130
|
// src/runtime/element.ts
|
|
2110
|
-
import { BUILD as
|
|
2111
|
-
var getElement = (ref) =>
|
|
2131
|
+
import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
|
|
2132
|
+
var getElement = (ref) => BUILD16.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
2112
2133
|
|
|
2113
2134
|
// src/runtime/event-emitter.ts
|
|
2114
2135
|
var createEvent = (ref, name, flags) => {
|
|
2115
2136
|
const elm = getElement(ref);
|
|
2116
2137
|
return {
|
|
2117
2138
|
emit: (detail) => {
|
|
2118
|
-
if (
|
|
2139
|
+
if (BUILD17.isDev && !elm.isConnected) {
|
|
2119
2140
|
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
2120
2141
|
}
|
|
2121
2142
|
return emitEvent(elm, name, {
|
|
@@ -2134,7 +2155,7 @@ var emitEvent = (elm, name, opts) => {
|
|
|
2134
2155
|
};
|
|
2135
2156
|
|
|
2136
2157
|
// src/runtime/styles.ts
|
|
2137
|
-
import { BUILD as
|
|
2158
|
+
import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
|
|
2138
2159
|
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
2139
2160
|
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
2140
2161
|
let style = styles.get(scopeId2);
|
|
@@ -2154,7 +2175,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2154
2175
|
var _a;
|
|
2155
2176
|
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
2156
2177
|
const style = styles.get(scopeId2);
|
|
2157
|
-
if (!
|
|
2178
|
+
if (!BUILD18.attachStyles) {
|
|
2158
2179
|
return scopeId2;
|
|
2159
2180
|
}
|
|
2160
2181
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -2167,16 +2188,16 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2167
2188
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
2168
2189
|
}
|
|
2169
2190
|
if (!appliedStyles.has(scopeId2)) {
|
|
2170
|
-
if (
|
|
2191
|
+
if (BUILD18.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
2171
2192
|
styleElm.innerHTML = style;
|
|
2172
2193
|
} else {
|
|
2173
|
-
styleElm = doc.createElement("style");
|
|
2194
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
2174
2195
|
styleElm.innerHTML = style;
|
|
2175
2196
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
2176
2197
|
if (nonce != null) {
|
|
2177
2198
|
styleElm.setAttribute("nonce", nonce);
|
|
2178
2199
|
}
|
|
2179
|
-
if ((
|
|
2200
|
+
if ((BUILD18.hydrateServerSide || BUILD18.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2180
2201
|
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
2181
2202
|
}
|
|
2182
2203
|
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
@@ -2212,7 +2233,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2212
2233
|
appliedStyles.add(scopeId2);
|
|
2213
2234
|
}
|
|
2214
2235
|
}
|
|
2215
|
-
} else if (
|
|
2236
|
+
} else if (BUILD18.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
2216
2237
|
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
2217
2238
|
}
|
|
2218
2239
|
}
|
|
@@ -2224,43 +2245,40 @@ var attachStyles = (hostRef) => {
|
|
|
2224
2245
|
const flags = cmpMeta.$flags$;
|
|
2225
2246
|
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
2226
2247
|
const scopeId2 = addStyle(
|
|
2227
|
-
|
|
2248
|
+
BUILD18.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
2228
2249
|
cmpMeta,
|
|
2229
2250
|
hostRef.$modeName$
|
|
2230
2251
|
);
|
|
2231
|
-
if ((
|
|
2252
|
+
if ((BUILD18.shadowDom || BUILD18.scoped) && BUILD18.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
2232
2253
|
elm["s-sc"] = scopeId2;
|
|
2233
2254
|
elm.classList.add(scopeId2 + "-h");
|
|
2234
|
-
if (BUILD17.scoped && flags & 2 /* scopedCssEncapsulation */) {
|
|
2235
|
-
elm.classList.add(scopeId2 + "-s");
|
|
2236
|
-
}
|
|
2237
2255
|
}
|
|
2238
2256
|
endAttachStyles();
|
|
2239
2257
|
};
|
|
2240
|
-
var getScopeId = (cmp, mode) => "sc-" + (
|
|
2258
|
+
var getScopeId = (cmp, mode) => "sc-" + (BUILD18.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
2241
2259
|
|
|
2242
2260
|
// src/runtime/update-component.ts
|
|
2243
2261
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
2244
|
-
if (
|
|
2262
|
+
if (BUILD19.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
2245
2263
|
ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
|
|
2246
2264
|
}
|
|
2247
2265
|
};
|
|
2248
2266
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
2249
|
-
if (
|
|
2267
|
+
if (BUILD19.taskQueue && BUILD19.updatable) {
|
|
2250
2268
|
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
2251
2269
|
}
|
|
2252
|
-
if (
|
|
2270
|
+
if (BUILD19.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
2253
2271
|
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
2254
2272
|
return;
|
|
2255
2273
|
}
|
|
2256
2274
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
2257
2275
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
2258
|
-
return
|
|
2276
|
+
return BUILD19.taskQueue ? writeTask(dispatch) : dispatch();
|
|
2259
2277
|
};
|
|
2260
2278
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
2261
2279
|
const elm = hostRef.$hostElement$;
|
|
2262
2280
|
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
2263
|
-
const instance =
|
|
2281
|
+
const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2264
2282
|
if (!instance) {
|
|
2265
2283
|
throw new Error(
|
|
2266
2284
|
`Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
|
|
@@ -2268,7 +2286,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2268
2286
|
}
|
|
2269
2287
|
let maybePromise;
|
|
2270
2288
|
if (isInitialLoad) {
|
|
2271
|
-
if (
|
|
2289
|
+
if (BUILD19.lazyLoad && BUILD19.hostListener) {
|
|
2272
2290
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
2273
2291
|
if (hostRef.$queuedListeners$) {
|
|
2274
2292
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
@@ -2276,17 +2294,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2276
2294
|
}
|
|
2277
2295
|
}
|
|
2278
2296
|
emitLifecycleEvent(elm, "componentWillLoad");
|
|
2279
|
-
if (
|
|
2297
|
+
if (BUILD19.cmpWillLoad) {
|
|
2280
2298
|
maybePromise = safeCall(instance, "componentWillLoad");
|
|
2281
2299
|
}
|
|
2282
2300
|
} else {
|
|
2283
2301
|
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
2284
|
-
if (
|
|
2302
|
+
if (BUILD19.cmpWillUpdate) {
|
|
2285
2303
|
maybePromise = safeCall(instance, "componentWillUpdate");
|
|
2286
2304
|
}
|
|
2287
2305
|
}
|
|
2288
2306
|
emitLifecycleEvent(elm, "componentWillRender");
|
|
2289
|
-
if (
|
|
2307
|
+
if (BUILD19.cmpWillRender) {
|
|
2290
2308
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
2291
2309
|
}
|
|
2292
2310
|
endSchedule();
|
|
@@ -2302,23 +2320,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2302
2320
|
const elm = hostRef.$hostElement$;
|
|
2303
2321
|
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
2304
2322
|
const rc = elm["s-rc"];
|
|
2305
|
-
if (
|
|
2323
|
+
if (BUILD19.style && isInitialLoad) {
|
|
2306
2324
|
attachStyles(hostRef);
|
|
2307
2325
|
}
|
|
2308
2326
|
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
2309
|
-
if (
|
|
2327
|
+
if (BUILD19.isDev) {
|
|
2310
2328
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2311
2329
|
}
|
|
2312
|
-
if (
|
|
2330
|
+
if (BUILD19.hydrateServerSide) {
|
|
2313
2331
|
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
2314
2332
|
} else {
|
|
2315
2333
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
2316
2334
|
}
|
|
2317
|
-
if (
|
|
2335
|
+
if (BUILD19.isDev) {
|
|
2318
2336
|
hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
|
|
2319
2337
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2320
2338
|
}
|
|
2321
|
-
if (
|
|
2339
|
+
if (BUILD19.hydrateServerSide) {
|
|
2322
2340
|
try {
|
|
2323
2341
|
serverSideConnected(elm);
|
|
2324
2342
|
if (isInitialLoad) {
|
|
@@ -2332,13 +2350,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2332
2350
|
consoleError(e, elm);
|
|
2333
2351
|
}
|
|
2334
2352
|
}
|
|
2335
|
-
if (
|
|
2353
|
+
if (BUILD19.asyncLoading && rc) {
|
|
2336
2354
|
rc.map((cb) => cb());
|
|
2337
2355
|
elm["s-rc"] = void 0;
|
|
2338
2356
|
}
|
|
2339
2357
|
endRender();
|
|
2340
2358
|
endUpdate();
|
|
2341
|
-
if (
|
|
2359
|
+
if (BUILD19.asyncLoading) {
|
|
2342
2360
|
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
2343
2361
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
2344
2362
|
if (childrenPromises.length === 0) {
|
|
@@ -2354,10 +2372,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2354
2372
|
};
|
|
2355
2373
|
var renderingRef = null;
|
|
2356
2374
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
2357
|
-
const allRenderFn =
|
|
2358
|
-
const lazyLoad =
|
|
2359
|
-
const taskQueue =
|
|
2360
|
-
const updatable =
|
|
2375
|
+
const allRenderFn = BUILD19.allRenderFn ? true : false;
|
|
2376
|
+
const lazyLoad = BUILD19.lazyLoad ? true : false;
|
|
2377
|
+
const taskQueue = BUILD19.taskQueue ? true : false;
|
|
2378
|
+
const updatable = BUILD19.updatable ? true : false;
|
|
2361
2379
|
try {
|
|
2362
2380
|
renderingRef = instance;
|
|
2363
2381
|
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
@@ -2367,9 +2385,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
2367
2385
|
if (updatable || lazyLoad) {
|
|
2368
2386
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
2369
2387
|
}
|
|
2370
|
-
if (
|
|
2371
|
-
if (
|
|
2372
|
-
if (
|
|
2388
|
+
if (BUILD19.hasRenderFn || BUILD19.reflect) {
|
|
2389
|
+
if (BUILD19.vdomRender || BUILD19.reflect) {
|
|
2390
|
+
if (BUILD19.hydrateServerSide) {
|
|
2373
2391
|
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
2374
2392
|
} else {
|
|
2375
2393
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
@@ -2394,57 +2412,57 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2394
2412
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
2395
2413
|
const elm = hostRef.$hostElement$;
|
|
2396
2414
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
2397
|
-
const instance =
|
|
2415
|
+
const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2398
2416
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2399
|
-
if (
|
|
2400
|
-
if (
|
|
2417
|
+
if (BUILD19.cmpDidRender) {
|
|
2418
|
+
if (BUILD19.isDev) {
|
|
2401
2419
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2402
2420
|
}
|
|
2403
2421
|
safeCall(instance, "componentDidRender");
|
|
2404
|
-
if (
|
|
2422
|
+
if (BUILD19.isDev) {
|
|
2405
2423
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2406
2424
|
}
|
|
2407
2425
|
}
|
|
2408
2426
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
2409
2427
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
2410
2428
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
2411
|
-
if (
|
|
2429
|
+
if (BUILD19.asyncLoading && BUILD19.cssAnnotations) {
|
|
2412
2430
|
addHydratedFlag(elm);
|
|
2413
2431
|
}
|
|
2414
|
-
if (
|
|
2415
|
-
if (
|
|
2432
|
+
if (BUILD19.cmpDidLoad) {
|
|
2433
|
+
if (BUILD19.isDev) {
|
|
2416
2434
|
hostRef.$flags$ |= 2048 /* devOnDidLoad */;
|
|
2417
2435
|
}
|
|
2418
2436
|
safeCall(instance, "componentDidLoad");
|
|
2419
|
-
if (
|
|
2437
|
+
if (BUILD19.isDev) {
|
|
2420
2438
|
hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
|
|
2421
2439
|
}
|
|
2422
2440
|
}
|
|
2423
2441
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
2424
2442
|
endPostUpdate();
|
|
2425
|
-
if (
|
|
2443
|
+
if (BUILD19.asyncLoading) {
|
|
2426
2444
|
hostRef.$onReadyResolve$(elm);
|
|
2427
2445
|
if (!ancestorComponent) {
|
|
2428
2446
|
appDidLoad(tagName);
|
|
2429
2447
|
}
|
|
2430
2448
|
}
|
|
2431
2449
|
} else {
|
|
2432
|
-
if (
|
|
2433
|
-
if (
|
|
2450
|
+
if (BUILD19.cmpDidUpdate) {
|
|
2451
|
+
if (BUILD19.isDev) {
|
|
2434
2452
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2435
2453
|
}
|
|
2436
2454
|
safeCall(instance, "componentDidUpdate");
|
|
2437
|
-
if (
|
|
2455
|
+
if (BUILD19.isDev) {
|
|
2438
2456
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2439
2457
|
}
|
|
2440
2458
|
}
|
|
2441
2459
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
2442
2460
|
endPostUpdate();
|
|
2443
2461
|
}
|
|
2444
|
-
if (
|
|
2462
|
+
if (BUILD19.method && BUILD19.lazyLoad) {
|
|
2445
2463
|
hostRef.$onInstanceResolve$(elm);
|
|
2446
2464
|
}
|
|
2447
|
-
if (
|
|
2465
|
+
if (BUILD19.asyncLoading) {
|
|
2448
2466
|
if (hostRef.$onRenderResolve$) {
|
|
2449
2467
|
hostRef.$onRenderResolve$();
|
|
2450
2468
|
hostRef.$onRenderResolve$ = void 0;
|
|
@@ -2456,7 +2474,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2456
2474
|
}
|
|
2457
2475
|
};
|
|
2458
2476
|
var forceUpdate = (ref) => {
|
|
2459
|
-
if (
|
|
2477
|
+
if (BUILD19.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
2460
2478
|
const hostRef = getHostRef(ref);
|
|
2461
2479
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
2462
2480
|
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
@@ -2467,14 +2485,14 @@ var forceUpdate = (ref) => {
|
|
|
2467
2485
|
return false;
|
|
2468
2486
|
};
|
|
2469
2487
|
var appDidLoad = (who) => {
|
|
2470
|
-
if (
|
|
2488
|
+
if (BUILD19.cssAnnotations) {
|
|
2471
2489
|
addHydratedFlag(doc.documentElement);
|
|
2472
2490
|
}
|
|
2473
|
-
if (
|
|
2491
|
+
if (BUILD19.asyncQueue) {
|
|
2474
2492
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2475
2493
|
}
|
|
2476
2494
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
2477
|
-
if (
|
|
2495
|
+
if (BUILD19.profile && performance.measure) {
|
|
2478
2496
|
performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
2479
2497
|
}
|
|
2480
2498
|
};
|
|
@@ -2489,7 +2507,7 @@ var safeCall = (instance, method, arg) => {
|
|
|
2489
2507
|
return void 0;
|
|
2490
2508
|
};
|
|
2491
2509
|
var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
2492
|
-
if (
|
|
2510
|
+
if (BUILD19.lifecycleDOMEvents) {
|
|
2493
2511
|
emitEvent(elm, "stencil_" + lifecycleName, {
|
|
2494
2512
|
bubbles: true,
|
|
2495
2513
|
composed: true,
|
|
@@ -2501,7 +2519,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
|
2501
2519
|
};
|
|
2502
2520
|
var addHydratedFlag = (elm) => {
|
|
2503
2521
|
var _a, _b;
|
|
2504
|
-
return
|
|
2522
|
+
return BUILD19.hydratedClass ? elm.classList.add((_a = BUILD19.hydratedSelectorName) != null ? _a : "hydrated") : BUILD19.hydratedAttribute ? elm.setAttribute((_b = BUILD19.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
|
|
2505
2523
|
};
|
|
2506
2524
|
var serverSideConnected = (elm) => {
|
|
2507
2525
|
const children = elm.children;
|
|
@@ -2520,21 +2538,21 @@ var serverSideConnected = (elm) => {
|
|
|
2520
2538
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
2521
2539
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
2522
2540
|
const hostRef = getHostRef(ref);
|
|
2523
|
-
if (
|
|
2541
|
+
if (BUILD20.lazyLoad && !hostRef) {
|
|
2524
2542
|
throw new Error(
|
|
2525
2543
|
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`
|
|
2526
2544
|
);
|
|
2527
2545
|
}
|
|
2528
|
-
const elm =
|
|
2546
|
+
const elm = BUILD20.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
2529
2547
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
2530
2548
|
const flags = hostRef.$flags$;
|
|
2531
|
-
const instance =
|
|
2549
|
+
const instance = BUILD20.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2532
2550
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
2533
2551
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
2534
2552
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
2535
|
-
if ((!
|
|
2553
|
+
if ((!BUILD20.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
2536
2554
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
2537
|
-
if (
|
|
2555
|
+
if (BUILD20.isDev) {
|
|
2538
2556
|
if (hostRef.$flags$ & 1024 /* devOnRender */) {
|
|
2539
2557
|
consoleDevWarn(
|
|
2540
2558
|
`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
|
|
@@ -2557,8 +2575,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2557
2575
|
);
|
|
2558
2576
|
}
|
|
2559
2577
|
}
|
|
2560
|
-
if (!
|
|
2561
|
-
if (
|
|
2578
|
+
if (!BUILD20.lazyLoad || instance) {
|
|
2579
|
+
if (BUILD20.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
2562
2580
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
2563
2581
|
if (watchMethods) {
|
|
2564
2582
|
watchMethods.map((watchMethodName) => {
|
|
@@ -2570,8 +2588,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2570
2588
|
});
|
|
2571
2589
|
}
|
|
2572
2590
|
}
|
|
2573
|
-
if (
|
|
2574
|
-
if (
|
|
2591
|
+
if (BUILD20.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
2592
|
+
if (BUILD20.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
2575
2593
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2576
2594
|
return;
|
|
2577
2595
|
}
|
|
@@ -2586,40 +2604,40 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2586
2604
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2587
2605
|
var _a, _b;
|
|
2588
2606
|
const prototype = Cstr.prototype;
|
|
2589
|
-
if (
|
|
2607
|
+
if (BUILD21.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
2590
2608
|
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2591
2609
|
const originalFormAssociatedCallback = prototype[cbName];
|
|
2592
2610
|
Object.defineProperty(prototype, cbName, {
|
|
2593
2611
|
value(...args) {
|
|
2594
2612
|
const hostRef = getHostRef(this);
|
|
2595
|
-
const instance =
|
|
2613
|
+
const instance = BUILD21.lazyLoad ? hostRef.$lazyInstance$ : this;
|
|
2596
2614
|
if (!instance) {
|
|
2597
2615
|
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2598
2616
|
const cb = asyncInstance[cbName];
|
|
2599
2617
|
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
2600
2618
|
});
|
|
2601
2619
|
} else {
|
|
2602
|
-
const cb =
|
|
2620
|
+
const cb = BUILD21.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
|
|
2603
2621
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
2604
2622
|
}
|
|
2605
2623
|
}
|
|
2606
2624
|
});
|
|
2607
2625
|
});
|
|
2608
2626
|
}
|
|
2609
|
-
if (
|
|
2610
|
-
if (
|
|
2627
|
+
if (BUILD21.member && cmpMeta.$members$ || BUILD21.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
2628
|
+
if (BUILD21.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
|
|
2611
2629
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2612
2630
|
}
|
|
2613
2631
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
2614
2632
|
members.map(([memberName, [memberFlags]]) => {
|
|
2615
|
-
if ((
|
|
2633
|
+
if ((BUILD21.prop || BUILD21.state) && (memberFlags & 31 /* Prop */ || (!BUILD21.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2616
2634
|
if ((memberFlags & 2048 /* Getter */) === 0) {
|
|
2617
2635
|
Object.defineProperty(prototype, memberName, {
|
|
2618
2636
|
get() {
|
|
2619
2637
|
return getValue(this, memberName);
|
|
2620
2638
|
},
|
|
2621
2639
|
set(newValue) {
|
|
2622
|
-
if (
|
|
2640
|
+
if (BUILD21.isDev) {
|
|
2623
2641
|
const ref = getHostRef(this);
|
|
2624
2642
|
if (
|
|
2625
2643
|
// we are proxying the instance (not element)
|
|
@@ -2640,11 +2658,11 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2640
2658
|
enumerable: true
|
|
2641
2659
|
});
|
|
2642
2660
|
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
|
|
2643
|
-
if (
|
|
2661
|
+
if (BUILD21.lazyLoad) {
|
|
2644
2662
|
Object.defineProperty(prototype, memberName, {
|
|
2645
2663
|
get() {
|
|
2646
2664
|
const ref = getHostRef(this);
|
|
2647
|
-
const instance =
|
|
2665
|
+
const instance = BUILD21.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
|
|
2648
2666
|
if (!instance) return;
|
|
2649
2667
|
return instance[memberName];
|
|
2650
2668
|
},
|
|
@@ -2684,7 +2702,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2684
2702
|
});
|
|
2685
2703
|
}
|
|
2686
2704
|
}
|
|
2687
|
-
} else if (
|
|
2705
|
+
} else if (BUILD21.lazyLoad && BUILD21.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
2688
2706
|
Object.defineProperty(prototype, memberName, {
|
|
2689
2707
|
value(...args) {
|
|
2690
2708
|
var _a2;
|
|
@@ -2697,13 +2715,13 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2697
2715
|
});
|
|
2698
2716
|
}
|
|
2699
2717
|
});
|
|
2700
|
-
if (
|
|
2718
|
+
if (BUILD21.observeAttribute && (!BUILD21.lazyLoad || flags & 1 /* isElementConstructor */)) {
|
|
2701
2719
|
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
2702
2720
|
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
2703
2721
|
plt.jmp(() => {
|
|
2704
2722
|
var _a2;
|
|
2705
2723
|
const propName = attrNameToPropName.get(attrName);
|
|
2706
|
-
if (this.hasOwnProperty(propName) &&
|
|
2724
|
+
if (this.hasOwnProperty(propName) && BUILD21.lazyLoad) {
|
|
2707
2725
|
newValue = this[propName];
|
|
2708
2726
|
delete this[propName];
|
|
2709
2727
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -2713,8 +2731,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2713
2731
|
const hostRef = getHostRef(this);
|
|
2714
2732
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
2715
2733
|
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
2716
|
-
const elm =
|
|
2717
|
-
const instance =
|
|
2734
|
+
const elm = BUILD21.lazyLoad ? hostRef.$hostElement$ : this;
|
|
2735
|
+
const instance = BUILD21.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2718
2736
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
2719
2737
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
2720
2738
|
if (instance[callbackName] != null) {
|
|
@@ -2737,7 +2755,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2737
2755
|
var _a2;
|
|
2738
2756
|
const attrName = m[1] || propName;
|
|
2739
2757
|
attrNameToPropName.set(attrName, propName);
|
|
2740
|
-
if (
|
|
2758
|
+
if (BUILD21.reflect && m[0] & 512 /* ReflectAttr */) {
|
|
2741
2759
|
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
2742
2760
|
}
|
|
2743
2761
|
return attrName;
|
|
@@ -2755,7 +2773,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2755
2773
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
2756
2774
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
2757
2775
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
2758
|
-
if ((
|
|
2776
|
+
if ((BUILD22.lazyLoad || BUILD22.hydrateClientSide) && bundleId) {
|
|
2759
2777
|
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
2760
2778
|
if (CstrImport && "then" in CstrImport) {
|
|
2761
2779
|
const endLoad = uniqueTime(
|
|
@@ -2770,15 +2788,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2770
2788
|
if (!Cstr) {
|
|
2771
2789
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2772
2790
|
}
|
|
2773
|
-
if (
|
|
2774
|
-
if (
|
|
2791
|
+
if (BUILD22.member && !Cstr.isProxied) {
|
|
2792
|
+
if (BUILD22.watchCallback) {
|
|
2775
2793
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2776
2794
|
}
|
|
2777
2795
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
2778
2796
|
Cstr.isProxied = true;
|
|
2779
2797
|
}
|
|
2780
2798
|
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
2781
|
-
if (
|
|
2799
|
+
if (BUILD22.member) {
|
|
2782
2800
|
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
2783
2801
|
}
|
|
2784
2802
|
try {
|
|
@@ -2786,10 +2804,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2786
2804
|
} catch (e) {
|
|
2787
2805
|
consoleError(e);
|
|
2788
2806
|
}
|
|
2789
|
-
if (
|
|
2807
|
+
if (BUILD22.member) {
|
|
2790
2808
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
2791
2809
|
}
|
|
2792
|
-
if (
|
|
2810
|
+
if (BUILD22.watchCallback) {
|
|
2793
2811
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
2794
2812
|
}
|
|
2795
2813
|
endNewInstance();
|
|
@@ -2799,24 +2817,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2799
2817
|
const cmpTag = elm.localName;
|
|
2800
2818
|
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
2801
2819
|
}
|
|
2802
|
-
if (
|
|
2820
|
+
if (BUILD22.style && Cstr && Cstr.style) {
|
|
2803
2821
|
let style;
|
|
2804
2822
|
if (typeof Cstr.style === "string") {
|
|
2805
2823
|
style = Cstr.style;
|
|
2806
|
-
} else if (
|
|
2824
|
+
} else if (BUILD22.mode && typeof Cstr.style !== "string") {
|
|
2807
2825
|
hostRef.$modeName$ = computeMode(elm);
|
|
2808
2826
|
if (hostRef.$modeName$) {
|
|
2809
2827
|
style = Cstr.style[hostRef.$modeName$];
|
|
2810
2828
|
}
|
|
2811
|
-
if (
|
|
2829
|
+
if (BUILD22.hydrateServerSide && hostRef.$modeName$) {
|
|
2812
2830
|
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
2813
2831
|
}
|
|
2814
2832
|
}
|
|
2815
2833
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2816
2834
|
if (!styles.has(scopeId2)) {
|
|
2817
2835
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
2818
|
-
if (!
|
|
2819
|
-
|
|
2836
|
+
if (!BUILD22.hydrateServerSide && BUILD22.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2837
|
+
BUILD22.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2820
2838
|
style = await import("./shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
|
|
2821
2839
|
}
|
|
2822
2840
|
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
@@ -2826,14 +2844,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2826
2844
|
}
|
|
2827
2845
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2828
2846
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2829
|
-
if (
|
|
2847
|
+
if (BUILD22.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
2830
2848
|
ancestorComponent["s-rc"].push(schedule);
|
|
2831
2849
|
} else {
|
|
2832
2850
|
schedule();
|
|
2833
2851
|
}
|
|
2834
2852
|
};
|
|
2835
2853
|
var fireConnectedCallback = (instance) => {
|
|
2836
|
-
if (
|
|
2854
|
+
if (BUILD22.lazyLoad && BUILD22.connectedCallback) {
|
|
2837
2855
|
safeCall(instance, "connectedCallback");
|
|
2838
2856
|
}
|
|
2839
2857
|
};
|
|
@@ -2844,41 +2862,41 @@ var connectedCallback = (elm) => {
|
|
|
2844
2862
|
const hostRef = getHostRef(elm);
|
|
2845
2863
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2846
2864
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
2847
|
-
if (
|
|
2865
|
+
if (BUILD23.hostListenerTargetParent) {
|
|
2848
2866
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2849
2867
|
}
|
|
2850
2868
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
2851
2869
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2852
2870
|
let hostId;
|
|
2853
|
-
if (
|
|
2871
|
+
if (BUILD23.hydrateClientSide) {
|
|
2854
2872
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2855
2873
|
if (hostId) {
|
|
2856
|
-
if (
|
|
2857
|
-
const scopeId2 =
|
|
2874
|
+
if (BUILD23.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2875
|
+
const scopeId2 = BUILD23.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
|
|
2858
2876
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2859
|
-
} else if (
|
|
2860
|
-
const scopeId2 = getScopeId(cmpMeta,
|
|
2877
|
+
} else if (BUILD23.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2878
|
+
const scopeId2 = getScopeId(cmpMeta, BUILD23.mode ? elm.getAttribute("s-mode") : void 0);
|
|
2861
2879
|
elm["s-sc"] = scopeId2;
|
|
2862
2880
|
}
|
|
2863
2881
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2864
2882
|
}
|
|
2865
2883
|
}
|
|
2866
|
-
if (
|
|
2867
|
-
if (
|
|
2884
|
+
if (BUILD23.slotRelocation && !hostId) {
|
|
2885
|
+
if (BUILD23.hydrateServerSide || (BUILD23.slot || BUILD23.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2868
2886
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
2869
2887
|
setContentReference(elm);
|
|
2870
2888
|
}
|
|
2871
2889
|
}
|
|
2872
|
-
if (
|
|
2890
|
+
if (BUILD23.asyncLoading) {
|
|
2873
2891
|
let ancestorComponent = elm;
|
|
2874
2892
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
2875
|
-
if (
|
|
2893
|
+
if (BUILD23.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
2876
2894
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
2877
2895
|
break;
|
|
2878
2896
|
}
|
|
2879
2897
|
}
|
|
2880
2898
|
}
|
|
2881
|
-
if (
|
|
2899
|
+
if (BUILD23.prop && !BUILD23.hydrateServerSide && cmpMeta.$members$) {
|
|
2882
2900
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2883
2901
|
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2884
2902
|
const value = elm[memberName];
|
|
@@ -2887,7 +2905,7 @@ var connectedCallback = (elm) => {
|
|
|
2887
2905
|
}
|
|
2888
2906
|
});
|
|
2889
2907
|
}
|
|
2890
|
-
if (
|
|
2908
|
+
if (BUILD23.initializeNextTick) {
|
|
2891
2909
|
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2892
2910
|
} else {
|
|
2893
2911
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
@@ -2905,32 +2923,32 @@ var connectedCallback = (elm) => {
|
|
|
2905
2923
|
};
|
|
2906
2924
|
var setContentReference = (elm) => {
|
|
2907
2925
|
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
2908
|
-
|
|
2926
|
+
BUILD23.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
2909
2927
|
);
|
|
2910
2928
|
contentRefElm["s-cn"] = true;
|
|
2911
2929
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
2912
2930
|
};
|
|
2913
2931
|
|
|
2914
2932
|
// src/runtime/disconnected-callback.ts
|
|
2915
|
-
import { BUILD as
|
|
2933
|
+
import { BUILD as BUILD24 } from "@stencil/core/internal/app-data";
|
|
2916
2934
|
var disconnectInstance = (instance) => {
|
|
2917
|
-
if (
|
|
2935
|
+
if (BUILD24.lazyLoad && BUILD24.disconnectedCallback) {
|
|
2918
2936
|
safeCall(instance, "disconnectedCallback");
|
|
2919
2937
|
}
|
|
2920
|
-
if (
|
|
2938
|
+
if (BUILD24.cmpDidUnload) {
|
|
2921
2939
|
safeCall(instance, "componentDidUnload");
|
|
2922
2940
|
}
|
|
2923
2941
|
};
|
|
2924
2942
|
var disconnectedCallback = async (elm) => {
|
|
2925
2943
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2926
2944
|
const hostRef = getHostRef(elm);
|
|
2927
|
-
if (
|
|
2945
|
+
if (BUILD24.hostListener) {
|
|
2928
2946
|
if (hostRef.$rmListeners$) {
|
|
2929
2947
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2930
2948
|
hostRef.$rmListeners$ = void 0;
|
|
2931
2949
|
}
|
|
2932
2950
|
}
|
|
2933
|
-
if (!
|
|
2951
|
+
if (!BUILD24.lazyLoad) {
|
|
2934
2952
|
disconnectInstance(elm);
|
|
2935
2953
|
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2936
2954
|
disconnectInstance(hostRef.$lazyInstance$);
|
|
@@ -2949,36 +2967,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2949
2967
|
$flags$: compactMeta[0],
|
|
2950
2968
|
$tagName$: compactMeta[1]
|
|
2951
2969
|
};
|
|
2952
|
-
if (
|
|
2970
|
+
if (BUILD25.member) {
|
|
2953
2971
|
cmpMeta.$members$ = compactMeta[2];
|
|
2954
2972
|
}
|
|
2955
|
-
if (
|
|
2973
|
+
if (BUILD25.hostListener) {
|
|
2956
2974
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2957
2975
|
}
|
|
2958
|
-
if (
|
|
2976
|
+
if (BUILD25.watchCallback) {
|
|
2959
2977
|
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
2960
2978
|
}
|
|
2961
|
-
if (
|
|
2979
|
+
if (BUILD25.reflect) {
|
|
2962
2980
|
cmpMeta.$attrsToReflect$ = [];
|
|
2963
2981
|
}
|
|
2964
|
-
if (
|
|
2982
|
+
if (BUILD25.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2965
2983
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2966
2984
|
}
|
|
2967
|
-
if (
|
|
2968
|
-
if (
|
|
2985
|
+
if (BUILD25.experimentalSlotFixes) {
|
|
2986
|
+
if (BUILD25.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2969
2987
|
patchPseudoShadowDom(Cstr.prototype);
|
|
2970
2988
|
}
|
|
2971
2989
|
} else {
|
|
2972
|
-
if (
|
|
2990
|
+
if (BUILD25.slotChildNodesFix) {
|
|
2973
2991
|
patchChildSlotNodes(Cstr.prototype);
|
|
2974
2992
|
}
|
|
2975
|
-
if (
|
|
2993
|
+
if (BUILD25.cloneNodeFix) {
|
|
2976
2994
|
patchCloneNode(Cstr.prototype);
|
|
2977
2995
|
}
|
|
2978
|
-
if (
|
|
2996
|
+
if (BUILD25.appendChildSlotFix) {
|
|
2979
2997
|
patchSlotAppendChild(Cstr.prototype);
|
|
2980
2998
|
}
|
|
2981
|
-
if (
|
|
2999
|
+
if (BUILD25.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2982
3000
|
patchTextContent(Cstr.prototype);
|
|
2983
3001
|
}
|
|
2984
3002
|
}
|
|
@@ -2996,20 +3014,20 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2996
3014
|
this.__hasHostListenerAttached = true;
|
|
2997
3015
|
}
|
|
2998
3016
|
connectedCallback(this);
|
|
2999
|
-
if (
|
|
3017
|
+
if (BUILD25.connectedCallback && originalConnectedCallback) {
|
|
3000
3018
|
originalConnectedCallback.call(this);
|
|
3001
3019
|
}
|
|
3002
3020
|
},
|
|
3003
3021
|
disconnectedCallback() {
|
|
3004
3022
|
disconnectedCallback(this);
|
|
3005
|
-
if (
|
|
3023
|
+
if (BUILD25.disconnectedCallback && originalDisconnectedCallback) {
|
|
3006
3024
|
originalDisconnectedCallback.call(this);
|
|
3007
3025
|
}
|
|
3008
3026
|
},
|
|
3009
3027
|
__attachShadow() {
|
|
3010
3028
|
if (supportsShadow) {
|
|
3011
3029
|
if (!this.shadowRoot) {
|
|
3012
|
-
if (
|
|
3030
|
+
if (BUILD25.shadowDelegatesFocus) {
|
|
3013
3031
|
this.attachShadow({
|
|
3014
3032
|
mode: "open",
|
|
3015
3033
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -3033,7 +3051,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3033
3051
|
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
3034
3052
|
};
|
|
3035
3053
|
var forceModeUpdate = (elm) => {
|
|
3036
|
-
if (
|
|
3054
|
+
if (BUILD25.style && BUILD25.mode && !BUILD25.lazyLoad) {
|
|
3037
3055
|
const mode = computeMode(elm);
|
|
3038
3056
|
const hostRef = getHostRef(elm);
|
|
3039
3057
|
if (hostRef.$modeName$ !== mode) {
|
|
@@ -3056,7 +3074,7 @@ var forceModeUpdate = (elm) => {
|
|
|
3056
3074
|
};
|
|
3057
3075
|
|
|
3058
3076
|
// src/runtime/bootstrap-lazy.ts
|
|
3059
|
-
import { BUILD as
|
|
3077
|
+
import { BUILD as BUILD26 } from "@stencil/core/internal/app-data";
|
|
3060
3078
|
|
|
3061
3079
|
// src/runtime/hmr-component.ts
|
|
3062
3080
|
var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
@@ -3068,7 +3086,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
|
3068
3086
|
// src/runtime/bootstrap-lazy.ts
|
|
3069
3087
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
3070
3088
|
var _a;
|
|
3071
|
-
if (
|
|
3089
|
+
if (BUILD26.profile && performance.mark) {
|
|
3072
3090
|
performance.mark("st:app:start");
|
|
3073
3091
|
}
|
|
3074
3092
|
installDevTools();
|
|
@@ -3084,12 +3102,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3084
3102
|
let isBootstrapping = true;
|
|
3085
3103
|
Object.assign(plt, options);
|
|
3086
3104
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
|
|
3087
|
-
if (
|
|
3105
|
+
if (BUILD26.asyncQueue) {
|
|
3088
3106
|
if (options.syncQueue) {
|
|
3089
3107
|
plt.$flags$ |= 4 /* queueSync */;
|
|
3090
3108
|
}
|
|
3091
3109
|
}
|
|
3092
|
-
if (
|
|
3110
|
+
if (BUILD26.hydrateClientSide) {
|
|
3093
3111
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
3094
3112
|
}
|
|
3095
3113
|
let hasSlotRelocation = false;
|
|
@@ -3105,22 +3123,22 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3105
3123
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
3106
3124
|
hasSlotRelocation = true;
|
|
3107
3125
|
}
|
|
3108
|
-
if (
|
|
3126
|
+
if (BUILD26.member) {
|
|
3109
3127
|
cmpMeta.$members$ = compactMeta[2];
|
|
3110
3128
|
}
|
|
3111
|
-
if (
|
|
3129
|
+
if (BUILD26.hostListener) {
|
|
3112
3130
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
3113
3131
|
}
|
|
3114
|
-
if (
|
|
3132
|
+
if (BUILD26.reflect) {
|
|
3115
3133
|
cmpMeta.$attrsToReflect$ = [];
|
|
3116
3134
|
}
|
|
3117
|
-
if (
|
|
3135
|
+
if (BUILD26.watchCallback) {
|
|
3118
3136
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
3119
3137
|
}
|
|
3120
|
-
if (
|
|
3138
|
+
if (BUILD26.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3121
3139
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
3122
3140
|
}
|
|
3123
|
-
const tagName =
|
|
3141
|
+
const tagName = BUILD26.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
|
|
3124
3142
|
const HostElement = class extends HTMLElement {
|
|
3125
3143
|
// StencilLazyHost
|
|
3126
3144
|
constructor(self) {
|
|
@@ -3128,10 +3146,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3128
3146
|
this.hasRegisteredEventListeners = false;
|
|
3129
3147
|
self = this;
|
|
3130
3148
|
registerHost(self, cmpMeta);
|
|
3131
|
-
if (
|
|
3149
|
+
if (BUILD26.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3132
3150
|
if (supportsShadow) {
|
|
3133
3151
|
if (!self.shadowRoot) {
|
|
3134
|
-
if (
|
|
3152
|
+
if (BUILD26.shadowDelegatesFocus) {
|
|
3135
3153
|
self.attachShadow({
|
|
3136
3154
|
mode: "open",
|
|
3137
3155
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -3146,7 +3164,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3146
3164
|
);
|
|
3147
3165
|
}
|
|
3148
3166
|
}
|
|
3149
|
-
} else if (!
|
|
3167
|
+
} else if (!BUILD26.hydrateServerSide && !("shadowRoot" in self)) {
|
|
3150
3168
|
self.shadowRoot = self;
|
|
3151
3169
|
}
|
|
3152
3170
|
}
|
|
@@ -3174,28 +3192,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3174
3192
|
return getHostRef(this).$onReadyPromise$;
|
|
3175
3193
|
}
|
|
3176
3194
|
};
|
|
3177
|
-
if (
|
|
3178
|
-
if (
|
|
3195
|
+
if (BUILD26.experimentalSlotFixes) {
|
|
3196
|
+
if (BUILD26.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3179
3197
|
patchPseudoShadowDom(HostElement.prototype);
|
|
3180
3198
|
}
|
|
3181
3199
|
} else {
|
|
3182
|
-
if (
|
|
3200
|
+
if (BUILD26.slotChildNodesFix) {
|
|
3183
3201
|
patchChildSlotNodes(HostElement.prototype);
|
|
3184
3202
|
}
|
|
3185
|
-
if (
|
|
3203
|
+
if (BUILD26.cloneNodeFix) {
|
|
3186
3204
|
patchCloneNode(HostElement.prototype);
|
|
3187
3205
|
}
|
|
3188
|
-
if (
|
|
3206
|
+
if (BUILD26.appendChildSlotFix) {
|
|
3189
3207
|
patchSlotAppendChild(HostElement.prototype);
|
|
3190
3208
|
}
|
|
3191
|
-
if (
|
|
3209
|
+
if (BUILD26.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3192
3210
|
patchTextContent(HostElement.prototype);
|
|
3193
3211
|
}
|
|
3194
3212
|
}
|
|
3195
|
-
if (
|
|
3213
|
+
if (BUILD26.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
|
|
3196
3214
|
HostElement.formAssociated = true;
|
|
3197
3215
|
}
|
|
3198
|
-
if (
|
|
3216
|
+
if (BUILD26.hotModuleReplacement) {
|
|
3199
3217
|
HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
3200
3218
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
3201
3219
|
};
|
|
@@ -3214,7 +3232,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3214
3232
|
if (hasSlotRelocation) {
|
|
3215
3233
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
3216
3234
|
}
|
|
3217
|
-
if (
|
|
3235
|
+
if (BUILD26.invisiblePrehydration && (BUILD26.hydratedClass || BUILD26.hydratedAttribute)) {
|
|
3218
3236
|
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
3219
3237
|
}
|
|
3220
3238
|
if (dataStyles.innerHTML.length) {
|
|
@@ -3230,7 +3248,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3230
3248
|
if (deferredConnectedCallbacks.length) {
|
|
3231
3249
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
3232
3250
|
} else {
|
|
3233
|
-
if (
|
|
3251
|
+
if (BUILD26.profile) {
|
|
3234
3252
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
|
|
3235
3253
|
} else {
|
|
3236
3254
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
|
|
@@ -3243,10 +3261,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3243
3261
|
var Fragment = (_, children) => children;
|
|
3244
3262
|
|
|
3245
3263
|
// src/runtime/host-listener.ts
|
|
3246
|
-
import { BUILD as
|
|
3264
|
+
import { BUILD as BUILD27 } from "@stencil/core/internal/app-data";
|
|
3247
3265
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
3248
|
-
if (
|
|
3249
|
-
if (
|
|
3266
|
+
if (BUILD27.hostListener && listeners) {
|
|
3267
|
+
if (BUILD27.hostListenerTargetParent) {
|
|
3250
3268
|
if (attachParentListeners) {
|
|
3251
3269
|
listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
|
|
3252
3270
|
} else {
|
|
@@ -3254,7 +3272,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3254
3272
|
}
|
|
3255
3273
|
}
|
|
3256
3274
|
listeners.map(([flags, name, method]) => {
|
|
3257
|
-
const target =
|
|
3275
|
+
const target = BUILD27.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
|
|
3258
3276
|
const handler = hostListenerProxy(hostRef, method);
|
|
3259
3277
|
const opts = hostListenerOpts(flags);
|
|
3260
3278
|
plt.ael(target, name, handler, opts);
|
|
@@ -3265,7 +3283,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3265
3283
|
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
3266
3284
|
var _a;
|
|
3267
3285
|
try {
|
|
3268
|
-
if (
|
|
3286
|
+
if (BUILD27.lazyLoad) {
|
|
3269
3287
|
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
3270
3288
|
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
3271
3289
|
} else {
|
|
@@ -3279,10 +3297,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
3279
3297
|
}
|
|
3280
3298
|
};
|
|
3281
3299
|
var getHostListenerTarget = (elm, flags) => {
|
|
3282
|
-
if (
|
|
3283
|
-
if (
|
|
3284
|
-
if (
|
|
3285
|
-
if (
|
|
3300
|
+
if (BUILD27.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
|
|
3301
|
+
if (BUILD27.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
|
|
3302
|
+
if (BUILD27.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
|
|
3303
|
+
if (BUILD27.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
|
|
3286
3304
|
return elm.parentElement;
|
|
3287
3305
|
return elm;
|
|
3288
3306
|
};
|
|
@@ -3442,7 +3460,7 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
|
|
|
3442
3460
|
}
|
|
3443
3461
|
};
|
|
3444
3462
|
export {
|
|
3445
|
-
|
|
3463
|
+
BUILD28 as BUILD,
|
|
3446
3464
|
Build,
|
|
3447
3465
|
Env,
|
|
3448
3466
|
Fragment,
|