lwc 2.5.10 → 2.6.3
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.
- package/dist/engine-dom/esm/es2017/engine-dom.js +674 -471
- package/dist/engine-dom/iife/es2017/engine-dom.js +674 -471
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +647 -446
- package/dist/engine-dom/iife/es5/engine-dom.js +737 -433
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +704 -408
- package/dist/engine-dom/umd/es2017/engine-dom.js +674 -471
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +647 -446
- package/dist/engine-dom/umd/es5/engine-dom.js +737 -433
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +704 -408
- package/dist/engine-server/commonjs/es2017/engine-server.js +754 -549
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -9
- package/dist/engine-server/esm/es2017/engine-server.js +754 -549
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +135 -140
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +135 -140
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +135 -140
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +146 -137
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +146 -137
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +135 -140
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +135 -140
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +146 -137
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +146 -137
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +11 -11
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +11 -11
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +11 -11
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +11 -11
- package/package.json +8 -8
|
@@ -7,9 +7,13 @@
|
|
|
7
7
|
|
|
8
8
|
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; }
|
|
9
9
|
|
|
10
|
+
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); } }
|
|
11
|
+
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
|
|
10
14
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
15
|
|
|
12
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
16
|
+
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); }
|
|
13
17
|
|
|
14
18
|
/* proxy-compat-disable */
|
|
15
19
|
|
|
@@ -195,7 +199,7 @@
|
|
|
195
199
|
var hasNativeSymbolSupport = /*@__PURE__*/function () {
|
|
196
200
|
return Symbol('x').toString() === 'Symbol(x)';
|
|
197
201
|
}();
|
|
198
|
-
/** version: 2.
|
|
202
|
+
/** version: 2.6.3 */
|
|
199
203
|
|
|
200
204
|
/*
|
|
201
205
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -295,6 +299,9 @@
|
|
|
295
299
|
var shadowRootGetter = hasOwnProperty.call(Element.prototype, 'shadowRoot') ? getOwnPropertyDescriptor(Element.prototype, 'shadowRoot').get : function () {
|
|
296
300
|
return null;
|
|
297
301
|
};
|
|
302
|
+
var assignedSlotGetter$1 = hasOwnProperty.call(Element.prototype, 'assignedSlot') ? getOwnPropertyDescriptor(Element.prototype, 'assignedSlot').get : function () {
|
|
303
|
+
return null;
|
|
304
|
+
};
|
|
298
305
|
/*
|
|
299
306
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
300
307
|
* All rights reserved.
|
|
@@ -428,9 +435,9 @@
|
|
|
428
435
|
function apply$4() {
|
|
429
436
|
// IE11 does not have this element definition
|
|
430
437
|
// we don't care much about the construction phase, just the prototype
|
|
431
|
-
var HTMLSlotElement = function HTMLSlotElement() {
|
|
438
|
+
var HTMLSlotElement = /*#__PURE__*/_createClass(function HTMLSlotElement() {
|
|
432
439
|
_classCallCheck(this, HTMLSlotElement);
|
|
433
|
-
}; // prototype inheritance dance
|
|
440
|
+
}); // prototype inheritance dance
|
|
434
441
|
|
|
435
442
|
|
|
436
443
|
setPrototypeOf(HTMLSlotElement, HTMLElement.constructor);
|
|
@@ -516,20 +523,6 @@
|
|
|
516
523
|
|
|
517
524
|
return cloned;
|
|
518
525
|
}
|
|
519
|
-
/**
|
|
520
|
-
* Copyright (C) 2018 salesforce.com, inc.
|
|
521
|
-
*/
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
if (!_globalThis.lwcRuntimeFlags) {
|
|
525
|
-
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
|
|
526
|
-
value: create(null)
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
var runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
531
|
-
/** version: 2.5.10 */
|
|
532
|
-
|
|
533
526
|
/*
|
|
534
527
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
535
528
|
* All rights reserved.
|
|
@@ -537,6 +530,7 @@
|
|
|
537
530
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
538
531
|
*/
|
|
539
532
|
|
|
533
|
+
|
|
540
534
|
var eventTargetPrototype = typeof EventTarget !== 'undefined' ? EventTarget.prototype : _Node.prototype;
|
|
541
535
|
var addEventListener = eventTargetPrototype.addEventListener,
|
|
542
536
|
dispatchEvent = eventTargetPrototype.dispatchEvent,
|
|
@@ -589,17 +583,9 @@
|
|
|
589
583
|
assert.invariant(isFalse(isSyntheticShadowHost(currentTarget)), 'This routine should not be used to wrap event listeners for host elements and shadow roots.');
|
|
590
584
|
}
|
|
591
585
|
|
|
592
|
-
var
|
|
593
|
-
var shouldInvoke;
|
|
594
|
-
|
|
595
|
-
if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
|
|
596
|
-
shouldInvoke = !(eventToShadowRootMap.has(event) && isFalse(composed));
|
|
597
|
-
} else {
|
|
598
|
-
var actualTarget = getActualTarget(event);
|
|
599
|
-
shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
|
|
600
|
-
}
|
|
586
|
+
var actualTarget = getActualTarget(event);
|
|
601
587
|
|
|
602
|
-
if (!
|
|
588
|
+
if (!shouldInvokeListener(event, actualTarget, currentTarget)) {
|
|
603
589
|
return;
|
|
604
590
|
}
|
|
605
591
|
|
|
@@ -620,25 +606,6 @@
|
|
|
620
606
|
|
|
621
607
|
|
|
622
608
|
var eventToContextMap = new WeakMap();
|
|
623
|
-
|
|
624
|
-
function isChildNode(root, node) {
|
|
625
|
-
return !!(compareDocumentPosition.call(root, node) & DOCUMENT_POSITION_CONTAINED_BY);
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
var GET_ROOT_NODE_CONFIG_FALSE = {
|
|
629
|
-
composed: false
|
|
630
|
-
};
|
|
631
|
-
|
|
632
|
-
function getRootNodeHost(node, options) {
|
|
633
|
-
var rootNode = node.getRootNode(options);
|
|
634
|
-
|
|
635
|
-
if (isSyntheticShadowRoot(rootNode)) {
|
|
636
|
-
rootNode = getHost(rootNode);
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
return rootNode;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
609
|
var customElementToWrappedListeners = new WeakMap();
|
|
643
610
|
|
|
644
611
|
function getEventMap(elm) {
|
|
@@ -683,16 +650,9 @@
|
|
|
683
650
|
currentTarget = getShadowRoot(currentTarget);
|
|
684
651
|
}
|
|
685
652
|
|
|
686
|
-
var
|
|
687
|
-
|
|
688
|
-
if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
|
|
689
|
-
shouldInvoke = shouldInvokeShadowRootListener(event);
|
|
690
|
-
} else {
|
|
691
|
-
var actualTarget = getActualTarget(event);
|
|
692
|
-
shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
|
|
693
|
-
}
|
|
653
|
+
var actualTarget = getActualTarget(event);
|
|
694
654
|
|
|
695
|
-
if (
|
|
655
|
+
if (shouldInvokeListener(event, actualTarget, currentTarget)) {
|
|
696
656
|
listener.call(currentTarget, event);
|
|
697
657
|
}
|
|
698
658
|
};
|
|
@@ -719,16 +679,9 @@
|
|
|
719
679
|
customElementWrappedListener = function customElementWrappedListener(event) {
|
|
720
680
|
// currentTarget is always defined inside an event listener
|
|
721
681
|
var currentTarget = eventCurrentTargetGetter.call(event);
|
|
722
|
-
var
|
|
682
|
+
var actualTarget = getActualTarget(event);
|
|
723
683
|
|
|
724
|
-
if (
|
|
725
|
-
shouldInvoke = shouldInvokeCustomElementListener(event);
|
|
726
|
-
} else {
|
|
727
|
-
var actualTarget = getActualTarget(event);
|
|
728
|
-
shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
if (shouldInvoke) {
|
|
684
|
+
if (shouldInvokeListener(event, actualTarget, currentTarget)) {
|
|
732
685
|
listener.call(currentTarget, event);
|
|
733
686
|
}
|
|
734
687
|
};
|
|
@@ -845,66 +798,6 @@
|
|
|
845
798
|
}
|
|
846
799
|
}
|
|
847
800
|
|
|
848
|
-
function shouldInvokeCustomElementListener(event) {
|
|
849
|
-
var composed = event.composed;
|
|
850
|
-
|
|
851
|
-
if (isTrue(composed)) {
|
|
852
|
-
// Listeners on host elements should always be invoked for {composed: true} events.
|
|
853
|
-
return true;
|
|
854
|
-
} // If this {composed: false} event was dispatched on any root.
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
if (eventToShadowRootMap.has(event)) {
|
|
858
|
-
return false;
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
var target = eventTargetGetter.call(event);
|
|
862
|
-
var currentTarget = eventCurrentTargetGetter.call(event); // If this {composed: false} event was dispatched on the current target host.
|
|
863
|
-
|
|
864
|
-
if (target === currentTarget) {
|
|
865
|
-
return true;
|
|
866
|
-
} // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
|
|
867
|
-
// shadow-excluding descendant node. In this case, we only invoke the listener if the target
|
|
868
|
-
// host was assigned to a slot in the composed subtree of the current target host.
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
var targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
|
|
872
|
-
var currentTargetHost = currentTarget;
|
|
873
|
-
return isChildNode(targetHost, currentTargetHost);
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
function shouldInvokeShadowRootListener(event) {
|
|
877
|
-
var composed = event.composed;
|
|
878
|
-
var target = eventTargetGetter.call(event);
|
|
879
|
-
var currentTarget = eventCurrentTargetGetter.call(event); // If the event was dispatched on the host or its root.
|
|
880
|
-
|
|
881
|
-
if (target === currentTarget) {
|
|
882
|
-
// Invoke the listener if the event was dispatched directly on the root.
|
|
883
|
-
return eventToShadowRootMap.get(event) === getShadowRoot(target);
|
|
884
|
-
} // At this point the event is {bubbles: true} and was dispatched from a shadow-including descendant node.
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
if (isTrue(composed)) {
|
|
888
|
-
// Invoke the listener if the event is {composed: true}.
|
|
889
|
-
return true;
|
|
890
|
-
} // At this point the event must be {bubbles: true, composed: false}.
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
if (isTrue(eventToShadowRootMap.has(event))) {
|
|
894
|
-
// Don't invoke the listener because the event was dispatched on a descendant root.
|
|
895
|
-
return false;
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
var targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
|
|
899
|
-
var currentTargetHost = currentTarget;
|
|
900
|
-
var isCurrentTargetSlotted = isChildNode(targetHost, currentTargetHost); // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
|
|
901
|
-
// shadow-excluding descendant node. In this case, we only invoke the listener if the target
|
|
902
|
-
// host was assigned to a slot in the composed subtree of the current target host, or the
|
|
903
|
-
// descendant node is in the shadow tree of the current root.
|
|
904
|
-
|
|
905
|
-
return isCurrentTargetSlotted || targetHost === currentTargetHost;
|
|
906
|
-
}
|
|
907
|
-
|
|
908
801
|
function addCustomElementEventListener(type, listener, _options) {
|
|
909
802
|
if (process.env.NODE_ENV !== 'production') {
|
|
910
803
|
if (!isFunction(listener)) {
|
|
@@ -1019,6 +912,15 @@
|
|
|
1019
912
|
function isNodeShadowed(node) {
|
|
1020
913
|
return !isUndefined(getNodeOwnerKey(node));
|
|
1021
914
|
}
|
|
915
|
+
/**
|
|
916
|
+
* Returns true if this node is a shadow host, is in a shadow host, or contains a shadow host
|
|
917
|
+
* anywhere in its tree.
|
|
918
|
+
*/
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
function isNodeOrDescendantsShadowed(node) {
|
|
922
|
+
return isNodeShadowed(node) || isSyntheticShadowHost(node) || containsHost(node);
|
|
923
|
+
}
|
|
1022
924
|
/*
|
|
1023
925
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
1024
926
|
* All rights reserved.
|
|
@@ -1620,6 +1522,20 @@
|
|
|
1620
1522
|
}
|
|
1621
1523
|
}
|
|
1622
1524
|
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Copyright (C) 2018 salesforce.com, inc.
|
|
1527
|
+
*/
|
|
1528
|
+
|
|
1529
|
+
|
|
1530
|
+
if (!_globalThis.lwcRuntimeFlags) {
|
|
1531
|
+
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
|
|
1532
|
+
value: create(null)
|
|
1533
|
+
});
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
var runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
1537
|
+
/** version: 2.6.3 */
|
|
1538
|
+
|
|
1623
1539
|
/*
|
|
1624
1540
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
1625
1541
|
* All rights reserved.
|
|
@@ -1634,7 +1550,6 @@
|
|
|
1634
1550
|
* because we don't want to patch the children getters for those elements.
|
|
1635
1551
|
*/
|
|
1636
1552
|
|
|
1637
|
-
|
|
1638
1553
|
function hasMountedChildren(node) {
|
|
1639
1554
|
return isSyntheticSlotElement(node) || isSyntheticShadowHost(node);
|
|
1640
1555
|
}
|
|
@@ -1713,7 +1628,9 @@
|
|
|
1713
1628
|
}
|
|
1714
1629
|
|
|
1715
1630
|
function compareDocumentPositionPatched(otherNode) {
|
|
1716
|
-
if (this
|
|
1631
|
+
if (this === otherNode) {
|
|
1632
|
+
return 0;
|
|
1633
|
+
} else if (this.getRootNode() === otherNode) {
|
|
1717
1634
|
// "this" is in a shadow tree where the shadow root is the "otherNode".
|
|
1718
1635
|
return 10; // Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING
|
|
1719
1636
|
} else if (getNodeOwnerKey(this) !== getNodeOwnerKey(otherNode)) {
|
|
@@ -1759,7 +1676,7 @@
|
|
|
1759
1676
|
function childNodesGetterPatched() {
|
|
1760
1677
|
if (isSyntheticShadowHost(this)) {
|
|
1761
1678
|
var owner = getNodeOwner(this);
|
|
1762
|
-
var childNodes = isNull(owner) ?
|
|
1679
|
+
var childNodes = isNull(owner) ? getFilteredChildNodes(this) : getAllMatches(owner, getFilteredChildNodes(this));
|
|
1763
1680
|
|
|
1764
1681
|
if (process.env.NODE_ENV !== 'production' && isFalse(hasNativeSymbolSupport) && isExternalChildNodeAccessorFlagOn()) {
|
|
1765
1682
|
// inserting a comment node as the first childNode to trick the IE11
|
|
@@ -1868,7 +1785,8 @@
|
|
|
1868
1785
|
textContent: {
|
|
1869
1786
|
get: function get() {
|
|
1870
1787
|
if (!runtimeFlags.ENABLE_NODE_PATCH) {
|
|
1871
|
-
|
|
1788
|
+
// See note on get innerHTML in faux-shadow/element.ts
|
|
1789
|
+
if (isNodeOrDescendantsShadowed(this)) {
|
|
1872
1790
|
return textContentGetterPatched.call(this);
|
|
1873
1791
|
}
|
|
1874
1792
|
|
|
@@ -2093,7 +2011,22 @@
|
|
|
2093
2011
|
}
|
|
2094
2012
|
|
|
2095
2013
|
return rootNodes;
|
|
2096
|
-
}
|
|
2014
|
+
} // Keep searching up the host tree until we find an element that is within the immediate shadow root
|
|
2015
|
+
|
|
2016
|
+
|
|
2017
|
+
var findAncestorHostInImmediateShadowRoot = function findAncestorHostInImmediateShadowRoot(rootNode, targetRootNode) {
|
|
2018
|
+
var host;
|
|
2019
|
+
|
|
2020
|
+
while (!isUndefined(host = rootNode.host)) {
|
|
2021
|
+
var thisRootNode = host.getRootNode();
|
|
2022
|
+
|
|
2023
|
+
if (thisRootNode === targetRootNode) {
|
|
2024
|
+
return host;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
rootNode = thisRootNode;
|
|
2028
|
+
}
|
|
2029
|
+
};
|
|
2097
2030
|
|
|
2098
2031
|
function fauxElementsFromPoint(context, doc, left, top) {
|
|
2099
2032
|
var elements = elementsFromPoint.call(doc, left, top);
|
|
@@ -2107,8 +2040,28 @@
|
|
|
2107
2040
|
for (var i = 0; i < elements.length; i++) {
|
|
2108
2041
|
var element = elements[i];
|
|
2109
2042
|
|
|
2110
|
-
if (
|
|
2111
|
-
|
|
2043
|
+
if (isSyntheticSlotElement(element)) {
|
|
2044
|
+
continue;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
var elementRootNode = element.getRootNode();
|
|
2048
|
+
|
|
2049
|
+
if (ArrayIndexOf.call(rootNodes, elementRootNode) !== -1) {
|
|
2050
|
+
ArrayPush.call(result, element);
|
|
2051
|
+
continue;
|
|
2052
|
+
} // In cases where the host element is not visible but its shadow descendants are, then
|
|
2053
|
+
// we may get the shadow descendant instead of the host element here. (The
|
|
2054
|
+
// browser doesn't know the difference in synthetic shadow DOM.)
|
|
2055
|
+
// In native shadow DOM, however, elementsFromPoint would return the host but not
|
|
2056
|
+
// the child. So we need to detect if this shadow element's host is accessible from
|
|
2057
|
+
// the context's shadow root. Note we also need to be careful not to add the host
|
|
2058
|
+
// multiple times.
|
|
2059
|
+
|
|
2060
|
+
|
|
2061
|
+
var ancestorHost = findAncestorHostInImmediateShadowRoot(elementRootNode, rootNodes[0]);
|
|
2062
|
+
|
|
2063
|
+
if (!isUndefined(ancestorHost) && ArrayIndexOf.call(elements, ancestorHost) === -1 && ArrayIndexOf.call(result, ancestorHost) === -1) {
|
|
2064
|
+
ArrayPush.call(result, ancestorHost);
|
|
2112
2065
|
}
|
|
2113
2066
|
}
|
|
2114
2067
|
}
|
|
@@ -2188,6 +2141,29 @@
|
|
|
2188
2141
|
function isSyntheticShadowRoot(node) {
|
|
2189
2142
|
var shadowRootRecord = InternalSlot.get(node);
|
|
2190
2143
|
return !isUndefined(shadowRootRecord) && node === shadowRootRecord.shadowRoot;
|
|
2144
|
+
} // Return true if any descendant is a host element
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
function containsHost(node) {
|
|
2148
|
+
// IE11 complains with "Unexpected call to method or property access." when calling walker.nextNode().
|
|
2149
|
+
// The fix for this is to only walk trees for nodes that are Node.ELEMENT_NODE.
|
|
2150
|
+
if (node.nodeType !== _Node.ELEMENT_NODE) {
|
|
2151
|
+
return false;
|
|
2152
|
+
} // IE requires all four arguments, even though the fourth is deprecated
|
|
2153
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Document/createTreeWalker#browser_compatibility
|
|
2154
|
+
// @ts-ignore
|
|
2155
|
+
|
|
2156
|
+
|
|
2157
|
+
var walker = document.createTreeWalker(node, NodeFilter.SHOW_ELEMENT, null, false);
|
|
2158
|
+
var descendant;
|
|
2159
|
+
|
|
2160
|
+
while (!isNull(descendant = walker.nextNode())) {
|
|
2161
|
+
if (isSyntheticShadowHost(descendant)) {
|
|
2162
|
+
return true;
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
return false;
|
|
2191
2167
|
}
|
|
2192
2168
|
|
|
2193
2169
|
var uid = 0;
|
|
@@ -2236,6 +2212,12 @@
|
|
|
2236
2212
|
value: function value() {
|
|
2237
2213
|
return "[object ShadowRoot]";
|
|
2238
2214
|
}
|
|
2215
|
+
},
|
|
2216
|
+
synthetic: {
|
|
2217
|
+
writable: false,
|
|
2218
|
+
enumerable: false,
|
|
2219
|
+
configurable: false,
|
|
2220
|
+
value: true
|
|
2239
2221
|
}
|
|
2240
2222
|
};
|
|
2241
2223
|
var ShadowRootDescriptors = {
|
|
@@ -3967,6 +3949,16 @@
|
|
|
3967
3949
|
*/
|
|
3968
3950
|
|
|
3969
3951
|
retargetRelatedTarget(MouseEvent);
|
|
3952
|
+
/*
|
|
3953
|
+
* Copyright (c) 2021, salesforce.com, inc.
|
|
3954
|
+
* All rights reserved.
|
|
3955
|
+
* SPDX-License-Identifier: MIT
|
|
3956
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3957
|
+
*/
|
|
3958
|
+
|
|
3959
|
+
var assignedSlotGetter = hasOwnProperty.call(Text.prototype, 'assignedSlot') ? getOwnPropertyDescriptor(Text.prototype, 'assignedSlot').get : function () {
|
|
3960
|
+
return null;
|
|
3961
|
+
};
|
|
3970
3962
|
/*
|
|
3971
3963
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
3972
3964
|
* All rights reserved.
|
|
@@ -4018,10 +4010,22 @@
|
|
|
4018
4010
|
}
|
|
4019
4011
|
|
|
4020
4012
|
function assignedSlotGetterPatched() {
|
|
4021
|
-
var parentNode = parentNodeGetter.call(this);
|
|
4013
|
+
var parentNode = parentNodeGetter.call(this); // use original assignedSlot if parent has a native shdow root
|
|
4014
|
+
|
|
4015
|
+
if (parentNode instanceof Element) {
|
|
4016
|
+
var sr = shadowRootGetter.call(parentNode);
|
|
4017
|
+
|
|
4018
|
+
if (isInstanceOfNativeShadowRoot(sr)) {
|
|
4019
|
+
if (this instanceof Text) {
|
|
4020
|
+
return assignedSlotGetter.call(this);
|
|
4021
|
+
}
|
|
4022
|
+
|
|
4023
|
+
return assignedSlotGetter$1.call(this);
|
|
4024
|
+
}
|
|
4025
|
+
}
|
|
4022
4026
|
/**
|
|
4023
4027
|
* The node is assigned to a slot if:
|
|
4024
|
-
* - it has a parent and
|
|
4028
|
+
* - it has a parent and its parent is a slot element
|
|
4025
4029
|
* - and if the slot owner key is different than the node owner key.
|
|
4026
4030
|
*
|
|
4027
4031
|
* When the slot and the slotted node are 2 different shadow trees, the owner keys will be
|
|
@@ -4030,6 +4034,7 @@
|
|
|
4030
4034
|
* different than the node owner key (always `undefined`).
|
|
4031
4035
|
*/
|
|
4032
4036
|
|
|
4037
|
+
|
|
4033
4038
|
if (!isNull(parentNode) && isSlotElement(parentNode) && getNodeOwnerKey(parentNode) !== getNodeOwnerKey(this)) {
|
|
4034
4039
|
return parentNode;
|
|
4035
4040
|
}
|
|
@@ -4246,7 +4251,10 @@
|
|
|
4246
4251
|
innerHTML: {
|
|
4247
4252
|
get: function get() {
|
|
4248
4253
|
if (!runtimeFlags.ENABLE_ELEMENT_PATCH) {
|
|
4249
|
-
|
|
4254
|
+
// If this element is in synthetic shadow, if it's a synthetic shadow host,
|
|
4255
|
+
// or if any of its descendants are synthetic shadow hosts, then we can't
|
|
4256
|
+
// use the native innerHTML because it would expose private node internals.
|
|
4257
|
+
if (isNodeOrDescendantsShadowed(this)) {
|
|
4250
4258
|
return innerHTMLGetterPatched.call(this);
|
|
4251
4259
|
}
|
|
4252
4260
|
|
|
@@ -4269,7 +4277,8 @@
|
|
|
4269
4277
|
outerHTML: {
|
|
4270
4278
|
get: function get() {
|
|
4271
4279
|
if (!runtimeFlags.ENABLE_ELEMENT_PATCH) {
|
|
4272
|
-
|
|
4280
|
+
// See notes above on get innerHTML
|
|
4281
|
+
if (isNodeOrDescendantsShadowed(this)) {
|
|
4273
4282
|
return outerHTMLGetterPatched.call(this);
|
|
4274
4283
|
}
|
|
4275
4284
|
|
|
@@ -5633,6 +5642,6 @@
|
|
|
5633
5642
|
},
|
|
5634
5643
|
configurable: true
|
|
5635
5644
|
});
|
|
5636
|
-
/** version: 2.
|
|
5645
|
+
/** version: 2.6.3 */
|
|
5637
5646
|
|
|
5638
5647
|
}));
|