@lvce-editor/main-area-worker 9.36.0 → 9.37.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/mainAreaWorkerMain.js +35 -22
- package/package.json +1 -1
|
@@ -2887,6 +2887,37 @@ const diff2 = uid => {
|
|
|
2887
2887
|
return result;
|
|
2888
2888
|
};
|
|
2889
2889
|
|
|
2890
|
+
const getActiveTab = state => {
|
|
2891
|
+
const {
|
|
2892
|
+
layout
|
|
2893
|
+
} = state;
|
|
2894
|
+
const {
|
|
2895
|
+
groups
|
|
2896
|
+
} = layout;
|
|
2897
|
+
const activeGroup = groups.find(group => group.focused);
|
|
2898
|
+
if (!activeGroup || !activeGroup.activeTabId) {
|
|
2899
|
+
return undefined;
|
|
2900
|
+
}
|
|
2901
|
+
const activeTab = activeGroup.tabs.find(tab => tab.id === activeGroup.activeTabId);
|
|
2902
|
+
if (!activeTab) {
|
|
2903
|
+
return undefined;
|
|
2904
|
+
}
|
|
2905
|
+
return {
|
|
2906
|
+
groupId: activeGroup.id,
|
|
2907
|
+
tab: activeTab
|
|
2908
|
+
};
|
|
2909
|
+
};
|
|
2910
|
+
|
|
2911
|
+
const focus = async state => {
|
|
2912
|
+
const activeTab = getActiveTab(state);
|
|
2913
|
+
const editorUid = activeTab?.tab.editorUid;
|
|
2914
|
+
if (typeof editorUid !== 'number' || editorUid < 0) {
|
|
2915
|
+
return state;
|
|
2916
|
+
}
|
|
2917
|
+
await invoke('Viewlet.focusSelector', editorUid, '[name="editor"]');
|
|
2918
|
+
return state;
|
|
2919
|
+
};
|
|
2920
|
+
|
|
2890
2921
|
const requestIdState = {
|
|
2891
2922
|
counter: 0
|
|
2892
2923
|
};
|
|
@@ -3402,27 +3433,6 @@ const getActiveGroup = (groups, activeGroupId) => {
|
|
|
3402
3433
|
const Left$1 = 'left';
|
|
3403
3434
|
const Right$1 = 'right';
|
|
3404
3435
|
|
|
3405
|
-
const getActiveTab = state => {
|
|
3406
|
-
const {
|
|
3407
|
-
layout
|
|
3408
|
-
} = state;
|
|
3409
|
-
const {
|
|
3410
|
-
groups
|
|
3411
|
-
} = layout;
|
|
3412
|
-
const activeGroup = groups.find(group => group.focused);
|
|
3413
|
-
if (!activeGroup || !activeGroup.activeTabId) {
|
|
3414
|
-
return undefined;
|
|
3415
|
-
}
|
|
3416
|
-
const activeTab = activeGroup.tabs.find(tab => tab.id === activeGroup.activeTabId);
|
|
3417
|
-
if (!activeTab) {
|
|
3418
|
-
return undefined;
|
|
3419
|
-
}
|
|
3420
|
-
return {
|
|
3421
|
-
groupId: activeGroup.id,
|
|
3422
|
-
tab: activeTab
|
|
3423
|
-
};
|
|
3424
|
-
};
|
|
3425
|
-
|
|
3426
3436
|
const handleClickTogglePreview = async state => {
|
|
3427
3437
|
const activeTabInfo = getActiveTab(state);
|
|
3428
3438
|
if (!activeTabInfo || !activeTabInfo.tab.uri) {
|
|
@@ -7084,8 +7094,10 @@ const renderEditorGroup = (group, groupIndex, splitButtonEnabled = false, sizePr
|
|
|
7084
7094
|
}, ...renderEditorGroupHeader(group, groupIndex, splitButtonEnabled), editorContainerNode, ...renderEditor(activeTab)];
|
|
7085
7095
|
};
|
|
7086
7096
|
|
|
7097
|
+
const classVertical = 'Sash SashVertical';
|
|
7098
|
+
const classHorizontal = 'Sash SashHorizontal';
|
|
7087
7099
|
const getSashClassName = direction => {
|
|
7088
|
-
return direction === Horizontal ?
|
|
7100
|
+
return direction === Horizontal ? classVertical : classHorizontal;
|
|
7089
7101
|
};
|
|
7090
7102
|
|
|
7091
7103
|
const getSashBorderClassName = direction => {
|
|
@@ -8002,6 +8014,7 @@ const commandMap = {
|
|
|
8002
8014
|
'Main.closeTabsRight': wrapSerialCommand(closeTabsRight),
|
|
8003
8015
|
'Main.copyPath': wrapSerialCommand(copyPath$1),
|
|
8004
8016
|
'Main.copyRelativePath': wrapSerialCommand(copyRelativePath$1),
|
|
8017
|
+
'Main.focus': wrapSerialCommand(focus),
|
|
8005
8018
|
'Main.focusNext': wrapSerialCommand(focusNextTab),
|
|
8006
8019
|
'Main.focusNextTab': wrapSerialCommand(focusNextTab),
|
|
8007
8020
|
'Main.focusPrevious': wrapSerialCommand(focusPreviousTab),
|