@openpeepshq/react 0.10.0 → 0.11.0

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 (270) 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/lib/downloadUrl.d.ts +6 -0
  75. package/dist/lib/downloadUrl.js +6 -0
  76. package/dist/navigation/menuItems.js +4 -4
  77. package/dist/pages/Explore.js +1 -1
  78. package/dist/pages/admin/ApiKeys.js +3 -3
  79. package/dist/pages/admin/ConfigEditor.js +1 -1
  80. package/dist/pages/admin/ConfigurationCommunityFeed.js +2 -2
  81. package/dist/pages/admin/ConfigurationCommunityLanguage.js +2 -2
  82. package/dist/pages/admin/ConfigurationCommunityTimezone.js +2 -2
  83. package/dist/pages/admin/ConfigurationEmail.js +2 -2
  84. package/dist/pages/admin/ConfigurationI18n.js +1 -1
  85. package/dist/pages/admin/ConfigurationSso.js +1 -1
  86. package/dist/pages/admin/ConfigurationSsoNew.js +1 -1
  87. package/dist/pages/admin/Dashboard.js +1 -1
  88. package/dist/pages/admin/Db.js +4 -4
  89. package/dist/pages/admin/DiagnosticsEmail.js +3 -3
  90. package/dist/pages/admin/DiagnosticsJob.js +2 -2
  91. package/dist/pages/admin/DiagnosticsLivekit.js +1 -1
  92. package/dist/pages/admin/DiagnosticsLogs.js +2 -2
  93. package/dist/pages/admin/DiagnosticsPerformance.js +1 -1
  94. package/dist/pages/admin/GroupMembers.js +5 -5
  95. package/dist/pages/admin/Groups.js +2 -2
  96. package/dist/pages/admin/Invites.js +3 -3
  97. package/dist/pages/admin/Media.js +2 -2
  98. package/dist/pages/admin/MemberDetail.js +7 -7
  99. package/dist/pages/admin/Members.js +2 -2
  100. package/dist/pages/admin/analytics/AnalyticsLayout.js +3 -1
  101. package/dist/pages/admin/analytics/Content.js +1 -1
  102. package/dist/pages/admin/analytics/Engagement.js +1 -1
  103. package/dist/pages/admin/analytics/Groups.js +1 -1
  104. package/dist/pages/admin/analytics/ReportSettings.js +1 -1
  105. package/dist/pages/admin/community/CommunityAccess.js +1 -1
  106. package/dist/pages/admin/community/CommunityFavicons.js +1 -1
  107. package/dist/pages/admin/community/CommunityForbiddenUsernames.js +2 -2
  108. package/dist/pages/admin/community/CommunityInfo.js +1 -1
  109. package/dist/pages/admin/community/CommunityLinks.js +1 -1
  110. package/dist/pages/admin/community/CommunityMarkdownPage.js +1 -1
  111. package/dist/pages/admin/community/CommunityProfileFields.js +2 -2
  112. package/dist/pages/admin/community/CommunityRoles.js +7 -7
  113. package/dist/pages/admin/community/CommunityTheme.js +3 -2
  114. package/dist/pages/admin/community/ThemeColorPreview.d.ts +8 -0
  115. package/dist/pages/admin/community/ThemeColorPreview.js +46 -0
  116. package/dist/pages/admin/community/ThemeColorPreview.test.d.ts +1 -0
  117. package/dist/pages/admin/community/ThemeColorPreview.test.js +49 -0
  118. package/dist/pages/admin/components/AdminGroupCard.js +1 -1
  119. package/dist/pages/admin/components/EditInviteLinkModal.js +1 -1
  120. package/dist/pages/admin/components/InviteWithEmailModal.js +2 -2
  121. package/dist/pages/admin/components/InviteWithLinkModal.js +3 -3
  122. package/dist/pages/admin/components/ProfileRowActions.js +4 -4
  123. package/dist/pages/admin/components/RestoreBackupModal.js +2 -2
  124. package/dist/pages/admin/components/RestoreTestBackupModal.js +1 -1
  125. package/dist/pages/auth/Login.js +1 -1
  126. package/dist/pages/auth/Register.js +3 -3
  127. package/dist/pages/auth/RequestResetPassword.js +1 -1
  128. package/dist/pages/conversations/Info.js +1 -1
  129. package/dist/pages/conversations/Show.js +45 -15
  130. package/dist/pages/events/Index.js +1 -1
  131. package/dist/pages/feeds/Bookmarks.js +1 -1
  132. package/dist/pages/groups/EditInfo.js +1 -1
  133. package/dist/pages/groups/EditRoles.js +1 -1
  134. package/dist/pages/groups/Index.js +1 -1
  135. package/dist/pages/groups/Members.js +2 -2
  136. package/dist/pages/groups/New.js +1 -1
  137. package/dist/pages/groups/Show.js +2 -2
  138. package/dist/pages/settings/AccessTokens.js +4 -4
  139. package/dist/pages/settings/Account.js +1 -1
  140. package/dist/pages/settings/Feed.js +1 -1
  141. package/dist/pages/settings/Language.js +1 -1
  142. package/dist/pages/settings/PublicProfile.js +3 -3
  143. package/dist/pages/settings/PushEnabledDevices.js +1 -1
  144. package/dist/pages/settings/Theme.js +1 -1
  145. package/dist/pages/settings/Timezone.js +1 -1
  146. package/dist/react-native.d.ts +1 -1
  147. package/dist/react-native.js +1 -1
  148. package/package.json +9 -9
  149. package/src/components/RelationCapabilitiesEditor.tsx +3 -3
  150. package/src/components/RoleCapabilityMatrix.tsx +2 -2
  151. package/src/components/accounts/SignUpLoginModal.tsx +1 -1
  152. package/src/components/configuration/ConfigurationList.tsx +2 -2
  153. package/src/components/conversations/ConversationMessageBubble.tsx +24 -0
  154. package/src/components/conversations/CreateNewConversation.tsx +114 -78
  155. package/src/components/form/ImageEditModal.tsx +2 -2
  156. package/src/components/groups/ChangeGroupRolesModal.tsx +1 -1
  157. package/src/components/groups/ConfirmGroupExitModal.tsx +1 -1
  158. package/src/components/groups/ConfirmMemberRemovalModal.tsx +2 -2
  159. package/src/components/groups/DeleteGroupModal.tsx +2 -2
  160. package/src/components/groups/GroupForm.tsx +2 -2
  161. package/src/components/groups/GroupNotificationSettingsModal.tsx +2 -2
  162. package/src/components/jams/JamCallParticipant.tsx +4 -3
  163. package/src/components/jams/JamGuestForm.tsx +1 -1
  164. package/src/components/jams/jamEventActions.ts +21 -0
  165. package/src/components/navigation/ContentHeader.tsx +3 -3
  166. package/src/components/navigation/FooterMobile.tsx +1 -1
  167. package/src/components/navigation/SideBar.tsx +3 -3
  168. package/src/components/post/FullPostLayout.tsx +1 -1
  169. package/src/components/post/index.ts +1 -0
  170. package/src/components/post/pieces/EventRsvpList.tsx +1 -1
  171. package/src/components/post/pieces/EventRsvpScopeDialog.tsx +2 -2
  172. package/src/components/post/pieces/EventWaitlistJoinDialog.tsx +1 -1
  173. package/src/components/post/pieces/GalleryModal.tsx +1 -1
  174. package/src/components/post/pieces/modals/DeletePostModal.tsx +2 -2
  175. package/src/components/post/post-form/ComposeAttachments.tsx +10 -0
  176. package/src/components/post/post-form/DescriptionEditModal.tsx +1 -1
  177. package/src/components/post/post-form/EditPostModal.tsx +2 -2
  178. package/src/components/post/post-form/EventForm.tsx +8 -26
  179. package/src/components/post/post-form/PostAudienceSelector.tsx +2 -2
  180. package/src/components/post/post-form/ReplyModal.tsx +1 -1
  181. package/src/components/post/types/event/FullEvent.tsx +3 -3
  182. package/src/components/post/types/resource/FullResource.tsx +2 -1
  183. package/src/components/preview-link/RemotePreviewLink.tsx +92 -25
  184. package/src/components/profile/ProfileActivitySummary.tsx +4 -4
  185. package/src/components/profile/ProfileBadge.tsx +1 -1
  186. package/src/components/profile/ProfilePageAction.tsx +1 -1
  187. package/src/components/profile/ProfilePostsAndReplies.tsx +2 -2
  188. package/src/components/profile/ProfileSelector.tsx +1 -1
  189. package/src/components/profile/ReportProfileOrPostModal.tsx +4 -2
  190. package/src/components/resources/CategoryPathPicker.tsx +1 -1
  191. package/src/components/resources/ResourceCard.tsx +5 -3
  192. package/src/components/resources/ResourceLibrary.tsx +79 -4
  193. package/src/contexts/router/index.tsx +40 -1
  194. package/src/hooks/conversations/dmMessage.ts +26 -0
  195. package/src/hooks/conversations/useCreateConversation.ts +7 -0
  196. package/src/hooks/events/useEventForm.ts +32 -1
  197. package/src/hooks/index.ts +10 -1
  198. package/src/hooks/posts/useFeedPostActions.ts +4 -18
  199. package/src/hooks/posts/usePostReactionToggle.ts +60 -0
  200. package/src/hooks/resources/useResourceLibrary.ts +20 -5
  201. package/src/hooks/settings/useAccessTokens.ts +1 -0
  202. package/src/lib/downloadUrl.ts +7 -0
  203. package/src/navigation/menuItems.ts +4 -4
  204. package/src/pages/Explore.tsx +4 -4
  205. package/src/pages/admin/ApiKeys.tsx +4 -4
  206. package/src/pages/admin/ConfigEditor.tsx +1 -1
  207. package/src/pages/admin/ConfigurationCommunityFeed.tsx +2 -2
  208. package/src/pages/admin/ConfigurationCommunityLanguage.tsx +2 -2
  209. package/src/pages/admin/ConfigurationCommunityTimezone.tsx +2 -2
  210. package/src/pages/admin/ConfigurationEmail.tsx +2 -2
  211. package/src/pages/admin/ConfigurationI18n.tsx +1 -1
  212. package/src/pages/admin/ConfigurationSso.tsx +1 -1
  213. package/src/pages/admin/ConfigurationSsoNew.tsx +1 -1
  214. package/src/pages/admin/Dashboard.tsx +1 -1
  215. package/src/pages/admin/Db.tsx +6 -6
  216. package/src/pages/admin/DiagnosticsEmail.tsx +5 -5
  217. package/src/pages/admin/DiagnosticsJob.tsx +2 -2
  218. package/src/pages/admin/DiagnosticsLivekit.tsx +3 -3
  219. package/src/pages/admin/DiagnosticsLogs.tsx +4 -4
  220. package/src/pages/admin/DiagnosticsPerformance.tsx +1 -1
  221. package/src/pages/admin/GroupMembers.tsx +6 -6
  222. package/src/pages/admin/Groups.tsx +2 -2
  223. package/src/pages/admin/Invites.tsx +4 -4
  224. package/src/pages/admin/Media.tsx +2 -2
  225. package/src/pages/admin/MemberDetail.tsx +7 -7
  226. package/src/pages/admin/Members.tsx +2 -2
  227. package/src/pages/admin/analytics/AnalyticsLayout.tsx +5 -1
  228. package/src/pages/admin/analytics/Content.tsx +1 -1
  229. package/src/pages/admin/analytics/Engagement.tsx +1 -1
  230. package/src/pages/admin/analytics/Groups.tsx +1 -1
  231. package/src/pages/admin/analytics/ReportSettings.tsx +1 -1
  232. package/src/pages/admin/community/CommunityAccess.tsx +1 -1
  233. package/src/pages/admin/community/CommunityFavicons.tsx +1 -1
  234. package/src/pages/admin/community/CommunityForbiddenUsernames.tsx +2 -2
  235. package/src/pages/admin/community/CommunityInfo.tsx +1 -1
  236. package/src/pages/admin/community/CommunityLinks.tsx +1 -1
  237. package/src/pages/admin/community/CommunityMarkdownPage.tsx +1 -1
  238. package/src/pages/admin/community/CommunityProfileFields.tsx +5 -5
  239. package/src/pages/admin/community/CommunityRoles.tsx +9 -9
  240. package/src/pages/admin/community/CommunityTheme.tsx +26 -23
  241. package/src/pages/admin/community/ThemeColorPreview.tsx +141 -0
  242. package/src/pages/admin/components/AdminGroupCard.tsx +2 -2
  243. package/src/pages/admin/components/EditInviteLinkModal.tsx +2 -2
  244. package/src/pages/admin/components/InviteWithEmailModal.tsx +2 -2
  245. package/src/pages/admin/components/InviteWithLinkModal.tsx +3 -3
  246. package/src/pages/admin/components/ProfileRowActions.tsx +6 -6
  247. package/src/pages/admin/components/RestoreBackupModal.tsx +2 -2
  248. package/src/pages/admin/components/RestoreTestBackupModal.tsx +1 -1
  249. package/src/pages/auth/Login.tsx +1 -1
  250. package/src/pages/auth/Register.tsx +3 -3
  251. package/src/pages/auth/RequestResetPassword.tsx +1 -1
  252. package/src/pages/conversations/Info.tsx +1 -1
  253. package/src/pages/conversations/Show.tsx +94 -33
  254. package/src/pages/events/Index.tsx +1 -1
  255. package/src/pages/feeds/Bookmarks.tsx +3 -1
  256. package/src/pages/groups/EditInfo.tsx +1 -1
  257. package/src/pages/groups/EditRoles.tsx +1 -1
  258. package/src/pages/groups/Index.tsx +1 -1
  259. package/src/pages/groups/Members.tsx +2 -2
  260. package/src/pages/groups/New.tsx +1 -1
  261. package/src/pages/groups/Show.tsx +4 -4
  262. package/src/pages/settings/AccessTokens.tsx +4 -4
  263. package/src/pages/settings/Account.tsx +1 -1
  264. package/src/pages/settings/Feed.tsx +1 -1
  265. package/src/pages/settings/Language.tsx +1 -1
  266. package/src/pages/settings/PublicProfile.tsx +3 -3
  267. package/src/pages/settings/PushEnabledDevices.tsx +3 -6
  268. package/src/pages/settings/Theme.tsx +1 -1
  269. package/src/pages/settings/Timezone.tsx +1 -1
  270. package/src/react-native.ts +1 -0
