@openpeepshq/react 0.2.3 → 0.2.5

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 (418) hide show
  1. package/dist/components/accounts/SignUpLoginModal.js +2 -2
  2. package/dist/components/configuration/ConfigMenuButton.d.ts +10 -0
  3. package/dist/components/configuration/ConfigMenuButton.js +12 -0
  4. package/dist/components/configuration/ConfigurationTree.js +1 -1
  5. package/dist/components/configuration/index.d.ts +2 -0
  6. package/dist/components/configuration/index.js +1 -0
  7. package/dist/components/conversations/ConversationMessageBubble.d.ts +2 -1
  8. package/dist/components/conversations/ConversationMessageBubble.js +4 -5
  9. package/dist/components/conversations/CreateNewConversation.js +10 -42
  10. package/dist/components/conversations/DirectMessagesHeaderActions.js +1 -1
  11. package/dist/components/conversations/MessageInThread.js +1 -2
  12. package/dist/components/form/ImageEditModal.js +2 -4
  13. package/dist/components/form/ImageInput.js +13 -8
  14. package/dist/components/form/LocationInput.js +1 -1
  15. package/dist/components/groups/AddGroupMembersButton.d.ts +1 -1
  16. package/dist/components/groups/AddGroupMembersButton.js +2 -2
  17. package/dist/components/groups/ChangeGroupRolesModal.js +1 -1
  18. package/dist/components/groups/ConfirmGroupExitModal.js +2 -2
  19. package/dist/components/groups/ConfirmMemberRemovalModal.js +1 -1
  20. package/dist/components/groups/DeleteGroupModal.js +1 -1
  21. package/dist/components/groups/GroupAvatar.js +4 -4
  22. package/dist/components/groups/GroupCard.js +3 -3
  23. package/dist/components/groups/GroupHeader.js +1 -1
  24. package/dist/components/groups/GroupMembersList.js +2 -3
  25. package/dist/components/groups/GroupOptionsMenu.js +12 -6
  26. package/dist/components/groups/JoinGroupButton.js +3 -20
  27. package/dist/components/jams/CreateNewJam.js +4 -4
  28. package/dist/components/jams/JamCallParticipant.js +17 -7
  29. package/dist/components/jams/JamCapacityGate.js +1 -1
  30. package/dist/components/jams/JamChatDrawer.js +2 -2
  31. package/dist/components/jams/JamConference.js +1 -1
  32. package/dist/components/jams/JamContext.d.ts +4 -0
  33. package/dist/components/jams/JamContext.js +17 -2
  34. package/dist/components/jams/JamDetailsDrawer.js +1 -1
  35. package/dist/components/jams/JamDeviceSelectors.d.ts +15 -0
  36. package/dist/components/jams/JamDeviceSelectors.js +4 -3
  37. package/dist/components/jams/JamFooter.js +15 -16
  38. package/dist/components/jams/JamGuestForm.js +2 -2
  39. package/dist/components/jams/JamLobby.js +9 -19
  40. package/dist/components/jams/JamObserverShell.js +1 -1
  41. package/dist/components/jams/JamParticipantConference.js +1 -1
  42. package/dist/components/jams/JamPeopleDrawer.js +17 -13
  43. package/dist/components/jams/JamReactionMenu.js +1 -1
  44. package/dist/components/jams/JamRequestJoin.js +1 -1
  45. package/dist/components/jams/JamRoom.js +84 -4
  46. package/dist/components/jams/JamToolbarButton.d.ts +21 -0
  47. package/dist/components/jams/JamToolbarButton.js +19 -0
  48. package/dist/components/jams/JamVideoCall.js +8 -3
  49. package/dist/components/jams/JamVideoLayout.js +16 -5
  50. package/dist/components/jams/LeaveCloseButton.js +9 -44
  51. package/dist/components/jams/LiveJamsSection.js +1 -1
  52. package/dist/components/jams/constants.js +4 -0
  53. package/dist/components/jams/useParticipantConnection.d.ts +7 -0
  54. package/dist/components/jams/useParticipantConnection.js +11 -0
  55. package/dist/components/layout/Auth.js +1 -1
  56. package/dist/components/layout/Infos.js +2 -2
  57. package/dist/components/layout/OpenpeepsContextProvider.js +4 -3
  58. package/dist/components/layout/OpenpeepsThemeProvider.d.ts +3 -4
  59. package/dist/components/layout/OpenpeepsThemeProvider.js +23 -9
  60. package/dist/components/layout/Root.js +1 -1
  61. package/dist/components/markdown/CompiledMarkdown.js +15 -1
  62. package/dist/components/markdown/classes.d.ts +2 -0
  63. package/dist/components/markdown/classes.js +2 -0
  64. package/dist/components/markdown/index.d.ts +1 -1
  65. package/dist/components/markdown/index.js +1 -1
  66. package/dist/components/navigation/ContentHeader.js +1 -1
  67. package/dist/components/navigation/FooterMobile.js +5 -1
  68. package/dist/components/navigation/HeaderMobile.js +1 -1
  69. package/dist/components/navigation/MobileMenuItem.js +1 -1
  70. package/dist/components/navigation/PageHeaderAction.js +1 -1
  71. package/dist/components/navigation/PlusButton.js +1 -1
  72. package/dist/components/navigation/SideBar.js +6 -1
  73. package/dist/components/navigation/breadcrumbs/Breadcrumbs.js +5 -1
  74. package/dist/components/navigation/sideBarNavLinkClass.js +1 -1
  75. package/dist/components/notifications/NotificationHeaderActions.js +2 -2
  76. package/dist/components/notifications/NotificationWrapper.js +1 -1
  77. package/dist/components/notifications/NotificationsList.js +3 -3
  78. package/dist/components/notifications/TypedNotification.js +3 -3
  79. package/dist/components/post/Feed.js +3 -3
  80. package/dist/components/post/FeedPost.d.ts +2 -1
  81. package/dist/components/post/FeedPost.js +11 -6
  82. package/dist/components/post/FeedPostContent.js +1 -1
  83. package/dist/components/post/FullPostLayout.js +11 -4
  84. package/dist/components/post/NewEventButton.js +1 -1
  85. package/dist/components/post/NewNoteButton.js +1 -1
  86. package/dist/components/post/PinnedPost.js +1 -1
  87. package/dist/components/post/ReplyBox.js +1 -1
  88. package/dist/components/post/feed/events/EventsFeed.js +3 -3
  89. package/dist/components/post/feed/threaded/ThreadPost.js +1 -1
  90. package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +3 -1
  91. package/dist/components/post/feed/threaded/ThreadedFeed.js +3 -3
  92. package/dist/components/post/pieces/Attachments.js +3 -3
  93. package/dist/components/post/pieces/EventMenu.js +1 -1
  94. package/dist/components/post/pieces/EventRsvpButton.js +3 -3
  95. package/dist/components/post/pieces/FeedPostStats.js +2 -2
  96. package/dist/components/post/pieces/GalleryModal.js +36 -5
  97. package/dist/components/post/pieces/PollContent.js +33 -14
  98. package/dist/components/post/pieces/PostActions.js +6 -45
  99. package/dist/components/post/pieces/PostInfoHeader.js +1 -1
  100. package/dist/components/post/pieces/PostMenu.js +35 -9
  101. package/dist/components/post/pieces/PostReactionHeader.js +1 -1
  102. package/dist/components/post/pieces/ShareMenu.js +4 -2
  103. package/dist/components/post/pieces/UnreadPostIndicator.d.ts +5 -3
  104. package/dist/components/post/pieces/UnreadPostIndicator.js +4 -3
  105. package/dist/components/post/pieces/modals/DeletePostModal.js +1 -1
  106. package/dist/components/post/pieces/modals/RepostModal.d.ts +5 -3
  107. package/dist/components/post/pieces/modals/RepostModal.js +8 -7
  108. package/dist/components/post/post-form/AttachmentCard.js +2 -2
  109. package/dist/components/post/post-form/ComposeAttachments.js +1 -1
  110. package/dist/components/post/post-form/DescriptionEditModal.js +1 -1
  111. package/dist/components/post/post-form/EditPostModal.js +22 -12
  112. package/dist/components/post/post-form/EventForm.js +2 -2
  113. package/dist/components/post/post-form/EventTypeSwitcher.js +1 -1
  114. package/dist/components/post/post-form/NewPostModal.d.ts +1 -1
  115. package/dist/components/post/post-form/NewPostModal.js +10 -10
  116. package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +2 -2
  117. package/dist/components/post/post-form/PollComposerFields.d.ts +2 -0
  118. package/dist/components/post/post-form/PollComposerFields.js +12 -8
  119. package/dist/components/post/post-form/PostAudienceSelector.js +3 -3
  120. package/dist/components/post/post-form/PostTypeSwitcher.js +1 -1
  121. package/dist/components/post/post-form/ReplyModal.js +9 -8
  122. package/dist/components/post/post-form/VisibilitySelector.js +1 -1
  123. package/dist/components/post/types/Article.js +2 -1
  124. package/dist/components/post/types/Event.js +1 -1
  125. package/dist/components/post/types/Note.js +2 -1
  126. package/dist/components/post/types/Poll.js +2 -1
  127. package/dist/components/post/types/event/CardEvent.js +2 -2
  128. package/dist/components/post/types/event/FullEvent.js +8 -8
  129. package/dist/components/post/types/event/ProfileEventRelationship.d.ts +1 -1
  130. package/dist/components/post/types/event/ProfileEventRelationship.js +38 -18
  131. package/dist/components/preview-link/LocalPreviewLink.js +1 -1
  132. package/dist/components/preview-link/RemotePreviewLink.js +5 -1
  133. package/dist/components/profile/Avatar.js +3 -2
  134. package/dist/components/profile/FollowUnfollowButton.js +2 -2
  135. package/dist/components/profile/ProfileBadge.js +1 -1
  136. package/dist/components/profile/ProfileCard.js +1 -1
  137. package/dist/components/profile/ProfileHeader.js +1 -1
  138. package/dist/components/profile/ProfilePageAction.js +3 -3
  139. package/dist/components/profile/ProfilePostsAndReplies.js +3 -1
  140. package/dist/components/profile/ProfileSelector.js +3 -3
  141. package/dist/components/profile/ProfilesInput.js +1 -1
  142. package/dist/components/profile/ReportProfileOrPostModal.js +6 -4
  143. package/dist/components/server-data/context.d.ts +8 -0
  144. package/dist/contexts/openpeeps/hooks/admin.d.ts +63 -16774
  145. package/dist/contexts/openpeeps/hooks/admin.js +34 -14
  146. package/dist/contexts/openpeeps/hooks/conversations.d.ts +330 -0
  147. package/dist/contexts/openpeeps/hooks/jams.d.ts +110 -0
  148. package/dist/contexts/openpeeps/hooks/jams.js +1 -1
  149. package/dist/contexts/openpeeps/hooks/other.d.ts +8 -0
  150. package/dist/contexts/openpeeps/hooks/posts.d.ts +933 -53
  151. package/dist/contexts/openpeeps/hooks/profiles.d.ts +220 -0
  152. package/dist/contexts/openpeeps/hooks/search.d.ts +330 -0
  153. package/dist/contexts/openpeeps/index.d.ts +1 -1
  154. package/dist/contexts/openpeeps/index.js +10 -2
  155. package/dist/contexts/router/index.d.ts +8 -3
  156. package/dist/contexts/router/index.js +7 -3
  157. package/dist/hooks/conversations/useCreateConversation.d.ts +124 -0
  158. package/dist/hooks/conversations/useCreateConversation.js +56 -0
  159. package/dist/hooks/groups/useJoinGroup.d.ts +8 -0
  160. package/dist/hooks/groups/useJoinGroup.js +23 -0
  161. package/dist/hooks/index.d.ts +6 -0
  162. package/dist/hooks/index.js +4 -0
  163. package/dist/hooks/jams/useLeaveCloseJam.d.ts +20 -0
  164. package/dist/hooks/jams/useLeaveCloseJam.js +59 -0
  165. package/dist/hooks/posts/useFeedPostActions.d.ts +18 -0
  166. package/dist/hooks/posts/useFeedPostActions.js +51 -0
  167. package/dist/index.d.ts +3 -0
  168. package/dist/index.js +3 -0
  169. package/dist/lib/Markdown.d.ts +14 -0
  170. package/dist/lib/Markdown.js +16 -0
  171. package/dist/lib/analyticsClicks.d.ts +12 -0
  172. package/dist/lib/analyticsClicks.js +64 -0
  173. package/dist/lib/auth.d.ts +8 -0
  174. package/dist/lib/auth.js +27 -0
  175. package/dist/lib/canvasUtils.d.ts +6 -0
  176. package/dist/lib/canvasUtils.js +62 -1
  177. package/dist/lib/groupCapabilityHelpers.d.ts +1 -1
  178. package/dist/lib/passwordStrength.d.ts +6 -0
  179. package/dist/lib/passwordStrength.js +26 -0
  180. package/dist/lib/postUnread.d.ts +7 -0
  181. package/dist/lib/postUnread.js +7 -0
  182. package/dist/lib/postViewCounter.d.ts +1 -1
  183. package/dist/lib/postViewCounter.js +3 -1
  184. package/dist/lib/routeHandles.d.ts +2 -0
  185. package/dist/lib/routeHandles.js +2 -0
  186. package/dist/lib/svgCover.d.ts +2 -0
  187. package/dist/lib/svgCover.js +18 -0
  188. package/dist/navigation/index.d.ts +11 -0
  189. package/dist/navigation/index.js +2 -0
  190. package/dist/navigation/menuItems.d.ts +8 -0
  191. package/dist/navigation/menuItems.js +83 -0
  192. package/dist/navigation/targets.d.ts +94 -0
  193. package/dist/navigation/targets.js +12 -0
  194. package/dist/pages/About.d.ts +1 -0
  195. package/dist/pages/About.js +19 -0
  196. package/dist/pages/CodeOfConduct.d.ts +1 -0
  197. package/dist/pages/CodeOfConduct.js +14 -0
  198. package/dist/pages/Explore.d.ts +1 -0
  199. package/dist/pages/Explore.js +132 -0
  200. package/dist/pages/Home.d.ts +6 -0
  201. package/dist/pages/Home.js +31 -0
  202. package/dist/pages/Members.d.ts +1 -0
  203. package/dist/pages/Members.js +35 -0
  204. package/dist/pages/NotFound.d.ts +1 -0
  205. package/dist/pages/NotFound.js +9 -0
  206. package/dist/pages/Notifications.d.ts +1 -0
  207. package/dist/pages/Notifications.js +8 -0
  208. package/dist/pages/PostDetail.d.ts +1 -0
  209. package/dist/pages/PostDetail.js +27 -0
  210. package/dist/pages/Profile.d.ts +1 -0
  211. package/dist/pages/Profile.js +20 -0
  212. package/dist/pages/Tags.d.ts +1 -0
  213. package/dist/pages/Tags.js +14 -0
  214. package/dist/pages/Welcome.d.ts +1 -0
  215. package/dist/pages/Welcome.js +89 -0
  216. package/dist/pages/admin/Analytics.d.ts +11 -0
  217. package/dist/pages/admin/Analytics.js +11 -0
  218. package/dist/pages/admin/ApiKeys.d.ts +1 -0
  219. package/dist/pages/admin/ApiKeys.js +141 -0
  220. package/dist/pages/admin/Backups.d.ts +1 -0
  221. package/dist/pages/admin/Backups.js +39 -0
  222. package/dist/pages/admin/ConfigEditor.d.ts +14 -0
  223. package/dist/pages/admin/ConfigEditor.js +91 -0
  224. package/dist/pages/admin/Configuration.d.ts +1 -0
  225. package/dist/pages/admin/Configuration.js +8 -0
  226. package/dist/pages/admin/ConfigurationCommunity.d.ts +1 -0
  227. package/dist/pages/admin/ConfigurationCommunity.js +7 -0
  228. package/dist/pages/admin/ConfigurationCommunityLanguage.d.ts +1 -0
  229. package/dist/pages/admin/ConfigurationCommunityLanguage.js +71 -0
  230. package/dist/pages/admin/ConfigurationEmail.d.ts +1 -0
  231. package/dist/pages/admin/ConfigurationEmail.js +97 -0
  232. package/dist/pages/admin/ConfigurationI18n.d.ts +1 -0
  233. package/dist/pages/admin/ConfigurationI18n.js +51 -0
  234. package/dist/pages/admin/Dashboard.d.ts +1 -0
  235. package/dist/pages/admin/Dashboard.js +40 -0
  236. package/dist/pages/admin/Db.d.ts +1 -0
  237. package/dist/pages/admin/Db.js +238 -0
  238. package/dist/pages/admin/Diagnostics.d.ts +1 -0
  239. package/dist/pages/admin/Diagnostics.js +8 -0
  240. package/dist/pages/admin/DiagnosticsEmail.d.ts +1 -0
  241. package/dist/pages/admin/DiagnosticsEmail.js +65 -0
  242. package/dist/pages/admin/DiagnosticsJob.d.ts +1 -0
  243. package/dist/pages/admin/DiagnosticsJob.js +51 -0
  244. package/dist/pages/admin/DiagnosticsLogs.d.ts +1 -0
  245. package/dist/pages/admin/DiagnosticsLogs.js +62 -0
  246. package/dist/pages/admin/DiagnosticsPerformance.d.ts +1 -0
  247. package/dist/pages/admin/DiagnosticsPerformance.js +34 -0
  248. package/dist/pages/admin/GroupMembers.d.ts +1 -0
  249. package/dist/pages/admin/GroupMembers.js +109 -0
  250. package/dist/pages/admin/Groups.d.ts +1 -0
  251. package/dist/pages/admin/Groups.js +61 -0
  252. package/dist/pages/admin/Invites.d.ts +1 -0
  253. package/dist/pages/admin/Invites.js +72 -0
  254. package/dist/pages/admin/Members.d.ts +1 -0
  255. package/dist/pages/admin/Members.js +49 -0
  256. package/dist/pages/admin/Moderation.d.ts +1 -0
  257. package/dist/pages/admin/Moderation.js +62 -0
  258. package/dist/pages/admin/Reports.d.ts +1 -0
  259. package/dist/pages/admin/Reports.js +178 -0
  260. package/dist/pages/admin/analytics/AnalyticsLayout.d.ts +14 -0
  261. package/dist/pages/admin/analytics/AnalyticsLayout.js +104 -0
  262. package/dist/pages/admin/analytics/AnalyticsRangeContext.d.ts +9 -0
  263. package/dist/pages/admin/analytics/AnalyticsRangeContext.js +9 -0
  264. package/dist/pages/admin/analytics/Content.d.ts +1 -0
  265. package/dist/pages/admin/analytics/Content.js +117 -0
  266. package/dist/pages/admin/analytics/Engagement.d.ts +1 -0
  267. package/dist/pages/admin/analytics/Engagement.js +220 -0
  268. package/dist/pages/admin/analytics/Groups.d.ts +1 -0
  269. package/dist/pages/admin/analytics/Groups.js +139 -0
  270. package/dist/pages/admin/analytics/Members.d.ts +1 -0
  271. package/dist/pages/admin/analytics/Members.js +96 -0
  272. package/dist/pages/admin/analytics/Overview.d.ts +1 -0
  273. package/dist/pages/admin/analytics/Overview.js +165 -0
  274. package/dist/pages/admin/analytics/ReportSettings.d.ts +1 -0
  275. package/dist/pages/admin/analytics/ReportSettings.js +62 -0
  276. package/dist/pages/admin/analytics/analyticsInfo.d.ts +3 -0
  277. package/dist/pages/admin/analytics/analyticsInfo.js +4 -0
  278. package/dist/pages/admin/analytics/downloadCsv.d.ts +2 -0
  279. package/dist/pages/admin/analytics/downloadCsv.js +20 -0
  280. package/dist/pages/admin/community/CommunityFavicons.d.ts +1 -0
  281. package/dist/pages/admin/community/CommunityFavicons.js +47 -0
  282. package/dist/pages/admin/community/CommunityInfo.d.ts +1 -0
  283. package/dist/pages/admin/community/CommunityInfo.js +35 -0
  284. package/dist/pages/admin/community/CommunityLinks.d.ts +1 -0
  285. package/dist/pages/admin/community/CommunityLinks.js +35 -0
  286. package/dist/pages/admin/community/CommunityMarkdownPage.d.ts +8 -0
  287. package/dist/pages/admin/community/CommunityMarkdownPage.js +35 -0
  288. package/dist/pages/admin/community/CommunityProfileFields.d.ts +1 -0
  289. package/dist/pages/admin/community/CommunityProfileFields.js +50 -0
  290. package/dist/pages/admin/community/CommunityRoles.d.ts +1 -0
  291. package/dist/pages/admin/community/CommunityRoles.js +109 -0
  292. package/dist/pages/admin/community/CommunityTheme.d.ts +1 -0
  293. package/dist/pages/admin/community/CommunityTheme.js +56 -0
  294. package/dist/pages/admin/community/useCommunityConfig.d.ts +168 -0
  295. package/dist/pages/admin/community/useCommunityConfig.js +28 -0
  296. package/dist/pages/admin/components/AdminCharts.d.ts +22 -0
  297. package/dist/pages/admin/components/AdminCharts.js +29 -0
  298. package/dist/pages/admin/components/AdminGroupCard.d.ts +6 -0
  299. package/dist/pages/admin/components/AdminGroupCard.js +42 -0
  300. package/dist/pages/admin/components/AdminInviteActions.d.ts +1 -0
  301. package/dist/pages/admin/components/AdminInviteActions.js +23 -0
  302. package/dist/pages/admin/components/InviteWithEmailModal.d.ts +3 -0
  303. package/dist/pages/admin/components/InviteWithEmailModal.js +82 -0
  304. package/dist/pages/admin/components/InviteWithLinkModal.d.ts +22 -0
  305. package/dist/pages/admin/components/InviteWithLinkModal.js +98 -0
  306. package/dist/pages/admin/components/ProfileRowActions.d.ts +5 -0
  307. package/dist/pages/admin/components/ProfileRowActions.js +131 -0
  308. package/dist/pages/admin/components/RestoreBackupModal.d.ts +4 -0
  309. package/dist/pages/admin/components/RestoreBackupModal.js +33 -0
  310. package/dist/pages/admin/components/RestoreTestBackupModal.d.ts +4 -0
  311. package/dist/pages/admin/components/RestoreTestBackupModal.js +36 -0
  312. package/dist/pages/articles/Edit.d.ts +1 -0
  313. package/dist/pages/articles/Edit.js +60 -0
  314. package/dist/pages/articles/Index.d.ts +1 -0
  315. package/dist/pages/articles/Index.js +18 -0
  316. package/dist/pages/articles/New.d.ts +1 -0
  317. package/dist/pages/articles/New.js +48 -0
  318. package/dist/pages/auth/Closed.d.ts +1 -0
  319. package/dist/pages/auth/Closed.js +14 -0
  320. package/dist/pages/auth/Login.d.ts +1 -0
  321. package/dist/pages/auth/Login.js +74 -0
  322. package/dist/pages/auth/OidcCallback.d.ts +5 -0
  323. package/dist/pages/auth/OidcCallback.js +31 -0
  324. package/dist/pages/auth/OidcPending.d.ts +5 -0
  325. package/dist/pages/auth/OidcPending.js +39 -0
  326. package/dist/pages/auth/Register.d.ts +4 -0
  327. package/dist/pages/auth/Register.js +124 -0
  328. package/dist/pages/auth/RegisterInvitation.d.ts +1 -0
  329. package/dist/pages/auth/RegisterInvitation.js +5 -0
  330. package/dist/pages/auth/RequestResetPassword.d.ts +1 -0
  331. package/dist/pages/auth/RequestResetPassword.js +50 -0
  332. package/dist/pages/auth/ResetPassword.d.ts +1 -0
  333. package/dist/pages/auth/ResetPassword.js +40 -0
  334. package/dist/pages/auth/SsoCallback.d.ts +1 -0
  335. package/dist/pages/auth/SsoCallback.js +34 -0
  336. package/dist/pages/auth/ValidateEmail.d.ts +6 -0
  337. package/dist/pages/auth/ValidateEmail.js +64 -0
  338. package/dist/pages/conversations/Index.d.ts +1 -0
  339. package/dist/pages/conversations/Index.js +58 -0
  340. package/dist/pages/conversations/Info.d.ts +1 -0
  341. package/dist/pages/conversations/Info.js +26 -0
  342. package/dist/pages/conversations/New.d.ts +1 -0
  343. package/dist/pages/conversations/New.js +8 -0
  344. package/dist/pages/conversations/Show.d.ts +1 -0
  345. package/dist/pages/conversations/Show.js +100 -0
  346. package/dist/pages/events/Edit.d.ts +1 -0
  347. package/dist/pages/events/Edit.js +69 -0
  348. package/dist/pages/events/Index.d.ts +1 -0
  349. package/dist/pages/events/Index.js +23 -0
  350. package/dist/pages/events/My.d.ts +1 -0
  351. package/dist/pages/events/My.js +24 -0
  352. package/dist/pages/events/New.d.ts +1 -0
  353. package/dist/pages/events/New.js +66 -0
  354. package/dist/pages/feeds/Bookmarks.d.ts +1 -0
  355. package/dist/pages/feeds/Bookmarks.js +10 -0
  356. package/dist/pages/feeds/Local.d.ts +1 -0
  357. package/dist/pages/feeds/Local.js +14 -0
  358. package/dist/pages/feeds/My.d.ts +1 -0
  359. package/dist/pages/feeds/My.js +12 -0
  360. package/dist/pages/groups/Edit.d.ts +1 -0
  361. package/dist/pages/groups/Edit.js +57 -0
  362. package/dist/pages/groups/Index.d.ts +1 -0
  363. package/dist/pages/groups/Index.js +50 -0
  364. package/dist/pages/groups/Info.d.ts +1 -0
  365. package/dist/pages/groups/Info.js +21 -0
  366. package/dist/pages/groups/Members.d.ts +1 -0
  367. package/dist/pages/groups/Members.js +28 -0
  368. package/dist/pages/groups/New.d.ts +1 -0
  369. package/dist/pages/groups/New.js +68 -0
  370. package/dist/pages/groups/Show.d.ts +1 -0
  371. package/dist/pages/groups/Show.js +64 -0
  372. package/dist/pages/index.d.ts +94 -0
  373. package/dist/pages/index.js +94 -0
  374. package/dist/pages/jams/Event.d.ts +8 -0
  375. package/dist/pages/jams/Event.js +57 -0
  376. package/dist/pages/jams/Index.d.ts +6 -0
  377. package/dist/pages/jams/Index.js +44 -0
  378. package/dist/pages/payment/Success.d.ts +1 -0
  379. package/dist/pages/payment/Success.js +30 -0
  380. package/dist/pages/plugins/Index.d.ts +1 -0
  381. package/dist/pages/plugins/Index.js +69 -0
  382. package/dist/pages/profile/Followers.d.ts +6 -0
  383. package/dist/pages/profile/Followers.js +28 -0
  384. package/dist/pages/settings/AccessTokens.d.ts +1 -0
  385. package/dist/pages/settings/AccessTokens.js +149 -0
  386. package/dist/pages/settings/Account.d.ts +1 -0
  387. package/dist/pages/settings/Account.js +81 -0
  388. package/dist/pages/settings/Billing.d.ts +1 -0
  389. package/dist/pages/settings/Billing.js +82 -0
  390. package/dist/pages/settings/Index.d.ts +1 -0
  391. package/dist/pages/settings/Index.js +13 -0
  392. package/dist/pages/settings/Language.d.ts +1 -0
  393. package/dist/pages/settings/Language.js +54 -0
  394. package/dist/pages/settings/NotificationPreferences.d.ts +1 -0
  395. package/dist/pages/settings/NotificationPreferences.js +180 -0
  396. package/dist/pages/settings/Notifications.d.ts +1 -0
  397. package/dist/pages/settings/Notifications.js +10 -0
  398. package/dist/pages/settings/PublicProfile.d.ts +1 -0
  399. package/dist/pages/settings/PublicProfile.js +135 -0
  400. package/dist/pages/settings/PushEnabledDevices.d.ts +1 -0
  401. package/dist/pages/settings/PushEnabledDevices.js +67 -0
  402. package/dist/pages/settings/Theme.d.ts +1 -0
  403. package/dist/pages/settings/Theme.js +37 -0
  404. package/dist/pages/test/Error.d.ts +1 -0
  405. package/dist/pages/test/Error.js +10 -0
  406. package/dist/pages/test/Markdown.d.ts +1 -0
  407. package/dist/pages/test/Markdown.js +32 -0
  408. package/dist/pwa/InstallPrompt.js +1 -1
  409. package/dist/pwa/NotificationPermissionPrompt.js +2 -2
  410. package/dist/pwa/UpdatePrompt.js +1 -1
  411. package/dist/react-native.d.ts +1 -0
  412. package/dist/react-native.js +1 -0
  413. package/dist/session/useSessionEvents.d.ts +3 -0
  414. package/dist/session/useSessionEvents.js +64 -0
  415. package/dist/stores/newPosts.d.ts +8 -8
  416. package/package.json +14 -9
  417. package/dist/components/jams/useJamLiveKitTheme.d.ts +0 -3
  418. package/dist/components/jams/useJamLiveKitTheme.js +0 -10
