@stencil/core 4.33.1-dev.1749520348.955217 → 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.
@@ -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
- if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
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
- node.assignedElements = assignedFactory(true);
781
- node.assignedNodes = assignedFactory(false);
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 }));
@@ -1061,7 +1096,6 @@ var patchSlottedNode = (node) => {
1061
1096
  if (node.nodeType === Node.ELEMENT_NODE) {
1062
1097
  patchNextElementSibling(node);
1063
1098
  patchPreviousElementSibling(node);
1064
- patchParentElement(node);
1065
1099
  }
1066
1100
  };
1067
1101
  var patchNextSibling = (node) => {
@@ -1129,26 +1163,15 @@ var patchParentNode = (node) => {
1129
1163
  patchHostOriginalAccessor("parentNode", node);
1130
1164
  Object.defineProperty(node, "parentNode", {
1131
1165
  get: function() {
1132
- return this.__parentNode;
1166
+ var _a;
1167
+ return ((_a = this["s-ol"]) == null ? void 0 : _a.parentNode) || this.__parentNode;
1133
1168
  },
1134
1169
  set: function(value) {
1135
1170
  this.__parentNode = value;
1136
1171
  }
1137
1172
  });
1138
1173
  };
1139
- var patchParentElement = (element) => {
1140
- if (!element || element.__parentElement) return;
1141
- patchHostOriginalAccessor("parentElement", element);
1142
- Object.defineProperty(element, "parentElement", {
1143
- get: function() {
1144
- return this.__parentElement;
1145
- },
1146
- set: function(value) {
1147
- this.__parentElement = value;
1148
- }
1149
- });
1150
- };
1151
- var validElementPatches = ["children", "nextElementSibling", "previousElementSibling", "parentElement"];
1174
+ var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
1152
1175
  var validNodesPatches = [
1153
1176
  "childNodes",
1154
1177
  "firstChild",
@@ -1420,15 +1443,19 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1420
1443
  vnode.$elm$ = hostElm;
1421
1444
  const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
1422
1445
  members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
1423
- var _a2;
1446
+ var _a2, _b;
1424
1447
  if (!(memberFlags & 31 /* Prop */)) {
1425
1448
  return;
1426
1449
  }
1427
1450
  const attributeName = metaAttributeName || memberName;
1428
1451
  const attrVal = hostElm.getAttribute(attributeName);
1429
1452
  if (attrVal !== null) {
1430
- const attrPropVal = parsePropertyValue(attrVal, memberFlags);
1431
- (_a2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a2.set(memberName, attrPropVal);
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);
1432
1459
  }
1433
1460
  });
1434
1461
  let scopeId2;
@@ -2199,7 +2226,7 @@ var import_app_data15 = require("@stencil/core/internal/app-data");
2199
2226
 
2200
2227
  // src/runtime/parse-property-value.ts
2201
2228
  var import_app_data7 = require("@stencil/core/internal/app-data");
