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
@@ -417,9 +417,9 @@ const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
417
417
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
418
418
  */
419
419
  // Increment whenever the LWC template compiler changes
420
- const LWC_VERSION = "2.12.1";
420
+ const LWC_VERSION = "2.13.2";
421
421
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
422
- /** version: 2.12.1 */
422
+ /** version: 2.13.2 */
423
423
 
424
424
  /*
425
425
  * Copyright (c) 2020, salesforce.com, inc.
@@ -527,7 +527,7 @@ function setFeatureFlagForTest(name, value) {
527
527
  setFeatureFlag(name, value);
528
528
  }
529
529
  }
530
- /** version: 2.12.1 */
530
+ /** version: 2.13.2 */
531
531
 
532
532
  /* proxy-compat-disable */
533
533
 
@@ -935,6 +935,20 @@ function logError(message, vm) {
935
935
  log('error', message, vm);
936
936
  }
937
937
 
938
+ /*
939
+ * Copyright (c) 2020, salesforce.com, inc.
940
+ * All rights reserved.
941
+ * SPDX-License-Identifier: MIT
942
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
943
+ */
944
+ function resolveCircularModuleDependency(fn) {
945
+ const module = fn();
946
+ return (module === null || module === void 0 ? void 0 : module.__esModule) ? module.default : module;
947
+ }
948
+ function isCircularModuleDependency(obj) {
949
+ return isFunction$1(obj) && hasOwnProperty$1.call(obj, '__circular__');
950
+ }
951
+
938
952
  /*
939
953
  * Copyright (c) 2018, salesforce.com, inc.
940
954
  * All rights reserved.
@@ -2300,64 +2314,7 @@ if (process.env.NODE_ENV !== 'production') {
2300
2314
  patchLightningElementPrototypeWithRestrictions(LightningElement.prototype);
2301
2315
  }
2302
2316
 
2303
- /*
2304
- * Copyright (c) 2018, salesforce.com, inc.
2305
- * All rights reserved.
2306
- * SPDX-License-Identifier: MIT
2307
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2308
- */
2309
- /**
2310
- * @wire decorator to wire fields and methods to a wire adapter in
2311
- * LWC Components. This function implements the internals of this
2312
- * decorator.
2313
- */
2314
- function wire(_adapter, _config) {
2315
- if (process.env.NODE_ENV !== 'production') {
2316
- assert.fail('@wire(adapter, config?) may only be used as a decorator.');
2317
- }
2318
- throw new Error();
2319
- }
2320
- function internalWireFieldDecorator(key) {
2321
- return {
2322
- get() {
2323
- const vm = getAssociatedVM(this);
2324
- componentValueObserved(vm, key);
2325
- return vm.cmpFields[key];
2326
- },
2327
- set(value) {
2328
- const vm = getAssociatedVM(this);
2329
- /**
2330
- * Reactivity for wired fields is provided in wiring.
2331
- * We intentionally add reactivity here since this is just
2332
- * letting the author to do the wrong thing, but it will keep our
2333
- * system to be backward compatible.
2334
- */
2335
- if (value !== vm.cmpFields[key]) {
2336
- vm.cmpFields[key] = value;
2337
- componentValueMutated(vm, key);
2338
- }
2339
- },
2340
- enumerable: true,
2341
- configurable: true,
2342
- };
2343
- }
2344
-
2345
- /*
2346
- * Copyright (c) 2018, salesforce.com, inc.
2347
- * All rights reserved.
2348
- * SPDX-License-Identifier: MIT
2349
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2350
- */
2351
- function track(target) {
2352
- if (arguments.length === 1) {
2353
- return reactiveMembrane.getProxy(target);
2354
- }
2355
- if (process.env.NODE_ENV !== 'production') {
2356
- assert.fail(`@track decorator can only be used with one argument to return a trackable object, or as a decorator function.`);
2357
- }
2358
- throw new Error();
2359
- }
2360
- function internalTrackDecorator(key) {
2317
+ function createObservedFieldPropertyDescriptor(key) {
2361
2318
  return {
2362
2319
  get() {
2363
2320
  const vm = getAssociatedVM(this);
@@ -2366,14 +2323,8 @@ function internalTrackDecorator(key) {
2366
2323
  },
2367
2324
  set(newValue) {
2368
2325
  const vm = getAssociatedVM(this);
2369
- if (process.env.NODE_ENV !== 'production') {
2370
- const vmBeingRendered = getVMBeingRendered();
2371
- assert.invariant(!isInvokingRender, `${vmBeingRendered}.render() method has side effects on the state of ${vm}.${toString$1(key)}`);
2372
- assert.invariant(!isUpdatingTemplate, `Updating the template of ${vmBeingRendered} has side effects on the state of ${vm}.${toString$1(key)}`);
2373
- }
2374
- const reactiveOrAnyValue = reactiveMembrane.getProxy(newValue);
2375
- if (reactiveOrAnyValue !== vm.cmpFields[key]) {
2376
- vm.cmpFields[key] = reactiveOrAnyValue;
2326
+ if (newValue !== vm.cmpFields[key]) {
2327
+ vm.cmpFields[key] = newValue;
2377
2328
  componentValueMutated(vm, key);
2378
2329
  }
2379
2330
  },
@@ -2537,7 +2488,22 @@ function createPublicAccessorDescriptor(key, descriptor) {
2537
2488
  };
2538
2489
  }
2539
2490
 
2540
- function createObservedFieldPropertyDescriptor(key) {
2491
+ /*
2492
+ * Copyright (c) 2018, salesforce.com, inc.
2493
+ * All rights reserved.
2494
+ * SPDX-License-Identifier: MIT
2495
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2496
+ */
2497
+ function track(target) {
2498
+ if (arguments.length === 1) {
2499
+ return reactiveMembrane.getProxy(target);
2500
+ }
2501
+ if (process.env.NODE_ENV !== 'production') {
2502
+ assert.fail(`@track decorator can only be used with one argument to return a trackable object, or as a decorator function.`);
2503
+ }
2504
+ throw new Error();
2505
+ }
2506
+ function internalTrackDecorator(key) {
2541
2507
  return {
2542
2508
  get() {
2543
2509
  const vm = getAssociatedVM(this);
@@ -2546,8 +2512,56 @@ function createObservedFieldPropertyDescriptor(key) {
2546
2512
  },
2547
2513
  set(newValue) {
2548
2514
  const vm = getAssociatedVM(this);
2549
- if (newValue !== vm.cmpFields[key]) {
2550
- vm.cmpFields[key] = newValue;
2515
+ if (process.env.NODE_ENV !== 'production') {
2516
+ const vmBeingRendered = getVMBeingRendered();
2517
+ assert.invariant(!isInvokingRender, `${vmBeingRendered}.render() method has side effects on the state of ${vm}.${toString$1(key)}`);
2518
+ assert.invariant(!isUpdatingTemplate, `Updating the template of ${vmBeingRendered} has side effects on the state of ${vm}.${toString$1(key)}`);
2519
+ }
2520
+ const reactiveOrAnyValue = reactiveMembrane.getProxy(newValue);
2521
+ if (reactiveOrAnyValue !== vm.cmpFields[key]) {
2522
+ vm.cmpFields[key] = reactiveOrAnyValue;
2523
+ componentValueMutated(vm, key);
2524
+ }
2525
+ },
2526
+ enumerable: true,
2527
+ configurable: true,
2528
+ };
2529
+ }
2530
+
2531
+ /*
2532
+ * Copyright (c) 2018, salesforce.com, inc.
2533
+ * All rights reserved.
2534
+ * SPDX-License-Identifier: MIT
2535
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2536
+ */
2537
+ /**
2538
+ * @wire decorator to wire fields and methods to a wire adapter in
2539
+ * LWC Components. This function implements the internals of this
2540
+ * decorator.
2541
+ */
2542
+ function wire(_adapter, _config) {
2543
+ if (process.env.NODE_ENV !== 'production') {
2544
+ assert.fail('@wire(adapter, config?) may only be used as a decorator.');
2545
+ }
2546
+ throw new Error();
2547
+ }
2548
+ function internalWireFieldDecorator(key) {
2549
+ return {
2550
+ get() {
2551
+ const vm = getAssociatedVM(this);
2552
+ componentValueObserved(vm, key);
2553
+ return vm.cmpFields[key];
2554
+ },
2555
+ set(value) {
2556
+ const vm = getAssociatedVM(this);
2557
+ /**
2558
+ * Reactivity for wired fields is provided in wiring.
2559
+ * We intentionally add reactivity here since this is just
2560
+ * letting the author to do the wrong thing, but it will keep our
2561
+ * system to be backward compatible.
2562
+ */
2563
+ if (value !== vm.cmpFields[key]) {
2564
+ vm.cmpFields[key] = value;
2551
2565
  componentValueMutated(vm, key);
2552
2566
  }
2553
2567
  },
@@ -2981,20 +2995,6 @@ const BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOw
2981
2995
  freeze(BaseBridgeElement);
2982
2996
  seal(BaseBridgeElement.prototype);
2983
2997
 
2984
- /*
2985
- * Copyright (c) 2020, salesforce.com, inc.
2986
- * All rights reserved.
2987
- * SPDX-License-Identifier: MIT
2988
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2989
- */
2990
- function resolveCircularModuleDependency(fn) {
2991
- const module = fn();
2992
- return (module === null || module === void 0 ? void 0 : module.__esModule) ? module.default : module;
2993
- }
2994
- function isCircularModuleDependency(obj) {
2995
- return isFunction$1(obj) && hasOwnProperty$1.call(obj, '__circular__');
2996
- }
2997
-
2998
2998
  /*
2999
2999
  * Copyright (c) 2020, salesforce.com, inc.
3000
3000
  * All rights reserved.
@@ -3963,13 +3963,6 @@ function allocateInSlot(vm, children) {
3963
3963
  slotName = ((_a = vnode.data.attrs) === null || _a === void 0 ? void 0 : _a.slot) || '';
3964
3964
  }
3965
3965
  const vnodes = (cmpSlots[slotName] = cmpSlots[slotName] || []);
3966
- // re-keying the vnodes is necessary to avoid conflicts with default content for the slot
3967
- // which might have similar keys. Each vnode will always have a key that
3968
- // starts with a numeric character from compiler. In this case, we add a unique
3969
- // notation for slotted vnodes keys, e.g.: `@foo:1:1`
3970
- if (!isUndefined$1(vnode.key)) {
3971
- vnode.key = `@${slotName}:${vnode.key}`;
3972
- }
3973
3966
  ArrayPush$1.call(vnodes, vnode);
3974
3967
  }
3975
3968
  if (isFalse(vm.isDirty)) {
@@ -5239,20 +5232,9 @@ function removeVM(vm) {
5239
5232
 
5240
5233
  resetComponentStateWhenRemoved(vm);
5241
5234
  }
5242
-
5243
- function getNearestShadowAncestor(vm) {
5244
- let ancestor = vm.owner;
5245
-
5246
- while (!isNull(ancestor) && ancestor.renderMode === 0
5247
- /* Light */
5248
- ) {
5249
- ancestor = ancestor.owner;
5250
- }
5251
-
5252
- return ancestor;
5253
- }
5254
-
5255
5235
  function createVM(elm, ctor, options) {
5236
+ var _a;
5237
+
5256
5238
  const {
5257
5239
  mode,
5258
5240
  owner,
@@ -5280,6 +5262,8 @@ function createVM(elm, ctor, options) {
5280
5262
  oar: create(null),
5281
5263
  cmpTemplate: null,
5282
5264
  renderMode: def.renderMode,
5265
+ shadowMode: computeShadowMode(def, owner),
5266
+ 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,
5283
5267
  context: {
5284
5268
  stylesheetToken: undefined,
5285
5269
  hasTokenInClass: undefined,
@@ -5292,7 +5276,6 @@ function createVM(elm, ctor, options) {
5292
5276
  },
5293
5277
  // Properties set right after VM creation.
5294
5278
  tro: null,
5295
- shadowMode: null,
5296
5279
  // Properties set by the LightningElement constructor.
5297
5280
  component: null,
5298
5281
  shadowRoot: null,
@@ -5301,7 +5284,6 @@ function createVM(elm, ctor, options) {
5301
5284
  setHook,
5302
5285
  getHook
5303
5286
  };
5304
- vm.shadowMode = computeShadowMode(vm);
5305
5287
  vm.tro = getTemplateReactiveObserver(vm);
5306
5288
 
5307
5289
  if (process.env.NODE_ENV !== 'production') {
@@ -5326,10 +5308,9 @@ function createVM(elm, ctor, options) {
5326
5308
  return vm;
5327
5309
  }
5328
5310
 
5329
- function computeShadowMode(vm) {
5330
- const {
5331
- def
5332
- } = vm;
5311
+ function computeShadowMode(def, owner) {
5312
+ var _a;
5313
+
5333
5314
  let shadowMode;
5334
5315
 
5335
5316
  if (isSyntheticShadowDefined$1) {
@@ -5352,23 +5333,13 @@ function computeShadowMode(vm) {
5352
5333
  /* Native */
5353
5334
  ;
5354
5335
  } else {
5355
- const shadowAncestor = getNearestShadowAncestor(vm);
5356
-
5357
- if (!isNull(shadowAncestor) && shadowAncestor.shadowMode === 0
5358
- /* Native */
5359
- ) {
5360
- // Transitive support for native Shadow DOM. A component in native mode
5361
- // transitively opts all of its descendants into native.
5362
- shadowMode = 0
5363
- /* Native */
5364
- ;
5365
- } else {
5366
- // Synthetic if neither this component nor any of its ancestors are configured
5367
- // to be native.
5368
- shadowMode = 1
5369
- /* Synthetic */
5370
- ;
5371
- }
5336
+ // Transitive support for native Shadow DOM. A component in native mode
5337
+ // transitively opts all of its descendants into native.
5338
+ // Synthetic if neither this component nor any of its ancestors are configured
5339
+ // to be native.
5340
+ shadowMode = (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : 1
5341
+ /* Synthetic */
5342
+ ;
5372
5343
  }
5373
5344
  } else {
5374
5345
  shadowMode = 1
@@ -6148,7 +6119,7 @@ function setHooks(hooks) {
6148
6119
  hooksAreSet = true;
6149
6120
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
6150
6121
  }
6151
- /* version: 2.12.1 */
6122
+ /* version: 2.13.2 */
6152
6123
 
6153
6124
  /*
6154
6125
  * Copyright (c) 2020, salesforce.com, inc.
@@ -6615,6 +6586,6 @@ function renderComponent(tagName, Ctor, props = {}) {
6615
6586
  */
6616
6587
  freeze(LightningElement);
6617
6588
  seal(LightningElement.prototype);
6618
- /* version: 2.12.1 */
6589
+ /* version: 2.13.2 */
6619
6590
 
6620
6591
  export { LightningElement, api$1 as api, createContextProvider, getComponentDef, isComponentConstructor, readonly, register, registerComponent, registerDecorators, registerTemplate, renderComponent, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, track, unwrap, wire };