@lvce-editor/main-area-worker 9.21.0 → 9.24.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 +95 -30
- package/package.json +1 -1
|
@@ -2145,6 +2145,7 @@ const create$2 = (uid, uri, x, y, width, height, platform, assetDir, tabHeight =
|
|
|
2145
2145
|
},
|
|
2146
2146
|
maxOpenEditorGroups: Infinity,
|
|
2147
2147
|
maxOpenEditors: Infinity,
|
|
2148
|
+
minGroupHeightPx: 80,
|
|
2148
2149
|
minGroupWidthPx: 250,
|
|
2149
2150
|
platform,
|
|
2150
2151
|
splitButtonEnabled: false,
|
|
@@ -2464,6 +2465,8 @@ const getEditorInputEditorType = editorInput => {
|
|
|
2464
2465
|
case 'diff-editor':
|
|
2465
2466
|
case 'extension-detail-view':
|
|
2466
2467
|
case 'image':
|
|
2468
|
+
case 'process-explorer':
|
|
2469
|
+
case 'running-extensions':
|
|
2467
2470
|
case 'video':
|
|
2468
2471
|
return 'custom';
|
|
2469
2472
|
case 'editor':
|
|
@@ -2481,6 +2484,10 @@ const getEditorInputUri = editorInput => {
|
|
|
2481
2484
|
return editorInput.uri;
|
|
2482
2485
|
case 'extension-detail-view':
|
|
2483
2486
|
return `extension-detail://${editorInput.extensionId}`;
|
|
2487
|
+
case 'process-explorer':
|
|
2488
|
+
return 'process-explorer://';
|
|
2489
|
+
case 'running-extensions':
|
|
2490
|
+
return 'running-extensions://';
|
|
2484
2491
|
}
|
|
2485
2492
|
};
|
|
2486
2493
|
|
|
@@ -2545,6 +2552,16 @@ const getEditorInputFromUri = uri => {
|
|
|
2545
2552
|
};
|
|
2546
2553
|
}
|
|
2547
2554
|
}
|
|
2555
|
+
if (uri.startsWith('process-explorer://')) {
|
|
2556
|
+
return {
|
|
2557
|
+
type: 'process-explorer'
|
|
2558
|
+
};
|
|
2559
|
+
}
|
|
2560
|
+
if (uri.startsWith('running-extensions://')) {
|
|
2561
|
+
return {
|
|
2562
|
+
type: 'running-extensions'
|
|
2563
|
+
};
|
|
2564
|
+
}
|
|
2548
2565
|
const extension = getLowerCaseExtension(uri);
|
|
2549
2566
|
if (imageExtensions.has(extension)) {
|
|
2550
2567
|
return {
|
|
@@ -2714,6 +2731,8 @@ const getViewletModuleId$1 = async uri => {
|
|
|
2714
2731
|
const DiffEditor = 'DiffEditor';
|
|
2715
2732
|
const EditorText = 'Editor';
|
|
2716
2733
|
const ExtensionDetail = 'ExtensionDetail';
|
|
2734
|
+
const ProcessExplorer = 'ProcessExplorer';
|
|
2735
|
+
const RunningExtensions = 'RunningExtensions';
|
|
2717
2736
|
const QuickPick = 'QuickPick';
|
|
2718
2737
|
|
|
2719
2738
|
const getViewletModuleIdForEditorInput = async editorInput => {
|
|
@@ -2726,6 +2745,10 @@ const getViewletModuleIdForEditorInput = async editorInput => {
|
|
|
2726
2745
|
return getViewletModuleId$1(editorInput.uri);
|
|
2727
2746
|
case 'extension-detail-view':
|
|
2728
2747
|
return ExtensionDetail;
|
|
2748
|
+
case 'process-explorer':
|
|
2749
|
+
return ProcessExplorer;
|
|
2750
|
+
case 'running-extensions':
|
|
2751
|
+
return RunningExtensions;
|
|
2729
2752
|
}
|
|
2730
2753
|
};
|
|
2731
2754
|
|
|
@@ -3254,6 +3277,9 @@ const getLabel = uri => {
|
|
|
3254
3277
|
if (uri.startsWith('process-explorer://')) {
|
|
3255
3278
|
return 'Process Explorer';
|
|
3256
3279
|
}
|
|
3280
|
+
if (uri.startsWith('running-extensions://')) {
|
|
3281
|
+
return 'Running Extensions';
|
|
3282
|
+
}
|
|
3257
3283
|
if (uri.startsWith(inlineDiffPrefix)) {
|
|
3258
3284
|
return getInlineDiffLabel(uri);
|
|
3259
3285
|
}
|
|
@@ -3274,6 +3300,10 @@ const getEditorInputTitle = editorInput => {
|
|
|
3274
3300
|
return getLabel(editorInput.uri);
|
|
3275
3301
|
case 'extension-detail-view':
|
|
3276
3302
|
return editorInput.extensionId;
|
|
3303
|
+
case 'process-explorer':
|
|
3304
|
+
return 'Process Explorer';
|
|
3305
|
+
case 'running-extensions':
|
|
3306
|
+
return 'Running Extensions';
|
|
3277
3307
|
}
|
|
3278
3308
|
};
|
|
3279
3309
|
|
|
@@ -3557,8 +3587,8 @@ const getIconsCached = (dirents, fileIconCache) => {
|
|
|
3557
3587
|
return dirents.map(dirent => fileIconCache[dirent]);
|
|
3558
3588
|
};
|
|
3559
3589
|
|
|
3560
|
-
const ExtensionDetailScheme = 'extension-detail://';
|
|
3561
|
-
const
|
|
3590
|
+
const ExtensionDetailScheme$1 = 'extension-detail://';
|
|
3591
|
+
const RunningExtensionsScheme$1 = 'running-extensions://';
|
|
3562
3592
|
const getBasename = uri => {
|
|
3563
3593
|
const lastSlashIndex = uri.lastIndexOf('/');
|
|
3564
3594
|
if (lastSlashIndex === -1) {
|
|
@@ -3569,7 +3599,7 @@ const getBasename = uri => {
|
|
|
3569
3599
|
const getMissingTabs = (tabs, fileIconCache) => {
|
|
3570
3600
|
const missingTabs = [];
|
|
3571
3601
|
for (const tab of tabs) {
|
|
3572
|
-
if (tab.uri && !(tab.uri in fileIconCache)) {
|
|
3602
|
+
if (tab.uri && !tab.uri.startsWith(ExtensionDetailScheme$1) && !tab.uri.startsWith(RunningExtensionsScheme$1) && !(tab.uri in fileIconCache)) {
|
|
3573
3603
|
missingTabs.push(tab);
|
|
3574
3604
|
}
|
|
3575
3605
|
}
|
|
@@ -3577,13 +3607,6 @@ const getMissingTabs = (tabs, fileIconCache) => {
|
|
|
3577
3607
|
};
|
|
3578
3608
|
const tabToIconRequest = tab => {
|
|
3579
3609
|
const uri = tab.uri || '';
|
|
3580
|
-
if (uri.startsWith(ExtensionDetailScheme)) {
|
|
3581
|
-
return {
|
|
3582
|
-
name: ExtensionIconName,
|
|
3583
|
-
path: uri,
|
|
3584
|
-
type: Directory
|
|
3585
|
-
};
|
|
3586
|
-
}
|
|
3587
3610
|
return {
|
|
3588
3611
|
name: getBasename(uri),
|
|
3589
3612
|
path: uri,
|
|
@@ -4123,6 +4146,8 @@ const SplitEditorGroupButton = 'SplitEditorGroupButton';
|
|
|
4123
4146
|
const MaskIconPreview = 'MaskIcon MaskIconPreview';
|
|
4124
4147
|
const MaskIconCircleFilled = 'MaskIcon MaskIconCircleFilled';
|
|
4125
4148
|
const MaskIconClose = 'MaskIcon MaskIconClose';
|
|
4149
|
+
const MaskIconExtensions = 'MaskIcon MaskIconExtensions';
|
|
4150
|
+
const MaskIconRecordKey = 'MaskIcon MaskIconRecordKey';
|
|
4126
4151
|
const TextEditor = 'TextEditor';
|
|
4127
4152
|
const TextEditorLoading = 'TextEditor TextEditor--loading';
|
|
4128
4153
|
const EditorContentLoading = 'EditorContent EditorContent--loading';
|
|
@@ -4439,13 +4464,11 @@ const clamp = (value, min, max) => {
|
|
|
4439
4464
|
return Math.min(max, Math.max(min, value));
|
|
4440
4465
|
};
|
|
4441
4466
|
|
|
4442
|
-
const getMinGroupSizePercent = (axisSize,
|
|
4467
|
+
const getMinGroupSizePercent = (axisSize, minGroupSizePx) => {
|
|
4443
4468
|
if (!axisSize) {
|
|
4444
|
-
return
|
|
4469
|
+
return 0;
|
|
4445
4470
|
}
|
|
4446
|
-
|
|
4447
|
-
// Ensure minimum is at least 10%, matching the CSS 250px constraint on typical widths
|
|
4448
|
-
return Math.max(minPercent, 10);
|
|
4471
|
+
return minGroupSizePx / axisSize * 100;
|
|
4449
4472
|
};
|
|
4450
4473
|
|
|
4451
4474
|
const round = value => {
|
|
@@ -4476,7 +4499,8 @@ const handleSashPointerMove = async (state, clientX, clientY) => {
|
|
|
4476
4499
|
const deltaPx = direction === Horizontal ? clientX - sashDrag.startClientX : clientY - sashDrag.startClientY;
|
|
4477
4500
|
const deltaPercent = deltaPx / axisSize * 100;
|
|
4478
4501
|
const totalResizableSize = sashDrag.beforeSize + sashDrag.afterSize;
|
|
4479
|
-
|
|
4502
|
+
const minGroupSizePx = direction === Horizontal ? state.minGroupWidthPx : state.minGroupHeightPx;
|
|
4503
|
+
let minGroupSize = getMinGroupSizePercent(axisSize, minGroupSizePx);
|
|
4480
4504
|
|
|
4481
4505
|
// If the minimum size makes it impossible to fit two groups, relax the constraint
|
|
4482
4506
|
if (2 * minGroupSize > totalResizableSize) {
|
|
@@ -5781,6 +5805,39 @@ const renderTabActions = (isDirty, tabIndex, groupIndex) => {
|
|
|
5781
5805
|
}];
|
|
5782
5806
|
};
|
|
5783
5807
|
|
|
5808
|
+
const ExtensionDetailScheme = 'extension-detail://';
|
|
5809
|
+
const KeyBindingsUri = 'app://keybindings';
|
|
5810
|
+
const RunningExtensionsScheme = 'running-extensions://';
|
|
5811
|
+
const renderMaskIcon = className => {
|
|
5812
|
+
return [{
|
|
5813
|
+
childCount: 1,
|
|
5814
|
+
className: TabIcon,
|
|
5815
|
+
role: None$1,
|
|
5816
|
+
type: Div
|
|
5817
|
+
}, {
|
|
5818
|
+
childCount: 0,
|
|
5819
|
+
className,
|
|
5820
|
+
type: Div
|
|
5821
|
+
}];
|
|
5822
|
+
};
|
|
5823
|
+
const renderTabIcon = tab => {
|
|
5824
|
+
if (tab.uri === KeyBindingsUri) {
|
|
5825
|
+
return renderMaskIcon(MaskIconRecordKey);
|
|
5826
|
+
}
|
|
5827
|
+
if (tab.uri?.startsWith(ExtensionDetailScheme)) {
|
|
5828
|
+
return renderMaskIcon(MaskIconExtensions);
|
|
5829
|
+
}
|
|
5830
|
+
if (tab.uri?.startsWith(RunningExtensionsScheme)) {
|
|
5831
|
+
return renderMaskIcon(MaskIconExtensions);
|
|
5832
|
+
}
|
|
5833
|
+
return [{
|
|
5834
|
+
childCount: 0,
|
|
5835
|
+
className: TabIcon,
|
|
5836
|
+
role: None$1,
|
|
5837
|
+
src: tab.icon,
|
|
5838
|
+
type: Img
|
|
5839
|
+
}];
|
|
5840
|
+
};
|
|
5784
5841
|
const renderTab = (tab, isActive, tabIndex, groupIndex) => {
|
|
5785
5842
|
const closeButtonNodes = renderTabActions(tab.isDirty, tabIndex, groupIndex);
|
|
5786
5843
|
let className = MainTab;
|
|
@@ -5804,13 +5861,7 @@ const renderTab = (tab, isActive, tabIndex, groupIndex) => {
|
|
|
5804
5861
|
role: 'tab',
|
|
5805
5862
|
title: tab.uriTitle || tab.uri || tab.title,
|
|
5806
5863
|
type: Div
|
|
5807
|
-
}, {
|
|
5808
|
-
childCount: 0,
|
|
5809
|
-
className: TabIcon,
|
|
5810
|
-
role: None$1,
|
|
5811
|
-
src: tab.icon,
|
|
5812
|
-
type: Img
|
|
5813
|
-
}, {
|
|
5864
|
+
}, ...renderTabIcon(tab), {
|
|
5814
5865
|
childCount: 1,
|
|
5815
5866
|
className: TabTitle,
|
|
5816
5867
|
type: Span
|
|
@@ -5926,25 +5977,26 @@ const renderWaterMark = groupId => {
|
|
|
5926
5977
|
}];
|
|
5927
5978
|
};
|
|
5928
5979
|
|
|
5929
|
-
const renderEmptyEditorGroup = (group, groupIndex, style) => {
|
|
5980
|
+
const renderEmptyEditorGroup = (group, groupIndex, style, closeButtonEnabled = true) => {
|
|
5981
|
+
const closeButtonDom = closeButtonEnabled ? renderEmptyGroupCloseButton(group) : [];
|
|
5930
5982
|
return [{
|
|
5931
|
-
childCount: 2,
|
|
5983
|
+
childCount: closeButtonEnabled ? 2 : 1,
|
|
5932
5984
|
className: EditorGroup,
|
|
5933
5985
|
'data-groupId': String(group.id),
|
|
5934
5986
|
onContextMenu: HandleContextMenu,
|
|
5935
5987
|
style,
|
|
5936
5988
|
tabIndex: 0,
|
|
5937
5989
|
type: Div
|
|
5938
|
-
}, ...
|
|
5990
|
+
}, ...closeButtonDom, ...renderWaterMark(group.id)];
|
|
5939
5991
|
};
|
|
5940
5992
|
|
|
5941
|
-
const renderEditorGroup = (group, groupIndex, splitButtonEnabled = false, sizeProperty = 'width') => {
|
|
5993
|
+
const renderEditorGroup = (group, groupIndex, splitButtonEnabled = false, sizeProperty = 'width', closeButtonEnabled = true) => {
|
|
5942
5994
|
const activeTab = group.tabs.find(tab => tab.id === group.activeTabId);
|
|
5943
5995
|
const style = `${sizeProperty}:${group.size}%;`;
|
|
5944
5996
|
const hasTabs = group.tabs.length > 0;
|
|
5945
5997
|
const hasEmptyGroupCloseButton = !hasTabs;
|
|
5946
5998
|
if (hasEmptyGroupCloseButton) {
|
|
5947
|
-
return renderEmptyEditorGroup(group, groupIndex, style);
|
|
5999
|
+
return renderEmptyEditorGroup(group, groupIndex, style, closeButtonEnabled);
|
|
5948
6000
|
}
|
|
5949
6001
|
return [{
|
|
5950
6002
|
childCount: 2,
|
|
@@ -5986,7 +6038,7 @@ const renderSingleEditorGroup = (layout, splitButtonEnabled, sizeProperty = 'wid
|
|
|
5986
6038
|
childCount: 1,
|
|
5987
6039
|
className: Main,
|
|
5988
6040
|
type: Div
|
|
5989
|
-
}, ...renderEditorGroup(layout.groups[0], 0, splitButtonEnabled, sizeProperty)];
|
|
6041
|
+
}, ...renderEditorGroup(layout.groups[0], 0, splitButtonEnabled, sizeProperty, false)];
|
|
5990
6042
|
};
|
|
5991
6043
|
|
|
5992
6044
|
const getDirectionClassName = (direction, isSplit) => {
|
|
@@ -6246,9 +6298,21 @@ const save = async state => {
|
|
|
6246
6298
|
});
|
|
6247
6299
|
};
|
|
6248
6300
|
|
|
6301
|
+
const getSavedTab = tab => {
|
|
6302
|
+
const normalizedTab = normalizeTabEditorInput(tab);
|
|
6303
|
+
const {
|
|
6304
|
+
errorMessage: _errorMessage,
|
|
6305
|
+
loadingState: _loadingState,
|
|
6306
|
+
...rest
|
|
6307
|
+
} = normalizedTab;
|
|
6308
|
+
return {
|
|
6309
|
+
...rest,
|
|
6310
|
+
editorUid: -1
|
|
6311
|
+
};
|
|
6312
|
+
};
|
|
6249
6313
|
const getFilteredGroups = groups => {
|
|
6250
6314
|
return groups.map(group => {
|
|
6251
|
-
const tabs = group.tabs.filter(tab => !tab.uri?.startsWith('untitled://')).map(
|
|
6315
|
+
const tabs = group.tabs.filter(tab => !tab.uri?.startsWith('untitled://')).map(getSavedTab);
|
|
6252
6316
|
const activeTabId = tabs.some(tab => tab.id === group.activeTabId) ? group.activeTabId : tabs[0]?.id;
|
|
6253
6317
|
return {
|
|
6254
6318
|
...group,
|
|
@@ -6652,6 +6716,7 @@ const commandMap = {
|
|
|
6652
6716
|
'MainArea.handleTabContextMenu': wrapCommand(handleTabContextMenu),
|
|
6653
6717
|
'MainArea.handleUriChange': wrapCommand(handleUriChange),
|
|
6654
6718
|
'MainArea.handleWorkspaceChange': wrapCommand(handleWorkspaceChange),
|
|
6719
|
+
'MainArea.hasActiveTextEditor': wrapGetter(hasActiveTextEditor),
|
|
6655
6720
|
'MainArea.initialize': initialize,
|
|
6656
6721
|
'MainArea.loadContent': wrapCommand(loadContent),
|
|
6657
6722
|
'MainArea.moveIntoNewWindow': wrapCommand(moveIntoNewWindow),
|