lwc 2.24.0 → 2.25.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 +256 -141
- package/dist/engine-dom/iife/es2017/engine-dom.js +256 -141
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +243 -128
- package/dist/engine-dom/iife/es5/engine-dom.js +44 -12
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +42 -10
- package/dist/engine-dom/umd/es2017/engine-dom.js +256 -141
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +243 -128
- package/dist/engine-dom/umd/es5/engine-dom.js +44 -12
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +42 -10
- package/dist/engine-server/commonjs/es2017/engine-server.js +208 -122
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +208 -122
- 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
|
@@ -436,9 +436,9 @@ function htmlEscape(str, attrMode = false) {
|
|
|
436
436
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
437
437
|
*/
|
|
438
438
|
// Increment whenever the LWC template compiler changes
|
|
439
|
-
const LWC_VERSION = "2.
|
|
439
|
+
const LWC_VERSION = "2.25.1";
|
|
440
440
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
441
|
-
/** version: 2.
|
|
441
|
+
/** version: 2.25.1 */
|
|
442
442
|
|
|
443
443
|
/*
|
|
444
444
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -496,6 +496,7 @@ const features = {
|
|
|
496
496
|
ENABLE_REACTIVE_SETTER: null,
|
|
497
497
|
ENABLE_WIRE_SYNC_EMIT: null,
|
|
498
498
|
ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null,
|
|
499
|
+
DISABLE_LIGHT_DOM_UNSCOPED_CSS: null,
|
|
499
500
|
};
|
|
500
501
|
if (!_globalThis.lwcRuntimeFlags) {
|
|
501
502
|
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
|
|
@@ -549,7 +550,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
549
550
|
setFeatureFlag(name, value);
|
|
550
551
|
}
|
|
551
552
|
}
|
|
552
|
-
/** version: 2.
|
|
553
|
+
/** version: 2.25.1 */
|
|
553
554
|
|
|
554
555
|
/* proxy-compat-disable */
|
|
555
556
|
|
|
@@ -3232,149 +3233,234 @@ function getComponentDef(Ctor) {
|
|
|
3232
3233
|
* SPDX-License-Identifier: MIT
|
|
3233
3234
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3234
3235
|
*/
|
|
3236
|
+
|
|
3235
3237
|
function makeHostToken(token) {
|
|
3236
|
-
|
|
3238
|
+
return `${token}-host`;
|
|
3237
3239
|
}
|
|
3240
|
+
|
|
3238
3241
|
function createInlineStyleVNode(content) {
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3242
|
+
return api.h('style', {
|
|
3243
|
+
key: 'style',
|
|
3244
|
+
attrs: {
|
|
3245
|
+
type: 'text/css'
|
|
3246
|
+
}
|
|
3247
|
+
}, [api.t(content)]);
|
|
3245
3248
|
}
|
|
3249
|
+
|
|
3246
3250
|
function updateStylesheetToken(vm, template) {
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3251
|
+
const {
|
|
3252
|
+
elm,
|
|
3253
|
+
context,
|
|
3254
|
+
renderMode,
|
|
3255
|
+
shadowMode,
|
|
3256
|
+
renderer: {
|
|
3257
|
+
getClassList,
|
|
3258
|
+
removeAttribute,
|
|
3259
|
+
setAttribute
|
|
3260
|
+
}
|
|
3261
|
+
} = vm;
|
|
3262
|
+
const {
|
|
3263
|
+
stylesheets: newStylesheets,
|
|
3264
|
+
stylesheetToken: newStylesheetToken
|
|
3265
|
+
} = template;
|
|
3266
|
+
const isSyntheticShadow = renderMode === 1
|
|
3267
|
+
/* RenderMode.Shadow */
|
|
3268
|
+
&& shadowMode === 1
|
|
3269
|
+
/* ShadowMode.Synthetic */
|
|
3270
|
+
;
|
|
3271
|
+
const {
|
|
3272
|
+
hasScopedStyles
|
|
3273
|
+
} = context;
|
|
3274
|
+
let newToken;
|
|
3275
|
+
let newHasTokenInClass;
|
|
3276
|
+
let newHasTokenInAttribute; // Reset the styling token applied to the host element.
|
|
3277
|
+
|
|
3278
|
+
const {
|
|
3279
|
+
stylesheetToken: oldToken,
|
|
3280
|
+
hasTokenInClass: oldHasTokenInClass,
|
|
3281
|
+
hasTokenInAttribute: oldHasTokenInAttribute
|
|
3282
|
+
} = context;
|
|
3283
|
+
|
|
3284
|
+
if (!isUndefined$1(oldToken)) {
|
|
3285
|
+
if (oldHasTokenInClass) {
|
|
3286
|
+
getClassList(elm).remove(makeHostToken(oldToken));
|
|
3287
|
+
}
|
|
3288
|
+
|
|
3289
|
+
if (oldHasTokenInAttribute) {
|
|
3290
|
+
removeAttribute(elm, makeHostToken(oldToken));
|
|
3291
|
+
}
|
|
3292
|
+
} // Apply the new template styling token to the host element, if the new template has any
|
|
3293
|
+
// associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
|
|
3294
|
+
|
|
3295
|
+
|
|
3296
|
+
if (!isUndefined$1(newStylesheets) && newStylesheets.length !== 0) {
|
|
3297
|
+
newToken = newStylesheetToken;
|
|
3298
|
+
} // Set the new styling token on the host element
|
|
3299
|
+
|
|
3300
|
+
|
|
3301
|
+
if (!isUndefined$1(newToken)) {
|
|
3302
|
+
if (hasScopedStyles) {
|
|
3303
|
+
getClassList(elm).add(makeHostToken(newToken));
|
|
3304
|
+
newHasTokenInClass = true;
|
|
3305
|
+
}
|
|
3306
|
+
|
|
3307
|
+
if (isSyntheticShadow) {
|
|
3308
|
+
setAttribute(elm, makeHostToken(newToken), '');
|
|
3309
|
+
newHasTokenInAttribute = true;
|
|
3310
|
+
}
|
|
3311
|
+
} // Update the styling tokens present on the context object.
|
|
3312
|
+
|
|
3313
|
+
|
|
3314
|
+
context.stylesheetToken = newToken;
|
|
3315
|
+
context.hasTokenInClass = newHasTokenInClass;
|
|
3316
|
+
context.hasTokenInAttribute = newHasTokenInAttribute;
|
|
3284
3317
|
}
|
|
3318
|
+
|
|
3285
3319
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3320
|
+
const content = [];
|
|
3321
|
+
let root;
|
|
3322
|
+
|
|
3323
|
+
for (let i = 0; i < stylesheets.length; i++) {
|
|
3324
|
+
let stylesheet = stylesheets[i];
|
|
3325
|
+
|
|
3326
|
+
if (isArray$1(stylesheet)) {
|
|
3327
|
+
ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
|
|
3328
|
+
} else {
|
|
3329
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3330
|
+
// Check for compiler version mismatch in dev mode only
|
|
3331
|
+
checkVersionMismatch(stylesheet, 'stylesheet'); // in dev-mode, we support hot swapping of stylesheet, which means that
|
|
3332
|
+
// the component instance might be attempting to use an old version of
|
|
3333
|
+
// the stylesheet, while internally, we have a replacement for it.
|
|
3334
|
+
|
|
3335
|
+
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
3336
|
+
}
|
|
3337
|
+
|
|
3338
|
+
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
3339
|
+
|
|
3340
|
+
if (lwcRuntimeFlags.DISABLE_LIGHT_DOM_UNSCOPED_CSS) {
|
|
3341
|
+
if (!isScopedCss && vm.renderMode === 0
|
|
3342
|
+
/* RenderMode.Light */
|
|
3343
|
+
) {
|
|
3344
|
+
logError('Unscoped CSS is not supported in Light DOM. Please use scoped CSS (*.scoped.css) instead of unscoped CSS (*.css).');
|
|
3345
|
+
continue;
|
|
3292
3346
|
}
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
root = getNearestShadowComponent(vm);
|
|
3325
|
-
}
|
|
3326
|
-
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0 /* ShadowMode.Native */;
|
|
3327
|
-
}
|
|
3328
|
-
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
3347
|
+
} // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
3348
|
+
|
|
3349
|
+
|
|
3350
|
+
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
3351
|
+
/* ShadowMode.Synthetic */
|
|
3352
|
+
&& vm.renderMode === 1
|
|
3353
|
+
/* RenderMode.Shadow */
|
|
3354
|
+
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
3355
|
+
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
3356
|
+
|
|
3357
|
+
const useActualHostSelector = vm.renderMode === 0
|
|
3358
|
+
/* RenderMode.Light */
|
|
3359
|
+
? !isScopedCss : vm.shadowMode === 0
|
|
3360
|
+
/* ShadowMode.Native */
|
|
3361
|
+
; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
3362
|
+
// we use an attribute selector on the host to simulate :dir().
|
|
3363
|
+
|
|
3364
|
+
let useNativeDirPseudoclass;
|
|
3365
|
+
|
|
3366
|
+
if (vm.renderMode === 1
|
|
3367
|
+
/* RenderMode.Shadow */
|
|
3368
|
+
) {
|
|
3369
|
+
useNativeDirPseudoclass = vm.shadowMode === 0
|
|
3370
|
+
/* ShadowMode.Native */
|
|
3371
|
+
;
|
|
3372
|
+
} else {
|
|
3373
|
+
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
3374
|
+
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
3375
|
+
if (isUndefined$1(root)) {
|
|
3376
|
+
// Only calculate the root once as necessary
|
|
3377
|
+
root = getNearestShadowComponent(vm);
|
|
3329
3378
|
}
|
|
3379
|
+
|
|
3380
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
3381
|
+
/* ShadowMode.Native */
|
|
3382
|
+
;
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
3330
3386
|
}
|
|
3331
|
-
|
|
3387
|
+
}
|
|
3388
|
+
|
|
3389
|
+
return content;
|
|
3332
3390
|
}
|
|
3391
|
+
|
|
3333
3392
|
function getStylesheetsContent(vm, template) {
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3393
|
+
const {
|
|
3394
|
+
stylesheets,
|
|
3395
|
+
stylesheetToken
|
|
3396
|
+
} = template;
|
|
3397
|
+
let content = [];
|
|
3398
|
+
|
|
3399
|
+
if (!isUndefined$1(stylesheets) && stylesheets.length !== 0) {
|
|
3400
|
+
content = evaluateStylesheetsContent(stylesheets, stylesheetToken, vm);
|
|
3401
|
+
}
|
|
3402
|
+
|
|
3403
|
+
return content;
|
|
3404
|
+
} // It might be worth caching this to avoid doing the lookup repeatedly, but
|
|
3342
3405
|
// perf testing has not shown it to be a huge improvement yet:
|
|
3343
3406
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
3407
|
+
|
|
3344
3408
|
function getNearestShadowComponent(vm) {
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3409
|
+
let owner = vm;
|
|
3410
|
+
|
|
3411
|
+
while (!isNull(owner)) {
|
|
3412
|
+
if (owner.renderMode === 1
|
|
3413
|
+
/* RenderMode.Shadow */
|
|
3414
|
+
) {
|
|
3415
|
+
return owner;
|
|
3351
3416
|
}
|
|
3352
|
-
|
|
3417
|
+
|
|
3418
|
+
owner = owner.owner;
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3421
|
+
return owner;
|
|
3353
3422
|
}
|
|
3354
3423
|
/**
|
|
3355
3424
|
* If the component that is currently being rendered uses scoped styles,
|
|
3356
3425
|
* this returns the unique token for that scoped stylesheet. Otherwise
|
|
3357
3426
|
* it returns null.
|
|
3358
3427
|
*/
|
|
3428
|
+
|
|
3429
|
+
|
|
3359
3430
|
function getScopeTokenClass(owner) {
|
|
3360
|
-
|
|
3361
|
-
|
|
3431
|
+
const {
|
|
3432
|
+
cmpTemplate,
|
|
3433
|
+
context
|
|
3434
|
+
} = owner;
|
|
3435
|
+
return context.hasScopedStyles && (cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken) || null;
|
|
3362
3436
|
}
|
|
3437
|
+
|
|
3363
3438
|
function createStylesheet(vm, stylesheets) {
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3439
|
+
const {
|
|
3440
|
+
renderMode,
|
|
3441
|
+
shadowMode,
|
|
3442
|
+
renderer: {
|
|
3443
|
+
insertStylesheet
|
|
3369
3444
|
}
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3445
|
+
} = vm;
|
|
3446
|
+
|
|
3447
|
+
if (renderMode === 1
|
|
3448
|
+
/* RenderMode.Shadow */
|
|
3449
|
+
&& shadowMode === 1
|
|
3450
|
+
/* ShadowMode.Synthetic */
|
|
3451
|
+
) {
|
|
3452
|
+
for (let i = 0; i < stylesheets.length; i++) {
|
|
3453
|
+
insertStylesheet(stylesheets[i]);
|
|
3376
3454
|
}
|
|
3377
|
-
|
|
3455
|
+
} else {
|
|
3456
|
+
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
3457
|
+
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
3458
|
+
// the first time the VM renders.
|
|
3459
|
+
// native shadow or light DOM, SSR
|
|
3460
|
+
return ArrayMap.call(stylesheets, createInlineStyleVNode);
|
|
3461
|
+
}
|
|
3462
|
+
|
|
3463
|
+
return null;
|
|
3378
3464
|
}
|
|
3379
3465
|
|
|
3380
3466
|
/*
|
|
@@ -6411,7 +6497,7 @@ function freezeTemplate(tmpl) {
|
|
|
6411
6497
|
});
|
|
6412
6498
|
}
|
|
6413
6499
|
}
|
|
6414
|
-
/* version: 2.
|
|
6500
|
+
/* version: 2.25.1 */
|
|
6415
6501
|
|
|
6416
6502
|
/*
|
|
6417
6503
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -6781,7 +6867,7 @@ const renderer = {
|
|
|
6781
6867
|
*/
|
|
6782
6868
|
function serializeAttributes(attributes) {
|
|
6783
6869
|
return attributes
|
|
6784
|
-
.map((attr) => attr.value.length ? `${attr.name}
|
|
6870
|
+
.map((attr) => attr.value.length ? `${attr.name}="${htmlEscape(attr.value, true)}"` : attr.name)
|
|
6785
6871
|
.join(' ');
|
|
6786
6872
|
}
|
|
6787
6873
|
function serializeChildNodes(children) {
|
|
@@ -6881,7 +6967,7 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
6881
6967
|
*/
|
|
6882
6968
|
freeze(LightningElement);
|
|
6883
6969
|
seal(LightningElement.prototype);
|
|
6884
|
-
/* version: 2.
|
|
6970
|
+
/* version: 2.25.1 */
|
|
6885
6971
|
|
|
6886
6972
|
exports.LightningElement = LightningElement;
|
|
6887
6973
|
exports.api = api$1;
|