@mapomodule/uikit 2.0.0-beta.7 → 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.
Files changed (115) hide show
  1. package/dist/index.d.mts +1 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.mjs +1 -1
  5. package/dist/module.d.mts +1 -0
  6. package/dist/module.d.ts.map +1 -1
  7. package/dist/module.json +1 -1
  8. package/dist/module.mjs +13 -2
  9. package/dist/runtime/components/MapoConfirmDialog.vue +5 -3
  10. package/dist/runtime/components/MapoConfirmDialog.vue.d.ts.map +1 -1
  11. package/dist/runtime/components/MapoDetail.vue +40 -32
  12. package/dist/runtime/components/MapoDetail.vue.d.ts.map +1 -1
  13. package/dist/runtime/components/MapoDetailLangSwitch.vue +1 -1
  14. package/dist/runtime/components/MapoDropArea.vue +5 -1
  15. package/dist/runtime/components/MapoDropArea.vue.d.ts.map +1 -1
  16. package/dist/runtime/components/MapoLangSwitcher.vue +39 -0
  17. package/dist/runtime/components/MapoLangSwitcher.vue.d.ts +18 -0
  18. package/dist/runtime/components/MapoLangSwitcher.vue.d.ts.map +1 -0
  19. package/dist/runtime/components/MapoList.vue +2 -2
  20. package/dist/runtime/components/MapoListActions.vue +15 -8
  21. package/dist/runtime/components/MapoListActions.vue.d.ts.map +1 -1
  22. package/dist/runtime/components/MapoListFilters.vue +4 -2
  23. package/dist/runtime/components/MapoListFilters.vue.d.ts.map +1 -1
  24. package/dist/runtime/components/MapoListQuickEdit.vue +13 -9
  25. package/dist/runtime/components/MapoListQuickEdit.vue.d.ts.map +1 -1
  26. package/dist/runtime/components/MapoListTable.vue +25 -20
  27. package/dist/runtime/components/MapoListTable.vue.d.ts.map +1 -1
  28. package/dist/runtime/components/MapoLogin.vue +13 -10
  29. package/dist/runtime/components/MapoLogin.vue.d.ts.map +1 -1
  30. package/dist/runtime/components/MapoLogoutButton.vue +4 -2
  31. package/dist/runtime/components/MapoLogoutButton.vue.d.ts.map +1 -1
  32. package/dist/runtime/components/MapoMediaBreadcrumbs.vue +3 -1
  33. package/dist/runtime/components/MapoMediaBreadcrumbs.vue.d.ts.map +1 -1
  34. package/dist/runtime/components/MapoMediaEditor.vue +26 -16
  35. package/dist/runtime/components/MapoMediaEditor.vue.d.ts.map +1 -1
  36. package/dist/runtime/components/MapoMediaFileChanger.vue +8 -4
  37. package/dist/runtime/components/MapoMediaFileChanger.vue.d.ts.map +1 -1
  38. package/dist/runtime/components/MapoMediaFolders.vue +36 -14
  39. package/dist/runtime/components/MapoMediaFolders.vue.d.ts.map +1 -1
  40. package/dist/runtime/components/MapoMediaGallery.vue +15 -5
  41. package/dist/runtime/components/MapoMediaGallery.vue.d.ts.map +1 -1
  42. package/dist/runtime/components/MapoMediaManager.vue +18 -8
  43. package/dist/runtime/components/MapoMediaManager.vue.d.ts.map +1 -1
  44. package/dist/runtime/components/MapoMediaManagerDialog.vue +9 -5
  45. package/dist/runtime/components/MapoMediaManagerDialog.vue.d.ts.map +1 -1
  46. package/dist/runtime/components/MapoMediaPreview.vue +1 -1
  47. package/dist/runtime/components/MapoMediaUploader.vue +40 -16
  48. package/dist/runtime/components/MapoMediaUploader.vue.d.ts.map +1 -1
  49. package/dist/runtime/components/MapoMenuManager.vue +273 -0
  50. package/dist/runtime/components/MapoMenuManager.vue.d.ts +92 -0
  51. package/dist/runtime/components/MapoMenuManager.vue.d.ts.map +1 -0
  52. package/dist/runtime/components/MapoMenuNodeEditor.vue +201 -0
  53. package/dist/runtime/components/MapoMenuNodeEditor.vue.d.ts +61 -0
  54. package/dist/runtime/components/MapoMenuNodeEditor.vue.d.ts.map +1 -0
  55. package/dist/runtime/components/MapoMenuTreeview.vue +181 -0
  56. package/dist/runtime/components/MapoMenuTreeview.vue.d.ts +57 -0
  57. package/dist/runtime/components/MapoMenuTreeview.vue.d.ts.map +1 -0
  58. package/dist/runtime/components/MapoMenuTreeviewNode.vue +175 -0
  59. package/dist/runtime/components/MapoMenuTreeviewNode.vue.d.ts +27 -0
  60. package/dist/runtime/components/MapoMenuTreeviewNode.vue.d.ts.map +1 -0
  61. package/dist/runtime/components/MapoSidebar.vue +3 -1
  62. package/dist/runtime/components/MapoSidebar.vue.d.ts.map +1 -1
  63. package/dist/runtime/components/MapoSidebarList.vue +1 -1
  64. package/dist/runtime/components/MapoSidebarProfile.vue +6 -2
  65. package/dist/runtime/components/MapoSidebarProfile.vue.d.ts.map +1 -1
  66. package/dist/runtime/components/MapoThemeToggle.vue +5 -1
  67. package/dist/runtime/components/MapoThemeToggle.vue.d.ts.map +1 -1
  68. package/dist/runtime/components/menuDndContext.d.ts +19 -0
  69. package/dist/runtime/components/menuDndContext.d.ts.map +1 -0
  70. package/dist/runtime/components/menuDndContext.js +3 -0
  71. package/dist/runtime/pages/index.vue +4 -2
  72. package/dist/runtime/pages/index.vue.d.ts.map +1 -1
  73. package/dist/runtime/plugins/media-adapter.d.ts.map +1 -1
  74. package/dist/runtime/plugins/media-adapter.js +2 -1
  75. package/dist/runtime/stores/media.d.ts.map +1 -1
  76. package/dist/runtime/stores/media.js +29 -13
  77. package/dist/runtime/types/menu.d.ts +66 -0
  78. package/dist/runtime/types/menu.d.ts.map +1 -0
  79. package/dist/runtime/types/menu.js +30 -0
  80. package/package.json +11 -8
  81. package/src/index.ts +12 -0
  82. package/src/module.ts +17 -0
  83. package/src/runtime/components/MapoConfirmDialog.vue +5 -3
  84. package/src/runtime/components/MapoDetail.vue +39 -36
  85. package/src/runtime/components/MapoDetailLangSwitch.vue +1 -1
  86. package/src/runtime/components/MapoDropArea.vue +6 -1
  87. package/src/runtime/components/MapoLangSwitcher.vue +74 -0
  88. package/src/runtime/components/MapoList.vue +1 -1
  89. package/src/runtime/components/MapoListActions.vue +16 -10
  90. package/src/runtime/components/MapoListFilters.vue +5 -2
  91. package/src/runtime/components/MapoListQuickEdit.vue +12 -9
  92. package/src/runtime/components/MapoListTable.vue +25 -20
  93. package/src/runtime/components/MapoLogin.vue +13 -10
  94. package/src/runtime/components/MapoLogoutButton.vue +4 -2
  95. package/src/runtime/components/MapoMediaBreadcrumbs.vue +3 -1
  96. package/src/runtime/components/MapoMediaEditor.vue +26 -16
  97. package/src/runtime/components/MapoMediaFileChanger.vue +8 -3
  98. package/src/runtime/components/MapoMediaFolders.vue +37 -15
  99. package/src/runtime/components/MapoMediaGallery.vue +17 -5
  100. package/src/runtime/components/MapoMediaManager.vue +17 -7
  101. package/src/runtime/components/MapoMediaManagerDialog.vue +10 -4
  102. package/src/runtime/components/MapoMediaUploader.vue +43 -16
  103. package/src/runtime/components/MapoMenuManager.vue +402 -0
  104. package/src/runtime/components/MapoMenuNodeEditor.vue +282 -0
  105. package/src/runtime/components/MapoMenuTreeview.vue +264 -0
  106. package/src/runtime/components/MapoMenuTreeviewNode.vue +234 -0
  107. package/src/runtime/components/MapoSidebar.vue +3 -1
  108. package/src/runtime/components/MapoSidebarList.vue +1 -1
  109. package/src/runtime/components/MapoSidebarProfile.vue +6 -2
  110. package/src/runtime/components/MapoThemeToggle.vue +5 -1
  111. package/src/runtime/components/menuDndContext.ts +22 -0
  112. package/src/runtime/pages/index.vue +5 -2
  113. package/src/runtime/plugins/media-adapter.ts +9 -5
  114. package/src/runtime/stores/media.ts +29 -13
  115. package/src/runtime/types/menu.ts +105 -0
