@lvce-editor/title-bar-worker 4.18.0 → 4.19.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/titleBarWorkerMain.js +7 -11
- package/package.json +1 -1
|
@@ -3548,7 +3548,7 @@ const set = rpc => {
|
|
|
3548
3548
|
state.connected = true;
|
|
3549
3549
|
};
|
|
3550
3550
|
|
|
3551
|
-
const handleMessagePort = async (port, viewletCommandMap) => {
|
|
3551
|
+
const handleMessagePort = async (port, viewletCommandMap, setAsRendererProcess = true) => {
|
|
3552
3552
|
const executeViewletCommand = async (uid, command, ...args) => {
|
|
3553
3553
|
const fn = viewletCommandMap[`TitleBar.${command}`];
|
|
3554
3554
|
if (typeof fn !== 'function') {
|
|
@@ -3563,7 +3563,9 @@ const handleMessagePort = async (port, viewletCommandMap) => {
|
|
|
3563
3563
|
},
|
|
3564
3564
|
messagePort: port
|
|
3565
3565
|
});
|
|
3566
|
-
|
|
3566
|
+
if (setAsRendererProcess) {
|
|
3567
|
+
set(rpc);
|
|
3568
|
+
}
|
|
3567
3569
|
};
|
|
3568
3570
|
|
|
3569
3571
|
const getMenuOffset = (x, clientX, iconWidth) => {
|
|
@@ -4968,14 +4970,8 @@ const handleFocus = async state => {
|
|
|
4968
4970
|
};
|
|
4969
4971
|
|
|
4970
4972
|
const handleFocusOut = async state => {
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
return closedState;
|
|
4974
|
-
}
|
|
4975
|
-
return {
|
|
4976
|
-
...closedState,
|
|
4977
|
-
focused: false
|
|
4978
|
-
};
|
|
4973
|
+
// The renderer process checks relatedTarget and closes the menu only when focus leaves the complete menu tree.
|
|
4974
|
+
return state;
|
|
4979
4975
|
};
|
|
4980
4976
|
|
|
4981
4977
|
const openMenu = async (state, focus) => {
|
|
@@ -5462,7 +5458,7 @@ const wakeUp = sleepState => {
|
|
|
5462
5458
|
set$1(sleepState.uid, sleepState, sleepState);
|
|
5463
5459
|
};
|
|
5464
5460
|
|
|
5465
|
-
const handleDirectMessagePort = port => handleMessagePort(port, commandMap);
|
|
5461
|
+
const handleDirectMessagePort = (port, setAsRendererProcess = true) => handleMessagePort(port, commandMap, setAsRendererProcess);
|
|
5466
5462
|
const commandMap = {
|
|
5467
5463
|
'TitleBar.closeMenu': wrapCommand(closeMenu),
|
|
5468
5464
|
'TitleBar.create': create,
|