@design-embed/plugin-figma-html 0.1.0 → 1.0.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/LICENSE +1 -1
- package/dist/compilers/compilerUtils.d.mts +11 -0
- package/dist/compilers/compilerUtils.mjs +119 -0
- package/dist/compilers/htmlCompiler.d.mts +6 -0
- package/dist/compilers/htmlCompiler.mjs +31 -0
- package/dist/compilers/index.d.mts +11 -0
- package/dist/compilers/index.mjs +17 -0
- package/dist/compilers/index.test.d.mts +1 -0
- package/dist/compilers/index.test.mjs +45 -0
- package/dist/compilers/reactCompiler.d.mts +6 -0
- package/dist/compilers/reactCompiler.mjs +47 -0
- package/dist/compilers/vanjsCompiler.d.mts +6 -0
- package/dist/compilers/vanjsCompiler.mjs +47 -0
- package/dist/design-embed/src/core/diagnostics/diagnostic.d.mts +16 -0
- package/dist/design-embed/src/core/nodes.d.mts +14 -0
- package/dist/design-embed/src/core/plugins/pluginApi.d.mts +34 -0
- package/dist/external/figmaApi.d.mts +17 -0
- package/dist/external/figmaApi.mjs +55 -0
- package/dist/external/figmaApi.test.d.mts +1 -0
- package/dist/external/figmaApi.test.mjs +101 -0
- package/dist/external/imageDownloader.d.mts +17 -0
- package/dist/external/imageDownloader.mjs +66 -0
- package/dist/external/imageDownloader.test.d.mts +1 -0
- package/dist/external/imageDownloader.test.mjs +42 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.mjs +7 -0
- package/dist/plugin.d.mts +16 -0
- package/dist/plugin.mjs +43 -0
- package/dist/types.d.mts +84 -0
- package/package.json +12 -10
- package/src/plugin.ts +2 -3
- package/dist/compilers/compilerUtils.js +0 -182
- package/dist/compilers/htmlCompiler.js +0 -35
- package/dist/compilers/index.js +0 -17
- package/dist/compilers/reactCompiler.js +0 -58
- package/dist/compilers/vanjsCompiler.js +0 -55
- package/dist/external/figmaApi.js +0 -74
- package/dist/external/imageDownloader.js +0 -82
- package/dist/index.js +0 -3
- package/dist/plugin.js +0 -56
- package/node_modules/@design-embed/config/README.md +0 -5
- package/node_modules/@design-embed/config/dist/index.js +0 -283
- package/node_modules/@design-embed/config/package.json +0 -19
- package/node_modules/@design-embed/config/src/index.ts +0 -518
- package/node_modules/@design-embed/core/README.md +0 -5
- package/node_modules/@design-embed/core/dist/diagnostics/diagnostic.js +0 -3
- package/node_modules/@design-embed/core/dist/diagnostics/jsonDiagnostic.js +0 -35
- package/node_modules/@design-embed/core/dist/index.js +0 -351
- package/node_modules/@design-embed/core/dist/pipeline/checkMode.js +0 -29
- package/node_modules/@design-embed/core/dist/plugins/pluginApi.js +0 -1
- package/node_modules/@design-embed/core/dist/plugins/pluginRegistry.js +0 -25
- package/node_modules/@design-embed/core/package.json +0 -19
- package/node_modules/@design-embed/core/src/diagnostics/diagnostic.ts +0 -18
- package/node_modules/@design-embed/core/src/diagnostics/jsonDiagnostic.ts +0 -51
- package/node_modules/@design-embed/core/src/index.ts +0 -591
- package/node_modules/@design-embed/core/src/pipeline/checkMode.ts +0 -46
- package/node_modules/@design-embed/core/src/plugins/pluginApi.ts +0 -78
- package/node_modules/@design-embed/core/src/plugins/pluginRegistry.ts +0 -37
- /package/dist/{types.js → types.mjs} +0 -0
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { SourcePlugin, TransformerPlugin } from "./pluginApi.ts";
|
|
2
|
-
|
|
3
|
-
export class PluginRegistry {
|
|
4
|
-
#sourcePlugins = new Map<string, SourcePlugin>();
|
|
5
|
-
#transformers: TransformerPlugin[] = [];
|
|
6
|
-
|
|
7
|
-
registerSource(plugin: SourcePlugin): void {
|
|
8
|
-
this.#sourcePlugins.set(plugin.name, plugin);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
getSource(name: string): SourcePlugin | undefined {
|
|
12
|
-
return this.#sourcePlugins.get(name);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
listSources(): SourcePlugin[] {
|
|
16
|
-
return [...this.#sourcePlugins.values()].sort((left, right) =>
|
|
17
|
-
left.name.localeCompare(right.name),
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
registerTransformer(plugin: TransformerPlugin): void {
|
|
22
|
-
this.#transformers.push(plugin);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
listTransformers(): TransformerPlugin[] {
|
|
26
|
-
return sortTransformers(this.#transformers);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function sortTransformers(
|
|
31
|
-
transformers: TransformerPlugin[],
|
|
32
|
-
): TransformerPlugin[] {
|
|
33
|
-
return [...transformers].sort((left, right) => {
|
|
34
|
-
const orderDelta = (left.order ?? 0) - (right.order ?? 0);
|
|
35
|
-
return orderDelta || left.name.localeCompare(right.name);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
File without changes
|