@micromag/media-gallery 0.3.561 → 0.3.564
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 +144 -140
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -141,164 +141,167 @@ var defaultColumns = [{
|
|
|
141
141
|
// },
|
|
142
142
|
];
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
defaultMessage: [{
|
|
149
|
-
"type": 0,
|
|
150
|
-
"value": "File name"
|
|
151
|
-
}]
|
|
152
|
-
}),
|
|
153
|
-
type: 'text',
|
|
154
|
-
component: 'text'
|
|
155
|
-
}, {
|
|
156
|
-
id: 'metadata',
|
|
157
|
-
component: 'fields',
|
|
158
|
-
name: 'metadata',
|
|
159
|
-
fields: [{
|
|
160
|
-
name: 'description',
|
|
144
|
+
function fields() {
|
|
145
|
+
var route = useUrlGenerator();
|
|
146
|
+
return [{
|
|
147
|
+
name: 'name',
|
|
161
148
|
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
162
|
-
id: "
|
|
149
|
+
id: "WX83V9",
|
|
163
150
|
defaultMessage: [{
|
|
164
151
|
"type": 0,
|
|
165
|
-
"value": "
|
|
152
|
+
"value": "File name"
|
|
166
153
|
}]
|
|
167
154
|
}),
|
|
168
155
|
type: 'text',
|
|
169
156
|
component: 'text'
|
|
170
157
|
}, {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
158
|
+
id: 'metadata',
|
|
159
|
+
component: 'fields',
|
|
160
|
+
name: 'metadata',
|
|
161
|
+
fields: [{
|
|
162
|
+
name: 'description',
|
|
163
|
+
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
164
|
+
id: "ygNvmz",
|
|
165
|
+
defaultMessage: [{
|
|
166
|
+
"type": 0,
|
|
167
|
+
"value": "Description"
|
|
168
|
+
}]
|
|
169
|
+
}),
|
|
170
|
+
type: 'text',
|
|
171
|
+
component: 'text'
|
|
172
|
+
}, {
|
|
173
|
+
name: 'tags',
|
|
174
|
+
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
175
|
+
id: "IOVper",
|
|
176
|
+
defaultMessage: [{
|
|
177
|
+
"type": 0,
|
|
178
|
+
"value": "Tags"
|
|
179
|
+
}]
|
|
180
|
+
}),
|
|
181
|
+
createPrefix: 'Create',
|
|
182
|
+
type: 'array',
|
|
183
|
+
component: 'item',
|
|
184
|
+
requestUrl: route('medias.tags') || '/medias/tags',
|
|
185
|
+
itemLabelPath: 'name',
|
|
186
|
+
itemDescriptionPath: null,
|
|
187
|
+
itemValuePath: 'id',
|
|
188
|
+
// Uses taggable so change the logic here
|
|
189
|
+
valueIsOption: true,
|
|
190
|
+
multiple: true,
|
|
191
|
+
paginated: false,
|
|
192
|
+
creatable: true
|
|
200
193
|
}]
|
|
201
|
-
}),
|
|
202
|
-
isList: true,
|
|
203
|
-
hideWithoutValue: true,
|
|
204
|
-
fields: [{
|
|
205
|
-
id: 'user',
|
|
206
|
-
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
207
|
-
id: "yByaBh",
|
|
208
|
-
defaultMessage: [{
|
|
209
|
-
"type": 0,
|
|
210
|
-
"value": "Added by"
|
|
211
|
-
}]
|
|
212
|
-
}),
|
|
213
|
-
type: 'display',
|
|
214
|
-
display: 'avatar',
|
|
215
|
-
name: 'user',
|
|
216
|
-
horizontal: true
|
|
217
194
|
}, {
|
|
218
|
-
id: '
|
|
195
|
+
id: 'info',
|
|
196
|
+
component: 'fields',
|
|
219
197
|
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
220
|
-
id: "
|
|
198
|
+
id: "3RT69u",
|
|
221
199
|
defaultMessage: [{
|
|
222
200
|
"type": 0,
|
|
223
|
-
"value": "
|
|
201
|
+
"value": "Informations"
|
|
224
202
|
}]
|
|
225
203
|
}),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
204
|
+
isList: true,
|
|
205
|
+
hideWithoutValue: true,
|
|
206
|
+
fields: [{
|
|
207
|
+
id: 'user',
|
|
208
|
+
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
209
|
+
id: "yByaBh",
|
|
210
|
+
defaultMessage: [{
|
|
211
|
+
"type": 0,
|
|
212
|
+
"value": "Added by"
|
|
213
|
+
}]
|
|
214
|
+
}),
|
|
215
|
+
type: 'display',
|
|
216
|
+
display: 'avatar',
|
|
217
|
+
name: 'user',
|
|
218
|
+
horizontal: true
|
|
219
|
+
}, {
|
|
220
|
+
id: 'created_at',
|
|
221
|
+
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
222
|
+
id: "PN+75e",
|
|
223
|
+
defaultMessage: [{
|
|
224
|
+
"type": 0,
|
|
225
|
+
"value": "Created at"
|
|
226
|
+
}]
|
|
227
|
+
}),
|
|
228
|
+
type: 'display',
|
|
229
|
+
display: 'date',
|
|
230
|
+
name: 'created_at',
|
|
231
|
+
format: 'yyyy-MM-dd hh:ss',
|
|
232
|
+
horizontal: true
|
|
240
233
|
}]
|
|
241
|
-
}),
|
|
242
|
-
isList: true,
|
|
243
|
-
hideWithoutValue: true,
|
|
244
|
-
fields: [{
|
|
245
|
-
id: 'format',
|
|
246
|
-
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
247
|
-
id: "JuxiUN",
|
|
248
|
-
defaultMessage: [{
|
|
249
|
-
"type": 0,
|
|
250
|
-
"value": "Format"
|
|
251
|
-
}]
|
|
252
|
-
}),
|
|
253
|
-
type: 'display',
|
|
254
|
-
display: 'unit',
|
|
255
|
-
format: 'format',
|
|
256
|
-
name: 'format',
|
|
257
|
-
horizontal: true
|
|
258
234
|
}, {
|
|
259
|
-
id: '
|
|
235
|
+
id: 'technical',
|
|
236
|
+
component: 'fields',
|
|
260
237
|
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
261
|
-
id: "
|
|
238
|
+
id: "xKUOLG",
|
|
262
239
|
defaultMessage: [{
|
|
263
240
|
"type": 0,
|
|
264
|
-
"value": "
|
|
241
|
+
"value": "Technical details"
|
|
265
242
|
}]
|
|
266
243
|
}),
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
244
|
+
isList: true,
|
|
245
|
+
hideWithoutValue: true,
|
|
246
|
+
fields: [{
|
|
247
|
+
id: 'format',
|
|
248
|
+
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
249
|
+
id: "JuxiUN",
|
|
250
|
+
defaultMessage: [{
|
|
251
|
+
"type": 0,
|
|
252
|
+
"value": "Format"
|
|
253
|
+
}]
|
|
254
|
+
}),
|
|
255
|
+
type: 'display',
|
|
256
|
+
display: 'unit',
|
|
257
|
+
format: 'format',
|
|
258
|
+
name: 'format',
|
|
259
|
+
horizontal: true
|
|
260
|
+
}, {
|
|
261
|
+
id: 'dimensions',
|
|
262
|
+
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
263
|
+
id: "rmJBin",
|
|
264
|
+
defaultMessage: [{
|
|
265
|
+
"type": 0,
|
|
266
|
+
"value": "Dimensions"
|
|
267
|
+
}]
|
|
268
|
+
}),
|
|
269
|
+
type: 'display',
|
|
270
|
+
display: 'unit',
|
|
271
|
+
format: 'dimensions',
|
|
272
|
+
name: 'metadata',
|
|
273
|
+
horizontal: true
|
|
274
|
+
}, {
|
|
275
|
+
id: 'size',
|
|
276
|
+
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
277
|
+
id: "g2CRt5",
|
|
278
|
+
defaultMessage: [{
|
|
279
|
+
"type": 0,
|
|
280
|
+
"value": "Size"
|
|
281
|
+
}]
|
|
282
|
+
}),
|
|
283
|
+
type: 'display',
|
|
284
|
+
display: 'unit',
|
|
285
|
+
format: 'bytes',
|
|
286
|
+
name: 'metadata.size',
|
|
287
|
+
horizontal: true
|
|
288
|
+
}, {
|
|
289
|
+
id: 'duration',
|
|
290
|
+
label: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
291
|
+
id: "wU++NJ",
|
|
292
|
+
defaultMessage: [{
|
|
293
|
+
"type": 0,
|
|
294
|
+
"value": "Duration"
|
|
295
|
+
}]
|
|
296
|
+
}),
|
|
297
|
+
type: 'display',
|
|
298
|
+
display: 'unit',
|
|
299
|
+
format: 'duration',
|
|
300
|
+
name: 'metadata.duration',
|
|
301
|
+
horizontal: true
|
|
302
|
+
}]
|
|
303
|
+
}];
|
|
304
|
+
}
|
|
302
305
|
|
|
303
306
|
function filters() {
|
|
304
307
|
var route = useUrlGenerator();
|
|
@@ -435,7 +438,7 @@ var defaultProps = {
|
|
|
435
438
|
types: null,
|
|
436
439
|
source: 'all',
|
|
437
440
|
filters: null,
|
|
438
|
-
fields:
|
|
441
|
+
fields: null,
|
|
439
442
|
columns: defaultColumns,
|
|
440
443
|
isPicker: false,
|
|
441
444
|
multiple: false,
|
|
@@ -450,7 +453,7 @@ function MediaGallery(_ref) {
|
|
|
450
453
|
types = _ref.types,
|
|
451
454
|
source = _ref.source,
|
|
452
455
|
filters$1 = _ref.filters,
|
|
453
|
-
|
|
456
|
+
providedFields = _ref.fields,
|
|
454
457
|
columns = _ref.columns,
|
|
455
458
|
isPicker = _ref.isPicker,
|
|
456
459
|
multiple = _ref.multiple,
|
|
@@ -464,6 +467,7 @@ function MediaGallery(_ref) {
|
|
|
464
467
|
var _ref2 = story || {},
|
|
465
468
|
_ref2$id = _ref2.id,
|
|
466
469
|
storyId = _ref2$id === void 0 ? null : _ref2$id;
|
|
470
|
+
var fields$1 = providedFields === null ? fields() : providedFields;
|
|
467
471
|
var mediasApi = useMemo(function () {
|
|
468
472
|
return {
|
|
469
473
|
get: function get() {
|
|
@@ -599,7 +603,7 @@ function MediaGallery(_ref) {
|
|
|
599
603
|
query: finalQuery,
|
|
600
604
|
items: initialMedias,
|
|
601
605
|
filters: finalFilters,
|
|
602
|
-
fields: fields,
|
|
606
|
+
fields: fields$1,
|
|
603
607
|
columns: columns,
|
|
604
608
|
multiple: multiple,
|
|
605
609
|
onChange: onChange,
|
|
@@ -618,7 +622,7 @@ function MediaGallery(_ref) {
|
|
|
618
622
|
query: finalQuery,
|
|
619
623
|
items: initialMedias,
|
|
620
624
|
filters: finalFilters,
|
|
621
|
-
fields: fields,
|
|
625
|
+
fields: fields$1,
|
|
622
626
|
columns: columns,
|
|
623
627
|
uppyConfig: uppyConfig,
|
|
624
628
|
onMediaUploaded: onMediaUploaded,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/media-gallery",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.564",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"access": "public",
|
|
87
87
|
"registry": "https://registry.npmjs.org/"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "e8f28bbbfe6ffc35d31de6fb33786e073e3980ca"
|
|
90
90
|
}
|