@openpeepshq/react 0.10.0 → 0.11.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 (277) hide show
  1. package/dist/components/RelationCapabilitiesEditor.js +3 -3
  2. package/dist/components/RoleCapabilityMatrix.js +2 -2
  3. package/dist/components/accounts/SignUpLoginModal.js +1 -1
  4. package/dist/components/configuration/ConfigurationList.js +2 -2
  5. package/dist/components/conversations/ConversationMessageBubble.js +8 -1
  6. package/dist/components/conversations/CreateNewConversation.js +34 -17
  7. package/dist/components/form/ImageEditModal.js +2 -2
  8. package/dist/components/groups/ChangeGroupRolesModal.js +1 -1
  9. package/dist/components/groups/ConfirmGroupExitModal.js +1 -1
  10. package/dist/components/groups/ConfirmMemberRemovalModal.js +1 -1
  11. package/dist/components/groups/DeleteGroupModal.js +1 -1
  12. package/dist/components/groups/GroupForm.js +2 -2
  13. package/dist/components/groups/GroupNotificationSettingsModal.js +2 -2
  14. package/dist/components/jams/JamCallParticipant.js +4 -3
  15. package/dist/components/jams/JamGuestForm.js +1 -1
  16. package/dist/components/jams/jamEventActions.d.ts +10 -0
  17. package/dist/components/jams/jamEventActions.js +13 -0
  18. package/dist/components/navigation/ContentHeader.js +1 -1
  19. package/dist/components/navigation/FooterMobile.js +1 -1
  20. package/dist/components/navigation/SideBar.js +1 -1
  21. package/dist/components/post/FullPostLayout.js +1 -1
  22. package/dist/components/post/index.d.ts +1 -0
  23. package/dist/components/post/index.js +1 -0
  24. package/dist/components/post/pieces/EventRsvpList.js +1 -1
  25. package/dist/components/post/pieces/EventRsvpScopeDialog.js +2 -2
  26. package/dist/components/post/pieces/EventWaitlistJoinDialog.js +1 -1
  27. package/dist/components/post/pieces/GalleryModal.js +1 -1
  28. package/dist/components/post/pieces/modals/DeletePostModal.js +2 -2
  29. package/dist/components/post/post-form/ComposeAttachments.d.ts +2 -0
  30. package/dist/components/post/post-form/ComposeAttachments.js +8 -0
  31. package/dist/components/post/post-form/DescriptionEditModal.js +1 -1
  32. package/dist/components/post/post-form/EditPostModal.js +2 -2
  33. package/dist/components/post/post-form/EventForm.js +4 -26
  34. package/dist/components/post/post-form/PostAudienceSelector.js +2 -2
  35. package/dist/components/post/post-form/ReplyModal.js +1 -1
  36. package/dist/components/post/types/event/FullEvent.js +3 -3
  37. package/dist/components/post/types/resource/FullResource.js +2 -1
  38. package/dist/components/preview-link/RemotePreviewLink.js +32 -4
  39. package/dist/components/preview-link/RemotePreviewLink.test.d.ts +1 -0
  40. package/dist/components/preview-link/RemotePreviewLink.test.js +118 -0
  41. package/dist/components/profile/ProfileActivitySummary.js +4 -4
  42. package/dist/components/profile/ProfileBadge.js +1 -1
  43. package/dist/components/profile/ProfilePageAction.js +1 -1
  44. package/dist/components/profile/ProfilePostsAndReplies.js +1 -1
  45. package/dist/components/profile/ProfileSelector.js +1 -1
  46. package/dist/components/profile/ReportProfileOrPostModal.js +4 -2
  47. package/dist/components/resources/CategoryPathPicker.js +1 -1
  48. package/dist/components/resources/ResourceCard.js +5 -3
  49. package/dist/components/resources/ResourceLibrary.js +61 -8
  50. package/dist/components/resources/ResourceLibrary.test.d.ts +1 -0
  51. package/dist/components/resources/ResourceLibrary.test.js +122 -0
  52. package/dist/components/server-data/context.d.ts +24 -16
  53. package/dist/contexts/openpeeps/hooks/admin.d.ts +2 -2
  54. package/dist/contexts/openpeeps/hooks/auth.d.ts +1 -1
  55. package/dist/contexts/router/index.d.ts +8 -0
  56. package/dist/contexts/router/index.js +27 -2
  57. package/dist/hooks/conversations/dmMessage.d.ts +15 -0
  58. package/dist/hooks/conversations/dmMessage.js +12 -0
  59. package/dist/hooks/conversations/useCreateConversation.d.ts +40 -0
  60. package/dist/hooks/conversations/useCreateConversation.js +6 -0
  61. package/dist/hooks/events/useEventForm.d.ts +3 -0
  62. package/dist/hooks/events/useEventForm.js +31 -2
  63. package/dist/hooks/events/useEventForm.test.d.ts +1 -0
  64. package/dist/hooks/events/useEventForm.test.js +107 -0
  65. package/dist/hooks/index.d.ts +3 -1
  66. package/dist/hooks/index.js +3 -1
  67. package/dist/hooks/posts/useFeedPostActions.js +4 -15
  68. package/dist/hooks/posts/usePostReactionToggle.d.ts +14 -0
  69. package/dist/hooks/posts/usePostReactionToggle.js +46 -0
  70. package/dist/hooks/resources/useResourceLibrary.d.ts +8 -1
  71. package/dist/hooks/resources/useResourceLibrary.js +5 -5
  72. package/dist/hooks/settings/useAccessTokens.d.ts +3 -3
  73. package/dist/hooks/settings/useAccessTokens.js +1 -0
  74. package/dist/hooks/settings/useNotificationPreferences.d.ts +1 -0
  75. package/dist/hooks/settings/useNotificationPreferences.js +7 -2
  76. package/dist/lib/downloadUrl.d.ts +6 -0
  77. package/dist/lib/downloadUrl.js +6 -0
  78. package/dist/navigation/menuItems.js +4 -4
  79. package/dist/pages/Explore.js +1 -1
  80. package/dist/pages/admin/ApiKeys.js +17 -9
  81. package/dist/pages/admin/ConfigEditor.js +1 -1
  82. package/dist/pages/admin/ConfigurationCommunityFeed.js +2 -2
  83. package/dist/pages/admin/ConfigurationCommunityLanguage.js +2 -2
  84. package/dist/pages/admin/ConfigurationCommunityTimezone.js +2 -2
  85. package/dist/pages/admin/ConfigurationEmail.js +4 -4
  86. package/dist/pages/admin/ConfigurationI18n.js +1 -1
  87. package/dist/pages/admin/ConfigurationSso.js +2 -2
  88. package/dist/pages/admin/ConfigurationSsoNew.js +1 -1
  89. package/dist/pages/admin/Dashboard.js +1 -1
  90. package/dist/pages/admin/Db.js +4 -4
  91. package/dist/pages/admin/DiagnosticsEmail.js +3 -3
  92. package/dist/pages/admin/DiagnosticsJob.js +2 -2
  93. package/dist/pages/admin/DiagnosticsLivekit.js +1 -1
  94. package/dist/pages/admin/DiagnosticsLogs.js +2 -2
  95. package/dist/pages/admin/DiagnosticsPerformance.js +1 -1
  96. package/dist/pages/admin/GroupMembers.js +5 -5
  97. package/dist/pages/admin/Groups.js +2 -2
  98. package/dist/pages/admin/Invites.js +3 -3
  99. package/dist/pages/admin/Media.js +2 -2
  100. package/dist/pages/admin/MemberDetail.js +7 -7
  101. package/dist/pages/admin/Members.js +2 -2
  102. package/dist/pages/admin/analytics/AnalyticsLayout.js +3 -1
  103. package/dist/pages/admin/analytics/Content.js +1 -1
  104. package/dist/pages/admin/analytics/Engagement.js +1 -1
  105. package/dist/pages/admin/analytics/Groups.js +1 -1
  106. package/dist/pages/admin/analytics/ReportSettings.js +1 -1
  107. package/dist/pages/admin/community/CommunityAccess.js +1 -1
  108. package/dist/pages/admin/community/CommunityFavicons.js +1 -1
  109. package/dist/pages/admin/community/CommunityForbiddenUsernames.js +2 -2
  110. package/dist/pages/admin/community/CommunityInfo.js +1 -1
  111. package/dist/pages/admin/community/CommunityLinks.js +1 -1
  112. package/dist/pages/admin/community/CommunityMarkdownPage.js +1 -1
  113. package/dist/pages/admin/community/CommunityProfileFields.js +2 -2
  114. package/dist/pages/admin/community/CommunityRoles.js +7 -7
  115. package/dist/pages/admin/community/CommunityTheme.js +3 -2
  116. package/dist/pages/admin/community/ThemeColorPreview.d.ts +8 -0
  117. package/dist/pages/admin/community/ThemeColorPreview.js +46 -0
  118. package/dist/pages/admin/community/ThemeColorPreview.test.d.ts +1 -0
  119. package/dist/pages/admin/community/ThemeColorPreview.test.js +49 -0
  120. package/dist/pages/admin/components/AdminGroupCard.js +1 -1
  121. package/dist/pages/admin/components/EditInviteLinkModal.js +1 -1
  122. package/dist/pages/admin/components/InviteWithEmailModal.js +2 -2
  123. package/dist/pages/admin/components/InviteWithLinkModal.js +3 -3
  124. package/dist/pages/admin/components/ProfileRowActions.js +4 -4
  125. package/dist/pages/admin/components/RestoreBackupModal.js +2 -2
  126. package/dist/pages/admin/components/RestoreTestBackupModal.js +1 -1
  127. package/dist/pages/auth/Login.js +1 -1
  128. package/dist/pages/auth/Register.js +3 -3
  129. package/dist/pages/auth/RequestResetPassword.js +2 -2
  130. package/dist/pages/conversations/Info.js +1 -1
  131. package/dist/pages/conversations/Show.js +45 -15
  132. package/dist/pages/events/Index.js +1 -1
  133. package/dist/pages/feeds/Bookmarks.js +1 -1
  134. package/dist/pages/groups/EditInfo.js +1 -1
  135. package/dist/pages/groups/EditRoles.js +1 -1
  136. package/dist/pages/groups/Index.js +1 -1
  137. package/dist/pages/groups/Members.js +2 -2
  138. package/dist/pages/groups/New.js +1 -1
  139. package/dist/pages/groups/Show.js +2 -2
  140. package/dist/pages/settings/AccessTokens.js +4 -4
  141. package/dist/pages/settings/Account.js +1 -1
  142. package/dist/pages/settings/Feed.js +1 -1
  143. package/dist/pages/settings/Language.js +1 -1
  144. package/dist/pages/settings/NotificationPreferences.js +7 -3
  145. package/dist/pages/settings/NotificationPreferences.test.d.ts +1 -0
  146. package/dist/pages/settings/NotificationPreferences.test.js +119 -0
  147. package/dist/pages/settings/PublicProfile.js +3 -3
  148. package/dist/pages/settings/PushEnabledDevices.js +1 -1
  149. package/dist/pages/settings/Theme.js +1 -1
  150. package/dist/pages/settings/Timezone.js +1 -1
  151. package/dist/react-native.d.ts +1 -1
  152. package/dist/react-native.js +1 -1
  153. package/package.json +9 -9
  154. package/src/components/RelationCapabilitiesEditor.tsx +3 -3
  155. package/src/components/RoleCapabilityMatrix.tsx +2 -2
  156. package/src/components/accounts/SignUpLoginModal.tsx +1 -1
  157. package/src/components/configuration/ConfigurationList.tsx +2 -2
  158. package/src/components/conversations/ConversationMessageBubble.tsx +24 -0
  159. package/src/components/conversations/CreateNewConversation.tsx +114 -78
  160. package/src/components/form/ImageEditModal.tsx +2 -2
  161. package/src/components/groups/ChangeGroupRolesModal.tsx +1 -1
  162. package/src/components/groups/ConfirmGroupExitModal.tsx +1 -1
  163. package/src/components/groups/ConfirmMemberRemovalModal.tsx +2 -2
  164. package/src/components/groups/DeleteGroupModal.tsx +2 -2
  165. package/src/components/groups/GroupForm.tsx +2 -2
  166. package/src/components/groups/GroupNotificationSettingsModal.tsx +2 -2
  167. package/src/components/jams/JamCallParticipant.tsx +4 -3
  168. package/src/components/jams/JamGuestForm.tsx +1 -1
  169. package/src/components/jams/jamEventActions.ts +21 -0
  170. package/src/components/navigation/ContentHeader.tsx +3 -3
  171. package/src/components/navigation/FooterMobile.tsx +1 -1
  172. package/src/components/navigation/SideBar.tsx +3 -3
  173. package/src/components/post/FullPostLayout.tsx +1 -1
  174. package/src/components/post/index.ts +1 -0
  175. package/src/components/post/pieces/EventRsvpList.tsx +1 -1
  176. package/src/components/post/pieces/EventRsvpScopeDialog.tsx +2 -2
  177. package/src/components/post/pieces/EventWaitlistJoinDialog.tsx +1 -1
  178. package/src/components/post/pieces/GalleryModal.tsx +1 -1
  179. package/src/components/post/pieces/modals/DeletePostModal.tsx +2 -2
  180. package/src/components/post/post-form/ComposeAttachments.tsx +10 -0
  181. package/src/components/post/post-form/DescriptionEditModal.tsx +1 -1
  182. package/src/components/post/post-form/EditPostModal.tsx +2 -2
  183. package/src/components/post/post-form/EventForm.tsx +10 -28
  184. package/src/components/post/post-form/PostAudienceSelector.tsx +2 -2
  185. package/src/components/post/post-form/ReplyModal.tsx +1 -1
  186. package/src/components/post/types/event/FullEvent.tsx +3 -3
  187. package/src/components/post/types/resource/FullResource.tsx +2 -1
  188. package/src/components/preview-link/RemotePreviewLink.tsx +92 -25
  189. package/src/components/profile/ProfileActivitySummary.tsx +4 -4
  190. package/src/components/profile/ProfileBadge.tsx +1 -1
  191. package/src/components/profile/ProfilePageAction.tsx +1 -1
  192. package/src/components/profile/ProfilePostsAndReplies.tsx +2 -2
  193. package/src/components/profile/ProfileSelector.tsx +1 -1
  194. package/src/components/profile/ReportProfileOrPostModal.tsx +4 -2
  195. package/src/components/resources/CategoryPathPicker.tsx +1 -1
  196. package/src/components/resources/ResourceCard.tsx +5 -3
  197. package/src/components/resources/ResourceLibrary.tsx +79 -4
  198. package/src/contexts/router/index.tsx +40 -1
  199. package/src/hooks/conversations/dmMessage.ts +26 -0
  200. package/src/hooks/conversations/useCreateConversation.ts +7 -0
  201. package/src/hooks/events/useEventForm.ts +32 -1
  202. package/src/hooks/index.ts +10 -1
  203. package/src/hooks/posts/useFeedPostActions.ts +4 -18
  204. package/src/hooks/posts/usePostReactionToggle.ts +60 -0
  205. package/src/hooks/resources/useResourceLibrary.ts +20 -5
  206. package/src/hooks/settings/useAccessTokens.ts +1 -0
  207. package/src/hooks/settings/useNotificationPreferences.ts +12 -1
  208. package/src/lib/downloadUrl.ts +7 -0
  209. package/src/navigation/menuItems.ts +4 -4
  210. package/src/pages/Explore.tsx +4 -4
  211. package/src/pages/admin/ApiKeys.tsx +24 -13
  212. package/src/pages/admin/ConfigEditor.tsx +1 -1
  213. package/src/pages/admin/ConfigurationCommunityFeed.tsx +2 -2
  214. package/src/pages/admin/ConfigurationCommunityLanguage.tsx +2 -2
  215. package/src/pages/admin/ConfigurationCommunityTimezone.tsx +2 -2
  216. package/src/pages/admin/ConfigurationEmail.tsx +4 -4
  217. package/src/pages/admin/ConfigurationI18n.tsx +1 -1
  218. package/src/pages/admin/ConfigurationSso.tsx +3 -2
  219. package/src/pages/admin/ConfigurationSsoNew.tsx +1 -1
  220. package/src/pages/admin/Dashboard.tsx +1 -1
  221. package/src/pages/admin/Db.tsx +6 -6
  222. package/src/pages/admin/DiagnosticsEmail.tsx +5 -5
  223. package/src/pages/admin/DiagnosticsJob.tsx +2 -2
  224. package/src/pages/admin/DiagnosticsLivekit.tsx +3 -3
  225. package/src/pages/admin/DiagnosticsLogs.tsx +4 -4
  226. package/src/pages/admin/DiagnosticsPerformance.tsx +1 -1
  227. package/src/pages/admin/GroupMembers.tsx +6 -6
  228. package/src/pages/admin/Groups.tsx +2 -2
  229. package/src/pages/admin/Invites.tsx +4 -4
  230. package/src/pages/admin/Media.tsx +2 -2
  231. package/src/pages/admin/MemberDetail.tsx +7 -7
  232. package/src/pages/admin/Members.tsx +2 -2
  233. package/src/pages/admin/analytics/AnalyticsLayout.tsx +5 -1
  234. package/src/pages/admin/analytics/Content.tsx +1 -1
  235. package/src/pages/admin/analytics/Engagement.tsx +1 -1
  236. package/src/pages/admin/analytics/Groups.tsx +1 -1
  237. package/src/pages/admin/analytics/ReportSettings.tsx +1 -1
  238. package/src/pages/admin/community/CommunityAccess.tsx +1 -1
  239. package/src/pages/admin/community/CommunityFavicons.tsx +1 -1
  240. package/src/pages/admin/community/CommunityForbiddenUsernames.tsx +2 -2
  241. package/src/pages/admin/community/CommunityInfo.tsx +1 -1
  242. package/src/pages/admin/community/CommunityLinks.tsx +1 -1
  243. package/src/pages/admin/community/CommunityMarkdownPage.tsx +1 -1
  244. package/src/pages/admin/community/CommunityProfileFields.tsx +5 -5
  245. package/src/pages/admin/community/CommunityRoles.tsx +9 -9
  246. package/src/pages/admin/community/CommunityTheme.tsx +26 -23
  247. package/src/pages/admin/community/ThemeColorPreview.tsx +141 -0
  248. package/src/pages/admin/components/AdminGroupCard.tsx +2 -2
  249. package/src/pages/admin/components/EditInviteLinkModal.tsx +2 -2
  250. package/src/pages/admin/components/InviteWithEmailModal.tsx +2 -2
  251. package/src/pages/admin/components/InviteWithLinkModal.tsx +3 -3
  252. package/src/pages/admin/components/ProfileRowActions.tsx +6 -6
  253. package/src/pages/admin/components/RestoreBackupModal.tsx +2 -2
  254. package/src/pages/admin/components/RestoreTestBackupModal.tsx +1 -1
  255. package/src/pages/auth/Login.tsx +1 -1
  256. package/src/pages/auth/Register.tsx +3 -3
  257. package/src/pages/auth/RequestResetPassword.tsx +2 -2
  258. package/src/pages/conversations/Info.tsx +1 -1
  259. package/src/pages/conversations/Show.tsx +94 -33
  260. package/src/pages/events/Index.tsx +1 -1
  261. package/src/pages/feeds/Bookmarks.tsx +3 -1
  262. package/src/pages/groups/EditInfo.tsx +1 -1
  263. package/src/pages/groups/EditRoles.tsx +1 -1
  264. package/src/pages/groups/Index.tsx +1 -1
  265. package/src/pages/groups/Members.tsx +2 -2
  266. package/src/pages/groups/New.tsx +1 -1
  267. package/src/pages/groups/Show.tsx +4 -4
  268. package/src/pages/settings/AccessTokens.tsx +4 -4
  269. package/src/pages/settings/Account.tsx +1 -1
  270. package/src/pages/settings/Feed.tsx +1 -1
  271. package/src/pages/settings/Language.tsx +1 -1
  272. package/src/pages/settings/NotificationPreferences.tsx +38 -12
  273. package/src/pages/settings/PublicProfile.tsx +3 -3
  274. package/src/pages/settings/PushEnabledDevices.tsx +3 -6
  275. package/src/pages/settings/Theme.tsx +1 -1
  276. package/src/pages/settings/Timezone.tsx +1 -1
  277. package/src/react-native.ts +1 -0
