lwc 2.5.9 → 2.6.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 (41) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +52 -79
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +52 -79
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +52 -79
  5. package/dist/engine-dom/iife/es5/engine-dom.js +64 -91
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +64 -91
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +52 -79
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +52 -79
  11. package/dist/engine-dom/umd/es5/engine-dom.js +64 -91
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +64 -91
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +63 -87
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
  16. package/dist/engine-server/esm/es2017/engine-server.js +63 -87
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +23 -130
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +23 -130
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +23 -130
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +30 -127
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +30 -127
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +23 -130
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +23 -130
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +30 -127
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +30 -127
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/iife/es5/wire-service.js +11 -11
  34. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  35. package/dist/wire-service/iife/es5/wire-service_debug.js +11 -11
  36. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  37. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service.js +11 -11
  39. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  40. package/dist/wire-service/umd/es5/wire-service_debug.js +11 -11
  41. package/package.json +8 -8
@@ -5,9 +5,13 @@
5
5
 
6
6
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
7
 
8
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
9
+
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+
8
12
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
13
 
10
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
14
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
11
15
  /*
12
16
  * Copyright (c) 2018, salesforce.com, inc.
13
17
  * All rights reserved.
@@ -117,7 +121,7 @@
117
121
  var KEY__SHADOW_TOKEN = '$shadowToken$';
118
122
  var KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
119
123
  var KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
120
- /** version: 2.5.9 */
124
+ /** version: 2.6.2 */
121
125
 
122
126
  /*
123
127
  * Copyright (c) 2018, salesforce.com, inc.
@@ -348,9 +352,9 @@
348
352
  function apply$4() {
349
353
  // IE11 does not have this element definition
350
354
  // we don't care much about the construction phase, just the prototype
351
- var HTMLSlotElement = function HTMLSlotElement() {
355
+ var HTMLSlotElement = /*#__PURE__*/_createClass(function HTMLSlotElement() {
352
356
  _classCallCheck(this, HTMLSlotElement);
353
- }; // prototype inheritance dance
357
+ }); // prototype inheritance dance
354
358
 
355
359
 
356
360
  setPrototypeOf(HTMLSlotElement, HTMLElement.constructor);
@@ -436,20 +440,6 @@
436
440
 
437
441
  return cloned;
438
442
  }
439
- /**
440
- * Copyright (C) 2018 salesforce.com, inc.
441
- */
442
-
443
-
444
- if (!_globalThis.lwcRuntimeFlags) {
445
- Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
446
- value: create(null)
447
- });
448
- }
449
-
450
- var runtimeFlags = _globalThis.lwcRuntimeFlags;
451
- /** version: 2.5.9 */
452
-
453
443
  /*
454
444
  * Copyright (c) 2018, salesforce.com, inc.
455
445
  * All rights reserved.
@@ -457,6 +447,7 @@
457
447
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
458
448
  */
459
449
 
450
+
460
451
  var eventTargetPrototype = typeof EventTarget !== 'undefined' ? EventTarget.prototype : _Node.prototype;
461
452
  var addEventListener = eventTargetPrototype.addEventListener,
462
453
  dispatchEvent = eventTargetPrototype.dispatchEvent,
@@ -505,17 +496,9 @@
505
496
  // This function is invoked from an event listener and currentTarget is always defined.
506
497
  var currentTarget = eventCurrentTargetGetter.call(event);
507
498
 
508
- var composed = event.composed;
509
- var shouldInvoke;
510
-
511
- if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
512
- shouldInvoke = !(eventToShadowRootMap.has(event) && isFalse(composed));
513
- } else {
514
- var actualTarget = getActualTarget(event);
515
- shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
516
- }
499
+ var actualTarget = getActualTarget(event);
517
500
 
518
- if (!shouldInvoke) {
501
+ if (!shouldInvokeListener(event, actualTarget, currentTarget)) {
519
502
  return;
520
503
  }
521
504
 
@@ -536,25 +519,6 @@
536
519
 
537
520
 
538
521
  var eventToContextMap = new WeakMap();
539
-
540
- function isChildNode(root, node) {
541
- return !!(compareDocumentPosition.call(root, node) & DOCUMENT_POSITION_CONTAINED_BY);
542
- }
543
-
544
- var GET_ROOT_NODE_CONFIG_FALSE = {
545
- composed: false
546
- };
547
-
548
- function getRootNodeHost(node, options) {
549
- var rootNode = node.getRootNode(options);
550
-
551
- if (isSyntheticShadowRoot(rootNode)) {
552
- rootNode = getHost(rootNode);
553
- }
554
-
555
- return rootNode;
556
- }
557
-
558
522
  var customElementToWrappedListeners = new WeakMap();
559
523
 
560
524
  function getEventMap(elm) {
@@ -599,16 +563,9 @@
599
563
  currentTarget = getShadowRoot(currentTarget);
600
564
  }
601
565
 
602
- var shouldInvoke;
566
+ var actualTarget = getActualTarget(event);
603
567
 
604
- if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
605
- shouldInvoke = shouldInvokeShadowRootListener(event);
606
- } else {
607
- var actualTarget = getActualTarget(event);
608
- shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
609
- }
610
-
611
- if (shouldInvoke) {
568
+ if (shouldInvokeListener(event, actualTarget, currentTarget)) {
612
569
  listener.call(currentTarget, event);
613
570
  }
614
571
  };
