@mantine/notifications 4.1.0 → 4.1.1
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/cjs/events.js +1 -1
- package/cjs/events.js.map +1 -1
- package/esm/events.js +1 -1
- package/esm/events.js.map +1 -1
- package/package.json +3 -3
package/cjs/events.js
CHANGED
|
@@ -35,7 +35,7 @@ function useNotificationsEvents(ctx) {
|
|
|
35
35
|
hide: (event) => ctx.hideNotification(event.detail),
|
|
36
36
|
update: (event) => ctx.updateNotification(event.detail.id, event.detail),
|
|
37
37
|
clean: ctx.clean,
|
|
38
|
-
|
|
38
|
+
cleanQueue: ctx.cleanQueue
|
|
39
39
|
};
|
|
40
40
|
React.useEffect(() => {
|
|
41
41
|
Object.keys(events).forEach((event) => {
|
package/cjs/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sources":["../src/events.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport type { NotificationProps, NotificationsContextProps } from './types';\n\ntype ValueOf<T> = T[keyof T];\n\nexport const NOTIFICATIONS_EVENTS = {\n show: 'mantine:show-notification',\n hide: 'mantine:hide-notification',\n update: 'mantine:update-notification',\n clean: 'mantine:clean-notifications',\n cleanQueue: 'mantine:clean-notifications-queue',\n} as const;\n\nexport function createEvent(type: ValueOf<typeof NOTIFICATIONS_EVENTS>, detail?: any) {\n return new CustomEvent(type, { detail });\n}\n\nexport function showNotification(notification: NotificationProps) {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.show, notification));\n}\n\nexport function updateNotification(notification: NotificationProps & { id: string }) {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.update, notification));\n}\n\nexport function hideNotification(id: string) {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.hide, id));\n}\n\nexport function cleanNotifications() {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.clean));\n}\n\nexport function cleanNotificationsQueue() {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.cleanQueue));\n}\n\nexport function useNotificationsEvents(ctx: NotificationsContextProps) {\n const events = {\n show: (event: any) => ctx.showNotification(event.detail),\n hide: (event: any) => ctx.hideNotification(event.detail),\n update: (event: any) => ctx.updateNotification(event.detail.id, event.detail),\n clean: ctx.clean,\n
|
|
1
|
+
{"version":3,"file":"events.js","sources":["../src/events.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport type { NotificationProps, NotificationsContextProps } from './types';\n\ntype ValueOf<T> = T[keyof T];\n\nexport const NOTIFICATIONS_EVENTS = {\n show: 'mantine:show-notification',\n hide: 'mantine:hide-notification',\n update: 'mantine:update-notification',\n clean: 'mantine:clean-notifications',\n cleanQueue: 'mantine:clean-notifications-queue',\n} as const;\n\nexport function createEvent(type: ValueOf<typeof NOTIFICATIONS_EVENTS>, detail?: any) {\n return new CustomEvent(type, { detail });\n}\n\nexport function showNotification(notification: NotificationProps) {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.show, notification));\n}\n\nexport function updateNotification(notification: NotificationProps & { id: string }) {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.update, notification));\n}\n\nexport function hideNotification(id: string) {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.hide, id));\n}\n\nexport function cleanNotifications() {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.clean));\n}\n\nexport function cleanNotificationsQueue() {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.cleanQueue));\n}\n\nexport function useNotificationsEvents(ctx: NotificationsContextProps) {\n const events = {\n show: (event: any) => ctx.showNotification(event.detail),\n hide: (event: any) => ctx.hideNotification(event.detail),\n update: (event: any) => ctx.updateNotification(event.detail.id, event.detail),\n clean: ctx.clean,\n cleanQueue: ctx.cleanQueue,\n };\n\n useEffect(() => {\n Object.keys(events).forEach((event) => {\n window.addEventListener(NOTIFICATIONS_EVENTS[event], events[event]);\n });\n\n return () => {\n Object.keys(events).forEach((event) => {\n window.removeEventListener(NOTIFICATIONS_EVENTS[event], events[event]);\n });\n };\n }, []);\n}\n"],"names":["useEffect"],"mappings":";;;;;;AACY,MAAC,oBAAoB,GAAG;AACpC,EAAE,IAAI,EAAE,2BAA2B;AACnC,EAAE,IAAI,EAAE,2BAA2B;AACnC,EAAE,MAAM,EAAE,6BAA6B;AACvC,EAAE,KAAK,EAAE,6BAA6B;AACtC,EAAE,UAAU,EAAE,mCAAmC;AACjD,EAAE;AACK,SAAS,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE;AAC1C,EAAE,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAC3C,CAAC;AACM,SAAS,gBAAgB,CAAC,YAAY,EAAE;AAC/C,EAAE,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;AAC7E,CAAC;AACM,SAAS,kBAAkB,CAAC,YAAY,EAAE;AACjD,EAAE,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAC/E,CAAC;AACM,SAAS,gBAAgB,CAAC,EAAE,EAAE;AACrC,EAAE,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AACnE,CAAC;AACM,SAAS,kBAAkB,GAAG;AACrC,EAAE,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;AAChE,CAAC;AACM,SAAS,uBAAuB,GAAG;AAC1C,EAAE,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC;AACrE,CAAC;AACM,SAAS,sBAAsB,CAAC,GAAG,EAAE;AAC5C,EAAE,MAAM,MAAM,GAAG;AACjB,IAAI,IAAI,EAAE,CAAC,KAAK,KAAK,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC;AACvD,IAAI,IAAI,EAAE,CAAC,KAAK,KAAK,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC;AACvD,IAAI,MAAM,EAAE,CAAC,KAAK,KAAK,GAAG,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC;AAC5E,IAAI,KAAK,EAAE,GAAG,CAAC,KAAK;AACpB,IAAI,UAAU,EAAE,GAAG,CAAC,UAAU;AAC9B,GAAG,CAAC;AACJ,EAAEA,eAAS,CAAC,MAAM;AAClB,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK;AAC3C,MAAM,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1E,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,MAAM;AACjB,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK;AAC7C,QAAQ,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/E,OAAO,CAAC,CAAC;AACT,KAAK,CAAC;AACN,GAAG,EAAE,EAAE,CAAC,CAAC;AACT;;;;;;;;;;;"}
|
package/esm/events.js
CHANGED
|
@@ -31,7 +31,7 @@ function useNotificationsEvents(ctx) {
|
|
|
31
31
|
hide: (event) => ctx.hideNotification(event.detail),
|
|
32
32
|
update: (event) => ctx.updateNotification(event.detail.id, event.detail),
|
|
33
33
|
clean: ctx.clean,
|
|
34
|
-
|
|
34
|
+
cleanQueue: ctx.cleanQueue
|
|
35
35
|
};
|
|
36
36
|
useEffect(() => {
|
|
37
37
|
Object.keys(events).forEach((event) => {
|
package/esm/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sources":["../src/events.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport type { NotificationProps, NotificationsContextProps } from './types';\n\ntype ValueOf<T> = T[keyof T];\n\nexport const NOTIFICATIONS_EVENTS = {\n show: 'mantine:show-notification',\n hide: 'mantine:hide-notification',\n update: 'mantine:update-notification',\n clean: 'mantine:clean-notifications',\n cleanQueue: 'mantine:clean-notifications-queue',\n} as const;\n\nexport function createEvent(type: ValueOf<typeof NOTIFICATIONS_EVENTS>, detail?: any) {\n return new CustomEvent(type, { detail });\n}\n\nexport function showNotification(notification: NotificationProps) {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.show, notification));\n}\n\nexport function updateNotification(notification: NotificationProps & { id: string }) {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.update, notification));\n}\n\nexport function hideNotification(id: string) {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.hide, id));\n}\n\nexport function cleanNotifications() {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.clean));\n}\n\nexport function cleanNotificationsQueue() {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.cleanQueue));\n}\n\nexport function useNotificationsEvents(ctx: NotificationsContextProps) {\n const events = {\n show: (event: any) => ctx.showNotification(event.detail),\n hide: (event: any) => ctx.hideNotification(event.detail),\n update: (event: any) => ctx.updateNotification(event.detail.id, event.detail),\n clean: ctx.clean,\n
|
|
1
|
+
{"version":3,"file":"events.js","sources":["../src/events.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport type { NotificationProps, NotificationsContextProps } from './types';\n\ntype ValueOf<T> = T[keyof T];\n\nexport const NOTIFICATIONS_EVENTS = {\n show: 'mantine:show-notification',\n hide: 'mantine:hide-notification',\n update: 'mantine:update-notification',\n clean: 'mantine:clean-notifications',\n cleanQueue: 'mantine:clean-notifications-queue',\n} as const;\n\nexport function createEvent(type: ValueOf<typeof NOTIFICATIONS_EVENTS>, detail?: any) {\n return new CustomEvent(type, { detail });\n}\n\nexport function showNotification(notification: NotificationProps) {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.show, notification));\n}\n\nexport function updateNotification(notification: NotificationProps & { id: string }) {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.update, notification));\n}\n\nexport function hideNotification(id: string) {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.hide, id));\n}\n\nexport function cleanNotifications() {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.clean));\n}\n\nexport function cleanNotificationsQueue() {\n window.dispatchEvent(createEvent(NOTIFICATIONS_EVENTS.cleanQueue));\n}\n\nexport function useNotificationsEvents(ctx: NotificationsContextProps) {\n const events = {\n show: (event: any) => ctx.showNotification(event.detail),\n hide: (event: any) => ctx.hideNotification(event.detail),\n update: (event: any) => ctx.updateNotification(event.detail.id, event.detail),\n clean: ctx.clean,\n cleanQueue: ctx.cleanQueue,\n };\n\n useEffect(() => {\n Object.keys(events).forEach((event) => {\n window.addEventListener(NOTIFICATIONS_EVENTS[event], events[event]);\n });\n\n return () => {\n Object.keys(events).forEach((event) => {\n window.removeEventListener(NOTIFICATIONS_EVENTS[event], events[event]);\n });\n };\n }, []);\n}\n"],"names":[],"mappings":";;AACY,MAAC,oBAAoB,GAAG;AACpC,EAAE,IAAI,EAAE,2BAA2B;AACnC,EAAE,IAAI,EAAE,2BAA2B;AACnC,EAAE,MAAM,EAAE,6BAA6B;AACvC,EAAE,KAAK,EAAE,6BAA6B;AACtC,EAAE,UAAU,EAAE,mCAAmC;AACjD,EAAE;AACK,SAAS,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE;AAC1C,EAAE,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAC3C,CAAC;AACM,SAAS,gBAAgB,CAAC,YAAY,EAAE;AAC/C,EAAE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AAC,KAAK,KAAK;AAC3C,MAAM,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1E,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,MAAM;AACjB,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK;AAC7C,QAAQ,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/E,OAAO,CAAC,CAAC;AACT,KAAK,CAAC;AACN,GAAG,EAAE,EAAE,CAAC,CAAC;AACT;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/notifications",
|
|
3
3
|
"description": "Notification system based on Mantine components",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.1",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"notification-system"
|
|
29
29
|
],
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@mantine/core": "4.1.
|
|
32
|
-
"@mantine/hooks": "4.1.
|
|
31
|
+
"@mantine/core": "4.1.1",
|
|
32
|
+
"@mantine/hooks": "4.1.1",
|
|
33
33
|
"react": ">=16.8.0",
|
|
34
34
|
"react-dom": ">=16.8.0"
|
|
35
35
|
},
|