@@ -55,8 +55,8 @@ export function AdminDiagnosticsLogs() {
55
55
  log.namespace.toLowerCase().includes(needle));
56
56
  });
57
57
  }, [logs, textFilter, levelFilter]);
58
- return (_jsxs("div", { className: "space-y-4 p-4", children: [_jsxs("div", { className: "bg-surface-2 rounded-lg p-4", children: [_jsxs("div", { className: "mb-3 flex flex-wrap items-start justify-between gap-3", children: [_jsxs("div", { children: [_jsx("p", { className: "font-medium", children: t('diagnostics.logs.title') }), _jsx("p", { className: "text-sm opacity-80", children: t('diagnostics.logs.hint') })] }), _jsx(Button, { variant: "secondary", title: t('diagnostics.logs.refresh'), action: () => logsQuery.refetch(), children: t('diagnostics.logs.refresh') })] }), _jsxs("div", { className: "grid gap-3 md:grid-cols-3", children: [_jsxs("label", { children: [_jsx("span", { children: t('diagnostics.logs.date') }), _jsx("input", { type: "date", value: date, onChange: (e) => setDate(e.target.value), className: "op-input rounded", max: todayIsoDate() })] }), _jsxs("label", { children: [_jsx("span", { children: t('diagnostics.logs.level') }), _jsxs("select", { value: levelFilter, onChange: (e) => setLevelFilter(e.target.value), className: "op-input rounded", children: [_jsx("option", { value: "all", children: t('diagnostics.logs.allLevels') }), LOG_LEVELS.map((level) => (_jsx("option", { value: level, children: level.toUpperCase() }, level)))] })] }), _jsxs("label", { children: [_jsx("span", { children: t('diagnostics.logs.filter') }), _jsx("input", { type: "search", value: textFilter, onChange: (e) => setTextFilter(e.target.value), className: "op-input rounded", placeholder: t('diagnostics.logs.filterPlaceholder') })] })] }), _jsxs("div", { className: "mt-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-sm opacity-80", children: [_jsx("span", { children: t('diagnostics.logs.showing', {
58
+ return (_jsxs("div", { className: "space-y-4 p-4", children: [_jsxs("div", { className: "bg-surface-2 rounded-lg p-4", children: [_jsxs("div", { className: "mb-3 flex flex-wrap items-start justify-between gap-3", children: [_jsxs("div", { children: [_jsx("p", { className: "font-medium", children: t('diagnostics.logs.title') }), _jsx("p", { className: "text-sm opacity-80", children: t('diagnostics.logs.hint') })] }), _jsx(Button, { variant: "secondary", title: t('common.actions.refresh'), action: () => logsQuery.refetch(), children: t('common.actions.refresh') })] }), _jsxs("div", { className: "grid gap-3 md:grid-cols-3", children: [_jsxs("label", { children: [_jsx("span", { children: t('common.labels.date') }), _jsx("input", { type: "date", value: date, onChange: (e) => setDate(e.target.value), className: "op-input rounded", max: todayIsoDate() })] }), _jsxs("label", { children: [_jsx("span", { children: t('diagnostics.logs.level') }), _jsxs("select", { value: levelFilter, onChange: (e) => setLevelFilter(e.target.value), className: "op-input rounded", children: [_jsx("option", { value: "all", children: t('diagnostics.logs.allLevels') }), LOG_LEVELS.map((level) => (_jsx("option", { value: level, children: level.toUpperCase() }, level)))] })] }), _jsxs("label", { children: [_jsx("span", { children: t('diagnostics.logs.filter') }), _jsx("input", { type: "search", value: textFilter, onChange: (e) => setTextFilter(e.target.value), className: "op-input rounded", placeholder: t('diagnostics.logs.filterPlaceholder') })] })] }), _jsxs("div", { className: "mt-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-sm opacity-80", children: [_jsx("span", { children: t('diagnostics.logs.showing', {
59
59
  count: filtered.length,
60
60
  total: logs.length,
61
- }) }), isToday ? (_jsx("span", { className: "text-primary", children: t('diagnostics.logs.autoRefresh') })) : null] })] }), _jsx("div", { className: "border-border bg-surface overflow-hidden rounded-lg border", children: logsQuery.isPending ? (_jsx("p", { className: "p-4 text-sm opacity-70", children: t('common.form.loading') })) : logsQuery.isError ? (_jsx("p", { className: "text-error p-4 text-sm", children: t('diagnostics.logs.loadError') })) : filtered.length === 0 ? (_jsx("p", { className: "p-4 text-sm opacity-70", children: t('diagnostics.logs.empty') })) : (_jsx("div", { className: "max-h-[calc(100vh-20rem)] overflow-y-auto", children: _jsxs("table", { className: "w-full table-fixed text-sm", children: [_jsx("thead", { className: "bg-surface-2 sticky top-0 z-10 text-left", children: _jsxs("tr", { children: [_jsx("th", { className: "w-28 px-3 py-2 font-medium", children: t('diagnostics.logs.timestamp') }), _jsx("th", { className: "w-20 px-3 py-2 font-medium", children: t('diagnostics.logs.levelColumn') }), _jsx("th", { className: "w-44 px-3 py-2 font-medium", children: t('diagnostics.logs.namespaceColumn') }), _jsx("th", { className: "px-3 py-2 font-medium", children: t('diagnostics.logs.messageColumn') })] }) }), _jsx("tbody", { className: "font-mono", children: filtered.map((log, idx) => (_jsxs("tr", { className: "border-border border-t align-top", children: [_jsx("td", { className: "px-3 py-2 text-xs opacity-80", children: formatTimestamp(log.timestamp) }), _jsx("td", { className: "px-3 py-2", children: _jsx("span", { className: `inline-block rounded px-1.5 py-0.5 text-xs font-semibold uppercase ${levelClass(log.level)}`, children: log.level }) }), _jsx("td", { className: "break-all px-3 py-2 text-xs opacity-90", children: log.namespace }), _jsx("td", { className: "whitespace-pre-wrap break-words px-3 py-2", children: log.message })] }, `${log.timestamp}-${log.namespace}-${idx}`))) })] }) })) })] }));
61
+ }) }), isToday ? (_jsx("span", { className: "text-primary", children: t('diagnostics.logs.autoRefresh') })) : null] })] }), _jsx("div", { className: "border-border bg-surface overflow-hidden rounded-lg border", children: logsQuery.isPending ? (_jsx("p", { className: "p-4 text-sm opacity-70", children: t('common.states.loading') })) : logsQuery.isError ? (_jsx("p", { className: "text-error p-4 text-sm", children: t('diagnostics.logs.loadError') })) : filtered.length === 0 ? (_jsx("p", { className: "p-4 text-sm opacity-70", children: t('diagnostics.logs.empty') })) : (_jsx("div", { className: "max-h-[calc(100vh-20rem)] overflow-y-auto", children: _jsxs("table", { className: "w-full table-fixed text-sm", children: [_jsx("thead", { className: "bg-surface-2 sticky top-0 z-10 text-left", children: _jsxs("tr", { children: [_jsx("th", { className: "w-28 px-3 py-2 font-medium", children: t('diagnostics.logs.timestamp') }), _jsx("th", { className: "w-20 px-3 py-2 font-medium", children: t('diagnostics.logs.levelColumn') }), _jsx("th", { className: "w-44 px-3 py-2 font-medium", children: t('diagnostics.logs.namespaceColumn') }), _jsx("th", { className: "px-3 py-2 font-medium", children: t('diagnostics.logs.messageColumn') })] }) }), _jsx("tbody", { className: "font-mono", children: filtered.map((log, idx) => (_jsxs("tr", { className: "border-border border-t align-top", children: [_jsx("td", { className: "px-3 py-2 text-xs opacity-80", children: formatTimestamp(log.timestamp) }), _jsx("td", { className: "px-3 py-2", children: _jsx("span", { className: `inline-block rounded px-1.5 py-0.5 text-xs font-semibold uppercase ${levelClass(log.level)}`, children: log.level }) }), _jsx("td", { className: "break-all px-3 py-2 text-xs opacity-90", children: log.namespace }), _jsx("td", { className: "whitespace-pre-wrap break-words px-3 py-2", children: log.message })] }, `${log.timestamp}-${log.namespace}-${idx}`))) })] }) })) })] }));
62
62
  }
