@i18n-micro/devtools-ui 1.0.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.md +27 -0
- package/dist/App.ce.vue.d.ts +14 -0
- package/dist/bridge/interface.d.ts +36 -0
- package/dist/components/config/ConfigCard.vue.d.ts +22 -0
- package/dist/components/config/DiffViewer.vue.d.ts +7 -0
- package/dist/components/config/SettingsCard.vue.d.ts +22 -0
- package/dist/components/data/LocaleTable.vue.d.ts +13 -0
- package/dist/components/data/LocalesList.vue.d.ts +11 -0
- package/dist/components/data/StatItem.vue.d.ts +20 -0
- package/dist/components/data/Statistics.vue.d.ts +21 -0
- package/dist/components/data/TreeItem.vue.d.ts +15 -0
- package/dist/components/editor/TranslationControls.vue.d.ts +21 -0
- package/dist/components/editor/TranslationEditor.vue.d.ts +10 -0
- package/dist/components/layout/ActionBar.vue.d.ts +17 -0
- package/dist/components/layout/SplitPane.vue.d.ts +28 -0
- package/dist/components/ui/Button.vue.d.ts +32 -0
- package/dist/components/ui/Loader.vue.d.ts +9 -0
- package/dist/components/ui/Modal.vue.d.ts +41 -0
- package/dist/components/ui/Pagination.vue.d.ts +10 -0
- package/dist/components/ui/StatusIndicator.vue.d.ts +9 -0
- package/dist/components/ui/Tabs.vue.d.ts +16 -0
- package/dist/components/ui/icons/GlobeIcon.vue.d.ts +2 -0
- package/dist/components/ui/icons/ServerIcon.vue.d.ts +2 -0
- package/dist/components/ui/icons/SettingsIcon.vue.d.ts +2 -0
- package/dist/composables/useI18nState.d.ts +249 -0
- package/dist/env.d.ts +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.es.js +8232 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +14 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/rpc/client.d.ts +2 -0
- package/dist/rpc/host.d.ts +8 -0
- package/dist/rpc/types.d.ts +21 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/util/Translator.d.ts +68 -0
- package/dist/util/i18nUtils.d.ts +2 -0
- package/dist/views/ConfigView.vue.d.ts +2 -0
- package/dist/views/I18nView.vue.d.ts +4 -0
- package/dist/views/SettingsView.vue.d.ts +2 -0
- package/package.json +42 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { InjectionKey } from 'vue';
|
|
2
|
+
import { I18nDevToolsBridge, LocaleData, TranslationContent, ModuleOptions } from '../types';
|
|
3
|
+
export declare const I18N_STATE_KEY: InjectionKey<ReturnType<typeof createI18nState>>;
|
|
4
|
+
export declare function createI18nState(): {
|
|
5
|
+
isLoading: import('vue').Ref<boolean, boolean>;
|
|
6
|
+
selectedFile: import('vue').Ref<string, string>;
|
|
7
|
+
locales: import('vue').Ref<LocaleData, LocaleData>;
|
|
8
|
+
configs: import('vue').Ref<{
|
|
9
|
+
locales?: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
code: import('@i18n-micro/types').LocaleCode;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
iso?: string | undefined;
|
|
14
|
+
dir?: "ltr" | "rtl" | "auto" | undefined;
|
|
15
|
+
displayName?: string | undefined;
|
|
16
|
+
baseUrl?: string | undefined;
|
|
17
|
+
baseDefault?: boolean | undefined;
|
|
18
|
+
fallbackLocale?: string | undefined;
|
|
19
|
+
}[] | undefined;
|
|
20
|
+
meta?: boolean | undefined;
|
|
21
|
+
strategy?: import('@i18n-micro/types').Strategies | undefined;
|
|
22
|
+
metaBaseUrl?: string | undefined;
|
|
23
|
+
define?: boolean | undefined;
|
|
24
|
+
redirects?: boolean | undefined;
|
|
25
|
+
plugin?: boolean | undefined;
|
|
26
|
+
hooks?: boolean | undefined;
|
|
27
|
+
defaultLocale?: string | undefined;
|
|
28
|
+
apiBaseUrl?: string | undefined;
|
|
29
|
+
apiBaseClientHost?: string | undefined;
|
|
30
|
+
apiBaseServerHost?: string | undefined;
|
|
31
|
+
translationDir?: string | undefined;
|
|
32
|
+
autoDetectLanguage?: boolean | undefined;
|
|
33
|
+
autoDetectPath?: string | undefined;
|
|
34
|
+
disableWatcher?: boolean | undefined;
|
|
35
|
+
types?: boolean | undefined;
|
|
36
|
+
includeDefaultLocaleRoute?: boolean | undefined;
|
|
37
|
+
routesLocaleLinks?: {
|
|
38
|
+
[key: string]: string;
|
|
39
|
+
} | undefined;
|
|
40
|
+
plural?: (string | import('@i18n-micro/types').PluralFunc) | undefined;
|
|
41
|
+
disablePageLocales?: boolean | undefined;
|
|
42
|
+
fallbackLocale?: string | undefined;
|
|
43
|
+
localeCookie?: string | undefined;
|
|
44
|
+
debug?: boolean | undefined;
|
|
45
|
+
globalLocaleRoutes?: import('@i18n-micro/types').GlobalLocaleRoutes;
|
|
46
|
+
customRegexMatcher?: (string | RegExp) | undefined;
|
|
47
|
+
noPrefixRedirect?: boolean | undefined;
|
|
48
|
+
canonicalQueryWhitelist?: string[] | undefined;
|
|
49
|
+
excludePatterns?: (string | RegExp)[] | undefined;
|
|
50
|
+
routeLocales?: Record<string, string[]> | undefined;
|
|
51
|
+
routeDisableMeta?: Record<string, boolean | string[]> | undefined;
|
|
52
|
+
missingWarn?: boolean | undefined;
|
|
53
|
+
experimental?: {
|
|
54
|
+
i18nPreviousPageFallback?: boolean | undefined;
|
|
55
|
+
hmr?: boolean | undefined;
|
|
56
|
+
} | undefined;
|
|
57
|
+
}, ModuleOptions | {
|
|
58
|
+
locales?: {
|
|
59
|
+
[x: string]: unknown;
|
|
60
|
+
code: import('@i18n-micro/types').LocaleCode;
|
|
61
|
+
disabled?: boolean | undefined;
|
|
62
|
+
iso?: string | undefined;
|
|
63
|
+
dir?: "ltr" | "rtl" | "auto" | undefined;
|
|
64
|
+
displayName?: string | undefined;
|
|
65
|
+
baseUrl?: string | undefined;
|
|
66
|
+
baseDefault?: boolean | undefined;
|
|
67
|
+
fallbackLocale?: string | undefined;
|
|
68
|
+
}[] | undefined;
|
|
69
|
+
meta?: boolean | undefined;
|
|
70
|
+
strategy?: import('@i18n-micro/types').Strategies | undefined;
|
|
71
|
+
metaBaseUrl?: string | undefined;
|
|
72
|
+
define?: boolean | undefined;
|
|
73
|
+
redirects?: boolean | undefined;
|
|
74
|
+
plugin?: boolean | undefined;
|
|
75
|
+
hooks?: boolean | undefined;
|
|
76
|
+
defaultLocale?: string | undefined;
|
|
77
|
+
apiBaseUrl?: string | undefined;
|
|
78
|
+
apiBaseClientHost?: string | undefined;
|
|
79
|
+
apiBaseServerHost?: string | undefined;
|
|
80
|
+
translationDir?: string | undefined;
|
|
81
|
+
autoDetectLanguage?: boolean | undefined;
|
|
82
|
+
autoDetectPath?: string | undefined;
|
|
83
|
+
disableWatcher?: boolean | undefined;
|
|
84
|
+
types?: boolean | undefined;
|
|
85
|
+
includeDefaultLocaleRoute?: boolean | undefined;
|
|
86
|
+
routesLocaleLinks?: {
|
|
87
|
+
[key: string]: string;
|
|
88
|
+
} | undefined;
|
|
89
|
+
plural?: (string | import('@i18n-micro/types').PluralFunc) | undefined;
|
|
90
|
+
disablePageLocales?: boolean | undefined;
|
|
91
|
+
fallbackLocale?: string | undefined;
|
|
92
|
+
localeCookie?: string | undefined;
|
|
93
|
+
debug?: boolean | undefined;
|
|
94
|
+
globalLocaleRoutes?: import('@i18n-micro/types').GlobalLocaleRoutes;
|
|
95
|
+
customRegexMatcher?: (string | RegExp) | undefined;
|
|
96
|
+
noPrefixRedirect?: boolean | undefined;
|
|
97
|
+
canonicalQueryWhitelist?: string[] | undefined;
|
|
98
|
+
excludePatterns?: (string | RegExp)[] | undefined;
|
|
99
|
+
routeLocales?: Record<string, string[]> | undefined;
|
|
100
|
+
routeDisableMeta?: Record<string, boolean | string[]> | undefined;
|
|
101
|
+
missingWarn?: boolean | undefined;
|
|
102
|
+
experimental?: {
|
|
103
|
+
i18nPreviousPageFallback?: boolean | undefined;
|
|
104
|
+
hmr?: boolean | undefined;
|
|
105
|
+
} | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
selectedFileContent: import('vue').Ref<TranslationContent, TranslationContent>;
|
|
108
|
+
bridge: Readonly<import('vue').Ref<{
|
|
109
|
+
readonly getLocalesAndTranslations: () => Promise<LocaleData>;
|
|
110
|
+
readonly getConfigs: () => Promise<ModuleOptions>;
|
|
111
|
+
readonly saveTranslation: (filePath: string, content: TranslationContent) => Promise<void>;
|
|
112
|
+
readonly onLocalesUpdate: (callback: (data: LocaleData) => void) => () => void;
|
|
113
|
+
} | null, {
|
|
114
|
+
readonly getLocalesAndTranslations: () => Promise<LocaleData>;
|
|
115
|
+
readonly getConfigs: () => Promise<ModuleOptions>;
|
|
116
|
+
readonly saveTranslation: (filePath: string, content: TranslationContent) => Promise<void>;
|
|
117
|
+
readonly onLocalesUpdate: (callback: (data: LocaleData) => void) => () => void;
|
|
118
|
+
} | null>>;
|
|
119
|
+
setBridge: (newBridge: I18nDevToolsBridge) => void;
|
|
120
|
+
init: () => Promise<void>;
|
|
121
|
+
handleFileSelected: (file: string) => void;
|
|
122
|
+
exportTranslations: () => Promise<void>;
|
|
123
|
+
importTranslations: (event: Event) => void;
|
|
124
|
+
getDefaultLocaleTranslation: () => TranslationContent;
|
|
125
|
+
saveCurrent: () => Promise<void>;
|
|
126
|
+
};
|
|
127
|
+
export declare function useI18nState(): {
|
|
128
|
+
isLoading: import('vue').Ref<boolean, boolean>;
|
|
129
|
+
selectedFile: import('vue').Ref<string, string>;
|
|
130
|
+
locales: import('vue').Ref<LocaleData, LocaleData>;
|
|
131
|
+
configs: import('vue').Ref<{
|
|
132
|
+
locales?: {
|
|
133
|
+
[x: string]: unknown;
|
|
134
|
+
code: import('@i18n-micro/types').LocaleCode;
|
|
135
|
+
disabled?: boolean | undefined;
|
|
136
|
+
iso?: string | undefined;
|
|
137
|
+
dir?: "ltr" | "rtl" | "auto" | undefined;
|
|
138
|
+
displayName?: string | undefined;
|
|
139
|
+
baseUrl?: string | undefined;
|
|
140
|
+
baseDefault?: boolean | undefined;
|
|
141
|
+
fallbackLocale?: string | undefined;
|
|
142
|
+
}[] | undefined;
|
|
143
|
+
meta?: boolean | undefined;
|
|
144
|
+
strategy?: import('@i18n-micro/types').Strategies | undefined;
|
|
145
|
+
metaBaseUrl?: string | undefined;
|
|
146
|
+
define?: boolean | undefined;
|
|
147
|
+
redirects?: boolean | undefined;
|
|
148
|
+
plugin?: boolean | undefined;
|
|
149
|
+
hooks?: boolean | undefined;
|
|
150
|
+
defaultLocale?: string | undefined;
|
|
151
|
+
apiBaseUrl?: string | undefined;
|
|
152
|
+
apiBaseClientHost?: string | undefined;
|
|
153
|
+
apiBaseServerHost?: string | undefined;
|
|
154
|
+
translationDir?: string | undefined;
|
|
155
|
+
autoDetectLanguage?: boolean | undefined;
|
|
156
|
+
autoDetectPath?: string | undefined;
|
|
157
|
+
disableWatcher?: boolean | undefined;
|
|
158
|
+
types?: boolean | undefined;
|
|
159
|
+
includeDefaultLocaleRoute?: boolean | undefined;
|
|
160
|
+
routesLocaleLinks?: {
|
|
161
|
+
[key: string]: string;
|
|
162
|
+
} | undefined;
|
|
163
|
+
plural?: (string | import('@i18n-micro/types').PluralFunc) | undefined;
|
|
164
|
+
disablePageLocales?: boolean | undefined;
|
|
165
|
+
fallbackLocale?: string | undefined;
|
|
166
|
+
localeCookie?: string | undefined;
|
|
167
|
+
debug?: boolean | undefined;
|
|
168
|
+
globalLocaleRoutes?: import('@i18n-micro/types').GlobalLocaleRoutes;
|
|
169
|
+
customRegexMatcher?: (string | RegExp) | undefined;
|
|
170
|
+
noPrefixRedirect?: boolean | undefined;
|
|
171
|
+
canonicalQueryWhitelist?: string[] | undefined;
|
|
172
|
+
excludePatterns?: (string | RegExp)[] | undefined;
|
|
173
|
+
routeLocales?: Record<string, string[]> | undefined;
|
|
174
|
+
routeDisableMeta?: Record<string, boolean | string[]> | undefined;
|
|
175
|
+
missingWarn?: boolean | undefined;
|
|
176
|
+
experimental?: {
|
|
177
|
+
i18nPreviousPageFallback?: boolean | undefined;
|
|
178
|
+
hmr?: boolean | undefined;
|
|
179
|
+
} | undefined;
|
|
180
|
+
}, ModuleOptions | {
|
|
181
|
+
locales?: {
|
|
182
|
+
[x: string]: unknown;
|
|
183
|
+
code: import('@i18n-micro/types').LocaleCode;
|
|
184
|
+
disabled?: boolean | undefined;
|
|
185
|
+
iso?: string | undefined;
|
|
186
|
+
dir?: "ltr" | "rtl" | "auto" | undefined;
|
|
187
|
+
displayName?: string | undefined;
|
|
188
|
+
baseUrl?: string | undefined;
|
|
189
|
+
baseDefault?: boolean | undefined;
|
|
190
|
+
fallbackLocale?: string | undefined;
|
|
191
|
+
}[] | undefined;
|
|
192
|
+
meta?: boolean | undefined;
|
|
193
|
+
strategy?: import('@i18n-micro/types').Strategies | undefined;
|
|
194
|
+
metaBaseUrl?: string | undefined;
|
|
195
|
+
define?: boolean | undefined;
|
|
196
|
+
redirects?: boolean | undefined;
|
|
197
|
+
plugin?: boolean | undefined;
|
|
198
|
+
hooks?: boolean | undefined;
|
|
199
|
+
defaultLocale?: string | undefined;
|
|
200
|
+
apiBaseUrl?: string | undefined;
|
|
201
|
+
apiBaseClientHost?: string | undefined;
|
|
202
|
+
apiBaseServerHost?: string | undefined;
|
|
203
|
+
translationDir?: string | undefined;
|
|
204
|
+
autoDetectLanguage?: boolean | undefined;
|
|
205
|
+
autoDetectPath?: string | undefined;
|
|
206
|
+
disableWatcher?: boolean | undefined;
|
|
207
|
+
types?: boolean | undefined;
|
|
208
|
+
includeDefaultLocaleRoute?: boolean | undefined;
|
|
209
|
+
routesLocaleLinks?: {
|
|
210
|
+
[key: string]: string;
|
|
211
|
+
} | undefined;
|
|
212
|
+
plural?: (string | import('@i18n-micro/types').PluralFunc) | undefined;
|
|
213
|
+
disablePageLocales?: boolean | undefined;
|
|
214
|
+
fallbackLocale?: string | undefined;
|
|
215
|
+
localeCookie?: string | undefined;
|
|
216
|
+
debug?: boolean | undefined;
|
|
217
|
+
globalLocaleRoutes?: import('@i18n-micro/types').GlobalLocaleRoutes;
|
|
218
|
+
customRegexMatcher?: (string | RegExp) | undefined;
|
|
219
|
+
noPrefixRedirect?: boolean | undefined;
|
|
220
|
+
canonicalQueryWhitelist?: string[] | undefined;
|
|
221
|
+
excludePatterns?: (string | RegExp)[] | undefined;
|
|
222
|
+
routeLocales?: Record<string, string[]> | undefined;
|
|
223
|
+
routeDisableMeta?: Record<string, boolean | string[]> | undefined;
|
|
224
|
+
missingWarn?: boolean | undefined;
|
|
225
|
+
experimental?: {
|
|
226
|
+
i18nPreviousPageFallback?: boolean | undefined;
|
|
227
|
+
hmr?: boolean | undefined;
|
|
228
|
+
} | undefined;
|
|
229
|
+
}>;
|
|
230
|
+
selectedFileContent: import('vue').Ref<TranslationContent, TranslationContent>;
|
|
231
|
+
bridge: Readonly<import('vue').Ref<{
|
|
232
|
+
readonly getLocalesAndTranslations: () => Promise<LocaleData>;
|
|
233
|
+
readonly getConfigs: () => Promise<ModuleOptions>;
|
|
234
|
+
readonly saveTranslation: (filePath: string, content: TranslationContent) => Promise<void>;
|
|
235
|
+
readonly onLocalesUpdate: (callback: (data: LocaleData) => void) => () => void;
|
|
236
|
+
} | null, {
|
|
237
|
+
readonly getLocalesAndTranslations: () => Promise<LocaleData>;
|
|
238
|
+
readonly getConfigs: () => Promise<ModuleOptions>;
|
|
239
|
+
readonly saveTranslation: (filePath: string, content: TranslationContent) => Promise<void>;
|
|
240
|
+
readonly onLocalesUpdate: (callback: (data: LocaleData) => void) => () => void;
|
|
241
|
+
} | null>>;
|
|
242
|
+
setBridge: (newBridge: I18nDevToolsBridge) => void;
|
|
243
|
+
init: () => Promise<void>;
|
|
244
|
+
handleFileSelected: (file: string) => void;
|
|
245
|
+
exportTranslations: () => Promise<void>;
|
|
246
|
+
importTranslations: (event: Event) => void;
|
|
247
|
+
getDefaultLocaleTranslation: () => TranslationContent;
|
|
248
|
+
saveCurrent: () => Promise<void>;
|
|
249
|
+
};
|
package/dist/env.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const I18nDevToolsElement: import('vue').VueElementConstructor<import('vue').ExtractPropTypes<{
|
|
2
|
+
bridge: {
|
|
3
|
+
type: import('vue').PropType<import('./types').I18nDevToolsBridge>;
|
|
4
|
+
required: false;
|
|
5
|
+
};
|
|
6
|
+
}>>;
|
|
7
|
+
export { I18nDevToolsElement };
|
|
8
|
+
/**
|
|
9
|
+
* Register the i18n-devtools-ui custom element
|
|
10
|
+
* This should be called once before using the element
|
|
11
|
+
*/
|
|
12
|
+
export declare function register(): void;
|
|
13
|
+
export type { I18nDevToolsBridge } from './bridge/interface';
|
|
14
|
+
export { createRpcClient } from './rpc/client';
|
|
15
|
+
export { setupRpcHost } from './rpc/host';
|
|
16
|
+
export type { JsonRpcRequest, JsonRpcResponse, JsonRpcEvent } from './rpc/types';
|
|
17
|
+
export type { LocaleData, TranslationContent, JSONValue, TreeNode, } from './types';
|