@novu/react 3.0.0 → 3.0.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/dist/cjs/hooks/NovuProvider.cjs +1 -1
- package/dist/esm/hooks/NovuProvider.js +1 -1
- package/package.json +2 -2
- package/dist/client/components/index.d.mts +0 -168
- package/dist/client/components/index.d.ts +0 -168
- package/dist/client/components/index.js +0 -853
- package/dist/client/components/index.js.map +0 -1
- package/dist/client/components/index.mjs +0 -805
- package/dist/client/components/index.mjs.map +0 -1
- package/dist/client/hooks/index.d.mts +0 -75
- package/dist/client/hooks/index.d.ts +0 -75
- package/dist/client/hooks/index.js +0 -395
- package/dist/client/hooks/index.js.map +0 -1
- package/dist/client/hooks/index.mjs +0 -364
- package/dist/client/hooks/index.mjs.map +0 -1
- package/dist/client/themes/index.d.mts +0 -1
- package/dist/client/themes/index.d.ts +0 -1
- package/dist/client/themes/index.js +0 -25
- package/dist/client/themes/index.js.map +0 -1
- package/dist/client/themes/index.mjs +0 -3
- package/dist/client/themes/index.mjs.map +0 -1
- package/dist/server/index.d.mts +0 -141
- package/dist/server/index.d.ts +0 -141
- package/dist/server/index.js +0 -415
- package/dist/server/index.js.map +0 -1
- package/dist/server/index.mjs +0 -379
- package/dist/server/index.mjs.map +0 -1
package/dist/server/index.mjs
DELETED
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
// src/hooks/NovuProvider.tsx
|
|
2
|
-
import { Novu } from "@novu/js";
|
|
3
|
-
import { createContext, useContext, useMemo } from "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
var version = "2.6.6";
|
|
6
|
-
var name = "@novu/react";
|
|
7
|
-
var baseUserAgent = `${name}@${version}`;
|
|
8
|
-
var NovuContext = createContext(void 0);
|
|
9
|
-
var NovuProvider = ({
|
|
10
|
-
children,
|
|
11
|
-
applicationIdentifier,
|
|
12
|
-
subscriberId,
|
|
13
|
-
subscriberHash,
|
|
14
|
-
backendUrl,
|
|
15
|
-
socketUrl,
|
|
16
|
-
useCache
|
|
17
|
-
}) => {
|
|
18
|
-
return /* @__PURE__ */ jsx(
|
|
19
|
-
InternalNovuProvider,
|
|
20
|
-
{
|
|
21
|
-
applicationIdentifier,
|
|
22
|
-
subscriberId,
|
|
23
|
-
subscriberHash,
|
|
24
|
-
backendUrl,
|
|
25
|
-
socketUrl,
|
|
26
|
-
useCache,
|
|
27
|
-
userAgentType: "hooks",
|
|
28
|
-
children
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
var InternalNovuProvider = ({
|
|
33
|
-
children,
|
|
34
|
-
applicationIdentifier,
|
|
35
|
-
subscriberId,
|
|
36
|
-
subscriberHash,
|
|
37
|
-
backendUrl,
|
|
38
|
-
socketUrl,
|
|
39
|
-
useCache,
|
|
40
|
-
userAgentType
|
|
41
|
-
}) => {
|
|
42
|
-
const novu = useMemo(
|
|
43
|
-
() => new Novu({
|
|
44
|
-
applicationIdentifier,
|
|
45
|
-
subscriberId,
|
|
46
|
-
subscriberHash,
|
|
47
|
-
backendUrl,
|
|
48
|
-
socketUrl,
|
|
49
|
-
useCache,
|
|
50
|
-
__userAgent: `${baseUserAgent} ${userAgentType}`
|
|
51
|
-
}),
|
|
52
|
-
[applicationIdentifier, subscriberId, subscriberHash, backendUrl, socketUrl, useCache, userAgentType]
|
|
53
|
-
);
|
|
54
|
-
return /* @__PURE__ */ jsx(NovuContext.Provider, { value: novu, children });
|
|
55
|
-
};
|
|
56
|
-
var useNovu = () => {
|
|
57
|
-
const context = useContext(NovuContext);
|
|
58
|
-
if (!context) {
|
|
59
|
-
throw new Error("useNovu must be used within a <NovuProvider />");
|
|
60
|
-
}
|
|
61
|
-
return context;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
// src/hooks/useNotifications.ts
|
|
65
|
-
import { useState, useEffect, useRef } from "react";
|
|
66
|
-
import { isSameFilter } from "@novu/js";
|
|
67
|
-
var useNotifications = (props) => {
|
|
68
|
-
const { tags, read, archived = false, limit, onSuccess, onError } = props || {};
|
|
69
|
-
const filterRef = useRef(void 0);
|
|
70
|
-
const { notifications, on } = useNovu();
|
|
71
|
-
const [data, setData] = useState();
|
|
72
|
-
const [error, setError] = useState();
|
|
73
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
74
|
-
const [isFetching, setIsFetching] = useState(false);
|
|
75
|
-
const [hasMore, setHasMore] = useState(false);
|
|
76
|
-
const length = data?.length;
|
|
77
|
-
const after = length ? data[length - 1].id : void 0;
|
|
78
|
-
const sync = (event) => {
|
|
79
|
-
if (!event.data || filterRef.current && !isSameFilter(filterRef.current, event.data.filter)) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
setData(event.data.notifications);
|
|
83
|
-
setHasMore(event.data.hasMore);
|
|
84
|
-
};
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
const cleanup = on("notifications.list.updated", sync);
|
|
87
|
-
return () => {
|
|
88
|
-
cleanup();
|
|
89
|
-
};
|
|
90
|
-
}, []);
|
|
91
|
-
useEffect(() => {
|
|
92
|
-
const newFilter = { tags, read, archived };
|
|
93
|
-
if (filterRef.current && isSameFilter(filterRef.current, newFilter)) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
notifications.clearCache({ filter: filterRef.current });
|
|
97
|
-
filterRef.current = newFilter;
|
|
98
|
-
fetchNotifications({ refetch: true });
|
|
99
|
-
}, [tags, read, archived]);
|
|
100
|
-
const fetchNotifications = async (options) => {
|
|
101
|
-
if (options?.refetch) {
|
|
102
|
-
setError(void 0);
|
|
103
|
-
setIsLoading(true);
|
|
104
|
-
setIsFetching(false);
|
|
105
|
-
}
|
|
106
|
-
setIsFetching(true);
|
|
107
|
-
const response = await notifications.list({
|
|
108
|
-
tags,
|
|
109
|
-
read,
|
|
110
|
-
archived,
|
|
111
|
-
limit,
|
|
112
|
-
after: options?.refetch ? void 0 : after
|
|
113
|
-
});
|
|
114
|
-
if (response.error) {
|
|
115
|
-
setError(response.error);
|
|
116
|
-
onError?.(response.error);
|
|
117
|
-
} else {
|
|
118
|
-
onSuccess?.(response.data.notifications);
|
|
119
|
-
setData(response.data.notifications);
|
|
120
|
-
setHasMore(response.data.hasMore);
|
|
121
|
-
}
|
|
122
|
-
setIsLoading(false);
|
|
123
|
-
setIsFetching(false);
|
|
124
|
-
};
|
|
125
|
-
const refetch = () => {
|
|
126
|
-
notifications.clearCache({ filter: { tags, read, archived } });
|
|
127
|
-
return fetchNotifications({ refetch: true });
|
|
128
|
-
};
|
|
129
|
-
const fetchMore = async () => {
|
|
130
|
-
if (!hasMore || isFetching) return;
|
|
131
|
-
return fetchNotifications();
|
|
132
|
-
};
|
|
133
|
-
const readAll = async () => {
|
|
134
|
-
return await notifications.readAll({ tags });
|
|
135
|
-
};
|
|
136
|
-
const archiveAll = async () => {
|
|
137
|
-
return await notifications.archiveAll({ tags });
|
|
138
|
-
};
|
|
139
|
-
const archiveAllRead = async () => {
|
|
140
|
-
return await notifications.archiveAllRead({ tags });
|
|
141
|
-
};
|
|
142
|
-
return {
|
|
143
|
-
readAll,
|
|
144
|
-
archiveAll,
|
|
145
|
-
archiveAllRead,
|
|
146
|
-
notifications: data,
|
|
147
|
-
error,
|
|
148
|
-
isLoading,
|
|
149
|
-
isFetching,
|
|
150
|
-
refetch,
|
|
151
|
-
fetchMore,
|
|
152
|
-
hasMore
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
// src/hooks/usePreferences.ts
|
|
157
|
-
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
158
|
-
var usePreferences = (props) => {
|
|
159
|
-
const { onSuccess, onError } = props || {};
|
|
160
|
-
const [data, setData] = useState2();
|
|
161
|
-
const { preferences, on } = useNovu();
|
|
162
|
-
const [error, setError] = useState2();
|
|
163
|
-
const [isLoading, setIsLoading] = useState2(true);
|
|
164
|
-
const [isFetching, setIsFetching] = useState2(false);
|
|
165
|
-
const sync = (event) => {
|
|
166
|
-
if (!event.data) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
setData(event.data);
|
|
170
|
-
};
|
|
171
|
-
useEffect2(() => {
|
|
172
|
-
fetchPreferences();
|
|
173
|
-
const listUpdatedCleanup = on("preferences.list.updated", sync);
|
|
174
|
-
const listPendingCleanup = on("preferences.list.pending", sync);
|
|
175
|
-
const listResolvedCleanup = on("preferences.list.resolved", sync);
|
|
176
|
-
return () => {
|
|
177
|
-
listUpdatedCleanup();
|
|
178
|
-
listPendingCleanup();
|
|
179
|
-
listResolvedCleanup();
|
|
180
|
-
};
|
|
181
|
-
}, []);
|
|
182
|
-
const fetchPreferences = async () => {
|
|
183
|
-
setIsFetching(true);
|
|
184
|
-
const response = await preferences.list(props?.filter);
|
|
185
|
-
if (response.error) {
|
|
186
|
-
setError(response.error);
|
|
187
|
-
onError?.(response.error);
|
|
188
|
-
} else {
|
|
189
|
-
onSuccess?.(response.data);
|
|
190
|
-
}
|
|
191
|
-
setIsLoading(false);
|
|
192
|
-
setIsFetching(false);
|
|
193
|
-
};
|
|
194
|
-
const refetch = () => {
|
|
195
|
-
preferences.cache.clearAll();
|
|
196
|
-
return fetchPreferences();
|
|
197
|
-
};
|
|
198
|
-
return {
|
|
199
|
-
preferences: data,
|
|
200
|
-
error,
|
|
201
|
-
isLoading,
|
|
202
|
-
isFetching,
|
|
203
|
-
refetch
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
// src/hooks/useCounts.ts
|
|
208
|
-
import { useEffect as useEffect5, useState as useState4 } from "react";
|
|
209
|
-
import { areTagsEqual } from "@novu/js";
|
|
210
|
-
|
|
211
|
-
// src/hooks/internal/useWebsocketEvent.ts
|
|
212
|
-
import { useEffect as useEffect4 } from "react";
|
|
213
|
-
|
|
214
|
-
// src/utils/requestLock.ts
|
|
215
|
-
function requestLock(id, cb) {
|
|
216
|
-
if (!("locks" in navigator)) {
|
|
217
|
-
cb(id);
|
|
218
|
-
return () => {
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
let isFulfilled = false;
|
|
222
|
-
let promiseResolve;
|
|
223
|
-
const promise = new Promise((resolve) => {
|
|
224
|
-
promiseResolve = resolve;
|
|
225
|
-
});
|
|
226
|
-
navigator.locks.request(id, () => {
|
|
227
|
-
if (!isFulfilled) {
|
|
228
|
-
cb(id);
|
|
229
|
-
}
|
|
230
|
-
return promise;
|
|
231
|
-
});
|
|
232
|
-
return () => {
|
|
233
|
-
isFulfilled = true;
|
|
234
|
-
promiseResolve();
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// src/hooks/internal/useBrowserTabsChannel.ts
|
|
239
|
-
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
240
|
-
var useBrowserTabsChannel = ({
|
|
241
|
-
channelName,
|
|
242
|
-
onMessage
|
|
243
|
-
}) => {
|
|
244
|
-
const [tabsChannel] = useState3(
|
|
245
|
-
typeof BroadcastChannel !== "undefined" ? new BroadcastChannel(channelName) : void 0
|
|
246
|
-
);
|
|
247
|
-
const postMessage = (data) => {
|
|
248
|
-
tabsChannel?.postMessage(data);
|
|
249
|
-
};
|
|
250
|
-
useEffect3(() => {
|
|
251
|
-
const listener = (event) => {
|
|
252
|
-
onMessage(event.data);
|
|
253
|
-
};
|
|
254
|
-
tabsChannel?.addEventListener("message", listener);
|
|
255
|
-
return () => {
|
|
256
|
-
tabsChannel?.removeEventListener("message", listener);
|
|
257
|
-
};
|
|
258
|
-
}, []);
|
|
259
|
-
return { postMessage };
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
// src/hooks/internal/useWebsocketEvent.ts
|
|
263
|
-
var useWebSocketEvent = ({
|
|
264
|
-
event: webSocketEvent,
|
|
265
|
-
eventHandler: onMessage
|
|
266
|
-
}) => {
|
|
267
|
-
const novu = useNovu();
|
|
268
|
-
const { postMessage } = useBrowserTabsChannel({ channelName: `nv.${webSocketEvent}`, onMessage });
|
|
269
|
-
const updateReadCount = (data) => {
|
|
270
|
-
onMessage(data);
|
|
271
|
-
postMessage(data);
|
|
272
|
-
};
|
|
273
|
-
useEffect4(() => {
|
|
274
|
-
let cleanup;
|
|
275
|
-
const resolveLock = requestLock(`nv.${webSocketEvent}`, () => {
|
|
276
|
-
cleanup = novu.on(webSocketEvent, updateReadCount);
|
|
277
|
-
});
|
|
278
|
-
return () => {
|
|
279
|
-
if (cleanup) {
|
|
280
|
-
cleanup();
|
|
281
|
-
}
|
|
282
|
-
resolveLock();
|
|
283
|
-
};
|
|
284
|
-
}, []);
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
// src/hooks/useCounts.ts
|
|
288
|
-
var useCounts = (props) => {
|
|
289
|
-
const { filters, onSuccess, onError } = props;
|
|
290
|
-
const { notifications } = useNovu();
|
|
291
|
-
const [error, setError] = useState4();
|
|
292
|
-
const [counts, setCounts] = useState4();
|
|
293
|
-
const [isLoading, setIsLoading] = useState4(true);
|
|
294
|
-
const [isFetching, setIsFetching] = useState4(false);
|
|
295
|
-
const sync = async (notification) => {
|
|
296
|
-
const existingCounts = counts ?? new Array(filters.length).fill(void 0);
|
|
297
|
-
let countFiltersToFetch = [];
|
|
298
|
-
if (notification) {
|
|
299
|
-
for (let i = 0; i < existingCounts.length; i++) {
|
|
300
|
-
const filter = filters[i];
|
|
301
|
-
if (areTagsEqual(filter.tags, notification.tags)) {
|
|
302
|
-
countFiltersToFetch.push(filter);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
} else {
|
|
306
|
-
countFiltersToFetch = filters;
|
|
307
|
-
}
|
|
308
|
-
if (countFiltersToFetch.length === 0) {
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
setIsFetching(true);
|
|
312
|
-
const countsRes = await notifications.count({ filters: countFiltersToFetch });
|
|
313
|
-
setIsFetching(false);
|
|
314
|
-
setIsLoading(false);
|
|
315
|
-
if (countsRes.error) {
|
|
316
|
-
setError(countsRes.error);
|
|
317
|
-
onError?.(countsRes.error);
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
const data = countsRes.data;
|
|
321
|
-
onSuccess?.(data.counts);
|
|
322
|
-
setCounts((oldCounts) => {
|
|
323
|
-
const newCounts = [];
|
|
324
|
-
const countsReceived = data.counts;
|
|
325
|
-
for (let i = 0; i < existingCounts.length; i++) {
|
|
326
|
-
const countReceived = countsReceived.find((c) => areTagsEqual(c.filter.tags, existingCounts[i]?.filter.tags));
|
|
327
|
-
newCounts.push(countReceived || oldCounts[i]);
|
|
328
|
-
}
|
|
329
|
-
return newCounts;
|
|
330
|
-
});
|
|
331
|
-
};
|
|
332
|
-
useWebSocketEvent({
|
|
333
|
-
event: "notifications.notification_received",
|
|
334
|
-
eventHandler: (data) => {
|
|
335
|
-
sync(data.result);
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
useWebSocketEvent({
|
|
339
|
-
event: "notifications.unread_count_changed",
|
|
340
|
-
eventHandler: () => {
|
|
341
|
-
sync();
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
useEffect5(() => {
|
|
345
|
-
setError(void 0);
|
|
346
|
-
setIsLoading(true);
|
|
347
|
-
setIsFetching(false);
|
|
348
|
-
sync();
|
|
349
|
-
}, [JSON.stringify(filters)]);
|
|
350
|
-
const refetch = async () => {
|
|
351
|
-
await sync();
|
|
352
|
-
};
|
|
353
|
-
return { counts, error, refetch, isLoading, isFetching };
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
// src/server/index.ts
|
|
357
|
-
function Inbox() {
|
|
358
|
-
}
|
|
359
|
-
function InboxContent() {
|
|
360
|
-
}
|
|
361
|
-
function Notifications() {
|
|
362
|
-
}
|
|
363
|
-
function Preferences() {
|
|
364
|
-
}
|
|
365
|
-
function Bell() {
|
|
366
|
-
}
|
|
367
|
-
export {
|
|
368
|
-
Bell,
|
|
369
|
-
Inbox,
|
|
370
|
-
InboxContent,
|
|
371
|
-
Notifications,
|
|
372
|
-
NovuProvider,
|
|
373
|
-
Preferences,
|
|
374
|
-
useCounts,
|
|
375
|
-
useNotifications,
|
|
376
|
-
useNovu,
|
|
377
|
-
usePreferences
|
|
378
|
-
};
|
|
379
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/NovuProvider.tsx","../../src/hooks/useNotifications.ts","../../src/hooks/usePreferences.ts","../../src/hooks/useCounts.ts","../../src/hooks/internal/useWebsocketEvent.ts","../../src/utils/requestLock.ts","../../src/hooks/internal/useBrowserTabsChannel.ts","../../src/server/index.ts"],"sourcesContent":["import { Novu, NovuOptions } from '@novu/js';\nimport { ReactNode, createContext, useContext, useMemo } from 'react';\n\n// @ts-ignore\nconst version = PACKAGE_VERSION;\n// @ts-ignore\nconst name = PACKAGE_NAME;\nconst baseUserAgent = `${name}@${version}`;\n\ntype NovuProviderProps = NovuOptions & {\n children: ReactNode;\n};\n\nconst NovuContext = createContext<Novu | undefined>(undefined);\n\nexport const NovuProvider = ({\n children,\n applicationIdentifier,\n subscriberId,\n subscriberHash,\n backendUrl,\n socketUrl,\n useCache,\n}: NovuProviderProps) => {\n return (\n <InternalNovuProvider\n applicationIdentifier={applicationIdentifier}\n subscriberId={subscriberId}\n subscriberHash={subscriberHash}\n backendUrl={backendUrl}\n socketUrl={socketUrl}\n useCache={useCache}\n userAgentType=\"hooks\"\n >\n {children}\n </InternalNovuProvider>\n );\n};\n\n/**\n * @internal Should be used internally not to be exposed outside of the library\n * This is needed to differentiate between the hooks and components user agents\n * Better to use this internally to avoid confusion.\n */\nexport const InternalNovuProvider = ({\n children,\n applicationIdentifier,\n subscriberId,\n subscriberHash,\n backendUrl,\n socketUrl,\n useCache,\n userAgentType,\n}: NovuProviderProps & { userAgentType: 'components' | 'hooks' }) => {\n const novu = useMemo(\n () =>\n new Novu({\n applicationIdentifier,\n subscriberId,\n subscriberHash,\n backendUrl,\n socketUrl,\n useCache,\n __userAgent: `${baseUserAgent} ${userAgentType}`,\n }),\n [applicationIdentifier, subscriberId, subscriberHash, backendUrl, socketUrl, useCache, userAgentType]\n );\n\n return <NovuContext.Provider value={novu}>{children}</NovuContext.Provider>;\n};\n\nexport const useNovu = () => {\n const context = useContext(NovuContext);\n if (!context) {\n throw new Error('useNovu must be used within a <NovuProvider />');\n }\n\n return context;\n};\n\nexport const useUnsafeNovu = () => {\n const context = useContext(NovuContext);\n\n return context;\n};\n","import { useState, useEffect, useRef } from 'react';\nimport { ListNotificationsResponse, Notification, NovuError, isSameFilter, NotificationFilter } from '@novu/js';\nimport { useNovu } from './NovuProvider';\n\nexport type UseNotificationsProps = {\n tags?: string[];\n read?: boolean;\n archived?: boolean;\n limit?: number;\n onSuccess?: (data: Notification[]) => void;\n onError?: (error: NovuError) => void;\n};\n\nexport const useNotifications = (props?: UseNotificationsProps) => {\n const { tags, read, archived = false, limit, onSuccess, onError } = props || {};\n const filterRef = useRef<NotificationFilter | undefined>(undefined);\n const { notifications, on } = useNovu();\n const [data, setData] = useState<Array<Notification>>();\n const [error, setError] = useState<NovuError>();\n const [isLoading, setIsLoading] = useState(true);\n const [isFetching, setIsFetching] = useState(false);\n const [hasMore, setHasMore] = useState(false);\n const length = data?.length;\n const after = length ? data[length - 1].id : undefined;\n\n const sync = (event: { data?: ListNotificationsResponse }) => {\n if (!event.data || (filterRef.current && !isSameFilter(filterRef.current, event.data.filter))) {\n return;\n }\n setData(event.data.notifications);\n setHasMore(event.data.hasMore);\n };\n\n useEffect(() => {\n const cleanup = on('notifications.list.updated', sync);\n\n return () => {\n cleanup();\n };\n }, []);\n\n useEffect(() => {\n const newFilter = { tags, read, archived };\n if (filterRef.current && isSameFilter(filterRef.current, newFilter)) {\n return;\n }\n\n notifications.clearCache({ filter: filterRef.current });\n filterRef.current = newFilter;\n\n fetchNotifications({ refetch: true });\n }, [tags, read, archived]);\n\n const fetchNotifications = async (options?: { refetch: boolean }) => {\n if (options?.refetch) {\n setError(undefined);\n setIsLoading(true);\n setIsFetching(false);\n }\n setIsFetching(true);\n const response = await notifications.list({\n tags,\n read,\n archived,\n limit,\n after: options?.refetch ? undefined : after,\n });\n if (response.error) {\n setError(response.error);\n onError?.(response.error);\n } else {\n onSuccess?.(response.data!.notifications);\n setData(response.data!.notifications);\n setHasMore(response.data!.hasMore);\n }\n setIsLoading(false);\n setIsFetching(false);\n };\n\n const refetch = () => {\n notifications.clearCache({ filter: { tags, read, archived } });\n\n return fetchNotifications({ refetch: true });\n };\n\n const fetchMore = async () => {\n if (!hasMore || isFetching) return;\n\n return fetchNotifications();\n };\n\n const readAll = async () => {\n return await notifications.readAll({ tags });\n };\n\n const archiveAll = async () => {\n return await notifications.archiveAll({ tags });\n };\n\n const archiveAllRead = async () => {\n return await notifications.archiveAllRead({ tags });\n };\n\n return {\n readAll,\n archiveAll,\n archiveAllRead,\n notifications: data,\n error,\n isLoading,\n isFetching,\n refetch,\n fetchMore,\n hasMore,\n };\n};\n","import { NovuError, Preference } from '@novu/js';\nimport { useEffect, useState } from 'react';\nimport { useNovu } from './NovuProvider';\n\ntype UsePreferencesProps = {\n filter?: { tags?: string[] };\n onSuccess?: (data: Preference[]) => void;\n onError?: (error: NovuError) => void;\n};\n\ntype UsePreferencesResult = {\n preferences?: Preference[];\n error?: NovuError;\n isLoading: boolean; // initial loading\n isFetching: boolean; // the request is in flight\n refetch: () => Promise<void>;\n};\n\nexport const usePreferences = (props?: UsePreferencesProps): UsePreferencesResult => {\n const { onSuccess, onError } = props || {};\n const [data, setData] = useState<Preference[]>();\n const { preferences, on } = useNovu();\n const [error, setError] = useState<NovuError>();\n const [isLoading, setIsLoading] = useState(true);\n const [isFetching, setIsFetching] = useState(false);\n\n const sync = (event: { data?: Preference[] }) => {\n if (!event.data) {\n return;\n }\n setData(event.data);\n };\n\n useEffect(() => {\n fetchPreferences();\n\n const listUpdatedCleanup = on('preferences.list.updated', sync);\n const listPendingCleanup = on('preferences.list.pending', sync);\n const listResolvedCleanup = on('preferences.list.resolved', sync);\n\n return () => {\n listUpdatedCleanup();\n listPendingCleanup();\n listResolvedCleanup();\n };\n }, []);\n\n const fetchPreferences = async () => {\n setIsFetching(true);\n const response = await preferences.list(props?.filter);\n if (response.error) {\n setError(response.error);\n onError?.(response.error);\n } else {\n onSuccess?.(response.data!);\n }\n setIsLoading(false);\n setIsFetching(false);\n };\n\n const refetch = () => {\n preferences.cache.clearAll();\n\n return fetchPreferences();\n };\n\n return {\n preferences: data,\n error,\n isLoading,\n isFetching,\n refetch,\n };\n};\n","import { useEffect, useState } from 'react';\nimport { Notification, NotificationFilter, NovuError, areTagsEqual } from '@novu/js';\nimport { useNovu } from './NovuProvider';\nimport { useWebSocketEvent } from './internal/useWebsocketEvent';\n\ntype Count = {\n count: number;\n filter: NotificationFilter;\n};\n\ntype UseCountsProps = {\n filters: NotificationFilter[];\n onSuccess?: (data: Count[]) => void;\n onError?: (error: NovuError) => void;\n};\n\ntype UseCountsResult = {\n counts?: Count[];\n error?: NovuError;\n isLoading: boolean; // initial loading\n isFetching: boolean; // the request is in flight\n refetch: () => Promise<void>;\n};\n\nexport const useCounts = (props: UseCountsProps): UseCountsResult => {\n const { filters, onSuccess, onError } = props;\n const { notifications } = useNovu();\n const [error, setError] = useState<NovuError>();\n const [counts, setCounts] = useState<Count[]>();\n const [isLoading, setIsLoading] = useState(true);\n const [isFetching, setIsFetching] = useState(false);\n\n const sync = async (notification?: Notification) => {\n const existingCounts = counts ?? (new Array(filters.length).fill(undefined) as (Count | undefined)[]);\n let countFiltersToFetch: NotificationFilter[] = [];\n if (notification) {\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < existingCounts.length; i++) {\n const filter = filters[i];\n if (areTagsEqual(filter.tags, notification.tags)) {\n countFiltersToFetch.push(filter);\n }\n }\n } else {\n countFiltersToFetch = filters;\n }\n\n if (countFiltersToFetch.length === 0) {\n return;\n }\n\n setIsFetching(true);\n const countsRes = await notifications.count({ filters: countFiltersToFetch });\n setIsFetching(false);\n setIsLoading(false);\n if (countsRes.error) {\n setError(countsRes.error);\n onError?.(countsRes.error);\n\n return;\n }\n const data = countsRes.data!;\n onSuccess?.(data.counts);\n\n setCounts((oldCounts) => {\n const newCounts: Count[] = [];\n const countsReceived = data.counts;\n\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < existingCounts.length; i++) {\n const countReceived = countsReceived.find((c) => areTagsEqual(c.filter.tags, existingCounts[i]?.filter.tags));\n\n newCounts.push(countReceived || oldCounts![i]);\n }\n\n return newCounts;\n });\n };\n\n useWebSocketEvent({\n event: 'notifications.notification_received',\n eventHandler: (data) => {\n sync(data.result);\n },\n });\n\n useWebSocketEvent({\n event: 'notifications.unread_count_changed',\n eventHandler: () => {\n sync();\n },\n });\n\n useEffect(() => {\n setError(undefined);\n setIsLoading(true);\n setIsFetching(false);\n sync();\n }, [JSON.stringify(filters)]);\n\n const refetch = async () => {\n await sync();\n };\n\n return { counts, error, refetch, isLoading, isFetching };\n};\n","import { EventHandler, Events, SocketEventNames } from '@novu/js';\nimport { useEffect } from 'react';\nimport { useNovu } from '../NovuProvider';\nimport { requestLock } from '../../utils/requestLock';\nimport { useBrowserTabsChannel } from './useBrowserTabsChannel';\n\nexport const useWebSocketEvent = <E extends SocketEventNames>({\n event: webSocketEvent,\n eventHandler: onMessage,\n}: {\n event: E;\n eventHandler: (args: Events[E]) => void;\n}) => {\n const novu = useNovu();\n const { postMessage } = useBrowserTabsChannel({ channelName: `nv.${webSocketEvent}`, onMessage });\n\n const updateReadCount: EventHandler<Events[E]> = (data) => {\n onMessage(data);\n postMessage(data);\n };\n\n useEffect(() => {\n let cleanup: () => void;\n const resolveLock = requestLock(`nv.${webSocketEvent}`, () => {\n cleanup = novu.on(webSocketEvent, updateReadCount);\n });\n\n return () => {\n if (cleanup) {\n cleanup();\n }\n\n resolveLock();\n };\n }, []);\n};\n","export function requestLock(id: string, cb: (id: string) => void) {\n // Check if the Lock API is available\n if (!('locks' in navigator)) {\n // If Lock API is not available, immediately invoke the callback and return a no-op function\n cb(id);\n return () => {};\n }\n\n let isFulfilled = false;\n let promiseResolve: () => void;\n\n const promise = new Promise<void>((resolve) => {\n promiseResolve = resolve;\n });\n\n navigator.locks.request(id, () => {\n if (!isFulfilled) {\n cb(id);\n }\n\n return promise;\n });\n\n return () => {\n isFulfilled = true;\n promiseResolve();\n };\n}\n","import { useEffect, useState } from 'react';\n\nexport const useBrowserTabsChannel = <T = unknown>({\n channelName,\n onMessage,\n}: {\n channelName: string;\n onMessage: (args: T) => void;\n}) => {\n const [tabsChannel] = useState(\n typeof BroadcastChannel !== 'undefined' ? new BroadcastChannel(channelName) : undefined\n );\n\n const postMessage = (data: T) => {\n tabsChannel?.postMessage(data);\n };\n\n useEffect(() => {\n const listener = (event: MessageEvent<T>) => {\n onMessage(event.data);\n };\n\n tabsChannel?.addEventListener('message', listener);\n\n return () => {\n tabsChannel?.removeEventListener('message', listener);\n };\n }, []);\n\n return { postMessage };\n};\n","export type * from '../utils/types';\nexport type { InboxProps } from '../components/Inbox';\n\n/**\n * Exporting all components from the components folder\n * as empty functions to fix build errors in SSR\n * This will be replaced with actual components\n * when we implement the SSR components in @novu/js/ui\n */\nexport function Inbox() {}\nexport function InboxContent() {}\nexport function Notifications() {}\nexport function Preferences() {}\nexport function Bell() {}\n\n// Hooks\nexport { NovuProvider } from '../index';\nexport * from '../hooks';\n"],"mappings":";AAAA,SAAS,YAAyB;AAClC,SAAoB,eAAe,YAAY,eAAe;AAwB1D;AArBJ,IAAM,UAAU;AAEhB,IAAM,OAAO;AACb,IAAM,gBAAgB,GAAG,IAAI,IAAI,OAAO;AAMxC,IAAM,cAAc,cAAgC,MAAS;AAEtD,IAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyB;AACvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAc;AAAA,MAEb;AAAA;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AAM,UAAU,YAAY;AAC1B,UAAM,KAAK;AAAA,EACb;AAEA,SAAO,EAAE,QAAQ,OAAO,SAAS,WAAW,WAAW;AACzD;;;AIhGO,SAAS,QAAQ;AAAC;AAClB,SAAS,eAAe;AAAC;AACzB,SAAS,gBAAgB;AAAC;AAC1B,SAAS,cAAc;AAAC;AACxB,SAAS,OAAO;AAAC;","names":["useEffect","useState","useState","useEffect","useEffect","useState","useEffect","useEffect","useState","useEffect","useState","useEffect"]}
|