@@ -18,7 +18,7 @@ export const AdminDiagnosticsPerformance = () => {
18
18
  ? stats.dbTimingEnabled
19
19
  ? t('diagnostics.performance.on', { defaultValue: 'on' })
20
20
  : t('diagnostics.performance.off', { defaultValue: 'off' })
21
- : '—' })] }), _jsx(Button, { variant: "outline", action: () => void statsQuery.refetch(), children: t('diagnostics.performance.refresh', { defaultValue: 'Refresh' }) })] }), statsQuery.isError ? (_jsx("p", { className: "text-error text-sm", children: t('diagnostics.performance.loadError', {
21
+ : '—' })] }), _jsx(Button, { variant: "outline", action: () => void statsQuery.refetch(), children: t('common.actions.refresh', { defaultValue: 'Refresh' }) })] }), statsQuery.isError ? (_jsx("p", { className: "text-error text-sm", children: t('diagnostics.performance.loadError', {
22
22
  defaultValue: 'Could not load performance stats.',
23
23
  }) })) : null, slowRequests.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('diagnostics.performance.empty', {
24
24
  defaultValue: 'No slow requests recorded yet.',
@@ -16,8 +16,8 @@ export function AdminGroupMembers() {
16
16
  const membersQuery = openpeepsApi.useGroupMembers(groupQuery.data?.id ?? '');
17
17
  const group = groupQuery.data;
18
18
  const headerTitle = group
19
- ? `${groupName(group)} - ${t('admin.members.title', { defaultValue: 'Members' })}`
20
- : t('admin.members.title', { defaultValue: 'Members' });
19
+ ? `${groupName(group)} - ${t('common.entities.members', { defaultValue: 'Members' })}`
20
+ : t('common.entities.members', { defaultValue: 'Members' });
21
21
  useSetPageHeader(headerTitle);
22
22
  if (groupQuery.isLoading || membersQuery.isLoading) {
23
23
  return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
@@ -26,7 +26,7 @@ export function AdminGroupMembers() {
26
26
  return (_jsx("div", { className: "p-8 text-center text-2xl", children: t('groups.notFound', { defaultValue: 'Group not found' }) }));
27
27
  }
28
28
  const members = membersQuery.data ?? [];
29
- return (_jsx("div", { className: "p-4", children: _jsx("div", { className: "rounded-md border", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "bg-surface", children: _jsxs("tr", { children: [_jsx("th", { className: "p-2 text-left", children: t('admin.members.profileColumn', { defaultValue: 'Profile' }) }), _jsx("th", { className: "p-2 text-left", children: t('admin.members.handleColumn', { defaultValue: 'Handle' }) }), _jsx("th", { className: "p-2 text-left", children: t('admin.members.rolesColumn', { defaultValue: 'Roles' }) }), _jsx("th", { className: "p-2" })] }) }), _jsx("tbody", { children: members.map((m) => (_jsxs("tr", { className: "border-t", children: [_jsx("td", { className: "p-2", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Avatar, { profile: m.profile, size: 2 }), _jsx("span", { children: m.profile.displayName || `@${m.profile.handle}` })] }) }), _jsxs("td", { className: "text-muted-foreground p-2", children: ["@", m.profile.handle] }), _jsx("td", { className: "p-2 text-xs", children: (m.roles ?? [])
29
+ return (_jsx("div", { className: "p-4", children: _jsx("div", { className: "rounded-md border", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "bg-surface", children: _jsxs("tr", { children: [_jsx("th", { className: "p-2 text-left", children: t('admin.members.profileColumn', { defaultValue: 'Profile' }) }), _jsx("th", { className: "p-2 text-left", children: t('common.labels.handle', { defaultValue: 'Handle' }) }), _jsx("th", { className: "p-2 text-left", children: t('admin.members.rolesColumn', { defaultValue: 'Roles' }) }), _jsx("th", { className: "p-2" })] }) }), _jsx("tbody", { children: members.map((m) => (_jsxs("tr", { className: "border-t", children: [_jsx("td", { className: "p-2", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Avatar, { profile: m.profile, size: 2 }), _jsx("span", { children: m.profile.displayName || `@${m.profile.handle}` })] }) }), _jsxs("td", { className: "text-muted-foreground p-2", children: ["@", m.profile.handle] }), _jsx("td", { className: "p-2 text-xs", children: (m.roles ?? [])
30
30
  .map((r) => t(`groups.roles.${r}`, { defaultValue: r }))
31
31
  .join(', ') || '—' }), _jsx("td", { className: "p-2 text-right", children: _jsx(MemberRowActions, { group: group, member: m }) })] }, m.profile.id))) })] }) }) }));
32
32
  }
@@ -45,7 +45,7 @@ function MemberRowActions({ group, member, }) {
45
45
  defaultValue: 'Change Roles',
46
46
  }), text: t('groups.changeRoles.title', { defaultValue: 'Change Roles' }), action: () => setActiveModal('roles') }), _jsx(PopupMenuButton, { icon: Trash2, title: t('groups.removeMember.title', {
47
47
  defaultValue: 'Remove Member',
48
- }), text: t('groups.removeMember.confirm', { defaultValue: 'Remove' }), action: () => setActiveModal('remove'), danger: true })] }), activeModal === 'roles' ? (_jsx(ChangeGroupRolesModal, { group: group, member: member, onClose: () => setActiveModal(null) })) : null, activeModal === 'remove' ? (_jsx(RemoveMemberModal, { group: group, member: member, onClose: () => setActiveModal(null) })) : null] }));
48
+ }), text: t('common.actions.remove', { defaultValue: 'Remove' }), action: () => setActiveModal('remove'), danger: true })] }), activeModal === 'roles' ? (_jsx(ChangeGroupRolesModal, { group: group, member: member, onClose: () => setActiveModal(null) })) : null, activeModal === 'remove' ? (_jsx(RemoveMemberModal, { group: group, member: member, onClose: () => setActiveModal(null) })) : null] }));
49
49
  }
