lwc 2.11.1 → 2.12.1
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 +301 -259
- package/dist/engine-dom/iife/es2017/engine-dom.js +301 -259
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +258 -124
- package/dist/engine-dom/iife/es5/engine-dom.js +1094 -1041
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +384 -179
- package/dist/engine-dom/umd/es2017/engine-dom.js +301 -259
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +258 -124
- package/dist/engine-dom/umd/es5/engine-dom.js +1094 -1041
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +384 -179
- package/dist/engine-server/commonjs/es2017/engine-server.js +6 -7
- package/dist/engine-server/esm/es2017/engine-server.js +6 -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 +10 -10
|
@@ -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.
|
|
353
|
+
/** version: 2.12.1 */
|
|
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.
|
|
523
|
+
/** version: 2.12.1 */
|
|
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.
|
|
@@ -5057,140 +5095,6 @@
|
|
|
5057
5095
|
cbs[_i22].call(undefined, component, {}, def, context);
|
|
5058
5096
|
}
|
|
5059
5097
|
}
|
|
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
5098
|
/*
|
|
5195
5099
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
5196
5100
|
* All rights reserved.
|
|
@@ -5241,12 +5145,6 @@
|
|
|
5241
5145
|
, vm);
|
|
5242
5146
|
}
|
|
5243
5147
|
|
|
5244
|
-
function hydrateRootElement(elm) {
|
|
5245
|
-
var vm = getAssociatedVM(elm);
|
|
5246
|
-
runConnectedCallback(vm);
|
|
5247
|
-
hydrateVM(vm);
|
|
5248
|
-
}
|
|
5249
|
-
|
|
5250
5148
|
function disconnectRootElement(elm) {
|
|
5251
5149
|
var vm = getAssociatedVM(elm);
|
|
5252
5150
|
resetComponentStateWhenRemoved(vm);
|
|
@@ -5254,22 +5152,6 @@
|
|
|
5254
5152
|
|
|
5255
5153
|
function appendVM(vm) {
|
|
5256
5154
|
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
5155
|
} // just in case the component comes back, with this we guarantee re-rendering it
|
|
5274
5156
|
// while preventing any attempt to rehydration until after reinsertion.
|
|
5275
5157
|
|
|
@@ -5535,19 +5417,19 @@
|
|
|
5535
5417
|
});
|
|
5536
5418
|
rehydrateQueue = []; // reset to a new queue
|
|
5537
5419
|
|
|
5538
|
-
for (var
|
|
5539
|
-
var vm = vms[
|
|
5420
|
+
for (var _i23 = 0, _len8 = vms.length; _i23 < _len8; _i23 += 1) {
|
|
5421
|
+
var vm = vms[_i23];
|
|
5540
5422
|
|
|
5541
5423
|
try {
|
|
5542
5424
|
rehydrate(vm);
|
|
5543
5425
|
} catch (error) {
|
|
5544
|
-
if (
|
|
5426
|
+
if (_i23 + 1 < _len8) {
|
|
5545
5427
|
// pieces of the queue are still pending to be rehydrated, those should have priority
|
|
5546
5428
|
if (rehydrateQueue.length === 0) {
|
|
5547
5429
|
addCallbackToNextTick(flushRehydrationQueue);
|
|
5548
5430
|
}
|
|
5549
5431
|
|
|
5550
|
-
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms,
|
|
5432
|
+
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i23 + 1));
|
|
5551
5433
|
} // we need to end the measure before throwing.
|
|
5552
5434
|
|
|
5553
5435
|
|
|
@@ -5646,8 +5528,8 @@
|
|
|
5646
5528
|
var vCustomElementCollection = vm.velements; // Reporting disconnection for every child in inverse order since they are
|
|
5647
5529
|
// inserted in reserved order.
|
|
5648
5530
|
|
|
5649
|
-
for (var
|
|
5650
|
-
var elm = vCustomElementCollection[
|
|
5531
|
+
for (var _i24 = vCustomElementCollection.length - 1; _i24 >= 0; _i24 -= 1) {
|
|
5532
|
+
var elm = vCustomElementCollection[_i24].elm; // There are two cases where the element could be undefined:
|
|
5651
5533
|
// * when there is an error during the construction phase, and an error
|
|
5652
5534
|
// boundary picks it, there is a possibility that the VCustomElement
|
|
5653
5535
|
// is not properly initialized, and therefore is should be ignored.
|
|
@@ -5681,8 +5563,8 @@
|
|
|
5681
5563
|
|
|
5682
5564
|
|
|
5683
5565
|
function recursivelyDisconnectChildren(vnodes) {
|
|
5684
|
-
for (var
|
|
5685
|
-
var vnode = vnodes[
|
|
5566
|
+
for (var _i25 = 0, _len9 = vnodes.length; _i25 < _len9; _i25 += 1) {
|
|
5567
|
+
var vnode = vnodes[_i25];
|
|
5686
5568
|
|
|
5687
5569
|
if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
|
|
5688
5570
|
switch (vnode.type) {
|
|
@@ -5713,8 +5595,8 @@
|
|
|
5713
5595
|
var children = vm.children,
|
|
5714
5596
|
renderRoot = vm.renderRoot;
|
|
5715
5597
|
|
|
5716
|
-
for (var
|
|
5717
|
-
var child = children[
|
|
5598
|
+
for (var _i26 = 0, _len10 = children.length; _i26 < _len10; _i26++) {
|
|
5599
|
+
var child = children[_i26];
|
|
5718
5600
|
|
|
5719
5601
|
if (!isNull(child) && !isUndefined$1(child.elm)) {
|
|
5720
5602
|
remove$1(child.elm, renderRoot);
|
|
@@ -6064,8 +5946,8 @@
|
|
|
6064
5946
|
function connectWireAdapters(vm) {
|
|
6065
5947
|
var wiredConnecting = vm.context.wiredConnecting;
|
|
6066
5948
|
|
|
6067
|
-
for (var
|
|
6068
|
-
wiredConnecting[
|
|
5949
|
+
for (var _i27 = 0, _len11 = wiredConnecting.length; _i27 < _len11; _i27 += 1) {
|
|
5950
|
+
wiredConnecting[_i27]();
|
|
6069
5951
|
}
|
|
6070
5952
|
}
|
|
6071
5953
|
|
|
@@ -6073,8 +5955,8 @@
|
|
|
6073
5955
|
var wiredDisconnecting = vm.context.wiredDisconnecting;
|
|
6074
5956
|
runWithBoundaryProtection(vm, vm, noop, function () {
|
|
6075
5957
|
// job
|
|
6076
|
-
for (var
|
|
6077
|
-
wiredDisconnecting[
|
|
5958
|
+
for (var _i28 = 0, _len12 = wiredDisconnecting.length; _i28 < _len12; _i28 += 1) {
|
|
5959
|
+
wiredDisconnecting[_i28]();
|
|
6078
5960
|
}
|
|
6079
5961
|
}, noop);
|
|
6080
5962
|
}
|
|
@@ -6144,6 +6026,327 @@
|
|
|
6144
6026
|
|
|
6145
6027
|
return reactiveMembrane.getReadOnlyProxy(obj);
|
|
6146
6028
|
}
|
|
6029
|
+
/*
|
|
6030
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
6031
|
+
* All rights reserved.
|
|
6032
|
+
* SPDX-License-Identifier: MIT
|
|
6033
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6034
|
+
*/
|
|
6035
|
+
// flag indicating if the hydration recovered from the DOM mismatch
|
|
6036
|
+
|
|
6037
|
+
|
|
6038
|
+
var hasMismatch = false;
|
|
6039
|
+
|
|
6040
|
+
function hydrateRoot(vm) {
|
|
6041
|
+
hasMismatch = false;
|
|
6042
|
+
runConnectedCallback(vm);
|
|
6043
|
+
hydrateVM(vm);
|
|
6044
|
+
|
|
6045
|
+
if (hasMismatch) {
|
|
6046
|
+
logError('Hydration completed with errors.', vm);
|
|
6047
|
+
}
|
|
6048
|
+
}
|
|
6049
|
+
|
|
6050
|
+
function hydrateVM(vm) {
|
|
6051
|
+
var children = renderComponent(vm);
|
|
6052
|
+
vm.children = children;
|
|
6053
|
+
var parentNode = vm.renderRoot;
|
|
6054
|
+
hydrateChildren(getFirstChild$1(parentNode), children, parentNode);
|
|
6055
|
+
runRenderedCallback(vm);
|
|
6056
|
+
}
|
|
6057
|
+
|
|
6058
|
+
function hydrateNode(node, vnode) {
|
|
6059
|
+
var hydratedNode;
|
|
6060
|
+
|
|
6061
|
+
switch (vnode.type) {
|
|
6062
|
+
case 0
|
|
6063
|
+
/* Text */
|
|
6064
|
+
:
|
|
6065
|
+
hydratedNode = hydrateText(node, vnode);
|
|
6066
|
+
break;
|
|
6067
|
+
|
|
6068
|
+
case 1
|
|
6069
|
+
/* Comment */
|
|
6070
|
+
:
|
|
6071
|
+
hydratedNode = hydrateComment(node, vnode);
|
|
6072
|
+
break;
|
|
6073
|
+
|
|
6074
|
+
case 2
|
|
6075
|
+
/* Element */
|
|
6076
|
+
:
|
|
6077
|
+
hydratedNode = hydrateElement(node, vnode);
|
|
6078
|
+
break;
|
|
6079
|
+
|
|
6080
|
+
case 3
|
|
6081
|
+
/* CustomElement */
|
|
6082
|
+
:
|
|
6083
|
+
hydratedNode = hydrateCustomElement(node, vnode);
|
|
6084
|
+
break;
|
|
6085
|
+
}
|
|
6086
|
+
|
|
6087
|
+
return nextSibling$1(hydratedNode);
|
|
6088
|
+
}
|
|
6089
|
+
|
|
6090
|
+
function hydrateText(node, vnode) {
|
|
6091
|
+
var _a;
|
|
6092
|
+
|
|
6093
|
+
if (!hasCorrectNodeType(vnode, node, 3
|
|
6094
|
+
/* TEXT */
|
|
6095
|
+
)) {
|
|
6096
|
+
return handleMismatch(node, vnode);
|
|
6097
|
+
}
|
|
6098
|
+
|
|
6099
|
+
setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
6100
|
+
vnode.elm = node;
|
|
6101
|
+
return node;
|
|
6102
|
+
}
|
|
6103
|
+
|
|
6104
|
+
function hydrateComment(node, vnode) {
|
|
6105
|
+
var _a;
|
|
6106
|
+
|
|
6107
|
+
if (!hasCorrectNodeType(vnode, node, 8
|
|
6108
|
+
/* COMMENT */
|
|
6109
|
+
)) {
|
|
6110
|
+
return handleMismatch(node, vnode);
|
|
6111
|
+
}
|
|
6112
|
+
|
|
6113
|
+
setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
6114
|
+
vnode.elm = node;
|
|
6115
|
+
return node;
|
|
6116
|
+
}
|
|
6117
|
+
|
|
6118
|
+
function hydrateElement(elm, vnode) {
|
|
6119
|
+
if (!hasCorrectNodeType(vnode, elm, 1
|
|
6120
|
+
/* ELEMENT */
|
|
6121
|
+
) || !isMatchingElement(vnode, elm)) {
|
|
6122
|
+
return handleMismatch(elm, vnode);
|
|
6123
|
+
}
|
|
6124
|
+
|
|
6125
|
+
vnode.elm = elm;
|
|
6126
|
+
var context = vnode.data.context;
|
|
6127
|
+
var isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual"
|
|
6128
|
+
/* Manual */
|
|
6129
|
+
);
|
|
6130
|
+
|
|
6131
|
+
if (isDomManual) {
|
|
6132
|
+
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
6133
|
+
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
6134
|
+
var props = vnode.data.props;
|
|
6135
|
+
|
|
6136
|
+
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
6137
|
+
if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
|
|
6138
|
+
// Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
|
|
6139
|
+
vnode.data = Object.assign(Object.assign({}, vnode.data), {
|
|
6140
|
+
props: cloneAndOmitKey(props, 'innerHTML')
|
|
6141
|
+
});
|
|
6142
|
+
}
|
|
6143
|
+
}
|
|
6144
|
+
}
|
|
6145
|
+
|
|
6146
|
+
patchElementPropsAndAttrs(vnode);
|
|
6147
|
+
|
|
6148
|
+
if (!isDomManual) {
|
|
6149
|
+
hydrateChildren(getFirstChild$1(elm), vnode.children, elm, vnode.owner);
|
|
6150
|
+
}
|
|
6151
|
+
|
|
6152
|
+
return elm;
|
|
6153
|
+
}
|
|
6154
|
+
|
|
6155
|
+
function hydrateCustomElement(elm, vnode) {
|
|
6156
|
+
if (!hasCorrectNodeType(vnode, elm, 1
|
|
6157
|
+
/* ELEMENT */
|
|
6158
|
+
) || !isMatchingElement(vnode, elm)) {
|
|
6159
|
+
return handleMismatch(elm, vnode);
|
|
6160
|
+
}
|
|
6161
|
+
|
|
6162
|
+
var sel = vnode.sel,
|
|
6163
|
+
mode = vnode.mode,
|
|
6164
|
+
ctor = vnode.ctor,
|
|
6165
|
+
owner = vnode.owner;
|
|
6166
|
+
var vm = createVM(elm, ctor, {
|
|
6167
|
+
mode: mode,
|
|
6168
|
+
owner: owner,
|
|
6169
|
+
tagName: sel
|
|
6170
|
+
});
|
|
6171
|
+
vnode.elm = elm;
|
|
6172
|
+
vnode.vm = vm;
|
|
6173
|
+
allocateChildren(vnode, vm);
|
|
6174
|
+
patchElementPropsAndAttrs(vnode); // Insert hook section:
|
|
6175
|
+
|
|
6176
|
+
runConnectedCallback(vm);
|
|
6177
|
+
|
|
6178
|
+
if (vm.renderMode !== 0
|
|
6179
|
+
/* Light */
|
|
6180
|
+
) {
|
|
6181
|
+
// VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
6182
|
+
// Note: for Light DOM, this is handled while hydrating the VM
|
|
6183
|
+
hydrateChildren(getFirstChild$1(elm), vnode.children, elm);
|
|
6184
|
+
}
|
|
6185
|
+
|
|
6186
|
+
hydrateVM(vm);
|
|
6187
|
+
return elm;
|
|
6188
|
+
}
|
|
6189
|
+
|
|
6190
|
+
function hydrateChildren(node, children, parentNode, owner) {
|
|
6191
|
+
var nextNode = node;
|
|
6192
|
+
var anchor = null;
|
|
6193
|
+
|
|
6194
|
+
for (var _i29 = 0; _i29 < children.length; _i29++) {
|
|
6195
|
+
var childVnode = children[_i29];
|
|
6196
|
+
|
|
6197
|
+
if (!isNull(childVnode)) {
|
|
6198
|
+
if (nextNode) {
|
|
6199
|
+
nextNode = hydrateNode(nextNode, childVnode);
|
|
6200
|
+
anchor = childVnode.elm;
|
|
6201
|
+
} else {
|
|
6202
|
+
hasMismatch = true;
|
|
6203
|
+
|
|
6204
|
+
mount(childVnode, parentNode, anchor);
|
|
6205
|
+
anchor = childVnode.elm;
|
|
6206
|
+
}
|
|
6207
|
+
}
|
|
6208
|
+
}
|
|
6209
|
+
|
|
6210
|
+
if (nextNode) {
|
|
6211
|
+
hasMismatch = true;
|
|
6212
|
+
|
|
6213
|
+
do {
|
|
6214
|
+
var current = nextNode;
|
|
6215
|
+
nextNode = nextSibling$1(nextNode);
|
|
6216
|
+
removeNode(current, parentNode);
|
|
6217
|
+
} while (nextNode);
|
|
6218
|
+
}
|
|
6219
|
+
}
|
|
6220
|
+
|
|
6221
|
+
function handleMismatch(node, vnode, msg) {
|
|
6222
|
+
hasMismatch = true;
|
|
6223
|
+
|
|
6224
|
+
var parentNode = getProperty$1(node, 'parentNode');
|
|
6225
|
+
mount(vnode, parentNode, node);
|
|
6226
|
+
removeNode(node, parentNode);
|
|
6227
|
+
return vnode.elm;
|
|
6228
|
+
}
|
|
6229
|
+
|
|
6230
|
+
function patchElementPropsAndAttrs(vnode) {
|
|
6231
|
+
applyEventListeners(vnode);
|
|
6232
|
+
patchProps(null, vnode);
|
|
6233
|
+
}
|
|
6234
|
+
|
|
6235
|
+
function hasCorrectNodeType(vnode, node, nodeType) {
|
|
6236
|
+
if (getProperty$1(node, 'nodeType') !== nodeType) {
|
|
6237
|
+
|
|
6238
|
+
return false;
|
|
6239
|
+
}
|
|
6240
|
+
|
|
6241
|
+
return true;
|
|
6242
|
+
}
|
|
6243
|
+
|
|
6244
|
+
function isMatchingElement(vnode, elm) {
|
|
6245
|
+
if (vnode.sel.toLowerCase() !== getProperty$1(elm, 'tagName').toLowerCase()) {
|
|
6246
|
+
|
|
6247
|
+
return false;
|
|
6248
|
+
}
|
|
6249
|
+
|
|
6250
|
+
var hasIncompatibleAttrs = validateAttrs(vnode, elm);
|
|
6251
|
+
var hasIncompatibleClass = validateClassAttr(vnode, elm);
|
|
6252
|
+
var hasIncompatibleStyle = validateStyleAttr(vnode, elm);
|
|
6253
|
+
return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
|
|
6254
|
+
}
|
|
6255
|
+
|
|
6256
|
+
function validateAttrs(vnode, elm) {
|
|
6257
|
+
var _vnode$data$attrs = vnode.data.attrs,
|
|
6258
|
+
attrs = _vnode$data$attrs === void 0 ? {} : _vnode$data$attrs;
|
|
6259
|
+
var nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
|
|
6260
|
+
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
6261
|
+
|
|
6262
|
+
for (var _i30 = 0, _Object$entries = Object.entries(attrs); _i30 < _Object$entries.length; _i30++) {
|
|
6263
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i30], 2),
|
|
6264
|
+
attrName = _Object$entries$_i[0],
|
|
6265
|
+
attrValue = _Object$entries$_i[1];
|
|
6266
|
+
|
|
6267
|
+
var elmAttrValue = getAttribute$1(elm, attrName);
|
|
6268
|
+
|
|
6269
|
+
if (String(attrValue) !== elmAttrValue) {
|
|
6270
|
+
|
|
6271
|
+
nodesAreCompatible = false;
|
|
6272
|
+
}
|
|
6273
|
+
}
|
|
6274
|
+
|
|
6275
|
+
return nodesAreCompatible;
|
|
6276
|
+
}
|
|
6277
|
+
|
|
6278
|
+
function validateClassAttr(vnode, elm) {
|
|
6279
|
+
var _vnode$data = vnode.data,
|
|
6280
|
+
className = _vnode$data.className,
|
|
6281
|
+
classMap = _vnode$data.classMap;
|
|
6282
|
+
var nodesAreCompatible = true;
|
|
6283
|
+
|
|
6284
|
+
if (!isUndefined$1(className) && String(className) !== getProperty$1(elm, 'className')) {
|
|
6285
|
+
// className is used when class is bound to an expr.
|
|
6286
|
+
nodesAreCompatible = false;
|
|
6287
|
+
} else if (!isUndefined$1(classMap)) {
|
|
6288
|
+
// classMap is used when class is set to static value.
|
|
6289
|
+
var classList = getClassList$1(elm);
|
|
6290
|
+
var computedClassName = ''; // all classes from the vnode should be in the element.classList
|
|
6291
|
+
|
|
6292
|
+
for (var name in classMap) {
|
|
6293
|
+
computedClassName += ' ' + name;
|
|
6294
|
+
|
|
6295
|
+
if (!classList.contains(name)) {
|
|
6296
|
+
nodesAreCompatible = false;
|
|
6297
|
+
}
|
|
6298
|
+
}
|
|
6299
|
+
|
|
6300
|
+
computedClassName.trim();
|
|
6301
|
+
|
|
6302
|
+
if (classList.length > keys(classMap).length) {
|
|
6303
|
+
nodesAreCompatible = false;
|
|
6304
|
+
}
|
|
6305
|
+
}
|
|
6306
|
+
|
|
6307
|
+
return nodesAreCompatible;
|
|
6308
|
+
}
|
|
6309
|
+
|
|
6310
|
+
function validateStyleAttr(vnode, elm) {
|
|
6311
|
+
var _vnode$data2 = vnode.data,
|
|
6312
|
+
style = _vnode$data2.style,
|
|
6313
|
+
styleDecls = _vnode$data2.styleDecls;
|
|
6314
|
+
var elmStyle = getAttribute$1(elm, 'style') || '';
|
|
6315
|
+
var nodesAreCompatible = true;
|
|
6316
|
+
|
|
6317
|
+
if (!isUndefined$1(style) && style !== elmStyle) {
|
|
6318
|
+
nodesAreCompatible = false;
|
|
6319
|
+
} else if (!isUndefined$1(styleDecls)) {
|
|
6320
|
+
var parsedVnodeStyle = parseStyleText(elmStyle);
|
|
6321
|
+
var expectedStyle = []; // styleMap is used when style is set to static value.
|
|
6322
|
+
|
|
6323
|
+
for (var _i31 = 0, n = styleDecls.length; _i31 < n; _i31++) {
|
|
6324
|
+
var _styleDecls$_i2 = _slicedToArray(styleDecls[_i31], 3),
|
|
6325
|
+
prop = _styleDecls$_i2[0],
|
|
6326
|
+
value = _styleDecls$_i2[1],
|
|
6327
|
+
important = _styleDecls$_i2[2];
|
|
6328
|
+
|
|
6329
|
+
expectedStyle.push("".concat(prop, ": ").concat(value + (important ? ' important!' : '')));
|
|
6330
|
+
var parsedPropValue = parsedVnodeStyle[prop];
|
|
6331
|
+
|
|
6332
|
+
if (isUndefined$1(parsedPropValue)) {
|
|
6333
|
+
nodesAreCompatible = false;
|
|
6334
|
+
} else if (!parsedPropValue.startsWith(value)) {
|
|
6335
|
+
nodesAreCompatible = false;
|
|
6336
|
+
} else if (important && !parsedPropValue.endsWith('!important')) {
|
|
6337
|
+
nodesAreCompatible = false;
|
|
6338
|
+
}
|
|
6339
|
+
}
|
|
6340
|
+
|
|
6341
|
+
if (keys(parsedVnodeStyle).length > styleDecls.length) {
|
|
6342
|
+
nodesAreCompatible = false;
|
|
6343
|
+
}
|
|
6344
|
+
|
|
6345
|
+
ArrayJoin.call(expectedStyle, ';');
|
|
6346
|
+
}
|
|
6347
|
+
|
|
6348
|
+
return nodesAreCompatible;
|
|
6349
|
+
}
|
|
6147
6350
|
/*
|
|
6148
6351
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
6149
6352
|
* All rights reserved.
|
|
@@ -6159,7 +6362,7 @@
|
|
|
6159
6362
|
hooksAreSet = true;
|
|
6160
6363
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
6161
6364
|
}
|
|
6162
|
-
/* version: 2.
|
|
6365
|
+
/* version: 2.12.1 */
|
|
6163
6366
|
|
|
6164
6367
|
/*
|
|
6165
6368
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6546,7 +6749,7 @@
|
|
|
6546
6749
|
}
|
|
6547
6750
|
|
|
6548
6751
|
function createVMWithProps(element, Ctor, props) {
|
|
6549
|
-
createVM(element, Ctor, {
|
|
6752
|
+
var vm = createVM(element, Ctor, {
|
|
6550
6753
|
mode: 'open',
|
|
6551
6754
|
owner: null,
|
|
6552
6755
|
tagName: element.tagName.toLowerCase()
|
|
@@ -6559,6 +6762,8 @@
|
|
|
6559
6762
|
|
|
6560
6763
|
element[key] = value;
|
|
6561
6764
|
}
|
|
6765
|
+
|
|
6766
|
+
return vm;
|
|
6562
6767
|
}
|
|
6563
6768
|
|
|
6564
6769
|
function hydrateComponent(element, Ctor) {
|
|
@@ -6586,8 +6791,8 @@
|
|
|
6586
6791
|
// Let the renderer know we are hydrating, so it does not replace the existing shadowRoot
|
|
6587
6792
|
// and uses the same algo to create the stylesheets as in SSR.
|
|
6588
6793
|
setIsHydrating(true);
|
|
6589
|
-
createVMWithProps(element, Ctor, props);
|
|
6590
|
-
|
|
6794
|
+
var vm = createVMWithProps(element, Ctor, props);
|
|
6795
|
+
hydrateRoot(vm); // set it back since now we finished hydration.
|
|
6591
6796
|
|
|
6592
6797
|
setIsHydrating(false);
|
|
6593
6798
|
} catch (e) {
|
|
@@ -6902,7 +7107,7 @@
|
|
|
6902
7107
|
});
|
|
6903
7108
|
freeze(LightningElement);
|
|
6904
7109
|
seal(LightningElement.prototype);
|
|
6905
|
-
/* version: 2.
|
|
7110
|
+
/* version: 2.12.1 */
|
|
6906
7111
|
|
|
6907
7112
|
exports.LightningElement = LightningElement;
|
|
6908
7113
|
exports.__unstable__ProfilerControl = profilerControl;
|