@theia/messages 1.48.1 → 1.48.3
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 +30 -30
- package/lib/browser/messages-frontend-module.d.ts +4 -4
- package/lib/browser/messages-frontend-module.js +41 -41
- package/lib/browser/notification-center-component.d.ts +18 -18
- package/lib/browser/notification-center-component.js +67 -67
- package/lib/browser/notification-component.d.ts +15 -15
- package/lib/browser/notification-component.js +88 -88
- package/lib/browser/notification-content-renderer.d.ts +5 -5
- package/lib/browser/notification-content-renderer.js +35 -35
- package/lib/browser/notification-content-renderer.spec.d.ts +1 -1
- package/lib/browser/notification-content-renderer.spec.js +41 -41
- package/lib/browser/notification-preferences.d.ts +11 -11
- package/lib/browser/notification-preferences.js +46 -46
- package/lib/browser/notification-toasts-component.d.ts +18 -18
- package/lib/browser/notification-toasts-component.js +48 -48
- package/lib/browser/notifications-commands.d.ts +7 -7
- package/lib/browser/notifications-commands.js +47 -47
- package/lib/browser/notifications-contribution.d.ts +21 -21
- package/lib/browser/notifications-contribution.js +203 -203
- package/lib/browser/notifications-manager.d.ts +71 -71
- package/lib/browser/notifications-manager.js +274 -274
- package/lib/browser/notifications-renderer.d.ts +13 -13
- package/lib/browser/notifications-renderer.js +67 -67
- package/package.json +4 -4
- package/src/browser/messages-frontend-module.ts +42 -42
- package/src/browser/notification-center-component.tsx +95 -95
- package/src/browser/notification-component.tsx +128 -128
- package/src/browser/notification-content-renderer.spec.ts +73 -73
- package/src/browser/notification-content-renderer.ts +31 -31
- package/src/browser/notification-preferences.ts +58 -58
- package/src/browser/notification-toasts-component.tsx +67 -67
- package/src/browser/notifications-commands.ts +50 -50
- package/src/browser/notifications-contribution.ts +218 -218
- package/src/browser/notifications-manager.ts +305 -305
- package/src/browser/notifications-renderer.tsx +61 -61
- package/src/browser/style/index.css +17 -17
- package/src/browser/style/notifications.css +283 -283
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2019 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import * as React from '@theia/core/shared/react';
|
|
18
|
-
import { DisposableCollection } from '@theia/core';
|
|
19
|
-
import { NotificationManager, NotificationUpdateEvent } from './notifications-manager';
|
|
20
|
-
import { NotificationComponent } from './notification-component';
|
|
21
|
-
import { CorePreferences } from '@theia/core/lib/browser';
|
|
22
|
-
|
|
23
|
-
export interface NotificationToastsComponentProps {
|
|
24
|
-
readonly manager: NotificationManager;
|
|
25
|
-
readonly corePreferences: CorePreferences;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
type NotificationToastsComponentState = Pick<NotificationUpdateEvent, Exclude<keyof NotificationUpdateEvent, 'notifications'>>;
|
|
29
|
-
|
|
30
|
-
export class NotificationToastsComponent extends React.Component<NotificationToastsComponentProps, NotificationToastsComponentState> {
|
|
31
|
-
|
|
32
|
-
constructor(props: NotificationToastsComponentProps) {
|
|
33
|
-
super(props);
|
|
34
|
-
this.state = {
|
|
35
|
-
toasts: [],
|
|
36
|
-
visibilityState: 'hidden'
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
protected readonly toDisposeOnUnmount = new DisposableCollection();
|
|
41
|
-
|
|
42
|
-
override async componentDidMount(): Promise<void> {
|
|
43
|
-
this.toDisposeOnUnmount.push(
|
|
44
|
-
this.props.manager.onUpdated(({ toasts, visibilityState }) => {
|
|
45
|
-
visibilityState = this.props.corePreferences['workbench.silentNotifications'] ? 'hidden' : visibilityState;
|
|
46
|
-
this.setState({
|
|
47
|
-
toasts: toasts.slice(-3),
|
|
48
|
-
visibilityState
|
|
49
|
-
});
|
|
50
|
-
})
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
override componentWillUnmount(): void {
|
|
54
|
-
this.toDisposeOnUnmount.dispose();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
override render(): React.ReactNode {
|
|
58
|
-
return (
|
|
59
|
-
<div className={`theia-notifications-container theia-notification-toasts ${this.state.visibilityState === 'toasts' ? 'open' : 'closed'}`}>
|
|
60
|
-
<div className='theia-notification-list'>
|
|
61
|
-
{this.state.toasts.map(notification => <NotificationComponent key={notification.messageId} notification={notification} manager={this.props.manager} />)}
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2019 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import * as React from '@theia/core/shared/react';
|
|
18
|
+
import { DisposableCollection } from '@theia/core';
|
|
19
|
+
import { NotificationManager, NotificationUpdateEvent } from './notifications-manager';
|
|
20
|
+
import { NotificationComponent } from './notification-component';
|
|
21
|
+
import { CorePreferences } from '@theia/core/lib/browser';
|
|
22
|
+
|
|
23
|
+
export interface NotificationToastsComponentProps {
|
|
24
|
+
readonly manager: NotificationManager;
|
|
25
|
+
readonly corePreferences: CorePreferences;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type NotificationToastsComponentState = Pick<NotificationUpdateEvent, Exclude<keyof NotificationUpdateEvent, 'notifications'>>;
|
|
29
|
+
|
|
30
|
+
export class NotificationToastsComponent extends React.Component<NotificationToastsComponentProps, NotificationToastsComponentState> {
|
|
31
|
+
|
|
32
|
+
constructor(props: NotificationToastsComponentProps) {
|
|
33
|
+
super(props);
|
|
34
|
+
this.state = {
|
|
35
|
+
toasts: [],
|
|
36
|
+
visibilityState: 'hidden'
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
protected readonly toDisposeOnUnmount = new DisposableCollection();
|
|
41
|
+
|
|
42
|
+
override async componentDidMount(): Promise<void> {
|
|
43
|
+
this.toDisposeOnUnmount.push(
|
|
44
|
+
this.props.manager.onUpdated(({ toasts, visibilityState }) => {
|
|
45
|
+
visibilityState = this.props.corePreferences['workbench.silentNotifications'] ? 'hidden' : visibilityState;
|
|
46
|
+
this.setState({
|
|
47
|
+
toasts: toasts.slice(-3),
|
|
48
|
+
visibilityState
|
|
49
|
+
});
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
override componentWillUnmount(): void {
|
|
54
|
+
this.toDisposeOnUnmount.dispose();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
override render(): React.ReactNode {
|
|
58
|
+
return (
|
|
59
|
+
<div className={`theia-notifications-container theia-notification-toasts ${this.state.visibilityState === 'toasts' ? 'open' : 'closed'}`}>
|
|
60
|
+
<div className='theia-notification-list'>
|
|
61
|
+
{this.state.toasts.map(notification => <NotificationComponent key={notification.messageId} notification={notification} manager={this.props.manager} />)}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2019 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { Command, nls } from '@theia/core';
|
|
18
|
-
import { codicon } from '@theia/core/lib/browser';
|
|
19
|
-
|
|
20
|
-
export namespace NotificationsCommands {
|
|
21
|
-
|
|
22
|
-
const NOTIFICATIONS_CATEGORY = 'Notifications';
|
|
23
|
-
const NOTIFICATIONS_CATEGORY_KEY = nls.getDefaultKey(NOTIFICATIONS_CATEGORY);
|
|
24
|
-
|
|
25
|
-
export const TOGGLE = Command.toLocalizedCommand({
|
|
26
|
-
id: 'notifications.commands.toggle',
|
|
27
|
-
category: NOTIFICATIONS_CATEGORY,
|
|
28
|
-
iconClass: codicon('list-unordered'),
|
|
29
|
-
label: 'Toggle Notifications'
|
|
30
|
-
}, 'theia/messages/toggleNotifications', NOTIFICATIONS_CATEGORY_KEY);
|
|
31
|
-
|
|
32
|
-
export const SHOW = Command.toDefaultLocalizedCommand({
|
|
33
|
-
id: 'notifications.commands.show',
|
|
34
|
-
category: NOTIFICATIONS_CATEGORY,
|
|
35
|
-
label: 'Show Notifications'
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export const HIDE = Command.toDefaultLocalizedCommand({
|
|
39
|
-
id: 'notifications.commands.hide',
|
|
40
|
-
category: NOTIFICATIONS_CATEGORY,
|
|
41
|
-
label: 'Hide Notifications'
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
export const CLEAR_ALL = Command.toDefaultLocalizedCommand({
|
|
45
|
-
id: 'notifications.commands.clearAll',
|
|
46
|
-
category: NOTIFICATIONS_CATEGORY,
|
|
47
|
-
iconClass: codicon('clear-all'),
|
|
48
|
-
label: 'Clear All Notifications'
|
|
49
|
-
});
|
|
50
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2019 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { Command, nls } from '@theia/core';
|
|
18
|
+
import { codicon } from '@theia/core/lib/browser';
|
|
19
|
+
|
|
20
|
+
export namespace NotificationsCommands {
|
|
21
|
+
|
|
22
|
+
const NOTIFICATIONS_CATEGORY = 'Notifications';
|
|
23
|
+
const NOTIFICATIONS_CATEGORY_KEY = nls.getDefaultKey(NOTIFICATIONS_CATEGORY);
|
|
24
|
+
|
|
25
|
+
export const TOGGLE = Command.toLocalizedCommand({
|
|
26
|
+
id: 'notifications.commands.toggle',
|
|
27
|
+
category: NOTIFICATIONS_CATEGORY,
|
|
28
|
+
iconClass: codicon('list-unordered'),
|
|
29
|
+
label: 'Toggle Notifications'
|
|
30
|
+
}, 'theia/messages/toggleNotifications', NOTIFICATIONS_CATEGORY_KEY);
|
|
31
|
+
|
|
32
|
+
export const SHOW = Command.toDefaultLocalizedCommand({
|
|
33
|
+
id: 'notifications.commands.show',
|
|
34
|
+
category: NOTIFICATIONS_CATEGORY,
|
|
35
|
+
label: 'Show Notifications'
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const HIDE = Command.toDefaultLocalizedCommand({
|
|
39
|
+
id: 'notifications.commands.hide',
|
|
40
|
+
category: NOTIFICATIONS_CATEGORY,
|
|
41
|
+
label: 'Hide Notifications'
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const CLEAR_ALL = Command.toDefaultLocalizedCommand({
|
|
45
|
+
id: 'notifications.commands.clearAll',
|
|
46
|
+
category: NOTIFICATIONS_CATEGORY,
|
|
47
|
+
iconClass: codicon('clear-all'),
|
|
48
|
+
label: 'Clear All Notifications'
|
|
49
|
+
});
|
|
50
|
+
}
|