@theia/messages 1.17.0-next.ff9e0507 → 1.18.0-next.05f289b3
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.js +11 -11
- package/lib/browser/messages-frontend-module.js.map +1 -1
- package/lib/browser/notification-center-component.d.ts.map +1 -1
- package/lib/browser/notification-center-component.js +32 -93
- package/lib/browser/notification-center-component.js.map +1 -1
- package/lib/browser/notification-component.d.ts.map +1 -1
- package/lib/browser/notification-component.js +31 -47
- package/lib/browser/notification-component.js.map +1 -1
- package/lib/browser/notification-content-renderer.js +11 -12
- package/lib/browser/notification-content-renderer.js.map +1 -1
- package/lib/browser/notification-content-renderer.spec.js +9 -11
- package/lib/browser/notification-content-renderer.spec.js.map +1 -1
- package/lib/browser/notification-preferences.js +5 -6
- package/lib/browser/notification-preferences.js.map +1 -1
- package/lib/browser/notification-toasts-component.js +23 -83
- package/lib/browser/notification-toasts-component.js.map +1 -1
- package/lib/browser/notifications-commands.d.ts.map +1 -1
- package/lib/browser/notifications-commands.js +4 -3
- package/lib/browser/notifications-commands.js.map +1 -1
- package/lib/browser/notifications-contribution.js +60 -66
- package/lib/browser/notifications-contribution.js.map +1 -1
- package/lib/browser/notifications-manager.js +163 -257
- package/lib/browser/notifications-manager.js.map +1 -1
- package/lib/browser/notifications-renderer.js +36 -39
- package/lib/browser/notifications-renderer.js.map +1 -1
- package/package.json +3 -3
- package/src/browser/notification-center-component.tsx +3 -2
- package/src/browser/notification-component.tsx +5 -4
- package/src/browser/notifications-commands.ts +3 -2
- package/src/browser/notifications-contribution.ts +1 -1
- package/src/browser/style/notifications.css +8 -31
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
********************************************************************************/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
require("../../src/browser/style/index.css");
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
exports.default = new inversify_1.ContainerModule(
|
|
19
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
20
|
+
const common_1 = require("@theia/core/lib/common");
|
|
21
|
+
const notifications_manager_1 = require("./notifications-manager");
|
|
22
|
+
const notification_preferences_1 = require("./notification-preferences");
|
|
23
|
+
const notifications_renderer_1 = require("./notifications-renderer");
|
|
24
|
+
const notifications_contribution_1 = require("./notifications-contribution");
|
|
25
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
26
|
+
const core_1 = require("@theia/core");
|
|
27
|
+
const color_application_contribution_1 = require("@theia/core/lib/browser/color-application-contribution");
|
|
28
|
+
const notification_content_renderer_1 = require("./notification-content-renderer");
|
|
29
|
+
exports.default = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
30
30
|
bind(notification_content_renderer_1.NotificationContentRenderer).toSelf().inSingletonScope();
|
|
31
31
|
bind(notifications_renderer_1.NotificationsRenderer).toSelf().inSingletonScope();
|
|
32
32
|
bind(notifications_contribution_1.NotificationsContribution).toSelf().inSingletonScope();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages-frontend-module.js","sourceRoot":"","sources":["../../src/browser/messages-frontend-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,6CAA2C;AAE3C,
|
|
1
|
+
{"version":3,"file":"messages-frontend-module.js","sourceRoot":"","sources":["../../src/browser/messages-frontend-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,6CAA2C;AAE3C,4DAA+D;AAC/D,mDAAuD;AACvD,mEAA8D;AAC9D,yEAAyE;AACzE,qEAAiE;AACjE,6EAAyG;AACzG,qDAAqH;AACrH,sCAAkD;AAClD,2GAA2F;AAC3F,mFAA8E;AAE9E,kBAAe,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IACjE,IAAI,CAAC,2DAA2B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC9D,IAAI,CAAC,8CAAqB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACxD,IAAI,CAAC,sDAAyB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC5D,IAAI,CAAC,yCAA+B,CAAC,CAAC,SAAS,CAAC,sDAAyB,CAAC,CAAC;IAC3E,IAAI,CAAC,0BAAmB,CAAC,CAAC,SAAS,CAAC,sDAAyB,CAAC,CAAC;IAC/D,IAAI,CAAC,gCAAsB,CAAC,CAAC,SAAS,CAAC,sDAAyB,CAAC,CAAC;IAClE,IAAI,CAAC,kDAAiB,CAAC,CAAC,SAAS,CAAC,sDAAyB,CAAC,CAAC;IAC7D,IAAI,CAAC,2DAA8B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACjE,IAAI,CAAC,2BAAiB,CAAC,CAAC,SAAS,CAAC,2DAA8B,CAAC,CAAC;IAClE,IAAI,CAAC,2CAAmB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACtD,MAAM,CAAC,sBAAa,CAAC,CAAC,SAAS,CAAC,2CAAmB,CAAC,CAAC;IACrD,sDAA2B,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-center-component.d.ts","sourceRoot":"","sources":["../../src/browser/notification-center-component.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"notification-center-component.d.ts","sourceRoot":"","sources":["../../src/browser/notification-center-component.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAMvF,MAAM,WAAW,gCAAgC;IAC7C,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;CACzC;AAED,aAAK,gCAAgC,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,MAAM,uBAAuB,EAAE,QAAQ,CAAC,CAAC,CAAC;AAExH,qBAAa,2BAA4B,SAAQ,KAAK,CAAC,SAAS,CAAC,gCAAgC,EAAE,gCAAgC,CAAC;gBAEpH,KAAK,EAAE,gCAAgC;IAQnD,SAAS,CAAC,QAAQ,CAAC,kBAAkB,uBAA8B;IAE7D,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUxC,oBAAoB,IAAI,IAAI;IAI5B,MAAM,IAAI,KAAK,CAAC,SAAS;IAyBzB,SAAS,CAAC,MAAM,aAEd;IAEF,SAAS,CAAC,UAAU,aAElB;CAEL"}
|
|
@@ -14,113 +14,52 @@
|
|
|
14
14
|
*
|
|
15
15
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
16
|
********************************************************************************/
|
|
17
|
-
var __extends = (this && this.__extends) || (function () {
|
|
18
|
-
var extendStatics = function (d, b) {
|
|
19
|
-
extendStatics = Object.setPrototypeOf ||
|
|
20
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
22
|
-
return extendStatics(d, b);
|
|
23
|
-
};
|
|
24
|
-
return function (d, b) {
|
|
25
|
-
extendStatics(d, b);
|
|
26
|
-
function __() { this.constructor = d; }
|
|
27
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
-
};
|
|
29
|
-
})();
|
|
30
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
40
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
41
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
42
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
43
|
-
function step(op) {
|
|
44
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
45
|
-
while (_) try {
|
|
46
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
47
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
48
|
-
switch (op[0]) {
|
|
49
|
-
case 0: case 1: t = op; break;
|
|
50
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
51
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
52
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
53
|
-
default:
|
|
54
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
55
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
56
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
57
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
58
|
-
if (t[2]) _.ops.pop();
|
|
59
|
-
_.trys.pop(); continue;
|
|
60
|
-
}
|
|
61
|
-
op = body.call(thisArg, _);
|
|
62
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
63
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
18
|
exports.NotificationCenterComponent = void 0;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
19
|
+
const React = require("@theia/core/shared/react");
|
|
20
|
+
const core_1 = require("@theia/core");
|
|
21
|
+
const notification_component_1 = require("./notification-component");
|
|
22
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
23
|
+
const PerfectScrollbar = require('react-perfect-scrollbar');
|
|
24
|
+
class NotificationCenterComponent extends React.Component {
|
|
25
|
+
constructor(props) {
|
|
26
|
+
super(props);
|
|
27
|
+
this.toDisposeOnUnmount = new core_1.DisposableCollection();
|
|
28
|
+
this.onHide = () => {
|
|
29
|
+
this.props.manager.hideCenter();
|
|
79
30
|
};
|
|
80
|
-
|
|
81
|
-
|
|
31
|
+
this.onClearAll = () => {
|
|
32
|
+
this.props.manager.clearAll();
|
|
82
33
|
};
|
|
83
|
-
|
|
34
|
+
this.state = {
|
|
84
35
|
notifications: [],
|
|
85
36
|
visibilityState: 'hidden'
|
|
86
37
|
};
|
|
87
|
-
return _this;
|
|
88
38
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var notifications = _a.notifications, visibilityState = _a.visibilityState;
|
|
95
|
-
_this.setState({
|
|
96
|
-
notifications: notifications,
|
|
97
|
-
visibilityState: visibilityState
|
|
98
|
-
});
|
|
99
|
-
}));
|
|
100
|
-
return [2 /*return*/];
|
|
39
|
+
async componentDidMount() {
|
|
40
|
+
this.toDisposeOnUnmount.push(this.props.manager.onUpdated(({ notifications, visibilityState }) => {
|
|
41
|
+
this.setState({
|
|
42
|
+
notifications: notifications,
|
|
43
|
+
visibilityState
|
|
101
44
|
});
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
componentWillUnmount() {
|
|
105
48
|
this.toDisposeOnUnmount.dispose();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return (React.createElement("div", { className: "theia-notifications-container theia-notification-center " + (this.state.visibilityState === 'center' ? 'open' : 'closed') },
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
const empty = this.state.notifications.length === 0;
|
|
52
|
+
const title = empty ? 'NO NEW NOTIFICATIONS' : 'NOTIFICATIONS';
|
|
53
|
+
return (React.createElement("div", { className: `theia-notifications-container theia-notification-center ${this.state.visibilityState === 'center' ? 'open' : 'closed'}` },
|
|
112
54
|
React.createElement("div", { className: 'theia-notification-center-header' },
|
|
113
55
|
React.createElement("div", { className: 'theia-notification-center-header-title' }, title),
|
|
114
56
|
React.createElement("div", { className: 'theia-notification-center-header-actions' },
|
|
115
57
|
React.createElement("ul", { className: 'theia-notification-actions' },
|
|
116
|
-
React.createElement("li", { className: '
|
|
117
|
-
React.createElement("li", { className: '
|
|
58
|
+
React.createElement("li", { className: browser_1.codicon('clear-all', true), title: 'Clear All', onClick: this.onClearAll }),
|
|
59
|
+
React.createElement("li", { className: browser_1.codicon('chevron-down', true), title: 'Hide Notification Center', onClick: this.onHide })))),
|
|
118
60
|
React.createElement(PerfectScrollbar, { className: 'theia-notification-list-scroll-container' },
|
|
119
|
-
React.createElement("div", { className: 'theia-notification-list' }, this.state.notifications.map(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
};
|
|
123
|
-
return NotificationCenterComponent;
|
|
124
|
-
}(React.Component));
|
|
61
|
+
React.createElement("div", { className: 'theia-notification-list' }, this.state.notifications.map(notification => React.createElement(notification_component_1.NotificationComponent, { key: notification.messageId, notification: notification, manager: this.props.manager }))))));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
125
64
|
exports.NotificationCenterComponent = NotificationCenterComponent;
|
|
126
65
|
//# sourceMappingURL=notification-center-component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-center-component.js","sourceRoot":"","sources":["../../src/browser/notification-center-component.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF
|
|
1
|
+
{"version":3,"file":"notification-center-component.js","sourceRoot":"","sources":["../../src/browser/notification-center-component.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,kDAAkD;AAClD,sCAAmD;AAEnD,qEAAiE;AACjE,qDAAkD;AAElD,MAAM,gBAAgB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAQ5D,MAAa,2BAA4B,SAAQ,KAAK,CAAC,SAA6E;IAEhI,YAAY,KAAuC;QAC/C,KAAK,CAAC,KAAK,CAAC,CAAC;QAOE,uBAAkB,GAAG,IAAI,2BAAoB,EAAE,CAAC;QAyCzD,WAAM,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACpC,CAAC,CAAC;QAEQ,eAAU,GAAG,GAAG,EAAE;YACxB,IAAI,CAAC,KAAK,CAAC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AO,EAAE,IAAI,CAAC,MAAM,GAAI,CACtG,CACH,CACJ;YACN,oBAAC,gBAAgB,IAAC,SAAS,EAAC,0CAA0C;gBAClE,6BAAK,SAAS,EAAC,yBAAyB,IACnC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CACzC,oBAAC,8CAAqB,IAAC,GAAG,EAAE,YAAY,CAAC,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAI,CAClH,CACC,CACS,CACjB,CACT,CAAC;IACN,CAAC;CAUJ;AA3DD,kEA2DC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-component.d.ts","sourceRoot":"","sources":["../../src/browser/notification-component.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"notification-component.d.ts","sourceRoot":"","sources":["../../src/browser/notification-component.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5E,MAAM,WAAW,0BAA0B;IACvC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACvC;AAED,qBAAa,qBAAsB,SAAQ,KAAK,CAAC,SAAS,CAAC,0BAA0B,CAAC;gBAEtE,KAAK,EAAE,0BAA0B;IAK7C,SAAS,CAAC,OAAO,UAAW,KAAK,CAAC,UAAU,UAO1C;IAEF,SAAS,CAAC,iBAAiB,UAAW,KAAK,CAAC,UAAU,UAOpD;IAEF,SAAS,CAAC,QAAQ,UAAW,KAAK,CAAC,UAAU,UAQ3C;IAEF,SAAS,CAAC,cAAc,UAAW,KAAK,CAAC,UAAU,UAOjD;IAEF,MAAM,IAAI,KAAK,CAAC,SAAS;CA8C5B"}
|
|
@@ -14,83 +14,67 @@
|
|
|
14
14
|
*
|
|
15
15
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
16
|
********************************************************************************/
|
|
17
|
-
var __extends = (this && this.__extends) || (function () {
|
|
18
|
-
var extendStatics = function (d, b) {
|
|
19
|
-
extendStatics = Object.setPrototypeOf ||
|
|
20
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
22
|
-
return extendStatics(d, b);
|
|
23
|
-
};
|
|
24
|
-
return function (d, b) {
|
|
25
|
-
extendStatics(d, b);
|
|
26
|
-
function __() { this.constructor = d; }
|
|
27
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
-
};
|
|
29
|
-
})();
|
|
30
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
18
|
exports.NotificationComponent = void 0;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
const React = require("@theia/core/shared/react");
|
|
20
|
+
const DOMPurify = require("@theia/core/shared/dompurify");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
class NotificationComponent extends React.Component {
|
|
23
|
+
constructor(props) {
|
|
24
|
+
super(props);
|
|
25
|
+
this.onClear = (event) => {
|
|
39
26
|
if (event.target instanceof HTMLElement) {
|
|
40
|
-
|
|
27
|
+
const messageId = event.target.dataset.messageId;
|
|
41
28
|
if (messageId) {
|
|
42
|
-
|
|
29
|
+
this.props.manager.clear(messageId);
|
|
43
30
|
}
|
|
44
31
|
}
|
|
45
32
|
};
|
|
46
|
-
|
|
33
|
+
this.onToggleExpansion = (event) => {
|
|
47
34
|
if (event.target instanceof HTMLElement) {
|
|
48
|
-
|
|
35
|
+
const messageId = event.target.dataset.messageId;
|
|
49
36
|
if (messageId) {
|
|
50
|
-
|
|
37
|
+
this.props.manager.toggleExpansion(messageId);
|
|
51
38
|
}
|
|
52
39
|
}
|
|
53
40
|
};
|
|
54
|
-
|
|
41
|
+
this.onAction = (event) => {
|
|
55
42
|
if (event.target instanceof HTMLElement) {
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
const messageId = event.target.dataset.messageId;
|
|
44
|
+
const action = event.target.dataset.action;
|
|
58
45
|
if (messageId && action) {
|
|
59
|
-
|
|
46
|
+
this.props.manager.accept(messageId, action);
|
|
60
47
|
}
|
|
61
48
|
}
|
|
62
49
|
};
|
|
63
|
-
|
|
50
|
+
this.onMessageClick = (event) => {
|
|
64
51
|
if (event.target instanceof HTMLAnchorElement) {
|
|
65
52
|
event.stopPropagation();
|
|
66
53
|
event.preventDefault();
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
const link = event.target.href;
|
|
55
|
+
this.props.manager.openLink(link);
|
|
69
56
|
}
|
|
70
57
|
};
|
|
71
|
-
|
|
72
|
-
return _this;
|
|
58
|
+
this.state = {};
|
|
73
59
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var isProgress = typeof progress === 'number';
|
|
60
|
+
render() {
|
|
61
|
+
const { messageId, message, type, progress, collapsed, expandable, source, actions } = this.props.notification;
|
|
62
|
+
const isProgress = typeof progress === 'number';
|
|
78
63
|
return (React.createElement("div", { key: messageId, className: 'theia-notification-list-item' },
|
|
79
|
-
React.createElement("div", { className:
|
|
64
|
+
React.createElement("div", { className: `theia-notification-list-item-content ${collapsed ? 'collapsed' : ''}` },
|
|
80
65
|
React.createElement("div", { className: 'theia-notification-list-item-content-main' },
|
|
81
|
-
React.createElement("div", { className:
|
|
66
|
+
React.createElement("div", { className: `theia-notification-icon ${browser_1.codicon(type)} ${type}` }),
|
|
82
67
|
React.createElement("div", { className: 'theia-notification-message' },
|
|
83
68
|
React.createElement("span", { dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(message) }, onClick: this.onMessageClick })),
|
|
84
69
|
React.createElement("ul", { className: 'theia-notification-actions' },
|
|
85
|
-
expandable && (React.createElement("li", { className: collapsed ? 'expand' : 'collapse', title: collapsed ? 'Expand' : 'Collapse', "data-message-id": messageId, onClick: this.onToggleExpansion })),
|
|
86
|
-
!isProgress && (React.createElement("li", { className: '
|
|
70
|
+
expandable && (React.createElement("li", { className: browser_1.codicon('chevron-down') + collapsed ? ' expand' : ' collapse', title: collapsed ? 'Expand' : 'Collapse', "data-message-id": messageId, onClick: this.onToggleExpansion })),
|
|
71
|
+
!isProgress && (React.createElement("li", { className: browser_1.codicon('close', true), title: 'Clear', "data-message-id": messageId, onClick: this.onClear })))),
|
|
87
72
|
(source || !!actions.length) && (React.createElement("div", { className: 'theia-notification-list-item-content-bottom' },
|
|
88
73
|
React.createElement("div", { className: 'theia-notification-source' }, source && (React.createElement("span", null, source))),
|
|
89
|
-
React.createElement("div", { className: 'theia-notification-buttons' }, actions && actions.map(
|
|
74
|
+
React.createElement("div", { className: 'theia-notification-buttons' }, actions && actions.map((action, index) => (React.createElement("button", { key: messageId + `-action-${index}`, className: 'theia-button', "data-message-id": messageId, "data-action": action, onClick: this.onAction }, action))))))),
|
|
90
75
|
isProgress && (React.createElement("div", { className: 'theia-notification-item-progress' },
|
|
91
|
-
React.createElement("div", { className: 'theia-notification-item-progressbar', style: { width: progress
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
}(React.Component));
|
|
76
|
+
React.createElement("div", { className: 'theia-notification-item-progressbar', style: { width: `${progress}%` } })))));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
95
79
|
exports.NotificationComponent = NotificationComponent;
|
|
96
80
|
//# sourceMappingURL=notification-component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-component.js","sourceRoot":"","sources":["../../src/browser/notification-component.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF
|
|
1
|
+
{"version":3,"file":"notification-component.js","sourceRoot":"","sources":["../../src/browser/notification-component.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,kDAAkD;AAClD,0DAA0D;AAE1D,qDAAkD;AAOlD,MAAa,qBAAsB,SAAQ,KAAK,CAAC,SAAqC;IAElF,YAAY,KAAiC;QACzC,KAAK,CAAC,KAAK,CAAC,CAAC;QAIP,YAAO,GAAG,CAAC,KAAuB,EAAE,EAAE;YAC5C,IAAI,KAAK,CAAC,MAAM,YAAY,WAAW,EAAE;gBACrC,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;gBACjD,IAAI,SAAS,EAAE;oBACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;iBACvC;aACJ;QACL,CAAC,CAAC;QAEQ,sBAAiB,GAAG,CAAC,KAAuB,EAAE,EAAE;YACtD,IAAI,KAAK,CAAC,MAAM,YAAY,WAAW,EAAE;gBACrC,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;gBACjD,IAAI,SAAS,EAAE;oBACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;iBACjD;aACJ;QACL,CAAC,CAAC;QAEQ,aAAQ,GAAG,CAAC,KAAuB,EAAE,EAAE;YAC7C,IAAI,KAAK,CAAC,MAAM,YAAY,WAAW,EAAE;gBACrC,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;gBACjD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;gBAC3C,IAAI,SAAS,IA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,
|
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.NotificationContentRenderer = void 0;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const markdownit = require("markdown-it");
|
|
26
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
27
|
+
let NotificationContentRenderer = class NotificationContentRenderer {
|
|
28
|
+
constructor() {
|
|
29
29
|
this.mdEngine = markdownit({ html: false });
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
renderMessage(content) {
|
|
32
32
|
// in alignment with vscode, new lines aren't supported
|
|
33
|
-
|
|
33
|
+
const contentWithoutNewlines = content.replace(/((\r)?\n)+/gm, ' ');
|
|
34
34
|
return this.mdEngine.renderInline(contentWithoutNewlines);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}());
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
NotificationContentRenderer = __decorate([
|
|
38
|
+
inversify_1.injectable()
|
|
39
|
+
], NotificationContentRenderer);
|
|
41
40
|
exports.NotificationContentRenderer = NotificationContentRenderer;
|
|
42
41
|
//# sourceMappingURL=notification-content-renderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-content-renderer.js","sourceRoot":"","sources":["../../src/browser/notification-content-renderer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,
|
|
1
|
+
{"version":3,"file":"notification-content-renderer.js","sourceRoot":"","sources":["../../src/browser/notification-content-renderer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,0CAA0C;AAC1C,4DAA0D;AAG1D,IAAa,2BAA2B,GAAxC,MAAa,2BAA2B;IAAxC;QAEuB,aAAQ,GAAG,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAQ9D,CAAC;IANG,aAAa,CAAC,OAAe;QACzB,uDAAuD;QACvD,MAAM,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QAEpE,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC;IAC9D,CAAC;CACJ,CAAA;AAVY,2BAA2B;IADvC,sBAAU,EAAE;GACA,2BAA2B,CAUvC;AAVY,kEAA2B"}
|
|
@@ -15,31 +15,29 @@
|
|
|
15
15
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
16
|
********************************************************************************/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const chai_1 = require("chai");
|
|
19
|
+
const notification_content_renderer_1 = require("./notification-content-renderer");
|
|
20
20
|
/* eslint-disable no-unused-expressions */
|
|
21
|
-
describe('notification-content-renderer',
|
|
22
|
-
|
|
23
|
-
it('should remove new lines',
|
|
21
|
+
describe('notification-content-renderer', () => {
|
|
22
|
+
const contentRenderer = new notification_content_renderer_1.NotificationContentRenderer();
|
|
23
|
+
it('should remove new lines', () => {
|
|
24
24
|
expectRenderedContent('foo\nbar', 'foo bar');
|
|
25
25
|
expectRenderedContent('foo\n\n\nbar', 'foo bar');
|
|
26
26
|
});
|
|
27
|
-
it('should render links',
|
|
27
|
+
it('should render links', () => {
|
|
28
28
|
expectRenderedContent('Link to [theia](https://github.com/eclipse-theia/theia)!', 'Link to <a href="https://github.com/eclipse-theia/theia">theia</a>!');
|
|
29
29
|
expectRenderedContent('Link to [theia](https://github.com/eclipse-theia/theia "title on hover")!', 'Link to <a href="https://github.com/eclipse-theia/theia" title="title on hover">theia</a>!');
|
|
30
30
|
expectRenderedContent('Click [here](command:my-command-id) to open stuff!', 'Click <a href="command:my-command-id">here</a> to open stuff!');
|
|
31
31
|
expectRenderedContent('Click [here](javascript:window.alert();) to open stuff!', 'Click [here](javascript:window.alert();) to open stuff!');
|
|
32
32
|
});
|
|
33
|
-
it('should render markdown',
|
|
33
|
+
it('should render markdown', () => {
|
|
34
34
|
expectRenderedContent('*italic*', '<em>italic</em>');
|
|
35
35
|
expectRenderedContent('**bold**', '<strong>bold</strong>');
|
|
36
36
|
});
|
|
37
|
-
it('should not render html',
|
|
37
|
+
it('should not render html', () => {
|
|
38
38
|
expectRenderedContent('<script>document.getElementById("demo").innerHTML = "Hello JavaScript!";</script>', '<script>document.getElementById("demo").innerHTML = "Hello JavaScript!";</script>');
|
|
39
39
|
expectRenderedContent('<a href="javascript:window.alert();">foobar</a>', '<a href="javascript:window.alert();">foobar</a>');
|
|
40
40
|
});
|
|
41
|
-
|
|
42
|
-
return chai_1.expect(contentRenderer.renderMessage(input)).to.be.equal(output);
|
|
43
|
-
};
|
|
41
|
+
const expectRenderedContent = (input, output) => chai_1.expect(contentRenderer.renderMessage(input)).to.be.equal(output);
|
|
44
42
|
});
|
|
45
43
|
//# sourceMappingURL=notification-content-renderer.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-content-renderer.spec.js","sourceRoot":"","sources":["../../src/browser/notification-content-renderer.spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAElF
|
|
1
|
+
{"version":3,"file":"notification-content-renderer.spec.js","sourceRoot":"","sources":["../../src/browser/notification-content-renderer.spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,+BAA8B;AAC9B,mFAA8E;AAE9E,0CAA0C;AAE1C,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAE3C,MAAM,eAAe,GAAG,IAAI,2DAA2B,EAAE,CAAC;IAE1D,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QAC/B,qBAAqB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QAC7C,qBAAqB,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE;QAC3B,qBAAqB,CACjB,0DAA0D,EAC1D,qEAAqE,CACxE,CAAC;QACF,qBAAqB,CACjB,2EAA2E,EAC3E,4FAA4F,CAC/F,CAAC;QACF,qBAAqB,CACjB,oDAAoD,EACpD,+DAA+D,CAClE,CAAC;QACF,qBAAqB,CACjB,yDAAyD,EACzD,yDAAyD,CAC5D,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QAC9B,qBAAqB,CACjB,UAAU,EACV,iBAAiB,CACpB,CAAC;QACF,qBAAqB,CACjB,UAAU,EACV,uBAAuB,CAC1B,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QAC9B,qBAAqB,CACjB,mFAAmF,EACnF,mHAAmH,CACtH,CAAC;QACF,qBAAqB,CACjB,iDAAiD,EACjD,uEAAuE,CAC1E,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,MAAM,qBAAqB,GAAG,CAAC,KAAa,EAAE,MAAc,EAAE,EAAE,CAC5D,aAAM,CAAC,eAAe,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAEzE,CAAC,CAAC,CAAC"}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
********************************************************************************/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.bindNotificationPreferences = exports.createNotificationPreferences = exports.NotificationPreferences = exports.NotificationPreferenceContribution = exports.NotificationConfigSchema = void 0;
|
|
19
|
-
|
|
19
|
+
const preferences_1 = require("@theia/core/lib/browser/preferences");
|
|
20
20
|
exports.NotificationConfigSchema = {
|
|
21
21
|
'type': 'object',
|
|
22
22
|
'properties': {
|
|
@@ -29,15 +29,14 @@ exports.NotificationConfigSchema = {
|
|
|
29
29
|
};
|
|
30
30
|
exports.NotificationPreferenceContribution = Symbol('NotificationPreferenceContribution');
|
|
31
31
|
exports.NotificationPreferences = Symbol('NotificationPreferences');
|
|
32
|
-
function createNotificationPreferences(preferences, schema) {
|
|
33
|
-
if (schema === void 0) { schema = exports.NotificationConfigSchema; }
|
|
32
|
+
function createNotificationPreferences(preferences, schema = exports.NotificationConfigSchema) {
|
|
34
33
|
return preferences_1.createPreferenceProxy(preferences, schema);
|
|
35
34
|
}
|
|
36
35
|
exports.createNotificationPreferences = createNotificationPreferences;
|
|
37
36
|
function bindNotificationPreferences(bind) {
|
|
38
|
-
bind(exports.NotificationPreferences).toDynamicValue(
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
bind(exports.NotificationPreferences).toDynamicValue(ctx => {
|
|
38
|
+
const preferences = ctx.container.get(preferences_1.PreferenceService);
|
|
39
|
+
const contribution = ctx.container.get(exports.NotificationPreferenceContribution);
|
|
41
40
|
return createNotificationPreferences(preferences, contribution.schema);
|
|
42
41
|
}).inSingletonScope();
|
|
43
42
|
bind(exports.NotificationPreferenceContribution).toConstantValue({ schema: exports.NotificationConfigSchema });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-preferences.js","sourceRoot":"","sources":["../../src/browser/notification-preferences.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAGlF,
|
|
1
|
+
{"version":3,"file":"notification-preferences.js","sourceRoot":"","sources":["../../src/browser/notification-preferences.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAGlF,qEAM6C;AAEhC,QAAA,wBAAwB,GAAqB;IACtD,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE;QACV,sBAAsB,EAAE;YACpB,MAAM,EAAE,QAAQ;YAChB,aAAa,EAAE,8DAA8D;YAC7E,SAAS,EAAE,EAAE,GAAG,IAAI,CAAC,qDAAqD;SAC7E;KACJ;CACJ,CAAC;AAMW,QAAA,kCAAkC,GAAG,MAAM,CAAC,oCAAoC,CAAC,CAAC;AAClF,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAGzE,SAAgB,6BAA6B,CAAC,WAA8B,EAAE,SAA2B,gCAAwB;IAC7H,OAAO,mCAAqB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AAFD,sEAEC;AAED,SAAgB,2BAA2B,CAAC,IAAqB;IAC7D,IAAI,CAAC,+BAAuB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QAC/C,MAAM,WAAW,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAoB,+BAAiB,CAAC,CAAC;QAC5E,MAAM,YAAY,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAyB,0CAAkC,CAAC,CAAC;QACnG,OAAO,6BAA6B,CAAC,WAAW,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACtB,IAAI,CAAC,0CAAkC,CAAC,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,gCAAwB,EAAE,CAAC,CAAC;IAC/F,IAAI,CAAC,oCAAsB,CAAC,CAAC,SAAS,CAAC,0CAAkC,CAAC,CAAC;AAC/E,CAAC;AARD,kEAQC"}
|
|
@@ -14,96 +14,36 @@
|
|
|
14
14
|
*
|
|
15
15
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
16
|
********************************************************************************/
|
|
17
|
-
var __extends = (this && this.__extends) || (function () {
|
|
18
|
-
var extendStatics = function (d, b) {
|
|
19
|
-
extendStatics = Object.setPrototypeOf ||
|
|
20
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
22
|
-
return extendStatics(d, b);
|
|
23
|
-
};
|
|
24
|
-
return function (d, b) {
|
|
25
|
-
extendStatics(d, b);
|
|
26
|
-
function __() { this.constructor = d; }
|
|
27
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
-
};
|
|
29
|
-
})();
|
|
30
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
40
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
41
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
42
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
43
|
-
function step(op) {
|
|
44
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
45
|
-
while (_) try {
|
|
46
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
47
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
48
|
-
switch (op[0]) {
|
|
49
|
-
case 0: case 1: t = op; break;
|
|
50
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
51
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
52
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
53
|
-
default:
|
|
54
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
55
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
56
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
57
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
58
|
-
if (t[2]) _.ops.pop();
|
|
59
|
-
_.trys.pop(); continue;
|
|
60
|
-
}
|
|
61
|
-
op = body.call(thisArg, _);
|
|
62
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
63
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
18
|
exports.NotificationToastsComponent = void 0;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
_this.state = {
|
|
19
|
+
const React = require("@theia/core/shared/react");
|
|
20
|
+
const core_1 = require("@theia/core");
|
|
21
|
+
const notification_component_1 = require("./notification-component");
|
|
22
|
+
class NotificationToastsComponent extends React.Component {
|
|
23
|
+
constructor(props) {
|
|
24
|
+
super(props);
|
|
25
|
+
this.toDisposeOnUnmount = new core_1.DisposableCollection();
|
|
26
|
+
this.state = {
|
|
77
27
|
toasts: [],
|
|
78
28
|
visibilityState: 'hidden'
|
|
79
29
|
};
|
|
80
|
-
return _this;
|
|
81
30
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
visibilityState = _this.props.corePreferences['workbench.silentNotifications'] ? 'hidden' : visibilityState;
|
|
89
|
-
_this.setState({
|
|
90
|
-
toasts: toasts.slice(-3),
|
|
91
|
-
visibilityState: visibilityState
|
|
92
|
-
});
|
|
93
|
-
}));
|
|
94
|
-
return [2 /*return*/];
|
|
31
|
+
async componentDidMount() {
|
|
32
|
+
this.toDisposeOnUnmount.push(this.props.manager.onUpdated(({ toasts, visibilityState }) => {
|
|
33
|
+
visibilityState = this.props.corePreferences['workbench.silentNotifications'] ? 'hidden' : visibilityState;
|
|
34
|
+
this.setState({
|
|
35
|
+
toasts: toasts.slice(-3),
|
|
36
|
+
visibilityState
|
|
95
37
|
});
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
componentWillUnmount() {
|
|
99
41
|
this.toDisposeOnUnmount.dispose();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return NotificationToastsComponent;
|
|
107
|
-
}(React.Component));
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return (React.createElement("div", { className: `theia-notifications-container theia-notification-toasts ${this.state.visibilityState === 'toasts' ? 'open' : 'closed'}` },
|
|
45
|
+
React.createElement("div", { className: 'theia-notification-list' }, this.state.toasts.map(notification => React.createElement(notification_component_1.NotificationComponent, { key: notification.messageId, notification: notification, manager: this.props.manager })))));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
108
48
|
exports.NotificationToastsComponent = NotificationToastsComponent;
|
|
109
49
|
//# sourceMappingURL=notification-toasts-component.js.map
|