@@ -635,16 +592,9 @@
635
592
  customElementWrappedListener = function customElementWrappedListener(event) {
636
593
  // currentTarget is always defined inside an event listener
637
594
  var currentTarget = eventCurrentTargetGetter.call(event);
638
- var shouldInvoke;
595
+ var actualTarget = getActualTarget(event);
639
596
 
640
- if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
641
- shouldInvoke = shouldInvokeCustomElementListener(event);
642
- } else {
643
- var actualTarget = getActualTarget(event);
644
- shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
645
- }
646
-
647
- if (shouldInvoke) {
597
+ if (shouldInvokeListener(event, actualTarget, currentTarget)) {
648
598
  listener.call(currentTarget, event);
649
599
  }
650
600
  };
@@ -761,66 +711,6 @@
761
711
  }
762
712
  }
763
713
 
764
- function shouldInvokeCustomElementListener(event) {
765
- var composed = event.composed;
766
-
767
- if (isTrue(composed)) {
768
- // Listeners on host elements should always be invoked for {composed: true} events.
769
- return true;
770
- } // If this {composed: false} event was dispatched on any root.
771
-
772
-
773
- if (eventToShadowRootMap.has(event)) {
774
- return false;
775
- }
776
-
777
- var target = eventTargetGetter.call(event);
778
- var currentTarget = eventCurrentTargetGetter.call(event); // If this {composed: false} event was dispatched on the current target host.
779
-
780
- if (target === currentTarget) {
781
- return true;
782
- } // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
783
- // shadow-excluding descendant node. In this case, we only invoke the listener if the target
784
- // host was assigned to a slot in the composed subtree of the current target host.
785
-
786
-
787
- var targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
788
- var currentTargetHost = currentTarget;
789
- return isChildNode(targetHost, currentTargetHost);
790
- }
791
-
792
- function shouldInvokeShadowRootListener(event) {
793
- var composed = event.composed;
794
- var target = eventTargetGetter.call(event);
795
- var currentTarget = eventCurrentTargetGetter.call(event); // If the event was dispatched on the host or its root.
796
-
797
- if (target === currentTarget) {
798
- // Invoke the listener if the event was dispatched directly on the root.
799
- return eventToShadowRootMap.get(event) === getShadowRoot(target);
800
- } // At this point the event is {bubbles: true} and was dispatched from a shadow-including descendant node.
801
-
802
-
803
- if (isTrue(composed)) {
804
- // Invoke the listener if the event is {composed: true}.
805
- return true;
806
- } // At this point the event must be {bubbles: true, composed: false}.
807
-
808
-
809
- if (isTrue(eventToShadowRootMap.has(event))) {
810
- // Don't invoke the listener because the event was dispatched on a descendant root.
811
- return false;
812
- }
813
-
814
- var targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
815
- var currentTargetHost = currentTarget;
816
- var isCurrentTargetSlotted = isChildNode(targetHost, currentTargetHost); // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
817
- // shadow-excluding descendant node. In this case, we only invoke the listener if the target
818
- // host was assigned to a slot in the composed subtree of the current target host, or the
819
- // descendant node is in the shadow tree of the current root.
820
-
821
- return isCurrentTargetSlotted || targetHost === currentTargetHost;
822
- }
823
-
824
714
  function addCustomElementEventListener(type, listener, _options) {
825
715
 
826
716
 
@@ -1513,6 +1403,20 @@
1513
1403
  }
1514
1404
  }
1515
1405
  }
