@apia/notifications 0.0.9-alpha.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cleanDist.json +3 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -45
- package/dist/index.js.map +1 -0
- package/package.json +24 -15
package/cleanDist.json
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ interface INotificationProps {
|
|
|
49
49
|
disableClose?: boolean;
|
|
50
50
|
notification: INotification;
|
|
51
51
|
}
|
|
52
|
-
declare const
|
|
52
|
+
declare const Notification: React.FC<INotificationProps>;
|
|
53
53
|
|
|
54
54
|
declare const _default: React__default.MemoExoticComponent<((props: object) => theme_ui_jsx_runtime.JSX.Element) & {
|
|
55
55
|
displayName: string;
|
|
@@ -71,7 +71,7 @@ declare function notify(notification: TDispatchedNotification): void;
|
|
|
71
71
|
|
|
72
72
|
interface TMessage {
|
|
73
73
|
text: string;
|
|
74
|
-
|
|
74
|
+
content?: string;
|
|
75
75
|
title?: string;
|
|
76
76
|
type?: string;
|
|
77
77
|
}
|
|
@@ -105,4 +105,4 @@ declare const parseServerNotification: (serverNotification: TMessage | TMessage[
|
|
|
105
105
|
*/
|
|
106
106
|
declare const dispatchNotifications: (alert: TNotificationMessage) => void;
|
|
107
107
|
|
|
108
|
-
export { DefaultNotifier, INotification, INotificationsDispatcher,
|
|
108
|
+
export { DefaultNotifier, INotification, INotificationsDispatcher, Notification, _default as NotificationsList, TDispatchedNotification, TMessage, TNotificationId, TNotificationMessage, TNotificationSelector, TNotificationType, defaultNotifier, dispatchNotifications, getNotificationMessageObj, notify, onCloseNotificationCallbacks, parseServerNotification };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var c = require('react');
|
|
4
|
-
var themeUi = require('theme-ui');
|
|
5
|
-
var reactTransitionGroup = require('react-transition-group');
|
|
6
|
-
var util = require('@apia/util');
|
|
7
|
-
var icons = require('@apia/icons');
|
|
8
|
-
var lodashEs = require('lodash-es');
|
|
9
|
-
var store = require('@apia/store');
|
|
10
|
-
var jsxRuntime = require('theme-ui/jsx-runtime');
|
|
11
|
-
var theme = require('@apia/theme');
|
|
12
|
-
var react = require('@emotion/react');
|
|
13
|
-
|
|
14
|
-
function _interopNamespace(e) {
|
|
15
|
-
if (e && e.__esModule) return e;
|
|
16
|
-
var n = Object.create(null);
|
|
17
|
-
if (e) {
|
|
18
|
-
Object.keys(e).forEach(function (k) {
|
|
19
|
-
if (k !== 'default') {
|
|
20
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
21
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () { return e[k]; }
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
n.default = e;
|
|
29
|
-
return Object.freeze(n);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var c__namespace = /*#__PURE__*/_interopNamespace(c);
|
|
33
|
-
|
|
34
|
-
var k=Object.defineProperty,B=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var R=(i,t,o)=>t in i?k(i,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[t]=o,r=(i,t)=>{for(var o in t||(t={}))P.call(t,o)&&R(i,o,t[o]);if(w)for(var o of w(t))v.call(t,o)&&R(i,o,t[o]);return i},f=(i,t)=>B(i,M(t));function F(i){let t=!1;return document.querySelectorAll(".notificationsFloatingList .notification__text").forEach(o=>{if(o.textContent===String(i)){let n=util.getSpecificParent(o,e=>e.classList.contains("notification"));n?(n.classList.add("animate"),setTimeout(()=>{n.classList.remove("animate");},300),t=!0):console.warn("A notification with that text was found, but it could not be animated");}}),t}var b=store.createSlice({name:"notificationsSlice",initialState:{notifications:[]},reducers:{close(i,{payload:t}){i.notifications=i.notifications.map(o=>o.id===t.id?f(r({},o),{isOpen:!1}):o);},closeAll(i){let t=i.notifications.findIndex(o=>o.isOpen);t>=0&&(i.notifications[t].isOpen=!1,setTimeout(()=>p.dispatch(l.closeAll()),50));},delete:(i,{payload:{id:t}})=>{i.notifications=i.notifications.filter(o=>o.id!==t);},push(i,t){let o=t.payload.notifications.filter(n=>!F(n.message));i.notifications.push(...o);}}}),{store:p,useSelector:C}=store.injectReducers({notificationsSlice:b.reducer}),l=b.actions;var T={},x=class{areNotificationsOpen(){return !!document.querySelector(".notification")}close(t){p.dispatch(l.close({id:typeof t=="object"?t.id:t}));}closeAll(){p.dispatch(l.closeAll());}delete(t){p.dispatch(l.delete({id:typeof t=="object"?t.id:t}));}getSelector(){return t=>C(o=>t(o.notificationsSlice.notifications))}notify(t){var n,e;let o=(n=t.id)!=null?n:lodashEs.uniqueId();t.onClose&&(T[o]=t.onClose),p.dispatch(l.push({notifications:[f(r({},t),{isOpen:!0,type:(e=t.type)!=null?e:"warning",id:o,onClose:void 0})]}));}},h=new x;function I(i){new x().notify(i);}var G=({animationName:i="fromRight",animationTimeout:t=150,className:o,disableClose:n,notification:e})=>{let N=c__namespace.useRef(null);e.title||(e.title=util.getIndex([window.LBL_ERROR,window.LBL_WARNING,window.LBL_COMPLETE_OPERATION],[e.type==="danger",e.type==="warning",e.type==="success"])),e.icon||(e.icon=util.getIndex(["Check","Alert","Close"],[e.type==="success",e.type==="warning",e.type==="danger"]));let[g,S]=c__namespace.useState(!0),O=c__namespace.useCallback(()=>{h.delete(e);},[e]);util.useUpdateEffect(()=>{e.isOpen||S(!1);},[e.isOpen]),util.useUnmount(()=>{T[e.id]&&T[e.id]();});let d="warning";["sysException","exception","danger"].includes(e.type)&&(d="danger"),["greenMessage","success"].includes(e.type)&&(d="success");let E=c__namespace.useCallback(()=>{S(!1);},[]);return jsxRuntime.jsx(reactTransitionGroup.CSSTransition,{in:g,timeout:t,classNames:i,appear:!0,unmountOnExit:!0,onExited:O,nodeRef:N,children:jsxRuntime.jsxs(themeUi.Alert,{"data-testid":d,role:"alert",ref:N,variant:`alerts.${d}`,className:`${o!=null?o:""} notification notification__alert ${d}`,tabIndex:0,onKeyDown:c__namespace.useCallback(u=>{(u.key.toLowerCase()==="escape"||u.key.toLowerCase()==="enter"||u.key===" ")&&(u.preventDefault(),u.stopPropagation(),S(!1));},[]),children:[(!n||e.icon||e.title)&&jsxRuntime.jsxs(themeUi.Box,{className:"notification__header",children:[(e.title||e.icon)&&jsxRuntime.jsxs(themeUi.Box,{as:"h4",className:"notification__title",children:[e.icon&&jsxRuntime.jsx(themeUi.Box,{className:"notification__icon",children:icons.isIconName(e.icon)?jsxRuntime.jsx(icons.Icon,{name:e.icon}):e.icon}),e.title]}),!n&&jsxRuntime.jsx(themeUi.Close,{type:"button",onClick:E,tabIndex:-1,className:"notification__closeButton"})]}),jsxRuntime.jsx(themeUi.Box,{className:"notification__body",children:jsxRuntime.jsxs(themeUi.Box,{className:"notification__content",children:[jsxRuntime.jsx(themeUi.Box,{className:"notification__message",children:jsxRuntime.jsx(themeUi.Box,{dangerouslySetInnerHTML:{__html:e.message},className:"notification__text"})}),e.trace&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(themeUi.Box,{as:"code",className:"notification__trace",children:[jsxRuntime.jsx(themeUi.Box,{as:"strong",className:"notification__traceLabel",children:"Trace:"}),jsxRuntime.jsx(themeUi.Box,{className:"notification__traceText",children:e.trace})]})})]})})]})})},_=c__namespace.memo(G);var et=react.keyframes`
|
|
1
|
+
import{jsx as a,jsxs as d,Fragment as T}from"react/jsx-runtime";import*as l from"react";import M from"react";import{Alert as B,Box as r,Close as D}from"theme-ui";import{CSSTransition as X}from"react-transition-group";import{getSpecificParent as F,getIndex as x,useUpdateEffect as q,useUnmount as H,arrayOrArray as U}from"@apia/util";import{isIconName as W,Icon as z}from"@apia/icons";import{uniqueId as w}from"lodash-es";import{createSlice as G,injectReducers as K}from"@apia/store";import{makeStyledComponent as V,spacing as J,getVariant as Q}from"@apia/theme";import{keyframes as Y}from"@emotion/react";var Z=Object.defineProperty,ee=Object.defineProperties,te=Object.getOwnPropertyDescriptors,_=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,N=(t,e,n)=>e in t?Z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,oe=(t,e)=>{for(var n in e||(e={}))ne.call(e,n)&&N(t,n,e[n]);if(_)for(var n of _(e))ie.call(e,n)&&N(t,n,e[n]);return t},ae=(t,e)=>ee(t,te(e));function re(t){let e=!1;return document.querySelectorAll(".notificationsFloatingList .notification__text").forEach(n=>{if(n.textContent===String(t)){const o=F(n,s=>s.classList.contains("notification"));o?(o.classList.add("animate"),setTimeout(()=>{o.classList.remove("animate")},300),e=!0):console.warn("A notification with that text was found, but it could not be animated")}}),e}const j=G({name:"notificationsSlice",initialState:{notifications:[]},reducers:{close(t,{payload:e}){t.notifications=t.notifications.map(n=>n.id===e.id?ae(oe({},n),{isOpen:!1}):n)},closeAll(t){const e=t.notifications.findIndex(n=>n.isOpen);e>=0&&(t.notifications[e].isOpen=!1,setTimeout(()=>u.dispatch(y.closeAll()),50))},delete:(t,{payload:{id:e}})=>{t.notifications=t.notifications.filter(n=>n.id!==e)},push(t,e){const n=e.payload.notifications.filter(o=>!re(o.message));t.notifications.push(...n)}}}),{store:u,useSelector:se}=K({notificationsSlice:j.reducer}),y=j.actions;var ce=Object.defineProperty,le=Object.defineProperties,fe=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable,P=(t,e,n)=>e in t?ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,de=(t,e)=>{for(var n in e||(e={}))pe.call(e,n)&&P(t,n,e[n]);if(S)for(var n of S(e))me.call(e,n)&&P(t,n,e[n]);return t},ue=(t,e)=>le(t,fe(e));const g={};class v{areNotificationsOpen(){return!!document.querySelector(".notification")}close(e){u.dispatch(y.close({id:typeof e=="object"?e.id:e}))}closeAll(){u.dispatch(y.closeAll())}delete(e){u.dispatch(y.delete({id:typeof e=="object"?e.id:e}))}getSelector(){return e=>se(n=>e(n.notificationsSlice.notifications))}notify(e){var n,o;const s=(n=e.id)!=null?n:w();e.onClose&&(g[s]=e.onClose),u.dispatch(y.push({notifications:[ue(de({},e),{isOpen:!0,type:(o=e.type)!=null?o:"warning",id:s,onClose:void 0})]}))}}const O=new v;function b(t){new v().notify(t)}var ye=Object.defineProperty,$=Object.getOwnPropertySymbols,ge=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,C=(t,e,n)=>e in t?ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,he=(t,e)=>{for(var n in e||(e={}))ge.call(e,n)&&C(t,n,e[n]);if($)for(var n of $(e))be.call(e,n)&&C(t,n,e[n]);return t};const E=({animationName:t="fromRight",animationTimeout:e=150,className:n,disableClose:o,notification:s})=>{const i=l.useMemo(()=>he({},s),[s]),f=l.useRef(null);i.title||(i.title=x([window.LBL_ERROR,window.LBL_WARNING,window.LBL_COMPLETE_OPERATION],[i.type==="danger",i.type==="warning",i.type==="success"])),i.icon||(i.icon=x(["Check","Alert","Close"],[i.type==="success",i.type==="warning",i.type==="danger"]));const[R,h]=l.useState(!0),A=l.useCallback(()=>{O.delete(i)},[i]);q(()=>{i.isOpen||h(!1)},[i.isOpen]),H(()=>{g[i.id]&&g[i.id]()});let p="warning";["sysException","exception","danger"].includes(i.type)&&(p="danger"),["greenMessage","success"].includes(i.type)&&(p="success");const k=l.useCallback(()=>{h(!1)},[]);return a(X,{in:R,timeout:e,classNames:t,appear:!0,unmountOnExit:!0,onExited:A,nodeRef:f,children:d(B,{"data-testid":p,role:"alert",ref:f,variant:`alerts.${p}`,className:`${n??""} notification notification__alert ${p}`,tabIndex:0,onKeyDown:l.useCallback(m=>{(m.key.toLowerCase()==="escape"||m.key.toLowerCase()==="enter"||m.key===" ")&&(m.preventDefault(),m.stopPropagation(),h(!1))},[]),children:[(!o||i.icon||i.title)&&d(r,{className:"notification__header",children:[(i.title||i.icon)&&d(r,{as:"h4",className:"notification__title",children:[i.icon&&a(r,{className:"notification__icon",children:W(i.icon)?a(z,{title:"",name:i.icon}):i.icon}),i.title]}),!o&&a(D,{type:"button",onClick:k,tabIndex:-1,className:"notification__closeButton"})]}),a(r,{className:"notification__body",children:d(r,{className:"notification__content",children:[a(r,{className:"notification__message",children:a(r,{dangerouslySetInnerHTML:{__html:i.message},className:"notification__text"})}),i.trace&&a(T,{children:d(r,{as:"code",className:"notification__trace",children:[a(r,{as:"strong",className:"notification__traceLabel",children:"Trace:"}),a(r,{className:"notification__traceText",children:i.trace})]})})]})})]})})};var ve=Object.defineProperty,Oe=Object.defineProperties,xe=Object.getOwnPropertyDescriptors,L=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable,I=(t,e,n)=>e in t?ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ne=(t,e)=>{for(var n in e||(e={}))we.call(e,n)&&I(t,n,e[n]);if(L)for(var n of L(e))_e.call(e,n)&&I(t,n,e[n]);return t},je=(t,e)=>Oe(t,xe(e));const Se=Y`
|
|
35
2
|
0% {
|
|
36
3
|
transform: rotate(0);
|
|
37
4
|
}
|
|
@@ -46,14 +13,4 @@ var k=Object.defineProperty,B=Object.defineProperties;var M=Object.getOwnPropert
|
|
|
46
13
|
|
|
47
14
|
100% {
|
|
48
15
|
transform: rotate(0);
|
|
49
|
-
}`,
|
|
50
|
-
|
|
51
|
-
exports.DefaultNotifier = x;
|
|
52
|
-
exports.Notification = _;
|
|
53
|
-
exports.NotificationsList = at;
|
|
54
|
-
exports.defaultNotifier = h;
|
|
55
|
-
exports.dispatchNotifications = Ht;
|
|
56
|
-
exports.getNotificationMessageObj = $t;
|
|
57
|
-
exports.notify = I;
|
|
58
|
-
exports.onCloseNotificationCallbacks = T;
|
|
59
|
-
exports.parseServerNotification = m;
|
|
16
|
+
}`,Pe=O.getSelector(),$e=V("NotificationsList","layout.common.notifications.list",{".notificationsFloatingList":{bottom:"10px",height:"min-content",maxHeight:"calc(100vh - 20px)",maxWidth:"floatingNotifications",position:"fixed",pr:"5px",right:"5px",width:"100%",zIndex:"notifications","& > *:not(:last-child)":{mb:J(5)},".notification.animate":{animation:`${Se} 0.1s linear infinite`}},".fromRight-enter, .fromRight-appear":{transform:"translateX(550px)"},".fromRight-enter-active, .fromRight-appear-active":{transition:"transform 150ms",transform:"translateX(0)"},".fromRight-exit":{transform:"translateX(0)"},".fromRight-exit-active":{transition:"transform 150ms",transform:"translateX(550px)"}},()=>{const t=Pe(e=>e);return a(r,je(Ne({className:"notificationsFloatingList"},Q("layout.common.components.notifications.list")),{children:t.map(e=>a(E,{notification:e},e.id))}))});var Ce=M.memo($e);const Ee=t=>{var e,n;const o=[];return(e=t?.sysMessages)!=null&&e.message&&o.push(...c(t.sysMessages.message,"warning")),t!=null&&t.sysExceptions&&o.push(...c(t.sysExceptions.exception,"danger")),(n=t?.exceptions)!=null&&n.exception&&o.push(...c(t.exceptions.exception,"danger")),o.length>0?o:null};function Le(t){switch(t){case"1":return"success";case"2":return"warning";case"3":return"danger";default:return"warning"}}const c=(t,e)=>U(t).map(n=>({message:n.text,trace:n.content,title:n.title,type:n.type!==void 0?Le(n.type):e,isOpen:!0,id:w()})),Ie=t=>{var e,n,o,s,i,f;t&&((e=t.sysMessages)!=null&&e.message&&c((n=t.sysMessages)==null?void 0:n.message,"warning").forEach(b),(o=t.exceptions)!=null&&o.exception&&c((s=t.exceptions)==null?void 0:s.exception,"danger").forEach(b),(i=t.sysExceptions)!=null&&i.exception&&c((f=t.sysExceptions)==null?void 0:f.exception,"danger").forEach(b))};export{v as DefaultNotifier,E as Notification,Ce as NotificationsList,O as defaultNotifier,Ie as dispatchNotifications,Ee as getNotificationMessageObj,b as notify,g as onCloseNotificationCallbacks,c as parseServerNotification};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/notificationsStore.ts","../src/defaultNotifier.ts","../src/Notification.tsx","../src/NotificationsList.tsx","../src/apia/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { createSlice, injectReducers, PayloadAction } from '@apia/store';\nimport { getSpecificParent } from '@apia/util';\nimport { INotification, TNotificationId } from './types';\n\nfunction putNotificationToVibrate(message: string) {\n let hasAnimated = false;\n document\n .querySelectorAll('.notificationsFloatingList .notification__text')\n .forEach((current) => {\n if (current.textContent === String(message)) {\n const notificationElement = getSpecificParent(\n current as HTMLElement,\n (search) => {\n return search.classList.contains('notification');\n },\n );\n if (notificationElement) {\n notificationElement.classList.add('animate');\n setTimeout(() => {\n notificationElement.classList.remove('animate');\n }, 300);\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 return hasAnimated;\n}\n\nexport const notificationsSlice = createSlice({\n name: 'notificationsSlice',\n initialState: { notifications: [] } as {\n notifications: INotification<any>[];\n },\n reducers: {\n close(state, { payload }: PayloadAction<{ id: TNotificationId }>) {\n state.notifications = state.notifications.map((current) => {\n return current.id === payload.id\n ? { ...current, isOpen: false }\n : current;\n });\n },\n closeAll(state) {\n const firstOpenIndex = state.notifications.findIndex((current) => {\n return current.isOpen;\n });\n if (firstOpenIndex >= 0) {\n state.notifications[firstOpenIndex].isOpen = false;\n setTimeout(() => {\n return notificationsStore.dispatch(notificationsActions.closeAll());\n }, 50);\n }\n },\n delete: (\n state,\n { payload: { id } }: PayloadAction<{ id: TNotificationId }>,\n ) => {\n state.notifications = state.notifications.filter((current) => {\n return current.id !== id;\n });\n },\n push(\n state,\n payload: PayloadAction<{ notifications: INotification<any>[] }>,\n ) {\n const notifications = payload.payload.notifications.filter(\n (notification) => {\n return !putNotificationToVibrate(notification.message);\n },\n );\n\n state.notifications.push(...notifications);\n },\n },\n});\n\nexport const {\n store: notificationsStore,\n useSelector: useNotificationsSelector,\n} = injectReducers({\n notificationsSlice: notificationsSlice.reducer,\n});\n\nexport const notificationsActions = notificationsSlice.actions;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { uniqueId } from 'lodash-es';\nimport {\n notificationsActions,\n notificationsStore,\n useNotificationsSelector,\n} from './notificationsStore';\nimport {\n INotification,\n INotificationsDispatcher,\n TNotificationId,\n TNotificationSelector,\n} from './types';\n\nexport const onCloseNotificationCallbacks: Record<string, () => unknown> = {};\n\nexport type TNotificationType = 'danger' | 'success' | 'warning';\n\nexport type TDispatchedNotification = Omit<\n INotification<TNotificationType>,\n 'id' | 'type' | 'isOpen'\n> &\n Partial<Pick<INotification<TNotificationType>, 'id' | 'type'>>;\n\nexport class DefaultNotifier\n implements INotificationsDispatcher<TNotificationType>\n{\n areNotificationsOpen(): boolean {\n return !!document.querySelector('.notification');\n }\n\n close(id: TNotificationId | INotification): void {\n notificationsStore.dispatch(\n notificationsActions.close({ id: typeof id === 'object' ? id.id : id }),\n );\n }\n\n closeAll(): void {\n notificationsStore.dispatch(notificationsActions.closeAll());\n }\n\n delete(id: TNotificationId | INotification): void {\n notificationsStore.dispatch(\n notificationsActions.delete({ id: typeof id === 'object' ? id.id : id }),\n );\n }\n\n getSelector(): (\n selector: TNotificationSelector<TNotificationType>,\n ) => INotification<TNotificationType>[] {\n return (selector: TNotificationSelector<TNotificationType>) => {\n return useNotificationsSelector((global) => {\n return selector(\n global.notificationsSlice\n .notifications as INotification<TNotificationType>[],\n );\n });\n };\n }\n\n notify(notification: TDispatchedNotification): void {\n const id = notification.id ?? uniqueId();\n\n if (notification.onClose)\n onCloseNotificationCallbacks[id] = notification.onClose;\n\n notificationsStore.dispatch(\n notificationsActions.push({\n notifications: [\n {\n ...notification,\n isOpen: true,\n type: notification.type ?? 'warning',\n id,\n onClose: undefined,\n },\n ],\n }),\n );\n }\n}\n\nexport const defaultNotifier = new DefaultNotifier();\n\nexport function notify(notification: TDispatchedNotification) {\n new DefaultNotifier().notify(notification);\n}\n","import * as React from 'react';\nimport { Alert, Box, Close } from 'theme-ui';\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';\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\n const onClick = React.useCallback(() => {\n setShouldShow(false);\n }, []);\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 <>\n <Box as=\"code\" className=\"notification__trace\">\n <Box as=\"strong\" className=\"notification__traceLabel\">\n Trace:\n </Box>\n <Box className=\"notification__traceText\">\n {innerNotification.trace}\n </Box>\n </Box>\n </>\n )}\n </Box>\n </Box>\n </Alert>\n </CSSTransition>\n );\n};\n","import React from 'react';\nimport { Box } from 'theme-ui';\nimport { getVariant, makeStyledComponent, spacing } from '@apia/theme';\nimport { keyframes } from '@emotion/react';\nimport { Notification } from './Notification';\nimport { defaultNotifier } from './defaultNotifier';\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.getSelector();\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 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 { uniqueId } from 'lodash-es';\nimport { notify, TNotificationType } 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":["__spreadProps","__spreadValues","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAS,yBAAyB,OAAiB,EAAA;AACjD,EAAA,IAAI,WAAc,GAAA,KAAA,CAAA;AAClB,EAAA,QAAA,CACG,gBA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,KAAA,CAAA,GAAA,EAAA,CAAA,SAAA;AACvB,MAAA,uBAAA,CAAA,CAAwB,EAAM,GAAA,KAAA,CAAA,aAAA,KAAN,IAAqB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,SAAA,EAAW,QAAQ,CAAE,CAAA,OAAA;AAAA,QAChE,MAAA;AAAA,OACF,CAAA;AAAA,GACJ;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -6,22 +6,35 @@
|
|
|
6
6
|
"name": "@apia/notifications",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.1.3",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "rollup -c rollup.config.esb.mjs",
|
|
12
|
+
"buildDev": "rollup -c rollup.config.esb.mjs --dev",
|
|
13
|
+
"watch": "rollup -c rollup.config.esb.mjs --dev --watch"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@rollup/plugin-commonjs": "^24.0.1",
|
|
17
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
18
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
19
|
+
"@rollup/plugin-terser": "^0.4.0",
|
|
20
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
21
|
+
"esbuild": "^0.17.14",
|
|
22
|
+
"rollup": "^3.20.2",
|
|
23
|
+
"rollup-plugin-bundle-analyzer": "^1.6.6",
|
|
24
|
+
"rollup-plugin-dts": "^5.3.0",
|
|
25
|
+
"rollup-plugin-esbuild": "^5.0.0",
|
|
26
|
+
"typescript": "^4.9.5"
|
|
27
|
+
},
|
|
10
28
|
"dependencies": {
|
|
11
|
-
"@apia/icons": "^0.
|
|
12
|
-
"@apia/store": "^0.
|
|
13
|
-
"@apia/theme": "^0.
|
|
14
|
-
"@apia/util": "^0.
|
|
29
|
+
"@apia/icons": "^0.1.3",
|
|
30
|
+
"@apia/store": "^0.1.0",
|
|
31
|
+
"@apia/theme": "^0.1.3",
|
|
32
|
+
"@apia/util": "^0.1.3",
|
|
15
33
|
"@types/lodash-es": "^4.17.7",
|
|
16
34
|
"@types/react-transition-group": "^4.4.5",
|
|
17
35
|
"lodash-es": "^4.17.21",
|
|
18
36
|
"react-transition-group": "^4.4.5"
|
|
19
37
|
},
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"tsup": "^6.6.3",
|
|
22
|
-
"type-fest": "^3.6.1",
|
|
23
|
-
"typescript": "^4.9.5"
|
|
24
|
-
},
|
|
25
38
|
"peerDependencies": {
|
|
26
39
|
"@emotion/react": "^11.10.6",
|
|
27
40
|
"react": "^18.2.0",
|
|
@@ -37,9 +50,5 @@
|
|
|
37
50
|
"url": "http://corp-gitlab-01.domst.st.net/products/apia/ApiaNPMPackages.git",
|
|
38
51
|
"directory": "packages/notifications"
|
|
39
52
|
},
|
|
40
|
-
"
|
|
41
|
-
"build": "tsup",
|
|
42
|
-
"buildDev": "tsup"
|
|
43
|
-
},
|
|
44
|
-
"gitHead": "44a7f4d12bba024c862a7a811b79547c6a8030b1"
|
|
53
|
+
"gitHead": "26592fdfe0290bfed776776bf9dbe5d3ac2c7341"
|
|
45
54
|
}
|