@lvce-editor/title-bar-worker 4.15.2 → 4.15.4
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 +56 -51
- package/package.json +1 -1
|
@@ -3347,6 +3347,10 @@ const getKeyBindings = () => {
|
|
|
3347
3347
|
command: 'TitleBar.handleKeyArrowLeft',
|
|
3348
3348
|
key: LeftArrow$1,
|
|
3349
3349
|
when: FocusTitleBarMenuBar
|
|
3350
|
+
}, {
|
|
3351
|
+
command: 'TitleBar.handleKeyEnter',
|
|
3352
|
+
key: Enter$1,
|
|
3353
|
+
when: FocusTitleBarMenuBar
|
|
3350
3354
|
}, {
|
|
3351
3355
|
command: 'TitleBar.handleKeySpace',
|
|
3352
3356
|
key: Space$1,
|
|
@@ -5057,57 +5061,6 @@ const handleKeyEnterMenuClosed = state => {
|
|
|
5057
5061
|
return openMenu(state, /* focus */true);
|
|
5058
5062
|
};
|
|
5059
5063
|
|
|
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
5064
|
const executeMenuItemCommand = async item => {
|
|
5112
5065
|
await invoke(item.command, ...(item.args || []));
|
|
5113
5066
|
};
|
|
@@ -5199,6 +5152,58 @@ const handleMenuClick = async (state, level, index) => {
|
|
|
5199
5152
|
}
|
|
5200
5153
|
};
|
|
5201
5154
|
|
|
5155
|
+
const handleKeyEnterMenuOpen = state => {
|
|
5156
|
+
const {
|
|
5157
|
+
menus
|
|
5158
|
+
} = state;
|
|
5159
|
+
const menu = menus.at(-1);
|
|
5160
|
+
if (!menu) {
|
|
5161
|
+
return state;
|
|
5162
|
+
}
|
|
5163
|
+
return handleMenuClick(state, menu.level, menu.focusedIndex);
|
|
5164
|
+
};
|
|
5165
|
+
|
|
5166
|
+
const handleKeyEnter = ifElse(handleKeyEnterMenuOpen, handleKeyEnterMenuClosed);
|
|
5167
|
+
|
|
5168
|
+
const handleKeyEscapeMenuOpen = state => {
|
|
5169
|
+
const {
|
|
5170
|
+
menus
|
|
5171
|
+
} = state;
|
|
5172
|
+
if (menus.length > 1) {
|
|
5173
|
+
return closeOneMenu(state);
|
|
5174
|
+
}
|
|
5175
|
+
return closeMenu(state, /* keepFocus */true);
|
|
5176
|
+
};
|
|
5177
|
+
|
|
5178
|
+
const handleKeyEscape = ifElse(handleKeyEscapeMenuOpen, noop);
|
|
5179
|
+
|
|
5180
|
+
const handleKeyHomeMenuOpen = state => {
|
|
5181
|
+
const {
|
|
5182
|
+
menus
|
|
5183
|
+
} = state;
|
|
5184
|
+
const menu = menus[0];
|
|
5185
|
+
const newFocusedIndex = getIndexToFocusFirst(menu.items);
|
|
5186
|
+
const newMenus = [{
|
|
5187
|
+
...menu,
|
|
5188
|
+
focusedIndex: newFocusedIndex
|
|
5189
|
+
}];
|
|
5190
|
+
return {
|
|
5191
|
+
...state,
|
|
5192
|
+
menus: newMenus
|
|
5193
|
+
};
|
|
5194
|
+
};
|
|
5195
|
+
|
|
5196
|
+
const handleKeyHome = ifElse(handleKeyHomeMenuOpen, focusFirst);
|
|
5197
|
+
|
|
5198
|
+
const handleKeySpaceMenuClosed = state => {
|
|
5199
|
+
return openMenu(state, /* focus */true);
|
|
5200
|
+
};
|
|
5201
|
+
|
|
5202
|
+
const handleKeySpaceMenuOpen = state => handleKeyEnterMenuOpen(state);
|
|
5203
|
+
|
|
5204
|
+
// TODO this is same as handle key enter -> merge the functions
|
|
5205
|
+
const handleKeySpace = ifElse(handleKeySpaceMenuOpen, handleKeySpaceMenuClosed);
|
|
5206
|
+
|
|
5202
5207
|
const getNewMenus = async (menus, level, index, flags) => {
|
|
5203
5208
|
const menu = menus[level];
|
|
5204
5209
|
if (!menu) {
|