@lvce-editor/panel-worker 2.10.4 → 2.11.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/panelWorkerMain.js +12 -5
- package/package.json +1 -1
package/dist/panelWorkerMain.js
CHANGED
|
@@ -1646,12 +1646,17 @@ const layoutCommands = {
|
|
|
1646
1646
|
handleClickMaximize: 'Layout.maximizePanel',
|
|
1647
1647
|
handleClickUnmaximize: 'Layout.unmaximizePanel'
|
|
1648
1648
|
};
|
|
1649
|
-
const
|
|
1649
|
+
const forwardLayoutCommand = layoutCommand => {
|
|
1650
|
+
setTimeout(() => {
|
|
1651
|
+
void invoke('Viewlet.forwardRendererWorkerCommand', layoutCommand);
|
|
1652
|
+
}, 0);
|
|
1653
|
+
};
|
|
1654
|
+
const handleMessagePort = async (port, viewletCommandMap, setAsRendererProcess = true) => {
|
|
1650
1655
|
const executeViewletCommand = async (uid, command, ...args) => {
|
|
1651
1656
|
const layoutCommand = layoutCommands[command];
|
|
1652
1657
|
if (layoutCommand) {
|
|
1653
|
-
//
|
|
1654
|
-
|
|
1658
|
+
// Forward after this direct event returns so layout callbacks use an idle worker RPC.
|
|
1659
|
+
forwardLayoutCommand(layoutCommand);
|
|
1655
1660
|
return;
|
|
1656
1661
|
}
|
|
1657
1662
|
const fn = viewletCommandMap[`Panel.${command}`];
|
|
@@ -1667,7 +1672,9 @@ const handleMessagePort = async (port, viewletCommandMap) => {
|
|
|
1667
1672
|
},
|
|
1668
1673
|
messagePort: port
|
|
1669
1674
|
});
|
|
1670
|
-
|
|
1675
|
+
if (setAsRendererProcess) {
|
|
1676
|
+
set(rpc);
|
|
1677
|
+
}
|
|
1671
1678
|
};
|
|
1672
1679
|
|
|
1673
1680
|
const setBadgeCount = (state, id, count) => {
|
|
@@ -2444,7 +2451,7 @@ const selectName = async (state, name) => {
|
|
|
2444
2451
|
return selectIndex(state, index);
|
|
2445
2452
|
};
|
|
2446
2453
|
|
|
2447
|
-
const handleDirectMessagePort = port => handleMessagePort(port, commandMap);
|
|
2454
|
+
const handleDirectMessagePort = (port, setAsRendererProcess = true) => handleMessagePort(port, commandMap, setAsRendererProcess);
|
|
2448
2455
|
const commandMap = {
|
|
2449
2456
|
'Panel.create': create,
|
|
2450
2457
|
'Panel.diff2': diff2,
|