@codingame/monaco-vscode-api 2.1.4 → 2.2.0-next.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.
- package/README.md +2 -0
- package/contributions.js +1 -0
- package/extensions.d.ts +6 -3
- package/extensions.js +18 -7
- package/lifecycle.js +11 -3
- package/missing-services.js +55 -10
- package/monaco.js +7 -3
- package/package.json +8 -8
- package/service-override/tools/views.d.ts +98 -0
- package/service-override/tools/views.js +249 -0
- package/services.d.ts +4 -2
- package/services.js +11 -9
- package/vscode/src/vs/base/browser/deviceAccess.js +60 -0
- package/vscode/src/vs/base/browser/dom.js +18 -1
- package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +178 -0
- package/vscode/src/vs/base/browser/ui/grid/grid.js +492 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +4 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.d.ts +1 -0
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +1109 -0
- package/vscode/src/vs/base/browser/ui/sash/sash.js +9 -1
- package/vscode/src/vs/base/browser/ui/splitview/splitview.d.ts +348 -1
- package/vscode/src/vs/base/common/async.js +46 -2
- package/vscode/src/vs/base/common/codicons.d.ts +579 -0
- package/vscode/src/vs/base/common/event.js +11 -2
- package/vscode/src/vs/base/common/keybindingParser.js +87 -0
- package/vscode/src/vs/base/common/network.js +1 -2
- package/vscode/src/vs/base/common/observableInternal/utils.js +1 -1
- package/vscode/src/vs/base/common/platform.js +2 -1
- package/vscode/src/vs/base/common/scrollable.d.ts +28 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/colors.js +17 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/diffEditorItemTemplate.js +214 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorViewModel.js +84 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidget.js +54 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidgetImpl.js +324 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/objectPool.js +46 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/style.css.js +4 -0
- package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/utils.js +11 -0
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardLayout.js +61 -1
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +10 -0
- package/vscode/src/vs/platform/log/browser/log.js +24 -0
- package/vscode/src/vs/platform/product/common/product.js +1 -2
- package/vscode/src/vs/platform/userDataSync/common/abstractSynchronizer.js +772 -0
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncStoreService.js +551 -0
- package/vscode/src/vs/platform/webview/common/mimeTypes.js +22 -0
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +62 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +788 -0
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +763 -0
- package/vscode/src/vs/workbench/browser/layout.d.ts +26 -0
- package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +610 -0
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +148 -0
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +603 -0
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +333 -0
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +221 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +1406 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +184 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +509 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +112 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +1018 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +389 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsActions.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsList.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +213 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +73 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +307 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +226 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +218 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +433 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +436 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +643 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +377 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +66 -0
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +144 -0
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +220 -0
- package/vscode/src/vs/workbench/browser/window.js +239 -5
- package/vscode/src/vs/workbench/common/configuration.js +11 -1
- package/vscode/src/vs/workbench/common/theme.js +3 -3
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +298 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +363 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +133 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +90 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentMenus.js +43 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentService.js +317 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +107 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +395 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +3 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1277 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +17 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +123 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +342 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +451 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +176 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +35 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +16 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +143 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +212 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +76 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +61 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +117 -0
- package/vscode/src/vs/workbench/contrib/editSessions/common/editSessions.js +62 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +5 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +77 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +72 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +254 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +97 -0
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +442 -0
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +430 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +784 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +487 -0
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +521 -0
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +150 -0
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +61 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js +25 -1
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +178 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +49 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +408 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +145 -0
- package/vscode/src/vs/workbench/contrib/mappedEdits/common/mappedEdits.contribution.js +22 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +691 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +238 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +76 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +40 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +69 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +346 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +96 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +144 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +103 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +399 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +195 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +39 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +126 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +611 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +156 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +262 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +171 -0
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.js +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +317 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +56 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +315 -0
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +193 -0
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +2 -1
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +37 -0
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.js +39 -0
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +138 -2
- package/vscode/src/vs/workbench/contrib/tags/browser/workspaceTagsService.js +12 -0
- package/vscode/src/vs/workbench/contrib/tags/common/workspaceTags.js +3 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +281 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +358 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +131 -0
- package/vscode/src/vs/workbench/contrib/update/common/update.js +2 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +288 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +94 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +86 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +77 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +646 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +63 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +57 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +140 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +119 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +67 -0
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +233 -0
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +143 -0
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +0 -3
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +184 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +668 -0
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +1482 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +17 -1
- package/vscode/src/vs/workbench/services/lifecycle/common/lifecycle.js +8 -1
- package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +4 -0
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +521 -0
- package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +102 -0
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +296 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +99 -0
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +711 -0
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +596 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import './media/notificationsActions.css.js';
|
|
3
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
4
|
+
import { Action } from '../../../../base/common/actions.js';
|
|
5
|
+
import { CLEAR_NOTIFICATION, CLEAR_ALL_NOTIFICATIONS, TOGGLE_DO_NOT_DISTURB_MODE, TOGGLE_DO_NOT_DISTURB_MODE_BY_SOURCE, HIDE_NOTIFICATIONS_CENTER, EXPAND_NOTIFICATION, COLLAPSE_NOTIFICATION } from './notificationsCommands.js';
|
|
6
|
+
import { ICommandService } from '../../../../platform/commands/common/commands.js';
|
|
7
|
+
import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';
|
|
8
|
+
import { Codicon } from '../../../../base/common/codicons.js';
|
|
9
|
+
import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';
|
|
10
|
+
import { ThemeIcon } from '../../../../base/common/themables.js';
|
|
11
|
+
const clearIcon = registerIcon('notifications-clear', Codicon.close, ( localizeWithPath(
|
|
12
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
13
|
+
'clearIcon',
|
|
14
|
+
'Icon for the clear action in notifications.'
|
|
15
|
+
)));
|
|
16
|
+
const clearAllIcon = registerIcon('notifications-clear-all', Codicon.clearAll, ( localizeWithPath(
|
|
17
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
18
|
+
'clearAllIcon',
|
|
19
|
+
'Icon for the clear all action in notifications.'
|
|
20
|
+
)));
|
|
21
|
+
const hideIcon = registerIcon('notifications-hide', Codicon.chevronDown, ( localizeWithPath(
|
|
22
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
23
|
+
'hideIcon',
|
|
24
|
+
'Icon for the hide action in notifications.'
|
|
25
|
+
)));
|
|
26
|
+
const expandIcon = registerIcon('notifications-expand', Codicon.chevronUp, ( localizeWithPath(
|
|
27
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
28
|
+
'expandIcon',
|
|
29
|
+
'Icon for the expand action in notifications.'
|
|
30
|
+
)));
|
|
31
|
+
const collapseIcon = registerIcon('notifications-collapse', Codicon.chevronDown, ( localizeWithPath(
|
|
32
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
33
|
+
'collapseIcon',
|
|
34
|
+
'Icon for the collapse action in notifications.'
|
|
35
|
+
)));
|
|
36
|
+
const configureIcon = registerIcon('notifications-configure', Codicon.gear, ( localizeWithPath(
|
|
37
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
38
|
+
'configureIcon',
|
|
39
|
+
'Icon for the configure action in notifications.'
|
|
40
|
+
)));
|
|
41
|
+
const doNotDisturbIcon = registerIcon('notifications-do-not-disturb', Codicon.bellSlash, ( localizeWithPath(
|
|
42
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
43
|
+
'doNotDisturbIcon',
|
|
44
|
+
'Icon for the mute all action in notifications.'
|
|
45
|
+
)));
|
|
46
|
+
let ClearNotificationAction = class ClearNotificationAction extends Action {
|
|
47
|
+
static { this.ID = CLEAR_NOTIFICATION; }
|
|
48
|
+
static { this.LABEL = ( localizeWithPath(
|
|
49
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
50
|
+
'clearNotification',
|
|
51
|
+
"Clear Notification"
|
|
52
|
+
)); }
|
|
53
|
+
constructor(id, label, commandService) {
|
|
54
|
+
super(id, label, ThemeIcon.asClassName(clearIcon));
|
|
55
|
+
this.commandService = commandService;
|
|
56
|
+
}
|
|
57
|
+
async run(notification) {
|
|
58
|
+
this.commandService.executeCommand(CLEAR_NOTIFICATION, notification);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
ClearNotificationAction = ( __decorate([
|
|
62
|
+
( __param(2, ICommandService))
|
|
63
|
+
], ClearNotificationAction));
|
|
64
|
+
let ClearAllNotificationsAction = class ClearAllNotificationsAction extends Action {
|
|
65
|
+
static { this.ID = CLEAR_ALL_NOTIFICATIONS; }
|
|
66
|
+
static { this.LABEL = ( localizeWithPath(
|
|
67
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
68
|
+
'clearNotifications',
|
|
69
|
+
"Clear All Notifications"
|
|
70
|
+
)); }
|
|
71
|
+
constructor(id, label, commandService) {
|
|
72
|
+
super(id, label, ThemeIcon.asClassName(clearAllIcon));
|
|
73
|
+
this.commandService = commandService;
|
|
74
|
+
}
|
|
75
|
+
async run() {
|
|
76
|
+
this.commandService.executeCommand(CLEAR_ALL_NOTIFICATIONS);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
ClearAllNotificationsAction = ( __decorate([
|
|
80
|
+
( __param(2, ICommandService))
|
|
81
|
+
], ClearAllNotificationsAction));
|
|
82
|
+
let ToggleDoNotDisturbAction = class ToggleDoNotDisturbAction extends Action {
|
|
83
|
+
static { this.ID = TOGGLE_DO_NOT_DISTURB_MODE; }
|
|
84
|
+
static { this.LABEL = ( localizeWithPath(
|
|
85
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
86
|
+
'toggleDoNotDisturbMode',
|
|
87
|
+
"Toggle Do Not Disturb Mode"
|
|
88
|
+
)); }
|
|
89
|
+
constructor(id, label, commandService) {
|
|
90
|
+
super(id, label, ThemeIcon.asClassName(doNotDisturbIcon));
|
|
91
|
+
this.commandService = commandService;
|
|
92
|
+
}
|
|
93
|
+
async run() {
|
|
94
|
+
this.commandService.executeCommand(TOGGLE_DO_NOT_DISTURB_MODE);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
ToggleDoNotDisturbAction = ( __decorate([
|
|
98
|
+
( __param(2, ICommandService))
|
|
99
|
+
], ToggleDoNotDisturbAction));
|
|
100
|
+
let ToggleDoNotDisturbBySourceAction = class ToggleDoNotDisturbBySourceAction extends Action {
|
|
101
|
+
static { this.ID = TOGGLE_DO_NOT_DISTURB_MODE_BY_SOURCE; }
|
|
102
|
+
static { this.LABEL = ( localizeWithPath(
|
|
103
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
104
|
+
'toggleDoNotDisturbModeBySource',
|
|
105
|
+
"Toggle Do Not Disturb Mode By Source..."
|
|
106
|
+
)); }
|
|
107
|
+
constructor(id, label, commandService) {
|
|
108
|
+
super(id, label);
|
|
109
|
+
this.commandService = commandService;
|
|
110
|
+
}
|
|
111
|
+
async run() {
|
|
112
|
+
this.commandService.executeCommand(TOGGLE_DO_NOT_DISTURB_MODE_BY_SOURCE);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
ToggleDoNotDisturbBySourceAction = ( __decorate([
|
|
116
|
+
( __param(2, ICommandService))
|
|
117
|
+
], ToggleDoNotDisturbBySourceAction));
|
|
118
|
+
class ConfigureDoNotDisturbAction extends Action {
|
|
119
|
+
static { this.ID = 'workbench.action.configureDoNotDisturbMode'; }
|
|
120
|
+
static { this.LABEL = ( localizeWithPath(
|
|
121
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
122
|
+
'configureDoNotDisturbMode',
|
|
123
|
+
"Configure Do Not Disturb..."
|
|
124
|
+
)); }
|
|
125
|
+
constructor(id, label) {
|
|
126
|
+
super(id, label, ThemeIcon.asClassName(doNotDisturbIcon));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
let HideNotificationsCenterAction = class HideNotificationsCenterAction extends Action {
|
|
130
|
+
static { this.ID = HIDE_NOTIFICATIONS_CENTER; }
|
|
131
|
+
static { this.LABEL = ( localizeWithPath(
|
|
132
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
133
|
+
'hideNotificationsCenter',
|
|
134
|
+
"Hide Notifications"
|
|
135
|
+
)); }
|
|
136
|
+
constructor(id, label, commandService) {
|
|
137
|
+
super(id, label, ThemeIcon.asClassName(hideIcon));
|
|
138
|
+
this.commandService = commandService;
|
|
139
|
+
}
|
|
140
|
+
async run() {
|
|
141
|
+
this.commandService.executeCommand(HIDE_NOTIFICATIONS_CENTER);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
HideNotificationsCenterAction = ( __decorate([
|
|
145
|
+
( __param(2, ICommandService))
|
|
146
|
+
], HideNotificationsCenterAction));
|
|
147
|
+
let ExpandNotificationAction = class ExpandNotificationAction extends Action {
|
|
148
|
+
static { this.ID = EXPAND_NOTIFICATION; }
|
|
149
|
+
static { this.LABEL = ( localizeWithPath(
|
|
150
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
151
|
+
'expandNotification',
|
|
152
|
+
"Expand Notification"
|
|
153
|
+
)); }
|
|
154
|
+
constructor(id, label, commandService) {
|
|
155
|
+
super(id, label, ThemeIcon.asClassName(expandIcon));
|
|
156
|
+
this.commandService = commandService;
|
|
157
|
+
}
|
|
158
|
+
async run(notification) {
|
|
159
|
+
this.commandService.executeCommand(EXPAND_NOTIFICATION, notification);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
ExpandNotificationAction = ( __decorate([
|
|
163
|
+
( __param(2, ICommandService))
|
|
164
|
+
], ExpandNotificationAction));
|
|
165
|
+
let CollapseNotificationAction = class CollapseNotificationAction extends Action {
|
|
166
|
+
static { this.ID = COLLAPSE_NOTIFICATION; }
|
|
167
|
+
static { this.LABEL = ( localizeWithPath(
|
|
168
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
169
|
+
'collapseNotification',
|
|
170
|
+
"Collapse Notification"
|
|
171
|
+
)); }
|
|
172
|
+
constructor(id, label, commandService) {
|
|
173
|
+
super(id, label, ThemeIcon.asClassName(collapseIcon));
|
|
174
|
+
this.commandService = commandService;
|
|
175
|
+
}
|
|
176
|
+
async run(notification) {
|
|
177
|
+
this.commandService.executeCommand(COLLAPSE_NOTIFICATION, notification);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
CollapseNotificationAction = ( __decorate([
|
|
181
|
+
( __param(2, ICommandService))
|
|
182
|
+
], CollapseNotificationAction));
|
|
183
|
+
class ConfigureNotificationAction extends Action {
|
|
184
|
+
static { this.ID = 'workbench.action.configureNotification'; }
|
|
185
|
+
static { this.LABEL = ( localizeWithPath(
|
|
186
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
187
|
+
'configureNotification',
|
|
188
|
+
"More Actions..."
|
|
189
|
+
)); }
|
|
190
|
+
constructor(id, label, notification) {
|
|
191
|
+
super(id, label, ThemeIcon.asClassName(configureIcon));
|
|
192
|
+
this.notification = notification;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
let CopyNotificationMessageAction = class CopyNotificationMessageAction extends Action {
|
|
196
|
+
static { this.ID = 'workbench.action.copyNotificationMessage'; }
|
|
197
|
+
static { this.LABEL = ( localizeWithPath(
|
|
198
|
+
'vs/workbench/browser/parts/notifications/notificationsActions',
|
|
199
|
+
'copyNotification',
|
|
200
|
+
"Copy Text"
|
|
201
|
+
)); }
|
|
202
|
+
constructor(id, label, clipboardService) {
|
|
203
|
+
super(id, label);
|
|
204
|
+
this.clipboardService = clipboardService;
|
|
205
|
+
}
|
|
206
|
+
run(notification) {
|
|
207
|
+
return this.clipboardService.writeText(notification.message.raw);
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
CopyNotificationMessageAction = ( __decorate([
|
|
211
|
+
( __param(2, IClipboardService))
|
|
212
|
+
], CopyNotificationMessageAction));
|
|
213
|
+
export { ClearAllNotificationsAction, ClearNotificationAction, CollapseNotificationAction, ConfigureDoNotDisturbAction, ConfigureNotificationAction, CopyNotificationMessageAction, ExpandNotificationAction, HideNotificationsCenterAction, ToggleDoNotDisturbAction, ToggleDoNotDisturbBySourceAction };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { alert } from '../../../../base/browser/ui/aria/aria.js';
|
|
2
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
3
|
+
import { Disposable } from '../../../../base/common/lifecycle.js';
|
|
4
|
+
import { toErrorMessage } from '../../../../base/common/errorMessage.js';
|
|
5
|
+
import { Severity, NotificationPriority } from '../../../../platform/notification/common/notification.js';
|
|
6
|
+
import { Event } from '../../../../base/common/event.js';
|
|
7
|
+
class NotificationsAlerts extends Disposable {
|
|
8
|
+
constructor(model) {
|
|
9
|
+
super();
|
|
10
|
+
this.model = model;
|
|
11
|
+
for (const notification of model.notifications) {
|
|
12
|
+
this.triggerAriaAlert(notification);
|
|
13
|
+
}
|
|
14
|
+
this.registerListeners();
|
|
15
|
+
}
|
|
16
|
+
registerListeners() {
|
|
17
|
+
this._register(this.model.onDidChangeNotification(e => this.onDidChangeNotification(e)));
|
|
18
|
+
}
|
|
19
|
+
onDidChangeNotification(e) {
|
|
20
|
+
if (e.kind === 0 ) {
|
|
21
|
+
this.triggerAriaAlert(e.item);
|
|
22
|
+
if (e.item.severity === Severity.Error) {
|
|
23
|
+
if (e.item.message.original instanceof Error) {
|
|
24
|
+
console.error(e.item.message.original);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
console.error(toErrorMessage(( e.item.message.linkedText.toString()), true));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
triggerAriaAlert(notification) {
|
|
33
|
+
if (notification.priority === NotificationPriority.SILENT) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const listener = notification.onDidChangeContent(e => {
|
|
37
|
+
if (e.kind === 1 ) {
|
|
38
|
+
this.doTriggerAriaAlert(notification);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
Event.once(notification.onDidClose)(() => listener.dispose());
|
|
42
|
+
this.doTriggerAriaAlert(notification);
|
|
43
|
+
}
|
|
44
|
+
doTriggerAriaAlert(notification) {
|
|
45
|
+
let alertText;
|
|
46
|
+
if (notification.severity === Severity.Error) {
|
|
47
|
+
alertText = ( localizeWithPath(
|
|
48
|
+
'vs/workbench/browser/parts/notifications/notificationsAlerts',
|
|
49
|
+
'alertErrorMessage',
|
|
50
|
+
"Error: {0}",
|
|
51
|
+
( notification.message.linkedText.toString())
|
|
52
|
+
));
|
|
53
|
+
}
|
|
54
|
+
else if (notification.severity === Severity.Warning) {
|
|
55
|
+
alertText = ( localizeWithPath(
|
|
56
|
+
'vs/workbench/browser/parts/notifications/notificationsAlerts',
|
|
57
|
+
'alertWarningMessage',
|
|
58
|
+
"Warning: {0}",
|
|
59
|
+
( notification.message.linkedText.toString())
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
alertText = ( localizeWithPath(
|
|
64
|
+
'vs/workbench/browser/parts/notifications/notificationsAlerts',
|
|
65
|
+
'alertInfoMessage',
|
|
66
|
+
"Info: {0}",
|
|
67
|
+
( notification.message.linkedText.toString())
|
|
68
|
+
));
|
|
69
|
+
}
|
|
70
|
+
alert(alertText);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export { NotificationsAlerts };
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import './media/notificationsCenter.css.js';
|
|
3
|
+
import './media/notificationsActions.css.js';
|
|
4
|
+
import { NOTIFICATIONS_CENTER_BORDER, NOTIFICATIONS_CENTER_HEADER_FOREGROUND, NOTIFICATIONS_CENTER_HEADER_BACKGROUND } from '../../../common/theme.js';
|
|
5
|
+
import { Themable, IThemeService } from '../../../../platform/theme/common/themeService.js';
|
|
6
|
+
import { IWorkbenchLayoutService } from '../../../services/layout/browser/layoutService.js';
|
|
7
|
+
import { Emitter } from '../../../../base/common/event.js';
|
|
8
|
+
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
|
|
9
|
+
import { NotificationActionRunner } from './notificationsCommands.js';
|
|
10
|
+
import { NotificationsList } from './notificationsList.js';
|
|
11
|
+
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
12
|
+
import { Dimension, isAncestorOfActiveElement } from '../../../../base/browser/dom.js';
|
|
13
|
+
import { widgetShadow } from '../../../../platform/theme/common/colorRegistry.js';
|
|
14
|
+
import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js';
|
|
15
|
+
import { localizeWithPath } from '../../../../nls.js';
|
|
16
|
+
import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js';
|
|
17
|
+
import { ConfigureDoNotDisturbAction, ToggleDoNotDisturbAction, ToggleDoNotDisturbBySourceAction, ClearAllNotificationsAction, HideNotificationsCenterAction } from './notificationsActions.js';
|
|
18
|
+
import { toAction, Separator } from '../../../../base/common/actions.js';
|
|
19
|
+
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';
|
|
20
|
+
import { assertIsDefined, assertAllDefined } from '../../../../base/common/types.js';
|
|
21
|
+
import { NotificationsCenterVisibleContext } from '../../../common/contextkeys.js';
|
|
22
|
+
import { NotificationsFilter, INotificationService } from '../../../../platform/notification/common/notification.js';
|
|
23
|
+
import { mainWindow } from '../../../../base/browser/window.js';
|
|
24
|
+
import { IContextMenuService } from '../../../../platform/contextview/browser/contextView.js';
|
|
25
|
+
import { DropdownMenuActionViewItem } from '../../../../base/browser/ui/dropdown/dropdownActionViewItem.js';
|
|
26
|
+
import { AudioCue, IAudioCueService } from '../../../../platform/audioCues/browser/audioCueService.js';
|
|
27
|
+
var NotificationsCenter_1;
|
|
28
|
+
let NotificationsCenter = class NotificationsCenter extends Themable {
|
|
29
|
+
static { NotificationsCenter_1 = this; }
|
|
30
|
+
static { this.MAX_DIMENSIONS = ( new Dimension(450, 400)); }
|
|
31
|
+
static { this.MAX_NOTIFICATION_SOURCES = 10; }
|
|
32
|
+
constructor(container, model, themeService, instantiationService, layoutService, contextKeyService, editorGroupService, keybindingService, notificationService, audioCueService, contextMenuService) {
|
|
33
|
+
super(themeService);
|
|
34
|
+
this.container = container;
|
|
35
|
+
this.model = model;
|
|
36
|
+
this.instantiationService = instantiationService;
|
|
37
|
+
this.layoutService = layoutService;
|
|
38
|
+
this.contextKeyService = contextKeyService;
|
|
39
|
+
this.editorGroupService = editorGroupService;
|
|
40
|
+
this.keybindingService = keybindingService;
|
|
41
|
+
this.notificationService = notificationService;
|
|
42
|
+
this.audioCueService = audioCueService;
|
|
43
|
+
this.contextMenuService = contextMenuService;
|
|
44
|
+
this._onDidChangeVisibility = this._register(( new Emitter()));
|
|
45
|
+
this.onDidChangeVisibility = this._onDidChangeVisibility.event;
|
|
46
|
+
this.notificationsCenterVisibleContextKey = NotificationsCenterVisibleContext.bindTo(this.contextKeyService);
|
|
47
|
+
this.notificationsCenterVisibleContextKey = NotificationsCenterVisibleContext.bindTo(contextKeyService);
|
|
48
|
+
this.registerListeners();
|
|
49
|
+
}
|
|
50
|
+
registerListeners() {
|
|
51
|
+
this._register(this.model.onDidChangeNotification(e => this.onDidChangeNotification(e)));
|
|
52
|
+
this._register(this.layoutService.onDidLayoutMainContainer(dimension => this.layout(Dimension.lift(dimension))));
|
|
53
|
+
this._register(this.notificationService.onDidChangeFilter(() => this.onDidChangeFilter()));
|
|
54
|
+
}
|
|
55
|
+
onDidChangeFilter() {
|
|
56
|
+
if (this.notificationService.getFilter() === NotificationsFilter.ERROR) {
|
|
57
|
+
this.hide();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
get isVisible() {
|
|
61
|
+
return !!this._isVisible;
|
|
62
|
+
}
|
|
63
|
+
show() {
|
|
64
|
+
if (this._isVisible) {
|
|
65
|
+
const notificationsList = assertIsDefined(this.notificationsList);
|
|
66
|
+
notificationsList.show();
|
|
67
|
+
notificationsList.focusFirst();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (!this.notificationsCenterContainer) {
|
|
71
|
+
this.create();
|
|
72
|
+
}
|
|
73
|
+
this.updateTitle();
|
|
74
|
+
const [notificationsList, notificationsCenterContainer] = assertAllDefined(this.notificationsList, this.notificationsCenterContainer);
|
|
75
|
+
this._isVisible = true;
|
|
76
|
+
notificationsCenterContainer.classList.add('visible');
|
|
77
|
+
notificationsList.show();
|
|
78
|
+
this.layout(this.workbenchDimensions);
|
|
79
|
+
notificationsList.updateNotificationsList(0, 0, this.model.notifications);
|
|
80
|
+
notificationsList.focusFirst();
|
|
81
|
+
this.updateStyles();
|
|
82
|
+
this.model.notifications.forEach(notification => notification.updateVisibility(true));
|
|
83
|
+
this.notificationsCenterVisibleContextKey.set(true);
|
|
84
|
+
this._onDidChangeVisibility.fire();
|
|
85
|
+
}
|
|
86
|
+
updateTitle() {
|
|
87
|
+
const [notificationsCenterTitle, clearAllAction] = assertAllDefined(this.notificationsCenterTitle, this.clearAllAction);
|
|
88
|
+
if (this.model.notifications.length === 0) {
|
|
89
|
+
notificationsCenterTitle.textContent = ( localizeWithPath(
|
|
90
|
+
'vs/workbench/browser/parts/notifications/notificationsCenter',
|
|
91
|
+
'notificationsEmpty',
|
|
92
|
+
"No new notifications"
|
|
93
|
+
));
|
|
94
|
+
clearAllAction.enabled = false;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
notificationsCenterTitle.textContent = ( localizeWithPath(
|
|
98
|
+
'vs/workbench/browser/parts/notifications/notificationsCenter',
|
|
99
|
+
'notifications',
|
|
100
|
+
"Notifications"
|
|
101
|
+
));
|
|
102
|
+
clearAllAction.enabled = ( this.model.notifications.some(notification => !notification.hasProgress));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
create() {
|
|
106
|
+
this.notificationsCenterContainer = document.createElement('div');
|
|
107
|
+
this.notificationsCenterContainer.classList.add('notifications-center');
|
|
108
|
+
this.notificationsCenterHeader = document.createElement('div');
|
|
109
|
+
this.notificationsCenterHeader.classList.add('notifications-center-header');
|
|
110
|
+
this.notificationsCenterContainer.appendChild(this.notificationsCenterHeader);
|
|
111
|
+
this.notificationsCenterTitle = document.createElement('span');
|
|
112
|
+
this.notificationsCenterTitle.classList.add('notifications-center-header-title');
|
|
113
|
+
this.notificationsCenterHeader.appendChild(this.notificationsCenterTitle);
|
|
114
|
+
const toolbarContainer = document.createElement('div');
|
|
115
|
+
toolbarContainer.classList.add('notifications-center-header-toolbar');
|
|
116
|
+
this.notificationsCenterHeader.appendChild(toolbarContainer);
|
|
117
|
+
const actionRunner = this._register(this.instantiationService.createInstance(NotificationActionRunner));
|
|
118
|
+
const that = this;
|
|
119
|
+
const notificationsToolBar = this._register(( new ActionBar(toolbarContainer, {
|
|
120
|
+
ariaLabel: ( localizeWithPath(
|
|
121
|
+
'vs/workbench/browser/parts/notifications/notificationsCenter',
|
|
122
|
+
'notificationsToolbar',
|
|
123
|
+
"Notification Center Actions"
|
|
124
|
+
)),
|
|
125
|
+
actionRunner,
|
|
126
|
+
actionViewItemProvider: action => {
|
|
127
|
+
if (action.id === ConfigureDoNotDisturbAction.ID) {
|
|
128
|
+
return this._register(this.instantiationService.createInstance(DropdownMenuActionViewItem, action, {
|
|
129
|
+
getActions() {
|
|
130
|
+
const actions = [toAction({
|
|
131
|
+
id: ToggleDoNotDisturbAction.ID,
|
|
132
|
+
label: that.notificationService.getFilter() === NotificationsFilter.OFF ? ( localizeWithPath(
|
|
133
|
+
'vs/workbench/browser/parts/notifications/notificationsCenter',
|
|
134
|
+
'turnOnNotifications',
|
|
135
|
+
"Enable Do Not Disturb Mode"
|
|
136
|
+
)) : ( localizeWithPath(
|
|
137
|
+
'vs/workbench/browser/parts/notifications/notificationsCenter',
|
|
138
|
+
'turnOffNotifications',
|
|
139
|
+
"Disable Do Not Disturb Mode"
|
|
140
|
+
)),
|
|
141
|
+
run: () => that.notificationService.setFilter(that.notificationService.getFilter() === NotificationsFilter.OFF ? NotificationsFilter.ERROR : NotificationsFilter.OFF)
|
|
142
|
+
})];
|
|
143
|
+
const sortedFilters = that.notificationService.getFilters().sort((a, b) => a.label.localeCompare(b.label));
|
|
144
|
+
for (const source of sortedFilters.slice(0, NotificationsCenter_1.MAX_NOTIFICATION_SOURCES)) {
|
|
145
|
+
if (actions.length === 1) {
|
|
146
|
+
actions.push(( new Separator()));
|
|
147
|
+
}
|
|
148
|
+
actions.push(toAction({
|
|
149
|
+
id: `${ToggleDoNotDisturbAction.ID}.${source.id}`,
|
|
150
|
+
label: source.label,
|
|
151
|
+
checked: source.filter !== NotificationsFilter.ERROR,
|
|
152
|
+
run: () => that.notificationService.setFilter({
|
|
153
|
+
...source,
|
|
154
|
+
filter: source.filter === NotificationsFilter.ERROR ? NotificationsFilter.OFF : NotificationsFilter.ERROR
|
|
155
|
+
})
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
if (sortedFilters.length > NotificationsCenter_1.MAX_NOTIFICATION_SOURCES) {
|
|
159
|
+
actions.push(( new Separator()));
|
|
160
|
+
actions.push(that._register(that.instantiationService.createInstance(ToggleDoNotDisturbBySourceAction, ToggleDoNotDisturbBySourceAction.ID, ( localizeWithPath(
|
|
161
|
+
'vs/workbench/browser/parts/notifications/notificationsCenter',
|
|
162
|
+
'moreSources',
|
|
163
|
+
"More…"
|
|
164
|
+
)))));
|
|
165
|
+
}
|
|
166
|
+
return actions;
|
|
167
|
+
},
|
|
168
|
+
}, this.contextMenuService, {
|
|
169
|
+
actionRunner,
|
|
170
|
+
classNames: action.class,
|
|
171
|
+
keybindingProvider: action => this.keybindingService.lookupKeybinding(action.id)
|
|
172
|
+
}));
|
|
173
|
+
}
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
})));
|
|
177
|
+
this.clearAllAction = this._register(this.instantiationService.createInstance(ClearAllNotificationsAction, ClearAllNotificationsAction.ID, ClearAllNotificationsAction.LABEL));
|
|
178
|
+
notificationsToolBar.push(this.clearAllAction, { icon: true, label: false, keybinding: this.getKeybindingLabel(this.clearAllAction) });
|
|
179
|
+
this.configureDoNotDisturbAction = this._register(this.instantiationService.createInstance(ConfigureDoNotDisturbAction, ConfigureDoNotDisturbAction.ID, ConfigureDoNotDisturbAction.LABEL));
|
|
180
|
+
notificationsToolBar.push(this.configureDoNotDisturbAction, { icon: true, label: false });
|
|
181
|
+
const hideAllAction = this._register(this.instantiationService.createInstance(HideNotificationsCenterAction, HideNotificationsCenterAction.ID, HideNotificationsCenterAction.LABEL));
|
|
182
|
+
notificationsToolBar.push(hideAllAction, { icon: true, label: false, keybinding: this.getKeybindingLabel(hideAllAction) });
|
|
183
|
+
this.notificationsList = this.instantiationService.createInstance(NotificationsList, this.notificationsCenterContainer, {
|
|
184
|
+
widgetAriaLabel: ( localizeWithPath(
|
|
185
|
+
'vs/workbench/browser/parts/notifications/notificationsCenter',
|
|
186
|
+
'notificationsCenterWidgetAriaLabel',
|
|
187
|
+
"Notifications Center"
|
|
188
|
+
))
|
|
189
|
+
});
|
|
190
|
+
this.container.appendChild(this.notificationsCenterContainer);
|
|
191
|
+
}
|
|
192
|
+
getKeybindingLabel(action) {
|
|
193
|
+
const keybinding = this.keybindingService.lookupKeybinding(action.id);
|
|
194
|
+
return keybinding ? keybinding.getLabel() : null;
|
|
195
|
+
}
|
|
196
|
+
onDidChangeNotification(e) {
|
|
197
|
+
if (!this._isVisible) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
let focusEditor = false;
|
|
201
|
+
const [notificationsList, notificationsCenterContainer] = assertAllDefined(this.notificationsList, this.notificationsCenterContainer);
|
|
202
|
+
switch (e.kind) {
|
|
203
|
+
case 0 :
|
|
204
|
+
notificationsList.updateNotificationsList(e.index, 0, [e.item]);
|
|
205
|
+
e.item.updateVisibility(true);
|
|
206
|
+
break;
|
|
207
|
+
case 1 :
|
|
208
|
+
switch (e.detail) {
|
|
209
|
+
case 2 :
|
|
210
|
+
notificationsList.updateNotificationsList(e.index, 1, [e.item]);
|
|
211
|
+
break;
|
|
212
|
+
case 1 :
|
|
213
|
+
if (e.item.expanded) {
|
|
214
|
+
notificationsList.updateNotificationHeight(e.item);
|
|
215
|
+
}
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
break;
|
|
219
|
+
case 2 :
|
|
220
|
+
notificationsList.updateNotificationsList(e.index, 1, [e.item]);
|
|
221
|
+
break;
|
|
222
|
+
case 3 :
|
|
223
|
+
focusEditor = isAncestorOfActiveElement(notificationsCenterContainer);
|
|
224
|
+
notificationsList.updateNotificationsList(e.index, 1);
|
|
225
|
+
e.item.updateVisibility(false);
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
this.updateTitle();
|
|
229
|
+
if (this.model.notifications.length === 0) {
|
|
230
|
+
this.hide();
|
|
231
|
+
if (focusEditor) {
|
|
232
|
+
this.editorGroupService.activeGroup.focus();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
hide() {
|
|
237
|
+
if (!this._isVisible || !this.notificationsCenterContainer || !this.notificationsList) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
const focusEditor = isAncestorOfActiveElement(this.notificationsCenterContainer);
|
|
241
|
+
this._isVisible = false;
|
|
242
|
+
this.notificationsCenterContainer.classList.remove('visible');
|
|
243
|
+
this.notificationsList.hide();
|
|
244
|
+
this.model.notifications.forEach(notification => notification.updateVisibility(false));
|
|
245
|
+
this.notificationsCenterVisibleContextKey.set(false);
|
|
246
|
+
this._onDidChangeVisibility.fire();
|
|
247
|
+
if (focusEditor) {
|
|
248
|
+
this.editorGroupService.activeGroup.focus();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
updateStyles() {
|
|
252
|
+
if (this.notificationsCenterContainer && this.notificationsCenterHeader) {
|
|
253
|
+
const widgetShadowColor = this.getColor(widgetShadow);
|
|
254
|
+
this.notificationsCenterContainer.style.boxShadow = widgetShadowColor ? `0 0 8px 2px ${widgetShadowColor}` : '';
|
|
255
|
+
const borderColor = this.getColor(NOTIFICATIONS_CENTER_BORDER);
|
|
256
|
+
this.notificationsCenterContainer.style.border = borderColor ? `1px solid ${borderColor}` : '';
|
|
257
|
+
const headerForeground = this.getColor(NOTIFICATIONS_CENTER_HEADER_FOREGROUND);
|
|
258
|
+
this.notificationsCenterHeader.style.color = headerForeground ?? '';
|
|
259
|
+
const headerBackground = this.getColor(NOTIFICATIONS_CENTER_HEADER_BACKGROUND);
|
|
260
|
+
this.notificationsCenterHeader.style.background = headerBackground ?? '';
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
layout(dimension) {
|
|
264
|
+
this.workbenchDimensions = dimension;
|
|
265
|
+
if (this._isVisible && this.notificationsCenterContainer) {
|
|
266
|
+
const maxWidth = NotificationsCenter_1.MAX_DIMENSIONS.width;
|
|
267
|
+
const maxHeight = NotificationsCenter_1.MAX_DIMENSIONS.height;
|
|
268
|
+
let availableWidth = maxWidth;
|
|
269
|
+
let availableHeight = maxHeight;
|
|
270
|
+
if (this.workbenchDimensions) {
|
|
271
|
+
availableWidth = this.workbenchDimensions.width;
|
|
272
|
+
availableWidth -= (2 * 8);
|
|
273
|
+
availableHeight = this.workbenchDimensions.height - 35 ;
|
|
274
|
+
if (this.layoutService.isVisible("workbench.parts.statusbar" , mainWindow)) {
|
|
275
|
+
availableHeight -= 22;
|
|
276
|
+
}
|
|
277
|
+
if (this.layoutService.isVisible("workbench.parts.titlebar" , mainWindow)) {
|
|
278
|
+
availableHeight -= 22;
|
|
279
|
+
}
|
|
280
|
+
availableHeight -= (2 * 12);
|
|
281
|
+
}
|
|
282
|
+
const notificationsList = assertIsDefined(this.notificationsList);
|
|
283
|
+
notificationsList.layout(Math.min(maxWidth, availableWidth), Math.min(maxHeight, availableHeight));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
clearAll() {
|
|
287
|
+
this.hide();
|
|
288
|
+
for (const notification of [...this.model.notifications] ) {
|
|
289
|
+
if (!notification.hasProgress) {
|
|
290
|
+
notification.close();
|
|
291
|
+
}
|
|
292
|
+
this.audioCueService.playAudioCue(AudioCue.clear);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
NotificationsCenter = NotificationsCenter_1 = ( __decorate([
|
|
297
|
+
( __param(2, IThemeService)),
|
|
298
|
+
( __param(3, IInstantiationService)),
|
|
299
|
+
( __param(4, IWorkbenchLayoutService)),
|
|
300
|
+
( __param(5, IContextKeyService)),
|
|
301
|
+
( __param(6, IEditorGroupsService)),
|
|
302
|
+
( __param(7, IKeybindingService)),
|
|
303
|
+
( __param(8, INotificationService)),
|
|
304
|
+
( __param(9, IAudioCueService)),
|
|
305
|
+
( __param(10, IContextMenuService))
|
|
306
|
+
], NotificationsCenter));
|
|
307
|
+
export { NotificationsCenter };
|