@blaze-cms/plugin-media-ui 0.146.0-translations.6 → 0.147.0-rc-eagle.2
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/lib/components/CardMedia/CardMedia.js +168 -221
- package/lib/components/CardMedia/CardMedia.js.map +1 -1
- package/lib/components/CardMedia/index.js +2 -3
- package/lib/components/CardMedia/index.js.map +1 -1
- package/lib/components/EditMediaFile/EditMediaFile.js +162 -113
- package/lib/components/EditMediaFile/EditMediaFile.js.map +1 -1
- package/lib/components/EditMediaFile/EditMediaFilePage.js +81 -97
- package/lib/components/EditMediaFile/EditMediaFilePage.js.map +1 -1
- package/lib/components/EditMediaFile/index.js +2 -3
- package/lib/components/EditMediaFile/index.js.map +1 -1
- package/lib/components/EditorAdapter/EditorAdapter.js +43 -22
- package/lib/components/EditorAdapter/EditorAdapter.js.map +1 -1
- package/lib/components/EditorAdapter/index.js +2 -3
- package/lib/components/EditorAdapter/index.js.map +1 -1
- package/lib/components/FileList/FilesListContext/index.js +3 -4
- package/lib/components/FileList/FilesListContext/index.js.map +1 -1
- package/lib/components/FileList/FilesListProvider/index.js +27 -29
- package/lib/components/FileList/FilesListProvider/index.js.map +1 -1
- package/lib/components/FileList/useFileList/index.js +3 -6
- package/lib/components/FileList/useFileList/index.js.map +1 -1
- package/lib/components/FileList/useGetFiles/getFiles.js +164 -184
- package/lib/components/FileList/useGetFiles/getFiles.js.map +1 -1
- package/lib/components/FileList/useGetFiles/index.js +2 -3
- package/lib/components/FileList/useGetFiles/index.js.map +1 -1
- package/lib/components/FileList/useGetFiles/useGetFiles.js +88 -132
- package/lib/components/FileList/useGetFiles/useGetFiles.js.map +1 -1
- package/lib/components/FileList/useGetFilesList/getCounters.js +10 -30
- package/lib/components/FileList/useGetFilesList/getCounters.js.map +1 -1
- package/lib/components/FileList/useGetFilesList/index.js +2 -3
- package/lib/components/FileList/useGetFilesList/index.js.map +1 -1
- package/lib/components/FileList/useGetFilesList/useGetFilesList.js +89 -109
- package/lib/components/FileList/useGetFilesList/useGetFilesList.js.map +1 -1
- package/lib/components/FilePreview/Actions/index.js +24 -38
- package/lib/components/FilePreview/Actions/index.js.map +1 -1
- package/lib/components/FilePreview/Image/Image.js +35 -24
- package/lib/components/FilePreview/Image/Image.js.map +1 -1
- package/lib/components/FilePreview/Image/RawImage.js +25 -27
- package/lib/components/FilePreview/Image/RawImage.js.map +1 -1
- package/lib/components/FilePreview/Image/imageSchema.js +2 -3
- package/lib/components/FilePreview/Image/imageSchema.js.map +1 -1
- package/lib/components/FilePreview/Image/index.js +1 -2
- package/lib/components/FilePreview/Image/index.js.map +1 -1
- package/lib/components/FilePreview/ModalContext.js +9 -0
- package/lib/components/FilePreview/ModalContext.js.map +1 -0
- package/lib/components/FilePreview/PDF/PDF.js +44 -31
- package/lib/components/FilePreview/PDF/PDF.js.map +1 -1
- package/lib/components/FilePreview/PDF/RawPDF.js +27 -29
- package/lib/components/FilePreview/PDF/RawPDF.js.map +1 -1
- package/lib/components/FilePreview/PDF/index.js +1 -2
- package/lib/components/FilePreview/PDF/index.js.map +1 -1
- package/lib/components/FilePreview/PDF/schema.js +1 -2
- package/lib/components/FilePreview/PDF/schema.js.map +1 -1
- package/lib/components/FilePreview/get-preview.js +12 -10
- package/lib/components/FilePreview/get-preview.js.map +1 -1
- package/lib/components/FilePreview/index.js +66 -57
- package/lib/components/FilePreview/index.js.map +1 -1
- package/lib/components/FilePreview/previewDefault/PreviewDefault.js +35 -23
- package/lib/components/FilePreview/previewDefault/PreviewDefault.js.map +1 -1
- package/lib/components/FilePreview/previewDefault/RawPreviewDefault.js +33 -27
- package/lib/components/FilePreview/previewDefault/RawPreviewDefault.js.map +1 -1
- package/lib/components/FilePreview/previewDefault/icons/DefaultIcon.js +120 -123
- package/lib/components/FilePreview/previewDefault/icons/DefaultIcon.js.map +1 -1
- package/lib/components/FilePreview/previewDefault/icons/index.js +2 -3
- package/lib/components/FilePreview/previewDefault/icons/index.js.map +1 -1
- package/lib/components/FilePreview/previewDefault/index.js +1 -2
- package/lib/components/FilePreview/previewDefault/index.js.map +1 -1
- package/lib/components/FilePreview/previewDefault/previewDefaultSchema.js +1 -2
- package/lib/components/FilePreview/previewDefault/previewDefaultSchema.js.map +1 -1
- package/lib/components/FilePreviewReadOnly/FileList.js +10 -12
- package/lib/components/FilePreviewReadOnly/FileList.js.map +1 -1
- package/lib/components/FilePreviewReadOnly/FilePreviewList.js +14 -19
- package/lib/components/FilePreviewReadOnly/FilePreviewList.js.map +1 -1
- package/lib/components/FilePreviewReadOnly/FilePreviewReadOnly.js +52 -98
- package/lib/components/FilePreviewReadOnly/FilePreviewReadOnly.js.map +1 -1
- package/lib/components/FilePreviewReadOnly/index.js +2 -3
- package/lib/components/FilePreviewReadOnly/index.js.map +1 -1
- package/lib/components/FilePreviewReadOnly/mappers/format-initial-value.js +7 -8
- package/lib/components/FilePreviewReadOnly/mappers/format-initial-value.js.map +1 -1
- package/lib/components/FilePreviewReadOnly/mappers/index.js +1 -2
- package/lib/components/FilePreviewReadOnly/mappers/index.js.map +1 -1
- package/lib/components/FileUploadAdapter/FileList.js +26 -39
- package/lib/components/FileUploadAdapter/FileList.js.map +1 -1
- package/lib/components/FileUploadAdapter/FilePreviewList.js +14 -19
- package/lib/components/FileUploadAdapter/FilePreviewList.js.map +1 -1
- package/lib/components/FileUploadAdapter/FileReorderList.js +18 -21
- package/lib/components/FileUploadAdapter/FileReorderList.js.map +1 -1
- package/lib/components/FileUploadAdapter/FileReorderListItem.js +20 -23
- package/lib/components/FileUploadAdapter/FileReorderListItem.js.map +1 -1
- package/lib/components/FileUploadAdapter/FileUploadAdapter.js +233 -337
- package/lib/components/FileUploadAdapter/FileUploadAdapter.js.map +1 -1
- package/lib/components/FileUploadAdapter/index.js +2 -3
- package/lib/components/FileUploadAdapter/index.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/format-initial-value.js +7 -8
- package/lib/components/FileUploadAdapter/mappers/format-initial-value.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/get-button-text.js +9 -10
- package/lib/components/FileUploadAdapter/mappers/get-button-text.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/get-format.js +7 -13
- package/lib/components/FileUploadAdapter/mappers/get-format.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js +6 -5
- package/lib/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/index.js +6 -7
- package/lib/components/FileUploadAdapter/mappers/index.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/is-unselecting.js +2 -10
- package/lib/components/FileUploadAdapter/mappers/is-unselecting.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/transform-to-array.js +2 -5
- package/lib/components/FileUploadAdapter/mappers/transform-to-array.js.map +1 -1
- package/lib/components/FileUploadAdapter/useLimit.js +4 -10
- package/lib/components/FileUploadAdapter/useLimit.js.map +1 -1
- package/lib/components/FileUploadModal/FileUploadModal.js +150 -145
- package/lib/components/FileUploadModal/FileUploadModal.js.map +1 -1
- package/lib/components/FileUploadModal/index.js +2 -3
- package/lib/components/FileUploadModal/index.js.map +1 -1
- package/lib/components/FilterPanel/FilterPanel.js +68 -88
- package/lib/components/FilterPanel/FilterPanel.js.map +1 -1
- package/lib/components/FilterPanel/index.js +2 -3
- package/lib/components/FilterPanel/index.js.map +1 -1
- package/lib/components/ListingContainer/Listing/Listing.js +58 -48
- package/lib/components/ListingContainer/Listing/Listing.js.map +1 -1
- package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +75 -92
- package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js.map +1 -1
- package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/index.js +2 -3
- package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/index.js.map +1 -1
- package/lib/components/ListingContainer/Listing/MediaListing/MediaListing.js +22 -26
- package/lib/components/ListingContainer/Listing/MediaListing/MediaListing.js.map +1 -1
- package/lib/components/ListingContainer/Listing/MediaListing/index.js +2 -3
- package/lib/components/ListingContainer/Listing/MediaListing/index.js.map +1 -1
- package/lib/components/ListingContainer/Listing/index.js +2 -3
- package/lib/components/ListingContainer/Listing/index.js.map +1 -1
- package/lib/components/ListingContainer/ListingContainer.js +69 -92
- package/lib/components/ListingContainer/ListingContainer.js.map +1 -1
- package/lib/components/ListingContainer/index.js +2 -3
- package/lib/components/ListingContainer/index.js.map +1 -1
- package/lib/components/ListingContainer/mappers/exist-previous.js +3 -10
- package/lib/components/ListingContainer/mappers/exist-previous.js.map +1 -1
- package/lib/components/ListingContainer/mappers/index.js +2 -3
- package/lib/components/ListingContainer/mappers/index.js.map +1 -1
- package/lib/components/MediaListing.js +14 -26
- package/lib/components/MediaListing.js.map +1 -1
- package/lib/constants.js +15 -16
- package/lib/constants.js.map +1 -1
- package/lib/icons/MediaLibraryIcon.js +17 -20
- package/lib/icons/MediaLibraryIcon.js.map +1 -1
- package/lib/icons/index.js +2 -3
- package/lib/icons/index.js.map +1 -1
- package/lib/index.js +67 -92
- package/lib/index.js.map +1 -1
- package/lib/utils/available-filters/available-filters.js +1 -2
- package/lib/utils/available-filters/available-filters.js.map +1 -1
- package/lib/utils/bustUrl.js +13 -0
- package/lib/utils/bustUrl.js.map +1 -0
- package/lib/utils/media-context/index.js +4 -5
- package/lib/utils/media-context/index.js.map +1 -1
- package/lib/utils/media-context/media-context.js +3 -4
- package/lib/utils/media-context/media-context.js.map +1 -1
- package/lib/utils/media-context/useMediaContext.js +2 -4
- package/lib/utils/media-context/useMediaContext.js.map +1 -1
- package/lib-es/components/CardMedia/CardMedia.js +22 -8
- package/lib-es/components/CardMedia/CardMedia.js.map +1 -1
- package/lib-es/components/CardMedia/index.js.map +1 -1
- package/lib-es/components/EditMediaFile/EditMediaFile.js +106 -34
- package/lib-es/components/EditMediaFile/EditMediaFile.js.map +1 -1
- package/lib-es/components/EditMediaFile/EditMediaFilePage.js +37 -14
- package/lib-es/components/EditMediaFile/EditMediaFilePage.js.map +1 -1
- package/lib-es/components/EditMediaFile/index.js.map +1 -1
- package/lib-es/components/EditorAdapter/EditorAdapter.js +26 -6
- package/lib-es/components/EditorAdapter/EditorAdapter.js.map +1 -1
- package/lib-es/components/EditorAdapter/index.js.map +1 -1
- package/lib-es/components/FileList/FilesListContext/index.js.map +1 -1
- package/lib-es/components/FileList/FilesListProvider/index.js.map +1 -1
- package/lib-es/components/FileList/useFileList/index.js.map +1 -1
- package/lib-es/components/FileList/useGetFiles/getFiles.js.map +1 -1
- package/lib-es/components/FileList/useGetFiles/index.js.map +1 -1
- package/lib-es/components/FileList/useGetFiles/useGetFiles.js.map +1 -1
- package/lib-es/components/FileList/useGetFilesList/getCounters.js.map +1 -1
- package/lib-es/components/FileList/useGetFilesList/index.js.map +1 -1
- package/lib-es/components/FileList/useGetFilesList/useGetFilesList.js.map +1 -1
- package/lib-es/components/FilePreview/Actions/index.js +2 -2
- package/lib-es/components/FilePreview/Actions/index.js.map +1 -1
- package/lib-es/components/FilePreview/Image/Image.js +16 -3
- package/lib-es/components/FilePreview/Image/Image.js.map +1 -1
- package/lib-es/components/FilePreview/Image/RawImage.js.map +1 -1
- package/lib-es/components/FilePreview/Image/imageSchema.js +1 -1
- package/lib-es/components/FilePreview/Image/imageSchema.js.map +1 -1
- package/lib-es/components/FilePreview/Image/index.js.map +1 -1
- package/lib-es/components/FilePreview/ModalContext.js +3 -0
- package/lib-es/components/FilePreview/ModalContext.js.map +1 -0
- package/lib-es/components/FilePreview/PDF/PDF.js +19 -4
- package/lib-es/components/FilePreview/PDF/PDF.js.map +1 -1
- package/lib-es/components/FilePreview/PDF/RawPDF.js.map +1 -1
- package/lib-es/components/FilePreview/PDF/index.js.map +1 -1
- package/lib-es/components/FilePreview/PDF/schema.js.map +1 -1
- package/lib-es/components/FilePreview/get-preview.js.map +1 -1
- package/lib-es/components/FilePreview/index.js +26 -7
- package/lib-es/components/FilePreview/index.js.map +1 -1
- package/lib-es/components/FilePreview/previewDefault/PreviewDefault.js +18 -4
- package/lib-es/components/FilePreview/previewDefault/PreviewDefault.js.map +1 -1
- package/lib-es/components/FilePreview/previewDefault/RawPreviewDefault.js +12 -4
- package/lib-es/components/FilePreview/previewDefault/RawPreviewDefault.js.map +1 -1
- package/lib-es/components/FilePreview/previewDefault/icons/DefaultIcon.js.map +1 -1
- package/lib-es/components/FilePreview/previewDefault/icons/index.js.map +1 -1
- package/lib-es/components/FilePreview/previewDefault/index.js.map +1 -1
- package/lib-es/components/FilePreview/previewDefault/previewDefaultSchema.js.map +1 -1
- package/lib-es/components/FilePreviewReadOnly/FileList.js +2 -2
- package/lib-es/components/FilePreviewReadOnly/FileList.js.map +1 -1
- package/lib-es/components/FilePreviewReadOnly/FilePreviewList.js.map +1 -1
- package/lib-es/components/FilePreviewReadOnly/FilePreviewReadOnly.js +14 -12
- package/lib-es/components/FilePreviewReadOnly/FilePreviewReadOnly.js.map +1 -1
- package/lib-es/components/FilePreviewReadOnly/index.js.map +1 -1
- package/lib-es/components/FilePreviewReadOnly/mappers/format-initial-value.js.map +1 -1
- package/lib-es/components/FilePreviewReadOnly/mappers/index.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/FileList.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/FilePreviewList.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/FileReorderList.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/FileReorderListItem.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/FileUploadAdapter.js +41 -21
- package/lib-es/components/FileUploadAdapter/FileUploadAdapter.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/index.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/format-initial-value.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/get-button-text.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/get-format.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js +5 -4
- package/lib-es/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/index.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/is-unselecting.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/transform-to-array.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/useLimit.js.map +1 -1
- package/lib-es/components/FileUploadModal/FileUploadModal.js +90 -25
- package/lib-es/components/FileUploadModal/FileUploadModal.js.map +1 -1
- package/lib-es/components/FileUploadModal/index.js.map +1 -1
- package/lib-es/components/FilterPanel/FilterPanel.js.map +1 -1
- package/lib-es/components/FilterPanel/index.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/Listing.js +17 -5
- package/lib-es/components/ListingContainer/Listing/Listing.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +14 -6
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/index.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaListing.js +12 -3
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaListing.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/MediaListing/index.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/index.js.map +1 -1
- package/lib-es/components/ListingContainer/ListingContainer.js +14 -5
- package/lib-es/components/ListingContainer/ListingContainer.js.map +1 -1
- package/lib-es/components/ListingContainer/index.js.map +1 -1
- package/lib-es/components/ListingContainer/mappers/exist-previous.js.map +1 -1
- package/lib-es/components/ListingContainer/mappers/index.js.map +1 -1
- package/lib-es/components/MediaListing.js.map +1 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/icons/MediaLibraryIcon.js.map +1 -1
- package/lib-es/icons/index.js.map +1 -1
- package/lib-es/index.js +20 -4
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/available-filters/available-filters.js.map +1 -1
- package/lib-es/utils/bustUrl.js +7 -0
- package/lib-es/utils/bustUrl.js.map +1 -0
- package/lib-es/utils/media-context/index.js.map +1 -1
- package/lib-es/utils/media-context/media-context.js.map +1 -1
- package/lib-es/utils/media-context/useMediaContext.js.map +1 -1
- package/package.json +26 -18
- package/src/components/CardMedia/CardMedia.js +28 -14
- package/src/components/EditMediaFile/EditMediaFile.js +117 -42
- package/src/components/EditMediaFile/EditMediaFilePage.js +35 -14
- package/src/components/EditorAdapter/EditorAdapter.js +31 -4
- package/src/components/FileList/useGetFilesList/useGetFilesList.js +15 -14
- package/src/components/FilePreview/Actions/index.js +25 -27
- package/src/components/FilePreview/Image/Image.js +15 -2
- package/src/components/FilePreview/Image/imageSchema.js +1 -1
- package/src/components/FilePreview/ModalContext.js +3 -0
- package/src/components/FilePreview/PDF/PDF.js +17 -4
- package/src/components/FilePreview/index.js +35 -6
- package/src/components/FilePreview/previewDefault/PreviewDefault.js +16 -3
- package/src/components/FilePreview/previewDefault/RawPreviewDefault.js +17 -7
- package/src/components/FilePreviewReadOnly/FileList.js +1 -3
- package/src/components/FilePreviewReadOnly/FilePreviewReadOnly.js +17 -29
- package/src/components/FileUploadAdapter/FileUploadAdapter.js +81 -69
- package/src/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js +6 -4
- package/src/components/FileUploadAdapter/useLimit.js +5 -8
- package/src/components/FileUploadModal/FileUploadModal.js +88 -42
- package/src/components/FilterPanel/FilterPanel.js +18 -23
- package/src/components/ListingContainer/Listing/Listing.js +15 -5
- package/src/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +30 -38
- package/src/components/ListingContainer/Listing/MediaListing/MediaListing.js +10 -2
- package/src/components/ListingContainer/ListingContainer.js +13 -4
- package/src/index.js +17 -10
- package/src/utils/bustUrl.js +6 -0
- package/CHANGELOG.md +0 -1235
- package/babel.config.js +0 -3
- package/jest.config.js +0 -5
|
@@ -18,14 +18,16 @@ const ListingContainer = ({
|
|
|
18
18
|
displayFileUploadModal,
|
|
19
19
|
setDisplayFileUploadModal,
|
|
20
20
|
closeModalAndSetValue,
|
|
21
|
-
simpleLayout
|
|
21
|
+
simpleLayout,
|
|
22
|
+
openEditInModal,
|
|
23
|
+
storeKey
|
|
22
24
|
}) => {
|
|
23
25
|
const [selectedFiles, setSelectedFiles] = useState(filesSelected || []);
|
|
24
26
|
const [selectedFilter, setSelectedFilter] = useState({
|
|
25
27
|
filter: 'all',
|
|
26
28
|
isSearch: false,
|
|
27
29
|
searchTerm: null,
|
|
28
|
-
storeKey
|
|
30
|
+
storeKey
|
|
29
31
|
});
|
|
30
32
|
const fileStoresType = getQuery('GET_FILE_STORES');
|
|
31
33
|
const {
|
|
@@ -83,7 +85,10 @@ const ListingContainer = ({
|
|
|
83
85
|
displayFileUploadModal: displayFileUploadModal,
|
|
84
86
|
handleDisplayFileUploadModal: handleDisplayFileUploadModal,
|
|
85
87
|
setSelectedFiles: setSelectedFiles,
|
|
86
|
-
handleSelectedFiles: handleSelectedFiles
|
|
88
|
+
handleSelectedFiles: handleSelectedFiles,
|
|
89
|
+
openEditInModal: openEditInModal,
|
|
90
|
+
selectedStoreKey: selectedFilter.storeKey || defaultFileStore,
|
|
91
|
+
storeKey: storeKey
|
|
87
92
|
}))));
|
|
88
93
|
};
|
|
89
94
|
ListingContainer.propTypes = {
|
|
@@ -93,14 +98,18 @@ ListingContainer.propTypes = {
|
|
|
93
98
|
simpleLayout: PropTypes.bool,
|
|
94
99
|
setDisplayFileUploadModal: PropTypes.func.isRequired,
|
|
95
100
|
displayFileUploadModal: PropTypes.bool.isRequired,
|
|
96
|
-
closeModalAndSetValue: PropTypes.func
|
|
101
|
+
closeModalAndSetValue: PropTypes.func,
|
|
102
|
+
openEditInModal: PropTypes.bool,
|
|
103
|
+
storeKey: PropTypes.string
|
|
97
104
|
};
|
|
98
105
|
ListingContainer.defaultProps = {
|
|
99
106
|
closeModalAndSetValue: () => {},
|
|
100
107
|
handleSelectedFiles: () => {},
|
|
101
108
|
maxItems: false,
|
|
102
109
|
filesSelected: [],
|
|
103
|
-
simpleLayout: false
|
|
110
|
+
simpleLayout: false,
|
|
111
|
+
openEditInModal: false,
|
|
112
|
+
storeKey: 'default'
|
|
104
113
|
};
|
|
105
114
|
export default ListingContainer;
|
|
106
115
|
//# sourceMappingURL=ListingContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListingContainer.js","names":["React","useState","PropTypes","useQuery","getQuery","ToastProvider","Listing","availableFilters","MediaContextProvider","FilesListProvider","existPrevious","ListingContainer","handleSelectedFiles","maxItems","filesSelected","displayFileUploadModal","setDisplayFileUploadModal","closeModalAndSetValue","simpleLayout","selectedFiles","setSelectedFiles","selectedFilter","setSelectedFilter","filter","isSearch","searchTerm","
|
|
1
|
+
{"version":3,"file":"ListingContainer.js","names":["React","useState","PropTypes","useQuery","getQuery","ToastProvider","Listing","availableFilters","MediaContextProvider","FilesListProvider","existPrevious","ListingContainer","handleSelectedFiles","maxItems","filesSelected","displayFileUploadModal","setDisplayFileUploadModal","closeModalAndSetValue","simpleLayout","openEditInModal","storeKey","selectedFiles","setSelectedFiles","selectedFilter","setSelectedFilter","filter","isSearch","searchTerm","fileStoresType","loading","data","getFileStores","fileStores","variables","visibleInAdmin","getSelectedFiles","file","files","id","existPreviousFile","length","allSelectedFiles","fileId","handleDisplayFileUploadModal","param","defaultFileStore","find","isDefault","key","createElement","value","changeSelectedFilter","_objectSpread","filters","onClickPrompt","selectedStoreKey","propTypes","func","oneOfType","number","bool","arrayOf","string","isRequired","defaultProps"],"sources":["../../../src/components/ListingContainer/ListingContainer.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useQuery } from '@apollo/client';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { ToastProvider } from '@blaze-react/toaster';\nimport Listing from './Listing';\nimport { availableFilters } from '../../utils/available-filters/available-filters';\nimport { MediaContextProvider } from '../../utils/media-context';\nimport FilesListProvider from '../FileList/FilesListProvider';\nimport { existPrevious } from './mappers';\n\nconst ListingContainer = ({\n handleSelectedFiles,\n maxItems,\n filesSelected,\n displayFileUploadModal,\n setDisplayFileUploadModal,\n closeModalAndSetValue,\n simpleLayout,\n openEditInModal,\n storeKey\n}) => {\n const [selectedFiles, setSelectedFiles] = useState(filesSelected || []);\n const [selectedFilter, setSelectedFilter] = useState({\n filter: 'all',\n isSearch: false,\n searchTerm: null,\n storeKey\n });\n\n const fileStoresType = getQuery('GET_FILE_STORES');\n const { loading, data: { getFileStores: fileStores = [] } = {} } = useQuery(fileStoresType, {\n variables: { visibleInAdmin: true }\n });\n if (loading) return null;\n\n const getSelectedFiles = (file, files) => {\n if (simpleLayout) {\n handleSelectedFiles(files, false);\n setSelectedFiles(files);\n return;\n }\n const { id } = file;\n const existPreviousFile = existPrevious(selectedFiles, id);\n if (maxItems === selectedFiles.length && !existPreviousFile) {\n handleSelectedFiles([id], false);\n setSelectedFiles([id]);\n } else {\n const allSelectedFiles = existPreviousFile\n ? selectedFiles.filter(fileId => fileId !== existPreviousFile)\n : [...selectedFiles, id];\n\n handleSelectedFiles(allSelectedFiles, false);\n setSelectedFiles(allSelectedFiles);\n }\n };\n\n const handleDisplayFileUploadModal = param => setDisplayFileUploadModal(param);\n const defaultFileStore = (fileStores.find(({ isDefault }) => isDefault) || {}).key;\n\n return (\n <ToastProvider>\n <MediaContextProvider\n value={{\n fileStores,\n defaultFileStore,\n changeSelectedFilter: value => setSelectedFilter(value),\n selectedFilter: {\n ...selectedFilter,\n storeKey: selectedFilter.storeKey || defaultFileStore\n },\n selectedFiles,\n getSelectedFiles,\n filters: availableFilters,\n onClickPrompt: () => handleDisplayFileUploadModal(true)\n }}>\n <FilesListProvider>\n <Listing\n closeModalAndSetValue={closeModalAndSetValue}\n simpleLayout={simpleLayout}\n getSelectedFiles={getSelectedFiles}\n setDisplayFileUploadModal={setDisplayFileUploadModal}\n displayFileUploadModal={displayFileUploadModal}\n handleDisplayFileUploadModal={handleDisplayFileUploadModal}\n setSelectedFiles={setSelectedFiles}\n handleSelectedFiles={handleSelectedFiles}\n openEditInModal={openEditInModal}\n selectedStoreKey={selectedFilter.storeKey || defaultFileStore}\n storeKey={storeKey}\n />\n </FilesListProvider>\n </MediaContextProvider>\n </ToastProvider>\n );\n};\n\nListingContainer.propTypes = {\n handleSelectedFiles: PropTypes.func,\n maxItems: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]),\n filesSelected: PropTypes.arrayOf(PropTypes.string),\n simpleLayout: PropTypes.bool,\n setDisplayFileUploadModal: PropTypes.func.isRequired,\n displayFileUploadModal: PropTypes.bool.isRequired,\n closeModalAndSetValue: PropTypes.func,\n openEditInModal: PropTypes.bool,\n storeKey: PropTypes.string\n};\n\nListingContainer.defaultProps = {\n closeModalAndSetValue: () => {},\n handleSelectedFiles: () => {},\n maxItems: false,\n filesSelected: [],\n simpleLayout: false,\n openEditInModal: false,\n storeKey: 'default'\n};\n\nexport default ListingContainer;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,QAAQ,QAAQ,2BAA2B;AACpD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,OAAOC,OAAO,MAAM,WAAW;AAC/B,SAASC,gBAAgB,QAAQ,iDAAiD;AAClF,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,OAAOC,iBAAiB,MAAM,+BAA+B;AAC7D,SAASC,aAAa,QAAQ,WAAW;AAEzC,MAAMC,gBAAgB,GAAGA,CAAC;EACxBC,mBAAmB;EACnBC,QAAQ;EACRC,aAAa;EACbC,sBAAsB;EACtBC,yBAAyB;EACzBC,qBAAqB;EACrBC,YAAY;EACZC,eAAe;EACfC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,G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GAAG;EAC3B5C,mBAAmB,EAAEV,SAAS,CAACuD,IAAI;EACnC5C,QAAQ,EAAEX,SAAS,CAACwD,SAAS,CAAC,CAACxD,SAAS,CAACyD,MAAM,EAAEzD,SAAS,CAAC0D,IAAI,CAAC,CAAC;EACjE9C,aAAa,EAAEZ,SAAS,CAAC2D,OAAO,CAAC3D,SAAS,CAAC4D,MAAM,CAAC;EAClD5C,YAAY,EAAEhB,SAAS,CAAC0D,IAAI;EAC5B5C,yBAAyB,EAAEd,SAAS,CAACuD,IAAI,CAACM,UAAU;EACpDhD,sBAAsB,EAAEb,SAAS,CAAC0D,IAAI,CAACG,UAAU;EACjD9C,qBAAqB,EAAEf,SAAS,CAACuD,IAAI;EACrCtC,eAAe,EAAEjB,SAAS,CAAC0D,IAAI;EAC/BxC,QAAQ,EAAElB,SAAS,CAAC4D;AACtB,CAAC;AAEDnD,gBAAgB,CAACqD,YAAY,GAAG;EAC9B/C,qBAAqB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC/BL,mBAAmB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC7BC,QAAQ,EAAE,KAAK;EACfC,aAAa,EAAE,EAAE;EACjBI,YAAY,EAAE,KAAK;EACnBC,eAAe,EAAE,KAAK;EACtBC,QAAQ,EAAE;AACZ,CAAC;AAED,eAAeT,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ListingContainer"],"sources":["../../../src/components/ListingContainer/index.js"],"sourcesContent":["import ListingContainer from './ListingContainer';\n\nexport default ListingContainer;\n"],"mappings":"AAAA,OAAOA,gBAAgB,MAAM,oBAAoB;AAEjD,eAAeA,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ListingContainer"],"sources":["../../../src/components/ListingContainer/index.js"],"sourcesContent":["import ListingContainer from './ListingContainer';\n\nexport default ListingContainer;\n"],"mappings":"AAAA,OAAOA,gBAAgB,MAAM,oBAAoB;AAEjD,eAAeA,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exist-previous.js","names":["existPrevious","selectedFiles","id","find","fileId"],"sources":["../../../../src/components/ListingContainer/mappers/exist-previous.js"],"sourcesContent":["const existPrevious = (selectedFiles, id) => selectedFiles.find(fileId => fileId === id);\n\nexport default existPrevious;\n"],"mappings":"AAAA,MAAMA,aAAa,GAAGA,CAACC,aAAa,EAAEC,EAAE,KAAKD,aAAa,CAACE,IAAI,CAACC,MAAM,IAAIA,MAAM,KAAKF,EAAE,CAAC;AAExF,eAAeF,aAAa"}
|
|
1
|
+
{"version":3,"file":"exist-previous.js","names":["existPrevious","selectedFiles","id","find","fileId"],"sources":["../../../../src/components/ListingContainer/mappers/exist-previous.js"],"sourcesContent":["const existPrevious = (selectedFiles, id) => selectedFiles.find(fileId => fileId === id);\n\nexport default existPrevious;\n"],"mappings":"AAAA,MAAMA,aAAa,GAAGA,CAACC,aAAa,EAAEC,EAAE,KAAKD,aAAa,CAACE,IAAI,CAACC,MAAM,IAAIA,MAAM,KAAKF,EAAE,CAAC;AAExF,eAAeF,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["existPrevious"],"sources":["../../../../src/components/ListingContainer/mappers/index.js"],"sourcesContent":["import existPrevious from './exist-previous';\n\nexport { existPrevious };\n"],"mappings":"AAAA,OAAOA,aAAa,MAAM,kBAAkB;AAE5C,SAASA,aAAa"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["existPrevious"],"sources":["../../../../src/components/ListingContainer/mappers/index.js"],"sourcesContent":["import existPrevious from './exist-previous';\n\nexport { existPrevious };\n"],"mappings":"AAAA,OAAOA,aAAa,MAAM,kBAAkB;AAE5C,SAASA,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaListing.js","names":["React","useState","PropTypes","ListingContainer","MediaListing","handleSelectedFiles","maxItems","filesSelected","displayFileUploadModal","setDisplayFileUploadModal","createElement","propTypes","func","oneOfType","number","bool","arrayOf","string","defaultProps"],"sources":["../../src/components/MediaListing.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport ListingContainer from './ListingContainer';\n\nconst MediaListing = ({ handleSelectedFiles, maxItems, filesSelected }) => {\n const [displayFileUploadModal, setDisplayFileUploadModal] = useState(false);\n\n return (\n <ListingContainer\n setDisplayFileUploadModal={setDisplayFileUploadModal}\n displayFileUploadModal={displayFileUploadModal}\n handleSelectedFiles={handleSelectedFiles}\n filesSelected={filesSelected}\n maxItems={maxItems}\n />\n );\n};\n\nMediaListing.propTypes = {\n handleSelectedFiles: PropTypes.func,\n maxItems: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]),\n filesSelected: PropTypes.arrayOf(PropTypes.string)\n};\n\nMediaListing.defaultProps = {\n handleSelectedFiles: () => {},\n maxItems: false,\n filesSelected: []\n};\n\nexport default MediaListing;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,MAAMC,YAAY,GAAGA,CAAC;EAAEC,mBAAmB;EAAEC,QAAQ;EAAEC;AAAc,CAAC,KAAK;EACzE,MAAM,CAACC,sBAAsB,EAAEC,yBAAyB,CAAC,GAAGR,QAAQ,CAAC,KAAK,CAAC;EAE3E,oBACED,KAAA,CAAAU,aAAA,CAACP,gBAAgB;IACfM,yBAAyB,EAAEA,yBAA0B;IACrDD,sBAAsB,EAAEA,sBAAuB;IAC/CH,mBAAmB,EAAEA,mBAAoB;IACzCE,aAAa,EAAEA,aAAc;IAC7BD,QAAQ,EAAEA;EAAS,CACpB,CAAC;AAEN,CAAC;AAEDF,YAAY,CAACO,SAAS,GAAG;EACvBN,mBAAmB,EAAEH,SAAS,CAACU,IAAI;EACnCN,QAAQ,EAAEJ,SAAS,CAACW,SAAS,CAAC,CAACX,SAAS,CAACY,MAAM,EAAEZ,SAAS,CAACa,IAAI,CAAC,CAAC;EACjER,aAAa,EAAEL,SAAS,CAACc,OAAO,CAACd,SAAS,CAACe,MAAM;AACnD,CAAC;AAEDb,YAAY,CAACc,YAAY,GAAG;EAC1Bb,mBAAmB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC7BC,QAAQ,EAAE,KAAK;EACfC,aAAa,EAAE;AACjB,CAAC;AAED,eAAeH,YAAY"}
|
|
1
|
+
{"version":3,"file":"MediaListing.js","names":["React","useState","PropTypes","ListingContainer","MediaListing","handleSelectedFiles","maxItems","filesSelected","displayFileUploadModal","setDisplayFileUploadModal","createElement","propTypes","func","oneOfType","number","bool","arrayOf","string","defaultProps"],"sources":["../../src/components/MediaListing.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport ListingContainer from './ListingContainer';\n\nconst MediaListing = ({ handleSelectedFiles, maxItems, filesSelected }) => {\n const [displayFileUploadModal, setDisplayFileUploadModal] = useState(false);\n\n return (\n <ListingContainer\n setDisplayFileUploadModal={setDisplayFileUploadModal}\n displayFileUploadModal={displayFileUploadModal}\n handleSelectedFiles={handleSelectedFiles}\n filesSelected={filesSelected}\n maxItems={maxItems}\n />\n );\n};\n\nMediaListing.propTypes = {\n handleSelectedFiles: PropTypes.func,\n maxItems: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]),\n filesSelected: PropTypes.arrayOf(PropTypes.string)\n};\n\nMediaListing.defaultProps = {\n handleSelectedFiles: () => {},\n maxItems: false,\n filesSelected: []\n};\n\nexport default MediaListing;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,MAAMC,YAAY,GAAGA,CAAC;EAAEC,mBAAmB;EAAEC,QAAQ;EAAEC;AAAc,CAAC,KAAK;EACzE,MAAM,CAACC,sBAAsB,EAAEC,yBAAyB,CAAC,GAAGR,QAAQ,CAAC,KAAK,CAAC;EAE3E,oBACED,KAAA,CAAAU,aAAA,CAACP,gBAAgB;IACfM,yBAAyB,EAAEA,yBAA0B;IACrDD,sBAAsB,EAAEA,sBAAuB;IAC/CH,mBAAmB,EAAEA,mBAAoB;IACzCE,aAAa,EAAEA,aAAc;IAC7BD,QAAQ,EAAEA;EAAS,CACpB,CAAC;AAEN,CAAC;AAEDF,YAAY,CAACO,SAAS,GAAG;EACvBN,mBAAmB,EAAEH,SAAS,CAACU,IAAI;EACnCN,QAAQ,EAAEJ,SAAS,CAACW,SAAS,CAAC,CAACX,SAAS,CAACY,MAAM,EAAEZ,SAAS,CAACa,IAAI,CAAC,CAAC;EACjER,aAAa,EAAEL,SAAS,CAACc,OAAO,CAACd,SAAS,CAACe,MAAM;AACnD,CAAC;AAEDb,YAAY,CAACc,YAAY,GAAG;EAC1Bb,mBAAmB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC7BC,QAAQ,EAAE,KAAK;EACfC,aAAa,EAAE;AACjB,CAAC;AAED,eAAeH,YAAY","ignoreList":[]}
|
package/lib-es/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["PLUGIN_NAME","ONE_FILE_AS_LIMIT","AVAILABLE_FILTER_TYPES","all","type","images","videos","documents","MEDIA_LIST_ITEM_SIZE","MEDIA_OVER_SCAN_COUNT","ICON_SIZE","WIDTH","HEIGHT","ICON_COLOR","STROKE","FILL","STORE_KEY","NAME","ALL","INVALID_STORE_KEY_VALUES","PREVIEW","REORDER","IMAGES","MORE"],"sources":["../src/constants.js"],"sourcesContent":["const PLUGIN_NAME = 'media-ui';\nconst ONE_FILE_AS_LIMIT = 1;\nconst AVAILABLE_FILTER_TYPES = {\n all: {\n type: 'all'\n },\n images: {\n type: 'image'\n },\n videos: {\n type: 'video'\n },\n documents: {\n type: 'text'\n }\n};\n\nconst MEDIA_LIST_ITEM_SIZE = 97;\nconst MEDIA_OVER_SCAN_COUNT = 0;\n\nconst ICON_SIZE = {\n WIDTH: '25px',\n HEIGHT: '25px'\n};\n\nconst ICON_COLOR = {\n STROKE: '#63779C',\n FILL: '#63779C'\n};\n\nconst STORE_KEY = 'storeKey';\nconst NAME = 'name';\n\nconst ALL = 'all';\nconst INVALID_STORE_KEY_VALUES = [null, '', 'Please Choose...', 'Any'];\nconst PREVIEW = 'Preview';\nconst REORDER = 'Reorder';\nconst IMAGES = 'Images';\nconst MORE = 'more ...';\n\nexport {\n ALL,\n AVAILABLE_FILTER_TYPES,\n IMAGES,\n INVALID_STORE_KEY_VALUES,\n MEDIA_LIST_ITEM_SIZE,\n MEDIA_OVER_SCAN_COUNT,\n MORE,\n NAME,\n ONE_FILE_AS_LIMIT,\n PLUGIN_NAME,\n PREVIEW,\n REORDER,\n STORE_KEY,\n ICON_SIZE,\n ICON_COLOR\n};\n"],"mappings":"AAAA,MAAMA,WAAW,GAAG,UAAU;AAC9B,MAAMC,iBAAiB,GAAG,CAAC;AAC3B,MAAMC,sBAAsB,GAAG;EAC7BC,GAAG,EAAE;IACHC,IAAI,EAAE;EACR,CAAC;EACDC,MAAM,EAAE;IACND,IAAI,EAAE;EACR,CAAC;EACDE,MAAM,EAAE;IACNF,IAAI,EAAE;EACR,CAAC;EACDG,SAAS,EAAE;IACTH,IAAI,EAAE;EACR;AACF,CAAC;AAED,MAAMI,oBAAoB,GAAG,EAAE;AAC/B,MAAMC,qBAAqB,GAAG,CAAC;AAE/B,MAAMC,SAAS,GAAG;EAChBC,KAAK,EAAE,MAAM;EACbC,MAAM,EAAE;AACV,CAAC;AAED,MAAMC,UAAU,GAAG;EACjBC,MAAM,EAAE,SAAS;EACjBC,IAAI,EAAE;AACR,CAAC;AAED,MAAMC,SAAS,GAAG,UAAU;AAC5B,MAAMC,IAAI,GAAG,MAAM;AAEnB,MAAMC,GAAG,GAAG,KAAK;AACjB,MAAMC,wBAAwB,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,kBAAkB,EAAE,KAAK,CAAC;AACtE,MAAMC,OAAO,GAAG,SAAS;AACzB,MAAMC,OAAO,GAAG,SAAS;AACzB,MAAMC,MAAM,GAAG,QAAQ;AACvB,MAAMC,IAAI,GAAG,UAAU;AAEvB,SACEL,GAAG,EACHhB,sBAAsB,EACtBoB,MAAM,EACNH,wBAAwB,EACxBX,oBAAoB,EACpBC,qBAAqB,EACrBc,IAAI,EACJN,IAAI,EACJhB,iBAAiB,EACjBD,WAAW,EACXoB,OAAO,EACPC,OAAO,EACPL,SAAS,EACTN,SAAS,EACTG,UAAU"}
|
|
1
|
+
{"version":3,"file":"constants.js","names":["PLUGIN_NAME","ONE_FILE_AS_LIMIT","AVAILABLE_FILTER_TYPES","all","type","images","videos","documents","MEDIA_LIST_ITEM_SIZE","MEDIA_OVER_SCAN_COUNT","ICON_SIZE","WIDTH","HEIGHT","ICON_COLOR","STROKE","FILL","STORE_KEY","NAME","ALL","INVALID_STORE_KEY_VALUES","PREVIEW","REORDER","IMAGES","MORE"],"sources":["../src/constants.js"],"sourcesContent":["const PLUGIN_NAME = 'media-ui';\nconst ONE_FILE_AS_LIMIT = 1;\nconst AVAILABLE_FILTER_TYPES = {\n all: {\n type: 'all'\n },\n images: {\n type: 'image'\n },\n videos: {\n type: 'video'\n },\n documents: {\n type: 'text'\n }\n};\n\nconst MEDIA_LIST_ITEM_SIZE = 97;\nconst MEDIA_OVER_SCAN_COUNT = 0;\n\nconst ICON_SIZE = {\n WIDTH: '25px',\n HEIGHT: '25px'\n};\n\nconst ICON_COLOR = {\n STROKE: '#63779C',\n FILL: '#63779C'\n};\n\nconst STORE_KEY = 'storeKey';\nconst NAME = 'name';\n\nconst ALL = 'all';\nconst INVALID_STORE_KEY_VALUES = [null, '', 'Please Choose...', 'Any'];\nconst PREVIEW = 'Preview';\nconst REORDER = 'Reorder';\nconst IMAGES = 'Images';\nconst MORE = 'more ...';\n\nexport {\n ALL,\n AVAILABLE_FILTER_TY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AS,EACTG,UAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaLibraryIcon.js","names":["React","ICON_SIZE","ICON_COLOR","MediaLibraryIcon","width","WIDTH","height","HEIGHT","stroke","STROKE","createElement","viewBox","version","xmlns","xmlnsXlink","id","strokeWidth","fill","fillRule","transform","d","strokeLinecap","strokeLinejoin","cx","cy","rx","ry","x","y"],"sources":["../../src/icons/MediaLibraryIcon.js"],"sourcesContent":["import React from 'react';\nimport { ICON_SIZE, ICON_COLOR } from '../constants';\n\nfunction MediaLibraryIcon({\n width = ICON_SIZE.WIDTH,\n height = ICON_SIZE.HEIGHT,\n stroke = ICON_COLOR.STROKE\n}) {\n return (\n <svg\n width={width}\n height={height}\n viewBox=\"0 0 23 22\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\">\n <title>media-library</title>\n <g id=\"Page-1\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"media-library\" transform=\"translate(1, 1.5)\">\n <g\n id=\"Group\"\n transform=\"translate(11.2707, 9.5) rotate(10) translate(-11.2707, -9.5)translate(2.7864, 1.3495)\">\n <path\n d=\"M6.97432089e-17,12.2258144 L4.86362131,7.55351567 C5.69190017,6.75805948 7.03454026,6.75805948 7.86281911,7.55351567 L12.7264404,12.2258144 M10.6053671,10.1881787 L12.2873782,8.57233353 C13.1156571,7.77687734 14.4582972,7.77687734 15.286576,8.57233353 L16.9685872,10.1881787 M2.1210734,16.3010859 L14.8475139,16.3010859 C16.0189503,16.3010859 16.9685872,15.3888053 16.9685872,14.2634501 L16.9685872,2.03763573 C16.9685872,0.912280592 16.0189503,0 14.8475139,0 L2.1210734,0 C0.949636909,0 6.97432089e-17,0.912280592 6.97432089e-17,2.03763573 L6.97432089e-17,14.2634501 C6.97432089e-17,15.3888053 0.949636909,16.3010859 2.1210734,16.3010859 Z\"\n id=\"Shape\"\n stroke={stroke}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <ellipse\n id=\"Oval\"\n fill=\"#899BBC\"\n fillRule=\"nonzero\"\n cx=\"10.6975876\"\n cy=\"4.41487742\"\n rx=\"1.106647\"\n ry=\"1.01881787\"\n />\n </g>\n <rect\n id=\"Rectangle\"\n fill=\"#FFFFFF\"\n fillRule=\"nonzero\"\n x=\"0\"\n y=\"2.52861778\"\n width=\"16.9685872\"\n height=\"16.3010859\"\n rx=\"3\"\n />\n <g id=\"Group\" transform=\"translate(0, 2.5286)\">\n <path\n d=\"M0,12.2258144 L4.86362131,7.55351567 C5.69190017,6.75805948 7.03454026,6.75805948 7.86281911,7.55351567 L12.7264404,12.2258144 M10.6053671,10.1881787 L12.2873782,8.57233353 C13.1156571,7.77687734 14.4582972,7.77687734 15.286576,8.57233353 L16.9685872,10.1881787 M2.1210734,16.3010859 L14.8475139,16.3010859 C16.0189503,16.3010859 16.9685872,15.3888053 16.9685872,14.2634501 L16.9685872,2.03763573 C16.9685872,0.912280592 16.0189503,0 14.8475139,0 L2.1210734,0 C0.949636909,0 0,0.912280592 0,2.03763573 L0,14.2634501 C0,15.3888053 0.949636909,16.3010859 2.1210734,16.3010859 Z\"\n id=\"Shape\"\n stroke=\"#63779C\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <ellipse\n id=\"Oval\"\n fill=\"#63779C\"\n fillRule=\"nonzero\"\n cx=\"10.6975876\"\n cy=\"4.41487742\"\n rx=\"1.106647\"\n ry=\"1.01881787\"\n />\n </g>\n </g>\n </g>\n </svg>\n );\n}\n\nexport default MediaLibraryIcon;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAEpD,SAASC,gBAAgBA,CAAC;EACxBC,KAAK,GAAGH,SAAS,CAACI,KAAK;EACvBC,MAAM,GAAGL,SAAS,CAACM,MAAM;EACzBC,MAAM,GAAGN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,EAAC,OAAO;IAACI,SAAS,EAAC;EAAsB,gBAC5CnB,KAAA,CAAAU,aAAA;IACEU,CAAC,EAAC,ikBAAikB;IACnkBL,EAAE,EAAC,OAAO;IACVP,MAAM,EAAC,SAAS;IAChBa,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC;EAAO,CACvB,CAAC,eACFtB,KAAA,CAAAU,aAAA;IACEK,EAAE,EAAC,MAAM;IACTE,IAAI,EAAC,SAAS;IACdC,QAAQ,EAAC,SAAS;IAClBK,EAAE,EAAC,YAAY;IACfC,EAAE,EAAC,YAAY;IACfC,EAAE,EAAC,UAAU;IACbC,EAAE,EAAC;EAAY,CAChB,CACA,CACF,CACF,CACA,CAAC;AAEV;AAEA,eAAevB,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"MediaLibraryIcon.js","names":["React","ICON_SIZE","ICON_COLOR","MediaLibraryIcon","width","WIDTH","height","HEIGHT","stroke","STROKE","createElement","viewBox","version","xmlns","xmlnsXlink","id","strokeWidth","fill","fillRule","transform","d","strokeLinecap","strokeLinejoin","cx","cy","rx","ry","x","y"],"sources":["../../src/icons/MediaLibraryIcon.js"],"sourcesContent":["import React from 'react';\nimport { ICON_SIZE, ICON_COLOR } from '../constants';\n\nfunction MediaLibraryIcon({\n width = ICON_SIZE.WIDTH,\n height = ICON_SIZE.HEIGHT,\n stroke = ICON_COLOR.STROKE\n}) {\n return (\n <svg\n width={width}\n height={height}\n viewBox=\"0 0 23 22\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\">\n <title>media-library</title>\n <g id=\"Page-1\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"media-library\" transform=\"translate(1, 1.5)\">\n <g\n id=\"Group\"\n transform=\"translate(11.2707, 9.5) rotate(10) translate(-11.2707, -9.5)translate(2.7864, 1.3495)\">\n <path\n d=\"M6.97432089e-17,12.2258144 L4.86362131,7.55351567 C5.69190017,6.75805948 7.03454026,6.75805948 7.86281911,7.55351567 L12.7264404,12.2258144 M10.6053671,10.1881787 L12.2873782,8.57233353 C13.1156571,7.77687734 14.4582972,7.77687734 15.286576,8.57233353 L16.9685872,10.1881787 M2.1210734,16.3010859 L14.8475139,16.3010859 C16.0189503,16.3010859 16.9685872,15.3888053 16.9685872,14.2634501 L16.9685872,2.03763573 C16.9685872,0.912280592 16.0189503,0 14.8475139,0 L2.1210734,0 C0.949636909,0 6.97432089e-17,0.912280592 6.97432089e-17,2.03763573 L6.97432089e-17,14.2634501 C6.97432089e-17,15.3888053 0.949636909,16.3010859 2.1210734,16.3010859 Z\"\n id=\"Shape\"\n stroke={stroke}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <ellipse\n id=\"Oval\"\n fill=\"#899BBC\"\n fillRule=\"nonzero\"\n cx=\"10.6975876\"\n cy=\"4.41487742\"\n rx=\"1.106647\"\n ry=\"1.01881787\"\n />\n </g>\n <rect\n id=\"Rectangle\"\n fill=\"#FFFFFF\"\n fillRule=\"nonzero\"\n x=\"0\"\n y=\"2.52861778\"\n width=\"16.9685872\"\n height=\"16.3010859\"\n rx=\"3\"\n />\n <g id=\"Group\" transform=\"translate(0, 2.5286)\">\n <path\n d=\"M0,12.2258144 L4.86362131,7.55351567 C5.69190017,6.75805948 7.03454026,6.75805948 7.86281911,7.55351567 L12.7264404,12.2258144 M10.6053671,10.1881787 L12.2873782,8.57233353 C13.1156571,7.77687734 14.4582972,7.77687734 15.286576,8.57233353 L16.9685872,10.1881787 M2.1210734,16.3010859 L14.8475139,16.3010859 C16.0189503,16.3010859 16.9685872,15.3888053 16.9685872,14.2634501 L16.9685872,2.03763573 C16.9685872,0.912280592 16.0189503,0 14.8475139,0 L2.1210734,0 C0.949636909,0 0,0.912280592 0,2.03763573 L0,14.2634501 C0,15.3888053 0.949636909,16.3010859 2.1210734,16.3010859 Z\"\n id=\"Shape\"\n stroke=\"#63779C\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <ellipse\n id=\"Oval\"\n fill=\"#63779C\"\n fillRule=\"nonzero\"\n cx=\"10.6975876\"\n cy=\"4.41487742\"\n rx=\"1.106647\"\n ry=\"1.01881787\"\n />\n </g>\n </g>\n </g>\n </svg>\n );\n}\n\nexport default MediaLibraryIcon;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAEpD,SAASC,gBAAgBA,CAAC;EACxBC,KAAK,GAAGH,SAAS,CAACI,KAAK;EACvBC,MAAM,GAAGL,SAAS,CAACM,MAAM;EACzBC,MAAM,GAAGN,UAAU,CAACO;AACtB,CAAC,EAAE;EACD,oBACET,KAAA,CAAAU,aAAA;IACEN,KAAK,EAAEA,KAAM;IACbE,MAAM,EAAEA,MAAO;IACfK,OAAO,EAAC,WAAW;IACnBC,OAAO,EAAC,KAAK;IACbC,KAAK,EAAC,4BAA4B;IAClCC,UAAU,EAAC;EAA8B,gBACzCd,KAAA,CAAAU,aAAA,gBAAO,eAAoB,CAAC,eAC5BV,KAAA,CAAAU,aAAA;IAAGK,EAAE,EAAC,QAAQ;IAACP,MAAM,EAAC,MAAM;IAACQ,WAAW,EAAC,GAAG;IAACC,IAAI,EAAC,MAAM;IAACC,QAAQ,EAAC;EAAS,gBACzElB,KAAA,CAAAU,aAAA;IAAGK,EAAE,EAAC,eAAe;IAACI,SAAS,EAAC;EAAmB,gBACjDnB,KAAA,CAAAU,aAAA;IACEK,EAAE,EAAC,OAAO;IACVI,SAAS,EAAC;EAAuF,gBACjGnB,KAAA,CAAAU,aAAA;IACEU,CAAC,EAAC,koBAAkoB;IACpoBL,EAAE,EAAC,OAAO;IACVP,MAAM,EAAEA,MAAO;IACfa,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC;EAAO,CACvB,CAAC,eACFtB,KAAA,CAAAU,aAAA;IACEK,EAAE,EAAC,MAAM;IACTE,IAAI,EAAC,SAAS;IACdC,QAAQ,EAAC,SAAS;IAClBK,EAAE,EAAC,YAAY;IACfC,EAAE,EAAC,YAAY;IACfC,EAAE,EAAC,UAAU;IACbC,EAAE,EAAC;EAAY,CAChB,CACA,CAAC,eACJ1B,KAAA,CAAAU,aAAA;IACEK,EAAE,EAAC,WAAW;IACdE,IAAI,EAAC,SAAS;IACdC,QAAQ,EAAC,SAAS;IAClBS,CAAC,EAAC,GAAG;IACLC,CAAC,EAAC,YAAY;IACdxB,KAAK,EAAC,YAAY;IAClBE,MAAM,EAAC,YAAY;IACnBmB,EAAE,EAAC;EAAG,CACP,CAAC,eACFzB,KAAA,CAAAU,aAAA;IAAGK,EAAE,EAAC,OAAO;IAACI,SAAS,EAAC;EAAsB,gBAC5CnB,KAAA,CAAAU,aAAA;IACEU,CAAC,EAAC,ikBAAikB;IACnkBL,EAAE,EAAC,OAAO;IACVP,MAAM,EAAC,SAAS;IAChBa,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC;EAAO,CACvB,CAAC,eACFtB,KAAA,CAAAU,aAAA;IACEK,EAAE,EAAC,MAAM;IACTE,IAAI,EAAC,SAAS;IACdC,QAAQ,EAAC,SAAS;IAClBK,EAAE,EAAC,YAAY;IACfC,EAAE,EAAC,YAAY;IACfC,EAAE,EAAC,UAAU;IACbC,EAAE,EAAC;EAAY,CAChB,CACA,CACF,CACF,CACA,CAAC;AAEV;AAEA,eAAevB,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MediaLibraryIcon"],"sources":["../../src/icons/index.js"],"sourcesContent":["import MediaLibraryIcon from './MediaLibraryIcon';\n\nexport { MediaLibraryIcon };\n"],"mappings":"AAAA,OAAOA,gBAAgB,MAAM,oBAAoB;AAEjD,SAASA,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["MediaLibraryIcon"],"sources":["../../src/icons/index.js"],"sourcesContent":["import MediaLibraryIcon from './MediaLibraryIcon';\n\nexport { MediaLibraryIcon };\n"],"mappings":"AAAA,OAAOA,gBAAgB,MAAM,oBAAoB;AAEjD,SAASA,gBAAgB","ignoreList":[]}
|
package/lib-es/index.js
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import FileUploadAdapter from './components/FileUploadAdapter';
|
|
3
2
|
import EditorAdapter from './components/EditorAdapter';
|
|
4
3
|
import { MediaLibraryIcon } from './icons';
|
|
5
4
|
import pkg from '../package.json';
|
|
6
5
|
import { PLUGIN_NAME } from './constants';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import FilePreviewReadOnly from './components/FilePreviewReadOnly';
|
|
7
|
+
import MediaListing from './components/MediaListing';
|
|
8
|
+
import EditMediaFilePage from './components/EditMediaFile/EditMediaFilePage';
|
|
9
|
+
|
|
10
|
+
// todo: renable lazy loading after bundler optimisations, currently they are too slow in dev mode
|
|
11
|
+
// export const FilePreviewReadOnly = React.lazy(
|
|
12
|
+
// () =>
|
|
13
|
+
// import(/* webpackChunkName: 'MediaFilePreviewReadOnly' */ './components/FilePreviewReadOnly')
|
|
14
|
+
// );
|
|
15
|
+
|
|
16
|
+
// const MediaListing = React.lazy(
|
|
17
|
+
// () => import(/* webpackChunkName: 'MediaListingContainer' */ './components/MediaListing')
|
|
18
|
+
// );
|
|
19
|
+
|
|
20
|
+
// const EditMediaFilePage = React.lazy(
|
|
21
|
+
// () =>
|
|
22
|
+
// import(
|
|
23
|
+
// /* webpackChunkName: 'EditMediaFilePage' */ './components/EditMediaFile/EditMediaFilePage'
|
|
24
|
+
// )
|
|
25
|
+
// );
|
|
10
26
|
export default async function load(app) {
|
|
11
27
|
app.events.once('admin:menu:config:load', ({
|
|
12
28
|
addConfig
|
package/lib-es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["FileUploadAdapter","EditorAdapter","MediaLibraryIcon","pkg","PLUGIN_NAME","FilePreviewReadOnly","MediaListing","EditMediaFilePage","load","app","events","once","addConfig","main","items","media","label","uri","icon","order","addFieldType","type","component","mediaRoute","path","key","exact","editMediaFileRoute","addRoute","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import FileUploadAdapter from './components/FileUploadAdapter';\nimport EditorAdapter from './components/EditorAdapter';\nimport { MediaLibraryIcon } from './icons';\nimport pkg from '../package.json';\nimport { PLUGIN_NAME } from './constants';\nimport FilePreviewReadOnly from './components/FilePreviewReadOnly';\nimport MediaListing from './components/MediaListing';\nimport EditMediaFilePage from './components/EditMediaFile/EditMediaFilePage';\n\n// todo: renable lazy loading after bundler optimisations, currently they are too slow in dev mode\n// export const FilePreviewReadOnly = React.lazy(\n// () =>\n// import(/* webpackChunkName: 'MediaFilePreviewReadOnly' */ './components/FilePreviewReadOnly')\n// );\n\n// const MediaListing = React.lazy(\n// () => import(/* webpackChunkName: 'MediaListingContainer' */ './components/MediaListing')\n// );\n\n// const EditMediaFilePage = React.lazy(\n// () =>\n// import(\n// /* webpackChunkName: 'EditMediaFilePage' */ './components/EditMediaFile/EditMediaFilePage'\n// )\n// );\nexport default async function load(app) {\n app.events.once('admin:menu:config:load', ({ addConfig }) => {\n addConfig({\n main: {\n items: {\n media: {\n label: 'Media',\n uri: '/media',\n icon: MediaLibraryIcon,\n order: 30\n }\n }\n }\n });\n });\n\n app.events.once('load:custom:field:type', addFieldType => {\n addFieldType({ type: 'fileUpload', component: FileUploadAdapter });\n addFieldType({ type: 'filePreview', component: FilePreviewReadOnly });\n addFieldType({ type: 'editor', component: EditorAdapter });\n });\n\n const mediaRoute = {\n path: '/media',\n key: 'media',\n component: MediaListing,\n exact: true\n };\n\n const editMediaFileRoute = {\n path: '/media/edit/:fileId',\n key: 'editMedia',\n component: EditMediaFilePage,\n exact: true\n };\n\n app.addRoute(mediaRoute);\n app.addRoute(editMediaFileRoute);\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}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AAMC,kBAAkB,GAAG;IACzBH,IAAI,EAAE,qBAAqB;IAC3BC,GAAG,EAAE,WAAW;IAChBH,SAAS,EAAEf,iBAAiB;IAC5BmB,KAAK,EAAE;EACT,CAAC;EAEDjB,GAAG,CAACmB,QAAQ,CAACL,UAAU,CAAC;EACxBd,GAAG,CAACmB,QAAQ,CAACD,kBAAkB,CAAC;EAEhC,OAAO;IACLE,IAAI,EAAEzB,WAAW;IACjB0B,OAAO,EAAE3B,GAAG,CAAC2B;EACf,CAAC;AACH;AAEAtB,IAAI,CAACuB,UAAU,GAAG3B,WAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"available-filters.js","names":["availableFilters","label","searchTerm","id","type","formats"],"sources":["../../../src/utils/available-filters/available-filters.js"],"sourcesContent":["const availableFilters = [\n {\n label: 'All',\n searchTerm: 'all',\n id: 'all',\n type: 'all',\n formats: [\n 'text/csv',\n 'text/plain',\n 'text/rtf',\n 'image/gif',\n 'image/jpeg',\n 'image/png',\n 'image/bmp',\n 'image/svg+xml',\n 'image/tiff',\n 'image/webp',\n 'application/pdf'\n ]\n },\n {\n label: 'Images',\n searchTerm: 'images',\n id: 'images',\n type: 'image',\n formats: [\n 'image/gif',\n 'image/jpeg',\n 'image/png',\n 'image/bmp',\n 'image/svg+xml',\n 'image/tiff',\n 'image/webp'\n ]\n },\n {\n label: 'Videos',\n searchTerm: 'videos',\n type: 'video',\n id: 'videos'\n },\n {\n label: 'Docs',\n searchTerm: 'documents',\n id: 'documents',\n type: 'text',\n formats: ['text/csv', 'text/plain', 'text/rtf', 'application/pdf']\n }\n];\n\nexport { availableFilters };\n"],"mappings":"AAAA,MAAMA,gBAAgB,GAAG,CACvB;EACEC,KAAK,EAAE,KAAK;EACZC,UAAU,EAAE,KAAK;EACjBC,EAAE,EAAE,KAAK;EACTC,IAAI,EAAE,KAAK;EACXC,OAAO,EAAE,CACP,UAAU,EACV,YAAY,EACZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,iBAAiB;AAErB,CAAC,EACD;EACEJ,KAAK,EAAE,QAAQ;EACfC,UAAU,EAAE,QAAQ;EACpBC,EAAE,EAAE,QAAQ;EACZC,IAAI,EAAE,OAAO;EACbC,OAAO,EAAE,CACP,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY;AAEhB,CAAC,EACD;EACEJ,KAAK,EAAE,QAAQ;EACfC,UAAU,EAAE,QAAQ;EACpBE,IAAI,EAAE,OAAO;EACbD,EAAE,EAAE;AACN,CAAC,EACD;EACEF,KAAK,EAAE,MAAM;EACbC,UAAU,EAAE,WAAW;EACvBC,EAAE,EAAE,WAAW;EACfC,IAAI,EAAE,MAAM;EACZC,OAAO,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB;AACnE,CAAC,CACF;AAED,SAASL,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"available-filters.js","names":["availableFilters","label","searchTerm","id","type","formats"],"sources":["../../../src/utils/available-filters/available-filters.js"],"sourcesContent":["const availableFilters = [\n {\n label: 'All',\n searchTerm: 'all',\n id: 'all',\n type: 'all',\n formats: [\n 'text/csv',\n 'text/plain',\n 'text/rtf',\n 'image/gif',\n 'image/jpeg',\n 'image/png',\n 'image/bmp',\n 'image/svg+xml',\n 'image/tiff',\n 'image/webp',\n 'application/pdf'\n ]\n },\n {\n label: 'Images',\n searchTerm: 'images',\n id: 'images',\n type: 'image',\n formats: [\n 'image/gif',\n 'image/jpeg',\n 'image/png',\n 'image/bmp',\n 'image/svg+xml',\n 'image/tiff',\n 'image/webp'\n ]\n },\n {\n label: 'Videos',\n searchTerm: 'videos',\n type: 'video',\n id: 'videos'\n },\n {\n label: 'Docs',\n searchTerm: 'documents',\n id: 'documents',\n type: 'text',\n formats: ['text/csv', 'text/plain', 'text/rtf', 'application/pdf']\n }\n];\n\nexport { availableFilters };\n"],"mappings":"AAAA,MAAMA,gBAAgB,GAAG,CACvB;EACEC,KAAK,EAAE,KAAK;EACZC,UAAU,EAAE,KAAK;EACjBC,EAAE,EAAE,KAAK;EACTC,IAAI,EAAE,KAAK;EACXC,OAAO,EAAE,CACP,UAAU,EACV,YAAY,EACZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,iBAAiB;AAErB,CAAC,EACD;EACEJ,KAAK,EAAE,QAAQ;EACfC,UAAU,EAAE,QAAQ;EACpBC,EAAE,EAAE,QAAQ;EACZC,IAAI,EAAE,OAAO;EACbC,OAAO,EAAE,CACP,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY;AAEhB,CAAC,EACD;EACEJ,KAAK,EAAE,QAAQ;EACfC,UAAU,EAAE,QAAQ;EACpBE,IAAI,EAAE,OAAO;EACbD,EAAE,EAAE;AACN,CAAC,EACD;EACEF,KAAK,EAAE,MAAM;EACbC,UAAU,EAAE,WAAW;EACvBC,EAAE,EAAE,WAAW;EACfC,IAAI,EAAE,MAAM;EACZC,OAAO,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB;AACnE,CAAC,CACF;AAED,SAASL,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bustUrl.js","names":["bustUrl","url","updated","separator","includes","version","Date","now"],"sources":["../../src/utils/bustUrl.js"],"sourcesContent":["export default function bustUrl(url, updated) {\n if (!url) return url;\n const separator = url.includes('?') ? '&' : '?';\n const version = updated || Date.now();\n return `${url}${separator}v=${version}`;\n}\n"],"mappings":"AAAA,eAAe,SAASA,OAAOA,CAACC,GAAG,EAAEC,OAAO,EAAE;EAC5C,IAAI,CAACD,GAAG,EAAE,OAAOA,GAAG;EACpB,MAAME,SAAS,GAAGF,GAAG,CAACG,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG;EAC/C,MAAMC,OAAO,GAAGH,OAAO,IAAII,IAAI,CAACC,GAAG,CAAC,CAAC;EACrC,OAAO,GAAGN,GAAG,GAAGE,SAAS,KAAKE,OAAO,EAAE;AACzC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MediaContext","MediaContextProvider","MediaContextConsumer","useMediaContext"],"sources":["../../../src/utils/media-context/index.js"],"sourcesContent":["import { MediaContext, MediaContextProvider, MediaContextConsumer } from './media-context';\nimport { useMediaContext } from './useMediaContext';\n\nexport { MediaContext, MediaContextProvider, MediaContextConsumer, useMediaContext };\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,oBAAoB,EAAEC,oBAAoB,QAAQ,iBAAiB;AAC1F,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASH,YAAY,EAAEC,oBAAoB,EAAEC,oBAAoB,EAAEC,eAAe"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["MediaContext","MediaContextProvider","MediaContextConsumer","useMediaContext"],"sources":["../../../src/utils/media-context/index.js"],"sourcesContent":["import { MediaContext, MediaContextProvider, MediaContextConsumer } from './media-context';\nimport { useMediaContext } from './useMediaContext';\n\nexport { MediaContext, MediaContextProvider, MediaContextConsumer, useMediaContext };\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,oBAAoB,EAAEC,oBAAoB,QAAQ,iBAAiB;AAC1F,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASH,YAAY,EAAEC,oBAAoB,EAAEC,oBAAoB,EAAEC,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-context.js","names":["React","MediaContext","createContext","MediaContextProvider","Provider","MediaContextConsumer","Consumer"],"sources":["../../../src/utils/media-context/media-context.js"],"sourcesContent":["import React from 'react';\n\nconst MediaContext = React.createContext({});\nconst MediaContextProvider = MediaContext.Provider;\nconst MediaContextConsumer = MediaContext.Consumer;\n\nexport { MediaContext, MediaContextProvider, MediaContextConsumer };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,YAAY,GAAGD,KAAK,CAACE,aAAa,CAAC,CAAC,CAAC,CAAC;AAC5C,MAAMC,oBAAoB,GAAGF,YAAY,CAACG,QAAQ;AAClD,MAAMC,oBAAoB,GAAGJ,YAAY,CAACK,QAAQ;AAElD,SAASL,YAAY,EAAEE,oBAAoB,EAAEE,oBAAoB"}
|
|
1
|
+
{"version":3,"file":"media-context.js","names":["React","MediaContext","createContext","MediaContextProvider","Provider","MediaContextConsumer","Consumer"],"sources":["../../../src/utils/media-context/media-context.js"],"sourcesContent":["import React from 'react';\n\nconst MediaContext = React.createContext({});\nconst MediaContextProvider = MediaContext.Provider;\nconst MediaContextConsumer = MediaContext.Consumer;\n\nexport { MediaContext, MediaContextProvider, MediaContextConsumer };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,YAAY,GAAGD,KAAK,CAACE,aAAa,CAAC,CAAC,CAAC,CAAC;AAC5C,MAAMC,oBAAoB,GAAGF,YAAY,CAACG,QAAQ;AAClD,MAAMC,oBAAoB,GAAGJ,YAAY,CAACK,QAAQ;AAElD,SAASL,YAAY,EAAEE,oBAAoB,EAAEE,oBAAoB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMediaContext.js","names":["useContext","useMediaContext","ctx"],"sources":["../../../src/utils/media-context/useMediaContext.js"],"sourcesContent":["import { useContext } from 'react';\n\nconst useMediaContext = ctx => useContext(ctx);\n\nexport { useMediaContext };\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAElC,MAAMC,eAAe,GAAGC,GAAG,IAAIF,UAAU,CAACE,GAAG,CAAC;AAE9C,SAASD,eAAe"}
|
|
1
|
+
{"version":3,"file":"useMediaContext.js","names":["useContext","useMediaContext","ctx"],"sources":["../../../src/utils/media-context/useMediaContext.js"],"sourcesContent":["import { useContext } from 'react';\n\nconst useMediaContext = ctx => useContext(ctx);\n\nexport { useMediaContext };\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAElC,MAAMC,eAAe,GAAGC,GAAG,IAAIF,UAAU,CAACE,GAAG,CAAC;AAE9C,SAASD,eAAe","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-media-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.147.0-rc-eagle.2",
|
|
4
4
|
"description": "Blaze plugin media ui",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
7
|
-
"
|
|
7
|
+
"files": [
|
|
8
|
+
"lib",
|
|
9
|
+
"lib-es",
|
|
10
|
+
"src"
|
|
11
|
+
],
|
|
12
|
+
"source": "src/index.js",
|
|
8
13
|
"directories": {
|
|
9
14
|
"src": "src/"
|
|
10
15
|
},
|
|
11
16
|
"scripts": {
|
|
12
17
|
"test": "jest",
|
|
13
|
-
"lint": "
|
|
18
|
+
"lint": "npm run lint:js",
|
|
14
19
|
"lint:js": "eslint .",
|
|
15
20
|
"clean": "rm -Rf ./lib/ && rm -Rf ./lib-es/",
|
|
16
21
|
"build:cjs": "BABEL_ENV=cjs ../../node_modules/.bin/babel ./src --out-dir ./lib --source-maps --root-mode upward",
|
|
17
22
|
"build:esm": "BABEL_ENV=esm ../../node_modules/.bin/babel ./src --out-dir ./lib-es --source-maps --root-mode upward",
|
|
18
|
-
"build": "
|
|
19
|
-
"build:clean": "
|
|
20
|
-
"prepublishOnly": "
|
|
21
|
-
"postpublish": "
|
|
23
|
+
"build": "npm run build:cjs && npm run build:esm",
|
|
24
|
+
"build:clean": "npm run clean && npm run build",
|
|
25
|
+
"prepublishOnly": "npm run build:clean",
|
|
26
|
+
"postpublish": "npm run clean"
|
|
22
27
|
},
|
|
23
28
|
"author": {
|
|
24
29
|
"email": "hello@thebyte9.com",
|
|
@@ -27,35 +32,38 @@
|
|
|
27
32
|
},
|
|
28
33
|
"license": "GPL-3.0",
|
|
29
34
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/admin-ui-utils": "0.
|
|
31
|
-
"@blaze-cms/core-errors": "0.
|
|
32
|
-
"@blaze-cms/plugin-search-ui": "0.
|
|
33
|
-
"@blaze-cms/react-form-builder": "0.
|
|
34
|
-
"@blaze-cms/setup-ui": "
|
|
35
|
+
"@blaze-cms/admin-ui-utils": "0.147.0-rc-eagle.2",
|
|
36
|
+
"@blaze-cms/core-errors": "0.147.0-rc-eagle.2",
|
|
37
|
+
"@blaze-cms/plugin-search-ui": "0.147.0-rc-eagle.2",
|
|
38
|
+
"@blaze-cms/react-form-builder": "0.147.0-rc-eagle.2",
|
|
39
|
+
"@blaze-cms/setup-ui": "0.147.0-rc-eagle.2",
|
|
35
40
|
"@blaze-react/button": "0.8.0-alpha.82",
|
|
41
|
+
"@blaze-react/dnd": "^0.7.0",
|
|
36
42
|
"@blaze-react/drafteditor": "0.7.0",
|
|
37
|
-
"@blaze-react/file-upload": "0.8.0-alpha.
|
|
43
|
+
"@blaze-react/file-upload": "0.8.0-alpha.109",
|
|
38
44
|
"@blaze-react/modal": "0.5.19",
|
|
39
45
|
"@blaze-react/more": "0.5.19",
|
|
40
|
-
"@blaze-react/
|
|
46
|
+
"@blaze-react/select": "0.8.0-alpha.100",
|
|
47
|
+
"@blaze-react/toaster": "^0.7.0",
|
|
48
|
+
"@blaze-react/tooltip": "0.8.0-alpha.100",
|
|
41
49
|
"classnames": "^2.2.6",
|
|
42
50
|
"lodash.differencewith": "^4.5.0",
|
|
43
51
|
"lodash.isequal": "^4.5.0",
|
|
44
52
|
"react-tiny-virtual-list": "2.2.0"
|
|
45
53
|
},
|
|
46
54
|
"devDependencies": {
|
|
47
|
-
"@blaze-cms/core-ui": "0.
|
|
55
|
+
"@blaze-cms/core-ui": "0.147.0-rc-eagle.2"
|
|
48
56
|
},
|
|
49
57
|
"peerDependencies": {
|
|
50
58
|
"@apollo/client": "3.x",
|
|
51
|
-
"@blaze-cms/admin": "^0.
|
|
59
|
+
"@blaze-cms/admin": "^0.145.0",
|
|
52
60
|
"prop-types": "^15.7.2",
|
|
53
|
-
"react": "
|
|
61
|
+
"react": ">= 18",
|
|
54
62
|
"react-router-dom": "^5.0.1"
|
|
55
63
|
},
|
|
56
64
|
"eslintIgnore": [
|
|
57
65
|
"lib/*",
|
|
58
66
|
"lib-es/*"
|
|
59
67
|
],
|
|
60
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "156a1560d7bc2bbd57b5b51fdf11098349bb26f5"
|
|
61
69
|
}
|
|
@@ -11,6 +11,7 @@ import Modal from '@blaze-react/modal';
|
|
|
11
11
|
import { createPortal } from 'react-dom';
|
|
12
12
|
import { Link } from 'react-router-dom';
|
|
13
13
|
import EditMediaFile from '../EditMediaFile';
|
|
14
|
+
import bustUrl from '../../utils/bustUrl';
|
|
14
15
|
|
|
15
16
|
const CardMedia = ({
|
|
16
17
|
onSelected,
|
|
@@ -21,10 +22,12 @@ const CardMedia = ({
|
|
|
21
22
|
selected,
|
|
22
23
|
displayLayout,
|
|
23
24
|
data,
|
|
25
|
+
updated,
|
|
24
26
|
modalTargetRef,
|
|
25
27
|
updateFile,
|
|
26
28
|
removeFile,
|
|
27
|
-
index
|
|
29
|
+
index,
|
|
30
|
+
openEditInModal
|
|
28
31
|
}) => {
|
|
29
32
|
const [displayDeleteModal, setDisplayDeleteModal] = useState(false);
|
|
30
33
|
const [displayEditModal, setDisplayEditModal] = useState(false);
|
|
@@ -82,7 +85,7 @@ const CardMedia = ({
|
|
|
82
85
|
modifiers: ['cancel']
|
|
83
86
|
},
|
|
84
87
|
{
|
|
85
|
-
textButton: '
|
|
88
|
+
textButton: 'Apply',
|
|
86
89
|
callback: () => handleFormSave(),
|
|
87
90
|
modifiers: enableSaveButton ? [] : ['disabled']
|
|
88
91
|
}
|
|
@@ -99,12 +102,7 @@ const CardMedia = ({
|
|
|
99
102
|
} = await client.mutate({
|
|
100
103
|
mutation: getMutation('UPDATE_FILE'),
|
|
101
104
|
variables: { input: fileData },
|
|
102
|
-
update(
|
|
103
|
-
cache,
|
|
104
|
-
{
|
|
105
|
-
data: { updateFile: fileUpdated }
|
|
106
|
-
}
|
|
107
|
-
) {
|
|
105
|
+
update(cache, { data: { updateFile: fileUpdated } }) {
|
|
108
106
|
cache.writeQuery({
|
|
109
107
|
query: getQuery('GET_FILE_BY_ID'),
|
|
110
108
|
variables: { id },
|
|
@@ -157,7 +155,7 @@ const CardMedia = ({
|
|
|
157
155
|
|
|
158
156
|
{type === 'image' ? (
|
|
159
157
|
<div className={`card__image card__image--media-${displayLayout}`}>
|
|
160
|
-
<img src={url} alt={name} />
|
|
158
|
+
<img src={bustUrl(url, updated)} alt={name} />
|
|
161
159
|
</div>
|
|
162
160
|
) : (
|
|
163
161
|
<div className="card__image card__image--media-list-document">
|
|
@@ -183,9 +181,21 @@ const CardMedia = ({
|
|
|
183
181
|
<span className="material-icons">more_vert</span>
|
|
184
182
|
</More.Avatar>
|
|
185
183
|
<More.Content isMoreMenu>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
184
|
+
{openEditInModal ? (
|
|
185
|
+
<Button
|
|
186
|
+
onClick={event => {
|
|
187
|
+
event.preventDefault();
|
|
188
|
+
event.stopPropagation();
|
|
189
|
+
setDisplayEditModal(true);
|
|
190
|
+
}}
|
|
191
|
+
className="more-menu__link">
|
|
192
|
+
Edit
|
|
193
|
+
</Button>
|
|
194
|
+
) : (
|
|
195
|
+
<Link to={`/media/edit/${id}`} className="more-menu__link">
|
|
196
|
+
Edit
|
|
197
|
+
</Link>
|
|
198
|
+
)}
|
|
189
199
|
<Button
|
|
190
200
|
onClick={event => {
|
|
191
201
|
event.preventDefault();
|
|
@@ -212,18 +222,22 @@ CardMedia.propTypes = {
|
|
|
212
222
|
mimetype: PropTypes.string.isRequired,
|
|
213
223
|
displayLayout: PropTypes.string.isRequired,
|
|
214
224
|
data: PropTypes.object,
|
|
225
|
+
updated: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
215
226
|
onSelected: PropTypes.func,
|
|
216
227
|
updateFile: PropTypes.func.isRequired,
|
|
217
228
|
removeFile: PropTypes.func.isRequired,
|
|
218
229
|
selected: PropTypes.bool,
|
|
219
230
|
modalTargetRef: PropTypes.object.isRequired,
|
|
220
|
-
index: PropTypes.number.isRequired
|
|
231
|
+
index: PropTypes.number.isRequired,
|
|
232
|
+
openEditInModal: PropTypes.bool
|
|
221
233
|
};
|
|
222
234
|
|
|
223
235
|
CardMedia.defaultProps = {
|
|
224
236
|
onSelected: () => {},
|
|
225
237
|
selected: false,
|
|
226
|
-
data: {}
|
|
238
|
+
data: {},
|
|
239
|
+
updated: null,
|
|
240
|
+
openEditInModal: false
|
|
227
241
|
};
|
|
228
242
|
|
|
229
243
|
export default CardMedia;
|