@codingame/monaco-vscode-view-common-service-override 4.5.0-improve-code-splitting.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.
Files changed (114) hide show
  1. package/assets/fake.html +10 -0
  2. package/assets/index-no-csp.html +1230 -0
  3. package/assets/index.html +1231 -0
  4. package/assets/service-worker.js +457 -0
  5. package/index.d.ts +1 -0
  6. package/index.js +1 -0
  7. package/override/vs/workbench/browser/parts/editor/textEditor.js +5 -0
  8. package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +11 -0
  9. package/package.json +32 -0
  10. package/tools/editorAssets.js +4 -0
  11. package/tools/url.js +10 -0
  12. package/viewCommon.d.ts +5 -0
  13. package/viewCommon.js +105 -0
  14. package/vscode/src/vs/base/browser/deviceAccess.js +61 -0
  15. package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +180 -0
  16. package/vscode/src/vs/base/browser/ui/grid/grid.js +494 -0
  17. package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +6 -0
  18. package/vscode/src/vs/base/browser/ui/grid/gridview.js +1113 -0
  19. package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +12 -0
  20. package/vscode/src/vs/platform/webview/common/mimeTypes.js +24 -0
  21. package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +64 -0
  22. package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +907 -0
  23. package/vscode/src/vs/workbench/browser/actions/listCommands.js +764 -0
  24. package/vscode/src/vs/workbench/browser/actions/navigationActions.js +301 -0
  25. package/vscode/src/vs/workbench/browser/media/style.css.js +6 -0
  26. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +671 -0
  27. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +6 -0
  28. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +6 -0
  29. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +229 -0
  30. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +6 -0
  31. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +606 -0
  32. package/vscode/src/vs/workbench/browser/parts/compositePart.js +346 -0
  33. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +246 -0
  34. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +1403 -0
  35. package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +188 -0
  36. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +523 -0
  37. package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +1030 -0
  38. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +391 -0
  39. package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +6 -0
  40. package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +6 -0
  41. package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +6 -0
  42. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +643 -0
  43. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +472 -0
  44. package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +68 -0
  45. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +160 -0
  46. package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +6 -0
  47. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +39 -0
  48. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +238 -0
  49. package/vscode/src/vs/workbench/browser/style.js +54 -0
  50. package/vscode/src/vs/workbench/browser/window.js +381 -0
  51. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +300 -0
  52. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +367 -0
  53. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +135 -0
  54. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +6 -0
  55. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +18 -0
  56. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +146 -0
  57. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +215 -0
  58. package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +6 -0
  59. package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +78 -0
  60. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +56 -0
  61. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +63 -0
  62. package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +183 -0
  63. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +8 -0
  64. package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +408 -0
  65. package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +6 -0
  66. package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +147 -0
  67. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +635 -0
  68. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +230 -0
  69. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +75 -0
  70. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +42 -0
  71. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +81 -0
  72. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +350 -0
  73. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +100 -0
  74. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +148 -0
  75. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +106 -0
  76. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +403 -0
  77. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +199 -0
  78. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +41 -0
  79. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +128 -0
  80. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +6 -0
  81. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +619 -0
  82. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +161 -0
  83. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +266 -0
  84. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +173 -0
  85. package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +195 -0
  86. package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +38 -0
  87. package/vscode/src/vs/workbench/contrib/sash/browser/sash.js +41 -0
  88. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +6 -0
  89. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +283 -0
  90. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +362 -0
  91. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +133 -0
  92. package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +314 -0
  93. package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +96 -0
  94. package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +98 -0
  95. package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +656 -0
  96. package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +65 -0
  97. package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +59 -0
  98. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +143 -0
  99. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +121 -0
  100. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +67 -0
  101. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +234 -0
  102. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewService.js +45 -0
  103. package/vscode/src/vs/workbench/services/activity/browser/activityService.js +145 -0
  104. package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +341 -0
  105. package/vscode/src/vs/workbench/services/driver/browser/driver.js +186 -0
  106. package/vscode/src/vs/workbench/services/editor/browser/editorPaneService.js +13 -0
  107. package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +676 -0
  108. package/vscode/src/vs/workbench/services/history/browser/historyService.js +1516 -0
  109. package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +6 -0
  110. package/vscode/src/vs/workbench/services/progress/browser/progressService.js +527 -0
  111. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +102 -0
  112. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +133 -0
  113. package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +711 -0
  114. package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +603 -0
