@stencil/core 4.43.3 → 4.43.4-dev.1776145387.a1589d9

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 Platform v4.43.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Platform v4.43.4-dev.1776145387.a1589d9 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -2178,6 +2178,31 @@ var getMode = (ref) => {
2178
2178
  return (_a2 = getHostRef(ref)) == null ? void 0 : _a2.$modeName$;
2179
2179
  };
2180
2180
 
2181
+ // src/runtime/normalize-watchers.ts
2182
+ var normalizeWatchers = (raw) => {
2183
+ if (!raw) return void 0;
2184
+ const keys = Object.keys(raw);
2185
+ if (keys.length === 0) return void 0;
2186
+ let hasLegacy = false;
2187
+ for (const propName of keys) {
2188
+ if (hasLegacy) break;
2189
+ for (const h2 of raw[propName]) {
2190
+ if (typeof h2 === "string") {
2191
+ hasLegacy = true;
2192
+ break;
2193
+ }
2194
+ }
2195
+ }
2196
+ if (!hasLegacy) return raw;
2197
+ const out = {};
2198
+ for (const propName of keys) {
2199
+ out[propName] = raw[propName].map(
2200
+ (h2) => typeof h2 === "string" ? { [h2]: 0 } : h2
2201
+ );
2202
+ }
2203
+ return out;
2204
+ };
2205
+
2181
2206
  // src/runtime/proxy-component.ts
2182
2207
  import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
2183
2208
 
@@ -2283,11 +2308,19 @@ var RemoteValue = class _RemoteValue {
2283
2308
  };
2284
2309
 
2285
2310
  // src/utils/serialize.ts
2311
+ function decodeBase64Unicode(base64) {
2312
+ const binary = atob(base64);
2313
+ const bytes = new Uint8Array(binary.length);
2314
+ for (let i2 = 0; i2 < binary.length; i2++) {
2315
+ bytes[i2] = binary.charCodeAt(i2);
2316
+ }
2317
+ return new TextDecoder().decode(bytes);
2318
+ }
2286
2319
  function deserializeProperty(value) {
2287
2320
  if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
2288
2321
  return value;
2289
2322
  }
2290
- return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
2323
+ return RemoteValue.fromLocalValue(JSON.parse(decodeBase64Unicode(value.slice(SERIALIZED_PREFIX.length))));
2291
2324
  }
2292
2325
 
2293
2326
  // src/runtime/parse-property-value.ts
@@ -3604,7 +3637,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
3604
3637
  if (BUILD17.member && cmpMeta.$members$ || BUILD17.propChangeCallback) {
3605
3638
  if (BUILD17.propChangeCallback) {
3606
3639
  if (Cstr.watchers && !cmpMeta.$watchers$) {
3607
- cmpMeta.$watchers$ = Cstr.watchers;
3640
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
3608
3641
  }
3609
3642
  if (Cstr.deserializers && !cmpMeta.$deserializers$) {
3610
3643
  cmpMeta.$deserializers$ = Cstr.deserializers;
@@ -3782,11 +3815,13 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3782
3815
  return;
3783
3816
  }
3784
3817
  const propFlags = members.find(([m]) => m === propName);
3785
- if (propFlags && propFlags[1][0] & 4 /* Boolean */) {
3818
+ const isBooleanTarget = propFlags && propFlags[1][0] & 4 /* Boolean */;
3819
+ const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
3820
+ if (isBooleanTarget) {
3786
3821
  newValue = newValue === null || newValue === "false" ? false : true;
3787
3822
  }
3788
3823
  const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
3789
- if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
3824
+ if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
3790
3825
  this[propName] = newValue;
3791
3826
  }
3792
3827
  });
@@ -3834,7 +3869,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3834
3869
  }
3835
3870
  if (BUILD18.member && !Cstr.isProxied) {
3836
3871
  if (BUILD18.propChangeCallback) {
3837
- cmpMeta.$watchers$ = Cstr.watchers;
3872
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
3838
3873
  cmpMeta.$serializers$ = Cstr.serializers;
3839
3874
  cmpMeta.$deserializers$ = Cstr.deserializers;
3840
3875
  }
@@ -4051,7 +4086,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
4051
4086
  cmpMeta.$listeners$ = compactMeta[3];
4052
4087
  }
