lwc 2.28.0 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +47 -24
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +47 -24
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +40 -18
  5. package/dist/engine-dom/iife/es5/engine-dom.js +49 -24
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +42 -18
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +47 -24
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +40 -18
  11. package/dist/engine-dom/umd/es5/engine-dom.js +49 -24
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +42 -18
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +41 -18
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +41 -18
  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
@@ -291,7 +291,7 @@ var LWC = (function (exports) {
291
291
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
292
292
  return attributeName;
293
293
  }
294
- /** version: 2.28.0 */
294
+ /** version: 2.29.0 */
295
295
 
296
296
  /**
297
297
  * Copyright (C) 2018 salesforce.com, inc.
@@ -373,7 +373,7 @@ var LWC = (function (exports) {
373
373
  patch$1(propName);
374
374
  }
375
375
  }
376
- /** version: 2.28.0 */
376
+ /** version: 2.29.0 */
377
377
 
378
378
  /**
379
379
  * Copyright (C) 2018 salesforce.com, inc.
@@ -2638,6 +2638,9 @@ var LWC = (function (exports) {
2638
2638
  function isVCustomElement(vnode) {
2639
2639
  return vnode.type === 3 /* VNodeType.CustomElement */;
2640
2640
  }
2641
+ function isVFragment(vnode) {
2642
+ return vnode.type === 5 /* VNodeType.Fragment */;
2643
+ }
2641
2644
  function isVScopedSlotFragment(vnode) {
2642
2645
  return vnode.type === 6 /* VNodeType.ScopedSlotFragment */;
2643
2646
  }
