lwc 2.11.1 → 2.11.5
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 +331 -259
- package/dist/engine-dom/iife/es2017/engine-dom.js +331 -259
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +288 -124
- package/dist/engine-dom/iife/es5/engine-dom.js +1132 -1046
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +418 -180
- package/dist/engine-dom/umd/es2017/engine-dom.js +331 -259
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +288 -124
- package/dist/engine-dom/umd/es5/engine-dom.js +1132 -1046
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +418 -180
- package/dist/engine-server/commonjs/es2017/engine-server.js +36 -7
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +36 -7
- 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 +8 -9
|
@@ -52,6 +52,8 @@
|
|
|
52
52
|
|
|
53
53
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
54
54
|
|
|
55
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
56
|
+
|
|
55
57
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
56
58
|
|
|
57
59
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
@@ -348,7 +350,7 @@
|
|
|
348
350
|
var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
349
351
|
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
350
352
|
var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
351
|
-
/** version: 2.11.
|
|
353
|
+
/** version: 2.11.5 */
|
|
352
354
|
|
|
353
355
|
/*
|
|
354
356
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -518,7 +520,7 @@
|
|
|
518
520
|
|
|
519
521
|
function setFeatureFlagForTest(name, value) {
|
|
520
522
|
}
|
|
521
|
-
/** version: 2.11.
|
|
523
|
+
/** version: 2.11.5 */
|
|
522
524
|
|
|
523
525
|
/* proxy-compat-disable */
|
|
524
526
|
|
|
@@ -561,6 +563,42 @@
|
|
|
561
563
|
|
|
562
564
|
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
|
563
565
|
} // Borrowed from Vue template compiler.
|
|
566
|
+
// https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
var DECLARATION_DELIMITER = /;(?![^(]*\))/g;
|
|
570
|
+
var PROPERTY_DELIMITER = /:(.+)/;
|
|
571
|
+
|
|
572
|
+
function parseStyleText(cssText) {
|
|
573
|
+
var styleMap = {};
|
|
574
|
+
var declarations = cssText.split(DECLARATION_DELIMITER);
|
|
575
|
+
|
|
576
|
+
var _iterator = _createForOfIteratorHelper(declarations),
|
|
577
|
+
_step;
|
|
578
|
+
|
|
579
|
+
try {
|
|
580
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
581
|
+
var declaration = _step.value;
|
|
582
|
+
|
|
583
|
+
if (declaration) {
|
|
584
|
+
var _declaration$split = declaration.split(PROPERTY_DELIMITER),
|
|
585
|
+
_declaration$split2 = _slicedToArray(_declaration$split, 2),
|
|
586
|
+
prop = _declaration$split2[0],
|
|
587
|
+
value = _declaration$split2[1];
|
|
588
|
+
|
|
589
|
+
if (prop !== undefined && value !== undefined) {
|
|
590
|
+
styleMap[prop.trim()] = value.trim();
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
} catch (err) {
|
|
595
|
+
_iterator.e(err);
|
|
596
|
+
} finally {
|
|
597
|
+
_iterator.f();
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
return styleMap;
|
|
601
|
+
} // Make a shallow copy of an object but omit the given key
|
|
564
602
|
|
|
565
603
|
|
|
566
604
|
function cloneAndOmitKey(object, keyToOmit) {
|
|
@@ -1033,8 +1071,8 @@
|
|
|
1033
1071
|
}
|
|
1034
1072
|
}
|
|
1035
1073
|
|
|
1036
|
-
function
|
|
1037
|
-
log('
|
|
1074
|
+
function logError(message, vm) {
|
|
1075
|
+
log('error', message, vm);
|
|
1038
1076
|
}
|
|
1039
1077
|
/*
|
|
1040
1078
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2594,6 +2632,13 @@
|
|
|
2594
2632
|
var meta = signedDecoratorToMetaMap.get(Ctor);
|
|
2595
2633
|
return isUndefined$1(meta) ? defaultMeta : meta;
|
|
2596
2634
|
}
|
|
2635
|
+
/*
|
|
2636
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
2637
|
+
* All rights reserved.
|
|
2638
|
+
* SPDX-License-Identifier: MIT
|
|
2639
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2640
|
+
*/
|
|
2641
|
+
|
|
2597
2642
|
|
|
2598
2643
|
var signedTemplateSet = new Set();
|
|
2599
2644
|
|
|
@@ -2614,7 +2659,33 @@
|
|
|
2614
2659
|
|
|
2615
2660
|
function registerTemplate(tpl) {
|
|
2616
2661
|
|
|
2617
|
-
signedTemplateSet.add(tpl); //
|
|
2662
|
+
signedTemplateSet.add(tpl); // FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
|
|
2663
|
+
// the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
|
|
2664
|
+
// on top of stylesheetToken for anyone who is accessing the old internal API.
|
|
2665
|
+
// Details: https://salesforce.quip.com/v1rmAFu2cKAr
|
|
2666
|
+
|
|
2667
|
+
defineProperty(tpl, 'stylesheetTokens', {
|
|
2668
|
+
get: function get() {
|
|
2669
|
+
var stylesheetToken = this.stylesheetToken;
|
|
2670
|
+
|
|
2671
|
+
if (isUndefined$1(stylesheetToken)) {
|
|
2672
|
+
return stylesheetToken;
|
|
2673
|
+
} // Shim for the old `stylesheetTokens` property
|
|
2674
|
+
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
2675
|
+
|
|
2676
|
+
|
|
2677
|
+
return {
|
|
2678
|
+
hostAttribute: "".concat(stylesheetToken, "-host"),
|
|
2679
|
+
shadowAttribute: stylesheetToken
|
|
2680
|
+
};
|
|
2681
|
+
},
|
|
2682
|
+
set: function set(value) {
|
|
2683
|
+
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
2684
|
+
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
2685
|
+
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
2686
|
+
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
2687
|
+
}
|
|
2688
|
+
}); // chaining this method as a way to wrap existing
|
|
2618
2689
|
// assignment of templates easily, without too much transformation
|
|
2619
2690
|
|
|
2620
2691
|
return tpl;
|
|
@@ -5057,140 +5128,6 @@
|
|
|
5057
5128
|
cbs[_i22].call(undefined, component, {}, def, context);
|
|
5058
5129
|
}
|
|
5059
5130
|
}
|
|
5060
|
-
/*
|
|
5061
|
-
* Copyright (c) 2022, salesforce.com, inc.
|
|
5062
|
-
* All rights reserved.
|
|
5063
|
-
* SPDX-License-Identifier: MIT
|
|
5064
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5065
|
-
*/
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
function hydrate(vnode, node) {
|
|
5069
|
-
switch (vnode.type) {
|
|
5070
|
-
case 0
|
|
5071
|
-
/* Text */
|
|
5072
|
-
:
|
|
5073
|
-
hydrateText(vnode, node);
|
|
5074
|
-
break;
|
|
5075
|
-
|
|
5076
|
-
case 1
|
|
5077
|
-
/* Comment */
|
|
5078
|
-
:
|
|
5079
|
-
hydrateComment(vnode, node);
|
|
5080
|
-
break;
|
|
5081
|
-
|
|
5082
|
-
case 2
|
|
5083
|
-
/* Element */
|
|
5084
|
-
:
|
|
5085
|
-
hydrateElement(vnode, node);
|
|
5086
|
-
break;
|
|
5087
|
-
|
|
5088
|
-
case 3
|
|
5089
|
-
/* CustomElement */
|
|
5090
|
-
:
|
|
5091
|
-
hydrateCustomElement(vnode, node);
|
|
5092
|
-
break;
|
|
5093
|
-
}
|
|
5094
|
-
}
|
|
5095
|
-
|
|
5096
|
-
function hydrateText(vnode, node) {
|
|
5097
|
-
var _a;
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
5101
|
-
vnode.elm = node;
|
|
5102
|
-
}
|
|
5103
|
-
|
|
5104
|
-
function hydrateComment(vnode, node) {
|
|
5105
|
-
var _a;
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
5109
|
-
vnode.elm = node;
|
|
5110
|
-
}
|
|
5111
|
-
|
|
5112
|
-
function hydrateElement(vnode, node) {
|
|
5113
|
-
|
|
5114
|
-
var elm = node;
|
|
5115
|
-
vnode.elm = elm;
|
|
5116
|
-
var context = vnode.data.context;
|
|
5117
|
-
var isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual"
|
|
5118
|
-
/* Manual */
|
|
5119
|
-
);
|
|
5120
|
-
|
|
5121
|
-
if (isDomManual) {
|
|
5122
|
-
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
5123
|
-
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
5124
|
-
var props = vnode.data.props;
|
|
5125
|
-
|
|
5126
|
-
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
5127
|
-
if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
|
|
5128
|
-
// Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
|
|
5129
|
-
vnode.data = Object.assign(Object.assign({}, vnode.data), {
|
|
5130
|
-
props: cloneAndOmitKey(props, 'innerHTML')
|
|
5131
|
-
});
|
|
5132
|
-
} else {
|
|
5133
|
-
logWarn("Mismatch hydrating element <".concat(getProperty$1(elm, 'tagName').toLowerCase(), ">: innerHTML values do not match for element, will recover from the difference"), vnode.owner);
|
|
5134
|
-
}
|
|
5135
|
-
}
|
|
5136
|
-
}
|
|
5137
|
-
|
|
5138
|
-
patchElementPropsAndAttrs(vnode);
|
|
5139
|
-
|
|
5140
|
-
if (!isDomManual) {
|
|
5141
|
-
hydrateChildren(getChildNodes$1(vnode.elm), vnode.children, vnode.owner);
|
|
5142
|
-
}
|
|
5143
|
-
}
|
|
5144
|
-
|
|
5145
|
-
function hydrateCustomElement(vnode, node) {
|
|
5146
|
-
|
|
5147
|
-
var elm = node;
|
|
5148
|
-
var sel = vnode.sel,
|
|
5149
|
-
mode = vnode.mode,
|
|
5150
|
-
ctor = vnode.ctor,
|
|
5151
|
-
owner = vnode.owner;
|
|
5152
|
-
var vm = createVM(elm, ctor, {
|
|
5153
|
-
mode: mode,
|
|
5154
|
-
owner: owner,
|
|
5155
|
-
tagName: sel
|
|
5156
|
-
});
|
|
5157
|
-
vnode.elm = elm;
|
|
5158
|
-
vnode.vm = vm;
|
|
5159
|
-
allocateChildren(vnode, vm);
|
|
5160
|
-
patchElementPropsAndAttrs(vnode); // Insert hook section:
|
|
5161
|
-
|
|
5162
|
-
runConnectedCallback(vm);
|
|
5163
|
-
|
|
5164
|
-
if (vm.renderMode !== 0
|
|
5165
|
-
/* Light */
|
|
5166
|
-
) {
|
|
5167
|
-
// VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
5168
|
-
// Note: for Light DOM, this is handled while hydrating the VM
|
|
5169
|
-
hydrateChildren(getChildNodes$1(vnode.elm), vnode.children);
|
|
5170
|
-
}
|
|
5171
|
-
|
|
5172
|
-
hydrateVM(vm);
|
|
5173
|
-
}
|
|
5174
|
-
|
|
5175
|
-
function hydrateChildren(elmChildren, children, vm) {
|
|
5176
|
-
|
|
5177
|
-
var childNodeIndex = 0;
|
|
5178
|
-
|
|
5179
|
-
for (var _i23 = 0; _i23 < children.length; _i23++) {
|
|
5180
|
-
var childVnode = children[_i23];
|
|
5181
|
-
|
|
5182
|
-
if (!isNull(childVnode)) {
|
|
5183
|
-
var childNode = elmChildren[childNodeIndex];
|
|
5184
|
-
hydrate(childVnode, childNode);
|
|
5185
|
-
childNodeIndex++;
|
|
5186
|
-
}
|
|
5187
|
-
}
|
|
5188
|
-
}
|
|
5189
|
-
|
|
5190
|
-
function patchElementPropsAndAttrs(vnode) {
|
|
5191
|
-
applyEventListeners(vnode);
|
|
5192
|
-
patchProps(null, vnode);
|
|
5193
|
-
}
|
|
5194
5131
|
/*
|
|
5195
5132
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
5196
5133
|
* All rights reserved.
|
|
@@ -5241,12 +5178,6 @@
|
|
|
5241
5178
|
, vm);
|
|
5242
5179
|
}
|
|
5243
5180
|
|
|
5244
|
-
function hydrateRootElement(elm) {
|
|
5245
|
-
var vm = getAssociatedVM(elm);
|
|
5246
|
-
runConnectedCallback(vm);
|
|
5247
|
-
hydrateVM(vm);
|
|
5248
|
-
}
|
|
5249
|
-
|
|
5250
5181
|
function disconnectRootElement(elm) {
|
|
5251
5182
|
var vm = getAssociatedVM(elm);
|
|
5252
5183
|
resetComponentStateWhenRemoved(vm);
|
|
@@ -5254,22 +5185,6 @@
|
|
|
5254
5185
|
|
|
5255
5186
|
function appendVM(vm) {
|
|
5256
5187
|
rehydrate(vm);
|
|
5257
|
-
}
|
|
5258
|
-
|
|
5259
|
-
function hydrateVM(vm) {
|
|
5260
|
-
if (isTrue(vm.isDirty)) {
|
|
5261
|
-
// manually diffing/patching here.
|
|
5262
|
-
// This routine is:
|
|
5263
|
-
// patchShadowRoot(vm, children);
|
|
5264
|
-
// -> addVnodes.
|
|
5265
|
-
var children = renderComponent(vm);
|
|
5266
|
-
vm.children = children;
|
|
5267
|
-
var vmChildren = vm.renderMode === 0
|
|
5268
|
-
/* Light */
|
|
5269
|
-
? getChildNodes$1(vm.elm) : getChildNodes$1(vm.elm.shadowRoot);
|
|
5270
|
-
hydrateChildren(vmChildren, children);
|
|
5271
|
-
runRenderedCallback(vm);
|
|
5272
|
-
}
|
|
5273
5188
|
} // just in case the component comes back, with this we guarantee re-rendering it
|
|
5274
5189
|
// while preventing any attempt to rehydration until after reinsertion.
|
|
5275
5190
|
|
|
@@ -5535,19 +5450,19 @@
|
|
|
5535
5450
|
});
|
|
5536
5451
|
rehydrateQueue = []; // reset to a new queue
|
|
5537
5452
|
|
|
5538
|
-
for (var
|
|
5539
|
-
var vm = vms[
|
|
5453
|
+
for (var _i23 = 0, _len8 = vms.length; _i23 < _len8; _i23 += 1) {
|
|
5454
|
+
var vm = vms[_i23];
|
|
5540
5455
|
|
|
5541
5456
|
try {
|
|
5542
5457
|
rehydrate(vm);
|
|
5543
5458
|
} catch (error) {
|
|
5544
|
-
if (
|
|
5459
|
+
if (_i23 + 1 < _len8) {
|
|
5545
5460
|
// pieces of the queue are still pending to be rehydrated, those should have priority
|
|
5546
5461
|
if (rehydrateQueue.length === 0) {
|
|
5547
5462
|
addCallbackToNextTick(flushRehydrationQueue);
|
|
5548
5463
|
}
|
|
5549
5464
|
|
|
5550
|
-
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms,
|
|
5465
|
+
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i23 + 1));
|
|
5551
5466
|
} // we need to end the measure before throwing.
|
|
5552
5467
|
|
|
5553
5468
|
|
|
@@ -5646,8 +5561,8 @@
|
|
|
5646
5561
|
var vCustomElementCollection = vm.velements; // Reporting disconnection for every child in inverse order since they are
|
|
5647
5562
|
// inserted in reserved order.
|
|
5648
5563
|
|
|
5649
|
-
for (var
|
|
5650
|
-
var elm = vCustomElementCollection[
|
|
5564
|
+
for (var _i24 = vCustomElementCollection.length - 1; _i24 >= 0; _i24 -= 1) {
|
|
5565
|
+
var elm = vCustomElementCollection[_i24].elm; // There are two cases where the element could be undefined:
|
|
5651
5566
|
// * when there is an error during the construction phase, and an error
|
|
5652
5567
|
// boundary picks it, there is a possibility that the VCustomElement
|
|
5653
5568
|
// is not properly initialized, and therefore is should be ignored.
|
|
@@ -5681,8 +5596,8 @@
|
|
|
5681
5596
|
|
|
5682
5597
|
|
|
5683
5598
|
function recursivelyDisconnectChildren(vnodes) {
|
|
5684
|
-
for (var
|
|
5685
|
-
var vnode = vnodes[
|
|
5599
|
+
for (var _i25 = 0, _len9 = vnodes.length; _i25 < _len9; _i25 += 1) {
|
|
5600
|
+
var vnode = vnodes[_i25];
|
|
5686
5601
|
|
|
5687
5602
|
if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
|
|
5688
5603
|
switch (vnode.type) {
|
|
@@ -5713,8 +5628,8 @@
|
|
|
5713
5628
|
var children = vm.children,
|
|
5714
5629
|
renderRoot = vm.renderRoot;
|
|
5715
5630
|
|
|
5716
|
-
for (var
|
|
5717
|
-
var child = children[
|
|
5631
|
+
for (var _i26 = 0, _len10 = children.length; _i26 < _len10; _i26++) {
|
|
5632
|
+
var child = children[_i26];
|
|
5718
5633
|
|
|
5719
5634
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
5720
5635
|
remove$1(child.elm, renderRoot);
|
|
@@ -6064,8 +5979,8 @@
|
|
|
6064
5979
|
function connectWireAdapters(vm) {
|
|
6065
5980
|
var wiredConnecting = vm.context.wiredConnecting;
|
|
6066
5981
|
|
|
6067
|
-
for (var
|
|
6068
|
-
wiredConnecting[
|
|
5982
|
+
for (var _i27 = 0, _len11 = wiredConnecting.length; _i27 < _len11; _i27 += 1) {
|
|
5983
|
+
wiredConnecting[_i27]();
|
|
6069
5984
|
}
|
|
6070
5985
|
}
|
|
6071
5986
|
|
|
@@ -6073,8 +5988,8 @@
|
|
|
6073
5988
|
var wiredDisconnecting = vm.context.wiredDisconnecting;
|
|
6074
5989
|
runWithBoundaryProtection(vm, vm, noop, function () {
|
|
6075
5990
|
// job
|
|
6076
|
-
for (var
|
|
6077
|
-
wiredDisconnecting[
|
|
5991
|
+
for (var _i28 = 0, _len12 = wiredDisconnecting.length; _i28 < _len12; _i28 += 1) {
|
|
5992
|
+
wiredDisconnecting[_i28]();
|
|
6078
5993
|
}
|
|
6079
5994
|
}, noop);
|
|
6080
5995
|
}
|
|
@@ -6144,6 +6059,327 @@
|
|
|
6144
6059
|
|
|
6145
6060
|
return reactiveMembrane.getReadOnlyProxy(obj);
|
|
6146
6061
|
}
|
|
6062
|
+
/*
|
|
6063
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
6064
|
+
* All rights reserved.
|
|
6065
|
+
* SPDX-License-Identifier: MIT
|
|
6066
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6067
|
+
*/
|
|
6068
|
+
// flag indicating if the hydration recovered from the DOM mismatch
|
|
6069
|
+
|
|
6070
|
+
|
|
6071
|
+
var hasMismatch = false;
|
|
6072
|
+
|
|
6073
|
+
function hydrateRoot(vm) {
|
|
6074
|
+
hasMismatch = false;
|
|
6075
|
+
runConnectedCallback(vm);
|
|
6076
|
+
hydrateVM(vm);
|
|
6077
|
+
|
|
6078
|
+
if (hasMismatch) {
|
|
6079
|
+
logError('Hydration completed with errors.', vm);
|
|
6080
|
+
}
|
|
6081
|
+
}
|
|
6082
|
+
|
|
6083
|
+
function hydrateVM(vm) {
|
|
6084
|
+
var children = renderComponent(vm);
|
|
6085
|
+
vm.children = children;
|
|
6086
|
+
var parentNode = vm.renderRoot;
|
|
6087
|
+
hydrateChildren(getFirstChild$1(parentNode), children, parentNode);
|
|
6088
|
+
runRenderedCallback(vm);
|
|
6089
|
+
}
|
|
6090
|
+
|
|
6091
|
+
function hydrateNode(node, vnode) {
|
|
6092
|
+
var hydratedNode;
|
|
6093
|
+
|
|
6094
|
+
switch (vnode.type) {
|
|
6095
|
+
case 0
|
|
6096
|
+
/* Text */
|
|
6097
|
+
:
|
|
6098
|
+
hydratedNode = hydrateText(node, vnode);
|
|
6099
|
+
break;
|
|
6100
|
+
|
|
6101
|
+
case 1
|
|
6102
|
+
/* Comment */
|
|
6103
|
+
:
|
|
6104
|
+
hydratedNode = hydrateComment(node, vnode);
|
|
6105
|
+
break;
|
|
6106
|
+
|
|
6107
|
+
case 2
|
|
6108
|
+
/* Element */
|
|
6109
|
+
:
|
|
6110
|
+
hydratedNode = hydrateElement(node, vnode);
|
|
6111
|
+
break;
|
|
6112
|
+
|
|
6113
|
+
case 3
|
|
6114
|
+
/* CustomElement */
|
|
6115
|
+
:
|
|
6116
|
+
hydratedNode = hydrateCustomElement(node, vnode);
|
|
6117
|
+
break;
|
|
6118
|
+
}
|
|
6119
|
+
|
|
6120
|
+
return nextSibling$1(hydratedNode);
|
|
6121
|
+
}
|
|
6122
|
+
|
|
6123
|
+
function hydrateText(node, vnode) {
|
|
6124
|
+
var _a;
|
|
6125
|
+
|
|
6126
|
+
if (!hasCorrectNodeType(vnode, node, 3
|
|
6127
|
+
/* TEXT */
|
|
6128
|
+
)) {
|
|
6129
|
+
return handleMismatch(node, vnode);
|
|
6130
|
+
}
|
|
6131
|
+
|
|
6132
|
+
setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
6133
|
+
vnode.elm = node;
|
|
6134
|
+
return node;
|
|
6135
|
+
}
|
|
6136
|
+
|
|
6137
|
+
function hydrateComment(node, vnode) {
|
|
6138
|
+
var _a;
|
|
6139
|
+
|
|
6140
|
+
if (!hasCorrectNodeType(vnode, node, 8
|
|
6141
|
+
/* COMMENT */
|
|
6142
|
+
)) {
|
|
6143
|
+
return handleMismatch(node, vnode);
|
|
6144
|
+
}
|
|
6145
|
+
|
|
6146
|
+
setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
6147
|
+
vnode.elm = node;
|
|
6148
|
+
return node;
|
|
6149
|
+
}
|
|
6150
|
+
|
|
6151
|
+
function hydrateElement(elm, vnode) {
|
|
6152
|
+
if (!hasCorrectNodeType(vnode, elm, 1
|
|
6153
|
+
/* ELEMENT */
|
|
6154
|
+
) || !isMatchingElement(vnode, elm)) {
|
|
6155
|
+
return handleMismatch(elm, vnode);
|
|
6156
|
+
}
|
|
6157
|
+
|
|
6158
|
+
vnode.elm = elm;
|
|
6159
|
+
var context = vnode.data.context;
|
|
6160
|
+
var isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual"
|
|
6161
|
+
/* Manual */
|
|
6162
|
+
);
|
|
6163
|
+
|
|
6164
|
+
if (isDomManual) {
|
|
6165
|
+
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
6166
|
+
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
6167
|
+
var props = vnode.data.props;
|
|
6168
|
+
|
|
6169
|
+
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
6170
|
+
if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
|
|
6171
|
+
// Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
|
|
6172
|
+
vnode.data = Object.assign(Object.assign({}, vnode.data), {
|
|
6173
|
+
props: cloneAndOmitKey(props, 'innerHTML')
|
|
6174
|
+
});
|
|
6175
|
+
}
|
|
6176
|
+
}
|
|
6177
|
+
}
|
|
6178
|
+
|
|
6179
|
+
patchElementPropsAndAttrs(vnode);
|
|
6180
|
+
|
|
6181
|
+
if (!isDomManual) {
|
|
6182
|
+
hydrateChildren(getFirstChild$1(elm), vnode.children, elm, vnode.owner);
|
|
6183
|
+
}
|
|
6184
|
+
|
|
6185
|
+
return elm;
|
|
6186
|
+
}
|
|
6187
|
+
|
|
6188
|
+
function hydrateCustomElement(elm, vnode) {
|
|
6189
|
+
if (!hasCorrectNodeType(vnode, elm, 1
|
|
6190
|
+
/* ELEMENT */
|
|
6191
|
+
) || !isMatchingElement(vnode, elm)) {
|
|
6192
|
+
return handleMismatch(elm, vnode);
|
|
6193
|
+
}
|
|
6194
|
+
|
|
6195
|
+
var sel = vnode.sel,
|
|
6196
|
+
mode = vnode.mode,
|
|
6197
|
+
ctor = vnode.ctor,
|
|
6198
|
+
owner = vnode.owner;
|
|
6199
|
+
var vm = createVM(elm, ctor, {
|
|
6200
|
+
mode: mode,
|
|
6201
|
+
owner: owner,
|
|
6202
|
+
tagName: sel
|
|
6203
|
+
});
|
|
6204
|
+
vnode.elm = elm;
|
|
6205
|
+
vnode.vm = vm;
|
|
6206
|
+
allocateChildren(vnode, vm);
|
|
6207
|
+
patchElementPropsAndAttrs(vnode); // Insert hook section:
|
|
6208
|
+
|
|
6209
|
+
runConnectedCallback(vm);
|
|
6210
|
+
|
|
6211
|
+
if (vm.renderMode !== 0
|
|
6212
|
+
/* Light */
|
|
6213
|
+
) {
|
|
6214
|
+
// VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
6215
|
+
// Note: for Light DOM, this is handled while hydrating the VM
|
|
6216
|
+
hydrateChildren(getFirstChild$1(elm), vnode.children, elm);
|
|
6217
|
+
}
|
|
6218
|
+
|
|
6219
|
+
hydrateVM(vm);
|
|
6220
|
+
return elm;
|
|
6221
|
+
}
|
|
6222
|
+
|
|
6223
|
+
function hydrateChildren(node, children, parentNode, owner) {
|
|
6224
|
+
var nextNode = node;
|
|
6225
|
+
var anchor = null;
|
|
6226
|
+
|
|
6227
|
+
for (var _i29 = 0; _i29 < children.length; _i29++) {
|
|
6228
|
+
var childVnode = children[_i29];
|
|
6229
|
+
|
|
6230
|
+
if (!isNull(childVnode)) {
|
|
6231
|
+
if (nextNode) {
|
|
6232
|
+
nextNode = hydrateNode(nextNode, childVnode);
|
|
6233
|
+
anchor = childVnode.elm;
|
|
6234
|
+
} else {
|
|
6235
|
+
hasMismatch = true;
|
|
6236
|
+
|
|
6237
|
+
mount(childVnode, parentNode, anchor);
|
|
6238
|
+
anchor = childVnode.elm;
|
|
6239
|
+
}
|
|
6240
|
+
}
|
|
6241
|
+
}
|
|
6242
|
+
|
|
6243
|
+
if (nextNode) {
|
|
6244
|
+
hasMismatch = true;
|
|
6245
|
+
|
|
6246
|
+
do {
|
|
6247
|
+
var current = nextNode;
|
|
6248
|
+
nextNode = nextSibling$1(nextNode);
|
|
6249
|
+
removeNode(current, parentNode);
|
|
6250
|
+
} while (nextNode);
|
|
6251
|
+
}
|
|
6252
|
+
}
|
|
6253
|
+
|
|
6254
|
+
function handleMismatch(node, vnode, msg) {
|
|
6255
|
+
hasMismatch = true;
|
|
6256
|
+
|
|
6257
|
+
var parentNode = getProperty$1(node, 'parentNode');
|
|
6258
|
+
mount(vnode, parentNode, node);
|
|
6259
|
+
removeNode(node, parentNode);
|
|
6260
|
+
return vnode.elm;
|
|
6261
|
+
}
|
|
6262
|
+
|
|
6263
|
+
function patchElementPropsAndAttrs(vnode) {
|
|
6264
|
+
applyEventListeners(vnode);
|
|
6265
|
+
patchProps(null, vnode);
|
|
6266
|
+
}
|
|
6267
|
+
|
|
6268
|
+
function hasCorrectNodeType(vnode, node, nodeType) {
|
|
6269
|
+
if (getProperty$1(node, 'nodeType') !== nodeType) {
|
|
6270
|
+
|
|
6271
|
+
return false;
|
|
6272
|
+
}
|
|
6273
|
+
|
|
6274
|
+
return true;
|
|
6275
|
+
}
|
|
6276
|
+
|
|
6277
|
+
function isMatchingElement(vnode, elm) {
|
|
6278
|
+
if (vnode.sel.toLowerCase() !== getProperty$1(elm, 'tagName').toLowerCase()) {
|
|
6279
|
+
|
|
6280
|
+
return false;
|
|
6281
|
+
}
|
|
6282
|
+
|
|
6283
|
+
var hasIncompatibleAttrs = validateAttrs(vnode, elm);
|
|
6284
|
+
var hasIncompatibleClass = validateClassAttr(vnode, elm);
|
|
6285
|
+
var hasIncompatibleStyle = validateStyleAttr(vnode, elm);
|
|
6286
|
+
return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
|
|
6287
|
+
}
|
|
6288
|
+
|
|
6289
|
+
function validateAttrs(vnode, elm) {
|
|
6290
|
+
var _vnode$data$attrs = vnode.data.attrs,
|
|
6291
|
+
attrs = _vnode$data$attrs === void 0 ? {} : _vnode$data$attrs;
|
|
6292
|
+
var nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
|
|
6293
|
+
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
6294
|
+
|
|
6295
|
+
for (var _i30 = 0, _Object$entries = Object.entries(attrs); _i30 < _Object$entries.length; _i30++) {
|
|
6296
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i30], 2),
|
|
6297
|
+
attrName = _Object$entries$_i[0],
|
|
6298
|
+
attrValue = _Object$entries$_i[1];
|
|
6299
|
+
|
|
6300
|
+
var elmAttrValue = getAttribute$1(elm, attrName);
|
|
6301
|
+
|
|
6302
|
+
if (String(attrValue) !== elmAttrValue) {
|
|
6303
|
+
|
|
6304
|
+
nodesAreCompatible = false;
|
|
6305
|
+
}
|
|
6306
|
+
}
|
|
6307
|
+
|
|
6308
|
+
return nodesAreCompatible;
|
|
6309
|
+
}
|
|
6310
|
+
|
|
6311
|
+
function validateClassAttr(vnode, elm) {
|
|
6312
|
+
var _vnode$data = vnode.data,
|
|
6313
|
+
className = _vnode$data.className,
|
|
6314
|
+
classMap = _vnode$data.classMap;
|
|
6315
|
+
var nodesAreCompatible = true;
|
|
6316
|
+
|
|
6317
|
+
if (!isUndefined$1(className) && String(className) !== getProperty$1(elm, 'className')) {
|
|
6318
|
+
// className is used when class is bound to an expr.
|
|
6319
|
+
nodesAreCompatible = false;
|
|
6320
|
+
} else if (!isUndefined$1(classMap)) {
|
|
6321
|
+
// classMap is used when class is set to static value.
|
|
6322
|
+
var classList = getClassList$1(elm);
|
|
6323
|
+
var computedClassName = ''; // all classes from the vnode should be in the element.classList
|
|
6324
|
+
|
|
6325
|
+
for (var name in classMap) {
|
|
6326
|
+
computedClassName += ' ' + name;
|
|
6327
|
+
|
|
6328
|
+
if (!classList.contains(name)) {
|
|
6329
|
+
nodesAreCompatible = false;
|
|
6330
|
+
}
|
|
6331
|
+
}
|
|
6332
|
+
|
|
6333
|
+
computedClassName.trim();
|
|
6334
|
+
|
|
6335
|
+
if (classList.length > keys(classMap).length) {
|
|
6336
|
+
nodesAreCompatible = false;
|
|
6337
|
+
}
|
|
6338
|
+
}
|
|
6339
|
+
|
|
6340
|
+
return nodesAreCompatible;
|
|
6341
|
+
}
|
|
6342
|
+
|
|
6343
|
+
function validateStyleAttr(vnode, elm) {
|
|
6344
|
+
var _vnode$data2 = vnode.data,
|
|
6345
|
+
style = _vnode$data2.style,
|
|
6346
|
+
styleDecls = _vnode$data2.styleDecls;
|
|
6347
|
+
var elmStyle = getAttribute$1(elm, 'style') || '';
|
|
6348
|
+
var nodesAreCompatible = true;
|
|
6349
|
+
|
|
6350
|
+
if (!isUndefined$1(style) && style !== elmStyle) {
|
|
6351
|
+
nodesAreCompatible = false;
|
|
6352
|
+
} else if (!isUndefined$1(styleDecls)) {
|
|
6353
|
+
var parsedVnodeStyle = parseStyleText(elmStyle);
|
|
6354
|
+
var expectedStyle = []; // styleMap is used when style is set to static value.
|
|
6355
|
+
|
|
6356
|
+
for (var _i31 = 0, n = styleDecls.length; _i31 < n; _i31++) {
|
|
6357
|
+
var _styleDecls$_i2 = _slicedToArray(styleDecls[_i31], 3),
|
|
6358
|
+
prop = _styleDecls$_i2[0],
|
|
6359
|
+
value = _styleDecls$_i2[1],
|
|
6360
|
+
important = _styleDecls$_i2[2];
|
|
6361
|
+
|
|
6362
|
+
expectedStyle.push("".concat(prop, ": ").concat(value + (important ? ' important!' : '')));
|
|
6363
|
+
var parsedPropValue = parsedVnodeStyle[prop];
|
|
6364
|
+
|
|
6365
|
+
if (isUndefined$1(parsedPropValue)) {
|
|
6366
|
+
nodesAreCompatible = false;
|
|
6367
|
+
} else if (!parsedPropValue.startsWith(value)) {
|
|
6368
|
+
nodesAreCompatible = false;
|
|
6369
|
+
} else if (important && !parsedPropValue.endsWith('!important')) {
|
|
6370
|
+
nodesAreCompatible = false;
|
|
6371
|
+
}
|
|
6372
|
+
}
|
|
6373
|
+
|
|
6374
|
+
if (keys(parsedVnodeStyle).length > styleDecls.length) {
|
|
6375
|
+
nodesAreCompatible = false;
|
|
6376
|
+
}
|
|
6377
|
+
|
|
6378
|
+
ArrayJoin.call(expectedStyle, ';');
|
|
6379
|
+
}
|
|
6380
|
+
|
|
6381
|
+
return nodesAreCompatible;
|
|
6382
|
+
}
|
|
6147
6383
|
/*
|
|
6148
6384
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
6149
6385
|
* All rights reserved.
|
|
@@ -6159,7 +6395,7 @@
|
|
|
6159
6395
|
hooksAreSet = true;
|
|
6160
6396
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
6161
6397
|
}
|
|
6162
|
-
/* version: 2.11.
|
|
6398
|
+
/* version: 2.11.5 */
|
|
6163
6399
|
|
|
6164
6400
|
/*
|
|
6165
6401
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6546,7 +6782,7 @@
|
|
|
6546
6782
|
}
|
|
6547
6783
|
|
|
6548
6784
|
function createVMWithProps(element, Ctor, props) {
|
|
6549
|
-
createVM(element, Ctor, {
|
|
6785
|
+
var vm = createVM(element, Ctor, {
|
|
6550
6786
|
mode: 'open',
|
|
6551
6787
|
owner: null,
|
|
6552
6788
|
tagName: element.tagName.toLowerCase()
|
|
@@ -6559,6 +6795,8 @@
|
|
|
6559
6795
|
|
|
6560
6796
|
element[key] = value;
|
|
6561
6797
|
}
|
|
6798
|
+
|
|
6799
|
+
return vm;
|
|
6562
6800
|
}
|
|
6563
6801
|
|
|
6564
6802
|
function hydrateComponent(element, Ctor) {
|
|
@@ -6586,8 +6824,8 @@
|
|
|
6586
6824
|
// Let the renderer know we are hydrating, so it does not replace the existing shadowRoot
|
|
6587
6825
|
// and uses the same algo to create the stylesheets as in SSR.
|
|
6588
6826
|
setIsHydrating(true);
|
|
6589
|
-
createVMWithProps(element, Ctor, props);
|
|
6590
|
-
|
|
6827
|
+
var vm = createVMWithProps(element, Ctor, props);
|
|
6828
|
+
hydrateRoot(vm); // set it back since now we finished hydration.
|
|
6591
6829
|
|
|
6592
6830
|
setIsHydrating(false);
|
|
6593
6831
|
} catch (e) {
|
|
@@ -6902,7 +7140,7 @@
|
|
|
6902
7140
|
});
|
|
6903
7141
|
freeze(LightningElement);
|
|
6904
7142
|
seal(LightningElement.prototype);
|
|
6905
|
-
/* version: 2.11.
|
|
7143
|
+
/* version: 2.11.5 */
|
|
6906
7144
|
|
|
6907
7145
|
exports.LightningElement = LightningElement;
|
|
6908
7146
|
exports.__unstable__ProfilerControl = profilerControl;
|