@blaze-cms/plugin-media-ui 0.146.0-rc-eagle.0 → 0.146.0-rc-eagle-3.0
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 -1
- package/lib/components/CardMedia/CardMedia.js +96 -52
- package/lib/components/CardMedia/CardMedia.js.map +1 -1
- package/lib/components/EditMediaFile/EditMediaFile.js +24 -39
- package/lib/components/EditMediaFile/EditMediaFile.js.map +1 -1
- package/lib/components/EditMediaFile/EditMediaFilePage.js +16 -8
- package/lib/components/EditMediaFile/EditMediaFilePage.js.map +1 -1
- package/lib/components/FileList/useGetFiles/getFiles.js +6 -3
- package/lib/components/FileList/useGetFiles/getFiles.js.map +1 -1
- package/lib/components/FileList/useGetFiles/useGetFiles.js +7 -2
- package/lib/components/FileList/useGetFiles/useGetFiles.js.map +1 -1
- package/lib/components/FileList/useGetFilesList/useGetFilesList.js +4 -1
- package/lib/components/FileList/useGetFilesList/useGetFilesList.js.map +1 -1
- package/lib/components/FilePreview/Actions/index.js +2 -1
- package/lib/components/FilePreview/Actions/index.js.map +1 -1
- package/lib/components/FilePreview/Image/imageSchema.js +8 -4
- package/lib/components/FilePreview/Image/imageSchema.js.map +1 -1
- package/lib/components/FilePreview/PDF/schema.js +2 -1
- package/lib/components/FilePreview/PDF/schema.js.map +1 -1
- package/lib/components/FilePreview/index.js +47 -3
- package/lib/components/FilePreview/index.js.map +1 -1
- package/lib/components/FilePreview/previewDefault/previewDefaultSchema.js +2 -1
- package/lib/components/FilePreview/previewDefault/previewDefaultSchema.js.map +1 -1
- package/lib/components/FilePreviewReadOnly/FilePreviewReadOnly.js +2 -1
- package/lib/components/FilePreviewReadOnly/FilePreviewReadOnly.js.map +1 -1
- package/lib/components/FileUploadAdapter/FileList.js +2 -1
- package/lib/components/FileUploadAdapter/FileList.js.map +1 -1
- package/lib/components/FileUploadAdapter/FileUploadAdapter.js +35 -23
- package/lib/components/FileUploadAdapter/FileUploadAdapter.js.map +1 -1
- package/lib/components/FileUploadModal/FileUploadModal.js +82 -18
- package/lib/components/FileUploadModal/FileUploadModal.js.map +1 -1
- package/lib/components/FilterPanel/FilterPanel.js +43 -125
- package/lib/components/FilterPanel/FilterPanel.js.map +1 -1
- package/lib/components/FilterPanel/MediaSearchFilter.js +41 -0
- package/lib/components/FilterPanel/MediaSearchFilter.js.map +1 -0
- package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +9 -5
- package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js.map +1 -1
- package/lib/components/ListingContainer/Listing/MediaListing/MediaListing.js +2 -1
- package/lib/components/ListingContainer/Listing/MediaListing/MediaListing.js.map +1 -1
- package/lib/components/ListingContainer/ListingContainer.js +6 -2
- package/lib/components/ListingContainer/ListingContainer.js.map +1 -1
- package/lib/components/MediaListing.js +2 -1
- package/lib/components/MediaListing.js.map +1 -1
- package/lib/constants.js +3 -2
- package/lib/constants.js.map +1 -1
- package/lib-es/components/CardMedia/CardMedia.js +276 -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 +171 -0
- package/lib-es/components/EditMediaFile/EditMediaFile.js.map +1 -0
- package/lib-es/components/EditMediaFile/EditMediaFilePage.js +116 -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 +59 -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 +182 -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 +119 -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 +175 -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 +57 -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 +22 -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 +148 -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 +26 -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 +402 -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 +241 -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 +55 -0
- package/lib-es/components/FilterPanel/FilterPanel.js.map +1 -0
- package/lib-es/components/FilterPanel/MediaSearchFilter.js +34 -0
- package/lib-es/components/FilterPanel/MediaSearchFilter.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 +156 -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 +118 -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 +37 -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 +77 -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 +16 -9
- package/src/components/CardMedia/CardMedia.js +119 -89
- package/src/components/EditMediaFile/EditMediaFile.js +20 -21
- package/src/components/EditMediaFile/EditMediaFilePage.js +12 -7
- package/src/components/FileList/useGetFiles/getFiles.js +12 -4
- package/src/components/FileList/useGetFiles/useGetFiles.js +3 -4
- package/src/components/FileList/useGetFilesList/useGetFilesList.js +2 -1
- package/src/components/FilePreview/Image/imageSchema.js +8 -4
- package/src/components/FilePreview/PDF/schema.js +2 -1
- package/src/components/FilePreview/index.js +36 -2
- package/src/components/FilePreview/previewDefault/previewDefaultSchema.js +2 -1
- package/src/components/FileUploadAdapter/FileUploadAdapter.js +24 -14
- package/src/components/FileUploadModal/FileUploadModal.js +71 -6
- package/src/components/FilterPanel/FilterPanel.js +44 -129
- package/src/components/FilterPanel/MediaSearchFilter.js +32 -0
- package/src/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +7 -2
- package/src/components/ListingContainer/ListingContainer.js +4 -1
- package/src/constants.js +16 -2
- package/babel.config.js +0 -3
- package/jest.config.js +0 -5
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
const _excluded = ["name", "storeKey"];
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { FormBuilder } from '@blaze-cms/react-form-builder';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import { useQuery } from '@apollo/client';
|
|
11
|
+
import { getQuery, getDynamicQuery } from '@blaze-cms/admin-ui-utils';
|
|
12
|
+
import { getPreview } from './get-preview';
|
|
13
|
+
import { FILE_DEFAULT_PROPS } from '../../constants';
|
|
14
|
+
const FilePreview = ({
|
|
15
|
+
file,
|
|
16
|
+
handleFormChange,
|
|
17
|
+
displayForm,
|
|
18
|
+
previewType,
|
|
19
|
+
children,
|
|
20
|
+
handleChangeFile,
|
|
21
|
+
showChangeButton,
|
|
22
|
+
disableFilePreview
|
|
23
|
+
}) => {
|
|
24
|
+
const {
|
|
25
|
+
data: schemaData = {
|
|
26
|
+
getEntitySchemas: [{
|
|
27
|
+
properties: {},
|
|
28
|
+
actions: {
|
|
29
|
+
get: 'getFile'
|
|
30
|
+
}
|
|
31
|
+
}]
|
|
32
|
+
},
|
|
33
|
+
loading: schemaLoading
|
|
34
|
+
} = useQuery(getQuery('GET_ENTITY_SCHEMA'), {
|
|
35
|
+
variables: {
|
|
36
|
+
identifier: 'file'
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const [fileSchema] = schemaData && schemaData.getEntitySchemas ? schemaData.getEntitySchemas : [];
|
|
40
|
+
const fileQuery = getDynamicQuery('DATA_QUERY')(fileSchema, file.id, null, FILE_DEFAULT_PROPS);
|
|
41
|
+
const {
|
|
42
|
+
loading,
|
|
43
|
+
data: {
|
|
44
|
+
entityData: fileData
|
|
45
|
+
} = {}
|
|
46
|
+
} = useQuery(fileQuery, {
|
|
47
|
+
variables: {
|
|
48
|
+
id: file.id
|
|
49
|
+
},
|
|
50
|
+
fetchPolicy: 'cache-and-network',
|
|
51
|
+
skip: !fileSchema || !fileSchema.id
|
|
52
|
+
});
|
|
53
|
+
if (!fileSchema || schemaLoading || loading) return null;
|
|
54
|
+
const {
|
|
55
|
+
name,
|
|
56
|
+
url,
|
|
57
|
+
mimetype,
|
|
58
|
+
data,
|
|
59
|
+
store,
|
|
60
|
+
updated
|
|
61
|
+
} = fileData;
|
|
62
|
+
const bustUrl = (srcUrl, version) => {
|
|
63
|
+
if (!srcUrl) return srcUrl;
|
|
64
|
+
const sep = srcUrl.includes('?') ? '&' : '?';
|
|
65
|
+
return `${srcUrl}${sep}v=${version || Date.now()}`;
|
|
66
|
+
};
|
|
67
|
+
const displayUrl = bustUrl(url, updated);
|
|
68
|
+
const [Preview, schema] = getPreview({
|
|
69
|
+
mimetype,
|
|
70
|
+
previewType
|
|
71
|
+
});
|
|
72
|
+
const shouldRenderForm = schema && displayForm;
|
|
73
|
+
const {
|
|
74
|
+
properties
|
|
75
|
+
} = fileSchema;
|
|
76
|
+
const {
|
|
77
|
+
name: nameProp,
|
|
78
|
+
storeKey: storeKeyProp
|
|
79
|
+
} = properties,
|
|
80
|
+
restProperties = _objectWithoutProperties(properties, _excluded);
|
|
81
|
+
_extends(schema.formSchema.properties, restProperties);
|
|
82
|
+
if (shouldRenderForm && store) {
|
|
83
|
+
const {
|
|
84
|
+
defaultStore = {},
|
|
85
|
+
storeOptions = []
|
|
86
|
+
} = store;
|
|
87
|
+
if (schema.formSchema.properties.storeKey) {
|
|
88
|
+
schema.formSchema.properties.storeKey.options = storeOptions;
|
|
89
|
+
if (defaultStore) {
|
|
90
|
+
const {
|
|
91
|
+
key
|
|
92
|
+
} = defaultStore;
|
|
93
|
+
schema.formSchema.properties.storeKey.selected = key;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const formBuilderData = {
|
|
98
|
+
values: _objectSpread(_objectSpread({}, data), fileData)
|
|
99
|
+
};
|
|
100
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Preview, _extends({
|
|
101
|
+
mimetype: mimetype,
|
|
102
|
+
url: displayUrl,
|
|
103
|
+
name: name
|
|
104
|
+
}, data, {
|
|
105
|
+
file: file,
|
|
106
|
+
handleChangeFile: handleChangeFile,
|
|
107
|
+
disableFilePreview: disableFilePreview,
|
|
108
|
+
showChangeButton: showChangeButton
|
|
109
|
+
}), shouldRenderForm && /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: "preview__details"
|
|
111
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: "preview__filename"
|
|
113
|
+
}, file.filename), /*#__PURE__*/React.createElement(FormBuilder, {
|
|
114
|
+
formClassName: "preview__form",
|
|
115
|
+
onChange: handleFormChange,
|
|
116
|
+
data: formBuilderData,
|
|
117
|
+
schema: schema.formSchema
|
|
118
|
+
}))), children);
|
|
119
|
+
};
|
|
120
|
+
FilePreview.availablePreviewTypes = {
|
|
121
|
+
card: 'card',
|
|
122
|
+
raw: 'raw'
|
|
123
|
+
};
|
|
124
|
+
FilePreview.propTypes = {
|
|
125
|
+
file: PropTypes.object.isRequired,
|
|
126
|
+
fileName: PropTypes.string,
|
|
127
|
+
handleFormChange: PropTypes.func,
|
|
128
|
+
handleChangeFile: PropTypes.func,
|
|
129
|
+
displayForm: PropTypes.bool,
|
|
130
|
+
handlers: PropTypes.object,
|
|
131
|
+
previewType: PropTypes.oneOf(Object.keys(FilePreview.availablePreviewTypes)),
|
|
132
|
+
children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string]),
|
|
133
|
+
showChangeButton: PropTypes.bool,
|
|
134
|
+
disableFilePreview: PropTypes.bool
|
|
135
|
+
};
|
|
136
|
+
FilePreview.defaultProps = {
|
|
137
|
+
displayForm: false,
|
|
138
|
+
fileName: '',
|
|
139
|
+
handlers: {},
|
|
140
|
+
previewType: FilePreview.availablePreviewTypes.card,
|
|
141
|
+
handleFormChange: () => {},
|
|
142
|
+
handleChangeFile: () => {},
|
|
143
|
+
children: [],
|
|
144
|
+
showChangeButton: false,
|
|
145
|
+
disableFilePreview: true
|
|
146
|
+
};
|
|
147
|
+
export default FilePreview;
|
|
148
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","FormBuilder","PropTypes","useQuery","getQuery","getDynamicQuery","getPreview","FILE_DEFAULT_PROPS","FilePreview","file","handleFormChange","displayForm","previewType","children","handleChangeFile","showChangeButton","disableFilePreview","data","schemaData","getEntitySchemas","properties","actions","get","loading","schemaLoading","variables","identifier","fileSchema","fileQuery","id","entityData","fileData","fetchPolicy","skip","name","url","mimetype","store","updated","bustUrl","srcUrl","version","sep","includes","Date","now","displayUrl","Preview","schema","shouldRenderForm","nameProp","storeKey","storeKeyProp","restProperties","_objectWithoutProperties","_excluded","_extends","formSchema","defaultStore","storeOptions","options","key","selected","formBuilderData","values","_objectSpread","createElement","Fragment","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 { useQuery } from '@apollo/client';\nimport { getQuery, getDynamicQuery } from '@blaze-cms/admin-ui-utils';\nimport { getPreview } from './get-preview';\nimport { FILE_DEFAULT_PROPS } from '../../constants';\n\nconst FilePreview = ({\n file,\n handleFormChange,\n displayForm,\n previewType,\n children,\n handleChangeFile,\n showChangeButton,\n disableFilePreview\n}) => {\n const {\n data: schemaData = {\n getEntitySchemas: [\n {\n properties: {},\n actions: {\n get: 'getFile'\n }\n }\n ]\n },\n loading: schemaLoading\n } = useQuery(getQuery('GET_ENTITY_SCHEMA'), {\n variables: { identifier: 'file' }\n });\n\n const [fileSchema] = schemaData && schemaData.getEntitySchemas ? schemaData.getEntitySchemas : [];\n\n const fileQuery = getDynamicQuery('DATA_QUERY')(fileSchema, file.id, null, FILE_DEFAULT_PROPS);\n const { loading, data: { entityData: fileData } = {} } = useQuery(fileQuery, {\n variables: { id: file.id },\n fetchPolicy: 'cache-and-network',\n skip: !fileSchema || !fileSchema.id\n });\n\n if (!fileSchema || schemaLoading || loading) return null;\n\n const { name, url, mimetype, data, store, updated } = fileData;\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 const { properties } = fileSchema;\n const { name: nameProp, storeKey: storeKeyProp, ...restProperties } = properties;\n Object.assign(schema.formSchema.properties, restProperties);\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, ...fileData } };\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,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,QAAQ,EAAEC,eAAe,QAAQ,2BAA2B;AACrE,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,kBAAkB,QAAQ,iBAAi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,CAACC,MAAM,CAACC,IAAI,CAAC7E,WAAW,CAACgE,qBAAqB,CAAC,CAAC;EAC5E3D,QAAQ,EAAEX,SAAS,CAACoF,SAAS,CAAC,CAACpF,SAAS,CAACqF,KAAK,EAAErF,SAAS,CAAC0E,MAAM,EAAE1E,SAAS,CAAC6E,MAAM,CAAC,CAAC;EACpFhE,gBAAgB,EAAEb,SAAS,CAAC+E,IAAI;EAChCjE,kBAAkB,EAAEd,SAAS,CAAC+E;AAChC,CAAC;AAEDzE,WAAW,CAACgF,YAAY,GAAG;EACzB7E,WAAW,EAAE,KAAK;EAClBmE,QAAQ,EAAE,EAAE;EACZI,QAAQ,EAAE,CAAC,CAAC;EACZtE,WAAW,EAAEJ,WAAW,CAACgE,qBAAqB,CAACC,IAAI;EACnD/D,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,EACLD,QACE,CACN;AAEDH,cAAc,CAACa,SAAS,GAAG;EACzBZ,GAAG,EAAEJ,SAAS,CAACiB,MAAM,CAACC,UAAU;EAChCb,IAAI,EAAEL,SAAS,CAACiB,MAAM,CAACC,UAAU;EACjCZ,QAAQ,EAAEN,SAAS,CAACmB,SAAS,CAAC,CAACnB,SAAS,CAACoB,OAAO,CAACpB,SAAS,CAACqB,IAAI,CAAC,EAAErB,SAAS,CAACqB,IAAI,CAAC,CAAC,CAACH,UAAU;EAC7FX,gBAAgB,EAAEP,SAAS,CAACsB,IAAI;EAChCd,gBAAgB,EAAER,SAAS,CAACuB;AAC9B,CAAC;AAEDpB,cAAc,CAACqB,YAAY,GAAG;EAC5BjB,gBAAgB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC1BC,gBAAgB,EAAE;AACpB,CAAC;AAED,SAASL,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Actions from '../Actions';
|
|
4
|
+
const RawPreviewDefault = ({
|
|
5
|
+
url,
|
|
6
|
+
name,
|
|
7
|
+
file,
|
|
8
|
+
disableFilePreview
|
|
9
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
className: "FilePreview"
|
|
11
|
+
}, !disableFilePreview ? /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: "FilePreviewItem"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: "FilePreviewItem__wrapper"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
16
|
+
className: "FilePreviewItem__wrapper__default",
|
|
17
|
+
src: url,
|
|
18
|
+
alt: name
|
|
19
|
+
})), /*#__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
|
+
}))) : /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: "FilePreviewItem__info"
|
|
27
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
28
|
+
className: "FilePreviewItem__info__fileName FilePreviewItem__info--disablePreview"
|
|
29
|
+
}, name), /*#__PURE__*/React.createElement(Actions, {
|
|
30
|
+
file: file
|
|
31
|
+
})));
|
|
32
|
+
RawPreviewDefault.propTypes = {
|
|
33
|
+
url: PropTypes.string.isRequired,
|
|
34
|
+
name: PropTypes.string.isRequired,
|
|
35
|
+
file: PropTypes.object.isRequired,
|
|
36
|
+
disableFilePreview: PropTypes.bool.isRequired
|
|
37
|
+
};
|
|
38
|
+
export { RawPreviewDefault };
|
|
39
|
+
//# sourceMappingURL=RawPreviewDefault.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RawPreviewDefault.js","names":["React","PropTypes","Actions","RawPreviewDefault","url","name","file","disableFilePreview","createElement","className","src","alt","propTypes","string","isRequired","object","bool"],"sources":["../../../../src/components/FilePreview/previewDefault/RawPreviewDefault.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Actions from '../Actions';\n\nconst RawPreviewDefault = ({ url, name, file, disableFilePreview }) => (\n <div className=\"FilePreview\">\n {!disableFilePreview ? (\n <div className=\"FilePreviewItem\">\n <div className=\"FilePreviewItem__wrapper\">\n <img className=\"FilePreviewItem__wrapper__default\" 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 ) : (\n <div className=\"FilePreviewItem__info\">\n <p className=\"FilePreviewItem__info__fileName FilePreviewItem__info--disablePreview\">\n {name}\n </p>\n <Actions file={file} />\n </div>\n )}\n </div>\n);\n\nRawPreviewDefault.propTypes = {\n url: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n file: PropTypes.object.isRequired,\n disableFilePreview: PropTypes.bool.isRequired\n};\n\nexport { RawPreviewDefault };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,YAAY;AAEhC,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,GAAG;EAAEC,IAAI;EAAEC,IAAI;EAAEC;AAAmB,CAAC,kBAChEP,KAAA,CAAAQ,aAAA;EAAKC,SAAS,EAAC;AAAa,GACzB,CAACF,kBAAkB,gBAClBP,KAAA,CAAAQ,aAAA;EAAKC,SAAS,EAAC;AAAiB,gBAC9BT,KAAA,CAAAQ,aAAA;EAAKC,SAAS,EAAC;AAA0B,gBACvCT,KAAA,CAAAQ,aAAA;EAAKC,SAAS,EAAC,mCAAmC;EAACC,GAAG,EAAEN,GAAI;EAACO,GAAG,EAAEN;AAAK,CAAE,CACtE,CAAC,eACNL,KAAA,CAAAQ,aAAA;EAAKC,SAAS,EAAC;AAAuB,gBACpCT,KAAA,CAAAQ,aAAA;EAAGC,SAAS,EAAC;AAAiC,GAAEJ,IAAQ,CAAC,eACzDL,KAAA,CAAAQ,aAAA,CAACN,OAAO;EAACI,IAAI,EAAEA;AAAK,CAAE,CACnB,CACF,CAAC,gBAENN,KAAA,CAAAQ,aAAA;EAAKC,SAAS,EAAC;AAAuB,gBACpCT,KAAA,CAAAQ,aAAA;EAAGC,SAAS,EAAC;AAAuE,GACjFJ,IACA,CAAC,eACJL,KAAA,CAAAQ,aAAA,CAACN,OAAO;EAACI,IAAI,EAAEA;AAAK,CAAE,CACnB,CAEJ,CACN;AAEDH,iBAAiB,CAACS,SAAS,GAAG;EAC5BR,GAAG,EAAEH,SAAS,CAACY,MAAM,CAACC,UAAU;EAChCT,IAAI,EAAEJ,SAAS,CAACY,MAAM,CAACC,UAAU;EACjCR,IAAI,EAAEL,SAAS,CAACc,MAAM,CAACD,UAAU;EACjCP,kBAAkB,EAAEN,SAAS,CAACe,IAAI,CAACF;AACrC,CAAC;AAED,SAASX,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const DefaultIcon = () => /*#__PURE__*/React.createElement("svg", {
|
|
3
|
+
width: "24px",
|
|
4
|
+
height: "24px",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
version: "1.1",
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8
|
+
}, /*#__PURE__*/React.createElement("title", null, "gala:file-document"), /*#__PURE__*/React.createElement("g", {
|
|
9
|
+
id: "Subscribe",
|
|
10
|
+
stroke: "none",
|
|
11
|
+
strokeWidth: "1",
|
|
12
|
+
fill: "none",
|
|
13
|
+
fillRule: "evenodd"
|
|
14
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
15
|
+
id: "Desktop",
|
|
16
|
+
transform: "translate(-109.000000, -1998.000000)"
|
|
17
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
18
|
+
id: "gala:file-document",
|
|
19
|
+
transform: "translate(109.000000, 1998.000000)"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
21
|
+
id: "ViewBox",
|
|
22
|
+
x: "0",
|
|
23
|
+
y: "0",
|
|
24
|
+
width: "24",
|
|
25
|
+
height: "24"
|
|
26
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
27
|
+
id: "galaFileDocument0",
|
|
28
|
+
strokeLinecap: "round",
|
|
29
|
+
transform: "translate(2.953125, 1.453125)",
|
|
30
|
+
stroke: "#7C7D7E",
|
|
31
|
+
strokeWidth: "1.5"
|
|
32
|
+
}, /*#__PURE__*/React.createElement("line", {
|
|
33
|
+
x1: "0.05",
|
|
34
|
+
y1: "3.046875",
|
|
35
|
+
x2: "0.05",
|
|
36
|
+
y2: "18.0397125",
|
|
37
|
+
id: "galaFileDocument1"
|
|
38
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
39
|
+
x1: "18.05",
|
|
40
|
+
y1: "7.546875",
|
|
41
|
+
x2: "18.05",
|
|
42
|
+
y2: "18.046875",
|
|
43
|
+
id: "galaFileDocument2",
|
|
44
|
+
strokeLinejoin: "round"
|
|
45
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
46
|
+
x1: "3.046875",
|
|
47
|
+
y1: "0.05",
|
|
48
|
+
x2: "10.546875",
|
|
49
|
+
y2: "0.05",
|
|
50
|
+
id: "galaFileDocument3",
|
|
51
|
+
strokeLinejoin: "round"
|
|
52
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
53
|
+
x1: "3.046875",
|
|
54
|
+
y1: "21.05",
|
|
55
|
+
x2: "15.046875",
|
|
56
|
+
y2: "21.05",
|
|
57
|
+
id: "galaFileDocument4"
|
|
58
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
59
|
+
d: "M18.046875,18.046875 C18.0550688,19.5451584 16.546875,21.046875 15.046875,21.046875",
|
|
60
|
+
id: "galaFileDocument5",
|
|
61
|
+
strokeLinejoin: "round"
|
|
62
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
63
|
+
d: "M3.046875,18.046875 C3.046875,19.546875 1.546875,21.046875 0.046875,21.046875",
|
|
64
|
+
id: "galaFileDocument6",
|
|
65
|
+
strokeLinejoin: "round",
|
|
66
|
+
transform: "translate(1.546875, 19.546875) scale(-1, 1) translate(-1.546875, -19.546875) "
|
|
67
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
68
|
+
d: "M3.046875,0.0468751875 C3.046875,1.54469869 1.546875,3.0112935 0.046875,3.0446985",
|
|
69
|
+
id: "galaFileDocument7",
|
|
70
|
+
strokeLinejoin: "round",
|
|
71
|
+
transform: "translate(1.546875, 1.545787) rotate(180.000000) translate(-1.546875, -1.545787) "
|
|
72
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
73
|
+
x1: "18.0386784",
|
|
74
|
+
y1: "7.55360428",
|
|
75
|
+
x2: "10.546875",
|
|
76
|
+
y2: "0.046875",
|
|
77
|
+
id: "galaFileDocument8",
|
|
78
|
+
strokeLinejoin: "round"
|
|
79
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
80
|
+
d: "M13.546875,4.546875 C13.5422625,6.03871181 12.0408262,7.546875 10.546875,7.546875",
|
|
81
|
+
id: "galaFileDocument9",
|
|
82
|
+
strokeLinejoin: "round",
|
|
83
|
+
transform: "translate(12.046875, 6.046875) scale(-1, 1) translate(-12.046875, -6.046875) "
|
|
84
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
85
|
+
x1: "10.55",
|
|
86
|
+
y1: "4.546875",
|
|
87
|
+
x2: "10.55",
|
|
88
|
+
y2: "0.046875",
|
|
89
|
+
id: "galaFileDocumenta",
|
|
90
|
+
strokeLinejoin: "round"
|
|
91
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
92
|
+
x1: "13.546875",
|
|
93
|
+
y1: "7.55",
|
|
94
|
+
x2: "18.046875",
|
|
95
|
+
y2: "7.55",
|
|
96
|
+
id: "galaFileDocumentb",
|
|
97
|
+
strokeLinejoin: "round"
|
|
98
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
99
|
+
x1: "3.046875",
|
|
100
|
+
y1: "17.05",
|
|
101
|
+
x2: "7.546875",
|
|
102
|
+
y2: "17.05",
|
|
103
|
+
id: "galaFileDocumentc",
|
|
104
|
+
strokeLinejoin: "round"
|
|
105
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
106
|
+
x1: "3.046875",
|
|
107
|
+
y1: "14.05",
|
|
108
|
+
x2: "10.546875",
|
|
109
|
+
y2: "14.05",
|
|
110
|
+
id: "galaFileDocumentd",
|
|
111
|
+
strokeLinejoin: "round"
|
|
112
|
+
}), /*#__PURE__*/React.createElement("line", {
|
|
113
|
+
x1: "3.046875",
|
|
114
|
+
y1: "11.05",
|
|
115
|
+
x2: "7.546875",
|
|
116
|
+
y2: "11.05",
|
|
117
|
+
id: "galaFileDocumente",
|
|
118
|
+
strokeLinejoin: "round"
|
|
119
|
+
}))))));
|
|
120
|
+
export default DefaultIcon;
|
|
121
|
+
//# sourceMappingURL=DefaultIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultIcon.js","names":["React","DefaultIcon","createElement","width","height","viewBox","version","xmlns","id","stroke","strokeWidth","fill","fillRule","transform","x","y","strokeLinecap","x1","y1","x2","y2","strokeLinejoin","d"],"sources":["../../../../../src/components/FilePreview/previewDefault/icons/DefaultIcon.js"],"sourcesContent":["import React from 'react';\n\nconst DefaultIcon = () => (\n <svg\n width=\"24px\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <title>gala:file-document</title>\n <g id=\"Subscribe\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"Desktop\" transform=\"translate(-109.000000, -1998.000000)\">\n <g id=\"gala:file-document\" transform=\"translate(109.000000, 1998.000000)\">\n <rect id=\"ViewBox\" x=\"0\" y=\"0\" width=\"24\" height=\"24\" />\n <g\n id=\"galaFileDocument0\"\n strokeLinecap=\"round\"\n transform=\"translate(2.953125, 1.453125)\"\n stroke=\"#7C7D7E\"\n strokeWidth=\"1.5\">\n <line x1=\"0.05\" y1=\"3.046875\" x2=\"0.05\" y2=\"18.0397125\" id=\"galaFileDocument1\" />\n <line\n x1=\"18.05\"\n y1=\"7.546875\"\n x2=\"18.05\"\n y2=\"18.046875\"\n id=\"galaFileDocument2\"\n strokeLinejoin=\"round\"\n />\n <line\n x1=\"3.046875\"\n y1=\"0.05\"\n x2=\"10.546875\"\n y2=\"0.05\"\n id=\"galaFileDocument3\"\n strokeLinejoin=\"round\"\n />\n <line x1=\"3.046875\" y1=\"21.05\" x2=\"15.046875\" y2=\"21.05\" id=\"galaFileDocument4\" />\n <path\n d=\"M18.046875,18.046875 C18.0550688,19.5451584 16.546875,21.046875 15.046875,21.046875\"\n id=\"galaFileDocument5\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M3.046875,18.046875 C3.046875,19.546875 1.546875,21.046875 0.046875,21.046875\"\n id=\"galaFileDocument6\"\n strokeLinejoin=\"round\"\n transform=\"translate(1.546875, 19.546875) scale(-1, 1) translate(-1.546875, -19.546875) \"\n />\n <path\n d=\"M3.046875,0.0468751875 C3.046875,1.54469869 1.546875,3.0112935 0.046875,3.0446985\"\n id=\"galaFileDocument7\"\n strokeLinejoin=\"round\"\n transform=\"translate(1.546875, 1.545787) rotate(180.000000) translate(-1.546875, -1.545787) \"\n />\n <line\n x1=\"18.0386784\"\n y1=\"7.55360428\"\n x2=\"10.546875\"\n y2=\"0.046875\"\n id=\"galaFileDocument8\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M13.546875,4.546875 C13.5422625,6.03871181 12.0408262,7.546875 10.546875,7.546875\"\n id=\"galaFileDocument9\"\n strokeLinejoin=\"round\"\n transform=\"translate(12.046875, 6.046875) scale(-1, 1) translate(-12.046875, -6.046875) \"\n />\n <line\n x1=\"10.55\"\n y1=\"4.546875\"\n x2=\"10.55\"\n y2=\"0.046875\"\n id=\"galaFileDocumenta\"\n strokeLinejoin=\"round\"\n />\n <line\n x1=\"13.546875\"\n y1=\"7.55\"\n x2=\"18.046875\"\n y2=\"7.55\"\n id=\"galaFileDocumentb\"\n strokeLinejoin=\"round\"\n />\n <line\n x1=\"3.046875\"\n y1=\"17.05\"\n x2=\"7.546875\"\n y2=\"17.05\"\n id=\"galaFileDocumentc\"\n strokeLinejoin=\"round\"\n />\n <line\n x1=\"3.046875\"\n y1=\"14.05\"\n x2=\"10.546875\"\n y2=\"14.05\"\n id=\"galaFileDocumentd\"\n strokeLinejoin=\"round\"\n />\n <line\n x1=\"3.046875\"\n y1=\"11.05\"\n x2=\"7.546875\"\n y2=\"11.05\"\n id=\"galaFileDocumente\"\n strokeLinejoin=\"round\"\n />\n </g>\n </g>\n </g>\n </g>\n </svg>\n);\n\nexport default DefaultIcon;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,WAAW,GAAGA,CAAA,kBAClBD,KAAA,CAAAE,aAAA;EACEC,KAAK,EAAC,MAAM;EACZC,MAAM,EAAC,MAAM;EACbC,OAAO,EAAC,WAAW;EACnBC,OAAO,EAAC,KAAK;EACbC,KAAK,EAAC;AAA4B,gBAClCP,KAAA,CAAAE,aAAA,gBAAO,oBAAyB,CAAC,eACjCF,KAAA,CAAAE,aAAA;EAAGM,EAAE,EAAC,WAAW;EAACC,MAAM,EAAC,MAAM;EAACC,WAAW,EAAC,GAAG;EAACC,IAAI,EAAC,MAAM;EAACC,QAAQ,EAAC;AAAS,gBAC5EZ,KAAA,CAAAE,aAAA;EAAGM,EAAE,EAAC,SAAS;EAACK,SAAS,EAAC;AAAsC,gBAC9Db,KAAA,CAAAE,aAAA;EAAGM,EAAE,EAAC,oBAAoB;EAACK,SAAS,EAAC;AAAoC,gBACvEb,KAAA,CAAAE,aAAA;EAAMM,EAAE,EAAC,SAAS;EAACM,CAAC,EAAC,GAAG;EAACC,CAAC,EAAC,GAAG;EAACZ,KAAK,EAAC,IAAI;EAACC,MAAM,EAAC;AAAI,CAAE,CAAC,eACxDJ,KAAA,CAAAE,aAAA;EACEM,EAAE,EAAC,mBAAmB;EACtBQ,aAAa,EAAC,OAAO;EACrBH,SAAS,EAAC,+BAA+B;EACzCJ,MAAM,EAAC,SAAS;EAChBC,WAAW,EAAC;AAAK,gBACjBV,KAAA,CAAAE,aAAA;EAAMe,EAAE,EAAC,MAAM;EAACC,EAAE,EAAC,UAAU;EAACC,EAAE,EAAC,MA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oB,CAAC,EAAC,mFAAmF;EACrFd,EAAE,EAAC,mBAAmB;EACtBa,cAAc,EAAC,OAAO;EACtBR,SAAS,EAAC;AAA+E,CAC1F,CAAC,eACFb,KAAA,CAAAE,aAAA;EACEe,EAAE,EAAC,OAAO;EACVC,EAAE,EAAC,UAAU;EACbC,EAAE,EAAC,OAAO;EACVC,EAAE,EAAC,UAAU;EACbZ,EAAE,EAAC,mBAAmB;EACtBa,cAAc,EAAC;AAAO,CACvB,CAAC,eACFrB,KAAA,CAAAE,aAAA;EACEe,EAAE,EAAC,WAAW;EACdC,EAAE,EAAC,MAAM;EACTC,EAAE,EAAC,WAAW;EACdC,EAAE,EAAC,MAAM;EACTZ,EAAE,EAAC,mBAAmB;EACtBa,cAAc,EAAC;AAAO,CACvB,CAAC,eACFrB,KAAA,CAAAE,aAAA;EACEe,EAAE,EAAC,UAAU;EACbC,EAAE,EAAC,OAAO;EACVC,EAAE,EAAC,UAAU;EACbC,EAAE,EAAC,OAAO;EACVZ,EAAE,EAAC,mBAAmB;EACtBa,cAAc,EAAC;AAAO,CACvB,CAAC,eACFrB,KAAA,CAAAE,aAAA;EACEe,EAAE,EAAC,UAAU;EACbC,EAAE,EAAC,OAAO;EACVC,EAAE,EAAC,WAAW;EACdC,EAAE,EAAC,OAAO;EACVZ,EAAE,EAAC,mBAAmB;EACtBa,cAAc,EAAC;AAAO,CACvB,CAAC,eACFrB,KAAA,CAAAE,aAAA;EACEe,EAAE,EAAC,UAAU;EACbC,EAAE,EAAC,OAAO;EACVC,EAAE,EAAC,UAAU;EACbC,EAAE,EAAC,OAAO;EACVZ,EAAE,EAAC,mBAAmB;EACtBa,cAAc,EAAC;AAAO,CACvB,CACA,CACF,CACF,CACF,CACA,CACN;AAED,eAAepB,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["DefaultIcon"],"sources":["../../../../../src/components/FilePreview/previewDefault/icons/index.js"],"sourcesContent":["import DefaultIcon from './DefaultIcon';\n\nexport { DefaultIcon };\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AAEvC,SAASA,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RawPreviewDefault } from './RawPreviewDefault';
|
|
2
|
+
import { PreviewDefault } from './PreviewDefault';
|
|
3
|
+
import { previewDefaultSchema } from './previewDefaultSchema';
|
|
4
|
+
const previewDefault = {
|
|
5
|
+
component: {
|
|
6
|
+
card: PreviewDefault,
|
|
7
|
+
raw: RawPreviewDefault
|
|
8
|
+
},
|
|
9
|
+
schema: previewDefaultSchema
|
|
10
|
+
};
|
|
11
|
+
export { previewDefault };
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["RawPreviewDefault","PreviewDefault","previewDefaultSchema","previewDefault","component","card","raw","schema"],"sources":["../../../../src/components/FilePreview/previewDefault/index.js"],"sourcesContent":["import { RawPreviewDefault } from './RawPreviewDefault';\nimport { PreviewDefault } from './PreviewDefault';\nimport { previewDefaultSchema } from './previewDefaultSchema';\n\nconst previewDefault = {\n component: {\n card: PreviewDefault,\n raw: RawPreviewDefault\n },\n schema: previewDefaultSchema\n};\nexport { previewDefault };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,oBAAoB,QAAQ,wBAAwB;AAE7D,MAAMC,cAAc,GAAG;EACrBC,SAAS,EAAE;IACTC,IAAI,EAAEJ,cAAc;IACpBK,GAAG,EAAEN;EACP,CAAC;EACDO,MAAM,EAAEL;AACV,CAAC;AACD,SAASC,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const previewDefaultSchema = {
|
|
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
|
+
hrefUrl: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
format: 'uri-template',
|
|
15
|
+
label: 'url',
|
|
16
|
+
showInForm: true,
|
|
17
|
+
formFieldType: 'text',
|
|
18
|
+
description: 'Url format is not valid',
|
|
19
|
+
isDataPropery: true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
required: ['name']
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export { previewDefaultSchema };
|
|
26
|
+
//# sourceMappingURL=previewDefaultSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"previewDefaultSchema.js","names":["previewDefaultSchema","settings","formSchema","properties","name","type","showInForm","label","formFieldType","formPriority","hrefUrl","format","description","isDataPropery","required"],"sources":["../../../../src/components/FilePreview/previewDefault/previewDefaultSchema.js"],"sourcesContent":["const previewDefaultSchema = {\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 hrefUrl: {\n type: 'string',\n format: 'uri-template',\n label: 'url',\n showInForm: true,\n formFieldType: 'text',\n description: 'Url format is not valid',\n isDataPropery: true\n }\n },\n required: ['name']\n }\n};\n\nexport { previewDefaultSchema };\n"],"mappings":"AAAA,MAAMA,oBAAoB,GAAG;EAC3BC,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,OAAO,EAAE;QACPL,IAAI,EAAE,QAAQ;QACdM,MAAM,EAAE,cAAc;QACtBJ,KAAK,EAAE,KAAK;QACZD,UAAU,EAAE,IAAI;QAChBE,aAAa,EAAE,MAAM;QACrBI,WAAW,EAAE,yBAAyB;QACtCC,aAAa,EAAE;MACjB;IACF,CAAC;IACDC,QAAQ,EAAE,CAAC,MAAM;EACnB;AACF,CAAC;AAED,SAASd,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import FilePreviewList from './FilePreviewList';
|
|
4
|
+
const FileList = ({
|
|
5
|
+
selectedFiles,
|
|
6
|
+
children
|
|
7
|
+
}) => /*#__PURE__*/React.createElement(FilePreviewList, {
|
|
8
|
+
selectedFiles: selectedFiles
|
|
9
|
+
}, children);
|
|
10
|
+
FileList.propTypes = {
|
|
11
|
+
selectedFiles: PropTypes.array.isRequired,
|
|
12
|
+
children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string])
|
|
13
|
+
};
|
|
14
|
+
FileList.defaultProps = {
|
|
15
|
+
children: []
|
|
16
|
+
};
|
|
17
|
+
export default FileList;
|
|
18
|
+
//# sourceMappingURL=FileList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileList.js","names":["React","PropTypes","FilePreviewList","FileList","selectedFiles","children","createElement","propTypes","array","isRequired","oneOfType","object","string","defaultProps"],"sources":["../../../src/components/FilePreviewReadOnly/FileList.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport FilePreviewList from './FilePreviewList';\n\nconst FileList = ({ selectedFiles, children }) => (\n <FilePreviewList selectedFiles={selectedFiles}>{children}</FilePreviewList>\n);\n\nFileList.propTypes = {\n selectedFiles: PropTypes.array.isRequired,\n children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string])\n};\n\nFileList.defaultProps = {\n children: []\n};\n\nexport default FileList;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,MAAMC,QAAQ,GAAGA,CAAC;EAAEC,aAAa;EAAEC;AAAS,CAAC,kBAC3CL,KAAA,CAAAM,aAAA,CAACJ,eAAe;EAACE,aAAa,EAAEA;AAAc,GAAEC,QAA0B,CAC3E;AAEDF,QAAQ,CAACI,SAAS,GAAG;EACnBH,aAAa,EAAEH,SAAS,CAACO,KAAK,CAACC,UAAU;EACzCJ,QAAQ,EAAEJ,SAAS,CAACS,SAAS,CAAC,CAACT,SAAS,CAACO,KAAK,EAAEP,SAAS,CAACU,MAAM,EAAEV,SAAS,CAACW,MAAM,CAAC;AACrF,CAAC;AAEDT,QAAQ,CAACU,YAAY,GAAG;EACtBR,QAAQ,EAAE;AACZ,CAAC;AAED,eAAeF,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import FilePreview from '../FilePreview';
|
|
4
|
+
const FilePreviewList = ({
|
|
5
|
+
selectedFiles,
|
|
6
|
+
children
|
|
7
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
className: "FileUploadAdapter__preview"
|
|
9
|
+
}, selectedFiles.map(file => /*#__PURE__*/React.createElement(FilePreview, {
|
|
10
|
+
key: file.id,
|
|
11
|
+
file: file,
|
|
12
|
+
previewType: FilePreview.availablePreviewTypes.raw
|
|
13
|
+
})), children);
|
|
14
|
+
FilePreviewList.propTypes = {
|
|
15
|
+
selectedFiles: PropTypes.array.isRequired,
|
|
16
|
+
children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string])
|
|
17
|
+
};
|
|
18
|
+
FilePreviewList.defaultProps = {
|
|
19
|
+
children: []
|
|
20
|
+
};
|
|
21
|
+
export default FilePreviewList;
|
|
22
|
+
//# sourceMappingURL=FilePreviewList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilePreviewList.js","names":["React","PropTypes","FilePreview","FilePreviewList","selectedFiles","children","createElement","className","map","file","key","id","previewType","availablePreviewTypes","raw","propTypes","array","isRequired","oneOfType","object","string","defaultProps"],"sources":["../../../src/components/FilePreviewReadOnly/FilePreviewList.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport FilePreview from '../FilePreview';\n\nconst FilePreviewList = ({ selectedFiles, children }) => (\n <div className=\"FileUploadAdapter__preview\">\n {selectedFiles.map(file => (\n <FilePreview key={file.id} file={file} previewType={FilePreview.availablePreviewTypes.raw} />\n ))}\n {children}\n </div>\n);\n\nFilePreviewList.propTypes = {\n selectedFiles: PropTypes.array.isRequired,\n children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string])\n};\n\nFilePreviewList.defaultProps = {\n children: []\n};\n\nexport default FilePreviewList;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,WAAW,MAAM,gBAAgB;AAExC,MAAMC,eAAe,GAAGA,CAAC;EAAEC,aAAa;EAAEC;AAAS,CAAC,kBAClDL,KAAA,CAAAM,aAAA;EAAKC,SAAS,EAAC;AAA4B,GACxCH,aAAa,CAACI,GAAG,CAACC,IAAI,iBACrBT,KAAA,CAAAM,aAAA,CAACJ,WAAW;EAACQ,GAAG,EAAED,IAAI,CAACE,EAAG;EAACF,IAAI,EAAEA,IAAK;EAACG,WAAW,EAAEV,WAAW,CAACW,qBAAqB,CAACC;AAAI,CAAE,CAC7F,CAAC,EACDT,QACE,CACN;AAEDF,eAAe,CAACY,SAAS,GAAG;EAC1BX,aAAa,EAAEH,SAAS,CAACe,KAAK,CAACC,UAAU;EACzCZ,QAAQ,EAAEJ,SAAS,CAACiB,SAAS,CAAC,CAACjB,SAAS,CAACe,KAAK,EAAEf,SAAS,CAACkB,MAAM,EAAElB,SAAS,CAACmB,MAAM,CAAC;AACrF,CAAC;AAEDjB,eAAe,CAACkB,YAAY,GAAG;EAC7BhB,QAAQ,EAAE;AACZ,CAAC;AAED,eAAeF,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useApolloClient } from '@apollo/client';
|
|
4
|
+
import { getQuery } from '@blaze-cms/admin-ui-utils';
|
|
5
|
+
import FileList from './FileList';
|
|
6
|
+
import { formatInitialValue } from './mappers';
|
|
7
|
+
const FilePreviewReadOnly = ({
|
|
8
|
+
label,
|
|
9
|
+
id,
|
|
10
|
+
type,
|
|
11
|
+
value
|
|
12
|
+
}) => {
|
|
13
|
+
const initialValue = formatInitialValue({
|
|
14
|
+
value,
|
|
15
|
+
type
|
|
16
|
+
});
|
|
17
|
+
const [selectedFiles, setSelectedFiles] = useState([]);
|
|
18
|
+
const client = useApolloClient();
|
|
19
|
+
const getFiles = async (offset, ids) => {
|
|
20
|
+
if (!ids.length) return [];
|
|
21
|
+
const {
|
|
22
|
+
data: {
|
|
23
|
+
files = []
|
|
24
|
+
} = {}
|
|
25
|
+
} = await client.query({
|
|
26
|
+
query: getQuery('GET_FILES'),
|
|
27
|
+
variables: {
|
|
28
|
+
offset,
|
|
29
|
+
where: {
|
|
30
|
+
id: {
|
|
31
|
+
_in: ids
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
fetchPolicy: 'network-only'
|
|
36
|
+
});
|
|
37
|
+
return files;
|
|
38
|
+
};
|
|
39
|
+
const orderFiles = (files, ids) => ids.map(currentId => files.find(({
|
|
40
|
+
id: fileId
|
|
41
|
+
}) => fileId === currentId)).filter(Boolean);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
(async () => {
|
|
44
|
+
const files = await getFiles(0, initialValue);
|
|
45
|
+
const orderedFiles = orderFiles(files, initialValue);
|
|
46
|
+
setSelectedFiles(orderedFiles);
|
|
47
|
+
})();
|
|
48
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
|
+
}, []);
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
className: "form-field form-field--button"
|
|
52
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
53
|
+
htmlFor: id
|
|
54
|
+
}, label), selectedFiles.length > 0 && /*#__PURE__*/React.createElement(FileList, {
|
|
55
|
+
selectedFiles: selectedFiles
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
FilePreviewReadOnly.propTypes = {
|
|
59
|
+
label: PropTypes.string.isRequired,
|
|
60
|
+
id: PropTypes.string.isRequired,
|
|
61
|
+
type: PropTypes.string.isRequired,
|
|
62
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.array])
|
|
63
|
+
};
|
|
64
|
+
FilePreviewReadOnly.defaultProps = {
|
|
65
|
+
value: ''
|
|
66
|
+
};
|
|
67
|
+
export default FilePreviewReadOnly;
|
|
68
|
+
//# sourceMappingURL=FilePreviewReadOnly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilePreviewReadOnly.js","names":["React","useState","useEffect","PropTypes","useApolloClient","getQuery","FileList","formatInitialValue","FilePreviewReadOnly","label","id","type","value","initialValue","selectedFiles","setSelectedFiles","client","getFiles","offset","ids","length","data","files","query","variables","where","_in","fetchPolicy","orderFiles","map","currentId","find","fileId","filter","Boolean","orderedFiles","createElement","className","htmlFor","propTypes","string","isRequired","oneOfType","array","defaultProps"],"sources":["../../../src/components/FilePreviewReadOnly/FilePreviewReadOnly.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { useApolloClient } from '@apollo/client';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\nimport FileList from './FileList';\nimport { formatInitialValue } from './mappers';\n\nconst FilePreviewReadOnly = ({ label, id, type, value }) => {\n const initialValue = formatInitialValue({ value, type });\n const [selectedFiles, setSelectedFiles] = useState([]);\n const client = useApolloClient();\n\n const getFiles = async (offset, ids) => {\n if (!ids.length) return [];\n const { data: { files = [] } = {} } = await client.query({\n query: getQuery('GET_FILES'),\n variables: {\n offset,\n where: {\n id: { _in: ids }\n }\n },\n fetchPolicy: 'network-only'\n });\n return files;\n };\n\n const orderFiles = (files, ids) =>\n ids.map(currentId => files.find(({ id: fileId }) => fileId === currentId)).filter(Boolean);\n\n useEffect(() => {\n (async () => {\n const files = await getFiles(0, initialValue);\n const orderedFiles = orderFiles(files, initialValue);\n setSelectedFiles(orderedFiles);\n })();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div className=\"form-field form-field--button\">\n <label htmlFor={id}>{label}</label>\n {selectedFiles.length > 0 && <FileList selectedFiles={selectedFiles} />}\n </div>\n );\n};\n\nFilePreviewReadOnly.propTypes = {\n label: PropTypes.string.isRequired,\n id: PropTypes.string.isRequired,\n type: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.array])\n};\n\nFilePreviewReadOnly.defaultProps = {\n value: ''\n};\n\nexport default FilePreviewReadOnly;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,eAAe,QAAQ,gBAAgB;AAChD,SAASC,QAAQ,QAAQ,2BAA2B;AACpD,OAAOC,QAAQ,MAAM,YAAY;AACjC,SAASC,kBAAkB,QAAQ,WAAW;AAE9C,MAAMC,mBAAmB,GAAGA,CAAC;EAAEC,KAAK;EAAEC,EAAE;EAAEC,IAAI;EAAEC;AAAM,CAAC,KAAK;EAC1D,MAAMC,YAAY,GAAGN,kBAAkB,CAAC;IAAEK,KAAK;IAAED;EAAK,CAAC,CAAC;EACxD,MAAM,CAACG,aAAa,EAAEC,gBAAgB,CAAC,GAAGd,QAAQ,CAAC,EAAE,CAAC;EACtD,MAAMe,MAAM,GAAGZ,eAAe,CAAC,CAAC;EAEhC,MAAMa,QAAQ,GAAG,MA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AAmB,CAAC+B,SAAS,GAAG;EAC9B9B,KAAK,EAAEN,SAAS,CAACqC,MAAM,CAACC,UAAU;EAClC/B,EAAE,EAAEP,SAAS,CAACqC,MAAM,CAACC,UAAU;EAC/B9B,IAAI,EAAER,SAAS,CAACqC,MAAM,CAACC,UAAU;EACjC7B,KAAK,EAAET,SAAS,CAACuC,SAAS,CAAC,CAACvC,SAAS,CAACqC,MAAM,EAAErC,SAAS,CAACwC,KAAK,CAAC;AAChE,CAAC;AAEDnC,mBAAmB,CAACoC,YAAY,GAAG;EACjChC,KAAK,EAAE;AACT,CAAC;AAED,eAAeJ,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["FilePreviewReadOnly"],"sources":["../../../src/components/FilePreviewReadOnly/index.js"],"sourcesContent":["import FilePreviewReadOnly from './FilePreviewReadOnly';\n\nexport default FilePreviewReadOnly;\n"],"mappings":"AAAA,OAAOA,mBAAmB,MAAM,uBAAuB;AAEvD,eAAeA,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const formatInitialValue = ({
|
|
2
|
+
value,
|
|
3
|
+
type
|
|
4
|
+
}) => {
|
|
5
|
+
const parsedValue = value && type === 'array' ? value : [value];
|
|
6
|
+
const existValue = parsedValue.filter(Boolean).length;
|
|
7
|
+
if (!parsedValue || !existValue) return [];
|
|
8
|
+
return parsedValue;
|
|
9
|
+
};
|
|
10
|
+
export { formatInitialValue };
|
|
11
|
+
//# sourceMappingURL=format-initial-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-initial-value.js","names":["formatInitialValue","value","type","parsedValue","existValue","filter","Boolean","length"],"sources":["../../../../src/components/FilePreviewReadOnly/mappers/format-initial-value.js"],"sourcesContent":["const formatInitialValue = ({ value, type }) => {\n const parsedValue = value && type === 'array' ? value : [value];\n const existValue = parsedValue.filter(Boolean).length;\n if (!parsedValue || !existValue) return [];\n return parsedValue;\n};\n\nexport { formatInitialValue };\n"],"mappings":"AAAA,MAAMA,kBAAkB,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAK,CAAC,KAAK;EAC9C,MAAMC,WAAW,GAAGF,KAAK,IAAIC,IAAI,KAAK,OAAO,GAAGD,KAAK,GAAG,CAACA,KAAK,CAAC;EAC/D,MAAMG,UAAU,GAAGD,WAAW,CAACE,MAAM,CAACC,OAAO,CAAC,CAACC,MAAM;EACrD,IAAI,CAACJ,WAAW,IAAI,CAACC,UAAU,EAAE,OAAO,EAAE;EAC1C,OAAOD,WAAW;AACpB,CAAC;AAED,SAASH,kBAAkB","ignoreList":[]}
|