@micromag/media-gallery 0.4.49 → 0.4.50
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 +75 -73
- package/package.json +4 -4
package/es/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import isArray from 'lodash/isArray';
|
|
4
|
-
import
|
|
4
|
+
import { useMemo, useCallback } from 'react';
|
|
5
5
|
import { MediasPickerContainer, MediasBrowserContainer } from '@panneau/medias';
|
|
6
6
|
import { useStory } from '@micromag/core/contexts';
|
|
7
7
|
import { useApi, useMediaCreate } from '@micromag/data';
|
|
8
8
|
import { FormattedMessage } from 'react-intl';
|
|
9
|
+
import { jsx } from 'react/jsx-runtime';
|
|
9
10
|
import { useUrlGenerator } from '@folklore/routes';
|
|
10
11
|
|
|
11
12
|
var defaultColumns = [{
|
|
@@ -16,7 +17,7 @@ var defaultColumns = [{
|
|
|
16
17
|
sortable: false
|
|
17
18
|
}, {
|
|
18
19
|
id: 'name',
|
|
19
|
-
label: /*#__PURE__*/
|
|
20
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
20
21
|
id: "WX83V9",
|
|
21
22
|
defaultMessage: [{
|
|
22
23
|
"type": 0,
|
|
@@ -27,28 +28,28 @@ var defaultColumns = [{
|
|
|
27
28
|
path: 'name',
|
|
28
29
|
descriptionPath: 'type',
|
|
29
30
|
descriptionValues: {
|
|
30
|
-
image: /*#__PURE__*/
|
|
31
|
+
image: /*#__PURE__*/jsx(FormattedMessage, {
|
|
31
32
|
id: "AwDQvD",
|
|
32
33
|
defaultMessage: [{
|
|
33
34
|
"type": 0,
|
|
34
35
|
"value": "Image"
|
|
35
36
|
}]
|
|
36
37
|
}),
|
|
37
|
-
video: /*#__PURE__*/
|
|
38
|
+
video: /*#__PURE__*/jsx(FormattedMessage, {
|
|
38
39
|
id: "mQiyAm",
|
|
39
40
|
defaultMessage: [{
|
|
40
41
|
"type": 0,
|
|
41
42
|
"value": "Video"
|
|
42
43
|
}]
|
|
43
44
|
}),
|
|
44
|
-
audio: /*#__PURE__*/
|
|
45
|
+
audio: /*#__PURE__*/jsx(FormattedMessage, {
|
|
45
46
|
id: "XnyI69",
|
|
46
47
|
defaultMessage: [{
|
|
47
48
|
"type": 0,
|
|
48
49
|
"value": "Audio"
|
|
49
50
|
}]
|
|
50
51
|
}),
|
|
51
|
-
document: /*#__PURE__*/
|
|
52
|
+
document: /*#__PURE__*/jsx(FormattedMessage, {
|
|
52
53
|
id: "1dqmFw",
|
|
53
54
|
defaultMessage: [{
|
|
54
55
|
"type": 0,
|
|
@@ -59,7 +60,7 @@ var defaultColumns = [{
|
|
|
59
60
|
sortable: true
|
|
60
61
|
}, {
|
|
61
62
|
id: 'dimensions',
|
|
62
|
-
label: /*#__PURE__*/
|
|
63
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
63
64
|
id: "eCe9ZY",
|
|
64
65
|
defaultMessage: [{
|
|
65
66
|
"type": 0,
|
|
@@ -71,7 +72,7 @@ var defaultColumns = [{
|
|
|
71
72
|
path: 'metadata'
|
|
72
73
|
}, {
|
|
73
74
|
id: 'size',
|
|
74
|
-
label: /*#__PURE__*/
|
|
75
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
75
76
|
id: "c3hu9o",
|
|
76
77
|
defaultMessage: [{
|
|
77
78
|
"type": 0,
|
|
@@ -83,7 +84,7 @@ var defaultColumns = [{
|
|
|
83
84
|
path: 'metadata.size'
|
|
84
85
|
}, {
|
|
85
86
|
id: 'duration',
|
|
86
|
-
label: /*#__PURE__*/
|
|
87
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
87
88
|
id: "002oWQ",
|
|
88
89
|
defaultMessage: [{
|
|
89
90
|
"type": 0,
|
|
@@ -104,7 +105,7 @@ var defaultColumns = [{
|
|
|
104
105
|
// },
|
|
105
106
|
{
|
|
106
107
|
id: 'created_at',
|
|
107
|
-
label: /*#__PURE__*/
|
|
108
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
108
109
|
id: "OzYWZz",
|
|
109
110
|
defaultMessage: [{
|
|
110
111
|
"type": 0,
|
|
@@ -117,7 +118,7 @@ var defaultColumns = [{
|
|
|
117
118
|
sortable: true
|
|
118
119
|
}, {
|
|
119
120
|
id: 'actions',
|
|
120
|
-
label: /*#__PURE__*/
|
|
121
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
121
122
|
id: "rtwfuZ",
|
|
122
123
|
defaultMessage: [{
|
|
123
124
|
"type": 0,
|
|
@@ -141,7 +142,7 @@ function fields() {
|
|
|
141
142
|
var route = useUrlGenerator();
|
|
142
143
|
return [{
|
|
143
144
|
name: 'name',
|
|
144
|
-
label: /*#__PURE__*/
|
|
145
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
145
146
|
id: "WX83V9",
|
|
146
147
|
defaultMessage: [{
|
|
147
148
|
"type": 0,
|
|
@@ -156,7 +157,7 @@ function fields() {
|
|
|
156
157
|
name: 'metadata',
|
|
157
158
|
fields: [{
|
|
158
159
|
name: 'description',
|
|
159
|
-
label: /*#__PURE__*/
|
|
160
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
160
161
|
id: "ygNvmz",
|
|
161
162
|
defaultMessage: [{
|
|
162
163
|
"type": 0,
|
|
@@ -167,7 +168,7 @@ function fields() {
|
|
|
167
168
|
component: 'text'
|
|
168
169
|
}, {
|
|
169
170
|
name: 'tags',
|
|
170
|
-
label: /*#__PURE__*/
|
|
171
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
171
172
|
id: "IOVper",
|
|
172
173
|
defaultMessage: [{
|
|
173
174
|
"type": 0,
|
|
@@ -190,7 +191,7 @@ function fields() {
|
|
|
190
191
|
}, {
|
|
191
192
|
id: 'info',
|
|
192
193
|
component: 'fields',
|
|
193
|
-
label: /*#__PURE__*/
|
|
194
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
194
195
|
id: "3RT69u",
|
|
195
196
|
defaultMessage: [{
|
|
196
197
|
"type": 0,
|
|
@@ -201,7 +202,7 @@ function fields() {
|
|
|
201
202
|
hideWithoutValue: true,
|
|
202
203
|
fields: [{
|
|
203
204
|
id: 'user',
|
|
204
|
-
label: /*#__PURE__*/
|
|
205
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
205
206
|
id: "yByaBh",
|
|
206
207
|
defaultMessage: [{
|
|
207
208
|
"type": 0,
|
|
@@ -214,7 +215,7 @@ function fields() {
|
|
|
214
215
|
horizontal: true
|
|
215
216
|
}, {
|
|
216
217
|
id: 'created_at',
|
|
217
|
-
label: /*#__PURE__*/
|
|
218
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
218
219
|
id: "PN+75e",
|
|
219
220
|
defaultMessage: [{
|
|
220
221
|
"type": 0,
|
|
@@ -230,7 +231,7 @@ function fields() {
|
|
|
230
231
|
}, {
|
|
231
232
|
id: 'technical',
|
|
232
233
|
component: 'fields',
|
|
233
|
-
label: /*#__PURE__*/
|
|
234
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
234
235
|
id: "xKUOLG",
|
|
235
236
|
defaultMessage: [{
|
|
236
237
|
"type": 0,
|
|
@@ -241,7 +242,7 @@ function fields() {
|
|
|
241
242
|
hideWithoutValue: true,
|
|
242
243
|
fields: [{
|
|
243
244
|
id: 'format',
|
|
244
|
-
label: /*#__PURE__*/
|
|
245
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
245
246
|
id: "JuxiUN",
|
|
246
247
|
defaultMessage: [{
|
|
247
248
|
"type": 0,
|
|
@@ -255,7 +256,7 @@ function fields() {
|
|
|
255
256
|
horizontal: true
|
|
256
257
|
}, {
|
|
257
258
|
id: 'dimensions',
|
|
258
|
-
label: /*#__PURE__*/
|
|
259
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
259
260
|
id: "rmJBin",
|
|
260
261
|
defaultMessage: [{
|
|
261
262
|
"type": 0,
|
|
@@ -269,7 +270,7 @@ function fields() {
|
|
|
269
270
|
horizontal: true
|
|
270
271
|
}, {
|
|
271
272
|
id: 'size',
|
|
272
|
-
label: /*#__PURE__*/
|
|
273
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
273
274
|
id: "g2CRt5",
|
|
274
275
|
defaultMessage: [{
|
|
275
276
|
"type": 0,
|
|
@@ -283,7 +284,7 @@ function fields() {
|
|
|
283
284
|
horizontal: true
|
|
284
285
|
}, {
|
|
285
286
|
id: 'duration',
|
|
286
|
-
label: /*#__PURE__*/
|
|
287
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
287
288
|
id: "wU++NJ",
|
|
288
289
|
defaultMessage: [{
|
|
289
290
|
"type": 0,
|
|
@@ -299,7 +300,7 @@ function fields() {
|
|
|
299
300
|
}, {
|
|
300
301
|
id: 'conversion',
|
|
301
302
|
component: 'fields',
|
|
302
|
-
label: /*#__PURE__*/
|
|
303
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
303
304
|
id: "pBNrdH",
|
|
304
305
|
defaultMessage: [{
|
|
305
306
|
"type": 0,
|
|
@@ -310,7 +311,7 @@ function fields() {
|
|
|
310
311
|
hideWithoutValue: true,
|
|
311
312
|
fields: [{
|
|
312
313
|
id: 'h264',
|
|
313
|
-
label: /*#__PURE__*/
|
|
314
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
314
315
|
id: "4RV6+9",
|
|
315
316
|
defaultMessage: [{
|
|
316
317
|
"type": 0,
|
|
@@ -323,7 +324,7 @@ function fields() {
|
|
|
323
324
|
horizontal: true
|
|
324
325
|
}, {
|
|
325
326
|
id: 'webm',
|
|
326
|
-
label: /*#__PURE__*/
|
|
327
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
327
328
|
id: "3I2Xl7",
|
|
328
329
|
defaultMessage: [{
|
|
329
330
|
"type": 0,
|
|
@@ -349,7 +350,7 @@ function filters() {
|
|
|
349
350
|
id: 'types',
|
|
350
351
|
component: 'select',
|
|
351
352
|
name: 'types',
|
|
352
|
-
placeholder: /*#__PURE__*/
|
|
353
|
+
placeholder: /*#__PURE__*/jsx(FormattedMessage, {
|
|
353
354
|
id: "9/t5wK",
|
|
354
355
|
defaultMessage: [{
|
|
355
356
|
"type": 0,
|
|
@@ -357,7 +358,7 @@ function filters() {
|
|
|
357
358
|
}]
|
|
358
359
|
}),
|
|
359
360
|
options: [{
|
|
360
|
-
label: /*#__PURE__*/
|
|
361
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
361
362
|
id: "yHAmDD",
|
|
362
363
|
defaultMessage: [{
|
|
363
364
|
"type": 0,
|
|
@@ -366,7 +367,7 @@ function filters() {
|
|
|
366
367
|
}),
|
|
367
368
|
value: 'image'
|
|
368
369
|
}, {
|
|
369
|
-
label: /*#__PURE__*/
|
|
370
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
370
371
|
id: "xSERPA",
|
|
371
372
|
defaultMessage: [{
|
|
372
373
|
"type": 0,
|
|
@@ -375,7 +376,7 @@ function filters() {
|
|
|
375
376
|
}),
|
|
376
377
|
value: 'video'
|
|
377
378
|
}, {
|
|
378
|
-
label: /*#__PURE__*/
|
|
379
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
379
380
|
id: "yQRtgx",
|
|
380
381
|
defaultMessage: [{
|
|
381
382
|
"type": 0,
|
|
@@ -384,7 +385,7 @@ function filters() {
|
|
|
384
385
|
}),
|
|
385
386
|
value: 'audio'
|
|
386
387
|
}, {
|
|
387
|
-
label: /*#__PURE__*/
|
|
388
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
388
389
|
id: "fpQzza",
|
|
389
390
|
defaultMessage: [{
|
|
390
391
|
"type": 0,
|
|
@@ -398,7 +399,7 @@ function filters() {
|
|
|
398
399
|
id: 'authors',
|
|
399
400
|
component: 'select',
|
|
400
401
|
name: 'authors',
|
|
401
|
-
placeholder: /*#__PURE__*/
|
|
402
|
+
placeholder: /*#__PURE__*/jsx(FormattedMessage, {
|
|
402
403
|
id: "7oXkoj",
|
|
403
404
|
defaultMessage: [{
|
|
404
405
|
"type": 0,
|
|
@@ -414,7 +415,7 @@ function filters() {
|
|
|
414
415
|
id: 'tags',
|
|
415
416
|
component: 'select',
|
|
416
417
|
name: 'tags',
|
|
417
|
-
placeholder: /*#__PURE__*/
|
|
418
|
+
placeholder: /*#__PURE__*/jsx(FormattedMessage, {
|
|
418
419
|
id: "9mXl24",
|
|
419
420
|
defaultMessage: [{
|
|
420
421
|
"type": 0,
|
|
@@ -431,7 +432,7 @@ function filters() {
|
|
|
431
432
|
component: 'radios',
|
|
432
433
|
name: 'source',
|
|
433
434
|
options: [{
|
|
434
|
-
label: /*#__PURE__*/
|
|
435
|
+
label: /*#__PURE__*/jsx(FormattedMessage, {
|
|
435
436
|
id: "bCtuS/",
|
|
436
437
|
defaultMessage: [{
|
|
437
438
|
"type": 0,
|
|
@@ -596,46 +597,47 @@ function MediaGallery(_ref) {
|
|
|
596
597
|
source: source
|
|
597
598
|
} : null;
|
|
598
599
|
}, [source]);
|
|
599
|
-
return /*#__PURE__*/
|
|
600
|
-
className: classNames([styles.container, className])
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
600
|
+
return /*#__PURE__*/jsx("div", {
|
|
601
|
+
className: classNames([styles.container, className]),
|
|
602
|
+
children: isPicker ? /*#__PURE__*/jsx(MediasPickerContainer, {
|
|
603
|
+
className: styles.browser,
|
|
604
|
+
api: mediasApi,
|
|
605
|
+
value: value,
|
|
606
|
+
theme: "dark",
|
|
607
|
+
types: finalTypes,
|
|
608
|
+
query: finalQuery,
|
|
609
|
+
items: initialMedias,
|
|
610
|
+
filters: finalFilters,
|
|
611
|
+
fields: fields$1,
|
|
612
|
+
columns: columns,
|
|
613
|
+
multiple: multiple,
|
|
614
|
+
onChange: onChange,
|
|
615
|
+
uppyConfig: uppyConfig,
|
|
616
|
+
onMediaUploaded: onMediaUploaded,
|
|
617
|
+
onMediaFormOpen: onMediaFormOpen,
|
|
618
|
+
onMediaFormClose: onMediaFormClose,
|
|
619
|
+
withStickySelection: true,
|
|
620
|
+
withTrash: true
|
|
621
|
+
}) : /*#__PURE__*/jsx(MediasBrowserContainer, {
|
|
622
|
+
className: styles.browser,
|
|
623
|
+
api: mediasApi,
|
|
624
|
+
value: value,
|
|
625
|
+
theme: "dark",
|
|
626
|
+
types: finalTypes,
|
|
627
|
+
query: finalQuery,
|
|
628
|
+
items: initialMedias,
|
|
629
|
+
filters: finalFilters,
|
|
630
|
+
fields: fields$1,
|
|
631
|
+
columns: columns,
|
|
632
|
+
uppyConfig: uppyConfig,
|
|
633
|
+
onMediaUploaded: onMediaUploaded,
|
|
634
|
+
multipleSelection: true // allow multi-uploads in MediasBrowser
|
|
635
|
+
,
|
|
636
|
+
withStickySelection: true,
|
|
637
|
+
withTrash: true,
|
|
638
|
+
withReplace: true
|
|
639
|
+
})
|
|
640
|
+
});
|
|
639
641
|
}
|
|
640
642
|
|
|
641
643
|
export { MediaGallery as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/media-gallery",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.50",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
70
70
|
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
|
71
71
|
"@fortawesome/react-fontawesome": "^3.2.0",
|
|
72
|
-
"@micromag/core": "^0.4.
|
|
73
|
-
"@micromag/data": "^0.4.
|
|
72
|
+
"@micromag/core": "^0.4.50",
|
|
73
|
+
"@micromag/data": "^0.4.50",
|
|
74
74
|
"@panneau/medias": "^4.0.29",
|
|
75
75
|
"bootstrap": "^5.3.8",
|
|
76
76
|
"classnames": "^2.2.6",
|
|
@@ -83,6 +83,6 @@
|
|
|
83
83
|
"access": "public",
|
|
84
84
|
"registry": "https://registry.npmjs.org/"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
|
|
87
87
|
"types": "es/index.d.ts"
|
|
88
88
|
}
|