lwc 2.20.4 → 2.22.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 (35) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +181 -127
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +181 -127
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +168 -115
  5. package/dist/engine-dom/iife/es5/engine-dom.js +226 -147
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +201 -119
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +181 -127
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +168 -115
  11. package/dist/engine-dom/umd/es5/engine-dom.js +226 -147
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +201 -119
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +89 -318
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +89 -318
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
  20. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
  22. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
  23. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
  24. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  25. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  26. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  27. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  28. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  29. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  30. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  31. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  34. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  35. package/package.json +7 -7
@@ -305,9 +305,9 @@
305
305
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
306
306
  */
307
307
  // Increment whenever the LWC template compiler changes
308
- const LWC_VERSION = "2.20.4";
308
+ const LWC_VERSION = "2.22.0";
309
309
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
310
- /** version: 2.20.4 */
310
+ /** version: 2.22.0 */
311
311
 
312
312
  /*
313
313
  * Copyright (c) 2018, salesforce.com, inc.
@@ -461,7 +461,7 @@
461
461
  setFeatureFlag(name, value);
462
462
  }
463
463
  }
464
- /** version: 2.20.4 */
464
+ /** version: 2.22.0 */
465
465
 
466
466
  /*
467
467
  * Copyright (c) 2018, salesforce.com, inc.
@@ -693,18 +693,21 @@
693
693
  ArrayPush$1.call(this.listeners, reactiveObservers);
694
694
  }
695
695
  }
696
-
697
- /*
698
- * Copyright (c) 2018, salesforce.com, inc.
699
- * All rights reserved.
700
- * SPDX-License-Identifier: MIT
701
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
702
- */
703
696
  function componentValueMutated(vm, key) {
704
- valueMutated(vm.component, key);
697
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
698
+ {
699
+ valueMutated(vm.component, key);
700
+ }
705
701
  }
706
702
  function componentValueObserved(vm, key) {
707
- valueObserved(vm.component, key);
703
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
704
+ {
705
+ valueObserved(vm.component, key);
706
+ }
707
+ }
708
+ function createReactiveObserver(callback) {
709
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
710
+ return new ReactiveObserver(callback) ;
708
711
  }
709
712
 
710
713
  /*
@@ -1826,7 +1829,24 @@
1826
1829
  * change or being removed.
1827
1830
  */
1828
1831
  function unwrap(value) {
1829
- return reactiveMembrane.unwrapProxy(value);
1832
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
1833
+ return reactiveMembrane.unwrapProxy(value) ;
1834
+ }
1835
+ function getReadOnlyProxy(value) {
1836
+ // We must return a frozen wrapper around the value, so that child components cannot mutate properties passed to
1837
+ // them from their parents. This applies to both the client and server.
1838
+ return reactiveMembrane.getReadOnlyProxy(value);
1839
+ }
1840
+ function getReactiveProxy(value) {
1841
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
1842
+ return reactiveMembrane.getProxy(value) ;
1843
+ }
1844
+ // Making the component instance a live value when using Locker to support expandos.
1845
+ function markLockerLiveObject(obj) {
1846
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
1847
+ {
1848
+ obj[lockerLivePropertyKey] = undefined;
1849
+ }
1830
1850
  }
1831
1851
 
