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
@@ -194,7 +194,7 @@ const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
194
194
  // we can't use typeof since it will fail when transpiling.
195
195
 
196
196
  const hasNativeSymbolSupport = /*@__PURE__*/(() => Symbol('x').toString() === 'Symbol(x)')();
197
- /** version: 2.5.9 */
197
+ /** version: 2.6.2 */
198
198
 
199
199
  /*
200
200
  * Copyright (c) 2018, salesforce.com, inc.
@@ -521,20 +521,6 @@ function arrayFromCollection(collection) {
521
521
 
522
522
  return cloned;
523
523
  }
524
- /**
525
- * Copyright (C) 2018 salesforce.com, inc.
526
- */
527
-
528
-
529
- if (!_globalThis.lwcRuntimeFlags) {
530
- Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
531
- value: create(null)
532
- });
533
- }
534
-
535
- const runtimeFlags = _globalThis.lwcRuntimeFlags;
536
- /** version: 2.5.9 */
537
-
538
524
  /*
539
525
  * Copyright (c) 2018, salesforce.com, inc.
540
526
  * All rights reserved.
@@ -542,6 +528,7 @@ const runtimeFlags = _globalThis.lwcRuntimeFlags;
542
528
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
543
529
  */
544
530
 
531
+
545
532
  const eventTargetPrototype = typeof EventTarget !== 'undefined' ? EventTarget.prototype : _Node.prototype;
546
533
  const {
547
534
  addEventListener,
@@ -596,19 +583,9 @@ function getEventListenerWrapper(fnOrObj) {
596
583
  assert.invariant(isFalse(isSyntheticShadowHost(currentTarget)), 'This routine should not be used to wrap event listeners for host elements and shadow roots.');
597
584
  }
598
585
 
599
- const {
600
- composed
601
- } = event;
602
- let shouldInvoke;
603
-
604
- if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
605
- shouldInvoke = !(eventToShadowRootMap.has(event) && isFalse(composed));
606
- } else {
607
- const actualTarget = getActualTarget(event);
608
- shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
609
- }
586
+ const actualTarget = getActualTarget(event);
610
587
 
