@spectratools/graphic-designer-cli 0.3.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 +21 -0
- package/README.md +177 -0
- package/dist/cli.d.ts +5 -0
- package/dist/cli.js +4922 -0
- package/dist/index.d.ts +105 -0
- package/dist/index.js +4973 -0
- package/dist/publish/index.d.ts +49 -0
- package/dist/publish/index.js +259 -0
- package/dist/qa.d.ts +38 -0
- package/dist/qa.js +901 -0
- package/dist/renderer.d.ts +3 -0
- package/dist/renderer.js +3608 -0
- package/dist/spec.schema-BxXBTOn-.d.ts +4809 -0
- package/dist/spec.schema.d.ts +3 -0
- package/dist/spec.schema.js +604 -0
- package/fonts/Inter-Bold.woff2 +0 -0
- package/fonts/Inter-Medium.woff2 +0 -0
- package/fonts/Inter-Regular.woff2 +0 -0
- package/fonts/Inter-SemiBold.woff2 +0 -0
- package/fonts/JetBrainsMono-Bold.woff2 +0 -0
- package/fonts/JetBrainsMono-Medium.woff2 +0 -0
- package/fonts/JetBrainsMono-Regular.woff2 +0 -0
- package/fonts/SpaceGrotesk-Bold.woff2 +0 -0
- package/fonts/SpaceGrotesk-Medium.woff2 +0 -0
- package/package.json +78 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Cli } from 'incur';
|
|
2
|
+
import { T as ThemeInput, D as DesignSpec, a as Rect, b as DrawCommand, c as Theme, d as RenderedElement } from './spec.schema-BxXBTOn-.js';
|
|
3
|
+
export { A as AutoLayoutConfig, B as BuiltInTheme, C as CardElement, e as CodeBlockElement, f as ConnectionElement, g as ConstraintSpec, h as DEFAULT_GENERATOR_VERSION, i as DEFAULT_RAINBOW_COLORS, j as Decorator, k as DesignSafeFrame, l as DrawBadge, m as DrawBezier, n as DrawCircle, o as DrawFontFamily, p as DrawGradientRect, q as DrawLine, r as DrawPath, s as DrawPoint, t as DrawRect, u as DrawText, E as Element, F as FlowNodeElement, G as Gradient, v as GradientOverlayDecorator, w as GradientSpec, x as GradientStop, y as GridLayoutConfig, I as ImageElement, L as LayoutConfig, z as LayoutSnapshot, M as ManualLayoutConfig, H as RainbowRuleDecorator, R as RenderMetadata, J as RenderResult, S as ShapeElement, K as StackLayoutConfig, N as TerminalElement, O as TextElement, P as ThemeInput, V as VignetteDecorator, W as WrittenArtifacts, Q as builtInThemeBackgrounds, U as builtInThemes, X as computeSpecHash, Y as defaultAutoLayout, Z as defaultCanvas, _ as defaultConstraints, $ as defaultGridLayout, a0 as defaultLayout, a1 as defaultStackLayout, a2 as defaultTheme, a3 as deriveSafeFrame, a4 as designSpecSchema, a5 as drawGradientRect, a6 as drawRainbowRule, a7 as drawVignette, a8 as inferLayout, a9 as inferSidecarPath, aa as parseDesignSpec, ab as renderDesign, ac as resolveTheme, ad as writeRenderArtifacts } from './spec.schema-BxXBTOn-.js';
|
|
4
|
+
import { SKRSContext2D } from '@napi-rs/canvas';
|
|
5
|
+
export { QaIssue, QaReport, QaSeverity, readMetadata, runQa } from './qa.js';
|
|
6
|
+
import { Highlighter } from 'shiki';
|
|
7
|
+
export { GistPublishOptions, GistPublishResult, GitHubPublishOptions, GitHubPublishResult, publishToGist, publishToGitHub } from './publish/index.js';
|
|
8
|
+
import 'zod';
|
|
9
|
+
|
|
10
|
+
declare const cli: Cli.Cli<{}, undefined, undefined>;
|
|
11
|
+
|
|
12
|
+
declare const themeToShikiMap: Record<string, string>;
|
|
13
|
+
declare function resolveShikiTheme(theme: ThemeInput): string;
|
|
14
|
+
|
|
15
|
+
declare function buildFlowchartSpec(options: {
|
|
16
|
+
nodes: string[];
|
|
17
|
+
edges: string[];
|
|
18
|
+
title?: string;
|
|
19
|
+
direction?: 'TB' | 'BT' | 'LR' | 'RL';
|
|
20
|
+
algorithm?: 'layered' | 'stress' | 'force' | 'radial' | 'box';
|
|
21
|
+
theme?: string;
|
|
22
|
+
nodeShape?: string;
|
|
23
|
+
width?: number;
|
|
24
|
+
height?: number;
|
|
25
|
+
}): DesignSpec;
|
|
26
|
+
|
|
27
|
+
type WindowControls = 'macos' | 'bw' | 'none';
|
|
28
|
+
|
|
29
|
+
declare function buildCodeSpec(options: {
|
|
30
|
+
code: string;
|
|
31
|
+
language: string;
|
|
32
|
+
title?: string;
|
|
33
|
+
theme?: string;
|
|
34
|
+
showLineNumbers?: boolean;
|
|
35
|
+
highlightLines?: number[];
|
|
36
|
+
startLine?: number;
|
|
37
|
+
width?: number;
|
|
38
|
+
height?: number;
|
|
39
|
+
surroundColor?: string;
|
|
40
|
+
windowControls?: WindowControls;
|
|
41
|
+
scale?: number;
|
|
42
|
+
}): DesignSpec;
|
|
43
|
+
|
|
44
|
+
declare function buildTerminalSpec(options: {
|
|
45
|
+
command?: string;
|
|
46
|
+
output?: string;
|
|
47
|
+
content?: string;
|
|
48
|
+
title?: string;
|
|
49
|
+
prompt?: string;
|
|
50
|
+
theme?: string;
|
|
51
|
+
width?: number;
|
|
52
|
+
height?: number;
|
|
53
|
+
surroundColor?: string;
|
|
54
|
+
windowControls?: WindowControls;
|
|
55
|
+
scale?: number;
|
|
56
|
+
}): DesignSpec;
|
|
57
|
+
|
|
58
|
+
declare function buildCardsSpec(options: {
|
|
59
|
+
cards: Array<{
|
|
60
|
+
title: string;
|
|
61
|
+
body: string;
|
|
62
|
+
badge?: string;
|
|
63
|
+
metric?: string;
|
|
64
|
+
tone?: string;
|
|
65
|
+
}>;
|
|
66
|
+
title?: string;
|
|
67
|
+
subtitle?: string;
|
|
68
|
+
columns?: number;
|
|
69
|
+
theme?: string;
|
|
70
|
+
width?: number;
|
|
71
|
+
height?: number;
|
|
72
|
+
}): DesignSpec;
|
|
73
|
+
|
|
74
|
+
type EdgeRoute = {
|
|
75
|
+
points: Array<{
|
|
76
|
+
x: number;
|
|
77
|
+
y: number;
|
|
78
|
+
}>;
|
|
79
|
+
};
|
|
80
|
+
type LayoutResult = {
|
|
81
|
+
positions: Map<string, Rect>;
|
|
82
|
+
canvasSize?: {
|
|
83
|
+
width: number;
|
|
84
|
+
height: number;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
type ElkLayoutResult = LayoutResult & {
|
|
88
|
+
edgeRoutes?: Map<string, EdgeRoute>;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
declare function renderDrawCommands(ctx: SKRSContext2D, commands: DrawCommand[], theme: Theme): RenderedElement[];
|
|
92
|
+
|
|
93
|
+
declare function loadFonts(): void;
|
|
94
|
+
|
|
95
|
+
declare function initHighlighter(): Promise<Highlighter>;
|
|
96
|
+
type HighlightedLine = {
|
|
97
|
+
tokens: Array<{
|
|
98
|
+
text: string;
|
|
99
|
+
color: string;
|
|
100
|
+
}>;
|
|
101
|
+
};
|
|
102
|
+
declare function highlightCode(code: string, language: string, themeName: string): Promise<HighlightedLine[]>;
|
|
103
|
+
declare function disposeHighlighter(): void;
|
|
104
|
+
|
|
105
|
+
export { DesignSpec, DrawCommand, type EdgeRoute, type ElkLayoutResult, type HighlightedLine, type LayoutResult, Rect, RenderedElement, Theme, buildCardsSpec, buildCodeSpec, buildFlowchartSpec, buildTerminalSpec, cli, disposeHighlighter, highlightCode, initHighlighter, loadFonts, renderDrawCommands, resolveShikiTheme, themeToShikiMap };
|