@lvce-editor/explorer-view 4.0.0 → 4.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 +18 -10
- package/package.json +1 -1
|
@@ -3975,6 +3975,22 @@ const show = async (x, y, id, ...args) => {
|
|
|
3975
3975
|
|
|
3976
3976
|
const Explorer = 4;
|
|
3977
3977
|
|
|
3978
|
+
const handleContextMenuAtIndex = async (state, index, x, y) => {
|
|
3979
|
+
number(x);
|
|
3980
|
+
number(y);
|
|
3981
|
+
const {
|
|
3982
|
+
uid
|
|
3983
|
+
} = state;
|
|
3984
|
+
const newState = {
|
|
3985
|
+
...state,
|
|
3986
|
+
focusedIndex: index,
|
|
3987
|
+
focused: false
|
|
3988
|
+
};
|
|
3989
|
+
set$1(uid, state, newState);
|
|
3990
|
+
await show(x, y, Explorer);
|
|
3991
|
+
return newState;
|
|
3992
|
+
};
|
|
3993
|
+
|
|
3978
3994
|
const handleContextMenuKeyboard = async state => {
|
|
3979
3995
|
const {
|
|
3980
3996
|
focusedIndex,
|
|
@@ -3985,22 +4001,14 @@ const handleContextMenuKeyboard = async state => {
|
|
|
3985
4001
|
} = state;
|
|
3986
4002
|
const menuX = x;
|
|
3987
4003
|
const menuY = y + (focusedIndex - minLineY + 1) * itemHeight;
|
|
3988
|
-
|
|
3989
|
-
return state;
|
|
4004
|
+
return handleContextMenuAtIndex(state, focusedIndex, menuX, menuY);
|
|
3990
4005
|
};
|
|
3991
4006
|
|
|
3992
4007
|
const handleContextMenuMouseAt = async (state, x, y) => {
|
|
3993
4008
|
number(x);
|
|
3994
4009
|
number(y);
|
|
3995
4010
|
const focusedIndex = getIndexFromPosition(state, x, y);
|
|
3996
|
-
|
|
3997
|
-
...state,
|
|
3998
|
-
focusedIndex,
|
|
3999
|
-
focused: false
|
|
4000
|
-
};
|
|
4001
|
-
set$1(state.uid, state, newState);
|
|
4002
|
-
await show(x, y, Explorer);
|
|
4003
|
-
return state;
|
|
4011
|
+
return handleContextMenuAtIndex(state, focusedIndex, x, y);
|
|
4004
4012
|
};
|
|
4005
4013
|
|
|
4006
4014
|
const getContextMenuHandler = button => {
|