@@ -0,0 +1,14 @@
1
+ import type { PublicPost } from '@openpeepshq/common/types';
2
+ /**
3
+ * Reaction toggle for a single post, shared by the feed footer (via
4
+ * useFeedPostActions) and DM message bubbles.
5
+ *
6
+ * `conversations` queries are only invalidated for direct posts so a
7
+ * reaction on a feed post does not refetch every open thread.
8
+ */
9
+ export declare const usePostReactionToggle: (post: PublicPost) => {
10
+ me: import("@openpeepshq/common").ProfileWithMeta | undefined;
11
+ iReacted: boolean;
12
+ canReact: boolean;
13
+ toggleReaction: () => Promise<void>;
14
+ };
@@ -0,0 +1,46 @@
1
+ import { useContext, useMemo } from 'react';
2
+ import { QueryClientContext } from '@tanstack/react-query';
3
+ import { getPostActionAvailability } from '@openpeepshq/common';
4
+ import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
5
+ import { useAuthData, useCurrentProfile, } from '../../components/layout/IdentityContext.js';
6
+ import { useCapabilities } from '../../components/server-data/index.js';
7
+ /**
8
+ * Reaction toggle for a single post, shared by the feed footer (via
9
+ * useFeedPostActions) and DM message bubbles.
10
+ *
11
+ * `conversations` queries are only invalidated for direct posts so a
12
+ * reaction on a feed post does not refetch every open thread.
13
+ */
14
+ export const usePostReactionToggle = (post) => {
15
+ const me = useCurrentProfile();
16
+ const authData = useAuthData();
17
+ const capabilities = useCapabilities();
18
+ const queryClient = useContext(QueryClientContext);
19
+ const { openpeepsApi } = useOpenpeeps();
20
+ const reactToPost = openpeepsApi.reactToPostAction({ id: post.id });
21
+ const retractReaction = openpeepsApi.retractPostReactionAction({
22
+ id: post.id,
23
+ });
24
+ const iReacted = useMemo(() => !!post.reactions?.some((r) => r.profile.id === me?.id), [post.reactions, me?.id]);
25
+ const { canReact } = useMemo(() => getPostActionAvailability(authData, post, capabilities), [authData, post, capabilities]);
26
+ const toggleReaction = async () => {
27
+ if (iReacted) {
28
+ await retractReaction(undefined);
29
+ }
30
+ else if (canReact) {
31
+ await reactToPost({ reaction: '👍' });
32
+ }
33
+ else {
34
+ return;
35
+ }
36
+ if (post.visibility === 'direct' && queryClient) {
37
+ await queryClient.invalidateQueries({ queryKey: ['conversations'] });
38
+ }
39
+ };
40
+ return {
41
+ me,
42
+ iReacted,
43
+ canReact: canReact || iReacted,
44
+ toggleReaction,
45
+ };
46
+ };
@@ -1,4 +1,11 @@
1
- export declare const useResourceLibrary: (groupId?: string, ungrouped?: boolean) => {
1
+ import type { ResourceKind } from '@openpeepshq/common/types';
2
+ export interface ResourceLibraryInitialFilters {
3
+ kind?: ResourceKind | 'all';
4
+ tags?: string[];
5
+ search?: string;
6
+ pathPrefix?: string[];
7
+ }
8
+ export declare const useResourceLibrary: (groupId?: string, ungrouped?: boolean, initial?: ResourceLibraryInitialFilters) => {
2
9
  query: import("@tanstack/react-query").UseInfiniteQueryResult<import("@tanstack/react-query").InfiniteData<{
3
10
  id: string;
4
11
  type: "event" | "resource" | "note" | "question" | "article";
@@ -2,7 +2,7 @@ import { useMemo, useState } from 'react';
2
2
  import { categoryTreeFromPaths, normalizeResourceTags, pathStartsWith, } from '@openpeepshq/common/lib';
3
3
  import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
4
4
  import { useFeedListParams } from '../useResolvedFeedFormat.js';
5
- export const useResourceLibrary = (groupId, ungrouped) => {
5
+ export const useResourceLibrary = (groupId, ungrouped, initial = {}) => {
6
6
  const { openpeepsApi } = useOpenpeeps();
7
7
  const params = useFeedListParams({ format: 'linear' });
8
8
  const query = openpeepsApi.usePostsByType('resource', {
@@ -14,10 +14,10 @@ export const useResourceLibrary = (groupId, ungrouped) => {
14
14
  : {}),
15
15
  });
16
16
  const bookmarkedIds = openpeepsApi.useCurrentProfileBookmarkedIds();
17
- const [search, setSearch] = useState('');
18
- const [kind, setKind] = useState('all');
19
- const [selectedTags, setSelectedTags] = useState([]);
20
- const [pathPrefix, setPathPrefix] = useState([]);
17
+ const [search, setSearch] = useState(initial.search ?? '');
18
+ const [kind, setKind] = useState(initial.kind ?? 'all');
19
+ const [selectedTags, setSelectedTags] = useState(initial.tags ?? []);
20
+ const [pathPrefix, setPathPrefix] = useState(initial.pathPrefix ?? []);
21
21
  const [hierarchy, setHierarchy] = useState(false);
22
22
  const [view, setView] = useState('cards');
23
23
  const [saved, setSaved] = useState(false);
@@ -1,5 +1,5 @@
1
1
  import type { PublicAccessToken, Scope, ScopeLevel } from '@openpeepshq/common/types';
2
- export declare const ACCESS_TOKEN_RESOURCE_TYPES: readonly ["*", "posts", "profiles", "groups", "jams", "notifications", "reports", "webhooks"];
2
+ export declare const ACCESS_TOKEN_RESOURCE_TYPES: readonly ["*", "posts", "profiles", "groups", "jams", "notifications", "reports", "webhooks", "conversations"];
3
3
  export type AccessTokenResourceType = (typeof ACCESS_TOKEN_RESOURCE_TYPES)[number];
4
4
  export declare const ACCESS_TOKEN_SCOPE_LEVELS: ScopeLevel[];
5
5
  export declare const ACCESS_TOKEN_EXPIRATION_OPTIONS: readonly [{
@@ -29,7 +29,7 @@ export declare const useAccessTokens: () => {
29
29
  description?: string | undefined;
30
30
  scopes?: {
31
31
  resource: {
32
- type: "profiles" | "notifications" | "groups" | "jams" | "posts" | "self" | "*" | "db" | "reports" | "webhooks" | "analytics" | "render";
32
+ type: "profiles" | "notifications" | "groups" | "jams" | "posts" | "self" | "*" | "db" | "reports" | "webhooks" | "conversations" | "analytics" | "render";
33
33
  id?: string | undefined;
34
34
  };
35
35
  scopeLevel?: "read" | "admin" | "write" | undefined;
@@ -41,7 +41,7 @@ export declare const useAccessTokens: () => {
41
41
  description?: string | undefined;
42
42
  scopes?: {
43
43
  resource: {
44
- type: "profiles" | "notifications" | "groups" | "jams" | "posts" | "self" | "*" | "db" | "reports" | "webhooks" | "analytics" | "render";
44
+ type: "profiles" | "notifications" | "groups" | "jams" | "posts" | "self" | "*" | "db" | "reports" | "webhooks" | "conversations" | "analytics" | "render";
45
45
  id?: string | undefined;
46
46
  };
47
47
  scopeLevel?: "read" | "admin" | "write" | undefined;
@@ -10,6 +10,7 @@ export const ACCESS_TOKEN_RESOURCE_TYPES = [
10
10
  'notifications',
11
11
  'reports',
12
12
  'webhooks',
13
+ 'conversations',
13
14
  ];
14
15
  export const ACCESS_TOKEN_SCOPE_LEVELS = [
15
16
  'read',
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Appends `download=1` so the media endpoint answers with
3
+ * `Content-Disposition: attachment`. The `download` attribute on `<a>` is
4
+ * ignored for cross-origin URLs; the response header works for both.
5
+ */
6
+ export declare const asDownloadUrl: (url: string) => string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Appends `download=1` so the media endpoint answers with
3
+ * `Content-Disposition: attachment`. The `download` attribute on `<a>` is
4
+ * ignored for cross-origin URLs; the response header works for both.
5
+ */
6
+ export const asDownloadUrl = (url) => `${url}${url.includes('?') ? '&' : '?'}download=1`;
@@ -43,13 +43,13 @@ export const buildMainNavItems = (caps) => {
43
43
  items.push({
44
44
  id: 'groups',
45
45
  target: { type: 'groups' },
46
- labelKey: 'navigation.groups',
46
+ labelKey: 'common.entities.groups',
47
47
  tooltipKey: navTooltip('groups'),
48
48
  icon: 'Users',
49
49
  }, {
50
50
  id: 'events',
51
51
  target: { type: 'events' },
52
- labelKey: 'navigation.events',
52
+ labelKey: 'common.entities.events',
53
53
  tooltipKey: navTooltip('events'),
54
54
  icon: 'CalendarDays',
55
55
  }, {
@@ -73,13 +73,13 @@ export const buildMainNavItems = (caps) => {
73
73
  }, {
74
74
  id: 'members',
75
75
  target: { type: 'members' },
76
- labelKey: 'navigation.members',
76
+ labelKey: 'common.entities.members',
77
77
  tooltipKey: navTooltip('members'),
78
78
  icon: 'BookUser',
79
79
  }, {
80
80
  id: 'bookmarks',
81
81
  target: { type: 'feed', feed: 'bookmarks' },
82
- labelKey: 'navigation.bookmarks',
82
+ labelKey: 'common.entities.bookmarks',
83
83
  tooltipKey: navTooltip('bookmarks'),
84
84
  icon: 'Bookmark',
85
85
  }, {
@@ -104,7 +104,7 @@ export function Explore() {
104
104
  triggerSearch();
105
105
  }, children: [_jsx(Input, { placeholder: t('explore.enterSearchQuery', {
106
106
  defaultValue: 'Search for members, posts, groups…',
107
- }), value: searchInput, onChange: (e) => setSearchInput(e.target.value), "data-testid": "explore-search-input" }), _jsx(Button, { title: t('explore.SearchButton', { defaultValue: 'Search' }), variant: "default", action: triggerSearch, className: "px-8", children: _jsx(Search, {}) })] }), _jsxs("nav", { "aria-label": t('explore.tabs.label', { defaultValue: 'Result types' }), className: "border-border mt-4 flex flex-wrap border-b", children: [_jsx(TabButton, { active: tab === 'members', onClick: () => switchTab('members'), count: counts?.profiles, countLoading: countsLoading, children: t('explore.tabs.members', { defaultValue: 'Members' }) }), _jsx(TabButton, { active: tab === 'posts', onClick: () => switchTab('posts'), count: counts?.posts, countLoading: countsLoading, children: t('explore.tabs.posts', { defaultValue: 'Posts' }) }), _jsx(TabButton, { active: tab === 'jams', onClick: () => switchTab('jams'), count: counts?.jams, countLoading: countsLoading, children: t('explore.tabs.jams', { defaultValue: 'Jams' }) }), _jsx(TabButton, { active: tab === 'events', onClick: () => switchTab('events'), count: counts?.events, countLoading: countsLoading, children: t('explore.tabs.events', { defaultValue: 'Events' }) }), _jsx(TabButton, { active: tab === 'groups', onClick: () => switchTab('groups'), count: counts?.groups, countLoading: countsLoading, children: t('explore.tabs.groups', { defaultValue: 'Groups' }) })] }), _jsxs("div", { className: "mt-2", "data-testid": "explore-results", children: [search.length <= 2 ? (_jsx("p", { className: "text-muted-foreground p-6 text-sm", children: t('explore.startTyping', {
107
+ }), value: searchInput, onChange: (e) => setSearchInput(e.target.value), "data-testid": "explore-search-input" }), _jsx(Button, { title: t('explore.SearchButton', { defaultValue: 'Search' }), variant: "default", action: triggerSearch, className: "px-8", children: _jsx(Search, {}) })] }), _jsxs("nav", { "aria-label": t('explore.tabs.label', { defaultValue: 'Result types' }), className: "border-border mt-4 flex flex-wrap border-b", children: [_jsx(TabButton, { active: tab === 'members', onClick: () => switchTab('members'), count: counts?.profiles, countLoading: countsLoading, children: t('common.entities.members', { defaultValue: 'Members' }) }), _jsx(TabButton, { active: tab === 'posts', onClick: () => switchTab('posts'), count: counts?.posts, countLoading: countsLoading, children: t('common.entities.posts', { defaultValue: 'Posts' }) }), _jsx(TabButton, { active: tab === 'jams', onClick: () => switchTab('jams'), count: counts?.jams, countLoading: countsLoading, children: t('explore.tabs.jams', { defaultValue: 'Jams' }) }), _jsx(TabButton, { active: tab === 'events', onClick: () => switchTab('events'), count: counts?.events, countLoading: countsLoading, children: t('common.entities.events', { defaultValue: 'Events' }) }), _jsx(TabButton, { active: tab === 'groups', onClick: () => switchTab('groups'), count: counts?.groups, countLoading: countsLoading, children: t('common.entities.groups', { defaultValue: 'Groups' }) })] }), _jsxs("div", { className: "mt-2", "data-testid": "explore-results", children: [search.length <= 2 ? (_jsx("p", { className: "text-muted-foreground p-6 text-sm", children: t('explore.startTyping', {
108
108
  defaultValue: 'Type at least 3 characters to start searching.',
109
109
  }) })) : listQuery.isLoading ? (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) })) : tab === 'jams' ? (_jsx(EventSearchResults, { posts: jamItems, emptyMessage: t('explore.noJamsFound', {
110
110
  defaultValue: 'No jams found',
@@ -86,7 +86,7 @@ export const AdminApiKeys = () => {
86
86
  };
87
87
  const cardLabels = {
88
88
  expiresLabel: t('admin.apiKeys.expiresAt', { defaultValue: 'Expires at' }),
89
- neverLabel: t('admin.apiKeys.never', { defaultValue: 'Never' }),
89
+ neverLabel: t('common.states.never', { defaultValue: 'Never' }),
90
90
  revokeLabel: t('admin.apiKeys.revoke', { defaultValue: 'Revoke' }),
91
91
  revokedLabel: t('admin.apiKeys.revoked', { defaultValue: 'Revoked' }),
92
92
  noScopesLabel: t('admin.apiKeys.noScopes', { defaultValue: 'No scopes' }),
@@ -95,7 +95,7 @@ export const AdminApiKeys = () => {
95
95
  defaultValue: 'Create Service Access Token',
96
96
  }) }), _jsx("p", { className: "text-sm opacity-80", children: t('admin.apiKeys.createDescription', {
97
97
  defaultValue: 'Create a service token for integrations. Copy the token value when it is created.',
98
- }) }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "svc-name", children: t('admin.apiKeys.name', { defaultValue: 'Name' }) }), _jsx(Input, { id: "svc-name", value: form.name, onChange: (e) => setForm((f) => ({ ...f, name: e.target.value })) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "svc-description", children: t('admin.apiKeys.descriptionLabel', {
98
+ }) }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "svc-name", children: t('common.labels.name', { defaultValue: 'Name' }) }), _jsx(Input, { id: "svc-name", value: form.name, onChange: (e) => setForm((f) => ({ ...f, name: e.target.value })) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "svc-description", children: t('common.labels.description', {
99
99
  defaultValue: 'Description',
100
100
  }) }), _jsx(Input, { id: "svc-description", value: form.description ?? '', onChange: (e) => setForm((f) => ({ ...f, description: e.target.value })) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "svc-expiration", children: t('admin.apiKeys.expiration', { defaultValue: 'Expiration' }) }), _jsx("select", { id: "svc-expiration", className: "border-input bg-background w-full rounded-md border px-2 py-2 text-sm", value: form.expirationTime ?? '30d', onChange: (e) => setForm((f) => ({ ...f, expirationTime: e.target.value })), children: EXPIRATION_OPTIONS.map((option) => (_jsx("option", { value: option.value, children: t(`admin.apiKeys.expirationOptions.${option.labelKey}`, {
101
101
  defaultValue: EXPIRATION_OPTION_DEFAULTS[option.labelKey],
@@ -118,7 +118,7 @@ export const AdminApiKeys = () => {
118
118
  })), children: SERVICE_RESOURCE_TYPES.map((type) => (_jsx("option", { value: type, children: type }, type))) }), _jsx(Button, { variant: "outline", disabled: (form.scopes?.length ?? 0) === 1, action: () => setForm((f) => ({
119
119
  ...f,
120
120
  scopes: (f.scopes ?? []).filter((_, i) => i !== index),
121
- })), children: t('admin.apiKeys.removeScope', { defaultValue: 'Remove' }) })] }, index))), _jsx(Button, { variant: "outline", action: () => setForm((f) => ({
121
+ })), children: t('common.actions.remove', { defaultValue: 'Remove' }) })] }, index))), _jsx(Button, { variant: "outline", action: () => setForm((f) => ({
122
122
  ...f,
123
123
  scopes: [
124
124
  ...(f.scopes ?? []),
@@ -83,5 +83,5 @@ export function AdminConfigEditor({ title, namespace, name, }) {
83
83
  const defaultsForView = defaults !== undefined ? JSON.stringify(defaults, null, 2) : null;
84
84
  return (_jsxs("div", { className: "space-y-4 p-4", children: [_jsxs("p", { className: "text-muted-foreground text-xs", children: [namespace, ".", name] }), !schema && (_jsx("p", { className: "text-muted-foreground text-xs", children: t('admin.config.noSchema', {
85
85
  defaultValue: 'No Zod schema is registered for this slot — editing as JSON.',
86
- }) })), _jsxs("section", { className: "space-y-2", children: [_jsx("h2", { className: "text-sm font-medium", children: "Current value (JSON)" }), _jsx("textarea", { rows: 20, value: draft, spellCheck: false, className: "bg-surface w-full rounded-md border p-2 font-mono text-xs", onChange: (e) => setDraft(e.target.value) })] }), defaultsForView !== null && (_jsxs("details", { className: "space-y-2 rounded-md border p-2 text-xs", children: [_jsx("summary", { className: "cursor-pointer font-medium", children: "View server defaults" }), _jsx("pre", { className: "bg-surface overflow-x-auto whitespace-pre-wrap p-2 text-xs", children: defaultsForView })] })), status && (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })), _jsx(Button, { title: "Save", variant: "default", action: saveJson, disabled: saving, loadingContent: t('common.saving', { defaultValue: 'Saving…' }), children: t('common.save', { defaultValue: 'Save' }) })] }));
86
+ }) })), _jsxs("section", { className: "space-y-2", children: [_jsx("h2", { className: "text-sm font-medium", children: "Current value (JSON)" }), _jsx("textarea", { rows: 20, value: draft, spellCheck: false, className: "bg-surface w-full rounded-md border p-2 font-mono text-xs", onChange: (e) => setDraft(e.target.value) })] }), defaultsForView !== null && (_jsxs("details", { className: "space-y-2 rounded-md border p-2 text-xs", children: [_jsx("summary", { className: "cursor-pointer font-medium", children: "View server defaults" }), _jsx("pre", { className: "bg-surface overflow-x-auto whitespace-pre-wrap p-2 text-xs", children: defaultsForView })] })), status && (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })), _jsx(Button, { title: "Save", variant: "default", action: saveJson, disabled: saving, loadingContent: t('common.saving', { defaultValue: 'Saving…' }), children: t('common.actions.save', { defaultValue: 'Save' }) })] }));
87
87
  }
@@ -55,7 +55,7 @@ export function AdminConfigurationCommunityFeed() {
55
55
  }
56
56
  };
57
57
  if (configQuery.isLoading) {
58
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
58
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
59
59
  }
60
60
  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.feed.title', {
61
61
  defaultValue: 'Default feed layout',
@@ -65,5 +65,5 @@ export function AdminConfigurationCommunityFeed() {
65
65
  defaultValue: option === 'threaded' ? 'Threaded' : 'Linear',
66
66
  }), option === DEFAULT_FEED_FORMAT ? (_jsx("span", { className: "ml-1 text-sm opacity-60", children: t('settings.language.default', {
67
67
  defaultValue: '(default)',
68
- }) })) : null] })] }, option))) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: !hasChanges || saving, children: t('common.form.save', { defaultValue: 'Save' }) })] }));
68
+ }) })) : null] })] }, option))) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: !hasChanges || saving, children: t('common.actions.save', { defaultValue: 'Save' }) })] }));
69
69
  }
