lwc 2.45.5 → 2.46.0

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.
Files changed (65) hide show
  1. package/README.md +5 -11
  2. package/dist/engine-dom/esm/es2017/engine-dom.js +60 -115
  3. package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom.js +60 -115
  5. package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -1
  6. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +58 -113
  8. package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
  9. package/dist/engine-dom/iife/es5/engine-dom.js +54 -110
  10. package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -1
  11. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  12. package/dist/engine-dom/iife/es5/engine-dom_debug.js +52 -108
  13. package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
  14. package/dist/engine-dom/umd/es2017/engine-dom.js +60 -115
  15. package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -1
  16. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  17. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +58 -113
  18. package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
  19. package/dist/engine-dom/umd/es5/engine-dom.js +54 -110
  20. package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -1
  21. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  22. package/dist/engine-dom/umd/es5/engine-dom_debug.js +52 -108
  23. package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
  24. package/dist/engine-server/commonjs/es2017/engine-server.js +58 -114
  25. package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -1
  26. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  27. package/dist/engine-server/esm/es2017/engine-server.js +58 -114
  28. package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
  29. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
  30. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
  31. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
  32. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
  33. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
  34. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
  35. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
  36. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
  37. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
  38. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
  39. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
  40. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
  41. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
  42. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
  43. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  44. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
  45. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  46. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
  47. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  48. package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
  49. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  50. package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
  51. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  52. package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
  53. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  54. package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
  55. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  56. package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
  57. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  58. package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
  59. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  60. package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
  61. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  62. package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
  63. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  64. package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
  65. package/package.json +7 -7
