@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
package/internal/client/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Client Platform v4.22.3-dev.
|
|
2
|
+
Stencil Client Platform v4.22.3-dev.1732683708.a15bc5d | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -1162,8 +1162,12 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1162
1162
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1163
1163
|
const host = parentElm.closest(hostTagName.toLowerCase());
|
|
1164
1164
|
if (host != null) {
|
|
1165
|
-
const contentRefNode = Array.from(host.childNodes).find(
|
|
1166
|
-
|
|
1165
|
+
const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
|
|
1166
|
+
(ref) => ref["s-cr"]
|
|
1167
|
+
);
|
|
1168
|
+
const childNodeArray = Array.from(
|
|
1169
|
+
parentElm.__childNodes || parentElm.childNodes
|
|
1170
|
+
);
|
|
1167
1171
|
for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
|
|
1168
1172
|
if (childNode["s-sh"] != null) {
|
|
1169
1173
|
insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
|
|
@@ -1176,7 +1180,7 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1176
1180
|
};
|
|
1177
1181
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
1178
1182
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1179
|
-
const oldSlotChildNodes = Array.from(parentElm.childNodes);
|
|
1183
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
1180
1184
|
if (parentElm["s-sr"] && BUILD16.experimentalSlotFixes) {
|
|
1181
1185
|
let node = parentElm;
|
|
1182
1186
|
while (node = node.nextSibling) {
|
|
@@ -1397,7 +1401,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1397
1401
|
}
|
|
1398
1402
|
};
|
|
1399
1403
|
var updateFallbackSlotVisibility = (elm) => {
|
|
1400
|
-
const childNodes = elm.childNodes;
|
|
1404
|
+
const childNodes = elm.__childNodes || elm.childNodes;
|
|
1401
1405
|
for (const childNode of childNodes) {
|
|
1402
1406
|
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1403
1407
|
if (childNode["s-sr"]) {
|
|
@@ -1428,9 +1432,10 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1428
1432
|
let node;
|
|
1429
1433
|
let hostContentNodes;
|
|
1430
1434
|
let j;
|
|
1431
|
-
|
|
1435
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1436
|
+
for (const childNode of children) {
|
|
1432
1437
|
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1433
|
-
hostContentNodes = node.parentNode.childNodes;
|
|
1438
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1434
1439
|
const slotName = childNode["s-sn"];
|
|
1435
1440
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1436
1441
|
node = hostContentNodes[j];
|
|
@@ -1519,7 +1524,7 @@ var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
|
|
|
1519
1524
|
if (scopeIds.size) {
|
|
1520
1525
|
(_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = Array.from(scopeIds));
|
|
1521
1526
|
if (element["s-ol"] || iterateChildNodes) {
|
|
1522
|
-
for (const childNode of Array.from(element.childNodes)) {
|
|
1527
|
+
for (const childNode of Array.from(element.__childNodes || element.childNodes)) {
|
|
1523
1528
|
updateElementScopeIds(childNode, element, true);
|
|
1524
1529
|
}
|
|
1525
1530
|
}
|
|
@@ -1637,7 +1642,8 @@ render() {
|
|
|
1637
1642
|
relocateNodes.length = 0;
|
|
1638
1643
|
}
|
|
1639
1644
|
if (BUILD16.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1640
|
-
|
|
1645
|
+
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1646
|
+
for (const childNode of children) {
|
|
1641
1647
|
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
1642
1648
|
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
1643
1649
|
childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
|
|
@@ -2029,31 +2035,77 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2029
2035
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
2030
2036
|
members.map(([memberName, [memberFlags]]) => {
|
|
2031
2037
|
if ((BUILD19.prop || BUILD19.state) && (memberFlags & 31 /* Prop */ || (!BUILD19.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2038
|
+
if ((memberFlags & 2048 /* Getter */) === 0) {
|
|
2039
|
+
Object.defineProperty(prototype, memberName, {
|
|
2040
|
+
get() {
|
|
2041
|
+
return getValue(this, memberName);
|
|
2042
|
+
},
|
|
2043
|
+
set(newValue) {
|
|
2044
|
+
if (BUILD19.isDev) {
|
|
2045
|
+
const ref = getHostRef(this);
|
|
2046
|
+
if (
|
|
2047
|
+
// we are proxying the instance (not element)
|
|
2048
|
+
(flags & 1 /* isElementConstructor */) === 0 && // the element is not constructing
|
|
2049
|
+
(ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
|
|
2050
|
+
(memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
|
|
2051
|
+
(memberFlags & 1024 /* Mutable */) === 0
|
|
2052
|
+
) {
|
|
2053
|
+
consoleDevWarn(
|
|
2054
|
+
`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
|
|
2048
2055
|
More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
2049
|
-
|
|
2056
|
+
);
|
|
2057
|
+
}
|
|
2050
2058
|
}
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
})
|
|
2059
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
2060
|
+
},
|
|
2061
|
+
configurable: true,
|
|
2062
|
+
enumerable: true
|
|
2063
|
+
});
|
|
2064
|
+
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
|
|
2065
|
+
if (BUILD19.lazyLoad) {
|
|
2066
|
+
Object.defineProperty(prototype, memberName, {
|
|
2067
|
+
get() {
|
|
2068
|
+
const ref = getHostRef(this);
|
|
2069
|
+
const instance = BUILD19.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
|
|
2070
|
+
if (!instance) return;
|
|
2071
|
+
return instance[memberName];
|
|
2072
|
+
},
|
|
2073
|
+
configurable: true,
|
|
2074
|
+
enumerable: true
|
|
2075
|
+
});
|
|
2076
|
+
}
|
|
2077
|
+
if (memberFlags & 4096 /* Setter */) {
|
|
2078
|
+
const origSetter = Object.getOwnPropertyDescriptor(prototype, memberName).set;
|
|
2079
|
+
Object.defineProperty(prototype, memberName, {
|
|
2080
|
+
set(newValue) {
|
|
2081
|
+
const ref = getHostRef(this);
|
|
2082
|
+
if (origSetter) {
|
|
2083
|
+
const currentValue = ref.$hostElement$[memberName];
|
|
2084
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2085
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2086
|
+
}
|
|
2087
|
+
origSetter.apply(this, [parsePropertyValue(newValue, cmpMeta.$members$[memberName][0])]);
|
|
2088
|
+
setValue(this, memberName, ref.$hostElement$[memberName], cmpMeta);
|
|
2089
|
+
return;
|
|
2090
|
+
}
|
|
2091
|
+
if (!ref) return;
|
|
2092
|
+
const setterSetVal = () => {
|
|
2093
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
2094
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2095
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2096
|
+
}
|
|
2097
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, cmpMeta.$members$[memberName][0]);
|
|
2098
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
2099
|
+
};
|
|
2100
|
+
if (ref.$lazyInstance$) {
|
|
2101
|
+
setterSetVal();
|
|
2102
|
+
} else {
|
|
2103
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
});
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2057
2109
|
} else if (BUILD19.lazyLoad && BUILD19.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
2058
2110
|
Object.defineProperty(prototype, memberName, {
|
|
2059
2111
|
value(...args) {
|
|
@@ -2094,7 +2146,10 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2094
2146
|
}
|
|
2095
2147
|
return;
|
|
2096
2148
|
}
|
|
2097
|
-
|
|
2149
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
2150
|
+
if (!propDesc.get || !!propDesc.set) {
|
|
2151
|
+
this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
2152
|
+
}
|
|
2098
2153
|
});
|
|
2099
2154
|
};
|
|
2100
2155
|
Cstr.observedAttributes = Array.from(
|
|
@@ -2306,7 +2361,7 @@ var disconnectedCallback = async (elm) => {
|
|
|
2306
2361
|
|
|
2307
2362
|
// src/runtime/dom-extras.ts
|
|
2308
2363
|
import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
|
|
2309
|
-
var patchPseudoShadowDom = (hostElementPrototype
|
|
2364
|
+
var patchPseudoShadowDom = (hostElementPrototype) => {
|
|
2310
2365
|
patchCloneNode(hostElementPrototype);
|
|
2311
2366
|
patchSlotAppendChild(hostElementPrototype);
|
|
2312
2367
|
patchSlotAppend(hostElementPrototype);
|
|
@@ -2315,7 +2370,7 @@ var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
|
|
|
2315
2370
|
patchSlotInsertAdjacentHTML(hostElementPrototype);
|
|
2316
2371
|
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
2317
2372
|
patchTextContent(hostElementPrototype);
|
|
2318
|
-
patchChildSlotNodes(hostElementPrototype
|
|
2373
|
+
patchChildSlotNodes(hostElementPrototype);
|
|
2319
2374
|
patchSlotRemoveChild(hostElementPrototype);
|
|
2320
2375
|
};
|
|
2321
2376
|
var patchCloneNode = (HostElementPrototype) => {
|
|
@@ -2344,9 +2399,10 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
2344
2399
|
"s-rf",
|
|
2345
2400
|
"s-scs"
|
|
2346
2401
|
];
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2402
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
2403
|
+
for (; i2 < childNodes.length; i2++) {
|
|
2404
|
+
slotted = childNodes[i2]["s-nr"];
|
|
2405
|
+
nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
2350
2406
|
if (slotted) {
|
|
2351
2407
|
if (BUILD23.appendChildSlotFix && clonedNode.__appendChild) {
|
|
2352
2408
|
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
@@ -2355,7 +2411,7 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
2355
2411
|
}
|
|
2356
2412
|
}
|
|
2357
2413
|
if (nonStencilNode) {
|
|
2358
|
-
clonedNode.appendChild(
|
|
2414
|
+
clonedNode.appendChild(childNodes[i2].cloneNode(true));
|
|
2359
2415
|
}
|
|
2360
2416
|
}
|
|
2361
2417
|
}
|
|
@@ -2366,13 +2422,9 @@ var patchSlotAppendChild = (HostElementPrototype) => {
|
|
|
2366
2422
|
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
2367
2423
|
HostElementPrototype.appendChild = function(newChild) {
|
|
2368
2424
|
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
2369
|
-
const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
|
|
2425
|
+
const slotNode = getHostSlotNode(this.__childNodes || this.childNodes, slotName, this.tagName);
|
|
2370
2426
|
if (slotNode) {
|
|
2371
|
-
|
|
2372
|
-
slotPlaceholder["s-nr"] = newChild;
|
|
2373
|
-
slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
|
|
2374
|
-
newChild["s-ol"] = slotPlaceholder;
|
|
2375
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
2427
|
+
addSlotRelocateNode(newChild, slotNode);
|
|
2376
2428
|
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2377
2429
|
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
2378
2430
|
const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
@@ -2386,35 +2438,29 @@ var patchSlotRemoveChild = (ElementPrototype) => {
|
|
|
2386
2438
|
ElementPrototype.__removeChild = ElementPrototype.removeChild;
|
|
2387
2439
|
ElementPrototype.removeChild = function(toRemove) {
|
|
2388
2440
|
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
2389
|
-
const
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
updateFallbackSlotVisibility(this);
|
|
2396
|
-
return;
|
|
2397
|
-
}
|
|
2441
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
2442
|
+
const slotNode = getHostSlotNode(childNodes, toRemove["s-sn"], this.tagName);
|
|
2443
|
+
if (slotNode && toRemove.isConnected) {
|
|
2444
|
+
toRemove.remove();
|
|
2445
|
+
updateFallbackSlotVisibility(this);
|
|
2446
|
+
return;
|
|
2398
2447
|
}
|
|
2399
2448
|
}
|
|
2400
2449
|
return this.__removeChild(toRemove);
|
|
2401
2450
|
};
|
|
2402
2451
|
};
|
|
2403
2452
|
var patchSlotPrepend = (HostElementPrototype) => {
|
|
2404
|
-
|
|
2453
|
+
HostElementPrototype.__prepend = HostElementPrototype.prepend;
|
|
2405
2454
|
HostElementPrototype.prepend = function(...newChildren) {
|
|
2406
2455
|
newChildren.forEach((newChild) => {
|
|
2407
2456
|
if (typeof newChild === "string") {
|
|
2408
2457
|
newChild = this.ownerDocument.createTextNode(newChild);
|
|
2409
2458
|
}
|
|
2410
2459
|
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
2411
|
-
const
|
|
2460
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
2461
|
+
const slotNode = getHostSlotNode(childNodes, slotName, this.tagName);
|
|
2412
2462
|
if (slotNode) {
|
|
2413
|
-
|
|
2414
|
-
slotPlaceholder["s-nr"] = newChild;
|
|
2415
|
-
slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
|
|
2416
|
-
newChild["s-ol"] = slotPlaceholder;
|
|
2417
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
2463
|
+
addSlotRelocateNode(newChild, slotNode, true);
|
|
2418
2464
|
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2419
2465
|
const appendAfter = slotChildNodes[0];
|
|
2420
2466
|
return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
@@ -2422,11 +2468,12 @@ var patchSlotPrepend = (HostElementPrototype) => {
|
|
|
2422
2468
|
if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
|
|
2423
2469
|
newChild.hidden = true;
|
|
2424
2470
|
}
|
|
2425
|
-
return
|
|
2471
|
+
return HostElementPrototype.__prepend(newChild);
|
|
2426
2472
|
});
|
|
2427
2473
|
};
|
|
2428
2474
|
};
|
|
2429
2475
|
var patchSlotAppend = (HostElementPrototype) => {
|
|
2476
|
+
HostElementPrototype.__append = HostElementPrototype.append;
|
|
2430
2477
|
HostElementPrototype.append = function(...newChildren) {
|
|
2431
2478
|
newChildren.forEach((newChild) => {
|
|
2432
2479
|
if (typeof newChild === "string") {
|
|
@@ -2478,126 +2525,86 @@ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
|
2478
2525
|
};
|
|
2479
2526
|
};
|
|
2480
2527
|
var patchTextContent = (hostElementPrototype) => {
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
},
|
|
2503
|
-
// To mimic shadow root behavior, we need to overwrite all nodes in a slot
|
|
2504
|
-
// reference node. If a default slot reference node exists, the text content will be
|
|
2505
|
-
// placed there. Otherwise, the new text node will be hidden
|
|
2506
|
-
set(value) {
|
|
2507
|
-
const slotRefNodes = getAllChildSlotNodes(this.childNodes);
|
|
2508
|
-
slotRefNodes.forEach((node) => {
|
|
2509
|
-
let slotContent = node.nextSibling;
|
|
2510
|
-
while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
|
|
2511
|
-
const tmp = slotContent;
|
|
2512
|
-
slotContent = slotContent.nextSibling;
|
|
2513
|
-
tmp.remove();
|
|
2514
|
-
}
|
|
2515
|
-
if (node["s-sn"] === "") {
|
|
2516
|
-
const textNode = this.ownerDocument.createTextNode(value);
|
|
2517
|
-
textNode["s-sn"] = "";
|
|
2518
|
-
insertBefore(node.parentElement, textNode, node.nextSibling);
|
|
2519
|
-
} else {
|
|
2520
|
-
node.remove();
|
|
2521
|
-
}
|
|
2522
|
-
});
|
|
2523
|
-
}
|
|
2524
|
-
});
|
|
2525
|
-
} else {
|
|
2526
|
-
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
2527
|
-
get() {
|
|
2528
|
-
var _a;
|
|
2529
|
-
const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
|
|
2530
|
-
if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
|
|
2531
|
-
return slotNode.nextSibling.textContent;
|
|
2532
|
-
} else if (slotNode) {
|
|
2533
|
-
return slotNode.textContent;
|
|
2534
|
-
} else {
|
|
2535
|
-
return this.__textContent;
|
|
2536
|
-
}
|
|
2537
|
-
},
|
|
2538
|
-
set(value) {
|
|
2539
|
-
var _a;
|
|
2540
|
-
const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
|
|
2541
|
-
if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
|
|
2542
|
-
slotNode.nextSibling.textContent = value;
|
|
2543
|
-
} else if (slotNode) {
|
|
2544
|
-
slotNode.textContent = value;
|
|
2545
|
-
} else {
|
|
2546
|
-
this.__textContent = value;
|
|
2547
|
-
const contentRefElm = this["s-cr"];
|
|
2548
|
-
if (contentRefElm) {
|
|
2549
|
-
insertBefore(this, contentRefElm, this.firstChild);
|
|
2550
|
-
}
|
|
2551
|
-
}
|
|
2552
|
-
}
|
|
2553
|
-
});
|
|
2554
|
-
}
|
|
2528
|
+
let descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
|
|
2529
|
+
if (!descriptor) {
|
|
2530
|
+
descriptor = Object.getOwnPropertyDescriptor(hostElementPrototype, "textContent");
|
|
2531
|
+
}
|
|
2532
|
+
if (descriptor) Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
|
|
2533
|
+
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
2534
|
+
get: function() {
|
|
2535
|
+
let text = "";
|
|
2536
|
+
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
2537
|
+
childNodes.forEach((node) => text += node.textContent || "");
|
|
2538
|
+
return text;
|
|
2539
|
+
},
|
|
2540
|
+
set: function(value) {
|
|
2541
|
+
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
2542
|
+
childNodes.forEach((node) => {
|
|
2543
|
+
if (node["s-ol"]) node["s-ol"].remove();
|
|
2544
|
+
node.remove();
|
|
2545
|
+
});
|
|
2546
|
+
this.insertAdjacentHTML("beforeend", value);
|
|
2547
|
+
}
|
|
2548
|
+
});
|
|
2555
2549
|
};
|
|
2556
|
-
var patchChildSlotNodes = (elm
|
|
2550
|
+
var patchChildSlotNodes = (elm) => {
|
|
2557
2551
|
class FakeNodeList extends Array {
|
|
2558
2552
|
item(n) {
|
|
2559
2553
|
return this[n];
|
|
2560
2554
|
}
|
|
2561
2555
|
}
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
Object.
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2556
|
+
let childNodesFn = Object.getOwnPropertyDescriptor(Node.prototype, "childNodes");
|
|
2557
|
+
if (!childNodesFn) {
|
|
2558
|
+
childNodesFn = Object.getOwnPropertyDescriptor(elm, "childNodes");
|
|
2559
|
+
}
|
|
2560
|
+
if (childNodesFn) Object.defineProperty(elm, "__childNodes", childNodesFn);
|
|
2561
|
+
Object.defineProperty(elm, "children", {
|
|
2562
|
+
get() {
|
|
2563
|
+
return this.childNodes.filter((n) => n.nodeType === 1);
|
|
2564
|
+
}
|
|
2565
|
+
});
|
|
2566
|
+
Object.defineProperty(elm, "childElementCount", {
|
|
2567
|
+
get() {
|
|
2568
|
+
return this.children.length;
|
|
2569
|
+
}
|
|
2570
|
+
});
|
|
2571
|
+
if (!childNodesFn) return;
|
|
2572
|
+
Object.defineProperty(elm, "childNodes", {
|
|
2573
|
+
get() {
|
|
2574
|
+
var _a, _b;
|
|
2575
|
+
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 */) {
|
|
2576
|
+
const result = new FakeNodeList();
|
|
2577
|
+
const nodes = getSlottedChildNodes(this.__childNodes);
|
|
2578
|
+
result.push(...nodes);
|
|
2579
|
+
return result;
|
|
2580
|
+
}
|
|
2581
|
+
return FakeNodeList.from(this.__childNodes);
|
|
2582
|
+
}
|
|
2583
|
+
});
|
|
2584
|
+
};
|
|
2585
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend) => {
|
|
2586
|
+
let slottedNodeLocation;
|
|
2587
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
2588
|
+
slottedNodeLocation = newChild["s-ol"];
|
|
2589
|
+
} else {
|
|
2590
|
+
slottedNodeLocation = document.createTextNode("");
|
|
2591
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
2590
2592
|
}
|
|
2593
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
2594
|
+
const appendMethod = prepend ? parent.__prepend : parent.__appendChild;
|
|
2595
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
2596
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
2597
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
2591
2598
|
};
|
|
2592
|
-
var
|
|
2593
|
-
const
|
|
2594
|
-
for (
|
|
2595
|
-
|
|
2596
|
-
|
|
2599
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
2600
|
+
const result = [];
|
|
2601
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
2602
|
+
const slottedNode = childNodes[i2]["s-nr"];
|
|
2603
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
2604
|
+
result.push(slottedNode);
|
|
2597
2605
|
}
|
|
2598
|
-
slotRefNodes.push(...getAllChildSlotNodes(childNode.childNodes));
|
|
2599
2606
|
}
|
|
2600
|
-
return
|
|
2607
|
+
return result;
|
|
2601
2608
|
};
|
|
2602
2609
|
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
2603
2610
|
var getHostSlotNode = (childNodes, slotName, hostName) => {
|
|
@@ -2649,11 +2656,11 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2649
2656
|
}
|
|
2650
2657
|
if (BUILD24.experimentalSlotFixes) {
|
|
2651
2658
|
if (BUILD24.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2652
|
-
patchPseudoShadowDom(Cstr.prototype
|
|
2659
|
+
patchPseudoShadowDom(Cstr.prototype);
|
|
2653
2660
|
}
|
|
2654
2661
|
} else {
|
|
2655
2662
|
if (BUILD24.slotChildNodesFix) {
|
|
2656
|
-
patchChildSlotNodes(Cstr.prototype
|
|
2663
|
+
patchChildSlotNodes(Cstr.prototype);
|
|
2657
2664
|
}
|
|
2658
2665
|
if (BUILD24.cloneNodeFix) {
|
|
2659
2666
|
patchCloneNode(Cstr.prototype);
|
|
@@ -2859,11 +2866,11 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2859
2866
|
};
|
|
2860
2867
|
if (BUILD25.experimentalSlotFixes) {
|
|
2861
2868
|
if (BUILD25.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2862
|
-
patchPseudoShadowDom(HostElement.prototype
|
|
2869
|
+
patchPseudoShadowDom(HostElement.prototype);
|
|
2863
2870
|
}
|
|
2864
2871
|
} else {
|
|
2865
2872
|
if (BUILD25.slotChildNodesFix) {
|
|
2866
|
-
patchChildSlotNodes(HostElement.prototype
|
|
2873
|
+
patchChildSlotNodes(HostElement.prototype);
|
|
2867
2874
|
}
|
|
2868
2875
|
if (BUILD25.cloneNodeFix) {
|
|
2869
2876
|
patchCloneNode(HostElement.prototype);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/client",
|
|
3
|
-
"version": "4.22.3-dev.
|
|
3
|
+
"version": "4.22.3-dev.1732683708.a15bc5d",
|
|
4
4
|
"description": "Stencil internal client platform to be imported by the Stencil Compiler and internal runtime. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"exports": "./index.js",
|