4053
4088
  if (BUILD21.propChangeCallback) {
4054
- cmpMeta.$watchers$ = Cstr.$watchers$;
4089
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.$watchers$);
4055
4090
  cmpMeta.$deserializers$ = Cstr.$deserializers$;
4056
4091
  cmpMeta.$serializers$ = Cstr.$serializers$;
4057
4092
  }
@@ -4210,7 +4245,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
4210
4245
  let hasSlotRelocation = false;
4211
4246
  lazyBundles.map((lazyBundle) => {
4212
4247
  lazyBundle[1].map((compactMeta) => {
4213
- var _a3, _b, _c;
4248
+ var _a3, _b;
4214
4249
  const cmpMeta = {
4215
4250
  $flags$: compactMeta[0],
4216
4251
  $tagName$: compactMeta[1],
@@ -4230,9 +4265,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
4230
4265
  cmpMeta.$attrsToReflect$ = [];
4231
4266
  }
4232
4267
  if (BUILD22.propChangeCallback) {
4233
- cmpMeta.$watchers$ = (_a3 = compactMeta[4]) != null ? _a3 : {};
4234
- cmpMeta.$serializers$ = (_b = compactMeta[5]) != null ? _b : {};
4235
- cmpMeta.$deserializers$ = (_c = compactMeta[6]) != null ? _c : {};
4268
+ cmpMeta.$watchers$ = normalizeWatchers(compactMeta[4]);
4269
+ cmpMeta.$serializers$ = (_a3 = compactMeta[5]) != null ? _a3 : {};
4270
+ cmpMeta.$deserializers$ = (_b = compactMeta[6]) != null ? _b : {};
4236
4271
  }
4237
4272
  if (BUILD22.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
4238
4273
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/hydrate",
3
- "version": "4.43.3",
3
+ "version": "4.43.4-dev.1776145387.a1589d9",
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.43.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Runner v4.43.4-dev.1776145387.a1589d9 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -14947,18 +14947,34 @@ var RemoteValue = class _RemoteValue {
14947
14947
  };
14948
14948
 
14949
14949
  // src/utils/serialize.ts
14950
+ function encodeBase64Unicode(str) {
14951
+ const utf8Bytes = new TextEncoder().encode(str);
14952
+ let binary = "";
14953
+ for (let i = 0; i < utf8Bytes.length; i++) {
14954
+ binary += String.fromCharCode(utf8Bytes[i]);
14955
+ }
14956
+ return btoa(binary);
14957
+ }
14958
+ function decodeBase64Unicode(base64) {
14959
+ const binary = atob(base64);
14960
+ const bytes = new Uint8Array(binary.length);
14961
+ for (let i = 0; i < binary.length; i++) {
14962
+ bytes[i] = binary.charCodeAt(i);
14963
+ }
14964
+ return new TextDecoder().decode(bytes);
14965
+ }
14950
14966
  function serializeProperty(value) {
14951
14967
  if (["string", "boolean", "undefined"].includes(typeof value) || typeof value === "number" && value !== Infinity && value !== -Infinity && !isNaN(value)) {
14952
14968
  return value;
14953
14969
  }
14954
14970
  const arg = LocalValue.getArgument(value);
14955
- return SERIALIZED_PREFIX + btoa(JSON.stringify(arg));
14971
+ return SERIALIZED_PREFIX + encodeBase64Unicode(JSON.stringify(arg));
14956
14972
  }
14957
14973
  function deserializeProperty(value) {
14958
14974
  if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
14959
14975
  return value;
14960
14976
  }
14961
- return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
14977
+ return RemoteValue.fromLocalValue(JSON.parse(decodeBase64Unicode(value.slice(SERIALIZED_PREFIX.length))));
14962
14978
  }
14963
14979
 
14964
14980
  // src/runtime/update-component.ts
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal",
3
- "version": "4.43.3",
3
+ "version": "4.43.4-dev.1776145387.a1589d9",
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",
@@ -288,6 +288,7 @@ __export(index_exports, {
288
288
  modeResolutionChain: () => modeResolutionChain,
289
289
  needsScopedSSR: () => needsScopedSSR,
290
290
  nextTick: () => nextTick,
291
+ normalizeWatchers: () => normalizeWatchers,
291
292
  parsePropertyValue: () => parsePropertyValue,
292
293
  plt: () => plt,
293
294
  postUpdateComponent: () => postUpdateComponent,
@@ -2129,11 +2130,19 @@ var unwrapErr = (result) => {
2129
2130
  };
2130
2131
 
2131
2132
  // src/utils/serialize.ts
2133
+ function decodeBase64Unicode(base64) {
2134
+ const binary = atob(base64);
2135
+ const bytes = new Uint8Array(binary.length);
2136
+ for (let i2 = 0; i2 < binary.length; i2++) {
2137
+ bytes[i2] = binary.charCodeAt(i2);
2138
+ }
2139
+ return new TextDecoder().decode(bytes);
2140
+ }
2132
2141
  function deserializeProperty(value) {
2133
2142
  if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
2134
2143
  return value;
2135
2144
  }
2136
- return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
2145
+ return RemoteValue.fromLocalValue(JSON.parse(decodeBase64Unicode(value.slice(SERIALIZED_PREFIX.length))));
2137
2146
  }
2138
2147
 
2139
2148
  // src/utils/shadow-root.ts
@@ -4292,6 +4301,31 @@ var getMode = (ref) => {
4292
4301
  return (_a2 = getHostRef(ref)) == null ? void 0 : _a2.$modeName$;
4293
4302
  };
4294
4303
 
4304
+ // src/runtime/normalize-watchers.ts
4305
+ var normalizeWatchers = (raw) => {
4306
+ if (!raw) return void 0;
4307
+ const keys = Object.keys(raw);
4308
+ if (keys.length === 0) return void 0;
4309
+ let hasLegacy = false;
4310
+ for (const propName of keys) {
4311
+ if (hasLegacy) break;
4312
+ for (const h2 of raw[propName]) {
4313
+ if (typeof h2 === "string") {
4314
+ hasLegacy = true;
4315
+ break;
4316
+ }
4317
+ }
4318
+ }
4319
+ if (!hasLegacy) return raw;
4320
+ const out = {};
4321
+ for (const propName of keys) {
4322
+ out[propName] = raw[propName].map(
4323
+ (h2) => typeof h2 === "string" ? { [h2]: 0 } : h2
4324
+ );
4325
+ }
4326
+ return out;
4327
+ };
4328
+
4295
4329
  // src/runtime/proxy-component.ts
4296
4330
  var import_app_data16 = require("@stencil/core/internal/app-data");
4297
4331
 
@@ -5591,7 +5625,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
5591
5625
  if (import_app_data16.BUILD.member && cmpMeta.$members$ || import_app_data16.BUILD.propChangeCallback) {
5592
5626
  if (import_app_data16.BUILD.propChangeCallback) {
5593
5627
  if (Cstr.watchers && !cmpMeta.$watchers$) {
5594
- cmpMeta.$watchers$ = Cstr.watchers;
5628
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
5595
5629
  }
5596
5630
  if (Cstr.deserializers && !cmpMeta.$deserializers$) {
5597
5631
  cmpMeta.$deserializers$ = Cstr.deserializers;
@@ -5769,11 +5803,13 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
5769
5803
  return;
5770
5804
  }
5771
5805
  const propFlags = members.find(([m]) => m === propName);
5772
- if (propFlags && propFlags[1][0] & 4 /* Boolean */) {
5806
+ const isBooleanTarget = propFlags && propFlags[1][0] & 4 /* Boolean */;
5807
+ const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
5808
+ if (isBooleanTarget) {
5773
5809
  newValue = newValue === null || newValue === "false" ? false : true;
5774
5810
  }
5775
5811
  const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
5776
- if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
5812
+ if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
5777
5813
  this[propName] = newValue;
5778
5814
  }
5779
5815
  });
@@ -5821,7 +5857,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
5821
5857
  }
5822
5858
  if (import_app_data17.BUILD.member && !Cstr.isProxied) {
5823
5859
  if (import_app_data17.BUILD.propChangeCallback) {
5824
- cmpMeta.$watchers$ = Cstr.watchers;
5860
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
5825
5861
  cmpMeta.$serializers$ = Cstr.serializers;
5826
5862
  cmpMeta.$deserializers$ = Cstr.deserializers;
5827
5863
  }
@@ -6038,7 +6074,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
6038
6074
  cmpMeta.$listeners$ = compactMeta[3];
6039
6075
  }
6040
6076
  if (import_app_data20.BUILD.propChangeCallback) {
6041
- cmpMeta.$watchers$ = Cstr.$watchers$;
6077
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.$watchers$);
6042
6078
  cmpMeta.$deserializers$ = Cstr.$deserializers$;
6043
6079
  cmpMeta.$serializers$ = Cstr.$serializers$;
6044
6080
  }
@@ -6197,7 +6233,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
6197
6233
  let hasSlotRelocation = false;
6198
6234
  lazyBundles.map((lazyBundle) => {
6199
6235
  lazyBundle[1].map((compactMeta) => {
6200
- var _a3, _b, _c;
6236
+ var _a3, _b;
6201
6237
  const cmpMeta = {
6202
6238
  $flags$: compactMeta[0],
6203
6239
  $tagName$: compactMeta[1],
@@ -6217,9 +6253,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
6217
6253
  cmpMeta.$attrsToReflect$ = [];
6218
6254
  }
6219
6255
  if (import_app_data21.BUILD.propChangeCallback) {
6220
- cmpMeta.$watchers$ = (_a3 = compactMeta[4]) != null ? _a3 : {};
6221
- cmpMeta.$serializers$ = (_b = compactMeta[5]) != null ? _b : {};
6222
- cmpMeta.$deserializers$ = (_c = compactMeta[6]) != null ? _c : {};
6256
+ cmpMeta.$watchers$ = normalizeWatchers(compactMeta[4]);
6257
+ cmpMeta.$serializers$ = (_a3 = compactMeta[5]) != null ? _a3 : {};
6258
+ cmpMeta.$deserializers$ = (_b = compactMeta[6]) != null ? _b : {};
6223
6259
  }
6224
6260
  if (import_app_data21.BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
6225
6261
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
@@ -6433,16 +6469,21 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
6433
6469
  var setPlatformOptions = (opts) => Object.assign(plt, opts);
6434
6470
 
6435
6471
  // src/runtime/render.ts
6472
+ var hostRefCache = /* @__PURE__ */ new WeakMap();
6436
6473
  function render(vnode, container) {
6437
- const cmpMeta = {
6438
- $flags$: 0,
6439
- $tagName$: container.tagName
6440
- };
6441
- const ref = {
6442
- $flags$: 0,
6443
- $cmpMeta$: cmpMeta,
6444
- $hostElement$: container
6445
- };
6474
+ let ref = hostRefCache.get(container);
6475
+ if (!ref) {
6476
+ const cmpMeta = {
6477
+ $flags$: 0,
6478
+ $tagName$: container.tagName
6479
+ };
6480
+ ref = {
6481
+ $flags$: 0,
6482
+ $cmpMeta$: cmpMeta,
6483
+ $hostElement$: container
6484
+ };
6485
+ hostRefCache.set(container, ref);
6486
+ }
6446
6487
  renderVdom(ref, vnode);
6447
6488
  }
6448
6489
 
@@ -6701,6 +6742,7 @@ var scopedSSR = false;
6701
6742
  modeResolutionChain,
6702
6743
  needsScopedSSR,
6703
6744
  nextTick,
6745
+ normalizeWatchers,
6704
6746
  parsePropertyValue,
6705
6747
  plt,
6706
6748
  postUpdateComponent,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/testing",
3
- "version": "4.43.3",
3
+ "version": "4.43.4-dev.1776145387.a1589d9",
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.43.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc (CommonJS) v4.43.4-dev.1776145387.a1589d9 | 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.43.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v4.43.4-dev.1776145387.a1589d9 | 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;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "4.43.3",
3
+ "version": "4.43.4-dev.1776145387.a1589d9",
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.43.3",
3
+ "version": "4.43.4-dev.1776145387.a1589d9",
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.43.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot v4.43.4-dev.1776145387.a1589d9 | 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.43.3",
3
+ "version": "4.43.4-dev.1776145387.a1589d9",
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.43.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot Pixel Match v4.43.4-dev.1776145387.a1589d9 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;