50
50
  function RemoveMemberModal({ group, member, onClose, }) {
51
51
  const t = useT();
@@ -70,7 +70,7 @@ function RemoveMemberModal({ group, member, onClose, }) {
70
70
  return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-sm", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('groups.removeMember.title', { defaultValue: 'Remove Member' }) }) }), _jsx("p", { className: "px-1 text-sm", children: t('groups.removeMember.description', {
71
71
  defaultValue: 'Are you sure you want to remove @{{handle}} from group?',
72
72
  handle: member.profile.handle,
73
- }) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(DialogActions, { cancelLabel: t('common.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('groups.removeMember.confirm', {
73
+ }) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(DialogActions, { cancelLabel: t('common.actions.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('common.actions.remove', {
74
74
  defaultValue: 'Remove',
75
75
  }), onAction: submit, actionVariant: "destructive", disabled: submitting })] }) }));
76
76
  }
@@ -19,7 +19,7 @@ export function AdminGroups() {
19
19
  defaultValue: 'Create Group',
20
20
  });
21
21
  const headerActions = useMemo(() => canCreate ? (_jsx(Button, { title: createLabel, variant: "default", action: () => navigate('/groups/new'), children: createLabel })) : undefined, [canCreate, createLabel, navigate]);
22
- useSetPageHeader(t('admin.groups.title', { defaultValue: 'Groups' }), headerActions);
22
+ useSetPageHeader(t('common.entities.groups', { defaultValue: 'Groups' }), headerActions);
23
23
  const groups = groupsQuery.data ?? [];
24
24
  const filtered = search
25
25
  ? groups.filter((g) => {
@@ -59,7 +59,7 @@ function DeleteGroupModal({ group, onClose, }) {
59
59
  return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-sm", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('admin.groups.deleteTitle', { defaultValue: 'Delete group' }) }) }), _jsx("p", { className: "px-1 text-sm", children: t('admin.groups.deleteDescription', {
60
60
  defaultValue: 'Are you sure you want to delete this group? This action cannot be undone.',
61
61
  name: groupName(group),
62
- }) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(DialogActions, { cancelLabel: t('common.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('admin.groups.delete', {
62
+ }) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(DialogActions, { cancelLabel: t('common.actions.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('admin.groups.delete', {
63
63
  defaultValue: 'Delete group',
64
64
  }), onAction: submit, actionVariant: "destructive", disabled: submitting })] }) }));
65
65
  }
