@nsxbet/admin-sdk 0.5.0 → 0.6.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/CHECKLIST.md +40 -10
- package/README.md +337 -36
- package/dist/auth/client/gateway-token.d.ts +19 -0
- package/dist/auth/client/gateway-token.js +89 -0
- package/dist/auth/client/in-memory.d.ts +5 -1
- package/dist/auth/client/in-memory.js +75 -38
- package/dist/auth/client/index.d.ts +0 -1
- package/dist/auth/client/interface.d.ts +6 -3
- package/dist/auth/client/keycloak.d.ts +0 -1
- package/dist/auth/client/keycloak.js +6 -3
- package/dist/auth/components/UserSelector.d.ts +0 -1
- package/dist/auth/components/UserSelector.js +89 -7
- package/dist/auth/components/index.d.ts +0 -1
- package/dist/auth/index.d.ts +0 -1
- package/dist/components/AuthProvider.d.ts +0 -1
- package/dist/components/Timestamp.d.ts +7 -0
- package/dist/components/Timestamp.js +50 -0
- package/dist/hooks/useAuth.d.ts +0 -1
- package/dist/hooks/useAuth.js +1 -1
- package/dist/hooks/useFetch.d.ts +0 -1
- package/dist/hooks/useI18n.d.ts +0 -1
- package/dist/hooks/usePlatformAPI.d.ts +0 -1
- package/dist/hooks/useTelemetry.d.ts +0 -1
- package/dist/hooks/useTimestamp.d.ts +8 -0
- package/dist/hooks/useTimestamp.js +122 -0
- package/dist/i18n/config.d.ts +20 -2
- package/dist/i18n/config.js +48 -0
- package/dist/i18n/index.d.ts +2 -3
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/locales/en-US.json +95 -18
- package/dist/i18n/locales/es.json +95 -18
- package/dist/i18n/locales/pt-BR.json +95 -18
- package/dist/i18n/locales/ro.json +95 -18
- package/dist/index.d.ts +11 -7
- package/dist/index.js +5 -1
- package/dist/registry/AdminShellRegistry.d.ts +1 -2
- package/dist/registry/cache/cached-catalog.d.ts +11 -0
- package/dist/registry/cache/cached-catalog.js +42 -0
- package/dist/registry/cache/catalog-cache.d.ts +10 -0
- package/dist/registry/cache/catalog-cache.js +58 -0
- package/dist/registry/cache/index.d.ts +5 -0
- package/dist/registry/cache/index.js +3 -0
- package/dist/registry/cache/types.d.ts +20 -0
- package/dist/registry/cache/types.js +3 -0
- package/dist/registry/client/http.d.ts +0 -1
- package/dist/registry/client/http.js +13 -0
- package/dist/registry/client/in-memory.d.ts +0 -1
- package/dist/registry/client/in-memory.js +117 -12
- package/dist/registry/client/index.d.ts +0 -1
- package/dist/registry/client/interface.d.ts +21 -6
- package/dist/registry/index.d.ts +5 -2
- package/dist/registry/index.js +4 -0
- package/dist/registry/types/index.d.ts +2 -3
- package/dist/registry/types/manifest.d.ts +20 -24
- package/dist/registry/types/manifest.js +17 -18
- package/dist/registry/types/module.d.ts +43 -14
- package/dist/registry/useRegistryPolling.d.ts +15 -0
- package/dist/registry/useRegistryPolling.js +66 -0
- package/dist/router/DynamicModule.d.ts +6 -22
- package/dist/router/DynamicModule.js +25 -48
- package/dist/router/ModuleErrorBoundary.d.ts +39 -0
- package/dist/router/ModuleErrorBoundary.js +101 -0
- package/dist/router/index.d.ts +1 -1
- package/dist/router/url-allowlist.d.ts +22 -0
- package/dist/router/url-allowlist.js +65 -0
- package/dist/shell/AdminShell.d.ts +0 -1
- package/dist/shell/AdminShell.js +178 -43
- package/dist/shell/BackofficeShell.d.ts +0 -1
- package/dist/shell/BackofficeShell.js +59 -25
- package/dist/shell/components/CommandPalette.d.ts +0 -1
- package/dist/shell/components/CommandPalette.js +26 -50
- package/dist/shell/components/DevtoolsPanel.d.ts +11 -0
- package/dist/shell/components/DevtoolsPanel.js +145 -0
- package/dist/shell/components/HomePage.d.ts +0 -1
- package/dist/shell/components/HomePage.js +9 -4
- package/dist/shell/components/LeftNav.d.ts +0 -1
- package/dist/shell/components/LeftNav.js +91 -93
- package/dist/shell/components/MainContent.d.ts +3 -2
- package/dist/shell/components/MainContent.js +8 -23
- package/dist/shell/components/ModuleOverview.d.ts +0 -1
- package/dist/shell/components/ModuleOverview.js +4 -20
- package/dist/shell/components/ProfilePage.d.ts +0 -1
- package/dist/shell/components/ProfilePage.js +1 -1
- package/dist/shell/components/RegistryPage.d.ts +0 -1
- package/dist/shell/components/RegistryPage.js +154 -64
- package/dist/shell/components/RegistryStatusBanner.d.ts +6 -0
- package/dist/shell/components/RegistryStatusBanner.js +31 -0
- package/dist/shell/components/RegistryUnavailable.d.ts +4 -0
- package/dist/shell/components/RegistryUnavailable.js +7 -0
- package/dist/shell/components/SettingsPage.d.ts +0 -1
- package/dist/shell/components/StackedPanel.d.ts +15 -0
- package/dist/shell/components/StackedPanel.js +45 -0
- package/dist/shell/components/TopBar.d.ts +4 -2
- package/dist/shell/components/TopBar.js +9 -3
- package/dist/shell/components/UpdateBanner.d.ts +5 -0
- package/dist/shell/components/UpdateBanner.js +8 -0
- package/dist/shell/components/index.d.ts +4 -1
- package/dist/shell/components/index.js +2 -0
- package/dist/shell/components/theme-provider.d.ts +0 -1
- package/dist/shell/components/theme-provider.js +8 -5
- package/dist/shell/hooks/useCspViolations.d.ts +12 -0
- package/dist/shell/hooks/useCspViolations.js +34 -0
- package/dist/shell/index.d.ts +1 -2
- package/dist/shell/polling-config.d.ts +10 -0
- package/dist/shell/polling-config.js +26 -0
- package/dist/shell/search/fuzzy.d.ts +0 -1
- package/dist/shell/search/index.d.ts +0 -1
- package/dist/shell/telemetry.d.ts +0 -1
- package/dist/shell/types.d.ts +34 -18
- package/dist/tailwind/index.d.ts +0 -1
- package/dist/types/keycloak.d.ts +0 -1
- package/dist/types/platform.d.ts +12 -1
- package/dist/vite/AdminShellSharedDeps.d.ts +64 -0
- package/dist/vite/AdminShellSharedDeps.js +215 -0
- package/dist/vite/config.d.ts +10 -2
- package/dist/vite/config.js +13 -10
- package/dist/vite/i18n-plugin.d.ts +13 -0
- package/dist/vite/i18n-plugin.js +81 -0
- package/dist/vite/index.d.ts +2 -1
- package/dist/vite/index.js +2 -0
- package/dist/vite/plugins.d.ts +0 -1
- package/package.json +6 -2
- package/dist/auth/client/in-memory.d.ts.map +0 -1
- package/dist/auth/client/index.d.ts.map +0 -1
- package/dist/auth/client/interface.d.ts.map +0 -1
- package/dist/auth/client/keycloak.d.ts.map +0 -1
- package/dist/auth/components/UserSelector.d.ts.map +0 -1
- package/dist/auth/components/index.d.ts.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/components/AuthProvider.d.ts.map +0 -1
- package/dist/hooks/useAuth.d.ts.map +0 -1
- package/dist/hooks/useFetch.d.ts.map +0 -1
- package/dist/hooks/useI18n.d.ts.map +0 -1
- package/dist/hooks/usePlatformAPI.d.ts.map +0 -1
- package/dist/hooks/useTelemetry.d.ts.map +0 -1
- package/dist/i18n/config.d.ts.map +0 -1
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/registry/AdminShellRegistry.d.ts.map +0 -1
- package/dist/registry/client/http.d.ts.map +0 -1
- package/dist/registry/client/in-memory.d.ts.map +0 -1
- package/dist/registry/client/index.d.ts.map +0 -1
- package/dist/registry/client/interface.d.ts.map +0 -1
- package/dist/registry/index.d.ts.map +0 -1
- package/dist/registry/types/index.d.ts.map +0 -1
- package/dist/registry/types/manifest.d.ts.map +0 -1
- package/dist/registry/types/module.d.ts.map +0 -1
- package/dist/router/DynamicModule.d.ts.map +0 -1
- package/dist/router/index.d.ts.map +0 -1
- package/dist/shell/AdminShell.d.ts.map +0 -1
- package/dist/shell/BackofficeShell.d.ts.map +0 -1
- package/dist/shell/components/CommandPalette.d.ts.map +0 -1
- package/dist/shell/components/HomePage.d.ts.map +0 -1
- package/dist/shell/components/LeftNav.d.ts.map +0 -1
- package/dist/shell/components/MainContent.d.ts.map +0 -1
- package/dist/shell/components/ModuleOverview.d.ts.map +0 -1
- package/dist/shell/components/ProfilePage.d.ts.map +0 -1
- package/dist/shell/components/RegistryPage.d.ts.map +0 -1
- package/dist/shell/components/SettingsPage.d.ts.map +0 -1
- package/dist/shell/components/TopBar.d.ts.map +0 -1
- package/dist/shell/components/index.d.ts.map +0 -1
- package/dist/shell/components/theme-provider.d.ts.map +0 -1
- package/dist/shell/index.d.ts.map +0 -1
- package/dist/shell/search/fuzzy.d.ts.map +0 -1
- package/dist/shell/search/index.d.ts.map +0 -1
- package/dist/shell/telemetry.d.ts.map +0 -1
- package/dist/shell/types.d.ts.map +0 -1
- package/dist/tailwind/index.d.ts.map +0 -1
- package/dist/types/keycloak.d.ts.map +0 -1
- package/dist/types/platform.d.ts.map +0 -1
- package/dist/vite/config.d.ts.map +0 -1
- package/dist/vite/index.d.ts.map +0 -1
- package/dist/vite/plugins.d.ts.map +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TimezoneMode, TimestampFormat } from '../types/platform';
|
|
2
|
+
export interface UseTimestampResult {
|
|
3
|
+
mode: TimezoneMode;
|
|
4
|
+
setMode: (mode: TimezoneMode) => void;
|
|
5
|
+
formatDate: (date: Date, format?: TimestampFormat) => string;
|
|
6
|
+
timezone: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function useTimestamp(): UseTimestampResult;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { useEffect, useState, useCallback, useMemo } from 'react';
|
|
2
|
+
import { usePlatformAPI } from './usePlatformAPI';
|
|
3
|
+
import { useI18n } from './useI18n';
|
|
4
|
+
const TIMEZONE_STORAGE_KEY = 'admin-timezone-mode';
|
|
5
|
+
function getStoredTimezoneMode() {
|
|
6
|
+
if (typeof window === 'undefined')
|
|
7
|
+
return 'local';
|
|
8
|
+
const stored = localStorage.getItem(TIMEZONE_STORAGE_KEY);
|
|
9
|
+
if (stored === 'utc' || stored === 'local')
|
|
10
|
+
return stored;
|
|
11
|
+
return 'local';
|
|
12
|
+
}
|
|
13
|
+
function getRelativeTime(date, locale) {
|
|
14
|
+
const now = Date.now();
|
|
15
|
+
const diffMs = now - date.getTime();
|
|
16
|
+
const absDiffMs = Math.abs(diffMs);
|
|
17
|
+
const isFuture = diffMs < 0;
|
|
18
|
+
const SECOND = 1000;
|
|
19
|
+
const MINUTE = 60 * SECOND;
|
|
20
|
+
const HOUR = 60 * MINUTE;
|
|
21
|
+
const DAY = 24 * HOUR;
|
|
22
|
+
const MONTH = 30 * DAY;
|
|
23
|
+
const YEAR = 12 * MONTH;
|
|
24
|
+
if (absDiffMs < 60 * SECOND) {
|
|
25
|
+
return new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(0, 'second');
|
|
26
|
+
}
|
|
27
|
+
const rtf = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' });
|
|
28
|
+
let value;
|
|
29
|
+
let unit;
|
|
30
|
+
if (absDiffMs < HOUR) {
|
|
31
|
+
value = Math.round(absDiffMs / MINUTE);
|
|
32
|
+
unit = 'minute';
|
|
33
|
+
}
|
|
34
|
+
else if (absDiffMs < DAY) {
|
|
35
|
+
value = Math.round(absDiffMs / HOUR);
|
|
36
|
+
unit = 'hour';
|
|
37
|
+
}
|
|
38
|
+
else if (absDiffMs < MONTH) {
|
|
39
|
+
value = Math.round(absDiffMs / DAY);
|
|
40
|
+
unit = 'day';
|
|
41
|
+
}
|
|
42
|
+
else if (absDiffMs < YEAR) {
|
|
43
|
+
value = Math.round(absDiffMs / MONTH);
|
|
44
|
+
unit = 'month';
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
value = Math.round(absDiffMs / YEAR);
|
|
48
|
+
unit = 'year';
|
|
49
|
+
}
|
|
50
|
+
return rtf.format(isFuture ? value : -value, unit);
|
|
51
|
+
}
|
|
52
|
+
function formatDateValue(date, format, mode, locale) {
|
|
53
|
+
if (format === 'relative') {
|
|
54
|
+
return getRelativeTime(date, locale);
|
|
55
|
+
}
|
|
56
|
+
const tzOption = mode === 'utc' ? 'UTC' : undefined;
|
|
57
|
+
const suffix = mode === 'utc' ? ' UTC' : '';
|
|
58
|
+
let options;
|
|
59
|
+
switch (format) {
|
|
60
|
+
case 'date':
|
|
61
|
+
options = {
|
|
62
|
+
year: 'numeric',
|
|
63
|
+
month: 'short',
|
|
64
|
+
day: 'numeric',
|
|
65
|
+
timeZone: tzOption,
|
|
66
|
+
};
|
|
67
|
+
return new Intl.DateTimeFormat(locale, options).format(date);
|
|
68
|
+
case 'time':
|
|
69
|
+
options = {
|
|
70
|
+
hour: 'numeric',
|
|
71
|
+
minute: '2-digit',
|
|
72
|
+
second: '2-digit',
|
|
73
|
+
timeZone: tzOption,
|
|
74
|
+
};
|
|
75
|
+
return new Intl.DateTimeFormat(locale, options).format(date) + suffix;
|
|
76
|
+
case 'datetime':
|
|
77
|
+
default:
|
|
78
|
+
options = {
|
|
79
|
+
year: 'numeric',
|
|
80
|
+
month: 'short',
|
|
81
|
+
day: 'numeric',
|
|
82
|
+
hour: 'numeric',
|
|
83
|
+
minute: '2-digit',
|
|
84
|
+
second: '2-digit',
|
|
85
|
+
timeZone: tzOption,
|
|
86
|
+
};
|
|
87
|
+
return new Intl.DateTimeFormat(locale, options).format(date) + suffix;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export function useTimestamp() {
|
|
91
|
+
const { isShellMode, api } = usePlatformAPI();
|
|
92
|
+
const { locale } = useI18n();
|
|
93
|
+
const [standaloneMode, setStandaloneMode] = useState(getStoredTimezoneMode);
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (isShellMode && api) {
|
|
96
|
+
setStandaloneMode(api.timestamp.mode);
|
|
97
|
+
const unsubscribe = api.timestamp.onModeChange((newMode) => {
|
|
98
|
+
setStandaloneMode(newMode);
|
|
99
|
+
});
|
|
100
|
+
return unsubscribe;
|
|
101
|
+
}
|
|
102
|
+
}, [isShellMode, api]);
|
|
103
|
+
const mode = isShellMode && api ? api.timestamp.mode : standaloneMode;
|
|
104
|
+
const setMode = useCallback((newMode) => {
|
|
105
|
+
if (isShellMode && api) {
|
|
106
|
+
api.timestamp.setMode(newMode);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
localStorage.setItem(TIMEZONE_STORAGE_KEY, newMode);
|
|
110
|
+
setStandaloneMode(newMode);
|
|
111
|
+
}
|
|
112
|
+
}, [isShellMode, api]);
|
|
113
|
+
const formatDate = useCallback((date, format = 'datetime') => {
|
|
114
|
+
return formatDateValue(date, format, mode, locale);
|
|
115
|
+
}, [mode, locale]);
|
|
116
|
+
const timezone = useMemo(() => {
|
|
117
|
+
if (mode === 'utc')
|
|
118
|
+
return 'UTC';
|
|
119
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
120
|
+
}, [mode]);
|
|
121
|
+
return { mode, setMode, formatDate, timezone };
|
|
122
|
+
}
|
package/dist/i18n/config.d.ts
CHANGED
|
@@ -5,9 +5,28 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import i18n from 'i18next';
|
|
7
7
|
export declare const SUPPORTED_LOCALES: readonly ["pt-BR", "es", "en-US", "ro"];
|
|
8
|
-
export type SupportedLocale = typeof SUPPORTED_LOCALES[number];
|
|
8
|
+
export type SupportedLocale = (typeof SUPPORTED_LOCALES)[number];
|
|
9
|
+
/**
|
|
10
|
+
* Localized string value - one string per supported locale.
|
|
11
|
+
* Used for manifest title, description, and command titles.
|
|
12
|
+
*/
|
|
13
|
+
export type LocalizedField = Record<SupportedLocale, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Resolves a localized string for the given locale.
|
|
16
|
+
* Falls back to en-US if the locale is missing.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveLocalizedString(value: LocalizedField | undefined, locale: string): string;
|
|
9
19
|
export declare const LOCALE_FLAGS: Record<SupportedLocale, string>;
|
|
10
20
|
export declare const LOCALE_NAMES: Record<SupportedLocale, string>;
|
|
21
|
+
/**
|
|
22
|
+
* Register module translation bundles.
|
|
23
|
+
* If i18n is already initialized, registers immediately.
|
|
24
|
+
* Otherwise queues for application when initI18n() is called.
|
|
25
|
+
* Used by the Vite plugin's auto-injected registration code.
|
|
26
|
+
*
|
|
27
|
+
* Idempotent: subsequent calls for the same namespace are no-ops.
|
|
28
|
+
*/
|
|
29
|
+
export declare function registerModuleTranslations(namespace: string, translations: Record<string, Record<string, unknown>>): void;
|
|
11
30
|
/**
|
|
12
31
|
* Save locale to localStorage
|
|
13
32
|
*/
|
|
@@ -23,4 +42,3 @@ export declare function initI18n(): typeof i18n;
|
|
|
23
42
|
export declare function isSupportedLocale(locale: string): locale is SupportedLocale;
|
|
24
43
|
export { i18n };
|
|
25
44
|
export default i18n;
|
|
26
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/i18n/config.js
CHANGED
|
@@ -10,6 +10,18 @@ import es from './locales/es.json';
|
|
|
10
10
|
import enUS from './locales/en-US.json';
|
|
11
11
|
import ro from './locales/ro.json';
|
|
12
12
|
export const SUPPORTED_LOCALES = ['pt-BR', 'es', 'en-US', 'ro'];
|
|
13
|
+
/**
|
|
14
|
+
* Resolves a localized string for the given locale.
|
|
15
|
+
* Falls back to en-US if the locale is missing.
|
|
16
|
+
*/
|
|
17
|
+
export function resolveLocalizedString(value, locale) {
|
|
18
|
+
if (!value || typeof value !== 'object')
|
|
19
|
+
return '';
|
|
20
|
+
const supported = value[locale];
|
|
21
|
+
if (typeof supported === 'string')
|
|
22
|
+
return supported;
|
|
23
|
+
return value['en-US'] ?? Object.values(value)[0] ?? '';
|
|
24
|
+
}
|
|
13
25
|
export const LOCALE_FLAGS = {
|
|
14
26
|
'pt-BR': '🇧🇷',
|
|
15
27
|
'es': '🇪🇸',
|
|
@@ -23,6 +35,35 @@ export const LOCALE_NAMES = {
|
|
|
23
35
|
'ro': 'Română',
|
|
24
36
|
};
|
|
25
37
|
const STORAGE_KEY = 'adminPlatform.locale';
|
|
38
|
+
const pendingTranslations = [];
|
|
39
|
+
const registeredNamespaces = new Set();
|
|
40
|
+
/**
|
|
41
|
+
* Register module translation bundles.
|
|
42
|
+
* If i18n is already initialized, registers immediately.
|
|
43
|
+
* Otherwise queues for application when initI18n() is called.
|
|
44
|
+
* Used by the Vite plugin's auto-injected registration code.
|
|
45
|
+
*
|
|
46
|
+
* Idempotent: subsequent calls for the same namespace are no-ops.
|
|
47
|
+
*/
|
|
48
|
+
export function registerModuleTranslations(namespace, translations) {
|
|
49
|
+
if (registeredNamespaces.has(namespace))
|
|
50
|
+
return;
|
|
51
|
+
registeredNamespaces.add(namespace);
|
|
52
|
+
if (import.meta.env?.DEV) {
|
|
53
|
+
const missing = SUPPORTED_LOCALES.filter(l => !(l in translations));
|
|
54
|
+
if (missing.length > 0) {
|
|
55
|
+
console.warn(`[i18n] registerModuleTranslations("${namespace}"): missing locales: ${missing.join(', ')}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (i18n.isInitialized) {
|
|
59
|
+
for (const [lng, resources] of Object.entries(translations)) {
|
|
60
|
+
i18n.addResourceBundle(lng, namespace, resources, true, true);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
pendingTranslations.push({ namespace, translations });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
26
67
|
/**
|
|
27
68
|
* Get the saved locale from localStorage, or return default
|
|
28
69
|
*/
|
|
@@ -80,6 +121,13 @@ export function initI18n() {
|
|
|
80
121
|
}
|
|
81
122
|
},
|
|
82
123
|
});
|
|
124
|
+
// Apply any module translations that were queued before init
|
|
125
|
+
for (const { namespace, translations } of pendingTranslations) {
|
|
126
|
+
for (const [lng, resources] of Object.entries(translations)) {
|
|
127
|
+
i18n.addResourceBundle(lng, namespace, resources, true, true);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
pendingTranslations.length = 0;
|
|
83
131
|
return i18n;
|
|
84
132
|
}
|
|
85
133
|
/**
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* i18n module exports
|
|
3
3
|
*/
|
|
4
|
-
export { initI18n, saveLocale, isSupportedLocale, i18n, SUPPORTED_LOCALES, LOCALE_FLAGS, LOCALE_NAMES, } from './config';
|
|
5
|
-
export type { SupportedLocale } from './config';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
4
|
+
export { initI18n, saveLocale, isSupportedLocale, resolveLocalizedString, registerModuleTranslations, i18n, SUPPORTED_LOCALES, LOCALE_FLAGS, LOCALE_NAMES, } from './config';
|
|
5
|
+
export type { SupportedLocale, LocalizedField } from './config';
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* i18n module exports
|
|
3
3
|
*/
|
|
4
|
-
export { initI18n, saveLocale, isSupportedLocale, i18n, SUPPORTED_LOCALES, LOCALE_FLAGS, LOCALE_NAMES, } from './config';
|
|
4
|
+
export { initI18n, saveLocale, isSupportedLocale, resolveLocalizedString, registerModuleTranslations, i18n, SUPPORTED_LOCALES, LOCALE_FLAGS, LOCALE_NAMES, } from './config';
|
|
@@ -30,9 +30,14 @@
|
|
|
30
30
|
"themeLight": "Light",
|
|
31
31
|
"themeDark": "Dark",
|
|
32
32
|
"themeSystem": "System",
|
|
33
|
-
"language": "Language"
|
|
33
|
+
"language": "Language",
|
|
34
|
+
"timezone": "Timezone",
|
|
35
|
+
"timezoneUtc": "UTC",
|
|
36
|
+
"timezoneLocal": "Local",
|
|
37
|
+
"timezoneToggleUtc": "Toggle timezone: currently UTC",
|
|
38
|
+
"timezoneToggleLocal": "Toggle timezone: currently Local"
|
|
34
39
|
},
|
|
35
|
-
"
|
|
40
|
+
"navigation": {
|
|
36
41
|
"home": "Home",
|
|
37
42
|
"settings": "Settings",
|
|
38
43
|
"profile": "Profile",
|
|
@@ -95,23 +100,40 @@
|
|
|
95
100
|
"mode": "Mode",
|
|
96
101
|
"apiMode": "API Mode",
|
|
97
102
|
"inMemoryMode": "In-Memory Mode",
|
|
98
|
-
"addModule": "Add Module",
|
|
99
|
-
"addByUrl": "By URL",
|
|
100
|
-
"addByManifest": "By Manifest",
|
|
101
|
-
"moduleUrl": "Module URL",
|
|
102
|
-
"moduleUrlPlaceholder": "https://example.com/module",
|
|
103
|
-
"manifestJson": "Manifest JSON",
|
|
104
|
-
"manifestPlaceholder": "Paste the manifest JSON here...",
|
|
105
|
-
"register": "Register",
|
|
106
103
|
"registeredModules": "Registered Modules",
|
|
107
104
|
"noModules": "No modules registered",
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
105
|
+
"noModulesHint": "Modules are registered through the CI/CD pipeline.",
|
|
106
|
+
"loadingModules": "Loading modules...",
|
|
107
|
+
"loadingVersions": "Loading versions...",
|
|
108
|
+
"enabled": "Enabled",
|
|
109
|
+
"disabled": "Disabled",
|
|
110
|
+
"unversioned": "unversioned",
|
|
111
|
+
"noDescription": "No description",
|
|
112
|
+
"versionHistory": "Version History",
|
|
113
|
+
"versionActive": "Active",
|
|
114
|
+
"noVersionHistory": "No version history available.",
|
|
115
|
+
"rollback": "Rollback",
|
|
116
|
+
"rollbackTitle": "Roll back to v{{version}}?",
|
|
117
|
+
"rollbackDescription": "{{name}} will be rolled back from v{{fromVersion}} to v{{toVersion}}. The current version will be replaced immediately for all users.",
|
|
118
|
+
"rollbackConfirm": "Confirm Rollback",
|
|
119
|
+
"rollingBack": "Rolling back...",
|
|
120
|
+
"rolledBackFrom": "rolled back from v{{version}}",
|
|
121
|
+
"disableTitle": "Disable {{name}}?",
|
|
122
|
+
"disableDescription": "This module will be removed from navigation for all users. Module routes will become inaccessible until re-enabled.",
|
|
123
|
+
"disableConfirm": "Disable Module",
|
|
124
|
+
"deleteConfirm": "Are you sure you want to delete \"{{name}}\"? This action cannot be undone.",
|
|
125
|
+
"manageOrder": "Manage Order",
|
|
126
|
+
"saveOrder": "Save Order",
|
|
127
|
+
"savingOrder": "Saving...",
|
|
128
|
+
"position": "#{{position}}",
|
|
129
|
+
"errorClientUnavailable": "Registry client not available. Please check configuration.",
|
|
130
|
+
"errorLoadModules": "Failed to load modules",
|
|
131
|
+
"errorUpdateModule": "Failed to update module",
|
|
132
|
+
"errorDisableModule": "Failed to disable module",
|
|
133
|
+
"errorDeleteModule": "Failed to delete module",
|
|
134
|
+
"errorLoadVersions": "Failed to load version history",
|
|
135
|
+
"errorRollback": "Failed to rollback module",
|
|
136
|
+
"errorSaveOrder": "Failed to save order"
|
|
115
137
|
},
|
|
116
138
|
"moduleOverview": {
|
|
117
139
|
"title": "Module Overview",
|
|
@@ -128,6 +150,17 @@
|
|
|
128
150
|
"support": "Support",
|
|
129
151
|
"supportChannel": "Support Channel"
|
|
130
152
|
},
|
|
153
|
+
"moduleError": {
|
|
154
|
+
"title": "Failed to Load Module",
|
|
155
|
+
"description": "An error occurred while loading the module.",
|
|
156
|
+
"ownerTeam": "Owner",
|
|
157
|
+
"supportChannel": "Support",
|
|
158
|
+
"retry": "Try Again",
|
|
159
|
+
"reload": "Reload Page",
|
|
160
|
+
"networkTitle": "Module Unavailable",
|
|
161
|
+
"networkDescription": "The module server is not responding. Please ensure the module is running.",
|
|
162
|
+
"contactHeading": "Report this issue"
|
|
163
|
+
},
|
|
131
164
|
"errors": {
|
|
132
165
|
"generic": "Something went wrong",
|
|
133
166
|
"notFound": "Page not found",
|
|
@@ -138,7 +171,51 @@
|
|
|
138
171
|
"moduleLoadFailed": "Failed to load module",
|
|
139
172
|
"networkError": "Network error"
|
|
140
173
|
},
|
|
174
|
+
"registryCache": {
|
|
175
|
+
"cachedMessage": "Using cached module data — registry unavailable",
|
|
176
|
+
"staleMessage": "Using outdated module data — registry unavailable for over 24 hours",
|
|
177
|
+
"unavailableTitle": "Admin Registry Unavailable",
|
|
178
|
+
"unavailableDescription": "Unable to load module catalog from the registry. Please check your connection and try again.",
|
|
179
|
+
"retry": "Retry",
|
|
180
|
+
"lastUpdated": "Last updated {{time}}"
|
|
181
|
+
},
|
|
182
|
+
"devtoolsPanel": {
|
|
183
|
+
"title": "Devtools",
|
|
184
|
+
"triggerLabel": "Open devtools panel",
|
|
185
|
+
"registry": "Registry",
|
|
186
|
+
"modules": "Modules",
|
|
187
|
+
"cacheStatus": "Cache Status",
|
|
188
|
+
"cspViolations": "CSP Violations",
|
|
189
|
+
"copyDebugInfo": "Copy debug info",
|
|
190
|
+
"copied": "Copied!",
|
|
191
|
+
"close": "Close",
|
|
192
|
+
"catalogVersion": "Catalog Version",
|
|
193
|
+
"generatedAt": "Generated At",
|
|
194
|
+
"registryMode": "Registry Mode",
|
|
195
|
+
"apiMode": "API Mode",
|
|
196
|
+
"inMemoryMode": "In-Memory Mode",
|
|
197
|
+
"fresh": "Fresh",
|
|
198
|
+
"cached": "Cached",
|
|
199
|
+
"stale": "Stale",
|
|
200
|
+
"unavailable": "Unavailable",
|
|
201
|
+
"cachedAt": "Cached At",
|
|
202
|
+
"enabled": "Enabled",
|
|
203
|
+
"disabled": "Disabled",
|
|
204
|
+
"noModules": "No modules registered",
|
|
205
|
+
"noViolations": "No violations recorded",
|
|
206
|
+
"cspHintConnect": "Add {{host}} to CSP_CONNECT_HOSTS",
|
|
207
|
+
"cspHintScript": "Add {{host}} to CSP_SCRIPT_HOSTS",
|
|
208
|
+
"cspHintGeneric": "CSP {{directive}} violation for {{uri}}",
|
|
209
|
+
"blockedUri": "Blocked URI",
|
|
210
|
+
"violatedDirective": "Violated Directive",
|
|
211
|
+
"hint": "Hint",
|
|
212
|
+
"baseUrl": "Base URL",
|
|
213
|
+
"id": "ID"
|
|
214
|
+
},
|
|
141
215
|
"breadcrumbs": {
|
|
142
|
-
"home": "Home"
|
|
216
|
+
"home": "Home",
|
|
217
|
+
"registry": "Registry",
|
|
218
|
+
"settings": "Settings",
|
|
219
|
+
"profile": "Profile"
|
|
143
220
|
}
|
|
144
221
|
}
|
|
@@ -30,9 +30,14 @@
|
|
|
30
30
|
"themeLight": "Claro",
|
|
31
31
|
"themeDark": "Oscuro",
|
|
32
32
|
"themeSystem": "Sistema",
|
|
33
|
-
"language": "Idioma"
|
|
33
|
+
"language": "Idioma",
|
|
34
|
+
"timezone": "Zona horaria",
|
|
35
|
+
"timezoneUtc": "UTC",
|
|
36
|
+
"timezoneLocal": "Local",
|
|
37
|
+
"timezoneToggleUtc": "Cambiar zona horaria: actualmente UTC",
|
|
38
|
+
"timezoneToggleLocal": "Cambiar zona horaria: actualmente Local"
|
|
34
39
|
},
|
|
35
|
-
"
|
|
40
|
+
"navigation": {
|
|
36
41
|
"home": "Inicio",
|
|
37
42
|
"settings": "Configuración",
|
|
38
43
|
"profile": "Perfil",
|
|
@@ -95,23 +100,40 @@
|
|
|
95
100
|
"mode": "Modo",
|
|
96
101
|
"apiMode": "Modo API",
|
|
97
102
|
"inMemoryMode": "Modo En Memoria",
|
|
98
|
-
"addModule": "Agregar Módulo",
|
|
99
|
-
"addByUrl": "Por URL",
|
|
100
|
-
"addByManifest": "Por Manifiesto",
|
|
101
|
-
"moduleUrl": "URL del Módulo",
|
|
102
|
-
"moduleUrlPlaceholder": "https://ejemplo.com/modulo",
|
|
103
|
-
"manifestJson": "JSON del Manifiesto",
|
|
104
|
-
"manifestPlaceholder": "Pega el JSON del manifiesto aquí...",
|
|
105
|
-
"register": "Registrar",
|
|
106
103
|
"registeredModules": "Módulos Registrados",
|
|
107
104
|
"noModules": "No hay módulos registrados",
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
105
|
+
"noModulesHint": "Los módulos se registran a través del pipeline CI/CD.",
|
|
106
|
+
"loadingModules": "Cargando módulos...",
|
|
107
|
+
"loadingVersions": "Cargando versiones...",
|
|
108
|
+
"enabled": "Habilitado",
|
|
109
|
+
"disabled": "Deshabilitado",
|
|
110
|
+
"unversioned": "sin versión",
|
|
111
|
+
"noDescription": "Sin descripción",
|
|
112
|
+
"versionHistory": "Historial de Versiones",
|
|
113
|
+
"versionActive": "Activo",
|
|
114
|
+
"noVersionHistory": "No hay historial de versiones disponible.",
|
|
115
|
+
"rollback": "Revertir",
|
|
116
|
+
"rollbackTitle": "¿Revertir a v{{version}}?",
|
|
117
|
+
"rollbackDescription": "{{name}} será revertido de v{{fromVersion}} a v{{toVersion}}. La versión actual será reemplazada inmediatamente para todos los usuarios.",
|
|
118
|
+
"rollbackConfirm": "Confirmar Reversión",
|
|
119
|
+
"rollingBack": "Revirtiendo...",
|
|
120
|
+
"rolledBackFrom": "revertido de v{{version}}",
|
|
121
|
+
"disableTitle": "¿Deshabilitar {{name}}?",
|
|
122
|
+
"disableDescription": "Este módulo será eliminado de la navegación para todos los usuarios. Las rutas del módulo serán inaccesibles hasta que se rehabilite.",
|
|
123
|
+
"disableConfirm": "Deshabilitar Módulo",
|
|
124
|
+
"deleteConfirm": "¿Estás seguro de que deseas eliminar \"{{name}}\"? Esta acción no se puede deshacer.",
|
|
125
|
+
"manageOrder": "Gestionar Orden",
|
|
126
|
+
"saveOrder": "Guardar Orden",
|
|
127
|
+
"savingOrder": "Guardando...",
|
|
128
|
+
"position": "#{{position}}",
|
|
129
|
+
"errorClientUnavailable": "Cliente del registro no disponible. Verifica la configuración.",
|
|
130
|
+
"errorLoadModules": "Error al cargar módulos",
|
|
131
|
+
"errorUpdateModule": "Error al actualizar módulo",
|
|
132
|
+
"errorDisableModule": "Error al deshabilitar módulo",
|
|
133
|
+
"errorDeleteModule": "Error al eliminar módulo",
|
|
134
|
+
"errorLoadVersions": "Error al cargar historial de versiones",
|
|
135
|
+
"errorRollback": "Error al revertir módulo",
|
|
136
|
+
"errorSaveOrder": "Error al guardar orden"
|
|
115
137
|
},
|
|
116
138
|
"moduleOverview": {
|
|
117
139
|
"title": "Vista General del Módulo",
|
|
@@ -128,6 +150,17 @@
|
|
|
128
150
|
"support": "Soporte",
|
|
129
151
|
"supportChannel": "Canal de Soporte"
|
|
130
152
|
},
|
|
153
|
+
"moduleError": {
|
|
154
|
+
"title": "Error al Cargar Módulo",
|
|
155
|
+
"description": "Ocurrió un error al cargar el módulo.",
|
|
156
|
+
"ownerTeam": "Propietario",
|
|
157
|
+
"supportChannel": "Soporte",
|
|
158
|
+
"retry": "Intentar de Nuevo",
|
|
159
|
+
"reload": "Recargar Página",
|
|
160
|
+
"networkTitle": "Módulo No Disponible",
|
|
161
|
+
"networkDescription": "El servidor del módulo no responde. Asegúrate de que el módulo esté en ejecución.",
|
|
162
|
+
"contactHeading": "Reportar este problema"
|
|
163
|
+
},
|
|
131
164
|
"errors": {
|
|
132
165
|
"generic": "Algo salió mal",
|
|
133
166
|
"notFound": "Página no encontrada",
|
|
@@ -138,7 +171,51 @@
|
|
|
138
171
|
"moduleLoadFailed": "Error al cargar módulo",
|
|
139
172
|
"networkError": "Error de conexión"
|
|
140
173
|
},
|
|
174
|
+
"registryCache": {
|
|
175
|
+
"cachedMessage": "Usando datos de módulos en caché — registro no disponible",
|
|
176
|
+
"staleMessage": "Usando datos de módulos desactualizados — registro no disponible por más de 24 horas",
|
|
177
|
+
"unavailableTitle": "Registro Admin No Disponible",
|
|
178
|
+
"unavailableDescription": "No se pudo cargar el catálogo de módulos del registro. Verifica tu conexión e inténtalo de nuevo.",
|
|
179
|
+
"retry": "Reintentar",
|
|
180
|
+
"lastUpdated": "Última actualización {{time}}"
|
|
181
|
+
},
|
|
182
|
+
"devtoolsPanel": {
|
|
183
|
+
"title": "Devtools",
|
|
184
|
+
"triggerLabel": "Abrir panel de devtools",
|
|
185
|
+
"registry": "Registro",
|
|
186
|
+
"modules": "Módulos",
|
|
187
|
+
"cacheStatus": "Estado del Caché",
|
|
188
|
+
"cspViolations": "Violaciones CSP",
|
|
189
|
+
"copyDebugInfo": "Copiar info de depuración",
|
|
190
|
+
"copied": "¡Copiado!",
|
|
191
|
+
"close": "Cerrar",
|
|
192
|
+
"catalogVersion": "Versión del Catálogo",
|
|
193
|
+
"generatedAt": "Generado El",
|
|
194
|
+
"registryMode": "Modo del Registro",
|
|
195
|
+
"apiMode": "Modo API",
|
|
196
|
+
"inMemoryMode": "Modo En Memoria",
|
|
197
|
+
"fresh": "Actualizado",
|
|
198
|
+
"cached": "En Caché",
|
|
199
|
+
"stale": "Desactualizado",
|
|
200
|
+
"unavailable": "No Disponible",
|
|
201
|
+
"cachedAt": "En Caché Desde",
|
|
202
|
+
"enabled": "Habilitado",
|
|
203
|
+
"disabled": "Deshabilitado",
|
|
204
|
+
"noModules": "No hay módulos registrados",
|
|
205
|
+
"noViolations": "No se registraron violaciones",
|
|
206
|
+
"cspHintConnect": "Agrega {{host}} a CSP_CONNECT_HOSTS",
|
|
207
|
+
"cspHintScript": "Agrega {{host}} a CSP_SCRIPT_HOSTS",
|
|
208
|
+
"cspHintGeneric": "Violación CSP {{directive}} para {{uri}}",
|
|
209
|
+
"blockedUri": "URI Bloqueada",
|
|
210
|
+
"violatedDirective": "Directiva Violada",
|
|
211
|
+
"hint": "Pista",
|
|
212
|
+
"baseUrl": "URL Base",
|
|
213
|
+
"id": "ID"
|
|
214
|
+
},
|
|
141
215
|
"breadcrumbs": {
|
|
142
|
-
"home": "Inicio"
|
|
216
|
+
"home": "Inicio",
|
|
217
|
+
"registry": "Registro",
|
|
218
|
+
"settings": "Configuración",
|
|
219
|
+
"profile": "Perfil"
|
|
143
220
|
}
|
|
144
221
|
}
|