@lwc/engine-core 2.5.9 → 2.5.12

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.
@@ -5416,7 +5416,6 @@ function updateStylesheetToken(vm, template) {
5416
5416
 
5417
5417
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5418
5418
  const content = [];
5419
- let root;
5420
5419
 
5421
5420
  for (let i = 0; i < stylesheets.length; i++) {
5422
5421
  let stylesheet = stylesheets[i];
@@ -5429,46 +5428,23 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5429
5428
  // the component instance might be attempting to use an old version of
5430
5429
  // the stylesheet, while internally, we have a replacement for it.
5431
5430
  stylesheet = getStyleOrSwappedStyle(stylesheet);
5432
- }
5433
-
5434
- const isScopedCss = stylesheet[shared.KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5435
-
5436
- const scopeToken = isScopedCss || vm.shadowMode === 1
5437
- /* Synthetic */
5438
- && vm.renderMode === 1
5439
- /* Shadow */
5440
- ? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5431
+ } // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5441
5432
  // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5442
5433
 
5434
+
5435
+ const isScopedCss = stylesheet[shared.KEY__SCOPED_CSS];
5443
5436
  const useActualHostSelector = vm.renderMode === 0
5444
5437
  /* Light */
5445
5438
  ? !isScopedCss : vm.shadowMode === 0
5446
5439
  /* Native */
5447
- ; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
5448
- // we use an attribute selector on the host to simulate :dir().
5449
-
5450
- let useNativeDirPseudoclass;
5440
+ ; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5451
5441
 
5452
- if (vm.renderMode === 1
5442
+ const scopeToken = isScopedCss || vm.shadowMode === 1
5443
+ /* Synthetic */
5444
+ && vm.renderMode === 1
5453
5445
  /* Shadow */
5454
- ) {
5455
- useNativeDirPseudoclass = vm.shadowMode === 0
5456
- /* Native */
5457
- ;
5458
- } else {
5459
- // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
5460
- // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
5461
- if (shared.isUndefined(root)) {
5462
- // Only calculate the root once as necessary
5463
- root = getNearestShadowComponent(vm);
5464
- }
5465
-
5466
- useNativeDirPseudoclass = shared.isNull(root) || root.shadowMode === 0
5467
- /* Native */
5468
- ;
5469
- }
5470
-
5471
- shared.ArrayPush.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
5446
+ ? stylesheetToken : undefined;
5447
+ shared.ArrayPush.call(content, stylesheet(useActualHostSelector, scopeToken));
5472
5448
  }
5473
5449
  }
5474
5450
 
