@antelopejs/dms-lang 0.0.7 → 0.1.1
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 +12 -6
- package/dist/pages/actions.d.ts +7 -0
- package/dist/pages/actions.js +15 -0
- package/dist/pages/actions.js.map +1 -0
- package/dist/pages/component-action.d.ts +2 -0
- package/dist/pages/component-action.js +10 -0
- package/dist/pages/component-action.js.map +1 -0
- package/dist/pages/header-actions.d.ts +9 -0
- package/dist/pages/header-actions.js +146 -0
- package/dist/pages/header-actions.js.map +1 -0
- package/dist/pages/index.d.ts +6 -0
- package/dist/pages/index.js +6 -0
- package/dist/pages/index.js.map +1 -1
- package/dist/pages/language.d.ts +10 -0
- package/dist/pages/language.js +89 -0
- package/dist/pages/language.js.map +1 -0
- package/dist/pages/languages-table.d.ts +2 -0
- package/dist/pages/languages-table.js +120 -0
- package/dist/pages/languages-table.js.map +1 -0
- package/dist/pages/module.d.ts +7 -1
- package/dist/pages/module.js +28 -2
- package/dist/pages/module.js.map +1 -1
- package/dist/pages/overview.d.ts +2 -1
- package/dist/pages/overview.js +83 -8
- package/dist/pages/overview.js.map +1 -1
- package/dist/pages/page-actions.d.ts +6 -0
- package/dist/pages/page-actions.js +10 -0
- package/dist/pages/page-actions.js.map +1 -0
- package/dist/pages/quick-actions.d.ts +1 -0
- package/dist/pages/quick-actions.js +56 -0
- package/dist/pages/quick-actions.js.map +1 -0
- package/dist/pages/translations.d.ts +7 -1
- package/dist/pages/translations.js +47 -10
- package/dist/pages/translations.js.map +1 -1
- package/dist/pages/workspace-guard.d.ts +1 -0
- package/dist/pages/workspace-guard.js +35 -0
- package/dist/pages/workspace-guard.js.map +1 -0
- package/dist/pages/workspace.d.ts +18 -0
- package/dist/pages/workspace.js +162 -0
- package/dist/pages/workspace.js.map +1 -0
- package/dist/pages/workspaces.d.ts +14 -0
- package/dist/pages/workspaces.js +88 -0
- package/dist/pages/workspaces.js.map +1 -0
- package/dist/routes/publicLocales.d.ts +3 -2
- package/dist/routes/publicLocales.js +39 -18
- package/dist/routes/publicLocales.js.map +1 -1
- package/dist/routes/translations.d.ts +59 -63
- package/dist/routes/translations.js +400 -119
- package/dist/routes/translations.js.map +1 -1
- package/dist/utils/announce.d.ts +9 -0
- package/dist/utils/announce.js +29 -0
- package/dist/utils/announce.js.map +1 -0
- package/dist/utils/blocks.d.ts +8 -0
- package/dist/utils/blocks.js +213 -0
- package/dist/utils/blocks.js.map +1 -0
- package/dist/utils/body.d.ts +1 -0
- package/dist/utils/body.js +21 -0
- package/dist/utils/body.js.map +1 -0
- package/dist/utils/cache.d.ts +3 -0
- package/dist/utils/cache.js +32 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/catalog.d.ts +7 -0
- package/dist/utils/catalog.js +62 -0
- package/dist/utils/catalog.js.map +1 -0
- package/dist/utils/constants.d.ts +6 -0
- package/dist/utils/constants.js +10 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/coverage.d.ts +2 -0
- package/dist/utils/coverage.js +11 -0
- package/dist/utils/coverage.js.map +1 -0
- package/dist/utils/dialogs.d.ts +7 -0
- package/dist/utils/dialogs.js +103 -0
- package/dist/utils/dialogs.js.map +1 -0
- package/dist/utils/errors.d.ts +40 -0
- package/dist/utils/errors.js +60 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/export.d.ts +17 -0
- package/dist/utils/export.js +129 -0
- package/dist/utils/export.js.map +1 -0
- package/dist/utils/json.d.ts +10 -1
- package/dist/utils/json.js +127 -19
- package/dist/utils/json.js.map +1 -1
- package/dist/utils/key-stores.d.ts +3 -0
- package/dist/utils/key-stores.js +24 -0
- package/dist/utils/key-stores.js.map +1 -0
- package/dist/utils/keys.d.ts +23 -0
- package/dist/utils/keys.js +252 -0
- package/dist/utils/keys.js.map +1 -0
- package/dist/utils/languages.d.ts +27 -0
- package/dist/utils/languages.js +121 -0
- package/dist/utils/languages.js.map +1 -0
- package/dist/utils/locale-codes.d.ts +5 -0
- package/dist/utils/locale-codes.js +56 -0
- package/dist/utils/locale-codes.js.map +1 -0
- package/dist/utils/locale-discovery.d.ts +1 -0
- package/dist/utils/locale-discovery.js +19 -1
- package/dist/utils/locale-discovery.js.map +1 -1
- package/dist/utils/message-check.d.ts +1 -0
- package/dist/utils/message-check.js +93 -0
- package/dist/utils/message-check.js.map +1 -0
- package/dist/utils/message-syntax.d.ts +6 -0
- package/dist/utils/message-syntax.js +38 -0
- package/dist/utils/message-syntax.js.map +1 -0
- package/dist/utils/namespaces.d.ts +12 -0
- package/dist/utils/namespaces.js +52 -0
- package/dist/utils/namespaces.js.map +1 -0
- package/dist/utils/notices.d.ts +4 -0
- package/dist/utils/notices.js +60 -0
- package/dist/utils/notices.js.map +1 -0
- package/dist/utils/own.d.ts +2 -3
- package/dist/utils/own.js +17 -57
- package/dist/utils/own.js.map +1 -1
- package/dist/utils/public-url.d.ts +8 -0
- package/dist/utils/public-url.js +87 -0
- package/dist/utils/public-url.js.map +1 -0
- package/dist/utils/registry.d.ts +3 -1
- package/dist/utils/registry.js +26 -10
- package/dist/utils/registry.js.map +1 -1
- package/dist/utils/resolve.d.ts +18 -15
- package/dist/utils/resolve.js +98 -151
- package/dist/utils/resolve.js.map +1 -1
- package/dist/utils/review.d.ts +5 -0
- package/dist/utils/review.js +64 -0
- package/dist/utils/review.js.map +1 -0
- package/dist/utils/snippets.d.ts +7 -0
- package/dist/utils/snippets.js +129 -0
- package/dist/utils/snippets.js.map +1 -0
- package/dist/utils/summary.d.ts +23 -0
- package/dist/utils/summary.js +65 -0
- package/dist/utils/summary.js.map +1 -0
- package/dist/utils/tree.d.ts +2 -17
- package/dist/utils/tree.js +21 -126
- package/dist/utils/tree.js.map +1 -1
- package/dist/utils/workspaces.d.ts +45 -15
- package/dist/utils/workspaces.js +256 -164
- package/dist/utils/workspaces.js.map +1 -1
- package/dist/validation/key.schema.d.ts +71 -0
- package/dist/validation/key.schema.js +67 -0
- package/dist/validation/key.schema.js.map +1 -0
- package/dist/validation/query.schema.d.ts +17 -0
- package/dist/validation/query.schema.js +44 -0
- package/dist/validation/query.schema.js.map +1 -0
- package/dist/validation/validate.d.ts +2 -0
- package/dist/validation/validate.js +24 -0
- package/dist/validation/validate.js.map +1 -0
- package/dist/validation/workspace.schema.d.ts +145 -0
- package/dist/validation/workspace.schema.js +83 -0
- package/dist/validation/workspace.schema.js.map +1 -0
- package/frontend-vue/app/build/components/KeyAddModal.vue +340 -0
- package/frontend-vue/app/build/components/KeyEditorDrawer.vue +951 -0
- package/frontend-vue/app/build/components/KeyRenameModal.vue +172 -0
- package/frontend-vue/app/build/components/LanguageAddModal.vue +199 -0
- package/frontend-vue/app/build/components/LanguagePicker.vue +233 -0
- package/frontend-vue/app/build/components/LocaleTile.vue +52 -0
- package/frontend-vue/app/build/components/PlaceholderText.vue +42 -0
- package/frontend-vue/app/build/components/ShortcutKbds.vue +22 -0
- package/frontend-vue/app/build/components/WorkspaceCreateModal.vue +193 -0
- package/frontend-vue/app/build/components/WorkspaceRenameModal.vue +107 -0
- package/frontend-vue/app/build/components/form/FormFieldRow.vue +70 -0
- package/frontend-vue/app/build/components/form/FormRows.vue +25 -0
- package/frontend-vue/app/build/components/form/WorkspaceDetailsFields.vue +44 -0
- package/frontend-vue/app/build/components/matrix/MatrixCell.vue +488 -0
- package/frontend-vue/app/build/components/matrix/MatrixColumns.vue +177 -0
- package/frontend-vue/app/build/components/matrix/MatrixGroupHeader.vue +57 -0
- package/frontend-vue/app/build/components/matrix/MatrixKeyCell.vue +83 -0
- package/frontend-vue/app/build/components/matrix/MatrixToolbar.vue +167 -0
- package/frontend-vue/app/build/components/queue/QueueActions.vue +60 -0
- package/frontend-vue/app/build/components/queue/QueueDone.vue +185 -0
- package/frontend-vue/app/build/components/queue/QueueEditor.vue +374 -0
- package/frontend-vue/app/build/components/queue/QueueHeader.vue +162 -0
- package/frontend-vue/app/build/components/queue/QueueUpNext.vue +61 -0
- package/frontend-vue/app/build/composables/useCellEditor.ts +324 -0
- package/frontend-vue/app/build/composables/useCellMoves.ts +155 -0
- package/frontend-vue/app/build/composables/useCellSaves.ts +339 -0
- package/frontend-vue/app/build/composables/useKeyPanel.ts +284 -0
- package/frontend-vue/app/build/composables/useKeySaves.ts +280 -0
- package/frontend-vue/app/build/composables/useMatrixFilters.ts +213 -0
- package/frontend-vue/app/build/composables/useMatrixRows.ts +104 -0
- package/frontend-vue/app/build/composables/useMatrixView.ts +181 -0
- package/frontend-vue/app/build/composables/useQueueContext.ts +31 -0
- package/frontend-vue/app/build/composables/useQueueEditing.ts +53 -0
- package/frontend-vue/app/build/composables/useQueueOrphans.ts +54 -0
- package/frontend-vue/app/build/composables/useQueueSave.ts +290 -0
- package/frontend-vue/app/build/composables/useQueueShortcuts.ts +106 -0
- package/frontend-vue/app/build/composables/useQueueToasts.ts +99 -0
- package/frontend-vue/app/components/LanguageNamespaces.vue +77 -0
- package/frontend-vue/app/components/NamespaceCoverage.vue +222 -0
- package/frontend-vue/app/components/TranslationMatrix.vue +809 -0
- package/frontend-vue/app/components/TranslationQueue.vue +212 -0
- package/frontend-vue/app/components/WorkspaceDangerZone.vue +81 -0
- package/frontend-vue/app/components/WorkspaceGeneral.vue +232 -0
- package/frontend-vue/app/components/WorkspaceList.vue +454 -0
- package/frontend-vue/app/components/WorkspaceScope.vue +384 -0
- package/frontend-vue/app/composables/translation/useFirstRun.ts +8 -0
- package/frontend-vue/app/composables/translation/useI18nWorkspaces.ts +221 -133
- package/frontend-vue/app/composables/translation/useKeyActions.ts +224 -0
- package/frontend-vue/app/composables/translation/useLangFormat.ts +10 -0
- package/frontend-vue/app/composables/translation/useLangLinks.ts +80 -0
- package/frontend-vue/app/composables/translation/useLanguageActions.ts +159 -0
- package/frontend-vue/app/composables/translation/useLanguageQueue.ts +232 -0
- package/frontend-vue/app/composables/translation/useLocaleNames.ts +166 -0
- package/frontend-vue/app/composables/translation/useMutationToast.ts +51 -17
- package/frontend-vue/app/composables/translation/useQueueDrafts.ts +115 -0
- package/frontend-vue/app/composables/translation/useQueueSession.ts +182 -0
- package/frontend-vue/app/composables/translation/useServedConfirm.ts +152 -0
- package/frontend-vue/app/composables/translation/useWorkspaceActions.ts +259 -0
- package/frontend-vue/app/composables/translation/useWorkspaceContext.ts +46 -15
- package/frontend-vue/app/composables/translation/useWorkspaceFlat.ts +322 -70
- package/frontend-vue/app/composables/translation/useWorkspaceNameCheck.ts +55 -0
- package/frontend-vue/app/composables/translation/useWorkspaceRoute.ts +129 -0
- package/frontend-vue/app/config/shortcuts-registry.ts +72 -0
- package/frontend-vue/app/types/lang.ts +130 -0
- package/frontend-vue/app/utils/boundedCache.ts +22 -0
- package/frontend-vue/app/utils/download.ts +16 -0
- package/frontend-vue/app/utils/keySaveErrors.ts +61 -0
- package/frontend-vue/app/utils/keySaves.ts +108 -0
- package/frontend-vue/app/utils/languages.ts +272 -0
- package/frontend-vue/app/utils/matrixExport.ts +47 -0
- package/frontend-vue/app/utils/queueDrafts.ts +115 -0
- package/frontend-vue/app/utils/queuePass.ts +145 -0
- package/frontend-vue/app/utils/queueView.ts +22 -0
- package/frontend-vue/app/utils/shortcuts.ts +75 -0
- package/frontend-vue/app/utils/translations.ts +756 -0
- package/frontend-vue/app/utils/workspaceBackup.ts +119 -0
- package/frontend-vue/app/utils/workspaces.ts +45 -0
- package/frontend-vue/dms.frontend.build.ts +5 -0
- package/frontend-vue/dms.frontend.ts +9 -20
- package/frontend-vue/i18n/locales/lang-en-GB.json +792 -69
- package/frontend-vue/i18n/locales/lang-fr-FR.json +792 -69
- package/frontend-vue/package.json +8 -6
- package/package.json +11 -8
- package/dist/utils/mutations.d.ts +0 -3
- package/dist/utils/mutations.js +0 -35
- package/dist/utils/mutations.js.map +0 -1
- package/frontend-vue/app/build/components/pages/lang/TranslationMatrix.vue +0 -284
- package/frontend-vue/app/components/LanguageAddModal.vue +0 -78
- package/frontend-vue/app/components/WorkspaceEndpoint.vue +0 -29
- package/frontend-vue/app/components/WorkspaceSelector.vue +0 -180
- package/frontend-vue/app/components/WorkspaceStatus.vue +0 -24
- package/frontend-vue/app/composables/translation/useLanguageCatalog.ts +0 -90
- package/frontend-vue/app/composables/translation/useLocaleMeta.ts +0 -18
- package/frontend-vue/app/composables/translation/useTranslationProgress.ts +0 -73
- package/frontend-vue/app/custom-pages/lang/overview.vue +0 -397
- package/frontend-vue/app/custom-pages/lang/translations.vue +0 -498
- package/frontend-vue/app/plugins/workspace-sidebar-widget.ts +0 -12
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"packageManager": "pnpm@10.6.5",
|
|
9
9
|
"engines": {
|
|
10
|
-
"@antelopejs/dms-frontend": ">=0.2
|
|
10
|
+
"@antelopejs/dms-frontend": ">=0.5.2 <0.6.0"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "ajs dms build",
|
|
@@ -17,15 +17,13 @@
|
|
|
17
17
|
"lint": "eslint .",
|
|
18
18
|
"lint:fix": "eslint . --fix"
|
|
19
19
|
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"@vueuse/core": "^14.3.0"
|
|
22
|
-
},
|
|
23
20
|
"devDependencies": {
|
|
24
|
-
"@antelopejs/core": "1.
|
|
25
|
-
"@antelopejs/dms-frontend": "0.
|
|
21
|
+
"@antelopejs/core": "1.14.0",
|
|
22
|
+
"@antelopejs/dms-frontend": "0.5.6",
|
|
26
23
|
"@eslint/js": "^9",
|
|
27
24
|
"@typescript-eslint/eslint-plugin": "^8",
|
|
28
25
|
"@typescript-eslint/parser": "^8",
|
|
26
|
+
"@vueuse/core": "^14.4.0",
|
|
29
27
|
"eslint": "^9",
|
|
30
28
|
"eslint-plugin-vue": "^9",
|
|
31
29
|
"globals": "^15",
|
|
@@ -36,6 +34,10 @@
|
|
|
36
34
|
},
|
|
37
35
|
"peerDependencies": {
|
|
38
36
|
"@nuxt/ui": "4.10.0",
|
|
37
|
+
"@vueuse/core": "^14.4.0",
|
|
39
38
|
"vue": "^3.5.0"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@intlify/message-compiler": "^11.1.12"
|
|
40
42
|
}
|
|
41
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms-lang",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,13 +30,14 @@
|
|
|
30
30
|
"build": "rimraf dist && tsc",
|
|
31
31
|
"dev:frontend": "pnpm --dir playground frontend:dev",
|
|
32
32
|
"frontend:dev": "cd playground && pnpm frontend:dev",
|
|
33
|
-
"dev": "ajs project
|
|
33
|
+
"dev": "ajs project dev -w -p playground",
|
|
34
34
|
"lint:fix": "oxlint --fix --max-warnings=1000000 && oxfmt . && pnpm --dir frontend-vue lint:fix",
|
|
35
35
|
"lint": "oxlint && oxfmt --check . && pnpm --dir frontend-vue lint && antelopejs-check-interface-ranges",
|
|
36
36
|
"typecheck": "tsc --noEmit",
|
|
37
37
|
"format": "oxfmt . && pnpm --dir frontend-vue format",
|
|
38
|
-
"test": "pnpm run build && ajs module test .",
|
|
39
|
-
"test:unit": "pnpm build && mocha dist/test/locale-discovery.test.js && node --test tests/*.test.mjs",
|
|
38
|
+
"test": "[ -n \"$DMS_PREBUILT\" ] || pnpm run build && ajs module test .",
|
|
39
|
+
"test:unit": "[ -n \"$DMS_PREBUILT\" ] || pnpm run build && mocha dist/test/locale-discovery.test.js && node --test tests/*.test.mjs",
|
|
40
|
+
"test:node": "[ -n \"$DMS_PREBUILT\" ] || pnpm run build && node --test tests/*.test.mjs",
|
|
40
41
|
"test:frontend": "ajs dms verify-source --layer node_modules/@antelopejs/dms/frontend-vue --module frontend-vue",
|
|
41
42
|
"release": "pnpm run lint && release-it",
|
|
42
43
|
"prepack": "pnpm run build",
|
|
@@ -47,12 +48,14 @@
|
|
|
47
48
|
"@antelopejs/interface-api": ">=0.0.14 <1.0.0",
|
|
48
49
|
"@antelopejs/interface-api-util": ">=0.1.2 <1.0.0",
|
|
49
50
|
"@antelopejs/interface-core": ">=0.1.1 <1.0.0",
|
|
50
|
-
"@antelopejs/interface-dms": ">=0.
|
|
51
|
+
"@antelopejs/interface-dms": ">=0.6.0 <1.0.0",
|
|
52
|
+
"@intlify/message-compiler": "^11.1.12",
|
|
53
|
+
"zod": "~3.24.2"
|
|
51
54
|
},
|
|
52
55
|
"devDependencies": {
|
|
53
|
-
"@antelopejs/core": "1.
|
|
54
|
-
"@antelopejs/dms": ">=0.
|
|
55
|
-
"@antelopejs/dms-frontend": "0.
|
|
56
|
+
"@antelopejs/core": "1.14.0",
|
|
57
|
+
"@antelopejs/dms": ">=0.8.0 <0.9.0",
|
|
58
|
+
"@antelopejs/dms-frontend": "0.5.6",
|
|
56
59
|
"@antelopejs/tooling-configs": ">=0.0.7 <1.0.0",
|
|
57
60
|
"@types/chai": "^5.2.3",
|
|
58
61
|
"@types/mocha": "^10.0.10",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare function upsertKeyFor(workspace: string, path: string, values: Record<string, unknown>, defaultLocale?: string): void;
|
|
2
|
-
export declare function renameKeyFor(workspace: string, path: string, newPath: string): void;
|
|
3
|
-
export declare function deleteKeyFor(workspace: string, path: string): void;
|
package/dist/utils/mutations.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.upsertKeyFor = upsertKeyFor;
|
|
4
|
-
exports.renameKeyFor = renameKeyFor;
|
|
5
|
-
exports.deleteKeyFor = deleteKeyFor;
|
|
6
|
-
const interface_api_1 = require("@antelopejs/interface-api");
|
|
7
|
-
const own_1 = require("./own");
|
|
8
|
-
const resolve_1 = require("./resolve");
|
|
9
|
-
const workspaces_1 = require("./workspaces");
|
|
10
|
-
function readOnly() {
|
|
11
|
-
throw new interface_api_1.HTTPResult(403, "The modules workspace is read-only; override into default");
|
|
12
|
-
}
|
|
13
|
-
const KEY_WRITERS = {
|
|
14
|
-
default: {
|
|
15
|
-
upsert: (_workspace, path, values, defaultLocale) => (0, own_1.upsertOwnKey)(path, values, defaultLocale),
|
|
16
|
-
rename: (_workspace, path, newPath) => (0, own_1.renameOwnKey)(path, newPath),
|
|
17
|
-
remove: (_workspace, path) => (0, own_1.deleteOwnKey)(path),
|
|
18
|
-
},
|
|
19
|
-
modules: { upsert: readOnly, rename: readOnly, remove: readOnly },
|
|
20
|
-
added: {
|
|
21
|
-
upsert: (workspace, path, values) => (0, workspaces_1.upsertKey)(workspace, path, values),
|
|
22
|
-
rename: (workspace, path, newPath) => (0, workspaces_1.renameKey)(workspace, path, newPath),
|
|
23
|
-
remove: (workspace, path) => (0, workspaces_1.deleteKey)(workspace, path),
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
function upsertKeyFor(workspace, path, values, defaultLocale) {
|
|
27
|
-
KEY_WRITERS[(0, resolve_1.workspaceKind)(workspace)].upsert(workspace, path, values, defaultLocale);
|
|
28
|
-
}
|
|
29
|
-
function renameKeyFor(workspace, path, newPath) {
|
|
30
|
-
KEY_WRITERS[(0, resolve_1.workspaceKind)(workspace)].rename(workspace, path, newPath);
|
|
31
|
-
}
|
|
32
|
-
function deleteKeyFor(workspace, path) {
|
|
33
|
-
KEY_WRITERS[(0, resolve_1.workspaceKind)(workspace)].remove(workspace, path);
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=mutations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../src/utils/mutations.ts"],"names":[],"mappings":";;AAsCA,oCAYC;AAED,oCAMC;AAED,oCAEC;AA9DD,6DAAuD;AACvD,+BAAiE;AACjE,uCAA8D;AAC9D,6CAA+D;AAa/D,SAAS,QAAQ;IACf,MAAM,IAAI,0BAAU,CAClB,GAAG,EACH,2DAA2D,CAC5D,CAAC;AACJ,CAAC;AAED,MAAM,WAAW,GAAqC;IACpD,OAAO,EAAE;QACP,MAAM,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,CAClD,IAAA,kBAAY,EAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC;QAC3C,MAAM,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,kBAAY,EAAC,IAAI,EAAE,OAAO,CAAC;QAClE,MAAM,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,kBAAY,EAAC,IAAI,CAAC;KACjD;IACD,OAAO,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE;IACjE,KAAK,EAAE;QACL,MAAM,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,IAAA,sBAAS,EAAC,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC;QACvE,MAAM,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,sBAAS,EAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC;QACzE,MAAM,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,sBAAS,EAAC,SAAS,EAAE,IAAI,CAAC;KACxD;CACF,CAAC;AAEF,SAAgB,YAAY,CAC1B,SAAiB,EACjB,IAAY,EACZ,MAA+B,EAC/B,aAAsB;IAEtB,WAAW,CAAC,IAAA,uBAAa,EAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAC1C,SAAS,EACT,IAAI,EACJ,MAAM,EACN,aAAa,CACd,CAAC;AACJ,CAAC;AAED,SAAgB,YAAY,CAC1B,SAAiB,EACjB,IAAY,EACZ,OAAe;IAEf,WAAW,CAAC,IAAA,uBAAa,EAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACzE,CAAC;AAED,SAAgB,YAAY,CAAC,SAAiB,EAAE,IAAY;IAC1D,WAAW,CAAC,IAAA,uBAAa,EAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { DropdownMenuItem } from "@nuxt/ui";
|
|
3
|
-
import { useElementSize } from "@vueuse/core";
|
|
4
|
-
|
|
5
|
-
interface LocaleColumn {
|
|
6
|
-
code: string;
|
|
7
|
-
name: string;
|
|
8
|
-
flag: string;
|
|
9
|
-
isDefault: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface MatrixRow {
|
|
13
|
-
key: string;
|
|
14
|
-
values: Record<string, string | undefined>;
|
|
15
|
-
inherited?: Record<string, string | undefined>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface Props {
|
|
19
|
-
rows: MatrixRow[];
|
|
20
|
-
columns: LocaleColumn[];
|
|
21
|
-
editable: boolean;
|
|
22
|
-
showInherited: boolean;
|
|
23
|
-
overridable: boolean;
|
|
24
|
-
manageKeys: boolean;
|
|
25
|
-
resetKey: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface SavePayload {
|
|
29
|
-
key: string;
|
|
30
|
-
locale: string;
|
|
31
|
-
value: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface MatrixEmits {
|
|
35
|
-
save: [payload: SavePayload];
|
|
36
|
-
rename: [key: string];
|
|
37
|
-
remove: [key: string];
|
|
38
|
-
override: [key: string];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const props = defineProps<Props>();
|
|
42
|
-
|
|
43
|
-
const emit = defineEmits<MatrixEmits>();
|
|
44
|
-
|
|
45
|
-
const ROW_HEIGHT = 56;
|
|
46
|
-
const HEADER_HEIGHT = 44;
|
|
47
|
-
const KEY_WIDTH = 280;
|
|
48
|
-
const COLUMN_WIDTH = 240;
|
|
49
|
-
const OVERSCAN = 8;
|
|
50
|
-
const FALLBACK_VIEWPORT = 600;
|
|
51
|
-
|
|
52
|
-
const { t } = useI18n();
|
|
53
|
-
|
|
54
|
-
const scroller = ref<HTMLElement | null>(null);
|
|
55
|
-
const scrollTop = ref(0);
|
|
56
|
-
const { height: viewportHeight } = useElementSize(scroller);
|
|
57
|
-
|
|
58
|
-
function onScroll(event: Event) {
|
|
59
|
-
scrollTop.value = (event.target as HTMLElement).scrollTop;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const totalRows = computed(() => props.rows.length);
|
|
63
|
-
const bodyHeight = computed(() => totalRows.value * ROW_HEIGHT);
|
|
64
|
-
const contentWidth = computed(
|
|
65
|
-
() => KEY_WIDTH + props.columns.length * COLUMN_WIDTH,
|
|
66
|
-
);
|
|
67
|
-
const gridTemplate = computed(
|
|
68
|
-
() => `${KEY_WIDTH}px repeat(${props.columns.length}, ${COLUMN_WIDTH}px)`,
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const startIndex = computed(() =>
|
|
72
|
-
Math.max(
|
|
73
|
-
0,
|
|
74
|
-
Math.floor((scrollTop.value - HEADER_HEIGHT) / ROW_HEIGHT) - OVERSCAN,
|
|
75
|
-
),
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
const endIndex = computed(() =>
|
|
79
|
-
Math.min(
|
|
80
|
-
totalRows.value,
|
|
81
|
-
Math.ceil(
|
|
82
|
-
(scrollTop.value - HEADER_HEIGHT + (viewportHeight.value || FALLBACK_VIEWPORT)) /
|
|
83
|
-
ROW_HEIGHT,
|
|
84
|
-
) + OVERSCAN,
|
|
85
|
-
),
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
const visibleRows = computed(() =>
|
|
89
|
-
props.rows.slice(startIndex.value, endIndex.value).map((row, offset) => ({
|
|
90
|
-
row,
|
|
91
|
-
top: (startIndex.value + offset) * ROW_HEIGHT,
|
|
92
|
-
})),
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
const drafts = ref<Record<string, Record<string, string>>>({});
|
|
96
|
-
|
|
97
|
-
function stringValue(value: string | undefined): string {
|
|
98
|
-
return value == null ? "" : String(value);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function buildDrafts(preserve: boolean) {
|
|
102
|
-
const next: Record<string, Record<string, string>> = preserve
|
|
103
|
-
? { ...drafts.value }
|
|
104
|
-
: {};
|
|
105
|
-
for (const row of props.rows) {
|
|
106
|
-
if (!next[row.key]) next[row.key] = {};
|
|
107
|
-
for (const column of props.columns) {
|
|
108
|
-
if (!preserve || next[row.key][column.code] === undefined) {
|
|
109
|
-
next[row.key][column.code] = stringValue(row.values[column.code]);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
drafts.value = next;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
watch(
|
|
117
|
-
() => [props.resetKey, props.rows, props.columns] as const,
|
|
118
|
-
(now, prev) => {
|
|
119
|
-
const contextChanged = !prev || now[0] !== prev[0];
|
|
120
|
-
buildDrafts(!contextChanged);
|
|
121
|
-
if (contextChanged) {
|
|
122
|
-
if (scroller.value) scroller.value.scrollTop = 0;
|
|
123
|
-
scrollTop.value = 0;
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
{ immediate: true },
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
function isMissing(row: MatrixRow, code: string): boolean {
|
|
130
|
-
return stringValue(row.values[code]) === "";
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function placeholderFor(row: MatrixRow, code: string): string {
|
|
134
|
-
if (props.showInherited && row.inherited) {
|
|
135
|
-
return stringValue(row.inherited[code]) || "—";
|
|
136
|
-
}
|
|
137
|
-
return "—";
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function commit(key: string, code: string) {
|
|
141
|
-
const next = drafts.value[key]?.[code] ?? "";
|
|
142
|
-
const row = props.rows.find((item) => item.key === key);
|
|
143
|
-
if (!row) return;
|
|
144
|
-
if (next === stringValue(row.values[code])) return;
|
|
145
|
-
emit("save", { key, locale: code, value: next });
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function rowMenu(key: string): DropdownMenuItem[][] {
|
|
149
|
-
const items: DropdownMenuItem[] = [];
|
|
150
|
-
if (props.overridable) {
|
|
151
|
-
items.push({
|
|
152
|
-
label: t("dms_lang.translation.ws_override"),
|
|
153
|
-
icon: "i-lucide-git-fork",
|
|
154
|
-
onSelect: () => emit("override", key),
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
if (props.manageKeys) {
|
|
158
|
-
items.push({
|
|
159
|
-
label: t("dms_lang.translation.ws_rename_key"),
|
|
160
|
-
icon: "i-lucide-pencil",
|
|
161
|
-
onSelect: () => emit("rename", key),
|
|
162
|
-
});
|
|
163
|
-
items.push({
|
|
164
|
-
label: t("dms_lang.translation.ws_delete_key_title"),
|
|
165
|
-
icon: "i-lucide-trash-2",
|
|
166
|
-
color: "error",
|
|
167
|
-
onSelect: () => emit("remove", key),
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
return [items];
|
|
171
|
-
}
|
|
172
|
-
</script>
|
|
173
|
-
|
|
174
|
-
<template>
|
|
175
|
-
<div
|
|
176
|
-
v-if="props.rows.length === 0"
|
|
177
|
-
class="text-muted py-12 text-center text-sm"
|
|
178
|
-
>
|
|
179
|
-
{{ $t("dms_lang.editor.no_keys") }}
|
|
180
|
-
</div>
|
|
181
|
-
|
|
182
|
-
<div
|
|
183
|
-
v-else
|
|
184
|
-
ref="scroller"
|
|
185
|
-
class="relative max-h-[68vh] overflow-auto"
|
|
186
|
-
@scroll="onScroll"
|
|
187
|
-
>
|
|
188
|
-
<div :style="{ minWidth: `${contentWidth}px` }">
|
|
189
|
-
<div
|
|
190
|
-
class="border-default sticky top-0 z-20 grid border-b bg-(--dms-surface-card)"
|
|
191
|
-
:style="{ gridTemplateColumns: gridTemplate, height: `${HEADER_HEIGHT}px` }"
|
|
192
|
-
>
|
|
193
|
-
<div
|
|
194
|
-
class="text-muted sticky left-0 z-10 flex items-center px-3 text-xs font-semibold bg-(--dms-surface-card)"
|
|
195
|
-
>
|
|
196
|
-
{{ $t("dms_lang.editor.col_key") }}
|
|
197
|
-
</div>
|
|
198
|
-
<div
|
|
199
|
-
v-for="column in props.columns"
|
|
200
|
-
:key="column.code"
|
|
201
|
-
class="text-muted flex items-center gap-2 px-3 text-xs font-semibold"
|
|
202
|
-
>
|
|
203
|
-
<UIcon
|
|
204
|
-
:name="column.flag ? `flagpack:${column.flag}` : 'i-lucide-globe'"
|
|
205
|
-
class="size-4 shrink-0"
|
|
206
|
-
/>
|
|
207
|
-
<span class="truncate">{{ column.name }}</span>
|
|
208
|
-
<UBadge
|
|
209
|
-
v-if="column.isDefault"
|
|
210
|
-
color="neutral"
|
|
211
|
-
variant="subtle"
|
|
212
|
-
size="sm"
|
|
213
|
-
>
|
|
214
|
-
{{ $t("dms_lang.editor.base") }}
|
|
215
|
-
</UBadge>
|
|
216
|
-
</div>
|
|
217
|
-
</div>
|
|
218
|
-
|
|
219
|
-
<div class="relative" :style="{ height: `${bodyHeight}px` }">
|
|
220
|
-
<div
|
|
221
|
-
v-for="item in visibleRows"
|
|
222
|
-
:key="item.row.key"
|
|
223
|
-
class="group border-default absolute right-0 left-0 grid border-b"
|
|
224
|
-
:style="{
|
|
225
|
-
top: `${item.top}px`,
|
|
226
|
-
height: `${ROW_HEIGHT}px`,
|
|
227
|
-
gridTemplateColumns: gridTemplate,
|
|
228
|
-
}"
|
|
229
|
-
>
|
|
230
|
-
<div
|
|
231
|
-
class="sticky left-0 z-10 flex items-center px-3 bg-(--dms-surface-card)"
|
|
232
|
-
>
|
|
233
|
-
<span
|
|
234
|
-
class="text-primary line-clamp-2 w-full font-mono text-xs break-all"
|
|
235
|
-
:title="item.row.key"
|
|
236
|
-
>{{ item.row.key }}</span>
|
|
237
|
-
<UDropdownMenu
|
|
238
|
-
v-if="props.overridable || props.manageKeys"
|
|
239
|
-
:items="rowMenu(item.row.key)"
|
|
240
|
-
:content="{ align: 'end' }"
|
|
241
|
-
>
|
|
242
|
-
<UButton
|
|
243
|
-
icon="i-lucide-ellipsis"
|
|
244
|
-
color="neutral"
|
|
245
|
-
variant="ghost"
|
|
246
|
-
size="xs"
|
|
247
|
-
class="absolute top-1/2 right-1 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100"
|
|
248
|
-
:aria-label="$t('dms_lang.translation.ws_rename')"
|
|
249
|
-
/>
|
|
250
|
-
</UDropdownMenu>
|
|
251
|
-
</div>
|
|
252
|
-
|
|
253
|
-
<div
|
|
254
|
-
v-for="column in props.columns"
|
|
255
|
-
:key="column.code"
|
|
256
|
-
class="flex items-center px-2"
|
|
257
|
-
>
|
|
258
|
-
<input
|
|
259
|
-
v-if="props.editable"
|
|
260
|
-
v-model="drafts[item.row.key][column.code]"
|
|
261
|
-
:placeholder="placeholderFor(item.row, column.code)"
|
|
262
|
-
class="bg-default text-default focus:border-primary h-8 w-full rounded-md border px-2.5 text-sm transition-colors focus:outline-none"
|
|
263
|
-
:class="
|
|
264
|
-
isMissing(item.row, column.code)
|
|
265
|
-
? 'border-warning/40 border-dashed'
|
|
266
|
-
: 'border-default'
|
|
267
|
-
"
|
|
268
|
-
@blur="commit(item.row.key, column.code)"
|
|
269
|
-
@keydown.enter.prevent="commit(item.row.key, column.code)"
|
|
270
|
-
>
|
|
271
|
-
<div
|
|
272
|
-
v-else
|
|
273
|
-
class="truncate text-sm"
|
|
274
|
-
:class="isMissing(item.row, column.code) ? 'text-muted' : 'text-default'"
|
|
275
|
-
:title="item.row.values[column.code] || ''"
|
|
276
|
-
>
|
|
277
|
-
{{ item.row.values[column.code] || "—" }}
|
|
278
|
-
</div>
|
|
279
|
-
</div>
|
|
280
|
-
</div>
|
|
281
|
-
</div>
|
|
282
|
-
</div>
|
|
283
|
-
</div>
|
|
284
|
-
</template>
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { LanguageCatalogEntry } from "../composables/translation/useLanguageCatalog";
|
|
3
|
-
|
|
4
|
-
interface Emits {
|
|
5
|
-
added: [];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const EMPTY_FORM: LanguageCatalogEntry = { code: "", name: "", flag: "" };
|
|
9
|
-
|
|
10
|
-
const open = defineModel<boolean>("open", { required: true });
|
|
11
|
-
const emit = defineEmits<Emits>();
|
|
12
|
-
|
|
13
|
-
const { tryMutate } = useMutationToast();
|
|
14
|
-
const { items: languageItems, resolveLanguage } = useLanguageCatalog();
|
|
15
|
-
const { selectedWorkspace, addLocale } = useI18nWorkspaces();
|
|
16
|
-
|
|
17
|
-
const form = ref<LanguageCatalogEntry>({ ...EMPTY_FORM });
|
|
18
|
-
const isSubmitting = ref(false);
|
|
19
|
-
|
|
20
|
-
watch(open, (isOpen) => {
|
|
21
|
-
if (isOpen) form.value = { ...EMPTY_FORM };
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
async function submit() {
|
|
25
|
-
const workspace = selectedWorkspace.value;
|
|
26
|
-
const { code, name, flag } = form.value;
|
|
27
|
-
isSubmitting.value = true;
|
|
28
|
-
const ok = await tryMutate(() =>
|
|
29
|
-
addLocale(workspace, {
|
|
30
|
-
code,
|
|
31
|
-
name: name || undefined,
|
|
32
|
-
flag: flag || undefined,
|
|
33
|
-
}),
|
|
34
|
-
);
|
|
35
|
-
isSubmitting.value = false;
|
|
36
|
-
if (!ok) return;
|
|
37
|
-
open.value = false;
|
|
38
|
-
emit("added");
|
|
39
|
-
}
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<template>
|
|
43
|
-
<UModal
|
|
44
|
-
v-model:open="open"
|
|
45
|
-
:title="$t('dms_lang.translation.ws_add_language')"
|
|
46
|
-
>
|
|
47
|
-
<template #body>
|
|
48
|
-
<UFormField :label="$t('dms_lang.translation.ws_language')">
|
|
49
|
-
<USelectMenu
|
|
50
|
-
:model-value="form.code"
|
|
51
|
-
:items="languageItems"
|
|
52
|
-
value-key="value"
|
|
53
|
-
label-key="label"
|
|
54
|
-
searchable
|
|
55
|
-
class="w-full"
|
|
56
|
-
:placeholder="$t('dms_lang.translation.ws_language_select')"
|
|
57
|
-
@update:model-value="form = resolveLanguage($event)"
|
|
58
|
-
/>
|
|
59
|
-
</UFormField>
|
|
60
|
-
</template>
|
|
61
|
-
<template #footer>
|
|
62
|
-
<div class="flex w-full justify-end gap-2">
|
|
63
|
-
<UButton
|
|
64
|
-
color="neutral"
|
|
65
|
-
variant="ghost"
|
|
66
|
-
:label="$t('dms_lang.translation.ws_cancel')"
|
|
67
|
-
@click="open = false"
|
|
68
|
-
/>
|
|
69
|
-
<UButton
|
|
70
|
-
:label="$t('dms_lang.translation.ws_add')"
|
|
71
|
-
:loading="isSubmitting"
|
|
72
|
-
:disabled="!form.code"
|
|
73
|
-
@click="submit"
|
|
74
|
-
/>
|
|
75
|
-
</div>
|
|
76
|
-
</template>
|
|
77
|
-
</UModal>
|
|
78
|
-
</template>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { useDmsRuntimeConfig } from '#dms/frontend-module'
|
|
3
|
-
|
|
4
|
-
const { selectedWorkspace } = useI18nWorkspaces()
|
|
5
|
-
const { isAdded } = useWorkspaceContext()
|
|
6
|
-
|
|
7
|
-
const baseUrl = useDmsRuntimeConfig().public.dms.baseURL
|
|
8
|
-
|
|
9
|
-
const publicUrl = computed(() =>
|
|
10
|
-
isAdded.value
|
|
11
|
-
? `${baseUrl}/i18n/${selectedWorkspace.value}/{locale}.json`
|
|
12
|
-
: null,
|
|
13
|
-
)
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<template>
|
|
17
|
-
<DmsCard v-if="publicUrl" :padded="false">
|
|
18
|
-
<div class="flex flex-wrap items-center gap-3 px-4 py-3">
|
|
19
|
-
<UBadge color="success" variant="solid" size="sm">GET</UBadge>
|
|
20
|
-
<code class="text-default break-all font-mono text-xs">
|
|
21
|
-
{{ publicUrl }}
|
|
22
|
-
</code>
|
|
23
|
-
<DmsCopyButton :value="publicUrl" />
|
|
24
|
-
<span class="text-muted text-xs">
|
|
25
|
-
{{ $t('dms_lang.translation.ws_http_notice_hint') }}
|
|
26
|
-
</span>
|
|
27
|
-
</div>
|
|
28
|
-
</DmsCard>
|
|
29
|
-
</template>
|