@tnf-dev/react 1.0.1-15 → 1.0.1-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/README.md +4 -3
- package/dist/cjs/components/icons/archive-box-icon.cjs +50 -1
- package/dist/cjs/components/icons/archive-box-icon.cjs.map +1 -0
- package/dist/cjs/components/icons/bell-icon.cjs +50 -1
- package/dist/cjs/components/icons/bell-icon.cjs.map +1 -0
- package/dist/cjs/components/icons/check-circle-icon.cjs +50 -1
- package/dist/cjs/components/icons/check-circle-icon.cjs.map +1 -0
- package/dist/cjs/components/icons/index.cjs +112 -1
- package/dist/cjs/components/icons/index.cjs.map +1 -0
- package/dist/cjs/components/inbox/bell.cjs +4714 -12
- package/dist/cjs/components/inbox/bell.cjs.map +1 -0
- package/dist/cjs/components/inbox/button.cjs +4654 -12
- package/dist/cjs/components/inbox/button.cjs.map +1 -0
- package/dist/cjs/components/inbox/empty.cjs +4635 -12
- package/dist/cjs/components/inbox/empty.cjs.map +1 -0
- package/dist/cjs/components/inbox/inbox.cjs +5291 -12
- package/dist/cjs/components/inbox/inbox.cjs.map +1 -0
- package/dist/cjs/components/inbox/inbox.d.cts +8 -10
- package/dist/cjs/components/inbox/index.cjs +5309 -12
- package/dist/cjs/components/inbox/index.cjs.map +1 -0
- package/dist/cjs/components/inbox/index.d.cts +1 -2
- package/dist/cjs/components/inbox/loader.cjs +4629 -12
- package/dist/cjs/components/inbox/loader.cjs.map +1 -0
- package/dist/cjs/components/inbox/notification-header.cjs +4649 -12
- package/dist/cjs/components/inbox/notification-header.cjs.map +1 -0
- package/dist/cjs/components/inbox/notification-item/actions.cjs +4738 -12
- package/dist/cjs/components/inbox/notification-item/actions.cjs.map +1 -0
- package/dist/cjs/components/inbox/notification-item/index.cjs +4865 -12
- package/dist/cjs/components/inbox/notification-item/index.cjs.map +1 -0
- package/dist/cjs/components/inbox/popover.cjs +4711 -12
- package/dist/cjs/components/inbox/popover.cjs.map +1 -0
- package/dist/cjs/components/index.cjs +5309 -12
- package/dist/cjs/components/index.cjs.map +1 -0
- package/dist/cjs/components/index.d.cts +1 -2
- package/dist/cjs/contexts/StyleProvider.cjs +4645 -12
- package/dist/cjs/contexts/StyleProvider.cjs.map +1 -0
- package/dist/cjs/contexts/TeknifyProvider.cjs +4674 -12
- package/dist/cjs/contexts/TeknifyProvider.cjs.map +1 -0
- package/dist/cjs/contexts/TeknifyProvider.d.cts +0 -6
- package/dist/cjs/contexts/index.cjs +4677 -12
- package/dist/cjs/contexts/index.cjs.map +1 -0
- package/dist/cjs/contexts/index.d.cts +0 -1
- package/dist/cjs/dto/index.cjs +19 -1
- package/dist/cjs/dto/index.cjs.map +1 -0
- package/dist/cjs/dto/notifications/index.cjs +19 -1
- package/dist/cjs/dto/notifications/index.cjs.map +1 -0
- package/dist/cjs/dto/notifications/notification.interface.cjs +19 -1
- package/dist/cjs/dto/notifications/notification.interface.cjs.map +1 -0
- package/dist/cjs/hooks/index.cjs +145 -1
- package/dist/cjs/hooks/index.cjs.map +1 -0
- package/dist/cjs/hooks/useNotifications.cjs +143 -1
- package/dist/cjs/hooks/useNotifications.cjs.map +1 -0
- package/dist/cjs/index.cjs +5362 -12
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +1 -3
- package/dist/cjs/utils/const.cjs +31 -1
- package/dist/cjs/utils/const.cjs.map +1 -0
- package/dist/cjs/utils/index.cjs +33 -1
- package/dist/cjs/utils/index.cjs.map +1 -0
- package/dist/esm/chunk-57PGXW3M.js +2 -0
- package/dist/esm/chunk-57PGXW3M.js.map +1 -0
- package/dist/esm/chunk-5ZHARJ3G.js +4446 -0
- package/dist/esm/chunk-5ZHARJ3G.js.map +1 -0
- package/dist/esm/chunk-6FGP2HJW.js +9 -0
- package/dist/esm/chunk-6FGP2HJW.js.map +1 -0
- package/dist/esm/chunk-ATNNGNAM.js +2 -0
- package/dist/esm/chunk-ATNNGNAM.js.map +1 -0
- package/dist/esm/chunk-B5I3IFK2.js +113 -0
- package/dist/esm/chunk-B5I3IFK2.js.map +1 -0
- package/dist/esm/chunk-DC2MKTMP.js +2 -0
- package/dist/esm/chunk-DC2MKTMP.js.map +1 -0
- package/dist/esm/chunk-EBHNXTGY.js +2 -0
- package/dist/esm/chunk-EBHNXTGY.js.map +1 -0
- package/dist/esm/chunk-ET4RPLX7.js +32 -0
- package/dist/esm/chunk-ET4RPLX7.js.map +1 -0
- package/dist/esm/chunk-H3IWAKC5.js +34 -0
- package/dist/esm/chunk-H3IWAKC5.js.map +1 -0
- package/dist/esm/chunk-H3RCKWE3.js +2 -0
- package/dist/esm/chunk-H3RCKWE3.js.map +1 -0
- package/dist/esm/chunk-HDKTD2IK.js +49 -0
- package/dist/esm/chunk-HDKTD2IK.js.map +1 -0
- package/dist/esm/chunk-IXQPSHNR.js +32 -0
- package/dist/esm/chunk-IXQPSHNR.js.map +1 -0
- package/dist/esm/chunk-MNBHQJKW.js +2 -0
- package/dist/esm/chunk-MNBHQJKW.js.map +1 -0
- package/dist/esm/chunk-NDUFFQA7.js +24 -0
- package/dist/esm/chunk-NDUFFQA7.js.map +1 -0
- package/dist/esm/chunk-NQ3CC7OA.js +84 -0
- package/dist/esm/chunk-NQ3CC7OA.js.map +1 -0
- package/dist/esm/chunk-QILM4R2Q.js +54 -0
- package/dist/esm/chunk-QILM4R2Q.js.map +1 -0
- package/dist/esm/chunk-RCHW4I55.js +2 -0
- package/dist/esm/chunk-RCHW4I55.js.map +1 -0
- package/dist/esm/chunk-RLFVKZHT.js +30 -0
- package/dist/esm/chunk-RLFVKZHT.js.map +1 -0
- package/dist/esm/chunk-S6WUE45S.js +32 -0
- package/dist/esm/chunk-S6WUE45S.js.map +1 -0
- package/dist/esm/chunk-SSLZWOID.js +97 -0
- package/dist/esm/chunk-SSLZWOID.js.map +1 -0
- package/dist/esm/chunk-VWQT7XSQ.js +2 -0
- package/dist/esm/chunk-VWQT7XSQ.js.map +1 -0
- package/dist/esm/chunk-WN4NSHNE.js +32 -0
- package/dist/esm/chunk-WN4NSHNE.js.map +1 -0
- package/dist/esm/chunk-XVCHU66N.js +40 -0
- package/dist/esm/chunk-XVCHU66N.js.map +1 -0
- package/dist/esm/chunk-YKV4YNJ4.js +44 -0
- package/dist/esm/chunk-YKV4YNJ4.js.map +1 -0
- package/dist/esm/chunk-YY3MZBYQ.js +2 -0
- package/dist/esm/chunk-YY3MZBYQ.js.map +1 -0
- package/dist/esm/chunk-Z4Q2SGNX.js +144 -0
- package/dist/esm/chunk-Z4Q2SGNX.js.map +1 -0
- package/dist/esm/chunk-ZBV5DZZB.js +104 -0
- package/dist/esm/chunk-ZBV5DZZB.js.map +1 -0
- package/dist/esm/components/icons/archive-box-icon.js +8 -1
- package/dist/esm/components/icons/archive-box-icon.js.map +1 -0
- package/dist/esm/components/icons/bell-icon.js +8 -1
- package/dist/esm/components/icons/bell-icon.js.map +1 -0
- package/dist/esm/components/icons/check-circle-icon.js +8 -1
- package/dist/esm/components/icons/check-circle-icon.js.map +1 -0
- package/dist/esm/components/icons/index.js +17 -1
- package/dist/esm/components/icons/index.js.map +1 -0
- package/dist/esm/components/inbox/bell.js +15 -29
- package/dist/esm/components/inbox/bell.js.map +1 -0
- package/dist/esm/components/inbox/button.js +11 -29
- package/dist/esm/components/inbox/button.js.map +1 -0
- package/dist/esm/components/inbox/empty.js +11 -29
- package/dist/esm/components/inbox/empty.js.map +1 -0
- package/dist/esm/components/inbox/inbox.d.ts +8 -10
- package/dist/esm/components/inbox/inbox.js +28 -29
- package/dist/esm/components/inbox/inbox.js.map +1 -0
- package/dist/esm/components/inbox/index.d.ts +1 -2
- package/dist/esm/components/inbox/index.js +50 -29
- package/dist/esm/components/inbox/index.js.map +1 -0
- package/dist/esm/components/inbox/loader.js +9 -29
- package/dist/esm/components/inbox/loader.js.map +1 -0
- package/dist/esm/components/inbox/notification-header.js +11 -29
- package/dist/esm/components/inbox/notification-header.js.map +1 -0
- package/dist/esm/components/inbox/notification-item/actions.js +16 -29
- package/dist/esm/components/inbox/notification-item/actions.js.map +1 -0
- package/dist/esm/components/inbox/notification-item/index.js +17 -29
- package/dist/esm/components/inbox/notification-item/index.js.map +1 -0
- package/dist/esm/components/inbox/popover.js +11 -29
- package/dist/esm/components/inbox/popover.js.map +1 -0
- package/dist/esm/components/index.d.ts +1 -2
- package/dist/esm/components/index.js +51 -29
- package/dist/esm/components/index.js.map +1 -0
- package/dist/esm/contexts/StyleProvider.js +9 -29
- package/dist/esm/contexts/StyleProvider.js.map +1 -0
- package/dist/esm/contexts/TeknifyProvider.d.ts +0 -6
- package/dist/esm/contexts/TeknifyProvider.js +12 -29
- package/dist/esm/contexts/TeknifyProvider.js.map +1 -0
- package/dist/esm/contexts/index.d.ts +0 -1
- package/dist/esm/contexts/index.js +13 -29
- package/dist/esm/contexts/index.js.map +1 -0
- package/dist/esm/dto/index.js +4 -0
- package/dist/esm/dto/index.js.map +1 -0
- package/dist/esm/dto/notifications/index.js +3 -0
- package/dist/esm/dto/notifications/index.js.map +1 -0
- package/dist/esm/dto/notifications/notification.interface.js +2 -0
- package/dist/esm/dto/notifications/notification.interface.js.map +1 -0
- package/dist/esm/hooks/index.js +13 -1
- package/dist/esm/hooks/index.js.map +1 -0
- package/dist/esm/hooks/useNotifications.js +12 -1
- package/dist/esm/hooks/useNotifications.js.map +1 -0
- package/dist/esm/index.d.ts +1 -3
- package/dist/esm/index.js +62 -29
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/utils/const.js +8 -1
- package/dist/esm/utils/const.js.map +1 -0
- package/dist/esm/utils/index.js +9 -1
- package/dist/esm/utils/index.js.map +1 -0
- package/package.json +5 -4
- package/dist/cjs/components/inbox/error.cjs +0 -51
- package/dist/cjs/components/inbox/error.d.cts +0 -8
- package/dist/cjs/locale/default.cjs +0 -2
- package/dist/cjs/locale/default.d.cts +0 -5
- package/dist/cjs/locale/index.cjs +0 -2
- package/dist/cjs/locale/index.d.cts +0 -2
- package/dist/cjs/types/index.cjs +0 -2
- package/dist/cjs/types/index.d.cts +0 -1
- package/dist/cjs/types/locale.cjs +0 -2
- package/dist/cjs/types/locale.d.cts +0 -18
- package/dist/esm/components/inbox/error.d.ts +0 -8
- package/dist/esm/components/inbox/error.js +0 -30
- package/dist/esm/locale/default.d.ts +0 -5
- package/dist/esm/locale/default.js +0 -2
- package/dist/esm/locale/index.d.ts +0 -2
- package/dist/esm/locale/index.js +0 -2
- package/dist/esm/types/index.d.ts +0 -1
- package/dist/esm/types/index.js +0 -1
- package/dist/esm/types/locale.d.ts +0 -18
- package/dist/esm/types/locale.js +0 -1
package/dist/cjs/dto/index.cjs
CHANGED
@@ -1,2 +1,20 @@
|
|
1
1
|
"use client"
|
2
|
-
"use strict";
|
2
|
+
"use strict";
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
9
|
+
for (let key of __getOwnPropNames(from))
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
|
+
}
|
13
|
+
return to;
|
14
|
+
};
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
16
|
+
|
17
|
+
// src/dto/index.ts
|
18
|
+
var dto_exports = {};
|
19
|
+
module.exports = __toCommonJS(dto_exports);
|
20
|
+
//# sourceMappingURL=index.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/dto/index.ts"],"sourcesContent":["export * from './notifications';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
@@ -1,2 +1,20 @@
|
|
1
1
|
"use client"
|
2
|
-
"use strict";
|
2
|
+
"use strict";
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
9
|
+
for (let key of __getOwnPropNames(from))
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
|
+
}
|
13
|
+
return to;
|
14
|
+
};
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
16
|
+
|
17
|
+
// src/dto/notifications/index.ts
|
18
|
+
var notifications_exports = {};
|
19
|
+
module.exports = __toCommonJS(notifications_exports);
|
20
|
+
//# sourceMappingURL=index.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/dto/notifications/index.ts"],"sourcesContent":["export * from './notification.interface';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
@@ -1,2 +1,20 @@
|
|
1
1
|
"use client"
|
2
|
-
"use strict";
|
2
|
+
"use strict";
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
9
|
+
for (let key of __getOwnPropNames(from))
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
|
+
}
|
13
|
+
return to;
|
14
|
+
};
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
16
|
+
|
17
|
+
// src/dto/notifications/notification.interface.ts
|
18
|
+
var notification_interface_exports = {};
|
19
|
+
module.exports = __toCommonJS(notification_interface_exports);
|
20
|
+
//# sourceMappingURL=notification.interface.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/dto/notifications/notification.interface.ts"],"sourcesContent":["import { Notification as BaseNotification } from '@tnf-dev/core';\n\nexport interface Notification extends BaseNotification {\n markAsRead: () => Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/cjs/hooks/index.cjs
CHANGED
@@ -1,2 +1,146 @@
|
|
1
1
|
"use client"
|
2
|
-
"use strict";
|
2
|
+
"use strict";
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
20
|
+
|
21
|
+
// src/hooks/index.ts
|
22
|
+
var hooks_exports = {};
|
23
|
+
__export(hooks_exports, {
|
24
|
+
useNotifications: () => useNotifications
|
25
|
+
});
|
26
|
+
module.exports = __toCommonJS(hooks_exports);
|
27
|
+
|
28
|
+
// src/hooks/useNotifications.ts
|
29
|
+
var import_react2 = require("react");
|
30
|
+
|
31
|
+
// src/contexts/TeknifyProvider.tsx
|
32
|
+
var import_js = require("@tnf-dev/js");
|
33
|
+
var import_react = require("react");
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
35
|
+
var TeknifyContext = (0, import_react.createContext)({
|
36
|
+
applicationId: "",
|
37
|
+
subscriberId: ""
|
38
|
+
});
|
39
|
+
|
40
|
+
// src/hooks/useNotifications.ts
|
41
|
+
var useNotifications = () => {
|
42
|
+
const { client } = (0, import_react2.useContext)(TeknifyContext);
|
43
|
+
const [notifications, setNotifications] = (0, import_react2.useState)([]);
|
44
|
+
const [isError, setIsError] = (0, import_react2.useState)(false);
|
45
|
+
const [error, setError] = (0, import_react2.useState)(null);
|
46
|
+
const [isLoading, setIsLoading] = (0, import_react2.useState)(false);
|
47
|
+
const [isFirstLoad, setIsFirstLoad] = (0, import_react2.useState)(true);
|
48
|
+
const [hasMore, setHasMore] = (0, import_react2.useState)(true);
|
49
|
+
const [nextCursor, setNextCursor] = (0, import_react2.useState)();
|
50
|
+
const [unread, setUnread] = (0, import_react2.useState)(0);
|
51
|
+
const handleMarkAsRead = (0, import_react2.useCallback)(async (id) => {
|
52
|
+
try {
|
53
|
+
await client.notification.markAsRead(id);
|
54
|
+
setNotifications((prev) => {
|
55
|
+
return prev.map((notification) => {
|
56
|
+
if (notification._id === id) {
|
57
|
+
return {
|
58
|
+
...notification,
|
59
|
+
isRead: true
|
60
|
+
};
|
61
|
+
}
|
62
|
+
return notification;
|
63
|
+
});
|
64
|
+
});
|
65
|
+
} catch (error2) {
|
66
|
+
}
|
67
|
+
}, []);
|
68
|
+
const fetchNotifications = (0, import_react2.useCallback)(async () => {
|
69
|
+
if (isLoading) return;
|
70
|
+
try {
|
71
|
+
setIsLoading(true);
|
72
|
+
const res = await client.notification.getNotifications({
|
73
|
+
...nextCursor ? { cursor: nextCursor } : {}
|
74
|
+
});
|
75
|
+
setNotifications((prev) => {
|
76
|
+
return [
|
77
|
+
...prev,
|
78
|
+
...res.data.filter((notification) => !prev.find((n) => n._id === notification._id)).map((notification) => ({
|
79
|
+
...notification,
|
80
|
+
markAsRead: () => handleMarkAsRead(notification._id)
|
81
|
+
}))
|
82
|
+
];
|
83
|
+
});
|
84
|
+
setHasMore(!!res.pagination.continueCursor);
|
85
|
+
setNextCursor(res.pagination.continueCursor);
|
86
|
+
setUnread(res.unread);
|
87
|
+
} catch (error2) {
|
88
|
+
setIsError(true);
|
89
|
+
if (error2 instanceof Error) {
|
90
|
+
setError(error2);
|
91
|
+
} else {
|
92
|
+
setError(new Error("Unknown error"));
|
93
|
+
}
|
94
|
+
} finally {
|
95
|
+
setIsLoading(false);
|
96
|
+
setIsFirstLoad(false);
|
97
|
+
}
|
98
|
+
}, [isLoading, nextCursor, handleMarkAsRead]);
|
99
|
+
(0, import_react2.useEffect)(() => {
|
100
|
+
fetchNotifications();
|
101
|
+
}, []);
|
102
|
+
(0, import_react2.useEffect)(() => {
|
103
|
+
const handler = (notifications2) => {
|
104
|
+
setNotifications((prev) => {
|
105
|
+
return [
|
106
|
+
...notifications2.filter((notification) => {
|
107
|
+
const foundIndex = prev.findIndex((n) => n._id === notification._id);
|
108
|
+
if (foundIndex) {
|
109
|
+
prev[foundIndex] = {
|
110
|
+
...notification,
|
111
|
+
markAsRead: () => handleMarkAsRead(notification._id)
|
112
|
+
};
|
113
|
+
}
|
114
|
+
return foundIndex === -1;
|
115
|
+
}).map((notification) => ({
|
116
|
+
...notification,
|
117
|
+
markAsRead: () => handleMarkAsRead(notification._id)
|
118
|
+
})),
|
119
|
+
...prev
|
120
|
+
];
|
121
|
+
});
|
122
|
+
};
|
123
|
+
client.notification.on(handler);
|
124
|
+
return () => {
|
125
|
+
client.notification.off(handler);
|
126
|
+
};
|
127
|
+
}, [handleMarkAsRead]);
|
128
|
+
const fetchMore = (0, import_react2.useCallback)(() => {
|
129
|
+
fetchNotifications();
|
130
|
+
}, [fetchNotifications]);
|
131
|
+
return {
|
132
|
+
notifications,
|
133
|
+
isLoading,
|
134
|
+
isFirstLoad,
|
135
|
+
isError,
|
136
|
+
error,
|
137
|
+
hasMore,
|
138
|
+
unread,
|
139
|
+
fetchMore
|
140
|
+
};
|
141
|
+
};
|
142
|
+
// Annotate the CommonJS export names for ESM import in node:
|
143
|
+
0 && (module.exports = {
|
144
|
+
useNotifications
|
145
|
+
});
|
146
|
+
//# sourceMappingURL=index.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/index.ts","../../../src/hooks/useNotifications.ts","../../../src/contexts/TeknifyProvider.tsx"],"sourcesContent":["export * from './useNotifications';\n","import { useCallback, useContext, useEffect, useState } from 'react';\nimport { TeknifyContext } from '../contexts';\nimport { Notification } from '../dto';\n\nexport const useNotifications = () => {\n const { client } = useContext(TeknifyContext);\n const [notifications, setNotifications] = useState<Notification[]>([]);\n const [isError, setIsError] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n const [isFirstLoad, setIsFirstLoad] = useState(true);\n const [hasMore, setHasMore] = useState(true);\n const [nextCursor, setNextCursor] = useState<string | undefined>();\n const [unread, setUnread] = useState(0);\n\n const handleMarkAsRead = useCallback(async (id: string) => {\n try {\n await client.notification.markAsRead(id);\n setNotifications((prev) => {\n return prev.map((notification) => {\n if (notification._id === id) {\n return {\n ...notification,\n isRead: true,\n };\n }\n return notification;\n });\n });\n } catch (error) {}\n }, []);\n\n const fetchNotifications = useCallback(async () => {\n if (isLoading) return;\n try {\n setIsLoading(true);\n const res = await client.notification.getNotifications({\n ...(nextCursor ? { cursor: nextCursor } : {}),\n });\n\n setNotifications((prev) => {\n return [\n ...prev,\n ...res.data\n .filter((notification) => !prev.find((n) => n._id === notification._id))\n .map((notification) => ({\n ...notification,\n markAsRead: () => handleMarkAsRead(notification._id),\n })),\n ];\n });\n setHasMore(!!res.pagination.continueCursor);\n setNextCursor(res.pagination.continueCursor);\n setUnread(res.unread);\n } catch (error) {\n setIsError(true);\n if (error instanceof Error) {\n setError(error);\n } else {\n setError(new Error('Unknown error'));\n }\n } finally {\n setIsLoading(false);\n setIsFirstLoad(false);\n }\n }, [isLoading, nextCursor, handleMarkAsRead]);\n\n useEffect(() => {\n fetchNotifications();\n }, []);\n\n useEffect(() => {\n const handler = (notifications: Array<Omit<Notification, 'markAsRead'>>) => {\n setNotifications((prev) => {\n return [\n ...notifications\n .filter((notification) => {\n const foundIndex = prev.findIndex((n) => n._id === notification._id);\n if (foundIndex) {\n prev[foundIndex] = {\n ...notification,\n markAsRead: () => handleMarkAsRead(notification._id),\n };\n }\n return foundIndex === -1;\n })\n .map((notification) => ({\n ...notification,\n markAsRead: () => handleMarkAsRead(notification._id),\n })),\n ...prev,\n ];\n });\n };\n client.notification.on(handler);\n return () => {\n client.notification.off(handler);\n };\n }, [handleMarkAsRead]);\n\n const fetchMore = useCallback(() => {\n fetchNotifications();\n }, [fetchNotifications]);\n\n return {\n notifications,\n isLoading,\n isFirstLoad,\n isError,\n error,\n hasMore,\n unread,\n fetchMore,\n };\n};\n","import { TeknifyClient } from '@tnf-dev/js';\nimport { createContext, FC, PropsWithChildren, useMemo } from 'react';\nimport StyleProvider from './StyleProvider';\ninterface NotekProviderProps extends PropsWithChildren {\n applicationId: string;\n subscriberId: string;\n}\n\ninterface NotekContextValues {\n applicationId: string;\n subscriberId: string;\n client: TeknifyClient;\n}\n\nexport const TeknifyContext = createContext<NotekContextValues>({\n applicationId: '',\n subscriberId: '',\n} as any);\n\nconst NotekProvider: FC<NotekProviderProps> = ({ applicationId, subscriberId, children, ...props }) => {\n const values: NotekContextValues = useMemo(\n () => ({\n applicationId,\n subscriberId,\n client: new TeknifyClient({\n applicationId,\n subscriberId,\n }),\n }),\n [applicationId, subscriberId],\n );\n\n return (\n <TeknifyContext.Provider value={values}>\n <StyleProvider>{children}</StyleProv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AM,iBAAiB,aAAa,GAAG;AAAA,UACrD,EAAE;AAAA,UACJ,GAAG;AAAA,QACL;AAAA,MACF,CAAC;AAAA,IACH;AACA,WAAO,aAAa,GAAG,OAAO;AAC9B,WAAO,MAAM;AACX,aAAO,aAAa,IAAI,OAAO;AAAA,IACjC;AAAA,EACF,GAAG,CAAC,gBAAgB,CAAC;AAErB,QAAM,gBAAY,2BAAY,MAAM;AAClC,uBAAmB;AAAA,EACrB,GAAG,CAAC,kBAAkB,CAAC;AAEvB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["import_react","error","notifications"]}
|
@@ -1,2 +1,144 @@
|
|
1
1
|
"use client"
|
2
|
-
"use strict";
|
2
|
+
"use strict";
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
20
|
+
|
21
|
+
// src/hooks/useNotifications.ts
|
22
|
+
var useNotifications_exports = {};
|
23
|
+
__export(useNotifications_exports, {
|
24
|
+
useNotifications: () => useNotifications
|
25
|
+
});
|
26
|
+
module.exports = __toCommonJS(useNotifications_exports);
|
27
|
+
var import_react2 = require("react");
|
28
|
+
|
29
|
+
// src/contexts/TeknifyProvider.tsx
|
30
|
+
var import_js = require("@tnf-dev/js");
|
31
|
+
var import_react = require("react");
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
33
|
+
var TeknifyContext = (0, import_react.createContext)({
|
34
|
+
applicationId: "",
|
35
|
+
subscriberId: ""
|
36
|
+
});
|
37
|
+
|
38
|
+
// src/hooks/useNotifications.ts
|
39
|
+
var useNotifications = () => {
|
40
|
+
const { client } = (0, import_react2.useContext)(TeknifyContext);
|
41
|
+
const [notifications, setNotifications] = (0, import_react2.useState)([]);
|
42
|
+
const [isError, setIsError] = (0, import_react2.useState)(false);
|
43
|
+
const [error, setError] = (0, import_react2.useState)(null);
|
44
|
+
const [isLoading, setIsLoading] = (0, import_react2.useState)(false);
|
45
|
+
const [isFirstLoad, setIsFirstLoad] = (0, import_react2.useState)(true);
|
46
|
+
const [hasMore, setHasMore] = (0, import_react2.useState)(true);
|
47
|
+
const [nextCursor, setNextCursor] = (0, import_react2.useState)();
|
48
|
+
const [unread, setUnread] = (0, import_react2.useState)(0);
|
49
|
+
const handleMarkAsRead = (0, import_react2.useCallback)(async (id) => {
|
50
|
+
try {
|
51
|
+
await client.notification.markAsRead(id);
|
52
|
+
setNotifications((prev) => {
|
53
|
+
return prev.map((notification) => {
|
54
|
+
if (notification._id === id) {
|
55
|
+
return {
|
56
|
+
...notification,
|
57
|
+
isRead: true
|
58
|
+
};
|
59
|
+
}
|
60
|
+
return notification;
|
61
|
+
});
|
62
|
+
});
|
63
|
+
} catch (error2) {
|
64
|
+
}
|
65
|
+
}, []);
|
66
|
+
const fetchNotifications = (0, import_react2.useCallback)(async () => {
|
67
|
+
if (isLoading) return;
|
68
|
+
try {
|
69
|
+
setIsLoading(true);
|
70
|
+
const res = await client.notification.getNotifications({
|
71
|
+
...nextCursor ? { cursor: nextCursor } : {}
|
72
|
+
});
|
73
|
+
setNotifications((prev) => {
|
74
|
+
return [
|
75
|
+
...prev,
|
76
|
+
...res.data.filter((notification) => !prev.find((n) => n._id === notification._id)).map((notification) => ({
|
77
|
+
...notification,
|
78
|
+
markAsRead: () => handleMarkAsRead(notification._id)
|
79
|
+
}))
|
80
|
+
];
|
81
|
+
});
|
82
|
+
setHasMore(!!res.pagination.continueCursor);
|
83
|
+
setNextCursor(res.pagination.continueCursor);
|
84
|
+
setUnread(res.unread);
|
85
|
+
} catch (error2) {
|
86
|
+
setIsError(true);
|
87
|
+
if (error2 instanceof Error) {
|
88
|
+
setError(error2);
|
89
|
+
} else {
|
90
|
+
setError(new Error("Unknown error"));
|
91
|
+
}
|
92
|
+
} finally {
|
93
|
+
setIsLoading(false);
|
94
|
+
setIsFirstLoad(false);
|
95
|
+
}
|
96
|
+
}, [isLoading, nextCursor, handleMarkAsRead]);
|
97
|
+
(0, import_react2.useEffect)(() => {
|
98
|
+
fetchNotifications();
|
99
|
+
}, []);
|
100
|
+
(0, import_react2.useEffect)(() => {
|
101
|
+
const handler = (notifications2) => {
|
102
|
+
setNotifications((prev) => {
|
103
|
+
return [
|
104
|
+
...notifications2.filter((notification) => {
|
105
|
+
const foundIndex = prev.findIndex((n) => n._id === notification._id);
|
106
|
+
if (foundIndex) {
|
107
|
+
prev[foundIndex] = {
|
108
|
+
...notification,
|
109
|
+
markAsRead: () => handleMarkAsRead(notification._id)
|
110
|
+
};
|
111
|
+
}
|
112
|
+
return foundIndex === -1;
|
113
|
+
}).map((notification) => ({
|
114
|
+
...notification,
|
115
|
+
markAsRead: () => handleMarkAsRead(notification._id)
|
116
|
+
})),
|
117
|
+
...prev
|
118
|
+
];
|
119
|
+
});
|
120
|
+
};
|
121
|
+
client.notification.on(handler);
|
122
|
+
return () => {
|
123
|
+
client.notification.off(handler);
|
124
|
+
};
|
125
|
+
}, [handleMarkAsRead]);
|
126
|
+
const fetchMore = (0, import_react2.useCallback)(() => {
|
127
|
+
fetchNotifications();
|
128
|
+
}, [fetchNotifications]);
|
129
|
+
return {
|
130
|
+
notifications,
|
131
|
+
isLoading,
|
132
|
+
isFirstLoad,
|
133
|
+
isError,
|
134
|
+
error,
|
135
|
+
hasMore,
|
136
|
+
unread,
|
137
|
+
fetchMore
|
138
|
+
};
|
139
|
+
};
|
140
|
+
// Annotate the CommonJS export names for ESM import in node:
|
141
|
+
0 && (module.exports = {
|
142
|
+
useNotifications
|
143
|
+
});
|
144
|
+
//# sourceMappingURL=useNotifications.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/useNotifications.ts","../../../src/contexts/TeknifyProvider.tsx"],"sourcesContent":["import { useCallback, useContext, useEffect, useState } from 'react';\nimport { TeknifyContext } from '../contexts';\nimport { Notification } from '../dto';\n\nexport const useNotifications = () => {\n const { client } = useContext(TeknifyContext);\n const [notifications, setNotifications] = useState<Notification[]>([]);\n const [isError, setIsError] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n const [isFirstLoad, setIsFirstLoad] = useState(true);\n const [hasMore, setHasMore] = useState(true);\n const [nextCursor, setNextCursor] = useState<string | undefined>();\n const [unread, setUnread] = useState(0);\n\n const handleMarkAsRead = useCallback(async (id: string) => {\n try {\n await client.notification.markAsRead(id);\n setNotifications((prev) => {\n return prev.map((notification) => {\n if (notification._id === id) {\n return {\n ...notification,\n isRead: true,\n };\n }\n return notification;\n });\n });\n } catch (error) {}\n }, []);\n\n const fetchNotifications = useCallback(async () => {\n if (isLoading) return;\n try {\n setIsLoading(true);\n const res = await client.notification.getNotifications({\n ...(nextCursor ? { cursor: nextCursor } : {}),\n });\n\n setNotifications((prev) => {\n return [\n ...prev,\n ...res.data\n .filter((notification) => !prev.find((n) => n._id === notification._id))\n .map((notification) => ({\n ...notification,\n markAsRead: () => handleMarkAsRead(notification._id),\n })),\n ];\n });\n setHasMore(!!res.pagination.continueCursor);\n setNextCursor(res.pagination.continueCursor);\n setUnread(res.unread);\n } catch (error) {\n setIsError(true);\n if (error instanceof Error) {\n setError(error);\n } else {\n setError(new Error('Unknown error'));\n }\n } finally {\n setIsLoading(false);\n setIsFirstLoad(false);\n }\n }, [isLoading, nextCursor, handleMarkAsRead]);\n\n useEffect(() => {\n fetchNotifications();\n }, []);\n\n useEffect(() => {\n const handler = (notifications: Array<Omit<Notification, 'markAsRead'>>) => {\n setNotifications((prev) => {\n return [\n ...notifications\n .filter((notification) => {\n const foundIndex = prev.findIndex((n) => n._id === notification._id);\n if (foundIndex) {\n prev[foundIndex] = {\n ...notification,\n markAsRead: () => handleMarkAsRead(notification._id),\n };\n }\n return foundIndex === -1;\n })\n .map((notification) => ({\n ...notification,\n markAsRead: () => handleMarkAsRead(notification._id),\n })),\n ...prev,\n ];\n });\n };\n client.notification.on(handler);\n return () => {\n client.notification.off(handler);\n };\n }, [handleMarkAsRead]);\n\n const fetchMore = useCallback(() => {\n fetchNotifications();\n }, [fetchNotifications]);\n\n return {\n notifications,\n isLoading,\n isFirstLoad,\n isError,\n error,\n hasMore,\n unread,\n fetchMore,\n };\n};\n","import { TeknifyClient } from '@tnf-dev/js';\nimport { createContext, FC, PropsWithChildren, useMemo } from 'react';\nimport StyleProvider from './StyleProvider';\ninterface NotekProviderProps extends PropsWithChildren {\n applicationId: string;\n subscriberId: string;\n}\n\ninterface NotekContextValues {\n applicationId: string;\n subscriberId: string;\n client: TeknifyClient;\n}\n\nexport const TeknifyContext = createContext<NotekContextValues>({\n applicationId: '',\n subscriberId: '',\n} as any);\n\nconst NotekProvider: FC<NotekProviderProps> = ({ applicationId, subscriberId, children, ...props }) => {\n const values: NotekContextValues = useMemo(\n () => ({\n applicationId,\n subscriberId,\n client: new TeknifyClient({\n applicationId,\n subscriberId,\n }),\n }),\n [applicationId, subscriberId],\n );\n\n return (\n <TeknifyContext.Provider value={values}>\n <StyleProvider>{children}</StyleProvider>\n </TeknifyContext.Provider>\n );\n};\n\nexport default NotekProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;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