@@ -26,9 +26,9 @@ export function AdminInvites() {
26
26
  defaultValue: 'Search by name or handle',
27
27
  }), value: search, onChange: (e) => setSearch(e.target.value) }) }), filtered.length === 0 ? (_jsx("div", { className: "flex w-full items-center justify-center p-4", children: _jsx("h2", { className: "text-lg", children: t('admin.invites.noInvitesFound', {
28
28
  defaultValue: 'No invites found',
29
- }) }) })) : (_jsx("div", { className: "rounded-md border", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "bg-surface", children: _jsxs("tr", { children: [_jsx("th", { className: "p-2 text-left", children: t('admin.invites.linkColumn', { defaultValue: 'Link' }) }), _jsx("th", { className: "p-2 text-left", children: t('admin.invites.createdByColumn', {
29
+ }) }) })) : (_jsx("div", { className: "rounded-md border", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "bg-surface", children: _jsxs("tr", { children: [_jsx("th", { className: "p-2 text-left", children: t('common.labels.link', { defaultValue: 'Link' }) }), _jsx("th", { className: "p-2 text-left", children: t('admin.invites.createdByColumn', {
30
30
  defaultValue: 'Created by',
31
- }) }), _jsx("th", { className: "p-2 text-left", children: t('admin.invites.groupsColumn', { defaultValue: 'Groups' }) }), _jsx("th", { className: "p-2 text-left", children: t('admin.invites.expirationDateColumn', {
31
+ }) }), _jsx("th", { className: "p-2 text-left", children: t('common.entities.groups', { defaultValue: 'Groups' }) }), _jsx("th", { className: "p-2 text-left", children: t('admin.invites.expirationDateColumn', {
32
32
  defaultValue: 'Expires',
33
33
  }) }), _jsx("th", { className: "p-2 text-left", children: t('admin.invites.usesColumn', { defaultValue: 'Uses' }) }), _jsx("th", { className: "p-2 text-left", children: t('admin.invites.statusColumn', { defaultValue: 'Status' }) }), _jsx("th", { className: "p-2" })] }) }), _jsx("tbody", { children: filtered.map((invite) => {
34
34
  const active = invite.active && new Date(invite.expiresAt) > new Date();
@@ -57,7 +57,7 @@ function InvitesTablePopup({ invite }) {
57
57
  defaultValue: 'See invited accounts',
58
58
  }), text: t('admin.invites.seeInvitedAccounts', {
59
59
  defaultValue: 'See invited accounts',
60
- }), action: () => setShowInvited(true) }), _jsx(PopupMenuButton, { icon: Pencil, title: t('admin.invites.edit', { defaultValue: 'Edit' }), text: t('admin.invites.edit', { defaultValue: 'Edit' }), action: () => setShowEdit(true) }), active ? (_jsxs(_Fragment, { children: [_jsx(PopupMenuButton, { icon: Copy, title: t('admin.invites.copyLink', {
60
+ }), action: () => setShowInvited(true) }), _jsx(PopupMenuButton, { icon: Pencil, title: t('common.actions.edit', { defaultValue: 'Edit' }), text: t('common.actions.edit', { defaultValue: 'Edit' }), action: () => setShowEdit(true) }), active ? (_jsxs(_Fragment, { children: [_jsx(PopupMenuButton, { icon: Copy, title: t('admin.invites.copyLink', {
61
61
  defaultValue: 'Copy link',
62
62
  }), text: t('admin.invites.copyLink', { defaultValue: 'Copy link' }), action: () => void navigator.clipboard.writeText(inviteUrl(invite.slug)) }), _jsx(PopupMenuButton, { icon: QrCode, title: t('admin.invites.saveAsQrCode', {
63
63
  defaultValue: 'Save as QR code',
@@ -109,7 +109,7 @@ export const AdminMedia = () => {
109
109
  inUse: files.length - unusedCount,
110
110
  }) }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [filters.map((item) => (_jsx(Button, { title: item.label, variant: filter === item.id ? 'default' : 'outline', action: () => setFilter(item.id), children: item.label }, item.id))), _jsx("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: t('admin.media.search', {
111
111
  defaultValue: 'Search by file id',
112
- }), className: "border-border bg-background min-w-48 flex-1 rounded-md border px-3 py-2 text-sm" })] }), mediaQuery.isLoading ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('admin.media.loading', { defaultValue: 'Loading…' }) })) : null, mediaQuery.isError ? (_jsx("p", { className: "text-error text-sm", children: t('admin.media.error', {
112
+ }), className: "border-border bg-background min-w-48 flex-1 rounded-md border px-3 py-2 text-sm" })] }), mediaQuery.isLoading ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) })) : null, mediaQuery.isError ? (_jsx("p", { className: "text-error text-sm", children: t('admin.media.error', {
113
113
  defaultValue: 'Could not load media files',
114
114
  }) })) : null, !mediaQuery.isLoading && !mediaQuery.isError && visible.length === 0 ? (_jsxs("div", { className: "text-muted-foreground flex flex-col items-center pt-16", children: [_jsx(Images, { size: 48 }), _jsx("p", { className: "mt-2 text-sm", children: t('admin.media.empty', { defaultValue: 'No media files' }) })] })) : null, visible.length > 0 ? (_jsx("ul", { className: "space-y-2", children: visible.map((file) => (_jsx("li", { className: "rounded-md border p-3", children: _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "break-all font-mono text-xs", children: file.storageId }), _jsxs("p", { className: "text-muted-foreground mt-1 text-sm", children: [formatBytes(file.size), " \u00B7 ", formatWhen(file.modifiedAt)] }), _jsxs("p", { className: "mt-1 text-sm", children: [_jsx("span", { className: "font-medium", children: statusLabel(file.status) }), _jsxs("span", { className: "text-muted-foreground", children: [' ', "\u00B7 ", collectionLabel(file)] })] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("a", { href: file.url, target: "_blank", rel: "noreferrer", className: "text-primary text-sm", children: t('admin.media.open', { defaultValue: 'Open' }) }), canDeleteMedia ? (_jsx(Button, { title: t('admin.media.delete', {
115
115
  defaultValue: 'Delete now',
@@ -127,7 +127,7 @@ export const AdminMedia = () => {
127
127
  })
128
128
  : t('admin.media.confirm.unused', {
129
129
  defaultValue: 'This file is unused. Deleting it now removes it from the server instead of waiting for garbage collection.',
130
- }) }), deleteError ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: deleteError })) : null, _jsx(DialogActions, { cancelLabel: t('admin.media.confirm.cancel', {
130
+ }) }), deleteError ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: deleteError })) : null, _jsx(DialogActions, { cancelLabel: t('common.actions.cancel', {
131
131
  defaultValue: 'Cancel',
132
132
  }), onCancel: () => setPending(null), actionLabel: t('admin.media.confirm.action', {
133
133
  defaultValue: 'Delete file',
@@ -11,10 +11,10 @@ export function AdminMemberDetail() {
11
11
  const { profileId = '' } = useParams();
12
12
  const summaryQuery = openpeepsApi.admin.useAdminProfileSummary(profileId);
13
13
  useSetPageHeader(summaryQuery.data?.profile
14
- ? `${summaryQuery.data.profile.displayName || summaryQuery.data.profile.handle} — ${t('admin.members.title', { defaultValue: 'Members' })}`
15
- : t('admin.members.title', { defaultValue: 'Members' }));
14
+ ? `${summaryQuery.data.profile.displayName || summaryQuery.data.profile.handle} — ${t('common.entities.members', { defaultValue: 'Members' })}`
15
+ : t('common.entities.members', { defaultValue: 'Members' }));
16
16
  if (summaryQuery.isLoading) {
17
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
17
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
18
18
  }
19
19
  if (!summaryQuery.data) {
20
20
  return (_jsx("div", { className: "p-4", children: t('admin.members.notFound', {
@@ -42,13 +42,13 @@ export function AdminMemberDetail() {
42
42
  defaultValue: 'Followers',
43
43
  }), value: data.followersCount }), _jsx(StatRow, { label: t('admin.members.following', {
44
44
  defaultValue: 'Following',
45
- }), value: data.followingCount }), _jsx(StatRow, { label: t('admin.members.posts', {
45
+ }), value: data.followingCount }), _jsx(StatRow, { label: t('common.entities.posts', {
46
46
  defaultValue: 'Posts',
47
47
  }), value: data.activity.postsCount }), _jsx(StatRow, { label: t('admin.members.replies', {
48
48
  defaultValue: 'Replies',
49
- }), value: data.activity.repliesCount }), _jsx(StatRow, { label: t('admin.members.events', {
49
+ }), value: data.activity.repliesCount }), _jsx(StatRow, { label: t('common.entities.events', {
50
50
  defaultValue: 'Events',
51
- }), value: data.activity.eventsCount }), _jsx(StatRow, { label: t('admin.members.groups', {
51
+ }), value: data.activity.eventsCount }), _jsx(StatRow, { label: t('common.entities.groups', {
52
52
  defaultValue: 'Groups',
53
53
  }), value: data.activity.groupsCount }), _jsx(StatRow, { label: t('admin.members.reports', {
54
54
  defaultValue: 'Reports',
@@ -56,7 +56,7 @@ export function AdminMemberDetail() {
56
56
  defaultValue: 'Blocked by',
57
57
  }), value: data.blockedByCount }), _jsx(StatRow, { label: t('admin.members.rsvps', {
58
58
  defaultValue: 'RSVPs',
59
- }), value: data.activity.rsvpsCount }), _jsx(StatRow, { label: t('admin.members.bookmarks', {
59
+ }), value: data.activity.rsvpsCount }), _jsx(StatRow, { label: t('common.entities.bookmarks', {
60
60
  defaultValue: 'Bookmarks',
61
61
  }), value: data.activity.bookmarksCount })] })] })] }), _jsx("div", { className: "mt-6", children: _jsx(Button, { variant: "outline", compact: true, action: () => navigate({ type: 'admin', section: 'members' }), title: t('admin.members.backToMembers', {
62
62
  defaultValue: 'Back to members',
@@ -41,7 +41,7 @@ export function AdminMembers() {
41
41
  downloadCsv(csv, 'members.csv');
42
42
  }, [client]);
43
43
  const headerActions = useMemo(() => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { variant: "outline", compact: true, action: handleDownload, children: [_jsx(DownloadIcon, { size: 16 }), t('admin.members.downloadCsv', { defaultValue: 'Download CSV' })] }), _jsx(AdminInviteActions, {})] })), [handleDownload, t]);
44
- useSetPageHeader(t('admin.members.title', { defaultValue: 'Members' }), headerActions);
44
+ useSetPageHeader(t('common.entities.members', { defaultValue: 'Members' }), headerActions);
45
45
  const sorted = useMemo(() => {
46
46
  const profiles = profilesQuery.data ?? [];
47
47
  const searched = search
@@ -66,7 +66,7 @@ export function AdminMembers() {
66
66
  defaultValue: 'No users found',
67
67
  }) }) })) : (_jsx("div", { className: "rounded-md border", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "bg-surface", children: _jsxs("tr", { children: [_jsx("th", { className: "p-2 text-left", children: t('admin.members.profileColumn', {
68
68
  defaultValue: 'Profile',
69
- }) }), _jsxs("th", { className: "cursor-pointer select-none p-2 text-left", onClick: () => toggleSort('handle'), children: [t('admin.members.handleColumn', {
69
+ }) }), _jsxs("th", { className: "cursor-pointer select-none p-2 text-left", onClick: () => toggleSort('handle'), children: [t('common.labels.handle', {
70
70
  defaultValue: 'Handle',
71
71
  }), sort.column === 'handle' &&
72
72
  (sort.direction === 'asc' ? (_jsx(ChevronUpIcon, { className: "ml-1 inline h-3 w-3" })) : (_jsx(ChevronDownIcon, { className: "ml-1 inline h-3 w-3" })))] }), _jsx("th", { className: "p-2 text-left", children: t('admin.members.rolesColumn', { defaultValue: 'Roles' }) }), _jsxs("th", { className: "cursor-pointer select-none p-2 text-left", onClick: () => toggleSort('createdAt'), children: [t('admin.members.createdColumn', {
@@ -19,6 +19,7 @@ const coreTabs = [
19
19
  to: '/admin/analytics/members',
20
20
  labelKey: 'members',
21
21
  fallback: 'Members',
22
+ i18nKey: 'common.entities.members',
22
23
  },
23
24
  {
24
25
  to: '/admin/analytics/content',
@@ -34,6 +35,7 @@ const coreTabs = [
34
35
  to: '/admin/analytics/groups',
35
36
  labelKey: 'groups',
36
37
  fallback: 'Groups',
38
+ i18nKey: 'common.entities.groups',
37
39
  },
38
40
  {
39
41
  to: '/admin/analytics/reports',
@@ -107,7 +109,7 @@ export const AnalyticsLayout = () => {
107
109
  defaultValue: 'Analytics sections',
108
110
  }), className: "border-border flex flex-wrap gap-1 border-b", children: tabs.map((tab) => (_jsx(NavLink, { to: tab.to, end: tab.end === true, className: ({ isActive }) => `-mb-px border-b-2 px-3 py-2.5 text-sm font-medium transition-colors ${isActive
109
111
  ? 'border-foreground text-foreground'
110
- : 'text-muted-foreground hover:text-foreground border-transparent'}`, children: t(`admin.analytics.tabs.${tab.labelKey}`, {
112
+ : 'text-muted-foreground hover:text-foreground border-transparent'}`, children: t(tab.i18nKey ?? `admin.analytics.tabs.${tab.labelKey}`, {
111
113
  defaultValue: tab.fallback,
112
114
  }) }, tab.to))) }), _jsx(Outlet, {})] }) }));
113
115
  };
@@ -106,7 +106,7 @@ export const AnalyticsContentPage = () => {
106
106
  {
107
107
  id: 'target',
108
108
  type: 'text',
109
- header: columnHeader(t('admin.analytics.table.link', { defaultValue: 'Link' }), info('tableLink', 'Outbound URL origin and path (query strings stripped).')),
109
+ header: columnHeader(t('common.labels.link', { defaultValue: 'Link' }), info('tableLink', 'Outbound URL origin and path (query strings stripped).')),
110
110
  render: (row) => row.target,
111
111
  },
112
112
  {
@@ -76,7 +76,7 @@ export const AnalyticsEngagementPage = () => {
76
76
  },
77
77
  {
78
78
  value: 'bookmarks',
79
- label: t('admin.analytics.metrics.bookmarks', {
79
+ label: t('common.entities.bookmarks', {
80
80
  defaultValue: 'Bookmarks',
81
81
  }),
82
82
  },
@@ -86,7 +86,7 @@ export const AnalyticsGroupsPage = () => {
86
86
  {
87
87
  id: 'members',
88
88
  type: 'text',
89
- header: columnHeader(t('admin.analytics.table.members', {
89
+ header: columnHeader(t('common.entities.members', {
90
90
  defaultValue: 'Members',
91
91
  }), info('tableMembers', 'Current total members in the group, with active members underneath (distinct post authors in the group during the range).')),
92
92
  render: (g) => (_jsxs("div", { className: "flex flex-col tabular-nums", children: [_jsx("span", { children: g.members.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-xs", children: [g.activeMembers.toLocaleString(), ' ', t('admin.analytics.table.activeShort', {
@@ -58,5 +58,5 @@ export const AnalyticsReportSettingsPage = () => {
58
58
  defaultValue: 'Recipients',
59
59
  }) }), _jsx("textarea", { className: "border-input bg-background min-h-28 w-full rounded-md border px-3 py-2 text-sm", value: recipientsText, onChange: (e) => setRecipientsText(e.target.value), placeholder: "ops@example.com" }), _jsx("span", { className: "text-muted-foreground mt-1 block text-xs", children: t('admin.analytics.reports.recipientsHelp', {
60
60
  defaultValue: 'One email per line, or comma-separated.',
61
- }) })] }), _jsxs("div", { className: "mt-4 flex items-center gap-3", children: [_jsx(Button, { type: "button", size: "sm", disabled: busy, onClick: () => void onSave(), children: t('admin.analytics.reports.save', { defaultValue: 'Save' }) }), message ? (_jsx("p", { className: "text-muted-foreground text-xs", children: message })) : null] })] }) }));
61
+ }) })] }), _jsxs("div", { className: "mt-4 flex items-center gap-3", children: [_jsx(Button, { type: "button", size: "sm", disabled: busy, onClick: () => void onSave(), children: t('common.actions.save', { defaultValue: 'Save' }) }), message ? (_jsx("p", { className: "text-muted-foreground text-xs", children: message })) : null] })] }) }));
62
62
  };
@@ -44,7 +44,7 @@ export function AdminConfigurationCommunityAccess() {
44
44
  }
45
45
  };
46
46
  if (configQuery.isLoading || !base) {
47
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
47
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
48
48
  }
49
49
  return (_jsxs("div", { className: "space-y-6 p-4", children: [_jsx("p", { className: "text-muted-foreground text-sm", children: t('configuration.community.access.description', {
50
50
  defaultValue: 'Control who can join your community and who can see it',
@@ -36,7 +36,7 @@ export function AdminConfigurationCommunityFavicons() {
36
36
  }
37
37
  };
38
38
  if (isLoading || !draft) {
39
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
39
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
40
40
  }
41
41
  return (_jsxs("div", { className: "relative mb-20 h-full w-full p-4", children: [_jsx("p", { children: t('configuration.community.favicons.title') }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4", children: t('configuration.community.favicons.description') }), _jsxs("div", { className: "mb-2 flex gap-x-6", children: [_jsxs("span", { children: [t('configuration.community.currentIcon'), ":"] }), _jsx("img", { className: "size-8", alt: t('configuration.community.icon'), src: currentIcon })] }), _jsx(Button, { variant: "outline", action: () => inputRef.current?.click(), title: t('configuration.community.upload'), children: t('configuration.community.upload') }), _jsx("input", { ref: inputRef, type: "file", accept: "image/*", className: "hidden", onChange: (e) => {
42
42
  const file = e.target.files?.[0];
@@ -80,7 +80,7 @@ export function AdminConfigurationCommunityForbiddenUsernames() {
80
80
  }
81
81
  };
82
82
  if (configQuery.isLoading) {
83
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
83
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
84
84
  }
85
85
  return (_jsxs("div", { className: "flex flex-col gap-4 p-4", "data-testid": "admin-forbidden-usernames", children: [_jsx("p", { className: "text-muted-foreground text-sm", children: t('configuration.community.forbiddenUsernames.description', {
86
86
  defaultValue: 'Block usernames your community does not allow, such as slurs or hate speech. Each entry is a full username, ignoring capitalization. Built-in usernames stay reserved and cannot be removed.',
@@ -102,5 +102,5 @@ export function AdminConfigurationCommunityForbiddenUsernames() {
102
102
  defaultValue: 'Add username',
103
103
  }), action: addUsername, "data-testid": "admin-forbidden-usernames-add", children: t('configuration.community.forbiddenUsernames.add', {
104
104
  defaultValue: 'Add username',
105
- }) })] }), fieldError ? (_jsx("p", { className: "text-error text-sm", role: "alert", children: fieldError })) : null] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: saving || sameHandles(custom, saved), "data-testid": "admin-forbidden-usernames-save", children: t('common.form.save', { defaultValue: 'Save' }) })] }));
105
+ }) })] }), fieldError ? (_jsx("p", { className: "text-error text-sm", role: "alert", children: fieldError })) : null] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: saving || sameHandles(custom, saved), "data-testid": "admin-forbidden-usernames-save", children: t('common.actions.save', { defaultValue: 'Save' }) })] }));
106
106
  }
@@ -29,7 +29,7 @@ export function AdminConfigurationCommunityInfo() {
29
29
  }
30
30
  });
31
31
  if (isLoading || !draft) {
32
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
32
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
33
33
  }
34
34
  return (_jsxs("div", { className: "p-4", children: [_jsx(Form, { ...form, children: _jsxs("form", { className: "flex flex-col gap-4", onSubmit: onSubmit, children: [_jsx(FormField, { control: form.control, name: "info.name", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.community.name') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", "data-testid": "admin-community-info-name" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "info.tagLine", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.community.tagline') }), _jsx(FormControl, { children: _jsx(Textarea, { ...field, "data-testid": "admin-community-info-tagline" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "info.contactEmail", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.community.email') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "email", value: field.value ?? '', "data-testid": "admin-community-info-email" }) }), _jsx(FormMessage, {})] })) }), _jsx(Button, { type: "submit", variant: "default", title: t('configuration.community.save'), loading: form.formState.isSubmitting, "data-testid": "admin-community-info-save", children: t('configuration.community.save') })] }) }), status ? (_jsx(Toast, { variant: status.type, testId: "admin-community-info-toast", onDismiss: () => setStatus(null), children: status.message })) : null] }));
35
35
  }
@@ -29,7 +29,7 @@ export function AdminConfigurationCommunityLinks() {
29
29
  }
30
30
  });
31
31
  if (isLoading || !draft) {
32
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
32
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
33
33
  }
34
34
  return (_jsxs("div", { className: "p-4", children: [_jsx(Form, { ...form, children: _jsxs("form", { className: "flex flex-col gap-4", onSubmit: onSubmit, children: [_jsx(FormField, { control: form.control, name: "info.privacyPolicy", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.community.privacyPolicy') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", value: field.value ?? '', "data-testid": "admin-community-links-privacy" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "info.termsAndConditions", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.community.termsAndConditions') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", value: field.value ?? '', "data-testid": "admin-community-links-terms" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "info.bugReportUrl", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.community.bugReportUrl', {
35
35
  defaultValue: 'Bug report form URL',
@@ -30,7 +30,7 @@ export function CommunityMarkdownPage({ path, titleKey, descriptionKey, }) {
30
30
  }
31
31
  };
32
32
  if (isLoading || !draft) {
33
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
33
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
34
34
  }
35
35
  return (_jsxs("div", { className: "flex flex-col gap-4 p-4", children: [_jsx(Markdown, { source: t(descriptionKey), className: "pb-2 pt-4 text-sm text-muted-foreground" }), _jsx(OpenpeepsMarkdownInput, { value: value, maxLength: 10000, rows: 18, className: "min-h-[30rem]", onChange: setContent }), _jsx(Button, { variant: "default", action: handleSubmit, title: t('configuration.community.save'), children: t('configuration.community.save') }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null] }));
36
36
  }
@@ -44,7 +44,7 @@ export function AdminConfigurationCommunityProfileFields() {
44
44
  }
45
45
  };
46
46
  if (configQuery.isLoading) {
47
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
47
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
48
48
  }
49
- return (_jsxs("div", { className: "flex flex-col gap-4 p-4", children: [_jsx("p", { className: "text-sm", children: t('configuration.profileFields.description') }), fields.map((field, index) => (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("h4", { className: "text-lg font-semibold", children: index + 1 }), _jsx(Label, { title: t('profile.form.fields.label'), children: _jsx(Input, { value: field.label, onChange: (e) => updateField(index, { label: e.target.value }) }) }), _jsx(Label, { title: t('common.form.fieldKey'), children: _jsx(Input, { value: field.key, onChange: (e) => updateField(index, { key: e.target.value }) }) })] }, index))), fields.length ? (_jsxs(Button, { variant: "outline", action: () => setFields((prev) => prev.slice(0, -1)), title: t('common.listEditor.removeTitle'), children: [_jsx(MinusSquare, { className: "mr-1 size-4" }), t('common.listEditor.removeTitle')] })) : null, _jsxs(Button, { variant: "outline", action: () => setFields((prev) => [...prev, { key: '', label: '' }]), title: t('posts.form.poll.addOption'), children: [_jsx(PlusSquare, { className: "mr-1 size-4" }), t('posts.form.poll.addOption')] }), _jsx(Button, { variant: "ghost", action: handleSubmit, title: t('common.form.save'), children: t('common.form.save') }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null] }));
49
+ return (_jsxs("div", { className: "flex flex-col gap-4 p-4", children: [_jsx("p", { className: "text-sm", children: t('configuration.profileFields.description') }), fields.map((field, index) => (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("h4", { className: "text-lg font-semibold", children: index + 1 }), _jsx(Label, { title: t('profile.form.fields.label'), children: _jsx(Input, { value: field.label, onChange: (e) => updateField(index, { label: e.target.value }) }) }), _jsx(Label, { title: t('common.form.fieldKey'), children: _jsx(Input, { value: field.key, onChange: (e) => updateField(index, { key: e.target.value }) }) })] }, index))), fields.length ? (_jsxs(Button, { variant: "outline", action: () => setFields((prev) => prev.slice(0, -1)), title: t('common.actions.remove'), children: [_jsx(MinusSquare, { className: "mr-1 size-4" }), t('common.actions.remove')] })) : null, _jsxs(Button, { variant: "outline", action: () => setFields((prev) => [...prev, { key: '', label: '' }]), title: t('posts.form.poll.addOption'), children: [_jsx(PlusSquare, { className: "mr-1 size-4" }), t('posts.form.poll.addOption')] }), _jsx(Button, { variant: "ghost", action: handleSubmit, title: t('common.actions.save'), children: t('common.actions.save') }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null] }));
50
50
  }
@@ -42,7 +42,7 @@ function DefaultRoles({ base }) {
42
42
  await handleSubmit();
43
43
  };
44
44
  const isDefault = roleOnRegistration === 'pendingmember';
45
- return (_jsxs("div", { className: "p-4", children: [_jsx("h3", { className: "text-xl font-bold", children: t('admin.configuration.community.defaultRoles.title') }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(Label, { title: t('admin.configuration.community.defaultRoles.roleOnRegistration'), description: t('admin.configuration.community.defaultRoles.roleOnRegistrationDescription'), children: _jsxs("select", { className: "op-input", value: roleOnRegistration, onChange: (e) => setRoleOnRegistration(e.target.value), children: [_jsx("option", { value: "pendingmember", children: "Pending Member" }), _jsx("option", { value: "member", children: "Member" })] }) }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { variant: "default", action: handleSubmit, title: t('common.save', { defaultValue: 'Save' }), children: t('common.save', { defaultValue: 'Save' }) }), _jsx(Button, { variant: "outline", action: handleRestoreDefaults, disabled: isDefault, title: t('common.restoreDefaults', {
45
+ return (_jsxs("div", { className: "p-4", children: [_jsx("h3", { className: "text-xl font-bold", children: t('admin.configuration.community.defaultRoles.title') }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(Label, { title: t('admin.configuration.community.defaultRoles.roleOnRegistration'), description: t('admin.configuration.community.defaultRoles.roleOnRegistrationDescription'), children: _jsxs("select", { className: "op-input", value: roleOnRegistration, onChange: (e) => setRoleOnRegistration(e.target.value), children: [_jsx("option", { value: "pendingmember", children: "Pending Member" }), _jsx("option", { value: "member", children: "Member" })] }) }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { variant: "default", action: handleSubmit, title: t('common.actions.save', { defaultValue: 'Save' }), children: t('common.actions.save', { defaultValue: 'Save' }) }), _jsx(Button, { variant: "outline", action: handleRestoreDefaults, disabled: isDefault, title: t('common.restoreDefaults', {
46
46
  defaultValue: 'Restore defaults',
47
47
  }), children: t('common.restoreDefaults', { defaultValue: 'Restore defaults' }) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null] })] }));
48
48
  }
@@ -97,22 +97,22 @@ function NewRoleForm() {
97
97
  setDescription('');
98
98
  setStatus(null);
99
99
  };
100
- return (_jsxs("div", { className: "flex flex-col gap-3", children: [open ? (_jsxs("div", { className: "flex flex-col gap-3 rounded-md border p-4", children: [_jsx(Label, { htmlFor: "new-role-name", title: t('capabilities.roles.name', {
100
+ return (_jsxs("div", { className: "flex flex-col gap-3", children: [open ? (_jsxs("div", { className: "flex flex-col gap-3 rounded-md border p-4", children: [_jsx(Label, { htmlFor: "new-role-name", title: t('common.labels.name', {
101
101
  defaultValue: 'Name',
102
- }), required: true, children: _jsx(Input, { id: "new-role-name", value: name, maxLength: 32, placeholder: t('capabilities.roles.name', {
102
+ }), required: true, children: _jsx(Input, { id: "new-role-name", value: name, maxLength: 32, placeholder: t('common.labels.name', {
103
103
  defaultValue: 'Name',
104
104
  }), onChange: (e) => {
105
105
  setName(e.target.value);
106
106
  setStatus(null);
107
- } }) }), key ? (_jsxs("p", { className: "text-muted-foreground text-xs", children: [t('capabilities.roles.key', { defaultValue: 'Key' }), ":", ' ', _jsx("code", { children: key })] })) : null, _jsx(Label, { htmlFor: "new-role-description", title: t('capabilities.roles.description', {
107
+ } }) }), key ? (_jsxs("p", { className: "text-muted-foreground text-xs", children: [t('capabilities.roles.key', { defaultValue: 'Key' }), ":", ' ', _jsx("code", { children: key })] })) : null, _jsx(Label, { htmlFor: "new-role-description", title: t('common.labels.description', {
108
108
  defaultValue: 'Description',
109
- }), children: _jsx(Input, { id: "new-role-description", value: description, onChange: (e) => setDescription(e.target.value) }) }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { variant: "default", disabled: !key || creating, action: handleCreate, title: t('capabilities.roles.create', { defaultValue: 'Create' }), loadingContent: t('capabilities.roles.creating', {
109
+ }), children: _jsx(Input, { id: "new-role-description", value: description, onChange: (e) => setDescription(e.target.value) }) }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { variant: "default", disabled: !key || creating, action: handleCreate, title: t('common.actions.create', { defaultValue: 'Create' }), loadingContent: t('capabilities.roles.creating', {
110
110
  defaultValue: 'Creating…',
111
111
  }), children: creating
112
112
  ? t('capabilities.roles.creating', {
113
113
  defaultValue: 'Creating…',
114
114
  })
115
- : t('capabilities.roles.create', { defaultValue: 'Create' }) }), _jsx(Button, { variant: "outline", action: handleCancel, children: t('common.cancel', { defaultValue: 'Cancel' }) })] })] })) : (_jsx(Button, { variant: "outline", action: () => setOpen(true), title: t('capabilities.roles.newRole', { defaultValue: 'New role' }), children: t('capabilities.roles.newRole', { defaultValue: 'New role' }) })), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null] }));
115
+ : t('common.actions.create', { defaultValue: 'Create' }) }), _jsx(Button, { variant: "outline", action: handleCancel, children: t('common.actions.cancel', { defaultValue: 'Cancel' }) })] })] })) : (_jsx(Button, { variant: "outline", action: () => setOpen(true), title: t('capabilities.roles.newRole', { defaultValue: 'New role' }), children: t('capabilities.roles.newRole', { defaultValue: 'New role' }) })), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null] }));
116
116
  }
117
117
  export function AdminConfigurationCommunityRoles() {
118
118
  const t = useT();
@@ -128,7 +128,7 @@ export function AdminConfigurationCommunityRoles() {
128
128
  const loading = configQuery.isLoading || rolesQuery.isLoading || !base || !rolesQuery.data;
129
129
  const [activeTab, setActiveTab] = useState(TAB_DEFAULT_ROLE);
130
130
  if (loading) {
131
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
131
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
132
132
  }
133
133
  const tabs = [
134
134
  {
@@ -3,6 +3,7 @@ import { useEffect, useState } from 'react';
3
3
  import { useT, useSetPageHeader, useOpenpeeps, equal } from '../../../index.js';
4
4
  import { Button, ThemeFontSelect, Toast } from '@openpeepshq/react-ui';
5
5
  import { useCommunityConfig } from './useCommunityConfig.js';
6
+ import { ThemeColorPreview } from './ThemeColorPreview.js';
6
7
  export function AdminConfigurationCommunityTheme() {
7
8
  const t = useT();
8
9
  const { openpeepsApi } = useOpenpeeps();
@@ -40,7 +41,7 @@ export function AdminConfigurationCommunityTheme() {
40
41
  }
41
42
  };
42
43
  if (isLoading || !cfg) {
43
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
44
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
44
45
  }
45
46
  const fileInput = (onChange, label, preview, previewClass = 'h-[400px] w-full bg-contain bg-center bg-no-repeat') => (_jsxs("div", { children: [_jsx("div", { className: previewClass, style: preview ? { backgroundImage: `url(${preview})` } : undefined }), _jsxs("label", { className: "border-primary mt-2 flex cursor-pointer items-center justify-center rounded border-2 border-dashed p-4 text-sm", children: [label, _jsx("input", { type: "file", accept: "image/*", className: "hidden", onChange: (e) => {
46
47
  const file = e.target.files?.[0];
@@ -51,6 +52,6 @@ export function AdminConfigurationCommunityTheme() {
51
52
  return (_jsxs("div", { className: "flex flex-col gap-4 p-4", children: [_jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.theme.title') }), _jsx("span", { children: t('configuration.community.themeDescription') }), _jsx("div", { className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-2", children: [
52
53
  ['OpenpeepsLight', 'configuration.community.lightTheme.mode'],
53
54
  ['OpenpeepsDark', 'configuration.community.darkTheme.mode'],
54
- ].map(([base, labelKey]) => (_jsxs("label", { className: "flex items-center gap-2", children: [_jsx("input", { type: "radio", className: "h-4 w-4", checked: cfg.theme.base === base, onChange: () => patch((c) => (c.theme.base = base)) }), _jsx("span", { children: t(labelKey) })] }, base))) })] }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.color') }), _jsx("span", { children: t('configuration.community.colorDescription') }), _jsx("div", { className: "mt-2 flex gap-x-4", children: ['light', 'dark'].map((mode) => (_jsxs("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2", children: [_jsx("span", { className: "mr-4", children: t(`configuration.community.${mode}Theme.color`) }), _jsx("input", { className: "border-border !size-8 !rounded-full border [&::-moz-color-swatch]:!m-0 [&::-moz-color-swatch]:!rounded-full [&::-moz-color-swatch]:!border-0 [&::-webkit-color-swatch-wrapper]:!p-0 [&::-webkit-color-swatch]:!rounded-full [&::-webkit-color-swatch]:!border-0", type: "color", value: cfg.theme[mode].primaryHex, onChange: (e) => patch((c) => (c.theme[mode].primaryHex = e.target.value)) }), _jsx("input", { className: "op-input w-32", type: "text", value: cfg.theme[mode].primaryHex, readOnly: true, tabIndex: -1 })] }, mode))) })] }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.typographyAndRadii') }), _jsx("div", { className: "mt-2 grid gap-4 sm:grid-cols-2", children: ['light', 'dark'].map((mode) => (_jsxs("div", { className: "space-y-3", children: [_jsx("div", { className: "font-medium", children: t(`configuration.community.${mode}Theme.mode`) }), _jsxs("label", { className: "block text-sm", children: [t('configuration.community.fontFamily'), _jsx(ThemeFontSelect, { className: "op-input mt-1 w-full", "aria-label": t('configuration.community.fontFamily'), value: cfg.theme[mode].fontFamily, onChange: (fontFamily) => patch((c) => (c.theme[mode].fontFamily = fontFamily)) })] }), _jsxs("label", { className: "block text-sm", children: [t('configuration.community.buttonRadius'), _jsx("input", { className: "op-input mt-1 w-full", type: "text", placeholder: "9999px", value: cfg.theme[mode].buttonRadius ?? '', onChange: (e) => patch((c) => (c.theme[mode].buttonRadius =
55
+ ].map(([base, labelKey]) => (_jsxs("label", { className: "flex items-center gap-2", children: [_jsx("input", { type: "radio", className: "h-4 w-4", checked: cfg.theme.base === base, onChange: () => patch((c) => (c.theme.base = base)) }), _jsx("span", { children: t(labelKey) })] }, base))) })] }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.color') }), _jsx("span", { children: t('configuration.community.colorDescription') }), _jsx("div", { className: "mt-4 grid gap-6 lg:grid-cols-2", children: ['light', 'dark'].map((mode) => (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2", children: [_jsx("span", { children: t(`configuration.community.${mode}Theme.color`) }), _jsx("input", { className: "border-border !size-8 !rounded-full border [&::-moz-color-swatch]:!m-0 [&::-moz-color-swatch]:!rounded-full [&::-moz-color-swatch]:!border-0 [&::-webkit-color-swatch-wrapper]:!p-0 [&::-webkit-color-swatch]:!rounded-full [&::-webkit-color-swatch]:!border-0", type: "color", value: cfg.theme[mode].primaryHex, onChange: (e) => patch((c) => (c.theme[mode].primaryHex = e.target.value)) }), _jsx("input", { className: "op-input w-32", type: "text", value: cfg.theme[mode].primaryHex, readOnly: true, tabIndex: -1 })] }), _jsx(ThemeColorPreview, { mode: mode, primaryHex: cfg.theme[mode].primaryHex, buttonRadius: cfg.theme[mode].buttonRadius })] }, mode))) })] }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.typographyAndRadii') }), _jsx("div", { className: "mt-2 grid gap-4 sm:grid-cols-2", children: ['light', 'dark'].map((mode) => (_jsxs("div", { className: "space-y-3", children: [_jsx("div", { className: "font-medium", children: t(`configuration.community.${mode}Theme.mode`) }), _jsxs("label", { className: "block text-sm", children: [t('configuration.community.fontFamily'), _jsx(ThemeFontSelect, { className: "op-input mt-1 w-full", "aria-label": t('configuration.community.fontFamily'), value: cfg.theme[mode].fontFamily, onChange: (fontFamily) => patch((c) => (c.theme[mode].fontFamily = fontFamily)) })] }), _jsxs("label", { className: "block text-sm", children: [t('configuration.community.buttonRadius'), _jsx("input", { className: "op-input mt-1 w-full", type: "text", placeholder: "9999px", value: cfg.theme[mode].buttonRadius ?? '', onChange: (e) => patch((c) => (c.theme[mode].buttonRadius =
55
56
  e.target.value || undefined)) })] }), _jsxs("label", { className: "block text-sm", children: [t('configuration.community.radius'), _jsx("input", { className: "op-input mt-1 w-full", type: "text", placeholder: "8px", value: cfg.theme[mode].radius ?? '', onChange: (e) => patch((c) => (c.theme[mode].radius = e.target.value || undefined)) })] })] }, mode))) })] }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.authBackground') }), _jsx("span", { children: t('configuration.community.authBackgroundDescription') }), _jsx("div", { className: "flex flex-wrap gap-x-4", children: ['light', 'dark'].map((mode) => fileInput((file) => uploadInto(file, (c, url) => (c.theme[mode].backgroundAuth = url), 'configuration.community.backgroundAuth'), t(`configuration.community.${mode}Theme.uploadAuthBackground`), cfg.theme[mode].backgroundAuth)) }), _jsx("p", { className: "py-3 text-sm", children: t('configuration.community.authBackgroundRequirements') })] }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.background') }), _jsx("span", { children: t('configuration.community.backgroundDescription') }), _jsx("div", { className: "flex flex-wrap gap-x-4", children: ['light', 'dark'].map((mode) => fileInput((file) => uploadInto(file, (c, url) => (c.theme[mode].background = url), 'configuration.community.background'), t(`configuration.community.${mode}Theme.uploadBackground`), cfg.theme[mode].background)) }), _jsx("p", { className: "py-3 text-sm", children: t('configuration.community.backgroundRequirements') })] }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.logo') }), _jsx("span", { children: t('configuration.community.logoDescription') }), _jsx("div", { className: "flex flex-wrap gap-x-4", children: ['light', 'dark'].map((mode) => (_jsxs("div", { children: [_jsx("div", { className: "mb-2 flex flex-wrap gap-x-6 gap-y-2", children: _jsx("img", { className: "h-20 object-contain", alt: t('configuration.community.logo'), src: cfg.theme[mode].logoSmall ?? '/img/logo-small.png' }) }), fileInput((file) => uploadInto(file, (c, url) => (c.theme[mode].logoSmall = url), 'configuration.community.logo'), t(`configuration.community.${mode}Theme.uploadLogo`), undefined, 'hidden')] }, mode))) }), _jsx("p", { className: "py-3 text-sm", children: t('configuration.community.logoRequirements') })] }), _jsx(Button, { variant: "default", action: handleSubmit, disabled: !base || equal(base, cfg), title: t('configuration.community.save'), children: t('configuration.community.save') }), status ? (_jsx(Toast, { variant: "error", onDismiss: () => setStatus(null), children: status })) : null] }));
56
57
  }
@@ -0,0 +1,8 @@
1
+ type Mode = 'light' | 'dark';
2
+ export type ThemeColorPreviewProps = {
3
+ mode: Mode;
4
+ primaryHex: string;
5
+ buttonRadius?: string;
6
+ };
7
+ export declare const ThemeColorPreview: ({ mode, primaryHex, buttonRadius, }: ThemeColorPreviewProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,46 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Bell, Home, Newspaper } from 'lucide-react';
3
+ import { Button, contrastRatio, generateA11yOnColor, hexToTailwindRgbString, themeBackgroundHex, } from '@openpeepshq/react-ui';
4
+ import { useT } from '../../../i18n/index.js';
5
+ // 3:1 is the WCAG 1.4.11 floor for icons and controls against the page
6
+ // background (text needs 4.5:1, so the warning only covers non-text uses).
7
+ const MIN_CONTRAST = 3;
8
+ // Keeps a sentence translatable as one string: the translator places the
9
+ // token where the link belongs, and we splice the styled link in around it.
10
+ const LINK_TOKEN = '{{link}}';
11
+ const splitAroundLink = (sentence) => {
12
+ const i = sentence.indexOf(LINK_TOKEN);
13
+ return i < 0
14
+ ? { before: sentence, after: '' }
15
+ : {
16
+ before: sentence.slice(0, i),
17
+ after: sentence.slice(i + LINK_TOKEN.length),
18
+ };
19
+ };
20
+ const themeName = {
21
+ light: 'OpenpeepsLight',
22
+ dark: 'OpenpeepsDark',
23
+ };
24
+ export const ThemeColorPreview = ({ mode, primaryHex, buttonRadius, }) => {
25
+ const t = useT();
26
+ const ratio = contrastRatio(primaryHex, themeBackgroundHex[mode]);
27
+ const channels = hexToTailwindRgbString(primaryHex);
28
+ const valid = channels !== '(invalid)';
29
+ const { before: articleBefore, after: articleAfter } = splitAroundLink(t('configuration.community.preview.articleText', { link: LINK_TOKEN }));
30
+ const style = valid
31
+ ? {
32
+ '--color-primary': channels,
33
+ '--color-primary-foreground': generateA11yOnColor(primaryHex.startsWith('#') ? primaryHex : `#${primaryHex}`),
34
+ '--theme-rounded-base': buttonRadius?.trim() || '9999px',
35
+ }
36
+ : undefined;
37
+ const linkKeys = [
38
+ 'configuration.community.preview.linkGuidelines',
39
+ 'configuration.community.preview.linkEvents',
40
+ 'configuration.community.preview.linkMembers',
41
+ ];
42
+ return (_jsxs("div", { className: "flex flex-col gap-2", children: [ratio !== null && ratio < MIN_CONTRAST ? (_jsx("p", { className: "text-destructive text-sm", role: "status", children: t('configuration.community.contrastPoor', {
43
+ mode: t(`configuration.community.${mode}Theme.mode`),
44
+ ratio: ratio.toFixed(1),
45
+ }) })) : null, _jsx("div", { "aria-hidden": "true", "data-theme": themeName[mode], style: style, className: "pointer-events-none bg-background text-foreground overflow-hidden rounded-lg border", children: _jsxs("div", { className: "grid", children: [_jsxs("div", { className: "border-b p-3", children: [_jsx("p", { className: "text-muted-foreground mb-2 text-xs font-medium", children: t('configuration.community.preview.navigation') }), _jsxs("div", { className: "text-foreground/70 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm", children: [_jsx(Home, { className: "size-4" }), t('configuration.community.preview.home')] }), _jsxs("div", { className: "text-primary flex items-center gap-2 rounded-md px-2 py-1.5 text-sm font-bold", children: [_jsx(Newspaper, { className: "size-4" }), t('configuration.community.preview.feed')] }), _jsxs("div", { className: "text-foreground/70 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm", children: [_jsx(Bell, { className: "size-4" }), t('configuration.community.preview.notifications')] }), _jsx(Button, { className: "mt-3", size: "sm", variant: "default", tabIndex: -1, children: t('configuration.community.preview.join') })] }), _jsxs("div", { className: "p-3", children: [_jsx("p", { className: "text-muted-foreground mb-2 text-xs font-medium", children: t('configuration.community.preview.article') }), _jsx("p", { className: "text-sm font-semibold", children: t('configuration.community.preview.articleTitle') }), _jsxs("p", { className: "mt-1 text-sm", children: [articleBefore, _jsx("span", { className: "text-primary underline", children: t('configuration.community.preview.articleLink') }), articleAfter] }), _jsx("p", { className: "text-muted-foreground mb-1 mt-3 text-xs font-medium", children: t('configuration.community.preview.links') }), _jsx("ul", { className: "space-y-1", children: linkKeys.map((key) => (_jsx("li", { children: _jsx("span", { className: "text-primary text-sm underline", children: t(key) }) }, key))) })] })] }) })] }));
46
+ };