@burdenoff/microfe-notification 2026.1124.1 → 2026.1125.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.
Files changed (40) hide show
  1. package/dist/AdminNotificationRoutes.js +59 -51
  2. package/dist/AdminNotificationRoutes.js.map +1 -1
  3. package/dist/NotificationRoutes.js +76 -68
  4. package/dist/NotificationRoutes.js.map +1 -1
  5. package/dist/UserNotificationRoutes.js +39 -31
  6. package/dist/UserNotificationRoutes.js.map +1 -1
  7. package/dist/components/NotificationListFooter.js +1 -1
  8. package/dist/components/NotificationListFooter.js.map +1 -1
  9. package/dist/components/loadingSystem.d.ts +64 -0
  10. package/dist/components/loadingSystem.js +34 -0
  11. package/dist/components/loadingSystem.js.map +1 -0
  12. package/dist/navigation-v2/AdminPageV2.js +23 -16
  13. package/dist/navigation-v2/AdminPageV2.js.map +1 -1
  14. package/dist/navigation-v2/NotificationArchivedV2.js +100 -93
  15. package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
  16. package/dist/navigation-v2/NotificationInboxV2.js +130 -123
  17. package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
  18. package/dist/navigation-v2/NotificationSettingsV2.js +91 -84
  19. package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -1
  20. package/dist/navigation-v2/NotificationsV2Landing.js +31 -23
  21. package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -1
  22. package/dist/pages/CreateNotificationPage.js +442 -432
  23. package/dist/pages/CreateNotificationPage.js.map +1 -1
  24. package/dist/pages/NotificationCenterPage.js +91 -84
  25. package/dist/pages/NotificationCenterPage.js.map +1 -1
  26. package/dist/pages/NotificationHistoryAdminPage.js +226 -219
  27. package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
  28. package/dist/pages/NotificationHistoryPage.js +69 -62
  29. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  30. package/dist/pages/NotificationLandingPage.js +42 -34
  31. package/dist/pages/NotificationLandingPage.js.map +1 -1
  32. package/dist/pages/NotificationPreferencesPage.js +80 -70
  33. package/dist/pages/NotificationPreferencesPage.js.map +1 -1
  34. package/dist/pages/NotificationTemplatesPage.js +192 -181
  35. package/dist/pages/NotificationTemplatesPage.js.map +1 -1
  36. package/dist/pages/NotificationTopicsPage.js +124 -117
  37. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  38. package/dist/pages/TemplateEditorPage.js +248 -233
  39. package/dist/pages/TemplateEditorPage.js.map +1 -1
  40. package/package.json +2 -2
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"UserNotificationRoutes.js","names":["NotificationHistoryPage","lazy","m","NotificationPreferencesPage","PageLoader","SectionLoaderOr","CompactMarkOr","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';\nimport { CompactMarkOr, SectionLoaderOr } from './components/loadingSystem';\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 <SectionLoaderOr\n route\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\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":";;;;;;;;;;AAYA,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,kBAACC,GAAD;EACE,OAAA;EACA,WAAU;EACV,OACE,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD;IACE,WAAU;IACV,OACE,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;GAEpG,CAAA;EACE,CAAA;CAER,CAAA;AAEL;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,kBAACZ,GAAD,CAAa,CAAA;EAC/B,UAAA,kBAACa,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,kBAACf,GAAD,CAA0B,CAAA,IAE1B,kBAACqB,GAAD;KACE,OAAOZ,EACL,6CACA,qCACF;KACA,aAAaA,EACX,uDACA,qJACF;IACD,CAAA;GAGN,CAAA;GACD,kBAACS,GAAD;IAAO,MAAK;IAAc,SAAS,kBAACf,GAAD,CAA8B,CAAA;GAAI,CAAA;GAIrE,kBAACe,GAAD;IAAO,MAAK;IAAI,SAAS,kBAACC,GAAD;KAAU,IAAIR;KAAY,SAAA;IAAS,CAAA;GAAI,CAAA;EAC1D,EAAA,CAAA;CACA,CAAA;AAEd"}
@@ -1,5 +1,5 @@
1
1
  import { useTr as e } from "../shared/hooks/useTr.js";
2
- import { Loader2 as t } from "lucide-react";
2
+ import { SpinnerIcon as t } from "./loadingSystem.js";
3
3
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
4
  import { Button as i } from "@burdenoff/fe-libs/ui";
