@burdenoff/microfe-notification 2026.1029.2 → 2026.1109.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 (218) hide show
  1. package/dist/AdminNotificationRoot.d.ts +33 -0
  2. package/dist/AdminNotificationRoot.js +9 -6
  3. package/dist/AdminNotificationRoot.js.map +1 -1
  4. package/dist/AdminNotificationRoutes.d.ts +1 -0
  5. package/dist/AdminNotificationRoutes.js +22 -23
  6. package/dist/AdminNotificationRoutes.js.map +1 -1
  7. package/dist/NotificationRoot.d.ts +29 -0
  8. package/dist/NotificationRoot.js +9 -6
  9. package/dist/NotificationRoot.js.map +1 -1
  10. package/dist/NotificationRoutes.d.ts +18 -0
  11. package/dist/NotificationRoutes.js +1 -2
  12. package/dist/NotificationRoutes.js.map +1 -1
  13. package/dist/UserNotificationRoot.d.ts +32 -0
  14. package/dist/UserNotificationRoot.js +9 -6
  15. package/dist/UserNotificationRoot.js.map +1 -1
  16. package/dist/UserNotificationRoutes.d.ts +16 -0
  17. package/dist/UserNotificationRoutes.js +9 -10
  18. package/dist/UserNotificationRoutes.js.map +1 -1
  19. package/dist/components/FeatureDisabledPage.d.ts +6 -0
  20. package/dist/components/FeatureDisabledPage.js +1 -2
  21. package/dist/components/FeatureDisabledPage.js.map +1 -1
  22. package/dist/components/NotificationBell.d.ts +13 -0
  23. package/dist/components/NotificationBell.js +6 -7
  24. package/dist/components/NotificationBell.js.map +1 -1
  25. package/dist/components/NotificationCard.d.ts +18 -0
  26. package/dist/components/NotificationCard.js +10 -11
  27. package/dist/components/NotificationCard.js.map +1 -1
  28. package/dist/components/NotificationPanel.d.ts +10 -0
  29. package/dist/components/NotificationPanel.js +5 -6
  30. package/dist/components/NotificationPanel.js.map +1 -1
  31. package/dist/components/RecipientSelector.d.ts +32 -0
  32. package/dist/components/RecipientSelector.js +2 -3
  33. package/dist/components/RecipientSelector.js.map +1 -1
  34. package/dist/components/TemplatePreview.d.ts +21 -0
  35. package/dist/components/TemplatePreview.js +3 -4
  36. package/dist/components/TemplatePreview.js.map +1 -1
  37. package/dist/components/VariableInserter.d.ts +11 -0
  38. package/dist/components/index.d.ts +3 -0
  39. package/dist/components/index.js +4 -3
  40. package/dist/constants/permissions.d.ts +23 -0
  41. package/dist/constants/permissions.js +1 -2
  42. package/dist/constants/permissions.js.map +1 -1
  43. package/dist/dev/main.d.ts +0 -0
  44. package/dist/generated/global-operations.d.ts +2119 -0
  45. package/dist/generated/global-operations.js +80 -69
  46. package/dist/generated/global-operations.js.map +1 -1
  47. package/dist/generated/global-types.d.ts +23507 -0
  48. package/dist/generated/wspace-operations.d.ts +4 -0
  49. package/dist/generated/wspace-types.d.ts +57831 -0
  50. package/dist/graphql/global-client.d.ts +32 -0
  51. package/dist/graphql/global-client.js +23 -30
  52. package/dist/graphql/global-client.js.map +1 -1
  53. package/dist/hooks/index.d.ts +7 -0
  54. package/dist/hooks/index.js +7 -6
  55. package/dist/hooks/useNotificationAdmin.d.ts +46 -0
  56. package/dist/hooks/useNotificationAdmin.js +18 -17
  57. package/dist/hooks/useNotificationAdmin.js.map +1 -1
  58. package/dist/hooks/useNotificationAnalytics.d.ts +65 -0
  59. package/dist/hooks/useNotificationAnalytics.js +1 -2
  60. package/dist/hooks/useNotificationAnalytics.js.map +1 -1
  61. package/dist/hooks/useNotificationPreferences.d.ts +10 -0
  62. package/dist/hooks/useNotificationPreferences.js +7 -7
  63. package/dist/hooks/useNotificationPreferences.js.map +1 -1
  64. package/dist/hooks/useNotificationTemplates.d.ts +131 -0
  65. package/dist/hooks/useNotificationTemplates.js +1 -2
  66. package/dist/hooks/useNotificationTemplates.js.map +1 -1
  67. package/dist/hooks/useNotificationTopics.d.ts +35 -0
  68. package/dist/hooks/useNotificationTopics.js +22 -22
  69. package/dist/hooks/useNotificationTopics.js.map +1 -1
  70. package/dist/hooks/useNotifications.d.ts +39 -0
  71. package/dist/hooks/useNotifications.js +6 -4
  72. package/dist/hooks/useNotifications.js.map +1 -1
  73. package/dist/hooks/useSendNotification.d.ts +158 -0
  74. package/dist/hooks/useSendNotification.js +12 -10
  75. package/dist/hooks/useSendNotification.js.map +1 -1
  76. package/dist/hooks/useUserSearch.d.ts +26 -0
  77. package/dist/hooks/useUserSearch.js +8 -10
  78. package/dist/hooks/useUserSearch.js.map +1 -1
  79. package/dist/index.d.ts +36 -0
  80. package/dist/index.js +8 -8
  81. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +1 -2
  82. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -1
  83. package/dist/node_modules/@apollo/client/errors/utils.js +1 -2
  84. package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -1
  85. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +7 -8
  86. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -1
  87. package/dist/node_modules/@apollo/client/link/subscriptions/index.js +9 -10
  88. package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -1
  89. package/dist/node_modules/@apollo/client/link/utils/createOperation.js +5 -6
  90. package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -1
  91. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -1
  92. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -1
  93. package/dist/node_modules/@apollo/client/utilities/graphql/print.js +4 -5
  94. package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -1
  95. package/dist/node_modules/@apollo/client/utilities/internal/caches.js +1 -2
  96. package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -1
  97. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +1 -2
  98. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -1
  99. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +2 -3
  100. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -1
  101. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +1 -2
  102. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -1
  103. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +1 -2
  104. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -1
  105. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +1 -2
  106. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -1
  107. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +1 -2
  108. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -1
  109. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +1 -2
  110. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -1
  111. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +1 -2
  112. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -1
  113. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +1 -2
  114. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -1
  115. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +1 -2
  116. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -1
  117. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +1 -2
  118. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -1
  119. package/dist/node_modules/@apollo/client/utilities/invariant/index.js +2 -3
  120. package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -1
  121. package/dist/node_modules/@apollo/client/version.js +2 -3
  122. package/dist/node_modules/@apollo/client/version.js.map +1 -1
  123. package/dist/node_modules/@wry/caches/lib/weak.js +1 -2
  124. package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -1
  125. package/dist/node_modules/@wry/trie/lib/index.js +2 -3
  126. package/dist/node_modules/@wry/trie/lib/index.js.map +1 -1
  127. package/dist/node_modules/graphql-ws/dist/client.js +76 -69
  128. package/dist/node_modules/graphql-ws/dist/client.js.map +1 -1
  129. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +2 -3
  130. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -1
  131. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +2 -3
  132. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -1
  133. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +41 -42
  134. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -1
  135. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +14 -15
  136. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -1
  137. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +21 -18
  138. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -1
  139. package/dist/node_modules/rxjs/dist/esm5/internal/config.js +1 -2
  140. package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -1
  141. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +1 -2
  142. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -1
  143. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +2 -3
  144. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -1
  145. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +1 -2
  146. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -1
  147. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +1 -2
  148. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -1
  149. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +1 -2
  150. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -1
  151. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +1 -2
  152. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -1
  153. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +1 -2
  154. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -1
  155. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +1 -2
  156. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -1
  157. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +1 -2
  158. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -1
  159. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +1 -2
  160. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -1
  161. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +1 -2
  162. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -1
  163. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +1 -2
  164. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -1
  165. package/dist/node_modules/{rxjs/node_modules/tslib → tslib}/tslib.es6.js +1 -2
  166. package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
  167. package/dist/pages/CreateNotificationPage.d.ts +5 -0
  168. package/dist/pages/CreateNotificationPage.js +18 -19
  169. package/dist/pages/CreateNotificationPage.js.map +1 -1
  170. package/dist/pages/NotificationCenterPage.d.ts +6 -0
  171. package/dist/pages/NotificationCenterPage.js +13 -14
  172. package/dist/pages/NotificationCenterPage.js.map +1 -1
  173. package/dist/pages/NotificationHistoryAdminPage.d.ts +2 -0
  174. package/dist/pages/NotificationHistoryAdminPage.js +7 -8
  175. package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
  176. package/dist/pages/NotificationHistoryPage.d.ts +2 -0
  177. package/dist/pages/NotificationHistoryPage.js +13 -14
  178. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  179. package/dist/pages/NotificationLandingPage.d.ts +10 -0
  180. package/dist/pages/NotificationLandingPage.js +5 -6
  181. package/dist/pages/NotificationLandingPage.js.map +1 -1
  182. package/dist/pages/NotificationPreferencesPage.d.ts +1 -0
  183. package/dist/pages/NotificationPreferencesPage.js +14 -15
  184. package/dist/pages/NotificationPreferencesPage.js.map +1 -1
  185. package/dist/pages/NotificationTemplatesPage.d.ts +7 -0
  186. package/dist/pages/NotificationTemplatesPage.js +25 -23
  187. package/dist/pages/NotificationTemplatesPage.js.map +1 -1
  188. package/dist/pages/NotificationTopicsPage.d.ts +1 -0
  189. package/dist/pages/NotificationTopicsPage.js +6 -7
  190. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  191. package/dist/pages/TemplateEditorPage.d.ts +12 -0
  192. package/dist/pages/TemplateEditorPage.js +294 -285
  193. package/dist/pages/TemplateEditorPage.js.map +1 -1
  194. package/dist/providers/NotificationProvider.d.ts +11 -0
  195. package/dist/providers/NotificationProvider.js +1 -2
  196. package/dist/providers/NotificationProvider.js.map +1 -1
  197. package/dist/shared/hooks/useTr.d.ts +13 -0
  198. package/dist/shared/hooks/useTr.js +1 -2
  199. package/dist/shared/hooks/useTr.js.map +1 -1
  200. package/dist/store/notificationStore.d.ts +30 -0
  201. package/dist/store/notificationStore.js +1 -2
  202. package/dist/store/notificationStore.js.map +1 -1
  203. package/dist/test/happydom.d.ts +1 -0
  204. package/dist/translations/en.d.ts +468 -0
  205. package/dist/types/index.d.ts +249 -0
  206. package/dist/utils/inAppNavigation.d.ts +37 -0
  207. package/dist/utils/inAppNavigation.js +2 -3
  208. package/dist/utils/inAppNavigation.js.map +1 -1
  209. package/dist/utils/index.d.ts +68 -0
  210. package/dist/utils/index.js +1 -2
  211. package/dist/utils/index.js.map +1 -1
  212. package/dist/utils/nativeBridge.d.ts +2 -0
  213. package/dist/utils/nativeBridge.js +1 -2
  214. package/dist/utils/notificationHistoryExport.d.ts +12 -0
  215. package/dist/utils/notificationHistoryExport.js +1 -2
  216. package/dist/utils/notificationHistoryExport.js.map +1 -1
  217. package/package.json +66 -48
  218. package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"RecipientSelector.js","names":[],"sources":["../../src/components/RecipientSelector.tsx"],"sourcesContent":["import { useState, useCallback, useRef, useEffect } from 'react';\nimport { X, Plus, Mail, Phone, User, Users, AlertCircle } from 'lucide-react';\nimport type { RecipientInput, NotificationChannelType } from '../hooks/useSendNotification';\nimport { useTr } from '../shared/hooks/useTr';\n\n/**\n * Recipient with display info\n */\nexport interface Recipient extends RecipientInput {\n id: string;\n displayName: string;\n type: 'email' | 'phone' | 'user' | 'manual';\n}\n\ninterface RecipientSelectorProps {\n recipients: Recipient[];\n onChange: (recipients: Recipient[]) => void;\n channel: NotificationChannelType;\n placeholder?: string;\n disabled?: boolean;\n maxRecipients?: number;\n error?: string;\n}\n\n/**\n * Get icon for recipient type\n */\nfunction getRecipientIcon(type: Recipient['type']) {\n switch (type) {\n case 'email':\n return <Mail size={14} className=\"text-status-info-text\" />;\n case 'phone':\n return <Phone size={14} className=\"text-status-success-text\" />;\n case 'user':\n return <User size={14} className=\"text-accent-purple\" />;\n default:\n return <User size={14} className=\"text-text-secondary\" />;\n }\n}\n\n/**\n * Validate email format\n */\nfunction isValidEmail(email: string): boolean {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(email);\n}\n\n/**\n * Validate phone format (basic validation)\n */\nfunction isValidPhone(phone: string): boolean {\n const phoneRegex = /^\\+?[1-9]\\d{6,14}$/;\n return phoneRegex.test(phone.replace(/[\\s\\-\\(\\)]/g, ''));\n}\n\n/**\n * Generate unique ID\n */\nfunction generateId(): string {\n return `recipient-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n}\n\n/**\n * RecipientSelector component\n *\n * Allows selecting multiple recipients for notifications.\n * Supports email, phone, and manual input based on channel type.\n */\nexport function RecipientSelector({\n recipients,\n onChange,\n channel,\n placeholder,\n disabled = false,\n maxRecipients = 100,\n error,\n}: RecipientSelectorProps) {\n const tr = useTr();\n const [inputValue, setInputValue] = useState('');\n const [inputError, setInputError] = useState<string | null>(null);\n const [isFocused, setIsFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Determine input type based on channel\n const inputType =\n channel === 'EMAIL' ? 'email' : channel === 'SMS' || channel === 'WHATSAPP' ? 'phone' : 'text';\n const inputPlaceholder =\n placeholder ||\n (channel === 'EMAIL'\n ? tr('notifCommon.enterEmailPlaceholder', 'Enter email address...')\n : channel === 'SMS' || channel === 'WHATSAPP'\n ? tr('notifCommon.enterPhonePlaceholder', 'Enter phone number (e.g., +1234567890)...')\n : channel === 'PUSH'\n ? tr('notifCommon.enterDeviceTokenPlaceholder', 'Enter device token...')\n : channel === 'SLACK'\n ? tr('notifCommon.enterSlackIdPlaceholder', 'Enter Slack user ID...')\n : channel === 'TEAMS'\n ? tr('notifCommon.enterTeamsIdPlaceholder', 'Enter Teams user ID...')\n : tr('notifCommon.enterRecipientPlaceholder', 'Enter recipient...'));\n\n // Clear input error when input changes\n useEffect(() => {\n if (inputValue) {\n setInputError(null);\n }\n }, [inputValue]);\n\n /**\n * Add a recipient\n */\n const addRecipient = useCallback(\n (value: string) => {\n const trimmedValue = value.trim();\n if (!trimmedValue) return;\n\n // Check max recipients\n if (recipients.length >= maxRecipients) {\n setInputError(\n tr('notifCommon.maxRecipientsAllowed', `Maximum ${maxRecipients} recipients allowed`)\n );\n return;\n }\n\n // Check for duplicates\n const isDuplicate = recipients.some((r) => {\n if (channel === 'EMAIL') return r.email === trimmedValue;\n if (channel === 'SMS' || channel === 'WHATSAPP')\n return r.phoneNumber === trimmedValue || r.whatsappNumber === trimmedValue;\n return false;\n });\n\n if (isDuplicate) {\n setInputError(\n tr('notifCommon.duplicateRecipient', 'This recipient has already been added')\n );\n return;\n }\n\n // Validate based on channel\n let recipient: Recipient | null = null;\n\n if (channel === 'EMAIL') {\n if (!isValidEmail(trimmedValue)) {\n setInputError(tr('notifCommon.invalidEmail', 'Please enter a valid email address'));\n return;\n }\n recipient = {\n id: generateId(),\n email: trimmedValue,\n displayName: trimmedValue,\n type: 'email',\n };\n } else if (channel === 'SMS') {\n if (!isValidPhone(trimmedValue)) {\n setInputError(\n tr('notifCommon.invalidPhone', 'Please enter a valid phone number (e.g., +1234567890)')\n );\n return;\n }\n recipient = {\n id: generateId(),\n phoneNumber: trimmedValue,\n displayName: trimmedValue,\n type: 'phone',\n };\n } else if (channel === 'WHATSAPP') {\n if (!isValidPhone(trimmedValue)) {\n setInputError(\n tr(\n 'notifCommon.invalidWhatsApp',\n 'Please enter a valid WhatsApp number (e.g., +1234567890)'\n )\n );\n return;\n }\n recipient = {\n id: generateId(),\n whatsappNumber: trimmedValue,\n displayName: trimmedValue,\n type: 'phone',\n };\n } else if (channel === 'PUSH') {\n recipient = {\n id: generateId(),\n pushToken: trimmedValue,\n displayName: trimmedValue.substring(0, 20) + '...',\n type: 'manual',\n };\n } else if (channel === 'SLACK') {\n recipient = {\n id: generateId(),\n slackUserId: trimmedValue,\n displayName: trimmedValue,\n type: 'user',\n };\n } else if (channel === 'TEAMS') {\n recipient = {\n id: generateId(),\n teamsUserId: trimmedValue,\n displayName: trimmedValue,\n type: 'user',\n };\n } else if (channel === 'WEBHOOK') {\n recipient = {\n id: generateId(),\n webhookUrl: trimmedValue,\n displayName: trimmedValue,\n type: 'manual',\n };\n } else {\n // Other channels - use userId\n recipient = {\n id: generateId(),\n userId: trimmedValue,\n displayName: trimmedValue,\n type: 'user',\n };\n }\n\n if (recipient) {\n onChange([...recipients, recipient]);\n setInputValue('');\n setInputError(null);\n }\n },\n [recipients, onChange, channel, maxRecipients, tr]\n );\n\n /**\n * Remove a recipient\n */\n const removeRecipient = useCallback(\n (id: string) => {\n onChange(recipients.filter((r) => r.id !== id));\n },\n [recipients, onChange]\n );\n\n /**\n * Handle key down\n */\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' || e.key === ',') {\n e.preventDefault();\n addRecipient(inputValue);\n } else if (e.key === 'Backspace' && !inputValue && recipients.length > 0) {\n // Remove last recipient on backspace when input is empty\n removeRecipient(recipients[recipients.length - 1].id);\n }\n };\n\n /**\n * Handle paste (for bulk adding)\n */\n const handlePaste = (e: React.ClipboardEvent<HTMLInputElement>) => {\n const pastedText = e.clipboardData.getData('text');\n\n // Check if pasted text contains multiple values (comma or newline separated)\n if (pastedText.includes(',') || pastedText.includes('\\n')) {\n e.preventDefault();\n const values = pastedText\n .split(/[,\\n]/)\n .map((v) => v.trim())\n .filter(Boolean);\n\n values.forEach((value) => {\n addRecipient(value);\n });\n }\n };\n\n return (\n <div className=\"space-y-2\">\n {/* Input container */}\n <div\n className={`\n relative flex flex-wrap items-center gap-2 p-2 min-h-[42px]\n bg-surface border rounded-lg transition-colors\n ${isFocused ? 'border-primary-500 ring-1 ring-primary-500' : 'border-border-subtle'}\n ${disabled ? 'opacity-50 cursor-not-allowed bg-bg-sunken' : ''}\n ${error || inputError ? 'border-error-500' : ''}\n `}\n onClick={() => inputRef.current?.focus()}\n >\n {/* Selected recipients */}\n {recipients.map((recipient) => (\n <div\n key={recipient.id}\n className=\"flex items-center gap-1.5 px-2 py-1 bg-surface-elevated border border-border-subtle rounded-full text-sm\"\n >\n {getRecipientIcon(recipient.type)}\n <span className=\"text-text-primary max-w-[200px] truncate\">\n {recipient.displayName}\n </span>\n {!disabled && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n removeRecipient(recipient.id);\n }}\n className=\"p-0.5 hover:bg-surface-hover rounded-full transition-colors\"\n aria-label={tr('notifCommon.removeRecipient', 'Remove {{name}}').replace(\n '{{name}}',\n recipient.displayName\n )}\n >\n <X size={12} className=\"text-text-secondary\" />\n </button>\n )}\n </div>\n ))}\n\n {/* Input */}\n {!disabled && recipients.length < maxRecipients && (\n <input\n ref={inputRef}\n type={inputType}\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n onKeyDown={handleKeyDown}\n onPaste={handlePaste}\n onFocus={() => setIsFocused(true)}\n onBlur={() => {\n setIsFocused(false);\n if (inputValue.trim()) {\n addRecipient(inputValue);\n }\n }}\n placeholder={\n recipients.length === 0 ? inputPlaceholder : tr('notifCommon.addMore', 'Add more...')\n }\n className=\"flex-1 min-w-[150px] bg-transparent border-none outline-none text-sm text-text-primary placeholder:text-text-secondary\"\n disabled={disabled}\n />\n )}\n\n {/* Add button for clarity */}\n {!disabled && inputValue.trim() && (\n <button\n type=\"button\"\n onClick={() => addRecipient(inputValue)}\n className=\"p-1 text-primary-500 hover:bg-primary-100 rounded transition-colors\"\n aria-label={tr('notifCommon.addRecipient', 'Add recipient')}\n >\n <Plus size={16} />\n </button>\n )}\n </div>\n\n {/* Error message */}\n {(error || inputError) && (\n <div className=\"flex items-center gap-1.5 text-error-500 text-sm\">\n <AlertCircle size={14} />\n <span>{error || inputError}</span>\n </div>\n )}\n\n {/* Helper text */}\n <div className=\"flex items-center justify-between text-xs text-text-secondary\">\n <span>\n {channel === 'EMAIL' &&\n tr(\n 'notifCommon.emailHelperText',\n 'Enter email addresses. Press Enter or comma to add multiple.'\n )}\n {(channel === 'SMS' || channel === 'WHATSAPP') &&\n tr(\n 'notifCommon.phoneHelperText',\n 'Enter phone numbers with country code (e.g., +1234567890).'\n )}\n\n {channel === 'PUSH' &&\n tr('notifCommon.pushHelperText', 'Enter device tokens for push notifications.')}\n {channel === 'SLACK' && tr('notifCommon.slackHelperText', 'Enter Slack user IDs.')}\n {channel === 'TEAMS' &&\n tr('notifCommon.teamsHelperText', 'Enter Microsoft Teams user IDs.')}\n {channel === 'WEBHOOK' && tr('notifCommon.webhookHelperText', 'Enter webhook URLs.')}\n </span>\n <span>\n {recipients.length} / {maxRecipients}\n </span>\n </div>\n </div>\n );\n}\n\n/**\n * Compact recipient display for read-only views\n */\nexport function RecipientList({ recipients }: { recipients: Recipient[] }) {\n const tr = useTr();\n\n if (recipients.length === 0) {\n return (\n <span className=\"text-text-secondary text-sm\">\n {tr('notifCommon.noRecipients', 'No recipients')}\n </span>\n );\n }\n\n return (\n <div className=\"flex flex-wrap items-center gap-1.5\">\n {recipients.slice(0, 5).map((recipient) => (\n <div\n key={recipient.id}\n className=\"flex items-center gap-1 px-2 py-0.5 bg-surface-elevated border border-border-subtle rounded-full text-xs\"\n >\n {getRecipientIcon(recipient.type)}\n <span className=\"text-text-primary max-w-[150px] truncate\">{recipient.displayName}</span>\n </div>\n ))}\n {recipients.length > 5 && (\n <span className=\"flex items-center gap-1 px-2 py-0.5 bg-bg-sunken text-text-secondary rounded-full text-xs\">\n <Users size={12} />+{recipients.length - 5} {tr('notifCommon.more', 'more')}\n </span>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;AA2BA,SAAS,EAAiB,GAAyB;AACjD,SAAQ,GAAR;EACE,KAAK,QACH,QAAO,kBAAC,GAAD;GAAM,MAAM;GAAI,WAAU;GAA0B,CAAA;EAC7D,KAAK,QACH,QAAO,kBAAC,GAAD;GAAO,MAAM;GAAI,WAAU;GAA6B,CAAA;EACjE,KAAK,OACH,QAAO,kBAAC,GAAD;GAAM,MAAM;GAAI,WAAU;GAAuB,CAAA;EAC1D,QACE,QAAO,kBAAC,GAAD;GAAM,MAAM;GAAI,WAAU;GAAwB,CAAA;;;AAO/D,SAAS,EAAa,GAAwB;AAE5C,QADmB,6BACD,KAAK,EAAM;;AAM/B,SAAS,EAAa,GAAwB;AAE5C,QADmB,qBACD,KAAK,EAAM,QAAQ,eAAe,GAAG,CAAC;;AAM1D,SAAS,IAAqB;AAC5B,QAAO,aAAa,KAAK,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,OAAO,GAAG,EAAE;;AAS3E,SAAgB,EAAkB,EAChC,eACA,aACA,YACA,gBACA,cAAW,IACX,mBAAgB,KAChB,YACyB;CACzB,IAAM,IAAK,GAAO,EACZ,CAAC,GAAY,KAAiB,EAA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IAAM,CAAA,EACzB,kBAAC,QAAD,EAAA,UAAO,KAAS,GAAkB,CAAA,CAC9B;;GAIR,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD,EAAA,UAAA;KACG,MAAY,WACX,EACE,+BACA,+DACD;MACD,MAAY,SAAS,MAAY,eACjC,EACE,+BACA,6DACD;KAEF,MAAY,UACX,EAAG,8BAA8B,8CAA8C;KAChF,MAAY,WAAW,EAAG,+BAA+B,wBAAwB;KACjF,MAAY,WACX,EAAG,+BAA+B,kCAAkC;KACrE,MAAY,aAAa,EAAG,iCAAiC,sBAAsB;KAC/E,EAAA,CAAA,EACP,kBAAC,QAAD,EAAA,UAAA;KACG,EAAW;KAAO;KAAI;KAClB,EAAA,CAAA,CACH;;GACF"}
