@theia/messages 1.67.0-next.56 → 1.67.0-next.86
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/lib/browser/messages-frontend-module.d.ts +5 -0
- package/lib/browser/messages-frontend-module.d.ts.map +1 -0
- package/lib/browser/messages-frontend-module.js +42 -0
- package/lib/browser/messages-frontend-module.js.map +1 -0
- package/lib/browser/notification-center-component.d.ts +19 -0
- package/lib/browser/notification-center-component.d.ts.map +1 -0
- package/lib/browser/notification-center-component.js +68 -0
- package/lib/browser/notification-center-component.js.map +1 -0
- package/lib/browser/notification-component.d.ts +16 -0
- package/lib/browser/notification-component.d.ts.map +1 -0
- package/lib/browser/notification-component.js +89 -0
- package/lib/browser/notification-component.js.map +1 -0
- package/lib/browser/notification-content-renderer.d.ts +6 -0
- package/lib/browser/notification-content-renderer.d.ts.map +1 -0
- package/lib/browser/notification-content-renderer.js +36 -0
- package/lib/browser/notification-content-renderer.js.map +1 -0
- package/lib/browser/notification-content-renderer.spec.d.ts +2 -0
- package/lib/browser/notification-content-renderer.spec.d.ts.map +1 -0
- package/lib/browser/notification-content-renderer.spec.js +42 -0
- package/lib/browser/notification-content-renderer.spec.js.map +1 -0
- package/lib/browser/notification-toasts-component.d.ts +19 -0
- package/lib/browser/notification-toasts-component.d.ts.map +1 -0
- package/lib/browser/notification-toasts-component.js +49 -0
- package/lib/browser/notification-toasts-component.js.map +1 -0
- package/lib/browser/notifications-commands.d.ts +8 -0
- package/lib/browser/notifications-commands.d.ts.map +1 -0
- package/lib/browser/notifications-commands.js +48 -0
- package/lib/browser/notifications-commands.js.map +1 -0
- package/lib/browser/notifications-contribution.d.ts +22 -0
- package/lib/browser/notifications-contribution.d.ts.map +1 -0
- package/lib/browser/notifications-contribution.js +204 -0
- package/lib/browser/notifications-contribution.js.map +1 -0
- package/lib/browser/notifications-manager.d.ts +72 -0
- package/lib/browser/notifications-manager.d.ts.map +1 -0
- package/lib/browser/notifications-manager.js +279 -0
- package/lib/browser/notifications-manager.js.map +1 -0
- package/lib/browser/notifications-renderer.d.ts +15 -0
- package/lib/browser/notifications-renderer.d.ts.map +1 -0
- package/lib/browser/notifications-renderer.js +69 -0
- package/lib/browser/notifications-renderer.js.map +1 -0
- package/lib/common/notification-preferences.d.ts +12 -0
- package/lib/common/notification-preferences.d.ts.map +1 -0
- package/lib/common/notification-preferences.js +46 -0
- package/lib/common/notification-preferences.js.map +1 -0
- package/lib/node/messages-backend-module.d.ts +4 -0
- package/lib/node/messages-backend-module.d.ts.map +1 -0
- package/lib/node/messages-backend-module.js +23 -0
- package/lib/node/messages-backend-module.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2019 TypeFox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.NotificationsContribution = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const notifications_commands_1 = require("./notifications-commands");
|
|
23
|
+
const notifications_manager_1 = require("./notifications-manager");
|
|
24
|
+
const notifications_renderer_1 = require("./notifications-renderer");
|
|
25
|
+
const color_1 = require("@theia/core/lib/common/color");
|
|
26
|
+
const nls_1 = require("@theia/core/lib/common/nls");
|
|
27
|
+
const theme_1 = require("@theia/core/lib/common/theme");
|
|
28
|
+
let NotificationsContribution = class NotificationsContribution {
|
|
29
|
+
constructor() {
|
|
30
|
+
this.id = 'theia-notification-center';
|
|
31
|
+
}
|
|
32
|
+
onStart(_app) {
|
|
33
|
+
this.createStatusBarItem();
|
|
34
|
+
}
|
|
35
|
+
createStatusBarItem() {
|
|
36
|
+
this.updateStatusBarItem();
|
|
37
|
+
this.manager.onUpdated(e => this.updateStatusBarItem(e.notifications.length));
|
|
38
|
+
}
|
|
39
|
+
updateStatusBarItem(count = 0) {
|
|
40
|
+
this.statusBar.setElement(this.id, {
|
|
41
|
+
text: this.getStatusBarItemText(count),
|
|
42
|
+
alignment: browser_1.StatusBarAlignment.RIGHT,
|
|
43
|
+
priority: -900,
|
|
44
|
+
command: notifications_commands_1.NotificationsCommands.TOGGLE.id,
|
|
45
|
+
tooltip: this.getStatusBarItemTooltip(count),
|
|
46
|
+
accessibilityInformation: {
|
|
47
|
+
label: this.getStatusBarItemTooltip(count)
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
getStatusBarItemText(count) {
|
|
52
|
+
return `$(${count ? 'codicon-bell-dot' : 'codicon-bell'})${count ? ` ${count}` : ''}`;
|
|
53
|
+
}
|
|
54
|
+
getStatusBarItemTooltip(count) {
|
|
55
|
+
if (this.manager.centerVisible) {
|
|
56
|
+
return nls_1.nls.localizeByDefault('Hide Notifications');
|
|
57
|
+
}
|
|
58
|
+
return count === 0
|
|
59
|
+
? nls_1.nls.localizeByDefault('No Notifications')
|
|
60
|
+
: count === 1
|
|
61
|
+
? nls_1.nls.localizeByDefault('1 New Notification')
|
|
62
|
+
: nls_1.nls.localizeByDefault('{0} New Notifications', count.toString());
|
|
63
|
+
}
|
|
64
|
+
registerCommands(commands) {
|
|
65
|
+
commands.registerCommand(notifications_commands_1.NotificationsCommands.TOGGLE, {
|
|
66
|
+
isEnabled: () => true,
|
|
67
|
+
execute: () => this.manager.toggleCenter()
|
|
68
|
+
});
|
|
69
|
+
commands.registerCommand(notifications_commands_1.NotificationsCommands.SHOW, {
|
|
70
|
+
isEnabled: () => true,
|
|
71
|
+
execute: () => this.manager.showCenter()
|
|
72
|
+
});
|
|
73
|
+
commands.registerCommand(notifications_commands_1.NotificationsCommands.HIDE, {
|
|
74
|
+
execute: () => this.manager.hide()
|
|
75
|
+
});
|
|
76
|
+
commands.registerCommand(notifications_commands_1.NotificationsCommands.CLEAR_ALL, {
|
|
77
|
+
execute: () => this.manager.clearAll()
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
registerKeybindings(keybindings) {
|
|
81
|
+
keybindings.registerKeybinding({
|
|
82
|
+
command: notifications_commands_1.NotificationsCommands.HIDE.id,
|
|
83
|
+
when: 'notificationsVisible',
|
|
84
|
+
keybinding: 'esc'
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
registerColors(colors) {
|
|
88
|
+
colors.register({
|
|
89
|
+
id: 'notificationCenter.border', defaults: {
|
|
90
|
+
hcDark: 'contrastBorder',
|
|
91
|
+
hcLight: 'contrastBorder'
|
|
92
|
+
}, description: 'Notifications center border color. Notifications slide in from the bottom right of the window.'
|
|
93
|
+
}, {
|
|
94
|
+
id: 'notificationToast.border', defaults: {
|
|
95
|
+
hcDark: 'contrastBorder',
|
|
96
|
+
hcLight: 'contrastBorder'
|
|
97
|
+
}, description: 'Notification toast border color. Notifications slide in from the bottom right of the window.'
|
|
98
|
+
}, {
|
|
99
|
+
id: 'notifications.foreground', defaults: {
|
|
100
|
+
dark: 'editorWidget.foreground',
|
|
101
|
+
light: 'editorWidget.foreground',
|
|
102
|
+
hcDark: 'editorWidget.foreground',
|
|
103
|
+
hcLight: 'editorWidget.foreground'
|
|
104
|
+
}, description: 'Notifications foreground color. Notifications slide in from the bottom right of the window.'
|
|
105
|
+
}, {
|
|
106
|
+
id: 'notifications.background', defaults: {
|
|
107
|
+
dark: 'editorWidget.background',
|
|
108
|
+
light: 'editorWidget.background',
|
|
109
|
+
hcDark: 'editorWidget.background',
|
|
110
|
+
hcLight: 'editorWidget.background'
|
|
111
|
+
}, description: 'Notifications background color. Notifications slide in from the bottom right of the window.'
|
|
112
|
+
}, {
|
|
113
|
+
id: 'notificationLink.foreground', defaults: {
|
|
114
|
+
dark: 'textLink.foreground',
|
|
115
|
+
light: 'textLink.foreground',
|
|
116
|
+
hcDark: 'textLink.foreground',
|
|
117
|
+
hcLight: 'textLink.foreground'
|
|
118
|
+
}, description: 'Notification links foreground color. Notifications slide in from the bottom right of the window.'
|
|
119
|
+
}, {
|
|
120
|
+
id: 'notificationCenterHeader.foreground',
|
|
121
|
+
description: 'Notifications center header foreground color. Notifications slide in from the bottom right of the window.'
|
|
122
|
+
}, {
|
|
123
|
+
id: 'notificationCenterHeader.background', defaults: {
|
|
124
|
+
dark: color_1.Color.lighten('notifications.background', 0.3),
|
|
125
|
+
light: color_1.Color.darken('notifications.background', 0.05),
|
|
126
|
+
hcDark: 'notifications.background',
|
|
127
|
+
hcLight: 'notifications.background'
|
|
128
|
+
}, description: 'Notifications center header background color. Notifications slide in from the bottom right of the window.'
|
|
129
|
+
}, {
|
|
130
|
+
id: 'notifications.border', defaults: {
|
|
131
|
+
dark: 'notificationCenterHeader.background',
|
|
132
|
+
light: 'notificationCenterHeader.background',
|
|
133
|
+
hcDark: 'notificationCenterHeader.background',
|
|
134
|
+
hcLight: 'notificationCenterHeader.background'
|
|
135
|
+
// eslint-disable-next-line max-len
|
|
136
|
+
}, description: 'Notifications border color separating from other notifications in the notifications center. Notifications slide in from the bottom right of the window.'
|
|
137
|
+
}, {
|
|
138
|
+
id: 'notificationsErrorIcon.foreground', defaults: {
|
|
139
|
+
dark: 'editorError.foreground',
|
|
140
|
+
light: 'editorError.foreground',
|
|
141
|
+
hcDark: 'editorError.foreground',
|
|
142
|
+
hcLight: 'editorError.foreground'
|
|
143
|
+
}, description: 'The color used for the icon of error notifications. Notifications slide in from the bottom right of the window.'
|
|
144
|
+
}, {
|
|
145
|
+
id: 'notificationsWarningIcon.foreground', defaults: {
|
|
146
|
+
dark: 'editorWarning.foreground',
|
|
147
|
+
light: 'editorWarning.foreground',
|
|
148
|
+
hcDark: 'editorWarning.foreground',
|
|
149
|
+
hcLight: 'editorWarning.foreground'
|
|
150
|
+
}, description: 'The color used for the icon of warning notifications. Notifications slide in from the bottom right of the window.'
|
|
151
|
+
}, {
|
|
152
|
+
id: 'notificationsInfoIcon.foreground', defaults: {
|
|
153
|
+
dark: 'editorInfo.foreground',
|
|
154
|
+
light: 'editorInfo.foreground',
|
|
155
|
+
hcDark: 'editorInfo.foreground',
|
|
156
|
+
hcLight: 'editorInfo.foreground'
|
|
157
|
+
}, description: 'The color used for the icon of info notifications. Notifications slide in from the bottom right of the window.'
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
registerThemeStyle(theme, collector) {
|
|
161
|
+
const notificationsBackground = theme.getColor('notifications.background');
|
|
162
|
+
if (notificationsBackground) {
|
|
163
|
+
collector.addRule(`
|
|
164
|
+
.theia-notification-list-item-container {
|
|
165
|
+
background-color: ${notificationsBackground};
|
|
166
|
+
}
|
|
167
|
+
`);
|
|
168
|
+
}
|
|
169
|
+
const notificationHover = theme.getColor('list.hoverBackground');
|
|
170
|
+
if (notificationHover) {
|
|
171
|
+
collector.addRule(`
|
|
172
|
+
.theia-notification-list-item:hover:not(:focus) {
|
|
173
|
+
background-color: ${notificationHover};
|
|
174
|
+
}
|
|
175
|
+
`);
|
|
176
|
+
}
|
|
177
|
+
const focusBorder = theme.getColor('focusBorder');
|
|
178
|
+
if (focusBorder && (0, theme_1.isHighContrast)(theme.type)) {
|
|
179
|
+
collector.addRule(`
|
|
180
|
+
.theia-notification-list-item:hover:not(:focus) {
|
|
181
|
+
outline: 1px dashed ${focusBorder};
|
|
182
|
+
outline-offset: -2px;
|
|
183
|
+
}
|
|
184
|
+
`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
exports.NotificationsContribution = NotificationsContribution;
|
|
189
|
+
tslib_1.__decorate([
|
|
190
|
+
(0, inversify_1.inject)(notifications_manager_1.NotificationManager),
|
|
191
|
+
tslib_1.__metadata("design:type", notifications_manager_1.NotificationManager)
|
|
192
|
+
], NotificationsContribution.prototype, "manager", void 0);
|
|
193
|
+
tslib_1.__decorate([
|
|
194
|
+
(0, inversify_1.inject)(notifications_renderer_1.NotificationsRenderer),
|
|
195
|
+
tslib_1.__metadata("design:type", notifications_renderer_1.NotificationsRenderer)
|
|
196
|
+
], NotificationsContribution.prototype, "notificationsRenderer", void 0);
|
|
197
|
+
tslib_1.__decorate([
|
|
198
|
+
(0, inversify_1.inject)(browser_1.StatusBar),
|
|
199
|
+
tslib_1.__metadata("design:type", Object)
|
|
200
|
+
], NotificationsContribution.prototype, "statusBar", void 0);
|
|
201
|
+
exports.NotificationsContribution = NotificationsContribution = tslib_1.__decorate([
|
|
202
|
+
(0, inversify_1.injectable)()
|
|
203
|
+
], NotificationsContribution);
|
|
204
|
+
//# sourceMappingURL=notifications-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications-contribution.js","sourceRoot":"","sources":["../../src/browser/notifications-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAClE,qDAGiC;AACjC,qEAAiE;AAEjE,mEAA8D;AAC9D,qEAAiE;AAGjE,wDAAqD;AACrD,oDAAiD;AACjD,wDAA8D;AAGvD,I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WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAClD,IAAI,WAAW,IAAI,IAAA,sBAAc,EAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5C,SAAS,CAAC,OAAO,CAAC;;0CAEY,WAAW;;;aAGxC,CAAC,CAAC;QACP,CAAC;IACL,CAAC;CACJ,CAAA;AAzLY,8DAAyB;AAKf;IADlB,IAAA,kBAAM,EAAC,2CAAmB,CAAC;sCACA,2CAAmB;0DAAC;AAG7B;IADlB,IAAA,kBAAM,EAAC,8CAAqB,CAAC;sCACY,8CAAqB;wEAAC;AAG7C;IADlB,IAAA,kBAAM,EAAC,mBAAS,CAAC;;4DACsB;oCAX/B,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CAyLrC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { MessageClient, MessageType, Message as PlainMessage, ProgressMessage, ProgressUpdate, CancellationToken } from '@theia/core/lib/common';
|
|
3
|
+
import { Emitter } from '@theia/core';
|
|
4
|
+
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
5
|
+
import { NotificationPreferences } from '../common/notification-preferences';
|
|
6
|
+
import { ContextKeyService, ContextKey } from '@theia/core/lib/browser/context-key-service';
|
|
7
|
+
import { OpenerService } from '@theia/core/lib/browser';
|
|
8
|
+
import { NotificationContentRenderer } from './notification-content-renderer';
|
|
9
|
+
export interface NotificationUpdateEvent {
|
|
10
|
+
readonly notifications: Notification[];
|
|
11
|
+
readonly toasts: Notification[];
|
|
12
|
+
readonly visibilityState: Notification.Visibility;
|
|
13
|
+
}
|
|
14
|
+
export interface Notification {
|
|
15
|
+
messageId: string;
|
|
16
|
+
message: string;
|
|
17
|
+
source?: string;
|
|
18
|
+
expandable: boolean;
|
|
19
|
+
collapsed: boolean;
|
|
20
|
+
type: Notification.Type;
|
|
21
|
+
actions: string[];
|
|
22
|
+
progress?: number;
|
|
23
|
+
}
|
|
24
|
+
export declare namespace Notification {
|
|
25
|
+
type Visibility = 'hidden' | 'toasts' | 'center';
|
|
26
|
+
type Type = 'info' | 'warning' | 'error' | 'progress';
|
|
27
|
+
}
|
|
28
|
+
export declare class NotificationManager extends MessageClient {
|
|
29
|
+
protected readonly preferences: NotificationPreferences;
|
|
30
|
+
protected readonly contextKeyService: ContextKeyService;
|
|
31
|
+
protected readonly openerService: OpenerService;
|
|
32
|
+
protected readonly contentRenderer: NotificationContentRenderer;
|
|
33
|
+
protected readonly onUpdatedEmitter: Emitter<NotificationUpdateEvent>;
|
|
34
|
+
readonly onUpdated: import("@theia/core/lib/common").Event<NotificationUpdateEvent>;
|
|
35
|
+
protected readonly fireUpdatedEvent: import("lodash").DebouncedFuncLeading<() => void>;
|
|
36
|
+
protected readonly deferredResults: Map<string, Deferred<string | undefined>>;
|
|
37
|
+
protected readonly notifications: Map<string, Notification>;
|
|
38
|
+
protected readonly toasts: Map<string, Notification>;
|
|
39
|
+
protected notificationToastsVisibleKey: ContextKey<boolean>;
|
|
40
|
+
protected notificationCenterVisibleKey: ContextKey<boolean>;
|
|
41
|
+
protected notificationsVisible: ContextKey<boolean>;
|
|
42
|
+
protected init(): void;
|
|
43
|
+
protected doInit(): Promise<void>;
|
|
44
|
+
protected updateContextKeys(): void;
|
|
45
|
+
get toastsVisible(): boolean;
|
|
46
|
+
get centerVisible(): boolean;
|
|
47
|
+
protected visibilityState: Notification.Visibility;
|
|
48
|
+
protected setVisibilityState(newState: Notification.Visibility): void;
|
|
49
|
+
hideCenter(): void;
|
|
50
|
+
showCenter(): void;
|
|
51
|
+
toggleCenter(): void;
|
|
52
|
+
accept(notification: Notification | string, action: string | undefined): void;
|
|
53
|
+
protected find(notification: Notification | string): Notification | undefined;
|
|
54
|
+
protected getId(notification: Notification | string): string;
|
|
55
|
+
hide(): void;
|
|
56
|
+
clearAll(): void;
|
|
57
|
+
clear(notification: Notification | string): void;
|
|
58
|
+
toggleExpansion(notificationId: string): void;
|
|
59
|
+
showMessage(plainMessage: PlainMessage): Promise<string | undefined>;
|
|
60
|
+
protected hideTimeouts: Map<string, number>;
|
|
61
|
+
protected startHideTimeout(messageId: string, timeout: number): void;
|
|
62
|
+
protected hideToast(messageId: string): void;
|
|
63
|
+
protected getTimeout(plainMessage: PlainMessage): number;
|
|
64
|
+
protected isExpandable(message: string, source: string | undefined, actions: string[]): boolean;
|
|
65
|
+
protected toNotificationType(type?: MessageType): Notification.Type;
|
|
66
|
+
protected getMessageId(m: PlainMessage): string;
|
|
67
|
+
showProgress(messageId: string, plainMessage: ProgressMessage, cancellationToken: CancellationToken): Promise<string | undefined>;
|
|
68
|
+
reportProgress(messageId: string, update: ProgressUpdate, originalMessage: ProgressMessage, cancellationToken: CancellationToken): Promise<void>;
|
|
69
|
+
protected toPlainProgress(update: ProgressUpdate): number | undefined;
|
|
70
|
+
openLink(link: string): Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=notifications-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications-manager.d.ts","sourceRoot":"","sources":["../../src/browser/notifications-manager.ts"],"names":[],"mappings":";AAiBA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,IAAI,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEjJ,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAE9E,MAAM,WAAW,uBAAuB;IACpC,QAAQ,C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AE,YAAY,GAAG,MAAM;IAOxD,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO;IAM/F,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,YAAY,CAAC,IAAI;IAYnE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM;IAIhC,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IA4BjI,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB/J,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAI/D,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAM9C"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2019 TypeFox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.NotificationManager = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const common_1 = require("@theia/core/lib/common");
|
|
22
|
+
const objects_1 = require("@theia/core/lib/common/objects");
|
|
23
|
+
const core_1 = require("@theia/core");
|
|
24
|
+
const promise_util_1 = require("@theia/core/lib/common/promise-util");
|
|
25
|
+
const ts_md5_1 = require("ts-md5");
|
|
26
|
+
const throttle = require("@theia/core/shared/lodash.throttle");
|
|
27
|
+
const notification_preferences_1 = require("../common/notification-preferences");
|
|
28
|
+
const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
|
|
29
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
30
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
31
|
+
const notification_content_renderer_1 = require("./notification-content-renderer");
|
|
32
|
+
let NotificationManager = class NotificationManager extends common_1.MessageClient {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.onUpdatedEmitter = new core_1.Emitter();
|
|
36
|
+
this.onUpdated = this.onUpdatedEmitter.event;
|
|
37
|
+
this.fireUpdatedEvent = throttle(() => {
|
|
38
|
+
const notifications = (0, objects_1.deepClone)(Array.from(this.notifications.values()).filter((notification) => notification.message));
|
|
39
|
+
const toasts = (0, objects_1.deepClone)(Array.from(this.toasts.values()).filter((toast) => toast.message));
|
|
40
|
+
const visibilityState = this.visibilityState;
|
|
41
|
+
this.onUpdatedEmitter.fire({ notifications, toasts, visibilityState });
|
|
42
|
+
}, 250, { leading: true, trailing: true });
|
|
43
|
+
this.deferredResults = new Map();
|
|
44
|
+
this.notifications = new Map();
|
|
45
|
+
this.toasts = new Map();
|
|
46
|
+
this.visibilityState = 'hidden';
|
|
47
|
+
this.hideTimeouts = new Map();
|
|
48
|
+
}
|
|
49
|
+
init() {
|
|
50
|
+
this.doInit();
|
|
51
|
+
}
|
|
52
|
+
async doInit() {
|
|
53
|
+
this.notificationToastsVisibleKey = this.contextKeyService.createKey('notificationToastsVisible', false);
|
|
54
|
+
this.notificationCenterVisibleKey = this.contextKeyService.createKey('notificationCenterVisible', false);
|
|
55
|
+
this.notificationsVisible = this.contextKeyService.createKey('notificationsVisible', false);
|
|
56
|
+
}
|
|
57
|
+
updateContextKeys() {
|
|
58
|
+
this.notificationToastsVisibleKey.set(this.toastsVisible);
|
|
59
|
+
this.notificationCenterVisibleKey.set(this.centerVisible);
|
|
60
|
+
this.notificationsVisible.set(this.toastsVisible || this.centerVisible);
|
|
61
|
+
}
|
|
62
|
+
get toastsVisible() {
|
|
63
|
+
return this.visibilityState === 'toasts';
|
|
64
|
+
}
|
|
65
|
+
get centerVisible() {
|
|
66
|
+
return this.visibilityState === 'center';
|
|
67
|
+
}
|
|
68
|
+
setVisibilityState(newState) {
|
|
69
|
+
const changed = this.visibilityState !== newState;
|
|
70
|
+
this.visibilityState = newState;
|
|
71
|
+
if (changed) {
|
|
72
|
+
this.fireUpdatedEvent();
|
|
73
|
+
this.updateContextKeys();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
hideCenter() {
|
|
77
|
+
this.setVisibilityState('hidden');
|
|
78
|
+
}
|
|
79
|
+
showCenter() {
|
|
80
|
+
this.setVisibilityState('center');
|
|
81
|
+
}
|
|
82
|
+
toggleCenter() {
|
|
83
|
+
this.setVisibilityState(this.centerVisible ? 'hidden' : 'center');
|
|
84
|
+
}
|
|
85
|
+
accept(notification, action) {
|
|
86
|
+
const messageId = this.getId(notification);
|
|
87
|
+
if (!messageId) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.notifications.delete(messageId);
|
|
91
|
+
this.toasts.delete(messageId);
|
|
92
|
+
const result = this.deferredResults.get(messageId);
|
|
93
|
+
if (!result) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
this.deferredResults.delete(messageId);
|
|
97
|
+
if ((this.centerVisible && !this.notifications.size) || (this.toastsVisible && !this.toasts.size)) {
|
|
98
|
+
this.setVisibilityState('hidden');
|
|
99
|
+
}
|
|
100
|
+
result.resolve(action);
|
|
101
|
+
this.fireUpdatedEvent();
|
|
102
|
+
}
|
|
103
|
+
find(notification) {
|
|
104
|
+
return typeof notification === 'string' ? this.notifications.get(notification) : notification;
|
|
105
|
+
}
|
|
106
|
+
getId(notification) {
|
|
107
|
+
return typeof notification === 'string' ? notification : notification.messageId;
|
|
108
|
+
}
|
|
109
|
+
hide() {
|
|
110
|
+
if (this.toastsVisible) {
|
|
111
|
+
this.toasts.clear();
|
|
112
|
+
}
|
|
113
|
+
this.setVisibilityState('hidden');
|
|
114
|
+
}
|
|
115
|
+
clearAll() {
|
|
116
|
+
this.setVisibilityState('hidden');
|
|
117
|
+
Array.from(this.notifications.values()).forEach(n => this.clear(n));
|
|
118
|
+
}
|
|
119
|
+
clear(notification) {
|
|
120
|
+
this.accept(notification, undefined);
|
|
121
|
+
}
|
|
122
|
+
toggleExpansion(notificationId) {
|
|
123
|
+
const notification = this.find(notificationId);
|
|
124
|
+
if (!notification) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
notification.collapsed = !notification.collapsed;
|
|
128
|
+
this.fireUpdatedEvent();
|
|
129
|
+
}
|
|
130
|
+
showMessage(plainMessage) {
|
|
131
|
+
const messageId = this.getMessageId(plainMessage);
|
|
132
|
+
this.toasts.delete(messageId);
|
|
133
|
+
this.notifications.delete(messageId);
|
|
134
|
+
const existingDeferred = this.deferredResults.get(messageId);
|
|
135
|
+
if (existingDeferred) {
|
|
136
|
+
this.deferredResults.delete(messageId);
|
|
137
|
+
existingDeferred.resolve(undefined);
|
|
138
|
+
}
|
|
139
|
+
const message = this.contentRenderer.renderMessage(plainMessage.text);
|
|
140
|
+
const type = this.toNotificationType(plainMessage.type);
|
|
141
|
+
const actions = Array.from(new Set(plainMessage.actions));
|
|
142
|
+
const source = plainMessage.source;
|
|
143
|
+
const expandable = this.isExpandable(message, source, actions);
|
|
144
|
+
const collapsed = expandable;
|
|
145
|
+
const notification = { messageId, message, type, actions, expandable, collapsed };
|
|
146
|
+
this.notifications.set(messageId, notification);
|
|
147
|
+
const result = new promise_util_1.Deferred();
|
|
148
|
+
this.deferredResults.set(messageId, result);
|
|
149
|
+
if (!this.centerVisible) {
|
|
150
|
+
this.toasts.delete(messageId);
|
|
151
|
+
this.toasts.set(messageId, notification);
|
|
152
|
+
this.startHideTimeout(messageId, this.getTimeout(plainMessage));
|
|
153
|
+
this.setVisibilityState('toasts');
|
|
154
|
+
}
|
|
155
|
+
this.fireUpdatedEvent();
|
|
156
|
+
return result.promise;
|
|
157
|
+
}
|
|
158
|
+
startHideTimeout(messageId, timeout) {
|
|
159
|
+
if (timeout > 0) {
|
|
160
|
+
this.hideTimeouts.set(messageId, window.setTimeout(() => {
|
|
161
|
+
this.hideToast(messageId);
|
|
162
|
+
}, timeout));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
hideToast(messageId) {
|
|
166
|
+
this.toasts.delete(messageId);
|
|
167
|
+
if (this.toastsVisible && !this.toasts.size) {
|
|
168
|
+
this.setVisibilityState('hidden');
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
this.fireUpdatedEvent();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
getTimeout(plainMessage) {
|
|
175
|
+
if (plainMessage.actions && plainMessage.actions.length > 0) {
|
|
176
|
+
// Ignore the timeout if at least one action is set, and we wait for user interaction.
|
|
177
|
+
return 0;
|
|
178
|
+
}
|
|
179
|
+
return plainMessage.options && plainMessage.options.timeout || this.preferences['notification.timeout'];
|
|
180
|
+
}
|
|
181
|
+
isExpandable(message, source, actions) {
|
|
182
|
+
if (!actions.length && source) {
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
return message.length > 500;
|
|
186
|
+
}
|
|
187
|
+
toNotificationType(type) {
|
|
188
|
+
switch (type) {
|
|
189
|
+
case common_1.MessageType.Error:
|
|
190
|
+
return 'error';
|
|
191
|
+
case common_1.MessageType.Warning:
|
|
192
|
+
return 'warning';
|
|
193
|
+
case common_1.MessageType.Progress:
|
|
194
|
+
return 'progress';
|
|
195
|
+
default:
|
|
196
|
+
return 'info';
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
getMessageId(m) {
|
|
200
|
+
return String(ts_md5_1.Md5.hashStr(`[${m.type}] ${m.text} : ${(m.actions || []).join(' | ')};`));
|
|
201
|
+
}
|
|
202
|
+
async showProgress(messageId, plainMessage, cancellationToken) {
|
|
203
|
+
let notification = this.notifications.get(messageId);
|
|
204
|
+
if (!notification) {
|
|
205
|
+
const message = this.contentRenderer.renderMessage(plainMessage.text);
|
|
206
|
+
const type = this.toNotificationType(plainMessage.type);
|
|
207
|
+
const actions = Array.from(new Set(plainMessage.actions));
|
|
208
|
+
const source = plainMessage.source;
|
|
209
|
+
const expandable = this.isExpandable(message, source, actions);
|
|
210
|
+
const collapsed = expandable;
|
|
211
|
+
notification = { messageId, message, type, actions, expandable, collapsed };
|
|
212
|
+
this.notifications.set(messageId, notification);
|
|
213
|
+
notification.progress = 0;
|
|
214
|
+
cancellationToken.onCancellationRequested(() => {
|
|
215
|
+
this.accept(messageId, common_1.ProgressMessage.Cancel);
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
const result = this.deferredResults.get(messageId) || new promise_util_1.Deferred();
|
|
219
|
+
this.deferredResults.set(messageId, result);
|
|
220
|
+
if (!this.centerVisible) {
|
|
221
|
+
this.toasts.set(messageId, notification);
|
|
222
|
+
this.setVisibilityState('toasts');
|
|
223
|
+
}
|
|
224
|
+
this.fireUpdatedEvent();
|
|
225
|
+
return result.promise;
|
|
226
|
+
}
|
|
227
|
+
async reportProgress(messageId, update, originalMessage, cancellationToken) {
|
|
228
|
+
const notification = this.find(messageId);
|
|
229
|
+
if (!notification) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
if (cancellationToken.isCancellationRequested) {
|
|
233
|
+
this.clear(messageId);
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
const textMessage = originalMessage.text && update.message ? `${originalMessage.text}: ${update.message}` : originalMessage.text || (update === null || update === void 0 ? void 0 : update.message);
|
|
237
|
+
if (textMessage) {
|
|
238
|
+
notification.message = this.contentRenderer.renderMessage(textMessage);
|
|
239
|
+
}
|
|
240
|
+
notification.progress = this.toPlainProgress(update) || notification.progress;
|
|
241
|
+
}
|
|
242
|
+
this.fireUpdatedEvent();
|
|
243
|
+
}
|
|
244
|
+
toPlainProgress(update) {
|
|
245
|
+
return update.work && Math.min(update.work.done / update.work.total * 100, 100);
|
|
246
|
+
}
|
|
247
|
+
async openLink(link) {
|
|
248
|
+
const uri = new uri_1.default(link);
|
|
249
|
+
const opener = await this.openerService.getOpener(uri);
|
|
250
|
+
opener.open(uri);
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
exports.NotificationManager = NotificationManager;
|
|
254
|
+
tslib_1.__decorate([
|
|
255
|
+
(0, inversify_1.inject)(notification_preferences_1.NotificationPreferences),
|
|
256
|
+
tslib_1.__metadata("design:type", Object)
|
|
257
|
+
], NotificationManager.prototype, "preferences", void 0);
|
|
258
|
+
tslib_1.__decorate([
|
|
259
|
+
(0, inversify_1.inject)(context_key_service_1.ContextKeyService),
|
|
260
|
+
tslib_1.__metadata("design:type", Object)
|
|
261
|
+
], NotificationManager.prototype, "contextKeyService", void 0);
|
|
262
|
+
tslib_1.__decorate([
|
|
263
|
+
(0, inversify_1.inject)(browser_1.OpenerService),
|
|
264
|
+
tslib_1.__metadata("design:type", Object)
|
|
265
|
+
], NotificationManager.prototype, "openerService", void 0);
|
|
266
|
+
tslib_1.__decorate([
|
|
267
|
+
(0, inversify_1.inject)(notification_content_renderer_1.NotificationContentRenderer),
|
|
268
|
+
tslib_1.__metadata("design:type", notification_content_renderer_1.NotificationContentRenderer)
|
|
269
|
+
], NotificationManager.prototype, "contentRenderer", void 0);
|
|
270
|
+
tslib_1.__decorate([
|
|
271
|
+
(0, inversify_1.postConstruct)(),
|
|
272
|
+
tslib_1.__metadata("design:type", Function),
|
|
273
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
274
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
275
|
+
], NotificationManager.prototype, "init", null);
|
|
276
|
+
exports.NotificationManager = NotificationManager = tslib_1.__decorate([
|
|
277
|
+
(0, inversify_1.injectable)()
|
|
278
|
+
], NotificationManager);
|
|
279
|
+
//# sourceMappingURL=notifications-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications-manager.js","sourceRoot":"","sources":["../../src/browser/notifications-manager.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAiF;AACjF,mDAAiJ;AACjJ,4DAA2D;AAC3D,sCAAsC;AACtC,sEAA+D;AAC/D,mCAA6B;AAC7B,+DAAgE;AAChE,iFAA6E;AAC7E,qFAA4F;AAC5F,qDAAwD;AACxD,oDAA6C;AAC7C,mFAA8E;AAwBvE,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,sBAAa;IAA/C;;QAcgB,qBAAgB,GAAG,IAAI,cAAO,EAA2B,CAAC;QACpE,cAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;QAC9B,qBAAgB,GAAG,QAAQ,CAAC,GAAG,EAAE;YAChD,MAAM,aAAa,GAAG,IAAA,mBAAS,EAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,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IAAI,CAAC,CAAC;QAC1B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACvD,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;CAEJ,CAAA;AAlQY,kDAAmB;AAGT;IADlB,IAAA,kBAAM,EAAC,kDAAuB,CAAC;;wDACwB;AAGrC;IADlB,IAAA,kBAAM,EAAC,uCAAiB,CAAC;;8DAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,uBAAa,CAAC;;0DAC0B;AAG7B;IADlB,IAAA,kBAAM,EAAC,2DAA2B,CAAC;sCACA,2DAA2B;4DAAC;AAwBtD;IADT,IAAA,yBAAa,GAAE;;;;+CAGf;8BAtCQ,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;GACA,mBAAmB,CAkQ/B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Root } from '@theia/core/shared/react-dom/client';
|
|
2
|
+
import { ApplicationShell } from '@theia/core/lib/browser';
|
|
3
|
+
import { NotificationManager } from './notifications-manager';
|
|
4
|
+
import { CorePreferences } from '@theia/core';
|
|
5
|
+
export declare class NotificationsRenderer {
|
|
6
|
+
protected readonly shell: ApplicationShell;
|
|
7
|
+
protected readonly manager: NotificationManager;
|
|
8
|
+
protected readonly corePreferences: CorePreferences;
|
|
9
|
+
protected containerRoot: Root;
|
|
10
|
+
protected init(): void;
|
|
11
|
+
protected container: HTMLDivElement;
|
|
12
|
+
protected createOverlayContainer(): void;
|
|
13
|
+
protected render(): void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=notifications-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications-renderer.d.ts","sourceRoot":"","sources":["../../src/browser/notifications-renderer.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAc,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBACa,qBAAqB;IAG9B,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IAG3C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IAGhD,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IACpD,SAAS,CAAC,aAAa,EAAE,IAAI,CAAC;IAG9B,SAAS,CAAC,IAAI,IAAI,IAAI;IAKtB,SAAS,CAAC,SAAS,EAAE,cAAc,CAAC;IACpC,SAAS,CAAC,sBAAsB,IAAI,IAAI;IASxC,SAAS,CAAC,MAAM,IAAI,IAAI;CAO3B"}
|