@lvce-editor/panel-worker 2.10.0 → 2.10.2

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.
@@ -1589,8 +1589,13 @@ const isEqual$1 = (oldState, newState) => {
1589
1589
  return oldState.childUid === newState.childUid;
1590
1590
  };
1591
1591
 
1592
+ const areBadgeCountsEqual = (oldBadgeCounts, newBadgeCounts) => {
1593
+ const oldKeys = Object.keys(oldBadgeCounts);
1594
+ const newKeys = Object.keys(newBadgeCounts);
1595
+ return oldKeys.length === newKeys.length && oldKeys.every(key => oldBadgeCounts[key] === newBadgeCounts[key]);
1596
+ };
1592
1597
  const isEqual = (oldState, newState) => {
1593
- return oldState.assetDir === newState.assetDir && oldState.initial === newState.initial && oldState.currentViewletId === newState.currentViewletId && oldState.maximized === newState.maximized && oldState.selectedIndex === newState.selectedIndex && oldState.views === newState.views && oldState.childUid === newState.childUid && oldState.actionsUid === newState.actionsUid;
1598
+ return oldState.assetDir === newState.assetDir && areBadgeCountsEqual(oldState.badgeCounts, newState.badgeCounts) && oldState.initial === newState.initial && oldState.currentViewletId === newState.currentViewletId && oldState.maximized === newState.maximized && oldState.selectedIndex === newState.selectedIndex && oldState.views === newState.views && oldState.childUid === newState.childUid && oldState.actionsUid === newState.actionsUid;
1594
1599
  };
1595
1600
 
1596
1601
  const RenderItems = 4;
@@ -1636,8 +1641,13 @@ const set = rpc => {
1636
1641
  state.connected = true;
1637
1642
  };
1638
1643
 
1644
+ const rendererWorkerCommands = new Set(['handleClickClose', 'handleClickMaximize', 'handleClickUnmaximize']);
1639
1645
  const handleMessagePort = async (port, viewletCommandMap) => {
1640
1646
  const executeViewletCommand = async (uid, command, ...args) => {
1647
+ if (rendererWorkerCommands.has(command)) {
1648
+ await invoke$1('Viewlet.executeViewletCommand', uid, command, ...args);
1649
+ return;
1650
+ }
1641
1651
  const fn = viewletCommandMap[`Panel.${command}`];
1642
1652
  if (typeof fn !== 'function') {
1643
1653
  throw new TypeError(`Viewlet command not found: ${command}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/panel-worker",
3
- "version": "2.10.0",
3
+ "version": "2.10.2",
4
4
  "description": "Panel Worker",
5
5
  "repository": {
6
6
  "type": "git",