1
+ {"version":3,"file":"RecipientSelector.js","names":["getRecipientIcon","type","Mail","Phone","User","isValidEmail","email","isValidPhone","phone","generateId","RecipientSelector","tr","useTr","inputValue","setInputValue","useState","inputError","setInputError","isFocused","setIsFocused","inputRef","useRef","inputType","channel","inputPlaceholder","placeholder","addRecipient","useCallback","trimmedValue","value","recipients","maxRecipients","r","recipient","onChange","removeRecipient","id","disabled","error","e","X","pastedText","v","Plus","AlertCircle"],"sources":["../../src/components/RecipientSelector.tsx"],"sourcesContent":["import { useState, useCallback, useRef, useEffect } from 'react';\nimport { X, Plus, Mail, Phone, User, Users, AlertCircle } from 'lucide-react';\nimport type { RecipientInput, NotificationChannelType } from '../hooks/useSendNotification';\nimport { useTr } from '../shared/hooks/useTr';\n\n/**\n * Recipient with display info\n */\nexport interface Recipient extends RecipientInput {\n id: string;\n displayName: string;\n type: 'email' | 'phone' | 'user' | 'manual';\n}\n\ninterface RecipientSelectorProps {\n recipients: Recipient[];\n onChange: (recipients: Recipient[]) => void;\n channel: NotificationChannelType;\n placeholder?: string;\n disabled?: boolean;\n maxRecipients?: number;\n error?: string;\n}\n\n/**\n * Get icon for recipient type\n */\nfunction getRecipientIcon(type: Recipient['type']) {\n switch (type) {\n case 'email':\n return <Mail size={14} className=\"text-status-info-text\" />;\n case 'phone':\n return <Phone size={14} className=\"text-status-success-text\" />;\n case 'user':\n return <User size={14} className=\"text-accent-purple\" />;\n default:\n return <User size={14} className=\"text-text-secondary\" />;\n }\n}\n\n/**\n * Validate email format\n */\nfunction isValidEmail(email: string): boolean {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(email);\n}\n\n/**\n * Validate phone format (basic validation)\n */\nfunction isValidPhone(phone: string): boolean {\n const phoneRegex = /^\\+?[1-9]\\d{6,14}$/;\n return phoneRegex.test(phone.replace(/[\\s\\-()]/g, ''));\n}\n\n/**\n * Generate unique ID\n */\nfunction generateId(): string {\n return `recipient-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n}\n\n/**\n * RecipientSelector component\n *\n * Allows selecting multiple recipients for notifications.\n * Supports email, phone, and manual input based on channel type.\n */\nexport function RecipientSelector({\n recipients,\n onChange,\n channel,\n placeholder,\n disabled = false,\n maxRecipients = 100,\n error,\n}: RecipientSelectorProps) {\n const tr = useTr();\n const [inputValue, setInputValue] = useState('');\n const [inputError, setInputError] = useState<string | null>(null);\n const [isFocused, setIsFocused] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Determine input type based on channel\n const inputType =\n channel === 'EMAIL' ? 'email' : channel === 'SMS' || channel === 'WHATSAPP' ? 'phone' : 'text';\n const inputPlaceholder =\n placeholder ||\n (channel === 'EMAIL'\n ? tr('notifCommon.enterEmailPlaceholder', 'Enter email address...')\n : channel === 'SMS' || channel === 'WHATSAPP'\n ? tr('notifCommon.enterPhonePlaceholder', 'Enter phone number (e.g., +1234567890)...')\n : channel === 'PUSH'\n ? tr('notifCommon.enterDeviceTokenPlaceholder', 'Enter device token...')\n : channel === 'SLACK'\n ? tr('notifCommon.enterSlackIdPlaceholder', 'Enter Slack user ID...')\n : channel === 'TEAMS'\n ? tr('notifCommon.enterTeamsIdPlaceholder', 'Enter Teams user ID...')\n : tr('notifCommon.enterRecipientPlaceholder', 'Enter recipient...'));\n\n // Clear input error when input changes\n useEffect(() => {\n if (inputValue) {\n setInputError(null);\n }\n }, [inputValue]);\n\n /**\n * Add a recipient\n */\n const addRecipient = useCallback(\n (value: string) => {\n const trimmedValue = value.trim();\n if (!trimmedValue) return;\n\n // Check max recipients\n if (recipients.length >= maxRecipients) {\n setInputError(\n tr('notifCommon.maxRecipientsAllowed', `Maximum ${maxRecipients} recipients allowed`)\n );\n return;\n }\n\n // Check for duplicates\n const isDuplicate = recipients.some((r) => {\n if (channel === 'EMAIL') return r.email === trimmedValue;\n if (channel === 'SMS' || channel === 'WHATSAPP')\n return r.phoneNumber === trimmedValue || r.whatsappNumber === trimmedValue;\n return false;\n });\n\n if (isDuplicate) {\n setInputError(\n tr('notifCommon.duplicateRecipient', 'This recipient has already been added')\n );\n return;\n }\n\n // Validate based on channel\n let recipient: Recipient | null = null;\n\n if (channel === 'EMAIL') {\n if (!isValidEmail(trimmedValue)) {\n setInputError(tr('notifCommon.invalidEmail', 'Please enter a valid email address'));\n return;\n }\n recipient = {\n id: generateId(),\n email: trimmedValue,\n displayName: trimmedValue,\n type: 'email',\n };\n } else if (channel === 'SMS') {\n if (!isValidPhone(trimmedValue)) {\n setInputError(\n tr('notifCommon.invalidPhone', 'Please enter a valid phone number (e.g., +1234567890)')\n );\n return;\n }\n recipient = {\n id: generateId(),\n phoneNumber: trimmedValue,\n displayName: trimmedValue,\n type: 'phone',\n };\n } else if (channel === 'WHATSAPP') {\n if (!isValidPhone(trimmedValue)) {\n setInputError(\n tr(\n 'notifCommon.invalidWhatsApp',\n 'Please enter a valid WhatsApp number (e.g., +1234567890)'\n )\n );\n return;\n }\n recipient = {\n id: generateId(),\n whatsappNumber: trimmedValue,\n displayName: trimmedValue,\n type: 'phone',\n };\n } else if (channel === 'PUSH') {\n recipient = {\n id: generateId(),\n pushToken: trimmedValue,\n displayName: trimmedValue.substring(0, 20) + '...',\n type: 'manual',\n };\n } else if (channel === 'SLACK') {\n recipient = {\n id: generateId(),\n slackUserId: trimmedValue,\n displayName: trimmedValue,\n type: 'user',\n };\n } else if (channel === 'TEAMS') {\n recipient = {\n id: generateId(),\n teamsUserId: trimmedValue,\n displayName: trimmedValue,\n type: 'user',\n };\n } else if (channel === 'WEBHOOK') {\n recipient = {\n id: generateId(),\n webhookUrl: trimmedValue,\n displayName: trimmedValue,\n type: 'manual',\n };\n } else {\n // Other channels - use userId\n recipient = {\n id: generateId(),\n userId: trimmedValue,\n displayName: trimmedValue,\n type: 'user',\n };\n }\n\n if (recipient) {\n onChange([...recipients, recipient]);\n setInputValue('');\n setInputError(null);\n }\n },\n [recipients, onChange, channel, maxRecipients, tr]\n );\n\n /**\n * Remove a recipient\n */\n const removeRecipient = useCallback(\n (id: string) => {\n onChange(recipients.filter((r) => r.id !== id));\n },\n [recipients, onChange]\n );\n\n /**\n * Handle key down\n */\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' || e.key === ',') {\n e.preventDefault();\n addRecipient(inputValue);\n } else if (e.key === 'Backspace' && !inputValue && recipients.length > 0) {\n // Remove last recipient on backspace when input is empty\n removeRecipient(recipients[recipients.length - 1].id);\n }\n };\n\n /**\n * Handle paste (for bulk adding)\n */\n const handlePaste = (e: React.ClipboardEvent<HTMLInputElement>) => {\n const pastedText = e.clipboardData.getData('text');\n\n // Check if pasted text contains multiple values (comma or newline separated)\n if (pastedText.includes(',') || pastedText.includes('\\n')) {\n e.preventDefault();\n const values = pastedText\n .split(/[,\\n]/)\n .map((v) => v.trim())\n .filter(Boolean);\n\n values.forEach((value) => {\n addRecipient(value);\n });\n }\n };\n\n return (\n <div className=\"space-y-2\">\n {/* Input container */}\n <div\n className={`\n relative flex flex-wrap items-center gap-2 p-2 min-h-[42px]\n bg-surface border rounded-lg transition-colors\n ${isFocused ? 'border-primary-500 ring-1 ring-primary-500' : 'border-border-subtle'}\n ${disabled ? 'opacity-50 cursor-not-allowed bg-bg-sunken' : ''}\n ${error || inputError ? 'border-error-500' : ''}\n `}\n onClick={() => inputRef.current?.focus()}\n >\n {/* Selected recipients */}\n {recipients.map((recipient) => (\n <div\n key={recipient.id}\n className=\"flex items-center gap-1.5 px-2 py-1 bg-surface-elevated border border-border-subtle rounded-full text-sm\"\n >\n {getRecipientIcon(recipient.type)}\n <span className=\"text-text-primary max-w-[200px] truncate\">\n {recipient.displayName}\n </span>\n {!disabled && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n removeRecipient(recipient.id);\n }}\n className=\"p-0.5 hover:bg-surface-hover rounded-full transition-colors\"\n aria-label={tr('notifCommon.removeRecipient', 'Remove {{name}}').replace(\n '{{name}}',\n recipient.displayName\n )}\n >\n <X size={12} className=\"text-text-secondary\" />\n </button>\n )}\n </div>\n ))}\n\n {/* Input */}\n {!disabled && recipients.length < maxRecipients && (\n <input\n ref={inputRef}\n type={inputType}\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n onKeyDown={handleKeyDown}\n onPaste={handlePaste}\n onFocus={() => setIsFocused(true)}\n onBlur={() => {\n setIsFocused(false);\n if (inputValue.trim()) {\n addRecipient(inputValue);\n }\n }}\n placeholder={\n recipients.length === 0 ? inputPlaceholder : tr('notifCommon.addMore', 'Add more...')\n }\n className=\"flex-1 min-w-[150px] bg-transparent border-none outline-none text-sm text-text-primary placeholder:text-text-secondary\"\n disabled={disabled}\n />\n )}\n\n {/* Add button for clarity */}\n {!disabled && inputValue.trim() && (\n <button\n type=\"button\"\n onClick={() => addRecipient(inputValue)}\n className=\"p-1 text-primary-500 hover:bg-primary-100 rounded transition-colors\"\n aria-label={tr('notifCommon.addRecipient', 'Add recipient')}\n >\n <Plus size={16} />\n </button>\n )}\n </div>\n\n {/* Error message */}\n {(error || inputError) && (\n <div className=\"flex items-center gap-1.5 text-error-500 text-sm\">\n <AlertCircle size={14} />\n <span>{error || inputError}</span>\n </div>\n )}\n\n {/* Helper text */}\n <div className=\"flex items-center justify-between text-xs text-text-secondary\">\n <span>\n {channel === 'EMAIL' &&\n tr(\n 'notifCommon.emailHelperText',\n 'Enter email addresses. Press Enter or comma to add multiple.'\n )}\n {(channel === 'SMS' || channel === 'WHATSAPP') &&\n tr(\n 'notifCommon.phoneHelperText',\n 'Enter phone numbers with country code (e.g., +1234567890).'\n )}\n\n {channel === 'PUSH' &&\n tr('notifCommon.pushHelperText', 'Enter device tokens for push notifications.')}\n {channel === 'SLACK' && tr('notifCommon.slackHelperText', 'Enter Slack user IDs.')}\n {channel === 'TEAMS' &&\n tr('notifCommon.teamsHelperText', 'Enter Microsoft Teams user IDs.')}\n {channel === 'WEBHOOK' && tr('notifCommon.webhookHelperText', 'Enter webhook URLs.')}\n </span>\n <span>\n {recipients.length} / {maxRecipients}\n </span>\n </div>\n </div>\n );\n}\n\n/**\n * Compact recipient display for read-only views\n */\nexport function RecipientList({ recipients }: { recipients: Recipient[] }) {\n const tr = useTr();\n\n if (recipients.length === 0) {\n return (\n <span className=\"text-text-secondary text-sm\">\n {tr('notifCommon.noRecipients', 'No recipients')}\n </span>\n );\n }\n\n return (\n <div className=\"flex flex-wrap items-center gap-1.5\">\n {recipients.slice(0, 5).map((recipient) => (\n <div\n key={recipient.id}\n className=\"flex items-center gap-1 px-2 py-0.5 bg-surface-elevated border border-border-subtle rounded-full text-xs\"\n >\n {getRecipientIcon(recipient.type)}\n <span className=\"text-text-primary max-w-[150px] truncate\">{recipient.displayName}</span>\n </div>\n ))}\n {recipients.length > 5 && (\n <span className=\"flex items-center gap-1 px-2 py-0.5 bg-bg-sunken text-text-secondary rounded-full text-xs\">\n <Users size={12} />+{recipients.length - 5} {tr('notifCommon.more', 'more')}\n </span>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;AA2BA,SAASA,EAAiB,GAAyB;CACjD,QAAQC,GAAR;EACE,KAAK,SACH,OAAO,kBAACC,GAAD;GAAM,MAAM;GAAI,WAAU;EAAyB,CAAA;EAC5D,KAAK,SACH,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,EAAG,8BAA8B,6CAA6C;KAC/EY,MAAY,WAAWZ,EAAG,+BAA+B,uBAAuB;KAChFY,MAAY,WACXZ,EAAG,+BAA+B,iCAAiC;KACpEY,MAAY,aAAaZ,EAAG,iCAAiC,qBAAqB;IAC/E,EAAA,CAAA,GACN,kBAAC,QAAD,EAAA,UAAA;KACGmB,EAAW;KAAO;KAAIC;IACnB,EAAA,CAAA,CACH;;EACF;;AAET"}
@@ -0,0 +1,21 @@
1
+ export type PreviewChannel = 'email' | 'sms' | 'push' | 'in_app';
2
+ export interface TemplatePreviewProps {
3
+ channel: PreviewChannel;
4
+ subject: string;
5
+ body: string;
6
+ html: string;
7
+ appName: string;
8
+ onChannelChange: (channel: PreviewChannel) => void;
9
+ }
10
+ /**
11
+ * Template Preview Component
12
+ *
13
+ * Shows how a notification template will look across different channels.
14
+ * Templates are channel-agnostic — this component lets you preview
15
+ * the same content as it would render on Email, SMS, Push, or In-App.
16
+ *
17
+ * Uses semantic theme tokens (text-primary, bg-surface, etc.) for theme
18
+ * compatibility, with hardcoded colors only inside device mockups where
19
+ * the real device UI is always dark (iPhone SMS, Push lock screen).
20
+ */
21
+ export declare function TemplatePreview({ channel, subject, body, html, appName, onChannelChange, }: TemplatePreviewProps): import('react').JSX.Element;
@@ -2,13 +2,13 @@ import { useTr as e } from "../shared/hooks/useTr.js";
2
2
  import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
3
3
  import { Bell as a, Mail as o, MessageSquare as s, Monitor as c, Smartphone as l } from "lucide-react";
4
4
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
5
- //#region src/components/TemplatePreview.tsx
5
+ // src/components/TemplatePreview.tsx
6
6
  function f(e) {
7
7
  let a = r(null), o = r(null), [s, c] = i(1), [l, u] = i(400), d = t(() => {
8
8
  let e = a.current, t = o.current;
9
9
  if (!e || !t) return;
10
- let n = e.clientWidth;
11
- c(Math.min(1, n / 620)), requestAnimationFrame(() => {
10
+ let n = e.clientWidth, r = Math.min(1, n / 620);
11
+ c(r), requestAnimationFrame(() => {
12
12
  try {
13
13
  let e = t.contentDocument || t.contentWindow?.document;
14
14
  if (e?.body) {
@@ -419,7 +419,6 @@ function m({ channel: t, subject: n, body: r, html: i, appName: s, onChannelChan
419
419
  })]
420
420
  });
421
421
  }
422
- //#endregion
423
422
  export { m as TemplatePreview };
424
423
 
425
424
  //# sourceMappingURL=TemplatePreview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TemplatePreview.js","names":[],"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,SAAS,EAAgB,GAAc;CACrC,IAAM,IAAe,EAAuB,KAAK,EAC3C,IAAY,EAA0B,KAAK,EAC3C,CAAC,GAAO,KAAY,EAAS,EAAE,EAC/B,CAAC,GAAc,KAAmB,EAAS,IAAI,EAI/C,IAAc,QAAkB;EACpC,IAAM,IAAY,EAAa,SACzB,IAAS,EAAU;AACzB,MAAI,CAAC,KAAa,CAAC,EAAQ;EAE3B,IAAM,IAAiB,EAAU;AAKjC,EAHA,EADiB,KAAK,IAAI,GAAG,IAAiB,IAAY,CACxC,EAGlB,4BAA4B;AAC1B,OAAI;IACF,IAAM,IAAM,EAAO,mBAAmB,EAAO,eAAe;AAC5D,QAAI,GAAK,MAAM;KACb,IAAM,IAAgB,EAAI,KAAK;AAC/B,OAAgB,EAAc;;WAE1B;IAGR;IACD,EAAE,CAAC;AAqBN,QAlBA,QAAgB;EAEd,IAAM,IAAQ,WAAW,GAAa,IAAI;AAC1C,eAAa,aAAa,EAAM;IAC/B,CAAC,GAAM,EAAY,CAAC,EAGvB,QAAgB;EACd,IAAM,IAAW,IAAI,eAAe,EAAY;AAEhD,SADI,EAAa,WAAS,EAAS,QAAQ,EAAa,QAAQ,QACnD,EAAS,YAAY;IACjC,CAAC,EAAY,CAAC,EAOV;EAAE;EAAc;EAAW;EAAO;EAAc,cAJlC,QAAkB;AACrC,MAAa;KACZ,CAAC,EAAY,CAAC;EAEoD;EAAa;;AAGpF,IAAM,IAA8E;CAClF;EAAE,IAAI;EAAS,OAAO;EAAS,MAAM,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;EAAE;CACzD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AAC,OAAD;WAAK,WAAU;qBAAf,CACE,kBAAC,QAAD;YAAM,WAAU;sBACb,EAAG,gCAAgC,cAAc;YAC7C,CAAA,EACP,kBAAC,QAAD;YAAM,WAAU;sBACb,EAAG,+BAA+B,SAAS;YACvC,CAAA,CACH;cACN,kBAAC,KAAD;WAAG,WAAU;qBACV,EACC,oCACA,uCACD;WACC,CAAA,CACA;YACF;;QACF;SACF;;KACF,CAAA;IAEJ;KACF"}
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,IAA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,oCACA,sCACF;UACC,CAAA,CACA;SACF,CAAA,CAAA;;OACF;MACF,CAAA,CAAA;;IACF,CAAA;GAEJ;EACF,CAAA,CAAA;;AAET"}
@@ -0,0 +1,11 @@
1
+ interface VariableInserterProps {
2
+ variables: Record<string, unknown>;
3
+ onInsert: (variable: string) => void;
4
+ className?: string;
5
+ }
6
+ /**
7
+ * Variable Inserter Component
8
+ * Dropdown to insert template variables
9
+ */
10
+ export declare function VariableInserter({ variables, onInsert, className }: VariableInserterProps): import('react').JSX.Element;
11
+ export {};
@@ -0,0 +1,3 @@
1
+ export { NotificationBell } from './NotificationBell';
2
+ export { NotificationCard } from './NotificationCard';
3
+ export { NotificationPanel } from './NotificationPanel';
@@ -1,3 +1,4 @@
1
- import "./NotificationCard.js";
2
- import "./NotificationBell.js";
3
- import "./NotificationPanel.js";
1
+ import { NotificationBell as e } from "./NotificationBell.js";
2
+ import { NotificationCard as t } from "./NotificationCard.js";
3
+ import { NotificationPanel as n } from "./NotificationPanel.js";
4
+ export { e as NotificationBell, t as NotificationCard, n as NotificationPanel };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Notification Permission Constants
3
+ *
4
+ * All permission strings for Notification resources.
5
+ * Use with fe-libs usePermissions hook: hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST)
6
+ *
7
+ * Resource types:
8
+ * - notification: list, read, create, update, delete, send
9
+ * - notification-template: list, create, update, delete
10
+ */
11
+ export declare const NOTIFICATION_PERMISSIONS: {
12
+ readonly NOTIFICATION_LIST: "notification:list";
13
+ readonly NOTIFICATION_READ: "notification:read";
14
+ readonly NOTIFICATION_CREATE: "notification:create";
15
+ readonly NOTIFICATION_UPDATE: "notification:update";
16
+ readonly NOTIFICATION_DELETE: "notification:delete";
17
+ readonly NOTIFICATION_SEND: "notification:send";
18
+ readonly TEMPLATE_LIST: "notification-template:list";
19
+ readonly TEMPLATE_CREATE: "notification-template:create";
20
+ readonly TEMPLATE_UPDATE: "notification-template:update";
21
+ readonly TEMPLATE_DELETE: "notification-template:delete";
22
+ };
23
+ export type NotificationPermission = (typeof NOTIFICATION_PERMISSIONS)[keyof typeof NOTIFICATION_PERMISSIONS];
@@ -1,4 +1,4 @@
1
- //#region src/constants/permissions.ts
1
+ // src/constants/permissions.ts
2
2
  var e = {
3
3
  NOTIFICATION_LIST: "notification:list",
4
4
  NOTIFICATION_READ: "notification:read",
@@ -11,7 +11,6 @@ var e = {
11
11
  TEMPLATE_UPDATE: "notification-template:update",
12
12
  TEMPLATE_DELETE: "notification-template:delete"
13
13
  };
14
- //#endregion
15
14
  export { e as NOTIFICATION_PERMISSIONS };
16
15
 
17
16
  //# sourceMappingURL=permissions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.js","names":[],"sources":["../../src/constants/permissions.ts"],"sourcesContent":["/**\n * Notification Permission Constants\n *\n * All permission strings for Notification resources.\n * Use with fe-libs usePermissions hook: hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST)\n *\n * Resource types:\n * - notification: list, read, create, update, delete, send\n * - notification-template: list, create, update, delete\n */\n\nexport const NOTIFICATION_PERMISSIONS = {\n // Notification resources\n NOTIFICATION_LIST: 'notification:list',\n NOTIFICATION_READ: 'notification:read',\n NOTIFICATION_CREATE: 'notification:create',\n NOTIFICATION_UPDATE: 'notification:update',\n NOTIFICATION_DELETE: 'notification:delete',\n NOTIFICATION_SEND: 'notification:send',\n\n // Template resources\n TEMPLATE_LIST: 'notification-template:list',\n TEMPLATE_CREATE: 'notification-template:create',\n TEMPLATE_UPDATE: 'notification-template:update',\n TEMPLATE_DELETE: 'notification-template:delete',\n} as const;\n\nexport type NotificationPermission =\n (typeof NOTIFICATION_PERMISSIONS)[keyof typeof NOTIFICATION_PERMISSIONS];\n"],"mappings":";AAWA,IAAa,IAA2B;CAEtC,mBAAmB;CACnB,mBAAmB;CACnB,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CACrB,mBAAmB;CAGnB,eAAe;CACf,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;CAClB"}
1
+ {"version":3,"file":"permissions.js","names":["NOTIFICATION_PERMISSIONS"],"sources":["../../src/constants/permissions.ts"],"sourcesContent":["/**\n * Notification Permission Constants\n *\n * All permission strings for Notification resources.\n * Use with fe-libs usePermissions hook: hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST)\n *\n * Resource types:\n * - notification: list, read, create, update, delete, send\n * - notification-template: list, create, update, delete\n */\n\nexport const NOTIFICATION_PERMISSIONS = {\n // Notification resources\n NOTIFICATION_LIST: 'notification:list',\n NOTIFICATION_READ: 'notification:read',\n NOTIFICATION_CREATE: 'notification:create',\n NOTIFICATION_UPDATE: 'notification:update',\n NOTIFICATION_DELETE: 'notification:delete',\n NOTIFICATION_SEND: 'notification:send',\n\n // Template resources\n TEMPLATE_LIST: 'notification-template:list',\n TEMPLATE_CREATE: 'notification-template:create',\n TEMPLATE_UPDATE: 'notification-template:update',\n TEMPLATE_DELETE: 'notification-template:delete',\n} as const;\n\nexport type NotificationPermission =\n (typeof NOTIFICATION_PERMISSIONS)[keyof typeof NOTIFICATION_PERMISSIONS];\n"],"mappings":";AAWA,IAAaA,IAA2B;CAEtC,mBAAmB;CACnB,mBAAmB;CACnB,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CACrB,mBAAmB;CAGnB,eAAe;CACf,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;AACnB"}
File without changes