seeder-resources-view 1.3.1 → 1.3.3

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.esm.js CHANGED
@@ -17879,7 +17879,7 @@ const useDirectoryTree = _ref => {
17879
17879
  createFolder,
17880
17880
  removeFolderFile,
17881
17881
  renameFolderFile,
17882
- mediaType,
17882
+ mediaType = 'VIDEO',
17883
17883
  isEditable = true,
17884
17884
  batchOperations = true,
17885
17885
  withRootNode = true,
@@ -17890,7 +17890,12 @@ const useDirectoryTree = _ref => {
17890
17890
  titleHeight: 30
17891
17891
  }
17892
17892
  }
17893
- }
17893
+ },
17894
+ treeStyle = {},
17895
+ // Tree 组件样式
17896
+ wrapperStyle = {
17897
+ paddingTop: 16
17898
+ } // 包装器样式
17894
17899
  } = _ref;
17895
17900
  const [treeState, setTreeState] = useState({
17896
17901
  data: [],
@@ -17995,10 +18000,14 @@ const useDirectoryTree = _ref => {
17995
18000
  const addedNode = parentNode[0].children.find(ch => pathUtils.isSamePath(ch.path, expectedPath));
17996
18001
  if (addedNode) {
17997
18002
  updateTreeState({
17998
- expandedKeys: [...treeState.expandedKeys, addedNode.key, parentNode[0].key]
18003
+ selectedKeys: [addedNode.key],
18004
+ expandedKeys: [...treeState.expandedKeys, addedNode.key, parentNode[0].key],
18005
+ currentPath: addedNode.path,
18006
+ contents: []
17999
18007
  });
18000
18008
  }
18001
18009
  }
18010
+ ;
18002
18011
  } catch (error) {
18003
18012
  handleError(error, 'CREATE FOLDER');
18004
18013
  }
@@ -18100,9 +18109,7 @@ const useDirectoryTree = _ref => {
18100
18109
  });
18101
18110
  }
18102
18111
  return /*#__PURE__*/jsx("div", {
18103
- style: {
18104
- paddingTop: 16
18105
- },
18112
+ style: wrapperStyle,
18106
18113
  children: /*#__PURE__*/jsx(ConfigProvider, {
18107
18114
  theme: theme,
18108
18115
  children: /*#__PURE__*/jsx(Tree, {
@@ -18121,7 +18128,8 @@ const useDirectoryTree = _ref => {
18121
18128
  handleDel: handleRemove,
18122
18129
  handleAdd: handleCreate
18123
18130
  }),
18124
- height: height
18131
+ height: height,
18132
+ style: treeStyle
18125
18133
  })
18126
18134
  })
18127
18135
  }, "folder-directory");
@@ -18167,6 +18175,9 @@ const createUrlBuilder = function () {
18167
18175
  };
18168
18176
  };
18169
18177
 
18178
+ const pathUtils = {
18179
+ replaceRoot: path => path.replace(/^root$|^root\//, '')
18180
+ };
18170
18181
  const ResourcesView = _ref => {
18171
18182
  let {
18172
18183
  apiConfig = {},
@@ -18272,7 +18283,7 @@ const ResourcesView = _ref => {
18272
18283
  setShowProgress(true);
18273
18284
  setPercent(0);
18274
18285
  try {
18275
- await uploadFiles(files, currentPath);
18286
+ await uploadFiles(files, pathUtils.replaceRoot(currentPath));
18276
18287
  // 延迟2s刷新数据
18277
18288
  await new Promise(resolve => setTimeout(resolve, 2000));
18278
18289
  await updateFileContents();