1832
1852
  /*
@@ -1916,8 +1936,7 @@
1916
1936
  vm.setHook = setHook;
1917
1937
  vm.getHook = getHook;
1918
1938
  }
1919
- // Making the component instance a live value when using Locker to support expandos.
1920
- this[lockerLivePropertyKey] = undefined;
1939
+ markLockerLiveObject(this);
1921
1940
  // Linking elm, shadow root and component with the VM.
1922
1941
  associateVM(component, vm);
1923
1942
  associateVM(elm, vm);
@@ -2186,6 +2205,45 @@
2186
2205
  configurable: true,
2187
2206
  };
2188
2207
  }
2208
+ class AccessorReactiveObserver extends ReactiveObserver {
2209
+ constructor(vm, set) {
2210
+ super(() => {
2211
+ if (isFalse(this.debouncing)) {
2212
+ this.debouncing = true;
2213
+ addCallbackToNextTick(() => {
2214
+ if (isTrue(this.debouncing)) {
2215
+ const { value } = this;
2216
+ const { isDirty: dirtyStateBeforeSetterCall, component, idx } = vm;
2217
+ set.call(component, value);
2218
+ // de-bouncing after the call to the original setter to prevent
2219
+ // infinity loop if the setter itself is mutating things that
2220
+ // were accessed during the previous invocation.
2221
+ this.debouncing = false;
2222
+ if (isTrue(vm.isDirty) && isFalse(dirtyStateBeforeSetterCall) && idx > 0) {
2223
+ // immediate rehydration due to a setter driven mutation, otherwise
2224
+ // the component will get rendered on the second tick, which it is not
2225
+ // desirable.
2226
+ rerenderVM(vm);
2227
+ }
2228
+ }
2229
+ });
2230
+ }
2231
+ });
2232
+ this.debouncing = false;
2233
+ }
2234
+ reset(value) {
2235
+ super.reset();
2236
+ this.debouncing = false;
2237
+ if (arguments.length > 0) {
2238
+ this.value = value;
2239
+ }
2240
+ }
2241
+ }
2242
+ function createAccessorReactiveObserver(vm, set) {
2243
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
2244
+ return new AccessorReactiveObserver(vm, set)
2245
+ ;
2246
+ }
2189
2247
 
2190
2248
  /*
2191
2249
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2234,50 +2292,6 @@
2234
2292
  configurable: true
2235
2293
  };
2236
2294
  }
2237
- class AccessorReactiveObserver extends ReactiveObserver {
2238
- constructor(vm, set) {
2239
- super(() => {
2240
- if (isFalse(this.debouncing)) {
2241
- this.debouncing = true;
2242
- addCallbackToNextTick(() => {
2243
- if (isTrue(this.debouncing)) {
2244
- const {
2245
- value
2246
- } = this;
2247
- const {
2248
- isDirty: dirtyStateBeforeSetterCall,
2249
- component,
2250
- idx
2251
- } = vm;
2252
- set.call(component, value); // de-bouncing after the call to the original setter to prevent
2253
- // infinity loop if the setter itself is mutating things that
2254
- // were accessed during the previous invocation.
2255
-
2256
- this.debouncing = false;
2257
-
2258
- if (isTrue(vm.isDirty) && isFalse(dirtyStateBeforeSetterCall) && idx > 0) {
2259
- // immediate rehydration due to a setter driven mutation, otherwise
2260
- // the component will get rendered on the second tick, which it is not
2261
- // desirable.
2262
- rerenderVM(vm);
2263
- }
2264
- }
2265
- });
2266
- }
2267
- });
2268
- this.debouncing = false;
2269
- }
2270
-
2271
- reset(value) {
2272
- super.reset();
2273
- this.debouncing = false;
2274
-
2275
- if (arguments.length > 0) {
2276
- this.value = value;
2277
- }
2278
- }
2279
-
2280
- }
2281
2295
  function createPublicAccessorDescriptor(key, descriptor) {
2282
2296
  const {
2283
2297
  get,
@@ -2318,7 +2332,7 @@
2318
2332
  let ro = vm.oar[key];
2319
2333
 
2320
2334
  if (isUndefined$1(ro)) {
2321
- ro = vm.oar[key] = new AccessorReactiveObserver(vm, set);
2335
+ ro = vm.oar[key] = createAccessorReactiveObserver(vm, set);
2322
2336
  } // every time we invoke this setter from outside (through this wrapper setter)
2323
2337
  // we should reset the value and then debounce just in case there is a pending
2324
2338
  // invocation the next tick that is not longer relevant since the value is changing
@@ -2350,7 +2364,7 @@
2350
2364
  */