@@ -3437,26 +3440,26 @@ var LWC = (function (exports) {
3437
3440
 
3438
3441
  return vm;
3439
3442
  }
3443
+ /**
3444
+ * Collects all slots into a SlotSet, traversing through VFragment Nodes
3445
+ */
3440
3446
 
3441
- function allocateInSlot(vm, children, owner) {
3442
- var _a, _b;
3443
3447
 
3444
- const {
3445
- cmpSlots: {
3446
- slotAssignments: oldSlotsMapping
3447
- }
3448
- } = vm;
3449
- const cmpSlotsMapping = create(null);
3450
- vm.cmpSlots = {
3451
- owner,
3452
- slotAssignments: cmpSlotsMapping
3453
- };
3448
+ function collectSlots(vm, children, cmpSlotsMapping) {
3449
+ var _a, _b;
3454
3450
 
3455
3451
  for (let i = 0, len = children.length; i < len; i += 1) {
3456
3452
  const vnode = children[i];
3457
3453
 
3458
3454
  if (isNull(vnode)) {
3459
3455
  continue;
3456
+ } // Dive further iff the content is wrapped in a VFragment
3457
+
3458
+
3459
+ if (isVFragment(vnode)) {
3460
+ // Remove the text delimiter nodes to avoid overriding default slot content
3461
+ collectSlots(vm, vnode.children.slice(1, -1), cmpSlotsMapping);
3462
+ continue;
3460
3463
  }
3461
3464
 
3462
3465
  let slotName = '';
@@ -3470,6 +3473,20 @@ var LWC = (function (exports) {
3470
3473
  const vnodes = cmpSlotsMapping[slotName] = cmpSlotsMapping[slotName] || [];
3471
3474
  ArrayPush$1.call(vnodes, vnode);
3472
3475
  }
3476
+ }
3477
+
3478
+ function allocateInSlot(vm, children, owner) {
3479
+ const {
3480
+ cmpSlots: {
3481
+ slotAssignments: oldSlotsMapping
3482
+ }
3483
+ } = vm;
3484
+ const cmpSlotsMapping = create(null);
3485
+ collectSlots(vm, children, cmpSlotsMapping);
3486
+ vm.cmpSlots = {
3487
+ owner,
3488
+ slotAssignments: cmpSlotsMapping
3489
+ };
3473
3490
 
3474
3491
  if (isFalse(vm.isDirty)) {
3475
3492
  // We need to determine if the old allocation is really different from the new one
@@ -5586,7 +5603,8 @@ var LWC = (function (exports) {
5586
5603
  }
5587
5604
  }
5588
5605
  let nodesAreCompatible = true;
5589
- if (!isUndefined$1(className) && String(className) !== getProperty(elm, 'className')) {
5606
+ const elmClassName = getProperty(elm, 'className');
5607
+ if (!isUndefined$1(className) && String(className) !== elmClassName) {
5590
5608
  // className is used when class is bound to an expr.
5591
5609
  nodesAreCompatible = false;
5592
5610
  }
@@ -5606,6 +5624,10 @@ var LWC = (function (exports) {
5606
5624
  nodesAreCompatible = false;
5607
5625
  }
5608
5626
  }
5627
+ else if (isUndefined$1(className) && elmClassName !== '') {
5628
+ // SSR contains a className but client-side VDOM does not
5629
+ nodesAreCompatible = false;
5630
+ }
5609
5631
  return nodesAreCompatible;
5610
5632
  }
5611
5633
  function validateStyleAttr(vnode, elm, renderer) {
@@ -5711,7 +5733,7 @@ var LWC = (function (exports) {
5711
5733
  }
5712
5734
  return ctor;
5713
5735
  }
5714
- /* version: 2.28.0 */
5736
+ /* version: 2.29.0 */
5715
5737
 
5716
5738
  /*
5717
5739
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6558,7 +6580,7 @@ var LWC = (function (exports) {
6558
6580
  function isNull(obj) {
6559
6581
  return obj === null;
6560
6582
  }
6561
- /** version: 2.28.0 */
6583
+ /** version: 2.29.0 */
6562
6584
 
6563
6585
  /*
6564
6586
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7129,7 +7151,7 @@ var LWC = (function (exports) {
7129
7151
  });
7130
7152
  freeze(LightningElement);
7131
7153
  seal(LightningElement.prototype);
7132
- /* version: 2.28.0 */
7154
+ /* version: 2.29.0 */
7133
7155
 
7134
7156
  exports.LightningElement = LightningElement;
7135
7157
  exports.__unstable__ProfilerControl = profilerControl;
@@ -368,9 +368,9 @@ var LWC = (function (exports) {
368
368
  // Increment whenever the LWC template compiler changes
369
369
 
370
370
 
371
- var LWC_VERSION = "2.28.0";
371
+ var LWC_VERSION = "2.29.0";
372
372
  var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
373
- /** version: 2.28.0 */
373
+ /** version: 2.29.0 */
374
374
 
375
375
  /**
376
376
  * Copyright (C) 2018 salesforce.com, inc.
@@ -464,7 +464,7 @@ var LWC = (function (exports) {
464
464
  patch$1(propName);
465
465
  }
466
466
  }
467
- /** version: 2.28.0 */
467
+ /** version: 2.29.0 */
468
468
 
469
469
  /**
470
470
  * Copyright (C) 2018 salesforce.com, inc.
@@ -558,7 +558,7 @@ var LWC = (function (exports) {
558
558
  setFeatureFlag(name, value);
559
559
  }
560
560
  }
561
- /** version: 2.28.0 */
561
+ /** version: 2.29.0 */
562
562
 
563
563
  /*
564
564
  * Copyright (c) 2018, salesforce.com, inc.
@@ -4517,6 +4517,12 @@ var LWC = (function (exports) {
4517
4517
  ;
4518
4518
  }
4519
4519
 
4520
+ function isVFragment(vnode) {
4521
+ return vnode.type === 5
4522
+ /* VNodeType.Fragment */
4523
+ ;
4524
+ }
4525
+
4520
4526
  function isVScopedSlotFragment(vnode) {
4521
4527
  return vnode.type === 6
4522
4528
  /* VNodeType.ScopedSlotFragment */
@@ -5427,22 +5433,26 @@ var LWC = (function (exports) {
5427
5433
 
5428
5434
  return vm;
5429
5435
  }
5436
+ /**
5437
+ * Collects all slots into a SlotSet, traversing through VFragment Nodes
5438
+ */
5430
5439
 
5431
- function allocateInSlot(vm, children, owner) {
5432
- var _a, _b;
5433
5440
 
5434
- var oldSlotsMapping = vm.cmpSlots.slotAssignments;
5435
- var cmpSlotsMapping = create(null);
5436
- vm.cmpSlots = {
5437
- owner: owner,
5438
- slotAssignments: cmpSlotsMapping
5439
- };
5441
+ function collectSlots(vm, children, cmpSlotsMapping) {
5442
+ var _a, _b;
5440
5443
 
5441
5444
  for (var _i15 = 0, len = children.length; _i15 < len; _i15 += 1) {
5442
5445
  var vnode = children[_i15];
5443
5446
 
5444
5447
  if (isNull(vnode)) {
5445
5448
  continue;
5449
+ } // Dive further iff the content is wrapped in a VFragment
5450
+
5451
+
5452
+ if (isVFragment(vnode)) {
5453
+ // Remove the text delimiter nodes to avoid overriding default slot content
5454
+ collectSlots(vm, vnode.children.slice(1, -1), cmpSlotsMapping);
5455
+ continue;
5446
5456
  }
5447
5457
 
5448
5458
  var slotName = '';
@@ -5456,6 +5466,16 @@ var LWC = (function (exports) {
5456
5466
  var vnodes = cmpSlotsMapping[slotName] = cmpSlotsMapping[slotName] || [];
5457
5467
  ArrayPush$1.call(vnodes, vnode);
5458
5468
  }
5469
+ }
5470
+
5471
+ function allocateInSlot(vm, children, owner) {
5472
+ var oldSlotsMapping = vm.cmpSlots.slotAssignments;
5473
+ var cmpSlotsMapping = create(null);
5474
+ collectSlots(vm, children, cmpSlotsMapping);
5475
+ vm.cmpSlots = {
5476
+ owner: owner,
5477
+ slotAssignments: cmpSlotsMapping
5478
+ };
5459
5479
 
5460
5480
  if (isFalse(vm.isDirty)) {
5461
5481
  // We need to determine if the old allocation is really different from the new one
@@ -5467,7 +5487,7 @@ var LWC = (function (exports) {
5467
5487
  return;
5468
5488
  }
5469
5489
 
5470
- for (var _i16 = 0, _len4 = oldKeys.length; _i16 < _len4; _i16 += 1) {
5490
+ for (var _i16 = 0, len = oldKeys.length; _i16 < len; _i16 += 1) {
5471
5491
  var key = oldKeys[_i16];
5472
5492
 
5473
5493
  if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
@@ -5476,10 +5496,10 @@ var LWC = (function (exports) {
5476
5496
  }
5477
5497
 
5478
5498
  var oldVNodes = oldSlotsMapping[key];
5479
- var _vnodes = cmpSlotsMapping[key];
5499
+ var vnodes = cmpSlotsMapping[key];
5480
5500
 
5481
5501
  for (var j = 0, a = cmpSlotsMapping[key].length; j < a; j += 1) {
5482
- if (oldVNodes[j] !== _vnodes[j]) {
5502
+ if (oldVNodes[j] !== vnodes[j]) {
5483
5503
  markComponentAsDirty(vm);
5484
5504
  return;
5485
5505
  }
@@ -6418,7 +6438,7 @@ var LWC = (function (exports) {
6418
6438
 
6419
6439
  function buildParseFragmentFn(createFragmentFn) {
6420
6440
  return function (strings) {
6421
- for (var _len5 = arguments.length, keys = new Array(_len5 > 1 ? _len5 - 1 : 0), _key3 = 1; _key3 < _len5; _key3++) {
6441
+ for (var _len4 = arguments.length, keys = new Array(_len4 > 1 ? _len4 - 1 : 0), _key3 = 1; _key3 < _len4; _key3++) {
6422
6442
  keys[_key3 - 1] = arguments[_key3];
6423
6443
  }
6424
6444
 
@@ -8262,12 +8282,13 @@ var LWC = (function (exports) {
8262
8282
  }
8263
8283
 
8264
8284
  var nodesAreCompatible = true;
8265
- var vnodeClassName;
8285
+ var readableVnodeClassname;
8286
+ var elmClassName = getProperty(elm, 'className');
8266
8287
 
8267
- if (!isUndefined$1(className) && String(className) !== getProperty(elm, 'className')) {
8288
+ if (!isUndefined$1(className) && String(className) !== elmClassName) {
8268
8289
  // className is used when class is bound to an expr.
8269
8290
  nodesAreCompatible = false;
8270
- vnodeClassName = className;
8291
+ readableVnodeClassname = className;
8271
8292
  } else if (!isUndefined$1(classMap)) {
8272
8293
  // classMap is used when class is set to static value.
8273
8294
  var classList = getClassList(elm);
@@ -8281,16 +8302,20 @@ var LWC = (function (exports) {
8281
8302
  }
8282
8303
  }
8283
8304
 
8284
- vnodeClassName = computedClassName.trim();
8305
+ readableVnodeClassname = computedClassName.trim();
8285
8306
 
8286
8307
  if (classList.length > keys(classMap).length) {
8287
8308
  nodesAreCompatible = false;
8288
8309
  }
8310
+ } else if (isUndefined$1(className) && elmClassName !== '') {
8311
+ // SSR contains a className but client-side VDOM does not
8312
+ nodesAreCompatible = false;
8313
+ readableVnodeClassname = '';
8289
8314
  }
8290
8315
 
8291
8316
  if (!nodesAreCompatible) {
8292
8317
  if (process.env.NODE_ENV !== 'production') {
8293
- logError("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: attribute \"class\" has different values, expected \"").concat(vnodeClassName, "\" but found \"").concat(getProperty(elm, 'className'), "\""), vnode.owner);
8318
+ logError("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: attribute \"class\" has different values, expected \"").concat(readableVnodeClassname, "\" but found \"").concat(elmClassName, "\""), vnode.owner);
8294
8319
  }
8295
8320
  }
8296
8321
 
@@ -8573,7 +8598,7 @@ var LWC = (function (exports) {
8573
8598
 
8574
8599
  return ctor;
8575
8600
  }
8576
- /* version: 2.28.0 */
8601
+ /* version: 2.29.0 */
8577
8602
 
8578
8603
  /*
8579
8604
  * Copyright (c) 2018, salesforce.com, inc.
@@ -9625,7 +9650,7 @@ var LWC = (function (exports) {
9625
9650
  function isNull(obj) {
9626
9651
  return obj === null;
9627
9652
  }
9628
- /** version: 2.28.0 */
9653
+ /** version: 2.29.0 */
9629
9654
 
9630
9655
  /*
9631
9656
  * Copyright (c) 2018, salesforce.com, inc.
@@ -10292,7 +10317,7 @@ var LWC = (function (exports) {
10292
10317
  });
10293
10318
  freeze(LightningElement);
10294
10319
  seal(LightningElement.prototype);
10295
- /* version: 2.28.0 */
10320
+ /* version: 2.29.0 */
10296
10321
 
10297
10322
  exports.LightningElement = LightningElement;
10298
10323
  exports.__unstable__ProfilerControl = profilerControl;