@@ -9,5 +9,5 @@ export function MobileMenuItem({ action, icon: Icon, title, }) {
9
9
  action();
10
10
  else
11
11
  router.navigate(action);
12
- }, children: _jsx("span", { className: cn('flex items-center gap-x-2', active ? 'text-primary-500 font-bold' : 'text-foreground/70'), children: _jsx(Icon, { className: "mr-1 h-5 w-5" }) }) }));
12
+ }, children: _jsx("span", { className: cn('flex items-center gap-x-2', active ? 'text-primary font-bold' : 'text-foreground/70'), children: _jsx(Icon, { className: "mr-1 h-5 w-5" }) }) }));
13
13
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Button } from '@openpeepshq/react-ui';
3
3
  export function PageHeaderAction({ title, action }) {
4
- return (_jsx(Button, { title: title, className: "h-6 w-fit text-sm", variant: "variant-ringed-surface", action: action
4
+ return (_jsx(Button, { title: title, className: "h-6 w-fit text-sm", variant: "outline", action: action
5
5
  ? () => Promise.resolve(action()).then(() => undefined)
6
6
  : undefined, children: _jsx("span", { children: title }) }));
7
7
  }
@@ -7,5 +7,5 @@ export function PlusButton() {
7
7
  if (!plusButton || Array.isArray(plusButton))
8
8
  return null;
9
9
  const Icon = plusButton.icon ?? Plus;
10
- return (_jsx("div", { className: "sticky bottom-1 flex w-full justify-end sm:bottom-4", children: _jsx(Button, { compact: true, title: plusButton.title ?? '', variant: "variant-filled-primary", action: plusButton.action, className: "z-10 mr-4 size-16 rounded-full sm:mb-4", "data-testid": "posts-new-post-button", children: _jsx(Icon, { size: 24 }) }) }));
10
+ return (_jsx("div", { className: "sticky bottom-1 flex w-full justify-end sm:bottom-4", children: _jsx(Button, { compact: true, title: plusButton.title ?? '', variant: "default", action: plusButton.action, className: "z-10 mr-4 size-16 rounded-full sm:mb-4", "data-testid": "posts-new-post-button", children: _jsx(Icon, { size: 24 }) }) }));
11
11
  }
@@ -4,6 +4,7 @@ import { Button, Link } from '@openpeepshq/react-ui';
4
4
  import { getTheme } from '@openpeepshq/common';
5
5
  import { useServerInfo } from '../server-data/index.js';
6
6
  import { useCurrentProfile, useCurrentProfileSettings, } from '../layout/IdentityContext.js';
7
+ import { useHrefOf } from '../../contexts/router/index.js';
7
8
  import { useT } from '../../i18n/index.js';
8
9
  /**
9
10
  * Translation of @openpeepshq/svelte/components/navigation/SideBar.svelte.
@@ -18,7 +19,11 @@ export function SideBar({ onClose, mainMenu, profileMenu } = {}) {
18
19
  const profileSettings = useCurrentProfileSettings();
19
20
  const profile = useCurrentProfile();
20
21
  const t = useT();
22
+ const hrefOf = useHrefOf();
21
23
  const logoSmall = getTheme(serverInfo.communityConfig, profileSettings).logoSmall;
22
24
  const { name, tagLine } = serverInfo.communityConfig?.info ?? {};
23
- return (_jsxs("div", { className: "relative h-screen w-full pt-3 md:h-full", children: [_jsxs("div", { className: "h-[90%] overflow-y-auto", children: [_jsxs("div", { className: "flex w-full items-center justify-between px-4 md:items-start", children: [_jsx("a", { href: "/", children: logoSmall && (_jsx("img", { src: logoSmall, alt: "logo", className: "h-10 object-contain" })) }), onClose && (_jsx("button", { type: "button", title: t('common.close'), className: "flex md:hidden", onClick: onClose, children: _jsx(X, {}) }))] }), profile?.type === 'local' ? (_jsxs(_Fragment, { children: [profileMenu, mainMenu] })) : (_jsx("div", { className: "mt-4 px-4", children: _jsxs("div", { className: "flex h-full flex-col items-center justify-center space-y-4", children: [name && (_jsx("p", { className: "text-center text-lg font-semibold", children: t('navigation.welcome', { name }) })), tagLine && _jsx("p", { className: "px-2 text-center text-sm", children: tagLine }), _jsx(Button, { title: t('navigation.joinCommunity'), variant: "variant-filled-primary", action: "/auth/register", children: t('navigation.joinCommunity') }), _jsxs("span", { className: "text-sm", children: [t('navigation.haveAccount'), ' ', _jsx(Link, { action: "/auth/login", children: t('navigation.logIn') })] })] }) }))] }), _jsx("div", { className: "bg-card absolute bottom-3", children: _jsx("p", { className: "ml-4 text-center", children: t('navigation.poweredBy') }) })] }));
25
+ const homeHref = hrefOf({ type: 'home' });
26
+ const registerHref = hrefOf({ type: 'auth', mode: 'register' });
27
+ const loginHref = hrefOf({ type: 'auth', mode: 'login' });
28
+ return (_jsxs("div", { className: "bg-background text-foreground relative h-screen w-full pt-3 md:h-full", children: [_jsxs("div", { className: "h-[90%] overflow-y-auto", children: [_jsxs("div", { className: "flex w-full items-center justify-between px-4 md:items-start", children: [_jsx("a", { href: homeHref, children: logoSmall && (_jsx("img", { src: logoSmall, alt: "logo", className: "h-10 object-contain" })) }), onClose && (_jsx("button", { type: "button", title: t('common.close'), className: "flex md:hidden", onClick: onClose, children: _jsx(X, {}) }))] }), profile?.type === 'local' ? (_jsxs(_Fragment, { children: [profileMenu, mainMenu] })) : (_jsx("div", { className: "mt-4 px-4", children: _jsxs("div", { className: "flex h-full flex-col items-center justify-center space-y-4", children: [name && (_jsx("p", { className: "text-center text-lg font-semibold", children: t('navigation.welcome', { name }) })), tagLine && _jsx("p", { className: "px-2 text-center text-sm", children: tagLine }), _jsx(Button, { title: t('navigation.joinCommunity'), variant: "default", action: registerHref, children: t('navigation.joinCommunity') }), _jsxs("span", { className: "text-sm", children: [t('navigation.haveAccount'), ' ', _jsx(Link, { action: loginHref, children: t('navigation.logIn') })] })] }) }))] }), _jsx("footer", { className: "bg-background absolute bottom-3", children: _jsx("p", { className: "ml-4 text-center", children: t('navigation.poweredBy') }) })] }));
24
29
  }
@@ -1,10 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Fragment } from 'react';
3
3
  import { useBreadcrumbs } from '../../../stores/index.js';
4
+ import { useT } from '../../../i18n/index.js';
4
5
  import { CrumbItem } from './Crumb.js';
5
6
  export function Breadcrumbs() {
6
7
  const breadcrumbs = useBreadcrumbs();
8
+ const t = useT();
7
9
  if (breadcrumbs.length === 0)
8
10
  return null;
9
- return (_jsx("ol", { className: "text-muted-foreground mb-3 flex flex-wrap items-center gap-1 px-4 text-sm", children: breadcrumbs.map((crumb, idx) => (_jsxs(Fragment, { children: [idx > 0 && (_jsx("li", { className: "op-crumb-separator", "aria-hidden": "true", children: "\u203A" })), _jsx(CrumbItem, { crumb: crumb })] }, `${crumb.text}-${idx}`))) }));
11
+ return (_jsx("nav", { "aria-label": t('navigation.breadcrumbs', {
12
+ defaultValue: 'Breadcrumbs',
13
+ }), children: _jsx("ol", { className: "text-muted-foreground mb-3 flex flex-wrap items-center gap-1 px-4 text-sm", children: breadcrumbs.map((crumb, idx) => (_jsxs(Fragment, { children: [idx > 0 && (_jsx("li", { className: "op-crumb-separator", "aria-hidden": "true", children: "\u203A" })), _jsx(CrumbItem, { crumb: crumb })] }, `${crumb.text}-${idx}`))) }) }));
10
14
  }
@@ -1,3 +1,3 @@
1
1
  import { cn } from '@openpeepshq/react-ui';
2
2
  /** Active/inactive classes for sidebar nav links (parity with Svelte `MenuItem.svelte`). */
3
- export const sideBarNavLinkClass = ({ isActive }) => cn('flex items-center gap-2 rounded-md px-3 py-2 hover:bg-muted', isActive ? 'text-primary font-bold' : 'text-foreground/70');
3
+ export const sideBarNavLinkClass = ({ isActive }) => cn('flex items-center gap-2 rounded-md px-3 py-2 hover:bg-surface', isActive ? 'text-primary font-bold' : 'text-foreground/70');
@@ -29,7 +29,7 @@ export function NotificationHeaderActions() {
29
29
  };
30
30
  return (_jsxs(_Fragment, { children: [_jsx(Button, { title: t('settings.notifications.feedPreferences.markAllRead', {
31
31
  defaultValue: 'Mark all as read',
32
- }), action: markAllRead, variant: "variant-ringed-surface", children: _jsx(CheckCheck, { size: 18 }) }), _jsx(Button, { title: t('settings.notifications.headerPreferencesTitle', {
32
+ }), action: markAllRead, variant: "outline", children: _jsx(CheckCheck, { size: 18 }) }), _jsx(Button, { title: t('settings.notifications.headerPreferencesTitle', {
33
33
  defaultValue: 'Notification preferences',
34
- }), action: "/settings/notifications/preferences", variant: "variant-ringed-surface", children: _jsx(Settings2, { size: 18 }) })] }));
34
+ }), action: "/settings/notifications/preferences", variant: "outline", children: _jsx(Settings2, { size: 18 }) })] }));
35
35
  }
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Dot, User, Users } from 'lucide-react';
3
3
  import { Avatar, ProfileLink } from '../profile/index.js';
