lwc 2.35.2 → 2.36.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.
- package/dist/engine-dom/esm/es2017/engine-dom.js +245 -89
- package/dist/engine-dom/iife/es2017/engine-dom.js +245 -89
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +273 -45
- package/dist/engine-dom/iife/es5/engine-dom.js +402 -232
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +449 -161
- package/dist/engine-dom/umd/es2017/engine-dom.js +245 -89
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +273 -45
- package/dist/engine-dom/umd/es5/engine-dom.js +402 -232
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +449 -161
- package/dist/engine-server/commonjs/es2017/engine-server.js +124 -77
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +124 -77
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
- 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 +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- 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 +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +7 -7
|
@@ -89,13 +89,18 @@
|
|
|
89
89
|
setPrototypeOf = Object.setPrototypeOf;
|
|
90
90
|
var isArray$1 = Array.isArray;
|
|
91
91
|
var _Array$prototype = Array.prototype,
|
|
92
|
+
ArrayCopyWithin = _Array$prototype.copyWithin,
|
|
93
|
+
ArrayFill = _Array$prototype.fill,
|
|
92
94
|
ArrayFilter = _Array$prototype.filter,
|
|
93
95
|
ArrayIndexOf = _Array$prototype.indexOf,
|
|
94
96
|
ArrayJoin = _Array$prototype.join,
|
|
95
97
|
ArrayMap = _Array$prototype.map,
|
|
96
98
|
ArrayPop = _Array$prototype.pop,
|
|
97
99
|
ArrayPush$1 = _Array$prototype.push,
|
|
100
|
+
ArrayReverse = _Array$prototype.reverse,
|
|
101
|
+
ArrayShift = _Array$prototype.shift,
|
|
98
102
|
ArraySlice = _Array$prototype.slice,
|
|
103
|
+
ArraySort = _Array$prototype.sort,
|
|
99
104
|
ArraySplice = _Array$prototype.splice,
|
|
100
105
|
ArrayUnshift = _Array$prototype.unshift,
|
|
101
106
|
forEach = _Array$prototype.forEach;
|
|
@@ -313,7 +318,7 @@
|
|
|
313
318
|
CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
|
|
314
319
|
return propertyName;
|
|
315
320
|
}
|
|
316
|
-
/** version: 2.
|
|
321
|
+
/** version: 2.36.0 */
|
|
317
322
|
|
|
318
323
|
/**
|
|
319
324
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -385,7 +390,7 @@
|
|
|
385
390
|
*/
|
|
386
391
|
function setFeatureFlagForTest(name, value) {
|
|
387
392
|
}
|
|
388
|
-
/** version: 2.
|
|
393
|
+
/** version: 2.36.0 */
|
|
389
394
|
|
|
390
395
|
/**
|
|
391
396
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -449,7 +454,7 @@
|
|
|
449
454
|
}
|
|
450
455
|
}
|
|
451
456
|
}
|
|
452
|
-
/** version: 2.
|
|
457
|
+
/** version: 2.36.0 */
|
|
453
458
|
|
|
454
459
|
/*
|
|
455
460
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -469,7 +474,6 @@
|
|
|
469
474
|
* SPDX-License-Identifier: MIT
|
|
470
475
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
471
476
|
*/
|
|
472
|
-
/** Callbacks to invoke when reporting is enabled **/
|
|
473
477
|
var onReportingEnabledCallbacks = [];
|
|
474
478
|
/** The currently assigned reporting dispatcher. */
|
|
475
479
|
var currentDispatcher$1 = noop;
|
|
@@ -526,11 +530,11 @@
|
|
|
526
530
|
/**
|
|
527
531
|
* Report to the current dispatcher, if there is one.
|
|
528
532
|
* @param reportingEventId
|
|
529
|
-
* @param
|
|
533
|
+
* @param payload - data to report
|
|
530
534
|
*/
|
|
531
|
-
function report(reportingEventId,
|
|
535
|
+
function report(reportingEventId, payload) {
|
|
532
536
|
if (enabled$1) {
|
|
533
|
-
currentDispatcher$1(reportingEventId,
|
|
537
|
+
currentDispatcher$1(reportingEventId, payload);
|
|
534
538
|
}
|
|
535
539
|
}
|
|
536
540
|
|
|
@@ -794,31 +798,39 @@
|
|
|
794
798
|
// Make a shallow copy of an object but omit the given key
|
|
795
799
|
function cloneAndOmitKey(object, keyToOmit) {
|
|
796
800
|
var result = {};
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
+
var _iterator2 = _createForOfIteratorHelper(keys(object)),
|
|
802
|
+
_step2;
|
|
803
|
+
try {
|
|
804
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
805
|
+
var key = _step2.value;
|
|
806
|
+
if (key !== keyToOmit) {
|
|
807
|
+
result[key] = object[key];
|
|
808
|
+
}
|
|
801
809
|
}
|
|
810
|
+
} catch (err) {
|
|
811
|
+
_iterator2.e(err);
|
|
812
|
+
} finally {
|
|
813
|
+
_iterator2.f();
|
|
802
814
|
}
|
|
803
815
|
return result;
|
|
804
816
|
}
|
|
805
817
|
function flattenStylesheets(stylesheets) {
|
|
806
818
|
var list = [];
|
|
807
|
-
var
|
|
808
|
-
|
|
819
|
+
var _iterator3 = _createForOfIteratorHelper(stylesheets),
|
|
820
|
+
_step3;
|
|
809
821
|
try {
|
|
810
|
-
for (
|
|
811
|
-
var stylesheet =
|
|
812
|
-
if (!
|
|
822
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
823
|
+
var stylesheet = _step3.value;
|
|
824
|
+
if (!isArray$1(stylesheet)) {
|
|
813
825
|
list.push(stylesheet);
|
|
814
826
|
} else {
|
|
815
827
|
list.push.apply(list, _toConsumableArray(flattenStylesheets(stylesheet)));
|
|
816
828
|
}
|
|
817
829
|
}
|
|
818
830
|
} catch (err) {
|
|
819
|
-
|
|
831
|
+
_iterator3.e(err);
|
|
820
832
|
} finally {
|
|
821
|
-
|
|
833
|
+
_iterator3.f();
|
|
822
834
|
}
|
|
823
835
|
return list;
|
|
824
836
|
}
|
|
@@ -1720,17 +1732,17 @@
|
|
|
1720
1732
|
var refs = refsCache.get(refVNodes);
|
|
1721
1733
|
if (isUndefined$1(refs)) {
|
|
1722
1734
|
refs = create(null);
|
|
1723
|
-
var
|
|
1724
|
-
|
|
1735
|
+
var _iterator4 = _createForOfIteratorHelper(keys(refVNodes)),
|
|
1736
|
+
_step4;
|
|
1725
1737
|
try {
|
|
1726
|
-
for (
|
|
1727
|
-
var key =
|
|
1738
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
1739
|
+
var key = _step4.value;
|
|
1728
1740
|
refs[key] = refVNodes[key].elm;
|
|
1729
1741
|
}
|
|
1730
1742
|
} catch (err) {
|
|
1731
|
-
|
|
1743
|
+
_iterator4.e(err);
|
|
1732
1744
|
} finally {
|
|
1733
|
-
|
|
1745
|
+
_iterator4.f();
|
|
1734
1746
|
}
|
|
1735
1747
|
freeze(refs);
|
|
1736
1748
|
refsCache.set(refVNodes, refs);
|
|
@@ -1794,7 +1806,7 @@
|
|
|
1794
1806
|
var queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
|
|
1795
1807
|
// Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
|
|
1796
1808
|
var _loop = function _loop() {
|
|
1797
|
-
var queryMethod = _queryMethods[
|
|
1809
|
+
var queryMethod = _queryMethods[_i7];
|
|
1798
1810
|
queryAndChildGetterDescriptors[queryMethod] = {
|
|
1799
1811
|
value: function value(arg) {
|
|
1800
1812
|
var vm = getAssociatedVM(this);
|
|
@@ -1807,7 +1819,7 @@
|
|
|
1807
1819
|
writable: true
|
|
1808
1820
|
};
|
|
1809
1821
|
};
|
|
1810
|
-
for (var
|
|
1822
|
+
for (var _i7 = 0, _queryMethods = queryMethods; _i7 < _queryMethods.length; _i7++) {
|
|
1811
1823
|
_loop();
|
|
1812
1824
|
}
|
|
1813
1825
|
defineProperties(LightningElement.prototype, queryAndChildGetterDescriptors);
|
|
@@ -2093,16 +2105,16 @@
|
|
|
2093
2105
|
}
|
|
2094
2106
|
function connectWireAdapters(vm) {
|
|
2095
2107
|
var wiredConnecting = vm.context.wiredConnecting;
|
|
2096
|
-
for (var
|
|
2097
|
-
wiredConnecting[
|
|
2108
|
+
for (var _i8 = 0, len = wiredConnecting.length; _i8 < len; _i8 += 1) {
|
|
2109
|
+
wiredConnecting[_i8]();
|
|
2098
2110
|
}
|
|
2099
2111
|
}
|
|
2100
2112
|
function disconnectWireAdapters(vm) {
|
|
2101
2113
|
var wiredDisconnecting = vm.context.wiredDisconnecting;
|
|
2102
2114
|
runWithBoundaryProtection(vm, vm, noop, function () {
|
|
2103
2115
|
// job
|
|
2104
|
-
for (var
|
|
2105
|
-
wiredDisconnecting[
|
|
2116
|
+
for (var _i9 = 0, len = wiredDisconnecting.length; _i9 < len; _i9 += 1) {
|
|
2117
|
+
wiredDisconnecting[_i9]();
|
|
2106
2118
|
}
|
|
2107
2119
|
}, noop);
|
|
2108
2120
|
}
|
|
@@ -2304,8 +2316,8 @@
|
|
|
2304
2316
|
}
|
|
2305
2317
|
}
|
|
2306
2318
|
if (!isUndefined$1(fields)) {
|
|
2307
|
-
for (var
|
|
2308
|
-
var _fieldName2 = fields[
|
|
2319
|
+
for (var _i10 = 0, n = fields.length; _i10 < n; _i10++) {
|
|
2320
|
+
var _fieldName2 = fields[_i10];
|
|
2309
2321
|
descriptor = getOwnPropertyDescriptor$1(proto, _fieldName2);
|
|
2310
2322
|
// [W-9927596] Only mark a field as observed whenever it isn't a duplicated public nor
|
|
2311
2323
|
// tracked property. This is only here for backward compatibility purposes.
|
|
@@ -2486,8 +2498,8 @@
|
|
|
2486
2498
|
superObservedAttributes = _SuperClass$observedA === void 0 ? [] : _SuperClass$observedA;
|
|
2487
2499
|
var descriptors = create(null);
|
|
2488
2500
|
// expose getters and setters for each public props on the new Element Bridge
|
|
2489
|
-
for (var
|
|
2490
|
-
var _propName = props[
|
|
2501
|
+
for (var _i11 = 0, len = props.length; _i11 < len; _i11 += 1) {
|
|
2502
|
+
var _propName = props[_i11];
|
|
2491
2503
|
attributeToPropMap[htmlPropertyToAttribute(_propName)] = _propName;
|
|
2492
2504
|
descriptors[_propName] = {
|
|
2493
2505
|
get: createGetter(_propName),
|
|
@@ -2497,8 +2509,8 @@
|
|
|
2497
2509
|
};
|
|
2498
2510
|
}
|
|
2499
2511
|
// expose public methods as props on the new Element Bridge
|
|
2500
|
-
for (var
|
|
2501
|
-
var methodName = methods[
|
|
2512
|
+
for (var _i12 = 0, _len = methods.length; _i12 < _len; _i12 += 1) {
|
|
2513
|
+
var methodName = methods[_i12];
|
|
2502
2514
|
descriptors[methodName] = {
|
|
2503
2515
|
value: createMethodCaller(methodName),
|
|
2504
2516
|
writable: true,
|
|
@@ -2866,8 +2878,8 @@
|
|
|
2866
2878
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
2867
2879
|
var content = [];
|
|
2868
2880
|
var root;
|
|
2869
|
-
for (var
|
|
2870
|
-
var stylesheet = stylesheets[
|
|
2881
|
+
for (var _i13 = 0; _i13 < stylesheets.length; _i13++) {
|
|
2882
|
+
var stylesheet = stylesheets[_i13];
|
|
2871
2883
|
if (isArray$1(stylesheet)) {
|
|
2872
2884
|
ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
|
|
2873
2885
|
} else {
|
|
@@ -2967,8 +2979,8 @@
|
|
|
2967
2979
|
shadowMode = vm.shadowMode,
|
|
2968
2980
|
insertStylesheet = vm.renderer.insertStylesheet;
|
|
2969
2981
|
if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
2970
|
-
for (var
|
|
2971
|
-
insertStylesheet(stylesheets[
|
|
2982
|
+
for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
|
|
2983
|
+
insertStylesheet(stylesheets[_i14]);
|
|
2972
2984
|
}
|
|
2973
2985
|
} else if (vm.hydrated) {
|
|
2974
2986
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
@@ -2981,8 +2993,8 @@
|
|
|
2981
2993
|
var root = getNearestNativeShadowComponent(vm);
|
|
2982
2994
|
// null root means a global style
|
|
2983
2995
|
var target = isNull(root) ? undefined : root.shadowRoot;
|
|
2984
|
-
for (var
|
|
2985
|
-
insertStylesheet(stylesheets[
|
|
2996
|
+
for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
|
|
2997
|
+
insertStylesheet(stylesheets[_i15], target);
|
|
2986
2998
|
}
|
|
2987
2999
|
}
|
|
2988
3000
|
return null;
|
|
@@ -3284,8 +3296,8 @@
|
|
|
3284
3296
|
return;
|
|
3285
3297
|
}
|
|
3286
3298
|
var setCSSStyleProperty = renderer.setCSSStyleProperty;
|
|
3287
|
-
for (var
|
|
3288
|
-
var _styleDecls$_i = _slicedToArray(styleDecls[
|
|
3299
|
+
for (var _i16 = 0; _i16 < styleDecls.length; _i16++) {
|
|
3300
|
+
var _styleDecls$_i = _slicedToArray(styleDecls[_i16], 3),
|
|
3289
3301
|
prop = _styleDecls$_i[0],
|
|
3290
3302
|
value = _styleDecls$_i[1],
|
|
3291
3303
|
important = _styleDecls$_i[2];
|
|
@@ -3708,8 +3720,8 @@
|
|
|
3708
3720
|
// If no VFragment is found in children, we don't need to traverse anything or mark the children dynamic and can return early.
|
|
3709
3721
|
var nodeStack = [];
|
|
3710
3722
|
var fragmentFound = false;
|
|
3711
|
-
for (var
|
|
3712
|
-
var child = children[
|
|
3723
|
+
for (var _i17 = children.length - 1; _i17 > -1; _i17 -= 1) {
|
|
3724
|
+
var child = children[_i17];
|
|
3713
3725
|
ArrayPush$1.call(nodeStack, child);
|
|
3714
3726
|
fragmentFound = fragmentFound || !!(child && isVFragment(child));
|
|
3715
3727
|
}
|
|
@@ -3721,8 +3733,8 @@
|
|
|
3721
3733
|
if (!isNull(currentNode) && isVFragment(currentNode)) {
|
|
3722
3734
|
var fChildren = currentNode.children;
|
|
3723
3735
|
// Ignore the start and end text node delimiters
|
|
3724
|
-
for (var
|
|
3725
|
-
ArrayPush$1.call(nodeStack, fChildren[
|
|
3736
|
+
for (var _i18 = fChildren.length - 2; _i18 > 0; _i18 -= 1) {
|
|
3737
|
+
ArrayPush$1.call(nodeStack, fChildren[_i18]);
|
|
3726
3738
|
}
|
|
3727
3739
|
} else {
|
|
3728
3740
|
ArrayPush$1.call(flattenedChildren, currentNode);
|
|
@@ -3758,8 +3770,8 @@
|
|
|
3758
3770
|
var oldSlotsMapping = vm.cmpSlots.slotAssignments;
|
|
3759
3771
|
var cmpSlotsMapping = create(null);
|
|
3760
3772
|
// Collect all slots into cmpSlotsMapping
|
|
3761
|
-
for (var
|
|
3762
|
-
var vnode = children[
|
|
3773
|
+
for (var _i19 = 0, len = children.length; _i19 < len; _i19 += 1) {
|
|
3774
|
+
var vnode = children[_i19];
|
|
3763
3775
|
if (isNull(vnode)) {
|
|
3764
3776
|
continue;
|
|
3765
3777
|
}
|
|
@@ -3769,7 +3781,12 @@
|
|
|
3769
3781
|
} else if (isVScopedSlotFragment(vnode)) {
|
|
3770
3782
|
slotName = vnode.slotName;
|
|
3771
3783
|
}
|
|
3772
|
-
|
|
3784
|
+
// Can't use toString here because Symbol(1).toString() is 'Symbol(1)'
|
|
3785
|
+
// but elm.setAttribute('slot', Symbol(1)) is an error.
|
|
3786
|
+
// the following line also throws same error for symbols
|
|
3787
|
+
// Similar for Object.create(null)
|
|
3788
|
+
var normalizedSlotName = '' + slotName;
|
|
3789
|
+
var vnodes = cmpSlotsMapping[normalizedSlotName] = cmpSlotsMapping[normalizedSlotName] || [];
|
|
3773
3790
|
ArrayPush$1.call(vnodes, vnode);
|
|
3774
3791
|
}
|
|
3775
3792
|
vm.cmpSlots = {
|
|
@@ -3784,8 +3801,8 @@
|
|
|
3784
3801
|
markComponentAsDirty(vm);
|
|
3785
3802
|
return;
|
|
3786
3803
|
}
|
|
3787
|
-
for (var
|
|
3788
|
-
var key = oldKeys[
|
|
3804
|
+
for (var _i20 = 0, _len2 = oldKeys.length; _i20 < _len2; _i20 += 1) {
|
|
3805
|
+
var key = oldKeys[_i20];
|
|
3789
3806
|
if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
|
|
3790
3807
|
markComponentAsDirty(vm);
|
|
3791
3808
|
return;
|
|
@@ -3908,11 +3925,11 @@
|
|
|
3908
3925
|
if (oldStartIdx > oldEndIdx) {
|
|
3909
3926
|
// There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
|
|
3910
3927
|
// already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
|
|
3911
|
-
var
|
|
3928
|
+
var _i21 = newEndIdx;
|
|
3912
3929
|
var n;
|
|
3913
3930
|
do {
|
|
3914
|
-
n = newCh[++
|
|
3915
|
-
} while (!isVNode(n) &&
|
|
3931
|
+
n = newCh[++_i21];
|
|
3932
|
+
} while (!isVNode(n) && _i21 < newChEnd);
|
|
3916
3933
|
before = isVNode(n) ? n.elm : null;
|
|
3917
3934
|
mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
|
|
3918
3935
|
} else {
|
|
@@ -3937,9 +3954,9 @@
|
|
|
3937
3954
|
// if the old list is not empty, the new list MUST have the same
|
|
3938
3955
|
// amount of nodes, that's why we call this static children
|
|
3939
3956
|
var anchor = null;
|
|
3940
|
-
for (var
|
|
3941
|
-
var n1 = c1[
|
|
3942
|
-
var n2 = c2[
|
|
3957
|
+
for (var _i22 = c2Length - 1; _i22 >= 0; _i22 -= 1) {
|
|
3958
|
+
var n1 = c1[_i22];
|
|
3959
|
+
var n2 = c2[_i22];
|
|
3943
3960
|
if (n2 !== n1) {
|
|
3944
3961
|
if (isVNode(n1)) {
|
|
3945
3962
|
if (isVNode(n2)) {
|
|
@@ -4036,8 +4053,8 @@
|
|
|
4036
4053
|
if (!isUndefined$1(slotset) && !isUndefined$1(slotset.slotAssignments) && !isUndefined$1(slotset.slotAssignments[slotName]) && slotset.slotAssignments[slotName].length !== 0) {
|
|
4037
4054
|
var newChildren = [];
|
|
4038
4055
|
var slotAssignments = slotset.slotAssignments[slotName];
|
|
4039
|
-
for (var
|
|
4040
|
-
var vnode = slotAssignments[
|
|
4056
|
+
for (var _i23 = 0; _i23 < slotAssignments.length; _i23++) {
|
|
4057
|
+
var vnode = slotAssignments[_i23];
|
|
4041
4058
|
if (!isNull(vnode)) {
|
|
4042
4059
|
var assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
|
|
4043
4060
|
// The only sniff test for a scoped <slot> element is the presence of `slotData`
|
|
@@ -4425,23 +4442,23 @@
|
|
|
4425
4442
|
var classAttrToken = hasScopedStyles && hasStyleToken ? " class=\"".concat(stylesheetToken, "\"") : '';
|
|
4426
4443
|
var attrToken = hasStyleToken && isSyntheticShadow ? ' ' + stylesheetToken : '';
|
|
4427
4444
|
var htmlFragment = '';
|
|
4428
|
-
for (var
|
|
4429
|
-
switch (keys[
|
|
4445
|
+
for (var _i24 = 0, n = keys.length; _i24 < n; _i24++) {
|
|
4446
|
+
switch (keys[_i24]) {
|
|
4430
4447
|
case 0:
|
|
4431
4448
|
// styleToken in existing class attr
|
|
4432
|
-
htmlFragment += strings[
|
|
4449
|
+
htmlFragment += strings[_i24] + classToken;
|
|
4433
4450
|
break;
|
|
4434
4451
|
case 1:
|
|
4435
4452
|
// styleToken for added class attr
|
|
4436
|
-
htmlFragment += strings[
|
|
4453
|
+
htmlFragment += strings[_i24] + classAttrToken;
|
|
4437
4454
|
break;
|
|
4438
4455
|
case 2:
|
|
4439
4456
|
// styleToken as attr
|
|
4440
|
-
htmlFragment += strings[
|
|
4457
|
+
htmlFragment += strings[_i24] + attrToken;
|
|
4441
4458
|
break;
|
|
4442
4459
|
case 3:
|
|
4443
4460
|
// ${1}${2}
|
|
4444
|
-
htmlFragment += strings[
|
|
4461
|
+
htmlFragment += strings[_i24] + classAttrToken + attrToken;
|
|
4445
4462
|
break;
|
|
4446
4463
|
}
|
|
4447
4464
|
}
|
|
@@ -4529,8 +4546,8 @@
|
|
|
4529
4546
|
}
|
|
4530
4547
|
function computeHasScopedStylesInStylesheets(stylesheets) {
|
|
4531
4548
|
if (hasStyles(stylesheets)) {
|
|
4532
|
-
for (var
|
|
4533
|
-
if (isTrue(stylesheets[
|
|
4549
|
+
for (var _i25 = 0; _i25 < stylesheets.length; _i25++) {
|
|
4550
|
+
if (isTrue(stylesheets[_i25][KEY__SCOPED_CSS])) {
|
|
4534
4551
|
return true;
|
|
4535
4552
|
}
|
|
4536
4553
|
}
|
|
@@ -4696,8 +4713,8 @@
|
|
|
4696
4713
|
* subject to change or being removed.
|
|
4697
4714
|
*/
|
|
4698
4715
|
function register(service) {
|
|
4699
|
-
for (var
|
|
4700
|
-
var hookName = hooks[
|
|
4716
|
+
for (var _i26 = 0; _i26 < hooks.length; ++_i26) {
|
|
4717
|
+
var hookName = hooks[_i26];
|
|
4701
4718
|
if (hookName in service) {
|
|
4702
4719
|
var l = Services[hookName];
|
|
4703
4720
|
if (isUndefined$1(l)) {
|
|
@@ -4711,8 +4728,8 @@
|
|
|
4711
4728
|
var component = vm.component,
|
|
4712
4729
|
def = vm.def,
|
|
4713
4730
|
context = vm.context;
|
|
4714
|
-
for (var
|
|
4715
|
-
cbs[
|
|
4731
|
+
for (var _i27 = 0, len = cbs.length; _i27 < len; ++_i27) {
|
|
4732
|
+
cbs[_i27].call(undefined, component, {}, def, context);
|
|
4716
4733
|
}
|
|
4717
4734
|
}
|
|
4718
4735
|
|
|
@@ -4849,8 +4866,8 @@
|
|
|
4849
4866
|
var valid = true;
|
|
4850
4867
|
var validate = function validate(arrayOrStylesheet) {
|
|
4851
4868
|
if (isArray$1(arrayOrStylesheet)) {
|
|
4852
|
-
for (var
|
|
4853
|
-
validate(arrayOrStylesheet[
|
|
4869
|
+
for (var _i28 = 0; _i28 < arrayOrStylesheet.length; _i28++) {
|
|
4870
|
+
validate(arrayOrStylesheet[_i28]);
|
|
4854
4871
|
}
|
|
4855
4872
|
} else if (!isFunction$1(arrayOrStylesheet)) {
|
|
4856
4873
|
// function assumed to be a stylesheet factory
|
|
@@ -4985,17 +5002,17 @@
|
|
|
4985
5002
|
return a.idx - b.idx;
|
|
4986
5003
|
});
|
|
4987
5004
|
rehydrateQueue = []; // reset to a new queue
|
|
4988
|
-
for (var
|
|
4989
|
-
var vm = vms[
|
|
5005
|
+
for (var _i29 = 0, len = vms.length; _i29 < len; _i29 += 1) {
|
|
5006
|
+
var vm = vms[_i29];
|
|
4990
5007
|
try {
|
|
4991
5008
|
rehydrate(vm);
|
|
4992
5009
|
} catch (error) {
|
|
4993
|
-
if (
|
|
5010
|
+
if (_i29 + 1 < len) {
|
|
4994
5011
|
// pieces of the queue are still pending to be rehydrated, those should have priority
|
|
4995
5012
|
if (rehydrateQueue.length === 0) {
|
|
4996
5013
|
addCallbackToNextTick(flushRehydrationQueue);
|
|
4997
5014
|
}
|
|
4998
|
-
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms,
|
|
5015
|
+
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i29 + 1));
|
|
4999
5016
|
}
|
|
5000
5017
|
// we need to end the measure before throwing.
|
|
5001
5018
|
logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */);
|
|
@@ -5061,8 +5078,8 @@
|
|
|
5061
5078
|
var vCustomElementCollection = vm.velements;
|
|
5062
5079
|
// Reporting disconnection for every child in inverse order since they are
|
|
5063
5080
|
// inserted in reserved order.
|
|
5064
|
-
for (var
|
|
5065
|
-
var elm = vCustomElementCollection[
|
|
5081
|
+
for (var _i30 = vCustomElementCollection.length - 1; _i30 >= 0; _i30 -= 1) {
|
|
5082
|
+
var elm = vCustomElementCollection[_i30].elm;
|
|
5066
5083
|
// There are two cases where the element could be undefined:
|
|
5067
5084
|
// * when there is an error during the construction phase, and an error
|
|
5068
5085
|
// boundary picks it, there is a possibility that the VCustomElement
|
|
@@ -5093,8 +5110,8 @@
|
|
|
5093
5110
|
* defined on its shadow.
|
|
5094
5111
|
*/
|
|
5095
5112
|
function recursivelyDisconnectChildren(vnodes) {
|
|
5096
|
-
for (var
|
|
5097
|
-
var vnode = vnodes[
|
|
5113
|
+
for (var _i31 = 0, len = vnodes.length; _i31 < len; _i31 += 1) {
|
|
5114
|
+
var vnode = vnodes[_i31];
|
|
5098
5115
|
if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
|
|
5099
5116
|
switch (vnode.type) {
|
|
5100
5117
|
case 2 /* VNodeType.Element */:
|
|
@@ -5118,8 +5135,8 @@
|
|
|
5118
5135
|
var children = vm.children,
|
|
5119
5136
|
renderRoot = vm.renderRoot,
|
|
5120
5137
|
remove = vm.renderer.remove;
|
|
5121
|
-
for (var
|
|
5122
|
-
var child = children[
|
|
5138
|
+
for (var _i32 = 0, len = children.length; _i32 < len; _i32++) {
|
|
5139
|
+
var child = children[_i32];
|
|
5123
5140
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
5124
5141
|
remove(child.elm, renderRoot);
|
|
5125
5142
|
}
|
|
@@ -5191,7 +5208,7 @@
|
|
|
5191
5208
|
function isSyntheticShadowRootInstance(rootNode) {
|
|
5192
5209
|
return rootNode !== document && isTrue(rootNode.synthetic);
|
|
5193
5210
|
}
|
|
5194
|
-
function reportViolation(source, target, attrName) {
|
|
5211
|
+
function reportViolation$1(source, target, attrName) {
|
|
5195
5212
|
// The vm is either for the source, the target, or both. Either one or both must be using synthetic
|
|
5196
5213
|
// shadow for a violation to be detected.
|
|
5197
5214
|
var vm = getAssociatedVMIfPresent(source.getRootNode().host);
|
|
@@ -5202,7 +5219,10 @@
|
|
|
5202
5219
|
// vm should never be undefined here, but just to be safe, bail out and don't report
|
|
5203
5220
|
return;
|
|
5204
5221
|
}
|
|
5205
|
-
report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */,
|
|
5222
|
+
report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */, {
|
|
5223
|
+
tagName: vm.tagName,
|
|
5224
|
+
attributeName: attrName
|
|
5225
|
+
});
|
|
5206
5226
|
}
|
|
5207
5227
|
function parseIdRefAttributeValue(attrValue) {
|
|
5208
5228
|
// split on whitespace and skip empty strings after splitting
|
|
@@ -5219,57 +5239,57 @@
|
|
|
5219
5239
|
// if our id is null or empty, nobody can reference us
|
|
5220
5240
|
return;
|
|
5221
5241
|
}
|
|
5222
|
-
var
|
|
5223
|
-
|
|
5242
|
+
var _iterator5 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
|
|
5243
|
+
_step5;
|
|
5224
5244
|
try {
|
|
5225
|
-
for (
|
|
5226
|
-
var idRefAttrName =
|
|
5245
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
5246
|
+
var idRefAttrName = _step5.value;
|
|
5227
5247
|
// Query all global elements with this attribute. The attribute selector syntax `~=` is for values
|
|
5228
5248
|
// that reference multiple IDs, separated by whitespace.
|
|
5229
5249
|
var query = "[".concat(idRefAttrName, "~=\"").concat(CSS.escape(attrValue), "\"]");
|
|
5230
5250
|
var sourceElements = querySelectorAll.call(document, query);
|
|
5231
|
-
for (var
|
|
5232
|
-
var sourceElement = sourceElements[
|
|
5251
|
+
for (var _i33 = 0; _i33 < sourceElements.length; _i33++) {
|
|
5252
|
+
var sourceElement = sourceElements[_i33];
|
|
5233
5253
|
var sourceRoot = sourceElement.getRootNode();
|
|
5234
5254
|
if (sourceRoot !== root) {
|
|
5235
|
-
reportViolation(sourceElement, elm, idRefAttrName);
|
|
5255
|
+
reportViolation$1(sourceElement, elm, idRefAttrName);
|
|
5236
5256
|
break;
|
|
5237
5257
|
}
|
|
5238
5258
|
}
|
|
5239
5259
|
}
|
|
5240
5260
|
} catch (err) {
|
|
5241
|
-
|
|
5261
|
+
_iterator5.e(err);
|
|
5242
5262
|
} finally {
|
|
5243
|
-
|
|
5263
|
+
_iterator5.f();
|
|
5244
5264
|
}
|
|
5245
5265
|
} else {
|
|
5246
5266
|
// elm is the source, find the target
|
|
5247
5267
|
var ids = parseIdRefAttributeValue(attrValue);
|
|
5248
|
-
var
|
|
5249
|
-
|
|
5268
|
+
var _iterator6 = _createForOfIteratorHelper(ids),
|
|
5269
|
+
_step6;
|
|
5250
5270
|
try {
|
|
5251
|
-
for (
|
|
5252
|
-
var id =
|
|
5271
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
5272
|
+
var id = _step6.value;
|
|
5253
5273
|
var target = getElementById.call(document, id);
|
|
5254
5274
|
if (!isNull(target)) {
|
|
5255
5275
|
var targetRoot = target.getRootNode();
|
|
5256
5276
|
if (targetRoot !== root) {
|
|
5257
5277
|
// target element's shadow root is not the same as ours
|
|
5258
|
-
reportViolation(elm, target, attrName);
|
|
5278
|
+
reportViolation$1(elm, target, attrName);
|
|
5259
5279
|
}
|
|
5260
5280
|
}
|
|
5261
5281
|
}
|
|
5262
5282
|
} catch (err) {
|
|
5263
|
-
|
|
5283
|
+
_iterator6.e(err);
|
|
5264
5284
|
} finally {
|
|
5265
|
-
|
|
5285
|
+
_iterator6.f();
|
|
5266
5286
|
}
|
|
5267
5287
|
}
|
|
5268
5288
|
}
|
|
5269
5289
|
var enabled = false;
|
|
5270
5290
|
// We want to avoid patching globals whenever possible, so this should be tree-shaken out in prod-mode and if
|
|
5271
5291
|
// reporting is not enabled. It should also only run once
|
|
5272
|
-
function enableDetection() {
|
|
5292
|
+
function enableDetection$1() {
|
|
5273
5293
|
if (enabled) {
|
|
5274
5294
|
return; // don't double-apply the patches
|
|
5275
5295
|
}
|
|
@@ -5324,7 +5344,102 @@
|
|
|
5324
5344
|
// Always run detection in dev mode, so we can at least print to the console
|
|
5325
5345
|
{
|
|
5326
5346
|
// In prod mode, only enable detection if reporting is enabled
|
|
5327
|
-
onReportingEnabled(enableDetection);
|
|
5347
|
+
onReportingEnabled(enableDetection$1);
|
|
5348
|
+
}
|
|
5349
|
+
}
|
|
5350
|
+
|
|
5351
|
+
/*
|
|
5352
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5353
|
+
* All rights reserved.
|
|
5354
|
+
* SPDX-License-Identifier: MIT
|
|
5355
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5356
|
+
*/
|
|
5357
|
+
//
|
|
5358
|
+
// The goal of this code is to detect usages of non-standard reflected ARIA properties. These are caused by
|
|
5359
|
+
// legacy non-standard Element.prototype extensions added by the @lwc/aria-reflection package.
|
|
5360
|
+
//
|
|
5361
|
+
// See the README for @lwc/aria-reflection
|
|
5362
|
+
var NON_STANDARD_ARIA_PROPS = ['ariaActiveDescendant', 'ariaControls', 'ariaDescribedBy', 'ariaDetails', 'ariaErrorMessage', 'ariaFlowTo', 'ariaLabelledBy', 'ariaOwns'];
|
|
5363
|
+
function isLightningElement(elm) {
|
|
5364
|
+
// The former case is for `this.prop` (inside component) and the latter is for `element.prop` (outside component).
|
|
5365
|
+
// In both cases, we apply the non-standard prop even when the global polyfill is disabled, so this is kosher.
|
|
5366
|
+
return elm instanceof LightningElement || elm instanceof BaseBridgeElement;
|
|
5367
|
+
}
|
|
5368
|
+
function findVM(elm) {
|
|
5369
|
+
// If it's a shadow DOM component, then it has a host
|
|
5370
|
+
var _elm$getRootNode = elm.getRootNode(),
|
|
5371
|
+
host = _elm$getRootNode.host;
|
|
5372
|
+
var vm = isUndefined$1(host) ? undefined : getAssociatedVMIfPresent(host);
|
|
5373
|
+
if (!isUndefined$1(vm)) {
|
|
5374
|
+
return vm;
|
|
5375
|
+
}
|
|
5376
|
+
// Else it might be a light DOM component. Walk up the tree trying to find the owner
|
|
5377
|
+
var parentElement = elm;
|
|
5378
|
+
while (!isNull(parentElement = parentElement.parentElement)) {
|
|
5379
|
+
if (isLightningElement(parentElement)) {
|
|
5380
|
+
var _vm = getAssociatedVMIfPresent(parentElement);
|
|
5381
|
+
if (!isUndefined$1(_vm)) {
|
|
5382
|
+
return _vm;
|
|
5383
|
+
}
|
|
5384
|
+
}
|
|
5385
|
+
}
|
|
5386
|
+
// If we return undefined, it's because the element was rendered wholly outside a LightningElement
|
|
5387
|
+
}
|
|
5388
|
+
|
|
5389
|
+
function checkAndReportViolation(elm, prop) {
|
|
5390
|
+
if (!isLightningElement(elm)) {
|
|
5391
|
+
var vm = findVM(elm);
|
|
5392
|
+
report(2 /* ReportingEventId.NonStandardAriaReflection */, {
|
|
5393
|
+
tagName: vm === null || vm === void 0 ? void 0 : vm.tagName,
|
|
5394
|
+
propertyName: prop
|
|
5395
|
+
});
|
|
5396
|
+
}
|
|
5397
|
+
}
|
|
5398
|
+
function enableDetection() {
|
|
5399
|
+
var _Element = Element,
|
|
5400
|
+
prototype = _Element.prototype;
|
|
5401
|
+
var _iterator7 = _createForOfIteratorHelper(NON_STANDARD_ARIA_PROPS),
|
|
5402
|
+
_step7;
|
|
5403
|
+
try {
|
|
5404
|
+
var _loop3 = function _loop3() {
|
|
5405
|
+
var prop = _step7.value;
|
|
5406
|
+
var descriptor = getOwnPropertyDescriptor$1(prototype, prop);
|
|
5407
|
+
// The descriptor should exist because the @lwc/aria-reflection polyfill has run by now.
|
|
5408
|
+
// This happens automatically because of the ordering of imports.
|
|
5409
|
+
if ("production" !== 'production') ;
|
|
5410
|
+
// @ts-ignore
|
|
5411
|
+
var _get4 = descriptor.get,
|
|
5412
|
+
_set4 = descriptor.set;
|
|
5413
|
+
defineProperty(prototype, prop, {
|
|
5414
|
+
get: function get() {
|
|
5415
|
+
checkAndReportViolation(this, prop);
|
|
5416
|
+
return _get4.call(this);
|
|
5417
|
+
},
|
|
5418
|
+
set: function set(val) {
|
|
5419
|
+
checkAndReportViolation(this, prop);
|
|
5420
|
+
return _set4.call(this, val);
|
|
5421
|
+
},
|
|
5422
|
+
configurable: true,
|
|
5423
|
+
enumerable: true
|
|
5424
|
+
});
|
|
5425
|
+
};
|
|
5426
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
5427
|
+
_loop3();
|
|
5428
|
+
}
|
|
5429
|
+
} catch (err) {
|
|
5430
|
+
_iterator7.e(err);
|
|
5431
|
+
} finally {
|
|
5432
|
+
_iterator7.f();
|
|
5433
|
+
}
|
|
5434
|
+
}
|
|
5435
|
+
// No point in running this code if we're not in a browser, or if the global polyfill is not loaded
|
|
5436
|
+
{
|
|
5437
|
+
if (!lwcRuntimeFlags.DISABLE_ARIA_REFLECTION_POLYFILL) {
|
|
5438
|
+
// Always run detection in dev mode, so we can at least print to the console
|
|
5439
|
+
{
|
|
5440
|
+
// In prod mode, only enable detection if reporting is enabled
|
|
5441
|
+
onReportingEnabled(enableDetection);
|
|
5442
|
+
}
|
|
5328
5443
|
}
|
|
5329
5444
|
}
|
|
5330
5445
|
|
|
@@ -5533,8 +5648,8 @@
|
|
|
5533
5648
|
var nextNode = node;
|
|
5534
5649
|
var anchor = null;
|
|
5535
5650
|
var renderer = owner.renderer;
|
|
5536
|
-
for (var
|
|
5537
|
-
var childVnode = children[
|
|
5651
|
+
for (var _i34 = 0; _i34 < children.length; _i34++) {
|
|
5652
|
+
var childVnode = children[_i34];
|
|
5538
5653
|
if (!isNull(childVnode)) {
|
|
5539
5654
|
if (nextNode) {
|
|
5540
5655
|
nextNode = hydrateNode(nextNode, childVnode, renderer);
|
|
@@ -5595,8 +5710,8 @@
|
|
|
5595
5710
|
var nodesAreCompatible = true;
|
|
5596
5711
|
// Validate attributes, though we could always recovery from those by running the update mods.
|
|
5597
5712
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
5598
|
-
for (var
|
|
5599
|
-
var _Object$entries$_i = _slicedToArray(_Object$entries[
|
|
5713
|
+
for (var _i35 = 0, _Object$entries = Object.entries(attrs); _i35 < _Object$entries.length; _i35++) {
|
|
5714
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i35], 2),
|
|
5600
5715
|
attrName = _Object$entries$_i[0],
|
|
5601
5716
|
attrValue = _Object$entries$_i[1];
|
|
5602
5717
|
vnode.owner;
|
|
@@ -5683,8 +5798,8 @@
|
|
|
5683
5798
|
var parsedVnodeStyle = parseStyleText(elmStyle);
|
|
5684
5799
|
var expectedStyle = [];
|
|
5685
5800
|
// styleMap is used when style is set to static value.
|
|
5686
|
-
for (var
|
|
5687
|
-
var _styleDecls$_i2 = _slicedToArray(styleDecls[
|
|
5801
|
+
for (var _i36 = 0, n = styleDecls.length; _i36 < n; _i36++) {
|
|
5802
|
+
var _styleDecls$_i2 = _slicedToArray(styleDecls[_i36], 3),
|
|
5688
5803
|
prop = _styleDecls$_i2[0],
|
|
5689
5804
|
value = _styleDecls$_i2[1],
|
|
5690
5805
|
important = _styleDecls$_i2[2];
|
|
@@ -5749,6 +5864,121 @@
|
|
|
5749
5864
|
hooksAreSet = true;
|
|
5750
5865
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
5751
5866
|
}
|
|
5867
|
+
|
|
5868
|
+
/*
|
|
5869
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5870
|
+
* All rights reserved.
|
|
5871
|
+
* SPDX-License-Identifier: MIT
|
|
5872
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5873
|
+
*/
|
|
5874
|
+
// See @lwc/engine-core/src/framework/template.ts
|
|
5875
|
+
var TEMPLATE_PROPS = ['slots', 'stylesheetToken', 'stylesheets', 'renderMode'];
|
|
5876
|
+
// Expandos that may be placed on a stylesheet factory function, and which are meaningful to LWC at runtime
|
|
5877
|
+
var STYLESHEET_PROPS = [
|
|
5878
|
+
// SEE `KEY__SCOPED_CSS` in @lwc/style-compiler
|
|
5879
|
+
'$scoped$'];
|
|
5880
|
+
// Via https://www.npmjs.com/package/object-observer
|
|
5881
|
+
var ARRAY_MUTATION_METHODS = ['pop', 'push', 'shift', 'unshift', 'reverse', 'sort', 'fill', 'splice', 'copyWithin'];
|
|
5882
|
+
var mutationTrackingDisabled = false;
|
|
5883
|
+
function getOriginalArrayMethod(prop) {
|
|
5884
|
+
switch (prop) {
|
|
5885
|
+
case 'pop':
|
|
5886
|
+
return ArrayPop;
|
|
5887
|
+
case 'push':
|
|
5888
|
+
return ArrayPush$1;
|
|
5889
|
+
case 'shift':
|
|
5890
|
+
return ArrayShift;
|
|
5891
|
+
case 'unshift':
|
|
5892
|
+
return ArrayUnshift;
|
|
5893
|
+
case 'reverse':
|
|
5894
|
+
return ArrayReverse;
|
|
5895
|
+
case 'sort':
|
|
5896
|
+
return ArraySort;
|
|
5897
|
+
case 'fill':
|
|
5898
|
+
return ArrayFill;
|
|
5899
|
+
case 'splice':
|
|
5900
|
+
return ArraySplice;
|
|
5901
|
+
case 'copyWithin':
|
|
5902
|
+
return ArrayCopyWithin;
|
|
5903
|
+
}
|
|
5904
|
+
}
|
|
5905
|
+
function reportViolation(type, eventId, prop) {
|
|
5906
|
+
report(eventId, {
|
|
5907
|
+
propertyName: prop
|
|
5908
|
+
});
|
|
5909
|
+
}
|
|
5910
|
+
function reportTemplateViolation(prop) {
|
|
5911
|
+
reportViolation('template', 3 /* ReportingEventId.TemplateMutation */, prop);
|
|
5912
|
+
}
|
|
5913
|
+
function reportStylesheetViolation(prop) {
|
|
5914
|
+
reportViolation('stylesheet', 4 /* ReportingEventId.StylesheetMutation */, prop);
|
|
5915
|
+
}
|
|
5916
|
+
// Warn if the user tries to mutate a stylesheets array, e.g.:
|
|
5917
|
+
// `tmpl.stylesheets.push(someStylesheetFunction)`
|
|
5918
|
+
function warnOnArrayMutation(stylesheets) {
|
|
5919
|
+
// We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
|
|
5920
|
+
// we can at least warn when they use the most common mutation methods.
|
|
5921
|
+
var _iterator8 = _createForOfIteratorHelper(ARRAY_MUTATION_METHODS),
|
|
5922
|
+
_step8;
|
|
5923
|
+
try {
|
|
5924
|
+
var _loop4 = function _loop4() {
|
|
5925
|
+
var prop = _step8.value;
|
|
5926
|
+
var originalArrayMethod = getOriginalArrayMethod(prop);
|
|
5927
|
+
stylesheets[prop] = function arrayMutationWarningWrapper() {
|
|
5928
|
+
reportTemplateViolation('stylesheets');
|
|
5929
|
+
// @ts-ignore
|
|
5930
|
+
return originalArrayMethod.apply(this, arguments);
|
|
5931
|
+
};
|
|
5932
|
+
};
|
|
5933
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
5934
|
+
_loop4();
|
|
5935
|
+
}
|
|
5936
|
+
} catch (err) {
|
|
5937
|
+
_iterator8.e(err);
|
|
5938
|
+
} finally {
|
|
5939
|
+
_iterator8.f();
|
|
5940
|
+
}
|
|
5941
|
+
}
|
|
5942
|
+
// Warn if the user tries to mutate a stylesheet factory function, e.g.:
|
|
5943
|
+
// `stylesheet.$scoped$ = true`
|
|
5944
|
+
function warnOnStylesheetFunctionMutation(stylesheet) {
|
|
5945
|
+
var _iterator9 = _createForOfIteratorHelper(STYLESHEET_PROPS),
|
|
5946
|
+
_step9;
|
|
5947
|
+
try {
|
|
5948
|
+
var _loop5 = function _loop5() {
|
|
5949
|
+
var prop = _step9.value;
|
|
5950
|
+
var value = stylesheet[prop];
|
|
5951
|
+
defineProperty(stylesheet, prop, {
|
|
5952
|
+
enumerable: true,
|
|
5953
|
+
configurable: true,
|
|
5954
|
+
get: function get() {
|
|
5955
|
+
return value;
|
|
5956
|
+
},
|
|
5957
|
+
set: function set(newValue) {
|
|
5958
|
+
reportStylesheetViolation(prop);
|
|
5959
|
+
value = newValue;
|
|
5960
|
+
}
|
|
5961
|
+
});
|
|
5962
|
+
};
|
|
5963
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
5964
|
+
_loop5();
|
|
5965
|
+
}
|
|
5966
|
+
} catch (err) {
|
|
5967
|
+
_iterator9.e(err);
|
|
5968
|
+
} finally {
|
|
5969
|
+
_iterator9.f();
|
|
5970
|
+
}
|
|
5971
|
+
}
|
|
5972
|
+
// Warn on either array or stylesheet (function) mutation, in a deeply-nested array
|
|
5973
|
+
function trackStylesheetsMutation(stylesheets) {
|
|
5974
|
+
traverseStylesheets(stylesheets, function (subStylesheets) {
|
|
5975
|
+
if (isArray$1(subStylesheets)) {
|
|
5976
|
+
warnOnArrayMutation(subStylesheets);
|
|
5977
|
+
} else {
|
|
5978
|
+
warnOnStylesheetFunctionMutation(subStylesheets);
|
|
5979
|
+
}
|
|
5980
|
+
});
|
|
5981
|
+
}
|
|
5752
5982
|
// Deeply freeze the entire array (of arrays) of stylesheet factory functions
|
|
5753
5983
|
function deepFreeze(stylesheets) {
|
|
5754
5984
|
traverseStylesheets(stylesheets, function (subStylesheets) {
|
|
@@ -5758,8 +5988,8 @@
|
|
|
5758
5988
|
// Deep-traverse an array (of arrays) of stylesheet factory functions, and call the callback for every array/function
|
|
5759
5989
|
function traverseStylesheets(stylesheets, callback) {
|
|
5760
5990
|
callback(stylesheets);
|
|
5761
|
-
for (var
|
|
5762
|
-
var stylesheet = stylesheets[
|
|
5991
|
+
for (var _i37 = 0; _i37 < stylesheets.length; _i37++) {
|
|
5992
|
+
var stylesheet = stylesheets[_i37];
|
|
5763
5993
|
if (isArray$1(stylesheet)) {
|
|
5764
5994
|
traverseStylesheets(stylesheet, callback);
|
|
5765
5995
|
} else {
|
|
@@ -5767,7 +5997,80 @@
|
|
|
5767
5997
|
}
|
|
5768
5998
|
}
|
|
5769
5999
|
}
|
|
6000
|
+
function trackMutations(tmpl) {
|
|
6001
|
+
if (!isUndefined$1(tmpl.stylesheets)) {
|
|
6002
|
+
trackStylesheetsMutation(tmpl.stylesheets);
|
|
6003
|
+
}
|
|
6004
|
+
var _iterator10 = _createForOfIteratorHelper(TEMPLATE_PROPS),
|
|
6005
|
+
_step10;
|
|
6006
|
+
try {
|
|
6007
|
+
var _loop6 = function _loop6() {
|
|
6008
|
+
var prop = _step10.value;
|
|
6009
|
+
var value = tmpl[prop];
|
|
6010
|
+
defineProperty(tmpl, prop, {
|
|
6011
|
+
enumerable: true,
|
|
6012
|
+
configurable: true,
|
|
6013
|
+
get: function get() {
|
|
6014
|
+
return value;
|
|
6015
|
+
},
|
|
6016
|
+
set: function set(newValue) {
|
|
6017
|
+
if (!mutationTrackingDisabled) {
|
|
6018
|
+
reportTemplateViolation(prop);
|
|
6019
|
+
}
|
|
6020
|
+
value = newValue;
|
|
6021
|
+
}
|
|
6022
|
+
});
|
|
6023
|
+
};
|
|
6024
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
6025
|
+
_loop6();
|
|
6026
|
+
}
|
|
6027
|
+
} catch (err) {
|
|
6028
|
+
_iterator10.e(err);
|
|
6029
|
+
} finally {
|
|
6030
|
+
_iterator10.f();
|
|
6031
|
+
}
|
|
6032
|
+
var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
|
|
6033
|
+
defineProperty(tmpl, 'stylesheetTokens', {
|
|
6034
|
+
enumerable: true,
|
|
6035
|
+
configurable: true,
|
|
6036
|
+
get: originalDescriptor.get,
|
|
6037
|
+
set: function set(value) {
|
|
6038
|
+
reportTemplateViolation('stylesheetTokens');
|
|
6039
|
+
// Avoid logging/reporting twice (for both stylesheetToken and stylesheetTokens)
|
|
6040
|
+
mutationTrackingDisabled = true;
|
|
6041
|
+
originalDescriptor.set.call(this, value);
|
|
6042
|
+
mutationTrackingDisabled = false;
|
|
6043
|
+
}
|
|
6044
|
+
});
|
|
6045
|
+
}
|
|
6046
|
+
function addLegacyStylesheetTokensShim(tmpl) {
|
|
6047
|
+
// When ENABLE_FROZEN_TEMPLATE is false, then we shim stylesheetTokens on top of stylesheetToken for anyone who
|
|
6048
|
+
// is accessing the old internal API (backwards compat). Details: https://salesforce.quip.com/v1rmAFu2cKAr
|
|
6049
|
+
defineProperty(tmpl, 'stylesheetTokens', {
|
|
6050
|
+
enumerable: true,
|
|
6051
|
+
configurable: true,
|
|
6052
|
+
get: function get() {
|
|
6053
|
+
var stylesheetToken = this.stylesheetToken;
|
|
6054
|
+
if (isUndefined$1(stylesheetToken)) {
|
|
6055
|
+
return stylesheetToken;
|
|
6056
|
+
}
|
|
6057
|
+
// Shim for the old `stylesheetTokens` property
|
|
6058
|
+
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
6059
|
+
return {
|
|
6060
|
+
hostAttribute: "".concat(stylesheetToken, "-host"),
|
|
6061
|
+
shadowAttribute: stylesheetToken
|
|
6062
|
+
};
|
|
6063
|
+
},
|
|
6064
|
+
set: function set(value) {
|
|
6065
|
+
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
6066
|
+
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
6067
|
+
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
6068
|
+
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
6069
|
+
}
|
|
6070
|
+
});
|
|
6071
|
+
}
|
|
5770
6072
|
function freezeTemplate(tmpl) {
|
|
6073
|
+
// TODO [#2782]: remove this flag and delete the legacy behavior
|
|
5771
6074
|
if (lwcRuntimeFlags.ENABLE_FROZEN_TEMPLATE) {
|
|
5772
6075
|
// Deep freeze the template
|
|
5773
6076
|
freeze(tmpl);
|
|
@@ -5775,31 +6078,16 @@
|
|
|
5775
6078
|
deepFreeze(tmpl.stylesheets);
|
|
5776
6079
|
}
|
|
5777
6080
|
} else {
|
|
5778
|
-
//
|
|
5779
|
-
//
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
}
|
|
5789
|
-
// Shim for the old `stylesheetTokens` property
|
|
5790
|
-
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
5791
|
-
return {
|
|
5792
|
-
hostAttribute: "".concat(stylesheetToken, "-host"),
|
|
5793
|
-
shadowAttribute: stylesheetToken
|
|
5794
|
-
};
|
|
5795
|
-
},
|
|
5796
|
-
set: function set(value) {
|
|
5797
|
-
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
5798
|
-
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
5799
|
-
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
5800
|
-
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
5801
|
-
}
|
|
5802
|
-
});
|
|
6081
|
+
// template is not frozen - shim, report, and warn
|
|
6082
|
+
// this shim should be applied in both dev and prod
|
|
6083
|
+
addLegacyStylesheetTokensShim(tmpl);
|
|
6084
|
+
// When ENABLE_FROZEN_TEMPLATE is false, we want to warn in dev mode whenever someone is mutating the template
|
|
6085
|
+
{
|
|
6086
|
+
// In prod mode, we only track mutations if reporting is enabled
|
|
6087
|
+
onReportingEnabled(function () {
|
|
6088
|
+
trackMutations(tmpl);
|
|
6089
|
+
});
|
|
6090
|
+
}
|
|
5803
6091
|
}
|
|
5804
6092
|
}
|
|
5805
6093
|
|
|
@@ -6420,17 +6708,17 @@
|
|
|
6420
6708
|
function flushPendingWhenDefinedCallbacks(tagName, ctor) {
|
|
6421
6709
|
var resolvers = pendingWhenDefinedCallbacks.get(tagName);
|
|
6422
6710
|
if (!isUndefined$1(resolvers)) {
|
|
6423
|
-
var
|
|
6424
|
-
|
|
6711
|
+
var _iterator11 = _createForOfIteratorHelper(resolvers),
|
|
6712
|
+
_step11;
|
|
6425
6713
|
try {
|
|
6426
|
-
for (
|
|
6427
|
-
var resolver =
|
|
6714
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
6715
|
+
var resolver = _step11.value;
|
|
6428
6716
|
resolver(ctor);
|
|
6429
6717
|
}
|
|
6430
6718
|
} catch (err) {
|
|
6431
|
-
|
|
6719
|
+
_iterator11.e(err);
|
|
6432
6720
|
} finally {
|
|
6433
|
-
|
|
6721
|
+
_iterator11.f();
|
|
6434
6722
|
}
|
|
6435
6723
|
}
|
|
6436
6724
|
pendingWhenDefinedCallbacks.delete(tagName);
|
|
@@ -6480,11 +6768,11 @@
|
|
|
6480
6768
|
var awaiting = awaitingUpgrade.get(tagName);
|
|
6481
6769
|
if (!isUndefined$1(awaiting)) {
|
|
6482
6770
|
awaitingUpgrade.delete(tagName);
|
|
6483
|
-
var
|
|
6484
|
-
|
|
6771
|
+
var _iterator12 = _createForOfIteratorHelper(awaiting),
|
|
6772
|
+
_step12;
|
|
6485
6773
|
try {
|
|
6486
|
-
for (
|
|
6487
|
-
var element =
|
|
6774
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
6775
|
+
var element = _step12.value;
|
|
6488
6776
|
var registeredDefinition = pendingRegistryForElement.get(element);
|
|
6489
6777
|
// At this point, registeredDefinition should never be undefined because awaitingUpgrade
|
|
6490
6778
|
// is only populated when we haven't run internalUpgrade yet, and we only populate
|
|
@@ -6496,9 +6784,9 @@
|
|
|
6496
6784
|
}
|
|
6497
6785
|
}
|
|
6498
6786
|
} catch (err) {
|
|
6499
|
-
|
|
6787
|
+
_iterator12.e(err);
|
|
6500
6788
|
} finally {
|
|
6501
|
-
|
|
6789
|
+
_iterator12.f();
|
|
6502
6790
|
}
|
|
6503
6791
|
}
|
|
6504
6792
|
// If anyone called customElements.whenDefined() and is still waiting for a promise resolution, resolve now
|
|
@@ -6775,7 +7063,7 @@
|
|
|
6775
7063
|
function isNull(obj) {
|
|
6776
7064
|
return obj === null;
|
|
6777
7065
|
}
|
|
6778
|
-
/** version: 2.
|
|
7066
|
+
/** version: 2.36.0 */
|
|
6779
7067
|
|
|
6780
7068
|
/*
|
|
6781
7069
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6834,17 +7122,17 @@
|
|
|
6834
7122
|
exports.createFragment = function (html) {
|
|
6835
7123
|
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
6836
7124
|
if (!isUndefined(wrapperTags)) {
|
|
6837
|
-
var
|
|
6838
|
-
|
|
7125
|
+
var _iterator13 = _createForOfIteratorHelper(wrapperTags),
|
|
7126
|
+
_step13;
|
|
6839
7127
|
try {
|
|
6840
|
-
for (
|
|
6841
|
-
var wrapperTag =
|
|
7128
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
7129
|
+
var wrapperTag = _step13.value;
|
|
6842
7130
|
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
6843
7131
|
}
|
|
6844
7132
|
} catch (err) {
|
|
6845
|
-
|
|
7133
|
+
_iterator13.e(err);
|
|
6846
7134
|
} finally {
|
|
6847
|
-
|
|
7135
|
+
_iterator13.f();
|
|
6848
7136
|
}
|
|
6849
7137
|
}
|
|
6850
7138
|
// For IE11, the document title must not be undefined, but it can be an empty string
|
|
@@ -6853,7 +7141,7 @@
|
|
|
6853
7141
|
doc.body.innerHTML = html;
|
|
6854
7142
|
var content = doc.body;
|
|
6855
7143
|
if (!isUndefined(wrapperTags)) {
|
|
6856
|
-
for (var
|
|
7144
|
+
for (var _i38 = 0; _i38 < wrapperTags.length; _i38++) {
|
|
6857
7145
|
content = content.firstChild;
|
|
6858
7146
|
}
|
|
6859
7147
|
}
|
|
@@ -7046,8 +7334,8 @@
|
|
|
7046
7334
|
tagName: element.tagName.toLowerCase(),
|
|
7047
7335
|
hydrated: true
|
|
7048
7336
|
});
|
|
7049
|
-
for (var
|
|
7050
|
-
var _Object$entries2$_i = _slicedToArray(_Object$entries2[
|
|
7337
|
+
for (var _i39 = 0, _Object$entries2 = Object.entries(props); _i39 < _Object$entries2.length; _i39++) {
|
|
7338
|
+
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i39], 2),
|
|
7051
7339
|
key = _Object$entries2$_i[0],
|
|
7052
7340
|
value = _Object$entries2$_i[1];
|
|
7053
7341
|
element[key] = value;
|
|
@@ -7334,7 +7622,7 @@
|
|
|
7334
7622
|
});
|
|
7335
7623
|
freeze(LightningElement);
|
|
7336
7624
|
seal(LightningElement.prototype);
|
|
7337
|
-
/* version: 2.
|
|
7625
|
+
/* version: 2.36.0 */
|
|
7338
7626
|
|
|
7339
7627
|
exports.LightningElement = LightningElement;
|
|
7340
7628
|
exports.__unstable__ProfilerControl = profilerControl;
|