lwc 2.23.1 → 2.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +1182 -856
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +1182 -855
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +1101 -803
  5. package/dist/engine-dom/iife/es5/engine-dom.js +449 -368
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +409 -335
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +1182 -855
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +1101 -803
  11. package/dist/engine-dom/umd/es5/engine-dom.js +449 -368
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +409 -335
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +782 -521
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +782 -521
  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
@@ -368,9 +368,9 @@
368
368
  // Increment whenever the LWC template compiler changes
369
369
 
370
370
 
371
- var LWC_VERSION = "2.23.1";
371
+ var LWC_VERSION = "2.23.2";
372
372
  var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
373
- /** version: 2.23.1 */
373
+ /** version: 2.23.2 */
374
374
 
375
375
  /**
376
376
  * Copyright (C) 2018 salesforce.com, inc.
@@ -464,7 +464,7 @@
464
464
  patch$1(propName);
465
465
  }
466
466
  }
467
- /** version: 2.23.1 */
467
+ /** version: 2.23.2 */
468
468
 
469
469
  /**
470
470
  * Copyright (C) 2018 salesforce.com, inc.
@@ -486,6 +486,7 @@
486
486
  ENABLE_HTML_COLLECTIONS_PATCH: null,
487
487
  ENABLE_INNER_OUTER_TEXT_PATCH: null,
488
488
  ENABLE_MIXED_SHADOW_MODE: null,
489
+ ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE: null,
489
490
  ENABLE_NODE_LIST_PATCH: null,
490
491
  ENABLE_NODE_PATCH: null,
491
492
  ENABLE_REACTIVE_SETTER: null,
@@ -555,7 +556,7 @@
555
556
  setFeatureFlag(name, value);
556
557
  }
557
558
  }
558
- /** version: 2.23.1 */
559
+ /** version: 2.23.2 */
559
560
 
560
561
  /*
561
562
  * Copyright (c) 2018, salesforce.com, inc.
@@ -997,8 +998,8 @@
997
998
  // to inject at runtime.
998
999
 
999
1000
 
1000
- var HTMLElementConstructor$1 = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
1001
- var HTMLElementPrototype = HTMLElementConstructor$1.prototype;
1001
+ var HTMLElementConstructor = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
1002
+ var HTMLElementPrototype = HTMLElementConstructor.prototype;
1002
1003
  /*
1003
1004
  * Copyright (c) 2018, salesforce.com, inc.
1004
1005
  * All rights reserved.
@@ -1218,10 +1219,10 @@
1218
1219
  }; // Apply extra restriction related to DOM manipulation if the element is not a portal.
1219
1220
 
1220
1221
  if (!options.isLight && !options.isPortal) {
1221
- var _appendChild = elm.appendChild,
1222
- _insertBefore = elm.insertBefore,
1223
- _removeChild = elm.removeChild,
1224
- _replaceChild = elm.replaceChild;
1222
+ var appendChild = elm.appendChild,
1223
+ insertBefore = elm.insertBefore,
1224
+ removeChild = elm.removeChild,
1225
+ replaceChild = elm.replaceChild;
1225
1226
  var originalNodeValueDescriptor = getPropertyDescriptor(elm, 'nodeValue');
1226
1227
  var originalInnerHTMLDescriptor = getPropertyDescriptor(elm, 'innerHTML');
1227
1228
  var originalTextContentDescriptor = getPropertyDescriptor(elm, 'textContent');
@@ -1229,7 +1230,7 @@
1229
1230
  appendChild: generateDataDescriptor({
1230
1231
  value: function value(aChild) {
1231
1232
  logMissingPortalError('appendChild', 'method');
1232
- return _appendChild.call(this, aChild);
1233
+ return appendChild.call(this, aChild);
1233
1234
  }
1234
1235
  }),
1235
1236
  insertBefore: generateDataDescriptor({
@@ -1238,7 +1239,7 @@
1238
1239
  logMissingPortalError('insertBefore', 'method');
1239
1240
  }
1240
1241
 
1241
- return _insertBefore.call(this, newNode, referenceNode);
1242
+ return insertBefore.call(this, newNode, referenceNode);
1242
1243
  }
1243
1244
  }),
1244
1245
  removeChild: generateDataDescriptor({
@@ -1247,13 +1248,13 @@
1247
1248
  logMissingPortalError('removeChild', 'method');
1248
1249
  }
1249
1250
 
1250
- return _removeChild.call(this, aChild);
1251
+ return removeChild.call(this, aChild);
1251
1252
  }
1252
1253
  }),
1253
1254
  replaceChild: generateDataDescriptor({
1254
1255
  value: function value(newChild, oldChild) {
1255
1256
  logMissingPortalError('replaceChild', 'method');
1256
- return _replaceChild.call(this, newChild, oldChild);
1257
+ return replaceChild.call(this, newChild, oldChild);
1257
1258
  }
1258
1259
  }),
1259
1260
  nodeValue: generateAccessorDescriptor({
@@ -2414,9 +2415,8 @@
2414
2415
  var bridge = def.bridge;
2415
2416
 
2416
2417
  if (process.env.NODE_ENV !== 'production') {
2417
- var _assertInstanceOfHTMLElement = vm.renderer.assertInstanceOfHTMLElement;
2418
-
2419
- _assertInstanceOfHTMLElement(vm.elm, "Component creation requires a DOM element to be associated to ".concat(vm, "."));
2418
+ var assertInstanceOfHTMLElement = vm.renderer.assertInstanceOfHTMLElement;
2419
+ assertInstanceOfHTMLElement(vm.elm, "Component creation requires a DOM element to be associated to ".concat(vm, "."));
2420
2420
  }
2421
2421
 
2422
2422
  var component = this;
@@ -3593,7 +3593,7 @@
3593
3593
  return HTMLBridgeElement;
3594
3594
  }
3595
3595
 
3596
- var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor$1, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
3596
+ var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
3597
3597
  freeze(BaseBridgeElement);
3598
3598
  seal(BaseBridgeElement.prototype);
3599
3599
  /*
@@ -4388,6 +4388,18 @@
4388
4388
  */
4389
4389
 
4390
4390
 
