@lvce-editor/explorer-view 3.14.0 → 3.16.0

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.
@@ -1649,6 +1649,9 @@ const dirname = (pathSeparator, path) => {
1649
1649
  const dirname2 = path => {
1650
1650
  return dirname('/', path);
1651
1651
  };
1652
+ const join = (pathSeparator, ...parts) => {
1653
+ return parts.join(pathSeparator);
1654
+ };
1652
1655
  const getBaseName = (pathSeparator, path) => {
1653
1656
  return path.slice(path.lastIndexOf(pathSeparator) + 1);
1654
1657
  };
@@ -2105,7 +2108,7 @@ const FilesExplorer = 'Files Explorer';
2105
2108
  const NewFile$1 = 'New File...';
2106
2109
  const NewFolder$1 = 'New Folder...';
2107
2110
  const OpenContainingFolder = 'Open Containing Folder';
2108
- const OpenFolder = 'Open folder';
2111
+ const OpenFolder$1 = 'Open folder';
2109
2112
  const OpenInIntegratedTerminal = 'Open in integrated Terminal';
2110
2113
  const Paste = 'Paste';
2111
2114
  const RefreshExplorer = 'Refresh Explorer';
@@ -2159,7 +2162,7 @@ const youHaveNotYetOpenedAFolder = () => {
2159
2162
  return i18nString(YouHaveNotYetOpenedAFolder);
2160
2163
  };
2161
2164
  const openFolder$1 = () => {
2162
- return i18nString(OpenFolder);
2165
+ return i18nString(OpenFolder$1);
2163
2166
  };
2164
2167
  const fileOrFolderNameMustBeProvided = () => {
2165
2168
  return i18nString(FileOrFolderNameMustBeProvider);
@@ -3789,7 +3792,8 @@ const handleClickCurrentButKeepFocus = state => {
3789
3792
  };
3790
3793
 
3791
3794
  const openFolder = async () => {
3792
- // TODO
3795
+ // @ts-ignore
3796
+ await invoke$2(`Dialog.openFolder`);
3793
3797
  };
3794
3798
 
3795
3799
  const handleClickOpenFolder = async state => {
@@ -4184,7 +4188,7 @@ const handleDrop$2 = async (state, fileHandles, files) => {
4184
4188
  };
4185
4189
  };
4186
4190
 
4187
- const getFileOperationsElectron = async (root, paths, fileHandles) => {
4191
+ const getFileOperationsElectron = async (root, paths, fileHandles, pathSeparator) => {
4188
4192
  const operations = [];
4189
4193
  for (let i = 0; i < paths.length; i++) {
4190
4194
  const fileHandle = fileHandles[i];
@@ -4194,7 +4198,7 @@ const getFileOperationsElectron = async (root, paths, fileHandles) => {
4194
4198
  const path = paths[i];
4195
4199
  operations.push({
4196
4200
  type: Copy$1,
4197
- path: join2(root, name),
4201
+ path: join(pathSeparator, root, name),
4198
4202
  from: path
4199
4203
  });
4200
4204
  }
@@ -4202,8 +4206,9 @@ const getFileOperationsElectron = async (root, paths, fileHandles) => {
4202
4206
  };
4203
4207
 
4204
4208
  // TODO copy files in parallel
4205
- const copyFilesElectron = async (root, pathSeparator, fileHandles, files, paths) => {
4206
- const operations = await getFileOperationsElectron(root, paths, fileHandles);
4209
+ const copyFilesElectron = async (root, fileHandles, files, paths) => {
4210
+ const pathSeparator = await getPathSeparator$1(root);
4211
+ const operations = await getFileOperationsElectron(root, paths, fileHandles, pathSeparator);
4207
4212
  await applyFileOperations(operations);
4208
4213
  };
4209
4214
 
@@ -4221,7 +4226,7 @@ const handleDrop$1 = async (state, fileHandles, files, paths) => {
4221
4226
  pathSeparator,
4222
4227
  items
4223
4228
  } = state;
4224
- await copyFilesElectron(root, pathSeparator, fileHandles, files, paths);
4229
+ await copyFilesElectron(root, fileHandles, files, paths);
4225
4230
  const mergedDirents = await getMergedDirents$1(root, pathSeparator, items);
4226
4231
  return {
4227
4232
  ...state,
@@ -5326,6 +5331,7 @@ const renderDragData = (oldState, newState) => {
5326
5331
  };
5327
5332
 
5328
5333
  const ExplorerInput = 'ExplorerInput';
5334
+ const OpenFolder = 'OpenFolder';
5329
5335
 
5330
5336
  const renderEditingSelection = (oldState, newState) => {
5331
5337
  const {
@@ -5467,6 +5473,7 @@ const getExplorerWelcomeVirtualDom = isWide => {
5467
5473
  }, text(youHaveNotYetOpenedAFolder()), {
5468
5474
  type: Button$1,
5469
5475
  className: mergeClassNames(Button$2, ButtonPrimary, isWide ? ButtonWide : ButtonNarrow),
5476
+ name: OpenFolder,
5470
5477
  childCount: 1,
5471
5478
  onClick: HandleClickOpenFolder
5472
5479
  }, text(openFolder$1())];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/explorer-view",
3
- "version": "3.14.0",
3
+ "version": "3.16.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",