611
- if (!shouldInvoke) {
588
+ if (!shouldInvokeListener(event, actualTarget, currentTarget)) {
612
589
  return;
613
590
  }
614
591
 
@@ -629,25 +606,6 @@ function getEventListenerWrapper(fnOrObj) {
629
606
 
630
607
 
631
608
  const eventToContextMap = new WeakMap();
632
-
633
- function isChildNode(root, node) {
634
- return !!(compareDocumentPosition.call(root, node) & DOCUMENT_POSITION_CONTAINED_BY);
635
- }
636
-
637
- const GET_ROOT_NODE_CONFIG_FALSE = {
638
- composed: false
639
- };
640
-
641
- function getRootNodeHost(node, options) {
642
- let rootNode = node.getRootNode(options);
643
-
644
- if (isSyntheticShadowRoot(rootNode)) {
645
- rootNode = getHost(rootNode);
646
- }
647
-
648
- return rootNode;
649
- }
650
-
651
609
  const customElementToWrappedListeners = new WeakMap();
652
610
 
653
611
  function getEventMap(elm) {
@@ -692,16 +650,9 @@ function getWrappedShadowRootListener(listener) {
692
650
  currentTarget = getShadowRoot(currentTarget);
693
651
  }
694
652
 
695
- let shouldInvoke;
653
+ const actualTarget = getActualTarget(event);
696
654
 
697
- if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
698
- shouldInvoke = shouldInvokeShadowRootListener(event);
699
- } else {
700
- const actualTarget = getActualTarget(event);
701
- shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
702
- }
703
-
704
- if (shouldInvoke) {
655
+ if (shouldInvokeListener(event, actualTarget, currentTarget)) {
705
656
  listener.call(currentTarget, event);
706
657
  }
707
658
  };
@@ -728,16 +679,9 @@ function getWrappedCustomElementListener(listener) {
728
679
  customElementWrappedListener = function (event) {
729
680
  // currentTarget is always defined inside an event listener
730
681
  const currentTarget = eventCurrentTargetGetter.call(event);
731
- let shouldInvoke;
682
+ const actualTarget = getActualTarget(event);
732
683
 
733
- if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
734
- shouldInvoke = shouldInvokeCustomElementListener(event);
735
- } else {
736
- const actualTarget = getActualTarget(event);
737
- shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
738
- }
739
-
740
- if (shouldInvoke) {
684
+ if (shouldInvokeListener(event, actualTarget, currentTarget)) {
741
685
  listener.call(currentTarget, event);
742
686
  }
743
687
  };
@@ -858,70 +802,6 @@ function detachDOMListener(elm, type, wrappedListener) {
858
802
  }
859
803
  }
860
804
 
861
- function shouldInvokeCustomElementListener(event) {
862
- const {
863
- composed
864
- } = event;
865
-
866
- if (isTrue(composed)) {
867
- // Listeners on host elements should always be invoked for {composed: true} events.
868
- return true;
869
- } // If this {composed: false} event was dispatched on any root.
870
-
871
-
872
- if (eventToShadowRootMap.has(event)) {
873
- return false;
874
- }
875
-
876
- const target = eventTargetGetter.call(event);
877
- const currentTarget = eventCurrentTargetGetter.call(event); // If this {composed: false} event was dispatched on the current target host.
878
-
879
- if (target === currentTarget) {
880
- return true;
881
- } // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
882
- // shadow-excluding descendant node. In this case, we only invoke the listener if the target
883
- // host was assigned to a slot in the composed subtree of the current target host.
884
-
885
-
886
- const targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
887
- const currentTargetHost = currentTarget;
888
- return isChildNode(targetHost, currentTargetHost);
889
- }
890
-
891
- function shouldInvokeShadowRootListener(event) {
892
- const {
893
- composed
894
- } = event;
895
- const target = eventTargetGetter.call(event);
896
- const currentTarget = eventCurrentTargetGetter.call(event); // If the event was dispatched on the host or its root.
897
-
898
- if (target === currentTarget) {
899
- // Invoke the listener if the event was dispatched directly on the root.
900
- return eventToShadowRootMap.get(event) === getShadowRoot(target);
901
- } // At this point the event is {bubbles: true} and was dispatched from a shadow-including descendant node.
902
-
903
-
904
- if (isTrue(composed)) {
905
- // Invoke the listener if the event is {composed: true}.
906
- return true;
907
- } // At this point the event must be {bubbles: true, composed: false}.
908
-
909
-
910
- if (isTrue(eventToShadowRootMap.has(event))) {
911
- // Don't invoke the listener because the event was dispatched on a descendant root.
912
- return false;
913
- }
914
-
915
- const targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
916
- const currentTargetHost = currentTarget;
917
- const isCurrentTargetSlotted = isChildNode(targetHost, currentTargetHost); // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
918
- // shadow-excluding descendant node. In this case, we only invoke the listener if the target
919
- // host was assigned to a slot in the composed subtree of the current target host, or the
920
- // descendant node is in the shadow tree of the current root.
921
-
922
- return isCurrentTargetSlotted || targetHost === currentTargetHost;
923
- }
924
-
925
805
  function addCustomElementEventListener(type, listener, _options) {
926
806
  if (process.env.NODE_ENV !== 'production') {
927
807
  if (!isFunction(listener)) {
@@ -1669,6 +1549,20 @@ function getOuterHTML(node) {
1669
1549
  }
1670
1550
  }
1671
1551
  }
1552
+ /**
1553
+ * Copyright (C) 2018 salesforce.com, inc.
1554
+ */
1555
+
1556
+
1557
+ if (!_globalThis.lwcRuntimeFlags) {
1558
+ Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
1559
+ value: create(null)
1560
+ });
1561
+ }
1562
+
1563
+ const runtimeFlags = _globalThis.lwcRuntimeFlags;
1564
+ /** version: 2.6.2 */
1565
+
1672
1566
  /*
1673
1567
  * Copyright (c) 2018, salesforce.com, inc.
1674
1568
  * All rights reserved.
@@ -1683,7 +1577,6 @@ function getOuterHTML(node) {
1683
1577
  * because we don't want to patch the children getters for those elements.
1684
1578
  */
1685
1579
 
1686
-
1687
1580
  function hasMountedChildren(node) {
1688
1581
  return isSyntheticSlotElement(node) || isSyntheticShadowHost(node);
1689
1582
  }
@@ -5829,4 +5722,4 @@ defineProperty(Element.prototype, '$domManual$', {
5829
5722
 
5830
5723
  configurable: true
5831
5724
  });
5832
- /** version: 2.5.9 */
5725
+ /** version: 2.6.2 */
@@ -197,7 +197,7 @@
197
197
  // we can't use typeof since it will fail when transpiling.
198
198
 
199
199
  const hasNativeSymbolSupport = /*@__PURE__*/(() => Symbol('x').toString() === 'Symbol(x)')();
200
- /** version: 2.5.9 */
200
+ /** version: 2.6.2 */
201
201
 
202
202
  /*
203
203
  * Copyright (c) 2018, salesforce.com, inc.
@@ -524,20 +524,6 @@
524
524
 
525
525
  return cloned;
526
526
  }
527
- /**
528
- * Copyright (C) 2018 salesforce.com, inc.
529
- */
530
-
531
-
532
- if (!_globalThis.lwcRuntimeFlags) {
533
- Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
534
- value: create(null)
535
- });
536
- }
537
-
538
- const runtimeFlags = _globalThis.lwcRuntimeFlags;
539
- /** version: 2.5.9 */
540
-
541
527
  /*
542
528
  * Copyright (c) 2018, salesforce.com, inc.
543
529
  * All rights reserved.
@@ -545,6 +531,7 @@
545
531
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
546
532
  */