5
5
  import { useInfiniteScroll as a } from "@burdenoff/fe-libs/shared/hooks";
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationListFooter.js","names":["NotificationListFooter","tr","useTr","endRef","useInfiniteScroll","isLoadingMore","onLoadMore","hasMore","Loader2","Button","shownCount"],"sources":["../../src/components/NotificationListFooter.tsx"],"sourcesContent":["import { Loader2 } from 'lucide-react';\nimport { useInfiniteScroll } from '@burdenoff/fe-libs/shared/hooks';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../shared/hooks/useTr';\n\ninterface NotificationListFooterProps {\n /** More notifications exist after the ones loaded. */\n hasMore: boolean;\n /** The next page is loading. */\n isLoadingMore: boolean;\n /** Load the next page (useNotifications' loadMore). */\n onLoadMore: () => void | Promise<void>;\n /** How many notifications the list shows; the end note needs at least one. */\n shownCount: number;\n}\n\n/**\n * The end of a notification list (BOFF-15331): loads the next page as it\n * scrolls into view, shows a loading row meanwhile, keeps a \"Load more\"\n * button for keyboard users and browsers without IntersectionObserver, and\n * says so when everything is shown.\n */\nexport function NotificationListFooter({\n hasMore,\n isLoadingMore,\n onLoadMore,\n shownCount,\n}: NotificationListFooterProps) {\n const tr = useTr();\n const endRef = useInfiniteScroll({\n hasMore,\n loading: isLoadingMore,\n onLoadMore: () => void onLoadMore(),\n });\n\n if (!hasMore) {\n return shownCount > 0 ? (\n <p\n data-testid=\"notifications-list-end\"\n className=\"py-4 text-center text-xs text-text-tertiary\"\n >\n {tr('notifications.listEnd', \"That's everything\")}\n </p>\n ) : null;\n }\n\n return (\n <div data-testid=\"notifications-list-footer\" className=\"flex flex-col items-center py-4\">\n <div ref={endRef} aria-hidden=\"true\" className=\"h-px w-full\" />\n {isLoadingMore ? (\n <div role=\"status\" className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <Loader2 size={16} className=\"animate-spin\" aria-hidden=\"true\" />\n {tr('notifications.loadingMore', 'Loading more…')}\n </div>\n ) : (\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={() => void onLoadMore()}>\n {tr('notifications.loadMore', 'Load more')}\n </Button>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAsBA,SAAgBA,EAAuB,EACrC,YACA,kBACA,eACA,iBAC8B;CAC9B,IAAMC,IAAKC,EAAM,GACXC,IAASC,EAAkB;EAC/B;EACA,SAASC;EACT,kBAAkB,KAAKC,EAAW;CACpC,CAAC;CAaD,OAXKC,IAYH,kBAAC,OAAD;EAAK,eAAY;EAA4B,WAAU;EAAvD,UAAA,CACE,kBAAC,OAAD;GAAK,KAAKJ;GAAQ,eAAY;GAAO,WAAU;EAAe,CAAA,GAC7DE,IACC,kBAAC,OAAD;GAAK,MAAK;GAAS,WAAU;GAA7B,UAAA,CACE,kBAACG,GAAD;IAAS,MAAM;IAAI,WAAU;IAAe,eAAY;GAAQ,CAAA,GAC/DP,EAAG,6BAA6B,eAAe,CAC7C;EAEL,CAAA,IAAA,kBAACQ,GAAD;GAAQ,MAAK;GAAS,SAAQ;GAAQ,MAAK;GAAK,eAAe,KAAKH,EAAW;GAC5E,UAAAL,EAAG,0BAA0B,WAAW;EACnC,CAAA,CAEP;C,KAvBES,IAAa,IAClB,kBAAC,KAAD;EACE,eAAY;EACZ,WAAU;EAET,UAAAT,EAAG,yBAAyB,mBAAmB;CAC/C,CAAA,IACD;AAkBR"}
1
+ {"version":3,"file":"NotificationListFooter.js","names":["NotificationListFooter","tr","useTr","endRef","useInfiniteScroll","isLoadingMore","onLoadMore","hasMore","SpinnerIcon","Button","shownCount"],"sources":["../../src/components/NotificationListFooter.tsx"],"sourcesContent":["import { useInfiniteScroll } from '@burdenoff/fe-libs/shared/hooks';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../shared/hooks/useTr';\nimport { SpinnerIcon } from './loadingSystem';\n\ninterface NotificationListFooterProps {\n /** More notifications exist after the ones loaded. */\n hasMore: boolean;\n /** The next page is loading. */\n isLoadingMore: boolean;\n /** Load the next page (useNotifications' loadMore). */\n onLoadMore: () => void | Promise<void>;\n /** How many notifications the list shows; the end note needs at least one. */\n shownCount: number;\n}\n\n/**\n * The end of a notification list (BOFF-15331): loads the next page as it\n * scrolls into view, shows a loading row meanwhile, keeps a \"Load more\"\n * button for keyboard users and browsers without IntersectionObserver, and\n * says so when everything is shown.\n */\nexport function NotificationListFooter({\n hasMore,\n isLoadingMore,\n onLoadMore,\n shownCount,\n}: NotificationListFooterProps) {\n const tr = useTr();\n const endRef = useInfiniteScroll({\n hasMore,\n loading: isLoadingMore,\n onLoadMore: () => void onLoadMore(),\n });\n\n if (!hasMore) {\n return shownCount > 0 ? (\n <p\n data-testid=\"notifications-list-end\"\n className=\"py-4 text-center text-xs text-text-tertiary\"\n >\n {tr('notifications.listEnd', \"That's everything\")}\n </p>\n ) : null;\n }\n\n return (\n <div data-testid=\"notifications-list-footer\" className=\"flex flex-col items-center py-4\">\n <div ref={endRef} aria-hidden=\"true\" className=\"h-px w-full\" />\n {isLoadingMore ? (\n <div role=\"status\" className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <SpinnerIcon size={16} className=\"animate-spin\" aria-hidden=\"true\" />\n {tr('notifications.loadingMore', 'Loading more…')}\n </div>\n ) : (\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={() => void onLoadMore()}>\n {tr('notifications.loadMore', 'Load more')}\n </Button>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAsBA,SAAgBA,EAAuB,EACrC,YACA,kBACA,eACA,iBAC8B;CAC9B,IAAMC,IAAKC,EAAM,GACXC,IAASC,EAAkB;EAC/B;EACA,SAASC;EACT,kBAAkB,KAAKC,EAAW;CACpC,CAAC;CAaD,OAXKC,IAYH,kBAAC,OAAD;EAAK,eAAY;EAA4B,WAAU;EAAvD,UAAA,CACE,kBAAC,OAAD;GAAK,KAAKJ;GAAQ,eAAY;GAAO,WAAU;EAAe,CAAA,GAC7DE,IACC,kBAAC,OAAD;GAAK,MAAK;GAAS,WAAU;GAA7B,UAAA,CACE,kBAACG,GAAD;IAAa,MAAM;IAAI,WAAU;IAAe,eAAY;GAAQ,CAAA,GACnEP,EAAG,6BAA6B,eAAe,CAC7C;EAEL,CAAA,IAAA,kBAACQ,GAAD;GAAQ,MAAK;GAAS,SAAQ;GAAQ,MAAK;GAAK,eAAe,KAAKH,EAAW;GAC5E,UAAAL,EAAG,0BAA0B,WAAW;EACnC,CAAA,CAEP;C,KAvBES,IAAa,IAClB,kBAAC,KAAD;EACE,eAAY;EACZ,WAAU;EAET,UAAAT,EAAG,yBAAyB,mBAAmB;CAC/C,CAAA,IACD;AAkBR"}
@@ -0,0 +1,64 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { SpinnerIconProps } from '@burdenoff/fe-libs/ui/loading/SpinnerIcon';
3
+ /**
4
+ * A drop-in for `<Loader2 className="… animate-spin" />`. Without the opt-in it IS this module's
5
+ * `Loader2`, with exactly the props it was given: fe-libs resolves a newer lucide-react than the
6
+ * module's (its icons add `aria-hidden`), so fe-libs' own `SpinnerIcon` would not draw the module's
7
+ * spinner byte for byte. Under the opt-in, fe-libs' `SpinnerIcon`: the compact mark, sized from
8
+ * the classes, `animate-spin` dropped; `tone="current"` lights it in the label's colour (a filled
9
+ * button).
10
+ */
11
+ export declare function SpinnerIcon({ tone, ...props }: SpinnerIconProps): import('react').JSX.Element;
12
+ /**
13
+ * A spinner the module draws itself (a CSS ring, its own svg, a turning icon): `today` exactly
14
+ * without the opt-in; under it, the compact mark. As fe-libs' `CompactMarkOr`, with the mark's
15
+ * `tone`: in a filled button it lights in the label's colour (an accent light on an accent fill
16
+ * would not show).
17
+ */
18
+ export declare function CompactMarkOr({ today, className, tone, }: {
19
+ /** The spinner as the module draws it today. */
20
+ today: ReactNode;
21
+ /** The compact mark's classes (its size, its margins). */
22
+ className?: string;
23
+ tone?: 'brand' | 'current';
24
+ }): import('react').JSX.Element;
25
+ export type SkeletonBlockProps = HTMLAttributes<HTMLElement> & {
26
+ /** Today's element: a `span` stays a `span` (it may sit in a line of text). */
27
+ as?: 'div' | 'span';
28
+ };
29
+ /**
30
+ * A grey block standing in for content on its way: a drop-in for today's hand-made
31
+ * `<div className="… animate-pulse bg-…" />`. Without the opt-in it IS that element, with exactly
32
+ * the props it was given, in their order; under it, the system's skeleton (one light passing, still
33
+ * under reduced motion, hidden from assistive technology) in the block's size, shape and place.
34
+ */
35
+ export declare function SkeletonBlock({ as, ...props }: SkeletonBlockProps): import('react').JSX.Element;
36
+ /**
37
+ * A box that pulses as a whole around its grey blocks (today's `<div className="animate-pulse …">`
38
+ * with plain blocks inside): a drop-in for that element. Without the opt-in it IS that element,
39
+ * prop for prop; under it, the same element without the pulse (its blocks are `SkeletonBlock`s,
40
+ * each with the system's light).
41
+ */
42
+ export type SkeletonGroupProps = HTMLAttributes<HTMLElement> & {
43
+ /** Today's element. */
44
+ as?: 'div' | 'span' | 'li' | 'section';
45
+ };
46
+ export declare function SkeletonGroup({ as, ...props }: SkeletonGroupProps): import('react').JSX.Element;
47
+ export interface SectionLoaderOrProps {
48
+ /** Today's loader, rendered exactly as it is without the opt-in. */
49
+ today: ReactNode;
50
+ /** What is loading, from today's words; the shell's "Loading…" when the box had none. */
51
+ label?: string;
52
+ /** Today's box height, so nothing moves when the content lands. */
53
+ minHeight?: string;
54
+ /** A page's loader (a route's code or its first data): it also runs the route wire. */
55
+ route?: boolean;
56
+ /** Where today's box sat (its grid span, margins). */
57
+ className?: string;
58
+ }
59
+ /**
60
+ * A box that waits on content of unknown shape. Without the opt-in it is `today`, exactly; under
61
+ * it, fe-libs' `SectionLoader`: nothing for 300 ms, then the product's mark and the words, held at
62
+ * least 600 ms, in a box of today's height.
63
+ */
64
+ export declare function SectionLoaderOr({ today, label, minHeight, route, className, }: SectionLoaderOrProps): import('react').JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { Loader2 as e } from "lucide-react";
2
+ import { Fragment as t, jsx as n } from "react/jsx-runtime";
3
+ import { BrandLoader as r } from "@burdenoff/fe-libs/ui/loading/BrandLoader";
4
+ import { useLoadingSystem as i } from "@burdenoff/fe-libs/ui/loading/LoadingSystemProvider";
5
+ import { SectionLoader as a } from "@burdenoff/fe-libs/ui/loading/Loaders";
6
+ import { SpinnerIcon as o } from "@burdenoff/fe-libs/ui/loading/SpinnerIcon";
7
+ import "@burdenoff/fe-libs/ui/skeleton";
8
+ import { useShellLabel as s } from "@burdenoff/fe-libs/shared/providers/shell/useShellLabel";
9
+ // src/components/loadingSystem.tsx
10
+ function c({ tone: t, ...r }) {
11
+ return i() ? /* @__PURE__ */ n(o, {
12
+ tone: t,
13
+ ...r
14
+ }) : /* @__PURE__ */ n(e, { ...r });
15
+ }
16
+ function l({ today: e, className: a, tone: o }) {
17
+ return i() ? /* @__PURE__ */ n(r, {
18
+ size: "s",
19
+ tone: o,
20
+ className: a
21
+ }) : /* @__PURE__ */ n(t, { children: e });
22
+ }
23
+ function u({ today: e, label: r, minHeight: o, route: c, className: l }) {
24
+ let u = i(), d = s();
25
+ return u ? /* @__PURE__ */ n(a, {
26
+ label: r ?? d("loading.generic", "Loading…"),
27
+ minHeight: o,
28
+ route: c,
29
+ className: l
30
+ }) : /* @__PURE__ */ n(t, { children: e });
31
+ }
32
+ export { l as CompactMarkOr, u as SectionLoaderOr, c as SpinnerIcon };
33
+
34
+ //# sourceMappingURL=loadingSystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadingSystem.js","names":["SpinnerIcon","SystemSpinnerIcon","_Fragment","SpinnerIcon$1","props","useLoadingSystem","SpinnerIcon","Loader2","CompactMarkOr","BrandLoader","Fragment","today","SectionLoaderOr","loadingSystem","shellLabel","useShellLabel","SectionLoader","label"],"sources":["../../src/components/loadingSystem.tsx"],"sourcesContent":["/**\n * The loading system's pieces for this module's own hand-made loaders (BOFF-16259). Without the\n * product's opt-in (`AppShellConfig.loadingSystem`, FluidGrids only) each renders exactly today's\n * markup, so every other product that mounts the module sees no change; under it, the fe-libs\n * piece: the compact mark for a spinner, the system's skeleton for a pulse block, the section\n * loader for a box that waits.\n *\n * fe-libs is imported by its per-file paths (the same modules its barrels re-export), so a test\n * that stubs a barrel never takes these pieces with it; a component that branches on the opt-in\n * itself reads `useLoadingSystem` from `@burdenoff/fe-libs/ui/loading/LoadingSystemProvider`.\n */\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { Loader2 } from 'lucide-react';\nimport { BrandLoader } from '@burdenoff/fe-libs/ui/loading/BrandLoader';\nimport { useLoadingSystem } from '@burdenoff/fe-libs/ui/loading/LoadingSystemProvider';\nimport { SectionLoader } from '@burdenoff/fe-libs/ui/loading/Loaders';\nimport {\n SpinnerIcon as SystemSpinnerIcon,\n type SpinnerIconProps,\n} from '@burdenoff/fe-libs/ui/loading/SpinnerIcon';\nimport { Skeleton } from '@burdenoff/fe-libs/ui/skeleton';\nimport { useShellLabel } from '@burdenoff/fe-libs/shared/providers/shell/useShellLabel';\n\n/**\n * A drop-in for `<Loader2 className=\"… animate-spin\" />`. Without the opt-in it IS this module's\n * `Loader2`, with exactly the props it was given: fe-libs resolves a newer lucide-react than the\n * module's (its icons add `aria-hidden`), so fe-libs' own `SpinnerIcon` would not draw the module's\n * spinner byte for byte. Under the opt-in, fe-libs' `SpinnerIcon`: the compact mark, sized from\n * the classes, `animate-spin` dropped; `tone=\"current\"` lights it in the label's colour (a filled\n * button).\n */\nexport function SpinnerIcon({ tone, ...props }: SpinnerIconProps) {\n const loadingSystem = useLoadingSystem();\n if (!loadingSystem) return <Loader2 {...props} />;\n return <SystemSpinnerIcon tone={tone} {...props} />;\n}\n\n/**\n * A spinner the module draws itself (a CSS ring, its own svg, a turning icon): `today` exactly\n * without the opt-in; under it, the compact mark. As fe-libs' `CompactMarkOr`, with the mark's\n * `tone`: in a filled button it lights in the label's colour (an accent light on an accent fill\n * would not show).\n */\nexport function CompactMarkOr({\n today,\n className,\n tone,\n}: {\n /** The spinner as the module draws it today. */\n today: ReactNode;\n /** The compact mark's classes (its size, its margins). */\n className?: string;\n tone?: 'brand' | 'current';\n}) {\n const loadingSystem = useLoadingSystem();\n if (!loadingSystem) return <>{today}</>;\n return <BrandLoader size=\"s\" tone={tone} className={className} />;\n}\n\n/** What today's block paints itself, which the system's skeleton paints instead. */\nconst TODAYS_PAINT = /^(?:[\\w-]+:)*(?:animate-pulse|animate-vc-shimmer|bg-\\S+)$/;\n\n/** A pulse block's classes under the opt-in: its size, shape and place, not its paint. */\nfunction skeletonClasses(className: string | undefined): string | undefined {\n const kept = (className ?? '')\n .split(/\\s+/)\n .filter((c) => c && !TODAYS_PAINT.test(c))\n .join(' ');\n return kept || undefined;\n}\n\nexport type SkeletonBlockProps = HTMLAttributes<HTMLElement> & {\n /** Today's element: a `span` stays a `span` (it may sit in a line of text). */\n as?: 'div' | 'span';\n};\n\n/**\n * A grey block standing in for content on its way: a drop-in for today's hand-made\n * `<div className=\"… animate-pulse bg-…\" />`. Without the opt-in it IS that element, with exactly\n * the props it was given, in their order; under it, the system's skeleton (one light passing, still\n * under reduced motion, hidden from assistive technology) in the block's size, shape and place.\n */\nexport function SkeletonBlock({ as = 'div', ...props }: SkeletonBlockProps) {\n const loadingSystem = useLoadingSystem();\n if (!loadingSystem) {\n const Today = as;\n return <Today {...props} />;\n }\n const { className, ...rest } = props;\n const kept = skeletonClasses(className);\n if (as === 'span') {\n // fe-libs' Skeleton is a div; in a line of text the same skeleton is a span (its attributes,\n // its corner unless the block sets its own).\n const corner = kept && /(?:^|\\s|:)rounded/.test(kept) ? '' : 'rounded-card';\n return (\n <span\n data-slot=\"skeleton\"\n data-loading-system=\"skeleton\"\n aria-hidden=\"true\"\n className={[corner, kept].filter(Boolean).join(' ')}\n {...rest}\n />\n );\n }\n return <Skeleton className={kept} {...(rest as HTMLAttributes<HTMLDivElement>)} />;\n}\n\n/**\n * A box that pulses as a whole around its grey blocks (today's `<div className=\"animate-pulse …\">`\n * with plain blocks inside): a drop-in for that element. Without the opt-in it IS that element,\n * prop for prop; under it, the same element without the pulse (its blocks are `SkeletonBlock`s,\n * each with the system's light).\n */\nexport type SkeletonGroupProps = HTMLAttributes<HTMLElement> & {\n /** Today's element. */\n as?: 'div' | 'span' | 'li' | 'section';\n};\n\nexport function SkeletonGroup({ as = 'div', ...props }: SkeletonGroupProps) {\n const loadingSystem = useLoadingSystem();\n const Today = as;\n if (!loadingSystem) return <Today {...props} />;\n const className =\n props.className\n ?.split(/\\s+/)\n .filter((c) => c && !/^(?:[\\w-]+:)*(?:animate-pulse|animate-vc-shimmer)$/.test(c))\n .join(' ') || undefined;\n return <Today {...props} className={className} />;\n}\n\nexport interface SectionLoaderOrProps {\n /** Today's loader, rendered exactly as it is without the opt-in. */\n today: ReactNode;\n /** What is loading, from today's words; the shell's \"Loading…\" when the box had none. */\n label?: string;\n /** Today's box height, so nothing moves when the content lands. */\n minHeight?: string;\n /** A page's loader (a route's code or its first data): it also runs the route wire. */\n route?: boolean;\n /** Where today's box sat (its grid span, margins). */\n className?: string;\n}\n\n/**\n * A box that waits on content of unknown shape. Without the opt-in it is `today`, exactly; under\n * it, fe-libs' `SectionLoader`: nothing for 300 ms, then the product's mark and the words, held at\n * least 600 ms, in a box of today's height.\n */\nexport function SectionLoaderOr({\n today,\n label,\n minHeight,\n route,\n className,\n}: SectionLoaderOrProps) {\n const loadingSystem = useLoadingSystem();\n const shellLabel = useShellLabel();\n if (!loadingSystem) return <>{today}</>;\n return (\n <SectionLoader\n label={label ?? shellLabel('loading.generic', 'Loading…')}\n minHeight={minHeight}\n route={route}\n className={className}\n />\n );\n}\n"],"mappings":";;;;;;;;;AA+BA,SAAgBA,EAAY,EAAE,SAAM,GAAGI,KAA2B;CAGhE,OAFsBC,EACjB,IACE,kBAACJ,GAAD;EAAyB;EAAM,GAAIG;CAAQ,CAAA,IADvB,kBAACG,GAAD,EAAS,GAAIH,EAAQ,CAAA;AAElD;AAQA,SAAgBI,EAAc,EAC5B,UACA,cACA,WAOC;CAGD,OAFsBH,EACjB,IACE,kBAACI,GAAD;EAAa,MAAK;EAAU;EAAiB;CAAY,CAAA,IADrC,kBAAAP,GAAA,EAAA,UAAGS,EAAQ,CAAA;AAExC;AA2FA,SAAgBC,EAAgB,EAC9B,UACA,UACA,cACA,UACA,gBACuB;CACvB,IAAMC,IAAgBR,EAAiB,GACjCS,IAAaC,EAAc;CAEjC,OADKF,IAEH,kBAACG,GAAD;EACE,OAAOC,KAASH,EAAW,mBAAmB,UAAU;EAC7C;EACJ;EACI;CACZ,CAAA,IAPwB,kBAAAZ,GAAA,EAAA,UAAGS,EAAQ,CAAA;AASxC"}
@@ -1,17 +1,24 @@
1
1
  import { useTr as e } from "../shared/hooks/useTr.js";
2
2
  import { BackToNotifications as t } from "./BackToNotifications.js";
3
3
  import { holdsAdminToolPermission as n } from "./useAdminTools.js";
4
- import { usePermissions as r } from "@burdenoff/fe-libs/shared/providers/shell";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import { AccessGate as o } from "@burdenoff/fe-libs/ui";
4
+ import { CompactMarkOr as r, SectionLoaderOr as i } from "../components/loadingSystem.js";
5
+ import { usePermissions as a } from "@burdenoff/fe-libs/shared/providers/shell";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
+ import { AccessGate as c } from "@burdenoff/fe-libs/ui";
7
8
  // src/navigation-v2/AdminPageV2.tsx
8
- function s() {
9
- return /* @__PURE__ */ i("div", {
10
- className: "flex h-64 items-center justify-center",
11
- children: /* @__PURE__ */ i("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
9
+ function l() {
10
+ return /* @__PURE__ */ o(i, {
11
+ minHeight: "16rem",
12
+ today: /* @__PURE__ */ o("div", {
13
+ className: "flex h-64 items-center justify-center",
14
+ children: /* @__PURE__ */ o(r, {
15
+ className: "h-8 w-8",
16
+ today: /* @__PURE__ */ o("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
17
+ })
18
+ })
12
19
  });
13
20
  }
14
- var c = {
21
+ var u = {
15
22
  send: {
16
23
  key: "notifications.v2.admin.send",
17
24
  fallback: "Send"
@@ -29,23 +36,23 @@ var c = {
29
36
  fallback: "Topics"
30
37
  }
31
38
  };
32
- function l({ tool: l, children: u, back: d = !0 }) {
33
- let f = e(), { hasPermission: p, isLoading: m } = r(), h = f(c[l].key, c[l].fallback), g = u;
34
- return m ? g = /* @__PURE__ */ i(s, {}) : n(l, p) || (g = /* @__PURE__ */ i(o, {
39
+ function d({ tool: r, children: i, back: d = !0 }) {
40
+ let f = e(), { hasPermission: p, isLoading: m } = a(), h = f(u[r].key, u[r].fallback), g = i;
41
+ return m ? g = /* @__PURE__ */ o(l, {}) : n(r, p) || (g = /* @__PURE__ */ o(c, {
35
42
  className: "py-16",
36
43
  message: f("notifications.v2.needAccess", "You need access to {{page}}", { page: h }),
37
44
  granterHint: f("notifications.v2.needAccessHint", "Ask a workspace admin to give your role this permission.")
38
- })), /* @__PURE__ */ a("div", {
45
+ })), /* @__PURE__ */ s("div", {
39
46
  className: "flex h-full flex-col",
40
- children: [d && /* @__PURE__ */ i("div", {
47
+ children: [d && /* @__PURE__ */ o("div", {
41
48
  className: "px-3 pt-2 sm:px-4",
42
- children: /* @__PURE__ */ i(t, {})
43
- }), /* @__PURE__ */ i("div", {
49
+ children: /* @__PURE__ */ o(t, {})
50
+ }), /* @__PURE__ */ o("div", {
44
51
  className: "min-h-0 flex-1",
45
52
  children: g
46
53
  })]
47
54
  });
48
55
  }
49
- export { l as AdminPageV2 };
56
+ export { d as AdminPageV2 };
50
57
 
51
58
  //# sourceMappingURL=AdminPageV2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdminPageV2.js","names":["PageLoader","PAGE_NAMES","AdminPageV2","tr","useTr","usePermissions","name","tool","body","children","isLoading","holdsAdminToolPermission","hasPermission","AccessGate","back","BackToNotifications"],"sources":["../../src/navigation-v2/AdminPageV2.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { AccessGate } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../shared/hooks/useTr';\nimport { BackToNotifications } from './BackToNotifications';\nimport { holdsAdminToolPermission, type AdminToolId } from './useAdminTools';\n\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\nconst PAGE_NAMES: Record<AdminToolId, { key: string; fallback: string }> = {\n send: { key: 'notifications.v2.admin.send', fallback: 'Send' },\n deliveryLog: { key: 'notifications.v2.admin.deliveryLog', fallback: 'Delivery log' },\n templates: { key: 'notifications.v2.admin.templates', fallback: 'Templates' },\n topics: { key: 'notifications.v2.admin.topics', fallback: 'Topics' },\n};\n\n/**\n * A Navigation v2 admin page (BOFF-11872): \"‹ Notifications\" above it, and a\n * route-level gate (§8 item 1). Someone without the permission sees \"You need\n * access\" instead of loading a page they cannot use; the page's own in-page\n * checks stay as they are.\n */\nexport function AdminPageV2({\n tool,\n children,\n back = true,\n}: {\n tool: AdminToolId;\n children: ReactNode;\n /** False for a page with its own back button (Send). */\n back?: boolean;\n}) {\n const tr = useTr();\n const { hasPermission, isLoading } = usePermissions();\n const name = tr(PAGE_NAMES[tool].key, PAGE_NAMES[tool].fallback);\n let body: ReactNode = children;\n if (isLoading) body = <PageLoader />;\n else if (!holdsAdminToolPermission(tool, hasPermission)) {\n body = (\n <AccessGate\n className=\"py-16\"\n message={tr('notifications.v2.needAccess', 'You need access to {{page}}', { page: name })}\n granterHint={tr(\n 'notifications.v2.needAccessHint',\n 'Ask a workspace admin to give your role this permission.'\n )}\n />\n );\n }\n return (\n <div className=\"flex h-full flex-col\">\n {back && (\n <div className=\"px-3 pt-2 sm:px-4\">\n <BackToNotifications />\n </div>\n )}\n <div className=\"min-h-0 flex-1\">{body}</div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAOA,SAASA,IAAa;CACpB,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA;AAET;AAEA,IAAMC,IAAqE;CACzE,MAAM;EAAE,KAAK;EAA+B,UAAU;CAAO;CAC7D,aAAa;EAAE,KAAK;EAAsC,UAAU;CAAe;CACnF,WAAW;EAAE,KAAK;EAAoC,UAAU;CAAY;CAC5E,QAAQ;EAAE,KAAK;EAAiC,UAAU;CAAS;AACrE;AAQA,SAAgBC,EAAY,EAC1B,SACA,aACA,UAAO,MAMN;CACD,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,iBAAcC,EAAe,GAC9CC,IAAOH,EAAGF,EAAWM,EAAK,CAAC,KAAKN,EAAWM,EAAK,CAAC,QAAQ,GAC3DC,IAAkBC;CActB,OAbIC,IAAW,IAAO,kBAACV,GAAD,CAAa,CAAA,IACzBW,EAAyBJ,GAAMK,CAAa,MACpD,IACE,kBAACC,GAAD;EACE,WAAU;EACV,SAASV,EAAG,+BAA+B,+BAA+B,EAAE,MAAMG,EAAK,CAAC;EACxF,aAAaH,EACX,mCACA,0DACF;CACD,CAAA,IAIH,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACGW,KACC,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD,CAAsB,CAAA;EACnB,CAAA,GAEP,kBAAC,OAAD;GAAK,WAAU;GAAkB,UAAAP;EAAU,CAAA,CACxC;;AAET"}
1
+ {"version":3,"file":"AdminPageV2.js","names":["PageLoader","SectionLoaderOr","CompactMarkOr","PAGE_NAMES","AdminPageV2","tr","useTr","usePermissions","name","tool","body","children","isLoading","holdsAdminToolPermission","hasPermission","AccessGate","back","BackToNotifications"],"sources":["../../src/navigation-v2/AdminPageV2.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { AccessGate } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../shared/hooks/useTr';\nimport { BackToNotifications } from './BackToNotifications';\nimport { holdsAdminToolPermission, type AdminToolId } from './useAdminTools';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nfunction PageLoader() {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n}\n\nconst PAGE_NAMES: Record<AdminToolId, { key: string; fallback: string }> = {\n send: { key: 'notifications.v2.admin.send', fallback: 'Send' },\n deliveryLog: { key: 'notifications.v2.admin.deliveryLog', fallback: 'Delivery log' },\n templates: { key: 'notifications.v2.admin.templates', fallback: 'Templates' },\n topics: { key: 'notifications.v2.admin.topics', fallback: 'Topics' },\n};\n\n/**\n * A Navigation v2 admin page (BOFF-11872): \"‹ Notifications\" above it, and a\n * route-level gate (§8 item 1). Someone without the permission sees \"You need\n * access\" instead of loading a page they cannot use; the page's own in-page\n * checks stay as they are.\n */\nexport function AdminPageV2({\n tool,\n children,\n back = true,\n}: {\n tool: AdminToolId;\n children: ReactNode;\n /** False for a page with its own back button (Send). */\n back?: boolean;\n}) {\n const tr = useTr();\n const { hasPermission, isLoading } = usePermissions();\n const name = tr(PAGE_NAMES[tool].key, PAGE_NAMES[tool].fallback);\n let body: ReactNode = children;\n if (isLoading) body = <PageLoader />;\n else if (!holdsAdminToolPermission(tool, hasPermission)) {\n body = (\n <AccessGate\n className=\"py-16\"\n message={tr('notifications.v2.needAccess', 'You need access to {{page}}', { page: name })}\n granterHint={tr(\n 'notifications.v2.needAccessHint',\n 'Ask a workspace admin to give your role this permission.'\n )}\n />\n );\n }\n return (\n <div className=\"flex h-full flex-col\">\n {back && (\n <div className=\"px-3 pt-2 sm:px-4\">\n <BackToNotifications />\n </div>\n )}\n <div className=\"min-h-0 flex-1\">{body}</div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAQA,SAASA,IAAa;CACpB,OACE,kBAACC,GAAD;EACE,WAAU;EACV,OACE,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD;IACE,WAAU;IACV,OACE,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;GAEpG,CAAA;EACE,CAAA;CAER,CAAA;AAEL;AAEA,IAAMC,IAAqE;CACzE,MAAM;EAAE,KAAK;EAA+B,UAAU;CAAO;CAC7D,aAAa;EAAE,KAAK;EAAsC,UAAU;CAAe;CACnF,WAAW;EAAE,KAAK;EAAoC,UAAU;CAAY;CAC5E,QAAQ;EAAE,KAAK;EAAiC,UAAU;CAAS;AACrE;AAQA,SAAgBC,EAAY,EAC1B,SACA,aACA,UAAO,MAMN;CACD,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,iBAAcC,EAAe,GAC9CC,IAAOH,EAAGF,EAAWM,EAAK,CAAC,KAAKN,EAAWM,EAAK,CAAC,QAAQ,GAC3DC,IAAkBC;CActB,OAbIC,IAAW,IAAO,kBAACZ,GAAD,CAAa,CAAA,IACzBa,EAAyBJ,GAAMK,CAAa,MACpD,IACE,kBAACC,GAAD;EACE,WAAU;EACV,SAASV,EAAG,+BAA+B,+BAA+B,EAAE,MAAMG,EAAK,CAAC;EACxF,aAAaH,EACX,mCACA,0DACF;CACD,CAAA,IAIH,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACGW,KACC,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD,CAAsB,CAAA;EACnB,CAAA,GAEP,kBAAC,OAAD;GAAK,WAAU;GAAkB,UAAAP;EAAU,CAAA,CACxC;;AAET"}
@@ -10,173 +10,180 @@ import { inArchivedView as s } from "./inboxFilters.js";
10
10
  import { exportNotificationsAsCsv as c } from "../utils/notificationHistoryExport.js";
11
11
  import { BackToNotifications as l } from "./BackToNotifications.js";
12
12
  import { MoreFiltersButton as u, SearchField as d, ViewChips as f } from "./FilterControls.js";
13
- import { useMemo as p, useState as m } from "react";
14
- import { usePermissions as h } from "@burdenoff/fe-libs/shared/providers/shell";
15
- import { Download as g, MoreHorizontal as _ } from "lucide-react";
16
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
17
- import { Button as b, DropdownMenu as x, DropdownMenuContent as S, DropdownMenuItem as C, DropdownMenuTrigger as w, IllustratedEmptyState as T, Input as E, NativeSelect as D, useRememberedOpen as O } from "@burdenoff/fe-libs/ui";
13
+ import { CompactMarkOr as p, SectionLoaderOr as ee } from "../components/loadingSystem.js";
14
+ import { useMemo as m, useState as h } from "react";
15
+ import { usePermissions as g } from "@burdenoff/fe-libs/shared/providers/shell";
16
+ import { Download as _, MoreHorizontal as v } from "lucide-react";
17
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
18
+ import { Button as x, DropdownMenu as S, DropdownMenuContent as C, DropdownMenuItem as w, DropdownMenuTrigger as T, IllustratedEmptyState as E, Input as D, NativeSelect as O, useRememberedOpen as k } from "@burdenoff/fe-libs/ui";
18
19
  // src/navigation-v2/NotificationArchivedV2.tsx
19
- var k = {
20
+ var A = {
20
21
  archived: null,
21
22
  channel: "ALL"
22
- }, A = "ALL";
23
- function j(e) {
23
+ }, j = "ALL";
24
+ function M(e) {
24
25
  return e ? e.toISOString().split("T")[0] : "";
25
26
  }
26
- function M() {
27
- let M = o(), { hasPermission: N, isLoading: ee } = h(), { currentUser: P } = a(), { topics: F } = n({ isActive: !0 }), { notifications: I, hasMore: L, isLoadingMore: R, loadMore: z, notificationFilter: B, updateFilter: V, archiveNotification: H, unarchiveNotification: U, recordAction: W } = t({ baseFilter: k }), [G, K] = m("archived"), [q, J] = O("notifications.archived.moreFilters", !1), Y = p(() => I.filter((e) => s(e, G)), [I, G]), X = !!(B.topicId || B.dateRange.start || B.dateRange.end), Z = !!B.search || X;
28
- if (ee) return /* @__PURE__ */ v("div", {
29
- className: "flex h-64 items-center justify-center",
30
- children: /* @__PURE__ */ v("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
27
+ function N() {
28
+ let N = o(), { hasPermission: P, isLoading: F } = g(), { currentUser: I } = a(), { topics: L } = n({ isActive: !0 }), { notifications: R, hasMore: z, isLoadingMore: B, loadMore: V, notificationFilter: H, updateFilter: U, archiveNotification: W, unarchiveNotification: G, recordAction: K } = t({ baseFilter: A }), [q, J] = h("archived"), [Y, X] = k("notifications.archived.moreFilters", !1), Z = m(() => R.filter((e) => s(e, q)), [R, q]), Q = !!(H.topicId || H.dateRange.start || H.dateRange.end), $ = !!H.search || Q;
29
+ if (F) return /* @__PURE__ */ y(ee, {
30
+ minHeight: "16rem",
31
+ today: /* @__PURE__ */ y("div", {
32
+ className: "flex h-64 items-center justify-center",
33
+ children: /* @__PURE__ */ y(p, {
34
+ className: "h-8 w-8",
35
+ today: /* @__PURE__ */ y("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
36
+ })
37
+ })
31
38
  });
32
- if (!N(i.NOTIFICATION_LIST) && !P?.id) return /* @__PURE__ */ v("div", {
39
+ if (!P(i.NOTIFICATION_LIST) && !I?.id) return /* @__PURE__ */ y("div", {
33
40
  className: "p-8 text-center text-text-secondary",
34
- children: M("notifications.noPermissionHistory", "You don't have permission to view notification history.")
41
+ children: N("notifications.noPermissionHistory", "You don't have permission to view notification history.")
35
42
  });
36
- let Q = [{
43
+ let te = [{
37
44
  id: "archived",
38
- label: M("notifications.v2.archived", "Archived")
45
+ label: N("notifications.v2.archived", "Archived")
39
46
  }, {
40
47
  id: "everything",
41
- label: M("notifications.v2.everything", "Everything")
42
- }], $ = [{
43
- value: A,
44
- label: M("notifications.allTopics", "All Topics")
45
- }, ...F.map((e) => ({
48
+ label: N("notifications.v2.everything", "Everything")
49
+ }], ne = [{
50
+ value: j,
51
+ label: N("notifications.allTopics", "All Topics")
52
+ }, ...L.map((e) => ({
46
53
  value: e.id,
47
54
  label: e.name
48
55
  }))];
49
- return /* @__PURE__ */ y("div", {
56
+ return /* @__PURE__ */ b("div", {
50
57
  className: "mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6",
51
58
  children: [
52
- /* @__PURE__ */ v(l, {}),
53
- /* @__PURE__ */ y("header", {
59
+ /* @__PURE__ */ y(l, {}),
60
+ /* @__PURE__ */ b("header", {
54
61
  "data-tour": "notification-history-header",
55
62
  className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
56
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
63
+ children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h1", {
57
64
  className: "text-xl font-semibold text-text-primary sm:text-2xl",
58
- children: M("notifications.v2.archivedTitle", "Archived")
59
- }), /* @__PURE__ */ v("p", {
65
+ children: N("notifications.v2.archivedTitle", "Archived")
66
+ }), /* @__PURE__ */ y("p", {
60
67
  className: "mt-1 text-sm text-text-secondary",
61
- children: M("notifications.v2.archivedSubtitle", "Notifications you archived. Restore one to put it back in your inbox.")
62
- })] }), /* @__PURE__ */ y(x, { children: [/* @__PURE__ */ v(w, {
68
+ children: N("notifications.v2.archivedSubtitle", "Notifications you archived. Restore one to put it back in your inbox.")
69
+ })] }), /* @__PURE__ */ b(S, { children: [/* @__PURE__ */ y(T, {
63
70
  asChild: !0,
64
- children: /* @__PURE__ */ v(b, {
71
+ children: /* @__PURE__ */ y(x, {
65
72
  variant: "ghost",
66
73
  size: "icon",
67
- "aria-label": M("notifications.v2.moreActions", "More actions"),
74
+ "aria-label": N("notifications.v2.moreActions", "More actions"),
68
75
  "data-testid": "notifications-archived-overflow",
69
- children: /* @__PURE__ */ v(_, {
76
+ children: /* @__PURE__ */ y(v, {
70
77
  size: 18,
71
78
  "aria-hidden": "true"
72
79
  })
73
80
  })
74
- }), /* @__PURE__ */ v(S, {
81
+ }), /* @__PURE__ */ y(C, {
75
82
  align: "end",
76
- children: /* @__PURE__ */ y(C, {
83
+ children: /* @__PURE__ */ b(w, {
77
84
  "data-tour": "notification-history-export",
78
- disabled: I.length === 0,
79
- onSelect: () => c(M, I),
80
- children: [/* @__PURE__ */ v(g, {
85
+ disabled: R.length === 0,
86
+ onSelect: () => c(N, R),
87
+ children: [/* @__PURE__ */ y(_, {
81
88
  size: 16,
82
89
  "aria-hidden": "true"
83
- }), M("notifications.v2.downloadSpreadsheet", "Download as spreadsheet")]
90
+ }), N("notifications.v2.downloadSpreadsheet", "Download as spreadsheet")]
84
91
  })
85
92
  })] })]
86
93
  }),
87
- /* @__PURE__ */ y("section", {
88
- "aria-label": M("notifications.v2.filters", "Filters"),
94
+ /* @__PURE__ */ b("section", {
95
+ "aria-label": N("notifications.v2.filters", "Filters"),
89
96
  className: "space-y-3",
90
- children: [/* @__PURE__ */ y("div", {
97
+ children: [/* @__PURE__ */ b("div", {
91
98
  className: "flex flex-col gap-3 sm:flex-row sm:items-center",
92
- children: [/* @__PURE__ */ v(d, {
93
- label: M("notifications.searchByTitleOrContent", "Search by title or content..."),
94
- value: B.search,
95
- onChange: (e) => V({ search: e })
96
- }), /* @__PURE__ */ y("div", {
99
+ children: [/* @__PURE__ */ y(d, {
100
+ label: N("notifications.searchByTitleOrContent", "Search by title or content..."),
101
+ value: H.search,
102
+ onChange: (e) => U({ search: e })
103
+ }), /* @__PURE__ */ b("div", {
97
104
  className: "flex flex-wrap items-center gap-2",
98
- children: [/* @__PURE__ */ v(f, {
99
- chips: Q,
100
- value: G,
101
- onChange: K,
105
+ children: [/* @__PURE__ */ y(f, {
106
+ chips: te,
107
+ value: q,
108
+ onChange: J,
102
109
  testIdPrefix: "notifications-archived-view"
103
- }), /* @__PURE__ */ v(u, {
104
- open: q,
105
- active: X,
110
+ }), /* @__PURE__ */ y(u, {
111
+ open: Y,
112
+ active: Q,
106
113
  controls: "notifications-archived-more-filters",
107
- onToggle: () => J(!q)
114
+ onToggle: () => X(!Y)
108
115
  })]
109
116
  })]
110
- }), /* @__PURE__ */ y("div", {
117
+ }), /* @__PURE__ */ b("div", {
111
118
  id: "notifications-archived-more-filters",
112
- hidden: !q,
119
+ hidden: !Y,
113
120
  className: "grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-3",
114
121
  children: [
115
- /* @__PURE__ */ v(D, {
116
- "aria-label": M("notifications.v2.topicFilter", "Topic"),
117
- options: $,
118
- value: B.topicId || A,
119
- onValueChange: (e) => V({ topicId: e === A ? void 0 : e })
122
+ /* @__PURE__ */ y(O, {
123
+ "aria-label": N("notifications.v2.topicFilter", "Topic"),
124
+ options: ne,
125
+ value: H.topicId || j,
126
+ onValueChange: (e) => U({ topicId: e === j ? void 0 : e })
120
127
  }),
121
- /* @__PURE__ */ v(E, {
128
+ /* @__PURE__ */ y(D, {
122
129
  type: "date",
123
- "aria-label": M("notifications.startDate", "Start date"),
124
- value: j(B.dateRange.start),
125
- onChange: (e) => V({ dateRange: {
126
- ...B.dateRange,
130
+ "aria-label": N("notifications.startDate", "Start date"),
131
+ value: M(H.dateRange.start),
132
+ onChange: (e) => U({ dateRange: {
133
+ ...H.dateRange,
127
134
  start: e.target.value ? new Date(e.target.value) : null
128
135
  } })
129
136
  }),
130
- /* @__PURE__ */ v(E, {
137
+ /* @__PURE__ */ y(D, {
131
138
  type: "date",
132
- "aria-label": M("notifications.endDate", "End date"),
133
- value: j(B.dateRange.end),
134
- onChange: (e) => V({ dateRange: {
135
- ...B.dateRange,
139
+ "aria-label": N("notifications.endDate", "End date"),
140
+ value: M(H.dateRange.end),
141
+ onChange: (e) => U({ dateRange: {
142
+ ...H.dateRange,
136
143
  end: e.target.value ? new Date(e.target.value) : null
137
144
  } })
138
145
  })
139
146
  ]
140
147
  })]
141
148
  }),
142
- /* @__PURE__ */ v("div", {
149
+ /* @__PURE__ */ y("div", {
143
150
  className: "space-y-2",
144
- children: Y.length > 0 ? Y.map((t) => /* @__PURE__ */ y("div", {
151
+ children: Z.length > 0 ? Z.map((t) => /* @__PURE__ */ b("div", {
145
152
  className: "space-y-2",
146
- children: [/* @__PURE__ */ v(e, {
153
+ children: [/* @__PURE__ */ y(e, {
147
154
  notification: t,
148
- onArchive: t.archivedAt ? void 0 : H,
149
- onAction: W,
155
+ onArchive: t.archivedAt ? void 0 : W,
156
+ onAction: K,
150
157
  showArchivedState: !0,
151
158
  analyticsSource: "history",
152
159
  navigationV2: !0,
153
- showTopic: q
154
- }), t.archivedAt && /* @__PURE__ */ v("div", {
160
+ showTopic: Y
161
+ }), t.archivedAt && /* @__PURE__ */ y("div", {
155
162
  className: "flex justify-end",
156
- children: /* @__PURE__ */ v(b, {
163
+ children: /* @__PURE__ */ y(x, {
157
164
  type: "button",
158
165
  variant: "outline",
159
166
  size: "sm",
160
- onClick: () => U(t.id),
161
- children: M("notifications.restore", "Restore")
167
+ onClick: () => G(t.id),
168
+ children: N("notifications.restore", "Restore")
162
169
  })
163
170
  })]
164
- }, t.id)) : /* @__PURE__ */ v(T, {
165
- illustration: Z ? "empty-search" : "empty-notifications",
166
- title: Z ? M("notifications.noNotificationsFound", "No notifications found") : G === "archived" ? M("notifications.v2.archivedEmptyTitle", "Nothing archived") : M("notifications.historyEmptyTitle", "No history yet"),
167
- description: Z ? M("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : G === "archived" ? M("notifications.v2.archivedEmptyDescription", "Archive a notification from your inbox and it moves here.") : M("notifications.historyEmptyDescription", "Notifications you receive will be archived here so you can always find them again."),
168
- kind: B.search ? "no-results" : Z ? "filtered" : "first-use"
171
+ }, t.id)) : /* @__PURE__ */ y(E, {
172
+ illustration: $ ? "empty-search" : "empty-notifications",
173
+ title: $ ? N("notifications.noNotificationsFound", "No notifications found") : q === "archived" ? N("notifications.v2.archivedEmptyTitle", "Nothing archived") : N("notifications.historyEmptyTitle", "No history yet"),
174
+ description: $ ? N("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : q === "archived" ? N("notifications.v2.archivedEmptyDescription", "Archive a notification from your inbox and it moves here.") : N("notifications.historyEmptyDescription", "Notifications you receive will be archived here so you can always find them again."),
175
+ kind: H.search ? "no-results" : $ ? "filtered" : "first-use"
169
176
  })
170
177
  }),
171
- /* @__PURE__ */ v(r, {
172
- hasMore: L,
173
- isLoadingMore: R,
174
- onLoadMore: z,
175
- shownCount: Y.length
178
+ /* @__PURE__ */ y(r, {
179
+ hasMore: z,
180
+ isLoadingMore: B,
181
+ onLoadMore: V,
182
+ shownCount: Z.length
176
183
  })
177
184
  ]
178
185
  });
179
186
  }
180
- export { M as NotificationArchivedV2 };
187
+ export { N as NotificationArchivedV2 };
181
188
 
182
189
  //# sourceMappingURL=NotificationArchivedV2.js.map