@mapomodule/uikit 2.0.0-beta.6 → 2.0.0-beta.8
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/dist/index.d.mts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/module.d.mts +1 -0
- package/dist/module.d.ts.map +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +13 -2
- package/dist/runtime/components/MapoConfirmDialog.vue +5 -3
- package/dist/runtime/components/MapoConfirmDialog.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoDetail.vue +40 -32
- package/dist/runtime/components/MapoDetail.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoDetailLangSwitch.vue +1 -1
- package/dist/runtime/components/MapoDropArea.vue +5 -1
- package/dist/runtime/components/MapoDropArea.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoLangSwitcher.vue +39 -0
- package/dist/runtime/components/MapoLangSwitcher.vue.d.ts +18 -0
- package/dist/runtime/components/MapoLangSwitcher.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoList.vue +2 -2
- package/dist/runtime/components/MapoListActions.vue +15 -8
- package/dist/runtime/components/MapoListActions.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoListFilters.vue +4 -2
- package/dist/runtime/components/MapoListFilters.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoListQuickEdit.vue +13 -9
- package/dist/runtime/components/MapoListQuickEdit.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoListTable.vue +26 -21
- package/dist/runtime/components/MapoListTable.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoLogin.vue +13 -10
- package/dist/runtime/components/MapoLogin.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoLogoutButton.vue +4 -2
- package/dist/runtime/components/MapoLogoutButton.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMediaBreadcrumbs.vue +3 -1
- package/dist/runtime/components/MapoMediaBreadcrumbs.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMediaEditor.vue +26 -16
- package/dist/runtime/components/MapoMediaEditor.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMediaFileChanger.vue +8 -4
- package/dist/runtime/components/MapoMediaFileChanger.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMediaFolders.vue +36 -14
- package/dist/runtime/components/MapoMediaFolders.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMediaGallery.vue +15 -5
- package/dist/runtime/components/MapoMediaGallery.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMediaManager.vue +18 -8
- package/dist/runtime/components/MapoMediaManager.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMediaManagerDialog.vue +9 -5
- package/dist/runtime/components/MapoMediaManagerDialog.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMediaPreview.vue +1 -1
- package/dist/runtime/components/MapoMediaUploader.vue +40 -16
- package/dist/runtime/components/MapoMediaUploader.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMenuManager.vue +273 -0
- package/dist/runtime/components/MapoMenuManager.vue.d.ts +92 -0
- package/dist/runtime/components/MapoMenuManager.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMenuNodeEditor.vue +201 -0
- package/dist/runtime/components/MapoMenuNodeEditor.vue.d.ts +61 -0
- package/dist/runtime/components/MapoMenuNodeEditor.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMenuTreeview.vue +181 -0
- package/dist/runtime/components/MapoMenuTreeview.vue.d.ts +57 -0
- package/dist/runtime/components/MapoMenuTreeview.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMenuTreeviewNode.vue +175 -0
- package/dist/runtime/components/MapoMenuTreeviewNode.vue.d.ts +27 -0
- package/dist/runtime/components/MapoMenuTreeviewNode.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebar.vue +3 -1
- package/dist/runtime/components/MapoSidebar.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoSidebarList.vue +1 -1
- package/dist/runtime/components/MapoSidebarProfile.vue +6 -2
- package/dist/runtime/components/MapoSidebarProfile.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoThemeToggle.vue +5 -1
- package/dist/runtime/components/MapoThemeToggle.vue.d.ts.map +1 -1
- package/dist/runtime/components/menuDndContext.d.ts +19 -0
- package/dist/runtime/components/menuDndContext.d.ts.map +1 -0
- package/dist/runtime/components/menuDndContext.js +3 -0
- package/dist/runtime/pages/index.vue +4 -2
- package/dist/runtime/pages/index.vue.d.ts.map +1 -1
- package/dist/runtime/plugins/media-adapter.d.ts.map +1 -1
- package/dist/runtime/plugins/media-adapter.js +2 -1
- package/dist/runtime/stores/media.d.ts.map +1 -1
- package/dist/runtime/stores/media.js +36 -14
- package/dist/runtime/types/menu.d.ts +66 -0
- package/dist/runtime/types/menu.d.ts.map +1 -0
- package/dist/runtime/types/menu.js +30 -0
- package/package.json +11 -8
- package/src/index.ts +12 -0
- package/src/module.ts +17 -0
- package/src/runtime/components/MapoConfirmDialog.vue +5 -3
- package/src/runtime/components/MapoDetail.vue +39 -36
- package/src/runtime/components/MapoDetailLangSwitch.vue +1 -1
- package/src/runtime/components/MapoDropArea.vue +6 -1
- package/src/runtime/components/MapoLangSwitcher.vue +74 -0
- package/src/runtime/components/MapoList.vue +1 -1
- package/src/runtime/components/MapoListActions.vue +16 -10
- package/src/runtime/components/MapoListFilters.vue +5 -2
- package/src/runtime/components/MapoListQuickEdit.vue +12 -9
- package/src/runtime/components/MapoListTable.vue +26 -21
- package/src/runtime/components/MapoLogin.vue +13 -10
- package/src/runtime/components/MapoLogoutButton.vue +4 -2
- package/src/runtime/components/MapoMediaBreadcrumbs.vue +3 -1
- package/src/runtime/components/MapoMediaEditor.vue +26 -16
- package/src/runtime/components/MapoMediaFileChanger.vue +8 -3
- package/src/runtime/components/MapoMediaFolders.vue +37 -15
- package/src/runtime/components/MapoMediaGallery.vue +17 -5
- package/src/runtime/components/MapoMediaManager.vue +17 -7
- package/src/runtime/components/MapoMediaManagerDialog.vue +10 -4
- package/src/runtime/components/MapoMediaUploader.vue +43 -16
- package/src/runtime/components/MapoMenuManager.vue +402 -0
- package/src/runtime/components/MapoMenuNodeEditor.vue +282 -0
- package/src/runtime/components/MapoMenuTreeview.vue +264 -0
- package/src/runtime/components/MapoMenuTreeviewNode.vue +234 -0
- package/src/runtime/components/MapoSidebar.vue +3 -1
- package/src/runtime/components/MapoSidebarList.vue +1 -1
- package/src/runtime/components/MapoSidebarProfile.vue +6 -2
- package/src/runtime/components/MapoThemeToggle.vue +5 -1
- package/src/runtime/components/menuDndContext.ts +22 -0
- package/src/runtime/pages/index.vue +5 -2
- package/src/runtime/plugins/media-adapter.ts +9 -5
- package/src/runtime/stores/media.ts +51 -15
- package/src/runtime/types/menu.ts +105 -0
|
@@ -1,29 +1,51 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
3
4
|
import { useMediaStore } from "../stores/media.js";
|
|
4
5
|
import type { MediaFolder } from "../types/media.js";
|
|
5
6
|
|
|
7
|
+
const { t } = useI18n();
|
|
6
8
|
const store = useMediaStore();
|
|
7
9
|
|
|
8
10
|
const editingFolder = ref<Partial<MediaFolder> | null>(null);
|
|
9
11
|
const folderName = ref("");
|
|
10
12
|
const saving = ref(false);
|
|
11
13
|
|
|
12
|
-
const ALL_MIME_FILTERS = [
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const ALL_MIME_FILTERS = computed(() => [
|
|
15
|
+
{
|
|
16
|
+
label: t("mapo.mediaFolders.allFolder"),
|
|
17
|
+
icon: "i-lucide-layers",
|
|
18
|
+
mime: null as string | null,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: t("mapo.mediaFolders.imageFolder"),
|
|
22
|
+
icon: "i-lucide-image",
|
|
23
|
+
mime: "image/*",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: t("mapo.mediaFolders.videoFolder"),
|
|
27
|
+
icon: "i-lucide-film",
|
|
28
|
+
mime: "video/*",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: t("mapo.mediaFolders.audioFolder"),
|
|
32
|
+
icon: "i-lucide-music",
|
|
33
|
+
mime: "audio/*",
|
|
34
|
+
},
|
|
17
35
|
// Family filter (legacy parity): pdf, zip, office docs — not just pdf.
|
|
18
|
-
{
|
|
19
|
-
|
|
36
|
+
{
|
|
37
|
+
label: t("mapo.mediaFolders.docFolder"),
|
|
38
|
+
icon: "i-lucide-file-text",
|
|
39
|
+
mime: "application/*",
|
|
40
|
+
},
|
|
41
|
+
]);
|
|
20
42
|
|
|
21
43
|
// When the host locks a mime (picker fields), only the matching filter is
|
|
22
44
|
// offered — "All" would let the user select media of the wrong type.
|
|
23
45
|
const mimeFilters = computed(() =>
|
|
24
46
|
store.lockedMime
|
|
25
|
-
? ALL_MIME_FILTERS.filter((f) => f.mime === store.lockedMime)
|
|
26
|
-
: ALL_MIME_FILTERS,
|
|
47
|
+
? ALL_MIME_FILTERS.value.filter((f) => f.mime === store.lockedMime)
|
|
48
|
+
: ALL_MIME_FILTERS.value,
|
|
27
49
|
);
|
|
28
50
|
|
|
29
51
|
function startCreate() {
|
|
@@ -77,7 +99,7 @@ function onNameKeyup(event: KeyboardEvent) {
|
|
|
77
99
|
<p
|
|
78
100
|
class="mb-1 px-1 text-xs font-semibold uppercase tracking-wide text-dimmed"
|
|
79
101
|
>
|
|
80
|
-
|
|
102
|
+
{{ t("mapo.mime") }}
|
|
81
103
|
</p>
|
|
82
104
|
<UButton
|
|
83
105
|
v-for="f in mimeFilters"
|
|
@@ -100,14 +122,14 @@ function onNameKeyup(event: KeyboardEvent) {
|
|
|
100
122
|
<!-- Folders header -->
|
|
101
123
|
<div class="flex items-center justify-between px-3">
|
|
102
124
|
<p class="text-xs font-semibold uppercase tracking-wide text-dimmed">
|
|
103
|
-
|
|
125
|
+
{{ t("mapo.mediaFolders.folders") }}
|
|
104
126
|
</p>
|
|
105
127
|
<UButton
|
|
106
128
|
icon="i-lucide-folder-plus"
|
|
107
129
|
size="xs"
|
|
108
130
|
variant="ghost"
|
|
109
131
|
color="neutral"
|
|
110
|
-
title="
|
|
132
|
+
:title="t('mapo.mediaFolders.newFolder')"
|
|
111
133
|
@click="startCreate"
|
|
112
134
|
/>
|
|
113
135
|
</div>
|
|
@@ -117,7 +139,7 @@ function onNameKeyup(event: KeyboardEvent) {
|
|
|
117
139
|
<UInput
|
|
118
140
|
v-model="folderName"
|
|
119
141
|
size="xs"
|
|
120
|
-
placeholder="
|
|
142
|
+
:placeholder="t('mapo.mediaFolders.folderName')"
|
|
121
143
|
autofocus
|
|
122
144
|
@keyup="onNameKeyup"
|
|
123
145
|
>
|
|
@@ -195,7 +217,7 @@ function onNameKeyup(event: KeyboardEvent) {
|
|
|
195
217
|
v-if="store.folders.length === 0"
|
|
196
218
|
class="px-2 py-3 text-xs text-dimmed italic"
|
|
197
219
|
>
|
|
198
|
-
|
|
220
|
+
{{ t("mapo.mediaFolders.noFolders") }}
|
|
199
221
|
</p>
|
|
200
222
|
</div>
|
|
201
223
|
|
|
@@ -210,7 +232,7 @@ function onNameKeyup(event: KeyboardEvent) {
|
|
|
210
232
|
class="justify-start"
|
|
211
233
|
@click="store.navigateToFolder(null)"
|
|
212
234
|
>
|
|
213
|
-
|
|
235
|
+
{{ t("mapo.mediaFolders.goBack") }}
|
|
214
236
|
</UButton>
|
|
215
237
|
</div>
|
|
216
238
|
</div>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
3
4
|
import { humanFileSize } from "@mapomodule/utils";
|
|
4
5
|
import { useMediaStore } from "../stores/media.js";
|
|
5
6
|
import type { MediaItem } from "../types/media.js";
|
|
6
7
|
|
|
8
|
+
const { t } = useI18n();
|
|
7
9
|
const store = useMediaStore();
|
|
8
10
|
|
|
9
11
|
const isPickerMode = computed(
|
|
@@ -85,7 +87,9 @@ function onDragEnd() {
|
|
|
85
87
|
</div>
|
|
86
88
|
</div>
|
|
87
89
|
<span class="ml-auto shrink-0 pl-2 text-xs text-muted">
|
|
88
|
-
{{
|
|
90
|
+
{{
|
|
91
|
+
t("mapo.mediaGallery.nSelected", { number: multiSelection.length })
|
|
92
|
+
}}
|
|
89
93
|
</span>
|
|
90
94
|
</div>
|
|
91
95
|
|
|
@@ -100,11 +104,17 @@ function onDragEnd() {
|
|
|
100
104
|
? 'indeterminate'
|
|
101
105
|
: store.editListState.value
|
|
102
106
|
"
|
|
103
|
-
:label="
|
|
107
|
+
:label="
|
|
108
|
+
store.editListState.value
|
|
109
|
+
? t('mapo.mediaGallery.deselectAll')
|
|
110
|
+
: t('mapo.mediaGallery.selectAll')
|
|
111
|
+
"
|
|
104
112
|
@update:model-value="store.editSelectAll()"
|
|
105
113
|
/>
|
|
106
114
|
<span class="text-sm text-muted">
|
|
107
|
-
{{
|
|
115
|
+
{{
|
|
116
|
+
t("mapo.mediaGallery.nSelected", { number: store.editList.length })
|
|
117
|
+
}}
|
|
108
118
|
</span>
|
|
109
119
|
<div class="flex-1" />
|
|
110
120
|
<UButton
|
|
@@ -114,7 +124,7 @@ function onDragEnd() {
|
|
|
114
124
|
variant="soft"
|
|
115
125
|
@click="store.deleteSelected()"
|
|
116
126
|
>
|
|
117
|
-
|
|
127
|
+
{{ t("mapo.mediaGallery.deleteSelectedLabel") }}
|
|
118
128
|
</UButton>
|
|
119
129
|
<UButton
|
|
120
130
|
icon="i-lucide-x"
|
|
@@ -139,7 +149,9 @@ function onDragEnd() {
|
|
|
139
149
|
class="flex flex-col items-center gap-3 py-16 text-center"
|
|
140
150
|
>
|
|
141
151
|
<UIcon name="i-lucide-image-off" class="size-12 text-dimmed" />
|
|
142
|
-
<p class="text-sm text-muted">
|
|
152
|
+
<p class="text-sm text-muted">
|
|
153
|
+
{{ t("mapo.mediaGallery.noMediaFound") }}
|
|
154
|
+
</p>
|
|
143
155
|
</div>
|
|
144
156
|
|
|
145
157
|
<!-- Grid -->
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref, onMounted, onUnmounted, watch } from "vue";
|
|
2
|
+
import { ref, computed, onMounted, onUnmounted, watch } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
3
4
|
import { debounce } from "@mapomodule/utils";
|
|
4
5
|
import { useMediaStore } from "../stores/media.js";
|
|
5
6
|
import type { SelectMode } from "../types/media.js";
|
|
@@ -37,13 +38,22 @@ const emit = defineEmits<{
|
|
|
37
38
|
];
|
|
38
39
|
}>();
|
|
39
40
|
|
|
41
|
+
const { t } = useI18n();
|
|
40
42
|
const store = useMediaStore();
|
|
41
43
|
// string (not a union) because UTabs' v-model emits string | number
|
|
42
44
|
const activeTab = ref<string>("gallery");
|
|
43
|
-
const tabItems = [
|
|
44
|
-
{
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
const tabItems = computed(() => [
|
|
46
|
+
{
|
|
47
|
+
label: t("mapo.mediaManager.gallery"),
|
|
48
|
+
icon: "i-lucide-images",
|
|
49
|
+
value: "gallery",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: t("mapo.mediaManager.uploader"),
|
|
53
|
+
icon: "i-lucide-upload-cloud",
|
|
54
|
+
value: "upload",
|
|
55
|
+
},
|
|
56
|
+
]);
|
|
47
57
|
const searchValue = ref("");
|
|
48
58
|
const showFolders = ref(!props.noFolders);
|
|
49
59
|
|
|
@@ -119,7 +129,7 @@ onUnmounted(() => {
|
|
|
119
129
|
<UInput
|
|
120
130
|
v-model="searchValue"
|
|
121
131
|
size="xs"
|
|
122
|
-
placeholder="
|
|
132
|
+
:placeholder="t('mapo.search')"
|
|
123
133
|
icon="i-lucide-search"
|
|
124
134
|
:loading="store.loading"
|
|
125
135
|
/>
|
|
@@ -131,7 +141,7 @@ onUnmounted(() => {
|
|
|
131
141
|
size="xs"
|
|
132
142
|
variant="ghost"
|
|
133
143
|
color="neutral"
|
|
134
|
-
title="
|
|
144
|
+
:title="t('mapo.refresh')"
|
|
135
145
|
@click="store.getRoot()"
|
|
136
146
|
/>
|
|
137
147
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, watch, computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
3
4
|
import { useMediaStore } from "../stores/media.js";
|
|
4
5
|
import type { MediaItem, SelectMode } from "../types/media.js";
|
|
5
6
|
|
|
@@ -31,6 +32,7 @@ const emit = defineEmits<{
|
|
|
31
32
|
confirm: [value: MediaItem | MediaItem[]];
|
|
32
33
|
}>();
|
|
33
34
|
|
|
35
|
+
const { t } = useI18n();
|
|
34
36
|
const store = useMediaStore();
|
|
35
37
|
const open = ref(props.modelValue);
|
|
36
38
|
|
|
@@ -89,7 +91,11 @@ watch(
|
|
|
89
91
|
<div class="flex items-center gap-2 border-b border-default px-4 py-3">
|
|
90
92
|
<UIcon name="i-lucide-image" class="size-4 text-dimmed" />
|
|
91
93
|
<span class="flex-1 font-semibold text-highlighted">
|
|
92
|
-
{{
|
|
94
|
+
{{
|
|
95
|
+
selectionMode === "multi"
|
|
96
|
+
? t("mapo.mediaManager.selectMedia")
|
|
97
|
+
: t("mapo.mediaManager.selectAMedia")
|
|
98
|
+
}}
|
|
93
99
|
</span>
|
|
94
100
|
<UButton
|
|
95
101
|
icon="i-lucide-x"
|
|
@@ -120,11 +126,11 @@ watch(
|
|
|
120
126
|
v-if="selectionMode === 'multi' && selectionCount > 0"
|
|
121
127
|
class="text-sm text-muted"
|
|
122
128
|
>
|
|
123
|
-
{{ selectionCount }}
|
|
129
|
+
{{ t("mapo.mediaGallery.nSelected", { number: selectionCount }) }}
|
|
124
130
|
</p>
|
|
125
131
|
<div class="ml-auto flex gap-2">
|
|
126
132
|
<UButton variant="ghost" color="neutral" @click="cancel">
|
|
127
|
-
|
|
133
|
+
{{ t("mapo.cancel") }}
|
|
128
134
|
</UButton>
|
|
129
135
|
<UButton
|
|
130
136
|
color="primary"
|
|
@@ -132,7 +138,7 @@ watch(
|
|
|
132
138
|
icon="i-lucide-check"
|
|
133
139
|
@click="confirm"
|
|
134
140
|
>
|
|
135
|
-
|
|
141
|
+
{{ t("mapo.confirm") }}
|
|
136
142
|
</UButton>
|
|
137
143
|
</div>
|
|
138
144
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, computed, onUnmounted } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
3
4
|
import { humanFileSize } from "@mapomodule/utils";
|
|
4
5
|
import { useMediaStore } from "../stores/media.js";
|
|
5
6
|
import { useSnackStore } from "@mapomodule/store/runtime/stores/snack";
|
|
@@ -26,6 +27,7 @@ const emit = defineEmits<{
|
|
|
26
27
|
uploaded: [];
|
|
27
28
|
}>();
|
|
28
29
|
|
|
30
|
+
const { t } = useI18n();
|
|
29
31
|
const store = useMediaStore();
|
|
30
32
|
const snack = useSnackStore();
|
|
31
33
|
|
|
@@ -72,7 +74,10 @@ function onFiles(files: File[]) {
|
|
|
72
74
|
|
|
73
75
|
if (file.size > limit) {
|
|
74
76
|
snack.show(
|
|
75
|
-
|
|
77
|
+
t("mapo.mediaUploader.fileTooLarge", {
|
|
78
|
+
name: file.name,
|
|
79
|
+
max: (limit / (1024 * 1024)).toFixed(0),
|
|
80
|
+
}),
|
|
76
81
|
"error",
|
|
77
82
|
);
|
|
78
83
|
continue;
|
|
@@ -128,7 +133,10 @@ async function upload() {
|
|
|
128
133
|
successCount++;
|
|
129
134
|
} catch (err) {
|
|
130
135
|
entry.status = "error";
|
|
131
|
-
entry.error =
|
|
136
|
+
entry.error =
|
|
137
|
+
err instanceof Error
|
|
138
|
+
? err.message
|
|
139
|
+
: t("mapo.mediaUploader.uploadFailed");
|
|
132
140
|
}
|
|
133
141
|
}
|
|
134
142
|
|
|
@@ -136,7 +144,7 @@ async function upload() {
|
|
|
136
144
|
|
|
137
145
|
if (successCount > 0) {
|
|
138
146
|
snack.show(
|
|
139
|
-
|
|
147
|
+
t("mapo.mediaUploader.success", { numberFiles: successCount }),
|
|
140
148
|
"success",
|
|
141
149
|
);
|
|
142
150
|
await store.getRoot({ page: 1 });
|
|
@@ -173,12 +181,18 @@ onUnmounted(clearAll);
|
|
|
173
181
|
<UIcon name="i-lucide-upload-cloud" class="size-10 text-dimmed" />
|
|
174
182
|
<div class="text-center">
|
|
175
183
|
<p class="text-sm font-medium text-muted">
|
|
176
|
-
|
|
177
|
-
<span class="text-primary">
|
|
184
|
+
{{ t("mapo.mediaUploader.dragHere") }}
|
|
185
|
+
<span class="text-primary">{{
|
|
186
|
+
t("mapo.mediaUploader.browse")
|
|
187
|
+
}}</span>
|
|
178
188
|
</p>
|
|
179
189
|
<p class="mt-0.5 text-xs text-dimmed">
|
|
180
|
-
|
|
181
|
-
|
|
190
|
+
{{
|
|
191
|
+
t("mapo.mediaUploader.limits", {
|
|
192
|
+
img: (MAX_IMAGE / (1024 * 1024)).toFixed(0),
|
|
193
|
+
vid: (MAX_VIDEO / (1024 * 1024)).toFixed(0),
|
|
194
|
+
})
|
|
195
|
+
}}
|
|
182
196
|
</p>
|
|
183
197
|
</div>
|
|
184
198
|
</div>
|
|
@@ -189,8 +203,13 @@ onUnmounted(clearAll);
|
|
|
189
203
|
<div v-if="entries.length > 0" class="space-y-2">
|
|
190
204
|
<div class="flex items-center justify-between">
|
|
191
205
|
<p class="text-xs font-medium text-muted">
|
|
192
|
-
{{
|
|
193
|
-
|
|
206
|
+
{{
|
|
207
|
+
t(
|
|
208
|
+
"mapo.mediaUploader.nSelected",
|
|
209
|
+
{ n: entries.length },
|
|
210
|
+
entries.length,
|
|
211
|
+
)
|
|
212
|
+
}}
|
|
194
213
|
</p>
|
|
195
214
|
<UButton
|
|
196
215
|
v-if="!uploading"
|
|
@@ -200,7 +219,7 @@ onUnmounted(clearAll);
|
|
|
200
219
|
icon="i-lucide-x"
|
|
201
220
|
@click="clearAll"
|
|
202
221
|
>
|
|
203
|
-
|
|
222
|
+
{{ t("mapo.clear") }}
|
|
204
223
|
</UButton>
|
|
205
224
|
</div>
|
|
206
225
|
|
|
@@ -246,22 +265,26 @@ onUnmounted(clearAll);
|
|
|
246
265
|
v-if="entry.status === 'pending'"
|
|
247
266
|
class="grid grid-cols-2 gap-1.5"
|
|
248
267
|
>
|
|
249
|
-
<UInput
|
|
268
|
+
<UInput
|
|
269
|
+
v-model="entry.title"
|
|
270
|
+
size="xs"
|
|
271
|
+
:placeholder="t('mapo.title')"
|
|
272
|
+
/>
|
|
250
273
|
<UInput
|
|
251
274
|
v-model="entry.alt_text"
|
|
252
275
|
size="xs"
|
|
253
|
-
placeholder="
|
|
276
|
+
:placeholder="t('mapo.altTag')"
|
|
254
277
|
/>
|
|
255
278
|
<UInput
|
|
256
279
|
v-model="entry.description"
|
|
257
280
|
size="xs"
|
|
258
|
-
placeholder="
|
|
281
|
+
:placeholder="t('mapo.description')"
|
|
259
282
|
/>
|
|
260
283
|
<USelect
|
|
261
284
|
v-model="entry.folder"
|
|
262
285
|
:items="folderOptions"
|
|
263
286
|
size="xs"
|
|
264
|
-
placeholder="
|
|
287
|
+
:placeholder="t('mapo.folder')"
|
|
265
288
|
/>
|
|
266
289
|
</div>
|
|
267
290
|
|
|
@@ -279,7 +302,9 @@ onUnmounted(clearAll);
|
|
|
279
302
|
class="flex items-center gap-1 text-success"
|
|
280
303
|
>
|
|
281
304
|
<UIcon name="i-lucide-check-circle" class="size-3.5" />
|
|
282
|
-
<span class="text-xs">
|
|
305
|
+
<span class="text-xs">{{
|
|
306
|
+
t("mapo.mediaUploader.uploaded")
|
|
307
|
+
}}</span>
|
|
283
308
|
</div>
|
|
284
309
|
<div
|
|
285
310
|
v-if="entry.status === 'error'"
|
|
@@ -316,7 +341,9 @@ onUnmounted(clearAll);
|
|
|
316
341
|
color="primary"
|
|
317
342
|
@click="upload"
|
|
318
343
|
>
|
|
319
|
-
|
|
344
|
+
{{
|
|
345
|
+
t("mapo.mediaUploader.uploadCta", { n: pendingCount }, pendingCount)
|
|
346
|
+
}}
|
|
320
347
|
</UButton>
|
|
321
348
|
</div>
|
|
322
349
|
</div>
|