@aalis/api-webui 0.11.1 → 0.13.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.
- package/dist/frame/frame.css +218 -0
- package/dist/frame/frame.js +158 -0
- package/dist/frame/schema-i18n/catalog.js +101 -0
- package/dist/frame/schema-i18n/check.js +65 -0
- package/dist/frame/schema-i18n/define.js +105 -0
- package/dist/frame/schema-i18n/errors.js +41 -0
- package/dist/frame/schema-i18n/format.js +160 -0
- package/dist/frame/schema-i18n/index.js +17 -0
- package/dist/frame/schema-i18n/locale.js +100 -0
- package/dist/frame/schema-i18n/locales/en.js +3 -0
- package/dist/frame/schema-i18n/message.js +249 -0
- package/dist/frame/schema-i18n/packs.js +52 -0
- package/dist/frame/schema-i18n/params.js +2 -0
- package/dist/frame/schema-i18n/resolve.js +85 -0
- package/dist/frame/schema-i18n/source.js +4 -0
- package/dist/frame/schema-i18n/text-ref.js +94 -0
- package/dist/frame/schema-i18n/texts.js +29 -0
- package/dist/frame.d.ts +190 -0
- package/dist/frame.d.ts.map +1 -0
- package/dist/frame.js +121 -0
- package/dist/frame.js.map +1 -0
- package/dist/index.d.ts +137 -206
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -32
- package/dist/index.js.map +1 -1
- package/dist/locales/en.d.ts +82 -0
- package/dist/locales/en.d.ts.map +1 -0
- package/dist/locales/en.js +82 -0
- package/dist/locales/en.js.map +1 -0
- package/dist/page.d.ts +433 -0
- package/dist/page.d.ts.map +1 -0
- package/dist/page.js +30 -0
- package/dist/page.js.map +1 -0
- package/dist/rest.d.ts +674 -0
- package/dist/rest.d.ts.map +1 -0
- package/dist/rest.js +21 -0
- package/dist/rest.js.map +1 -0
- package/dist/texts.d.ts +163 -0
- package/dist/texts.d.ts.map +1 -0
- package/dist/texts.js +85 -0
- package/dist/texts.js.map +1 -0
- package/dist/theme.d.ts +466 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +298 -0
- package/dist/theme.js.map +1 -0
- package/dist/themes/aalis-dark.json +49 -0
- package/dist/themes/aalis-light.json +49 -0
- package/dist/themes/brand-dark.json +49 -0
- package/dist/themes/brand-light.json +49 -0
- package/dist/themes/calm-dark.json +49 -0
- package/dist/themes/calm-light.json +49 -0
- package/dist/themes/neutral-dark.json +49 -0
- package/dist/themes/neutral-light.json +49 -0
- package/package.json +14 -6
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import type { TextRef } from '@aalis/schema-i18n';
|
|
2
|
+
/** 主题文件的格式名 */
|
|
3
|
+
export declare const THEME_FILE_FORMAT = "aalis-theme";
|
|
4
|
+
/** 主题文件的格式版本:令牌表改名时加一,旧版本的文件按版本迁移 */
|
|
5
|
+
export declare const THEME_FILE_VERSION = 1;
|
|
6
|
+
/**
|
|
7
|
+
* 颜色令牌表,名字即 CSS 自定义属性名。fill 系列是半透明的叠加底,放在任何底色上都成立;
|
|
8
|
+
* 图表色给关系图等分类着色,语法色给代码高亮
|
|
9
|
+
*/
|
|
10
|
+
export declare const THEME_TOKENS: readonly ["--color-bg", "--color-bg-side", "--color-bg-rail", "--color-surface-raised", "--color-fill-1", "--color-fill-2", "--color-fill-3", "--color-border", "--color-border-control", "--color-text", "--color-text-2", "--color-text-3", "--color-text-disabled", "--color-accent", "--color-accent-hover", "--color-on-accent", "--color-accent-text", "--color-accent-subtle", "--color-focus", "--color-mark", "--color-danger", "--color-danger-hover", "--color-danger-text", "--color-danger-subtle", "--color-warning-text", "--color-warning-subtle", "--color-success-text", "--color-success-subtle", "--color-scrim", "--color-shadow", "--color-chart-1", "--color-chart-2", "--color-chart-3", "--color-chart-4", "--color-chart-5", "--color-chart-6", "--color-syntax-keyword", "--color-syntax-string", "--color-syntax-number", "--color-syntax-comment", "--color-syntax-function", "--color-syntax-type"];
|
|
11
|
+
export type ThemeToken = (typeof THEME_TOKENS)[number];
|
|
12
|
+
export type ThemeKind = 'dark' | 'light';
|
|
13
|
+
/** 主题文件:没写的令牌按同种类的偏中性主题补 */
|
|
14
|
+
export interface ThemeFile {
|
|
15
|
+
format: typeof THEME_FILE_FORMAT;
|
|
16
|
+
version: typeof THEME_FILE_VERSION;
|
|
17
|
+
name: string;
|
|
18
|
+
kind: ThemeKind;
|
|
19
|
+
colors: Partial<Record<ThemeToken, string>>;
|
|
20
|
+
}
|
|
21
|
+
/** 校验过的主题:每个令牌都有值 */
|
|
22
|
+
export interface Theme {
|
|
23
|
+
name: string;
|
|
24
|
+
kind: ThemeKind;
|
|
25
|
+
colors: Record<ThemeToken, string>;
|
|
26
|
+
}
|
|
27
|
+
/** 校验的结果:不合格式时列出全部原因,原因是本包字典里的文字对象,界面按读者语言渲染、日志取原文 */
|
|
28
|
+
export type ThemeParseResult = {
|
|
29
|
+
ok: true;
|
|
30
|
+
theme: Theme;
|
|
31
|
+
} | {
|
|
32
|
+
ok: false;
|
|
33
|
+
errors: TextRef[];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* `webui:theme` 贡献点的 spec:插件交一份主题文件,经 `contributions.contribute('webui:theme', { id, theme })` 登记,
|
|
37
|
+
* 随激活撤回。id 是局部名,与插件实例 id 合成全局键。主题只是数据,与导入的主题文件走同一套校验(parseTheme),
|
|
38
|
+
* 不合格式的不列出,webui-server 记一条告警
|
|
39
|
+
*/
|
|
40
|
+
export interface ThemeContribution {
|
|
41
|
+
id: string;
|
|
42
|
+
theme: ThemeFile;
|
|
43
|
+
}
|
|
44
|
+
declare module '@aalis/api-contributions' {
|
|
45
|
+
interface ContributionPointMap {
|
|
46
|
+
'webui:theme': ThemeContribution;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** GET /api/themes 的一项:贡献点的全局键(`<插件实例 id>/<局部 id>`)、提供它的插件实例与校验过的主题 */
|
|
50
|
+
export interface PluginTheme {
|
|
51
|
+
id: string;
|
|
52
|
+
instance: string;
|
|
53
|
+
theme: Theme;
|
|
54
|
+
}
|
|
55
|
+
/** 内置主题:随包带的主题文件(不带名字),键是主题 id(配色名加种类) */
|
|
56
|
+
export declare const BUILTIN_THEMES: {
|
|
57
|
+
'calm-dark': {
|
|
58
|
+
format: string;
|
|
59
|
+
version: number;
|
|
60
|
+
kind: string;
|
|
61
|
+
colors: {
|
|
62
|
+
"--color-bg": string;
|
|
63
|
+
"--color-bg-side": string;
|
|
64
|
+
"--color-bg-rail": string;
|
|
65
|
+
"--color-surface-raised": string;
|
|
66
|
+
"--color-fill-1": string;
|
|
67
|
+
"--color-fill-2": string;
|
|
68
|
+
"--color-fill-3": string;
|
|
69
|
+
"--color-border": string;
|
|
70
|
+
"--color-border-control": string;
|
|
71
|
+
"--color-text": string;
|
|
72
|
+
"--color-text-2": string;
|
|
73
|
+
"--color-text-3": string;
|
|
74
|
+
"--color-text-disabled": string;
|
|
75
|
+
"--color-accent": string;
|
|
76
|
+
"--color-accent-hover": string;
|
|
77
|
+
"--color-on-accent": string;
|
|
78
|
+
"--color-accent-text": string;
|
|
79
|
+
"--color-accent-subtle": string;
|
|
80
|
+
"--color-focus": string;
|
|
81
|
+
"--color-mark": string;
|
|
82
|
+
"--color-danger": string;
|
|
83
|
+
"--color-danger-hover": string;
|
|
84
|
+
"--color-danger-text": string;
|
|
85
|
+
"--color-danger-subtle": string;
|
|
86
|
+
"--color-warning-text": string;
|
|
87
|
+
"--color-warning-subtle": string;
|
|
88
|
+
"--color-success-text": string;
|
|
89
|
+
"--color-success-subtle": string;
|
|
90
|
+
"--color-scrim": string;
|
|
91
|
+
"--color-shadow": string;
|
|
92
|
+
"--color-chart-1": string;
|
|
93
|
+
"--color-chart-2": string;
|
|
94
|
+
"--color-chart-3": string;
|
|
95
|
+
"--color-chart-4": string;
|
|
96
|
+
"--color-chart-5": string;
|
|
97
|
+
"--color-chart-6": string;
|
|
98
|
+
"--color-syntax-keyword": string;
|
|
99
|
+
"--color-syntax-string": string;
|
|
100
|
+
"--color-syntax-number": string;
|
|
101
|
+
"--color-syntax-comment": string;
|
|
102
|
+
"--color-syntax-function": string;
|
|
103
|
+
"--color-syntax-type": string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
'calm-light': {
|
|
107
|
+
format: string;
|
|
108
|
+
version: number;
|
|
109
|
+
kind: string;
|
|
110
|
+
colors: {
|
|
111
|
+
"--color-bg": string;
|
|
112
|
+
"--color-bg-side": string;
|
|
113
|
+
"--color-bg-rail": string;
|
|
114
|
+
"--color-surface-raised": string;
|
|
115
|
+
"--color-fill-1": string;
|
|
116
|
+
"--color-fill-2": string;
|
|
117
|
+
"--color-fill-3": string;
|
|
118
|
+
"--color-border": string;
|
|
119
|
+
"--color-border-control": string;
|
|
120
|
+
"--color-text": string;
|
|
121
|
+
"--color-text-2": string;
|
|
122
|
+
"--color-text-3": string;
|
|
123
|
+
"--color-text-disabled": string;
|
|
124
|
+
"--color-accent": string;
|
|
125
|
+
"--color-accent-hover": string;
|
|
126
|
+
"--color-on-accent": string;
|
|
127
|
+
"--color-accent-text": string;
|
|
128
|
+
"--color-accent-subtle": string;
|
|
129
|
+
"--color-focus": string;
|
|
130
|
+
"--color-mark": string;
|
|
131
|
+
"--color-danger": string;
|
|
132
|
+
"--color-danger-hover": string;
|
|
133
|
+
"--color-danger-text": string;
|
|
134
|
+
"--color-danger-subtle": string;
|
|
135
|
+
"--color-warning-text": string;
|
|
136
|
+
"--color-warning-subtle": string;
|
|
137
|
+
"--color-success-text": string;
|
|
138
|
+
"--color-success-subtle": string;
|
|
139
|
+
"--color-scrim": string;
|
|
140
|
+
"--color-shadow": string;
|
|
141
|
+
"--color-chart-1": string;
|
|
142
|
+
"--color-chart-2": string;
|
|
143
|
+
"--color-chart-3": string;
|
|
144
|
+
"--color-chart-4": string;
|
|
145
|
+
"--color-chart-5": string;
|
|
146
|
+
"--color-chart-6": string;
|
|
147
|
+
"--color-syntax-keyword": string;
|
|
148
|
+
"--color-syntax-string": string;
|
|
149
|
+
"--color-syntax-number": string;
|
|
150
|
+
"--color-syntax-comment": string;
|
|
151
|
+
"--color-syntax-function": string;
|
|
152
|
+
"--color-syntax-type": string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
'aalis-dark': {
|
|
156
|
+
format: string;
|
|
157
|
+
version: number;
|
|
158
|
+
kind: string;
|
|
159
|
+
colors: {
|
|
160
|
+
"--color-bg": string;
|
|
161
|
+
"--color-bg-side": string;
|
|
162
|
+
"--color-bg-rail": string;
|
|
163
|
+
"--color-surface-raised": string;
|
|
164
|
+
"--color-fill-1": string;
|
|
165
|
+
"--color-fill-2": string;
|
|
166
|
+
"--color-fill-3": string;
|
|
167
|
+
"--color-border": string;
|
|
168
|
+
"--color-border-control": string;
|
|
169
|
+
"--color-text": string;
|
|
170
|
+
"--color-text-2": string;
|
|
171
|
+
"--color-text-3": string;
|
|
172
|
+
"--color-text-disabled": string;
|
|
173
|
+
"--color-accent": string;
|
|
174
|
+
"--color-accent-hover": string;
|
|
175
|
+
"--color-on-accent": string;
|
|
176
|
+
"--color-accent-text": string;
|
|
177
|
+
"--color-accent-subtle": string;
|
|
178
|
+
"--color-focus": string;
|
|
179
|
+
"--color-mark": string;
|
|
180
|
+
"--color-danger": string;
|
|
181
|
+
"--color-danger-hover": string;
|
|
182
|
+
"--color-danger-text": string;
|
|
183
|
+
"--color-danger-subtle": string;
|
|
184
|
+
"--color-warning-text": string;
|
|
185
|
+
"--color-warning-subtle": string;
|
|
186
|
+
"--color-success-text": string;
|
|
187
|
+
"--color-success-subtle": string;
|
|
188
|
+
"--color-scrim": string;
|
|
189
|
+
"--color-shadow": string;
|
|
190
|
+
"--color-chart-1": string;
|
|
191
|
+
"--color-chart-2": string;
|
|
192
|
+
"--color-chart-3": string;
|
|
193
|
+
"--color-chart-4": string;
|
|
194
|
+
"--color-chart-5": string;
|
|
195
|
+
"--color-chart-6": string;
|
|
196
|
+
"--color-syntax-keyword": string;
|
|
197
|
+
"--color-syntax-string": string;
|
|
198
|
+
"--color-syntax-number": string;
|
|
199
|
+
"--color-syntax-comment": string;
|
|
200
|
+
"--color-syntax-function": string;
|
|
201
|
+
"--color-syntax-type": string;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
'aalis-light': {
|
|
205
|
+
format: string;
|
|
206
|
+
version: number;
|
|
207
|
+
kind: string;
|
|
208
|
+
colors: {
|
|
209
|
+
"--color-bg": string;
|
|
210
|
+
"--color-bg-side": string;
|
|
211
|
+
"--color-bg-rail": string;
|
|
212
|
+
"--color-surface-raised": string;
|
|
213
|
+
"--color-fill-1": string;
|
|
214
|
+
"--color-fill-2": string;
|
|
215
|
+
"--color-fill-3": string;
|
|
216
|
+
"--color-border": string;
|
|
217
|
+
"--color-border-control": string;
|
|
218
|
+
"--color-text": string;
|
|
219
|
+
"--color-text-2": string;
|
|
220
|
+
"--color-text-3": string;
|
|
221
|
+
"--color-text-disabled": string;
|
|
222
|
+
"--color-accent": string;
|
|
223
|
+
"--color-accent-hover": string;
|
|
224
|
+
"--color-on-accent": string;
|
|
225
|
+
"--color-accent-text": string;
|
|
226
|
+
"--color-accent-subtle": string;
|
|
227
|
+
"--color-focus": string;
|
|
228
|
+
"--color-mark": string;
|
|
229
|
+
"--color-danger": string;
|
|
230
|
+
"--color-danger-hover": string;
|
|
231
|
+
"--color-danger-text": string;
|
|
232
|
+
"--color-danger-subtle": string;
|
|
233
|
+
"--color-warning-text": string;
|
|
234
|
+
"--color-warning-subtle": string;
|
|
235
|
+
"--color-success-text": string;
|
|
236
|
+
"--color-success-subtle": string;
|
|
237
|
+
"--color-scrim": string;
|
|
238
|
+
"--color-shadow": string;
|
|
239
|
+
"--color-chart-1": string;
|
|
240
|
+
"--color-chart-2": string;
|
|
241
|
+
"--color-chart-3": string;
|
|
242
|
+
"--color-chart-4": string;
|
|
243
|
+
"--color-chart-5": string;
|
|
244
|
+
"--color-chart-6": string;
|
|
245
|
+
"--color-syntax-keyword": string;
|
|
246
|
+
"--color-syntax-string": string;
|
|
247
|
+
"--color-syntax-number": string;
|
|
248
|
+
"--color-syntax-comment": string;
|
|
249
|
+
"--color-syntax-function": string;
|
|
250
|
+
"--color-syntax-type": string;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
'brand-dark': {
|
|
254
|
+
format: string;
|
|
255
|
+
version: number;
|
|
256
|
+
kind: string;
|
|
257
|
+
colors: {
|
|
258
|
+
"--color-bg": string;
|
|
259
|
+
"--color-bg-side": string;
|
|
260
|
+
"--color-bg-rail": string;
|
|
261
|
+
"--color-surface-raised": string;
|
|
262
|
+
"--color-fill-1": string;
|
|
263
|
+
"--color-fill-2": string;
|
|
264
|
+
"--color-fill-3": string;
|
|
265
|
+
"--color-border": string;
|
|
266
|
+
"--color-border-control": string;
|
|
267
|
+
"--color-text": string;
|
|
268
|
+
"--color-text-2": string;
|
|
269
|
+
"--color-text-3": string;
|
|
270
|
+
"--color-text-disabled": string;
|
|
271
|
+
"--color-accent": string;
|
|
272
|
+
"--color-accent-hover": string;
|
|
273
|
+
"--color-on-accent": string;
|
|
274
|
+
"--color-accent-text": string;
|
|
275
|
+
"--color-accent-subtle": string;
|
|
276
|
+
"--color-focus": string;
|
|
277
|
+
"--color-mark": string;
|
|
278
|
+
"--color-danger": string;
|
|
279
|
+
"--color-danger-hover": string;
|
|
280
|
+
"--color-danger-text": string;
|
|
281
|
+
"--color-danger-subtle": string;
|
|
282
|
+
"--color-warning-text": string;
|
|
283
|
+
"--color-warning-subtle": string;
|
|
284
|
+
"--color-success-text": string;
|
|
285
|
+
"--color-success-subtle": string;
|
|
286
|
+
"--color-scrim": string;
|
|
287
|
+
"--color-shadow": string;
|
|
288
|
+
"--color-chart-1": string;
|
|
289
|
+
"--color-chart-2": string;
|
|
290
|
+
"--color-chart-3": string;
|
|
291
|
+
"--color-chart-4": string;
|
|
292
|
+
"--color-chart-5": string;
|
|
293
|
+
"--color-chart-6": string;
|
|
294
|
+
"--color-syntax-keyword": string;
|
|
295
|
+
"--color-syntax-string": string;
|
|
296
|
+
"--color-syntax-number": string;
|
|
297
|
+
"--color-syntax-comment": string;
|
|
298
|
+
"--color-syntax-function": string;
|
|
299
|
+
"--color-syntax-type": string;
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
'brand-light': {
|
|
303
|
+
format: string;
|
|
304
|
+
version: number;
|
|
305
|
+
kind: string;
|
|
306
|
+
colors: {
|
|
307
|
+
"--color-bg": string;
|
|
308
|
+
"--color-bg-side": string;
|
|
309
|
+
"--color-bg-rail": string;
|
|
310
|
+
"--color-surface-raised": string;
|
|
311
|
+
"--color-fill-1": string;
|
|
312
|
+
"--color-fill-2": string;
|
|
313
|
+
"--color-fill-3": string;
|
|
314
|
+
"--color-border": string;
|
|
315
|
+
"--color-border-control": string;
|
|
316
|
+
"--color-text": string;
|
|
317
|
+
"--color-text-2": string;
|
|
318
|
+
"--color-text-3": string;
|
|
319
|
+
"--color-text-disabled": string;
|
|
320
|
+
"--color-accent": string;
|
|
321
|
+
"--color-accent-hover": string;
|
|
322
|
+
"--color-on-accent": string;
|
|
323
|
+
"--color-accent-text": string;
|
|
324
|
+
"--color-accent-subtle": string;
|
|
325
|
+
"--color-focus": string;
|
|
326
|
+
"--color-mark": string;
|
|
327
|
+
"--color-danger": string;
|
|
328
|
+
"--color-danger-hover": string;
|
|
329
|
+
"--color-danger-text": string;
|
|
330
|
+
"--color-danger-subtle": string;
|
|
331
|
+
"--color-warning-text": string;
|
|
332
|
+
"--color-warning-subtle": string;
|
|
333
|
+
"--color-success-text": string;
|
|
334
|
+
"--color-success-subtle": string;
|
|
335
|
+
"--color-scrim": string;
|
|
336
|
+
"--color-shadow": string;
|
|
337
|
+
"--color-chart-1": string;
|
|
338
|
+
"--color-chart-2": string;
|
|
339
|
+
"--color-chart-3": string;
|
|
340
|
+
"--color-chart-4": string;
|
|
341
|
+
"--color-chart-5": string;
|
|
342
|
+
"--color-chart-6": string;
|
|
343
|
+
"--color-syntax-keyword": string;
|
|
344
|
+
"--color-syntax-string": string;
|
|
345
|
+
"--color-syntax-number": string;
|
|
346
|
+
"--color-syntax-comment": string;
|
|
347
|
+
"--color-syntax-function": string;
|
|
348
|
+
"--color-syntax-type": string;
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
'neutral-dark': {
|
|
352
|
+
format: string;
|
|
353
|
+
version: number;
|
|
354
|
+
kind: string;
|
|
355
|
+
colors: {
|
|
356
|
+
"--color-bg": string;
|
|
357
|
+
"--color-bg-side": string;
|
|
358
|
+
"--color-bg-rail": string;
|
|
359
|
+
"--color-surface-raised": string;
|
|
360
|
+
"--color-fill-1": string;
|
|
361
|
+
"--color-fill-2": string;
|
|
362
|
+
"--color-fill-3": string;
|
|
363
|
+
"--color-border": string;
|
|
364
|
+
"--color-border-control": string;
|
|
365
|
+
"--color-text": string;
|
|
366
|
+
"--color-text-2": string;
|
|
367
|
+
"--color-text-3": string;
|
|
368
|
+
"--color-text-disabled": string;
|
|
369
|
+
"--color-accent": string;
|
|
370
|
+
"--color-accent-hover": string;
|
|
371
|
+
"--color-on-accent": string;
|
|
372
|
+
"--color-accent-text": string;
|
|
373
|
+
"--color-accent-subtle": string;
|
|
374
|
+
"--color-focus": string;
|
|
375
|
+
"--color-mark": string;
|
|
376
|
+
"--color-danger": string;
|
|
377
|
+
"--color-danger-hover": string;
|
|
378
|
+
"--color-danger-text": string;
|
|
379
|
+
"--color-danger-subtle": string;
|
|
380
|
+
"--color-warning-text": string;
|
|
381
|
+
"--color-warning-subtle": string;
|
|
382
|
+
"--color-success-text": string;
|
|
383
|
+
"--color-success-subtle": string;
|
|
384
|
+
"--color-scrim": string;
|
|
385
|
+
"--color-shadow": string;
|
|
386
|
+
"--color-chart-1": string;
|
|
387
|
+
"--color-chart-2": string;
|
|
388
|
+
"--color-chart-3": string;
|
|
389
|
+
"--color-chart-4": string;
|
|
390
|
+
"--color-chart-5": string;
|
|
391
|
+
"--color-chart-6": string;
|
|
392
|
+
"--color-syntax-keyword": string;
|
|
393
|
+
"--color-syntax-string": string;
|
|
394
|
+
"--color-syntax-number": string;
|
|
395
|
+
"--color-syntax-comment": string;
|
|
396
|
+
"--color-syntax-function": string;
|
|
397
|
+
"--color-syntax-type": string;
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
'neutral-light': {
|
|
401
|
+
format: string;
|
|
402
|
+
version: number;
|
|
403
|
+
kind: string;
|
|
404
|
+
colors: {
|
|
405
|
+
"--color-bg": string;
|
|
406
|
+
"--color-bg-side": string;
|
|
407
|
+
"--color-bg-rail": string;
|
|
408
|
+
"--color-surface-raised": string;
|
|
409
|
+
"--color-fill-1": string;
|
|
410
|
+
"--color-fill-2": string;
|
|
411
|
+
"--color-fill-3": string;
|
|
412
|
+
"--color-border": string;
|
|
413
|
+
"--color-border-control": string;
|
|
414
|
+
"--color-text": string;
|
|
415
|
+
"--color-text-2": string;
|
|
416
|
+
"--color-text-3": string;
|
|
417
|
+
"--color-text-disabled": string;
|
|
418
|
+
"--color-accent": string;
|
|
419
|
+
"--color-accent-hover": string;
|
|
420
|
+
"--color-on-accent": string;
|
|
421
|
+
"--color-accent-text": string;
|
|
422
|
+
"--color-accent-subtle": string;
|
|
423
|
+
"--color-focus": string;
|
|
424
|
+
"--color-mark": string;
|
|
425
|
+
"--color-danger": string;
|
|
426
|
+
"--color-danger-hover": string;
|
|
427
|
+
"--color-danger-text": string;
|
|
428
|
+
"--color-danger-subtle": string;
|
|
429
|
+
"--color-warning-text": string;
|
|
430
|
+
"--color-warning-subtle": string;
|
|
431
|
+
"--color-success-text": string;
|
|
432
|
+
"--color-success-subtle": string;
|
|
433
|
+
"--color-scrim": string;
|
|
434
|
+
"--color-shadow": string;
|
|
435
|
+
"--color-chart-1": string;
|
|
436
|
+
"--color-chart-2": string;
|
|
437
|
+
"--color-chart-3": string;
|
|
438
|
+
"--color-chart-4": string;
|
|
439
|
+
"--color-chart-5": string;
|
|
440
|
+
"--color-chart-6": string;
|
|
441
|
+
"--color-syntax-keyword": string;
|
|
442
|
+
"--color-syntax-string": string;
|
|
443
|
+
"--color-syntax-number": string;
|
|
444
|
+
"--color-syntax-comment": string;
|
|
445
|
+
"--color-syntax-function": string;
|
|
446
|
+
"--color-syntax-type": string;
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
export type BuiltinThemeId = keyof typeof BUILTIN_THEMES;
|
|
451
|
+
/** 内置主题的名字,按主题 id 取 */
|
|
452
|
+
export declare const BUILTIN_THEME_NAMES: Readonly<Record<BuiltinThemeId, TextRef>>;
|
|
453
|
+
/** 跟随系统时默认的深色与浅色主题,也是补齐缺失令牌的来源 */
|
|
454
|
+
export declare const DEFAULT_THEMES: Readonly<Record<ThemeKind, BuiltinThemeId>>;
|
|
455
|
+
/** 校验一份主题文件(已按 JSON 解析):不合格式的列出全部原因 */
|
|
456
|
+
export declare function parseTheme(value: unknown): ThemeParseResult;
|
|
457
|
+
export interface ContrastIssue {
|
|
458
|
+
/** 组合名 */
|
|
459
|
+
pair: TextRef;
|
|
460
|
+
/** 算出的对比度,保留两位小数 */
|
|
461
|
+
ratio: number;
|
|
462
|
+
minimum: number;
|
|
463
|
+
}
|
|
464
|
+
/** 按 WCAG 2 的对比度公式检查主题,列出不达标的组合;没有不达标的回空数组 */
|
|
465
|
+
export declare function themeContrastIssues(theme: Theme): ContrastIssue[];
|
|
466
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAWlD,eAAe;AACf,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAC/C,qCAAqC;AACrC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAKpC;;;GAGG;AACH,eAAO,MAAM,YAAY,m4BAyEf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AACvD,MAAM,MAAM,SAAS,GAAG,MA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