@stencil/core 4.45.2-dev.1794373558.f615a1c → 4.45.2-dev.1794432084.9be802b

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Hydrate Runner v4.45.2-dev.1794373558.f615a1c | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Runner v4.45.2-dev.1794432084.9be802b | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -11581,7 +11581,9 @@ var MockElement = class extends MockNode2 {
11581
11581
  return this.hasAttributeNS(null, "hidden");
11582
11582
  }
11583
11583
  set hidden(isHidden) {
11584
- if (isHidden === true) {
11584
+ if (isHidden === "until-found") {
11585
+ this.setAttributeNS(null, "hidden", "until-found");
11586
+ } else if (isHidden === true) {
11585
11587
  this.setAttributeNS(null, "hidden", "");
11586
11588
  } else {
11587
11589
  this.removeAttributeNS(null, "hidden");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal",
3
- "version": "4.45.2-dev.1794373558.f615a1c",
3
+ "version": "4.45.2-dev.1794432084.9be802b",
4
4
  "description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1402,7 +1402,7 @@ export declare namespace JSXBase {
1402
1402
  contextmenu?: string;
1403
1403
  dir?: string;
1404
1404
  draggable?: boolean;
1405
- hidden?: boolean;
1405
+ hidden?: boolean | 'until-found';
1406
1406
  id?: string;
1407
1407
  inert?: boolean;
1408
1408
  lang?: string;
@@ -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
- updateFallbackSlotVisibility(this);
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
- let found = false;
2964
- slottedNodes.forEach((childNode) => {
2965
- if (childNode === currentChild || currentChild === null) {
2966
- found = true;
2967
- if (currentChild === null || slotName !== currentChild["s-sn"]) {
2968
- this.appendChild(newChild);
2969
- return;
2970
- }
2971
- if (slotName === currentChild["s-sn"]) {
2972
- addSlotRelocateNode(newChild, slotNode);
2973
- const parent = internalCall(currentChild, "parentNode");
2974
- internalCall(parent, "insertBefore")(newChild, currentChild);
2975
- dispatchSlotChangeEvent(slotNode);
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
- if (found) return newChild;
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
- const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
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) {
@@ -5953,7 +5978,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
5953
5978
  newValue = newValue === null || newValue === "false" && !isFormAssociated ? false : true;
5954
5979
  }
5955
5980
  const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
5956
- if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
5981
+ const isUnchanged = newValue === this[propName] || newValue == null && this[propName] == null;
5982
+ if (!isSpuriousBooleanRemoval && !isUnchanged && (!propDesc.get || !!propDesc.set)) {
5957
5983
  this[propName] = newValue;
5958
5984
  }
5959
5985
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/testing",
3
- "version": "4.45.2-dev.1794373558.f615a1c",
3
+ "version": "4.45.2-dev.1794432084.9be802b",
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.45.2-dev.1794373558.f615a1c | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc (CommonJS) v4.45.2-dev.1794432084.9be802b | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __defProp = Object.defineProperty;
@@ -7132,7 +7132,9 @@ var MockElement = class extends MockNode2 {
7132
7132
  return this.hasAttributeNS(null, "hidden");
7133
7133
  }
7134
7134
  set hidden(isHidden) {
7135
- if (isHidden === true) {
7135
+ if (isHidden === "until-found") {
7136
+ this.setAttributeNS(null, "hidden", "until-found");
7137
+ } else if (isHidden === true) {
7136
7138
  this.setAttributeNS(null, "hidden", "");
7137
7139
  } else {
7138
7140
  this.removeAttributeNS(null, "hidden");
@@ -618,8 +618,8 @@ declare class MockElement extends MockNode {
618
618
  insertAdjacentText(position: 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend', text: string): void;
619
619
  hasAttribute(attrName: string): boolean;
620
620
  hasAttributeNS(namespaceURI: string | null, name: string): boolean;
621
- get hidden(): boolean;
622
- set hidden(isHidden: boolean);
621
+ get hidden(): boolean | "until-found";
622
+ set hidden(isHidden: boolean | 'until-found');
623
623
  get lang(): string;
624
624
  set lang(value: string);
625
625
  get lastElementChild(): MockElement | null;
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc v4.45.2-dev.1794373558.f615a1c | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v4.45.2-dev.1794432084.9be802b | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -7080,7 +7080,9 @@ var MockElement = class extends MockNode2 {
7080
7080
  return this.hasAttributeNS(null, "hidden");
7081
7081
  }
7082
7082
  set hidden(isHidden) {
7083
- if (isHidden === true) {
7083
+ if (isHidden === "until-found") {
7084
+ this.setAttributeNS(null, "hidden", "until-found");
7085
+ } else if (isHidden === true) {
7084
7086
  this.setAttributeNS(null, "hidden", "");
7085
7087
  } else {
7086
7088
  this.removeAttributeNS(null, "hidden");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "4.45.2-dev.1794373558.f615a1c",
3
+ "version": "4.45.2-dev.1794432084.9be802b",
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.45.2-dev.1794373558.f615a1c",
3
+ "version": "4.45.2-dev.1794432084.9be802b",
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.45.2-dev.1794373558.f615a1c | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot v4.45.2-dev.1794432084.9be802b | 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.45.2-dev.1794373558.f615a1c",
3
+ "version": "4.45.2-dev.1794432084.9be802b",
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.45.2-dev.1794373558.f615a1c | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot Pixel Match v4.45.2-dev.1794432084.9be802b | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;