@stencil/core 4.33.1-dev.1749534306.36fca61 → 4.33.1-dev.1749618190.28e2a06
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 +79 -59
- 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 +83 -19
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +84 -20
- 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 +3 -2
- package/internal/stencil-public-compiler.d.ts +11 -1
- package/internal/testing/index.js +82 -18
- 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 +30 -30
- 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
|
@@ -754,13 +754,17 @@ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
|
754
754
|
};
|
|
755
755
|
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
756
756
|
function patchSlotNode(node) {
|
|
757
|
-
|
|
757
|
+
var _a;
|
|
758
|
+
const slotNode = node;
|
|
759
|
+
if (slotNode.assignedElements || slotNode.assignedNodes || !node["s-sr"]) {
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
758
762
|
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
759
763
|
const toReturn = [];
|
|
760
764
|
const slotName = this["s-sn"];
|
|
761
765
|
if (opts == null ? void 0 : opts.flatten) {
|
|
762
766
|
console.error(`
|
|
763
|
-
Flattening is not supported for Stencil non-shadow slots.
|
|
767
|
+
Flattening is not supported for Stencil non-shadow slots.
|
|
764
768
|
You can use \`.childNodes\` to nested slot fallback content.
|
|
765
769
|
If you have a particular use case, please open an issue on the Stencil repo.
|
|
766
770
|
`);
|
|
@@ -777,8 +781,39 @@ function patchSlotNode(node) {
|
|
|
777
781
|
}
|
|
778
782
|
return toReturn;
|
|
779
783
|
}).bind(node);
|
|
780
|
-
|
|
781
|
-
|
|
784
|
+
slotNode.assignedElements = assignedFactory(true);
|
|
785
|
+
slotNode.assignedNodes = assignedFactory(false);
|
|
786
|
+
slotNode.__eventListeners = (_a = slotNode.__eventListeners) != null ? _a : [];
|
|
787
|
+
if (!slotNode.addEventListener) {
|
|
788
|
+
slotNode.addEventListener = function(type, listener) {
|
|
789
|
+
this.__eventListeners = this.__eventListeners || [];
|
|
790
|
+
this.__eventListeners.push({ type, listener });
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
if (!slotNode.removeEventListener) {
|
|
794
|
+
slotNode.removeEventListener = function(type, listener) {
|
|
795
|
+
if (!this.__eventListeners) return;
|
|
796
|
+
this.__eventListeners = this.__eventListeners.filter((l) => !(l.type === type && l.listener === listener));
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
if (!slotNode.dispatchEvent) {
|
|
800
|
+
slotNode.dispatchEvent = function(event) {
|
|
801
|
+
if (!this.__eventListeners) return true;
|
|
802
|
+
const listeners = this.__eventListeners.filter((l) => l.type === event.type);
|
|
803
|
+
for (const { listener } of listeners) {
|
|
804
|
+
try {
|
|
805
|
+
if (typeof listener === "function") {
|
|
806
|
+
listener.call(this, event);
|
|
807
|
+
} else if (listener && typeof listener.handleEvent === "function") {
|
|
808
|
+
listener.handleEvent(event);
|
|
809
|
+
}
|
|
810
|
+
} catch (err2) {
|
|
811
|
+
console.error("Error in slot event listener:", err2);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
return !event.defaultPrevented;
|
|
815
|
+
};
|
|
816
|
+
}
|
|
782
817
|
}
|
|
783
818
|
function dispatchSlotChangeEvent(elm) {
|
|
784
819
|
elm.dispatchEvent(new CustomEvent("slotchange", { bubbles: false, cancelable: false, composed: false }));
|
|
@@ -1408,15 +1443,19 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1408
1443
|
vnode.$elm$ = hostElm;
|
|
1409
1444
|
const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
|
|
1410
1445
|
members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
|
|
1411
|
-
var _a2;
|
|
1446
|
+
var _a2, _b;
|
|
1412
1447
|
if (!(memberFlags & 31 /* Prop */)) {
|
|
1413
1448
|
return;
|
|
1414
1449
|
}
|
|
1415
1450
|
const attributeName = metaAttributeName || memberName;
|
|
1416
1451
|
const attrVal = hostElm.getAttribute(attributeName);
|
|
1417
1452
|
if (attrVal !== null) {
|
|
1418
|
-
const attrPropVal = parsePropertyValue(
|
|
1419
|
-
|
|
1453
|
+
const attrPropVal = parsePropertyValue(
|
|
1454
|
+
attrVal,
|
|
1455
|
+
memberFlags,
|
|
1456
|
+
import_app_data6.BUILD.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
|
|
1457
|
+
);
|
|
1458
|
+
(_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
|
|
1420
1459
|
}
|
|
1421
1460
|
});
|
|
1422
1461
|
let scopeId2;
|
|
@@ -2187,7 +2226,7 @@ var import_app_data15 = require("@stencil/core/internal/app-data");
|
|
|
2187
2226
|
|
|
2188
2227
|
// src/runtime/parse-property-value.ts
|
|
2189
2228
|
var import_app_data7 = require("@stencil/core/internal/app-data");
|
|
2190
|
-
var parsePropertyValue = (propValue, propType) => {
|
|
2229
|
+
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
2191
2230
|
if ((import_app_data7.BUILD.hydrateClientSide || import_app_data7.BUILD.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
2192
2231
|
try {
|
|
2193
2232
|
propValue = JSON.parse(propValue);
|
|
@@ -2201,7 +2240,11 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
2201
2240
|
}
|
|
2202
2241
|
if (propValue != null && !isComplexType(propValue)) {
|
|
2203
2242
|
if (import_app_data7.BUILD.propBoolean && propType & 4 /* Boolean */) {
|
|
2204
|
-
|
|
2243
|
+
if (import_app_data7.BUILD.formAssociated && isFormAssociated && typeof propValue === "string") {
|
|
2244
|
+
return propValue === "" || !!propValue;
|
|
2245
|
+
} else {
|
|
2246
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
2247
|
+
}
|
|
2205
2248
|
}
|
|
2206
2249
|
if (import_app_data7.BUILD.propNumber && propType & 2 /* Number */) {
|
|
2207
2250
|
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
@@ -2547,7 +2590,7 @@ var checkSlotFallbackVisibility = false;
|
|
|
2547
2590
|
var checkSlotRelocate = false;
|
|
2548
2591
|
var isSvgMode = false;
|
|
2549
2592
|
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
2550
|
-
var _a;
|
|
2593
|
+
var _a, _b;
|
|
2551
2594
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
2552
2595
|
let i2 = 0;
|
|
2553
2596
|
let elm;
|
|
@@ -2577,6 +2620,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2577
2620
|
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
2578
2621
|
} else if (import_app_data13.BUILD.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
2579
2622
|
elm = newVNode2.$elm$ = import_app_data13.BUILD.isDebug || import_app_data13.BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : win.document.createTextNode("");
|
|
2623
|
+
elm["s-sr"] = true;
|
|
2624
|
+
elm["s-cr"] = contentRef;
|
|
2625
|
+
elm["s-sn"] = newVNode2.$name$ || "";
|
|
2626
|
+
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
2627
|
+
patchSlotNode(elm);
|
|
2580
2628
|
if (import_app_data13.BUILD.vdomAttribute) {
|
|
2581
2629
|
updateElement(null, newVNode2, isSvgMode);
|
|
2582
2630
|
}
|
|
@@ -2623,11 +2671,13 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
2623
2671
|
elm["s-hn"] = hostTagName;
|
|
2624
2672
|
if (import_app_data13.BUILD.slotRelocation) {
|
|
2625
2673
|
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2674
|
+
if (!(newVNode2.$flags$ & 1 /* isSlotReference */)) {
|
|
2675
|
+
elm["s-sr"] = true;
|
|
2676
|
+
elm["s-cr"] = contentRef;
|
|
2677
|
+
elm["s-sn"] = newVNode2.$name$ || "";
|
|
2678
|
+
elm["s-rf"] = (_b = newVNode2.$attrs$) == null ? void 0 : _b.ref;
|
|
2679
|
+
patchSlotNode(elm);
|
|
2680
|
+
}
|
|
2631
2681
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
2632
2682
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
2633
2683
|
if (import_app_data13.BUILD.experimentalSlotFixes) {
|
|
@@ -3395,7 +3445,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
3395
3445
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
3396
3446
|
const flags = hostRef.$flags$;
|
|
3397
3447
|
const instance = import_app_data15.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
3398
|
-
newVal = parsePropertyValue(
|
|
3448
|
+
newVal = parsePropertyValue(
|
|
3449
|
+
newVal,
|
|
3450
|
+
cmpMeta.$members$[propName][0],
|
|
3451
|
+
import_app_data15.BUILD.formAssociated && !!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
3452
|
+
);
|
|
3399
3453
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
3400
3454
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
3401
3455
|
if ((!import_app_data15.BUILD.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
@@ -3533,7 +3587,13 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3533
3587
|
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
3534
3588
|
ref.$instanceValues$.set(memberName, currentValue);
|
|
3535
3589
|
}
|
|
3536
|
-
origSetter.apply(this, [
|
|
3590
|
+
origSetter.apply(this, [
|
|
3591
|
+
parsePropertyValue(
|
|
3592
|
+
newValue,
|
|
3593
|
+
memberFlags,
|
|
3594
|
+
import_app_data16.BUILD.formAssociated && !!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
3595
|
+
)
|
|
3596
|
+
]);
|
|
3537
3597
|
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
3538
3598
|
setValue(this, memberName, newValue, cmpMeta);
|
|
3539
3599
|
return;
|
|
@@ -3559,7 +3619,11 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3559
3619
|
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
3560
3620
|
ref.$instanceValues$.set(memberName, currentValue);
|
|
3561
3621
|
}
|
|
3562
|
-
ref.$lazyInstance$[memberName] = parsePropertyValue(
|
|
3622
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(
|
|
3623
|
+
newValue,
|
|
3624
|
+
memberFlags,
|
|
3625
|
+
import_app_data16.BUILD.formAssociated && !!(cmpMeta.$flags$ & 64 /* formAssociated */)
|
|
3626
|
+
);
|
|
3563
3627
|
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
3564
3628
|
};
|
|
3565
3629
|
if (ref.$lazyInstance$) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/testing",
|
|
3
|
-
"version": "4.33.1-dev.
|
|
3
|
+
"version": "4.33.1-dev.1749618190.28e2a06",
|
|
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