lwc 2.5.2 → 2.5.6

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 +181 -101
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +183 -101
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +163 -82
  5. package/dist/engine-dom/iife/es5/engine-dom.js +211 -108
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +189 -87
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +184 -102
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +164 -83
  11. package/dist/engine-dom/umd/es5/engine-dom.js +212 -109
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +190 -88
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +174 -99
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
  16. package/dist/engine-server/esm/es2017/engine-server.js +173 -100
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +46 -40
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +47 -41
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +46 -40
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +47 -41
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +46 -40
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +48 -42
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +47 -41
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +48 -42
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +47 -41
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +3 -3
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +3 -3
  33. package/dist/wire-service/iife/es5/wire-service.js +3 -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 +3 -3
  36. package/dist/wire-service/umd/es2017/wire-service.js +4 -4
  37. package/dist/wire-service/umd/es2017/wire-service_debug.js +4 -4
  38. package/dist/wire-service/umd/es5/wire-service.js +4 -4
  39. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  40. package/dist/wire-service/umd/es5/wire-service_debug.js +4 -4
  41. package/package.json +8 -8
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.LWC = {}));
5
- }(this, (function (exports) { 'use strict';
5
+ })(this, (function (exports) { 'use strict';
6
6
 
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
 
@@ -350,7 +350,7 @@
350
350
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
351
351
  return attributeName;
352
352
  }
353
- /** version: 2.5.2 */
353
+ /** version: 2.5.6 */
354
354
 
355
355
  /*
356
356
  * Copyright (c) 2018, salesforce.com, inc.
@@ -458,6 +458,7 @@
458
458
  ENABLE_HMR: null,
459
459
  ENABLE_INNER_OUTER_TEXT_PATCH: null,
460
460
  ENABLE_ELEMENT_PATCH: null,
461
+ ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST: null,
461
462
  ENABLE_NODE_LIST_PATCH: null,
462
463
  ENABLE_HTML_COLLECTIONS_PATCH: null,
463
464
  ENABLE_NODE_PATCH: null,
@@ -529,7 +530,7 @@
529
530
  setFeatureFlag(name, value);
530
531
  }
531
532
  }
532
- /** version: 2.5.2 */
533
+ /** version: 2.5.6 */
533
534
 
534
535
  /* proxy-compat-disable */
535
536
 
@@ -2824,9 +2825,9 @@
2824
2825
  }
2825
2826
  }
2826
2827
 
2827
- function warnIfInvokedDuringConstruction(vm, methodName) {
2828
+ function warnIfInvokedDuringConstruction(vm, methodOrPropName) {
2828
2829
  if (isBeingConstructed(vm)) {
2829
- logError("this.".concat(methodName, "() should not be called during the construction of the custom element for ").concat(getComponentTag(vm), " because the element is not yet in the DOM or has no children yet."));
2830
+ logError("this.".concat(methodOrPropName, " should not be called during the construction of the custom element for ").concat(getComponentTag(vm), " because the element is not yet in the DOM or has no children yet."));
2830
2831
  }
2831
2832
  } // @ts-ignore
2832
2833
 
@@ -2941,55 +2942,11 @@
2941
2942
  getBoundingClientRect = vm.renderer.getBoundingClientRect;
2942
2943
 
2943
2944
  if (process.env.NODE_ENV !== 'production') {
2944
- warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect');
2945
+ warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
2945
2946
  }
2946
2947
 
2947
2948
  return getBoundingClientRect(elm);
2948
2949
  },
2949
- querySelector: function querySelector(selectors) {
2950
- var vm = getAssociatedVM(this);
2951
- var elm = vm.elm,
2952
- querySelector = vm.renderer.querySelector;
2953
-
2954
- if (process.env.NODE_ENV !== 'production') {
2955
- warnIfInvokedDuringConstruction(vm, 'querySelector');
2956
- }
2957
-
2958
- return querySelector(elm, selectors);
2959
- },
2960
- querySelectorAll: function querySelectorAll(selectors) {
2961
- var vm = getAssociatedVM(this);
2962
- var elm = vm.elm,
2963
- querySelectorAll = vm.renderer.querySelectorAll;
2964
-
2965
- if (process.env.NODE_ENV !== 'production') {
2966
- warnIfInvokedDuringConstruction(vm, 'querySelectorAll');
2967
- }
2968
-
2969
- return querySelectorAll(elm, selectors);
2970
- },
2971
- getElementsByTagName: function getElementsByTagName(tagNameOrWildCard) {
2972
- var vm = getAssociatedVM(this);
2973
- var elm = vm.elm,
2974
- getElementsByTagName = vm.renderer.getElementsByTagName;
2975
-
2976
- if (process.env.NODE_ENV !== 'production') {
2977
- warnIfInvokedDuringConstruction(vm, 'getElementsByTagName');
2978
- }
2979
-
2980
- return getElementsByTagName(elm, tagNameOrWildCard);
2981
- },
2982
- getElementsByClassName: function getElementsByClassName(names) {
2983
- var vm = getAssociatedVM(this);
2984
- var elm = vm.elm,
2985
- getElementsByClassName = vm.renderer.getElementsByClassName;
2986
-
2987
- if (process.env.NODE_ENV !== 'production') {
2988
- warnIfInvokedDuringConstruction(vm, 'getElementsByClassName');
2989
- }
2990
-
2991
- return getElementsByClassName(elm, names);
2992
- },
2993
2950
 
2994
2951
  get isConnected() {
2995
2952
  var _getAssociatedVM8 = getAssociatedVM(this),
@@ -3042,6 +2999,57 @@
3042
2999
  return "[object ".concat(vm.def.name, "]");
3043
3000
  }
3044
3001
  };
