@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
@@ -59,9 +59,9 @@ export function DeleteGroupModal({ group, onClose }: DeleteGroupModalProps) {
59
59
  </p>
60
60
  ) : null}
61
61
  <DialogActions
62
- cancelLabel={t('groups.delete.cancel', { defaultValue: 'Cancel' })}
62
+ cancelLabel={t('common.actions.cancel', { defaultValue: 'Cancel' })}
63
63
  onCancel={onClose}
64
- actionLabel={t('groups.delete.deleteButton', {
64
+ actionLabel={t('common.actions.delete', {
65
65
  defaultValue: 'Delete',
66
66
  })}
67
67
  onAction={submit}
@@ -85,7 +85,7 @@ export function GroupForm({
85
85
  {!isEdit ? (
86
86
  <div className="space-y-2 px-1">
87
87
  <Label htmlFor="handle">
88
- {t('groups.handle.title', { defaultValue: 'Handle' })}
88
+ {t('common.labels.handle', { defaultValue: 'Handle' })}
89
89
  </Label>
90
90
  <Input
91
91
  id="handle"
@@ -116,7 +116,7 @@ export function GroupForm({
116
116
 
117
117
  <div className="space-y-2 px-1">
118
118
  <Label htmlFor="description">
119
- {t('groups.description.title', { defaultValue: 'Description' })}
119
+ {t('common.labels.description', { defaultValue: 'Description' })}
120
120
  </Label>
121
121
  <Textarea
122
122
  id="description"
@@ -119,12 +119,12 @@ export function GroupNotificationSettingsModal({
119
119
  </p>
120
120
  ) : null}
121
121
  <DialogActions
122
- cancelLabel={t('common.cancel', { defaultValue: 'Cancel' })}
122
+ cancelLabel={t('common.actions.cancel', { defaultValue: 'Cancel' })}
123
123
  onCancel={onClose}
124
124
  actionLabel={
125
125
  saving
126
126
  ? t('common.saving', { defaultValue: 'Saving…' })
127
- : t('common.save', { defaultValue: 'Save' })
127
+ : t('common.actions.save', { defaultValue: 'Save' })
128
128
  }
129
129
  onAction={onSave}
130
130
  disabled={saving || !ready}
@@ -25,7 +25,7 @@ import { Avatar } from '../profile';
25
25
  import { JamAnimatedEmoji } from './JamAnimatedEmoji';
26
26
  import { useJamContext } from './JamContext';
27
27
  import { useJamEventsContext } from './JamEventsContext';
28
- import { parseParticipantMetadata } from './jamEventActions';
28
+ import { participantTileProfile } from './jamEventActions';
29
29
  import { useConnectionLost } from './useParticipantConnection';
30
30
  import { useRaisedHands } from './useJamHands';
31
31
 
@@ -156,7 +156,7 @@ function JamParticipantOverlay({
156
156
  }
157
157
  }, [handUp]);
158
158
 
159
- const profile = parseParticipantMetadata(participant.metadata).profile;
159
+ const profile = participantTileProfile(participant, me);
160
160
  const isModerator = jam.moderators.includes(participant.identity);
161
161
  const viewerIsModerator = !!me && jam.moderators.includes(me.id);
162
162
 
@@ -263,7 +263,8 @@ export function JamCallParticipant({
263
263
  }: JamCallParticipantProps) {
264
264
  const t = useT();
265
265
  const participant = trackRef.participant;
266
- const profile = parseParticipantMetadata(participant.metadata).profile;
266
+ const me = useCurrentProfile();
267
+ const profile = participantTileProfile(participant, me);
267
268
  const connectionLost = useConnectionLost(participant);
268
269
  const speaking = useIsSpeaking(participant);
269
270
  const cameraOn = isTrackReference(trackRef) && !trackRef.publication.isMuted;
@@ -72,7 +72,7 @@ export function JamGuestForm() {
72
72
 
73
73
  <div className="space-y-2">
74
74
  <Label htmlFor="guest-email">
75
- {t('jams.lobby.guestEmailLabel', { defaultValue: 'Email' })}
75
+ {t('common.labels.email', { defaultValue: 'Email' })}
76
76
  </Label>
77
77
  <Input
78
78
  id="guest-email"
@@ -30,6 +30,27 @@ export function parseParticipantMetadata(
30
30
  }
31
31
  }
32
32
 
33
+ const hasTileIdentity = (profile?: {
34
+ handle?: string;
35
+ displayName?: string;
36
+ avatar?: string | null;
37
+ }) => !!(profile?.handle || profile?.displayName || profile?.avatar);
38
+
39
+ /**
40
+ * Profile drawn on a participant tile. LiveKit applies token metadata only
41
+ * after the room connection completes, so the local tile has no profile while
42
+ * the UI still says it is connecting and the empty-name avatar renders as "??".
43
+ * Use the signed-in profile for that window.
44
+ */
45
+ export const participantTileProfile = (
46
+ participant: { isLocal: boolean; metadata?: string },
47
+ localProfile?: PublicProfile,
48
+ ): PublicProfile | undefined => {
49
+ const fromRoom = parseParticipantMetadata(participant.metadata).profile;
50
+ if (hasTileIdentity(fromRoom)) return fromRoom;
51
+ return participant.isLocal ? localProfile : fromRoom;
52
+ };
53
+
33
54
  export const mentionProfilesFromParticipants = (
34
55
  participants: { metadata?: string }[],
35
56
  ): PublicProfile[] => {
@@ -26,12 +26,12 @@ export function ContentHeader() {
26
26
  <div className="flex min-w-0 items-center gap-2">
27
27
  <button
28
28
  type="button"
29
- title={t('navigation.back')}
30
- aria-label={t('navigation.back')}
29
+ title={t('common.actions.back')}
30
+ aria-label={t('common.actions.back')}
31
31
  onClick={() => router.back()}
32
32
  >
33
33
  <ChevronLeft aria-hidden="true" />
34
- <span className="sr-only">{t('navigation.back')}</span>
34
+ <span className="sr-only">{t('common.actions.back')}</span>
35
35
  </button>
36
36
  {titleNode ?? (
37
37
  <h1
@@ -43,7 +43,7 @@ export function FooterMobile({ onNewPost }: FooterMobileProps = {}) {
43
43
  action={onNewPost ?? hrefOf({ type: 'postNew' })}
44
44
  />
45
45
  <MobileMenuItem
46
- title={t('navigation.groups')}
46
+ title={t('common.entities.groups')}
47
47
  tooltip={t('navigation.tooltips.groups')}
48
48
  icon={Users}
49
49
  action={hrefOf({ type: 'groups' })}
@@ -56,13 +56,13 @@ export function SideBar({ onClose, mainMenu, profileMenu }: SideBarProps = {}) {
56
56
  {onClose && (
57
57
  <button
58
58
  type="button"
59
- title={t('common.close')}
60
- aria-label={t('common.close')}
59
+ title={t('common.actions.close')}
60
+ aria-label={t('common.actions.close')}
61
61
  className="flex md:hidden"
62
62
  onClick={onClose}
63
63
  >
64
64
  <X aria-hidden="true" />
65
- <span className="sr-only">{t('common.close')}</span>
65
+ <span className="sr-only">{t('common.actions.close')}</span>
66
66
  </button>
67
67
  )}
68
68
  </div>
@@ -36,7 +36,7 @@ export function FullPostLayout({
36
36
  if (isLoading) {
37
37
  return (
38
38
  <div className="text-muted-foreground flex h-32 items-center justify-center text-sm">
39
- {t('common.loading', { defaultValue: 'Loading…' })}
39
+ {t('common.states.loading', { defaultValue: 'Loading…' })}
40
40
  </div>
41
41
  );
42
42
  }
@@ -20,6 +20,7 @@ export { DeletePostModal } from './pieces/modals/DeletePostModal';
20
20
  export { EditPostModal } from './post-form/EditPostModal';
21
21
  export { useEditPostModal } from './post-form/EditPostModalContext';
22
22
  export { ComposeAttachments } from './post-form/ComposeAttachments';
23
+ export { useComposeAttachments } from './post-form/ComposeAttachments';
23
24
  export { DescriptionEditModal } from './post-form/DescriptionEditModal';
24
25
  export type { DescriptionEditModalProps } from './post-form/DescriptionEditModal';
25
26
  export { OpenpeepsMarkdownInput } from './post-form/OpenpeepsMarkdownInput';
@@ -428,7 +428,7 @@ const EventRsvpRow = ({
428
428
  variant="outline"
429
429
  action={() => onManage('removed', rsvp.profile.id, recurrenceId)}
430
430
  >
431
- {t('events.rsvp.removeAttendee', {
431
+ {t('common.actions.remove', {
432
432
  defaultValue: 'Remove',
433
433
  })}
434
434
  </Button>
@@ -227,7 +227,7 @@ export const EventRsvpScopeDialog = ({
227
227
  ) : null}
228
228
  {error ? <p className="text-error text-sm">{error}</p> : null}
229
229
  <DialogActions
230
- cancelLabel={t('events.rsvp.scope.cancel', {
230
+ cancelLabel={t('common.actions.cancel', {
231
231
  defaultValue: 'Cancel',
232
232
  })}
233
233
  onCancel={onClose}
@@ -236,7 +236,7 @@ export const EventRsvpScopeDialog = ({
236
236
  ? t('events.rsvp.joinWaitlist', {
237
237
  defaultValue: 'Join waitlist',
238
238
  })
239
- : t('events.rsvp.scope.confirm', {
239
+ : t('common.actions.confirm', {
240
240
  defaultValue: 'Confirm',
241
241
  })
242
242
  }
@@ -61,7 +61,7 @@ export const EventWaitlistJoinDialog = ({
61
61
  </p>
62
62
  {error ? <p className="text-error text-sm">{error}</p> : null}
63
63
  <DialogActions
64
- cancelLabel={t('events.rsvp.scope.cancel', {
64
+ cancelLabel={t('common.actions.cancel', {
65
65
  defaultValue: 'Cancel',
66
66
  })}
67
67
  onCancel={onClose}
@@ -37,7 +37,7 @@ export function GalleryModal({
37
37
 
38
38
  const prevLabel = t('posts.gallery.previous', { defaultValue: 'Previous' });
39
39
  const nextLabel = t('posts.gallery.next', { defaultValue: 'Next' });
40
- const closeLabel = t('posts.gallery.close', { defaultValue: 'Close' });
40
+ const closeLabel = t('common.actions.close', { defaultValue: 'Close' });
41
41
 
42
42
  const prev = (e: MouseEvent) => {
43
43
  stop(e);
@@ -54,11 +54,11 @@ export function DeletePostModal({
54
54
  </article>
55
55
  </div>
56
56
  <DialogActions
57
- cancelLabel={t('posts.deleteModal.cancel', {
57
+ cancelLabel={t('common.actions.cancel', {
58
58
  defaultValue: 'Cancel',
59
59
  })}
60
60
  onCancel={onClose}
61
- actionLabel={t('posts.deleteModal.delete', {
61
+ actionLabel={t('common.actions.delete', {
62
62
  defaultValue: 'Delete',
63
63
  })}
64
64
  onAction={handleDelete}
@@ -45,6 +45,8 @@ export interface ComposeAttachmentsApi {
45
45
  openImagePicker: () => void;
46
46
  openAudioPicker: () => void;
47
47
  openDocumentPicker: () => void;
48
+ /** Drop in-flight and ready items. Used after a message is sent. */
49
+ clear: () => void;
48
50
  /** True while any attachment is still uploading or processing. */
49
51
  pending: boolean;
50
52
  /** Attachment cards — render where the previews should appear. */
@@ -280,6 +282,14 @@ export function useComposeAttachments({
280
282
  openImagePicker: () => imageInputRef.current?.click(),
281
283
  openAudioPicker: () => audioInputRef.current?.click(),
282
284
  openDocumentPicker: () => documentInputRef.current?.click(),
285
+ clear: () => {
286
+ items.forEach((item) => {
287
+ if (item.previewUrl && isBlobUrl(item.previewUrl)) {
288
+ revokeBlobUrl(item.previewUrl);
289
+ }
290
+ });
291
+ setItems([]);
292
+ },
283
293
  pending,
284
294
  previews,
285
295
  inputs,
@@ -64,7 +64,7 @@ export function DescriptionEditModal({
64
64
  </div>
65
65
 
66
66
  <DialogActions
67
- cancelLabel={t('common.back', { defaultValue: 'Back' })}
67
+ cancelLabel={t('common.actions.back', { defaultValue: 'Back' })}
68
68
  onCancel={onClose}
69
69
  actionLabel={t('common.done', { defaultValue: 'Done' })}
70
70
  onAction={saveAndClose}
@@ -179,12 +179,12 @@ export function EditPostModal({ post, onClose }: EditPostModalProps) {
179
179
  {error ? <p className="text-error text-sm">{error}</p> : null}
180
180
 
181
181
  <DialogActions
182
- cancelLabel={t('common.cancel', { defaultValue: 'Cancel' })}
182
+ cancelLabel={t('common.actions.cancel', { defaultValue: 'Cancel' })}
183
183
  onCancel={onClose}
184
184
  actionLabel={
185
185
  submitting
186
186
  ? t('common.saving', { defaultValue: 'Saving…' })
187
- : t('common.save', { defaultValue: 'Save' })
187
+ : t('common.actions.save', { defaultValue: 'Save' })
188
188
  }
189
189
  onAction={publish}
190
190
  disabled={submitting || !canSave}
@@ -57,7 +57,6 @@ export const EventForm = ({
57
57
  }: EventFormProps) => {
58
58
  const t = useT();
59
59
  const [audienceOpen, setAudienceOpen] = useState(false);
60
- const [endBeforeStart, setEndBeforeStart] = useState(false);
61
60
  const {
62
61
  event,
63
62
  eventTimeZone,
@@ -65,6 +64,9 @@ export const EventForm = ({
65
64
  repeatFreq,
66
65
  repeatEnd,
67
66
  preview,
67
+ endBeforeStart,
68
+ changeStart,
69
+ changeEnd,
68
70
  patchEvent,
69
71
  setEvent,
70
72
  setAudience,
@@ -137,7 +139,7 @@ export const EventForm = ({
137
139
  </h2>
138
140
 
139
141
  <Label
140
- title={t('events.form.startDate', { defaultValue: 'Start Date' })}
142
+ title={t('events.startDate', { defaultValue: 'Start Date' })}
141
143
  htmlFor="event-start"
142
144
  >
143
145
  <Input
@@ -145,17 +147,7 @@ export const EventForm = ({
145
147
  type="datetime-local"
146
148
  step={60}
147
149
  value={dateToInputValue(event.start, eventTimeZone)}
148
- onChange={(e) => {
149
- const start = toIso(e.target.value, eventTimeZone);
150
- if (start) {
151
- if (event.end && new Date(event.end) <= new Date(start)) {
152
- setEndBeforeStart(true);
153
- } else {
154
- setEndBeforeStart(false);
155
- }
156
- patchEvent({ start });
157
- }
158
- }}
150
+ onChange={(e) => changeStart(toIso(e.target.value, eventTimeZone))}
159
151
  data-testid="events-start-input"
160
152
  />
161
153
  </Label>
@@ -176,7 +168,7 @@ export const EventForm = ({
176
168
  {showEndDate ? (
177
169
  <>
178
170
  <Label
179
- title={t('events.form.endDate', { defaultValue: 'End Date' })}
171
+ title={t('events.endDate', { defaultValue: 'End Date' })}
180
172
  htmlFor="event-end"
181
173
  >
182
174
  <Input
@@ -184,19 +176,9 @@ export const EventForm = ({
184
176
  type="datetime-local"
185
177
  step={60}
186
178
  value={dateToInputValue(event.end, eventTimeZone)}
187
- onChange={(e) => {
188
- const newEnd = toIso(e.target.value, eventTimeZone);
189
- if (
190
- newEnd &&
191
- event.start &&
192
- new Date(newEnd) <= new Date(event.start)
193
- ) {
194
- setEndBeforeStart(true);
195
- return;
196
- }
197
- setEndBeforeStart(false);
198
- patchEvent({ end: newEnd });
199
- }}
179
+ onChange={(e) =>
180
+ changeEnd(toIso(e.target.value, eventTimeZone))
181
+ }
200
182
  />
201
183
  </Label>
202
184
  {endBeforeStart ? (
@@ -394,7 +376,7 @@ export const EventForm = ({
394
376
  </h2>
395
377
 
396
378
  <Label
397
- title={t('events.form.visibility', { defaultValue: 'Visibility' })}
379
+ title={t('common.labels.visibility', { defaultValue: 'Visibility' })}
398
380
  description={t('events.form.visibilityNotChangeable', {
399
381
  defaultValue:
400
382
  "Note: The event visibility cannot be changed once the event is published. Make sure you're adding the right people or group.",
@@ -205,8 +205,8 @@ export const PostAudienceSelector = ({
205
205
  <DialogActions
206
206
  cancelLabel={
207
207
  view !== 'main'
208
- ? t('navigation.back', { defaultValue: 'Back' })
209
- : t('common.cancel', { defaultValue: 'Cancel' })
208
+ ? t('common.actions.back', { defaultValue: 'Back' })
209
+ : t('common.actions.cancel', { defaultValue: 'Cancel' })
210
210
  }
211
211
  onCancel={view !== 'main' ? () => setView('main') : onClose}
212
212
  actionLabel={t('common.done', { defaultValue: 'Done' })}
@@ -330,7 +330,7 @@ export function ReplyModal({ post, onClose }: ReplyModalProps) {
330
330
  </div>
331
331
  <div className="flex gap-2">
332
332
  <Button variant="ghost" action={onClose}>
333
- {t('common.cancel', { defaultValue: 'Cancel' })}
333
+ {t('common.actions.cancel', { defaultValue: 'Cancel' })}
334
334
  </Button>
335
335
  <Button
336
336
  variant="default"
@@ -289,7 +289,7 @@ export function FullEvent({ post, occurrence }: FullEventProps) {
289
289
  active={tab === 'description'}
290
290
  onClick={() => setTab('description')}
291
291
  >
292
- {t('events.tabs.description', { defaultValue: 'Description' })}
292
+ {t('common.labels.description', { defaultValue: 'Description' })}
293
293
  </TabButton>
294
294
  ) : null}
295
295
  <TabButton active={tab === 'replies'} onClick={() => setTab('replies')}>
@@ -571,11 +571,11 @@ function JamRecordingItem({
571
571
  })}
572
572
  </p>
573
573
  <DialogActions
574
- cancelLabel={t('posts.deleteModal.cancel', {
574
+ cancelLabel={t('common.actions.cancel', {
575
575
  defaultValue: 'Cancel',
576
576
  })}
577
577
  onCancel={() => setConfirmOpen(false)}
578
- actionLabel={t('posts.deleteModal.delete', {
578
+ actionLabel={t('common.actions.delete', {
579
579
  defaultValue: 'Delete',
580
580
  })}
581
581
  onAction={handleDelete}
@@ -10,6 +10,7 @@ import { ResourceCard } from '../../../resources/ResourceCard';
10
10
  import { VideoPlayer } from '../../pieces/VideoPlayer';
11
11
  import { AudioAttachment } from '../../pieces/AudioAttachment';
12
12
  import { GalleryModal } from '../../pieces/GalleryModal';
13
+ import { asDownloadUrl } from '../../../../lib/downloadUrl';
13
14
 
14
15
  export interface FullResourceProps {
15
16
  post: PublicPost;
@@ -36,7 +37,7 @@ export const FullResource = ({ post }: FullResourceProps) => {
36
37
  const att = resource.attachments?.find(
37
38
  (a) => attachmentMediaKind(a) === 'file',
38
39
  );
39
- if (att?.url) window.open(att.url, '_blank');
40
+ if (att?.url) window.location.assign(asDownloadUrl(att.url));
40
41
  break;
41
42
  }
42
43
  case 'link':
@@ -1,4 +1,8 @@
1
+ import { useState } from 'react';
2
+ import { Play } from 'lucide-react';
3
+ import { videoEmbedForUrl } from '@openpeepshq/common/lib';
1
4
  import { LoadingSpinner } from '@openpeepshq/react-ui';
5
+ import { useT } from '../../i18n';
2
6
  import { useOpenpeeps } from '../../contexts/openpeeps';
3
7
  import { recordOutboundClick } from '../../lib/analyticsClicks';
4
8
 
@@ -6,10 +10,40 @@ export interface RemotePreviewLinkProps {
6
10
  url: string;
7
11
  }
8
12
 
13
+ // Same safety set as the markdown iframe path (see
14
+ // injectIframeSafetyAttrs in @openpeepshq/common/lib); `allow` is trimmed
15
+ // to what video players need.
16
+ const EMBED_SANDBOX =
17
+ 'allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-presentation';
18
+ const EMBED_ALLOW = 'autoplay; encrypted-media; picture-in-picture; fullscreen';
19
+
9
20
  export function RemotePreviewLink({ url }: RemotePreviewLinkProps) {
21
+ const t = useT();
10
22
  const { openpeepsApi } = useOpenpeeps();
23
+ const embed = videoEmbedForUrl(url);
24
+ // Click-to-load: the server-fetched OG card (no third-party request) is
25
+ // the default view; the player mounts only after an explicit action.
26
+ const [loadedUrl, setLoadedUrl] = useState<string | null>(null);
11
27
  const previewQuery = openpeepsApi.usePreviewLink(url);
12
28
 
29
+ if (embed && loadedUrl === url) {
30
+ return (
31
+ <div className="mb-2 w-full">
32
+ <iframe
33
+ src={embed.embedUrl}
34
+ title={t('previewLink.embeddedVideo', {
35
+ defaultValue: 'Embedded video',
36
+ })}
37
+ className="aspect-video w-full rounded-md border-0"
38
+ sandbox={EMBED_SANDBOX}
39
+ allow={EMBED_ALLOW}
40
+ allowFullScreen
41
+ referrerPolicy="no-referrer"
42
+ />
43
+ </div>
44
+ );
45
+ }
46
+
13
47
  if (previewQuery.isLoading) {
14
48
  return (
15
49
  <div className="text-muted-foreground py-2 text-sm">
@@ -28,39 +62,72 @@ export function RemotePreviewLink({ url }: RemotePreviewLinkProps) {
28
62
  /* keep url */
29
63
  }
30
64
 
31
- return (
32
- <a
33
- href={url}
34
- target="_blank"
35
- rel="noreferrer"
36
- className="hover:bg-surface mb-2 block w-full min-w-0 max-w-full overflow-hidden rounded-md border no-underline"
37
- onClick={(e) => {
38
- e.stopPropagation();
39
- recordOutboundClick(url);
40
- }}
41
- >
42
- <div className="flex w-full min-w-0 flex-row items-center gap-4 p-2">
43
- {data.image ? (
44
- <div className="flex h-24 w-24 shrink-0 items-center justify-center">
65
+ const card = (
66
+ <div className="flex w-full min-w-0 flex-row items-center gap-4 p-2">
67
+ {data.image || embed ? (
68
+ <div className="relative flex h-24 w-24 shrink-0 items-center justify-center">
69
+ {data.image ? (
45
70
  <img
46
71
  src={data.image}
47
72
  alt={data.title ?? ''}
48
73
  className="h-full w-full rounded-md object-cover"
49
74
  />
50
- </div>
51
- ) : null}
52
- <div className="flex min-w-0 flex-1 flex-col gap-1">
53
- <p className="text-muted-foreground truncate text-xs">{hostname}</p>
54
- {data.title ? (
55
- <p className="truncate font-semibold">{data.title}</p>
56
75
  ) : null}
57
- {data.description ? (
58
- <p className="text-muted-foreground truncate text-sm">
59
- {data.description}
60
- </p>
76
+ {embed ? (
77
+ <div className="absolute inset-0 flex items-center justify-center">
78
+ <div className="flex size-10 items-center justify-center rounded-full bg-black/60">
79
+ <Play className="size-5 text-white" aria-hidden />
80
+ </div>
81
+ </div>
61
82
  ) : null}
62
83
  </div>
84
+ ) : null}
85
+ <div className="flex min-w-0 flex-1 flex-col gap-1">
86
+ <p className="text-muted-foreground truncate text-xs">{hostname}</p>
87
+ {data.title ? (
88
+ <p className="truncate font-semibold">{data.title}</p>
89
+ ) : null}
90
+ {data.description ? (
91
+ <p className="text-muted-foreground truncate text-sm">
92
+ {data.description}
93
+ </p>
94
+ ) : null}
63
95
  </div>
64
- </a>
96
+ </div>
97
+ );
98
+
99
+ if (!embed) {
100
+ return (
101
+ <a
102
+ href={url}
103
+ target="_blank"
104
+ rel="noreferrer"
105
+ className="hover:bg-surface mb-2 block w-full min-w-0 max-w-full overflow-hidden rounded-md border no-underline"
106
+ onClick={(e) => {
107
+ e.stopPropagation();
108
+ recordOutboundClick(url);
109
+ }}
110
+ >
111
+ {card}
112
+ </a>
113
+ );
114
+ }
115
+
116
+ return (
117
+ <div
118
+ role="button"
119
+ tabIndex={0}
120
+ aria-label={t('previewLink.playVideo', { defaultValue: 'Play video' })}
121
+ className="hover:bg-surface mb-2 block w-full min-w-0 max-w-full cursor-pointer overflow-hidden rounded-md border"
122
+ onClick={() => setLoadedUrl(url)}
123
+ onKeyDown={(e) => {
124
+ if (e.key === 'Enter' || e.key === ' ') {
125
+ e.preventDefault();
126
+ setLoadedUrl(url);
127
+ }
128
+ }}
129
+ >
130
+ {card}
131
+ </div>
65
132
  );
66
133
  }
@@ -58,7 +58,7 @@ const SummaryBody = ({ summary }: { summary: ProfileActivitySummaryData }) => {
58
58
  >
59
59
  <CountCard
60
60
  value={summary.postsCount}
61
- label={t('profile.activity.postsCount', { defaultValue: 'Posts' })}
61
+ label={t('common.entities.posts', { defaultValue: 'Posts' })}
62
62
  testId="profile-activity-posts-count"
63
63
  />
64
64
  <CountCard
@@ -70,7 +70,7 @@ const SummaryBody = ({ summary }: { summary: ProfileActivitySummaryData }) => {
70
70
  />
71
71
  <CountCard
72
72
  value={summary.eventsCount}
73
- label={t('profile.activity.eventsCount', { defaultValue: 'Events' })}
73
+ label={t('common.entities.events', { defaultValue: 'Events' })}
74
74
  testId="profile-activity-events-count"
75
75
  />
76
76
  </CountSection>
@@ -101,14 +101,14 @@ const SummaryBody = ({ summary }: { summary: ProfileActivitySummaryData }) => {
101
101
  />
102
102
  <CountCard
103
103
  value={summary.bookmarksCount}
104
- label={t('profile.activity.bookmarksCount', {
104
+ label={t('common.entities.bookmarks', {
105
105
  defaultValue: 'Bookmarks',
106
106
  })}
107
107
  testId="profile-activity-bookmarks-count"
108
108
  />
109
109
  <CountCard
110
110
  value={summary.groupsCount}
111
- label={t('profile.activity.groupsCount', { defaultValue: 'Groups' })}
111
+ label={t('common.entities.groups', { defaultValue: 'Groups' })}
112
112
  testId="profile-activity-groups-count"
113
113
  />
114
114
  </CountSection>
@@ -29,7 +29,7 @@ export const ProfileBadge = ({
29
29
  <button
30
30
  type="button"
31
31
  className="hover:bg-secondary ml-0.5 rounded-full p-0.5 transition-colors"
32
- title={t('profile.selector.remove', { defaultValue: 'Remove' })}
32
+ title={t('common.actions.remove', { defaultValue: 'Remove' })}
33
33
  onClick={(e) => {
34
34
  e.stopPropagation();
35
35
  onRemove();
@@ -181,7 +181,7 @@ export function ProfilePageAction({
181
181
  })}
182
182
  </p>
183
183
  <DialogActions
184
- cancelLabel={t('common.cancel', { defaultValue: 'Cancel' })}
184
+ cancelLabel={t('common.actions.cancel', { defaultValue: 'Cancel' })}
185
185
  onCancel={() => setBlockOpen(false)}
186
186
  actionLabel={t('profile.block.confirm', { defaultValue: 'Block' })}
187
187
  onAction={() => void confirmBlock()}