@lvce-editor/main-area-worker 1.7.0 → 1.8.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/mainAreaWorkerMain.js +13 -2
- package/package.json +1 -1
|
@@ -1255,7 +1255,7 @@ const handleClickCloseTab = (state, groupId, tabId) => {
|
|
|
1255
1255
|
return state;
|
|
1256
1256
|
};
|
|
1257
1257
|
|
|
1258
|
-
const
|
|
1258
|
+
const selectTab = async (state, groupIndex, index) => {
|
|
1259
1259
|
const {
|
|
1260
1260
|
layout
|
|
1261
1261
|
} = state;
|
|
@@ -1296,6 +1296,15 @@ const handleClickTab = async (state, groupIndex, index) => {
|
|
|
1296
1296
|
};
|
|
1297
1297
|
};
|
|
1298
1298
|
|
|
1299
|
+
const handleClickTab = async (state, groupIndexRaw, indexRaw) => {
|
|
1300
|
+
if (!groupIndexRaw || !indexRaw) {
|
|
1301
|
+
return state;
|
|
1302
|
+
}
|
|
1303
|
+
const groupIndex = Number.parseInt(groupIndexRaw);
|
|
1304
|
+
const index = Number.parseInt(indexRaw);
|
|
1305
|
+
return selectTab(state, groupIndex, index);
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1299
1308
|
const id = 7201;
|
|
1300
1309
|
const sendMessagePortToExtensionHostWorker = async port => {
|
|
1301
1310
|
await sendMessagePortToExtensionHostWorker$1(port, id);
|
|
@@ -1400,9 +1409,10 @@ const renderTab = (tab, isActive, tabIndex, groupIndex) => {
|
|
|
1400
1409
|
return [{
|
|
1401
1410
|
childCount: 2,
|
|
1402
1411
|
className: isActive ? 'MainTab MainTabSelected' : 'MainTab',
|
|
1403
|
-
'data-
|
|
1412
|
+
'data-groupIndex': groupIndex,
|
|
1404
1413
|
'data-index': tabIndex,
|
|
1405
1414
|
onClick: HandleClickTab,
|
|
1415
|
+
role: 'tab',
|
|
1406
1416
|
type: Div
|
|
1407
1417
|
}, {
|
|
1408
1418
|
childCount: 1,
|
|
@@ -1539,6 +1549,7 @@ const commandMap = {
|
|
|
1539
1549
|
'MainArea.renderEventListeners': renderEventListeners,
|
|
1540
1550
|
'MainArea.resize': wrapCommand(resize),
|
|
1541
1551
|
'MainArea.saveState': saveState,
|
|
1552
|
+
'MainArea.selectTab': wrapCommand(selectTab),
|
|
1542
1553
|
'MainArea.terminate': terminate
|
|
1543
1554
|
};
|
|
1544
1555
|
|