@stencil/core 4.23.0-dev.1735794112.5d29255 → 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 +125 -133
- 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 +504 -453
- 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 +11 -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 +2 -1
- package/testing/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Hydrate Platform v4.23.0-dev.
|
|
2
|
+
Stencil Hydrate 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) => {
|
|
@@ -8,7 +8,7 @@ var __export = (target, all) => {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
// src/hydrate/platform/index.ts
|
|
11
|
-
import { BUILD as
|
|
11
|
+
import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
|
|
12
12
|
|
|
13
13
|
// src/runtime/asset-path.ts
|
|
14
14
|
var getAssetPath = (path) => {
|
|
@@ -18,7 +18,7 @@ var getAssetPath = (path) => {
|
|
|
18
18
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
19
19
|
|
|
20
20
|
// src/runtime/bootstrap-custom-element.ts
|
|
21
|
-
import { BUILD as
|
|
21
|
+
import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
|
|
22
22
|
|
|
23
23
|
// src/utils/constants.ts
|
|
24
24
|
var EMPTY_OBJ = {};
|
|
@@ -26,7 +26,7 @@ var SVG_NS = "http://www.w3.org/2000/svg";
|
|
|
26
26
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
27
27
|
|
|
28
28
|
// src/utils/helpers.ts
|
|
29
|
-
var isDef = (v) => v != null;
|
|
29
|
+
var isDef = (v) => v != null && v !== void 0;
|
|
30
30
|
var isComplexType = (o) => {
|
|
31
31
|
o = typeof o;
|
|
32
32
|
return o === "object" || o === "function";
|
|
@@ -88,13 +88,13 @@ var unwrapErr = (result) => {
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
// src/runtime/connected-callback.ts
|
|
91
|
-
import { BUILD as
|
|
91
|
+
import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
|
|
92
92
|
|
|
93
93
|
// src/runtime/client-hydrate.ts
|
|
94
|
-
import { BUILD as
|
|
94
|
+
import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
|
|
95
95
|
|
|
96
96
|
// src/runtime/dom-extras.ts
|
|
97
|
-
import { BUILD as
|
|
97
|
+
import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
|
|
98
98
|
|
|
99
99
|
// src/runtime/runtime-constants.ts
|
|
100
100
|
var CONTENT_REF_ID = "r";
|
|
@@ -121,11 +121,114 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
|
121
121
|
"formStateRestoreCallback"
|
|
122
122
|
];
|
|
123
123
|
|
|
124
|
+
// src/runtime/slot-polyfill-utils.ts
|
|
125
|
+
import { BUILD } from "@stencil/core/internal/app-data";
|
|
126
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
127
|
+
const childNodes = elm.__childNodes || elm.childNodes;
|
|
128
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
129
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
130
|
+
var _a;
|
|
131
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
132
|
+
if ((_a = getHostSlotChildNodes(slotNode, slotNode["s-sn"], false)) == null ? void 0 : _a.length) {
|
|
133
|
+
slotNode.hidden = true;
|
|
134
|
+
} else {
|
|
135
|
+
slotNode.hidden = false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
for (const childNode of childNodes) {
|
|
141
|
+
if (childNode.nodeType === 1 /* ElementNode */ && (childNode.__childNodes || childNode.childNodes).length) {
|
|
142
|
+
updateFallbackSlotVisibility(childNode);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
147
|
+
const result = [];
|
|
148
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
149
|
+
const slottedNode = childNodes[i2]["s-nr"];
|
|
150
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
151
|
+
result.push(slottedNode);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return result;
|
|
155
|
+
};
|
|
156
|
+
var getHostSlotNodes = (childNodes, hostName, slotName) => {
|
|
157
|
+
let i2 = 0;
|
|
158
|
+
let slottedNodes = [];
|
|
159
|
+
let childNode;
|
|
160
|
+
for (; i2 < childNodes.length; i2++) {
|
|
161
|
+
childNode = childNodes[i2];
|
|
162
|
+
if (childNode["s-sr"] && childNode["s-hn"] === hostName && (!slotName || childNode["s-sn"] === slotName)) {
|
|
163
|
+
slottedNodes.push(childNode);
|
|
164
|
+
if (typeof slotName !== "undefined") return slottedNodes;
|
|
165
|
+
}
|
|
166
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
167
|
+
}
|
|
168
|
+
return slottedNodes;
|
|
169
|
+
};
|
|
170
|
+
var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
|
|
171
|
+
const childNodes = [];
|
|
172
|
+
if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
|
|
173
|
+
while ((node = node.nextSibling) && node["s-sn"] === slotName) {
|
|
174
|
+
childNodes.push(node);
|
|
175
|
+
}
|
|
176
|
+
return childNodes;
|
|
177
|
+
};
|
|
178
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
179
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
180
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
return slotName === "";
|
|
192
|
+
};
|
|
193
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
194
|
+
let slottedNodeLocation;
|
|
195
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
196
|
+
slottedNodeLocation = newChild["s-ol"];
|
|
197
|
+
} else {
|
|
198
|
+
slottedNodeLocation = document.createTextNode("");
|
|
199
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
200
|
+
}
|
|
201
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
202
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
203
|
+
const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
|
|
204
|
+
if (typeof position !== "undefined") {
|
|
205
|
+
if (BUILD.hydrateClientSide) {
|
|
206
|
+
slottedNodeLocation["s-oo"] = position;
|
|
207
|
+
const childNodes = parent.__childNodes || parent.childNodes;
|
|
208
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
209
|
+
childNodes.forEach((n) => {
|
|
210
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
211
|
+
});
|
|
212
|
+
slotRelocateNodes.sort((a, b) => {
|
|
213
|
+
if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
|
|
214
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
215
|
+
return 0;
|
|
216
|
+
});
|
|
217
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
221
|
+
}
|
|
222
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
223
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
224
|
+
};
|
|
225
|
+
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
226
|
+
|
|
124
227
|
// src/runtime/vdom/vdom-render.ts
|
|
125
|
-
import { BUILD as
|
|
228
|
+
import { BUILD as BUILD5 } from "@stencil/core/internal/app-data";
|
|
126
229
|
|
|
127
230
|
// src/runtime/vdom/h.ts
|
|
128
|
-
import { BUILD } from "@stencil/core/internal/app-data";
|
|
231
|
+
import { BUILD as BUILD2 } from "@stencil/core/internal/app-data";
|
|
129
232
|
var h = (nodeName, vnodeData, ...children) => {
|
|
130
233
|
let child = null;
|
|
131
234
|
let key = null;
|
|
@@ -141,7 +244,7 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
141
244
|
} else if (child != null && typeof child !== "boolean") {
|
|
142
245
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
143
246
|
child = String(child);
|
|
144
|
-
} else if (
|
|
247
|
+
} else if (BUILD2.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
145
248
|
consoleDevError(`vNode passed as children has unexpected type.
|
|
146
249
|
Make sure it's using the correct h() function.
|
|
147
250
|
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
@@ -157,28 +260,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
157
260
|
};
|
|
158
261
|
walk(children);
|
|
159
262
|
if (vnodeData) {
|
|
160
|
-
if (
|
|
263
|
+
if (BUILD2.isDev && nodeName === "input") {
|
|
161
264
|
validateInputProperties(vnodeData);
|
|
162
265
|
}
|
|
163
|
-
if (
|
|
266
|
+
if (BUILD2.vdomKey && vnodeData.key) {
|
|
164
267
|
key = vnodeData.key;
|
|
165
268
|
}
|
|
166
|
-
if (
|
|
269
|
+
if (BUILD2.slotRelocation && vnodeData.name) {
|
|
167
270
|
slotName = vnodeData.name;
|
|
168
271
|
}
|
|
169
|
-
if (
|
|
272
|
+
if (BUILD2.vdomClass) {
|
|
170
273
|
const classData = vnodeData.className || vnodeData.class;
|
|
171
274
|
if (classData) {
|
|
172
275
|
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
173
276
|
}
|
|
174
277
|
}
|
|
175
278
|
}
|
|
176
|
-
if (
|
|
279
|
+
if (BUILD2.isDev && vNodeChildren.some(isHost)) {
|
|
177
280
|
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
178
281
|
- You are NOT using hostData() and <Host> in the same component.
|
|
179
282
|
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
180
283
|
}
|
|
181
|
-
if (
|
|
284
|
+
if (BUILD2.vdomFunctional && typeof nodeName === "function") {
|
|
182
285
|
return nodeName(
|
|
183
286
|
vnodeData === null ? {} : vnodeData,
|
|
184
287
|
vNodeChildren,
|
|
@@ -190,10 +293,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
190
293
|
if (vNodeChildren.length > 0) {
|
|
191
294
|
vnode.$children$ = vNodeChildren;
|
|
192
295
|
}
|
|
193
|
-
if (
|
|
296
|
+
if (BUILD2.vdomKey) {
|
|
194
297
|
vnode.$key$ = key;
|
|
195
298
|
}
|
|
196
|
-
if (
|
|
299
|
+
if (BUILD2.slotRelocation) {
|
|
197
300
|
vnode.$name$ = slotName;
|
|
198
301
|
}
|
|
199
302
|
return vnode;
|
|
@@ -206,13 +309,13 @@ var newVNode = (tag, text) => {
|
|
|
206
309
|
$elm$: null,
|
|
207
310
|
$children$: null
|
|
208
311
|
};
|
|
209
|
-
if (
|
|
312
|
+
if (BUILD2.vdomAttribute) {
|
|
210
313
|
vnode.$attrs$ = null;
|
|
211
314
|
}
|
|
212
|
-
if (
|
|
315
|
+
if (BUILD2.vdomKey) {
|
|
213
316
|
vnode.$key$ = null;
|
|
214
317
|
}
|
|
215
|
-
if (
|
|
318
|
+
if (BUILD2.slotRelocation) {
|
|
216
319
|
vnode.$name$ = null;
|
|
217
320
|
}
|
|
218
321
|
return vnode;
|
|
@@ -265,28 +368,35 @@ var validateInputProperties = (inputElm) => {
|
|
|
265
368
|
};
|
|
266
369
|
|
|
267
370
|
// src/runtime/vdom/update-element.ts
|
|
268
|
-
import { BUILD as
|
|
371
|
+
import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
|
|
269
372
|
|
|
270
373
|
// src/runtime/vdom/set-accessor.ts
|
|
271
|
-
import { BUILD as
|
|
374
|
+
import { BUILD as BUILD3 } from "@stencil/core/internal/app-data";
|
|
272
375
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
273
376
|
if (oldValue !== newValue) {
|
|
274
377
|
let isProp = isMemberInElement(elm, memberName);
|
|
275
378
|
let ln = memberName.toLowerCase();
|
|
276
|
-
if (
|
|
379
|
+
if (BUILD3.vdomClass && memberName === "class") {
|
|
277
380
|
const classList = elm.classList;
|
|
278
381
|
const oldClasses = parseClassList(oldValue);
|
|
279
|
-
|
|
280
|
-
if (elm["s-si"]
|
|
382
|
+
let newClasses = parseClassList(newValue);
|
|
383
|
+
if (elm["s-si"]) {
|
|
281
384
|
newClasses.push(elm["s-si"]);
|
|
385
|
+
oldClasses.forEach((c) => {
|
|
386
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
387
|
+
});
|
|
388
|
+
newClasses = [...new Set(newClasses)];
|
|
389
|
+
classList.add(...newClasses);
|
|
390
|
+
delete elm["s-si"];
|
|
391
|
+
} else {
|
|
392
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
393
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
282
394
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
} else if (BUILD2.vdomStyle && memberName === "style") {
|
|
286
|
-
if (BUILD2.updatable) {
|
|
395
|
+
} else if (BUILD3.vdomStyle && memberName === "style") {
|
|
396
|
+
if (BUILD3.updatable) {
|
|
287
397
|
for (const prop in oldValue) {
|
|
288
398
|
if (!newValue || newValue[prop] == null) {
|
|
289
|
-
if (!
|
|
399
|
+
if (!BUILD3.hydrateServerSide && prop.includes("-")) {
|
|
290
400
|
elm.style.removeProperty(prop);
|
|
291
401
|
} else {
|
|
292
402
|
elm.style[prop] = "";
|
|
@@ -296,19 +406,19 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
296
406
|
}
|
|
297
407
|
for (const prop in newValue) {
|
|
298
408
|
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
299
|
-
if (!
|
|
409
|
+
if (!BUILD3.hydrateServerSide && prop.includes("-")) {
|
|
300
410
|
elm.style.setProperty(prop, newValue[prop]);
|
|
301
411
|
} else {
|
|
302
412
|
elm.style[prop] = newValue[prop];
|
|
303
413
|
}
|
|
304
414
|
}
|
|
305
415
|
}
|
|
306
|
-
} else if (
|
|
307
|
-
} else if (
|
|
416
|
+
} else if (BUILD3.vdomKey && memberName === "key") {
|
|
417
|
+
} else if (BUILD3.vdomRef && memberName === "ref") {
|
|
308
418
|
if (newValue) {
|
|
309
419
|
newValue(elm);
|
|
310
420
|
}
|
|
311
|
-
} else if (
|
|
421
|
+
} else if (BUILD3.vdomListener && (BUILD3.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
312
422
|
if (memberName[2] === "-") {
|
|
313
423
|
memberName = memberName.slice(3);
|
|
314
424
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -326,7 +436,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
326
436
|
plt.ael(elm, memberName, newValue, capture);
|
|
327
437
|
}
|
|
328
438
|
}
|
|
329
|
-
} else if (
|
|
439
|
+
} else if (BUILD3.vdomPropOrAttr) {
|
|
330
440
|
const isComplex = isComplexType(newValue);
|
|
331
441
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
332
442
|
try {
|
|
@@ -348,7 +458,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
348
458
|
}
|
|
349
459
|
}
|
|
350
460
|
let xlink = false;
|
|
351
|
-
if (
|
|
461
|
+
if (BUILD3.vdomXlink) {
|
|
352
462
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
353
463
|
memberName = ln;
|
|
354
464
|
xlink = true;
|
|
@@ -356,7 +466,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
356
466
|
}
|
|
357
467
|
if (newValue == null || newValue === false) {
|
|
358
468
|
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
359
|
-
if (
|
|
469
|
+
if (BUILD3.vdomXlink && xlink) {
|
|
360
470
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
361
471
|
} else {
|
|
362
472
|
elm.removeAttribute(memberName);
|
|
@@ -364,7 +474,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
364
474
|
}
|
|
365
475
|
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
366
476
|
newValue = newValue === true ? "" : newValue;
|
|
367
|
-
if (
|
|
477
|
+
if (BUILD3.vdomXlink && xlink) {
|
|
368
478
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
369
479
|
} else {
|
|
370
480
|
elm.setAttribute(memberName, newValue);
|
|
@@ -391,7 +501,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
|
391
501
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
392
502
|
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
|
|
393
503
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
394
|
-
if (
|
|
504
|
+
if (BUILD4.updatable) {
|
|
395
505
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
396
506
|
if (!(memberName in newVnodeAttrs)) {
|
|
397
507
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
@@ -420,19 +530,16 @@ var useNativeShadowDom = false;
|
|
|
420
530
|
var checkSlotFallbackVisibility = false;
|
|
421
531
|
var checkSlotRelocate = false;
|
|
422
532
|
var isSvgMode = false;
|
|
423
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
533
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
424
534
|
var _a;
|
|
425
535
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
426
536
|
let i2 = 0;
|
|
427
537
|
let elm;
|
|
428
538
|
let childNode;
|
|
429
539
|
let oldVNode;
|
|
430
|
-
if (
|
|
540
|
+
if (BUILD5.slotRelocation && !useNativeShadowDom) {
|
|
431
541
|
checkSlotRelocate = true;
|
|
432
542
|
if (newVNode2.$tag$ === "slot") {
|
|
433
|
-
if (scopeId) {
|
|
434
|
-
parentElm.classList.add(scopeId + "-s");
|
|
435
|
-
}
|
|
436
543
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
437
544
|
// slot element has fallback content
|
|
438
545
|
// still create an element that "mocks" the slot element
|
|
@@ -445,48 +552,43 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
445
552
|
);
|
|
446
553
|
}
|
|
447
554
|
}
|
|
448
|
-
if (
|
|
555
|
+
if (BUILD5.isDev && newVNode2.$elm$) {
|
|
449
556
|
consoleDevError(
|
|
450
557
|
`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`
|
|
451
558
|
);
|
|
452
559
|
}
|
|
453
|
-
if (
|
|
560
|
+
if (BUILD5.vdomText && newVNode2.$text$ !== null) {
|
|
454
561
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
455
|
-
} else if (
|
|
456
|
-
elm = newVNode2.$elm$ =
|
|
562
|
+
} else if (BUILD5.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
563
|
+
elm = newVNode2.$elm$ = BUILD5.isDebug || BUILD5.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
|
|
457
564
|
} else {
|
|
458
|
-
if (
|
|
565
|
+
if (BUILD5.svg && !isSvgMode) {
|
|
459
566
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
460
567
|
}
|
|
461
|
-
elm = newVNode2.$elm$ =
|
|
568
|
+
elm = newVNode2.$elm$ = BUILD5.svg ? doc.createElementNS(
|
|
462
569
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
463
|
-
!useNativeShadowDom &&
|
|
570
|
+
!useNativeShadowDom && BUILD5.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
464
571
|
) : doc.createElement(
|
|
465
|
-
!useNativeShadowDom &&
|
|
572
|
+
!useNativeShadowDom && BUILD5.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
466
573
|
);
|
|
467
|
-
if (
|
|
574
|
+
if (BUILD5.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
468
575
|
isSvgMode = false;
|
|
469
576
|
}
|
|
470
|
-
if (
|
|
577
|
+
if (BUILD5.vdomAttribute) {
|
|
471
578
|
updateElement(null, newVNode2, isSvgMode);
|
|
472
579
|
}
|
|
473
|
-
|
|
474
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
475
|
-
if (!isElementWithinShadowRoot && BUILD4.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
580
|
+
if (BUILD5.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
476
581
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
477
582
|
}
|
|
478
|
-
if (BUILD4.scoped) {
|
|
479
|
-
updateElementScopeIds(elm, parentElm);
|
|
480
|
-
}
|
|
481
583
|
if (newVNode2.$children$) {
|
|
482
584
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
483
|
-
childNode = createElm(oldParentVNode, newVNode2, i2
|
|
585
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
484
586
|
if (childNode) {
|
|
485
587
|
elm.appendChild(childNode);
|
|
486
588
|
}
|
|
487
589
|
}
|
|
488
590
|
}
|
|
489
|
-
if (
|
|
591
|
+
if (BUILD5.svg) {
|
|
490
592
|
if (newVNode2.$tag$ === "svg") {
|
|
491
593
|
isSvgMode = false;
|
|
492
594
|
} else if (elm.tagName === "foreignObject") {
|
|
@@ -495,7 +597,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
495
597
|
}
|
|
496
598
|
}
|
|
497
599
|
elm["s-hn"] = hostTagName;
|
|
498
|
-
if (
|
|
600
|
+
if (BUILD5.slotRelocation) {
|
|
499
601
|
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
500
602
|
elm["s-sr"] = true;
|
|
501
603
|
elm["s-cr"] = contentRef;
|
|
@@ -503,12 +605,15 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
503
605
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
504
606
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
505
607
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
506
|
-
if (
|
|
608
|
+
if (BUILD5.experimentalSlotFixes) {
|
|
507
609
|
relocateToHostRoot(oldParentVNode.$elm$);
|
|
508
610
|
} else {
|
|
509
611
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
510
612
|
}
|
|
511
613
|
}
|
|
614
|
+
if (BUILD5.scoped) {
|
|
615
|
+
addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
|
|
616
|
+
}
|
|
512
617
|
}
|
|
513
618
|
}
|
|
514
619
|
return elm;
|
|
@@ -536,7 +641,7 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
536
641
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
537
642
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
538
643
|
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
539
|
-
if (parentElm["s-sr"] &&
|
|
644
|
+
if (parentElm["s-sr"] && BUILD5.experimentalSlotFixes) {
|
|
540
645
|
let node = parentElm;
|
|
541
646
|
while (node = node.nextSibling) {
|
|
542
647
|
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
@@ -547,7 +652,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
547
652
|
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
548
653
|
const childNode = oldSlotChildNodes[i2];
|
|
549
654
|
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
550
|
-
insertBefore(
|
|
655
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
551
656
|
childNode["s-ol"].remove();
|
|
552
657
|
childNode["s-ol"] = void 0;
|
|
553
658
|
childNode["s-sh"] = void 0;
|
|
@@ -560,17 +665,17 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
560
665
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
561
666
|
};
|
|
562
667
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
563
|
-
let containerElm =
|
|
668
|
+
let containerElm = BUILD5.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
564
669
|
let childNode;
|
|
565
|
-
if (
|
|
670
|
+
if (BUILD5.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
566
671
|
containerElm = containerElm.shadowRoot;
|
|
567
672
|
}
|
|
568
673
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
569
674
|
if (vnodes[startIdx]) {
|
|
570
|
-
childNode = createElm(null, parentVNode, startIdx
|
|
675
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
571
676
|
if (childNode) {
|
|
572
677
|
vnodes[startIdx].$elm$ = childNode;
|
|
573
|
-
insertBefore(containerElm, childNode,
|
|
678
|
+
insertBefore(containerElm, childNode, BUILD5.slotRelocation ? referenceNode(before) : before);
|
|
574
679
|
}
|
|
575
680
|
}
|
|
576
681
|
}
|
|
@@ -582,7 +687,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
582
687
|
const elm = vnode.$elm$;
|
|
583
688
|
nullifyVNodeRefs(vnode);
|
|
584
689
|
if (elm) {
|
|
585
|
-
if (
|
|
690
|
+
if (BUILD5.slotRelocation) {
|
|
586
691
|
checkSlotFallbackVisibility = true;
|
|
587
692
|
if (elm["s-ol"]) {
|
|
588
693
|
elm["s-ol"].remove();
|
|
@@ -626,7 +731,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
626
731
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
627
732
|
newEndVnode = newCh[--newEndIdx];
|
|
628
733
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
629
|
-
if (
|
|
734
|
+
if (BUILD5.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
630
735
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
631
736
|
}
|
|
632
737
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -634,7 +739,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
634
739
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
635
740
|
newEndVnode = newCh[--newEndIdx];
|
|
636
741
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
637
|
-
if (
|
|
742
|
+
if (BUILD5.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
638
743
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
639
744
|
}
|
|
640
745
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -643,7 +748,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
643
748
|
newStartVnode = newCh[++newStartIdx];
|
|
644
749
|
} else {
|
|
645
750
|
idxInOld = -1;
|
|
646
|
-
if (
|
|
751
|
+
if (BUILD5.vdomKey) {
|
|
647
752
|
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
648
753
|
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
649
754
|
idxInOld = i2;
|
|
@@ -651,10 +756,10 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
651
756
|
}
|
|
652
757
|
}
|
|
653
758
|
}
|
|
654
|
-
if (
|
|
759
|
+
if (BUILD5.vdomKey && idxInOld >= 0) {
|
|
655
760
|
elmToMove = oldCh[idxInOld];
|
|
656
761
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
657
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld
|
|
762
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
658
763
|
} else {
|
|
659
764
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
660
765
|
oldCh[idxInOld] = void 0;
|
|
@@ -662,12 +767,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
662
767
|
}
|
|
663
768
|
newStartVnode = newCh[++newStartIdx];
|
|
664
769
|
} else {
|
|
665
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx
|
|
770
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
666
771
|
newStartVnode = newCh[++newStartIdx];
|
|
667
772
|
}
|
|
668
773
|
if (node) {
|
|
669
|
-
if (
|
|
670
|
-
insertBefore(
|
|
774
|
+
if (BUILD5.slotRelocation) {
|
|
775
|
+
insertBefore(
|
|
776
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
777
|
+
node,
|
|
778
|
+
referenceNode(oldStartVnode.$elm$)
|
|
779
|
+
);
|
|
671
780
|
} else {
|
|
672
781
|
insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
|
|
673
782
|
}
|
|
@@ -683,35 +792,26 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
683
792
|
newStartIdx,
|
|
684
793
|
newEndIdx
|
|
685
794
|
);
|
|
686
|
-
} else if (
|
|
795
|
+
} else if (BUILD5.updatable && newStartIdx > newEndIdx) {
|
|
687
796
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
688
797
|
}
|
|
689
798
|
};
|
|
690
799
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
691
800
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
692
|
-
if (
|
|
693
|
-
if (
|
|
694
|
-
// The component gets hydrated and no VDOM has been initialized.
|
|
695
|
-
// Here the comparison can't happen as $name$ property is not set for `leftNode`.
|
|
696
|
-
"$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many
|
|
697
|
-
// hydration comments to be removed
|
|
698
|
-
leftVNode.$elm$.nodeType !== 8
|
|
699
|
-
) {
|
|
700
|
-
return false;
|
|
701
|
-
}
|
|
801
|
+
if (BUILD5.slotRelocation && leftVNode.$tag$ === "slot") {
|
|
702
802
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
703
803
|
}
|
|
704
|
-
if (
|
|
804
|
+
if (BUILD5.vdomKey && !isInitialRender) {
|
|
705
805
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
706
806
|
}
|
|
807
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
808
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
809
|
+
}
|
|
707
810
|
return true;
|
|
708
811
|
}
|
|
709
812
|
return false;
|
|
710
813
|
};
|
|
711
|
-
var referenceNode = (node) =>
|
|
712
|
-
return node && node["s-ol"] || node;
|
|
713
|
-
};
|
|
714
|
-
var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
|
|
814
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
715
815
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
716
816
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
717
817
|
const oldChildren = oldVNode.$children$;
|
|
@@ -719,13 +819,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
719
819
|
const tag = newVNode2.$tag$;
|
|
720
820
|
const text = newVNode2.$text$;
|
|
721
821
|
let defaultHolder;
|
|
722
|
-
if (!
|
|
723
|
-
if (
|
|
822
|
+
if (!BUILD5.vdomText || text === null) {
|
|
823
|
+
if (BUILD5.svg) {
|
|
724
824
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
725
825
|
}
|
|
726
|
-
if (
|
|
727
|
-
if (
|
|
728
|
-
if (
|
|
826
|
+
if (BUILD5.vdomAttribute || BUILD5.reflect) {
|
|
827
|
+
if (BUILD5.slot && tag === "slot" && !useNativeShadowDom) {
|
|
828
|
+
if (BUILD5.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
|
|
729
829
|
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
730
830
|
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
731
831
|
}
|
|
@@ -733,55 +833,28 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
733
833
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
734
834
|
}
|
|
735
835
|
}
|
|
736
|
-
if (
|
|
836
|
+
if (BUILD5.updatable && oldChildren !== null && newChildren !== null) {
|
|
737
837
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
738
838
|
} else if (newChildren !== null) {
|
|
739
|
-
if (
|
|
839
|
+
if (BUILD5.updatable && BUILD5.vdomText && oldVNode.$text$ !== null) {
|
|
740
840
|
elm.textContent = "";
|
|
741
841
|
}
|
|
742
842
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
743
843
|
} else if (
|
|
744
844
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
745
|
-
!isInitialRender &&
|
|
845
|
+
!isInitialRender && BUILD5.updatable && oldChildren !== null
|
|
746
846
|
) {
|
|
747
847
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
748
848
|
}
|
|
749
|
-
if (
|
|
849
|
+
if (BUILD5.svg && isSvgMode && tag === "svg") {
|
|
750
850
|
isSvgMode = false;
|
|
751
851
|
}
|
|
752
|
-
} else if (
|
|
852
|
+
} else if (BUILD5.vdomText && BUILD5.slotRelocation && (defaultHolder = elm["s-cr"])) {
|
|
753
853
|
defaultHolder.parentNode.textContent = text;
|
|
754
|
-
} else if (
|
|
854
|
+
} else if (BUILD5.vdomText && oldVNode.$text$ !== text) {
|
|
755
855
|
elm.data = text;
|
|
756
856
|
}
|
|
757
857
|
};
|
|
758
|
-
var updateFallbackSlotVisibility = (elm) => {
|
|
759
|
-
const childNodes = elm.__childNodes || elm.childNodes;
|
|
760
|
-
for (const childNode of childNodes) {
|
|
761
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
762
|
-
if (childNode["s-sr"]) {
|
|
763
|
-
const slotName = childNode["s-sn"];
|
|
764
|
-
childNode.hidden = false;
|
|
765
|
-
for (const siblingNode of childNodes) {
|
|
766
|
-
if (siblingNode !== childNode) {
|
|
767
|
-
if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
|
|
768
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
|
|
769
|
-
childNode.hidden = true;
|
|
770
|
-
break;
|
|
771
|
-
}
|
|
772
|
-
} else if (slotName === siblingNode["s-sn"]) {
|
|
773
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
|
|
774
|
-
childNode.hidden = true;
|
|
775
|
-
break;
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
updateFallbackSlotVisibility(childNode);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
};
|
|
785
858
|
var relocateNodes = [];
|
|
786
859
|
var markSlotContentForRelocation = (elm) => {
|
|
787
860
|
let node;
|
|
@@ -794,7 +867,7 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
794
867
|
const slotName = childNode["s-sn"];
|
|
795
868
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
796
869
|
node = hostContentNodes[j];
|
|
797
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!
|
|
870
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD5.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
798
871
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
799
872
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
800
873
|
checkSlotFallbackVisibility = true;
|
|
@@ -832,60 +905,40 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
832
905
|
}
|
|
833
906
|
}
|
|
834
907
|
};
|
|
835
|
-
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
836
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
837
|
-
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
838
|
-
return true;
|
|
839
|
-
}
|
|
840
|
-
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
841
|
-
return true;
|
|
842
|
-
}
|
|
843
|
-
return false;
|
|
844
|
-
}
|
|
845
|
-
if (nodeToRelocate["s-sn"] === slotName) {
|
|
846
|
-
return true;
|
|
847
|
-
}
|
|
848
|
-
return slotName === "";
|
|
849
|
-
};
|
|
850
908
|
var nullifyVNodeRefs = (vNode) => {
|
|
851
|
-
if (
|
|
909
|
+
if (BUILD5.vdomRef) {
|
|
852
910
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
853
911
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
854
912
|
}
|
|
855
913
|
};
|
|
856
914
|
var insertBefore = (parent, newNode, reference) => {
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
updateElementScopeIds(newNode, parent);
|
|
915
|
+
if (BUILD5.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
916
|
+
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
860
917
|
}
|
|
918
|
+
const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
861
919
|
return inserted;
|
|
862
920
|
};
|
|
863
|
-
|
|
864
|
-
const scopeIds = [];
|
|
865
|
-
if (element) {
|
|
866
|
-
scopeIds.push(
|
|
867
|
-
...element["s-scs"] || [],
|
|
868
|
-
element["s-si"],
|
|
869
|
-
element["s-sc"],
|
|
870
|
-
...findScopeIds(element.parentElement)
|
|
871
|
-
);
|
|
872
|
-
}
|
|
873
|
-
return scopeIds;
|
|
874
|
-
};
|
|
875
|
-
var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
|
|
921
|
+
function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
|
|
876
922
|
var _a;
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
923
|
+
let scopeId2;
|
|
924
|
+
if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
|
|
925
|
+
const scopeName = slotNode["s-sn"];
|
|
926
|
+
const hostName = slotNode["s-hn"];
|
|
927
|
+
(_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
|
|
928
|
+
if (oldParent && oldParent.classList.contains(scopeId2 + "-s")) {
|
|
929
|
+
let child = (oldParent.__childNodes || oldParent.childNodes)[0];
|
|
930
|
+
let found = false;
|
|
931
|
+
while (child) {
|
|
932
|
+
if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
|
|
933
|
+
found = true;
|
|
934
|
+
break;
|
|
884
935
|
}
|
|
936
|
+
child = child.nextSibling;
|
|
885
937
|
}
|
|
938
|
+
if (!found) oldParent.classList.remove(scopeId2 + "-s");
|
|
886
939
|
}
|
|
887
940
|
}
|
|
888
|
-
}
|
|
941
|
+
}
|
|
889
942
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
890
943
|
var _a, _b, _c, _d, _e;
|
|
891
944
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -893,7 +946,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
893
946
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
894
947
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
895
948
|
hostTagName = hostElm.tagName;
|
|
896
|
-
if (
|
|
949
|
+
if (BUILD5.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
897
950
|
throw new Error(`The <Host> must be the single root component.
|
|
898
951
|
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
899
952
|
|
|
@@ -907,7 +960,7 @@ render() {
|
|
|
907
960
|
}
|
|
908
961
|
`);
|
|
909
962
|
}
|
|
910
|
-
if (
|
|
963
|
+
if (BUILD5.reflect && cmpMeta.$attrsToReflect$) {
|
|
911
964
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
912
965
|
cmpMeta.$attrsToReflect$.map(
|
|
913
966
|
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
@@ -923,24 +976,24 @@ render() {
|
|
|
923
976
|
rootVnode.$tag$ = null;
|
|
924
977
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
925
978
|
hostRef.$vnode$ = rootVnode;
|
|
926
|
-
rootVnode.$elm$ = oldVNode.$elm$ =
|
|
927
|
-
if (
|
|
979
|
+
rootVnode.$elm$ = oldVNode.$elm$ = BUILD5.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
|
|
980
|
+
if (BUILD5.scoped || BUILD5.shadowDom) {
|
|
928
981
|
scopeId = hostElm["s-sc"];
|
|
929
982
|
}
|
|
930
983
|
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
931
|
-
if (
|
|
984
|
+
if (BUILD5.slotRelocation) {
|
|
932
985
|
contentRef = hostElm["s-cr"];
|
|
933
986
|
checkSlotFallbackVisibility = false;
|
|
934
987
|
}
|
|
935
988
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
936
|
-
if (
|
|
989
|
+
if (BUILD5.slotRelocation) {
|
|
937
990
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
938
991
|
if (checkSlotRelocate) {
|
|
939
992
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
940
993
|
for (const relocateData of relocateNodes) {
|
|
941
994
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
942
995
|
if (!nodeToRelocate["s-ol"]) {
|
|
943
|
-
const orgLocationNode =
|
|
996
|
+
const orgLocationNode = BUILD5.isDebug || BUILD5.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
|
|
944
997
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
945
998
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
946
999
|
}
|
|
@@ -951,7 +1004,7 @@ render() {
|
|
|
951
1004
|
if (slotRefNode) {
|
|
952
1005
|
const parentNodeRef = slotRefNode.parentNode;
|
|
953
1006
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
954
|
-
if (!
|
|
1007
|
+
if (!BUILD5.hydrateServerSide && (!BUILD5.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
955
1008
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
956
1009
|
while (orgLocationNode) {
|
|
957
1010
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
@@ -970,11 +1023,11 @@ render() {
|
|
|
970
1023
|
}
|
|
971
1024
|
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
972
1025
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
973
|
-
if (!
|
|
1026
|
+
if (!BUILD5.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
974
1027
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
975
1028
|
}
|
|
976
1029
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
977
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1030
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
978
1031
|
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
979
1032
|
}
|
|
980
1033
|
}
|
|
@@ -996,7 +1049,7 @@ render() {
|
|
|
996
1049
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
997
1050
|
relocateNodes.length = 0;
|
|
998
1051
|
}
|
|
999
|
-
if (
|
|
1052
|
+
if (BUILD5.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1000
1053
|
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1001
1054
|
for (const childNode of children) {
|
|
1002
1055
|
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
@@ -1033,9 +1086,9 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
1033
1086
|
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
1034
1087
|
HostElementPrototype.cloneNode = function(deep) {
|
|
1035
1088
|
const srcNode = this;
|
|
1036
|
-
const isShadowDom =
|
|
1089
|
+
const isShadowDom = BUILD6.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
1037
1090
|
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
1038
|
-
if (
|
|
1091
|
+
if (BUILD6.slot && !isShadowDom && deep) {
|
|
1039
1092
|
let i2 = 0;
|
|
1040
1093
|
let slotted, nonStencilNode;
|
|
1041
1094
|
const stencilPrivates = [
|
|
@@ -1060,7 +1113,7 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
1060
1113
|
slotted = childNodes[i2]["s-nr"];
|
|
1061
1114
|
nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
1062
1115
|
if (slotted) {
|
|
1063
|
-
if (
|
|
1116
|
+
if (BUILD6.appendChildSlotFix && clonedNode.__appendChild) {
|
|
1064
1117
|
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
1065
1118
|
} else {
|
|
1066
1119
|
clonedNode.appendChild(slotted.cloneNode(true));
|
|
@@ -1078,7 +1131,7 @@ var patchSlotAppendChild = (HostElementPrototype) => {
|
|
|
1078
1131
|
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
1079
1132
|
HostElementPrototype.appendChild = function(newChild) {
|
|
1080
1133
|
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1081
|
-
const slotNode =
|
|
1134
|
+
const slotNode = getHostSlotNodes(this.__childNodes || this.childNodes, this.tagName, slotName)[0];
|
|
1082
1135
|
if (slotNode) {
|
|
1083
1136
|
addSlotRelocateNode(newChild, slotNode);
|
|
1084
1137
|
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
@@ -1095,7 +1148,7 @@ var patchSlotRemoveChild = (ElementPrototype) => {
|
|
|
1095
1148
|
ElementPrototype.removeChild = function(toRemove) {
|
|
1096
1149
|
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
1097
1150
|
const childNodes = this.__childNodes || this.childNodes;
|
|
1098
|
-
const slotNode =
|
|
1151
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
|
|
1099
1152
|
if (slotNode && toRemove.isConnected) {
|
|
1100
1153
|
toRemove.remove();
|
|
1101
1154
|
updateFallbackSlotVisibility(this);
|
|
@@ -1114,7 +1167,7 @@ var patchSlotPrepend = (HostElementPrototype) => {
|
|
|
1114
1167
|
}
|
|
1115
1168
|
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1116
1169
|
const childNodes = this.__childNodes || this.childNodes;
|
|
1117
|
-
const slotNode =
|
|
1170
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];
|
|
1118
1171
|
if (slotNode) {
|
|
1119
1172
|
addSlotRelocateNode(newChild, slotNode, true);
|
|
1120
1173
|
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
@@ -1332,77 +1385,12 @@ function patchHostOriginalAccessor(accessorName, node) {
|
|
|
1332
1385
|
}
|
|
1333
1386
|
if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
|
|
1334
1387
|
}
|
|
1335
|
-
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
1336
|
-
let slottedNodeLocation;
|
|
1337
|
-
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
1338
|
-
slottedNodeLocation = newChild["s-ol"];
|
|
1339
|
-
} else {
|
|
1340
|
-
slottedNodeLocation = document.createTextNode("");
|
|
1341
|
-
slottedNodeLocation["s-nr"] = newChild;
|
|
1342
|
-
}
|
|
1343
|
-
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
1344
|
-
const parent = slotNode["s-cr"].parentNode;
|
|
1345
|
-
const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
|
|
1346
|
-
if (typeof position !== "undefined") {
|
|
1347
|
-
if (BUILD5.hydrateClientSide) {
|
|
1348
|
-
slottedNodeLocation["s-oo"] = position;
|
|
1349
|
-
const childNodes = parent.__childNodes || parent.childNodes;
|
|
1350
|
-
const slotRelocateNodes = [slottedNodeLocation];
|
|
1351
|
-
childNodes.forEach((n) => {
|
|
1352
|
-
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
1353
|
-
});
|
|
1354
|
-
slotRelocateNodes.sort((a, b) => {
|
|
1355
|
-
if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
|
|
1356
|
-
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
1357
|
-
return 0;
|
|
1358
|
-
});
|
|
1359
|
-
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
1360
|
-
}
|
|
1361
|
-
} else {
|
|
1362
|
-
appendMethod.call(parent, slottedNodeLocation);
|
|
1363
|
-
}
|
|
1364
|
-
newChild["s-ol"] = slottedNodeLocation;
|
|
1365
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
1366
|
-
};
|
|
1367
|
-
var getSlottedChildNodes = (childNodes) => {
|
|
1368
|
-
const result = [];
|
|
1369
|
-
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
1370
|
-
const slottedNode = childNodes[i2]["s-nr"];
|
|
1371
|
-
if (slottedNode && slottedNode.isConnected) {
|
|
1372
|
-
result.push(slottedNode);
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
return result;
|
|
1376
|
-
};
|
|
1377
|
-
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
1378
|
-
var getHostSlotNode = (childNodes, slotName, hostName) => {
|
|
1379
|
-
let i2 = 0;
|
|
1380
|
-
let childNode;
|
|
1381
|
-
for (; i2 < childNodes.length; i2++) {
|
|
1382
|
-
childNode = childNodes[i2];
|
|
1383
|
-
if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) {
|
|
1384
|
-
return childNode;
|
|
1385
|
-
}
|
|
1386
|
-
childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
|
|
1387
|
-
if (childNode) {
|
|
1388
|
-
return childNode;
|
|
1389
|
-
}
|
|
1390
|
-
}
|
|
1391
|
-
return null;
|
|
1392
|
-
};
|
|
1393
|
-
var getHostSlotChildNodes = (n, slotName) => {
|
|
1394
|
-
const childNodes = [n];
|
|
1395
|
-
while ((n = n.nextSibling) && n["s-sn"] === slotName) {
|
|
1396
|
-
childNodes.push(n);
|
|
1397
|
-
}
|
|
1398
|
-
return childNodes;
|
|
1399
|
-
};
|
|
1400
1388
|
|
|
1401
1389
|
// src/runtime/profile.ts
|
|
1402
|
-
import { BUILD as
|
|
1390
|
+
import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
|
|
1403
1391
|
var i = 0;
|
|
1404
1392
|
var createTime = (fnName, tagName = "") => {
|
|
1405
|
-
if (
|
|
1393
|
+
if (BUILD7.profile && performance.mark) {
|
|
1406
1394
|
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
1407
1395
|
performance.mark(key);
|
|
1408
1396
|
return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
|
|
@@ -1413,7 +1401,7 @@ var createTime = (fnName, tagName = "") => {
|
|
|
1413
1401
|
}
|
|
1414
1402
|
};
|
|
1415
1403
|
var uniqueTime = (key, measureText) => {
|
|
1416
|
-
if (
|
|
1404
|
+
if (BUILD7.profile && performance.mark) {
|
|
1417
1405
|
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
1418
1406
|
performance.mark(key);
|
|
1419
1407
|
}
|
|
@@ -1471,7 +1459,7 @@ var inspect = (ref) => {
|
|
|
1471
1459
|
};
|
|
1472
1460
|
};
|
|
1473
1461
|
var installDevTools = () => {
|
|
1474
|
-
if (
|
|
1462
|
+
if (BUILD7.devTools) {
|
|
1475
1463
|
const stencil = win.stencil = win.stencil || {};
|
|
1476
1464
|
const originalInspect = stencil.inspect;
|
|
1477
1465
|
stencil.inspect = (ref) => {
|
|
@@ -1491,9 +1479,19 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1491
1479
|
const childRenderNodes = [];
|
|
1492
1480
|
const slotNodes = [];
|
|
1493
1481
|
const slottedNodes = [];
|
|
1494
|
-
const shadowRootNodes =
|
|
1482
|
+
const shadowRootNodes = BUILD8.shadowDom && shadowRoot ? [] : null;
|
|
1495
1483
|
const vnode = newVNode(tagName, null);
|
|
1496
1484
|
vnode.$elm$ = hostElm;
|
|
1485
|
+
let scopeId2;
|
|
1486
|
+
if (BUILD8.scoped) {
|
|
1487
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1488
|
+
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
1489
|
+
scopeId2 = hostElm["s-sc"];
|
|
1490
|
+
hostElm.classList.add(scopeId2 + "-h");
|
|
1491
|
+
} else if (hostElm["s-sc"]) {
|
|
1492
|
+
delete hostElm["s-sc"];
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1497
1495
|
if (!plt.$orgLocNodes$) {
|
|
1498
1496
|
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
1499
1497
|
}
|
|
@@ -1523,6 +1521,18 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1523
1521
|
node["s-cr"] = hostElm["s-cr"];
|
|
1524
1522
|
}
|
|
1525
1523
|
}
|
|
1524
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
1525
|
+
if (childRenderNode.$children$) {
|
|
1526
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
1527
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
1528
|
+
childRenderNode.$children$.forEach((c) => {
|
|
1529
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
1530
|
+
});
|
|
1531
|
+
}
|
|
1532
|
+
} else {
|
|
1533
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1526
1536
|
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
1527
1537
|
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
1528
1538
|
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
@@ -1535,8 +1545,8 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1535
1545
|
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1536
1546
|
}
|
|
1537
1547
|
const hosts = [];
|
|
1538
|
-
let snIndex = 0;
|
|
1539
1548
|
const snLen = slottedNodes.length;
|
|
1549
|
+
let snIndex = 0;
|
|
1540
1550
|
let slotGroup;
|
|
1541
1551
|
let snGroupIdx;
|
|
1542
1552
|
let snGroupLen;
|
|
@@ -1558,11 +1568,10 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1558
1568
|
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
1559
1569
|
slottedItem.slot["s-cr"] = hostEle;
|
|
1560
1570
|
} else {
|
|
1561
|
-
|
|
1562
|
-
slottedItem.slot["s-cr"] = hostChildren[0];
|
|
1571
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1563
1572
|
}
|
|
1564
1573
|
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1565
|
-
if (
|
|
1574
|
+
if (BUILD8.experimentalSlotFixes) {
|
|
1566
1575
|
patchNextPrev(slottedItem.node);
|
|
1567
1576
|
}
|
|
1568
1577
|
}
|
|
@@ -1571,7 +1580,12 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1571
1580
|
}
|
|
1572
1581
|
}
|
|
1573
1582
|
}
|
|
1574
|
-
if (
|
|
1583
|
+
if (BUILD8.scoped && scopeId2 && slotNodes.length) {
|
|
1584
|
+
slotNodes.forEach((slot) => {
|
|
1585
|
+
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
1586
|
+
});
|
|
1587
|
+
}
|
|
1588
|
+
if (BUILD8.shadowDom && shadowRoot) {
|
|
1575
1589
|
let rnIdex = 0;
|
|
1576
1590
|
const rnLen = shadowRootNodes.length;
|
|
1577
1591
|
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
@@ -1605,15 +1619,19 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1605
1619
|
$index$: childIdSplt[3],
|
|
1606
1620
|
$tag$: node.tagName.toLowerCase(),
|
|
1607
1621
|
$elm$: node,
|
|
1608
|
-
// If we don't add the initial classes to the VNode, the first `vdom-render.ts`
|
|
1609
|
-
//
|
|
1610
|
-
$attrs$: { class: node.className }
|
|
1622
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
1623
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
1624
|
+
$attrs$: { class: node.className || "" }
|
|
1611
1625
|
});
|
|
1612
1626
|
childRenderNodes.push(childVNode);
|
|
1613
1627
|
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
1614
1628
|
if (!parentVNode.$children$) {
|
|
1615
1629
|
parentVNode.$children$ = [];
|
|
1616
1630
|
}
|
|
1631
|
+
if (BUILD8.scoped && scopeId2) {
|
|
1632
|
+
node["s-si"] = scopeId2;
|
|
1633
|
+
childVNode.$attrs$.class += " " + scopeId2;
|
|
1634
|
+
}
|
|
1617
1635
|
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
1618
1636
|
if (typeof slotName === "string") {
|
|
1619
1637
|
if (childVNode.$tag$ === "slot-fb") {
|
|
@@ -1628,6 +1646,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1628
1646
|
shadowRootNodes,
|
|
1629
1647
|
slottedNodes
|
|
1630
1648
|
);
|
|
1649
|
+
if (BUILD8.scoped && scopeId2) {
|
|
1650
|
+
node.classList.add(scopeId2);
|
|
1651
|
+
}
|
|
1631
1652
|
}
|
|
1632
1653
|
childVNode.$elm$["s-sn"] = slotName;
|
|
1633
1654
|
childVNode.$elm$.removeAttribute("s-sn");
|
|
@@ -1635,7 +1656,6 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1635
1656
|
if (childVNode.$index$ !== void 0) {
|
|
1636
1657
|
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1637
1658
|
}
|
|
1638
|
-
if (scopeId2) node["s-si"] = scopeId2;
|
|
1639
1659
|
parentVNode = childVNode;
|
|
1640
1660
|
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1641
1661
|
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
@@ -1710,8 +1730,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1710
1730
|
}
|
|
1711
1731
|
} else if (childVNode.$hostId$ === hostId) {
|
|
1712
1732
|
if (childNodeType === SLOT_NODE_ID) {
|
|
1713
|
-
|
|
1714
|
-
const slotName = node["s-sn"] = childVNode.$name$ = childIdSplt[5] || "";
|
|
1733
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
1715
1734
|
addSlot(
|
|
1716
1735
|
slotName,
|
|
1717
1736
|
childIdSplt[2],
|
|
@@ -1724,9 +1743,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1724
1743
|
slottedNodes
|
|
1725
1744
|
);
|
|
1726
1745
|
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1727
|
-
if (
|
|
1746
|
+
if (BUILD8.shadowDom && shadowRootNodes) {
|
|
1728
1747
|
node.remove();
|
|
1729
|
-
} else if (
|
|
1748
|
+
} else if (BUILD8.slotRelocation) {
|
|
1730
1749
|
hostElm["s-cr"] = node;
|
|
1731
1750
|
node["s-cn"] = true;
|
|
1732
1751
|
}
|
|
@@ -1785,8 +1804,10 @@ var createSimpleVNode = (vnode) => {
|
|
|
1785
1804
|
};
|
|
1786
1805
|
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
1787
1806
|
node["s-sr"] = true;
|
|
1807
|
+
childVNode.$name$ = slotName || null;
|
|
1808
|
+
childVNode.$tag$ = "slot";
|
|
1788
1809
|
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1789
|
-
if (
|
|
1810
|
+
if (BUILD8.shadowDom && shadowRootNodes) {
|
|
1790
1811
|
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
1791
1812
|
if (childVNode.$name$) {
|
|
1792
1813
|
childVNode.$elm$.setAttribute("name", slotName);
|
|
@@ -1827,7 +1848,7 @@ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) =>
|
|
|
1827
1848
|
};
|
|
1828
1849
|
|
|
1829
1850
|
// src/runtime/initialize-component.ts
|
|
1830
|
-
import { BUILD as
|
|
1851
|
+
import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
|
|
1831
1852
|
|
|
1832
1853
|
// src/runtime/mode.ts
|
|
1833
1854
|
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
@@ -1835,22 +1856,22 @@ var setMode = (handler) => modeResolutionChain.push(handler);
|
|
|
1835
1856
|
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
1836
1857
|
|
|
1837
1858
|
// src/runtime/proxy-component.ts
|
|
1838
|
-
import { BUILD as
|
|
1859
|
+
import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
|
|
1839
1860
|
|
|
1840
1861
|
// src/runtime/set-value.ts
|
|
1841
|
-
import { BUILD as
|
|
1862
|
+
import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
|
|
1842
1863
|
|
|
1843
1864
|
// src/runtime/parse-property-value.ts
|
|
1844
|
-
import { BUILD as
|
|
1865
|
+
import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
|
|
1845
1866
|
var parsePropertyValue = (propValue, propType) => {
|
|
1846
1867
|
if (propValue != null && !isComplexType(propValue)) {
|
|
1847
|
-
if (
|
|
1868
|
+
if (BUILD9.propBoolean && propType & 4 /* Boolean */) {
|
|
1848
1869
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1849
1870
|
}
|
|
1850
|
-
if (
|
|
1871
|
+
if (BUILD9.propNumber && propType & 2 /* Number */) {
|
|
1851
1872
|
return parseFloat(propValue);
|
|
1852
1873
|
}
|
|
1853
|
-
if (
|
|
1874
|
+
if (BUILD9.propString && propType & 1 /* String */) {
|
|
1854
1875
|
return String(propValue);
|
|
1855
1876
|
}
|
|
1856
1877
|
return propValue;
|
|
@@ -1859,21 +1880,21 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
1859
1880
|
};
|
|
1860
1881
|
|
|
1861
1882
|
// src/runtime/update-component.ts
|
|
1862
|
-
import { BUILD as
|
|
1883
|
+
import { BUILD as BUILD13, NAMESPACE } from "@stencil/core/internal/app-data";
|
|
1863
1884
|
|
|
1864
1885
|
// src/runtime/event-emitter.ts
|
|
1865
|
-
import { BUILD as
|
|
1886
|
+
import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
|
|
1866
1887
|
|
|
1867
1888
|
// src/runtime/element.ts
|
|
1868
|
-
import { BUILD as
|
|
1869
|
-
var getElement = (ref) =>
|
|
1889
|
+
import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
|
|
1890
|
+
var getElement = (ref) => BUILD10.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
1870
1891
|
|
|
1871
1892
|
// src/runtime/event-emitter.ts
|
|
1872
1893
|
var createEvent = (ref, name, flags) => {
|
|
1873
1894
|
const elm = getElement(ref);
|
|
1874
1895
|
return {
|
|
1875
1896
|
emit: (detail) => {
|
|
1876
|
-
if (
|
|
1897
|
+
if (BUILD11.isDev && !elm.isConnected) {
|
|
1877
1898
|
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
1878
1899
|
}
|
|
1879
1900
|
return emitEvent(elm, name, {
|
|
@@ -1892,7 +1913,7 @@ var emitEvent = (elm, name, opts) => {
|
|
|
1892
1913
|
};
|
|
1893
1914
|
|
|
1894
1915
|
// src/runtime/styles.ts
|
|
1895
|
-
import { BUILD as
|
|
1916
|
+
import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
|
|
1896
1917
|
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
1897
1918
|
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
1898
1919
|
let style = styles.get(scopeId2);
|
|
@@ -1912,7 +1933,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1912
1933
|
var _a;
|
|
1913
1934
|
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
1914
1935
|
const style = styles.get(scopeId2);
|
|
1915
|
-
if (!
|
|
1936
|
+
if (!BUILD12.attachStyles) {
|
|
1916
1937
|
return scopeId2;
|
|
1917
1938
|
}
|
|
1918
1939
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -1925,16 +1946,16 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1925
1946
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
1926
1947
|
}
|
|
1927
1948
|
if (!appliedStyles.has(scopeId2)) {
|
|
1928
|
-
if (
|
|
1949
|
+
if (BUILD12.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
1929
1950
|
styleElm.innerHTML = style;
|
|
1930
1951
|
} else {
|
|
1931
|
-
styleElm = doc.createElement("style");
|
|
1952
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
1932
1953
|
styleElm.innerHTML = style;
|
|
1933
1954
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
1934
1955
|
if (nonce != null) {
|
|
1935
1956
|
styleElm.setAttribute("nonce", nonce);
|
|
1936
1957
|
}
|
|
1937
|
-
if ((
|
|
1958
|
+
if ((BUILD12.hydrateServerSide || BUILD12.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1938
1959
|
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
1939
1960
|
}
|
|
1940
1961
|
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
@@ -1970,7 +1991,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1970
1991
|
appliedStyles.add(scopeId2);
|
|
1971
1992
|
}
|
|
1972
1993
|
}
|
|
1973
|
-
} else if (
|
|
1994
|
+
} else if (BUILD12.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
1974
1995
|
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
1975
1996
|
}
|
|
1976
1997
|
}
|
|
@@ -1982,43 +2003,40 @@ var attachStyles = (hostRef) => {
|
|
|
1982
2003
|
const flags = cmpMeta.$flags$;
|
|
1983
2004
|
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
1984
2005
|
const scopeId2 = addStyle(
|
|
1985
|
-
|
|
2006
|
+
BUILD12.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
1986
2007
|
cmpMeta,
|
|
1987
2008
|
hostRef.$modeName$
|
|
1988
2009
|
);
|
|
1989
|
-
if ((
|
|
2010
|
+
if ((BUILD12.shadowDom || BUILD12.scoped) && BUILD12.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
1990
2011
|
elm["s-sc"] = scopeId2;
|
|
1991
2012
|
elm.classList.add(scopeId2 + "-h");
|
|
1992
|
-
if (BUILD11.scoped && flags & 2 /* scopedCssEncapsulation */) {
|
|
1993
|
-
elm.classList.add(scopeId2 + "-s");
|
|
1994
|
-
}
|
|
1995
2013
|
}
|
|
1996
2014
|
endAttachStyles();
|
|
1997
2015
|
};
|
|
1998
|
-
var getScopeId = (cmp, mode) => "sc-" + (
|
|
2016
|
+
var getScopeId = (cmp, mode) => "sc-" + (BUILD12.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
1999
2017
|
|
|
2000
2018
|
// src/runtime/update-component.ts
|
|
2001
2019
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
2002
|
-
if (
|
|
2020
|
+
if (BUILD13.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
2003
2021
|
ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
|
|
2004
2022
|
}
|
|
2005
2023
|
};
|
|
2006
2024
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
2007
|
-
if (
|
|
2025
|
+
if (BUILD13.taskQueue && BUILD13.updatable) {
|
|
2008
2026
|
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
2009
2027
|
}
|
|
2010
|
-
if (
|
|
2028
|
+
if (BUILD13.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
2011
2029
|
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
2012
2030
|
return;
|
|
2013
2031
|
}
|
|
2014
2032
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
2015
2033
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
2016
|
-
return
|
|
2034
|
+
return BUILD13.taskQueue ? writeTask(dispatch) : dispatch();
|
|
2017
2035
|
};
|
|
2018
2036
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
2019
2037
|
const elm = hostRef.$hostElement$;
|
|
2020
2038
|
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
2021
|
-
const instance =
|
|
2039
|
+
const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2022
2040
|
if (!instance) {
|
|
2023
2041
|
throw new Error(
|
|
2024
2042
|
`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`
|
|
@@ -2026,7 +2044,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2026
2044
|
}
|
|
2027
2045
|
let maybePromise;
|
|
2028
2046
|
if (isInitialLoad) {
|
|
2029
|
-
if (
|
|
2047
|
+
if (BUILD13.lazyLoad && BUILD13.hostListener) {
|
|
2030
2048
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
2031
2049
|
if (hostRef.$queuedListeners$) {
|
|
2032
2050
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
@@ -2034,17 +2052,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2034
2052
|
}
|
|
2035
2053
|
}
|
|
2036
2054
|
emitLifecycleEvent(elm, "componentWillLoad");
|
|
2037
|
-
if (
|
|
2055
|
+
if (BUILD13.cmpWillLoad) {
|
|
2038
2056
|
maybePromise = safeCall(instance, "componentWillLoad");
|
|
2039
2057
|
}
|
|
2040
2058
|
} else {
|
|
2041
2059
|
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
2042
|
-
if (
|
|
2060
|
+
if (BUILD13.cmpWillUpdate) {
|
|
2043
2061
|
maybePromise = safeCall(instance, "componentWillUpdate");
|
|
2044
2062
|
}
|
|
2045
2063
|
}
|
|
2046
2064
|
emitLifecycleEvent(elm, "componentWillRender");
|
|
2047
|
-
if (
|
|
2065
|
+
if (BUILD13.cmpWillRender) {
|
|
2048
2066
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
2049
2067
|
}
|
|
2050
2068
|
endSchedule();
|
|
@@ -2060,23 +2078,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2060
2078
|
const elm = hostRef.$hostElement$;
|
|
2061
2079
|
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
2062
2080
|
const rc = elm["s-rc"];
|
|
2063
|
-
if (
|
|
2081
|
+
if (BUILD13.style && isInitialLoad) {
|
|
2064
2082
|
attachStyles(hostRef);
|
|
2065
2083
|
}
|
|
2066
2084
|
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
2067
|
-
if (
|
|
2085
|
+
if (BUILD13.isDev) {
|
|
2068
2086
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2069
2087
|
}
|
|
2070
|
-
if (
|
|
2088
|
+
if (BUILD13.hydrateServerSide) {
|
|
2071
2089
|
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
2072
2090
|
} else {
|
|
2073
2091
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
2074
2092
|
}
|
|
2075
|
-
if (
|
|
2093
|
+
if (BUILD13.isDev) {
|
|
2076
2094
|
hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
|
|
2077
2095
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2078
2096
|
}
|
|
2079
|
-
if (
|
|
2097
|
+
if (BUILD13.hydrateServerSide) {
|
|
2080
2098
|
try {
|
|
2081
2099
|
serverSideConnected(elm);
|
|
2082
2100
|
if (isInitialLoad) {
|
|
@@ -2090,13 +2108,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2090
2108
|
consoleError(e, elm);
|
|
2091
2109
|
}
|
|
2092
2110
|
}
|
|
2093
|
-
if (
|
|
2111
|
+
if (BUILD13.asyncLoading && rc) {
|
|
2094
2112
|
rc.map((cb) => cb());
|
|
2095
2113
|
elm["s-rc"] = void 0;
|
|
2096
2114
|
}
|
|
2097
2115
|
endRender();
|
|
2098
2116
|
endUpdate();
|
|
2099
|
-
if (
|
|
2117
|
+
if (BUILD13.asyncLoading) {
|
|
2100
2118
|
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
2101
2119
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
2102
2120
|
if (childrenPromises.length === 0) {
|
|
@@ -2112,10 +2130,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2112
2130
|
};
|
|
2113
2131
|
var renderingRef = null;
|
|
2114
2132
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
2115
|
-
const allRenderFn =
|
|
2116
|
-
const lazyLoad =
|
|
2117
|
-
const taskQueue =
|
|
2118
|
-
const updatable =
|
|
2133
|
+
const allRenderFn = BUILD13.allRenderFn ? true : false;
|
|
2134
|
+
const lazyLoad = BUILD13.lazyLoad ? true : false;
|
|
2135
|
+
const taskQueue = BUILD13.taskQueue ? true : false;
|
|
2136
|
+
const updatable = BUILD13.updatable ? true : false;
|
|
2119
2137
|
try {
|
|
2120
2138
|
renderingRef = instance;
|
|
2121
2139
|
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
@@ -2125,9 +2143,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
2125
2143
|
if (updatable || lazyLoad) {
|
|
2126
2144
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
2127
2145
|
}
|
|
2128
|
-
if (
|
|
2129
|
-
if (
|
|
2130
|
-
if (
|
|
2146
|
+
if (BUILD13.hasRenderFn || BUILD13.reflect) {
|
|
2147
|
+
if (BUILD13.vdomRender || BUILD13.reflect) {
|
|
2148
|
+
if (BUILD13.hydrateServerSide) {
|
|
2131
2149
|
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
2132
2150
|
} else {
|
|
2133
2151
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
@@ -2152,57 +2170,57 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2152
2170
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
2153
2171
|
const elm = hostRef.$hostElement$;
|
|
2154
2172
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
2155
|
-
const instance =
|
|
2173
|
+
const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2156
2174
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2157
|
-
if (
|
|
2158
|
-
if (
|
|
2175
|
+
if (BUILD13.cmpDidRender) {
|
|
2176
|
+
if (BUILD13.isDev) {
|
|
2159
2177
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2160
2178
|
}
|
|
2161
2179
|
safeCall(instance, "componentDidRender");
|
|
2162
|
-
if (
|
|
2180
|
+
if (BUILD13.isDev) {
|
|
2163
2181
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2164
2182
|
}
|
|
2165
2183
|
}
|
|
2166
2184
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
2167
2185
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
2168
2186
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
2169
|
-
if (
|
|
2187
|
+
if (BUILD13.asyncLoading && BUILD13.cssAnnotations) {
|
|
2170
2188
|
addHydratedFlag(elm);
|
|
2171
2189
|
}
|
|
2172
|
-
if (
|
|
2173
|
-
if (
|
|
2190
|
+
if (BUILD13.cmpDidLoad) {
|
|
2191
|
+
if (BUILD13.isDev) {
|
|
2174
2192
|
hostRef.$flags$ |= 2048 /* devOnDidLoad */;
|
|
2175
2193
|
}
|
|
2176
2194
|
safeCall(instance, "componentDidLoad");
|
|
2177
|
-
if (
|
|
2195
|
+
if (BUILD13.isDev) {
|
|
2178
2196
|
hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
|
|
2179
2197
|
}
|
|
2180
2198
|
}
|
|
2181
2199
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
2182
2200
|
endPostUpdate();
|
|
2183
|
-
if (
|
|
2201
|
+
if (BUILD13.asyncLoading) {
|
|
2184
2202
|
hostRef.$onReadyResolve$(elm);
|
|
2185
2203
|
if (!ancestorComponent) {
|
|
2186
2204
|
appDidLoad(tagName);
|
|
2187
2205
|
}
|
|
2188
2206
|
}
|
|
2189
2207
|
} else {
|
|
2190
|
-
if (
|
|
2191
|
-
if (
|
|
2208
|
+
if (BUILD13.cmpDidUpdate) {
|
|
2209
|
+
if (BUILD13.isDev) {
|
|
2192
2210
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2193
2211
|
}
|
|
2194
2212
|
safeCall(instance, "componentDidUpdate");
|
|
2195
|
-
if (
|
|
2213
|
+
if (BUILD13.isDev) {
|
|
2196
2214
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2197
2215
|
}
|
|
2198
2216
|
}
|
|
2199
2217
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
2200
2218
|
endPostUpdate();
|
|
2201
2219
|
}
|
|
2202
|
-
if (
|
|
2220
|
+
if (BUILD13.method && BUILD13.lazyLoad) {
|
|
2203
2221
|
hostRef.$onInstanceResolve$(elm);
|
|
2204
2222
|
}
|
|
2205
|
-
if (
|
|
2223
|
+
if (BUILD13.asyncLoading) {
|
|
2206
2224
|
if (hostRef.$onRenderResolve$) {
|
|
2207
2225
|
hostRef.$onRenderResolve$();
|
|
2208
2226
|
hostRef.$onRenderResolve$ = void 0;
|
|
@@ -2214,7 +2232,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2214
2232
|
}
|
|
2215
2233
|
};
|
|
2216
2234
|
var forceUpdate = (ref) => {
|
|
2217
|
-
if (
|
|
2235
|
+
if (BUILD13.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
2218
2236
|
const hostRef = getHostRef(ref);
|
|
2219
2237
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
2220
2238
|
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
@@ -2225,14 +2243,14 @@ var forceUpdate = (ref) => {
|
|
|
2225
2243
|
return false;
|
|
2226
2244
|
};
|
|
2227
2245
|
var appDidLoad = (who) => {
|
|
2228
|
-
if (
|
|
2246
|
+
if (BUILD13.cssAnnotations) {
|
|
2229
2247
|
addHydratedFlag(doc.documentElement);
|
|
2230
2248
|
}
|
|
2231
|
-
if (
|
|
2249
|
+
if (BUILD13.asyncQueue) {
|
|
2232
2250
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2233
2251
|
}
|
|
2234
2252
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
2235
|
-
if (
|
|
2253
|
+
if (BUILD13.profile && performance.measure) {
|
|
2236
2254
|
performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
2237
2255
|
}
|
|
2238
2256
|
};
|
|
@@ -2247,7 +2265,7 @@ var safeCall = (instance, method, arg) => {
|
|
|
2247
2265
|
return void 0;
|
|
2248
2266
|
};
|
|
2249
2267
|
var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
2250
|
-
if (
|
|
2268
|
+
if (BUILD13.lifecycleDOMEvents) {
|
|
2251
2269
|
emitEvent(elm, "stencil_" + lifecycleName, {
|
|
2252
2270
|
bubbles: true,
|
|
2253
2271
|
composed: true,
|
|
@@ -2259,7 +2277,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
|
2259
2277
|
};
|
|
2260
2278
|
var addHydratedFlag = (elm) => {
|
|
2261
2279
|
var _a, _b;
|
|
2262
|
-
return
|
|
2280
|
+
return BUILD13.hydratedClass ? elm.classList.add((_a = BUILD13.hydratedSelectorName) != null ? _a : "hydrated") : BUILD13.hydratedAttribute ? elm.setAttribute((_b = BUILD13.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
|
|
2263
2281
|
};
|
|
2264
2282
|
var serverSideConnected = (elm) => {
|
|
2265
2283
|
const children = elm.children;
|
|
@@ -2278,21 +2296,21 @@ var serverSideConnected = (elm) => {
|
|
|
2278
2296
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
2279
2297
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
2280
2298
|
const hostRef = getHostRef(ref);
|
|
2281
|
-
if (
|
|
2299
|
+
if (BUILD14.lazyLoad && !hostRef) {
|
|
2282
2300
|
throw new Error(
|
|
2283
2301
|
`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).`
|
|
2284
2302
|
);
|
|
2285
2303
|
}
|
|
2286
|
-
const elm =
|
|
2304
|
+
const elm = BUILD14.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
2287
2305
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
2288
2306
|
const flags = hostRef.$flags$;
|
|
2289
|
-
const instance =
|
|
2307
|
+
const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2290
2308
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
2291
2309
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
2292
2310
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
2293
|
-
if ((!
|
|
2311
|
+
if ((!BUILD14.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
2294
2312
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
2295
|
-
if (
|
|
2313
|
+
if (BUILD14.isDev) {
|
|
2296
2314
|
if (hostRef.$flags$ & 1024 /* devOnRender */) {
|
|
2297
2315
|
consoleDevWarn(
|
|
2298
2316
|
`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
|
|
@@ -2315,8 +2333,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2315
2333
|
);
|
|
2316
2334
|
}
|
|
2317
2335
|
}
|
|
2318
|
-
if (!
|
|
2319
|
-
if (
|
|
2336
|
+
if (!BUILD14.lazyLoad || instance) {
|
|
2337
|
+
if (BUILD14.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
2320
2338
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
2321
2339
|
if (watchMethods) {
|
|
2322
2340
|
watchMethods.map((watchMethodName) => {
|
|
@@ -2328,8 +2346,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2328
2346
|
});
|
|
2329
2347
|
}
|
|
2330
2348
|
}
|
|
2331
|
-
if (
|
|
2332
|
-
if (
|
|
2349
|
+
if (BUILD14.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
2350
|
+
if (BUILD14.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
2333
2351
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2334
2352
|
return;
|
|
2335
2353
|
}
|
|
@@ -2344,40 +2362,40 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2344
2362
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2345
2363
|
var _a, _b;
|
|
2346
2364
|
const prototype = Cstr.prototype;
|
|
2347
|
-
if (
|
|
2365
|
+
if (BUILD15.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
2348
2366
|
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2349
2367
|
const originalFormAssociatedCallback = prototype[cbName];
|
|
2350
2368
|
Object.defineProperty(prototype, cbName, {
|
|
2351
2369
|
value(...args) {
|
|
2352
2370
|
const hostRef = getHostRef(this);
|
|
2353
|
-
const instance =
|
|
2371
|
+
const instance = BUILD15.lazyLoad ? hostRef.$lazyInstance$ : this;
|
|
2354
2372
|
if (!instance) {
|
|
2355
2373
|
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2356
2374
|
const cb = asyncInstance[cbName];
|
|
2357
2375
|
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
2358
2376
|
});
|
|
2359
2377
|
} else {
|
|
2360
|
-
const cb =
|
|
2378
|
+
const cb = BUILD15.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
|
|
2361
2379
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
2362
2380
|
}
|
|
2363
2381
|
}
|
|
2364
2382
|
});
|
|
2365
2383
|
});
|
|
2366
2384
|
}
|
|
2367
|
-
if (
|
|
2368
|
-
if (
|
|
2385
|
+
if (BUILD15.member && cmpMeta.$members$ || BUILD15.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
2386
|
+
if (BUILD15.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
|
|
2369
2387
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2370
2388
|
}
|
|
2371
2389
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
2372
2390
|
members.map(([memberName, [memberFlags]]) => {
|
|
2373
|
-
if ((
|
|
2391
|
+
if ((BUILD15.prop || BUILD15.state) && (memberFlags & 31 /* Prop */ || (!BUILD15.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2374
2392
|
if ((memberFlags & 2048 /* Getter */) === 0) {
|
|
2375
2393
|
Object.defineProperty(prototype, memberName, {
|
|
2376
2394
|
get() {
|
|
2377
2395
|
return getValue(this, memberName);
|
|
2378
2396
|
},
|
|
2379
2397
|
set(newValue) {
|
|
2380
|
-
if (
|
|
2398
|
+
if (BUILD15.isDev) {
|
|
2381
2399
|
const ref = getHostRef(this);
|
|
2382
2400
|
if (
|
|
2383
2401
|
// we are proxying the instance (not element)
|
|
@@ -2398,11 +2416,11 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2398
2416
|
enumerable: true
|
|
2399
2417
|
});
|
|
2400
2418
|
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
|
|
2401
|
-
if (
|
|
2419
|
+
if (BUILD15.lazyLoad) {
|
|
2402
2420
|
Object.defineProperty(prototype, memberName, {
|
|
2403
2421
|
get() {
|
|
2404
2422
|
const ref = getHostRef(this);
|
|
2405
|
-
const instance =
|
|
2423
|
+
const instance = BUILD15.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
|
|
2406
2424
|
if (!instance) return;
|
|
2407
2425
|
return instance[memberName];
|
|
2408
2426
|
},
|
|
@@ -2442,7 +2460,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2442
2460
|
});
|
|
2443
2461
|
}
|
|
2444
2462
|
}
|
|
2445
|
-
} else if (
|
|
2463
|
+
} else if (BUILD15.lazyLoad && BUILD15.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
2446
2464
|
Object.defineProperty(prototype, memberName, {
|
|
2447
2465
|
value(...args) {
|
|
2448
2466
|
var _a2;
|
|
@@ -2455,13 +2473,13 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2455
2473
|
});
|
|
2456
2474
|
}
|
|
2457
2475
|
});
|
|
2458
|
-
if (
|
|
2476
|
+
if (BUILD15.observeAttribute && (!BUILD15.lazyLoad || flags & 1 /* isElementConstructor */)) {
|
|
2459
2477
|
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
2460
2478
|
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
2461
2479
|
plt.jmp(() => {
|
|
2462
2480
|
var _a2;
|
|
2463
2481
|
const propName = attrNameToPropName.get(attrName);
|
|
2464
|
-
if (this.hasOwnProperty(propName)) {
|
|
2482
|
+
if (this.hasOwnProperty(propName) && BUILD15.lazyLoad) {
|
|
2465
2483
|
newValue = this[propName];
|
|
2466
2484
|
delete this[propName];
|
|
2467
2485
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -2471,8 +2489,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2471
2489
|
const hostRef = getHostRef(this);
|
|
2472
2490
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
2473
2491
|
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
2474
|
-
const elm =
|
|
2475
|
-
const instance =
|
|
2492
|
+
const elm = BUILD15.lazyLoad ? hostRef.$hostElement$ : this;
|
|
2493
|
+
const instance = BUILD15.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2476
2494
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
2477
2495
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
2478
2496
|
if (instance[callbackName] != null) {
|
|
@@ -2495,7 +2513,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2495
2513
|
var _a2;
|
|
2496
2514
|
const attrName = m[1] || propName;
|
|
2497
2515
|
attrNameToPropName.set(attrName, propName);
|
|
2498
|
-
if (
|
|
2516
|
+
if (BUILD15.reflect && m[0] & 512 /* ReflectAttr */) {
|
|
2499
2517
|
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
2500
2518
|
}
|
|
2501
2519
|
return attrName;
|
|
@@ -2513,7 +2531,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2513
2531
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
2514
2532
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
2515
2533
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
2516
|
-
if ((
|
|
2534
|
+
if ((BUILD16.lazyLoad || BUILD16.hydrateClientSide) && bundleId) {
|
|
2517
2535
|
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
2518
2536
|
if (CstrImport && "then" in CstrImport) {
|
|
2519
2537
|
const endLoad = uniqueTime(
|
|
@@ -2528,15 +2546,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2528
2546
|
if (!Cstr) {
|
|
2529
2547
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2530
2548
|
}
|
|
2531
|
-
if (
|
|
2532
|
-
if (
|
|
2549
|
+
if (BUILD16.member && !Cstr.isProxied) {
|
|
2550
|
+
if (BUILD16.watchCallback) {
|
|
2533
2551
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2534
2552
|
}
|
|
2535
2553
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
2536
2554
|
Cstr.isProxied = true;
|
|
2537
2555
|
}
|
|
2538
2556
|
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
2539
|
-
if (
|
|
2557
|
+
if (BUILD16.member) {
|
|
2540
2558
|
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
2541
2559
|
}
|
|
2542
2560
|
try {
|
|
@@ -2544,10 +2562,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2544
2562
|
} catch (e) {
|
|
2545
2563
|
consoleError(e);
|
|
2546
2564
|
}
|
|
2547
|
-
if (
|
|
2565
|
+
if (BUILD16.member) {
|
|
2548
2566
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
2549
2567
|
}
|
|
2550
|
-
if (
|
|
2568
|
+
if (BUILD16.watchCallback) {
|
|
2551
2569
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
2552
2570
|
}
|
|
2553
2571
|
endNewInstance();
|
|
@@ -2557,24 +2575,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2557
2575
|
const cmpTag = elm.localName;
|
|
2558
2576
|
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
2559
2577
|
}
|
|
2560
|
-
if (
|
|
2578
|
+
if (BUILD16.style && Cstr && Cstr.style) {
|
|
2561
2579
|
let style;
|
|
2562
2580
|
if (typeof Cstr.style === "string") {
|
|
2563
2581
|
style = Cstr.style;
|
|
2564
|
-
} else if (
|
|
2582
|
+
} else if (BUILD16.mode && typeof Cstr.style !== "string") {
|
|
2565
2583
|
hostRef.$modeName$ = computeMode(elm);
|
|
2566
2584
|
if (hostRef.$modeName$) {
|
|
2567
2585
|
style = Cstr.style[hostRef.$modeName$];
|
|
2568
2586
|
}
|
|
2569
|
-
if (
|
|
2587
|
+
if (BUILD16.hydrateServerSide && hostRef.$modeName$) {
|
|
2570
2588
|
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
2571
2589
|
}
|
|
2572
2590
|
}
|
|
2573
2591
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2574
2592
|
if (!styles.has(scopeId2)) {
|
|
2575
2593
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
2576
|
-
if (!
|
|
2577
|
-
|
|
2594
|
+
if (!BUILD16.hydrateServerSide && BUILD16.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2595
|
+
BUILD16.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2578
2596
|
style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
|
|
2579
2597
|
}
|
|
2580
2598
|
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
@@ -2584,14 +2602,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2584
2602
|
}
|
|
2585
2603
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2586
2604
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2587
|
-
if (
|
|
2605
|
+
if (BUILD16.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
2588
2606
|
ancestorComponent["s-rc"].push(schedule);
|
|
2589
2607
|
} else {
|
|
2590
2608
|
schedule();
|
|
2591
2609
|
}
|
|
2592
2610
|
};
|
|
2593
2611
|
var fireConnectedCallback = (instance) => {
|
|
2594
|
-
if (
|
|
2612
|
+
if (BUILD16.lazyLoad && BUILD16.connectedCallback) {
|
|
2595
2613
|
safeCall(instance, "connectedCallback");
|
|
2596
2614
|
}
|
|
2597
2615
|
};
|
|
@@ -2602,41 +2620,41 @@ var connectedCallback = (elm) => {
|
|
|
2602
2620
|
const hostRef = getHostRef(elm);
|
|
2603
2621
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2604
2622
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
2605
|
-
if (
|
|
2623
|
+
if (BUILD17.hostListenerTargetParent) {
|
|
2606
2624
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2607
2625
|
}
|
|
2608
2626
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
2609
2627
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2610
2628
|
let hostId;
|
|
2611
|
-
if (
|
|
2629
|
+
if (BUILD17.hydrateClientSide) {
|
|
2612
2630
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2613
2631
|
if (hostId) {
|
|
2614
|
-
if (
|
|
2615
|
-
const scopeId2 =
|
|
2632
|
+
if (BUILD17.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2633
|
+
const scopeId2 = BUILD17.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
|
|
2616
2634
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2617
|
-
} else if (
|
|
2618
|
-
const scopeId2 = getScopeId(cmpMeta,
|
|
2635
|
+
} else if (BUILD17.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2636
|
+
const scopeId2 = getScopeId(cmpMeta, BUILD17.mode ? elm.getAttribute("s-mode") : void 0);
|
|
2619
2637
|
elm["s-sc"] = scopeId2;
|
|
2620
2638
|
}
|
|
2621
2639
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2622
2640
|
}
|
|
2623
2641
|
}
|
|
2624
|
-
if (
|
|
2625
|
-
if (
|
|
2642
|
+
if (BUILD17.slotRelocation && !hostId) {
|
|
2643
|
+
if (BUILD17.hydrateServerSide || (BUILD17.slot || BUILD17.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2626
2644
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
2627
2645
|
setContentReference(elm);
|
|
2628
2646
|
}
|
|
2629
2647
|
}
|
|
2630
|
-
if (
|
|
2648
|
+
if (BUILD17.asyncLoading) {
|
|
2631
2649
|
let ancestorComponent = elm;
|
|
2632
2650
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
2633
|
-
if (
|
|
2651
|
+
if (BUILD17.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
2634
2652
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
2635
2653
|
break;
|
|
2636
2654
|
}
|
|
2637
2655
|
}
|
|
2638
2656
|
}
|
|
2639
|
-
if (
|
|
2657
|
+
if (BUILD17.prop && !BUILD17.hydrateServerSide && cmpMeta.$members$) {
|
|
2640
2658
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2641
2659
|
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2642
2660
|
const value = elm[memberName];
|
|
@@ -2645,7 +2663,7 @@ var connectedCallback = (elm) => {
|
|
|
2645
2663
|
}
|
|
2646
2664
|
});
|
|
2647
2665
|
}
|
|
2648
|
-
if (
|
|
2666
|
+
if (BUILD17.initializeNextTick) {
|
|
2649
2667
|
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2650
2668
|
} else {
|
|
2651
2669
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
@@ -2663,32 +2681,32 @@ var connectedCallback = (elm) => {
|
|
|
2663
2681
|
};
|
|
2664
2682
|
var setContentReference = (elm) => {
|
|
2665
2683
|
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
2666
|
-
|
|
2684
|
+
BUILD17.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
2667
2685
|
);
|
|
2668
2686
|
contentRefElm["s-cn"] = true;
|
|
2669
2687
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
2670
2688
|
};
|
|
2671
2689
|
|
|
2672
2690
|
// src/runtime/disconnected-callback.ts
|
|
2673
|
-
import { BUILD as
|
|
2691
|
+
import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
|
|
2674
2692
|
var disconnectInstance = (instance) => {
|
|
2675
|
-
if (
|
|
2693
|
+
if (BUILD18.lazyLoad && BUILD18.disconnectedCallback) {
|
|
2676
2694
|
safeCall(instance, "disconnectedCallback");
|
|
2677
2695
|
}
|
|
2678
|
-
if (
|
|
2696
|
+
if (BUILD18.cmpDidUnload) {
|
|
2679
2697
|
safeCall(instance, "componentDidUnload");
|
|
2680
2698
|
}
|
|
2681
2699
|
};
|
|
2682
2700
|
var disconnectedCallback = async (elm) => {
|
|
2683
2701
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2684
2702
|
const hostRef = getHostRef(elm);
|
|
2685
|
-
if (
|
|
2703
|
+
if (BUILD18.hostListener) {
|
|
2686
2704
|
if (hostRef.$rmListeners$) {
|
|
2687
2705
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2688
2706
|
hostRef.$rmListeners$ = void 0;
|
|
2689
2707
|
}
|
|
2690
2708
|
}
|
|
2691
|
-
if (!
|
|
2709
|
+
if (!BUILD18.lazyLoad) {
|
|
2692
2710
|
disconnectInstance(elm);
|
|
2693
2711
|
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2694
2712
|
disconnectInstance(hostRef.$lazyInstance$);
|
|
@@ -2707,36 +2725,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2707
2725
|
$flags$: compactMeta[0],
|
|
2708
2726
|
$tagName$: compactMeta[1]
|
|
2709
2727
|
};
|
|
2710
|
-
if (
|
|
2728
|
+
if (BUILD19.member) {
|
|
2711
2729
|
cmpMeta.$members$ = compactMeta[2];
|
|
2712
2730
|
}
|
|
2713
|
-
if (
|
|
2731
|
+
if (BUILD19.hostListener) {
|
|
2714
2732
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2715
2733
|
}
|
|
2716
|
-
if (
|
|
2734
|
+
if (BUILD19.watchCallback) {
|
|
2717
2735
|
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
2718
2736
|
}
|
|
2719
|
-
if (
|
|
2737
|
+
if (BUILD19.reflect) {
|
|
2720
2738
|
cmpMeta.$attrsToReflect$ = [];
|
|
2721
2739
|
}
|
|
2722
|
-
if (
|
|
2740
|
+
if (BUILD19.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2723
2741
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2724
2742
|
}
|
|
2725
|
-
if (
|
|
2726
|
-
if (
|
|
2743
|
+
if (BUILD19.experimentalSlotFixes) {
|
|
2744
|
+
if (BUILD19.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2727
2745
|
patchPseudoShadowDom(Cstr.prototype);
|
|
2728
2746
|
}
|
|
2729
2747
|
} else {
|
|
2730
|
-
if (
|
|
2748
|
+
if (BUILD19.slotChildNodesFix) {
|
|
2731
2749
|
patchChildSlotNodes(Cstr.prototype);
|
|
2732
2750
|
}
|
|
2733
|
-
if (
|
|
2751
|
+
if (BUILD19.cloneNodeFix) {
|
|
2734
2752
|
patchCloneNode(Cstr.prototype);
|
|
2735
2753
|
}
|
|
2736
|
-
if (
|
|
2754
|
+
if (BUILD19.appendChildSlotFix) {
|
|
2737
2755
|
patchSlotAppendChild(Cstr.prototype);
|
|
2738
2756
|
}
|
|
2739
|
-
if (
|
|
2757
|
+
if (BUILD19.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2740
2758
|
patchTextContent(Cstr.prototype);
|
|
2741
2759
|
}
|
|
2742
2760
|
}
|
|
@@ -2754,20 +2772,20 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2754
2772
|
this.__hasHostListenerAttached = true;
|
|
2755
2773
|
}
|
|
2756
2774
|
connectedCallback(this);
|
|
2757
|
-
if (
|
|
2775
|
+
if (BUILD19.connectedCallback && originalConnectedCallback) {
|
|
2758
2776
|
originalConnectedCallback.call(this);
|
|
2759
2777
|
}
|
|
2760
2778
|
},
|
|
2761
2779
|
disconnectedCallback() {
|
|
2762
2780
|
disconnectedCallback(this);
|
|
2763
|
-
if (
|
|
2781
|
+
if (BUILD19.disconnectedCallback && originalDisconnectedCallback) {
|
|
2764
2782
|
originalDisconnectedCallback.call(this);
|
|
2765
2783
|
}
|
|
2766
2784
|
},
|
|
2767
2785
|
__attachShadow() {
|
|
2768
2786
|
if (supportsShadow) {
|
|
2769
2787
|
if (!this.shadowRoot) {
|
|
2770
|
-
if (
|
|
2788
|
+
if (BUILD19.shadowDelegatesFocus) {
|
|
2771
2789
|
this.attachShadow({
|
|
2772
2790
|
mode: "open",
|
|
2773
2791
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -2791,7 +2809,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2791
2809
|
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
2792
2810
|
};
|
|
2793
2811
|
var forceModeUpdate = (elm) => {
|
|
2794
|
-
if (
|
|
2812
|
+
if (BUILD19.style && BUILD19.mode && !BUILD19.lazyLoad) {
|
|
2795
2813
|
const mode = computeMode(elm);
|
|
2796
2814
|
const hostRef = getHostRef(elm);
|
|
2797
2815
|
if (hostRef.$modeName$ !== mode) {
|
|
@@ -2814,7 +2832,7 @@ var forceModeUpdate = (elm) => {
|
|
|
2814
2832
|
};
|
|
2815
2833
|
|
|
2816
2834
|
// src/runtime/bootstrap-lazy.ts
|
|
2817
|
-
import { BUILD as
|
|
2835
|
+
import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
|
|
2818
2836
|
|
|
2819
2837
|
// src/runtime/hmr-component.ts
|
|
2820
2838
|
var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
@@ -2826,7 +2844,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
|
2826
2844
|
// src/runtime/bootstrap-lazy.ts
|
|
2827
2845
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
2828
2846
|
var _a;
|
|
2829
|
-
if (
|
|
2847
|
+
if (BUILD20.profile && performance.mark) {
|
|
2830
2848
|
performance.mark("st:app:start");
|
|
2831
2849
|
}
|
|
2832
2850
|
installDevTools();
|
|
@@ -2842,12 +2860,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2842
2860
|
let isBootstrapping = true;
|
|
2843
2861
|
Object.assign(plt, options);
|
|
2844
2862
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
|
|
2845
|
-
if (
|
|
2863
|
+
if (BUILD20.asyncQueue) {
|
|
2846
2864
|
if (options.syncQueue) {
|
|
2847
2865
|
plt.$flags$ |= 4 /* queueSync */;
|
|
2848
2866
|
}
|
|
2849
2867
|
}
|
|
2850
|
-
if (
|
|
2868
|
+
if (BUILD20.hydrateClientSide) {
|
|
2851
2869
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2852
2870
|
}
|
|
2853
2871
|
let hasSlotRelocation = false;
|
|
@@ -2863,22 +2881,22 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2863
2881
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
2864
2882
|
hasSlotRelocation = true;
|
|
2865
2883
|
}
|
|
2866
|
-
if (
|
|
2884
|
+
if (BUILD20.member) {
|
|
2867
2885
|
cmpMeta.$members$ = compactMeta[2];
|
|
2868
2886
|
}
|
|
2869
|
-
if (
|
|
2887
|
+
if (BUILD20.hostListener) {
|
|
2870
2888
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2871
2889
|
}
|
|
2872
|
-
if (
|
|
2890
|
+
if (BUILD20.reflect) {
|
|
2873
2891
|
cmpMeta.$attrsToReflect$ = [];
|
|
2874
2892
|
}
|
|
2875
|
-
if (
|
|
2893
|
+
if (BUILD20.watchCallback) {
|
|
2876
2894
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
2877
2895
|
}
|
|
2878
|
-
if (
|
|
2896
|
+
if (BUILD20.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2879
2897
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2880
2898
|
}
|
|
2881
|
-
const tagName =
|
|
2899
|
+
const tagName = BUILD20.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
|
|
2882
2900
|
const HostElement = class extends HTMLElement {
|
|
2883
2901
|
// StencilLazyHost
|
|
2884
2902
|
constructor(self) {
|
|
@@ -2886,10 +2904,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2886
2904
|
this.hasRegisteredEventListeners = false;
|
|
2887
2905
|
self = this;
|
|
2888
2906
|
registerHost(self, cmpMeta);
|
|
2889
|
-
if (
|
|
2907
|
+
if (BUILD20.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2890
2908
|
if (supportsShadow) {
|
|
2891
2909
|
if (!self.shadowRoot) {
|
|
2892
|
-
if (
|
|
2910
|
+
if (BUILD20.shadowDelegatesFocus) {
|
|
2893
2911
|
self.attachShadow({
|
|
2894
2912
|
mode: "open",
|
|
2895
2913
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -2904,7 +2922,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2904
2922
|
);
|
|
2905
2923
|
}
|
|
2906
2924
|
}
|
|
2907
|
-
} else if (!
|
|
2925
|
+
} else if (!BUILD20.hydrateServerSide && !("shadowRoot" in self)) {
|
|
2908
2926
|
self.shadowRoot = self;
|
|
2909
2927
|
}
|
|
2910
2928
|
}
|
|
@@ -2932,28 +2950,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2932
2950
|
return getHostRef(this).$onReadyPromise$;
|
|
2933
2951
|
}
|
|
2934
2952
|
};
|
|
2935
|
-
if (
|
|
2936
|
-
if (
|
|
2953
|
+
if (BUILD20.experimentalSlotFixes) {
|
|
2954
|
+
if (BUILD20.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2937
2955
|
patchPseudoShadowDom(HostElement.prototype);
|
|
2938
2956
|
}
|
|
2939
2957
|
} else {
|
|
2940
|
-
if (
|
|
2958
|
+
if (BUILD20.slotChildNodesFix) {
|
|
2941
2959
|
patchChildSlotNodes(HostElement.prototype);
|
|
2942
2960
|
}
|
|
2943
|
-
if (
|
|
2961
|
+
if (BUILD20.cloneNodeFix) {
|
|
2944
2962
|
patchCloneNode(HostElement.prototype);
|
|
2945
2963
|
}
|
|
2946
|
-
if (
|
|
2964
|
+
if (BUILD20.appendChildSlotFix) {
|
|
2947
2965
|
patchSlotAppendChild(HostElement.prototype);
|
|
2948
2966
|
}
|
|
2949
|
-
if (
|
|
2967
|
+
if (BUILD20.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2950
2968
|
patchTextContent(HostElement.prototype);
|
|
2951
2969
|
}
|
|
2952
2970
|
}
|
|
2953
|
-
if (
|
|
2971
|
+
if (BUILD20.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
|
|
2954
2972
|
HostElement.formAssociated = true;
|
|
2955
2973
|
}
|
|
2956
|
-
if (
|
|
2974
|
+
if (BUILD20.hotModuleReplacement) {
|
|
2957
2975
|
HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
2958
2976
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
2959
2977
|
};
|
|
@@ -2972,7 +2990,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2972
2990
|
if (hasSlotRelocation) {
|
|
2973
2991
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
2974
2992
|
}
|
|
2975
|
-
if (
|
|
2993
|
+
if (BUILD20.invisiblePrehydration && (BUILD20.hydratedClass || BUILD20.hydratedAttribute)) {
|
|
2976
2994
|
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
2977
2995
|
}
|
|
2978
2996
|
if (dataStyles.innerHTML.length) {
|
|
@@ -2988,7 +3006,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2988
3006
|
if (deferredConnectedCallbacks.length) {
|
|
2989
3007
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
2990
3008
|
} else {
|
|
2991
|
-
if (
|
|
3009
|
+
if (BUILD20.profile) {
|
|
2992
3010
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
|
|
2993
3011
|
} else {
|
|
2994
3012
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
|
|
@@ -3001,10 +3019,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3001
3019
|
var Fragment = (_, children) => children;
|
|
3002
3020
|
|
|
3003
3021
|
// src/runtime/host-listener.ts
|
|
3004
|
-
import { BUILD as
|
|
3022
|
+
import { BUILD as BUILD21 } from "@stencil/core/internal/app-data";
|
|
3005
3023
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
3006
|
-
if (
|
|
3007
|
-
if (
|
|
3024
|
+
if (BUILD21.hostListener && listeners) {
|
|
3025
|
+
if (BUILD21.hostListenerTargetParent) {
|
|
3008
3026
|
if (attachParentListeners) {
|
|
3009
3027
|
listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
|
|
3010
3028
|
} else {
|
|
@@ -3012,7 +3030,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3012
3030
|
}
|
|
3013
3031
|
}
|
|
3014
3032
|
listeners.map(([flags, name, method]) => {
|
|
3015
|
-
const target =
|
|
3033
|
+
const target = BUILD21.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
|
|
3016
3034
|
const handler = hostListenerProxy(hostRef, method);
|
|
3017
3035
|
const opts = hostListenerOpts(flags);
|
|
3018
3036
|
plt.ael(target, name, handler, opts);
|
|
@@ -3023,7 +3041,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3023
3041
|
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
3024
3042
|
var _a;
|
|
3025
3043
|
try {
|
|
3026
|
-
if (
|
|
3044
|
+
if (BUILD21.lazyLoad) {
|
|
3027
3045
|
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
3028
3046
|
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
3029
3047
|
} else {
|
|
@@ -3037,10 +3055,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
3037
3055
|
}
|
|
3038
3056
|
};
|
|
3039
3057
|
var getHostListenerTarget = (elm, flags) => {
|
|
3040
|
-
if (
|
|
3041
|
-
if (
|
|
3042
|
-
if (
|
|
3043
|
-
if (
|
|
3058
|
+
if (BUILD21.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
|
|
3059
|
+
if (BUILD21.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
|
|
3060
|
+
if (BUILD21.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
|
|
3061
|
+
if (BUILD21.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
|
|
3044
3062
|
return elm.parentElement;
|
|
3045
3063
|
return elm;
|
|
3046
3064
|
};
|
|
@@ -3218,7 +3236,7 @@ var hAsync = (nodeName, vnodeData, ...children) => {
|
|
|
3218
3236
|
import { globalScripts } from "@stencil/core/internal/app-globals";
|
|
3219
3237
|
|
|
3220
3238
|
// src/hydrate/platform/proxy-host-element.ts
|
|
3221
|
-
import { BUILD as
|
|
3239
|
+
import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
|
|
3222
3240
|
function proxyHostElement(elm, cmpMeta) {
|
|
3223
3241
|
if (typeof elm.componentOnReady !== "function") {
|
|
3224
3242
|
elm.componentOnReady = componentOnReady;
|
|
@@ -3227,7 +3245,7 @@ function proxyHostElement(elm, cmpMeta) {
|
|
|
3227
3245
|
elm.forceUpdate = forceUpdate2;
|
|
3228
3246
|
}
|
|
3229
3247
|
if (!elm.shadowRoot && !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
3230
|
-
if (
|
|
3248
|
+
if (BUILD22.shadowDelegatesFocus) {
|
|
3231
3249
|
elm.attachShadow({
|
|
3232
3250
|
mode: "open",
|
|
3233
3251
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -3541,7 +3559,7 @@ function waitingOnElementsMsg(waitingElements) {
|
|
|
3541
3559
|
}
|
|
3542
3560
|
|
|
3543
3561
|
// src/hydrate/platform/index.ts
|
|
3544
|
-
import { BUILD as
|
|
3562
|
+
import { BUILD as BUILD24, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
|
|
3545
3563
|
var customError;
|
|
3546
3564
|
var cmpModules = /* @__PURE__ */ new Map();
|
|
3547
3565
|
var getModule = (tagName) => {
|
|
@@ -3627,7 +3645,7 @@ var plt = {
|
|
|
3627
3645
|
var setPlatformHelpers = (helpers) => {
|
|
3628
3646
|
Object.assign(plt, helpers);
|
|
3629
3647
|
};
|
|
3630
|
-
var supportsShadow =
|
|
3648
|
+
var supportsShadow = BUILD23.shadowDom;
|
|
3631
3649
|
var supportsListenerOptions = false;
|
|
3632
3650
|
var supportsConstructableStylesheets = false;
|
|
3633
3651
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
@@ -3656,7 +3674,7 @@ var Build = {
|
|
|
3656
3674
|
var styles = /* @__PURE__ */ new Map();
|
|
3657
3675
|
var modeResolutionChain = [];
|
|
3658
3676
|
export {
|
|
3659
|
-
|
|
3677
|
+
BUILD24 as BUILD,
|
|
3660
3678
|
Build,
|
|
3661
3679
|
Env,
|
|
3662
3680
|
Fragment,
|