4391
+ function checkHasVM(elm) {
4392
+ var hasVM = !isUndefined$1(getAssociatedVMIfPresent(elm));
4393
+
4394
+ if (process.env.NODE_ENV !== 'production' && !hasVM) {
4395
+ // Occurs when an element is manually created with the same tag name as an existing LWC component. In that case,
4396
+ // we skip calling the LWC connectedCallback/disconnectedCallback logic and log an error.
4397
+ logError("VM for tag name \"".concat(elm.tagName.toLowerCase(), "\" is undefined. ") + "This indicates that an element was created with this tag name, " + "which is already reserved by an LWC component. Use lwc.createElement " + "instead to create elements.");
4398
+ }
4399
+
4400
+ return hasVM;
4401
+ }
4402
+
4391
4403
  function getUpgradableConstructor(tagName, renderer) {
4392
4404
  var getCustomElement = renderer.getCustomElement,
4393
4405
  RendererHTMLElement = renderer.HTMLElementExported,
@@ -4429,6 +4441,20 @@
4429
4441
  return _createClass(LWCUpgradableElement);
4430
4442
  }(RendererHTMLElement);
4431
4443
 
4444
+ if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
4445
+ CE.prototype.connectedCallback = function () {
4446
+ if (checkHasVM(this)) {
4447
+ connectRootElement(this);
4448
+ }
4449
+ };
4450
+
4451
+ CE.prototype.disconnectedCallback = function () {
4452
+ if (checkHasVM(this)) {
4453
+ disconnectRootElement(this);
4454
+ }
4455
+ };
4456
+ }
4457
+
4432
4458
  defineCustomElement(tagName, CE);
4433
4459
  return CE;
4434
4460
  }
@@ -4540,6 +4566,15 @@
4540
4566
  // different than the one previously set.
4541
4567
 
4542
4568
  if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
4569
+ // Additional verification if properties are supported by the element
4570
+ // Validation relies on html properties and public properties being defined on the element,
4571
+ // SSR has its own custom validation.
4572
+ if (process.env.NODE_ENV !== 'production') {
4573
+ if (!(key in elm)) {
4574
+ logWarn("Unknown public property \"".concat(key, "\" of element <").concat(elm.tagName.toLowerCase(), ">. This is either a typo on the corresponding attribute \"").concat(htmlPropertyToAttribute(key), "\", or the attribute does not exist in this browser or DOM implementation."));
4575
+ }
4576
+ }
4577
+
4543
4578
  setProperty(elm, key, cur);
4544
4579
  }
4545
4580
  }
@@ -4952,13 +4987,19 @@
4952
4987
  insertNode(elm, parent, anchor, renderer);
4953
4988
 
4954
4989
  if (vm) {
4955
- if (process.env.NODE_ENV !== 'production') {
4956
- assert.isTrue(vm.state === 0
4957
- /* VMState.created */
4958
- , "".concat(vm, " cannot be recycled."));
4959
- }
4990
+ {
4991
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
4992
+ if (process.env.NODE_ENV !== 'production') {
4993
+ // With synthetic lifecycle callbacks, it's possible for elements to be removed without the engine
4994
+ // noticing it (e.g. `appendChild` the same host element twice). This test ensures we don't regress.
4995
+ assert.isTrue(vm.state === 0
4996
+ /* VMState.created */
4997
+ , "".concat(vm, " cannot be recycled."));
4998
+ }
4960
4999
 
4961
- runConnectedCallback(vm);
5000
+ runConnectedCallback(vm);
5001
+ }
5002
+ }
4962
5003
  }
4963
5004
 
4964
5005
  mountVNodes(vnode.children, elm, renderer, null);
@@ -5148,10 +5189,10 @@
5148
5189
  var scopeToken = getScopeTokenClass(owner);
5149
5190
 
5150
5191
  if (!isNull(scopeToken)) {
5151
- var _getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
5192
+ var getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
5152
5193
  // probably we should have a renderer api for just the add operation
5153
5194
 
5154
- _getClassList(elm).add(scopeToken);
5195
+ getClassList(elm).add(scopeToken);
5155
5196
  } // Set property element for synthetic shadow DOM style scoping.
5156
5197
 
5157
5198
 
@@ -7666,6 +7707,8 @@
7666
7707
  return renderer.nextSibling(hydratedNode);
7667
7708
  }
7668
7709
 
7710
+ var NODE_VALUE_PROP = 'nodeValue';
7711
+
7669
7712
  function hydrateText(node, vnode, renderer) {
7670
7713
  var _a;
7671
7714
 
@@ -7676,9 +7719,8 @@
7676
7719
  }
7677
7720
 