547
533
 
534
+
548
535
  const eventTargetPrototype = typeof EventTarget !== 'undefined' ? EventTarget.prototype : _Node.prototype;
549
536
  const {
550
537
  addEventListener,
@@ -599,19 +586,9 @@
599
586
  assert.invariant(isFalse(isSyntheticShadowHost(currentTarget)), 'This routine should not be used to wrap event listeners for host elements and shadow roots.');
600
587
  }
601
588
 
602
- const {
603
- composed
604
- } = event;
605
- let shouldInvoke;
606
-
607
- if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
608
- shouldInvoke = !(eventToShadowRootMap.has(event) && isFalse(composed));
609
- } else {
610
- const actualTarget = getActualTarget(event);
611
- shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
612
- }
589
+ const actualTarget = getActualTarget(event);
613
590
 
614
- if (!shouldInvoke) {
591
+ if (!shouldInvokeListener(event, actualTarget, currentTarget)) {
615
592
  return;
616
593
  }
617
594
 
@@ -632,25 +609,6 @@
632
609
 
633
610
 
634
611
  const eventToContextMap = new WeakMap();
635
-
636
- function isChildNode(root, node) {
637
- return !!(compareDocumentPosition.call(root, node) & DOCUMENT_POSITION_CONTAINED_BY);
638
- }
639
-
640
- const GET_ROOT_NODE_CONFIG_FALSE = {
641
- composed: false
642
- };
643
-
644
- function getRootNodeHost(node, options) {
645
- let rootNode = node.getRootNode(options);
646
-
647
- if (isSyntheticShadowRoot(rootNode)) {
648
- rootNode = getHost(rootNode);
649
- }
650
-
651
- return rootNode;
652
- }
653
-
654
612
  const customElementToWrappedListeners = new WeakMap();
655
613
 
656
614
  function getEventMap(elm) {
@@ -695,16 +653,9 @@
695
653
  currentTarget = getShadowRoot(currentTarget);
696
654
  }
697
655
 
698
- let shouldInvoke;
656
+ const actualTarget = getActualTarget(event);
699
657
 
700
- if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
701
- shouldInvoke = shouldInvokeShadowRootListener(event);
702
- } else {
703
- const actualTarget = getActualTarget(event);
704
- shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
705
- }
706
-
707
- if (shouldInvoke) {
658
+ if (shouldInvokeListener(event, actualTarget, currentTarget)) {
708
659
  listener.call(currentTarget, event);
709
660
  }
710
661
  };
@@ -731,16 +682,9 @@
731
682
  customElementWrappedListener = function (event) {
732
683
  // currentTarget is always defined inside an event listener
733
684
  const currentTarget = eventCurrentTargetGetter.call(event);
734
- let shouldInvoke;
685
+ const actualTarget = getActualTarget(event);
735
686
 
736
- if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
737
- shouldInvoke = shouldInvokeCustomElementListener(event);
738
- } else {
739
- const actualTarget = getActualTarget(event);
740
- shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
741
- }
742
-
743
- if (shouldInvoke) {
687
+ if (shouldInvokeListener(event, actualTarget, currentTarget)) {
744
688
  listener.call(currentTarget, event);
745
689
  }
746
690
  };
