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.
Files changed (35) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +256 -141
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +256 -141
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +243 -128
  5. package/dist/engine-dom/iife/es5/engine-dom.js +44 -12
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +42 -10
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +256 -141
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +243 -128
  11. package/dist/engine-dom/umd/es5/engine-dom.js +44 -12
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +42 -10
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +208 -122
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +208 -122
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
  20. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
  22. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
  23. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
  24. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  25. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  26. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  27. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  28. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  29. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  30. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  31. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  34. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  35. package/package.json +7 -7
@@ -291,7 +291,7 @@ var LWC = (function (exports) {
291
291
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
292
292
  return attributeName;
293
293
  }
294
- /** version: 2.24.0 */
294
+ /** version: 2.25.1 */
295
295
 
296
296
  /**
297
297
  * Copyright (C) 2018 salesforce.com, inc.
@@ -373,7 +373,7 @@ var LWC = (function (exports) {
373
373
  patch$1(propName);
374
374
  }
375
375
  }
376
- /** version: 2.24.0 */
376
+ /** version: 2.25.1 */
377
377
 
378
378
  /**
379
379
  * Copyright (C) 2018 salesforce.com, inc.
@@ -399,6 +399,7 @@ var LWC = (function (exports) {
399
399
  ENABLE_REACTIVE_SETTER: null,
400
400
  ENABLE_WIRE_SYNC_EMIT: null,
401
401
  ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null,
402
+ DISABLE_LIGHT_DOM_UNSCOPED_CSS: null,
402
403
  };
403
404
  if (!_globalThis.lwcRuntimeFlags) {
404
405
  Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
@@ -2373,159 +2374,262 @@ var LWC = (function (exports) {
2373
2374
  * SPDX-License-Identifier: MIT
2374
2375
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2375
2376
  */
2377
+
2376
2378
  function makeHostToken(token) {
2377
- return `${token}-host`;
2379
+ return `${token}-host`;
2378
2380
  }
2381
+
2379
2382
  function createInlineStyleVNode(content) {
2380
- return api.h('style', {
2381
- key: 'style',
2382
- attrs: {
2383
- type: 'text/css',
2384
- },
2385
- }, [api.t(content)]);
2383
+ return api.h('style', {
2384
+ key: 'style',
2385
+ attrs: {
2386
+ type: 'text/css'
2387
+ }
2388
+ }, [api.t(content)]);
2386
2389
  }
2390
+
2387
2391
  function updateStylesheetToken(vm, template) {
2388
- const { elm, context, renderMode, shadowMode, renderer: { getClassList, removeAttribute, setAttribute }, } = vm;
2389
- const { stylesheets: newStylesheets, stylesheetToken: newStylesheetToken } = template;
2390
- const isSyntheticShadow = renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */;
2391
- const { hasScopedStyles } = context;
2392
- let newToken;
2393
- let newHasTokenInClass;
2394
- let newHasTokenInAttribute;
2395
- // Reset the styling token applied to the host element.
2396
- const { stylesheetToken: oldToken, hasTokenInClass: oldHasTokenInClass, hasTokenInAttribute: oldHasTokenInAttribute, } = context;
2397
- if (!isUndefined$1(oldToken)) {
2398
- if (oldHasTokenInClass) {
2399
- getClassList(elm).remove(makeHostToken(oldToken));
2400
- }
2401
- if (oldHasTokenInAttribute) {
2402
- removeAttribute(elm, makeHostToken(oldToken));
2403
- }
2392
+ const {
2393
+ elm,
2394
+ context,
2395
+ renderMode,
2396
+ shadowMode,
2397
+ renderer: {
2398
+ getClassList,
2399
+ removeAttribute,
2400
+ setAttribute
2404
2401
  }
2405
- // Apply the new template styling token to the host element, if the new template has any
2406
- // associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
2407
- if (!isUndefined$1(newStylesheets) && newStylesheets.length !== 0) {
2408
- newToken = newStylesheetToken;
2402
+ } = vm;
2403
+ const {
2404
+ stylesheets: newStylesheets,
2405
+ stylesheetToken: newStylesheetToken
2406
+ } = template;
2407
+ const isSyntheticShadow = renderMode === 1
2408
+ /* RenderMode.Shadow */
2409
+ && shadowMode === 1
2410
+ /* ShadowMode.Synthetic */
2411
+ ;
2412
+ const {
2413
+ hasScopedStyles
2414
+ } = context;
2415
+ let newToken;
2416
+ let newHasTokenInClass;
2417
+ let newHasTokenInAttribute; // Reset the styling token applied to the host element.
2418
+
2419
+ const {
2420
+ stylesheetToken: oldToken,
2421
+ hasTokenInClass: oldHasTokenInClass,
2422
+ hasTokenInAttribute: oldHasTokenInAttribute
2423
+ } = context;
2424
+
2425
+ if (!isUndefined$1(oldToken)) {
2426
+ if (oldHasTokenInClass) {
2427
+ getClassList(elm).remove(makeHostToken(oldToken));
2409
2428
  }
2410
- // Set the new styling token on the host element
2411
- if (!isUndefined$1(newToken)) {
2412
- if (hasScopedStyles) {
2413
- getClassList(elm).add(makeHostToken(newToken));
2414
- newHasTokenInClass = true;
2415
- }
2416
- if (isSyntheticShadow) {
2417
- setAttribute(elm, makeHostToken(newToken), '');
2418
- newHasTokenInAttribute = true;
2419
- }
2429
+
2430
+ if (oldHasTokenInAttribute) {
2431
+ removeAttribute(elm, makeHostToken(oldToken));
2432
+ }
2433
+ } // Apply the new template styling token to the host element, if the new template has any
2434
+ // associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
2435
+
2436
+
2437
+ if (!isUndefined$1(newStylesheets) && newStylesheets.length !== 0) {
2438
+ newToken = newStylesheetToken;
2439
+ } // Set the new styling token on the host element
2440
+
2441
+
2442
+ if (!isUndefined$1(newToken)) {
2443
+ if (hasScopedStyles) {
2444
+ getClassList(elm).add(makeHostToken(newToken));
2445
+ newHasTokenInClass = true;
2446
+ }
2447
+
2448
+ if (isSyntheticShadow) {
2449
+ setAttribute(elm, makeHostToken(newToken), '');
2450
+ newHasTokenInAttribute = true;
2420
2451
  }
2421
- // Update the styling tokens present on the context object.
2422
- context.stylesheetToken = newToken;
2423
- context.hasTokenInClass = newHasTokenInClass;
2424
- context.hasTokenInAttribute = newHasTokenInAttribute;
2452
+ } // Update the styling tokens present on the context object.
2453
+
2454
+
2455
+ context.stylesheetToken = newToken;
2456
+ context.hasTokenInClass = newHasTokenInClass;
2457
+ context.hasTokenInAttribute = newHasTokenInAttribute;
2425
2458
  }
2459
+
2426
2460
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
2427
- const content = [];
2428
- let root;
2429
- for (let i = 0; i < stylesheets.length; i++) {
2430
- let stylesheet = stylesheets[i];
2431
- if (isArray$1(stylesheet)) {
2432
- ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
2461
+ const content = [];
2462
+ let root;
2463
+
2464
+ for (let i = 0; i < stylesheets.length; i++) {
2465
+ let stylesheet = stylesheets[i];
2466
+
2467
+ if (isArray$1(stylesheet)) {
2468
+ ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
2469
+ } else {
2470
+
2471
+ const isScopedCss = stylesheet[KEY__SCOPED_CSS];
2472
+
2473
+ if (lwcRuntimeFlags.DISABLE_LIGHT_DOM_UNSCOPED_CSS) {
2474
+ if (!isScopedCss && vm.renderMode === 0
2475
+ /* RenderMode.Light */
2476
+ ) {
2477
+ logError('Unscoped CSS is not supported in Light DOM. Please use scoped CSS (*.scoped.css) instead of unscoped CSS (*.css).');
2478
+ continue;
2433
2479
  }
2434
- else {
2435
- const isScopedCss = stylesheet[KEY__SCOPED_CSS];
2436
- // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
2437
- const scopeToken = isScopedCss ||
2438
- (vm.shadowMode === 1 /* ShadowMode.Synthetic */ && vm.renderMode === 1 /* RenderMode.Shadow */)
2439
- ? stylesheetToken
2440
- : undefined;
2441
- // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
2442
- // native shadow DOM. Synthetic shadow DOM never uses `:host`.
2443
- const useActualHostSelector = vm.renderMode === 0 /* RenderMode.Light */
2444
- ? !isScopedCss
2445
- : vm.shadowMode === 0 /* ShadowMode.Native */;
2446
- // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
2447
- // we use an attribute selector on the host to simulate :dir().
2448
- let useNativeDirPseudoclass;
2449
- if (vm.renderMode === 1 /* RenderMode.Shadow */) {
2450
- useNativeDirPseudoclass = vm.shadowMode === 0 /* ShadowMode.Native */;
2451
- }
2452
- else {
2453
- // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
2454
- // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
2455
- if (isUndefined$1(root)) {
2456
- // Only calculate the root once as necessary
2457
- root = getNearestShadowComponent(vm);
2458
- }
2459
- useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0 /* ShadowMode.Native */;
2460
- }
2461
- ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
2480
+ } // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
2481
+
2482
+
2483
+ const scopeToken = isScopedCss || vm.shadowMode === 1
2484
+ /* ShadowMode.Synthetic */
2485
+ && vm.renderMode === 1
2486
+ /* RenderMode.Shadow */
2487
+ ? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
2488
+ // native shadow DOM. Synthetic shadow DOM never uses `:host`.
2489
+
2490
+ const useActualHostSelector = vm.renderMode === 0
2491
+ /* RenderMode.Light */
2492
+ ? !isScopedCss : vm.shadowMode === 0
2493
+ /* ShadowMode.Native */
2494
+ ; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
2495
+ // we use an attribute selector on the host to simulate :dir().
2496
+
2497
+ let useNativeDirPseudoclass;
2498
+
2499
+ if (vm.renderMode === 1
2500
+ /* RenderMode.Shadow */
2501
+ ) {
2502
+ useNativeDirPseudoclass = vm.shadowMode === 0
2503
+ /* ShadowMode.Native */
2504
+ ;
2505
+ } else {
2506
+ // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
2507
+ // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
2508
+ if (isUndefined$1(root)) {
2509
+ // Only calculate the root once as necessary
2510
+ root = getNearestShadowComponent(vm);
2462
2511
  }
2512
+
2513
+ useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
2514
+ /* ShadowMode.Native */
2515
+ ;
2516
+ }
2517
+
2518
+ ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
2463
2519
  }
2464
- return content;
2520
+ }
2521
+
2522
+ return content;
2465
2523
  }
2524
+
2466
2525
  function getStylesheetsContent(vm, template) {
2467
- const { stylesheets, stylesheetToken } = template;
2468
- let content = [];
2469
- if (!isUndefined$1(stylesheets) && stylesheets.length !== 0) {
2470
- content = evaluateStylesheetsContent(stylesheets, stylesheetToken, vm);
2471
- }
2472
- return content;
2473
- }
2474
- // It might be worth caching this to avoid doing the lookup repeatedly, but
2526
+ const {
2527
+ stylesheets,
2528
+ stylesheetToken
2529
+ } = template;
2530
+ let content = [];
2531
+
2532
+ if (!isUndefined$1(stylesheets) && stylesheets.length !== 0) {
2533
+ content = evaluateStylesheetsContent(stylesheets, stylesheetToken, vm);
2534
+ }
2535
+
2536
+ return content;
2537
+ } // It might be worth caching this to avoid doing the lookup repeatedly, but
2475
2538
  // perf testing has not shown it to be a huge improvement yet:
2476
2539
  // https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
2540
+
2477
2541
  function getNearestShadowComponent(vm) {
2478
- let owner = vm;
2479
- while (!isNull(owner)) {
2480
- if (owner.renderMode === 1 /* RenderMode.Shadow */) {
2481
- return owner;
2482
- }
2483
- owner = owner.owner;
2542
+ let owner = vm;
2543
+
2544
+ while (!isNull(owner)) {
2545
+ if (owner.renderMode === 1
2546
+ /* RenderMode.Shadow */
2547
+ ) {
2548
+ return owner;
2484
2549
  }
2485
- return owner;
2550
+
2551
+ owner = owner.owner;
2552
+ }
2553
+
2554
+ return owner;
2486
2555
  }
2487
2556
  /**
2488
2557
  * If the component that is currently being rendered uses scoped styles,
2489
2558
  * this returns the unique token for that scoped stylesheet. Otherwise
2490
2559
  * it returns null.
2491
2560
  */
2561
+
2562
+
2492
2563
  function getScopeTokenClass(owner) {
2493
- const { cmpTemplate, context } = owner;
2494
- return (context.hasScopedStyles && (cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken)) || null;
2564
+ const {
2565
+ cmpTemplate,
2566
+ context
2567
+ } = owner;
2568
+ return context.hasScopedStyles && (cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken) || null;
2495
2569
  }
2496
- function getNearestNativeShadowComponent(vm) {
2497
- const owner = getNearestShadowComponent(vm);
2498
- if (!isNull(owner) && owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
2499
- // Synthetic-within-native is impossible. So if the nearest shadow component is
2500
- // synthetic, we know we won't find a native component if we go any further.
2501
- return null;
2570
+ /**
2571
+ * This function returns the host style token for a custom element if it
2572
+ * exists. Otherwise it returns null.
2573
+ */
2574
+
2575
+ function getStylesheetTokenHost(vnode) {
2576
+ const {
2577
+ template: {
2578
+ stylesheetToken
2502
2579
  }
2503
- return owner;
2580
+ } = getComponentInternalDef(vnode.ctor);
2581
+ return !isUndefined$1(stylesheetToken) ? makeHostToken(stylesheetToken) : null;
2582
+ }
2583
+
2584
+ function getNearestNativeShadowComponent(vm) {
2585
+ const owner = getNearestShadowComponent(vm);
2586
+
2587
+ if (!isNull(owner) && owner.shadowMode === 1
2588
+ /* ShadowMode.Synthetic */
2589
+ ) {
2590
+ // Synthetic-within-native is impossible. So if the nearest shadow component is
2591
+ // synthetic, we know we won't find a native component if we go any further.
2592
+ return null;
2593
+ }
2594
+
2595
+ return owner;
2504
2596
  }
2597
+
2505
2598
  function createStylesheet(vm, stylesheets) {
2506
- const { renderMode, shadowMode, renderer: { insertStylesheet }, } = vm;
2507
- if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
2508
- for (let i = 0; i < stylesheets.length; i++) {
2509
- insertStylesheet(stylesheets[i]);
2510
- }
2511
- }
2512
- else if (vm.hydrated) {
2513
- // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
2514
- // This works in the client, because the stylesheets are created, and cached in the VM
2515
- // the first time the VM renders.
2516
- // native shadow or light DOM, SSR
2517
- return ArrayMap.call(stylesheets, createInlineStyleVNode);
2599
+ const {
2600
+ renderMode,
2601
+ shadowMode,
2602
+ renderer: {
2603
+ insertStylesheet
2518
2604
  }
2519
- else {
2520
- // native shadow or light DOM, DOM renderer
2521
- const root = getNearestNativeShadowComponent(vm);
2522
- // null root means a global style
2523
- const target = isNull(root) ? undefined : root.shadowRoot;
2524
- for (let i = 0; i < stylesheets.length; i++) {
2525
- insertStylesheet(stylesheets[i], target);
2526
- }
2605
+ } = vm;
2606
+
2607
+ if (renderMode === 1
2608
+ /* RenderMode.Shadow */
2609
+ && shadowMode === 1
2610
+ /* ShadowMode.Synthetic */
2611
+ ) {
2612
+ for (let i = 0; i < stylesheets.length; i++) {
2613
+ insertStylesheet(stylesheets[i]);
2614
+ }
2615
+ } else if (vm.hydrated) {
2616
+ // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
2617
+ // This works in the client, because the stylesheets are created, and cached in the VM
2618
+ // the first time the VM renders.
2619
+ // native shadow or light DOM, SSR
2620
+ return ArrayMap.call(stylesheets, createInlineStyleVNode);
2621
+ } else {
2622
+ // native shadow or light DOM, DOM renderer
2623
+ const root = getNearestNativeShadowComponent(vm); // null root means a global style
2624
+
2625
+ const target = isNull(root) ? undefined : root.shadowRoot;
2626
+
2627
+ for (let i = 0; i < stylesheets.length; i++) {
2628
+ insertStylesheet(stylesheets[i], target);
2527
2629
  }
2528
- return null;
2630
+ }
2631
+
2632
+ return null;
2529
2633
  }
2530
2634
 
2531
2635
  /*
@@ -2604,6 +2708,9 @@ var LWC = (function (exports) {
2604
2708
  function isSameVnode(vnode1, vnode2) {
2605
2709
  return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
2606
2710
  }
2711
+ function isVCustomElement(vnode) {
2712
+ return vnode.type === 3 /* VNodeType.CustomElement */;
2713
+ }
2607
2714
 
2608
2715
  /*
2609
2716
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5445,6 +5552,7 @@ var LWC = (function (exports) {
5445
5552
  let { className, classMap } = data;
5446
5553
  const { getProperty, getClassList } = renderer;
5447
5554
  const scopedToken = getScopeTokenClass(owner);
5555
+ const stylesheetTokenHost = isVCustomElement(vnode) ? getStylesheetTokenHost(vnode) : null;
5448
5556
  // Classnames for scoped CSS are added directly to the DOM during rendering,
5449
5557
  // or to the VDOM on the server in the case of SSR. As such, these classnames
5450
5558
  // are never present in VDOM nodes in the browser.
@@ -5453,10 +5561,17 @@ var LWC = (function (exports) {
5453
5561
  // are rendered during SSR. This needs to be accounted for when validating.
5454
5562
  if (scopedToken) {
5455
5563
  if (!isUndefined$1(className)) {
5456
- className = `${scopedToken} ${className}`;
5564
+ className = isNull(stylesheetTokenHost)
5565
+ ? `${scopedToken} ${className}`
5566
+ : `${scopedToken} ${className} ${stylesheetTokenHost}`;
5457
5567
  }
5458
5568
  else if (!isUndefined$1(classMap)) {
5459
- classMap = Object.assign(Object.assign({}, classMap), { [scopedToken]: true });
5569
+ classMap = Object.assign(Object.assign(Object.assign({}, classMap), { [scopedToken]: true }), (isNull(stylesheetTokenHost) ? {} : { [stylesheetTokenHost]: true }));
5570
+ }
5571
+ else {
5572
+ className = isNull(stylesheetTokenHost)
5573
+ ? `${scopedToken}`
5574
+ : `${scopedToken} ${stylesheetTokenHost}`;
5460
5575
  }
5461
5576
  }
5462
5577
  let nodesAreCompatible = true;
@@ -5585,7 +5700,7 @@ var LWC = (function (exports) {
5585
5700
  }
5586
5701
  return ctor;
5587
5702
  }
5588
- /* version: 2.24.0 */
5703
+ /* version: 2.25.1 */
5589
5704
 
5590
5705
  /*
5591
5706
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5780,7 +5895,7 @@ var LWC = (function (exports) {
5780
5895
  function isNull(obj) {
5781
5896
  return obj === null;
5782
5897
  }
5783
- /** version: 2.24.0 */
5898
+ /** version: 2.25.1 */
5784
5899
 
5785
5900
  /*
5786
5901
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6391,7 +6506,7 @@ var LWC = (function (exports) {
6391
6506
  });
6392
6507
  freeze(LightningElement);
6393
6508
  seal(LightningElement.prototype);
6394
- /* version: 2.24.0 */
6509
+ /* version: 2.25.1 */
6395
6510
 
6396
6511
  exports.LightningElement = LightningElement;
6397
6512
  exports.__unstable__ProfilerControl = profilerControl;
@@ -365,9 +365,9 @@ var LWC = (function (exports) {
365
365
  // Increment whenever the LWC template compiler changes
366
366
 
367
367
 
368
- var LWC_VERSION = "2.24.0";
368
+ var LWC_VERSION = "2.25.1";
369
369
  var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
370
- /** version: 2.24.0 */
370
+ /** version: 2.25.1 */
371
371
 
372
372
  /**
373
373
  * Copyright (C) 2018 salesforce.com, inc.
@@ -461,7 +461,7 @@ var LWC = (function (exports) {
461
461
  patch$1(propName);
462
462
  }
463
463
  }
464
- /** version: 2.24.0 */
464
+ /** version: 2.25.1 */
465
465
 
466
466
  /**
467
467
  * Copyright (C) 2018 salesforce.com, inc.
@@ -488,7 +488,8 @@ var LWC = (function (exports) {
488
488
  ENABLE_NODE_PATCH: null,
489
489
  ENABLE_REACTIVE_SETTER: null,
490
490
  ENABLE_WIRE_SYNC_EMIT: null,
491
- ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null
491
+ ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null,
492
+ DISABLE_LIGHT_DOM_UNSCOPED_CSS: null
492
493
  };
493
494
 
494
495
  if (!_globalThis.lwcRuntimeFlags) {
@@ -554,7 +555,7 @@ var LWC = (function (exports) {
554
555
  setFeatureFlag(name, value);
555
556
  }
556
557
  }
557
- /** version: 2.24.0 */
558
+ /** version: 2.25.1 */
558
559
 
559
560
  /*
560
561
  * Copyright (c) 2018, salesforce.com, inc.
@@ -4348,7 +4349,17 @@ var LWC = (function (exports) {
4348
4349
  stylesheet = getStyleOrSwappedStyle(stylesheet);
4349
4350
  }
4350
4351
 
4351
- var isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
4352
+ var isScopedCss = stylesheet[KEY__SCOPED_CSS];
4353
+
4354
+ if (lwcRuntimeFlags.DISABLE_LIGHT_DOM_UNSCOPED_CSS) {
4355
+ if (!isScopedCss && vm.renderMode === 0
4356
+ /* RenderMode.Light */
4357
+ ) {
4358
+ logError('Unscoped CSS is not supported in Light DOM. Please use scoped CSS (*.scoped.css) instead of unscoped CSS (*.css).');
4359
+ continue;
4360
+ }
4361
+ } // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
4362
+
4352
4363
 
4353
4364
  var scopeToken = isScopedCss || vm.shadowMode === 1
4354
4365
  /* ShadowMode.Synthetic */
@@ -4434,6 +4445,18 @@ var LWC = (function (exports) {
4434
4445
  context = owner.context;
4435
4446
  return context.hasScopedStyles && (cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken) || null;
4436
4447
  }
4448
+ /**
4449
+ * This function returns the host style token for a custom element if it
4450
+ * exists. Otherwise it returns null.
4451
+ */
4452
+
4453
+
4454
+ function getStylesheetTokenHost(vnode) {
4455
+ var _getComponentInternal = getComponentInternalDef(vnode.ctor),
4456
+ stylesheetToken = _getComponentInternal.template.stylesheetToken;
4457
+
4458
+ return !isUndefined$1(stylesheetToken) ? makeHostToken(stylesheetToken) : null;
4459
+ }
4437
4460
 
4438
4461
  function getNearestNativeShadowComponent(vm) {
4439
4462
  var owner = getNearestShadowComponent(vm);
@@ -4579,6 +4602,12 @@ var LWC = (function (exports) {
4579
4602
  function isSameVnode(vnode1, vnode2) {
4580
4603
  return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
4581
4604
  }
4605
+
4606
+ function isVCustomElement(vnode) {
4607
+ return vnode.type === 3
4608
+ /* VNodeType.CustomElement */
4609
+ ;
4610
+ }
4582
4611
  /*
4583
4612
  * Copyright (c) 2018, salesforce.com, inc.
4584
4613
  * All rights reserved.
@@ -8192,7 +8221,8 @@ var LWC = (function (exports) {
8192
8221
  classMap = data.classMap;
8193
8222
  var getProperty = renderer.getProperty,
8194
8223
  getClassList = renderer.getClassList;
8195
- var scopedToken = getScopeTokenClass(owner); // Classnames for scoped CSS are added directly to the DOM during rendering,
8224
+ var scopedToken = getScopeTokenClass(owner);
8225
+ var stylesheetTokenHost = isVCustomElement(vnode) ? getStylesheetTokenHost(vnode) : null; // Classnames for scoped CSS are added directly to the DOM during rendering,
8196
8226
  // or to the VDOM on the server in the case of SSR. As such, these classnames
8197
8227
  // are never present in VDOM nodes in the browser.
8198
8228
  //
@@ -8201,9 +8231,11 @@ var LWC = (function (exports) {
8201
8231
 
8202
8232
  if (scopedToken) {
8203
8233
  if (!isUndefined$1(className)) {
8204
- className = "".concat(scopedToken, " ").concat(className);
8234
+ className = isNull(stylesheetTokenHost) ? "".concat(scopedToken, " ").concat(className) : "".concat(scopedToken, " ").concat(className, " ").concat(stylesheetTokenHost);
8205
8235
  } else if (!isUndefined$1(classMap)) {
8206
- classMap = Object.assign(Object.assign({}, classMap), _defineProperty({}, scopedToken, true));
8236
+ classMap = Object.assign(Object.assign(Object.assign({}, classMap), _defineProperty({}, scopedToken, true)), isNull(stylesheetTokenHost) ? {} : _defineProperty({}, stylesheetTokenHost, true));
8237
+ } else {
8238
+ className = isNull(stylesheetTokenHost) ? "".concat(scopedToken) : "".concat(scopedToken, " ").concat(stylesheetTokenHost);
8207
8239
  }
8208
8240
  }
8209
8241
 
@@ -8519,7 +8551,7 @@ var LWC = (function (exports) {
8519
8551
 
8520
8552
  return ctor;
8521
8553
  }
8522
- /* version: 2.24.0 */
8554
+ /* version: 2.25.1 */
8523
8555
 
8524
8556
  /*
8525
8557
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8747,7 +8779,7 @@ var LWC = (function (exports) {
8747
8779
  function isNull(obj) {
8748
8780
  return obj === null;
8749
8781
  }
8750
- /** version: 2.24.0 */
8782
+ /** version: 2.25.1 */
8751
8783
 
8752
8784
  /*
8753
8785
  * Copyright (c) 2018, salesforce.com, inc.
@@ -9477,7 +9509,7 @@ var LWC = (function (exports) {
9477
9509
  });
9478
9510
  freeze(LightningElement);
9479
9511
  seal(LightningElement.prototype);
9480
- /* version: 2.24.0 */
9512
+ /* version: 2.25.1 */
9481
9513
 
9482
9514
  exports.LightningElement = LightningElement;
9483
9515
  exports.__unstable__ProfilerControl = profilerControl;