@lvce-editor/explorer-view 2.16.0 → 2.18.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.
@@ -1971,7 +1971,7 @@ const focusPrevious = state => {
1971
1971
  }
1972
1972
  };
1973
1973
 
1974
- const commandIds = ['getMenuEntries2', 'acceptEdit', 'cancelEdit', 'collapseAll', 'copyPath', 'copyRelativePath', 'expandAll', 'expandRecursively', 'focus', 'focusFirst', 'focusIndex', 'focusLast', 'focusNext', 'focusNone', 'focusPrevious', 'getFocusedDirent', 'handleArrowLeft', 'handleArrowLeft', 'handleArrowRight', 'handleArrowRight', 'handleBlur', 'handleClick', 'handleClickAt', 'handleClickCurrent', 'handleClickCurrentButKeepFocus', 'handleClickOpenFolder', 'handleContextMenu', 'handleContextMenuKeyboard', 'handleCopy', 'handleDragLeave', 'handleDragOver', 'handleDrop', 'handleFocus', 'handleIconThemeChange', 'handleLanguagesChanged', 'handleMouseEnter', 'handleMouseLeave', 'handlePaste', 'handlePointerDown', 'handleUpload', 'handleWheel', 'handleWorkspaceChange', 'hotReload', 'newFile', 'newFolder', 'openContainingFolder', 'refresh', 'refresh', 'removeDirent', 'rename', 'renameDirent', 'renderEventListeners', 'revealItem', 'revealItem', 'scrollDown', 'scrollUp', 'setDeltaY', 'updateEditingValue', 'updateIcons'];
1974
+ const commandIds = ['acceptEdit', 'cancelEdit', 'collapseAll', 'copyPath', 'copyRelativePath', 'dispose', 'expandAll', 'expandRecursively', 'focus', 'focusFirst', 'focusIndex', 'focusLast', 'focusNext', 'focusNone', 'focusPrevious', 'getFocusedDirent', 'getMenuEntries2', 'handleArrowLeft', 'handleArrowLeft', 'handleArrowRight', 'handleArrowRight', 'handleBlur', 'handleClick', 'handleClickAt', 'handleClickCurrent', 'handleClickCurrentButKeepFocus', 'handleClickOpenFolder', 'handleContextMenu', 'handleContextMenuKeyboard', 'handleCopy', 'handleDragLeave', 'handleDragOver', 'handleDrop', 'handleFocus', 'handleIconThemeChange', 'handleLanguagesChanged', 'handleMouseEnter', 'handleMouseLeave', 'handlePaste', 'handlePointerDown', 'handleUpload', 'handleWheel', 'handleWorkspaceChange', 'hotReload', 'newFile', 'newFolder', 'openContainingFolder', 'refresh', 'refresh', 'removeDirent', 'rename', 'renameDirent', 'renderEventListeners', 'revealItem', 'revealItem', 'scrollDown', 'scrollUp', 'setDeltaY', 'updateEditingValue', 'updateIcons'];
1975
1975
 
1976
1976
  const getCommandIds = () => {
1977
1977
  return commandIds;
@@ -3569,12 +3569,12 @@ const renameDirent = state => {
3569
3569
  items
3570
3570
  } = state;
3571
3571
  const item = items[focusedIndex];
3572
- // Focus.setFocus(FocusKey.ExplorerEditBox)
3573
3572
  return {
3574
3573
  ...state,
3575
3574
  editingIndex: focusedIndex,
3576
3575
  editingType: Rename$1,
3577
- editingValue: item.name
3576
+ editingValue: item.name,
3577
+ focus: Input$1
3578
3578
  };
3579
3579
  };
3580
3580
 
@@ -4226,7 +4226,7 @@ const getPathPartChildren = async pathPart => {
4226
4226
  return children;
4227
4227
  };
4228
4228
  const mergeVisibleWithHiddenItems = (visibleItems, hiddenItems) => {
4229
- const merged = [...hiddenItems];
4229
+ const merged = [...visibleItems, ...hiddenItems];
4230
4230
  const seen = Object.create(null);
4231
4231
  const unique = [];
4232
4232
  for (const item of merged) {
@@ -4236,57 +4236,6 @@ const mergeVisibleWithHiddenItems = (visibleItems, hiddenItems) => {
4236
4236
  seen[item.path] = true;
4237
4237
  unique.push(item);
4238
4238
  }
4239
-
4240
- // depth one
4241
- // let depth=1
4242
- // while(true){
4243
- // for(const item of unique){
4244
- // if(item.depth===depth){
4245
- // ordered.push(item)
4246
- // }
4247
- // }
4248
- // break
4249
- // }
4250
- // const getChildren = (path) => {
4251
- // const children = []
4252
- // for (const item of unique) {
4253
- // if (item.path.startsWith(path) && item.path !== path) {
4254
- // ordered.push(item)
4255
- // }
4256
- // }
4257
- // return children
4258
- // }
4259
- // for (const item of unique) {
4260
- // for (const potentialChild of unique) {
4261
- // if (
4262
- // potentialChild.path.startsWith(item.path) &&
4263
- // potentialChild.path !== item.path
4264
- // ) {
4265
- // ordered.push(potentialChild)
4266
- // }
4267
- // }
4268
- // }
4269
- // const refreshedRoots = Object.create(null)
4270
- // for (const hiddenItem of hiddenItems) {
4271
- // const parent = hiddenItem.path.slice(0, hiddenItem.path.lastIndexOf('/'))
4272
- // refreshedRoots[parent] = true
4273
- // }
4274
- // const mergedDirents = []
4275
- // for(const v)
4276
- // for (const visibleItem of visibleItems) {
4277
- // if (visibleItem.path === hiddenItemRoot) {
4278
- // // TODO update aria posinset and aria setsize
4279
- // mergedDirents.push(...hiddenItems)
4280
- // } else {
4281
- // for (const hiddenItem of hiddenItems) {
4282
- // if (hiddenItem.path === visibleItem.path) {
4283
- // continue
4284
- // }
4285
- // }
4286
- // mergedDirents.push(visibleItem)
4287
- // }
4288
- // }
4289
-
4290
4239
  return unique;
4291
4240
  };
4292
4241
 
@@ -4388,8 +4337,21 @@ const terminate = () => {
4388
4337
  globalThis.close();
4389
4338
  };
4390
4339
 
4391
- const updateEditingValue = (state, value, inputSource = User) => {
4392
- const editingIcon = '';
4340
+ const getEditingIcon = async (editingType, value) => {
4341
+ if (editingType === File) {
4342
+ return invoke('IconTheme.getFileIcon', {
4343
+ name: value
4344
+ });
4345
+ }
4346
+ if (editingType === Directory) {
4347
+ return invoke('IconTheme.getFolderIcon', {
4348
+ name: value
4349
+ });
4350
+ }
4351
+ return '';
4352
+ };
4353
+ const updateEditingValue = async (state, value, inputSource = User) => {
4354
+ const editingIcon = await getEditingIcon(state.editingType, value);
4393
4355
  return {
4394
4356
  ...state,
4395
4357
  editingValue: value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/explorer-view",
3
- "version": "2.16.0",
3
+ "version": "2.18.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",