@micromag/media-gallery 0.3.522 → 0.3.524
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/es/index.js +10 -32
- package/lib/index.js +10 -32
- package/package.json +4 -4
package/es/index.js
CHANGED
|
@@ -185,16 +185,6 @@ var defaultFields = [{
|
|
|
185
185
|
multiple: true,
|
|
186
186
|
paginated: false
|
|
187
187
|
}]
|
|
188
|
-
}, {
|
|
189
|
-
id: 'jobs',
|
|
190
|
-
component: 'jobs',
|
|
191
|
-
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
192
|
-
id: "SrFsAq",
|
|
193
|
-
defaultMessage: [{
|
|
194
|
-
"type": 0,
|
|
195
|
-
"value": "Jobs"
|
|
196
|
-
}]
|
|
197
|
-
})
|
|
198
188
|
}, {
|
|
199
189
|
id: 'info',
|
|
200
190
|
component: 'fields',
|
|
@@ -401,7 +391,6 @@ function filters() {
|
|
|
401
391
|
|
|
402
392
|
var styles = {"container":"micromag-media-gallery-new-media-gallery-container","browser":"micromag-media-gallery-new-media-gallery-browser"};
|
|
403
393
|
|
|
404
|
-
var videoTypes = ['video', 'image/gif'];
|
|
405
394
|
var propTypes = {
|
|
406
395
|
value: PropTypes.shape({
|
|
407
396
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
@@ -502,18 +491,23 @@ function MediaGallery(_ref) {
|
|
|
502
491
|
});
|
|
503
492
|
}, [createMedia]);
|
|
504
493
|
var fileTypes = useMemo(function () {
|
|
494
|
+
var finalTypes = [];
|
|
505
495
|
if (isArray(types)) {
|
|
506
|
-
|
|
496
|
+
finalTypes = types.map(function (t) {
|
|
507
497
|
return ['image', 'video', 'audio'].indexOf(t) !== -1 ? "".concat(t, "/*") : null;
|
|
508
498
|
}).filter(function (t) {
|
|
509
499
|
return t !== null;
|
|
510
500
|
});
|
|
511
501
|
}
|
|
512
|
-
|
|
502
|
+
finalTypes = ['image', 'video', 'audio'].indexOf(types) !== -1 ? ["".concat(types, "/*")] : null;
|
|
503
|
+
if (finalTypes !== null && isArray(finalTypes) && finalTypes.indexOf('video') !== -1) {
|
|
504
|
+
finalTypes.push('image/gif');
|
|
505
|
+
}
|
|
506
|
+
return finalTypes;
|
|
513
507
|
}, [types]);
|
|
514
508
|
var uppyConfig = useMemo(function () {
|
|
515
509
|
return {
|
|
516
|
-
// sources
|
|
510
|
+
// set sources ? - uppy sources -
|
|
517
511
|
allowedFileTypes: fileTypes !== null && fileTypes.length > 0 ? fileTypes : null
|
|
518
512
|
};
|
|
519
513
|
}, [fileTypes]);
|
|
@@ -530,7 +524,7 @@ function MediaGallery(_ref) {
|
|
|
530
524
|
return null;
|
|
531
525
|
}
|
|
532
526
|
return _objectSpread(_objectSpread({}, filter), {}, {
|
|
533
|
-
|
|
527
|
+
queryValue: "document-".concat(storyId)
|
|
534
528
|
});
|
|
535
529
|
}
|
|
536
530
|
return filter;
|
|
@@ -550,24 +544,8 @@ function MediaGallery(_ref) {
|
|
|
550
544
|
} : null));
|
|
551
545
|
}, [source, setQuery]);
|
|
552
546
|
var finalTypes = useMemo(function () {
|
|
553
|
-
|
|
554
|
-
return types === 'video' ? videoTypes : partialTypes;
|
|
547
|
+
return !isArray(types) && types !== null ? [types] : types;
|
|
555
548
|
}, [types]);
|
|
556
|
-
|
|
557
|
-
// const finalOnChange = useCallback(
|
|
558
|
-
// (newMedias) => {
|
|
559
|
-
// if (multiple) {
|
|
560
|
-
// onChange(newMedias || []);
|
|
561
|
-
// } else if (isArray(newMedias)) {
|
|
562
|
-
// const [firstMedia = null] = newMedias || [];
|
|
563
|
-
// onChange(firstMedia || null);
|
|
564
|
-
// } else {
|
|
565
|
-
// onChange(newMedias || null);
|
|
566
|
-
// }
|
|
567
|
-
// },
|
|
568
|
-
// [onChange, multiple],
|
|
569
|
-
// );
|
|
570
|
-
|
|
571
549
|
return /*#__PURE__*/React.createElement("div", {
|
|
572
550
|
className: classNames([styles.container, _defineProperty({}, className, className)])
|
|
573
551
|
}, isPicker ? /*#__PURE__*/React.createElement(MediasPickerContainer, {
|
package/lib/index.js
CHANGED
|
@@ -187,16 +187,6 @@ var defaultFields = [{
|
|
|
187
187
|
multiple: true,
|
|
188
188
|
paginated: false
|
|
189
189
|
}]
|
|
190
|
-
}, {
|
|
191
|
-
id: 'jobs',
|
|
192
|
-
component: 'jobs',
|
|
193
|
-
label: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
194
|
-
id: "SrFsAq",
|
|
195
|
-
defaultMessage: [{
|
|
196
|
-
"type": 0,
|
|
197
|
-
"value": "Jobs"
|
|
198
|
-
}]
|
|
199
|
-
})
|
|
200
190
|
}, {
|
|
201
191
|
id: 'info',
|
|
202
192
|
component: 'fields',
|
|
@@ -441,7 +431,6 @@ function filters() {
|
|
|
441
431
|
|
|
442
432
|
var styles = {"container":"micromag-media-gallery-new-media-gallery-container","browser":"micromag-media-gallery-new-media-gallery-browser"};
|
|
443
433
|
|
|
444
|
-
var videoTypes = ['video', 'image/gif'];
|
|
445
434
|
var propTypes = {
|
|
446
435
|
value: PropTypes.shape({
|
|
447
436
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
@@ -542,18 +531,23 @@ function MediaGallery(_ref) {
|
|
|
542
531
|
});
|
|
543
532
|
}, [createMedia]);
|
|
544
533
|
var fileTypes = React.useMemo(function () {
|
|
534
|
+
var finalTypes = [];
|
|
545
535
|
if (isArray(types)) {
|
|
546
|
-
|
|
536
|
+
finalTypes = types.map(function (t) {
|
|
547
537
|
return ['image', 'video', 'audio'].indexOf(t) !== -1 ? "".concat(t, "/*") : null;
|
|
548
538
|
}).filter(function (t) {
|
|
549
539
|
return t !== null;
|
|
550
540
|
});
|
|
551
541
|
}
|
|
552
|
-
|
|
542
|
+
finalTypes = ['image', 'video', 'audio'].indexOf(types) !== -1 ? ["".concat(types, "/*")] : null;
|
|
543
|
+
if (finalTypes !== null && isArray(finalTypes) && finalTypes.indexOf('video') !== -1) {
|
|
544
|
+
finalTypes.push('image/gif');
|
|
545
|
+
}
|
|
546
|
+
return finalTypes;
|
|
553
547
|
}, [types]);
|
|
554
548
|
var uppyConfig = React.useMemo(function () {
|
|
555
549
|
return {
|
|
556
|
-
// sources
|
|
550
|
+
// set sources ? - uppy sources -
|
|
557
551
|
allowedFileTypes: fileTypes !== null && fileTypes.length > 0 ? fileTypes : null
|
|
558
552
|
};
|
|
559
553
|
}, [fileTypes]);
|
|
@@ -570,7 +564,7 @@ function MediaGallery(_ref) {
|
|
|
570
564
|
return null;
|
|
571
565
|
}
|
|
572
566
|
return _objectSpread(_objectSpread({}, filter), {}, {
|
|
573
|
-
|
|
567
|
+
queryValue: "document-".concat(storyId)
|
|
574
568
|
});
|
|
575
569
|
}
|
|
576
570
|
return filter;
|
|
@@ -590,24 +584,8 @@ function MediaGallery(_ref) {
|
|
|
590
584
|
} : null));
|
|
591
585
|
}, [source, setQuery]);
|
|
592
586
|
var finalTypes = React.useMemo(function () {
|
|
593
|
-
|
|
594
|
-
return types === 'video' ? videoTypes : partialTypes;
|
|
587
|
+
return !isArray(types) && types !== null ? [types] : types;
|
|
595
588
|
}, [types]);
|
|
596
|
-
|
|
597
|
-
// const finalOnChange = useCallback(
|
|
598
|
-
// (newMedias) => {
|
|
599
|
-
// if (multiple) {
|
|
600
|
-
// onChange(newMedias || []);
|
|
601
|
-
// } else if (isArray(newMedias)) {
|
|
602
|
-
// const [firstMedia = null] = newMedias || [];
|
|
603
|
-
// onChange(firstMedia || null);
|
|
604
|
-
// } else {
|
|
605
|
-
// onChange(newMedias || null);
|
|
606
|
-
// }
|
|
607
|
-
// },
|
|
608
|
-
// [onChange, multiple],
|
|
609
|
-
// );
|
|
610
|
-
|
|
611
589
|
return /*#__PURE__*/React.createElement("div", {
|
|
612
590
|
className: classNames([styles.container, _defineProperty({}, className, className)])
|
|
613
591
|
}, isPicker ? /*#__PURE__*/React.createElement(medias.MediasPickerContainer, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/media-gallery",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.524",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
|
73
73
|
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
|
74
74
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
75
|
-
"@micromag/core": "^0.3.
|
|
76
|
-
"@micromag/data": "^0.3.
|
|
75
|
+
"@micromag/core": "^0.3.523",
|
|
76
|
+
"@micromag/data": "^0.3.523",
|
|
77
77
|
"@panneau/medias": "^3.0.163",
|
|
78
78
|
"bootstrap": "^5.3.1",
|
|
79
79
|
"classnames": "^2.2.6",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"access": "public",
|
|
88
88
|
"registry": "https://registry.npmjs.org/"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "5c033a775f4b9b5a72e61ba74573df7d83be9e4c"
|
|
91
91
|
}
|