@@ -59,7 +59,7 @@ export function AdminConfigurationCommunityLanguage() {
59
59
  }
60
60
  };
61
61
  if (configQuery.isLoading) {
62
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
62
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
63
63
  }
64
64
  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.language.title', {
65
65
  defaultValue: 'Default language',
@@ -67,5 +67,5 @@ export function AdminConfigurationCommunityLanguage() {
67
67
  defaultValue: 'Choose the default language for new members.',
68
68
  }) }), _jsx("div", { className: "mt-4 flex flex-wrap items-center gap-x-4 gap-y-2", children: AVAILABLE_LANGUAGES.map((lang) => (_jsxs("label", { className: "flex items-center gap-2", children: [_jsx("input", { type: "radio", className: "h-4 w-4", checked: selectedLanguage === lang.code, onChange: () => setSelectedLanguage(lang.code) }), _jsxs("span", { children: [lang.name, lang.code === DEFAULT_LANGUAGE ? (_jsx("span", { className: "ml-1 text-sm opacity-60", children: t('settings.language.default', {
69
69
  defaultValue: '(default)',
70
- }) })) : null] })] }, lang.code))) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: !hasChanges || saving, children: t('common.form.save', { defaultValue: 'Save' }) })] }));
70
+ }) })) : null] })] }, lang.code))) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: !hasChanges || saving, children: t('common.actions.save', { defaultValue: 'Save' }) })] }));
71
71
  }
