@micromag/media-gallery 0.3.531 → 0.3.532
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 +12 -4
- package/lib/index.js +12 -4
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
4
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
6
|
import isArray from 'lodash/isArray';
|
|
@@ -180,8 +181,9 @@ var defaultFields = [{
|
|
|
180
181
|
component: 'select',
|
|
181
182
|
requestUrl: '/api/medias/tags',
|
|
182
183
|
optionLabelPath: 'name',
|
|
183
|
-
optionValuePath: '
|
|
184
|
-
// Uses taggable
|
|
184
|
+
optionValuePath: 'id',
|
|
185
|
+
// Uses taggable so change the logic here
|
|
186
|
+
valueIsOption: true,
|
|
185
187
|
multiple: true,
|
|
186
188
|
paginated: false
|
|
187
189
|
}]
|
|
@@ -410,6 +412,7 @@ function filters() {
|
|
|
410
412
|
|
|
411
413
|
var styles = {"container":"micromag-media-gallery-new-media-gallery-container","browser":"micromag-media-gallery-new-media-gallery-browser"};
|
|
412
414
|
|
|
415
|
+
var _excluded = ["value"];
|
|
413
416
|
var propTypes = {
|
|
414
417
|
value: PropTypes.shape({
|
|
415
418
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
@@ -548,8 +551,13 @@ function MediaGallery(_ref) {
|
|
|
548
551
|
options: (options || []).map(function () {
|
|
549
552
|
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
550
553
|
_ref4$value = _ref4.value,
|
|
551
|
-
optionValue = _ref4$value === void 0 ? null : _ref4$value
|
|
552
|
-
|
|
554
|
+
optionValue = _ref4$value === void 0 ? null : _ref4$value,
|
|
555
|
+
props = _objectWithoutProperties(_ref4, _excluded);
|
|
556
|
+
return optionValue === 'document-' ? _objectSpread({
|
|
557
|
+
value: "document-".concat(storyId)
|
|
558
|
+
}, props) : _objectSpread({
|
|
559
|
+
value: optionValue
|
|
560
|
+
}, props);
|
|
553
561
|
})
|
|
554
562
|
});
|
|
555
563
|
}
|
package/lib/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
5
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
6
|
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
6
7
|
var classNames = require('classnames');
|
|
7
8
|
var isArray = require('lodash/isArray');
|
|
@@ -182,8 +183,9 @@ var defaultFields = [{
|
|
|
182
183
|
component: 'select',
|
|
183
184
|
requestUrl: '/api/medias/tags',
|
|
184
185
|
optionLabelPath: 'name',
|
|
185
|
-
optionValuePath: '
|
|
186
|
-
// Uses taggable
|
|
186
|
+
optionValuePath: 'id',
|
|
187
|
+
// Uses taggable so change the logic here
|
|
188
|
+
valueIsOption: true,
|
|
187
189
|
multiple: true,
|
|
188
190
|
paginated: false
|
|
189
191
|
}]
|
|
@@ -450,6 +452,7 @@ function filters() {
|
|
|
450
452
|
|
|
451
453
|
var styles = {"container":"micromag-media-gallery-new-media-gallery-container","browser":"micromag-media-gallery-new-media-gallery-browser"};
|
|
452
454
|
|
|
455
|
+
var _excluded = ["value"];
|
|
453
456
|
var propTypes = {
|
|
454
457
|
value: PropTypes.shape({
|
|
455
458
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
@@ -588,8 +591,13 @@ function MediaGallery(_ref) {
|
|
|
588
591
|
options: (options || []).map(function () {
|
|
589
592
|
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
590
593
|
_ref4$value = _ref4.value,
|
|
591
|
-
optionValue = _ref4$value === void 0 ? null : _ref4$value
|
|
592
|
-
|
|
594
|
+
optionValue = _ref4$value === void 0 ? null : _ref4$value,
|
|
595
|
+
props = _objectWithoutProperties(_ref4, _excluded);
|
|
596
|
+
return optionValue === 'document-' ? _objectSpread({
|
|
597
|
+
value: "document-".concat(storyId)
|
|
598
|
+
}, props) : _objectSpread({
|
|
599
|
+
value: optionValue
|
|
600
|
+
}, props);
|
|
593
601
|
})
|
|
594
602
|
});
|
|
595
603
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/media-gallery",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.532",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"access": "public",
|
|
88
88
|
"registry": "https://registry.npmjs.org/"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "5c4722607cb4d35b72568ceaa7988c1a03ecfa17"
|
|
91
91
|
}
|