@lwc/engine-core 2.3.4 → 2.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lwc/engine-core",
3
- "version": "2.3.4",
3
+ "version": "2.5.1",
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.3.4",
28
- "@lwc/shared": "2.3.4"
27
+ "@lwc/features": "2.5.1",
28
+ "@lwc/shared": "2.5.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "observable-membrane": "1.0.1"
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "4c002dbcc8c6ae61f7719f71d2208f69220cf2c6"
36
+ "gitHead": "443fa2e0a54c8940814292aac84d40e7eb69b22f"
37
37
  }
@@ -2,7 +2,8 @@ export declare type HostNode = any;
2
2
  export declare type HostElement = any;
3
3
  export interface Renderer<N = HostNode, E = HostElement> {
4
4
  ssr: boolean;
5
- syntheticShadow: boolean;
5
+ isNativeShadowDefined: boolean;
6
+ isSyntheticShadowDefined: boolean;
6
7
  insert(node: N, parent: E, anchor: N | null): void;
7
8
  remove(node: N, parent: E): void;
8
9
  createElement(tagName: string, namespace?: string): E;
@@ -28,6 +29,7 @@ export interface Renderer<N = HostNode, E = HostElement> {
28
29
  getElementsByClassName(element: E, names: string): HTMLCollection;
29
30
  isConnected(node: N): boolean;
30
31
  insertGlobalStylesheet(content: string): void;
32
+ insertStylesheet(content: string, target: N): void;
31
33
  assertInstanceOfHTMLElement?(elm: any, msg: string): void;
32
34
  defineCustomElement(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void;
33
35
  getCustomElement(name: string): CustomElementConstructor | undefined;
@@ -5,13 +5,13 @@ 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 = (hostSelector: string, shadowSelector: string, nativeShadow: 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
12
12
  * @import CSS declaration).
13
13
  */
14
14
  export declare type TemplateStylesheetFactories = Array<StylesheetFactory | TemplateStylesheetFactories>;
15
- export declare function updateSyntheticShadowAttributes(vm: VM, template: Template): void;
15
+ export declare function updateStylesheetToken(vm: VM, template: Template): void;
16
16
  export declare function getStylesheetsContent(vm: VM, template: Template): string[];
17
17
  export declare function createStylesheet(vm: VM, stylesheets: string[]): VNode | null;
@@ -2,23 +2,14 @@ import { VNode, VNodes } from '../3rdparty/snabbdom/types';
2
2
  import { RenderAPI } from './api';
3
3
  import { SlotSet, TemplateCache, VM } from './vm';
4
4
  import { TemplateStylesheetFactories } from './stylesheet';
5
- export interface TemplateStylesheetTokens {
6
- /** HTML attribute that need to be applied to the host element. This attribute is used for
7
- * the `:host` pseudo class CSS selector. */
8
- hostAttribute: string;
9
- /** HTML attribute that need to the applied to all the element that the template produces.
10
- * This attribute is used for style encapsulation when the engine runs with synthetic
11
- * shadow. */
12
- shadowAttribute: string;
13
- }
14
5
  export interface Template {
15
6
  (api: RenderAPI, cmp: object, slotSet: SlotSet, cache: TemplateCache): VNodes;
16
7
  /** The list of slot names used in the template. */
17
8
  slots?: string[];
18
9
  /** The stylesheet associated with the template. */
19
10
  stylesheets?: TemplateStylesheetFactories;
20
- /** The stylesheet tokens used for synthetic shadow style scoping. */
21
- stylesheetTokens?: TemplateStylesheetTokens;
11
+ /** The string used for synthetic shadow style scoping and light DOM style scoping. */
12
+ stylesheetToken?: string;
22
13
  /** Render mode for the template. Could be light or undefined (which means it's shadow) */
23
14
  renderMode?: 'light';
24
15
  }
@@ -26,3 +17,4 @@ export declare let isUpdatingTemplate: boolean;
26
17
  export declare function getVMBeingRendered(): VM | null;
27
18
  export declare function setVMBeingRendered(vm: VM | null): void;
28
19
  export declare function evaluateTemplate(vm: VM, html: Template): Array<VNode | null>;
20
+ export declare function computeHasScopedStyles(template: Template): boolean;
@@ -30,10 +30,14 @@ export declare const enum ShadowSupportMode {
30
30
  Default = "default"
31
31
  }
32
32
  export interface Context {
33
- /** The attribute name used on the host element to scope the style. */
34
- hostAttribute: string | undefined;
35
- /** The attribute name used on all the elements rendered in the shadow tree to scope the style. */
36
- shadowAttribute: string | undefined;
33
+ /** The string used for synthetic shadow DOM and light DOM style scoping. */
34
+ stylesheetToken: string | undefined;
35
+ /** True if a stylesheetToken was added to the host class */
36
+ hasTokenInClass: boolean | undefined;
37
+ /** True if a stylesheetToken was added to the host attributes */
38
+ hasTokenInAttribute: boolean | undefined;
39
+ /** Whether or not light DOM scoped styles are present in the stylesheets. */
40
+ hasScopedStyles: boolean | undefined;
37
41
  /** The VNode injected in all the shadow trees to apply the associated component stylesheets. */
38
42
  styleVNode: VNode | null;
39
43
  /** Object used by the template function to store information that can be reused between