7678
7721
  if (process.env.NODE_ENV !== 'production') {
7679
- var _getProperty = renderer.getProperty;
7680
-
7681
- var nodeValue = _getProperty(node, 'nodeValue');
7722
+ var getProperty = renderer.getProperty;
7723
+ var nodeValue = getProperty(node, NODE_VALUE_PROP);
7682
7724
 
7683
7725
  if (nodeValue !== vnode.text && !(nodeValue === "\u200D" && vnode.text === '')) {
7684
7726
  logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
@@ -7701,9 +7743,8 @@
7701
7743
  }
7702
7744
 
7703
7745
  if (process.env.NODE_ENV !== 'production') {
7704
- var _getProperty2 = renderer.getProperty;
7705
-
7706
- var nodeValue = _getProperty2(node, 'nodeValue');
7746
+ var getProperty = renderer.getProperty;
7747
+ var nodeValue = getProperty(node, NODE_VALUE_PROP);
7707
7748
 
7708
7749
  if (nodeValue !== vnode.text) {
7709
7750
  logWarn('Hydration mismatch: comment values do not match, will recover from the difference', vnode.owner);
@@ -7711,7 +7752,7 @@
7711
7752
  }
7712
7753
 
7713
7754
  var setProperty = renderer.setProperty;
7714
- setProperty(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
7755
+ setProperty(node, NODE_VALUE_PROP, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
7715
7756
  vnode.elm = node;
7716
7757
  return node;
7717
7758
  }
@@ -7743,17 +7784,17 @@
7743
7784
  // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
7744
7785
  // remove the innerHTML from props so it reuses the existing dom elements.
7745
7786
  var props = vnode.data.props;
7746
- var _getProperty3 = renderer.getProperty;
7787
+ var getProperty = renderer.getProperty;
7747
7788
 
7748
7789
  if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
7749
- if (_getProperty3(elm, 'innerHTML') === props.innerHTML) {
7790
+ if (getProperty(elm, 'innerHTML') === props.innerHTML) {
7750
7791
  // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
7751
7792
  vnode.data = Object.assign(Object.assign({}, vnode.data), {
7752
7793
  props: cloneAndOmitKey(props, 'innerHTML')
7753
7794
  });
7754
7795
  } else {
7755
7796
  if (process.env.NODE_ENV !== 'production') {
7756
- logWarn("Mismatch hydrating element <".concat(_getProperty3(elm, 'tagName').toLowerCase(), ">: innerHTML values do not match for element, will recover from the difference"), owner);
7797
+ logWarn("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: innerHTML values do not match for element, will recover from the difference"), owner);
7757
7798
  }
7758
7799
  }
7759
7800
  }
@@ -7762,8 +7803,8 @@
7762
7803
  patchElementPropsAndAttrs(vnode, renderer);
7763
7804
 
7764
7805
  if (!isDomManual) {
7765
- var _getFirstChild = renderer.getFirstChild;
7766
- hydrateChildren(_getFirstChild(elm), vnode.children, elm, owner);
7806
+ var getFirstChild = renderer.getFirstChild;
7807
+ hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
7767
7808
  }
7768
7809
 
7769
7810
  return elm;
@@ -7802,10 +7843,10 @@
7802
7843
  if (vm.renderMode !== 0
7803
7844
  /* RenderMode.Light */
7804
7845
  ) {
7805
- var _getFirstChild2 = renderer.getFirstChild; // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
7846
+ var getFirstChild = renderer.getFirstChild; // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
7806
7847
  // Note: for Light DOM, this is handled while hydrating the VM
7807
7848
 
7808
- hydrateChildren(_getFirstChild2(elm), vnode.children, elm, vm);
7849
+ hydrateChildren(getFirstChild(elm), vnode.children, elm, vm);
7809
7850
  }
7810
7851
 
7811
7852
  hydrateVM(vm);
@@ -7854,11 +7895,11 @@
7854
7895
  // next node in the list to be hydrated.
7855
7896
 
7856
7897
 
7857
- var _nextSibling = renderer.nextSibling;
7898
+ var nextSibling = renderer.nextSibling;
7858
7899
 
7859
7900
  do {
7860
7901
  var current = nextNode;
7861
- nextNode = _nextSibling(nextNode);
7902
+ nextNode = nextSibling(nextNode);
7862
7903
  removeNode(current, parentNode, renderer);
7863
7904
  } while (nextNode);
7864
7905
  }
@@ -7921,14 +7962,13 @@
7921
7962
  attrValue = _Object$entries$_i[1];
7922
7963
 
7923
7964
  var owner = vnode.owner;
7924
- var _getAttribute = renderer.getAttribute;
7925
-
7926
- var elmAttrValue = _getAttribute(elm, attrName);
7965
+ var getAttribute = renderer.getAttribute;
7966
+ var elmAttrValue = getAttribute(elm, attrName);
7927
7967
 
7928
7968
  if (String(attrValue) !== elmAttrValue) {
7929
7969
  if (process.env.NODE_ENV !== 'production') {
7930
- var _getProperty4 = renderer.getProperty;
7931
- logError("Mismatch hydrating element <".concat(_getProperty4(elm, 'tagName').toLowerCase(), ">: attribute \"").concat(attrName, "\" has different values, expected \"").concat(attrValue, "\" but found \"").concat(elmAttrValue, "\""), owner);
7970
+ var getProperty = renderer.getProperty;
7971
+ logError("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: attribute \"").concat(attrName, "\" has different values, expected \"").concat(attrValue, "\" but found \"").concat(elmAttrValue, "\""), owner);
7932
7972
  }
7933
7973
 
7934
7974
  nodesAreCompatible = false;
@@ -8039,8 +8079,8 @@
8039
8079
 
8040
8080
  if (!nodesAreCompatible) {
8041
8081
  if (process.env.NODE_ENV !== 'production') {
8042
- var _getProperty5 = renderer.getProperty;
8043
- logError("Mismatch hydrating element <".concat(_getProperty5(elm, 'tagName').toLowerCase(), ">: attribute \"style\" has different values, expected \"").concat(vnodeStyle, "\" but found \"").concat(elmStyle, "\"."), vnode.owner);
8082
+ var getProperty = renderer.getProperty;
8083
+ logError("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: attribute \"style\" has different values, expected \"").concat(vnodeStyle, "\" but found \"").concat(elmStyle, "\"."), vnode.owner);
8044
8084
  }
8045
8085
  }
8046
8086
 
@@ -8060,7 +8100,7 @@
8060
8100
  return false;
8061
8101
  }
8062
8102
 
8063
- return getProperty(client, 'nodeValue') === getProperty(ssr, 'nodeValue');
8103
+ return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
8064
8104
  }
8065
8105
 
8066
8106
  if (getProperty(client, 'nodeType') === 8
@@ -8072,7 +8112,7 @@
8072
8112
  return false;
8073
8113
  }
8074
8114
 
8075
- return getProperty(client, 'nodeValue') === getProperty(ssr, 'nodeValue');
8115
+ return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
8076
8116
  }
8077
8117
 