3002
+ var queryAndChildGetterDescriptors = create(null);
3003
+ var childGetters = [['children', 'getChildren'], ['childNodes', 'getChildNodes'], ['firstChild', 'getFirstChild'], ['firstElementChild', 'getFirstElementChild'], ['lastChild', 'getLastChild'], ['lastElementChild', 'getLastElementChild']]; // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
3004
+
3005
+ var _loop = function _loop() {
3006
+ var _childGetters$_i = _slicedToArray(_childGetters[_i9], 2),
3007
+ elementProp = _childGetters$_i[0],
3008
+ rendererMethod = _childGetters$_i[1];
3009
+
3010
+ queryAndChildGetterDescriptors[elementProp] = {
3011
+ get: function get() {
3012
+ var vm = getAssociatedVM(this);
3013
+ var elm = vm.elm,
3014
+ renderer = vm.renderer;
3015
+
3016
+ if (process.env.NODE_ENV !== 'production') {
3017
+ warnIfInvokedDuringConstruction(vm, elementProp);
3018
+ }
3019
+
3020
+ return renderer[rendererMethod](elm);
3021
+ }
3022
+ };
3023
+ };
3024
+
3025
+ for (var _i9 = 0, _childGetters = childGetters; _i9 < _childGetters.length; _i9++) {
3026
+ _loop();
3027
+ }
3028
+
3029
+ var queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll']; // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
3030
+
3031
+ var _loop2 = function _loop2() {
3032
+ var queryMethod = _queryMethods[_i10];
3033
+ queryAndChildGetterDescriptors[queryMethod] = {
3034
+ value: function value(arg) {
3035
+ var vm = getAssociatedVM(this);
3036
+ var elm = vm.elm,
3037
+ renderer = vm.renderer;
3038
+
3039
+ if (process.env.NODE_ENV !== 'production') {
3040
+ warnIfInvokedDuringConstruction(vm, "".concat(queryMethod, "()"));
3041
+ }
3042
+
3043
+ return renderer[queryMethod](elm, arg);
3044
+ }
3045
+ };
3046
+ };
3047
+
3048
+ for (var _i10 = 0, _queryMethods = queryMethods; _i10 < _queryMethods.length; _i10++) {
3049
+ _loop2();
3050
+ }
3051
+
3052
+ defineProperties(LightningElement.prototype, queryAndChildGetterDescriptors);
3045
3053
  var lightningBasedDescriptors = create(null);
3046
3054
 
3047
3055
  for (var _propName in HTMLElementOriginalDescriptors) {
@@ -3560,8 +3568,8 @@
3560
3568
  }
3561
3569
 
