@openpeepshq/react 0.2.3 โ†’ 0.2.4

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 (406) 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 +7 -2
  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/GalleryModal.js +36 -5
  96. package/dist/components/post/pieces/PollContent.js +4 -4
  97. package/dist/components/post/pieces/PostActions.js +6 -45
  98. package/dist/components/post/pieces/PostInfoHeader.js +1 -1
  99. package/dist/components/post/pieces/PostMenu.js +34 -8
  100. package/dist/components/post/pieces/PostReactionHeader.js +1 -1
  101. package/dist/components/post/pieces/ShareMenu.js +4 -2
  102. package/dist/components/post/pieces/UnreadPostIndicator.d.ts +5 -3
  103. package/dist/components/post/pieces/UnreadPostIndicator.js +4 -3
  104. package/dist/components/post/pieces/modals/DeletePostModal.js +1 -1
  105. package/dist/components/post/post-form/AttachmentCard.js +2 -2
  106. package/dist/components/post/post-form/ComposeAttachments.js +1 -1
  107. package/dist/components/post/post-form/DescriptionEditModal.js +1 -1
  108. package/dist/components/post/post-form/EditPostModal.js +22 -12
  109. package/dist/components/post/post-form/EventForm.js +2 -2
  110. package/dist/components/post/post-form/EventTypeSwitcher.js +1 -1
  111. package/dist/components/post/post-form/NewPostModal.d.ts +1 -1
  112. package/dist/components/post/post-form/NewPostModal.js +10 -10
  113. package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +2 -2
  114. package/dist/components/post/post-form/PollComposerFields.d.ts +2 -0
  115. package/dist/components/post/post-form/PollComposerFields.js +12 -8
  116. package/dist/components/post/post-form/PostAudienceSelector.js +3 -3
  117. package/dist/components/post/post-form/PostTypeSwitcher.js +1 -1
  118. package/dist/components/post/post-form/ReplyModal.js +9 -8
  119. package/dist/components/post/post-form/VisibilitySelector.js +1 -1
  120. package/dist/components/post/types/Article.js +2 -1
  121. package/dist/components/post/types/Event.js +1 -1
  122. package/dist/components/post/types/Note.js +2 -1
  123. package/dist/components/post/types/Poll.js +2 -1
  124. package/dist/components/post/types/event/CardEvent.js +2 -2
  125. package/dist/components/post/types/event/FullEvent.js +8 -8
  126. package/dist/components/post/types/event/ProfileEventRelationship.d.ts +1 -1
  127. package/dist/components/post/types/event/ProfileEventRelationship.js +38 -18
  128. package/dist/components/preview-link/LocalPreviewLink.js +1 -1
  129. package/dist/components/preview-link/RemotePreviewLink.js +5 -1
  130. package/dist/components/profile/Avatar.js +3 -2
  131. package/dist/components/profile/FollowUnfollowButton.js +2 -2
  132. package/dist/components/profile/ProfileBadge.js +1 -1
  133. package/dist/components/profile/ProfileCard.js +1 -1
  134. package/dist/components/profile/ProfileHeader.js +1 -1
  135. package/dist/components/profile/ProfilePageAction.js +3 -3
  136. package/dist/components/profile/ProfilePostsAndReplies.js +3 -1
  137. package/dist/components/profile/ProfileSelector.js +3 -3
  138. package/dist/components/profile/ProfilesInput.js +1 -1
  139. package/dist/components/profile/ReportProfileOrPostModal.js +6 -4
  140. package/dist/components/server-data/context.d.ts +8 -0
  141. package/dist/contexts/openpeeps/hooks/admin.d.ts +53 -0
  142. package/dist/contexts/openpeeps/hooks/admin.js +1 -0
  143. package/dist/contexts/openpeeps/hooks/jams.js +1 -1
  144. package/dist/contexts/openpeeps/hooks/other.d.ts +8 -0
  145. package/dist/contexts/openpeeps/index.js +10 -2
  146. package/dist/contexts/router/index.d.ts +8 -3
  147. package/dist/contexts/router/index.js +7 -3
  148. package/dist/hooks/conversations/useCreateConversation.d.ts +124 -0
  149. package/dist/hooks/conversations/useCreateConversation.js +56 -0
  150. package/dist/hooks/groups/useJoinGroup.d.ts +8 -0
  151. package/dist/hooks/groups/useJoinGroup.js +23 -0
  152. package/dist/hooks/index.d.ts +6 -0
  153. package/dist/hooks/index.js +4 -0
  154. package/dist/hooks/jams/useLeaveCloseJam.d.ts +20 -0
  155. package/dist/hooks/jams/useLeaveCloseJam.js +59 -0
  156. package/dist/hooks/posts/useFeedPostActions.d.ts +18 -0
  157. package/dist/hooks/posts/useFeedPostActions.js +51 -0
  158. package/dist/index.d.ts +3 -0
  159. package/dist/index.js +3 -0
  160. package/dist/lib/Markdown.d.ts +14 -0
  161. package/dist/lib/Markdown.js +16 -0
  162. package/dist/lib/analyticsClicks.d.ts +12 -0
  163. package/dist/lib/analyticsClicks.js +64 -0
  164. package/dist/lib/auth.d.ts +8 -0
  165. package/dist/lib/auth.js +27 -0
  166. package/dist/lib/canvasUtils.d.ts +6 -0
  167. package/dist/lib/canvasUtils.js +62 -1
  168. package/dist/lib/groupCapabilityHelpers.d.ts +1 -1
  169. package/dist/lib/passwordStrength.d.ts +6 -0
  170. package/dist/lib/passwordStrength.js +26 -0
  171. package/dist/lib/postViewCounter.d.ts +1 -1
  172. package/dist/lib/postViewCounter.js +3 -1
  173. package/dist/lib/routeHandles.d.ts +2 -0
  174. package/dist/lib/routeHandles.js +2 -0
  175. package/dist/lib/svgCover.d.ts +2 -0
  176. package/dist/lib/svgCover.js +18 -0
  177. package/dist/navigation/index.d.ts +11 -0
  178. package/dist/navigation/index.js +2 -0
  179. package/dist/navigation/menuItems.d.ts +8 -0
  180. package/dist/navigation/menuItems.js +83 -0
  181. package/dist/navigation/targets.d.ts +94 -0
  182. package/dist/navigation/targets.js +12 -0
  183. package/dist/pages/About.d.ts +1 -0
  184. package/dist/pages/About.js +19 -0
  185. package/dist/pages/CodeOfConduct.d.ts +1 -0
  186. package/dist/pages/CodeOfConduct.js +14 -0
  187. package/dist/pages/Explore.d.ts +1 -0
  188. package/dist/pages/Explore.js +132 -0
  189. package/dist/pages/Home.d.ts +6 -0
  190. package/dist/pages/Home.js +31 -0
  191. package/dist/pages/Members.d.ts +1 -0
  192. package/dist/pages/Members.js +35 -0
  193. package/dist/pages/NotFound.d.ts +1 -0
  194. package/dist/pages/NotFound.js +9 -0
  195. package/dist/pages/Notifications.d.ts +1 -0
  196. package/dist/pages/Notifications.js +8 -0
  197. package/dist/pages/PostDetail.d.ts +1 -0
  198. package/dist/pages/PostDetail.js +27 -0
  199. package/dist/pages/Profile.d.ts +1 -0
  200. package/dist/pages/Profile.js +20 -0
  201. package/dist/pages/Tags.d.ts +1 -0
  202. package/dist/pages/Tags.js +14 -0
  203. package/dist/pages/Welcome.d.ts +1 -0
  204. package/dist/pages/Welcome.js +89 -0
  205. package/dist/pages/admin/Analytics.d.ts +11 -0
  206. package/dist/pages/admin/Analytics.js +11 -0
  207. package/dist/pages/admin/ApiKeys.d.ts +1 -0
  208. package/dist/pages/admin/ApiKeys.js +141 -0
  209. package/dist/pages/admin/Backups.d.ts +1 -0
  210. package/dist/pages/admin/Backups.js +39 -0
  211. package/dist/pages/admin/ConfigEditor.d.ts +14 -0
  212. package/dist/pages/admin/ConfigEditor.js +91 -0
  213. package/dist/pages/admin/Configuration.d.ts +1 -0
  214. package/dist/pages/admin/Configuration.js +8 -0
  215. package/dist/pages/admin/ConfigurationCommunity.d.ts +1 -0
  216. package/dist/pages/admin/ConfigurationCommunity.js +7 -0
  217. package/dist/pages/admin/ConfigurationCommunityLanguage.d.ts +1 -0
  218. package/dist/pages/admin/ConfigurationCommunityLanguage.js +71 -0
  219. package/dist/pages/admin/ConfigurationEmail.d.ts +1 -0
  220. package/dist/pages/admin/ConfigurationEmail.js +97 -0
  221. package/dist/pages/admin/ConfigurationI18n.d.ts +1 -0
  222. package/dist/pages/admin/ConfigurationI18n.js +51 -0
  223. package/dist/pages/admin/Dashboard.d.ts +1 -0
  224. package/dist/pages/admin/Dashboard.js +40 -0
  225. package/dist/pages/admin/Db.d.ts +1 -0
  226. package/dist/pages/admin/Db.js +238 -0
  227. package/dist/pages/admin/Diagnostics.d.ts +1 -0
  228. package/dist/pages/admin/Diagnostics.js +8 -0
  229. package/dist/pages/admin/DiagnosticsEmail.d.ts +1 -0
  230. package/dist/pages/admin/DiagnosticsEmail.js +65 -0
  231. package/dist/pages/admin/DiagnosticsJob.d.ts +1 -0
  232. package/dist/pages/admin/DiagnosticsJob.js +51 -0
  233. package/dist/pages/admin/DiagnosticsLogs.d.ts +1 -0
  234. package/dist/pages/admin/DiagnosticsLogs.js +62 -0
  235. package/dist/pages/admin/DiagnosticsPerformance.d.ts +1 -0
  236. package/dist/pages/admin/DiagnosticsPerformance.js +34 -0
  237. package/dist/pages/admin/GroupMembers.d.ts +1 -0
  238. package/dist/pages/admin/GroupMembers.js +109 -0
  239. package/dist/pages/admin/Groups.d.ts +1 -0
  240. package/dist/pages/admin/Groups.js +61 -0
  241. package/dist/pages/admin/Invites.d.ts +1 -0
  242. package/dist/pages/admin/Invites.js +72 -0
  243. package/dist/pages/admin/Members.d.ts +1 -0
  244. package/dist/pages/admin/Members.js +49 -0
  245. package/dist/pages/admin/Moderation.d.ts +1 -0
  246. package/dist/pages/admin/Moderation.js +62 -0
  247. package/dist/pages/admin/Reports.d.ts +1 -0
  248. package/dist/pages/admin/Reports.js +178 -0
  249. package/dist/pages/admin/analytics/AnalyticsLayout.d.ts +14 -0
  250. package/dist/pages/admin/analytics/AnalyticsLayout.js +104 -0
  251. package/dist/pages/admin/analytics/AnalyticsRangeContext.d.ts +9 -0
  252. package/dist/pages/admin/analytics/AnalyticsRangeContext.js +9 -0
  253. package/dist/pages/admin/analytics/Content.d.ts +1 -0
  254. package/dist/pages/admin/analytics/Content.js +117 -0
  255. package/dist/pages/admin/analytics/Engagement.d.ts +1 -0
  256. package/dist/pages/admin/analytics/Engagement.js +220 -0
  257. package/dist/pages/admin/analytics/Groups.d.ts +1 -0
  258. package/dist/pages/admin/analytics/Groups.js +139 -0
  259. package/dist/pages/admin/analytics/Members.d.ts +1 -0
  260. package/dist/pages/admin/analytics/Members.js +96 -0
  261. package/dist/pages/admin/analytics/Overview.d.ts +1 -0
  262. package/dist/pages/admin/analytics/Overview.js +165 -0
  263. package/dist/pages/admin/analytics/ReportSettings.d.ts +1 -0
  264. package/dist/pages/admin/analytics/ReportSettings.js +62 -0
  265. package/dist/pages/admin/analytics/analyticsInfo.d.ts +3 -0
  266. package/dist/pages/admin/analytics/analyticsInfo.js +4 -0
  267. package/dist/pages/admin/analytics/downloadCsv.d.ts +2 -0
  268. package/dist/pages/admin/analytics/downloadCsv.js +20 -0
  269. package/dist/pages/admin/community/CommunityFavicons.d.ts +1 -0
  270. package/dist/pages/admin/community/CommunityFavicons.js +47 -0
  271. package/dist/pages/admin/community/CommunityInfo.d.ts +1 -0
  272. package/dist/pages/admin/community/CommunityInfo.js +35 -0
  273. package/dist/pages/admin/community/CommunityLinks.d.ts +1 -0
  274. package/dist/pages/admin/community/CommunityLinks.js +35 -0
  275. package/dist/pages/admin/community/CommunityMarkdownPage.d.ts +8 -0
  276. package/dist/pages/admin/community/CommunityMarkdownPage.js +35 -0
  277. package/dist/pages/admin/community/CommunityProfileFields.d.ts +1 -0
  278. package/dist/pages/admin/community/CommunityProfileFields.js +50 -0
  279. package/dist/pages/admin/community/CommunityRoles.d.ts +1 -0
  280. package/dist/pages/admin/community/CommunityRoles.js +109 -0
  281. package/dist/pages/admin/community/CommunityTheme.d.ts +1 -0
  282. package/dist/pages/admin/community/CommunityTheme.js +56 -0
  283. package/dist/pages/admin/community/useCommunityConfig.d.ts +168 -0
  284. package/dist/pages/admin/community/useCommunityConfig.js +28 -0
  285. package/dist/pages/admin/components/AdminCharts.d.ts +22 -0
  286. package/dist/pages/admin/components/AdminCharts.js +29 -0
  287. package/dist/pages/admin/components/AdminGroupCard.d.ts +6 -0
  288. package/dist/pages/admin/components/AdminGroupCard.js +42 -0
  289. package/dist/pages/admin/components/AdminInviteActions.d.ts +1 -0
  290. package/dist/pages/admin/components/AdminInviteActions.js +23 -0
  291. package/dist/pages/admin/components/InviteWithEmailModal.d.ts +3 -0
  292. package/dist/pages/admin/components/InviteWithEmailModal.js +82 -0
  293. package/dist/pages/admin/components/InviteWithLinkModal.d.ts +22 -0
  294. package/dist/pages/admin/components/InviteWithLinkModal.js +98 -0
  295. package/dist/pages/admin/components/ProfileRowActions.d.ts +5 -0
  296. package/dist/pages/admin/components/ProfileRowActions.js +131 -0
  297. package/dist/pages/admin/components/RestoreBackupModal.d.ts +4 -0
  298. package/dist/pages/admin/components/RestoreBackupModal.js +33 -0
  299. package/dist/pages/admin/components/RestoreTestBackupModal.d.ts +4 -0
  300. package/dist/pages/admin/components/RestoreTestBackupModal.js +36 -0
  301. package/dist/pages/articles/Edit.d.ts +1 -0
  302. package/dist/pages/articles/Edit.js +60 -0
  303. package/dist/pages/articles/Index.d.ts +1 -0
  304. package/dist/pages/articles/Index.js +18 -0
  305. package/dist/pages/articles/New.d.ts +1 -0
  306. package/dist/pages/articles/New.js +48 -0
  307. package/dist/pages/auth/Closed.d.ts +1 -0
  308. package/dist/pages/auth/Closed.js +14 -0
  309. package/dist/pages/auth/Login.d.ts +1 -0
  310. package/dist/pages/auth/Login.js +74 -0
  311. package/dist/pages/auth/OidcCallback.d.ts +5 -0
  312. package/dist/pages/auth/OidcCallback.js +31 -0
  313. package/dist/pages/auth/OidcPending.d.ts +5 -0
  314. package/dist/pages/auth/OidcPending.js +39 -0
  315. package/dist/pages/auth/Register.d.ts +4 -0
  316. package/dist/pages/auth/Register.js +124 -0
  317. package/dist/pages/auth/RegisterInvitation.d.ts +1 -0
  318. package/dist/pages/auth/RegisterInvitation.js +5 -0
  319. package/dist/pages/auth/RequestResetPassword.d.ts +1 -0
  320. package/dist/pages/auth/RequestResetPassword.js +50 -0
  321. package/dist/pages/auth/ResetPassword.d.ts +1 -0
  322. package/dist/pages/auth/ResetPassword.js +40 -0
  323. package/dist/pages/auth/SsoCallback.d.ts +1 -0
  324. package/dist/pages/auth/SsoCallback.js +34 -0
  325. package/dist/pages/auth/ValidateEmail.d.ts +6 -0
  326. package/dist/pages/auth/ValidateEmail.js +64 -0
  327. package/dist/pages/conversations/Index.d.ts +1 -0
  328. package/dist/pages/conversations/Index.js +58 -0
  329. package/dist/pages/conversations/Info.d.ts +1 -0
  330. package/dist/pages/conversations/Info.js +26 -0
  331. package/dist/pages/conversations/New.d.ts +1 -0
  332. package/dist/pages/conversations/New.js +8 -0
  333. package/dist/pages/conversations/Show.d.ts +1 -0
  334. package/dist/pages/conversations/Show.js +100 -0
  335. package/dist/pages/events/Edit.d.ts +1 -0
  336. package/dist/pages/events/Edit.js +69 -0
  337. package/dist/pages/events/Index.d.ts +1 -0
  338. package/dist/pages/events/Index.js +23 -0
  339. package/dist/pages/events/My.d.ts +1 -0
  340. package/dist/pages/events/My.js +24 -0
  341. package/dist/pages/events/New.d.ts +1 -0
  342. package/dist/pages/events/New.js +66 -0
  343. package/dist/pages/feeds/Bookmarks.d.ts +1 -0
  344. package/dist/pages/feeds/Bookmarks.js +10 -0
  345. package/dist/pages/feeds/Local.d.ts +1 -0
  346. package/dist/pages/feeds/Local.js +14 -0
  347. package/dist/pages/feeds/My.d.ts +1 -0
  348. package/dist/pages/feeds/My.js +12 -0
  349. package/dist/pages/groups/Edit.d.ts +1 -0
  350. package/dist/pages/groups/Edit.js +57 -0
  351. package/dist/pages/groups/Index.d.ts +1 -0
  352. package/dist/pages/groups/Index.js +50 -0
  353. package/dist/pages/groups/Info.d.ts +1 -0
  354. package/dist/pages/groups/Info.js +21 -0
  355. package/dist/pages/groups/Members.d.ts +1 -0
  356. package/dist/pages/groups/Members.js +28 -0
  357. package/dist/pages/groups/New.d.ts +1 -0
  358. package/dist/pages/groups/New.js +68 -0
  359. package/dist/pages/groups/Show.d.ts +1 -0
  360. package/dist/pages/groups/Show.js +64 -0
  361. package/dist/pages/index.d.ts +94 -0
  362. package/dist/pages/index.js +94 -0
  363. package/dist/pages/jams/Event.d.ts +8 -0
  364. package/dist/pages/jams/Event.js +57 -0
  365. package/dist/pages/jams/Index.d.ts +6 -0
  366. package/dist/pages/jams/Index.js +44 -0
  367. package/dist/pages/payment/Success.d.ts +1 -0
  368. package/dist/pages/payment/Success.js +30 -0
  369. package/dist/pages/plugins/Index.d.ts +1 -0
  370. package/dist/pages/plugins/Index.js +69 -0
  371. package/dist/pages/profile/Followers.d.ts +6 -0
  372. package/dist/pages/profile/Followers.js +28 -0
  373. package/dist/pages/settings/AccessTokens.d.ts +1 -0
  374. package/dist/pages/settings/AccessTokens.js +149 -0
  375. package/dist/pages/settings/Account.d.ts +1 -0
  376. package/dist/pages/settings/Account.js +81 -0
  377. package/dist/pages/settings/Billing.d.ts +1 -0
  378. package/dist/pages/settings/Billing.js +82 -0
  379. package/dist/pages/settings/Index.d.ts +1 -0
  380. package/dist/pages/settings/Index.js +13 -0
  381. package/dist/pages/settings/Language.d.ts +1 -0
  382. package/dist/pages/settings/Language.js +54 -0
  383. package/dist/pages/settings/NotificationPreferences.d.ts +1 -0
  384. package/dist/pages/settings/NotificationPreferences.js +180 -0
  385. package/dist/pages/settings/Notifications.d.ts +1 -0
  386. package/dist/pages/settings/Notifications.js +10 -0
  387. package/dist/pages/settings/PublicProfile.d.ts +1 -0
  388. package/dist/pages/settings/PublicProfile.js +135 -0
  389. package/dist/pages/settings/PushEnabledDevices.d.ts +1 -0
  390. package/dist/pages/settings/PushEnabledDevices.js +67 -0
  391. package/dist/pages/settings/Theme.d.ts +1 -0
  392. package/dist/pages/settings/Theme.js +37 -0
  393. package/dist/pages/test/Error.d.ts +1 -0
  394. package/dist/pages/test/Error.js +10 -0
  395. package/dist/pages/test/Markdown.d.ts +1 -0
  396. package/dist/pages/test/Markdown.js +32 -0
  397. package/dist/pwa/InstallPrompt.js +1 -1
  398. package/dist/pwa/NotificationPermissionPrompt.js +2 -2
  399. package/dist/pwa/UpdatePrompt.js +1 -1
  400. package/dist/react-native.d.ts +1 -0
  401. package/dist/react-native.js +1 -0
  402. package/dist/session/useSessionEvents.d.ts +3 -0
  403. package/dist/session/useSessionEvents.js +64 -0
  404. package/package.json +12 -7
  405. package/dist/components/jams/useJamLiveKitTheme.d.ts +0 -3
  406. 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,4 +1,5 @@
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
4
  import { isUnreadPostForViewer } from '../../lib/postUnread.js';
