@lvce-editor/main-area-worker 9.22.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.
@@ -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,
@@ -2465,6 +2466,7 @@ const getEditorInputEditorType = editorInput => {
2465
2466
  case 'extension-detail-view':
2466
2467
  case 'image':
2467
2468
  case 'process-explorer':
2469
+ case 'running-extensions':
2468
2470
  case 'video':
2469
2471
  return 'custom';
2470
2472
  case 'editor':
@@ -2484,6 +2486,8 @@ const getEditorInputUri = editorInput => {
2484
2486
  return `extension-detail://${editorInput.extensionId}`;
2485
2487
  case 'process-explorer':
2486
2488
  return 'process-explorer://';
2489
+ case 'running-extensions':
2490
+ return 'running-extensions://';
2487
2491
  }
2488
2492
  };
2489
2493
 
@@ -2553,6 +2557,11 @@ const getEditorInputFromUri = uri => {
2553
2557
  type: 'process-explorer'
2554
2558
  };
2555
2559
  }
2560
+ if (uri.startsWith('running-extensions://')) {
2561
+ return {
2562
+ type: 'running-extensions'
2563
+ };
2564
+ }
2556
2565
  const extension = getLowerCaseExtension(uri);
2557
2566
  if (imageExtensions.has(extension)) {
2558
2567
  return {
@@ -2723,6 +2732,7 @@ const DiffEditor = 'DiffEditor';
2723
2732
  const EditorText = 'Editor';
2724
2733
  const ExtensionDetail = 'ExtensionDetail';
2725
2734
  const ProcessExplorer = 'ProcessExplorer';
2735
+ const RunningExtensions = 'RunningExtensions';
2726
2736
  const QuickPick = 'QuickPick';
2727
2737
 
2728
2738
  const getViewletModuleIdForEditorInput = async editorInput => {
@@ -2737,6 +2747,8 @@ const getViewletModuleIdForEditorInput = async editorInput => {
2737
2747
  return ExtensionDetail;
2738
2748
  case 'process-explorer':
2739
2749
  return ProcessExplorer;
2750
+ case 'running-extensions':
2751
+ return RunningExtensions;
2740
2752
  }
2741
2753
  };
2742
2754
 
@@ -3265,6 +3277,9 @@ const getLabel = uri => {
3265
3277
  if (uri.startsWith('process-explorer://')) {
3266
3278
  return 'Process Explorer';
3267
3279
  }
3280
+ if (uri.startsWith('running-extensions://')) {
3281
+ return 'Running Extensions';
3282
+ }
3268
3283
  if (uri.startsWith(inlineDiffPrefix)) {
3269
3284
  return getInlineDiffLabel(uri);
3270
3285
  }
@@ -3287,6 +3302,8 @@ const getEditorInputTitle = editorInput => {
3287
3302
  return editorInput.extensionId;
3288
3303
  case 'process-explorer':
3289
3304
  return 'Process Explorer';
3305
+ case 'running-extensions':
3306
+ return 'Running Extensions';
3290
3307
  }
3291
3308
  };
3292
3309
 
@@ -3571,6 +3588,7 @@ const getIconsCached = (dirents, fileIconCache) => {
3571
3588
  };
3572
3589
 
3573
3590
  const ExtensionDetailScheme$1 = 'extension-detail://';
3591
+ const RunningExtensionsScheme$1 = 'running-extensions://';
3574
3592
  const getBasename = uri => {
3575
3593
  const lastSlashIndex = uri.lastIndexOf('/');
3576
3594
  if (lastSlashIndex === -1) {
@@ -3581,7 +3599,7 @@ const getBasename = uri => {
3581
3599
  const getMissingTabs = (tabs, fileIconCache) => {
3582
3600
  const missingTabs = [];
3583
3601
  for (const tab of tabs) {
3584
- if (tab.uri && !tab.uri.startsWith(ExtensionDetailScheme$1) && !(tab.uri in fileIconCache)) {
3602
+ if (tab.uri && !tab.uri.startsWith(ExtensionDetailScheme$1) && !tab.uri.startsWith(RunningExtensionsScheme$1) && !(tab.uri in fileIconCache)) {
3585
3603
  missingTabs.push(tab);
3586
3604
  }
3587
3605
  }
@@ -4129,6 +4147,7 @@ const MaskIconPreview = 'MaskIcon MaskIconPreview';
4129
4147
  const MaskIconCircleFilled = 'MaskIcon MaskIconCircleFilled';
4130
4148
  const MaskIconClose = 'MaskIcon MaskIconClose';
4131
4149
  const MaskIconExtensions = 'MaskIcon MaskIconExtensions';
4150
+ const MaskIconRecordKey = 'MaskIcon MaskIconRecordKey';
4132
4151
  const TextEditor = 'TextEditor';
4133
4152
  const TextEditorLoading = 'TextEditor TextEditor--loading';
4134
4153
  const EditorContentLoading = 'EditorContent EditorContent--loading';
@@ -4445,13 +4464,11 @@ const clamp = (value, min, max) => {
4445
4464
  return Math.min(max, Math.max(min, value));
4446
4465
  };
4447
4466
 
4448
- const getMinGroupSizePercent = (axisSize, minGroupWidthPx) => {
4467
+ const getMinGroupSizePercent = (axisSize, minGroupSizePx) => {
4449
4468
  if (!axisSize) {
4450
- return 10;
4469
+ return 0;
4451
4470
  }
4452
- const minPercent = minGroupWidthPx / axisSize * 100;
4453
- // Ensure minimum is at least 10%, matching the CSS 250px constraint on typical widths
4454
- return Math.max(minPercent, 10);
4471
+ return minGroupSizePx / axisSize * 100;
4455
4472
  };
4456
4473
 
4457
4474
  const round = value => {
@@ -4482,7 +4499,8 @@ const handleSashPointerMove = async (state, clientX, clientY) => {
4482
4499
  const deltaPx = direction === Horizontal ? clientX - sashDrag.startClientX : clientY - sashDrag.startClientY;
4483
4500
  const deltaPercent = deltaPx / axisSize * 100;
4484
4501
  const totalResizableSize = sashDrag.beforeSize + sashDrag.afterSize;
4485
- let minGroupSize = getMinGroupSizePercent(axisSize, state.minGroupWidthPx);
4502
+ const minGroupSizePx = direction === Horizontal ? state.minGroupWidthPx : state.minGroupHeightPx;
4503
+ let minGroupSize = getMinGroupSizePercent(axisSize, minGroupSizePx);
4486
4504
 
4487
4505
  // If the minimum size makes it impossible to fit two groups, relax the constraint
4488
4506
  if (2 * minGroupSize > totalResizableSize) {
@@ -5788,18 +5806,29 @@ const renderTabActions = (isDirty, tabIndex, groupIndex) => {
5788
5806
  };
5789
5807
 
5790
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
+ };
5791
5823
  const renderTabIcon = tab => {
5824
+ if (tab.uri === KeyBindingsUri) {
5825
+ return renderMaskIcon(MaskIconRecordKey);
5826
+ }
5792
5827
  if (tab.uri?.startsWith(ExtensionDetailScheme)) {
5793
- return [{
5794
- childCount: 1,
5795
- className: TabIcon,
5796
- role: None$1,
5797
- type: Div
5798
- }, {
5799
- childCount: 0,
5800
- className: MaskIconExtensions,
5801
- type: Div
5802
- }];
5828
+ return renderMaskIcon(MaskIconExtensions);
5829
+ }
5830
+ if (tab.uri?.startsWith(RunningExtensionsScheme)) {
5831
+ return renderMaskIcon(MaskIconExtensions);
5803
5832
  }
5804
5833
  return [{
5805
5834
  childCount: 0,
@@ -5948,25 +5977,26 @@ const renderWaterMark = groupId => {
5948
5977
  }];
5949
5978
  };
5950
5979
 
5951
- const renderEmptyEditorGroup = (group, groupIndex, style) => {
5980
+ const renderEmptyEditorGroup = (group, groupIndex, style, closeButtonEnabled = true) => {
5981
+ const closeButtonDom = closeButtonEnabled ? renderEmptyGroupCloseButton(group) : [];
5952
5982
  return [{
5953
- childCount: 2,
5983
+ childCount: closeButtonEnabled ? 2 : 1,
5954
5984
  className: EditorGroup,
5955
5985
  'data-groupId': String(group.id),
5956
5986
  onContextMenu: HandleContextMenu,
5957
5987
  style,
5958
5988
  tabIndex: 0,
5959
5989
  type: Div
5960
- }, ...renderEmptyGroupCloseButton(group), ...renderWaterMark(group.id)];
5990
+ }, ...closeButtonDom, ...renderWaterMark(group.id)];
5961
5991
  };
5962
5992
 
5963
- const renderEditorGroup = (group, groupIndex, splitButtonEnabled = false, sizeProperty = 'width') => {
5993
+ const renderEditorGroup = (group, groupIndex, splitButtonEnabled = false, sizeProperty = 'width', closeButtonEnabled = true) => {
5964
5994
  const activeTab = group.tabs.find(tab => tab.id === group.activeTabId);
5965
5995
  const style = `${sizeProperty}:${group.size}%;`;
5966
5996
  const hasTabs = group.tabs.length > 0;
5967
5997
  const hasEmptyGroupCloseButton = !hasTabs;
5968
5998
  if (hasEmptyGroupCloseButton) {
5969
- return renderEmptyEditorGroup(group, groupIndex, style);
5999
+ return renderEmptyEditorGroup(group, groupIndex, style, closeButtonEnabled);
5970
6000
  }
5971
6001
  return [{
5972
6002
  childCount: 2,
@@ -6008,7 +6038,7 @@ const renderSingleEditorGroup = (layout, splitButtonEnabled, sizeProperty = 'wid
6008
6038
  childCount: 1,
6009
6039
  className: Main,
6010
6040
  type: Div
6011
- }, ...renderEditorGroup(layout.groups[0], 0, splitButtonEnabled, sizeProperty)];
6041
+ }, ...renderEditorGroup(layout.groups[0], 0, splitButtonEnabled, sizeProperty, false)];
6012
6042
  };
6013
6043
 
6014
6044
  const getDirectionClassName = (direction, isSplit) => {
@@ -6268,9 +6298,21 @@ const save = async state => {
6268
6298
  });
6269
6299
  };
6270
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
+ };
6271
6313
  const getFilteredGroups = groups => {
6272
6314
  return groups.map(group => {
6273
- const tabs = group.tabs.filter(tab => !tab.uri?.startsWith('untitled://')).map(normalizeTabEditorInput);
6315
+ const tabs = group.tabs.filter(tab => !tab.uri?.startsWith('untitled://')).map(getSavedTab);
6274
6316
  const activeTabId = tabs.some(tab => tab.id === group.activeTabId) ? group.activeTabId : tabs[0]?.id;
6275
6317
  return {
6276
6318
  ...group,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-area-worker",
3
- "version": "9.22.0",
3
+ "version": "9.24.0",
4
4
  "description": "Main Area Worker",
5
5
  "repository": {
6
6
  "type": "git",