@@ -55,7 +55,7 @@ export function AdminConfigurationCommunityTimezone() {
55
55
  }
56
56
  };
57
57
  if (configQuery.isLoading) {
58
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
58
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
59
59
  }
60
60
  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.timezone.title', {
61
61
  defaultValue: 'Default timezone',
@@ -65,5 +65,5 @@ export function AdminConfigurationCommunityTimezone() {
65
65
  ? `${tz} ${t('configuration.community.timezone.browser', {
66
66
  defaultValue: '(browser)',
67
67
  })}`
68
- : tz }) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: !hasChanges || saving, children: t('common.form.save', { defaultValue: 'Save' }) })] }));
68
+ : tz }) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: !hasChanges || saving, children: t('common.actions.save', { defaultValue: 'Save' }) })] }));
69
69
  }
@@ -87,11 +87,11 @@ export function AdminConfigurationEmail() {
87
87
  }
88
88
  };
89
89
  if (configQuery.isLoading || !draft || !baseEmail) {
90
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
90
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
91
91
  }
92
92
  return (_jsxs("div", { className: "space-y-6 p-4", children: [_jsx("p", { className: "text-sm opacity-80", children: t('configuration.email.intro') }), _jsx(Form, { ...form, children: _jsxs("form", { className: "flex flex-col gap-6", onSubmit: onSubmit, children: [_jsxs("section", { className: "flex flex-col gap-4", "aria-labelledby": "email-config-transport-heading", children: [_jsx("h3", { id: "email-config-transport-heading", className: "text-base font-semibold", children: t('configuration.email.sections.transport') }), _jsx(FormField, { control: form.control, name: "transportConfig.host", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.host') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", "data-testid": "admin-email-host" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "transportConfig.port", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.port') }), _jsx(FormControl, { children: _jsx(Input, { type: "number", value: Number.isNaN(field.value) ? '' : field.value, onChange: (e) => field.onChange(e.target.value === ''
93
93
  ? Number.NaN
94
94
  : Number(e.target.value)), "data-testid": "admin-email-port" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "transportConfig.auth.user", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.authUser') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", value: field.value ?? '' }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "transportConfig.auth.pass", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.authPass') }), _jsx(FormDescription, { children: t('configuration.email.fields.authPassDescription') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "password", value: field.value ?? '' }) }), _jsx(FormMessage, {})] })) })] }), _jsx(ExpandableBox, { initialOpen: false, title: _jsx("p", { className: "text-base font-semibold", children: t('configuration.email.sections.general') }), children: _jsxs("div", { className: "flex flex-col gap-4 pt-1", children: [_jsx(FormField, { control: form.control, name: "service", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.service') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "defaultTemplatePath", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.defaultTemplatePath') }), _jsx(FormDescription, { children: t('configuration.email.fields.defaultTemplatePathDescription') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "defaultFrom", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.defaultFrom') }), _jsx(FormDescription, { children: t('configuration.email.fields.defaultFromDescription') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", value: field.value ?? '' }) }), _jsx(FormMessage, {})] })) })] }) }), _jsx("span", { className: "flex justify-end pt-2", children: _jsx(Button, { type: "submit", title: t('common.submit', { defaultValue: 'Submit' }), disabled: !form.formState.isValid || unchanged, loading: form.formState.isSubmitting, variant: "default", "data-testid": "admin-email-submit", children: t('common.submit', { defaultValue: 'Submit' }) }) })] }) }), _jsxs("div", { className: "bg-surface-2 rounded-lg p-4", children: [_jsx("p", { className: "font-medium", children: t('configuration.email.testTitle') }), _jsx("p", { className: "mb-3 text-sm opacity-80", children: t('configuration.email.testHint') }), _jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-end", children: [_jsxs("label", { className: "flex-1", children: [_jsx("span", { children: t('configuration.email.testRecipient') }), _jsx("input", { type: "email", value: testRecipient, onChange: (e) => setTestRecipient(e.target.value), className: "op-input rounded", placeholder: t('configuration.email.testRecipientPlaceholder'), autoComplete: "email", "data-testid": "admin-email-test-recipient" })] }), _jsx(Button, { variant: "secondary", title: t('configuration.email.sendTest'), action: handleSendTest, disabled: sending, "data-testid": "admin-email-send-test", children: sending
95
- ? t('common.form.loading')
95
+ ? t('common.states.loading')
96
96
  : t('configuration.email.sendTest') })] }), _jsx("p", { className: "mt-3 text-xs opacity-70", children: t('configuration.email.bounceNote') })] }), status ? (_jsx(Toast, { variant: status.type, testId: "admin-email-toast", onDismiss: () => setStatus(null), children: status.message })) : null] }));