2351
2365
  function track(target) {
2352
2366
  if (arguments.length === 1) {
2353
- return reactiveMembrane.getProxy(target);
2367
+ return getReactiveProxy(target);
2354
2368
  }
2355
2369
  if (process.env.NODE_ENV !== 'production') {
2356
2370
  assert.fail(`@track decorator can only be used with one argument to return a trackable object, or as a decorator function.`);
@@ -2371,7 +2385,7 @@
2371
2385
  assert.invariant(!isInvokingRender, `${vmBeingRendered}.render() method has side effects on the state of ${vm}.${toString$1(key)}`);
2372
2386
  assert.invariant(!isUpdatingTemplate, `Updating the template of ${vmBeingRendered} has side effects on the state of ${vm}.${toString$1(key)}`);
2373
2387
  }
2374
- const reactiveOrAnyValue = reactiveMembrane.getProxy(newValue);
2388
+ const reactiveOrAnyValue = getReactiveProxy(newValue);
2375
2389
  if (reactiveOrAnyValue !== vm.cmpFields[key]) {
2376
2390
  vm.cmpFields[key] = reactiveOrAnyValue;
2377
2391
  componentValueMutated(vm, key);
@@ -2763,7 +2777,7 @@
2763
2777
  fn = cachedSetterByKey[key] = function (newValue) {
2764
2778
  const vm = getAssociatedVM(this);
2765
2779
  const { setHook } = vm;
2766
- newValue = reactiveMembrane.getReadOnlyProxy(newValue);
2780
+ newValue = getReadOnlyProxy(newValue);
2767
2781
  setHook(vm.component, key, newValue);
2768
2782
  };
2769
2783
  }
@@ -3903,10 +3917,11 @@
3903
3917
  const { sel, owner, data: { svg }, } = vnode;
3904
3918
  const { createElement } = renderer;
3905
3919
  const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
3906
- const elm = createElement(sel, namespace);
3920
+ const elm = (vnode.elm = createElement(sel, namespace));
3907
3921
  linkNodeToShadow(elm, owner, renderer);
3908
- fallbackElmHook(elm, vnode, renderer);
3909
- vnode.elm = elm;
3922
+ applyStyleScoping(elm, owner, renderer);
3923
+ applyDomManual(elm, vnode);
3924
+ applyElementRestrictions(elm, vnode);
3910
3925
  patchElementPropsAndAttrs$1(null, vnode, renderer);
3911
3926
  insertNode(elm, parent, anchor, renderer);
3912
3927
  mountVNodes(vnode.children, elm, renderer, null);
@@ -3921,6 +3936,7 @@
3921
3936
  const { cloneNode, isSyntheticShadowDefined } = renderer;
3922
3937
  const elm = (vnode.elm = cloneNode(vnode.fragment, true));
3923
3938
  linkNodeToShadow(elm, owner, renderer);
3939
+ applyElementRestrictions(elm, vnode);
3924
3940
  // Marks this node as Static to propagate the shadow resolver. must happen after elm is assigned to the proper shadow
3925
3941
  const { renderMode, shadowMode } = owner;
3926
3942
  if (isSyntheticShadowDefined) {
@@ -3928,10 +3944,6 @@
3928
3944
  elm[KEY__SHADOW_STATIC] = true;
3929
3945
  }
3930
3946
  }
3931
- if (process.env.NODE_ENV !== 'production') {
3932
- const isLight = renderMode === 0 /* RenderMode.Light */;
3933
- patchElementWithRestrictions(elm, { isPortal: false, isLight });
3934
- }
3935
3947
  insertNode(elm, parent, anchor, renderer);
3936
3948
  }
3937
3949
  function mountCustomElement(vnode, parent, anchor, renderer) {
@@ -3948,9 +3960,10 @@
3948
3960
  // the custom element from the registry is expecting an upgrade callback
3949
3961
  vm = createViewModelHook(elm, vnode, renderer);
3950
3962
  });
3951
- linkNodeToShadow(elm, owner, renderer);
3952
3963
  vnode.elm = elm;
3953
3964
  vnode.vm = vm;
3965
+ linkNodeToShadow(elm, owner, renderer);
3966
+ applyStyleScoping(elm, owner, renderer);
3954
3967
  if (vm) {
3955
3968
  allocateChildren(vnode, vm);
3956
3969
  }
@@ -4034,22 +4047,6 @@
4034
4047
  function isVNode(vnode) {
4035
4048
  return vnode != null;
4036
4049
  }
4037
- function observeElementChildNodes(elm) {
4038
- elm.$domManual$ = true;
4039
- }
4040
- function setElementShadowToken(elm, token) {
4041
- elm.$shadowToken$ = token;
4042
- }
4043
- // Set the scope token class for *.scoped.css styles
4044
- function setScopeTokenClassIfNecessary(elm, owner, renderer) {
4045
- const token = getScopeTokenClass(owner);
4046
- if (!isNull(token)) {
4047
- const { getClassList } = renderer;
4048
- // TODO [#2762]: this dot notation with add is probably problematic
4049
- // probably we should have a renderer api for just the add operation
4050
- getClassList(elm).add(token);
4051
- }
4052
- }
4053
4050
  function linkNodeToShadow(elm, owner, renderer) {
4054
4051
  const { renderRoot, renderMode, shadowMode } = owner;
4055
4052
  const { isSyntheticShadowDefined } = renderer;
@@ -4102,31 +4099,37 @@
4102
4099
  patchAttributes(oldVnode, vnode, renderer);
4103
4100
  patchProps(oldVnode, vnode, renderer);
4104
4101
  }
