lwc 2.31.1 → 2.32.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 +237 -264
- package/dist/engine-dom/iife/es2017/engine-dom.js +237 -264
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +109 -160
- package/dist/engine-dom/iife/es5/engine-dom.js +233 -242
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +142 -199
- package/dist/engine-dom/umd/es2017/engine-dom.js +237 -264
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +109 -160
- package/dist/engine-dom/umd/es5/engine-dom.js +233 -242
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +142 -199
- package/dist/engine-server/commonjs/es2017/engine-server.js +218 -224
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +218 -224
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +676 -909
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +676 -909
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +644 -882
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +85 -345
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +85 -345
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +676 -909
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +644 -882
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +85 -345
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +85 -345
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +7 -7
|
@@ -336,7 +336,7 @@
|
|
|
336
336
|
CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
|
|
337
337
|
return propertyName;
|
|
338
338
|
}
|
|
339
|
-
/** version: 2.
|
|
339
|
+
/** version: 2.32.1 */
|
|
340
340
|
|
|
341
341
|
/**
|
|
342
342
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -418,7 +418,7 @@
|
|
|
418
418
|
patch$1(propName);
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
/** version: 2.
|
|
421
|
+
/** version: 2.32.1 */
|
|
422
422
|
|
|
423
423
|
/**
|
|
424
424
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -432,19 +432,14 @@
|
|
|
432
432
|
*/
|
|
433
433
|
const features = {
|
|
434
434
|
DUMMY_TEST_FLAG: null,
|
|
435
|
-
ENABLE_ELEMENT_PATCH: null,
|
|
436
435
|
ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST: null,
|
|
437
|
-
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
438
|
-
ENABLE_INNER_OUTER_TEXT_PATCH: null,
|
|
439
436
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
440
437
|
ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE: null,
|
|
441
|
-
ENABLE_NODE_LIST_PATCH: null,
|
|
442
|
-
ENABLE_NODE_PATCH: null,
|
|
443
|
-
ENABLE_REACTIVE_SETTER: null,
|
|
444
438
|
ENABLE_WIRE_SYNC_EMIT: null,
|
|
445
439
|
ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null,
|
|
446
440
|
DISABLE_LIGHT_DOM_UNSCOPED_CSS: null,
|
|
447
441
|
ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY: null,
|
|
442
|
+
ENABLE_FROZEN_TEMPLATE: null,
|
|
448
443
|
};
|
|
449
444
|
if (!_globalThis.lwcRuntimeFlags) {
|
|
450
445
|
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
|
|
@@ -1700,45 +1695,6 @@
|
|
|
1700
1695
|
configurable: true,
|
|
1701
1696
|
};
|
|
1702
1697
|
}
|
|
1703
|
-
class AccessorReactiveObserver extends ReactiveObserver {
|
|
1704
|
-
constructor(vm, set) {
|
|
1705
|
-
super(() => {
|
|
1706
|
-
if (isFalse(this.debouncing)) {
|
|
1707
|
-
this.debouncing = true;
|
|
1708
|
-
addCallbackToNextTick(() => {
|
|
1709
|
-
if (isTrue(this.debouncing)) {
|
|
1710
|
-
const { value } = this;
|
|
1711
|
-
const { isDirty: dirtyStateBeforeSetterCall, component, idx } = vm;
|
|
1712
|
-
set.call(component, value);
|
|
1713
|
-
// de-bouncing after the call to the original setter to prevent
|
|
1714
|
-
// infinity loop if the setter itself is mutating things that
|
|
1715
|
-
// were accessed during the previous invocation.
|
|
1716
|
-
this.debouncing = false;
|
|
1717
|
-
if (isTrue(vm.isDirty) && isFalse(dirtyStateBeforeSetterCall) && idx > 0) {
|
|
1718
|
-
// immediate rehydration due to a setter driven mutation, otherwise
|
|
1719
|
-
// the component will get rendered on the second tick, which it is not
|
|
1720
|
-
// desirable.
|
|
1721
|
-
rerenderVM(vm);
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
|
-
});
|
|
1725
|
-
}
|
|
1726
|
-
});
|
|
1727
|
-
this.debouncing = false;
|
|
1728
|
-
}
|
|
1729
|
-
reset(value) {
|
|
1730
|
-
super.reset();
|
|
1731
|
-
this.debouncing = false;
|
|
1732
|
-
if (arguments.length > 0) {
|
|
1733
|
-
this.value = value;
|
|
1734
|
-
}
|
|
1735
|
-
}
|
|
1736
|
-
}
|
|
1737
|
-
function createAccessorReactiveObserver(vm, set) {
|
|
1738
|
-
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
1739
|
-
return new AccessorReactiveObserver(vm, set)
|
|
1740
|
-
;
|
|
1741
|
-
}
|
|
1742
1698
|
|
|
1743
1699
|
/*
|
|
1744
1700
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -1747,65 +1703,45 @@
|
|
|
1747
1703
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1748
1704
|
*/
|
|
1749
1705
|
function api$1() {
|
|
1750
|
-
|
|
1706
|
+
throw new Error();
|
|
1751
1707
|
}
|
|
1752
1708
|
function createPublicPropertyDescriptor(key) {
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1709
|
+
return {
|
|
1710
|
+
get() {
|
|
1711
|
+
const vm = getAssociatedVM(this);
|
|
1712
|
+
if (isBeingConstructed(vm)) {
|
|
1713
|
+
return;
|
|
1714
|
+
}
|
|
1715
|
+
componentValueObserved(vm, key);
|
|
1716
|
+
return vm.cmpProps[key];
|
|
1717
|
+
},
|
|
1718
|
+
set(newValue) {
|
|
1719
|
+
const vm = getAssociatedVM(this);
|
|
1720
|
+
vm.cmpProps[key] = newValue;
|
|
1721
|
+
componentValueMutated(vm, key);
|
|
1722
|
+
},
|
|
1723
|
+
enumerable: true,
|
|
1724
|
+
configurable: true,
|
|
1725
|
+
};
|
|
1770
1726
|
}
|
|
1771
1727
|
function createPublicAccessorDescriptor(key, descriptor) {
|
|
1772
|
-
|
|
1773
|
-
get
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
let ro = vm.oar[key];
|
|
1790
|
-
if (isUndefined$1(ro)) {
|
|
1791
|
-
ro = vm.oar[key] = createAccessorReactiveObserver(vm, set);
|
|
1792
|
-
}
|
|
1793
|
-
// every time we invoke this setter from outside (through this wrapper setter)
|
|
1794
|
-
// we should reset the value and then debounce just in case there is a pending
|
|
1795
|
-
// invocation the next tick that is not longer relevant since the value is changing
|
|
1796
|
-
// from outside.
|
|
1797
|
-
ro.reset(newValue);
|
|
1798
|
-
ro.observe(() => {
|
|
1799
|
-
set.call(this, newValue);
|
|
1800
|
-
});
|
|
1801
|
-
} else {
|
|
1802
|
-
set.call(this, newValue);
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
},
|
|
1806
|
-
enumerable,
|
|
1807
|
-
configurable
|
|
1808
|
-
};
|
|
1728
|
+
const { get, set, enumerable, configurable } = descriptor;
|
|
1729
|
+
if (!isFunction$1(get)) {
|
|
1730
|
+
throw new Error();
|
|
1731
|
+
}
|
|
1732
|
+
return {
|
|
1733
|
+
get() {
|
|
1734
|
+
return get.call(this);
|
|
1735
|
+
},
|
|
1736
|
+
set(newValue) {
|
|
1737
|
+
getAssociatedVM(this);
|
|
1738
|
+
if (set) {
|
|
1739
|
+
set.call(this, newValue);
|
|
1740
|
+
}
|
|
1741
|
+
},
|
|
1742
|
+
enumerable,
|
|
1743
|
+
configurable,
|
|
1744
|
+
};
|
|
1809
1745
|
}
|
|
1810
1746
|
|
|
1811
1747
|
/*
|
|
@@ -1987,12 +1923,6 @@
|
|
|
1987
1923
|
return isUndefined$1(meta) ? defaultMeta : meta;
|
|
1988
1924
|
}
|
|
1989
1925
|
|
|
1990
|
-
/*
|
|
1991
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
1992
|
-
* All rights reserved.
|
|
1993
|
-
* SPDX-License-Identifier: MIT
|
|
1994
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
1995
|
-
*/
|
|
1996
1926
|
const signedTemplateSet = new Set();
|
|
1997
1927
|
function defaultEmptyTemplate() {
|
|
1998
1928
|
return [];
|
|
@@ -2007,32 +1937,6 @@
|
|
|
2007
1937
|
*/
|
|
2008
1938
|
function registerTemplate(tpl) {
|
|
2009
1939
|
signedTemplateSet.add(tpl);
|
|
2010
|
-
// FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
|
|
2011
|
-
// the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
|
|
2012
|
-
// on top of stylesheetToken for anyone who is accessing the old internal API.
|
|
2013
|
-
// Details: https://salesforce.quip.com/v1rmAFu2cKAr
|
|
2014
|
-
defineProperty(tpl, 'stylesheetTokens', {
|
|
2015
|
-
enumerable: true,
|
|
2016
|
-
configurable: true,
|
|
2017
|
-
get() {
|
|
2018
|
-
const { stylesheetToken } = this;
|
|
2019
|
-
if (isUndefined$1(stylesheetToken)) {
|
|
2020
|
-
return stylesheetToken;
|
|
2021
|
-
}
|
|
2022
|
-
// Shim for the old `stylesheetTokens` property
|
|
2023
|
-
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
2024
|
-
return {
|
|
2025
|
-
hostAttribute: `${stylesheetToken}-host`,
|
|
2026
|
-
shadowAttribute: stylesheetToken,
|
|
2027
|
-
};
|
|
2028
|
-
},
|
|
2029
|
-
set(value) {
|
|
2030
|
-
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
2031
|
-
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
2032
|
-
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
2033
|
-
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
2034
|
-
},
|
|
2035
|
-
});
|
|
2036
1940
|
// chaining this method as a way to wrap existing
|
|
2037
1941
|
// assignment of templates easily, without too much transformation
|
|
2038
1942
|
return tpl;
|
|
@@ -3647,7 +3551,7 @@
|
|
|
3647
3551
|
// undefined is for root components, but root components cannot accept slotted content
|
|
3648
3552
|
setVMBeingRendered(slotset.owner);
|
|
3649
3553
|
try {
|
|
3650
|
-
ArrayPush$1.
|
|
3554
|
+
ArrayPush$1.call(newChildren, vnode.factory(data.slotData, data.key));
|
|
3651
3555
|
}
|
|
3652
3556
|
finally {
|
|
3653
3557
|
setVMBeingRendered(vmBeingRenderedInception);
|
|
@@ -4313,15 +4217,10 @@
|
|
|
4313
4217
|
} = vm;
|
|
4314
4218
|
if (state !== 2 /* VMState.disconnected */) {
|
|
4315
4219
|
const {
|
|
4316
|
-
oar,
|
|
4317
4220
|
tro
|
|
4318
4221
|
} = vm;
|
|
4319
4222
|
// Making sure that any observing record will not trigger the rehydrated on this vm
|
|
4320
4223
|
tro.reset();
|
|
4321
|
-
// Making sure that any observing accessor record will not trigger the setter to be reinvoked
|
|
4322
|
-
for (const key in oar) {
|
|
4323
|
-
oar[key].reset();
|
|
4324
|
-
}
|
|
4325
4224
|
runDisconnectedCallback(vm);
|
|
4326
4225
|
// Spec: https://dom.spec.whatwg.org/#concept-node-remove (step 14-15)
|
|
4327
4226
|
runChildNodesDisconnectedCallback(vm);
|
|
@@ -4368,7 +4267,6 @@
|
|
|
4368
4267
|
cmpSlots: {
|
|
4369
4268
|
slotAssignments: create(null)
|
|
4370
4269
|
},
|
|
4371
|
-
oar: create(null),
|
|
4372
4270
|
cmpTemplate: null,
|
|
4373
4271
|
hydrated: Boolean(hydrated),
|
|
4374
4272
|
renderMode: def.renderMode,
|
|
@@ -5398,9 +5296,60 @@
|
|
|
5398
5296
|
hooksAreSet = true;
|
|
5399
5297
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
5400
5298
|
}
|
|
5401
|
-
//
|
|
5402
|
-
|
|
5299
|
+
// Deeply freeze the entire array (of arrays) of stylesheet factory functions
|
|
5300
|
+
function deepFreeze(stylesheets) {
|
|
5301
|
+
traverseStylesheets(stylesheets, subStylesheets => {
|
|
5302
|
+
freeze(subStylesheets);
|
|
5303
|
+
});
|
|
5304
|
+
}
|
|
5305
|
+
// Deep-traverse an array (of arrays) of stylesheet factory functions, and call the callback for every array/function
|
|
5306
|
+
function traverseStylesheets(stylesheets, callback) {
|
|
5307
|
+
callback(stylesheets);
|
|
5308
|
+
for (let i = 0; i < stylesheets.length; i++) {
|
|
5309
|
+
const stylesheet = stylesheets[i];
|
|
5310
|
+
if (isArray$1(stylesheet)) {
|
|
5311
|
+
traverseStylesheets(stylesheet, callback);
|
|
5312
|
+
} else {
|
|
5313
|
+
callback(stylesheet);
|
|
5314
|
+
}
|
|
5315
|
+
}
|
|
5316
|
+
}
|
|
5403
5317
|
function freezeTemplate(tmpl) {
|
|
5318
|
+
if (lwcRuntimeFlags.ENABLE_FROZEN_TEMPLATE) {
|
|
5319
|
+
// Deep freeze the template
|
|
5320
|
+
freeze(tmpl);
|
|
5321
|
+
if (!isUndefined$1(tmpl.stylesheets)) {
|
|
5322
|
+
deepFreeze(tmpl.stylesheets);
|
|
5323
|
+
}
|
|
5324
|
+
} else {
|
|
5325
|
+
// TODO [#2782]: remove this flag and delete the legacy behavior
|
|
5326
|
+
// When ENABLE_FROZEN_TEMPLATE is false, then we shim stylesheetTokens on top of stylesheetToken for anyone who
|
|
5327
|
+
// is accessing the old internal API (backwards compat). Details: https://salesforce.quip.com/v1rmAFu2cKAr
|
|
5328
|
+
defineProperty(tmpl, 'stylesheetTokens', {
|
|
5329
|
+
enumerable: true,
|
|
5330
|
+
configurable: true,
|
|
5331
|
+
get() {
|
|
5332
|
+
const {
|
|
5333
|
+
stylesheetToken
|
|
5334
|
+
} = this;
|
|
5335
|
+
if (isUndefined$1(stylesheetToken)) {
|
|
5336
|
+
return stylesheetToken;
|
|
5337
|
+
}
|
|
5338
|
+
// Shim for the old `stylesheetTokens` property
|
|
5339
|
+
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
5340
|
+
return {
|
|
5341
|
+
hostAttribute: `${stylesheetToken}-host`,
|
|
5342
|
+
shadowAttribute: stylesheetToken
|
|
5343
|
+
};
|
|
5344
|
+
},
|
|
5345
|
+
set(value) {
|
|
5346
|
+
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
5347
|
+
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
5348
|
+
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
5349
|
+
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
5350
|
+
}
|
|
5351
|
+
});
|
|
5352
|
+
}
|
|
5404
5353
|
}
|
|
5405
5354
|
|
|
5406
5355
|
/*
|
|
@@ -6186,25 +6135,25 @@
|
|
|
6186
6135
|
// multiple times per tag name.
|
|
6187
6136
|
const createUserConstructor = (HTMLElementToExtend, upgradeCallback, connectedCallback, disconnectedCallback) => {
|
|
6188
6137
|
// TODO [#2972]: this class should expose observedAttributes as necessary
|
|
6189
|
-
class UserConstructor extends HTMLElementToExtend {
|
|
6138
|
+
return class UserConstructor extends HTMLElementToExtend {
|
|
6190
6139
|
constructor() {
|
|
6191
6140
|
super();
|
|
6192
6141
|
upgradeCallback(this);
|
|
6193
6142
|
}
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6143
|
+
// Note that there is no need to do the "avoid defining connectedCallback/disconnectedCallback" optimization
|
|
6144
|
+
// here, because in create-scoped-registry.ts, the registered class will always have these callbacks anyway.
|
|
6145
|
+
// See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
|
|
6146
|
+
connectedCallback() {
|
|
6147
|
+
if (!isUndefined$1(connectedCallback)) {
|
|
6148
|
+
connectedCallback(this);
|
|
6149
|
+
}
|
|
6150
|
+
}
|
|
6151
|
+
disconnectedCallback() {
|
|
6152
|
+
if (!isUndefined$1(disconnectedCallback)) {
|
|
6153
|
+
disconnectedCallback(this);
|
|
6154
|
+
}
|
|
6155
|
+
}
|
|
6156
|
+
};
|
|
6208
6157
|
};
|
|
6209
6158
|
function createCustomElementScoped(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
|
|
6210
6159
|
if (isUndefined$1(createScopedConstructor) || isUndefined$1(CachedHTMLElement)) {
|
|
@@ -6308,7 +6257,7 @@
|
|
|
6308
6257
|
function isNull(obj) {
|
|
6309
6258
|
return obj === null;
|
|
6310
6259
|
}
|
|
6311
|
-
/** version: 2.
|
|
6260
|
+
/** version: 2.32.1 */
|
|
6312
6261
|
|
|
6313
6262
|
/*
|
|
6314
6263
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6861,7 +6810,7 @@
|
|
|
6861
6810
|
});
|
|
6862
6811
|
freeze(LightningElement);
|
|
6863
6812
|
seal(LightningElement.prototype);
|
|
6864
|
-
/* version: 2.
|
|
6813
|
+
/* version: 2.32.1 */
|
|
6865
6814
|
|
|
6866
6815
|
exports.LightningElement = LightningElement;
|
|
6867
6816
|
exports.__unstable__ProfilerControl = profilerControl;
|