1406
+ /**
1407
+ * Copyright (C) 2018 salesforce.com, inc.
1408
+ */
1409
+
1410
+
1411
+ if (!_globalThis.lwcRuntimeFlags) {
1412
+ Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
1413
+ value: create(null)
1414
+ });
1415
+ }
1416
+
1417
+ var runtimeFlags = _globalThis.lwcRuntimeFlags;
1418
+ /** version: 2.6.2 */
1419
+
1516
1420
  /*
1517
1421
  * Copyright (c) 2018, salesforce.com, inc.
1518
1422
  * All rights reserved.
@@ -1527,7 +1431,6 @@
1527
1431
  * because we don't want to patch the children getters for those elements.
1528
1432
  */
1529
1433
 
1530
-
1531
1434
  function hasMountedChildren(node) {
1532
1435
  return isSyntheticSlotElement(node) || isSyntheticShadowHost(node);
1533
1436
  }
@@ -5435,6 +5338,6 @@
5435
5338
  },
5436
5339
  configurable: true
5437
5340
  });
5438
- /** version: 2.5.9 */
5341
+ /** version: 2.6.2 */
5439
5342
 
5440
5343
  })();
@@ -199,7 +199,7 @@
199
199
  // we can't use typeof since it will fail when transpiling.
200
200
 
201
201
  const hasNativeSymbolSupport = /*@__PURE__*/(() => Symbol('x').toString() === 'Symbol(x)')();
202
- /** version: 2.5.9 */
202
+ /** version: 2.6.2 */
203
203
 
204
204
  /*
205
205
  * Copyright (c) 2018, salesforce.com, inc.
@@ -526,20 +526,6 @@
526
526
 
527
527
  return cloned;
528
528
  }
529
- /**
530
- * Copyright (C) 2018 salesforce.com, inc.
531
- */
532
-
533
-
534
- if (!_globalThis.lwcRuntimeFlags) {
535
- Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
536
- value: create(null)
537
- });
538
- }
539
-
540
- const runtimeFlags = _globalThis.lwcRuntimeFlags;
541
- /** version: 2.5.9 */
542
-
543
529
  /*
544
530
  * Copyright (c) 2018, salesforce.com, inc.
545
531
  * All rights reserved.
@@ -547,6 +533,7 @@
547
533
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
548
534
  */
549
535
 
536
+
550
537
  const eventTargetPrototype = typeof EventTarget !== 'undefined' ? EventTarget.prototype : _Node.prototype;
551
538
  const {
552
539
  addEventListener,
@@ -601,19 +588,9 @@
601
588
  assert.invariant(isFalse(isSyntheticShadowHost(currentTarget)), 'This routine should not be used to wrap event listeners for host elements and shadow roots.');
602
589
  }
603
590
 
604
- const {
605
- composed
606
- } = event;
607
- let shouldInvoke;
608
-
609
- if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
610
- shouldInvoke = !(eventToShadowRootMap.has(event) && isFalse(composed));
611
- } else {
612
- const actualTarget = getActualTarget(event);
613
- shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
614
- }
591
+ const actualTarget = getActualTarget(event);
615
592
 
616
- if (!shouldInvoke) {
593
+ if (!shouldInvokeListener(event, actualTarget, currentTarget)) {
617
594
  return;
618
595
  }
619
596
 
@@ -634,25 +611,6 @@
634
611
 
635
612
 
636
613
  const eventToContextMap = new WeakMap();
637
-
638
- function isChildNode(root, node) {
639
- return !!(compareDocumentPosition.call(root, node) & DOCUMENT_POSITION_CONTAINED_BY);
640
- }
641
-
642
- const GET_ROOT_NODE_CONFIG_FALSE = {
643
- composed: false
644
- };
645
-
646
- function getRootNodeHost(node, options) {
647
- let rootNode = node.getRootNode(options);
648
-
649
- if (isSyntheticShadowRoot(rootNode)) {
650
- rootNode = getHost(rootNode);
651
- }
652
-
653
- return rootNode;
654
- }
655
-
656
614
  const customElementToWrappedListeners = new WeakMap();
657
615
 
658
616
  function getEventMap(elm) {
@@ -697,16 +655,9 @@
697
655
  currentTarget = getShadowRoot(currentTarget);
698
656
  }
699
657
 
700
- let shouldInvoke;
658
+ const actualTarget = getActualTarget(event);
701
659
 
702
- if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
703
- shouldInvoke = shouldInvokeShadowRootListener(event);
704
- } else {
705
- const actualTarget = getActualTarget(event);
706
- shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
707
- }
708
-
709
- if (shouldInvoke) {
660
+ if (shouldInvokeListener(event, actualTarget, currentTarget)) {
710
661
  listener.call(currentTarget, event);
711
662
  }
712
663
  };
