lwc 2.45.1 → 2.45.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 +101 -60
- package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.js +101 -60
- package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +110 -58
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.js +114 -62
- package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +123 -60
- package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.js +101 -60
- package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +110 -58
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.js +114 -62
- package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +123 -60
- package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.js +7796 -92
- package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +7795 -72
- package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +72 -13
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +72 -13
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +40 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +56 -6
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +71 -12
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +39 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +43 -4
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +72 -13
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +40 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +56 -6
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +71 -12
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +39 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +43 -4
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/wire-service/esm/es2017/wire-service.js +10 -4
- package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service.js +10 -4
- package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service_debug.js +10 -4
- package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service.js +10 -4
- package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +10 -4
- package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service.js +10 -4
- package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service_debug.js +10 -4
- package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service.js +10 -4
- package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +10 -4
- package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
/* proxy-compat-disable */
|
|
2
1
|
/**
|
|
3
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
4
6
|
*/
|
|
5
7
|
/*
|
|
6
8
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -43,7 +45,16 @@ var assert = /*#__PURE__*/Object.freeze({
|
|
|
43
45
|
*/
|
|
44
46
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
45
47
|
const { isArray: isArray$1 } = Array;
|
|
46
|
-
const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
48
|
+
const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, every: ArrayEvery, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, includes: ArrayIncludes, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
49
|
+
// The type of the return value of Array.prototype.every is `this is T[]`. However, once this
|
|
50
|
+
// Array method is pulled out of the prototype, the function is now referencing `this` where
|
|
51
|
+
// `this` is meaningless, resulting in a TypeScript compilation error.
|
|
52
|
+
//
|
|
53
|
+
// Exposing this helper function is the closest we can get to preserving the usage patterns
|
|
54
|
+
// of Array.prototype methods used elsewhere in the codebase.
|
|
55
|
+
function arrayEvery(arr, predicate) {
|
|
56
|
+
return ArrayEvery.call(arr, predicate);
|
|
57
|
+
}
|
|
47
58
|
const { fromCharCode: StringFromCharCode } = String;
|
|
48
59
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, split: StringSplit, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
49
60
|
function isUndefined$1(obj) {
|
|
@@ -184,7 +195,7 @@ const { AriaAttrNameToPropNameMap, AriaPropNameToAttrNameMap } = /*@__PURE__*/ (
|
|
|
184
195
|
})();
|
|
185
196
|
// These attributes take either an ID or a list of IDs as values.
|
|
186
197
|
// This includes aria-* attributes as well as the special non-ARIA "for" attribute
|
|
187
|
-
const ID_REFERENCING_ATTRIBUTES_SET = new Set([
|
|
198
|
+
const ID_REFERENCING_ATTRIBUTES_SET = /*@__PURE__*/ new Set([
|
|
188
199
|
'aria-activedescendant',
|
|
189
200
|
'aria-controls',
|
|
190
201
|
'aria-describedby',
|
|
@@ -271,11 +282,11 @@ const { NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING, NO_STANDARD_PROPERTY_ATTRIBUTE_M
|
|
|
271
282
|
/**
|
|
272
283
|
* Map associating previously transformed HTML property into HTML attribute.
|
|
273
284
|
*/
|
|
274
|
-
const CACHED_PROPERTY_ATTRIBUTE_MAPPING = new Map();
|
|
285
|
+
const CACHED_PROPERTY_ATTRIBUTE_MAPPING = /*@__PURE__@*/ new Map();
|
|
275
286
|
/**
|
|
276
287
|
* Map associating previously transformed HTML attribute into HTML property.
|
|
277
288
|
*/
|
|
278
|
-
const CACHED_ATTRIBUTE_PROPERTY_MAPPING = new Map();
|
|
289
|
+
const CACHED_ATTRIBUTE_PROPERTY_MAPPING = /*@__PURE__@*/ new Map();
|
|
279
290
|
function htmlPropertyToAttribute(propName) {
|
|
280
291
|
const ariaAttributeName = AriaPropNameToAttrNameMap[propName];
|
|
281
292
|
if (!isUndefined$1(ariaAttributeName)) {
|
|
@@ -329,12 +340,12 @@ function htmlAttributeToProperty(attrName) {
|
|
|
329
340
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
330
341
|
*/
|
|
331
342
|
// Increment whenever the LWC template compiler changes
|
|
332
|
-
const LWC_VERSION = "2.45.
|
|
343
|
+
const LWC_VERSION = "2.45.3";
|
|
333
344
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
334
|
-
/** version: 2.45.
|
|
345
|
+
/** version: 2.45.3 */
|
|
335
346
|
|
|
336
347
|
/**
|
|
337
|
-
* Copyright (C)
|
|
348
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
338
349
|
*/
|
|
339
350
|
|
|
340
351
|
/*
|
|
@@ -409,10 +420,10 @@ function setFeatureFlagForTest(name, value) {
|
|
|
409
420
|
setFeatureFlag(name, value);
|
|
410
421
|
}
|
|
411
422
|
}
|
|
412
|
-
/** version: 2.45.
|
|
423
|
+
/** version: 2.45.3 */
|
|
413
424
|
|
|
414
425
|
/**
|
|
415
|
-
* Copyright (C)
|
|
426
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
416
427
|
*/
|
|
417
428
|
|
|
418
429
|
/*
|
|
@@ -473,7 +484,7 @@ function applyAriaReflection(prototype = Element.prototype) {
|
|
|
473
484
|
}
|
|
474
485
|
}
|
|
475
486
|
}
|
|
476
|
-
/** version: 2.45.
|
|
487
|
+
/** version: 2.45.3 */
|
|
477
488
|
|
|
478
489
|
/*
|
|
479
490
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -487,7 +498,9 @@ if (!lwcRuntimeFlags.DISABLE_ARIA_REFLECTION_POLYFILL) {
|
|
|
487
498
|
applyAriaReflection();
|
|
488
499
|
}
|
|
489
500
|
|
|
490
|
-
|
|
501
|
+
/**
|
|
502
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
503
|
+
*/
|
|
491
504
|
|
|
492
505
|
/*
|
|
493
506
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -916,19 +929,6 @@ const defaultDefHTMLPropertyNames = [
|
|
|
916
929
|
'tabIndex',
|
|
917
930
|
'title',
|
|
918
931
|
];
|
|
919
|
-
let controlledElement = null;
|
|
920
|
-
let controlledAttributeName;
|
|
921
|
-
function isAttributeLocked(elm, attrName) {
|
|
922
|
-
return elm !== controlledElement || attrName !== controlledAttributeName;
|
|
923
|
-
}
|
|
924
|
-
function lockAttribute(_elm, _key) {
|
|
925
|
-
controlledElement = null;
|
|
926
|
-
controlledAttributeName = undefined;
|
|
927
|
-
}
|
|
928
|
-
function unlockAttribute(elm, key) {
|
|
929
|
-
controlledElement = elm;
|
|
930
|
-
controlledAttributeName = key;
|
|
931
|
-
}
|
|
932
932
|
|
|
933
933
|
/*
|
|
934
934
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -967,6 +967,7 @@ forEach.call(defaultDefHTMLPropertyNames, (propName) => {
|
|
|
967
967
|
* SPDX-License-Identifier: MIT
|
|
968
968
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
969
969
|
*/
|
|
970
|
+
/* eslint @lwc/lwc-internal/no-production-assert: "off" */
|
|
970
971
|
function generateDataDescriptor(options) {
|
|
971
972
|
return assign({
|
|
972
973
|
configurable: true,
|
|
@@ -1796,6 +1797,14 @@ function markLockerLiveObject(obj) {
|
|
|
1796
1797
|
* SPDX-License-Identifier: MIT
|
|
1797
1798
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1798
1799
|
*/
|
|
1800
|
+
/**
|
|
1801
|
+
* This module is responsible for producing the ComponentDef object that is always
|
|
1802
|
+
* accessible via `vm.def`. This is lazily created during the creation of the first
|
|
1803
|
+
* instance of a component class, and shared across all instances.
|
|
1804
|
+
*
|
|
1805
|
+
* This structure can be used to synthetically create proxies, and understand the
|
|
1806
|
+
* shape of a component. It is also used internally to apply extra optimizations.
|
|
1807
|
+
*/
|
|
1799
1808
|
/**
|
|
1800
1809
|
* This operation is called with a descriptor of an standard html property
|
|
1801
1810
|
* that a Custom Element can support (including AOM properties), which
|
|
@@ -1959,15 +1968,11 @@ LightningElement.prototype = {
|
|
|
1959
1968
|
removeAttribute(name) {
|
|
1960
1969
|
const vm = getAssociatedVM(this);
|
|
1961
1970
|
const { elm, renderer: { removeAttribute }, } = vm;
|
|
1962
|
-
unlockAttribute(elm, name);
|
|
1963
1971
|
removeAttribute(elm, name);
|
|
1964
|
-
lockAttribute();
|
|
1965
1972
|
},
|
|
1966
1973
|
removeAttributeNS(namespace, name) {
|
|
1967
1974
|
const { elm, renderer: { removeAttribute }, } = getAssociatedVM(this);
|
|
1968
|
-
unlockAttribute(elm, name);
|
|
1969
1975
|
removeAttribute(elm, name, namespace);
|
|
1970
|
-
lockAttribute();
|
|
1971
1976
|
},
|
|
1972
1977
|
getAttribute(name) {
|
|
1973
1978
|
const vm = getAssociatedVM(this);
|
|
@@ -1989,9 +1994,7 @@ LightningElement.prototype = {
|
|
|
1989
1994
|
logError(`Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
|
|
1990
1995
|
}
|
|
1991
1996
|
}
|
|
1992
|
-
unlockAttribute(elm, name);
|
|
1993
1997
|
setAttribute(elm, name, value);
|
|
1994
|
-
lockAttribute();
|
|
1995
1998
|
},
|
|
1996
1999
|
setAttributeNS(namespace, name, value) {
|
|
1997
2000
|
const vm = getAssociatedVM(this);
|
|
@@ -2001,9 +2004,7 @@ LightningElement.prototype = {
|
|
|
2001
2004
|
logError(`Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
|
|
2002
2005
|
}
|
|
2003
2006
|
}
|
|
2004
|
-
unlockAttribute(elm, name);
|
|
2005
2007
|
setAttribute(elm, name, value, namespace);
|
|
2006
|
-
lockAttribute();
|
|
2007
2008
|
},
|
|
2008
2009
|
getBoundingClientRect() {
|
|
2009
2010
|
const vm = getAssociatedVM(this);
|
|
@@ -2385,7 +2386,7 @@ function createConnector(vm, name, wireDef) {
|
|
|
2385
2386
|
});
|
|
2386
2387
|
runWithBoundaryProtection(vm, vm, noop, () => {
|
|
2387
2388
|
// job
|
|
2388
|
-
connector = new adapter(dataCallback);
|
|
2389
|
+
connector = new adapter(dataCallback, { tagName: vm.tagName });
|
|
2389
2390
|
}, noop);
|
|
2390
2391
|
const updateConnectorConfig = (config) => {
|
|
2391
2392
|
// every time the config is recomputed due to tracking,
|
|
@@ -2953,6 +2954,10 @@ function sanitizeAttribute(tagName, namespaceUri, attrName, attrValue) {
|
|
|
2953
2954
|
* SPDX-License-Identifier: MIT
|
|
2954
2955
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2955
2956
|
*/
|
|
2957
|
+
/**
|
|
2958
|
+
* This module is responsible for creating the base bridge class BaseBridgeElement
|
|
2959
|
+
* that represents the HTMLElement extension used for any LWC inserted in the DOM.
|
|
2960
|
+
*/
|
|
2956
2961
|
// A bridge descriptor is a descriptor whose job is just to get the component instance
|
|
2957
2962
|
// from the element instance, and get the value or set a new value on the component.
|
|
2958
2963
|
// This means that across different elements, similar names can get the exact same
|
|
@@ -3006,14 +3011,6 @@ function createAttributeChangedCallback(attributeToPropMap, superAttributeChange
|
|
|
3006
3011
|
}
|
|
3007
3012
|
return;
|
|
3008
3013
|
}
|
|
3009
|
-
if (!isAttributeLocked(this, attrName)) {
|
|
3010
|
-
// Ignore changes triggered by the engine itself during:
|
|
3011
|
-
// * diffing when public props are attempting to reflect to the DOM
|
|
3012
|
-
// * component via `this.setAttribute()`, should never update the prop
|
|
3013
|
-
// Both cases, the setAttribute call is always wrapped by the unlocking of the
|
|
3014
|
-
// attribute to be changed
|
|
3015
|
-
return;
|
|
3016
|
-
}
|
|
3017
3014
|
// Reflect attribute change to the corresponding property when changed from outside.
|
|
3018
3015
|
this[propName] = newValue;
|
|
3019
3016
|
};
|
|
@@ -3358,6 +3355,14 @@ function swapStyle(oldStyle, newStyle) {
|
|
|
3358
3355
|
* SPDX-License-Identifier: MIT
|
|
3359
3356
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3360
3357
|
*/
|
|
3358
|
+
/**
|
|
3359
|
+
* This module is responsible for producing the ComponentDef object that is always
|
|
3360
|
+
* accessible via `vm.def`. This is lazily created during the creation of the first
|
|
3361
|
+
* instance of a component class, and shared across all instances.
|
|
3362
|
+
*
|
|
3363
|
+
* This structure can be used to synthetically create proxies, and understand the
|
|
3364
|
+
* shape of a component. It is also used internally to apply extra optimizations.
|
|
3365
|
+
*/
|
|
3361
3366
|
const CtorToDefMap = new WeakMap();
|
|
3362
3367
|
function getCtorProto(Ctor) {
|
|
3363
3368
|
let proto = getPrototypeOf$1(Ctor);
|
|
@@ -3799,7 +3804,6 @@ function patchAttributes(oldVnode, vnode, renderer) {
|
|
|
3799
3804
|
const cur = attrs[key];
|
|
3800
3805
|
const old = oldAttrs[key];
|
|
3801
3806
|
if (old !== cur) {
|
|
3802
|
-
unlockAttribute(elm, key);
|
|
3803
3807
|
if (StringCharCodeAt.call(key, 3) === ColonCharCode$1) {
|
|
3804
3808
|
// Assume xml namespace
|
|
3805
3809
|
setAttribute(elm, key, cur, XML_NAMESPACE);
|
|
@@ -3814,7 +3818,6 @@ function patchAttributes(oldVnode, vnode, renderer) {
|
|
|
3814
3818
|
else {
|
|
3815
3819
|
setAttribute(elm, key, cur);
|
|
3816
3820
|
}
|
|
3817
|
-
lockAttribute();
|
|
3818
3821
|
}
|
|
3819
3822
|
}
|
|
3820
3823
|
}
|
|
@@ -6702,6 +6705,27 @@ function textNodeContentsAreEqual(node, vnode, renderer) {
|
|
|
6702
6705
|
}
|
|
6703
6706
|
return false;
|
|
6704
6707
|
}
|
|
6708
|
+
// The validationOptOut static property can be an array of attribute names.
|
|
6709
|
+
// Any attribute names specified in that array will not be validated, and the
|
|
6710
|
+
// LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
|
|
6711
|
+
function getValidationPredicate(optOutStaticProp) {
|
|
6712
|
+
if (isUndefined$1(optOutStaticProp)) {
|
|
6713
|
+
return (_attrName) => true;
|
|
6714
|
+
}
|
|
6715
|
+
// If validationOptOut is true, no attributes will be checked for correctness
|
|
6716
|
+
// and the runtime will assume VDOM attrs and DOM attrs are in sync.
|
|
6717
|
+
if (isTrue(optOutStaticProp)) {
|
|
6718
|
+
return (_attrName) => false;
|
|
6719
|
+
}
|
|
6720
|
+
// If validationOptOut is an array of strings, attributes specified in the
|
|
6721
|
+
// array will be "opted out". Attributes not specified in the array will still
|
|
6722
|
+
// be validated.
|
|
6723
|
+
if (isArray$1(optOutStaticProp) && arrayEvery(optOutStaticProp, isString)) {
|
|
6724
|
+
return (attrName) => !ArrayIncludes.call(optOutStaticProp, attrName);
|
|
6725
|
+
}
|
|
6726
|
+
logWarn('Validation opt out must be `true` or an array of attributes that should not be validated.');
|
|
6727
|
+
return (_attrName) => true;
|
|
6728
|
+
}
|
|
6705
6729
|
function hydrateText(node, vnode, renderer) {
|
|
6706
6730
|
var _a;
|
|
6707
6731
|
if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
|
|
@@ -6780,8 +6804,19 @@ function hydrateElement(elm, vnode, renderer) {
|
|
|
6780
6804
|
return elm;
|
|
6781
6805
|
}
|
|
6782
6806
|
function hydrateCustomElement(elm, vnode, renderer) {
|
|
6807
|
+
const { validationOptOut } = vnode.ctor;
|
|
6808
|
+
const shouldValidateAttr = getValidationPredicate(validationOptOut);
|
|
6809
|
+
// The validationOptOut static property can be an array of attribute names.
|
|
6810
|
+
// Any attribute names specified in that array will not be validated, and the
|
|
6811
|
+
// LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
|
|
6812
|
+
//
|
|
6813
|
+
// If validationOptOut is true, no attributes will be checked for correctness
|
|
6814
|
+
// and the runtime will assume VDOM attrs and DOM attrs are in sync.
|
|
6815
|
+
//
|
|
6816
|
+
// Therefore, if validationOptOut is falsey or an array of strings, we need to
|
|
6817
|
+
// examine some or all of the custom element's attributes.
|
|
6783
6818
|
if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) ||
|
|
6784
|
-
!isMatchingElement(vnode, elm, renderer)) {
|
|
6819
|
+
!isMatchingElement(vnode, elm, renderer, shouldValidateAttr)) {
|
|
6785
6820
|
return handleMismatch(elm, vnode, renderer);
|
|
6786
6821
|
}
|
|
6787
6822
|
const { sel, mode, ctor, owner } = vnode;
|
|
@@ -6812,14 +6847,12 @@ function hydrateCustomElement(elm, vnode, renderer) {
|
|
|
6812
6847
|
function hydrateChildren(node, children, parentNode, owner) {
|
|
6813
6848
|
let hasWarned = false;
|
|
6814
6849
|
let nextNode = node;
|
|
6815
|
-
let anchor = null;
|
|
6816
6850
|
const { renderer } = owner;
|
|
6817
6851
|
for (let i = 0; i < children.length; i++) {
|
|
6818
6852
|
const childVnode = children[i];
|
|
6819
6853
|
if (!isNull(childVnode)) {
|
|
6820
6854
|
if (nextNode) {
|
|
6821
6855
|
nextNode = hydrateNode(nextNode, childVnode, renderer);
|
|
6822
|
-
anchor = childVnode.elm;
|
|
6823
6856
|
}
|
|
6824
6857
|
else {
|
|
6825
6858
|
hasMismatch = true;
|
|
@@ -6829,8 +6862,8 @@ function hydrateChildren(node, children, parentNode, owner) {
|
|
|
6829
6862
|
logError(`Hydration mismatch: incorrect number of rendered nodes. Client produced more nodes than the server.`, owner);
|
|
6830
6863
|
}
|
|
6831
6864
|
}
|
|
6832
|
-
mount(childVnode, parentNode, renderer,
|
|
6833
|
-
|
|
6865
|
+
mount(childVnode, parentNode, renderer, nextNode);
|
|
6866
|
+
nextNode = renderer.nextSibling(childVnode.elm);
|
|
6834
6867
|
}
|
|
6835
6868
|
}
|
|
6836
6869
|
}
|
|
@@ -6875,7 +6908,7 @@ function hasCorrectNodeType(vnode, node, nodeType, renderer) {
|
|
|
6875
6908
|
}
|
|
6876
6909
|
return true;
|
|
6877
6910
|
}
|
|
6878
|
-
function isMatchingElement(vnode, elm, renderer) {
|
|
6911
|
+
function isMatchingElement(vnode, elm, renderer, shouldValidateAttr = () => true) {
|
|
6879
6912
|
const { getProperty } = renderer;
|
|
6880
6913
|
if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
|
|
6881
6914
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -6883,10 +6916,14 @@ function isMatchingElement(vnode, elm, renderer) {
|
|
|
6883
6916
|
}
|
|
6884
6917
|
return false;
|
|
6885
6918
|
}
|
|
6886
|
-
const
|
|
6887
|
-
const
|
|
6888
|
-
|
|
6889
|
-
|
|
6919
|
+
const hasCompatibleAttrs = validateAttrs(vnode, elm, renderer, shouldValidateAttr);
|
|
6920
|
+
const hasCompatibleClass = shouldValidateAttr('class')
|
|
6921
|
+
? validateClassAttr(vnode, elm, renderer)
|
|
6922
|
+
: true;
|
|
6923
|
+
const hasCompatibleStyle = shouldValidateAttr('style')
|
|
6924
|
+
? validateStyleAttr(vnode, elm, renderer)
|
|
6925
|
+
: true;
|
|
6926
|
+
return hasCompatibleAttrs && hasCompatibleClass && hasCompatibleStyle;
|
|
6890
6927
|
}
|
|
6891
6928
|
function attributeValuesAreEqual(vnodeValue, value) {
|
|
6892
6929
|
const vnodeValueAsString = String(vnodeValue);
|
|
@@ -6901,12 +6938,15 @@ function attributeValuesAreEqual(vnodeValue, value) {
|
|
|
6901
6938
|
// In all other cases, the two values are not considered equal
|
|
6902
6939
|
return false;
|
|
6903
6940
|
}
|
|
6904
|
-
function validateAttrs(vnode, elm, renderer) {
|
|
6941
|
+
function validateAttrs(vnode, elm, renderer, shouldValidateAttr) {
|
|
6905
6942
|
const { data: { attrs = {} }, } = vnode;
|
|
6906
6943
|
let nodesAreCompatible = true;
|
|
6907
6944
|
// Validate attributes, though we could always recovery from those by running the update mods.
|
|
6908
6945
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
6909
6946
|
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
6947
|
+
if (!shouldValidateAttr(attrName)) {
|
|
6948
|
+
continue;
|
|
6949
|
+
}
|
|
6910
6950
|
const { owner } = vnode;
|
|
6911
6951
|
const { getAttribute } = renderer;
|
|
6912
6952
|
const elmAttrValue = getAttribute(elm, attrName);
|
|
@@ -7330,7 +7370,7 @@ function readonly(obj) {
|
|
|
7330
7370
|
}
|
|
7331
7371
|
return getReadOnlyProxy(obj);
|
|
7332
7372
|
}
|
|
7333
|
-
|
|
7373
|
+
/** version: 2.45.3 */
|
|
7334
7374
|
|
|
7335
7375
|
/*
|
|
7336
7376
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7592,6 +7632,7 @@ const hasCustomElements = isCustomElementRegistryAvailable();
|
|
|
7592
7632
|
* SPDX-License-Identifier: MIT
|
|
7593
7633
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7594
7634
|
*/
|
|
7635
|
+
new WeakMap();
|
|
7595
7636
|
// Creates a custom element for compat (legacy) browser environments
|
|
7596
7637
|
const createCustomElementCompat = (tagName, upgradeCallback) => {
|
|
7597
7638
|
const elm = document.createElement(tagName);
|
|
@@ -7718,7 +7759,7 @@ function rendererFactory(baseRenderer) {
|
|
|
7718
7759
|
const renderer = (function (exports) {
|
|
7719
7760
|
|
|
7720
7761
|
/**
|
|
7721
|
-
* Copyright (C)
|
|
7762
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
7722
7763
|
*/
|
|
7723
7764
|
/*
|
|
7724
7765
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7758,7 +7799,7 @@ function rendererFactory(baseRenderer) {
|
|
|
7758
7799
|
function isNull(obj) {
|
|
7759
7800
|
return obj === null;
|
|
7760
7801
|
}
|
|
7761
|
-
/** version: 2.45.
|
|
7802
|
+
/** version: 2.45.3 */
|
|
7762
7803
|
|
|
7763
7804
|
/*
|
|
7764
7805
|
* Copyright (c) 2023, salesforce.com, inc.
|
|
@@ -8377,7 +8418,7 @@ function registerContextProvider(elm, adapterContextToken, onContextSubscription
|
|
|
8377
8418
|
});
|
|
8378
8419
|
}));
|
|
8379
8420
|
}
|
|
8380
|
-
|
|
8421
|
+
/** version: 2.45.3 */
|
|
8381
8422
|
|
|
8382
8423
|
export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, freezeTemplate, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeShadowed as isNodeFromTemplate, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderer, rendererFactory, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
8383
8424
|
//# sourceMappingURL=engine-dom.js.map
|