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
@@ -252,55 +252,35 @@
252
252
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
253
253
  */
254
254
  const CAMEL_REGEX = /-([a-z])/g;
255
- // Convoluted map generation so that @lwc/shared remains fully tree-shakable (verify-treeshakable)
256
- const { NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING, NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING } =
257
- /*#__PURE__*/ (() => {
258
- /**
259
- * Map composed of properties to attributes not following the HTML property to attribute mapping
260
- * convention.
261
- */
262
- const NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING = new Map([
263
- ['accessKey', 'accesskey'],
264
- ['readOnly', 'readonly'],
265
- ['tabIndex', 'tabindex'],
266
- ['bgColor', 'bgcolor'],
267
- ['colSpan', 'colspan'],
268
- ['rowSpan', 'rowspan'],
269
- ['contentEditable', 'contenteditable'],
270
- ['crossOrigin', 'crossorigin'],
271
- ['dateTime', 'datetime'],
272
- ['formAction', 'formaction'],
273
- ['isMap', 'ismap'],
274
- ['maxLength', 'maxlength'],
275
- ['minLength', 'minlength'],
276
- ['noValidate', 'novalidate'],
277
- ['useMap', 'usemap'],
278
- ['htmlFor', 'for'],
279
- ]);
280
- /**
281
- * Inverted map with attribute name key and property name value.
282
- */
283
- const NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING = new Map();
284
- NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING.forEach((value, key) => NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING.set(value, key));
285
- return {
286
- NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING,
287
- NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING,
288
- };
289
- })();
255
+ // These are HTML standard prop/attribute IDL mappings, but are not predictable based on camel/kebab-case conversion
256
+ const SPECIAL_PROPERTY_ATTRIBUTE_MAPPING = /*@__PURE__@*/ new Map([
257
+ ['accessKey', 'accesskey'],
258
+ ['readOnly', 'readonly'],
259
+ ['tabIndex', 'tabindex'],
260
+ ['bgColor', 'bgcolor'],
261
+ ['colSpan', 'colspan'],
262
+ ['rowSpan', 'rowspan'],
263
+ ['contentEditable', 'contenteditable'],
264
+ ['crossOrigin', 'crossorigin'],
265
+ ['dateTime', 'datetime'],
266
+ ['formAction', 'formaction'],
267
+ ['isMap', 'ismap'],
268
+ ['maxLength', 'maxlength'],
269
+ ['minLength', 'minlength'],
270
+ ['noValidate', 'novalidate'],
271
+ ['useMap', 'usemap'],
272
+ ['htmlFor', 'for'],
273
+ ]);
290
274
  /**
291
275
  * Map associating previously transformed HTML property into HTML attribute.
292
276
  */
293
277
  const CACHED_PROPERTY_ATTRIBUTE_MAPPING = /*@__PURE__@*/ new Map();
294
- /**
295
- * Map associating previously transformed HTML attribute into HTML property.
296
- */
297
- const CACHED_ATTRIBUTE_PROPERTY_MAPPING = /*@__PURE__@*/ new Map();
298
278
  function htmlPropertyToAttribute(propName) {
299
279
  const ariaAttributeName = AriaPropNameToAttrNameMap[propName];
300
280
  if (!isUndefined$1(ariaAttributeName)) {
301
281
  return ariaAttributeName;
302
282
  }
303
- const specialAttributeName = NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING.get(propName);
283
+ const specialAttributeName = SPECIAL_PROPERTY_ATTRIBUTE_MAPPING.get(propName);
304
284
  if (!isUndefined$1(specialAttributeName)) {
305
285
  return specialAttributeName;
306
286
  }
@@ -323,22 +303,17 @@
323
303
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
324
304
  return attributeName;
325
305
  }
