lwc 2.27.0 → 2.28.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 (37) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +95 -32
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +95 -32
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +79 -30
  5. package/dist/engine-dom/iife/es5/engine-dom.js +134 -46
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +115 -44
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +95 -32
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +79 -30
  11. package/dist/engine-dom/umd/es5/engine-dom.js +134 -46
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +115 -44
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +57 -26
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +57 -26
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +4 -4
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +4 -4
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +4 -4
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
  23. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +4 -4
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +4 -4
  26. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  28. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  29. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  30. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  31. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  33. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  34. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  35. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  36. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  37. package/package.json +7 -7
@@ -348,7 +348,7 @@ var LWC = (function (exports) {
348
348
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
349
349
  return attributeName;
350
350
  }
351
- /** version: 2.27.0 */
351
+ /** version: 2.28.0 */
352
352
 
353
353
  /**
354
354
  * Copyright (C) 2018 salesforce.com, inc.
@@ -442,7 +442,7 @@ var LWC = (function (exports) {
442
442
  patch$1(propName);
443
443
  }
444
444
  }
445
- /** version: 2.27.0 */
445
+ /** version: 2.28.0 */
446
446
 
447
447
  /**
448
448
  * Copyright (C) 2018 salesforce.com, inc.
@@ -3832,9 +3832,14 @@ var LWC = (function (exports) {
3832
3832
  if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
3833
3833
  disconnectRootElement(elm);
3834
3834
  }
3835
- };
3835
+ }; // Should never get a tag with upper case letter at this point; the compiler
3836
+ // should produce only tags with lowercase letters. However, the Java
3837
+ // compiler may generate tagnames with uppercase letters so - for backwards
3838
+ // compatibility, we lower case the tagname here.
3839
+
3836
3840
 
3837
- var elm = createCustomElement(sel, upgradeCallback, connectedCallback, disconnectedCallback);
3841
+ var normalizedTagname = sel.toLowerCase();
3842
+ var elm = createCustomElement(normalizedTagname, upgradeCallback, connectedCallback, disconnectedCallback);
3838
3843
  vnode.elm = elm;
3839
3844
  vnode.vm = vm;
3840
3845
  linkNodeToShadow(elm, owner, renderer);
@@ -4445,27 +4450,42 @@ var LWC = (function (exports) {
4445
4450
  function s(slotName, data, children, slotset) {
4446
4451
 
4447
4452
  if (!isUndefined$1(slotset) && !isUndefined$1(slotset.slotAssignments) && !isUndefined$1(slotset.slotAssignments[slotName]) && slotset.slotAssignments[slotName].length !== 0) {
4448
- children = slotset.slotAssignments[slotName].reduce(function (acc, vnode) {
4449
- // If the passed slot content is factory, evaluate it and use the produced vnodes
4450
- if (vnode && isVScopedSlotFragment(vnode)) {
4451
- var vmBeingRenderedInception = getVMBeingRendered();
4452
- var _children = []; // Evaluate in the scope of the slot content's owner
4453
- // if a slotset is provided, there will always be an owner. The only case where owner is
4454
- // undefined is for root components, but root components cannot accept slotted content
4455
-
4456
- setVMBeingRendered(slotset.owner);
4457
-
4458
- try {
4459
- _children = vnode.factory(data.slotData);
4460
- } finally {
4461
- setVMBeingRendered(vmBeingRenderedInception);
4462
- }
4453
+ children = slotset.slotAssignments[slotName].reduce(function (accumulator, vnode) {
4454
+ if (vnode) {
4455
+ var assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode); // The only sniff test for a scoped <slot> element is the presence of `slotData`
4463
4456
 
4464
- return ArrayConcat$1.call(acc, _children);
4465
- } else {
4466
- // If the slot content is a static list of child nodes provided by the parent, nothing to do
4467
- return ArrayConcat$1.call(acc, vnode);
4457
+ var isScopedSlotElement = !isUndefined$1(data.slotData); // Check if slot types of parent and child are matching
4458
+
4459
+ if (assignedNodeIsScopedSlot !== isScopedSlotElement) {
4460
+
4461
+
4462
+ return accumulator;
4463
+ } // If the passed slot content is factory, evaluate it and add the produced vnodes
4464
+
4465
+
4466
+ if (assignedNodeIsScopedSlot) {
4467
+ var vmBeingRenderedInception = getVMBeingRendered();
4468
+ var scopedSlotChildren = []; // Evaluate in the scope of the slot content's owner
4469
+ // if a slotset is provided, there will always be an owner. The only case where owner is
4470
+ // undefined is for root components, but root components cannot accept slotted content
4471
+
4472
+ setVMBeingRendered(slotset.owner);
4473
+
4474
+ try {
4475
+ scopedSlotChildren = vnode.factory(data.slotData);
4476
+ } finally {
4477
+ setVMBeingRendered(vmBeingRenderedInception);
4478
+ }
4479
+
4480
+ return ArrayConcat$1.call(accumulator, scopedSlotChildren);
4481
+ } else {
4482
+ // If the slot content is standard type, the content is static, no additional
4483
+ // processing needed on the vnode
4484
+ return ArrayConcat$1.call(accumulator, vnode);
4485
+ }
4468
4486
  }
4487
+
4488
+ return accumulator;
4469
4489
  }, []);
4470
4490
  }
4471
4491
 
@@ -6713,7 +6733,7 @@ var LWC = (function (exports) {
6713
6733
 
6714
6734
  return ctor;
6715
6735
  }
6716
- /* version: 2.27.0 */
6736
+ /* version: 2.28.0 */
6717
6737
 
6718
6738
  /*
6719
6739
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7039,10 +7059,12 @@ var LWC = (function (exports) {
7039
7059
  var pendingRegistryForElement = new WeakMap();
7040
7060
  var definitionForConstructor = new WeakMap();
7041
7061
  var registeredUserCtors = new WeakSet();
7062
+ var registeredPivotCtors = new WeakSet();
7042
7063
  var pivotCtorByTag = new Map();
7043
7064
  var globalDefinitionsByTag = new Map();
7044
7065
  var globalDefinitionsByClass = new Map();
7045
7066
  var awaitingUpgrade = new Map();
7067
+ var pendingWhenDefinedCallbacks = new Map();
7046
7068
  var EMPTY_SET = new Set();
7047
7069
 
7048
7070
  function createDefinitionRecord(constructor) {
@@ -7184,6 +7206,7 @@ var LWC = (function (exports) {
7184
7206
  }(NativeHTMLElement);
7185
7207
 
7186
7208
  PivotCtor.observedAttributes = _toConsumableArray(registeredDefinition.observedAttributes);
7209
+ registeredPivotCtors.add(PivotCtor);
7187
7210
  return PivotCtor;
7188
7211
  }
7189
7212
 
@@ -7334,6 +7357,43 @@ var LWC = (function (exports) {
7334
7357
  }
7335
7358
 
7336
7359
  return createDefinitionRecord(constructor);
7360
+ } // Defer a `whenDefined()` callback until an externally-visible custom element is defined
7361
+
7362
+
7363
+ function createPendingWhenDefinedCallback(tagName) {
7364
+ return new Promise(function (resolve) {
7365
+ var resolvers = pendingWhenDefinedCallbacks.get(tagName);
7366
+
7367
+ if (isUndefined$1(resolvers)) {
7368
+ resolvers = [];
7369
+ pendingWhenDefinedCallbacks.set(tagName, resolvers);
7370
+ }
7371
+
7372
+ resolvers.push(resolve);
7373
+ });
7374
+ } // Call any pending `whenDefined()` callbacks
7375
+
7376
+
7377
+ function flushPendingWhenDefinedCallbacks(tagName, ctor) {
7378
+ var resolvers = pendingWhenDefinedCallbacks.get(tagName);
7379
+
7380
+ if (!isUndefined$1(resolvers)) {
7381
+ var _iterator6 = _createForOfIteratorHelper(resolvers),
7382
+ _step6;
7383
+
7384
+ try {
7385
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7386
+ var resolver = _step6.value;
7387
+ resolver(ctor);
7388
+ }
7389
+ } catch (err) {
7390
+ _iterator6.e(err);
7391
+ } finally {
7392
+ _iterator6.f();
7393
+ }
7394
+ }
7395
+
7396
+ pendingWhenDefinedCallbacks.delete(tagName);
7337
7397
  }
7338
7398
 
7339
7399
  var _window2 = window,
@@ -7388,12 +7448,12 @@ var LWC = (function (exports) {
7388
7448
  if (!isUndefined$1(awaiting)) {
7389
7449
  awaitingUpgrade.delete(tagName);
7390
7450
 
7391
- var _iterator6 = _createForOfIteratorHelper(awaiting),
7392
- _step6;
7451
+ var _iterator7 = _createForOfIteratorHelper(awaiting),
7452
+ _step7;
7393
7453
 
7394
7454
  try {
7395
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7396
- var element = _step6.value;
7455
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7456
+ var element = _step7.value;
7397
7457
  var registeredDefinition = pendingRegistryForElement.get(element); // At this point, registeredDefinition should never be undefined because awaitingUpgrade
7398
7458
  // is only populated when we haven't run internalUpgrade yet, and we only populate
7399
7459
  // pendingRegistryForElement when internalUpgrade hasn't run yet.
@@ -7405,11 +7465,14 @@ var LWC = (function (exports) {
7405
7465
  }
7406
7466
  }
7407
7467
  } catch (err) {
7408
- _iterator6.e(err);
7468
+ _iterator7.e(err);
7409
7469
  } finally {
7410
- _iterator6.f();
7470
+ _iterator7.f();
7411
7471
  }
7412
- }
7472
+ } // If anyone called customElements.whenDefined() and is still waiting for a promise resolution, resolve now
7473
+
7474
+
7475
+ flushPendingWhenDefinedCallbacks(tagName, constructor);
7413
7476
  };
7414
7477
 
7415
7478
  CustomElementRegistry.prototype.get = function get(tagName) {
@@ -7420,10 +7483,13 @@ var LWC = (function (exports) {
7420
7483
 
7421
7484
  if (!isUndefined$1(definition)) {
7422
7485
  return definition.UserCtor; // defined by the patched custom elements registry
7423
- } // TODO [#3073]: return undefined rather than the pivot constructor (NativeCtor)
7486
+ }
7424
7487
 
7488
+ if (registeredPivotCtors.has(NativeCtor)) {
7489
+ return undefined; // pivot constructors should not be observable, return undefined
7490
+ }
7425
7491
 
7426
- return NativeCtor; // return the pivot constructor or constructor that existed before patching
7492
+ return NativeCtor; // constructor that existed before patching
7427
7493
  }
7428
7494
  };
7429
7495
 
@@ -7433,15 +7499,20 @@ var LWC = (function (exports) {
7433
7499
 
7434
7500
  if (!isUndefined$1(definition)) {
7435
7501
  return definition.UserCtor;
7436
- } // TODO [#3073]: return undefined rather than the pivot constructor (NativeCtor)
7437
- // In this case, the custom element must have been defined before the registry patches
7502
+ } // In this case, the custom element must have been defined before the registry patches
7438
7503
  // were applied. So return the non-pivot constructor
7439
7504
 
7440
7505
 
7441
7506
  if (isUndefined$1(NativeCtor)) {
7442
7507
  // Chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1335247
7443
7508
  // We can patch the correct behavior using customElements.get()
7444
- return nativeGet.call(nativeRegistry, tagName);
7509
+ NativeCtor = nativeGet.call(nativeRegistry, tagName);
7510
+ }
7511
+
7512
+ if (registeredPivotCtors.has(NativeCtor)) {
7513
+ // Pivot constructors should not be observable. Wait to resolve the promise
7514
+ // if a constructor is ever defined in userland
7515
+ return createPendingWhenDefinedCallback(tagName);
7445
7516
  }
7446
7517
 
7447
7518
  return NativeCtor;
@@ -7705,7 +7776,7 @@ var LWC = (function (exports) {
7705
7776
  function isNull(obj) {
7706
7777
  return obj === null;
7707
7778
  }
7708
- /** version: 2.27.0 */
7779
+ /** version: 2.28.0 */
7709
7780
 
7710
7781
  /*
7711
7782
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7773,18 +7844,18 @@ var LWC = (function (exports) {
7773
7844
  var wrapperTags = topLevelWrappingMap[getTagName(html)];
7774
7845
 
7775
7846
  if (!isUndefined(wrapperTags)) {
7776
- var _iterator7 = _createForOfIteratorHelper(wrapperTags),
7777
- _step7;
7847
+ var _iterator8 = _createForOfIteratorHelper(wrapperTags),
7848
+ _step8;
7778
7849
 
7779
7850
  try {
7780
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
7781
- var wrapperTag = _step7.value;
7851
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
7852
+ var wrapperTag = _step8.value;
7782
7853
  html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
7783
7854
  }
7784
7855
  } catch (err) {
7785
- _iterator7.e(err);
7856
+ _iterator8.e(err);
7786
7857
  } finally {
7787
- _iterator7.f();
7858
+ _iterator8.f();
7788
7859
  }
7789
7860
  } // For IE11, the document title must not be undefined, but it can be an empty string
7790
7861
  // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
@@ -8365,7 +8436,7 @@ var LWC = (function (exports) {
8365
8436
  });
8366
8437
  freeze(LightningElement);
8367
8438
  seal(LightningElement.prototype);
8368
- /* version: 2.27.0 */
8439
+ /* version: 2.28.0 */
8369
8440
 
8370
8441
  exports.LightningElement = LightningElement;
8371
8442
  exports.__unstable__ProfilerControl = profilerControl;
@@ -49,7 +49,7 @@
49
49
  */
50
50
  const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
51
51
  const { isArray: isArray$1 } = Array;
52
- const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
52
+ const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
53
53
  const { fromCharCode: StringFromCharCode } = String;
54
54
  const { charCodeAt: StringCharCodeAt, replace: StringReplace, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
55
55
  function isUndefined$1(obj) {
@@ -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.27.0";
308
+ const LWC_VERSION = "2.28.0";
309
309
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
310
- /** version: 2.27.0 */
310
+ /** version: 2.28.0 */
311
311
 
312
312
  /**
313
313
  * Copyright (C) 2018 salesforce.com, inc.
@@ -389,7 +389,7 @@
389
389
  patch$1(propName);
390
390
  }
391
391
  }
392
- /** version: 2.27.0 */
392
+ /** version: 2.28.0 */
393
393
 
394
394
  /**
395
395
  * Copyright (C) 2018 salesforce.com, inc.
@@ -469,7 +469,7 @@
469
469
  setFeatureFlag(name, value);
470
470
  }
471
471
  }
472
- /** version: 2.27.0 */
472
+ /** version: 2.28.0 */
473
473
 
474
474
  /*
475
475
  * Copyright (c) 2018, salesforce.com, inc.
@@ -4219,9 +4219,14 @@
4219
4219
  if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
4220
4220
  disconnectRootElement(elm);
4221
4221
  }
4222
- };
4222
+ }; // Should never get a tag with upper case letter at this point; the compiler
4223
+ // should produce only tags with lowercase letters. However, the Java
4224
+ // compiler may generate tagnames with uppercase letters so - for backwards
4225
+ // compatibility, we lower case the tagname here.
4226
+
4223
4227
 
4224
- const elm = createCustomElement(sel, upgradeCallback, connectedCallback, disconnectedCallback);
4228
+ const normalizedTagname = sel.toLowerCase();
4229
+ const elm = createCustomElement(normalizedTagname, upgradeCallback, connectedCallback, disconnectedCallback);
4225
4230
  vnode.elm = elm;
4226
4231
  vnode.vm = vm;
4227
4232
  linkNodeToShadow(elm, owner, renderer);
@@ -4523,6 +4528,17 @@
4523
4528
  shadowMode
4524
4529
  } = vm;
4525
4530
 
4531
+ if (process.env.NODE_ENV !== 'production') {
4532
+ // If any of the children being allocated is a scoped slot fragment, make sure the receiving
4533
+ // component is a light DOM component. This is mainly to validate light dom parent running
4534
+ // in native shadow mode.
4535
+ if (renderMode !== 0
4536
+ /* RenderMode.Light */
4537
+ && ArraySome.call(children, child => !isNull(child) && isVScopedSlotFragment(child))) {
4538
+ logError(`Invalid usage of 'lwc:slot-data' on ${getComponentTag(vm)} tag. Scoped slot content can only be passed to a light dom child.`);
4539
+ }
4540
+ }
4541
+
4526
4542
  if (shadowMode === 1
4527
4543
  /* ShadowMode.Synthetic */
4528
4544
  || renderMode === 0
@@ -4917,27 +4933,42 @@
4917
4933
  !isUndefined$1(slotset.slotAssignments) &&
4918
4934
  !isUndefined$1(slotset.slotAssignments[slotName]) &&
4919
4935
  slotset.slotAssignments[slotName].length !== 0) {
4920
- children = slotset.slotAssignments[slotName].reduce((acc, vnode) => {
4921
- // If the passed slot content is factory, evaluate it and use the produced vnodes
4922
- if (vnode && isVScopedSlotFragment(vnode)) {
4923
- const vmBeingRenderedInception = getVMBeingRendered();
4924
- let children = [];
4925
- // Evaluate in the scope of the slot content's owner
4926
- // if a slotset is provided, there will always be an owner. The only case where owner is
4927
- // undefined is for root components, but root components cannot accept slotted content
4928
- setVMBeingRendered(slotset.owner);
4929
- try {
4930
- children = vnode.factory(data.slotData);
4936
+ children = slotset.slotAssignments[slotName].reduce((accumulator, vnode) => {
4937
+ if (vnode) {
4938
+ const assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
4939
+ // The only sniff test for a scoped <slot> element is the presence of `slotData`
4940
+ const isScopedSlotElement = !isUndefined$1(data.slotData);
4941
+ // Check if slot types of parent and child are matching
4942
+ if (assignedNodeIsScopedSlot !== isScopedSlotElement) {
4943
+ if (process.env.NODE_ENV !== 'production') {
4944
+ logError(`Mismatched slot types for ${slotName === '' ? '(default)' : slotName} slot. Both parent and child component must use standard type or scoped type for a given slot.`, slotset.owner);
4945
+ }
4946
+ // Ignore slot content from parent
4947
+ return accumulator;
4931
4948
  }
4932
- finally {
4933
- setVMBeingRendered(vmBeingRenderedInception);
4949
+ // If the passed slot content is factory, evaluate it and add the produced vnodes
4950
+ if (assignedNodeIsScopedSlot) {
4951
+ const vmBeingRenderedInception = getVMBeingRendered();
4952
+ let scopedSlotChildren = [];
4953
+ // Evaluate in the scope of the slot content's owner
4954
+ // if a slotset is provided, there will always be an owner. The only case where owner is
4955
+ // undefined is for root components, but root components cannot accept slotted content
4956
+ setVMBeingRendered(slotset.owner);
4957
+ try {
4958
+ scopedSlotChildren = vnode.factory(data.slotData);
4959
+ }
4960
+ finally {
4961
+ setVMBeingRendered(vmBeingRenderedInception);
4962
+ }
4963
+ return ArrayConcat$1.call(accumulator, scopedSlotChildren);
4964
+ }
4965
+ else {
4966
+ // If the slot content is standard type, the content is static, no additional
4967
+ // processing needed on the vnode
4968
+ return ArrayConcat$1.call(accumulator, vnode);
4934
4969
  }
4935
- return ArrayConcat$1.call(acc, children);
4936
- }
4937
- else {
4938
- // If the slot content is a static list of child nodes provided by the parent, nothing to do
4939
- return ArrayConcat$1.call(acc, vnode);
4940
4970
  }
4971
+ return accumulator;
4941
4972
  }, []);
4942
4973
  }
4943
4974
  const vmBeingRendered = getVMBeingRendered();
@@ -7305,7 +7336,7 @@
7305
7336
  }
7306
7337
  return ctor;
7307
7338
  }
7308
- /* version: 2.27.0 */
7339
+ /* version: 2.28.0 */
7309
7340
 
7310
7341
  /*
7311
7342
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7579,10 +7610,12 @@
7579
7610
  const pendingRegistryForElement = new WeakMap();
7580
7611
  const definitionForConstructor = new WeakMap();
7581
7612
  const registeredUserCtors = new WeakSet();
7613
+ const registeredPivotCtors = new WeakSet();
7582
7614
  const pivotCtorByTag = new Map();
7583
7615
  const globalDefinitionsByTag = new Map();
7584
7616
  const globalDefinitionsByClass = new Map();
7585
7617
  const awaitingUpgrade = new Map();
7618
+ const pendingWhenDefinedCallbacks = new Map();
7586
7619
  const EMPTY_SET = new Set();
7587
7620
  function createDefinitionRecord(constructor) {
7588
7621
  var _a;
@@ -7688,6 +7721,7 @@
7688
7721
  }
7689
7722
  }
7690
7723
  PivotCtor.observedAttributes = [...registeredDefinition.observedAttributes];
7724
+ registeredPivotCtors.add(PivotCtor);
7691
7725
  return PivotCtor;
7692
7726
  }
7693
7727
  function getNewObservedAttributes(registeredDefinition, pivotDefinition) {
@@ -7821,6 +7855,27 @@
7821
7855
  }
7822
7856
  return createDefinitionRecord(constructor);
7823
7857
  }
7858
+ // Defer a `whenDefined()` callback until an externally-visible custom element is defined
7859
+ function createPendingWhenDefinedCallback(tagName) {
7860
+ return new Promise((resolve) => {
7861
+ let resolvers = pendingWhenDefinedCallbacks.get(tagName);
7862
+ if (isUndefined$1(resolvers)) {
7863
+ resolvers = [];
7864
+ pendingWhenDefinedCallbacks.set(tagName, resolvers);
7865
+ }
7866
+ resolvers.push(resolve);
7867
+ });
7868
+ }
7869
+ // Call any pending `whenDefined()` callbacks
7870
+ function flushPendingWhenDefinedCallbacks(tagName, ctor) {
7871
+ const resolvers = pendingWhenDefinedCallbacks.get(tagName);
7872
+ if (!isUndefined$1(resolvers)) {
7873
+ for (const resolver of resolvers) {
7874
+ resolver(ctor);
7875
+ }
7876
+ }
7877
+ pendingWhenDefinedCallbacks.delete(tagName);
7878
+ }
7824
7879
  const { customElements: nativeRegistry } = window;
7825
7880
  const { define: nativeDefine, whenDefined: nativeWhenDefined, get: nativeGet } = nativeRegistry;
7826
7881
  // patch for the global registry define mechanism
@@ -7875,6 +7930,8 @@
7875
7930
  }
7876
7931
  }
7877
7932
  }
7933
+ // If anyone called customElements.whenDefined() and is still waiting for a promise resolution, resolve now
7934
+ flushPendingWhenDefinedCallbacks(tagName, constructor);
7878
7935
  };
7879
7936
  CustomElementRegistry.prototype.get = function get(tagName) {
7880
7937
  const NativeCtor = nativeGet.call(nativeRegistry, tagName);
@@ -7883,8 +7940,10 @@
7883
7940
  if (!isUndefined$1(definition)) {
7884
7941
  return definition.UserCtor; // defined by the patched custom elements registry
7885
7942
  }
7886
- // TODO [#3073]: return undefined rather than the pivot constructor (NativeCtor)
7887
- return NativeCtor; // return the pivot constructor or constructor that existed before patching
7943
+ if (registeredPivotCtors.has(NativeCtor)) {
7944
+ return undefined; // pivot constructors should not be observable, return undefined
7945
+ }
7946
+ return NativeCtor; // constructor that existed before patching
7888
7947
  }
7889
7948
  };
7890
7949
  CustomElementRegistry.prototype.whenDefined = function whenDefined(tagName) {
@@ -7893,13 +7952,17 @@
7893
7952
  if (!isUndefined$1(definition)) {
7894
7953
  return definition.UserCtor;
7895
7954
  }
7896
- // TODO [#3073]: return undefined rather than the pivot constructor (NativeCtor)
7897
7955
  // In this case, the custom element must have been defined before the registry patches
7898
7956
  // were applied. So return the non-pivot constructor
7899
7957
  if (isUndefined$1(NativeCtor)) {
7900
7958
  // Chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1335247
7901
7959
  // We can patch the correct behavior using customElements.get()
7902
- return nativeGet.call(nativeRegistry, tagName);
7960
+ NativeCtor = nativeGet.call(nativeRegistry, tagName);
7961
+ }
7962
+ if (registeredPivotCtors.has(NativeCtor)) {
7963
+ // Pivot constructors should not be observable. Wait to resolve the promise
7964
+ // if a constructor is ever defined in userland
7965
+ return createPendingWhenDefinedCallback(tagName);
7903
7966
  }
7904
7967
  return NativeCtor;
7905
7968
  });
@@ -8129,7 +8192,7 @@
8129
8192
  function isNull(obj) {
8130
8193
  return obj === null;
8131
8194
  }
8132
- /** version: 2.27.0 */
8195
+ /** version: 2.28.0 */
8133
8196
 
8134
8197
  /*
8135
8198
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8708,7 +8771,7 @@
8708
8771
  });
8709
8772
  freeze(LightningElement);
8710
8773
  seal(LightningElement.prototype);
8711
- /* version: 2.27.0 */
8774
+ /* version: 2.28.0 */
8712
8775
 
8713
8776
  exports.LightningElement = LightningElement;
8714
8777
  exports.__unstable__ProfilerControl = profilerControl;