lwc 2.32.0 → 2.33.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 (41) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +898 -802
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +898 -802
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +683 -608
  5. package/dist/engine-dom/iife/es5/engine-dom.js +324 -313
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +234 -270
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +898 -802
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +683 -608
  11. package/dist/engine-dom/umd/es5/engine-dom.js +324 -313
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +234 -270
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +871 -696
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +871 -696
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +676 -909
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +676 -909
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +644 -882
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +89 -347
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +89 -347
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +676 -909
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +644 -882
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +89 -347
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +89 -347
  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_debug.js +2 -2
  33. package/dist/wire-service/iife/es5/wire-service.js +5 -3
  34. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  35. package/dist/wire-service/iife/es5/wire-service_debug.js +5 -3
  36. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  37. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service.js +5 -3
  39. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  40. package/dist/wire-service/umd/es5/wire-service_debug.js +5 -3
  41. package/package.json +7 -7
@@ -7,9 +7,7 @@
7
7
  function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf2(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
8
8
  function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
9
9
  function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
10
- function _get2() { if (typeof Reflect !== "undefined" && Reflect.get) { _get2 = Reflect.get.bind(); } else { _get2 = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get2.apply(this, arguments); }
11
- function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf2(object); if (object === null) break; } return object; }
12
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
11
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
14
12
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
13
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf2(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf2(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -18,15 +16,17 @@
18
16
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
19
17
  function _getPrototypeOf2(o) { _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf2(o); }
20
18
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
19
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
22
20
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
21
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
22
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
23
23
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
24
24
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
25
25
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
26
26
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
27
27
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
28
28
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
29
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
30
30
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
31
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
32
32
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -181,6 +181,9 @@
181
181
  * The above list of 46 aria attributes is consistent with the following resources:
182
182
  * https://github.com/w3c/aria/pull/708/files#diff-eacf331f0ffc35d4b482f1d15a887d3bR11060
183
183
  * https://wicg.github.io/aom/spec/aria-reflection.html
184
+ *
185
+ * NOTE: If you update this list, please update test files that implicitly reference this list!
186
+ * Searching the codebase for `aria-flowto` and `ariaFlowTo` should be good enough to find all usages.
184
187
  */
185
188
  var AriaPropertyNames = ['ariaActiveDescendant', 'ariaAtomic', 'ariaAutoComplete', 'ariaBusy', 'ariaChecked', 'ariaColCount', 'ariaColIndex', 'ariaColSpan', 'ariaControls', 'ariaCurrent', 'ariaDescribedBy', 'ariaDetails', 'ariaDisabled', 'ariaErrorMessage', 'ariaExpanded', 'ariaFlowTo', 'ariaHasPopup', 'ariaHidden', 'ariaInvalid', 'ariaKeyShortcuts', 'ariaLabel', 'ariaLabelledBy', 'ariaLevel', 'ariaLive', 'ariaModal', 'ariaMultiLine', 'ariaMultiSelectable', 'ariaOrientation', 'ariaOwns', 'ariaPlaceholder', 'ariaPosInSet', 'ariaPressed', 'ariaReadOnly', 'ariaRelevant', 'ariaRequired', 'ariaRoleDescription', 'ariaRowCount', 'ariaRowIndex', 'ariaRowSpan', 'ariaSelected', 'ariaSetSize', 'ariaSort', 'ariaValueMax', 'ariaValueMin', 'ariaValueNow', 'ariaValueText', 'role'];
186
189
  var _ref = /*@__PURE__*/function () {
@@ -349,90 +352,9 @@
349
352
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
350
353
  */
351
354
  // Increment whenever the LWC template compiler changes
352
- var LWC_VERSION = "2.32.0";
355
+ var LWC_VERSION = "2.33.0";
353
356
  var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
354
- /** version: 2.32.0 */
355
-
356
- /**
357
- * Copyright (C) 2018 salesforce.com, inc.
358
- */
359
-
360
- /*
361
- * Copyright (c) 2018, salesforce.com, inc.
362
- * All rights reserved.
363
- * SPDX-License-Identifier: MIT
364
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
365
- */
366
- function detect(propName) {
367
- return getOwnPropertyDescriptor$1(Element.prototype, propName) === undefined;
368
- }
369
-
370
- /*
371
- * Copyright (c) 2018, salesforce.com, inc.
372
- * All rights reserved.
373
- * SPDX-License-Identifier: MIT
374
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
375
- */
376
- var nodeToAriaPropertyValuesMap = new WeakMap();
377
- function getAriaPropertyMap(elm) {
378
- var map = nodeToAriaPropertyValuesMap.get(elm);
379
- if (map === undefined) {
380
- map = {};
381
- nodeToAriaPropertyValuesMap.set(elm, map);
382
- }
383
- return map;
384
- }
385
- function getNormalizedAriaPropertyValue(value) {
386
- return value == null ? null : String(value);
387
- }
388
- function createAriaPropertyPropertyDescriptor(propName, attrName) {
389
- return {
390
- get: function get() {
391
- var map = getAriaPropertyMap(this);
392
- if (hasOwnProperty$1.call(map, propName)) {
393
- return map[propName];
394
- }
395
- // otherwise just reflect what's in the attribute
396
- return this.hasAttribute(attrName) ? this.getAttribute(attrName) : null;
397
- },
398
- set: function set(newValue) {
399
- var normalizedValue = getNormalizedAriaPropertyValue(newValue);
400
- var map = getAriaPropertyMap(this);
401
- map[propName] = normalizedValue;
402
- // reflect into the corresponding attribute
403
- if (newValue === null) {
404
- this.removeAttribute(attrName);
405
- } else {
406
- this.setAttribute(attrName, newValue);
407
- }
408
- },
409
- configurable: true,
410
- enumerable: true
411
- };
412
- }
413
- function patch$1(propName) {
414
- // Typescript is inferring the wrong function type for this particular
415
- // overloaded method: https://github.com/Microsoft/TypeScript/issues/27972
416
- // @ts-ignore type-mismatch
417
- var attrName = AriaPropNameToAttrNameMap[propName];
418
- var descriptor = createAriaPropertyPropertyDescriptor(propName, attrName);
419
- Object.defineProperty(Element.prototype, propName, descriptor);
420
- }
421
-
422
- /*
423
- * Copyright (c) 2018, salesforce.com, inc.
424
- * All rights reserved.
425
- * SPDX-License-Identifier: MIT
426
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
427
- */
428
- var ElementPrototypeAriaPropertyNames = keys(AriaPropNameToAttrNameMap);
429
- for (var _i2 = 0, len = ElementPrototypeAriaPropertyNames.length; _i2 < len; _i2 += 1) {
430
- var propName = ElementPrototypeAriaPropertyNames[_i2];
431
- if (detect(propName)) {
432
- patch$1(propName);
433
- }
434
- }
435
- /** version: 2.32.0 */
357
+ /** version: 2.33.0 */
436
358
 
437
359
  /**
438
360
  * Copyright (C) 2018 salesforce.com, inc.
@@ -446,19 +368,15 @@
446
368
  */
447
369
  var features = {
448
370
  DUMMY_TEST_FLAG: null,
449
- ENABLE_ELEMENT_PATCH: null,
450
371
  ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST: null,
451
- ENABLE_HTML_COLLECTIONS_PATCH: null,
452
- ENABLE_INNER_OUTER_TEXT_PATCH: null,
453
372
  ENABLE_MIXED_SHADOW_MODE: null,
454
373
  ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE: null,
455
- ENABLE_NODE_LIST_PATCH: null,
456
- ENABLE_NODE_PATCH: null,
457
- ENABLE_REACTIVE_SETTER: null,
458
374
  ENABLE_WIRE_SYNC_EMIT: null,
459
375
  ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null,
460
376
  DISABLE_LIGHT_DOM_UNSCOPED_CSS: null,
461
- ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY: null
377
+ ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY: null,
378
+ ENABLE_FROZEN_TEMPLATE: null,
379
+ DISABLE_ARIA_REFLECTION_POLYFILL: null
462
380
  };
463
381
  if (!_globalThis.lwcRuntimeFlags) {
464
382
  Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
@@ -514,7 +432,83 @@
514
432
  setFeatureFlag(name, value);
515
433
  }
516
434
  }
517
- /** version: 2.32.0 */
435
+ /** version: 2.33.0 */
436
+
437
+ /**
438
+ * Copyright (C) 2018 salesforce.com, inc.
439
+ */
440
+
441
+ /*
442
+ * Copyright (c) 2018, salesforce.com, inc.
443
+ * All rights reserved.
444
+ * SPDX-License-Identifier: MIT
445
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
446
+ */
447
+ function detect(propName, prototype) {
448
+ return isUndefined$1(getOwnPropertyDescriptor$1(prototype, propName));
449
+ }
450
+
451
+ /*
452
+ * Copyright (c) 2018, salesforce.com, inc.
453
+ * All rights reserved.
454
+ * SPDX-License-Identifier: MIT
455
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
456
+ */
457
+ function createAriaPropertyPropertyDescriptor(attrName) {
458
+ // Note that we need to call this.{get,set,has,remove}Attribute rather than dereferencing
459
+ // from Element.prototype, because these methods are overridden in LightningElement.
460
+ return {
461
+ get: function get() {
462
+ // reflect what's in the attribute
463
+ return this.hasAttribute(attrName) ? this.getAttribute(attrName) : null;
464
+ },
465
+ set: function set(newValue) {
466
+ // reflect into the corresponding attribute
467
+ if (isNull(newValue)) {
468
+ this.removeAttribute(attrName);
469
+ } else {
470
+ this.setAttribute(attrName, newValue);
471
+ }
472
+ },
473
+ configurable: true,
474
+ enumerable: true
475
+ };
476
+ }
477
+ function patch$1(propName, prototype) {
478
+ var attrName = AriaPropNameToAttrNameMap[propName];
479
+ var descriptor = createAriaPropertyPropertyDescriptor(attrName);
480
+ defineProperty(prototype, propName, descriptor);
481
+ }
482
+
483
+ /*
484
+ * Copyright (c) 2018, salesforce.com, inc.
485
+ * All rights reserved.
486
+ * SPDX-License-Identifier: MIT
487
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
488
+ */
489
+ function applyAriaReflection() {
490
+ var prototype = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Element.prototype;
491
+ var ElementPrototypeAriaPropertyNames = keys(AriaPropNameToAttrNameMap);
492
+ for (var _i2 = 0, len = ElementPrototypeAriaPropertyNames.length; _i2 < len; _i2 += 1) {
493
+ var propName = ElementPrototypeAriaPropertyNames[_i2];
494
+ if (detect(propName, prototype)) {
495
+ patch$1(propName, prototype);
496
+ }
497
+ }
498
+ }
499
+ /** version: 2.33.0 */
500
+
501
+ /*
502
+ * Copyright (c) 2018, salesforce.com, inc.
503
+ * All rights reserved.
504
+ * SPDX-License-Identifier: MIT
505
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
506
+ */
507
+ if (!lwcRuntimeFlags.DISABLE_ARIA_REFLECTION_POLYFILL) {
508
+ // If DISABLE_ARIA_REFLECTION_POLYFILL is false, then we need to apply the ARIA reflection polyfill globally,
509
+ // i.e. to the global Element.prototype
510
+ applyAriaReflection();
511
+ }
518
512
 
519
513
  /*
520
514
  * Copyright (c) 2018, salesforce.com, inc.
@@ -582,7 +576,7 @@
582
576
  }
583
577
  var callbacks = nextTickCallbackQueue;
584
578
  nextTickCallbackQueue = []; // reset to a new queue
585
- for (var _i3 = 0, _len = callbacks.length; _i3 < _len; _i3 += 1) {
579
+ for (var _i3 = 0, len = callbacks.length; _i3 < len; _i3 += 1) {
586
580
  callbacks[_i3]();
587
581
  }
588
582
  }
@@ -700,7 +694,7 @@
700
694
  if (!isUndefined$1(reactiveRecord)) {
701
695
  var reactiveObservers = reactiveRecord[key];
702
696
  if (!isUndefined$1(reactiveObservers)) {
703
- for (var _i5 = 0, _len2 = reactiveObservers.length; _i5 < _len2; _i5 += 1) {
697
+ for (var _i5 = 0, len = reactiveObservers.length; _i5 < len; _i5 += 1) {
704
698
  var ro = reactiveObservers[_i5];
705
699
  ro.notify();
706
700
  }
@@ -1102,7 +1096,7 @@
1102
1096
  })
1103
1097
  };
1104
1098
  // Apply extra restriction related to DOM manipulation if the element is not a portal.
1105
- if (!options.isLight && !options.isPortal) {
1099
+ if (!options.isLight && options.isSynthetic && !options.isPortal) {
1106
1100
  var appendChild = elm.appendChild,
1107
1101
  insertBefore = elm.insertBefore,
1108
1102
  removeChild = elm.removeChild,
@@ -2473,6 +2467,17 @@
2473
2467
  lightningBasedDescriptors[propName] = createBridgeToElementDescriptor(propName, HTMLElementOriginalDescriptors[propName]);
2474
2468
  }
2475
2469
  defineProperties(LightningElement.prototype, lightningBasedDescriptors);
2470
+ function applyAriaReflectionToLightningElement() {
2471
+ // If ARIA reflection is not applied globally to Element.prototype, or if we are running server-side,
2472
+ // apply it to LightningElement.prototype.
2473
+ // This allows `this.aria*` property accessors to work from inside a component, and to reflect `aria-*` attrs.
2474
+ applyAriaReflection(LightningElement.prototype);
2475
+ }
2476
+ // The reason for this odd if/else branching is limitations in @lwc/features:
2477
+ // https://github.com/salesforce/lwc/blob/master/packages/%40lwc/features/README.md#only-works-with-if-statements
2478
+ if (lwcRuntimeFlags.DISABLE_ARIA_REFLECTION_POLYFILL) {
2479
+ applyAriaReflectionToLightningElement();
2480
+ }
2476
2481
  defineProperty(LightningElement, 'CustomElementConstructor', {
2477
2482
  get: function get() {
2478
2483
  // If required, a runtime-specific implementation must be defined.
@@ -2498,56 +2503,6 @@
2498
2503
  configurable: true
2499
2504
  };
2500
2505
  }
2501
- var AccessorReactiveObserver = /*#__PURE__*/function (_ReactiveObserver) {
2502
- _inherits(AccessorReactiveObserver, _ReactiveObserver);
2503
- var _super3 = _createSuper(AccessorReactiveObserver);
2504
- function AccessorReactiveObserver(vm, set) {
2505
- var _this2;
2506
- _classCallCheck(this, AccessorReactiveObserver);
2507
- _this2 = _super3.call(this, function () {
2508
- if (isFalse(_this2.debouncing)) {
2509
- _this2.debouncing = true;
2510
- addCallbackToNextTick(function () {
2511
- if (isTrue(_this2.debouncing)) {
2512
- var _assertThisInitialize = _assertThisInitialized(_this2),
2513
- value = _assertThisInitialize.value;
2514
- var dirtyStateBeforeSetterCall = vm.isDirty,
2515
- component = vm.component,
2516
- _idx = vm.idx;
2517
- set.call(component, value);
2518
- // de-bouncing after the call to the original setter to prevent
2519
- // infinity loop if the setter itself is mutating things that
2520
- // were accessed during the previous invocation.
2521
- _this2.debouncing = false;
2522
- if (isTrue(vm.isDirty) && isFalse(dirtyStateBeforeSetterCall) && _idx > 0) {
2523
- // immediate rehydration due to a setter driven mutation, otherwise
2524
- // the component will get rendered on the second tick, which it is not
2525
- // desirable.
2526
- rerenderVM(vm);
2527
- }
2528
- }
2529
- });
2530
- }
2531
- });
2532
- _this2.debouncing = false;
2533
- return _this2;
2534
- }
2535
- _createClass(AccessorReactiveObserver, [{
2536
- key: "reset",
2537
- value: function reset(value) {
2538
- _get2(_getPrototypeOf2(AccessorReactiveObserver.prototype), "reset", this).call(this);
2539
- this.debouncing = false;
2540
- if (arguments.length > 0) {
2541
- this.value = value;
2542
- }
2543
- }
2544
- }]);
2545
- return AccessorReactiveObserver;
2546
- }(ReactiveObserver);
2547
- function createAccessorReactiveObserver(vm, set) {
2548
- // On the server side, we don't need mutation tracking. Skipping it improves performance.
2549
- return new AccessorReactiveObserver(vm, set);
2550
- }
2551
2506
 
2552
2507
  /*
2553
2508
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2589,13 +2544,13 @@
2589
2544
  };
2590
2545
  }
2591
2546
  function createPublicAccessorDescriptor(key, descriptor) {
2592
- var _get3 = descriptor.get,
2547
+ var _get2 = descriptor.get,
2593
2548
  _set2 = descriptor.set,
2594
2549
  enumerable = descriptor.enumerable,
2595
2550
  configurable = descriptor.configurable;
2596
- if (!isFunction$1(_get3)) {
2551
+ if (!isFunction$1(_get2)) {
2597
2552
  if (process.env.NODE_ENV !== 'production') {
2598
- assert.invariant(isFunction$1(_get3), "Invalid compiler output for public accessor ".concat(toString$1(key), " decorated with @api"));
2553
+ assert.invariant(isFunction$1(_get2), "Invalid compiler output for public accessor ".concat(toString$1(key), " decorated with @api"));
2599
2554
  }
2600
2555
  throw new Error();
2601
2556
  }
@@ -2605,10 +2560,9 @@
2605
2560
  // Assert that the this value is an actual Component with an associated VM.
2606
2561
  getAssociatedVM(this);
2607
2562
  }
2608
- return _get3.call(this);
2563
+ return _get2.call(this);
2609
2564
  },
2610
2565
  set: function set(newValue) {
2611
- var _this3 = this;
2612
2566
  var vm = getAssociatedVM(this);
2613
2567
  if (process.env.NODE_ENV !== 'production') {
2614
2568
  var _vmBeingRendered4 = getVMBeingRendered();
@@ -2616,22 +2570,7 @@
2616
2570
  assert.invariant(!isUpdatingTemplate, "Updating the template of ".concat(_vmBeingRendered4, " has side effects on the state of ").concat(vm, ".").concat(toString$1(key)));
2617
2571
  }
2618
2572
  if (_set2) {
2619
- if (lwcRuntimeFlags.ENABLE_REACTIVE_SETTER) {
2620
- var ro = vm.oar[key];
2621
- if (isUndefined$1(ro)) {
2622
- ro = vm.oar[key] = createAccessorReactiveObserver(vm, _set2);
2623
- }
2624
- // every time we invoke this setter from outside (through this wrapper setter)
2625
- // we should reset the value and then debounce just in case there is a pending
2626
- // invocation the next tick that is not longer relevant since the value is changing
2627
- // from outside.
2628
- ro.reset(newValue);
2629
- ro.observe(function () {
2630
- _set2.call(_this3, newValue);
2631
- });
2632
- } else {
2633
- _set2.call(this, newValue);
2634
- }
2573
+ _set2.call(this, newValue);
2635
2574
  } else if (process.env.NODE_ENV !== 'production') {
2636
2575
  assert.fail("Invalid attempt to set a new value for property ".concat(toString$1(key), " of ").concat(vm, " that does not has a setter decorated with @api."));
2637
2576
  }
@@ -2970,13 +2909,6 @@
2970
2909
  }
2971
2910
  }
2972
2911
  }
2973
-
2974
- /*
2975
- * Copyright (c) 2018, salesforce.com, inc.
2976
- * All rights reserved.
2977
- * SPDX-License-Identifier: MIT
2978
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2979
- */
2980
2912
  var signedTemplateSet = new Set();
2981
2913
  function defaultEmptyTemplate() {
2982
2914
  return [];
@@ -2994,32 +2926,6 @@
2994
2926
  checkVersionMismatch(tpl, 'template');
2995
2927
  }
2996
2928
  signedTemplateSet.add(tpl);
2997
- // FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
2998
- // the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
2999
- // on top of stylesheetToken for anyone who is accessing the old internal API.
3000
- // Details: https://salesforce.quip.com/v1rmAFu2cKAr
3001
- defineProperty(tpl, 'stylesheetTokens', {
3002
- enumerable: true,
3003
- configurable: true,
3004
- get: function get() {
3005
- var stylesheetToken = this.stylesheetToken;
3006
- if (isUndefined$1(stylesheetToken)) {
3007
- return stylesheetToken;
3008
- }
3009
- // Shim for the old `stylesheetTokens` property
3010
- // See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
3011
- return {
3012
- hostAttribute: "".concat(stylesheetToken, "-host"),
3013
- shadowAttribute: stylesheetToken
3014
- };
3015
- },
3016
- set: function set(value) {
3017
- // If the value is null or some other exotic object, you would be broken anyway in the past
3018
- // because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
3019
- // However it may be undefined in newer versions of LWC, so we need to guard against that case.
3020
- this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
3021
- }
3022
- });
3023
2929
  // chaining this method as a way to wrap existing
3024
2930
  // assignment of templates easily, without too much transformation
3025
2931
  return tpl;
@@ -3120,10 +3026,10 @@
3120
3026
  if (isFunction$1(SuperClass)) {
3121
3027
  HTMLBridgeElement = /*#__PURE__*/function (_SuperClass) {
3122
3028
  _inherits(HTMLBridgeElement, _SuperClass);
3123
- var _super4 = _createSuper(HTMLBridgeElement);
3029
+ var _super3 = _createSuper(HTMLBridgeElement);
3124
3030
  function HTMLBridgeElement() {
3125
3031
  _classCallCheck(this, HTMLBridgeElement);
3126
- return _super4.apply(this, arguments);
3032
+ return _super3.apply(this, arguments);
3127
3033
  }
3128
3034
  return _createClass(HTMLBridgeElement);
3129
3035
  }(SuperClass);
@@ -3161,7 +3067,7 @@
3161
3067
  };
3162
3068
  }
3163
3069
  // expose public methods as props on the new Element Bridge
3164
- for (var _i10 = 0, _len3 = methods.length; _i10 < _len3; _i10 += 1) {
3070
+ for (var _i10 = 0, _len = methods.length; _i10 < _len; _i10 += 1) {
3165
3071
  var methodName = methods[_i10];
3166
3072
  descriptors[methodName] = {
3167
3073
  value: createMethodCaller(methodName),
@@ -3187,6 +3093,20 @@
3187
3093
  return HTMLBridgeElement;
3188
3094
  }
3189
3095
  var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
3096
+ {
3097
+ // This ARIA reflection only really makes sense in the browser. On the server, there is no `renderedCallback()`,
3098
+ // so you cannot do e.g. `this.template.querySelector('x-child').ariaBusy = 'true'`. So we don't need to expose
3099
+ // ARIA props outside the LightningElement
3100
+ if (lwcRuntimeFlags.DISABLE_ARIA_REFLECTION_POLYFILL) {
3101
+ // If ARIA reflection is not applied globally to Element.prototype, apply it to HTMLBridgeElement.prototype.
3102
+ // This allows `elm.aria*` property accessors to work from outside a component, and to reflect `aria-*` attrs.
3103
+ // This is especially important because the template compiler compiles aria-* attrs on components to aria* props
3104
+ //
3105
+ // Also note that we apply this to BaseBridgeElement.prototype to avoid excessively redefining property
3106
+ // accessors inside the HTMLBridgeElementFactory.
3107
+ applyAriaReflection(BaseBridgeElement.prototype);
3108
+ }
3109
+ }
3190
3110
  freeze(BaseBridgeElement);
3191
3111
  seal(BaseBridgeElement.prototype);
3192
3112
 
@@ -4521,11 +4441,13 @@
4521
4441
  function applyElementRestrictions(elm, vnode) {
4522
4442
  var _a, _b;
4523
4443
  if (process.env.NODE_ENV !== 'production') {
4444
+ var isSynthetic = vnode.owner.shadowMode === 1 /* ShadowMode.Synthetic */;
4524
4445
  var isPortal = vnode.type === 2 /* VNodeType.Element */ && ((_b = (_a = vnode.data.context) === null || _a === void 0 ? void 0 : _a.lwc) === null || _b === void 0 ? void 0 : _b.dom) === "manual" /* LwcDomMode.Manual */;
4525
4446
  var isLight = vnode.owner.renderMode === 0 /* RenderMode.Light */;
4526
4447
  patchElementWithRestrictions(elm, {
4527
4448
  isPortal: isPortal,
4528
- isLight: isLight
4449
+ isLight: isLight,
4450
+ isSynthetic: isSynthetic
4529
4451
  });
4530
4452
  }
4531
4453
  }
@@ -4929,7 +4851,7 @@
4929
4851
  // undefined is for root components, but root components cannot accept slotted content
4930
4852
  setVMBeingRendered(slotset.owner);
4931
4853
  try {
4932
- ArrayPush$1.apply(newChildren, vnode.factory(data.slotData));
4854
+ ArrayPush$1.call(newChildren, vnode.factory(data.slotData, data.key));
4933
4855
  } finally {
4934
4856
  setVMBeingRendered(vmBeingRenderedInception);
4935
4857
  }
@@ -5404,7 +5326,7 @@
5404
5326
  }
5405
5327
  function buildParseFragmentFn(createFragmentFn) {
5406
5328
  return function (strings) {
5407
- for (var _len4 = arguments.length, keys = new Array(_len4 > 1 ? _len4 - 1 : 0), _key3 = 1; _key3 < _len4; _key3++) {
5329
+ for (var _len2 = arguments.length, keys = new Array(_len2 > 1 ? _len2 - 1 : 0), _key3 = 1; _key3 < _len2; _key3++) {
5408
5330
  keys[_key3 - 1] = arguments[_key3];
5409
5331
  }
5410
5332
  var cache = create(null);
@@ -5815,14 +5737,9 @@
5815
5737
  function resetComponentStateWhenRemoved(vm) {
5816
5738
  var state = vm.state;
5817
5739
  if (state !== 2 /* VMState.disconnected */) {
5818
- var oar = vm.oar,
5819
- tro = vm.tro;
5740
+ var tro = vm.tro;
5820
5741
  // Making sure that any observing record will not trigger the rehydrated on this vm
5821
5742
  tro.reset();
5822
- // Making sure that any observing accessor record will not trigger the setter to be reinvoked
5823
- for (var key in oar) {
5824
- oar[key].reset();
5825
- }
5826
5743
  runDisconnectedCallback(vm);
5827
5744
  // Spec: https://dom.spec.whatwg.org/#concept-node-remove (step 14-15)
5828
5745
  runChildNodesDisconnectedCallback(vm);
@@ -5873,7 +5790,6 @@
5873
5790
  cmpSlots: {
5874
5791
  slotAssignments: create(null)
5875
5792
  },
5876
- oar: create(null),
5877
5793
  cmpTemplate: null,
5878
5794
  hydrated: Boolean(hydrated),
5879
5795
  renderMode: def.renderMode,
@@ -6265,17 +6181,17 @@
6265
6181
  var WireMetaMap = new Map();
6266
6182
  var WireContextRegistrationEvent = /*#__PURE__*/function (_CustomEvent) {
6267
6183
  _inherits(WireContextRegistrationEvent, _CustomEvent);
6268
- var _super5 = _createSuper(WireContextRegistrationEvent);
6184
+ var _super4 = _createSuper(WireContextRegistrationEvent);
6269
6185
  function WireContextRegistrationEvent(adapterToken, _ref4) {
6270
- var _this4;
6186
+ var _this2;
6271
6187
  var setNewContext = _ref4.setNewContext,
6272
6188
  setDisconnectedCallback = _ref4.setDisconnectedCallback;
6273
6189
  _classCallCheck(this, WireContextRegistrationEvent);
6274
- _this4 = _super5.call(this, adapterToken, {
6190
+ _this2 = _super4.call(this, adapterToken, {
6275
6191
  bubbles: true,
6276
6192
  composed: true
6277
6193
  });
6278
- defineProperties(_assertThisInitialized(_this4), {
6194
+ defineProperties(_assertThisInitialized(_this2), {
6279
6195
  setNewContext: {
6280
6196
  value: setNewContext
6281
6197
  },
@@ -6283,7 +6199,7 @@
6283
6199
  value: setDisconnectedCallback
6284
6200
  }
6285
6201
  });
6286
- return _this4;
6202
+ return _this2;
6287
6203
  }
6288
6204
  return _createClass(WireContextRegistrationEvent);
6289
6205
  }( /*#__PURE__*/_wrapNativeSuper(CustomEvent));
@@ -7034,6 +6950,10 @@
7034
6950
  var TEMPLATE_PROPS = ['slots', 'stylesheetToken', 'stylesheets', 'renderMode'];
7035
6951
  // Via https://www.npmjs.com/package/object-observer
7036
6952
  var ARRAY_MUTATION_METHODS = ['pop', 'push', 'shift', 'unshift', 'reverse', 'sort', 'fill', 'splice', 'copyWithin'];
6953
+ // Expandos that may be placed on a stylesheet factory function, and which are meaningful to LWC at runtime
6954
+ var STYLESHEET_FUNCTION_EXPANDOS = [
6955
+ // SEE `KEY__SCOPED_CSS` in @lwc/style-compiler
6956
+ '$scoped$'];
7037
6957
  function getOriginalArrayMethod(prop) {
7038
6958
  switch (prop) {
7039
6959
  case 'pop':
@@ -7057,7 +6977,7 @@
7057
6977
  }
7058
6978
  }
7059
6979
  var mutationWarningsSilenced = false;
7060
- // Warn if the user tries to mutate tmpl.stylesheets, e.g.:
6980
+ // Warn if the user tries to mutate a stylesheets array, e.g.:
7061
6981
  // `tmpl.stylesheets.push(someStylesheetFunction)`
7062
6982
  function warnOnArrayMutation(stylesheets) {
7063
6983
  // We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
@@ -7083,54 +7003,145 @@
7083
7003
  _iterator4.f();
7084
7004
  }
7085
7005
  }
7086
- // TODO [#2782]: eventually freezeTemplate() will _actually_ freeze the tmpl object. Today it
7087
- // just warns on mutation.
7006
+ // Warn if the user tries to mutate a stylesheet factory function, e.g.:
7007
+ // `stylesheet.$scoped$ = true`
7008
+ function warnOnStylesheetFunctionMutation(stylesheet) {
7009
+ // We could warn on other properties, but in practice only certain expandos are meaningful to LWC at runtime
7010
+ var _iterator5 = _createForOfIteratorHelper(STYLESHEET_FUNCTION_EXPANDOS),
7011
+ _step5;
7012
+ try {
7013
+ var _loop3 = function _loop3() {
7014
+ var prop = _step5.value;
7015
+ var value = stylesheet[prop];
7016
+ defineProperty(stylesheet, prop, {
7017
+ enumerable: true,
7018
+ configurable: true,
7019
+ get: function get() {
7020
+ return value;
7021
+ },
7022
+ set: function set(newValue) {
7023
+ logError("Dynamically setting the \"".concat(prop, "\" property on a stylesheet function ") + "is deprecated and may be removed in a future version of LWC.");
7024
+ value = newValue;
7025
+ }
7026
+ });
7027
+ };
7028
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
7029
+ _loop3();
7030
+ }
7031
+ } catch (err) {
7032
+ _iterator5.e(err);
7033
+ } finally {
7034
+ _iterator5.f();
7035
+ }
7036
+ }
7037
+ // Warn on either array or stylesheet (function) mutation, in a deeply-nested array
7038
+ function warnOnStylesheetsMutation(stylesheets) {
7039
+ traverseStylesheets(stylesheets, function (subStylesheets) {
7040
+ if (isArray$1(subStylesheets)) {
7041
+ warnOnArrayMutation(subStylesheets);
7042
+ } else {
7043
+ warnOnStylesheetFunctionMutation(subStylesheets);
7044
+ }
7045
+ });
7046
+ }
7047
+ // Deeply freeze the entire array (of arrays) of stylesheet factory functions
7048
+ function deepFreeze(stylesheets) {
7049
+ traverseStylesheets(stylesheets, function (subStylesheets) {
7050
+ freeze(subStylesheets);
7051
+ });
7052
+ }
7053
+ // Deep-traverse an array (of arrays) of stylesheet factory functions, and call the callback for every array/function
7054
+ function traverseStylesheets(stylesheets, callback) {
7055
+ callback(stylesheets);
7056
+ for (var _i33 = 0; _i33 < stylesheets.length; _i33++) {
7057
+ var stylesheet = stylesheets[_i33];
7058
+ if (isArray$1(stylesheet)) {
7059
+ traverseStylesheets(stylesheet, callback);
7060
+ } else {
7061
+ callback(stylesheet);
7062
+ }
7063
+ }
7064
+ }
7088
7065
  function freezeTemplate(tmpl) {
7089
- if (process.env.NODE_ENV !== 'production') {
7066
+ if (lwcRuntimeFlags.ENABLE_FROZEN_TEMPLATE) {
7067
+ // Deep freeze the template
7068
+ freeze(tmpl);
7090
7069
  if (!isUndefined$1(tmpl.stylesheets)) {
7091
- warnOnArrayMutation(tmpl.stylesheets);
7092
- }
7093
- var _iterator5 = _createForOfIteratorHelper(TEMPLATE_PROPS),
7094
- _step5;
7095
- try {
7096
- var _loop3 = function _loop3() {
7097
- var prop = _step5.value;
7098
- var value = tmpl[prop];
7099
- defineProperty(tmpl, prop, {
7100
- enumerable: true,
7101
- configurable: true,
7102
- get: function get() {
7103
- return value;
7104
- },
7105
- set: function set(newValue) {
7106
- if (!mutationWarningsSilenced) {
7107
- logError("Dynamically setting the \"".concat(prop, "\" property on a template function ") + "is deprecated and may be removed in a future version of LWC.");
7108
- }
7109
- value = newValue;
7110
- }
7111
- });
7112
- };
7113
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
7114
- _loop3();
7115
- }
7116
- } catch (err) {
7117
- _iterator5.e(err);
7118
- } finally {
7119
- _iterator5.f();
7070
+ deepFreeze(tmpl.stylesheets);
7120
7071
  }
7121
- var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
7072
+ } else {
7073
+ // TODO [#2782]: remove this flag and delete the legacy behavior
7074
+ // When ENABLE_FROZEN_TEMPLATE is false, then we shim stylesheetTokens on top of stylesheetToken for anyone who
7075
+ // is accessing the old internal API (backwards compat). Details: https://salesforce.quip.com/v1rmAFu2cKAr
7122
7076
  defineProperty(tmpl, 'stylesheetTokens', {
7123
7077
  enumerable: true,
7124
7078
  configurable: true,
7125
- get: originalDescriptor.get,
7079
+ get: function get() {
7080
+ var stylesheetToken = this.stylesheetToken;
7081
+ if (isUndefined$1(stylesheetToken)) {
7082
+ return stylesheetToken;
7083
+ }
7084
+ // Shim for the old `stylesheetTokens` property
7085
+ // See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
7086
+ return {
7087
+ hostAttribute: "".concat(stylesheetToken, "-host"),
7088
+ shadowAttribute: stylesheetToken
7089
+ };
7090
+ },
7126
7091
  set: function set(value) {
7127
- logError("Dynamically setting the \"stylesheetTokens\" property on a template function " + "is deprecated and may be removed in a future version of LWC.");
7128
- // Avoid logging twice (for both stylesheetToken and stylesheetTokens)
7129
- mutationWarningsSilenced = true;
7130
- originalDescriptor.set.call(this, value);
7131
- mutationWarningsSilenced = false;
7092
+ // If the value is null or some other exotic object, you would be broken anyway in the past
7093
+ // because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
7094
+ // However it may be undefined in newer versions of LWC, so we need to guard against that case.
7095
+ this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
7132
7096
  }
7133
7097
  });
7098
+ // When ENABLE_FROZEN_TEMPLATE is false, warn in dev mode whenever someone is mutating the template
7099
+ if (process.env.NODE_ENV !== 'production') {
7100
+ if (!isUndefined$1(tmpl.stylesheets)) {
7101
+ warnOnStylesheetsMutation(tmpl.stylesheets);
7102
+ }
7103
+ var _iterator6 = _createForOfIteratorHelper(TEMPLATE_PROPS),
7104
+ _step6;
7105
+ try {
7106
+ var _loop4 = function _loop4() {
7107
+ var prop = _step6.value;
7108
+ var value = tmpl[prop];
7109
+ defineProperty(tmpl, prop, {
7110
+ enumerable: true,
7111
+ configurable: true,
7112
+ get: function get() {
7113
+ return value;
7114
+ },
7115
+ set: function set(newValue) {
7116
+ if (!mutationWarningsSilenced) {
7117
+ logError("Dynamically setting the \"".concat(prop, "\" property on a template function ") + "is deprecated and may be removed in a future version of LWC.");
7118
+ }
7119
+ value = newValue;
7120
+ }
7121
+ });
7122
+ };
7123
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7124
+ _loop4();
7125
+ }
7126
+ } catch (err) {
7127
+ _iterator6.e(err);
7128
+ } finally {
7129
+ _iterator6.f();
7130
+ }
7131
+ var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
7132
+ defineProperty(tmpl, 'stylesheetTokens', {
7133
+ enumerable: true,
7134
+ configurable: true,
7135
+ get: originalDescriptor.get,
7136
+ set: function set(value) {
7137
+ logError("Dynamically setting the \"stylesheetTokens\" property on a template function " + "is deprecated and may be removed in a future version of LWC.");
7138
+ // Avoid logging twice (for both stylesheetToken and stylesheetTokens)
7139
+ mutationWarningsSilenced = true;
7140
+ originalDescriptor.set.call(this, value);
7141
+ mutationWarningsSilenced = false;
7142
+ }
7143
+ });
7144
+ }
7134
7145
  }
7135
7146
  }
7136
7147
 
@@ -7156,7 +7167,7 @@
7156
7167
  }
7157
7168
  return ctor;
7158
7169
  }
7159
- /* version: 2.32.0 */
7170
+ /* version: 2.33.0 */
7160
7171
 
7161
7172
  /*
7162
7173
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7393,10 +7404,10 @@
7393
7404
  // which are not equipped to be initialized that way.
7394
7405
  var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
7395
7406
  _inherits(clazz, _HTMLElementAlias);
7396
- var _super6 = _createSuper(clazz);
7407
+ var _super5 = _createSuper(clazz);
7397
7408
  function clazz() {
7398
7409
  _classCallCheck(this, clazz);
7399
- return _super6.apply(this, arguments);
7410
+ return _super5.apply(this, arguments);
7400
7411
  }
7401
7412
  return _createClass(clazz);
7402
7413
  }(HTMLElementAlias);
@@ -7442,24 +7453,24 @@
7442
7453
  // TODO [#2972]: this class should expose observedAttributes as necessary
7443
7454
  var UpgradableConstructor = /*#__PURE__*/function (_HTMLElement) {
7444
7455
  _inherits(UpgradableConstructor, _HTMLElement);
7445
- var _super7 = _createSuper(UpgradableConstructor);
7456
+ var _super6 = _createSuper(UpgradableConstructor);
7446
7457
  function UpgradableConstructor(upgradeCallback) {
7447
- var _this5;
7458
+ var _this3;
7448
7459
  _classCallCheck(this, UpgradableConstructor);
7449
- _this5 = _super7.call(this);
7460
+ _this3 = _super6.call(this);
7450
7461
  // If the element is not created using lwc.createElement(), e.g. `document.createElement('x-foo')`,
7451
7462
  // then elementBeingUpgraded will be false
7452
7463
  if (elementBeingUpgradedByLWC) {
7453
- upgradeCallback(_assertThisInitialized(_this5));
7464
+ upgradeCallback(_assertThisInitialized(_this3));
7454
7465
  } else if (hasConnectedCallback || hasDisconnectedCallback) {
7455
7466
  // If this element has connected or disconnected callbacks, then we need to keep track of
7456
7467
  // instances that were created outside LWC (i.e. not created by `lwc.createElement()`).
7457
7468
  // If the element has no connected or disconnected callbacks, then we don't need to track this.
7458
- elementsUpgradedOutsideLWC.add(_assertThisInitialized(_this5));
7469
+ elementsUpgradedOutsideLWC.add(_assertThisInitialized(_this3));
7459
7470
  // TODO [#2970]: LWC elements cannot be upgraded via new Ctor()
7460
7471
  // Do we want to support this? Throw an error? Currently for backwards compat it's a no-op.
7461
7472
  }
7462
- return _this5;
7473
+ return _this3;
7463
7474
  }
7464
7475
  return _createClass(UpgradableConstructor);
7465
7476
  }( /*#__PURE__*/_wrapNativeSuper(HTMLElement)); // Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead
@@ -7568,9 +7579,9 @@
7568
7579
  function createPivotingClass(tagName, registeredDefinition) {
7569
7580
  var PivotCtor = /*#__PURE__*/function (_NativeHTMLElement) {
7570
7581
  _inherits(PivotCtor, _NativeHTMLElement);
7571
- var _super8 = _createSuper(PivotCtor);
7582
+ var _super7 = _createSuper(PivotCtor);
7572
7583
  function PivotCtor(UserCtor) {
7573
- var _this6;
7584
+ var _this4;
7574
7585
  _classCallCheck(this, PivotCtor);
7575
7586
  // This constructor can only be invoked by:
7576
7587
  // a) the browser instantiating an element from parsing or via document.createElement.
@@ -7580,7 +7591,7 @@
7580
7591
  // If the caller signals via UserCtor that this is in fact a controlled
7581
7592
  // definition, we use that one, otherwise fallback to the global
7582
7593
  // internal registry.
7583
- _this6 = _super8.call(this);
7594
+ _this4 = _super7.call(this);
7584
7595
  var userCtorIsDefined = !isUndefined$1(UserCtor);
7585
7596
  if (userCtorIsDefined) {
7586
7597
  if (!isConstructor(UserCtor)) {
@@ -7592,15 +7603,15 @@
7592
7603
  }
7593
7604
  var definition = userCtorIsDefined ? getOrCreateDefinitionForConstructor(UserCtor) : globalDefinitionsByTag.get(tagName);
7594
7605
  if (!isUndefined$1(definition)) {
7595
- internalUpgrade(_assertThisInitialized(_this6), registeredDefinition, definition);
7606
+ internalUpgrade(_assertThisInitialized(_this4), registeredDefinition, definition);
7596
7607
  } else {
7597
7608
  // This is the case in which there is no global definition, and
7598
7609
  // it is not handled by LWC (otherwise it will have a valid UserCtor)
7599
7610
  // so we need to add it to the pending queue just in case it eventually
7600
7611
  // gets defined in the global registry.
7601
- pendingRegistryForElement.set(_assertThisInitialized(_this6), registeredDefinition);
7612
+ pendingRegistryForElement.set(_assertThisInitialized(_this4), registeredDefinition);
7602
7613
  }
7603
- return _this6;
7614
+ return _this4;
7604
7615
  }
7605
7616
  _createClass(PivotCtor, [{
7606
7617
  key: "connectedCallback",
@@ -7838,17 +7849,17 @@
7838
7849
  function flushPendingWhenDefinedCallbacks(tagName, ctor) {
7839
7850
  var resolvers = pendingWhenDefinedCallbacks.get(tagName);
7840
7851
  if (!isUndefined$1(resolvers)) {
7841
- var _iterator6 = _createForOfIteratorHelper(resolvers),
7842
- _step6;
7852
+ var _iterator7 = _createForOfIteratorHelper(resolvers),
7853
+ _step7;
7843
7854
  try {
7844
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7845
- var resolver = _step6.value;
7855
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7856
+ var resolver = _step7.value;
7846
7857
  resolver(ctor);
7847
7858
  }
7848
7859
  } catch (err) {
7849
- _iterator6.e(err);
7860
+ _iterator7.e(err);
7850
7861
  } finally {
7851
- _iterator6.f();
7862
+ _iterator7.f();
7852
7863
  }
7853
7864
  }
7854
7865
  pendingWhenDefinedCallbacks.delete(tagName);
@@ -7898,11 +7909,11 @@
7898
7909
  var awaiting = awaitingUpgrade.get(tagName);
7899
7910
  if (!isUndefined$1(awaiting)) {
7900
7911
  awaitingUpgrade.delete(tagName);
7901
- var _iterator7 = _createForOfIteratorHelper(awaiting),
7902
- _step7;
7912
+ var _iterator8 = _createForOfIteratorHelper(awaiting),
7913
+ _step8;
7903
7914
  try {
7904
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7905
- var element = _step7.value;
7915
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
7916
+ var element = _step8.value;
7906
7917
  var registeredDefinition = pendingRegistryForElement.get(element);
7907
7918
  // At this point, registeredDefinition should never be undefined because awaitingUpgrade
7908
7919
  // is only populated when we haven't run internalUpgrade yet, and we only populate
@@ -7914,9 +7925,9 @@
7914
7925
  }
7915
7926
  }
7916
7927
  } catch (err) {
7917
- _iterator7.e(err);
7928
+ _iterator8.e(err);
7918
7929
  } finally {
7919
- _iterator7.f();
7930
+ _iterator8.f();
7920
7931
  }
7921
7932
  }
7922
7933
  // If anyone called customElements.whenDefined() and is still waiting for a promise resolution, resolve now
@@ -8064,13 +8075,13 @@
8064
8075
  // TODO [#2972]: this class should expose observedAttributes as necessary
8065
8076
  return /*#__PURE__*/function (_HTMLElementToExtend) {
8066
8077
  _inherits(UserConstructor, _HTMLElementToExtend);
8067
- var _super9 = _createSuper(UserConstructor);
8078
+ var _super8 = _createSuper(UserConstructor);
8068
8079
  function UserConstructor() {
8069
- var _this7;
8080
+ var _this5;
8070
8081
  _classCallCheck(this, UserConstructor);
8071
- _this7 = _super9.call(this);
8072
- upgradeCallback(_assertThisInitialized(_this7));
8073
- return _this7;
8082
+ _this5 = _super8.call(this);
8083
+ upgradeCallback(_assertThisInitialized(_this5));
8084
+ return _this5;
8074
8085
  }
8075
8086
  // Note that there is no need to do the "avoid defining connectedCallback/disconnectedCallback" optimization
8076
8087
  // here, because in create-scoped-registry.ts, the registered class will always have these callbacks anyway.
@@ -8193,7 +8204,7 @@
8193
8204
  function isNull(obj) {
8194
8205
  return obj === null;
8195
8206
  }
8196
- /** version: 2.32.0 */
8207
+ /** version: 2.33.0 */
8197
8208
 
8198
8209
  /*
8199
8210
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8252,17 +8263,17 @@
8252
8263
  exports.createFragment = function (html) {
8253
8264
  var wrapperTags = topLevelWrappingMap[getTagName(html)];
8254
8265
  if (!isUndefined(wrapperTags)) {
8255
- var _iterator8 = _createForOfIteratorHelper(wrapperTags),
8256
- _step8;
8266
+ var _iterator9 = _createForOfIteratorHelper(wrapperTags),
8267
+ _step9;
8257
8268
  try {
8258
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
8259
- var wrapperTag = _step8.value;
8269
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
8270
+ var wrapperTag = _step9.value;
8260
8271
  html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
8261
8272
  }
8262
8273
  } catch (err) {
8263
- _iterator8.e(err);
8274
+ _iterator9.e(err);
8264
8275
  } finally {
8265
- _iterator8.f();
8276
+ _iterator9.f();
8266
8277
  }
8267
8278
  }
8268
8279
  // For IE11, the document title must not be undefined, but it can be an empty string
@@ -8271,7 +8282,7 @@
8271
8282
  doc.body.innerHTML = html;
8272
8283
  var content = doc.body;
8273
8284
  if (!isUndefined(wrapperTags)) {
8274
- for (var _i33 = 0; _i33 < wrapperTags.length; _i33++) {
8285
+ for (var _i34 = 0; _i34 < wrapperTags.length; _i34++) {
8275
8286
  content = content.firstChild;
8276
8287
  }
8277
8288
  }
@@ -8464,8 +8475,8 @@
8464
8475
  tagName: element.tagName.toLowerCase(),
8465
8476
  hydrated: true
8466
8477
  });
8467
- for (var _i34 = 0, _Object$entries2 = Object.entries(props); _i34 < _Object$entries2.length; _i34++) {
8468
- var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i34], 2),
8478
+ for (var _i35 = 0, _Object$entries2 = Object.entries(props); _i35 < _Object$entries2.length; _i35++) {
8479
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i35], 2),
8469
8480
  key = _Object$entries2$_i[0],
8470
8481
  value = _Object$entries2$_i[1];
8471
8482
  element[key] = value;
@@ -8542,23 +8553,23 @@
8542
8553
  var _attributeChangedCallback = HtmlPrototype.prototype.attributeChangedCallback;
8543
8554
  return _a = /*#__PURE__*/function (_HTMLElement2) {
8544
8555
  _inherits(_a, _HTMLElement2);
8545
- var _super10 = _createSuper(_a);
8556
+ var _super9 = _createSuper(_a);
8546
8557
  function _a() {
8547
- var _this8;
8558
+ var _this6;
8548
8559
  _classCallCheck(this, _a);
8549
- _this8 = _super10.call(this);
8550
- if (_this8.isConnected) {
8560
+ _this6 = _super9.call(this);
8561
+ if (_this6.isConnected) {
8551
8562
  // this if block is hit when there's already an un-upgraded element in the DOM with the same tag name.
8552
- hydrateComponent(_assertThisInitialized(_this8), Ctor, {});
8553
- hydratedCustomElements.add(_assertThisInitialized(_this8));
8563
+ hydrateComponent(_assertThisInitialized(_this6), Ctor, {});
8564
+ hydratedCustomElements.add(_assertThisInitialized(_this6));
8554
8565
  } else {
8555
- createVM(_assertThisInitialized(_this8), Ctor, renderer, {
8566
+ createVM(_assertThisInitialized(_this6), Ctor, renderer, {
8556
8567
  mode: 'open',
8557
8568
  owner: null,
8558
- tagName: _this8.tagName
8569
+ tagName: _this6.tagName
8559
8570
  });
8560
8571
  }
8561
- return _this8;
8572
+ return _this6;
8562
8573
  }
8563
8574
  _createClass(_a, [{
8564
8575
  key: "connectedCallback",
@@ -8759,7 +8770,7 @@
8759
8770
  });
8760
8771
  freeze(LightningElement);
8761
8772
  seal(LightningElement.prototype);
8762
- /* version: 2.32.0 */
8773
+ /* version: 2.33.0 */
8763
8774
 
8764
8775
  exports.LightningElement = LightningElement;
8765
8776
  exports.__unstable__ProfilerControl = profilerControl;