seeder-resources-view 1.2.0 → 1.3.1

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
@@ -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 ".concat(showCheckbox ? 'media-grid-item--selectable' : ''),
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
  });
@@ -17666,7 +17668,8 @@ const TreeTitleNode = _ref2 => {
17666
17668
  nodeData,
17667
17669
  handleSave,
17668
17670
  handleDel,
17669
- handleAdd
17671
+ handleAdd,
17672
+ isEditable = true
17670
17673
  } = _ref2;
17671
17674
  const [editing, setEditing] = react.useState(false);
17672
17675
  const inputRef = react.useRef(null);
@@ -17761,7 +17764,13 @@ const TreeTitleNode = _ref2 => {
17761
17764
  }, [editing, nodeData.title, save, title, renderIconNode]);
17762
17765
  return /*#__PURE__*/jsxRuntime.jsx("div", {
17763
17766
  className: "tree-title",
17764
- children: renderChildNode()
17767
+ children: isEditable ? renderChildNode() : /*#__PURE__*/jsxRuntime.jsx(antd.Typography.Text, {
17768
+ ellipsis: true,
17769
+ style: {
17770
+ width: "100%%"
17771
+ },
17772
+ children: title
17773
+ })
17765
17774
  });
17766
17775
  };
17767
17776
  var TreeTitle$1 = /*#__PURE__*/react.memo(TreeTitle);
@@ -17872,6 +17881,8 @@ const useDirectoryTree = _ref => {
17872
17881
  createFolder,
17873
17882
  removeFolderFile,
17874
17883
  renameFolderFile,
17884
+ mediaType,
17885
+ isEditable = true,
17875
17886
  batchOperations = true,
17876
17887
  withRootNode = true,
17877
17888
  height = 828,
@@ -17926,9 +17937,14 @@ const useDirectoryTree = _ref => {
17926
17937
  const fetchFolderData = react.useCallback(async function () {
17927
17938
  let initialization = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
17928
17939
  try {
17929
- const data = await getFolderData({
17940
+ // 构建请求参数
17941
+ const requestParams = {
17930
17942
  folder: ""
17931
- });
17943
+ };
17944
+ if (mediaType) {
17945
+ requestParams.media_type = mediaType;
17946
+ }
17947
+ const data = await getFolderData(requestParams);
17932
17948
  if (!(data !== null && data !== void 0 && data.directoryTree)) {
17933
17949
  return null;
17934
17950
  }
@@ -17955,7 +17971,7 @@ const useDirectoryTree = _ref => {
17955
17971
  } catch (error) {
17956
17972
  handleError(error, 'GET FOLDER DATA');
17957
17973
  }
17958
- }, [withRootNode]);
17974
+ }, [mediaType, withRootNode]);
17959
17975
 
17960
17976
  // 初始化数据
17961
17977
  react.useEffect(() => {
@@ -18102,6 +18118,7 @@ const useDirectoryTree = _ref => {
18102
18118
  titleRender: nodeData => /*#__PURE__*/jsxRuntime.jsx(TreeTitle$1, {
18103
18119
  title: nodeData.title,
18104
18120
  nodeData: nodeData,
18121
+ isEditable: isEditable,
18105
18122
  handleSave: handleRename,
18106
18123
  handleDel: handleRemove,
18107
18124
  handleAdd: handleCreate