@burdenoff/microfe-notification 2026.1114.1 → 2026.1117.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 (35) hide show
  1. package/dist/NotificationRoot.d.ts +16 -0
  2. package/dist/NotificationRoot.js +33 -26
  3. package/dist/NotificationRoot.js.map +1 -1
  4. package/dist/NotificationRoutes.js +72 -68
  5. package/dist/NotificationRoutes.js.map +1 -1
  6. package/dist/components/FeatureDisabledPage.js +2 -2
  7. package/dist/components/FeatureDisabledPage.js.map +1 -1
  8. package/dist/components/NotificationCard.js +6 -6
  9. package/dist/components/NotificationCard.js.map +1 -1
  10. package/dist/components/NotificationPanel.js +1 -1
  11. package/dist/components/NotificationPanel.js.map +1 -1
  12. package/dist/components/TemplatePreview.js +5 -5
  13. package/dist/components/TemplatePreview.js.map +1 -1
  14. package/dist/navigation-v2/NotificationsV2Landing.d.ts +9 -3
  15. package/dist/navigation-v2/NotificationsV2Landing.js +16 -12
  16. package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -1
  17. package/dist/navigation-v2/paths.js +1 -1
  18. package/dist/navigation-v2/paths.js.map +1 -1
  19. package/dist/pages/CreateNotificationPage.js +6 -4
  20. package/dist/pages/CreateNotificationPage.js.map +1 -1
  21. package/dist/pages/NotificationCenterPage.js +1 -1
  22. package/dist/pages/NotificationCenterPage.js.map +1 -1
  23. package/dist/pages/NotificationHistoryAdminPage.js +13 -13
  24. package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
  25. package/dist/pages/NotificationHistoryPage.js +2 -2
  26. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  27. package/dist/pages/NotificationPreferencesPage.js +6 -6
  28. package/dist/pages/NotificationPreferencesPage.js.map +1 -1
  29. package/dist/pages/NotificationTemplatesPage.js +6 -6
  30. package/dist/pages/NotificationTemplatesPage.js.map +1 -1
  31. package/dist/pages/NotificationTopicsPage.js +12 -12
  32. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  33. package/dist/pages/TemplateEditorPage.js +2 -2
  34. package/dist/pages/TemplateEditorPage.js.map +1 -1
  35. package/package.json +1 -1
@@ -74,7 +74,7 @@ function l({ onViewAll: l }) {
74
74
  className: "text-tertiary mb-4"
75
75
  }),
76
76
  /* @__PURE__ */ s("p", {
77
- className: "text-sm text-secondary",
77
+ className: "text-sm text-text-secondary",
78
78
  children: u("notifCommon.noNotifications", "No notifications")
79
79
  }),