326
- function htmlAttributeToProperty(attrName) {
327
- const ariaPropertyName = AriaAttrNameToPropNameMap[attrName];
328
- if (!isUndefined$1(ariaPropertyName)) {
329
- return ariaPropertyName;
330
- }
331
- const specialPropertyName = NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING.get(attrName);
332
- if (!isUndefined$1(specialPropertyName)) {
333
- return specialPropertyName;
334
- }
335
- const cachedPropertyName = CACHED_ATTRIBUTE_PROPERTY_MAPPING.get(attrName);
336
- if (!isUndefined$1(cachedPropertyName)) {
337
- return cachedPropertyName;
306
+ /**
307
+ * Map associating previously transformed kabab-case attributes into camel-case props.
308
+ */
309
+ const CACHED_KEBAB_CAMEL_MAPPING = /*@__PURE__@*/ new Map();
310
+ function kebabCaseToCamelCase(attrName) {
311
+ let result = CACHED_KEBAB_CAMEL_MAPPING.get(attrName);
312
+ if (isUndefined$1(result)) {
313
+ result = StringReplace.call(attrName, CAMEL_REGEX, (g) => g[1].toUpperCase());
314
+ CACHED_KEBAB_CAMEL_MAPPING.set(attrName, result);
338
315
  }
339
- const propertyName = StringReplace.call(attrName, CAMEL_REGEX, (g) => g[1].toUpperCase());
340
- CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
341
- return propertyName;
316
+ return result;
342
317
  }
343
318
 
344
319
  /*
@@ -348,9 +323,9 @@
348
323
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
349
324
  */
350
325
  // Increment whenever the LWC template compiler changes
351
- const LWC_VERSION = "2.45.5";
326
+ const LWC_VERSION = "2.46.0";
352
327
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
353
- /** version: 2.45.5 */
328
+ /** version: 2.46.0 */
354
329
 
355
330
  /* proxy-compat-disable */
356
331
  /**
@@ -429,7 +404,7 @@
429
404
  setFeatureFlag(name, value);
430
405
  }
431
406
  }
432
- /** version: 2.45.5 */
407
+ /** version: 2.46.0 */
433
408
 
434
409
  /* proxy-compat-disable */
435
410
  /**
@@ -494,7 +469,7 @@
494
469
  }
495
470
  }
496
471
  }
497
- /** version: 2.45.5 */
472
+ /** version: 2.46.0 */
498
473
 
499
474
  /*
500
475
  * Copyright (c) 2018, salesforce.com, inc.
@@ -3799,27 +3774,35 @@
3799
3774
  * SPDX-License-Identifier: MIT
3800
3775
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3801
3776
  */
3802
- const ColonCharCode$1 = 58;
3777
+ const ColonCharCode = 58;
3803
3778
  function patchAttributes(oldVnode, vnode, renderer) {
3804
- const { attrs } = vnode.data;
3779
+ const { attrs, external } = vnode.data;
3805
3780
  if (isUndefined$1(attrs)) {
3806
3781
  return;
3807
3782
  }
3808
3783
  const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
3784
+ // Attrs may be the same due to the static content optimization, so we can skip diffing
3809
3785
  if (oldAttrs === attrs) {
3810
3786
  return;
3811
3787
  }
3812
3788
  const { elm } = vnode;
3813
- const { setAttribute, removeAttribute } = renderer;
3789
+ const { setAttribute, removeAttribute, setProperty } = renderer;
3814
3790
  for (const key in attrs) {
3815
3791
  const cur = attrs[key];
3816
3792
  const old = oldAttrs[key];
3817
3793
  if (old !== cur) {
3818
- if (StringCharCodeAt.call(key, 3) === ColonCharCode$1) {
3794
+ let propName;
3795
+ // For external custom elements, sniff to see if the attr should be considered a prop.
3796
+ // Use kebabCaseToCamelCase directly because we don't want to set props like `ariaLabel` or `tabIndex`
3797
+ // on a custom element versus just using the more reliable attribute format.
3798
+ if (external && (propName = kebabCaseToCamelCase(key)) in elm) {
3799
+ setProperty(elm, propName, cur);
3800
+ }
3801
+ else if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
3819
3802
  // Assume xml namespace
3820
3803
  setAttribute(elm, key, cur, XML_NAMESPACE);
3821
3804
  }
3822
- else if (StringCharCodeAt.call(key, 5) === ColonCharCode$1) {
3805
+ else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
3823
3806
  // Assume xlink namespace
3824
3807
  setAttribute(elm, key, cur, XLINK_NAMESPACE);
3825
3808
  }
@@ -3833,46 +3816,6 @@
3833
3816
  }
3834
3817
  }
3835
3818
 
3836
- /*
3837
- * Copyright (c) 2018, salesforce.com, inc.
3838
- * All rights reserved.
3839
- * SPDX-License-Identifier: MIT
3840
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3841
- */
3842
- const ColonCharCode = 58;
3843
- function patchAttrUnlessProp(oldVnode, vnode, renderer) {
3844
- const { data: { attrs }, elm, } = vnode;
3845
- if (isUndefined$1(attrs)) {
3846
- return;
3847
- }
3848
- const { removeAttribute, setAttribute, setProperty } = renderer;
3849
- const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
3850
- for (const name in attrs) {
3851
- const cur = attrs[name];
3852
- const old = oldAttrs[name];
3853
- if (old !== cur) {
3854
- const propName = htmlAttributeToProperty(name);
3855
- if (propName in elm) {
3856
- setProperty(elm, name, cur);
3857
- }
3858
- else if (StringCharCodeAt.call(name, 3) === ColonCharCode) {
3859
- // Assume xml namespace
3860
- setAttribute(elm, name, cur, XML_NAMESPACE);
3861
- }
3862
- else if (StringCharCodeAt.call(name, 5) === ColonCharCode) {
3863
- // Assume xlink namespace
3864
- setAttribute(elm, name, cur, XLINK_NAMESPACE);
3865
- }
3866
- else if (isNull(cur) || isUndefined$1(cur)) {
3867
- removeAttribute(elm, name);
3868
- }
3869
- else {
3870
- setAttribute(elm, name, cur);
3871
- }
3872
- }
3873
- }
3874
- }
3875
-
3876
3819
  /*
3877
3820
  * Copyright (c) 2018, salesforce.com, inc.
3878
3821
  * All rights reserved.
@@ -3894,6 +3837,7 @@
3894
3837
  if (!isNull(oldVnode)) {
3895
3838
  oldProps = oldVnode.data.props;
3896
3839
  const oldSpread = oldVnode.data.spread;
3840
+ // Props may be the same due to the static content optimization, so we can skip diffing
3897
3841
  if (oldProps === props && oldSpread === spread) {
3898
3842
  return;
3899
3843
  }
@@ -4024,7 +3968,9 @@
4024
3968
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4025
3969
  */
4026
3970
  function applyEventListeners(vnode, renderer) {
4027
- const { elm, data: { on }, } = vnode;
3971
+ var _a;
3972
+ const { elm } = vnode;
3973
+ const on = (_a = vnode.data) === null || _a === void 0 ? void 0 : _a.on;
4028
3974
  if (isUndefined$1(on)) {
4029
3975
  return;
4030
3976
  }
@@ -4236,6 +4182,8 @@
4236
4182
  }
4237
4183
  }
4238
4184
  insertNode(elm, parent, anchor, renderer);
4185
+ // Event listeners are only applied once when mounting, so they are allowed for static vnodes
4186
+ applyEventListeners(vnode, renderer);
4239
4187
  }
4240
4188
  function mountCustomElement(vnode, parent, anchor, renderer) {
4241
4189
  const { sel, owner } = vnode;
@@ -4463,12 +4411,7 @@
4463
4411
  // value is set before type=radio.
4464
4412
  patchClassAttribute(oldVnode, vnode, renderer);
4465
4413
  patchStyleAttribute(oldVnode, vnode, renderer);
4466
- if (vnode.data.external) {
4467
- patchAttrUnlessProp(oldVnode, vnode, renderer);
4468
- }
4469
- else {
4470
- patchAttributes(oldVnode, vnode, renderer);
4471
- }
4414
+ patchAttributes(oldVnode, vnode, renderer);
4472
4415
  patchProps(oldVnode, vnode, renderer);
4473
4416
  }
4474
4417
  function applyStyleScoping(elm, owner, renderer) {
@@ -4868,7 +4811,7 @@
4868
4811
  };
4869
4812
  }
