@lmzhen/dsh-evolution-client-kit 0.40.0 → 0.41.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/lib/generated/i18n/evolution-merge.js +1800 -0
- package/lib/generated/i18n/evolution-settings.js +1008 -0
- package/lib/generated/i18n/evolution-skill-health.js +720 -0
- package/lib/generated/i18n/evolution-skill-history.js +800 -0
- package/lib/generated/i18n.generated.js +29 -0
- package/lib/index.js +1 -1
- package/lib/types/generated/i18n/evolution-merge.d.ts +1798 -0
- package/lib/types/generated/i18n/evolution-merge.js +1799 -0
- package/lib/types/generated/i18n/evolution-settings.d.ts +1006 -0
- package/lib/types/generated/i18n/evolution-settings.js +1007 -0
- package/lib/types/generated/i18n/evolution-skill-health.d.ts +718 -0
- package/lib/types/generated/i18n/evolution-skill-health.js +719 -0
- package/lib/types/generated/i18n/evolution-skill-history.d.ts +798 -0
- package/lib/types/generated/i18n/evolution-skill-history.js +799 -0
- package/lib/types/generated/i18n.generated.d.ts +4315 -0
- package/lib/types/generated/i18n.generated.js +19 -0
- package/lib/types/panel.d.ts +4 -6
- package/lib/types/panel.js +1 -1
- package/lib/types/seam.d.ts +6 -4
- package/lib/types/workbench-view.d.ts +2 -4
- package/package.json +22 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// GENERATED by packages/scripts/gen-i18n.mjs — do not edit.
|
|
2
|
+
/**
|
|
3
|
+
* Source of truth: packages/scripts/i18n/catalog/*.json.
|
|
4
|
+
*/
|
|
5
|
+
import { dictionaries as evolutionMerge } from "./i18n/evolution-merge.js";
|
|
6
|
+
import { dictionaries as evolutionSettings } from "./i18n/evolution-settings.js";
|
|
7
|
+
import { dictionaries as evolutionSkillHealth } from "./i18n/evolution-skill-health.js";
|
|
8
|
+
import { dictionaries as evolutionSkillHistory } from "./i18n/evolution-skill-history.js";
|
|
9
|
+
export const SUPPORTED_LOCALES = ["zh", "en", "ja", "es", "fr", "de", "ru", "pt"];
|
|
10
|
+
export const DICTIONARIES = {
|
|
11
|
+
"evolution-merge": evolutionMerge,
|
|
12
|
+
"evolution-settings": evolutionSettings,
|
|
13
|
+
"evolution-skill-health": evolutionSkillHealth,
|
|
14
|
+
"evolution-skill-history": evolutionSkillHistory,
|
|
15
|
+
};
|
|
16
|
+
export function dictionariesFor(namespace) {
|
|
17
|
+
return DICTIONARIES[namespace];
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=i18n.generated.js.map
|
package/lib/types/panel.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
6
6
|
import type { ReactNode } from 'react';
|
|
7
|
-
import type { ClientSeam } from './seam.ts';
|
|
7
|
+
import type { ClientSeam, LocaleDictionaries } from './seam.ts';
|
|
8
|
+
import type { SupportedLocale } from './generated/i18n.generated.ts';
|
|
8
9
|
/** Dictionary lookup used by the panel body and row label. */
|
|
9
10
|
export type Translate = (key: string, values?: Readonly<Record<string, string | number>>) => string;
|
|
10
11
|
/** The feature-specific part of one sidebar panel. */
|
|
@@ -16,12 +17,9 @@ export interface SidebarPanelSpec<Face> {
|
|
|
16
17
|
order: number;
|
|
17
18
|
/** Locale namespace owned by this panel. */
|
|
18
19
|
namespace: string;
|
|
19
|
-
dictionaries:
|
|
20
|
-
zh: Record<string, string>;
|
|
21
|
-
en: Record<string, string>;
|
|
22
|
-
};
|
|
20
|
+
dictionaries: LocaleDictionaries;
|
|
23
21
|
/** Fallback dictionary when the locale seat refuses or is absent. */
|
|
24
|
-
fallback?:
|
|
22
|
+
fallback?: SupportedLocale;
|
|
25
23
|
/** Panel stylesheet and the tag id that makes injection idempotent. */
|
|
26
24
|
styles: {
|
|
27
25
|
css: string;
|
package/lib/types/panel.js
CHANGED
|
@@ -46,7 +46,7 @@ export function registerSidebarPanel(ctx, spec) {
|
|
|
46
46
|
}
|
|
47
47
|
}, spec.namespace + ': locale');
|
|
48
48
|
ctx.effect(() => injectStyles(typeof document === 'undefined' ? undefined : document, spec.styles.css, spec.styles.tagId), spec.namespace + ': styles');
|
|
49
|
-
const fallback = spec.dictionaries[spec.fallback ?? FALLBACK_LOCALE];
|
|
49
|
+
const fallback = spec.dictionaries[spec.fallback ?? FALLBACK_LOCALE] ?? spec.dictionaries.en;
|
|
50
50
|
const lookup = (key) => {
|
|
51
51
|
const own = fallback[key] ?? key;
|
|
52
52
|
if (!registered)
|
package/lib/types/seam.d.ts
CHANGED
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
* @module @lmzhen/dsh-evolution-client-kit
|
|
8
8
|
*/
|
|
9
9
|
import type { ReactNode } from 'react';
|
|
10
|
+
import type { SupportedLocale } from './generated/i18n.generated.ts';
|
|
11
|
+
/** The dictionaries a family panel registers; English is always present. */
|
|
12
|
+
export type LocaleDictionaries = Partial<Record<SupportedLocale, Record<string, string>>> & {
|
|
13
|
+
en: Record<string, string>;
|
|
14
|
+
};
|
|
10
15
|
/** Registration options for the global sidebar row. */
|
|
11
16
|
export interface PanelRowOptions {
|
|
12
17
|
name: 'sidebar.panellist';
|
|
@@ -24,10 +29,7 @@ export interface PanelBodyOptions {
|
|
|
24
29
|
}
|
|
25
30
|
/** The locale seat: one namespace registration and a bound translator. */
|
|
26
31
|
export interface LocaleSeat {
|
|
27
|
-
register(namespace: string, dictionaries:
|
|
28
|
-
zh: Record<string, string>;
|
|
29
|
-
en: Record<string, string>;
|
|
30
|
-
}): () => void;
|
|
32
|
+
register(namespace: string, dictionaries: LocaleDictionaries): () => void;
|
|
31
33
|
bind(namespace: string): (key: string) => string;
|
|
32
34
|
}
|
|
33
35
|
/** The slot registry: an inject body may register and is disposed when it unmounts. */
|
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
* @module @lmzhen/dsh-evolution-client-kit
|
|
5
5
|
*/
|
|
6
6
|
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
7
|
+
import type { LocaleDictionaries } from './seam.ts';
|
|
7
8
|
import type { ReactNode } from 'react';
|
|
8
9
|
/** One feature view contribution. */
|
|
9
10
|
export interface WorkbenchViewSpec<Face> {
|
|
10
11
|
readonly id: string;
|
|
11
12
|
readonly order: number;
|
|
12
13
|
readonly namespace: string;
|
|
13
|
-
readonly dictionaries:
|
|
14
|
-
readonly zh: Record<string, string>;
|
|
15
|
-
readonly en: Record<string, string>;
|
|
16
|
-
};
|
|
14
|
+
readonly dictionaries: LocaleDictionaries;
|
|
17
15
|
readonly styles: {
|
|
18
16
|
readonly css: string;
|
|
19
17
|
readonly tagId: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-client-kit",
|
|
3
3
|
"description": "Shared browser seams and lifecycle for the evolution family sidebar panels (community build)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.41.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -43,7 +43,27 @@
|
|
|
43
43
|
"types": "./lib/types/tokens.d.ts",
|
|
44
44
|
"default": "./lib/tokens.js"
|
|
45
45
|
},
|
|
46
|
-
"./package.json": "./package.json"
|
|
46
|
+
"./package.json": "./package.json",
|
|
47
|
+
"./generated/i18n": {
|
|
48
|
+
"types": "./lib/types/generated/i18n.generated.d.ts",
|
|
49
|
+
"default": "./lib/generated/i18n.generated.js"
|
|
50
|
+
},
|
|
51
|
+
"./generated/i18n/evolution-settings": {
|
|
52
|
+
"types": "./lib/types/generated/i18n/evolution-settings.d.ts",
|
|
53
|
+
"default": "./lib/generated/i18n/evolution-settings.js"
|
|
54
|
+
},
|
|
55
|
+
"./generated/i18n/evolution-skill-history": {
|
|
56
|
+
"types": "./lib/types/generated/i18n/evolution-skill-history.d.ts",
|
|
57
|
+
"default": "./lib/generated/i18n/evolution-skill-history.js"
|
|
58
|
+
},
|
|
59
|
+
"./generated/i18n/evolution-merge": {
|
|
60
|
+
"types": "./lib/types/generated/i18n/evolution-merge.d.ts",
|
|
61
|
+
"default": "./lib/generated/i18n/evolution-merge.js"
|
|
62
|
+
},
|
|
63
|
+
"./generated/i18n/evolution-skill-health": {
|
|
64
|
+
"types": "./lib/types/generated/i18n/evolution-skill-health.d.ts",
|
|
65
|
+
"default": "./lib/generated/i18n/evolution-skill-health.js"
|
|
66
|
+
}
|
|
47
67
|
},
|
|
48
68
|
"files": [
|
|
49
69
|
"lib/**/*.js",
|