80
80
  /* @__PURE__ */ s("p", {
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationPanel.js","names":["_Fragment","NotificationPanel","tr","useTr","useNotificationStore","useNotifications","isPanelOpen","recentNotifications","notifications","Fragment","togglePanel","Bell","unreadCount","markAllAsRead","X","NotificationCard","markAsRead","archiveNotification","recordAction","notification","onViewAll"],"sources":["../../src/components/NotificationPanel.tsx"],"sourcesContent":["import { X, Bell } from 'lucide-react';\nimport { useNotificationStore } from '../store/notificationStore';\nimport { useNotifications } from '../hooks';\nimport { NotificationCard } from './NotificationCard';\nimport { useTr } from '../shared/hooks/useTr';\n\ninterface NotificationPanelProps {\n onViewAll?: () => void;\n}\n\n/**\n * Notification dropdown panel\n *\n * Quick view of recent notifications that appears when clicking the bell icon\n */\nexport function NotificationPanel({ onViewAll }: NotificationPanelProps) {\n const tr = useTr();\n const { isPanelOpen, togglePanel } = useNotificationStore();\n const {\n notifications,\n unreadCount,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n } = useNotifications();\n\n if (!isPanelOpen) return null;\n\n // Show only the 5 most recent notifications\n const recentNotifications = notifications.slice(0, 5);\n\n return (\n <>\n {/* Backdrop */}\n <div className=\"fixed inset-0 z-40\" onClick={togglePanel} aria-hidden=\"true\" />\n\n {/* Panel */}\n <div\n data-tour=\"notification-panel\"\n className=\"absolute right-0 top-full mt-2 w-96 max-h-[600px] bg-gloss-card border border-border-seam rounded-lg shadow-[var(--shadow-pop)] z-50 overflow-hidden flex flex-col animate-in fade-in slide-in-from-top-2 duration-200\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between p-4 border-b border-border-seam bg-accent-wash\">\n <div className=\"flex items-center gap-2\">\n <Bell size={20} className=\"text-primary\" />\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifCommon.notifications', 'Notifications')}\n </h2>\n {unreadCount > 0 && (\n <span className=\"px-2 py-0.5 text-xs font-semibold tabular-nums text-white bg-primary-500 rounded-full\">\n {unreadCount}\n </span>\n )}\n </div>\n\n <div className=\"flex items-center gap-2\">\n {unreadCount > 0 && (\n <button\n data-tour=\"notification-panel-mark-all-read\"\n onClick={markAllAsRead}\n className=\"text-xs text-accent-primary hover:text-accent-primary/80 transition-colors duration-150\"\n >\n {tr('notifCommon.markAllRead', 'Mark all read')}\n </button>\n )}\n <button\n onClick={togglePanel}\n className=\"p-1 hover:bg-bg-sunken rounded transition-colors duration-150\"\n aria-label={tr('notifCommon.closePanel', 'Close panel')}\n >\n <X size={16} className=\"text-tertiary\" />\n </button>\n </div>\n </div>\n\n {/* Notifications list */}\n <div className=\"flex-1 overflow-y-auto\">\n {recentNotifications.length > 0 ? (\n <div className=\"flex flex-col gap-2 p-2\">\n {recentNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n compact\n analyticsSource=\"panel\"\n />\n ))}\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-center p-8 text-center animate-in fade-in duration-200\">\n <Bell size={48} className=\"text-tertiary mb-4\" />\n <p className=\"text-sm text-secondary\">\n {tr('notifCommon.noNotifications', 'No notifications')}\n </p>\n <p className=\"text-xs text-tertiary mt-1\">\n {tr('notifCommon.allCaughtUp', \"You're all caught up!\")}\n </p>\n </div>\n )}\n </div>\n\n {/* Footer */}\n {recentNotifications.length > 0 && (\n <div className=\"p-3 border-t border-default\">\n <button\n data-tour=\"notification-panel-view-all\"\n onClick={() => {\n togglePanel();\n if (onViewAll) onViewAll();\n }}\n className=\"w-full py-2 text-sm text-accent-primary hover:text-accent-primary/80 font-medium transition-colors duration-150\"\n >\n {tr('notifCommon.viewAllNotifications', 'View All Notifications')}\n </button>\n </div>\n )}\n </div>\n </>\n );\n}\n"],"mappings":";;;;;;;;AAeA,SAAgBC,EAAkB,EAAE,gBAAqC;CACvE,IAAMC,IAAKC,EAAM,GACX,EAAE,gBAAa,mBAAgBC,EAAqB,GACpD,EACJ,kBACA,gBACA,eACA,kBACA,wBACA,oBACEC,EAAiB;CAErB,IAAI,CAACC,GAAa,OAAO;CAGzB,IAAMC,IAAsBC,EAAc,MAAM,GAAG,CAAC;CAEpD,OACE,kBAAAR,GAAA,EAAA,UAAA,CAEE,kBAAC,OAAD;EAAK,WAAU;EAAqB,SAASU;EAAa,eAAY;CAAQ,CAAA,GAG9E,kBAAC,OAAD;EACE,aAAU;EACV,WAAU;EAFZ,UAAA;GAKE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA;MACE,kBAACC,GAAD;OAAM,MAAM;OAAI,WAAU;MAAgB,CAAA;MAC1C,kBAAC,MAAD;OAAI,WAAU;OACX,UAAAT,EAAG,6BAA6B,eAAe;MAC9C,CAAA;MACHU,IAAc,KACb,kBAAC,QAAD;OAAM,WAAU;OACb,UAAAA;MACG,CAAA;KAEL;IAEL,CAAA,GAAA,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACGA,IAAc,KACb,kBAAC,UAAD;MACE,aAAU;MACV,SAASC;MACT,WAAU;MAET,UAAAX,EAAG,2BAA2B,eAAe;KACxC,CAAA,GAEV,kBAAC,UAAD;MACE,SAASQ;MACT,WAAU;MACV,cAAYR,EAAG,0BAA0B,aAAa;MAEtD,UAAA,kBAACY,GAAD;OAAG,MAAM;OAAI,WAAU;MAAiB,CAAA;KAClC,CAAA,CACL;IACF,CAAA,CAAA;;GAGL,kBAAC,OAAD;IAAK,WAAU;IACZ,UAAAP,EAAoB,SAAS,IAC5B,kBAAC,OAAD;KAAK,WAAU;KACZ,UAAAA,EAAoB,KAAK,MACxB,kBAACQ,GAAD;MAEgB;MACd,cAAcC;MACd,WAAWC;MACX,UAAUC;MACV,SAAA;MACA,iBAAgB;KACjB,GAPMC,EAAa,EAOnB,CACF;IACE,CAAA,IAEL,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA;MACE,kBAACR,GAAD;OAAM,MAAM;OAAI,WAAU;MAAsB,CAAA;MAChD,kBAAC,KAAD;OAAG,WAAU;OACV,UAAAT,EAAG,+BAA+B,kBAAkB;MACpD,CAAA;MACH,kBAAC,KAAD;OAAG,WAAU;OACV,UAAAA,EAAG,2BAA2B,uBAAuB;MACrD,CAAA;KACA;;GAEJ,CAAA;GAGJK,EAAoB,SAAS,KAC5B,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,kBAAC,UAAD;KACE,aAAU;KACV,eAAe;MAEb,AADAG,EAAY,GACRU,KAAWA,EAAU;KAC3B;KACA,WAAU;KAET,UAAAlB,EAAG,oCAAoC,wBAAwB;IAC1D,CAAA;GACL,CAAA;EAEJ;CACL,CAAA,CAAA,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"NotificationPanel.js","names":["_Fragment","NotificationPanel","tr","useTr","useNotificationStore","useNotifications","isPanelOpen","recentNotifications","notifications","Fragment","togglePanel","Bell","unreadCount","markAllAsRead","X","NotificationCard","markAsRead","archiveNotification","recordAction","notification","onViewAll"],"sources":["../../src/components/NotificationPanel.tsx"],"sourcesContent":["import { X, Bell } from 'lucide-react';\nimport { useNotificationStore } from '../store/notificationStore';\nimport { useNotifications } from '../hooks';\nimport { NotificationCard } from './NotificationCard';\nimport { useTr } from '../shared/hooks/useTr';\n\ninterface NotificationPanelProps {\n onViewAll?: () => void;\n}\n\n/**\n * Notification dropdown panel\n *\n * Quick view of recent notifications that appears when clicking the bell icon\n */\nexport function NotificationPanel({ onViewAll }: NotificationPanelProps) {\n const tr = useTr();\n const { isPanelOpen, togglePanel } = useNotificationStore();\n const {\n notifications,\n unreadCount,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n } = useNotifications();\n\n if (!isPanelOpen) return null;\n\n // Show only the 5 most recent notifications\n const recentNotifications = notifications.slice(0, 5);\n\n return (\n <>\n {/* Backdrop */}\n <div className=\"fixed inset-0 z-40\" onClick={togglePanel} aria-hidden=\"true\" />\n\n {/* Panel */}\n <div\n data-tour=\"notification-panel\"\n className=\"absolute right-0 top-full mt-2 w-96 max-h-[600px] bg-gloss-card border border-border-seam rounded-lg shadow-[var(--shadow-pop)] z-50 overflow-hidden flex flex-col animate-in fade-in slide-in-from-top-2 duration-200\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between p-4 border-b border-border-seam bg-accent-wash\">\n <div className=\"flex items-center gap-2\">\n <Bell size={20} className=\"text-primary\" />\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifCommon.notifications', 'Notifications')}\n </h2>\n {unreadCount > 0 && (\n <span className=\"px-2 py-0.5 text-xs font-semibold tabular-nums text-white bg-primary-500 rounded-full\">\n {unreadCount}\n </span>\n )}\n </div>\n\n <div className=\"flex items-center gap-2\">\n {unreadCount > 0 && (\n <button\n data-tour=\"notification-panel-mark-all-read\"\n onClick={markAllAsRead}\n className=\"text-xs text-accent-primary hover:text-accent-primary/80 transition-colors duration-150\"\n >\n {tr('notifCommon.markAllRead', 'Mark all read')}\n </button>\n )}\n <button\n onClick={togglePanel}\n className=\"p-1 hover:bg-bg-sunken rounded transition-colors duration-150\"\n aria-label={tr('notifCommon.closePanel', 'Close panel')}\n >\n <X size={16} className=\"text-tertiary\" />\n </button>\n </div>\n </div>\n\n {/* Notifications list */}\n <div className=\"flex-1 overflow-y-auto\">\n {recentNotifications.length > 0 ? (\n <div className=\"flex flex-col gap-2 p-2\">\n {recentNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n compact\n analyticsSource=\"panel\"\n />\n ))}\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-center p-8 text-center animate-in fade-in duration-200\">\n <Bell size={48} className=\"text-tertiary mb-4\" />\n <p className=\"text-sm text-text-secondary\">\n {tr('notifCommon.noNotifications', 'No notifications')}\n </p>\n <p className=\"text-xs text-tertiary mt-1\">\n {tr('notifCommon.allCaughtUp', \"You're all caught up!\")}\n </p>\n </div>\n )}\n </div>\n\n {/* Footer */}\n {recentNotifications.length > 0 && (\n <div className=\"p-3 border-t border-default\">\n <button\n data-tour=\"notification-panel-view-all\"\n onClick={() => {\n togglePanel();\n if (onViewAll) onViewAll();\n }}\n className=\"w-full py-2 text-sm text-accent-primary hover:text-accent-primary/80 font-medium transition-colors duration-150\"\n >\n {tr('notifCommon.viewAllNotifications', 'View All Notifications')}\n </button>\n </div>\n )}\n </div>\n </>\n );\n}\n"],"mappings":";;;;;;;;AAeA,SAAgBC,EAAkB,EAAE,gBAAqC;CACvE,IAAMC,IAAKC,EAAM,GACX,EAAE,gBAAa,mBAAgBC,EAAqB,GACpD,EACJ,kBACA,gBACA,eACA,kBACA,wBACA,oBACEC,EAAiB;CAErB,IAAI,CAACC,GAAa,OAAO;CAGzB,IAAMC,IAAsBC,EAAc,MAAM,GAAG,CAAC;CAEpD,OACE,kBAAAR,GAAA,EAAA,UAAA,CAEE,kBAAC,OAAD;EAAK,WAAU;EAAqB,SAASU;EAAa,eAAY;CAAQ,CAAA,GAG9E,kBAAC,OAAD;EACE,aAAU;EACV,WAAU;EAFZ,UAAA;GAKE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA;MACE,kBAACC,GAAD;OAAM,MAAM;OAAI,WAAU;MAAgB,CAAA;MAC1C,kBAAC,MAAD;OAAI,WAAU;OACX,UAAAT,EAAG,6BAA6B,eAAe;MAC9C,CAAA;MACHU,IAAc,KACb,kBAAC,QAAD;OAAM,WAAU;OACb,UAAAA;MACG,CAAA;KAEL;IAEL,CAAA,GAAA,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACGA,IAAc,KACb,kBAAC,UAAD;MACE,aAAU;MACV,SAASC;MACT,WAAU;MAET,UAAAX,EAAG,2BAA2B,eAAe;KACxC,CAAA,GAEV,kBAAC,UAAD;MACE,SAASQ;MACT,WAAU;MACV,cAAYR,EAAG,0BAA0B,aAAa;MAEtD,UAAA,kBAACY,GAAD;OAAG,MAAM;OAAI,WAAU;MAAiB,CAAA;KAClC,CAAA,CACL;IACF,CAAA,CAAA;;GAGL,kBAAC,OAAD;IAAK,WAAU;IACZ,UAAAP,EAAoB,SAAS,IAC5B,kBAAC,OAAD;KAAK,WAAU;KACZ,UAAAA,EAAoB,KAAK,MACxB,kBAACQ,GAAD;MAEgB;MACd,cAAcC;MACd,WAAWC;MACX,UAAUC;MACV,SAAA;MACA,iBAAgB;KACjB,GAPMC,EAAa,EAOnB,CACF;IACE,CAAA,IAEL,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA;MACE,kBAACR,GAAD;OAAM,MAAM;OAAI,WAAU;MAAsB,CAAA;MAChD,kBAAC,KAAD;OAAG,WAAU;OACV,UAAAT,EAAG,+BAA+B,kBAAkB;MACpD,CAAA;MACH,kBAAC,KAAD;OAAG,WAAU;OACV,UAAAA,EAAG,2BAA2B,uBAAuB;MACrD,CAAA;KACA;;GAEJ,CAAA;GAGJK,EAAoB,SAAS,KAC5B,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,kBAAC,UAAD;KACE,aAAU;KACV,eAAe;MAEb,AADAG,EAAY,GACRU,KAAWA,EAAU;KAC3B;KACA,WAAU;KAET,UAAAlB,EAAG,oCAAoC,wBAAwB;IAC1D,CAAA;GACL,CAAA;EAEJ;CACL,CAAA,CAAA,EAAA,CAAA;AAEN"}
@@ -94,7 +94,7 @@ function m({ channel: t, subject: n, body: r, html: i, appName: s, onChannelChan
94
94
  className: "text-[10px] font-medium text-tertiary w-12",
95
95
  children: m("notifCommon.emailFromLabel", "From:")
96
96
  }), /* @__PURE__ */ u("span", {
97
- className: "text-xs text-secondary",
97
+ className: "text-xs text-text-secondary",
98
98
  children: s || "noreply@example.com"
99
99
  })]
100
100
  }),
@@ -104,7 +104,7 @@ function m({ channel: t, subject: n, body: r, html: i, appName: s, onChannelChan
104
104
  className: "text-[10px] font-medium text-tertiary w-12",
105
105
  children: m("notifCommon.emailToLabel", "To:")
106
106
  }), /* @__PURE__ */ u("span", {
107
- className: "text-xs text-secondary",
107
+ className: "text-xs text-text-secondary",
108
108
  children: "recipient@example.com"
109
109
  })]
110
110
  }),
@@ -351,7 +351,7 @@ function m({ channel: t, subject: n, body: r, html: i, appName: s, onChannelChan
351
351
  children: m("notifCommon.inAppJustNow", "Just now")
352
352
  })]
353
353
  }), /* @__PURE__ */ u("p", {
354
- className: "text-xs text-secondary leading-relaxed",
354
+ className: "text-xs text-text-secondary leading-relaxed",
355
355
  children: r || /* @__PURE__ */ u("span", {
356
356
  className: "italic text-tertiary",
357
357
  children: m("notifCommon.noMessageContent", "No message content")
@@ -381,7 +381,7 @@ function m({ channel: t, subject: n, body: r, html: i, appName: s, onChannelChan
381
381
  children: m("notifCommon.sampleTwoHoursAgo", "2h ago")
382
382
  })]
383
383
  }), /* @__PURE__ */ u("p", {
384
- className: "text-xs text-secondary",
384
+ className: "text-xs text-text-secondary",
385
385
  children: m("notifCommon.sampleSystemUpdateBody", "Your system has been updated successfully.")
386
386
  })]
387
387
  })]
@@ -406,7 +406,7 @@ function m({ channel: t, subject: n, body: r, html: i, appName: s, onChannelChan
406
406
  children: m("notifCommon.sampleOneDayAgo", "1d ago")
407
407
  })]
408
408
  }), /* @__PURE__ */ u("p", {
409
- className: "text-xs text-secondary",
409
+ className: "text-xs text-text-secondary",
410
410
  children: m("notifCommon.sampleNewMessageBody", "You have a new message from support.")
411
411
  })]