4
4
  export function NotificationWrapper({ profile, seen = true, isGroup = false, showProfile = true, children, }) {
5
- return (_jsxs("div", { className: "hover:bg-surface-300 w-full items-start gap-3 overflow-hidden border-b px-4 py-5", children: [_jsx("div", { className: "flex justify-end", children: !seen ? _jsx(Dot, { className: "h-3 w-3" }) : null }), showProfile ? (_jsxs("div", { className: "flex items-center gap-4 px-6", children: [isGroup ? (_jsx(Users, { className: "text-surface-500 h-8 w-8" })) : (_jsx(User, { className: "text-surface-500 h-8 w-8" })), _jsx(ProfileLink, { profile: profile, children: _jsx(Avatar, { profile: profile, size: 3.5 }) })] })) : null, _jsx("div", { className: "flex flex-1 flex-col", children: children })] }));
5
+ return (_jsxs("article", { className: "hover:bg-surface w-full items-start gap-3 overflow-hidden border-b px-4 py-5", children: [_jsx("div", { className: "flex justify-end", children: !seen ? _jsx(Dot, { className: "h-3 w-3" }) : null }), showProfile ? (_jsxs("div", { className: "flex items-center gap-4 px-6", children: [isGroup ? (_jsx(Users, { className: "text-muted-foreground h-8 w-8" })) : (_jsx(User, { className: "text-muted-foreground h-8 w-8" })), _jsx(ProfileLink, { profile: profile, children: _jsx(Avatar, { profile: profile, size: 3.5 }) })] })) : null, _jsx("div", { className: "flex flex-1 flex-col", children: children })] }));
6
6
  }
