electron-notify-manager 1.0.0
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 +323 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/src/NotificationManager.d.ts +45 -0
- package/dist/src/NotificationManager.d.ts.map +1 -0
- package/dist/src/NotificationManager.js +337 -0
- package/dist/src/NotificationManager.js.map +1 -0
- package/dist/src/NotificationWindow.d.ts +19 -0
- package/dist/src/NotificationWindow.d.ts.map +1 -0
- package/dist/src/NotificationWindow.js +165 -0
- package/dist/src/NotificationWindow.js.map +1 -0
- package/dist/src/constants.d.ts +22 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +39 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/core/NotificationQueue.d.ts +14 -0
- package/dist/src/core/NotificationQueue.d.ts.map +1 -0
- package/dist/src/core/NotificationQueue.js +35 -0
- package/dist/src/core/NotificationQueue.js.map +1 -0
- package/dist/src/errors.d.ts +23 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +43 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/ipc/IpcChannels.d.ts +9 -0
- package/dist/src/ipc/IpcChannels.d.ts.map +1 -0
- package/dist/src/ipc/IpcChannels.js +11 -0
- package/dist/src/ipc/IpcChannels.js.map +1 -0
- package/dist/src/position/PositionCalculator.d.ts +22 -0
- package/dist/src/position/PositionCalculator.d.ts.map +1 -0
- package/dist/src/position/PositionCalculator.js +77 -0
- package/dist/src/position/PositionCalculator.js.map +1 -0
- package/dist/src/positionCalculator.d.ts +19 -0
- package/dist/src/positionCalculator.d.ts.map +1 -0
- package/dist/src/positionCalculator.js +50 -0
- package/dist/src/positionCalculator.js.map +1 -0
- package/dist/src/types/config.types.d.ts +11 -0
- package/dist/src/types/config.types.d.ts.map +1 -0
- package/dist/src/types/config.types.js +3 -0
- package/dist/src/types/config.types.js.map +1 -0
- package/dist/src/types/index.d.ts +8 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +3 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/ipc.types.d.ts +12 -0
- package/dist/src/types/ipc.types.d.ts.map +1 -0
- package/dist/src/types/ipc.types.js +3 -0
- package/dist/src/types/ipc.types.js.map +1 -0
- package/dist/src/types/notification.types.d.ts +28 -0
- package/dist/src/types/notification.types.d.ts.map +1 -0
- package/dist/src/types/notification.types.js +3 -0
- package/dist/src/types/notification.types.js.map +1 -0
- package/dist/src/types/position.types.d.ts +12 -0
- package/dist/src/types/position.types.d.ts.map +1 -0
- package/dist/src/types/position.types.js +3 -0
- package/dist/src/types/position.types.js.map +1 -0
- package/dist/src/types/theme.types.d.ts +8 -0
- package/dist/src/types/theme.types.d.ts.map +1 -0
- package/dist/src/types/theme.types.js +3 -0
- package/dist/src/types/theme.types.js.map +1 -0
- package/dist/src/utils/idGenerator.d.ts +7 -0
- package/dist/src/utils/idGenerator.d.ts.map +1 -0
- package/dist/src/utils/idGenerator.js +16 -0
- package/dist/src/utils/idGenerator.js.map +1 -0
- package/dist/src/utils/logger.d.ts +12 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/logger.js +38 -0
- package/dist/src/utils/logger.js.map +1 -0
- package/dist/src/utils/themeDetector.d.ts +3 -0
- package/dist/src/utils/themeDetector.d.ts.map +1 -0
- package/dist/src/utils/themeDetector.js +11 -0
- package/dist/src/utils/themeDetector.js.map +1 -0
- package/dist/src/utils/validators.d.ts +10 -0
- package/dist/src/utils/validators.d.ts.map +1 -0
- package/dist/src/utils/validators.js +95 -0
- package/dist/src/utils/validators.js.map +1 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +50 -0
- package/renderer/notification.css +172 -0
- package/renderer/notification.html +52 -0
- package/renderer/notification.js +137 -0
- package/renderer/notification.ts +150 -0
- package/renderer/preload.js +38 -0
- package/renderer/preload.ts +56 -0
- package/renderer/scripts/animationController.ts +12 -0
- package/renderer/scripts/icons.ts +36 -0
- package/renderer/scripts/notification.js +188 -0
- package/renderer/scripts/progressBar.ts +10 -0
- package/renderer/styles/animations.css +28 -0
- package/renderer/styles/notification.css +186 -0
- package/renderer/styles/themes.css +94 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NotificationManager = void 0;
|
|
7
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
8
|
+
const events_1 = require("events");
|
|
9
|
+
const electron_1 = require("electron");
|
|
10
|
+
const NotificationWindow_1 = require("./NotificationWindow");
|
|
11
|
+
const positionCalculator_1 = require("./positionCalculator");
|
|
12
|
+
const constants_1 = require("./constants");
|
|
13
|
+
const themeDetector_1 = require("./utils/themeDetector");
|
|
14
|
+
const validators_1 = require("./utils/validators");
|
|
15
|
+
class NotificationManager extends events_1.EventEmitter {
|
|
16
|
+
constructor(options = {}) {
|
|
17
|
+
super();
|
|
18
|
+
this.options = {
|
|
19
|
+
position: (options.position ?? 'bottomRight'),
|
|
20
|
+
width: typeof options.width === 'number' ? options.width : constants_1.DEFAULTS.WIDTH,
|
|
21
|
+
height: typeof options.height === 'number' ? options.height : constants_1.DEFAULTS.HEIGHT,
|
|
22
|
+
margin: typeof options.margin === 'number' ? options.margin : constants_1.DEFAULTS.MARGIN,
|
|
23
|
+
gap: typeof options.gap === 'number' ? options.gap : constants_1.DEFAULTS.GAP,
|
|
24
|
+
debug: typeof options.debug === 'boolean' ? options.debug : false,
|
|
25
|
+
maxVisible: typeof options.maxVisible === 'number' ? options.maxVisible : 5
|
|
26
|
+
};
|
|
27
|
+
this.notifications = new Map();
|
|
28
|
+
this.windows = new Map();
|
|
29
|
+
this.order = [];
|
|
30
|
+
this.pending = new Map();
|
|
31
|
+
this.onIpcCloseBound = this.onRendererClose.bind(this);
|
|
32
|
+
this.onIpcClickBound = this.onRendererClick.bind(this);
|
|
33
|
+
electron_1.ipcMain.on(constants_1.IPC_CHANNELS.NOTIFICATION_CLOSE, this.onIpcCloseBound);
|
|
34
|
+
electron_1.ipcMain.on(constants_1.IPC_CHANNELS.NOTIFICATION_CLICK, this.onIpcClickBound);
|
|
35
|
+
electron_1.nativeTheme.on('updated', () => {
|
|
36
|
+
this.broadcastThemeIfAuto();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Show a notification window and return its unique ID.
|
|
41
|
+
*/
|
|
42
|
+
show(options) {
|
|
43
|
+
(0, validators_1.validateNotificationOptions)(options);
|
|
44
|
+
const id = this.newId();
|
|
45
|
+
const variant = options.variant ?? 'default';
|
|
46
|
+
const duration = variant === 'loading'
|
|
47
|
+
? 0
|
|
48
|
+
: typeof options.duration === 'number'
|
|
49
|
+
? Math.max(0, Math.floor(options.duration))
|
|
50
|
+
: constants_1.DEFAULTS.DURATION;
|
|
51
|
+
// Insert as top-most.
|
|
52
|
+
this.order.unshift(id);
|
|
53
|
+
const display = this.getTargetDisplay();
|
|
54
|
+
const normalized = { ...options, duration, variant };
|
|
55
|
+
this.pending.set(id, { id, options: normalized, displayId: display.id });
|
|
56
|
+
this.pump(display.id);
|
|
57
|
+
return id;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Manually close a notification by ID.
|
|
61
|
+
*/
|
|
62
|
+
close(id) {
|
|
63
|
+
const pending = this.pending.get(id);
|
|
64
|
+
if (pending) {
|
|
65
|
+
this.pending.delete(id);
|
|
66
|
+
const idx = this.order.indexOf(id);
|
|
67
|
+
if (idx >= 0)
|
|
68
|
+
this.order.splice(idx, 1);
|
|
69
|
+
try {
|
|
70
|
+
pending.options.onClose?.();
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// ignore
|
|
74
|
+
}
|
|
75
|
+
this.emit('close', id, 'programmatic');
|
|
76
|
+
this.pump(pending.displayId);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const item = this.notifications.get(id);
|
|
80
|
+
if (!item)
|
|
81
|
+
return;
|
|
82
|
+
this.closeById(id, item.window, 'programmatic');
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Close all active notifications.
|
|
86
|
+
*/
|
|
87
|
+
closeAll() {
|
|
88
|
+
for (const id of Array.from(this.pending.keys())) {
|
|
89
|
+
this.close(id);
|
|
90
|
+
}
|
|
91
|
+
for (const id of Array.from(this.notifications.keys())) {
|
|
92
|
+
this.close(id);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Destroy manager and clean up all resources.
|
|
97
|
+
*/
|
|
98
|
+
destroy() {
|
|
99
|
+
this.dispose('app-quit');
|
|
100
|
+
}
|
|
101
|
+
dispose(reason = 'programmatic') {
|
|
102
|
+
electron_1.ipcMain.off(constants_1.IPC_CHANNELS.NOTIFICATION_CLOSE, this.onIpcCloseBound);
|
|
103
|
+
electron_1.ipcMain.off(constants_1.IPC_CHANNELS.NOTIFICATION_CLICK, this.onIpcClickBound);
|
|
104
|
+
for (const id of Array.from(this.pending.keys())) {
|
|
105
|
+
const pending = this.pending.get(id);
|
|
106
|
+
if (!pending)
|
|
107
|
+
continue;
|
|
108
|
+
this.pending.delete(id);
|
|
109
|
+
const idx = this.order.indexOf(id);
|
|
110
|
+
if (idx >= 0)
|
|
111
|
+
this.order.splice(idx, 1);
|
|
112
|
+
try {
|
|
113
|
+
pending.options.onClose?.();
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
// ignore
|
|
117
|
+
}
|
|
118
|
+
this.emit('close', id, reason);
|
|
119
|
+
}
|
|
120
|
+
for (const id of Array.from(this.notifications.keys())) {
|
|
121
|
+
const item = this.notifications.get(id);
|
|
122
|
+
if (!item)
|
|
123
|
+
continue;
|
|
124
|
+
this.closeById(id, item.window, reason);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Update an existing notification (loading/progress/description).
|
|
129
|
+
*/
|
|
130
|
+
update(id, payload) {
|
|
131
|
+
const item = this.notifications.get(id);
|
|
132
|
+
if (!item)
|
|
133
|
+
return;
|
|
134
|
+
const next = {
|
|
135
|
+
description: payload.description,
|
|
136
|
+
loadingText: payload.loadingText,
|
|
137
|
+
progress: payload.progress,
|
|
138
|
+
};
|
|
139
|
+
if (typeof next.description === 'string')
|
|
140
|
+
item.options.description = next.description;
|
|
141
|
+
if (typeof next.loadingText === 'string')
|
|
142
|
+
item.options.loadingText = next.loadingText;
|
|
143
|
+
if (typeof next.progress === 'number')
|
|
144
|
+
item.options.progress = next.progress;
|
|
145
|
+
try {
|
|
146
|
+
item.window.webContents.send(constants_1.IPC_CHANNELS.NOTIFICATION_UPDATE, { id, updates: next });
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
// ignore
|
|
150
|
+
}
|
|
151
|
+
if (item.options.variant === 'progress' && typeof next.progress === 'number' && next.progress >= 100) {
|
|
152
|
+
setTimeout(() => this.close(id), 500);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
onRendererClose(event, id) {
|
|
156
|
+
const notifId = String(id);
|
|
157
|
+
const item = this.notifications.get(notifId);
|
|
158
|
+
if (!item)
|
|
159
|
+
return;
|
|
160
|
+
if (item.window.webContents.id !== event.sender.id)
|
|
161
|
+
return;
|
|
162
|
+
this.closeById(notifId, item.window, 'user');
|
|
163
|
+
}
|
|
164
|
+
onRendererClick(event, id) {
|
|
165
|
+
const notifId = String(id);
|
|
166
|
+
const item = this.notifications.get(notifId);
|
|
167
|
+
if (!item)
|
|
168
|
+
return;
|
|
169
|
+
if (item.window.webContents.id !== event.sender.id)
|
|
170
|
+
return;
|
|
171
|
+
try {
|
|
172
|
+
item.options.onClick?.();
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
// ignore
|
|
176
|
+
}
|
|
177
|
+
this.emit('click', notifId);
|
|
178
|
+
// Renderer requests close after click; manager will close on 'notification-close'.
|
|
179
|
+
}
|
|
180
|
+
closeById(id, window, reason) {
|
|
181
|
+
const item = this.notifications.get(id);
|
|
182
|
+
if (!item)
|
|
183
|
+
return;
|
|
184
|
+
if (item.timer) {
|
|
185
|
+
clearTimeout(item.timer);
|
|
186
|
+
item.timer = null;
|
|
187
|
+
}
|
|
188
|
+
this.notifications.delete(id);
|
|
189
|
+
const idx = this.order.indexOf(id);
|
|
190
|
+
if (idx >= 0)
|
|
191
|
+
this.order.splice(idx, 1);
|
|
192
|
+
const wrapper = this.windows.get(id);
|
|
193
|
+
this.windows.delete(id);
|
|
194
|
+
wrapper?.destroy();
|
|
195
|
+
try {
|
|
196
|
+
item.options.onClose?.();
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
// ignore
|
|
200
|
+
}
|
|
201
|
+
this.emit('close', id, reason);
|
|
202
|
+
const displayId = this.getDisplayIdForWindow(window) ?? this.getTargetDisplay().id;
|
|
203
|
+
this.pump(displayId);
|
|
204
|
+
}
|
|
205
|
+
idsOnDisplay(displayId) {
|
|
206
|
+
return this.order.filter((id) => {
|
|
207
|
+
const pending = this.pending.get(id);
|
|
208
|
+
if (pending)
|
|
209
|
+
return pending.displayId === displayId;
|
|
210
|
+
const win = this.notifications.get(id)?.window;
|
|
211
|
+
if (!win)
|
|
212
|
+
return false;
|
|
213
|
+
const d = electron_1.screen.getDisplayMatching(win.getBounds());
|
|
214
|
+
return d.id === displayId;
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
reflowForDisplay(displayId, args) {
|
|
218
|
+
const display = electron_1.screen.getAllDisplays().find((d) => d.id === displayId) ?? this.getTargetDisplay();
|
|
219
|
+
const workArea = display.workArea;
|
|
220
|
+
const ids = this.idsOnDisplay(display.id).filter((id) => this.notifications.has(id));
|
|
221
|
+
const count = ids.length;
|
|
222
|
+
for (let index = 0; index < count; index++) {
|
|
223
|
+
const id = ids[index];
|
|
224
|
+
const wrapper = this.windows.get(id);
|
|
225
|
+
const item = this.notifications.get(id);
|
|
226
|
+
if (!wrapper || !item)
|
|
227
|
+
continue;
|
|
228
|
+
if (wrapper.isDestroyed())
|
|
229
|
+
continue;
|
|
230
|
+
const coords = (0, positionCalculator_1.calculateCoordsInWorkArea)({
|
|
231
|
+
workArea,
|
|
232
|
+
position: this.options.position,
|
|
233
|
+
width: this.options.width,
|
|
234
|
+
height: this.options.height,
|
|
235
|
+
margin: this.options.margin,
|
|
236
|
+
gap: this.options.gap,
|
|
237
|
+
indexTopToBottom: index,
|
|
238
|
+
count
|
|
239
|
+
});
|
|
240
|
+
// Requested IPC contract (renderer might animate something, but main moves the window).
|
|
241
|
+
try {
|
|
242
|
+
wrapper.window.webContents.send(constants_1.IPC_CHANNELS.NOTIFICATION_REPOSITION, { id, y: coords.y });
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
// ignore
|
|
246
|
+
}
|
|
247
|
+
const entranceFrom = this.options.position.endsWith('Left') ? 'left' : 'right';
|
|
248
|
+
if (args.showingId === id) {
|
|
249
|
+
void wrapper.showAt(coords, entranceFrom);
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
wrapper.moveTo(coords, args.animate, 300);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
pump(displayId) {
|
|
257
|
+
const ids = this.idsOnDisplay(displayId);
|
|
258
|
+
const visibleTarget = Math.max(0, Math.floor(this.options.maxVisible));
|
|
259
|
+
const shouldBeVisible = ids.slice(0, visibleTarget);
|
|
260
|
+
const newlyCreated = [];
|
|
261
|
+
let showingId;
|
|
262
|
+
for (let index = 0; index < shouldBeVisible.length; index++) {
|
|
263
|
+
const id = shouldBeVisible[index];
|
|
264
|
+
if (this.notifications.has(id))
|
|
265
|
+
continue;
|
|
266
|
+
const pending = this.pending.get(id);
|
|
267
|
+
if (!pending)
|
|
268
|
+
continue;
|
|
269
|
+
const display = electron_1.screen.getAllDisplays().find((d) => d.id === pending.displayId) ?? this.getTargetDisplay();
|
|
270
|
+
const workArea = display.workArea;
|
|
271
|
+
const coords = (0, positionCalculator_1.calculateCoordsInWorkArea)({
|
|
272
|
+
workArea,
|
|
273
|
+
position: this.options.position,
|
|
274
|
+
width: this.options.width,
|
|
275
|
+
height: this.options.height,
|
|
276
|
+
margin: this.options.margin,
|
|
277
|
+
gap: this.options.gap,
|
|
278
|
+
indexTopToBottom: index,
|
|
279
|
+
count: shouldBeVisible.length
|
|
280
|
+
});
|
|
281
|
+
const win = new NotificationWindow_1.NotificationWindow(id, pending.options, coords, this.options);
|
|
282
|
+
this.windows.set(id, win);
|
|
283
|
+
const item = {
|
|
284
|
+
id,
|
|
285
|
+
window: win.window,
|
|
286
|
+
options: pending.options,
|
|
287
|
+
timer: null
|
|
288
|
+
};
|
|
289
|
+
this.notifications.set(id, item);
|
|
290
|
+
this.pending.delete(id);
|
|
291
|
+
newlyCreated.push(id);
|
|
292
|
+
if (!showingId)
|
|
293
|
+
showingId = id;
|
|
294
|
+
}
|
|
295
|
+
this.reflowForDisplay(displayId, {
|
|
296
|
+
animate: true,
|
|
297
|
+
showingId
|
|
298
|
+
});
|
|
299
|
+
for (const id of newlyCreated) {
|
|
300
|
+
this.emit('show', id);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
getTargetDisplay() {
|
|
304
|
+
const point = electron_1.screen.getCursorScreenPoint();
|
|
305
|
+
return electron_1.screen.getDisplayNearestPoint(point);
|
|
306
|
+
}
|
|
307
|
+
getDisplayIdForWindow(window) {
|
|
308
|
+
try {
|
|
309
|
+
const d = electron_1.screen.getDisplayMatching(window.getBounds());
|
|
310
|
+
return d.id;
|
|
311
|
+
}
|
|
312
|
+
catch {
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
newId() {
|
|
317
|
+
if (typeof crypto_1.default.randomUUID === 'function')
|
|
318
|
+
return crypto_1.default.randomUUID();
|
|
319
|
+
return crypto_1.default.randomBytes(16).toString('hex');
|
|
320
|
+
}
|
|
321
|
+
broadcastThemeIfAuto() {
|
|
322
|
+
for (const item of this.notifications.values()) {
|
|
323
|
+
const requested = item.options.theme ?? 'auto';
|
|
324
|
+
if (requested !== 'auto')
|
|
325
|
+
continue;
|
|
326
|
+
const theme = (0, themeDetector_1.resolveTheme)('auto');
|
|
327
|
+
try {
|
|
328
|
+
item.window.webContents.send(constants_1.IPC_CHANNELS.NOTIFICATION_THEME, { theme });
|
|
329
|
+
}
|
|
330
|
+
catch {
|
|
331
|
+
// ignore
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
exports.NotificationManager = NotificationManager;
|
|
337
|
+
//# sourceMappingURL=NotificationManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationManager.js","sourceRoot":"","sources":["../../src/NotificationManager.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,mCAAsC;AACtC,uCAAwD;AAExD,6DAA0D;AAC1D,6DAAiE;AACjE,2CAAqD;AACrD,yDAAqD;AAUrD,mDAAiE;AAajE,MAAa,mBAAoB,SAAQ,qBAAY;IAUnD,YAAmB,UAAsC,EAAE;QACzD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG;YACb,QAAQ,EAAE,CAAC,OAAO,CAAC,QAAQ,IAAI,aAAa,CAAyB;YACrE,KAAK,EAAE,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,oBAAQ,CAAC,KAAK;YACzE,MAAM,EAAE,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,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,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA1VD,kDA0VC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BrowserWindow } from 'electron';
|
|
2
|
+
import type { NotificationOptions, PositionCoords, RequiredManagerOptions } from './types';
|
|
3
|
+
type EntranceFrom = 'left' | 'right';
|
|
4
|
+
export declare class NotificationWindow {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly window: BrowserWindow;
|
|
7
|
+
private readonly width;
|
|
8
|
+
private readonly height;
|
|
9
|
+
private animTimer;
|
|
10
|
+
constructor(id: string, options: NotificationOptions, coords: PositionCoords, managerOptions: RequiredManagerOptions);
|
|
11
|
+
isDestroyed(): boolean;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
getPosition(): PositionCoords;
|
|
14
|
+
showAt(finalPos: PositionCoords, entranceFrom: EntranceFrom): Promise<void>;
|
|
15
|
+
moveTo(target: PositionCoords, animate: boolean, durationMs: number): void;
|
|
16
|
+
private animatePosition;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=NotificationWindow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationWindow.d.ts","sourceRoot":"","sources":["../../src/NotificationWindow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAY3F,KAAK,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAErC,qBAAa,kBAAkB;IAC7B,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,MAAM,EAAE,aAAa,CAAC;IAEtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,SAAS,CAAwB;gBAGvC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,cAAc,EACtB,cAAc,EAAE,sBAAsB;IAyFjC,WAAW,IAAI,OAAO;IAItB,OAAO,IAAI,IAAI;IAcf,WAAW,IAAI,cAAc;IAKvB,MAAM,CAAC,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IASjF,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAQjF,OAAO,CAAC,eAAe;CAoCxB"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NotificationWindow = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const electron_1 = require("electron");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const themeDetector_1 = require("./utils/themeDetector");
|
|
11
|
+
function easeOutCubic(t) {
|
|
12
|
+
return 1 - Math.pow(1 - t, 3);
|
|
13
|
+
}
|
|
14
|
+
function encodeParam(value) {
|
|
15
|
+
return encodeURIComponent(value);
|
|
16
|
+
}
|
|
17
|
+
class NotificationWindow {
|
|
18
|
+
constructor(id, options, coords, managerOptions) {
|
|
19
|
+
this.id = id;
|
|
20
|
+
this.width = managerOptions.width;
|
|
21
|
+
this.height = managerOptions.height;
|
|
22
|
+
this.animTimer = null;
|
|
23
|
+
// When compiled, this file lives in `dist/src/*`, so we resolve the package root
|
|
24
|
+
// and reference the runtime `renderer/*` assets from there (not from `dist/`).
|
|
25
|
+
const packageRoot = path_1.default.resolve(__dirname, '..', '..');
|
|
26
|
+
const preloadPath = path_1.default.join(packageRoot, 'renderer', 'preload.js');
|
|
27
|
+
this.window = new electron_1.BrowserWindow({
|
|
28
|
+
width: managerOptions.width,
|
|
29
|
+
height: managerOptions.height,
|
|
30
|
+
x: coords.x,
|
|
31
|
+
y: coords.y,
|
|
32
|
+
show: false,
|
|
33
|
+
frame: false,
|
|
34
|
+
transparent: true,
|
|
35
|
+
alwaysOnTop: true,
|
|
36
|
+
skipTaskbar: true,
|
|
37
|
+
resizable: false,
|
|
38
|
+
hasShadow: true,
|
|
39
|
+
minimizable: false,
|
|
40
|
+
maximizable: false,
|
|
41
|
+
fullscreenable: false,
|
|
42
|
+
focusable: false,
|
|
43
|
+
webPreferences: {
|
|
44
|
+
nodeIntegration: false,
|
|
45
|
+
contextIsolation: true,
|
|
46
|
+
sandbox: false,
|
|
47
|
+
devTools: false,
|
|
48
|
+
backgroundThrottling: false,
|
|
49
|
+
preload: preloadPath
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
this.window.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
|
|
53
|
+
this.window.setAlwaysOnTop(true, 'screen-saver');
|
|
54
|
+
const htmlPath = path_1.default.join(packageRoot, 'renderer', 'notification.html');
|
|
55
|
+
const variant = options.variant ?? 'default';
|
|
56
|
+
const requestedTheme = options.theme ?? 'auto';
|
|
57
|
+
const resolvedTheme = (0, themeDetector_1.resolveTheme)(requestedTheme);
|
|
58
|
+
const duration = variant === 'loading'
|
|
59
|
+
? 0
|
|
60
|
+
: typeof options.duration === 'number'
|
|
61
|
+
? options.duration
|
|
62
|
+
: constants_1.DEFAULTS.DURATION;
|
|
63
|
+
const image = typeof options.image === 'string' && options.image.trim().length > 0 ? options.image : null;
|
|
64
|
+
const progress = typeof options.progress === 'number' ? options.progress : null;
|
|
65
|
+
const progressLabel = typeof options.progressLabel === 'string' && options.progressLabel.trim().length > 0
|
|
66
|
+
? options.progressLabel
|
|
67
|
+
: null;
|
|
68
|
+
const loadingText = typeof options.loadingText === 'string' && options.loadingText.trim().length > 0 ? options.loadingText : null;
|
|
69
|
+
const url = `file://${htmlPath}?` +
|
|
70
|
+
`id=${encodeParam(id)}` +
|
|
71
|
+
`&title=${encodeParam(options.title)}` +
|
|
72
|
+
`&description=${encodeParam(options.description)}` +
|
|
73
|
+
`&duration=${encodeParam(String(duration))}` +
|
|
74
|
+
`&position=${encodeParam(managerOptions.position)}` +
|
|
75
|
+
`&variant=${encodeParam(variant)}` +
|
|
76
|
+
`&theme=${encodeParam(requestedTheme)}` +
|
|
77
|
+
`&themeResolved=${encodeParam(resolvedTheme)}` +
|
|
78
|
+
(image ? `&image=${encodeParam(image)}` : '') +
|
|
79
|
+
(progress !== null ? `&progress=${encodeParam(String(progress))}` : '') +
|
|
80
|
+
(progressLabel ? `&progressLabel=${encodeParam(progressLabel)}` : '') +
|
|
81
|
+
(loadingText ? `&loadingText=${encodeParam(loadingText)}` : '');
|
|
82
|
+
void this.window.loadURL(url);
|
|
83
|
+
// Keep window theme in sync when system theme changes (auto mode only).
|
|
84
|
+
this.window.webContents.once('did-finish-load', () => {
|
|
85
|
+
if (requestedTheme !== 'auto')
|
|
86
|
+
return;
|
|
87
|
+
try {
|
|
88
|
+
this.window.webContents.send(constants_1.IPC_CHANNELS.NOTIFICATION_THEME, { theme: (0, themeDetector_1.resolveTheme)('auto') });
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// ignore
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
isDestroyed() {
|
|
96
|
+
return this.window.isDestroyed();
|
|
97
|
+
}
|
|
98
|
+
destroy() {
|
|
99
|
+
if (this.animTimer) {
|
|
100
|
+
clearInterval(this.animTimer);
|
|
101
|
+
this.animTimer = null;
|
|
102
|
+
}
|
|
103
|
+
if (!this.window.isDestroyed()) {
|
|
104
|
+
try {
|
|
105
|
+
this.window.destroy();
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
// ignore
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
getPosition() {
|
|
113
|
+
const [x, y] = this.window.getPosition();
|
|
114
|
+
return { x, y };
|
|
115
|
+
}
|
|
116
|
+
async showAt(finalPos, entranceFrom) {
|
|
117
|
+
const offscreenX = entranceFrom === 'left' ? finalPos.x - (this.width + 24) : finalPos.x + (this.width + 24);
|
|
118
|
+
this.window.setPosition(Math.round(offscreenX), Math.round(finalPos.y), false);
|
|
119
|
+
this.window.showInactive();
|
|
120
|
+
await this.animatePosition(finalPos, 260);
|
|
121
|
+
}
|
|
122
|
+
moveTo(target, animate, durationMs) {
|
|
123
|
+
if (!animate) {
|
|
124
|
+
this.window.setPosition(Math.round(target.x), Math.round(target.y), false);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
void this.animatePosition(target, durationMs);
|
|
128
|
+
}
|
|
129
|
+
animatePosition(target, durationMs) {
|
|
130
|
+
if (this.window.isDestroyed())
|
|
131
|
+
return Promise.resolve();
|
|
132
|
+
if (this.animTimer) {
|
|
133
|
+
clearInterval(this.animTimer);
|
|
134
|
+
this.animTimer = null;
|
|
135
|
+
}
|
|
136
|
+
const start = this.getPosition();
|
|
137
|
+
const dx = target.x - start.x;
|
|
138
|
+
const dy = target.y - start.y;
|
|
139
|
+
const startTime = Date.now();
|
|
140
|
+
return new Promise((resolve) => {
|
|
141
|
+
this.animTimer = setInterval(() => {
|
|
142
|
+
if (this.window.isDestroyed()) {
|
|
143
|
+
if (this.animTimer)
|
|
144
|
+
clearInterval(this.animTimer);
|
|
145
|
+
this.animTimer = null;
|
|
146
|
+
resolve();
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const t = Math.min(1, (Date.now() - startTime) / durationMs);
|
|
150
|
+
const e = easeOutCubic(t);
|
|
151
|
+
const x = start.x + dx * e;
|
|
152
|
+
const y = start.y + dy * e;
|
|
153
|
+
this.window.setPosition(Math.round(x), Math.round(y), false);
|
|
154
|
+
if (t >= 1) {
|
|
155
|
+
if (this.animTimer)
|
|
156
|
+
clearInterval(this.animTimer);
|
|
157
|
+
this.animTimer = null;
|
|
158
|
+
resolve();
|
|
159
|
+
}
|
|
160
|
+
}, 16);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
exports.NotificationWindow = NotificationWindow;
|
|
165
|
+
//# sourceMappingURL=NotificationWindow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationWindow.js","sourceRoot":"","sources":["../../src/NotificationWindow.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,uCAAyC;AAEzC,2CAAqD;AACrD,yDAAqD;AAErD,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AAID,MAAa,kBAAkB;IAQ7B,YACE,EAAU,EACV,OAA4B,EAC5B,MAAsB,EACtB,cAAsC;QAEtC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAEtB,iFAAiF;QACjF,+EAA+E;QAC/E,MAAM,WAAW,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACxD,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;QAErE,IAAI,CAAC,MAAM,GAAG,IAAI,wBAAa,CAAC;YAC9B,KAAK,EAAE,cAAc,CAAC,KAAK;YAC3B,MAAM,EAAE,cAAc,CAAC,MAAM;YAC7B,CAAC,EAAE,MAAM,CAAC,CAAC;YACX,C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CAAC,SAAS;wBAAE,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBAClD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;oBACtB,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC,EAAE,EAAE,CAAC,CAAC;QACT,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAjLD,gDAiLC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const DEFAULTS: {
|
|
2
|
+
readonly WIDTH: 360;
|
|
3
|
+
readonly HEIGHT: 100;
|
|
4
|
+
readonly MARGIN: 16;
|
|
5
|
+
readonly GAP: 10;
|
|
6
|
+
readonly DURATION: 4000;
|
|
7
|
+
readonly ANIMATION_DURATION: 300;
|
|
8
|
+
readonly REPOSITION_DURATION: 300;
|
|
9
|
+
readonly MAX_VISIBLE: 5;
|
|
10
|
+
};
|
|
11
|
+
export declare const IPC_CHANNELS: {
|
|
12
|
+
readonly NOTIFICATION_CLOSE: "notification:close";
|
|
13
|
+
readonly NOTIFICATION_CLICK: "notification:click";
|
|
14
|
+
readonly NOTIFICATION_REPOSITION: "notification:reposition";
|
|
15
|
+
readonly NOTIFICATION_READY: "notification:ready";
|
|
16
|
+
readonly NOTIFICATION_UPDATE: "notification:update";
|
|
17
|
+
readonly NOTIFICATION_THEME: "notification:theme";
|
|
18
|
+
};
|
|
19
|
+
export declare const VALID_POSITIONS: readonly ["topLeft", "topCenter", "topRight", "bottomLeft", "bottomCenter", "bottomRight"];
|
|
20
|
+
export declare const VALID_VARIANTS: readonly ["default", "success", "error", "warning", "loading", "progress"];
|
|
21
|
+
export declare const VALID_THEME_MODES: readonly ["dark", "light", "auto"];
|
|
22
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;;;;CASX,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAC;AAEX,eAAO,MAAM,eAAe,4FAOlB,CAAC;AAEX,eAAO,MAAM,cAAc,4EAOjB,CAAC;AAEX,eAAO,MAAM,iBAAiB,oCAAqC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VALID_THEME_MODES = exports.VALID_VARIANTS = exports.VALID_POSITIONS = exports.IPC_CHANNELS = exports.DEFAULTS = void 0;
|
|
4
|
+
exports.DEFAULTS = {
|
|
5
|
+
WIDTH: 360,
|
|
6
|
+
HEIGHT: 100,
|
|
7
|
+
MARGIN: 16,
|
|
8
|
+
GAP: 10,
|
|
9
|
+
DURATION: 4000,
|
|
10
|
+
ANIMATION_DURATION: 300,
|
|
11
|
+
REPOSITION_DURATION: 300,
|
|
12
|
+
MAX_VISIBLE: 5,
|
|
13
|
+
};
|
|
14
|
+
exports.IPC_CHANNELS = {
|
|
15
|
+
NOTIFICATION_CLOSE: 'notification:close',
|
|
16
|
+
NOTIFICATION_CLICK: 'notification:click',
|
|
17
|
+
NOTIFICATION_REPOSITION: 'notification:reposition',
|
|
18
|
+
NOTIFICATION_READY: 'notification:ready',
|
|
19
|
+
NOTIFICATION_UPDATE: 'notification:update',
|
|
20
|
+
NOTIFICATION_THEME: 'notification:theme',
|
|
21
|
+
};
|
|
22
|
+
exports.VALID_POSITIONS = [
|
|
23
|
+
'topLeft',
|
|
24
|
+
'topCenter',
|
|
25
|
+
'topRight',
|
|
26
|
+
'bottomLeft',
|
|
27
|
+
'bottomCenter',
|
|
28
|
+
'bottomRight',
|
|
29
|
+
];
|
|
30
|
+
exports.VALID_VARIANTS = [
|
|
31
|
+
'default',
|
|
32
|
+
'success',
|
|
33
|
+
'error',
|
|
34
|
+
'warning',
|
|
35
|
+
'loading',
|
|
36
|
+
'progress',
|
|
37
|
+
];
|
|
38
|
+
exports.VALID_THEME_MODES = ['dark', 'light', 'auto'];
|
|
39
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACtB,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,EAAE;IACV,GAAG,EAAE,EAAE;IACP,QAAQ,EAAE,IAAI;IACd,kBAAkB,EAAE,GAAG;IACvB,mBAAmB,EAAE,GAAG;IACxB,WAAW,EAAE,CAAC;CACN,CAAC;AAEE,QAAA,YAAY,GAAG;IAC1B,kBAAkB,EAAE,oBAAoB;IACxC,kBAAkB,EAAE,oBAAoB;IACxC,uBAAuB,EAAE,yBAAyB;IAClD,kBAAkB,EAAE,oBAAoB;IACxC,mBAAmB,EAAE,qBAAqB;IAC1C,kBAAkB,EAAE,oBAAoB;CAChC,CAAC;AAEE,QAAA,eAAe,GAAG;IAC7B,SAAS;IACT,WAAW;IACX,UAAU;IACV,YAAY;IACZ,cAAc;IACd,aAAa;CACL,CAAC;AAEE,QAAA,cAAc,GAAG;IAC5B,SAAS;IACT,SAAS;IACT,OAAO;IACP,SAAS;IACT,SAAS;IACT,UAAU;CACF,CAAC;AAEE,QAAA,iBAAiB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NotificationItem } from '../types/notification.types';
|
|
2
|
+
export declare class NotificationQueue {
|
|
3
|
+
private readonly queue;
|
|
4
|
+
private readonly maxVisible;
|
|
5
|
+
constructor(maxVisible?: number);
|
|
6
|
+
add(item: NotificationItem): void;
|
|
7
|
+
remove(id: string): NotificationItem | undefined;
|
|
8
|
+
getAll(): NotificationItem[];
|
|
9
|
+
getVisible(): NotificationItem[];
|
|
10
|
+
has(id: string): boolean;
|
|
11
|
+
clear(): void;
|
|
12
|
+
get size(): number;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=NotificationQueue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationQueue.d.ts","sourceRoot":"","sources":["../../../src/core/NotificationQueue.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IACtD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAEjB,UAAU,GAAE,MAA6B;IAKrD,GAAG,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAIjC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAMhD,MAAM,IAAI,gBAAgB,EAAE;IAI5B,UAAU,IAAI,gBAAgB,EAAE;IAIhC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB,KAAK,IAAI,IAAI;IAIpB,IAAW,IAAI,IAAI,MAAM,CAExB;CACF"}
|