@aalis/api-webui 0.12.0 → 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.js +65 -7
- 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 +32 -7
- package/dist/frame.d.ts.map +1 -1
- package/dist/frame.js +2 -2
- package/dist/frame.js.map +1 -1
- package/dist/index.d.ts +15 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -20
- 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 +36 -26
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +2 -0
- package/dist/page.js.map +1 -1
- package/dist/rest.d.ts +115 -26
- package/dist/rest.d.ts.map +1 -1
- package/dist/rest.js +10 -1
- package/dist/rest.js.map +1 -1
- 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 +8 -11
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +75 -57
- package/dist/theme.js.map +1 -1
- package/dist/themes/aalis-dark.json +0 -1
- package/dist/themes/aalis-light.json +0 -1
- package/dist/themes/brand-dark.json +0 -1
- package/dist/themes/brand-light.json +0 -1
- package/dist/themes/calm-dark.json +0 -1
- package/dist/themes/calm-light.json +0 -1
- package/dist/themes/neutral-dark.json +0 -1
- package/dist/themes/neutral-light.json +0 -1
- package/package.json +12 -11
package/dist/rest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest.js","sourceRoot":"","sources":["../src/rest.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,EAAE;AACF,sFAAsF;AACtF,2FAA2F;AAC3F,iFAAiF;AACjF,kGAAkG;AAClG,oCAAoC;AACpC,EAAE;AACF,kFAAkF;AAClF,8EAA8E"}
|
|
1
|
+
{"version":3,"file":"rest.js","sourceRoot":"","sources":["../src/rest.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,EAAE;AACF,sFAAsF;AACtF,2FAA2F;AAC3F,iFAAiF;AACjF,kGAAkG;AAClG,oCAAoC;AACpC,EAAE;AACF,kFAAkF;AAClF,8EAA8E;AAC9E,EAAE;AACF,gEAAgE;AAChE,gFAAgF;AAChF,0BAA0B;AAsa1B;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC"}
|
package/dist/texts.d.ts
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
declare const SOURCE: {
|
|
2
|
+
readonly subsystemSystem: "系统";
|
|
3
|
+
readonly subsystemCore: "核心";
|
|
4
|
+
readonly subsystemPlatform: "平台";
|
|
5
|
+
readonly subsystemAgent: "Agent";
|
|
6
|
+
readonly subsystemLlm: "LLM";
|
|
7
|
+
readonly subsystemEmbedding: "Embedding";
|
|
8
|
+
readonly subsystemMemory: "记忆";
|
|
9
|
+
readonly subsystemPersona: "人格";
|
|
10
|
+
readonly subsystemTools: "工具";
|
|
11
|
+
readonly subsystemStorage: "存储";
|
|
12
|
+
readonly subsystemMessage: "消息";
|
|
13
|
+
readonly subsystemMedia: "媒体";
|
|
14
|
+
readonly subsystemSession: "会话";
|
|
15
|
+
readonly subsystemSkills: "技能";
|
|
16
|
+
readonly subsystemScheduler: "调度";
|
|
17
|
+
readonly subsystemWorkflow: "工作流";
|
|
18
|
+
readonly subsystemAuthority: "权限";
|
|
19
|
+
readonly subsystemUser: "用户";
|
|
20
|
+
readonly subsystemExternal: "外部";
|
|
21
|
+
readonly themeCalmDark: "偏中性深色";
|
|
22
|
+
readonly themeCalmLight: "偏中性浅色";
|
|
23
|
+
readonly themeAalisDark: "品牌柔和深色";
|
|
24
|
+
readonly themeAalisLight: "品牌柔和浅色";
|
|
25
|
+
readonly themeBrandDark: "文档站原色深色";
|
|
26
|
+
readonly themeBrandLight: "文档站原色浅色";
|
|
27
|
+
readonly themeNeutralDark: "安静中性深色";
|
|
28
|
+
readonly themeNeutralLight: "安静中性浅色";
|
|
29
|
+
readonly textOnMain: "正文 / 主区";
|
|
30
|
+
readonly textOnSideSelected: "正文 / 侧栏里的选中行";
|
|
31
|
+
readonly secondaryOnMain: "次要字 / 主区";
|
|
32
|
+
readonly secondaryOnSide: "次要字 / 侧栏";
|
|
33
|
+
readonly mutedOnMain: "弱化字 / 主区";
|
|
34
|
+
readonly mutedOnSide: "弱化字 / 侧栏";
|
|
35
|
+
readonly mutedOnSideSelected: "弱化字 / 侧栏里的选中行";
|
|
36
|
+
readonly mutedOnMainSelected: "弱化字 / 主区里的选中行";
|
|
37
|
+
readonly mutedOnRaisedHighlight: "弱化字 / 浮层里的高亮项";
|
|
38
|
+
readonly linkOnMain: "链接 / 主区";
|
|
39
|
+
readonly accentText: "主按钮的字 / 主按钮";
|
|
40
|
+
readonly accentHoverText: "主按钮的字 / 主按钮悬停";
|
|
41
|
+
readonly dangerButtonText: "危险按钮的字 / 危险按钮";
|
|
42
|
+
readonly dangerHoverText: "危险按钮的字 / 危险按钮悬停";
|
|
43
|
+
readonly dangerOnMain: "危险字 / 主区";
|
|
44
|
+
readonly warningOnMain: "警告字 / 主区";
|
|
45
|
+
readonly successOnMain: "成功字 / 主区";
|
|
46
|
+
readonly dangerOnMainTint: "危险字 / 主区上的危险浅底";
|
|
47
|
+
readonly dangerOnSideTint: "危险字 / 侧栏上的危险浅底";
|
|
48
|
+
readonly warningOnMainTint: "警告字 / 主区上的警告浅底";
|
|
49
|
+
readonly warningOnSideTint: "警告字 / 侧栏上的警告浅底";
|
|
50
|
+
readonly successOnMainTint: "成功字 / 主区上的成功浅底";
|
|
51
|
+
readonly successOnSideTint: "成功字 / 侧栏上的成功浅底";
|
|
52
|
+
readonly secondaryOnRail: "次要字 / 图标栏";
|
|
53
|
+
readonly syntaxKeyword: "代码关键字 / 代码块";
|
|
54
|
+
readonly syntaxString: "代码字符串 / 代码块";
|
|
55
|
+
readonly syntaxNumber: "代码数字 / 代码块";
|
|
56
|
+
readonly syntaxComment: "代码注释 / 代码块";
|
|
57
|
+
readonly syntaxFunction: "代码函数名 / 代码块";
|
|
58
|
+
readonly syntaxType: "代码类型 / 代码块";
|
|
59
|
+
readonly focusOnMain: "焦点环 / 主区";
|
|
60
|
+
readonly focusOnSide: "焦点环 / 侧栏";
|
|
61
|
+
readonly controlOnMain: "输入框外框 / 主区";
|
|
62
|
+
readonly controlOnSide: "输入框外框 / 侧栏";
|
|
63
|
+
readonly controlOnRaised: "输入框外框 / 浮层";
|
|
64
|
+
readonly chartOnMain: "图表色 {n} / 主区";
|
|
65
|
+
readonly iconOnRailCurrent: "图标 / 图标栏的当前项";
|
|
66
|
+
readonly markOnMain: "金色标记 / 主区";
|
|
67
|
+
readonly markOnSide: "金色标记 / 侧栏";
|
|
68
|
+
readonly markOnRail: "金色标记 / 图标栏";
|
|
69
|
+
readonly markOnSideSelected: "金色标记 / 侧栏里的选中行";
|
|
70
|
+
readonly markOnRailCurrent: "金色标记 / 图标栏的当前项";
|
|
71
|
+
readonly themeNotObject: "主题文件应是一个 JSON 对象";
|
|
72
|
+
readonly themeFormat: "格式名应为 {format}";
|
|
73
|
+
readonly themeVersion: "格式版本 {version} 不认识,只认 {supported}";
|
|
74
|
+
readonly themeName: "名字应是 1 到 {max, number} 个字的文本";
|
|
75
|
+
readonly themeKind: "种类应为 dark 或 light";
|
|
76
|
+
readonly themeExtraField: "多余的字段:{key}";
|
|
77
|
+
readonly themeColorsNotObject: "colors 应是一个对象";
|
|
78
|
+
readonly themeUnknownToken: "{token} 不在令牌表里";
|
|
79
|
+
readonly themeNotColor: "{token} 的值不是颜色:{value}";
|
|
80
|
+
};
|
|
81
|
+
export type Source = typeof SOURCE;
|
|
82
|
+
export declare const t: import("@aalis/schema-i18n").TextFactory<{
|
|
83
|
+
readonly subsystemSystem: "系统";
|
|
84
|
+
readonly subsystemCore: "核心";
|
|
85
|
+
readonly subsystemPlatform: "平台";
|
|
86
|
+
readonly subsystemAgent: "Agent";
|
|
87
|
+
readonly subsystemLlm: "LLM";
|
|
88
|
+
readonly subsystemEmbedding: "Embedding";
|
|
89
|
+
readonly subsystemMemory: "记忆";
|
|
90
|
+
readonly subsystemPersona: "人格";
|
|
91
|
+
readonly subsystemTools: "工具";
|
|
92
|
+
readonly subsystemStorage: "存储";
|
|
93
|
+
readonly subsystemMessage: "消息";
|
|
94
|
+
readonly subsystemMedia: "媒体";
|
|
95
|
+
readonly subsystemSession: "会话";
|
|
96
|
+
readonly subsystemSkills: "技能";
|
|
97
|
+
readonly subsystemScheduler: "调度";
|
|
98
|
+
readonly subsystemWorkflow: "工作流";
|
|
99
|
+
readonly subsystemAuthority: "权限";
|
|
100
|
+
readonly subsystemUser: "用户";
|
|
101
|
+
readonly subsystemExternal: "外部";
|
|
102
|
+
readonly themeCalmDark: "偏中性深色";
|
|
103
|
+
readonly themeCalmLight: "偏中性浅色";
|
|
104
|
+
readonly themeAalisDark: "品牌柔和深色";
|
|
105
|
+
readonly themeAalisLight: "品牌柔和浅色";
|
|
106
|
+
readonly themeBrandDark: "文档站原色深色";
|
|
107
|
+
readonly themeBrandLight: "文档站原色浅色";
|
|
108
|
+
readonly themeNeutralDark: "安静中性深色";
|
|
109
|
+
readonly themeNeutralLight: "安静中性浅色";
|
|
110
|
+
readonly textOnMain: "正文 / 主区";
|
|
111
|
+
readonly textOnSideSelected: "正文 / 侧栏里的选中行";
|
|
112
|
+
readonly secondaryOnMain: "次要字 / 主区";
|
|
113
|
+
readonly secondaryOnSide: "次要字 / 侧栏";
|
|
114
|
+
readonly mutedOnMain: "弱化字 / 主区";
|
|
115
|
+
readonly mutedOnSide: "弱化字 / 侧栏";
|
|
116
|
+
readonly mutedOnSideSelected: "弱化字 / 侧栏里的选中行";
|
|
117
|
+
readonly mutedOnMainSelected: "弱化字 / 主区里的选中行";
|
|
118
|
+
readonly mutedOnRaisedHighlight: "弱化字 / 浮层里的高亮项";
|
|
119
|
+
readonly linkOnMain: "链接 / 主区";
|
|
120
|
+
readonly accentText: "主按钮的字 / 主按钮";
|
|
121
|
+
readonly accentHoverText: "主按钮的字 / 主按钮悬停";
|
|
122
|
+
readonly dangerButtonText: "危险按钮的字 / 危险按钮";
|
|
123
|
+
readonly dangerHoverText: "危险按钮的字 / 危险按钮悬停";
|
|
124
|
+
readonly dangerOnMain: "危险字 / 主区";
|
|
125
|
+
readonly warningOnMain: "警告字 / 主区";
|
|
126
|
+
readonly successOnMain: "成功字 / 主区";
|
|
127
|
+
readonly dangerOnMainTint: "危险字 / 主区上的危险浅底";
|
|
128
|
+
readonly dangerOnSideTint: "危险字 / 侧栏上的危险浅底";
|
|
129
|
+
readonly warningOnMainTint: "警告字 / 主区上的警告浅底";
|
|
130
|
+
readonly warningOnSideTint: "警告字 / 侧栏上的警告浅底";
|
|
131
|
+
readonly successOnMainTint: "成功字 / 主区上的成功浅底";
|
|
132
|
+
readonly successOnSideTint: "成功字 / 侧栏上的成功浅底";
|
|
133
|
+
readonly secondaryOnRail: "次要字 / 图标栏";
|
|
134
|
+
readonly syntaxKeyword: "代码关键字 / 代码块";
|
|
135
|
+
readonly syntaxString: "代码字符串 / 代码块";
|
|
136
|
+
readonly syntaxNumber: "代码数字 / 代码块";
|
|
137
|
+
readonly syntaxComment: "代码注释 / 代码块";
|
|
138
|
+
readonly syntaxFunction: "代码函数名 / 代码块";
|
|
139
|
+
readonly syntaxType: "代码类型 / 代码块";
|
|
140
|
+
readonly focusOnMain: "焦点环 / 主区";
|
|
141
|
+
readonly focusOnSide: "焦点环 / 侧栏";
|
|
142
|
+
readonly controlOnMain: "输入框外框 / 主区";
|
|
143
|
+
readonly controlOnSide: "输入框外框 / 侧栏";
|
|
144
|
+
readonly controlOnRaised: "输入框外框 / 浮层";
|
|
145
|
+
readonly chartOnMain: "图表色 {n} / 主区";
|
|
146
|
+
readonly iconOnRailCurrent: "图标 / 图标栏的当前项";
|
|
147
|
+
readonly markOnMain: "金色标记 / 主区";
|
|
148
|
+
readonly markOnSide: "金色标记 / 侧栏";
|
|
149
|
+
readonly markOnRail: "金色标记 / 图标栏";
|
|
150
|
+
readonly markOnSideSelected: "金色标记 / 侧栏里的选中行";
|
|
151
|
+
readonly markOnRailCurrent: "金色标记 / 图标栏的当前项";
|
|
152
|
+
readonly themeNotObject: "主题文件应是一个 JSON 对象";
|
|
153
|
+
readonly themeFormat: "格式名应为 {format}";
|
|
154
|
+
readonly themeVersion: "格式版本 {version} 不认识,只认 {supported}";
|
|
155
|
+
readonly themeName: "名字应是 1 到 {max, number} 个字的文本";
|
|
156
|
+
readonly themeKind: "种类应为 dark 或 light";
|
|
157
|
+
readonly themeExtraField: "多余的字段:{key}";
|
|
158
|
+
readonly themeColorsNotObject: "colors 应是一个对象";
|
|
159
|
+
readonly themeUnknownToken: "{token} 不在令牌表里";
|
|
160
|
+
readonly themeNotColor: "{token} 的值不是颜色:{value}";
|
|
161
|
+
}>;
|
|
162
|
+
export {};
|
|
163
|
+
//# sourceMappingURL=texts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texts.d.ts","sourceRoot":"","sources":["../src/texts.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+EF,CAAC;AACX,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC;AAEnC,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA8F,CAAC"}
|
package/dist/texts.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// 本包自己的原文字典:子系统组名、内置主题名、对比度检查的组合名与主题文件的校验原因,前端随包带上、按读者语言渲染
|
|
2
|
+
import { defineTexts } from '@aalis/schema-i18n';
|
|
3
|
+
import en from './locales/en.js';
|
|
4
|
+
const SOURCE = {
|
|
5
|
+
subsystemSystem: '系统',
|
|
6
|
+
subsystemCore: '核心',
|
|
7
|
+
subsystemPlatform: '平台',
|
|
8
|
+
subsystemAgent: 'Agent',
|
|
9
|
+
subsystemLlm: 'LLM',
|
|
10
|
+
subsystemEmbedding: 'Embedding',
|
|
11
|
+
subsystemMemory: '记忆',
|
|
12
|
+
subsystemPersona: '人格',
|
|
13
|
+
subsystemTools: '工具',
|
|
14
|
+
subsystemStorage: '存储',
|
|
15
|
+
subsystemMessage: '消息',
|
|
16
|
+
subsystemMedia: '媒体',
|
|
17
|
+
subsystemSession: '会话',
|
|
18
|
+
subsystemSkills: '技能',
|
|
19
|
+
subsystemScheduler: '调度',
|
|
20
|
+
subsystemWorkflow: '工作流',
|
|
21
|
+
subsystemAuthority: '权限',
|
|
22
|
+
subsystemUser: '用户',
|
|
23
|
+
subsystemExternal: '外部',
|
|
24
|
+
themeCalmDark: '偏中性深色',
|
|
25
|
+
themeCalmLight: '偏中性浅色',
|
|
26
|
+
themeAalisDark: '品牌柔和深色',
|
|
27
|
+
themeAalisLight: '品牌柔和浅色',
|
|
28
|
+
themeBrandDark: '文档站原色深色',
|
|
29
|
+
themeBrandLight: '文档站原色浅色',
|
|
30
|
+
themeNeutralDark: '安静中性深色',
|
|
31
|
+
themeNeutralLight: '安静中性浅色',
|
|
32
|
+
textOnMain: '正文 / 主区',
|
|
33
|
+
textOnSideSelected: '正文 / 侧栏里的选中行',
|
|
34
|
+
secondaryOnMain: '次要字 / 主区',
|
|
35
|
+
secondaryOnSide: '次要字 / 侧栏',
|
|
36
|
+
mutedOnMain: '弱化字 / 主区',
|
|
37
|
+
mutedOnSide: '弱化字 / 侧栏',
|
|
38
|
+
mutedOnSideSelected: '弱化字 / 侧栏里的选中行',
|
|
39
|
+
mutedOnMainSelected: '弱化字 / 主区里的选中行',
|
|
40
|
+
mutedOnRaisedHighlight: '弱化字 / 浮层里的高亮项',
|
|
41
|
+
linkOnMain: '链接 / 主区',
|
|
42
|
+
accentText: '主按钮的字 / 主按钮',
|
|
43
|
+
accentHoverText: '主按钮的字 / 主按钮悬停',
|
|
44
|
+
dangerButtonText: '危险按钮的字 / 危险按钮',
|
|
45
|
+
dangerHoverText: '危险按钮的字 / 危险按钮悬停',
|
|
46
|
+
dangerOnMain: '危险字 / 主区',
|
|
47
|
+
warningOnMain: '警告字 / 主区',
|
|
48
|
+
successOnMain: '成功字 / 主区',
|
|
49
|
+
dangerOnMainTint: '危险字 / 主区上的危险浅底',
|
|
50
|
+
dangerOnSideTint: '危险字 / 侧栏上的危险浅底',
|
|
51
|
+
warningOnMainTint: '警告字 / 主区上的警告浅底',
|
|
52
|
+
warningOnSideTint: '警告字 / 侧栏上的警告浅底',
|
|
53
|
+
successOnMainTint: '成功字 / 主区上的成功浅底',
|
|
54
|
+
successOnSideTint: '成功字 / 侧栏上的成功浅底',
|
|
55
|
+
secondaryOnRail: '次要字 / 图标栏',
|
|
56
|
+
syntaxKeyword: '代码关键字 / 代码块',
|
|
57
|
+
syntaxString: '代码字符串 / 代码块',
|
|
58
|
+
syntaxNumber: '代码数字 / 代码块',
|
|
59
|
+
syntaxComment: '代码注释 / 代码块',
|
|
60
|
+
syntaxFunction: '代码函数名 / 代码块',
|
|
61
|
+
syntaxType: '代码类型 / 代码块',
|
|
62
|
+
focusOnMain: '焦点环 / 主区',
|
|
63
|
+
focusOnSide: '焦点环 / 侧栏',
|
|
64
|
+
controlOnMain: '输入框外框 / 主区',
|
|
65
|
+
controlOnSide: '输入框外框 / 侧栏',
|
|
66
|
+
controlOnRaised: '输入框外框 / 浮层',
|
|
67
|
+
chartOnMain: '图表色 {n} / 主区',
|
|
68
|
+
iconOnRailCurrent: '图标 / 图标栏的当前项',
|
|
69
|
+
markOnMain: '金色标记 / 主区',
|
|
70
|
+
markOnSide: '金色标记 / 侧栏',
|
|
71
|
+
markOnRail: '金色标记 / 图标栏',
|
|
72
|
+
markOnSideSelected: '金色标记 / 侧栏里的选中行',
|
|
73
|
+
markOnRailCurrent: '金色标记 / 图标栏的当前项',
|
|
74
|
+
themeNotObject: '主题文件应是一个 JSON 对象',
|
|
75
|
+
themeFormat: '格式名应为 {format}',
|
|
76
|
+
themeVersion: '格式版本 {version} 不认识,只认 {supported}',
|
|
77
|
+
themeName: '名字应是 1 到 {max, number} 个字的文本',
|
|
78
|
+
themeKind: '种类应为 dark 或 light',
|
|
79
|
+
themeExtraField: '多余的字段:{key}',
|
|
80
|
+
themeColorsNotObject: 'colors 应是一个对象',
|
|
81
|
+
themeUnknownToken: '{token} 不在令牌表里',
|
|
82
|
+
themeNotColor: '{token} 的值不是颜色:{value}',
|
|
83
|
+
};
|
|
84
|
+
export const t = defineTexts({ ns: '@aalis/api-webui', language: 'zh-CN', source: SOURCE, locales: { en } });
|
|
85
|
+
//# sourceMappingURL=texts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texts.js","sourceRoot":"","sources":["../src/texts.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEjC,MAAM,MAAM,GAAG;IACb,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,IAAI;IACnB,iBAAiB,EAAE,IAAI;IACvB,cAAc,EAAE,OAAO;IACvB,YAAY,EAAE,KAAK;IACnB,kBAAkB,EAAE,WAAW;IAC/B,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,gBAAgB,EAAE,IAAI;IACtB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,gBAAgB,EAAE,IAAI;IACtB,eAAe,EAAE,IAAI;IACrB,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,KAAK;IACxB,kBAAkB,EAAE,IAAI;IACxB,aAAa,EAAE,IAAI;IACnB,iBAAiB,EAAE,IAAI;IACvB,aAAa,EAAE,OAAO;IACtB,cAAc,EAAE,OAAO;IACvB,cAAc,EAAE,QAAQ;IACxB,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,SAAS;IACzB,eAAe,EAAE,SAAS;IAC1B,gBAAgB,EAAE,QAAQ;IAC1B,iBAAiB,EAAE,QAAQ;IAC3B,UAAU,EAAE,SAAS;IACrB,kBAAkB,EAAE,cAAc;IAClC,eAAe,EAAE,UAAU;IAC3B,eAAe,EAAE,UAAU;IAC3B,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,UAAU;IACvB,mBAAmB,EAAE,eAAe;IACpC,mBAAmB,EAAE,eAAe;IACpC,sBAAsB,EAAE,eAAe;IACvC,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,aAAa;IACzB,eAAe,EAAE,eAAe;IAChC,gBAAgB,EAAE,eAAe;IACjC,eAAe,EAAE,iBAAiB;IAClC,YAAY,EAAE,UAAU;IACxB,aAAa,EAAE,UAAU;IACzB,aAAa,EAAE,UAAU;IACzB,gBAAgB,EAAE,gBAAgB;IAClC,gBAAgB,EAAE,gBAAgB;IAClC,iBAAiB,EAAE,gBAAgB;IACnC,iBAAiB,EAAE,gBAAgB;IACnC,iBAAiB,EAAE,gBAAgB;IACnC,iBAAiB,EAAE,gBAAgB;IACnC,eAAe,EAAE,WAAW;IAC5B,aAAa,EAAE,aAAa;IAC5B,YAAY,EAAE,aAAa;IAC3B,YAAY,EAAE,YAAY;IAC1B,aAAa,EAAE,YAAY;IAC3B,cAAc,EAAE,aAAa;IAC7B,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,UAAU;IACvB,aAAa,EAAE,YAAY;IAC3B,aAAa,EAAE,YAAY;IAC3B,eAAe,EAAE,YAAY;IAC7B,WAAW,EAAE,cAAc;IAC3B,iBAAiB,EAAE,cAAc;IACjC,UAAU,EAAE,WAAW;IACvB,UAAU,EAAE,WAAW;IACvB,UAAU,EAAE,YAAY;IACxB,kBAAkB,EAAE,gBAAgB;IACpC,iBAAiB,EAAE,gBAAgB;IACnC,cAAc,EAAE,kBAAkB;IAClC,WAAW,EAAE,gBAAgB;IAC7B,YAAY,EAAE,mCAAmC;IACjD,SAAS,EAAE,8BAA8B;IACzC,SAAS,EAAE,mBAAmB;IAC9B,eAAe,EAAE,aAAa;IAC9B,oBAAoB,EAAE,eAAe;IACrC,iBAAiB,EAAE,gBAAgB;IACnC,aAAa,EAAE,wBAAwB;CAC/B,CAAC;AAGX,MAAM,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,EAAE,EAAE,EAAE,kBAAkB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC"}
|
package/dist/theme.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TextRef } from '@aalis/schema-i18n';
|
|
1
2
|
/** 主题文件的格式名 */
|
|
2
3
|
export declare const THEME_FILE_FORMAT = "aalis-theme";
|
|
3
4
|
/** 主题文件的格式版本:令牌表改名时加一,旧版本的文件按版本迁移 */
|
|
@@ -23,12 +24,13 @@ export interface Theme {
|
|
|
23
24
|
kind: ThemeKind;
|
|
24
25
|
colors: Record<ThemeToken, string>;
|
|
25
26
|
}
|
|
27
|
+
/** 校验的结果:不合格式时列出全部原因,原因是本包字典里的文字对象,界面按读者语言渲染、日志取原文 */
|
|
26
28
|
export type ThemeParseResult = {
|
|
27
29
|
ok: true;
|
|
28
30
|
theme: Theme;
|
|
29
31
|
} | {
|
|
30
32
|
ok: false;
|
|
31
|
-
errors:
|
|
33
|
+
errors: TextRef[];
|
|
32
34
|
};
|
|
33
35
|
/**
|
|
34
36
|
* `webui:theme` 贡献点的 spec:插件交一份主题文件,经 `contributions.contribute('webui:theme', { id, theme })` 登记,
|
|
@@ -50,12 +52,11 @@ export interface PluginTheme {
|
|
|
50
52
|
instance: string;
|
|
51
53
|
theme: Theme;
|
|
52
54
|
}
|
|
53
|
-
/**
|
|
55
|
+
/** 内置主题:随包带的主题文件(不带名字),键是主题 id(配色名加种类) */
|
|
54
56
|
export declare const BUILTIN_THEMES: {
|
|
55
57
|
'calm-dark': {
|
|
56
58
|
format: string;
|
|
57
59
|
version: number;
|
|
58
|
-
name: string;
|
|
59
60
|
kind: string;
|
|
60
61
|
colors: {
|
|
61
62
|
"--color-bg": string;
|
|
@@ -105,7 +106,6 @@ export declare const BUILTIN_THEMES: {
|
|
|
105
106
|
'calm-light': {
|
|
106
107
|
format: string;
|
|
107
108
|
version: number;
|
|
108
|
-
name: string;
|
|
109
109
|
kind: string;
|
|
110
110
|
colors: {
|
|
111
111
|
"--color-bg": string;
|
|
@@ -155,7 +155,6 @@ export declare const BUILTIN_THEMES: {
|
|
|
155
155
|
'aalis-dark': {
|
|
156
156
|
format: string;
|
|
157
157
|
version: number;
|
|
158
|
-
name: string;
|
|
159
158
|
kind: string;
|
|
160
159
|
colors: {
|
|
161
160
|
"--color-bg": string;
|
|
@@ -205,7 +204,6 @@ export declare const BUILTIN_THEMES: {
|
|
|
205
204
|
'aalis-light': {
|
|
206
205
|
format: string;
|
|
207
206
|
version: number;
|
|
208
|
-
name: string;
|
|
209
207
|
kind: string;
|
|
210
208
|
colors: {
|
|
211
209
|
"--color-bg": string;
|
|
@@ -255,7 +253,6 @@ export declare const BUILTIN_THEMES: {
|
|
|
255
253
|
'brand-dark': {
|
|
256
254
|
format: string;
|
|
257
255
|
version: number;
|
|
258
|
-
name: string;
|
|
259
256
|
kind: string;
|
|
260
257
|
colors: {
|
|
261
258
|
"--color-bg": string;
|
|
@@ -305,7 +302,6 @@ export declare const BUILTIN_THEMES: {
|
|
|
305
302
|
'brand-light': {
|
|
306
303
|
format: string;
|
|
307
304
|
version: number;
|
|
308
|
-
name: string;
|
|
309
305
|
kind: string;
|
|
310
306
|
colors: {
|
|
311
307
|
"--color-bg": string;
|
|
@@ -355,7 +351,6 @@ export declare const BUILTIN_THEMES: {
|
|
|
355
351
|
'neutral-dark': {
|
|
356
352
|
format: string;
|
|
357
353
|
version: number;
|
|
358
|
-
name: string;
|
|
359
354
|
kind: string;
|
|
360
355
|
colors: {
|
|
361
356
|
"--color-bg": string;
|
|
@@ -405,7 +400,6 @@ export declare const BUILTIN_THEMES: {
|
|
|
405
400
|
'neutral-light': {
|
|
406
401
|
format: string;
|
|
407
402
|
version: number;
|
|
408
|
-
name: string;
|
|
409
403
|
kind: string;
|
|
410
404
|
colors: {
|
|
411
405
|
"--color-bg": string;
|
|
@@ -454,12 +448,15 @@ export declare const BUILTIN_THEMES: {
|
|
|
454
448
|
};
|
|
455
449
|
};
|
|
456
450
|
export type BuiltinThemeId = keyof typeof BUILTIN_THEMES;
|
|
451
|
+
/** 内置主题的名字,按主题 id 取 */
|
|
452
|
+
export declare const BUILTIN_THEME_NAMES: Readonly<Record<BuiltinThemeId, TextRef>>;
|
|
457
453
|
/** 跟随系统时默认的深色与浅色主题,也是补齐缺失令牌的来源 */
|
|
458
454
|
export declare const DEFAULT_THEMES: Readonly<Record<ThemeKind, BuiltinThemeId>>;
|
|
459
455
|
/** 校验一份主题文件(已按 JSON 解析):不合格式的列出全部原因 */
|
|
460
456
|
export declare function parseTheme(value: unknown): ThemeParseResult;
|
|
461
457
|
export interface ContrastIssue {
|
|
462
|
-
|
|
458
|
+
/** 组合名 */
|
|
459
|
+
pair: TextRef;
|
|
463
460
|
/** 算出的对比度,保留两位小数 */
|
|
464
461
|
ratio: number;
|
|
465
462
|
minimum: number;
|
package/dist/theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"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"}
|
package/dist/theme.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// ----- 主题 -----
|
|
2
2
|
//
|
|
3
3
|
// 一个主题是名字、种类(深或浅)与一套颜色令牌值,只改颜色,不改间距、圆角、字号与布局。主题文件是可交换的 JSON:
|
|
4
|
-
//
|
|
5
|
-
//
|
|
4
|
+
// 格式名、格式版本、名字、种类与颜色令牌表,没有别的内容。内置主题是随包带的这种文件,只是不带名字:名字按主题 id
|
|
5
|
+
// 取本包的字典(BUILTIN_THEME_NAMES),界面按读者语言渲染。第三方主题照着改了再导入,插件提供的主题也只交同一种数据,
|
|
6
|
+
// 三者都经 parseTheme 校验(内置主题以 id 作名字)。导入的与插件提供的主题名是数据,照原文显示。
|
|
6
7
|
//
|
|
7
8
|
// 令牌名是公开契约:主题只能写 THEME_TOKENS 里的名字,界面的样式只引用这些名字。改名会打破已有的主题,
|
|
8
9
|
// 所以按格式版本迁移,迁不了的拒收并说明。
|
|
9
10
|
//
|
|
10
11
|
// 插件经贡献点 `webui:theme` 提供主题(ThemeContribution),webui-server 经 GET /api/themes 列出校验过的,
|
|
11
12
|
// 插件停用就随之撤回;设置「外观」的主题选择里与内置、导入的主题并列。
|
|
13
|
+
import { t } from './texts.js';
|
|
12
14
|
import aalisDark from './themes/aalis-dark.json' with { type: 'json' };
|
|
13
15
|
import aalisLight from './themes/aalis-light.json' with { type: 'json' };
|
|
14
16
|
import brandDark from './themes/brand-dark.json' with { type: 'json' };
|
|
@@ -101,7 +103,7 @@ export const THEME_TOKENS = [
|
|
|
101
103
|
'--color-syntax-function',
|
|
102
104
|
'--color-syntax-type',
|
|
103
105
|
];
|
|
104
|
-
/**
|
|
106
|
+
/** 内置主题:随包带的主题文件(不带名字),键是主题 id(配色名加种类) */
|
|
105
107
|
export const BUILTIN_THEMES = {
|
|
106
108
|
'calm-dark': calmDark,
|
|
107
109
|
'calm-light': calmLight,
|
|
@@ -112,6 +114,17 @@ export const BUILTIN_THEMES = {
|
|
|
112
114
|
'neutral-dark': neutralDark,
|
|
113
115
|
'neutral-light': neutralLight,
|
|
114
116
|
};
|
|
117
|
+
/** 内置主题的名字,按主题 id 取 */
|
|
118
|
+
export const BUILTIN_THEME_NAMES = {
|
|
119
|
+
'calm-dark': t('themeCalmDark'),
|
|
120
|
+
'calm-light': t('themeCalmLight'),
|
|
121
|
+
'aalis-dark': t('themeAalisDark'),
|
|
122
|
+
'aalis-light': t('themeAalisLight'),
|
|
123
|
+
'brand-dark': t('themeBrandDark'),
|
|
124
|
+
'brand-light': t('themeBrandLight'),
|
|
125
|
+
'neutral-dark': t('themeNeutralDark'),
|
|
126
|
+
'neutral-light': t('themeNeutralLight'),
|
|
127
|
+
};
|
|
115
128
|
/** 跟随系统时默认的深色与浅色主题,也是补齐缺失令牌的来源 */
|
|
116
129
|
export const DEFAULT_THEMES = { dark: 'calm-dark', light: 'calm-light' };
|
|
117
130
|
const TOKEN_SET = new Set(THEME_TOKENS);
|
|
@@ -120,31 +133,36 @@ const isRecord = (value) => typeof value === 'object' && value !== null && !Arra
|
|
|
120
133
|
/** 校验一份主题文件(已按 JSON 解析):不合格式的列出全部原因 */
|
|
121
134
|
export function parseTheme(value) {
|
|
122
135
|
if (!isRecord(value))
|
|
123
|
-
return { ok: false, errors: ['
|
|
124
|
-
if (value.format !== THEME_FILE_FORMAT)
|
|
125
|
-
return { ok: false, errors: [
|
|
136
|
+
return { ok: false, errors: [t('themeNotObject')] };
|
|
137
|
+
if (value.format !== THEME_FILE_FORMAT) {
|
|
138
|
+
return { ok: false, errors: [t('themeFormat', { format: THEME_FILE_FORMAT })] };
|
|
139
|
+
}
|
|
126
140
|
if (value.version !== THEME_FILE_VERSION) {
|
|
127
|
-
return {
|
|
141
|
+
return {
|
|
142
|
+
ok: false,
|
|
143
|
+
errors: [t('themeVersion', { version: String(value.version), supported: THEME_FILE_VERSION })],
|
|
144
|
+
};
|
|
128
145
|
}
|
|
129
146
|
const errors = [];
|
|
130
147
|
const name = typeof value.name === 'string' ? value.name.trim() : '';
|
|
131
148
|
if (name === '' || [...name].length > THEME_NAME_MAX_LENGTH) {
|
|
132
|
-
errors.push(
|
|
149
|
+
errors.push(t('themeName', { max: THEME_NAME_MAX_LENGTH }));
|
|
133
150
|
}
|
|
134
151
|
if (value.kind !== 'dark' && value.kind !== 'light')
|
|
135
|
-
errors.push('
|
|
152
|
+
errors.push(t('themeKind'));
|
|
136
153
|
for (const key of Object.keys(value))
|
|
137
154
|
if (!FILE_FIELDS.has(key))
|
|
138
|
-
errors.push(
|
|
155
|
+
errors.push(t('themeExtraField', { key }));
|
|
139
156
|
if (!isRecord(value.colors)) {
|
|
140
|
-
errors.push('
|
|
157
|
+
errors.push(t('themeColorsNotObject'));
|
|
141
158
|
return { ok: false, errors };
|
|
142
159
|
}
|
|
143
160
|
for (const [token, color] of Object.entries(value.colors)) {
|
|
144
161
|
if (!TOKEN_SET.has(token))
|
|
145
|
-
errors.push(
|
|
146
|
-
else if (typeof color !== 'string' || !parseColor(color))
|
|
147
|
-
errors.push(
|
|
162
|
+
errors.push(t('themeUnknownToken', { token }));
|
|
163
|
+
else if (typeof color !== 'string' || !parseColor(color)) {
|
|
164
|
+
errors.push(t('themeNotColor', { token, value: String(color) }));
|
|
165
|
+
}
|
|
148
166
|
}
|
|
149
167
|
if (errors.length > 0)
|
|
150
168
|
return { ok: false, errors };
|
|
@@ -166,53 +184,53 @@ const pair = (name, foreground, background, minimum) => ({
|
|
|
166
184
|
minimum,
|
|
167
185
|
});
|
|
168
186
|
const SYNTAX_PAIRS = [
|
|
169
|
-
['
|
|
170
|
-
['
|
|
171
|
-
['
|
|
172
|
-
['
|
|
173
|
-
['
|
|
174
|
-
['
|
|
175
|
-
].map(([name, token]) => pair(
|
|
176
|
-
const CHART_PAIRS = [1, 2, 3, 4, 5, 6].map(n => pair(
|
|
187
|
+
[t('syntaxKeyword'), '--color-syntax-keyword'],
|
|
188
|
+
[t('syntaxString'), '--color-syntax-string'],
|
|
189
|
+
[t('syntaxNumber'), '--color-syntax-number'],
|
|
190
|
+
[t('syntaxComment'), '--color-syntax-comment'],
|
|
191
|
+
[t('syntaxFunction'), '--color-syntax-function'],
|
|
192
|
+
[t('syntaxType'), '--color-syntax-type'],
|
|
193
|
+
].map(([name, token]) => pair(name, token, ['--color-bg', '--color-fill-1'], TEXT));
|
|
194
|
+
const CHART_PAIRS = [1, 2, 3, 4, 5, 6].map(n => pair(t('chartOnMain', { n }), `--color-chart-${n}`, ['--color-bg'], NON_TEXT));
|
|
177
195
|
/** 主题要过的全部组合:导入主题与内置主题的测试用同一张表 */
|
|
178
196
|
const CONTRAST_PAIRS = [
|
|
179
|
-
pair('
|
|
180
|
-
pair('
|
|
181
|
-
pair('
|
|
182
|
-
pair('
|
|
183
|
-
pair('
|
|
184
|
-
pair('
|
|
185
|
-
pair('
|
|
186
|
-
pair('
|
|
187
|
-
pair('
|
|
188
|
-
pair('
|
|
189
|
-
pair('
|
|
190
|
-
pair('
|
|
191
|
-
pair('
|
|
192
|
-
pair('
|
|
193
|
-
pair('
|
|
194
|
-
pair('
|
|
195
|
-
pair('
|
|
196
|
-
pair('
|
|
197
|
-
pair('
|
|
198
|
-
pair('
|
|
199
|
-
pair('
|
|
200
|
-
pair('
|
|
201
|
-
pair('
|
|
202
|
-
pair('
|
|
197
|
+
pair(t('textOnMain'), '--color-text', ['--color-bg'], TEXT),
|
|
198
|
+
pair(t('textOnSideSelected'), '--color-text', ['--color-bg-side', '--color-fill-2'], TEXT),
|
|
199
|
+
pair(t('secondaryOnMain'), '--color-text-2', ['--color-bg'], TEXT),
|
|
200
|
+
pair(t('secondaryOnSide'), '--color-text-2', ['--color-bg-side'], TEXT),
|
|
201
|
+
pair(t('mutedOnMain'), '--color-text-3', ['--color-bg'], TEXT),
|
|
202
|
+
pair(t('mutedOnSide'), '--color-text-3', ['--color-bg-side'], TEXT),
|
|
203
|
+
pair(t('mutedOnSideSelected'), '--color-text-3', ['--color-bg-side', '--color-fill-2'], TEXT),
|
|
204
|
+
pair(t('mutedOnMainSelected'), '--color-text-3', ['--color-bg', '--color-fill-2'], TEXT),
|
|
205
|
+
pair(t('mutedOnRaisedHighlight'), '--color-text-3', ['--color-surface-raised', '--color-fill-1'], TEXT),
|
|
206
|
+
pair(t('linkOnMain'), '--color-accent-text', ['--color-bg'], TEXT),
|
|
207
|
+
pair(t('accentText'), '--color-on-accent', ['--color-accent'], TEXT),
|
|
208
|
+
pair(t('accentHoverText'), '--color-on-accent', ['--color-accent-hover'], TEXT),
|
|
209
|
+
pair(t('dangerButtonText'), '--color-on-accent', ['--color-danger'], TEXT),
|
|
210
|
+
pair(t('dangerHoverText'), '--color-on-accent', ['--color-danger-hover'], TEXT),
|
|
211
|
+
pair(t('dangerOnMain'), '--color-danger-text', ['--color-bg'], TEXT),
|
|
212
|
+
pair(t('warningOnMain'), '--color-warning-text', ['--color-bg'], TEXT),
|
|
213
|
+
pair(t('successOnMain'), '--color-success-text', ['--color-bg'], TEXT),
|
|
214
|
+
pair(t('dangerOnMainTint'), '--color-danger-text', ['--color-bg', '--color-danger-subtle'], TEXT),
|
|
215
|
+
pair(t('dangerOnSideTint'), '--color-danger-text', ['--color-bg-side', '--color-danger-subtle'], TEXT),
|
|
216
|
+
pair(t('warningOnMainTint'), '--color-warning-text', ['--color-bg', '--color-warning-subtle'], TEXT),
|
|
217
|
+
pair(t('warningOnSideTint'), '--color-warning-text', ['--color-bg-side', '--color-warning-subtle'], TEXT),
|
|
218
|
+
pair(t('successOnMainTint'), '--color-success-text', ['--color-bg', '--color-success-subtle'], TEXT),
|
|
219
|
+
pair(t('successOnSideTint'), '--color-success-text', ['--color-bg-side', '--color-success-subtle'], TEXT),
|
|
220
|
+
pair(t('secondaryOnRail'), '--color-text-2', ['--color-bg-rail'], TEXT),
|
|
203
221
|
...SYNTAX_PAIRS,
|
|
204
|
-
pair('
|
|
205
|
-
pair('
|
|
206
|
-
pair('
|
|
207
|
-
pair('
|
|
208
|
-
pair('
|
|
222
|
+
pair(t('focusOnMain'), '--color-focus', ['--color-bg'], NON_TEXT),
|
|
223
|
+
pair(t('focusOnSide'), '--color-focus', ['--color-bg-side'], NON_TEXT),
|
|
224
|
+
pair(t('controlOnMain'), '--color-border-control', ['--color-bg'], NON_TEXT),
|
|
225
|
+
pair(t('controlOnSide'), '--color-border-control', ['--color-bg-side'], NON_TEXT),
|
|
226
|
+
pair(t('controlOnRaised'), '--color-border-control', ['--color-surface-raised'], NON_TEXT),
|
|
209
227
|
...CHART_PAIRS,
|
|
210
|
-
pair('
|
|
211
|
-
pair('
|
|
212
|
-
pair('
|
|
213
|
-
pair('
|
|
214
|
-
pair('
|
|
215
|
-
pair('
|
|
228
|
+
pair(t('iconOnRailCurrent'), '--color-text-2', ['--color-bg-rail', '--color-fill-2'], NON_TEXT),
|
|
229
|
+
pair(t('markOnMain'), '--color-mark', ['--color-bg'], NON_TEXT),
|
|
230
|
+
pair(t('markOnSide'), '--color-mark', ['--color-bg-side'], NON_TEXT),
|
|
231
|
+
pair(t('markOnRail'), '--color-mark', ['--color-bg-rail'], NON_TEXT),
|
|
232
|
+
pair(t('markOnSideSelected'), '--color-mark', ['--color-bg-side', '--color-fill-2'], NON_TEXT),
|
|
233
|
+
pair(t('markOnRailCurrent'), '--color-mark', ['--color-bg-rail', '--color-fill-2'], NON_TEXT),
|
|
216
234
|
];
|
|
217
235
|
/** 按 WCAG 2 的对比度公式检查主题,列出不达标的组合;没有不达标的回空数组 */
|
|
218
236
|
export function themeContrastIssues(theme) {
|