lwc 2.45.1 → 2.45.2

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 (66) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +63 -15
  2. package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
  3. package/dist/engine-dom/iife/es2017/engine-dom.js +63 -15
  4. package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -1
  5. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  6. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +64 -13
  7. package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
  8. package/dist/engine-dom/iife/es5/engine-dom.js +70 -13
  9. package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -1
  10. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  11. package/dist/engine-dom/iife/es5/engine-dom_debug.js +71 -11
  12. package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
  13. package/dist/engine-dom/umd/es2017/engine-dom.js +63 -15
  14. package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -1
  15. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  16. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +64 -13
  17. package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
  18. package/dist/engine-dom/umd/es5/engine-dom.js +70 -13
  19. package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -1
  20. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  21. package/dist/engine-dom/umd/es5/engine-dom_debug.js +71 -11
  22. package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
  23. package/dist/engine-server/commonjs/es2017/engine-server.js +7 -7
  24. package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -1
  25. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  26. package/dist/engine-server/esm/es2017/engine-server.js +7 -7
  27. package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
  28. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +4 -4
  29. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
  30. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +4 -4
  31. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
  32. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  33. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +4 -4
  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 +4 -4
  40. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
  41. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  42. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +4 -4
  43. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
  44. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  45. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
  46. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  47. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
  48. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  49. package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
  50. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  51. package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
  52. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  53. package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
  54. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  55. package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
  56. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  57. package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
  58. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  59. package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
  60. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  61. package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
  62. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  63. package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
  64. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  65. package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
  66. package/package.json +7 -7
