@micromag/media-gallery 0.3.423 → 0.3.430
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/assets/css/styles.css +5 -5
- package/es/index.js +2 -4
- package/lib/index.js +349 -365
- package/package.json +8 -5
package/lib/index.js
CHANGED
|
@@ -29,20 +29,6 @@ var faSearch = require('@fortawesome/free-solid-svg-icons/faSearch');
|
|
|
29
29
|
var faSpinner = require('@fortawesome/free-solid-svg-icons/faSpinner');
|
|
30
30
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
31
31
|
|
|
32
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
33
|
-
|
|
34
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
35
|
-
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
36
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
37
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
38
|
-
var isArray__default = /*#__PURE__*/_interopDefaultLegacy(isArray);
|
|
39
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
40
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
41
|
-
var uniqBy__default = /*#__PURE__*/_interopDefaultLegacy(uniqBy);
|
|
42
|
-
var prettyBytes__default = /*#__PURE__*/_interopDefaultLegacy(prettyBytes);
|
|
43
|
-
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
44
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
45
|
-
|
|
46
32
|
var middleEllipsis = function middleEllipsis(string, maxLength) {
|
|
47
33
|
if (!string) return string;
|
|
48
34
|
if (maxLength < 1) return string;
|
|
@@ -59,13 +45,13 @@ var styles$b = {"container":"micromag-media-gallery-items-gallery-item-container
|
|
|
59
45
|
|
|
60
46
|
var propTypes$b = {
|
|
61
47
|
item: core.PropTypes.media,
|
|
62
|
-
width:
|
|
63
|
-
selected:
|
|
64
|
-
withInfoButton:
|
|
65
|
-
className:
|
|
66
|
-
onClick:
|
|
67
|
-
onClickInfo:
|
|
68
|
-
onClickRemove:
|
|
48
|
+
width: PropTypes.number,
|
|
49
|
+
selected: PropTypes.bool,
|
|
50
|
+
withInfoButton: PropTypes.bool,
|
|
51
|
+
className: PropTypes.string,
|
|
52
|
+
onClick: PropTypes.func,
|
|
53
|
+
onClickInfo: PropTypes.func,
|
|
54
|
+
onClickRemove: PropTypes.func
|
|
69
55
|
};
|
|
70
56
|
var defaultProps$b = {
|
|
71
57
|
item: null,
|
|
@@ -78,7 +64,6 @@ var defaultProps$b = {
|
|
|
78
64
|
onClickRemove: null
|
|
79
65
|
};
|
|
80
66
|
var GalleryItem = function GalleryItem(_ref) {
|
|
81
|
-
var _ref2;
|
|
82
67
|
var item = _ref.item,
|
|
83
68
|
width = _ref.width,
|
|
84
69
|
selected = _ref.selected,
|
|
@@ -98,46 +83,46 @@ var GalleryItem = function GalleryItem(_ref) {
|
|
|
98
83
|
} else {
|
|
99
84
|
title = middleEllipsis(name, Math.floor(Math.max(25, width / 3 / 8)));
|
|
100
85
|
}
|
|
101
|
-
return /*#__PURE__*/
|
|
102
|
-
image: /*#__PURE__*/
|
|
103
|
-
className:
|
|
86
|
+
return /*#__PURE__*/React.createElement(components.Card, {
|
|
87
|
+
image: /*#__PURE__*/React.createElement("button", {
|
|
88
|
+
className: classNames(['d-block', 'position-relative', 'p-0', 'border-0', 'w-100', 'text-start', 'bg-dark', 'text-black', styles$b.imageButton]),
|
|
104
89
|
type: "button",
|
|
105
90
|
onClick: onClick
|
|
106
|
-
}, /*#__PURE__*/
|
|
107
|
-
className:
|
|
91
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: classNames(['card-img-top', styles$b.image]),
|
|
108
93
|
style: {
|
|
109
94
|
backgroundImage: thumbnail !== null ? "url('".concat(thumbnail, "')") : null
|
|
110
95
|
}
|
|
111
96
|
})),
|
|
112
|
-
beforeBody: /*#__PURE__*/
|
|
97
|
+
beforeBody: /*#__PURE__*/React.createElement(React.Fragment, null, withInfoButton ? /*#__PURE__*/React.createElement(components.Button, {
|
|
113
98
|
className: styles$b.infoButton,
|
|
114
99
|
onClick: onClickInfo,
|
|
115
100
|
withoutStyle: true
|
|
116
|
-
}, /*#__PURE__*/
|
|
101
|
+
}, /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
117
102
|
icon: faInfoCircle.faInfoCircle,
|
|
118
103
|
className: styles$b.icon
|
|
119
|
-
})) : null, selected ? /*#__PURE__*/
|
|
120
|
-
className:
|
|
104
|
+
})) : null, selected ? /*#__PURE__*/React.createElement(components.Button, {
|
|
105
|
+
className: classNames(['text-danger', styles$b.closeButton]),
|
|
121
106
|
onClick: onClickRemove,
|
|
122
107
|
withoutStyle: true
|
|
123
|
-
}, /*#__PURE__*/
|
|
108
|
+
}, /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
124
109
|
icon: faTimesCircle.faTimesCircle,
|
|
125
110
|
className: styles$b.icon
|
|
126
111
|
})) : null),
|
|
127
|
-
footer: /*#__PURE__*/
|
|
112
|
+
footer: /*#__PURE__*/React.createElement(React.Fragment, null, type === 'video' ? /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
128
113
|
className: styles$b.icon,
|
|
129
114
|
icon: faPlayCircle.faPlayCircle
|
|
130
|
-
}) : null, type === 'audio' ? /*#__PURE__*/
|
|
115
|
+
}) : null, type === 'audio' ? /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
131
116
|
className: styles$b.icon,
|
|
132
117
|
icon: faHeadphonesAlt.faHeadphonesAlt
|
|
133
|
-
}) : null, /*#__PURE__*/
|
|
134
|
-
className:
|
|
135
|
-
}, /*#__PURE__*/
|
|
118
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
className: classNames(['text-truncate', styles$b.label])
|
|
120
|
+
}, /*#__PURE__*/React.createElement("small", null, title), size !== null ? /*#__PURE__*/React.createElement("small", {
|
|
136
121
|
className: "text-muted ms-1"
|
|
137
122
|
}, size) : null)),
|
|
138
123
|
theme: selected ? null : null,
|
|
139
|
-
className:
|
|
140
|
-
footerClassName:
|
|
124
|
+
className: classNames([styles$b.container, _defineProperty(_defineProperty({}, styles$b.selected, selected), className, className !== null)]),
|
|
125
|
+
footerClassName: classNames(['p-1', styles$b.footer]),
|
|
141
126
|
onClickFooter: onClick
|
|
142
127
|
});
|
|
143
128
|
};
|
|
@@ -149,13 +134,13 @@ var styles$a = {};
|
|
|
149
134
|
var propTypes$a = {
|
|
150
135
|
items: core.PropTypes.medias,
|
|
151
136
|
selectedItem: core.PropTypes.media,
|
|
152
|
-
withInfoButton:
|
|
153
|
-
isSmall:
|
|
154
|
-
selectedFirst:
|
|
155
|
-
className:
|
|
156
|
-
onClickItem:
|
|
157
|
-
onClickItemInfo:
|
|
158
|
-
onClickRemoveItem:
|
|
137
|
+
withInfoButton: PropTypes.bool,
|
|
138
|
+
isSmall: PropTypes.bool,
|
|
139
|
+
selectedFirst: PropTypes.bool,
|
|
140
|
+
className: PropTypes.string,
|
|
141
|
+
onClickItem: PropTypes.func,
|
|
142
|
+
onClickItemInfo: PropTypes.func,
|
|
143
|
+
onClickRemoveItem: PropTypes.func
|
|
159
144
|
};
|
|
160
145
|
var defaultProps$a = {
|
|
161
146
|
items: null,
|
|
@@ -183,25 +168,25 @@ function Gallery(_ref) {
|
|
|
183
168
|
width = _useDimensionObserver.width;
|
|
184
169
|
var finalItems = React.useMemo(function () {
|
|
185
170
|
if (selectedFirst && selectedItem !== null && typeof selectedItem.id !== 'undefined') {
|
|
186
|
-
return [selectedItem].concat(
|
|
171
|
+
return [selectedItem].concat(_toConsumableArray(items.filter(function (_ref2) {
|
|
187
172
|
var id = _ref2.id;
|
|
188
173
|
return id !== selectedItem.id;
|
|
189
174
|
})));
|
|
190
175
|
}
|
|
191
176
|
return items;
|
|
192
177
|
}, [selectedFirst, selectedItem, items]);
|
|
193
|
-
return /*#__PURE__*/
|
|
194
|
-
className:
|
|
178
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
179
|
+
className: classNames([styles$a.container, 'p-2', 'pt-0', _defineProperty({}, className, className !== null)]),
|
|
195
180
|
ref: ref
|
|
196
|
-
}, /*#__PURE__*/
|
|
197
|
-
className:
|
|
181
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
182
|
+
className: classNames(['row', 'mx-n1', 'row-cols-2', {
|
|
198
183
|
'row-cols-md-3': !isSmall
|
|
199
184
|
}])
|
|
200
185
|
}, finalItems.map(function (item) {
|
|
201
|
-
return /*#__PURE__*/
|
|
186
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
202
187
|
className: "col px-1 py-1",
|
|
203
188
|
key: "gallery-item-".concat(item.id)
|
|
204
|
-
}, /*#__PURE__*/
|
|
189
|
+
}, /*#__PURE__*/React.createElement(GalleryItem, {
|
|
205
190
|
item: item,
|
|
206
191
|
width: width,
|
|
207
192
|
selected: selectedItem !== null && selectedItem.id === item.id,
|
|
@@ -226,11 +211,11 @@ var styles$9 = {"container":"micromag-media-gallery-partials-media-metadata-cont
|
|
|
226
211
|
var propTypes$9 = {
|
|
227
212
|
media: core.PropTypes.media,
|
|
228
213
|
tags: core.PropTypes.tags,
|
|
229
|
-
onChange:
|
|
230
|
-
onClickClose:
|
|
231
|
-
onClickSave:
|
|
232
|
-
onClickDelete:
|
|
233
|
-
className:
|
|
214
|
+
onChange: PropTypes.func,
|
|
215
|
+
onClickClose: PropTypes.func,
|
|
216
|
+
onClickSave: PropTypes.func,
|
|
217
|
+
onClickDelete: PropTypes.func,
|
|
218
|
+
className: PropTypes.string
|
|
234
219
|
};
|
|
235
220
|
var defaultProps$9 = {
|
|
236
221
|
media: null,
|
|
@@ -297,25 +282,25 @@ function MediaMetadata(_ref) {
|
|
|
297
282
|
};
|
|
298
283
|
}, []);
|
|
299
284
|
var finalTags = React.useMemo(function () {
|
|
300
|
-
return allTags !== null ?
|
|
285
|
+
return allTags !== null ? uniqBy(mediaTags.concat(allTags), function (_ref6) {
|
|
301
286
|
var id = _ref6.id;
|
|
302
287
|
return id;
|
|
303
288
|
}) : mediaTags;
|
|
304
289
|
}, [mediaTags, allTags]);
|
|
305
290
|
var _useState = React.useState(mediaName),
|
|
306
|
-
_useState2 =
|
|
291
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
307
292
|
name = _useState2[0],
|
|
308
293
|
setName = _useState2[1];
|
|
309
294
|
var _useState3 = React.useState(mediaDescription),
|
|
310
|
-
_useState4 =
|
|
295
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
311
296
|
description = _useState4[0],
|
|
312
297
|
setDescription = _useState4[1];
|
|
313
298
|
var _useState5 = React.useState(mediaTags.map(getOptionValue)),
|
|
314
|
-
_useState6 =
|
|
299
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
315
300
|
tags = _useState6[0],
|
|
316
301
|
setTags = _useState6[1];
|
|
317
302
|
var _useState7 = React.useState(false),
|
|
318
|
-
_useState8 =
|
|
303
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
319
304
|
changed = _useState8[0],
|
|
320
305
|
setChanged = _useState8[1];
|
|
321
306
|
var onTagChange = React.useCallback(function (val) {
|
|
@@ -331,7 +316,7 @@ function MediaMetadata(_ref) {
|
|
|
331
316
|
setChanged(true);
|
|
332
317
|
}, [tags, setDescription, setChanged]);
|
|
333
318
|
var _useState9 = React.useState(null),
|
|
334
|
-
_useState10 =
|
|
319
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
335
320
|
saveState = _useState10[0],
|
|
336
321
|
setSaveState = _useState10[1];
|
|
337
322
|
var onSave = React.useCallback(function () {
|
|
@@ -353,11 +338,11 @@ function MediaMetadata(_ref) {
|
|
|
353
338
|
});
|
|
354
339
|
}, [mediaId, name, tags, description, metadata, update, onChange, onClickSave, onClickClose, setChanged, setSaveState]);
|
|
355
340
|
var _useState11 = React.useState(null),
|
|
356
|
-
_useState12 =
|
|
341
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
357
342
|
deletedState = _useState12[0],
|
|
358
343
|
setDeletedState = _useState12[1];
|
|
359
344
|
var _useState13 = React.useState(null),
|
|
360
|
-
_useState14 =
|
|
345
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
361
346
|
confirmation = _useState14[0],
|
|
362
347
|
setConfirmation = _useState14[1];
|
|
363
348
|
React.useEffect(function () {
|
|
@@ -410,74 +395,74 @@ function MediaMetadata(_ref) {
|
|
|
410
395
|
}, [media, setTags, setName, setDescription, setChanged]);
|
|
411
396
|
var TextField = contexts.useFieldComponent('text');
|
|
412
397
|
var TokensField = contexts.useFieldComponent('tokens');
|
|
413
|
-
return /*#__PURE__*/
|
|
414
|
-
className:
|
|
415
|
-
}, /*#__PURE__*/
|
|
416
|
-
className:
|
|
398
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
399
|
+
className: classNames([styles$9.container, _defineProperty({}, className, className)])
|
|
400
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
401
|
+
className: classNames(['position-relative', _defineProperty({
|
|
417
402
|
'bg-light': type === 'audio',
|
|
418
403
|
'bg-black': type === 'image'
|
|
419
404
|
}, styles$9.video, type === 'video')])
|
|
420
|
-
}, type === 'video' ? /*#__PURE__*/
|
|
405
|
+
}, type === 'video' ? /*#__PURE__*/React.createElement("video", {
|
|
421
406
|
className: styles$9.player,
|
|
422
407
|
controls: true,
|
|
423
408
|
src: url
|
|
424
|
-
}) : null, type === 'audio' ? /*#__PURE__*/
|
|
409
|
+
}) : null, type === 'audio' ? /*#__PURE__*/React.createElement("div", {
|
|
425
410
|
className: styles$9.audio
|
|
426
|
-
}, /*#__PURE__*/
|
|
411
|
+
}, /*#__PURE__*/React.createElement("audio", {
|
|
427
412
|
className: styles$9.player,
|
|
428
413
|
controls: true,
|
|
429
414
|
src: url
|
|
430
|
-
})) : null, type !== 'video' && thumbnail !== null ? /*#__PURE__*/
|
|
415
|
+
})) : null, type !== 'video' && thumbnail !== null ? /*#__PURE__*/React.createElement("img", {
|
|
431
416
|
src: thumbnail,
|
|
432
417
|
className: styles$9.image,
|
|
433
418
|
alt: filename
|
|
434
|
-
}) : /*#__PURE__*/
|
|
419
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
435
420
|
className: styles$9.placeholder
|
|
436
|
-
})), /*#__PURE__*/
|
|
421
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
437
422
|
className: "p-2"
|
|
438
|
-
}, /*#__PURE__*/
|
|
423
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
439
424
|
className: "tags mb-4"
|
|
440
|
-
}, /*#__PURE__*/
|
|
425
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
441
426
|
className: "my-3"
|
|
442
|
-
}, /*#__PURE__*/
|
|
427
|
+
}, /*#__PURE__*/React.createElement("h6", null, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
443
428
|
id: "kBz8vF",
|
|
444
429
|
defaultMessage: [{
|
|
445
430
|
"type": 0,
|
|
446
431
|
"value": "Name"
|
|
447
432
|
}]
|
|
448
|
-
})), /*#__PURE__*/
|
|
433
|
+
})), /*#__PURE__*/React.createElement(TextField, {
|
|
449
434
|
value: name,
|
|
450
435
|
onChange: onNameChange
|
|
451
|
-
})), /*#__PURE__*/
|
|
436
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
452
437
|
className: "my-3"
|
|
453
|
-
}, /*#__PURE__*/
|
|
438
|
+
}, /*#__PURE__*/React.createElement("h6", {
|
|
454
439
|
className: "mb-0"
|
|
455
|
-
}, /*#__PURE__*/
|
|
440
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
456
441
|
id: "YJZtWR",
|
|
457
442
|
defaultMessage: [{
|
|
458
443
|
"type": 0,
|
|
459
444
|
"value": "Description"
|
|
460
445
|
}]
|
|
461
|
-
})), /*#__PURE__*/
|
|
446
|
+
})), /*#__PURE__*/React.createElement("p", {
|
|
462
447
|
className: "mb-1"
|
|
463
|
-
}, /*#__PURE__*/
|
|
448
|
+
}, /*#__PURE__*/React.createElement("small", null, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
464
449
|
id: "EDFyUp",
|
|
465
450
|
defaultMessage: [{
|
|
466
451
|
"type": 0,
|
|
467
452
|
"value": "Alternative text (accessibility)"
|
|
468
453
|
}]
|
|
469
|
-
}))), /*#__PURE__*/
|
|
454
|
+
}))), /*#__PURE__*/React.createElement(TextField, {
|
|
470
455
|
value: description,
|
|
471
456
|
onChange: onDescriptionChange
|
|
472
|
-
})), /*#__PURE__*/
|
|
457
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
473
458
|
className: "my-3"
|
|
474
|
-
}, /*#__PURE__*/
|
|
459
|
+
}, /*#__PURE__*/React.createElement("h6", null, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
475
460
|
id: "4fHMVj",
|
|
476
461
|
defaultMessage: [{
|
|
477
462
|
"type": 0,
|
|
478
463
|
"value": "Tags"
|
|
479
464
|
}]
|
|
480
|
-
})), /*#__PURE__*/
|
|
465
|
+
})), /*#__PURE__*/React.createElement(TokensField, {
|
|
481
466
|
value: tags,
|
|
482
467
|
options: finalTags
|
|
483
468
|
// loadOptions={loadTags}
|
|
@@ -486,178 +471,178 @@ function MediaMetadata(_ref) {
|
|
|
486
471
|
getOptionValue: getOptionValue,
|
|
487
472
|
getNewOptionData: getNewOptionData,
|
|
488
473
|
onChange: onTagChange
|
|
489
|
-
})), changed ? /*#__PURE__*/
|
|
474
|
+
})), changed ? /*#__PURE__*/React.createElement(components.Button, {
|
|
490
475
|
theme: "primary",
|
|
491
476
|
onClick: onSave
|
|
492
|
-
}, /*#__PURE__*/
|
|
477
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
493
478
|
id: "qIw1nW",
|
|
494
479
|
defaultMessage: [{
|
|
495
480
|
"type": 0,
|
|
496
481
|
"value": "Save"
|
|
497
482
|
}]
|
|
498
|
-
})) : null, saveState === false ? /*#__PURE__*/
|
|
483
|
+
})) : null, saveState === false ? /*#__PURE__*/React.createElement("p", {
|
|
499
484
|
className: "pt-1 text-danger"
|
|
500
|
-
}, /*#__PURE__*/
|
|
485
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
501
486
|
id: "DYjRd/",
|
|
502
487
|
defaultMessage: [{
|
|
503
488
|
"type": 0,
|
|
504
489
|
"value": "Sorry, this media could not be saved."
|
|
505
490
|
}]
|
|
506
|
-
})) : null), /*#__PURE__*/
|
|
491
|
+
})) : null), /*#__PURE__*/React.createElement("h6", null, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
507
492
|
id: "c9VwT/",
|
|
508
493
|
defaultMessage: [{
|
|
509
494
|
"type": 0,
|
|
510
495
|
"value": "Technical details"
|
|
511
496
|
}]
|
|
512
|
-
})), /*#__PURE__*/
|
|
497
|
+
})), /*#__PURE__*/React.createElement("ul", {
|
|
513
498
|
className: "list-group"
|
|
514
|
-
}, type !== null ? /*#__PURE__*/
|
|
499
|
+
}, type !== null ? /*#__PURE__*/React.createElement("li", {
|
|
515
500
|
className: "list-group-item py-2 px-2"
|
|
516
|
-
}, /*#__PURE__*/
|
|
501
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
517
502
|
className: "row"
|
|
518
|
-
}, /*#__PURE__*/
|
|
503
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
519
504
|
className: "col-4 text-muted"
|
|
520
|
-
}, /*#__PURE__*/
|
|
505
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
521
506
|
id: "OkNUmk",
|
|
522
507
|
defaultMessage: [{
|
|
523
508
|
"type": 0,
|
|
524
509
|
"value": "Type"
|
|
525
510
|
}]
|
|
526
|
-
})), /*#__PURE__*/
|
|
511
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
527
512
|
className: "col text-capitalize"
|
|
528
|
-
}, /*#__PURE__*/
|
|
513
|
+
}, /*#__PURE__*/React.createElement("small", null, type)))) : null, filename !== null ? /*#__PURE__*/React.createElement("li", {
|
|
529
514
|
className: "list-group-item py-2 px-2"
|
|
530
|
-
}, /*#__PURE__*/
|
|
515
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
531
516
|
className: "row"
|
|
532
|
-
}, /*#__PURE__*/
|
|
517
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
533
518
|
className: "col-4 text-muted"
|
|
534
|
-
}, /*#__PURE__*/
|
|
519
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
535
520
|
id: "aovRFH",
|
|
536
521
|
defaultMessage: [{
|
|
537
522
|
"type": 0,
|
|
538
523
|
"value": "Filename"
|
|
539
524
|
}]
|
|
540
|
-
})), /*#__PURE__*/
|
|
525
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
541
526
|
className: "col"
|
|
542
|
-
}, /*#__PURE__*/
|
|
527
|
+
}, /*#__PURE__*/React.createElement("small", null, filename)))) : null, duration ? /*#__PURE__*/React.createElement("li", {
|
|
543
528
|
className: "list-group-item py-2 px-2"
|
|
544
|
-
}, /*#__PURE__*/
|
|
529
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
545
530
|
className: "row"
|
|
546
|
-
}, /*#__PURE__*/
|
|
531
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
547
532
|
className: "col-4 text-muted"
|
|
548
|
-
}, /*#__PURE__*/
|
|
533
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
549
534
|
id: "eoW0tZ",
|
|
550
535
|
defaultMessage: [{
|
|
551
536
|
"type": 0,
|
|
552
537
|
"value": "Duration"
|
|
553
538
|
}]
|
|
554
|
-
})), /*#__PURE__*/
|
|
539
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
555
540
|
className: "col"
|
|
556
|
-
}, /*#__PURE__*/
|
|
541
|
+
}, /*#__PURE__*/React.createElement("small", null, duration)))) : null, width !== null || height !== null ? /*#__PURE__*/React.createElement("li", {
|
|
557
542
|
className: "list-group-item py-2 px-2"
|
|
558
|
-
}, /*#__PURE__*/
|
|
543
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
559
544
|
className: "row"
|
|
560
|
-
}, /*#__PURE__*/
|
|
545
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
561
546
|
className: "col-4 text-muted"
|
|
562
|
-
}, /*#__PURE__*/
|
|
547
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
563
548
|
id: "mv37oK",
|
|
564
549
|
defaultMessage: [{
|
|
565
550
|
"type": 0,
|
|
566
551
|
"value": "Dimension"
|
|
567
552
|
}]
|
|
568
|
-
})), /*#__PURE__*/
|
|
553
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
569
554
|
className: "col"
|
|
570
|
-
}, /*#__PURE__*/
|
|
555
|
+
}, /*#__PURE__*/React.createElement("small", null, width, "x", height)))) : null, size !== null ? /*#__PURE__*/React.createElement("li", {
|
|
571
556
|
className: "list-group-item py-2 px-2"
|
|
572
|
-
}, /*#__PURE__*/
|
|
557
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
573
558
|
className: "row"
|
|
574
|
-
}, /*#__PURE__*/
|
|
559
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
575
560
|
className: "col-4 text-muted"
|
|
576
|
-
}, /*#__PURE__*/
|
|
561
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
577
562
|
id: "liyV7Y",
|
|
578
563
|
defaultMessage: [{
|
|
579
564
|
"type": 0,
|
|
580
565
|
"value": "Size"
|
|
581
566
|
}]
|
|
582
|
-
})), /*#__PURE__*/
|
|
567
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
583
568
|
className: "col"
|
|
584
|
-
}, /*#__PURE__*/
|
|
569
|
+
}, /*#__PURE__*/React.createElement("small", null, prettyBytes(size))))) : null, description !== null ? /*#__PURE__*/React.createElement("li", {
|
|
585
570
|
className: "list-group-item py-2 px-2"
|
|
586
|
-
}, /*#__PURE__*/
|
|
571
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
587
572
|
className: "row"
|
|
588
|
-
}, /*#__PURE__*/
|
|
573
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
589
574
|
className: "col-4 text-muted"
|
|
590
|
-
}, /*#__PURE__*/
|
|
575
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
591
576
|
id: "7uyslu",
|
|
592
577
|
defaultMessage: [{
|
|
593
578
|
"type": 0,
|
|
594
579
|
"value": "Description"
|
|
595
580
|
}]
|
|
596
|
-
})), /*#__PURE__*/
|
|
581
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
597
582
|
className: "col"
|
|
598
|
-
}, /*#__PURE__*/
|
|
583
|
+
}, /*#__PURE__*/React.createElement("small", null, description)))) : null, user !== null && user.name ? /*#__PURE__*/React.createElement("li", {
|
|
599
584
|
className: "list-group-item py-2 px-2"
|
|
600
|
-
}, /*#__PURE__*/
|
|
585
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
601
586
|
className: "row"
|
|
602
|
-
}, /*#__PURE__*/
|
|
587
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
603
588
|
className: "col-4 text-muted"
|
|
604
|
-
}, /*#__PURE__*/
|
|
589
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
605
590
|
id: "sUR1xV",
|
|
606
591
|
defaultMessage: [{
|
|
607
592
|
"type": 0,
|
|
608
593
|
"value": "Author"
|
|
609
594
|
}]
|
|
610
|
-
})), /*#__PURE__*/
|
|
595
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
611
596
|
className: "col"
|
|
612
|
-
}, /*#__PURE__*/
|
|
597
|
+
}, /*#__PURE__*/React.createElement("small", null, user.name)))) : null), /*#__PURE__*/React.createElement("div", {
|
|
613
598
|
className: "py-3"
|
|
614
|
-
}, confirmation !== null ? /*#__PURE__*/
|
|
599
|
+
}, confirmation !== null ? /*#__PURE__*/React.createElement(React.Fragment, null, confirmation.length > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", {
|
|
615
600
|
className: "pt-1 text-danger"
|
|
616
|
-
}, /*#__PURE__*/
|
|
601
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
617
602
|
id: "2FD6tj",
|
|
618
603
|
defaultMessage: [{
|
|
619
604
|
"type": 0,
|
|
620
605
|
"value": "This media is used by the following documents:"
|
|
621
606
|
}]
|
|
622
|
-
})), /*#__PURE__*/
|
|
623
|
-
return /*#__PURE__*/
|
|
607
|
+
})), /*#__PURE__*/React.createElement("ul", null, confirmation.map(function (it, i) {
|
|
608
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
624
609
|
key: "".concat(it, "-").concat(i + 1),
|
|
625
610
|
className: "text-danger"
|
|
626
611
|
}, it);
|
|
627
|
-
}))) : null, /*#__PURE__*/
|
|
612
|
+
}))) : null, /*#__PURE__*/React.createElement("p", {
|
|
628
613
|
className: "pt-1 text-danger"
|
|
629
|
-
}, /*#__PURE__*/
|
|
614
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
630
615
|
id: "wy2g+x",
|
|
631
616
|
defaultMessage: [{
|
|
632
617
|
"type": 0,
|
|
633
618
|
"value": "Are you sure you want to continue?"
|
|
634
619
|
}]
|
|
635
|
-
}))) : null, /*#__PURE__*/
|
|
620
|
+
}))) : null, /*#__PURE__*/React.createElement("div", {
|
|
636
621
|
className: "d-flex"
|
|
637
|
-
}, /*#__PURE__*/
|
|
622
|
+
}, /*#__PURE__*/React.createElement(components.Button, {
|
|
638
623
|
className: "me-2",
|
|
639
624
|
theme: "danger",
|
|
640
625
|
outline: true,
|
|
641
626
|
onClick: confirmation === null ? onConfirm : onDelete
|
|
642
|
-
}, /*#__PURE__*/
|
|
627
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
643
628
|
id: "/KQ87r",
|
|
644
629
|
defaultMessage: [{
|
|
645
630
|
"type": 0,
|
|
646
631
|
"value": "Delete media"
|
|
647
632
|
}]
|
|
648
|
-
})), confirmation !== null ? /*#__PURE__*/
|
|
633
|
+
})), confirmation !== null ? /*#__PURE__*/React.createElement(components.Button, {
|
|
649
634
|
theme: "primary",
|
|
650
635
|
outline: true,
|
|
651
636
|
onClick: onCancelDelete
|
|
652
|
-
}, /*#__PURE__*/
|
|
637
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
653
638
|
id: "Xb6r3F",
|
|
654
639
|
defaultMessage: [{
|
|
655
640
|
"type": 0,
|
|
656
641
|
"value": "Cancel"
|
|
657
642
|
}]
|
|
658
|
-
})) : null), deletedState === false ? /*#__PURE__*/
|
|
643
|
+
})) : null), deletedState === false ? /*#__PURE__*/React.createElement("p", {
|
|
659
644
|
className: "pt-1 text-danger"
|
|
660
|
-
}, /*#__PURE__*/
|
|
645
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
661
646
|
id: "rqbRV2",
|
|
662
647
|
defaultMessage: [{
|
|
663
648
|
"type": 0,
|
|
@@ -681,8 +666,8 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
681
666
|
withType = _ref$withType === void 0 ? false : _ref$withType,
|
|
682
667
|
_ref$storyId = _ref.storyId,
|
|
683
668
|
storyId = _ref$storyId === void 0 ? null : _ref$storyId;
|
|
684
|
-
var sources = [].concat(
|
|
685
|
-
label: /*#__PURE__*/
|
|
669
|
+
var sources = [].concat(_toConsumableArray(storyId !== null ? [{
|
|
670
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
686
671
|
id: "eiaIIB",
|
|
687
672
|
defaultMessage: [{
|
|
688
673
|
"type": 0,
|
|
@@ -691,7 +676,7 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
691
676
|
}),
|
|
692
677
|
value: "document-".concat(storyId)
|
|
693
678
|
}] : []), [{
|
|
694
|
-
label: /*#__PURE__*/
|
|
679
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
695
680
|
id: "xAzv6g",
|
|
696
681
|
defaultMessage: [{
|
|
697
682
|
"type": 0,
|
|
@@ -699,8 +684,8 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
699
684
|
}]
|
|
700
685
|
}),
|
|
701
686
|
value: 'all'
|
|
702
|
-
}],
|
|
703
|
-
label: /*#__PURE__*/
|
|
687
|
+
}], _toConsumableArray(team !== null && team.length > 0 ? [{
|
|
688
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
704
689
|
id: "/62oe4",
|
|
705
690
|
defaultMessage: [{
|
|
706
691
|
"type": 0,
|
|
@@ -708,11 +693,11 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
708
693
|
}]
|
|
709
694
|
}),
|
|
710
695
|
value: 'user'
|
|
711
|
-
}] : []),
|
|
696
|
+
}] : []), _toConsumableArray(upstreamSources)).filter(function (it) {
|
|
712
697
|
return it !== null;
|
|
713
698
|
});
|
|
714
699
|
var types = [{
|
|
715
|
-
label: /*#__PURE__*/
|
|
700
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
716
701
|
id: "2J05S0",
|
|
717
702
|
defaultMessage: [{
|
|
718
703
|
"type": 0,
|
|
@@ -721,7 +706,7 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
721
706
|
}),
|
|
722
707
|
value: 'image'
|
|
723
708
|
}, {
|
|
724
|
-
label: /*#__PURE__*/
|
|
709
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
725
710
|
id: "QBlqW9",
|
|
726
711
|
defaultMessage: [{
|
|
727
712
|
"type": 0,
|
|
@@ -730,7 +715,7 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
730
715
|
}),
|
|
731
716
|
value: 'video'
|
|
732
717
|
}, {
|
|
733
|
-
label: /*#__PURE__*/
|
|
718
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
734
719
|
id: "PNMMo/",
|
|
735
720
|
defaultMessage: [{
|
|
736
721
|
"type": 0,
|
|
@@ -740,7 +725,7 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
740
725
|
value: 'audio'
|
|
741
726
|
}];
|
|
742
727
|
var usage = [{
|
|
743
|
-
label: /*#__PURE__*/
|
|
728
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
744
729
|
id: "tmfbUn",
|
|
745
730
|
defaultMessage: [{
|
|
746
731
|
"type": 0,
|
|
@@ -749,7 +734,7 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
749
734
|
}),
|
|
750
735
|
value: 'unused'
|
|
751
736
|
}, {
|
|
752
|
-
label: /*#__PURE__*/
|
|
737
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
753
738
|
id: "AQ8Aig",
|
|
754
739
|
defaultMessage: [{
|
|
755
740
|
"type": 0,
|
|
@@ -760,7 +745,7 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
760
745
|
}];
|
|
761
746
|
var sections = [withType ? {
|
|
762
747
|
value: 'types',
|
|
763
|
-
label: /*#__PURE__*/
|
|
748
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
764
749
|
id: "/ca7BX",
|
|
765
750
|
defaultMessage: [{
|
|
766
751
|
"type": 0,
|
|
@@ -770,7 +755,7 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
770
755
|
items: types
|
|
771
756
|
} : null, {
|
|
772
757
|
value: 'recent',
|
|
773
|
-
label: /*#__PURE__*/
|
|
758
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
774
759
|
id: "vYunz+",
|
|
775
760
|
defaultMessage: [{
|
|
776
761
|
"type": 0,
|
|
@@ -780,7 +765,7 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
780
765
|
items: recent
|
|
781
766
|
}, {
|
|
782
767
|
value: 'tags',
|
|
783
|
-
label: /*#__PURE__*/
|
|
768
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
784
769
|
id: "/OM5UY",
|
|
785
770
|
defaultMessage: [{
|
|
786
771
|
"type": 0,
|
|
@@ -790,7 +775,7 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
790
775
|
items: tags
|
|
791
776
|
}, {
|
|
792
777
|
value: 'users',
|
|
793
|
-
label: /*#__PURE__*/
|
|
778
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
794
779
|
id: "pfvDzR",
|
|
795
780
|
defaultMessage: [{
|
|
796
781
|
"type": 0,
|
|
@@ -800,7 +785,7 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
800
785
|
items: team
|
|
801
786
|
}, {
|
|
802
787
|
value: 'usage',
|
|
803
|
-
label: /*#__PURE__*/
|
|
788
|
+
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
804
789
|
id: "mOSkbf",
|
|
805
790
|
defaultMessage: [{
|
|
806
791
|
"type": 0,
|
|
@@ -819,27 +804,27 @@ var useSearchFilters = function useSearchFilters(_ref) {
|
|
|
819
804
|
};
|
|
820
805
|
|
|
821
806
|
// eslint-disable-next-line import/prefer-default-export
|
|
822
|
-
var filtersValue =
|
|
823
|
-
search:
|
|
807
|
+
var filtersValue = PropTypes.shape({
|
|
808
|
+
search: PropTypes.string
|
|
824
809
|
});
|
|
825
|
-
|
|
826
|
-
types:
|
|
827
|
-
tags:
|
|
828
|
-
users:
|
|
829
|
-
usage:
|
|
810
|
+
PropTypes.shape({
|
|
811
|
+
types: PropTypes.arrayOf(PropTypes.string),
|
|
812
|
+
tags: PropTypes.arrayOf(PropTypes.string),
|
|
813
|
+
users: PropTypes.arrayOf(PropTypes.string),
|
|
814
|
+
usage: PropTypes.arrayOf(PropTypes.oneOf(['used', 'unused']))
|
|
830
815
|
});
|
|
831
816
|
|
|
832
817
|
var styles$8 = {"container":"micromag-media-gallery-forms-dropdown-section-container","dropdownToggle":"micromag-media-gallery-forms-dropdown-section-dropdownToggle","label":"micromag-media-gallery-forms-dropdown-section-label","dropdown":"micromag-media-gallery-forms-dropdown-section-dropdown"};
|
|
833
818
|
|
|
834
819
|
var propTypes$8 = {
|
|
835
|
-
value:
|
|
836
|
-
items:
|
|
820
|
+
value: PropTypes.string,
|
|
821
|
+
items: PropTypes.arrayOf(PropTypes.shape({
|
|
837
822
|
label: core.PropTypes.label,
|
|
838
|
-
value:
|
|
839
|
-
active:
|
|
823
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
824
|
+
active: PropTypes.bool
|
|
840
825
|
})),
|
|
841
|
-
onChange:
|
|
842
|
-
className:
|
|
826
|
+
onChange: PropTypes.func,
|
|
827
|
+
className: PropTypes.string
|
|
843
828
|
};
|
|
844
829
|
var defaultProps$8 = {
|
|
845
830
|
value: null,
|
|
@@ -853,7 +838,7 @@ function DropdownSection(_ref) {
|
|
|
853
838
|
onChange = _ref.onChange,
|
|
854
839
|
className = _ref.className;
|
|
855
840
|
var _useState = React.useState(false),
|
|
856
|
-
_useState2 =
|
|
841
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
857
842
|
open = _useState2[0],
|
|
858
843
|
setOpen = _useState2[1];
|
|
859
844
|
var currentItem = items.find(function (i) {
|
|
@@ -873,40 +858,40 @@ function DropdownSection(_ref) {
|
|
|
873
858
|
setOpen(false);
|
|
874
859
|
onChange(val);
|
|
875
860
|
}, [setOpen]);
|
|
876
|
-
return items !== null && items.length > 1 ? /*#__PURE__*/
|
|
877
|
-
className:
|
|
878
|
-
}, /*#__PURE__*/
|
|
861
|
+
return items !== null && items.length > 1 ? /*#__PURE__*/React.createElement("div", {
|
|
862
|
+
className: classNames([styles$8.container, 'dropdown', _defineProperty({}, className, className !== null)])
|
|
863
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
879
864
|
className: styles$8.label
|
|
880
|
-
}, /*#__PURE__*/
|
|
865
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
881
866
|
id: "9ZdD+Q",
|
|
882
867
|
defaultMessage: [{
|
|
883
868
|
"type": 0,
|
|
884
869
|
"value": "Library for"
|
|
885
870
|
}]
|
|
886
|
-
})), /*#__PURE__*/
|
|
887
|
-
className:
|
|
871
|
+
})), /*#__PURE__*/React.createElement("button", {
|
|
872
|
+
className: classNames([styles$8.dropdownToggle, 'dropdown-toggle', {
|
|
888
873
|
open: open === true
|
|
889
874
|
}]),
|
|
890
875
|
type: "button",
|
|
891
876
|
onClick: onOpen,
|
|
892
877
|
onBlur: onBlur
|
|
893
|
-
}, (currentItem ? currentItem.label : null) || /*#__PURE__*/
|
|
878
|
+
}, (currentItem ? currentItem.label : null) || /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
894
879
|
id: "15GBmG",
|
|
895
880
|
defaultMessage: [{
|
|
896
881
|
"type": 0,
|
|
897
882
|
"value": "All"
|
|
898
883
|
}]
|
|
899
|
-
})), /*#__PURE__*/
|
|
900
|
-
className:
|
|
884
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
885
|
+
className: classNames([styles$8.dropdown, 'dropdown-menu', {
|
|
901
886
|
show: open === true
|
|
902
887
|
}])
|
|
903
888
|
}, items.map(function (_ref3) {
|
|
904
889
|
var label = _ref3.label,
|
|
905
890
|
itemValue = _ref3.value;
|
|
906
|
-
var itemClassNames =
|
|
891
|
+
var itemClassNames = classNames(['dropdown-item', {
|
|
907
892
|
active: itemValue === value
|
|
908
893
|
}]);
|
|
909
|
-
return /*#__PURE__*/
|
|
894
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
910
895
|
className: itemClassNames,
|
|
911
896
|
type: "button",
|
|
912
897
|
key: "drop-".concat(itemValue),
|
|
@@ -921,13 +906,13 @@ DropdownSection.defaultProps = defaultProps$8;
|
|
|
921
906
|
var styles$7 = {"container":"micromag-media-gallery-forms-search-container","input":"micromag-media-gallery-forms-search-input","active":"micromag-media-gallery-forms-search-active"};
|
|
922
907
|
|
|
923
908
|
var propTypes$7 = {
|
|
924
|
-
value:
|
|
925
|
-
loading:
|
|
926
|
-
onChange:
|
|
927
|
-
onFocus:
|
|
928
|
-
onBlur:
|
|
929
|
-
onClickIcon:
|
|
930
|
-
className:
|
|
909
|
+
value: PropTypes.string,
|
|
910
|
+
loading: PropTypes.bool,
|
|
911
|
+
onChange: PropTypes.func,
|
|
912
|
+
onFocus: PropTypes.func,
|
|
913
|
+
onBlur: PropTypes.func,
|
|
914
|
+
onClickIcon: PropTypes.func,
|
|
915
|
+
className: PropTypes.string
|
|
931
916
|
};
|
|
932
917
|
var defaultProps$7 = {
|
|
933
918
|
value: null,
|
|
@@ -963,23 +948,23 @@ var Search = function Search(_ref) {
|
|
|
963
948
|
onClickIcon();
|
|
964
949
|
}
|
|
965
950
|
}, [onClickIcon]);
|
|
966
|
-
return /*#__PURE__*/
|
|
951
|
+
return /*#__PURE__*/React.createElement("form", {
|
|
967
952
|
method: "post",
|
|
968
|
-
className:
|
|
953
|
+
className: classNames([styles$7.container, 'w-100', 'border', 'border-dark', 'rounded', _defineProperty({}, className, className !== null)]),
|
|
969
954
|
onSubmit: function onSubmit(e) {
|
|
970
955
|
return e.preventDefault();
|
|
971
956
|
}
|
|
972
|
-
}, /*#__PURE__*/
|
|
957
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
973
958
|
className: "input-group w-100"
|
|
974
|
-
}, /*#__PURE__*/
|
|
959
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
975
960
|
type: "button",
|
|
976
961
|
className: "btn",
|
|
977
962
|
onClick: onClickSearchIcon
|
|
978
|
-
}, /*#__PURE__*/
|
|
963
|
+
}, /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
979
964
|
icon: loading ? faSpinner.faSpinner : faSearch.faSearch,
|
|
980
965
|
spin: loading
|
|
981
|
-
})), /*#__PURE__*/
|
|
982
|
-
className:
|
|
966
|
+
})), /*#__PURE__*/React.createElement("input", {
|
|
967
|
+
className: classNames([styles$7.input, 'form-control', {
|
|
983
968
|
'bg-light': !!value,
|
|
984
969
|
'text-dark': value
|
|
985
970
|
}]),
|
|
@@ -1003,14 +988,14 @@ Search.defaultProps = defaultProps$7;
|
|
|
1003
988
|
var styles$6 = {"container":"micromag-media-gallery-forms-tag-dropdown-container","select":"micromag-media-gallery-forms-tag-dropdown-select"};
|
|
1004
989
|
|
|
1005
990
|
var propTypes$6 = {
|
|
1006
|
-
tags:
|
|
1007
|
-
label:
|
|
1008
|
-
value:
|
|
1009
|
-
active:
|
|
991
|
+
tags: PropTypes.arrayOf(PropTypes.shape({
|
|
992
|
+
label: PropTypes.string,
|
|
993
|
+
value: PropTypes.oneOf([PropTypes.string, PropTypes.node]),
|
|
994
|
+
active: PropTypes.bool
|
|
1010
995
|
})),
|
|
1011
|
-
parent:
|
|
1012
|
-
onChange:
|
|
1013
|
-
className:
|
|
996
|
+
parent: PropTypes.string,
|
|
997
|
+
onChange: PropTypes.func,
|
|
998
|
+
className: PropTypes.string
|
|
1014
999
|
};
|
|
1015
1000
|
var defaultProps$6 = {
|
|
1016
1001
|
tags: null,
|
|
@@ -1027,18 +1012,18 @@ var TagDropdown = function TagDropdown(_ref) {
|
|
|
1027
1012
|
var val = e.target.dataset.value || null;
|
|
1028
1013
|
onChange(val, parent);
|
|
1029
1014
|
}, [onChange, parent]);
|
|
1030
|
-
return /*#__PURE__*/
|
|
1031
|
-
className:
|
|
1032
|
-
}, /*#__PURE__*/
|
|
1033
|
-
className:
|
|
1015
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1016
|
+
className: classNames([styles$6.container, 'd-flex', 'mt-1', _defineProperty({}, className, className !== null)])
|
|
1017
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
1018
|
+
className: classNames(['form-select', styles$6.select])
|
|
1034
1019
|
}, tags !== null ? tags.map(function (_ref3) {
|
|
1035
1020
|
var label = _ref3.label,
|
|
1036
1021
|
value = _ref3.value,
|
|
1037
1022
|
active = _ref3.active;
|
|
1038
|
-
var itemClassNames =
|
|
1023
|
+
var itemClassNames = classNames([styles$6.tag, 'fs-6', {
|
|
1039
1024
|
'btn-primary': active === true
|
|
1040
1025
|
}]);
|
|
1041
|
-
return /*#__PURE__*/
|
|
1026
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
1042
1027
|
className: itemClassNames,
|
|
1043
1028
|
type: "button",
|
|
1044
1029
|
key: "option-".concat(value),
|
|
@@ -1054,14 +1039,14 @@ TagDropdown.defaultProps = defaultProps$6;
|
|
|
1054
1039
|
var styles$5 = {"container":"micromag-media-gallery-forms-tag-section-container","tag":"micromag-media-gallery-forms-tag-section-tag"};
|
|
1055
1040
|
|
|
1056
1041
|
var propTypes$5 = {
|
|
1057
|
-
tags:
|
|
1058
|
-
label:
|
|
1059
|
-
value:
|
|
1060
|
-
active:
|
|
1042
|
+
tags: PropTypes.arrayOf(PropTypes.shape({
|
|
1043
|
+
label: PropTypes.string,
|
|
1044
|
+
value: PropTypes.oneOf([PropTypes.string, PropTypes.node]),
|
|
1045
|
+
active: PropTypes.bool
|
|
1061
1046
|
})),
|
|
1062
|
-
parent:
|
|
1063
|
-
onChange:
|
|
1064
|
-
className:
|
|
1047
|
+
parent: PropTypes.string,
|
|
1048
|
+
onChange: PropTypes.func,
|
|
1049
|
+
className: PropTypes.string
|
|
1065
1050
|
};
|
|
1066
1051
|
var defaultProps$5 = {
|
|
1067
1052
|
tags: null,
|
|
@@ -1078,18 +1063,18 @@ var TagSection = function TagSection(_ref) {
|
|
|
1078
1063
|
var val = e.target.dataset.value || null;
|
|
1079
1064
|
onChange(val, parent);
|
|
1080
1065
|
}, [onChange, parent]);
|
|
1081
|
-
return /*#__PURE__*/
|
|
1082
|
-
className:
|
|
1066
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1067
|
+
className: classNames([styles$5.container, 'd-flex', 'mt-1', _defineProperty({}, className, className !== null)])
|
|
1083
1068
|
}, tags !== null ? tags.map(function (_ref3) {
|
|
1084
1069
|
var label = _ref3.label,
|
|
1085
1070
|
value = _ref3.value,
|
|
1086
1071
|
active = _ref3.active;
|
|
1087
|
-
var itemClassNames =
|
|
1072
|
+
var itemClassNames = classNames([styles$5.tag, 'btn', 'btn-sm', 'mb-1', 'me-1', 'p-1', 'btn-secondary', 'text-truncate', {
|
|
1088
1073
|
'btn-primary': active === true
|
|
1089
1074
|
// 'btn-outline-light': active === false,
|
|
1090
1075
|
}]);
|
|
1091
1076
|
|
|
1092
|
-
return /*#__PURE__*/
|
|
1077
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
1093
1078
|
className: itemClassNames,
|
|
1094
1079
|
type: "button",
|
|
1095
1080
|
key: "tag-".concat(value),
|
|
@@ -1104,12 +1089,12 @@ TagSection.defaultProps = defaultProps$5;
|
|
|
1104
1089
|
var styles$4 = {"container":"micromag-media-gallery-forms-search-filters-container","closeBtn":"micromag-media-gallery-forms-search-filters-closeBtn","section":"micromag-media-gallery-forms-search-filters-section","title":"micromag-media-gallery-forms-search-filters-title","tags":"micromag-media-gallery-forms-search-filters-tags"};
|
|
1105
1090
|
|
|
1106
1091
|
var propTypes$4 = {
|
|
1107
|
-
filters:
|
|
1092
|
+
filters: PropTypes.object,
|
|
1108
1093
|
// eslint-disable-line
|
|
1109
|
-
sections:
|
|
1110
|
-
onChange:
|
|
1111
|
-
onClose:
|
|
1112
|
-
className:
|
|
1094
|
+
sections: PropTypes.arrayOf(PropTypes.shape({})),
|
|
1095
|
+
onChange: PropTypes.func,
|
|
1096
|
+
onClose: PropTypes.func,
|
|
1097
|
+
className: PropTypes.string
|
|
1113
1098
|
};
|
|
1114
1099
|
var defaultProps$4 = {
|
|
1115
1100
|
filters: null,
|
|
@@ -1127,7 +1112,7 @@ var SearchFilters = function SearchFilters(_ref) {
|
|
|
1127
1112
|
var intl = reactIntl.useIntl();
|
|
1128
1113
|
var getActive = React.useCallback(function (items, sectionFilters) {
|
|
1129
1114
|
return items !== null ? items.map(function (it) {
|
|
1130
|
-
return
|
|
1115
|
+
return _objectSpread(_objectSpread({}, it), {}, {
|
|
1131
1116
|
active: sectionFilters ? !!sectionFilters.find(function (f) {
|
|
1132
1117
|
return f === it.value;
|
|
1133
1118
|
}) : false
|
|
@@ -1136,7 +1121,7 @@ var SearchFilters = function SearchFilters(_ref) {
|
|
|
1136
1121
|
}, []);
|
|
1137
1122
|
var activeSections = React.useMemo(function () {
|
|
1138
1123
|
return sections.map(function (section) {
|
|
1139
|
-
return
|
|
1124
|
+
return _objectSpread(_objectSpread({}, section), {}, {
|
|
1140
1125
|
items: getActive(section.items, filters[section.value])
|
|
1141
1126
|
});
|
|
1142
1127
|
});
|
|
@@ -1156,17 +1141,17 @@ var SearchFilters = function SearchFilters(_ref) {
|
|
|
1156
1141
|
} else if (section === 'usage') {
|
|
1157
1142
|
onChange(section, [data]);
|
|
1158
1143
|
} else {
|
|
1159
|
-
onChange(section, [].concat(
|
|
1144
|
+
onChange(section, [].concat(_toConsumableArray(val), [data]));
|
|
1160
1145
|
}
|
|
1161
1146
|
}
|
|
1162
1147
|
}, [filters, onChange]);
|
|
1163
|
-
return /*#__PURE__*/
|
|
1164
|
-
className:
|
|
1165
|
-
}, activeSections.length > 0 ? /*#__PURE__*/
|
|
1166
|
-
className:
|
|
1167
|
-
}, /*#__PURE__*/
|
|
1168
|
-
className:
|
|
1169
|
-
icon: /*#__PURE__*/
|
|
1148
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1149
|
+
className: classNames([styles$4.container, 'flex-nowrap', 'mt-1', _defineProperty({}, className, className !== null)])
|
|
1150
|
+
}, activeSections.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
1151
|
+
className: classNames(['bg-dark', 'flex-nowrap', 'text-dark', 'py-1', 'px-3', 'rounded'])
|
|
1152
|
+
}, /*#__PURE__*/React.createElement(components.Button, {
|
|
1153
|
+
className: classNames([styles$4.closeBtn, 'py-1', 'px-1', 'text-light']),
|
|
1154
|
+
icon: /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
1170
1155
|
icon: faTimes.faTimes
|
|
1171
1156
|
}),
|
|
1172
1157
|
onClick: onClose,
|
|
@@ -1181,18 +1166,18 @@ var SearchFilters = function SearchFilters(_ref) {
|
|
|
1181
1166
|
var value = _ref3.value,
|
|
1182
1167
|
label = _ref3.label,
|
|
1183
1168
|
items = _ref3.items;
|
|
1184
|
-
return items.length > 0 ? /*#__PURE__*/
|
|
1169
|
+
return items.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
1185
1170
|
key: "filter-".concat(value),
|
|
1186
|
-
className:
|
|
1187
|
-
}, /*#__PURE__*/
|
|
1188
|
-
className:
|
|
1189
|
-
}, label), value === 'tags' || value === 'recent' || value === 'users' ? /*#__PURE__*/
|
|
1190
|
-
className:
|
|
1171
|
+
className: classNames([styles$4.section, 'py-2'])
|
|
1172
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
1173
|
+
className: classNames([styles$4.title, 'm-0'])
|
|
1174
|
+
}, label), value === 'tags' || value === 'recent' || value === 'users' ? /*#__PURE__*/React.createElement(TagDropdown, {
|
|
1175
|
+
className: classNames([styles$4.tags]),
|
|
1191
1176
|
tags: items,
|
|
1192
1177
|
parent: value,
|
|
1193
1178
|
onChange: onSectionChange
|
|
1194
|
-
}) : /*#__PURE__*/
|
|
1195
|
-
className:
|
|
1179
|
+
}) : /*#__PURE__*/React.createElement(TagSection, {
|
|
1180
|
+
className: classNames([styles$4.tags]),
|
|
1196
1181
|
tags: items,
|
|
1197
1182
|
parent: value,
|
|
1198
1183
|
onChange: onSectionChange
|
|
@@ -1206,18 +1191,18 @@ var styles$3 = {"container":"micromag-media-gallery-buttons-close-container"};
|
|
|
1206
1191
|
|
|
1207
1192
|
var _excluded = ["className"];
|
|
1208
1193
|
var propTypes$3 = {
|
|
1209
|
-
className:
|
|
1194
|
+
className: PropTypes.string
|
|
1210
1195
|
};
|
|
1211
1196
|
var defaultProps$3 = {
|
|
1212
1197
|
className: null
|
|
1213
1198
|
};
|
|
1214
1199
|
var CloseButton = function CloseButton(_ref) {
|
|
1215
1200
|
var className = _ref.className,
|
|
1216
|
-
props =
|
|
1217
|
-
return /*#__PURE__*/
|
|
1218
|
-
className:
|
|
1201
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
1202
|
+
return /*#__PURE__*/React.createElement(components.Button, Object.assign({
|
|
1203
|
+
className: classNames([styles$3.container, _defineProperty({}, className, className !== null)]),
|
|
1219
1204
|
withoutStyle: true,
|
|
1220
|
-
icon: /*#__PURE__*/
|
|
1205
|
+
icon: /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
1221
1206
|
icon: faTimes.faTimes,
|
|
1222
1207
|
className: styles$3.icon
|
|
1223
1208
|
}),
|
|
@@ -1230,16 +1215,16 @@ CloseButton.defaultProps = defaultProps$3;
|
|
|
1230
1215
|
var styles$2 = {"container":"micromag-media-gallery-partials-active-filters-container","heading":"micromag-media-gallery-partials-active-filters-heading","title":"micromag-media-gallery-partials-active-filters-title","resetButton":"micromag-media-gallery-partials-active-filters-resetButton","activeTag":"micromag-media-gallery-partials-active-filters-activeTag"};
|
|
1231
1216
|
|
|
1232
1217
|
var propTypes$2 = {
|
|
1233
|
-
filters:
|
|
1234
|
-
types:
|
|
1235
|
-
tags:
|
|
1236
|
-
users:
|
|
1237
|
-
usage:
|
|
1218
|
+
filters: PropTypes.shape({
|
|
1219
|
+
types: PropTypes.arrayOf(PropTypes.string),
|
|
1220
|
+
tags: PropTypes.arrayOf(PropTypes.string),
|
|
1221
|
+
users: PropTypes.arrayOf(PropTypes.string),
|
|
1222
|
+
usage: PropTypes.arrayOf(PropTypes.oneOf(['used', 'unused']))
|
|
1238
1223
|
}),
|
|
1239
|
-
onChange:
|
|
1240
|
-
onReset:
|
|
1241
|
-
sections:
|
|
1242
|
-
className:
|
|
1224
|
+
onChange: PropTypes.func,
|
|
1225
|
+
onReset: PropTypes.func,
|
|
1226
|
+
sections: PropTypes.arrayOf(PropTypes.shape({})),
|
|
1227
|
+
className: PropTypes.string
|
|
1243
1228
|
};
|
|
1244
1229
|
var defaultProps$2 = {
|
|
1245
1230
|
filters: null,
|
|
@@ -1271,22 +1256,22 @@ function ActiveFilters(_ref) {
|
|
|
1271
1256
|
var hasValue = Object.keys(filters).reduce(function (oneHasValue, key) {
|
|
1272
1257
|
return oneHasValue || filters[key] !== null;
|
|
1273
1258
|
}, false);
|
|
1274
|
-
return /*#__PURE__*/
|
|
1275
|
-
className:
|
|
1276
|
-
}, hasValue ? /*#__PURE__*/
|
|
1259
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1260
|
+
className: classNames(['w-100', styles$2.container, _defineProperty({}, className, className)])
|
|
1261
|
+
}, hasValue ? /*#__PURE__*/React.createElement("div", {
|
|
1277
1262
|
className: styles$2.heading
|
|
1278
|
-
}, /*#__PURE__*/
|
|
1263
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1279
1264
|
className: styles$2.title
|
|
1280
|
-
}, /*#__PURE__*/
|
|
1265
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
1281
1266
|
id: "t2cFdl",
|
|
1282
1267
|
defaultMessage: [{
|
|
1283
1268
|
"type": 0,
|
|
1284
1269
|
"value": "Active filters"
|
|
1285
1270
|
}]
|
|
1286
|
-
})), /*#__PURE__*/
|
|
1271
|
+
})), /*#__PURE__*/React.createElement(CloseButton, {
|
|
1287
1272
|
className: styles$2.resetButton,
|
|
1288
1273
|
onClick: handleReset
|
|
1289
|
-
}, /*#__PURE__*/
|
|
1274
|
+
}, /*#__PURE__*/React.createElement("u", null, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
1290
1275
|
id: "/T/UDH",
|
|
1291
1276
|
defaultMessage: [{
|
|
1292
1277
|
"type": 0,
|
|
@@ -1303,14 +1288,14 @@ function ActiveFilters(_ref) {
|
|
|
1303
1288
|
var _ref3 = current || {},
|
|
1304
1289
|
_ref3$label = _ref3.label,
|
|
1305
1290
|
label = _ref3$label === void 0 ? '' : _ref3$label;
|
|
1306
|
-
return /*#__PURE__*/
|
|
1291
|
+
return /*#__PURE__*/React.createElement(components.Button, {
|
|
1307
1292
|
className: styles$2.activeTag,
|
|
1308
1293
|
key: "filter-button-".concat(activeValue),
|
|
1309
1294
|
type: "submit",
|
|
1310
1295
|
size: "sm",
|
|
1311
|
-
label: /*#__PURE__*/
|
|
1296
|
+
label: /*#__PURE__*/React.createElement("span", null, section.label, " : ", label),
|
|
1312
1297
|
theme: "secondary",
|
|
1313
|
-
icon: /*#__PURE__*/
|
|
1298
|
+
icon: /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
1314
1299
|
icon: faTimes.faTimes
|
|
1315
1300
|
}),
|
|
1316
1301
|
iconPosition: "right",
|
|
@@ -1327,27 +1312,27 @@ ActiveFilters.defaultProps = defaultProps$2;
|
|
|
1327
1312
|
var styles$1 = {"container":"micromag-media-gallery-partials-navbar-container","inner":"micromag-media-gallery-partials-navbar-inner","mediaPreview":"micromag-media-gallery-partials-navbar-mediaPreview","thumbnail":"micromag-media-gallery-partials-navbar-thumbnail","mediaLabel":"micromag-media-gallery-partials-navbar-mediaLabel"};
|
|
1328
1313
|
|
|
1329
1314
|
var propTypes$1 = {
|
|
1330
|
-
types:
|
|
1315
|
+
types: PropTypes.arrayOf(PropTypes.string),
|
|
1331
1316
|
filters: filtersValue,
|
|
1332
1317
|
media: core.PropTypes.media,
|
|
1333
1318
|
selectedMedia: core.PropTypes.media,
|
|
1334
|
-
storyId:
|
|
1319
|
+
storyId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
1335
1320
|
tags: core.PropTypes.tags,
|
|
1336
|
-
authors:
|
|
1337
|
-
name:
|
|
1321
|
+
authors: PropTypes.arrayOf(PropTypes.shape({
|
|
1322
|
+
name: PropTypes.string
|
|
1338
1323
|
})),
|
|
1339
|
-
loading:
|
|
1340
|
-
withoutSource:
|
|
1341
|
-
withoutType:
|
|
1342
|
-
onClickAdd:
|
|
1343
|
-
onClickItem:
|
|
1344
|
-
onClickItemInfo:
|
|
1345
|
-
onClickClear:
|
|
1324
|
+
loading: PropTypes.bool,
|
|
1325
|
+
withoutSource: PropTypes.bool,
|
|
1326
|
+
withoutType: PropTypes.bool,
|
|
1327
|
+
onClickAdd: PropTypes.func,
|
|
1328
|
+
onClickItem: PropTypes.func,
|
|
1329
|
+
onClickItemInfo: PropTypes.func,
|
|
1330
|
+
onClickClear: PropTypes.func,
|
|
1346
1331
|
// TODO: still needed?
|
|
1347
|
-
onFocusSearch:
|
|
1348
|
-
onFiltersChange:
|
|
1349
|
-
onClickBack:
|
|
1350
|
-
className:
|
|
1332
|
+
onFocusSearch: PropTypes.func,
|
|
1333
|
+
onFiltersChange: PropTypes.func,
|
|
1334
|
+
onClickBack: PropTypes.func,
|
|
1335
|
+
className: PropTypes.string
|
|
1351
1336
|
};
|
|
1352
1337
|
var defaultProps$1 = {
|
|
1353
1338
|
types: null,
|
|
@@ -1391,7 +1376,7 @@ function Navbar(_ref) {
|
|
|
1391
1376
|
var intl = reactIntl.useIntl();
|
|
1392
1377
|
var throttle = React.useRef(null);
|
|
1393
1378
|
var _useState = React.useState(false),
|
|
1394
|
-
_useState2 =
|
|
1379
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1395
1380
|
open = _useState2[0],
|
|
1396
1381
|
setOpen = _useState2[1];
|
|
1397
1382
|
|
|
@@ -1431,7 +1416,7 @@ function Navbar(_ref) {
|
|
|
1431
1416
|
}, false) : false;
|
|
1432
1417
|
var onFilterChange = React.useCallback(function (type, value) {
|
|
1433
1418
|
var isOpen = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1434
|
-
var newFiltersValue =
|
|
1419
|
+
var newFiltersValue = _objectSpread(_objectSpread({}, filters), {}, _defineProperty({}, type, value));
|
|
1435
1420
|
if (onFiltersChange !== null) {
|
|
1436
1421
|
onFiltersChange(newFiltersValue);
|
|
1437
1422
|
}
|
|
@@ -1478,7 +1463,7 @@ function Navbar(_ref) {
|
|
|
1478
1463
|
}
|
|
1479
1464
|
}, [onClickClear, onClickItem]);
|
|
1480
1465
|
var uploadMessage = React.useMemo(function () {
|
|
1481
|
-
var message = /*#__PURE__*/
|
|
1466
|
+
var message = /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
1482
1467
|
id: "3Ap0C1",
|
|
1483
1468
|
defaultMessage: [{
|
|
1484
1469
|
"type": 0,
|
|
@@ -1487,7 +1472,7 @@ function Navbar(_ref) {
|
|
|
1487
1472
|
});
|
|
1488
1473
|
if (types !== null) {
|
|
1489
1474
|
if (types.indexOf('video') !== -1 && types.indexOf('image') !== -1) {
|
|
1490
|
-
message = /*#__PURE__*/
|
|
1475
|
+
message = /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
1491
1476
|
id: "KK5teQ",
|
|
1492
1477
|
defaultMessage: [{
|
|
1493
1478
|
"type": 0,
|
|
@@ -1495,7 +1480,7 @@ function Navbar(_ref) {
|
|
|
1495
1480
|
}]
|
|
1496
1481
|
});
|
|
1497
1482
|
} else if (types.indexOf('video') !== -1) {
|
|
1498
|
-
message = /*#__PURE__*/
|
|
1483
|
+
message = /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
1499
1484
|
id: "WeD4nB",
|
|
1500
1485
|
defaultMessage: [{
|
|
1501
1486
|
"type": 0,
|
|
@@ -1503,7 +1488,7 @@ function Navbar(_ref) {
|
|
|
1503
1488
|
}]
|
|
1504
1489
|
});
|
|
1505
1490
|
} else if (types.indexOf('image') !== -1) {
|
|
1506
|
-
message = /*#__PURE__*/
|
|
1491
|
+
message = /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
1507
1492
|
id: "KdAKt7",
|
|
1508
1493
|
defaultMessage: [{
|
|
1509
1494
|
"type": 0,
|
|
@@ -1511,7 +1496,7 @@ function Navbar(_ref) {
|
|
|
1511
1496
|
}]
|
|
1512
1497
|
});
|
|
1513
1498
|
} else if (types.indexOf('audio') !== -1) {
|
|
1514
|
-
message = /*#__PURE__*/
|
|
1499
|
+
message = /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
1515
1500
|
id: "6W4St0",
|
|
1516
1501
|
defaultMessage: [{
|
|
1517
1502
|
"type": 0,
|
|
@@ -1519,7 +1504,7 @@ function Navbar(_ref) {
|
|
|
1519
1504
|
}]
|
|
1520
1505
|
});
|
|
1521
1506
|
} else if (types.indexOf('subtitle') !== -1) {
|
|
1522
|
-
message = /*#__PURE__*/
|
|
1507
|
+
message = /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
1523
1508
|
id: "BAfC6s",
|
|
1524
1509
|
defaultMessage: [{
|
|
1525
1510
|
"type": 0,
|
|
@@ -1530,56 +1515,56 @@ function Navbar(_ref) {
|
|
|
1530
1515
|
}
|
|
1531
1516
|
return message;
|
|
1532
1517
|
}, [types]);
|
|
1533
|
-
return /*#__PURE__*/
|
|
1534
|
-
className:
|
|
1535
|
-
}, /*#__PURE__*/
|
|
1536
|
-
className:
|
|
1537
|
-
}, media === null ? /*#__PURE__*/
|
|
1538
|
-
className:
|
|
1518
|
+
return /*#__PURE__*/React.createElement("nav", {
|
|
1519
|
+
className: classNames([styles$1.container, 'navbar', _defineProperty({}, className, className !== null)])
|
|
1520
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1521
|
+
className: classNames([styles$1.inner])
|
|
1522
|
+
}, media === null ? /*#__PURE__*/React.createElement("div", {
|
|
1523
|
+
className: classNames(['list-group-item rounded w-100 mw-100 navbar-text mb-2', {
|
|
1539
1524
|
'border border-primary bg-dark py-2 px-2': selectedMedia !== null
|
|
1540
1525
|
}])
|
|
1541
|
-
}, selectedMedia !== null ? /*#__PURE__*/
|
|
1526
|
+
}, selectedMedia !== null ? /*#__PURE__*/React.createElement("div", {
|
|
1542
1527
|
className: ""
|
|
1543
|
-
}, /*#__PURE__*/
|
|
1528
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1544
1529
|
className: "d-flex align-items-center mb-2 overflow-hidden"
|
|
1545
|
-
}, /*#__PURE__*/
|
|
1530
|
+
}, /*#__PURE__*/React.createElement(components.Media, {
|
|
1546
1531
|
className: styles$1.mediaPreview,
|
|
1547
1532
|
thumbnailClassName: styles$1.thumbnail,
|
|
1548
1533
|
thumbnail: selectedMedia === null || selectedMedia === void 0 ? void 0 : selectedMedia.thumbnail_url,
|
|
1549
1534
|
thumbnailAlign: "center"
|
|
1550
|
-
}), /*#__PURE__*/
|
|
1551
|
-
className:
|
|
1552
|
-
}, selectedMedia.name || /*#__PURE__*/
|
|
1535
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
1536
|
+
className: classNames([styles$1.mediaLabel, 'd-inline-block', 'text-truncate', 'mx-1', 'me-2'])
|
|
1537
|
+
}, selectedMedia.name || /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
1553
1538
|
id: "fVqgfl",
|
|
1554
1539
|
defaultMessage: [{
|
|
1555
1540
|
"type": 0,
|
|
1556
1541
|
"value": "[no title]"
|
|
1557
1542
|
}]
|
|
1558
|
-
}))), /*#__PURE__*/
|
|
1543
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
1559
1544
|
className: "d-flex w-100 align-content-center justify-content-between"
|
|
1560
|
-
}, /*#__PURE__*/
|
|
1545
|
+
}, /*#__PURE__*/React.createElement(components.Button, {
|
|
1561
1546
|
onClick: function onClick() {
|
|
1562
1547
|
return onClickItemInfo(selectedMedia);
|
|
1563
1548
|
},
|
|
1564
1549
|
theme: "secondary",
|
|
1565
1550
|
size: "sm",
|
|
1566
1551
|
iconPosition: "right",
|
|
1567
|
-
icon: /*#__PURE__*/
|
|
1552
|
+
icon: /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
1568
1553
|
icon: faInfoCircle.faInfoCircle
|
|
1569
1554
|
}),
|
|
1570
1555
|
outline: true
|
|
1571
|
-
}, /*#__PURE__*/
|
|
1556
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
1572
1557
|
id: "iCf/MP",
|
|
1573
1558
|
defaultMessage: [{
|
|
1574
1559
|
"type": 0,
|
|
1575
1560
|
"value": "Edit"
|
|
1576
1561
|
}]
|
|
1577
|
-
})), /*#__PURE__*/
|
|
1562
|
+
})), /*#__PURE__*/React.createElement(components.Button, {
|
|
1578
1563
|
theme: "secondary",
|
|
1579
1564
|
size: "sm",
|
|
1580
1565
|
outline: true,
|
|
1581
1566
|
iconPosition: "right",
|
|
1582
|
-
icon: /*#__PURE__*/
|
|
1567
|
+
icon: /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
1583
1568
|
icon: faTimes.faTimes
|
|
1584
1569
|
}),
|
|
1585
1570
|
onClick: onClickRemove,
|
|
@@ -1590,16 +1575,16 @@ function Navbar(_ref) {
|
|
|
1590
1575
|
"value": "Remove"
|
|
1591
1576
|
}]
|
|
1592
1577
|
})
|
|
1593
|
-
}, /*#__PURE__*/
|
|
1578
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
1594
1579
|
id: "8TbpT7",
|
|
1595
1580
|
defaultMessage: [{
|
|
1596
1581
|
"type": 0,
|
|
1597
1582
|
"value": "Remove"
|
|
1598
1583
|
}]
|
|
1599
|
-
})))) : /*#__PURE__*/
|
|
1584
|
+
})))) : /*#__PURE__*/React.createElement(components.Button, {
|
|
1600
1585
|
className: "w-100",
|
|
1601
1586
|
theme: "primary",
|
|
1602
|
-
icon: /*#__PURE__*/
|
|
1587
|
+
icon: /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
1603
1588
|
icon: faPlus.faPlus
|
|
1604
1589
|
}),
|
|
1605
1590
|
onClick: onClickAdd,
|
|
@@ -1610,47 +1595,47 @@ function Navbar(_ref) {
|
|
|
1610
1595
|
"value": "Add"
|
|
1611
1596
|
}]
|
|
1612
1597
|
})
|
|
1613
|
-
}, /*#__PURE__*/
|
|
1598
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
1614
1599
|
className: "ps-2"
|
|
1615
|
-
}, uploadMessage))) : null, !withoutSource && media === null && sources !== null && sources.length > 1 ? /*#__PURE__*/
|
|
1600
|
+
}, uploadMessage))) : null, !withoutSource && media === null && sources !== null && sources.length > 1 ? /*#__PURE__*/React.createElement("div", {
|
|
1616
1601
|
className: "mb-2 d-flex w-100 align-items-center flex-nowrap"
|
|
1617
|
-
}, /*#__PURE__*/
|
|
1602
|
+
}, /*#__PURE__*/React.createElement(DropdownSection, {
|
|
1618
1603
|
items: sources,
|
|
1619
1604
|
value: filters.source || null,
|
|
1620
1605
|
onChange: onSourceChange
|
|
1621
|
-
})) : null, media !== null ? /*#__PURE__*/
|
|
1606
|
+
})) : null, media !== null ? /*#__PURE__*/React.createElement("div", {
|
|
1622
1607
|
className: "w-100 d-flex flex-nowrap justify-content-between"
|
|
1623
|
-
}, /*#__PURE__*/
|
|
1624
|
-
className:
|
|
1625
|
-
}, /*#__PURE__*/
|
|
1608
|
+
}, /*#__PURE__*/React.createElement("form", {
|
|
1609
|
+
className: classNames(['d-flex', 'me-2'])
|
|
1610
|
+
}, /*#__PURE__*/React.createElement(components.Button, {
|
|
1626
1611
|
theme: "secondary",
|
|
1627
1612
|
outline: true,
|
|
1628
1613
|
size: "sm",
|
|
1629
|
-
icon: /*#__PURE__*/
|
|
1614
|
+
icon: /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
1630
1615
|
icon: faChevronLeft.faChevronLeft
|
|
1631
1616
|
}),
|
|
1632
1617
|
onClick: onClickBack
|
|
1633
|
-
})), /*#__PURE__*/
|
|
1618
|
+
})), /*#__PURE__*/React.createElement("strong", {
|
|
1634
1619
|
className: "navbar-text me-auto w-100 text-truncate text-light"
|
|
1635
|
-
}, media !== null ? media.name : null)) : null, media === null ? /*#__PURE__*/
|
|
1620
|
+
}, media !== null ? media.name : null)) : null, media === null ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
1636
1621
|
className: "d-flex w-100 flex-nowrap justify-content-between"
|
|
1637
|
-
}, /*#__PURE__*/
|
|
1622
|
+
}, /*#__PURE__*/React.createElement(Search, {
|
|
1638
1623
|
value: searchValue,
|
|
1639
1624
|
onChange: onSearchChange,
|
|
1640
1625
|
onFocus: onSearchFocus,
|
|
1641
1626
|
onClickIcon: onToggleMenu,
|
|
1642
1627
|
loading: loading,
|
|
1643
|
-
className:
|
|
1644
|
-
})), open ? /*#__PURE__*/
|
|
1628
|
+
className: classNames(['d-flex'])
|
|
1629
|
+
})), open ? /*#__PURE__*/React.createElement("div", {
|
|
1645
1630
|
className: "d-flex w-100 my-1 flex-nowrap justify-content-between"
|
|
1646
|
-
}, /*#__PURE__*/
|
|
1631
|
+
}, /*#__PURE__*/React.createElement(SearchFilters, {
|
|
1647
1632
|
filters: filters,
|
|
1648
1633
|
sections: sections,
|
|
1649
1634
|
onChange: onFilterChange,
|
|
1650
1635
|
onClose: onCloseFilters
|
|
1651
|
-
})) : null) : null, hasFilter && !open && media === null ? /*#__PURE__*/
|
|
1636
|
+
})) : null) : null, hasFilter && !open && media === null ? /*#__PURE__*/React.createElement("div", {
|
|
1652
1637
|
className: "list-group-item py-2 px-2 d-flex w-100 my-2 flex-nowrap justify-content-between"
|
|
1653
|
-
}, /*#__PURE__*/
|
|
1638
|
+
}, /*#__PURE__*/React.createElement(ActiveFilters, {
|
|
1654
1639
|
filters: filters,
|
|
1655
1640
|
sections: sections,
|
|
1656
1641
|
onChange: onFilterChange,
|
|
@@ -1664,20 +1649,20 @@ var styles = {"container":"micromag-media-gallery-container","metadataOpened":"m
|
|
|
1664
1649
|
|
|
1665
1650
|
var videoTypes = ['video', 'image/gif'];
|
|
1666
1651
|
var propTypes = {
|
|
1667
|
-
type:
|
|
1668
|
-
source:
|
|
1669
|
-
isPicker:
|
|
1670
|
-
isSmall:
|
|
1671
|
-
withoutTitle:
|
|
1672
|
-
withoutSource:
|
|
1673
|
-
withoutType:
|
|
1652
|
+
type: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
|
|
1653
|
+
source: PropTypes.string,
|
|
1654
|
+
isPicker: PropTypes.bool,
|
|
1655
|
+
isSmall: PropTypes.bool,
|
|
1656
|
+
withoutTitle: PropTypes.bool,
|
|
1657
|
+
withoutSource: PropTypes.bool,
|
|
1658
|
+
withoutType: PropTypes.bool,
|
|
1674
1659
|
medias: core.PropTypes.medias,
|
|
1675
1660
|
selectedMedia: core.PropTypes.media,
|
|
1676
|
-
className:
|
|
1677
|
-
navbarClassName:
|
|
1678
|
-
onChange:
|
|
1679
|
-
onClickMedia:
|
|
1680
|
-
onClearMedia:
|
|
1661
|
+
className: PropTypes.string,
|
|
1662
|
+
navbarClassName: PropTypes.string,
|
|
1663
|
+
onChange: PropTypes.func,
|
|
1664
|
+
onClickMedia: PropTypes.func,
|
|
1665
|
+
onClearMedia: PropTypes.func
|
|
1681
1666
|
};
|
|
1682
1667
|
var defaultProps = {
|
|
1683
1668
|
type: null,
|
|
@@ -1696,7 +1681,6 @@ var defaultProps = {
|
|
|
1696
1681
|
onClearMedia: null
|
|
1697
1682
|
};
|
|
1698
1683
|
function MediaGallery(_ref) {
|
|
1699
|
-
var _ref8;
|
|
1700
1684
|
var type = _ref.type,
|
|
1701
1685
|
source = _ref.source,
|
|
1702
1686
|
isPicker = _ref.isPicker,
|
|
@@ -1721,11 +1705,11 @@ function MediaGallery(_ref) {
|
|
|
1721
1705
|
// Filters
|
|
1722
1706
|
var throttle = React.useRef(null);
|
|
1723
1707
|
var _useState = React.useState(defaultFilters),
|
|
1724
|
-
_useState2 =
|
|
1708
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1725
1709
|
queryValue = _useState2[0],
|
|
1726
1710
|
setQueryValue = _useState2[1];
|
|
1727
1711
|
var _useState3 = React.useState(defaultFilters),
|
|
1728
|
-
_useState4 =
|
|
1712
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1729
1713
|
filtersValue = _useState4[0],
|
|
1730
1714
|
setFiltersValue = _useState4[1];
|
|
1731
1715
|
var story = contexts.useStory();
|
|
@@ -1747,7 +1731,7 @@ function MediaGallery(_ref) {
|
|
|
1747
1731
|
setFiltersValue(value);
|
|
1748
1732
|
}, [setFiltersValue, setQueryValue, throttle]);
|
|
1749
1733
|
var _useState5 = React.useState(initialMedias),
|
|
1750
|
-
_useState6 =
|
|
1734
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1751
1735
|
defaultItems = _useState6[0],
|
|
1752
1736
|
setDefaultItems = _useState6[1];
|
|
1753
1737
|
|
|
@@ -1765,17 +1749,17 @@ function MediaGallery(_ref) {
|
|
|
1765
1749
|
|
|
1766
1750
|
// Temporary type filter
|
|
1767
1751
|
var _useState7 = React.useState([]),
|
|
1768
|
-
_useState8 =
|
|
1752
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
1769
1753
|
addedMedias = _useState8[0],
|
|
1770
1754
|
setAddedMedias = _useState8[1];
|
|
1771
1755
|
var medias = React.useMemo(function () {
|
|
1772
|
-
var allMedias = [].concat(
|
|
1756
|
+
var allMedias = [].concat(_toConsumableArray(addedMedias), _toConsumableArray(loadedMedias || []));
|
|
1773
1757
|
return allMedias.length > 0 ? allMedias : null;
|
|
1774
1758
|
}, [loadedMedias, addedMedias]);
|
|
1775
1759
|
|
|
1776
1760
|
// Medias
|
|
1777
1761
|
var _useState9 = React.useState(null),
|
|
1778
|
-
_useState10 =
|
|
1762
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
1779
1763
|
metadataMedia = _useState10[0],
|
|
1780
1764
|
setMetadataMedia = _useState10[1];
|
|
1781
1765
|
var onClickItem = React.useCallback(function (media) {
|
|
@@ -1841,11 +1825,11 @@ function MediaGallery(_ref) {
|
|
|
1841
1825
|
|
|
1842
1826
|
// Upload modal
|
|
1843
1827
|
var _useState11 = React.useState(false),
|
|
1844
|
-
_useState12 =
|
|
1828
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
1845
1829
|
uploading = _useState12[0],
|
|
1846
1830
|
setUploading = _useState12[1];
|
|
1847
1831
|
var _useState13 = React.useState(false),
|
|
1848
|
-
_useState14 =
|
|
1832
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
1849
1833
|
uploadModalOpened = _useState14[0],
|
|
1850
1834
|
setUploadModalOpened = _useState14[1];
|
|
1851
1835
|
var _useMediaCreate = data.useMediaCreate(),
|
|
@@ -1857,16 +1841,16 @@ function MediaGallery(_ref) {
|
|
|
1857
1841
|
setUploading(true);
|
|
1858
1842
|
Promise.all(newMedias.map(createMedia)).then(function (newAddedMedias) {
|
|
1859
1843
|
setUploading(false);
|
|
1860
|
-
return setAddedMedias([].concat(
|
|
1844
|
+
return setAddedMedias([].concat(_toConsumableArray(addedMedias), _toConsumableArray(newAddedMedias)));
|
|
1861
1845
|
});
|
|
1862
1846
|
}, [createMedia, addedMedias, setAddedMedias]);
|
|
1863
1847
|
var onUploadRequestClose = React.useCallback(function () {
|
|
1864
1848
|
return setUploadModalOpened(false);
|
|
1865
1849
|
}, [setUploadModalOpened]);
|
|
1866
|
-
return /*#__PURE__*/
|
|
1867
|
-
className:
|
|
1868
|
-
}, /*#__PURE__*/
|
|
1869
|
-
types:
|
|
1850
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1851
|
+
className: classNames([styles.container, _defineProperty(_defineProperty({}, styles.metadataOpened, metadataMedia !== null), className, className)])
|
|
1852
|
+
}, /*#__PURE__*/React.createElement(Navbar, {
|
|
1853
|
+
types: isArray(type) ? type : [type],
|
|
1870
1854
|
filters: filtersValue,
|
|
1871
1855
|
media: metadataMedia !== null ? metadataMedia : null,
|
|
1872
1856
|
selectedMedia: selectedMedia,
|
|
@@ -1884,11 +1868,11 @@ function MediaGallery(_ref) {
|
|
|
1884
1868
|
tags: tags,
|
|
1885
1869
|
loading: loading || uploading,
|
|
1886
1870
|
className: navbarClassName
|
|
1887
|
-
}), /*#__PURE__*/
|
|
1871
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1888
1872
|
className: styles.content
|
|
1889
|
-
}, /*#__PURE__*/
|
|
1873
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1890
1874
|
className: styles.gallery
|
|
1891
|
-
}, medias !== null && !uploading ? /*#__PURE__*/
|
|
1875
|
+
}, medias !== null && !uploading ? /*#__PURE__*/React.createElement(Gallery, {
|
|
1892
1876
|
items: medias,
|
|
1893
1877
|
selectedItem: selectedMedia,
|
|
1894
1878
|
selectedFirst: true,
|
|
@@ -1897,11 +1881,11 @@ function MediaGallery(_ref) {
|
|
|
1897
1881
|
onClickItem: onClickItem,
|
|
1898
1882
|
onClickItemInfo: onClickItemInfo,
|
|
1899
1883
|
onClickRemoveItem: onClickRemoveItem
|
|
1900
|
-
}) : null, !allLoaded ? /*#__PURE__*/
|
|
1884
|
+
}) : null, !allLoaded ? /*#__PURE__*/React.createElement("div", {
|
|
1901
1885
|
className: "w-100 mb-2"
|
|
1902
|
-
}, loading || uploading ? /*#__PURE__*/
|
|
1886
|
+
}, loading || uploading ? /*#__PURE__*/React.createElement(components.Spinner, {
|
|
1903
1887
|
className: styles.loading
|
|
1904
|
-
}) : null, !loading && !uploading ? /*#__PURE__*/
|
|
1888
|
+
}) : null, !loading && !uploading ? /*#__PURE__*/React.createElement(components.Button, {
|
|
1905
1889
|
className: "d-block mx-auto",
|
|
1906
1890
|
theme: "secondary",
|
|
1907
1891
|
outline: true,
|
|
@@ -1912,9 +1896,9 @@ function MediaGallery(_ref) {
|
|
|
1912
1896
|
"type": 0,
|
|
1913
1897
|
"value": "Load more"
|
|
1914
1898
|
}]
|
|
1915
|
-
})) : null) : null), /*#__PURE__*/
|
|
1899
|
+
})) : null) : null), /*#__PURE__*/React.createElement("div", {
|
|
1916
1900
|
className: styles.mediaMetadata
|
|
1917
|
-
}, /*#__PURE__*/
|
|
1901
|
+
}, /*#__PURE__*/React.createElement(MediaMetadata, {
|
|
1918
1902
|
media: metadataMedia,
|
|
1919
1903
|
tags: tags,
|
|
1920
1904
|
onChange: onMetadataChange,
|
|
@@ -1922,7 +1906,7 @@ function MediaGallery(_ref) {
|
|
|
1922
1906
|
// onClickSave={onMetadataClickSave}
|
|
1923
1907
|
,
|
|
1924
1908
|
onClickDelete: onMetadataClickDelete
|
|
1925
|
-
}))), /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/
|
|
1909
|
+
}))), /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React.createElement(components.UploadModal, {
|
|
1926
1910
|
type: type === 'video' ? videoTypes : type,
|
|
1927
1911
|
opened: uploadModalOpened,
|
|
1928
1912
|
onUploaded: onUploadCompleted,
|