@codingame/monaco-vscode-notifications-service-override 17.2.1 → 18.0.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-notifications-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - notifications service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-494be54c-bd37-5b3c-af70-02f086e28768-common": "
|
|
19
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-494be54c-bd37-5b3c-af70-02f086e28768-common": "18.0.1",
|
|
19
|
+
"@codingame/monaco-vscode-api": "18.0.1"
|
|
20
20
|
},
|
|
21
21
|
"main": "index.js",
|
|
22
22
|
"module": "index.js",
|
|
@@ -8,10 +8,6 @@ export declare class NotificationService extends Disposable implements INotifica
|
|
|
8
8
|
private readonly storageService;
|
|
9
9
|
readonly _serviceBrand: undefined;
|
|
10
10
|
readonly model: NotificationsModel;
|
|
11
|
-
private readonly _onDidAddNotification;
|
|
12
|
-
readonly onDidAddNotification: Event<INotification>;
|
|
13
|
-
private readonly _onDidRemoveNotification;
|
|
14
|
-
readonly onDidRemoveNotification: Event<INotification>;
|
|
15
11
|
constructor(storageService: IStorageService);
|
|
16
12
|
private registerListeners;
|
|
17
13
|
private static readonly GLOBAL_FILTER_SETTINGS_KEY;
|
|
@@ -19,10 +19,6 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
19
19
|
super();
|
|
20
20
|
this.storageService = storageService;
|
|
21
21
|
this.model = this._register(( new NotificationsModel()));
|
|
22
|
-
this._onDidAddNotification = this._register(( new Emitter()));
|
|
23
|
-
this.onDidAddNotification = this._onDidAddNotification.event;
|
|
24
|
-
this._onDidRemoveNotification = this._register(( new Emitter()));
|
|
25
|
-
this.onDidRemoveNotification = this._onDidRemoveNotification.event;
|
|
26
22
|
this._onDidChangeFilter = this._register(( new Emitter()));
|
|
27
23
|
this.onDidChangeFilter = this._onDidChangeFilter.event;
|
|
28
24
|
this.mapSourceToFilter = (() => {
|
|
@@ -39,28 +35,15 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
39
35
|
registerListeners() {
|
|
40
36
|
this._register(this.model.onDidChangeNotification(e => {
|
|
41
37
|
switch (e.kind) {
|
|
42
|
-
case NotificationChangeType.ADD:
|
|
43
|
-
case NotificationChangeType.REMOVE: {
|
|
38
|
+
case NotificationChangeType.ADD: {
|
|
44
39
|
const source = typeof e.item.sourceId === 'string' && typeof e.item.source === 'string' ? { id: e.item.sourceId, label: e.item.source } : e.item.source;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (e.kind === NotificationChangeType.ADD) {
|
|
52
|
-
if (isNotificationSource(source)) {
|
|
53
|
-
if (!( this.mapSourceToFilter.has(source.id))) {
|
|
54
|
-
this.setFilter({ ...source, filter: NotificationsFilter.OFF });
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
this.updateSourceFilter(source);
|
|
58
|
-
}
|
|
40
|
+
if (isNotificationSource(source)) {
|
|
41
|
+
if (!( this.mapSourceToFilter.has(source.id))) {
|
|
42
|
+
this.setFilter({ ...source, filter: NotificationsFilter.OFF });
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.updateSourceFilter(source);
|
|
59
46
|
}
|
|
60
|
-
this._onDidAddNotification.fire(notification);
|
|
61
|
-
}
|
|
62
|
-
if (e.kind === NotificationChangeType.REMOVE) {
|
|
63
|
-
this._onDidRemoveNotification.fire(notification);
|
|
64
47
|
}
|
|
65
48
|
break;
|
|
66
49
|
}
|
|
@@ -158,7 +141,7 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
158
141
|
if (this.storageService.getBoolean(id, scope)) {
|
|
159
142
|
return ( new NoOpNotification());
|
|
160
143
|
}
|
|
161
|
-
const neverShowAgainAction = toDispose.add(( new Action('workbench.notification.neverShowAgain', ( localize(
|
|
144
|
+
const neverShowAgainAction = toDispose.add(( new Action('workbench.notification.neverShowAgain', ( localize(12766, "Don't Show Again")), undefined, true, async () => {
|
|
162
145
|
handle.close();
|
|
163
146
|
this.storageService.store(id, true, scope, StorageTarget.USER);
|
|
164
147
|
})));
|
|
@@ -198,7 +181,7 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
198
181
|
return ( new NoOpNotification());
|
|
199
182
|
}
|
|
200
183
|
const neverShowAgainChoice = {
|
|
201
|
-
label: ( localize(
|
|
184
|
+
label: ( localize(12766, "Don't Show Again")),
|
|
202
185
|
run: () => this.storageService.store(id, true, scope, StorageTarget.USER),
|
|
203
186
|
isSecondary: options.neverShowAgain.isSecondary
|
|
204
187
|
};
|