@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,346 @@
1
+ import './media/compositepart.css.js';
2
+ import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
+ import { defaultGenerator } from 'vscode/vscode/vs/base/common/idGenerator';
4
+ import { MutableDisposable, DisposableStore, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
5
+ import { Emitter } from 'vscode/vscode/vs/base/common/event';
6
+ import { isCancellationError } from 'vscode/vscode/vs/base/common/errors';
7
+ import { prepareActions } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
8
+ import { ProgressBar } from 'vscode/vscode/vs/base/browser/ui/progressbar/progressbar';
9
+ import { Part } from 'vscode/vscode/vs/workbench/browser/part';
10
+ import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
11
+ import { IEditorProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
12
+ import { $, show, hide, append, Dimension } from 'vscode/vscode/vs/base/browser/dom';
13
+ import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
14
+ import { createActionViewItem } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
15
+ import { ScopedProgressIndicator, AbstractProgressScope } from 'vscode/vscode/vs/workbench/services/progress/browser/progressIndicator';
16
+ import { WorkbenchToolBar } from 'vscode/vscode/vs/platform/actions/browser/toolbar';
17
+ import { defaultProgressBarStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
18
+ import { createInstantHoverDelegate, getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
19
+ import { setupCustomHover } from 'vscode/vscode/vs/base/browser/ui/hover/updatableHoverWidget';
20
+
21
+ class CompositePart extends Part {
22
+ constructor(notificationService, storageService, contextMenuService, layoutService, keybindingService, instantiationService, themeService, registry, activeCompositeSettingsKey, defaultCompositeId, nameForTelemetry, compositeCSSClass, titleForegroundColor, id, options) {
23
+ super(id, options, themeService, storageService, layoutService);
24
+ this.notificationService = notificationService;
25
+ this.storageService = storageService;
26
+ this.contextMenuService = contextMenuService;
27
+ this.keybindingService = keybindingService;
28
+ this.instantiationService = instantiationService;
29
+ this.registry = registry;
30
+ this.activeCompositeSettingsKey = activeCompositeSettingsKey;
31
+ this.defaultCompositeId = defaultCompositeId;
32
+ this.nameForTelemetry = nameForTelemetry;
33
+ this.compositeCSSClass = compositeCSSClass;
34
+ this.titleForegroundColor = titleForegroundColor;
35
+ this.onDidCompositeOpen = this._register(( new Emitter()));
36
+ this.onDidCompositeClose = this._register(( new Emitter()));
37
+ this.mapCompositeToCompositeContainer = ( new Map());
38
+ this.mapActionsBindingToComposite = ( new Map());
39
+ this.instantiatedCompositeItems = ( new Map());
40
+ this.actionsListener = this._register(( new MutableDisposable()));
41
+ this.lastActiveCompositeId = storageService.get(activeCompositeSettingsKey, 1 , this.defaultCompositeId);
42
+ this.toolbarHoverDelegate = this._register(createInstantHoverDelegate());
43
+ }
44
+ openComposite(id, focus) {
45
+ if (this.activeComposite?.getId() === id) {
46
+ if (focus) {
47
+ this.activeComposite.focus();
48
+ }
49
+ return this.activeComposite;
50
+ }
51
+ if (!this.element) {
52
+ return;
53
+ }
54
+ return this.doOpenComposite(id, focus);
55
+ }
56
+ doOpenComposite(id, focus = false) {
57
+ const currentCompositeOpenToken = defaultGenerator.nextId();
58
+ this.currentCompositeOpenToken = currentCompositeOpenToken;
59
+ if (this.activeComposite) {
60
+ this.hideActiveComposite();
61
+ }
62
+ this.updateTitle(id);
63
+ const composite = this.createComposite(id, true);
64
+ if ((this.currentCompositeOpenToken !== currentCompositeOpenToken) || (this.activeComposite && this.activeComposite.getId() !== composite.getId())) {
65
+ return undefined;
66
+ }
67
+ if (this.activeComposite?.getId() === composite.getId()) {
68
+ if (focus) {
69
+ composite.focus();
70
+ }
71
+ this.onDidCompositeOpen.fire({ composite, focus });
72
+ return composite;
73
+ }
74
+ this.showComposite(composite);
75
+ if (focus) {
76
+ composite.focus();
77
+ }
78
+ if (composite) {
79
+ this.onDidCompositeOpen.fire({ composite, focus });
80
+ }
81
+ return composite;
82
+ }
83
+ createComposite(id, isActive) {
84
+ const compositeItem = this.instantiatedCompositeItems.get(id);
85
+ if (compositeItem) {
86
+ return compositeItem.composite;
87
+ }
88
+ const compositeDescriptor = this.registry.getComposite(id);
89
+ if (compositeDescriptor) {
90
+ const that = this;
91
+ const compositeProgressIndicator = ( new ScopedProgressIndicator(
92
+ assertIsDefined(this.progressBar),
93
+ new (class extends AbstractProgressScope {
94
+ constructor() {
95
+ super(compositeDescriptor.id, !!isActive);
96
+ this._register(that.onDidCompositeOpen.event(e => this.onScopeOpened(e.composite.getId())));
97
+ this._register(that.onDidCompositeClose.event(e => this.onScopeClosed(e.getId())));
98
+ }
99
+ })()
100
+ ));
101
+ const compositeInstantiationService = this.instantiationService.createChild(( new ServiceCollection(
102
+ [IEditorProgressService, compositeProgressIndicator]
103
+ )));
104
+ const composite = compositeDescriptor.instantiate(compositeInstantiationService);
105
+ const disposable = ( new DisposableStore());
106
+ this.instantiatedCompositeItems.set(id, { composite, disposable, progress: compositeProgressIndicator });
107
+ disposable.add(composite.onTitleAreaUpdate(() => this.onTitleAreaUpdate(composite.getId()), this));
108
+ return composite;
109
+ }
110
+ throw new Error(`Unable to find composite with id ${id}`);
111
+ }
112
+ showComposite(composite) {
113
+ this.activeComposite = composite;
114
+ const id = this.activeComposite.getId();
115
+ if (id !== this.defaultCompositeId) {
116
+ this.storageService.store(this.activeCompositeSettingsKey, id, 1 , 1 );
117
+ }
118
+ else {
119
+ this.storageService.remove(this.activeCompositeSettingsKey, 1 );
120
+ }
121
+ this.lastActiveCompositeId = this.activeComposite.getId();
122
+ let compositeContainer = this.mapCompositeToCompositeContainer.get(composite.getId());
123
+ if (!compositeContainer) {
124
+ compositeContainer = $('.composite');
125
+ compositeContainer.classList.add(...this.compositeCSSClass.split(' '));
126
+ compositeContainer.id = composite.getId();
127
+ composite.create(compositeContainer);
128
+ composite.updateStyles();
129
+ this.mapCompositeToCompositeContainer.set(composite.getId(), compositeContainer);
130
+ }
131
+ if (!this.activeComposite || composite.getId() !== this.activeComposite.getId()) {
132
+ return undefined;
133
+ }
134
+ const contentArea = this.getContentArea();
135
+ contentArea?.appendChild(compositeContainer);
136
+ show(compositeContainer);
137
+ const toolBar = assertIsDefined(this.toolBar);
138
+ toolBar.actionRunner = composite.getActionRunner();
139
+ const descriptor = this.registry.getComposite(composite.getId());
140
+ if (descriptor && descriptor.name !== composite.getTitle()) {
141
+ this.updateTitle(composite.getId(), composite.getTitle());
142
+ }
143
+ let actionsBinding = this.mapActionsBindingToComposite.get(composite.getId());
144
+ if (!actionsBinding) {
145
+ actionsBinding = this.collectCompositeActions(composite);
146
+ this.mapActionsBindingToComposite.set(composite.getId(), actionsBinding);
147
+ }
148
+ actionsBinding();
149
+ this.actionsListener.value = toolBar.actionRunner.onDidRun(e => {
150
+ if (e.error && !isCancellationError(e.error)) {
151
+ this.notificationService.error(e.error);
152
+ }
153
+ });
154
+ composite.setVisible(true);
155
+ if (!this.activeComposite || composite.getId() !== this.activeComposite.getId()) {
156
+ return;
157
+ }
158
+ if (this.contentAreaSize) {
159
+ composite.layout(this.contentAreaSize);
160
+ }
161
+ if (this.boundarySashes) {
162
+ composite.setBoundarySashes(this.boundarySashes);
163
+ }
164
+ }
165
+ onTitleAreaUpdate(compositeId) {
166
+ const composite = this.instantiatedCompositeItems.get(compositeId);
167
+ if (composite) {
168
+ this.updateTitle(compositeId, composite.composite.getTitle());
169
+ }
170
+ if (this.activeComposite?.getId() === compositeId) {
171
+ const actionsBinding = this.collectCompositeActions(this.activeComposite);
172
+ this.mapActionsBindingToComposite.set(this.activeComposite.getId(), actionsBinding);
173
+ actionsBinding();
174
+ }
175
+ else {
176
+ this.mapActionsBindingToComposite.delete(compositeId);
177
+ }
178
+ }
179
+ updateTitle(compositeId, compositeTitle) {
180
+ const compositeDescriptor = this.registry.getComposite(compositeId);
181
+ if (!compositeDescriptor || !this.titleLabel) {
182
+ return;
183
+ }
184
+ if (!compositeTitle) {
185
+ compositeTitle = compositeDescriptor.name;
186
+ }
187
+ const keybinding = this.keybindingService.lookupKeybinding(compositeId);
188
+ this.titleLabel.updateTitle(compositeId, compositeTitle, keybinding?.getLabel() ?? undefined);
189
+ const toolBar = assertIsDefined(this.toolBar);
190
+ toolBar.setAriaLabel(( localizeWithPath(
191
+ 'vs/workbench/browser/parts/compositePart',
192
+ 'ariaCompositeToolbarLabel',
193
+ "{0} actions",
194
+ compositeTitle
195
+ )));
196
+ }
197
+ collectCompositeActions(composite) {
198
+ const menuIds = composite?.getMenuIds();
199
+ const primaryActions = composite?.getActions().slice(0) || [];
200
+ const secondaryActions = composite?.getSecondaryActions().slice(0) || [];
201
+ const toolBar = assertIsDefined(this.toolBar);
202
+ toolBar.context = this.actionsContextProvider();
203
+ return () => toolBar.setActions(prepareActions(primaryActions), prepareActions(secondaryActions), menuIds);
204
+ }
205
+ getActiveComposite() {
206
+ return this.activeComposite;
207
+ }
208
+ getLastActiveCompositeId() {
209
+ return this.lastActiveCompositeId;
210
+ }
211
+ hideActiveComposite() {
212
+ if (!this.activeComposite) {
213
+ return undefined;
214
+ }
215
+ const composite = this.activeComposite;
216
+ this.activeComposite = undefined;
217
+ const compositeContainer = this.mapCompositeToCompositeContainer.get(composite.getId());
218
+ composite.setVisible(false);
219
+ if (compositeContainer) {
220
+ compositeContainer.remove();
221
+ hide(compositeContainer);
222
+ }
223
+ this.progressBar?.stop().hide();
224
+ if (this.toolBar) {
225
+ this.collectCompositeActions()();
226
+ }
227
+ this.onDidCompositeClose.fire(composite);
228
+ return composite;
229
+ }
230
+ createTitleArea(parent) {
231
+ const titleArea = append(parent, $('.composite'));
232
+ titleArea.classList.add('title');
233
+ this.titleLabel = this.createTitleLabel(titleArea);
234
+ const titleActionsContainer = append(titleArea, $('.title-actions'));
235
+ this.toolBar = this._register(this.instantiationService.createInstance(WorkbenchToolBar, titleActionsContainer, {
236
+ actionViewItemProvider: (action, options) => this.actionViewItemProvider(action, options),
237
+ orientation: 0 ,
238
+ getKeyBinding: action => this.keybindingService.lookupKeybinding(action.id),
239
+ anchorAlignmentProvider: () => this.getTitleAreaDropDownAnchorAlignment(),
240
+ toggleMenuTitle: ( localizeWithPath(
241
+ 'vs/workbench/browser/parts/compositePart',
242
+ 'viewsAndMoreActions',
243
+ "Views and More Actions..."
244
+ )),
245
+ telemetrySource: this.nameForTelemetry,
246
+ hoverDelegate: this.toolbarHoverDelegate
247
+ }));
248
+ this.collectCompositeActions()();
249
+ return titleArea;
250
+ }
251
+ createTitleLabel(parent) {
252
+ const titleContainer = append(parent, $('.title-label'));
253
+ const titleLabel = append(titleContainer, $('h2'));
254
+ this.titleLabelElement = titleLabel;
255
+ const hover = this._register(setupCustomHover(getDefaultHoverDelegate('mouse'), titleLabel, ''));
256
+ const $this = this;
257
+ return {
258
+ updateTitle: (id, title, keybinding) => {
259
+ if (!this.activeComposite || this.activeComposite.getId() === id) {
260
+ titleLabel.innerText = title;
261
+ hover.update(keybinding ? ( localizeWithPath(
262
+ 'vs/workbench/browser/parts/compositePart',
263
+ 'titleTooltip',
264
+ "{0} ({1})",
265
+ title,
266
+ keybinding
267
+ )) : title);
268
+ }
269
+ },
270
+ updateStyles: () => {
271
+ titleLabel.style.color = $this.titleForegroundColor ? $this.getColor($this.titleForegroundColor) || '' : '';
272
+ }
273
+ };
274
+ }
275
+ createHeaderArea() {
276
+ return $('.composite');
277
+ }
278
+ createFooterArea() {
279
+ return $('.composite');
280
+ }
281
+ updateStyles() {
282
+ super.updateStyles();
283
+ const titleLabel = assertIsDefined(this.titleLabel);
284
+ titleLabel.updateStyles();
285
+ }
286
+ actionViewItemProvider(action, options) {
287
+ if (this.activeComposite) {
288
+ return this.activeComposite.getActionViewItem(action, options);
289
+ }
290
+ return createActionViewItem(this.instantiationService, action, options);
291
+ }
292
+ actionsContextProvider() {
293
+ if (this.activeComposite) {
294
+ return this.activeComposite.getActionsContext();
295
+ }
296
+ return null;
297
+ }
298
+ createContentArea(parent) {
299
+ const contentContainer = append(parent, $('.content'));
300
+ this.progressBar = this._register(( new ProgressBar(contentContainer, defaultProgressBarStyles)));
301
+ this.progressBar.hide();
302
+ return contentContainer;
303
+ }
304
+ getProgressIndicator(id) {
305
+ const compositeItem = this.instantiatedCompositeItems.get(id);
306
+ return compositeItem ? compositeItem.progress : undefined;
307
+ }
308
+ getTitleAreaDropDownAnchorAlignment() {
309
+ return 1 ;
310
+ }
311
+ layout(width, height, top, left) {
312
+ super.layout(width, height, top, left);
313
+ this.contentAreaSize = Dimension.lift(super.layoutContents(width, height).contentSize);
314
+ this.activeComposite?.layout(this.contentAreaSize);
315
+ }
316
+ setBoundarySashes(sashes) {
317
+ this.boundarySashes = sashes;
318
+ this.activeComposite?.setBoundarySashes(sashes);
319
+ }
320
+ removeComposite(compositeId) {
321
+ if (this.activeComposite?.getId() === compositeId) {
322
+ return false;
323
+ }
324
+ this.mapCompositeToCompositeContainer.delete(compositeId);
325
+ this.mapActionsBindingToComposite.delete(compositeId);
326
+ const compositeItem = this.instantiatedCompositeItems.get(compositeId);
327
+ if (compositeItem) {
328
+ compositeItem.composite.dispose();
329
+ dispose(compositeItem.disposable);
330
+ this.instantiatedCompositeItems.delete(compositeId);
331
+ }
332
+ return true;
333
+ }
334
+ dispose() {
335
+ this.mapCompositeToCompositeContainer.clear();
336
+ this.mapActionsBindingToComposite.clear();
337
+ this.instantiatedCompositeItems.forEach(compositeItem => {
338
+ compositeItem.composite.dispose();
339
+ dispose(compositeItem.disposable);
340
+ });
341
+ this.instantiatedCompositeItems.clear();
342
+ super.dispose();
343
+ }
344
+ }
345
+
346
+ export { CompositePart };
@@ -0,0 +1,246 @@
1
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
+ import { onDidChangeFullscreen } from 'vscode/vscode/vs/base/browser/browser';
3
+ import { show, hide } from 'vscode/vscode/vs/base/browser/dom';
4
+ import { Event, Emitter } from 'vscode/vscode/vs/base/common/event';
5
+ import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
6
+ import { isNative } from 'vscode/vscode/vs/base/common/platform';
7
+ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
8
+ import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
9
+ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
10
+ import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
11
+ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
12
+ import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
13
+ import { hasCustomTitlebar } from 'vscode/vscode/vs/platform/window/common/window';
14
+ import { EditorPart } from './editorPart.js';
15
+ import { WindowTitle } from 'vscode/vscode/vs/workbench/browser/parts/titlebar/windowTitle';
16
+ import { IAuxiliaryWindowService } from 'vscode/vscode/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.service';
17
+ import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
18
+ import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
19
+ import { shouldShowCustomTitleBar } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
20
+ import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
21
+ import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
22
+ import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
23
+ import { ITitleService } from 'vscode/vscode/vs/workbench/services/title/browser/titleService.service';
24
+
25
+ var AuxiliaryEditorPart_1, AuxiliaryEditorPartImpl_1;
26
+ let AuxiliaryEditorPart = class AuxiliaryEditorPart {
27
+ static { AuxiliaryEditorPart_1 = this; }
28
+ static { this.STATUS_BAR_VISIBILITY = 'workbench.statusBar.visible'; }
29
+ constructor(editorPartsView, instantiationService, auxiliaryWindowService, lifecycleService, configurationService, statusbarService, titleService, editorService, layoutService) {
30
+ this.editorPartsView = editorPartsView;
31
+ this.instantiationService = instantiationService;
32
+ this.auxiliaryWindowService = auxiliaryWindowService;
33
+ this.lifecycleService = lifecycleService;
34
+ this.configurationService = configurationService;
35
+ this.statusbarService = statusbarService;
36
+ this.titleService = titleService;
37
+ this.editorService = editorService;
38
+ this.layoutService = layoutService;
39
+ }
40
+ async create(label, options) {
41
+ function computeEditorPartHeightOffset() {
42
+ let editorPartHeightOffset = 0;
43
+ if (statusbarVisible) {
44
+ editorPartHeightOffset += statusbarPart.height;
45
+ }
46
+ if (titlebarPart && titlebarVisible) {
47
+ editorPartHeightOffset += titlebarPart.height;
48
+ }
49
+ return editorPartHeightOffset;
50
+ }
51
+ function updateStatusbarVisibility(fromEvent) {
52
+ if (statusbarVisible) {
53
+ show(statusbarPart.container);
54
+ }
55
+ else {
56
+ hide(statusbarPart.container);
57
+ }
58
+ if (fromEvent) {
59
+ auxiliaryWindow.layout();
60
+ }
61
+ }
62
+ function updateTitlebarVisibility(fromEvent) {
63
+ if (!titlebarPart) {
64
+ return;
65
+ }
66
+ if (titlebarVisible) {
67
+ show(titlebarPart.container);
68
+ }
69
+ else {
70
+ hide(titlebarPart.container);
71
+ }
72
+ if (fromEvent) {
73
+ auxiliaryWindow.layout();
74
+ }
75
+ }
76
+ const disposables = ( new DisposableStore());
77
+ const auxiliaryWindow = disposables.add(await this.auxiliaryWindowService.open(options));
78
+ const editorPartContainer = document.createElement('div');
79
+ editorPartContainer.classList.add('part', 'editor');
80
+ editorPartContainer.setAttribute('role', 'main');
81
+ editorPartContainer.style.position = 'relative';
82
+ auxiliaryWindow.container.appendChild(editorPartContainer);
83
+ const editorPart = disposables.add(this.instantiationService.createInstance(AuxiliaryEditorPartImpl, auxiliaryWindow.window.vscodeWindowId, this.editorPartsView, options?.state, label));
84
+ disposables.add(this.editorPartsView.registerPart(editorPart));
85
+ editorPart.create(editorPartContainer);
86
+ let titlebarPart = undefined;
87
+ let titlebarVisible = false;
88
+ const useCustomTitle = isNative && hasCustomTitlebar();
89
+ if (useCustomTitle) {
90
+ titlebarPart = disposables.add(this.titleService.createAuxiliaryTitlebarPart(auxiliaryWindow.container, editorPart));
91
+ titlebarVisible = shouldShowCustomTitleBar(this.configurationService, auxiliaryWindow.window);
92
+ const handleTitleBarVisibilityEvent = () => {
93
+ const oldTitlebarPartVisible = titlebarVisible;
94
+ titlebarVisible = shouldShowCustomTitleBar(this.configurationService, auxiliaryWindow.window);
95
+ if (oldTitlebarPartVisible !== titlebarVisible) {
96
+ updateTitlebarVisibility(true);
97
+ }
98
+ };
99
+ disposables.add(titlebarPart.onDidChange(() => auxiliaryWindow.layout()));
100
+ disposables.add(this.layoutService.onDidChangePartVisibility(() => handleTitleBarVisibilityEvent()));
101
+ disposables.add(onDidChangeFullscreen(windowId => {
102
+ if (windowId !== auxiliaryWindow.window.vscodeWindowId) {
103
+ return;
104
+ }
105
+ handleTitleBarVisibilityEvent();
106
+ }));
107
+ updateTitlebarVisibility(false);
108
+ }
109
+ else {
110
+ disposables.add(this.instantiationService.createInstance(WindowTitle, auxiliaryWindow.window, editorPart));
111
+ }
112
+ const statusbarPart = disposables.add(this.statusbarService.createAuxiliaryStatusbarPart(auxiliaryWindow.container));
113
+ let statusbarVisible = this.configurationService.getValue(AuxiliaryEditorPart_1.STATUS_BAR_VISIBILITY) !== false;
114
+ disposables.add(this.configurationService.onDidChangeConfiguration(e => {
115
+ if (e.affectsConfiguration(AuxiliaryEditorPart_1.STATUS_BAR_VISIBILITY)) {
116
+ statusbarVisible = this.configurationService.getValue(AuxiliaryEditorPart_1.STATUS_BAR_VISIBILITY) !== false;
117
+ updateStatusbarVisibility(true);
118
+ }
119
+ }));
120
+ updateStatusbarVisibility(false);
121
+ const editorCloseListener = disposables.add(Event.once(editorPart.onWillClose)(() => auxiliaryWindow.window.close()));
122
+ disposables.add(Event.once(auxiliaryWindow.onUnload)(() => {
123
+ if (disposables.isDisposed) {
124
+ return;
125
+ }
126
+ editorCloseListener.dispose();
127
+ editorPart.close();
128
+ disposables.dispose();
129
+ }));
130
+ disposables.add(Event.once(this.lifecycleService.onDidShutdown)(() => disposables.dispose()));
131
+ disposables.add(auxiliaryWindow.onBeforeUnload(event => {
132
+ for (const group of editorPart.groups) {
133
+ for (const editor of group.editors) {
134
+ const canMoveVeto = editor.canMove(group.id, this.editorPartsView.mainPart.activeGroup.id);
135
+ if (typeof canMoveVeto === 'string') {
136
+ group.openEditor(editor);
137
+ event.veto(canMoveVeto);
138
+ break;
139
+ }
140
+ }
141
+ }
142
+ }));
143
+ disposables.add(auxiliaryWindow.onWillLayout(dimension => {
144
+ const titlebarPartHeight = titlebarPart?.height ?? 0;
145
+ titlebarPart?.layout(dimension.width, titlebarPartHeight, 0, 0);
146
+ const editorPartHeight = dimension.height - computeEditorPartHeightOffset();
147
+ editorPart.layout(dimension.width, editorPartHeight, titlebarPartHeight, 0);
148
+ statusbarPart.layout(dimension.width, statusbarPart.height, dimension.height - statusbarPart.height, 0);
149
+ }));
150
+ auxiliaryWindow.layout();
151
+ const instantiationService = this.instantiationService.createChild(( new ServiceCollection(
152
+ [IStatusbarService, this.statusbarService.createScoped(statusbarPart, disposables)],
153
+ [IEditorService, this.editorService.createScoped(editorPart, disposables)]
154
+ )));
155
+ return {
156
+ part: editorPart,
157
+ instantiationService,
158
+ disposables
159
+ };
160
+ }
161
+ };
162
+ AuxiliaryEditorPart = AuxiliaryEditorPart_1 = ( __decorate([
163
+ ( __param(1, IInstantiationService)),
164
+ ( __param(2, IAuxiliaryWindowService)),
165
+ ( __param(3, ILifecycleService)),
166
+ ( __param(4, IConfigurationService)),
167
+ ( __param(5, IStatusbarService)),
168
+ ( __param(6, ITitleService)),
169
+ ( __param(7, IEditorService)),
170
+ ( __param(8, IWorkbenchLayoutService))
171
+ ], AuxiliaryEditorPart));
172
+ let AuxiliaryEditorPartImpl = class AuxiliaryEditorPartImpl extends EditorPart {
173
+ static { AuxiliaryEditorPartImpl_1 = this; }
174
+ static { this.COUNTER = 1; }
175
+ constructor(windowId, editorPartsView, state, groupsLabel, instantiationService, themeService, configurationService, storageService, layoutService, hostService, contextKeyService) {
176
+ const id = AuxiliaryEditorPartImpl_1.COUNTER++;
177
+ super(editorPartsView, `workbench.parts.auxiliaryEditor.${id}`, groupsLabel, windowId, instantiationService, themeService, configurationService, storageService, layoutService, hostService, contextKeyService);
178
+ this.state = state;
179
+ this._onWillClose = this._register(( new Emitter()));
180
+ this.onWillClose = this._onWillClose.event;
181
+ }
182
+ removeGroup(group, preserveFocus) {
183
+ const groupView = this.assertGroupView(group);
184
+ if (this.count === 1 && this.activeGroup === groupView) {
185
+ this.doRemoveLastGroup(preserveFocus);
186
+ }
187
+ else {
188
+ super.removeGroup(group, preserveFocus);
189
+ }
190
+ }
191
+ doRemoveLastGroup(preserveFocus) {
192
+ const restoreFocus = !preserveFocus && this.shouldRestoreFocus(this.container);
193
+ const mostRecentlyActiveGroups = this.editorPartsView.getGroups(1 );
194
+ const nextActiveGroup = mostRecentlyActiveGroups[1];
195
+ if (nextActiveGroup) {
196
+ nextActiveGroup.groupsView.activateGroup(nextActiveGroup);
197
+ if (restoreFocus) {
198
+ nextActiveGroup.focus();
199
+ }
200
+ }
201
+ this.doClose(false );
202
+ }
203
+ loadState() {
204
+ return this.state;
205
+ }
206
+ saveState() {
207
+ return;
208
+ }
209
+ close() {
210
+ this.doClose(true );
211
+ }
212
+ doClose(mergeGroupsToMainPart) {
213
+ if (mergeGroupsToMainPart) {
214
+ this.mergeGroupsToMainPart();
215
+ }
216
+ this._onWillClose.fire();
217
+ }
218
+ mergeGroupsToMainPart() {
219
+ if (!( this.groups.some(group => group.count > 0))) {
220
+ return;
221
+ }
222
+ let targetGroup = undefined;
223
+ for (const group of this.editorPartsView.mainPart.getGroups(1 )) {
224
+ if (!group.isLocked) {
225
+ targetGroup = group;
226
+ break;
227
+ }
228
+ }
229
+ if (!targetGroup) {
230
+ targetGroup = this.editorPartsView.mainPart.addGroup(this.editorPartsView.mainPart.activeGroup, this.partOptions.openSideBySideDirection === 'right' ? 3 : 1 );
231
+ }
232
+ this.mergeAllGroups(targetGroup);
233
+ targetGroup.focus();
234
+ }
235
+ };
236
+ AuxiliaryEditorPartImpl = AuxiliaryEditorPartImpl_1 = ( __decorate([
237
+ ( __param(4, IInstantiationService)),
238
+ ( __param(5, IThemeService)),
239
+ ( __param(6, IConfigurationService)),
240
+ ( __param(7, IStorageService)),
241
+ ( __param(8, IWorkbenchLayoutService)),
242
+ ( __param(9, IHostService)),
243
+ ( __param(10, IContextKeyService))
244
+ ], AuxiliaryEditorPartImpl));
245
+
246
+ export { AuxiliaryEditorPart };