4105
- function fallbackElmHook(elm, vnode, renderer) {
4106
- const { owner } = vnode;
4107
- setScopeTokenClassIfNecessary(elm, owner, renderer);
4108
- if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
4109
- const { data: { context }, } = vnode;
4110
- const { stylesheetToken } = owner.context;
4111
- if (!isUndefined$1(context) &&
4112
- !isUndefined$1(context.lwc) &&
4113
- context.lwc.dom === "manual" /* LwcDomMode.Manual */) {
4114
- // this element will now accept any manual content inserted into it
4115
- observeElementChildNodes(elm);
4116
- }
4117
- if (!isUndefined$1(stylesheetToken)) {
4118
- // when running in synthetic shadow mode, we need to set the shadowToken value
4119
- // into each element from the template, so they can be styled accordingly.
4120
- setElementShadowToken(elm, stylesheetToken);
4121
- }
4102
+ function applyStyleScoping(elm, owner, renderer) {
4103
+ // Set the class name for `*.scoped.css` style scoping.
4104
+ const scopeToken = getScopeTokenClass(owner);
4105
+ if (!isNull(scopeToken)) {
4106
+ const { getClassList } = renderer;
4107
+ // TODO [#2762]: this dot notation with add is probably problematic
4108
+ // probably we should have a renderer api for just the add operation
4109
+ getClassList(elm).add(scopeToken);
4110
+ }
4111
+ // Set property element for synthetic shadow DOM style scoping.
4112
+ const { stylesheetToken: syntheticToken } = owner.context;
4113
+ if (owner.shadowMode === 1 /* ShadowMode.Synthetic */ && !isUndefined$1(syntheticToken)) {
4114
+ elm.$shadowToken$ = syntheticToken;
4115
+ }
4116
+ }
4117
+ function applyDomManual(elm, vnode) {
4118
+ var _a;
4119
+ const { owner, data: { context }, } = vnode;
4120
+ if (owner.shadowMode === 1 /* ShadowMode.Synthetic */ && ((_a = context === null || context === void 0 ? void 0 : context.lwc) === null || _a === void 0 ? void 0 : _a.dom) === "manual" /* LwcDomMode.Manual */) {
4121
+ elm.$domManual$ = true;
4122
4122
  }
4123
+ }
4124
+ function applyElementRestrictions(elm, vnode) {
4125
+ var _a, _b;
4123
4126
  if (process.env.NODE_ENV !== 'production') {
4124
- const { data: { context }, } = vnode;
4125
- const isPortal = !isUndefined$1(context) &&
4126
- !isUndefined$1(context.lwc) &&
4127
- context.lwc.dom === "manual" /* LwcDomMode.Manual */;
4128
- const isLight = owner.renderMode === 0 /* RenderMode.Light */;
4129
- patchElementWithRestrictions(elm, { isPortal, isLight });
4127
+ const 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 */;
4128
+ const isLight = vnode.owner.renderMode === 0 /* RenderMode.Light */;
4129
+ patchElementWithRestrictions(elm, {
4130
+ isPortal,
4131
+ isLight,
4132
+ });
4130
4133
  }
4131
4134
  }
4132
4135
  function allocateChildren(vnode, vm) {
@@ -4161,15 +4164,6 @@
4161
4164
  return vm;
4162
4165
  }
4163
4166
  const { sel, mode, ctor, owner } = vnode;
4164
- setScopeTokenClassIfNecessary(elm, owner, renderer);
4165
- if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
4166
- const { stylesheetToken } = owner.context;
4167
- // when running in synthetic shadow mode, we need to set the shadowToken value
4168
- // into each element from the template, so they can be styled accordingly.
4169
- if (!isUndefined$1(stylesheetToken)) {
4170
- setElementShadowToken(elm, stylesheetToken);
4171
- }
4172
- }
4173
4167
  vm = createVM(elm, ctor, renderer, {
4174
4168
  mode,
4175
4169
  owner,
@@ -5219,7 +5213,7 @@
5219
5213
  return signedTemplateMap.get(Ctor);
5220
5214
  }
5221
5215
  function getTemplateReactiveObserver(vm) {
5222
- return new ReactiveObserver(() => {
5216
+ return createReactiveObserver(() => {
5223
5217
  const { isDirty } = vm;
5224
5218
  if (isFalse(isDirty)) {
5225
5219
  markComponentAsDirty(vm);
@@ -6034,7 +6028,7 @@
6034
6028
  function createConfigWatcher(component, configCallback, callbackWhenConfigIsReady) {
6035
6029
  let hasPendingConfig = false; // creating the reactive observer for reactive params when needed
6036
6030
 
6037
- const ro = new ReactiveObserver(() => {
6031
+ const ro = createReactiveObserver(() => {
6038
6032
  if (hasPendingConfig === false) {
6039
6033
  hasPendingConfig = true; // collect new config in the micro-task
6040
6034
 
@@ -6330,7 +6324,7 @@
6330
6324
  assert.fail('@readonly cannot be used as a decorator just yet, use it as a function with one argument to produce a readonly version of the provided value.');
6331
6325
  }
6332
6326
  }
6333
- return reactiveMembrane.getReadOnlyProxy(obj);
6327
+ return getReadOnlyProxy(obj);
6334
6328
  }
6335
6329
 
6336
6330
  /*
@@ -6841,7 +6835,7 @@
6841
6835
  }
6842
6836
  return ctor;
6843
6837
  }
6844
- /* version: 2.20.4 */
6838
+ /* version: 2.22.0 */
6845
6839
 
6846
6840
  /*
6847
6841
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6985,6 +6979,69 @@
6985
6979
  }
6986
6980
  }
6987
6981
 
6982
+ /*
6983
+ * Copyright (c) 2018, salesforce.com, inc.
6984
+ * All rights reserved.
6985
+ * SPDX-License-Identifier: MIT
6986
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6987
+ */
6988
+ const SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
6989
+ let createFragment;
6990
+ if (SUPPORTS_TEMPLATE) {
6991
+ // Parse the fragment HTML string into DOM
6992
+ createFragment = function (html) {
6993
+ const template = document.createElement('template');
6994
+ template.innerHTML = html;
6995
+ return template.content.firstChild;
6996
+ };
6997
+ }
6998
+ else {
6999
+ // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
7000
+ // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
7001
+ // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
7002
+ // With other elements added from:
7003
+ // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
7004
+ // Using the test:
7005
+ // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
7006
+ // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
7007
+ const topLevelWrappingMap = {
7008
+ caption: ['table'],
7009
+ col: ['colgroup', 'table'],
7010
+ colgroup: ['table'],
7011
+ option: ['select'],
7012
+ tbody: ['table'],
7013
+ td: ['tr', 'tbody', 'table'],
7014
+ th: ['tr', 'tbody', 'table'],
7015
+ thead: ['table'],
7016
+ tfoot: ['table'],
7017
+ tr: ['tbody', 'table'],
7018
+ };
7019
+ // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
7020
+ const getTagName = function (text) {
7021
+ return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
7022
+ };
7023
+ // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
7024
+ createFragment = function (html) {
7025
+ const wrapperTags = topLevelWrappingMap[getTagName(html)];
7026
+ if (!isUndefined$1(wrapperTags)) {
7027
+ for (const wrapperTag of wrapperTags) {
7028
+ html = `<${wrapperTag}>${html}</${wrapperTag}>`;
7029
+ }
7030
+ }
7031
+ // For IE11, the document title must not be undefined, but it can be an empty string
7032
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
7033
+ const doc = document.implementation.createHTMLDocument('');
7034
+ doc.body.innerHTML = html;
7035
+ let content = doc.body;
7036
+ if (!isUndefined$1(wrapperTags)) {
7037
+ for (let i = 0; i < wrapperTags.length; i++) {
7038
+ content = content.firstChild;
7039
+ }
7040
+ }
7041
+ return content.firstChild;
7042
+ };
7043
+ }
7044
+
6988
7045
  /*
6989
7046
  * Copyright (c) 2018, salesforce.com, inc.
6990
7047
  * All rights reserved.
@@ -7063,9 +7120,6 @@
7063
7120
  function cloneNode(node, deep) {
7064
7121
  return node.cloneNode(deep);
7065
7122
  }
7066
- function createFragment(html) {
7067
- return document.createRange().createContextualFragment(html).firstChild;
7068
- }
7069
7123
  function createElement$1(tagName, namespace) {
7070
7124
  return isUndefined$1(namespace)
7071
7125
  ? document.createElement(tagName)
@@ -7529,7 +7583,7 @@
7529
7583
  });
7530
7584
  freeze(LightningElement);
7531
7585
  seal(LightningElement.prototype);
7532
- /* version: 2.20.4 */
7586
+ /* version: 2.22.0 */
7533
7587
 
7534
7588
  exports.LightningElement = LightningElement;
7535
7589
  exports.__unstable__ProfilerControl = profilerControl;