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