@blaze-cms/plugin-media-ui 0.146.0-node18-core-styles-tooltips.45 → 0.146.0-node18-core-styles-tooltips.46
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/CHANGELOG.md +8 -0
- package/lib-es/components/CardMedia/CardMedia.js +233 -0
- package/lib-es/components/CardMedia/CardMedia.js.map +1 -0
- package/lib-es/components/CardMedia/index.js +3 -0
- package/lib-es/components/CardMedia/index.js.map +1 -0
- package/lib-es/components/EditMediaFile/EditMediaFile.js +187 -0
- package/lib-es/components/EditMediaFile/EditMediaFile.js.map +1 -0
- package/lib-es/components/EditMediaFile/EditMediaFilePage.js +109 -0
- package/lib-es/components/EditMediaFile/EditMediaFilePage.js.map +1 -0
- package/lib-es/components/EditMediaFile/index.js +3 -0
- package/lib-es/components/EditMediaFile/index.js.map +1 -0
- package/lib-es/components/EditorAdapter/EditorAdapter.js +48 -0
- package/lib-es/components/EditorAdapter/EditorAdapter.js.map +1 -0
- package/lib-es/components/EditorAdapter/index.js +3 -0
- package/lib-es/components/EditorAdapter/index.js.map +1 -0
- package/lib-es/components/FileList/FilesListContext/index.js +4 -0
- package/lib-es/components/FileList/FilesListContext/index.js.map +1 -0
- package/lib-es/components/FileList/FilesListProvider/index.js +36 -0
- package/lib-es/components/FileList/FilesListProvider/index.js.map +1 -0
- package/lib-es/components/FileList/useFileList/index.js +5 -0
- package/lib-es/components/FileList/useFileList/index.js.map +1 -0
- package/lib-es/components/FileList/useGetFiles/getFiles.js +179 -0
- package/lib-es/components/FileList/useGetFiles/getFiles.js.map +1 -0
- package/lib-es/components/FileList/useGetFiles/index.js +3 -0
- package/lib-es/components/FileList/useGetFiles/index.js.map +1 -0
- package/lib-es/components/FileList/useGetFiles/useGetFiles.js +114 -0
- package/lib-es/components/FileList/useGetFiles/useGetFiles.js.map +1 -0
- package/lib-es/components/FileList/useGetFilesList/getCounters.js +11 -0
- package/lib-es/components/FileList/useGetFilesList/getCounters.js.map +1 -0
- package/lib-es/components/FileList/useGetFilesList/index.js +3 -0
- package/lib-es/components/FileList/useGetFilesList/index.js.map +1 -0
- package/lib-es/components/FileList/useGetFilesList/useGetFilesList.js +172 -0
- package/lib-es/components/FileList/useGetFilesList/useGetFilesList.js.map +1 -0
- package/lib-es/components/FilePreview/Actions/index.js +38 -0
- package/lib-es/components/FilePreview/Actions/index.js.map +1 -0
- package/lib-es/components/FilePreview/Image/Image.js +40 -0
- package/lib-es/components/FilePreview/Image/Image.js.map +1 -0
- package/lib-es/components/FilePreview/Image/RawImage.js +31 -0
- package/lib-es/components/FilePreview/Image/RawImage.js.map +1 -0
- package/lib-es/components/FilePreview/Image/imageSchema.js +53 -0
- package/lib-es/components/FilePreview/Image/imageSchema.js.map +1 -0
- package/lib-es/components/FilePreview/Image/index.js +12 -0
- package/lib-es/components/FilePreview/Image/index.js.map +1 -0
- 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 +49 -0
- package/lib-es/components/FilePreview/PDF/PDF.js.map +1 -0
- package/lib-es/components/FilePreview/PDF/RawPDF.js +33 -0
- package/lib-es/components/FilePreview/PDF/RawPDF.js.map +1 -0
- package/lib-es/components/FilePreview/PDF/index.js +12 -0
- package/lib-es/components/FilePreview/PDF/index.js.map +1 -0
- package/lib-es/components/FilePreview/PDF/schema.js +21 -0
- package/lib-es/components/FilePreview/PDF/schema.js.map +1 -0
- package/lib-es/components/FilePreview/get-preview.js +28 -0
- package/lib-es/components/FilePreview/get-preview.js.map +1 -0
- package/lib-es/components/FilePreview/index.js +104 -0
- package/lib-es/components/FilePreview/index.js.map +1 -0
- package/lib-es/components/FilePreview/previewDefault/PreviewDefault.js +41 -0
- package/lib-es/components/FilePreview/previewDefault/PreviewDefault.js.map +1 -0
- package/lib-es/components/FilePreview/previewDefault/RawPreviewDefault.js +39 -0
- package/lib-es/components/FilePreview/previewDefault/RawPreviewDefault.js.map +1 -0
- package/lib-es/components/FilePreview/previewDefault/icons/DefaultIcon.js +121 -0
- package/lib-es/components/FilePreview/previewDefault/icons/DefaultIcon.js.map +1 -0
- package/lib-es/components/FilePreview/previewDefault/icons/index.js +3 -0
- package/lib-es/components/FilePreview/previewDefault/icons/index.js.map +1 -0
- package/lib-es/components/FilePreview/previewDefault/index.js +12 -0
- package/lib-es/components/FilePreview/previewDefault/index.js.map +1 -0
- package/lib-es/components/FilePreview/previewDefault/previewDefaultSchema.js +25 -0
- package/lib-es/components/FilePreview/previewDefault/previewDefaultSchema.js.map +1 -0
- package/lib-es/components/FilePreviewReadOnly/FileList.js +18 -0
- package/lib-es/components/FilePreviewReadOnly/FileList.js.map +1 -0
- package/lib-es/components/FilePreviewReadOnly/FilePreviewList.js +22 -0
- package/lib-es/components/FilePreviewReadOnly/FilePreviewList.js.map +1 -0
- package/lib-es/components/FilePreviewReadOnly/FilePreviewReadOnly.js +68 -0
- package/lib-es/components/FilePreviewReadOnly/FilePreviewReadOnly.js.map +1 -0
- package/lib-es/components/FilePreviewReadOnly/index.js +3 -0
- package/lib-es/components/FilePreviewReadOnly/index.js.map +1 -0
- package/lib-es/components/FilePreviewReadOnly/mappers/format-initial-value.js +11 -0
- package/lib-es/components/FilePreviewReadOnly/mappers/format-initial-value.js.map +1 -0
- package/lib-es/components/FilePreviewReadOnly/mappers/index.js +3 -0
- package/lib-es/components/FilePreviewReadOnly/mappers/index.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/FileList.js +52 -0
- package/lib-es/components/FileUploadAdapter/FileList.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/FilePreviewList.js +22 -0
- package/lib-es/components/FileUploadAdapter/FilePreviewList.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/FileReorderList.js +32 -0
- package/lib-es/components/FileUploadAdapter/FileReorderList.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/FileReorderListItem.js +24 -0
- package/lib-es/components/FileUploadAdapter/FileReorderListItem.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/FileUploadAdapter.js +391 -0
- package/lib-es/components/FileUploadAdapter/FileUploadAdapter.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/index.js +3 -0
- package/lib-es/components/FileUploadAdapter/index.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/mappers/format-initial-value.js +11 -0
- package/lib-es/components/FileUploadAdapter/mappers/format-initial-value.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/mappers/get-button-text.js +11 -0
- package/lib-es/components/FileUploadAdapter/mappers/get-button-text.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/mappers/get-format.js +12 -0
- package/lib-es/components/FileUploadAdapter/mappers/get-format.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js +7 -0
- package/lib-es/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/mappers/index.js +8 -0
- package/lib-es/components/FileUploadAdapter/mappers/index.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/mappers/is-unselecting.js +2 -0
- package/lib-es/components/FileUploadAdapter/mappers/is-unselecting.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/mappers/transform-to-array.js +2 -0
- package/lib-es/components/FileUploadAdapter/mappers/transform-to-array.js.map +1 -0
- package/lib-es/components/FileUploadAdapter/useLimit.js +13 -0
- package/lib-es/components/FileUploadAdapter/useLimit.js.map +1 -0
- package/lib-es/components/FileUploadModal/FileUploadModal.js +178 -0
- package/lib-es/components/FileUploadModal/FileUploadModal.js.map +1 -0
- package/lib-es/components/FileUploadModal/index.js +3 -0
- package/lib-es/components/FileUploadModal/index.js.map +1 -0
- package/lib-es/components/FilterPanel/FilterPanel.js +135 -0
- package/lib-es/components/FilterPanel/FilterPanel.js.map +1 -0
- package/lib-es/components/FilterPanel/index.js +3 -0
- package/lib-es/components/FilterPanel/index.js.map +1 -0
- package/lib-es/components/ListingContainer/Listing/Listing.js +70 -0
- package/lib-es/components/ListingContainer/Listing/Listing.js.map +1 -0
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +153 -0
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js.map +1 -0
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/index.js +3 -0
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/index.js.map +1 -0
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaListing.js +33 -0
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaListing.js.map +1 -0
- package/lib-es/components/ListingContainer/Listing/MediaListing/index.js +3 -0
- package/lib-es/components/ListingContainer/Listing/MediaListing/index.js.map +1 -0
- package/lib-es/components/ListingContainer/Listing/index.js +3 -0
- package/lib-es/components/ListingContainer/Listing/index.js.map +1 -0
- package/lib-es/components/ListingContainer/ListingContainer.js +115 -0
- package/lib-es/components/ListingContainer/ListingContainer.js.map +1 -0
- package/lib-es/components/ListingContainer/index.js +3 -0
- package/lib-es/components/ListingContainer/index.js.map +1 -0
- package/lib-es/components/ListingContainer/mappers/exist-previous.js +3 -0
- package/lib-es/components/ListingContainer/mappers/exist-previous.js.map +1 -0
- package/lib-es/components/ListingContainer/mappers/index.js +3 -0
- package/lib-es/components/ListingContainer/mappers/index.js.map +1 -0
- package/lib-es/components/MediaListing.js +29 -0
- package/lib-es/components/MediaListing.js.map +1 -0
- package/lib-es/constants.js +36 -0
- package/lib-es/constants.js.map +1 -0
- package/lib-es/icons/MediaLibraryIcon.js +70 -0
- package/lib-es/icons/MediaLibraryIcon.js.map +1 -0
- package/lib-es/icons/index.js +3 -0
- package/lib-es/icons/index.js.map +1 -0
- package/lib-es/index.js +61 -0
- package/lib-es/index.js.map +1 -0
- package/lib-es/utils/available-filters/available-filters.js +26 -0
- package/lib-es/utils/available-filters/available-filters.js.map +1 -0
- 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 +4 -0
- package/lib-es/utils/media-context/index.js.map +1 -0
- package/lib-es/utils/media-context/media-context.js +6 -0
- package/lib-es/utils/media-context/media-context.js.map +1 -0
- package/lib-es/utils/media-context/useMediaContext.js +4 -0
- package/lib-es/utils/media-context/useMediaContext.js.map +1 -0
- package/package.json +9 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGetFilesList.js","names":["useState","useEffect","differenceWith","isEqual","useGetFiles","useGetFilesList","queryParams","previousFilter","previousSearchTerm","loading","data","files","results","all","image","video","text","setParams","currentResults","setCurrentResults","allResults","setAllResults","currentFilter","setCurrentFilter","allFilesCounter","setAllFilesCounter","counters","setCounters","total","isContentDifferent","length","shouldSetContentIfListIsVoid","removeFile","index","resultsToUpdate","splice","currentFileType","type","updatedFileTypeCounterValue","updateAllFilesCounter","isSearch","_objectSpread","updatedCounters","updateFile","file","addNewFile","newFiles","_image","_video","_text","reduce","acc","searchTerm","clearList","params","offset","setQueryParams","isNewSearchTerm","hasDeletedSearchTerm","newFilter","JSON","stringify","where","isNewFilter","shouldClearList","parsedQueryParams","formatCounterNumber","images","videos","documents","n"],"sources":["../../../../src/components/FileList/useGetFilesList/useGetFilesList.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport differenceWith from 'lodash.differencewith';\nimport isEqual from 'lodash.isequal';\nimport useGetFiles from '../useGetFiles';\n\nfunction useGetFilesList() {\n const [\n {\n queryParams,\n previousFilter,\n previousSearchTerm,\n loading,\n data: { files: results, all, image, video, text }\n },\n setParams\n ] = useGetFiles();\n const [currentResults, setCurrentResults] = useState([]);\n const [allResults, setAllResults] = useState([]);\n const [currentFilter, setCurrentFilter] = useState(null);\n const [allFilesCounter, setAllFilesCounter] = useState({ all: 0, text: 0, image: 0, video: 0 });\n const [counters, setCounters] = useState(null);\n\n useEffect(() => {\n if (all && image && video && text) {\n setCounters({\n all: all.total,\n image: image.total,\n video: video.total,\n text: text.total\n });\n }\n }, [all, image, video, text]);\n\n useEffect(\n () => {\n if (!currentFilter && previousFilter) {\n setCurrentFilter(previousFilter);\n }\n\n if (currentFilter !== previousFilter) {\n setAllResults([]);\n setCurrentResults([]);\n return;\n }\n\n const isContentDifferent = !!differenceWith(results, currentResults, isEqual).length;\n if (isContentDifferent) {\n setAllResults([...allResults, ...results]);\n setCurrentResults(results);\n }\n\n const shouldSetContentIfListIsVoid =\n !isContentDifferent && !allResults.length && results.length;\n\n if (shouldSetContentIfListIsVoid) {\n setAllResults(results);\n setCurrentResults(results);\n }\n },\n [currentFilter, currentResults, currentResults.length, previousFilter, results] //eslint-disable-line\n );\n\n const removeFile = ({ index }) => {\n const resultsToUpdate = [...allResults];\n resultsToUpdate.splice(index, 1);\n const currentFileType = resultsToUpdate[index].type;\n const updatedFileTypeCounterValue = allFilesCounter[currentFileType] - 1;\n const updateAllFilesCounter = allFilesCounter.all - 1;\n if (queryParams.isSearch) {\n setCounters({\n ...counters,\n [currentFileType]: counters[currentFileType] - 1,\n all: counters.all - 1\n });\n setAllFilesCounter({\n ...allFilesCounter,\n [currentFileType]: updatedFileTypeCounterValue,\n all: updateAllFilesCounter\n });\n }\n\n if (!queryParams.isSearch) {\n const updatedCounters = {\n ...allFilesCounter,\n [currentFileType]: updatedFileTypeCounterValue,\n all: updateAllFilesCounter\n };\n\n setCounters(updatedCounters);\n setAllFilesCounter(updatedCounters);\n }\n setAllResults(resultsToUpdate);\n };\n\n const updateFile = ({ file, index }) => {\n const resultsToUpdate = [...allResults];\n resultsToUpdate[index] = file;\n setAllResults(resultsToUpdate);\n };\n\n const addNewFile = newFiles => {\n const {\n image: _image,\n video: _video,\n text: _text\n } = newFiles.reduce(\n (acc, { type }) => {\n acc[type] += 1;\n return acc;\n },\n { image: 0, video: 0, text: 0 }\n );\n\n if (queryParams.isSearch) {\n setAllResults([]);\n setParams({ queryParams, isSearch: false, searchTerm: null });\n }\n\n const updatedCounters = {\n all: allFilesCounter.all + _image + _video + _text,\n image: allFilesCounter.image + _image,\n video: allFilesCounter.video + _video,\n text: allFilesCounter.text + _text\n };\n\n setCounters(updatedCounters);\n setAllFilesCounter(updatedCounters);\n setAllResults([...newFiles, ...allResults]);\n };\n\n const clearList = params => {\n setAllResults([]);\n setParams({ ...params, offset: 0 });\n setCounters(allFilesCounter);\n };\n\n const setQueryParams = params => {\n const isNewSearchTerm = params.isSearch && previousSearchTerm !== params.searchTerm;\n const hasDeletedSearchTerm = previousSearchTerm && params.searchTerm === null;\n const newFilter = JSON.stringify(params.where);\n const isNewFilter = newFilter !== previousFilter;\n const shouldClearList = hasDeletedSearchTerm || isNewFilter || isNewSearchTerm;\n shouldClearList ? clearList(params) : setParams(params);\n setCurrentFilter(newFilter);\n };\n\n const parsedQueryParams = {\n ...queryParams,\n where: { ...queryParams.where }\n };\n\n if (parsedQueryParams.where.type === 'all') delete parsedQueryParams.where.type;\n\n return [\n {\n queryParams: parsedQueryParams,\n loading,\n data: {\n files: allResults,\n all: counters ? formatCounterNumber(counters.all) : 0,\n images: counters ? formatCounterNumber(counters.image) : 0,\n videos: counters ? formatCounterNumber(counters.video) : 0,\n documents: counters ? formatCounterNumber(counters.text) : 0\n }\n },\n { setQueryParams, clearList, removeFile, addNewFile, updateFile }\n ];\n}\n\nconst formatCounterNumber = n => (n === 10000 ? '10000+' : n);\n\nexport default useGetFilesList;\n"],"mappings":";;;AAAA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC3C,OAAOC,cAAc,MAAM,uBAAuB;AAClD,OAAOC,OAAO,MAAM,gBAAgB;AACpC,OAAOC,WAAW,MAAM,gBAAgB;AAExC,SAASC,eAAeA,CAAA,EAAG;EACzB,MAAM,CACJ;IACEC,WAAW;IACXC,cAAc;IACdC,kBAAkB;IAClBC,OAAO;IACPC,IAAI,EAAE;MAAEC,KAAK,EAAEC,OAAO;MAAEC,GAAG;MAAEC,KAAK;MAAEC,KAAK;MAAEC;IAAK;EAClD,CAAC,EACDC,SAAS,CACV,GAAGb,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C,KAAK,EAAES,UAAU;MACjBP,GAAG,EAAEa,QAAQ,GAAGwC,mBAAmB,CAACxC,QAAQ,CAACb,GAAG,CAAC,GAAG,CAAC;MACrDsD,MAAM,EAAEzC,QAAQ,GAAGwC,mBAAmB,CAACxC,QAAQ,CAACZ,KAAK,CAAC,GAAG,CAAC;MAC1DsD,MAAM,EAAE1C,QAAQ,GAAGwC,mBAAmB,CAACxC,QAAQ,CAACX,KAAK,CAAC,GAAG,CAAC;MAC1DsD,SAAS,EAAE3C,QAAQ,GAAGwC,mBAAmB,CAACxC,QAAQ,CAACV,IAAI,CAAC,GAAG;IAC7D;EACF,CAAC,EACD;IAAEwC,cAAc;IAAEH,SAAS;IAAErB,UAAU;IAAEa,UAAU;IAAEF;EAAW,CAAC,CAClE;AACH;AAEA,MAAMuB,mBAAmB,GAAGI,CAAC,IAAKA,CAAC,KAAK,KAAK,GAAG,QAAQ,GAAGA,CAAE;AAE7D,eAAejE,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { MediaContext } from '../../../utils/media-context';
|
|
4
|
+
const Actions = ({
|
|
5
|
+
file
|
|
6
|
+
}) => {
|
|
7
|
+
const {
|
|
8
|
+
handleEditModal,
|
|
9
|
+
onUnselectFile
|
|
10
|
+
} = useContext(MediaContext);
|
|
11
|
+
const [, extension] = file.mimetype.split('/');
|
|
12
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: "FilePreviewItem__info__actions"
|
|
14
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: "FilePreviewItem__info__actions FilePreviewItem__info__actions--media-type"
|
|
16
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
17
|
+
className: "FilePreviewItem__info__actionsIcon material-icons"
|
|
18
|
+
}, "insert_photo"), ' ', /*#__PURE__*/React.createElement("span", null, extension)), /*#__PURE__*/React.createElement("div", null, handleEditModal && /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
"data-testid": `open-media-library-${file.id}`,
|
|
20
|
+
className: "FilePreviewItem__info__actionsIcon material-icons edit",
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
onClick: () => handleEditModal(file)
|
|
23
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
24
|
+
className: "fas fa-pen fa-xs"
|
|
25
|
+
})), onUnselectFile && /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
"data-testid": `unselect-${file.id}`,
|
|
27
|
+
className: "FilePreviewItem__info__actionsIcon material-icons delete",
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
onClick: () => onUnselectFile([file.id])
|
|
30
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
31
|
+
className: "fas fa-trash fa-xs"
|
|
32
|
+
}))));
|
|
33
|
+
};
|
|
34
|
+
Actions.propTypes = {
|
|
35
|
+
file: PropTypes.object.isRequired
|
|
36
|
+
};
|
|
37
|
+
export default Actions;
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useContext","PropTypes","MediaContext","Actions","file","handleEditModal","onUnselectFile","extension","mimetype","split","createElement","className","id","onClick","propTypes","object","isRequired"],"sources":["../../../../src/components/FilePreview/Actions/index.js"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { MediaContext } from '../../../utils/media-context';\n\nconst Actions = ({ file }) => {\n const { handleEditModal, onUnselectFile } = useContext(MediaContext);\n const [, extension] = file.mimetype.split('/');\n\n return (\n <div className=\"FilePreviewItem__info__actions\">\n <div className=\"FilePreviewItem__info__actions FilePreviewItem__info__actions--media-type\">\n <i className=\"FilePreviewItem__info__actionsIcon material-icons\">insert_photo</i>{' '}\n <span>{extension}</span>\n </div>\n <div>\n {handleEditModal && (\n <div\n data-testid={`open-media-library-${file.id}`}\n className=\"FilePreviewItem__info__actionsIcon material-icons edit\"\n aria-hidden=\"true\"\n onClick={() => handleEditModal(file)}>\n <i className=\"fas fa-pen fa-xs\" />\n </div>\n )}\n {onUnselectFile && (\n <div\n data-testid={`unselect-${file.id}`}\n className=\"FilePreviewItem__info__actionsIcon material-icons delete\"\n aria-hidden=\"true\"\n onClick={() => onUnselectFile([file.id])}>\n <i className=\"fas fa-trash fa-xs\" />\n </div>\n )}\n </div>\n </div>\n );\n};\n\nActions.propTypes = {\n file: PropTypes.object.isRequired\n};\n\nexport default Actions;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,YAAY,QAAQ,8BAA8B;AAE3D,MAAMC,OAAO,GAAGA,CAAC;EAAEC;AAAK,CAAC,KAAK;EAC5B,MAAM;IAAEC,eAAe;IAAEC;EAAe,CAAC,GAAGN,UAAU,CAACE,YAAY,CAAC;EACpE,MAAM,GAAGK,SAAS,CAAC,GAAGH,IAAI,CAACI,QAAQ,CAACC,KAAK,CAAC,GAAG,CAAC;EAE9C,oBACEV,KAAA,CAAAW,aAAA;IAAKC,SAAS,EAAC;EAAgC,gBAC7CZ,KAAA,CAAAW,aAAA;IAAKC,SAAS,EAAC;EAA2E,gBACxFZ,KAAA,CAAAW,aAAA;IAAGC,SAAS,EAAC;EAAmD,GAAC,cAAe,CAAC,EAAC,GAAG,eACrFZ,KAAA,CAAAW,aAAA,eAAOH,SAAgB,CACpB,CAAC,eACNR,KAAA,CAAAW,aAAA,cACGL,eAAe,iBACdN,KAAA,CAAAW,aAAA;IACE,eAAa,sBAAsBN,IAAI,CAACQ,EAAE,EAAG;IAC7CD,SAAS,EAAC,wDAAwD;IAClE,eAAY,MAAM;IAClBE,OAAO,EAAEA,CAAA,KAAMR,eAAe,CAACD,IAAI;EAAE,gBACrCL,KAAA,CAAAW,aAAA;IAAGC,SAAS,EAAC;EAAkB,CAAE,CAC9B,CACN,EACAL,cAAc,iBACbP,KAAA,CAAAW,aAAA;IACE,eAAa,YAAYN,IAAI,CAACQ,EAAE,EAAG;IACnCD,SAAS,EAAC,0DAA0D;IACpE,eAAY,MAAM;IAClBE,OAAO,EAAEA,CAAA,KAAMP,cAAc,CAAC,CAACF,IAAI,CAACQ,EAAE,CAAC;EAAE,gBACzCb,KAAA,CAAAW,aAAA;IAAGC,SAAS,EAAC;EAAoB,CAAE,CAChC,CAEJ,CACF,CAAC;AAEV,CAAC;AAEDR,OAAO,CAACW,SAAS,GAAG;EAClBV,IAAI,EAAEH,SAAS,CAACc,MAAM,CAACC;AACzB,CAAC;AAED,eAAeb,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Button from '@blaze-react/button';
|
|
4
|
+
const Image = ({
|
|
5
|
+
url,
|
|
6
|
+
name,
|
|
7
|
+
children,
|
|
8
|
+
handleChangeFile,
|
|
9
|
+
showChangeButton
|
|
10
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: "preview"
|
|
12
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: "preview__file preview__file--image"
|
|
14
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
15
|
+
src: url,
|
|
16
|
+
alt: name
|
|
17
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: "preview__details preview__details--file"
|
|
19
|
+
}, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("strong", null, "File details"), /*#__PURE__*/React.createElement("a", {
|
|
20
|
+
href: url,
|
|
21
|
+
rel: "noopener noreferrer",
|
|
22
|
+
target: "_blank"
|
|
23
|
+
}, "Original")), showChangeButton && /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: "preview__change-button"
|
|
25
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
26
|
+
onClick: handleChangeFile
|
|
27
|
+
}, "Change file")))), children);
|
|
28
|
+
Image.propTypes = {
|
|
29
|
+
url: PropTypes.string.isRequired,
|
|
30
|
+
name: PropTypes.string.isRequired,
|
|
31
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
|
32
|
+
handleChangeFile: PropTypes.func,
|
|
33
|
+
showChangeButton: PropTypes.bool
|
|
34
|
+
};
|
|
35
|
+
Image.defaultProps = {
|
|
36
|
+
handleChangeFile: () => {},
|
|
37
|
+
showChangeButton: false
|
|
38
|
+
};
|
|
39
|
+
export { Image };
|
|
40
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.js","names":["React","PropTypes","Button","Image","url","name","children","handleChangeFile","showChangeButton","createElement","className","src","alt","href","rel","target","onClick","propTypes","string","isRequired","oneOfType","arrayOf","node","func","bool","defaultProps"],"sources":["../../../../src/components/FilePreview/Image/Image.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '@blaze-react/button';\n\nconst Image = ({ url, name, children, handleChangeFile, showChangeButton }) => (\n <div className=\"preview\">\n <div className=\"preview__file preview__file--image\">\n <img src={url} alt={name} />\n <div className=\"preview__details preview__details--file\">\n <p>\n <strong>File details</strong>\n <a href={url} rel=\"noopener noreferrer\" target=\"_blank\">\n Original\n </a>\n </p>\n {showChangeButton && (\n <div className=\"preview__change-button\">\n <Button onClick={handleChangeFile}>Change file</Button>\n </div>\n )}\n </div>\n </div>\n {children}\n </div>\n);\n\nImage.propTypes = {\n url: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,\n handleChangeFile: PropTypes.func,\n showChangeButton: PropTypes.bool\n};\n\nImage.defaultProps = {\n handleChangeFile: () => {},\n showChangeButton: false\n};\n\nexport { Image };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAA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AA,KAAM,CAAC,CAAC;EAC1BC,gBAAgB,EAAE;AACpB,CAAC;AAED,SAASL,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Actions from '../Actions';
|
|
4
|
+
const RawImage = ({
|
|
5
|
+
url,
|
|
6
|
+
name,
|
|
7
|
+
file
|
|
8
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: "FilePreview"
|
|
10
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: "FilePreviewItem"
|
|
12
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: "FilePreviewItem__wrapper"
|
|
14
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
15
|
+
className: "FilePreviewItem__wrapper__image",
|
|
16
|
+
src: url,
|
|
17
|
+
alt: name
|
|
18
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
className: "FilePreviewItem__info"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
21
|
+
className: "FilePreviewItem__info__fileName"
|
|
22
|
+
}, name), /*#__PURE__*/React.createElement(Actions, {
|
|
23
|
+
file: file
|
|
24
|
+
}))));
|
|
25
|
+
RawImage.propTypes = {
|
|
26
|
+
url: PropTypes.string.isRequired,
|
|
27
|
+
name: PropTypes.string.isRequired,
|
|
28
|
+
file: PropTypes.object.isRequired
|
|
29
|
+
};
|
|
30
|
+
export { RawImage };
|
|
31
|
+
//# sourceMappingURL=RawImage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RawImage.js","names":["React","PropTypes","Actions","RawImage","url","name","file","createElement","className","src","alt","propTypes","string","isRequired","object"],"sources":["../../../../src/components/FilePreview/Image/RawImage.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Actions from '../Actions';\n\nconst RawImage = ({ url, name, file }) => (\n <div className=\"FilePreview\">\n <div className=\"FilePreviewItem\">\n <div className=\"FilePreviewItem__wrapper\">\n <img className=\"FilePreviewItem__wrapper__image\" src={url} alt={name} />\n </div>\n <div className=\"FilePreviewItem__info\">\n <p className=\"FilePreviewItem__info__fileName\">{name}</p>\n <Actions file={file} />\n </div>\n </div>\n </div>\n);\n\nRawImage.propTypes = {\n url: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n file: PropTypes.object.isRequired\n};\n\nexport { RawImage };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,YAAY;AAEhC,MAAMC,QAAQ,GAAGA,CAAC;EAAEC,GAAG;EAAEC,IAAI;EAAEC;AAAK,CAAC,kBACnCN,KAAA,CAAAO,aAAA;EAAKC,SAAS,EAAC;AAAa,gBAC1BR,KAAA,CAAAO,aAAA;EAAKC,SAAS,EAAC;AAAiB,gBAC9BR,KAAA,CAAAO,aAAA;EAAKC,SAAS,EAAC;AAA0B,gBACvCR,KAAA,CAAAO,aAAA;EAAKC,SAAS,EAAC,iCAAiC;EAACC,GAAG,EAAEL,GAAI;EAACM,GAAG,EAAEL;AAAK,CAAE,CACpE,CAAC,eACNL,KAAA,CAAAO,aAAA;EAAKC,SAAS,EAAC;AAAuB,gBACpCR,KAAA,CAAAO,aAAA;EAAGC,SAAS,EAAC;AAAiC,GAAEH,IAAQ,CAAC,eACzDL,KAAA,CAAAO,aAAA,CAACL,OAAO;EAACI,IAAI,EAAEA;AAAK,CAAE,CACnB,CACF,CACF,CACN;AAEDH,QAAQ,CAACQ,SAAS,GAAG;EACnBP,GAAG,EAAEH,SAAS,CAACW,MAAM,CAACC,UAAU;EAChCR,IAAI,EAAEJ,SAAS,CAACW,MAAM,CAACC,UAAU;EACjCP,IAAI,EAAEL,SAAS,CAACa,MAAM,CAACD;AACzB,CAAC;AAED,SAASV,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const imageSchema = {
|
|
2
|
+
settings: {},
|
|
3
|
+
formSchema: {
|
|
4
|
+
properties: {
|
|
5
|
+
name: {
|
|
6
|
+
type: 'string',
|
|
7
|
+
showInForm: true,
|
|
8
|
+
label: 'File name',
|
|
9
|
+
formFieldType: 'text',
|
|
10
|
+
formPriority: 1.0
|
|
11
|
+
},
|
|
12
|
+
storeKey: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
showInForm: true,
|
|
15
|
+
label: 'Store type',
|
|
16
|
+
formFieldType: 'select',
|
|
17
|
+
formPriority: 2.0,
|
|
18
|
+
description: 'Please select store type',
|
|
19
|
+
options: []
|
|
20
|
+
},
|
|
21
|
+
altText: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
showInForm: true,
|
|
24
|
+
label: 'Alt text',
|
|
25
|
+
formFieldType: 'text',
|
|
26
|
+
formPriority: 3.0
|
|
27
|
+
},
|
|
28
|
+
caption: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
showInForm: true,
|
|
31
|
+
formFieldType: 'text',
|
|
32
|
+
formPriority: 4.0
|
|
33
|
+
},
|
|
34
|
+
credits: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
showInForm: true,
|
|
37
|
+
formFieldType: 'text',
|
|
38
|
+
formPriority: 5.0
|
|
39
|
+
},
|
|
40
|
+
hrefUrl: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
format: 'uri-template',
|
|
43
|
+
label: 'Image hyperlink',
|
|
44
|
+
showInForm: true,
|
|
45
|
+
formFieldType: 'text',
|
|
46
|
+
description: 'Url format is not valid'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
required: ['name']
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
export { imageSchema };
|
|
53
|
+
//# sourceMappingURL=imageSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageSchema.js","names":["imageSchema","settings","formSchema","properties","name","type","showInForm","label","formFieldType","formPriority","storeKey","description","options","altText","caption","credits","hrefUrl","format","required"],"sources":["../../../../src/components/FilePreview/Image/imageSchema.js"],"sourcesContent":["const imageSchema = {\n settings: {},\n formSchema: {\n properties: {\n name: {\n type: 'string',\n showInForm: true,\n label: 'File name',\n formFieldType: 'text',\n formPriority: 1.0\n },\n storeKey: {\n type: 'string',\n showInForm: true,\n label: 'Store type',\n formFieldType: 'select',\n formPriority: 2.0,\n description: 'Please select store type',\n options: []\n },\n altText: {\n type: 'string',\n showInForm: true,\n label: 'Alt text',\n formFieldType: 'text',\n formPriority: 3.0\n },\n caption: {\n type: 'string',\n showInForm: true,\n formFieldType: 'text',\n formPriority: 4.0\n },\n credits: {\n type: 'string',\n showInForm: true,\n formFieldType: 'text',\n formPriority: 5.0\n },\n hrefUrl: {\n type: 'string',\n format: 'uri-template',\n label: 'Image hyperlink',\n showInForm: true,\n formFieldType: 'text',\n description: 'Url format is not valid'\n }\n },\n required: ['name']\n }\n};\n\nexport { imageSchema };\n"],"mappings":"AAAA,MAAMA,WAAW,GAAG;EAClBC,QAAQ,EAAE,CAAC,CAAC;EACZC,UAAU,EAAE;IACVC,UAAU,EAAE;MACVC,IAAI,EAAE;QACJC,IAAI,EAAE,QAAQ;QACdC,UAAU,EAAE,IAAI;QAChBC,KAAK,EAAE,WAAW;QAClBC,aAAa,EAAE,MAAM;QACrBC,YAAY,EAAE;MAChB,CAAC;MACDC,QAAQ,EAAE;QACRL,IAAI,EAAE,QAAQ;QACdC,UAAU,EAAE,IAAI;QAChBC,KAAK,EAAE,YAAY;QACnBC,aAAa,EAAE,QAAQ;QACvBC,YAAY,EAAE,GAAG;QACjBE,WAAW,EAAE,0BAA0B;QACvCC,OAAO,EAAE;MACX,CAAC;MACDC,OAAO,EAAE;QACPR,IAAI,EAAE,QAAQ;QACdC,UAAU,EAAE,IAAI;QAChBC,KAAK,EAAE,UAAU;QACjBC,aAAa,EAAE,MAAM;QACrBC,YAAY,EAAE;MAChB,CAAC;MACDK,OAAO,EAAE;QACPT,IAAI,EAAE,QAAQ;QACdC,UAAU,EAAE,IAAI;QAChBE,aAAa,EAAE,MAAM;QACrBC,YAAY,EAAE;MAChB,CAAC;MACDM,OAAO,EAAE;QACPV,IAAI,EAAE,QAAQ;QACdC,UAAU,EAAE,IAAI;QAChBE,aAAa,EAAE,MAAM;QACrBC,YAAY,EAAE;MAChB,CAAC;MACDO,OAAO,EAAE;QACPX,IAAI,EAAE,QAAQ;QACdY,MAAM,EAAE,cAAc;QACtBV,KAAK,EAAE,iBAAiB;QACxBD,UAAU,EAAE,IAAI;QAChBE,aAAa,EAAE,MAAM;QACrBG,WAAW,EAAE;MACf;IACF,CAAC;IACDO,QAAQ,EAAE,CAAC,MAAM;EACnB;AACF,CAAC;AAED,SAASlB,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RawImage } from './RawImage';
|
|
2
|
+
import { Image } from './Image';
|
|
3
|
+
import { imageSchema } from './imageSchema';
|
|
4
|
+
const image = {
|
|
5
|
+
component: {
|
|
6
|
+
card: Image,
|
|
7
|
+
raw: RawImage
|
|
8
|
+
},
|
|
9
|
+
schema: imageSchema
|
|
10
|
+
};
|
|
11
|
+
export { image };
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["RawImage","Image","imageSchema","image","component","card","raw","schema"],"sources":["../../../../src/components/FilePreview/Image/index.js"],"sourcesContent":["import { RawImage } from './RawImage';\nimport { Image } from './Image';\nimport { imageSchema } from './imageSchema';\n\nconst image = {\n component: {\n card: Image,\n raw: RawImage\n },\n schema: imageSchema\n};\nexport { image };\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAASC,KAAK,QAAQ,SAAS;AAC/B,SAASC,WAAW,QAAQ,eAAe;AAE3C,MAAMC,KAAK,GAAG;EACZC,SAAS,EAAE;IACTC,IAAI,EAAEJ,KAAK;IACXK,GAAG,EAAEN;EACP,CAAC;EACDO,MAAM,EAAEL;AACV,CAAC;AACD,SAASC,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalContext.js","names":["createContext","ModalContext"],"sources":["../../../src/components/FilePreview/ModalContext.js"],"sourcesContent":["import { createContext } from 'react';\n\nexport const ModalContext = createContext(false);\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,OAAO;AAErC,OAAO,MAAMC,YAAY,GAAGD,aAAa,CAAC,KAAK,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Button from '@blaze-react/button';
|
|
4
|
+
const PDF = ({
|
|
5
|
+
mimetype,
|
|
6
|
+
url,
|
|
7
|
+
name,
|
|
8
|
+
children,
|
|
9
|
+
handleChangeFile,
|
|
10
|
+
showChangeButton
|
|
11
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: "preview",
|
|
13
|
+
key: `pdf-${url}`
|
|
14
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: "preview__file preview__file--pdf"
|
|
16
|
+
}, /*#__PURE__*/React.createElement("object", {
|
|
17
|
+
key: url,
|
|
18
|
+
data: url,
|
|
19
|
+
type: mimetype,
|
|
20
|
+
className: "preview__file--pdf"
|
|
21
|
+
}, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
|
|
22
|
+
href: url,
|
|
23
|
+
rel: "noopener noreferrer",
|
|
24
|
+
target: "_blank"
|
|
25
|
+
}, "Download ", name))), /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: "preview__details preview__details--file"
|
|
27
|
+
}, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("strong", null, "File details"), /*#__PURE__*/React.createElement("a", {
|
|
28
|
+
href: url,
|
|
29
|
+
rel: "noopener noreferrer",
|
|
30
|
+
target: "_blank"
|
|
31
|
+
}, "Original")), showChangeButton && /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
className: "preview__change-button"
|
|
33
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
34
|
+
onClick: handleChangeFile
|
|
35
|
+
}, "Change file")))), children);
|
|
36
|
+
PDF.propTypes = {
|
|
37
|
+
mimetype: PropTypes.string.isRequired,
|
|
38
|
+
url: PropTypes.string.isRequired,
|
|
39
|
+
name: PropTypes.string.isRequired,
|
|
40
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
|
41
|
+
handleChangeFile: PropTypes.func,
|
|
42
|
+
showChangeButton: PropTypes.bool
|
|
43
|
+
};
|
|
44
|
+
PDF.defaultProps = {
|
|
45
|
+
handleChangeFile: () => {},
|
|
46
|
+
showChangeButton: false
|
|
47
|
+
};
|
|
48
|
+
export { PDF };
|
|
49
|
+
//# sourceMappingURL=PDF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PDF.js","names":["React","PropTypes","Button","PDF","mimetype","url","name","children","handleChangeFile","showChangeButton","createElement","className","key","data","type","href","rel","target","onClick","propTypes","string","isRequired","oneOfType","arrayOf","node","func","bool","defaultProps"],"sources":["../../../../src/components/FilePreview/PDF/PDF.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '@blaze-react/button';\n\nconst PDF = ({ mimetype, url, name, children, handleChangeFile, showChangeButton }) => (\n <div className=\"preview\" key={`pdf-${url}`}>\n <div className=\"preview__file preview__file--pdf\">\n <object key={url} data={url} type={mimetype} className=\"preview__file--pdf\">\n <p>\n <a href={url} rel=\"noopener noreferrer\" target=\"_blank\">\n Download {name}\n </a>\n </p>\n </object>\n <div className=\"preview__details preview__details--file\">\n <p>\n <strong>File details</strong>\n <a href={url} rel=\"noopener noreferrer\" target=\"_blank\">\n Original\n </a>\n </p>\n {showChangeButton && (\n <div className=\"preview__change-button\">\n <Button onClick={handleChangeFile}>Change file</Button>\n </div>\n )}\n </div>\n </div>\n {children}\n </div>\n);\n\nPDF.propTypes = {\n mimetype: PropTypes.string.isRequired,\n url: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,\n handleChangeFile: PropTypes.func,\n showChangeButton: PropTypes.bool\n};\n\nPDF.defaultProps = {\n handleChangeFile: () => {},\n showChangeButton: false\n};\n\nexport { PDF };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,MAAM,MAAM,qBAAqB;AAExC,MAAMC,GAAG,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,GAAG;EAAEC,IAAI;EAAEC,QAAQ;EAAEC,gBAAgB;EAAEC;AAAiB,CAAC,kBAChFT,KAAA,CAAAU,aAAA;EAAKC,SAAS,EAAC,SAAS;EAACC,GAAG,EAAE,OAAOP,GAAG;AAAG,gBACzCL,KAAA,CAAAU,aAAA;EAAKC,SAAS,EAAC;AAAkC,gBAC/CX,KAAA,CAAAU,aAAA;EAAQE,GAAG,EAAEP,GAAI;EAACQ,IAAI,EAAER,GAAI;EAACS,IAAI,EAAEV,QAAS;EAACO,SAAS,EAAC;AAAoB,gBACzEX,KAAA,CAAAU,aAAA,yBACEV,KAAA,CAAAU,aAAA;EAAGK,IAAI,EAAEV,GAAI;EAACW,GAAG,EAAC,qBAAqB;EAACC,MAAM,EAAC;AAAQ,GAAC,WAC7C,EAACX,IACT,CACF,CACG,CAAC,eACTN,KAAA,CAAAU,aAAA;EAAKC,SAAS,EAAC;AAAyC,gBACtDX,KAAA,CAAAU,aAAA,yBACEV,KAAA,CAAAU,aAAA,iBAAQ,cAAoB,CAAC,eAC7BV,KAAA,CAAAU,aAAA;EAAGK,IAAI,EAAEV,GAAI;EAACW,GAAG,EAAC,qBAAqB;EAACC,MAAM,EAAC;AAAQ,GAAC,UAErD,CACF,CAAC,EACHR,gBAAgB,iBACfT,KAAA,CAAAU,aAAA;EAAKC,SAAS,EAAC;AAAwB,gBACrCX,KAAA,CAAAU,aAAA,CAACR,MAAM;EAACgB,OAAO,EAAEV;AAAiB,GAAC,aAAmB,CACnD,CAEJ,CACF,CAAC,EACLD,QACE,CACN;AAEDJ,GAAG,CAACgB,SAAS,GAAG;EACdf,QAAQ,EAAEH,SAAS,CAACmB,MAAM,CAACC,UAAU;EACrChB,GAAG,EAAEJ,SAAS,CAACmB,MAAM,CAACC,UAAU;EAChCf,IAAI,EAAEL,SAAS,CAACmB,MAAM,CAACC,UAAU;EACjCd,QAAQ,EAAEN,SAAS,CAACqB,SAAS,CAAC,CAACrB,SAAS,CAACsB,OAAO,CAACtB,SAAS,CAACuB,IAAI,CAAC,EAAEvB,SAAS,CAACuB,IAAI,CAAC,CAAC,CAACH,UAAU;EAC7Fb,gBAAgB,EAAEP,SAAS,CAACwB,IAAI;EAChChB,gBAAgB,EAAER,SAAS,CAACyB;AAC9B,CAAC;AAEDvB,GAAG,CAACwB,YAAY,GAAG;EACjBnB,gBAAgB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC1BC,gBAAgB,EAAE;AACpB,CAAC;AAED,SAASN,GAAG","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Actions from '../Actions';
|
|
4
|
+
const RawPDF = ({
|
|
5
|
+
mimetype,
|
|
6
|
+
url,
|
|
7
|
+
name,
|
|
8
|
+
file
|
|
9
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
className: "FilePreview"
|
|
11
|
+
}, /*#__PURE__*/React.createElement("object", {
|
|
12
|
+
data: url,
|
|
13
|
+
type: mimetype,
|
|
14
|
+
className: "preview__file--pdf"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
|
|
16
|
+
href: url,
|
|
17
|
+
rel: "noopener noreferrer",
|
|
18
|
+
target: "_blank"
|
|
19
|
+
}, "Download ", name))), /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: "FilePreviewItem__info"
|
|
21
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
22
|
+
className: "FilePreviewItem__info__fileName"
|
|
23
|
+
}, name), /*#__PURE__*/React.createElement(Actions, {
|
|
24
|
+
file: file
|
|
25
|
+
})));
|
|
26
|
+
RawPDF.propTypes = {
|
|
27
|
+
mimetype: PropTypes.string.isRequired,
|
|
28
|
+
url: PropTypes.string.isRequired,
|
|
29
|
+
name: PropTypes.string.isRequired,
|
|
30
|
+
file: PropTypes.object.isRequired
|
|
31
|
+
};
|
|
32
|
+
export { RawPDF };
|
|
33
|
+
//# sourceMappingURL=RawPDF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RawPDF.js","names":["React","PropTypes","Actions","RawPDF","mimetype","url","name","file","createElement","className","data","type","href","rel","target","propTypes","string","isRequired","object"],"sources":["../../../../src/components/FilePreview/PDF/RawPDF.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Actions from '../Actions';\n\nconst RawPDF = ({ mimetype, url, name, file }) => (\n <div className=\"FilePreview\">\n <object data={url} type={mimetype} className=\"preview__file--pdf\">\n <p>\n <a href={url} rel=\"noopener noreferrer\" target=\"_blank\">\n Download {name}\n </a>\n </p>\n </object>\n <div className=\"FilePreviewItem__info\">\n <p className=\"FilePreviewItem__info__fileName\">{name}</p>\n <Actions file={file} />\n </div>\n </div>\n);\n\nRawPDF.propTypes = {\n mimetype: PropTypes.string.isRequired,\n url: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n file: PropTypes.object.isRequired\n};\n\nexport { RawPDF };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,YAAY;AAEhC,MAAMC,MAAM,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,GAAG;EAAEC,IAAI;EAAEC;AAAK,CAAC,kBAC3CP,KAAA,CAAAQ,aAAA;EAAKC,SAAS,EAAC;AAAa,gBAC1BT,KAAA,CAAAQ,aAAA;EAAQE,IAAI,EAAEL,GAAI;EAACM,IAAI,EAAEP,QAAS;EAACK,SAAS,EAAC;AAAoB,gBAC/DT,KAAA,CAAAQ,aAAA,yBACER,KAAA,CAAAQ,aAAA;EAAGI,IAAI,EAAEP,GAAI;EAACQ,GAAG,EAAC,qBAAqB;EAACC,MAAM,EAAC;AAAQ,GAAC,WAC7C,EAACR,IACT,CACF,CACG,CAAC,eACTN,KAAA,CAAAQ,aAAA;EAAKC,SAAS,EAAC;AAAuB,gBACpCT,KAAA,CAAAQ,aAAA;EAAGC,SAAS,EAAC;AAAiC,GAAEH,IAAQ,CAAC,eACzDN,KAAA,CAAAQ,aAAA,CAACN,OAAO;EAACK,IAAI,EAAEA;AAAK,CAAE,CACnB,CACF,CACN;AAEDJ,MAAM,CAACY,SAAS,GAAG;EACjBX,QAAQ,EAAEH,SAAS,CAACe,MAAM,CAACC,UAAU;EACrCZ,GAAG,EAAEJ,SAAS,CAACe,MAAM,CAACC,UAAU;EAChCX,IAAI,EAAEL,SAAS,CAACe,MAAM,CAACC,UAAU;EACjCV,IAAI,EAAEN,SAAS,CAACiB,MAAM,CAACD;AACzB,CAAC;AAED,SAASd,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["PDF","RawPDF","PDFSchema","pdf","component","card","raw","schema"],"sources":["../../../../src/components/FilePreview/PDF/index.js"],"sourcesContent":["import { PDF } from './PDF';\nimport { RawPDF } from './RawPDF';\nimport { PDFSchema } from './schema';\n\nconst pdf = {\n component: {\n card: PDF,\n raw: RawPDF\n },\n schema: PDFSchema\n};\n\nexport { pdf };\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,OAAO;AAC3B,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,SAAS,QAAQ,UAAU;AAEpC,MAAMC,GAAG,GAAG;EACVC,SAAS,EAAE;IACTC,IAAI,EAAEL,GAAG;IACTM,GAAG,EAAEL;EACP,CAAC;EACDM,MAAM,EAAEL;AACV,CAAC;AAED,SAASC,GAAG","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const PDFSchema = {
|
|
2
|
+
settings: {},
|
|
3
|
+
formSchema: {
|
|
4
|
+
properties: {
|
|
5
|
+
name: {
|
|
6
|
+
type: 'string',
|
|
7
|
+
showInForm: true,
|
|
8
|
+
label: 'File name',
|
|
9
|
+
formFieldType: 'text'
|
|
10
|
+
},
|
|
11
|
+
caption: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
showInForm: true,
|
|
14
|
+
formFieldType: 'text'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
required: ['name']
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export { PDFSchema };
|
|
21
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","names":["PDFSchema","settings","formSchema","properties","name","type","showInForm","label","formFieldType","caption","required"],"sources":["../../../../src/components/FilePreview/PDF/schema.js"],"sourcesContent":["const PDFSchema = {\n settings: {},\n formSchema: {\n properties: {\n name: {\n type: 'string',\n showInForm: true,\n label: 'File name',\n formFieldType: 'text'\n },\n caption: {\n type: 'string',\n showInForm: true,\n formFieldType: 'text'\n }\n },\n required: ['name']\n }\n};\n\nexport { PDFSchema };\n"],"mappings":"AAAA,MAAMA,SAAS,GAAG;EAChBC,QAAQ,EAAE,CAAC,CAAC;EACZC,UAAU,EAAE;IACVC,UAAU,EAAE;MACVC,IAAI,EAAE;QACJC,IAAI,EAAE,QAAQ;QACdC,UAAU,EAAE,IAAI;QAChBC,KAAK,EAAE,WAAW;QAClBC,aAAa,EAAE;MACjB,CAAC;MACDC,OAAO,EAAE;QACPJ,IAAI,EAAE,QAAQ;QACdC,UAAU,EAAE,IAAI;QAChBE,aAAa,EAAE;MACjB;IACF,CAAC;IACDE,QAAQ,EAAE,CAAC,MAAM;EACnB;AACF,CAAC;AAED,SAASV,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { pdf } from './PDF';
|
|
2
|
+
import { image } from './Image';
|
|
3
|
+
import { previewDefault } from './previewDefault';
|
|
4
|
+
const schemas = {
|
|
5
|
+
'application/pdf': pdf,
|
|
6
|
+
'image/gif': image,
|
|
7
|
+
'image/jpg': image,
|
|
8
|
+
'image/jpeg': image,
|
|
9
|
+
'image/png': image,
|
|
10
|
+
'image/bmp': image,
|
|
11
|
+
'image/svg+xml': image,
|
|
12
|
+
'image/tiff': image,
|
|
13
|
+
'image/webp': image,
|
|
14
|
+
default: previewDefault
|
|
15
|
+
};
|
|
16
|
+
const getPreview = ({
|
|
17
|
+
mimetype,
|
|
18
|
+
previewType
|
|
19
|
+
}) => {
|
|
20
|
+
const {
|
|
21
|
+
component,
|
|
22
|
+
schema
|
|
23
|
+
} = schemas[mimetype] || schemas.default;
|
|
24
|
+
const Preview = component[previewType] || component;
|
|
25
|
+
return [Preview, schema];
|
|
26
|
+
};
|
|
27
|
+
export { getPreview };
|
|
28
|
+
//# sourceMappingURL=get-preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-preview.js","names":["pdf","image","previewDefault","schemas","default","getPreview","mimetype","previewType","component","schema","Preview"],"sources":["../../../src/components/FilePreview/get-preview.js"],"sourcesContent":["import { pdf } from './PDF';\nimport { image } from './Image';\nimport { previewDefault } from './previewDefault';\n\nconst schemas = {\n 'application/pdf': pdf,\n 'image/gif': image,\n 'image/jpg': image,\n 'image/jpeg': image,\n 'image/png': image,\n 'image/bmp': image,\n 'image/svg+xml': image,\n 'image/tiff': image,\n 'image/webp': image,\n default: previewDefault\n};\n\nconst getPreview = ({ mimetype, previewType }) => {\n const { component, schema } = schemas[mimetype] || schemas.default;\n const Preview = component[previewType] || component;\n return [Preview, schema];\n};\n\nexport { getPreview };\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,OAAO;AAC3B,SAASC,KAAK,QAAQ,SAAS;AAC/B,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,MAAMC,OAAO,GAAG;EACd,iBAAiB,EAAEH,GAAG;EACtB,WAAW,EAAEC,KAAK;EAClB,WAAW,EAAEA,KAAK;EAClB,YAAY,EAAEA,KAAK;EACnB,WAAW,EAAEA,KAAK;EAClB,WAAW,EAAEA,KAAK;EAClB,eAAe,EAAEA,KAAK;EACtB,YAAY,EAAEA,KAAK;EACnB,YAAY,EAAEA,KAAK;EACnBG,OAAO,EAAEF;AACX,CAAC;AAED,MAAMG,UAAU,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAY,CAAC,KAAK;EAChD,MAAM;IAAEC,SAAS;IAAEC;EAAO,CAAC,GAAGN,OAAO,CAACG,QAAQ,CAAC,IAAIH,OAAO,CAACC,OAAO;EAClE,MAAMM,OAAO,GAAGF,SAAS,CAACD,WAAW,CAAC,IAAIC,SAAS;EACnD,OAAO,CAACE,OAAO,EAAED,MAAM,CAAC;AAC1B,CAAC;AAED,SAASJ,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { FormBuilder } from '@blaze-cms/react-form-builder';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { getPreview } from './get-preview';
|
|
9
|
+
const FilePreview = ({
|
|
10
|
+
file,
|
|
11
|
+
handleFormChange,
|
|
12
|
+
displayForm,
|
|
13
|
+
previewType,
|
|
14
|
+
children,
|
|
15
|
+
handleChangeFile,
|
|
16
|
+
showChangeButton,
|
|
17
|
+
disableFilePreview
|
|
18
|
+
}) => {
|
|
19
|
+
const {
|
|
20
|
+
name,
|
|
21
|
+
url,
|
|
22
|
+
mimetype,
|
|
23
|
+
data,
|
|
24
|
+
store,
|
|
25
|
+
updated
|
|
26
|
+
} = file;
|
|
27
|
+
const bustUrl = (srcUrl, version) => {
|
|
28
|
+
if (!srcUrl) return srcUrl;
|
|
29
|
+
const sep = srcUrl.includes('?') ? '&' : '?';
|
|
30
|
+
return `${srcUrl}${sep}v=${version || Date.now()}`;
|
|
31
|
+
};
|
|
32
|
+
const displayUrl = bustUrl(url, updated);
|
|
33
|
+
const [Preview, schema] = getPreview({
|
|
34
|
+
mimetype,
|
|
35
|
+
previewType
|
|
36
|
+
});
|
|
37
|
+
const shouldRenderForm = schema && displayForm;
|
|
38
|
+
if (shouldRenderForm && store) {
|
|
39
|
+
const {
|
|
40
|
+
defaultStore = {},
|
|
41
|
+
storeOptions = []
|
|
42
|
+
} = store;
|
|
43
|
+
if (schema.formSchema.properties.storeKey) {
|
|
44
|
+
schema.formSchema.properties.storeKey.options = storeOptions;
|
|
45
|
+
if (defaultStore) {
|
|
46
|
+
const {
|
|
47
|
+
key
|
|
48
|
+
} = defaultStore;
|
|
49
|
+
schema.formSchema.properties.storeKey.selected = key;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const formBuilderData = {
|
|
54
|
+
values: _objectSpread(_objectSpread({}, data), file)
|
|
55
|
+
};
|
|
56
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Preview, _extends({
|
|
57
|
+
mimetype: mimetype,
|
|
58
|
+
url: displayUrl,
|
|
59
|
+
name: name
|
|
60
|
+
}, data, {
|
|
61
|
+
file: file,
|
|
62
|
+
handleChangeFile: handleChangeFile,
|
|
63
|
+
disableFilePreview: disableFilePreview,
|
|
64
|
+
showChangeButton: showChangeButton
|
|
65
|
+
}), shouldRenderForm && /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: "preview__details"
|
|
67
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: "preview__filename"
|
|
69
|
+
}, file.filename), /*#__PURE__*/React.createElement(FormBuilder, {
|
|
70
|
+
formClassName: "preview__form",
|
|
71
|
+
onChange: handleFormChange,
|
|
72
|
+
data: formBuilderData,
|
|
73
|
+
schema: schema.formSchema
|
|
74
|
+
}))), children);
|
|
75
|
+
};
|
|
76
|
+
FilePreview.availablePreviewTypes = {
|
|
77
|
+
card: 'card',
|
|
78
|
+
raw: 'raw'
|
|
79
|
+
};
|
|
80
|
+
FilePreview.propTypes = {
|
|
81
|
+
file: PropTypes.object.isRequired,
|
|
82
|
+
fileName: PropTypes.string,
|
|
83
|
+
handleFormChange: PropTypes.func,
|
|
84
|
+
handleChangeFile: PropTypes.func,
|
|
85
|
+
displayForm: PropTypes.bool,
|
|
86
|
+
handlers: PropTypes.object,
|
|
87
|
+
previewType: PropTypes.oneOf(Object.keys(FilePreview.availablePreviewTypes)),
|
|
88
|
+
children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string]),
|
|
89
|
+
showChangeButton: PropTypes.bool,
|
|
90
|
+
disableFilePreview: PropTypes.bool
|
|
91
|
+
};
|
|
92
|
+
FilePreview.defaultProps = {
|
|
93
|
+
displayForm: false,
|
|
94
|
+
fileName: '',
|
|
95
|
+
handlers: {},
|
|
96
|
+
previewType: FilePreview.availablePreviewTypes.card,
|
|
97
|
+
handleFormChange: () => {},
|
|
98
|
+
handleChangeFile: () => {},
|
|
99
|
+
children: [],
|
|
100
|
+
showChangeButton: false,
|
|
101
|
+
disableFilePreview: true
|
|
102
|
+
};
|
|
103
|
+
export default FilePreview;
|
|
104
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","FormBuilder","PropTypes","getPreview","FilePreview","file","handleFormChange","displayForm","previewType","children","handleChangeFile","showChangeButton","disableFilePreview","name","url","mimetype","data","store","updated","bustUrl","srcUrl","version","sep","includes","Date","now","displayUrl","Preview","schema","shouldRenderForm","defaultStore","storeOptions","formSchema","properties","storeKey","options","key","selected","formBuilderData","values","_objectSpread","createElement","Fragment","_extends","className","filename","formClassName","onChange","availablePreviewTypes","card","raw","propTypes","object","isRequired","fileName","string","func","bool","handlers","oneOf","Object","keys","oneOfType","array","defaultProps"],"sources":["../../../src/components/FilePreview/index.js"],"sourcesContent":["import React from 'react';\nimport { FormBuilder } from '@blaze-cms/react-form-builder';\nimport PropTypes from 'prop-types';\nimport { getPreview } from './get-preview';\n\nconst FilePreview = ({\n file,\n handleFormChange,\n displayForm,\n previewType,\n children,\n handleChangeFile,\n showChangeButton,\n disableFilePreview\n}) => {\n const { name, url, mimetype, data, store, updated } = file;\n const bustUrl = (srcUrl, version) => {\n if (!srcUrl) return srcUrl;\n const sep = srcUrl.includes('?') ? '&' : '?';\n return `${srcUrl}${sep}v=${version || Date.now()}`;\n };\n const displayUrl = bustUrl(url, updated);\n const [Preview, schema] = getPreview({ mimetype, previewType });\n const shouldRenderForm = schema && displayForm;\n\n if (shouldRenderForm && store) {\n const { defaultStore = {}, storeOptions = [] } = store;\n if (schema.formSchema.properties.storeKey) {\n schema.formSchema.properties.storeKey.options = storeOptions;\n if (defaultStore) {\n const { key } = defaultStore;\n schema.formSchema.properties.storeKey.selected = key;\n }\n }\n }\n\n const formBuilderData = { values: { ...data, ...file } };\n\n return (\n <>\n <Preview\n mimetype={mimetype}\n url={displayUrl}\n name={name}\n {...data}\n file={file}\n handleChangeFile={handleChangeFile}\n disableFilePreview={disableFilePreview}\n showChangeButton={showChangeButton}>\n {shouldRenderForm && (\n <div className=\"preview__details\">\n <div className=\"preview__filename\">{file.filename}</div>\n <FormBuilder\n formClassName=\"preview__form\"\n onChange={handleFormChange}\n data={formBuilderData}\n schema={schema.formSchema}\n />\n </div>\n )}\n </Preview>\n {children}\n </>\n );\n};\n\nFilePreview.availablePreviewTypes = {\n card: 'card',\n raw: 'raw'\n};\n\nFilePreview.propTypes = {\n file: PropTypes.object.isRequired,\n fileName: PropTypes.string,\n handleFormChange: PropTypes.func,\n handleChangeFile: PropTypes.func,\n displayForm: PropTypes.bool,\n handlers: PropTypes.object,\n previewType: PropTypes.oneOf(Object.keys(FilePreview.availablePreviewTypes)),\n children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string]),\n showChangeButton: PropTypes.bool,\n disableFilePreview: PropTypes.bool\n};\n\nFilePreview.defaultProps = {\n displayForm: false,\n fileName: '',\n handlers: {},\n previewType: FilePreview.availablePreviewTypes.card,\n handleFormChange: () => {},\n handleChangeFile: () => {},\n children: [],\n showChangeButton: false,\n disableFilePreview: true\n};\n\nexport default FilePreview;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,QAAQ,+BAA+B;AAC3D,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,UAAU,QAAQ,eAAe;AAE1C,MAAMC,WAAW,GAAGA,CAAC;EACnBC,IAAI;EACJC,gBAAgB;EAChBC,WAAW;EACXC,WAAW;EACXC,QAAQ;EACRC,gBAAgB;EAChBC,gBAAgB;EAChBC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC,IAAI;IAAEC,GAAG;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,KAAK;IAAE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,SAAS,CAACuD,IAAI;EAChC7C,kBAAkB,EAAEV,SAAS,CAACuD;AAChC,CAAC;AAEDrD,WAAW,CAAC4D,YAAY,GAAG;EACzBzD,WAAW,EAAE,KAAK;EAClB+C,QAAQ,EAAE,EAAE;EACZI,QAAQ,EAAE,CAAC,CAAC;EACZlD,WAAW,EAAEJ,WAAW,CAAC4C,qBAAqB,CAACC,IAAI;EACnD3C,gBAAgB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC1BI,gBAAgB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC1BD,QAAQ,EAAE,EAAE;EACZE,gBAAgB,EAAE,KAAK;EACvBC,kBAAkB,EAAE;AACtB,CAAC;AAED,eAAeR,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Button from '@blaze-react/button';
|
|
4
|
+
import { DefaultIcon } from './icons';
|
|
5
|
+
const PreviewDefault = ({
|
|
6
|
+
url,
|
|
7
|
+
name,
|
|
8
|
+
children,
|
|
9
|
+
handleChangeFile,
|
|
10
|
+
showChangeButton
|
|
11
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: "preview",
|
|
13
|
+
key: `default-${url}`
|
|
14
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: "preview__file preview__file--default"
|
|
16
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: "preview__file--icon"
|
|
18
|
+
}, /*#__PURE__*/React.createElement(DefaultIcon, null), /*#__PURE__*/React.createElement("span", null, "Preview not available")), /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
className: "preview__details preview__details--file"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("strong", null, "File details"), /*#__PURE__*/React.createElement("a", {
|
|
21
|
+
href: url,
|
|
22
|
+
rel: "noopener noreferrer",
|
|
23
|
+
target: "_blank"
|
|
24
|
+
}, "Original")), showChangeButton && /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: "preview__change-button"
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
27
|
+
onClick: handleChangeFile
|
|
28
|
+
}, "Change file")))), children);
|
|
29
|
+
PreviewDefault.propTypes = {
|
|
30
|
+
url: PropTypes.string.isRequired,
|
|
31
|
+
name: PropTypes.string.isRequired,
|
|
32
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
|
33
|
+
handleChangeFile: PropTypes.func,
|
|
34
|
+
showChangeButton: PropTypes.bool
|
|
35
|
+
};
|
|
36
|
+
PreviewDefault.defaultProps = {
|
|
37
|
+
handleChangeFile: () => {},
|
|
38
|
+
showChangeButton: false
|
|
39
|
+
};
|
|
40
|
+
export { PreviewDefault };
|
|
41
|
+
//# sourceMappingURL=PreviewDefault.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreviewDefault.js","names":["React","PropTypes","Button","DefaultIcon","PreviewDefault","url","name","children","handleChangeFile","showChangeButton","createElement","className","key","href","rel","target","onClick","propTypes","string","isRequired","oneOfType","arrayOf","node","func","bool","defaultProps"],"sources":["../../../../src/components/FilePreview/previewDefault/PreviewDefault.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '@blaze-react/button';\nimport { DefaultIcon } from './icons';\n\nconst PreviewDefault = ({ url, name, children, handleChangeFile, showChangeButton }) => (\n <div className=\"preview\" key={`default-${url}`}>\n <div className=\"preview__file preview__file--default\">\n <div className=\"preview__file--icon\">\n <DefaultIcon />\n <span>Preview not available</span>\n </div>\n <div className=\"preview__details preview__details--file\">\n <p>\n <strong>File details</strong>\n <a href={url} rel=\"noopener noreferrer\" target=\"_blank\">\n Original\n </a>\n </p>\n {showChangeButton && (\n <div className=\"preview__change-button\">\n <Button onClick={handleChangeFile}>Change file</Button>\n </div>\n )}\n </div>\n </div>\n {children}\n </div>\n);\n\nPreviewDefault.propTypes = {\n url: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,\n handleChangeFile: PropTypes.func,\n showChangeButton: PropTypes.bool\n};\n\nPreviewDefault.defaultProps = {\n handleChangeFile: () => {},\n showChangeButton: false\n};\n\nexport { PreviewDefault };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,MAAM,MAAM,qBAAqB;AACxC,SAASC,WAAW,QAAQ,SAAS;AAErC,MAAMC,cAAc,GAAGA,CAAC;EAAEC,GAAG;EAAEC,IAAI;EAAEC,QAAQ;EAAEC,gBAAgB;EAAEC;AAAiB,CAAC,kBACjFT,KAAA,CAAAU,aAAA;EAAKC,SAAS,EAAC,SAAS;EAACC,GAAG,EAAE,WAAWP,GAAG;AAAG,gBAC7CL,KAAA,CAAAU,aAAA;EAAKC,SAAS,EAAC;AAAsC,gBACnDX,KAAA,CAAAU,aAAA;EAAKC,SAAS,EAAC;AAAqB,gBAClCX,KAAA,CAAAU,aAAA,CAACP,WAAW,MAAE,CAAC,eACfH,KAAA,CAAAU,aAAA,eAAM,uBAA2B,CAC9B,CAAC,eACNV,KAAA,CAAAU,aAAA;EAAKC,SAAS,EAAC;AAAyC,gBACtDX,KAAA,CAAAU,aAAA,yBACEV,KAAA,CAAAU,aAAA,iBAAQ,cAAoB,CAAC,eAC7BV,KAAA,CAAAU,aAAA;EAAGG,IAAI,EAAER,GAAI;EAACS,GAAG,EAAC,qBAAqB;EAACC,MAAM,EAAC;AAAQ,GAAC,UAErD,CACF,CAAC,EACHN,gBAAgB,iBACfT,KAAA,CAAAU,aAAA;EAAKC,SAAS,EAAC;AAAwB,gBACrCX,KAAA,CAAAU,aAAA,CAACR,MAAM;EAACc,OAAO,EAAER;AAAiB,GAAC,aAAmB,CACnD,CAEJ,CACF,CAAC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