412
412
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"TemplatePreview.js","names":["useScaledIframe","containerRef","useRef","iframeRef","scale","setScale","useState","iframeHeight","setIframeHeight","recalculate","useCallback","container","iframe","containerWidth","newScale","doc","contentHeight","useEffect","timer","html","observer","channelTabs","Mail","MessageSquare","Bell","Smartphone","TemplatePreview","tr","useTr","onChannelChange","tab","channel","appName","subject","EMAIL_WIDTH","onIframeLoad","body","Monitor"],"sources":["../../src/components/TemplatePreview.tsx"],"sourcesContent":["import { useState, useCallback, useEffect, useRef } from 'react';\nimport { Mail, MessageSquare, Bell, Smartphone, Monitor } from 'lucide-react';\nimport { useTr } from '../shared/hooks/useTr';\n\nexport type PreviewChannel = 'email' | 'sms' | 'push' | 'in_app';\n\nexport interface TemplatePreviewProps {\n channel: PreviewChannel;\n subject: string;\n body: string;\n html: string;\n appName: string;\n onChannelChange: (channel: PreviewChannel) => void;\n}\n\n/**\n * Hook to scale an iframe so the full-width email (600px) fits inside\n * the available container width while showing all content without scroll.\n */\nfunction useScaledIframe(html: string) {\n const containerRef = useRef<HTMLDivElement>(null);\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const [scale, setScale] = useState(1);\n const [iframeHeight, setIframeHeight] = useState(400);\n\n const EMAIL_WIDTH = 620; // email templates are typically 600px + a bit of padding\n\n const recalculate = useCallback(() => {\n const container = containerRef.current;\n const iframe = iframeRef.current;\n if (!container || !iframe) return;\n\n const containerWidth = container.clientWidth;\n const newScale = Math.min(1, containerWidth / EMAIL_WIDTH);\n setScale(newScale);\n\n // Give the iframe time to render, then measure its content height\n requestAnimationFrame(() => {\n try {\n const doc = iframe.contentDocument || iframe.contentWindow?.document;\n if (doc?.body) {\n const contentHeight = doc.body.scrollHeight;\n setIframeHeight(contentHeight);\n }\n } catch {\n // cross-origin guard — won't happen with srcDoc + allow-same-origin\n }\n });\n }, []);\n\n // Recalculate when html changes\n useEffect(() => {\n // Small delay to let iframe render new content\n const timer = setTimeout(recalculate, 100);\n return () => clearTimeout(timer);\n }, [html, recalculate]);\n\n // Recalculate on resize\n useEffect(() => {\n const observer = new ResizeObserver(recalculate);\n if (containerRef.current) observer.observe(containerRef.current);\n return () => observer.disconnect();\n }, [recalculate]);\n\n // Also recalculate when iframe loads\n const onIframeLoad = useCallback(() => {\n recalculate();\n }, [recalculate]);\n\n return { containerRef, iframeRef, scale, iframeHeight, onIframeLoad, EMAIL_WIDTH };\n}\n\nconst channelTabs: { id: PreviewChannel; label: string; icon: React.ReactNode }[] = [\n { id: 'email', label: 'Email', icon: <Mail size={14} /> },\n { id: 'sms', label: 'SMS', icon: <MessageSquare size={14} /> },\n { id: 'push', label: 'Push', icon: <Bell size={14} /> },\n { id: 'in_app', label: 'In-App', icon: <Smartphone size={14} /> },\n];\n\n/**\n * Template Preview Component\n *\n * Shows how a notification template will look across different channels.\n * Templates are channel-agnostic — this component lets you preview\n * the same content as it would render on Email, SMS, Push, or In-App.\n *\n * Uses semantic theme tokens (text-primary, bg-surface, etc.) for theme\n * compatibility, with hardcoded colors only inside device mockups where\n * the real device UI is always dark (iPhone SMS, Push lock screen).\n */\nexport function TemplatePreview({\n channel,\n subject,\n body,\n html,\n appName,\n onChannelChange,\n}: TemplatePreviewProps) {\n const tr = useTr();\n const { containerRef, iframeRef, scale, iframeHeight, onIframeLoad, EMAIL_WIDTH } =\n useScaledIframe(html);\n\n return (\n <div className=\"h-full flex flex-col overflow-hidden\">\n {/* ── Channel Tabs ─────────────────────────────────────────── */}\n <div className=\"flex items-center gap-1 p-2 border-b border-default bg-surface/50 shrink-0\">\n {channelTabs.map((tab) => (\n <button\n key={tab.id}\n onClick={() => onChannelChange(tab.id)}\n className={`flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-all duration-150 ${\n channel === tab.id\n ? 'bg-accent-primary/10 text-accent-primary'\n : 'text-tertiary hover:text-primary hover:bg-bg-sunken'\n }`}\n >\n {tab.icon}\n {tr(`notifCommon.previewChannel.${tab.id}`, tab.label)}\n </button>\n ))}\n </div>\n\n {/* ── Preview Area ─────────────────────────────────────────── */}\n <div className=\"flex-1 p-4 overflow-auto bg-bg-sunken/30\">\n {/* ═══════════════════════════════════════════════════════════\n EMAIL PREVIEW — Desktop email client mockup\n ═══════════════════════════════════════════════════════════ */}\n {channel === 'email' && (\n <div className=\"max-w-xl mx-auto\">\n <div className=\"bg-surface rounded-xl shadow-lg overflow-hidden border border-default\">\n {/* Window chrome */}\n <div className=\"bg-bg-sunken px-4 py-3 border-b border-default\">\n <div className=\"flex items-center gap-1.5 mb-3\">\n <div className=\"w-2.5 h-2.5 rounded-full bg-red-400\"></div>\n <div className=\"w-2.5 h-2.5 rounded-full bg-yellow-400\"></div>\n <div className=\"w-2.5 h-2.5 rounded-full bg-green-400\"></div>\n </div>\n <div className=\"space-y-1.5\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-[10px] font-medium text-tertiary w-12\">\n {tr('notifCommon.emailFromLabel', 'From:')}\n </span>\n <span className=\"text-xs text-secondary\">\n {appName || 'noreply@example.com'}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-[10px] font-medium text-tertiary w-12\">\n {tr('notifCommon.emailToLabel', 'To:')}\n </span>\n <span className=\"text-xs text-secondary\">recipient@example.com</span>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-[10px] font-medium text-tertiary w-12\">\n {tr('notifCommon.emailSubjectLabel', 'Subject:')}\n </span>\n <span className=\"text-xs font-semibold text-primary\">\n {subject || (\n <span className=\"text-tertiary italic\">\n {tr('notifCommon.noSubject', 'No subject')}\n </span>\n )}\n </span>\n </div>\n </div>\n </div>\n\n {/* Email body — scaled iframe for pixel-perfect preview */}\n <div className=\"overflow-hidden\" ref={containerRef}>\n {html ? (\n <div\n style={{\n width: EMAIL_WIDTH,\n height: iframeHeight,\n transform: `scale(${scale})`,\n transformOrigin: 'top left',\n }}\n >\n <iframe\n ref={iframeRef}\n srcDoc={`<!DOCTYPE html><html><head><meta charset=\"utf-8\"/><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/><style>body{font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,sans-serif;font-size:14px;line-height:1.6;color:#1a1a1a;margin:0;padding:0}img{max-width:100%}a{color:#2563eb}table{border-collapse:collapse}</style></head><body>${html}</body></html>`}\n sandbox=\"allow-same-origin\"\n style={{ width: EMAIL_WIDTH, height: iframeHeight, border: 'none' }}\n title=\"Email preview\"\n onLoad={onIframeLoad}\n />\n </div>\n ) : body ? (\n <div className=\"p-5 min-h-[180px]\">\n <pre className=\"text-sm text-primary whitespace-pre-wrap font-sans leading-relaxed\">\n {body}\n </pre>\n </div>\n ) : (\n <div className=\"flex items-center justify-center h-40 text-tertiary p-5\">\n <p className=\"text-sm italic\">\n {tr('notifCommon.startTypingEmail', 'Start typing to see email preview...')}\n </p>\n </div>\n )}\n </div>\n\n {/* Scaled container height — collapse outer div to match scaled size */}\n {html && (\n <div\n style={{\n marginTop: -(iframeHeight - iframeHeight * scale),\n }}\n />\n )}\n </div>\n </div>\n )}\n\n {/* ═══════════════════════════════════════════════════════════\n SMS PREVIEW — iPhone Messages mockup\n ═══════════════════════════════════════════════════════════ */}\n {channel === 'sms' && (\n <div className=\"flex justify-center\">\n <div className=\"w-72 bg-black rounded-[2.5rem] p-2.5 shadow-2xl\">\n <div className=\"bg-gray-900 rounded-[2rem] overflow-hidden\">\n {/* Notch */}\n <div className=\"flex justify-center pt-1.5 pb-3 bg-black\">\n <div className=\"w-20 h-5 bg-black rounded-full\"></div>\n </div>\n\n {/* Messages header */}\n <div className=\"bg-gray-800 px-3 py-2.5 flex items-center justify-between border-b border-gray-700\">\n <span className=\"text-blue-400 text-xs\">\n {tr('notifCommon.smsBackLabel', '< Messages')}\n </span>\n <span className=\"text-white text-xs font-semibold\">\n {appName || tr('notifCommon.smsSenderFallback', 'Sender')}\n </span>\n <div className=\"w-6 h-6 bg-gray-600 rounded-full\"></div>\n </div>\n\n {/* Message area */}\n <div className=\"bg-black min-h-[280px] p-3 space-y-3\">\n <div className=\"text-center\">\n <span className=\"text-[10px] text-gray-500\">\n {tr('notifCommon.smsTimestamp', 'Today 10:30 AM')}\n </span>\n </div>\n\n {body ? (\n <div className=\"flex justify-start\">\n <div className=\"max-w-[80%] bg-gray-700 text-white text-xs px-3 py-2.5 rounded-2xl rounded-bl-md leading-relaxed\">\n {body}\n </div>\n </div>\n ) : (\n <div className=\"flex items-center justify-center h-24 text-gray-500\">\n <p className=\"text-xs italic\">\n {tr('notifCommon.noMessageContent', 'No message content')}\n </p>\n </div>\n )}\n </div>\n\n {/* Input bar */}\n <div className=\"bg-gray-900 px-3 py-2.5 flex items-center gap-2 border-t border-gray-800\">\n <div className=\"flex-1 bg-gray-700 rounded-full px-3 py-1.5\">\n <span className=\"text-gray-400 text-[10px]\">\n {tr('notifCommon.smsInputPlaceholder', 'iMessage')}\n </span>\n </div>\n <div className=\"w-6 h-6 bg-blue-500 rounded-full flex items-center justify-center\">\n <span className=\"text-white text-[10px]\">↑</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n )}\n\n {/* ═══════════════════════════════════════════════════════════\n PUSH PREVIEW — iPhone lock screen mockup\n ═══════════════════════════════════════════════════════════ */}\n {channel === 'push' && (\n <div className=\"flex justify-center\">\n <div className=\"w-72 bg-black rounded-[2.5rem] p-2.5 shadow-2xl\">\n <div className=\"bg-gradient-to-b from-purple-900 via-blue-900 to-black rounded-[2rem] overflow-hidden\">\n {/* Notch */}\n <div className=\"flex justify-center pt-1.5 pb-1.5 bg-black/30\">\n <div className=\"w-20 h-5 bg-black rounded-full\"></div>\n </div>\n\n {/* Time */}\n <div className=\"text-center pt-8 pb-6\">\n <div className=\"text-5xl font-light text-white\">9:41</div>\n <div className=\"text-sm text-white/80 mt-1\">\n {tr('notifCommon.pushDate', 'Monday, January 27')}\n </div>\n </div>\n\n {/* Push notification card */}\n <div className=\"px-3 pb-6\">\n <div className=\"bg-bg-surface/90 backdrop-blur-xl rounded-2xl p-3.5 shadow-lg\">\n <div className=\"flex items-start gap-2.5\">\n <div className=\"w-8 h-8 bg-blue-500 rounded-xl flex items-center justify-center flex-shrink-0\">\n <Bell size={16} className=\"text-white\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-[10px] font-semibold text-gray-900 uppercase tracking-wide\">\n {appName || tr('notifCommon.pushAppNameFallback', 'App Name')}\n </span>\n <span className=\"text-[10px] text-gray-500\">\n {tr('notifCommon.pushTimestampNow', 'now')}\n </span>\n </div>\n <div className=\"text-xs font-semibold text-gray-900 mt-0.5\">\n {subject || (\n <span className=\"text-gray-400 italic\">\n {tr('notifCommon.noTitle', 'No title')}\n </span>\n )}\n </div>\n <div className=\"text-xs text-gray-600 line-clamp-2 mt-0.5 leading-relaxed\">\n {body || (\n <span className=\"italic\">\n {tr('notifCommon.noMessage', 'No message')}\n </span>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n\n {/* Home indicator */}\n <div className=\"flex justify-center pb-3\">\n <div className=\"w-28 h-1 bg-bg-surface/30 rounded-full\"></div>\n </div>\n </div>\n </div>\n </div>\n )}\n\n {/* ═══════════════════════════════════════════════════════════\n IN-APP PREVIEW — Desktop notification panel mockup\n ═══════════════════════════════════════════════════════════ */}\n {channel === 'in_app' && (\n <div className=\"max-w-sm mx-auto\">\n <div className=\"bg-surface rounded-xl shadow-lg overflow-hidden border border-default\">\n {/* Panel header */}\n <div className=\"bg-bg-sunken px-4 py-2.5 border-b border-default flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <Bell size={16} className=\"text-tertiary\" />\n <span className=\"text-sm font-semibold text-primary\">\n {tr('notifCommon.notifications', 'Notifications')}\n </span>\n </div>\n <span className=\"text-[10px] text-accent-primary font-medium\">\n {tr('notifCommon.markAllAsRead', 'Mark all as read')}\n </span>\n </div>\n\n {/* Notification items */}\n <div className=\"divide-y divide-default\">\n {/* Active notification (the template) */}\n <div className=\"p-3.5 bg-accent-primary/5 flex items-start gap-2.5\">\n <div className=\"w-8 h-8 bg-accent-primary/10 rounded-full flex items-center justify-center flex-shrink-0\">\n <Bell size={14} className=\"text-accent-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center justify-between mb-0.5\">\n <span className=\"text-xs font-semibold text-primary\">\n {subject || appName || (\n <span className=\"text-tertiary italic\">\n {tr('notifCommon.notification', 'Notification')}\n </span>\n )}\n </span>\n <span className=\"text-[10px] text-tertiary\">\n {tr('notifCommon.inAppJustNow', 'Just now')}\n </span>\n </div>\n <p className=\"text-xs text-secondary leading-relaxed\">\n {body || (\n <span className=\"italic text-tertiary\">\n {tr('notifCommon.noMessageContent', 'No message content')}\n </span>\n )}\n </p>\n </div>\n <div className=\"w-1.5 h-1.5 bg-accent rounded-full flex-shrink-0 mt-1.5\"></div>\n </div>\n\n {/* Older notifications (dimmed placeholders) */}\n <div className=\"p-3.5 flex items-start gap-2.5 opacity-40\">\n <div className=\"w-8 h-8 bg-bg-sunken rounded-full flex items-center justify-center flex-shrink-0\">\n <Monitor size={14} className=\"text-tertiary\" />\n </div>\n <div className=\"flex-1\">\n <div className=\"flex items-center justify-between mb-0.5\">\n <span className=\"text-xs font-medium text-primary\">\n {tr('notifCommon.sampleSystemUpdate', 'System Update')}\n </span>\n <span className=\"text-[10px] text-tertiary\">\n {tr('notifCommon.sampleTwoHoursAgo', '2h ago')}\n </span>\n </div>\n <p className=\"text-xs text-secondary\">\n {tr(\n 'notifCommon.sampleSystemUpdateBody',\n 'Your system has been updated successfully.'\n )}\n </p>\n </div>\n </div>\n\n <div className=\"p-3.5 flex items-start gap-2.5 opacity-40\">\n <div className=\"w-8 h-8 bg-bg-sunken rounded-full flex items-center justify-center flex-shrink-0\">\n <Mail size={14} className=\"text-tertiary\" />\n </div>\n <div className=\"flex-1\">\n <div className=\"flex items-center justify-between mb-0.5\">\n <span className=\"text-xs font-medium text-primary\">\n {tr('notifCommon.sampleNewMessage', 'New Message')}\n </span>\n <span className=\"text-[10px] text-tertiary\">\n {tr('notifCommon.sampleOneDayAgo', '1d ago')}\n </span>\n </div>\n <p className=\"text-xs text-secondary\">\n {tr(\n 'notifCommon.sampleNewMessageBody',\n 'You have a new message from support.'\n )}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;AAmBA,SAASA,EAAgB,GAAc;CACrC,IAAMC,IAAeC,EAAuB,IAAI,GAC1CC,IAAYD,EAA0B,IAAI,GAC1C,CAACE,GAAOC,KAAYC,EAAS,CAAC,GAC9B,CAACC,GAAcC,KAAmBF,EAAS,GAAG,GAI9CG,IAAcC,QAAkB;EACpC,IAAMC,IAAYV,EAAa,SACzBW,IAAST,EAAU;EACzB,IAAI,CAACQ,KAAa,CAACC,GAAQ;EAE3B,IAAMC,IAAiBF,EAAU,aAC3BG,IAAW,KAAK,IAAI,GAAGD,IAAiB,GAAW;EAIzD,AAHAR,EAASS,CAAQ,GAGjB,4BAA4B;GAC1B,IAAI;IACF,IAAMC,IAAMH,EAAO,mBAAmBA,EAAO,eAAe;IAC5D,IAAIG,GAAK,MAAM;KACb,IAAMC,IAAgBD,EAAI,KAAK;KAC/B,EAAgBC,CAAa;IAC/B;GACF,QAAQ,CAER;EACF,CAAC;CACH,GAAG,CAAC,CAAC;CAqBL,OAlBAC,QAAgB;EAEd,IAAMC,IAAQ,WAAWT,GAAa,GAAG;EACzC,aAAa,aAAaS,CAAK;CACjC,GAAG,CAACC,GAAMV,CAAW,CAAC,GAGtBQ,QAAgB;EACd,IAAMG,IAAW,IAAI,eAAeX,CAAW;EAE/C,OADIR,EAAa,WAASmB,EAAS,QAAQnB,EAAa,OAAO,SAClDmB,EAAS,WAAW;CACnC,GAAG,CAACX,CAAW,CAAC,GAOT;EAAE;EAAc;EAAW;EAAO;EAAc,cAJlCC,QAAkB;GACrC,EAAY;EACd,GAAG,CAACD,CAAW,CAEwC;EAAc;CAAY;AACnF;AAEA,IAAMY,IAA8E;CAClF;EAAE,IAAI;EAAS,OAAO;EAAS,MAAM,kBAACC,GAAD,EAAM,MAAM,GAAK,CAAA;CAAE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,kBAAC,OAAD;UAAK,WAAU;UACb,UAAA,kBAACU,GAAD;WAAS,MAAM;WAAI,WAAU;UAAiB,CAAA;SAC3C,CAAA,GACL,kBAAC,OAAD;UAAK,WAAU;UAAf,UAAA,CACE,kBAAC,OAAD;WAAK,WAAU;WAAf,UAAA,CACE,kBAAC,QAAD;YAAM,WAAU;YACb,UAAAV,EAAG,kCAAkC,eAAe;WACjD,CAAA,GACN,kBAAC,QAAD;YAAM,WAAU;YACb,UAAAA,EAAG,iCAAiC,QAAQ;WACzC,CAAA,CACH;UACL,CAAA,GAAA,kBAAC,KAAD;WAAG,WAAU;WACV,UAAAA,EACC,sCACA,4CACF;UACC,CAAA,CACA;SACF,CAAA,CAAA;;QAEL,kBAAC,OAAD;SAAK,WAAU;SAAf,UAAA,CACE,kBAAC,OAAD;UAAK,WAAU;UACb,UAAA,kBAACL,GAAD;WAAM,MAAM;WAAI,WAAU;UAAiB,CAAA;SACxC,CAAA,GACL,kBAAC,OAAD;UAAK,WAAU;UAAf,UAAA,CACE,kBAAC,OAAD;WAAK,WAAU;WAAf,UAAA,CACE,kBAAC,QAAD;YAAM,WAAU;YACb,UAAAK,EAAG,gCAAgC,aAAa;WAC7C,CAAA,GACN,kBAAC,QAAD;YAAM,WAAU;YACb,UAAAA,EAAG,+BAA+B,QAAQ;WACvC,CAAA,CACH;UACL,CAAA,GAAA,kBAAC,KAAD;WAAG,WAAU;WACV,UAAAA,EACC,oCACA,sCACF;UACC,CAAA,CACA;SACF,CAAA,CAAA;;OACF;MACF,CAAA,CAAA;;IACF,CAAA;GAEJ;EACF,CAAA,CAAA;;AAET"}
1
+ {"version":3,"file":"TemplatePreview.js","names":["useScaledIframe","containerRef","useRef","iframeRef","scale","setScale","useState","iframeHeight","setIframeHeight","recalculate","useCallback","container","iframe","containerWidth","newScale","doc","contentHeight","useEffect","timer","html","observer","channelTabs","Mail","MessageSquare","Bell","Smartphone","TemplatePreview","tr","useTr","onChannelChange","tab","channel","appName","subject","EMAIL_WIDTH","onIframeLoad","body","Monitor"],"sources":["../../src/components/TemplatePreview.tsx"],"sourcesContent":["import { useState, useCallback, useEffect, useRef } from 'react';\nimport { Mail, MessageSquare, Bell, Smartphone, Monitor } from 'lucide-react';\nimport { useTr } from '../shared/hooks/useTr';\n\nexport type PreviewChannel = 'email' | 'sms' | 'push' | 'in_app';\n\nexport interface TemplatePreviewProps {\n channel: PreviewChannel;\n subject: string;\n body: string;\n html: string;\n appName: string;\n onChannelChange: (channel: PreviewChannel) => void;\n}\n\n/**\n * Hook to scale an iframe so the full-width email (600px) fits inside\n * the available container width while showing all content without scroll.\n */\nfunction useScaledIframe(html: string) {\n const containerRef = useRef<HTMLDivElement>(null);\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const [scale, setScale] = useState(1);\n const [iframeHeight, setIframeHeight] = useState(400);\n\n const EMAIL_WIDTH = 620; // email templates are typically 600px + a bit of padding\n\n const recalculate = useCallback(() => {\n const container = containerRef.current;\n const iframe = iframeRef.current;\n if (!container || !iframe) return;\n\n const containerWidth = container.clientWidth;\n const newScale = Math.min(1, containerWidth / EMAIL_WIDTH);\n setScale(newScale);\n\n // Give the iframe time to render, then measure its content height\n requestAnimationFrame(() => {\n try {\n const doc = iframe.contentDocument || iframe.contentWindow?.document;\n if (doc?.body) {\n const contentHeight = doc.body.scrollHeight;\n setIframeHeight(contentHeight);\n }\n } catch {\n // cross-origin guard — won't happen with srcDoc + allow-same-origin\n }\n });\n }, []);\n\n // Recalculate when html changes\n useEffect(() => {\n // Small delay to let iframe render new content\n const timer = setTimeout(recalculate, 100);\n return () => clearTimeout(timer);\n }, [html, recalculate]);\n\n // Recalculate on resize\n useEffect(() => {\n const observer = new ResizeObserver(recalculate);\n if (containerRef.current) observer.observe(containerRef.current);\n return () => observer.disconnect();\n }, [recalculate]);\n\n // Also recalculate when iframe loads\n const onIframeLoad = useCallback(() => {\n recalculate();\n }, [recalculate]);\n\n return { containerRef, iframeRef, scale, iframeHeight, onIframeLoad, EMAIL_WIDTH };\n}\n\nconst channelTabs: { id: PreviewChannel; label: string; icon: React.ReactNode }[] = [\n { id: 'email', label: 'Email', icon: <Mail size={14} /> },\n { id: 'sms', label: 'SMS', icon: <MessageSquare size={14} /> },\n { id: 'push', label: 'Push', icon: <Bell size={14} /> },\n { id: 'in_app', label: 'In-App', icon: <Smartphone size={14} /> },\n];\n\n/**\n * Template Preview Component\n *\n * Shows how a notification template will look across different channels.\n * Templates are channel-agnostic — this component lets you preview\n * the same content as it would render on Email, SMS, Push, or In-App.\n *\n * Uses semantic theme tokens (text-primary, bg-surface, etc.) for theme\n * compatibility, with hardcoded colors only inside device mockups where\n * the real device UI is always dark (iPhone SMS, Push lock screen).\n */\nexport function TemplatePreview({\n channel,\n subject,\n body,\n html,\n appName,\n onChannelChange,\n}: TemplatePreviewProps) {\n const tr = useTr();\n const { containerRef, iframeRef, scale, iframeHeight, onIframeLoad, EMAIL_WIDTH } =\n useScaledIframe(html);\n\n return (\n <div className=\"h-full flex flex-col overflow-hidden\">\n {/* ── Channel Tabs ─────────────────────────────────────────── */}\n <div className=\"flex items-center gap-1 p-2 border-b border-default bg-surface/50 shrink-0\">\n {channelTabs.map((tab) => (\n <button\n key={tab.id}\n onClick={() => onChannelChange(tab.id)}\n className={`flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-all duration-150 ${\n channel === tab.id\n ? 'bg-accent-primary/10 text-accent-primary'\n : 'text-tertiary hover:text-primary hover:bg-bg-sunken'\n }`}\n >\n {tab.icon}\n {tr(`notifCommon.previewChannel.${tab.id}`, tab.label)}\n </button>\n ))}\n </div>\n\n {/* ── Preview Area ─────────────────────────────────────────── */}\n <div className=\"flex-1 p-4 overflow-auto bg-bg-sunken/30\">\n {/* ═══════════════════════════════════════════════════════════\n EMAIL PREVIEW — Desktop email client mockup\n ═══════════════════════════════════════════════════════════ */}\n {channel === 'email' && (\n <div className=\"max-w-xl mx-auto\">\n <div className=\"bg-surface rounded-xl shadow-lg overflow-hidden border border-default\">\n {/* Window chrome */}\n <div className=\"bg-bg-sunken px-4 py-3 border-b border-default\">\n <div className=\"flex items-center gap-1.5 mb-3\">\n <div className=\"w-2.5 h-2.5 rounded-full bg-red-400\"></div>\n <div className=\"w-2.5 h-2.5 rounded-full bg-yellow-400\"></div>\n <div className=\"w-2.5 h-2.5 rounded-full bg-green-400\"></div>\n </div>\n <div className=\"space-y-1.5\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-[10px] font-medium text-tertiary w-12\">\n {tr('notifCommon.emailFromLabel', 'From:')}\n </span>\n <span className=\"text-xs text-text-secondary\">\n {appName || 'noreply@example.com'}\n </span>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-[10px] font-medium text-tertiary w-12\">\n {tr('notifCommon.emailToLabel', 'To:')}\n </span>\n <span className=\"text-xs text-text-secondary\">recipient@example.com</span>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-[10px] font-medium text-tertiary w-12\">\n {tr('notifCommon.emailSubjectLabel', 'Subject:')}\n </span>\n <span className=\"text-xs font-semibold text-primary\">\n {subject || (\n <span className=\"text-tertiary italic\">\n {tr('notifCommon.noSubject', 'No subject')}\n </span>\n )}\n </span>\n </div>\n </div>\n </div>\n\n {/* Email body — scaled iframe for pixel-perfect preview */}\n <div className=\"overflow-hidden\" ref={containerRef}>\n {html ? (\n <div\n style={{\n width: EMAIL_WIDTH,\n height: iframeHeight,\n transform: `scale(${scale})`,\n transformOrigin: 'top left',\n }}\n >\n <iframe\n ref={iframeRef}\n srcDoc={`<!DOCTYPE html><html><head><meta charset=\"utf-8\"/><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/><style>body{font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,sans-serif;font-size:14px;line-height:1.6;color:#1a1a1a;margin:0;padding:0}img{max-width:100%}a{color:#2563eb}table{border-collapse:collapse}</style></head><body>${html}</body></html>`}\n sandbox=\"allow-same-origin\"\n style={{ width: EMAIL_WIDTH, height: iframeHeight, border: 'none' }}\n title=\"Email preview\"\n onLoad={onIframeLoad}\n />\n </div>\n ) : body ? (\n <div className=\"p-5 min-h-[180px]\">\n <pre className=\"text-sm text-primary whitespace-pre-wrap font-sans leading-relaxed\">\n {body}\n </pre>\n </div>\n ) : (\n <div className=\"flex items-center justify-center h-40 text-tertiary p-5\">\n <p className=\"text-sm italic\">\n {tr('notifCommon.startTypingEmail', 'Start typing to see email preview...')}\n </p>\n </div>\n )}\n </div>\n\n {/* Scaled container height — collapse outer div to match scaled size */}\n {html && (\n <div\n style={{\n marginTop: -(iframeHeight - iframeHeight * scale),\n }}\n />\n )}\n </div>\n </div>\n )}\n\n {/* ═══════════════════════════════════════════════════════════\n SMS PREVIEW — iPhone Messages mockup\n ═══════════════════════════════════════════════════════════ */}\n {channel === 'sms' && (\n <div className=\"flex justify-center\">\n <div className=\"w-72 bg-black rounded-[2.5rem] p-2.5 shadow-2xl\">\n <div className=\"bg-gray-900 rounded-[2rem] overflow-hidden\">\n {/* Notch */}\n <div className=\"flex justify-center pt-1.5 pb-3 bg-black\">\n <div className=\"w-20 h-5 bg-black rounded-full\"></div>\n </div>\n\n {/* Messages header */}\n <div className=\"bg-gray-800 px-3 py-2.5 flex items-center justify-between border-b border-gray-700\">\n <span className=\"text-blue-400 text-xs\">\n {tr('notifCommon.smsBackLabel', '< Messages')}\n </span>\n <span className=\"text-white text-xs font-semibold\">\n {appName || tr('notifCommon.smsSenderFallback', 'Sender')}\n </span>\n <div className=\"w-6 h-6 bg-gray-600 rounded-full\"></div>\n </div>\n\n {/* Message area */}\n <div className=\"bg-black min-h-[280px] p-3 space-y-3\">\n <div className=\"text-center\">\n <span className=\"text-[10px] text-gray-500\">\n {tr('notifCommon.smsTimestamp', 'Today 10:30 AM')}\n </span>\n </div>\n\n {body ? (\n <div className=\"flex justify-start\">\n <div className=\"max-w-[80%] bg-gray-700 text-white text-xs px-3 py-2.5 rounded-2xl rounded-bl-md leading-relaxed\">\n {body}\n </div>\n </div>\n ) : (\n <div className=\"flex items-center justify-center h-24 text-gray-500\">\n <p className=\"text-xs italic\">\n {tr('notifCommon.noMessageContent', 'No message content')}\n </p>\n </div>\n )}\n </div>\n\n {/* Input bar */}\n <div className=\"bg-gray-900 px-3 py-2.5 flex items-center gap-2 border-t border-gray-800\">\n <div className=\"flex-1 bg-gray-700 rounded-full px-3 py-1.5\">\n <span className=\"text-gray-400 text-[10px]\">\n {tr('notifCommon.smsInputPlaceholder', 'iMessage')}\n </span>\n </div>\n <div className=\"w-6 h-6 bg-blue-500 rounded-full flex items-center justify-center\">\n <span className=\"text-white text-[10px]\">↑</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n )}\n\n {/* ═══════════════════════════════════════════════════════════\n PUSH PREVIEW — iPhone lock screen mockup\n ═══════════════════════════════════════════════════════════ */}\n {channel === 'push' && (\n <div className=\"flex justify-center\">\n <div className=\"w-72 bg-black rounded-[2.5rem] p-2.5 shadow-2xl\">\n <div className=\"bg-gradient-to-b from-purple-900 via-blue-900 to-black rounded-[2rem] overflow-hidden\">\n {/* Notch */}\n <div className=\"flex justify-center pt-1.5 pb-1.5 bg-black/30\">\n <div className=\"w-20 h-5 bg-black rounded-full\"></div>\n </div>\n\n {/* Time */}\n <div className=\"text-center pt-8 pb-6\">\n <div className=\"text-5xl font-light text-white\">9:41</div>\n <div className=\"text-sm text-white/80 mt-1\">\n {tr('notifCommon.pushDate', 'Monday, January 27')}\n </div>\n </div>\n\n {/* Push notification card */}\n <div className=\"px-3 pb-6\">\n <div className=\"bg-bg-surface/90 backdrop-blur-xl rounded-2xl p-3.5 shadow-lg\">\n <div className=\"flex items-start gap-2.5\">\n <div className=\"w-8 h-8 bg-blue-500 rounded-xl flex items-center justify-center flex-shrink-0\">\n <Bell size={16} className=\"text-white\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-[10px] font-semibold text-gray-900 uppercase tracking-wide\">\n {appName || tr('notifCommon.pushAppNameFallback', 'App Name')}\n </span>\n <span className=\"text-[10px] text-gray-500\">\n {tr('notifCommon.pushTimestampNow', 'now')}\n </span>\n </div>\n <div className=\"text-xs font-semibold text-gray-900 mt-0.5\">\n {subject || (\n <span className=\"text-gray-400 italic\">\n {tr('notifCommon.noTitle', 'No title')}\n </span>\n )}\n </div>\n <div className=\"text-xs text-gray-600 line-clamp-2 mt-0.5 leading-relaxed\">\n {body || (\n <span className=\"italic\">\n {tr('notifCommon.noMessage', 'No message')}\n </span>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n\n {/* Home indicator */}\n <div className=\"flex justify-center pb-3\">\n <div className=\"w-28 h-1 bg-bg-surface/30 rounded-full\"></div>\n </div>\n </div>\n </div>\n </div>\n )}\n\n {/* ═══════════════════════════════════════════════════════════\n IN-APP PREVIEW — Desktop notification panel mockup\n ═══════════════════════════════════════════════════════════ */}\n {channel === 'in_app' && (\n <div className=\"max-w-sm mx-auto\">\n <div className=\"bg-surface rounded-xl shadow-lg overflow-hidden border border-default\">\n {/* Panel header */}\n <div className=\"bg-bg-sunken px-4 py-2.5 border-b border-default flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <Bell size={16} className=\"text-tertiary\" />\n <span className=\"text-sm font-semibold text-primary\">\n {tr('notifCommon.notifications', 'Notifications')}\n </span>\n </div>\n <span className=\"text-[10px] text-accent-primary font-medium\">\n {tr('notifCommon.markAllAsRead', 'Mark all as read')}\n </span>\n </div>\n\n {/* Notification items */}\n <div className=\"divide-y divide-default\">\n {/* Active notification (the template) */}\n <div className=\"p-3.5 bg-accent-primary/5 flex items-start gap-2.5\">\n <div className=\"w-8 h-8 bg-accent-primary/10 rounded-full flex items-center justify-center flex-shrink-0\">\n <Bell size={14} className=\"text-accent-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center justify-between mb-0.5\">\n <span className=\"text-xs font-semibold text-primary\">\n {subject || appName || (\n <span className=\"text-tertiary italic\">\n {tr('notifCommon.notification', 'Notification')}\n </span>\n )}\n </span>\n <span className=\"text-[10px] text-tertiary\">\n {tr('notifCommon.inAppJustNow', 'Just now')}\n </span>\n </div>\n <p className=\"text-xs text-text-secondary leading-relaxed\">\n {body || (\n <span className=\"italic text-tertiary\">\n {tr('notifCommon.noMessageContent', 'No message content')}\n </span>\n )}\n </p>\n </div>\n <div className=\"w-1.5 h-1.5 bg-accent rounded-full flex-shrink-0 mt-1.5\"></div>\n </div>\n\n {/* Older notifications (dimmed placeholders) */}\n <div className=\"p-3.5 flex items-start gap-2.5 opacity-40\">\n <div className=\"w-8 h-8 bg-bg-sunken rounded-full flex items-center justify-center flex-shrink-0\">\n <Monitor size={14} className=\"text-tertiary\" />\n </div>\n <div className=\"flex-1\">\n <div className=\"flex items-center justify-between mb-0.5\">\n <span className=\"text-xs font-medium text-primary\">\n {tr('notifCommon.sampleSystemUpdate', 'System Update')}\n </span>\n <span className=\"text-[10px] text-tertiary\">\n {tr('notifCommon.sampleTwoHoursAgo', '2h ago')}\n </span>\n </div>\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'notifCommon.sampleSystemUpdateBody',\n 'Your system has been updated successfully.'\n )}\n </p>\n </div>\n </div>\n\n <div className=\"p-3.5 flex items-start gap-2.5 opacity-40\">\n <div className=\"w-8 h-8 bg-bg-sunken rounded-full flex items-center justify-center flex-shrink-0\">\n <Mail size={14} className=\"text-tertiary\" />\n </div>\n <div className=\"flex-1\">\n <div className=\"flex items-center justify-between mb-0.5\">\n <span className=\"text-xs font-medium text-primary\">\n {tr('notifCommon.sampleNewMessage', 'New Message')}\n </span>\n <span className=\"text-[10px] text-tertiary\">\n {tr('notifCommon.sampleOneDayAgo', '1d ago')}\n </span>\n </div>\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'notifCommon.sampleNewMessageBody',\n 'You have a new message from support.'\n )}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;AAmBA,SAASA,EAAgB,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D;WAAK,WAAU;WAAf,UAAA,CACE,kBAAC,QAAD;YAAM,WAAU;YACb,UAAAV,EAAG,kCAAkC,eAAe;WACjD,CAAA,GACN,kBAAC,QAAD;YAAM,WAAU;YACb,UAAAA,EAAG,iCAAiC,QAAQ;WACzC,CAAA,CACH;UACL,CAAA,GAAA,kBAAC,KAAD;WAAG,WAAU;WACV,UAAAA,EACC,sCACA,4CACF;UACC,CAAA,CACA;SACF,CAAA,CAAA;;QAEL,kBAAC,OAAD;SAAK,WAAU;SAAf,UAAA,CACE,kBAAC,OAAD;UAAK,WAAU;UACb,UAAA,kBAACL,GAAD;WAAM,MAAM;WAAI,WAAU;UAAiB,CAAA;SACxC,CAAA,GACL,kBAAC,OAAD;UAAK,WAAU;UAAf,UAAA,CACE,kBAAC,OAAD;WAAK,WAAU;WAAf,UAAA,CACE,kBAAC,QAAD;YAAM,WAAU;YACb,UAAAK,EAAG,gCAAgC,aAAa;WAC7C,CAAA,GACN,kBAAC,QAAD;YAAM,WAAU;YACb,UAAAA,EAAG,+BAA+B,QAAQ;WACvC,CAAA,CACH;UACL,CAAA,GAAA,kBAAC,KAAD;WAAG,WAAU;WACV,UAAAA,EACC,oCACA,sCACF;UACC,CAAA,CACA;SACF,CAAA,CAAA;;OACF;MACF,CAAA,CAAA;;IACF,CAAA;GAEJ;EACF,CAAA,CAAA;;AAET"}
@@ -1,9 +1,15 @@
1
+ /**
2
+ * The Delivery log (the Operations console, BOFF-11872). It opens, as on the
3
+ * old landing's `?tab=history`, only while `notification.history` is on, and
4
+ * behind the route-level permission gate; with the flag off the inbox shows
5
+ * in its place (the URL is kept, so the page appears once the flag loads).
6
+ */
7
+ export declare function DeliveryLogV2(): import('react').JSX.Element;
1
8
  /**
2
9
  * `/notifications` under Navigation v2 (BOFF-11872): straight on the inbox,
3
10
  * no tab strip. Every old `?tab=` value still opens its page: `send`,
4
11
  * `templates` and `topics` go to their own routes, `history` is the Delivery
5
- * log (which has no route of its own, and, as on the old landing, opens only
6
- * while `notification.history` is on), and `inbox` or anything unknown is the
7
- * inbox.
12
+ * log (also at its own route, `delivery-log`), and `inbox` or anything
13
+ * unknown is the inbox.
8
14
  */
9
15
  export declare function NotificationsV2Landing(): import('react').JSX.Element;
@@ -14,17 +14,8 @@ function u() {
14
14
  });