@@ -79,10 +79,10 @@ export function NotificationsList({ pageSize = 15 }) {
79
79
  return () => observer.disconnect();
80
80
  }, [query]);
81
81
  if (query.isLoading) {
82
- return (_jsx("div", { className: "flex h-32 items-center justify-center text-sm text-muted-foreground", children: _jsx(LoadingSpinner, {}) }));
82
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
83
83
  }
84
84
  if (notifications.length === 0) {
85
- return (_jsx("p", { className: "px-5 py-8 text-sm text-muted-foreground", children: t('notification.empty', { defaultValue: 'No notifications' }) }));
85
+ return (_jsx("p", { className: "text-muted-foreground px-5 py-8 text-sm", children: t('notification.empty', { defaultValue: 'No notifications' }) }));
86
86
  }
87
- return (_jsxs("div", { className: "relative overflow-hidden", children: [notifications.map((n) => (_jsx(NotificationItem, { notification: n }, n.id))), _jsx("div", { ref: sentinelRef, "aria-hidden": "true", className: "h-8" }), query.isFetchingNextPage && (_jsx("div", { className: "flex justify-center py-4 text-sm text-muted-foreground", children: _jsx(LoadingSpinner, {}) }))] }));
87
+ return (_jsxs("div", { role: "feed", "aria-busy": query.isFetchingNextPage || undefined, className: "relative overflow-hidden", children: [notifications.map((n) => (_jsx(NotificationItem, { notification: n }, n.id))), _jsx("div", { ref: sentinelRef, "aria-hidden": "true", className: "h-8" }), query.isFetchingNextPage && (_jsx("div", { className: "text-muted-foreground flex justify-center py-4 text-sm", children: _jsx(LoadingSpinner, {}) }))] }));
88
88
  }
