@stencil/core 4.32.0 → 4.33.0
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 +21 -9
- 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/app-globals/index.d.ts +2 -0
- package/internal/app-globals/index.js +14 -0
- package/internal/app-globals/package.json +14 -0
- package/internal/client/index.js +285 -286
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +284 -293
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +53 -32
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +4 -1
- package/internal/stencil-public-runtime.d.ts +1 -1
- package/internal/testing/index.js +294 -288
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +28 -10
- package/mock-doc/index.d.ts +5 -4
- package/mock-doc/index.js +28 -10
- package/mock-doc/package.json +1 -1
- package/package.json +5 -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 +21 -21
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +27 -24
- package/testing/package.json +1 -1
package/internal/client/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Client Platform v4.
|
|
2
|
+
Stencil Client Platform v4.33.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -319,7 +319,7 @@ var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
|
|
|
319
319
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
320
320
|
|
|
321
321
|
// src/client/index.ts
|
|
322
|
-
import { BUILD as
|
|
322
|
+
import { BUILD as BUILD30, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
|
|
323
323
|
|
|
324
324
|
// src/runtime/asset-path.ts
|
|
325
325
|
var getAssetPath = (path) => {
|
|
@@ -329,7 +329,7 @@ var getAssetPath = (path) => {
|
|
|
329
329
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
330
330
|
|
|
331
331
|
// src/runtime/bootstrap-custom-element.ts
|
|
332
|
-
import { BUILD as
|
|
332
|
+
import { BUILD as BUILD27 } from "@stencil/core/internal/app-data";
|
|
333
333
|
|
|
334
334
|
// src/utils/helpers.ts
|
|
335
335
|
var isDef = (v) => v != null && v !== void 0;
|
|
@@ -501,6 +501,19 @@ function deserializeProperty(value) {
|
|
|
501
501
|
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
+
// src/utils/shadow-root.ts
|
|
505
|
+
import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
|
|
506
|
+
import { globalStyles } from "@stencil/core/internal/app-globals";
|
|
507
|
+
function createShadowRoot(cmpMeta) {
|
|
508
|
+
const shadowRoot = BUILD8.shadowDelegatesFocus ? this.attachShadow({
|
|
509
|
+
mode: "open",
|
|
510
|
+
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
511
|
+
}) : this.attachShadow({ mode: "open" });
|
|
512
|
+
const sheet = new CSSStyleSheet();
|
|
513
|
+
sheet.replaceSync(globalStyles);
|
|
514
|
+
shadowRoot.adoptedStyleSheets.push(sheet);
|
|
515
|
+
}
|
|
516
|
+
|
|
504
517
|
// src/utils/util.ts
|
|
505
518
|
var lowerPathParam = (fn) => (p) => fn(p.toLowerCase());
|
|
506
519
|
var isDtsFile = lowerPathParam((p) => p.endsWith(".d.ts") || p.endsWith(".d.mts") || p.endsWith(".d.cts"));
|
|
@@ -516,16 +529,16 @@ var isJsxFile = lowerPathParam(
|
|
|
516
529
|
var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") || p.endsWith(".cjs"));
|
|
517
530
|
|
|
518
531
|
// src/runtime/connected-callback.ts
|
|
519
|
-
import { BUILD as
|
|
532
|
+
import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
|
|
520
533
|
|
|
521
534
|
// src/runtime/client-hydrate.ts
|
|
522
|
-
import { BUILD as
|
|
535
|
+
import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
|
|
523
536
|
|
|
524
537
|
// src/runtime/dom-extras.ts
|
|
525
|
-
import { BUILD as
|
|
538
|
+
import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
|
|
526
539
|
|
|
527
540
|
// src/runtime/slot-polyfill-utils.ts
|
|
528
|
-
import { BUILD as
|
|
541
|
+
import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
|
|
529
542
|
var updateFallbackSlotVisibility = (elm) => {
|
|
530
543
|
const childNodes = internalCall(elm, "childNodes");
|
|
531
544
|
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
@@ -604,7 +617,7 @@ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
|
604
617
|
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
605
618
|
const parent = slotNode["s-cr"].parentNode;
|
|
606
619
|
const appendMethod = prepend ? internalCall(parent, "prepend") : internalCall(parent, "appendChild");
|
|
607
|
-
if (
|
|
620
|
+
if (BUILD9.hydrateClientSide && typeof position !== "undefined") {
|
|
608
621
|
slottedNodeLocation["s-oo"] = position;
|
|
609
622
|
const childNodes = internalCall(parent, "childNodes");
|
|
610
623
|
const slotRelocateNodes = [slottedNodeLocation];
|
|
@@ -682,9 +695,9 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
682
695
|
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
683
696
|
HostElementPrototype.cloneNode = function(deep) {
|
|
684
697
|
const srcNode = this;
|
|
685
|
-
const isShadowDom =
|
|
698
|
+
const isShadowDom = BUILD10.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
686
699
|
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
687
|
-
if (
|
|
700
|
+
if (BUILD10.slot && !isShadowDom && deep) {
|
|
688
701
|
let i2 = 0;
|
|
689
702
|
let slotted, nonStencilNode;
|
|
690
703
|
const stencilPrivates = [
|
|
@@ -709,7 +722,7 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
709
722
|
slotted = childNodes[i2]["s-nr"];
|
|
710
723
|
nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
711
724
|
if (slotted) {
|
|
712
|
-
if (
|
|
725
|
+
if (BUILD10.appendChildSlotFix && clonedNode.__appendChild) {
|
|
713
726
|
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
714
727
|
} else {
|
|
715
728
|
clonedNode.appendChild(slotted.cloneNode(true));
|
|
@@ -1041,10 +1054,10 @@ function internalCall(node, method) {
|
|
|
1041
1054
|
}
|
|
1042
1055
|
|
|
1043
1056
|
// src/runtime/profile.ts
|
|
1044
|
-
import { BUILD as
|
|
1057
|
+
import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
|
|
1045
1058
|
var i = 0;
|
|
1046
1059
|
var createTime = (fnName, tagName = "") => {
|
|
1047
|
-
if (
|
|
1060
|
+
if (BUILD11.profile && performance.mark) {
|
|
1048
1061
|
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
1049
1062
|
performance.mark(key);
|
|
1050
1063
|
return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
|
|
@@ -1055,7 +1068,7 @@ var createTime = (fnName, tagName = "") => {
|
|
|
1055
1068
|
}
|
|
1056
1069
|
};
|
|
1057
1070
|
var uniqueTime = (key, measureText) => {
|
|
1058
|
-
if (
|
|
1071
|
+
if (BUILD11.profile && performance.mark) {
|
|
1059
1072
|
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
1060
1073
|
performance.mark(key);
|
|
1061
1074
|
}
|
|
@@ -1113,7 +1126,7 @@ var inspect = (ref) => {
|
|
|
1113
1126
|
};
|
|
1114
1127
|
};
|
|
1115
1128
|
var installDevTools = () => {
|
|
1116
|
-
if (
|
|
1129
|
+
if (BUILD11.devTools) {
|
|
1117
1130
|
const stencil = win.stencil = win.stencil || {};
|
|
1118
1131
|
const originalInspect = stencil.inspect;
|
|
1119
1132
|
stencil.inspect = (ref) => {
|
|
@@ -1127,7 +1140,7 @@ var installDevTools = () => {
|
|
|
1127
1140
|
};
|
|
1128
1141
|
|
|
1129
1142
|
// src/runtime/vdom/h.ts
|
|
1130
|
-
import { BUILD as
|
|
1143
|
+
import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
|
|
1131
1144
|
var h = (nodeName, vnodeData, ...children) => {
|
|
1132
1145
|
let child = null;
|
|
1133
1146
|
let key = null;
|
|
@@ -1143,7 +1156,7 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
1143
1156
|
} else if (child != null && typeof child !== "boolean") {
|
|
1144
1157
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
1145
1158
|
child = String(child);
|
|
1146
|
-
} else if (
|
|
1159
|
+
} else if (BUILD12.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
1147
1160
|
consoleDevError(`vNode passed as children has unexpected type.
|
|
1148
1161
|
Make sure it's using the correct h() function.
|
|
1149
1162
|
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
@@ -1159,28 +1172,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
1159
1172
|
};
|
|
1160
1173
|
walk(children);
|
|
1161
1174
|
if (vnodeData) {
|
|
1162
|
-
if (
|
|
1175
|
+
if (BUILD12.isDev && nodeName === "input") {
|
|
1163
1176
|
validateInputProperties(vnodeData);
|
|
1164
1177
|
}
|
|
1165
|
-
if (
|
|
1178
|
+
if (BUILD12.vdomKey && vnodeData.key) {
|
|
1166
1179
|
key = vnodeData.key;
|
|
1167
1180
|
}
|
|
1168
|
-
if (
|
|
1181
|
+
if (BUILD12.slotRelocation && vnodeData.name) {
|
|
1169
1182
|
slotName = vnodeData.name;
|
|
1170
1183
|
}
|
|
1171
|
-
if (
|
|
1184
|
+
if (BUILD12.vdomClass) {
|
|
1172
1185
|
const classData = vnodeData.className || vnodeData.class;
|
|
1173
1186
|
if (classData) {
|
|
1174
1187
|
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
1175
1188
|
}
|
|
1176
1189
|
}
|
|
1177
1190
|
}
|
|
1178
|
-
if (
|
|
1191
|
+
if (BUILD12.isDev && vNodeChildren.some(isHost)) {
|
|
1179
1192
|
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
1180
1193
|
- You are NOT using hostData() and <Host> in the same component.
|
|
1181
1194
|
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
1182
1195
|
}
|
|
1183
|
-
if (
|
|
1196
|
+
if (BUILD12.vdomFunctional && typeof nodeName === "function") {
|
|
1184
1197
|
return nodeName(
|
|
1185
1198
|
vnodeData === null ? {} : vnodeData,
|
|
1186
1199
|
vNodeChildren,
|
|
@@ -1192,10 +1205,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
1192
1205
|
if (vNodeChildren.length > 0) {
|
|
1193
1206
|
vnode.$children$ = vNodeChildren;
|
|
1194
1207
|
}
|
|
1195
|
-
if (
|
|
1208
|
+
if (BUILD12.vdomKey) {
|
|
1196
1209
|
vnode.$key$ = key;
|
|
1197
1210
|
}
|
|
1198
|
-
if (
|
|
1211
|
+
if (BUILD12.slotRelocation) {
|
|
1199
1212
|
vnode.$name$ = slotName;
|
|
1200
1213
|
}
|
|
1201
1214
|
return vnode;
|
|
@@ -1208,13 +1221,13 @@ var newVNode = (tag, text) => {
|
|
|
1208
1221
|
$elm$: null,
|
|
1209
1222
|
$children$: null
|
|
1210
1223
|
};
|
|
1211
|
-
if (
|
|
1224
|
+
if (BUILD12.vdomAttribute) {
|
|
1212
1225
|
vnode.$attrs$ = null;
|
|
1213
1226
|
}
|
|
1214
|
-
if (
|
|
1227
|
+
if (BUILD12.vdomKey) {
|
|
1215
1228
|
vnode.$key$ = null;
|
|
1216
1229
|
}
|
|
1217
|
-
if (
|
|
1230
|
+
if (BUILD12.slotRelocation) {
|
|
1218
1231
|
vnode.$name$ = null;
|
|
1219
1232
|
}
|
|
1220
1233
|
return vnode;
|
|
@@ -1274,7 +1287,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1274
1287
|
const childRenderNodes = [];
|
|
1275
1288
|
const slotNodes = [];
|
|
1276
1289
|
const slottedNodes = [];
|
|
1277
|
-
const shadowRootNodes =
|
|
1290
|
+
const shadowRootNodes = BUILD13.shadowDom && shadowRoot ? [] : null;
|
|
1278
1291
|
const vnode = newVNode(tagName, null);
|
|
1279
1292
|
vnode.$elm$ = hostElm;
|
|
1280
1293
|
const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
|
|
@@ -1291,7 +1304,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1291
1304
|
}
|
|
1292
1305
|
});
|
|
1293
1306
|
let scopeId2;
|
|
1294
|
-
if (
|
|
1307
|
+
if (BUILD13.scoped) {
|
|
1295
1308
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1296
1309
|
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
1297
1310
|
scopeId2 = hostElm["s-sc"];
|
|
@@ -1380,7 +1393,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1380
1393
|
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1381
1394
|
}
|
|
1382
1395
|
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1383
|
-
if (
|
|
1396
|
+
if (BUILD13.experimentalSlotFixes) {
|
|
1384
1397
|
patchSlottedNode(slottedItem.node);
|
|
1385
1398
|
}
|
|
1386
1399
|
}
|
|
@@ -1389,12 +1402,12 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1389
1402
|
}
|
|
1390
1403
|
}
|
|
1391
1404
|
}
|
|
1392
|
-
if (
|
|
1405
|
+
if (BUILD13.scoped && scopeId2 && slotNodes.length) {
|
|
1393
1406
|
slotNodes.forEach((slot) => {
|
|
1394
1407
|
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
1395
1408
|
});
|
|
1396
1409
|
}
|
|
1397
|
-
if (
|
|
1410
|
+
if (BUILD13.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {
|
|
1398
1411
|
let rnIdex = 0;
|
|
1399
1412
|
const rnLen = shadowRootNodes.length;
|
|
1400
1413
|
if (rnLen) {
|
|
@@ -1444,7 +1457,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1444
1457
|
if (!parentVNode.$children$) {
|
|
1445
1458
|
parentVNode.$children$ = [];
|
|
1446
1459
|
}
|
|
1447
|
-
if (
|
|
1460
|
+
if (BUILD13.scoped && scopeId2) {
|
|
1448
1461
|
node["s-si"] = scopeId2;
|
|
1449
1462
|
childVNode.$attrs$.class += " " + scopeId2;
|
|
1450
1463
|
}
|
|
@@ -1462,7 +1475,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1462
1475
|
shadowRootNodes,
|
|
1463
1476
|
slottedNodes
|
|
1464
1477
|
);
|
|
1465
|
-
if (
|
|
1478
|
+
if (BUILD13.scoped && scopeId2) {
|
|
1466
1479
|
node.classList.add(scopeId2);
|
|
1467
1480
|
}
|
|
1468
1481
|
}
|
|
@@ -1559,9 +1572,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1559
1572
|
slottedNodes
|
|
1560
1573
|
);
|
|
1561
1574
|
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1562
|
-
if (
|
|
1575
|
+
if (BUILD13.shadowDom && shadowRootNodes) {
|
|
1563
1576
|
node.remove();
|
|
1564
|
-
} else if (
|
|
1577
|
+
} else if (BUILD13.slotRelocation) {
|
|
1565
1578
|
hostElm["s-cr"] = node;
|
|
1566
1579
|
node["s-cn"] = true;
|
|
1567
1580
|
}
|
|
@@ -1627,7 +1640,7 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
|
|
|
1627
1640
|
childVNode.$name$ = slotName || null;
|
|
1628
1641
|
childVNode.$tag$ = "slot";
|
|
1629
1642
|
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1630
|
-
if (
|
|
1643
|
+
if (BUILD13.shadowDom && shadowRootNodes && win.document) {
|
|
1631
1644
|
const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
|
|
1632
1645
|
if (childVNode.$name$) {
|
|
1633
1646
|
childVNode.$elm$.setAttribute("name", slotName);
|
|
@@ -1676,7 +1689,7 @@ var findCorrespondingNode = (node, type) => {
|
|
|
1676
1689
|
};
|
|
1677
1690
|
|
|
1678
1691
|
// src/runtime/initialize-component.ts
|
|
1679
|
-
import { BUILD as
|
|
1692
|
+
import { BUILD as BUILD24 } from "@stencil/core/internal/app-data";
|
|
1680
1693
|
|
|
1681
1694
|
// src/utils/shadow-css.ts
|
|
1682
1695
|
/**
|
|
@@ -2051,33 +2064,33 @@ var setMode = (handler) => modeResolutionChain.push(handler);
|
|
|
2051
2064
|
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
2052
2065
|
|
|
2053
2066
|
// src/runtime/proxy-component.ts
|
|
2054
|
-
import { BUILD as
|
|
2067
|
+
import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
|
|
2055
2068
|
|
|
2056
2069
|
// src/runtime/set-value.ts
|
|
2057
|
-
import { BUILD as
|
|
2070
|
+
import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
|
|
2058
2071
|
|
|
2059
2072
|
// src/runtime/parse-property-value.ts
|
|
2060
|
-
import { BUILD as
|
|
2073
|
+
import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
|
|
2061
2074
|
var parsePropertyValue = (propValue, propType) => {
|
|
2062
|
-
if ((
|
|
2075
|
+
if ((BUILD14.hydrateClientSide || BUILD14.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
2063
2076
|
try {
|
|
2064
2077
|
propValue = JSON.parse(propValue);
|
|
2065
2078
|
return propValue;
|
|
2066
2079
|
} catch (e) {
|
|
2067
2080
|
}
|
|
2068
2081
|
}
|
|
2069
|
-
if ((
|
|
2082
|
+
if ((BUILD14.hydrateClientSide || BUILD14.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
2070
2083
|
propValue = deserializeProperty(propValue);
|
|
2071
2084
|
return propValue;
|
|
2072
2085
|
}
|
|
2073
2086
|
if (propValue != null && !isComplexType(propValue)) {
|
|
2074
|
-
if (
|
|
2087
|
+
if (BUILD14.propBoolean && propType & 4 /* Boolean */) {
|
|
2075
2088
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
2076
2089
|
}
|
|
2077
|
-
if (
|
|
2090
|
+
if (BUILD14.propNumber && propType & 2 /* Number */) {
|
|
2078
2091
|
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
2079
2092
|
}
|
|
2080
|
-
if (
|
|
2093
|
+
if (BUILD14.propString && propType & 1 /* String */) {
|
|
2081
2094
|
return String(propValue);
|
|
2082
2095
|
}
|
|
2083
2096
|
return propValue;
|
|
@@ -2086,21 +2099,21 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
2086
2099
|
};
|
|
2087
2100
|
|
|
2088
2101
|
// src/runtime/update-component.ts
|
|
2089
|
-
import { BUILD as
|
|
2102
|
+
import { BUILD as BUILD21, NAMESPACE } from "@stencil/core/internal/app-data";
|
|
2090
2103
|
|
|
2091
2104
|
// src/runtime/event-emitter.ts
|
|
2092
|
-
import { BUILD as
|
|
2105
|
+
import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
|
|
2093
2106
|
|
|
2094
2107
|
// src/runtime/element.ts
|
|
2095
|
-
import { BUILD as
|
|
2096
|
-
var getElement = (ref) =>
|
|
2108
|
+
import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
|
|
2109
|
+
var getElement = (ref) => BUILD15.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
2097
2110
|
|
|
2098
2111
|
// src/runtime/event-emitter.ts
|
|
2099
2112
|
var createEvent = (ref, name, flags) => {
|
|
2100
2113
|
const elm = getElement(ref);
|
|
2101
2114
|
return {
|
|
2102
2115
|
emit: (detail) => {
|
|
2103
|
-
if (
|
|
2116
|
+
if (BUILD16.isDev && !elm.isConnected) {
|
|
2104
2117
|
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
2105
2118
|
}
|
|
2106
2119
|
return emitEvent(elm, name, {
|
|
@@ -2119,7 +2132,7 @@ var emitEvent = (elm, name, opts) => {
|
|
|
2119
2132
|
};
|
|
2120
2133
|
|
|
2121
2134
|
// src/runtime/styles.ts
|
|
2122
|
-
import { BUILD as
|
|
2135
|
+
import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
|
|
2123
2136
|
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
2124
2137
|
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
2125
2138
|
let style = styles.get(scopeId2);
|
|
@@ -2139,7 +2152,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2139
2152
|
var _a;
|
|
2140
2153
|
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
2141
2154
|
const style = styles.get(scopeId2);
|
|
2142
|
-
if (!
|
|
2155
|
+
if (!BUILD17.attachStyles || !win.document) {
|
|
2143
2156
|
return scopeId2;
|
|
2144
2157
|
}
|
|
2145
2158
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
@@ -2152,7 +2165,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2152
2165
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
2153
2166
|
}
|
|
2154
2167
|
if (!appliedStyles.has(scopeId2)) {
|
|
2155
|
-
if (
|
|
2168
|
+
if (BUILD17.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
2156
2169
|
styleElm.innerHTML = style;
|
|
2157
2170
|
} else {
|
|
2158
2171
|
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
|
@@ -2161,7 +2174,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2161
2174
|
if (nonce != null) {
|
|
2162
2175
|
styleElm.setAttribute("nonce", nonce);
|
|
2163
2176
|
}
|
|
2164
|
-
if ((
|
|
2177
|
+
if ((BUILD17.hydrateServerSide || BUILD17.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
|
|
2165
2178
|
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
2166
2179
|
}
|
|
2167
2180
|
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
@@ -2200,7 +2213,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2200
2213
|
appliedStyles.add(scopeId2);
|
|
2201
2214
|
}
|
|
2202
2215
|
}
|
|
2203
|
-
} else if (
|
|
2216
|
+
} else if (BUILD17.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
2204
2217
|
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
2205
2218
|
}
|
|
2206
2219
|
}
|
|
@@ -2212,17 +2225,17 @@ var attachStyles = (hostRef) => {
|
|
|
2212
2225
|
const flags = cmpMeta.$flags$;
|
|
2213
2226
|
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
2214
2227
|
const scopeId2 = addStyle(
|
|
2215
|
-
|
|
2228
|
+
BUILD17.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
2216
2229
|
cmpMeta,
|
|
2217
2230
|
hostRef.$modeName$
|
|
2218
2231
|
);
|
|
2219
|
-
if ((
|
|
2232
|
+
if ((BUILD17.shadowDom || BUILD17.scoped) && BUILD17.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
|
|
2220
2233
|
elm["s-sc"] = scopeId2;
|
|
2221
2234
|
elm.classList.add(scopeId2 + "-h");
|
|
2222
2235
|
}
|
|
2223
2236
|
endAttachStyles();
|
|
2224
2237
|
};
|
|
2225
|
-
var getScopeId = (cmp, mode) => "sc-" + (
|
|
2238
|
+
var getScopeId = (cmp, mode) => "sc-" + (BUILD17.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
2226
2239
|
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
2227
2240
|
var hydrateScopedToShadow = () => {
|
|
2228
2241
|
if (!win.document) {
|
|
@@ -2236,24 +2249,24 @@ var hydrateScopedToShadow = () => {
|
|
|
2236
2249
|
};
|
|
2237
2250
|
|
|
2238
2251
|
// src/runtime/vdom/vdom-render.ts
|
|
2239
|
-
import { BUILD as
|
|
2252
|
+
import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
|
|
2240
2253
|
|
|
2241
2254
|
// src/runtime/vdom/update-element.ts
|
|
2242
|
-
import { BUILD as
|
|
2255
|
+
import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
|
|
2243
2256
|
|
|
2244
2257
|
// src/runtime/vdom/set-accessor.ts
|
|
2245
|
-
import { BUILD as
|
|
2258
|
+
import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
|
|
2246
2259
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
2247
2260
|
if (oldValue === newValue) {
|
|
2248
2261
|
return;
|
|
2249
2262
|
}
|
|
2250
2263
|
let isProp = isMemberInElement(elm, memberName);
|
|
2251
2264
|
let ln = memberName.toLowerCase();
|
|
2252
|
-
if (
|
|
2265
|
+
if (BUILD18.vdomClass && memberName === "class") {
|
|
2253
2266
|
const classList = elm.classList;
|
|
2254
2267
|
const oldClasses = parseClassList(oldValue);
|
|
2255
2268
|
let newClasses = parseClassList(newValue);
|
|
2256
|
-
if (
|
|
2269
|
+
if (BUILD18.hydrateClientSide && elm["s-si"] && initialRender) {
|
|
2257
2270
|
newClasses.push(elm["s-si"]);
|
|
2258
2271
|
oldClasses.forEach((c) => {
|
|
2259
2272
|
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
@@ -2264,11 +2277,11 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2264
2277
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
2265
2278
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
2266
2279
|
}
|
|
2267
|
-
} else if (
|
|
2268
|
-
if (
|
|
2280
|
+
} else if (BUILD18.vdomStyle && memberName === "style") {
|
|
2281
|
+
if (BUILD18.updatable) {
|
|
2269
2282
|
for (const prop in oldValue) {
|
|
2270
2283
|
if (!newValue || newValue[prop] == null) {
|
|
2271
|
-
if (!
|
|
2284
|
+
if (!BUILD18.hydrateServerSide && prop.includes("-")) {
|
|
2272
2285
|
elm.style.removeProperty(prop);
|
|
2273
2286
|
} else {
|
|
2274
2287
|
elm.style[prop] = "";
|
|
@@ -2278,19 +2291,19 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2278
2291
|
}
|
|
2279
2292
|
for (const prop in newValue) {
|
|
2280
2293
|
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
2281
|
-
if (!
|
|
2294
|
+
if (!BUILD18.hydrateServerSide && prop.includes("-")) {
|
|
2282
2295
|
elm.style.setProperty(prop, newValue[prop]);
|
|
2283
2296
|
} else {
|
|
2284
2297
|
elm.style[prop] = newValue[prop];
|
|
2285
2298
|
}
|
|
2286
2299
|
}
|
|
2287
2300
|
}
|
|
2288
|
-
} else if (
|
|
2289
|
-
} else if (
|
|
2301
|
+
} else if (BUILD18.vdomKey && memberName === "key") {
|
|
2302
|
+
} else if (BUILD18.vdomRef && memberName === "ref") {
|
|
2290
2303
|
if (newValue) {
|
|
2291
2304
|
newValue(elm);
|
|
2292
2305
|
}
|
|
2293
|
-
} else if (
|
|
2306
|
+
} else if (BUILD18.vdomListener && (BUILD18.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
2294
2307
|
if (memberName[2] === "-") {
|
|
2295
2308
|
memberName = memberName.slice(3);
|
|
2296
2309
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -2308,7 +2321,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2308
2321
|
plt.ael(elm, memberName, newValue, capture);
|
|
2309
2322
|
}
|
|
2310
2323
|
}
|
|
2311
|
-
} else if (
|
|
2324
|
+
} else if (BUILD18.vdomPropOrAttr) {
|
|
2312
2325
|
const isComplex = isComplexType(newValue);
|
|
2313
2326
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
2314
2327
|
try {
|
|
@@ -2330,7 +2343,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2330
2343
|
}
|
|
2331
2344
|
}
|
|
2332
2345
|
let xlink = false;
|
|
2333
|
-
if (
|
|
2346
|
+
if (BUILD18.vdomXlink) {
|
|
2334
2347
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
2335
2348
|
memberName = ln;
|
|
2336
2349
|
xlink = true;
|
|
@@ -2338,7 +2351,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2338
2351
|
}
|
|
2339
2352
|
if (newValue == null || newValue === false) {
|
|
2340
2353
|
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
2341
|
-
if (
|
|
2354
|
+
if (BUILD18.vdomXlink && xlink) {
|
|
2342
2355
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
2343
2356
|
} else {
|
|
2344
2357
|
elm.removeAttribute(memberName);
|
|
@@ -2346,7 +2359,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2346
2359
|
}
|
|
2347
2360
|
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
|
2348
2361
|
newValue = newValue === true ? "" : newValue;
|
|
2349
|
-
if (
|
|
2362
|
+
if (BUILD18.vdomXlink && xlink) {
|
|
2350
2363
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
2351
2364
|
} else {
|
|
2352
2365
|
elm.setAttribute(memberName, newValue);
|
|
@@ -2372,7 +2385,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
2372
2385
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
2373
2386
|
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
2374
2387
|
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
2375
|
-
if (
|
|
2388
|
+
if (BUILD19.updatable) {
|
|
2376
2389
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
2377
2390
|
if (!(memberName in newVnodeAttrs)) {
|
|
2378
2391
|
setAccessor(
|
|
@@ -2424,7 +2437,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2424
2437
|
let elm;
|
|
2425
2438
|
let childNode;
|
|
2426
2439
|
let oldVNode;
|
|
2427
|
-
if (
|
|
2440
|
+
if (BUILD20.slotRelocation && !useNativeShadowDom) {
|
|
2428
2441
|
checkSlotRelocate = true;
|
|
2429
2442
|
if (newVNode2.$tag$ === "slot") {
|
|
2430
2443
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
@@ -2439,20 +2452,20 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2439
2452
|
);
|
|
2440
2453
|
}
|
|
2441
2454
|
}
|
|
2442
|
-
if (
|
|
2455
|
+
if (BUILD20.isDev && newVNode2.$elm$) {
|
|
2443
2456
|
consoleDevError(
|
|
2444
2457
|
`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`
|
|
2445
2458
|
);
|
|
2446
2459
|
}
|
|
2447
|
-
if (
|
|
2460
|
+
if (BUILD20.vdomText && newVNode2.$text$ !== null) {
|
|
2448
2461
|
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
2449
|
-
} else if (
|
|
2450
|
-
elm = newVNode2.$elm$ =
|
|
2451
|
-
if (
|
|
2462
|
+
} else if (BUILD20.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
2463
|
+
elm = newVNode2.$elm$ = BUILD20.isDebug || BUILD20.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : win.document.createTextNode("");
|
|
2464
|
+
if (BUILD20.vdomAttribute) {
|
|
2452
2465
|
updateElement(null, newVNode2, isSvgMode);
|
|
2453
2466
|
}
|
|
2454
2467
|
} else {
|
|
2455
|
-
if (
|
|
2468
|
+
if (BUILD20.svg && !isSvgMode) {
|
|
2456
2469
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
2457
2470
|
}
|
|
2458
2471
|
if (!win.document) {
|
|
@@ -2460,19 +2473,19 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2460
2473
|
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
|
2461
2474
|
);
|
|
2462
2475
|
}
|
|
2463
|
-
elm = newVNode2.$elm$ =
|
|
2476
|
+
elm = newVNode2.$elm$ = BUILD20.svg ? win.document.createElementNS(
|
|
2464
2477
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
2465
|
-
!useNativeShadowDom &&
|
|
2478
|
+
!useNativeShadowDom && BUILD20.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
2466
2479
|
) : win.document.createElement(
|
|
2467
|
-
!useNativeShadowDom &&
|
|
2480
|
+
!useNativeShadowDom && BUILD20.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
2468
2481
|
);
|
|
2469
|
-
if (
|
|
2482
|
+
if (BUILD20.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
2470
2483
|
isSvgMode = false;
|
|
2471
2484
|
}
|
|
2472
|
-
if (
|
|
2485
|
+
if (BUILD20.vdomAttribute) {
|
|
2473
2486
|
updateElement(null, newVNode2, isSvgMode);
|
|
2474
2487
|
}
|
|
2475
|
-
if ((
|
|
2488
|
+
if ((BUILD20.scoped || BUILD20.hydrateServerSide && 128 /* shadowNeedsScopedCss */) && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
2476
2489
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
2477
2490
|
}
|
|
2478
2491
|
if (newVNode2.$children$) {
|
|
@@ -2483,7 +2496,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2483
2496
|
}
|
|
2484
2497
|
}
|
|
2485
2498
|
}
|
|
2486
|
-
if (
|
|
2499
|
+
if (BUILD20.svg) {
|
|
2487
2500
|
if (newVNode2.$tag$ === "svg") {
|
|
2488
2501
|
isSvgMode = false;
|
|
2489
2502
|
} else if (elm.tagName === "foreignObject") {
|
|
@@ -2492,7 +2505,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2492
2505
|
}
|
|
2493
2506
|
}
|
|
2494
2507
|
elm["s-hn"] = hostTagName;
|
|
2495
|
-
if (
|
|
2508
|
+
if (BUILD20.slotRelocation) {
|
|
2496
2509
|
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
2497
2510
|
elm["s-sr"] = true;
|
|
2498
2511
|
elm["s-cr"] = contentRef;
|
|
@@ -2501,13 +2514,13 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2501
2514
|
patchSlotNode(elm);
|
|
2502
2515
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
2503
2516
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
2504
|
-
if (
|
|
2517
|
+
if (BUILD20.experimentalSlotFixes) {
|
|
2505
2518
|
relocateToHostRoot(oldParentVNode.$elm$);
|
|
2506
2519
|
} else {
|
|
2507
2520
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
2508
2521
|
}
|
|
2509
2522
|
}
|
|
2510
|
-
if (
|
|
2523
|
+
if (BUILD20.scoped || BUILD20.hydrateServerSide && 128 /* shadowNeedsScopedCss */) {
|
|
2511
2524
|
addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
|
|
2512
2525
|
}
|
|
2513
2526
|
}
|
|
@@ -2537,7 +2550,7 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
2537
2550
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
2538
2551
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
2539
2552
|
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
2540
|
-
if (parentElm["s-sr"] &&
|
|
2553
|
+
if (parentElm["s-sr"] && BUILD20.experimentalSlotFixes) {
|
|
2541
2554
|
let node = parentElm;
|
|
2542
2555
|
while (node = node.nextSibling) {
|
|
2543
2556
|
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
@@ -2561,9 +2574,9 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
2561
2574
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
2562
2575
|
};
|
|
2563
2576
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
2564
|
-
let containerElm =
|
|
2577
|
+
let containerElm = BUILD20.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
2565
2578
|
let childNode;
|
|
2566
|
-
if (
|
|
2579
|
+
if (BUILD20.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
2567
2580
|
containerElm = containerElm.shadowRoot;
|
|
2568
2581
|
}
|
|
2569
2582
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
@@ -2571,7 +2584,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
2571
2584
|
childNode = createElm(null, parentVNode, startIdx);
|
|
2572
2585
|
if (childNode) {
|
|
2573
2586
|
vnodes[startIdx].$elm$ = childNode;
|
|
2574
|
-
insertBefore(containerElm, childNode,
|
|
2587
|
+
insertBefore(containerElm, childNode, BUILD20.slotRelocation ? referenceNode(before) : before);
|
|
2575
2588
|
}
|
|
2576
2589
|
}
|
|
2577
2590
|
}
|
|
@@ -2583,7 +2596,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
2583
2596
|
const elm = vnode.$elm$;
|
|
2584
2597
|
nullifyVNodeRefs(vnode);
|
|
2585
2598
|
if (elm) {
|
|
2586
|
-
if (
|
|
2599
|
+
if (BUILD20.slotRelocation) {
|
|
2587
2600
|
checkSlotFallbackVisibility = true;
|
|
2588
2601
|
if (elm["s-ol"]) {
|
|
2589
2602
|
elm["s-ol"].remove();
|
|
@@ -2627,7 +2640,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2627
2640
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
2628
2641
|
newEndVnode = newCh[--newEndIdx];
|
|
2629
2642
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
2630
|
-
if (
|
|
2643
|
+
if (BUILD20.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
2631
2644
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
2632
2645
|
}
|
|
2633
2646
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -2635,7 +2648,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2635
2648
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
2636
2649
|
newEndVnode = newCh[--newEndIdx];
|
|
2637
2650
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
2638
|
-
if (
|
|
2651
|
+
if (BUILD20.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
2639
2652
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
2640
2653
|
}
|
|
2641
2654
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -2644,7 +2657,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2644
2657
|
newStartVnode = newCh[++newStartIdx];
|
|
2645
2658
|
} else {
|
|
2646
2659
|
idxInOld = -1;
|
|
2647
|
-
if (
|
|
2660
|
+
if (BUILD20.vdomKey) {
|
|
2648
2661
|
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
2649
2662
|
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
2650
2663
|
idxInOld = i2;
|
|
@@ -2652,7 +2665,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2652
2665
|
}
|
|
2653
2666
|
}
|
|
2654
2667
|
}
|
|
2655
|
-
if (
|
|
2668
|
+
if (BUILD20.vdomKey && idxInOld >= 0) {
|
|
2656
2669
|
elmToMove = oldCh[idxInOld];
|
|
2657
2670
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
2658
2671
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
@@ -2667,7 +2680,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2667
2680
|
newStartVnode = newCh[++newStartIdx];
|
|
2668
2681
|
}
|
|
2669
2682
|
if (node) {
|
|
2670
|
-
if (
|
|
2683
|
+
if (BUILD20.slotRelocation) {
|
|
2671
2684
|
insertBefore(
|
|
2672
2685
|
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
2673
2686
|
node,
|
|
@@ -2688,16 +2701,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2688
2701
|
newStartIdx,
|
|
2689
2702
|
newEndIdx
|
|
2690
2703
|
);
|
|
2691
|
-
} else if (
|
|
2704
|
+
} else if (BUILD20.updatable && newStartIdx > newEndIdx) {
|
|
2692
2705
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
2693
2706
|
}
|
|
2694
2707
|
};
|
|
2695
2708
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
2696
2709
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
2697
|
-
if (
|
|
2710
|
+
if (BUILD20.slotRelocation && leftVNode.$tag$ === "slot") {
|
|
2698
2711
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
2699
2712
|
}
|
|
2700
|
-
if (
|
|
2713
|
+
if (BUILD20.vdomKey && !isInitialRender) {
|
|
2701
2714
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
2702
2715
|
}
|
|
2703
2716
|
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
@@ -2715,38 +2728,38 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
2715
2728
|
const tag = newVNode2.$tag$;
|
|
2716
2729
|
const text = newVNode2.$text$;
|
|
2717
2730
|
let defaultHolder;
|
|
2718
|
-
if (!
|
|
2719
|
-
if (
|
|
2731
|
+
if (!BUILD20.vdomText || text === null) {
|
|
2732
|
+
if (BUILD20.svg) {
|
|
2720
2733
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
2721
2734
|
}
|
|
2722
|
-
if (
|
|
2723
|
-
if (
|
|
2724
|
-
if (
|
|
2735
|
+
if (BUILD20.vdomAttribute || BUILD20.reflect) {
|
|
2736
|
+
if (BUILD20.slot && tag === "slot" && !useNativeShadowDom) {
|
|
2737
|
+
if (BUILD20.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
|
|
2725
2738
|
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
2726
2739
|
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
2727
2740
|
}
|
|
2728
2741
|
}
|
|
2729
2742
|
updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
|
|
2730
2743
|
}
|
|
2731
|
-
if (
|
|
2744
|
+
if (BUILD20.updatable && oldChildren !== null && newChildren !== null) {
|
|
2732
2745
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
2733
2746
|
} else if (newChildren !== null) {
|
|
2734
|
-
if (
|
|
2747
|
+
if (BUILD20.updatable && BUILD20.vdomText && oldVNode.$text$ !== null) {
|
|
2735
2748
|
elm.textContent = "";
|
|
2736
2749
|
}
|
|
2737
2750
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
2738
2751
|
} else if (
|
|
2739
2752
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
2740
|
-
!isInitialRender &&
|
|
2753
|
+
!isInitialRender && BUILD20.updatable && oldChildren !== null
|
|
2741
2754
|
) {
|
|
2742
2755
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
2743
2756
|
}
|
|
2744
|
-
if (
|
|
2757
|
+
if (BUILD20.svg && isSvgMode && tag === "svg") {
|
|
2745
2758
|
isSvgMode = false;
|
|
2746
2759
|
}
|
|
2747
|
-
} else if (
|
|
2760
|
+
} else if (BUILD20.vdomText && BUILD20.slotRelocation && (defaultHolder = elm["s-cr"])) {
|
|
2748
2761
|
defaultHolder.parentNode.textContent = text;
|
|
2749
|
-
} else if (
|
|
2762
|
+
} else if (BUILD20.vdomText && oldVNode.$text$ !== text) {
|
|
2750
2763
|
elm.data = text;
|
|
2751
2764
|
}
|
|
2752
2765
|
};
|
|
@@ -2762,7 +2775,7 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
2762
2775
|
const slotName = childNode["s-sn"];
|
|
2763
2776
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
2764
2777
|
node = hostContentNodes[j];
|
|
2765
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!
|
|
2778
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD20.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
2766
2779
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
2767
2780
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
2768
2781
|
checkSlotFallbackVisibility = true;
|
|
@@ -2801,15 +2814,15 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
2801
2814
|
}
|
|
2802
2815
|
};
|
|
2803
2816
|
var nullifyVNodeRefs = (vNode) => {
|
|
2804
|
-
if (
|
|
2817
|
+
if (BUILD20.vdomRef) {
|
|
2805
2818
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
2806
2819
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
2807
2820
|
}
|
|
2808
2821
|
};
|
|
2809
2822
|
var insertBefore = (parent, newNode, reference) => {
|
|
2810
|
-
if (
|
|
2823
|
+
if (BUILD20.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
2811
2824
|
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
2812
|
-
} else if (
|
|
2825
|
+
} else if (BUILD20.experimentalSlotFixes && typeof newNode["s-sn"] === "string") {
|
|
2813
2826
|
if (parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
|
|
2814
2827
|
patchParentNode(newNode);
|
|
2815
2828
|
}
|
|
@@ -2818,7 +2831,7 @@ var insertBefore = (parent, newNode, reference) => {
|
|
|
2818
2831
|
if (slotNode) dispatchSlotChangeEvent(slotNode);
|
|
2819
2832
|
return newNode;
|
|
2820
2833
|
}
|
|
2821
|
-
if (
|
|
2834
|
+
if (BUILD20.experimentalSlotFixes && parent.__insertBefore) {
|
|
2822
2835
|
return parent.__insertBefore(newNode, reference);
|
|
2823
2836
|
} else {
|
|
2824
2837
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
@@ -2853,7 +2866,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
2853
2866
|
const isHostElement = isHost(renderFnResults);
|
|
2854
2867
|
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
2855
2868
|
hostTagName = hostElm.tagName;
|
|
2856
|
-
if (
|
|
2869
|
+
if (BUILD20.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
2857
2870
|
throw new Error(`The <Host> must be the single root component.
|
|
2858
2871
|
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
2859
2872
|
|
|
@@ -2867,7 +2880,7 @@ render() {
|
|
|
2867
2880
|
}
|
|
2868
2881
|
`);
|
|
2869
2882
|
}
|
|
2870
|
-
if (
|
|
2883
|
+
if (BUILD20.reflect && cmpMeta.$attrsToReflect$) {
|
|
2871
2884
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
2872
2885
|
cmpMeta.$attrsToReflect$.map(
|
|
2873
2886
|
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
@@ -2883,24 +2896,24 @@ render() {
|
|
|
2883
2896
|
rootVnode.$tag$ = null;
|
|
2884
2897
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
2885
2898
|
hostRef.$vnode$ = rootVnode;
|
|
2886
|
-
rootVnode.$elm$ = oldVNode.$elm$ =
|
|
2887
|
-
if (
|
|
2899
|
+
rootVnode.$elm$ = oldVNode.$elm$ = BUILD20.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
|
|
2900
|
+
if (BUILD20.scoped || BUILD20.shadowDom) {
|
|
2888
2901
|
scopeId = hostElm["s-sc"];
|
|
2889
2902
|
}
|
|
2890
2903
|
useNativeShadowDom = supportsShadow && !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
|
|
2891
|
-
if (
|
|
2904
|
+
if (BUILD20.slotRelocation) {
|
|
2892
2905
|
contentRef = hostElm["s-cr"];
|
|
2893
2906
|
checkSlotFallbackVisibility = false;
|
|
2894
2907
|
}
|
|
2895
2908
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
2896
|
-
if (
|
|
2909
|
+
if (BUILD20.slotRelocation) {
|
|
2897
2910
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
2898
2911
|
if (checkSlotRelocate) {
|
|
2899
2912
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
2900
2913
|
for (const relocateData of relocateNodes) {
|
|
2901
2914
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
2902
2915
|
if (!nodeToRelocate["s-ol"] && win.document) {
|
|
2903
|
-
const orgLocationNode =
|
|
2916
|
+
const orgLocationNode = BUILD20.isDebug || BUILD20.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : win.document.createTextNode("");
|
|
2904
2917
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
2905
2918
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
2906
2919
|
}
|
|
@@ -2911,7 +2924,7 @@ render() {
|
|
|
2911
2924
|
if (slotRefNode) {
|
|
2912
2925
|
const parentNodeRef = slotRefNode.parentNode;
|
|
2913
2926
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
2914
|
-
if (!
|
|
2927
|
+
if (!BUILD20.hydrateServerSide && (!BUILD20.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
2915
2928
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
2916
2929
|
while (orgLocationNode) {
|
|
2917
2930
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
@@ -2932,7 +2945,7 @@ render() {
|
|
|
2932
2945
|
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
2933
2946
|
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
2934
2947
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
2935
|
-
if (!
|
|
2948
|
+
if (!BUILD20.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
2936
2949
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
2937
2950
|
}
|
|
2938
2951
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
@@ -2958,7 +2971,7 @@ render() {
|
|
|
2958
2971
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
2959
2972
|
relocateNodes.length = 0;
|
|
2960
2973
|
}
|
|
2961
|
-
if (
|
|
2974
|
+
if (BUILD20.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2962
2975
|
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
2963
2976
|
for (const childNode of children) {
|
|
2964
2977
|
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
@@ -2986,7 +2999,7 @@ var originalLocationDebugNode = (nodeToRelocate) => {
|
|
|
2986
2999
|
|
|
2987
3000
|
// src/runtime/update-component.ts
|
|
2988
3001
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
2989
|
-
if (
|
|
3002
|
+
if (BUILD21.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
2990
3003
|
const index = ancestorComponent["s-p"].push(
|
|
2991
3004
|
new Promise(
|
|
2992
3005
|
(r) => hostRef.$onRenderResolve$ = () => {
|
|
@@ -2998,21 +3011,21 @@ var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
2998
3011
|
}
|
|
2999
3012
|
};
|
|
3000
3013
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
3001
|
-
if (
|
|
3014
|
+
if (BUILD21.taskQueue && BUILD21.updatable) {
|
|
3002
3015
|
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
3003
3016
|
}
|
|
3004
|
-
if (
|
|
3017
|
+
if (BUILD21.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
3005
3018
|
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
3006
3019
|
return;
|
|
3007
3020
|
}
|
|
3008
3021
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
3009
3022
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
3010
|
-
return
|
|
3023
|
+
return BUILD21.taskQueue ? writeTask(dispatch) : dispatch();
|
|
3011
3024
|
};
|
|
3012
3025
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
3013
3026
|
const elm = hostRef.$hostElement$;
|
|
3014
3027
|
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
3015
|
-
const instance =
|
|
3028
|
+
const instance = BUILD21.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
3016
3029
|
if (!instance) {
|
|
3017
3030
|
throw new Error(
|
|
3018
3031
|
`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`
|
|
@@ -3020,7 +3033,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
3020
3033
|
}
|
|
3021
3034
|
let maybePromise;
|
|
3022
3035
|
if (isInitialLoad) {
|
|
3023
|
-
if (
|
|
3036
|
+
if (BUILD21.lazyLoad && BUILD21.hostListener) {
|
|
3024
3037
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
3025
3038
|
if (hostRef.$queuedListeners$) {
|
|
3026
3039
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
@@ -3048,23 +3061,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
3048
3061
|
const elm = hostRef.$hostElement$;
|
|
3049
3062
|
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
3050
3063
|
const rc = elm["s-rc"];
|
|
3051
|
-
if (
|
|
3064
|
+
if (BUILD21.style && isInitialLoad) {
|
|
3052
3065
|
attachStyles(hostRef);
|
|
3053
3066
|
}
|
|
3054
3067
|
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
3055
|
-
if (
|
|
3068
|
+
if (BUILD21.isDev) {
|
|
3056
3069
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
3057
3070
|
}
|
|
3058
|
-
if (
|
|
3071
|
+
if (BUILD21.hydrateServerSide) {
|
|
3059
3072
|
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
3060
3073
|
} else {
|
|
3061
3074
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
3062
3075
|
}
|
|
3063
|
-
if (
|
|
3076
|
+
if (BUILD21.isDev) {
|
|
3064
3077
|
hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
|
|
3065
3078
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
3066
3079
|
}
|
|
3067
|
-
if (
|
|
3080
|
+
if (BUILD21.hydrateServerSide) {
|
|
3068
3081
|
try {
|
|
3069
3082
|
serverSideConnected(elm);
|
|
3070
3083
|
if (isInitialLoad) {
|
|
@@ -3078,13 +3091,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
3078
3091
|
consoleError(e, elm);
|
|
3079
3092
|
}
|
|
3080
3093
|
}
|
|
3081
|
-
if (
|
|
3094
|
+
if (BUILD21.asyncLoading && rc) {
|
|
3082
3095
|
rc.map((cb) => cb());
|
|
3083
3096
|
elm["s-rc"] = void 0;
|
|
3084
3097
|
}
|
|
3085
3098
|
endRender();
|
|
3086
3099
|
endUpdate();
|
|
3087
|
-
if (
|
|
3100
|
+
if (BUILD21.asyncLoading) {
|
|
3088
3101
|
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
3089
3102
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
3090
3103
|
if (childrenPromises.length === 0) {
|
|
@@ -3100,10 +3113,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
3100
3113
|
};
|
|
3101
3114
|
var renderingRef = null;
|
|
3102
3115
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
3103
|
-
const allRenderFn =
|
|
3104
|
-
const lazyLoad =
|
|
3105
|
-
const taskQueue =
|
|
3106
|
-
const updatable =
|
|
3116
|
+
const allRenderFn = BUILD21.allRenderFn ? true : false;
|
|
3117
|
+
const lazyLoad = BUILD21.lazyLoad ? true : false;
|
|
3118
|
+
const taskQueue = BUILD21.taskQueue ? true : false;
|
|
3119
|
+
const updatable = BUILD21.updatable ? true : false;
|
|
3107
3120
|
try {
|
|
3108
3121
|
renderingRef = instance;
|
|
3109
3122
|
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
@@ -3113,9 +3126,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
3113
3126
|
if (updatable || lazyLoad) {
|
|
3114
3127
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
3115
3128
|
}
|
|
3116
|
-
if (
|
|
3117
|
-
if (
|
|
3118
|
-
if (
|
|
3129
|
+
if (BUILD21.hasRenderFn || BUILD21.reflect) {
|
|
3130
|
+
if (BUILD21.vdomRender || BUILD21.reflect) {
|
|
3131
|
+
if (BUILD21.hydrateServerSide) {
|
|
3119
3132
|
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
3120
3133
|
} else {
|
|
3121
3134
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
@@ -3140,51 +3153,51 @@ var postUpdateComponent = (hostRef) => {
|
|
|
3140
3153
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
3141
3154
|
const elm = hostRef.$hostElement$;
|
|
3142
3155
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
3143
|
-
const instance =
|
|
3156
|
+
const instance = BUILD21.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
3144
3157
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
3145
|
-
if (
|
|
3158
|
+
if (BUILD21.isDev) {
|
|
3146
3159
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
3147
3160
|
}
|
|
3148
3161
|
safeCall(instance, "componentDidRender", void 0, elm);
|
|
3149
|
-
if (
|
|
3162
|
+
if (BUILD21.isDev) {
|
|
3150
3163
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
3151
3164
|
}
|
|
3152
3165
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
3153
3166
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
3154
3167
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
3155
|
-
if (
|
|
3168
|
+
if (BUILD21.asyncLoading && BUILD21.cssAnnotations) {
|
|
3156
3169
|
addHydratedFlag(elm);
|
|
3157
3170
|
}
|
|
3158
|
-
if (
|
|
3171
|
+
if (BUILD21.isDev) {
|
|
3159
3172
|
hostRef.$flags$ |= 2048 /* devOnDidLoad */;
|
|
3160
3173
|
}
|
|
3161
3174
|
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
3162
|
-
if (
|
|
3175
|
+
if (BUILD21.isDev) {
|
|
3163
3176
|
hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
|
|
3164
3177
|
}
|
|
3165
3178
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
3166
3179
|
endPostUpdate();
|
|
3167
|
-
if (
|
|
3180
|
+
if (BUILD21.asyncLoading) {
|
|
3168
3181
|
hostRef.$onReadyResolve$(elm);
|
|
3169
3182
|
if (!ancestorComponent) {
|
|
3170
3183
|
appDidLoad(tagName);
|
|
3171
3184
|
}
|
|
3172
3185
|
}
|
|
3173
3186
|
} else {
|
|
3174
|
-
if (
|
|
3187
|
+
if (BUILD21.isDev) {
|
|
3175
3188
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
3176
3189
|
}
|
|
3177
3190
|
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
3178
|
-
if (
|
|
3191
|
+
if (BUILD21.isDev) {
|
|
3179
3192
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
3180
3193
|
}
|
|
3181
3194
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
3182
3195
|
endPostUpdate();
|
|
3183
3196
|
}
|
|
3184
|
-
if (
|
|
3197
|
+
if (BUILD21.method && BUILD21.lazyLoad) {
|
|
3185
3198
|
hostRef.$onInstanceResolve$(elm);
|
|
3186
3199
|
}
|
|
3187
|
-
if (
|
|
3200
|
+
if (BUILD21.asyncLoading) {
|
|
3188
3201
|
if (hostRef.$onRenderResolve$) {
|
|
3189
3202
|
hostRef.$onRenderResolve$();
|
|
3190
3203
|
hostRef.$onRenderResolve$ = void 0;
|
|
@@ -3196,7 +3209,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
3196
3209
|
}
|
|
3197
3210
|
};
|
|
3198
3211
|
var forceUpdate = (ref) => {
|
|
3199
|
-
if (
|
|
3212
|
+
if (BUILD21.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
3200
3213
|
const hostRef = getHostRef(ref);
|
|
3201
3214
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
3202
3215
|
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
@@ -3207,11 +3220,11 @@ var forceUpdate = (ref) => {
|
|
|
3207
3220
|
return false;
|
|
3208
3221
|
};
|
|
3209
3222
|
var appDidLoad = (who) => {
|
|
3210
|
-
if (
|
|
3223
|
+
if (BUILD21.asyncQueue) {
|
|
3211
3224
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
3212
3225
|
}
|
|
3213
3226
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
3214
|
-
if (
|
|
3227
|
+
if (BUILD21.profile && performance.measure) {
|
|
3215
3228
|
performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
3216
3229
|
}
|
|
3217
3230
|
};
|
|
@@ -3226,7 +3239,7 @@ var safeCall = (instance, method, arg, elm) => {
|
|
|
3226
3239
|
return void 0;
|
|
3227
3240
|
};
|
|
3228
3241
|
var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
3229
|
-
if (
|
|
3242
|
+
if (BUILD21.lifecycleDOMEvents) {
|
|
3230
3243
|
emitEvent(elm, "stencil_" + lifecycleName, {
|
|
3231
3244
|
bubbles: true,
|
|
3232
3245
|
composed: true,
|
|
@@ -3238,7 +3251,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
|
3238
3251
|
};
|
|
3239
3252
|
var addHydratedFlag = (elm) => {
|
|
3240
3253
|
var _a, _b;
|
|
3241
|
-
return
|
|
3254
|
+
return BUILD21.hydratedClass ? elm.classList.add((_a = BUILD21.hydratedSelectorName) != null ? _a : "hydrated") : BUILD21.hydratedAttribute ? elm.setAttribute((_b = BUILD21.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
|
|
3242
3255
|
};
|
|
3243
3256
|
var serverSideConnected = (elm) => {
|
|
3244
3257
|
const children = elm.children;
|
|
@@ -3257,21 +3270,21 @@ var serverSideConnected = (elm) => {
|
|
|
3257
3270
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
3258
3271
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
3259
3272
|
const hostRef = getHostRef(ref);
|
|
3260
|
-
if (
|
|
3273
|
+
if (BUILD22.lazyLoad && !hostRef) {
|
|
3261
3274
|
throw new Error(
|
|
3262
3275
|
`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/stenciljs/core/issues/5457).`
|
|
3263
3276
|
);
|
|
3264
3277
|
}
|
|
3265
|
-
const elm =
|
|
3278
|
+
const elm = BUILD22.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
3266
3279
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
3267
3280
|
const flags = hostRef.$flags$;
|
|
3268
|
-
const instance =
|
|
3281
|
+
const instance = BUILD22.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
3269
3282
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
3270
3283
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
3271
3284
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
3272
|
-
if ((!
|
|
3285
|
+
if ((!BUILD22.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
3273
3286
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
3274
|
-
if (
|
|
3287
|
+
if (BUILD22.isDev) {
|
|
3275
3288
|
if (hostRef.$flags$ & 1024 /* devOnRender */) {
|
|
3276
3289
|
consoleDevWarn(
|
|
3277
3290
|
`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
|
|
@@ -3294,8 +3307,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
3294
3307
|
);
|
|
3295
3308
|
}
|
|
3296
3309
|
}
|
|
3297
|
-
if (!
|
|
3298
|
-
if (
|
|
3310
|
+
if (!BUILD22.lazyLoad || instance) {
|
|
3311
|
+
if (BUILD22.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
3299
3312
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
3300
3313
|
if (watchMethods) {
|
|
3301
3314
|
watchMethods.map((watchMethodName) => {
|
|
@@ -3307,7 +3320,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
3307
3320
|
});
|
|
3308
3321
|
}
|
|
3309
3322
|
}
|
|
3310
|
-
if (
|
|
3323
|
+
if (BUILD22.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
3311
3324
|
if (instance.componentShouldUpdate) {
|
|
3312
3325
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
3313
3326
|
return;
|
|
@@ -3323,46 +3336,46 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
3323
3336
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
3324
3337
|
var _a, _b;
|
|
3325
3338
|
const prototype = Cstr.prototype;
|
|
3326
|
-
if (
|
|
3339
|
+
if (BUILD23.isTesting) {
|
|
3327
3340
|
if (prototype.__stencilAugmented) {
|
|
3328
3341
|
return;
|
|
3329
3342
|
}
|
|
3330
3343
|
prototype.__stencilAugmented = true;
|
|
3331
3344
|
}
|
|
3332
|
-
if (
|
|
3345
|
+
if (BUILD23.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
3333
3346
|
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
3334
3347
|
const originalFormAssociatedCallback = prototype[cbName];
|
|
3335
3348
|
Object.defineProperty(prototype, cbName, {
|
|
3336
3349
|
value(...args) {
|
|
3337
3350
|
const hostRef = getHostRef(this);
|
|
3338
|
-
const instance =
|
|
3351
|
+
const instance = BUILD23.lazyLoad ? hostRef.$lazyInstance$ : this;
|
|
3339
3352
|
if (!instance) {
|
|
3340
3353
|
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
3341
3354
|
const cb = asyncInstance[cbName];
|
|
3342
3355
|
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
3343
3356
|
});
|
|
3344
3357
|
} else {
|
|
3345
|
-
const cb =
|
|
3358
|
+
const cb = BUILD23.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
|
|
3346
3359
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
3347
3360
|
}
|
|
3348
3361
|
}
|
|
3349
3362
|
});
|
|
3350
3363
|
});
|
|
3351
3364
|
}
|
|
3352
|
-
if (
|
|
3353
|
-
if (
|
|
3365
|
+
if (BUILD23.member && cmpMeta.$members$ || BUILD23.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
3366
|
+
if (BUILD23.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
|
|
3354
3367
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
3355
3368
|
}
|
|
3356
3369
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
3357
3370
|
members.map(([memberName, [memberFlags]]) => {
|
|
3358
|
-
if ((
|
|
3371
|
+
if ((BUILD23.prop || BUILD23.state) && (memberFlags & 31 /* Prop */ || (!BUILD23.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
3359
3372
|
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
3360
3373
|
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
3361
3374
|
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
3362
3375
|
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
3363
3376
|
Object.defineProperty(prototype, memberName, {
|
|
3364
3377
|
get() {
|
|
3365
|
-
if (
|
|
3378
|
+
if (BUILD23.lazyLoad) {
|
|
3366
3379
|
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
3367
3380
|
return getValue(this, memberName);
|
|
3368
3381
|
}
|
|
@@ -3371,7 +3384,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
3371
3384
|
if (!instance) return;
|
|
3372
3385
|
return instance[memberName];
|
|
3373
3386
|
}
|
|
3374
|
-
if (!
|
|
3387
|
+
if (!BUILD23.lazyLoad) {
|
|
3375
3388
|
return origGetter ? origGetter.apply(this) : getValue(this, memberName);
|
|
3376
3389
|
}
|
|
3377
3390
|
},
|
|
@@ -3382,7 +3395,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
3382
3395
|
Object.defineProperty(prototype, memberName, {
|
|
3383
3396
|
set(newValue) {
|
|
3384
3397
|
const ref = getHostRef(this);
|
|
3385
|
-
if (
|
|
3398
|
+
if (BUILD23.isDev) {
|
|
3386
3399
|
if (
|
|
3387
3400
|
// we are proxying the instance (not element)
|
|
3388
3401
|
(flags & 1 /* isElementConstructor */) === 0 && // if the class has a setter, then the Element can update instance values, so ignore
|
|
@@ -3409,11 +3422,11 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3409
3422
|
setValue(this, memberName, newValue, cmpMeta);
|
|
3410
3423
|
return;
|
|
3411
3424
|
}
|
|
3412
|
-
if (!
|
|
3425
|
+
if (!BUILD23.lazyLoad) {
|
|
3413
3426
|
setValue(this, memberName, newValue, cmpMeta);
|
|
3414
3427
|
return;
|
|
3415
3428
|
}
|
|
3416
|
-
if (
|
|
3429
|
+
if (BUILD23.lazyLoad) {
|
|
3417
3430
|
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
3418
3431
|
setValue(this, memberName, newValue, cmpMeta);
|
|
3419
3432
|
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
@@ -3441,7 +3454,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3441
3454
|
}
|
|
3442
3455
|
}
|
|
3443
3456
|
});
|
|
3444
|
-
} else if (
|
|
3457
|
+
} else if (BUILD23.lazyLoad && BUILD23.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
3445
3458
|
Object.defineProperty(prototype, memberName, {
|
|
3446
3459
|
value(...args) {
|
|
3447
3460
|
var _a2;
|
|
@@ -3454,13 +3467,13 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3454
3467
|
});
|
|
3455
3468
|
}
|
|
3456
3469
|
});
|
|
3457
|
-
if (
|
|
3470
|
+
if (BUILD23.observeAttribute && (!BUILD23.lazyLoad || flags & 1 /* isElementConstructor */)) {
|
|
3458
3471
|
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
3459
3472
|
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
3460
3473
|
plt.jmp(() => {
|
|
3461
3474
|
var _a2;
|
|
3462
3475
|
const propName = attrNameToPropName.get(attrName);
|
|
3463
|
-
if (this.hasOwnProperty(propName) &&
|
|
3476
|
+
if (this.hasOwnProperty(propName) && BUILD23.lazyLoad) {
|
|
3464
3477
|
newValue = this[propName];
|
|
3465
3478
|
delete this[propName];
|
|
3466
3479
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -3470,8 +3483,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3470
3483
|
const hostRef = getHostRef(this);
|
|
3471
3484
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
3472
3485
|
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
3473
|
-
const elm =
|
|
3474
|
-
const instance =
|
|
3486
|
+
const elm = BUILD23.lazyLoad ? hostRef.$hostElement$ : this;
|
|
3487
|
+
const instance = BUILD23.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
3475
3488
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
3476
3489
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
3477
3490
|
if (instance[callbackName] != null) {
|
|
@@ -3495,7 +3508,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3495
3508
|
var _a2;
|
|
3496
3509
|
const attrName = m[1] || propName;
|
|
3497
3510
|
attrNameToPropName.set(attrName, propName);
|
|
3498
|
-
if (
|
|
3511
|
+
if (BUILD23.reflect && m[0] & 512 /* ReflectAttr */) {
|
|
3499
3512
|
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
3500
3513
|
}
|
|
3501
3514
|
return attrName;
|
|
@@ -3513,7 +3526,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
3513
3526
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
3514
3527
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
3515
3528
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
3516
|
-
if (
|
|
3529
|
+
if (BUILD24.lazyLoad && bundleId) {
|
|
3517
3530
|
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
3518
3531
|
if (CstrImport && "then" in CstrImport) {
|
|
3519
3532
|
const endLoad = uniqueTime(
|
|
@@ -3528,15 +3541,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
3528
3541
|
if (!Cstr) {
|
|
3529
3542
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
3530
3543
|
}
|
|
3531
|
-
if (
|
|
3532
|
-
if (
|
|
3544
|
+
if (BUILD24.member && !Cstr.isProxied) {
|
|
3545
|
+
if (BUILD24.watchCallback) {
|
|
3533
3546
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
3534
3547
|
}
|
|
3535
3548
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
3536
3549
|
Cstr.isProxied = true;
|
|
3537
3550
|
}
|
|
3538
3551
|
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
3539
|
-
if (
|
|
3552
|
+
if (BUILD24.member) {
|
|
3540
3553
|
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
3541
3554
|
}
|
|
3542
3555
|
try {
|
|
@@ -3544,10 +3557,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
3544
3557
|
} catch (e) {
|
|
3545
3558
|
consoleError(e, elm);
|
|
3546
3559
|
}
|
|
3547
|
-
if (
|
|
3560
|
+
if (BUILD24.member) {
|
|
3548
3561
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
3549
3562
|
}
|
|
3550
|
-
if (
|
|
3563
|
+
if (BUILD24.watchCallback) {
|
|
3551
3564
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
3552
3565
|
}
|
|
3553
3566
|
endNewInstance();
|
|
@@ -3557,23 +3570,23 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
3557
3570
|
const cmpTag = elm.localName;
|
|
3558
3571
|
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
3559
3572
|
}
|
|
3560
|
-
if (
|
|
3573
|
+
if (BUILD24.style && Cstr && Cstr.style) {
|
|
3561
3574
|
let style;
|
|
3562
3575
|
if (typeof Cstr.style === "string") {
|
|
3563
3576
|
style = Cstr.style;
|
|
3564
|
-
} else if (
|
|
3577
|
+
} else if (BUILD24.mode && typeof Cstr.style !== "string") {
|
|
3565
3578
|
hostRef.$modeName$ = computeMode(elm);
|
|
3566
3579
|
if (hostRef.$modeName$) {
|
|
3567
3580
|
style = Cstr.style[hostRef.$modeName$];
|
|
3568
3581
|
}
|
|
3569
|
-
if (
|
|
3582
|
+
if (BUILD24.hydrateServerSide && hostRef.$modeName$) {
|
|
3570
3583
|
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
3571
3584
|
}
|
|
3572
3585
|
}
|
|
3573
3586
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
3574
3587
|
if (!styles.has(scopeId2)) {
|
|
3575
3588
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
3576
|
-
if (
|
|
3589
|
+
if (BUILD24.hydrateServerSide && BUILD24.shadowDom && cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
|
|
3577
3590
|
style = scopeCss(style, scopeId2, true);
|
|
3578
3591
|
}
|
|
3579
3592
|
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
@@ -3583,14 +3596,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
3583
3596
|
}
|
|
3584
3597
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
3585
3598
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
3586
|
-
if (
|
|
3599
|
+
if (BUILD24.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
3587
3600
|
ancestorComponent["s-rc"].push(schedule);
|
|
3588
3601
|
} else {
|
|
3589
3602
|
schedule();
|
|
3590
3603
|
}
|
|
3591
3604
|
};
|
|
3592
3605
|
var fireConnectedCallback = (instance, elm) => {
|
|
3593
|
-
if (
|
|
3606
|
+
if (BUILD24.lazyLoad) {
|
|
3594
3607
|
safeCall(instance, "connectedCallback", void 0, elm);
|
|
3595
3608
|
}
|
|
3596
3609
|
};
|
|
@@ -3601,41 +3614,41 @@ var connectedCallback = (elm) => {
|
|
|
3601
3614
|
const hostRef = getHostRef(elm);
|
|
3602
3615
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
3603
3616
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
3604
|
-
if (
|
|
3617
|
+
if (BUILD25.hostListenerTargetParent) {
|
|
3605
3618
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
3606
3619
|
}
|
|
3607
3620
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
3608
3621
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
3609
3622
|
let hostId;
|
|
3610
|
-
if (
|
|
3623
|
+
if (BUILD25.hydrateClientSide) {
|
|
3611
3624
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
3612
3625
|
if (hostId) {
|
|
3613
|
-
if (
|
|
3614
|
-
const scopeId2 =
|
|
3626
|
+
if (BUILD25.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3627
|
+
const scopeId2 = BUILD25.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
|
|
3615
3628
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
3616
|
-
} else if (
|
|
3617
|
-
const scopeId2 = getScopeId(cmpMeta,
|
|
3629
|
+
} else if (BUILD25.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3630
|
+
const scopeId2 = getScopeId(cmpMeta, BUILD25.mode ? elm.getAttribute("s-mode") : void 0);
|
|
3618
3631
|
elm["s-sc"] = scopeId2;
|
|
3619
3632
|
}
|
|
3620
3633
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
3621
3634
|
}
|
|
3622
3635
|
}
|
|
3623
|
-
if (
|
|
3624
|
-
if (
|
|
3636
|
+
if (BUILD25.slotRelocation && !hostId) {
|
|
3637
|
+
if (BUILD25.hydrateServerSide || (BUILD25.slot || BUILD25.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
3625
3638
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
3626
3639
|
setContentReference(elm);
|
|
3627
3640
|
}
|
|
3628
3641
|
}
|
|
3629
|
-
if (
|
|
3642
|
+
if (BUILD25.asyncLoading) {
|
|
3630
3643
|
let ancestorComponent = elm;
|
|
3631
3644
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
3632
|
-
if (
|
|
3645
|
+
if (BUILD25.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
3633
3646
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
3634
3647
|
break;
|
|
3635
3648
|
}
|
|
3636
3649
|
}
|
|
3637
3650
|
}
|
|
3638
|
-
if (
|
|
3651
|
+
if (BUILD25.prop && !BUILD25.hydrateServerSide && cmpMeta.$members$) {
|
|
3639
3652
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
3640
3653
|
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
3641
3654
|
const value = elm[memberName];
|
|
@@ -3644,7 +3657,7 @@ var connectedCallback = (elm) => {
|
|
|
3644
3657
|
}
|
|
3645
3658
|
});
|
|
3646
3659
|
}
|
|
3647
|
-
if (
|
|
3660
|
+
if (BUILD25.initializeNextTick) {
|
|
3648
3661
|
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
3649
3662
|
} else {
|
|
3650
3663
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
@@ -3665,29 +3678,29 @@ var setContentReference = (elm) => {
|
|
|
3665
3678
|
return;
|
|
3666
3679
|
}
|
|
3667
3680
|
const contentRefElm = elm["s-cr"] = win.document.createComment(
|
|
3668
|
-
|
|
3681
|
+
BUILD25.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
3669
3682
|
);
|
|
3670
3683
|
contentRefElm["s-cn"] = true;
|
|
3671
3684
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
3672
3685
|
};
|
|
3673
3686
|
|
|
3674
3687
|
// src/runtime/disconnected-callback.ts
|
|
3675
|
-
import { BUILD as
|
|
3688
|
+
import { BUILD as BUILD26 } from "@stencil/core/internal/app-data";
|
|
3676
3689
|
var disconnectInstance = (instance, elm) => {
|
|
3677
|
-
if (
|
|
3690
|
+
if (BUILD26.lazyLoad) {
|
|
3678
3691
|
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
3679
3692
|
}
|
|
3680
3693
|
};
|
|
3681
3694
|
var disconnectedCallback = async (elm) => {
|
|
3682
3695
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
3683
3696
|
const hostRef = getHostRef(elm);
|
|
3684
|
-
if (
|
|
3697
|
+
if (BUILD26.hostListener) {
|
|
3685
3698
|
if (hostRef.$rmListeners$) {
|
|
3686
3699
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
3687
3700
|
hostRef.$rmListeners$ = void 0;
|
|
3688
3701
|
}
|
|
3689
3702
|
}
|
|
3690
|
-
if (!
|
|
3703
|
+
if (!BUILD26.lazyLoad) {
|
|
3691
3704
|
disconnectInstance(elm);
|
|
3692
3705
|
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
3693
3706
|
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
@@ -3712,40 +3725,40 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3712
3725
|
$flags$: compactMeta[0],
|
|
3713
3726
|
$tagName$: compactMeta[1]
|
|
3714
3727
|
};
|
|
3715
|
-
if (
|
|
3728
|
+
if (BUILD27.member) {
|
|
3716
3729
|
cmpMeta.$members$ = compactMeta[2];
|
|
3717
3730
|
}
|
|
3718
|
-
if (
|
|
3731
|
+
if (BUILD27.hostListener) {
|
|
3719
3732
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
3720
3733
|
}
|
|
3721
|
-
if (
|
|
3734
|
+
if (BUILD27.watchCallback) {
|
|
3722
3735
|
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
3723
3736
|
}
|
|
3724
|
-
if (
|
|
3737
|
+
if (BUILD27.reflect) {
|
|
3725
3738
|
cmpMeta.$attrsToReflect$ = [];
|
|
3726
3739
|
}
|
|
3727
|
-
if (
|
|
3740
|
+
if (BUILD27.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3728
3741
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
3729
3742
|
}
|
|
3730
|
-
if (
|
|
3731
|
-
if (
|
|
3743
|
+
if (BUILD27.experimentalSlotFixes) {
|
|
3744
|
+
if (BUILD27.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3732
3745
|
patchPseudoShadowDom(Cstr.prototype);
|
|
3733
3746
|
}
|
|
3734
3747
|
} else {
|
|
3735
|
-
if (
|
|
3748
|
+
if (BUILD27.slotChildNodesFix) {
|
|
3736
3749
|
patchChildSlotNodes(Cstr.prototype);
|
|
3737
3750
|
}
|
|
3738
|
-
if (
|
|
3751
|
+
if (BUILD27.cloneNodeFix) {
|
|
3739
3752
|
patchCloneNode(Cstr.prototype);
|
|
3740
3753
|
}
|
|
3741
|
-
if (
|
|
3754
|
+
if (BUILD27.appendChildSlotFix) {
|
|
3742
3755
|
patchSlotAppendChild(Cstr.prototype);
|
|
3743
3756
|
}
|
|
3744
|
-
if (
|
|
3757
|
+
if (BUILD27.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3745
3758
|
patchTextContent(Cstr.prototype);
|
|
3746
3759
|
}
|
|
3747
3760
|
}
|
|
3748
|
-
if (
|
|
3761
|
+
if (BUILD27.hydrateClientSide && BUILD27.shadowDom) {
|
|
3749
3762
|
hydrateScopedToShadow();
|
|
3750
3763
|
}
|
|
3751
3764
|
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
@@ -3775,14 +3788,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3775
3788
|
__attachShadow() {
|
|
3776
3789
|
if (supportsShadow) {
|
|
3777
3790
|
if (!this.shadowRoot) {
|
|
3778
|
-
|
|
3779
|
-
this.attachShadow({
|
|
3780
|
-
mode: "open",
|
|
3781
|
-
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
3782
|
-
});
|
|
3783
|
-
} else {
|
|
3784
|
-
this.attachShadow({ mode: "open" });
|
|
3785
|
-
}
|
|
3791
|
+
createShadowRoot.call(this, cmpMeta);
|
|
3786
3792
|
} else {
|
|
3787
3793
|
if (this.shadowRoot.mode !== "open") {
|
|
3788
3794
|
throw new Error(
|
|
@@ -3799,7 +3805,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3799
3805
|
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
3800
3806
|
};
|
|
3801
3807
|
var forceModeUpdate = (elm) => {
|
|
3802
|
-
if (
|
|
3808
|
+
if (BUILD27.style && BUILD27.mode && !BUILD27.lazyLoad) {
|
|
3803
3809
|
const mode = computeMode(elm);
|
|
3804
3810
|
const hostRef = getHostRef(elm);
|
|
3805
3811
|
if (hostRef.$modeName$ !== mode) {
|
|
@@ -3822,7 +3828,7 @@ var forceModeUpdate = (elm) => {
|
|
|
3822
3828
|
};
|
|
3823
3829
|
|
|
3824
3830
|
// src/runtime/bootstrap-lazy.ts
|
|
3825
|
-
import { BUILD as
|
|
3831
|
+
import { BUILD as BUILD28 } from "@stencil/core/internal/app-data";
|
|
3826
3832
|
|
|
3827
3833
|
// src/runtime/hmr-component.ts
|
|
3828
3834
|
var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
@@ -3834,7 +3840,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
|
3834
3840
|
// src/runtime/bootstrap-lazy.ts
|
|
3835
3841
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
3836
3842
|
var _a;
|
|
3837
|
-
if (
|
|
3843
|
+
if (BUILD28.profile && performance.mark) {
|
|
3838
3844
|
performance.mark("st:app:start");
|
|
3839
3845
|
}
|
|
3840
3846
|
installDevTools();
|
|
@@ -3854,15 +3860,15 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3854
3860
|
let isBootstrapping = true;
|
|
3855
3861
|
Object.assign(plt, options);
|
|
3856
3862
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
3857
|
-
if (
|
|
3863
|
+
if (BUILD28.asyncQueue) {
|
|
3858
3864
|
if (options.syncQueue) {
|
|
3859
3865
|
plt.$flags$ |= 4 /* queueSync */;
|
|
3860
3866
|
}
|
|
3861
3867
|
}
|
|
3862
|
-
if (
|
|
3868
|
+
if (BUILD28.hydrateClientSide) {
|
|
3863
3869
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
3864
3870
|
}
|
|
3865
|
-
if (
|
|
3871
|
+
if (BUILD28.hydrateClientSide && BUILD28.shadowDom) {
|
|
3866
3872
|
hydrateScopedToShadow();
|
|
3867
3873
|
}
|
|
3868
3874
|
let hasSlotRelocation = false;
|
|
@@ -3878,22 +3884,22 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3878
3884
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
3879
3885
|
hasSlotRelocation = true;
|
|
3880
3886
|
}
|
|
3881
|
-
if (
|
|
3887
|
+
if (BUILD28.member) {
|
|
3882
3888
|
cmpMeta.$members$ = compactMeta[2];
|
|
3883
3889
|
}
|
|
3884
|
-
if (
|
|
3890
|
+
if (BUILD28.hostListener) {
|
|
3885
3891
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
3886
3892
|
}
|
|
3887
|
-
if (
|
|
3893
|
+
if (BUILD28.reflect) {
|
|
3888
3894
|
cmpMeta.$attrsToReflect$ = [];
|
|
3889
3895
|
}
|
|
3890
|
-
if (
|
|
3896
|
+
if (BUILD28.watchCallback) {
|
|
3891
3897
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
3892
3898
|
}
|
|
3893
|
-
if (
|
|
3899
|
+
if (BUILD28.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3894
3900
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
3895
3901
|
}
|
|
3896
|
-
const tagName =
|
|
3902
|
+
const tagName = BUILD28.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
|
|
3897
3903
|
const HostElement = class extends HTMLElement {
|
|
3898
3904
|
// StencilLazyHost
|
|
3899
3905
|
constructor(self) {
|
|
@@ -3901,17 +3907,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3901
3907
|
this.hasRegisteredEventListeners = false;
|
|
3902
3908
|
self = this;
|
|
3903
3909
|
registerHost(self, cmpMeta);
|
|
3904
|
-
if (
|
|
3910
|
+
if (BUILD28.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3905
3911
|
if (supportsShadow) {
|
|
3906
3912
|
if (!self.shadowRoot) {
|
|
3907
|
-
|
|
3908
|
-
self.attachShadow({
|
|
3909
|
-
mode: "open",
|
|
3910
|
-
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
3911
|
-
});
|
|
3912
|
-
} else {
|
|
3913
|
-
self.attachShadow({ mode: "open" });
|
|
3914
|
-
}
|
|
3913
|
+
createShadowRoot.call(self, cmpMeta);
|
|
3915
3914
|
} else {
|
|
3916
3915
|
if (self.shadowRoot.mode !== "open") {
|
|
3917
3916
|
throw new Error(
|
|
@@ -3919,7 +3918,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3919
3918
|
);
|
|
3920
3919
|
}
|
|
3921
3920
|
}
|
|
3922
|
-
} else if (!
|
|
3921
|
+
} else if (!BUILD28.hydrateServerSide && !("shadowRoot" in self)) {
|
|
3923
3922
|
self.shadowRoot = self;
|
|
3924
3923
|
}
|
|
3925
3924
|
}
|
|
@@ -3958,28 +3957,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3958
3957
|
return getHostRef(this).$onReadyPromise$;
|
|
3959
3958
|
}
|
|
3960
3959
|
};
|
|
3961
|
-
if (
|
|
3962
|
-
if (
|
|
3960
|
+
if (BUILD28.experimentalSlotFixes) {
|
|
3961
|
+
if (BUILD28.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3963
3962
|
patchPseudoShadowDom(HostElement.prototype);
|
|
3964
3963
|
}
|
|
3965
3964
|
} else {
|
|
3966
|
-
if (
|
|
3965
|
+
if (BUILD28.slotChildNodesFix) {
|
|
3967
3966
|
patchChildSlotNodes(HostElement.prototype);
|
|
3968
3967
|
}
|
|
3969
|
-
if (
|
|
3968
|
+
if (BUILD28.cloneNodeFix) {
|
|
3970
3969
|
patchCloneNode(HostElement.prototype);
|
|
3971
3970
|
}
|
|
3972
|
-
if (
|
|
3971
|
+
if (BUILD28.appendChildSlotFix) {
|
|
3973
3972
|
patchSlotAppendChild(HostElement.prototype);
|
|
3974
3973
|
}
|
|
3975
|
-
if (
|
|
3974
|
+
if (BUILD28.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3976
3975
|
patchTextContent(HostElement.prototype);
|
|
3977
3976
|
}
|
|
3978
3977
|
}
|
|
3979
|
-
if (
|
|
3978
|
+
if (BUILD28.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
|
|
3980
3979
|
HostElement.formAssociated = true;
|
|
3981
3980
|
}
|
|
3982
|
-
if (
|
|
3981
|
+
if (BUILD28.hotModuleReplacement) {
|
|
3983
3982
|
HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
3984
3983
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
3985
3984
|
};
|
|
@@ -3998,7 +3997,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3998
3997
|
if (hasSlotRelocation) {
|
|
3999
3998
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
4000
3999
|
}
|
|
4001
|
-
if (
|
|
4000
|
+
if (BUILD28.invisiblePrehydration && (BUILD28.hydratedClass || BUILD28.hydratedAttribute)) {
|
|
4002
4001
|
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
4003
4002
|
}
|
|
4004
4003
|
if (dataStyles.innerHTML.length) {
|
|
@@ -4014,7 +4013,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4014
4013
|
if (deferredConnectedCallbacks.length) {
|
|
4015
4014
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
4016
4015
|
} else {
|
|
4017
|
-
if (
|
|
4016
|
+
if (BUILD28.profile) {
|
|
4018
4017
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
|
|
4019
4018
|
} else {
|
|
4020
4019
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
|
|
@@ -4027,10 +4026,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4027
4026
|
var Fragment = (_, children) => children;
|
|
4028
4027
|
|
|
4029
4028
|
// src/runtime/host-listener.ts
|
|
4030
|
-
import { BUILD as
|
|
4029
|
+
import { BUILD as BUILD29 } from "@stencil/core/internal/app-data";
|
|
4031
4030
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
4032
|
-
if (
|
|
4033
|
-
if (
|
|
4031
|
+
if (BUILD29.hostListener && listeners && win.document) {
|
|
4032
|
+
if (BUILD29.hostListenerTargetParent) {
|
|
4034
4033
|
if (attachParentListeners) {
|
|
4035
4034
|
listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
|
|
4036
4035
|
} else {
|
|
@@ -4038,7 +4037,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
4038
4037
|
}
|
|
4039
4038
|
}
|
|
4040
4039
|
listeners.map(([flags, name, method]) => {
|
|
4041
|
-
const target =
|
|
4040
|
+
const target = BUILD29.hostListenerTarget ? getHostListenerTarget(win.document, elm, flags) : elm;
|
|
4042
4041
|
const handler = hostListenerProxy(hostRef, method);
|
|
4043
4042
|
const opts = hostListenerOpts(flags);
|
|
4044
4043
|
plt.ael(target, name, handler, opts);
|
|
@@ -4049,7 +4048,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
4049
4048
|
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
4050
4049
|
var _a;
|
|
4051
4050
|
try {
|
|
4052
|
-
if (
|
|
4051
|
+
if (BUILD29.lazyLoad) {
|
|
4053
4052
|
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
4054
4053
|
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
4055
4054
|
} else {
|
|
@@ -4063,16 +4062,16 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
4063
4062
|
}
|
|
4064
4063
|
};
|
|
4065
4064
|
var getHostListenerTarget = (doc, elm, flags) => {
|
|
4066
|
-
if (
|
|
4065
|
+
if (BUILD29.hostListenerTargetDocument && flags & 4 /* TargetDocument */) {
|
|
4067
4066
|
return doc;
|
|
4068
4067
|
}
|
|
4069
|
-
if (
|
|
4068
|
+
if (BUILD29.hostListenerTargetWindow && flags & 8 /* TargetWindow */) {
|
|
4070
4069
|
return win;
|
|
4071
4070
|
}
|
|
4072
|
-
if (
|
|
4071
|
+
if (BUILD29.hostListenerTargetBody && flags & 16 /* TargetBody */) {
|
|
4073
4072
|
return doc.body;
|
|
4074
4073
|
}
|
|
4075
|
-
if (
|
|
4074
|
+
if (BUILD29.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement) {
|
|
4076
4075
|
return elm.parentElement;
|
|
4077
4076
|
}
|
|
4078
4077
|
return elm;
|
|
@@ -4247,7 +4246,7 @@ var insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, inde
|
|
|
4247
4246
|
}
|
|
4248
4247
|
};
|
|
4249
4248
|
export {
|
|
4250
|
-
|
|
4249
|
+
BUILD30 as BUILD,
|
|
4251
4250
|
Build,
|
|
4252
4251
|
Env,
|
|
4253
4252
|
Fragment,
|