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 CHANGED
@@ -1 +1 @@
1
- .resources-view{background:#313131;flex:1;width:100%}.resources-view .content-container{border-top:1px solid #000;display:flex;height:calc(100vh - 50px)}.resources-view .content-container .directory-tree{position:relative;width:400px}.resources-view .content-container .directory-tree:after{border-right:1px solid #171717;content:"";height:100%;position:absolute;right:0;top:0;width:0}.resources-view .content-container .directory-tree .ant-tree{background-color:#313131}.resources-view .content-container .directory-tree .ant-tree .ant-tree-treenode{padding-inline:16px;padding-left:0;position:relative}.resources-view .content-container .directory-tree .ant-tree .ant-tree-treenode:before{bottom:0;content:"";height:auto;inset-inline-end:0;inset-inline-start:0;pointer-events:none;position:absolute;top:0;transition:background-color .2s;z-index:0}.resources-view .content-container .directory-tree .ant-tree .ant-tree-treenode:hover:before{background:hsla(0,0%,100%,.08)}.resources-view .content-container .directory-tree .ant-tree .ant-tree-treenode-selected:before,.resources-view .content-container .directory-tree .ant-tree .ant-tree-treenode-selected:hover:before{background:#595959}.resources-view .content-container .directory-tree .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected,.resources-view .content-container .directory-tree .ant-tree .ant-tree-node-content-wrapper:hover{background:none}.resources-view .content-container .directory-tree .ant-tree .ant-tree-list .ant-tree-node-content-wrapper{display:flex;padding:0 1px}.resources-view .content-container .directory-tree .ant-tree .ant-tree-list .ant-tree-title{display:flex;flex:auto}.resources-view .content-container .directory-tree .ant-tree .ant-tree-list .ant-tree-icon__customize .anticon-folder,.resources-view .content-container .directory-tree .ant-tree .ant-tree-list .ant-tree-icon__customize .anticon-folder-open{font-size:16px}.resources-view .content-container .folder-contents{display:flex;flex:1;flex-direction:column}.resources-view .content-container .folder-contents .media-grid-container{background:#171717;flex:1;max-height:844px;overflow:auto;padding:36px;padding-block-end:20px;padding-block-start:16px}.resources-view .content-container .folder-contents .media-grid-container::-webkit-scrollbar-track-piece{background:#141414}.resources-view .content-container .folder-contents .media-grid-container::-webkit-scrollbar{width:6px}.resources-view .content-container .folder-contents .media-grid-container::-webkit-scrollbar-thumb{background:#434343;border-radius:2px}.resources-view .content-container .folder-contents .media-grid-container .batch-operations{display:flex;margin-block-end:16px}.resources-view .content-container .folder-contents .media-grid-container .ant-list.ant-list-grid .ant-row{height:auto}.resources-view .content-container .folder-contents .media-grid-container .ant-list.ant-list-grid .ant-col>.ant-list-item.media-grid-item--selectable{border:1px solid #424242;margin-block-end:0;margin-left:-1px;margin-top:-1px;padding:20px}.resources-view .content-container .search-bar{border-bottom:1px solid #171717;height:50px;position:relative}.resources-view .content-container .search-bar .search-input{width:320px}.resources-view .content-container .search-bar .upload-icon{color:#a3a3a3;cursor:pointer;font-size:24px;position:absolute;right:14px}.media-grid-item{cursor:pointer}.media-grid-item .media-grid-checkbox-wrapper{display:flex;justify-content:flex-end;margin-block-end:12px;margin-block-start:-12px;margin-inline-end:-12px}.media-grid-item .media-grid-thumbnail{height:124px;width:100%}.media-grid-item .media-grid-info{margin-block-start:4px;text-align:center}.tree-title{align-items:center;flex:1;justify-content:space-between}.tree-title,.tree-title .tree-node-icons{display:flex}.tree-title .tree-node-icons .px-1{padding-inline:4px}.upload-progress{align-items:center;background:rgba(0,0,0,.65);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0}
1
+ .resources-view{background:#313131;flex:1;width:100%}.resources-view .content-container{border-top:1px solid #000;display:flex;height:calc(100vh - 50px)}.resources-view .content-container .directory-tree{position:relative;width:400px}.resources-view .content-container .directory-tree:after{border-right:1px solid #171717;content:"";height:100%;position:absolute;right:0;top:0;width:0}.resources-view .content-container .directory-tree .ant-tree{background-color:#313131}.resources-view .content-container .directory-tree .ant-tree .ant-tree-treenode{padding-inline:16px;padding-left:0;position:relative}.resources-view .content-container .directory-tree .ant-tree .ant-tree-treenode:before{bottom:0;content:"";height:auto;inset-inline-end:0;inset-inline-start:0;pointer-events:none;position:absolute;top:0;transition:background-color .2s;z-index:0}.resources-view .content-container .directory-tree .ant-tree .ant-tree-treenode:hover:before{background:hsla(0,0%,100%,.08)}.resources-view .content-container .directory-tree .ant-tree .ant-tree-treenode-selected:before,.resources-view .content-container .directory-tree .ant-tree .ant-tree-treenode-selected:hover:before{background:#595959}.resources-view .content-container .directory-tree .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected,.resources-view .content-container .directory-tree .ant-tree .ant-tree-node-content-wrapper:hover{background:none}.resources-view .content-container .directory-tree .ant-tree .ant-tree-list .ant-tree-node-content-wrapper{display:flex;padding:0 1px}.resources-view .content-container .directory-tree .ant-tree .ant-tree-list .ant-tree-title{display:flex;flex:auto}.resources-view .content-container .directory-tree .ant-tree .ant-tree-list .ant-tree-icon__customize .anticon-folder,.resources-view .content-container .directory-tree .ant-tree .ant-tree-list .ant-tree-icon__customize .anticon-folder-open{font-size:16px}.resources-view .content-container .folder-contents{display:flex;flex:1;flex-direction:column}.resources-view .content-container .folder-contents .media-grid-container{background:#171717;flex:1;max-height:844px;overflow:auto;padding:36px;padding-block-end:20px;padding-block-start:16px}.resources-view .content-container .folder-contents .media-grid-container::-webkit-scrollbar-track-piece{background:#141414}.resources-view .content-container .folder-contents .media-grid-container::-webkit-scrollbar{width:6px}.resources-view .content-container .folder-contents .media-grid-container::-webkit-scrollbar-thumb{background:#434343;border-radius:2px}.resources-view .content-container .folder-contents .media-grid-container .batch-operations{display:flex;margin-block-end:16px}.resources-view .content-container .folder-contents .media-grid-container .ant-list.ant-list-grid .ant-row{height:auto}.resources-view .content-container .folder-contents .media-grid-container .ant-list.ant-list-grid.media-grid-list--selectable .ant-row>div{border:1px solid #424242;margin-left:-1px;margin-top:-1px}.resources-view .content-container .folder-contents .media-grid-container .ant-list.ant-list-grid.media-grid-list--selectable .ant-col>.ant-list-item{margin-block-end:0;padding:20px}.resources-view .content-container .search-bar{border-bottom:1px solid #171717;height:50px;position:relative}.resources-view .content-container .search-bar .search-input{width:320px}.resources-view .content-container .search-bar .upload-icon{color:#a3a3a3;cursor:pointer;font-size:24px;position:absolute;right:14px}.media-grid-item{cursor:pointer}.media-grid-item .media-grid-checkbox-wrapper{display:flex;justify-content:flex-end;margin-block-end:12px;margin-block-start:-12px;margin-inline-end:-12px}.media-grid-item .media-grid-thumbnail{height:124px;width:100%}.media-grid-item .media-grid-info{margin-block-start:4px;text-align:center}.tree-title{align-items:center;flex:1;justify-content:space-between}.tree-title,.tree-title .tree-node-icons{display:flex}.tree-title .tree-node-icons .px-1{padding-inline:4px}.upload-progress{align-items:center;background:rgba(0,0,0,.65);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0}
package/dist/index.esm.js CHANGED
@@ -17318,7 +17318,7 @@ const MediaGridItem = /*#__PURE__*/memo(_ref => {
17318
17318
  trigger: ['contextMenu'],
17319
17319
  disabled: !onContextMenu,
17320
17320
  children: /*#__PURE__*/jsxs(List.Item, {
17321
- className: "media-grid-item ".concat(showCheckbox ? 'media-grid-item--selectable' : ''),
17321
+ className: "media-grid-item",
17322
17322
  title: item.name,
17323
17323
  onClick: handleItemClick,
17324
17324
  children: [showCheckbox && /*#__PURE__*/jsx("div", {
@@ -17398,6 +17398,8 @@ const MediaGrid = /*#__PURE__*/memo(_ref3 => {
17398
17398
  renderItem: renderItem,
17399
17399
  pagination: false
17400
17400
  // locale={{ emptyText: 'No media files found' }}
17401
+ ,
17402
+ className: "".concat(showCheckbox ? 'media-grid-list--selectable' : '')
17401
17403
  })
17402
17404
  });
17403
17405
  });
@@ -17993,10 +17995,14 @@ const useDirectoryTree = _ref => {
17993
17995
  const addedNode = parentNode[0].children.find(ch => pathUtils.isSamePath(ch.path, expectedPath));
17994
17996
  if (addedNode) {
17995
17997
  updateTreeState({
17996
- expandedKeys: [...treeState.expandedKeys, addedNode.key, parentNode[0].key]
17998
+ selectedKeys: [addedNode.key],
17999
+ expandedKeys: [...treeState.expandedKeys, addedNode.key, parentNode[0].key],
18000
+ currentPath: addedNode.path,
18001
+ contents: []
17997
18002
  });
17998
18003
  }
17999
18004
  }
18005
+ ;
18000
18006
  } catch (error) {
18001
18007
  handleError(error, 'CREATE FOLDER');
18002
18008
  }
@@ -18165,6 +18171,9 @@ const createUrlBuilder = function () {
18165
18171
  };
18166
18172
  };
18167
18173
 
18174
+ const pathUtils = {
18175
+ replaceRoot: path => path.replace(/^root$|^root\//, '')
18176
+ };
18168
18177
  const ResourcesView = _ref => {
18169
18178
  let {
18170
18179
  apiConfig = {},
@@ -18270,7 +18279,7 @@ const ResourcesView = _ref => {
18270
18279
  setShowProgress(true);
18271
18280
  setPercent(0);
18272
18281
  try {
18273
- await uploadFiles(files, currentPath);
18282
+ await uploadFiles(files, pathUtils.replaceRoot(currentPath));
18274
18283
  // 延迟2s刷新数据
18275
18284
  await new Promise(resolve => setTimeout(resolve, 2000));
18276
18285
  await updateFileContents();
@@ -18305,6 +18314,7 @@ const ResourcesView = _ref => {
18305
18314
  const calculateTotalSize = files => Array.from(files).reduce((sum, file) => sum + file.size, 0);
18306
18315
 
18307
18316
  // 上传单个文件
18317
+ // 待改正:需要对folder replaceRoot
18308
18318
  const uploadSingleFile = (file, folder, previousLoadedMap, onProgress) => {
18309
18319
  const formData = new FormData();
18310
18320
  formData.append('file', file);