@antelopejs/dms-lang 0.5.3 → 0.7.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/README.md +5 -5
- package/dist/routes/translations.d.ts +14 -13
- package/dist/routes/translations.js +31 -29
- package/dist/routes/translations.js.map +1 -1
- package/dist/utils/query.d.ts +2 -0
- package/dist/utils/query.js +7 -0
- package/dist/utils/query.js.map +1 -0
- package/frontend-vue/.prettierignore +1 -0
- package/frontend-vue/.prettierrc +2 -2
- package/frontend-vue/app/build/components/KeyAddModal.vue +13 -5
- package/frontend-vue/app/build/components/KeyEditorDrawer.vue +24 -26
- package/frontend-vue/app/build/components/KeyRenameModal.vue +7 -1
- package/frontend-vue/app/build/components/KeyStatus.vue +4 -1
- package/frontend-vue/app/build/components/LanguageAddModal.vue +24 -4
- package/frontend-vue/app/build/components/LanguagePicker.vue +30 -10
- package/frontend-vue/app/build/components/LocaleTile.vue +2 -1
- package/frontend-vue/app/build/components/PlaceholderText.vue +10 -3
- package/frontend-vue/app/build/components/WorkspaceCreateModal.vue +10 -1
- package/frontend-vue/app/build/components/WorkspaceRenameModal.vue +23 -7
- package/frontend-vue/app/build/components/form/FormFieldRow.vue +12 -3
- package/frontend-vue/app/build/components/form/FormRows.vue +10 -2
- package/frontend-vue/app/build/components/form/WorkspaceDetailsFields.vue +2 -1
- package/frontend-vue/app/build/components/matrix/MatrixCell.vue +81 -20
- package/frontend-vue/app/build/components/matrix/MatrixColumns.vue +6 -3
- package/frontend-vue/app/build/components/matrix/MatrixGroupHeader.vue +1 -0
- package/frontend-vue/app/build/components/matrix/MatrixKeyCell.vue +2 -2
- package/frontend-vue/app/build/components/matrix/MatrixToolbar.vue +2 -1
- package/frontend-vue/app/build/components/queue/QueueActions.vue +12 -2
- package/frontend-vue/app/build/components/queue/QueueDone.vue +3 -0
- package/frontend-vue/app/build/components/queue/QueueEditor.vue +63 -19
- package/frontend-vue/app/build/components/queue/QueueHeader.vue +24 -5
- package/frontend-vue/app/build/components/queue/QueueUpNext.vue +1 -1
- package/frontend-vue/app/build/composables/useCellEditor.ts +12 -2
- package/frontend-vue/app/build/composables/useCellMoves.ts +1 -0
- package/frontend-vue/app/build/composables/useCellSaves.ts +1 -0
- package/frontend-vue/app/build/composables/useKeyPanel.ts +4 -0
- package/frontend-vue/app/build/composables/useKeySaves.ts +3 -0
- package/frontend-vue/app/build/composables/useMatrixColumns.ts +78 -0
- package/frontend-vue/app/build/composables/useMatrixExport.ts +1 -0
- package/frontend-vue/app/build/composables/useMatrixFilters.ts +6 -0
- package/frontend-vue/app/build/composables/useMatrixView.ts +4 -0
- package/frontend-vue/app/build/composables/useQueueOrphans.ts +2 -0
- package/frontend-vue/app/build/composables/useQueueSave.ts +4 -0
- package/frontend-vue/app/build/drawer/KeyLanguageField.vue +37 -19
- package/frontend-vue/app/build/drawer/fieldFocus.ts +24 -0
- package/frontend-vue/app/build/matrix/MatrixDoneBanner.vue +4 -1
- package/frontend-vue/app/build/matrix/MatrixLanguageHeader.vue +36 -36
- package/frontend-vue/app/build/matrix/MatrixNoRows.vue +48 -39
- package/frontend-vue/app/components/LanguageNamespaces.vue +39 -11
- package/frontend-vue/app/components/NamespaceCoverage.vue +35 -9
- package/frontend-vue/app/components/TranslationMatrix.vue +84 -63
- package/frontend-vue/app/components/TranslationQueue.vue +25 -9
- package/frontend-vue/app/components/WorkspaceDangerZone.vue +6 -2
- package/frontend-vue/app/components/WorkspaceGeneral.vue +34 -9
- package/frontend-vue/app/components/WorkspaceList.vue +63 -30
- package/frontend-vue/app/components/WorkspaceScope.vue +64 -31
- package/frontend-vue/app/composables/translation/useFirstRun.ts +1 -0
- package/frontend-vue/app/composables/translation/useKeyActions.ts +10 -0
- package/frontend-vue/app/composables/translation/useLangLinks.ts +1 -0
- package/frontend-vue/app/composables/translation/useLanguageActions.ts +11 -2
- package/frontend-vue/app/composables/translation/useLanguageQueue.ts +10 -0
- package/frontend-vue/app/composables/translation/useQueueDrafts.ts +4 -0
- package/frontend-vue/app/composables/translation/useQueueSession.ts +6 -0
- package/frontend-vue/app/composables/translation/useWorkspaceActions.ts +6 -0
- package/frontend-vue/app/composables/translation/useWorkspaceContext.ts +1 -0
- package/frontend-vue/app/composables/translation/useWorkspaceFill.ts +4 -0
- package/frontend-vue/app/composables/translation/useWorkspaceFlat.ts +11 -4
- package/frontend-vue/app/composables/translation/useWorkspaceLabel.ts +2 -0
- package/frontend-vue/app/composables/translation/useWorkspaceNameCheck.ts +5 -0
- package/frontend-vue/app/composables/translation/useWorkspaceRoute.ts +8 -0
- package/frontend-vue/app/utils/keySaveErrors.ts +1 -0
- package/frontend-vue/app/utils/keySaves.ts +1 -0
- package/frontend-vue/app/utils/matrixExport.ts +1 -0
- package/frontend-vue/app/utils/translations.ts +3 -3
- package/frontend-vue/app/utils/workspaceBackup.ts +1 -0
- package/frontend-vue/build/backend-boundary.ts +7 -2
- package/frontend-vue/eslint.config.mjs +20 -45
- package/frontend-vue/package.json +8 -8
- package/package.json +16 -16
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { useLangLinks } from '../composables/translation/useLangLinks'
|
|
3
|
+
import { useLanguageActions } from '../composables/translation/useLanguageActions'
|
|
4
|
+
import { useLocaleNames } from '../composables/translation/useLocaleNames'
|
|
5
|
+
import { useQueueSession } from '../composables/translation/useQueueSession'
|
|
6
|
+
import { useWorkspaceContext } from '../composables/translation/useWorkspaceContext'
|
|
7
|
+
import { useWorkspaceLabel } from '../composables/translation/useWorkspaceLabel'
|
|
8
|
+
import {
|
|
9
|
+
useWorkspaceFlat,
|
|
10
|
+
useWorkspaceFlatSync,
|
|
11
|
+
} from '../composables/translation/useWorkspaceFlat'
|
|
3
12
|
import UButton from '@nuxt/ui/components/Button.vue'
|
|
4
13
|
import UDropdownMenu from '@nuxt/ui/components/DropdownMenu.vue'
|
|
5
14
|
import { useDmsRouter } from '#dms/frontend-module'
|
|
@@ -142,22 +151,23 @@ const canManageLanguage = computed(
|
|
|
142
151
|
!isBase.value,
|
|
143
152
|
)
|
|
144
153
|
|
|
145
|
-
usePageHeaderActions(() =>
|
|
146
|
-
canManageLanguage.value ? languageMenu() : null,
|
|
147
|
-
)
|
|
154
|
+
usePageHeaderActions(() => (canManageLanguage.value ? languageMenu() : null))
|
|
148
155
|
|
|
149
156
|
onBeforeUnmount(() => clearTimeout(urlTimer))
|
|
150
157
|
</script>
|
|
151
158
|
|
|
152
159
|
<template>
|
|
153
160
|
<template v-if="!isUnknown">
|
|
154
|
-
<
|
|
161
|
+
<DmsCardPanel
|
|
162
|
+
v-if="view === 'loading'"
|
|
163
|
+
padded
|
|
164
|
+
>
|
|
155
165
|
<div class="space-y-4">
|
|
156
166
|
<USkeleton class="h-5 w-1/3" />
|
|
157
167
|
<USkeleton class="h-14 w-full" />
|
|
158
168
|
<USkeleton class="h-24 w-full" />
|
|
159
169
|
</div>
|
|
160
|
-
</
|
|
170
|
+
</DmsCardPanel>
|
|
161
171
|
|
|
162
172
|
<DmsEmptyState
|
|
163
173
|
v-else-if="view === 'unknown'"
|
|
@@ -197,16 +207,22 @@ onBeforeUnmount(() => clearTimeout(urlTimer))
|
|
|
197
207
|
]"
|
|
198
208
|
/>
|
|
199
209
|
|
|
200
|
-
<
|
|
210
|
+
<DmsCardPanel
|
|
211
|
+
v-else
|
|
212
|
+
:padded="false"
|
|
213
|
+
>
|
|
201
214
|
<div ref="root">
|
|
202
215
|
<QueueHeader />
|
|
203
216
|
<QueueDone v-if="isFinished || !current" />
|
|
204
217
|
<template v-else>
|
|
205
|
-
<QueueEditor
|
|
218
|
+
<QueueEditor
|
|
219
|
+
ref="editor"
|
|
220
|
+
:row="current"
|
|
221
|
+
/>
|
|
206
222
|
<QueueActions />
|
|
207
223
|
<QueueUpNext />
|
|
208
224
|
</template>
|
|
209
225
|
</div>
|
|
210
|
-
</
|
|
226
|
+
</DmsCardPanel>
|
|
211
227
|
</template>
|
|
212
228
|
</template>
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useLangLinks } from '../composables/translation/useLangLinks'
|
|
3
|
+
import { useWorkspaceActions } from '../composables/translation/useWorkspaceActions'
|
|
4
|
+
import { useWorkspaceContext } from '../composables/translation/useWorkspaceContext'
|
|
5
|
+
import { useWorkspaceRoute } from '../composables/translation/useWorkspaceRoute'
|
|
2
6
|
const { t } = useI18n()
|
|
3
7
|
const { current, canManage, isUnknown, allows } = useWorkspaceContext()
|
|
4
8
|
const { renameWorkspace, deleteWorkspace, downloadBackup } =
|
|
@@ -25,7 +29,7 @@ function remove() {
|
|
|
25
29
|
</script>
|
|
26
30
|
|
|
27
31
|
<template>
|
|
28
|
-
<
|
|
32
|
+
<DmsSectionPanel
|
|
29
33
|
v-if="canManage && !isUnknown"
|
|
30
34
|
danger
|
|
31
35
|
:title="$t('dms_lang.workspace.danger_title')"
|
|
@@ -77,5 +81,5 @@ function remove() {
|
|
|
77
81
|
@click="remove"
|
|
78
82
|
/>
|
|
79
83
|
</DmsFieldRow>
|
|
80
|
-
</
|
|
84
|
+
</DmsSectionPanel>
|
|
81
85
|
</template>
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useLanguageActions } from '../composables/translation/useLanguageActions'
|
|
3
|
+
import { useLocaleNames } from '../composables/translation/useLocaleNames'
|
|
4
|
+
import {
|
|
5
|
+
useWorkspaceActions,
|
|
6
|
+
useWorkspaceTypes,
|
|
7
|
+
} from '../composables/translation/useWorkspaceActions'
|
|
8
|
+
import { useWorkspaceContext } from '../composables/translation/useWorkspaceContext'
|
|
9
|
+
import { useWorkspaceRoute } from '../composables/translation/useWorkspaceRoute'
|
|
2
10
|
import UButton from '@nuxt/ui/components/Button.vue'
|
|
3
11
|
import type { WorkspaceType } from '../types/lang'
|
|
4
12
|
import type { SaveState } from '../utils/keySaves'
|
|
@@ -113,7 +121,7 @@ usePageHeaderActions(() =>
|
|
|
113
121
|
</script>
|
|
114
122
|
|
|
115
123
|
<template>
|
|
116
|
-
<
|
|
124
|
+
<DmsSectionPanel
|
|
117
125
|
v-if="!isUnknown"
|
|
118
126
|
:title="$t('dms_lang.workspace.general_title')"
|
|
119
127
|
:description="
|
|
@@ -152,7 +160,7 @@ usePageHeaderActions(() =>
|
|
|
152
160
|
:label="$t('dms_lang.workspace_details.description_label')"
|
|
153
161
|
:description="$t('dms_lang.workspace_details.description_help')"
|
|
154
162
|
>
|
|
155
|
-
<
|
|
163
|
+
<DmsInputTextarea
|
|
156
164
|
v-if="canEditDetails"
|
|
157
165
|
v-model="description"
|
|
158
166
|
:rows="DESCRIPTION_ROWS"
|
|
@@ -165,7 +173,10 @@ usePageHeaderActions(() =>
|
|
|
165
173
|
@focus="isTypingDescription = true"
|
|
166
174
|
@blur="saveDescription"
|
|
167
175
|
/>
|
|
168
|
-
<p
|
|
176
|
+
<p
|
|
177
|
+
v-else
|
|
178
|
+
class="text-highlighted text-sm"
|
|
179
|
+
>
|
|
169
180
|
{{ current?.description || '—' }}
|
|
170
181
|
</p>
|
|
171
182
|
<template #label-extra>
|
|
@@ -181,12 +192,15 @@ usePageHeaderActions(() =>
|
|
|
181
192
|
>
|
|
182
193
|
<DmsSegmentedSelect
|
|
183
194
|
:model-value="current?.type"
|
|
184
|
-
@update:model-value="pickType"
|
|
185
195
|
:items="typeItems"
|
|
186
196
|
:disabled="!canEditDetails"
|
|
197
|
+
@update:model-value="pickType"
|
|
187
198
|
/>
|
|
188
199
|
<template #label-extra>
|
|
189
|
-
<DmsSaveStatus
|
|
200
|
+
<DmsSaveStatus
|
|
201
|
+
:state="stateOf('type')"
|
|
202
|
+
@retry="retries.type?.()"
|
|
203
|
+
/>
|
|
190
204
|
</template>
|
|
191
205
|
</DmsFieldRow>
|
|
192
206
|
</template>
|
|
@@ -196,7 +210,10 @@ usePageHeaderActions(() =>
|
|
|
196
210
|
:label="$t('dms_lang.workspace.base_label')"
|
|
197
211
|
:description="$t('dms_lang.workspace.base_help')"
|
|
198
212
|
>
|
|
199
|
-
<USkeleton
|
|
213
|
+
<USkeleton
|
|
214
|
+
v-if="!current"
|
|
215
|
+
class="h-8 w-64"
|
|
216
|
+
/>
|
|
200
217
|
<USelect
|
|
201
218
|
v-else-if="canManageLanguages"
|
|
202
219
|
v-model="baseModel"
|
|
@@ -204,14 +221,22 @@ usePageHeaderActions(() =>
|
|
|
204
221
|
class="w-full max-w-xs"
|
|
205
222
|
>
|
|
206
223
|
<template #leading>
|
|
207
|
-
<LocaleTile
|
|
224
|
+
<LocaleTile
|
|
225
|
+
:code="baseLocale"
|
|
226
|
+
size="sm"
|
|
227
|
+
is-base
|
|
228
|
+
/>
|
|
208
229
|
</template>
|
|
209
230
|
</USelect>
|
|
210
231
|
<span
|
|
211
232
|
v-else
|
|
212
233
|
class="text-highlighted inline-flex items-center gap-2 text-sm"
|
|
213
234
|
>
|
|
214
|
-
<LocaleTile
|
|
235
|
+
<LocaleTile
|
|
236
|
+
:code="baseLocale"
|
|
237
|
+
size="sm"
|
|
238
|
+
is-base
|
|
239
|
+
/>
|
|
215
240
|
{{ fullName(baseLocale) }}
|
|
216
241
|
<span class="text-dimmed font-mono text-xs">
|
|
217
242
|
{{ baseLocale }}
|
|
@@ -239,5 +264,5 @@ usePageHeaderActions(() =>
|
|
|
239
264
|
@click="addLanguage()"
|
|
240
265
|
/>
|
|
241
266
|
</DmsFieldRow>
|
|
242
|
-
</
|
|
267
|
+
</DmsSectionPanel>
|
|
243
268
|
</template>
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useLangFormat } from '../composables/translation/useLangFormat'
|
|
3
|
+
import {
|
|
4
|
+
PAGE_ACTIONS,
|
|
5
|
+
useLangLinks,
|
|
6
|
+
} from '../composables/translation/useLangLinks'
|
|
7
|
+
import {
|
|
8
|
+
useWorkspaceActions,
|
|
9
|
+
useWorkspaceTypes,
|
|
10
|
+
} from '../composables/translation/useWorkspaceActions'
|
|
11
|
+
import { useWorkspaceContext } from '../composables/translation/useWorkspaceContext'
|
|
12
|
+
import { useWorkspaceLabel } from '../composables/translation/useWorkspaceLabel'
|
|
13
|
+
import { useWorkspaceRoute } from '../composables/translation/useWorkspaceRoute'
|
|
2
14
|
import UButton from '@nuxt/ui/components/Button.vue'
|
|
3
15
|
import type { WorkspaceKind, WorkspaceStats } from '../types/lang'
|
|
4
16
|
import { COVERAGE_TEXT_CLASSES, coverageTone } from '../utils/coverage'
|
|
@@ -9,7 +21,10 @@ import {
|
|
|
9
21
|
} from '../utils/workspaces'
|
|
10
22
|
import type { WorkspaceSort } from '../utils/workspaces'
|
|
11
23
|
import LocaleTile from '../build/components/LocaleTile.vue'
|
|
12
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
useI18nWorkspaces,
|
|
26
|
+
useWorkspaceSummary,
|
|
27
|
+
} from '../composables/translation/useI18nWorkspaces'
|
|
13
28
|
|
|
14
29
|
interface WorkspaceStat {
|
|
15
30
|
id: string
|
|
@@ -153,10 +168,7 @@ function kindPill(workspace: WorkspaceStats): WorkspacePill {
|
|
|
153
168
|
}
|
|
154
169
|
|
|
155
170
|
function labelsOf(workspace: WorkspaceStats): string[] {
|
|
156
|
-
return [
|
|
157
|
-
kindPill(workspace).label,
|
|
158
|
-
labelOf(workspace),
|
|
159
|
-
]
|
|
171
|
+
return [kindPill(workspace).label, labelOf(workspace)]
|
|
160
172
|
}
|
|
161
173
|
|
|
162
174
|
function localeCodes(workspace: WorkspaceStats): string[] {
|
|
@@ -184,16 +196,17 @@ function create() {
|
|
|
184
196
|
return createWorkspace()
|
|
185
197
|
}
|
|
186
198
|
|
|
187
|
-
usePageHeaderActions(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
199
|
+
usePageHeaderActions(
|
|
200
|
+
() =>
|
|
201
|
+
canCreate.value
|
|
202
|
+
? h(UButton, {
|
|
203
|
+
label: t('dms_lang.workspace_import.open'),
|
|
204
|
+
icon: 'i-ph-upload-simple',
|
|
205
|
+
color: 'neutral',
|
|
206
|
+
variant: 'outline',
|
|
207
|
+
onClick: importWorkspace,
|
|
208
|
+
})
|
|
209
|
+
: null,
|
|
197
210
|
{ order: -1 },
|
|
198
211
|
)
|
|
199
212
|
|
|
@@ -206,12 +219,11 @@ watch(
|
|
|
206
219
|
},
|
|
207
220
|
{ immediate: true },
|
|
208
221
|
)
|
|
209
|
-
|
|
210
222
|
</script>
|
|
211
223
|
|
|
212
224
|
<template>
|
|
213
225
|
<div class="space-y-4">
|
|
214
|
-
<
|
|
226
|
+
<DmsNoticeBanner
|
|
215
227
|
v-if="isLoaded && !editable"
|
|
216
228
|
tone="info"
|
|
217
229
|
icon="i-ph-lock-simple"
|
|
@@ -221,7 +233,7 @@ watch(
|
|
|
221
233
|
<template #actions>
|
|
222
234
|
<DmsCopyButton :value="EDITABLE_CONFIG" />
|
|
223
235
|
</template>
|
|
224
|
-
</
|
|
236
|
+
</DmsNoticeBanner>
|
|
225
237
|
|
|
226
238
|
<DmsEmptyState
|
|
227
239
|
v-if="hasError && !isLoaded"
|
|
@@ -242,7 +254,10 @@ watch(
|
|
|
242
254
|
]"
|
|
243
255
|
/>
|
|
244
256
|
|
|
245
|
-
<div
|
|
257
|
+
<div
|
|
258
|
+
v-if="hasToolbar"
|
|
259
|
+
class="flex flex-wrap items-center gap-2"
|
|
260
|
+
>
|
|
246
261
|
<UInput
|
|
247
262
|
v-model="search"
|
|
248
263
|
icon="i-ph-magnifying-glass"
|
|
@@ -281,16 +296,20 @@ watch(
|
|
|
281
296
|
|
|
282
297
|
<div class="grid gap-4 lg:grid-cols-2">
|
|
283
298
|
<template v-if="!isLoaded && !hasError">
|
|
284
|
-
<
|
|
299
|
+
<DmsCardPanel
|
|
300
|
+
v-for="index in 4"
|
|
301
|
+
:key="index"
|
|
302
|
+
padded
|
|
303
|
+
>
|
|
285
304
|
<div class="space-y-4">
|
|
286
305
|
<USkeleton class="h-6 w-1/2" />
|
|
287
306
|
<USkeleton class="h-10 w-full" />
|
|
288
307
|
<USkeleton class="h-6 w-2/3" />
|
|
289
308
|
</div>
|
|
290
|
-
</
|
|
309
|
+
</DmsCardPanel>
|
|
291
310
|
</template>
|
|
292
311
|
|
|
293
|
-
<
|
|
312
|
+
<DmsCardPanel
|
|
294
313
|
v-for="workspace in shown"
|
|
295
314
|
:key="workspace.id"
|
|
296
315
|
:padded="false"
|
|
@@ -314,8 +333,8 @@ watch(
|
|
|
314
333
|
v-bind="kindPill(workspace)"
|
|
315
334
|
/>
|
|
316
335
|
<DmsStatusPill
|
|
317
|
-
dot="none"
|
|
318
336
|
v-if="workspace.id === selectedWorkspace"
|
|
337
|
+
dot="none"
|
|
319
338
|
tone="primary"
|
|
320
339
|
size="sm"
|
|
321
340
|
icon="i-ph-check"
|
|
@@ -340,8 +359,15 @@ watch(
|
|
|
340
359
|
</div>
|
|
341
360
|
|
|
342
361
|
<dl class="grid grid-cols-4 gap-3">
|
|
343
|
-
<div
|
|
344
|
-
|
|
362
|
+
<div
|
|
363
|
+
v-for="stat in statsOf(workspace)"
|
|
364
|
+
:key="stat.id"
|
|
365
|
+
>
|
|
366
|
+
<DmsEyebrowLabel
|
|
367
|
+
as="dt"
|
|
368
|
+
:label="stat.label"
|
|
369
|
+
size="xs"
|
|
370
|
+
/>
|
|
345
371
|
<dd
|
|
346
372
|
class="text-highlighted font-mono text-lg font-semibold"
|
|
347
373
|
:class="stat.tone"
|
|
@@ -355,7 +381,7 @@ watch(
|
|
|
355
381
|
<span
|
|
356
382
|
v-for="code in localeCodes(workspace)"
|
|
357
383
|
:key="code"
|
|
358
|
-
class="border-default inline-flex items-center gap-1.5 rounded-md border py-0.5
|
|
384
|
+
class="border-default inline-flex items-center gap-1.5 rounded-md border py-0.5 pl-0.5 pr-2 font-mono text-xs"
|
|
359
385
|
>
|
|
360
386
|
<LocaleTile
|
|
361
387
|
:code="code"
|
|
@@ -363,7 +389,10 @@ watch(
|
|
|
363
389
|
:is-base="code === workspace.baseLocale"
|
|
364
390
|
/>
|
|
365
391
|
{{ code }}
|
|
366
|
-
<span
|
|
392
|
+
<span
|
|
393
|
+
v-if="code === workspace.baseLocale"
|
|
394
|
+
class="text-dimmed"
|
|
395
|
+
>
|
|
367
396
|
{{ $t('dms_lang.common.base') }}
|
|
368
397
|
</span>
|
|
369
398
|
<span
|
|
@@ -420,15 +449,19 @@ watch(
|
|
|
420
449
|
/>
|
|
421
450
|
</div>
|
|
422
451
|
</template>
|
|
423
|
-
</
|
|
452
|
+
</DmsCardPanel>
|
|
424
453
|
|
|
425
454
|
<button
|
|
426
455
|
v-if="isLoaded && canCreate"
|
|
427
456
|
type="button"
|
|
428
|
-
class="border-default text-muted hover:border-primary/50 hover:text-highlighted flex min-h-56 flex-col items-center justify-center gap-3
|
|
457
|
+
class="border-default text-muted hover:border-primary/50 hover:text-highlighted rounded-(--dms-radius-card) flex min-h-56 flex-col items-center justify-center gap-3 border border-dashed p-6 text-center transition-colors"
|
|
429
458
|
@click="create"
|
|
430
459
|
>
|
|
431
|
-
<DmsIconWell
|
|
460
|
+
<DmsIconWell
|
|
461
|
+
icon="i-ph-plus"
|
|
462
|
+
tone="primary"
|
|
463
|
+
size="lg"
|
|
464
|
+
/>
|
|
432
465
|
<span class="text-highlighted text-sm font-semibold">
|
|
433
466
|
{{ $t('dms_lang.workspaces.new') }}
|
|
434
467
|
</span>
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useFirstRun } from '../composables/translation/useFirstRun'
|
|
3
|
+
import { useI18nWorkspaces } from '../composables/translation/useI18nWorkspaces'
|
|
4
|
+
import { useLangFormat } from '../composables/translation/useLangFormat'
|
|
5
|
+
import {
|
|
6
|
+
PAGE_ACTIONS,
|
|
7
|
+
PAGE_ACTION_QUERY,
|
|
8
|
+
useLangLinks,
|
|
9
|
+
} from '../composables/translation/useLangLinks'
|
|
10
|
+
import { useLanguageActions } from '../composables/translation/useLanguageActions'
|
|
11
|
+
import { useLocaleNames } from '../composables/translation/useLocaleNames'
|
|
12
|
+
import { useWorkspaceTypes } from '../composables/translation/useWorkspaceActions'
|
|
13
|
+
import { useWorkspaceContext } from '../composables/translation/useWorkspaceContext'
|
|
14
|
+
import { useWorkspaceFill } from '../composables/translation/useWorkspaceFill'
|
|
15
|
+
import { useWorkspaceLabel } from '../composables/translation/useWorkspaceLabel'
|
|
16
|
+
import { useWorkspaceRoute } from '../composables/translation/useWorkspaceRoute'
|
|
2
17
|
import { useLangChanges } from '../composables/translation/useWorkspaceFlat'
|
|
3
18
|
import type { DropdownMenuItem } from '@nuxt/ui'
|
|
4
19
|
import type { WorkspaceSummary } from '../types/lang'
|
|
@@ -13,23 +28,12 @@ const MENU_FILTER_FIELDS = ['label', 'description', 'workspaceId', 'summary']
|
|
|
13
28
|
const { t } = useI18n()
|
|
14
29
|
const { formatCount } = useLangFormat()
|
|
15
30
|
const { workspaces, editable, isLoaded, whenLoaded } = useI18nWorkspaces()
|
|
16
|
-
const {
|
|
17
|
-
|
|
18
|
-
isEditable,
|
|
19
|
-
isModules,
|
|
20
|
-
isAdded,
|
|
21
|
-
isUnknown,
|
|
22
|
-
isResolved,
|
|
23
|
-
} = useWorkspaceContext()
|
|
31
|
+
const { current, isEditable, isModules, isAdded, isUnknown, isResolved } =
|
|
32
|
+
useWorkspaceContext()
|
|
24
33
|
const { labelOf } = useWorkspaceLabel()
|
|
25
34
|
useLangChanges()
|
|
26
|
-
const {
|
|
27
|
-
|
|
28
|
-
queryWorkspace,
|
|
29
|
-
pageAction,
|
|
30
|
-
clearPageAction,
|
|
31
|
-
currentPage,
|
|
32
|
-
} = useWorkspaceRoute()
|
|
35
|
+
const { switchLink, queryWorkspace, pageAction, clearPageAction, currentPage } =
|
|
36
|
+
useWorkspaceRoute()
|
|
33
37
|
|
|
34
38
|
/** What the bar says about the workspace shown, from the workspace list. */
|
|
35
39
|
const scope = computed(() => ({
|
|
@@ -189,9 +193,12 @@ watch(
|
|
|
189
193
|
</script>
|
|
190
194
|
|
|
191
195
|
<template>
|
|
192
|
-
<div
|
|
196
|
+
<div
|
|
197
|
+
v-if="!isUnknown"
|
|
198
|
+
class="space-y-3"
|
|
199
|
+
>
|
|
193
200
|
<div
|
|
194
|
-
class="dms-card flex flex-wrap items-center gap-x-3.5 gap-y-2.5 py-2 pr-3.5
|
|
201
|
+
class="dms-card flex flex-wrap items-center gap-x-3.5 gap-y-2.5 py-2 pl-2 pr-3.5"
|
|
195
202
|
>
|
|
196
203
|
<UDropdownMenu
|
|
197
204
|
:items="menuItems"
|
|
@@ -224,7 +231,7 @@ watch(
|
|
|
224
231
|
</template>
|
|
225
232
|
<button
|
|
226
233
|
type="button"
|
|
227
|
-
class="hover:bg-elevated/60 hover:border-default flex h-11 items-center gap-2.5 rounded-md border border-transparent
|
|
234
|
+
class="hover:bg-elevated/60 hover:border-default flex h-11 items-center gap-2.5 rounded-md border border-transparent pl-1.5 pr-2.5 text-left transition-colors"
|
|
228
235
|
:aria-label="$t('dms_lang.scope.switch')"
|
|
229
236
|
>
|
|
230
237
|
<DmsIconWell
|
|
@@ -233,16 +240,25 @@ watch(
|
|
|
233
240
|
size="sm"
|
|
234
241
|
/>
|
|
235
242
|
<span class="grid gap-px">
|
|
236
|
-
<
|
|
237
|
-
|
|
243
|
+
<DmsEyebrowLabel
|
|
244
|
+
:label="$t('dms_lang.scope.workspace')"
|
|
245
|
+
size="xs"
|
|
246
|
+
/>
|
|
247
|
+
<USkeleton
|
|
248
|
+
v-if="!current"
|
|
249
|
+
class="h-4 w-24"
|
|
250
|
+
/>
|
|
238
251
|
<span
|
|
239
252
|
v-else
|
|
240
|
-
class="text-highlighted text-sm leading-tight
|
|
253
|
+
class="text-highlighted text-sm font-semibold leading-tight"
|
|
241
254
|
>
|
|
242
255
|
{{ workspaceLabel(current) }}
|
|
243
256
|
</span>
|
|
244
257
|
</span>
|
|
245
|
-
<UIcon
|
|
258
|
+
<UIcon
|
|
259
|
+
name="i-ph-caret-up-down"
|
|
260
|
+
class="text-dimmed ml-1 size-4"
|
|
261
|
+
/>
|
|
246
262
|
</button>
|
|
247
263
|
</UDropdownMenu>
|
|
248
264
|
|
|
@@ -258,7 +274,10 @@ watch(
|
|
|
258
274
|
<USkeleton class="h-4 w-16" />
|
|
259
275
|
</div>
|
|
260
276
|
|
|
261
|
-
<div
|
|
277
|
+
<div
|
|
278
|
+
v-else
|
|
279
|
+
class="flex flex-wrap items-center gap-x-4 gap-y-1 text-sm"
|
|
280
|
+
>
|
|
262
281
|
<DmsStatusPill
|
|
263
282
|
dot="none"
|
|
264
283
|
:tone="isEditable ? 'success' : 'warning'"
|
|
@@ -287,7 +306,10 @@ watch(
|
|
|
287
306
|
:to="baseMissingLink"
|
|
288
307
|
class="text-warning inline-flex items-center gap-1 hover:underline"
|
|
289
308
|
>
|
|
290
|
-
<UIcon
|
|
309
|
+
<UIcon
|
|
310
|
+
name="i-ph-warning"
|
|
311
|
+
class="size-4"
|
|
312
|
+
/>
|
|
291
313
|
{{
|
|
292
314
|
$t(
|
|
293
315
|
'dms_lang.scope.base_missing',
|
|
@@ -301,12 +323,18 @@ watch(
|
|
|
301
323
|
class="text-muted inline-flex items-center gap-1.5"
|
|
302
324
|
>
|
|
303
325
|
{{ $t('dms_lang.scope.base') }}
|
|
304
|
-
<LocaleTile
|
|
326
|
+
<LocaleTile
|
|
327
|
+
:code="scope.defaultLocale"
|
|
328
|
+
size="sm"
|
|
329
|
+
/>
|
|
305
330
|
<span class="font-mono text-xs">{{ scope.defaultLocale }}</span>
|
|
306
331
|
</span>
|
|
307
332
|
</div>
|
|
308
333
|
|
|
309
|
-
<USkeleton
|
|
334
|
+
<USkeleton
|
|
335
|
+
v-if="!current"
|
|
336
|
+
class="ml-auto h-3 w-40"
|
|
337
|
+
/>
|
|
310
338
|
<p
|
|
311
339
|
v-else
|
|
312
340
|
class="text-dimmed ml-auto min-w-0 truncate font-mono text-xs"
|
|
@@ -316,7 +344,7 @@ watch(
|
|
|
316
344
|
</p>
|
|
317
345
|
</div>
|
|
318
346
|
|
|
319
|
-
<
|
|
347
|
+
<DmsNoticeBanner
|
|
320
348
|
v-if="showReadOnlyServer"
|
|
321
349
|
tone="warning"
|
|
322
350
|
size="sm"
|
|
@@ -325,7 +353,10 @@ watch(
|
|
|
325
353
|
:description="$t('dms_lang.scope.server_read_only_description')"
|
|
326
354
|
/>
|
|
327
355
|
|
|
328
|
-
<
|
|
356
|
+
<DmsCardPanel
|
|
357
|
+
v-if="isFirstRun"
|
|
358
|
+
:padded="false"
|
|
359
|
+
>
|
|
329
360
|
<DmsEmptyState
|
|
330
361
|
icon="i-ph-rocket-launch"
|
|
331
362
|
tone="primary"
|
|
@@ -335,10 +366,12 @@ watch(
|
|
|
335
366
|
:actions="firstRunActions"
|
|
336
367
|
>
|
|
337
368
|
<template #content>
|
|
338
|
-
<DmsCheckList
|
|
369
|
+
<DmsCheckList
|
|
370
|
+
size="sm"
|
|
371
|
+
:items="firstRunSteps"
|
|
372
|
+
/>
|
|
339
373
|
</template>
|
|
340
374
|
</DmsEmptyState>
|
|
341
|
-
</
|
|
375
|
+
</DmsCardPanel>
|
|
342
376
|
</div>
|
|
343
377
|
</template>
|
|
344
|
-
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import KeyAddModal from '../../build/components/KeyAddModal.vue'
|
|
2
2
|
import KeyRenameModal from '../../build/components/KeyRenameModal.vue'
|
|
3
3
|
import type { FlatTranslationRow, KeyRowResponse } from '../../types/lang'
|
|
4
|
+
import {
|
|
5
|
+
isLocaleValueMissing,
|
|
6
|
+
nextSiblingPath,
|
|
7
|
+
stringValue,
|
|
8
|
+
} from '../../utils/translations.ts'
|
|
9
|
+
import { useI18nWorkspaces } from './useI18nWorkspaces.ts'
|
|
10
|
+
import { useMutationToast } from './useMutationToast.ts'
|
|
11
|
+
import { useWorkspaceContext } from './useWorkspaceContext.ts'
|
|
12
|
+
import { useWorkspaceFlat } from './useWorkspaceFlat.ts'
|
|
13
|
+
import { useWorkspaceLabel } from './useWorkspaceLabel.ts'
|
|
4
14
|
|
|
5
15
|
/** What the key actions share: the selected workspace, its keys and the DMS helpers. */
|
|
6
16
|
interface KeyActionsContext {
|
|
@@ -2,6 +2,11 @@ import type { Ref } from 'vue'
|
|
|
2
2
|
import { until } from '@vueuse/core'
|
|
3
3
|
import { useDmsState } from '#dms/frontend-module'
|
|
4
4
|
import LanguageAddModal from '../../build/components/LanguageAddModal.vue'
|
|
5
|
+
import { languageUrl, useI18nWorkspaces } from './useI18nWorkspaces.ts'
|
|
6
|
+
import { useLangFormat } from './useLangFormat.ts'
|
|
7
|
+
import { useLocaleNames } from './useLocaleNames.ts'
|
|
8
|
+
import { useWorkspaceContext } from './useWorkspaceContext.ts'
|
|
9
|
+
import { useWorkspaceFlat } from './useWorkspaceFlat.ts'
|
|
5
10
|
|
|
6
11
|
/** What the language actions share: the selected workspace and the DMS helpers. */
|
|
7
12
|
interface LanguageActionsContext {
|
|
@@ -53,7 +58,9 @@ async function openAddModal(context: LanguageActionsContext): Promise<boolean> {
|
|
|
53
58
|
props: {
|
|
54
59
|
workspace: context.workspaces.selectedWorkspace.value,
|
|
55
60
|
existing: codesOf(context),
|
|
56
|
-
baseName: context.nativeName(
|
|
61
|
+
baseName: context.nativeName(
|
|
62
|
+
context.current.value?.defaultLocale ?? '',
|
|
63
|
+
),
|
|
57
64
|
},
|
|
58
65
|
})
|
|
59
66
|
return (await modal.open()) === true
|
|
@@ -132,7 +139,9 @@ async function makeBase(
|
|
|
132
139
|
await context.translations.refresh()
|
|
133
140
|
notify(
|
|
134
141
|
context,
|
|
135
|
-
context.t('dms_lang.language_base.done', {
|
|
142
|
+
context.t('dms_lang.language_base.done', {
|
|
143
|
+
name: context.nativeName(code),
|
|
144
|
+
}),
|
|
136
145
|
)
|
|
137
146
|
return true
|
|
138
147
|
}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import type { ComputedRef } from 'vue'
|
|
2
2
|
import { useDmsRouter } from '#dms/frontend-module'
|
|
3
3
|
import type { FlatTranslationRow, FlatTranslations } from '../../types/lang'
|
|
4
|
+
import type { PageQuery } from './useLangLinks'
|
|
5
|
+
import { namespaceCoverage } from '../../utils/coverage.ts'
|
|
6
|
+
import {
|
|
7
|
+
isRowValueMissing,
|
|
8
|
+
namespaceOf,
|
|
9
|
+
needsReview,
|
|
10
|
+
} from '../../utils/translations.ts'
|
|
11
|
+
import { linkWithQuery } from './useLangLinks.ts'
|
|
12
|
+
import { useWorkspaceFlat } from './useWorkspaceFlat.ts'
|
|
13
|
+
import { useWorkspaceRoute } from './useWorkspaceRoute.ts'
|
|
4
14
|
|
|
5
15
|
export type QueueMode = 'missing' | 'issues' | 'all'
|
|
6
16
|
|
|
@@ -16,6 +16,10 @@ import {
|
|
|
16
16
|
type QueueDrafts,
|
|
17
17
|
type SentDraft,
|
|
18
18
|
} from '../../utils/queueDrafts'
|
|
19
|
+
import type { LangPage } from './useLangLinks'
|
|
20
|
+
import { useI18nWorkspaces } from './useI18nWorkspaces.ts'
|
|
21
|
+
import { langPageOf } from './useLangLinks.ts'
|
|
22
|
+
import { useWorkspaceRoute } from './useWorkspaceRoute.ts'
|
|
19
23
|
|
|
20
24
|
const QUEUE_PAGE: LangPage = 'language'
|
|
21
25
|
|