@lvce-editor/explorer-view 3.20.0 → 3.21.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.
@@ -1173,6 +1173,7 @@ const RendererWorker$1 = 1;
1173
1173
  const FocusElementByName = 'Viewlet.focusElementByName';
1174
1174
  const FocusSelector = 'Viewlet.focusSelector';
1175
1175
  const SetCss = 'Viewlet.setCss';
1176
+ const SetDom2 = 'Viewlet.setDom2';
1176
1177
  const SetFocusContext = 'Viewlet.setFocusContext';
1177
1178
 
1178
1179
  const FocusExplorer = 13;
@@ -2776,7 +2777,6 @@ const getVisibleExplorerItems = (items, minLineY, maxLineY, focusedIndex, editin
2776
2777
  const {
2777
2778
  get,
2778
2779
  set,
2779
- wrapCommand,
2780
2780
  registerCommands,
2781
2781
  getCommandIds,
2782
2782
  wrapGetter
@@ -2807,6 +2807,9 @@ const wrapListItemCommand = fn => {
2807
2807
  const intermediate = get(id);
2808
2808
  set(id, intermediate.oldState, updatedState);
2809
2809
  const maxLineY = getExplorerMaxLineY(minLineY, height, itemHeight, items.length);
2810
+ if (items === intermediate.newState.items && minLineY === intermediate.newState.minLineY && editingIcon === intermediate.newState.editingIcon && cutItems === intermediate.newState.cutItems && editingErrorMessage === intermediate.newState.editingErrorMessage) {
2811
+ return;
2812
+ }
2810
2813
  const visible = items.slice(minLineY, maxLineY);
2811
2814
  const {
2812
2815
  icons,
@@ -5741,28 +5744,19 @@ const getExplorerVirtualDom = (visibleItems, focusedIndex, root, isWide, focused
5741
5744
 
5742
5745
  const renderItems = (oldState, newState) => {
5743
5746
  const {
5744
- cutItems,
5745
- sourceControlIgnoredUris,
5746
5747
  deltaY,
5747
5748
  dropTargets,
5748
5749
  editingErrorMessage,
5749
- editingIcon,
5750
- editingIndex,
5751
- editingType,
5752
- editingValue,
5753
5750
  focused,
5754
5751
  focusedIndex,
5755
5752
  height,
5756
- icons,
5757
5753
  itemHeight,
5758
5754
  items,
5759
- maxLineY,
5760
5755
  minLineY,
5761
5756
  root,
5762
- useChevrons,
5763
5757
  width
5764
5758
  } = newState;
5765
- const visibleDirents = getVisibleExplorerItems(items, minLineY, maxLineY, focusedIndex, editingIndex, editingType, editingValue, editingErrorMessage, icons, useChevrons, dropTargets, editingIcon, cutItems, sourceControlIgnoredUris);
5759
+ const visibleDirents = newState.visibleExplorerItems;
5766
5760
  const isWide = width > 450;
5767
5761
  const contentHeight = items.length * itemHeight;
5768
5762
  const depth = items[focusedIndex]?.depth || 0;
@@ -5776,7 +5770,7 @@ const renderItems = (oldState, newState) => {
5776
5770
  left
5777
5771
  } = getErrorMessagePosition(itemHeight, focusedIndex, minLineY, depth, indent, fileIconWidth, padding + defaultPaddingLeft + chevronSpace);
5778
5772
  const dom = getExplorerVirtualDom(visibleDirents, focusedIndex, root, isWide, focused, dropTargets, height, contentHeight, deltaY, editingErrorMessage, top, left);
5779
- return ['Viewlet.setDom2', dom];
5773
+ return [SetDom2, dom];
5780
5774
  };
5781
5775
 
5782
5776
  const renderValue = (oldState, newState) => {
@@ -6258,69 +6252,69 @@ const updateEditingValue = async (state, value, inputSource = User) => {
6258
6252
  const commandMap = {
6259
6253
  'Explorer.acceptEdit': wrapListItemCommand(acceptEdit),
6260
6254
  'Explorer.cancelEdit': wrapListItemCommand(cancelEdit),
6261
- 'Explorer.cancelTypeAhead': wrapCommand(cancelTypeAhead),
6255
+ 'Explorer.cancelTypeAhead': wrapListItemCommand(cancelTypeAhead),
6262
6256
  'Explorer.collapseAll': wrapListItemCommand(collapseAll),
6263
- 'Explorer.copyPath': wrapCommand(copyPath),
6264
- 'Explorer.copyRelativePath': wrapCommand(copyRelativePath),
6257
+ 'Explorer.copyPath': wrapListItemCommand(copyPath),
6258
+ 'Explorer.copyRelativePath': wrapListItemCommand(copyRelativePath),
6265
6259
  'Explorer.expandAll': wrapListItemCommand(expandAll),
6266
6260
  'Explorer.expandRecursively': wrapListItemCommand(expandRecursively),
6267
- 'Explorer.focus': wrapCommand(focus),
6268
- 'Explorer.focusFirst': wrapCommand(focusFirst),
6269
- 'Explorer.focusIndex': wrapCommand(focusIndex),
6270
- 'Explorer.focusLast': wrapCommand(focusLast),
6271
- 'Explorer.handleDragStart': wrapCommand(handleDragStart),
6272
- 'Explorer.handleDragOverIndex': wrapCommand(handleDragOverIndex),
6273
- 'Explorer.focusNext': wrapCommand(focusNext),
6274
- 'Explorer.focusNone': wrapCommand(focusNone),
6275
- 'Explorer.focusPrevious': wrapCommand(focusPrevious),
6261
+ 'Explorer.focus': wrapListItemCommand(focus),
6262
+ 'Explorer.focusFirst': wrapListItemCommand(focusFirst),
6263
+ 'Explorer.focusIndex': wrapListItemCommand(focusIndex),
6264
+ 'Explorer.focusLast': wrapListItemCommand(focusLast),
6265
+ 'Explorer.handleDragStart': wrapListItemCommand(handleDragStart),
6266
+ 'Explorer.handleDragOverIndex': wrapListItemCommand(handleDragOverIndex),
6267
+ 'Explorer.focusNext': wrapListItemCommand(focusNext),
6268
+ 'Explorer.focusNone': wrapListItemCommand(focusNone),
6269
+ 'Explorer.focusPrevious': wrapListItemCommand(focusPrevious),
6276
6270
  'Explorer.getCommandIds': getCommandIds,
6277
6271
  'Explorer.getMenuEntries2': getMenuEntries2,
6278
6272
  'Explorer.getMouseActions': getMouseActions,
6279
- 'Explorer.handleArrowLeft': wrapCommand(handleArrowLeft),
6280
- 'Explorer.handleArrowRight': wrapCommand(handleArrowRight),
6281
- 'Explorer.handleEscape': wrapCommand(handleEscape),
6282
- 'Explorer.handleBlur': wrapCommand(handleBlur),
6273
+ 'Explorer.handleArrowLeft': wrapListItemCommand(handleArrowLeft),
6274
+ 'Explorer.handleArrowRight': wrapListItemCommand(handleArrowRight),
6275
+ 'Explorer.handleEscape': wrapListItemCommand(handleEscape),
6276
+ 'Explorer.handleBlur': wrapListItemCommand(handleBlur),
6283
6277
  'Explorer.handleClick': wrapListItemCommand(handleClick),
6284
- 'Explorer.handleClickAt': wrapCommand(handleClickAt),
6285
- 'Explorer.handleClickCurrent': wrapCommand(handleClickCurrent),
6286
- 'Explorer.handleClickCurrentButKeepFocus': wrapCommand(handleClickCurrentButKeepFocus),
6287
- 'Explorer.handleClickOpenFolder': wrapCommand(handleClickOpenFolder),
6288
- 'Explorer.handleContextMenu': wrapCommand(handleContextMenu),
6289
- 'Explorer.handleContextMenuKeyboard': wrapCommand(handleContextMenuKeyboard),
6290
- 'Explorer.handleCopy': wrapCommand(handleCopy),
6291
- 'Explorer.handleCut': wrapCommand(handleCut),
6292
- 'Explorer.handleDragLeave': wrapCommand(handleDragLeave),
6293
- 'Explorer.handleDragOver': wrapCommand(handleDragOver),
6294
- 'Explorer.handleDrop': wrapCommand(handleDrop),
6295
- 'Explorer.handleFocus': wrapCommand(handleFocus),
6296
- 'Explorer.handleIconThemeChange': wrapCommand(handleIconThemeChange),
6297
- 'Explorer.handleInputBlur': wrapCommand(handleInputBlur),
6298
- 'Explorer.handleInputClick': wrapCommand(handleInputClick),
6299
- 'Explorer.handleInputKeyDown': wrapCommand(handleInputKeyDown),
6300
- 'Explorer.handleKeyDown': wrapCommand(handleKeyDown),
6278
+ 'Explorer.handleClickAt': wrapListItemCommand(handleClickAt),
6279
+ 'Explorer.handleClickCurrent': wrapListItemCommand(handleClickCurrent),
6280
+ 'Explorer.handleClickCurrentButKeepFocus': wrapListItemCommand(handleClickCurrentButKeepFocus),
6281
+ 'Explorer.handleClickOpenFolder': wrapListItemCommand(handleClickOpenFolder),
6282
+ 'Explorer.handleContextMenu': wrapListItemCommand(handleContextMenu),
6283
+ 'Explorer.handleContextMenuKeyboard': wrapListItemCommand(handleContextMenuKeyboard),
6284
+ 'Explorer.handleCopy': wrapListItemCommand(handleCopy),
6285
+ 'Explorer.handleCut': wrapListItemCommand(handleCut),
6286
+ 'Explorer.handleDragLeave': wrapListItemCommand(handleDragLeave),
6287
+ 'Explorer.handleDragOver': wrapListItemCommand(handleDragOver),
6288
+ 'Explorer.handleDrop': wrapListItemCommand(handleDrop),
6289
+ 'Explorer.handleFocus': wrapListItemCommand(handleFocus),
6290
+ 'Explorer.handleIconThemeChange': wrapListItemCommand(handleIconThemeChange),
6291
+ 'Explorer.handleInputBlur': wrapListItemCommand(handleInputBlur),
6292
+ 'Explorer.handleInputClick': wrapListItemCommand(handleInputClick),
6293
+ 'Explorer.handleInputKeyDown': wrapListItemCommand(handleInputKeyDown),
6294
+ 'Explorer.handleKeyDown': wrapListItemCommand(handleKeyDown),
6301
6295
  'Explorer.handlePaste': wrapListItemCommand(handlePaste),
6302
- 'Explorer.handlePointerDown': wrapCommand(handlePointerDown),
6303
- 'Explorer.handleUpload': wrapCommand(handleUpload),
6304
- 'Explorer.handleWheel': wrapCommand(handleWheel),
6296
+ 'Explorer.handlePointerDown': wrapListItemCommand(handlePointerDown),
6297
+ 'Explorer.handleUpload': wrapListItemCommand(handleUpload),
6298
+ 'Explorer.handleWheel': wrapListItemCommand(handleWheel),
6305
6299
  'Explorer.handleWorkspaceChange': wrapListItemCommand(handleWorkspaceChange),
6306
6300
  'Explorer.loadContent': wrapListItemCommand(loadContent),
6307
6301
  'Explorer.newFile': wrapListItemCommand(newFile),
6308
6302
  'Explorer.newFolder': wrapListItemCommand(newFolder),
6309
- 'Explorer.openContainingFolder': wrapCommand(openContainingFolder),
6303
+ 'Explorer.openContainingFolder': wrapListItemCommand(openContainingFolder),
6310
6304
  'Explorer.refresh': wrapListItemCommand(refresh),
6311
6305
  'Explorer.removeDirent': wrapListItemCommand(removeDirent),
6312
6306
  'Explorer.renameDirent': wrapListItemCommand(renameDirent),
6313
6307
  'Explorer.restoreState': restoreState,
6314
- 'Explorer.revealItem': wrapCommand(revealItem),
6315
- 'Explorer.selectAll': wrapCommand(selectAll),
6316
- 'Explorer.selectDown': wrapCommand(selectDown),
6317
- 'Explorer.selectIndices': wrapCommand(setSelectedIndices),
6318
- 'Explorer.selectUp': wrapCommand(selectUp),
6308
+ 'Explorer.revealItem': wrapListItemCommand(revealItem),
6309
+ 'Explorer.selectAll': wrapListItemCommand(selectAll),
6310
+ 'Explorer.selectDown': wrapListItemCommand(selectDown),
6311
+ 'Explorer.selectIndices': wrapListItemCommand(setSelectedIndices),
6312
+ 'Explorer.selectUp': wrapListItemCommand(selectUp),
6319
6313
  'Explorer.setDeltaY': wrapListItemCommand(setDeltaY),
6320
- 'Explorer.setSelectedIndices': wrapCommand(setSelectedIndices),
6321
- 'Explorer.toggleIndividualSelection': wrapCommand(toggleIndividualSelection),
6322
- 'Explorer.updateEditingValue': wrapCommand(updateEditingValue),
6323
- 'Explorer.updateIcons': wrapCommand(updateIcons),
6314
+ 'Explorer.setSelectedIndices': wrapListItemCommand(setSelectedIndices),
6315
+ 'Explorer.toggleIndividualSelection': wrapListItemCommand(toggleIndividualSelection),
6316
+ 'Explorer.updateEditingValue': wrapListItemCommand(updateEditingValue),
6317
+ 'Explorer.updateIcons': wrapListItemCommand(updateIcons),
6324
6318
  // not wrapped
6325
6319
  'Explorer.create2': create2,
6326
6320
  'Explorer.diff2': diff2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/explorer-view",
3
- "version": "3.20.0",
3
+ "version": "3.21.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",