@panneau/modal-medias-picker 3.0.310 → 4.0.0
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 +17 -33
- package/package.json +6 -6
package/es/index.js
CHANGED
|
@@ -1,44 +1,30 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
4
|
import React, { useState, useCallback } from 'react';
|
|
6
5
|
import { FormattedMessage } from 'react-intl';
|
|
7
6
|
import { MediasResourcePicker, MediasPickerContainer } from '@panneau/medias';
|
|
8
7
|
import Dialog from '@panneau/modal-dialog';
|
|
9
8
|
|
|
10
9
|
var _excluded = ["id", "value", "resource", "title", "onChange", "onClose", "confirmButton", "cancelButton", "multiple"];
|
|
11
|
-
var propTypes = {
|
|
12
|
-
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
13
|
-
value: PropTypes.shape({}),
|
|
14
|
-
resource: PropTypes.string,
|
|
15
|
-
title: PropTypes.string,
|
|
16
|
-
multiple: PropTypes.bool,
|
|
17
|
-
onChange: PropTypes.func,
|
|
18
|
-
onClose: PropTypes.func,
|
|
19
|
-
confirmButton: PropTypes.shape({}),
|
|
20
|
-
cancelButton: PropTypes.shape({})
|
|
21
|
-
};
|
|
22
|
-
var defaultProps = {
|
|
23
|
-
resource: null,
|
|
24
|
-
value: null,
|
|
25
|
-
title: null,
|
|
26
|
-
multiple: false,
|
|
27
|
-
onChange: null,
|
|
28
|
-
onClose: null,
|
|
29
|
-
confirmButton: null,
|
|
30
|
-
cancelButton: null
|
|
31
|
-
};
|
|
32
10
|
function MediasPickerModal(_ref) {
|
|
33
11
|
var id = _ref.id,
|
|
34
|
-
value = _ref.value,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
12
|
+
_ref$value = _ref.value,
|
|
13
|
+
value = _ref$value === void 0 ? null : _ref$value,
|
|
14
|
+
_ref$resource = _ref.resource,
|
|
15
|
+
resource = _ref$resource === void 0 ? null : _ref$resource,
|
|
16
|
+
_ref$title = _ref.title,
|
|
17
|
+
title = _ref$title === void 0 ? null : _ref$title,
|
|
18
|
+
_ref$onChange = _ref.onChange,
|
|
19
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange,
|
|
20
|
+
_ref$onClose = _ref.onClose,
|
|
21
|
+
onClose = _ref$onClose === void 0 ? null : _ref$onClose,
|
|
22
|
+
_ref$confirmButton = _ref.confirmButton,
|
|
23
|
+
confirmButton = _ref$confirmButton === void 0 ? null : _ref$confirmButton,
|
|
24
|
+
_ref$cancelButton = _ref.cancelButton,
|
|
25
|
+
cancelButton = _ref$cancelButton === void 0 ? null : _ref$cancelButton,
|
|
26
|
+
_ref$multiple = _ref.multiple,
|
|
27
|
+
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
42
28
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
43
29
|
var _useState = useState(value),
|
|
44
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -51,7 +37,7 @@ function MediasPickerModal(_ref) {
|
|
|
51
37
|
if (onClose !== null) {
|
|
52
38
|
onClose();
|
|
53
39
|
}
|
|
54
|
-
}, [onChange, onClose]);
|
|
40
|
+
}, [onChange, onClose, selectedItems]);
|
|
55
41
|
var onSelectionChange = useCallback(function (items) {
|
|
56
42
|
setSelectedItems(items);
|
|
57
43
|
}, [setSelectedItems]);
|
|
@@ -112,7 +98,5 @@ function MediasPickerModal(_ref) {
|
|
|
112
98
|
onMediaFormClose: onMediaFormClose
|
|
113
99
|
})));
|
|
114
100
|
}
|
|
115
|
-
MediasPickerModal.propTypes = propTypes;
|
|
116
|
-
MediasPickerModal.defaultProps = defaultProps;
|
|
117
101
|
|
|
118
102
|
export { MediasPickerModal as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/modal-medias-picker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Medias picker modal",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,19 +49,19 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.12.5",
|
|
52
|
-
"@panneau/core": "^
|
|
53
|
-
"@panneau/medias": "^
|
|
54
|
-
"@panneau/modal-dialog": "^
|
|
52
|
+
"@panneau/core": "^4.0.0",
|
|
53
|
+
"@panneau/medias": "^4.0.0",
|
|
54
|
+
"@panneau/modal-dialog": "^4.0.0",
|
|
55
55
|
"@uppy/core": "^5.1.1",
|
|
56
56
|
"@uppy/dashboard": "^5.0.4",
|
|
57
57
|
"@uppy/react": "^5.1.1",
|
|
58
58
|
"@uppy/utils": "^7.1.3",
|
|
59
59
|
"lodash-es": "^4.17.21",
|
|
60
60
|
"prop-types": "^15.7.2",
|
|
61
|
-
"react-intl": "^5.15.8
|
|
61
|
+
"react-intl": "^5.15.8 || ^6.0.0 || ^7.0.0"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "2cca874e0388b4a20c39aadb205c0e67d5a946fc"
|
|
67
67
|
}
|