@svadmin/core 0.81.0 → 0.82.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/package.json +5 -1
- package/src/color-scale.ts +90 -0
- package/src/copy-format.ts +216 -0
- package/src/i18n.svelte.ts +55 -56
- package/src/index.ts +19 -2
- package/src/theme-dtcg.ts +2 -0
- package/src/theme.svelte.ts +30 -1
- package/src/toast.svelte.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svadmin/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.0",
|
|
4
4
|
"author": "zuohuadong",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,6 +39,10 @@
|
|
|
39
39
|
"types": "./src/date-time.ts",
|
|
40
40
|
"default": "./src/date-time.ts"
|
|
41
41
|
},
|
|
42
|
+
"./copy-format": {
|
|
43
|
+
"types": "./src/copy-format.ts",
|
|
44
|
+
"default": "./src/copy-format.ts"
|
|
45
|
+
},
|
|
42
46
|
"./pivot": {
|
|
43
47
|
"types": "./src/pivot.ts",
|
|
44
48
|
"default": "./src/pivot.ts"
|
package/src/color-scale.ts
CHANGED
|
@@ -216,6 +216,88 @@ function contrastAdjusted(
|
|
|
216
216
|
return { value: formatOklch(current, chroma, hue), hex };
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
/** Lightness step used by `generateColorScale` (step 1 → 10). */
|
|
220
|
+
const SCALE_LIGHTNESS_STEP = (0.975 - 0.26) / 9;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Official Arco hover (5) / pressed (7) / disabled fill (3) for the written
|
|
224
|
+
* product bases. `#165DFF` is the CSS default and must not be regenerated.
|
|
225
|
+
* Dark values are the compiled `body[arco-theme=dark]` channels from
|
|
226
|
+
* `@arco-design/web-react` 2.66.1, not the light scale reversed by hand.
|
|
227
|
+
*/
|
|
228
|
+
const OFFICIAL_INTERACTION_RAMPS: Record<string, { hover: string; pressed: string; disabled: string }> = {
|
|
229
|
+
'#165DFF': { hover: '#4080FF', pressed: '#0E42D2', disabled: '#94BFFF' },
|
|
230
|
+
'#3C7EFF': { hover: '#306FFF', pressed: '#689FFF', disabled: '#0E32A6' },
|
|
231
|
+
'#00B42A': { hover: '#23C343', pressed: '#009A29', disabled: '#7BE188' },
|
|
232
|
+
'#27C346': { hover: '#1DB440', pressed: '#50D266', disabled: '#0A802D' },
|
|
233
|
+
'#FF7D00': { hover: '#FF9A2E', pressed: '#D25F00', disabled: '#FFCF8B' },
|
|
234
|
+
'#FF9626': { hover: '#FF8D1F', pressed: '#FFB357', disabled: '#A64B0A' },
|
|
235
|
+
'#F53F3F': { hover: '#F76560', pressed: '#CB272D', disabled: '#FBACA3' },
|
|
236
|
+
'#F76965': { hover: '#F54E4E', pressed: '#F98D86', disabled: '#A1161F' },
|
|
237
|
+
'#3491FA': { hover: '#57A9FB', pressed: '#206CCF', disabled: '#9FD4FD' },
|
|
238
|
+
'#5AAAFB': { hover: '#469AFA', pressed: '#7DC1FC', disabled: '#134CA3' },
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export interface InteractionRamps {
|
|
242
|
+
/** color-5, hover. */
|
|
243
|
+
hover: string;
|
|
244
|
+
/** color-7, pressed. */
|
|
245
|
+
pressed: string;
|
|
246
|
+
/** color-3, general disabled fill. */
|
|
247
|
+
disabled: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function normalizeHexColor(color: string): string | undefined {
|
|
251
|
+
const trimmed = color.trim();
|
|
252
|
+
if (!HEX_PATTERN.test(trimmed)) return undefined;
|
|
253
|
+
let body = trimmed.slice(1);
|
|
254
|
+
if (body.length === 3) body = body.split('').map((digit) => digit + digit).join('');
|
|
255
|
+
return `#${body.toUpperCase()}`;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function parseOklchColor(color: string): { l: number; c: number; h: number } | undefined {
|
|
259
|
+
const match = /^oklch\(\s*([\d.]+)\s+([\d.]+)\s+([\d.]+)/i.exec(color.trim());
|
|
260
|
+
if (!match) return undefined;
|
|
261
|
+
return { l: Number(match[1]), c: Number(match[2]), h: Number(match[3]) };
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Hover / pressed / disabled fills for one brand color.
|
|
266
|
+
* Known Arco bases return the official hex. Every other color shifts lightness
|
|
267
|
+
* by the existing OKLCH scale step so imported themes stay on the same ramp.
|
|
268
|
+
*/
|
|
269
|
+
export function interactionRamps(color: string): InteractionRamps {
|
|
270
|
+
const official = normalizeHexColor(color);
|
|
271
|
+
if (official && OFFICIAL_INTERACTION_RAMPS[official]) return OFFICIAL_INTERACTION_RAMPS[official];
|
|
272
|
+
const parsed = official ? hexToOklch(official) : parseOklchColor(color);
|
|
273
|
+
if (!parsed) throw new TypeError(`Cannot derive interaction ramps from: ${String(color)}`);
|
|
274
|
+
const { l, c, h } = parsed;
|
|
275
|
+
return {
|
|
276
|
+
hover: formatOklch(clamp01(l + SCALE_LIGHTNESS_STEP), c, h),
|
|
277
|
+
pressed: formatOklch(clamp01(l - SCALE_LIGHTNESS_STEP), c, h),
|
|
278
|
+
disabled: formatOklch(clamp01(l + SCALE_LIGHTNESS_STEP * 3), c, h),
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/** Add primary 3/5/7 when a preset did not already declare them. */
|
|
283
|
+
export function withPrimaryInteractionRamps(variables: Record<string, string>): Record<string, string> {
|
|
284
|
+
const primary = variables['--primary'];
|
|
285
|
+
if (!primary || variables['--primary-5'] || variables['--primary-7'] || variables['--primary-3']) {
|
|
286
|
+
return variables;
|
|
287
|
+
}
|
|
288
|
+
try {
|
|
289
|
+
const ramps = interactionRamps(primary);
|
|
290
|
+
return {
|
|
291
|
+
...variables,
|
|
292
|
+
'--primary-5': ramps.hover,
|
|
293
|
+
'--primary-7': ramps.pressed,
|
|
294
|
+
'--primary-3': ramps.disabled,
|
|
295
|
+
};
|
|
296
|
+
} catch {
|
|
297
|
+
return variables;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
219
301
|
function chartPalette(
|
|
220
302
|
scale: ColorScaleStep[],
|
|
221
303
|
hue: number,
|
|
@@ -246,6 +328,8 @@ export function deriveColorPreset(input: { name: string; label?: string; color:
|
|
|
246
328
|
const darkForeground = '#111111';
|
|
247
329
|
const lightPrimary = contrastAdjusted(source.l, source.c, source.h, '#FFFFFF', 4.5);
|
|
248
330
|
const darkPrimary = contrastAdjusted(Math.min(0.82, source.l + 0.12), source.c, source.h, '#111111', 4.5);
|
|
331
|
+
const lightRamps = interactionRamps(lightPrimary.value);
|
|
332
|
+
const darkRamps = interactionRamps(darkPrimary.value);
|
|
249
333
|
|
|
250
334
|
return {
|
|
251
335
|
name,
|
|
@@ -254,6 +338,9 @@ export function deriveColorPreset(input: { name: string; label?: string; color:
|
|
|
254
338
|
light: {
|
|
255
339
|
'--primary': lightPrimary.value,
|
|
256
340
|
'--primary-foreground': lightForeground,
|
|
341
|
+
'--primary-5': lightRamps.hover,
|
|
342
|
+
'--primary-7': lightRamps.pressed,
|
|
343
|
+
'--primary-3': lightRamps.disabled,
|
|
257
344
|
'--ring': lightPrimary.value,
|
|
258
345
|
'--sidebar-primary': lightPrimary.value,
|
|
259
346
|
'--sidebar-primary-foreground': lightForeground,
|
|
@@ -263,6 +350,9 @@ export function deriveColorPreset(input: { name: string; label?: string; color:
|
|
|
263
350
|
dark: {
|
|
264
351
|
'--primary': darkPrimary.value,
|
|
265
352
|
'--primary-foreground': darkForeground,
|
|
353
|
+
'--primary-5': darkRamps.hover,
|
|
354
|
+
'--primary-7': darkRamps.pressed,
|
|
355
|
+
'--primary-3': darkRamps.disabled,
|
|
266
356
|
'--ring': scale[4]?.value as string,
|
|
267
357
|
'--sidebar-primary': darkPrimary.value,
|
|
268
358
|
'--sidebar-primary-foreground': darkForeground,
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 文案格式层,对齐 Arco 文案规范里已经有宿主可用的几条:
|
|
3
|
+
* 24 小时制、超过四位整数才千分位、中西文之间留空格、省略号用「…」。
|
|
4
|
+
* 不是一套新的 i18n 框架。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface AdminTimeOptions {
|
|
8
|
+
/** 需要日期时传入。不要和 `month` / `day` 同时用。 */
|
|
9
|
+
dateStyle?: Intl.DateTimeFormatOptions['dateStyle'];
|
|
10
|
+
/** 默认包含秒。只要时分时传 false。 */
|
|
11
|
+
seconds?: boolean;
|
|
12
|
+
locale?: string;
|
|
13
|
+
timeZone?: string;
|
|
14
|
+
year?: Intl.DateTimeFormatOptions['year'];
|
|
15
|
+
month?: Intl.DateTimeFormatOptions['month'];
|
|
16
|
+
day?: Intl.DateTimeFormatOptions['day'];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** 24 小时制。`hourCycle: 'h23'` 避免 en-US 默认的 12 小时。 */
|
|
20
|
+
export function formatAdminTime(value: Date | number | string, options: AdminTimeOptions = {}): string {
|
|
21
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
22
|
+
if (Number.isNaN(date.getTime())) return '';
|
|
23
|
+
// dateStyle 不能再和 hour/minute 字段同时出现,否则 Intl 会抛错。
|
|
24
|
+
if (options.dateStyle) {
|
|
25
|
+
return new Intl.DateTimeFormat(options.locale, {
|
|
26
|
+
dateStyle: options.dateStyle,
|
|
27
|
+
timeStyle: options.seconds === false ? 'short' : 'medium',
|
|
28
|
+
hourCycle: 'h23',
|
|
29
|
+
...(options.timeZone ? { timeZone: options.timeZone } : {}),
|
|
30
|
+
}).format(date);
|
|
31
|
+
}
|
|
32
|
+
const fields: Intl.DateTimeFormatOptions = {
|
|
33
|
+
hour: '2-digit',
|
|
34
|
+
minute: '2-digit',
|
|
35
|
+
hourCycle: 'h23',
|
|
36
|
+
};
|
|
37
|
+
if (options.seconds !== false) fields.second = '2-digit';
|
|
38
|
+
if (options.year) fields.year = options.year;
|
|
39
|
+
if (options.month) fields.month = options.month;
|
|
40
|
+
if (options.day) fields.day = options.day;
|
|
41
|
+
if (options.timeZone) fields.timeZone = options.timeZone;
|
|
42
|
+
return new Intl.DateTimeFormat(options.locale, fields).format(date);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface AdminNumberOptions {
|
|
46
|
+
/**
|
|
47
|
+
* 省略时用 zh-CN。
|
|
48
|
+
* 传 `null` 表示沿用运行时默认语言,用来替换原来的 `toLocaleString()`。
|
|
49
|
+
*/
|
|
50
|
+
locale?: string | null;
|
|
51
|
+
minimumFractionDigits?: number;
|
|
52
|
+
maximumFractionDigits?: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 超过四位的整数必须千分位。四位及以内沿用当前 locale 的分节,
|
|
57
|
+
* 不把 en-US 的 9,999 或 de-DE 的 1.234,5 改成不分节。小数部分不分节。
|
|
58
|
+
*/
|
|
59
|
+
export function formatAdminNumber(
|
|
60
|
+
value: number,
|
|
61
|
+
localeOrOptions: string | AdminNumberOptions = 'zh-CN',
|
|
62
|
+
): string {
|
|
63
|
+
if (!Number.isFinite(value)) return '';
|
|
64
|
+
const options: AdminNumberOptions = typeof localeOrOptions === 'string'
|
|
65
|
+
? { locale: localeOrOptions }
|
|
66
|
+
: localeOrOptions;
|
|
67
|
+
const locale = options.locale === null ? undefined : (options.locale ?? 'zh-CN');
|
|
68
|
+
const minimumFractionDigits = options.minimumFractionDigits ?? 0;
|
|
69
|
+
const maximumFractionDigits = options.maximumFractionDigits ?? 20;
|
|
70
|
+
if (minimumFractionDigits > maximumFractionDigits) return '';
|
|
71
|
+
return new Intl.NumberFormat(locale, {
|
|
72
|
+
useGrouping: true,
|
|
73
|
+
minimumFractionDigits,
|
|
74
|
+
maximumFractionDigits,
|
|
75
|
+
}).format(value);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const CJK_CHAR = /[\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]/;
|
|
79
|
+
|
|
80
|
+
/** 「7号线」以及「3D」「HTML5」这类型号不表数量,两侧都不插空格。 */
|
|
81
|
+
function isNonQuantityToken(token: string, nextChar: string): boolean {
|
|
82
|
+
if (/^\d+$/.test(token) && nextChar === '号') return true;
|
|
83
|
+
return /[A-Za-z]/.test(token) && /\d/.test(token);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 在汉字与拉丁字母或数字之间插入一个空格。
|
|
88
|
+
* 不处理全角标点。「7号线」「3D打印」这类不表数量的数字保持紧挨。
|
|
89
|
+
*/
|
|
90
|
+
export function spaceCjkLatin(text: string): string {
|
|
91
|
+
const parts = text.split(/([A-Za-z0-9]+)/);
|
|
92
|
+
let out = '';
|
|
93
|
+
for (let index = 0; index < parts.length; index += 1) {
|
|
94
|
+
const part = parts[index] ?? '';
|
|
95
|
+
if (index % 2 === 0) {
|
|
96
|
+
out += part;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const prev = parts[index - 1] ?? '';
|
|
100
|
+
const next = parts[index + 1] ?? '';
|
|
101
|
+
const nonQuantity = isNonQuantityToken(part, next.slice(0, 1));
|
|
102
|
+
if (!nonQuantity && CJK_CHAR.test(prev.slice(-1)) && !prev.endsWith(' ')) out += ' ';
|
|
103
|
+
out += part;
|
|
104
|
+
if (!nonQuantity && CJK_CHAR.test(next.slice(0, 1)) && !next.startsWith(' ')) out += ' ';
|
|
105
|
+
}
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** 连续三个及以上的半角句点换成省略号。小数点和代码里的单点不动。 */
|
|
110
|
+
export function formatAdminEllipsis(text: string): string {
|
|
111
|
+
return text.replace(/\.{3,}/g, '…');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** 共享展示字符串先换省略号,再补中西文空格。不改写用词。 */
|
|
115
|
+
export function formatAdminCopy(text: string): string {
|
|
116
|
+
return spaceCjkLatin(formatAdminEllipsis(text));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface AdminCurrencyOptions extends AdminNumberOptions {
|
|
120
|
+
/** 默认 CNY。 */
|
|
121
|
+
currency?: string;
|
|
122
|
+
notation?: 'standard' | 'compact';
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* 货币符号后面不加空格。小数分隔仍由 locale 决定。
|
|
127
|
+
* 结尾货币符号(如 `€`)前面的空格保留,那是符号前的间距。
|
|
128
|
+
*/
|
|
129
|
+
export function formatAdminCurrency(
|
|
130
|
+
value: number,
|
|
131
|
+
localeOrOptions: string | AdminCurrencyOptions = 'zh-CN',
|
|
132
|
+
): string {
|
|
133
|
+
if (!Number.isFinite(value)) return '';
|
|
134
|
+
const options: AdminCurrencyOptions = typeof localeOrOptions === 'string'
|
|
135
|
+
? { locale: localeOrOptions }
|
|
136
|
+
: localeOrOptions;
|
|
137
|
+
const locale = options.locale === null ? undefined : (options.locale ?? 'zh-CN');
|
|
138
|
+
const currency = options.currency ?? 'CNY';
|
|
139
|
+
try {
|
|
140
|
+
const formatted = new Intl.NumberFormat(locale, {
|
|
141
|
+
style: 'currency',
|
|
142
|
+
currency,
|
|
143
|
+
useGrouping: true,
|
|
144
|
+
...(options.minimumFractionDigits !== undefined ? { minimumFractionDigits: options.minimumFractionDigits } : {}),
|
|
145
|
+
...(options.maximumFractionDigits !== undefined ? { maximumFractionDigits: options.maximumFractionDigits } : {}),
|
|
146
|
+
...(options.notation === 'compact' ? { notation: 'compact', compactDisplay: 'short' } : {}),
|
|
147
|
+
}).format(value);
|
|
148
|
+
return formatted.replace(/^(\p{Sc})\s+/u, '$1');
|
|
149
|
+
} catch {
|
|
150
|
+
return '';
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface AdminPercentOptions extends AdminNumberOptions {
|
|
155
|
+
/** `ratio` 把 0.12 格式化成 12%。`points` 把 12 格式化成 12%。 */
|
|
156
|
+
scale?: 'ratio' | 'points';
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** 百分号前面不加空格。 */
|
|
160
|
+
export function formatAdminPercent(
|
|
161
|
+
value: number,
|
|
162
|
+
localeOrOptions: string | AdminPercentOptions = 'zh-CN',
|
|
163
|
+
): string {
|
|
164
|
+
if (!Number.isFinite(value)) return '';
|
|
165
|
+
const options: AdminPercentOptions = typeof localeOrOptions === 'string'
|
|
166
|
+
? { locale: localeOrOptions }
|
|
167
|
+
: localeOrOptions;
|
|
168
|
+
const locale = options.locale === null ? undefined : (options.locale ?? 'zh-CN');
|
|
169
|
+
const maximumFractionDigits = options.maximumFractionDigits ?? (options.scale === 'points' ? 20 : 0);
|
|
170
|
+
const minimumFractionDigits = options.minimumFractionDigits ?? 0;
|
|
171
|
+
if (options.scale === 'points') {
|
|
172
|
+
const numberLocale: string | null = options.locale === null ? null : locale ?? 'zh-CN';
|
|
173
|
+
const amount = formatAdminNumber(value, {
|
|
174
|
+
locale: numberLocale,
|
|
175
|
+
minimumFractionDigits,
|
|
176
|
+
maximumFractionDigits,
|
|
177
|
+
});
|
|
178
|
+
return `${amount}%`;
|
|
179
|
+
}
|
|
180
|
+
const formatted = new Intl.NumberFormat(locale, {
|
|
181
|
+
style: 'percent',
|
|
182
|
+
useGrouping: true,
|
|
183
|
+
minimumFractionDigits,
|
|
184
|
+
maximumFractionDigits,
|
|
185
|
+
}).format(value);
|
|
186
|
+
return formatted.replace(/\s+(?=%)/g, '');
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface AdminDateOptions {
|
|
190
|
+
locale?: string;
|
|
191
|
+
timeZone?: string;
|
|
192
|
+
dateStyle?: Intl.DateTimeFormatOptions['dateStyle'];
|
|
193
|
+
weekday?: Intl.DateTimeFormatOptions['weekday'];
|
|
194
|
+
year?: Intl.DateTimeFormatOptions['year'];
|
|
195
|
+
month?: Intl.DateTimeFormatOptions['month'];
|
|
196
|
+
day?: Intl.DateTimeFormatOptions['day'];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** 只输出日期,不带时间。和 `formatAdminTime` 的日期加时间分开。 */
|
|
200
|
+
export function formatAdminDate(value: Date | number | string, options: AdminDateOptions = {}): string {
|
|
201
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
202
|
+
if (Number.isNaN(date.getTime())) return '';
|
|
203
|
+
const fields: Intl.DateTimeFormatOptions = {};
|
|
204
|
+
if (options.dateStyle && !options.weekday && !options.year && !options.month && !options.day) {
|
|
205
|
+
fields.dateStyle = options.dateStyle;
|
|
206
|
+
} else if (options.weekday || options.year || options.month || options.day) {
|
|
207
|
+
if (options.weekday) fields.weekday = options.weekday;
|
|
208
|
+
if (options.year) fields.year = options.year;
|
|
209
|
+
if (options.month) fields.month = options.month;
|
|
210
|
+
if (options.day) fields.day = options.day;
|
|
211
|
+
} else {
|
|
212
|
+
fields.dateStyle = options.dateStyle ?? 'medium';
|
|
213
|
+
}
|
|
214
|
+
if (options.timeZone) fields.timeZone = options.timeZone;
|
|
215
|
+
return new Intl.DateTimeFormat(options.locale, fields).format(date);
|
|
216
|
+
}
|
package/src/i18n.svelte.ts
CHANGED
|
@@ -32,7 +32,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
32
32
|
'common.refresh': '刷新',
|
|
33
33
|
'common.importData': '导入数据',
|
|
34
34
|
'common.upload': '上传',
|
|
35
|
-
'common.processing': '
|
|
35
|
+
'common.processing': '处理中…',
|
|
36
36
|
'common.returnHome': '返回首页',
|
|
37
37
|
'common.lockScreen': '锁定屏幕',
|
|
38
38
|
'common.unlock': '解锁',
|
|
@@ -217,12 +217,12 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
217
217
|
'common.clearAllFilters': '清除全部',
|
|
218
218
|
'common.pageUnit': '页',
|
|
219
219
|
'common.all': '全部',
|
|
220
|
-
'common.search': '
|
|
220
|
+
'common.search': '搜索…',
|
|
221
221
|
'select.loadFailed': '无法加载选项。',
|
|
222
222
|
'select.noResults': '无匹配结果。',
|
|
223
223
|
'select.loadMore': '加载更多',
|
|
224
224
|
'common.confirm': '确定',
|
|
225
|
-
'common.loading': '
|
|
225
|
+
'common.loading': '加载中…',
|
|
226
226
|
'common.noData': '暂无数据',
|
|
227
227
|
'common.noDataHint': '暂无数据,请创建第一条记录。',
|
|
228
228
|
'common.actions': '操作',
|
|
@@ -231,7 +231,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
231
231
|
'common.export': '导出',
|
|
232
232
|
'common.download': '下载',
|
|
233
233
|
'common.preview': '预览',
|
|
234
|
-
'common.remove': '移除',
|
|
234
|
+
'common.remove': '移除', 'common.removeFilter': '移除筛选', 'common.deletePreset': '删除当前预设', 'common.pollInterval': '刷新频率',
|
|
235
235
|
'common.file': '文件',
|
|
236
236
|
'common.import': '导入',
|
|
237
237
|
'common.chooseFile': '选择文件',
|
|
@@ -247,7 +247,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
247
247
|
'common.records': '条记录',
|
|
248
248
|
'common.ignoreColumn': '忽略',
|
|
249
249
|
'common.startImport': '开始导入',
|
|
250
|
-
'common.importing': '
|
|
250
|
+
'common.importing': '导入中…',
|
|
251
251
|
'common.completed': '已完成',
|
|
252
252
|
'common.succeeded': '成功',
|
|
253
253
|
'common.failed': '失败',
|
|
@@ -260,7 +260,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
260
260
|
'common.startDate': '开始日期',
|
|
261
261
|
'common.endDate': '结束日期',
|
|
262
262
|
'common.clone': '克隆',
|
|
263
|
-
'common.autoSaving': '
|
|
263
|
+
'common.autoSaving': '自动保存中…',
|
|
264
264
|
'common.autoSaved': '已自动保存',
|
|
265
265
|
'common.selectAll': '全选',
|
|
266
266
|
'common.selectAllOnPage': '全选当前页',
|
|
@@ -280,6 +280,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
280
280
|
'common.confirmAction': '确认操作',
|
|
281
281
|
'common.operationSuccess': '操作成功',
|
|
282
282
|
'common.operationFailed': '操作失败',
|
|
283
|
+
'common.submitRejected': '提交没有完成,服务没有接受这次操作。',
|
|
283
284
|
'common.permissionDenied': '无权执行此操作',
|
|
284
285
|
'common.permissionUnavailable': '权限校验暂不可用,请重试。',
|
|
285
286
|
'common.test': '测试',
|
|
@@ -306,7 +307,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
306
307
|
'detailWorkspace.audit': '审计',
|
|
307
308
|
'detailWorkspace.versions': '版本差异',
|
|
308
309
|
'detailWorkspace.unavailable': '未配置数据源',
|
|
309
|
-
'detailWorkspace.loading': '
|
|
310
|
+
'detailWorkspace.loading': '正在加载…',
|
|
310
311
|
'common.show': '查看',
|
|
311
312
|
'common.loadFailed': '加载失败: {message}',
|
|
312
313
|
'common.pageNotFound': '页面未找到',
|
|
@@ -322,7 +323,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
322
323
|
'common.welcome': '欢迎使用 {title}',
|
|
323
324
|
'common.dashboardHint': '从侧边栏选择一个资源开始。',
|
|
324
325
|
'common.dashboard': '工作台',
|
|
325
|
-
'common.redirecting': '
|
|
326
|
+
'common.redirecting': '正在跳转到登录页…',
|
|
326
327
|
'common.expand': '展开',
|
|
327
328
|
'common.collapse': '收起',
|
|
328
329
|
'common.fullscreen': '全屏模式',
|
|
@@ -370,7 +371,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
370
371
|
// Field
|
|
371
372
|
'field.enterValue': '输入{label}',
|
|
372
373
|
'field.selectPlaceholder': '请选择',
|
|
373
|
-
'field.tagsPlaceholder': '
|
|
374
|
+
'field.tagsPlaceholder': '输入标签后按回车…',
|
|
374
375
|
'field.noOptions': '无可用选项',
|
|
375
376
|
'field.addImage': '添加图片',
|
|
376
377
|
// Config errors
|
|
@@ -399,9 +400,9 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
399
400
|
'auth.noAccount': '还没有账号?',
|
|
400
401
|
'auth.hasAccount': '已有账号?',
|
|
401
402
|
'auth.forgotPasswordLink': '忘记密码?',
|
|
402
|
-
'auth.forgotPasswordDescription': '
|
|
403
|
+
'auth.forgotPasswordDescription': '输入邮箱地址,用于接收重置密码的链接。',
|
|
403
404
|
'auth.resetPasswordDescription': '设置一个新的登录密码。',
|
|
404
|
-
'auth.resetLinkSent': '
|
|
405
|
+
'auth.resetLinkSent': '重置链接已发送,请查看邮箱。',
|
|
405
406
|
'auth.resetLinkSentTitle': '重置链接已发送',
|
|
406
407
|
'auth.resetLinkSentDescription': '如果该账号存在,请按照邮件中的步骤重置密码。',
|
|
407
408
|
'auth.passwordMismatch': '两次输入的密码不一致',
|
|
@@ -411,10 +412,10 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
411
412
|
'auth.welcomeBack': '欢迎回来',
|
|
412
413
|
'auth.welcomeMessage': '登录以继续使用管理后台',
|
|
413
414
|
'auth.createAccount': '创建账号',
|
|
414
|
-
'auth.createAccountMessage': '
|
|
415
|
+
'auth.createAccountMessage': '填写信息以创建账号',
|
|
415
416
|
// AutoSave
|
|
416
417
|
'autoSave.idle': '已保存',
|
|
417
|
-
'autoSave.saving': '
|
|
418
|
+
'autoSave.saving': '保存中…',
|
|
418
419
|
'autoSave.saved': '已保存',
|
|
419
420
|
'autoSave.error': '保存失败',
|
|
420
421
|
// Empty states
|
|
@@ -458,7 +459,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
458
459
|
'settings.api': 'API 设置',
|
|
459
460
|
'settings.developer': '开发者',
|
|
460
461
|
'settings.workspace': '工作区',
|
|
461
|
-
'settings.securityDescription': '
|
|
462
|
+
'settings.securityDescription': '管理密码、活跃会话和双重身份验证。',
|
|
462
463
|
'settings.integrationsDescription': '连接和管理工作区的第三方服务扩展。',
|
|
463
464
|
'settings.notificationsDescription': '配置系统警报的接收方式和时机。',
|
|
464
465
|
'settings.apiDescription': '生成并管理安全 API 密钥,以便集成外部程序脚本。',
|
|
@@ -470,7 +471,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
470
471
|
'security.twoFactorUnknown': '暂时无法确认双重身份验证状态。',
|
|
471
472
|
'security.passwordLastChanged': '上次修改:{time}',
|
|
472
473
|
'security.activeSessions': '活跃会话',
|
|
473
|
-
'security.sessionsDescription': '
|
|
474
|
+
'security.sessionsDescription': '以下是已登录此账户的设备。可以撤销不认识的设备。',
|
|
474
475
|
'security.revokeOthers': '注销其他所有设备',
|
|
475
476
|
'security.currentSession': '当前设备',
|
|
476
477
|
'security.revokeSession': '注销此设备',
|
|
@@ -488,7 +489,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
488
489
|
'integrations.webhooksDescription': '为内部工具和监控注册出站 Webhook。',
|
|
489
490
|
'integrations.addMoreHint': '需要自定义集成?请联系管理员注册新的应用程序。',
|
|
490
491
|
'notifications.emailTitle': '邮件通知',
|
|
491
|
-
'notifications.emailDescription': '
|
|
492
|
+
'notifications.emailDescription': '把系统通知发到电子邮箱。',
|
|
492
493
|
'notifications.securityAlerts': '安全警报',
|
|
493
494
|
'notifications.securityAlertsDesc': '在密码修改、新登录尝试或生成 API 密钥时收到通知。',
|
|
494
495
|
'notifications.activityLogs': '活动报告',
|
|
@@ -517,9 +518,9 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
517
518
|
'api.activeKeysTitle': '活跃 API 密钥',
|
|
518
519
|
'api.activeKeysDesc': '请妥善保管这些密钥。切勿在公共仓库中分享。',
|
|
519
520
|
'api.successTitle': 'API 密钥已生成',
|
|
520
|
-
'api.successHint': '
|
|
521
|
+
'api.successHint': '请立即复制此令牌。关闭后令牌只显示这一次。',
|
|
521
522
|
'api.noKeys': '尚未生成活跃的 API 密钥。',
|
|
522
|
-
'error.pageNotFoundDescription': '
|
|
523
|
+
'error.pageNotFoundDescription': '这个页面不存在,或已经被移除。',
|
|
523
524
|
'error.internalServerErrorDescription': '系统发生了一些问题,请稍后再试或联系支持人员。',
|
|
524
525
|
'settings.system': '系统',
|
|
525
526
|
'settings.themeMode': '主题模式',
|
|
@@ -559,7 +560,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
559
560
|
'settings.registeredResources': '已注册资源',
|
|
560
561
|
'settings.dataProvider': '数据源',
|
|
561
562
|
'settings.currentEnvironment': '当前环境',
|
|
562
|
-
'settings.settingsDescription': '
|
|
563
|
+
'settings.settingsDescription': '管理账户和界面偏好。',
|
|
563
564
|
'settings.rolesAndPermissions': '角色与权限',
|
|
564
565
|
'settings.roles': '角色',
|
|
565
566
|
'settings.rolesDescription': '管理系统访问控制与资源权限。',
|
|
@@ -573,7 +574,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
573
574
|
'settings.auditLogs': '操作日志',
|
|
574
575
|
'settings.auditDescription': '追踪和审查所有系统操作,用于合规与调试。',
|
|
575
576
|
'settings.auditNotSupported': '当前数据源不支持操作日志',
|
|
576
|
-
'settings.searchLogs': '
|
|
577
|
+
'settings.searchLogs': '搜索用户、操作或资源…',
|
|
577
578
|
'settings.auditTime': '时间',
|
|
578
579
|
'settings.auditUser': '操作人',
|
|
579
580
|
'settings.auditAction': '操作',
|
|
@@ -608,7 +609,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
608
609
|
'editor.clearFormat': '清除格式',
|
|
609
610
|
'editor.undo': '撤销',
|
|
610
611
|
'editor.redo': '重做',
|
|
611
|
-
'editor.startWriting': '
|
|
612
|
+
'editor.startWriting': '开始写作…',
|
|
612
613
|
'editor.typeSlash': '输入 / 唤出菜单',
|
|
613
614
|
// Editor - Popovers
|
|
614
615
|
'editor.link.url': '链接地址',
|
|
@@ -617,7 +618,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
617
618
|
'editor.link.remove': '移除链接',
|
|
618
619
|
'editor.image.url': '图片链接 (URL)',
|
|
619
620
|
'editor.image.upload': '点击或拖拽图片到此处上传',
|
|
620
|
-
'editor.image.uploading': '
|
|
621
|
+
'editor.image.uploading': '上传中…',
|
|
621
622
|
'editor.table.insertRowAbove': '在上方插入行',
|
|
622
623
|
'editor.table.insertRowBelow': '在下方插入行',
|
|
623
624
|
'editor.table.deleteRow': '删除行',
|
|
@@ -753,8 +754,8 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
753
754
|
'task.count': '{count} 个任务',
|
|
754
755
|
'task.activeCount': '{count} 个进行中',
|
|
755
756
|
'task.lastQueuedAt': '最近排队时间 {time}',
|
|
756
|
-
'task.loadingList': '
|
|
757
|
-
'task.loadingDetail': '
|
|
757
|
+
'task.loadingList': '正在加载任务…',
|
|
758
|
+
'task.loadingDetail': '正在加载任务详情…',
|
|
758
759
|
'task.noTasks': '暂无任务',
|
|
759
760
|
'task.noDlq': '暂无死信任务',
|
|
760
761
|
'task.listUnavailable': '当前任务服务未提供任务列表。',
|
|
@@ -774,7 +775,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
774
775
|
'task.errorLabel': '错误',
|
|
775
776
|
'task.payloadLabel': '负载',
|
|
776
777
|
'task.resultLabel': '结果',
|
|
777
|
-
'task.searchPlaceholder': '按名称、ID
|
|
778
|
+
'task.searchPlaceholder': '按名称、ID、状态或消息筛选任务…',
|
|
778
779
|
'task.statusFilterLabel': '状态筛选',
|
|
779
780
|
'task.statusAll': '全部状态',
|
|
780
781
|
'task.autoRefreshLabel': '自动刷新',
|
|
@@ -939,8 +940,8 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
939
940
|
// Profile grids
|
|
940
941
|
'publicProfile.projectsCount': '{count} 个项目',
|
|
941
942
|
'publicProfile.teamsCount': '{count} 个团队',
|
|
942
|
-
'publicProfile.searchProjects': '
|
|
943
|
-
'publicProfile.searchTeams': '
|
|
943
|
+
'publicProfile.searchProjects': '搜索项目…',
|
|
944
|
+
'publicProfile.searchTeams': '搜索团队…',
|
|
944
945
|
'publicProfile.autoRefresh': '自动刷新',
|
|
945
946
|
'publicProfile.join': '加入',
|
|
946
947
|
'publicProfile.rating': '评分',
|
|
@@ -991,15 +992,15 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
991
992
|
'org.selectDepartment': '选择部门',
|
|
992
993
|
'org.members': '部门成员',
|
|
993
994
|
'org.selectedMembers': '已选人员',
|
|
994
|
-
'org.searchMember': '
|
|
995
|
-
'org.searchDepartment': '
|
|
995
|
+
'org.searchMember': '搜索成员姓名或邮箱…',
|
|
996
|
+
'org.searchDepartment': '搜索部门…',
|
|
996
997
|
'org.selectAll': '全选本部门',
|
|
997
998
|
'org.clearAll': '清空已选',
|
|
998
999
|
'org.noMembers': '当前部门暂无成员',
|
|
999
1000
|
'org.selectedCount': '已选 {count} 人',
|
|
1000
1001
|
'org.source': '待选列表',
|
|
1001
1002
|
'org.target': '已选列表',
|
|
1002
|
-
'org.search': '
|
|
1003
|
+
'org.search': '搜索关键词…',
|
|
1003
1004
|
'org.empty': '暂无数据',
|
|
1004
1005
|
// Excel Suite
|
|
1005
1006
|
'excel.import': '数据导入向导',
|
|
@@ -1032,7 +1033,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1032
1033
|
'common.refresh': 'Refresh',
|
|
1033
1034
|
'common.importData': 'Import data',
|
|
1034
1035
|
'common.upload': 'Upload',
|
|
1035
|
-
'common.processing': 'Processing
|
|
1036
|
+
'common.processing': 'Processing…',
|
|
1036
1037
|
'common.returnHome': 'Return to Home',
|
|
1037
1038
|
'common.lockScreen': 'Lock Screen',
|
|
1038
1039
|
'common.unlock': 'Unlock',
|
|
@@ -1237,12 +1238,12 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1237
1238
|
'common.clearAllFilters': 'Clear all',
|
|
1238
1239
|
'common.pageUnit': 'Page',
|
|
1239
1240
|
'common.all': 'All',
|
|
1240
|
-
'common.search': 'Search
|
|
1241
|
+
'common.search': 'Search…',
|
|
1241
1242
|
'select.loadFailed': 'Unable to load options.',
|
|
1242
1243
|
'select.noResults': 'No results.',
|
|
1243
1244
|
'select.loadMore': 'Load more',
|
|
1244
1245
|
'common.confirm': 'Confirm',
|
|
1245
|
-
'common.loading': 'Loading
|
|
1246
|
+
'common.loading': 'Loading…',
|
|
1246
1247
|
'common.noData': 'No data',
|
|
1247
1248
|
'common.noDataHint': 'No data available, create your first record to get started.',
|
|
1248
1249
|
'common.actions': 'Actions',
|
|
@@ -1251,7 +1252,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1251
1252
|
'common.export': 'Export',
|
|
1252
1253
|
'common.download': 'Download',
|
|
1253
1254
|
'common.preview': 'Preview',
|
|
1254
|
-
'common.remove': 'Remove',
|
|
1255
|
+
'common.remove': 'Remove', 'common.removeFilter': 'Remove filter', 'common.deletePreset': 'Delete active preset', 'common.pollInterval': 'Poll interval',
|
|
1255
1256
|
'common.file': 'File',
|
|
1256
1257
|
'common.import': 'Import',
|
|
1257
1258
|
'common.chooseFile': 'Choose file',
|
|
@@ -1267,20 +1268,20 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1267
1268
|
'common.records': 'records',
|
|
1268
1269
|
'common.ignoreColumn': 'Ignore',
|
|
1269
1270
|
'common.startImport': 'Start import',
|
|
1270
|
-
'common.importing': 'Importing
|
|
1271
|
+
'common.importing': 'Importing…',
|
|
1271
1272
|
'common.completed': 'Completed',
|
|
1272
1273
|
'common.succeeded': 'Succeeded',
|
|
1273
1274
|
'common.failed': 'Failed',
|
|
1274
1275
|
'common.failedRowsHint': 'records failed to import.',
|
|
1275
1276
|
'common.downloadErrors': 'Download failed CSV',
|
|
1276
1277
|
'common.importAnother': 'Import another',
|
|
1277
|
-
'common.selectOption': 'Select an option
|
|
1278
|
+
'common.selectOption': 'Select an option…',
|
|
1278
1279
|
'common.yesTrue': 'Yes / True',
|
|
1279
1280
|
'common.noFalse': 'No / False',
|
|
1280
1281
|
'common.startDate': 'Start date',
|
|
1281
1282
|
'common.endDate': 'End date',
|
|
1282
1283
|
'common.clone': 'Clone',
|
|
1283
|
-
'common.autoSaving': 'Auto-saving
|
|
1284
|
+
'common.autoSaving': 'Auto-saving…',
|
|
1284
1285
|
'common.autoSaved': 'Saved',
|
|
1285
1286
|
'common.selectAll': 'Select All',
|
|
1286
1287
|
'common.selectAllOnPage': 'Select all on this page',
|
|
@@ -1300,6 +1301,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1300
1301
|
'common.confirmAction': 'Confirm Action',
|
|
1301
1302
|
'common.operationSuccess': 'Operation successful',
|
|
1302
1303
|
'common.operationFailed': 'Operation failed',
|
|
1304
|
+
'common.submitRejected': 'The submit did not finish because the service did not accept it.',
|
|
1303
1305
|
'common.permissionDenied': 'You do not have permission to perform this action',
|
|
1304
1306
|
'common.permissionUnavailable': 'Permission check is unavailable. Please retry.',
|
|
1305
1307
|
'common.test': 'Test',
|
|
@@ -1326,7 +1328,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1326
1328
|
'detailWorkspace.audit': 'Audit',
|
|
1327
1329
|
'detailWorkspace.versions': 'Version differences',
|
|
1328
1330
|
'detailWorkspace.unavailable': 'No data source configured',
|
|
1329
|
-
'detailWorkspace.loading': 'Loading
|
|
1331
|
+
'detailWorkspace.loading': 'Loading…',
|
|
1330
1332
|
'common.show': 'Show',
|
|
1331
1333
|
'common.loadFailed': 'Load failed: {message}',
|
|
1332
1334
|
'common.pageNotFound': 'Page not found',
|
|
@@ -1342,7 +1344,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1342
1344
|
'common.welcome': 'Welcome to {title}',
|
|
1343
1345
|
'common.dashboardHint': 'Select a resource from the sidebar to get started.',
|
|
1344
1346
|
'common.dashboard': 'Dashboard',
|
|
1345
|
-
'common.redirecting': 'Redirecting to login
|
|
1347
|
+
'common.redirecting': 'Redirecting to login…',
|
|
1346
1348
|
'common.expand': 'Expand',
|
|
1347
1349
|
'common.collapse': 'Collapse',
|
|
1348
1350
|
'common.fullscreen': 'Full Screen',
|
|
@@ -1389,8 +1391,8 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1389
1391
|
'common.skipToMainContent': 'Skip to main content',
|
|
1390
1392
|
// Field
|
|
1391
1393
|
'field.enterValue': 'Enter {label}',
|
|
1392
|
-
'field.selectPlaceholder': 'Select
|
|
1393
|
-
'field.tagsPlaceholder': 'Type a tag and press Enter
|
|
1394
|
+
'field.selectPlaceholder': 'Select…',
|
|
1395
|
+
'field.tagsPlaceholder': 'Type a tag and press Enter…',
|
|
1394
1396
|
'field.noOptions': 'No options available',
|
|
1395
1397
|
'field.addImage': 'Add image',
|
|
1396
1398
|
// Config errors
|
|
@@ -1434,7 +1436,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1434
1436
|
'auth.createAccountMessage': 'Fill in your details to create an account',
|
|
1435
1437
|
// AutoSave
|
|
1436
1438
|
'autoSave.idle': 'Saved',
|
|
1437
|
-
'autoSave.saving': 'Saving
|
|
1439
|
+
'autoSave.saving': 'Saving…',
|
|
1438
1440
|
'autoSave.saved': 'Saved',
|
|
1439
1441
|
'autoSave.error': 'Save failed',
|
|
1440
1442
|
// Empty states
|
|
@@ -1593,7 +1595,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1593
1595
|
'settings.auditLogs': 'Audit Logs',
|
|
1594
1596
|
'settings.auditDescription': 'Track and review all system operations for compliance and debugging.',
|
|
1595
1597
|
'settings.auditNotSupported': 'Audit logs are not supported by the current data provider',
|
|
1596
|
-
'settings.searchLogs': 'Search by user, action, or resource
|
|
1598
|
+
'settings.searchLogs': 'Search by user, action, or resource…',
|
|
1597
1599
|
'settings.auditTime': 'Time',
|
|
1598
1600
|
'settings.auditUser': 'User',
|
|
1599
1601
|
'settings.auditAction': 'Action',
|
|
@@ -1628,7 +1630,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1628
1630
|
'editor.clearFormat': 'Clear Formatting',
|
|
1629
1631
|
'editor.undo': 'Undo',
|
|
1630
1632
|
'editor.redo': 'Redo',
|
|
1631
|
-
'editor.startWriting': 'Start writing
|
|
1633
|
+
'editor.startWriting': 'Start writing…',
|
|
1632
1634
|
'editor.typeSlash': 'Type / for commands',
|
|
1633
1635
|
// Editor - Popovers
|
|
1634
1636
|
'editor.link.url': 'Link URL',
|
|
@@ -1637,7 +1639,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1637
1639
|
'editor.link.remove': 'Remove Link',
|
|
1638
1640
|
'editor.image.url': 'Image URL',
|
|
1639
1641
|
'editor.image.upload': 'Click or drag image here to upload',
|
|
1640
|
-
'editor.image.uploading': 'Uploading
|
|
1642
|
+
'editor.image.uploading': 'Uploading…',
|
|
1641
1643
|
'editor.table.insertRowAbove': 'Insert row above',
|
|
1642
1644
|
'editor.table.insertRowBelow': 'Insert row below',
|
|
1643
1645
|
'editor.table.deleteRow': 'Delete row',
|
|
@@ -1773,8 +1775,8 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1773
1775
|
'task.count': '{count} task(s)',
|
|
1774
1776
|
'task.activeCount': '{count} active',
|
|
1775
1777
|
'task.lastQueuedAt': 'Last queued at {time}',
|
|
1776
|
-
'task.loadingList': 'Loading tasks
|
|
1777
|
-
'task.loadingDetail': 'Loading task
|
|
1778
|
+
'task.loadingList': 'Loading tasks…',
|
|
1779
|
+
'task.loadingDetail': 'Loading task…',
|
|
1778
1780
|
'task.noTasks': 'No tasks found',
|
|
1779
1781
|
'task.noDlq': 'No dead-letter tasks',
|
|
1780
1782
|
'task.listUnavailable': 'The current task service does not provide a task list.',
|
|
@@ -1794,7 +1796,7 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1794
1796
|
'task.errorLabel': 'Error',
|
|
1795
1797
|
'task.payloadLabel': 'Payload',
|
|
1796
1798
|
'task.resultLabel': 'Result',
|
|
1797
|
-
'task.searchPlaceholder': 'Filter tasks by name, ID, status, or message
|
|
1799
|
+
'task.searchPlaceholder': 'Filter tasks by name, ID, status, or message…',
|
|
1798
1800
|
'task.statusFilterLabel': 'Status filter',
|
|
1799
1801
|
'task.statusAll': 'All statuses',
|
|
1800
1802
|
'task.autoRefreshLabel': 'Auto refresh',
|
|
@@ -1959,8 +1961,8 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
1959
1961
|
// Profile grids
|
|
1960
1962
|
'publicProfile.projectsCount': '{count} Projects',
|
|
1961
1963
|
'publicProfile.teamsCount': '{count} Teams',
|
|
1962
|
-
'publicProfile.searchProjects': 'Search projects
|
|
1963
|
-
'publicProfile.searchTeams': 'Search teams
|
|
1964
|
+
'publicProfile.searchProjects': 'Search projects…',
|
|
1965
|
+
'publicProfile.searchTeams': 'Search teams…',
|
|
1964
1966
|
'publicProfile.autoRefresh': 'Auto refresh',
|
|
1965
1967
|
'publicProfile.join': 'Join',
|
|
1966
1968
|
'publicProfile.rating': 'Rating',
|
|
@@ -2011,15 +2013,15 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
2011
2013
|
'org.selectDepartment': 'Select Department',
|
|
2012
2014
|
'org.members': 'Department Members',
|
|
2013
2015
|
'org.selectedMembers': 'Selected Members',
|
|
2014
|
-
'org.searchMember': 'Search member name or email
|
|
2015
|
-
'org.searchDepartment': 'Search department
|
|
2016
|
+
'org.searchMember': 'Search member name or email…',
|
|
2017
|
+
'org.searchDepartment': 'Search department…',
|
|
2016
2018
|
'org.selectAll': 'Select All In Dept',
|
|
2017
2019
|
'org.clearAll': 'Clear Selected',
|
|
2018
2020
|
'org.noMembers': 'No members in this department',
|
|
2019
2021
|
'org.selectedCount': '{count} selected',
|
|
2020
2022
|
'org.source': 'Source List',
|
|
2021
2023
|
'org.target': 'Target List',
|
|
2022
|
-
'org.search': 'Search keywords
|
|
2024
|
+
'org.search': 'Search keywords…',
|
|
2023
2025
|
'org.empty': 'No data',
|
|
2024
2026
|
// Excel Suite
|
|
2025
2027
|
'excel.import': 'Data Import Wizard',
|
|
@@ -2044,10 +2046,8 @@ const baseLocales: Record<string, Record<string, string>> = {
|
|
|
2044
2046
|
'pivot.totalRecords': '{count} records found',
|
|
2045
2047
|
},
|
|
2046
2048
|
};
|
|
2047
|
-
|
|
2048
2049
|
let locales = $state(structuredClone(baseLocales));
|
|
2049
2050
|
const initialLocales = structuredClone(baseLocales);
|
|
2050
|
-
|
|
2051
2051
|
/** Detect best locale from browser language; server rendering always starts in English. */
|
|
2052
2052
|
function detectLocale(): string {
|
|
2053
2053
|
// Node 22+ exposes a global navigator, so gate SSR on the browser window instead.
|
|
@@ -2063,7 +2063,6 @@ function detectLocale(): string {
|
|
|
2063
2063
|
}
|
|
2064
2064
|
|
|
2065
2065
|
let currentLocale = $state(detectLocale());
|
|
2066
|
-
|
|
2067
2066
|
/**
|
|
2068
2067
|
* I18nProvider — pluggable translation boundary.
|
|
2069
2068
|
* When set, all t/getLocale/getAvailableLocales delegates to it first,
|
package/src/index.ts
CHANGED
|
@@ -166,6 +166,23 @@ export { buildPivot, buildPivotCacheKey, buildPivotDrilldown, buildPivotExportRe
|
|
|
166
166
|
export type { PivotAggregation, PivotCache, PivotDimension, PivotDimensionValue, PivotOptions, PivotPayload, PivotProvider, PivotQuery, PivotResult, PivotDrilldown, PivotExportRequest, PivotExportTaskResult } from './pivot';
|
|
167
167
|
export { civilDateTimeToInstant, parseDateTimeInstant, formatCivilDateTime } from './date-time';
|
|
168
168
|
export type { DateTimeValueMode, DateTimeDisambiguation } from './date-time';
|
|
169
|
+
export {
|
|
170
|
+
formatAdminCopy,
|
|
171
|
+
formatAdminCurrency,
|
|
172
|
+
formatAdminDate,
|
|
173
|
+
formatAdminEllipsis,
|
|
174
|
+
formatAdminNumber,
|
|
175
|
+
formatAdminPercent,
|
|
176
|
+
formatAdminTime,
|
|
177
|
+
spaceCjkLatin,
|
|
178
|
+
} from './copy-format';
|
|
179
|
+
export type {
|
|
180
|
+
AdminCurrencyOptions,
|
|
181
|
+
AdminDateOptions,
|
|
182
|
+
AdminNumberOptions,
|
|
183
|
+
AdminPercentOptions,
|
|
184
|
+
AdminTimeOptions,
|
|
185
|
+
} from './copy-format';
|
|
169
186
|
export { validateGantt, GANTT_LIMITS } from './gantt';
|
|
170
187
|
export type { GanttTaskShape, GanttValidationError } from './gantt';
|
|
171
188
|
export { audit, auditWithProvider, writeAuditEntry, recordMutationRollback, setAuditHandler, setAuditLogProvider, getAuditLogProvider, withValidatedAuditProvider, AuditError } from './audit';
|
|
@@ -217,8 +234,8 @@ export type {
|
|
|
217
234
|
AdminTool, ToolResult,
|
|
218
235
|
} from './chatProvider.svelte';
|
|
219
236
|
export { getTheme, setTheme, toggleTheme, getResolvedTheme, getColorTheme, setColorTheme, getColorThemes, configureTheme, getThemeConfig, clearCssOverrides, builtinPresets, registerColorPreset, getColorPresets, registerColorTheme, exportColorThemes, importColorThemes, registerThemeOwner, updateThemeOwner, unregisterThemeOwner, resetTheme } from './theme.svelte';
|
|
220
|
-
export { deriveColorPreset, exportThemeTokens, generateColorScale, hexContrastRatio, hexLuminance, hexToOklch, oklchToHex, parseThemeTokens, pickReadableForeground } from './color-scale';
|
|
221
|
-
export type { ColorScaleStep, DerivedColorPreset, ThemeTokenDocument } from './color-scale';
|
|
237
|
+
export { deriveColorPreset, exportThemeTokens, generateColorScale, hexContrastRatio, hexLuminance, hexToOklch, interactionRamps, oklchToHex, parseThemeTokens, pickReadableForeground, withPrimaryInteractionRamps } from './color-scale';
|
|
238
|
+
export type { ColorScaleStep, DerivedColorPreset, InteractionRamps, ThemeTokenDocument } from './color-scale';
|
|
222
239
|
export type { ThemeMode, ColorTheme, BuiltinColorTheme, ThemeStrategy, ThemeConfig, ColorPreset, ThemeOwnerOptions, ThemeOwnerToken } from './theme.svelte';
|
|
223
240
|
export { setUnsavedChanges, getUnsavedChanges, initUnsavedChangesNotifier, resetUnsavedChanges } from './unsaved-changes.svelte';
|
|
224
241
|
export { setAdminOptions, getAdminOptions, getTextTransformers } from './options.svelte';
|
package/src/theme-dtcg.ts
CHANGED
|
@@ -275,6 +275,8 @@ export function auditThemeContrast(preset: DerivedColorPreset): ContrastCheck[]
|
|
|
275
275
|
const checks: ContrastCheck[] = [];
|
|
276
276
|
const pairs: Array<[string, string, string, number]> = [
|
|
277
277
|
['primary text', '--primary-foreground', '--primary', 4.5],
|
|
278
|
+
['primary hover text', '--primary-foreground', '--primary-5', 3],
|
|
279
|
+
['primary pressed text', '--primary-foreground', '--primary-7', 3],
|
|
278
280
|
['primary on surface', '--primary', '#surface', 3],
|
|
279
281
|
['sidebar primary text', '--sidebar-primary-foreground', '--sidebar-primary', 4.5],
|
|
280
282
|
['chart-1 on surface', '--chart-1', '#surface', 3],
|
package/src/theme.svelte.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { definedOptions } from './defined-options';
|
|
|
2
2
|
import {
|
|
3
3
|
deriveColorPreset,
|
|
4
4
|
exportThemeTokens,
|
|
5
|
+
interactionRamps,
|
|
5
6
|
parseThemeTokens,
|
|
7
|
+
withPrimaryInteractionRamps,
|
|
6
8
|
type DerivedColorPreset,
|
|
7
9
|
type ThemeTokenDocument,
|
|
8
10
|
} from './color-scale';
|
|
@@ -423,7 +425,7 @@ function applyThemeClasses(themeMode: ThemeMode,config: ThemeConfig): void {
|
|
|
423
425
|
function applyColorPreset(preset: ColorPreset,themeMode: ThemeMode): void {
|
|
424
426
|
if(typeof document==='undefined') return;
|
|
425
427
|
const resolved=themeMode==='system'? getSystemPreference():themeMode;
|
|
426
|
-
const variables=resolved==='dark'? preset.dark:preset.light;
|
|
428
|
+
const variables=withPrimaryInteractionRamps(resolved==='dark'? preset.dark:preset.light);
|
|
427
429
|
const root=document.documentElement;
|
|
428
430
|
|
|
429
431
|
for(const [key,value] of Object.entries(variables)) {
|
|
@@ -433,6 +435,32 @@ function applyColorPreset(preset: ColorPreset,themeMode: ThemeMode): void {
|
|
|
433
435
|
}
|
|
434
436
|
}
|
|
435
437
|
|
|
438
|
+
const SEMANTIC_RAMP_BASES = [
|
|
439
|
+
['--primary', '--primary-5', '--primary-7', '--primary-3'],
|
|
440
|
+
['--success', '--success-5', '--success-7', '--success-3'],
|
|
441
|
+
['--warning', '--warning-5', '--warning-7', '--warning-3'],
|
|
442
|
+
['--destructive', '--danger-5', '--danger-7', '--danger-3'],
|
|
443
|
+
['--info', '--info-5', '--info-7', '--info-3'],
|
|
444
|
+
] as const;
|
|
445
|
+
|
|
446
|
+
function applyOverrideRamps(overrides: Record<string, string>, root: HTMLElement): void {
|
|
447
|
+
const explicit = new Set(Object.keys(overrides).map((key) => key.startsWith('--') ? key : `--${key}`));
|
|
448
|
+
for (const [base, hover, pressed, disabled] of SEMANTIC_RAMP_BASES) {
|
|
449
|
+
const value = overrides[base] ?? overrides[base.slice(2)];
|
|
450
|
+
if (!value || explicit.has(hover) || explicit.has(pressed) || explicit.has(disabled)) continue;
|
|
451
|
+
let ramps;
|
|
452
|
+
try {
|
|
453
|
+
ramps = interactionRamps(value);
|
|
454
|
+
} catch {
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
for (const [key, ramp] of [[hover, ramps.hover], [pressed, ramps.pressed], [disabled, ramps.disabled]] as const) {
|
|
458
|
+
root.style.setProperty(key, ramp);
|
|
459
|
+
activeCssOverrideVars.push(key);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
436
464
|
function applyCssOverrides(overrides: Record<string,string>): void {
|
|
437
465
|
if(typeof document==='undefined') return;
|
|
438
466
|
const root=document.documentElement;
|
|
@@ -442,6 +470,7 @@ function applyCssOverrides(overrides: Record<string,string>): void {
|
|
|
442
470
|
root.style.setProperty(cssVar,value);
|
|
443
471
|
activeCssOverrideVars.push(cssVar);
|
|
444
472
|
}
|
|
473
|
+
applyOverrideRamps(overrides, root);
|
|
445
474
|
}
|
|
446
475
|
|
|
447
476
|
function applyEffectiveTheme(): void {
|
package/src/toast.svelte.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { definedOptions } from './defined-options';
|
|
2
|
-
export type ToastType='success'|'error'|'info'|'warning'|'undoable';
|
|
2
|
+
export type ToastType='success'|'error'|'info'|'warning'|'normal'|'undoable';
|
|
3
3
|
|
|
4
4
|
export interface ToastItem {
|
|
5
5
|
id: number;
|
|
@@ -69,6 +69,7 @@ export const toast={
|
|
|
69
69
|
success: (msg: string,duration?: number,opts?: { key?: string }) => addToast('success',msg,duration,opts),
|
|
70
70
|
error: (msg: string,duration?: number,opts?: { key?: string }) => addToast('error',msg,duration??5000,opts),
|
|
71
71
|
info: (msg: string,duration?: number,opts?: { key?: string }) => addToast('info',msg,duration,opts),
|
|
72
|
+
normal: (msg: string,duration?: number,opts?: { key?: string }) => addToast('normal',msg,duration,opts),
|
|
72
73
|
warning: (msg: string,duration?: number,opts?: { key?: string }) => addToast('warning',msg,duration??4000,opts),
|
|
73
74
|
undoable: (msg: string,duration: number,onUndo: () => void,onTimeout: () => void) =>
|
|
74
75
|
addToast('undoable',msg,duration,{ onUndo,onTimeout }),
|