lwc 2.35.2 → 2.36.0
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 +245 -89
- package/dist/engine-dom/iife/es2017/engine-dom.js +245 -89
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +273 -45
- package/dist/engine-dom/iife/es5/engine-dom.js +402 -232
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +449 -161
- package/dist/engine-dom/umd/es2017/engine-dom.js +245 -89
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +273 -45
- package/dist/engine-dom/umd/es5/engine-dom.js +402 -232
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +449 -161
- package/dist/engine-server/commonjs/es2017/engine-server.js +124 -77
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +124 -77
- 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 +7 -7
|
@@ -321,7 +321,7 @@ var LWC = (function (exports) {
|
|
|
321
321
|
CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
|
|
322
322
|
return propertyName;
|
|
323
323
|
}
|
|
324
|
-
/** version: 2.
|
|
324
|
+
/** version: 2.36.0 */
|
|
325
325
|
|
|
326
326
|
/**
|
|
327
327
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -389,7 +389,7 @@ var LWC = (function (exports) {
|
|
|
389
389
|
*/
|
|
390
390
|
function setFeatureFlagForTest(name, value) {
|
|
391
391
|
}
|
|
392
|
-
/** version: 2.
|
|
392
|
+
/** version: 2.36.0 */
|
|
393
393
|
|
|
394
394
|
/**
|
|
395
395
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -453,7 +453,7 @@ var LWC = (function (exports) {
|
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
/** version: 2.
|
|
456
|
+
/** version: 2.36.0 */
|
|
457
457
|
|
|
458
458
|
/*
|
|
459
459
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -473,7 +473,6 @@ var LWC = (function (exports) {
|
|
|
473
473
|
* SPDX-License-Identifier: MIT
|
|
474
474
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
475
475
|
*/
|
|
476
|
-
/** Callbacks to invoke when reporting is enabled **/
|
|
477
476
|
const onReportingEnabledCallbacks = [];
|
|
478
477
|
/** The currently assigned reporting dispatcher. */
|
|
479
478
|
let currentDispatcher$1 = noop;
|
|
@@ -531,11 +530,11 @@ var LWC = (function (exports) {
|
|
|
531
530
|
/**
|
|
532
531
|
* Report to the current dispatcher, if there is one.
|
|
533
532
|
* @param reportingEventId
|
|
534
|
-
* @param
|
|
533
|
+
* @param payload - data to report
|
|
535
534
|
*/
|
|
536
|
-
function report(reportingEventId,
|
|
535
|
+
function report(reportingEventId, payload) {
|
|
537
536
|
if (enabled$1) {
|
|
538
|
-
currentDispatcher$1(reportingEventId,
|
|
537
|
+
currentDispatcher$1(reportingEventId, payload);
|
|
539
538
|
}
|
|
540
539
|
}
|
|
541
540
|
|
|
@@ -781,7 +780,7 @@ var LWC = (function (exports) {
|
|
|
781
780
|
// Make a shallow copy of an object but omit the given key
|
|
782
781
|
function cloneAndOmitKey(object, keyToOmit) {
|
|
783
782
|
const result = {};
|
|
784
|
-
for (const key of
|
|
783
|
+
for (const key of keys(object)) {
|
|
785
784
|
if (key !== keyToOmit) {
|
|
786
785
|
result[key] = object[key];
|
|
787
786
|
}
|
|
@@ -791,7 +790,7 @@ var LWC = (function (exports) {
|
|
|
791
790
|
function flattenStylesheets(stylesheets) {
|
|
792
791
|
const list = [];
|
|
793
792
|
for (const stylesheet of stylesheets) {
|
|
794
|
-
if (!
|
|
793
|
+
if (!isArray$1(stylesheet)) {
|
|
795
794
|
list.push(stylesheet);
|
|
796
795
|
}
|
|
797
796
|
else {
|
|
@@ -3756,7 +3755,12 @@ var LWC = (function (exports) {
|
|
|
3756
3755
|
} else if (isVScopedSlotFragment(vnode)) {
|
|
3757
3756
|
slotName = vnode.slotName;
|
|
3758
3757
|
}
|
|
3759
|
-
|
|
3758
|
+
// Can't use toString here because Symbol(1).toString() is 'Symbol(1)'
|
|
3759
|
+
// but elm.setAttribute('slot', Symbol(1)) is an error.
|
|
3760
|
+
// the following line also throws same error for symbols
|
|
3761
|
+
// Similar for Object.create(null)
|
|
3762
|
+
const normalizedSlotName = '' + slotName;
|
|
3763
|
+
const vnodes = cmpSlotsMapping[normalizedSlotName] = cmpSlotsMapping[normalizedSlotName] || [];
|
|
3760
3764
|
ArrayPush$1.call(vnodes, vnode);
|
|
3761
3765
|
}
|
|
3762
3766
|
vm.cmpSlots = {
|
|
@@ -5189,7 +5193,7 @@ var LWC = (function (exports) {
|
|
|
5189
5193
|
function isSyntheticShadowRootInstance(rootNode) {
|
|
5190
5194
|
return rootNode !== document && isTrue(rootNode.synthetic);
|
|
5191
5195
|
}
|
|
5192
|
-
function reportViolation(source, target, attrName) {
|
|
5196
|
+
function reportViolation$1(source, target, attrName) {
|
|
5193
5197
|
// The vm is either for the source, the target, or both. Either one or both must be using synthetic
|
|
5194
5198
|
// shadow for a violation to be detected.
|
|
5195
5199
|
let vm = getAssociatedVMIfPresent(source.getRootNode().host);
|
|
@@ -5200,7 +5204,10 @@ var LWC = (function (exports) {
|
|
|
5200
5204
|
// vm should never be undefined here, but just to be safe, bail out and don't report
|
|
5201
5205
|
return;
|
|
5202
5206
|
}
|
|
5203
|
-
report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */,
|
|
5207
|
+
report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */, {
|
|
5208
|
+
tagName: vm.tagName,
|
|
5209
|
+
attributeName: attrName,
|
|
5210
|
+
});
|
|
5204
5211
|
}
|
|
5205
5212
|
function parseIdRefAttributeValue(attrValue) {
|
|
5206
5213
|
// split on whitespace and skip empty strings after splitting
|
|
@@ -5226,7 +5233,7 @@ var LWC = (function (exports) {
|
|
|
5226
5233
|
const sourceElement = sourceElements[i];
|
|
5227
5234
|
const sourceRoot = sourceElement.getRootNode();
|
|
5228
5235
|
if (sourceRoot !== root) {
|
|
5229
|
-
reportViolation(sourceElement, elm);
|
|
5236
|
+
reportViolation$1(sourceElement, elm, idRefAttrName);
|
|
5230
5237
|
break;
|
|
5231
5238
|
}
|
|
5232
5239
|
}
|
|
@@ -5241,7 +5248,7 @@ var LWC = (function (exports) {
|
|
|
5241
5248
|
const targetRoot = target.getRootNode();
|
|
5242
5249
|
if (targetRoot !== root) {
|
|
5243
5250
|
// target element's shadow root is not the same as ours
|
|
5244
|
-
reportViolation(elm, target);
|
|
5251
|
+
reportViolation$1(elm, target, attrName);
|
|
5245
5252
|
}
|
|
5246
5253
|
}
|
|
5247
5254
|
}
|
|
@@ -5250,7 +5257,7 @@ var LWC = (function (exports) {
|
|
|
5250
5257
|
let enabled = false;
|
|
5251
5258
|
// We want to avoid patching globals whenever possible, so this should be tree-shaken out in prod-mode and if
|
|
5252
5259
|
// reporting is not enabled. It should also only run once
|
|
5253
|
-
function enableDetection() {
|
|
5260
|
+
function enableDetection$1() {
|
|
5254
5261
|
if (enabled) {
|
|
5255
5262
|
return; // don't double-apply the patches
|
|
5256
5263
|
}
|
|
@@ -5303,10 +5310,94 @@ var LWC = (function (exports) {
|
|
|
5303
5310
|
// Always run detection in dev mode, so we can at least print to the console
|
|
5304
5311
|
{
|
|
5305
5312
|
// In prod mode, only enable detection if reporting is enabled
|
|
5306
|
-
onReportingEnabled(enableDetection);
|
|
5313
|
+
onReportingEnabled(enableDetection$1);
|
|
5307
5314
|
}
|
|
5308
5315
|
}
|
|
5309
5316
|
|
|
5317
|
+
/*
|
|
5318
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5319
|
+
* All rights reserved.
|
|
5320
|
+
* SPDX-License-Identifier: MIT
|
|
5321
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5322
|
+
*/
|
|
5323
|
+
//
|
|
5324
|
+
// The goal of this code is to detect usages of non-standard reflected ARIA properties. These are caused by
|
|
5325
|
+
// legacy non-standard Element.prototype extensions added by the @lwc/aria-reflection package.
|
|
5326
|
+
//
|
|
5327
|
+
// See the README for @lwc/aria-reflection
|
|
5328
|
+
const NON_STANDARD_ARIA_PROPS = ['ariaActiveDescendant', 'ariaControls', 'ariaDescribedBy', 'ariaDetails', 'ariaErrorMessage', 'ariaFlowTo', 'ariaLabelledBy', 'ariaOwns'];
|
|
5329
|
+
function isLightningElement(elm) {
|
|
5330
|
+
// The former case is for `this.prop` (inside component) and the latter is for `element.prop` (outside component).
|
|
5331
|
+
// In both cases, we apply the non-standard prop even when the global polyfill is disabled, so this is kosher.
|
|
5332
|
+
return elm instanceof LightningElement || elm instanceof BaseBridgeElement;
|
|
5333
|
+
}
|
|
5334
|
+
function findVM(elm) {
|
|
5335
|
+
// If it's a shadow DOM component, then it has a host
|
|
5336
|
+
const {
|
|
5337
|
+
host
|
|
5338
|
+
} = elm.getRootNode();
|
|
5339
|
+
const vm = isUndefined$1(host) ? undefined : getAssociatedVMIfPresent(host);
|
|
5340
|
+
if (!isUndefined$1(vm)) {
|
|
5341
|
+
return vm;
|
|
5342
|
+
}
|
|
5343
|
+
// Else it might be a light DOM component. Walk up the tree trying to find the owner
|
|
5344
|
+
let parentElement = elm;
|
|
5345
|
+
while (!isNull(parentElement = parentElement.parentElement)) {
|
|
5346
|
+
if (isLightningElement(parentElement)) {
|
|
5347
|
+
const vm = getAssociatedVMIfPresent(parentElement);
|
|
5348
|
+
if (!isUndefined$1(vm)) {
|
|
5349
|
+
return vm;
|
|
5350
|
+
}
|
|
5351
|
+
}
|
|
5352
|
+
}
|
|
5353
|
+
// If we return undefined, it's because the element was rendered wholly outside a LightningElement
|
|
5354
|
+
}
|
|
5355
|
+
|
|
5356
|
+
function checkAndReportViolation(elm, prop) {
|
|
5357
|
+
if (!isLightningElement(elm)) {
|
|
5358
|
+
const vm = findVM(elm);
|
|
5359
|
+
report(2 /* ReportingEventId.NonStandardAriaReflection */, {
|
|
5360
|
+
tagName: vm === null || vm === void 0 ? void 0 : vm.tagName,
|
|
5361
|
+
propertyName: prop
|
|
5362
|
+
});
|
|
5363
|
+
}
|
|
5364
|
+
}
|
|
5365
|
+
function enableDetection() {
|
|
5366
|
+
const {
|
|
5367
|
+
prototype
|
|
5368
|
+
} = Element;
|
|
5369
|
+
for (const prop of NON_STANDARD_ARIA_PROPS) {
|
|
5370
|
+
const descriptor = getOwnPropertyDescriptor$1(prototype, prop);
|
|
5371
|
+
// @ts-ignore
|
|
5372
|
+
const {
|
|
5373
|
+
get,
|
|
5374
|
+
set
|
|
5375
|
+
} = descriptor;
|
|
5376
|
+
defineProperty(prototype, prop, {
|
|
5377
|
+
get() {
|
|
5378
|
+
checkAndReportViolation(this, prop);
|
|
5379
|
+
return get.call(this);
|
|
5380
|
+
},
|
|
5381
|
+
set(val) {
|
|
5382
|
+
checkAndReportViolation(this, prop);
|
|
5383
|
+
return set.call(this, val);
|
|
5384
|
+
},
|
|
5385
|
+
configurable: true,
|
|
5386
|
+
enumerable: true
|
|
5387
|
+
});
|
|
5388
|
+
}
|
|
5389
|
+
}
|
|
5390
|
+
// No point in running this code if we're not in a browser, or if the global polyfill is not loaded
|
|
5391
|
+
{
|
|
5392
|
+
if (!lwcRuntimeFlags.DISABLE_ARIA_REFLECTION_POLYFILL) {
|
|
5393
|
+
// Always run detection in dev mode, so we can at least print to the console
|
|
5394
|
+
{
|
|
5395
|
+
// In prod mode, only enable detection if reporting is enabled
|
|
5396
|
+
onReportingEnabled(enableDetection);
|
|
5397
|
+
}
|
|
5398
|
+
}
|
|
5399
|
+
}
|
|
5400
|
+
|
|
5310
5401
|
/*
|
|
5311
5402
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
5312
5403
|
* All rights reserved.
|
|
@@ -5711,6 +5802,97 @@ var LWC = (function (exports) {
|
|
|
5711
5802
|
hooksAreSet = true;
|
|
5712
5803
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
5713
5804
|
}
|
|
5805
|
+
|
|
5806
|
+
/*
|
|
5807
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5808
|
+
* All rights reserved.
|
|
5809
|
+
* SPDX-License-Identifier: MIT
|
|
5810
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5811
|
+
*/
|
|
5812
|
+
// See @lwc/engine-core/src/framework/template.ts
|
|
5813
|
+
const TEMPLATE_PROPS = ['slots', 'stylesheetToken', 'stylesheets', 'renderMode'];
|
|
5814
|
+
// Expandos that may be placed on a stylesheet factory function, and which are meaningful to LWC at runtime
|
|
5815
|
+
const STYLESHEET_PROPS = [
|
|
5816
|
+
// SEE `KEY__SCOPED_CSS` in @lwc/style-compiler
|
|
5817
|
+
'$scoped$'];
|
|
5818
|
+
// Via https://www.npmjs.com/package/object-observer
|
|
5819
|
+
const ARRAY_MUTATION_METHODS = ['pop', 'push', 'shift', 'unshift', 'reverse', 'sort', 'fill', 'splice', 'copyWithin'];
|
|
5820
|
+
let mutationTrackingDisabled = false;
|
|
5821
|
+
function getOriginalArrayMethod(prop) {
|
|
5822
|
+
switch (prop) {
|
|
5823
|
+
case 'pop':
|
|
5824
|
+
return ArrayPop;
|
|
5825
|
+
case 'push':
|
|
5826
|
+
return ArrayPush$1;
|
|
5827
|
+
case 'shift':
|
|
5828
|
+
return ArrayShift;
|
|
5829
|
+
case 'unshift':
|
|
5830
|
+
return ArrayUnshift;
|
|
5831
|
+
case 'reverse':
|
|
5832
|
+
return ArrayReverse;
|
|
5833
|
+
case 'sort':
|
|
5834
|
+
return ArraySort;
|
|
5835
|
+
case 'fill':
|
|
5836
|
+
return ArrayFill;
|
|
5837
|
+
case 'splice':
|
|
5838
|
+
return ArraySplice;
|
|
5839
|
+
case 'copyWithin':
|
|
5840
|
+
return ArrayCopyWithin;
|
|
5841
|
+
}
|
|
5842
|
+
}
|
|
5843
|
+
function reportViolation(type, eventId, prop) {
|
|
5844
|
+
report(eventId, {
|
|
5845
|
+
propertyName: prop
|
|
5846
|
+
});
|
|
5847
|
+
}
|
|
5848
|
+
function reportTemplateViolation(prop) {
|
|
5849
|
+
reportViolation('template', 3 /* ReportingEventId.TemplateMutation */, prop);
|
|
5850
|
+
}
|
|
5851
|
+
function reportStylesheetViolation(prop) {
|
|
5852
|
+
reportViolation('stylesheet', 4 /* ReportingEventId.StylesheetMutation */, prop);
|
|
5853
|
+
}
|
|
5854
|
+
// Warn if the user tries to mutate a stylesheets array, e.g.:
|
|
5855
|
+
// `tmpl.stylesheets.push(someStylesheetFunction)`
|
|
5856
|
+
function warnOnArrayMutation(stylesheets) {
|
|
5857
|
+
// We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
|
|
5858
|
+
// we can at least warn when they use the most common mutation methods.
|
|
5859
|
+
for (const prop of ARRAY_MUTATION_METHODS) {
|
|
5860
|
+
const originalArrayMethod = getOriginalArrayMethod(prop);
|
|
5861
|
+
stylesheets[prop] = function arrayMutationWarningWrapper() {
|
|
5862
|
+
reportTemplateViolation('stylesheets');
|
|
5863
|
+
// @ts-ignore
|
|
5864
|
+
return originalArrayMethod.apply(this, arguments);
|
|
5865
|
+
};
|
|
5866
|
+
}
|
|
5867
|
+
}
|
|
5868
|
+
// Warn if the user tries to mutate a stylesheet factory function, e.g.:
|
|
5869
|
+
// `stylesheet.$scoped$ = true`
|
|
5870
|
+
function warnOnStylesheetFunctionMutation(stylesheet) {
|
|
5871
|
+
for (const prop of STYLESHEET_PROPS) {
|
|
5872
|
+
let value = stylesheet[prop];
|
|
5873
|
+
defineProperty(stylesheet, prop, {
|
|
5874
|
+
enumerable: true,
|
|
5875
|
+
configurable: true,
|
|
5876
|
+
get() {
|
|
5877
|
+
return value;
|
|
5878
|
+
},
|
|
5879
|
+
set(newValue) {
|
|
5880
|
+
reportStylesheetViolation(prop);
|
|
5881
|
+
value = newValue;
|
|
5882
|
+
}
|
|
5883
|
+
});
|
|
5884
|
+
}
|
|
5885
|
+
}
|
|
5886
|
+
// Warn on either array or stylesheet (function) mutation, in a deeply-nested array
|
|
5887
|
+
function trackStylesheetsMutation(stylesheets) {
|
|
5888
|
+
traverseStylesheets(stylesheets, subStylesheets => {
|
|
5889
|
+
if (isArray$1(subStylesheets)) {
|
|
5890
|
+
warnOnArrayMutation(subStylesheets);
|
|
5891
|
+
} else {
|
|
5892
|
+
warnOnStylesheetFunctionMutation(subStylesheets);
|
|
5893
|
+
}
|
|
5894
|
+
});
|
|
5895
|
+
}
|
|
5714
5896
|
// Deeply freeze the entire array (of arrays) of stylesheet factory functions
|
|
5715
5897
|
function deepFreeze(stylesheets) {
|
|
5716
5898
|
traverseStylesheets(stylesheets, subStylesheets => {
|
|
@@ -5729,7 +5911,70 @@ var LWC = (function (exports) {
|
|
|
5729
5911
|
}
|
|
5730
5912
|
}
|
|
5731
5913
|
}
|
|
5914
|
+
function trackMutations(tmpl) {
|
|
5915
|
+
if (!isUndefined$1(tmpl.stylesheets)) {
|
|
5916
|
+
trackStylesheetsMutation(tmpl.stylesheets);
|
|
5917
|
+
}
|
|
5918
|
+
for (const prop of TEMPLATE_PROPS) {
|
|
5919
|
+
let value = tmpl[prop];
|
|
5920
|
+
defineProperty(tmpl, prop, {
|
|
5921
|
+
enumerable: true,
|
|
5922
|
+
configurable: true,
|
|
5923
|
+
get() {
|
|
5924
|
+
return value;
|
|
5925
|
+
},
|
|
5926
|
+
set(newValue) {
|
|
5927
|
+
if (!mutationTrackingDisabled) {
|
|
5928
|
+
reportTemplateViolation(prop);
|
|
5929
|
+
}
|
|
5930
|
+
value = newValue;
|
|
5931
|
+
}
|
|
5932
|
+
});
|
|
5933
|
+
}
|
|
5934
|
+
const originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
|
|
5935
|
+
defineProperty(tmpl, 'stylesheetTokens', {
|
|
5936
|
+
enumerable: true,
|
|
5937
|
+
configurable: true,
|
|
5938
|
+
get: originalDescriptor.get,
|
|
5939
|
+
set(value) {
|
|
5940
|
+
reportTemplateViolation('stylesheetTokens');
|
|
5941
|
+
// Avoid logging/reporting twice (for both stylesheetToken and stylesheetTokens)
|
|
5942
|
+
mutationTrackingDisabled = true;
|
|
5943
|
+
originalDescriptor.set.call(this, value);
|
|
5944
|
+
mutationTrackingDisabled = false;
|
|
5945
|
+
}
|
|
5946
|
+
});
|
|
5947
|
+
}
|
|
5948
|
+
function addLegacyStylesheetTokensShim(tmpl) {
|
|
5949
|
+
// When ENABLE_FROZEN_TEMPLATE is false, then we shim stylesheetTokens on top of stylesheetToken for anyone who
|
|
5950
|
+
// is accessing the old internal API (backwards compat). Details: https://salesforce.quip.com/v1rmAFu2cKAr
|
|
5951
|
+
defineProperty(tmpl, 'stylesheetTokens', {
|
|
5952
|
+
enumerable: true,
|
|
5953
|
+
configurable: true,
|
|
5954
|
+
get() {
|
|
5955
|
+
const {
|
|
5956
|
+
stylesheetToken
|
|
5957
|
+
} = this;
|
|
5958
|
+
if (isUndefined$1(stylesheetToken)) {
|
|
5959
|
+
return stylesheetToken;
|
|
5960
|
+
}
|
|
5961
|
+
// Shim for the old `stylesheetTokens` property
|
|
5962
|
+
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
5963
|
+
return {
|
|
5964
|
+
hostAttribute: `${stylesheetToken}-host`,
|
|
5965
|
+
shadowAttribute: stylesheetToken
|
|
5966
|
+
};
|
|
5967
|
+
},
|
|
5968
|
+
set(value) {
|
|
5969
|
+
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
5970
|
+
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
5971
|
+
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
5972
|
+
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
5973
|
+
}
|
|
5974
|
+
});
|
|
5975
|
+
}
|
|
5732
5976
|
function freezeTemplate(tmpl) {
|
|
5977
|
+
// TODO [#2782]: remove this flag and delete the legacy behavior
|
|
5733
5978
|
if (lwcRuntimeFlags.ENABLE_FROZEN_TEMPLATE) {
|
|
5734
5979
|
// Deep freeze the template
|
|
5735
5980
|
freeze(tmpl);
|
|
@@ -5737,33 +5982,16 @@ var LWC = (function (exports) {
|
|
|
5737
5982
|
deepFreeze(tmpl.stylesheets);
|
|
5738
5983
|
}
|
|
5739
5984
|
} else {
|
|
5740
|
-
//
|
|
5741
|
-
//
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
if (isUndefined$1(stylesheetToken)) {
|
|
5751
|
-
return stylesheetToken;
|
|
5752
|
-
}
|
|
5753
|
-
// Shim for the old `stylesheetTokens` property
|
|
5754
|
-
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
5755
|
-
return {
|
|
5756
|
-
hostAttribute: `${stylesheetToken}-host`,
|
|
5757
|
-
shadowAttribute: stylesheetToken
|
|
5758
|
-
};
|
|
5759
|
-
},
|
|
5760
|
-
set(value) {
|
|
5761
|
-
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
5762
|
-
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
5763
|
-
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
5764
|
-
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
5765
|
-
}
|
|
5766
|
-
});
|
|
5985
|
+
// template is not frozen - shim, report, and warn
|
|
5986
|
+
// this shim should be applied in both dev and prod
|
|
5987
|
+
addLegacyStylesheetTokensShim(tmpl);
|
|
5988
|
+
// When ENABLE_FROZEN_TEMPLATE is false, we want to warn in dev mode whenever someone is mutating the template
|
|
5989
|
+
{
|
|
5990
|
+
// In prod mode, we only track mutations if reporting is enabled
|
|
5991
|
+
onReportingEnabled(() => {
|
|
5992
|
+
trackMutations(tmpl);
|
|
5993
|
+
});
|
|
5994
|
+
}
|
|
5767
5995
|
}
|
|
5768
5996
|
}
|
|
5769
5997
|
|
|
@@ -6672,7 +6900,7 @@ var LWC = (function (exports) {
|
|
|
6672
6900
|
function isNull(obj) {
|
|
6673
6901
|
return obj === null;
|
|
6674
6902
|
}
|
|
6675
|
-
/** version: 2.
|
|
6903
|
+
/** version: 2.36.0 */
|
|
6676
6904
|
|
|
6677
6905
|
/*
|
|
6678
6906
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7225,7 +7453,7 @@ var LWC = (function (exports) {
|
|
|
7225
7453
|
});
|
|
7226
7454
|
freeze(LightningElement);
|
|
7227
7455
|
seal(LightningElement.prototype);
|
|
7228
|
-
/* version: 2.
|
|
7456
|
+
/* version: 2.36.0 */
|
|
7229
7457
|
|
|
7230
7458
|
exports.LightningElement = LightningElement;
|
|
7231
7459
|
exports.__unstable__ProfilerControl = profilerControl;
|