@mapomodule/uikit 1.0.0 → 2.0.0-beta.10
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 +199 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/module.d.mts +60 -0
- package/dist/module.d.ts +55 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +179 -0
- package/dist/runtime/adapters/defaultMediaAdapter.d.ts +14 -0
- package/dist/runtime/adapters/defaultMediaAdapter.d.ts.map +1 -0
- package/dist/runtime/adapters/defaultMediaAdapter.js +30 -0
- package/dist/runtime/assets/main.css +1 -0
- package/dist/runtime/components/MapoConfirmDialog.vue +35 -0
- package/dist/runtime/components/MapoConfirmDialog.vue.d.ts +4 -0
- package/dist/runtime/components/MapoConfirmDialog.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoDetail.vue +606 -0
- package/dist/runtime/components/MapoDetail.vue.d.ts +401 -0
- package/dist/runtime/components/MapoDetail.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoDetailLangSwitch.vue +126 -0
- package/dist/runtime/components/MapoDetailLangSwitch.vue.d.ts +23 -0
- package/dist/runtime/components/MapoDetailLangSwitch.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoDropArea.vue +99 -0
- package/dist/runtime/components/MapoDropArea.vue.d.ts +33 -0
- package/dist/runtime/components/MapoDropArea.vue.d.ts.map +1 -0
- 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 +191 -0
- package/dist/runtime/components/MapoList.vue.d.ts +111 -0
- package/dist/runtime/components/MapoList.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListActions.vue +119 -0
- package/dist/runtime/components/MapoListActions.vue.d.ts +33 -0
- package/dist/runtime/components/MapoListActions.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListFilters.vue +246 -0
- package/dist/runtime/components/MapoListFilters.vue.d.ts +38 -0
- package/dist/runtime/components/MapoListFilters.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListHead.vue +9 -0
- package/dist/runtime/components/MapoListHead.vue.d.ts +14 -0
- package/dist/runtime/components/MapoListHead.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListQuickEdit.vue +123 -0
- package/dist/runtime/components/MapoListQuickEdit.vue.d.ts +47 -0
- package/dist/runtime/components/MapoListQuickEdit.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListTable.vue +665 -0
- package/dist/runtime/components/MapoListTable.vue.d.ts +105 -0
- package/dist/runtime/components/MapoListTable.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListTabs.vue +38 -0
- package/dist/runtime/components/MapoListTabs.vue.d.ts +26 -0
- package/dist/runtime/components/MapoListTabs.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoLogin.vue +196 -0
- package/dist/runtime/components/MapoLogin.vue.d.ts +22 -0
- package/dist/runtime/components/MapoLogin.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoLogoutButton.vue +27 -0
- package/dist/runtime/components/MapoLogoutButton.vue.d.ts +29 -0
- package/dist/runtime/components/MapoLogoutButton.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaBreadcrumbs.vue +47 -0
- package/dist/runtime/components/MapoMediaBreadcrumbs.vue.d.ts +4 -0
- package/dist/runtime/components/MapoMediaBreadcrumbs.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaEditor.vue +320 -0
- package/dist/runtime/components/MapoMediaEditor.vue.d.ts +8 -0
- package/dist/runtime/components/MapoMediaEditor.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaFileChanger.vue +112 -0
- package/dist/runtime/components/MapoMediaFileChanger.vue.d.ts +15 -0
- package/dist/runtime/components/MapoMediaFileChanger.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaFolders.vue +220 -0
- package/dist/runtime/components/MapoMediaFolders.vue.d.ts +4 -0
- package/dist/runtime/components/MapoMediaFolders.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaGallery.vue +219 -0
- package/dist/runtime/components/MapoMediaGallery.vue.d.ts +4 -0
- package/dist/runtime/components/MapoMediaGallery.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaManager.vue +140 -0
- package/dist/runtime/components/MapoMediaManager.vue.d.ts +35 -0
- package/dist/runtime/components/MapoMediaManager.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaManagerDialog.vue +116 -0
- package/dist/runtime/components/MapoMediaManagerDialog.vue.d.ts +41 -0
- package/dist/runtime/components/MapoMediaManagerDialog.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaPreview.vue +92 -0
- package/dist/runtime/components/MapoMediaPreview.vue.d.ts +19 -0
- package/dist/runtime/components/MapoMediaPreview.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaUploader.vue +290 -0
- package/dist/runtime/components/MapoMediaUploader.vue.d.ts +8 -0
- package/dist/runtime/components/MapoMediaUploader.vue.d.ts.map +1 -0
- 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/MapoRootComponents.vue +9 -0
- package/dist/runtime/components/MapoRootComponents.vue.d.ts +4 -0
- package/dist/runtime/components/MapoRootComponents.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebar.vue +89 -0
- package/dist/runtime/components/MapoSidebar.vue.d.ts +22 -0
- package/dist/runtime/components/MapoSidebar.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebarList.vue +27 -0
- package/dist/runtime/components/MapoSidebarList.vue.d.ts +8 -0
- package/dist/runtime/components/MapoSidebarList.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebarListItem.vue +74 -0
- package/dist/runtime/components/MapoSidebarListItem.vue.d.ts +9 -0
- package/dist/runtime/components/MapoSidebarListItem.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebarProfile.vue +55 -0
- package/dist/runtime/components/MapoSidebarProfile.vue.d.ts +10 -0
- package/dist/runtime/components/MapoSidebarProfile.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSnackBar.vue +38 -0
- package/dist/runtime/components/MapoSnackBar.vue.d.ts +4 -0
- package/dist/runtime/components/MapoSnackBar.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoThemeToggle.vue +23 -0
- package/dist/runtime/components/MapoThemeToggle.vue.d.ts +4 -0
- package/dist/runtime/components/MapoThemeToggle.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoTopbar.vue +30 -0
- package/dist/runtime/components/MapoTopbar.vue.d.ts +15 -0
- package/dist/runtime/components/MapoTopbar.vue.d.ts.map +1 -0
- 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/layouts/default.vue +43 -0
- package/dist/runtime/layouts/default.vue.d.ts +20 -0
- package/dist/runtime/layouts/default.vue.d.ts.map +1 -0
- package/dist/runtime/layouts/empty.vue +9 -0
- package/dist/runtime/layouts/empty.vue.d.ts +14 -0
- package/dist/runtime/layouts/empty.vue.d.ts.map +1 -0
- package/dist/runtime/page-meta.nuxt.d.ts +45 -0
- package/dist/runtime/pages/index.vue +14 -0
- package/dist/runtime/pages/index.vue.d.ts +4 -0
- package/dist/runtime/pages/index.vue.d.ts.map +1 -0
- package/dist/runtime/pages/login.vue +3 -0
- package/dist/runtime/pages/login.vue.d.ts +4 -0
- package/dist/runtime/pages/login.vue.d.ts.map +1 -0
- package/dist/runtime/plugins/media-adapter.d.ts +18 -0
- package/dist/runtime/plugins/media-adapter.d.ts.map +1 -0
- package/dist/runtime/plugins/media-adapter.js +8 -0
- package/dist/runtime/stores/media.d.ts +462 -0
- package/dist/runtime/stores/media.d.ts.map +1 -0
- package/dist/runtime/stores/media.js +344 -0
- package/dist/runtime/types/list.d.ts +59 -0
- package/dist/runtime/types/list.d.ts.map +1 -0
- package/dist/runtime/types/list.js +0 -0
- package/dist/runtime/types/media.d.ts +116 -0
- package/dist/runtime/types/media.d.ts.map +1 -0
- package/dist/runtime/types/media.js +0 -0
- 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/dist/types.d.mts +9 -0
- package/package.json +67 -12
- package/src/index.ts +30 -0
- package/src/module.ts +311 -0
- package/src/runtime/adapters/defaultMediaAdapter.ts +57 -0
- package/src/runtime/assets/main.css +59 -0
- package/src/runtime/components/MapoConfirmDialog.vue +36 -0
- package/src/runtime/components/MapoDetail.vue +864 -0
- package/src/runtime/components/MapoDetailLangSwitch.vue +166 -0
- package/src/runtime/components/MapoDropArea.vue +127 -0
- package/src/runtime/components/MapoLangSwitcher.vue +74 -0
- package/src/runtime/components/MapoList.vue +339 -0
- package/src/runtime/components/MapoListActions.vue +158 -0
- package/src/runtime/components/MapoListFilters.vue +292 -0
- package/src/runtime/components/MapoListHead.vue +12 -0
- package/src/runtime/components/MapoListQuickEdit.vue +166 -0
- package/src/runtime/components/MapoListTable.vue +931 -0
- package/src/runtime/components/MapoListTabs.vue +48 -0
- package/src/runtime/components/MapoLogin.vue +212 -0
- package/src/runtime/components/MapoLogoutButton.vue +48 -0
- package/src/runtime/components/MapoMediaBreadcrumbs.vue +53 -0
- package/src/runtime/components/MapoMediaEditor.vue +350 -0
- package/src/runtime/components/MapoMediaFileChanger.vue +136 -0
- package/src/runtime/components/MapoMediaFolders.vue +239 -0
- package/src/runtime/components/MapoMediaGallery.vue +239 -0
- package/src/runtime/components/MapoMediaManager.vue +180 -0
- package/src/runtime/components/MapoMediaManagerDialog.vue +148 -0
- package/src/runtime/components/MapoMediaPreview.vue +111 -0
- package/src/runtime/components/MapoMediaUploader.vue +351 -0
- 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/MapoRootComponents.vue +9 -0
- package/src/runtime/components/MapoSidebar.vue +114 -0
- package/src/runtime/components/MapoSidebarList.vue +35 -0
- package/src/runtime/components/MapoSidebarListItem.vue +79 -0
- package/src/runtime/components/MapoSidebarProfile.vue +61 -0
- package/src/runtime/components/MapoSnackBar.vue +42 -0
- package/src/runtime/components/MapoThemeToggle.vue +27 -0
- package/src/runtime/components/MapoTopbar.vue +36 -0
- package/src/runtime/components/menuDndContext.ts +22 -0
- package/src/runtime/layouts/default.vue +53 -0
- package/src/runtime/layouts/empty.vue +9 -0
- package/src/runtime/page-meta.nuxt.d.ts +45 -0
- package/src/runtime/pages/index.vue +15 -0
- package/src/runtime/pages/login.vue +3 -0
- package/src/runtime/plugins/media-adapter.ts +33 -0
- package/src/runtime/stores/media.ts +474 -0
- package/src/runtime/types/list.ts +64 -0
- package/src/runtime/types/media.ts +126 -0
- package/src/runtime/types/menu.ts +105 -0
- package/CHANGELOG.md +0 -1030
- package/assets/mixins.scss +0 -22
- package/assets/variables.scss +0 -18
- package/components/ConfirmDialog.vue +0 -173
- package/components/Detail/Detail.vue +0 -696
- package/components/Detail/DetailLangSwitch.vue +0 -79
- package/components/DropArea.vue +0 -257
- package/components/Form/Form.vue +0 -218
- package/components/Form/FormField.vue +0 -216
- package/components/Form/FormGroup.vue +0 -146
- package/components/Form/FormTabs.vue +0 -188
- package/components/Form/defaults.js +0 -98
- package/components/Form/fields/ColorField.vue +0 -79
- package/components/Form/fields/DateField.vue +0 -77
- package/components/Form/fields/DateTimeField.vue +0 -271
- package/components/Form/fields/EnhancedMediaField.vue +0 -224
- package/components/Form/fields/FileField.vue +0 -125
- package/components/Form/fields/FksField.vue +0 -115
- package/components/Form/fields/MediaField.vue +0 -159
- package/components/Form/fields/MediaM2mField.vue +0 -149
- package/components/Form/fields/Repeater.vue +0 -618
- package/components/Form/fields/SeoPreview.vue +0 -89
- package/components/Form/fields/TimeField.vue +0 -154
- package/components/Form/fields/mapField/leaflet.injector.js +0 -39
- package/components/Form/fields/mapField/mapField.vue +0 -350
- package/components/Form/fields/wygEditor/defaults.js +0 -25
- package/components/Form/fields/wygEditor/utils/events.js +0 -64
- package/components/Form/fields/wygEditor/utils/mapomedia.plugin.js +0 -32
- package/components/Form/fields/wygEditor/utils/tinymce.injector.js +0 -29
- package/components/Form/fields/wygEditor/wygEditor.vue +0 -285
- package/components/Form/fields/wygEditorCKE/defaults.js +0 -103
- package/components/Form/fields/wygEditorCKE/utils/ckeditor.injector.js +0 -29
- package/components/Form/fields/wygEditorCKE/wygEditorCKE.vue +0 -270
- package/components/LangSwitcher.vue +0 -44
- package/components/List/List.vue +0 -271
- package/components/List/ListActions.vue +0 -164
- package/components/List/ListFilters.vue +0 -372
- package/components/List/ListHead.vue +0 -67
- package/components/List/ListQuickEdit.vue +0 -228
- package/components/List/ListTable.vue +0 -484
- package/components/List/ListTabs.vue +0 -65
- package/components/Login.vue +0 -125
- package/components/Logo.vue +0 -79
- package/components/LogoutButton.vue +0 -54
- package/components/MediaManager/MediaBreadcrumbs.vue +0 -45
- package/components/MediaManager/MediaEditor.vue +0 -340
- package/components/MediaManager/MediaFileChanger.vue +0 -78
- package/components/MediaManager/MediaFolders.vue +0 -287
- package/components/MediaManager/MediaGallery.vue +0 -281
- package/components/MediaManager/MediaManager.vue +0 -159
- package/components/MediaManager/MediaManagerDialog.vue +0 -104
- package/components/MediaManager/MediaPreview.vue +0 -258
- package/components/MediaManager/MediaUploader.vue +0 -163
- package/components/MenuManager/MenuManager.vue +0 -332
- package/components/MenuManager/MenuNodeEditor.vue +0 -270
- package/components/MenuManager/MenuTreeview.vue +0 -237
- package/components/MenuManager/MenuTreeviewNode.vue +0 -208
- package/components/PagePreview.vue +0 -58
- package/components/RootComponents.vue +0 -25
- package/components/SnackBar.vue +0 -69
- package/components/ThemeToggle.vue +0 -13
- package/components/layout/Sidebar/Sidebar.vue +0 -89
- package/components/layout/Sidebar/SidebarList.vue +0 -49
- package/components/layout/Sidebar/SidebarListItem.vue +0 -185
- package/components/layout/Sidebar/SidebarProfile.vue +0 -42
- package/components/layout/Sidebar/SidebarTitle.vue +0 -45
- package/components/layout/Topbar/Topbar.vue +0 -29
- package/components/layout/routebuilder.js +0 -48
- package/defaults/i18n.js +0 -37
- package/defaults/vuetify.js +0 -34
- package/layouts/default.vue +0 -47
- package/layouts/empty.vue +0 -16
- package/module.js +0 -80
- package/pages/index.vue +0 -37
- package/pages/login.vue +0 -10
- package/static/mapo/ckeditor/plugins/image2/dev/assets/image1.jpg +0 -0
- package/static/mapo/ckeditor/plugins/image2/dev/assets/image2.jpg +0 -0
- package/static/mapo/ckeditor/plugins/image2/dev/contents.css +0 -35
- package/static/mapo/ckeditor/plugins/image2/dev/image2.html +0 -338
- package/static/mapo/ckeditor/plugins/image2/dialogs/image2.js +0 -557
- package/static/mapo/ckeditor/plugins/image2/icons/hidpi/image.png +0 -0
- package/static/mapo/ckeditor/plugins/image2/icons/image.png +0 -0
- package/static/mapo/ckeditor/plugins/image2/lang/af.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ar.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/az.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/bg.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/bn.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/bs.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ca.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/cs.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/cy.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/da.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/de-ch.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/de.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/el.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/en-au.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/en-ca.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/en-gb.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/en.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/eo.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/es-mx.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/es.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/et.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/eu.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fa.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fi.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fo.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fr-ca.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fr.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/gl.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/gu.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/he.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/hi.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/hr.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/hu.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/id.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/is.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/it.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ja.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ka.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/km.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ko.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ku.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/lt.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/lv.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/mk.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/mn.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ms.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/nb.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/nl.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/no.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/oc.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/pl.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/pt-br.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/pt.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ro.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ru.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/si.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sk.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sl.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sq.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sr-latn.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sr.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sv.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/th.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/tr.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/tt.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ug.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/uk.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/vi.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/zh-cn.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/zh.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/plugin.js +0 -1798
- package/static/mapo/ckeditor/plugins/image2/samples/assets/image1.jpg +0 -0
- package/static/mapo/ckeditor/plugins/image2/samples/assets/image2.jpg +0 -0
- package/static/mapo/ckeditor/plugins/image2/samples/image2.html +0 -68
- package/static/mapo/ckeditor/skins/moono/dev/icons16.png +0 -0
- package/static/mapo/ckeditor/skins/moono/dev/icons16.svg +0 -2374
- package/static/mapo/ckeditor/skins/moono/dev/icons32.png +0 -0
- package/static/mapo/ckeditor/skins/moono/dev/icons32.svg +0 -2722
- package/static/mapo/ckeditor/skins/moono/dev/locations.json +0 -144
- package/static/mapo/ckeditor/skins/moono/dialog.css +0 -5
- package/static/mapo/ckeditor/skins/moono/dialog_ie.css +0 -5
- package/static/mapo/ckeditor/skins/moono/dialog_ie7.css +0 -5
- package/static/mapo/ckeditor/skins/moono/dialog_ie8.css +0 -5
- package/static/mapo/ckeditor/skins/moono/dialog_iequirks.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_gecko.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_ie.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_ie7.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_ie8.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_iequirks.css +0 -5
- package/static/mapo/ckeditor/skins/moono/icons.png +0 -0
- package/static/mapo/ckeditor/skins/moono/icons_hidpi.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/anchor.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/arrow.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/close.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/anchor.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/close.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/lock-open.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/lock.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/refresh.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/spinner.gif +0 -0
- package/static/mapo/ckeditor/skins/moono/readme.md +0 -49
- package/static/mapo/ckeditor/skins/moono/skin.js +0 -10
- package/static/mapo/ckeditor/skins/moono-dark/dialog.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/dialog_ie.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/dialog_ie7.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/dialog_ie8.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/dialog_iequirks.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_gecko.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_ie.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_ie7.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_ie8.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_iequirks.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/icons.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/icons_hidpi.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/arrow.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/close.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/close.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/lock-open.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/lock.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/refresh.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/lock-open.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/lock.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/refresh.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/readme.md +0 -51
- package/static/mapo/ckeditor/skins/moono-dark/skin.js +0 -5
- package/static/mapo/favicon.ico +0 -0
- package/static/mapo/tinymce-skins/mapo-dark/content.inline.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-dark/content.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-dark/content.mobile.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-dark/skin.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-dark/skin.mobile.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/content.inline.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/content.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/content.mobile.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/skin.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/skin.mobile.min.css +0 -7
- package/translations/en-US.js +0 -177
- package/translations/it-IT.js +0 -180
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { useMediaStore } from "../stores/media.js";
|
|
5
|
+
import type { MediaFolder } from "../types/media.js";
|
|
6
|
+
|
|
7
|
+
const { t } = useI18n();
|
|
8
|
+
const store = useMediaStore();
|
|
9
|
+
|
|
10
|
+
const editingFolder = ref<Partial<MediaFolder> | null>(null);
|
|
11
|
+
const folderName = ref("");
|
|
12
|
+
const saving = ref(false);
|
|
13
|
+
|
|
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
|
+
},
|
|
35
|
+
// Family filter (legacy parity): pdf, zip, office docs — not just pdf.
|
|
36
|
+
{
|
|
37
|
+
label: t("mapo.mediaFolders.docFolder"),
|
|
38
|
+
icon: "i-lucide-file-text",
|
|
39
|
+
mime: "application/*",
|
|
40
|
+
},
|
|
41
|
+
]);
|
|
42
|
+
|
|
43
|
+
// When the host locks a mime (picker fields), only the matching filter is
|
|
44
|
+
// offered — "All" would let the user select media of the wrong type.
|
|
45
|
+
const mimeFilters = computed(() =>
|
|
46
|
+
store.lockedMime
|
|
47
|
+
? ALL_MIME_FILTERS.value.filter((f) => f.mime === store.lockedMime)
|
|
48
|
+
: ALL_MIME_FILTERS.value,
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
function startCreate() {
|
|
52
|
+
editingFolder.value = {};
|
|
53
|
+
folderName.value = "";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function startEdit(folder: MediaFolder) {
|
|
57
|
+
editingFolder.value = { ...folder };
|
|
58
|
+
folderName.value = folder.name;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function cancelEdit() {
|
|
62
|
+
editingFolder.value = null;
|
|
63
|
+
folderName.value = "";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function saveFolder() {
|
|
67
|
+
if (!folderName.value.trim()) return;
|
|
68
|
+
saving.value = true;
|
|
69
|
+
try {
|
|
70
|
+
await store.updateOrCreateFolder({
|
|
71
|
+
...editingFolder.value,
|
|
72
|
+
name: folderName.value.trim(),
|
|
73
|
+
});
|
|
74
|
+
cancelEdit();
|
|
75
|
+
} finally {
|
|
76
|
+
saving.value = false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function selectMime(mime: string | null) {
|
|
81
|
+
store.setMimeType(mime);
|
|
82
|
+
// Mime filters act as virtual folders spanning the whole library (legacy
|
|
83
|
+
// behavior); clearing back to "All" returns to the current folder scope.
|
|
84
|
+
store.getRoot({ page: 1, all: !!mime });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Single keyup handler — @keyup.enter + @keyup.esc on the same element compile
|
|
88
|
+
// to duplicate object keys (TS1117 under vue-tsc).
|
|
89
|
+
function onNameKeyup(event: KeyboardEvent) {
|
|
90
|
+
if (event.key === "Enter") saveFolder();
|
|
91
|
+
else if (event.key === "Escape") cancelEdit();
|
|
92
|
+
}
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<template>
|
|
96
|
+
<div class="mapo-media-folders flex h-full flex-col gap-2 py-2">
|
|
97
|
+
<!-- MIME filters -->
|
|
98
|
+
<div class="space-y-0.5 px-2">
|
|
99
|
+
<p
|
|
100
|
+
class="mb-1 px-1 text-xs font-semibold uppercase tracking-wide text-dimmed"
|
|
101
|
+
>
|
|
102
|
+
{{ t("mapo.mime") }}
|
|
103
|
+
</p>
|
|
104
|
+
<UButton
|
|
105
|
+
v-for="f in mimeFilters"
|
|
106
|
+
:key="f.mime ?? 'all'"
|
|
107
|
+
variant="ghost"
|
|
108
|
+
color="neutral"
|
|
109
|
+
size="xs"
|
|
110
|
+
block
|
|
111
|
+
:icon="f.icon"
|
|
112
|
+
class="justify-start"
|
|
113
|
+
:class="{ 'bg-elevated': store.mimeType === f.mime }"
|
|
114
|
+
@click="selectMime(f.mime)"
|
|
115
|
+
>
|
|
116
|
+
{{ f.label }}
|
|
117
|
+
</UButton>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<USeparator />
|
|
121
|
+
|
|
122
|
+
<!-- Folders header -->
|
|
123
|
+
<div class="flex items-center justify-between px-3">
|
|
124
|
+
<p class="text-xs font-semibold uppercase tracking-wide text-dimmed">
|
|
125
|
+
{{ t("mapo.mediaFolders.folders") }}
|
|
126
|
+
</p>
|
|
127
|
+
<UButton
|
|
128
|
+
icon="i-lucide-folder-plus"
|
|
129
|
+
size="xs"
|
|
130
|
+
variant="ghost"
|
|
131
|
+
color="neutral"
|
|
132
|
+
:title="t('mapo.mediaFolders.newFolder')"
|
|
133
|
+
@click="startCreate"
|
|
134
|
+
/>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
<!-- New folder input -->
|
|
138
|
+
<div v-if="editingFolder && !editingFolder.id" class="px-2">
|
|
139
|
+
<UInput
|
|
140
|
+
v-model="folderName"
|
|
141
|
+
size="xs"
|
|
142
|
+
:placeholder="t('mapo.mediaFolders.folderName')"
|
|
143
|
+
autofocus
|
|
144
|
+
@keyup="onNameKeyup"
|
|
145
|
+
>
|
|
146
|
+
<template #trailing>
|
|
147
|
+
<UButton
|
|
148
|
+
icon="i-lucide-check"
|
|
149
|
+
size="xs"
|
|
150
|
+
variant="ghost"
|
|
151
|
+
color="primary"
|
|
152
|
+
:loading="saving"
|
|
153
|
+
@click="saveFolder"
|
|
154
|
+
/>
|
|
155
|
+
</template>
|
|
156
|
+
</UInput>
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<!-- Folder list -->
|
|
160
|
+
<div class="flex-1 overflow-y-auto px-2">
|
|
161
|
+
<div v-for="folder in store.folders" :key="folder.id">
|
|
162
|
+
<!-- Editing this folder -->
|
|
163
|
+
<UInput
|
|
164
|
+
v-if="editingFolder?.id === folder.id"
|
|
165
|
+
v-model="folderName"
|
|
166
|
+
size="xs"
|
|
167
|
+
autofocus
|
|
168
|
+
@keyup="onNameKeyup"
|
|
169
|
+
>
|
|
170
|
+
<template #trailing>
|
|
171
|
+
<UButton
|
|
172
|
+
icon="i-lucide-check"
|
|
173
|
+
size="xs"
|
|
174
|
+
variant="ghost"
|
|
175
|
+
color="primary"
|
|
176
|
+
:loading="saving"
|
|
177
|
+
@click="saveFolder"
|
|
178
|
+
/>
|
|
179
|
+
</template>
|
|
180
|
+
</UInput>
|
|
181
|
+
|
|
182
|
+
<!-- Folder row -->
|
|
183
|
+
<div
|
|
184
|
+
v-else
|
|
185
|
+
class="group flex items-center gap-1 rounded px-1 py-1 hover:bg-elevated"
|
|
186
|
+
>
|
|
187
|
+
<UButton
|
|
188
|
+
variant="ghost"
|
|
189
|
+
color="neutral"
|
|
190
|
+
size="xs"
|
|
191
|
+
icon="i-lucide-folder"
|
|
192
|
+
class="flex-1 justify-start truncate"
|
|
193
|
+
@click="store.navigateToFolder(folder)"
|
|
194
|
+
>
|
|
195
|
+
{{ folder.name }}
|
|
196
|
+
</UButton>
|
|
197
|
+
<div class="hidden items-center gap-0.5 group-hover:flex">
|
|
198
|
+
<UButton
|
|
199
|
+
icon="i-lucide-pencil"
|
|
200
|
+
size="xs"
|
|
201
|
+
variant="ghost"
|
|
202
|
+
color="neutral"
|
|
203
|
+
@click.stop="startEdit(folder)"
|
|
204
|
+
/>
|
|
205
|
+
<UButton
|
|
206
|
+
icon="i-lucide-trash-2"
|
|
207
|
+
size="xs"
|
|
208
|
+
variant="ghost"
|
|
209
|
+
color="error"
|
|
210
|
+
@click.stop="store.deleteFolder(folder)"
|
|
211
|
+
/>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
<p
|
|
217
|
+
v-if="store.folders.length === 0"
|
|
218
|
+
class="px-2 py-3 text-xs text-dimmed italic"
|
|
219
|
+
>
|
|
220
|
+
{{ t("mapo.mediaFolders.noFolders") }}
|
|
221
|
+
</p>
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
<!-- Back -->
|
|
225
|
+
<div v-if="store.parentFolder" class="border-t border-default px-2 pt-2">
|
|
226
|
+
<UButton
|
|
227
|
+
icon="i-lucide-arrow-left"
|
|
228
|
+
size="xs"
|
|
229
|
+
variant="ghost"
|
|
230
|
+
color="neutral"
|
|
231
|
+
block
|
|
232
|
+
class="justify-start"
|
|
233
|
+
@click="store.navigateToFolder(null)"
|
|
234
|
+
>
|
|
235
|
+
{{ t("mapo.mediaFolders.goBack") }}
|
|
236
|
+
</UButton>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
</template>
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { humanFileSize } from "@mapomodule/utils";
|
|
5
|
+
import { useMediaStore } from "../stores/media.js";
|
|
6
|
+
import type { MediaItem } from "../types/media.js";
|
|
7
|
+
|
|
8
|
+
const { t } = useI18n();
|
|
9
|
+
const store = useMediaStore();
|
|
10
|
+
|
|
11
|
+
const isPickerMode = computed(
|
|
12
|
+
() => store.selectMode === "single" || store.selectMode === "multi",
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const multiSelection = computed<MediaItem[]>(() =>
|
|
16
|
+
store.selectMode === "multi" && Array.isArray(store.selection)
|
|
17
|
+
? store.selection
|
|
18
|
+
: [],
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
function isInSelection(media: MediaItem): boolean {
|
|
22
|
+
if (store.selectMode === "single") {
|
|
23
|
+
return (store.selection as MediaItem | null)?.id === media.id;
|
|
24
|
+
}
|
|
25
|
+
if (store.selectMode === "multi") {
|
|
26
|
+
return (
|
|
27
|
+
(store.selection as MediaItem[])?.some((m) => m.id === media.id) ?? false
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function onClickItem(media: MediaItem) {
|
|
34
|
+
if (isPickerMode.value) {
|
|
35
|
+
store.select(media);
|
|
36
|
+
} else {
|
|
37
|
+
store.openEditor(media);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Selection strip drag reorder (legacy parity: v1 used vuedraggable) —
|
|
42
|
+
// the picker order is the order the m2m relation is saved in.
|
|
43
|
+
const dragIndex = ref<number | null>(null);
|
|
44
|
+
|
|
45
|
+
function onDragStart(index: number) {
|
|
46
|
+
dragIndex.value = index;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function onDragOverItem(index: number) {
|
|
50
|
+
if (dragIndex.value === null || dragIndex.value === index) return;
|
|
51
|
+
const items = [...multiSelection.value];
|
|
52
|
+
const [moved] = items.splice(dragIndex.value, 1);
|
|
53
|
+
if (!moved) return;
|
|
54
|
+
items.splice(index, 0, moved);
|
|
55
|
+
dragIndex.value = index;
|
|
56
|
+
store.setSelection(items);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function onDragEnd() {
|
|
60
|
+
dragIndex.value = null;
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<div class="mapo-media-gallery flex flex-col gap-3">
|
|
66
|
+
<!-- Multi-picker selection strip: click to deselect, drag to reorder -->
|
|
67
|
+
<div
|
|
68
|
+
v-if="multiSelection.length > 0"
|
|
69
|
+
class="flex items-center gap-2 overflow-x-auto rounded-lg bg-elevated p-2"
|
|
70
|
+
>
|
|
71
|
+
<div
|
|
72
|
+
v-for="(media, i) in multiSelection"
|
|
73
|
+
:key="media.id"
|
|
74
|
+
class="group relative shrink-0 cursor-grab"
|
|
75
|
+
:class="{ 'opacity-50': dragIndex === i }"
|
|
76
|
+
draggable="true"
|
|
77
|
+
@dragstart="onDragStart(i)"
|
|
78
|
+
@dragover.prevent="onDragOverItem(i)"
|
|
79
|
+
@dragend="onDragEnd"
|
|
80
|
+
@click.stop="store.select(media)"
|
|
81
|
+
>
|
|
82
|
+
<MapoMediaPreview :media="media" size="xs" />
|
|
83
|
+
<div
|
|
84
|
+
class="absolute inset-0 hidden items-center justify-center rounded bg-black/50 text-white group-hover:flex"
|
|
85
|
+
>
|
|
86
|
+
<UIcon name="i-lucide-x" class="size-4" />
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
<span class="ml-auto shrink-0 pl-2 text-xs text-muted">
|
|
90
|
+
{{
|
|
91
|
+
t("mapo.mediaGallery.nSelected", { number: multiSelection.length })
|
|
92
|
+
}}
|
|
93
|
+
</span>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<!-- Bulk actions bar -->
|
|
97
|
+
<div
|
|
98
|
+
v-if="!isPickerMode && store.editList.length > 0"
|
|
99
|
+
class="flex items-center gap-2 rounded-lg bg-elevated px-3 py-2"
|
|
100
|
+
>
|
|
101
|
+
<UCheckbox
|
|
102
|
+
:model-value="
|
|
103
|
+
store.editListState.indeterminate
|
|
104
|
+
? 'indeterminate'
|
|
105
|
+
: store.editListState.value
|
|
106
|
+
"
|
|
107
|
+
:label="
|
|
108
|
+
store.editListState.value
|
|
109
|
+
? t('mapo.mediaGallery.deselectAll')
|
|
110
|
+
: t('mapo.mediaGallery.selectAll')
|
|
111
|
+
"
|
|
112
|
+
@update:model-value="store.editSelectAll()"
|
|
113
|
+
/>
|
|
114
|
+
<span class="text-sm text-muted">
|
|
115
|
+
{{
|
|
116
|
+
t("mapo.mediaGallery.nSelected", { number: store.editList.length })
|
|
117
|
+
}}
|
|
118
|
+
</span>
|
|
119
|
+
<div class="flex-1" />
|
|
120
|
+
<UButton
|
|
121
|
+
icon="i-lucide-trash-2"
|
|
122
|
+
size="xs"
|
|
123
|
+
color="error"
|
|
124
|
+
variant="soft"
|
|
125
|
+
@click="store.deleteSelected()"
|
|
126
|
+
>
|
|
127
|
+
{{ t("mapo.mediaGallery.deleteSelectedLabel") }}
|
|
128
|
+
</UButton>
|
|
129
|
+
<UButton
|
|
130
|
+
icon="i-lucide-x"
|
|
131
|
+
size="xs"
|
|
132
|
+
variant="ghost"
|
|
133
|
+
color="neutral"
|
|
134
|
+
@click="store.editList = []"
|
|
135
|
+
/>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<!-- Loading skeleton -->
|
|
139
|
+
<div
|
|
140
|
+
v-if="store.loading"
|
|
141
|
+
class="grid grid-cols-[repeat(auto-fill,minmax(120px,1fr))] gap-3"
|
|
142
|
+
>
|
|
143
|
+
<USkeleton v-for="n in 12" :key="n" class="aspect-square rounded-lg" />
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<!-- Empty state -->
|
|
147
|
+
<div
|
|
148
|
+
v-else-if="store.medias.length === 0"
|
|
149
|
+
class="flex flex-col items-center gap-3 py-16 text-center"
|
|
150
|
+
>
|
|
151
|
+
<UIcon name="i-lucide-image-off" class="size-12 text-dimmed" />
|
|
152
|
+
<p class="text-sm text-muted">
|
|
153
|
+
{{ t("mapo.mediaGallery.noMediaFound") }}
|
|
154
|
+
</p>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<!-- Grid -->
|
|
158
|
+
<div
|
|
159
|
+
v-else
|
|
160
|
+
class="grid grid-cols-[repeat(auto-fill,minmax(120px,1fr))] gap-3"
|
|
161
|
+
>
|
|
162
|
+
<div
|
|
163
|
+
v-for="media in store.medias"
|
|
164
|
+
:key="media.id"
|
|
165
|
+
class="group relative cursor-pointer overflow-hidden rounded-lg bg-elevated"
|
|
166
|
+
:class="{
|
|
167
|
+
'ring-2 ring-primary': isInSelection(media),
|
|
168
|
+
'ring-2 ring-primary ring-offset-1': store.editListSet.has(media.id),
|
|
169
|
+
}"
|
|
170
|
+
@click="onClickItem(media)"
|
|
171
|
+
>
|
|
172
|
+
<!-- Preview -->
|
|
173
|
+
<div class="aspect-square">
|
|
174
|
+
<MapoMediaPreview :media="media" size="lg" class="size-full" />
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<!-- Hover overlay with filename -->
|
|
178
|
+
<div
|
|
179
|
+
class="absolute inset-x-0 bottom-0 translate-y-full bg-black/60 px-1.5 py-1 transition-transform group-hover:translate-y-0"
|
|
180
|
+
>
|
|
181
|
+
<p class="truncate text-[10px] text-white">
|
|
182
|
+
{{ media.title || media.file?.split("/").pop() }}
|
|
183
|
+
</p>
|
|
184
|
+
<p class="text-[9px] text-white/60">
|
|
185
|
+
{{ humanFileSize(media.size) }}
|
|
186
|
+
</p>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<!-- Selection checkmark (picker mode) -->
|
|
190
|
+
<div
|
|
191
|
+
v-if="isPickerMode && isInSelection(media)"
|
|
192
|
+
class="absolute right-1.5 top-1.5 flex size-5 items-center justify-center rounded-full bg-primary text-inverted"
|
|
193
|
+
>
|
|
194
|
+
<UIcon name="i-lucide-check" class="size-3" />
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<!-- Bulk checkbox (gallery mode, no selection) -->
|
|
198
|
+
<div
|
|
199
|
+
v-if="!isPickerMode"
|
|
200
|
+
class="absolute left-1.5 top-1.5 opacity-0 transition-opacity group-hover:opacity-100"
|
|
201
|
+
:class="{ '!opacity-100': store.editListSet.has(media.id) }"
|
|
202
|
+
@click.stop
|
|
203
|
+
>
|
|
204
|
+
<UCheckbox
|
|
205
|
+
:model-value="store.editListSet.has(media.id)"
|
|
206
|
+
@update:model-value="store.editSelect(media.id)"
|
|
207
|
+
/>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<!-- Edit button (gallery mode, visible on hover) -->
|
|
211
|
+
<div
|
|
212
|
+
v-if="!isPickerMode"
|
|
213
|
+
class="absolute right-1.5 top-1.5 opacity-0 transition-opacity group-hover:opacity-100"
|
|
214
|
+
>
|
|
215
|
+
<UButton
|
|
216
|
+
icon="i-lucide-pencil"
|
|
217
|
+
size="xs"
|
|
218
|
+
variant="solid"
|
|
219
|
+
color="neutral"
|
|
220
|
+
class="shadow"
|
|
221
|
+
@click.stop="store.openEditor(media)"
|
|
222
|
+
/>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<!-- Pagination -->
|
|
228
|
+
<div v-if="store.pages > 1" class="flex justify-center pt-2">
|
|
229
|
+
<!-- The backend paginator only exposes page/pages (no item count), so the
|
|
230
|
+
page count is mapped 1:1 with items-per-page=1. -->
|
|
231
|
+
<UPagination
|
|
232
|
+
:page="store.page"
|
|
233
|
+
:total="store.pages"
|
|
234
|
+
:items-per-page="1"
|
|
235
|
+
@update:page="store.getRoot({ page: $event })"
|
|
236
|
+
/>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
</template>
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, computed, onMounted, onUnmounted, watch } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { debounce } from "@mapomodule/utils";
|
|
5
|
+
import { useMediaStore } from "../stores/media.js";
|
|
6
|
+
import type { SelectMode } from "../types/media.js";
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<{
|
|
10
|
+
selectionMode?: SelectMode;
|
|
11
|
+
mime?: string | null;
|
|
12
|
+
noFolders?: boolean;
|
|
13
|
+
languages?: string[];
|
|
14
|
+
defaultLang?: string;
|
|
15
|
+
/** Pre-seed the picker selection (e.g. the field's current value). */
|
|
16
|
+
initialSelection?:
|
|
17
|
+
| import("../types/media.js").MediaItem
|
|
18
|
+
| import("../types/media.js").MediaItem[]
|
|
19
|
+
| null;
|
|
20
|
+
}>(),
|
|
21
|
+
{
|
|
22
|
+
selectionMode: "none",
|
|
23
|
+
mime: null,
|
|
24
|
+
noFolders: false,
|
|
25
|
+
languages: undefined,
|
|
26
|
+
defaultLang: undefined,
|
|
27
|
+
initialSelection: null,
|
|
28
|
+
},
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const emit = defineEmits<{
|
|
32
|
+
/** Emitted on every selection change in single/multi picker mode */
|
|
33
|
+
"update:selection": [
|
|
34
|
+
value:
|
|
35
|
+
| import("../types/media.js").MediaItem
|
|
36
|
+
| import("../types/media.js").MediaItem[]
|
|
37
|
+
| null,
|
|
38
|
+
];
|
|
39
|
+
}>();
|
|
40
|
+
|
|
41
|
+
const { t } = useI18n();
|
|
42
|
+
const store = useMediaStore();
|
|
43
|
+
// string (not a union) because UTabs' v-model emits string | number
|
|
44
|
+
const activeTab = ref<string>("gallery");
|
|
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
|
+
]);
|
|
57
|
+
const searchValue = ref("");
|
|
58
|
+
const showFolders = ref(!props.noFolders);
|
|
59
|
+
|
|
60
|
+
// Searches span the whole library (`all: true`, legacy behavior); clearing the
|
|
61
|
+
// field drops back to the current folder scope.
|
|
62
|
+
const debouncedSearch = debounce((val: string) => {
|
|
63
|
+
store.getRoot({ page: 1, search: val, all: !!val });
|
|
64
|
+
}, 500);
|
|
65
|
+
|
|
66
|
+
watch(searchValue, (val) => debouncedSearch(val));
|
|
67
|
+
|
|
68
|
+
watch(
|
|
69
|
+
() => store.selection,
|
|
70
|
+
(sel) => {
|
|
71
|
+
if (props.selectionMode !== "none") {
|
|
72
|
+
emit("update:selection", sel);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
onMounted(async () => {
|
|
78
|
+
store.setSelectionMode(props.selectionMode);
|
|
79
|
+
if (props.initialSelection) store.setSelection(props.initialSelection);
|
|
80
|
+
// The mime prop is a hard constraint (picker fields): lock it so the
|
|
81
|
+
// folders panel cannot widen the filter past it.
|
|
82
|
+
if (props.mime) store.lockMimeType(props.mime);
|
|
83
|
+
// Detail fetches send language_code when a default language is provided
|
|
84
|
+
// (legacy parity: v1 passed $i18n.locale).
|
|
85
|
+
if (props.defaultLang) store.setLang(props.defaultLang);
|
|
86
|
+
await store.getRoot({ page: 1 });
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
onUnmounted(() => {
|
|
90
|
+
store.reset();
|
|
91
|
+
});
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<template>
|
|
95
|
+
<div class="mapo-media-manager flex h-full overflow-hidden">
|
|
96
|
+
<!-- Folders sidebar -->
|
|
97
|
+
<div
|
|
98
|
+
v-if="showFolders"
|
|
99
|
+
class="w-48 shrink-0 border-r border-default bg-default"
|
|
100
|
+
>
|
|
101
|
+
<MapoMediaFolders />
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<!-- Main area -->
|
|
105
|
+
<div class="flex min-w-0 flex-1 flex-col">
|
|
106
|
+
<!-- Top bar: breadcrumbs + search + tabs toggle -->
|
|
107
|
+
<div
|
|
108
|
+
class="flex items-center gap-3 border-b border-default bg-default px-4 py-2"
|
|
109
|
+
>
|
|
110
|
+
<!-- Toggle folders button -->
|
|
111
|
+
<UButton
|
|
112
|
+
v-if="!noFolders"
|
|
113
|
+
:icon="
|
|
114
|
+
showFolders
|
|
115
|
+
? 'i-lucide-panel-left-close'
|
|
116
|
+
: 'i-lucide-panel-left-open'
|
|
117
|
+
"
|
|
118
|
+
size="xs"
|
|
119
|
+
variant="ghost"
|
|
120
|
+
color="neutral"
|
|
121
|
+
@click="showFolders = !showFolders"
|
|
122
|
+
/>
|
|
123
|
+
|
|
124
|
+
<!-- Breadcrumbs -->
|
|
125
|
+
<MapoMediaBreadcrumbs class="flex-1" />
|
|
126
|
+
|
|
127
|
+
<!-- Search -->
|
|
128
|
+
<div v-if="activeTab === 'gallery'" class="w-48 shrink-0">
|
|
129
|
+
<UInput
|
|
130
|
+
v-model="searchValue"
|
|
131
|
+
size="xs"
|
|
132
|
+
:placeholder="t('mapo.search')"
|
|
133
|
+
icon="i-lucide-search"
|
|
134
|
+
:loading="store.loading"
|
|
135
|
+
/>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<!-- Refresh -->
|
|
139
|
+
<UButton
|
|
140
|
+
icon="i-lucide-refresh-cw"
|
|
141
|
+
size="xs"
|
|
142
|
+
variant="ghost"
|
|
143
|
+
color="neutral"
|
|
144
|
+
:title="t('mapo.refresh')"
|
|
145
|
+
@click="store.getRoot()"
|
|
146
|
+
/>
|
|
147
|
+
|
|
148
|
+
<!-- Tab switcher -->
|
|
149
|
+
<UTabs
|
|
150
|
+
v-model="activeTab"
|
|
151
|
+
:items="tabItems"
|
|
152
|
+
:content="false"
|
|
153
|
+
size="xs"
|
|
154
|
+
color="neutral"
|
|
155
|
+
/>
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
<!-- Content -->
|
|
159
|
+
<div class="flex-1 overflow-y-auto p-4">
|
|
160
|
+
<MapoMediaGallery v-if="activeTab === 'gallery'" />
|
|
161
|
+
<MapoMediaUploader v-else @uploaded="activeTab = 'gallery'" />
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<!-- Custom actions (legacy parity: v1 exposed an `actions` card slot) -->
|
|
165
|
+
<div
|
|
166
|
+
v-if="$slots.actions"
|
|
167
|
+
class="flex items-center justify-end gap-2 border-t border-default px-4 py-2"
|
|
168
|
+
>
|
|
169
|
+
<slot name="actions" />
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<!-- Editor drawer (overlays from right, only in gallery mode, none-selection) -->
|
|
174
|
+
<MapoMediaEditor
|
|
175
|
+
v-if="activeTab === 'gallery'"
|
|
176
|
+
:languages="languages"
|
|
177
|
+
:default-lang="defaultLang"
|
|
178
|
+
/>
|
|
179
|
+
</div>
|
|
180
|
+
</template>
|