@@ -249,55 +249,35 @@ var LWC = (function (exports) {
249
249
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
250
250
  */
251
251
  const CAMEL_REGEX = /-([a-z])/g;
252
- // Convoluted map generation so that @lwc/shared remains fully tree-shakable (verify-treeshakable)
253
- const { NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING, NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING } =
254
- /*#__PURE__*/ (() => {
255
- /**
256
- * Map composed of properties to attributes not following the HTML property to attribute mapping
257
- * convention.
258
- */
259
- const NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING = new Map([
260
- ['accessKey', 'accesskey'],
261
- ['readOnly', 'readonly'],
262
- ['tabIndex', 'tabindex'],
263
- ['bgColor', 'bgcolor'],
264
- ['colSpan', 'colspan'],
265
- ['rowSpan', 'rowspan'],
266
- ['contentEditable', 'contenteditable'],
267
- ['crossOrigin', 'crossorigin'],
268
- ['dateTime', 'datetime'],
269
- ['formAction', 'formaction'],
270
- ['isMap', 'ismap'],
271
- ['maxLength', 'maxlength'],
272
- ['minLength', 'minlength'],
273
- ['noValidate', 'novalidate'],
274
- ['useMap', 'usemap'],
275
- ['htmlFor', 'for'],
276
- ]);
277
- /**
278
- * Inverted map with attribute name key and property name value.
279
- */
280
- const NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING = new Map();
281
- NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING.forEach((value, key) => NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING.set(value, key));
282
- return {
283
- NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING,
284
- NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING,
285
- };
286
- })();
252
+ // These are HTML standard prop/attribute IDL mappings, but are not predictable based on camel/kebab-case conversion
253
+ const SPECIAL_PROPERTY_ATTRIBUTE_MAPPING = /*@__PURE__@*/ new Map([
254
+ ['accessKey', 'accesskey'],
255
+ ['readOnly', 'readonly'],
256
+ ['tabIndex', 'tabindex'],
257
+ ['bgColor', 'bgcolor'],
258
+ ['colSpan', 'colspan'],
259
+ ['rowSpan', 'rowspan'],
260
+ ['contentEditable', 'contenteditable'],
261
+ ['crossOrigin', 'crossorigin'],
262
+ ['dateTime', 'datetime'],
263
+ ['formAction', 'formaction'],
264
+ ['isMap', 'ismap'],
265
+ ['maxLength', 'maxlength'],
266
+ ['minLength', 'minlength'],
267
+ ['noValidate', 'novalidate'],
268
+ ['useMap', 'usemap'],
269
+ ['htmlFor', 'for'],
270
+ ]);
287
271
  /**
288
272
  * Map associating previously transformed HTML property into HTML attribute.
289
273
  */
290
274
  const CACHED_PROPERTY_ATTRIBUTE_MAPPING = /*@__PURE__@*/ new Map();
291
- /**
292
- * Map associating previously transformed HTML attribute into HTML property.
293
- */
294
- const CACHED_ATTRIBUTE_PROPERTY_MAPPING = /*@__PURE__@*/ new Map();
295
275
  function htmlPropertyToAttribute(propName) {
296
276
  const ariaAttributeName = AriaPropNameToAttrNameMap[propName];
297
277
  if (!isUndefined$1(ariaAttributeName)) {
298
278
  return ariaAttributeName;
299
279
  }
300
- const specialAttributeName = NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING.get(propName);
280
+ const specialAttributeName = SPECIAL_PROPERTY_ATTRIBUTE_MAPPING.get(propName);
301
281
  if (!isUndefined$1(specialAttributeName)) {
302
282
  return specialAttributeName;
303
283
  }
@@ -320,22 +300,17 @@ var LWC = (function (exports) {
320
300
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
321
301
  return attributeName;
322
302
  }
323
- function htmlAttributeToProperty(attrName) {
324
- const ariaPropertyName = AriaAttrNameToPropNameMap[attrName];
325
- if (!isUndefined$1(ariaPropertyName)) {
326
- return ariaPropertyName;
327
- }
328
- const specialPropertyName = NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING.get(attrName);
329
- if (!isUndefined$1(specialPropertyName)) {
330
- return specialPropertyName;
331
- }
332
- const cachedPropertyName = CACHED_ATTRIBUTE_PROPERTY_MAPPING.get(attrName);
333
- if (!isUndefined$1(cachedPropertyName)) {
334
- return cachedPropertyName;
303
+ /**
304
+ * Map associating previously transformed kabab-case attributes into camel-case props.
305
+ */
306
+ const CACHED_KEBAB_CAMEL_MAPPING = /*@__PURE__@*/ new Map();
307
+ function kebabCaseToCamelCase(attrName) {
308
+ let result = CACHED_KEBAB_CAMEL_MAPPING.get(attrName);
309
+ if (isUndefined$1(result)) {
310
+ result = StringReplace.call(attrName, CAMEL_REGEX, (g) => g[1].toUpperCase());
311
+ CACHED_KEBAB_CAMEL_MAPPING.set(attrName, result);
335
312
  }
336
- const propertyName = StringReplace.call(attrName, CAMEL_REGEX, (g) => g[1].toUpperCase());
337
- CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
338
- return propertyName;
313
+ return result;
339
314
  }
340
315
 
341
316
  /*
@@ -345,9 +320,9 @@ var LWC = (function (exports) {
345
320
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
346
321
  */
347
322
  // Increment whenever the LWC template compiler changes
348
- const LWC_VERSION = "2.45.5";
323
+ const LWC_VERSION = "2.46.0";
349
324
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
350
- /** version: 2.45.5 */
325
+ /** version: 2.46.0 */
351
326
 
352
327
  /* proxy-compat-disable */
353
328
  /**
@@ -426,7 +401,7 @@ var LWC = (function (exports) {
426
401
  setFeatureFlag(name, value);
427
402
  }
428
403
  }
429
- /** version: 2.45.5 */
404
+ /** version: 2.46.0 */
430
405
 
431
406
  /* proxy-compat-disable */
432
407
  /**
@@ -491,7 +466,7 @@ var LWC = (function (exports) {
491
466
  }
492
467
  }
493
468
  }
494
- /** version: 2.45.5 */
469
+ /** version: 2.46.0 */
495
470
 
496
471
  /*
497
472
  * Copyright (c) 2018, salesforce.com, inc.
@@ -3796,27 +3771,35 @@ var LWC = (function (exports) {
3796
3771
  * SPDX-License-Identifier: MIT
3797
3772
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3798
3773
  */
3799
- const ColonCharCode$1 = 58;
3774
+ const ColonCharCode = 58;
3800
3775
  function patchAttributes(oldVnode, vnode, renderer) {
3801
- const { attrs } = vnode.data;
3776
+ const { attrs, external } = vnode.data;
3802
3777
  if (isUndefined$1(attrs)) {
3803
3778
  return;
3804
3779
  }
3805
3780
  const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
3781
+ // Attrs may be the same due to the static content optimization, so we can skip diffing
3806
3782
  if (oldAttrs === attrs) {
3807
3783
  return;
3808
3784
  }
3809
3785
  const { elm } = vnode;
3810
- const { setAttribute, removeAttribute } = renderer;
3786
+ const { setAttribute, removeAttribute, setProperty } = renderer;
3811
3787
  for (const key in attrs) {
3812
3788
  const cur = attrs[key];
3813
3789
  const old = oldAttrs[key];
3814
3790
  if (old !== cur) {
3815
- if (StringCharCodeAt.call(key, 3) === ColonCharCode$1) {
3791
+ let propName;
3792
+ // For external custom elements, sniff to see if the attr should be considered a prop.
3793
+ // Use kebabCaseToCamelCase directly because we don't want to set props like `ariaLabel` or `tabIndex`
3794
+ // on a custom element versus just using the more reliable attribute format.
3795
+ if (external && (propName = kebabCaseToCamelCase(key)) in elm) {
3796
+ setProperty(elm, propName, cur);
3797
+ }
3798
+ else if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
3816
3799
  // Assume xml namespace
3817
3800
  setAttribute(elm, key, cur, XML_NAMESPACE);
3818
3801
  }
3819
- else if (StringCharCodeAt.call(key, 5) === ColonCharCode$1) {
3802
+ else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
3820
3803
  // Assume xlink namespace
3821
3804
  setAttribute(elm, key, cur, XLINK_NAMESPACE);
3822
3805
  }
@@ -3830,46 +3813,6 @@ var LWC = (function (exports) {
3830
3813
  }
3831
3814
  }
3832
3815
 
3833
- /*
3834
- * Copyright (c) 2018, salesforce.com, inc.
3835
- * All rights reserved.
3836
- * SPDX-License-Identifier: MIT
3837
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3838
- */
3839
- const ColonCharCode = 58;
3840
- function patchAttrUnlessProp(oldVnode, vnode, renderer) {
3841
- const { data: { attrs }, elm, } = vnode;
3842
- if (isUndefined$1(attrs)) {
3843
- return;
3844
- }
3845
- const { removeAttribute, setAttribute, setProperty } = renderer;
3846
- const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
3847
- for (const name in attrs) {
3848
- const cur = attrs[name];
3849
- const old = oldAttrs[name];
3850
- if (old !== cur) {
3851
- const propName = htmlAttributeToProperty(name);
3852
- if (propName in elm) {
3853
- setProperty(elm, name, cur);
3854
- }
3855
- else if (StringCharCodeAt.call(name, 3) === ColonCharCode) {
3856
- // Assume xml namespace
3857
- setAttribute(elm, name, cur, XML_NAMESPACE);
3858
- }
3859
- else if (StringCharCodeAt.call(name, 5) === ColonCharCode) {
3860
- // Assume xlink namespace
3861
- setAttribute(elm, name, cur, XLINK_NAMESPACE);
3862
- }
3863
- else if (isNull(cur) || isUndefined$1(cur)) {
3864
- removeAttribute(elm, name);
3865
- }
3866
- else {
3867
- setAttribute(elm, name, cur);
3868
- }
3869
- }
3870
- }
3871
- }
3872
-
3873
3816
  /*
3874
3817
  * Copyright (c) 2018, salesforce.com, inc.
3875
3818
  * All rights reserved.
@@ -3891,6 +3834,7 @@ var LWC = (function (exports) {
3891
3834
  if (!isNull(oldVnode)) {
3892
3835
  oldProps = oldVnode.data.props;
3893
3836
  const oldSpread = oldVnode.data.spread;
3837
+ // Props may be the same due to the static content optimization, so we can skip diffing
3894
3838
  if (oldProps === props && oldSpread === spread) {
3895
3839
  return;
3896
3840
  }
@@ -4021,7 +3965,9 @@ var LWC = (function (exports) {
4021
3965
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4022
3966
  */
4023
3967
  function applyEventListeners(vnode, renderer) {
4024
- const { elm, data: { on }, } = vnode;
3968
+ var _a;
3969
+ const { elm } = vnode;
3970
+ const on = (_a = vnode.data) === null || _a === void 0 ? void 0 : _a.on;
4025
3971
  if (isUndefined$1(on)) {
4026
3972
  return;
4027
3973
  }
@@ -4233,6 +4179,8 @@ var LWC = (function (exports) {
4233
4179
  }
4234
4180
  }
4235
4181
  insertNode(elm, parent, anchor, renderer);
4182
+ // Event listeners are only applied once when mounting, so they are allowed for static vnodes
4183
+ applyEventListeners(vnode, renderer);
4236
4184
  }
4237
4185
  function mountCustomElement(vnode, parent, anchor, renderer) {
4238
4186
  const { sel, owner } = vnode;
@@ -4460,12 +4408,7 @@ var LWC = (function (exports) {
4460
4408
  // value is set before type=radio.
4461
4409
  patchClassAttribute(oldVnode, vnode, renderer);
4462
4410
  patchStyleAttribute(oldVnode, vnode, renderer);
4463
- if (vnode.data.external) {
4464
- patchAttrUnlessProp(oldVnode, vnode, renderer);
4465
- }
4466
- else {
4467
- patchAttributes(oldVnode, vnode, renderer);
4468
- }
4411
+ patchAttributes(oldVnode, vnode, renderer);
4469
4412
  patchProps(oldVnode, vnode, renderer);
4470
4413
  }
4471
4414
  function applyStyleScoping(elm, owner, renderer) {
@@ -4865,7 +4808,7 @@ var LWC = (function (exports) {
4865
4808
  };
4866
4809
  }
4867
4810
  // [st]atic node
4868
- function st(fragment, key) {
4811
+ function st(fragment, key, data) {
4869
4812
  return {
4870
4813
  type: 4 /* VNodeType.Static */,
4871
4814
  sel: undefined,
@@ -4873,6 +4816,7 @@ var LWC = (function (exports) {
4873
4816
  elm: undefined,
4874
4817
  fragment,
4875
4818
  owner: getVMBeingRendered(),
4819
+ data,
4876
4820
  };
4877
4821
  }
4878
4822
  // [fr]agment node
@@ -6776,6 +6720,7 @@ var LWC = (function (exports) {
6776
6720
  return handleMismatch(elm, vnode, renderer);
6777
6721
  }
6778
6722
  vnode.elm = elm;
6723
+ applyEventListeners(vnode, renderer);
6779
6724
  return elm;
6780
6725
  }
6781
6726
  function hydrateFragment(elm, vnode, renderer) {
@@ -7383,7 +7328,7 @@ var LWC = (function (exports) {
7383
7328
  }
7384
7329
  return getReadOnlyProxy(obj);
7385
7330
  }
7386
- /** version: 2.45.5 */
7331
+ /** version: 2.46.0 */
7387
7332
 
7388
7333
  /*
7389
7334
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7813,7 +7758,7 @@ var LWC = (function (exports) {
7813
7758
  function isNull(obj) {
7814
7759
  return obj === null;
7815
7760
  }
7816
- /** version: 2.45.5 */
7761
+ /** version: 2.46.0 */
7817
7762
 
7818
7763
  /*
7819
7764
  * Copyright (c) 2023, salesforce.com, inc.
@@ -8432,7 +8377,7 @@ var LWC = (function (exports) {
8432
8377
  });
8433
8378
  }));
8434
8379
  }
8435
- /** version: 2.45.5 */
8380
+ /** version: 2.46.0 */
8436
8381
 
8437
8382
  exports.LightningElement = LightningElement;
8438
8383
  exports.__unstable__ProfilerControl = profilerControl;