@burdenoff/microfe-notification 2026.424.101
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 +376 -0
- package/dist/AdminNotificationRoot.d.ts +35 -0
- package/dist/AdminNotificationRoot.d.ts.map +1 -0
- package/dist/AdminNotificationRoot.js +81 -0
- package/dist/AdminNotificationRoot.js.map +1 -0
- package/dist/AdminNotificationRoutes.d.ts +2 -0
- package/dist/AdminNotificationRoutes.d.ts.map +1 -0
- package/dist/AdminNotificationRoutes.js +108 -0
- package/dist/AdminNotificationRoutes.js.map +1 -0
- package/dist/NotificationRoot.d.ts +31 -0
- package/dist/NotificationRoot.d.ts.map +1 -0
- package/dist/NotificationRoot.js +81 -0
- package/dist/NotificationRoot.js.map +1 -0
- package/dist/NotificationRoutes.d.ts +17 -0
- package/dist/NotificationRoutes.d.ts.map +1 -0
- package/dist/NotificationRoutes.js +67 -0
- package/dist/NotificationRoutes.js.map +1 -0
- package/dist/UserNotificationRoot.d.ts +34 -0
- package/dist/UserNotificationRoot.d.ts.map +1 -0
- package/dist/UserNotificationRoot.js +64 -0
- package/dist/UserNotificationRoot.js.map +1 -0
- package/dist/UserNotificationRoutes.d.ts +15 -0
- package/dist/UserNotificationRoutes.d.ts.map +1 -0
- package/dist/UserNotificationRoutes.js +52 -0
- package/dist/UserNotificationRoutes.js.map +1 -0
- package/dist/__tests__/setup.d.ts +2 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/components/NotificationBell.d.ts +14 -0
- package/dist/components/NotificationBell.d.ts.map +1 -0
- package/dist/components/NotificationBell.js +47 -0
- package/dist/components/NotificationBell.js.map +1 -0
- package/dist/components/NotificationCard.d.ts +19 -0
- package/dist/components/NotificationCard.d.ts.map +1 -0
- package/dist/components/NotificationCard.js +112 -0
- package/dist/components/NotificationCard.js.map +1 -0
- package/dist/components/NotificationPanel.d.ts +11 -0
- package/dist/components/NotificationPanel.d.ts.map +1 -0
- package/dist/components/NotificationPanel.js +100 -0
- package/dist/components/NotificationPanel.js.map +1 -0
- package/dist/components/RecipientSelector.d.ts +34 -0
- package/dist/components/RecipientSelector.d.ts.map +1 -0
- package/dist/components/RecipientSelector.js +212 -0
- package/dist/components/RecipientSelector.js.map +1 -0
- package/dist/components/TemplatePreview.d.ts +22 -0
- package/dist/components/TemplatePreview.d.ts.map +1 -0
- package/dist/components/TemplatePreview.js +425 -0
- package/dist/components/TemplatePreview.js.map +1 -0
- package/dist/components/VariableInserter.d.ts +12 -0
- package/dist/components/VariableInserter.d.ts.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +3 -0
- package/dist/constants/permissions.d.ts +24 -0
- package/dist/constants/permissions.d.ts.map +1 -0
- package/dist/constants/permissions.js +17 -0
- package/dist/constants/permissions.js.map +1 -0
- package/dist/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +1408 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-operations.js +514 -0
- package/dist/generated/global-operations.js.map +1 -0
- package/dist/generated/global-types.d.ts +20773 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-types.d.ts +53363 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/graphql/global-client.d.ts +19 -0
- package/dist/graphql/global-client.d.ts.map +1 -0
- package/dist/graphql/global-client.js +57 -0
- package/dist/graphql/global-client.js.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +5 -0
- package/dist/hooks/useNotificationAdmin.d.ts +51 -0
- package/dist/hooks/useNotificationAdmin.d.ts.map +1 -0
- package/dist/hooks/useNotificationAdmin.js +203 -0
- package/dist/hooks/useNotificationAdmin.js.map +1 -0
- package/dist/hooks/useNotificationTemplates.d.ts +136 -0
- package/dist/hooks/useNotificationTemplates.d.ts.map +1 -0
- package/dist/hooks/useNotificationTemplates.js +168 -0
- package/dist/hooks/useNotificationTemplates.js.map +1 -0
- package/dist/hooks/useNotificationTopics.d.ts +36 -0
- package/dist/hooks/useNotificationTopics.d.ts.map +1 -0
- package/dist/hooks/useNotificationTopics.js +127 -0
- package/dist/hooks/useNotificationTopics.js.map +1 -0
- package/dist/hooks/useNotifications.d.ts +36 -0
- package/dist/hooks/useNotifications.d.ts.map +1 -0
- package/dist/hooks/useNotifications.js +289 -0
- package/dist/hooks/useNotifications.js.map +1 -0
- package/dist/hooks/useSendNotification.d.ts +159 -0
- package/dist/hooks/useSendNotification.d.ts.map +1 -0
- package/dist/hooks/useSendNotification.js +123 -0
- package/dist/hooks/useSendNotification.js.map +1 -0
- package/dist/hooks/useUserSearch.d.ts +27 -0
- package/dist/hooks/useUserSearch.d.ts.map +1 -0
- package/dist/hooks/useUserSearch.js +76 -0
- package/dist/hooks/useUserSearch.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/pages/CreateNotificationPage.d.ts +6 -0
- package/dist/pages/CreateNotificationPage.d.ts.map +1 -0
- package/dist/pages/CreateNotificationPage.js +1366 -0
- package/dist/pages/CreateNotificationPage.js.map +1 -0
- package/dist/pages/NotificationCenterPage.d.ts +7 -0
- package/dist/pages/NotificationCenterPage.d.ts.map +1 -0
- package/dist/pages/NotificationCenterPage.js +203 -0
- package/dist/pages/NotificationCenterPage.js.map +1 -0
- package/dist/pages/NotificationHistoryAdminPage.d.ts +3 -0
- package/dist/pages/NotificationHistoryAdminPage.d.ts.map +1 -0
- package/dist/pages/NotificationHistoryAdminPage.js +484 -0
- package/dist/pages/NotificationHistoryAdminPage.js.map +1 -0
- package/dist/pages/NotificationHistoryPage.d.ts +3 -0
- package/dist/pages/NotificationHistoryPage.d.ts.map +1 -0
- package/dist/pages/NotificationHistoryPage.js +136 -0
- package/dist/pages/NotificationHistoryPage.js.map +1 -0
- package/dist/pages/NotificationLandingPage.d.ts +11 -0
- package/dist/pages/NotificationLandingPage.d.ts.map +1 -0
- package/dist/pages/NotificationLandingPage.js +85 -0
- package/dist/pages/NotificationLandingPage.js.map +1 -0
- package/dist/pages/NotificationPreferencesPage.d.ts +2 -0
- package/dist/pages/NotificationPreferencesPage.d.ts.map +1 -0
- package/dist/pages/NotificationPreferencesPage.js +108 -0
- package/dist/pages/NotificationPreferencesPage.js.map +1 -0
- package/dist/pages/NotificationTemplatesPage.d.ts +8 -0
- package/dist/pages/NotificationTemplatesPage.d.ts.map +1 -0
- package/dist/pages/NotificationTemplatesPage.js +310 -0
- package/dist/pages/NotificationTemplatesPage.js.map +1 -0
- package/dist/pages/NotificationTopicsPage.d.ts +2 -0
- package/dist/pages/NotificationTopicsPage.d.ts.map +1 -0
- package/dist/pages/NotificationTopicsPage.js +254 -0
- package/dist/pages/NotificationTopicsPage.js.map +1 -0
- package/dist/pages/TemplateEditorPage.d.ts +13 -0
- package/dist/pages/TemplateEditorPage.d.ts.map +1 -0
- package/dist/pages/TemplateEditorPage.js +790 -0
- package/dist/pages/TemplateEditorPage.js.map +1 -0
- package/dist/providers/NotificationProvider.d.ts +19 -0
- package/dist/providers/NotificationProvider.d.ts.map +1 -0
- package/dist/providers/NotificationProvider.js +35 -0
- package/dist/providers/NotificationProvider.js.map +1 -0
- package/dist/shared/hooks/useTr.d.ts +14 -0
- package/dist/shared/hooks/useTr.d.ts.map +1 -0
- package/dist/shared/hooks/useTr.js +14 -0
- package/dist/shared/hooks/useTr.js.map +1 -0
- package/dist/store/notificationStore.d.ts +32 -0
- package/dist/store/notificationStore.d.ts.map +1 -0
- package/dist/store/notificationStore.js +124 -0
- package/dist/store/notificationStore.js.map +1 -0
- package/dist/types/index.d.ts +215 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/index.d.ts +68 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +122 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/notificationHistoryExport.d.ts +13 -0
- package/dist/utils/notificationHistoryExport.d.ts.map +1 -0
- package/dist/utils/notificationHistoryExport.js +29 -0
- package/dist/utils/notificationHistoryExport.js.map +1 -0
- package/package.json +115 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface User {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
phoneNumber?: string;
|
|
6
|
+
role?: string;
|
|
7
|
+
status?: string;
|
|
8
|
+
username?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface UserSearchFilter {
|
|
11
|
+
search?: string;
|
|
12
|
+
role?: string;
|
|
13
|
+
status?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Hook for searching users via the global auth service.
|
|
17
|
+
* Uses the Apollo client from notification context (not raw fetch).
|
|
18
|
+
*/
|
|
19
|
+
export declare function useUserSearch(): {
|
|
20
|
+
searchUsers: (query: string, extraFilter?: Omit<UserSearchFilter, "search">) => void;
|
|
21
|
+
fetchAllUsers: (filter: UserSearchFilter) => Promise<User[]>;
|
|
22
|
+
results: User[];
|
|
23
|
+
isLoading: boolean;
|
|
24
|
+
error: string | null;
|
|
25
|
+
clearResults: () => void;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=useUserSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUserSearch.d.ts","sourceRoot":"","sources":["../../src/hooks/useUserSearch.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,aAAa;yBA0CjB,MAAM,gBAAgB,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC;4BA8B/C,gBAAgB,KAAG,OAAO,CAAC,IAAI,EAAE,CAAC;;;;;EA+CpD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useNotification as e } from "../providers/NotificationProvider.js";
|
|
2
|
+
import { getGlobalNotificationClient as t } from "../graphql/global-client.js";
|
|
3
|
+
import { SearchUsersDocument as n } from "../generated/global-operations.js";
|
|
4
|
+
import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
5
|
+
//#region src/hooks/useUserSearch.ts
|
|
6
|
+
function s() {
|
|
7
|
+
let { authToken: s, apiGatewayUrl: c } = e(), [l, u] = o(!1), [d, f] = o(null), [p, m] = o([]), h = a(null), g = r(() => t(c ?? void 0, s ?? void 0), [c, s]), _ = r(async (e, t = 10, r = 0) => ((await g().query({
|
|
8
|
+
query: n,
|
|
9
|
+
variables: {
|
|
10
|
+
filter: {
|
|
11
|
+
...e.search ? { search: e.search.trim() } : {},
|
|
12
|
+
...e.role ? { role: e.role } : {},
|
|
13
|
+
...e.status ? { status: e.status } : {}
|
|
14
|
+
},
|
|
15
|
+
pagination: {
|
|
16
|
+
limit: t,
|
|
17
|
+
offset: r
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
fetchPolicy: "network-only"
|
|
21
|
+
})).data?.users?.users || []).map((e) => ({
|
|
22
|
+
id: e.id,
|
|
23
|
+
name: e.name || "",
|
|
24
|
+
email: e.email,
|
|
25
|
+
phoneNumber: e.phoneNumber ?? void 0,
|
|
26
|
+
role: e.role,
|
|
27
|
+
status: e.status,
|
|
28
|
+
username: e.username
|
|
29
|
+
})), [g]), v = r((e, t) => {
|
|
30
|
+
if (h.current && clearTimeout(h.current), !e.trim() && !t?.role && !t?.status) {
|
|
31
|
+
m([]);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
h.current = setTimeout(async () => {
|
|
35
|
+
u(!0), f(null);
|
|
36
|
+
try {
|
|
37
|
+
m(await _({
|
|
38
|
+
search: e.trim(),
|
|
39
|
+
...t
|
|
40
|
+
}, 20, 0));
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.error("User search error:", e), f(e instanceof Error ? e.message : "Failed to search users"), m([]);
|
|
43
|
+
} finally {
|
|
44
|
+
u(!1);
|
|
45
|
+
}
|
|
46
|
+
}, 300);
|
|
47
|
+
}, [_]), y = r(async (e) => {
|
|
48
|
+
u(!0), f(null);
|
|
49
|
+
try {
|
|
50
|
+
let t = 0, n = !0, r = [];
|
|
51
|
+
for (; n;) {
|
|
52
|
+
let i = await _(e, 100, t);
|
|
53
|
+
r.push(...i), n = i.length === 100, t += 100;
|
|
54
|
+
}
|
|
55
|
+
return r;
|
|
56
|
+
} catch (e) {
|
|
57
|
+
return console.error("Fetch all users error:", e), f(e instanceof Error ? e.message : "Failed to fetch users"), [];
|
|
58
|
+
} finally {
|
|
59
|
+
u(!1);
|
|
60
|
+
}
|
|
61
|
+
}, [_]);
|
|
62
|
+
return i(() => () => {
|
|
63
|
+
h.current && clearTimeout(h.current);
|
|
64
|
+
}, []), {
|
|
65
|
+
searchUsers: v,
|
|
66
|
+
fetchAllUsers: y,
|
|
67
|
+
results: p,
|
|
68
|
+
isLoading: l,
|
|
69
|
+
error: d,
|
|
70
|
+
clearResults: () => m([])
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { s as useUserSearch };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=useUserSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUserSearch.js","names":[],"sources":["../../src/hooks/useUserSearch.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef } from 'react';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { getGlobalNotificationClient } from '../graphql/global-client';\nimport * as NotificationOps from '../generated/global-operations';\nimport type { SearchUsersQuery } from '../generated/global-operations';\n\nexport interface User {\n id: string;\n name: string;\n email: string;\n phoneNumber?: string;\n role?: string;\n status?: string;\n username?: string;\n}\n\nexport interface UserSearchFilter {\n search?: string;\n role?: string;\n status?: string;\n}\n\n/**\n * Hook for searching users via the global auth service.\n * Uses the Apollo client from notification context (not raw fetch).\n */\nexport function useUserSearch() {\n const { authToken, apiGatewayUrl } = useNotification();\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [results, setResults] = useState<User[]>([]);\n const debounceTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const getClient = useCallback(() => {\n return getGlobalNotificationClient(apiGatewayUrl ?? undefined, authToken ?? undefined);\n }, [apiGatewayUrl, authToken]);\n\n // Debounced search function\n const runQuery = useCallback(\n async (filter: UserSearchFilter, limit = 10, offset = 0): Promise<User[]> => {\n const client = getClient();\n const result = await client.query<SearchUsersQuery>({\n query: NotificationOps.SearchUsersDocument,\n variables: {\n filter: {\n ...(filter.search ? { search: filter.search.trim() } : {}),\n ...(filter.role ? { role: filter.role } : {}),\n ...(filter.status ? { status: filter.status } : {}),\n },\n pagination: { limit, offset },\n },\n fetchPolicy: 'network-only',\n });\n\n return (result.data?.users?.users || []).map((u) => ({\n id: u.id,\n name: u.name || '',\n email: u.email,\n phoneNumber: u.phoneNumber ?? undefined,\n role: (u as { role?: string }).role,\n status: (u as { status?: string }).status,\n username: u.username,\n }));\n },\n [getClient]\n );\n\n const searchUsers = useCallback(\n (query: string, extraFilter?: Omit<UserSearchFilter, 'search'>) => {\n if (debounceTimer.current) {\n clearTimeout(debounceTimer.current);\n }\n\n if (!query.trim() && !extraFilter?.role && !extraFilter?.status) {\n setResults([]);\n return;\n }\n\n debounceTimer.current = setTimeout(async () => {\n setIsLoading(true);\n setError(null);\n\n try {\n const users = await runQuery({ search: query.trim(), ...extraFilter }, 20, 0);\n setResults(users);\n } catch (err) {\n console.error('User search error:', err);\n setError(err instanceof Error ? err.message : 'Failed to search users');\n setResults([]);\n } finally {\n setIsLoading(false);\n }\n }, 300);\n },\n [runQuery]\n );\n\n const fetchAllUsers = useCallback(\n async (filter: UserSearchFilter): Promise<User[]> => {\n setIsLoading(true);\n setError(null);\n\n try {\n const pageSize = 100;\n let offset = 0;\n let hasMore = true;\n const allUsers: User[] = [];\n\n while (hasMore) {\n const page = await runQuery(filter, pageSize, offset);\n allUsers.push(...page);\n hasMore = page.length === pageSize;\n offset += pageSize;\n }\n\n return allUsers;\n } catch (err) {\n console.error('Fetch all users error:', err);\n const message = err instanceof Error ? err.message : 'Failed to fetch users';\n setError(message);\n return [];\n } finally {\n setIsLoading(false);\n }\n },\n [runQuery]\n );\n\n // Clear timer on unmount\n useEffect(() => {\n return () => {\n if (debounceTimer.current) {\n clearTimeout(debounceTimer.current);\n }\n };\n }, []);\n\n return {\n searchUsers,\n fetchAllUsers,\n results,\n isLoading,\n error,\n clearResults: () => setResults([]),\n };\n}\n"],"mappings":";;;;;AA0BA,SAAgB,IAAgB;CAC9B,IAAM,EAAE,cAAW,qBAAkB,GAAiB,EAChD,CAAC,GAAW,KAAgB,EAAS,GAAM,EAC3C,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,CAAC,GAAS,KAAc,EAAiB,EAAE,CAAC,EAC5C,IAAgB,EAA6C,KAAK,EAElE,IAAY,QACT,EAA4B,KAAiB,KAAA,GAAW,KAAa,KAAA,EAAU,EACrF,CAAC,GAAe,EAAU,CAAC,EAGxB,IAAW,EACf,OAAO,GAA0B,IAAQ,IAAI,IAAS,QAErC,MADA,GAAW,CACE,MAAwB;EAClD,OAAO;EACP,WAAW;GACT,QAAQ;IACN,GAAI,EAAO,SAAS,EAAE,QAAQ,EAAO,OAAO,MAAM,EAAE,GAAG,EAAE;IACzD,GAAI,EAAO,OAAO,EAAE,MAAM,EAAO,MAAM,GAAG,EAAE;IAC5C,GAAI,EAAO,SAAS,EAAE,QAAQ,EAAO,QAAQ,GAAG,EAAE;IACnD;GACD,YAAY;IAAE;IAAO;IAAQ;GAC9B;EACD,aAAa;EACd,CAAC,EAEa,MAAM,OAAO,SAAS,EAAE,EAAE,KAAK,OAAO;EACnD,IAAI,EAAE;EACN,MAAM,EAAE,QAAQ;EAChB,OAAO,EAAE;EACT,aAAa,EAAE,eAAe,KAAA;EAC9B,MAAO,EAAwB;EAC/B,QAAS,EAA0B;EACnC,UAAU,EAAE;EACb,EAAE,EAEL,CAAC,EAAU,CACZ,EAEK,IAAc,GACjB,GAAe,MAAmD;AAKjE,MAJI,EAAc,WAChB,aAAa,EAAc,QAAQ,EAGjC,CAAC,EAAM,MAAM,IAAI,CAAC,GAAa,QAAQ,CAAC,GAAa,QAAQ;AAC/D,KAAW,EAAE,CAAC;AACd;;AAGF,IAAc,UAAU,WAAW,YAAY;AAE7C,GADA,EAAa,GAAK,EAClB,EAAS,KAAK;AAEd,OAAI;AAEF,MADc,MAAM,EAAS;KAAE,QAAQ,EAAM,MAAM;KAAE,GAAG;KAAa,EAAE,IAAI,EAAE,CAC5D;YACV,GAAK;AAGZ,IAFA,QAAQ,MAAM,sBAAsB,EAAI,EACxC,EAAS,aAAe,QAAQ,EAAI,UAAU,yBAAyB,EACvE,EAAW,EAAE,CAAC;aACN;AACR,MAAa,GAAM;;KAEpB,IAAI;IAET,CAAC,EAAS,CACX,EAEK,IAAgB,EACpB,OAAO,MAA8C;AAEnD,EADA,EAAa,GAAK,EAClB,EAAS,KAAK;AAEd,MAAI;GACF,IACI,IAAS,GACT,IAAU,IACR,IAAmB,EAAE;AAE3B,UAAO,IAAS;IACd,IAAM,IAAO,MAAM,EAAS,GAAQ,KAAU,EAAO;AAGrD,IAFA,EAAS,KAAK,GAAG,EAAK,EACtB,IAAU,EAAK,WAAW,KAC1B,KAAU;;AAGZ,UAAO;WACA,GAAK;AAIZ,UAHA,QAAQ,MAAM,0BAA0B,EAAI,EAE5C,EADgB,aAAe,QAAQ,EAAI,UAAU,wBACpC,EACV,EAAE;YACD;AACR,KAAa,GAAM;;IAGvB,CAAC,EAAS,CACX;AAWD,QARA,cACe;AACX,EAAI,EAAc,WAChB,aAAa,EAAc,QAAQ;IAGtC,EAAE,CAAC,EAEC;EACL;EACA;EACA;EACA;EACA;EACA,oBAAoB,EAAW,EAAE,CAAC;EACnC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification Microfrontend
|
|
3
|
+
*
|
|
4
|
+
* Provides a UI for managing multi-channel notifications,
|
|
5
|
+
* notification history, and notification templates.
|
|
6
|
+
* This is a GLOBAL module that integrates with the global API gateway (gw-global.local.burdenoff.com).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { NotificationRoot, type NotificationRootProps } from '@burdenoff/micro-fe/notification';
|
|
11
|
+
*
|
|
12
|
+
* function App() {
|
|
13
|
+
* const props: NotificationRootProps = {
|
|
14
|
+
* basePath: '/notifications',
|
|
15
|
+
* navigate: (path) => router.push(path),
|
|
16
|
+
* currentUser: { id: '1', email: 'user@example.com' },
|
|
17
|
+
* workspaceId: 'ws-123',
|
|
18
|
+
* apiGatewayUrl: 'https://gw-global.local.burdenoff.com/global/graphql',
|
|
19
|
+
* authToken: 'token',
|
|
20
|
+
* registerNavItems: (items) => { return () => {}; },
|
|
21
|
+
* onNotificationClick: (notification) => console.log('Clicked:', notification),
|
|
22
|
+
* };
|
|
23
|
+
*
|
|
24
|
+
* return <NotificationRoot {...props} />;
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @module @burdenoff/micro-fe/notification
|
|
29
|
+
*/
|
|
30
|
+
export { NotificationRoot } from './NotificationRoot';
|
|
31
|
+
export { UserNotificationRoot } from './UserNotificationRoot';
|
|
32
|
+
export { AdminNotificationRoot } from './AdminNotificationRoot';
|
|
33
|
+
export type { NotificationRootProps, NavItem, FooterItem, Notification, NotificationType, NotificationPriority, NotificationStatus, NotificationChannel, NotificationTemplate, NotificationFilter, } from './types';
|
|
34
|
+
export { useNotifications, useNotificationStore, useNotification } from './hooks';
|
|
35
|
+
export { NotificationBell, NotificationCard, NotificationPanel } from './components';
|
|
36
|
+
export { formatRelativeTime, getPriorityColor, getPriorityIcon, getNotificationTypeLabel, getNotificationTypeIcon, filterNotifications, sortNotificationsByDate, groupNotificationsByDate, truncateText, validateTemplateVariables, substituteTemplateVariables, } from './utils';
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,YAAY,EACV,qBAAqB,EACrB,OAAO,EACP,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAGlF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGrF,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACxB,YAAY,EACZ,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useNotification as e } from "./providers/NotificationProvider.js";
|
|
2
|
+
import { useNotificationStore as t } from "./store/notificationStore.js";
|
|
3
|
+
import { useNotifications as n } from "./hooks/useNotifications.js";
|
|
4
|
+
import "./hooks/index.js";
|
|
5
|
+
import { filterNotifications as r, formatRelativeTime as i, getNotificationTypeIcon as a, getNotificationTypeLabel as o, getPriorityColor as s, getPriorityIcon as c, groupNotificationsByDate as l, sortNotificationsByDate as u, substituteTemplateVariables as d, truncateText as f, validateTemplateVariables as p } from "./utils/index.js";
|
|
6
|
+
import { NotificationCard as m } from "./components/NotificationCard.js";
|
|
7
|
+
import { NotificationRoot as h } from "./NotificationRoot.js";
|
|
8
|
+
import { UserNotificationRoot as g } from "./UserNotificationRoot.js";
|
|
9
|
+
import { AdminNotificationRoot as _ } from "./AdminNotificationRoot.js";
|
|
10
|
+
import { NotificationBell as v } from "./components/NotificationBell.js";
|
|
11
|
+
import { NotificationPanel as y } from "./components/NotificationPanel.js";
|
|
12
|
+
import "./components/index.js";
|
|
13
|
+
export { _ as AdminNotificationRoot, v as NotificationBell, m as NotificationCard, y as NotificationPanel, h as NotificationRoot, g as UserNotificationRoot, r as filterNotifications, i as formatRelativeTime, a as getNotificationTypeIcon, o as getNotificationTypeLabel, s as getPriorityColor, c as getPriorityIcon, l as groupNotificationsByDate, u as sortNotificationsByDate, d as substituteTemplateVariables, f as truncateText, e as useNotification, t as useNotificationStore, n as useNotifications, p as validateTemplateVariables };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateNotificationPage.d.ts","sourceRoot":"","sources":["../../src/pages/CreateNotificationPage.tsx"],"names":[],"mappings":"AAmGA;;;GAGG;AACH,wBAAgB,sBAAsB,4CA+/CrC"}
|