@stencil/core 4.22.3-dev.1732597307.7bdf128 → 4.22.3-dev.1732683708.a15bc5d
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 +83 -24
- 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 +183 -176
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +182 -175
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +8 -0
- package/internal/stencil-public-docs.d.ts +8 -0
- package/internal/testing/index.js +182 -175
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.js +1 -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 +13 -13
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +10 -3
- package/testing/package.json +1 -1
|
@@ -1325,8 +1325,12 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1325
1325
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1326
1326
|
const host = parentElm.closest(hostTagName.toLowerCase());
|
|
1327
1327
|
if (host != null) {
|
|
1328
|
-
const contentRefNode = Array.from(host.childNodes).find(
|
|
1329
|
-
|
|
1328
|
+
const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
|
|
1329
|
+
(ref) => ref["s-cr"]
|
|
1330
|
+
);
|
|
1331
|
+
const childNodeArray = Array.from(
|
|
1332
|
+
parentElm.__childNodes || parentElm.childNodes
|
|
1333
|
+
);
|
|
1330
1334
|
for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
|
|
1331
1335
|
if (childNode["s-sh"] != null) {
|
|
1332
1336
|
insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
|
|
@@ -1339,7 +1343,7 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1339
1343
|
};
|
|
1340
1344
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
1341
1345
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1342
|
-
const oldSlotChildNodes = Array.from(parentElm.childNodes);
|
|
1346
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
1343
1347
|
if (parentElm["s-sr"] && import_app_data10.BUILD.experimentalSlotFixes) {
|
|
1344
1348
|
let node = parentElm;
|
|
1345
1349
|
while (node = node.nextSibling) {
|
|
@@ -1560,7 +1564,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1560
1564
|
}
|
|
1561
1565
|
};
|
|
1562
1566
|
var updateFallbackSlotVisibility = (elm) => {
|
|
1563
|
-
const childNodes = elm.childNodes;
|
|
1567
|
+
const childNodes = elm.__childNodes || elm.childNodes;
|
|
1564
1568
|
for (const childNode of childNodes) {
|
|
1565
1569
|
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1566
1570
|
if (childNode["s-sr"]) {
|
|
@@ -1591,9 +1595,10 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1591
1595
|
let node;
|
|
1592
1596
|
let hostContentNodes;
|
|
1593
1597
|
let j;
|
|
1594
|
-
|
|
1598
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1599
|
+
for (const childNode of children) {
|
|
1595
1600
|
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1596
|
-
hostContentNodes = node.parentNode.childNodes;
|
|
1601
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1597
1602
|
const slotName = childNode["s-sn"];
|
|
1598
1603
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1599
1604
|
node = hostContentNodes[j];
|
|
@@ -1682,7 +1687,7 @@ var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
|
|
|
1682
1687
|
if (scopeIds.size) {
|
|
1683
1688
|
(_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = Array.from(scopeIds));
|
|
1684
1689
|
if (element["s-ol"] || iterateChildNodes) {
|
|
1685
|
-
for (const childNode of Array.from(element.childNodes)) {
|
|
1690
|
+
for (const childNode of Array.from(element.__childNodes || element.childNodes)) {
|
|
1686
1691
|
updateElementScopeIds(childNode, element, true);
|
|
1687
1692
|
}
|
|
1688
1693
|
}
|
|
@@ -1800,7 +1805,8 @@ render() {
|
|
|
1800
1805
|
relocateNodes.length = 0;
|
|
1801
1806
|
}
|
|
1802
1807
|
if (import_app_data10.BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1803
|
-
|
|
1808
|
+
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1809
|
+
for (const childNode of children) {
|
|
1804
1810
|
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
1805
1811
|
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
1806
1812
|
childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
|
|
@@ -2192,31 +2198,77 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2192
2198
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
2193
2199
|
members.map(([memberName, [memberFlags]]) => {
|
|
2194
2200
|
if ((import_app_data13.BUILD.prop || import_app_data13.BUILD.state) && (memberFlags & 31 /* Prop */ || (!import_app_data13.BUILD.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2201
|
+
if ((memberFlags & 2048 /* Getter */) === 0) {
|
|
2202
|
+
Object.defineProperty(prototype, memberName, {
|
|
2203
|
+
get() {
|
|
2204
|
+
return getValue(this, memberName);
|
|
2205
|
+
},
|
|
2206
|
+
set(newValue) {
|
|
2207
|
+
if (import_app_data13.BUILD.isDev) {
|
|
2208
|
+
const ref = getHostRef(this);
|
|
2209
|
+
if (
|
|
2210
|
+
// we are proxying the instance (not element)
|
|
2211
|
+
(flags & 1 /* isElementConstructor */) === 0 && // the element is not constructing
|
|
2212
|
+
(ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
|
|
2213
|
+
(memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
|
|
2214
|
+
(memberFlags & 1024 /* Mutable */) === 0
|
|
2215
|
+
) {
|
|
2216
|
+
consoleDevWarn(
|
|
2217
|
+
`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
|
|
2211
2218
|
More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
2212
|
-
|
|
2219
|
+
);
|
|
2220
|
+
}
|
|
2213
2221
|
}
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
})
|
|
2222
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
2223
|
+
},
|
|
2224
|
+
configurable: true,
|
|
2225
|
+
enumerable: true
|
|
2226
|
+
});
|
|
2227
|
+
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
|
|
2228
|
+
if (import_app_data13.BUILD.lazyLoad) {
|
|
2229
|
+
Object.defineProperty(prototype, memberName, {
|
|
2230
|
+
get() {
|
|
2231
|
+
const ref = getHostRef(this);
|
|
2232
|
+
const instance = import_app_data13.BUILD.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
|
|
2233
|
+
if (!instance) return;
|
|
2234
|
+
return instance[memberName];
|
|
2235
|
+
},
|
|
2236
|
+
configurable: true,
|
|
2237
|
+
enumerable: true
|
|
2238
|
+
});
|
|
2239
|
+
}
|
|
2240
|
+
if (memberFlags & 4096 /* Setter */) {
|
|
2241
|
+
const origSetter = Object.getOwnPropertyDescriptor(prototype, memberName).set;
|
|
2242
|
+
Object.defineProperty(prototype, memberName, {
|
|
2243
|
+
set(newValue) {
|
|
2244
|
+
const ref = getHostRef(this);
|
|
2245
|
+
if (origSetter) {
|
|
2246
|
+
const currentValue = ref.$hostElement$[memberName];
|
|
2247
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2248
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2249
|
+
}
|
|
2250
|
+
origSetter.apply(this, [parsePropertyValue(newValue, cmpMeta.$members$[memberName][0])]);
|
|
2251
|
+
setValue(this, memberName, ref.$hostElement$[memberName], cmpMeta);
|
|
2252
|
+
return;
|
|
2253
|
+
}
|
|
2254
|
+
if (!ref) return;
|
|
2255
|
+
const setterSetVal = () => {
|
|
2256
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
2257
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2258
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2259
|
+
}
|
|
2260
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, cmpMeta.$members$[memberName][0]);
|
|
2261
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
2262
|
+
};
|
|
2263
|
+
if (ref.$lazyInstance$) {
|
|
2264
|
+
setterSetVal();
|
|
2265
|
+
} else {
|
|
2266
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
});
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2220
2272
|
} else if (import_app_data13.BUILD.lazyLoad && import_app_data13.BUILD.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
2221
2273
|
Object.defineProperty(prototype, memberName, {
|
|
2222
2274
|
value(...args) {
|
|
@@ -2257,7 +2309,10 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2257
2309
|
}
|
|
2258
2310
|
return;
|
|
2259
2311
|
}
|
|
2260
|
-
|
|
2312
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
2313
|
+
if (!propDesc.get || !!propDesc.set) {
|
|
2314
|
+
this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
2315
|
+
}
|
|
2261
2316
|
});
|
|
2262
2317
|
};
|
|
2263
2318
|
Cstr.observedAttributes = Array.from(
|
|
@@ -2469,7 +2524,7 @@ var disconnectedCallback = async (elm) => {
|
|
|
2469
2524
|
|
|
2470
2525
|
// src/runtime/dom-extras.ts
|
|
2471
2526
|
var import_app_data17 = require("@stencil/core/internal/app-data");
|
|
2472
|
-
var patchPseudoShadowDom = (hostElementPrototype
|
|
2527
|
+
var patchPseudoShadowDom = (hostElementPrototype) => {
|
|
2473
2528
|
patchCloneNode(hostElementPrototype);
|
|
2474
2529
|
patchSlotAppendChild(hostElementPrototype);
|
|
2475
2530
|
patchSlotAppend(hostElementPrototype);
|
|
@@ -2478,7 +2533,7 @@ var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
|
|
|
2478
2533
|
patchSlotInsertAdjacentHTML(hostElementPrototype);
|
|
2479
2534
|
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
2480
2535
|
patchTextContent(hostElementPrototype);
|
|
2481
|
-
patchChildSlotNodes(hostElementPrototype
|
|
2536
|
+
patchChildSlotNodes(hostElementPrototype);
|
|
2482
2537
|
patchSlotRemoveChild(hostElementPrototype);
|
|
2483
2538
|
};
|
|
2484
2539
|
var patchCloneNode = (HostElementPrototype) => {
|
|
@@ -2507,9 +2562,10 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
2507
2562
|
"s-rf",
|
|
2508
2563
|
"s-scs"
|
|
2509
2564
|
];
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2565
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
2566
|
+
for (; i2 < childNodes.length; i2++) {
|
|
2567
|
+
slotted = childNodes[i2]["s-nr"];
|
|
2568
|
+
nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
2513
2569
|
if (slotted) {
|
|
2514
2570
|
if (import_app_data17.BUILD.appendChildSlotFix && clonedNode.__appendChild) {
|
|
2515
2571
|
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
@@ -2518,7 +2574,7 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
2518
2574
|
}
|
|
2519
2575
|
}
|
|
2520
2576
|
if (nonStencilNode) {
|
|
2521
|
-
clonedNode.appendChild(
|
|
2577
|
+
clonedNode.appendChild(childNodes[i2].cloneNode(true));
|
|
2522
2578
|
}
|
|
2523
2579
|
}
|
|
2524
2580
|
}
|
|
@@ -2529,13 +2585,9 @@ var patchSlotAppendChild = (HostElementPrototype) => {
|
|
|
2529
2585
|
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
2530
2586
|
HostElementPrototype.appendChild = function(newChild) {
|
|
2531
2587
|
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
2532
|
-
const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
|
|
2588
|
+
const slotNode = getHostSlotNode(this.__childNodes || this.childNodes, slotName, this.tagName);
|
|
2533
2589
|
if (slotNode) {
|
|
2534
|
-
|
|
2535
|
-
slotPlaceholder["s-nr"] = newChild;
|
|
2536
|
-
slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
|
|
2537
|
-
newChild["s-ol"] = slotPlaceholder;
|
|
2538
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
2590
|
+
addSlotRelocateNode(newChild, slotNode);
|
|
2539
2591
|
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2540
2592
|
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
2541
2593
|
const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
@@ -2549,35 +2601,29 @@ var patchSlotRemoveChild = (ElementPrototype) => {
|
|
|
2549
2601
|
ElementPrototype.__removeChild = ElementPrototype.removeChild;
|
|
2550
2602
|
ElementPrototype.removeChild = function(toRemove) {
|
|
2551
2603
|
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
2552
|
-
const
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
updateFallbackSlotVisibility(this);
|
|
2559
|
-
return;
|
|
2560
|
-
}
|
|
2604
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
2605
|
+
const slotNode = getHostSlotNode(childNodes, toRemove["s-sn"], this.tagName);
|
|
2606
|
+
if (slotNode && toRemove.isConnected) {
|
|
2607
|
+
toRemove.remove();
|
|
2608
|
+
updateFallbackSlotVisibility(this);
|
|
2609
|
+
return;
|
|
2561
2610
|
}
|
|
2562
2611
|
}
|
|
2563
2612
|
return this.__removeChild(toRemove);
|
|
2564
2613
|
};
|
|
2565
2614
|
};
|
|
2566
2615
|
var patchSlotPrepend = (HostElementPrototype) => {
|
|
2567
|
-
|
|
2616
|
+
HostElementPrototype.__prepend = HostElementPrototype.prepend;
|
|
2568
2617
|
HostElementPrototype.prepend = function(...newChildren) {
|
|
2569
2618
|
newChildren.forEach((newChild) => {
|
|
2570
2619
|
if (typeof newChild === "string") {
|
|
2571
2620
|
newChild = this.ownerDocument.createTextNode(newChild);
|
|
2572
2621
|
}
|
|
2573
2622
|
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
2574
|
-
const
|
|
2623
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
2624
|
+
const slotNode = getHostSlotNode(childNodes, slotName, this.tagName);
|
|
2575
2625
|
if (slotNode) {
|
|
2576
|
-
|
|
2577
|
-
slotPlaceholder["s-nr"] = newChild;
|
|
2578
|
-
slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
|
|
2579
|
-
newChild["s-ol"] = slotPlaceholder;
|
|
2580
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
2626
|
+
addSlotRelocateNode(newChild, slotNode, true);
|
|
2581
2627
|
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2582
2628
|
const appendAfter = slotChildNodes[0];
|
|
2583
2629
|
return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
@@ -2585,11 +2631,12 @@ var patchSlotPrepend = (HostElementPrototype) => {
|
|
|
2585
2631
|
if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
|
|
2586
2632
|
newChild.hidden = true;
|
|
2587
2633
|
}
|
|
2588
|
-
return
|
|
2634
|
+
return HostElementPrototype.__prepend(newChild);
|
|
2589
2635
|
});
|
|
2590
2636
|
};
|
|
2591
2637
|
};
|
|
2592
2638
|
var patchSlotAppend = (HostElementPrototype) => {
|
|
2639
|
+
HostElementPrototype.__append = HostElementPrototype.append;
|
|
2593
2640
|
HostElementPrototype.append = function(...newChildren) {
|
|
2594
2641
|
newChildren.forEach((newChild) => {
|
|
2595
2642
|
if (typeof newChild === "string") {
|
|
@@ -2641,126 +2688,86 @@ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
|
2641
2688
|
};
|
|
2642
2689
|
};
|
|
2643
2690
|
var patchTextContent = (hostElementPrototype) => {
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
},
|
|
2666
|
-
// To mimic shadow root behavior, we need to overwrite all nodes in a slot
|
|
2667
|
-
// reference node. If a default slot reference node exists, the text content will be
|
|
2668
|
-
// placed there. Otherwise, the new text node will be hidden
|
|
2669
|
-
set(value) {
|
|
2670
|
-
const slotRefNodes = getAllChildSlotNodes(this.childNodes);
|
|
2671
|
-
slotRefNodes.forEach((node) => {
|
|
2672
|
-
let slotContent = node.nextSibling;
|
|
2673
|
-
while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
|
|
2674
|
-
const tmp = slotContent;
|
|
2675
|
-
slotContent = slotContent.nextSibling;
|
|
2676
|
-
tmp.remove();
|
|
2677
|
-
}
|
|
2678
|
-
if (node["s-sn"] === "") {
|
|
2679
|
-
const textNode = this.ownerDocument.createTextNode(value);
|
|
2680
|
-
textNode["s-sn"] = "";
|
|
2681
|
-
insertBefore(node.parentElement, textNode, node.nextSibling);
|
|
2682
|
-
} else {
|
|
2683
|
-
node.remove();
|
|
2684
|
-
}
|
|
2685
|
-
});
|
|
2686
|
-
}
|
|
2687
|
-
});
|
|
2688
|
-
} else {
|
|
2689
|
-
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
2690
|
-
get() {
|
|
2691
|
-
var _a;
|
|
2692
|
-
const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
|
|
2693
|
-
if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
|
|
2694
|
-
return slotNode.nextSibling.textContent;
|
|
2695
|
-
} else if (slotNode) {
|
|
2696
|
-
return slotNode.textContent;
|
|
2697
|
-
} else {
|
|
2698
|
-
return this.__textContent;
|
|
2699
|
-
}
|
|
2700
|
-
},
|
|
2701
|
-
set(value) {
|
|
2702
|
-
var _a;
|
|
2703
|
-
const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
|
|
2704
|
-
if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
|
|
2705
|
-
slotNode.nextSibling.textContent = value;
|
|
2706
|
-
} else if (slotNode) {
|
|
2707
|
-
slotNode.textContent = value;
|
|
2708
|
-
} else {
|
|
2709
|
-
this.__textContent = value;
|
|
2710
|
-
const contentRefElm = this["s-cr"];
|
|
2711
|
-
if (contentRefElm) {
|
|
2712
|
-
insertBefore(this, contentRefElm, this.firstChild);
|
|
2713
|
-
}
|
|
2714
|
-
}
|
|
2715
|
-
}
|
|
2716
|
-
});
|
|
2717
|
-
}
|
|
2691
|
+
let descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
|
|
2692
|
+
if (!descriptor) {
|
|
2693
|
+
descriptor = Object.getOwnPropertyDescriptor(hostElementPrototype, "textContent");
|
|
2694
|
+
}
|
|
2695
|
+
if (descriptor) Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
|
|
2696
|
+
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
2697
|
+
get: function() {
|
|
2698
|
+
let text = "";
|
|
2699
|
+
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
2700
|
+
childNodes.forEach((node) => text += node.textContent || "");
|
|
2701
|
+
return text;
|
|
2702
|
+
},
|
|
2703
|
+
set: function(value) {
|
|
2704
|
+
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
2705
|
+
childNodes.forEach((node) => {
|
|
2706
|
+
if (node["s-ol"]) node["s-ol"].remove();
|
|
2707
|
+
node.remove();
|
|
2708
|
+
});
|
|
2709
|
+
this.insertAdjacentHTML("beforeend", value);
|
|
2710
|
+
}
|
|
2711
|
+
});
|
|
2718
2712
|
};
|
|
2719
|
-
var patchChildSlotNodes = (elm
|
|
2713
|
+
var patchChildSlotNodes = (elm) => {
|
|
2720
2714
|
class FakeNodeList extends Array {
|
|
2721
2715
|
item(n) {
|
|
2722
2716
|
return this[n];
|
|
2723
2717
|
}
|
|
2724
2718
|
}
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
Object.
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2719
|
+
let childNodesFn = Object.getOwnPropertyDescriptor(Node.prototype, "childNodes");
|
|
2720
|
+
if (!childNodesFn) {
|
|
2721
|
+
childNodesFn = Object.getOwnPropertyDescriptor(elm, "childNodes");
|
|
2722
|
+
}
|
|
2723
|
+
if (childNodesFn) Object.defineProperty(elm, "__childNodes", childNodesFn);
|
|
2724
|
+
Object.defineProperty(elm, "children", {
|
|
2725
|
+
get() {
|
|
2726
|
+
return this.childNodes.filter((n) => n.nodeType === 1);
|
|
2727
|
+
}
|
|
2728
|
+
});
|
|
2729
|
+
Object.defineProperty(elm, "childElementCount", {
|
|
2730
|
+
get() {
|
|
2731
|
+
return this.children.length;
|
|
2732
|
+
}
|
|
2733
|
+
});
|
|
2734
|
+
if (!childNodesFn) return;
|
|
2735
|
+
Object.defineProperty(elm, "childNodes", {
|
|
2736
|
+
get() {
|
|
2737
|
+
var _a, _b;
|
|
2738
|
+
if (!plt.$flags$ || !((_a = getHostRef(this)) == null ? void 0 : _a.$flags$) || (plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && ((_b = getHostRef(this)) == null ? void 0 : _b.$flags$) & 2 /* hasRendered */) {
|
|
2739
|
+
const result = new FakeNodeList();
|
|
2740
|
+
const nodes = getSlottedChildNodes(this.__childNodes);
|
|
2741
|
+
result.push(...nodes);
|
|
2742
|
+
return result;
|
|
2743
|
+
}
|
|
2744
|
+
return FakeNodeList.from(this.__childNodes);
|
|
2745
|
+
}
|
|
2746
|
+
});
|
|
2747
|
+
};
|
|
2748
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend) => {
|
|
2749
|
+
let slottedNodeLocation;
|
|
2750
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
2751
|
+
slottedNodeLocation = newChild["s-ol"];
|
|
2752
|
+
} else {
|
|
2753
|
+
slottedNodeLocation = document.createTextNode("");
|
|
2754
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
2753
2755
|
}
|
|
2756
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
2757
|
+
const appendMethod = prepend ? parent.__prepend : parent.__appendChild;
|
|
2758
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
2759
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
2760
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
2754
2761
|
};
|
|
2755
|
-
var
|
|
2756
|
-
const
|
|
2757
|
-
for (
|
|
2758
|
-
|
|
2759
|
-
|
|
2762
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
2763
|
+
const result = [];
|
|
2764
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
2765
|
+
const slottedNode = childNodes[i2]["s-nr"];
|
|
2766
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
2767
|
+
result.push(slottedNode);
|
|
2760
2768
|
}
|
|
2761
|
-
slotRefNodes.push(...getAllChildSlotNodes(childNode.childNodes));
|
|
2762
2769
|
}
|
|
2763
|
-
return
|
|
2770
|
+
return result;
|
|
2764
2771
|
};
|
|
2765
2772
|
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
2766
2773
|
var getHostSlotNode = (childNodes, slotName, hostName) => {
|
|
@@ -2812,11 +2819,11 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2812
2819
|
}
|
|
2813
2820
|
if (import_app_data18.BUILD.experimentalSlotFixes) {
|
|
2814
2821
|
if (import_app_data18.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2815
|
-
patchPseudoShadowDom(Cstr.prototype
|
|
2822
|
+
patchPseudoShadowDom(Cstr.prototype);
|
|
2816
2823
|
}
|
|
2817
2824
|
} else {
|
|
2818
2825
|
if (import_app_data18.BUILD.slotChildNodesFix) {
|
|
2819
|
-
patchChildSlotNodes(Cstr.prototype
|
|
2826
|
+
patchChildSlotNodes(Cstr.prototype);
|
|
2820
2827
|
}
|
|
2821
2828
|
if (import_app_data18.BUILD.cloneNodeFix) {
|
|
2822
2829
|
patchCloneNode(Cstr.prototype);
|
|
@@ -3022,11 +3029,11 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3022
3029
|
};
|
|
3023
3030
|
if (import_app_data19.BUILD.experimentalSlotFixes) {
|
|
3024
3031
|
if (import_app_data19.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3025
|
-
patchPseudoShadowDom(HostElement.prototype
|
|
3032
|
+
patchPseudoShadowDom(HostElement.prototype);
|
|
3026
3033
|
}
|
|
3027
3034
|
} else {
|
|
3028
3035
|
if (import_app_data19.BUILD.slotChildNodesFix) {
|
|
3029
|
-
patchChildSlotNodes(HostElement.prototype
|
|
3036
|
+
patchChildSlotNodes(HostElement.prototype);
|
|
3030
3037
|
}
|
|
3031
3038
|
if (import_app_data19.BUILD.cloneNodeFix) {
|
|
3032
3039
|
patchCloneNode(HostElement.prototype);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/testing",
|
|
3
|
-
"version": "4.22.3-dev.
|
|
3
|
+
"version": "4.22.3-dev.1732683708.a15bc5d",
|
|
4
4
|
"description": "Stencil internal testing platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|
package/mock-doc/index.cjs
CHANGED
package/mock-doc/index.js
CHANGED
package/mock-doc/package.json
CHANGED
package/package.json
CHANGED
package/screenshot/index.js
CHANGED
package/screenshot/package.json
CHANGED