@pandacss/compiler-wasm 2.0.0-beta.4 → 2.0.0-beta.6
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/{chunk-R2J25HLY.js → chunk-5E5JPQ3B.js} +36 -4
- package/dist/index.d.ts +17 -8
- package/dist/index.js +8 -6
- package/dist/{web-Z44NGLTK.js → web-2ZQDOLGS.js} +3 -1
- package/dist/web.d.ts +17 -8
- package/dist/web.js +36 -4
- package/package.json +3 -3
- package/pkg-node/compiler_wasm.d.ts +34 -9
- package/pkg-node/compiler_wasm.js +109 -9
- package/pkg-node/compiler_wasm_bg.wasm +0 -0
- package/pkg-node/compiler_wasm_bg.wasm.d.ts +5 -0
- package/pkg-web/compiler_wasm.d.ts +39 -9
- package/pkg-web/compiler_wasm.js +109 -9
- package/pkg-web/compiler_wasm_bg.wasm +0 -0
- package/pkg-web/compiler_wasm_bg.wasm.d.ts +5 -0
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
assertProjectCallbacks,
|
|
4
4
|
assertProjectHooks,
|
|
5
|
+
BuildInfo,
|
|
6
|
+
DesignSystem,
|
|
7
|
+
createUsageReport,
|
|
5
8
|
getTokenCategoryValues,
|
|
6
|
-
|
|
9
|
+
inspectFile,
|
|
10
|
+
inspectFiles,
|
|
7
11
|
mergeCallbacks,
|
|
8
12
|
prepareCompilerConfig
|
|
9
13
|
} from "@pandacss/compiler-shared";
|
|
@@ -78,13 +82,40 @@ function build(mod, config, callbacks, hooks) {
|
|
|
78
82
|
const prepared = prepareCompilerConfig(config);
|
|
79
83
|
const compiler = mod.WasmCompiler.fromConfig(fs, prepared, buildFromConfigOptions(callbacks));
|
|
80
84
|
registerCallbacks(compiler, callbacks, hooks, compiler.token_dictionary?.());
|
|
81
|
-
compiler
|
|
82
|
-
Object.defineProperty(compiler, "
|
|
83
|
-
|
|
85
|
+
Object.defineProperty(compiler, "fs", { value: fs, enumerable: false });
|
|
86
|
+
Object.defineProperty(compiler, "path", { value: wasmPathSystem(compiler), enumerable: false });
|
|
87
|
+
const buildInfo = new BuildInfo(compiler);
|
|
88
|
+
Object.defineProperty(compiler, "buildInfo", { value: buildInfo, enumerable: false });
|
|
89
|
+
Object.defineProperty(compiler, "designSystem", {
|
|
90
|
+
// `load` reuses the `buildInfo` namespace just wired above.
|
|
91
|
+
value: new DesignSystem(toDesignSystemBinding(compiler), buildInfo),
|
|
92
|
+
enumerable: false
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(compiler, "inspectFile", {
|
|
95
|
+
value: (input) => inspectFile(compiler, input),
|
|
96
|
+
enumerable: false
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(compiler, "inspectFiles", {
|
|
99
|
+
value: (files) => inspectFiles(compiler, files),
|
|
84
100
|
enumerable: false
|
|
85
101
|
});
|
|
86
102
|
return compiler;
|
|
87
103
|
}
|
|
104
|
+
function wasmPathSystem(compiler) {
|
|
105
|
+
return {
|
|
106
|
+
realpath: (path) => compiler.realpath(path),
|
|
107
|
+
resolve: (path, cwd) => compiler.resolvePath(path, cwd),
|
|
108
|
+
join: (parts) => compiler.joinPath(parts),
|
|
109
|
+
dirname: (path) => compiler.dirname(path)
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function toDesignSystemBinding(compiler) {
|
|
113
|
+
return {
|
|
114
|
+
createManifest: (input) => compiler.createDesignSystemManifest(input),
|
|
115
|
+
manifestSchemaVersion: () => compiler.designSystemManifestSchemaVersion(),
|
|
116
|
+
resolveChain: (manifests) => compiler.resolveDesignSystemChain(manifests)
|
|
117
|
+
};
|
|
118
|
+
}
|
|
88
119
|
function buildFromConfigOptions(callbacks) {
|
|
89
120
|
const utilityValues = callbacks["utility.values"];
|
|
90
121
|
if (!utilityValues || Object.keys(utilityValues).length === 0) return void 0;
|
|
@@ -101,6 +132,7 @@ function buildFromConfigOptions(callbacks) {
|
|
|
101
132
|
}
|
|
102
133
|
|
|
103
134
|
export {
|
|
135
|
+
createUsageReport,
|
|
104
136
|
mergeCallbacks,
|
|
105
137
|
createCompilerFromWasmModule,
|
|
106
138
|
build,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ParseFileReport, ScanOptions, LayerNames, Spec, SourceEntry, FileInspectionResult, ResolveUtilityValueInput, ResolvedUtilityValue, WriteArtifactsOptions, WriteCssOptions, WriteCssResult, WriteSplitCssOptions, WriteFilesResult, SerializedHookFilter, Atom, RecipeEntry, EncodedRecipeStyles, ProjectSummary, CompileOptions, CompileOutput, LayerCssOptions, SplitCssOptions, CssFile, GenerateArtifactOptions, CodegenArtifact, CodegenArtifactId, CodegenDependency, Diagnostic, CompileFileManifest, ParsedFileView, StaticPatternResult,
|
|
1
|
+
import { ParseFileReport, ScanOptions, LayerNames, Spec, SourceEntry, FileInspectionResult, ResolveUtilityValueInput, ResolvedUtilityValue, TokenSuggestion, WriteArtifactsOptions, WriteCssOptions, WriteCssResult, WriteLayerCssOptions, WriteSplitCssOptions, WriteFilesResult, SerializedHookFilter, Atom, RecipeEntry, EncodedRecipeStyles, ProjectSummary, CompileOptions, CompileOutput, LayerCssOptions, SplitCssOptions, CssFile, GenerateArtifactOptions, CodegenArtifact, CodegenArtifactId, CodegenDependency, Diagnostic, CompileFileManifest, ParsedFileView, StaticPatternResult, BuildInfoArtifact, DesignSystemManifestInput, DesignSystemManifest, DesignSystemChainPlan, SerializedConfig, CompilerOptions, Compiler, ProjectCallbacks, ProjectHooks, ConfigSnapshot, Driver } from '@pandacss/compiler-shared';
|
|
2
2
|
export * from '@pandacss/compiler-shared';
|
|
3
|
-
export { PatternHelpers, mergeCallbacks } from '@pandacss/compiler-shared';
|
|
3
|
+
export { PatternHelpers, createUsageReport, mergeCallbacks } from '@pandacss/compiler-shared';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* TS-facing types that mirror the wasm-bindgen generated interfaces.
|
|
@@ -86,10 +86,12 @@ declare class WasmCompiler {
|
|
|
86
86
|
hasLayerDeclaration(css: string): boolean;
|
|
87
87
|
spec(): Spec;
|
|
88
88
|
sources(): SourceEntry[];
|
|
89
|
-
inspectFileSource(path: string, source: string): FileInspectionResult
|
|
89
|
+
inspectFileSource(path: string, source: string): Omit<FileInspectionResult, 'path'>;
|
|
90
90
|
resolveUtilityValue(input: ResolveUtilityValueInput): ResolvedUtilityValue | null;
|
|
91
|
+
suggestTokens(prop: string, value: string): TokenSuggestion[];
|
|
91
92
|
writeArtifacts(options: WriteArtifactsOptions): string[];
|
|
92
93
|
writeCss(options: WriteCssOptions): WriteCssResult;
|
|
94
|
+
writeLayerCss(options: WriteLayerCssOptions): WriteCssResult;
|
|
93
95
|
writeSplitCss(options: WriteSplitCssOptions): WriteFilesResult;
|
|
94
96
|
isEmpty(): boolean;
|
|
95
97
|
registerUtilityTransform?(id: string, callback: (resolved: unknown, original: unknown) => unknown): void;
|
|
@@ -111,10 +113,13 @@ declare class WasmCompiler {
|
|
|
111
113
|
/** Per-file view, or `null` when `path` isn't known. */
|
|
112
114
|
getFile(path: string): ParsedFileView | null;
|
|
113
115
|
staticPatternAtoms(): StaticPatternResult;
|
|
114
|
-
serializeBuildInfo(panda: string):
|
|
115
|
-
applyBuildInfo(name: string, buildInfo:
|
|
116
|
+
serializeBuildInfo(panda: string): BuildInfoArtifact;
|
|
117
|
+
applyBuildInfo(name: string, buildInfo: BuildInfoArtifact, only?: string[]): boolean;
|
|
116
118
|
buildInfoSchemaVersion(): number;
|
|
117
119
|
configFingerprint(): string;
|
|
120
|
+
createDesignSystemManifest(input: DesignSystemManifestInput): DesignSystemManifest;
|
|
121
|
+
designSystemManifestSchemaVersion(): number;
|
|
122
|
+
resolveDesignSystemChain(manifests: DesignSystemManifest[]): DesignSystemChainPlan;
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
/**
|
|
@@ -136,14 +141,18 @@ declare class WasmCompiler {
|
|
|
136
141
|
* ```
|
|
137
142
|
*/
|
|
138
143
|
|
|
139
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* `configCallbacks` carry construction-time `utility.values` resolvers.
|
|
146
|
+
*/
|
|
140
147
|
interface WasmFromConfigOptions {
|
|
141
148
|
configCallbacks?: {
|
|
142
149
|
utilityValues?: Record<string, (tokenDictionary: TokenDictionaryInput | undefined) => unknown>;
|
|
143
150
|
};
|
|
144
151
|
}
|
|
145
|
-
/**
|
|
146
|
-
*
|
|
152
|
+
/**
|
|
153
|
+
* The raw wasm instance - superset of {@link Compiler} carrying the internal
|
|
154
|
+
* `token_dictionary` the facade hides.
|
|
155
|
+
*/
|
|
147
156
|
interface RawWasmCompiler extends WasmCompiler {
|
|
148
157
|
token_dictionary?(): TokenDictionaryInput | undefined;
|
|
149
158
|
}
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
build,
|
|
3
3
|
buildFromConfigOptions,
|
|
4
4
|
createCompilerFromWasmModule,
|
|
5
|
+
createUsageReport,
|
|
5
6
|
mergeCallbacks
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5E5JPQ3B.js";
|
|
7
8
|
|
|
8
9
|
// src/index.ts
|
|
9
10
|
import { createRequire } from "module";
|
|
@@ -20,7 +21,7 @@ async function createBrowserDriver(options) {
|
|
|
20
21
|
}) : await createCompilerFromSnapshot(options.snapshot);
|
|
21
22
|
if (options.sources) {
|
|
22
23
|
for (const [path, content] of Object.entries(options.sources)) {
|
|
23
|
-
compiler.fs?.
|
|
24
|
+
compiler.fs.addFile?.(path, content);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
return new BrowserDriver(compiler, options.snapshot.config);
|
|
@@ -47,16 +48,16 @@ var BrowserDriver = class extends BaseDriver {
|
|
|
47
48
|
}
|
|
48
49
|
applyChange(change) {
|
|
49
50
|
if (change.kind === "unlink") {
|
|
50
|
-
this.compiler.fs?.
|
|
51
|
+
this.compiler.fs.removeFile?.(change.path);
|
|
51
52
|
return this.compiler.removeFile(change.path);
|
|
52
53
|
}
|
|
53
54
|
if (change.content == null) return false;
|
|
54
|
-
this.compiler.fs?.
|
|
55
|
+
this.compiler.fs.addFile?.(change.path, change.content);
|
|
55
56
|
this.compiler.parseFileSource(change.path, change.content);
|
|
56
57
|
return true;
|
|
57
58
|
}
|
|
58
59
|
getOutdir(outdir) {
|
|
59
|
-
return this.compiler.
|
|
60
|
+
return this.compiler.path.resolve(this.getConfiguredOutdir(outdir));
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
63
|
|
|
@@ -73,7 +74,7 @@ async function loadWasm() {
|
|
|
73
74
|
return mod;
|
|
74
75
|
}
|
|
75
76
|
async function createCompiler(config, options) {
|
|
76
|
-
const { createCompilerFromWasmModule: createCompilerFromWasmModule2 } = await import("./web-
|
|
77
|
+
const { createCompilerFromWasmModule: createCompilerFromWasmModule2 } = await import("./web-2ZQDOLGS.js");
|
|
77
78
|
return createCompilerFromWasmModule2(await loadWasm(), config, options);
|
|
78
79
|
}
|
|
79
80
|
async function createCompilerFromSnapshot(snapshot, options) {
|
|
@@ -88,6 +89,7 @@ export {
|
|
|
88
89
|
createCompiler,
|
|
89
90
|
createCompilerFromSnapshot,
|
|
90
91
|
createCompilerFromWasmModule,
|
|
92
|
+
createUsageReport,
|
|
91
93
|
loadWasm,
|
|
92
94
|
mergeCallbacks
|
|
93
95
|
};
|
|
@@ -2,11 +2,13 @@ import {
|
|
|
2
2
|
build,
|
|
3
3
|
buildFromConfigOptions,
|
|
4
4
|
createCompilerFromWasmModule,
|
|
5
|
+
createUsageReport,
|
|
5
6
|
mergeCallbacks
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5E5JPQ3B.js";
|
|
7
8
|
export {
|
|
8
9
|
build,
|
|
9
10
|
buildFromConfigOptions,
|
|
10
11
|
createCompilerFromWasmModule,
|
|
12
|
+
createUsageReport,
|
|
11
13
|
mergeCallbacks
|
|
12
14
|
};
|
package/dist/web.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ParseFileReport, ScanOptions, LayerNames, Spec, SourceEntry, FileInspectionResult, ResolveUtilityValueInput, ResolvedUtilityValue, WriteArtifactsOptions, WriteCssOptions, WriteCssResult, WriteSplitCssOptions, WriteFilesResult, SerializedHookFilter, Atom, RecipeEntry, EncodedRecipeStyles, ProjectSummary, CompileOptions, CompileOutput, LayerCssOptions, SplitCssOptions, CssFile, GenerateArtifactOptions, CodegenArtifact, CodegenArtifactId, CodegenDependency, Diagnostic, CompileFileManifest, ParsedFileView, StaticPatternResult,
|
|
1
|
+
import { ParseFileReport, ScanOptions, LayerNames, Spec, SourceEntry, FileInspectionResult, ResolveUtilityValueInput, ResolvedUtilityValue, TokenSuggestion, WriteArtifactsOptions, WriteCssOptions, WriteCssResult, WriteLayerCssOptions, WriteSplitCssOptions, WriteFilesResult, SerializedHookFilter, Atom, RecipeEntry, EncodedRecipeStyles, ProjectSummary, CompileOptions, CompileOutput, LayerCssOptions, SplitCssOptions, CssFile, GenerateArtifactOptions, CodegenArtifact, CodegenArtifactId, CodegenDependency, Diagnostic, CompileFileManifest, ParsedFileView, StaticPatternResult, BuildInfoArtifact, DesignSystemManifestInput, DesignSystemManifest, DesignSystemChainPlan, SerializedConfig, CompilerOptions, Compiler, ProjectCallbacks, ProjectHooks } from '@pandacss/compiler-shared';
|
|
2
2
|
export * from '@pandacss/compiler-shared';
|
|
3
|
-
export { PatternHelpers, mergeCallbacks } from '@pandacss/compiler-shared';
|
|
3
|
+
export { PatternHelpers, createUsageReport, mergeCallbacks } from '@pandacss/compiler-shared';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* TS-facing types that mirror the wasm-bindgen generated interfaces.
|
|
@@ -86,10 +86,12 @@ declare class WasmCompiler {
|
|
|
86
86
|
hasLayerDeclaration(css: string): boolean;
|
|
87
87
|
spec(): Spec;
|
|
88
88
|
sources(): SourceEntry[];
|
|
89
|
-
inspectFileSource(path: string, source: string): FileInspectionResult
|
|
89
|
+
inspectFileSource(path: string, source: string): Omit<FileInspectionResult, 'path'>;
|
|
90
90
|
resolveUtilityValue(input: ResolveUtilityValueInput): ResolvedUtilityValue | null;
|
|
91
|
+
suggestTokens(prop: string, value: string): TokenSuggestion[];
|
|
91
92
|
writeArtifacts(options: WriteArtifactsOptions): string[];
|
|
92
93
|
writeCss(options: WriteCssOptions): WriteCssResult;
|
|
94
|
+
writeLayerCss(options: WriteLayerCssOptions): WriteCssResult;
|
|
93
95
|
writeSplitCss(options: WriteSplitCssOptions): WriteFilesResult;
|
|
94
96
|
isEmpty(): boolean;
|
|
95
97
|
registerUtilityTransform?(id: string, callback: (resolved: unknown, original: unknown) => unknown): void;
|
|
@@ -111,10 +113,13 @@ declare class WasmCompiler {
|
|
|
111
113
|
/** Per-file view, or `null` when `path` isn't known. */
|
|
112
114
|
getFile(path: string): ParsedFileView | null;
|
|
113
115
|
staticPatternAtoms(): StaticPatternResult;
|
|
114
|
-
serializeBuildInfo(panda: string):
|
|
115
|
-
applyBuildInfo(name: string, buildInfo:
|
|
116
|
+
serializeBuildInfo(panda: string): BuildInfoArtifact;
|
|
117
|
+
applyBuildInfo(name: string, buildInfo: BuildInfoArtifact, only?: string[]): boolean;
|
|
116
118
|
buildInfoSchemaVersion(): number;
|
|
117
119
|
configFingerprint(): string;
|
|
120
|
+
createDesignSystemManifest(input: DesignSystemManifestInput): DesignSystemManifest;
|
|
121
|
+
designSystemManifestSchemaVersion(): number;
|
|
122
|
+
resolveDesignSystemChain(manifests: DesignSystemManifest[]): DesignSystemChainPlan;
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
/**
|
|
@@ -136,14 +141,18 @@ declare class WasmCompiler {
|
|
|
136
141
|
* ```
|
|
137
142
|
*/
|
|
138
143
|
|
|
139
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* `configCallbacks` carry construction-time `utility.values` resolvers.
|
|
146
|
+
*/
|
|
140
147
|
interface WasmFromConfigOptions {
|
|
141
148
|
configCallbacks?: {
|
|
142
149
|
utilityValues?: Record<string, (tokenDictionary: TokenDictionaryInput | undefined) => unknown>;
|
|
143
150
|
};
|
|
144
151
|
}
|
|
145
|
-
/**
|
|
146
|
-
*
|
|
152
|
+
/**
|
|
153
|
+
* The raw wasm instance - superset of {@link Compiler} carrying the internal
|
|
154
|
+
* `token_dictionary` the facade hides.
|
|
155
|
+
*/
|
|
147
156
|
interface RawWasmCompiler extends WasmCompiler {
|
|
148
157
|
token_dictionary?(): TokenDictionaryInput | undefined;
|
|
149
158
|
}
|
package/dist/web.js
CHANGED
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
assertProjectCallbacks,
|
|
4
4
|
assertProjectHooks,
|
|
5
|
+
BuildInfo,
|
|
6
|
+
DesignSystem,
|
|
7
|
+
createUsageReport,
|
|
5
8
|
getTokenCategoryValues,
|
|
6
|
-
|
|
9
|
+
inspectFile,
|
|
10
|
+
inspectFiles,
|
|
7
11
|
mergeCallbacks,
|
|
8
12
|
prepareCompilerConfig
|
|
9
13
|
} from "@pandacss/compiler-shared";
|
|
@@ -78,13 +82,40 @@ function build(mod, config, callbacks, hooks) {
|
|
|
78
82
|
const prepared = prepareCompilerConfig(config);
|
|
79
83
|
const compiler = mod.WasmCompiler.fromConfig(fs, prepared, buildFromConfigOptions(callbacks));
|
|
80
84
|
registerCallbacks(compiler, callbacks, hooks, compiler.token_dictionary?.());
|
|
81
|
-
compiler
|
|
82
|
-
Object.defineProperty(compiler, "
|
|
83
|
-
|
|
85
|
+
Object.defineProperty(compiler, "fs", { value: fs, enumerable: false });
|
|
86
|
+
Object.defineProperty(compiler, "path", { value: wasmPathSystem(compiler), enumerable: false });
|
|
87
|
+
const buildInfo = new BuildInfo(compiler);
|
|
88
|
+
Object.defineProperty(compiler, "buildInfo", { value: buildInfo, enumerable: false });
|
|
89
|
+
Object.defineProperty(compiler, "designSystem", {
|
|
90
|
+
// `load` reuses the `buildInfo` namespace just wired above.
|
|
91
|
+
value: new DesignSystem(toDesignSystemBinding(compiler), buildInfo),
|
|
92
|
+
enumerable: false
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(compiler, "inspectFile", {
|
|
95
|
+
value: (input) => inspectFile(compiler, input),
|
|
96
|
+
enumerable: false
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(compiler, "inspectFiles", {
|
|
99
|
+
value: (files) => inspectFiles(compiler, files),
|
|
84
100
|
enumerable: false
|
|
85
101
|
});
|
|
86
102
|
return compiler;
|
|
87
103
|
}
|
|
104
|
+
function wasmPathSystem(compiler) {
|
|
105
|
+
return {
|
|
106
|
+
realpath: (path) => compiler.realpath(path),
|
|
107
|
+
resolve: (path, cwd) => compiler.resolvePath(path, cwd),
|
|
108
|
+
join: (parts) => compiler.joinPath(parts),
|
|
109
|
+
dirname: (path) => compiler.dirname(path)
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function toDesignSystemBinding(compiler) {
|
|
113
|
+
return {
|
|
114
|
+
createManifest: (input) => compiler.createDesignSystemManifest(input),
|
|
115
|
+
manifestSchemaVersion: () => compiler.designSystemManifestSchemaVersion(),
|
|
116
|
+
resolveChain: (manifests) => compiler.resolveDesignSystemChain(manifests)
|
|
117
|
+
};
|
|
118
|
+
}
|
|
88
119
|
function buildFromConfigOptions(callbacks) {
|
|
89
120
|
const utilityValues = callbacks["utility.values"];
|
|
90
121
|
if (!utilityValues || Object.keys(utilityValues).length === 0) return void 0;
|
|
@@ -103,5 +134,6 @@ export {
|
|
|
103
134
|
build,
|
|
104
135
|
buildFromConfigOptions,
|
|
105
136
|
createCompilerFromWasmModule,
|
|
137
|
+
createUsageReport,
|
|
106
138
|
mergeCallbacks
|
|
107
139
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/compiler-wasm",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.6",
|
|
4
4
|
"description": "WebAssembly binding for the Panda compiler engine (browser/playground target)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"pkg-web"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@pandacss/compiler-shared": "2.0.0-beta.
|
|
41
|
+
"@pandacss/compiler-shared": "2.0.0-beta.6"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@pandacss/config": "2.0.0-beta.
|
|
44
|
+
"@pandacss/config": "2.0.0-beta.6"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=22"
|
|
@@ -65,6 +65,18 @@ export class WasmCompiler {
|
|
|
65
65
|
* stamped into build info as `configFingerprint`.
|
|
66
66
|
*/
|
|
67
67
|
configFingerprint(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Build a `panda.lib.json` value from host-supplied fields, stamping the
|
|
70
|
+
* engine-owned schema version. Backs the `designSystem.create` JS namespace.
|
|
71
|
+
*
|
|
72
|
+
* # Errors
|
|
73
|
+
* Returns a JS error if `input` is invalid or the manifest fails to serialize.
|
|
74
|
+
*/
|
|
75
|
+
createDesignSystemManifest(input: any): any;
|
|
76
|
+
/**
|
|
77
|
+
* The manifest wire-format version this binding reads/writes.
|
|
78
|
+
*/
|
|
79
|
+
designSystemManifestSchemaVersion(): number;
|
|
68
80
|
/**
|
|
69
81
|
* Config validation diagnostics from construction.
|
|
70
82
|
*
|
|
@@ -220,24 +232,30 @@ export class WasmCompiler {
|
|
|
220
232
|
*/
|
|
221
233
|
refreshFileSource(path: string, source: string): boolean;
|
|
222
234
|
/**
|
|
223
|
-
* Register a JS-backed pattern transform callback.
|
|
224
|
-
* installs callbacks referenced by the serialized config snapshot.
|
|
235
|
+
* Register a JS-backed pattern transform callback.
|
|
225
236
|
*/
|
|
226
237
|
registerPatternTransform(id: string, callback: Function): void;
|
|
227
238
|
/**
|
|
228
|
-
* Register a JS-backed `parser:before` source transform
|
|
229
|
-
* filter. The filter is evaluated before calling into JS.
|
|
239
|
+
* Register a JS-backed `parser:before` source transform.
|
|
230
240
|
*/
|
|
231
241
|
registerSourceTransform(id: string, filter: any, callback: Function): void;
|
|
232
242
|
/**
|
|
233
|
-
* Register a JS-backed utility transform callback.
|
|
234
|
-
* the user callback so Rust only has to pass the raw value.
|
|
243
|
+
* Register a JS-backed utility transform callback.
|
|
235
244
|
*/
|
|
236
245
|
registerUtilityTransform(id: string, callback: Function): void;
|
|
237
246
|
/**
|
|
238
247
|
* Drop a file's contribution. Returns `true` if the path was known.
|
|
239
248
|
*/
|
|
240
249
|
removeFile(path: string): boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Order already-read manifests by their `designSystem` parent links into a
|
|
252
|
+
* root-first hydrate/merge plan (or report a cycle). Backs the
|
|
253
|
+
* `designSystem.resolveChain` JS namespace. Pure — the host did the reads.
|
|
254
|
+
*
|
|
255
|
+
* # Errors
|
|
256
|
+
* Returns a JS error if `manifests` is invalid or the plan fails to serialize.
|
|
257
|
+
*/
|
|
258
|
+
resolveDesignSystemChain(manifests: any): any;
|
|
241
259
|
resolvePath(path: string, cwd?: string | null): string;
|
|
242
260
|
/**
|
|
243
261
|
* Resolve selector and CSS metadata for one utility value.
|
|
@@ -292,6 +310,13 @@ export class WasmCompiler {
|
|
|
292
310
|
* Returns a JS error if serializing fails.
|
|
293
311
|
*/
|
|
294
312
|
staticPatternAtoms(): any;
|
|
313
|
+
/**
|
|
314
|
+
* Tokens that carry a hardcoded value, ranked (safe equivalents first).
|
|
315
|
+
*
|
|
316
|
+
* # Errors
|
|
317
|
+
* Returns a JS error if serialization fails.
|
|
318
|
+
*/
|
|
319
|
+
suggestTokens(prop: string, value: string): any;
|
|
295
320
|
/**
|
|
296
321
|
* Aggregate counts.
|
|
297
322
|
*
|
|
@@ -304,14 +329,14 @@ export class WasmCompiler {
|
|
|
304
329
|
*/
|
|
305
330
|
token_dictionary(): any;
|
|
306
331
|
/**
|
|
307
|
-
* Generate artifacts and write them under `outdir
|
|
308
|
-
* Returns the written paths.
|
|
332
|
+
* Generate artifacts and write them under `outdir`.
|
|
309
333
|
*
|
|
310
334
|
* # Errors
|
|
311
|
-
* Returns a JS error if
|
|
335
|
+
* Returns a JS error if writing or serializing fails.
|
|
312
336
|
*/
|
|
313
337
|
writeArtifacts(options: any): any;
|
|
314
338
|
writeCss(options: any): any;
|
|
339
|
+
writeLayerCss(options: any): any;
|
|
315
340
|
writeSplitCss(options: any): any;
|
|
316
341
|
}
|
|
317
342
|
|
|
@@ -165,6 +165,38 @@ class WasmCompiler {
|
|
|
165
165
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Build a `panda.lib.json` value from host-supplied fields, stamping the
|
|
170
|
+
* engine-owned schema version. Backs the `designSystem.create` JS namespace.
|
|
171
|
+
*
|
|
172
|
+
* # Errors
|
|
173
|
+
* Returns a JS error if `input` is invalid or the manifest fails to serialize.
|
|
174
|
+
* @param {any} input
|
|
175
|
+
* @returns {any}
|
|
176
|
+
*/
|
|
177
|
+
createDesignSystemManifest(input) {
|
|
178
|
+
try {
|
|
179
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
180
|
+
wasm.wasmcompiler_createDesignSystemManifest(retptr, this.__wbg_ptr, addHeapObject(input));
|
|
181
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
182
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
183
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
184
|
+
if (r2) {
|
|
185
|
+
throw takeObject(r1);
|
|
186
|
+
}
|
|
187
|
+
return takeObject(r0);
|
|
188
|
+
} finally {
|
|
189
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The manifest wire-format version this binding reads/writes.
|
|
194
|
+
* @returns {number}
|
|
195
|
+
*/
|
|
196
|
+
designSystemManifestSchemaVersion() {
|
|
197
|
+
const ret = wasm.wasmcompiler_designSystemManifestSchemaVersion(this.__wbg_ptr);
|
|
198
|
+
return ret >>> 0;
|
|
199
|
+
}
|
|
168
200
|
/**
|
|
169
201
|
* Config validation diagnostics from construction.
|
|
170
202
|
*
|
|
@@ -730,8 +762,7 @@ class WasmCompiler {
|
|
|
730
762
|
return ret !== 0;
|
|
731
763
|
}
|
|
732
764
|
/**
|
|
733
|
-
* Register a JS-backed pattern transform callback.
|
|
734
|
-
* installs callbacks referenced by the serialized config snapshot.
|
|
765
|
+
* Register a JS-backed pattern transform callback.
|
|
735
766
|
* @param {string} id
|
|
736
767
|
* @param {Function} callback
|
|
737
768
|
*/
|
|
@@ -741,8 +772,7 @@ class WasmCompiler {
|
|
|
741
772
|
wasm.wasmcompiler_registerPatternTransform(this.__wbg_ptr, ptr0, len0, addHeapObject(callback));
|
|
742
773
|
}
|
|
743
774
|
/**
|
|
744
|
-
* Register a JS-backed `parser:before` source transform
|
|
745
|
-
* filter. The filter is evaluated before calling into JS.
|
|
775
|
+
* Register a JS-backed `parser:before` source transform.
|
|
746
776
|
* @param {string} id
|
|
747
777
|
* @param {any} filter
|
|
748
778
|
* @param {Function} callback
|
|
@@ -763,8 +793,7 @@ class WasmCompiler {
|
|
|
763
793
|
}
|
|
764
794
|
}
|
|
765
795
|
/**
|
|
766
|
-
* Register a JS-backed utility transform callback.
|
|
767
|
-
* the user callback so Rust only has to pass the raw value.
|
|
796
|
+
* Register a JS-backed utility transform callback.
|
|
768
797
|
* @param {string} id
|
|
769
798
|
* @param {Function} callback
|
|
770
799
|
*/
|
|
@@ -784,6 +813,31 @@ class WasmCompiler {
|
|
|
784
813
|
const ret = wasm.wasmcompiler_removeFile(this.__wbg_ptr, ptr0, len0);
|
|
785
814
|
return ret !== 0;
|
|
786
815
|
}
|
|
816
|
+
/**
|
|
817
|
+
* Order already-read manifests by their `designSystem` parent links into a
|
|
818
|
+
* root-first hydrate/merge plan (or report a cycle). Backs the
|
|
819
|
+
* `designSystem.resolveChain` JS namespace. Pure — the host did the reads.
|
|
820
|
+
*
|
|
821
|
+
* # Errors
|
|
822
|
+
* Returns a JS error if `manifests` is invalid or the plan fails to serialize.
|
|
823
|
+
* @param {any} manifests
|
|
824
|
+
* @returns {any}
|
|
825
|
+
*/
|
|
826
|
+
resolveDesignSystemChain(manifests) {
|
|
827
|
+
try {
|
|
828
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
829
|
+
wasm.wasmcompiler_resolveDesignSystemChain(retptr, this.__wbg_ptr, addHeapObject(manifests));
|
|
830
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
831
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
832
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
833
|
+
if (r2) {
|
|
834
|
+
throw takeObject(r1);
|
|
835
|
+
}
|
|
836
|
+
return takeObject(r0);
|
|
837
|
+
} finally {
|
|
838
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
787
841
|
/**
|
|
788
842
|
* @param {string} path
|
|
789
843
|
* @param {string | null} [cwd]
|
|
@@ -972,6 +1026,34 @@ class WasmCompiler {
|
|
|
972
1026
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
973
1027
|
}
|
|
974
1028
|
}
|
|
1029
|
+
/**
|
|
1030
|
+
* Tokens that carry a hardcoded value, ranked (safe equivalents first).
|
|
1031
|
+
*
|
|
1032
|
+
* # Errors
|
|
1033
|
+
* Returns a JS error if serialization fails.
|
|
1034
|
+
* @param {string} prop
|
|
1035
|
+
* @param {string} value
|
|
1036
|
+
* @returns {any}
|
|
1037
|
+
*/
|
|
1038
|
+
suggestTokens(prop, value) {
|
|
1039
|
+
try {
|
|
1040
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1041
|
+
const ptr0 = passStringToWasm0(prop, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1042
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1043
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1044
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1045
|
+
wasm.wasmcompiler_suggestTokens(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1046
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1047
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1048
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1049
|
+
if (r2) {
|
|
1050
|
+
throw takeObject(r1);
|
|
1051
|
+
}
|
|
1052
|
+
return takeObject(r0);
|
|
1053
|
+
} finally {
|
|
1054
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
975
1057
|
/**
|
|
976
1058
|
* Aggregate counts.
|
|
977
1059
|
*
|
|
@@ -1014,11 +1096,10 @@ class WasmCompiler {
|
|
|
1014
1096
|
}
|
|
1015
1097
|
}
|
|
1016
1098
|
/**
|
|
1017
|
-
* Generate artifacts and write them under `outdir
|
|
1018
|
-
* Returns the written paths.
|
|
1099
|
+
* Generate artifacts and write them under `outdir`.
|
|
1019
1100
|
*
|
|
1020
1101
|
* # Errors
|
|
1021
|
-
* Returns a JS error if
|
|
1102
|
+
* Returns a JS error if writing or serializing fails.
|
|
1022
1103
|
* @param {any} options
|
|
1023
1104
|
* @returns {any}
|
|
1024
1105
|
*/
|
|
@@ -1056,6 +1137,25 @@ class WasmCompiler {
|
|
|
1056
1137
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1057
1138
|
}
|
|
1058
1139
|
}
|
|
1140
|
+
/**
|
|
1141
|
+
* @param {any} options
|
|
1142
|
+
* @returns {any}
|
|
1143
|
+
*/
|
|
1144
|
+
writeLayerCss(options) {
|
|
1145
|
+
try {
|
|
1146
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1147
|
+
wasm.wasmcompiler_writeLayerCss(retptr, this.__wbg_ptr, addHeapObject(options));
|
|
1148
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1149
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1150
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1151
|
+
if (r2) {
|
|
1152
|
+
throw takeObject(r1);
|
|
1153
|
+
}
|
|
1154
|
+
return takeObject(r0);
|
|
1155
|
+
} finally {
|
|
1156
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1059
1159
|
/**
|
|
1060
1160
|
* @param {any} options
|
|
1061
1161
|
* @returns {any}
|
|
Binary file
|
|
@@ -11,6 +11,8 @@ export const wasmcompiler_clear: (a: number) => void;
|
|
|
11
11
|
export const wasmcompiler_compile: (a: number, b: number, c: number) => void;
|
|
12
12
|
export const wasmcompiler_config: (a: number, b: number) => void;
|
|
13
13
|
export const wasmcompiler_configFingerprint: (a: number, b: number) => void;
|
|
14
|
+
export const wasmcompiler_createDesignSystemManifest: (a: number, b: number, c: number) => void;
|
|
15
|
+
export const wasmcompiler_designSystemManifestSchemaVersion: (a: number) => number;
|
|
14
16
|
export const wasmcompiler_diagnostics: (a: number, b: number) => void;
|
|
15
17
|
export const wasmcompiler_dirname: (a: number, b: number, c: number, d: number) => void;
|
|
16
18
|
export const wasmcompiler_encodedRecipes: (a: number, b: number) => void;
|
|
@@ -40,6 +42,7 @@ export const wasmcompiler_registerPatternTransform: (a: number, b: number, c: nu
|
|
|
40
42
|
export const wasmcompiler_registerSourceTransform: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
41
43
|
export const wasmcompiler_registerUtilityTransform: (a: number, b: number, c: number, d: number) => void;
|
|
42
44
|
export const wasmcompiler_removeFile: (a: number, b: number, c: number) => number;
|
|
45
|
+
export const wasmcompiler_resolveDesignSystemChain: (a: number, b: number, c: number) => void;
|
|
43
46
|
export const wasmcompiler_resolvePath: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
44
47
|
export const wasmcompiler_resolveUtilityValue: (a: number, b: number, c: number) => void;
|
|
45
48
|
export const wasmcompiler_scan: (a: number, b: number, c: number) => void;
|
|
@@ -48,10 +51,12 @@ export const wasmcompiler_slotRecipes: (a: number, b: number) => void;
|
|
|
48
51
|
export const wasmcompiler_sources: (a: number, b: number) => void;
|
|
49
52
|
export const wasmcompiler_spec: (a: number, b: number) => void;
|
|
50
53
|
export const wasmcompiler_staticPatternAtoms: (a: number, b: number) => void;
|
|
54
|
+
export const wasmcompiler_suggestTokens: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
51
55
|
export const wasmcompiler_summary: (a: number, b: number) => void;
|
|
52
56
|
export const wasmcompiler_token_dictionary: (a: number, b: number) => void;
|
|
53
57
|
export const wasmcompiler_writeArtifacts: (a: number, b: number, c: number) => void;
|
|
54
58
|
export const wasmcompiler_writeCss: (a: number, b: number, c: number) => void;
|
|
59
|
+
export const wasmcompiler_writeLayerCss: (a: number, b: number, c: number) => void;
|
|
55
60
|
export const wasmcompiler_writeSplitCss: (a: number, b: number, c: number) => void;
|
|
56
61
|
export const wasmextractor_new: (a: number, b: number, c: number) => void;
|
|
57
62
|
export const wasmextractor_parseFile: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
@@ -65,6 +65,18 @@ export class WasmCompiler {
|
|
|
65
65
|
* stamped into build info as `configFingerprint`.
|
|
66
66
|
*/
|
|
67
67
|
configFingerprint(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Build a `panda.lib.json` value from host-supplied fields, stamping the
|
|
70
|
+
* engine-owned schema version. Backs the `designSystem.create` JS namespace.
|
|
71
|
+
*
|
|
72
|
+
* # Errors
|
|
73
|
+
* Returns a JS error if `input` is invalid or the manifest fails to serialize.
|
|
74
|
+
*/
|
|
75
|
+
createDesignSystemManifest(input: any): any;
|
|
76
|
+
/**
|
|
77
|
+
* The manifest wire-format version this binding reads/writes.
|
|
78
|
+
*/
|
|
79
|
+
designSystemManifestSchemaVersion(): number;
|
|
68
80
|
/**
|
|
69
81
|
* Config validation diagnostics from construction.
|
|
70
82
|
*
|
|
@@ -220,24 +232,30 @@ export class WasmCompiler {
|
|
|
220
232
|
*/
|
|
221
233
|
refreshFileSource(path: string, source: string): boolean;
|
|
222
234
|
/**
|
|
223
|
-
* Register a JS-backed pattern transform callback.
|
|
224
|
-
* installs callbacks referenced by the serialized config snapshot.
|
|
235
|
+
* Register a JS-backed pattern transform callback.
|
|
225
236
|
*/
|
|
226
237
|
registerPatternTransform(id: string, callback: Function): void;
|
|
227
238
|
/**
|
|
228
|
-
* Register a JS-backed `parser:before` source transform
|
|
229
|
-
* filter. The filter is evaluated before calling into JS.
|
|
239
|
+
* Register a JS-backed `parser:before` source transform.
|
|
230
240
|
*/
|
|
231
241
|
registerSourceTransform(id: string, filter: any, callback: Function): void;
|
|
232
242
|
/**
|
|
233
|
-
* Register a JS-backed utility transform callback.
|
|
234
|
-
* the user callback so Rust only has to pass the raw value.
|
|
243
|
+
* Register a JS-backed utility transform callback.
|
|
235
244
|
*/
|
|
236
245
|
registerUtilityTransform(id: string, callback: Function): void;
|
|
237
246
|
/**
|
|
238
247
|
* Drop a file's contribution. Returns `true` if the path was known.
|
|
239
248
|
*/
|
|
240
249
|
removeFile(path: string): boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Order already-read manifests by their `designSystem` parent links into a
|
|
252
|
+
* root-first hydrate/merge plan (or report a cycle). Backs the
|
|
253
|
+
* `designSystem.resolveChain` JS namespace. Pure — the host did the reads.
|
|
254
|
+
*
|
|
255
|
+
* # Errors
|
|
256
|
+
* Returns a JS error if `manifests` is invalid or the plan fails to serialize.
|
|
257
|
+
*/
|
|
258
|
+
resolveDesignSystemChain(manifests: any): any;
|
|
241
259
|
resolvePath(path: string, cwd?: string | null): string;
|
|
242
260
|
/**
|
|
243
261
|
* Resolve selector and CSS metadata for one utility value.
|
|
@@ -292,6 +310,13 @@ export class WasmCompiler {
|
|
|
292
310
|
* Returns a JS error if serializing fails.
|
|
293
311
|
*/
|
|
294
312
|
staticPatternAtoms(): any;
|
|
313
|
+
/**
|
|
314
|
+
* Tokens that carry a hardcoded value, ranked (safe equivalents first).
|
|
315
|
+
*
|
|
316
|
+
* # Errors
|
|
317
|
+
* Returns a JS error if serialization fails.
|
|
318
|
+
*/
|
|
319
|
+
suggestTokens(prop: string, value: string): any;
|
|
295
320
|
/**
|
|
296
321
|
* Aggregate counts.
|
|
297
322
|
*
|
|
@@ -304,14 +329,14 @@ export class WasmCompiler {
|
|
|
304
329
|
*/
|
|
305
330
|
token_dictionary(): any;
|
|
306
331
|
/**
|
|
307
|
-
* Generate artifacts and write them under `outdir
|
|
308
|
-
* Returns the written paths.
|
|
332
|
+
* Generate artifacts and write them under `outdir`.
|
|
309
333
|
*
|
|
310
334
|
* # Errors
|
|
311
|
-
* Returns a JS error if
|
|
335
|
+
* Returns a JS error if writing or serializing fails.
|
|
312
336
|
*/
|
|
313
337
|
writeArtifacts(options: any): any;
|
|
314
338
|
writeCss(options: any): any;
|
|
339
|
+
writeLayerCss(options: any): any;
|
|
315
340
|
writeSplitCss(options: any): any;
|
|
316
341
|
}
|
|
317
342
|
|
|
@@ -401,6 +426,8 @@ export interface InitOutput {
|
|
|
401
426
|
readonly wasmcompiler_compile: (a: number, b: number, c: number) => void;
|
|
402
427
|
readonly wasmcompiler_config: (a: number, b: number) => void;
|
|
403
428
|
readonly wasmcompiler_configFingerprint: (a: number, b: number) => void;
|
|
429
|
+
readonly wasmcompiler_createDesignSystemManifest: (a: number, b: number, c: number) => void;
|
|
430
|
+
readonly wasmcompiler_designSystemManifestSchemaVersion: (a: number) => number;
|
|
404
431
|
readonly wasmcompiler_diagnostics: (a: number, b: number) => void;
|
|
405
432
|
readonly wasmcompiler_dirname: (a: number, b: number, c: number, d: number) => void;
|
|
406
433
|
readonly wasmcompiler_encodedRecipes: (a: number, b: number) => void;
|
|
@@ -430,6 +457,7 @@ export interface InitOutput {
|
|
|
430
457
|
readonly wasmcompiler_registerSourceTransform: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
431
458
|
readonly wasmcompiler_registerUtilityTransform: (a: number, b: number, c: number, d: number) => void;
|
|
432
459
|
readonly wasmcompiler_removeFile: (a: number, b: number, c: number) => number;
|
|
460
|
+
readonly wasmcompiler_resolveDesignSystemChain: (a: number, b: number, c: number) => void;
|
|
433
461
|
readonly wasmcompiler_resolvePath: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
434
462
|
readonly wasmcompiler_resolveUtilityValue: (a: number, b: number, c: number) => void;
|
|
435
463
|
readonly wasmcompiler_scan: (a: number, b: number, c: number) => void;
|
|
@@ -438,10 +466,12 @@ export interface InitOutput {
|
|
|
438
466
|
readonly wasmcompiler_sources: (a: number, b: number) => void;
|
|
439
467
|
readonly wasmcompiler_spec: (a: number, b: number) => void;
|
|
440
468
|
readonly wasmcompiler_staticPatternAtoms: (a: number, b: number) => void;
|
|
469
|
+
readonly wasmcompiler_suggestTokens: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
441
470
|
readonly wasmcompiler_summary: (a: number, b: number) => void;
|
|
442
471
|
readonly wasmcompiler_token_dictionary: (a: number, b: number) => void;
|
|
443
472
|
readonly wasmcompiler_writeArtifacts: (a: number, b: number, c: number) => void;
|
|
444
473
|
readonly wasmcompiler_writeCss: (a: number, b: number, c: number) => void;
|
|
474
|
+
readonly wasmcompiler_writeLayerCss: (a: number, b: number, c: number) => void;
|
|
445
475
|
readonly wasmcompiler_writeSplitCss: (a: number, b: number, c: number) => void;
|
|
446
476
|
readonly wasmextractor_new: (a: number, b: number, c: number) => void;
|
|
447
477
|
readonly wasmextractor_parseFile: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
package/pkg-web/compiler_wasm.js
CHANGED
|
@@ -165,6 +165,38 @@ export class WasmCompiler {
|
|
|
165
165
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Build a `panda.lib.json` value from host-supplied fields, stamping the
|
|
170
|
+
* engine-owned schema version. Backs the `designSystem.create` JS namespace.
|
|
171
|
+
*
|
|
172
|
+
* # Errors
|
|
173
|
+
* Returns a JS error if `input` is invalid or the manifest fails to serialize.
|
|
174
|
+
* @param {any} input
|
|
175
|
+
* @returns {any}
|
|
176
|
+
*/
|
|
177
|
+
createDesignSystemManifest(input) {
|
|
178
|
+
try {
|
|
179
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
180
|
+
wasm.wasmcompiler_createDesignSystemManifest(retptr, this.__wbg_ptr, addHeapObject(input));
|
|
181
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
182
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
183
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
184
|
+
if (r2) {
|
|
185
|
+
throw takeObject(r1);
|
|
186
|
+
}
|
|
187
|
+
return takeObject(r0);
|
|
188
|
+
} finally {
|
|
189
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The manifest wire-format version this binding reads/writes.
|
|
194
|
+
* @returns {number}
|
|
195
|
+
*/
|
|
196
|
+
designSystemManifestSchemaVersion() {
|
|
197
|
+
const ret = wasm.wasmcompiler_designSystemManifestSchemaVersion(this.__wbg_ptr);
|
|
198
|
+
return ret >>> 0;
|
|
199
|
+
}
|
|
168
200
|
/**
|
|
169
201
|
* Config validation diagnostics from construction.
|
|
170
202
|
*
|
|
@@ -730,8 +762,7 @@ export class WasmCompiler {
|
|
|
730
762
|
return ret !== 0;
|
|
731
763
|
}
|
|
732
764
|
/**
|
|
733
|
-
* Register a JS-backed pattern transform callback.
|
|
734
|
-
* installs callbacks referenced by the serialized config snapshot.
|
|
765
|
+
* Register a JS-backed pattern transform callback.
|
|
735
766
|
* @param {string} id
|
|
736
767
|
* @param {Function} callback
|
|
737
768
|
*/
|
|
@@ -741,8 +772,7 @@ export class WasmCompiler {
|
|
|
741
772
|
wasm.wasmcompiler_registerPatternTransform(this.__wbg_ptr, ptr0, len0, addHeapObject(callback));
|
|
742
773
|
}
|
|
743
774
|
/**
|
|
744
|
-
* Register a JS-backed `parser:before` source transform
|
|
745
|
-
* filter. The filter is evaluated before calling into JS.
|
|
775
|
+
* Register a JS-backed `parser:before` source transform.
|
|
746
776
|
* @param {string} id
|
|
747
777
|
* @param {any} filter
|
|
748
778
|
* @param {Function} callback
|
|
@@ -763,8 +793,7 @@ export class WasmCompiler {
|
|
|
763
793
|
}
|
|
764
794
|
}
|
|
765
795
|
/**
|
|
766
|
-
* Register a JS-backed utility transform callback.
|
|
767
|
-
* the user callback so Rust only has to pass the raw value.
|
|
796
|
+
* Register a JS-backed utility transform callback.
|
|
768
797
|
* @param {string} id
|
|
769
798
|
* @param {Function} callback
|
|
770
799
|
*/
|
|
@@ -784,6 +813,31 @@ export class WasmCompiler {
|
|
|
784
813
|
const ret = wasm.wasmcompiler_removeFile(this.__wbg_ptr, ptr0, len0);
|
|
785
814
|
return ret !== 0;
|
|
786
815
|
}
|
|
816
|
+
/**
|
|
817
|
+
* Order already-read manifests by their `designSystem` parent links into a
|
|
818
|
+
* root-first hydrate/merge plan (or report a cycle). Backs the
|
|
819
|
+
* `designSystem.resolveChain` JS namespace. Pure — the host did the reads.
|
|
820
|
+
*
|
|
821
|
+
* # Errors
|
|
822
|
+
* Returns a JS error if `manifests` is invalid or the plan fails to serialize.
|
|
823
|
+
* @param {any} manifests
|
|
824
|
+
* @returns {any}
|
|
825
|
+
*/
|
|
826
|
+
resolveDesignSystemChain(manifests) {
|
|
827
|
+
try {
|
|
828
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
829
|
+
wasm.wasmcompiler_resolveDesignSystemChain(retptr, this.__wbg_ptr, addHeapObject(manifests));
|
|
830
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
831
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
832
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
833
|
+
if (r2) {
|
|
834
|
+
throw takeObject(r1);
|
|
835
|
+
}
|
|
836
|
+
return takeObject(r0);
|
|
837
|
+
} finally {
|
|
838
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
787
841
|
/**
|
|
788
842
|
* @param {string} path
|
|
789
843
|
* @param {string | null} [cwd]
|
|
@@ -972,6 +1026,34 @@ export class WasmCompiler {
|
|
|
972
1026
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
973
1027
|
}
|
|
974
1028
|
}
|
|
1029
|
+
/**
|
|
1030
|
+
* Tokens that carry a hardcoded value, ranked (safe equivalents first).
|
|
1031
|
+
*
|
|
1032
|
+
* # Errors
|
|
1033
|
+
* Returns a JS error if serialization fails.
|
|
1034
|
+
* @param {string} prop
|
|
1035
|
+
* @param {string} value
|
|
1036
|
+
* @returns {any}
|
|
1037
|
+
*/
|
|
1038
|
+
suggestTokens(prop, value) {
|
|
1039
|
+
try {
|
|
1040
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1041
|
+
const ptr0 = passStringToWasm0(prop, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1042
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1043
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1044
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1045
|
+
wasm.wasmcompiler_suggestTokens(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1046
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1047
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1048
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1049
|
+
if (r2) {
|
|
1050
|
+
throw takeObject(r1);
|
|
1051
|
+
}
|
|
1052
|
+
return takeObject(r0);
|
|
1053
|
+
} finally {
|
|
1054
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
975
1057
|
/**
|
|
976
1058
|
* Aggregate counts.
|
|
977
1059
|
*
|
|
@@ -1014,11 +1096,10 @@ export class WasmCompiler {
|
|
|
1014
1096
|
}
|
|
1015
1097
|
}
|
|
1016
1098
|
/**
|
|
1017
|
-
* Generate artifacts and write them under `outdir
|
|
1018
|
-
* Returns the written paths.
|
|
1099
|
+
* Generate artifacts and write them under `outdir`.
|
|
1019
1100
|
*
|
|
1020
1101
|
* # Errors
|
|
1021
|
-
* Returns a JS error if
|
|
1102
|
+
* Returns a JS error if writing or serializing fails.
|
|
1022
1103
|
* @param {any} options
|
|
1023
1104
|
* @returns {any}
|
|
1024
1105
|
*/
|
|
@@ -1056,6 +1137,25 @@ export class WasmCompiler {
|
|
|
1056
1137
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1057
1138
|
}
|
|
1058
1139
|
}
|
|
1140
|
+
/**
|
|
1141
|
+
* @param {any} options
|
|
1142
|
+
* @returns {any}
|
|
1143
|
+
*/
|
|
1144
|
+
writeLayerCss(options) {
|
|
1145
|
+
try {
|
|
1146
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1147
|
+
wasm.wasmcompiler_writeLayerCss(retptr, this.__wbg_ptr, addHeapObject(options));
|
|
1148
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1149
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1150
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1151
|
+
if (r2) {
|
|
1152
|
+
throw takeObject(r1);
|
|
1153
|
+
}
|
|
1154
|
+
return takeObject(r0);
|
|
1155
|
+
} finally {
|
|
1156
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1059
1159
|
/**
|
|
1060
1160
|
* @param {any} options
|
|
1061
1161
|
* @returns {any}
|
|
Binary file
|
|
@@ -11,6 +11,8 @@ export const wasmcompiler_clear: (a: number) => void;
|
|
|
11
11
|
export const wasmcompiler_compile: (a: number, b: number, c: number) => void;
|
|
12
12
|
export const wasmcompiler_config: (a: number, b: number) => void;
|
|
13
13
|
export const wasmcompiler_configFingerprint: (a: number, b: number) => void;
|
|
14
|
+
export const wasmcompiler_createDesignSystemManifest: (a: number, b: number, c: number) => void;
|
|
15
|
+
export const wasmcompiler_designSystemManifestSchemaVersion: (a: number) => number;
|
|
14
16
|
export const wasmcompiler_diagnostics: (a: number, b: number) => void;
|
|
15
17
|
export const wasmcompiler_dirname: (a: number, b: number, c: number, d: number) => void;
|
|
16
18
|
export const wasmcompiler_encodedRecipes: (a: number, b: number) => void;
|
|
@@ -40,6 +42,7 @@ export const wasmcompiler_registerPatternTransform: (a: number, b: number, c: nu
|
|
|
40
42
|
export const wasmcompiler_registerSourceTransform: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
41
43
|
export const wasmcompiler_registerUtilityTransform: (a: number, b: number, c: number, d: number) => void;
|
|
42
44
|
export const wasmcompiler_removeFile: (a: number, b: number, c: number) => number;
|
|
45
|
+
export const wasmcompiler_resolveDesignSystemChain: (a: number, b: number, c: number) => void;
|
|
43
46
|
export const wasmcompiler_resolvePath: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
44
47
|
export const wasmcompiler_resolveUtilityValue: (a: number, b: number, c: number) => void;
|
|
45
48
|
export const wasmcompiler_scan: (a: number, b: number, c: number) => void;
|
|
@@ -48,10 +51,12 @@ export const wasmcompiler_slotRecipes: (a: number, b: number) => void;
|
|
|
48
51
|
export const wasmcompiler_sources: (a: number, b: number) => void;
|
|
49
52
|
export const wasmcompiler_spec: (a: number, b: number) => void;
|
|
50
53
|
export const wasmcompiler_staticPatternAtoms: (a: number, b: number) => void;
|
|
54
|
+
export const wasmcompiler_suggestTokens: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
51
55
|
export const wasmcompiler_summary: (a: number, b: number) => void;
|
|
52
56
|
export const wasmcompiler_token_dictionary: (a: number, b: number) => void;
|
|
53
57
|
export const wasmcompiler_writeArtifacts: (a: number, b: number, c: number) => void;
|
|
54
58
|
export const wasmcompiler_writeCss: (a: number, b: number, c: number) => void;
|
|
59
|
+
export const wasmcompiler_writeLayerCss: (a: number, b: number, c: number) => void;
|
|
55
60
|
export const wasmcompiler_writeSplitCss: (a: number, b: number, c: number) => void;
|
|
56
61
|
export const wasmextractor_new: (a: number, b: number, c: number) => void;
|
|
57
62
|
export const wasmextractor_parseFile: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|