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
@@ -293,7 +293,7 @@
293
293
  const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
294
294
  const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
295
295
  const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
296
- /** version: 2.12.1 */
296
+ /** version: 2.13.2 */
297
297
 
298
298
  /*
299
299
  * Copyright (c) 2018, salesforce.com, inc.
@@ -436,7 +436,7 @@
436
436
  */
437
437
  function setFeatureFlagForTest(name, value) {
438
438
  }
439
- /** version: 2.12.1 */
439
+ /** version: 2.13.2 */
440
440
 
441
441
  /* proxy-compat-disable */
442
442
 
@@ -840,6 +840,20 @@
840
840
  log('error', message, vm);
841
841
  }
842
842
 
843
+ /*
844
+ * Copyright (c) 2020, salesforce.com, inc.
845
+ * All rights reserved.
846
+ * SPDX-License-Identifier: MIT
847
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
848
+ */
849
+ function resolveCircularModuleDependency(fn) {
850
+ const module = fn();
851
+ return (module === null || module === void 0 ? void 0 : module.__esModule) ? module.default : module;
852
+ }
853
+ function isCircularModuleDependency(obj) {
854
+ return isFunction$1(obj) && hasOwnProperty$1.call(obj, '__circular__');
855
+ }
856
+
843
857
  /*
844
858
  * Copyright (c) 2018, salesforce.com, inc.
845
859
  * All rights reserved.
@@ -1708,58 +1722,7 @@
1708
1722
  configurable: true,
1709
1723
  });
1710
1724
 
1711
- /*
1712
- * Copyright (c) 2018, salesforce.com, inc.
1713
- * All rights reserved.
1714
- * SPDX-License-Identifier: MIT
1715
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1716
- */
1717
- /**
1718
- * @wire decorator to wire fields and methods to a wire adapter in
1719
- * LWC Components. This function implements the internals of this
1720
- * decorator.
1721
- */
1722
- function wire(_adapter, _config) {
1723
- throw new Error();
1724
- }
1725
- function internalWireFieldDecorator(key) {
1726
- return {
1727
- get() {
1728
- const vm = getAssociatedVM(this);
1729
- componentValueObserved(vm, key);
1730
- return vm.cmpFields[key];
1731
- },
1732
- set(value) {
1733
- const vm = getAssociatedVM(this);
1734
- /**
1735
- * Reactivity for wired fields is provided in wiring.
1736
- * We intentionally add reactivity here since this is just
1737
- * letting the author to do the wrong thing, but it will keep our
1738
- * system to be backward compatible.
1739
- */
1740
- if (value !== vm.cmpFields[key]) {
1741
- vm.cmpFields[key] = value;
1742
- componentValueMutated(vm, key);
1743
- }
1744
- },
1745
- enumerable: true,
1746
- configurable: true,
1747
- };
1748
- }
1749
-
1750
- /*
1751
- * Copyright (c) 2018, salesforce.com, inc.
1752
- * All rights reserved.
1753
- * SPDX-License-Identifier: MIT
1754
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1755
- */
1756
- function track(target) {
1757
- if (arguments.length === 1) {
1758
- return reactiveMembrane.getProxy(target);
1759
- }
1760
- throw new Error();
1761
- }
1762
- function internalTrackDecorator(key) {
1725
+ function createObservedFieldPropertyDescriptor(key) {
1763
1726
  return {
1764
1727
  get() {
1765
1728
  const vm = getAssociatedVM(this);
@@ -1768,9 +1731,8 @@
1768
1731
  },
1769
1732
  set(newValue) {
1770
1733
  const vm = getAssociatedVM(this);
1771
- const reactiveOrAnyValue = reactiveMembrane.getProxy(newValue);
1772
- if (reactiveOrAnyValue !== vm.cmpFields[key]) {
1773
- vm.cmpFields[key] = reactiveOrAnyValue;
1734
+ if (newValue !== vm.cmpFields[key]) {
1735
+ vm.cmpFields[key] = newValue;
1774
1736
  componentValueMutated(vm, key);
1775
1737
  }
1776
1738
  },
@@ -1907,7 +1869,19 @@
1907
1869
  };
1908
1870
  }
1909
1871
 
1910
- function createObservedFieldPropertyDescriptor(key) {
1872
+ /*
1873
+ * Copyright (c) 2018, salesforce.com, inc.
1874
+ * All rights reserved.
1875
+ * SPDX-License-Identifier: MIT
1876
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1877
+ */
1878
+ function track(target) {
1879
+ if (arguments.length === 1) {
1880
+ return reactiveMembrane.getProxy(target);
1881
+ }
1882
+ throw new Error();
1883
+ }
1884
+ function internalTrackDecorator(key) {
1911
1885
  return {
1912
1886
  get() {
1913
1887
  const vm = getAssociatedVM(this);
@@ -1916,8 +1890,48 @@
1916
1890
  },
1917
1891
  set(newValue) {
1918
1892
  const vm = getAssociatedVM(this);
1919
- if (newValue !== vm.cmpFields[key]) {
1920
- vm.cmpFields[key] = newValue;
1893
+ const reactiveOrAnyValue = reactiveMembrane.getProxy(newValue);
1894
+ if (reactiveOrAnyValue !== vm.cmpFields[key]) {
1895
+ vm.cmpFields[key] = reactiveOrAnyValue;
1896
+ componentValueMutated(vm, key);
1897
+ }
1898
+ },
1899
+ enumerable: true,
1900
+ configurable: true,
1901
+ };
1902
+ }
1903
+
1904
+ /*
1905
+ * Copyright (c) 2018, salesforce.com, inc.
1906
+ * All rights reserved.
1907
+ * SPDX-License-Identifier: MIT
1908
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1909
+ */
1910
+ /**
1911
+ * @wire decorator to wire fields and methods to a wire adapter in
1912
+ * LWC Components. This function implements the internals of this
1913
+ * decorator.
1914
+ */
1915
+ function wire(_adapter, _config) {
1916
+ throw new Error();
1917
+ }
1918
+ function internalWireFieldDecorator(key) {
1919
+ return {
1920
+ get() {
1921
+ const vm = getAssociatedVM(this);
1922
+ componentValueObserved(vm, key);
1923
+ return vm.cmpFields[key];
1924
+ },
1925
+ set(value) {
1926
+ const vm = getAssociatedVM(this);
1927
+ /**
1928
+ * Reactivity for wired fields is provided in wiring.
1929
+ * We intentionally add reactivity here since this is just
1930
+ * letting the author to do the wrong thing, but it will keep our
1931
+ * system to be backward compatible.
1932
+ */
1933
+ if (value !== vm.cmpFields[key]) {
1934
+ vm.cmpFields[key] = value;
1921
1935
  componentValueMutated(vm, key);
1922
1936
  }
1923
1937
  },
@@ -2215,20 +2229,6 @@
2215
2229
  const BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor$1, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
2216
2230
  freeze(BaseBridgeElement);
2217
2231
  seal(BaseBridgeElement.prototype);
2218
-
2219
- /*
2220
- * Copyright (c) 2020, salesforce.com, inc.
2221
- * All rights reserved.
2222
- * SPDX-License-Identifier: MIT
2223
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2224
- */
2225
- function resolveCircularModuleDependency(fn) {
2226
- const module = fn();
2227
- return (module === null || module === void 0 ? void 0 : module.__esModule) ? module.default : module;
2228
- }
2229
- function isCircularModuleDependency(obj) {
2230
- return isFunction$1(obj) && hasOwnProperty$1.call(obj, '__circular__');
2231
- }
2232
2232
  function setActiveVM(vm) {
2233
2233
  {
2234
2234
  // this method should never leak to prod
@@ -2999,13 +2999,6 @@
2999
2999
  slotName = ((_a = vnode.data.attrs) === null || _a === void 0 ? void 0 : _a.slot) || '';
3000
3000
  }
3001
3001
  const vnodes = (cmpSlots[slotName] = cmpSlots[slotName] || []);
3002
- // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
3003
- // which might have similar keys. Each vnode will always have a key that
3004
- // starts with a numeric character from compiler. In this case, we add a unique
3005
- // notation for slotted vnodes keys, e.g.: `@foo:1:1`
3006
- if (!isUndefined$1(vnode.key)) {
3007
- vnode.key = `@${slotName}:${vnode.key}`;
3008
- }
3009
3002
  ArrayPush$1.call(vnodes, vnode);
3010
3003
  }
3011
3004
  if (isFalse(vm.isDirty)) {
@@ -4045,20 +4038,9 @@
4045
4038
 
4046
4039
  resetComponentStateWhenRemoved(vm);
4047
4040
  }
4048
-
4049
- function getNearestShadowAncestor(vm) {
4050
- let ancestor = vm.owner;
4051
-
4052
- while (!isNull(ancestor) && ancestor.renderMode === 0
4053
- /* Light */
4054
- ) {
4055
- ancestor = ancestor.owner;
4056
- }
4057
-
4058
- return ancestor;
4059
- }
4060
-
4061
4041
  function createVM(elm, ctor, options) {
4042
+ var _a;
4043
+
4062
4044
  const {
4063
4045
  mode,
4064
4046
  owner,
@@ -4086,6 +4068,8 @@
4086
4068
  oar: create(null),
4087
4069
  cmpTemplate: null,
4088
4070
  renderMode: def.renderMode,
4071
+ shadowMode: computeShadowMode(def, owner),
4072
+ 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,
4089
4073
  context: {
4090
4074
  stylesheetToken: undefined,
4091
4075
  hasTokenInClass: undefined,
@@ -4098,7 +4082,6 @@
4098
4082
  },
4099
4083
  // Properties set right after VM creation.
4100
4084
  tro: null,
4101
- shadowMode: null,
4102
4085
  // Properties set by the LightningElement constructor.
4103
4086
  component: null,
4104
4087
  shadowRoot: null,
@@ -4107,7 +4090,6 @@
4107
4090
  setHook,
4108
4091
  getHook
4109
4092
  };
4110
- vm.shadowMode = computeShadowMode(vm);
4111
4093
  vm.tro = getTemplateReactiveObserver(vm);
4112
4094
 
4113
4095
 
@@ -4120,10 +4102,9 @@
4120
4102
  return vm;
4121
4103
  }
4122
4104
 
4123
- function computeShadowMode(vm) {
4124
- const {
4125
- def
4126
- } = vm;
4105
+ function computeShadowMode(def, owner) {
4106
+ var _a;
4107
+
4127
4108
  let shadowMode;
4128
4109
 
4129
4110
  if (isSyntheticShadowDefined$1) {
@@ -4146,23 +4127,13 @@
4146
4127
  /* Native */
4147
4128
  ;
4148
4129
  } else {
4149
- const shadowAncestor = getNearestShadowAncestor(vm);
4150
-
4151
- if (!isNull(shadowAncestor) && shadowAncestor.shadowMode === 0
4152
- /* Native */
4153
- ) {
4154
- // Transitive support for native Shadow DOM. A component in native mode
4155
- // transitively opts all of its descendants into native.
4156
- shadowMode = 0
4157
- /* Native */
4158
- ;
4159
- } else {
4160
- // Synthetic if neither this component nor any of its ancestors are configured
4161
- // to be native.
4162
- shadowMode = 1
4163
- /* Synthetic */
4164
- ;
4165
- }
4130
+ // Transitive support for native Shadow DOM. A component in native mode
4131
+ // transitively opts all of its descendants into native.
4132
+ // Synthetic if neither this component nor any of its ancestors are configured
4133
+ // to be native.
4134
+ shadowMode = (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : 1
4135
+ /* Synthetic */
4136
+ ;
4166
4137
  }
4167
4138
  } else {
4168
4139
  shadowMode = 1
@@ -5138,7 +5109,30 @@
5138
5109
  hooksAreSet = true;
5139
5110
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
5140
5111
  }
5141
- /* version: 2.12.1 */
5112
+
5113
+ /*
5114
+ * Copyright (c) 2018, salesforce.com, inc.
5115
+ * All rights reserved.
5116
+ * SPDX-License-Identifier: MIT
5117
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5118
+ */
5119
+ /**
5120
+ * EXPERIMENTAL: This function provides access to the component constructor, given an HTMLElement.
5121
+ * This API is subject to change or being removed.
5122
+ */
5123
+ function getComponentConstructor(elm) {
5124
+ let ctor = null;
5125
+ // intentionally checking for undefined due to some funky libraries patching weakmap.get
5126
+ // to throw when undefined.
5127
+ if (!isUndefined$1(elm)) {
5128
+ const vm = getAssociatedVMIfPresent(elm);
5129
+ if (!isUndefined$1(vm)) {
5130
+ ctor = vm.def.ctor;
5131
+ }
5132
+ }
5133
+ return ctor;
5134
+ }
5135
+ /* version: 2.13.2 */
5142
5136
 
5143
5137
  /*
5144
5138
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5656,27 +5650,6 @@
5656
5650
  return element;
5657
5651
  }
5658
5652
 
5659
- /*
5660
- * Copyright (c) 2018, salesforce.com, inc.
5661
- * All rights reserved.
5662
- * SPDX-License-Identifier: MIT
5663
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5664
- */
5665
- /**
5666
- * EXPERIMENTAL: This function provides access to the component constructor, given an HTMLElement.
5667
- * This API is subject to change or being removed.
5668
- */
5669
- function getComponentConstructor(elm) {
5670
- let ctor = null;
5671
- if (elm instanceof HTMLElement) {
5672
- const vm = getAssociatedVMIfPresent(elm);
5673
- if (!isUndefined$1(vm)) {
5674
- ctor = vm.def.ctor;
5675
- }
5676
- }
5677
- return ctor;
5678
- }
5679
-
5680
5653
  /*
5681
5654
  * Copyright (c) 2018, salesforce.com, inc.
5682
5655
  * All rights reserved.
@@ -5745,7 +5718,7 @@
5745
5718
  });
5746
5719
  freeze(LightningElement);
5747
5720
  seal(LightningElement.prototype);
5748
- /* version: 2.12.1 */
5721
+ /* version: 2.13.2 */
5749
5722
 
5750
5723
  exports.LightningElement = LightningElement;
5751
5724
  exports.__unstable__ProfilerControl = profilerControl;