4
5
  import { useCurrentProfile } from '../layout/IdentityContext.js';
@@ -14,7 +15,7 @@ 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
21
  const isUnread = isUnreadPostForViewer(displayedPost, me?.id);
@@ -24,8 +25,12 @@ export function FeedPost({ post, deleteCallback, noReactionHeader = false, inGro
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
  }
@@ -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
  }
@@ -94,16 +94,16 @@ export function PollContent({ post }) {
94
94
  e.preventDefault();
95
95
  e.stopPropagation();
96
96
  };
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)
97
+ return (_jsxs("div", { className: "bg-surface 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
98
  ? prev.filter((i) => i !== index)
99
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
100
  .filter((v) => v.selection.includes(index))
101
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: {
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 mt-2 h-2 overflow-hidden rounded-full", children: _jsx("div", { className: "bg-primary h-full rounded-full transition-all", style: {
103
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
104
+ } }) })] })] }, `${option.content}-${index}`))) }), 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
105
  ? 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', {
106
+ : `${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
107
  defaultValue: 'Undo your vote',
108
108
  }), action: handleClearVote, children: t('posts.poll.undoVote', { defaultValue: 'Undo vote' }) })) : null] })] }));
109
109
  }
@@ -1,61 +1,22 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { MessageCircle, Repeat2, ThumbsUp } from 'lucide-react';
2
+ import { Reply, Repeat2, ThumbsUp } from 'lucide-react';
4
3
  import { Button } from '@openpeepshq/react-ui';
5
- import { useOpenpeeps } from '../../../contexts/openpeeps/index.js';
6
4
  import { useT } from '../../../i18n/index.js';
7
- import { useCurrentProfile } from '../../layout/IdentityContext.js';
5
+ import { useFeedPostActions } from '../../../hooks/posts/useFeedPostActions.js';
8
6
  import { postReactionStats } from '../helpers.js';
9
- import { useReplyModal } from '../post-form/ReplyModalContext.js';
10
7
  export function PostActions({ post, compact = false }) {
11
8
  const t = useT();
12
- const me = useCurrentProfile();
13
- const { openpeepsApi } = useOpenpeeps();
14
- const { openReply } = useReplyModal();
15
- const repostsQuery = openpeepsApi.useCurrentProfileReposts();
16
- const reactToPost = openpeepsApi.reactToPostAction({ id: post.id });
17
- const retractReaction = openpeepsApi.retractPostReactionAction({
18
- id: post.id,
19
- });
20
- const repostPost = openpeepsApi.repostPostAction({ id: post.id });
21
- const deletePost = openpeepsApi.deletePostAction({ id: post.id });
22
- const myRepost = useMemo(() => repostsQuery.data?.find((p) => p.repost?.id === post.id), [repostsQuery.data, post.id]);
23
- const iReacted = useMemo(() => !!post.reactions?.some((r) => r.profile.id === me?.id), [post.reactions, me?.id]);
9
+ const { me, myRepost, iReacted, disabledForGroup, reply, toggleRepost, toggleReaction, } = useFeedPostActions(post);
24
10
  if (!me)
25
11
  return null;
26
- const isGroupPost = !!post.groupId;
27
- const membershipExists = !!me.memberships?.some((m) => m.group.id === post.group?.id);
28
- const disabledForGroup = isGroupPost && !membershipExists;
29
- const stop = (handler) => (e) => {
30
- e.preventDefault();
31
- e.stopPropagation();
32
- handler();
33
- };
34
- const handleReply = () => openReply(post);
35
- const handleRepost = async () => {
36
- if (myRepost) {
37
- await deletePost({ id: myRepost.id });
38
- }
39
- else {
40
- await repostPost(undefined);
41
- }
42
- await repostsQuery.refetch();
43
- };
44
- const handleReaction = async () => {
45
- if (iReacted) {
46
- await retractReaction(undefined);
47
- }
48
- else {
49
- await reactToPost({ reaction: '๐Ÿ‘' });
50
- }
51
- };
12
+ const actionClass = 'hover:bg-surface rounded-button flex gap-2 p-2 text-sm disabled:opacity-60';
52
13
  const replyLabel = t('posts.footer.reply', { defaultValue: 'Reply' });
53
14
  const repostLabel = t('posts.footer.repost', { defaultValue: 'Repost' });
54
15
  const likeLabel = t('posts.footer.like', { defaultValue: 'Like' });
55
- return (_jsxs("div", { className: `mx-auto grid w-full grid-cols-3 items-center p-2 ${compact ? '' : 'border-t'}`, onClick: (e) => {
16
+ return (_jsxs("div", { className: "mx-auto grid w-full grid-cols-3 items-center p-2", onClick: (e) => {
56
17
  e.preventDefault();
57
18
  e.stopPropagation();
58
- }, onKeyDown: (e) => e.stopPropagation(), role: "presentation", children: [_jsxs("button", { type: "button", className: "hover:bg-surface-200 flex gap-2 justify-self-start rounded-md p-2 text-sm disabled:opacity-60", title: t('posts.actions.reply', { defaultValue: 'Reply' }), onClick: stop(handleReply), disabled: disabledForGroup, children: [_jsx(MessageCircle, { className: "h-4 w-4" }), compact ? post.replyCount || null : replyLabel] }), _jsxs(Button, { type: "button", className: `hover:bg-surface-200 flex gap-2 justify-self-center rounded-md p-2 text-sm disabled:opacity-60 ${myRepost ? 'text-primary' : ''}`, title: t('posts.actions.repost', { defaultValue: 'Repost' }), action: handleRepost, disabled: disabledForGroup, spinnerOnlyOnLoading: true, "data-testid": "posts-repost-button", children: [_jsx(Repeat2, { className: "h-4 w-4" }), compact ? post.repostCount || null : repostLabel] }), _jsxs(Button, { type: "button", className: `hover:bg-surface-200 flex gap-2 justify-self-end rounded-md p-2 text-sm disabled:opacity-60 ${iReacted ? 'text-primary' : ''}`, title: t('posts.actions.react', { defaultValue: 'React' }), action: handleReaction, disabled: disabledForGroup, spinnerOnlyOnLoading: true, children: [_jsx(ThumbsUp, { className: "h-4 w-4" }), compact
19
+ }, onKeyDown: (e) => e.stopPropagation(), role: "presentation", children: [_jsxs(Button, { variant: "unstyled", className: `${actionClass} justify-self-start`, title: t('posts.actions.reply', { defaultValue: 'Reply' }), action: reply, disabled: disabledForGroup, children: [_jsx(Reply, { className: "h-4 w-4" }), compact ? post.replyCount || null : replyLabel] }), _jsxs(Button, { variant: "unstyled", className: `${actionClass} justify-self-center ${myRepost ? 'text-primary' : ''}`, title: t('posts.actions.repost', { defaultValue: 'Repost' }), action: toggleRepost, disabled: disabledForGroup, spinnerOnlyOnLoading: true, "data-testid": "posts-repost-button", children: [_jsx(Repeat2, { className: "h-4 w-4" }), compact ? post.repostCount || null : repostLabel] }), _jsxs(Button, { variant: "unstyled", className: `${actionClass} justify-self-end ${iReacted ? 'text-primary' : ''}`, title: t('posts.actions.react', { defaultValue: 'React' }), action: toggleReaction, disabled: disabledForGroup, spinnerOnlyOnLoading: true, children: [_jsx(ThumbsUp, { className: "h-4 w-4" }), compact
59
20
  ? post.reactions?.length
60
21
  ? ` ยท ${postReactionStats(post)}`
61
22
  : null