openfin-notifications 1.12.2 → 1.13.0-alpha-898
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 +17 -8
- package/dist/client/index.d.ts +1 -0
- package/dist/client/internal.d.ts +10 -3
- package/dist/client/main-bundle.js +201 -160
- package/dist/client/main-bundle.js.map +1 -1
- package/dist/client/openfin-notifications.js +1 -1
- package/dist/client/openfin-notifications.js.map +1 -1
- package/dist/client/platform.d.ts +41 -0
- package/dist/client/templates/BaseNotificationOptions.d.ts +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,23 +8,32 @@ The OpenFin Notification Center provides developers with a uniform way to create
|
|
|
8
8
|
|
|
9
9
|
Notifications will be displayed as toasts as well as being listed and organized in a Notification Center. The Notification Center can be accessed by clicking on the Notifications icon in the system tray.
|
|
10
10
|
|
|
11
|
-
This project consist of
|
|
11
|
+
This project consist of 3 parts:
|
|
12
12
|
|
|
13
13
|
1. The Notification Center, displaying and managing notifications
|
|
14
14
|
2. The Notification Center Client Library, exposing APIs for applications to create and manage notifications
|
|
15
|
+
3. The Notification Studio, A visual editor for user notifications.
|
|
15
16
|
|
|
16
17
|
### Dependencies
|
|
17
18
|
|
|
18
|
-
- OpenFin version
|
|
19
|
-
- OpenFin
|
|
20
|
-
- RVM >= 4.7
|
|
19
|
+
- OpenFin version used by the Notifications Provider = 23.96.68.3
|
|
20
|
+
- OpenFin RVM >= 4.7
|
|
21
21
|
|
|
22
22
|
### Features
|
|
23
23
|
|
|
24
|
-
- Create notifications
|
|
25
|
-
- Clear and dismiss notifications
|
|
26
|
-
- Attach handlers for when notifications are created, closed, and interacted with
|
|
27
|
-
-
|
|
24
|
+
- Create notifications.
|
|
25
|
+
- Clear and dismiss notifications.
|
|
26
|
+
- Attach handlers for when notifications are created, closed, and interacted with.
|
|
27
|
+
- Attach indicators and buttons with actions to notifications.
|
|
28
|
+
- Persist notifications in the Notification Center.
|
|
29
|
+
- Persist notification toasts.
|
|
30
|
+
- Create expiring and/or future notifications.
|
|
31
|
+
- Search notifications in the Notification Center.
|
|
32
|
+
- Create notifications with markdown, form, premade or custom templated notification content.
|
|
33
|
+
- Create grouping streams for notifications.
|
|
34
|
+
- Create pop-out frame windows for individiual notification senders and streams.
|
|
35
|
+
- Customize to specify the Notification Center and notification toast corners on screen.
|
|
36
|
+
- Customize Notification Center theme via Workspace Platforms.
|
|
28
37
|
|
|
29
38
|
## Getting Started
|
|
30
39
|
|
package/dist/client/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from './source';
|
|
|
21
21
|
export * from './forms';
|
|
22
22
|
export * from './stream';
|
|
23
23
|
export * from './templates';
|
|
24
|
+
export * from './platform';
|
|
24
25
|
export { provider, NotificationOptions };
|
|
25
26
|
export { NotificationIndicator, IndicatorColor, IndicatorType as NotificationIndicatorType };
|
|
26
27
|
/**
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
import { NotificationActionResult, ActionTrigger } from './actions';
|
|
11
11
|
import { ProviderStatus } from './provider';
|
|
12
12
|
import { NotificationSource } from './source';
|
|
13
|
-
import { NotificationOptions, Notification, NotificationActionEvent, NotificationClosedEvent, NotificationCreatedEvent, NotificationsCountChanged, NotificationFormSubmittedEvent, UpdatableNotification } from './index';
|
|
14
|
-
import { UpdatableNotificationOptions } from './templates/update';
|
|
13
|
+
import { NotificationOptions, Notification, NotificationActionEvent, NotificationClosedEvent, NotificationCreatedEvent, NotificationsCountChanged, NotificationFormSubmittedEvent, UpdatableNotification, NotificationPlatform, UpdatableNotificationOptions } from './index';
|
|
15
14
|
/**
|
|
16
15
|
* The identity of the main application window of the service provider
|
|
17
16
|
*/
|
|
@@ -33,7 +32,9 @@ export declare const enum APITopic {
|
|
|
33
32
|
ADD_EVENT_LISTENER = "add-event-listener",
|
|
34
33
|
REMOVE_EVENT_LISTENER = "remove-event-listener",
|
|
35
34
|
GET_PROVIDER_STATUS = "get-provider-status",
|
|
36
|
-
GET_NOTIFICATIONS_COUNT = "get-notifications-count"
|
|
35
|
+
GET_NOTIFICATIONS_COUNT = "get-notifications-count",
|
|
36
|
+
REGISTER_PLATFORM = "register-notifications-platform",
|
|
37
|
+
DEREGISTER_PLATFORM = "deregister-notifications-platform"
|
|
37
38
|
}
|
|
38
39
|
export interface API {
|
|
39
40
|
[APITopic.CREATE_NOTIFICATION]: [CreatePayload, NotificationInternal];
|
|
@@ -46,6 +47,8 @@ export interface API {
|
|
|
46
47
|
[APITopic.REMOVE_EVENT_LISTENER]: [Events['type'], void];
|
|
47
48
|
[APITopic.GET_PROVIDER_STATUS]: [undefined, ProviderStatus];
|
|
48
49
|
[APITopic.GET_NOTIFICATIONS_COUNT]: [undefined, number];
|
|
50
|
+
[APITopic.REGISTER_PLATFORM]: [PlatformRegisterPayload, void];
|
|
51
|
+
[APITopic.DEREGISTER_PLATFORM]: [PlatformDeregisterPayload, void];
|
|
49
52
|
}
|
|
50
53
|
export declare type Events = NotificationActionEvent | NotificationClosedEvent | NotificationCreatedEvent | NotificationsCountChanged | NotificationFormSubmittedEvent;
|
|
51
54
|
export declare type TransportMappings<T> = T extends NotificationActionEvent ? NotificationActionEventTransport : never;
|
|
@@ -66,6 +69,10 @@ export declare type UpdatableNotificationInternal<T extends UpdatableNotificatio
|
|
|
66
69
|
export interface ClearPayload {
|
|
67
70
|
id: string;
|
|
68
71
|
}
|
|
72
|
+
export declare type PlatformRegisterPayload<T extends NotificationPlatform = NotificationPlatform> = T;
|
|
73
|
+
export interface PlatformDeregisterPayload {
|
|
74
|
+
id: string;
|
|
75
|
+
}
|
|
69
76
|
export interface NotificationActionEventTransport {
|
|
70
77
|
type: 'notification-action';
|
|
71
78
|
notification: Readonly<NotificationInternal>;
|
|
@@ -128,6 +128,8 @@ var APITopic;
|
|
|
128
128
|
APITopic["REMOVE_EVENT_LISTENER"] = "remove-event-listener";
|
|
129
129
|
APITopic["GET_PROVIDER_STATUS"] = "get-provider-status";
|
|
130
130
|
APITopic["GET_NOTIFICATIONS_COUNT"] = "get-notifications-count";
|
|
131
|
+
APITopic["REGISTER_PLATFORM"] = "register-notifications-platform";
|
|
132
|
+
APITopic["DEREGISTER_PLATFORM"] = "deregister-notifications-platform";
|
|
131
133
|
})(APITopic = exports.APITopic || (exports.APITopic = {}));
|
|
132
134
|
|
|
133
135
|
|
|
@@ -137,159 +139,6 @@ var APITopic;
|
|
|
137
139
|
|
|
138
140
|
"use strict";
|
|
139
141
|
|
|
140
|
-
/**
|
|
141
|
-
* Actions are the mechanism through which notifications send messages back to the application that created them. The
|
|
142
|
-
* service defines a number of ways in which actions can be raised (a notification being interacted with by the user,
|
|
143
|
-
* being closed, expiring, etc.), and it is up to each application to decide if it wishes to be informed when each of
|
|
144
|
-
* these triggers occur.
|
|
145
|
-
*
|
|
146
|
-
* For an action to be raised when one of these triggers occurs, the application must specify an
|
|
147
|
-
* {@link NotificationActionResult|action result} for each trigger it is interested in. The application should then
|
|
148
|
-
* listen for when these actions are raised by listening for the {@link NotificationActionEvent|`notification-action`}
|
|
149
|
-
* event.
|
|
150
|
-
*
|
|
151
|
-
* This event is fired once each time an action is raised, and will contain the
|
|
152
|
-
* {@link NotificationActionResult|action result} the application specified for that trigger. The application may then
|
|
153
|
-
* use the {@link NotificationActionResult|action result} to determine which trigger occurred and respond appropriately.
|
|
154
|
-
*
|
|
155
|
-
* If an {@link NotificationActionResult|action result} is not specified for a particular trigger, or it is set to
|
|
156
|
-
* `null`, the application will not receive a corresponding {@link NotificationActionEvent|`notification-action`} when
|
|
157
|
-
* that trigger occurs.
|
|
158
|
-
*
|
|
159
|
-
* Unlike other event types, {@link NotificationActionEvent|`notification-action`} events will be buffered by the
|
|
160
|
-
* service until the application has added a listener for this event type, at which point it will receive all buffered
|
|
161
|
-
* {@link NotificationActionEvent|`notification-action`} events. The service will also attempt to restart the
|
|
162
|
-
* application if it is not running when the event is fired.
|
|
163
|
-
*
|
|
164
|
-
* For an overview of actions, consider the sample notification below:
|
|
165
|
-
* ```ts
|
|
166
|
-
* import {addEventListener, create} from 'openfin-notifications';
|
|
167
|
-
*
|
|
168
|
-
* // Create a notification with two buttons
|
|
169
|
-
* create({
|
|
170
|
-
* // Basic info
|
|
171
|
-
* title: 'Reminder',
|
|
172
|
-
* body: 'Event "Weekly Meeting" is starting soon...',
|
|
173
|
-
* category: 'Upcoming Events',
|
|
174
|
-
*
|
|
175
|
-
* // We'll use the 'customData' field to store metadata about the event
|
|
176
|
-
* customData: {eventId: '12345'},
|
|
177
|
-
*
|
|
178
|
-
* // We want the user clicking the notification to open the associated event, so register an 'onSelect' action
|
|
179
|
-
* onSelect: {task: 'view-calendar-event', target: 'popup'},
|
|
180
|
-
*
|
|
181
|
-
* buttons: [
|
|
182
|
-
* // A button that will schedule another reminder for 5 minutes from now. Since the application will be
|
|
183
|
-
* // responsible for snoozing the event, it will need to know about the user clicking this button. By setting
|
|
184
|
-
* // a NotificationActionResult for 'onClick', the service will raise a "notification-action" event when this
|
|
185
|
-
* // button is clicked, and will pass the value of 'onClick' as the 'result' field within the event
|
|
186
|
-
* {
|
|
187
|
-
* title: 'Snooze for 5 minutes',
|
|
188
|
-
* iconUrl: 'https://www.example.com/timer.png',
|
|
189
|
-
* onClick: {
|
|
190
|
-
* task: 'schedule-reminder',
|
|
191
|
-
* intervalMs: 5 * 60 * 1000
|
|
192
|
-
* }
|
|
193
|
-
* },
|
|
194
|
-
*
|
|
195
|
-
* // A button that closes the notification and doesn't prompt the user about this event again. Since the
|
|
196
|
-
* // application doesn't need to do anything when the user clicks this button, we leave 'onClick' undefined
|
|
197
|
-
* // rather than specifying a NotificationActionResult. This means that no action will be raised when the
|
|
198
|
-
* // button is clicked, and hence no "notification-action" event will be fired
|
|
199
|
-
* {
|
|
200
|
-
* title: 'Dismiss',
|
|
201
|
-
* iconUrl: 'https://www.example.com/cancel.png'
|
|
202
|
-
* }
|
|
203
|
-
* ]
|
|
204
|
-
* });
|
|
205
|
-
*
|
|
206
|
-
* // Create a listener that will be called for each action
|
|
207
|
-
* // Note: This handler will be used for ALL actions, from ALL notifications that are created by this application.
|
|
208
|
-
* addEventListener('notification-action', (event: NotificationActionEvent) => {
|
|
209
|
-
* const {result, notification} = event;
|
|
210
|
-
*
|
|
211
|
-
* if (result['task'] === 'view-calendar-event') {
|
|
212
|
-
* // Open a window with full details of the associated event
|
|
213
|
-
* openEventDetails(notification.customData.eventId, result['target']);
|
|
214
|
-
* } else if (result['task'] === 'schedule-reminder') {
|
|
215
|
-
* // Schedule a new notification
|
|
216
|
-
* scheduleReminder(notification.customData.eventId, Date.now() + result['intervalMs']);
|
|
217
|
-
* } // Etc...
|
|
218
|
-
* });
|
|
219
|
-
* ```
|
|
220
|
-
*
|
|
221
|
-
* The example above uses `customData` to store details about the notification subject (in this case, a calendar
|
|
222
|
-
* event), and `onClick` actions to inform the application about how it should respond when the user interacts with the
|
|
223
|
-
* notification. This is our intended usage and recommended best-practice, but the service doesn't require applications
|
|
224
|
-
* to follow this convention - application developers are free to decide how to manage notification state.
|
|
225
|
-
*
|
|
226
|
-
* Within the `notification-action` handler, the application must be able to understand which notification is being
|
|
227
|
-
* handled, and how to decide what it should do next. The example above uses an application-defined `action` field to
|
|
228
|
-
* determine the correct action, but the notification's `id`, `category`, `customData` and other fields are also useful
|
|
229
|
-
* selectors.
|
|
230
|
-
*
|
|
231
|
-
* @module Actions
|
|
232
|
-
*/
|
|
233
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
234
|
-
exports.ActionNoopType = exports.ActionTrigger = void 0;
|
|
235
|
-
/**
|
|
236
|
-
* Lists the different triggers that can raise an {@link Actions|action}. Each action that is raised will result in a
|
|
237
|
-
* {@link NotificationActionEvent|`notification-action`} event, which can be captured by the application that created
|
|
238
|
-
* the notification.
|
|
239
|
-
*/
|
|
240
|
-
var ActionTrigger;
|
|
241
|
-
(function (ActionTrigger) {
|
|
242
|
-
/**
|
|
243
|
-
* The user interacted with one of the controls within the notification. This currently means a button click, but
|
|
244
|
-
* other control types will be added in future releases.
|
|
245
|
-
*/
|
|
246
|
-
ActionTrigger["CONTROL"] = "control";
|
|
247
|
-
/**
|
|
248
|
-
* The user clicked the body of the notification itself. Any clicks of the notification that don't hit a control
|
|
249
|
-
* or the close button will fire an event with the `'select'` action trigger.
|
|
250
|
-
*/
|
|
251
|
-
ActionTrigger["SELECT"] = "select";
|
|
252
|
-
/**
|
|
253
|
-
* The notification was closed, either by user interaction, programmatically by an application, or by the notification expiring.
|
|
254
|
-
*/
|
|
255
|
-
ActionTrigger["CLOSE"] = "close";
|
|
256
|
-
/**
|
|
257
|
-
* The notification expired.
|
|
258
|
-
*/
|
|
259
|
-
ActionTrigger["EXPIRE"] = "expire";
|
|
260
|
-
/**
|
|
261
|
-
* The action was triggered programmatically by an application.
|
|
262
|
-
*
|
|
263
|
-
* *Not currently supported - will be implemented in a future release*
|
|
264
|
-
*/
|
|
265
|
-
ActionTrigger["PROGRAMMATIC"] = "programmatic";
|
|
266
|
-
})(ActionTrigger = exports.ActionTrigger || (exports.ActionTrigger = {}));
|
|
267
|
-
/**
|
|
268
|
-
* Noop action types see {@link ActionNoop|ActionNoop}.
|
|
269
|
-
*/
|
|
270
|
-
var ActionNoopType;
|
|
271
|
-
(function (ActionNoopType) {
|
|
272
|
-
/**
|
|
273
|
-
* No event will be raised and no dismissal of the notification on action.
|
|
274
|
-
*/
|
|
275
|
-
ActionNoopType["EVENT_DISMISS"] = "event_dismiss";
|
|
276
|
-
/**
|
|
277
|
-
* No event will be raised, but the notification will be dismissed on action.
|
|
278
|
-
*/
|
|
279
|
-
// EVENT = 'event',
|
|
280
|
-
/**
|
|
281
|
-
* No dismissal of the notification, but the action event will be raised on action.
|
|
282
|
-
*/
|
|
283
|
-
// DISMISS = 'dismiss',
|
|
284
|
-
})(ActionNoopType = exports.ActionNoopType || (exports.ActionNoopType = {}));
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
/***/ }),
|
|
288
|
-
/* 2 */
|
|
289
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
290
|
-
|
|
291
|
-
"use strict";
|
|
292
|
-
|
|
293
142
|
/**
|
|
294
143
|
* @hidden
|
|
295
144
|
*/
|
|
@@ -319,7 +168,7 @@ let channelPromise;
|
|
|
319
168
|
const hasDOMContentLoaded = new openfin_service_async_1.DeferredPromise();
|
|
320
169
|
let reconnect = false;
|
|
321
170
|
const MIN_API_VERSION = 53;
|
|
322
|
-
if (typeof fin !== 'undefined') {
|
|
171
|
+
if (typeof fin !== 'undefined' && typeof window !== 'undefined') {
|
|
323
172
|
launchSystemApp();
|
|
324
173
|
getServicePromise();
|
|
325
174
|
if (document.readyState !== 'loading') {
|
|
@@ -392,7 +241,7 @@ async function getServicePromise() {
|
|
|
392
241
|
}, 5000);
|
|
393
242
|
channelPromise = fin.InterApplicationBus.Channel.connect(internal_1.SERVICE_CHANNEL, {
|
|
394
243
|
wait: true,
|
|
395
|
-
payload: { version: '1.
|
|
244
|
+
payload: { version: '1.13.0-alpha-898' },
|
|
396
245
|
}).then((channel) => {
|
|
397
246
|
window.clearTimeout(timeoutHandle);
|
|
398
247
|
const eventRouter = getEventRouter();
|
|
@@ -447,6 +296,159 @@ function getEventRouter() {
|
|
|
447
296
|
exports.getEventRouter = getEventRouter;
|
|
448
297
|
|
|
449
298
|
|
|
299
|
+
/***/ }),
|
|
300
|
+
/* 2 */
|
|
301
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
302
|
+
|
|
303
|
+
"use strict";
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Actions are the mechanism through which notifications send messages back to the application that created them. The
|
|
307
|
+
* service defines a number of ways in which actions can be raised (a notification being interacted with by the user,
|
|
308
|
+
* being closed, expiring, etc.), and it is up to each application to decide if it wishes to be informed when each of
|
|
309
|
+
* these triggers occur.
|
|
310
|
+
*
|
|
311
|
+
* For an action to be raised when one of these triggers occurs, the application must specify an
|
|
312
|
+
* {@link NotificationActionResult|action result} for each trigger it is interested in. The application should then
|
|
313
|
+
* listen for when these actions are raised by listening for the {@link NotificationActionEvent|`notification-action`}
|
|
314
|
+
* event.
|
|
315
|
+
*
|
|
316
|
+
* This event is fired once each time an action is raised, and will contain the
|
|
317
|
+
* {@link NotificationActionResult|action result} the application specified for that trigger. The application may then
|
|
318
|
+
* use the {@link NotificationActionResult|action result} to determine which trigger occurred and respond appropriately.
|
|
319
|
+
*
|
|
320
|
+
* If an {@link NotificationActionResult|action result} is not specified for a particular trigger, or it is set to
|
|
321
|
+
* `null`, the application will not receive a corresponding {@link NotificationActionEvent|`notification-action`} when
|
|
322
|
+
* that trigger occurs.
|
|
323
|
+
*
|
|
324
|
+
* Unlike other event types, {@link NotificationActionEvent|`notification-action`} events will be buffered by the
|
|
325
|
+
* service until the application has added a listener for this event type, at which point it will receive all buffered
|
|
326
|
+
* {@link NotificationActionEvent|`notification-action`} events. The service will also attempt to restart the
|
|
327
|
+
* application if it is not running when the event is fired.
|
|
328
|
+
*
|
|
329
|
+
* For an overview of actions, consider the sample notification below:
|
|
330
|
+
* ```ts
|
|
331
|
+
* import {addEventListener, create} from 'openfin-notifications';
|
|
332
|
+
*
|
|
333
|
+
* // Create a notification with two buttons
|
|
334
|
+
* create({
|
|
335
|
+
* // Basic info
|
|
336
|
+
* title: 'Reminder',
|
|
337
|
+
* body: 'Event "Weekly Meeting" is starting soon...',
|
|
338
|
+
* category: 'Upcoming Events',
|
|
339
|
+
*
|
|
340
|
+
* // We'll use the 'customData' field to store metadata about the event
|
|
341
|
+
* customData: {eventId: '12345'},
|
|
342
|
+
*
|
|
343
|
+
* // We want the user clicking the notification to open the associated event, so register an 'onSelect' action
|
|
344
|
+
* onSelect: {task: 'view-calendar-event', target: 'popup'},
|
|
345
|
+
*
|
|
346
|
+
* buttons: [
|
|
347
|
+
* // A button that will schedule another reminder for 5 minutes from now. Since the application will be
|
|
348
|
+
* // responsible for snoozing the event, it will need to know about the user clicking this button. By setting
|
|
349
|
+
* // a NotificationActionResult for 'onClick', the service will raise a "notification-action" event when this
|
|
350
|
+
* // button is clicked, and will pass the value of 'onClick' as the 'result' field within the event
|
|
351
|
+
* {
|
|
352
|
+
* title: 'Snooze for 5 minutes',
|
|
353
|
+
* iconUrl: 'https://www.example.com/timer.png',
|
|
354
|
+
* onClick: {
|
|
355
|
+
* task: 'schedule-reminder',
|
|
356
|
+
* intervalMs: 5 * 60 * 1000
|
|
357
|
+
* }
|
|
358
|
+
* },
|
|
359
|
+
*
|
|
360
|
+
* // A button that closes the notification and doesn't prompt the user about this event again. Since the
|
|
361
|
+
* // application doesn't need to do anything when the user clicks this button, we leave 'onClick' undefined
|
|
362
|
+
* // rather than specifying a NotificationActionResult. This means that no action will be raised when the
|
|
363
|
+
* // button is clicked, and hence no "notification-action" event will be fired
|
|
364
|
+
* {
|
|
365
|
+
* title: 'Dismiss',
|
|
366
|
+
* iconUrl: 'https://www.example.com/cancel.png'
|
|
367
|
+
* }
|
|
368
|
+
* ]
|
|
369
|
+
* });
|
|
370
|
+
*
|
|
371
|
+
* // Create a listener that will be called for each action
|
|
372
|
+
* // Note: This handler will be used for ALL actions, from ALL notifications that are created by this application.
|
|
373
|
+
* addEventListener('notification-action', (event: NotificationActionEvent) => {
|
|
374
|
+
* const {result, notification} = event;
|
|
375
|
+
*
|
|
376
|
+
* if (result['task'] === 'view-calendar-event') {
|
|
377
|
+
* // Open a window with full details of the associated event
|
|
378
|
+
* openEventDetails(notification.customData.eventId, result['target']);
|
|
379
|
+
* } else if (result['task'] === 'schedule-reminder') {
|
|
380
|
+
* // Schedule a new notification
|
|
381
|
+
* scheduleReminder(notification.customData.eventId, Date.now() + result['intervalMs']);
|
|
382
|
+
* } // Etc...
|
|
383
|
+
* });
|
|
384
|
+
* ```
|
|
385
|
+
*
|
|
386
|
+
* The example above uses `customData` to store details about the notification subject (in this case, a calendar
|
|
387
|
+
* event), and `onClick` actions to inform the application about how it should respond when the user interacts with the
|
|
388
|
+
* notification. This is our intended usage and recommended best-practice, but the service doesn't require applications
|
|
389
|
+
* to follow this convention - application developers are free to decide how to manage notification state.
|
|
390
|
+
*
|
|
391
|
+
* Within the `notification-action` handler, the application must be able to understand which notification is being
|
|
392
|
+
* handled, and how to decide what it should do next. The example above uses an application-defined `action` field to
|
|
393
|
+
* determine the correct action, but the notification's `id`, `category`, `customData` and other fields are also useful
|
|
394
|
+
* selectors.
|
|
395
|
+
*
|
|
396
|
+
* @module Actions
|
|
397
|
+
*/
|
|
398
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
399
|
+
exports.ActionNoopType = exports.ActionTrigger = void 0;
|
|
400
|
+
/**
|
|
401
|
+
* Lists the different triggers that can raise an {@link Actions|action}. Each action that is raised will result in a
|
|
402
|
+
* {@link NotificationActionEvent|`notification-action`} event, which can be captured by the application that created
|
|
403
|
+
* the notification.
|
|
404
|
+
*/
|
|
405
|
+
var ActionTrigger;
|
|
406
|
+
(function (ActionTrigger) {
|
|
407
|
+
/**
|
|
408
|
+
* The user interacted with one of the controls within the notification. This currently means a button click, but
|
|
409
|
+
* other control types will be added in future releases.
|
|
410
|
+
*/
|
|
411
|
+
ActionTrigger["CONTROL"] = "control";
|
|
412
|
+
/**
|
|
413
|
+
* The user clicked the body of the notification itself. Any clicks of the notification that don't hit a control
|
|
414
|
+
* or the close button will fire an event with the `'select'` action trigger.
|
|
415
|
+
*/
|
|
416
|
+
ActionTrigger["SELECT"] = "select";
|
|
417
|
+
/**
|
|
418
|
+
* The notification was closed, either by user interaction, programmatically by an application, or by the notification expiring.
|
|
419
|
+
*/
|
|
420
|
+
ActionTrigger["CLOSE"] = "close";
|
|
421
|
+
/**
|
|
422
|
+
* The notification expired.
|
|
423
|
+
*/
|
|
424
|
+
ActionTrigger["EXPIRE"] = "expire";
|
|
425
|
+
/**
|
|
426
|
+
* The action was triggered programmatically by an application.
|
|
427
|
+
*
|
|
428
|
+
* *Not currently supported - will be implemented in a future release*
|
|
429
|
+
*/
|
|
430
|
+
ActionTrigger["PROGRAMMATIC"] = "programmatic";
|
|
431
|
+
})(ActionTrigger = exports.ActionTrigger || (exports.ActionTrigger = {}));
|
|
432
|
+
/**
|
|
433
|
+
* Noop action types see {@link ActionNoop|ActionNoop}.
|
|
434
|
+
*/
|
|
435
|
+
var ActionNoopType;
|
|
436
|
+
(function (ActionNoopType) {
|
|
437
|
+
/**
|
|
438
|
+
* No event will be raised and no dismissal of the notification on action.
|
|
439
|
+
*/
|
|
440
|
+
ActionNoopType["EVENT_DISMISS"] = "event_dismiss";
|
|
441
|
+
/**
|
|
442
|
+
* No event will be raised, but the notification will be dismissed on action.
|
|
443
|
+
*/
|
|
444
|
+
// EVENT = 'event',
|
|
445
|
+
/**
|
|
446
|
+
* No dismissal of the notification, but the action event will be raised on action.
|
|
447
|
+
*/
|
|
448
|
+
// DISMISS = 'dismiss',
|
|
449
|
+
})(ActionNoopType = exports.ActionNoopType || (exports.ActionNoopType = {}));
|
|
450
|
+
|
|
451
|
+
|
|
450
452
|
/***/ }),
|
|
451
453
|
/* 3 */
|
|
452
454
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -569,8 +571,8 @@ exports.getNotificationsCount = exports.toggleNotificationCenter = exports.clear
|
|
|
569
571
|
*
|
|
570
572
|
* @hidden
|
|
571
573
|
*/
|
|
572
|
-
const actions_1 = __webpack_require__(
|
|
573
|
-
const connection_1 = __webpack_require__(
|
|
574
|
+
const actions_1 = __webpack_require__(2);
|
|
575
|
+
const connection_1 = __webpack_require__(1);
|
|
574
576
|
const internal_1 = __webpack_require__(0);
|
|
575
577
|
const provider = __importStar(__webpack_require__(10));
|
|
576
578
|
exports.provider = provider;
|
|
@@ -581,18 +583,19 @@ Object.defineProperty(exports, "NotificationIndicatorType", { enumerable: true,
|
|
|
581
583
|
Object.defineProperty(exports, "IndicatorColor", { enumerable: true, get: function () { return indicator_1.IndicatorColor; } });
|
|
582
584
|
const templates_1 = __webpack_require__(5);
|
|
583
585
|
Object.defineProperty(exports, "NotificationOptions", { enumerable: true, get: function () { return templates_1.NotificationOptions; } });
|
|
584
|
-
__exportStar(__webpack_require__(
|
|
586
|
+
__exportStar(__webpack_require__(2), exports);
|
|
585
587
|
__exportStar(__webpack_require__(14), exports);
|
|
586
588
|
__exportStar(__webpack_require__(15), exports);
|
|
587
589
|
__exportStar(__webpack_require__(16), exports);
|
|
588
590
|
__exportStar(__webpack_require__(19), exports);
|
|
589
591
|
__exportStar(__webpack_require__(20), exports);
|
|
592
|
+
__exportStar(__webpack_require__(24), exports);
|
|
590
593
|
/**
|
|
591
594
|
* The Notification Client library's version in semver format.
|
|
592
595
|
*
|
|
593
596
|
* This is the version which you are currently using.
|
|
594
597
|
*/
|
|
595
|
-
exports.VERSION = '1.
|
|
598
|
+
exports.VERSION = '1.13.0-alpha-898';
|
|
596
599
|
const eventHandler = connection_1.getEventRouter();
|
|
597
600
|
function parseEventWithNotification(event) {
|
|
598
601
|
const { notification } = event;
|
|
@@ -1532,7 +1535,7 @@ exports.isConnectedToAtLeast = exports.getStatus = void 0;
|
|
|
1532
1535
|
*/
|
|
1533
1536
|
const semver_compare_1 = __importDefault(__webpack_require__(11));
|
|
1534
1537
|
const openfin_service_async_1 = __webpack_require__(3);
|
|
1535
|
-
const connection_1 = __webpack_require__(
|
|
1538
|
+
const connection_1 = __webpack_require__(1);
|
|
1536
1539
|
const internal_1 = __webpack_require__(0);
|
|
1537
1540
|
/**
|
|
1538
1541
|
* Retrieves the connection status and version semver of the Service Provider in the shape of a {@link ProviderStatus} object.
|
|
@@ -1896,6 +1899,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
1896
1899
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1897
1900
|
|
|
1898
1901
|
|
|
1902
|
+
/***/ }),
|
|
1903
|
+
/* 24 */
|
|
1904
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1905
|
+
|
|
1906
|
+
"use strict";
|
|
1907
|
+
|
|
1908
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1909
|
+
exports.deregisterPlatform = exports.registerPlatform = void 0;
|
|
1910
|
+
const connection_1 = __webpack_require__(1);
|
|
1911
|
+
const internal_1 = __webpack_require__(0);
|
|
1912
|
+
/**
|
|
1913
|
+
* These are internal methods to facilitate the connection with the Workspace API.
|
|
1914
|
+
*/
|
|
1915
|
+
/**
|
|
1916
|
+
* @ignore
|
|
1917
|
+
*/
|
|
1918
|
+
async function registerPlatform(platform) {
|
|
1919
|
+
if (typeof platform !== 'object' || platform === null) {
|
|
1920
|
+
throw new Error('Invalid argument passed to registerPlatform: argument must be an object and must not be null');
|
|
1921
|
+
}
|
|
1922
|
+
if (!platform.id) {
|
|
1923
|
+
throw new Error('Invalid argument passed to registerPlatform: "id" must be a non-empty string in platform info.');
|
|
1924
|
+
}
|
|
1925
|
+
return connection_1.tryServiceDispatch(internal_1.APITopic.REGISTER_PLATFORM, Object.assign({}, platform));
|
|
1926
|
+
}
|
|
1927
|
+
exports.registerPlatform = registerPlatform;
|
|
1928
|
+
/**
|
|
1929
|
+
* @ignore
|
|
1930
|
+
*/
|
|
1931
|
+
async function deregisterPlatform(id) {
|
|
1932
|
+
if (!id) {
|
|
1933
|
+
throw new Error('Invalid argument passed to deregisterPlatform: "id" must be a non-empty string.');
|
|
1934
|
+
}
|
|
1935
|
+
return connection_1.tryServiceDispatch(internal_1.APITopic.DEREGISTER_PLATFORM, { id });
|
|
1936
|
+
}
|
|
1937
|
+
exports.deregisterPlatform = deregisterPlatform;
|
|
1938
|
+
|
|
1939
|
+
|
|
1899
1940
|
/***/ })
|
|
1900
1941
|
/******/ ]);
|
|
1901
1942
|
});
|