@skillre/dsh-plugin-work-dashboard 0.0.0-stage → 0.9.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/LICENSE +21 -0
- package/README.en.md +259 -0
- package/README.md +371 -2
- package/UNINSTALL.md +7 -0
- package/compatibility.json +195 -0
- package/cordis.patch.yml +24 -0
- package/docs/DESIGN-0.3.md +122 -0
- package/docs/DETAIL.md +1 -0
- package/docs/DETAIL.zh.md +1 -0
- package/docs/PLAN-0.7-0.9.md +230 -0
- package/docs/preview.svg +254 -0
- package/docs/preview.zh.svg +254 -0
- package/icon.svg +17 -0
- package/lib/blockers.d.ts +45 -0
- package/lib/blockers.js +160 -0
- package/lib/client/api.d.ts +42 -0
- package/lib/client/api.js +45 -0
- package/lib/client/contracts.d.ts +94 -0
- package/lib/client/contracts.js +21 -0
- package/lib/client/css/base.d.ts +31 -0
- package/lib/client/css/base.js +461 -0
- package/lib/client/css/blockers.d.ts +18 -0
- package/lib/client/css/blockers.js +196 -0
- package/lib/client/css/charts.d.ts +14 -0
- package/lib/client/css/charts.js +191 -0
- package/lib/client/css/detail.d.ts +21 -0
- package/lib/client/css/detail.js +423 -0
- package/lib/client/css/insights.d.ts +27 -0
- package/lib/client/css/insights.js +660 -0
- package/lib/client/css/overview.d.ts +23 -0
- package/lib/client/css/overview.js +327 -0
- package/lib/client/css/summary.d.ts +13 -0
- package/lib/client/css/summary.js +187 -0
- package/lib/client/format.d.ts +57 -0
- package/lib/client/format.js +96 -0
- package/lib/client/preferences.d.ts +56 -0
- package/lib/client/preferences.js +118 -0
- package/lib/client/styles.d.ts +17 -0
- package/lib/client/styles.js +24 -0
- package/lib/client/text.d.ts +32 -0
- package/lib/client/text.js +1112 -0
- package/lib/client/view-contract.d.ts +118 -0
- package/lib/client/view-contract.js +28 -0
- package/lib/client.js +6599 -0
- package/lib/config.d.ts +61 -0
- package/lib/config.js +67 -0
- package/lib/form.d.ts +218 -0
- package/lib/form.js +1075 -0
- package/lib/gap.d.ts +60 -0
- package/lib/gap.js +227 -0
- package/lib/index.d.ts +40 -0
- package/lib/index.js +159 -0
- package/lib/repo.d.ts +124 -0
- package/lib/repo.js +407 -0
- package/lib/risks.d.ts +24 -0
- package/lib/risks.js +85 -0
- package/lib/skill.d.ts +94 -0
- package/lib/skill.js +220 -0
- package/lib/store.d.ts +63 -0
- package/lib/store.js +505 -0
- package/lib/timeline.d.ts +23 -0
- package/lib/timeline.js +93 -0
- package/lib/transport.d.ts +67 -0
- package/lib/transport.js +131 -0
- package/lib/types.d.ts +701 -0
- package/lib/types.js +78 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +117 -4
- package/skills/poc-export/SKILL.md +81 -0
- package/skills/poc-export/scripts/export-form.mjs +654 -0
- package/skills/poc-ledger/SKILL.md +171 -0
- package/skills/poc-submit/SKILL.md +186 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared display formatters.
|
|
3
|
+
*
|
|
4
|
+
* `formatWan` and `formatDate` had three copies each (overview, detail,
|
|
5
|
+
* insights), and `stageLabel` had two. Identical copies are not a style problem:
|
|
6
|
+
* three `formatDate` bodies meant three places to fix a timezone bug, and they
|
|
7
|
+
* had already drifted — the insights copy accepted `''` where the detail copy
|
|
8
|
+
* accepted `null`. One module, one behaviour.
|
|
9
|
+
*
|
|
10
|
+
* Everything here is pure and locale-explicit: the caller passes the active
|
|
11
|
+
* locale, so the result never depends on ambient state (and a replay or a test
|
|
12
|
+
* renders the same string as the live page).
|
|
13
|
+
*/
|
|
14
|
+
import { STAGES } from '../types.js';
|
|
15
|
+
/**
|
|
16
|
+
* Format a 万元 figure with thousands separators.
|
|
17
|
+
*
|
|
18
|
+
* Rounds to one decimal: the ledger stores whole 万元, so a decimal only ever
|
|
19
|
+
* appears from an average, and two decimals would imply a precision the data
|
|
20
|
+
* does not have.
|
|
21
|
+
*/
|
|
22
|
+
export function formatWan(value) {
|
|
23
|
+
const rounded = Math.round(value * 10) / 10;
|
|
24
|
+
return rounded.toLocaleString('zh-CN', { maximumFractionDigits: 1 });
|
|
25
|
+
}
|
|
26
|
+
/** `true` when the value is a calendar date (`YYYY-MM-DD`), not an instant. */
|
|
27
|
+
function isCalendarDate(value) {
|
|
28
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(value);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Format a ledger date for the active locale.
|
|
32
|
+
*
|
|
33
|
+
* The ledger stores calendar dates, not instants, so a bare `new Date('2026-11-01')`
|
|
34
|
+
* parses as UTC midnight and prints the previous day west of Greenwich. The
|
|
35
|
+
* string is therefore read as local midnight. Anything that is not a calendar
|
|
36
|
+
* date is returned verbatim: showing the raw value is honest, and inventing a
|
|
37
|
+
* parse would hide a hand-edited typo.
|
|
38
|
+
*
|
|
39
|
+
* @param value the raw field, `null`, or `''`
|
|
40
|
+
* @param locale the active locale id
|
|
41
|
+
* @param fallback what to return for an absent value; defaults to `''`
|
|
42
|
+
*/
|
|
43
|
+
export function formatDate(value, locale, fallback = '') {
|
|
44
|
+
if (value === null || value === '')
|
|
45
|
+
return fallback;
|
|
46
|
+
if (!isCalendarDate(value))
|
|
47
|
+
return value;
|
|
48
|
+
const stamp = new Date(`${value}T00:00:00`);
|
|
49
|
+
if (Number.isNaN(stamp.getTime()))
|
|
50
|
+
return value;
|
|
51
|
+
return stamp.toLocaleDateString(locale.toLowerCase().startsWith('zh') ? 'zh-CN' : 'en-US', {
|
|
52
|
+
year: 'numeric',
|
|
53
|
+
month: '2-digit',
|
|
54
|
+
day: '2-digit',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/** Format an ISO instant (not a calendar date) as `HH:MM` for the status bar. */
|
|
58
|
+
export function clockOf(value, locale) {
|
|
59
|
+
if (value === null)
|
|
60
|
+
return '';
|
|
61
|
+
const stamp = new Date(value);
|
|
62
|
+
if (Number.isNaN(stamp.getTime()))
|
|
63
|
+
return '';
|
|
64
|
+
return stamp.toLocaleTimeString(locale.toLowerCase().startsWith('zh') ? 'zh-CN' : 'en-US', {
|
|
65
|
+
hour: '2-digit',
|
|
66
|
+
minute: '2-digit',
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The dictionary label for a raw stage bucket key.
|
|
71
|
+
*
|
|
72
|
+
* Accepts the two sentinels `closed` / `unknown` alongside the five gate ids,
|
|
73
|
+
* because every stage-shaped surface (funnel, board column, filter chip) has to
|
|
74
|
+
* render all seven. An unrecognized value falls through unchanged rather than
|
|
75
|
+
* disappearing.
|
|
76
|
+
*/
|
|
77
|
+
export function stageLabel(t, key) {
|
|
78
|
+
if (key === 'closed')
|
|
79
|
+
return t('stageClosed');
|
|
80
|
+
if (key === 'unknown')
|
|
81
|
+
return t('stageUnknown');
|
|
82
|
+
if (STAGES.includes(key))
|
|
83
|
+
return t(`stage${key}`);
|
|
84
|
+
return key;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A stage bucket key for one project: `closed` wins over the normalized stage.
|
|
88
|
+
*
|
|
89
|
+
* Kept here rather than inline so the funnel, the board and the blocker list
|
|
90
|
+
* bucket a project identically.
|
|
91
|
+
*/
|
|
92
|
+
export function stageBucketKey(project) {
|
|
93
|
+
if (project.closed)
|
|
94
|
+
return 'closed';
|
|
95
|
+
return project.stage ?? 'unknown';
|
|
96
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-local refresh cadence.
|
|
3
|
+
*
|
|
4
|
+
* The cadence is a user preference, not plugin configuration, so it lives in
|
|
5
|
+
* `localStorage` under the keys the specification names and never reaches the
|
|
6
|
+
* Host. This module owns the read/write/parse rules so the settings dialog and
|
|
7
|
+
* the timer effect share one interpretation, and so the whole policy is
|
|
8
|
+
* testable without a DOM.
|
|
9
|
+
*
|
|
10
|
+
* Failure policy: storage is optional. A browser with storage disabled (or a
|
|
11
|
+
* quota error) must still render the console, so every write is best-effort and
|
|
12
|
+
* every read falls back to the documented default: manual refresh only.
|
|
13
|
+
*/
|
|
14
|
+
import { type RefreshInterval, type SortKey, type ViewMode } from '../types.js';
|
|
15
|
+
/** One resolved cadence: what the timer effect needs, nothing more. */
|
|
16
|
+
export interface RefreshPreference {
|
|
17
|
+
interval: RefreshInterval;
|
|
18
|
+
/** Only meaningful when `interval === 'custom'`. */
|
|
19
|
+
customMinutes: number;
|
|
20
|
+
}
|
|
21
|
+
/** The documented default: no automatic refresh at all. */
|
|
22
|
+
export declare const DEFAULT_PREFERENCE: RefreshPreference;
|
|
23
|
+
/** The storage face this module needs; `undefined` when unavailable. */
|
|
24
|
+
export type StorageLike = Pick<Storage, 'getItem' | 'setItem'> | undefined;
|
|
25
|
+
/** Resolve the browser storage without throwing when it is blocked. */
|
|
26
|
+
export declare function browserStorage(): StorageLike;
|
|
27
|
+
/** Clamp a custom cadence into the supported range, rounding to a whole minute. */
|
|
28
|
+
export declare function clampMinutes(value: number): number;
|
|
29
|
+
/** Accept only a declared interval id; anything else is the default. */
|
|
30
|
+
export declare function parseInterval(raw: string | null | undefined): RefreshInterval;
|
|
31
|
+
/** Read the stored preference, falling back to manual-only on anything odd. */
|
|
32
|
+
export declare function readPreference(storage?: StorageLike): RefreshPreference;
|
|
33
|
+
/** Persist the preference; a blocked or full storage degrades silently. */
|
|
34
|
+
export declare function writePreference(preference: RefreshPreference, storage?: StorageLike): void;
|
|
35
|
+
/**
|
|
36
|
+
* The timer period in milliseconds, or `null` when refresh is manual only.
|
|
37
|
+
*
|
|
38
|
+
* This is the single place the four cadences turn into a number, so the effect
|
|
39
|
+
* and the settings dialog can never disagree about "every 10 minutes".
|
|
40
|
+
*/
|
|
41
|
+
export declare function intervalMs(preference: RefreshPreference): number | null;
|
|
42
|
+
/** The stored overview layout: which view mode, and how the list is sorted. */
|
|
43
|
+
export interface ViewPreference {
|
|
44
|
+
viewMode: ViewMode;
|
|
45
|
+
sortKey: SortKey;
|
|
46
|
+
}
|
|
47
|
+
/** The documented default: cards, ordered by what needs attention. */
|
|
48
|
+
export declare const DEFAULT_VIEW_PREFERENCE: ViewPreference;
|
|
49
|
+
/** Accept only a declared view mode; anything else is the default. */
|
|
50
|
+
export declare function parseViewMode(raw: string | null | undefined): ViewMode;
|
|
51
|
+
/** Accept only a declared sort key; anything else is the default. */
|
|
52
|
+
export declare function parseSortKey(raw: string | null | undefined): SortKey;
|
|
53
|
+
/** Read the stored view preference, falling back to the default on anything odd. */
|
|
54
|
+
export declare function readViewPreference(storage?: StorageLike): ViewPreference;
|
|
55
|
+
/** Persist the view preference; a blocked or full storage degrades silently. */
|
|
56
|
+
export declare function writeViewPreference(preference: ViewPreference, storage?: StorageLike): void;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-local refresh cadence.
|
|
3
|
+
*
|
|
4
|
+
* The cadence is a user preference, not plugin configuration, so it lives in
|
|
5
|
+
* `localStorage` under the keys the specification names and never reaches the
|
|
6
|
+
* Host. This module owns the read/write/parse rules so the settings dialog and
|
|
7
|
+
* the timer effect share one interpretation, and so the whole policy is
|
|
8
|
+
* testable without a DOM.
|
|
9
|
+
*
|
|
10
|
+
* Failure policy: storage is optional. A browser with storage disabled (or a
|
|
11
|
+
* quota error) must still render the console, so every write is best-effort and
|
|
12
|
+
* every read falls back to the documented default: manual refresh only.
|
|
13
|
+
*/
|
|
14
|
+
import { CUSTOM_MINUTES_KEY, CUSTOM_MINUTES_MAX, CUSTOM_MINUTES_MIN, DEFAULT_CUSTOM_MINUTES, REFRESH_INTERVAL_KEY, REFRESH_INTERVALS, SORT_KEY_KEY, SORT_KEYS, VIEW_MODE_KEY, VIEW_MODES, } from '../types.js';
|
|
15
|
+
/** The documented default: no automatic refresh at all. */
|
|
16
|
+
export const DEFAULT_PREFERENCE = { interval: 'off', customMinutes: DEFAULT_CUSTOM_MINUTES };
|
|
17
|
+
/** Resolve the browser storage without throwing when it is blocked. */
|
|
18
|
+
export function browserStorage() {
|
|
19
|
+
try {
|
|
20
|
+
if (typeof globalThis.localStorage === 'undefined')
|
|
21
|
+
return undefined;
|
|
22
|
+
// Safari in private mode throws on the first access; probe it once.
|
|
23
|
+
const probe = '__poc-console-probe__';
|
|
24
|
+
globalThis.localStorage.setItem(probe, '1');
|
|
25
|
+
globalThis.localStorage.getItem(probe);
|
|
26
|
+
globalThis.localStorage.removeItem?.(probe);
|
|
27
|
+
return globalThis.localStorage;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** Clamp a custom cadence into the supported range, rounding to a whole minute. */
|
|
34
|
+
export function clampMinutes(value) {
|
|
35
|
+
if (!Number.isFinite(value))
|
|
36
|
+
return DEFAULT_CUSTOM_MINUTES;
|
|
37
|
+
return Math.min(CUSTOM_MINUTES_MAX, Math.max(CUSTOM_MINUTES_MIN, Math.round(value)));
|
|
38
|
+
}
|
|
39
|
+
/** Accept only a declared interval id; anything else is the default. */
|
|
40
|
+
export function parseInterval(raw) {
|
|
41
|
+
const value = (raw ?? '').trim();
|
|
42
|
+
return REFRESH_INTERVALS.includes(value) ? value : DEFAULT_PREFERENCE.interval;
|
|
43
|
+
}
|
|
44
|
+
/** Read the stored preference, falling back to manual-only on anything odd. */
|
|
45
|
+
export function readPreference(storage = browserStorage()) {
|
|
46
|
+
if (storage === undefined)
|
|
47
|
+
return { ...DEFAULT_PREFERENCE };
|
|
48
|
+
const interval = parseInterval(storage.getItem(REFRESH_INTERVAL_KEY));
|
|
49
|
+
const rawMinutes = storage.getItem(CUSTOM_MINUTES_KEY);
|
|
50
|
+
const parsed = rawMinutes === null ? Number.NaN : Number(rawMinutes);
|
|
51
|
+
return {
|
|
52
|
+
interval,
|
|
53
|
+
customMinutes: Number.isFinite(parsed) ? clampMinutes(parsed) : DEFAULT_CUSTOM_MINUTES,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** Persist the preference; a blocked or full storage degrades silently. */
|
|
57
|
+
export function writePreference(preference, storage = browserStorage()) {
|
|
58
|
+
if (storage === undefined)
|
|
59
|
+
return;
|
|
60
|
+
try {
|
|
61
|
+
storage.setItem(REFRESH_INTERVAL_KEY, preference.interval);
|
|
62
|
+
storage.setItem(CUSTOM_MINUTES_KEY, String(clampMinutes(preference.customMinutes)));
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// A read-only or full storage only costs the user the setting, not the board.
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The timer period in milliseconds, or `null` when refresh is manual only.
|
|
70
|
+
*
|
|
71
|
+
* This is the single place the four cadences turn into a number, so the effect
|
|
72
|
+
* and the settings dialog can never disagree about "every 10 minutes".
|
|
73
|
+
*/
|
|
74
|
+
export function intervalMs(preference) {
|
|
75
|
+
switch (preference.interval) {
|
|
76
|
+
case 'off':
|
|
77
|
+
return null;
|
|
78
|
+
case '10m':
|
|
79
|
+
return 10 * 60_000;
|
|
80
|
+
case '1h':
|
|
81
|
+
return 60 * 60_000;
|
|
82
|
+
case 'custom':
|
|
83
|
+
return clampMinutes(preference.customMinutes) * 60_000;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/** The documented default: cards, ordered by what needs attention. */
|
|
87
|
+
export const DEFAULT_VIEW_PREFERENCE = { viewMode: 'cards', sortKey: 'attention' };
|
|
88
|
+
/** Accept only a declared view mode; anything else is the default. */
|
|
89
|
+
export function parseViewMode(raw) {
|
|
90
|
+
const value = (raw ?? '').trim();
|
|
91
|
+
return VIEW_MODES.includes(value) ? value : DEFAULT_VIEW_PREFERENCE.viewMode;
|
|
92
|
+
}
|
|
93
|
+
/** Accept only a declared sort key; anything else is the default. */
|
|
94
|
+
export function parseSortKey(raw) {
|
|
95
|
+
const value = (raw ?? '').trim();
|
|
96
|
+
return SORT_KEYS.includes(value) ? value : DEFAULT_VIEW_PREFERENCE.sortKey;
|
|
97
|
+
}
|
|
98
|
+
/** Read the stored view preference, falling back to the default on anything odd. */
|
|
99
|
+
export function readViewPreference(storage = browserStorage()) {
|
|
100
|
+
if (storage === undefined)
|
|
101
|
+
return { ...DEFAULT_VIEW_PREFERENCE };
|
|
102
|
+
return {
|
|
103
|
+
viewMode: parseViewMode(storage.getItem(VIEW_MODE_KEY)),
|
|
104
|
+
sortKey: parseSortKey(storage.getItem(SORT_KEY_KEY)),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** Persist the view preference; a blocked or full storage degrades silently. */
|
|
108
|
+
export function writeViewPreference(preference, storage = browserStorage()) {
|
|
109
|
+
if (storage === undefined)
|
|
110
|
+
return;
|
|
111
|
+
try {
|
|
112
|
+
storage.setItem(VIEW_MODE_KEY, preference.viewMode);
|
|
113
|
+
storage.setItem(SORT_KEY_KEY, preference.sortKey);
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
// Losing the layout preference costs one click, not the board.
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The style assembly point.
|
|
3
|
+
*
|
|
4
|
+
* Each surface ships its CSS beside its component (`css/charts.ts`,
|
|
5
|
+
* `css/overview.ts`, `css/detail.ts`, `css/insights.ts`), and the shell owns the
|
|
6
|
+
* frame (`css/base.ts`). This module concatenates them into the single sheet the
|
|
7
|
+
* page mounts in one `<style>` element, in a fixed cascade order: variables and
|
|
8
|
+
* frame first, then the chart primitives, then the surfaces that build on them.
|
|
9
|
+
*
|
|
10
|
+
* Keeping the fragments in separate files is what let four modules be written in
|
|
11
|
+
* parallel without touching each other's stylesheets. The order below is the
|
|
12
|
+
* contract: a surface may rely on the frame's atoms, and no surface may rely on
|
|
13
|
+
* another surface's rules.
|
|
14
|
+
*/
|
|
15
|
+
export declare const CONSOLE_CSS: string;
|
|
16
|
+
/** The scoped root class, re-exported for tests that assert the scope. */
|
|
17
|
+
export declare const ROOT_CLASS = "wd-shell";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The style assembly point.
|
|
3
|
+
*
|
|
4
|
+
* Each surface ships its CSS beside its component (`css/charts.ts`,
|
|
5
|
+
* `css/overview.ts`, `css/detail.ts`, `css/insights.ts`), and the shell owns the
|
|
6
|
+
* frame (`css/base.ts`). This module concatenates them into the single sheet the
|
|
7
|
+
* page mounts in one `<style>` element, in a fixed cascade order: variables and
|
|
8
|
+
* frame first, then the chart primitives, then the surfaces that build on them.
|
|
9
|
+
*
|
|
10
|
+
* Keeping the fragments in separate files is what let four modules be written in
|
|
11
|
+
* parallel without touching each other's stylesheets. The order below is the
|
|
12
|
+
* contract: a surface may rely on the frame's atoms, and no surface may rely on
|
|
13
|
+
* another surface's rules.
|
|
14
|
+
*/
|
|
15
|
+
import { BASE_CSS } from './css/base.js';
|
|
16
|
+
import { BLOCKERS_CSS } from './css/blockers.js';
|
|
17
|
+
import { CHARTS_CSS } from './css/charts.js';
|
|
18
|
+
import { DETAIL_CSS } from './css/detail.js';
|
|
19
|
+
import { INSIGHTS_CSS } from './css/insights.js';
|
|
20
|
+
import { OVERVIEW_CSS } from './css/overview.js';
|
|
21
|
+
import { SUMMARY_CSS } from './css/summary.js';
|
|
22
|
+
export const CONSOLE_CSS = [BASE_CSS, CHARTS_CSS, OVERVIEW_CSS, SUMMARY_CSS, DETAIL_CSS, INSIGHTS_CSS, BLOCKERS_CSS].join('\n');
|
|
23
|
+
/** The scoped root class, re-exported for tests that assert the scope. */
|
|
24
|
+
export const ROOT_CLASS = 'wd-shell';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client dictionaries.
|
|
3
|
+
*
|
|
4
|
+
* Two locales ship with the bundle: Simplified Chinese (the authoring language
|
|
5
|
+
* and the language the ledger itself is written in) and English. Keys are flat
|
|
6
|
+
* and dot-namespaced, resolved through the shared `locale` service, so switching
|
|
7
|
+
* the GUI language re-renders the console without a reload.
|
|
8
|
+
*
|
|
9
|
+
* Rule and dimension copy is keyed by the stable ids the Host sends
|
|
10
|
+
* (`gap.G0-why-customer.title`, `dim.evidence`) rather than by prose, so a new
|
|
11
|
+
* rule id only needs a dictionary entry on both halves of the same bundle.
|
|
12
|
+
*/
|
|
13
|
+
/** The namespace registered with the Client locale service. */
|
|
14
|
+
export declare const NAMESPACE = "skillreWorkDashboard";
|
|
15
|
+
/** Chinese dictionary; the key set is the source of truth. */
|
|
16
|
+
export declare const zh: Record<string, string>;
|
|
17
|
+
/** English dictionary; every key mirrors {@link zh}. */
|
|
18
|
+
export declare const en: Record<string, string>;
|
|
19
|
+
/** Read one key from a dictionary, falling back to the key itself. */
|
|
20
|
+
export declare function textOf(dict: Record<string, string>, key: string): string;
|
|
21
|
+
/** Pick the dictionary for a locale id, falling back to English. */
|
|
22
|
+
export declare function dictFor(locale: string): Record<string, string>;
|
|
23
|
+
/** The translate function the locale service binds for one namespace. */
|
|
24
|
+
export type Translate = (key: string, params?: Record<string, string | number>) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Fill `{name}` placeholders from a parameter bag.
|
|
27
|
+
*
|
|
28
|
+
* The Client-side locale service interpolates the same way, but this helper is
|
|
29
|
+
* also used for dictionary lookups that bypass the service (the initial paint
|
|
30
|
+
* before the service's snapshot is available), and for the tests.
|
|
31
|
+
*/
|
|
32
|
+
export declare function format(template: string, params?: Record<string, string | number>): string;
|