@@ -5491,12 +5467,14 @@ function getStylesheetsContent(vm, template) {
5491
5467
  // perf testing has not shown it to be a huge improvement yet:
5492
5468
  // https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
5493
5469
 
5494
- function getNearestShadowComponent(vm) {
5470
+ function getNearestNativeShadowComponent(vm) {
5495
5471
  let owner = vm;
5496
5472
 
5497
5473
  while (!shared.isNull(owner)) {
5498
5474
  if (owner.renderMode === 1
5499
5475
  /* Shadow */
5476
+ && owner.shadowMode === 0
5477
+ /* Native */
5500
5478
  ) {
5501
5479
  return owner;
5502
5480
  }
@@ -5507,20 +5485,6 @@ function getNearestShadowComponent(vm) {
5507
5485
  return owner;
5508
5486
  }
5509
5487
 
5510
- function getNearestNativeShadowComponent(vm) {
5511
- const owner = getNearestShadowComponent(vm);
5512
-
5513
- if (!shared.isNull(owner) && owner.shadowMode === 1
5514
- /* Synthetic */
5515
- ) {
5516
- // Synthetic-within-native is impossible. So if the nearest shadow component is
5517
- // synthetic, we know we won't find a native component if we go any further.
5518
- return null;
5519
- }
5520
-
5521
- return owner;
5522
- }
5523
-
5524
5488
  function createStylesheet(vm, stylesheets) {
5525
5489
  const {
5526
5490
  renderer,
@@ -7246,4 +7210,4 @@ exports.swapTemplate = swapTemplate;
7246
7210
  exports.track = track;
7247
7211
  exports.unwrap = unwrap;
7248
7212
  exports.wire = wire;
7249
- /* version: 2.5.9 */
7213
+ /* version: 2.5.12 */
@@ -5413,7 +5413,6 @@ function updateStylesheetToken(vm, template) {
5413
5413
 
5414
5414
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5415
5415
  const content = [];
5416
- let root;
5417
5416
 
5418
5417
  for (let i = 0; i < stylesheets.length; i++) {
5419
5418
  let stylesheet = stylesheets[i];
@@ -5426,46 +5425,23 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5426
5425
  // the component instance might be attempting to use an old version of
5427
5426
  // the stylesheet, while internally, we have a replacement for it.
5428
5427
  stylesheet = getStyleOrSwappedStyle(stylesheet);
5429
- }
5430
-
5431
- const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5432
-
5433
- const scopeToken = isScopedCss || vm.shadowMode === 1
5434
- /* Synthetic */
5435
- && vm.renderMode === 1
5436
- /* Shadow */
5437
- ? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5428
+ } // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5438
5429
  // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5439
5430
 
5431
+
5432
+ const isScopedCss = stylesheet[KEY__SCOPED_CSS];
5440
5433
  const useActualHostSelector = vm.renderMode === 0
5441
5434
  /* Light */
5442
5435
  ? !isScopedCss : vm.shadowMode === 0
5443
5436
  /* Native */
5444
- ; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
5445
- // we use an attribute selector on the host to simulate :dir().
5446
-
5447
- let useNativeDirPseudoclass;
5437
+ ; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5448
5438
 
5449
- if (vm.renderMode === 1
5439
+ const scopeToken = isScopedCss || vm.shadowMode === 1
5440
+ /* Synthetic */
5441
+ && vm.renderMode === 1
5450
5442
  /* Shadow */
5451
- ) {
5452
- useNativeDirPseudoclass = vm.shadowMode === 0
5453
- /* Native */
5454
- ;
5455
- } else {
5456
- // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
5457
- // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
5458
- if (isUndefined$1(root)) {
5459
- // Only calculate the root once as necessary
5460
- root = getNearestShadowComponent(vm);
5461
- }
5462
-
5463
- useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
5464
- /* Native */
5465
- ;
5466
- }
5467
-
5468
- ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
5443
+ ? stylesheetToken : undefined;
5444
+ ArrayPush$1.call(content, stylesheet(useActualHostSelector, scopeToken));
5469
5445
  }
5470
5446
  }
5471
5447
 
@@ -5488,12 +5464,14 @@ function getStylesheetsContent(vm, template) {
5488
5464
  // perf testing has not shown it to be a huge improvement yet:
5489
5465
  // https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
5490
5466
 
5491
- function getNearestShadowComponent(vm) {
5467
+ function getNearestNativeShadowComponent(vm) {
5492
5468
  let owner = vm;
5493
5469
 
5494
5470
  while (!isNull(owner)) {
5495
5471
  if (owner.renderMode === 1
5496
5472
  /* Shadow */
5473
+ && owner.shadowMode === 0
5474
+ /* Native */
5497
5475
  ) {
5498
5476
  return owner;
5499
5477
  }
@@ -5504,20 +5482,6 @@ function getNearestShadowComponent(vm) {
5504
5482
  return owner;
5505
5483
  }
5506
5484
 
5507
- function getNearestNativeShadowComponent(vm) {
5508
- const owner = getNearestShadowComponent(vm);
5509
-
5510
- if (!isNull(owner) && owner.shadowMode === 1
5511
- /* Synthetic */
5512
- ) {
5513
- // Synthetic-within-native is impossible. So if the nearest shadow component is
5514
- // synthetic, we know we won't find a native component if we go any further.
5515
- return null;
5516
- }
5517
-
5518
- return owner;
5519
- }
5520
-
5521
5485
  function createStylesheet(vm, stylesheets) {
5522
5486
  const {
5523
5487
  renderer,
@@ -7210,4 +7174,4 @@ function setHooks(hooks) {
7210
7174
  }
7211
7175
 
7212
7176
  export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, connectRootElement, createContextProvider, createVM, disconnectRootElement, getAssociatedVMIfPresent, getComponentDef, getComponentInternalDef, getUpgradableConstructor, hydrateRootElement, isComponentConstructor, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
7213
- /* version: 2.5.9 */
7177
+ /* version: 2.5.12 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lwc/engine-core",
3
- "version": "2.5.9",
3
+ "version": "2.5.12",
4
4
  "description": "Core LWC engine APIs.",
5
5
  "homepage": "https://lwc.dev/",
6
6
  "repository": {
@@ -24,8 +24,8 @@
24
24
  "types/"
25
25
  ],
26
26
  "dependencies": {
27
- "@lwc/features": "2.5.9",
28
- "@lwc/shared": "2.5.9"
27
+ "@lwc/features": "2.5.12",
28
+ "@lwc/shared": "2.5.12"
29
29
  },
30
30
  "devDependencies": {
31
31
  "observable-membrane": "1.1.5"
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "3e50c5c599f5eb7af78bcfd6f634df10e8117145"
36
+ "gitHead": "e9d45e1d0cec7f2835c1b4f80142df908279abc9"
37
37
  }
@@ -5,7 +5,7 @@ import { Template } from './template';
5
5
  * Function producing style based on a host and a shadow selector. This function is invoked by
6
6
  * the engine with different values depending on the mode that the component is running on.
7
7
  */
8
- export declare type StylesheetFactory = (stylesheetToken: string | undefined, useActualHostSelector: boolean, useNativeDirPseudoclass: boolean) => string;
8
+ export declare type StylesheetFactory = (useActualHostSelector: boolean, stylesheetToken: string | undefined) => string;
9
9
  /**
10
10
  * The list of stylesheets associated with a template. Each entry is either a StylesheetFactory or a
11
11
  * TemplateStylesheetFactory a given stylesheet depends on other external stylesheets (via the