@lvce-editor/explorer-view 2.63.0 → 3.1.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.
- package/dist/explorerViewWorkerMain.js +41 -18
- package/package.json +1 -1
|
@@ -2085,6 +2085,11 @@ const RenderValue = 8;
|
|
|
2085
2085
|
const RenderSelection = 9;
|
|
2086
2086
|
const RenderDragData = 10;
|
|
2087
2087
|
|
|
2088
|
+
const diffType$4 = RenderDragData;
|
|
2089
|
+
const isEqual$5 = (oldState, newState) => {
|
|
2090
|
+
return oldState.isPointerDown || !newState.isPointerDown;
|
|
2091
|
+
};
|
|
2092
|
+
|
|
2088
2093
|
const diffType$3 = RenderFocus;
|
|
2089
2094
|
const isEqual$4 = (oldState, newState) => {
|
|
2090
2095
|
return oldState.focused === newState.focused && oldState.focus === newState.focus;
|
|
@@ -2108,8 +2113,8 @@ const isEqual$1 = (oldState, newState) => {
|
|
|
2108
2113
|
return oldState.focus === Input$1 && newState.focus === Input$1 && oldState.editingValue === newState.editingValue;
|
|
2109
2114
|
};
|
|
2110
2115
|
|
|
2111
|
-
const modules = [isEqual$3, isEqual$4, isEqual$4, isEqual$1, isEqual$2];
|
|
2112
|
-
const numbers = [diffType$2, diffType$3, RenderFocusContext, diffType, diffType$1];
|
|
2116
|
+
const modules = [isEqual$3, isEqual$4, isEqual$4, isEqual$1, isEqual$2, isEqual$5];
|
|
2117
|
+
const numbers = [diffType$2, diffType$3, RenderFocusContext, diffType, diffType$1, diffType$4];
|
|
2113
2118
|
|
|
2114
2119
|
const diff = (oldState, newState) => {
|
|
2115
2120
|
const diffResult = [];
|
|
@@ -2411,7 +2416,7 @@ const focusPrevious = state => {
|
|
|
2411
2416
|
}
|
|
2412
2417
|
};
|
|
2413
2418
|
|
|
2414
|
-
const commandIds = ['acceptEdit', 'cancelEdit', 'cancelTypeAhead', 'collapseAll', 'copyPath', 'copyRelativePath', 'dispose', 'expandAll', 'expandRecursively', 'focus', 'focusFirst', 'focusIndex', 'focusLast', 'focusNext', 'focusNone', 'focusPrevious', 'getFocusedDirent', 'getMenuEntries2', 'getMouseActions', 'handleArrowLeft', 'handleArrowLeft', 'handleArrowRight', 'handleArrowRight', 'handleBlur', 'handleClick', 'handleClickAt', 'handleClickCurrent', 'handleClickCurrentButKeepFocus', 'handleClickOpenFolder', 'handleContextMenu', 'handleContextMenuKeyboard', 'handleCopy', 'handleCut', 'handleDragLeave', 'handleDragOver', 'handleDragStart', 'handleDrop', 'handleFocus', 'handleIconThemeChange', 'handleInputBlur', 'handleInputClick', 'handleInputKeyDown', 'handleKeyDown', 'handleLanguagesChanged', 'handleMouseEnter', 'handleMouseLeave', 'handlePaste', 'handlePointerDown', 'handleUpload', 'handleWheel', 'handleWorkspaceChange', 'hotReload', 'newFile', 'newFolder', 'openContainingFolder', 'refresh', 'removeDirent', 'rename', 'renameDirent', 'renderEventListeners', 'revealItem', 'revealItem', 'scrollDown', 'scrollUp', 'selectAll', 'selectDown', 'selectIndices', 'selectUp', 'setDeltaY', 'setSelectedIndices', 'toggleIndividualSelection', 'updateEditingValue', 'updateIcons'];
|
|
2419
|
+
const commandIds = ['acceptEdit', 'cancelEdit', 'cancelTypeAhead', 'collapseAll', 'copyPath', 'copyRelativePath', 'dispose', 'expandAll', 'expandRecursively', 'focus', 'focusFirst', 'focusIndex', 'focusLast', 'focusNext', 'focusNone', 'focusPrevious', 'getFocusedDirent', 'getMenuEntries2', 'getMouseActions', 'handleArrowLeft', 'handleArrowLeft', 'handleArrowRight', 'handleArrowRight', 'handleBlur', 'handleClick', 'handleClickAt', 'handleClickCurrent', 'handleClickCurrentButKeepFocus', 'handleClickOpenFolder', 'handleContextMenu', 'handleContextMenuKeyboard', 'handleCopy', 'handleCut', 'handleDragLeave', 'handleDragOver', 'handleDragOverIndex', 'handleDragStart', 'handleDrop', 'handleFocus', 'handleIconThemeChange', 'handleInputBlur', 'handleInputClick', 'handleInputKeyDown', 'handleKeyDown', 'handleLanguagesChanged', 'handleMouseEnter', 'handleMouseLeave', 'handlePaste', 'handlePointerDown', 'handleUpload', 'handleWheel', 'handleWorkspaceChange', 'hotReload', 'newFile', 'newFolder', 'openContainingFolder', 'refresh', 'removeDirent', 'rename', 'renameDirent', 'renderEventListeners', 'revealItem', 'revealItem', 'scrollDown', 'scrollUp', 'selectAll', 'selectDown', 'selectIndices', 'selectUp', 'setDeltaY', 'setSelectedIndices', 'toggleIndividualSelection', 'updateEditingValue', 'updateIcons'];
|
|
2415
2420
|
|
|
2416
2421
|
const getCommandIds = () => {
|
|
2417
2422
|
return commandIds;
|
|
@@ -3289,19 +3294,28 @@ const canBeDroppedInto = dirent => {
|
|
|
3289
3294
|
}
|
|
3290
3295
|
};
|
|
3291
3296
|
|
|
3297
|
+
const countInRange = (start, end) => {
|
|
3298
|
+
const items = [];
|
|
3299
|
+
for (let i = start; i < end; i++) {
|
|
3300
|
+
items.push(i);
|
|
3301
|
+
}
|
|
3302
|
+
return items;
|
|
3303
|
+
};
|
|
3304
|
+
|
|
3292
3305
|
const dropTargetFull = [-1];
|
|
3293
3306
|
|
|
3294
|
-
const getNewDropTargets = (state,
|
|
3307
|
+
const getNewDropTargets = (state, index) => {
|
|
3295
3308
|
const {
|
|
3296
3309
|
items
|
|
3297
3310
|
} = state;
|
|
3298
|
-
const index = getIndexFromPosition(state, x, y);
|
|
3299
3311
|
if (index === -1) {
|
|
3300
3312
|
return dropTargetFull;
|
|
3301
3313
|
}
|
|
3302
3314
|
const item = items[index];
|
|
3303
3315
|
if (!canBeDroppedInto(item)) {
|
|
3304
|
-
|
|
3316
|
+
const startIndex = getParentStartIndex(items, index);
|
|
3317
|
+
const endIndex = getParentEndIndex(items, index);
|
|
3318
|
+
return countInRange(startIndex, endIndex);
|
|
3305
3319
|
}
|
|
3306
3320
|
const newDropTargets = [index];
|
|
3307
3321
|
return newDropTargets;
|
|
@@ -3322,13 +3336,11 @@ const isEqual = (a, b) => {
|
|
|
3322
3336
|
return true;
|
|
3323
3337
|
};
|
|
3324
3338
|
|
|
3325
|
-
const
|
|
3326
|
-
number(x);
|
|
3327
|
-
number(y);
|
|
3339
|
+
const handleDragOverIndex = (state, index) => {
|
|
3328
3340
|
const {
|
|
3329
3341
|
dropTargets
|
|
3330
3342
|
} = state;
|
|
3331
|
-
const newDropTargets = getNewDropTargets(state,
|
|
3343
|
+
const newDropTargets = getNewDropTargets(state, index);
|
|
3332
3344
|
if (isEqual(dropTargets, newDropTargets)) {
|
|
3333
3345
|
return state;
|
|
3334
3346
|
}
|
|
@@ -3338,6 +3350,13 @@ const handleDragOver = (state, x, y) => {
|
|
|
3338
3350
|
};
|
|
3339
3351
|
};
|
|
3340
3352
|
|
|
3353
|
+
const handleDragOver = (state, x, y) => {
|
|
3354
|
+
number(x);
|
|
3355
|
+
number(y);
|
|
3356
|
+
const index = getIndexFromPosition(state, x, y);
|
|
3357
|
+
return handleDragOverIndex(state, index);
|
|
3358
|
+
};
|
|
3359
|
+
|
|
3341
3360
|
const handleDragStart = state => {
|
|
3342
3361
|
return state;
|
|
3343
3362
|
};
|
|
@@ -4628,14 +4647,20 @@ const getDragLabel = urls => {
|
|
|
4628
4647
|
}
|
|
4629
4648
|
return `${urls.length}`;
|
|
4630
4649
|
};
|
|
4650
|
+
|
|
4651
|
+
const toUri = path => {
|
|
4652
|
+
if (path.startsWith('file://')) {
|
|
4653
|
+
return path;
|
|
4654
|
+
}
|
|
4655
|
+
return 'file://' + path;
|
|
4656
|
+
};
|
|
4631
4657
|
const getDragData = urls => {
|
|
4632
|
-
const data = urls.join('\n');
|
|
4633
|
-
// TODO send selected urls
|
|
4658
|
+
const data = urls.map(toUri).join('\n');
|
|
4634
4659
|
const dragData = [{
|
|
4635
|
-
type: 'text/
|
|
4660
|
+
type: 'text/uri-list',
|
|
4636
4661
|
data
|
|
4637
4662
|
}, {
|
|
4638
|
-
type: 'text/
|
|
4663
|
+
type: 'text/plain',
|
|
4639
4664
|
data
|
|
4640
4665
|
}];
|
|
4641
4666
|
// @ts-ignore
|
|
@@ -4940,6 +4965,7 @@ const getListItemsVirtualDom = (visibleItems, focusedIndex, focused, dropTargets
|
|
|
4940
4965
|
onContextMenu: HandleContextMenu,
|
|
4941
4966
|
onDragLeave: HandleDragLeave,
|
|
4942
4967
|
onDragOver: HandleDragOver,
|
|
4968
|
+
onDragStart: HandleDragStart,
|
|
4943
4969
|
onDrop: HandleDrop,
|
|
4944
4970
|
onFocus: HandleListFocus,
|
|
4945
4971
|
onPointerDown: HandlePointerDown,
|
|
@@ -5363,10 +5389,6 @@ const renderEventListeners = () => {
|
|
|
5363
5389
|
name: HandleDragStart,
|
|
5364
5390
|
params: ['handleDragStart'],
|
|
5365
5391
|
// @ts-ignore
|
|
5366
|
-
dragInfo: [{
|
|
5367
|
-
type: 'text/plain',
|
|
5368
|
-
data: 'https://example.com'
|
|
5369
|
-
}],
|
|
5370
5392
|
dragEffect: 'copyMove'
|
|
5371
5393
|
}];
|
|
5372
5394
|
};
|
|
@@ -5665,6 +5687,7 @@ const commandMap = {
|
|
|
5665
5687
|
'Explorer.focusIndex': wrapCommand(focusIndex),
|
|
5666
5688
|
'Explorer.focusLast': wrapCommand(focusLast),
|
|
5667
5689
|
'Explorer.handleDragStart': wrapCommand(handleDragStart),
|
|
5690
|
+
'Explorer.handleDragOverIndex': wrapCommand(handleDragOverIndex),
|
|
5668
5691
|
'Explorer.focusNext': wrapCommand(focusNext),
|
|
5669
5692
|
'Explorer.focusNone': wrapCommand(focusNone),
|
|
5670
5693
|
'Explorer.focusPrevious': wrapCommand(focusPrevious),
|