@stencil/core 4.22.2 → 4.22.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.
@@ -1680,7 +1680,7 @@ var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
1680
1680
  if (element && parent && element.nodeType === 1 /* ElementNode */) {
1681
1681
  const scopeIds = new Set(findScopeIds(parent).filter(Boolean));
1682
1682
  if (scopeIds.size) {
1683
- (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = [...scopeIds]);
1683
+ (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = Array.from(scopeIds));
1684
1684
  if (element["s-ol"] || iterateChildNodes) {
1685
1685
  for (const childNode of Array.from(element.childNodes)) {
1686
1686
  updateElementScopeIds(childNode, element, true);
@@ -2166,24 +2166,24 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
2166
2166
  var _a, _b;
2167
2167
  const prototype = Cstr.prototype;
2168
2168
  if (import_app_data13.BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
2169
- FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach(
2170
- (cbName) => Object.defineProperty(prototype, cbName, {
2169
+ FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
2170
+ const originalFormAssociatedCallback = prototype[cbName];
2171
+ Object.defineProperty(prototype, cbName, {
2171
2172
  value(...args) {
2172
2173
  const hostRef = getHostRef(this);
2173
- const elm = import_app_data13.BUILD.lazyLoad ? hostRef.$hostElement$ : this;
2174
- const instance = import_app_data13.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2174
+ const instance = import_app_data13.BUILD.lazyLoad ? hostRef.$lazyInstance$ : this;
2175
2175
  if (!instance) {
2176
- hostRef.$onReadyPromise$.then((instance2) => {
2177
- const cb = instance2[cbName];
2178
- typeof cb === "function" && cb.call(instance2, ...args);
2176
+ hostRef.$onReadyPromise$.then((asyncInstance) => {
2177
+ const cb = asyncInstance[cbName];
2178
+ typeof cb === "function" && cb.call(asyncInstance, ...args);
2179
2179
  });
2180
2180
  } else {
2181
- const cb = instance[cbName];
2181
+ const cb = import_app_data13.BUILD.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
2182
2182
  typeof cb === "function" && cb.call(instance, ...args);
2183
2183
  }
2184
2184
  }
2185
- })
2186
- );
2185
+ });
2186
+ });
2187
2187
  }
2188
2188
  if (import_app_data13.BUILD.member && cmpMeta.$members$ || import_app_data13.BUILD.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
2189
2189
  if (import_app_data13.BUILD.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
@@ -2830,13 +2830,17 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2830
2830
  }
2831
2831
  const originalConnectedCallback = Cstr.prototype.connectedCallback;
2832
2832
  const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
2833
+ let hasHostListenerAttached = false;
2833
2834
  Object.assign(Cstr.prototype, {
2834
2835
  __registerHost() {
2835
2836
  registerHost(this, cmpMeta);
2836
2837
  },
2837
2838
  connectedCallback() {
2838
- const hostRef = getHostRef(this);
2839
- addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
2839
+ if (!hasHostListenerAttached) {
2840
+ const hostRef = getHostRef(this);
2841
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
2842
+ hasHostListenerAttached = true;
2843
+ }
2840
2844
  connectedCallback(this);
2841
2845
  if (import_app_data18.BUILD.connectedCallback && originalConnectedCallback) {
2842
2846
  originalConnectedCallback.call(this);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/testing",
3
- "version": "4.22.2",
3
+ "version": "4.22.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
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc (CommonJS) v4.22.2 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc (CommonJS) v4.22.3 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __defProp = Object.defineProperty;
@@ -7844,6 +7844,9 @@ var MockAnchorElement = class extends MockHTMLElement {
7844
7844
  this.setAttribute("href", value);
7845
7845
  }
7846
7846
  get pathname() {
7847
+ if (!this.href) {
7848
+ return "";
7849
+ }
7847
7850
  return new URL(this.href).pathname;
7848
7851
  }
7849
7852
  };
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc v4.22.2 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v4.22.3 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/runtime/runtime-constants.ts
@@ -7791,6 +7791,9 @@ var MockAnchorElement = class extends MockHTMLElement {
7791
7791
  this.setAttribute("href", value);
7792
7792
  }
7793
7793
  get pathname() {
7794
+ if (!this.href) {
7795
+ return "";
7796
+ }
7794
7797
  return new URL(this.href).pathname;
7795
7798
  }
7796
7799
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "4.22.2",
3
+ "version": "4.22.3",
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.22.2",
3
+ "version": "4.22.3",
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.22.2 | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot v4.22.3 | 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.22.2",
3
+ "version": "4.22.3",
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.22.2 | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot Pixel Match v4.22.3 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;