4870
4813
  // [st]atic node
4871
- function st(fragment, key) {
4814
+ function st(fragment, key, data) {
4872
4815
  return {
4873
4816
  type: 4 /* VNodeType.Static */,
4874
4817
  sel: undefined,
@@ -4876,6 +4819,7 @@
4876
4819
  elm: undefined,
4877
4820
  fragment,
4878
4821
  owner: getVMBeingRendered(),
4822
+ data,
4879
4823
  };
4880
4824
  }
4881
4825
  // [fr]agment node
@@ -6779,6 +6723,7 @@
6779
6723
  return handleMismatch(elm, vnode, renderer);
6780
6724
  }
6781
6725
  vnode.elm = elm;
6726
+ applyEventListeners(vnode, renderer);
6782
6727
  return elm;
6783
6728
  }
6784
6729
  function hydrateFragment(elm, vnode, renderer) {
@@ -7386,7 +7331,7 @@
7386
7331
  }
7387
7332
  return getReadOnlyProxy(obj);
7388
7333
  }
7389
- /** version: 2.45.5 */
7334
+ /** version: 2.46.0 */
7390
7335
 
7391
7336
  /*
7392
7337
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7816,7 +7761,7 @@
7816
7761
  function isNull(obj) {
7817
7762
  return obj === null;
7818
7763
  }
7819
- /** version: 2.45.5 */
7764
+ /** version: 2.46.0 */
7820
7765
 
7821
7766
  /*
7822
7767
  * Copyright (c) 2023, salesforce.com, inc.
@@ -8435,7 +8380,7 @@
8435
8380
  });
8436
8381
  }));
8437
8382
  }
8438
- /** version: 2.45.5 */
8383
+ /** version: 2.46.0 */
8439
8384
 
8440
8385
  exports.LightningElement = LightningElement;
8441
8386
  exports.__unstable__ProfilerControl = profilerControl;