@@ -733,16 +684,9 @@
733
684
  customElementWrappedListener = function (event) {
734
685
  // currentTarget is always defined inside an event listener
735
686
  const currentTarget = eventCurrentTargetGetter.call(event);
736
- let shouldInvoke;
687
+ const actualTarget = getActualTarget(event);
737
688
 
738
- if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
739
- shouldInvoke = shouldInvokeCustomElementListener(event);
740
- } else {
741
- const actualTarget = getActualTarget(event);
742
- shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
743
- }
744
-
745
- if (shouldInvoke) {
689
+ if (shouldInvokeListener(event, actualTarget, currentTarget)) {
746
690
  listener.call(currentTarget, event);
747
691
  }
748
692
  };
@@ -863,70 +807,6 @@
863
807
  }
864
808
  }
865
809
 
866
- function shouldInvokeCustomElementListener(event) {
867
- const {
868
- composed
869
- } = event;
870
-
871
- if (isTrue(composed)) {
872
- // Listeners on host elements should always be invoked for {composed: true} events.
873
- return true;
874
- } // If this {composed: false} event was dispatched on any root.
875
-
876
-
877
- if (eventToShadowRootMap.has(event)) {
878
- return false;
879
- }
880
-
881
- const target = eventTargetGetter.call(event);
882
- const currentTarget = eventCurrentTargetGetter.call(event); // If this {composed: false} event was dispatched on the current target host.
883
-
884
- if (target === currentTarget) {
885
- return true;
886
- } // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
887
- // shadow-excluding descendant node. In this case, we only invoke the listener if the target
888
- // host was assigned to a slot in the composed subtree of the current target host.
889
-
890
-
891
- const targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
892
- const currentTargetHost = currentTarget;
893
- return isChildNode(targetHost, currentTargetHost);
894
- }
895
-
896
- function shouldInvokeShadowRootListener(event) {
897
- const {
898
- composed
899
- } = event;
900
- const target = eventTargetGetter.call(event);
901
- const currentTarget = eventCurrentTargetGetter.call(event); // If the event was dispatched on the host or its root.
902
-
903
- if (target === currentTarget) {
904
- // Invoke the listener if the event was dispatched directly on the root.
905
- return eventToShadowRootMap.get(event) === getShadowRoot(target);
906
- } // At this point the event is {bubbles: true} and was dispatched from a shadow-including descendant node.
907
-
908
-
909
- if (isTrue(composed)) {
910
- // Invoke the listener if the event is {composed: true}.
911
- return true;
912
- } // At this point the event must be {bubbles: true, composed: false}.
913
-
914
-
915
- if (isTrue(eventToShadowRootMap.has(event))) {
916
- // Don't invoke the listener because the event was dispatched on a descendant root.
917
- return false;
918
- }
919
-
920
- const targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
921
- const currentTargetHost = currentTarget;
922
- const isCurrentTargetSlotted = isChildNode(targetHost, currentTargetHost); // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
923
- // shadow-excluding descendant node. In this case, we only invoke the listener if the target
924
- // host was assigned to a slot in the composed subtree of the current target host, or the
925
- // descendant node is in the shadow tree of the current root.
926
-
927
- return isCurrentTargetSlotted || targetHost === currentTargetHost;
928
- }
929
-
930
810
  function addCustomElementEventListener(type, listener, _options) {
931
811
  if (process.env.NODE_ENV !== 'production') {
932
812
  if (!isFunction(listener)) {
@@ -1674,6 +1554,20 @@
1674
1554
  }
1675
1555
  }
1676
1556
  }
1557
+ /**
1558
+ * Copyright (C) 2018 salesforce.com, inc.
1559
+ */
1560
+
1561
+
1562
+ if (!_globalThis.lwcRuntimeFlags) {
1563
+ Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
1564
+ value: create(null)
1565
+ });
1566
+ }
1567
+
1568
+ const runtimeFlags = _globalThis.lwcRuntimeFlags;
1569
+ /** version: 2.6.2 */
1570
+
1677
1571
  /*
1678
1572
  * Copyright (c) 2018, salesforce.com, inc.
1679
1573
  * All rights reserved.
@@ -1688,7 +1582,6 @@
1688
1582
  * because we don't want to patch the children getters for those elements.
1689
1583
  */
1690
1584
 
1691
-
1692
1585
  function hasMountedChildren(node) {
1693
1586
  return isSyntheticSlotElement(node) || isSyntheticShadowHost(node);
1694
1587
  }
@@ -5834,6 +5727,6 @@
5834
5727
 
5835
5728
  configurable: true
5836
5729
  });
5837
- /** version: 2.5.9 */
5730
+ /** version: 2.6.2 */
5838
5731
 
5839
5732
  }));