@lvce-editor/main-area-worker 9.71.2 → 9.71.3
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 +16 -2
- package/package.json +1 -1
|
@@ -3992,6 +3992,7 @@ const HandleTabsWheel = 30;
|
|
|
3992
3992
|
const HandleTabDragOver = 31;
|
|
3993
3993
|
const HandleTabsDragOver = 32;
|
|
3994
3994
|
const HandleFocus = 33;
|
|
3995
|
+
const HandleGroupMouseDown = 34;
|
|
3995
3996
|
|
|
3996
3997
|
const dragOverlayVirtualDom = {
|
|
3997
3998
|
childCount: 0,
|
|
@@ -4668,6 +4669,7 @@ const renderEditorGroup = (group, groupIndex, splitButtonEnabled = false, closeB
|
|
|
4668
4669
|
childCount: 2,
|
|
4669
4670
|
className: mergeClassNames(EditorGroup, getEditorGroupClassName(group.id)),
|
|
4670
4671
|
'data-groupId': String(group.id),
|
|
4672
|
+
onMouseDown: HandleGroupMouseDown,
|
|
4671
4673
|
type: Div
|
|
4672
4674
|
}, ...renderEditorGroupHeader(group, groupIndex, splitButtonEnabled, tabDropIndicator), editorContainerNode, ...renderEditor(activeTab)];
|
|
4673
4675
|
};
|
|
@@ -4905,14 +4907,22 @@ const parseRawGroupId = rawGroupId => {
|
|
|
4905
4907
|
return Number.isNaN(groupId) ? undefined : groupId;
|
|
4906
4908
|
};
|
|
4907
4909
|
|
|
4908
|
-
const handleClick =
|
|
4910
|
+
const handleClick = (state, name) => {
|
|
4909
4911
|
const groupId = parseRawGroupId(name);
|
|
4910
4912
|
if (groupId === undefined) {
|
|
4911
4913
|
return state;
|
|
4912
4914
|
}
|
|
4913
4915
|
const hasGroup = state.layout.groups.some(group => group.id === groupId);
|
|
4916
|
+
// Empty-group focus must publish a fresh layout even when this group is already active.
|
|
4914
4917
|
return hasGroup ? focusEditorGroup(state, groupId) : state;
|
|
4915
4918
|
};
|
|
4919
|
+
const handleGroupMouseDown = async (context, name) => {
|
|
4920
|
+
const groupId = parseRawGroupId(name);
|
|
4921
|
+
await context.updateState(state => state.layout.activeGroupId === groupId ? state : handleClick(state, name));
|
|
4922
|
+
};
|
|
4923
|
+
const handleClickWithContext = async (context, name) => {
|
|
4924
|
+
await context.updateState(state => handleClick(state, name));
|
|
4925
|
+
};
|
|
4916
4926
|
|
|
4917
4927
|
const getActiveGroup = (groups, activeGroupId) => {
|
|
4918
4928
|
return groups.find(g => g.id === activeGroupId);
|
|
@@ -8827,6 +8837,9 @@ const renderEventListeners = () => {
|
|
|
8827
8837
|
}, {
|
|
8828
8838
|
name: HandleFocus,
|
|
8829
8839
|
params: ['handleClick', 'event.target.dataset.groupId']
|
|
8840
|
+
}, {
|
|
8841
|
+
name: HandleGroupMouseDown,
|
|
8842
|
+
params: ['handleGroupMouseDown', 'event.currentTarget.dataset.groupId']
|
|
8830
8843
|
}, {
|
|
8831
8844
|
name: HandleClickClose,
|
|
8832
8845
|
params: ['handleClickCloseTab', 'event.currentTarget.dataset.groupIndex', 'event.currentTarget.dataset.index'],
|
|
@@ -9488,7 +9501,7 @@ const commandMap = {
|
|
|
9488
9501
|
'MainArea.getComponentState': getComponentState,
|
|
9489
9502
|
'MainArea.getMenuEntries': wrapGetter(getMenuEntries),
|
|
9490
9503
|
'MainArea.getMenuIds': getMenuIds,
|
|
9491
|
-
'MainArea.handleClick':
|
|
9504
|
+
'MainArea.handleClick': wrapSerialAsyncCommand(handleClickWithContext),
|
|
9492
9505
|
'MainArea.handleClickAction': wrapSerialCommand(handleClickAction),
|
|
9493
9506
|
'MainArea.handleClickCloseTab': wrapSerialCommand(handleClickCloseTab),
|
|
9494
9507
|
'MainArea.handleClickTab': wrapSerialCommand(handleClickTab),
|
|
@@ -9500,6 +9513,7 @@ const commandMap = {
|
|
|
9500
9513
|
'MainArea.handleDragOver': wrapSerialCommand(handleDragOver),
|
|
9501
9514
|
'MainArea.handleDragStart': wrapSerialCommand(handleDragStart),
|
|
9502
9515
|
'MainArea.handleDrop': wrapSerialAsyncCommand(handleDrop),
|
|
9516
|
+
'MainArea.handleGroupMouseDown': wrapSerialAsyncCommand(handleGroupMouseDown),
|
|
9503
9517
|
'MainArea.handleHeaderDoubleClick': wrapSerialCommand(handleHeaderDoubleClick),
|
|
9504
9518
|
'MainArea.handleIconThemeChange': wrapSerialCommand(handleIconThemeChange),
|
|
9505
9519
|
'MainArea.handleMessagePort': handleDirectMessagePort,
|