97
97
  }
@@ -45,7 +45,7 @@ export function AdminConfigurationI18n() {
45
45
  }
46
46
  };
47
47
  if (i18nQuery.isLoading || !data || !working) {
48
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
48
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
49
49
  }
50
50
  return (_jsxs("div", { className: "p-4", children: [_jsxs("div", { className: "mb-4 flex items-center justify-between", children: [_jsx("h1", { className: "text-2xl font-bold", children: t('configuration.i18n.pageTitle', { defaultValue: 'Translations' }) }), _jsx(Button, { variant: "default", action: handleSave, title: t('configuration.i18n.save', { defaultValue: 'Save' }), children: t('configuration.i18n.save', { defaultValue: 'Save' }) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null, _jsx(NamespaceEditor, { defaults: data.defaults, merged: data.merged, overrides: working, languages: languages, path: [], onChange: onChange })] }));
51
51
  }
@@ -66,7 +66,7 @@ export function AdminConfigurationSso() {
66
66
  }
67
67
  };
68
68
  if (configQuery.isLoading || !core) {
69
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
69
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
70
70
  }
71
71
  const listed = [
72
72
  ...sso.oidc.map((provider) => ({
@@ -25,7 +25,7 @@ export function AdminConfigurationSsoNew() {
25
25
  return _jsx(Navigate, { to: "/admin/configuration/sso", replace: true });
26
26
  }
27
27
  if (configQuery.isLoading || !core || !form) {
28
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
28
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
29
29
  }
30
30
  const saveAdd = async () => {
31
31
  const error = validateProviderForm(form, t, undefined, sso);
@@ -75,7 +75,7 @@ export function AdminDashboard() {
75
75
  defaultValue: 'Rolling 30 days',
76
76
  }), info: info('mau', 'Distinct members who posted, liked, replied, reposted, or bookmarked in the 30 days ending at the range end.') }), _jsx(MetricCard, { label: t('admin.overview.activeWeek', {
77
77
  defaultValue: 'Active (week)',
78
- }), value: overviewData.metrics.activeMembers.value, deltaPct: overviewData.metrics.activeMembers.deltaPct, subtitle: thisPeriod, info: info('activeMembers', 'Distinct members who posted, liked, replied, reposted, or bookmarked at least once in the selected range. A member active on multiple days is counted once.') }), _jsx(MetricCard, { label: t('admin.analytics.metrics.dau', { defaultValue: 'DAU' }), value: growthData.metrics.dau.value, deltaPct: growthData.metrics.dau.deltaPct, subtitle: thisPeriod, info: info('dau', 'Average daily active members in the selected range. Active means posted, liked, replied, reposted, or bookmarked that day.') })] })] }), _jsxs("section", { children: [_jsx("h2", { className: "mb-3 text-lg font-medium", children: t('admin.overview.postsSection', { defaultValue: 'Posts' }) }), _jsxs("div", { className: "grid min-w-0 gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsx(MetricCard, { label: t('admin.overview.allPosts', { defaultValue: 'All Posts' }), value: overviewData.metrics.allTimePosts.value, info: info('totalPostsAllTime', 'All non-deleted, non-direct posts created on or before the end of the selected range.') }), _jsx(MetricCard, { label: t('admin.overview.replies', { defaultValue: 'Replies' }), value: engagementData.metrics.comments.value, deltaPct: engagementData.metrics.comments.deltaPct, subtitle: thisPeriod, info: info('comments', 'Replies recorded during the selected range.') }), _jsx(MetricCard, { label: t('admin.overview.postsThisPeriod', {
78
+ }), value: overviewData.metrics.activeMembers.value, deltaPct: overviewData.metrics.activeMembers.deltaPct, subtitle: thisPeriod, info: info('activeMembers', 'Distinct members who posted, liked, replied, reposted, or bookmarked at least once in the selected range. A member active on multiple days is counted once.') }), _jsx(MetricCard, { label: t('admin.analytics.metrics.dau', { defaultValue: 'DAU' }), value: growthData.metrics.dau.value, deltaPct: growthData.metrics.dau.deltaPct, subtitle: thisPeriod, info: info('dau', 'Average daily active members in the selected range. Active means posted, liked, replied, reposted, or bookmarked that day.') })] })] }), _jsxs("section", { children: [_jsx("h2", { className: "mb-3 text-lg font-medium", children: t('common.entities.posts', { defaultValue: 'Posts' }) }), _jsxs("div", { className: "grid min-w-0 gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsx(MetricCard, { label: t('admin.overview.allPosts', { defaultValue: 'All Posts' }), value: overviewData.metrics.allTimePosts.value, info: info('totalPostsAllTime', 'All non-deleted, non-direct posts created on or before the end of the selected range.') }), _jsx(MetricCard, { label: t('admin.overview.replies', { defaultValue: 'Replies' }), value: engagementData.metrics.comments.value, deltaPct: engagementData.metrics.comments.deltaPct, subtitle: thisPeriod, info: info('comments', 'Replies recorded during the selected range.') }), _jsx(MetricCard, { label: t('admin.overview.postsThisPeriod', {
79
79
  defaultValue: 'This week',
80
80
  }), value: overviewData.metrics.totalPosts.value, deltaPct: overviewData.metrics.totalPosts.deltaPct, subtitle: thisPeriod, info: info('totalPostsPeriod', 'Posts created during the selected range (excluding direct messages). Delta compares to the previous period.') }), _jsx(MetricCard, { label: t('admin.overview.recentInteractions', {
81
81
  defaultValue: 'Recent Interactions',
@@ -151,7 +151,7 @@ export function AdminDb() {
151
151
  : String(option) }, String(option)))) })] }));