@@ -0,0 +1,472 @@
1
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
+ import './media/paneCompositePart.css.js';
3
+ import { Event } from 'vscode/vscode/vs/base/common/event';
4
+ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
5
+ import { Extensions } from 'vscode/vscode/vs/workbench/browser/panecomposite';
6
+ import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
7
+ import { DisposableStore, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
8
+ import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
9
+ import { CompositePart } from './compositePart.js';
10
+ import { PaneCompositeBar } from './paneCompositeBar.js';
11
+ import { trackFocus, EventHelper, addDisposableListener, EventType, getWindow, $, prepend, Dimension } from 'vscode/vscode/vs/base/browser/dom';
12
+ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
13
+ import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
14
+ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
15
+ import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
16
+ import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
17
+ import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
18
+ import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
19
+ import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
20
+ import { localizeWithPath } from 'vscode/vscode/vs/nls';
21
+ import { CompositeDragAndDropObserver, toggleDropEffect } from 'vscode/vscode/vs/workbench/browser/dnd';
22
+ import { EDITOR_DRAG_AND_DROP_BACKGROUND } from 'vscode/vscode/vs/workbench/common/theme';
23
+ import { ToolBar } from 'vscode/vscode/vs/base/browser/ui/toolbar/toolbar';
24
+ import { CompositeMenuActions } from 'vscode/vscode/vs/workbench/browser/actions';
25
+ import { MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
26
+ import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.service';
27
+ import { prepareActions } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
28
+ import { Gesture, EventType as EventType$1 } from 'vscode/vscode/vs/base/browser/touch';
29
+ import { StandardMouseEvent } from 'vscode/vscode/vs/base/browser/mouseEvent';
30
+ import { SubmenuAction } from 'vscode/vscode/vs/base/common/actions';
31
+ import { ViewsSubMenu } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
32
+ import { createAndFillInActionBarActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
33
+
34
+ var AbstractPaneCompositePart_1;
35
+ var CompositeBarPosition;
36
+ ( (function(CompositeBarPosition) {
37
+ CompositeBarPosition[CompositeBarPosition["TOP"] = 0] = "TOP";
38
+ CompositeBarPosition[CompositeBarPosition["TITLE"] = 1] = "TITLE";
39
+ CompositeBarPosition[CompositeBarPosition["BOTTOM"] = 2] = "BOTTOM";
40
+ })(CompositeBarPosition || (CompositeBarPosition = {})));
41
+ let AbstractPaneCompositePart = class AbstractPaneCompositePart extends CompositePart {
42
+ static { AbstractPaneCompositePart_1 = this; }
43
+ static { this.MIN_COMPOSITE_BAR_WIDTH = 50; }
44
+ get snap() {
45
+ return this.layoutService.isVisible(this.partId) || !!this.paneCompositeBar.value?.getVisiblePaneCompositeIds().length;
46
+ }
47
+ get onDidPaneCompositeOpen() { return ( Event.map(this.onDidCompositeOpen.event, compositeEvent => compositeEvent.composite)); }
48
+ constructor(partId, partOptions, activePaneCompositeSettingsKey, activePaneContextKey, paneFocusContextKey, nameForTelemetry, compositeCSSClass, titleForegroundColor, notificationService, storageService, contextMenuService, layoutService, keybindingService, instantiationService, themeService, viewDescriptorService, contextKeyService, extensionService, menuService) {
49
+ let location = 0 ;
50
+ let registryId = Extensions.Viewlets;
51
+ let globalActionsMenuId = MenuId.SidebarTitle;
52
+ if (partId === "workbench.parts.panel" ) {
53
+ location = 1 ;
54
+ registryId = Extensions.Panels;
55
+ globalActionsMenuId = MenuId.PanelTitle;
56
+ }
57
+ else if (partId === "workbench.parts.auxiliarybar" ) {
58
+ location = 2 ;
59
+ registryId = Extensions.Auxiliary;
60
+ globalActionsMenuId = MenuId.AuxiliaryBarTitle;
61
+ }
62
+ super(notificationService, storageService, contextMenuService, layoutService, keybindingService, instantiationService, themeService, ( Registry.as(registryId)), activePaneCompositeSettingsKey, viewDescriptorService.getDefaultViewContainer(location)?.id || '', nameForTelemetry, compositeCSSClass, titleForegroundColor, partId, partOptions);
63
+ this.partId = partId;
64
+ this.activePaneContextKey = activePaneContextKey;
65
+ this.paneFocusContextKey = paneFocusContextKey;
66
+ this.viewDescriptorService = viewDescriptorService;
67
+ this.contextKeyService = contextKeyService;
68
+ this.extensionService = extensionService;
69
+ this.menuService = menuService;
70
+ this.onDidPaneCompositeClose = this.onDidCompositeClose.event;
71
+ this.headerFooterCompositeBarDispoables = this._register(( new DisposableStore()));
72
+ this.paneCompositeBar = this._register(( new MutableDisposable()));
73
+ this.compositeBarPosition = undefined;
74
+ this.blockOpening = false;
75
+ this.location = location;
76
+ this.globalActions = this._register(this.instantiationService.createInstance(CompositeMenuActions, globalActionsMenuId, undefined, undefined));
77
+ this.registerListeners();
78
+ }
79
+ registerListeners() {
80
+ this._register(this.onDidPaneCompositeOpen(composite => this.onDidOpen(composite)));
81
+ this._register(this.onDidPaneCompositeClose(this.onDidClose, this));
82
+ this._register(this.globalActions.onDidChange(() => this.updateGlobalToolbarActions()));
83
+ this._register(this.registry.onDidDeregister((viewletDescriptor) => {
84
+ const activeContainers = this.viewDescriptorService.getViewContainersByLocation(this.location)
85
+ .filter(container => this.viewDescriptorService.getViewContainerModel(container).activeViewDescriptors.length > 0);
86
+ if (activeContainers.length) {
87
+ if (this.getActiveComposite()?.getId() === viewletDescriptor.id) {
88
+ const defaultViewletId = this.viewDescriptorService.getDefaultViewContainer(this.location)?.id;
89
+ const containerToOpen = activeContainers.filter(c => c.id === defaultViewletId)[0] || activeContainers[0];
90
+ this.doOpenPaneComposite(containerToOpen.id);
91
+ }
92
+ }
93
+ else {
94
+ this.layoutService.setPartHidden(true, this.partId);
95
+ }
96
+ this.removeComposite(viewletDescriptor.id);
97
+ }));
98
+ this._register(this.extensionService.onDidRegisterExtensions(() => {
99
+ this.layoutCompositeBar();
100
+ }));
101
+ }
102
+ onDidOpen(composite) {
103
+ this.activePaneContextKey.set(composite.getId());
104
+ }
105
+ onDidClose(composite) {
106
+ const id = composite.getId();
107
+ if (this.activePaneContextKey.get() === id) {
108
+ this.activePaneContextKey.reset();
109
+ }
110
+ }
111
+ showComposite(composite) {
112
+ super.showComposite(composite);
113
+ this.layoutCompositeBar();
114
+ this.layoutEmptyMessage();
115
+ }
116
+ hideActiveComposite() {
117
+ const composite = super.hideActiveComposite();
118
+ this.layoutCompositeBar();
119
+ this.layoutEmptyMessage();
120
+ return composite;
121
+ }
122
+ create(parent) {
123
+ this.element = parent;
124
+ this.element.classList.add('pane-composite-part');
125
+ super.create(parent);
126
+ const contentArea = this.getContentArea();
127
+ if (contentArea) {
128
+ this.createEmptyPaneMessage(contentArea);
129
+ }
130
+ this.updateCompositeBar();
131
+ const focusTracker = this._register(trackFocus(parent));
132
+ this._register(focusTracker.onDidFocus(() => this.paneFocusContextKey.set(true)));
133
+ this._register(focusTracker.onDidBlur(() => this.paneFocusContextKey.set(false)));
134
+ }
135
+ createEmptyPaneMessage(parent) {
136
+ this.emptyPaneMessageElement = document.createElement('div');
137
+ this.emptyPaneMessageElement.classList.add('empty-pane-message-area');
138
+ const messageElement = document.createElement('div');
139
+ messageElement.classList.add('empty-pane-message');
140
+ messageElement.innerText = ( localizeWithPath(
141
+ 'vs/workbench/browser/parts/paneCompositePart',
142
+ 'pane.emptyMessage',
143
+ "Drag a view here to display."
144
+ ));
145
+ this.emptyPaneMessageElement.appendChild(messageElement);
146
+ parent.appendChild(this.emptyPaneMessageElement);
147
+ this._register(CompositeDragAndDropObserver.INSTANCE.registerTarget(this.emptyPaneMessageElement, {
148
+ onDragOver: (e) => {
149
+ EventHelper.stop(e.eventData, true);
150
+ if (this.paneCompositeBar.value) {
151
+ const validDropTarget = this.paneCompositeBar.value.dndHandler.onDragEnter(e.dragAndDropData, undefined, e.eventData);
152
+ toggleDropEffect(e.eventData.dataTransfer, 'move', validDropTarget);
153
+ }
154
+ },
155
+ onDragEnter: (e) => {
156
+ EventHelper.stop(e.eventData, true);
157
+ if (this.paneCompositeBar.value) {
158
+ const validDropTarget = this.paneCompositeBar.value.dndHandler.onDragEnter(e.dragAndDropData, undefined, e.eventData);
159
+ this.emptyPaneMessageElement.style.backgroundColor = validDropTarget ? this.theme.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND)?.toString() || '' : '';
160
+ }
161
+ },
162
+ onDragLeave: (e) => {
163
+ EventHelper.stop(e.eventData, true);
164
+ this.emptyPaneMessageElement.style.backgroundColor = '';
165
+ },
166
+ onDragEnd: (e) => {
167
+ EventHelper.stop(e.eventData, true);
168
+ this.emptyPaneMessageElement.style.backgroundColor = '';
169
+ },
170
+ onDrop: (e) => {
171
+ EventHelper.stop(e.eventData, true);
172
+ this.emptyPaneMessageElement.style.backgroundColor = '';
173
+ if (this.paneCompositeBar.value) {
174
+ this.paneCompositeBar.value.dndHandler.drop(e.dragAndDropData, undefined, e.eventData);
175
+ }
176
+ },
177
+ }));
178
+ }
179
+ createTitleArea(parent) {
180
+ const titleArea = super.createTitleArea(parent);
181
+ this._register(addDisposableListener(titleArea, EventType.CONTEXT_MENU, e => {
182
+ this.onTitleAreaContextMenu(( new StandardMouseEvent(getWindow(titleArea), e)));
183
+ }));
184
+ this._register(Gesture.addTarget(titleArea));
185
+ this._register(addDisposableListener(titleArea, EventType$1.Contextmenu, e => {
186
+ this.onTitleAreaContextMenu(( new StandardMouseEvent(getWindow(titleArea), e)));
187
+ }));
188
+ const globalTitleActionsContainer = titleArea.appendChild($('.global-actions'));
189
+ this.globalToolBar = this._register(( new ToolBar(globalTitleActionsContainer, this.contextMenuService, {
190
+ actionViewItemProvider: (action, options) => this.actionViewItemProvider(action, options),
191
+ orientation: 0 ,
192
+ getKeyBinding: action => this.keybindingService.lookupKeybinding(action.id),
193
+ anchorAlignmentProvider: () => this.getTitleAreaDropDownAnchorAlignment(),
194
+ toggleMenuTitle: ( localizeWithPath(
195
+ 'vs/workbench/browser/parts/paneCompositePart',
196
+ 'moreActions',
197
+ "More Actions..."
198
+ )),
199
+ hoverDelegate: this.toolbarHoverDelegate
200
+ })));
201
+ this.updateGlobalToolbarActions();
202
+ return titleArea;
203
+ }
204
+ createTitleLabel(parent) {
205
+ this.titleContainer = parent;
206
+ const titleLabel = super.createTitleLabel(parent);
207
+ this.titleLabelElement.draggable = true;
208
+ const draggedItemProvider = () => {
209
+ const activeViewlet = this.getActivePaneComposite();
210
+ return { type: 'composite', id: activeViewlet.getId() };
211
+ };
212
+ this._register(CompositeDragAndDropObserver.INSTANCE.registerDraggable(this.titleLabelElement, draggedItemProvider, {}));
213
+ return titleLabel;
214
+ }
215
+ updateCompositeBar() {
216
+ const wasCompositeBarVisible = this.compositeBarPosition !== undefined;
217
+ const isCompositeBarVisible = this.shouldShowCompositeBar();
218
+ const previousPosition = this.compositeBarPosition;
219
+ const newPosition = isCompositeBarVisible ? this.getCompositeBarPosition() : undefined;
220
+ if (previousPosition === newPosition) {
221
+ return;
222
+ }
223
+ if (wasCompositeBarVisible) {
224
+ const previousCompositeBarContainer = previousPosition === CompositeBarPosition.TITLE ? this.titleContainer : this.headerFooterCompositeBarContainer;
225
+ if (!this.paneCompositeBarContainer || !this.paneCompositeBar.value || !previousCompositeBarContainer) {
226
+ throw new Error('Composite bar containers should exist when removing the previous composite bar');
227
+ }
228
+ this.paneCompositeBarContainer.remove();
229
+ this.paneCompositeBarContainer = undefined;
230
+ this.paneCompositeBar.value = undefined;
231
+ previousCompositeBarContainer.classList.remove('has-composite-bar');
232
+ if (previousPosition === CompositeBarPosition.TOP) {
233
+ this.removeFooterHeaderArea(true);
234
+ }
235
+ else if (previousPosition === CompositeBarPosition.BOTTOM) {
236
+ this.removeFooterHeaderArea(false);
237
+ }
238
+ }
239
+ let newCompositeBarContainer;
240
+ switch (newPosition) {
241
+ case CompositeBarPosition.TOP:
242
+ newCompositeBarContainer = this.createHeaderArea();
243
+ break;
244
+ case CompositeBarPosition.TITLE:
245
+ newCompositeBarContainer = this.titleContainer;
246
+ break;
247
+ case CompositeBarPosition.BOTTOM:
248
+ newCompositeBarContainer = this.createFooterArea();
249
+ break;
250
+ }
251
+ if (isCompositeBarVisible) {
252
+ if (this.paneCompositeBarContainer || this.paneCompositeBar.value || !newCompositeBarContainer) {
253
+ throw new Error('Invalid composite bar state when creating the new composite bar');
254
+ }
255
+ newCompositeBarContainer.classList.add('has-composite-bar');
256
+ this.paneCompositeBarContainer = prepend(newCompositeBarContainer, $('.composite-bar-container'));
257
+ this.paneCompositeBar.value = this.createCompositeBar();
258
+ this.paneCompositeBar.value.create(this.paneCompositeBarContainer);
259
+ if (newPosition === CompositeBarPosition.TOP) {
260
+ this.setHeaderArea(newCompositeBarContainer);
261
+ }
262
+ else if (newPosition === CompositeBarPosition.BOTTOM) {
263
+ this.setFooterArea(newCompositeBarContainer);
264
+ }
265
+ }
266
+ this.compositeBarPosition = newPosition;
267
+ }
268
+ createHeaderArea() {
269
+ const headerArea = super.createHeaderArea();
270
+ return this.createHeaderFooterCompositeBarArea(headerArea);
271
+ }
272
+ createFooterArea() {
273
+ const footerArea = super.createFooterArea();
274
+ return this.createHeaderFooterCompositeBarArea(footerArea);
275
+ }
276
+ createHeaderFooterCompositeBarArea(area) {
277
+ if (this.headerFooterCompositeBarContainer) {
278
+ throw new Error('Header or Footer composite bar already exists');
279
+ }
280
+ this.headerFooterCompositeBarContainer = area;
281
+ this.headerFooterCompositeBarDispoables.add(addDisposableListener(area, EventType.CONTEXT_MENU, e => {
282
+ this.onCompositeBarAreaContextMenu(( new StandardMouseEvent(getWindow(area), e)));
283
+ }));
284
+ this.headerFooterCompositeBarDispoables.add(Gesture.addTarget(area));
285
+ this.headerFooterCompositeBarDispoables.add(addDisposableListener(area, EventType$1.Contextmenu, e => {
286
+ this.onCompositeBarAreaContextMenu(( new StandardMouseEvent(getWindow(area), e)));
287
+ }));
288
+ return area;
289
+ }
290
+ removeFooterHeaderArea(header) {
291
+ this.headerFooterCompositeBarContainer = undefined;
292
+ this.headerFooterCompositeBarDispoables.clear();
293
+ if (header) {
294
+ this.removeHeaderArea();
295
+ }
296
+ else {
297
+ this.removeFooterArea();
298
+ }
299
+ }
300
+ createCompositeBar() {
301
+ return this.instantiationService.createInstance(PaneCompositeBar, this.getCompositeBarOptions(), this.partId, this);
302
+ }
303
+ onTitleAreaUpdate(compositeId) {
304
+ super.onTitleAreaUpdate(compositeId);
305
+ this.layoutCompositeBar();
306
+ }
307
+ async openPaneComposite(id, focus) {
308
+ if (typeof id === 'string' && this.getPaneComposite(id)) {
309
+ return this.doOpenPaneComposite(id, focus);
310
+ }
311
+ await this.extensionService.whenInstalledExtensionsRegistered();
312
+ if (typeof id === 'string' && this.getPaneComposite(id)) {
313
+ return this.doOpenPaneComposite(id, focus);
314
+ }
315
+ return undefined;
316
+ }
317
+ doOpenPaneComposite(id, focus) {
318
+ if (this.blockOpening) {
319
+ return undefined;
320
+ }
321
+ if (!this.layoutService.isVisible(this.partId)) {
322
+ try {
323
+ this.blockOpening = true;
324
+ this.layoutService.setPartHidden(false, this.partId);
325
+ }
326
+ finally {
327
+ this.blockOpening = false;
328
+ }
329
+ }
330
+ return this.openComposite(id, focus);
331
+ }
332
+ getPaneComposite(id) {
333
+ return this.registry.getPaneComposite(id);
334
+ }
335
+ getPaneComposites() {
336
+ return this.registry.getPaneComposites()
337
+ .sort((v1, v2) => {
338
+ if (typeof v1.order !== 'number') {
339
+ return 1;
340
+ }
341
+ if (typeof v2.order !== 'number') {
342
+ return -1;
343
+ }
344
+ return v1.order - v2.order;
345
+ });
346
+ }
347
+ getPinnedPaneCompositeIds() {
348
+ return this.paneCompositeBar.value?.getPinnedPaneCompositeIds() ?? [];
349
+ }
350
+ getVisiblePaneCompositeIds() {
351
+ return this.paneCompositeBar.value?.getVisiblePaneCompositeIds() ?? [];
352
+ }
353
+ getActivePaneComposite() {
354
+ return this.getActiveComposite();
355
+ }
356
+ getLastActivePaneCompositeId() {
357
+ return this.getLastActiveCompositeId();
358
+ }
359
+ hideActivePaneComposite() {
360
+ if (this.layoutService.isVisible(this.partId)) {
361
+ this.layoutService.setPartHidden(true, this.partId);
362
+ }
363
+ this.hideActiveComposite();
364
+ }
365
+ focusComositeBar() {
366
+ this.paneCompositeBar.value?.focus();
367
+ }
368
+ layout(width, height, top, left) {
369
+ if (!this.layoutService.isVisible(this.partId)) {
370
+ return;
371
+ }
372
+ this.contentDimension = ( new Dimension(width, height));
373
+ super.layout(this.contentDimension.width, this.contentDimension.height, top, left);
374
+ this.layoutCompositeBar();
375
+ this.layoutEmptyMessage();
376
+ }
377
+ layoutCompositeBar() {
378
+ if (this.contentDimension && this.dimension && this.paneCompositeBar.value) {
379
+ const padding = this.compositeBarPosition === CompositeBarPosition.TITLE ? 16 : 8;
380
+ const borderWidth = this.partId === "workbench.parts.panel" ? 0 : 1;
381
+ let availableWidth = this.contentDimension.width - padding - borderWidth;
382
+ availableWidth = Math.max(AbstractPaneCompositePart_1.MIN_COMPOSITE_BAR_WIDTH, availableWidth - this.getToolbarWidth());
383
+ this.paneCompositeBar.value.layout(availableWidth, this.dimension.height);
384
+ }
385
+ }
386
+ layoutEmptyMessage() {
387
+ const visible = !this.getActiveComposite();
388
+ this.emptyPaneMessageElement?.classList.toggle('visible', visible);
389
+ if (visible) {
390
+ this.titleLabel?.updateTitle('', '');
391
+ }
392
+ }
393
+ updateGlobalToolbarActions() {
394
+ const primaryActions = this.globalActions.getPrimaryActions();
395
+ const secondaryActions = this.globalActions.getSecondaryActions();
396
+ this.globalToolBar?.setActions(prepareActions(primaryActions), prepareActions(secondaryActions));
397
+ }
398
+ getToolbarWidth() {
399
+ if (!this.toolBar || this.compositeBarPosition !== CompositeBarPosition.TITLE) {
400
+ return 0;
401
+ }
402
+ const activePane = this.getActivePaneComposite();
403
+ if (!activePane) {
404
+ return 0;
405
+ }
406
+ const toolBarWidth = this.toolBar.getItemsWidth() + this.toolBar.getItemsLength() * 4;
407
+ const globalToolBarWidth = this.globalToolBar ? this.globalToolBar.getItemsWidth() + this.globalToolBar.getItemsLength() * 4 : 0;
408
+ return toolBarWidth + globalToolBarWidth + 5;
409
+ }
410
+ onTitleAreaContextMenu(event) {
411
+ if (this.shouldShowCompositeBar() && this.getCompositeBarPosition() === CompositeBarPosition.TITLE) {
412
+ return this.onCompositeBarContextMenu(event);
413
+ }
414
+ else {
415
+ const activePaneComposite = this.getActivePaneComposite();
416
+ const activePaneCompositeActions = activePaneComposite ? activePaneComposite.getContextMenuActions() : [];
417
+ if (activePaneCompositeActions.length) {
418
+ this.contextMenuService.showContextMenu({
419
+ getAnchor: () => event,
420
+ getActions: () => activePaneCompositeActions,
421
+ getActionViewItem: (action, options) => this.actionViewItemProvider(action, options),
422
+ actionRunner: activePaneComposite.getActionRunner(),
423
+ skipTelemetry: true
424
+ });
425
+ }
426
+ }
427
+ }
428
+ onCompositeBarAreaContextMenu(event) {
429
+ return this.onCompositeBarContextMenu(event);
430
+ }
431
+ onCompositeBarContextMenu(event) {
432
+ if (this.paneCompositeBar.value) {
433
+ const actions = [...this.paneCompositeBar.value.getContextMenuActions()];
434
+ if (actions.length) {
435
+ this.contextMenuService.showContextMenu({
436
+ getAnchor: () => event,
437
+ getActions: () => actions,
438
+ skipTelemetry: true
439
+ });
440
+ }
441
+ }
442
+ }
443
+ getViewsSubmenuAction() {
444
+ const viewPaneContainer = this.getActivePaneComposite()?.getViewPaneContainer();
445
+ if (viewPaneContainer) {
446
+ const disposables = ( new DisposableStore());
447
+ const viewsActions = [];
448
+ const scopedContextKeyService = disposables.add(this.contextKeyService.createScoped(this.element));
449
+ scopedContextKeyService.createKey('viewContainer', viewPaneContainer.viewContainer.id);
450
+ const menu = disposables.add(this.menuService.createMenu(ViewsSubMenu, scopedContextKeyService));
451
+ createAndFillInActionBarActions(menu, { shouldForwardArgs: true, renderShortTitle: true }, { primary: viewsActions, secondary: [] }, () => true);
452
+ disposables.dispose();
453
+ return viewsActions.length > 1 && ( viewsActions.some(a => a.enabled)) ? ( new SubmenuAction('views', ( localizeWithPath('vs/workbench/browser/parts/paneCompositePart', 'views', "Views")), viewsActions)) : undefined;
454
+ }
455
+ return undefined;
456
+ }
457
+ };
458
+ AbstractPaneCompositePart = AbstractPaneCompositePart_1 = ( __decorate([
459
+ ( __param(8, INotificationService)),
460
+ ( __param(9, IStorageService)),
461
+ ( __param(10, IContextMenuService)),
462
+ ( __param(11, IWorkbenchLayoutService)),
463
+ ( __param(12, IKeybindingService)),
464
+ ( __param(13, IInstantiationService)),
465
+ ( __param(14, IThemeService)),
466
+ ( __param(15, IViewDescriptorService)),
467
+ ( __param(16, IContextKeyService)),
468
+ ( __param(17, IExtensionService)),
469
+ ( __param(18, IMenuService))
470
+ ], AbstractPaneCompositePart));
471
+
472
+ export { AbstractPaneCompositePart, CompositeBarPosition };
@@ -0,0 +1,68 @@
1
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
+ import { Event } from 'vscode/vscode/vs/base/common/event';
3
+ import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
4
+ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
5
+ import { AuxiliaryBarPart } from './auxiliarybar/auxiliaryBarPart.js';
6
+ import { PanelPart } from './panel/panelPart.js';
7
+ import { SidebarPart } from './sidebar/sidebarPart.js';
8
+ import { ViewContainerLocations } from 'vscode/vscode/vs/workbench/common/views';
9
+ import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
10
+
11
+ let PaneCompositePartService = class PaneCompositePartService extends Disposable {
12
+ constructor(instantiationService) {
13
+ super();
14
+ this.paneCompositeParts = ( new Map());
15
+ const panelPart = instantiationService.createInstance(PanelPart);
16
+ const sideBarPart = instantiationService.createInstance(SidebarPart);
17
+ const auxiliaryBarPart = instantiationService.createInstance(AuxiliaryBarPart);
18
+ this.paneCompositeParts.set(1 , panelPart);
19
+ this.paneCompositeParts.set(0 , sideBarPart);
20
+ this.paneCompositeParts.set(2 , auxiliaryBarPart);
21
+ const eventDisposables = this._register(( new DisposableStore()));
22
+ this.onDidPaneCompositeOpen = Event.any(...( ViewContainerLocations.map(loc => ( Event.map(
23
+ this.paneCompositeParts.get(loc).onDidPaneCompositeOpen,
24
+ composite => { return { composite, viewContainerLocation: loc }; },
25
+ eventDisposables
26
+ )))));
27
+ this.onDidPaneCompositeClose = Event.any(...( ViewContainerLocations.map(loc => ( Event.map(
28
+ this.paneCompositeParts.get(loc).onDidPaneCompositeClose,
29
+ composite => { return { composite, viewContainerLocation: loc }; },
30
+ eventDisposables
31
+ )))));
32
+ }
33
+ openPaneComposite(id, viewContainerLocation, focus) {
34
+ return this.getPartByLocation(viewContainerLocation).openPaneComposite(id, focus);
35
+ }
36
+ getActivePaneComposite(viewContainerLocation) {
37
+ return this.getPartByLocation(viewContainerLocation).getActivePaneComposite();
38
+ }
39
+ getPaneComposite(id, viewContainerLocation) {
40
+ return this.getPartByLocation(viewContainerLocation).getPaneComposite(id);
41
+ }
42
+ getPaneComposites(viewContainerLocation) {
43
+ return this.getPartByLocation(viewContainerLocation).getPaneComposites();
44
+ }
45
+ getPinnedPaneCompositeIds(viewContainerLocation) {
46
+ return this.getPartByLocation(viewContainerLocation).getPinnedPaneCompositeIds();
47
+ }
48
+ getVisiblePaneCompositeIds(viewContainerLocation) {
49
+ return this.getPartByLocation(viewContainerLocation).getVisiblePaneCompositeIds();
50
+ }
51
+ getProgressIndicator(id, viewContainerLocation) {
52
+ return this.getPartByLocation(viewContainerLocation).getProgressIndicator(id);
53
+ }
54
+ hideActivePaneComposite(viewContainerLocation) {
55
+ this.getPartByLocation(viewContainerLocation).hideActivePaneComposite();
56
+ }
57
+ getLastActivePaneCompositeId(viewContainerLocation) {
58
+ return this.getPartByLocation(viewContainerLocation).getLastActivePaneCompositeId();
59
+ }
60
+ getPartByLocation(viewContainerLocation) {
61
+ return assertIsDefined(this.paneCompositeParts.get(viewContainerLocation));
62
+ }
63
+ };
64
+ PaneCompositePartService = ( __decorate([
65
+ ( __param(0, IInstantiationService))
66
+ ], PaneCompositePartService));
67
+
68
+ export { PaneCompositePartService };