lwc 2.12.1 → 2.13.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 (43) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +125 -152
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +125 -152
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +113 -140
  5. package/dist/engine-dom/iife/es5/engine-dom.js +5757 -7328
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +4568 -5878
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +125 -152
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +113 -140
  11. package/dist/engine-dom/umd/es5/engine-dom.js +5757 -7328
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +4568 -5878
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +102 -131
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +102 -131
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +693 -693
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +693 -693
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +13 -10
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +681 -681
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3725 -4699
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +1 -10
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3600 -4543
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +693 -693
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +13 -10
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +681 -681
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3725 -4699
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +1 -10
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3600 -4543
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service.min.js +1 -1
  33. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  34. package/dist/wire-service/iife/es5/wire-service.js +258 -243
  35. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  36. package/dist/wire-service/iife/es5/wire-service_debug.js +258 -243
  37. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  38. package/dist/wire-service/umd/es2017/wire-service.min.js +1 -1
  39. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  40. package/dist/wire-service/umd/es5/wire-service.js +258 -243
  41. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  42. package/dist/wire-service/umd/es5/wire-service_debug.js +258 -243
  43. package/package.json +7 -7
@@ -290,7 +290,7 @@ var LWC = (function (exports) {
290
290
  const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
291
291
  const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
292
292
  const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
293
- /** version: 2.12.1 */
293
+ /** version: 2.13.2 */
294
294
 
295
295
  /*
296
296
  * Copyright (c) 2018, salesforce.com, inc.
@@ -433,7 +433,7 @@ var LWC = (function (exports) {
433
433
  */
434
434
  function setFeatureFlagForTest(name, value) {
435
435
  }
436
- /** version: 2.12.1 */
436
+ /** version: 2.13.2 */
437
437
 
438
438
  /* proxy-compat-disable */
439
439
 
@@ -837,6 +837,20 @@ var LWC = (function (exports) {
837
837
  log('error', message, vm);
838
838
  }
839
839
 
840
+ /*
841
+ * Copyright (c) 2020, salesforce.com, inc.
842
+ * All rights reserved.
843
+ * SPDX-License-Identifier: MIT
844
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
845
+ */
846
+ function resolveCircularModuleDependency(fn) {
847
+ const module = fn();
848
+ return (module === null || module === void 0 ? void 0 : module.__esModule) ? module.default : module;
849
+ }
850
+ function isCircularModuleDependency(obj) {
851
+ return isFunction$1(obj) && hasOwnProperty$1.call(obj, '__circular__');
852
+ }
853
+
840
854
  /*
841
855
  * Copyright (c) 2018, salesforce.com, inc.
842
856
  * All rights reserved.
@@ -1705,58 +1719,7 @@ var LWC = (function (exports) {
1705
1719
  configurable: true,
1706
1720
  });
1707
1721
 
1708
- /*
1709
- * Copyright (c) 2018, salesforce.com, inc.
1710
- * All rights reserved.
1711
- * SPDX-License-Identifier: MIT
1712
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1713
- */
1714
- /**
1715
- * @wire decorator to wire fields and methods to a wire adapter in
1716
- * LWC Components. This function implements the internals of this
1717
- * decorator.
1718
- */
1719
- function wire(_adapter, _config) {
1720
- throw new Error();
1721
- }
1722
- function internalWireFieldDecorator(key) {
1723
- return {
1724
- get() {
1725
- const vm = getAssociatedVM(this);
1726
- componentValueObserved(vm, key);
1727
- return vm.cmpFields[key];
1728
- },
1729
- set(value) {
1730
- const vm = getAssociatedVM(this);
1731
- /**
1732
- * Reactivity for wired fields is provided in wiring.
1733
- * We intentionally add reactivity here since this is just
1734
- * letting the author to do the wrong thing, but it will keep our
1735
- * system to be backward compatible.
1736
- */
1737
- if (value !== vm.cmpFields[key]) {
1738
- vm.cmpFields[key] = value;
1739
- componentValueMutated(vm, key);
1740
- }
1741
- },
1742
- enumerable: true,
1743
- configurable: true,
1744
- };
1745
- }
1746
-
1747
- /*
1748
- * Copyright (c) 2018, salesforce.com, inc.
1749
- * All rights reserved.
1750
- * SPDX-License-Identifier: MIT
1751
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1752
- */
1753
- function track(target) {
1754
- if (arguments.length === 1) {
1755
- return reactiveMembrane.getProxy(target);
1756
- }
1757
- throw new Error();
1758
- }
1759
- function internalTrackDecorator(key) {
1722
+ function createObservedFieldPropertyDescriptor(key) {
1760
1723
  return {
1761
1724
  get() {
1762
1725
  const vm = getAssociatedVM(this);
@@ -1765,9 +1728,8 @@ var LWC = (function (exports) {
1765
1728
  },
1766
1729
  set(newValue) {
1767
1730
  const vm = getAssociatedVM(this);
1768
- const reactiveOrAnyValue = reactiveMembrane.getProxy(newValue);
1769
- if (reactiveOrAnyValue !== vm.cmpFields[key]) {
1770
- vm.cmpFields[key] = reactiveOrAnyValue;
1731
+ if (newValue !== vm.cmpFields[key]) {
1732
+ vm.cmpFields[key] = newValue;
1771
1733
  componentValueMutated(vm, key);
1772
1734
  }
1773
1735
  },
@@ -1904,7 +1866,19 @@ var LWC = (function (exports) {
1904
1866
  };
1905
1867
  }
1906
1868
 
1907
- function createObservedFieldPropertyDescriptor(key) {
1869
+ /*
1870
+ * Copyright (c) 2018, salesforce.com, inc.
1871
+ * All rights reserved.
1872
+ * SPDX-License-Identifier: MIT
1873
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1874
+ */
1875
+ function track(target) {
1876
+ if (arguments.length === 1) {
1877
+ return reactiveMembrane.getProxy(target);
1878
+ }
1879
+ throw new Error();
1880
+ }
1881
+ function internalTrackDecorator(key) {
1908
1882
  return {
1909
1883
  get() {
1910
1884
  const vm = getAssociatedVM(this);
@@ -1913,8 +1887,48 @@ var LWC = (function (exports) {
1913
1887
  },
1914
1888
  set(newValue) {
1915
1889
  const vm = getAssociatedVM(this);
1916
- if (newValue !== vm.cmpFields[key]) {
1917
- vm.cmpFields[key] = newValue;
1890
+ const reactiveOrAnyValue = reactiveMembrane.getProxy(newValue);
1891
+ if (reactiveOrAnyValue !== vm.cmpFields[key]) {
1892
+ vm.cmpFields[key] = reactiveOrAnyValue;
1893
+ componentValueMutated(vm, key);
1894
+ }
1895
+ },
1896
+ enumerable: true,
1897
+ configurable: true,
1898
+ };
1899
+ }
1900
+
1901
+ /*
1902
+ * Copyright (c) 2018, salesforce.com, inc.
1903
+ * All rights reserved.
1904
+ * SPDX-License-Identifier: MIT
1905
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1906
+ */
1907
+ /**
1908
+ * @wire decorator to wire fields and methods to a wire adapter in
1909
+ * LWC Components. This function implements the internals of this
1910
+ * decorator.
1911
+ */
1912
+ function wire(_adapter, _config) {
1913
+ throw new Error();
1914
+ }
1915
+ function internalWireFieldDecorator(key) {
1916
+ return {
1917
+ get() {
1918
+ const vm = getAssociatedVM(this);
1919
+ componentValueObserved(vm, key);
1920
+ return vm.cmpFields[key];
1921
+ },
1922
+ set(value) {
1923
+ const vm = getAssociatedVM(this);
1924
+ /**
1925
+ * Reactivity for wired fields is provided in wiring.
1926
+ * We intentionally add reactivity here since this is just
1927
+ * letting the author to do the wrong thing, but it will keep our
1928
+ * system to be backward compatible.
1929
+ */
1930
+ if (value !== vm.cmpFields[key]) {
1931
+ vm.cmpFields[key] = value;
1918
1932
  componentValueMutated(vm, key);
1919
1933
  }
1920
1934
  },
@@ -2212,20 +2226,6 @@ var LWC = (function (exports) {
2212
2226
  const BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor$1, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
2213
2227
  freeze(BaseBridgeElement);
2214
2228
  seal(BaseBridgeElement.prototype);
2215
-
2216
- /*
2217
- * Copyright (c) 2020, salesforce.com, inc.
2218
- * All rights reserved.
2219
- * SPDX-License-Identifier: MIT
2220
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2221
- */
2222
- function resolveCircularModuleDependency(fn) {
2223
- const module = fn();
2224
- return (module === null || module === void 0 ? void 0 : module.__esModule) ? module.default : module;
2225
- }
2226
- function isCircularModuleDependency(obj) {
2227
- return isFunction$1(obj) && hasOwnProperty$1.call(obj, '__circular__');
2228
- }
2229
2229
  function setActiveVM(vm) {
2230
2230
  {
2231
2231
  // this method should never leak to prod
@@ -2996,13 +2996,6 @@ var LWC = (function (exports) {
2996
2996
  slotName = ((_a = vnode.data.attrs) === null || _a === void 0 ? void 0 : _a.slot) || '';
2997
2997
  }
2998
2998
  const vnodes = (cmpSlots[slotName] = cmpSlots[slotName] || []);
2999
- // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
3000
- // which might have similar keys. Each vnode will always have a key that
3001
- // starts with a numeric character from compiler. In this case, we add a unique
3002
- // notation for slotted vnodes keys, e.g.: `@foo:1:1`
3003
- if (!isUndefined$1(vnode.key)) {
3004
- vnode.key = `@${slotName}:${vnode.key}`;
3005
- }
3006
2999
  ArrayPush$1.call(vnodes, vnode);
3007
3000
  }
3008
3001
  if (isFalse(vm.isDirty)) {
@@ -4042,20 +4035,9 @@ var LWC = (function (exports) {
4042
4035
 
4043
4036
  resetComponentStateWhenRemoved(vm);
4044
4037
  }
4045
-
4046
- function getNearestShadowAncestor(vm) {
4047
- let ancestor = vm.owner;
4048
-
4049
- while (!isNull(ancestor) && ancestor.renderMode === 0
4050
- /* Light */
4051
- ) {
4052
- ancestor = ancestor.owner;
4053
- }
4054
-
4055
- return ancestor;
4056
- }
4057
-
4058
4038
  function createVM(elm, ctor, options) {
4039
+ var _a;
4040
+
4059
4041
  const {
4060
4042
  mode,
4061
4043
  owner,
@@ -4083,6 +4065,8 @@ var LWC = (function (exports) {
4083
4065
  oar: create(null),
4084
4066
  cmpTemplate: null,
4085
4067
  renderMode: def.renderMode,
4068
+ shadowMode: computeShadowMode(def, owner),
4069
+ nearestShadowMode: (owner === null || owner === void 0 ? void 0 : owner.shadowRoot) ? owner.shadowMode : (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : null,
4086
4070
  context: {
4087
4071
  stylesheetToken: undefined,
4088
4072
  hasTokenInClass: undefined,
@@ -4095,7 +4079,6 @@ var LWC = (function (exports) {
4095
4079
  },
4096
4080
  // Properties set right after VM creation.
4097
4081
  tro: null,
4098
- shadowMode: null,
4099
4082
  // Properties set by the LightningElement constructor.
4100
4083
  component: null,
4101
4084
  shadowRoot: null,
@@ -4104,7 +4087,6 @@ var LWC = (function (exports) {
4104
4087
  setHook,
4105
4088
  getHook
4106
4089
  };
4107
- vm.shadowMode = computeShadowMode(vm);
4108
4090
  vm.tro = getTemplateReactiveObserver(vm);
4109
4091
 
4110
4092
 
@@ -4117,10 +4099,9 @@ var LWC = (function (exports) {
4117
4099
  return vm;
4118
4100
  }
4119
4101
 
4120
- function computeShadowMode(vm) {
4121
- const {
4122
- def
4123
- } = vm;
4102
+ function computeShadowMode(def, owner) {
4103
+ var _a;
4104
+
4124
4105
  let shadowMode;
4125
4106
 
4126
4107
  if (isSyntheticShadowDefined$1) {
@@ -4143,23 +4124,13 @@ var LWC = (function (exports) {
4143
4124
  /* Native */
4144
4125
  ;
4145
4126
  } else {
4146
- const shadowAncestor = getNearestShadowAncestor(vm);
4147
-
4148
- if (!isNull(shadowAncestor) && shadowAncestor.shadowMode === 0
4149
- /* Native */
4150
- ) {
4151
- // Transitive support for native Shadow DOM. A component in native mode
4152
- // transitively opts all of its descendants into native.
4153
- shadowMode = 0
4154
- /* Native */
4155
- ;
4156
- } else {
4157
- // Synthetic if neither this component nor any of its ancestors are configured
4158
- // to be native.
4159
- shadowMode = 1
4160
- /* Synthetic */
4161
- ;
4162
- }
4127
+ // Transitive support for native Shadow DOM. A component in native mode
4128
+ // transitively opts all of its descendants into native.
4129
+ // Synthetic if neither this component nor any of its ancestors are configured
4130
+ // to be native.
4131
+ shadowMode = (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : 1
4132
+ /* Synthetic */
4133
+ ;
4163
4134
  }
4164
4135
  } else {
4165
4136
  shadowMode = 1
@@ -5135,7 +5106,30 @@ var LWC = (function (exports) {
5135
5106
  hooksAreSet = true;
5136
5107
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
5137
5108
  }
5138
- /* version: 2.12.1 */
5109
+
5110
+ /*
5111
+ * Copyright (c) 2018, salesforce.com, inc.
5112
+ * All rights reserved.
5113
+ * SPDX-License-Identifier: MIT
5114
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5115
+ */
5116
+ /**
5117
+ * EXPERIMENTAL: This function provides access to the component constructor, given an HTMLElement.
5118
+ * This API is subject to change or being removed.
5119
+ */
5120
+ function getComponentConstructor(elm) {
5121
+ let ctor = null;
5122
+ // intentionally checking for undefined due to some funky libraries patching weakmap.get
5123
+ // to throw when undefined.
5124
+ if (!isUndefined$1(elm)) {
5125
+ const vm = getAssociatedVMIfPresent(elm);
5126
+ if (!isUndefined$1(vm)) {
5127
+ ctor = vm.def.ctor;
5128
+ }
5129
+ }
5130
+ return ctor;
5131
+ }
5132
+ /* version: 2.13.2 */
5139
5133
 
5140
5134
  /*
5141
5135
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5653,27 +5647,6 @@ var LWC = (function (exports) {
5653
5647
  return element;
5654
5648
  }
5655
5649
 
5656
- /*
5657
- * Copyright (c) 2018, salesforce.com, inc.
5658
- * All rights reserved.
5659
- * SPDX-License-Identifier: MIT
5660
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5661
- */
5662
- /**
5663
- * EXPERIMENTAL: This function provides access to the component constructor, given an HTMLElement.
5664
- * This API is subject to change or being removed.
5665
- */
5666
- function getComponentConstructor(elm) {
5667
- let ctor = null;
5668
- if (elm instanceof HTMLElement) {
5669
- const vm = getAssociatedVMIfPresent(elm);
5670
- if (!isUndefined$1(vm)) {
5671
- ctor = vm.def.ctor;
5672
- }
5673
- }
5674
- return ctor;
5675
- }
5676
-
5677
5650
  /*
5678
5651
  * Copyright (c) 2018, salesforce.com, inc.
5679
5652
  * All rights reserved.
@@ -5742,7 +5715,7 @@ var LWC = (function (exports) {
5742
5715
  });
5743
5716
  freeze(LightningElement);
5744
5717
  seal(LightningElement.prototype);
5745
- /* version: 2.12.1 */
5718
+ /* version: 2.13.2 */
5746
5719
 
5747
5720
  exports.LightningElement = LightningElement;
5748
5721
  exports.__unstable__ProfilerControl = profilerControl;