@apia/notifications 3.0.1 → 3.0.6

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/dist/index.d.ts CHANGED
@@ -1,7 +1,97 @@
1
- export { Notification } from './Notification.js';
2
- export { default as NotificationsList } from './NotificationsList.js';
3
- export { dispatchNotifications, getNotificationMessageObj, parseServerNotification } from './apia/index.js';
4
- export { DefaultNotifier, TDispatchedNotification, TNotificationType, defaultNotifier, notify, onCloseNotificationCallbacks, uniqueId } from './defaultNotifier.js';
5
- export { INotification, TNotificationId, TNotificationSelector } from './types.js';
6
- export { TMessage, TNotificationMessage } from './apia/types.js';
1
+ import * as React from 'react';
2
+ import React__default, { ReactNode } from 'react';
3
+ import { EventEmitter, TApiaSystemMessageObj } from '@apia/util';
4
+
5
+ type TNotificationId = string | number;
6
+ interface INotification<T = string> {
7
+ icon?: ReactNode;
8
+ id: TNotificationId;
9
+ isOpen: boolean;
10
+ message: string;
11
+ onClose?: () => unknown;
12
+ title?: string;
13
+ trace?: string;
14
+ type: T;
15
+ }
16
+ type TNotificationSelector<T> = (notifications: INotification<T>[]) => INotification<T>[];
17
+ declare global {
18
+ interface Window {
19
+ LBL_ERROR: string;
20
+ LBL_WARNING: string;
21
+ LBL_COMPLETE_OPERATION: string;
22
+ }
23
+ }
24
+
25
+ interface INotificationProps {
26
+ animationName?: string;
27
+ animationTimeout?: number;
28
+ className?: string;
29
+ disableClose?: boolean;
30
+ notification: INotification;
31
+ }
32
+ declare const Notification: React.FC<INotificationProps>;
33
+
34
+ declare const _default: React__default.MemoExoticComponent<((props: object) => React__default.JSX.Element) & {
35
+ displayName: string;
36
+ }>;
37
+
38
+ declare const onCloseNotificationCallbacks: Record<string, () => unknown>;
39
+ type TNotificationType = 'danger' | 'success' | 'warning';
40
+ declare function uniqueId(): string;
41
+ type TDispatchedNotification = Omit<INotification<TNotificationType>, 'id' | 'type' | 'isOpen'> & Partial<Pick<INotification<TNotificationType>, 'id' | 'type'>>;
42
+ declare class DefaultNotifier extends EventEmitter<{
43
+ changedList: boolean;
44
+ }> {
45
+ notifications: INotification<TNotificationType>[];
46
+ areNotificationsOpen(): boolean;
47
+ shout(): void;
48
+ close(id: TNotificationId | INotification): void;
49
+ closeAll(): void;
50
+ delete(id: TNotificationId | INotification): void;
51
+ useSelector: (selector: TNotificationSelector<TNotificationType>) => INotification<TNotificationType>[];
52
+ notify(notification: TDispatchedNotification): void;
53
+ on<K extends 'changedList'>(eventName: K, fn: (params: {
54
+ changedList: boolean;
55
+ }[K]) => unknown): () => void;
56
+ }
57
+ declare const defaultNotifier: DefaultNotifier;
58
+ declare function notify(notification: TDispatchedNotification): void;
59
+
60
+ interface TMessage {
61
+ text: string;
62
+ content?: string;
63
+ title?: string;
64
+ type?: string;
65
+ }
66
+ interface TNotificationMessage {
67
+ onClose?: string;
68
+ sysMessages?: {
69
+ message: TMessage | TMessage[];
70
+ };
71
+ sysExceptions?: {
72
+ exception: TMessage | TMessage[];
73
+ };
74
+ exceptions?: {
75
+ exception: TMessage | TMessage[];
76
+ };
77
+ }
78
+
79
+ /**
80
+ * Devuelve un array de notificaciones a partir de
81
+ * una respuesta de Apia.
82
+ */
83
+ declare const getNotificationMessageObj: (data: TApiaSystemMessageObj) => INotification<TNotificationType>[] | null;
84
+ /**
85
+ * Toma un objeto de notificación de servidor y lo convierte a un
86
+ * objeto de notificación de cliente.
87
+ */
88
+ declare const parseServerNotification: (serverNotification: TMessage | TMessage[], type: TNotificationType) => INotification<TNotificationType>[];
89
+ /**
90
+ * Toma un objeto de respuesta de servidor que puede eventualmente
91
+ * tener notificaciones y las pasa al sistema de notificaciones si
92
+ * es que hay alguna.
93
+ */
94
+ declare const dispatchNotifications: (alert: TNotificationMessage) => void;
95
+
96
+ export { DefaultNotifier, type INotification, Notification, _default as NotificationsList, type TDispatchedNotification, type TMessage, type TNotificationId, type TNotificationMessage, type TNotificationSelector, type TNotificationType, defaultNotifier, dispatchNotifications, getNotificationMessageObj, notify, onCloseNotificationCallbacks, parseServerNotification, uniqueId };
7
97
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,5 +1,453 @@
1
- export { Notification } from './Notification.js';
2
- export { default as NotificationsList } from './NotificationsList.js';
3
- export { dispatchNotifications, getNotificationMessageObj, parseServerNotification } from './apia/index.js';
4
- export { DefaultNotifier, defaultNotifier, notify, onCloseNotificationCallbacks, uniqueId } from './defaultNotifier.js';
1
+ import { jsxs, jsx, Fragment } from '@apia/theme/jsx-runtime';
2
+ import * as React from 'react';
3
+ import React__default, { useState } from 'react';
4
+ import { Box, IconButton, Button, Alert, Close, makeStyledComponent, spacing, getVariant } from '@apia/theme';
5
+ import { CSSTransition } from 'react-transition-group';
6
+ import { EventEmitter, useLatest, useMount, getIndex, useUpdateEffect, useUnmount, arrayOrArray } from '@apia/util';
7
+ import { Icon, isIconName } from '@apia/icons';
8
+ import { keyframes } from '@emotion/react';
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __publicField = (obj, key, value) => {
13
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
14
+ return value;
15
+ };
16
+ const onCloseNotificationCallbacks = {};
17
+ function shallowEqual(a, b) {
18
+ if (a.length !== b.length)
19
+ return false;
20
+ for (let i = 0; i < a.length; i++)
21
+ if (a[i] !== b[i])
22
+ return false;
23
+ return true;
24
+ }
25
+ let id = 0;
26
+ function uniqueId() {
27
+ return `notification_${id++}`;
28
+ }
29
+ class DefaultNotifier extends EventEmitter {
30
+ constructor() {
31
+ super(...arguments);
32
+ __publicField(this, "notifications", []);
33
+ __publicField(this, "useSelector", (selector) => {
34
+ const [state, setState] = useState([]);
35
+ const lastState = useLatest(state);
36
+ useMount(() => {
37
+ return this.on("changedList", () => {
38
+ const newState = selector(this.notifications);
39
+ if (!shallowEqual(newState, lastState.current)) {
40
+ setState([...newState]);
41
+ }
42
+ });
43
+ });
44
+ return state;
45
+ });
46
+ }
47
+ areNotificationsOpen() {
48
+ return !!document.querySelector(".notification");
49
+ }
50
+ shout() {
51
+ this.emit("changedList", true);
52
+ }
53
+ close(id2) {
54
+ const actualId = typeof id2 === "object" ? id2.id : id2;
55
+ this.notifications = this.notifications.map((current) => {
56
+ if (current.id === actualId) {
57
+ current.onClose?.();
58
+ return { ...current, isOpen: false };
59
+ }
60
+ return current;
61
+ });
62
+ this.shout();
63
+ }
64
+ closeAll() {
65
+ this.notifications = this.notifications.map((current) => {
66
+ current.onClose?.();
67
+ return {
68
+ ...current,
69
+ isOpen: false
70
+ };
71
+ });
72
+ this.shout();
73
+ }
74
+ delete(id2) {
75
+ const actualId = typeof id2 === "object" ? id2.id : id2;
76
+ this.notifications = this.notifications.filter(
77
+ (current) => current.id !== actualId
78
+ );
79
+ this.shout();
80
+ }
81
+ notify(notification) {
82
+ const id2 = notification.id ?? uniqueId();
83
+ let hasAnimated = false;
84
+ document.querySelectorAll(".notificationsFloatingList .notification__text").forEach((current) => {
85
+ if (current.textContent === notification.message) {
86
+ const notificationElement = current.closest(
87
+ ".notification"
88
+ );
89
+ if (notificationElement) {
90
+ notificationElement.classList.add("animate");
91
+ setTimeout(() => {
92
+ notificationElement.classList.remove("animate");
93
+ }, 200);
94
+ hasAnimated = true;
95
+ } else
96
+ console.warn(
97
+ "A notification with that text was found, but it could not be animated"
98
+ );
99
+ }
100
+ });
101
+ if (hasAnimated)
102
+ return;
103
+ this.notifications.push({
104
+ ...notification,
105
+ isOpen: true,
106
+ type: notification.type ?? "warning",
107
+ id: id2
108
+ });
109
+ this.shout();
110
+ }
111
+ on(eventName, fn) {
112
+ fn(true);
113
+ return super.on(eventName, fn);
114
+ }
115
+ }
116
+ const defaultNotifier = new DefaultNotifier();
117
+ function notify(notification) {
118
+ defaultNotifier.notify(notification);
119
+ }
120
+
121
+ const Trace = ({ trace }) => {
122
+ const openModal = () => {
123
+ document.dispatchEvent(
124
+ new CustomEvent("openModal", {
125
+ detail: {
126
+ NavBar: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
127
+ Button,
128
+ {
129
+ variant: "outline-sm",
130
+ onClick: () => {
131
+ void navigator.clipboard.writeText(
132
+ document.querySelector(".TraceModal__content")?.innerText ?? ""
133
+ );
134
+ },
135
+ children: "Copy trace"
136
+ }
137
+ ) }),
138
+ children: /* @__PURE__ */ jsx(
139
+ Box,
140
+ {
141
+ dangerouslySetInnerHTML: {
142
+ __html: trace.replaceAll(
143
+ /\((\w+\.java:\d+)\)/g,
144
+ "(<strong>$1</strong>)"
145
+ )
146
+ }
147
+ }
148
+ ),
149
+ size: "xxl",
150
+ title: "Stack trace"
151
+ }
152
+ })
153
+ );
154
+ };
155
+ return /* @__PURE__ */ jsxs(Box, { as: "code", className: "notification__trace", children: [
156
+ /* @__PURE__ */ jsxs(Box, { as: "strong", className: "notification__traceLabel", children: [
157
+ /* @__PURE__ */ jsx(
158
+ IconButton,
159
+ {
160
+ size: "IconMd",
161
+ onClick: openModal,
162
+ title: "View trace",
163
+ sx: {
164
+ height: "24px",
165
+ width: "24px"
166
+ },
167
+ children: /* @__PURE__ */ jsx(Icon, { size: "iconXs", title: "", name: "External" })
168
+ }
169
+ ),
170
+ /* @__PURE__ */ jsx(
171
+ IconButton,
172
+ {
173
+ size: "IconMd",
174
+ title: "Copy trace",
175
+ sx: {
176
+ height: "24px",
177
+ width: "24px"
178
+ },
179
+ onClick: () => void navigator.clipboard.writeText(
180
+ trace.replaceAll(/<br *\/?>/g, "\n")
181
+ ),
182
+ children: /* @__PURE__ */ jsx(Icon, { size: "iconXs", title: "", name: "Copy" })
183
+ }
184
+ ),
185
+ /* @__PURE__ */ jsx(Box, { as: "span", children: "Trace:" })
186
+ ] }),
187
+ /* @__PURE__ */ jsx(Box, { className: "notification__traceText", children: trace })
188
+ ] });
189
+ };
190
+ var Trace$1 = Trace;
191
+
192
+ const Notification = ({
193
+ animationName = "fromRight",
194
+ animationTimeout = 150,
195
+ className,
196
+ disableClose,
197
+ notification
198
+ }) => {
199
+ const innerNotification = React.useMemo(
200
+ () => ({ ...notification }),
201
+ [notification]
202
+ );
203
+ const nodeRef = React.useRef(null);
204
+ if (!innerNotification.title)
205
+ innerNotification.title = getIndex(
206
+ [window.LBL_ERROR, window.LBL_WARNING, window.LBL_COMPLETE_OPERATION],
207
+ [
208
+ innerNotification.type === "danger",
209
+ innerNotification.type === "warning",
210
+ innerNotification.type === "success"
211
+ ]
212
+ );
213
+ if (!innerNotification.icon)
214
+ innerNotification.icon = getIndex(
215
+ ["Check", "Alert", "Close"],
216
+ [
217
+ innerNotification.type === "success",
218
+ innerNotification.type === "warning",
219
+ innerNotification.type === "danger"
220
+ ]
221
+ );
222
+ const [shouldShow, setShouldShow] = React.useState(true);
223
+ const close = React.useCallback(() => {
224
+ defaultNotifier.delete(innerNotification);
225
+ }, [innerNotification]);
226
+ useUpdateEffect(() => {
227
+ if (!innerNotification.isOpen)
228
+ setShouldShow(false);
229
+ }, [innerNotification.isOpen]);
230
+ useUnmount(() => {
231
+ if (onCloseNotificationCallbacks[innerNotification.id])
232
+ onCloseNotificationCallbacks[innerNotification.id]();
233
+ });
234
+ let notificationType = "warning";
235
+ if (["sysException", "exception", "danger"].includes(innerNotification.type))
236
+ notificationType = "danger";
237
+ if (["greenMessage", "success"].includes(innerNotification.type))
238
+ notificationType = "success";
239
+ if (["info"].includes(innerNotification.type))
240
+ notificationType = "info";
241
+ const onClick = React.useCallback(() => {
242
+ setShouldShow(false);
243
+ defaultNotifier.close(innerNotification);
244
+ }, [innerNotification]);
245
+ return /* @__PURE__ */ jsx(
246
+ CSSTransition,
247
+ {
248
+ in: shouldShow,
249
+ timeout: animationTimeout,
250
+ classNames: animationName,
251
+ appear: true,
252
+ unmountOnExit: true,
253
+ onExited: close,
254
+ nodeRef,
255
+ children: /* @__PURE__ */ jsxs(
256
+ Alert,
257
+ {
258
+ "data-testid": notificationType,
259
+ role: "alert",
260
+ ref: nodeRef,
261
+ variant: `alerts.${notificationType}`,
262
+ className: `${className ?? ""} notification notification__alert ${notificationType}`,
263
+ tabIndex: 0,
264
+ onKeyDown: React.useCallback((ev) => {
265
+ if (ev.key.toLowerCase() === "escape" || ev.key.toLowerCase() === "enter" || ev.key === " ") {
266
+ ev.preventDefault();
267
+ ev.stopPropagation();
268
+ setShouldShow(false);
269
+ }
270
+ }, []),
271
+ children: [
272
+ (!disableClose || innerNotification.icon || innerNotification.title) && /* @__PURE__ */ jsxs(Box, { className: "notification__header", children: [
273
+ (innerNotification.title || innerNotification.icon) && /* @__PURE__ */ jsxs(Box, { as: "h4", className: "notification__title", children: [
274
+ innerNotification.icon && /* @__PURE__ */ jsx(Box, { className: "notification__icon", children: isIconName(
275
+ innerNotification.icon
276
+ ) ? /* @__PURE__ */ jsx(
277
+ Icon,
278
+ {
279
+ title: "",
280
+ name: innerNotification.icon
281
+ }
282
+ ) : innerNotification.icon }),
283
+ innerNotification.title
284
+ ] }),
285
+ !disableClose && /* @__PURE__ */ jsx(
286
+ Close,
287
+ {
288
+ type: "button",
289
+ onClick,
290
+ tabIndex: -1,
291
+ className: "notification__closeButton"
292
+ }
293
+ )
294
+ ] }),
295
+ /* @__PURE__ */ jsx(Box, { className: "notification__body", children: /* @__PURE__ */ jsxs(Box, { className: "notification__content", children: [
296
+ /* @__PURE__ */ jsx(Box, { className: "notification__message", children: /* @__PURE__ */ jsx(
297
+ Box,
298
+ {
299
+ dangerouslySetInnerHTML: {
300
+ __html: innerNotification.message
301
+ },
302
+ className: "notification__text"
303
+ }
304
+ ) }),
305
+ innerNotification.trace && /* @__PURE__ */ jsx(Trace$1, { trace: innerNotification.trace })
306
+ ] }) })
307
+ ]
308
+ }
309
+ )
310
+ }
311
+ );
312
+ };
313
+
314
+ const vibrate = keyframes`
315
+ 0% {
316
+ transform: rotate(0);
317
+ }
318
+
319
+ 25% {
320
+ transform: rotate(1.5deg);
321
+ }
322
+
323
+ 75% {
324
+ transform: rotate(-1.5deg);
325
+ }
326
+
327
+ 100% {
328
+ transform: rotate(0);
329
+ }`;
330
+ const useSelector = defaultNotifier.useSelector;
331
+ const NotificationsList = makeStyledComponent(
332
+ "NotificationsList",
333
+ "layout.common.notifications.list",
334
+ {
335
+ ".notificationsFloatingList": {
336
+ bottom: "10px",
337
+ height: "min-content",
338
+ maxHeight: "calc(100vh - 20px)",
339
+ maxWidth: "floatingNotifications",
340
+ position: "fixed",
341
+ pr: "5px",
342
+ right: "5px",
343
+ width: "100%",
344
+ zIndex: "notifications",
345
+ "& > *:not(:last-child)": {
346
+ mb: spacing(5)
347
+ },
348
+ ".notification.animate": {
349
+ animation: `${vibrate} 0.1s linear infinite`
350
+ }
351
+ },
352
+ ".fromRight-enter, .fromRight-appear": { transform: "translateX(550px)" },
353
+ ".fromRight-enter-active, .fromRight-appear-active": {
354
+ transition: "transform 150ms",
355
+ transform: "translateX(0)"
356
+ },
357
+ ".fromRight-exit": { transform: "translateX(0)" },
358
+ ".fromRight-exit-active": {
359
+ transition: "transform 150ms",
360
+ transform: "translateX(550px)"
361
+ }
362
+ },
363
+ () => {
364
+ const notifications = useSelector((current) => {
365
+ return current;
366
+ });
367
+ useMount(() => {
368
+ document.addEventListener("keydown", (ev) => {
369
+ if (ev.code === "Escape") {
370
+ defaultNotifier.closeAll();
371
+ }
372
+ });
373
+ });
374
+ return /* @__PURE__ */ jsx(
375
+ Box,
376
+ {
377
+ className: "notificationsFloatingList",
378
+ ...getVariant("layout.common.components.notifications.list"),
379
+ children: notifications.map((current) => {
380
+ return /* @__PURE__ */ jsx(Notification, { notification: current }, current.id);
381
+ })
382
+ }
383
+ );
384
+ }
385
+ );
386
+ var NotificationsList$1 = React__default.memo(NotificationsList);
387
+
388
+ const getNotificationMessageObj = (data) => {
389
+ const notifications = [];
390
+ if (data?.sysMessages?.message) {
391
+ notifications.push(
392
+ ...parseServerNotification(data.sysMessages.message, "warning")
393
+ );
394
+ }
395
+ if (data?.sysExceptions) {
396
+ notifications.push(
397
+ ...parseServerNotification(data.sysExceptions.exception, "danger")
398
+ );
399
+ }
400
+ if (data?.exceptions?.exception) {
401
+ notifications.push(
402
+ ...parseServerNotification(data.exceptions.exception, "danger")
403
+ );
404
+ }
405
+ if (notifications.length > 0)
406
+ return notifications;
407
+ return null;
408
+ };
409
+ function parseServerNotificationType(type) {
410
+ switch (type) {
411
+ case "1":
412
+ return "success";
413
+ case "2":
414
+ return "warning";
415
+ case "3":
416
+ return "danger";
417
+ default:
418
+ return "warning";
419
+ }
420
+ }
421
+ const parseServerNotification = (serverNotification, type) => {
422
+ const messages = arrayOrArray(serverNotification);
423
+ return messages.map((current) => {
424
+ const returnNotification = {
425
+ message: current.text,
426
+ trace: current.content,
427
+ title: current.title,
428
+ type: current.type !== void 0 ? parseServerNotificationType(current.type) : type,
429
+ isOpen: true,
430
+ id: uniqueId()
431
+ };
432
+ return returnNotification;
433
+ });
434
+ };
435
+ const dispatchNotifications = (alert) => {
436
+ if (alert) {
437
+ if (alert.sysMessages?.message)
438
+ parseServerNotification(alert.sysMessages?.message, "warning").forEach(
439
+ notify
440
+ );
441
+ if (alert.exceptions?.exception)
442
+ parseServerNotification(alert.exceptions?.exception, "danger").forEach(
443
+ notify
444
+ );
445
+ if (alert.sysExceptions?.exception)
446
+ parseServerNotification(alert.sysExceptions?.exception, "danger").forEach(
447
+ notify
448
+ );
449
+ }
450
+ };
451
+
452
+ export { DefaultNotifier, Notification, NotificationsList$1 as NotificationsList, defaultNotifier, dispatchNotifications, getNotificationMessageObj, notify, onCloseNotificationCallbacks, parseServerNotification, uniqueId };
5
453
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/defaultNotifier.ts","../src/Trace.tsx","../src/Notification.tsx","../src/NotificationsList.tsx","../src/apia/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { INotification, TNotificationId, TNotificationSelector } from './types';\nimport { EventEmitter, useMount, useLatest } from '@apia/util';\nimport { useState } from 'react';\n\nexport const onCloseNotificationCallbacks: Record<string, () => unknown> = {};\n\nexport type TNotificationType = 'danger' | 'success' | 'warning';\n\nfunction shallowEqual(a: unknown[], b: unknown[]) {\n if (a.length !== b.length) return false;\n\n for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;\n\n return true;\n}\n\nlet id=0;\nexport function uniqueId() {\n return `notification_${id++}`\n}\n\nexport type TDispatchedNotification = Omit<\n INotification<TNotificationType>,\n 'id' | 'type' | 'isOpen'\n> &\n Partial<Pick<INotification<TNotificationType>, 'id' | 'type'>>;\n\nexport class DefaultNotifier extends EventEmitter<{ changedList: boolean }> {\n notifications: INotification<TNotificationType>[] = [];\n\n areNotificationsOpen(): boolean {\n return !!document.querySelector('.notification');\n }\n\n shout() {\n this.emit('changedList', true);\n }\n\n close(id: TNotificationId | INotification): void {\n const actualId = typeof id === 'object' ? id.id : id;\n this.notifications = this.notifications.map((current) => {\n if (current.id === actualId) {\n current.onClose?.();\n return { ...current, isOpen: false };\n }\n return current;\n });\n this.shout();\n }\n\n closeAll(): void {\n this.notifications = this.notifications.map((current) => {\n current.onClose?.();\n return {\n ...current,\n isOpen: false,\n };\n });\n this.shout();\n }\n\n delete(id: TNotificationId | INotification): void {\n const actualId = typeof id === 'object' ? id.id : id;\n this.notifications = this.notifications.filter(\n (current) => current.id !== actualId,\n );\n this.shout();\n }\n\n useSelector = (\n selector: TNotificationSelector<TNotificationType>,\n ): INotification<TNotificationType>[] => {\n const [state, setState] = useState<INotification<TNotificationType>[]>([]);\n\n const lastState = useLatest(state);\n useMount(() => {\n return this.on('changedList', () => {\n const newState = selector(this.notifications);\n if (!shallowEqual(newState, lastState.current)) {\n setState([...newState]);\n }\n });\n });\n\n return state;\n };\n\n notify(notification: TDispatchedNotification): void {\n const id = notification.id ?? uniqueId();\n\n let hasAnimated = false;\n document\n .querySelectorAll('.notificationsFloatingList .notification__text')\n .forEach((current) => {\n if (current.textContent === notification.message) {\n const notificationElement = (current as HTMLElement).closest(\n '.notification',\n ) as HTMLElement;\n if (notificationElement) {\n notificationElement.classList.add('animate');\n setTimeout(() => {\n notificationElement.classList.remove('animate');\n }, 200);\n hasAnimated = true;\n } else\n console.warn(\n 'A notification with that text was found, but it could not be animated',\n );\n }\n });\n if (hasAnimated) return;\n\n this.notifications.push({\n ...notification,\n isOpen: true,\n type: notification.type ?? 'warning',\n id,\n });\n\n this.shout();\n }\n\n on<K extends 'changedList'>(\n eventName: K,\n fn: (params: { changedList: boolean }[K]) => unknown,\n ): () => void {\n fn(true);\n return super.on(eventName, fn);\n }\n}\n\nexport const defaultNotifier = new DefaultNotifier();\n\nexport function notify(notification: TDispatchedNotification) {\n defaultNotifier.notify(notification);\n}\n","import { Icon } from '@apia/icons';\nimport { Box, Button, IconButton } from '@apia/theme';\n\ninterface ITrace {\n trace: string;\n}\n\nconst Trace = ({ trace }: ITrace) => {\n const openModal = () => {\n document.dispatchEvent(\n new CustomEvent('openModal', {\n detail: {\n NavBar: (\n <>\n <Button\n variant=\"outline-sm\"\n onClick={() => {\n void navigator.clipboard.writeText(\n document.querySelector<HTMLElement>('.TraceModal__content')\n ?.innerText ?? '',\n );\n }}\n >\n Copy trace\n </Button>\n </>\n ),\n children: (\n <Box\n dangerouslySetInnerHTML={{\n __html: trace.replaceAll(\n /\\((\\w+\\.java:\\d+)\\)/g,\n '(<strong>$1</strong>)',\n ),\n }}\n />\n ),\n size: 'xxl',\n title: 'Stack trace',\n },\n }),\n );\n };\n\n return (\n <Box as=\"code\" className=\"notification__trace\">\n <Box as=\"strong\" className=\"notification__traceLabel\">\n <IconButton\n size=\"IconMd\"\n onClick={openModal}\n title=\"View trace\"\n sx={{\n height: '24px',\n width: '24px',\n }}\n >\n <Icon size=\"iconXs\" title=\"\" name=\"External\" />\n </IconButton>\n <IconButton\n size=\"IconMd\"\n title=\"Copy trace\"\n sx={{\n height: '24px',\n width: '24px',\n }}\n onClick={() =>\n void navigator.clipboard.writeText(\n trace.replaceAll(/<br *\\/?>/g, '\\n'),\n )\n }\n >\n <Icon size=\"iconXs\" title=\"\" name=\"Copy\" />\n </IconButton>\n <Box as=\"span\">Trace:</Box>\n </Box>\n <Box className=\"notification__traceText\">{trace}</Box>\n </Box>\n );\n};\n\nexport default Trace;\n","import * as React from 'react';\nimport { Alert, Box, Close } from '@apia/theme';\nimport { CSSTransition } from 'react-transition-group';\nimport { getIndex, useUnmount, useUpdateEffect } from '@apia/util';\nimport { Icon, isIconName, TIconName } from '@apia/icons';\nimport { INotification } from './types';\nimport {\n defaultNotifier,\n onCloseNotificationCallbacks,\n} from './defaultNotifier';\nimport Trace from './Trace';\n\nexport interface INotificationProps {\n animationName?: string;\n animationTimeout?: number;\n className?: string;\n disableClose?: boolean;\n notification: INotification;\n}\n\nexport const Notification: React.FC<INotificationProps> = ({\n animationName = 'fromRight',\n animationTimeout = 150,\n className,\n disableClose,\n notification,\n}) => {\n const innerNotification = React.useMemo(\n () => ({ ...notification }),\n [notification],\n );\n const nodeRef = React.useRef(null);\n if (!innerNotification.title)\n innerNotification.title = getIndex(\n [window.LBL_ERROR, window.LBL_WARNING, window.LBL_COMPLETE_OPERATION],\n [\n innerNotification.type === 'danger',\n innerNotification.type === 'warning',\n innerNotification.type === 'success',\n ],\n );\n if (!innerNotification.icon)\n innerNotification.icon = getIndex<TIconName>(\n ['Check', 'Alert', 'Close'],\n [\n innerNotification.type === 'success',\n innerNotification.type === 'warning',\n innerNotification.type === 'danger',\n ],\n );\n\n const [shouldShow, setShouldShow] = React.useState(true);\n\n const close = React.useCallback(() => {\n defaultNotifier.delete(innerNotification);\n }, [innerNotification]);\n\n useUpdateEffect(() => {\n if (!innerNotification.isOpen) setShouldShow(false);\n }, [innerNotification.isOpen]);\n\n useUnmount(() => {\n if (onCloseNotificationCallbacks[innerNotification.id])\n onCloseNotificationCallbacks[innerNotification.id]();\n });\n\n let notificationType: INotification['type'] = 'warning';\n if (['sysException', 'exception', 'danger'].includes(innerNotification.type))\n notificationType = 'danger';\n if (['greenMessage', 'success'].includes(innerNotification.type))\n notificationType = 'success';\n if (['info'].includes(innerNotification.type)) notificationType = 'info';\n\n const onClick = React.useCallback(() => {\n setShouldShow(false);\n defaultNotifier.close(innerNotification);\n }, [innerNotification]);\n\n return (\n <CSSTransition\n in={shouldShow}\n timeout={animationTimeout}\n classNames={animationName}\n appear\n unmountOnExit\n onExited={close}\n nodeRef={nodeRef}\n >\n <Alert\n data-testid={notificationType}\n role=\"alert\"\n ref={nodeRef}\n variant={`alerts.${notificationType}`}\n className={`${\n className ?? ''\n } notification notification__alert ${notificationType}`}\n tabIndex={0}\n onKeyDown={React.useCallback((ev: React.KeyboardEvent) => {\n if (\n ev.key.toLowerCase() === 'escape' ||\n ev.key.toLowerCase() === 'enter' ||\n ev.key === ' '\n ) {\n ev.preventDefault();\n ev.stopPropagation();\n setShouldShow(false);\n }\n }, [])}\n >\n {(!disableClose ||\n innerNotification.icon ||\n innerNotification.title) && (\n <Box className=\"notification__header\">\n {(innerNotification.title || innerNotification.icon) && (\n <Box as=\"h4\" className=\"notification__title\">\n {innerNotification.icon && (\n <Box className=\"notification__icon\">\n {isIconName(\n innerNotification.icon as unknown as TIconName,\n ) ? (\n <Icon\n title=\"\"\n name={innerNotification.icon as unknown as TIconName}\n />\n ) : (\n innerNotification.icon\n )}\n </Box>\n )}\n {innerNotification.title}\n </Box>\n )}\n {!disableClose && (\n <Close\n type=\"button\"\n onClick={onClick}\n tabIndex={-1}\n className=\"notification__closeButton\"\n />\n )}\n </Box>\n )}\n <Box className=\"notification__body\">\n <Box className=\"notification__content\">\n <Box className=\"notification__message\">\n <Box\n dangerouslySetInnerHTML={{\n __html: innerNotification.message,\n }}\n className=\"notification__text\"\n />\n </Box>\n {innerNotification.trace && (\n <Trace trace={innerNotification.trace} />\n )}\n </Box>\n </Box>\n </Alert>\n </CSSTransition>\n );\n};\n","import React from 'react';\nimport { Box } from '@apia/theme';\nimport { getVariant, makeStyledComponent, spacing } from '@apia/theme';\nimport { keyframes } from '@emotion/react';\nimport { Notification } from './Notification';\nimport { defaultNotifier } from './defaultNotifier';\nimport { useMount } from '@apia/util';\n\nconst vibrate = keyframes`\n0% {\n transform: rotate(0);\n}\n\n25% {\n transform: rotate(1.5deg);\n}\n\n75% {\n transform: rotate(-1.5deg);\n}\n\n100% {\n transform: rotate(0);\n}`;\n\nconst useSelector = defaultNotifier.useSelector;\n\nconst NotificationsList = makeStyledComponent(\n 'NotificationsList',\n 'layout.common.notifications.list',\n {\n '.notificationsFloatingList': {\n bottom: '10px',\n height: 'min-content',\n maxHeight: 'calc(100vh - 20px)',\n maxWidth: 'floatingNotifications',\n position: 'fixed',\n pr: '5px',\n right: '5px',\n width: '100%',\n zIndex: 'notifications',\n\n '& > *:not(:last-child)': {\n mb: spacing(5),\n },\n\n '.notification.animate': {\n animation: `${vibrate} 0.1s linear infinite`,\n },\n },\n\n '.fromRight-enter, .fromRight-appear': { transform: 'translateX(550px)' },\n '.fromRight-enter-active, .fromRight-appear-active': {\n transition: 'transform 150ms',\n transform: 'translateX(0)',\n },\n '.fromRight-exit': { transform: 'translateX(0)' },\n '.fromRight-exit-active': {\n transition: 'transform 150ms',\n transform: 'translateX(550px)',\n },\n },\n () => {\n const notifications = useSelector((current) => {\n return current;\n });\n\n useMount(() => {\n document.addEventListener('keydown', (ev) => {\n if (ev.code === 'Escape') {\n defaultNotifier.closeAll();\n }\n });\n });\n\n return (\n <Box\n className=\"notificationsFloatingList\"\n {...getVariant('layout.common.components.notifications.list')}\n >\n {notifications.map((current) => {\n return <Notification notification={current} key={current.id} />;\n })}\n </Box>\n );\n },\n);\n\nexport default React.memo(NotificationsList);\n","import { arrayOrArray, TApiaSystemMessageObj } from '@apia/util';\nimport { notify, TNotificationType, uniqueId } from '../defaultNotifier';\nimport { INotification } from '../types';\nimport { TMessage, TNotificationMessage } from './types';\n\n/**\n * Devuelve un array de notificaciones a partir de\n * una respuesta de Apia.\n */\nexport const getNotificationMessageObj = (\n data: TApiaSystemMessageObj,\n): INotification<TNotificationType>[] | null => {\n const notifications: INotification<TNotificationType>[] = [];\n if (data?.sysMessages?.message) {\n notifications.push(\n ...parseServerNotification(data.sysMessages.message, 'warning'),\n );\n }\n if (data?.sysExceptions) {\n notifications.push(\n ...parseServerNotification(data.sysExceptions.exception, 'danger'),\n );\n }\n if (data?.exceptions?.exception) {\n notifications.push(\n ...parseServerNotification(data.exceptions.exception, 'danger'),\n );\n }\n if (notifications.length > 0) return notifications;\n return null;\n};\n\nfunction parseServerNotificationType(type: string): TNotificationType {\n switch (type) {\n case '1':\n return 'success';\n case '2':\n return 'warning';\n case '3':\n return 'danger';\n default:\n return 'warning';\n }\n}\n\n/**\n * Toma un objeto de notificación de servidor y lo convierte a un\n * objeto de notificación de cliente.\n */\nexport const parseServerNotification = (\n serverNotification: TMessage | TMessage[],\n type: TNotificationType,\n): INotification<TNotificationType>[] => {\n const messages = arrayOrArray(serverNotification);\n return messages.map((current) => {\n const returnNotification: INotification<TNotificationType> = {\n message: current.text,\n trace: current.content,\n title: current.title,\n type:\n current.type !== undefined\n ? parseServerNotificationType(current.type)\n : (type as TNotificationType),\n isOpen: true,\n id: uniqueId(),\n };\n return returnNotification;\n });\n};\n\n/**\n * Toma un objeto de respuesta de servidor que puede eventualmente\n * tener notificaciones y las pasa al sistema de notificaciones si\n * es que hay alguna.\n */\nexport const dispatchNotifications = (alert: TNotificationMessage) => {\n if (alert) {\n if (alert.sysMessages?.message)\n parseServerNotification(alert.sysMessages?.message, 'warning').forEach(\n notify,\n );\n if (alert.exceptions?.exception)\n parseServerNotification(alert.exceptions?.exception, 'danger').forEach(\n notify,\n );\n if (alert.sysExceptions?.exception)\n parseServerNotification(alert.sysExceptions?.exception, 'danger').forEach(\n notify,\n );\n }\n};\n\nexport * from './types';\n"],"names":["id","Trace","React"],"mappings":";;;;;;;;;;;;;;;A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AAAA,QAC7D,MAAA;AAAA,OACF,CAAA;AACF,IAAA,IAAI,MAAM,aAAe,EAAA,SAAA;AACvB,MAAA,uBAAA,CAAwB,KAAM,CAAA,aAAA,EAAe,SAAW,EAAA,QAAQ,CAAE,CAAA,OAAA;AAAA,QAChE,MAAA;AAAA,OACF,CAAA;AAAA,GACJ;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apia/notifications",
3
- "version": "3.0.1",
3
+ "version": "3.0.6",
4
4
  "sideEffects": false,
5
5
  "author": "Alexis Leite <alexisleite@live.com>",
6
6
  "main": "dist/index.js",
@@ -41,5 +41,5 @@
41
41
  "url": "http://corp-gitlab-01.domst.st.net/products/apia/ApiaNPMPackages.git",
42
42
  "directory": "packages/notifications"
43
43
  },
44
- "gitHead": "1fc338a96b6dc90632052f9bd032992f6aedb6a6"
44
+ "gitHead": "964a51f08ff5c0da7568511abe73b48a67f70dc5"
45
45
  }
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
- import { INotification } from './types.js';
3
-
4
- interface INotificationProps {
5
- animationName?: string;
6
- animationTimeout?: number;
7
- className?: string;
8
- disableClose?: boolean;
9
- notification: INotification;
10
- }
11
- declare const Notification: React.FC<INotificationProps>;
12
-
13
- export { type INotificationProps, Notification };
14
- //# sourceMappingURL=Notification.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Notification.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}