@@ -46,7 +46,16 @@ var LWC = (function (exports) {
46
46
  */
47
47
  const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
48
48
  const { isArray: isArray$1 } = Array;
49
- const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
49
+ const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, every: ArrayEvery, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, includes: ArrayIncludes, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
50
+ // The type of the return value of Array.prototype.every is `this is T[]`. However, once this
51
+ // Array method is pulled out of the prototype, the function is now referencing `this` where
52
+ // `this` is meaningless, resulting in a TypeScript compilation error.
53
+ //
54
+ // Exposing this helper function is the closest we can get to preserving the usage patterns
55
+ // of Array.prototype methods used elsewhere in the codebase.
56
+ function arrayEvery(arr, predicate) {
57
+ return ArrayEvery.call(arr, predicate);
58
+ }
50
59
  const { fromCharCode: StringFromCharCode } = String;
51
60
  const { charCodeAt: StringCharCodeAt, replace: StringReplace, split: StringSplit, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
52
61
  function isUndefined$1(obj) {
@@ -332,9 +341,9 @@ var LWC = (function (exports) {
332
341
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
333
342
  */
334
343
  // Increment whenever the LWC template compiler changes
335
- const LWC_VERSION = "2.45.1";
344
+ const LWC_VERSION = "2.45.2";
336
345
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
337
- /** version: 2.45.1 */
346
+ /** version: 2.45.2 */
338
347
 
339
348
  /**
340
349
  * Copyright (C) 2018 salesforce.com, inc.
@@ -412,7 +421,7 @@ var LWC = (function (exports) {
412
421
  setFeatureFlag(name, value);
413
422
  }
414
423
  }
415
- /** version: 2.45.1 */
424
+ /** version: 2.45.2 */
416
425
 
417
426
  /**
418
427
  * Copyright (C) 2018 salesforce.com, inc.
@@ -476,7 +485,7 @@ var LWC = (function (exports) {
476
485
  }
477
486
  }
478
487
  }
479
- /** version: 2.45.1 */
488
+ /** version: 2.45.2 */
480
489
 
481
490
  /*
482
491
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6705,6 +6714,27 @@ var LWC = (function (exports) {
6705
6714
  }
6706
6715
  return false;
6707
6716
  }
6717
+ // The validationOptOut static property can be an array of attribute names.
6718
+ // Any attribute names specified in that array will not be validated, and the
6719
+ // LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
6720
+ function getValidationPredicate(optOutStaticProp) {
6721
+ if (isUndefined$1(optOutStaticProp)) {
6722
+ return (_attrName) => true;
6723
+ }
6724
+ // If validationOptOut is true, no attributes will be checked for correctness
6725
+ // and the runtime will assume VDOM attrs and DOM attrs are in sync.
6726
+ if (isTrue(optOutStaticProp)) {
6727
+ return (_attrName) => false;
6728
+ }
6729
+ // If validationOptOut is an array of strings, attributes specified in the
6730
+ // array will be "opted out". Attributes not specified in the array will still
6731
+ // be validated.
6732
+ if (isArray$1(optOutStaticProp) && arrayEvery(optOutStaticProp, isString)) {
6733
+ return (attrName) => !ArrayIncludes.call(optOutStaticProp, attrName);
6734
+ }
6735
+ logWarn('Validation opt out must be `true` or an array of attributes that should not be validated.');
6736
+ return (_attrName) => true;
6737
+ }
6708
6738
  function hydrateText(node, vnode, renderer) {
6709
6739
  var _a;
6710
6740
  if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
@@ -6783,8 +6813,19 @@ var LWC = (function (exports) {
6783
6813
  return elm;
6784
6814
  }
6785
6815
  function hydrateCustomElement(elm, vnode, renderer) {
6816
+ const { validationOptOut } = vnode.ctor;
6817
+ const shouldValidateAttr = getValidationPredicate(validationOptOut);
6818
+ // The validationOptOut static property can be an array of attribute names.
6819
+ // Any attribute names specified in that array will not be validated, and the
6820
+ // LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
6821
+ //
6822
+ // If validationOptOut is true, no attributes will be checked for correctness
6823
+ // and the runtime will assume VDOM attrs and DOM attrs are in sync.
6824
+ //
6825
+ // Therefore, if validationOptOut is falsey or an array of strings, we need to
6826
+ // examine some or all of the custom element's attributes.
6786
6827
  if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) ||
6787
- !isMatchingElement(vnode, elm, renderer)) {
6828
+ !isMatchingElement(vnode, elm, renderer, shouldValidateAttr)) {
6788
6829
  return handleMismatch(elm, vnode, renderer);
6789
6830
  }
6790
6831
  const { sel, mode, ctor, owner } = vnode;
@@ -6878,7 +6919,7 @@ var LWC = (function (exports) {
6878
6919
  }
6879
6920
  return true;
6880
6921
  }
6881
- function isMatchingElement(vnode, elm, renderer) {
6922
+ function isMatchingElement(vnode, elm, renderer, shouldValidateAttr = () => true) {
6882
6923
  const { getProperty } = renderer;
6883
6924
  if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
6884
6925
  if (process.env.NODE_ENV !== 'production') {
@@ -6886,10 +6927,14 @@ var LWC = (function (exports) {
6886
6927
  }
6887
6928
  return false;
6888
6929
  }
6889
- const hasIncompatibleAttrs = validateAttrs(vnode, elm, renderer);
6890
- const hasIncompatibleClass = validateClassAttr(vnode, elm, renderer);
6891
- const hasIncompatibleStyle = validateStyleAttr(vnode, elm, renderer);
6892
- return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
6930
+ const hasCompatibleAttrs = validateAttrs(vnode, elm, renderer, shouldValidateAttr);
6931
+ const hasCompatibleClass = shouldValidateAttr('class')
6932
+ ? validateClassAttr(vnode, elm, renderer)
6933
+ : true;
6934
+ const hasCompatibleStyle = shouldValidateAttr('style')
6935
+ ? validateStyleAttr(vnode, elm, renderer)
6936
+ : true;
6937
+ return hasCompatibleAttrs && hasCompatibleClass && hasCompatibleStyle;
6893
6938
  }
6894
6939
  function attributeValuesAreEqual(vnodeValue, value) {
6895
6940
  const vnodeValueAsString = String(vnodeValue);
@@ -6904,12 +6949,15 @@ var LWC = (function (exports) {
6904
6949
  // In all other cases, the two values are not considered equal
6905
6950
  return false;
6906
6951
  }
6907
- function validateAttrs(vnode, elm, renderer) {
6952
+ function validateAttrs(vnode, elm, renderer, shouldValidateAttr) {
6908
6953
  const { data: { attrs = {} }, } = vnode;
6909
6954
  let nodesAreCompatible = true;
6910
6955
  // Validate attributes, though we could always recovery from those by running the update mods.
6911
6956
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
6912
6957
  for (const [attrName, attrValue] of Object.entries(attrs)) {
6958
+ if (!shouldValidateAttr(attrName)) {
6959
+ continue;
6960
+ }
6913
6961
  const { owner } = vnode;
6914
6962
  const { getAttribute } = renderer;
6915
6963
  const elmAttrValue = getAttribute(elm, attrName);
@@ -7333,7 +7381,7 @@ var LWC = (function (exports) {
7333
7381
  }
7334
7382
  return getReadOnlyProxy(obj);
7335
7383
  }
7336
- /* version: 2.45.1 */
7384
+ /* version: 2.45.2 */
7337
7385
 
7338
7386
  /*
7339
7387
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7761,7 +7809,7 @@ var LWC = (function (exports) {
7761
7809
  function isNull(obj) {
7762
7810
  return obj === null;
7763
7811
  }
7764
- /** version: 2.45.1 */
7812
+ /** version: 2.45.2 */
7765
7813
 
7766
7814
  /*
7767
7815
  * Copyright (c) 2023, salesforce.com, inc.
@@ -8380,7 +8428,7 @@ var LWC = (function (exports) {
8380
8428
  });
8381
8429
  }));
8382
8430
  }
8383
- /* version: 2.45.1 */
8431
+ /* version: 2.45.2 */
8384
8432
 
8385
8433
  exports.LightningElement = LightningElement;
8386
8434
  exports.__unstable__ProfilerControl = profilerControl;