lwc 2.13.1 → 2.13.4
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 +376 -170
- package/dist/engine-dom/iife/es2017/engine-dom.js +376 -169
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -2
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +222 -164
- package/dist/engine-dom/iife/es5/engine-dom.js +7562 -5758
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +5947 -4586
- package/dist/engine-dom/umd/es2017/engine-dom.js +376 -169
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -2
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +222 -164
- package/dist/engine-dom/umd/es5/engine-dom.js +7562 -5758
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +5947 -4586
- package/dist/engine-server/commonjs/es2017/engine-server.js +190 -72
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +190 -73
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +29 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +29 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +10 -13
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +4601 -3603
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +10 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +4424 -3481
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +29 -4
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +10 -13
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +4601 -3603
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +10 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +4424 -3481
- 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.min.js +1 -1
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +243 -258
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +243 -258
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +243 -258
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +243 -258
- package/package.json +7 -7
|
@@ -43,7 +43,7 @@ var assert = /*#__PURE__*/Object.freeze({
|
|
|
43
43
|
*/
|
|
44
44
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
45
45
|
const { isArray: isArray$1 } = Array;
|
|
46
|
-
const { filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, slice: ArraySlice, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
46
|
+
const { copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
47
47
|
const { fromCharCode: StringFromCharCode } = String;
|
|
48
48
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
49
49
|
function isUndefined$1(obj) {
|
|
@@ -417,9 +417,9 @@ const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
|
417
417
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
418
418
|
*/
|
|
419
419
|
// Increment whenever the LWC template compiler changes
|
|
420
|
-
const LWC_VERSION = "2.13.
|
|
420
|
+
const LWC_VERSION = "2.13.4";
|
|
421
421
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
422
|
-
/** version: 2.13.
|
|
422
|
+
/** version: 2.13.4 */
|
|
423
423
|
|
|
424
424
|
/*
|
|
425
425
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -464,6 +464,7 @@ if (typeof CustomEvent !== 'function') {
|
|
|
464
464
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
465
465
|
*/
|
|
466
466
|
const features = {
|
|
467
|
+
DUMMY_TEST_FLAG: null,
|
|
467
468
|
ENABLE_ELEMENT_PATCH: null,
|
|
468
469
|
ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST: null,
|
|
469
470
|
ENABLE_HMR: null,
|
|
@@ -527,10 +528,35 @@ function setFeatureFlagForTest(name, value) {
|
|
|
527
528
|
setFeatureFlag(name, value);
|
|
528
529
|
}
|
|
529
530
|
}
|
|
530
|
-
/** version: 2.13.
|
|
531
|
+
/** version: 2.13.4 */
|
|
531
532
|
|
|
532
533
|
/* proxy-compat-disable */
|
|
533
534
|
|
|
535
|
+
/*
|
|
536
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
537
|
+
* All rights reserved.
|
|
538
|
+
* SPDX-License-Identifier: MIT
|
|
539
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
540
|
+
*/
|
|
541
|
+
// @ts-ignore
|
|
542
|
+
|
|
543
|
+
if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
|
|
544
|
+
window.addEventListener('test-dummy-flag', () => {
|
|
545
|
+
let hasFlag = false;
|
|
546
|
+
|
|
547
|
+
if (runtimeFlags.DUMMY_TEST_FLAG) {
|
|
548
|
+
hasFlag = true;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
window.dispatchEvent(new CustomEvent('has-dummy-flag', {
|
|
552
|
+
detail: {
|
|
553
|
+
package: '@lwc/engine-core',
|
|
554
|
+
hasFlag
|
|
555
|
+
}
|
|
556
|
+
}));
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
|
|
534
560
|
/*
|
|
535
561
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
536
562
|
* All rights reserved.
|
|
@@ -604,10 +630,6 @@ let HTMLElementExported$1;
|
|
|
604
630
|
function setHTMLElement(HTMLElementImpl) {
|
|
605
631
|
HTMLElementExported$1 = HTMLElementImpl;
|
|
606
632
|
}
|
|
607
|
-
let isHydrating$1;
|
|
608
|
-
function setIsHydrating(isHydratingImpl) {
|
|
609
|
-
isHydrating$1 = isHydratingImpl;
|
|
610
|
-
}
|
|
611
633
|
let insert$1;
|
|
612
634
|
function setInsert(insertImpl) {
|
|
613
635
|
insert$1 = insertImpl;
|
|
@@ -728,10 +750,6 @@ let isConnected$1;
|
|
|
728
750
|
function setIsConnected(isConnectedImpl) {
|
|
729
751
|
isConnected$1 = isConnectedImpl;
|
|
730
752
|
}
|
|
731
|
-
let insertGlobalStylesheet$1;
|
|
732
|
-
function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
|
|
733
|
-
insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
|
|
734
|
-
}
|
|
735
753
|
let insertStylesheet$1;
|
|
736
754
|
function setInsertStylesheet(insertStylesheetImpl) {
|
|
737
755
|
insertStylesheet$1 = insertStylesheetImpl;
|
|
@@ -2816,6 +2834,12 @@ function checkVersionMismatch(func, type) {
|
|
|
2816
2834
|
}
|
|
2817
2835
|
}
|
|
2818
2836
|
|
|
2837
|
+
/*
|
|
2838
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
2839
|
+
* All rights reserved.
|
|
2840
|
+
* SPDX-License-Identifier: MIT
|
|
2841
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2842
|
+
*/
|
|
2819
2843
|
const signedTemplateSet = new Set();
|
|
2820
2844
|
function defaultEmptyTemplate() {
|
|
2821
2845
|
return [];
|
|
@@ -2833,6 +2857,32 @@ function registerTemplate(tpl) {
|
|
|
2833
2857
|
checkVersionMismatch(tpl, 'template');
|
|
2834
2858
|
}
|
|
2835
2859
|
signedTemplateSet.add(tpl);
|
|
2860
|
+
// FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
|
|
2861
|
+
// the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
|
|
2862
|
+
// on top of stylesheetToken for anyone who is accessing the old internal API.
|
|
2863
|
+
// Details: https://salesforce.quip.com/v1rmAFu2cKAr
|
|
2864
|
+
defineProperty(tpl, 'stylesheetTokens', {
|
|
2865
|
+
enumerable: true,
|
|
2866
|
+
configurable: true,
|
|
2867
|
+
get() {
|
|
2868
|
+
const { stylesheetToken } = this;
|
|
2869
|
+
if (isUndefined$1(stylesheetToken)) {
|
|
2870
|
+
return stylesheetToken;
|
|
2871
|
+
}
|
|
2872
|
+
// Shim for the old `stylesheetTokens` property
|
|
2873
|
+
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
2874
|
+
return {
|
|
2875
|
+
hostAttribute: `${stylesheetToken}-host`,
|
|
2876
|
+
shadowAttribute: stylesheetToken,
|
|
2877
|
+
};
|
|
2878
|
+
},
|
|
2879
|
+
set(value) {
|
|
2880
|
+
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
2881
|
+
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
2882
|
+
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
2883
|
+
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
2884
|
+
},
|
|
2885
|
+
});
|
|
2836
2886
|
// chaining this method as a way to wrap existing
|
|
2837
2887
|
// assignment of templates easily, without too much transformation
|
|
2838
2888
|
return tpl;
|
|
@@ -3776,15 +3826,16 @@ function mountVNodes(vnodes, parent, anchor, start = 0, end = vnodes.length) {
|
|
|
3776
3826
|
}
|
|
3777
3827
|
}
|
|
3778
3828
|
function unmount(vnode, parent, doRemove = false) {
|
|
3779
|
-
const { type, elm } = vnode;
|
|
3829
|
+
const { type, elm, sel } = vnode;
|
|
3780
3830
|
// When unmounting a VNode subtree not all the elements have to removed from the DOM. The
|
|
3781
3831
|
// subtree root, is the only element worth unmounting from the subtree.
|
|
3782
3832
|
if (doRemove) {
|
|
3783
3833
|
removeNode(elm, parent);
|
|
3784
3834
|
}
|
|
3835
|
+
const removeChildren = sel === 'slot'; // slot content is removed to trigger slotchange event when removing slot
|
|
3785
3836
|
switch (type) {
|
|
3786
3837
|
case 2 /* Element */:
|
|
3787
|
-
unmountVNodes(vnode.children, elm);
|
|
3838
|
+
unmountVNodes(vnode.children, elm, removeChildren);
|
|
3788
3839
|
break;
|
|
3789
3840
|
case 3 /* CustomElement */: {
|
|
3790
3841
|
const { vm } = vnode;
|
|
@@ -4702,10 +4753,10 @@ function createStylesheet(vm, stylesheets) {
|
|
|
4702
4753
|
const { renderMode, shadowMode } = vm;
|
|
4703
4754
|
if (renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */) {
|
|
4704
4755
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
4705
|
-
|
|
4756
|
+
insertStylesheet$1(stylesheets[i]);
|
|
4706
4757
|
}
|
|
4707
4758
|
}
|
|
4708
|
-
else if (ssr$1 ||
|
|
4759
|
+
else if (ssr$1 || vm.hydrated) {
|
|
4709
4760
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
4710
4761
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
4711
4762
|
// the first time the VM renders.
|
|
@@ -4716,15 +4767,10 @@ function createStylesheet(vm, stylesheets) {
|
|
|
4716
4767
|
else {
|
|
4717
4768
|
// native shadow or light DOM, DOM renderer
|
|
4718
4769
|
const root = getNearestNativeShadowComponent(vm);
|
|
4719
|
-
|
|
4770
|
+
// null root means a global style
|
|
4771
|
+
const target = isNull(root) ? undefined : root.shadowRoot;
|
|
4720
4772
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
4721
|
-
|
|
4722
|
-
insertGlobalStylesheet$1(stylesheets[i]);
|
|
4723
|
-
}
|
|
4724
|
-
else {
|
|
4725
|
-
// local level
|
|
4726
|
-
insertStylesheet$1(stylesheets[i], root.shadowRoot);
|
|
4727
|
-
}
|
|
4773
|
+
insertStylesheet$1(stylesheets[i], target);
|
|
4728
4774
|
}
|
|
4729
4775
|
}
|
|
4730
4776
|
return null;
|
|
@@ -5232,24 +5278,14 @@ function removeVM(vm) {
|
|
|
5232
5278
|
|
|
5233
5279
|
resetComponentStateWhenRemoved(vm);
|
|
5234
5280
|
}
|
|
5235
|
-
|
|
5236
|
-
function getNearestShadowAncestor(vm) {
|
|
5237
|
-
let ancestor = vm.owner;
|
|
5238
|
-
|
|
5239
|
-
while (!isNull(ancestor) && ancestor.renderMode === 0
|
|
5240
|
-
/* Light */
|
|
5241
|
-
) {
|
|
5242
|
-
ancestor = ancestor.owner;
|
|
5243
|
-
}
|
|
5244
|
-
|
|
5245
|
-
return ancestor;
|
|
5246
|
-
}
|
|
5247
|
-
|
|
5248
5281
|
function createVM(elm, ctor, options) {
|
|
5282
|
+
var _a;
|
|
5283
|
+
|
|
5249
5284
|
const {
|
|
5250
5285
|
mode,
|
|
5251
5286
|
owner,
|
|
5252
|
-
tagName
|
|
5287
|
+
tagName,
|
|
5288
|
+
hydrated
|
|
5253
5289
|
} = options;
|
|
5254
5290
|
const def = getComponentInternalDef(ctor);
|
|
5255
5291
|
const vm = {
|
|
@@ -5272,7 +5308,10 @@ function createVM(elm, ctor, options) {
|
|
|
5272
5308
|
cmpSlots: create(null),
|
|
5273
5309
|
oar: create(null),
|
|
5274
5310
|
cmpTemplate: null,
|
|
5311
|
+
hydrated: Boolean(hydrated),
|
|
5275
5312
|
renderMode: def.renderMode,
|
|
5313
|
+
shadowMode: computeShadowMode(def, owner),
|
|
5314
|
+
nearestShadowMode: (owner === null || owner === void 0 ? void 0 : owner.shadowRoot) ? owner.shadowMode : (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : null,
|
|
5276
5315
|
context: {
|
|
5277
5316
|
stylesheetToken: undefined,
|
|
5278
5317
|
hasTokenInClass: undefined,
|
|
@@ -5285,7 +5324,6 @@ function createVM(elm, ctor, options) {
|
|
|
5285
5324
|
},
|
|
5286
5325
|
// Properties set right after VM creation.
|
|
5287
5326
|
tro: null,
|
|
5288
|
-
shadowMode: null,
|
|
5289
5327
|
// Properties set by the LightningElement constructor.
|
|
5290
5328
|
component: null,
|
|
5291
5329
|
shadowRoot: null,
|
|
@@ -5294,7 +5332,6 @@ function createVM(elm, ctor, options) {
|
|
|
5294
5332
|
setHook,
|
|
5295
5333
|
getHook
|
|
5296
5334
|
};
|
|
5297
|
-
vm.shadowMode = computeShadowMode(vm);
|
|
5298
5335
|
vm.tro = getTemplateReactiveObserver(vm);
|
|
5299
5336
|
|
|
5300
5337
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -5319,10 +5356,9 @@ function createVM(elm, ctor, options) {
|
|
|
5319
5356
|
return vm;
|
|
5320
5357
|
}
|
|
5321
5358
|
|
|
5322
|
-
function computeShadowMode(
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
} = vm;
|
|
5359
|
+
function computeShadowMode(def, owner) {
|
|
5360
|
+
var _a;
|
|
5361
|
+
|
|
5326
5362
|
let shadowMode;
|
|
5327
5363
|
|
|
5328
5364
|
if (isSyntheticShadowDefined$1) {
|
|
@@ -5345,23 +5381,13 @@ function computeShadowMode(vm) {
|
|
|
5345
5381
|
/* Native */
|
|
5346
5382
|
;
|
|
5347
5383
|
} else {
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
if
|
|
5351
|
-
|
|
5352
|
-
)
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
shadowMode = 0
|
|
5356
|
-
/* Native */
|
|
5357
|
-
;
|
|
5358
|
-
} else {
|
|
5359
|
-
// Synthetic if neither this component nor any of its ancestors are configured
|
|
5360
|
-
// to be native.
|
|
5361
|
-
shadowMode = 1
|
|
5362
|
-
/* Synthetic */
|
|
5363
|
-
;
|
|
5364
|
-
}
|
|
5384
|
+
// Transitive support for native Shadow DOM. A component in native mode
|
|
5385
|
+
// transitively opts all of its descendants into native.
|
|
5386
|
+
// Synthetic if neither this component nor any of its ancestors are configured
|
|
5387
|
+
// to be native.
|
|
5388
|
+
shadowMode = (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : 1
|
|
5389
|
+
/* Synthetic */
|
|
5390
|
+
;
|
|
5365
5391
|
}
|
|
5366
5392
|
} else {
|
|
5367
5393
|
shadowMode = 1
|
|
@@ -6141,7 +6167,106 @@ function setHooks(hooks) {
|
|
|
6141
6167
|
hooksAreSet = true;
|
|
6142
6168
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
6143
6169
|
}
|
|
6144
|
-
|
|
6170
|
+
|
|
6171
|
+
/*
|
|
6172
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
6173
|
+
* All rights reserved.
|
|
6174
|
+
* SPDX-License-Identifier: MIT
|
|
6175
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6176
|
+
*/
|
|
6177
|
+
// See @lwc/engine-core/src/framework/template.ts
|
|
6178
|
+
const TEMPLATE_PROPS = ['slots', 'stylesheetToken', 'stylesheets', 'renderMode'];
|
|
6179
|
+
// Via https://www.npmjs.com/package/object-observer
|
|
6180
|
+
const ARRAY_MUTATION_METHODS = [
|
|
6181
|
+
'pop',
|
|
6182
|
+
'push',
|
|
6183
|
+
'shift',
|
|
6184
|
+
'unshift',
|
|
6185
|
+
'reverse',
|
|
6186
|
+
'sort',
|
|
6187
|
+
'fill',
|
|
6188
|
+
'splice',
|
|
6189
|
+
'copyWithin',
|
|
6190
|
+
];
|
|
6191
|
+
function getOriginalArrayMethod(prop) {
|
|
6192
|
+
switch (prop) {
|
|
6193
|
+
case 'pop':
|
|
6194
|
+
return ArrayPop;
|
|
6195
|
+
case 'push':
|
|
6196
|
+
return ArrayPush$1;
|
|
6197
|
+
case 'shift':
|
|
6198
|
+
return ArrayShift;
|
|
6199
|
+
case 'unshift':
|
|
6200
|
+
return ArrayUnshift;
|
|
6201
|
+
case 'reverse':
|
|
6202
|
+
return ArrayReverse;
|
|
6203
|
+
case 'sort':
|
|
6204
|
+
return ArraySort;
|
|
6205
|
+
case 'fill':
|
|
6206
|
+
return ArrayFill;
|
|
6207
|
+
case 'splice':
|
|
6208
|
+
return ArraySplice;
|
|
6209
|
+
case 'copyWithin':
|
|
6210
|
+
return ArrayCopyWithin;
|
|
6211
|
+
}
|
|
6212
|
+
}
|
|
6213
|
+
let mutationWarningsSilenced = false;
|
|
6214
|
+
// Warn if the user tries to mutate tmpl.stylesheets, e.g.:
|
|
6215
|
+
// `tmpl.stylesheets.push(someStylesheetFunction)`
|
|
6216
|
+
function warnOnArrayMutation(stylesheets) {
|
|
6217
|
+
// We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
|
|
6218
|
+
// we can at least warn when they use the most common mutation methods.
|
|
6219
|
+
for (const prop of ARRAY_MUTATION_METHODS) {
|
|
6220
|
+
const originalArrayMethod = getOriginalArrayMethod(prop);
|
|
6221
|
+
stylesheets[prop] = function arrayMutationWarningWrapper() {
|
|
6222
|
+
logError(`Mutating the "stylesheets" array on a template function ` +
|
|
6223
|
+
`is deprecated and may be removed in a future version of LWC.`);
|
|
6224
|
+
// @ts-ignore
|
|
6225
|
+
return originalArrayMethod.apply(this, arguments);
|
|
6226
|
+
};
|
|
6227
|
+
}
|
|
6228
|
+
}
|
|
6229
|
+
// TODO [#2782]: eventually freezeTemplate() will _actually_ freeze the tmpl object. Today it
|
|
6230
|
+
// just warns on mutation.
|
|
6231
|
+
function freezeTemplate(tmpl) {
|
|
6232
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6233
|
+
if (!isUndefined$1(tmpl.stylesheets)) {
|
|
6234
|
+
warnOnArrayMutation(tmpl.stylesheets);
|
|
6235
|
+
}
|
|
6236
|
+
for (const prop of TEMPLATE_PROPS) {
|
|
6237
|
+
let value = tmpl[prop];
|
|
6238
|
+
defineProperty(tmpl, prop, {
|
|
6239
|
+
enumerable: true,
|
|
6240
|
+
configurable: true,
|
|
6241
|
+
get() {
|
|
6242
|
+
return value;
|
|
6243
|
+
},
|
|
6244
|
+
set(newValue) {
|
|
6245
|
+
if (!mutationWarningsSilenced) {
|
|
6246
|
+
logError(`Dynamically setting the "${prop}" property on a template function ` +
|
|
6247
|
+
`is deprecated and may be removed in a future version of LWC.`);
|
|
6248
|
+
}
|
|
6249
|
+
value = newValue;
|
|
6250
|
+
},
|
|
6251
|
+
});
|
|
6252
|
+
}
|
|
6253
|
+
const originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
|
|
6254
|
+
defineProperty(tmpl, 'stylesheetTokens', {
|
|
6255
|
+
enumerable: true,
|
|
6256
|
+
configurable: true,
|
|
6257
|
+
get: originalDescriptor.get,
|
|
6258
|
+
set(value) {
|
|
6259
|
+
logError(`Dynamically setting the "stylesheetTokens" property on a template function ` +
|
|
6260
|
+
`is deprecated and may be removed in a future version of LWC.`);
|
|
6261
|
+
// Avoid logging twice (for both stylesheetToken and stylesheetTokens)
|
|
6262
|
+
mutationWarningsSilenced = true;
|
|
6263
|
+
originalDescriptor.set.call(this, value);
|
|
6264
|
+
mutationWarningsSilenced = false;
|
|
6265
|
+
},
|
|
6266
|
+
});
|
|
6267
|
+
}
|
|
6268
|
+
}
|
|
6269
|
+
/* version: 2.13.4 */
|
|
6145
6270
|
|
|
6146
6271
|
/*
|
|
6147
6272
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -6214,9 +6339,6 @@ class HTMLElementImpl {
|
|
|
6214
6339
|
}
|
|
6215
6340
|
}
|
|
6216
6341
|
const ssr = true;
|
|
6217
|
-
function isHydrating() {
|
|
6218
|
-
return false;
|
|
6219
|
-
}
|
|
6220
6342
|
const isNativeShadowDefined = false;
|
|
6221
6343
|
const isSyntheticShadowDefined = false;
|
|
6222
6344
|
function insert(node, parent, anchor) {
|
|
@@ -6417,9 +6539,6 @@ function isConnected(node) {
|
|
|
6417
6539
|
}
|
|
6418
6540
|
// Noop on SSR (for now). This need to be reevaluated whenever we will implement support for
|
|
6419
6541
|
// synthetic shadow.
|
|
6420
|
-
const insertGlobalStylesheet = noop;
|
|
6421
|
-
// Noop on SSR (for now). This need to be reevaluated whenever we will implement support for
|
|
6422
|
-
// synthetic shadow.
|
|
6423
6542
|
const insertStylesheet = noop;
|
|
6424
6543
|
// Noop on SSR.
|
|
6425
6544
|
const addEventListener = noop;
|
|
@@ -6475,10 +6594,7 @@ setGetLastElementChild(getLastElementChild);
|
|
|
6475
6594
|
setGetProperty(getProperty);
|
|
6476
6595
|
setHTMLElement(HTMLElementExported);
|
|
6477
6596
|
setInsert(insert);
|
|
6478
|
-
setInsertGlobalStylesheet(insertGlobalStylesheet);
|
|
6479
|
-
setInsertStylesheet(insertStylesheet);
|
|
6480
6597
|
setIsConnected(isConnected);
|
|
6481
|
-
setIsHydrating(isHydrating);
|
|
6482
6598
|
setIsNativeShadowDefined(isNativeShadowDefined);
|
|
6483
6599
|
setIsSyntheticShadowDefined(isSyntheticShadowDefined);
|
|
6484
6600
|
setNextSibling(nextSibling);
|
|
@@ -6493,6 +6609,7 @@ setSetProperty(setProperty);
|
|
|
6493
6609
|
setSetText(setText);
|
|
6494
6610
|
setSsr(ssr);
|
|
6495
6611
|
setAddEventListener(addEventListener);
|
|
6612
|
+
setInsertStylesheet(insertStylesheet);
|
|
6496
6613
|
|
|
6497
6614
|
/*
|
|
6498
6615
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -6608,6 +6725,6 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
6608
6725
|
*/
|
|
6609
6726
|
freeze(LightningElement);
|
|
6610
6727
|
seal(LightningElement.prototype);
|
|
6611
|
-
/* version: 2.13.
|
|
6728
|
+
/* version: 2.13.4 */
|
|
6612
6729
|
|
|
6613
|
-
export { LightningElement, api$1 as api, createContextProvider, getComponentDef, isComponentConstructor, readonly, register, registerComponent, registerDecorators, registerTemplate, renderComponent, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, track, unwrap, wire };
|
|
6730
|
+
export { LightningElement, api$1 as api, createContextProvider, freezeTemplate, getComponentDef, isComponentConstructor, readonly, register, registerComponent, registerDecorators, registerTemplate, renderComponent, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, track, unwrap, wire };
|
|
@@ -43,7 +43,7 @@ var assert = /*#__PURE__*/Object.freeze({
|
|
|
43
43
|
*/
|
|
44
44
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor, getOwnPropertyNames, getPrototypeOf, hasOwnProperty, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
45
45
|
const { isArray } = Array;
|
|
46
|
-
const { filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, push: ArrayPush, reduce: ArrayReduce, reverse: ArrayReverse, slice: ArraySlice, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
46
|
+
const { copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
47
47
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
48
48
|
function isUndefined(obj) {
|
|
49
49
|
return obj === undefined;
|
|
@@ -146,7 +146,7 @@ const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
|
146
146
|
// We use this to detect symbol support in order to avoid the expensive symbol polyfill. Note that
|
|
147
147
|
// we can't use typeof since it will fail when transpiling.
|
|
148
148
|
const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === 'Symbol(x)')();
|
|
149
|
-
/** version: 2.13.
|
|
149
|
+
/** version: 2.13.4 */
|
|
150
150
|
|
|
151
151
|
/*
|
|
152
152
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -1122,7 +1122,7 @@ if (!_globalThis.lwcRuntimeFlags) {
|
|
|
1122
1122
|
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
|
|
1123
1123
|
}
|
|
1124
1124
|
const runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
1125
|
-
/** version: 2.13.
|
|
1125
|
+
/** version: 2.13.4 */
|
|
1126
1126
|
|
|
1127
1127
|
/*
|
|
1128
1128
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5066,4 +5066,29 @@ defineProperty(Element.prototype, '$domManual$', {
|
|
|
5066
5066
|
},
|
|
5067
5067
|
configurable: true,
|
|
5068
5068
|
});
|
|
5069
|
-
|
|
5069
|
+
|
|
5070
|
+
/*
|
|
5071
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5072
|
+
* All rights reserved.
|
|
5073
|
+
* SPDX-License-Identifier: MIT
|
|
5074
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5075
|
+
*/
|
|
5076
|
+
// @ts-ignore
|
|
5077
|
+
|
|
5078
|
+
if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
|
|
5079
|
+
window.addEventListener('test-dummy-flag', () => {
|
|
5080
|
+
let hasFlag = false;
|
|
5081
|
+
|
|
5082
|
+
if (runtimeFlags.DUMMY_TEST_FLAG) {
|
|
5083
|
+
hasFlag = true;
|
|
5084
|
+
}
|
|
5085
|
+
|
|
5086
|
+
window.dispatchEvent(new CustomEvent('has-dummy-flag', {
|
|
5087
|
+
detail: {
|
|
5088
|
+
package: '@lwc/synthetic-shadow',
|
|
5089
|
+
hasFlag
|
|
5090
|
+
}
|
|
5091
|
+
}));
|
|
5092
|
+
});
|
|
5093
|
+
}
|
|
5094
|
+
/** version: 2.13.4 */
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
*/
|
|
47
47
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor, getOwnPropertyNames, getPrototypeOf, hasOwnProperty, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
48
48
|
const { isArray } = Array;
|
|
49
|
-
const { filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, push: ArrayPush, reduce: ArrayReduce, reverse: ArrayReverse, slice: ArraySlice, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
49
|
+
const { copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
50
50
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
51
51
|
function isUndefined(obj) {
|
|
52
52
|
return obj === undefined;
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
// We use this to detect symbol support in order to avoid the expensive symbol polyfill. Note that
|
|
150
150
|
// we can't use typeof since it will fail when transpiling.
|
|
151
151
|
const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === 'Symbol(x)')();
|
|
152
|
-
/** version: 2.13.
|
|
152
|
+
/** version: 2.13.4 */
|
|
153
153
|
|
|
154
154
|
/*
|
|
155
155
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -1125,7 +1125,7 @@
|
|
|
1125
1125
|
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
|
|
1126
1126
|
}
|
|
1127
1127
|
const runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
1128
|
-
/** version: 2.13.
|
|
1128
|
+
/** version: 2.13.4 */
|
|
1129
1129
|
|
|
1130
1130
|
/*
|
|
1131
1131
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5069,6 +5069,31 @@
|
|
|
5069
5069
|
},
|
|
5070
5070
|
configurable: true,
|
|
5071
5071
|
});
|
|
5072
|
-
|
|
5072
|
+
|
|
5073
|
+
/*
|
|
5074
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5075
|
+
* All rights reserved.
|
|
5076
|
+
* SPDX-License-Identifier: MIT
|
|
5077
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5078
|
+
*/
|
|
5079
|
+
// @ts-ignore
|
|
5080
|
+
|
|
5081
|
+
if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
|
|
5082
|
+
window.addEventListener('test-dummy-flag', () => {
|
|
5083
|
+
let hasFlag = false;
|
|
5084
|
+
|
|
5085
|
+
if (runtimeFlags.DUMMY_TEST_FLAG) {
|
|
5086
|
+
hasFlag = true;
|
|
5087
|
+
}
|
|
5088
|
+
|
|
5089
|
+
window.dispatchEvent(new CustomEvent('has-dummy-flag', {
|
|
5090
|
+
detail: {
|
|
5091
|
+
package: '@lwc/synthetic-shadow',
|
|
5092
|
+
hasFlag
|
|
5093
|
+
}
|
|
5094
|
+
}));
|
|
5095
|
+
});
|
|
5096
|
+
}
|
|
5097
|
+
/** version: 2.13.4 */
|
|
5073
5098
|
|
|
5074
5099
|
})();
|