@@ -1,7 +1,9 @@
1
1
  <script setup>
2
2
  import { ref, computed, watch } from "vue";
3
+ import { useI18n } from "vue-i18n";
3
4
  import { useSnackStore } from "@mapomodule/store/runtime/stores/snack";
4
5
  import { useCrud } from "@mapomodule/core/runtime/api/crud";
6
+ import { getErrorDetail } from "@mapomodule/core/runtime/utils/fetchError";
5
7
  const props = defineProps({
6
8
  open: { type: Boolean, required: true },
7
9
  endpoint: { type: String, required: false, default: "" },
@@ -9,12 +11,13 @@ const props = defineProps({
9
11
  editFields: { type: Array, required: false, default: () => [] },
10
12
  lookup: { type: String, required: false, default: "id" },
11
13
  languages: { type: Array, required: false },
12
- registry: { type: Object, required: false },
14
+ registry: { type: null, required: false },
13
15
  offline: { type: Boolean, required: false, default: false },
14
16
  localItem: { type: null, required: false, default: null }
15
17
  });
16
18
  const emit = defineEmits(["update:open", "saved"]);
17
19
  defineSlots();
20
+ const { t } = useI18n();
18
21
  const snack = useSnackStore();
19
22
  const crud = useCrud(props.endpoint);
20
23
  const model = ref({});
@@ -40,7 +43,7 @@ watch(
40
43
  try {
41
44
  model.value = await crud.detail(id);
42
45
  } catch {
43
- snack.show("Failed to load item", "error");
46
+ snack.show(t("mapo.loadItemError"), "error");
44
47
  isOpen.value = false;
45
48
  } finally {
46
49
  loading.value = false;
@@ -51,18 +54,17 @@ async function save() {
51
54
  saving.value = true;
52
55
  try {
53
56
  if (props.offline) {
54
- snack.show("Saved", "success");
57
+ snack.show(t("mapo.saveSuccess"), "success");
55
58
  emit("saved", { ...model.value });
56
59
  isOpen.value = false;
57
60
  return;
58
61
  }
59
62
  const result = props.itemId != null ? await crud.partialUpdate(props.itemId, model.value) : await crud.create(model.value);
60
- snack.show("Saved", "success");
63
+ snack.show(t("mapo.saveSuccess"), "success");
61
64
  emit("saved", result);
62
65
  isOpen.value = false;
63
66
  } catch (err) {
64
- const detail = err?.response?.data?.detail;
65
- snack.show(detail ?? "Failed to save", "error");
67
+ snack.show(getErrorDetail(err) ?? t("mapo.saveError"), "error");
66
68
  } finally {
67
69
  saving.value = false;
68
70
  }
@@ -75,7 +77,9 @@ async function save() {
75
77
  <div class="p-6 space-y-4">
76
78
  <div class="flex items-center justify-between">
77
79
  <h3 class="text-base font-semibold text-highlighted">
78
- {{ itemId != null ? "Edit" : "New item" }}
80
+ {{
81
+ itemId != null ? t("mapo.edit") : t("mapo.listQuickEdit.newItem")
82
+ }}
79
83
  </h3>
80
84
  <UButton
81
85
  size="xs"
@@ -106,10 +110,10 @@ async function save() {
106
110
 
107
111
  <div class="flex justify-end gap-2 pt-2">
108
112
  <UButton variant="ghost" color="neutral" @click="isOpen = false">
109
- Cancel
113
+ {{ t("mapo.cancel") }}
110
114
  </UButton>
111
115
  <UButton color="primary" :loading="saving" @click="save">
112
- Save
116
+ {{ t("mapo.save") }}
113
117
  </UButton>
114
118
  </div>
115
119
  </template>
@@ -1 +1 @@
1
- {"version":3,"file":"MapoListQuickEdit.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoListQuickEdit.vue"],"names":[],"mappings":"AAwKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIhF,QAAA,MAAM,YAAY,GAAK,CAAC,SAAS,MAAM,EACtC,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,gBAAgB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAClE;WAgUO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;cA9T9C,OAAO;mBACF,MAAM;iBACR,MAAM,GAAG,MAAM,GAAG,IAAI;qBAClB,kBAAkB,CAAC,CAAC,CAAC,EAAE;iBAC3B,MAAM;oBACH,MAAM,EAAE;mBACT,aAAa;QACxB;;;;WAIG;kBACO,OAAO;QACjB,kFAAkF;oBACtE,CAAC,GAAG,IAAI;;;;KAgTmE,CAAC,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC5J,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;;QA9RT;;;WAGG;qBACU;YAAE,KAAK,EAAE,CAAC,CAAA;SAAE,GAAG,GAAG;;;EA8R7B,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IA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,GAAG,CAAC,GAAG,EAAE,CAAC;YAC5J,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;;QAlST;;;WAGG;qBACU;YAAE,KAAK,EAAE,CAAC,CAAA;SAAE,GAAG,GAAG;;;EAkS7B,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAI,CAAC;wBACvD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
@@ -8,12 +8,13 @@ import {
8
8
  resolveComponent,
9
9
  useSlots
10
10
  } from "vue";
11
+ import { useI18n } from "vue-i18n";
11
12
  import { useSnackStore } from "@mapomodule/store/runtime/stores/snack";
12
13
  import { useConfirmStore } from "@mapomodule/store/runtime/stores/confirm";
13
14
  import { usePermissions } from "@mapomodule/store/runtime/composables/usePermissions";
14
15
  import { useCrud } from "@mapomodule/core/runtime/api/crud";
15
16
  import { debounce, splitEndpointParams } from "@mapomodule/utils";
16
- import { useRoute, useRouter } from "vue-router";
17
+ import { useRoute, useRouter } from "#app";
17
18
  const props = defineProps({
18
19
  endpoint: { type: String, required: false, default: "" },
19
20
  items: { type: Array, required: false, default: void 0 },
@@ -31,7 +32,7 @@ const props = defineProps({
31
32
  positionField: { type: String, required: false, default: "position" },
32
33
  editFields: { type: Array, required: false, default: () => [] },
33
34
  languages: { type: Array, required: false },
34
- registry: { type: Object, required: false },
35
+ registry: { type: null, required: false },
35
36
  detailBase: { type: String, required: false },
36
37
  permissionModel: { type: String, required: false }
37
38
  });
@@ -42,6 +43,7 @@ defineExpose({ refresh });
42
43
  defineSlots();
43
44
  const slots = useSlots();
44
45
  const atKey = (item, key) => item[key];
46
+ const { t } = useI18n();
45
47
  const snack = useSnackStore();
46
48
  const confirm = useConfirmStore();
47
49
  const route = useRoute();
@@ -165,9 +167,9 @@ const quickEditLocalItem = computed(() => {
165
167
  });
166
168
  async function deleteRow(item) {
167
169
  const ok = await confirm.ask({
168
- title: "Delete item",
169
- message: "Are you sure you want to delete this item?",
170
- confirmText: "Delete",
170
+ title: t("mapo.listTable.deleteItemTitle"),
171
+ message: t("mapo.confirmDelete"),
172
+ confirmText: t("mapo.delete"),
171
173
  dangerous: true
172
174
  });
173
175
  if (!ok) return;
@@ -176,16 +178,16 @@ async function deleteRow(item) {
176
178
  (r) => String(atKey(r, props.lookup)) !== String(atKey(item, props.lookup))
177
179
  );
178
180
  emit("update:items", next);
179
- snack.show("Item deleted", "success");
181
+ snack.show(t("mapo.listTable.itemDeleted"), "success");
180
182
  return;
181
183
  }
182
184
  try {
183
185
  await crud.delete(atKey(item, props.lookup));
184
- snack.show("Item deleted", "success");
186
+ snack.show(t("mapo.listTable.itemDeleted"), "success");
185
187
  if (hybridMode.value) hybridLoaded.value = false;
186
188
  refresh();
187
189
  } catch {
188
- snack.show("Failed to delete item", "error");
190
+ snack.show(t("mapo.listTable.deleteItemError"), "error");
189
191
  }
190
192
  }
191
193
  const canReorder = computed(
@@ -270,13 +272,13 @@ async function onDrop(fromIdx, toIdx) {
270
272
  atKey(moved, props.lookup),
271
273
  atKey(target, props.lookup)
272
274
  );
273
- snack.show("Order saved", "success");
275
+ snack.show(t("mapo.listTable.orderSaved"), "success");
274
276
  if (hybridMode.value) {
275
277
  hybridLoaded.value = false;
276
278
  refresh();
277
279
  }
278
280
  } catch {
279
- snack.show("Failed to save order", "error");
281
+ snack.show(t("mapo.listTable.orderError"), "error");
280
282
  refresh();
281
283
  }
282
284
  }
@@ -349,7 +351,7 @@ async function fetchAll() {
349
351
  fullDataset.value = nextItems;
350
352
  hybridLoaded.value = true;
351
353
  } catch {
352
- snack.show("Failed to load data", "error");
354
+ snack.show(t("mapo.loadError"), "error");
353
355
  } finally {
354
356
  loading.value = false;
355
357
  }
@@ -401,7 +403,7 @@ async function refresh() {
401
403
  rows.value = nextItems;
402
404
  total.value = nextTotal;
403
405
  } catch {
404
- snack.show("Failed to load data", "error");
406
+ snack.show(t("mapo.loadError"), "error");
405
407
  } finally {
406
408
  loading.value = false;
407
409
  }
@@ -443,14 +445,14 @@ const tableColumns = computed(() => {
443
445
  modelValue: isAllSelected.value,
444
446
  indeterminate: isIndeterminate.value,
445
447
  "onUpdate:modelValue": toggleAll,
446
- ariaLabel: "Select all rows"
448
+ ariaLabel: t("mapo.listTable.selectAllRows")
447
449
  }),
448
450
  cell: ({ row }) => {
449
451
  const k = pkOf(row.original);
450
452
  return h(UCheckbox, {
451
453
  modelValue: !!rowSelection.value[k],
452
454
  "onUpdate:modelValue": () => toggleRowByKey(k),
453
- ariaLabel: "Select row"
455
+ ariaLabel: t("mapo.listTable.selectRow")
454
456
  });
455
457
  },
456
458
  meta: { class: { th: "w-10", td: "w-10" } }
@@ -464,7 +466,7 @@ const tableColumns = computed(() => {
464
466
  {
465
467
  class: canReorder.value ? "cursor-grab text-muted" : "cursor-not-allowed text-muted opacity-30",
466
468
  draggable: canReorder.value,
467
- title: canReorder.value ? "Drag to reorder" : "Clear search & sorting to reorder",
469
+ title: canReorder.value ? t("mapo.listTable.dragToReorder") : t("mapo.listTable.clearToReorder"),
468
470
  onDragstart: (e) => {
469
471
  e.dataTransfer?.setData("text/plain", "");
470
472
  onDragStart(row.index);
@@ -559,7 +561,7 @@ const sortingOptions = computed(() => ({
559
561
  <div v-if="searchable" class="flex items-center gap-2">
560
562
  <UInput
561
563
  :model-value="search"
562
- placeholder="Search..."
564
+ :placeholder="t('mapo.search')"
563
565
  icon="i-lucide-search"
564
566
  size="sm"
565
567
  class="max-w-xs"
@@ -583,7 +585,7 @@ const sortingOptions = computed(() => ({
583
585
  :pagination-options="paginationOptions"
584
586
  :sorting="sorting"
585
587
  :sorting-options="sortingOptions"
586
- empty="No items found"
588
+ :empty="t('mapo.listTable.noItems')"
587
589
  @update:pagination="pagination = $event ?? pagination"
588
590
  @update:sorting="sorting = $event ?? sorting"
589
591
  >
@@ -591,7 +593,7 @@ const sortingOptions = computed(() => ({
591
593
  <slot name="dtable.empty">
592
594
  <div class="flex flex-col items-center gap-2 py-8 text-muted">
593
595
  <UIcon name="i-lucide-inbox" class="h-8 w-8" />
594
- <span class="text-sm">No items found</span>
596
+ <span class="text-sm">{{ t("mapo.listTable.noItems") }}</span>
595
597
  </div>
596
598
  </slot>
597
599
  </template>
@@ -611,7 +613,7 @@ const sortingOptions = computed(() => ({
611
613
 
612
614
  <!-- Pagination controls -->
613
615
  <div class="flex items-center justify-between text-sm text-muted">
614
- <span>{{ total }} items</span>
616
+ <span>{{ t("mapo.listTable.totalItems", { total }) }}</span>
615
617
  <UPagination
616
618
  :model-value="pagination.pageIndex + 1"
617
619
  :total="total"
@@ -624,7 +626,10 @@ const sortingOptions = computed(() => ({
624
626
  <USelect
625
627
  :model-value="pagination.pageSize"
626
628
  :items="
627
- pageSizeOptions.map((n) => ({ label: `${n} / page`, value: n }))
629
+ pageSizeOptions.map((n) => ({
630
+ label: t('mapo.listTable.perPage', { n }),
631
+ value: n
632
+ }))
628
633
  "
629
634
  size="xs"
630
635
  class="w-28"
@@ -1 +1 @@
1
- {"version":3,"file":"MapoListTable.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoListTable.vue"],"names":[],"mappings":"AA66BA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIhF,QAAA,MAAM,YAAY,GAAK,CAAC,SAAS,MAAM,EACtC,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D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C,OAAO,WAAW,CAAC,CAAA;CAAI,CAAC;wBACvD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
@@ -1,9 +1,10 @@
1
1
  <script setup>
2
2
  import { reactive, ref } from "vue";
3
+ import { useI18n } from "vue-i18n";
3
4
  import { useMapoAuth } from "@mapomodule/core/runtime/auth/useMapoAuth";
4
- import { useRoute } from "vue-router";
5
- import { navigateTo } from "#app";
5
+ import { useRoute, navigateTo } from "#app";
6
6
  defineSlots();
7
+ const { t } = useI18n();
7
8
  const { login } = useMapoAuth();
8
9
  const route = useRoute();
9
10
  const form = reactive({ username: "", password: "" });
@@ -25,7 +26,7 @@ async function submit() {
25
26
  if (data.username?.length) fieldErrors.username = data.username[0];
26
27
  if (data.password?.length) fieldErrors.password = data.password[0];
27
28
  } else {
28
- error.value = "Invalid credentials. Please try again.";
29
+ error.value = t("mapo.login.invalidCredentials");
29
30
  }
30
31
  } finally {
31
32
  loading.value = false;
@@ -61,9 +62,11 @@ async function submit() {
61
62
  <UIcon name="i-lucide-layers" class="size-10 text-white" />
62
63
  </div>
63
64
  <div class="space-y-2">
64
- <h2 class="text-3xl font-bold tracking-tight">Welcome to Mapo</h2>
65
+ <h2 class="text-3xl font-bold tracking-tight">
66
+ {{ t("mapo.login.welcome") }}
67
+ </h2>
65
68
  <p class="text-white/70 text-sm leading-relaxed max-w-xs">
66
- A modern admin framework built on Nuxt 4, Pinia, and Nuxt UI v4.
69
+ {{ t("mapo.login.tagline") }}
67
70
  </p>
68
71
  </div>
69
72
  <div class="flex gap-2 flex-wrap justify-center">
@@ -109,10 +112,10 @@ async function submit() {
109
112
  </div>
110
113
  <div>
111
114
  <h1 class="text-2xl font-bold text-highlighted tracking-tight">
112
- Sign in
115
+ {{ t("mapo.signIn") }}
113
116
  </h1>
114
117
  <p class="text-sm text-muted mt-1">
115
- Enter your credentials to continue
118
+ {{ t("mapo.login.subtitle") }}
116
119
  </p>
117
120
  </div>
118
121
  </div>
@@ -123,7 +126,7 @@ async function submit() {
123
126
  <UCard class="shadow-xl ring-1 ring-default/60">
124
127
  <form class="space-y-5" @submit.prevent="submit">
125
128
  <UFormField
126
- label="Username"
129
+ :label="t('mapo.username')"
127
130
  name="username"
128
131
  :error="fieldErrors.username"
129
132
  >
@@ -140,7 +143,7 @@ async function submit() {
140
143
  </UFormField>
141
144
 
142
145
  <UFormField
143
- label="Password"
146
+ :label="t('mapo.password')"
144
147
  name="password"
145
148
  :error="fieldErrors.password"
146
149
  >
@@ -179,7 +182,7 @@ async function submit() {
179
182
  :disabled="!form.username || !form.password"
180
183
  block
181
184
  >
182
- Sign in
185
+ {{ t("mapo.signIn") }}
183
186
  </UButton>
184
187
  </form>
185
188
  </UCard>
@@ -1 +1 @@
1
- {"version":3,"file":"MapoLogin.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoLogin.vue"],"names":[],"mappings":"AAyNA,KAAK,WAAW,GAAG;IACjB,yEAAyE;IACzE,KAAK,IAAI,OAAO,CAAC;IACjB,8CAA8C;IAC9C,KAAK,IAAI,OAAO,CAAC;IACjB,uEAAuE;IACvE,aAAa,IAAI,OAAO,CAAC;IACzB,wEAAwE;IACxE,YAAY,IAAI,OAAO,CAAC;IACxB,wDAAwD;IACxD,MAAM,IAAI,OAAO,CAAC;CACnB,CAAC;AA0dF,QAAA,MAAM,UAAU,+QACd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"MapoLogin.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoLogin.vue"],"names":[],"mappings":"AA4NA,KAAK,WAAW,GAAG;IACjB,yEAAyE;IACzE,KAAK,IAAI,OAAO,CAAC;IACjB,8CAA8C;IAC9C,KAAK,IAAI,OAAO,CAAC;IACjB,uEAAuE;IACvE,aAAa,IAAI,OAAO,CAAC;IACzB,wEAAwE;IACxE,YAAY,IAAI,OAAO,CAAC;IACxB,wDAAwD;IACxD,MAAM,IAAI,OAAO,CAAC;CACnB,CAAC;AAmeF,QAAA,MAAM,UAAU,+QACd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { useI18n } from "vue-i18n";
2
3
  import { useMapoAuth } from "@mapomodule/core/runtime/auth/useMapoAuth";
3
4
  defineProps({
4
5
  variant: { type: String, required: false, default: "ghost" },
@@ -6,6 +7,7 @@ defineProps({
6
7
  size: { type: String, required: false, default: "sm" },
7
8
  iconOnly: { type: Boolean, required: false, default: false }
8
9
  });
10
+ const { t } = useI18n();
9
11
  const { logout } = useMapoAuth();
10
12
  </script>
11
13
 
@@ -15,11 +17,11 @@ const { logout } = useMapoAuth();
15
17
  :color="color"
16
18
  :size="size"
17
19
  icon="i-lucide-log-out"
18
- :aria-label="iconOnly ? 'Logout' : void 0"
20
+ :aria-label="iconOnly ? t('mapo.logout') : void 0"
19
21
  @click="logout()"
20
22
  >
21
23
  <span v-if="!iconOnly">
22
- <slot>Logout</slot>
24
+ <slot>{{ t("mapo.logout") }}</slot>
23
25
  </span>
24
26
  </UButton>
25
27
  </template>
@@ -1 +1 @@
1
- {"version":3,"file":"MapoLogoutButton.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoLogoutButton.vue"],"names":[],"mappings":"AAmDA,KAAK,WAAW,GAAG;IACf,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAC1D,oCAAoC;IACpC,KAAK,CAAC,EACF,SAAS,GACT,WAAW,GACX,SAAS,GACT,MAAM,GACN,SAAS,GACT,SAAS,GACT,OAAO,CAAC;IACZ,mCAAmC;IACnC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA8EJ,QAAA,IAAI,QAAQ,IAAW,CAAE;AACzB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU;UAxFL,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;WARnC,SAAS,GACT,WAAW,GACX,SAAS,GACT,MAAM,GACN,SAAS,GACT,SAAS,GACT,OAAO;aATD,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM;cAa9C,OAAO;6EAyFpB,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"MapoLogoutButton.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoLogoutButton.vue"],"names":[],"mappings":"AAsDA,KAAK,WAAW,GAAG;IACf,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAC1D,oCAAoC;IACpC,KAAK,CAAC,EACF,SAAS,GACT,WAAW,GACX,SAAS,GACT,MAAM,GACN,SAAS,GACT,SAAS,GACT,OAAO,CAAC;IACZ,mCAAmC;IACnC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAiFJ,QAAA,IAAI,QAAQ,IAAW,CAAE;AACzB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU;UA3FL,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;WARnC,SAAS,GACT,WAAW,GACX,SAAS,GACT,MAAM,GACN,SAAS,GACT,SAAS,GACT,OAAO;aATD,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM;cAa9C,OAAO;6EA4FpB,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1,10 +1,12 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
+ import { useI18n } from "vue-i18n";
3
4
  import { useMediaStore } from "../stores/media.js";
5
+ const { t } = useI18n();
4
6
  const store = useMediaStore();
5
7
  const items = computed(() => [
6
8
  {
7
- label: "Media",
9
+ label: t("mapo.mediaManager.root"),
8
10
  icon: "i-lucide-folder-open",
9
11
  folder: null
10
12
  },
@@ -1 +1 @@
1
- {"version":3,"file":"MapoMediaBreadcrumbs.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMediaBreadcrumbs.vue"],"names":[],"mappings":"AA8KA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"MapoMediaBreadcrumbs.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMediaBreadcrumbs.vue"],"names":[],"mappings":"AAkLA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
2
  import { ref, watch, computed } from "vue";
3
+ import { useI18n } from "vue-i18n";
3
4
  import { useRuntimeConfig } from "#app";
4
5
  import {
5
6
  humanFileSize,
@@ -13,6 +14,7 @@ defineProps({
13
14
  languages: { type: Array, required: false },
14
15
  defaultLang: { type: String, required: false }
15
16
  });
17
+ const { t } = useI18n();
16
18
  const store = useMediaStore();
17
19
  const runtimeConfig = useRuntimeConfig();
18
20
  const permissionsModel = (runtimeConfig.public.mapoMedia ?? {}).permissionsModel ?? "media";
@@ -41,24 +43,32 @@ const metaRows = computed(() => {
41
43
  if (!media.value) return [];
42
44
  const m = media.value;
43
45
  return [
44
- { label: "File", value: m.file?.split("/").pop() ?? "", isUrl: false },
45
- { label: "MIME", value: m.mime_type, isUrl: false },
46
46
  {
47
- label: "Size",
47
+ label: t("mapo.file"),
48
+ value: m.file?.split("/").pop() ?? "",
49
+ isUrl: false
50
+ },
51
+ { label: t("mapo.mime"), value: m.mime_type, isUrl: false },
52
+ {
53
+ label: t("mapo.size"),
48
54
  value: m.size ? humanFileSize(m.size) : "\u2014",
49
55
  isUrl: false
50
56
  },
51
- { label: "Created", value: formatDate(m.created), isUrl: false },
52
- { label: "URL", value: m.file, isUrl: true }
57
+ { label: t("mapo.created"), value: formatDate(m.created), isUrl: false },
58
+ { label: t("mapo.url"), value: m.file, isUrl: true }
53
59
  ];
54
60
  });
55
61
  const editFields = computed(() => {
56
62
  const lang = currentLang.value;
57
63
  const prefix = lang ? `translations.${lang}.` : "";
58
64
  return [
59
- { path: `${prefix}title`, label: "Title", type: "text" },
60
- { path: `${prefix}alt_text`, label: "Alt text", type: "text" },
61
- { path: `${prefix}description`, label: "Description", type: "textarea" }
65
+ { path: `${prefix}title`, label: t("mapo.title"), type: "text" },
66
+ { path: `${prefix}alt_text`, label: t("mapo.altTag"), type: "text" },
67
+ {
68
+ path: `${prefix}description`,
69
+ label: t("mapo.description"),
70
+ type: "textarea"
71
+ }
62
72
  ];
63
73
  });
64
74
  function getFieldValue(path) {
@@ -144,7 +154,7 @@ function formatDate(dateStr) {
144
154
  color="neutral"
145
155
  @click="startEditing"
146
156
  >
147
- Edit
157
+ {{ t("mapo.edit") }}
148
158
  </UButton>
149
159
  <UButton
150
160
  icon="i-lucide-external-link"
@@ -153,7 +163,7 @@ function formatDate(dateStr) {
153
163
  color="neutral"
154
164
  :href="media.file"
155
165
  target="_blank"
156
- title="Open in new tab"
166
+ :title="t('mapo.mediaEditor.openInNewTab')"
157
167
  />
158
168
  </div>
159
169
 
@@ -168,7 +178,7 @@ function formatDate(dateStr) {
168
178
  <p
169
179
  class="mb-2 text-xs font-semibold uppercase tracking-wide text-dimmed"
170
180
  >
171
- Info
181
+ {{ t("mapo.mediaEditor.details") }}
172
182
  </p>
173
183
  <dl class="space-y-1">
174
184
  <div
@@ -198,7 +208,7 @@ function formatDate(dateStr) {
198
208
  <p
199
209
  class="mb-1 text-xs font-semibold uppercase tracking-wide text-dimmed"
200
210
  >
201
- Linked models
211
+ {{ t("mapo.linkedModels") }}
202
212
  </p>
203
213
  <ul class="space-y-0.5 text-xs text-muted">
204
214
  <li
@@ -220,7 +230,7 @@ function formatDate(dateStr) {
220
230
  color="neutral"
221
231
  @click="currentLang = ''"
222
232
  >
223
- Default
233
+ {{ t("mapo.mediaEditor.defaultLang") }}
224
234
  </UButton>
225
235
  <UButton
226
236
  v-for="lang in languages"
@@ -278,7 +288,7 @@ function formatDate(dateStr) {
278
288
  color="error"
279
289
  @click="store.deleteMedia(media)"
280
290
  >
281
- Delete
291
+ {{ t("mapo.delete") }}
282
292
  </UButton>
283
293
  <span v-else />
284
294
 
@@ -290,7 +300,7 @@ function formatDate(dateStr) {
290
300
  color="neutral"
291
301
  @click="cancelEditing"
292
302
  >
293
- Cancel
303
+ {{ t("mapo.cancel") }}
294
304
  </UButton>
295
305
  <UButton
296
306
  v-if="editing"
@@ -300,7 +310,7 @@ function formatDate(dateStr) {
300
310
  icon="i-lucide-save"
301
311
  @click="save"
302
312
  >
303
- Save
313
+ {{ t("mapo.save") }}
304
314
  </UButton>
305
315
  </div>
306
316
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"MapoMediaEditor.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMediaEditor.vue"],"names":[],"mappings":"AAmWA,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AA6vBF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"MapoMediaEditor.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMediaEditor.vue"],"names":[],"mappings":"AA8WA,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AA8wBF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,8 +1,10 @@
1
1
  <script setup>
2
2
  import { ref, computed, onUnmounted } from "vue";
3
+ import { useI18n } from "vue-i18n";
3
4
  import { humanFileSize } from "@mapomodule/utils";
5
+ const { t } = useI18n();
4
6
  const props = defineProps({
5
- media: { type: Object, required: true },
7
+ media: { type: null, required: true },
6
8
  accept: { type: String, required: false }
7
9
  });
8
10
  const emit = defineEmits(["update:file", "update:maintainUrl"]);
@@ -45,7 +47,9 @@ function onMaintainUrlChange(v) {
45
47
 
46
48
  <template>
47
49
  <div class="mapo-media-file-changer space-y-2">
48
- <p class="text-xs font-medium text-muted">Replace file</p>
50
+ <p class="text-xs font-medium text-muted">
51
+ {{ t("mapo.mediaFileChanger.replaceFile") }}
52
+ </p>
49
53
 
50
54
  <MapoDropArea
51
55
  :accept="acceptTypes"
@@ -92,7 +96,7 @@ function onMaintainUrlChange(v) {
92
96
  class="flex flex-1 items-center gap-2 text-sm text-dimmed"
93
97
  >
94
98
  <UIcon name="i-lucide-upload" class="size-5" />
95
- <span>Drag or click to choose a file</span>
99
+ <span>{{ t("mapo.mediaFileChanger.dragOrClick") }}</span>
96
100
  </div>
97
101
  </div>
98
102
  </template>
@@ -101,7 +105,7 @@ function onMaintainUrlChange(v) {
101
105
  <UCheckbox
102
106
  v-if="newFile"
103
107
  :model-value="maintainUrl"
104
- label="Keep current URL"
108
+ :label="t('mapo.mediaFileChanger.keepUrl')"
105
109
  @update:model-value="onMaintainUrlChange"
106
110
  />
107
111
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"MapoMediaFileChanger.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMediaFileChanger.vue"],"names":[],"mappings":"AAwIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAoRF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"MapoMediaFileChanger.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMediaFileChanger.vue"],"names":[],"mappings":"AA8IA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAuRF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}