lwc 2.45.5 → 2.47.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
@@ -333,55 +333,35 @@ const GLOBAL_ATTRIBUTE = /*@__PURE__*/ new Set([
333
333
  function isGlobalHtmlAttribute(attrName) {
334
334
  return GLOBAL_ATTRIBUTE.has(attrName);
335
335
  }
336
- // Convoluted map generation so that @lwc/shared remains fully tree-shakable (verify-treeshakable)
337
- const { NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING, NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING } =
338
- /*#__PURE__*/ (() => {
339
- /**
340
- * Map composed of properties to attributes not following the HTML property to attribute mapping
341
- * convention.
342
- */
343
- const NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING = new Map([
344
- ['accessKey', 'accesskey'],
345
- ['readOnly', 'readonly'],
346
- ['tabIndex', 'tabindex'],
347
- ['bgColor', 'bgcolor'],
348
- ['colSpan', 'colspan'],
349
- ['rowSpan', 'rowspan'],
350
- ['contentEditable', 'contenteditable'],
351
- ['crossOrigin', 'crossorigin'],
352
- ['dateTime', 'datetime'],
353
- ['formAction', 'formaction'],
354
- ['isMap', 'ismap'],
355
- ['maxLength', 'maxlength'],
356
- ['minLength', 'minlength'],
357
- ['noValidate', 'novalidate'],
358
- ['useMap', 'usemap'],
359
- ['htmlFor', 'for'],
360
- ]);
361
- /**
362
- * Inverted map with attribute name key and property name value.
363
- */
364
- const NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING = new Map();
365
- NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING.forEach((value, key) => NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING.set(value, key));
366
- return {
367
- NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING,
368
- NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING,
369
- };
370
- })();
336
+ // These are HTML standard prop/attribute IDL mappings, but are not predictable based on camel/kebab-case conversion
337
+ const SPECIAL_PROPERTY_ATTRIBUTE_MAPPING = /*@__PURE__@*/ new Map([
338
+ ['accessKey', 'accesskey'],
339
+ ['readOnly', 'readonly'],
340
+ ['tabIndex', 'tabindex'],
341
+ ['bgColor', 'bgcolor'],
342
+ ['colSpan', 'colspan'],
343
+ ['rowSpan', 'rowspan'],
344
+ ['contentEditable', 'contenteditable'],
345
+ ['crossOrigin', 'crossorigin'],
346
+ ['dateTime', 'datetime'],
347
+ ['formAction', 'formaction'],
348
+ ['isMap', 'ismap'],
349
+ ['maxLength', 'maxlength'],
350
+ ['minLength', 'minlength'],
351
+ ['noValidate', 'novalidate'],
352
+ ['useMap', 'usemap'],
353
+ ['htmlFor', 'for'],
354
+ ]);
371
355
  /**
372
356
  * Map associating previously transformed HTML property into HTML attribute.
373
357
  */
374
358
  const CACHED_PROPERTY_ATTRIBUTE_MAPPING = /*@__PURE__@*/ new Map();
375
- /**
376
- * Map associating previously transformed HTML attribute into HTML property.
377
- */
378
- const CACHED_ATTRIBUTE_PROPERTY_MAPPING = /*@__PURE__@*/ new Map();
379
359
  function htmlPropertyToAttribute(propName) {
380
360
  const ariaAttributeName = AriaPropNameToAttrNameMap[propName];
381
361
  if (!isUndefined$1(ariaAttributeName)) {
382
362
  return ariaAttributeName;
383
363
  }
384
- const specialAttributeName = NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING.get(propName);
364
+ const specialAttributeName = SPECIAL_PROPERTY_ATTRIBUTE_MAPPING.get(propName);
385
365
  if (!isUndefined$1(specialAttributeName)) {
386
366
  return specialAttributeName;
387
367
  }
@@ -404,22 +384,17 @@ function htmlPropertyToAttribute(propName) {
404
384
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
405
385
  return attributeName;
406
386
  }
407
- function htmlAttributeToProperty(attrName) {
408
- const ariaPropertyName = AriaAttrNameToPropNameMap[attrName];
409
- if (!isUndefined$1(ariaPropertyName)) {
410
- return ariaPropertyName;
411
- }
412
- const specialPropertyName = NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING.get(attrName);
413
- if (!isUndefined$1(specialPropertyName)) {
414
- return specialPropertyName;
415
- }
416
- const cachedPropertyName = CACHED_ATTRIBUTE_PROPERTY_MAPPING.get(attrName);
417
- if (!isUndefined$1(cachedPropertyName)) {
418
- return cachedPropertyName;
387
+ /**
388
+ * Map associating previously transformed kabab-case attributes into camel-case props.
389
+ */
390
+ const CACHED_KEBAB_CAMEL_MAPPING = /*@__PURE__@*/ new Map();
391
+ function kebabCaseToCamelCase(attrName) {
392
+ let result = CACHED_KEBAB_CAMEL_MAPPING.get(attrName);
393
+ if (isUndefined$1(result)) {
394
+ result = StringReplace.call(attrName, CAMEL_REGEX, (g) => g[1].toUpperCase());
395
+ CACHED_KEBAB_CAMEL_MAPPING.set(attrName, result);
419
396
  }
420
- const propertyName = StringReplace.call(attrName, CAMEL_REGEX, (g) => g[1].toUpperCase());
421
- CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
422
- return propertyName;
397
+ return result;
423
398
  }
424
399
 
425
400
  /*
@@ -447,9 +422,9 @@ function htmlEscape(str, attrMode = false) {
447
422
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
448
423
  */
449
424
  // Increment whenever the LWC template compiler changes
450
- const LWC_VERSION = "2.45.5";
425
+ const LWC_VERSION = "2.47.0";
451
426
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
452
- /** version: 2.45.5 */
427
+ /** version: 2.47.0 */
453
428
 
454
429
  /* proxy-compat-disable */
455
430
  /**
@@ -528,7 +503,7 @@ function setFeatureFlagForTest(name, value) {
528
503
  setFeatureFlag(name, value);
529
504
  }
530
505
  }
531
- /** version: 2.45.5 */
506
+ /** version: 2.47.0 */
532
507
 
533
508
  /*
534
509
  * Copyright (c) 2020, salesforce.com, inc.
@@ -625,7 +600,7 @@ function applyAriaReflection(prototype = Element.prototype) {
625
600
  }
626
601
  }
627
602
  }
628
- /** version: 2.45.5 */
603
+ /** version: 2.47.0 */
629
604
 
630
605
  /* proxy-compat-disable */
631
606
  /**
@@ -3550,27 +3525,35 @@ function isVScopedSlotFragment(vnode) {
3550
3525
  * SPDX-License-Identifier: MIT
3551
3526
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3552
3527
  */
3553
- const ColonCharCode$1 = 58;
3528
+ const ColonCharCode = 58;
3554
3529
  function patchAttributes(oldVnode, vnode, renderer) {
3555
- const { attrs } = vnode.data;
3530
+ const { attrs, external } = vnode.data;
3556
3531
  if (isUndefined$1(attrs)) {
3557
3532
  return;
3558
3533
  }
3559
3534
  const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
3535
+ // Attrs may be the same due to the static content optimization, so we can skip diffing
3560
3536
  if (oldAttrs === attrs) {
3561
3537
  return;
3562
3538
  }
3563
3539
  const { elm } = vnode;
3564
- const { setAttribute, removeAttribute } = renderer;
3540
+ const { setAttribute, removeAttribute, setProperty } = renderer;
3565
3541
  for (const key in attrs) {
3566
3542
  const cur = attrs[key];
3567
3543
  const old = oldAttrs[key];
3568
3544
  if (old !== cur) {
3569
- if (StringCharCodeAt.call(key, 3) === ColonCharCode$1) {
3545
+ let propName;
3546
+ // For external custom elements, sniff to see if the attr should be considered a prop.
3547
+ // Use kebabCaseToCamelCase directly because we don't want to set props like `ariaLabel` or `tabIndex`
3548
+ // on a custom element versus just using the more reliable attribute format.
3549
+ if (external && (propName = kebabCaseToCamelCase(key)) in elm) {
3550
+ setProperty(elm, propName, cur);
3551
+ }
3552
+ else if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
3570
3553
  // Assume xml namespace
3571
3554
  setAttribute(elm, key, cur, XML_NAMESPACE);
3572
3555
  }
3573
- else if (StringCharCodeAt.call(key, 5) === ColonCharCode$1) {
3556
+ else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
3574
3557
  // Assume xlink namespace
3575
3558
  setAttribute(elm, key, cur, XLINK_NAMESPACE);
3576
3559
  }
@@ -3584,46 +3567,6 @@ function patchAttributes(oldVnode, vnode, renderer) {
3584
3567
  }
3585
3568
  }
3586
3569
 
3587
- /*
3588
- * Copyright (c) 2018, salesforce.com, inc.
3589
- * All rights reserved.
3590
- * SPDX-License-Identifier: MIT
3591
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3592
- */
3593
- const ColonCharCode = 58;
3594
- function patchAttrUnlessProp(oldVnode, vnode, renderer) {
3595
- const { data: { attrs }, elm, } = vnode;
3596
- if (isUndefined$1(attrs)) {
3597
- return;
3598
- }
3599
- const { removeAttribute, setAttribute, setProperty } = renderer;
3600
- const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
3601
- for (const name in attrs) {
3602
- const cur = attrs[name];
3603
- const old = oldAttrs[name];
3604
- if (old !== cur) {
3605
- const propName = htmlAttributeToProperty(name);
3606
- if (propName in elm) {
3607
- setProperty(elm, name, cur);
3608
- }
3609
- else if (StringCharCodeAt.call(name, 3) === ColonCharCode) {
3610
- // Assume xml namespace
3611
- setAttribute(elm, name, cur, XML_NAMESPACE);
3612
- }
3613
- else if (StringCharCodeAt.call(name, 5) === ColonCharCode) {
3614
- // Assume xlink namespace
3615
- setAttribute(elm, name, cur, XLINK_NAMESPACE);
3616
- }
3617
- else if (isNull(cur) || isUndefined$1(cur)) {
3618
- removeAttribute(elm, name);
3619
- }
3620
- else {
3621
- setAttribute(elm, name, cur);
3622
- }
3623
- }
3624
- }
3625
- }
3626
-
3627
3570
  /*
3628
3571
  * Copyright (c) 2018, salesforce.com, inc.
3629
3572
  * All rights reserved.
@@ -3645,6 +3588,7 @@ function patchProps(oldVnode, vnode, renderer) {
3645
3588
  if (!isNull(oldVnode)) {
3646
3589
  oldProps = oldVnode.data.props;
3647
3590
  const oldSpread = oldVnode.data.spread;
3591
+ // Props may be the same due to the static content optimization, so we can skip diffing
3648
3592
  if (oldProps === props && oldSpread === spread) {
3649
3593
  return;
3650
3594
  }
@@ -3767,7 +3711,9 @@ function patchStyleAttribute(oldVnode, vnode, renderer) {
3767
3711
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3768
3712
  */
3769
3713
  function applyEventListeners(vnode, renderer) {
3770
- const { elm, data: { on }, } = vnode;
3714
+ var _a;
3715
+ const { elm } = vnode;
3716
+ const on = (_a = vnode.data) === null || _a === void 0 ? void 0 : _a.on;
3771
3717
  if (isUndefined$1(on)) {
3772
3718
  return;
3773
3719
  }
@@ -3979,6 +3925,8 @@ function mountStatic(vnode, parent, anchor, renderer) {
3979
3925
  }
3980
3926
  }
3981
3927
  insertNode(elm, parent, anchor, renderer);
3928
+ // Event listeners are only applied once when mounting, so they are allowed for static vnodes
3929
+ applyEventListeners(vnode, renderer);
3982
3930
  }
3983
3931
  function mountCustomElement(vnode, parent, anchor, renderer) {
3984
3932
  const { sel, owner } = vnode;
@@ -4201,12 +4149,7 @@ function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
4201
4149
  // value is set before type=radio.
4202
4150
  patchClassAttribute(oldVnode, vnode, renderer);
4203
4151
  patchStyleAttribute(oldVnode, vnode, renderer);
4204
- if (vnode.data.external) {
4205
- patchAttrUnlessProp(oldVnode, vnode, renderer);
4206
- }
4207
- else {
4208
- patchAttributes(oldVnode, vnode, renderer);
4209
- }
4152
+ patchAttributes(oldVnode, vnode, renderer);
4210
4153
  patchProps(oldVnode, vnode, renderer);
4211
4154
  }
4212
4155
  function applyStyleScoping(elm, owner, renderer) {
@@ -4606,7 +4549,7 @@ function ssf(slotName, factory) {
4606
4549
  };
4607
4550
  }
4608
4551
  // [st]atic node
4609
- function st(fragment, key) {
4552
+ function st(fragment, key, data) {
4610
4553
  return {
4611
4554
  type: 4 /* VNodeType.Static */,
4612
4555
  sel: undefined,
@@ -4614,6 +4557,7 @@ function st(fragment, key) {
4614
4557
  elm: undefined,
4615
4558
  fragment,
4616
4559
  owner: getVMBeingRendered(),
4560
+ data,
4617
4561
  };
4618
4562
  }
4619
4563
  // [fr]agment node
@@ -6248,7 +6192,7 @@ function readonly(obj) {
6248
6192
  }
6249
6193
  return getReadOnlyProxy(obj);
6250
6194
  }
6251
- /** version: 2.45.5 */
6195
+ /** version: 2.47.0 */
6252
6196
 
6253
6197
  /*
6254
6198
  * Copyright (c) 2020, salesforce.com, inc.
@@ -14560,7 +14504,7 @@ seal(LightningElement.prototype);
14560
14504
  function createElement() {
14561
14505
  throw new Error('createElement is not supported in @lwc/engine-server, only @lwc/engine-dom.');
14562
14506
  }
14563
- /** version: 2.45.5 */
14507
+ /** version: 2.47.0 */
14564
14508
 
14565
14509
  export { LightningElement, api$1 as api, createContextProvider, createElement, freezeTemplate, getComponentDef, isComponentConstructor, parseFragment$1 as parseFragment, parseFragment$1 as parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderComponent, renderer, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, track, unwrap, wire };
14566
14510
  //# sourceMappingURL=engine-server.js.map