@blaze-cms/plugin-media-ui 0.146.0-node18-core-styles-tooltips.3 → 0.146.0-node18-core-styles-tooltips.5
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 +19 -0
- package/lib/components/CardMedia/CardMedia.js +15 -5
- package/lib/components/CardMedia/CardMedia.js.map +1 -1
- package/lib/components/EditMediaFile/EditMediaFile.js +11 -6
- package/lib/components/EditMediaFile/EditMediaFile.js.map +1 -1
- package/lib/components/EditMediaFile/EditMediaFilePage.js +3 -2
- package/lib/components/EditMediaFile/EditMediaFilePage.js.map +1 -1
- package/lib/components/FilePreview/Image/Image.js +10 -5
- package/lib/components/FilePreview/Image/Image.js.map +1 -1
- package/lib/components/FilePreview/ModalContext.js +10 -0
- package/lib/components/FilePreview/ModalContext.js.map +1 -0
- package/lib/components/FilePreview/index.js +8 -4
- package/lib/components/FilePreview/index.js.map +1 -1
- package/lib/components/FileUploadAdapter/FileUploadAdapter.js +4 -3
- package/lib/components/FileUploadAdapter/FileUploadAdapter.js.map +1 -1
- package/lib/components/FileUploadModal/FileUploadModal.js +1 -1
- package/lib/components/FileUploadModal/FileUploadModal.js.map +1 -1
- package/lib/components/ListingContainer/Listing/Listing.js +10 -5
- package/lib/components/ListingContainer/Listing/Listing.js.map +1 -1
- 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 +11 -3
- package/lib/components/ListingContainer/Listing/MediaListing/MediaListing.js.map +1 -1
- package/lib/components/ListingContainer/ListingContainer.js +8 -4
- package/lib/components/ListingContainer/ListingContainer.js.map +1 -1
- package/lib-es/components/CardMedia/CardMedia.js +15 -5
- package/lib-es/components/CardMedia/CardMedia.js.map +1 -1
- package/lib-es/components/EditMediaFile/EditMediaFile.js +11 -6
- package/lib-es/components/EditMediaFile/EditMediaFile.js.map +1 -1
- package/lib-es/components/EditMediaFile/EditMediaFilePage.js +3 -2
- package/lib-es/components/EditMediaFile/EditMediaFilePage.js.map +1 -1
- package/lib-es/components/FilePreview/Image/Image.js +10 -5
- package/lib-es/components/FilePreview/Image/Image.js.map +1 -1
- package/lib-es/components/FilePreview/ModalContext.js +3 -0
- package/lib-es/components/FilePreview/ModalContext.js.map +1 -0
- package/lib-es/components/FilePreview/index.js +8 -4
- package/lib-es/components/FilePreview/index.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/FileUploadAdapter.js +4 -3
- package/lib-es/components/FileUploadAdapter/FileUploadAdapter.js.map +1 -1
- package/lib-es/components/FileUploadModal/FileUploadModal.js +1 -1
- package/lib-es/components/FileUploadModal/FileUploadModal.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/Listing.js +10 -5
- package/lib-es/components/ListingContainer/Listing/Listing.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +9 -5
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaListing.js +12 -3
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaListing.js.map +1 -1
- package/lib-es/components/ListingContainer/ListingContainer.js +8 -4
- package/lib-es/components/ListingContainer/ListingContainer.js.map +1 -1
- package/package.json +5 -5
- package/src/components/CardMedia/CardMedia.js +22 -7
- package/src/components/EditMediaFile/EditMediaFile.js +29 -5
- package/src/components/EditMediaFile/EditMediaFilePage.js +2 -1
- package/src/components/FilePreview/Image/Image.js +10 -4
- package/src/components/FilePreview/ModalContext.js +3 -0
- package/src/components/FilePreview/index.js +8 -4
- package/src/components/FileUploadAdapter/FileUploadAdapter.js +3 -2
- package/src/components/FileUploadModal/FileUploadModal.js +1 -1
- package/src/components/ListingContainer/Listing/Listing.js +8 -5
- package/src/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +8 -4
- package/src/components/ListingContainer/Listing/MediaListing/MediaListing.js +10 -2
- package/src/components/ListingContainer/ListingContainer.js +7 -3
|
@@ -9,7 +9,8 @@ const FilePreview = ({
|
|
|
9
9
|
displayForm,
|
|
10
10
|
previewType,
|
|
11
11
|
children,
|
|
12
|
-
handleChangeFile
|
|
12
|
+
handleChangeFile,
|
|
13
|
+
showChangeButton
|
|
13
14
|
}) => {
|
|
14
15
|
const { name, url, mimetype, data, store } = file;
|
|
15
16
|
const [Preview, schema] = getPreview({ mimetype, previewType });
|
|
@@ -36,7 +37,8 @@ const FilePreview = ({
|
|
|
36
37
|
name={name}
|
|
37
38
|
{...data}
|
|
38
39
|
file={file}
|
|
39
|
-
handleChangeFile={handleChangeFile}
|
|
40
|
+
handleChangeFile={handleChangeFile}
|
|
41
|
+
showChangeButton={showChangeButton}>
|
|
40
42
|
{shouldRenderForm && (
|
|
41
43
|
<div className="preview__details">
|
|
42
44
|
<div className="preview__filename">{file.filename}</div>
|
|
@@ -67,7 +69,8 @@ FilePreview.propTypes = {
|
|
|
67
69
|
displayForm: PropTypes.bool,
|
|
68
70
|
handlers: PropTypes.object,
|
|
69
71
|
previewType: PropTypes.oneOf(Object.keys(FilePreview.availablePreviewTypes)),
|
|
70
|
-
children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string])
|
|
72
|
+
children: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string]),
|
|
73
|
+
showChangeButton: PropTypes.bool
|
|
71
74
|
};
|
|
72
75
|
|
|
73
76
|
FilePreview.defaultProps = {
|
|
@@ -77,7 +80,8 @@ FilePreview.defaultProps = {
|
|
|
77
80
|
previewType: FilePreview.availablePreviewTypes.card,
|
|
78
81
|
handleFormChange: () => {},
|
|
79
82
|
handleChangeFile: () => {},
|
|
80
|
-
children: []
|
|
83
|
+
children: [],
|
|
84
|
+
showChangeButton: false
|
|
81
85
|
};
|
|
82
86
|
|
|
83
87
|
export default FilePreview;
|
|
@@ -197,7 +197,7 @@ const FileUploadAdapter = ({
|
|
|
197
197
|
modifiers: ['cancel']
|
|
198
198
|
},
|
|
199
199
|
{
|
|
200
|
-
textButton: '
|
|
200
|
+
textButton: 'Apply',
|
|
201
201
|
callback: () => {
|
|
202
202
|
closeModalAndSetValue(true);
|
|
203
203
|
},
|
|
@@ -214,7 +214,7 @@ const FileUploadAdapter = ({
|
|
|
214
214
|
modifiers: ['cancel']
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
|
-
textButton: '
|
|
217
|
+
textButton: 'Apply',
|
|
218
218
|
callback: async () => {
|
|
219
219
|
const { name, id: editedFileId, data } = editFile;
|
|
220
220
|
const updatedSelectedFiles = selectedFiles.map(selectedFile => {
|
|
@@ -349,6 +349,7 @@ const FileUploadAdapter = ({
|
|
|
349
349
|
handleSelectedFiles={handleSelectedFiles}
|
|
350
350
|
maxItems={currentLimit}
|
|
351
351
|
filesSelected={currentValue.length > 1 ? currentValue : []}
|
|
352
|
+
openEditInModal
|
|
352
353
|
/>
|
|
353
354
|
</Modal>
|
|
354
355
|
</div>
|
|
@@ -13,7 +13,8 @@ const Listing = ({
|
|
|
13
13
|
getSelectedFiles,
|
|
14
14
|
setDisplayFileUploadModal,
|
|
15
15
|
closeModalAndSetValue,
|
|
16
|
-
simpleLayout
|
|
16
|
+
simpleLayout,
|
|
17
|
+
openEditInModal
|
|
17
18
|
}) => (
|
|
18
19
|
<div className="page">
|
|
19
20
|
{displayFileUploadModal && (
|
|
@@ -36,7 +37,7 @@ const Listing = ({
|
|
|
36
37
|
onClick={() => {
|
|
37
38
|
handleDisplayFileUploadModal(true);
|
|
38
39
|
}}>
|
|
39
|
-
|
|
40
|
+
Upload
|
|
40
41
|
</Button>
|
|
41
42
|
<More displayBg>
|
|
42
43
|
<More.Avatar isMoreMenu>
|
|
@@ -48,7 +49,7 @@ const Listing = ({
|
|
|
48
49
|
</PageHeader>
|
|
49
50
|
<div className="page__content page__content--with-side-panel">
|
|
50
51
|
<FilterPanel />
|
|
51
|
-
<MediaListing />
|
|
52
|
+
<MediaListing openEditInModal={openEditInModal} />
|
|
52
53
|
</div>
|
|
53
54
|
</>
|
|
54
55
|
)}
|
|
@@ -61,13 +62,15 @@ Listing.propTypes = {
|
|
|
61
62
|
simpleLayout: PropTypes.bool,
|
|
62
63
|
setDisplayFileUploadModal: PropTypes.func.isRequired,
|
|
63
64
|
displayFileUploadModal: PropTypes.bool.isRequired,
|
|
64
|
-
closeModalAndSetValue: PropTypes.func
|
|
65
|
+
closeModalAndSetValue: PropTypes.func,
|
|
66
|
+
openEditInModal: PropTypes.bool
|
|
65
67
|
};
|
|
66
68
|
|
|
67
69
|
Listing.defaultProps = {
|
|
68
70
|
closeModalAndSetValue: () => {},
|
|
69
71
|
handleDisplayFileUploadModal: () => {},
|
|
70
|
-
simpleLayout: false
|
|
72
|
+
simpleLayout: false,
|
|
73
|
+
openEditInModal: false
|
|
71
74
|
};
|
|
72
75
|
|
|
73
76
|
export default Listing;
|
|
@@ -18,7 +18,8 @@ const MediaFileList = ({
|
|
|
18
18
|
setDisplayCardPrompt,
|
|
19
19
|
displayLayout,
|
|
20
20
|
wrapperRef,
|
|
21
|
-
modalTargetRef
|
|
21
|
+
modalTargetRef,
|
|
22
|
+
openEditInModal
|
|
22
23
|
}) => {
|
|
23
24
|
const [currentListIndex, setCurrentListIndex] = useState(1);
|
|
24
25
|
const [verifiedRanges, setVerifiedRanges] = useState([]);
|
|
@@ -127,6 +128,7 @@ const MediaFileList = ({
|
|
|
127
128
|
id={id}
|
|
128
129
|
index={index}
|
|
129
130
|
removeFile={removeFile}
|
|
131
|
+
openEditInModal={openEditInModal}
|
|
130
132
|
/>
|
|
131
133
|
</div>
|
|
132
134
|
);
|
|
@@ -137,7 +139,7 @@ const MediaFileList = ({
|
|
|
137
139
|
{displayCardPrompt && (
|
|
138
140
|
<CardPrompt>
|
|
139
141
|
<Button onClick={onClickPrompt} className="button button--rounded button--cta">
|
|
140
|
-
|
|
142
|
+
Upload
|
|
141
143
|
</Button>
|
|
142
144
|
</CardPrompt>
|
|
143
145
|
)}
|
|
@@ -150,11 +152,13 @@ MediaFileList.propTypes = {
|
|
|
150
152
|
displayCardPrompt: PropTypes.bool,
|
|
151
153
|
displayLayout: PropTypes.string.isRequired,
|
|
152
154
|
wrapperRef: PropTypes.object.isRequired,
|
|
153
|
-
modalTargetRef: PropTypes.object.isRequired
|
|
155
|
+
modalTargetRef: PropTypes.object.isRequired,
|
|
156
|
+
openEditInModal: PropTypes.bool
|
|
154
157
|
};
|
|
155
158
|
|
|
156
159
|
MediaFileList.defaultProps = {
|
|
157
|
-
displayCardPrompt: true
|
|
160
|
+
displayCardPrompt: true,
|
|
161
|
+
openEditInModal: false
|
|
158
162
|
};
|
|
159
163
|
|
|
160
164
|
export default MediaFileList;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
1
2
|
import React, { useState, useRef } from 'react';
|
|
2
3
|
import MediaFileList from './MediaFileList';
|
|
3
4
|
|
|
4
|
-
const MediaListing = () => {
|
|
5
|
+
const MediaListing = ({ openEditInModal }) => {
|
|
5
6
|
const [displayCardPrompt, setDisplayCardPrompt] = useState(false);
|
|
6
7
|
const mediaFileListWrapperRef = useRef();
|
|
7
8
|
const modalTargetRef = useRef();
|
|
@@ -15,6 +16,7 @@ const MediaListing = () => {
|
|
|
15
16
|
displayCardPrompt={displayCardPrompt}
|
|
16
17
|
setDisplayCardPrompt={setDisplayCardPrompt}
|
|
17
18
|
displayLayout="list"
|
|
19
|
+
openEditInModal={openEditInModal}
|
|
18
20
|
/>
|
|
19
21
|
</div>
|
|
20
22
|
{/* render edit card modal outside of the virtual list */}
|
|
@@ -23,6 +25,12 @@ const MediaListing = () => {
|
|
|
23
25
|
);
|
|
24
26
|
};
|
|
25
27
|
|
|
26
|
-
MediaListing.propTypes = {
|
|
28
|
+
MediaListing.propTypes = {
|
|
29
|
+
openEditInModal: PropTypes.bool
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
MediaListing.defaultProps = {
|
|
33
|
+
openEditInModal: false
|
|
34
|
+
};
|
|
27
35
|
|
|
28
36
|
export default MediaListing;
|
|
@@ -16,7 +16,8 @@ const ListingContainer = ({
|
|
|
16
16
|
displayFileUploadModal,
|
|
17
17
|
setDisplayFileUploadModal,
|
|
18
18
|
closeModalAndSetValue,
|
|
19
|
-
simpleLayout
|
|
19
|
+
simpleLayout,
|
|
20
|
+
openEditInModal
|
|
20
21
|
}) => {
|
|
21
22
|
const [selectedFiles, setSelectedFiles] = useState(filesSelected || []);
|
|
22
23
|
const [selectedFilter, setSelectedFilter] = useState({
|
|
@@ -82,6 +83,7 @@ const ListingContainer = ({
|
|
|
82
83
|
handleDisplayFileUploadModal={handleDisplayFileUploadModal}
|
|
83
84
|
setSelectedFiles={setSelectedFiles}
|
|
84
85
|
handleSelectedFiles={handleSelectedFiles}
|
|
86
|
+
openEditInModal={openEditInModal}
|
|
85
87
|
/>
|
|
86
88
|
</FilesListProvider>
|
|
87
89
|
</MediaContextProvider>
|
|
@@ -96,7 +98,8 @@ ListingContainer.propTypes = {
|
|
|
96
98
|
simpleLayout: PropTypes.bool,
|
|
97
99
|
setDisplayFileUploadModal: PropTypes.func.isRequired,
|
|
98
100
|
displayFileUploadModal: PropTypes.bool.isRequired,
|
|
99
|
-
closeModalAndSetValue: PropTypes.func
|
|
101
|
+
closeModalAndSetValue: PropTypes.func,
|
|
102
|
+
openEditInModal: PropTypes.bool
|
|
100
103
|
};
|
|
101
104
|
|
|
102
105
|
ListingContainer.defaultProps = {
|
|
@@ -104,7 +107,8 @@ ListingContainer.defaultProps = {
|
|
|
104
107
|
handleSelectedFiles: () => {},
|
|
105
108
|
maxItems: false,
|
|
106
109
|
filesSelected: [],
|
|
107
|
-
simpleLayout: false
|
|
110
|
+
simpleLayout: false,
|
|
111
|
+
openEditInModal: false
|
|
108
112
|
};
|
|
109
113
|
|
|
110
114
|
export default ListingContainer;
|