@lwc/template-compiler 6.6.2 → 7.0.0-alpha.0

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.
@@ -0,0 +1,6 @@
1
+ export type scopeTokens = {
2
+ scopeToken: string;
3
+ legacyScopeToken: string;
4
+ cssScopeTokens: string[];
5
+ };
6
+ export declare function generateScopeTokens(filename: string, namespace: string | undefined, name: string | undefined): scopeTokens;
@@ -5,6 +5,10 @@ export declare const PARSE_SVG_FRAGMENT_METHOD_NAME = "parseSVGFragment";
5
5
  export declare const RENDERER = "renderer";
6
6
  export declare const LWC_MODULE_NAME = "lwc";
7
7
  export declare const TEMPLATE_MODULES_PARAMETER: string;
8
+ export declare const FREEZE_TEMPLATE = "freezeTemplate";
9
+ export declare const IMPLICIT_STYLESHEETS = "_implicitStylesheets";
10
+ export declare const IMPLICIT_SCOPED_STYLESHEETS = "_implicitScopedStylesheets";
11
+ export declare const IMPLICIT_STYLESHEET_IMPORTS: string[];
8
12
  export declare const TEMPLATE_FUNCTION_NAME: string;
9
13
  export declare const TEMPLATE_PARAMS: {
10
14
  [label: string]: string;
@@ -32,6 +32,7 @@ export declare function templateLiteral(quasis: t.TemplateElement[], expressions
32
32
  export declare function assignmentPattern(left: t.Pattern, right: t.Expression): t.AssignmentPattern;
33
33
  export declare function functionExpression(id: null | t.Identifier, params: t.FunctionExpression['params'], body: t.FunctionExpression['body'], config?: Partial<t.FunctionExpression>): t.FunctionExpression;
34
34
  export declare function functionDeclaration(id: t.Identifier, params: t.FunctionDeclaration['params'], body: t.FunctionDeclaration['body'], config?: Partial<t.FunctionDeclaration>): t.FunctionDeclaration;
35
+ export declare function ifStatement(test: t.IfStatement['test'], consequent: t.IfStatement['consequent'], alternate?: t.IfStatement['alternate']): t.IfStatement;
35
36
  export declare function blockStatement(body: t.BlockStatement['body'], config?: Partial<t.BlockStatement>): t.BlockStatement;
36
37
  export declare function returnStatement(argument: t.ReturnStatement['argument'], config?: Partial<t.ReturnStatement>): t.ReturnStatement;
37
38
  export declare function variableDeclarator(id: t.VariableDeclarator['id'], init: t.VariableDeclarator['init'], config?: Partial<t.VariableDeclarator>): t.VariableDeclarator;
@@ -68,6 +69,7 @@ export type Expression = t.Expression;
68
69
  export type FunctionDeclaration = t.FunctionDeclaration;
69
70
  export type ArrowFunctionExpression = t.ArrowFunctionExpression;
70
71
  export type AssignmentPattern = t.AssignmentPattern;
72
+ export type IfStatement = t.IfStatement;
71
73
  export type BlockStatement = t.BlockStatement;
72
74
  export type ReturnStatement = t.ReturnStatement;
73
75
  export type VariableDeclarator = t.VariableDeclarator;
@@ -6,6 +6,7 @@ export interface TemplateParseResult {
6
6
  }
7
7
  export interface TemplateCompileResult extends TemplateParseResult {
8
8
  code: string;
9
+ cssScopeTokens: string[];
9
10
  }
10
11
  export declare enum LWCDirectiveDomMode {
11
12
  manual = "manual"
package/dist/state.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { NormalizedConfig } from './config';
2
1
  import { BaseElement } from './shared/types';
2
+ import { type scopeTokens } from './scopeTokens';
3
+ import type { NormalizedConfig } from './config';
3
4
  export default class State {
4
5
  config: NormalizedConfig;
5
6
  /**
@@ -19,5 +20,13 @@ export default class State {
19
20
  * Cache the result of elements that have already been checked if they require custom renderer
20
21
  */
21
22
  crCheckedElements: Map<BaseElement, boolean>;
22
- constructor(config: NormalizedConfig);
23
+ /**
24
+ * Filename of the HTML source
25
+ */
26
+ filename: string;
27
+ /**
28
+ * Contains the scopeTokens used in the template metadata
29
+ */
30
+ scopeTokens: scopeTokens;
31
+ constructor(config: NormalizedConfig, filename: string);
23
32
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
5
5
  ],
6
6
  "name": "@lwc/template-compiler",
7
- "version": "6.6.2",
7
+ "version": "7.0.0-alpha.0",
8
8
  "description": "Template compiler package",
9
9
  "keywords": [
10
10
  "lwc"
@@ -42,17 +42,17 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@lwc/errors": "6.6.2",
46
- "@lwc/shared": "6.6.2",
45
+ "@lwc/errors": "7.0.0-alpha.0",
46
+ "@lwc/shared": "7.0.0-alpha.0",
47
47
  "acorn": "~8.11.3",
48
48
  "astring": "~1.8.6",
49
49
  "he": "~1.2.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@parse5/tools": "^0.4.0",
52
+ "@parse5/tools": "^0.5.0",
53
53
  "@types/estree": "1.0.5",
54
54
  "@types/he": "^1.2.3",
55
55
  "estree-walker": "~3.0.3",
56
56
  "parse5": "~7.1.2"
57
57
  }
58
- }
58
+ }