8078
8118
  if (!hasCorrectNodeType(vnode, ssr, 1
@@ -8272,7 +8312,7 @@
8272
8312
 
8273
8313
  return ctor;
8274
8314
  }
8275
- /* version: 2.23.1 */
8315
+ /* version: 2.23.2 */
8276
8316
 
8277
8317
  /*
8278
8318
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8439,361 +8479,395 @@
8439
8479
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8440
8480
  */
8441
8481
 
8482
+ /**
8483
+ * A factory function that produces a renderer.
8484
+ * Renderer encapsulates operations that are required to render an LWC component into the underlying
8485
+ * runtime environment. In the case of @lwc/enigne-dom, it is meant to be used in a DOM environment.
8486
+ * Example usage:
8487
+ * import { renderer, rendererFactory } from 'lwc';
8488
+ * const customRenderer = rendererFactory(renderer);
8489
+ *
8490
+ * @param baseRenderer Either null or the base renderer imported from 'lwc'.
8491
+ */
8442
8492
 
8443
- var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
8444
- var createFragment;
8445
8493
 
8446
- if (SUPPORTS_TEMPLATE) {
8447
- // Parse the fragment HTML string into DOM
8448
- createFragment = function createFragment(html) {
8449
- var template = document.createElement('template');
8450
- template.innerHTML = html;
8451
- return template.content.firstChild;
8452
- };
8453
- } else {
8454
- // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
8455
- // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
8456
- // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
8457
- // With other elements added from:
8458
- // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
8459
- // Using the test:
8460
- // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
8461
- // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
8462
- var topLevelWrappingMap = {
8463
- caption: ['table'],
8464
- col: ['colgroup', 'table'],
8465
- colgroup: ['table'],
8466
- option: ['select'],
8467
- tbody: ['table'],
8468
- td: ['tr', 'tbody', 'table'],
8469
- th: ['tr', 'tbody', 'table'],
8470
- thead: ['table'],
8471
- tfoot: ['table'],
8472
- tr: ['tbody', 'table']
8473
- }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
8474
-
8475
- var getTagName = function getTagName(text) {
8476
- return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
8477
- }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
8478
-
8479
-
8480
- createFragment = function createFragment(html) {
8481
- var wrapperTags = topLevelWrappingMap[getTagName(html)];
8482
-
8483
- if (!isUndefined$1(wrapperTags)) {
8484
- var _iterator5 = _createForOfIteratorHelper(wrapperTags),
8485
- _step5;
8494
+ function rendererFactory(baseRenderer) {
8495
+ // Util functions
8496
+ function assertInvariant(value, msg) {
8497
+ if (!value) {
8498
+ throw new Error("Invariant Violation: ".concat(msg));
8499
+ }
8500
+ }
8486
8501
 
8487
- try {
8488
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
8489
- var wrapperTag = _step5.value;
8490
- html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
8491
- }
8492
- } catch (err) {
8493
- _iterator5.e(err);
8494
- } finally {
8495
- _iterator5.f();
8496
- }
8497
- } // For IE11, the document title must not be undefined, but it can be an empty string
8498
- // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
8502
+ function isNull(obj) {
8503
+ return obj === null;
8504
+ }
8499
8505
 
8506
+ function isUndefined(obj) {
8507
+ return obj === undefined;
8508
+ }
8500
8509
 
8501
- var doc = document.implementation.createHTMLDocument('');
8502
- doc.body.innerHTML = html;
8503
- var content = doc.body;
8510
+ var getCustomElement;
8511
+ var defineCustomElement;
8512
+ var HTMLElementConstructor;
8504
8513
 
8505
- if (!isUndefined$1(wrapperTags)) {
8506
- for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
8507
- content = content.firstChild;
8508
- }
8514
+ function isCustomElementRegistryAvailable() {
8515
+ if (typeof customElements === 'undefined') {
8516
+ return false;
8509
8517
  }
8510
8518
 
8511
- return content.firstChild;
8512
- };
8513
- }
8514
- /*
8515
- * Copyright (c) 2018, salesforce.com, inc.
8516
- * All rights reserved.
8517
- * SPDX-License-Identifier: MIT
8518
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8519
- */
8519
+ try {
8520
+ // dereference HTMLElement global because babel wraps globals in compat mode with a
8521
+ // _wrapNativeSuper()
8522
+ // This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
8523
+ // get wrapped by babel.
8524
+ var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
8525
+ // invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
8526
+ // which are not equipped to be initialized that way.
8520
8527
 
8528
+ var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
8529
+ _inherits(clazz, _HTMLElementAlias);
8521
8530
 
8522
- var getCustomElement;
8523
- var defineCustomElement;
8524
- var HTMLElementConstructor;
8531
+ var _super7 = _createSuper(clazz);
8525
8532
 
8526
- function isCustomElementRegistryAvailable() {
8527
- if (typeof customElements === 'undefined') {
8528
- return false;
8533
+ function clazz() {
8534
+ _classCallCheck(this, clazz);
8535
+
8536
+ return _super7.apply(this, arguments);
8537
+ }
8538
+
8539
+ return _createClass(clazz);
8540
+ }(HTMLElementAlias);
8541
+
8542
+ customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
8543
+ new clazz();
8544
+ return true;
8545
+ } catch (_a) {
8546
+ return false;
8547
+ }
8529
8548
  }
8530
8549
 
8531
- try {
8532
- // dereference HTMLElement global because babel wraps globals in compat mode with a
8533
- // _wrapNativeSuper()
8534
- // This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
8535
- // get wrapped by babel.
8536
- var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
8537
- // invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
8538
- // which are not equipped to be initialized that way.
8550
+ if (isCustomElementRegistryAvailable()) {
8551
+ getCustomElement = customElements.get.bind(customElements);
8552
+ defineCustomElement = customElements.define.bind(customElements);
8553
+ HTMLElementConstructor = HTMLElement;
8554
+ } else {
8555
+ var registry = Object.create(null);
8556
+ var reverseRegistry = new WeakMap();
8539
8557
 
8540
- var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
8541
- _inherits(clazz, _HTMLElementAlias);
8558
+ defineCustomElement = function define(name, ctor) {
8559
+ if (name !== String.prototype.toLowerCase.call(name) || registry[name]) {
8560
+ throw new TypeError("Invalid Registration");
8561
+ }
8542
8562
 
8543
- var _super7 = _createSuper(clazz);
8563
+ registry[name] = ctor;
8564
+ reverseRegistry.set(ctor, name);
8565
+ };
8544
8566
 
8545
- function clazz() {
8546
- _classCallCheck(this, clazz);
8567
+ getCustomElement = function get(name) {
8568
+ return registry[name];
8569
+ };
8547
8570
 
8548
- return _super7.apply(this, arguments);
8571
+ HTMLElementConstructor = function HTMLElement() {
8572
+ if (!(this instanceof HTMLElement)) {
8573
+ throw new TypeError("Invalid Invocation");
8549
8574
  }
8550
8575
 
8551
- return _createClass(clazz);
8552
- }(HTMLElementAlias);
8576
+ var constructor = this.constructor;
8577
+ var name = reverseRegistry.get(constructor);
8553
8578
 
8554
- customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
8555
- new clazz();
8556
- return true;
8557
- } catch (_a) {
8558
- return false;
8579
+ if (!name) {
8580
+ throw new TypeError("Invalid Construction");
8581
+ }
8582
+
8583
+ var elm = document.createElement(name);
8584
+ Object.setPrototypeOf(elm, constructor.prototype);
8585
+ return elm;
8586
+ };
8587
+
8588
+ HTMLElementConstructor.prototype = HTMLElement.prototype;
8559
8589
  }
8560
- }
8561
8590
 
8562
- if (isCustomElementRegistryAvailable()) {
8563
- getCustomElement = customElements.get.bind(customElements);
8564
- defineCustomElement = customElements.define.bind(customElements);
8565
- HTMLElementConstructor = HTMLElement;
8566
- } else {
8567
- var registry = create(null);
8568
- var reverseRegistry = new WeakMap();
8591
+ function cloneNode(node, deep) {
8592
+ return node.cloneNode(deep);
8593
+ }
8569
8594
 
8570
- defineCustomElement = function define(name, ctor) {
8571
- if (name !== StringToLowerCase.call(name) || registry[name]) {
8572
- throw new TypeError("Invalid Registration");
8573
- }
8595
+ function createElement(tagName, namespace) {
8596
+ return isUndefined(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
8597
+ }
8574
8598
 
8575
- registry[name] = ctor;
8576
- reverseRegistry.set(ctor, name);
8577
- };
8599
+ function createText(content) {
8600
+ return document.createTextNode(content);
8601
+ }
8578
8602
 
8579
- getCustomElement = function get(name) {
8580
- return registry[name];
8581
- };
8603
+ function createComment(content) {
8604
+ return document.createComment(content);
8605
+ }
8582
8606
 
8583
- HTMLElementConstructor = function HTMLElement() {
8584
- if (!(this instanceof HTMLElement)) {
8585
- throw new TypeError("Invalid Invocation");
8586
- }
8607
+ var createFragment; // IE11 lacks support for this feature
8587
8608
 
8588
- var constructor = this.constructor;
8589
- var name = reverseRegistry.get(constructor);
8609
+ var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
8590
8610
 
8591
- if (!name) {
8592
- throw new TypeError("Invalid Construction");
8593
- }
8611
+ if (SUPPORTS_TEMPLATE) {
8612
+ // Parse the fragment HTML string into DOM
8613
+ createFragment = function createFragment(html) {
8614
+ var template = document.createElement('template');
8615
+ template.innerHTML = html;
8616
+ return template.content.firstChild;
8617
+ };
8618
+ } else {
8619
+ // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
8620
+ // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
8621
+ // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
8622
+ // With other elements added from:
8623
+ // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
8624
+ // Using the test:
8625
+ // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
8626
+ // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
8627
+ var topLevelWrappingMap = {
8628
+ caption: ['table'],
8629
+ col: ['colgroup', 'table'],
8630
+ colgroup: ['table'],
8631
+ option: ['select'],
8632
+ tbody: ['table'],
8633
+ td: ['tr', 'tbody', 'table'],
8634
+ th: ['tr', 'tbody', 'table'],
8635
+ thead: ['table'],
8636
+ tfoot: ['table'],
8637
+ tr: ['tbody', 'table']
8638
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
8639
+
8640
+ var getTagName = function getTagName(text) {
8641
+ return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
8642
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
8643
+
8644
+
8645
+ createFragment = function createFragment(html) {
8646
+ var wrapperTags = topLevelWrappingMap[getTagName(html)];
8647
+
8648
+ if (!isUndefined(wrapperTags)) {
8649
+ var _iterator5 = _createForOfIteratorHelper(wrapperTags),
8650
+ _step5;
8651
+
8652
+ try {
8653
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
8654
+ var wrapperTag = _step5.value;
8655
+ html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
8656
+ }
8657
+ } catch (err) {
8658
+ _iterator5.e(err);
8659
+ } finally {
8660
+ _iterator5.f();
8661
+ }
8662
+ } // For IE11, the document title must not be undefined, but it can be an empty string
8663
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
8594
8664
 
8595
- var elm = document.createElement(name);
8596
- setPrototypeOf(elm, constructor.prototype);
8597
- return elm;
8598
- };
8599
8665
 
8600
- HTMLElementConstructor.prototype = HTMLElement.prototype;
8601
- }
8666
+ var doc = document.implementation.createHTMLDocument('');
8667
+ doc.body.innerHTML = html;
8668
+ var content = doc.body;
8602
8669
 
8603
- var isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
8604
- var isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
8670
+ if (!isUndefined(wrapperTags)) {
8671
+ for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
8672
+ content = content.firstChild;
8673
+ }
8674
+ }
8605
8675
 
8606
- function cloneNode(node, deep) {
8607
- return node.cloneNode(deep);
8608
- }
8676
+ return content.firstChild;
8677
+ };
8678
+ }
8609
8679
 
8610
- function createElement$1(tagName, namespace) {
8611
- return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
8612
- }
8680
+ function insert(node, parent, anchor) {
8681
+ parent.insertBefore(node, anchor);
8682
+ }
8613
8683
 
8614
- function createText(content) {
8615
- return document.createTextNode(content);
8616
- }
8684
+ function remove(node, parent) {
8685
+ parent.removeChild(node);
8686
+ }
8617
8687
 
8618
- function createComment(content) {
8619
- return document.createComment(content);
8620
- }
8688
+ function nextSibling(node) {
8689
+ return node.nextSibling;
8690
+ }
8621
8691
 
8622
- function insert(node, parent, anchor) {
8623
- parent.insertBefore(node, anchor);
8624
- }
8692
+ function attachShadow(element, options) {
8693
+ // `shadowRoot` will be non-null in two cases:
8694
+ // 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
8695
+ // 2. when a webapp author places <c-app> in their static HTML and mounts their
8696
+ // root component with customElement.define('c-app', Ctor)
8697
+ if (!isNull(element.shadowRoot)) {
8698
+ return element.shadowRoot;
8699
+ }
8625
8700
 
8626
- function remove(node, parent) {
8627
- parent.removeChild(node);
8628
- }
8701
+ return element.attachShadow(options);
8702
+ }
8629
8703
 
8630
- function nextSibling(node) {
8631
- return node.nextSibling;
8632
- }
8704
+ function setText(node, content) {
8705
+ node.nodeValue = content;
8706
+ }
8633
8707
 
8634
- function attachShadow(element, options) {
8635
- // `shadowRoot` will be non-null in two cases:
8636
- // 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
8637
- // 2. when a webapp author places <c-app> in their static HTML and mounts their
8638
- // root component with customElement.define('c-app', Ctor)
8639
- if (!isNull(element.shadowRoot)) {
8640
- return element.shadowRoot;
8708
+ function getProperty(node, key) {
8709
+ return node[key];
8641
8710
  }
8642
8711
 
8643
- return element.attachShadow(options);
8644
- }
8712
+ function setProperty(node, key, value) {
8713
+ node[key] = value;
8714
+ }
8645
8715
 
8646
- function setText(node, content) {
8647
- node.nodeValue = content;
8648
- }
8716
+ function getAttribute(element, name, namespace) {
8717
+ return isUndefined(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
8718
+ }
8649
8719
 
8650
- function getProperty(node, key) {
8651
- return node[key];
8652
- }
8720
+ function setAttribute(element, name, value, namespace) {
8721
+ return isUndefined(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8722
+ }
8653
8723
 
8654
- function setProperty(node, key, value) {
8655
- if (process.env.NODE_ENV !== 'production') {
8656
- if (node instanceof Element && !(key in node)) {
8657
- // TODO [#1297]: Move this validation to the compiler
8658
- assert.fail("Unknown public property \"".concat(key, "\" of element <").concat(node.tagName, ">. This is likely a typo on the corresponding attribute \"").concat(htmlPropertyToAttribute(key), "\"."));
8724
+ function removeAttribute(element, name, namespace) {
8725
+ if (isUndefined(namespace)) {
8726
+ element.removeAttribute(name);
8727
+ } else {
8728
+ element.removeAttributeNS(namespace, name);
8659
8729
  }
8660
8730
  }
8661
8731
 
8662
- node[key] = value;
8663
- }
8732
+ function addEventListener(target, type, callback, options) {
8733
+ target.addEventListener(type, callback, options);
8734
+ }
8664
8735
 
8665
- function getAttribute(element, name, namespace) {
8666
- return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
8667
- }
8736
+ function removeEventListener(target, type, callback, options) {
8737
+ target.removeEventListener(type, callback, options);
8738
+ }
8668
8739
 
8669
- function setAttribute(element, name, value, namespace) {
8670
- return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8671
- }
8740
+ function dispatchEvent(target, event) {
8741
+ return target.dispatchEvent(event);
8742
+ }
8672
8743
 
8673
- function removeAttribute(element, name, namespace) {
8674
- if (isUndefined$1(namespace)) {
8675
- element.removeAttribute(name);
8676
- } else {
8677
- element.removeAttributeNS(namespace, name);
8744
+ function getClassList(element) {
8745
+ return element.classList;
8678
8746
  }
8679
- }
8680
8747
 
8681
- function addEventListener(target, type, callback, options) {
8682
- target.addEventListener(type, callback, options);
8683
- }
8748
+ function setCSSStyleProperty(element, name, value, important) {
8749
+ // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8750
+ // represent elements in the engine?
8751
+ element.style.setProperty(name, value, important ? 'important' : '');
8752
+ }
8684
8753
 
8685
- function removeEventListener(target, type, callback, options) {
8686
- target.removeEventListener(type, callback, options);
8687
- }
8754
+ function getBoundingClientRect(element) {
8755
+ return element.getBoundingClientRect();
8756
+ }
8688
8757
 
8689
- function dispatchEvent(target, event) {
8690
- return target.dispatchEvent(event);
8691
- }
8758
+ function querySelector(element, selectors) {
8759
+ return element.querySelector(selectors);
8760
+ }
8692
8761
 
8693
- function getClassList(element) {
8694
- return element.classList;
8695
- }
8762
+ function querySelectorAll(element, selectors) {
8763
+ return element.querySelectorAll(selectors);
8764
+ }
8696
8765
 
8697
- function setCSSStyleProperty(element, name, value, important) {
8698
- // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8699
- // represent elements in the engine?
8700
- element.style.setProperty(name, value, important ? 'important' : '');
8701
- }
8766
+ function getElementsByTagName(element, tagNameOrWildCard) {
8767
+ return element.getElementsByTagName(tagNameOrWildCard);
8768
+ }
8702
8769
 
8703
- function getBoundingClientRect(element) {
8704
- return element.getBoundingClientRect();
8705
- }
8770
+ function getElementsByClassName(element, names) {
8771
+ return element.getElementsByClassName(names);
8772
+ }
8706
8773
 
8707
- function querySelector(element, selectors) {
8708
- return element.querySelector(selectors);
8709
- }
8774
+ function getChildren(element) {
8775
+ return element.children;
8776
+ }
8710
8777
 
8711
- function querySelectorAll(element, selectors) {
8712
- return element.querySelectorAll(selectors);
8713
- }
8778
+ function getChildNodes(element) {
8779
+ return element.childNodes;
8780
+ }
8714
8781
 
8715
- function getElementsByTagName(element, tagNameOrWildCard) {
8716
- return element.getElementsByTagName(tagNameOrWildCard);
8717
- }
8782
+ function getFirstChild(element) {
8783
+ return element.firstChild;
8784
+ }
8718
8785
 
8719
- function getElementsByClassName(element, names) {
8720
- return element.getElementsByClassName(names);
8721
- }
8786
+ function getFirstElementChild(element) {
8787
+ return element.firstElementChild;
8788
+ }
8722
8789
 
8723
- function getChildren(element) {
8724
- return element.children;
8725
- }
8790
+ function getLastChild(element) {
8791
+ return element.lastChild;
8792
+ }
8726
8793
 
8727
- function getChildNodes(element) {
8728
- return element.childNodes;
8729
- }
8794
+ function getLastElementChild(element) {
8795
+ return element.lastElementChild;
8796
+ }
8730
8797
 
8731
- function getFirstChild(element) {
8732
- return element.firstChild;
8733
- }
8798
+ function isConnected(node) {
8799
+ return node.isConnected;
8800
+ }
8734
8801
 
8735
- function getFirstElementChild(element) {
8736
- return element.firstElementChild;
8737
- }
8802
+ function assertInstanceOfHTMLElement(elm, msg) {
8803
+ assertInvariant(elm instanceof HTMLElement, msg);
8804
+ }
8738
8805
 
8739
- function getLastChild(element) {
8740
- return element.lastChild;
8741
- }
8806
+ var HTMLElementExported = HTMLElementConstructor;
8807
+ var renderer = {
8808
+ HTMLElementExported: HTMLElementExported,
8809
+ insert: insert,
8810
+ remove: remove,
8811
+ cloneNode: cloneNode,
8812
+ createFragment: createFragment,
8813
+ createElement: createElement,
8814
+ createText: createText,
8815
+ createComment: createComment,
8816
+ nextSibling: nextSibling,
8817
+ attachShadow: attachShadow,
8818
+ getProperty: getProperty,
8819
+ setProperty: setProperty,
8820
+ setText: setText,
8821
+ getAttribute: getAttribute,
8822
+ setAttribute: setAttribute,
8823
+ removeAttribute: removeAttribute,
8824
+ addEventListener: addEventListener,
8825
+ removeEventListener: removeEventListener,
8826
+ dispatchEvent: dispatchEvent,
8827
+ getClassList: getClassList,
8828
+ setCSSStyleProperty: setCSSStyleProperty,
8829
+ getBoundingClientRect: getBoundingClientRect,
8830
+ querySelector: querySelector,
8831
+ querySelectorAll: querySelectorAll,
8832
+ getElementsByTagName: getElementsByTagName,
8833
+ getElementsByClassName: getElementsByClassName,
8834
+ getChildren: getChildren,
8835
+ getChildNodes: getChildNodes,
8836
+ getFirstChild: getFirstChild,
8837
+ getFirstElementChild: getFirstElementChild,
8838
+ getLastChild: getLastChild,
8839
+ getLastElementChild: getLastElementChild,
8840
+ isConnected: isConnected,
8841
+ assertInstanceOfHTMLElement: assertInstanceOfHTMLElement,
8842
+ defineCustomElement: defineCustomElement,
8843
+ getCustomElement: getCustomElement
8844
+ }; // Meant to inherit any properties passed via the base renderer as the argument to the factory.
8742
8845
 
8743
- function getLastElementChild(element) {
8744
- return element.lastElementChild;
8846
+ Object.setPrototypeOf(renderer, baseRenderer);
8847
+ return renderer;
8745
8848
  }
8849
+ /*
8850
+ * Copyright (c) 2018, salesforce.com, inc.
8851
+ * All rights reserved.
8852
+ * SPDX-License-Identifier: MIT
8853
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8854
+ */
8746
8855
 
8747
- function isConnected(node) {
8748
- return node.isConnected;
8749
- }
8856
+ /**
8857
+ * The base renderer that will be used by engine-core.
8858
+ * This will be used for DOM operations when lwc is running in a browser environment.
8859
+ */
8750
8860
 
8751
- function assertInstanceOfHTMLElement(elm, msg) {
8752
- assert.invariant(elm instanceof HTMLElement, msg);
8753
- }
8754
8861
 
8755
- var HTMLElementExported = HTMLElementConstructor;
8756
- var renderer = {
8757
- isNativeShadowDefined: isNativeShadowDefined,
8758
- isSyntheticShadowDefined: isSyntheticShadowDefined,
8759
- HTMLElementExported: HTMLElementExported,
8760
- insert: insert,
8761
- remove: remove,
8762
- cloneNode: cloneNode,
8763
- createFragment: createFragment,
8764
- createElement: createElement$1,
8765
- createText: createText,
8766
- createComment: createComment,
8767
- nextSibling: nextSibling,
8768
- attachShadow: attachShadow,
8769
- getProperty: getProperty,
8770
- setProperty: setProperty,
8771
- setText: setText,
8772
- getAttribute: getAttribute,
8773
- setAttribute: setAttribute,
8774
- removeAttribute: removeAttribute,
8775
- addEventListener: addEventListener,
8776
- removeEventListener: removeEventListener,
8777
- dispatchEvent: dispatchEvent,
8778
- getClassList: getClassList,
8779
- setCSSStyleProperty: setCSSStyleProperty,
8780
- getBoundingClientRect: getBoundingClientRect,
8781
- querySelector: querySelector,
8782
- querySelectorAll: querySelectorAll,
8783
- getElementsByTagName: getElementsByTagName,
8784
- getElementsByClassName: getElementsByClassName,
8785
- getChildren: getChildren,
8786
- getChildNodes: getChildNodes,
8787
- getFirstChild: getFirstChild,
8788
- getFirstElementChild: getFirstElementChild,
8789
- getLastChild: getLastChild,
8790
- getLastElementChild: getLastElementChild,
8791
- isConnected: isConnected,
8862
+ var renderer = assign( // The base renderer will invoke the factory with null and assign additional properties that are
8863
+ // shared across renderers
8864
+ rendererFactory(null), // Properties that are either not required to be sandboxed or rely on a globally shared information
8865
+ {
8866
+ // insertStyleSheet implementation shares a global cache of stylesheet data
8792
8867
  insertStylesheet: insertStylesheet,
8793
- assertInstanceOfHTMLElement: assertInstanceOfHTMLElement,
8794
- defineCustomElement: defineCustomElement,
8795
- getCustomElement: getCustomElement
8796
- };
8868
+ isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
8869
+ isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN)
8870
+ });
8797
8871
  /*
8798
8872
  * Copyright (c) 2018, salesforce.com, inc.
8799
8873
  * All rights reserved.
@@ -8965,7 +9039,6 @@
8965
9039
  * SPDX-License-Identifier: MIT
8966
9040
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8967
9041
  */
8968
- // TODO [#2472]: Remove this workaround when appropriate.
8969
9042
  // eslint-disable-next-line @lwc/lwc-internal/no-global-node
8970
9043
 
8971
9044
 
@@ -8985,39 +9058,41 @@
8985
9058
  }
8986
9059
 
8987
9060
  return node; // for convenience
8988
- } // Monkey patching Node methods to be able to detect the insertions and removal of root elements
8989
- // created via createElement.
8990
-
9061
+ }
8991
9062
 
8992
- var _Node$1$prototype = _Node$1.prototype,
8993
- _appendChild2 = _Node$1$prototype.appendChild,
8994
- _insertBefore2 = _Node$1$prototype.insertBefore,
8995
- _removeChild2 = _Node$1$prototype.removeChild,
8996
- _replaceChild2 = _Node$1$prototype.replaceChild;
8997
- assign(_Node$1.prototype, {
8998
- appendChild: function appendChild(newChild) {
8999
- var appendedNode = _appendChild2.call(this, newChild);
9063
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
9064
+ // Monkey patching Node methods to be able to detect the insertions and removal of root elements
9065
+ // created via createElement.
9066
+ var _Node$1$prototype = _Node$1.prototype,
9067
+ _appendChild = _Node$1$prototype.appendChild,
9068
+ _insertBefore = _Node$1$prototype.insertBefore,
9069
+ _removeChild = _Node$1$prototype.removeChild,
9070
+ _replaceChild = _Node$1$prototype.replaceChild;
9071
+ assign(_Node$1.prototype, {
9072
+ appendChild: function appendChild(newChild) {
9073
+ var appendedNode = _appendChild.call(this, newChild);
9000
9074
 
9001
- return callNodeSlot(appendedNode, ConnectingSlot);
9002
- },
9003
- insertBefore: function insertBefore(newChild, referenceNode) {
9004
- var insertedNode = _insertBefore2.call(this, newChild, referenceNode);
9075
+ return callNodeSlot(appendedNode, ConnectingSlot);
9076
+ },
9077
+ insertBefore: function insertBefore(newChild, referenceNode) {
9078
+ var insertedNode = _insertBefore.call(this, newChild, referenceNode);
9005
9079
 
9006
- return callNodeSlot(insertedNode, ConnectingSlot);
9007
- },
9008
- removeChild: function removeChild(oldChild) {
9009
- var removedNode = _removeChild2.call(this, oldChild);
9080
+ return callNodeSlot(insertedNode, ConnectingSlot);
9081
+ },
9082
+ removeChild: function removeChild(oldChild) {
9083
+ var removedNode = _removeChild.call(this, oldChild);
9010
9084
 
9011
- return callNodeSlot(removedNode, DisconnectingSlot);
9012
- },
9013
- replaceChild: function replaceChild(newChild, oldChild) {
9014
- var replacedNode = _replaceChild2.call(this, newChild, oldChild);
9085
+ return callNodeSlot(removedNode, DisconnectingSlot);
9086
+ },
9087
+ replaceChild: function replaceChild(newChild, oldChild) {
9088
+ var replacedNode = _replaceChild.call(this, newChild, oldChild);
9015
9089
 
9016
- callNodeSlot(replacedNode, DisconnectingSlot);
9017
- callNodeSlot(newChild, ConnectingSlot);
9018
- return replacedNode;
9019
- }
9020
- });
9090
+ callNodeSlot(replacedNode, DisconnectingSlot);
9091
+ callNodeSlot(newChild, ConnectingSlot);
9092
+ return replacedNode;
9093
+ }
9094
+ });
9095
+ }
9021
9096
  /**
9022
9097
  * EXPERIMENTAL: This function is almost identical to document.createElement with the slightly
9023
9098
  * difference that in the options, you can pass the `is` property set to a Constructor instead of
@@ -9030,6 +9105,7 @@
9030
9105
  * ```
9031
9106
  */
9032
9107
 
9108
+
9033
9109
  function createElement(sel, options) {
9034
9110
  if (!isObject(options) || isNull(options)) {
9035
9111
  throw new TypeError("\"createElement\" function expects an object as second parameter but received \"".concat(toString$1(options), "\"."));
@@ -9057,8 +9133,12 @@
9057
9133
  mode: options.mode !== 'closed' ? 'open' : 'closed',
9058
9134
  owner: null
9059
9135
  });
9060
- ConnectingSlot.set(elm, connectRootElement);
9061
- DisconnectingSlot.set(elm, disconnectRootElement);
9136
+
9137
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
9138
+ ConnectingSlot.set(elm, connectRootElement);
9139
+ DisconnectingSlot.set(elm, disconnectRootElement);
9140
+ }
9141
+
9062
9142
  wasComponentUpgraded = true;
9063
9143
  });
9064
9144
 
@@ -9105,7 +9185,7 @@
9105
9185
  // inserted nodes without the `lwc:dom=manual` directive will be considered as global elements.
9106
9186
 
9107
9187
 
9108
- return isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
9188
+ return renderer.isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
9109
9189
  }
9110
9190
  /*
9111
9191
  * Copyright (c) 2018, salesforce.com, inc.
@@ -9149,7 +9229,7 @@
9149
9229
  });
9150
9230
  freeze(LightningElement);
9151
9231
  seal(LightningElement.prototype);
9152
- /* version: 2.23.1 */
9232
+ /* version: 2.23.2 */
9153
9233
 
9154
9234
  exports.LightningElement = LightningElement;
9155
9235
  exports.__unstable__ProfilerControl = profilerControl;
@@ -9171,6 +9251,7 @@
9171
9251
  exports.registerDecorators = registerDecorators;
9172
9252
  exports.registerTemplate = registerTemplate;
9173
9253
  exports.renderer = renderer;
9254
+ exports.rendererFactory = rendererFactory;
9174
9255
  exports.sanitizeAttribute = sanitizeAttribute;
9175
9256
  exports.setFeatureFlag = setFeatureFlag;
9176
9257
  exports.setFeatureFlagForTest = setFeatureFlagForTest;