lwc 2.20.3 → 2.21.1

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 +41 -61
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +41 -61
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +28 -49
  5. package/dist/engine-dom/iife/es5/engine-dom.js +49 -73
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +37 -58
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +41 -61
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +28 -49
  11. package/dist/engine-dom/umd/es5/engine-dom.js +49 -73
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +37 -58
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +144 -150
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +144 -150
  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
@@ -415,9 +415,9 @@ function htmlEscape(str, attrMode = false) {
415
415
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
416
416
  */
417
417
  // Increment whenever the LWC template compiler changes
418
- const LWC_VERSION = "2.20.3";
418
+ const LWC_VERSION = "2.21.1";
419
419
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
420
- /** version: 2.20.3 */
420
+ /** version: 2.21.1 */
421
421
 
422
422
  /*
423
423
  * Copyright (c) 2020, salesforce.com, inc.
@@ -526,7 +526,7 @@ function setFeatureFlagForTest(name, value) {
526
526
  setFeatureFlag(name, value);
527
527
  }
528
528
  }
529
- /** version: 2.20.3 */
529
+ /** version: 2.21.1 */
530
530
 
531
531
  /* proxy-compat-disable */
532
532
 
@@ -3792,10 +3792,11 @@ function mountElement(vnode, parent, anchor, renderer) {
3792
3792
  const { sel, owner, data: { svg }, } = vnode;
3793
3793
  const { createElement } = renderer;
3794
3794
  const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
3795
- const elm = createElement(sel, namespace);
3795
+ const elm = (vnode.elm = createElement(sel, namespace));
3796
3796
  linkNodeToShadow(elm, owner, renderer);
3797
- fallbackElmHook(elm, vnode, renderer);
3798
- vnode.elm = elm;
3797
+ applyStyleScoping(elm, owner, renderer);
3798
+ applyDomManual(elm, vnode);
3799
+ applyElementRestrictions(elm, vnode);
3799
3800
  patchElementPropsAndAttrs$1(null, vnode, renderer);
3800
3801
  insertNode(elm, parent, anchor, renderer);
3801
3802
  mountVNodes(vnode.children, elm, renderer, null);
@@ -3810,6 +3811,7 @@ function mountStatic(vnode, parent, anchor, renderer) {
3810
3811
  const { cloneNode, isSyntheticShadowDefined } = renderer;
3811
3812
  const elm = (vnode.elm = cloneNode(vnode.fragment, true));
3812
3813
  linkNodeToShadow(elm, owner, renderer);
3814
+ applyElementRestrictions(elm, vnode);
3813
3815
  // Marks this node as Static to propagate the shadow resolver. must happen after elm is assigned to the proper shadow
3814
3816
  const { renderMode, shadowMode } = owner;
3815
3817
  if (isSyntheticShadowDefined) {
@@ -3817,10 +3819,6 @@ function mountStatic(vnode, parent, anchor, renderer) {
3817
3819
  elm[KEY__SHADOW_STATIC] = true;
3818
3820
  }
3819
3821
  }
3820
- if (process.env.NODE_ENV !== 'production') {
3821
- const isLight = renderMode === 0 /* RenderMode.Light */;
3822
- patchElementWithRestrictions(elm, { isPortal: false, isLight });
3823
- }
3824
3822
  insertNode(elm, parent, anchor, renderer);
3825
3823
  }
3826
3824
  function mountCustomElement(vnode, parent, anchor, renderer) {
@@ -3837,9 +3835,10 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
3837
3835
  // the custom element from the registry is expecting an upgrade callback
3838
3836
  vm = createViewModelHook(elm, vnode, renderer);
3839
3837
  });
3840
- linkNodeToShadow(elm, owner, renderer);
3841
3838
  vnode.elm = elm;
3842
3839
  vnode.vm = vm;
3840
+ linkNodeToShadow(elm, owner, renderer);
3841
+ applyStyleScoping(elm, owner, renderer);
3843
3842
  if (vm) {
3844
3843
  allocateChildren(vnode, vm);
3845
3844
  }
@@ -3923,22 +3922,6 @@ function unmountVNodes(vnodes, parent, renderer, doRemove = false, start = 0, en
3923
3922
  function isVNode(vnode) {
3924
3923
  return vnode != null;
3925
3924
  }
3926
- function observeElementChildNodes(elm) {
3927
- elm.$domManual$ = true;
3928
- }
3929
- function setElementShadowToken(elm, token) {
3930
- elm.$shadowToken$ = token;
3931
- }
3932
- // Set the scope token class for *.scoped.css styles
3933
- function setScopeTokenClassIfNecessary(elm, owner, renderer) {
3934
- const token = getScopeTokenClass(owner);
3935
- if (!isNull(token)) {
3936
- const { getClassList } = renderer;
3937
- // TODO [#2762]: this dot notation with add is probably problematic
3938
- // probably we should have a renderer api for just the add operation
3939
- getClassList(elm).add(token);
3940
- }
3941
- }
3942
3925
  function linkNodeToShadow(elm, owner, renderer) {
3943
3926
  const { renderRoot, renderMode, shadowMode } = owner;
3944
3927
  const { isSyntheticShadowDefined } = renderer;
@@ -3991,31 +3974,37 @@ function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
3991
3974
  patchAttributes(oldVnode, vnode, renderer);
3992
3975
  patchProps(oldVnode, vnode, renderer);
3993
3976
  }
3994
- function fallbackElmHook(elm, vnode, renderer) {
3995
- const { owner } = vnode;
3996
- setScopeTokenClassIfNecessary(elm, owner, renderer);
3997
- if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
3998
- const { data: { context }, } = vnode;
3999
- const { stylesheetToken } = owner.context;
4000
- if (!isUndefined$1(context) &&
4001
- !isUndefined$1(context.lwc) &&
4002
- context.lwc.dom === "manual" /* LwcDomMode.Manual */) {
4003
- // this element will now accept any manual content inserted into it
4004
- observeElementChildNodes(elm);
4005
- }
4006
- if (!isUndefined$1(stylesheetToken)) {
4007
- // when running in synthetic shadow mode, we need to set the shadowToken value
4008
- // into each element from the template, so they can be styled accordingly.
4009
- setElementShadowToken(elm, stylesheetToken);
4010
- }
3977
+ function applyStyleScoping(elm, owner, renderer) {
3978
+ // Set the class name for `*.scoped.css` style scoping.
3979
+ const scopeToken = getScopeTokenClass(owner);
3980
+ if (!isNull(scopeToken)) {
3981
+ const { getClassList } = renderer;
3982
+ // TODO [#2762]: this dot notation with add is probably problematic
3983
+ // probably we should have a renderer api for just the add operation
3984
+ getClassList(elm).add(scopeToken);
4011
3985
  }
3986
+ // Set property element for synthetic shadow DOM style scoping.
3987
+ const { stylesheetToken: syntheticToken } = owner.context;
3988
+ if (owner.shadowMode === 1 /* ShadowMode.Synthetic */ && !isUndefined$1(syntheticToken)) {
3989
+ elm.$shadowToken$ = syntheticToken;
3990
+ }
3991
+ }
3992
+ function applyDomManual(elm, vnode) {
3993
+ var _a;
3994
+ const { owner, data: { context }, } = vnode;
3995
+ 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 */) {
3996
+ elm.$domManual$ = true;
3997
+ }
3998
+ }
3999
+ function applyElementRestrictions(elm, vnode) {
4000
+ var _a, _b;
4012
4001
  if (process.env.NODE_ENV !== 'production') {
4013
- const { data: { context }, } = vnode;
4014
- const isPortal = !isUndefined$1(context) &&
4015
- !isUndefined$1(context.lwc) &&
4016
- context.lwc.dom === "manual" /* LwcDomMode.Manual */;
4017
- const isLight = owner.renderMode === 0 /* RenderMode.Light */;
4018
- patchElementWithRestrictions(elm, { isPortal, isLight });
4002
+ 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 */;
4003
+ const isLight = vnode.owner.renderMode === 0 /* RenderMode.Light */;
4004
+ patchElementWithRestrictions(elm, {
4005
+ isPortal,
4006
+ isLight,
4007
+ });
4019
4008
  }
4020
4009
  }
4021
4010
  function allocateChildren(vnode, vm) {
@@ -4050,15 +4039,6 @@ function createViewModelHook(elm, vnode, renderer) {
4050
4039
  return vm;
4051
4040
  }
4052
4041
  const { sel, mode, ctor, owner } = vnode;
4053
- setScopeTokenClassIfNecessary(elm, owner, renderer);
4054
- if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
4055
- const { stylesheetToken } = owner.context;
4056
- // when running in synthetic shadow mode, we need to set the shadowToken value
4057
- // into each element from the template, so they can be styled accordingly.
4058
- if (!isUndefined$1(stylesheetToken)) {
4059
- setElementShadowToken(elm, stylesheetToken);
4060
- }
4061
- }
4062
4042
  vm = createVM(elm, ctor, renderer, {
4063
4043
  mode,
4064
4044
  owner,
@@ -6277,7 +6257,7 @@ function freezeTemplate(tmpl) {
6277
6257
  });
6278
6258
  }
6279
6259
  }
6280
- /* version: 2.20.3 */
6260
+ /* version: 2.21.1 */
6281
6261
 
6282
6262
  /*
6283
6263
  * Copyright (c) 2020, salesforce.com, inc.
@@ -6285,6 +6265,16 @@ function freezeTemplate(tmpl) {
6285
6265
  * SPDX-License-Identifier: MIT
6286
6266
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6287
6267
  */
6268
+ // We use Symbols as the keys for HostElement properties to avoid conflicting
6269
+ // with public component properties defined by a component author.
6270
+ const HostNamespaceKey = Symbol('namespace');
6271
+ const HostTypeKey = Symbol('type');
6272
+ const HostParentKey = Symbol('parent');
6273
+ const HostShadowRootKey = Symbol('shadow-root');
6274
+ const HostChildrenKey = Symbol('children');
6275
+ const HostAttributesKey = Symbol('attributes');
6276
+ const HostEventListenersKey = Symbol('event-listeners');
6277
+ const HostValueKey = Symbol('value');
6288
6278
  var HostNodeType;
6289
6279
  (function (HostNodeType) {
6290
6280
  HostNodeType["Text"] = "text";
@@ -6319,16 +6309,16 @@ function unsupportedMethod(name) {
6319
6309
  throw new TypeError(`"${name}" is not supported in this environment`);
6320
6310
  };
6321
6311
  }
6322
- function createElement(name, namespace) {
6312
+ function createElement(tagName, namespace) {
6323
6313
  return {
6324
- type: HostNodeType.Element,
6325
- name,
6326
- namespace: namespace !== null && namespace !== void 0 ? namespace : HTML_NAMESPACE,
6327
- parent: null,
6328
- shadowRoot: null,
6329
- children: [],
6330
- attributes: [],
6331
- eventListeners: {},
6314
+ [HostTypeKey]: HostNodeType.Element,
6315
+ tagName,
6316
+ [HostNamespaceKey]: namespace !== null && namespace !== void 0 ? namespace : HTML_NAMESPACE,
6317
+ [HostParentKey]: null,
6318
+ [HostShadowRootKey]: null,
6319
+ [HostChildrenKey]: [],
6320
+ [HostAttributesKey]: [],
6321
+ [HostEventListenersKey]: {},
6332
6322
  };
6333
6323
  }
6334
6324
  const registry = create(null);
@@ -6343,11 +6333,11 @@ function registerCustomElement(name, ctor) {
6343
6333
  class HTMLElementImpl {
6344
6334
  constructor() {
6345
6335
  const { constructor } = this;
6346
- const name = reverseRegistry.get(constructor);
6347
- if (!name) {
6336
+ const tagName = reverseRegistry.get(constructor);
6337
+ if (!tagName) {
6348
6338
  throw new TypeError(`Invalid Construction`);
6349
6339
  }
6350
- return createElement(name);
6340
+ return createElement(tagName);
6351
6341
  }
6352
6342
  }
6353
6343
  const ssr = true;
@@ -6357,73 +6347,74 @@ function isHydrating() {
6357
6347
  const isNativeShadowDefined = false;
6358
6348
  const isSyntheticShadowDefined = false;
6359
6349
  function insert(node, parent, anchor) {
6360
- if (node.parent !== null && node.parent !== parent) {
6361
- const nodeIndex = node.parent.children.indexOf(node);
6362
- node.parent.children.splice(nodeIndex, 1);
6350
+ const nodeParent = node[HostParentKey];
6351
+ if (nodeParent !== null && nodeParent !== parent) {
6352
+ const nodeIndex = nodeParent[HostChildrenKey].indexOf(node);
6353
+ nodeParent[HostChildrenKey].splice(nodeIndex, 1);
6363
6354
  }
6364
- node.parent = parent;
6365
- const anchorIndex = isNull(anchor) ? -1 : parent.children.indexOf(anchor);
6355
+ node[HostParentKey] = parent;
6356
+ const anchorIndex = isNull(anchor) ? -1 : parent[HostChildrenKey].indexOf(anchor);
6366
6357
  if (anchorIndex === -1) {
6367
- parent.children.push(node);
6358
+ parent[HostChildrenKey].push(node);
6368
6359
  }
6369
6360
  else {
6370
- parent.children.splice(anchorIndex, 0, node);
6361
+ parent[HostChildrenKey].splice(anchorIndex, 0, node);
6371
6362
  }
6372
6363
  }
6373
6364
  function remove(node, parent) {
6374
- const nodeIndex = parent.children.indexOf(node);
6375
- parent.children.splice(nodeIndex, 1);
6365
+ const nodeIndex = parent[HostChildrenKey].indexOf(node);
6366
+ parent[HostChildrenKey].splice(nodeIndex, 1);
6376
6367
  }
6377
6368
  function cloneNode(node) {
6378
6369
  return node;
6379
6370
  }
6380
6371
  function createFragment(html) {
6381
6372
  return {
6382
- type: HostNodeType.Raw,
6383
- parent: null,
6384
- value: html,
6373
+ [HostTypeKey]: HostNodeType.Raw,
6374
+ [HostParentKey]: null,
6375
+ [HostValueKey]: html,
6385
6376
  };
6386
6377
  }
6387
6378
  function createText(content) {
6388
6379
  return {
6389
- type: HostNodeType.Text,
6390
- value: String(content),
6391
- parent: null,
6380
+ [HostTypeKey]: HostNodeType.Text,
6381
+ [HostValueKey]: String(content),
6382
+ [HostParentKey]: null,
6392
6383
  };
6393
6384
  }
6394
6385
  function createComment(content) {
6395
6386
  return {
6396
- type: HostNodeType.Comment,
6397
- value: content,
6398
- parent: null,
6387
+ [HostTypeKey]: HostNodeType.Comment,
6388
+ [HostValueKey]: content,
6389
+ [HostParentKey]: null,
6399
6390
  };
6400
6391
  }
6401
6392
  function nextSibling(node) {
6402
- const { parent } = node;
6393
+ const parent = node[HostParentKey];
6403
6394
  if (isNull(parent)) {
6404
6395
  return null;
6405
6396
  }
6406
- const nodeIndex = parent.children.indexOf(node);
6407
- return parent.children[nodeIndex + 1] || null;
6397
+ const nodeIndex = parent[HostChildrenKey].indexOf(node);
6398
+ return parent[HostChildrenKey][nodeIndex + 1] || null;
6408
6399
  }
6409
6400
  function attachShadow(element, config) {
6410
- element.shadowRoot = {
6411
- type: HostNodeType.ShadowRoot,
6412
- children: [],
6401
+ element[HostShadowRootKey] = {
6402
+ [HostTypeKey]: HostNodeType.ShadowRoot,
6403
+ [HostChildrenKey]: [],
6413
6404
  mode: config.mode,
6414
6405
  delegatesFocus: !!config.delegatesFocus,
6415
6406
  };
6416
- return element.shadowRoot;
6407
+ return element[HostShadowRootKey];
6417
6408
  }
6418
6409
  function getProperty(node, key) {
6419
6410
  var _a, _b;
6420
6411
  if (key in node) {
6421
6412
  return node[key];
6422
6413
  }
6423
- if (node.type === HostNodeType.Element) {
6414
+ if (node[HostTypeKey] === HostNodeType.Element) {
6424
6415
  const attrName = htmlPropertyToAttribute(key);
6425
6416
  // Handle all the boolean properties.
6426
- if (isBooleanAttribute(attrName, node.name)) {
6417
+ if (isBooleanAttribute(attrName, node.tagName)) {
6427
6418
  return (_a = getAttribute(node, attrName)) !== null && _a !== void 0 ? _a : false;
6428
6419
  }
6429
6420
  // Handle global html attributes and AOM.
@@ -6432,7 +6423,7 @@ function getProperty(node, key) {
6432
6423
  }
6433
6424
  // Handle special elements live bindings. The checked property is already handled above
6434
6425
  // in the boolean case.
6435
- if (node.name === 'input' && key === 'value') {
6426
+ if (node.tagName === 'input' && key === 'value') {
6436
6427
  return (_b = getAttribute(node, 'value')) !== null && _b !== void 0 ? _b : '';
6437
6428
  }
6438
6429
  }
@@ -6445,20 +6436,20 @@ function setProperty(node, key, value) {
6445
6436
  if (key in node) {
6446
6437
  return (node[key] = value);
6447
6438
  }
6448
- if (node.type === HostNodeType.Element) {
6439
+ if (node[HostTypeKey] === HostNodeType.Element) {
6449
6440
  const attrName = htmlPropertyToAttribute(key);
6450
6441
  if (key === 'innerHTML') {
6451
- node.children = [
6442
+ node[HostChildrenKey] = [
6452
6443
  {
6453
- type: HostNodeType.Raw,
6454
- parent: node,
6455
- value,
6444
+ [HostTypeKey]: HostNodeType.Raw,
6445
+ [HostParentKey]: node,
6446
+ [HostValueKey]: value,
6456
6447
  },
6457
6448
  ];
6458
6449
  return;
6459
6450
  }
6460
6451
  // Handle all the boolean properties.
6461
- if (isBooleanAttribute(attrName, node.name)) {
6452
+ if (isBooleanAttribute(attrName, node.tagName)) {
6462
6453
  return value === true
6463
6454
  ? setAttribute(node, attrName, '')
6464
6455
  : removeAttribute(node, attrName);
@@ -6469,7 +6460,7 @@ function setProperty(node, key, value) {
6469
6460
  }
6470
6461
  // Handle special elements live bindings. The checked property is already handled above
6471
6462
  // in the boolean case.
6472
- if (node.name === 'input' && attrName === 'value') {
6463
+ if (node.tagName === 'input' && attrName === 'value') {
6473
6464
  return isNull(value) || isUndefined$1(value)
6474
6465
  ? removeAttribute(node, 'value')
6475
6466
  : setAttribute(node, 'value', value);
@@ -6481,32 +6472,32 @@ function setProperty(node, key, value) {
6481
6472
  }
6482
6473
  }
6483
6474
  function setText(node, content) {
6484
- if (node.type === HostNodeType.Text) {
6485
- node.value = content;
6475
+ if (node[HostTypeKey] === HostNodeType.Text) {
6476
+ node[HostValueKey] = content;
6486
6477
  }
6487
- else if (node.type === HostNodeType.Element) {
6488
- node.children = [
6478
+ else if (node[HostTypeKey] === HostNodeType.Element) {
6479
+ node[HostChildrenKey] = [
6489
6480
  {
6490
- type: HostNodeType.Text,
6491
- parent: node,
6492
- value: content,
6481
+ [HostTypeKey]: HostNodeType.Text,
6482
+ [HostParentKey]: node,
6483
+ [HostValueKey]: content,
6493
6484
  },
6494
6485
  ];
6495
6486
  }
6496
6487
  }
6497
6488
  function getAttribute(element, name, namespace = null) {
6498
- const attribute = element.attributes.find((attr) => attr.name === name && attr.namespace === namespace);
6489
+ const attribute = element[HostAttributesKey].find((attr) => attr.name === name && attr[HostNamespaceKey] === namespace);
6499
6490
  return attribute ? attribute.value : null;
6500
6491
  }
6501
6492
  function setAttribute(element, name, value, namespace = null) {
6502
- const attribute = element.attributes.find((attr) => attr.name === name && attr.namespace === namespace);
6493
+ const attribute = element[HostAttributesKey].find((attr) => attr.name === name && attr[HostNamespaceKey] === namespace);
6503
6494
  if (isUndefined$1(namespace)) {
6504
6495
  namespace = null;
6505
6496
  }
6506
6497
  if (isUndefined$1(attribute)) {
6507
- element.attributes.push({
6498
+ element[HostAttributesKey].push({
6508
6499
  name,
6509
- namespace,
6500
+ [HostNamespaceKey]: namespace,
6510
6501
  value: String(value),
6511
6502
  });
6512
6503
  }
@@ -6515,18 +6506,18 @@ function setAttribute(element, name, value, namespace = null) {
6515
6506
  }
6516
6507
  }
6517
6508
  function removeAttribute(element, name, namespace) {
6518
- element.attributes = element.attributes.filter((attr) => attr.name !== name && attr.namespace !== namespace);
6509
+ element[HostAttributesKey] = element[HostAttributesKey].filter((attr) => attr.name !== name && attr[HostNamespaceKey] !== namespace);
6519
6510
  }
6520
6511
  function getClassList(element) {
6521
6512
  function getClassAttribute() {
6522
- let classAttribute = element.attributes.find((attr) => attr.name === 'class' && isNull(attr.namespace));
6513
+ let classAttribute = element[HostAttributesKey].find((attr) => attr.name === 'class' && isNull(attr[HostNamespaceKey]));
6523
6514
  if (isUndefined$1(classAttribute)) {
6524
6515
  classAttribute = {
6525
6516
  name: 'class',
6526
- namespace: null,
6517
+ [HostNamespaceKey]: null,
6527
6518
  value: '',
6528
6519
  };
6529
- element.attributes.push(classAttribute);
6520
+ element[HostAttributesKey].push(classAttribute);
6530
6521
  }
6531
6522
  return classAttribute;
6532
6523
  }
@@ -6546,12 +6537,12 @@ function getClassList(element) {
6546
6537
  };
6547
6538
  }
6548
6539
  function setCSSStyleProperty(element, name, value, important) {
6549
- const styleAttribute = element.attributes.find((attr) => attr.name === 'style' && isNull(attr.namespace));
6540
+ const styleAttribute = element[HostAttributesKey].find((attr) => attr.name === 'style' && isNull(attr[HostNamespaceKey]));
6550
6541
  const serializedProperty = `${name}: ${value}${important ? ' !important' : ''}`;
6551
6542
  if (isUndefined$1(styleAttribute)) {
6552
- element.attributes.push({
6543
+ element[HostAttributesKey].push({
6553
6544
  name: 'style',
6554
- namespace: null,
6545
+ [HostNamespaceKey]: null,
6555
6546
  value: serializedProperty,
6556
6547
  });
6557
6548
  }
@@ -6560,7 +6551,7 @@ function setCSSStyleProperty(element, name, value, important) {
6560
6551
  }
6561
6552
  }
6562
6553
  function isConnected(node) {
6563
- return !isNull(node.parent);
6554
+ return !isNull(node[HostParentKey]);
6564
6555
  }
6565
6556
  // Noop on SSR (for now). This need to be reevaluated whenever we will implement support for
6566
6557
  // synthetic shadow.
@@ -6648,13 +6639,13 @@ function serializeAttributes(attributes) {
6648
6639
  function serializeChildNodes(children) {
6649
6640
  return children
6650
6641
  .map((child) => {
6651
- switch (child.type) {
6642
+ switch (child[HostTypeKey]) {
6652
6643
  case HostNodeType.Text:
6653
- return child.value === '' ? '\u200D' : htmlEscape(child.value);
6644
+ return child[HostValueKey] === '' ? '\u200D' : htmlEscape(child[HostValueKey]);
6654
6645
  case HostNodeType.Comment:
6655
- return `<!--${htmlEscape(child.value)}-->`;
6646
+ return `<!--${htmlEscape(child[HostValueKey])}-->`;
6656
6647
  case HostNodeType.Raw:
6657
- return child.value;
6648
+ return child[HostValueKey];
6658
6649
  case HostNodeType.Element:
6659
6650
  return serializeElement(child);
6660
6651
  }
@@ -6666,27 +6657,30 @@ function serializeShadowRoot(shadowRoot) {
6666
6657
  if (shadowRoot.delegatesFocus) {
6667
6658
  attrs.push('shadowrootdelegatesfocus');
6668
6659
  }
6669
- return `<template ${attrs.join(' ')}>${serializeChildNodes(shadowRoot.children)}</template>`;
6660
+ return `<template ${attrs.join(' ')}>${serializeChildNodes(shadowRoot[HostChildrenKey])}</template>`;
6670
6661
  }
6671
6662
  function serializeElement(element) {
6672
6663
  let output = '';
6673
- const { name, namespace } = element;
6664
+ const tagName = element.tagName;
6665
+ const namespace = element[HostNamespaceKey];
6674
6666
  const isForeignElement = namespace !== HTML_NAMESPACE;
6675
- const hasChildren = element.children.length > 0;
6676
- const attrs = element.attributes.length ? ` ${serializeAttributes(element.attributes)}` : '';
6677
- output += `<${name}${attrs}`;
6667
+ const hasChildren = element[HostChildrenKey].length > 0;
6668
+ const attrs = element[HostAttributesKey].length
6669
+ ? ` ${serializeAttributes(element[HostAttributesKey])}`
6670
+ : '';
6671
+ output += `<${tagName}${attrs}`;
6678
6672
  // Note that foreign elements can have children but not shadow roots
6679
6673
  if (isForeignElement && !hasChildren) {
6680
6674
  output += '/>';
6681
6675
  return output;
6682
6676
  }
6683
6677
  output += '>';
6684
- if (element.shadowRoot) {
6685
- output += serializeShadowRoot(element.shadowRoot);
6678
+ if (element[HostShadowRootKey]) {
6679
+ output += serializeShadowRoot(element[HostShadowRootKey]);
6686
6680
  }
6687
- output += serializeChildNodes(element.children);
6688
- if (!isVoidElement(name, namespace) || hasChildren) {
6689
- output += `</${name}>`;
6681
+ output += serializeChildNodes(element[HostChildrenKey]);
6682
+ if (!isVoidElement(tagName, namespace) || hasChildren) {
6683
+ output += `</${tagName}>`;
6690
6684
  }
6691
6685
  return output;
6692
6686
  }
@@ -6698,14 +6692,14 @@ function serializeElement(element) {
6698
6692
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6699
6693
  */
6700
6694
  const FakeRootElement = {
6701
- type: HostNodeType.Element,
6702
- name: 'fake-root-element',
6703
- namespace: HTML_NAMESPACE,
6704
- parent: null,
6705
- shadowRoot: null,
6706
- children: [],
6707
- attributes: [],
6708
- eventListeners: {},
6695
+ [HostTypeKey]: HostNodeType.Element,
6696
+ tagName: 'fake-root-element',
6697
+ [HostNamespaceKey]: HTML_NAMESPACE,
6698
+ [HostParentKey]: null,
6699
+ [HostShadowRootKey]: null,
6700
+ [HostChildrenKey]: [],
6701
+ [HostAttributesKey]: [],
6702
+ [HostEventListenersKey]: {},
6709
6703
  };
6710
6704
  function renderComponent(tagName, Ctor, props = {}) {
6711
6705
  if (!isString(tagName)) {
@@ -6726,7 +6720,7 @@ function renderComponent(tagName, Ctor, props = {}) {
6726
6720
  for (const [key, value] of Object.entries(props)) {
6727
6721
  element[key] = value;
6728
6722
  }
6729
- element.parent = FakeRootElement;
6723
+ element[HostParentKey] = FakeRootElement;
6730
6724
  connectRootElement(element);
6731
6725
  return serializeElement(element);
6732
6726
  }
@@ -6739,6 +6733,6 @@ function renderComponent(tagName, Ctor, props = {}) {
6739
6733
  */
6740
6734
  freeze(LightningElement);
6741
6735
  seal(LightningElement.prototype);
6742
- /* version: 2.20.3 */
6736
+ /* version: 2.21.1 */
6743
6737
 
6744
6738
  export { LightningElement, api$1 as api, createContextProvider, freezeTemplate, getComponentDef, isComponentConstructor, parseFragment, parseFragment as parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderComponent, renderer, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, track, unwrap, wire };
@@ -148,7 +148,7 @@ const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
148
148
  // We use this to detect symbol support in order to avoid the expensive symbol polyfill. Note that
149
149
  // we can't use typeof since it will fail when transpiling.
150
150
  const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === 'Symbol(x)')();
151
- /** version: 2.20.3 */
151
+ /** version: 2.21.1 */
152
152
 
153
153
  /*
154
154
  * Copyright (c) 2018, salesforce.com, inc.
@@ -1124,7 +1124,7 @@ if (!_globalThis.lwcRuntimeFlags) {
1124
1124
  Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
1125
1125
  }
1126
1126
  const runtimeFlags = _globalThis.lwcRuntimeFlags;
1127
- /** version: 2.20.3 */
1127
+ /** version: 2.21.1 */
1128
1128
 
1129
1129
  /*
1130
1130
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5111,4 +5111,4 @@ if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
5111
5111
  }));
5112
5112
  });
5113
5113
  }
5114
- /** version: 2.20.3 */
5114
+ /** version: 2.21.1 */
@@ -151,7 +151,7 @@
151
151
  // We use this to detect symbol support in order to avoid the expensive symbol polyfill. Note that
152
152
  // we can't use typeof since it will fail when transpiling.
153
153
  const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === 'Symbol(x)')();
154
- /** version: 2.20.3 */
154
+ /** version: 2.21.1 */
155
155
 
156
156
  /*
157
157
  * Copyright (c) 2018, salesforce.com, inc.
@@ -1127,7 +1127,7 @@
1127
1127
  Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
1128
1128
  }
1129
1129
  const runtimeFlags = _globalThis.lwcRuntimeFlags;
1130
- /** version: 2.20.3 */
1130
+ /** version: 2.21.1 */
1131
1131
 
1132
1132
  /*
1133
1133
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5114,6 +5114,6 @@
5114
5114
  }));
5115
5115
  });
5116
5116
  }
5117
- /** version: 2.20.3 */
5117
+ /** version: 2.21.1 */
5118
5118
 
5119
5119
  })();
@@ -87,7 +87,7 @@
87
87
  const KEY__SHADOW_TOKEN = '$shadowToken$';
88
88
  const KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
89
89
  const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
90
- /** version: 2.20.3 */
90
+ /** version: 2.21.1 */
91
91
 
92
92
  /*
93
93
  * Copyright (c) 2018, salesforce.com, inc.
@@ -1049,7 +1049,7 @@
1049
1049
  Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
1050
1050
  }
1051
1051
  const runtimeFlags = _globalThis.lwcRuntimeFlags;
1052
- /** version: 2.20.3 */
1052
+ /** version: 2.21.1 */
1053
1053
 
1054
1054
  /*
1055
1055
  * Copyright (c) 2018, salesforce.com, inc.
@@ -4911,6 +4911,6 @@
4911
4911
  },
4912
4912
  configurable: true,
4913
4913
  });
4914
- /** version: 2.20.3 */
4914
+ /** version: 2.21.1 */
4915
4915
 
4916
4916
  })();
@@ -199,7 +199,7 @@
199
199
  var hasNativeSymbolSupport = /*@__PURE__*/function () {
200
200
  return Symbol('x').toString() === 'Symbol(x)';
201
201
  }();
202
- /** version: 2.20.3 */
202
+ /** version: 2.21.1 */
203
203
 
204
204
  /*
205
205
  * Copyright (c) 2018, salesforce.com, inc.
@@ -1300,7 +1300,7 @@
1300
1300
  }
1301
1301
 
1302
1302
  var runtimeFlags = _globalThis.lwcRuntimeFlags;
1303
- /** version: 2.20.3 */
1303
+ /** version: 2.21.1 */
1304
1304
 
1305
1305
  /*
1306
1306
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5661,6 +5661,6 @@
5661
5661
  }));
5662
5662
  });
5663
5663
  }
5664
- /** version: 2.20.3 */
5664
+ /** version: 2.21.1 */
5665
5665
 
5666
5666
  })();