f7cloud_client/apps/photos/js/AlbumContent-Cz6sddgl.chunk.mjs.map
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

1 line
15 KiB
Plaintext

{"version":3,"file":"AlbumContent-Cz6sddgl.chunk.mjs","sources":["../src/views/AlbumContent.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<div class=\"album-container\">\n\t\t<CollectionContent\n\t\t\tref=\"collectionContent\"\n\t\t\t:collection=\"album\"\n\t\t\t:collection-file-ids=\"albumFileIds\"\n\t\t\t:loading=\"loadingCollection || loadingCollectionFiles\"\n\t\t\t:error=\"errorFetchingCollection || errorFetchingCollectionFiles\">\n\t\t\t<!-- Header -->\n\t\t\t<HeaderNavigation\n\t\t\t\tkey=\"navigation\"\n\t\t\t\tslot=\"header\"\n\t\t\t\tslot-scope=\"{ selectedFileIds, resetSelection }\"\n\t\t\t\t:loading=\"loadingCollectionFiles\"\n\t\t\t\t:params=\"{ albumName }\"\n\t\t\t\t:path=\"'/' + albumName\"\n\t\t\t\t:title=\"albumName\"\n\t\t\t\t@refresh=\"fetchAlbumContent\">\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"album !== undefined && album.attributes.location !== ''\"\n\t\t\t\t\tslot=\"subtitle\"\n\t\t\t\t\tclass=\"album__location\">\n\t\t\t\t\t<MapMarkerOutline />{{ album.attributes.location }}\n\t\t\t\t</div>\n\n\t\t\t\t<template slot=\"default\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"selectedFileIds.length > 0\"\n\t\t\t\t\t\t:aria-label=\"t('photos', 'Unselect all')\"\n\t\t\t\t\t\t@click=\"resetSelection\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Close />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('photos', 'Unselect all') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</template>\n\n\t\t\t\t<template v-if=\"album !== undefined\" slot=\"right\">\n\t\t\t\t\t<NcButton @click=\"showAddPhotosModal = true\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Plus :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('photos', 'Add photos to this album') }}\n\t\t\t\t\t</NcButton>\n\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"sharingEnabled\"\n\t\t\t\t\t\ttype=\"tertiary\"\n\t\t\t\t\t\t:aria-label=\"t('photos', 'Manage collaborators for this album')\"\n\t\t\t\t\t\t@click=\"showManageCollaboratorView = true\">\n\t\t\t\t\t\t<ShareVariantOutline slot=\"icon\" />\n\t\t\t\t\t</NcButton>\n\n\t\t\t\t\t<NcActions :aria-label=\"t('photos', 'Open actions menu')\">\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\t:close-after-click=\"true\"\n\t\t\t\t\t\t\t:aria-label=\"t('photos', 'Edit album details')\"\n\t\t\t\t\t\t\t@click=\"showEditAlbumForm = true\">\n\t\t\t\t\t\t\t{{ t('photos', 'Edit album details') }}\n\t\t\t\t\t\t\t<PencilOutline slot=\"icon\" />\n\t\t\t\t\t\t</NcActionButton>\n\n\t\t\t\t\t\t<!-- Support download from arbitrary origin\n\t\t\t\t\t\t<ActionDownload v-if=\"albumFileIds.length > 0\"\n\t\t\t\t\t\t\t:selected-file-ids=\"albumFileIds\"\n\t\t\t\t\t\t\t:title=\"t('photos', 'Download all files in album')\">\n\t\t\t\t\t\t\t<DownloadMultiple slot=\"icon\" />\n\t\t\t\t\t\t</ActionDownload>-->\n\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\t:close-after-click=\"true\"\n\t\t\t\t\t\t\t@click=\"handleDeleteAlbum\">\n\t\t\t\t\t\t\t{{ t('photos', 'Delete album') }}\n\t\t\t\t\t\t\t<DeleteOutline slot=\"icon\" />\n\t\t\t\t\t\t</NcActionButton>\n\n\t\t\t\t\t\t<template v-if=\"selectedFileIds.length > 0\">\n\t\t\t\t\t\t\t<NcActionSeparator />\n\n\t\t\t\t\t\t\t<!-- Support download from arbitrary origin\n\t\t\t\t\t\t\t<ActionDownload :selected-file-ids=\"selectedFileIds\" :title=\"t('photos', 'Download selected files')\">\n\t\t\t\t\t\t\t\t<Download slot=\"icon\" />\n\t\t\t\t\t\t\t</ActionDownload>-->\n\n\t\t\t\t\t\t\t<ActionFavorite :selected-file-ids=\"selectedFileIds\" />\n\n\t\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\t\tv-if=\"removableSelectedFiles.length !== 0\"\n\t\t\t\t\t\t\t\t:close-after-click=\"true\"\n\t\t\t\t\t\t\t\t@click=\"handleRemoveFilesFromAlbum(removableSelectedFiles)\">\n\t\t\t\t\t\t\t\t{{ t('photos', 'Remove selection from album') }}\n\t\t\t\t\t\t\t\t<Close slot=\"icon\" />\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActions>\n\t\t\t\t</template>\n\t\t\t</HeaderNavigation>\n\n\t\t\t<!-- No content -->\n\t\t\t<NcEmptyContent\n\t\t\t\tv-if=\"album !== undefined && album.attributes.nbItems === 0 && !(loadingCollectionFiles || loadingCollection)\"\n\t\t\t\tslot=\"empty-content\"\n\t\t\t\t:name=\"t('photos', 'This album does not have any photos or videos yet!')\"\n\t\t\t\tclass=\"album__empty\">\n\t\t\t\t<ImagePlusOutline slot=\"icon\" />\n\n\t\t\t\t<NcButton\n\t\t\t\t\tslot=\"action\"\n\t\t\t\t\tclass=\"album__empty__button\"\n\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t:aria-label=\"t('photos', 'Add photos to this album')\"\n\t\t\t\t\t@click=\"showAddPhotosModal = true\">\n\t\t\t\t\t<Plus slot=\"icon\" />\n\t\t\t\t\t{{ t('photos', \"Add\") }}\n\t\t\t\t</NcButton>\n\t\t\t</NcEmptyContent>\n\t\t</CollectionContent>\n\n\t\t<PhotosPicker\n\t\t\tv-if=\"album !== undefined\"\n\t\t\t:open.sync=\"showAddPhotosModal\"\n\t\t\t:blacklist-ids=\"albumFileIds\"\n\t\t\t:destination=\"album.basename\"\n\t\t\t:name=\"t('photos', 'Add photos to {albumName}', { albumName: albumName }, undefined, { escape: false, sanitize: false })\"\n\t\t\t@files-picked=\"handleFilesPicked\" />\n\n\t\t<NcModal\n\t\t\tv-if=\"showManageCollaboratorView && album !== undefined\"\n\t\t\t:name=\"t('photos', 'Manage collaborators')\"\n\t\t\t@close=\"showManageCollaboratorView = false\">\n\t\t\t<CollaboratorsSelectionForm\n\t\t\t\t:album-name=\"album.basename\"\n\t\t\t\t:collaborators=\"album.attributes.collaborators\">\n\t\t\t\t<template slot-scope=\"{ collaborators }\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\t:aria-label=\"t('photos', 'Save collaborators for this album.')\"\n\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\t:disabled=\"loadingAddCollaborators\"\n\t\t\t\t\t\t@click=\"handleSetCollaborators(collaborators)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<NcLoadingIcon v-if=\"loadingAddCollaborators\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('photos', 'Save') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</template>\n\t\t\t</CollaboratorsSelectionForm>\n\t\t</NcModal>\n\n\t\t<NcDialog\n\t\t\tv-if=\"showEditAlbumForm\"\n\t\t\t:name=\"t('photos', 'Edit album details')\"\n\t\t\tclose-on-click-outside\n\t\t\tsize=\"normal\"\n\t\t\t@closing=\"showEditAlbumForm = false\">\n\t\t\t<AlbumForm :album=\"album\" @done=\"(event) => handleAlbumUpdate(event)\" />\n\t\t</NcDialog>\n\t</div>\n</template>\n\n<script lang='ts'>\nimport type { Album } from '../store/albums.js'\n\nimport { translate } from '@nextcloud/l10n'\nimport { useIsMobile } from '@nextcloud/vue/composables/useIsMobile'\nimport NcActionButton from '@nextcloud/vue/components/NcActionButton'\nimport NcActions from '@nextcloud/vue/components/NcActions'\nimport NcActionSeparator from '@nextcloud/vue/components/NcActionSeparator'\nimport NcButton from '@nextcloud/vue/components/NcButton'\nimport NcDialog from '@nextcloud/vue/components/NcDialog'\nimport NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'\nimport NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'\nimport NcModal from '@nextcloud/vue/components/NcModal'\nimport Close from 'vue-material-design-icons/Close.vue'\n// import Download from 'vue-material-design-icons/TrayArrowDown.vue'\n// import DownloadMultiple from 'vue-material-design-icons/DownloadMultiple.vue'\nimport ImagePlusOutline from 'vue-material-design-icons/ImagePlusOutline.vue'\nimport MapMarkerOutline from 'vue-material-design-icons/MapMarkerOutline.vue'\nimport PencilOutline from 'vue-material-design-icons/PencilOutline.vue'\nimport Plus from 'vue-material-design-icons/Plus.vue'\nimport ShareVariantOutline from 'vue-material-design-icons/ShareVariantOutline.vue'\nimport DeleteOutline from 'vue-material-design-icons/TrashCanOutline.vue'\n// import ActionDownload from '../components/Actions/ActionDownload.vue'\nimport ActionFavorite from '../components/Actions/ActionFavorite.vue'\nimport AlbumForm from '../components/Albums/AlbumForm.vue'\nimport CollaboratorsSelectionForm from '../components/Albums/CollaboratorsSelectionForm.vue'\nimport CollectionContent from '../components/Collection/CollectionContent.vue'\nimport HeaderNavigation from '../components/HeaderNavigation.vue'\nimport PhotosPicker from '../components/PhotosPicker.vue'\nimport FetchCollectionContentMixin from '../mixins/FetchCollectionContentMixin.js'\nimport FetchFilesMixin from '../mixins/FetchFilesMixin.js'\nimport logger from '../services/logger.js'\nimport { albumFilesExtraProps, albumsExtraProps } from '../store/albums.ts'\n\nexport default {\n\tname: 'AlbumContent',\n\tcomponents: {\n\t\t// ActionDownload,\n\t\tActionFavorite,\n\t\tAlbumForm,\n\t\tClose,\n\t\tCollaboratorsSelectionForm,\n\t\tCollectionContent,\n\t\tDeleteOutline,\n\t\t// Download,\n\t\t// DownloadMultiple,\n\t\tPhotosPicker,\n\t\tHeaderNavigation,\n\t\tImagePlusOutline,\n\t\tMapMarkerOutline,\n\t\tNcActionButton,\n\t\tNcActions,\n\t\tNcActionSeparator,\n\t\tNcButton,\n\t\tNcDialog,\n\t\tNcEmptyContent,\n\t\tNcLoadingIcon,\n\t\tNcModal,\n\t\tPencilOutline,\n\t\tPlus,\n\t\tShareVariantOutline,\n\t},\n\n\tmixins: [\n\t\tFetchCollectionContentMixin,\n\t\tFetchFilesMixin,\n\t],\n\n\tprops: {\n\t\talbumName: {\n\t\t\ttype: String,\n\t\t\tdefault: '/',\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst isMobile = useIsMobile()\n\t\treturn {\n\t\t\tisMobile,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tshowAddPhotosModal: false,\n\t\t\tshowManageCollaboratorView: false,\n\t\t\tshowEditAlbumForm: false,\n\n\t\t\tloadingAddCollaborators: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\talbum(): Album {\n\t\t\treturn this.$store.getters.getAlbum(this.albumName)\n\t\t},\n\n\t\talbumFileIds(): string[] {\n\t\t\treturn this.$store.getters.getAlbumFiles(this.albumName)\n\t\t},\n\n\t\tsharingEnabled(): boolean {\n\t\t\treturn OC.Share !== undefined\n\t\t},\n\n\t\talbumFileName(): string {\n\t\t\treturn this.$store.getters.getAlbumName(this.albumName)\n\t\t},\n\n\t\tremovableSelectedFiles() {\n\t\t\treturn (this.$refs.collectionContent?.selectedFileIds as string[])\n\t\t\t\t.map((fileId) => this.$store.state.files.files[fileId])\n\t\t\t\t.filter((file) => file.attributes['photos-album-file-origin'] !== 'filters')\n\t\t\t\t.map((file) => file.fileid.toString())\n\t\t},\n\t},\n\n\tasync mounted() {\n\t\tthis.fetchAlbum()\n\t\tthis.fetchAlbumContent()\n\t},\n\n\tmethods: {\n\t\tasync fetchAlbum() {\n\t\t\tawait this.fetchCollection(\n\t\t\t\tthis.albumFileName,\n\t\t\t\talbumsExtraProps,\n\t\t\t)\n\t\t},\n\n\t\tasync fetchAlbumContent() {\n\t\t\tawait this.fetchCollectionFiles(this.albumFileName, albumFilesExtraProps)\n\t\t},\n\n\t\tasync handleAlbumUpdate({ album, changes }) {\n\t\t\tthis.showEditAlbumForm = false\n\n\t\t\tif (changes.includes('name')) {\n\t\t\t\tawait this.$router.push(`/albums/${album.basename}`)\n\t\t\t}\n\n\t\t\tif (changes.includes('filters')) {\n\t\t\t\tthis.fetchAlbumContent()\n\t\t\t}\n\t\t},\n\n\t\tasync handleFilesPicked(fileIds: string[]) {\n\t\t\tthis.showAddPhotosModal = false\n\t\t\tawait this.$store.dispatch('addFilesToCollection', { collectionFileName: this.album?.root + this.album?.path, fileIdsToAdd: fileIds })\n\t\t\t// Re-fetch album content to have the proper filenames.\n\t\t\tawait this.fetchAlbumContent()\n\t\t},\n\n\t\tasync handleRemoveFilesFromAlbum(fileIds: string[]) {\n\t\t\tthis.$refs.collectionContent?.onUncheckFiles(fileIds)\n\t\t\tawait this.$store.dispatch('removeFilesFromCollection', { collectionFileName: this.album?.root + this.album?.path, fileIdsToRemove: fileIds })\n\t\t},\n\n\t\tasync handleDeleteAlbum() {\n\t\t\tawait this.$store.dispatch('deleteCollection', { collectionFileName: this.album?.root + this.album?.path })\n\t\t\tthis.$router.push('/albums')\n\t\t},\n\n\t\tasync handleSetCollaborators(collaborators) {\n\t\t\ttry {\n\t\t\t\tthis.loadingAddCollaborators = true\n\t\t\t\tthis.showManageCollaboratorView = false\n\t\t\t\tawait this.$store.dispatch('updateCollection', { collectionFileName: this.album?.root + this.album?.path, properties: { collaborators } })\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error('Error while setting album collaborators', { error })\n\t\t\t} finally {\n\t\t\t\tthis.loadingAddCollaborators = false\n\t\t\t}\n\t\t},\n\n\t\tasync handleFiltersChange(filters) {\n\t\t\tawait this.$store.dispatch('updateCollection', { collectionFileName: this.album?.root + this.album?.path, properties: { filters } })\n\t\t\tthis.fetchAlbumContent()\n\t\t},\n\n\t\tt: translate,\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.album-container {\n\theight: 100%;\n\n\t:deep(.collection) {\n\t\theight: 100%;\n\t}\n\n\t&__filters {\n\t\tdisplay: flex;\n\t\tgap: 8px;\n\t}\n}\n\n.album {\n\t&__title {\n\t\twidth: 100%;\n\t}\n\n\t&__name {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__location {\n\t\tmargin-inline-start: -4px;\n\t\tdisplay: flex;\n\t\tcolor: var(--color-text-lighter);\n\t}\n}\n</style>\n"],"names":["_sfc_main","ActionFavorite","AlbumForm","Close","CollaboratorsSelectionForm","CollectionContent","DeleteOutline","PhotosPicker","HeaderNavigation","ImagePlusOutline","MapMarkerOutline","NcActionButton","NcActions","NcActionSeparator","NcButton","NcDialog","NcEmptyContent","NcLoadingIcon","NcModal","PencilOutline","Plus","ShareVariantOutline","FetchCollectionContentMixin","FetchFilesMixin","useIsMobile","fileId","file","albumsExtraProps","albumFilesExtraProps","album","changes","fileIds","collaborators","error","logger","filters","translate"],"mappings":"w9DAqMA,MAAAA,EAAA,CACA,KAAA,eACA,WAAA,CAEA,eAAAC,EACA,UAAAC,EACA,MAAAC,EACA,2BAAAC,EACA,kBAAAC,EACA,cAAAC,EAGA,aAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,UAAAC,EACA,kBAAAC,EACA,SAAAC,EACA,SAAAC,EACA,eAAAC,EACA,cAAAC,EACA,QAAAC,EACA,cAAAC,EACA,KAAAC,EACA,oBAAAC,CACA,EAEA,OAAA,CACAC,EACAC,CACA,EAEA,MAAA,CACA,UAAA,CACA,KAAA,OACA,QAAA,GAAA,CAEA,EAEA,OAAA,CAEA,MAAA,CACA,SAFAC,EAAA,CAGA,CACA,EAEA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