@@ -100,7 +100,7 @@ function NewGroupInvitationNotification({ notification, }) {
100
100
  const t = useT();
101
101
  const profile = notification.senderProfile;
102
102
  const group = notification.group;
103
- return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("div", { className: "w-full px-4 py-2", children: [_jsxs("div", { className: "mb-2 flex items-center gap-4", children: [_jsx(Users, { className: "text-surface-500 size-8" }), _jsx(GroupAvatarThumb, { group: group })] }), _jsxs("p", { className: "text-sm", children: [t('notification.newGroupInvitation.text', {
103
+ return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("div", { className: "w-full px-4 py-2", children: [_jsxs("div", { className: "mb-2 flex items-center gap-4", children: [_jsx(Users, { className: "text-muted-foreground size-8" }), _jsx(GroupAvatarThumb, { group: group })] }), _jsxs("p", { className: "text-sm", children: [t('notification.newGroupInvitation.text', {
104
104
  defaultValue: 'You were invited to',
105
105
  }), ' ', _jsx("a", { href: `/groups/@${group.handle}`, className: "font-semibold", children: groupName(group) }), _jsx("span", { className: "text-muted-foreground ml-2 text-xs", children: _jsx(UpdatingDate, { date: notification.createdAt }) })] })] }) }));
106
106
  }
@@ -108,7 +108,7 @@ function NewGroupMemberNotification({ notification, }) {
108
108
  const t = useT();
109
109
  const profile = notification.senderProfile;
110
110
  const group = notification.group;
111
- return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("div", { className: "w-full px-4 py-2", children: [_jsxs("div", { className: "mb-2 flex items-center gap-4", children: [_jsx(Users, { className: "text-surface-500 size-8" }), _jsx(GroupAvatarThumb, { group: group })] }), _jsxs("p", { className: "text-sm", children: [t('notification.newGroupMember.text', {
111
+ return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("div", { className: "w-full px-4 py-2", children: [_jsxs("div", { className: "mb-2 flex items-center gap-4", children: [_jsx(Users, { className: "text-muted-foreground size-8" }), _jsx(GroupAvatarThumb, { group: group })] }), _jsxs("p", { className: "text-sm", children: [t('notification.newGroupMember.text', {
112
112
  defaultValue: '{{profileName}} joined',
113
113
  profileName: profileName(profile),
114
114
  }), ' ', _jsx("a", { href: `/groups/@${group.handle}`, className: "font-semibold", children: groupName(group) }), _jsx("span", { className: "text-muted-foreground ml-2 text-xs", children: _jsx(UpdatingDate, { date: notification.createdAt }) })] })] }) }));
@@ -117,7 +117,7 @@ function GroupMemberExitNotification({ notification, }) {
117
117
  const t = useT();
118
118
  const profile = notification.senderProfile;
119
119
  const group = notification.group;
120
- return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("div", { className: "w-full px-4 py-2", children: [_jsxs("div", { className: "mb-2 flex items-center gap-4", children: [_jsx(Users, { className: "text-surface-500 size-8" }), _jsx(GroupAvatarThumb, { group: group })] }), _jsxs("p", { className: "text-sm", children: [t('notification.groupMemberExit.text', {
120
+ return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("div", { className: "w-full px-4 py-2", children: [_jsxs("div", { className: "mb-2 flex items-center gap-4", children: [_jsx(Users, { className: "text-muted-foreground size-8" }), _jsx(GroupAvatarThumb, { group: group })] }), _jsxs("p", { className: "text-sm", children: [t('notification.groupMemberExit.text', {
121
121
  defaultValue: '{{profileName}} left {{groupName}}',
122
122
  profileName: profileName(profile),
123
123
  groupName: groupName(group),
@@ -54,10 +54,10 @@ export function Feed({ query, inGroup = false, pinnedPostId }) {
54
54
  query.data?.pages,
55
55
  ]);
56
56
  if (query.isLoading) {
57
- return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
57
+ return (_jsx("div", { className: "bg-surface text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
58
58
  }
59
59
  if (posts.length === 0 && !pinnedPostId) {
60
- return (_jsxs("div", { className: "flex h-96 w-full flex-col items-center justify-center gap-y-4", children: [_jsx(Rss, { className: "text-surface-300 size-20" }), _jsx("p", { className: "text-xl", children: t('feed.empty', { defaultValue: 'No posts yet.' }) })] }));
60
+ return (_jsxs("div", { className: "bg-surface flex h-96 w-full flex-col items-center justify-center gap-y-4", children: [_jsx(Rss, { className: "text-muted-foreground size-20" }), _jsx("p", { className: "text-xl", children: t('feed.empty', { defaultValue: 'No posts yet.' }) })] }));
61
61
  }
62
- return (_jsxs("div", { className: "relative", children: [pinnedPostId ? (_jsx(PinnedPost, { pinnedPostId: pinnedPostId, inGroup: inGroup })) : null, posts.map((post) => (_jsx("a", { href: `/posts/${post.repost ? post.repost.id : post.id}`, className: "block", children: _jsx(FeedPost, { post: post, inGroup: inGroup, showReplyTo: true }) }, post.id))), _jsx("div", { ref: sentinelRef, "aria-hidden": "true", className: "h-8" }), query.isFetchingNextPage && (_jsx("div", { className: "text-muted-foreground flex justify-center py-4 text-sm", children: _jsx(LoadingSpinner, {}) }))] }));
62
+ return (_jsxs("div", { role: "feed", "aria-busy": query.isFetchingNextPage || undefined, className: "bg-surface relative flex min-h-full flex-col gap-0.5", children: [pinnedPostId ? (_jsx(PinnedPost, { pinnedPostId: pinnedPostId, inGroup: inGroup })) : null, posts.map((post) => (_jsx("a", { href: `/posts/${post.repost ? post.repost.id : post.id}`, className: "block", children: _jsx(FeedPost, { post: post, inGroup: inGroup, showReplyTo: true, className: "border-b-0" }) }, post.id))), _jsx("div", { ref: sentinelRef, "aria-hidden": "true", className: "h-8" }), query.isFetchingNextPage && (_jsx("div", { className: "text-muted-foreground flex justify-center py-4 text-sm", children: _jsx(LoadingSpinner, {}) }))] }));
63
63
  }
@@ -8,10 +8,11 @@ export interface FeedPostProps {
8
8
  showReplyTo?: boolean;
9
9
  /** Optional override for the body (used when threading). */
10
10
  content?: ReactNode;
11
+ className?: string;
11
12
  }
12
13
  /**
13
14
  * Single post card for the chronological feed:
14
15
  * shows a small reaction/reply/group banner, the author header, the body,
15
16
  * stats and actions. The body component dispatches on `post.type`.
16
17
  */
17
- export declare function FeedPost({ post, deleteCallback, noReactionHeader, inGroup, showReplyTo, content, }: FeedPostProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function FeedPost({ post, deleteCallback, noReactionHeader, inGroup, showReplyTo, content, className, }: FeedPostProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '@openpeepshq/react-ui';
2
3
  import { usePostViewRef } from '../../lib/postViewCounter.js';
3
- import { isUnreadPostForViewer } from '../../lib/postUnread.js';
4
+ import { isUnreadFeedActivityForViewer } from '../../lib/postUnread.js';
4
5
  import { useCurrentProfile } from '../layout/IdentityContext.js';
5
6
  import { FeedPostContent } from './FeedPostContent.js';
6
7
  import { PostInfoHeader } from './pieces/PostInfoHeader.js';
@@ -14,18 +15,22 @@ import { UnreadPostIndicator } from './pieces/UnreadPostIndicator.js';
14
15
  * shows a small reaction/reply/group banner, the author header, the body,
15
16
  * stats and actions. The body component dispatches on `post.type`.
16
17
  */
17
- export function FeedPost({ post, deleteCallback, noReactionHeader = false, inGroup = false, showReplyTo = false, content, }) {
18
+ export function FeedPost({ post, deleteCallback, noReactionHeader = false, inGroup = false, showReplyTo = false, content, className, }) {
18
19
  const me = useCurrentProfile();
19
20
  const displayedPost = post.repost ?? post;
20
- const isUnread = isUnreadPostForViewer(displayedPost, me?.id);
21
- const postViewRef = usePostViewRef(displayedPost.id, {
22
- groupId: displayedPost.groupId,
21
+ const isUnread = isUnreadFeedActivityForViewer(post, me?.id);
22
+ const postViewRef = usePostViewRef(post.id, {
23
+ groupId: post.groupId,
23
24
  adjustUnread: isUnread,
24
25
  });
25
26
  const hasReactionHeader = !noReactionHeader &&
26
27
  (!!post.repost || !!post.inReplyToId || (!!post.groupId && !inGroup));
28
+ const showsReplyTo = !!(showReplyTo && displayedPost.replyTo);
27
29
  const hasStats = !!(displayedPost?.repostCount ||
28
30
  displayedPost?.reactions?.length ||
29
31
  displayedPost?.replyCount);
30
- return (_jsxs("div", { ref: postViewRef, className: "relative min-w-0 border-b p-4", children: [_jsx(UnreadPostIndicator, { show: isUnread }), hasReactionHeader && (_jsx(PostReactionHeader, { post: post, inGroup: inGroup, deleteCallback: deleteCallback })), displayedPost.replyTo && showReplyTo && (_jsx("a", { href: `/posts/${displayedPost.replyTo.id}`, children: _jsx(ThreadPost, { post: displayedPost.replyTo, isParent: true, noActions: true, noMenu: true }) })), _jsxs("div", { children: [_jsx(PostInfoHeader, { post: displayedPost, showMenu: !hasReactionHeader, deleteCallback: deleteCallback }), _jsx("div", { className: "min-w-0 pb-2", children: content ?? _jsx(FeedPostContent, { post: displayedPost }) }), hasStats && _jsx(FeedPostStats, { post: displayedPost })] }), _jsx(PostActions, { post: displayedPost })] }));
32
+ return (_jsxs("article", { ref: postViewRef, className: cn('bg-background border-border relative min-w-0 border-b p-4', className), children: [_jsx(UnreadPostIndicator, { show: isUnread, variant: "corner" }), hasReactionHeader && (_jsx(PostReactionHeader, { post: post, inGroup: inGroup, deleteCallback: deleteCallback })), showsReplyTo && displayedPost.replyTo && (
33
+ // ThreadPost carries its own `p-2`, so pull it back to line its avatar
34
+ // and rail up with this post's avatar.
35
+ _jsx("a", { href: `/posts/${displayedPost.replyTo.id}`, className: "-ml-2 block", children: _jsx(ThreadPost, { post: displayedPost.replyTo, isParent: true, noActions: true, noMenu: true }) })), _jsxs("div", { className: "relative", children: [showsReplyTo && (_jsx("div", { className: "bg-border-2 pointer-events-none absolute left-6 top-0 h-2 w-px" })), _jsx(PostInfoHeader, { post: displayedPost, showMenu: !hasReactionHeader, deleteCallback: deleteCallback }), _jsx("div", { className: "min-w-0 pb-2", children: content ?? _jsx(FeedPostContent, { post: displayedPost }) }), hasStats && _jsx(FeedPostStats, { post: displayedPost })] }), _jsx(PostActions, { post: displayedPost })] }));
31
36
  }
@@ -5,7 +5,7 @@ import { FeedNote } from './types/Note.js';
5
5
  import { FeedPoll } from './types/Poll.js';
6
6
  export function FeedPostContent({ post }) {
7
7
  if (post.deletedAt) {
8
- return (_jsx("div", { className: "text-sm text-gray-500", children: "This post has been deleted." }));
8
+ return (_jsx("div", { className: "text-muted-foreground text-sm", children: "This post has been deleted." }));
9
9
  }
10
10
  switch (post.type) {
11
11
  case 'note':
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useMemo, useRef, useEffect } from 'react';
3
3
  import { buildThreads } from '@openpeepshq/common/lib';
4
4
  import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
@@ -6,18 +6,25 @@ import { useT } from '../../i18n/index.js';
6
6
  import { FeedPost } from './FeedPost.js';
7
7
  import { ThreadedFeed } from './feed/threaded/ThreadedFeed.js';
8
8
  import { ReplyBox } from './ReplyBox.js';
9
+ /**
10
+ * Shifts the compact thread rail (`p-2` + half a 3rem avatar = 2rem) onto the
11
+ * main post card's rail (`p-4` + half a 3rem avatar = 2.5rem).
12
+ */
13
+ const threadIndent = 'pl-2';
9
14
  export function FullPostLayout({ post, deleteCallback, children, }) {
10
15
  const t = useT();
11
16
  const { openpeepsApi } = useOpenpeeps();
12
17
  const contextQuery = openpeepsApi.usePostContext(post.id);
13
18
  const postRef = useRef(null);
14
- const ancestryThread = useMemo(() => (contextQuery.data ? buildThreads(contextQuery.data.ancestors)[0] : undefined), [contextQuery.data]);
19
+ const ancestryThread = useMemo(() => contextQuery.data
20
+ ? buildThreads(contextQuery.data.ancestors)[0]
21
+ : undefined, [contextQuery.data]);
15
22
  const descendentThreads = useMemo(() => (contextQuery.data && buildThreads(contextQuery.data.descendants)) || [], [contextQuery.data]);
16
23
  useEffect(() => {
17
24
  postRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' });
18
25
  }, [post.id]);
19
26
  if (contextQuery.isLoading) {
20
- return (_jsx("div", { className: "flex h-32 items-center justify-center text-sm text-muted-foreground", children: t('common.loading', { defaultValue: 'Loading…' }) }));
27
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.loading', { defaultValue: 'Loading…' }) }));
21
28
  }
22
- return (_jsxs(_Fragment, { children: [ancestryThread ? _jsx(ThreadedFeed, { thread: ancestryThread, isAncestors: true }) : null, _jsx("div", { ref: postRef, children: children ?? (_jsx(FeedPost, { post: post, deleteCallback: deleteCallback, noReactionHeader: true })) }), _jsx(ReplyBox, { post: post }), descendentThreads.map((thread) => (_jsx(ThreadedFeed, { thread: thread, isDescendants: true }, thread.id))), _jsx("div", { className: "h-[70vh]" })] }));
29
+ return (_jsxs(_Fragment, { children: [ancestryThread ? (_jsx("div", { className: threadIndent, children: _jsx(ThreadedFeed, { thread: ancestryThread, isAncestors: true }) })) : null, _jsxs("div", { ref: postRef, className: "relative", children: [children ?? (_jsx(FeedPost, { post: post, deleteCallback: deleteCallback, noReactionHeader: true })), ancestryThread ? (_jsx("div", { className: "bg-border-2 pointer-events-none absolute left-10 top-0 h-6 w-px" })) : null] }), _jsx(ReplyBox, { post: post }), descendentThreads.map((thread, index) => (_jsx("div", { className: threadIndent, children: _jsx(ThreadedFeed, { thread: thread, isDescendants: true, continuesBelow: index < descendentThreads.length - 1 }) }, thread.id))), _jsx("div", { className: "h-[70vh]" })] }));
23
30
  }
@@ -35,5 +35,5 @@ export function NewEventButton({ visibility, currentProfile, group, onNavigate,
35
35
  if (!canPost || !showButton) {
36
36
  return null;
37
37
  }
38
- return (_jsx("div", { className: "mb-4 p-4 pb-0", children: _jsxs(Button, { title: t('events.form.title', { defaultValue: 'New event' }), variant: "variant-filled-primary", action: openNewEvent, "data-testid": "events-new-event-button", children: [_jsx(CalendarPlus, { className: "mr-1 size-4" }), t('events.form.title', { defaultValue: 'New event' })] }) }));
38
+ return (_jsx("div", { className: "mb-4 p-4 pb-0", children: _jsxs(Button, { title: t('events.form.title', { defaultValue: 'New event' }), variant: "default", action: openNewEvent, "data-testid": "events-new-event-button", children: [_jsx(CalendarPlus, { className: "mr-1 size-4" }), t('events.form.title', { defaultValue: 'New event' })] }) }));
39
39
  }
@@ -34,5 +34,5 @@ export function NewNoteButton({ visibility, currentProfile, group, inline = fals
34
34
  if (!canPost || !inline) {
35
35
  return null;
36
36
  }
37
- return (_jsx("div", { className: "mb-4", children: _jsxs(Button, { title: t('posts.form.title', { defaultValue: 'New post' }), variant: "variant-filled-primary", action: openNewPost, "data-testid": "posts-new-post-button", children: [_jsx(Plus, { className: "mr-1 size-4" }), t('posts.form.newNote', { defaultValue: 'New post' })] }) }));
37
+ return (_jsx("div", { className: "mb-4", children: _jsxs(Button, { title: t('posts.form.title', { defaultValue: 'New post' }), variant: "default", action: openNewPost, "data-testid": "posts-new-post-button", children: [_jsx(Plus, { className: "mr-1 size-4" }), t('posts.form.newNote', { defaultValue: 'New post' })] }) }));
38
38
  }
@@ -11,5 +11,5 @@ export function PinnedPost({ pinnedPostId, inGroup = false }) {
11
11
  if (postQuery.isLoading || !post)
12
12
  return null;
13
13
  const href = `/posts/${post.repost ? post.repost.id : post.id}`;
14
- return (_jsxs("a", { href: href, className: "bg-surface-300 block", children: [_jsxs("div", { className: "px-5 pt-3 text-sm", children: [_jsx(Pin, { className: "mr-1 inline-block size-4" }), t('feed.pinned', { defaultValue: 'Pinned post' })] }), _jsx(FeedPost, { post: post, inGroup: inGroup })] }));
14
+ return (_jsxs("a", { href: href, className: "bg-surface block", children: [_jsxs("div", { className: "px-5 pt-3 text-sm", children: [_jsx(Pin, { className: "mr-1 inline-block size-4" }), t('feed.pinned', { defaultValue: 'Pinned post' })] }), _jsx(FeedPost, { post: post, inGroup: inGroup, className: "bg-surface border-b-0" })] }));
15
15
  }
@@ -24,7 +24,7 @@ export function ReplyBox({ post }) {
24
24
  ? t('posts.replyBox.reply', { defaultValue: 'Reply' })
25
25
  : t('posts.replyBox.logInToReply', {
26
26
  defaultValue: 'Log in to reply',
27
- }), onClick: handleClick, className: "flex w-full items-center gap-x-2 border-b-2 p-5", children: [_jsx(Avatar, { profile: profile, size: 2.5 }), _jsxs("span", { className: "bg-surface-200 hover:bg-surface-300 flex h-max w-full items-center justify-between rounded-full border-b border-t p-5", children: [_jsx("span", { children: t('posts.replyBox.addReplyPlaceholder', {
27
+ }), onClick: handleClick, className: "flex w-full items-center gap-x-2 border-b-2 p-5", children: [_jsx(Avatar, { profile: profile, size: 2.5 }), _jsxs("span", { className: "bg-surface-2 hover:bg-border-2 flex h-max w-full items-center justify-between rounded-full border-b border-t p-5", children: [_jsx("span", { children: t('posts.replyBox.addReplyPlaceholder', {
28
28
  defaultValue: 'Add a reply…',
29
29
  }) }), _jsx(Image, { size: 24 })] })] }));
30
30
  }
@@ -35,10 +35,10 @@ export function EventsFeed({ query }) {
35
35
  return () => observer.disconnect();
36
36
  }, [query]);
37
37
  if (query.isLoading) {
38
- return (_jsx("div", { className: "flex h-32 items-center justify-center text-sm text-muted-foreground", children: _jsx(LoadingSpinner, {}) }));
38
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
39
39
  }
40
40
  if (posts.length === 0) {
41
- return (_jsxs("div", { className: "flex h-96 w-full flex-col items-center justify-center gap-y-4", children: [_jsx(Rss, { className: "text-surface-300 size-20" }), _jsx("p", { className: "text-xl", children: t('feed.empty', { defaultValue: 'No events yet.' }) })] }));
41
+ return (_jsxs("div", { className: "flex h-96 w-full flex-col items-center justify-center gap-y-4", children: [_jsx(Rss, { className: "text-muted-foreground size-20" }), _jsx("p", { className: "text-xl", children: t('feed.empty', { defaultValue: 'No events yet.' }) })] }));
42
42
  }
43
- return (_jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [posts.map((post) => (_jsx(CardEvent, { post: post }, post.id))), _jsx("div", { ref: sentinelRef, "aria-hidden": "true", className: "col-span-full h-8" }), query.isFetchingNextPage ? (_jsx("div", { className: "col-span-full flex justify-center py-4 text-sm text-muted-foreground", children: _jsx(LoadingSpinner, {}) })) : null] }));
43
+ return (_jsxs("div", { role: "feed", "aria-busy": query.isFetchingNextPage || undefined, className: "grid gap-4 sm:grid-cols-2", children: [posts.map((post) => (_jsx(CardEvent, { post: post }, post.id))), _jsx("div", { ref: sentinelRef, "aria-hidden": "true", className: "col-span-full h-8" }), query.isFetchingNextPage ? (_jsx("div", { className: "text-muted-foreground col-span-full flex justify-center py-4 text-sm", children: _jsx(LoadingSpinner, {}) })) : null] }));
44
44
  }
@@ -15,5 +15,5 @@ export function ThreadPost({ post, isParent = false, isChild = false, noActions
15
15
  groupId: post.groupId,
16
16
  adjustUnread: isUnread,
17
17
  });
18
- return (_jsxs("div", { ref: postViewRef, className: "relative flex flex-row gap-2 p-2", children: [_jsx(UnreadPostIndicator, { show: isUnread, className: "left-0.5 top-5" }), _jsxs("div", { className: "relative w-12 shrink-0", children: [_jsx(ProfileLink, { profile: post.profile, children: _jsx(Avatar, { profile: post.profile, size: 3 }) }), isParent ? (_jsx("div", { className: "bg-surface-300 absolute left-6 top-12 h-[calc(100%-2rem)] w-px" })) : null, isChild ? (_jsx("div", { className: "bg-surface-300 absolute left-6 top-0 h-8 w-px" })) : null] }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "bg-surface-100 rounded-xl p-2", children: [_jsxs("div", { className: "mb-2 flex items-start justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx(ProfileLink, { profile: post.profile, className: "text-sm font-semibold hover:underline", children: post.profile.displayName || `@${post.profile.handle}` }), _jsxs("span", { className: "text-muted-foreground ml-2 text-xs", children: ["@", post.profile.handle] })] }), _jsxs("div", { className: "flex shrink-0 items-start gap-2", children: [_jsx("span", { className: "text-sm font-extralight", children: _jsx(UpdatingDate, { date: post.createdAt }) }), !noMenu ? _jsx(PostMenu, { post: post }) : null] })] }), _jsx(FeedPostContent, { post: post })] }), !noActions ? _jsx(PostActions, { post: post, compact: true }) : null] })] }));
18
+ return (_jsxs("article", { ref: postViewRef, className: "relative flex flex-row gap-2 p-2", children: [_jsx(UnreadPostIndicator, { show: isUnread, className: "left-0.5 top-5" }), _jsxs("div", { className: "relative w-12 shrink-0", children: [_jsx(ProfileLink, { profile: post.profile, children: _jsx(Avatar, { profile: post.profile, size: 3 }) }), isParent ? (_jsx("div", { className: "bg-border-2 absolute left-6 top-12 h-[calc(100%-2.5rem)] w-px" })) : null, isChild ? (_jsx("div", { className: "bg-border-2 absolute -top-2 left-6 h-2 w-px" })) : null] }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "bg-surface rounded-xl p-2", children: [_jsxs("div", { className: "mb-2 flex items-start justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx(ProfileLink, { profile: post.profile, className: "text-sm font-semibold hover:underline", children: post.profile.displayName || `@${post.profile.handle}` }), _jsxs("span", { className: "text-muted-foreground ml-2 text-xs", children: ["@", post.profile.handle] })] }), _jsxs("div", { className: "flex shrink-0 items-start gap-2", children: [_jsx("span", { className: "text-sm font-extralight", children: _jsx(UpdatingDate, { date: post.createdAt }) }), !noMenu ? _jsx(PostMenu, { post: post }) : null] })] }), _jsx(FeedPostContent, { post: post })] }), !noActions ? _jsx(PostActions, { post: post, compact: true }) : null] })] }));
19
19
  }
@@ -6,5 +6,7 @@ export interface ThreadedFeedProps {
6
6
  };
7
7
  isAncestors?: boolean;
8
8
  isDescendants?: boolean;
9
+ /** Another sibling thread follows, so the last post keeps its rail running down. */
10
+ continuesBelow?: boolean;
9
11
  }
10
- export declare function ThreadedFeed({ thread, pathSelector, isAncestors, isDescendants, }: ThreadedFeedProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function ThreadedFeed({ thread, pathSelector, isAncestors, isDescendants, continuesBelow, }: ThreadedFeedProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from 'react';
3
- import { collectPath, lastLongestPathSelector } from '../../../../lib/threadHelpers.js';
3
+ import { collectPath, lastLongestPathSelector, } from '../../../../lib/threadHelpers.js';
4
4
  import { ThreadPost } from './ThreadPost.js';
5
- export function ThreadedFeed({ thread, pathSelector = lastLongestPathSelector, isAncestors = false, isDescendants = false, }) {
5
+ export function ThreadedFeed({ thread, pathSelector = lastLongestPathSelector, isAncestors = false, isDescendants = false, continuesBelow = false, }) {
6
6
  const postList = useMemo(() => collectPath(pathSelector(thread)), [thread, pathSelector]);
7
- return (_jsx("div", { className: "w-full", children: postList.map((post, index) => (_jsx("a", { href: `/posts/${post.id}`, className: "block w-full", children: _jsx(ThreadPost, { post: post, isParent: index !== postList.length - 1 || isAncestors, isChild: index !== 0 || isDescendants }) }, post.id))) }));
7
+ return (_jsx("div", { className: "w-full", children: postList.map((post, index) => (_jsx("a", { href: `/posts/${post.id}`, className: "block w-full", children: _jsx(ThreadPost, { post: post, isParent: index !== postList.length - 1 || isAncestors || continuesBelow, isChild: index !== 0 || isDescendants }) }, post.id))) }));
8
8
  }
@@ -31,11 +31,11 @@ export function Attachments({ post }) {
31
31
  ? 'max-h-[600px] w-full object-contain'
32
32
  : 'h-full w-full object-cover';
33
33
  return (_jsxs(_Fragment, { children: [_jsx("div", { className: `mt-2 w-full gap-1 overflow-hidden rounded-md ${cols} ${height}`, children: attachments.map((att, idx) => {
34
- const tile = (_jsx(_Fragment, { children: isImage(att) && (att.previewUrl || att.url) ? (_jsx("img", { src: att.previewUrl ?? att.url ?? '', alt: att.description ?? `attachment ${idx + 1}`, className: mediaClass })) : isVideo(att) && (att.previewUrl || att.url) ? (_jsxs("div", { className: "relative h-full w-full", children: [_jsx("img", { src: att.previewUrl ?? att.url ?? '', alt: att.description ?? `attachment ${idx + 1}`, className: mediaClass }), _jsx(VideoPlayOverlay, { video: true })] })) : (_jsxs("div", { className: "flex min-h-24 w-full flex-col items-center justify-center gap-1 p-4 text-center text-xs text-muted-foreground", children: [_jsx("span", { className: "break-all font-medium text-foreground", children: att.filename ?? att.description ?? `Attachment ${idx + 1}` }), att.meta?.mimetype ? (_jsx("span", { className: "uppercase", children: att.meta.mimetype })) : null] })) }));
34
+ const tile = (_jsx(_Fragment, { children: isImage(att) && (att.previewUrl || att.url) ? (_jsx("img", { src: att.previewUrl ?? att.url ?? '', alt: att.description ?? `attachment ${idx + 1}`, className: mediaClass })) : isVideo(att) && (att.previewUrl || att.url) ? (_jsxs("div", { className: "relative h-full w-full", children: [_jsx("img", { src: att.previewUrl ?? att.url ?? '', alt: att.description ?? `attachment ${idx + 1}`, className: mediaClass }), _jsx(VideoPlayOverlay, { video: true })] })) : (_jsxs("div", { className: "text-muted-foreground flex min-h-24 w-full flex-col items-center justify-center gap-1 p-4 text-center text-xs", children: [_jsx("span", { className: "text-foreground break-all font-medium", children: att.filename ?? att.description ?? `Attachment ${idx + 1}` }), att.meta?.mimetype ? (_jsx("span", { className: "uppercase", children: att.meta.mimetype })) : null] })) }));
35
35
  if (staticRender) {
36
- return (_jsx("div", { className: `${tileClass} overflow-hidden bg-surface-100`, children: tile }, `${att.url ?? idx}-${idx}`));
36
+ return (_jsx("div", { className: `${tileClass} bg-surface overflow-hidden`, children: tile }, `${att.url ?? idx}-${idx}`));
37
37
  }
38
- return (_jsx("button", { type: "button", className: `${tileClass} overflow-hidden bg-surface-100`, onClick: (e) => {
38
+ return (_jsx("button", { type: "button", className: `${tileClass} bg-surface overflow-hidden`, onClick: (e) => {
39
39
  e.preventDefault();
40
40
  e.stopPropagation();
41
41
  setGalleryIndex(idx);
@@ -29,7 +29,7 @@ export function EventMenu({ post, menuButton }) {
29
29
  groupId: post.groupId,
30
30
  mentions: post.mentions,
31
31
  };
32
- navigate('/events/new');
32
+ navigate({ type: 'events', view: 'new' });
33
33
  };
34
34
  return (_jsxs(_Fragment, { children: [_jsxs(PopupMenu, { menuButton: menuButton, title: t('events.menu.title', { defaultValue: 'Event options' }), children: [_jsx(PopupMenuButton, { title: t('common.actions.edit', { defaultValue: 'Edit' }), text: t('common.actions.edit', { defaultValue: 'Edit' }), icon: Pencil, action: `/events/${post.id}/edit` }), canDeletePost ? (_jsx(PopupMenuButton, { title: t('common.actions.delete', { defaultValue: 'Delete' }), text: t('common.actions.delete', { defaultValue: 'Delete' }), icon: Trash, danger: true, action: () => setShowDelete(true) })) : null, _jsx(PopupMenuButton, { title: t('common.actions.duplicate', { defaultValue: 'Duplicate' }), text: t('common.actions.duplicate', { defaultValue: 'Duplicate' }), icon: CopyPlus, action: duplicate })] }), _jsx(DeletePostModal, { post: post, open: showDelete, onClose: () => setShowDelete(false), deleteCallback: () => window.history.back() })] }));
35
35
  }
@@ -44,7 +44,7 @@ export function EventRsvpButton({ post }) {
44
44
  }
45
45
  const full = atCapacity && myRsvp?.response !== 'yes';
46
46
  if (myRsvp && myRsvp.response !== 'no') {
47
- return (_jsxs("div", { className: "w-full", children: [_jsx(Button, { variant: "variant-ringed-secondary", className: "text-error w-full", action: () => respond('no'), children: t('posts.rsvp.cancelRegistration', {
47
+ return (_jsxs("div", { className: "w-full", children: [_jsx(Button, { variant: "outline", className: "text-error w-full", action: () => respond('no'), children: t('posts.rsvp.cancelRegistration', {
48
48
  defaultValue: 'Cancel registration',
49
49
  }) }), _jsx("p", { className: "mt-2 text-center text-sm", children: myRsvp.response === 'yes'
50
50
  ? t('posts.rsvp.attendingMessage', {
@@ -54,7 +54,7 @@ export function EventRsvpButton({ post }) {
54
54
  defaultValue: 'You responded maybe.',
55
55
  }) }), error ? (_jsx("p", { className: "text-error mt-2 text-center text-sm", children: error })) : null] }));
56
56
  }
57
- return (_jsxs("div", { className: "mt-4 w-full", children: [_jsxs("div", { className: "flex w-full gap-x-2", children: [_jsx(Button, { variant: "variant-filled-primary", className: "w-[70%]", disabled: full, action: () => respond('yes'), children: full
57
+ return (_jsxs("div", { className: "mt-4 w-full", children: [_jsxs("div", { className: "flex w-full gap-x-2", children: [_jsx(Button, { variant: "default", className: "w-[70%]", disabled: full, action: () => respond('yes'), children: full
58
58
  ? t('events.rsvp.full', { defaultValue: 'Event is full' })
59
- : t('posts.rsvp.register', { defaultValue: 'Register' }) }), !capacityEvent ? (_jsx(Button, { variant: "variant-ghost-primary", action: () => respond('tentative'), children: t('posts.rsvp.maybe', { defaultValue: 'Maybe' }) })) : null, _jsx(Button, { variant: "variant-ringed-primary", action: () => respond('no'), children: t('posts.rsvp.no', { defaultValue: 'No' }) })] }), error ? (_jsx("p", { className: "text-error mt-2 text-center text-sm", children: error })) : null] }));
59
+ : t('posts.rsvp.register', { defaultValue: 'Register' }) }), !capacityEvent ? (_jsx(Button, { variant: "ghost", action: () => respond('tentative'), children: t('posts.rsvp.maybe', { defaultValue: 'Maybe' }) })) : null, _jsx(Button, { variant: "outline", action: () => respond('no'), children: t('posts.rsvp.no', { defaultValue: 'No' }) })] }), error ? (_jsx("p", { className: "text-error mt-2 text-center text-sm", children: error })) : null] }));
60
60
  }
@@ -13,7 +13,7 @@ export function FeedPostStats({ post }) {
13
13
  e.stopPropagation();
14
14
  handler();
15
15
  };
16
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex justify-between pb-2 text-xs text-muted-foreground", children: [_jsx("div", { children: post?.reactions?.length ? (_jsx("button", { type: "button", title: t('posts.stats.viewReactions', {
16
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "text-muted-foreground flex justify-between pb-2 text-xs", children: [_jsx("div", { children: post?.reactions?.length ? (_jsx("button", { type: "button", title: t('posts.stats.viewReactions', {
17
17
  defaultValue: 'View reactions',
18
18
  }), className: "hover:underline", onClick: stop(() => setModal('reactions')), children: stats })) : null }), _jsxs("div", { className: "flex w-fit items-center gap-1", children: [post?.replyCount ? (_jsx("span", { children: t('posts.stats.repliesCount', {
19
19
  defaultValue: `${post.replyCount} replies`,
@@ -23,5 +23,5 @@ export function FeedPostStats({ post }) {
23
23
  }), className: "hover:underline", onClick: stop(() => setModal('reposts')), children: t('posts.stats.repostsCount', {
24
24
  defaultValue: `${post.repostCount} reposts`,
25
25
  count: post.repostCount,
26
- }) })) : null] })] }), _jsx(ReactionsModal, { reactions: post.reactions ?? [], open: modal === 'reactions', onClose: () => setModal(null) }), _jsx(RepostModal, { post: post, open: modal === 'reposts', onClose: () => setModal(null) })] }));
26
+ }) })) : null] })] }), _jsx(ReactionsModal, { reactions: post.reactions ?? [], open: modal === 'reactions', onClose: () => setModal(null) }), _jsx(RepostModal, { reposts: post.reposts ?? [], repostCount: post.repostCount ?? 0, open: modal === 'reposts', onClose: () => setModal(null) })] }));
27
27
  }
@@ -1,16 +1,47 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
2
+ import { useEffect, useState } from 'react';
3
+ import { createPortal } from 'react-dom';
3
4
  import { useT } from '../../../i18n/index.js';
4
5
  import { VideoPlayer } from './VideoPlayer.js';
6
+ const stop = (e) => {
7
+ e.preventDefault();
8
+ e.stopPropagation();
9
+ };
5
10
  export function GalleryModal({ attachments, initialIndex = 0, onClose, }) {
6
11
  const t = useT();
7
12
  const [index, setIndex] = useState(initialIndex);
8
13
  const attachment = attachments[index];
14
+ useEffect(() => {
15
+ const onKey = (e) => {
16
+ if (e.key === 'Escape')
17
+ onClose();
18
+ };
19
+ document.addEventListener('keydown', onKey);
20
+ return () => document.removeEventListener('keydown', onKey);
21
+ }, [onClose]);
9
22
  if (!attachment)
10
23
  return null;
11
- const prev = () => setIndex((i) => (i === 0 ? attachments.length - 1 : i - 1));
12
- const next = () => setIndex((i) => (i === attachments.length - 1 ? 0 : i + 1));
13
- return (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80", role: "dialog", "aria-modal": true, children: [attachments.length > 1 ? (_jsx("button", { type: "button", title: t('posts.gallery.previous', { defaultValue: 'Previous' }), className: "absolute left-2 top-1/2 z-50 -translate-y-1/2 rounded-md bg-white/15 p-4 text-xl font-bold shadow-xl md:left-4", onClick: prev, children: "\u2190" })) : null, _jsx("div", { className: "max-h-[90vh] max-w-[90vw] overflow-auto p-4", children: attachment.type === 'video' || attachment.meta?.mimetype?.startsWith('video/') ? (_jsx(VideoPlayer, { attachment: attachment, className: "max-h-[85vh] max-w-full" }, attachment.url)) : attachment.type === 'audio' || attachment.meta?.mimetype?.startsWith('audio/') ? (_jsx("audio", { src: attachment.url, controls: true, className: "w-full min-w-[280px]" })) : attachment.type === 'image' || attachment.meta?.mimetype?.startsWith('image/') ? (_jsx("img", { src: attachment.previewUrl ?? attachment.url ?? '', alt: attachment.description ?? '', className: "max-h-[85vh] max-w-full object-contain" })) : (_jsxs("div", { className: "bg-card space-y-3 rounded-md p-6 text-center", children: [_jsx("p", { className: "font-medium", children: attachment.filename ?? attachment.description ?? 'Document' }), attachment.url ? (_jsx("a", { href: attachment.url, target: "_blank", rel: "noreferrer", className: "text-primary underline", children: t('posts.gallery.openDocument', {
24
+ const prev = (e) => {
25
+ stop(e);
26
+ setIndex((i) => (i === 0 ? attachments.length - 1 : i - 1));
27
+ };
28
+ const next = (e) => {
29
+ stop(e);
30
+ setIndex((i) => (i === attachments.length - 1 ? 0 : i + 1));
31
+ };
32
+ const modal = (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80", role: "dialog", "aria-modal": true, onClick: (e) => {
33
+ stop(e);
34
+ onClose();
35
+ }, children: [attachments.length > 1 ? (_jsx("button", { type: "button", title: t('posts.gallery.previous', { defaultValue: 'Previous' }), className: "rounded-button absolute left-2 top-1/2 z-50 -translate-y-1/2 bg-white/15 p-4 text-xl font-bold shadow-xl md:left-4", onClick: prev, children: "\u2190" })) : null, _jsx("div", { className: "max-h-[90vh] max-w-[90vw] overflow-auto p-4", onClick: (e) => e.stopPropagation(), children: attachment.type === 'video' ||
36
+ attachment.meta?.mimetype?.startsWith('video/') ? (_jsx(VideoPlayer, { attachment: attachment, className: "max-h-[85vh] max-w-full" }, attachment.url)) : attachment.type === 'audio' ||
37
+ attachment.meta?.mimetype?.startsWith('audio/') ? (_jsx("audio", { src: attachment.url, controls: true, className: "w-full min-w-[280px]" })) : attachment.type === 'image' ||
38
+ attachment.meta?.mimetype?.startsWith('image/') ? (_jsx("img", { src: attachment.url ?? attachment.previewUrl ?? '', alt: attachment.description ?? '', className: "max-h-[85vh] max-w-full object-contain" })) : (_jsxs("div", { className: "bg-surface space-y-3 rounded-md p-6 text-center", children: [_jsx("p", { className: "font-medium", children: attachment.filename ?? attachment.description ?? 'Document' }), attachment.url ? (_jsx("a", { href: attachment.url, target: "_blank", rel: "noreferrer", className: "text-primary underline", children: t('posts.gallery.openDocument', {
14
39
  defaultValue: 'Open file',
15
- }) })) : null] })) }), attachments.length > 1 ? (_jsx("button", { type: "button", title: t('posts.gallery.next', { defaultValue: 'Next' }), className: "absolute right-2 top-1/2 z-50 -translate-y-1/2 rounded-md bg-white/15 p-4 text-xl font-bold shadow-xl md:right-4", onClick: next, children: "\u2192" })) : null, _jsx("button", { type: "button", title: t('posts.gallery.close', { defaultValue: 'Close' }), className: "fixed right-4 top-4 z-50 rounded-md bg-primary px-3 py-2 text-lg font-bold text-primary-foreground shadow-xl", onClick: onClose, children: "\u00D7" })] }));
40
+ }) })) : null] })) }), attachments.length > 1 ? (_jsx("button", { type: "button", title: t('posts.gallery.next', { defaultValue: 'Next' }), className: "rounded-button absolute right-2 top-1/2 z-50 -translate-y-1/2 bg-white/15 p-4 text-xl font-bold shadow-xl md:right-4", onClick: next, children: "\u2192" })) : null, _jsx("button", { type: "button", title: t('posts.gallery.close', { defaultValue: 'Close' }), className: "rounded-button bg-primary text-primary-foreground fixed right-4 top-4 z-50 px-3 py-2 text-lg font-bold shadow-xl", onClick: (e) => {
41
+ stop(e);
42
+ onClose();
43
+ }, children: "\u00D7" })] }));
44
+ return typeof document === 'undefined'
45
+ ? modal
46
+ : createPortal(modal, document.body);
16
47
  }
@@ -22,7 +22,7 @@ import { useAuthData, useCurrentProfile } from '../../layout/IdentityContext.js'
22
22
  import { useToast } from '../../layout/ToastProvider.js';
23
23
  import { useCapabilities } from '../../server-data/index.js';
24
24
  import { Avatar } from '../../profile/index.js';
25
- import { Button } from '@openpeepshq/react-ui';
25
+ import { Button, cn } from '@openpeepshq/react-ui';
26
26
  export function PollContent({ post }) {
27
27
  const t = useT();
28
28
  const { openpeepsApi } = useOpenpeeps();
@@ -38,9 +38,10 @@ export function PollContent({ post }) {
38
38
  const pollData = post.data;
39
39
  const { votes, voteCounts } = collectVotes(post);
40
40
  const hasPollEnded = !!(pollData.expiresAt && isPast(pollData.expiresAt));
41
- const hasVoted = !!(currentProfile &&
42
- (votes.find((v) => v?.profile?.id === currentProfile.id)?.selection
43
- ?.length ?? 0) > 0);
41
+ const ownSelection = currentProfile
42
+ ? (votes.find((v) => v?.profile?.id === currentProfile.id)?.selection ?? [])
43
+ : [];
44
+ const hasVoted = ownSelection.length > 0;
44
45
  const canVote = !!(currentProfile && !hasPollEnded && !hasVoted);
45
46
  const totalVotes = votes.length || 1;
46
47
  const handleVote = async () => {
@@ -90,20 +91,38 @@ export function PollContent({ post }) {
90
91
  }));
91
92
  }
92
93
  };
94
+ // The feed wraps each post in a link, so clicks inside the poll must not
95
+ // reach it. Clicks on the option controls are exempt: cancelling those
96
+ // reverts the checkbox/radio the browser just ticked, so a pending selection
97
+ // would never show. They are their own activation target, so the surrounding
98
+ // link does not navigate. Key events only stop propagation for the same
99
+ // reason — cancelling them swallows keyboard activation.
93
100
  const stopFeedNavigation = (e) => {
94
- e.preventDefault();
101
+ const target = e.target;
102
+ if (!target?.closest('input,label'))
103
+ e.preventDefault();
95
104
  e.stopPropagation();
96
105
  };
97
- return (_jsxs("div", { className: "bg-surface-100 rounded-lg px-4 py-4", onClick: stopFeedNavigation, onKeyDown: stopFeedNavigation, role: "presentation", children: [_jsx("div", { className: "space-y-4", children: pollData.options.map((option, index) => (_jsxs("div", { className: "flex items-center gap-2 py-2", children: [canVote ? (pollData.multiple ? (_jsx("input", { type: "checkbox", checked: selectedPollOptions.includes(index), onChange: () => setSelectedPollOptions((prev) => prev.includes(index)
98
- ? prev.filter((i) => i !== index)
99
- : [...prev, index]) })) : (_jsx("input", { type: "radio", name: `poll-${post.id}`, checked: selectedPollOption === index, onChange: () => setSelectedPollOption(index) }))) : null, _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-base", children: option.content }), _jsxs("div", { className: "flex items-center gap-2", children: [pollData.votersVisible ? (_jsx("div", { className: "flex -space-x-2", children: votes
100
- .filter((v) => v.selection.includes(index))
101
- .slice(0, 2)
102
- .map((vote) => (_jsx(Avatar, { profile: vote.profile, size: 1.5 }, vote.profile.id))) })) : null, _jsx("span", { children: voteCounts?.[index] ?? 0 })] })] }), _jsx("div", { className: "bg-surface-300 mt-2 h-2 overflow-hidden rounded-full", children: _jsx("div", { className: "bg-primary h-full rounded-full transition-all", style: {
103
- width: `${((voteCounts[index] ?? 0) / totalVotes) * 100}%`,
104
- } }) })] })] }, `${option.content}-${index}`))) }), canVote ? (_jsx(Button, { variant: "variant-filled-primary", className: "mt-4", title: t('posts.poll.vote', { defaultValue: 'Vote' }), action: handleVote, children: t('posts.form.poll.submit', { defaultValue: 'Vote' }) })) : null, _jsxs("div", { className: "text-muted-foreground mt-4 flex flex-wrap items-center gap-3 text-sm", children: [_jsxs("span", { children: [votes.length || 0, " ", t('posts.vote.count', { defaultValue: 'votes' })] }), pollData.expiresAt ? (_jsx("span", { children: hasPollEnded
106
+ return (_jsxs("div", { className: "bg-surface rounded-lg px-4 py-4", onClick: stopFeedNavigation, onKeyDown: (e) => e.stopPropagation(), role: "presentation", children: [_jsx("div", { className: "space-y-4", children: pollData.options.map((option, index) => {
107
+ const optionId = `poll-${post.id}-option-${index}`;
108
+ const isOwnChoice = ownSelection.includes(index);
109
+ // Kept visible (checked, disabled) once the viewer has voted so their
110
+ // own selection stays readable while the results show.
111
+ const hasControl = canVote || hasVoted;
112
+ const labelClass = cn('text-base', isOwnChoice && 'font-medium', canVote && 'cursor-pointer');
113
+ return (_jsxs("div", { className: "flex items-center gap-2 py-2", children: [hasControl ? (pollData.multiple ? (_jsx("input", { type: "checkbox", id: optionId, disabled: !canVote, checked: canVote
114
+ ? selectedPollOptions.includes(index)
115
+ : isOwnChoice, onChange: () => setSelectedPollOptions((prev) => prev.includes(index)
116
+ ? prev.filter((i) => i !== index)
117
+ : [...prev, index]) })) : (_jsx("input", { type: "radio", id: optionId, name: `poll-${post.id}`, disabled: !canVote, checked: canVote ? selectedPollOption === index : isOwnChoice, onChange: () => setSelectedPollOption(index) }))) : null, _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [hasControl ? (_jsx("label", { htmlFor: optionId, className: labelClass, children: option.content })) : (_jsx("span", { className: labelClass, children: option.content })), _jsxs("div", { className: "flex items-center gap-2", children: [pollData.votersVisible ? (_jsx("div", { className: "flex -space-x-2", children: votes
118
+ .filter((v) => v.selection.includes(index))
119
+ .slice(0, 2)
120
+ .map((vote) => (_jsx(Avatar, { profile: vote.profile, size: 1.5 }, vote.profile.id))) })) : null, _jsx("span", { children: voteCounts?.[index] ?? 0 })] })] }), _jsx("div", { className: "bg-surface mt-2 h-2 overflow-hidden rounded-full", children: _jsx("div", { className: "bg-primary h-full rounded-full transition-all", style: {
121
+ width: `${((voteCounts[index] ?? 0) / totalVotes) * 100}%`,
122
+ } }) })] })] }, `${option.content}-${index}`));
123
+ }) }), canVote ? (_jsx(Button, { variant: "default", className: "mt-4", title: t('posts.poll.vote', { defaultValue: 'Vote' }), action: handleVote, children: t('posts.form.poll.submit', { defaultValue: 'Vote' }) })) : null, _jsxs("div", { className: "text-muted-foreground mt-4 flex flex-wrap items-center gap-3 text-sm", children: [_jsxs("span", { children: [votes.length || 0, " ", t('posts.vote.count', { defaultValue: 'votes' })] }), pollData.expiresAt ? (_jsx("span", { children: hasPollEnded
105
124
  ? t('posts.poll.ended', { defaultValue: 'Poll ended' })
106
- : `${formatDistanceToNow(pollData.expiresAt)} ${t('posts.poll.timeLeft', { defaultValue: 'left' })}` })) : null, hasVoted && !hasPollEnded ? (_jsx(Button, { variant: "variant-ghost-primary", className: "h-auto min-h-0 px-0 font-semibold", title: t('posts.poll.undoVoteTitle', {
125
+ : `${formatDistanceToNow(pollData.expiresAt)} ${t('posts.poll.timeLeft', { defaultValue: 'left' })}` })) : null, hasVoted && !hasPollEnded ? (_jsx(Button, { variant: "ghost", className: "h-auto min-h-0 px-0 font-semibold", title: t('posts.poll.undoVoteTitle', {
107
126
  defaultValue: 'Undo your vote',
108
127
  }), action: handleClearVote, children: t('posts.poll.undoVote', { defaultValue: 'Undo vote' }) })) : null] })] }));
109
128
  }