lwc 2.11.1 → 2.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine-dom/esm/es2017/engine-dom.js +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 +8 -9
|
@@ -301,9 +301,9 @@ var LWC = (function (exports) {
|
|
|
301
301
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
302
302
|
*/
|
|
303
303
|
// Increment whenever the LWC template compiler changes
|
|
304
|
-
const LWC_VERSION = "2.11.
|
|
304
|
+
const LWC_VERSION = "2.11.3";
|
|
305
305
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
306
|
-
/** version: 2.11.
|
|
306
|
+
/** version: 2.11.3 */
|
|
307
307
|
|
|
308
308
|
/*
|
|
309
309
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -456,7 +456,7 @@ var LWC = (function (exports) {
|
|
|
456
456
|
setFeatureFlag(name, value);
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
/** version: 2.11.
|
|
459
|
+
/** version: 2.11.3 */
|
|
460
460
|
|
|
461
461
|
/* proxy-compat-disable */
|
|
462
462
|
|
|
@@ -5256,236 +5256,6 @@ var LWC = (function (exports) {
|
|
|
5256
5256
|
}
|
|
5257
5257
|
}
|
|
5258
5258
|
|
|
5259
|
-
/*
|
|
5260
|
-
* Copyright (c) 2022, salesforce.com, inc.
|
|
5261
|
-
* All rights reserved.
|
|
5262
|
-
* SPDX-License-Identifier: MIT
|
|
5263
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5264
|
-
*/
|
|
5265
|
-
function hydrate(vnode, node) {
|
|
5266
|
-
switch (vnode.type) {
|
|
5267
|
-
case 0 /* Text */:
|
|
5268
|
-
hydrateText(vnode, node);
|
|
5269
|
-
break;
|
|
5270
|
-
case 1 /* Comment */:
|
|
5271
|
-
hydrateComment(vnode, node);
|
|
5272
|
-
break;
|
|
5273
|
-
case 2 /* Element */:
|
|
5274
|
-
hydrateElement(vnode, node);
|
|
5275
|
-
break;
|
|
5276
|
-
case 3 /* CustomElement */:
|
|
5277
|
-
hydrateCustomElement(vnode, node);
|
|
5278
|
-
break;
|
|
5279
|
-
}
|
|
5280
|
-
}
|
|
5281
|
-
function hydrateText(vnode, node) {
|
|
5282
|
-
var _a;
|
|
5283
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
5284
|
-
validateNodeType(vnode, node, 3 /* TEXT */);
|
|
5285
|
-
const nodeValue = getProperty$1(node, 'nodeValue');
|
|
5286
|
-
if (nodeValue !== vnode.text && !(nodeValue === '\u200D' && vnode.text === '')) {
|
|
5287
|
-
logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
|
|
5288
|
-
}
|
|
5289
|
-
}
|
|
5290
|
-
// always set the text value to the one from the vnode.
|
|
5291
|
-
setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
5292
|
-
vnode.elm = node;
|
|
5293
|
-
}
|
|
5294
|
-
function hydrateComment(vnode, node) {
|
|
5295
|
-
var _a;
|
|
5296
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
5297
|
-
validateNodeType(vnode, node, 8 /* COMMENT */);
|
|
5298
|
-
if (getProperty$1(node, 'nodeValue') !== vnode.text) {
|
|
5299
|
-
logWarn('Hydration mismatch: comment values do not match, will recover from the difference', vnode.owner);
|
|
5300
|
-
}
|
|
5301
|
-
}
|
|
5302
|
-
// always set the text value to the one from the vnode.
|
|
5303
|
-
setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
5304
|
-
vnode.elm = node;
|
|
5305
|
-
}
|
|
5306
|
-
function hydrateElement(vnode, node) {
|
|
5307
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
5308
|
-
validateNodeType(vnode, node, 1 /* ELEMENT */);
|
|
5309
|
-
validateElement(vnode, node);
|
|
5310
|
-
}
|
|
5311
|
-
const elm = node;
|
|
5312
|
-
vnode.elm = elm;
|
|
5313
|
-
const { context } = vnode.data;
|
|
5314
|
-
const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual" /* Manual */);
|
|
5315
|
-
if (isDomManual) {
|
|
5316
|
-
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
5317
|
-
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
5318
|
-
const { props } = vnode.data;
|
|
5319
|
-
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
5320
|
-
if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
|
|
5321
|
-
// Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
|
|
5322
|
-
vnode.data = Object.assign(Object.assign({}, vnode.data), { props: cloneAndOmitKey(props, 'innerHTML') });
|
|
5323
|
-
}
|
|
5324
|
-
else {
|
|
5325
|
-
logWarn(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: innerHTML values do not match for element, will recover from the difference`, vnode.owner);
|
|
5326
|
-
}
|
|
5327
|
-
}
|
|
5328
|
-
}
|
|
5329
|
-
patchElementPropsAndAttrs(vnode);
|
|
5330
|
-
if (!isDomManual) {
|
|
5331
|
-
hydrateChildren(getChildNodes$1(vnode.elm), vnode.children, vnode.owner);
|
|
5332
|
-
}
|
|
5333
|
-
}
|
|
5334
|
-
function hydrateCustomElement(vnode, node) {
|
|
5335
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
5336
|
-
validateNodeType(vnode, node, 1 /* ELEMENT */);
|
|
5337
|
-
validateElement(vnode, node);
|
|
5338
|
-
}
|
|
5339
|
-
const elm = node;
|
|
5340
|
-
const { sel, mode, ctor, owner } = vnode;
|
|
5341
|
-
const vm = createVM(elm, ctor, {
|
|
5342
|
-
mode,
|
|
5343
|
-
owner,
|
|
5344
|
-
tagName: sel,
|
|
5345
|
-
});
|
|
5346
|
-
vnode.elm = elm;
|
|
5347
|
-
vnode.vm = vm;
|
|
5348
|
-
allocateChildren(vnode, vm);
|
|
5349
|
-
patchElementPropsAndAttrs(vnode);
|
|
5350
|
-
// Insert hook section:
|
|
5351
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
5352
|
-
assert.isTrue(vm.state === 0 /* created */, `${vm} cannot be recycled.`);
|
|
5353
|
-
}
|
|
5354
|
-
runConnectedCallback(vm);
|
|
5355
|
-
if (vm.renderMode !== 0 /* Light */) {
|
|
5356
|
-
// VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
5357
|
-
// Note: for Light DOM, this is handled while hydrating the VM
|
|
5358
|
-
hydrateChildren(getChildNodes$1(vnode.elm), vnode.children, vm);
|
|
5359
|
-
}
|
|
5360
|
-
hydrateVM(vm);
|
|
5361
|
-
}
|
|
5362
|
-
function hydrateChildren(elmChildren, children, vm) {
|
|
5363
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
5364
|
-
const filteredVNodes = ArrayFilter.call(children, (vnode) => !!vnode);
|
|
5365
|
-
if (elmChildren.length !== filteredVNodes.length) {
|
|
5366
|
-
logError(`Hydration mismatch: incorrect number of rendered nodes, expected ${filteredVNodes.length} but found ${elmChildren.length}.`, vm);
|
|
5367
|
-
throwHydrationError();
|
|
5368
|
-
}
|
|
5369
|
-
}
|
|
5370
|
-
let childNodeIndex = 0;
|
|
5371
|
-
for (let i = 0; i < children.length; i++) {
|
|
5372
|
-
const childVnode = children[i];
|
|
5373
|
-
if (!isNull(childVnode)) {
|
|
5374
|
-
const childNode = elmChildren[childNodeIndex];
|
|
5375
|
-
hydrate(childVnode, childNode);
|
|
5376
|
-
childNodeIndex++;
|
|
5377
|
-
}
|
|
5378
|
-
}
|
|
5379
|
-
}
|
|
5380
|
-
function patchElementPropsAndAttrs(vnode) {
|
|
5381
|
-
applyEventListeners(vnode);
|
|
5382
|
-
patchProps(null, vnode);
|
|
5383
|
-
}
|
|
5384
|
-
function throwHydrationError() {
|
|
5385
|
-
assert.fail('Server rendered elements do not match client side generated elements');
|
|
5386
|
-
}
|
|
5387
|
-
function validateNodeType(vnode, node, nodeType) {
|
|
5388
|
-
if (getProperty$1(node, 'nodeType') !== nodeType) {
|
|
5389
|
-
logError('Hydration mismatch: incorrect node type received', vnode.owner);
|
|
5390
|
-
assert.fail('Hydration mismatch: incorrect node type received.');
|
|
5391
|
-
}
|
|
5392
|
-
}
|
|
5393
|
-
function validateElement(vnode, elm) {
|
|
5394
|
-
if (vnode.sel.toLowerCase() !== getProperty$1(elm, 'tagName').toLowerCase()) {
|
|
5395
|
-
logError(`Hydration mismatch: expecting element with tag "${vnode.sel.toLowerCase()}" but found "${getProperty$1(elm, 'tagName').toLowerCase()}".`, vnode.owner);
|
|
5396
|
-
throwHydrationError();
|
|
5397
|
-
}
|
|
5398
|
-
const hasIncompatibleAttrs = validateAttrs(vnode, elm);
|
|
5399
|
-
const hasIncompatibleClass = validateClassAttr(vnode, elm);
|
|
5400
|
-
const hasIncompatibleStyle = validateStyleAttr(vnode, elm);
|
|
5401
|
-
const isVNodeAndElementCompatible = hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
|
|
5402
|
-
if (!isVNodeAndElementCompatible) {
|
|
5403
|
-
throwHydrationError();
|
|
5404
|
-
}
|
|
5405
|
-
}
|
|
5406
|
-
function validateAttrs(vnode, elm) {
|
|
5407
|
-
const { data: { attrs = {} }, } = vnode;
|
|
5408
|
-
let nodesAreCompatible = true;
|
|
5409
|
-
// Validate attributes, though we could always recovery from those by running the update mods.
|
|
5410
|
-
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
5411
|
-
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
5412
|
-
const elmAttrValue = getAttribute$1(elm, attrName);
|
|
5413
|
-
if (String(attrValue) !== elmAttrValue) {
|
|
5414
|
-
logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
|
|
5415
|
-
nodesAreCompatible = false;
|
|
5416
|
-
}
|
|
5417
|
-
}
|
|
5418
|
-
return nodesAreCompatible;
|
|
5419
|
-
}
|
|
5420
|
-
function validateClassAttr(vnode, elm) {
|
|
5421
|
-
const { data: { className, classMap }, } = vnode;
|
|
5422
|
-
let nodesAreCompatible = true;
|
|
5423
|
-
let vnodeClassName;
|
|
5424
|
-
if (!isUndefined$1(className) && String(className) !== getProperty$1(elm, 'className')) {
|
|
5425
|
-
// className is used when class is bound to an expr.
|
|
5426
|
-
nodesAreCompatible = false;
|
|
5427
|
-
vnodeClassName = className;
|
|
5428
|
-
}
|
|
5429
|
-
else if (!isUndefined$1(classMap)) {
|
|
5430
|
-
// classMap is used when class is set to static value.
|
|
5431
|
-
const classList = getClassList$1(elm);
|
|
5432
|
-
let computedClassName = '';
|
|
5433
|
-
// all classes from the vnode should be in the element.classList
|
|
5434
|
-
for (const name in classMap) {
|
|
5435
|
-
computedClassName += ' ' + name;
|
|
5436
|
-
if (!classList.contains(name)) {
|
|
5437
|
-
nodesAreCompatible = false;
|
|
5438
|
-
}
|
|
5439
|
-
}
|
|
5440
|
-
vnodeClassName = computedClassName.trim();
|
|
5441
|
-
if (classList.length > keys(classMap).length) {
|
|
5442
|
-
nodesAreCompatible = false;
|
|
5443
|
-
}
|
|
5444
|
-
}
|
|
5445
|
-
if (!nodesAreCompatible) {
|
|
5446
|
-
logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "class" has different values, expected "${vnodeClassName}" but found "${getProperty$1(elm, 'className')}"`, vnode.owner);
|
|
5447
|
-
}
|
|
5448
|
-
return nodesAreCompatible;
|
|
5449
|
-
}
|
|
5450
|
-
function validateStyleAttr(vnode, elm) {
|
|
5451
|
-
const { data: { style, styleDecls }, } = vnode;
|
|
5452
|
-
const elmStyle = getAttribute$1(elm, 'style') || '';
|
|
5453
|
-
let vnodeStyle;
|
|
5454
|
-
let nodesAreCompatible = true;
|
|
5455
|
-
if (!isUndefined$1(style) && style !== elmStyle) {
|
|
5456
|
-
nodesAreCompatible = false;
|
|
5457
|
-
vnodeStyle = style;
|
|
5458
|
-
}
|
|
5459
|
-
else if (!isUndefined$1(styleDecls)) {
|
|
5460
|
-
const parsedVnodeStyle = parseStyleText(elmStyle);
|
|
5461
|
-
const expectedStyle = [];
|
|
5462
|
-
// styleMap is used when style is set to static value.
|
|
5463
|
-
for (let i = 0, n = styleDecls.length; i < n; i++) {
|
|
5464
|
-
const [prop, value, important] = styleDecls[i];
|
|
5465
|
-
expectedStyle.push(`${prop}: ${value + (important ? ' important!' : '')}`);
|
|
5466
|
-
const parsedPropValue = parsedVnodeStyle[prop];
|
|
5467
|
-
if (isUndefined$1(parsedPropValue)) {
|
|
5468
|
-
nodesAreCompatible = false;
|
|
5469
|
-
}
|
|
5470
|
-
else if (!parsedPropValue.startsWith(value)) {
|
|
5471
|
-
nodesAreCompatible = false;
|
|
5472
|
-
}
|
|
5473
|
-
else if (important && !parsedPropValue.endsWith('!important')) {
|
|
5474
|
-
nodesAreCompatible = false;
|
|
5475
|
-
}
|
|
5476
|
-
}
|
|
5477
|
-
if (keys(parsedVnodeStyle).length > styleDecls.length) {
|
|
5478
|
-
nodesAreCompatible = false;
|
|
5479
|
-
}
|
|
5480
|
-
vnodeStyle = ArrayJoin.call(expectedStyle, ';');
|
|
5481
|
-
}
|
|
5482
|
-
if (!nodesAreCompatible) {
|
|
5483
|
-
// style is used when class is bound to an expr.
|
|
5484
|
-
logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "style" has different values, expected "${vnodeStyle}" but found "${elmStyle}".`, vnode.owner);
|
|
5485
|
-
}
|
|
5486
|
-
return nodesAreCompatible;
|
|
5487
|
-
}
|
|
5488
|
-
|
|
5489
5259
|
/*
|
|
5490
5260
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
5491
5261
|
* All rights reserved.
|
|
@@ -5531,32 +5301,12 @@ var LWC = (function (exports) {
|
|
|
5531
5301
|
/* GlobalHydrate */
|
|
5532
5302
|
, vm);
|
|
5533
5303
|
}
|
|
5534
|
-
function hydrateRootElement(elm) {
|
|
5535
|
-
const vm = getAssociatedVM(elm);
|
|
5536
|
-
runConnectedCallback(vm);
|
|
5537
|
-
hydrateVM(vm);
|
|
5538
|
-
}
|
|
5539
5304
|
function disconnectRootElement(elm) {
|
|
5540
5305
|
const vm = getAssociatedVM(elm);
|
|
5541
5306
|
resetComponentStateWhenRemoved(vm);
|
|
5542
5307
|
}
|
|
5543
5308
|
function appendVM(vm) {
|
|
5544
5309
|
rehydrate(vm);
|
|
5545
|
-
}
|
|
5546
|
-
function hydrateVM(vm) {
|
|
5547
|
-
if (isTrue(vm.isDirty)) {
|
|
5548
|
-
// manually diffing/patching here.
|
|
5549
|
-
// This routine is:
|
|
5550
|
-
// patchShadowRoot(vm, children);
|
|
5551
|
-
// -> addVnodes.
|
|
5552
|
-
const children = renderComponent(vm);
|
|
5553
|
-
vm.children = children;
|
|
5554
|
-
const vmChildren = vm.renderMode === 0
|
|
5555
|
-
/* Light */
|
|
5556
|
-
? getChildNodes$1(vm.elm) : getChildNodes$1(vm.elm.shadowRoot);
|
|
5557
|
-
hydrateChildren(vmChildren, children, vm);
|
|
5558
|
-
runRenderedCallback(vm);
|
|
5559
|
-
}
|
|
5560
5310
|
} // just in case the component comes back, with this we guarantee re-rendering it
|
|
5561
5311
|
// while preventing any attempt to rehydration until after reinsertion.
|
|
5562
5312
|
|
|
@@ -5861,7 +5611,6 @@ var LWC = (function (exports) {
|
|
|
5861
5611
|
, vm);
|
|
5862
5612
|
}
|
|
5863
5613
|
}
|
|
5864
|
-
|
|
5865
5614
|
let rehydrateQueue = [];
|
|
5866
5615
|
|
|
5867
5616
|
function flushRehydrationQueue() {
|
|
@@ -6518,6 +6267,298 @@ var LWC = (function (exports) {
|
|
|
6518
6267
|
return reactiveMembrane.getReadOnlyProxy(obj);
|
|
6519
6268
|
}
|
|
6520
6269
|
|
|
6270
|
+
/*
|
|
6271
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
6272
|
+
* All rights reserved.
|
|
6273
|
+
* SPDX-License-Identifier: MIT
|
|
6274
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6275
|
+
*/
|
|
6276
|
+
// flag indicating if the hydration recovered from the DOM mismatch
|
|
6277
|
+
let hasMismatch = false;
|
|
6278
|
+
function hydrateRoot(vm) {
|
|
6279
|
+
hasMismatch = false;
|
|
6280
|
+
runConnectedCallback(vm);
|
|
6281
|
+
hydrateVM(vm);
|
|
6282
|
+
if (hasMismatch) {
|
|
6283
|
+
logError('Hydration completed with errors.', vm);
|
|
6284
|
+
}
|
|
6285
|
+
}
|
|
6286
|
+
function hydrateVM(vm) {
|
|
6287
|
+
const children = renderComponent(vm);
|
|
6288
|
+
vm.children = children;
|
|
6289
|
+
const parentNode = vm.renderRoot;
|
|
6290
|
+
hydrateChildren(getFirstChild$1(parentNode), children, parentNode, vm);
|
|
6291
|
+
runRenderedCallback(vm);
|
|
6292
|
+
}
|
|
6293
|
+
function hydrateNode(node, vnode) {
|
|
6294
|
+
let hydratedNode;
|
|
6295
|
+
switch (vnode.type) {
|
|
6296
|
+
case 0 /* Text */:
|
|
6297
|
+
hydratedNode = hydrateText(node, vnode);
|
|
6298
|
+
break;
|
|
6299
|
+
case 1 /* Comment */:
|
|
6300
|
+
hydratedNode = hydrateComment(node, vnode);
|
|
6301
|
+
break;
|
|
6302
|
+
case 2 /* Element */:
|
|
6303
|
+
hydratedNode = hydrateElement(node, vnode);
|
|
6304
|
+
break;
|
|
6305
|
+
case 3 /* CustomElement */:
|
|
6306
|
+
hydratedNode = hydrateCustomElement(node, vnode);
|
|
6307
|
+
break;
|
|
6308
|
+
}
|
|
6309
|
+
return nextSibling$1(hydratedNode);
|
|
6310
|
+
}
|
|
6311
|
+
function hydrateText(node, vnode) {
|
|
6312
|
+
var _a;
|
|
6313
|
+
if (!hasCorrectNodeType(vnode, node, 3 /* TEXT */)) {
|
|
6314
|
+
return handleMismatch(node, vnode);
|
|
6315
|
+
}
|
|
6316
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6317
|
+
const nodeValue = getProperty$1(node, 'nodeValue');
|
|
6318
|
+
if (nodeValue !== vnode.text && !(nodeValue === '\u200D' && vnode.text === '')) {
|
|
6319
|
+
logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
|
|
6320
|
+
}
|
|
6321
|
+
}
|
|
6322
|
+
setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
6323
|
+
vnode.elm = node;
|
|
6324
|
+
return node;
|
|
6325
|
+
}
|
|
6326
|
+
function hydrateComment(node, vnode) {
|
|
6327
|
+
var _a;
|
|
6328
|
+
if (!hasCorrectNodeType(vnode, node, 8 /* COMMENT */)) {
|
|
6329
|
+
return handleMismatch(node, vnode);
|
|
6330
|
+
}
|
|
6331
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6332
|
+
const nodeValue = getProperty$1(node, 'nodeValue');
|
|
6333
|
+
if (nodeValue !== vnode.text) {
|
|
6334
|
+
logWarn('Hydration mismatch: comment values do not match, will recover from the difference', vnode.owner);
|
|
6335
|
+
}
|
|
6336
|
+
}
|
|
6337
|
+
setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
6338
|
+
vnode.elm = node;
|
|
6339
|
+
return node;
|
|
6340
|
+
}
|
|
6341
|
+
function hydrateElement(elm, vnode) {
|
|
6342
|
+
if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */) ||
|
|
6343
|
+
!isMatchingElement(vnode, elm)) {
|
|
6344
|
+
return handleMismatch(elm, vnode);
|
|
6345
|
+
}
|
|
6346
|
+
vnode.elm = elm;
|
|
6347
|
+
const { context } = vnode.data;
|
|
6348
|
+
const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual" /* Manual */);
|
|
6349
|
+
if (isDomManual) {
|
|
6350
|
+
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
6351
|
+
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
6352
|
+
const { props } = vnode.data;
|
|
6353
|
+
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
6354
|
+
if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
|
|
6355
|
+
// Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
|
|
6356
|
+
vnode.data = Object.assign(Object.assign({}, vnode.data), { props: cloneAndOmitKey(props, 'innerHTML') });
|
|
6357
|
+
}
|
|
6358
|
+
else {
|
|
6359
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6360
|
+
logWarn(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: innerHTML values do not match for element, will recover from the difference`, vnode.owner);
|
|
6361
|
+
}
|
|
6362
|
+
}
|
|
6363
|
+
}
|
|
6364
|
+
}
|
|
6365
|
+
patchElementPropsAndAttrs(vnode);
|
|
6366
|
+
if (!isDomManual) {
|
|
6367
|
+
hydrateChildren(getFirstChild$1(elm), vnode.children, elm, vnode.owner);
|
|
6368
|
+
}
|
|
6369
|
+
return elm;
|
|
6370
|
+
}
|
|
6371
|
+
function hydrateCustomElement(elm, vnode) {
|
|
6372
|
+
if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */) ||
|
|
6373
|
+
!isMatchingElement(vnode, elm)) {
|
|
6374
|
+
return handleMismatch(elm, vnode);
|
|
6375
|
+
}
|
|
6376
|
+
const { sel, mode, ctor, owner } = vnode;
|
|
6377
|
+
const vm = createVM(elm, ctor, {
|
|
6378
|
+
mode,
|
|
6379
|
+
owner,
|
|
6380
|
+
tagName: sel,
|
|
6381
|
+
});
|
|
6382
|
+
vnode.elm = elm;
|
|
6383
|
+
vnode.vm = vm;
|
|
6384
|
+
allocateChildren(vnode, vm);
|
|
6385
|
+
patchElementPropsAndAttrs(vnode);
|
|
6386
|
+
// Insert hook section:
|
|
6387
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6388
|
+
assert.isTrue(vm.state === 0 /* created */, `${vm} cannot be recycled.`);
|
|
6389
|
+
}
|
|
6390
|
+
runConnectedCallback(vm);
|
|
6391
|
+
if (vm.renderMode !== 0 /* Light */) {
|
|
6392
|
+
// VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
6393
|
+
// Note: for Light DOM, this is handled while hydrating the VM
|
|
6394
|
+
hydrateChildren(getFirstChild$1(elm), vnode.children, elm, vm);
|
|
6395
|
+
}
|
|
6396
|
+
hydrateVM(vm);
|
|
6397
|
+
return elm;
|
|
6398
|
+
}
|
|
6399
|
+
function hydrateChildren(node, children, parentNode, owner) {
|
|
6400
|
+
let hasWarned = false;
|
|
6401
|
+
let nextNode = node;
|
|
6402
|
+
let anchor = null;
|
|
6403
|
+
for (let i = 0; i < children.length; i++) {
|
|
6404
|
+
const childVnode = children[i];
|
|
6405
|
+
if (!isNull(childVnode)) {
|
|
6406
|
+
if (nextNode) {
|
|
6407
|
+
nextNode = hydrateNode(nextNode, childVnode);
|
|
6408
|
+
anchor = childVnode.elm;
|
|
6409
|
+
}
|
|
6410
|
+
else {
|
|
6411
|
+
hasMismatch = true;
|
|
6412
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6413
|
+
if (!hasWarned) {
|
|
6414
|
+
hasWarned = true;
|
|
6415
|
+
logError(`Hydration mismatch: incorrect number of rendered nodes. Client produced more nodes than the server.`, owner);
|
|
6416
|
+
}
|
|
6417
|
+
}
|
|
6418
|
+
mount(childVnode, parentNode, anchor);
|
|
6419
|
+
anchor = childVnode.elm;
|
|
6420
|
+
}
|
|
6421
|
+
}
|
|
6422
|
+
}
|
|
6423
|
+
if (nextNode) {
|
|
6424
|
+
hasMismatch = true;
|
|
6425
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6426
|
+
if (!hasWarned) {
|
|
6427
|
+
logError(`Hydration mismatch: incorrect number of rendered nodes. Server rendered more nodes than the client.`, owner);
|
|
6428
|
+
}
|
|
6429
|
+
}
|
|
6430
|
+
do {
|
|
6431
|
+
const current = nextNode;
|
|
6432
|
+
nextNode = nextSibling$1(nextNode);
|
|
6433
|
+
removeNode(current, parentNode);
|
|
6434
|
+
} while (nextNode);
|
|
6435
|
+
}
|
|
6436
|
+
}
|
|
6437
|
+
function handleMismatch(node, vnode, msg) {
|
|
6438
|
+
hasMismatch = true;
|
|
6439
|
+
if (!isUndefined$1(msg)) {
|
|
6440
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6441
|
+
logError(msg, vnode.owner);
|
|
6442
|
+
}
|
|
6443
|
+
}
|
|
6444
|
+
const parentNode = getProperty$1(node, 'parentNode');
|
|
6445
|
+
mount(vnode, parentNode, node);
|
|
6446
|
+
removeNode(node, parentNode);
|
|
6447
|
+
return vnode.elm;
|
|
6448
|
+
}
|
|
6449
|
+
function patchElementPropsAndAttrs(vnode) {
|
|
6450
|
+
applyEventListeners(vnode);
|
|
6451
|
+
patchProps(null, vnode);
|
|
6452
|
+
}
|
|
6453
|
+
function hasCorrectNodeType(vnode, node, nodeType) {
|
|
6454
|
+
if (getProperty$1(node, 'nodeType') !== nodeType) {
|
|
6455
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6456
|
+
logError('Hydration mismatch: incorrect node type received', vnode.owner);
|
|
6457
|
+
}
|
|
6458
|
+
return false;
|
|
6459
|
+
}
|
|
6460
|
+
return true;
|
|
6461
|
+
}
|
|
6462
|
+
function isMatchingElement(vnode, elm) {
|
|
6463
|
+
if (vnode.sel.toLowerCase() !== getProperty$1(elm, 'tagName').toLowerCase()) {
|
|
6464
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6465
|
+
logError(`Hydration mismatch: expecting element with tag "${vnode.sel.toLowerCase()}" but found "${getProperty$1(elm, 'tagName').toLowerCase()}".`, vnode.owner);
|
|
6466
|
+
}
|
|
6467
|
+
return false;
|
|
6468
|
+
}
|
|
6469
|
+
const hasIncompatibleAttrs = validateAttrs(vnode, elm);
|
|
6470
|
+
const hasIncompatibleClass = validateClassAttr(vnode, elm);
|
|
6471
|
+
const hasIncompatibleStyle = validateStyleAttr(vnode, elm);
|
|
6472
|
+
return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
|
|
6473
|
+
}
|
|
6474
|
+
function validateAttrs(vnode, elm) {
|
|
6475
|
+
const { data: { attrs = {} }, } = vnode;
|
|
6476
|
+
let nodesAreCompatible = true;
|
|
6477
|
+
// Validate attributes, though we could always recovery from those by running the update mods.
|
|
6478
|
+
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
6479
|
+
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
6480
|
+
const elmAttrValue = getAttribute$1(elm, attrName);
|
|
6481
|
+
if (String(attrValue) !== elmAttrValue) {
|
|
6482
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6483
|
+
logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
|
|
6484
|
+
}
|
|
6485
|
+
nodesAreCompatible = false;
|
|
6486
|
+
}
|
|
6487
|
+
}
|
|
6488
|
+
return nodesAreCompatible;
|
|
6489
|
+
}
|
|
6490
|
+
function validateClassAttr(vnode, elm) {
|
|
6491
|
+
const { data: { className, classMap }, } = vnode;
|
|
6492
|
+
let nodesAreCompatible = true;
|
|
6493
|
+
let vnodeClassName;
|
|
6494
|
+
if (!isUndefined$1(className) && String(className) !== getProperty$1(elm, 'className')) {
|
|
6495
|
+
// className is used when class is bound to an expr.
|
|
6496
|
+
nodesAreCompatible = false;
|
|
6497
|
+
vnodeClassName = className;
|
|
6498
|
+
}
|
|
6499
|
+
else if (!isUndefined$1(classMap)) {
|
|
6500
|
+
// classMap is used when class is set to static value.
|
|
6501
|
+
const classList = getClassList$1(elm);
|
|
6502
|
+
let computedClassName = '';
|
|
6503
|
+
// all classes from the vnode should be in the element.classList
|
|
6504
|
+
for (const name in classMap) {
|
|
6505
|
+
computedClassName += ' ' + name;
|
|
6506
|
+
if (!classList.contains(name)) {
|
|
6507
|
+
nodesAreCompatible = false;
|
|
6508
|
+
}
|
|
6509
|
+
}
|
|
6510
|
+
vnodeClassName = computedClassName.trim();
|
|
6511
|
+
if (classList.length > keys(classMap).length) {
|
|
6512
|
+
nodesAreCompatible = false;
|
|
6513
|
+
}
|
|
6514
|
+
}
|
|
6515
|
+
if (!nodesAreCompatible) {
|
|
6516
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6517
|
+
logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "class" has different values, expected "${vnodeClassName}" but found "${getProperty$1(elm, 'className')}"`, vnode.owner);
|
|
6518
|
+
}
|
|
6519
|
+
}
|
|
6520
|
+
return nodesAreCompatible;
|
|
6521
|
+
}
|
|
6522
|
+
function validateStyleAttr(vnode, elm) {
|
|
6523
|
+
const { data: { style, styleDecls }, } = vnode;
|
|
6524
|
+
const elmStyle = getAttribute$1(elm, 'style') || '';
|
|
6525
|
+
let vnodeStyle;
|
|
6526
|
+
let nodesAreCompatible = true;
|
|
6527
|
+
if (!isUndefined$1(style) && style !== elmStyle) {
|
|
6528
|
+
nodesAreCompatible = false;
|
|
6529
|
+
vnodeStyle = style;
|
|
6530
|
+
}
|
|
6531
|
+
else if (!isUndefined$1(styleDecls)) {
|
|
6532
|
+
const parsedVnodeStyle = parseStyleText(elmStyle);
|
|
6533
|
+
const expectedStyle = [];
|
|
6534
|
+
// styleMap is used when style is set to static value.
|
|
6535
|
+
for (let i = 0, n = styleDecls.length; i < n; i++) {
|
|
6536
|
+
const [prop, value, important] = styleDecls[i];
|
|
6537
|
+
expectedStyle.push(`${prop}: ${value + (important ? ' important!' : '')}`);
|
|
6538
|
+
const parsedPropValue = parsedVnodeStyle[prop];
|
|
6539
|
+
if (isUndefined$1(parsedPropValue)) {
|
|
6540
|
+
nodesAreCompatible = false;
|
|
6541
|
+
}
|
|
6542
|
+
else if (!parsedPropValue.startsWith(value)) {
|
|
6543
|
+
nodesAreCompatible = false;
|
|
6544
|
+
}
|
|
6545
|
+
else if (important && !parsedPropValue.endsWith('!important')) {
|
|
6546
|
+
nodesAreCompatible = false;
|
|
6547
|
+
}
|
|
6548
|
+
}
|
|
6549
|
+
if (keys(parsedVnodeStyle).length > styleDecls.length) {
|
|
6550
|
+
nodesAreCompatible = false;
|
|
6551
|
+
}
|
|
6552
|
+
vnodeStyle = ArrayJoin.call(expectedStyle, ';');
|
|
6553
|
+
}
|
|
6554
|
+
if (!nodesAreCompatible) {
|
|
6555
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6556
|
+
logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "style" has different values, expected "${vnodeStyle}" but found "${elmStyle}".`, vnode.owner);
|
|
6557
|
+
}
|
|
6558
|
+
}
|
|
6559
|
+
return nodesAreCompatible;
|
|
6560
|
+
}
|
|
6561
|
+
|
|
6521
6562
|
/*
|
|
6522
6563
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
6523
6564
|
* All rights reserved.
|
|
@@ -6530,7 +6571,7 @@ var LWC = (function (exports) {
|
|
|
6530
6571
|
hooksAreSet = true;
|
|
6531
6572
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
6532
6573
|
}
|
|
6533
|
-
/* version: 2.11.
|
|
6574
|
+
/* version: 2.11.3 */
|
|
6534
6575
|
|
|
6535
6576
|
/*
|
|
6536
6577
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6875,7 +6916,7 @@ var LWC = (function (exports) {
|
|
|
6875
6916
|
}
|
|
6876
6917
|
}
|
|
6877
6918
|
function createVMWithProps(element, Ctor, props) {
|
|
6878
|
-
createVM(element, Ctor, {
|
|
6919
|
+
const vm = createVM(element, Ctor, {
|
|
6879
6920
|
mode: 'open',
|
|
6880
6921
|
owner: null,
|
|
6881
6922
|
tagName: element.tagName.toLowerCase(),
|
|
@@ -6883,6 +6924,7 @@ var LWC = (function (exports) {
|
|
|
6883
6924
|
for (const [key, value] of Object.entries(props)) {
|
|
6884
6925
|
element[key] = value;
|
|
6885
6926
|
}
|
|
6927
|
+
return vm;
|
|
6886
6928
|
}
|
|
6887
6929
|
function hydrateComponent(element, Ctor, props = {}) {
|
|
6888
6930
|
if (!(element instanceof Element)) {
|
|
@@ -6903,8 +6945,8 @@ var LWC = (function (exports) {
|
|
|
6903
6945
|
// Let the renderer know we are hydrating, so it does not replace the existing shadowRoot
|
|
6904
6946
|
// and uses the same algo to create the stylesheets as in SSR.
|
|
6905
6947
|
setIsHydrating(true);
|
|
6906
|
-
createVMWithProps(element, Ctor, props);
|
|
6907
|
-
|
|
6948
|
+
const vm = createVMWithProps(element, Ctor, props);
|
|
6949
|
+
hydrateRoot(vm);
|
|
6908
6950
|
// set it back since now we finished hydration.
|
|
6909
6951
|
setIsHydrating(false);
|
|
6910
6952
|
}
|
|
@@ -7169,7 +7211,7 @@ var LWC = (function (exports) {
|
|
|
7169
7211
|
});
|
|
7170
7212
|
freeze(LightningElement);
|
|
7171
7213
|
seal(LightningElement.prototype);
|
|
7172
|
-
/* version: 2.11.
|
|
7214
|
+
/* version: 2.11.3 */
|
|
7173
7215
|
|
|
7174
7216
|
exports.LightningElement = LightningElement;
|
|
7175
7217
|
exports.__unstable__ProfilerControl = profilerControl;
|