@lvce-editor/title-bar-worker 4.15.2 → 4.15.3
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/titleBarWorkerMain.js +52 -51
- package/package.json +1 -1
|
@@ -5057,57 +5057,6 @@ const handleKeyEnterMenuClosed = state => {
|
|
|
5057
5057
|
return openMenu(state, /* focus */true);
|
|
5058
5058
|
};
|
|
5059
5059
|
|
|
5060
|
-
const handleKeyEnterMenuOpen = state => {
|
|
5061
|
-
// TODO
|
|
5062
|
-
// await Menu.selectCurrent()
|
|
5063
|
-
return state;
|
|
5064
|
-
};
|
|
5065
|
-
|
|
5066
|
-
const handleKeyEnter = ifElse(handleKeyEnterMenuOpen, handleKeyEnterMenuClosed);
|
|
5067
|
-
|
|
5068
|
-
const handleKeyEscapeMenuOpen = state => {
|
|
5069
|
-
const {
|
|
5070
|
-
menus
|
|
5071
|
-
} = state;
|
|
5072
|
-
if (menus.length > 1) {
|
|
5073
|
-
return closeOneMenu(state);
|
|
5074
|
-
}
|
|
5075
|
-
return closeMenu(state, /* keepFocus */true);
|
|
5076
|
-
};
|
|
5077
|
-
|
|
5078
|
-
const handleKeyEscape = ifElse(handleKeyEscapeMenuOpen, noop);
|
|
5079
|
-
|
|
5080
|
-
const handleKeyHomeMenuOpen = state => {
|
|
5081
|
-
const {
|
|
5082
|
-
menus
|
|
5083
|
-
} = state;
|
|
5084
|
-
const menu = menus[0];
|
|
5085
|
-
const newFocusedIndex = getIndexToFocusFirst(menu.items);
|
|
5086
|
-
const newMenus = [{
|
|
5087
|
-
...menu,
|
|
5088
|
-
focusedIndex: newFocusedIndex
|
|
5089
|
-
}];
|
|
5090
|
-
return {
|
|
5091
|
-
...state,
|
|
5092
|
-
menus: newMenus
|
|
5093
|
-
};
|
|
5094
|
-
};
|
|
5095
|
-
|
|
5096
|
-
const handleKeyHome = ifElse(handleKeyHomeMenuOpen, focusFirst);
|
|
5097
|
-
|
|
5098
|
-
const handleKeySpaceMenuClosed = state => {
|
|
5099
|
-
return openMenu(state, /* focus */true);
|
|
5100
|
-
};
|
|
5101
|
-
|
|
5102
|
-
const handleKeySpaceMenuOpen = state => {
|
|
5103
|
-
// TODO
|
|
5104
|
-
// await Menu.selectCurrent()
|
|
5105
|
-
return state;
|
|
5106
|
-
};
|
|
5107
|
-
|
|
5108
|
-
// TODO this is same as handle key enter -> merge the functions
|
|
5109
|
-
const handleKeySpace = ifElse(handleKeySpaceMenuOpen, handleKeySpaceMenuClosed);
|
|
5110
|
-
|
|
5111
5060
|
const executeMenuItemCommand = async item => {
|
|
5112
5061
|
await invoke(item.command, ...(item.args || []));
|
|
5113
5062
|
};
|
|
@@ -5199,6 +5148,58 @@ const handleMenuClick = async (state, level, index) => {
|
|
|
5199
5148
|
}
|
|
5200
5149
|
};
|
|
5201
5150
|
|
|
5151
|
+
const handleKeyEnterMenuOpen = state => {
|
|
5152
|
+
const {
|
|
5153
|
+
menus
|
|
5154
|
+
} = state;
|
|
5155
|
+
const menu = menus.at(-1);
|
|
5156
|
+
if (!menu) {
|
|
5157
|
+
return state;
|
|
5158
|
+
}
|
|
5159
|
+
return handleMenuClick(state, menu.level, menu.focusedIndex);
|
|
5160
|
+
};
|
|
5161
|
+
|
|
5162
|
+
const handleKeyEnter = ifElse(handleKeyEnterMenuOpen, handleKeyEnterMenuClosed);
|
|
5163
|
+
|
|
5164
|
+
const handleKeyEscapeMenuOpen = state => {
|
|
5165
|
+
const {
|
|
5166
|
+
menus
|
|
5167
|
+
} = state;
|
|
5168
|
+
if (menus.length > 1) {
|
|
5169
|
+
return closeOneMenu(state);
|
|
5170
|
+
}
|
|
5171
|
+
return closeMenu(state, /* keepFocus */true);
|
|
5172
|
+
};
|
|
5173
|
+
|
|
5174
|
+
const handleKeyEscape = ifElse(handleKeyEscapeMenuOpen, noop);
|
|
5175
|
+
|
|
5176
|
+
const handleKeyHomeMenuOpen = state => {
|
|
5177
|
+
const {
|
|
5178
|
+
menus
|
|
5179
|
+
} = state;
|
|
5180
|
+
const menu = menus[0];
|
|
5181
|
+
const newFocusedIndex = getIndexToFocusFirst(menu.items);
|
|
5182
|
+
const newMenus = [{
|
|
5183
|
+
...menu,
|
|
5184
|
+
focusedIndex: newFocusedIndex
|
|
5185
|
+
}];
|
|
5186
|
+
return {
|
|
5187
|
+
...state,
|
|
5188
|
+
menus: newMenus
|
|
5189
|
+
};
|
|
5190
|
+
};
|
|
5191
|
+
|
|
5192
|
+
const handleKeyHome = ifElse(handleKeyHomeMenuOpen, focusFirst);
|
|
5193
|
+
|
|
5194
|
+
const handleKeySpaceMenuClosed = state => {
|
|
5195
|
+
return openMenu(state, /* focus */true);
|
|
5196
|
+
};
|
|
5197
|
+
|
|
5198
|
+
const handleKeySpaceMenuOpen = state => handleKeyEnterMenuOpen(state);
|
|
5199
|
+
|
|
5200
|
+
// TODO this is same as handle key enter -> merge the functions
|
|
5201
|
+
const handleKeySpace = ifElse(handleKeySpaceMenuOpen, handleKeySpaceMenuClosed);
|
|
5202
|
+
|
|
5202
5203
|
const getNewMenus = async (menus, level, index, flags) => {
|
|
5203
5204
|
const menu = menus[level];
|
|
5204
5205
|
if (!menu) {
|