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