@lvce-editor/explorer-view 7.23.2 → 7.23.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.
@@ -3030,7 +3030,7 @@ const getFileIcons = async (dirents, fileIconCache) => {
3030
3030
  };
3031
3031
  };
3032
3032
 
3033
- const directoryTypes$2 = new Set([DirectoryExpanded, DirectoryExpanding, EditingDirectoryExpanded]);
3033
+ const directoryTypes$3 = new Set([DirectoryExpanded, DirectoryExpanding, EditingDirectoryExpanded]);
3034
3034
  const getParentPath = (path, pathSeparator) => {
3035
3035
  const index = path.lastIndexOf(pathSeparator);
3036
3036
  if (index === -1) {
@@ -3041,7 +3041,7 @@ const getParentPath = (path, pathSeparator) => {
3041
3041
  const getGitIgnoreCandidateDirs = (root, items, pathSeparator) => {
3042
3042
  const dirs = new Set([root]);
3043
3043
  for (const item of items) {
3044
- if (directoryTypes$2.has(item.type)) {
3044
+ if (directoryTypes$3.has(item.type)) {
3045
3045
  dirs.add(item.path);
3046
3046
  }
3047
3047
  const parent = getParentPath(item.path, pathSeparator);
@@ -6098,9 +6098,9 @@ const handleDrop$1 = async (state, fileHandles, files, paths) => {
6098
6098
  };
6099
6099
  };
6100
6100
 
6101
- const directoryTypes$1 = [Directory, DirectoryExpanded, DirectoryExpanding];
6101
+ const directoryTypes$2 = [Directory, DirectoryExpanded, DirectoryExpanding];
6102
6102
  const isDirectory = item => {
6103
- return directoryTypes$1.includes(item.type);
6103
+ return directoryTypes$2.includes(item.type);
6104
6104
  };
6105
6105
  const isDescendant = (path, parentPath, pathSeparator) => {
6106
6106
  const prefix = parentPath.endsWith(pathSeparator) ? parentPath : `${parentPath}${pathSeparator}`;
@@ -6326,11 +6326,20 @@ const getDroppedItems = async (itemIds, isElectron) => {
6326
6326
  };
6327
6327
  };
6328
6328
 
6329
+ const directoryTypes$1 = new Set([Directory, DirectoryExpanded, DirectoryExpanding, EditingDirectoryExpanded, EditingFolder, SymLinkFolder]);
6330
+ const getDragUri = item => {
6331
+ const uri = ensureUri(item.path);
6332
+ if (directoryTypes$1.has(item.type) && !uri.endsWith('/')) {
6333
+ return `${uri}/`;
6334
+ }
6335
+ return uri;
6336
+ };
6337
+
6329
6338
  const getInternalDragPaths = (items, uris) => {
6330
6339
  if (uris.length === 0) {
6331
6340
  return [];
6332
6341
  }
6333
- const pathByUri = new Map(items.map(item => [ensureUri(item.path), item.path]));
6342
+ const pathByUri = new Map(items.map(item => [getDragUri(item), item.path]));
6334
6343
  const paths = [];
6335
6344
  for (const uri of uris) {
6336
6345
  const path = pathByUri.get(uri);
@@ -7302,8 +7311,8 @@ const getDragLabel = urls => {
7302
7311
  return String(urls.length);
7303
7312
  };
7304
7313
 
7305
- const getDragData = urls => {
7306
- const data = urls.map(ensureUri).join('\n');
7314
+ const getDragData = items => {
7315
+ const data = items.map(getDragUri).join('\n');
7307
7316
  const dragData = [{
7308
7317
  data,
7309
7318
  type: 'text/uri-list'
@@ -7313,7 +7322,7 @@ const getDragData = urls => {
7313
7322
  }];
7314
7323
  return {
7315
7324
  items: dragData,
7316
- label: getDragLabel(urls)
7325
+ label: getDragLabel(items.map(item => item.path))
7317
7326
  };
7318
7327
  };
7319
7328
 
@@ -7337,7 +7346,7 @@ const renderDragData = (oldState, newState) => {
7337
7346
  } else {
7338
7347
  draggedItems = [];
7339
7348
  }
7340
- const dragData = getDragData(draggedItems.map(item => item.path));
7349
+ const dragData = getDragData(draggedItems);
7341
7350
  return ['Viewlet.setDragData', uid, dragData];
7342
7351
  };
7343
7352
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/explorer-view",
3
- "version": "7.23.2",
3
+ "version": "7.23.3",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",