seeder-resources-view 1.3.0 → 1.3.2
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/dist/index.css +1 -1
- package/dist/index.esm.js +13 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/style/resources.less +9 -7
package/dist/index.js
CHANGED
|
@@ -17320,7 +17320,7 @@ const MediaGridItem = /*#__PURE__*/react.memo(_ref => {
|
|
|
17320
17320
|
trigger: ['contextMenu'],
|
|
17321
17321
|
disabled: !onContextMenu,
|
|
17322
17322
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.List.Item, {
|
|
17323
|
-
className: "media-grid-item
|
|
17323
|
+
className: "media-grid-item",
|
|
17324
17324
|
title: item.name,
|
|
17325
17325
|
onClick: handleItemClick,
|
|
17326
17326
|
children: [showCheckbox && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -17400,6 +17400,8 @@ const MediaGrid = /*#__PURE__*/react.memo(_ref3 => {
|
|
|
17400
17400
|
renderItem: renderItem,
|
|
17401
17401
|
pagination: false
|
|
17402
17402
|
// locale={{ emptyText: 'No media files found' }}
|
|
17403
|
+
,
|
|
17404
|
+
className: "".concat(showCheckbox ? 'media-grid-list--selectable' : '')
|
|
17403
17405
|
})
|
|
17404
17406
|
});
|
|
17405
17407
|
});
|
|
@@ -17995,10 +17997,14 @@ const useDirectoryTree = _ref => {
|
|
|
17995
17997
|
const addedNode = parentNode[0].children.find(ch => pathUtils.isSamePath(ch.path, expectedPath));
|
|
17996
17998
|
if (addedNode) {
|
|
17997
17999
|
updateTreeState({
|
|
17998
|
-
|
|
18000
|
+
selectedKeys: [addedNode.key],
|
|
18001
|
+
expandedKeys: [...treeState.expandedKeys, addedNode.key, parentNode[0].key],
|
|
18002
|
+
currentPath: addedNode.path,
|
|
18003
|
+
contents: []
|
|
17999
18004
|
});
|
|
18000
18005
|
}
|
|
18001
18006
|
}
|
|
18007
|
+
;
|
|
18002
18008
|
} catch (error) {
|
|
18003
18009
|
handleError(error, 'CREATE FOLDER');
|
|
18004
18010
|
}
|
|
@@ -18167,6 +18173,9 @@ const createUrlBuilder = function () {
|
|
|
18167
18173
|
};
|
|
18168
18174
|
};
|
|
18169
18175
|
|
|
18176
|
+
const pathUtils = {
|
|
18177
|
+
replaceRoot: path => path.replace(/^root$|^root\//, '')
|
|
18178
|
+
};
|
|
18170
18179
|
const ResourcesView = _ref => {
|
|
18171
18180
|
let {
|
|
18172
18181
|
apiConfig = {},
|
|
@@ -18272,7 +18281,7 @@ const ResourcesView = _ref => {
|
|
|
18272
18281
|
setShowProgress(true);
|
|
18273
18282
|
setPercent(0);
|
|
18274
18283
|
try {
|
|
18275
|
-
await uploadFiles(files, currentPath);
|
|
18284
|
+
await uploadFiles(files, pathUtils.replaceRoot(currentPath));
|
|
18276
18285
|
// 延迟2s刷新数据
|
|
18277
18286
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
18278
18287
|
await updateFileContents();
|
|
@@ -18307,6 +18316,7 @@ const ResourcesView = _ref => {
|
|
|
18307
18316
|
const calculateTotalSize = files => Array.from(files).reduce((sum, file) => sum + file.size, 0);
|
|
18308
18317
|
|
|
18309
18318
|
// 上传单个文件
|
|
18319
|
+
// 待改正:需要对folder replaceRoot
|
|
18310
18320
|
const uploadSingleFile = (file, folder, previousLoadedMap, onProgress) => {
|
|
18311
18321
|
const formData = new FormData();
|
|
18312
18322
|
formData.append('file', file);
|