lwc 2.8.0 → 2.9.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 +73 -34
- package/dist/engine-dom/iife/es2017/engine-dom.js +73 -34
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +73 -34
- package/dist/engine-dom/iife/es5/engine-dom.js +144 -100
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +137 -94
- package/dist/engine-dom/umd/es2017/engine-dom.js +73 -34
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +73 -34
- package/dist/engine-dom/umd/es5/engine-dom.js +144 -100
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +137 -94
- package/dist/engine-server/commonjs/es2017/engine-server.js +41 -19
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +41 -19
- 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
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
356
356
|
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
357
357
|
var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
358
|
-
/** version: 2.
|
|
358
|
+
/** version: 2.9.0 */
|
|
359
359
|
|
|
360
360
|
/*
|
|
361
361
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -532,7 +532,7 @@
|
|
|
532
532
|
setFeatureFlag(name, value);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
/** version: 2.
|
|
535
|
+
/** version: 2.9.0 */
|
|
536
536
|
|
|
537
537
|
/* proxy-compat-disable */
|
|
538
538
|
|
|
@@ -620,6 +620,21 @@
|
|
|
620
620
|
}
|
|
621
621
|
|
|
622
622
|
return styleMap;
|
|
623
|
+
} // Make a shallow copy of an object but omit the given key
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
function cloneAndOmitKey(object, keyToOmit) {
|
|
627
|
+
var result = {};
|
|
628
|
+
|
|
629
|
+
for (var _i4 = 0, _Object$keys = Object.keys(object); _i4 < _Object$keys.length; _i4++) {
|
|
630
|
+
var key = _Object$keys[_i4];
|
|
631
|
+
|
|
632
|
+
if (key !== keyToOmit) {
|
|
633
|
+
result[key] = object[key];
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
return result;
|
|
623
638
|
} //
|
|
624
639
|
// Primitives
|
|
625
640
|
//
|
|
@@ -895,8 +910,8 @@
|
|
|
895
910
|
var reactiveObservers = reactiveRecord[key];
|
|
896
911
|
|
|
897
912
|
if (!isUndefined$1(reactiveObservers)) {
|
|
898
|
-
for (var
|
|
899
|
-
var ro = reactiveObservers[
|
|
913
|
+
for (var _i5 = 0, _len2 = reactiveObservers.length; _i5 < _len2; _i5 += 1) {
|
|
914
|
+
var ro = reactiveObservers[_i5];
|
|
900
915
|
ro.notify();
|
|
901
916
|
}
|
|
902
917
|
}
|
|
@@ -965,9 +980,9 @@
|
|
|
965
980
|
var len = listeners.length;
|
|
966
981
|
|
|
967
982
|
if (len > 0) {
|
|
968
|
-
for (var
|
|
969
|
-
var set = listeners[
|
|
970
|
-
var pos = ArrayIndexOf.call(listeners[
|
|
983
|
+
for (var _i6 = 0; _i6 < len; _i6 += 1) {
|
|
984
|
+
var set = listeners[_i6];
|
|
985
|
+
var pos = ArrayIndexOf.call(listeners[_i6], this);
|
|
971
986
|
ArraySplice.call(set, pos, 1);
|
|
972
987
|
}
|
|
973
988
|
|
|
@@ -2749,7 +2764,7 @@
|
|
|
2749
2764
|
|
|
2750
2765
|
|
|
2751
2766
|
var _loop = function _loop() {
|
|
2752
|
-
var childGetter = _childGetters[
|
|
2767
|
+
var childGetter = _childGetters[_i7];
|
|
2753
2768
|
queryAndChildGetterDescriptors[childGetter] = {
|
|
2754
2769
|
get: function get() {
|
|
2755
2770
|
var vm = getAssociatedVM(this);
|
|
@@ -2766,7 +2781,7 @@
|
|
|
2766
2781
|
};
|
|
2767
2782
|
};
|
|
2768
2783
|
|
|
2769
|
-
for (var
|
|
2784
|
+
for (var _i7 = 0, _childGetters = childGetters; _i7 < _childGetters.length; _i7++) {
|
|
2770
2785
|
_loop();
|
|
2771
2786
|
}
|
|
2772
2787
|
|
|
@@ -2790,7 +2805,7 @@
|
|
|
2790
2805
|
|
|
2791
2806
|
|
|
2792
2807
|
var _loop2 = function _loop2() {
|
|
2793
|
-
var queryMethod = _queryMethods[
|
|
2808
|
+
var queryMethod = _queryMethods[_i8];
|
|
2794
2809
|
queryAndChildGetterDescriptors[queryMethod] = {
|
|
2795
2810
|
value: function value(arg) {
|
|
2796
2811
|
var vm = getAssociatedVM(this);
|
|
@@ -2808,7 +2823,7 @@
|
|
|
2808
2823
|
};
|
|
2809
2824
|
};
|
|
2810
2825
|
|
|
2811
|
-
for (var
|
|
2826
|
+
for (var _i8 = 0, _queryMethods = queryMethods; _i8 < _queryMethods.length; _i8++) {
|
|
2812
2827
|
_loop2();
|
|
2813
2828
|
}
|
|
2814
2829
|
|
|
@@ -3331,8 +3346,8 @@
|
|
|
3331
3346
|
}
|
|
3332
3347
|
|
|
3333
3348
|
if (!isUndefined$1(fields)) {
|
|
3334
|
-
for (var
|
|
3335
|
-
var _fieldName2 = fields[
|
|
3349
|
+
for (var _i9 = 0, n = fields.length; _i9 < n; _i9++) {
|
|
3350
|
+
var _fieldName2 = fields[_i9];
|
|
3336
3351
|
descriptor = getOwnPropertyDescriptor$1(proto, _fieldName2);
|
|
3337
3352
|
|
|
3338
3353
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3553,8 +3568,8 @@
|
|
|
3553
3568
|
superObservedAttributes = _SuperClass$observedA === void 0 ? [] : _SuperClass$observedA;
|
|
3554
3569
|
var descriptors = create(null); // expose getters and setters for each public props on the new Element Bridge
|
|
3555
3570
|
|
|
3556
|
-
for (var
|
|
3557
|
-
var _propName2 = props[
|
|
3571
|
+
for (var _i10 = 0, _len3 = props.length; _i10 < _len3; _i10 += 1) {
|
|
3572
|
+
var _propName2 = props[_i10];
|
|
3558
3573
|
attributeToPropMap[htmlPropertyToAttribute(_propName2)] = _propName2;
|
|
3559
3574
|
descriptors[_propName2] = {
|
|
3560
3575
|
get: createGetter(_propName2),
|
|
@@ -3565,8 +3580,8 @@
|
|
|
3565
3580
|
} // expose public methods as props on the new Element Bridge
|
|
3566
3581
|
|
|
3567
3582
|
|
|
3568
|
-
for (var
|
|
3569
|
-
var methodName = methods[
|
|
3583
|
+
for (var _i11 = 0, _len4 = methods.length; _i11 < _len4; _i11 += 1) {
|
|
3584
|
+
var methodName = methods[_i11];
|
|
3570
3585
|
descriptors[methodName] = {
|
|
3571
3586
|
value: createMethodCaller(methodName),
|
|
3572
3587
|
writable: true,
|
|
@@ -4510,8 +4525,8 @@
|
|
|
4510
4525
|
return;
|
|
4511
4526
|
}
|
|
4512
4527
|
|
|
4513
|
-
for (var
|
|
4514
|
-
var _styleDecls$_i = _slicedToArray(styleDecls[
|
|
4528
|
+
for (var _i12 = 0; _i12 < styleDecls.length; _i12++) {
|
|
4529
|
+
var _styleDecls$_i = _slicedToArray(styleDecls[_i12], 3),
|
|
4515
4530
|
prop = _styleDecls$_i[0],
|
|
4516
4531
|
value = _styleDecls$_i[1],
|
|
4517
4532
|
important = _styleDecls$_i[2];
|
|
@@ -4778,11 +4793,13 @@
|
|
|
4778
4793
|
) {
|
|
4779
4794
|
// this element will now accept any manual content inserted into it
|
|
4780
4795
|
observeElementChildNodes(elm);
|
|
4781
|
-
}
|
|
4782
|
-
// into each element from the template, so they can be styled accordingly.
|
|
4783
|
-
|
|
4796
|
+
}
|
|
4784
4797
|
|
|
4785
|
-
|
|
4798
|
+
if (!isUndefined$1(stylesheetToken)) {
|
|
4799
|
+
// when running in synthetic shadow mode, we need to set the shadowToken value
|
|
4800
|
+
// into each element from the template, so they can be styled accordingly.
|
|
4801
|
+
setElementShadowToken(elm, stylesheetToken);
|
|
4802
|
+
}
|
|
4786
4803
|
}
|
|
4787
4804
|
|
|
4788
4805
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -4859,7 +4876,9 @@
|
|
|
4859
4876
|
var stylesheetToken = owner.context.stylesheetToken; // when running in synthetic shadow mode, we need to set the shadowToken value
|
|
4860
4877
|
// into each element from the template, so they can be styled accordingly.
|
|
4861
4878
|
|
|
4862
|
-
|
|
4879
|
+
if (!isUndefined$1(stylesheetToken)) {
|
|
4880
|
+
setElementShadowToken(elm, stylesheetToken);
|
|
4881
|
+
}
|
|
4863
4882
|
}
|
|
4864
4883
|
|
|
4865
4884
|
vm = createVM(elm, ctor, {
|
|
@@ -4911,8 +4930,8 @@
|
|
|
4911
4930
|
var oldSlots = vm.cmpSlots;
|
|
4912
4931
|
var cmpSlots = vm.cmpSlots = create(null);
|
|
4913
4932
|
|
|
4914
|
-
for (var
|
|
4915
|
-
var vnode = children[
|
|
4933
|
+
for (var _i13 = 0, _len6 = children.length; _i13 < _len6; _i13 += 1) {
|
|
4934
|
+
var vnode = children[_i13];
|
|
4916
4935
|
|
|
4917
4936
|
if (isNull(vnode)) {
|
|
4918
4937
|
continue;
|
|
@@ -4946,8 +4965,8 @@
|
|
|
4946
4965
|
return;
|
|
4947
4966
|
}
|
|
4948
4967
|
|
|
4949
|
-
for (var
|
|
4950
|
-
var key = oldKeys[
|
|
4968
|
+
for (var _i14 = 0, _len7 = oldKeys.length; _i14 < _len7; _i14 += 1) {
|
|
4969
|
+
var key = oldKeys[_i14];
|
|
4951
4970
|
|
|
4952
4971
|
if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
|
|
4953
4972
|
markComponentAsDirty(vm);
|
|
@@ -5032,6 +5051,7 @@
|
|
|
5032
5051
|
var idxInOld;
|
|
5033
5052
|
var elmToMove;
|
|
5034
5053
|
var before;
|
|
5054
|
+
var clonedOldCh = false;
|
|
5035
5055
|
|
|
5036
5056
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
5037
5057
|
if (!isVNode(oldStartVnode)) {
|
|
@@ -5083,7 +5103,18 @@
|
|
|
5083
5103
|
newStartVnode.hook.create(newStartVnode);
|
|
5084
5104
|
newStartVnode.hook.insert(newStartVnode, parentElm, oldStartVnode.elm);
|
|
5085
5105
|
} else {
|
|
5086
|
-
patchVnode(elmToMove, newStartVnode);
|
|
5106
|
+
patchVnode(elmToMove, newStartVnode); // Delete the old child, but copy the array since it is read-only.
|
|
5107
|
+
// The `oldCh` will be GC'ed after `updateDynamicChildren` is complete,
|
|
5108
|
+
// so we only care about the `oldCh` object inside this function.
|
|
5109
|
+
// To avoid cloning over and over again, we check `clonedOldCh`
|
|
5110
|
+
// and only clone once.
|
|
5111
|
+
|
|
5112
|
+
if (!clonedOldCh) {
|
|
5113
|
+
clonedOldCh = true;
|
|
5114
|
+
oldCh = _toConsumableArray(oldCh);
|
|
5115
|
+
} // We've already cloned at least once, so it's no longer read-only
|
|
5116
|
+
|
|
5117
|
+
|
|
5087
5118
|
oldCh[idxInOld] = undefined;
|
|
5088
5119
|
newStartVnode.hook.move(elmToMove, parentElm, oldStartVnode.elm);
|
|
5089
5120
|
}
|
|
@@ -5098,12 +5129,12 @@
|
|
|
5098
5129
|
if (oldStartIdx > oldEndIdx) {
|
|
5099
5130
|
// There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
|
|
5100
5131
|
// already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
|
|
5101
|
-
var
|
|
5132
|
+
var _i15 = newEndIdx;
|
|
5102
5133
|
var n;
|
|
5103
5134
|
|
|
5104
5135
|
do {
|
|
5105
|
-
n = newCh[++
|
|
5106
|
-
} while (!isVNode(n) &&
|
|
5136
|
+
n = newCh[++_i15];
|
|
5137
|
+
} while (!isVNode(n) && _i15 < newChEnd);
|
|
5107
5138
|
|
|
5108
5139
|
before = isVNode(n) ? n.elm : null;
|
|
5109
5140
|
addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx);
|
|
@@ -5134,9 +5165,9 @@
|
|
|
5134
5165
|
|
|
5135
5166
|
var referenceElm = null;
|
|
5136
5167
|
|
|
5137
|
-
for (var
|
|
5138
|
-
var vnode = newCh[
|
|
5139
|
-
var oldVNode = oldCh[
|
|
5168
|
+
for (var _i16 = newChLength - 1; _i16 >= 0; _i16 -= 1) {
|
|
5169
|
+
var vnode = newCh[_i16];
|
|
5170
|
+
var oldVNode = oldCh[_i16];
|
|
5140
5171
|
|
|
5141
5172
|
if (vnode !== oldVNode) {
|
|
5142
5173
|
if (isVNode(oldVNode)) {
|
|
@@ -5180,7 +5211,8 @@
|
|
|
5180
5211
|
} // [h]tml node
|
|
5181
5212
|
|
|
5182
5213
|
|
|
5183
|
-
function h(sel, data
|
|
5214
|
+
function h(sel, data) {
|
|
5215
|
+
var children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EmptyArray;
|
|
5184
5216
|
var vmBeingRendered = getVMBeingRendered();
|
|
5185
5217
|
|
|
5186
5218
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -5568,7 +5600,9 @@
|
|
|
5568
5600
|
* create a dynamic component via `<x-foo lwc:dynamic={Ctor}>`
|
|
5569
5601
|
*/
|
|
5570
5602
|
|
|
5571
|
-
function dc(sel, Ctor, data
|
|
5603
|
+
function dc(sel, Ctor, data) {
|
|
5604
|
+
var children = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : EmptyArray;
|
|
5605
|
+
|
|
5572
5606
|
if (process.env.NODE_ENV !== 'production') {
|
|
5573
5607
|
assert.isTrue(isString(sel), "dc() 1st argument sel must be a string.");
|
|
5574
5608
|
assert.isTrue(isObject(data), "dc() 3nd argument data must be an object.");
|
|
@@ -5592,10 +5626,14 @@
|
|
|
5592
5626
|
} // the new vnode key is a mix of idx and compiler key, this is required by the diffing algo
|
|
5593
5627
|
// to identify different constructors as vnodes with different keys to avoid reusing the
|
|
5594
5628
|
// element used for previous constructors.
|
|
5629
|
+
// Shallow clone is necessary here becuase VElementData may be shared across VNodes due to
|
|
5630
|
+
// hoisting optimization.
|
|
5595
5631
|
|
|
5596
5632
|
|
|
5597
|
-
|
|
5598
|
-
|
|
5633
|
+
var newData = Object.assign(Object.assign({}, data), {
|
|
5634
|
+
key: "dc:".concat(idx, ":").concat(data.key)
|
|
5635
|
+
});
|
|
5636
|
+
return c(sel, Ctor, newData, children);
|
|
5599
5637
|
}
|
|
5600
5638
|
/**
|
|
5601
5639
|
* slow children collection marking mechanism. this API allows the compiler to signal
|
|
@@ -5707,12 +5745,14 @@
|
|
|
5707
5745
|
oldHasTokenInClass = context.hasTokenInClass,
|
|
5708
5746
|
oldHasTokenInAttribute = context.hasTokenInAttribute;
|
|
5709
5747
|
|
|
5710
|
-
if (
|
|
5711
|
-
|
|
5712
|
-
|
|
5748
|
+
if (!isUndefined$1(oldToken)) {
|
|
5749
|
+
if (oldHasTokenInClass) {
|
|
5750
|
+
getClassList$1(elm).remove(makeHostToken(oldToken));
|
|
5751
|
+
}
|
|
5713
5752
|
|
|
5714
|
-
|
|
5715
|
-
|
|
5753
|
+
if (oldHasTokenInAttribute) {
|
|
5754
|
+
removeAttribute$1(elm, makeHostToken(oldToken));
|
|
5755
|
+
}
|
|
5716
5756
|
} // Apply the new template styling token to the host element, if the new template has any
|
|
5717
5757
|
// associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
|
|
5718
5758
|
|
|
@@ -5744,8 +5784,8 @@
|
|
|
5744
5784
|
var content = [];
|
|
5745
5785
|
var root;
|
|
5746
5786
|
|
|
5747
|
-
for (var
|
|
5748
|
-
var stylesheet = stylesheets[
|
|
5787
|
+
for (var _i17 = 0; _i17 < stylesheets.length; _i17++) {
|
|
5788
|
+
var stylesheet = stylesheets[_i17];
|
|
5749
5789
|
|
|
5750
5790
|
if (isArray$1(stylesheet)) {
|
|
5751
5791
|
ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
|
|
@@ -5855,8 +5895,8 @@
|
|
|
5855
5895
|
&& shadowMode === 1
|
|
5856
5896
|
/* Synthetic */
|
|
5857
5897
|
) {
|
|
5858
|
-
for (var
|
|
5859
|
-
insertGlobalStylesheet$1(stylesheets[
|
|
5898
|
+
for (var _i18 = 0; _i18 < stylesheets.length; _i18++) {
|
|
5899
|
+
insertGlobalStylesheet$1(stylesheets[_i18]);
|
|
5860
5900
|
}
|
|
5861
5901
|
} else if (ssr$1 || isHydrating$1()) {
|
|
5862
5902
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
@@ -5870,12 +5910,12 @@
|
|
|
5870
5910
|
var root = getNearestNativeShadowComponent(vm);
|
|
5871
5911
|
var isGlobal = isNull(root);
|
|
5872
5912
|
|
|
5873
|
-
for (var
|
|
5913
|
+
for (var _i19 = 0; _i19 < stylesheets.length; _i19++) {
|
|
5874
5914
|
if (isGlobal) {
|
|
5875
|
-
insertGlobalStylesheet$1(stylesheets[
|
|
5915
|
+
insertGlobalStylesheet$1(stylesheets[_i19]);
|
|
5876
5916
|
} else {
|
|
5877
5917
|
// local level
|
|
5878
|
-
insertStylesheet$1(stylesheets[
|
|
5918
|
+
insertStylesheet$1(stylesheets[_i19], root.shadowRoot);
|
|
5879
5919
|
}
|
|
5880
5920
|
}
|
|
5881
5921
|
}
|
|
@@ -6152,8 +6192,8 @@
|
|
|
6152
6192
|
var stylesheets = template.stylesheets;
|
|
6153
6193
|
|
|
6154
6194
|
if (!isUndefined$1(stylesheets)) {
|
|
6155
|
-
for (var
|
|
6156
|
-
if (isTrue(stylesheets[
|
|
6195
|
+
for (var _i20 = 0; _i20 < stylesheets.length; _i20++) {
|
|
6196
|
+
if (isTrue(stylesheets[_i20][KEY__SCOPED_CSS])) {
|
|
6157
6197
|
return true;
|
|
6158
6198
|
}
|
|
6159
6199
|
}
|
|
@@ -6365,8 +6405,8 @@
|
|
|
6365
6405
|
assert.isTrue(isObject(service), "Invalid service declaration, ".concat(service, ": service must be an object"));
|
|
6366
6406
|
}
|
|
6367
6407
|
|
|
6368
|
-
for (var
|
|
6369
|
-
var hookName = hooks[
|
|
6408
|
+
for (var _i21 = 0; _i21 < hooks.length; ++_i21) {
|
|
6409
|
+
var hookName = hooks[_i21];
|
|
6370
6410
|
|
|
6371
6411
|
if (hookName in service) {
|
|
6372
6412
|
var l = Services[hookName];
|
|
@@ -6389,8 +6429,8 @@
|
|
|
6389
6429
|
def = vm.def,
|
|
6390
6430
|
context = vm.context;
|
|
6391
6431
|
|
|
6392
|
-
for (var
|
|
6393
|
-
cbs[
|
|
6432
|
+
for (var _i22 = 0, _len8 = cbs.length; _i22 < _len8; ++_i22) {
|
|
6433
|
+
cbs[_i22].call(undefined, component, {}, def, context);
|
|
6394
6434
|
}
|
|
6395
6435
|
}
|
|
6396
6436
|
/*
|
|
@@ -6484,7 +6524,10 @@
|
|
|
6484
6524
|
|
|
6485
6525
|
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
6486
6526
|
if (elm.innerHTML === props.innerHTML) {
|
|
6487
|
-
|
|
6527
|
+
// Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
|
|
6528
|
+
vnode.data = Object.assign(Object.assign({}, vnode.data), {
|
|
6529
|
+
props: cloneAndOmitKey(props, 'innerHTML')
|
|
6530
|
+
});
|
|
6488
6531
|
} else {
|
|
6489
6532
|
logWarn("Mismatch hydrating element <".concat(elm.tagName.toLowerCase(), ">: innerHTML values do not match for element, will recover from the difference"), vnode.owner);
|
|
6490
6533
|
}
|
|
@@ -6552,8 +6595,8 @@
|
|
|
6552
6595
|
|
|
6553
6596
|
var childNodeIndex = 0;
|
|
6554
6597
|
|
|
6555
|
-
for (var
|
|
6556
|
-
var childVnode = children[
|
|
6598
|
+
for (var _i23 = 0; _i23 < children.length; _i23++) {
|
|
6599
|
+
var childVnode = children[_i23];
|
|
6557
6600
|
|
|
6558
6601
|
if (!isNull(childVnode)) {
|
|
6559
6602
|
var childNode = elmChildren[childNodeIndex];
|
|
@@ -6601,8 +6644,8 @@
|
|
|
6601
6644
|
var nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
|
|
6602
6645
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
6603
6646
|
|
|
6604
|
-
for (var
|
|
6605
|
-
var _Object$entries$_i = _slicedToArray(_Object$entries[
|
|
6647
|
+
for (var _i24 = 0, _Object$entries = Object.entries(attrs); _i24 < _Object$entries.length; _i24++) {
|
|
6648
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i24], 2),
|
|
6606
6649
|
attrName = _Object$entries$_i[0],
|
|
6607
6650
|
attrValue = _Object$entries$_i[1];
|
|
6608
6651
|
|
|
@@ -6670,8 +6713,8 @@
|
|
|
6670
6713
|
var parsedVnodeStyle = parseStyleText(elmStyle);
|
|
6671
6714
|
var expectedStyle = []; // styleMap is used when style is set to static value.
|
|
6672
6715
|
|
|
6673
|
-
for (var
|
|
6674
|
-
var _styleDecls$_i2 = _slicedToArray(styleDecls[
|
|
6716
|
+
for (var _i25 = 0, n = styleDecls.length; _i25 < n; _i25++) {
|
|
6717
|
+
var _styleDecls$_i2 = _slicedToArray(styleDecls[_i25], 3),
|
|
6675
6718
|
prop = _styleDecls$_i2[0],
|
|
6676
6719
|
value = _styleDecls$_i2[1],
|
|
6677
6720
|
important = _styleDecls$_i2[2];
|
|
@@ -7085,19 +7128,19 @@
|
|
|
7085
7128
|
});
|
|
7086
7129
|
rehydrateQueue = []; // reset to a new queue
|
|
7087
7130
|
|
|
7088
|
-
for (var
|
|
7089
|
-
var vm = vms[
|
|
7131
|
+
for (var _i26 = 0, _len9 = vms.length; _i26 < _len9; _i26 += 1) {
|
|
7132
|
+
var vm = vms[_i26];
|
|
7090
7133
|
|
|
7091
7134
|
try {
|
|
7092
7135
|
rehydrate(vm);
|
|
7093
7136
|
} catch (error) {
|
|
7094
|
-
if (
|
|
7137
|
+
if (_i26 + 1 < _len9) {
|
|
7095
7138
|
// pieces of the queue are still pending to be rehydrated, those should have priority
|
|
7096
7139
|
if (rehydrateQueue.length === 0) {
|
|
7097
7140
|
addCallbackToNextTick(flushRehydrationQueue);
|
|
7098
7141
|
}
|
|
7099
7142
|
|
|
7100
|
-
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms,
|
|
7143
|
+
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i26 + 1));
|
|
7101
7144
|
} // we need to end the measure before throwing.
|
|
7102
7145
|
|
|
7103
7146
|
|
|
@@ -7201,8 +7244,8 @@
|
|
|
7201
7244
|
var vCustomElementCollection = vm.velements; // Reporting disconnection for every child in inverse order since they are
|
|
7202
7245
|
// inserted in reserved order.
|
|
7203
7246
|
|
|
7204
|
-
for (var
|
|
7205
|
-
var elm = vCustomElementCollection[
|
|
7247
|
+
for (var _i27 = vCustomElementCollection.length - 1; _i27 >= 0; _i27 -= 1) {
|
|
7248
|
+
var elm = vCustomElementCollection[_i27].elm; // There are two cases where the element could be undefined:
|
|
7206
7249
|
// * when there is an error during the construction phase, and an error
|
|
7207
7250
|
// boundary picks it, there is a possibility that the VCustomElement
|
|
7208
7251
|
// is not properly initialized, and therefore is should be ignored.
|
|
@@ -7236,8 +7279,8 @@
|
|
|
7236
7279
|
|
|
7237
7280
|
|
|
7238
7281
|
function recursivelyDisconnectChildren(vnodes) {
|
|
7239
|
-
for (var
|
|
7240
|
-
var vnode = vnodes[
|
|
7282
|
+
for (var _i28 = 0, _len10 = vnodes.length; _i28 < _len10; _i28 += 1) {
|
|
7283
|
+
var vnode = vnodes[_i28];
|
|
7241
7284
|
|
|
7242
7285
|
if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
|
|
7243
7286
|
switch (vnode.type) {
|
|
@@ -7268,8 +7311,8 @@
|
|
|
7268
7311
|
var children = vm.children,
|
|
7269
7312
|
renderRoot = vm.renderRoot;
|
|
7270
7313
|
|
|
7271
|
-
for (var
|
|
7272
|
-
var child = children[
|
|
7314
|
+
for (var _i29 = 0, _len11 = children.length; _i29 < _len11; _i29++) {
|
|
7315
|
+
var child = children[_i29];
|
|
7273
7316
|
|
|
7274
7317
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
7275
7318
|
remove$1(child.elm, renderRoot);
|
|
@@ -7643,8 +7686,8 @@
|
|
|
7643
7686
|
function connectWireAdapters(vm) {
|
|
7644
7687
|
var wiredConnecting = vm.context.wiredConnecting;
|
|
7645
7688
|
|
|
7646
|
-
for (var
|
|
7647
|
-
wiredConnecting[
|
|
7689
|
+
for (var _i30 = 0, _len12 = wiredConnecting.length; _i30 < _len12; _i30 += 1) {
|
|
7690
|
+
wiredConnecting[_i30]();
|
|
7648
7691
|
}
|
|
7649
7692
|
}
|
|
7650
7693
|
|
|
@@ -7652,8 +7695,8 @@
|
|
|
7652
7695
|
var wiredDisconnecting = vm.context.wiredDisconnecting;
|
|
7653
7696
|
runWithBoundaryProtection(vm, vm, noop, function () {
|
|
7654
7697
|
// job
|
|
7655
|
-
for (var
|
|
7656
|
-
wiredDisconnecting[
|
|
7698
|
+
for (var _i31 = 0, _len13 = wiredDisconnecting.length; _i31 < _len13; _i31 += 1) {
|
|
7699
|
+
wiredDisconnecting[_i31]();
|
|
7657
7700
|
}
|
|
7658
7701
|
}, noop);
|
|
7659
7702
|
}
|
|
@@ -7743,7 +7786,7 @@
|
|
|
7743
7786
|
hooksAreSet = true;
|
|
7744
7787
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7745
7788
|
}
|
|
7746
|
-
/* version: 2.
|
|
7789
|
+
/* version: 2.9.0 */
|
|
7747
7790
|
|
|
7748
7791
|
/*
|
|
7749
7792
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7758,8 +7801,8 @@
|
|
|
7758
7801
|
if (process.env.NODE_ENV === 'development') {
|
|
7759
7802
|
// @ts-ignore
|
|
7760
7803
|
window.__lwcResetGlobalStylesheets = function () {
|
|
7761
|
-
for (var
|
|
7762
|
-
var key = _Object$
|
|
7804
|
+
for (var _i32 = 0, _Object$keys2 = Object.keys(globalStylesheets); _i32 < _Object$keys2.length; _i32++) {
|
|
7805
|
+
var key = _Object$keys2[_i32];
|
|
7763
7806
|
delete globalStylesheets[key];
|
|
7764
7807
|
}
|
|
7765
7808
|
};
|
|
@@ -8267,8 +8310,8 @@
|
|
|
8267
8310
|
tagName: element.tagName.toLowerCase()
|
|
8268
8311
|
});
|
|
8269
8312
|
|
|
8270
|
-
for (var
|
|
8271
|
-
var _Object$entries2$_i = _slicedToArray(_Object$entries2[
|
|
8313
|
+
for (var _i33 = 0, _Object$entries2 = Object.entries(props); _i33 < _Object$entries2.length; _i33++) {
|
|
8314
|
+
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i33], 2),
|
|
8272
8315
|
key = _Object$entries2$_i[0],
|
|
8273
8316
|
value = _Object$entries2$_i[1];
|
|
8274
8317
|
|
|
@@ -8290,8 +8333,8 @@
|
|
|
8290
8333
|
mode: 'open'
|
|
8291
8334
|
});
|
|
8292
8335
|
|
|
8293
|
-
for (var
|
|
8294
|
-
var _Object$entries3$_i = _slicedToArray(_Object$entries3[
|
|
8336
|
+
for (var _i34 = 0, _Object$entries3 = Object.entries(props); _i34 < _Object$entries3.length; _i34++) {
|
|
8337
|
+
var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i34], 2),
|
|
8295
8338
|
_key3 = _Object$entries3$_i[0],
|
|
8296
8339
|
_value2 = _Object$entries3$_i[1];
|
|
8297
8340
|
|
|
@@ -8408,30 +8451,31 @@
|
|
|
8408
8451
|
|
|
8409
8452
|
var _Node = Node;
|
|
8410
8453
|
/**
|
|
8411
|
-
* EXPERIMENTAL:
|
|
8412
|
-
*
|
|
8454
|
+
* EXPERIMENTAL: The purpose of this function is to detect shadowed nodes. THIS API WILL BE REMOVED
|
|
8455
|
+
* ONCE LOCKER V1 IS NO LONGER SUPPORTED.
|
|
8413
8456
|
*/
|
|
8414
8457
|
|
|
8415
|
-
function
|
|
8458
|
+
function isNodeShadowed(node) {
|
|
8416
8459
|
if (isFalse(node instanceof _Node)) {
|
|
8417
8460
|
return false;
|
|
8418
|
-
} //
|
|
8419
|
-
// this
|
|
8461
|
+
} // It's debatable whether shadow root instances should be considered as shadowed, but we keep
|
|
8462
|
+
// this unchanged for legacy reasons (#1250).
|
|
8420
8463
|
|
|
8421
8464
|
|
|
8422
8465
|
if (node instanceof ShadowRoot) {
|
|
8423
8466
|
return false;
|
|
8424
8467
|
}
|
|
8425
8468
|
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
return
|
|
8431
|
-
}
|
|
8469
|
+
var rootNode = node.getRootNode(); // Handle the native case. We can return early here because an invariant of LWC is that
|
|
8470
|
+
// synthetic roots cannot be descendants of native roots.
|
|
8471
|
+
|
|
8472
|
+
if (rootNode instanceof ShadowRoot && isFalse(hasOwnProperty$1.call(getPrototypeOf$1(rootNode), 'synthetic'))) {
|
|
8473
|
+
return true;
|
|
8474
|
+
} // TODO [#1252]: Old behavior that is still used by some pieces of the platform. Manually
|
|
8475
|
+
// inserted nodes without the `lwc:dom=manual` directive will be considered as global elements.
|
|
8476
|
+
|
|
8432
8477
|
|
|
8433
|
-
|
|
8434
|
-
return root instanceof ShadowRoot;
|
|
8478
|
+
return isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
|
|
8435
8479
|
}
|
|
8436
8480
|
/*
|
|
8437
8481
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8475,7 +8519,7 @@
|
|
|
8475
8519
|
});
|
|
8476
8520
|
freeze(LightningElement);
|
|
8477
8521
|
seal(LightningElement.prototype);
|
|
8478
|
-
/* version: 2.
|
|
8522
|
+
/* version: 2.9.0 */
|
|
8479
8523
|
|
|
8480
8524
|
exports.LightningElement = LightningElement;
|
|
8481
8525
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -8487,7 +8531,7 @@
|
|
|
8487
8531
|
exports.getComponentDef = getComponentDef;
|
|
8488
8532
|
exports.hydrateComponent = hydrateComponent;
|
|
8489
8533
|
exports.isComponentConstructor = isComponentConstructor;
|
|
8490
|
-
exports.isNodeFromTemplate =
|
|
8534
|
+
exports.isNodeFromTemplate = isNodeShadowed;
|
|
8491
8535
|
exports.readonly = readonly;
|
|
8492
8536
|
exports.register = register;
|
|
8493
8537
|
exports.registerComponent = registerComponent;
|