@panneau/medias 3.0.238 → 3.0.240
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 +31 -7
- package/package.json +4 -4
package/es/index.js
CHANGED
@@ -39,6 +39,7 @@ var apiPropTypes = PropTypes.shape({
|
|
39
39
|
find: PropTypes.func.isRequired,
|
40
40
|
update: PropTypes.func.isRequired,
|
41
41
|
trash: PropTypes.func.isRequired,
|
42
|
+
restore: PropTypes.func.isRequired,
|
42
43
|
"delete": PropTypes.func.isRequired
|
43
44
|
});
|
44
45
|
var propTypes$9 = {
|
@@ -820,6 +821,25 @@ var defaultFilters = [{
|
|
820
821
|
// },
|
821
822
|
];
|
822
823
|
|
824
|
+
var useMediaRestore = function useMediaRestore() {
|
825
|
+
var _useState = useState(false),
|
826
|
+
_useState2 = _slicedToArray(_useState, 2),
|
827
|
+
restoring = _useState2[0],
|
828
|
+
setRestoring = _useState2[1];
|
829
|
+
var api = useMediasApi();
|
830
|
+
var mediaRestore = useCallback(function (id, data) {
|
831
|
+
setRestoring(true);
|
832
|
+
return api.restore(id, data).then(function (response) {
|
833
|
+
setRestoring(false);
|
834
|
+
return response;
|
835
|
+
});
|
836
|
+
}, [api, setRestoring]);
|
837
|
+
return {
|
838
|
+
mediaRestore: mediaRestore,
|
839
|
+
restoring: restoring
|
840
|
+
};
|
841
|
+
};
|
842
|
+
|
823
843
|
var _excluded$5 = ["page", "count"],
|
824
844
|
_excluded2 = ["types", "trashed"];
|
825
845
|
var propTypes$5 = {
|
@@ -965,6 +985,8 @@ function MediasBrowser(_ref) {
|
|
965
985
|
var _useMediaDelete = useMediaDelete$1(),
|
966
986
|
mediaDelete = _useMediaDelete.mediaDelete,
|
967
987
|
deleting = _useMediaDelete.deleting;
|
988
|
+
var _useMediaRestore = useMediaRestore(),
|
989
|
+
mediaRestore = _useMediaRestore.mediaRestore;
|
968
990
|
var _useState3 = useState(false),
|
969
991
|
_useState4 = _slicedToArray(_useState3, 2),
|
970
992
|
showTrashed = _useState4[0],
|
@@ -1166,7 +1188,10 @@ function MediasBrowser(_ref) {
|
|
1166
1188
|
acc.push({
|
1167
1189
|
id: 'restore',
|
1168
1190
|
component: 'restore',
|
1169
|
-
withConfirmation: true
|
1191
|
+
withConfirmation: true,
|
1192
|
+
action: function action(ids) {
|
1193
|
+
return mediaRestore(ids[0]);
|
1194
|
+
}
|
1170
1195
|
});
|
1171
1196
|
}
|
1172
1197
|
acc.push(action);
|
@@ -1306,16 +1331,15 @@ function MediasBrowser(_ref) {
|
|
1306
1331
|
,
|
1307
1332
|
actionsProps: {
|
1308
1333
|
getDeletePropsFromItem: function getDeletePropsFromItem() {
|
1309
|
-
var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}
|
1310
|
-
_ref12
|
1311
|
-
id = _ref12$id === void 0 ? null : _ref12$id;
|
1334
|
+
var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
1335
|
+
_ref12.id;
|
1312
1336
|
return {
|
1313
1337
|
href: null,
|
1314
|
-
withConfirmation:
|
1338
|
+
withConfirmation: true,
|
1315
1339
|
disabled: trashing || deleting,
|
1316
1340
|
icon: showTrashed ? 'trash-fill' : 'trash',
|
1317
|
-
|
1318
|
-
return onTrashMedia(
|
1341
|
+
action: function action(ids) {
|
1342
|
+
return onTrashMedia(ids[0]);
|
1319
1343
|
}
|
1320
1344
|
};
|
1321
1345
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@panneau/medias",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.240",
|
4
4
|
"description": "",
|
5
5
|
"keywords": [
|
6
6
|
"javascript"
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"dependencies": {
|
53
53
|
"@babel/runtime": "^7.12.5",
|
54
54
|
"@panneau/core": "^3.0.228",
|
55
|
-
"@panneau/data": "^3.0.
|
55
|
+
"@panneau/data": "^3.0.239",
|
56
56
|
"@panneau/display-image": "^3.0.228",
|
57
57
|
"@panneau/element-button": "^3.0.228",
|
58
58
|
"@panneau/element-buttons": "^3.0.228",
|
@@ -64,7 +64,7 @@
|
|
64
64
|
"@panneau/element-media-player": "^3.0.228",
|
65
65
|
"@panneau/element-pagination": "^3.0.228",
|
66
66
|
"@panneau/element-table": "^3.0.228",
|
67
|
-
"@panneau/field-upload": "^3.0.
|
67
|
+
"@panneau/field-upload": "^3.0.239",
|
68
68
|
"@panneau/filter-filters": "^3.0.228",
|
69
69
|
"classnames": "^2.5.1",
|
70
70
|
"lodash": "^4.17.21",
|
@@ -74,5 +74,5 @@
|
|
74
74
|
"publishConfig": {
|
75
75
|
"access": "public"
|
76
76
|
},
|
77
|
-
"gitHead": "
|
77
|
+
"gitHead": "3d0f5c8df72d195c6d29fcf9f1d42a35e58df68a"
|
78
78
|
}
|