2202
- var parsePropertyValue = (propValue, propType) => {
2229
+ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2203
2230
  if ((import_app_data7.BUILD.hydrateClientSide || import_app_data7.BUILD.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2204
2231
  try {
2205
2232
  propValue = JSON.parse(propValue);
@@ -2213,7 +2240,11 @@ var parsePropertyValue = (propValue, propType) => {
2213
2240
  }
2214
2241
  if (propValue != null && !isComplexType(propValue)) {
2215
2242
  if (import_app_data7.BUILD.propBoolean && propType & 4 /* Boolean */) {
2216
- return propValue === "false" ? false : propValue === "" || !!propValue;
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
+ }
2217
2248
  }
2218
2249
  if (import_app_data7.BUILD.propNumber && propType & 2 /* Number */) {
2219
2250
  return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
@@ -2559,7 +2590,7 @@ var checkSlotFallbackVisibility = false;
2559
2590
  var checkSlotRelocate = false;
2560
2591
  var isSvgMode = false;
2561
2592
  var createElm = (oldParentVNode, newParentVNode, childIndex) => {
2562
- var _a;
2593
+ var _a, _b;
2563
2594
  const newVNode2 = newParentVNode.$children$[childIndex];
2564
2595
  let i2 = 0;
2565
2596
  let elm;
@@ -2589,6 +2620,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
2589
2620
  elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
2590
2621
  } else if (import_app_data13.BUILD.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
2591
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);
2592
2628
  if (import_app_data13.BUILD.vdomAttribute) {
2593
2629
  updateElement(null, newVNode2, isSvgMode);
2594
2630
  }
@@ -2635,11 +2671,13 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
2635
2671
  elm["s-hn"] = hostTagName;
2636
2672
  if (import_app_data13.BUILD.slotRelocation) {
2637
2673
  if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
2638
- elm["s-sr"] = true;
2639
- elm["s-cr"] = contentRef;
2640
- elm["s-sn"] = newVNode2.$name$ || "";
2641
- elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
2642
- patchSlotNode(elm);
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
+ }
2643
2681
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
2644
2682
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
2645
2683
  if (import_app_data13.BUILD.experimentalSlotFixes) {
@@ -3407,7 +3445,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
3407
3445
  const oldVal = hostRef.$instanceValues$.get(propName);
3408
3446
  const flags = hostRef.$flags$;
3409
3447
  const instance = import_app_data15.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
3410
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
3448
+ newVal = parsePropertyValue(
3449
+ newVal,
3450
+ cmpMeta.$members$[propName][0],
3451
+ import_app_data15.BUILD.formAssociated && !!(cmpMeta.$flags$ & 64 /* formAssociated */)
3452
+ );
3411
3453
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
3412
3454
  const didValueChange = newVal !== oldVal && !areBothNaN;
3413
3455
  if ((!import_app_data15.BUILD.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
@@ -3545,7 +3587,13 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3545
3587
  } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
3546
3588
  ref.$instanceValues$.set(memberName, currentValue);
3547
3589
  }
3548
- origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
3590
+ origSetter.apply(this, [
3591
+ parsePropertyValue(
3592
+ newValue,
3593
+ memberFlags,
3594
+ import_app_data16.BUILD.formAssociated && !!(cmpMeta.$flags$ & 64 /* formAssociated */)
3595
+ )
3596
+ ]);
3549
3597
  newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
3550
3598
  setValue(this, memberName, newValue, cmpMeta);
3551
3599
  return;
@@ -3571,7 +3619,11 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3571
3619
  if (!ref.$instanceValues$.get(memberName) && currentValue) {
3572
3620
  ref.$instanceValues$.set(memberName, currentValue);
3573
3621
  }
3574
- ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
3622
+ ref.$lazyInstance$[memberName] = parsePropertyValue(
3623
+ newValue,
3624
+ memberFlags,
3625
+ import_app_data16.BUILD.formAssociated && !!(cmpMeta.$flags$ & 64 /* formAssociated */)
3626
+ );
3575
3627
  setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
3576
3628
  };
3577
3629
  if (ref.$lazyInstance$) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/testing",
3
- "version": "4.33.1-dev.1749520348.0955217",
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
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc (CommonJS) v4.33.1-dev.1749520348.0955217 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc (CommonJS) v4.33.1-dev.1749618190.28e2a06 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __defProp = Object.defineProperty;
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc v4.33.1-dev.1749520348.0955217 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v4.33.1-dev.1749618190.28e2a06 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/runtime/runtime-constants.ts
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "4.33.1-dev.1749520348.0955217",
3
+ "version": "4.33.1-dev.1749618190.28e2a06",
4
4
  "description": "Mock window, document and DOM outside of a browser environment.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core",
3
- "version": "4.33.1-dev.1749520348.955217",
3
+ "version": "4.33.1-dev.1749618190.28e2a06",
4
4
  "license": "MIT",
5
5
  "main": "./internal/stencil-core/index.cjs",
6
6
  "module": "./internal/stencil-core/index.js",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Screenshot v4.33.1-dev.1749520348.0955217 | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot v4.33.1-dev.1749618190.28e2a06 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/screenshot",
3
- "version": "4.33.1-dev.1749520348.0955217",
3
+ "version": "4.33.1-dev.1749618190.28e2a06",
4
4
  "description": "Stencil Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Screenshot Pixel Match v4.33.1-dev.1749520348.0955217 | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot Pixel Match v4.33.1-dev.1749618190.28e2a06 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;