@lvce-editor/main-area-worker 9.33.1 → 9.33.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.
- package/dist/mainAreaWorkerMain.js +134 -87
- package/package.json +1 -1
|
@@ -2326,7 +2326,10 @@ const findTabInState = (state, groupId, tabId) => {
|
|
|
2326
2326
|
const {
|
|
2327
2327
|
layout
|
|
2328
2328
|
} = state;
|
|
2329
|
-
const
|
|
2329
|
+
const {
|
|
2330
|
+
groups
|
|
2331
|
+
} = layout;
|
|
2332
|
+
const group = groups.find(g => g.id === groupId);
|
|
2330
2333
|
return group?.tabs.find(t => t.id === tabId);
|
|
2331
2334
|
};
|
|
2332
2335
|
|
|
@@ -2334,6 +2337,9 @@ const closeTabWithViewlet = async (state, groupId, tabId) => {
|
|
|
2334
2337
|
const {
|
|
2335
2338
|
layout
|
|
2336
2339
|
} = state;
|
|
2340
|
+
const {
|
|
2341
|
+
groups
|
|
2342
|
+
} = layout;
|
|
2337
2343
|
const tab = findTabInState(state, groupId, tabId);
|
|
2338
2344
|
const commands = [];
|
|
2339
2345
|
if (tab && tab.editorUid !== -1) {
|
|
@@ -2343,7 +2349,7 @@ const closeTabWithViewlet = async (state, groupId, tabId) => {
|
|
|
2343
2349
|
commands.push(...disposeCommands);
|
|
2344
2350
|
}
|
|
2345
2351
|
const newState = closeTab(state, groupId, tabId);
|
|
2346
|
-
const group =
|
|
2352
|
+
const group = groups.find(g => g.id === groupId);
|
|
2347
2353
|
const wasActiveTab = group?.activeTabId === tabId;
|
|
2348
2354
|
const newGroup = wasActiveTab ? newState.layout.groups.find(candidate => candidate.id === groupId) : undefined;
|
|
2349
2355
|
const newActiveTabId = newGroup?.activeTabId;
|
|
@@ -2467,9 +2473,12 @@ const closeAll$1 = async state => {
|
|
|
2467
2473
|
const {
|
|
2468
2474
|
layout
|
|
2469
2475
|
} = state;
|
|
2470
|
-
const
|
|
2476
|
+
const {
|
|
2477
|
+
groups
|
|
2478
|
+
} = layout;
|
|
2479
|
+
const editorUids = groups.flatMap(group => group.tabs.map(tab => tab.editorUid)).filter(editorUid => editorUid !== -1);
|
|
2471
2480
|
await disposeEditors(editorUids);
|
|
2472
|
-
const entries =
|
|
2481
|
+
const entries = groups.flatMap((group, groupIndex) => {
|
|
2473
2482
|
return group.tabs.map((tab, tabIndex) => ({
|
|
2474
2483
|
group,
|
|
2475
2484
|
groupIndex,
|
|
@@ -2635,7 +2644,10 @@ const closeFirstTabByUri = (state, uri) => {
|
|
|
2635
2644
|
const {
|
|
2636
2645
|
layout
|
|
2637
2646
|
} = state;
|
|
2638
|
-
const
|
|
2647
|
+
const {
|
|
2648
|
+
groups
|
|
2649
|
+
} = layout;
|
|
2650
|
+
const matchingGroup = groups.find(group => {
|
|
2639
2651
|
return group.tabs.some(tab => tab.uri === uri);
|
|
2640
2652
|
});
|
|
2641
2653
|
const matchingTab = matchingGroup?.tabs.find(tab => tab.uri === uri);
|
|
@@ -2660,7 +2672,10 @@ const getGroupById = (state, groupId) => {
|
|
|
2660
2672
|
const {
|
|
2661
2673
|
layout
|
|
2662
2674
|
} = state;
|
|
2663
|
-
|
|
2675
|
+
const {
|
|
2676
|
+
groups
|
|
2677
|
+
} = layout;
|
|
2678
|
+
return groups.find(group => group.id === groupId);
|
|
2664
2679
|
};
|
|
2665
2680
|
|
|
2666
2681
|
const closeTabsRight = (state, groupId) => {
|
|
@@ -3045,7 +3060,10 @@ const getSelectedTabData = (state, groupIndex, index) => {
|
|
|
3045
3060
|
const {
|
|
3046
3061
|
layout
|
|
3047
3062
|
} = state;
|
|
3048
|
-
const
|
|
3063
|
+
const {
|
|
3064
|
+
groups
|
|
3065
|
+
} = layout;
|
|
3066
|
+
const group = groups[groupIndex];
|
|
3049
3067
|
if (!group || index < 0 || index >= group.tabs.length) {
|
|
3050
3068
|
return undefined;
|
|
3051
3069
|
}
|
|
@@ -3226,6 +3244,7 @@ const selectTab = async (state, groupIndex, index) => {
|
|
|
3226
3244
|
uid
|
|
3227
3245
|
} = state;
|
|
3228
3246
|
const {
|
|
3247
|
+
activeGroupId,
|
|
3229
3248
|
groups
|
|
3230
3249
|
} = layout;
|
|
3231
3250
|
if (groupIndex < 0 || groupIndex >= groups.length) {
|
|
@@ -3242,7 +3261,7 @@ const selectTab = async (state, groupIndex, index) => {
|
|
|
3242
3261
|
tabId
|
|
3243
3262
|
} = selectedTabData;
|
|
3244
3263
|
const normalizedTab = normalizeTabEditorInput(tab);
|
|
3245
|
-
const isAlreadyActive =
|
|
3264
|
+
const isAlreadyActive = activeGroupId === groupId && group.activeTabId === tabId;
|
|
3246
3265
|
if (isAlreadyActive && !shouldLoadContentForTab(normalizedTab)) {
|
|
3247
3266
|
return state;
|
|
3248
3267
|
}
|
|
@@ -3458,6 +3477,9 @@ const restoreExistingUri = (state, entry) => {
|
|
|
3458
3477
|
const {
|
|
3459
3478
|
layout
|
|
3460
3479
|
} = state;
|
|
3480
|
+
const {
|
|
3481
|
+
groups: layoutGroups
|
|
3482
|
+
} = layout;
|
|
3461
3483
|
if (!entry.tab.uri) {
|
|
3462
3484
|
return undefined;
|
|
3463
3485
|
}
|
|
@@ -3465,11 +3487,11 @@ const restoreExistingUri = (state, entry) => {
|
|
|
3465
3487
|
if (!existing) {
|
|
3466
3488
|
return undefined;
|
|
3467
3489
|
}
|
|
3468
|
-
const groupIndex =
|
|
3490
|
+
const groupIndex = layoutGroups.findIndex(group => group.id === existing.groupId);
|
|
3469
3491
|
if (groupIndex === -1) {
|
|
3470
3492
|
return undefined;
|
|
3471
3493
|
}
|
|
3472
|
-
const tabIndex =
|
|
3494
|
+
const tabIndex = layoutGroups[groupIndex].tabs.findIndex(tab => tab.id === existing.tab.id);
|
|
3473
3495
|
if (tabIndex === -1) {
|
|
3474
3496
|
return undefined;
|
|
3475
3497
|
}
|
|
@@ -3637,7 +3659,10 @@ const getTabCount = state => {
|
|
|
3637
3659
|
const {
|
|
3638
3660
|
layout
|
|
3639
3661
|
} = state;
|
|
3640
|
-
|
|
3662
|
+
const {
|
|
3663
|
+
groups
|
|
3664
|
+
} = layout;
|
|
3665
|
+
return groups.reduce((sum, group) => sum + group.tabs.length, 0);
|
|
3641
3666
|
};
|
|
3642
3667
|
|
|
3643
3668
|
const getCurrentState = state => {
|
|
@@ -3754,12 +3779,15 @@ const updateTabUriTitles = state => {
|
|
|
3754
3779
|
homeDirUri: rawHomeDirUri,
|
|
3755
3780
|
layout
|
|
3756
3781
|
} = state;
|
|
3782
|
+
const {
|
|
3783
|
+
groups
|
|
3784
|
+
} = layout;
|
|
3757
3785
|
const homeDirUri = rawHomeDirUri || '';
|
|
3758
3786
|
return {
|
|
3759
3787
|
...state,
|
|
3760
3788
|
layout: {
|
|
3761
3789
|
...layout,
|
|
3762
|
-
groups:
|
|
3790
|
+
groups: groups.map(group => ({
|
|
3763
3791
|
...group,
|
|
3764
3792
|
tabs: group.tabs.map(tab => updateTabUriTitle(tab, homeDirUri))
|
|
3765
3793
|
}))
|
|
@@ -4143,7 +4171,11 @@ const getActivePreviewEditorUid = state => {
|
|
|
4143
4171
|
const {
|
|
4144
4172
|
layout
|
|
4145
4173
|
} = state;
|
|
4146
|
-
const
|
|
4174
|
+
const {
|
|
4175
|
+
activeGroupId,
|
|
4176
|
+
groups
|
|
4177
|
+
} = layout;
|
|
4178
|
+
const activeGroup = activeGroupId === undefined ? groups.find(group => group.focused) : groups.find(group => group.id === activeGroupId);
|
|
4147
4179
|
const activeTab = activeGroup?.tabs.find(tab => tab.id === activeGroup.activeTabId);
|
|
4148
4180
|
return activeTab?.isPreview ? activeTab.editorUid : -1;
|
|
4149
4181
|
};
|
|
@@ -4359,11 +4391,14 @@ const createNextState = (state, activeGroupId, groups) => {
|
|
|
4359
4391
|
const {
|
|
4360
4392
|
layout
|
|
4361
4393
|
} = state;
|
|
4394
|
+
const {
|
|
4395
|
+
direction
|
|
4396
|
+
} = layout;
|
|
4362
4397
|
return {
|
|
4363
4398
|
...state,
|
|
4364
4399
|
layout: {
|
|
4365
4400
|
activeGroupId,
|
|
4366
|
-
direction
|
|
4401
|
+
direction,
|
|
4367
4402
|
groups
|
|
4368
4403
|
}
|
|
4369
4404
|
};
|
|
@@ -4466,6 +4501,7 @@ const splitEditorGroup$1 = (state, groupId, direction) => {
|
|
|
4466
4501
|
layout
|
|
4467
4502
|
} = state;
|
|
4468
4503
|
const {
|
|
4504
|
+
direction: layoutDirection,
|
|
4469
4505
|
groups
|
|
4470
4506
|
} = layout;
|
|
4471
4507
|
const sourceGroup = groups.find(group => group.id === groupId);
|
|
@@ -4488,12 +4524,12 @@ const splitEditorGroup$1 = (state, groupId, direction) => {
|
|
|
4488
4524
|
if (sourceGroup.direction === splitLayoutDirection) {
|
|
4489
4525
|
return splitWithinMatchingNestedDirection(state, groups, sourceGroup, groupId, newGroupId, direction, splitLayoutDirection, baseNewGroup);
|
|
4490
4526
|
}
|
|
4491
|
-
if (splitLayoutDirection !==
|
|
4527
|
+
if (splitLayoutDirection !== layoutDirection && sourceGroup.direction === undefined) {
|
|
4492
4528
|
return splitStandaloneSourceIntoNestedDirection(state, groups, sourceGroup, groupId, newGroupId, direction, splitLayoutDirection, baseNewGroup);
|
|
4493
4529
|
}
|
|
4494
|
-
const segments = getGroupSegments(groups,
|
|
4530
|
+
const segments = getGroupSegments(groups, layoutDirection);
|
|
4495
4531
|
const hasNestedSegments = segments.some(segment => segment.direction !== undefined);
|
|
4496
|
-
if (splitLayoutDirection ===
|
|
4532
|
+
if (splitLayoutDirection === layoutDirection && !hasNestedSegments) {
|
|
4497
4533
|
return splitAtRootLevel(state, groups, groupId, newGroupId, direction, baseNewGroup);
|
|
4498
4534
|
}
|
|
4499
4535
|
return createNextState(state, newGroupId, groups);
|
|
@@ -4608,12 +4644,15 @@ const handleDoubleClick = (state, groupIndexRaw, indexRaw) => {
|
|
|
4608
4644
|
const {
|
|
4609
4645
|
layout
|
|
4610
4646
|
} = state;
|
|
4647
|
+
const {
|
|
4648
|
+
groups
|
|
4649
|
+
} = layout;
|
|
4611
4650
|
if (!groupIndexRaw || !indexRaw) {
|
|
4612
4651
|
return state;
|
|
4613
4652
|
}
|
|
4614
4653
|
const groupIndex = Number.parseInt(groupIndexRaw);
|
|
4615
4654
|
const tabIndex = Number.parseInt(indexRaw);
|
|
4616
|
-
const tab =
|
|
4655
|
+
const tab = groups[groupIndex]?.tabs[tabIndex];
|
|
4617
4656
|
if (!tab?.isPreview) {
|
|
4618
4657
|
return state;
|
|
4619
4658
|
}
|
|
@@ -4710,7 +4749,10 @@ const getDragOverlay = (state, eventX, eventY) => {
|
|
|
4710
4749
|
x,
|
|
4711
4750
|
y
|
|
4712
4751
|
} = state;
|
|
4713
|
-
const
|
|
4752
|
+
const {
|
|
4753
|
+
groups
|
|
4754
|
+
} = layout;
|
|
4755
|
+
const hasOpenEditor = groups.some(group => !group.isEmpty);
|
|
4714
4756
|
const contentY = hasOpenEditor ? tabHeight : 0;
|
|
4715
4757
|
const contentHeight = Math.max(0, height - contentY);
|
|
4716
4758
|
const relativeX = eventX - x;
|
|
@@ -4920,8 +4962,11 @@ const handleHeaderDoubleClick = async (state, className, groupIndexRaw) => {
|
|
|
4920
4962
|
};
|
|
4921
4963
|
|
|
4922
4964
|
const getAllTabs = layout => {
|
|
4965
|
+
const {
|
|
4966
|
+
groups
|
|
4967
|
+
} = layout;
|
|
4923
4968
|
const allTabs = [];
|
|
4924
|
-
for (const group of
|
|
4969
|
+
for (const group of groups) {
|
|
4925
4970
|
allTabs.push(...group.tabs);
|
|
4926
4971
|
}
|
|
4927
4972
|
return allTabs;
|
|
@@ -4932,6 +4977,9 @@ const loadFileIcons = async state => {
|
|
|
4932
4977
|
fileIconCache,
|
|
4933
4978
|
layout
|
|
4934
4979
|
} = state;
|
|
4980
|
+
const {
|
|
4981
|
+
groups
|
|
4982
|
+
} = layout;
|
|
4935
4983
|
try {
|
|
4936
4984
|
const allTabs = getAllTabs(layout);
|
|
4937
4985
|
const {
|
|
@@ -4941,7 +4989,7 @@ const loadFileIcons = async state => {
|
|
|
4941
4989
|
// Update tabs with their icons
|
|
4942
4990
|
const updatedLayout = {
|
|
4943
4991
|
...layout,
|
|
4944
|
-
groups:
|
|
4992
|
+
groups: groups.map(group => ({
|
|
4945
4993
|
...group,
|
|
4946
4994
|
tabs: group.tabs.map(tab => ({
|
|
4947
4995
|
...tab,
|
|
@@ -5054,7 +5102,11 @@ const offsetsMatch = (first, second) => {
|
|
|
5054
5102
|
return Math.abs(first - second) < 1e-6;
|
|
5055
5103
|
};
|
|
5056
5104
|
const getSashCorner = layout => {
|
|
5057
|
-
const
|
|
5105
|
+
const {
|
|
5106
|
+
direction,
|
|
5107
|
+
groups
|
|
5108
|
+
} = layout;
|
|
5109
|
+
const segments = getGroupSegments(groups, direction);
|
|
5058
5110
|
if (segments.length !== 2) {
|
|
5059
5111
|
return undefined;
|
|
5060
5112
|
}
|
|
@@ -5074,7 +5126,7 @@ const getSashCorner = layout => {
|
|
|
5074
5126
|
return undefined;
|
|
5075
5127
|
}
|
|
5076
5128
|
const rootOffset = firstSegmentSize / totalSize * 100;
|
|
5077
|
-
if (
|
|
5129
|
+
if (direction === Horizontal) {
|
|
5078
5130
|
return {
|
|
5079
5131
|
leftOffset: rootOffset,
|
|
5080
5132
|
topOffset: firstNestedOffset,
|
|
@@ -5098,6 +5150,9 @@ const handleSashCornerPointerDown = async (state, clientX, clientY) => {
|
|
|
5098
5150
|
const {
|
|
5099
5151
|
layout
|
|
5100
5152
|
} = state;
|
|
5153
|
+
const {
|
|
5154
|
+
groups
|
|
5155
|
+
} = layout;
|
|
5101
5156
|
if (!Number.isFinite(clientX) || !Number.isFinite(clientY)) {
|
|
5102
5157
|
return state;
|
|
5103
5158
|
}
|
|
@@ -5108,7 +5163,7 @@ const handleSashCornerPointerDown = async (state, clientX, clientY) => {
|
|
|
5108
5163
|
return {
|
|
5109
5164
|
...state,
|
|
5110
5165
|
sashCornerDrag: {
|
|
5111
|
-
groupSizes:
|
|
5166
|
+
groupSizes: groups.map(group => ({
|
|
5112
5167
|
id: group.id,
|
|
5113
5168
|
size: group.size
|
|
5114
5169
|
})),
|
|
@@ -5157,6 +5212,9 @@ const handleSashCornerPointerMove = async (state, clientX, clientY) => {
|
|
|
5157
5212
|
sashCornerDrag,
|
|
5158
5213
|
width
|
|
5159
5214
|
} = state;
|
|
5215
|
+
const {
|
|
5216
|
+
groups
|
|
5217
|
+
} = layout;
|
|
5160
5218
|
if (!sashCornerDrag || !width || !height || !Number.isFinite(clientX) || !Number.isFinite(clientY)) {
|
|
5161
5219
|
return state;
|
|
5162
5220
|
}
|
|
@@ -5183,7 +5241,7 @@ const handleSashCornerPointerMove = async (state, clientX, clientY) => {
|
|
|
5183
5241
|
...state,
|
|
5184
5242
|
layout: {
|
|
5185
5243
|
...layout,
|
|
5186
|
-
groups:
|
|
5244
|
+
groups: groups.map(group => {
|
|
5187
5245
|
const xSize = xBeforeGroupIdSet.has(group.id) ? xBeforeSize : xAfterSize;
|
|
5188
5246
|
const ySize = yBeforeGroupIdSet.has(group.id) ? yBeforeSize : yAfterSize;
|
|
5189
5247
|
return {
|
|
@@ -5513,9 +5571,12 @@ const tryRestoreLayout = savedState => {
|
|
|
5513
5571
|
};
|
|
5514
5572
|
|
|
5515
5573
|
const createViewlets = async (layout, viewletModuleIds, bounds) => {
|
|
5574
|
+
const {
|
|
5575
|
+
groups
|
|
5576
|
+
} = layout;
|
|
5516
5577
|
const editorUids = {};
|
|
5517
5578
|
const titles = {};
|
|
5518
|
-
for (const group of
|
|
5579
|
+
for (const group of groups) {
|
|
5519
5580
|
const activeTab = group.tabs.find(tab => tab.id === group.activeTabId);
|
|
5520
5581
|
if (activeTab && viewletModuleIds[activeTab.id]) {
|
|
5521
5582
|
const editorUid = activeTab.editorUid === -1 ? create$2() : activeTab.editorUid;
|
|
@@ -5533,8 +5594,11 @@ const createViewlets = async (layout, viewletModuleIds, bounds) => {
|
|
|
5533
5594
|
};
|
|
5534
5595
|
|
|
5535
5596
|
const getViewletModuleIds = async layout => {
|
|
5597
|
+
const {
|
|
5598
|
+
groups
|
|
5599
|
+
} = layout;
|
|
5536
5600
|
const viewletModuleIds = {};
|
|
5537
|
-
for (const group of
|
|
5601
|
+
for (const group of groups) {
|
|
5538
5602
|
const {
|
|
5539
5603
|
tabs
|
|
5540
5604
|
} = group;
|
|
@@ -6129,8 +6193,12 @@ const getDragOverlayCss = dragOverlay => {
|
|
|
6129
6193
|
};
|
|
6130
6194
|
|
|
6131
6195
|
const getEditorGroupCss = layout => {
|
|
6132
|
-
const
|
|
6133
|
-
|
|
6196
|
+
const {
|
|
6197
|
+
direction,
|
|
6198
|
+
groups
|
|
6199
|
+
} = layout;
|
|
6200
|
+
const groupSizeVariable = direction === Vertical ? '--EditorGroupHeight' : '--EditorGroupWidth';
|
|
6201
|
+
return groups.map(group => {
|
|
6134
6202
|
return `.EditorGroup[data-groupId="${group.id}"] {
|
|
6135
6203
|
${groupSizeVariable}: ${group.size}%;
|
|
6136
6204
|
}`;
|
|
@@ -6173,7 +6241,11 @@ const renderSashCss = ({
|
|
|
6173
6241
|
}`;
|
|
6174
6242
|
};
|
|
6175
6243
|
const getProtoSashCss = (layout, width) => {
|
|
6176
|
-
const
|
|
6244
|
+
const {
|
|
6245
|
+
direction,
|
|
6246
|
+
groups
|
|
6247
|
+
} = layout;
|
|
6248
|
+
const segments = getGroupSegments(groups, direction);
|
|
6177
6249
|
const hasNestedSegments = segments.some(segment => segment.direction !== undefined);
|
|
6178
6250
|
const rules = [];
|
|
6179
6251
|
let segmentOffset = 0;
|
|
@@ -6182,9 +6254,9 @@ const getProtoSashCss = (layout, width) => {
|
|
|
6182
6254
|
const beforeGroupId = segments[i - 1].groups.at(-1)?.id || 0;
|
|
6183
6255
|
const afterGroupId = segments[i].groups[0].id;
|
|
6184
6256
|
const sashId = create(beforeGroupId, afterGroupId);
|
|
6185
|
-
const value = hasNestedSegments ||
|
|
6257
|
+
const value = hasNestedSegments || direction !== Horizontal || !width ? `${segmentOffset}%` : getSashOffset(layout, i, width);
|
|
6186
6258
|
rules.push({
|
|
6187
|
-
property: toSashProperty(
|
|
6259
|
+
property: toSashProperty(direction),
|
|
6188
6260
|
sashId,
|
|
6189
6261
|
value
|
|
6190
6262
|
});
|
|
@@ -6211,58 +6283,17 @@ const getProtoSashCss = (layout, width) => {
|
|
|
6211
6283
|
return rules;
|
|
6212
6284
|
};
|
|
6213
6285
|
const getSashCss = (layout, width = 0) => {
|
|
6214
|
-
|
|
6286
|
+
const {
|
|
6287
|
+
groups
|
|
6288
|
+
} = layout;
|
|
6289
|
+
if (groups.length <= 1) {
|
|
6215
6290
|
return [];
|
|
6216
6291
|
}
|
|
6217
6292
|
return getProtoSashCss(layout, width).map(renderSashCss);
|
|
6218
6293
|
};
|
|
6219
6294
|
|
|
6220
6295
|
const getCss = (layout, width = 0, dragOverlay) => {
|
|
6221
|
-
const rules = [
|
|
6222
|
-
position: relative;
|
|
6223
|
-
}`, `.editor-groups-container {
|
|
6224
|
-
overflow: auto;
|
|
6225
|
-
}`, `.DragOverlay {
|
|
6226
|
-
position: absolute;
|
|
6227
|
-
z-index: 1;
|
|
6228
|
-
contain: strict;
|
|
6229
|
-
pointer-events: none;
|
|
6230
|
-
background: rgba(83, 89, 93, 0.5);
|
|
6231
|
-
transition: all 100ms;
|
|
6232
|
-
}`, `.SashBorder {
|
|
6233
|
-
background: var(--SashBorder, gray);
|
|
6234
|
-
}`, `.SashBorderHorizontal {
|
|
6235
|
-
width: 100%;
|
|
6236
|
-
height: 1px;
|
|
6237
|
-
}`, `.SashBorderVertical {
|
|
6238
|
-
width: 1px;
|
|
6239
|
-
height: 100%;
|
|
6240
|
-
}`, `.SashCorner {
|
|
6241
|
-
position: absolute;
|
|
6242
|
-
z-index: 2;
|
|
6243
|
-
display: flex;
|
|
6244
|
-
align-items: center;
|
|
6245
|
-
justify-content: center;
|
|
6246
|
-
width: 12px;
|
|
6247
|
-
height: 12px;
|
|
6248
|
-
padding: 0;
|
|
6249
|
-
border: 0;
|
|
6250
|
-
background: transparent;
|
|
6251
|
-
cursor: all-scroll;
|
|
6252
|
-
transform: translate(-50%, -50%);
|
|
6253
|
-
}`, `.SashCorner::after {
|
|
6254
|
-
content: '';
|
|
6255
|
-
width: 4px;
|
|
6256
|
-
height: 4px;
|
|
6257
|
-
background: var(--SashBorder, gray);
|
|
6258
|
-
}`, `.SashCorner:hover::after,
|
|
6259
|
-
.SashCorner:active::after {
|
|
6260
|
-
background: var(--SashHoverBorder, #3d5252);
|
|
6261
|
-
}`, `.EditorGroup {
|
|
6262
|
-
min-width: 250px;
|
|
6263
|
-
width: var(--EditorGroupWidth, auto);
|
|
6264
|
-
/*height: var(--EditorGroupHeight, auto);*/
|
|
6265
|
-
}`];
|
|
6296
|
+
const rules = [];
|
|
6266
6297
|
if (layout) {
|
|
6267
6298
|
rules.push(...getEditorGroupCss(layout), ...getDragOverlayCss(dragOverlay), ...getSashCss(layout, width));
|
|
6268
6299
|
const sashCorner = getSashCorner(layout);
|
|
@@ -6966,7 +6997,10 @@ const mainNode$1 = {
|
|
|
6966
6997
|
type: Div
|
|
6967
6998
|
};
|
|
6968
6999
|
const renderSingleEditorGroup = (layout, splitButtonEnabled, sizeProperty = 'width') => {
|
|
6969
|
-
|
|
7000
|
+
const {
|
|
7001
|
+
groups
|
|
7002
|
+
} = layout;
|
|
7003
|
+
return [mainNode$1, ...renderEditorGroup(groups[0], 0, splitButtonEnabled, sizeProperty, false)];
|
|
6970
7004
|
};
|
|
6971
7005
|
|
|
6972
7006
|
const getDirectionClassName = (direction, isSplit) => {
|
|
@@ -7416,7 +7450,10 @@ const saveState = state => {
|
|
|
7416
7450
|
const {
|
|
7417
7451
|
layout
|
|
7418
7452
|
} = state;
|
|
7419
|
-
const
|
|
7453
|
+
const {
|
|
7454
|
+
groups
|
|
7455
|
+
} = layout;
|
|
7456
|
+
const filteredGroups = getFilteredGroups(groups);
|
|
7420
7457
|
|
|
7421
7458
|
// Update activeGroupId if it points to a removed group
|
|
7422
7459
|
const {
|
|
@@ -7494,9 +7531,13 @@ const setEditorLayout = (state, direction, slots) => {
|
|
|
7494
7531
|
const {
|
|
7495
7532
|
layout
|
|
7496
7533
|
} = state;
|
|
7497
|
-
const
|
|
7498
|
-
|
|
7499
|
-
|
|
7534
|
+
const {
|
|
7535
|
+
activeGroupId,
|
|
7536
|
+
groups: currentGroups
|
|
7537
|
+
} = layout;
|
|
7538
|
+
const groups = getGroupsForSlotCount(currentGroups, slots.length, activeGroupId);
|
|
7539
|
+
const originalActiveIndex = currentGroups.findIndex(group => group.id === activeGroupId);
|
|
7540
|
+
const activeIndex = originalActiveIndex >= slots.length ? slots.length - 1 : getActiveGroupIndex(groups, activeGroupId);
|
|
7500
7541
|
const nextGroups = groups.map((group, index) => {
|
|
7501
7542
|
const slot = slots[index];
|
|
7502
7543
|
const focused = index === activeIndex;
|
|
@@ -7521,12 +7562,16 @@ const flipLayout = state => {
|
|
|
7521
7562
|
const {
|
|
7522
7563
|
layout
|
|
7523
7564
|
} = state;
|
|
7565
|
+
const {
|
|
7566
|
+
direction,
|
|
7567
|
+
groups
|
|
7568
|
+
} = layout;
|
|
7524
7569
|
return {
|
|
7525
7570
|
...state,
|
|
7526
7571
|
layout: {
|
|
7527
7572
|
...layout,
|
|
7528
|
-
direction: flipDirection(
|
|
7529
|
-
groups:
|
|
7573
|
+
direction: flipDirection(direction),
|
|
7574
|
+
groups: groups.map(group => ({
|
|
7530
7575
|
...group,
|
|
7531
7576
|
direction: group.direction === undefined ? undefined : flipDirection(group.direction)
|
|
7532
7577
|
}))
|
|
@@ -7625,6 +7670,7 @@ const splitDown = (state, groupId) => {
|
|
|
7625
7670
|
layout
|
|
7626
7671
|
} = state;
|
|
7627
7672
|
const {
|
|
7673
|
+
activeGroupId,
|
|
7628
7674
|
groups
|
|
7629
7675
|
} = layout;
|
|
7630
7676
|
|
|
@@ -7649,7 +7695,7 @@ const splitDown = (state, groupId) => {
|
|
|
7649
7695
|
};
|
|
7650
7696
|
return splitEditorGroup$1(stateWithInitialGroup, initialGroupId, 'down');
|
|
7651
7697
|
}
|
|
7652
|
-
const resolvedGroupId = groupId ??
|
|
7698
|
+
const resolvedGroupId = groupId ?? activeGroupId;
|
|
7653
7699
|
if (!resolvedGroupId) {
|
|
7654
7700
|
return state;
|
|
7655
7701
|
}
|
|
@@ -7727,6 +7773,7 @@ const splitUp = (state, groupId) => {
|
|
|
7727
7773
|
layout
|
|
7728
7774
|
} = state;
|
|
7729
7775
|
const {
|
|
7776
|
+
activeGroupId,
|
|
7730
7777
|
groups
|
|
7731
7778
|
} = layout;
|
|
7732
7779
|
if (groups.length === 0) {
|
|
@@ -7749,7 +7796,7 @@ const splitUp = (state, groupId) => {
|
|
|
7749
7796
|
};
|
|
7750
7797
|
return splitEditorGroup$1(stateWithInitialGroup, initialGroupId, 'up');
|
|
7751
7798
|
}
|
|
7752
|
-
const resolvedGroupId = groupId ??
|
|
7799
|
+
const resolvedGroupId = groupId ?? activeGroupId;
|
|
7753
7800
|
if (!resolvedGroupId) {
|
|
7754
7801
|
return state;
|
|
7755
7802
|
}
|