15
15
  }
16
16
  function d() {
17
- let [i] = s(), d = n(), f = i.get("tab"), p = a("notification.history"), m = p ? !!p.value : !1;
18
- return f === "send" ? /* @__PURE__ */ c(o, {
19
- to: d.send,
20
- replace: !0
21
- }) : f === "templates" ? /* @__PURE__ */ c(o, {
22
- to: d.templates,
23
- replace: !0
24
- }) : f === "topics" ? /* @__PURE__ */ c(o, {
25
- to: d.topics,
26
- replace: !0
27
- }) : f === "history" && m ? /* @__PURE__ */ c(t, {
17
+ let n = a("notification.history");
18
+ return n && n.value ? /* @__PURE__ */ c(t, {
28
19
  tool: "deliveryLog",
29
20
  children: /* @__PURE__ */ c(r, {
30
21
  fallback: /* @__PURE__ */ c(u, {}),
@@ -32,6 +23,19 @@ function d() {
32
23
  })
33
24
  }) : /* @__PURE__ */ c(e, {});
34
25
  }
35
- export { d as NotificationsV2Landing };
26
+ function f() {
27
+ let [t] = s(), r = n(), i = t.get("tab");
28
+ return i === "send" ? /* @__PURE__ */ c(o, {
29
+ to: r.send,
30
+ replace: !0
31
+ }) : i === "templates" ? /* @__PURE__ */ c(o, {
32
+ to: r.templates,
33
+ replace: !0
34
+ }) : i === "topics" ? /* @__PURE__ */ c(o, {
35
+ to: r.topics,
36
+ replace: !0
37
+ }) : c(i === "history" ? d : e, {});
38
+ }
39
+ export { d as DeliveryLogV2, f as NotificationsV2Landing };
36
40
 
37
41
  //# sourceMappingURL=NotificationsV2Landing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsV2Landing.js","names":["NotificationHistoryAdminPage","lazy","m","PageLoader","NotificationsV2Landing","params","useSearchParams","paths","useNotificationPaths","tab","historyDetails","useFeatureFlagDetails","historyEnabled","Navigate","AdminPageV2","Suspense","NotificationCenterPage"],"sources":["../../src/navigation-v2/NotificationsV2Landing.tsx"],"sourcesContent":["import { Suspense, lazy } from 'react';\nimport { Navigate, useSearchParams } from 'react-router';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { NotificationCenterPage } from '../pages/NotificationCenterPage';\nimport { AdminPageV2 } from './AdminPageV2';\nimport { useNotificationPaths } from './paths';\n\nconst NotificationHistoryAdminPage = lazy(() =>\n import('../pages/NotificationHistoryAdminPage').then((m) => ({\n default: m.NotificationHistoryAdminPage,\n }))\n);\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\n/**\n * `/notifications` under Navigation v2 (BOFF-11872): straight on the inbox,\n * no tab strip. Every old `?tab=` value still opens its page: `send`,\n * `templates` and `topics` go to their own routes, `history` is the Delivery\n * log (which has no route of its own, and, as on the old landing, opens only\n * while `notification.history` is on), and `inbox` or anything unknown is the\n * inbox.\n */\nexport function NotificationsV2Landing() {\n const [params] = useSearchParams();\n const paths = useNotificationPaths();\n const tab = params.get('tab');\n const historyDetails = useFeatureFlagDetails('notification.history');\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n if (tab === 'send') return <Navigate to={paths.send} replace />;\n if (tab === 'templates') return <Navigate to={paths.templates} replace />;\n if (tab === 'topics') return <Navigate to={paths.topics} replace />;\n if (tab === 'history' && historyEnabled) {\n return (\n <AdminPageV2 tool=\"deliveryLog\">\n <Suspense fallback={<PageLoader />}>\n <NotificationHistoryAdminPage />\n </Suspense>\n </AdminPageV2>\n );\n }\n return <NotificationCenterPage />;\n}\n"],"mappings":";;;;;;;;AAOA,IAAMA,IAA+BC,QACnC,OAAO,2CAAwC,CAAC,MAAM,OAAO,EAC3D,SAASC,EAAE,6BACb,EAAE,CACJ;AAEA,SAASC,IAAa;CACpB,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA;AAET;AAUA,SAAgBC,IAAyB;CACvC,IAAM,CAACC,KAAUC,EAAgB,GAC3BC,IAAQC,EAAqB,GAC7BC,IAAMJ,EAAO,IAAI,KAAK,GACtBK,IAAiBC,EAAsB,sBAAsB,GAC7DC,IAAiBF,IAAiB,EAAQA,EAAe,QAAS;CAcxE,OAZID,MAAQ,SAAe,kBAACI,GAAD;EAAU,IAAIN,EAAM;EAAM,SAAA;CAAS,CAAA,IAC1DE,MAAQ,cAAoB,kBAACI,GAAD;EAAU,IAAIN,EAAM;EAAW,SAAA;CAAS,CAAA,IACpEE,MAAQ,WAAiB,kBAACI,GAAD;EAAU,IAAIN,EAAM;EAAQ,SAAA;CAAS,CAAA,IAC9DE,MAAQ,aAAaG,IAErB,kBAACE,GAAD;EAAa,MAAK;EAChB,UAAA,kBAACC,GAAD;GAAU,UAAU,kBAACZ,GAAD,CAAa,CAAA;GAC/B,UAAA,kBAACH,GAAD,CAA+B,CAAA;EACvB,CAAA;CACC,CAAA,IAGV,kBAACgB,GAAD,CAAyB,CAAA;AAClC"}
1
+ {"version":3,"file":"NotificationsV2Landing.js","names":["NotificationHistoryAdminPage","lazy","m","PageLoader","DeliveryLogV2","historyDetails","useFeatureFlagDetails","AdminPageV2","Suspense","NotificationCenterPage","NotificationsV2Landing","params","useSearchParams","paths","useNotificationPaths","tab","Navigate","jsx"],"sources":["../../src/navigation-v2/NotificationsV2Landing.tsx"],"sourcesContent":["import { Suspense, lazy } from 'react';\nimport { Navigate, useSearchParams } from 'react-router';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { NotificationCenterPage } from '../pages/NotificationCenterPage';\nimport { AdminPageV2 } from './AdminPageV2';\nimport { useNotificationPaths } from './paths';\n\nconst NotificationHistoryAdminPage = lazy(() =>\n import('../pages/NotificationHistoryAdminPage').then((m) => ({\n default: m.NotificationHistoryAdminPage,\n }))\n);\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\n/**\n * The Delivery log (the Operations console, BOFF-11872). It opens, as on the\n * old landing's `?tab=history`, only while `notification.history` is on, and\n * behind the route-level permission gate; with the flag off the inbox shows\n * in its place (the URL is kept, so the page appears once the flag loads).\n */\nexport function DeliveryLogV2() {\n const historyDetails = useFeatureFlagDetails('notification.history');\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n if (!historyEnabled) return <NotificationCenterPage />;\n return (\n <AdminPageV2 tool=\"deliveryLog\">\n <Suspense fallback={<PageLoader />}>\n <NotificationHistoryAdminPage />\n </Suspense>\n </AdminPageV2>\n );\n}\n\n/**\n * `/notifications` under Navigation v2 (BOFF-11872): straight on the inbox,\n * no tab strip. Every old `?tab=` value still opens its page: `send`,\n * `templates` and `topics` go to their own routes, `history` is the Delivery\n * log (also at its own route, `delivery-log`), and `inbox` or anything\n * unknown is the inbox.\n */\nexport function NotificationsV2Landing() {\n const [params] = useSearchParams();\n const paths = useNotificationPaths();\n const tab = params.get('tab');\n\n if (tab === 'send') return <Navigate to={paths.send} replace />;\n if (tab === 'templates') return <Navigate to={paths.templates} replace />;\n if (tab === 'topics') return <Navigate to={paths.topics} replace />;\n if (tab === 'history') return <DeliveryLogV2 />;\n return <NotificationCenterPage />;\n}\n"],"mappings":";;;;;;;;AAOA,IAAMA,IAA+BC,QACnC,OAAO,2CAAwC,CAAC,MAAM,OAAO,EAC3D,SAASC,EAAE,6BACb,EAAE,CACJ;AAEA,SAASC,IAAa;CACpB,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA;AAET;AAQA,SAAgBC,IAAgB;CAC9B,IAAMC,IAAiBC,EAAsB,sBAAsB;CAGnE,OAFuBD,KAAyBA,EAAe,QAG7D,kBAACE,GAAD;EAAa,MAAK;EAChB,UAAA,kBAACC,GAAD;GAAU,UAAU,kBAACL,GAAD,CAAa,CAAA;GAC/B,UAAA,kBAACH,GAAD,CAA+B,CAAA;EACvB,CAAA;CACC,CAAA,IANa,kBAACS,GAAD,CAAyB,CAAA;AAQvD;AASA,SAAgBC,IAAyB;CACvC,IAAM,CAACC,KAAUC,EAAgB,GAC3BC,IAAQC,EAAqB,GAC7BC,IAAMJ,EAAO,IAAI,KAAK;CAM5B,OAJII,MAAQ,SAAe,kBAACC,GAAD;EAAU,IAAIH,EAAM;EAAM,SAAA;CAAS,CAAA,IAC1DE,MAAQ,cAAoB,kBAACC,GAAD;EAAU,IAAIH,EAAM;EAAW,SAAA;CAAS,CAAA,IACpEE,MAAQ,WAAiB,kBAACC,GAAD;EAAU,IAAIH,EAAM;EAAQ,SAAA;CAAS,CAAA,IACpCI,EAA1BF,MAAQ,YAAmBX,IACvBK,GADsB,CAAgB,CAAA;AAEhD"}
@@ -16,7 +16,7 @@ function r(e) {
16
16
  newTemplate: n(e, "templates/new"),
17
17
  template: (t) => n(e, `templates/${encodeURIComponent(t)}`),
18
18
  topics: n(e, "topics"),
19
- deliveryLog: `${n(e)}?tab=history`
19
+ deliveryLog: n(e, "delivery-log")
20
20
  };
21
21
  }
22
22
  function i() {
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","names":["joinNotificationPath","base","basePath","tail","sub","buildNotificationPaths","idOrSlug","useNotificationPaths","useNotification","useMemo","useNavigationV2"],"sources":["../../src/navigation-v2/paths.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useNotification } from '../providers/NotificationProvider';\n\n/** `base` + `sub` with exactly one slash between them; `sub` empty gives `base`. */\nexport function joinNotificationPath(basePath: string | undefined, sub = ''): string {\n const base = (basePath ?? '/').replace(/\\/+$/, '');\n const tail = sub.replace(/^\\/+/, '');\n if (!tail) return base || '/';\n return `${base}/${tail}`;\n}\n\n/** Absolute paths for every page of the module, from where the shell mounted it. */\nexport interface NotificationPaths {\n inbox: string;\n center: string;\n archived: string;\n preferences: string;\n send: string;\n templates: string;\n newTemplate: string;\n template: (idOrSlug: string) => string;\n topics: string;\n deliveryLog: string;\n}\n\nexport function buildNotificationPaths(basePath: string | undefined): NotificationPaths {\n return {\n inbox: joinNotificationPath(basePath),\n center: joinNotificationPath(basePath, 'center'),\n archived: joinNotificationPath(basePath, 'history'),\n preferences: joinNotificationPath(basePath, 'preferences'),\n send: joinNotificationPath(basePath, 'create'),\n templates: joinNotificationPath(basePath, 'templates'),\n newTemplate: joinNotificationPath(basePath, 'templates/new'),\n template: (idOrSlug: string) =>\n joinNotificationPath(basePath, `templates/${encodeURIComponent(idOrSlug)}`),\n topics: joinNotificationPath(basePath, 'topics'),\n // The delivery log has no route of its own; it is the old landing's\n // `?tab=history`, kept so every old link still opens it.\n deliveryLog: `${joinNotificationPath(basePath)}?tab=history`,\n };\n}\n\n/**\n * The module's paths, absolute. Navigating with these (never a relative\n * `navigate('new')`) means a page works the same whether it was opened by its\n * own route or inside the old tabbed landing (BOFF-11872 §8 items 3, 4, 11).\n */\nexport function useNotificationPaths(): NotificationPaths {\n const { basePath } = useNotification();\n return useMemo(() => buildNotificationPaths(basePath), [basePath]);\n}\n\n/** True when the host turned on FluidGrids' Navigation v2 layout. */\nexport function useNavigationV2(): boolean {\n return Boolean(useNotification().navigationV2);\n}\n"],"mappings":";;;AAIA,SAAgBA,EAAqB,GAA8B,IAAM,IAAY;CACnF,IAAMC,KAAQC,KAAY,IAAA,CAAK,QAAQ,QAAQ,EAAE,GAC3CC,IAAOC,EAAI,QAAQ,QAAQ,EAAE;CAEnC,OADKD,IACE,GAAGF,EAAK,GAAGE,MADAF,KAAQ;AAE5B;AAgBA,SAAgBI,EAAuB,GAAiD;CACtF,OAAO;EACL,OAAOL,EAAqBE,CAAQ;EACpC,QAAQF,EAAqBE,GAAU,QAAQ;EAC/C,UAAUF,EAAqBE,GAAU,SAAS;EAClD,aAAaF,EAAqBE,GAAU,aAAa;EACzD,MAAMF,EAAqBE,GAAU,QAAQ;EAC7C,WAAWF,EAAqBE,GAAU,WAAW;EACrD,aAAaF,EAAqBE,GAAU,eAAe;EAC3D,WAAW,MACTF,EAAqBE,GAAU,aAAa,mBAAmBI,CAAQ,GAAG;EAC5E,QAAQN,EAAqBE,GAAU,QAAQ;EAG/C,aAAa,GAAGF,EAAqBE,CAAQ,EAAE;CACjD;AACF;AAOA,SAAgBK,IAA0C;CACxD,IAAM,EAAE,gBAAaC,EAAgB;CACrC,OAAOC,QAAcJ,EAAuBH,CAAQ,GAAG,CAACA,CAAQ,CAAC;AACnE;AAGA,SAAgBQ,IAA2B;CACzC,OAAO,EAAQF,EAAgB,CAAC,CAAC;AACnC"}
1
+ {"version":3,"file":"paths.js","names":["joinNotificationPath","base","basePath","tail","sub","buildNotificationPaths","idOrSlug","useNotificationPaths","useNotification","useMemo","useNavigationV2"],"sources":["../../src/navigation-v2/paths.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useNotification } from '../providers/NotificationProvider';\n\n/** `base` + `sub` with exactly one slash between them; `sub` empty gives `base`. */\nexport function joinNotificationPath(basePath: string | undefined, sub = ''): string {\n const base = (basePath ?? '/').replace(/\\/+$/, '');\n const tail = sub.replace(/^\\/+/, '');\n if (!tail) return base || '/';\n return `${base}/${tail}`;\n}\n\n/** Absolute paths for every page of the module, from where the shell mounted it. */\nexport interface NotificationPaths {\n inbox: string;\n center: string;\n archived: string;\n preferences: string;\n send: string;\n templates: string;\n newTemplate: string;\n template: (idOrSlug: string) => string;\n topics: string;\n deliveryLog: string;\n}\n\nexport function buildNotificationPaths(basePath: string | undefined): NotificationPaths {\n return {\n inbox: joinNotificationPath(basePath),\n center: joinNotificationPath(basePath, 'center'),\n archived: joinNotificationPath(basePath, 'history'),\n preferences: joinNotificationPath(basePath, 'preferences'),\n send: joinNotificationPath(basePath, 'create'),\n templates: joinNotificationPath(basePath, 'templates'),\n newTemplate: joinNotificationPath(basePath, 'templates/new'),\n template: (idOrSlug: string) =>\n joinNotificationPath(basePath, `templates/${encodeURIComponent(idOrSlug)}`),\n topics: joinNotificationPath(basePath, 'topics'),\n // The delivery log's own route; the old landing's `?tab=history` still\n // opens it too, so every old link keeps working.\n deliveryLog: joinNotificationPath(basePath, 'delivery-log'),\n };\n}\n\n/**\n * The module's paths, absolute. Navigating with these (never a relative\n * `navigate('new')`) means a page works the same whether it was opened by its\n * own route or inside the old tabbed landing (BOFF-11872 §8 items 3, 4, 11).\n */\nexport function useNotificationPaths(): NotificationPaths {\n const { basePath } = useNotification();\n return useMemo(() => buildNotificationPaths(basePath), [basePath]);\n}\n\n/** True when the host turned on FluidGrids' Navigation v2 layout. */\nexport function useNavigationV2(): boolean {\n return Boolean(useNotification().navigationV2);\n}\n"],"mappings":";;;AAIA,SAAgBA,EAAqB,GAA8B,IAAM,IAAY;CACnF,IAAMC,KAAQC,KAAY,IAAA,CAAK,QAAQ,QAAQ,EAAE,GAC3CC,IAAOC,EAAI,QAAQ,QAAQ,EAAE;CAEnC,OADKD,IACE,GAAGF,EAAK,GAAGE,MADAF,KAAQ;AAE5B;AAgBA,SAAgBI,EAAuB,GAAiD;CACtF,OAAO;EACL,OAAOL,EAAqBE,CAAQ;EACpC,QAAQF,EAAqBE,GAAU,QAAQ;EAC/C,UAAUF,EAAqBE,GAAU,SAAS;EAClD,aAAaF,EAAqBE,GAAU,aAAa;EACzD,MAAMF,EAAqBE,GAAU,QAAQ;EAC7C,WAAWF,EAAqBE,GAAU,WAAW;EACrD,aAAaF,EAAqBE,GAAU,eAAe;EAC3D,WAAW,MACTF,EAAqBE,GAAU,aAAa,mBAAmBI,CAAQ,GAAG;EAC5E,QAAQN,EAAqBE,GAAU,QAAQ;EAG/C,aAAaF,EAAqBE,GAAU,cAAc;CAC5D;AACF;AAOA,SAAgBK,IAA0C;CACxD,IAAM,EAAE,gBAAaC,EAAgB;CACrC,OAAOC,QAAcJ,EAAuBH,CAAQ,GAAG,CAACA,CAAQ,CAAC;AACnE;AAGA,SAAgBQ,IAA2B;CACzC,OAAO,EAAQF,EAAgB,CAAC,CAAC;AACnC"}
@@ -606,7 +606,8 @@ function h() {
606
606
  className: "min-h-screen bg-bg-canvas",
607
607
  children: [
608
608
  /* @__PURE__ */ m("div", {
609
- className: "sticky top-0 z-10 flex items-center justify-between gap-3 px-6 py-4 bg-bg-surface border-b border-border-seam",
609
+ className: "sticky top-0 z-10 flex flex-wrap items-center justify-between gap-3 px-6 py-4 bg-bg-surface border-b border-border-seam sm:flex-nowrap",
610
+ "data-testid": "notification-send-header",
610
611
  children: [/* @__PURE__ */ m("div", {
611
612
  className: "flex items-center gap-4",
612
613
  children: [/* @__PURE__ */ p("button", {
@@ -703,7 +704,7 @@ function h() {
703
704
  })]
704
705
  }),
705
706
  /* @__PURE__ */ m("div", {
706
- className: "flex gap-6 p-6",
707
+ className: "flex flex-col gap-6 p-6 sm:flex-row",
707
708
  children: [/* @__PURE__ */ m("div", {
708
709
  className: `flex-1 space-y-6 ${K ? "max-w-2xl" : ""}`,
709
710
  children: [
@@ -1299,7 +1300,8 @@ function h() {
1299
1300
  })
1300
1301
  ]
1301
1302
  }), K && /* @__PURE__ */ p("div", {
1302
- className: "w-96 flex-shrink-0",
1303
+ className: "w-full flex-shrink-0 sm:w-96",
1304
+ "data-testid": "notification-preview-rail",
1303
1305
  children: /* @__PURE__ */ m(we, {
1304
1306
  treatment: "glass",
1305
1307
  glow: !0,
@@ -1392,7 +1394,7 @@ function h() {
1392
1394
  }), /* @__PURE__ */ p("div", {
1393
1395
  className: "flex flex-wrap gap-2",
1394
1396
  children: Q.map((e) => /* @__PURE__ */ p("span", {
1395
- className: "rounded-full bg-bg-sunken px-2 py-1 text-xs text-secondary",
1397
+ className: "rounded-full bg-bg-sunken px-2 py-1 text-xs text-text-secondary",
1396
1398
  children: e.label
1397
1399
  }, e.id))
1398
1400
  })]