@lvce-editor/panel-worker 2.10.5 → 2.11.1
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 +13 -3
- package/package.json +1 -1
package/dist/panelWorkerMain.js
CHANGED
|
@@ -1626,6 +1626,13 @@ const diff2 = uid => {
|
|
|
1626
1626
|
return result;
|
|
1627
1627
|
};
|
|
1628
1628
|
|
|
1629
|
+
const getCurrentViewletId = state => {
|
|
1630
|
+
const {
|
|
1631
|
+
currentViewletId
|
|
1632
|
+
} = state;
|
|
1633
|
+
return currentViewletId;
|
|
1634
|
+
};
|
|
1635
|
+
|
|
1629
1636
|
const state = {
|
|
1630
1637
|
connected: false
|
|
1631
1638
|
};
|
|
@@ -1651,7 +1658,7 @@ const forwardLayoutCommand = layoutCommand => {
|
|
|
1651
1658
|
void invoke('Viewlet.forwardRendererWorkerCommand', layoutCommand);
|
|
1652
1659
|
}, 0);
|
|
1653
1660
|
};
|
|
1654
|
-
const handleMessagePort = async (port, viewletCommandMap) => {
|
|
1661
|
+
const handleMessagePort = async (port, viewletCommandMap, setAsRendererProcess = true) => {
|
|
1655
1662
|
const executeViewletCommand = async (uid, command, ...args) => {
|
|
1656
1663
|
const layoutCommand = layoutCommands[command];
|
|
1657
1664
|
if (layoutCommand) {
|
|
@@ -1672,7 +1679,9 @@ const handleMessagePort = async (port, viewletCommandMap) => {
|
|
|
1672
1679
|
},
|
|
1673
1680
|
messagePort: port
|
|
1674
1681
|
});
|
|
1675
|
-
|
|
1682
|
+
if (setAsRendererProcess) {
|
|
1683
|
+
set(rpc);
|
|
1684
|
+
}
|
|
1676
1685
|
};
|
|
1677
1686
|
|
|
1678
1687
|
const setBadgeCount = (state, id, count) => {
|
|
@@ -2449,11 +2458,12 @@ const selectName = async (state, name) => {
|
|
|
2449
2458
|
return selectIndex(state, index);
|
|
2450
2459
|
};
|
|
2451
2460
|
|
|
2452
|
-
const handleDirectMessagePort = port => handleMessagePort(port, commandMap);
|
|
2461
|
+
const handleDirectMessagePort = (port, setAsRendererProcess = true) => handleMessagePort(port, commandMap, setAsRendererProcess);
|
|
2453
2462
|
const commandMap = {
|
|
2454
2463
|
'Panel.create': create,
|
|
2455
2464
|
'Panel.diff2': diff2,
|
|
2456
2465
|
'Panel.getCommandIds': getCommandIds,
|
|
2466
|
+
'Panel.getCurrentViewletId': wrapGetter(getCurrentViewletId),
|
|
2457
2467
|
'Panel.handleBlur': wrapCommand(handleBlur),
|
|
2458
2468
|
'Panel.handleClickClose': wrapCommand(handleClickClose),
|
|
2459
2469
|
'Panel.handleClickMaximize': wrapCommand(handleClickMaximize),
|