@stencil/core 4.45.2 → 4.45.3
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 +234 -149
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +76 -37
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +75 -37
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +18 -12
- package/internal/package.json +1 -1
- package/internal/stencil-public-runtime.d.ts +1 -1
- package/internal/testing/index.js +74 -36
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +18 -12
- package/mock-doc/index.d.ts +13 -3
- package/mock-doc/index.js +18 -12
- 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/autoprefixer.js +1 -1
- package/sys/node/index.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +1 -1
- package/testing/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Hydrate Platform v4.45.
|
|
2
|
+
Stencil Hydrate Platform v4.45.3 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -551,6 +551,7 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
|
551
551
|
if (typeof slotName !== "undefined") return slottedNodes;
|
|
552
552
|
}
|
|
553
553
|
slottedNodes = [...slottedNodes, ...getHostSlotNodes(internalCall(childNode, "childNodes"), hostName, slotName)];
|
|
554
|
+
if (typeof slotName !== "undefined" && slottedNodes.length) return slottedNodes;
|
|
554
555
|
}
|
|
555
556
|
return slottedNodes;
|
|
556
557
|
}
|
|
@@ -658,6 +659,7 @@ var patchPseudoShadowDom = (hostElementPrototype) => {
|
|
|
658
659
|
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
659
660
|
patchInsertBefore(hostElementPrototype);
|
|
660
661
|
patchTextContent(hostElementPrototype);
|
|
662
|
+
patchInnerContentSetters(hostElementPrototype);
|
|
661
663
|
patchChildSlotNodes(hostElementPrototype);
|
|
662
664
|
patchSlotRemoveChild(hostElementPrototype);
|
|
663
665
|
};
|
|
@@ -716,10 +718,13 @@ var patchSlotAppendChild = (HostElementPrototype) => {
|
|
|
716
718
|
addSlotRelocateNode(newChild, slotNode);
|
|
717
719
|
const slotChildNodes = getSlotChildSiblings(slotNode, slotName);
|
|
718
720
|
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
721
|
+
const slotWasEmpty = slotChildNodes.every((node) => node["s-sr"]);
|
|
719
722
|
const parent = internalCall(appendAfter, "parentNode");
|
|
720
723
|
const insertedNode = internalCall(parent, "insertBefore")(newChild, appendAfter.nextSibling);
|
|
721
724
|
dispatchSlotChangeEvent(slotNode);
|
|
722
|
-
|
|
725
|
+
if (slotWasEmpty) {
|
|
726
|
+
updateFallbackSlotVisibility(this);
|
|
727
|
+
}
|
|
723
728
|
return insertedNode;
|
|
724
729
|
}
|
|
725
730
|
return this.__appendChild(newChild);
|
|
@@ -731,7 +736,7 @@ var patchSlotRemoveChild = (ElementPrototype) => {
|
|
|
731
736
|
ElementPrototype.removeChild = function(toRemove) {
|
|
732
737
|
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
733
738
|
const childNodes = this.__childNodes || this.childNodes;
|
|
734
|
-
const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
|
|
739
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"])[0];
|
|
735
740
|
if (slotNode && toRemove.isConnected) {
|
|
736
741
|
toRemove.remove();
|
|
737
742
|
updateFallbackSlotVisibility(this);
|
|
@@ -813,26 +818,23 @@ var patchInsertBefore = (HostElementPrototype) => {
|
|
|
813
818
|
eleProto.__insertBefore = HostElementPrototype.insertBefore;
|
|
814
819
|
HostElementPrototype.insertBefore = function(newChild, currentChild) {
|
|
815
820
|
const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);
|
|
816
|
-
const slottedNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
817
821
|
if (slotNode) {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
}
|
|
832
|
-
return;
|
|
822
|
+
if (currentChild === null) {
|
|
823
|
+
this.appendChild(newChild);
|
|
824
|
+
return newChild;
|
|
825
|
+
}
|
|
826
|
+
const slottedNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
827
|
+
if (slottedNodes.includes(currentChild)) {
|
|
828
|
+
if (slotName !== currentChild["s-sn"]) {
|
|
829
|
+
this.appendChild(newChild);
|
|
830
|
+
} else {
|
|
831
|
+
addSlotRelocateNode(newChild, slotNode);
|
|
832
|
+
const parent = internalCall(currentChild, "parentNode");
|
|
833
|
+
internalCall(parent, "insertBefore")(newChild, currentChild);
|
|
834
|
+
dispatchSlotChangeEvent(slotNode);
|
|
833
835
|
}
|
|
834
|
-
|
|
835
|
-
|
|
836
|
+
return newChild;
|
|
837
|
+
}
|
|
836
838
|
}
|
|
837
839
|
const parentNode = currentChild == null ? void 0 : currentChild.__parentNode;
|
|
838
840
|
if (parentNode && !this.isSameNode(parentNode)) {
|
|
@@ -868,15 +870,38 @@ var patchTextContent = (hostElementPrototype) => {
|
|
|
868
870
|
return text;
|
|
869
871
|
},
|
|
870
872
|
set: function(value) {
|
|
871
|
-
|
|
872
|
-
childNodes.forEach((node) => {
|
|
873
|
-
if (node["s-ol"]) node["s-ol"].remove();
|
|
874
|
-
node.remove();
|
|
875
|
-
});
|
|
873
|
+
removeSlottedNodes(this);
|
|
876
874
|
this.insertAdjacentHTML("beforeend", value);
|
|
877
875
|
}
|
|
878
876
|
});
|
|
879
877
|
};
|
|
878
|
+
var patchInnerContentSetters = (hostElementPrototype) => {
|
|
879
|
+
if (!globalThis.HTMLElement) return;
|
|
880
|
+
const patchSetter = (proto, name, insert) => {
|
|
881
|
+
var _a2;
|
|
882
|
+
const get = (_a2 = Object.getOwnPropertyDescriptor(proto, name)) == null ? void 0 : _a2.get;
|
|
883
|
+
if (!get) return;
|
|
884
|
+
Object.defineProperty(hostElementPrototype, name, {
|
|
885
|
+
get,
|
|
886
|
+
set: function(value) {
|
|
887
|
+
removeSlottedNodes(this);
|
|
888
|
+
Array.from(internalCall(this, "childNodes")).forEach((node) => {
|
|
889
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== this.tagName) node.remove();
|
|
890
|
+
});
|
|
891
|
+
insert(this, value != null ? value : "");
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
};
|
|
895
|
+
patchSetter(Element.prototype, "innerHTML", (host, value) => host.insertAdjacentHTML("beforeend", value));
|
|
896
|
+
patchSetter(HTMLElement.prototype, "innerText", (host, value) => host.append(value));
|
|
897
|
+
};
|
|
898
|
+
var removeSlottedNodes = (host) => {
|
|
899
|
+
const childNodes = host.__childNodes ? host.childNodes : getSlottedChildNodes(host.childNodes);
|
|
900
|
+
childNodes.forEach((node) => {
|
|
901
|
+
if (node["s-ol"]) node["s-ol"].remove();
|
|
902
|
+
node.remove();
|
|
903
|
+
});
|
|
904
|
+
};
|
|
880
905
|
var patchChildSlotNodes = (elm) => {
|
|
881
906
|
class FakeNodeList extends Array {
|
|
882
907
|
item(n) {
|
|
@@ -1165,7 +1190,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1165
1190
|
}
|
|
1166
1191
|
const existingStyleElm = (BUILD6.hydrateClientSide || BUILD6.hotModuleReplacement) && styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
|
|
1167
1192
|
if (existingStyleElm) {
|
|
1168
|
-
|
|
1193
|
+
if (BUILD6.hotModuleReplacement) {
|
|
1194
|
+
existingStyleElm.textContent = style;
|
|
1195
|
+
}
|
|
1196
|
+
appliedStyles.add(scopeId2);
|
|
1169
1197
|
} else if (!appliedStyles.has(scopeId2)) {
|
|
1170
1198
|
styleElm = win.document.createElement("style");
|
|
1171
1199
|
styleElm.textContent = style;
|
|
@@ -1173,7 +1201,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1173
1201
|
if (nonce != null) {
|
|
1174
1202
|
styleElm.setAttribute("nonce", nonce);
|
|
1175
1203
|
}
|
|
1176
|
-
if (
|
|
1204
|
+
if (BUILD6.hydrateServerSide || BUILD6.hotModuleReplacement) {
|
|
1177
1205
|
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
1178
1206
|
}
|
|
1179
1207
|
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
@@ -1267,14 +1295,21 @@ var attachStyles = (hostRef) => {
|
|
|
1267
1295
|
};
|
|
1268
1296
|
var getScopeId = (cmp, mode) => "sc-" + (BUILD6.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
1269
1297
|
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
1270
|
-
var hydrateScopedToShadow = () => {
|
|
1298
|
+
var hydrateScopedToShadow = (cmpMetas) => {
|
|
1271
1299
|
if (!win.document) {
|
|
1272
1300
|
return;
|
|
1273
1301
|
}
|
|
1274
|
-
const
|
|
1302
|
+
const styleElms = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
1275
1303
|
let i2 = 0;
|
|
1276
|
-
for (; i2 <
|
|
1277
|
-
|
|
1304
|
+
for (; i2 < styleElms.length; i2++) {
|
|
1305
|
+
const scopeId2 = styleElms[i2].getAttribute(HYDRATED_STYLE_ID);
|
|
1306
|
+
const isShadowCmpStyle = cmpMetas.some((cmpMeta) => {
|
|
1307
|
+
const cmpScopeId = "sc-" + cmpMeta.$tagName$;
|
|
1308
|
+
return cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && (scopeId2 === cmpScopeId || BUILD6.mode && cmpMeta.$flags$ & 32 /* hasMode */ && scopeId2.startsWith(cmpScopeId + "-"));
|
|
1309
|
+
});
|
|
1310
|
+
if (isShadowCmpStyle) {
|
|
1311
|
+
registerStyle(scopeId2, convertScopedToShadow(styleElms[i2].innerHTML), true);
|
|
1312
|
+
}
|
|
1278
1313
|
}
|
|
1279
1314
|
};
|
|
1280
1315
|
|
|
@@ -1604,7 +1639,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1604
1639
|
const scopeId2 = hostElm["s-sc"];
|
|
1605
1640
|
if (node.nodeType === 1 /* ElementNode */) {
|
|
1606
1641
|
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
1607
|
-
if (childNodeType) {
|
|
1642
|
+
if (childNodeType && node !== hostElm) {
|
|
1608
1643
|
childIdSplt = childNodeType.split(".");
|
|
1609
1644
|
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
1610
1645
|
childVNode = createSimpleVNode({
|
|
@@ -3934,7 +3969,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3934
3969
|
const entry = (_a3 = cmpMeta.$watchers$) == null ? void 0 : _a3[attrName];
|
|
3935
3970
|
entry == null ? void 0 : entry.forEach((watcher) => {
|
|
3936
3971
|
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
3937
|
-
if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
|
|
3972
|
+
if ((instance == null ? void 0 : instance[watchMethodName]) != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
|
|
3938
3973
|
instance[watchMethodName].call(instance, newValue, oldValue, attrName);
|
|
3939
3974
|
}
|
|
3940
3975
|
});
|
|
@@ -3955,7 +3990,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3955
3990
|
newValue = newValue === null || newValue === "false" && !isFormAssociated ? false : true;
|
|
3956
3991
|
}
|
|
3957
3992
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
3958
|
-
|
|
3993
|
+
const isUnchanged = newValue === this[propName] || newValue == null && this[propName] == null;
|
|
3994
|
+
if (!isSpuriousBooleanRemoval && !isUnchanged && (!propDesc.get || !!propDesc.set)) {
|
|
3959
3995
|
this[propName] = newValue;
|
|
3960
3996
|
}
|
|
3961
3997
|
});
|
|
@@ -4264,7 +4300,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
4264
4300
|
patchCloneNode(Cstr.prototype);
|
|
4265
4301
|
}
|
|
4266
4302
|
if (BUILD21.hydrateClientSide && BUILD21.shadowDom) {
|
|
4267
|
-
hydrateScopedToShadow();
|
|
4303
|
+
hydrateScopedToShadow([cmpMeta]);
|
|
4268
4304
|
}
|
|
4269
4305
|
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
4270
4306
|
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
@@ -4387,7 +4423,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4387
4423
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
4388
4424
|
}
|
|
4389
4425
|
if (BUILD22.hydrateClientSide && BUILD22.shadowDom) {
|
|
4390
|
-
|
|
4426
|
+
const cmpMetas = [];
|
|
4427
|
+
lazyBundles.map((lazyBundle) => lazyBundle[1].map(([$flags$, $tagName$]) => cmpMetas.push({ $flags$, $tagName$ })));
|
|
4428
|
+
hydrateScopedToShadow(cmpMetas);
|
|
4391
4429
|
}
|
|
4392
4430
|
let hasSlotRelocation = false;
|
|
4393
4431
|
lazyBundles.map((lazyBundle) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/hydrate",
|
|
3
|
-
"version": "4.45.
|
|
3
|
+
"version": "4.45.3",
|
|
4
4
|
"description": "Stencil internal hydrate 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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Hydrate Runner v4.45.
|
|
2
|
+
Stencil Hydrate Runner v4.45.3 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -11288,22 +11288,26 @@ var MockNodeList = class {
|
|
|
11288
11288
|
this.length = length;
|
|
11289
11289
|
}
|
|
11290
11290
|
};
|
|
11291
|
+
var MockElementInternals = class {
|
|
11292
|
+
states = /* @__PURE__ */ new Set();
|
|
11293
|
+
setFormValue() {
|
|
11294
|
+
}
|
|
11295
|
+
setValidity() {
|
|
11296
|
+
}
|
|
11297
|
+
checkValidity() {
|
|
11298
|
+
return true;
|
|
11299
|
+
}
|
|
11300
|
+
reportValidity() {
|
|
11301
|
+
return true;
|
|
11302
|
+
}
|
|
11303
|
+
};
|
|
11291
11304
|
var MockElement = class extends MockNode2 {
|
|
11292
11305
|
__namespaceURI;
|
|
11293
11306
|
__attributeMap;
|
|
11294
11307
|
__shadowRoot;
|
|
11295
11308
|
__style;
|
|
11296
11309
|
attachInternals() {
|
|
11297
|
-
return new
|
|
11298
|
-
get: function(_target, prop, _receiver) {
|
|
11299
|
-
if ("process" in globalThis && globalThis.process.env.__STENCIL_SPEC_TESTS__) {
|
|
11300
|
-
console.error(
|
|
11301
|
-
`NOTE: Property ${String(prop)} was accessed on ElementInternals, but this property is not implemented.
|
|
11302
|
-
Testing components with ElementInternals is fully supported in e2e tests.`
|
|
11303
|
-
);
|
|
11304
|
-
}
|
|
11305
|
-
}
|
|
11306
|
-
});
|
|
11310
|
+
return new MockElementInternals();
|
|
11307
11311
|
}
|
|
11308
11312
|
constructor(ownerDocument, nodeName, namespaceURI = null) {
|
|
11309
11313
|
super(ownerDocument, 1 /* ELEMENT_NODE */, typeof nodeName === "string" ? nodeName : null, null);
|
|
@@ -11577,7 +11581,9 @@ var MockElement = class extends MockNode2 {
|
|
|
11577
11581
|
return this.hasAttributeNS(null, "hidden");
|
|
11578
11582
|
}
|
|
11579
11583
|
set hidden(isHidden) {
|
|
11580
|
-
if (isHidden ===
|
|
11584
|
+
if (isHidden === "until-found") {
|
|
11585
|
+
this.setAttributeNS(null, "hidden", "until-found");
|
|
11586
|
+
} else if (isHidden === true) {
|
|
11581
11587
|
this.setAttributeNS(null, "hidden", "");
|
|
11582
11588
|
} else {
|
|
11583
11589
|
this.removeAttributeNS(null, "hidden");
|
package/internal/package.json
CHANGED
|
@@ -2696,6 +2696,7 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
|
2696
2696
|
if (typeof slotName !== "undefined") return slottedNodes;
|
|
2697
2697
|
}
|
|
2698
2698
|
slottedNodes = [...slottedNodes, ...getHostSlotNodes(internalCall(childNode, "childNodes"), hostName, slotName)];
|
|
2699
|
+
if (typeof slotName !== "undefined" && slottedNodes.length) return slottedNodes;
|
|
2699
2700
|
}
|
|
2700
2701
|
return slottedNodes;
|
|
2701
2702
|
}
|
|
@@ -2803,6 +2804,7 @@ var patchPseudoShadowDom = (hostElementPrototype) => {
|
|
|
2803
2804
|
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
2804
2805
|
patchInsertBefore(hostElementPrototype);
|
|
2805
2806
|
patchTextContent(hostElementPrototype);
|
|
2807
|
+
patchInnerContentSetters(hostElementPrototype);
|
|
2806
2808
|
patchChildSlotNodes(hostElementPrototype);
|
|
2807
2809
|
patchSlotRemoveChild(hostElementPrototype);
|
|
2808
2810
|
};
|
|
@@ -2861,10 +2863,13 @@ var patchSlotAppendChild = (HostElementPrototype) => {
|
|
|
2861
2863
|
addSlotRelocateNode(newChild, slotNode);
|
|
2862
2864
|
const slotChildNodes = getSlotChildSiblings(slotNode, slotName);
|
|
2863
2865
|
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
2866
|
+
const slotWasEmpty = slotChildNodes.every((node) => node["s-sr"]);
|
|
2864
2867
|
const parent = internalCall(appendAfter, "parentNode");
|
|
2865
2868
|
const insertedNode = internalCall(parent, "insertBefore")(newChild, appendAfter.nextSibling);
|
|
2866
2869
|
dispatchSlotChangeEvent(slotNode);
|
|
2867
|
-
|
|
2870
|
+
if (slotWasEmpty) {
|
|
2871
|
+
updateFallbackSlotVisibility(this);
|
|
2872
|
+
}
|
|
2868
2873
|
return insertedNode;
|
|
2869
2874
|
}
|
|
2870
2875
|
return this.__appendChild(newChild);
|
|
@@ -2876,7 +2881,7 @@ var patchSlotRemoveChild = (ElementPrototype) => {
|
|
|
2876
2881
|
ElementPrototype.removeChild = function(toRemove) {
|
|
2877
2882
|
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
2878
2883
|
const childNodes = this.__childNodes || this.childNodes;
|
|
2879
|
-
const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
|
|
2884
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"])[0];
|
|
2880
2885
|
if (slotNode && toRemove.isConnected) {
|
|
2881
2886
|
toRemove.remove();
|
|
2882
2887
|
updateFallbackSlotVisibility(this);
|
|
@@ -2958,26 +2963,23 @@ var patchInsertBefore = (HostElementPrototype) => {
|
|
|
2958
2963
|
eleProto.__insertBefore = HostElementPrototype.insertBefore;
|
|
2959
2964
|
HostElementPrototype.insertBefore = function(newChild, currentChild) {
|
|
2960
2965
|
const { slotName, slotNode } = findSlotFromSlottedNode(newChild, this);
|
|
2961
|
-
const slottedNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
2962
2966
|
if (slotNode) {
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
}
|
|
2977
|
-
return;
|
|
2967
|
+
if (currentChild === null) {
|
|
2968
|
+
this.appendChild(newChild);
|
|
2969
|
+
return newChild;
|
|
2970
|
+
}
|
|
2971
|
+
const slottedNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
2972
|
+
if (slottedNodes.includes(currentChild)) {
|
|
2973
|
+
if (slotName !== currentChild["s-sn"]) {
|
|
2974
|
+
this.appendChild(newChild);
|
|
2975
|
+
} else {
|
|
2976
|
+
addSlotRelocateNode(newChild, slotNode);
|
|
2977
|
+
const parent = internalCall(currentChild, "parentNode");
|
|
2978
|
+
internalCall(parent, "insertBefore")(newChild, currentChild);
|
|
2979
|
+
dispatchSlotChangeEvent(slotNode);
|
|
2978
2980
|
}
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
+
return newChild;
|
|
2982
|
+
}
|
|
2981
2983
|
}
|
|
2982
2984
|
const parentNode = currentChild == null ? void 0 : currentChild.__parentNode;
|
|
2983
2985
|
if (parentNode && !this.isSameNode(parentNode)) {
|
|
@@ -3013,15 +3015,38 @@ var patchTextContent = (hostElementPrototype) => {
|
|
|
3013
3015
|
return text;
|
|
3014
3016
|
},
|
|
3015
3017
|
set: function(value) {
|
|
3016
|
-
|
|
3017
|
-
childNodes.forEach((node) => {
|
|
3018
|
-
if (node["s-ol"]) node["s-ol"].remove();
|
|
3019
|
-
node.remove();
|
|
3020
|
-
});
|
|
3018
|
+
removeSlottedNodes(this);
|
|
3021
3019
|
this.insertAdjacentHTML("beforeend", value);
|
|
3022
3020
|
}
|
|
3023
3021
|
});
|
|
3024
3022
|
};
|
|
3023
|
+
var patchInnerContentSetters = (hostElementPrototype) => {
|
|
3024
|
+
if (!globalThis.HTMLElement) return;
|
|
3025
|
+
const patchSetter = (proto, name, insert) => {
|
|
3026
|
+
var _a2;
|
|
3027
|
+
const get = (_a2 = Object.getOwnPropertyDescriptor(proto, name)) == null ? void 0 : _a2.get;
|
|
3028
|
+
if (!get) return;
|
|
3029
|
+
Object.defineProperty(hostElementPrototype, name, {
|
|
3030
|
+
get,
|
|
3031
|
+
set: function(value) {
|
|
3032
|
+
removeSlottedNodes(this);
|
|
3033
|
+
Array.from(internalCall(this, "childNodes")).forEach((node) => {
|
|
3034
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== this.tagName) node.remove();
|
|
3035
|
+
});
|
|
3036
|
+
insert(this, value != null ? value : "");
|
|
3037
|
+
}
|
|
3038
|
+
});
|
|
3039
|
+
};
|
|
3040
|
+
patchSetter(Element.prototype, "innerHTML", (host, value) => host.insertAdjacentHTML("beforeend", value));
|
|
3041
|
+
patchSetter(HTMLElement.prototype, "innerText", (host, value) => host.append(value));
|
|
3042
|
+
};
|
|
3043
|
+
var removeSlottedNodes = (host) => {
|
|
3044
|
+
const childNodes = host.__childNodes ? host.childNodes : getSlottedChildNodes(host.childNodes);
|
|
3045
|
+
childNodes.forEach((node) => {
|
|
3046
|
+
if (node["s-ol"]) node["s-ol"].remove();
|
|
3047
|
+
node.remove();
|
|
3048
|
+
});
|
|
3049
|
+
};
|
|
3025
3050
|
var patchChildSlotNodes = (elm) => {
|
|
3026
3051
|
class FakeNodeList extends Array {
|
|
3027
3052
|
item(n) {
|
|
@@ -3302,7 +3327,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
3302
3327
|
}
|
|
3303
3328
|
const existingStyleElm = (import_app_data7.BUILD.hydrateClientSide || import_app_data7.BUILD.hotModuleReplacement) && styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
|
|
3304
3329
|
if (existingStyleElm) {
|
|
3305
|
-
|
|
3330
|
+
if (import_app_data7.BUILD.hotModuleReplacement) {
|
|
3331
|
+
existingStyleElm.textContent = style;
|
|
3332
|
+
}
|
|
3333
|
+
appliedStyles.add(scopeId2);
|
|
3306
3334
|
} else if (!appliedStyles.has(scopeId2)) {
|
|
3307
3335
|
styleElm = win.document.createElement("style");
|
|
3308
3336
|
styleElm.textContent = style;
|
|
@@ -3310,7 +3338,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
3310
3338
|
if (nonce != null) {
|
|
3311
3339
|
styleElm.setAttribute("nonce", nonce);
|
|
3312
3340
|
}
|
|
3313
|
-
if (
|
|
3341
|
+
if (import_app_data7.BUILD.hydrateServerSide || import_app_data7.BUILD.hotModuleReplacement) {
|
|
3314
3342
|
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
3315
3343
|
}
|
|
3316
3344
|
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
@@ -3404,14 +3432,21 @@ var attachStyles = (hostRef) => {
|
|
|
3404
3432
|
};
|
|
3405
3433
|
var getScopeId = (cmp, mode) => "sc-" + (import_app_data7.BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
3406
3434
|
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
3407
|
-
var hydrateScopedToShadow = () => {
|
|
3435
|
+
var hydrateScopedToShadow = (cmpMetas) => {
|
|
3408
3436
|
if (!win.document) {
|
|
3409
3437
|
return;
|
|
3410
3438
|
}
|
|
3411
|
-
const
|
|
3439
|
+
const styleElms = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
3412
3440
|
let i2 = 0;
|
|
3413
|
-
for (; i2 <
|
|
3414
|
-
|
|
3441
|
+
for (; i2 < styleElms.length; i2++) {
|
|
3442
|
+
const scopeId2 = styleElms[i2].getAttribute(HYDRATED_STYLE_ID);
|
|
3443
|
+
const isShadowCmpStyle = cmpMetas.some((cmpMeta) => {
|
|
3444
|
+
const cmpScopeId = "sc-" + cmpMeta.$tagName$;
|
|
3445
|
+
return cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && (scopeId2 === cmpScopeId || import_app_data7.BUILD.mode && cmpMeta.$flags$ & 32 /* hasMode */ && scopeId2.startsWith(cmpScopeId + "-"));
|
|
3446
|
+
});
|
|
3447
|
+
if (isShadowCmpStyle) {
|
|
3448
|
+
registerStyle(scopeId2, convertScopedToShadow(styleElms[i2].innerHTML), true);
|
|
3449
|
+
}
|
|
3415
3450
|
}
|
|
3416
3451
|
};
|
|
3417
3452
|
|
|
@@ -3732,7 +3767,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
3732
3767
|
const scopeId2 = hostElm["s-sc"];
|
|
3733
3768
|
if (node.nodeType === 1 /* ElementNode */) {
|
|
3734
3769
|
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
3735
|
-
if (childNodeType) {
|
|
3770
|
+
if (childNodeType && node !== hostElm) {
|
|
3736
3771
|
childIdSplt = childNodeType.split(".");
|
|
3737
3772
|
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
3738
3773
|
childVNode = createSimpleVNode({
|
|
@@ -5922,7 +5957,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
5922
5957
|
const entry = (_a3 = cmpMeta.$watchers$) == null ? void 0 : _a3[attrName];
|
|
5923
5958
|
entry == null ? void 0 : entry.forEach((watcher) => {
|
|
5924
5959
|
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
5925
|
-
if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
|
|
5960
|
+
if ((instance == null ? void 0 : instance[watchMethodName]) != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
|
|
5926
5961
|
instance[watchMethodName].call(instance, newValue, oldValue, attrName);
|
|
5927
5962
|
}
|
|
5928
5963
|
});
|
|
@@ -5943,7 +5978,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
5943
5978
|
newValue = newValue === null || newValue === "false" && !isFormAssociated ? false : true;
|
|
5944
5979
|
}
|
|
5945
5980
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
5946
|
-
|
|
5981
|
+
const isUnchanged = newValue === this[propName] || newValue == null && this[propName] == null;
|
|
5982
|
+
if (!isSpuriousBooleanRemoval && !isUnchanged && (!propDesc.get || !!propDesc.set)) {
|
|
5947
5983
|
this[propName] = newValue;
|
|
5948
5984
|
}
|
|
5949
5985
|
});
|
|
@@ -6252,7 +6288,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
6252
6288
|
patchCloneNode(Cstr.prototype);
|
|
6253
6289
|
}
|
|
6254
6290
|
if (import_app_data20.BUILD.hydrateClientSide && import_app_data20.BUILD.shadowDom) {
|
|
6255
|
-
hydrateScopedToShadow();
|
|
6291
|
+
hydrateScopedToShadow([cmpMeta]);
|
|
6256
6292
|
}
|
|
6257
6293
|
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
6258
6294
|
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
@@ -6375,7 +6411,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
6375
6411
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
6376
6412
|
}
|
|
6377
6413
|
if (import_app_data21.BUILD.hydrateClientSide && import_app_data21.BUILD.shadowDom) {
|
|
6378
|
-
|
|
6414
|
+
const cmpMetas = [];
|
|
6415
|
+
lazyBundles.map((lazyBundle) => lazyBundle[1].map(([$flags$, $tagName$]) => cmpMetas.push({ $flags$, $tagName$ })));
|
|
6416
|
+
hydrateScopedToShadow(cmpMetas);
|
|
6379
6417
|
}
|
|
6380
6418
|
let hasSlotRelocation = false;
|
|
6381
6419
|
lazyBundles.map((lazyBundle) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/testing",
|
|
3
|
-
"version": "4.45.
|
|
3
|
+
"version": "4.45.3",
|
|
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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Mock Doc (CommonJS) v4.45.
|
|
2
|
+
Stencil Mock Doc (CommonJS) v4.45.3 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
"use strict";
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -6839,22 +6839,26 @@ var MockNodeList = class {
|
|
|
6839
6839
|
this.length = length;
|
|
6840
6840
|
}
|
|
6841
6841
|
};
|
|
6842
|
+
var MockElementInternals = class {
|
|
6843
|
+
states = /* @__PURE__ */ new Set();
|
|
6844
|
+
setFormValue() {
|
|
6845
|
+
}
|
|
6846
|
+
setValidity() {
|
|
6847
|
+
}
|
|
6848
|
+
checkValidity() {
|
|
6849
|
+
return true;
|
|
6850
|
+
}
|
|
6851
|
+
reportValidity() {
|
|
6852
|
+
return true;
|
|
6853
|
+
}
|
|
6854
|
+
};
|
|
6842
6855
|
var MockElement = class extends MockNode2 {
|
|
6843
6856
|
__namespaceURI;
|
|
6844
6857
|
__attributeMap;
|
|
6845
6858
|
__shadowRoot;
|
|
6846
6859
|
__style;
|
|
6847
6860
|
attachInternals() {
|
|
6848
|
-
return new
|
|
6849
|
-
get: function(_target, prop, _receiver) {
|
|
6850
|
-
if ("process" in globalThis && globalThis.process.env.__STENCIL_SPEC_TESTS__) {
|
|
6851
|
-
console.error(
|
|
6852
|
-
`NOTE: Property ${String(prop)} was accessed on ElementInternals, but this property is not implemented.
|
|
6853
|
-
Testing components with ElementInternals is fully supported in e2e tests.`
|
|
6854
|
-
);
|
|
6855
|
-
}
|
|
6856
|
-
}
|
|
6857
|
-
});
|
|
6861
|
+
return new MockElementInternals();
|
|
6858
6862
|
}
|
|
6859
6863
|
constructor(ownerDocument, nodeName, namespaceURI = null) {
|
|
6860
6864
|
super(ownerDocument, 1 /* ELEMENT_NODE */, typeof nodeName === "string" ? nodeName : null, null);
|
|
@@ -7128,7 +7132,9 @@ var MockElement = class extends MockNode2 {
|
|
|
7128
7132
|
return this.hasAttributeNS(null, "hidden");
|
|
7129
7133
|
}
|
|
7130
7134
|
set hidden(isHidden) {
|
|
7131
|
-
if (isHidden ===
|
|
7135
|
+
if (isHidden === "until-found") {
|
|
7136
|
+
this.setAttributeNS(null, "hidden", "until-found");
|
|
7137
|
+
} else if (isHidden === true) {
|
|
7132
7138
|
this.setAttributeNS(null, "hidden", "");
|
|
7133
7139
|
} else {
|
|
7134
7140
|
this.removeAttributeNS(null, "hidden");
|
package/mock-doc/index.d.ts
CHANGED
|
@@ -542,7 +542,17 @@ declare class MockNodeList {
|
|
|
542
542
|
ownerDocument: any;
|
|
543
543
|
constructor(ownerDocument: any, childNodes: MockNode[], length: number);
|
|
544
544
|
}
|
|
545
|
-
|
|
545
|
+
/**
|
|
546
|
+
* Just enough of `ElementInternals` for form-associated components to run without throwing.
|
|
547
|
+
* There is no form, validation or accessibility tree to update, so the methods do nothing.
|
|
548
|
+
*/
|
|
549
|
+
declare class MockElementInternals {
|
|
550
|
+
states: Set<string>;
|
|
551
|
+
setFormValue(): void;
|
|
552
|
+
setValidity(): void;
|
|
553
|
+
checkValidity(): boolean;
|
|
554
|
+
reportValidity(): boolean;
|
|
555
|
+
}
|
|
546
556
|
declare class MockElement extends MockNode {
|
|
547
557
|
attachInternals(): MockElementInternals;
|
|
548
558
|
constructor(ownerDocument: any, nodeName: string | null, namespaceURI?: string | null);
|
|
@@ -608,8 +618,8 @@ declare class MockElement extends MockNode {
|
|
|
608
618
|
insertAdjacentText(position: 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend', text: string): void;
|
|
609
619
|
hasAttribute(attrName: string): boolean;
|
|
610
620
|
hasAttributeNS(namespaceURI: string | null, name: string): boolean;
|
|
611
|
-
get hidden(): boolean;
|
|
612
|
-
set hidden(isHidden: boolean);
|
|
621
|
+
get hidden(): boolean | "until-found";
|
|
622
|
+
set hidden(isHidden: boolean | 'until-found');
|
|
613
623
|
get lang(): string;
|
|
614
624
|
set lang(value: string);
|
|
615
625
|
get lastElementChild(): MockElement | null;
|