152
152
  const rows = rowsQuery.data?.rows ?? [];
153
153
  const total = rowsQuery.data?.total ?? 0;
154
- return (_jsxs("div", { className: "flex h-[calc(100vh-4rem)] flex-col gap-3 p-4", children: [_jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { title: t('admin.database.browseTab', { defaultValue: 'Browse' }), variant: tab === 'browse' ? 'default' : 'outline', action: () => setTab('browse'), children: t('admin.database.browseTab', { defaultValue: 'Browse' }) }), _jsx(Button, { title: t('admin.database.sqlTab', { defaultValue: 'SQL' }), variant: tab === 'sql' ? 'default' : 'outline', action: () => setTab('sql'), children: t('admin.database.sqlTab', { defaultValue: 'SQL' }) })] }), tab === 'browse' ? (_jsxs("div", { className: "flex min-h-0 flex-1 gap-3", children: [_jsxs("aside", { className: "w-56 shrink-0 overflow-y-auto rounded border p-2", children: [_jsx("p", { className: "mb-2 text-sm font-medium", children: t('admin.database.tables', { defaultValue: 'Tables' }) }), tablesQuery.isLoading ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('admin.database.loading', { defaultValue: 'Loading…' }) })) : (_jsx("ul", { className: "space-y-0.5 text-sm", children: tables.map((table) => (_jsx("li", { children: _jsx("button", { type: "button", className: `hover:bg-surface rounded-button w-full px-2 py-1 text-left ${selectedTable === table.name
154
+ return (_jsxs("div", { className: "flex h-[calc(100vh-4rem)] flex-col gap-3 p-4", children: [_jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { title: t('admin.database.browseTab', { defaultValue: 'Browse' }), variant: tab === 'browse' ? 'default' : 'outline', action: () => setTab('browse'), children: t('admin.database.browseTab', { defaultValue: 'Browse' }) }), _jsx(Button, { title: t('admin.database.sqlTab', { defaultValue: 'SQL' }), variant: tab === 'sql' ? 'default' : 'outline', action: () => setTab('sql'), children: t('admin.database.sqlTab', { defaultValue: 'SQL' }) })] }), tab === 'browse' ? (_jsxs("div", { className: "flex min-h-0 flex-1 gap-3", children: [_jsxs("aside", { className: "w-56 shrink-0 overflow-y-auto rounded border p-2", children: [_jsx("p", { className: "mb-2 text-sm font-medium", children: t('admin.database.tables', { defaultValue: 'Tables' }) }), tablesQuery.isLoading ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) })) : (_jsx("ul", { className: "space-y-0.5 text-sm", children: tables.map((table) => (_jsx("li", { children: _jsx("button", { type: "button", className: `hover:bg-surface rounded-button w-full px-2 py-1 text-left ${selectedTable === table.name
155
155
  ? 'bg-surface font-medium'
156
156
  : ''}`, onClick: () => {
157
157
  setSelectedTable(table.name);
@@ -184,7 +184,7 @@ export function AdminDb() {
184
184
  }) }), pageSizeSelect(browsePageSize, (next) => {
185
185
  setBrowsePageSize(next);
186
186
  setOffset(0);
187
- })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-auto rounded border", children: rowsQuery.isLoading ? (_jsx("p", { className: "p-3 text-sm", children: t('admin.database.loading', {
187
+ })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-auto rounded border", children: rowsQuery.isLoading ? (_jsx("p", { className: "p-3 text-sm", children: t('common.states.loading', {
188
188
  defaultValue: 'Loading…',
189
189
  }) })) : rowsQuery.isError ? (_jsx("p", { className: "text-error p-3 text-sm", children: t('admin.database.loadError', {
190
190
  defaultValue: 'Failed to load rows.',
@@ -232,7 +232,7 @@ export function AdminDb() {
232
232
  }) }), _jsx("div", { className: "min-h-0 flex-1 overflow-auto rounded border", children: _jsxs("table", { className: "w-full border-collapse text-left text-xs", children: [_jsx("thead", { className: "bg-surface sticky top-0", children: _jsx("tr", { children: sqlResult.columns.map((col) => (_jsx("th", { className: "whitespace-nowrap border-b px-2 py-1 font-medium", children: col }, col))) }) }), _jsx("tbody", { children: sqlResult.rows.map((row, i) => (_jsx("tr", { children: sqlResult.columns.map((col) => (_jsx("td", { className: "max-w-xs truncate border-b px-2 py-1", title: formatCell(row[col]), children: formatCell(row[col]) }, col))) }, i))) })] }) })] })) : null] })), editing ? (_jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4", children: _jsxs("div", { className: "bg-background w-full max-w-lg space-y-3 rounded-lg p-4 shadow-lg", children: [_jsx("h2", { className: "text-lg font-medium", children: t('admin.database.editTitle', {
233
233
  defaultValue: 'Edit {{column}}',
234
234
  column: editing.column,
235
- }) }), _jsx("textarea", { className: "min-h-40 w-full rounded border p-2 font-mono text-sm", value: editing.value, onChange: (e) => setEditing({ ...editing, value: e.target.value }) }), _jsxs("div", { className: "flex justify-end gap-2", children: [_jsx(Button, { title: t('admin.database.cancel', { defaultValue: 'Cancel' }), variant: "outline", action: () => setEditing(null), children: t('admin.database.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { title: t('admin.database.save', { defaultValue: 'Save' }), variant: "default", action: () => {
235
+ }) }), _jsx("textarea", { className: "min-h-40 w-full rounded border p-2 font-mono text-sm", value: editing.value, onChange: (e) => setEditing({ ...editing, value: e.target.value }) }), _jsxs("div", { className: "flex justify-end gap-2", children: [_jsx(Button, { title: t('common.actions.cancel', { defaultValue: 'Cancel' }), variant: "outline", action: () => setEditing(null), children: t('common.actions.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { title: t('common.actions.save', { defaultValue: 'Save' }), variant: "default", action: () => {
236
236
  void saveEdit();
237
- }, children: t('admin.database.save', { defaultValue: 'Save' }) })] })] }) })) : null] }));
237
+ }, children: t('common.actions.save', { defaultValue: 'Save' }) })] })] }) })) : null] }));
238
238
  }
@@ -12,7 +12,7 @@ export function AdminDiagnosticsEmail() {
12
12
  const { openpeepsApi } = useOpenpeeps();
13
13
  const statsQuery = openpeepsApi.admin.useEmailQueueStats();
14
14
  const queueTest = openpeepsApi.admin.queueTestEmailAction();
15
- useSetPageHeader(t('diagnostics.email.title', { defaultValue: 'Email' }));
15
+ useSetPageHeader(t('common.labels.email', { defaultValue: 'Email' }));
16
16
  const [recipient, setRecipient] = useState('');
17
17
  const [queuing, setQueuing] = useState(false);
18
18
  const [message, setMessage] = useState(null);
@@ -60,6 +60,6 @@ export function AdminDiagnosticsEmail() {
60
60
  ]
61
61
  : [];
62
62
  return (_jsxs("div", { className: "space-y-6 p-4", children: [_jsxs("div", { className: "bg-surface-2 rounded-lg p-4", children: [_jsx("p", { className: "font-medium", children: t('diagnostics.email.testTitle') }), _jsx("p", { className: "mb-3 text-sm opacity-80", children: t('diagnostics.email.testHint') }), _jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-end", children: [_jsxs("label", { className: "flex-1", children: [_jsx("span", { children: t('diagnostics.email.testRecipient') }), _jsx("input", { type: "email", value: recipient, onChange: (e) => setRecipient(e.target.value), className: "op-input rounded", placeholder: t('diagnostics.email.testRecipientPlaceholder'), autoComplete: "email" })] }), _jsx(Button, { variant: "secondary", title: t('diagnostics.email.queueTest'), action: handleQueueTest, disabled: queuing, children: queuing
63
- ? t('common.form.loading')
64
- : t('diagnostics.email.queueTest') })] }), message ? (_jsx(Toast, { variant: message.type, onDismiss: () => setMessage(null), children: message.text })) : null] }), _jsxs("div", { className: "bg-surface-2 rounded-lg p-4", children: [_jsxs("div", { className: "mb-2 flex flex-wrap items-center justify-between gap-2", children: [_jsx("p", { className: "font-medium", children: t('diagnostics.email.queueTitle') }), _jsx(Button, { variant: "secondary", title: t('diagnostics.email.refresh'), action: () => statsQuery.refetch(), children: t('diagnostics.email.refresh') })] }), _jsx("p", { className: "mb-3 text-sm opacity-80", children: t('diagnostics.email.countsHint') }), statsQuery.isPending ? (_jsx("p", { className: "text-sm opacity-70", children: t('common.form.loading') })) : statsQuery.isError ? (_jsx("p", { className: "text-error text-sm", children: t('diagnostics.email.statsError') })) : stats ? (_jsxs(_Fragment, { children: [_jsx("dl", { className: "grid grid-cols-2 gap-2 text-sm sm:grid-cols-3 md:grid-cols-6", children: counters.map((c) => (_jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t(`diagnostics.email.${c.labelKey}`) }), _jsx("dd", { className: `font-mono ${c.error ? 'text-error' : ''}`, children: c.value })] }, c.labelKey))) }), stats.recentFailures.length > 0 ? (_jsxs("div", { className: "border-border mt-4 border-t pt-3", children: [_jsx("p", { className: "text-error mb-2 font-medium", children: t('diagnostics.email.recentFailures') }), _jsx("ul", { className: "space-y-2 text-sm", children: stats.recentFailures.map((f, idx) => (_jsxs("li", { className: "border-error/30 bg-error/10 rounded border p-2", children: [_jsxs("div", { className: "mb-1 flex flex-wrap items-baseline justify-between gap-2", children: [f.id ? (_jsx(Link, { to: `/admin/diagnostics/jobs/${encodeURIComponent(f.queue)}/${encodeURIComponent(f.id)}`, className: "op-anchor font-mono text-xs", title: t('diagnostics.jobs.viewLogs'), children: f.name })) : (_jsx("span", { className: "font-mono text-xs opacity-80", children: f.name })), f.finishedOn != null ? (_jsx("time", { className: "text-xs opacity-70", dateTime: new Date(f.finishedOn).toISOString(), children: formatFailureTime(f.finishedOn) })) : null] }), _jsx("p", { className: "whitespace-pre-wrap break-words", children: f.failedReason }), f.id ? (_jsx(Link, { to: `/admin/diagnostics/jobs/${encodeURIComponent(f.queue)}/${encodeURIComponent(f.id)}`, className: "op-anchor mt-1 inline-block text-xs", children: t('diagnostics.jobs.viewLogs') })) : null] }, `${f.queue}-${f.id ?? f.name}-${idx}`))) })] })) : null] })) : null, _jsx("p", { className: "mt-4 text-xs opacity-70", children: t('diagnostics.email.bounceNote') })] })] }));
63
+ ? t('common.states.loading')
64
+ : t('diagnostics.email.queueTest') })] }), message ? (_jsx(Toast, { variant: message.type, onDismiss: () => setMessage(null), children: message.text })) : null] }), _jsxs("div", { className: "bg-surface-2 rounded-lg p-4", children: [_jsxs("div", { className: "mb-2 flex flex-wrap items-center justify-between gap-2", children: [_jsx("p", { className: "font-medium", children: t('diagnostics.email.queueTitle') }), _jsx(Button, { variant: "secondary", title: t('common.actions.refresh'), action: () => statsQuery.refetch(), children: t('common.actions.refresh') })] }), _jsx("p", { className: "mb-3 text-sm opacity-80", children: t('diagnostics.email.countsHint') }), statsQuery.isPending ? (_jsx("p", { className: "text-sm opacity-70", children: t('common.states.loading') })) : statsQuery.isError ? (_jsx("p", { className: "text-error text-sm", children: t('diagnostics.email.statsError') })) : stats ? (_jsxs(_Fragment, { children: [_jsx("dl", { className: "grid grid-cols-2 gap-2 text-sm sm:grid-cols-3 md:grid-cols-6", children: counters.map((c) => (_jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t(`diagnostics.email.${c.labelKey}`) }), _jsx("dd", { className: `font-mono ${c.error ? 'text-error' : ''}`, children: c.value })] }, c.labelKey))) }), stats.recentFailures.length > 0 ? (_jsxs("div", { className: "border-border mt-4 border-t pt-3", children: [_jsx("p", { className: "text-error mb-2 font-medium", children: t('diagnostics.email.recentFailures') }), _jsx("ul", { className: "space-y-2 text-sm", children: stats.recentFailures.map((f, idx) => (_jsxs("li", { className: "border-error/30 bg-error/10 rounded border p-2", children: [_jsxs("div", { className: "mb-1 flex flex-wrap items-baseline justify-between gap-2", children: [f.id ? (_jsx(Link, { to: `/admin/diagnostics/jobs/${encodeURIComponent(f.queue)}/${encodeURIComponent(f.id)}`, className: "op-anchor font-mono text-xs", title: t('diagnostics.jobs.viewLogs'), children: f.name })) : (_jsx("span", { className: "font-mono text-xs opacity-80", children: f.name })), f.finishedOn != null ? (_jsx("time", { className: "text-xs opacity-70", dateTime: new Date(f.finishedOn).toISOString(), children: formatFailureTime(f.finishedOn) })) : null] }), _jsx("p", { className: "whitespace-pre-wrap break-words", children: f.failedReason }), f.id ? (_jsx(Link, { to: `/admin/diagnostics/jobs/${encodeURIComponent(f.queue)}/${encodeURIComponent(f.id)}`, className: "op-anchor mt-1 inline-block text-xs", children: t('diagnostics.jobs.viewLogs') })) : null] }, `${f.queue}-${f.id ?? f.name}-${idx}`))) })] })) : null] })) : null, _jsx("p", { className: "mt-4 text-xs opacity-70", children: t('diagnostics.email.bounceNote') })] })] }));
65
65
  }
@@ -20,7 +20,7 @@ function formatPayload(data) {
20
20
  }
21
21
  function JobDetails({ job, onRefresh, }) {
22
22
  const t = useT();
23
- return (_jsxs("div", { className: "space-y-4 p-4", children: [_jsxs("div", { className: "bg-surface rounded-lg border p-4", children: [_jsxs("div", { className: "mb-3 flex flex-wrap items-center justify-between gap-2", children: [_jsx("p", { className: "font-medium", children: t('diagnostics.jobs.details', { defaultValue: 'Job details' }) }), _jsx(Button, { variant: "default", action: onRefresh, children: t('diagnostics.jobs.refresh', { defaultValue: 'Refresh' }) })] }), _jsxs("dl", { className: "grid gap-2 text-sm sm:grid-cols-2", children: [_jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t('diagnostics.jobs.queue', { defaultValue: 'Queue' }) }), _jsx("dd", { className: "font-mono", children: job.queue })] }), _jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t('diagnostics.jobs.id', { defaultValue: 'ID' }) }), _jsx("dd", { className: "break-all font-mono", children: job.id })] }), _jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t('diagnostics.jobs.name', { defaultValue: 'Name' }) }), _jsx("dd", { className: "break-all font-mono", children: job.name })] }), _jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t('diagnostics.jobs.state', { defaultValue: 'State' }) }), _jsx("dd", { className: "font-mono", children: job.state })] }), _jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t('diagnostics.jobs.queuedAt', { defaultValue: 'Queued at' }) }), _jsx("dd", { children: formatTime(job.timestamp) })] }), _jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t('diagnostics.jobs.finishedAt', {
23
+ return (_jsxs("div", { className: "space-y-4 p-4", children: [_jsxs("div", { className: "bg-surface rounded-lg border p-4", children: [_jsxs("div", { className: "mb-3 flex flex-wrap items-center justify-between gap-2", children: [_jsx("p", { className: "font-medium", children: t('diagnostics.jobs.details', { defaultValue: 'Job details' }) }), _jsx(Button, { variant: "default", action: onRefresh, children: t('common.actions.refresh', { defaultValue: 'Refresh' }) })] }), _jsxs("dl", { className: "grid gap-2 text-sm sm:grid-cols-2", children: [_jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t('diagnostics.jobs.queue', { defaultValue: 'Queue' }) }), _jsx("dd", { className: "font-mono", children: job.queue })] }), _jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t('diagnostics.jobs.id', { defaultValue: 'ID' }) }), _jsx("dd", { className: "break-all font-mono", children: job.id })] }), _jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t('diagnostics.jobs.name', { defaultValue: 'Name' }) }), _jsx("dd", { className: "break-all font-mono", children: job.name })] }), _jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t('diagnostics.jobs.state', { defaultValue: 'State' }) }), _jsx("dd", { className: "font-mono", children: job.state })] }), _jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t('diagnostics.jobs.queuedAt', { defaultValue: 'Queued at' }) }), _jsx("dd", { children: formatTime(job.timestamp) })] }), _jsxs("div", { children: [_jsx("dt", { className: "opacity-70", children: t('diagnostics.jobs.finishedAt', {
24
24
  defaultValue: 'Finished at',
25
25
  }) }), _jsx("dd", { children: formatTime(job.finishedOn) })] })] }), job.failedReason ? (_jsxs("div", { className: "border-error/30 bg-error/10 mt-3 rounded border p-2 text-sm", children: [_jsx("p", { className: "text-error mb-1 font-medium", children: t('diagnostics.jobs.failedReason', {
26
26
  defaultValue: 'Failed reason',
@@ -42,7 +42,7 @@ export function AdminDiagnosticsJob() {
42
42
  }
43
43
  const refresh = () => jobQuery.refetch();
44
44
  if (jobQuery.isLoading) {
45
- return (_jsx("p", { className: "p-4 text-sm opacity-70", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
45
+ return (_jsx("p", { className: "p-4 text-sm opacity-70", children: t('common.states.loading', { defaultValue: 'Loading…' }) }));
46
46
  }
47
47
  if (jobQuery.isError || !jobQuery.data) {
48
48
  return (_jsx("p", { className: "text-error p-4 text-sm", children: t('diagnostics.jobs.notFound', { defaultValue: 'Job not found.' }) }));
@@ -15,7 +15,7 @@ export const AdminDiagnosticsLivekit = () => {
15
15
  const diagnosis = diagnosisQuery.data;
16
16
  return (_jsxs("div", { className: "space-y-4 p-4", children: [_jsx("p", { className: "text-muted-foreground text-sm", children: t('diagnostics.livekit.description', {
17
17
  defaultValue: 'Check whether jams can reach the LiveKit server. Missing or invalid credentials disable live jams.',
18
- }) }), _jsx(Button, { variant: "outline", title: t('diagnostics.livekit.refresh', { defaultValue: 'Refresh' }), action: () => void diagnosisQuery.refetch(), children: t('diagnostics.livekit.refresh', { defaultValue: 'Refresh' }) }), diagnosisQuery.isPending ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) })) : null, diagnosisQuery.isError ? (_jsx("p", { className: "text-error text-sm", children: t('diagnostics.livekit.loadError', {
18
+ }) }), _jsx(Button, { variant: "outline", title: t('common.actions.refresh', { defaultValue: 'Refresh' }), action: () => void diagnosisQuery.refetch(), children: t('common.actions.refresh', { defaultValue: 'Refresh' }) }), diagnosisQuery.isPending ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('common.states.loading', { defaultValue: 'Loading…' }) })) : null, diagnosisQuery.isError ? (_jsx("p", { className: "text-error text-sm", children: t('diagnostics.livekit.loadError', {
19
19
  defaultValue: 'Could not load the LiveKit diagnosis.',
20
20
  }) })) : null, diagnosis ? _jsx(DiagnosisReport, { diagnosis: diagnosis }) : null] }));
21
21
  };
@@ -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
  }