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
|
@@ -294,7 +294,7 @@
|
|
|
294
294
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
295
295
|
return attributeName;
|
|
296
296
|
}
|
|
297
|
-
/** version: 2.
|
|
297
|
+
/** version: 2.25.1 */
|
|
298
298
|
|
|
299
299
|
/**
|
|
300
300
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -376,7 +376,7 @@
|
|
|
376
376
|
patch$1(propName);
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
/** version: 2.
|
|
379
|
+
/** version: 2.25.1 */
|
|
380
380
|
|
|
381
381
|
/**
|
|
382
382
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -402,6 +402,7 @@
|
|
|
402
402
|
ENABLE_REACTIVE_SETTER: null,
|
|
403
403
|
ENABLE_WIRE_SYNC_EMIT: null,
|
|
404
404
|
ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null,
|
|
405
|
+
DISABLE_LIGHT_DOM_UNSCOPED_CSS: null,
|
|
405
406
|
};
|
|
406
407
|
if (!_globalThis.lwcRuntimeFlags) {
|
|
407
408
|
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
|
|
@@ -2376,159 +2377,262 @@
|
|
|
2376
2377
|
* SPDX-License-Identifier: MIT
|
|
2377
2378
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2378
2379
|
*/
|
|
2380
|
+
|
|
2379
2381
|
function makeHostToken(token) {
|
|
2380
|
-
|
|
2382
|
+
return `${token}-host`;
|
|
2381
2383
|
}
|
|
2384
|
+
|
|
2382
2385
|
function createInlineStyleVNode(content) {
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2386
|
+
return api.h('style', {
|
|
2387
|
+
key: 'style',
|
|
2388
|
+
attrs: {
|
|
2389
|
+
type: 'text/css'
|
|
2390
|
+
}
|
|
2391
|
+
}, [api.t(content)]);
|
|
2389
2392
|
}
|
|
2393
|
+
|
|
2390
2394
|
function updateStylesheetToken(vm, template) {
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
if (!isUndefined$1(oldToken)) {
|
|
2401
|
-
if (oldHasTokenInClass) {
|
|
2402
|
-
getClassList(elm).remove(makeHostToken(oldToken));
|
|
2403
|
-
}
|
|
2404
|
-
if (oldHasTokenInAttribute) {
|
|
2405
|
-
removeAttribute(elm, makeHostToken(oldToken));
|
|
2406
|
-
}
|
|
2395
|
+
const {
|
|
2396
|
+
elm,
|
|
2397
|
+
context,
|
|
2398
|
+
renderMode,
|
|
2399
|
+
shadowMode,
|
|
2400
|
+
renderer: {
|
|
2401
|
+
getClassList,
|
|
2402
|
+
removeAttribute,
|
|
2403
|
+
setAttribute
|
|
2407
2404
|
}
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2405
|
+
} = vm;
|
|
2406
|
+
const {
|
|
2407
|
+
stylesheets: newStylesheets,
|
|
2408
|
+
stylesheetToken: newStylesheetToken
|
|
2409
|
+
} = template;
|
|
2410
|
+
const isSyntheticShadow = renderMode === 1
|
|
2411
|
+
/* RenderMode.Shadow */
|
|
2412
|
+
&& shadowMode === 1
|
|
2413
|
+
/* ShadowMode.Synthetic */
|
|
2414
|
+
;
|
|
2415
|
+
const {
|
|
2416
|
+
hasScopedStyles
|
|
2417
|
+
} = context;
|
|
2418
|
+
let newToken;
|
|
2419
|
+
let newHasTokenInClass;
|
|
2420
|
+
let newHasTokenInAttribute; // Reset the styling token applied to the host element.
|
|
2421
|
+
|
|
2422
|
+
const {
|
|
2423
|
+
stylesheetToken: oldToken,
|
|
2424
|
+
hasTokenInClass: oldHasTokenInClass,
|
|
2425
|
+
hasTokenInAttribute: oldHasTokenInAttribute
|
|
2426
|
+
} = context;
|
|
2427
|
+
|
|
2428
|
+
if (!isUndefined$1(oldToken)) {
|
|
2429
|
+
if (oldHasTokenInClass) {
|
|
2430
|
+
getClassList(elm).remove(makeHostToken(oldToken));
|
|
2412
2431
|
}
|
|
2413
|
-
|
|
2414
|
-
if (
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2432
|
+
|
|
2433
|
+
if (oldHasTokenInAttribute) {
|
|
2434
|
+
removeAttribute(elm, makeHostToken(oldToken));
|
|
2435
|
+
}
|
|
2436
|
+
} // Apply the new template styling token to the host element, if the new template has any
|
|
2437
|
+
// associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
|
|
2438
|
+
|
|
2439
|
+
|
|
2440
|
+
if (!isUndefined$1(newStylesheets) && newStylesheets.length !== 0) {
|
|
2441
|
+
newToken = newStylesheetToken;
|
|
2442
|
+
} // Set the new styling token on the host element
|
|
2443
|
+
|
|
2444
|
+
|
|
2445
|
+
if (!isUndefined$1(newToken)) {
|
|
2446
|
+
if (hasScopedStyles) {
|
|
2447
|
+
getClassList(elm).add(makeHostToken(newToken));
|
|
2448
|
+
newHasTokenInClass = true;
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2451
|
+
if (isSyntheticShadow) {
|
|
2452
|
+
setAttribute(elm, makeHostToken(newToken), '');
|
|
2453
|
+
newHasTokenInAttribute = true;
|
|
2423
2454
|
}
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2455
|
+
} // Update the styling tokens present on the context object.
|
|
2456
|
+
|
|
2457
|
+
|
|
2458
|
+
context.stylesheetToken = newToken;
|
|
2459
|
+
context.hasTokenInClass = newHasTokenInClass;
|
|
2460
|
+
context.hasTokenInAttribute = newHasTokenInAttribute;
|
|
2428
2461
|
}
|
|
2462
|
+
|
|
2429
2463
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2464
|
+
const content = [];
|
|
2465
|
+
let root;
|
|
2466
|
+
|
|
2467
|
+
for (let i = 0; i < stylesheets.length; i++) {
|
|
2468
|
+
let stylesheet = stylesheets[i];
|
|
2469
|
+
|
|
2470
|
+
if (isArray$1(stylesheet)) {
|
|
2471
|
+
ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
|
|
2472
|
+
} else {
|
|
2473
|
+
|
|
2474
|
+
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
2475
|
+
|
|
2476
|
+
if (lwcRuntimeFlags.DISABLE_LIGHT_DOM_UNSCOPED_CSS) {
|
|
2477
|
+
if (!isScopedCss && vm.renderMode === 0
|
|
2478
|
+
/* RenderMode.Light */
|
|
2479
|
+
) {
|
|
2480
|
+
logError('Unscoped CSS is not supported in Light DOM. Please use scoped CSS (*.scoped.css) instead of unscoped CSS (*.css).');
|
|
2481
|
+
continue;
|
|
2436
2482
|
}
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2483
|
+
} // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
2484
|
+
|
|
2485
|
+
|
|
2486
|
+
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
2487
|
+
/* ShadowMode.Synthetic */
|
|
2488
|
+
&& vm.renderMode === 1
|
|
2489
|
+
/* RenderMode.Shadow */
|
|
2490
|
+
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
2491
|
+
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
2492
|
+
|
|
2493
|
+
const useActualHostSelector = vm.renderMode === 0
|
|
2494
|
+
/* RenderMode.Light */
|
|
2495
|
+
? !isScopedCss : vm.shadowMode === 0
|
|
2496
|
+
/* ShadowMode.Native */
|
|
2497
|
+
; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
2498
|
+
// we use an attribute selector on the host to simulate :dir().
|
|
2499
|
+
|
|
2500
|
+
let useNativeDirPseudoclass;
|
|
2501
|
+
|
|
2502
|
+
if (vm.renderMode === 1
|
|
2503
|
+
/* RenderMode.Shadow */
|
|
2504
|
+
) {
|
|
2505
|
+
useNativeDirPseudoclass = vm.shadowMode === 0
|
|
2506
|
+
/* ShadowMode.Native */
|
|
2507
|
+
;
|
|
2508
|
+
} else {
|
|
2509
|
+
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
2510
|
+
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
2511
|
+
if (isUndefined$1(root)) {
|
|
2512
|
+
// Only calculate the root once as necessary
|
|
2513
|
+
root = getNearestShadowComponent(vm);
|
|
2465
2514
|
}
|
|
2515
|
+
|
|
2516
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
2517
|
+
/* ShadowMode.Native */
|
|
2518
|
+
;
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
2466
2522
|
}
|
|
2467
|
-
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2525
|
+
return content;
|
|
2468
2526
|
}
|
|
2527
|
+
|
|
2469
2528
|
function getStylesheetsContent(vm, template) {
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2529
|
+
const {
|
|
2530
|
+
stylesheets,
|
|
2531
|
+
stylesheetToken
|
|
2532
|
+
} = template;
|
|
2533
|
+
let content = [];
|
|
2534
|
+
|
|
2535
|
+
if (!isUndefined$1(stylesheets) && stylesheets.length !== 0) {
|
|
2536
|
+
content = evaluateStylesheetsContent(stylesheets, stylesheetToken, vm);
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
return content;
|
|
2540
|
+
} // It might be worth caching this to avoid doing the lookup repeatedly, but
|
|
2478
2541
|
// perf testing has not shown it to be a huge improvement yet:
|
|
2479
2542
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
2543
|
+
|
|
2480
2544
|
function getNearestShadowComponent(vm) {
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2545
|
+
let owner = vm;
|
|
2546
|
+
|
|
2547
|
+
while (!isNull(owner)) {
|
|
2548
|
+
if (owner.renderMode === 1
|
|
2549
|
+
/* RenderMode.Shadow */
|
|
2550
|
+
) {
|
|
2551
|
+
return owner;
|
|
2487
2552
|
}
|
|
2488
|
-
|
|
2553
|
+
|
|
2554
|
+
owner = owner.owner;
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
return owner;
|
|
2489
2558
|
}
|
|
2490
2559
|
/**
|
|
2491
2560
|
* If the component that is currently being rendered uses scoped styles,
|
|
2492
2561
|
* this returns the unique token for that scoped stylesheet. Otherwise
|
|
2493
2562
|
* it returns null.
|
|
2494
2563
|
*/
|
|
2564
|
+
|
|
2565
|
+
|
|
2495
2566
|
function getScopeTokenClass(owner) {
|
|
2496
|
-
|
|
2497
|
-
|
|
2567
|
+
const {
|
|
2568
|
+
cmpTemplate,
|
|
2569
|
+
context
|
|
2570
|
+
} = owner;
|
|
2571
|
+
return context.hasScopedStyles && (cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken) || null;
|
|
2498
2572
|
}
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2573
|
+
/**
|
|
2574
|
+
* This function returns the host style token for a custom element if it
|
|
2575
|
+
* exists. Otherwise it returns null.
|
|
2576
|
+
*/
|
|
2577
|
+
|
|
2578
|
+
function getStylesheetTokenHost(vnode) {
|
|
2579
|
+
const {
|
|
2580
|
+
template: {
|
|
2581
|
+
stylesheetToken
|
|
2505
2582
|
}
|
|
2506
|
-
|
|
2583
|
+
} = getComponentInternalDef(vnode.ctor);
|
|
2584
|
+
return !isUndefined$1(stylesheetToken) ? makeHostToken(stylesheetToken) : null;
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
function getNearestNativeShadowComponent(vm) {
|
|
2588
|
+
const owner = getNearestShadowComponent(vm);
|
|
2589
|
+
|
|
2590
|
+
if (!isNull(owner) && owner.shadowMode === 1
|
|
2591
|
+
/* ShadowMode.Synthetic */
|
|
2592
|
+
) {
|
|
2593
|
+
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
2594
|
+
// synthetic, we know we won't find a native component if we go any further.
|
|
2595
|
+
return null;
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
return owner;
|
|
2507
2599
|
}
|
|
2600
|
+
|
|
2508
2601
|
function createStylesheet(vm, stylesheets) {
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
}
|
|
2515
|
-
else if (vm.hydrated) {
|
|
2516
|
-
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
2517
|
-
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
2518
|
-
// the first time the VM renders.
|
|
2519
|
-
// native shadow or light DOM, SSR
|
|
2520
|
-
return ArrayMap.call(stylesheets, createInlineStyleVNode);
|
|
2602
|
+
const {
|
|
2603
|
+
renderMode,
|
|
2604
|
+
shadowMode,
|
|
2605
|
+
renderer: {
|
|
2606
|
+
insertStylesheet
|
|
2521
2607
|
}
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2608
|
+
} = vm;
|
|
2609
|
+
|
|
2610
|
+
if (renderMode === 1
|
|
2611
|
+
/* RenderMode.Shadow */
|
|
2612
|
+
&& shadowMode === 1
|
|
2613
|
+
/* ShadowMode.Synthetic */
|
|
2614
|
+
) {
|
|
2615
|
+
for (let i = 0; i < stylesheets.length; i++) {
|
|
2616
|
+
insertStylesheet(stylesheets[i]);
|
|
2617
|
+
}
|
|
2618
|
+
} else if (vm.hydrated) {
|
|
2619
|
+
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
2620
|
+
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
2621
|
+
// the first time the VM renders.
|
|
2622
|
+
// native shadow or light DOM, SSR
|
|
2623
|
+
return ArrayMap.call(stylesheets, createInlineStyleVNode);
|
|
2624
|
+
} else {
|
|
2625
|
+
// native shadow or light DOM, DOM renderer
|
|
2626
|
+
const root = getNearestNativeShadowComponent(vm); // null root means a global style
|
|
2627
|
+
|
|
2628
|
+
const target = isNull(root) ? undefined : root.shadowRoot;
|
|
2629
|
+
|
|
2630
|
+
for (let i = 0; i < stylesheets.length; i++) {
|
|
2631
|
+
insertStylesheet(stylesheets[i], target);
|
|
2530
2632
|
}
|
|
2531
|
-
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
return null;
|
|
2532
2636
|
}
|
|
2533
2637
|
|
|
2534
2638
|
/*
|
|
@@ -2607,6 +2711,9 @@
|
|
|
2607
2711
|
function isSameVnode(vnode1, vnode2) {
|
|
2608
2712
|
return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
|
|
2609
2713
|
}
|
|
2714
|
+
function isVCustomElement(vnode) {
|
|
2715
|
+
return vnode.type === 3 /* VNodeType.CustomElement */;
|
|
2716
|
+
}
|
|
2610
2717
|
|
|
2611
2718
|
/*
|
|
2612
2719
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5448,6 +5555,7 @@
|
|
|
5448
5555
|
let { className, classMap } = data;
|
|
5449
5556
|
const { getProperty, getClassList } = renderer;
|
|
5450
5557
|
const scopedToken = getScopeTokenClass(owner);
|
|
5558
|
+
const stylesheetTokenHost = isVCustomElement(vnode) ? getStylesheetTokenHost(vnode) : null;
|
|
5451
5559
|
// Classnames for scoped CSS are added directly to the DOM during rendering,
|
|
5452
5560
|
// or to the VDOM on the server in the case of SSR. As such, these classnames
|
|
5453
5561
|
// are never present in VDOM nodes in the browser.
|
|
@@ -5456,10 +5564,17 @@
|
|
|
5456
5564
|
// are rendered during SSR. This needs to be accounted for when validating.
|
|
5457
5565
|
if (scopedToken) {
|
|
5458
5566
|
if (!isUndefined$1(className)) {
|
|
5459
|
-
className =
|
|
5567
|
+
className = isNull(stylesheetTokenHost)
|
|
5568
|
+
? `${scopedToken} ${className}`
|
|
5569
|
+
: `${scopedToken} ${className} ${stylesheetTokenHost}`;
|
|
5460
5570
|
}
|
|
5461
5571
|
else if (!isUndefined$1(classMap)) {
|
|
5462
|
-
classMap = Object.assign(Object.assign({}, classMap), { [scopedToken]: true });
|
|
5572
|
+
classMap = Object.assign(Object.assign(Object.assign({}, classMap), { [scopedToken]: true }), (isNull(stylesheetTokenHost) ? {} : { [stylesheetTokenHost]: true }));
|
|
5573
|
+
}
|
|
5574
|
+
else {
|
|
5575
|
+
className = isNull(stylesheetTokenHost)
|
|
5576
|
+
? `${scopedToken}`
|
|
5577
|
+
: `${scopedToken} ${stylesheetTokenHost}`;
|
|
5463
5578
|
}
|
|
5464
5579
|
}
|
|
5465
5580
|
let nodesAreCompatible = true;
|
|
@@ -5588,7 +5703,7 @@
|
|
|
5588
5703
|
}
|
|
5589
5704
|
return ctor;
|
|
5590
5705
|
}
|
|
5591
|
-
/* version: 2.
|
|
5706
|
+
/* version: 2.25.1 */
|
|
5592
5707
|
|
|
5593
5708
|
/*
|
|
5594
5709
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5783,7 +5898,7 @@
|
|
|
5783
5898
|
function isNull(obj) {
|
|
5784
5899
|
return obj === null;
|
|
5785
5900
|
}
|
|
5786
|
-
/** version: 2.
|
|
5901
|
+
/** version: 2.25.1 */
|
|
5787
5902
|
|
|
5788
5903
|
/*
|
|
5789
5904
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6394,7 +6509,7 @@
|
|
|
6394
6509
|
});
|
|
6395
6510
|
freeze(LightningElement);
|
|
6396
6511
|
seal(LightningElement.prototype);
|
|
6397
|
-
/* version: 2.
|
|
6512
|
+
/* version: 2.25.1 */
|
|
6398
6513
|
|
|
6399
6514
|
exports.LightningElement = LightningElement;
|
|
6400
6515
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -368,9 +368,9 @@
|
|
|
368
368
|
// Increment whenever the LWC template compiler changes
|
|
369
369
|
|
|
370
370
|
|
|
371
|
-
var LWC_VERSION = "2.
|
|
371
|
+
var LWC_VERSION = "2.25.1";
|
|
372
372
|
var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
373
|
-
/** version: 2.
|
|
373
|
+
/** version: 2.25.1 */
|
|
374
374
|
|
|
375
375
|
/**
|
|
376
376
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
patch$1(propName);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
/** version: 2.
|
|
467
|
+
/** version: 2.25.1 */
|
|
468
468
|
|
|
469
469
|
/**
|
|
470
470
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -491,7 +491,8 @@
|
|
|
491
491
|
ENABLE_NODE_PATCH: null,
|
|
492
492
|
ENABLE_REACTIVE_SETTER: null,
|
|
493
493
|
ENABLE_WIRE_SYNC_EMIT: null,
|
|
494
|
-
ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null
|
|
494
|
+
ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null,
|
|
495
|
+
DISABLE_LIGHT_DOM_UNSCOPED_CSS: null
|
|
495
496
|
};
|
|
496
497
|
|
|
497
498
|
if (!_globalThis.lwcRuntimeFlags) {
|
|
@@ -557,7 +558,7 @@
|
|
|
557
558
|
setFeatureFlag(name, value);
|
|
558
559
|
}
|
|
559
560
|
}
|
|
560
|
-
/** version: 2.
|
|
561
|
+
/** version: 2.25.1 */
|
|
561
562
|
|
|
562
563
|
/*
|
|
563
564
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -4351,7 +4352,17 @@
|
|
|
4351
4352
|
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
4352
4353
|
}
|
|
4353
4354
|
|
|
4354
|
-
var isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
4355
|
+
var isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
4356
|
+
|
|
4357
|
+
if (lwcRuntimeFlags.DISABLE_LIGHT_DOM_UNSCOPED_CSS) {
|
|
4358
|
+
if (!isScopedCss && vm.renderMode === 0
|
|
4359
|
+
/* RenderMode.Light */
|
|
4360
|
+
) {
|
|
4361
|
+
logError('Unscoped CSS is not supported in Light DOM. Please use scoped CSS (*.scoped.css) instead of unscoped CSS (*.css).');
|
|
4362
|
+
continue;
|
|
4363
|
+
}
|
|
4364
|
+
} // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
4365
|
+
|
|
4355
4366
|
|
|
4356
4367
|
var scopeToken = isScopedCss || vm.shadowMode === 1
|
|
4357
4368
|
/* ShadowMode.Synthetic */
|
|
@@ -4437,6 +4448,18 @@
|
|
|
4437
4448
|
context = owner.context;
|
|
4438
4449
|
return context.hasScopedStyles && (cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken) || null;
|
|
4439
4450
|
}
|
|
4451
|
+
/**
|
|
4452
|
+
* This function returns the host style token for a custom element if it
|
|
4453
|
+
* exists. Otherwise it returns null.
|
|
4454
|
+
*/
|
|
4455
|
+
|
|
4456
|
+
|
|
4457
|
+
function getStylesheetTokenHost(vnode) {
|
|
4458
|
+
var _getComponentInternal = getComponentInternalDef(vnode.ctor),
|
|
4459
|
+
stylesheetToken = _getComponentInternal.template.stylesheetToken;
|
|
4460
|
+
|
|
4461
|
+
return !isUndefined$1(stylesheetToken) ? makeHostToken(stylesheetToken) : null;
|
|
4462
|
+
}
|
|
4440
4463
|
|
|
4441
4464
|
function getNearestNativeShadowComponent(vm) {
|
|
4442
4465
|
var owner = getNearestShadowComponent(vm);
|
|
@@ -4582,6 +4605,12 @@
|
|
|
4582
4605
|
function isSameVnode(vnode1, vnode2) {
|
|
4583
4606
|
return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
|
|
4584
4607
|
}
|
|
4608
|
+
|
|
4609
|
+
function isVCustomElement(vnode) {
|
|
4610
|
+
return vnode.type === 3
|
|
4611
|
+
/* VNodeType.CustomElement */
|
|
4612
|
+
;
|
|
4613
|
+
}
|
|
4585
4614
|
/*
|
|
4586
4615
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
4587
4616
|
* All rights reserved.
|
|
@@ -8195,7 +8224,8 @@
|
|
|
8195
8224
|
classMap = data.classMap;
|
|
8196
8225
|
var getProperty = renderer.getProperty,
|
|
8197
8226
|
getClassList = renderer.getClassList;
|
|
8198
|
-
var scopedToken = getScopeTokenClass(owner);
|
|
8227
|
+
var scopedToken = getScopeTokenClass(owner);
|
|
8228
|
+
var stylesheetTokenHost = isVCustomElement(vnode) ? getStylesheetTokenHost(vnode) : null; // Classnames for scoped CSS are added directly to the DOM during rendering,
|
|
8199
8229
|
// or to the VDOM on the server in the case of SSR. As such, these classnames
|
|
8200
8230
|
// are never present in VDOM nodes in the browser.
|
|
8201
8231
|
//
|
|
@@ -8204,9 +8234,11 @@
|
|
|
8204
8234
|
|
|
8205
8235
|
if (scopedToken) {
|
|
8206
8236
|
if (!isUndefined$1(className)) {
|
|
8207
|
-
className = "".concat(scopedToken, " ").concat(className);
|
|
8237
|
+
className = isNull(stylesheetTokenHost) ? "".concat(scopedToken, " ").concat(className) : "".concat(scopedToken, " ").concat(className, " ").concat(stylesheetTokenHost);
|
|
8208
8238
|
} else if (!isUndefined$1(classMap)) {
|
|
8209
|
-
classMap = Object.assign(Object.assign({}, classMap), _defineProperty({}, scopedToken, true));
|
|
8239
|
+
classMap = Object.assign(Object.assign(Object.assign({}, classMap), _defineProperty({}, scopedToken, true)), isNull(stylesheetTokenHost) ? {} : _defineProperty({}, stylesheetTokenHost, true));
|
|
8240
|
+
} else {
|
|
8241
|
+
className = isNull(stylesheetTokenHost) ? "".concat(scopedToken) : "".concat(scopedToken, " ").concat(stylesheetTokenHost);
|
|
8210
8242
|
}
|
|
8211
8243
|
}
|
|
8212
8244
|
|
|
@@ -8522,7 +8554,7 @@
|
|
|
8522
8554
|
|
|
8523
8555
|
return ctor;
|
|
8524
8556
|
}
|
|
8525
|
-
/* version: 2.
|
|
8557
|
+
/* version: 2.25.1 */
|
|
8526
8558
|
|
|
8527
8559
|
/*
|
|
8528
8560
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8750,7 +8782,7 @@
|
|
|
8750
8782
|
function isNull(obj) {
|
|
8751
8783
|
return obj === null;
|
|
8752
8784
|
}
|
|
8753
|
-
/** version: 2.
|
|
8785
|
+
/** version: 2.25.1 */
|
|
8754
8786
|
|
|
8755
8787
|
/*
|
|
8756
8788
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -9480,7 +9512,7 @@
|
|
|
9480
9512
|
});
|
|
9481
9513
|
freeze(LightningElement);
|
|
9482
9514
|
seal(LightningElement.prototype);
|
|
9483
|
-
/* version: 2.
|
|
9515
|
+
/* version: 2.25.1 */
|
|
9484
9516
|
|
|
9485
9517
|
exports.LightningElement = LightningElement;
|
|
9486
9518
|
exports.__unstable__ProfilerControl = profilerControl;
|