@lvce-editor/main-area-worker 6.4.0 → 6.6.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.
@@ -87,17 +87,6 @@ const terminate = () => {
87
87
  globalThis.close();
88
88
  };
89
89
 
90
- const closeAll$1 = state => {
91
- return {
92
- ...state,
93
- layout: {
94
- ...state.layout,
95
- activeGroupId: undefined,
96
- groups: []
97
- }
98
- };
99
- };
100
-
101
90
  const Button$1 = 1;
102
91
  const Div = 4;
103
92
  const Span = 8;
@@ -1276,12 +1265,10 @@ const showContextMenu2 = async (uid, menuId, x, y, args) => {
1276
1265
  number(menuId);
1277
1266
  number(x);
1278
1267
  number(y);
1279
- // @ts-ignore
1280
1268
  await invoke('ContextMenu.show2', uid, menuId, x, y, args);
1281
1269
  };
1282
1270
  const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
1283
1271
  const command = 'IconTheme.handleMessagePort';
1284
- // @ts-ignore
1285
1272
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
1286
1273
  };
1287
1274
  const sendMessagePortToExtensionHostWorker$1 = async (port, rpcId = 0) => {
@@ -1628,6 +1615,37 @@ const closeTab = (state, groupId, tabId) => {
1628
1615
  };
1629
1616
  };
1630
1617
 
1618
+ const closeActiveEditor = state => {
1619
+ const {
1620
+ layout
1621
+ } = state;
1622
+ const {
1623
+ groups
1624
+ } = layout;
1625
+ const focusedGroup = groups.find(group => group.focused);
1626
+ if (!focusedGroup) {
1627
+ return state;
1628
+ }
1629
+ const {
1630
+ activeTabId
1631
+ } = focusedGroup;
1632
+ if (activeTabId === undefined) {
1633
+ return state;
1634
+ }
1635
+ return closeTab(state, focusedGroup.id, activeTabId);
1636
+ };
1637
+
1638
+ const closeAll$1 = state => {
1639
+ return {
1640
+ ...state,
1641
+ layout: {
1642
+ ...state.layout,
1643
+ activeGroupId: undefined,
1644
+ groups: []
1645
+ }
1646
+ };
1647
+ };
1648
+
1631
1649
  const closeFocusedTab = state => {
1632
1650
  const {
1633
1651
  layout
@@ -3743,7 +3761,9 @@ const splitRight = (state, groupId) => {
3743
3761
  };
3744
3762
 
3745
3763
  const commandMap = {
3764
+ 'MainArea.closeActiveEditor': wrapCommand(closeActiveEditor),
3746
3765
  'MainArea.closeAll': wrapCommand(closeAll$1),
3766
+ 'MainArea.closeAllEditors': wrapCommand(closeAll$1),
3747
3767
  'MainArea.closeFocusedTab': wrapCommand(closeFocusedTab),
3748
3768
  'MainArea.create': create,
3749
3769
  'MainArea.diff2': diff2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-area-worker",
3
- "version": "6.4.0",
3
+ "version": "6.6.0",
4
4
  "description": "Main Area Worker",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,6 +11,6 @@
11
11
  "type": "module",
12
12
  "main": "dist/mainAreaWorkerMain.js",
13
13
  "dependencies": {
14
- "@lvce-editor/virtual-dom-worker": "^6.9.0"
14
+ "@lvce-editor/virtual-dom-worker": "^6.10.0"
15
15
  }
16
16
  }