@@ -861,70 +805,6 @@
861
805
  }
862
806
  }
863
807
 
864
- function shouldInvokeCustomElementListener(event) {
865
- const {
866
- composed
867
- } = event;
868
-
869
- if (isTrue(composed)) {
870
- // Listeners on host elements should always be invoked for {composed: true} events.
871
- return true;
872
- } // If this {composed: false} event was dispatched on any root.
873
-
874
-
875
- if (eventToShadowRootMap.has(event)) {
876
- return false;
877
- }
878
-
879
- const target = eventTargetGetter.call(event);
880
- const currentTarget = eventCurrentTargetGetter.call(event); // If this {composed: false} event was dispatched on the current target host.
881
-
882
- if (target === currentTarget) {
883
- return true;
884
- } // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
885
- // shadow-excluding descendant node. In this case, we only invoke the listener if the target
886
- // host was assigned to a slot in the composed subtree of the current target host.
887
-
888
-
889
- const targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
890
- const currentTargetHost = currentTarget;
891
- return isChildNode(targetHost, currentTargetHost);
892
- }
893
-
894
- function shouldInvokeShadowRootListener(event) {
895
- const {
896
- composed
897
- } = event;
898
- const target = eventTargetGetter.call(event);
899
- const currentTarget = eventCurrentTargetGetter.call(event); // If the event was dispatched on the host or its root.
900
-
901
- if (target === currentTarget) {
902
- // Invoke the listener if the event was dispatched directly on the root.
903
- return eventToShadowRootMap.get(event) === getShadowRoot(target);
904
- } // At this point the event is {bubbles: true} and was dispatched from a shadow-including descendant node.
905
-
906
-
907
- if (isTrue(composed)) {
908
- // Invoke the listener if the event is {composed: true}.
909
- return true;
910
- } // At this point the event must be {bubbles: true, composed: false}.
911
-
912
-
913
- if (isTrue(eventToShadowRootMap.has(event))) {
914
- // Don't invoke the listener because the event was dispatched on a descendant root.
915
- return false;
916
- }
917
-
918
- const targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
919
- const currentTargetHost = currentTarget;
920
- const isCurrentTargetSlotted = isChildNode(targetHost, currentTargetHost); // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
921
- // shadow-excluding descendant node. In this case, we only invoke the listener if the target
922
- // host was assigned to a slot in the composed subtree of the current target host, or the
923
- // descendant node is in the shadow tree of the current root.
924
-
925
- return isCurrentTargetSlotted || targetHost === currentTargetHost;
926
- }
927
-
928
808
  function addCustomElementEventListener(type, listener, _options) {
929
809
  if (process.env.NODE_ENV !== 'production') {
930
810
  if (!isFunction(listener)) {
@@ -1672,6 +1552,20 @@
1672
1552
  }
1673
1553
  }
1674
1554
  }
1555
+ /**
1556
+ * Copyright (C) 2018 salesforce.com, inc.
1557
+ */
1558
+
1559
+
1560
+ if (!_globalThis.lwcRuntimeFlags) {
1561
+ Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
1562
+ value: create(null)
1563
+ });
1564
+ }
1565
+
1566
+ const runtimeFlags = _globalThis.lwcRuntimeFlags;
1567
+ /** version: 2.6.2 */
1568
+
1675
1569
  /*
1676
1570
  * Copyright (c) 2018, salesforce.com, inc.
1677
1571
  * All rights reserved.
@@ -1686,7 +1580,6 @@
1686
1580
  * because we don't want to patch the children getters for those elements.
1687
1581
  */
1688
1582
 
1689
-
1690
1583
  function hasMountedChildren(node) {
1691
1584
  return isSyntheticSlotElement(node) || isSyntheticShadowHost(node);
1692
1585
  }
@@ -5832,6 +5725,6 @@
5832
5725
 
5833
5726
  configurable: true
5834
5727
  });
5835
- /** version: 2.5.9 */
5728
+ /** version: 2.6.2 */
5836
5729
 
5837
5730
  })();