3562
3570
  if (!isUndefined$1(fields)) {
3563
- for (var _i9 = 0, n = fields.length; _i9 < n; _i9++) {
3564
- var _fieldName2 = fields[_i9];
3571
+ for (var _i11 = 0, n = fields.length; _i11 < n; _i11++) {
3572
+ var _fieldName2 = fields[_i11];
3565
3573
  descriptor = getOwnPropertyDescriptor$1(proto, _fieldName2);
3566
3574
 
3567
3575
  if (process.env.NODE_ENV !== 'production') {
@@ -3634,15 +3642,14 @@
3634
3642
  return tpl;
3635
3643
  }
3636
3644
  /**
3637
- * EXPERIMENTAL: This function acts like a hook for Lightning Locker
3638
- * Service and other similar libraries to sanitize vulnerable attributes.
3639
- * This API is subject to change or being removed.
3645
+ * EXPERIMENTAL: This function acts like a hook for Lightning Locker Service and other similar
3646
+ * libraries to sanitize vulnerable attributes.
3640
3647
  */
3641
3648
 
3642
3649
 
3643
3650
  function sanitizeAttribute(tagName, namespaceUri, attrName, attrValue) {
3644
- // locker-service patches this function during runtime to sanitize vulnerable attributes.
3645
- // when ran off-core this function becomes a noop and returns the user authored value.
3651
+ // locker-service patches this function during runtime to sanitize vulnerable attributes. When
3652
+ // ran off-core this function becomes a noop and returns the user authored value.
3646
3653
  return attrValue;
3647
3654
  }
3648
3655
  /*
@@ -3783,8 +3790,8 @@
3783
3790
  superObservedAttributes = _SuperClass$observedA === void 0 ? [] : _SuperClass$observedA;
3784
3791
  var descriptors = create(null); // expose getters and setters for each public props on the new Element Bridge
3785
3792
 
3786
- for (var _i10 = 0, _len3 = props.length; _i10 < _len3; _i10 += 1) {
3787
- var _propName2 = props[_i10];
3793
+ for (var _i12 = 0, _len3 = props.length; _i12 < _len3; _i12 += 1) {
3794
+ var _propName2 = props[_i12];
3788
3795
  attributeToPropMap[htmlPropertyToAttribute(_propName2)] = _propName2;
3789
3796
  descriptors[_propName2] = {
3790
3797
  get: createGetter(_propName2),
@@ -3795,8 +3802,8 @@
3795
3802
  } // expose public methods as props on the new Element Bridge
3796
3803
 
3797
3804
 
3798
- for (var _i11 = 0, _len4 = methods.length; _i11 < _len4; _i11 += 1) {
3799
- var methodName = methods[_i11];
3805
+ for (var _i13 = 0, _len4 = methods.length; _i13 < _len4; _i13 += 1) {
3806
+ var methodName = methods[_i13];
3800
3807
  descriptors[methodName] = {
3801
3808
  value: createMethodCaller(methodName),
3802
3809
  writable: true,
@@ -4744,6 +4751,38 @@
4744
4751
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4745
4752
  */
4746
4753
 
4754
+ /**
4755
+ * EXPERIMENTAL: This function acts like a hook for Lightning Locker Service and other similar
4756
+ * libraries to sanitize HTML content. This hook process the content passed via the template to
4757
+ * lwc:inner-html directive.
4758
+ * It is meant to be overridden with setSanitizeHtmlContentHook
4759
+ */
4760
+
4761
+
4762
+ var sanitizeHtmlContentHook = function sanitizeHtmlContentHook() {
4763
+ // locker-service patches this function during runtime to sanitize HTML content.
4764
+ throw new Error('sanitizeHtmlContent hook must be implemented.');
4765
+ };
4766
+ /**
4767
+ * Sets the sanitizeHtmlContentHook.
4768
+ *
4769
+ * @param newHookImpl
4770
+ * @returns oldHookImplementation.
4771
+ */
4772
+
4773
+
4774
+ function setSanitizeHtmlContentHook(newHookImpl) {
4775
+ var currentHook = sanitizeHtmlContentHook;
4776
+ sanitizeHtmlContentHook = newHookImpl;
4777
+ return currentHook;
4778
+ }
4779
+ /*
4780
+ * Copyright (c) 2018, salesforce.com, inc.
4781
+ * All rights reserved.
4782
+ * SPDX-License-Identifier: MIT
4783
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
4784
+ */
4785
+
4747
4786
 
4748
4787
  var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
4749
4788
  var SymbolIterator = Symbol.iterator;
@@ -5093,7 +5132,7 @@
5093
5132
  next = iterator.next();
5094
5133
  last = next.done; // template factory logic based on the previous collected value
5095
5134
 
5096
- var vnode = factory(value, j, j === 0, last);
5135
+ var vnode = factory(value, j, j === 0, last === true);
5097
5136
 
5098
5137
  if (isArray$1(vnode)) {
5099
5138
  ArrayPush$1.apply(list, vnode);
@@ -5355,25 +5394,29 @@
5355
5394
 
5356
5395
  markAsDynamicChildren(vnodes);
5357
5396
  return vnodes;
5397
+ } // [s]anitize [h]tml [c]ontent
5398
+
5399
+
5400
+ function shc(content) {
5401
+ return sanitizeHtmlContentHook(content);
5358
5402
  }
5359
5403
 
5360
- var api = /*#__PURE__*/Object.freeze({
5361
- __proto__: null,
5362
- h: h,
5363
- ti: ti,
5404
+ var api = freeze({
5364
5405
  s: s,
5406
+ h: h,
5365
5407
  c: c,
5366
5408
  i: i,
5367
5409
  f: f,
5368
5410
  t: t,
5369
- co: co,
5370
5411
  d: d,
5371
5412
  b: b,
5372
5413
  k: k,
5414
+ co: co,
5415
+ dc: dc,
5416
+ ti: ti,
5373
5417
  gid: gid,
5374
5418
  fid: fid,
5375
- dc: dc,
5376
- sc: sc
5419
+ shc: shc
5377
5420
  });
5378
5421
  /*
5379
5422
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5387,12 +5430,12 @@
5387
5430
  }
5388
5431
 
5389
5432
  function createInlineStyleVNode(content) {
5390
- return h('style', {
5433
+ return api.h('style', {
5391
5434
  key: 'style',
5392
5435
  attrs: {
5393
5436
  type: 'text/css'
5394
5437
  }
5395
- }, [t(content)]);
5438
+ }, [api.t(content)]);
5396
5439
  }
5397
5440
 
5398
5441
  function updateStylesheetToken(vm, template) {
@@ -5453,8 +5496,8 @@
5453
5496
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5454
5497
  var content = [];
5455
5498
 
5456
- for (var _i12 = 0; _i12 < stylesheets.length; _i12++) {
5457
- var stylesheet = stylesheets[_i12];
5499
+ for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
5500
+ var stylesheet = stylesheets[_i14];
5458
5501
 
5459
5502
  if (isArray$1(stylesheet)) {
5460
5503
  ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
@@ -5530,8 +5573,8 @@
5530
5573
  && shadowMode === 1
5531
5574
  /* Synthetic */
5532
5575
  ) {
5533
- for (var _i13 = 0; _i13 < stylesheets.length; _i13++) {
5534
- renderer.insertGlobalStylesheet(stylesheets[_i13]);
5576
+ for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
5577
+ renderer.insertGlobalStylesheet(stylesheets[_i15]);
5535
5578
  }
5536
5579
  } else if (renderer.ssr) {
5537
5580
  // native shadow or light DOM, SSR
@@ -5542,12 +5585,12 @@
5542
5585
  var root = getNearestNativeShadowComponent(vm);
5543
5586
  var isGlobal = isNull(root);
5544
5587
 
5545
- for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
5588
+ for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
5546
5589
  if (isGlobal) {
5547
- renderer.insertGlobalStylesheet(stylesheets[_i14]);
5590
+ renderer.insertGlobalStylesheet(stylesheets[_i16]);
5548
5591
  } else {
5549
5592
  // local level
5550
- renderer.insertStylesheet(stylesheets[_i14], root.cmpRoot);
5593
+ renderer.insertStylesheet(stylesheets[_i16], root.cmpRoot);
5551
5594
  }
5552
5595
  }
5553
5596
  }
@@ -5824,8 +5867,8 @@
5824
5867
  var stylesheets = template.stylesheets;
5825
5868
 
5826
5869
  if (!isUndefined$1(stylesheets)) {
5827
- for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
5828
- if (isTrue(stylesheets[_i15][KEY__SCOPED_CSS])) {
5870
+ for (var _i17 = 0; _i17 < stylesheets.length; _i17++) {
5871
+ if (isTrue(stylesheets[_i17][KEY__SCOPED_CSS])) {
5829
5872
  return true;
5830
5873
  }
5831
5874
  }
@@ -6055,8 +6098,8 @@
6055
6098
  assert.isTrue(isObject(service), "Invalid service declaration, ".concat(service, ": service must be an object"));
6056
6099
  }
6057
6100
 
6058
- for (var _i16 = 0; _i16 < hooks.length; ++_i16) {
6059
- var hookName = hooks[_i16];
6101
+ for (var _i18 = 0; _i18 < hooks.length; ++_i18) {
6102
+ var hookName = hooks[_i18];
6060
6103
 
6061
6104
  if (hookName in service) {
6062
6105
  var l = Services[hookName];
@@ -6079,8 +6122,8 @@
6079
6122
  def = vm.def,
6080
6123
  context = vm.context;
6081
6124
 
6082
- for (var _i17 = 0, _len6 = cbs.length; _i17 < _len6; ++_i17) {
6083
- cbs[_i17].call(undefined, component, {}, def, context);
6125
+ for (var _i19 = 0, _len6 = cbs.length; _i19 < _len6; ++_i19) {
6126
+ cbs[_i19].call(undefined, component, {}, def, context);
6084
6127
  }
6085
6128
  }
6086
6129
  /*
@@ -6248,6 +6291,12 @@
6248
6291
  vm.toString = function () {
6249
6292
  return "[object:vm ".concat(def.name, " (").concat(vm.idx, ")]");
6250
6293
  };
6294
+
6295
+ if (runtimeFlags.ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST) {
6296
+ vm.shadowMode = 0
6297
+ /* Native */
6298
+ ;
6299
+ }
6251
6300
  } // Create component instance associated to the vm and the element.
6252
6301
 
6253
6302
 
@@ -6437,19 +6486,19 @@
6437
6486
  });
6438
6487
  rehydrateQueue = []; // reset to a new queue
6439
6488
 
6440
- for (var _i18 = 0, _len7 = vms.length; _i18 < _len7; _i18 += 1) {
6441
- var vm = vms[_i18];
6489
+ for (var _i20 = 0, _len7 = vms.length; _i20 < _len7; _i20 += 1) {
6490
+ var vm = vms[_i20];
6442
6491
 
6443
6492
  try {
6444
6493
  rehydrate(vm);
6445
6494
  } catch (error) {
6446
- if (_i18 + 1 < _len7) {
6495
+ if (_i20 + 1 < _len7) {
6447
6496
  // pieces of the queue are still pending to be rehydrated, those should have priority
6448
6497
  if (rehydrateQueue.length === 0) {
6449
6498
  addCallbackToNextTick(flushRehydrationQueue);
6450
6499
  }
6451
6500
 
6452
- ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i18 + 1));
6501
+ ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i20 + 1));
6453
6502
  } // we need to end the measure before throwing.
6454
6503
 
6455
6504
 
@@ -6553,8 +6602,8 @@
6553
6602
  var vCustomElementCollection = vm.velements; // Reporting disconnection for every child in inverse order since they are
6554
6603
  // inserted in reserved order.
6555
6604
 
6556
- for (var _i19 = vCustomElementCollection.length - 1; _i19 >= 0; _i19 -= 1) {
6557
- var elm = vCustomElementCollection[_i19].elm; // There are two cases where the element could be undefined:
6605
+ for (var _i21 = vCustomElementCollection.length - 1; _i21 >= 0; _i21 -= 1) {
6606
+ var elm = vCustomElementCollection[_i21].elm; // There are two cases where the element could be undefined:
6558
6607
  // * when there is an error during the construction phase, and an error
6559
6608
  // boundary picks it, there is a possibility that the VCustomElement
6560
6609
  // is not properly initialized, and therefore is should be ignored.
@@ -6588,8 +6637,8 @@
6588
6637
 
6589
6638
 
6590
6639
  function recursivelyDisconnectChildren(vnodes) {
6591
- for (var _i20 = 0, _len8 = vnodes.length; _i20 < _len8; _i20 += 1) {
6592
- var vnode = vnodes[_i20];
6640
+ for (var _i22 = 0, _len8 = vnodes.length; _i22 < _len8; _i22 += 1) {
6641
+ var vnode = vnodes[_i22];
6593
6642
 
6594
6643
  if (!isNull(vnode) && isArray$1(vnode.children) && !isUndefined$1(vnode.elm)) {
6595
6644
  // vnode is a VElement with children
@@ -6613,8 +6662,8 @@
6613
6662
  renderer = vm.renderer;
6614
6663
  var rootNode = getRenderRoot(vm);
6615
6664
 
6616
- for (var _i21 = 0, _len9 = children.length; _i21 < _len9; _i21++) {
6617
- var child = children[_i21];
6665
+ for (var _i23 = 0, _len9 = children.length; _i23 < _len9; _i23++) {
6666
+ var child = children[_i23];
6618
6667
 
6619
6668
  if (!isNull(child) && !isUndefined$1(child.elm)) {
6620
6669
  renderer.remove(child.elm, rootNode);
@@ -6659,8 +6708,8 @@
6659
6708
  var oldSlots = vm.cmpSlots;
6660
6709
  var cmpSlots = vm.cmpSlots = create(null);
6661
6710
 
6662
- for (var _i22 = 0, _len10 = children.length; _i22 < _len10; _i22 += 1) {
6663
- var vnode = children[_i22];
6711
+ for (var _i24 = 0, _len10 = children.length; _i24 < _len10; _i24 += 1) {
6712
+ var vnode = children[_i24];
6664
6713
 
6665
6714
  if (isNull(vnode)) {
6666
6715
  continue;
@@ -6690,8 +6739,8 @@
6690
6739
  return;
6691
6740
  }
6692
6741
 
6693
- for (var _i23 = 0, _len11 = oldKeys.length; _i23 < _len11; _i23 += 1) {
6694
- var key = oldKeys[_i23];
6742
+ for (var _i25 = 0, _len11 = oldKeys.length; _i25 < _len11; _i25 += 1) {
6743
+ var key = oldKeys[_i25];
6695
6744
 
6696
6745
  if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
6697
6746
  markComponentAsDirty(vm);
@@ -7054,8 +7103,8 @@
7054
7103
  function connectWireAdapters(vm) {
7055
7104
  var wiredConnecting = vm.context.wiredConnecting;
7056
7105
 
7057
- for (var _i24 = 0, _len12 = wiredConnecting.length; _i24 < _len12; _i24 += 1) {
7058
- wiredConnecting[_i24]();
7106
+ for (var _i26 = 0, _len12 = wiredConnecting.length; _i26 < _len12; _i26 += 1) {
7107
+ wiredConnecting[_i26]();
7059
7108
  }
7060
7109
  }
7061
7110
 
@@ -7063,8 +7112,8 @@
7063
7112
  var wiredDisconnecting = vm.context.wiredDisconnecting;
7064
7113
  runWithBoundaryProtection(vm, vm, noop, function () {
7065
7114
  // job
7066
- for (var _i25 = 0, _len13 = wiredDisconnecting.length; _i25 < _len13; _i25 += 1) {
7067
- wiredDisconnecting[_i25]();
7115
+ for (var _i27 = 0, _len13 = wiredDisconnecting.length; _i27 < _len13; _i27 += 1) {
7116
+ wiredDisconnecting[_i27]();
7068
7117
  }
7069
7118
  }, noop);
7070
7119
  }
@@ -7139,7 +7188,38 @@
7139
7188
 
7140
7189
  return reactiveMembrane.getReadOnlyProxy(obj);
7141
7190
  }
7142
- /* version: 2.5.2 */
7191
+ /*
7192
+ * Copyright (c) 2018, salesforce.com, inc.
7193
+ * All rights reserved.
7194
+ * SPDX-License-Identifier: MIT
7195
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
7196
+ */
7197
+
7198
+
7199
+ var hooksAreSet = false;
7200
+
7201
+ function overrideHooks(hooks) {
7202
+ var oldHooks = {};
7203
+
7204
+ if (!isUndefined$1(hooks.sanitizeHtmlContent)) {
7205
+ oldHooks.sanitizeHtmlContent = setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7206
+ }
7207
+
7208
+ return oldHooks;
7209
+ }
7210
+
7211
+ function setHooks(hooks) {
7212
+ assert.isFalse(hooksAreSet, 'Hooks are already overridden, only one definition is allowed.');
7213
+ overrideHooks(hooks);
7214
+ hooksAreSet = true;
7215
+ }
7216
+
7217
+ function setHooksForTest(hooks) {
7218
+ if (process.env.NODE_ENV !== 'production') {
7219
+ return overrideHooks(hooks);
7220
+ }
7221
+ }
7222
+ /* version: 2.5.6 */
7143
7223
 
7144
7224
  /*
7145
7225
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7154,15 +7234,18 @@
7154
7234
  if (process.env.NODE_ENV === 'development') {
7155
7235
  // @ts-ignore
7156
7236
  window.__lwcResetGlobalStylesheets = function () {
7157
- for (var _i26 = 0, _Object$keys = Object.keys(globalStylesheets); _i26 < _Object$keys.length; _i26++) {
7158
- var key = _Object$keys[_i26];
7237
+ for (var _i28 = 0, _Object$keys = Object.keys(globalStylesheets); _i28 < _Object$keys.length; _i28++) {
7238
+ var key = _Object$keys[_i28];
7159
7239
  delete globalStylesheets[key];
7160
7240
  }
7161
7241
  };
7162
7242
  }
7163
7243
 
7164
- var globalStylesheetsParentElement = document.head || document.body || document;
7165
- var supportsConstructableStyleSheets = isFunction$1(CSSStyleSheet.prototype.replaceSync);
7244
+ var globalStylesheetsParentElement = document.head || document.body || document; // This check for constructable stylesheets is similar to Fast's:
7245
+ // https://github.com/microsoft/fast/blob/d49d1ec/packages/web-components/fast-element/src/dom.ts#L51-L53
7246
+ // See also: https://github.com/whatwg/webidl/issues/1027#issuecomment-934510070
7247
+
7248
+ var supportsConstructableStyleSheets = isFunction$1(CSSStyleSheet.prototype.replaceSync) && isArray$1(document.adoptedStyleSheets);
7166
7249
  var styleElements = create(null);
7167
7250
  var styleSheets = create(null);
7168
7251
  var nodesToStyleSheets = new WeakMap();
@@ -7377,6 +7460,24 @@
7377
7460
  getElementsByClassName: function getElementsByClassName(element, names) {
7378
7461
  return element.getElementsByClassName(names);
7379
7462
  },
7463
+ getChildren: function getChildren(element) {
7464
+ return element.children;
7465
+ },
7466
+ getChildNodes: function getChildNodes(element) {
7467
+ return element.childNodes;
7468
+ },
7469
+ getFirstChild: function getFirstChild(element) {
7470
+ return element.firstChild;
7471
+ },
7472
+ getFirstElementChild: function getFirstElementChild(element) {
7473
+ return element.firstElementChild;
7474
+ },
7475
+ getLastChild: function getLastChild(element) {
7476
+ return element.lastChild;
7477
+ },
7478
+ getLastElementChild: function getLastElementChild(element) {
7479
+ return element.lastElementChild;
7480
+ },
7380
7481
  isConnected: function isConnected(node) {
7381
7482
  return node.isConnected;
7382
7483
  },
@@ -7692,7 +7793,7 @@
7692
7793
  });
7693
7794
  freeze(LightningElement);
7694
7795
  seal(LightningElement.prototype);
7695
- /* version: 2.5.2 */
7796
+ /* version: 2.5.6 */
7696
7797
 
7697
7798
  exports.LightningElement = LightningElement;
7698
7799
  exports.__unstable__ProfilerControl = profilerControl;
@@ -7712,6 +7813,8 @@
7712
7813
  exports.sanitizeAttribute = sanitizeAttribute;
7713
7814
  exports.setFeatureFlag = setFeatureFlag;
7714
7815
  exports.setFeatureFlagForTest = setFeatureFlagForTest;
7816
+ exports.setHooks = setHooks;
7817
+ exports.setHooksForTest = setHooksForTest;
7715
7818
  exports.swapComponent = swapComponent;
7716
7819
  exports.swapStyle = swapStyle;
7717
7820
  exports.swapTemplate = swapTemplate;
@@ -7721,4 +7824,4 @@
7721
7824
 
7722
7825
  Object.defineProperty(exports, '__esModule', { value: true });
7723
7826
 
7724
- })));
7827
+ }));