@burdenoff/microfe-notification 2026.1029.2 → 2026.1113.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/dist/AdminNotificationRoot.d.ts +33 -0
- package/dist/AdminNotificationRoot.js +9 -6
- package/dist/AdminNotificationRoot.js.map +1 -1
- package/dist/AdminNotificationRoutes.d.ts +1 -0
- package/dist/AdminNotificationRoutes.js +22 -23
- package/dist/AdminNotificationRoutes.js.map +1 -1
- package/dist/NotificationRoot.d.ts +29 -0
- package/dist/NotificationRoot.js +9 -6
- package/dist/NotificationRoot.js.map +1 -1
- package/dist/NotificationRoutes.d.ts +18 -0
- package/dist/NotificationRoutes.js +109 -38
- package/dist/NotificationRoutes.js.map +1 -1
- package/dist/UserNotificationRoot.d.ts +32 -0
- package/dist/UserNotificationRoot.js +9 -6
- package/dist/UserNotificationRoot.js.map +1 -1
- package/dist/UserNotificationRoutes.d.ts +16 -0
- package/dist/UserNotificationRoutes.js +9 -10
- package/dist/UserNotificationRoutes.js.map +1 -1
- package/dist/components/ConfirmDeleteDialog.d.ts +17 -0
- package/dist/components/ConfirmDeleteDialog.js +22 -0
- package/dist/components/ConfirmDeleteDialog.js.map +1 -0
- package/dist/components/FeatureDisabledPage.d.ts +6 -0
- package/dist/components/FeatureDisabledPage.js +1 -2
- package/dist/components/FeatureDisabledPage.js.map +1 -1
- package/dist/components/NotificationBell.d.ts +13 -0
- package/dist/components/NotificationBell.js +6 -7
- package/dist/components/NotificationBell.js.map +1 -1
- package/dist/components/NotificationCard.d.ts +27 -0
- package/dist/components/NotificationCard.js +106 -76
- package/dist/components/NotificationCard.js.map +1 -1
- package/dist/components/NotificationPanel.d.ts +10 -0
- package/dist/components/NotificationPanel.js +5 -6
- package/dist/components/NotificationPanel.js.map +1 -1
- package/dist/components/RecipientSelector.d.ts +32 -0
- package/dist/components/RecipientSelector.js +2 -3
- package/dist/components/RecipientSelector.js.map +1 -1
- package/dist/components/TemplatePreview.d.ts +21 -0
- package/dist/components/TemplatePreview.js +3 -4
- package/dist/components/TemplatePreview.js.map +1 -1
- package/dist/components/VariableInserter.d.ts +11 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +4 -3
- package/dist/constants/permissions.d.ts +23 -0
- package/dist/constants/permissions.js +1 -2
- package/dist/constants/permissions.js.map +1 -1
- package/dist/dev/main.d.ts +0 -0
- package/dist/generated/global-operations.d.ts +2119 -0
- package/dist/generated/global-operations.js +80 -69
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +23507 -0
- package/dist/generated/wspace-operations.d.ts +4 -0
- package/dist/generated/wspace-types.d.ts +57831 -0
- package/dist/graphql/global-client.d.ts +32 -0
- package/dist/graphql/global-client.js +23 -30
- package/dist/graphql/global-client.js.map +1 -1
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +7 -6
- package/dist/hooks/useNotificationAdmin.d.ts +46 -0
- package/dist/hooks/useNotificationAdmin.js +18 -17
- package/dist/hooks/useNotificationAdmin.js.map +1 -1
- package/dist/hooks/useNotificationAnalytics.d.ts +65 -0
- package/dist/hooks/useNotificationAnalytics.js +1 -2
- package/dist/hooks/useNotificationAnalytics.js.map +1 -1
- package/dist/hooks/useNotificationPreferences.d.ts +10 -0
- package/dist/hooks/useNotificationPreferences.js +7 -7
- package/dist/hooks/useNotificationPreferences.js.map +1 -1
- package/dist/hooks/useNotificationTemplates.d.ts +131 -0
- package/dist/hooks/useNotificationTemplates.js +1 -2
- package/dist/hooks/useNotificationTemplates.js.map +1 -1
- package/dist/hooks/useNotificationTopics.d.ts +35 -0
- package/dist/hooks/useNotificationTopics.js +22 -22
- package/dist/hooks/useNotificationTopics.js.map +1 -1
- package/dist/hooks/useNotifications.d.ts +39 -0
- package/dist/hooks/useNotifications.js +6 -4
- package/dist/hooks/useNotifications.js.map +1 -1
- package/dist/hooks/usePreferenceToggles.d.ts +27 -0
- package/dist/hooks/usePreferenceToggles.js +84 -0
- package/dist/hooks/usePreferenceToggles.js.map +1 -0
- package/dist/hooks/useSendNotification.d.ts +158 -0
- package/dist/hooks/useSendNotification.js +12 -10
- package/dist/hooks/useSendNotification.js.map +1 -1
- package/dist/hooks/useUserSearch.d.ts +26 -0
- package/dist/hooks/useUserSearch.js +8 -10
- package/dist/hooks/useUserSearch.js.map +1 -1
- package/dist/index.d.ts +36 -0
- package/dist/index.js +8 -8
- package/dist/navigation-v2/AdminPageV2.d.ts +14 -0
- package/dist/navigation-v2/AdminPageV2.js +51 -0
- package/dist/navigation-v2/AdminPageV2.js.map +1 -0
- package/dist/navigation-v2/AdminToolsMenu.d.ts +6 -0
- package/dist/navigation-v2/AdminToolsMenu.js +32 -0
- package/dist/navigation-v2/AdminToolsMenu.js.map +1 -0
- package/dist/navigation-v2/BackToNotifications.d.ts +2 -0
- package/dist/navigation-v2/BackToNotifications.js +20 -0
- package/dist/navigation-v2/BackToNotifications.js.map +1 -0
- package/dist/navigation-v2/FilterControls.d.ts +25 -0
- package/dist/navigation-v2/FilterControls.js +64 -0
- package/dist/navigation-v2/FilterControls.js.map +1 -0
- package/dist/navigation-v2/NotificationArchivedV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationArchivedV2.js +174 -0
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -0
- package/dist/navigation-v2/NotificationInboxV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationInboxV2.js +309 -0
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -0
- package/dist/navigation-v2/NotificationSettingsV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationSettingsV2.js +203 -0
- package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -0
- package/dist/navigation-v2/NotificationsV2Landing.d.ts +9 -0
- package/dist/navigation-v2/NotificationsV2Landing.js +37 -0
- package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -0
- package/dist/navigation-v2/__tests__/uiMocks.d.ts +71 -0
- package/dist/navigation-v2/inboxFilters.d.ts +8 -0
- package/dist/navigation-v2/inboxFilters.js +10 -0
- package/dist/navigation-v2/inboxFilters.js.map +1 -0
- package/dist/navigation-v2/paths.d.ts +24 -0
- package/dist/navigation-v2/paths.js +31 -0
- package/dist/navigation-v2/paths.js.map +1 -0
- package/dist/navigation-v2/settingsOptions.d.ts +12 -0
- package/dist/navigation-v2/settingsOptions.js +58 -0
- package/dist/navigation-v2/settingsOptions.js.map +1 -0
- package/dist/navigation-v2/useAdminTools.d.ts +22 -0
- package/dist/navigation-v2/useAdminTools.js +76 -0
- package/dist/navigation-v2/useAdminTools.js.map +1 -0
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +1 -2
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -1
- package/dist/node_modules/@apollo/client/errors/utils.js +1 -2
- package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +7 -8
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js +9 -10
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js +5 -6
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js +4 -5
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +2 -3
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js +2 -3
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -1
- package/dist/node_modules/@apollo/client/version.js +2 -3
- package/dist/node_modules/@apollo/client/version.js.map +1 -1
- package/dist/node_modules/@wry/caches/lib/weak.js +1 -2
- package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -1
- package/dist/node_modules/@wry/trie/lib/index.js +2 -3
- package/dist/node_modules/@wry/trie/lib/index.js.map +1 -1
- package/dist/node_modules/graphql-ws/dist/client.js +76 -69
- package/dist/node_modules/graphql-ws/dist/client.js.map +1 -1
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +2 -3
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +2 -3
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +41 -42
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +14 -15
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +21 -18
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +2 -3
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -1
- package/dist/node_modules/{rxjs/node_modules/tslib → tslib}/tslib.es6.js +1 -2
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/pages/CreateNotificationPage.d.ts +5 -0
- package/dist/pages/CreateNotificationPage.js +591 -573
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.d.ts +8 -0
- package/dist/pages/NotificationCenterPage.js +87 -83
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryAdminPage.d.ts +2 -0
- package/dist/pages/NotificationHistoryAdminPage.js +7 -8
- package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.d.ts +6 -0
- package/dist/pages/NotificationHistoryPage.js +59 -55
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationLandingPage.d.ts +10 -0
- package/dist/pages/NotificationLandingPage.js +5 -6
- package/dist/pages/NotificationLandingPage.js.map +1 -1
- package/dist/pages/NotificationPreferencesPage.d.ts +5 -0
- package/dist/pages/NotificationPreferencesPage.js +97 -159
- package/dist/pages/NotificationPreferencesPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.d.ts +7 -0
- package/dist/pages/NotificationTemplatesPage.js +192 -172
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.d.ts +1 -0
- package/dist/pages/NotificationTopicsPage.js +126 -112
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.d.ts +12 -0
- package/dist/pages/TemplateEditorPage.js +381 -341
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/dist/providers/NotificationProvider.d.ts +11 -0
- package/dist/providers/NotificationProvider.js +7 -7
- package/dist/providers/NotificationProvider.js.map +1 -1
- package/dist/shared/hooks/useTr.d.ts +13 -0
- package/dist/shared/hooks/useTr.js +1 -2
- package/dist/shared/hooks/useTr.js.map +1 -1
- package/dist/store/notificationStore.d.ts +30 -0
- package/dist/store/notificationStore.js +1 -2
- package/dist/store/notificationStore.js.map +1 -1
- package/dist/test/happydom.d.ts +1 -0
- package/dist/translations/en.d.ts +468 -0
- package/dist/types/index.d.ts +257 -0
- package/dist/utils/inAppNavigation.d.ts +37 -0
- package/dist/utils/inAppNavigation.js +2 -3
- package/dist/utils/inAppNavigation.js.map +1 -1
- package/dist/utils/index.d.ts +68 -0
- package/dist/utils/index.js +1 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +2 -0
- package/dist/utils/nativeBridge.js +1 -2
- package/dist/utils/notificationHistoryExport.d.ts +12 -0
- package/dist/utils/notificationHistoryExport.js +1 -2
- package/dist/utils/notificationHistoryExport.js.map +1 -1
- package/package.json +67 -49
- package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +0 -1
|
@@ -1,73 +1,144 @@
|
|
|
1
1
|
import { useNotification as e } from "./providers/NotificationProvider.js";
|
|
2
2
|
import { NotificationCenterPage as t } from "./pages/NotificationCenterPage.js";
|
|
3
3
|
import { NotificationLandingPage as n } from "./pages/NotificationLandingPage.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { AdminPageV2 as r } from "./navigation-v2/AdminPageV2.js";
|
|
5
|
+
import { NotificationsV2Landing as i } from "./navigation-v2/NotificationsV2Landing.js";
|
|
6
|
+
import { Suspense as a, lazy as o } from "react";
|
|
7
|
+
import { Navigate as s, Route as c, Routes as l } from "react-router";
|
|
8
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
|
+
// src/NotificationRoutes.tsx
|
|
10
|
+
var f = o(() => import("./pages/NotificationHistoryPage.js").then((e) => ({ default: e.NotificationHistoryPage }))), p = o(() => import("./pages/NotificationTemplatesPage.js").then((e) => ({ default: e.NotificationTemplatesPage }))), m = o(() => import("./pages/TemplateEditorPage.js").then((e) => ({ default: e.TemplateEditorPage }))), h = o(() => import("./pages/CreateNotificationPage.js").then((e) => ({ default: e.CreateNotificationPage }))), g = o(() => import("./pages/NotificationTopicsPage.js").then((e) => ({ default: e.NotificationTopicsPage }))), _ = o(() => import("./pages/NotificationPreferencesPage.js").then((e) => ({ default: e.NotificationPreferencesPage })));
|
|
11
|
+
function v() {
|
|
12
|
+
return /* @__PURE__ */ u("div", {
|
|
11
13
|
className: "flex h-64 items-center justify-center",
|
|
12
|
-
children: /* @__PURE__ */
|
|
14
|
+
children: /* @__PURE__ */ u("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
13
15
|
});
|
|
14
16
|
}
|
|
15
|
-
function
|
|
16
|
-
let { basePath:
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
fallback: /* @__PURE__ */
|
|
19
|
-
children: /* @__PURE__ */ l
|
|
20
|
-
/* @__PURE__ */ c
|
|
17
|
+
function y() {
|
|
18
|
+
let { basePath: r = "/", navigationV2: i } = e(), o = `${r.endsWith("/") ? r.slice(0, -1) : r}/center`;
|
|
19
|
+
return i ? /* @__PURE__ */ u(b, { centerPath: o }) : /* @__PURE__ */ u(a, {
|
|
20
|
+
fallback: /* @__PURE__ */ u(v, {}),
|
|
21
|
+
children: /* @__PURE__ */ d(l, { children: [
|
|
22
|
+
/* @__PURE__ */ u(c, {
|
|
21
23
|
index: !0,
|
|
22
|
-
element: /* @__PURE__ */
|
|
24
|
+
element: /* @__PURE__ */ u(n, {})
|
|
23
25
|
}),
|
|
24
|
-
/* @__PURE__ */ c
|
|
26
|
+
/* @__PURE__ */ u(c, {
|
|
25
27
|
path: "list",
|
|
26
|
-
element: /* @__PURE__ */
|
|
28
|
+
element: /* @__PURE__ */ u(t, {})
|
|
27
29
|
}),
|
|
28
|
-
/* @__PURE__ */ c
|
|
30
|
+
/* @__PURE__ */ u(c, {
|
|
29
31
|
path: "center",
|
|
30
|
-
element: /* @__PURE__ */
|
|
32
|
+
element: /* @__PURE__ */ u(t, {})
|
|
31
33
|
}),
|
|
32
|
-
/* @__PURE__ */ c
|
|
34
|
+
/* @__PURE__ */ u(c, {
|
|
33
35
|
path: "history",
|
|
34
|
-
element: /* @__PURE__ */
|
|
36
|
+
element: /* @__PURE__ */ u(f, {})
|
|
35
37
|
}),
|
|
36
|
-
/* @__PURE__ */ c
|
|
38
|
+
/* @__PURE__ */ u(c, {
|
|
37
39
|
path: "templates",
|
|
38
|
-
element: /* @__PURE__ */
|
|
40
|
+
element: /* @__PURE__ */ u(p, {})
|
|
39
41
|
}),
|
|
40
|
-
/* @__PURE__ */ c
|
|
42
|
+
/* @__PURE__ */ u(c, {
|
|
41
43
|
path: "templates/new",
|
|
42
|
-
element: /* @__PURE__ */
|
|
44
|
+
element: /* @__PURE__ */ u(m, {})
|
|
43
45
|
}),
|
|
44
|
-
/* @__PURE__ */ c
|
|
46
|
+
/* @__PURE__ */ u(c, {
|
|
45
47
|
path: "templates/:templateId",
|
|
46
|
-
element: /* @__PURE__ */
|
|
48
|
+
element: /* @__PURE__ */ u(m, {})
|
|
47
49
|
}),
|
|
48
|
-
/* @__PURE__ */ c
|
|
50
|
+
/* @__PURE__ */ u(c, {
|
|
49
51
|
path: "create",
|
|
50
|
-
element: /* @__PURE__ */
|
|
52
|
+
element: /* @__PURE__ */ u(h, {})
|
|
51
53
|
}),
|
|
52
|
-
/* @__PURE__ */ c
|
|
54
|
+
/* @__PURE__ */ u(c, {
|
|
53
55
|
path: "topics",
|
|
54
|
-
element: /* @__PURE__ */
|
|
56
|
+
element: /* @__PURE__ */ u(g, {})
|
|
55
57
|
}),
|
|
56
|
-
/* @__PURE__ */ c
|
|
58
|
+
/* @__PURE__ */ u(c, {
|
|
57
59
|
path: "preferences",
|
|
58
|
-
element: /* @__PURE__ */
|
|
60
|
+
element: /* @__PURE__ */ u(_, {})
|
|
59
61
|
}),
|
|
60
|
-
/* @__PURE__ */ c
|
|
62
|
+
/* @__PURE__ */ u(c, {
|
|
61
63
|
path: "*",
|
|
62
|
-
element: /* @__PURE__ */
|
|
63
|
-
to:
|
|
64
|
+
element: /* @__PURE__ */ u(s, {
|
|
65
|
+
to: o,
|
|
64
66
|
replace: !0
|
|
65
67
|
})
|
|
66
68
|
})
|
|
67
69
|
] })
|
|
68
70
|
});
|
|
69
71
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
function b({ centerPath: e }) {
|
|
73
|
+
return /* @__PURE__ */ u(a, {
|
|
74
|
+
fallback: /* @__PURE__ */ u(v, {}),
|
|
75
|
+
children: /* @__PURE__ */ d(l, { children: [
|
|
76
|
+
/* @__PURE__ */ u(c, {
|
|
77
|
+
index: !0,
|
|
78
|
+
element: /* @__PURE__ */ u(i, {})
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ u(c, {
|
|
81
|
+
path: "list",
|
|
82
|
+
element: /* @__PURE__ */ u(t, {})
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ u(c, {
|
|
85
|
+
path: "center",
|
|
86
|
+
element: /* @__PURE__ */ u(t, {})
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ u(c, {
|
|
89
|
+
path: "history",
|
|
90
|
+
element: /* @__PURE__ */ u(f, {})
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ u(c, {
|
|
93
|
+
path: "preferences",
|
|
94
|
+
element: /* @__PURE__ */ u(_, {})
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ u(c, {
|
|
97
|
+
path: "templates",
|
|
98
|
+
element: /* @__PURE__ */ u(r, {
|
|
99
|
+
tool: "templates",
|
|
100
|
+
children: /* @__PURE__ */ u(p, {})
|
|
101
|
+
})
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ u(c, {
|
|
104
|
+
path: "templates/new",
|
|
105
|
+
element: /* @__PURE__ */ u(r, {
|
|
106
|
+
tool: "templates",
|
|
107
|
+
children: /* @__PURE__ */ u(m, {})
|
|
108
|
+
})
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ u(c, {
|
|
111
|
+
path: "templates/:templateId",
|
|
112
|
+
element: /* @__PURE__ */ u(r, {
|
|
113
|
+
tool: "templates",
|
|
114
|
+
children: /* @__PURE__ */ u(m, {})
|
|
115
|
+
})
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ u(c, {
|
|
118
|
+
path: "create",
|
|
119
|
+
element: /* @__PURE__ */ u(r, {
|
|
120
|
+
tool: "send",
|
|
121
|
+
back: !1,
|
|
122
|
+
children: /* @__PURE__ */ u(h, {})
|
|
123
|
+
})
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ u(c, {
|
|
126
|
+
path: "topics",
|
|
127
|
+
element: /* @__PURE__ */ u(r, {
|
|
128
|
+
tool: "topics",
|
|
129
|
+
children: /* @__PURE__ */ u(g, {})
|
|
130
|
+
})
|
|
131
|
+
}),
|
|
132
|
+
/* @__PURE__ */ u(c, {
|
|
133
|
+
path: "*",
|
|
134
|
+
element: /* @__PURE__ */ u(s, {
|
|
135
|
+
to: e,
|
|
136
|
+
replace: !0
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
] })
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
export { y as NotificationRoutes };
|
|
72
143
|
|
|
73
144
|
//# sourceMappingURL=NotificationRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationRoutes.js","names":[],"sources":["../src/NotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { useNotification } from './providers/NotificationProvider';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\nimport { NotificationLandingPage } from './pages/NotificationLandingPage';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryPage = lazy(() =>\n import('./pages/NotificationHistoryPage').then((m) => ({\n default: m.NotificationHistoryPage,\n }))\n);\nconst NotificationTemplatesPage = lazy(() =>\n import('./pages/NotificationTemplatesPage').then((m) => ({\n default: m.NotificationTemplatesPage,\n }))\n);\nconst TemplateEditorPage = lazy(() =>\n import('./pages/TemplateEditorPage').then((m) => ({ default: m.TemplateEditorPage }))\n);\nconst CreateNotificationPage = lazy(() =>\n import('./pages/CreateNotificationPage').then((m) => ({ default: m.CreateNotificationPage }))\n);\nconst NotificationTopicsPage = lazy(() =>\n import('./pages/NotificationTopicsPage').then((m) => ({ default: m.NotificationTopicsPage }))\n);\nconst NotificationPreferencesPage = lazy(() =>\n import('./pages/NotificationPreferencesPage').then((m) => ({\n default: m.NotificationPreferencesPage,\n }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * Internal router for the Notification microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Routes:\n * - / → Notification landing page\n * - /list → Notification center (canonical list alias used by shell nav homePath)\n * - /center → Notification center (in-app notifications)\n * - /history → Notification history and archive\n * - /templates → Notification templates list (admin)\n * - /templates/new → Create new template (admin)\n * - /templates/:templateId → Edit template (admin)\n * - /create → Create and send notification (admin)\n * - /topics → Manage topics (admin)\n * - /preferences → User topic preferences\n * - unmatched → Absolute redirect to /{basePath}/center (avoids relative redirect loops)\n */\nexport function NotificationRoutes() {\n const { basePath = '/' } = useNotification();\n const centerPath = `${basePath.endsWith('/') ? basePath.slice(0, -1) : basePath}/center`;\n\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Tabbed landing - default route */}\n <Route index element={<NotificationLandingPage />} />\n\n {/* Canonical list alias used by product-shell nav homePath */}\n <Route path=\"list\" element={<NotificationCenterPage />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route path=\"history\" element={<NotificationHistoryPage />} />\n\n {/* Admin routes - Templates */}\n <Route path=\"templates\" element={<NotificationTemplatesPage />} />\n <Route path=\"templates/new\" element={<TemplateEditorPage />} />\n <Route path=\"templates/:templateId\" element={<TemplateEditorPage />} />\n\n {/* Admin routes - Create/Send Notification */}\n <Route path=\"create\" element={<CreateNotificationPage />} />\n <Route path=\"topics\" element={<NotificationTopicsPage />} />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n\n {/* Catch-all route - absolute redirect so an unmatched path like /list\n cannot recursively append /center (e.g. /list/center/center/...) */}\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"NotificationRoutes.js","names":["NotificationHistoryPage","lazy","m","NotificationTemplatesPage","TemplateEditorPage","CreateNotificationPage","NotificationTopicsPage","NotificationPreferencesPage","PageLoader","NotificationRoutes","useNotification","centerPath","basePath","navigationV2","NavigationV2Routes","Suspense","Routes","Route","NotificationLandingPage","NotificationCenterPage","Navigate","NotificationsV2Landing","AdminPageV2"],"sources":["../src/NotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { useNotification } from './providers/NotificationProvider';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\nimport { NotificationLandingPage } from './pages/NotificationLandingPage';\nimport { AdminPageV2 } from './navigation-v2/AdminPageV2';\nimport { NotificationsV2Landing } from './navigation-v2/NotificationsV2Landing';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryPage = lazy(() =>\n import('./pages/NotificationHistoryPage').then((m) => ({\n default: m.NotificationHistoryPage,\n }))\n);\nconst NotificationTemplatesPage = lazy(() =>\n import('./pages/NotificationTemplatesPage').then((m) => ({\n default: m.NotificationTemplatesPage,\n }))\n);\nconst TemplateEditorPage = lazy(() =>\n import('./pages/TemplateEditorPage').then((m) => ({ default: m.TemplateEditorPage }))\n);\nconst CreateNotificationPage = lazy(() =>\n import('./pages/CreateNotificationPage').then((m) => ({ default: m.CreateNotificationPage }))\n);\nconst NotificationTopicsPage = lazy(() =>\n import('./pages/NotificationTopicsPage').then((m) => ({ default: m.NotificationTopicsPage }))\n);\nconst NotificationPreferencesPage = lazy(() =>\n import('./pages/NotificationPreferencesPage').then((m) => ({\n default: m.NotificationPreferencesPage,\n }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * Internal router for the Notification microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Routes:\n * - / → Notification landing page\n * - /list → Notification center (canonical list alias used by shell nav homePath)\n * - /center → Notification center (in-app notifications)\n * - /history → Notification history and archive\n * - /templates → Notification templates list (admin)\n * - /templates/new → Create new template (admin)\n * - /templates/:templateId → Edit template (admin)\n * - /create → Create and send notification (admin)\n * - /topics → Manage topics (admin)\n * - /preferences → User topic preferences\n * - unmatched → Absolute redirect to /{basePath}/center (avoids relative redirect loops)\n */\nexport function NotificationRoutes() {\n const { basePath = '/', navigationV2 } = useNotification();\n const centerPath = `${basePath.endsWith('/') ? basePath.slice(0, -1) : basePath}/center`;\n\n if (navigationV2) return <NavigationV2Routes centerPath={centerPath} />;\n\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Tabbed landing - default route */}\n <Route index element={<NotificationLandingPage />} />\n\n {/* Canonical list alias used by product-shell nav homePath */}\n <Route path=\"list\" element={<NotificationCenterPage />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route path=\"history\" element={<NotificationHistoryPage />} />\n\n {/* Admin routes - Templates */}\n <Route path=\"templates\" element={<NotificationTemplatesPage />} />\n <Route path=\"templates/new\" element={<TemplateEditorPage />} />\n <Route path=\"templates/:templateId\" element={<TemplateEditorPage />} />\n\n {/* Admin routes - Create/Send Notification */}\n <Route path=\"create\" element={<CreateNotificationPage />} />\n <Route path=\"topics\" element={<NotificationTopicsPage />} />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n\n {/* Catch-all route - absolute redirect so an unmatched path like /list\n cannot recursively append /center (e.g. /list/center/center/...) */}\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n\n/**\n * FluidGrids' Navigation v2 routes (BOFF-11872). Every URL of the classic\n * routes keeps working: `/` opens straight on the inbox (old `?tab=` values\n * still open their page), and the admin pages get a route-level permission\n * gate and a way back to the inbox.\n */\nfunction NavigationV2Routes({ centerPath }: { centerPath: string }) {\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<NotificationsV2Landing />} />\n <Route path=\"list\" element={<NotificationCenterPage />} />\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route path=\"history\" element={<NotificationHistoryPage />} />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n <Route\n path=\"templates\"\n element={\n <AdminPageV2 tool=\"templates\">\n <NotificationTemplatesPage />\n </AdminPageV2>\n }\n />\n <Route\n path=\"templates/new\"\n element={\n <AdminPageV2 tool=\"templates\">\n <TemplateEditorPage />\n </AdminPageV2>\n }\n />\n <Route\n path=\"templates/:templateId\"\n element={\n <AdminPageV2 tool=\"templates\">\n <TemplateEditorPage />\n </AdminPageV2>\n }\n />\n <Route\n path=\"create\"\n element={\n <AdminPageV2 tool=\"send\" back={false}>\n <CreateNotificationPage />\n </AdminPageV2>\n }\n />\n <Route\n path=\"topics\"\n element={\n <AdminPageV2 tool=\"topics\">\n <NotificationTopicsPage />\n </AdminPageV2>\n }\n />\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;;AAWA,IAAMA,IAA0BC,QAC9B,OAAO,qCAAkC,CAAC,MAAM,OAAO,EACrD,SAASC,EAAE,wBACb,EAAE,CACJ,GACMC,IAA4BF,QAChC,OAAO,uCAAoC,CAAC,MAAM,OAAO,EACvD,SAASC,EAAE,0BACb,EAAE,CACJ,GACME,IAAqBH,QACzB,OAAO,gCAA6B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,mBAAmB,EAAE,CACtF,GACMG,IAAyBJ,QAC7B,OAAO,oCAAiC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,uBAAuB,EAAE,CAC9F,GACMI,IAAyBL,QAC7B,OAAO,oCAAiC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,uBAAuB,EAAE,CAC9F,GACMK,IAA8BN,QAClC,OAAO,yCAAsC,CAAC,MAAM,OAAO,EACzD,SAASC,EAAE,4BACb,EAAE,CACJ;AAGA,SAASM,IAAa;CACpB,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA;AAET;AAmBA,SAAgBC,IAAqB;CACnC,IAAM,EAAE,cAAW,KAAK,oBAAiBC,EAAgB,GACnDC,IAAa,GAAGC,EAAS,SAAS,GAAG,IAAIA,EAAS,MAAM,GAAG,EAAE,IAAIA,EAAS;CAIhF,OAFIC,IAAqB,kBAACC,GAAD,EAAgC,cAAa,CAAA,IAGpE,kBAACC,GAAD;EAAU,UAAU,kBAACP,GAAD,CAAa,CAAA;EAC/B,UAAA,kBAACQ,GAAD,EAAA,UAAA;GAEE,kBAACC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAACC,GAAD,CAA0B,CAAA;GAAI,CAAA;GAGpD,kBAACD,GAAD;IAAO,MAAK;IAAO,SAAS,kBAACE,GAAD,CAAyB,CAAA;GAAI,CAAA;GAGzD,kBAACF,GAAD;IAAO,MAAK;IAAS,SAAS,kBAACE,GAAD,CAAyB,CAAA;GAAI,CAAA;GAC3D,kBAACF,GAAD;IAAO,MAAK;IAAU,SAAS,kBAACjB,GAAD,CAA0B,CAAA;GAAI,CAAA;GAG7D,kBAACiB,GAAD;IAAO,MAAK;IAAY,SAAS,kBAACd,GAAD,CAA4B,CAAA;GAAI,CAAA;GACjE,kBAACc,GAAD;IAAO,MAAK;IAAgB,SAAS,kBAACb,GAAD,CAAqB,CAAA;GAAI,CAAA;GAC9D,kBAACa,GAAD;IAAO,MAAK;IAAwB,SAAS,kBAACb,GAAD,CAAqB,CAAA;GAAI,CAAA;GAGtE,kBAACa,GAAD;IAAO,MAAK;IAAS,SAAS,kBAACZ,GAAD,CAAyB,CAAA;GAAI,CAAA;GAC3D,kBAACY,GAAD;IAAO,MAAK;IAAS,SAAS,kBAACX,GAAD,CAAyB,CAAA;GAAI,CAAA;GAC3D,kBAACW,GAAD;IAAO,MAAK;IAAc,SAAS,kBAACV,GAAD,CAA8B,CAAA;GAAI,CAAA;GAIrE,kBAACU,GAAD;IAAO,MAAK;IAAI,SAAS,kBAACG,GAAD;KAAU,IAAIT;KAAY,SAAA;IAAS,CAAA;GAAI,CAAA;EAC1D,EAAA,CAAA;CACA,CAAA;AAEd;AAQA,SAASG,EAAmB,EAAE,iBAAsC;CAClE,OACE,kBAACC,GAAD;EAAU,UAAU,kBAACP,GAAD,CAAa,CAAA;EAC/B,UAAA,kBAACQ,GAAD,EAAA,UAAA;GACE,kBAACC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAACI,GAAD,CAAyB,CAAA;GAAI,CAAA;GACnD,kBAACJ,GAAD;IAAO,MAAK;IAAO,SAAS,kBAACE,GAAD,CAAyB,CAAA;GAAI,CAAA;GACzD,kBAACF,GAAD;IAAO,MAAK;IAAS,SAAS,kBAACE,GAAD,CAAyB,CAAA;GAAI,CAAA;GAC3D,kBAACF,GAAD;IAAO,MAAK;IAAU,SAAS,kBAACjB,GAAD,CAA0B,CAAA;GAAI,CAAA;GAC7D,kBAACiB,GAAD;IAAO,MAAK;IAAc,SAAS,kBAACV,GAAD,CAA8B,CAAA;GAAI,CAAA;GACrE,kBAACU,GAAD;IACE,MAAK;IACL,SACE,kBAACK,GAAD;KAAa,MAAK;KAChB,UAAA,kBAACnB,GAAD,CAA4B,CAAA;IACjB,CAAA;GAEhB,CAAA;GACD,kBAACc,GAAD;IACE,MAAK;IACL,SACE,kBAACK,GAAD;KAAa,MAAK;KAChB,UAAA,kBAAClB,GAAD,CAAqB,CAAA;IACV,CAAA;GAEhB,CAAA;GACD,kBAACa,GAAD;IACE,MAAK;IACL,SACE,kBAACK,GAAD;KAAa,MAAK;KAChB,UAAA,kBAAClB,GAAD,CAAqB,CAAA;IACV,CAAA;GAEhB,CAAA;GACD,kBAACa,GAAD;IACE,MAAK;IACL,SACE,kBAACK,GAAD;KAAa,MAAK;KAAO,MAAM;KAC7B,UAAA,kBAACjB,GAAD,CAAyB,CAAA;IACd,CAAA;GAEhB,CAAA;GACD,kBAACY,GAAD;IACE,MAAK;IACL,SACE,kBAACK,GAAD;KAAa,MAAK;KAChB,UAAA,kBAAChB,GAAD,CAAyB,CAAA;IACd,CAAA;GAEhB,CAAA;GACD,kBAACW,GAAD;IAAO,MAAK;IAAI,SAAS,kBAACG,GAAD;KAAU,IAAIT;KAAY,SAAA;IAAS,CAAA;GAAI,CAAA;EAC1D,EAAA,CAAA;CACA,CAAA;AAEd"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { NotificationRootProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* User Root component for the Notification microfrontend.
|
|
4
|
+
*
|
|
5
|
+
* This is the entry point host product shells should import. It exposes only
|
|
6
|
+
* the user-facing notification surfaces (Notification Center, History) and
|
|
7
|
+
* sets up the required provider stack.
|
|
8
|
+
*
|
|
9
|
+
* For the full admin experience (templates, create/send notification) use
|
|
10
|
+
* `AdminNotificationRoot` instead.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* import { UserNotificationRoot, type NotificationRootProps } from '@burdenoff/micro-fe/notification';
|
|
15
|
+
*
|
|
16
|
+
* function App() {
|
|
17
|
+
* const props: NotificationRootProps = {
|
|
18
|
+
* basePath: '/notifications',
|
|
19
|
+
* navigate: (path) => router.push(path),
|
|
20
|
+
* currentUser: { id: '1', email: 'user@example.com' },
|
|
21
|
+
* workspaceId: 'ws-123',
|
|
22
|
+
* apiGatewayUrl: 'https://api.example.com',
|
|
23
|
+
* authToken: 'token',
|
|
24
|
+
* registerNavItems: (items) => { return () => {}; },
|
|
25
|
+
* onNotificationClick: (notification) => console.log('Clicked:', notification),
|
|
26
|
+
* };
|
|
27
|
+
*
|
|
28
|
+
* return <UserNotificationRoot {...props} />;
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function UserNotificationRoot(props: NotificationRootProps): import('react').JSX.Element;
|
|
@@ -6,14 +6,15 @@ import { useFeatureFlagDetails as i } from "@burdenoff/fe-libs/shared/feature-fl
|
|
|
6
6
|
import { useI18n as a } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
7
7
|
import { Archive as o, Bell as s, Settings2 as c } from "lucide-react";
|
|
8
8
|
import { jsx as l } from "react/jsx-runtime";
|
|
9
|
-
|
|
9
|
+
// src/UserNotificationRoot.tsx
|
|
10
10
|
function u(u) {
|
|
11
11
|
let { registerNavItems: d, registerFooterItems: f, basePath: p = "/" } = u, { t: m } = a(), h = (e, t) => {
|
|
12
12
|
let n = m(e);
|
|
13
13
|
return n === e ? t : n;
|
|
14
14
|
}, g = i("notification.history"), _ = g ? !!g.value : !1, v = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
15
15
|
return n(() => {
|
|
16
|
-
if (d) return
|
|
16
|
+
if (!d) return;
|
|
17
|
+
let e = [
|
|
17
18
|
{
|
|
18
19
|
id: "user-notification-center",
|
|
19
20
|
label: h("notification.nav.center", "Notification Center"),
|
|
@@ -38,20 +39,23 @@ function u(u) {
|
|
|
38
39
|
order: 30,
|
|
39
40
|
group: "notifications"
|
|
40
41
|
}
|
|
41
|
-
]
|
|
42
|
+
];
|
|
43
|
+
return d(e);
|
|
42
44
|
}, [
|
|
43
45
|
d,
|
|
44
46
|
p,
|
|
45
47
|
_,
|
|
46
48
|
m
|
|
47
49
|
]), n(() => {
|
|
48
|
-
if (f) return
|
|
50
|
+
if (!f) return;
|
|
51
|
+
let e = [{
|
|
49
52
|
id: "user-notification-status",
|
|
50
53
|
label: h("notification.footer.ready", "Notifications Ready"),
|
|
51
54
|
type: "status",
|
|
52
55
|
order: 10,
|
|
53
56
|
section: "left"
|
|
54
|
-
}]
|
|
57
|
+
}];
|
|
58
|
+
return f(e);
|
|
55
59
|
}, [f, m]), /* @__PURE__ */ l(r, {
|
|
56
60
|
fallback: /* @__PURE__ */ l("div", {
|
|
57
61
|
className: "p-6 text-center text-text-secondary",
|
|
@@ -63,7 +67,6 @@ function u(u) {
|
|
|
63
67
|
})
|
|
64
68
|
});
|
|
65
69
|
}
|
|
66
|
-
//#endregion
|
|
67
70
|
export { u as UserNotificationRoot };
|
|
68
71
|
|
|
69
72
|
//# sourceMappingURL=UserNotificationRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserNotificationRoot.js","names":[],"sources":["../src/UserNotificationRoot.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Bell, Archive, Settings2 } from 'lucide-react';\nimport { NotificationProvider } from './providers/NotificationProvider';\nimport type { NavItem, FooterItem, NotificationRootProps } from './types';\nimport { UserNotificationRoutes } from './UserNotificationRoutes';\n\n/**\n * User Root component for the Notification microfrontend.\n *\n * This is the entry point host product shells should import. It exposes only\n * the user-facing notification surfaces (Notification Center, History) and\n * sets up the required provider stack.\n *\n * For the full admin experience (templates, create/send notification) use\n * `AdminNotificationRoot` instead.\n *\n * @example\n * ```tsx\n * import { UserNotificationRoot, type NotificationRootProps } from '@burdenoff/micro-fe/notification';\n *\n * function App() {\n * const props: NotificationRootProps = {\n * basePath: '/notifications',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com' },\n * workspaceId: 'ws-123',\n * apiGatewayUrl: 'https://api.example.com',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * onNotificationClick: (notification) => console.log('Clicked:', notification),\n * };\n *\n * return <UserNotificationRoot {...props} />;\n * }\n * ```\n */\nexport function UserNotificationRoot(props: NotificationRootProps) {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n\n // Component-level feature gate. `notification.history` is declared as\n // unreleased (defaultValue=false). We use `useFeatureFlagDetails` and\n // explicitly fall back to `false` when the flag is absent from the cache,\n // because the provider's global default-allow would otherwise return `true`\n // for unseeded flags — which would defeat the whole point of the unreleased\n // pattern.\n const historyDetails = useFeatureFlagDetails('notification.history');\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell (user-facing only)\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'user-notification-center',\n label: tr('notification.nav.center', 'Notification Center'),\n path: joinPath(basePath, 'center'),\n icon: <Bell size={20} />,\n order: 10,\n group: 'notifications',\n },\n ...(historyEnabled\n ? [\n {\n id: 'user-notification-history',\n label: tr('notification.nav.history', 'History'),\n path: joinPath(basePath, 'history'),\n icon: <Archive size={20} />,\n order: 20,\n group: 'notifications',\n },\n ]\n : []),\n {\n id: 'user-notification-preferences',\n label: tr('notification.nav.preferences', 'Preferences'),\n path: joinPath(basePath, 'preferences'),\n icon: <Settings2 size={20} />,\n order: 30,\n group: 'notifications',\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registerNavItems, basePath, historyEnabled, t]);\n\n // Register footer items (status indicator in left section)\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems: FooterItem[] = [\n {\n id: 'user-notification-status',\n label: tr('notification.footer.ready', 'Notifications Ready'),\n type: 'status',\n order: 10,\n section: 'left',\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registerFooterItems, t]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'notification.error.moduleLoad',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <NotificationProvider {...props}>\n <UserNotificationRoutes />\n </NotificationProvider>\n </ErrorBoundary>\n );\n}\n"],"mappings":";;;;;;;;;AAuCA,
|
|
1
|
+
{"version":3,"file":"UserNotificationRoot.js","names":["UserNotificationRoot","props","useI18n","tr","translated","t","key","fallback","historyDetails","useFeatureFlagDetails","historyEnabled","joinPath","base","path","useEffect","registerNavItems","navItems","basePath","Bell","Archive","Settings2","registerFooterItems","footerItems","ErrorBoundary","NotificationProvider","UserNotificationRoutes"],"sources":["../src/UserNotificationRoot.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Bell, Archive, Settings2 } from 'lucide-react';\nimport { NotificationProvider } from './providers/NotificationProvider';\nimport type { NavItem, FooterItem, NotificationRootProps } from './types';\nimport { UserNotificationRoutes } from './UserNotificationRoutes';\n\n/**\n * User Root component for the Notification microfrontend.\n *\n * This is the entry point host product shells should import. It exposes only\n * the user-facing notification surfaces (Notification Center, History) and\n * sets up the required provider stack.\n *\n * For the full admin experience (templates, create/send notification) use\n * `AdminNotificationRoot` instead.\n *\n * @example\n * ```tsx\n * import { UserNotificationRoot, type NotificationRootProps } from '@burdenoff/micro-fe/notification';\n *\n * function App() {\n * const props: NotificationRootProps = {\n * basePath: '/notifications',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com' },\n * workspaceId: 'ws-123',\n * apiGatewayUrl: 'https://api.example.com',\n * authToken: 'token',\n * registerNavItems: (items) => { return () => {}; },\n * onNotificationClick: (notification) => console.log('Clicked:', notification),\n * };\n *\n * return <UserNotificationRoot {...props} />;\n * }\n * ```\n */\nexport function UserNotificationRoot(props: NotificationRootProps) {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n\n // Component-level feature gate. `notification.history` is declared as\n // unreleased (defaultValue=false). We use `useFeatureFlagDetails` and\n // explicitly fall back to `false` when the flag is absent from the cache,\n // because the provider's global default-allow would otherwise return `true`\n // for unseeded flags — which would defeat the whole point of the unreleased\n // pattern.\n const historyDetails = useFeatureFlagDetails('notification.history');\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell (user-facing only)\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'user-notification-center',\n label: tr('notification.nav.center', 'Notification Center'),\n path: joinPath(basePath, 'center'),\n icon: <Bell size={20} />,\n order: 10,\n group: 'notifications',\n },\n ...(historyEnabled\n ? [\n {\n id: 'user-notification-history',\n label: tr('notification.nav.history', 'History'),\n path: joinPath(basePath, 'history'),\n icon: <Archive size={20} />,\n order: 20,\n group: 'notifications',\n },\n ]\n : []),\n {\n id: 'user-notification-preferences',\n label: tr('notification.nav.preferences', 'Preferences'),\n path: joinPath(basePath, 'preferences'),\n icon: <Settings2 size={20} />,\n order: 30,\n group: 'notifications',\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registerNavItems, basePath, historyEnabled, t]);\n\n // Register footer items (status indicator in left section)\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems: FooterItem[] = [\n {\n id: 'user-notification-status',\n label: tr('notification.footer.ready', 'Notifications Ready'),\n type: 'status',\n order: 10,\n section: 'left',\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registerFooterItems, t]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'notification.error.moduleLoad',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <NotificationProvider {...props}>\n <UserNotificationRoutes />\n </NotificationProvider>\n </ErrorBoundary>\n );\n}\n"],"mappings":";;;;;;;;;AAuCA,SAAgBA,EAAqB,GAA8B;CACjE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQC,GAC5D,EAAE,SAAMC,EAAQ,GAChBC,KAAM,GAAa,MAA6B;EACpD,IAAMC,IAAaC,EAAEC,CAAG;EACxB,OAAOF,MAAeE,IAAMC,IAAWH;CACzC,GAQMI,IAAiBC,EAAsB,sBAAsB,GAC7DC,IAAiBF,IAAiB,EAAQA,EAAe,QAAS,IAGlEG,KAAY,GAAc,OACZC,EAAK,SAAS,GAAG,IAAIA,EAAK,MAAM,GAAG,EAAE,IAAIA,MACzCC,EAAK,WAAW,GAAG,IAAIA,IAAO,IAAIA;CAkEtD,OA7DAC,QAAgB;EACd,IAAI,CAACC,GAAkB;EAEvB,IAAMC,IAAsB;GAC1B;IACE,IAAI;IACJ,OAAOb,EAAG,2BAA2B,qBAAqB;IAC1D,MAAMQ,EAASM,GAAU,QAAQ;IACjC,MAAM,kBAACC,GAAD,EAAM,MAAM,GAAK,CAAA;IACvB,OAAO;IACP,OAAO;GACT;GACA,GAAIR,IACA,CACE;IACE,IAAI;IACJ,OAAOP,EAAG,4BAA4B,SAAS;IAC/C,MAAMQ,EAASM,GAAU,SAAS;IAClC,MAAM,kBAACE,GAAD,EAAS,MAAM,GAAK,CAAA;IAC1B,OAAO;IACP,OAAO;GACT,CACF,IACA,CAAC;GACL;IACE,IAAI;IACJ,OAAOhB,EAAG,gCAAgC,aAAa;IACvD,MAAMQ,EAASM,GAAU,aAAa;IACtC,MAAM,kBAACG,GAAD,EAAW,MAAM,GAAK,CAAA;IAC5B,OAAO;IACP,OAAO;GACT;EACF;EAMA,OAHgBL,EAAiBC,CAG1B;CAET,GAAG;EAACD;EAAkBE;EAAUP;EAAgBL;CAAC,CAAC,GAGlDS,QAAgB;EACd,IAAI,CAACO,GAAqB;EAE1B,IAAMC,IAA4B,CAChC;GACE,IAAI;GACJ,OAAOnB,EAAG,6BAA6B,qBAAqB;GAC5D,MAAM;GACN,OAAO;GACP,SAAS;EACX,CACF;EAGA,OADgBkB,EAAoBC,CAC7B;CAET,GAAG,CAACD,GAAqBhB,CAAC,CAAC,GAGzB,kBAACkB,GAAD;EACE,UACE,kBAAC,OAAD;GAAK,WAAU;GACZ,UAAApB,EACC,iCACA,oEACF;EACG,CAAA;EAGP,UAAA,kBAACqB,GAAD;GAAsB,GAAIvB;GACxB,UAAA,kBAACwB,GAAD,CAAyB,CAAA;EACL,CAAA;CACT,CAAA;AAEnB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal router for the User-facing Notification microfrontend.
|
|
3
|
+
* This component handles routing within the microfrontend using React Router v7.
|
|
4
|
+
*
|
|
5
|
+
* Only exposes user-facing routes intended for product shells. RBAC permissions
|
|
6
|
+
* still gate in-page actions via usePermissions checks.
|
|
7
|
+
*
|
|
8
|
+
* Routes:
|
|
9
|
+
* - / → Redirect to notification center
|
|
10
|
+
* - /list → Notification center (canonical list alias used by shell nav homePath)
|
|
11
|
+
* - /center → Notification center (in-app notifications)
|
|
12
|
+
* - /history → Notification history and archive
|
|
13
|
+
* - /preferences → Topic subscriptions and preferences
|
|
14
|
+
* - unmatched → Absolute redirect to /{basePath}/center (avoids relative redirect loops)
|
|
15
|
+
*/
|
|
16
|
+
export declare function UserNotificationRoutes(): import('react').JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { FeatureDisabledPage as e } from "./components/FeatureDisabledPage.js";
|
|
2
|
+
import { useNotification as t } from "./providers/NotificationProvider.js";
|
|
3
|
+
import { useTr as n } from "./shared/hooks/useTr.js";
|
|
4
|
+
import { NotificationCenterPage as r } from "./pages/NotificationCenterPage.js";
|
|
5
5
|
import { Suspense as i, lazy as a } from "react";
|
|
6
6
|
import { useFeatureFlagDetails as o } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
7
7
|
import { Navigate as s, Route as c, Routes as l } from "react-router";
|
|
8
8
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
|
-
|
|
9
|
+
// src/UserNotificationRoutes.tsx
|
|
10
10
|
var f = a(() => import("./pages/NotificationHistoryPage.js").then((e) => ({ default: e.NotificationHistoryPage }))), p = a(() => import("./pages/NotificationPreferencesPage.js").then((e) => ({ default: e.NotificationPreferencesPage })));
|
|
11
11
|
function m() {
|
|
12
12
|
return /* @__PURE__ */ u("div", {
|
|
@@ -15,7 +15,7 @@ function m() {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
function h() {
|
|
18
|
-
let { basePath: a = "/" } =
|
|
18
|
+
let { basePath: a = "/" } = t(), h = n(), g = `${a.endsWith("/") ? a.slice(0, -1) : a}/center`, _ = o("notification.history"), v = _ ? !!_.value : !1;
|
|
19
19
|
return /* @__PURE__ */ u(i, {
|
|
20
20
|
fallback: /* @__PURE__ */ u(m, {}),
|
|
21
21
|
children: /* @__PURE__ */ d(l, { children: [
|
|
@@ -28,15 +28,15 @@ function h() {
|
|
|
28
28
|
}),
|
|
29
29
|
/* @__PURE__ */ u(c, {
|
|
30
30
|
path: "list",
|
|
31
|
-
element: /* @__PURE__ */ u(
|
|
31
|
+
element: /* @__PURE__ */ u(r, {})
|
|
32
32
|
}),
|
|
33
33
|
/* @__PURE__ */ u(c, {
|
|
34
34
|
path: "center",
|
|
35
|
-
element: /* @__PURE__ */ u(
|
|
35
|
+
element: /* @__PURE__ */ u(r, {})
|
|
36
36
|
}),
|
|
37
37
|
/* @__PURE__ */ u(c, {
|
|
38
38
|
path: "history",
|
|
39
|
-
element: v ? /* @__PURE__ */ u(f, {}) : /* @__PURE__ */ u(
|
|
39
|
+
element: v ? /* @__PURE__ */ u(f, {}) : /* @__PURE__ */ u(e, {
|
|
40
40
|
title: h("notification.featureDisabled.historyTitle", "Notification history is not enabled"),
|
|
41
41
|
description: h("notification.featureDisabled.historyUserDescription", "This page is controlled by the notification.history feature flag. Ask an administrator to enable it for this tenant if history should be available.")
|
|
42
42
|
})
|
|
@@ -55,7 +55,6 @@ function h() {
|
|
|
55
55
|
] })
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
//#endregion
|
|
59
58
|
export { h as UserNotificationRoutes };
|
|
60
59
|
|
|
61
60
|
//# sourceMappingURL=UserNotificationRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserNotificationRoutes.js","names":[],"sources":["../src/UserNotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { FeatureDisabledPage } from './components/FeatureDisabledPage';\nimport { useNotification } from './providers/NotificationProvider';\nimport { useTr } from './shared/hooks/useTr';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryPage = lazy(() =>\n import('./pages/NotificationHistoryPage').then((m) => ({\n default: m.NotificationHistoryPage,\n }))\n);\nconst NotificationPreferencesPage = lazy(() =>\n import('./pages/NotificationPreferencesPage').then((m) => ({\n default: m.NotificationPreferencesPage,\n }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * Internal router for the User-facing Notification microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Only exposes user-facing routes intended for product shells. RBAC permissions\n * still gate in-page actions via usePermissions checks.\n *\n * Routes:\n * - / → Redirect to notification center\n * - /list → Notification center (canonical list alias used by shell nav homePath)\n * - /center → Notification center (in-app notifications)\n * - /history → Notification history and archive\n * - /preferences → Topic subscriptions and preferences\n * - unmatched → Absolute redirect to /{basePath}/center (avoids relative redirect loops)\n */\nexport function UserNotificationRoutes() {\n const { basePath = '/' } = useNotification();\n const tr = useTr();\n const centerPath = `${basePath.endsWith('/') ? basePath.slice(0, -1) : basePath}/center`;\n\n // Component-level feature gate. `notification.history` is declared as\n // unreleased (defaultValue=false). We use `useFeatureFlagDetails` and\n // explicitly fall back to `false` when the flag is absent from the cache,\n // because the provider's global default-allow would otherwise return `true`\n // for unseeded flags — which would defeat the whole point of the unreleased\n // pattern.\n const historyDetails = useFeatureFlagDetails('notification.history');\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Default redirect to notification center */}\n <Route index element={<Navigate to={centerPath} replace />} />\n\n {/* Canonical list alias used by product-shell nav homePath */}\n <Route path=\"list\" element={<NotificationCenterPage />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route\n path=\"history\"\n element={\n historyEnabled ? (\n <NotificationHistoryPage />\n ) : (\n <FeatureDisabledPage\n title={tr(\n 'notification.featureDisabled.historyTitle',\n 'Notification history is not enabled'\n )}\n description={tr(\n 'notification.featureDisabled.historyUserDescription',\n 'This page is controlled by the notification.history feature flag. Ask an administrator to enable it for this tenant if history should be available.'\n )}\n />\n )\n }\n />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n\n {/* Catch-all route - absolute redirect so an unmatched path like /list\n cannot recursively append /center (e.g. /list/center/center/...) */}\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;;AAWA,
|
|
1
|
+
{"version":3,"file":"UserNotificationRoutes.js","names":["NotificationHistoryPage","lazy","m","NotificationPreferencesPage","PageLoader","UserNotificationRoutes","useNotification","tr","useTr","centerPath","basePath","historyDetails","useFeatureFlagDetails","historyEnabled","Suspense","Routes","Route","Navigate","NotificationCenterPage","FeatureDisabledPage"],"sources":["../src/UserNotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { FeatureDisabledPage } from './components/FeatureDisabledPage';\nimport { useNotification } from './providers/NotificationProvider';\nimport { useTr } from './shared/hooks/useTr';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryPage = lazy(() =>\n import('./pages/NotificationHistoryPage').then((m) => ({\n default: m.NotificationHistoryPage,\n }))\n);\nconst NotificationPreferencesPage = lazy(() =>\n import('./pages/NotificationPreferencesPage').then((m) => ({\n default: m.NotificationPreferencesPage,\n }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * Internal router for the User-facing Notification microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Only exposes user-facing routes intended for product shells. RBAC permissions\n * still gate in-page actions via usePermissions checks.\n *\n * Routes:\n * - / → Redirect to notification center\n * - /list → Notification center (canonical list alias used by shell nav homePath)\n * - /center → Notification center (in-app notifications)\n * - /history → Notification history and archive\n * - /preferences → Topic subscriptions and preferences\n * - unmatched → Absolute redirect to /{basePath}/center (avoids relative redirect loops)\n */\nexport function UserNotificationRoutes() {\n const { basePath = '/' } = useNotification();\n const tr = useTr();\n const centerPath = `${basePath.endsWith('/') ? basePath.slice(0, -1) : basePath}/center`;\n\n // Component-level feature gate. `notification.history` is declared as\n // unreleased (defaultValue=false). We use `useFeatureFlagDetails` and\n // explicitly fall back to `false` when the flag is absent from the cache,\n // because the provider's global default-allow would otherwise return `true`\n // for unseeded flags — which would defeat the whole point of the unreleased\n // pattern.\n const historyDetails = useFeatureFlagDetails('notification.history');\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Default redirect to notification center */}\n <Route index element={<Navigate to={centerPath} replace />} />\n\n {/* Canonical list alias used by product-shell nav homePath */}\n <Route path=\"list\" element={<NotificationCenterPage />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route\n path=\"history\"\n element={\n historyEnabled ? (\n <NotificationHistoryPage />\n ) : (\n <FeatureDisabledPage\n title={tr(\n 'notification.featureDisabled.historyTitle',\n 'Notification history is not enabled'\n )}\n description={tr(\n 'notification.featureDisabled.historyUserDescription',\n 'This page is controlled by the notification.history feature flag. Ask an administrator to enable it for this tenant if history should be available.'\n )}\n />\n )\n }\n />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n\n {/* Catch-all route - absolute redirect so an unmatched path like /list\n cannot recursively append /center (e.g. /list/center/center/...) */}\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;;AAWA,IAAMA,IAA0BC,QAC9B,OAAO,qCAAkC,CAAC,MAAM,OAAO,EACrD,SAASC,EAAE,wBACb,EAAE,CACJ,GACMC,IAA8BF,QAClC,OAAO,yCAAsC,CAAC,MAAM,OAAO,EACzD,SAASC,EAAE,4BACb,EAAE,CACJ;AAGA,SAASE,IAAa;CACpB,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA;AAET;AAiBA,SAAgBC,IAAyB;CACvC,IAAM,EAAE,cAAW,QAAQC,EAAgB,GACrCC,IAAKC,EAAM,GACXC,IAAa,GAAGC,EAAS,SAAS,GAAG,IAAIA,EAAS,MAAM,GAAG,EAAE,IAAIA,EAAS,UAQ1EC,IAAiBC,EAAsB,sBAAsB,GAC7DC,IAAiBF,IAAiB,EAAQA,EAAe,QAAS;CAExE,OACE,kBAACG,GAAD;EAAU,UAAU,kBAACV,GAAD,CAAa,CAAA;EAC/B,UAAA,kBAACW,GAAD,EAAA,UAAA;GAEE,kBAACC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAACC,GAAD;KAAU,IAAIR;KAAY,SAAA;IAAS,CAAA;GAAI,CAAA;GAG7D,kBAACO,GAAD;IAAO,MAAK;IAAO,SAAS,kBAACE,GAAD,CAAyB,CAAA;GAAI,CAAA;GAGzD,kBAACF,GAAD;IAAO,MAAK;IAAS,SAAS,kBAACE,GAAD,CAAyB,CAAA;GAAI,CAAA;GAC3D,kBAACF,GAAD;IACE,MAAK;IACL,SACEH,IACE,kBAACb,GAAD,CAA0B,CAAA,IAE1B,kBAACmB,GAAD;KACE,OAAOZ,EACL,6CACA,qCACF;KACA,aAAaA,EACX,uDACA,qJACF;IACD,CAAA;GAGN,CAAA;GACD,kBAACS,GAAD;IAAO,MAAK;IAAc,SAAS,kBAACb,GAAD,CAA8B,CAAA;GAAI,CAAA;GAIrE,kBAACa,GAAD;IAAO,MAAK;IAAI,SAAS,kBAACC,GAAD;KAAU,IAAIR;KAAY,SAAA;IAAS,CAAA;GAAI,CAAA;EAC1D,EAAA,CAAA;CACA,CAAA;AAEd"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ConfirmDeleteDialogProps {
|
|
2
|
+
/** Open while a delete waits for an answer. */
|
|
3
|
+
open: boolean;
|
|
4
|
+
/** Already translated, naming the item: "Delete topic". */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Already translated, naming the item and the effect. */
|
|
7
|
+
description: string;
|
|
8
|
+
confirmLabel?: string;
|
|
9
|
+
onConfirm: () => void;
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The confirmation before a destructive action (BOFF-11872): it names the
|
|
14
|
+
* item and what happens. Built on the fe-libs AlertDialog, so focus starts on
|
|
15
|
+
* Cancel and Escape cancels.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ConfirmDeleteDialog({ open, title, description, confirmLabel, onConfirm, onCancel, }: ConfirmDeleteDialogProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useTr as e } from "../shared/hooks/useTr.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { AlertDialog as r, AlertDialogAction as i, AlertDialogCancel as a, AlertDialogContent as o, AlertDialogDescription as s, AlertDialogFooter as c, AlertDialogHeader as l, AlertDialogTitle as u } from "@burdenoff/fe-libs/ui";
|
|
4
|
+
// src/components/ConfirmDeleteDialog.tsx
|
|
5
|
+
function d({ open: d, title: f, description: p, confirmLabel: m, onConfirm: h, onCancel: g }) {
|
|
6
|
+
let _ = e();
|
|
7
|
+
return /* @__PURE__ */ t(r, {
|
|
8
|
+
open: d,
|
|
9
|
+
onOpenChange: (e) => !e && g(),
|
|
10
|
+
children: /* @__PURE__ */ n(o, { children: [/* @__PURE__ */ n(l, { children: [/* @__PURE__ */ t(u, { children: f }), /* @__PURE__ */ t(s, { children: p })] }), /* @__PURE__ */ n(c, { children: [/* @__PURE__ */ t(a, {
|
|
11
|
+
onClick: g,
|
|
12
|
+
children: _("notifications.cancel", "Cancel")
|
|
13
|
+
}), /* @__PURE__ */ t(i, {
|
|
14
|
+
onClick: h,
|
|
15
|
+
className: "bg-action-danger-bg text-action-danger-text hover:bg-action-danger-bgHover",
|
|
16
|
+
children: m ?? _("notifications.delete", "Delete")
|
|
17
|
+
})] })] })
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export { d as ConfirmDeleteDialog };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=ConfirmDeleteDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDeleteDialog.js","names":["ConfirmDeleteDialog","tr","useTr","AlertDialog","next","onCancel","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","title","AlertDialogDescription","description","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","onConfirm","confirmLabel"],"sources":["../../src/components/ConfirmDeleteDialog.tsx"],"sourcesContent":["import {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../shared/hooks/useTr';\n\nexport interface ConfirmDeleteDialogProps {\n /** Open while a delete waits for an answer. */\n open: boolean;\n /** Already translated, naming the item: \"Delete topic\". */\n title: string;\n /** Already translated, naming the item and the effect. */\n description: string;\n confirmLabel?: string;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\n/**\n * The confirmation before a destructive action (BOFF-11872): it names the\n * item and what happens. Built on the fe-libs AlertDialog, so focus starts on\n * Cancel and Escape cancels.\n */\nexport function ConfirmDeleteDialog({\n open,\n title,\n description,\n confirmLabel,\n onConfirm,\n onCancel,\n}: ConfirmDeleteDialogProps) {\n const tr = useTr();\n return (\n <AlertDialog open={open} onOpenChange={(next) => !next && onCancel()}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{title}</AlertDialogTitle>\n <AlertDialogDescription>{description}</AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel onClick={onCancel}>\n {tr('notifications.cancel', 'Cancel')}\n </AlertDialogCancel>\n <AlertDialogAction\n onClick={onConfirm}\n className=\"bg-action-danger-bg text-action-danger-text hover:bg-action-danger-bgHover\"\n >\n {confirmLabel ?? tr('notifications.delete', 'Delete')}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n}\n"],"mappings":";;;;AA6BA,SAAgBA,EAAoB,EAClC,SACA,UACA,gBACA,iBACA,cACA,eAC2B;CAC3B,IAAMC,IAAKC,EAAM;CACjB,OACE,kBAACC,GAAD;EAAmB;EAAM,eAAe,MAAS,CAACC,KAAQC,EAAS;EACjE,UAAA,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UAAmBC,EAAwB,CAAA,GAC3C,kBAACC,GAAD,EAAA,UAAyBC,EAAoC,CAAA,CAC5C,EAAA,CAAA,GACnB,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD;GAAmB,SAASR;GACzB,UAAAJ,EAAG,wBAAwB,QAAQ;EACnB,CAAA,GACnB,kBAACa,GAAD;GACE,SAASC;GACT,WAAU;GAET,UAAAC,KAAgBf,EAAG,wBAAwB,QAAQ;EACnC,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA;CACT,CAAA;AAEjB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Lock as e } from "lucide-react";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/components/FeatureDisabledPage.tsx
|
|
4
4
|
function r({ title: r, description: i }) {
|
|
5
5
|
return /* @__PURE__ */ t("div", {
|
|
6
6
|
className: "flex min-h-64 items-center justify-center p-6",
|
|
@@ -26,7 +26,6 @@ function r({ title: r, description: i }) {
|
|
|
26
26
|
})
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
//#endregion
|
|
30
29
|
export { r as FeatureDisabledPage };
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=FeatureDisabledPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureDisabledPage.js","names":[],"sources":["../../src/components/FeatureDisabledPage.tsx"],"sourcesContent":["import { Lock } from 'lucide-react';\n\ninterface FeatureDisabledPageProps {\n title: string;\n description: string;\n}\n\nexport function FeatureDisabledPage({ title, description }: FeatureDisabledPageProps) {\n return (\n <div className=\"flex min-h-64 items-center justify-center p-6\">\n <div className=\"max-w-md rounded-xl border border-border-seam bg-gloss-card p-6 text-center shadow-[var(--shadow-pop)]\">\n <div className=\"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-bg-sunken text-secondary\">\n <Lock size={22} aria-hidden=\"true\" />\n </div>\n <h1 className=\"text-lg font-semibold text-primary\">{title}</h1>\n <p className=\"mt-2 text-sm leading-6 text-secondary\">{description}</p>\n </div>\n </div>\n );\n}\n"],"mappings":";;;AAOA,
|
|
1
|
+
{"version":3,"file":"FeatureDisabledPage.js","names":["FeatureDisabledPage","Lock","title","description"],"sources":["../../src/components/FeatureDisabledPage.tsx"],"sourcesContent":["import { Lock } from 'lucide-react';\n\ninterface FeatureDisabledPageProps {\n title: string;\n description: string;\n}\n\nexport function FeatureDisabledPage({ title, description }: FeatureDisabledPageProps) {\n return (\n <div className=\"flex min-h-64 items-center justify-center p-6\">\n <div className=\"max-w-md rounded-xl border border-border-seam bg-gloss-card p-6 text-center shadow-[var(--shadow-pop)]\">\n <div className=\"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-bg-sunken text-secondary\">\n <Lock size={22} aria-hidden=\"true\" />\n </div>\n <h1 className=\"text-lg font-semibold text-primary\">{title}</h1>\n <p className=\"mt-2 text-sm leading-6 text-secondary\">{description}</p>\n </div>\n </div>\n );\n}\n"],"mappings":";;;AAOA,SAAgBA,EAAoB,EAAE,UAAO,kBAAyC;CACpF,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACC,GAAD;MAAM,MAAM;MAAI,eAAY;KAAQ,CAAA;IACjC,CAAA;IACL,kBAAC,MAAD;KAAI,WAAU;KAAsC,UAAAC;IAAU,CAAA;IAC9D,kBAAC,KAAD;KAAG,WAAU;KAAyC,UAAAC;IAAe,CAAA;GAClE;;CACF,CAAA;AAET"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification bell icon with unread count badge
|
|
3
|
+
*
|
|
4
|
+
* This component should be placed in the global header/navbar
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <NotificationBell onClick={() => navigate('/notifications/center')} />
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare function NotificationBell({ onClick }: {
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
}): import('react').JSX.Element;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useNotification as e } from "../providers/NotificationProvider.js";
|
|
2
2
|
import { USER_NOTIFICATION_CONTEXT as t, getGlobalNotificationClient as n } from "../graphql/global-client.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { GetMyUnreadNotificationCountDocument as r, UnreadCountUpdatedDocument as i } from "../generated/global-operations.js";
|
|
4
|
+
import { useNotificationStore as a } from "../store/notificationStore.js";
|
|
5
5
|
import { useTr as o } from "../shared/hooks/useTr.js";
|
|
6
6
|
import { useCallback as s, useEffect as c } from "react";
|
|
7
7
|
import { Bell as l } from "lucide-react";
|
|
8
8
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
|
-
|
|
9
|
+
// src/components/NotificationBell.tsx
|
|
10
10
|
function f({ onClick: f }) {
|
|
11
|
-
let p = o(), { authToken: m, apiGatewayUrl: h, currentUser: g } = e(), { unreadCount: _, togglePanel: v, setUnreadCount: y } =
|
|
11
|
+
let p = o(), { authToken: m, apiGatewayUrl: h, currentUser: g } = e(), { unreadCount: _, togglePanel: v, setUnreadCount: y } = a(), b = s(async () => {
|
|
12
12
|
try {
|
|
13
13
|
let e = await n(h ?? void 0, m ?? void 0).query({
|
|
14
14
|
context: t,
|
|
15
|
-
query:
|
|
15
|
+
query: r,
|
|
16
16
|
variables: { filter: { channel: "IN_APP" } },
|
|
17
17
|
fetchPolicy: "network-only"
|
|
18
18
|
});
|
|
@@ -28,7 +28,7 @@ function f({ onClick: f }) {
|
|
|
28
28
|
}, [b]), c(() => {
|
|
29
29
|
if (!g?.id) return;
|
|
30
30
|
let e = n(h ?? void 0, m ?? void 0).subscribe({
|
|
31
|
-
query:
|
|
31
|
+
query: i,
|
|
32
32
|
variables: { userId: g.id }
|
|
33
33
|
}).subscribe({
|
|
34
34
|
next: (e) => {
|
|
@@ -64,7 +64,6 @@ function f({ onClick: f }) {
|
|
|
64
64
|
})]
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
//#endregion
|
|
68
67
|
export { f as NotificationBell };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=NotificationBell.js.map
|