@openpeepshq/react 0.2.3

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 (558) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +1 -0
  3. package/dist/auth/credentials/index.d.ts +11 -0
  4. package/dist/auth/credentials/index.js +57 -0
  5. package/dist/auth/credentials/types.d.ts +6 -0
  6. package/dist/auth/credentials/types.js +1 -0
  7. package/dist/components/accounts/SignUpLoginModal.d.ts +9 -0
  8. package/dist/components/accounts/SignUpLoginModal.js +19 -0
  9. package/dist/components/accounts/SignUpLoginModalContext.d.ts +10 -0
  10. package/dist/components/accounts/SignUpLoginModalContext.js +16 -0
  11. package/dist/components/accounts/index.d.ts +3 -0
  12. package/dist/components/accounts/index.js +2 -0
  13. package/dist/components/configuration/ConfigurationCategory.d.ts +12 -0
  14. package/dist/components/configuration/ConfigurationCategory.js +61 -0
  15. package/dist/components/configuration/ConfigurationList.d.ts +10 -0
  16. package/dist/components/configuration/ConfigurationList.js +30 -0
  17. package/dist/components/configuration/ConfigurationTree.d.ts +8 -0
  18. package/dist/components/configuration/ConfigurationTree.js +20 -0
  19. package/dist/components/configuration/ConfigurationValueEditor.d.ts +11 -0
  20. package/dist/components/configuration/ConfigurationValueEditor.js +45 -0
  21. package/dist/components/configuration/index.d.ts +4 -0
  22. package/dist/components/configuration/index.js +4 -0
  23. package/dist/components/conversations/ConversationMessageBubble.d.ts +4 -0
  24. package/dist/components/conversations/ConversationMessageBubble.js +10 -0
  25. package/dist/components/conversations/CreateNewConversation.d.ts +8 -0
  26. package/dist/components/conversations/CreateNewConversation.js +62 -0
  27. package/dist/components/conversations/CreateNewConversationContext.d.ts +15 -0
  28. package/dist/components/conversations/CreateNewConversationContext.js +18 -0
  29. package/dist/components/conversations/DirectMessagesHeaderActions.d.ts +1 -0
  30. package/dist/components/conversations/DirectMessagesHeaderActions.js +10 -0
  31. package/dist/components/conversations/MessageInThread.d.ts +13 -0
  32. package/dist/components/conversations/MessageInThread.js +41 -0
  33. package/dist/components/conversations/index.d.ts +8 -0
  34. package/dist/components/conversations/index.js +5 -0
  35. package/dist/components/form/HeaderAvatarInput.d.ts +13 -0
  36. package/dist/components/form/HeaderAvatarInput.js +16 -0
  37. package/dist/components/form/ImageEditModal.d.ts +23 -0
  38. package/dist/components/form/ImageEditModal.js +75 -0
  39. package/dist/components/form/ImageInput.d.ts +32 -0
  40. package/dist/components/form/ImageInput.js +65 -0
  41. package/dist/components/form/LocationInput.d.ts +20 -0
  42. package/dist/components/form/LocationInput.js +59 -0
  43. package/dist/components/form/index.d.ts +8 -0
  44. package/dist/components/form/index.js +4 -0
  45. package/dist/components/groups/AddGroupMemberModal.d.ts +6 -0
  46. package/dist/components/groups/AddGroupMemberModal.js +40 -0
  47. package/dist/components/groups/AddGroupMembersButton.d.ts +5 -0
  48. package/dist/components/groups/AddGroupMembersButton.js +17 -0
  49. package/dist/components/groups/ChangeGroupRolesModal.d.ts +7 -0
  50. package/dist/components/groups/ChangeGroupRolesModal.js +45 -0
  51. package/dist/components/groups/ConfirmGroupExitModal.d.ts +6 -0
  52. package/dist/components/groups/ConfirmGroupExitModal.js +35 -0
  53. package/dist/components/groups/ConfirmMemberRemovalModal.d.ts +7 -0
  54. package/dist/components/groups/ConfirmMemberRemovalModal.js +33 -0
  55. package/dist/components/groups/DeleteGroupModal.d.ts +6 -0
  56. package/dist/components/groups/DeleteGroupModal.js +34 -0
  57. package/dist/components/groups/GroupAvatar.d.ts +14 -0
  58. package/dist/components/groups/GroupAvatar.js +32 -0
  59. package/dist/components/groups/GroupCard.d.ts +19 -0
  60. package/dist/components/groups/GroupCard.js +12 -0
  61. package/dist/components/groups/GroupFeed.d.ts +9 -0
  62. package/dist/components/groups/GroupFeed.js +14 -0
  63. package/dist/components/groups/GroupForm.d.ts +7 -0
  64. package/dist/components/groups/GroupForm.js +73 -0
  65. package/dist/components/groups/GroupHeader.d.ts +5 -0
  66. package/dist/components/groups/GroupHeader.js +14 -0
  67. package/dist/components/groups/GroupMembersList.d.ts +5 -0
  68. package/dist/components/groups/GroupMembersList.js +38 -0
  69. package/dist/components/groups/GroupOptionsMenu.d.ts +5 -0
  70. package/dist/components/groups/GroupOptionsMenu.js +61 -0
  71. package/dist/components/groups/GroupShareMenu.d.ts +5 -0
  72. package/dist/components/groups/GroupShareMenu.js +29 -0
  73. package/dist/components/groups/JoinGroupButton.d.ts +6 -0
  74. package/dist/components/groups/JoinGroupButton.js +28 -0
  75. package/dist/components/groups/index.d.ts +30 -0
  76. package/dist/components/groups/index.js +15 -0
  77. package/dist/components/index.d.ts +15 -0
  78. package/dist/components/index.js +15 -0
  79. package/dist/components/jams/CreateNewJam.d.ts +4 -0
  80. package/dist/components/jams/CreateNewJam.js +138 -0
  81. package/dist/components/jams/CreateNewJamContext.d.ts +9 -0
  82. package/dist/components/jams/CreateNewJamContext.js +16 -0
  83. package/dist/components/jams/JamAnimatedEmoji.d.ts +4 -0
  84. package/dist/components/jams/JamAnimatedEmoji.js +12 -0
  85. package/dist/components/jams/JamCallParticipant.d.ts +15 -0
  86. package/dist/components/jams/JamCallParticipant.js +101 -0
  87. package/dist/components/jams/JamCapacityGate.d.ts +7 -0
  88. package/dist/components/jams/JamCapacityGate.js +30 -0
  89. package/dist/components/jams/JamChatDrawer.d.ts +6 -0
  90. package/dist/components/jams/JamChatDrawer.js +88 -0
  91. package/dist/components/jams/JamChatMessage.d.ts +5 -0
  92. package/dist/components/jams/JamChatMessage.js +35 -0
  93. package/dist/components/jams/JamConference.d.ts +8 -0
  94. package/dist/components/jams/JamConference.js +38 -0
  95. package/dist/components/jams/JamContext.d.ts +20 -0
  96. package/dist/components/jams/JamContext.js +24 -0
  97. package/dist/components/jams/JamDetailsDrawer.d.ts +9 -0
  98. package/dist/components/jams/JamDetailsDrawer.js +39 -0
  99. package/dist/components/jams/JamDeviceSelectors.d.ts +12 -0
  100. package/dist/components/jams/JamDeviceSelectors.js +71 -0
  101. package/dist/components/jams/JamEventsContext.d.ts +14 -0
  102. package/dist/components/jams/JamEventsContext.js +143 -0
  103. package/dist/components/jams/JamFooter.d.ts +18 -0
  104. package/dist/components/jams/JamFooter.js +171 -0
  105. package/dist/components/jams/JamGuestForm.d.ts +1 -0
  106. package/dist/components/jams/JamGuestForm.js +55 -0
  107. package/dist/components/jams/JamLobby.d.ts +17 -0
  108. package/dist/components/jams/JamLobby.js +159 -0
  109. package/dist/components/jams/JamObserverShell.d.ts +6 -0
  110. package/dist/components/jams/JamObserverShell.js +11 -0
  111. package/dist/components/jams/JamParticipantConference.d.ts +7 -0
  112. package/dist/components/jams/JamParticipantConference.js +80 -0
  113. package/dist/components/jams/JamPeopleDrawer.d.ts +10 -0
  114. package/dist/components/jams/JamPeopleDrawer.js +76 -0
  115. package/dist/components/jams/JamReactionMenu.d.ts +12 -0
  116. package/dist/components/jams/JamReactionMenu.js +79 -0
  117. package/dist/components/jams/JamRequestJoin.d.ts +9 -0
  118. package/dist/components/jams/JamRequestJoin.js +34 -0
  119. package/dist/components/jams/JamRoom.d.ts +21 -0
  120. package/dist/components/jams/JamRoom.js +166 -0
  121. package/dist/components/jams/JamRoomIndicators.d.ts +10 -0
  122. package/dist/components/jams/JamRoomIndicators.js +39 -0
  123. package/dist/components/jams/JamVideoCall.d.ts +15 -0
  124. package/dist/components/jams/JamVideoCall.js +18 -0
  125. package/dist/components/jams/JamVideoLayout.d.ts +13 -0
  126. package/dist/components/jams/JamVideoLayout.js +68 -0
  127. package/dist/components/jams/LeaveCloseButton.d.ts +6 -0
  128. package/dist/components/jams/LeaveCloseButton.js +58 -0
  129. package/dist/components/jams/LiveJamsSection.d.ts +1 -0
  130. package/dist/components/jams/LiveJamsSection.js +16 -0
  131. package/dist/components/jams/animateEmoji.d.ts +1 -0
  132. package/dist/components/jams/animateEmoji.js +48 -0
  133. package/dist/components/jams/blurProcessor.d.ts +8 -0
  134. package/dist/components/jams/blurProcessor.js +28 -0
  135. package/dist/components/jams/constants.d.ts +10 -0
  136. package/dist/components/jams/constants.js +44 -0
  137. package/dist/components/jams/index.d.ts +24 -0
  138. package/dist/components/jams/index.js +19 -0
  139. package/dist/components/jams/jamEventActions.d.ts +26 -0
  140. package/dist/components/jams/jamEventActions.js +76 -0
  141. package/dist/components/jams/jamLocalSettings.d.ts +17 -0
  142. package/dist/components/jams/jamLocalSettings.js +53 -0
  143. package/dist/components/jams/jamReactionPreferences.d.ts +15 -0
  144. package/dist/components/jams/jamReactionPreferences.js +53 -0
  145. package/dist/components/jams/jamRecordingState.d.ts +10 -0
  146. package/dist/components/jams/jamRecordingState.js +25 -0
  147. package/dist/components/jams/reactionEmojis.d.ts +30 -0
  148. package/dist/components/jams/reactionEmojis.js +73 -0
  149. package/dist/components/jams/useJamHands.d.ts +7 -0
  150. package/dist/components/jams/useJamHands.js +39 -0
  151. package/dist/components/jams/useJamLiveKitTheme.d.ts +3 -0
  152. package/dist/components/jams/useJamLiveKitTheme.js +10 -0
  153. package/dist/components/layout/AccessDenied.d.ts +14 -0
  154. package/dist/components/layout/AccessDenied.js +28 -0
  155. package/dist/components/layout/AccessDeniedLoader.d.ts +16 -0
  156. package/dist/components/layout/AccessDeniedLoader.js +12 -0
  157. package/dist/components/layout/Auth.d.ts +22 -0
  158. package/dist/components/layout/Auth.js +82 -0
  159. package/dist/components/layout/IdentityContext.d.ts +17 -0
  160. package/dist/components/layout/IdentityContext.js +38 -0
  161. package/dist/components/layout/Infos.d.ts +5 -0
  162. package/dist/components/layout/Infos.js +42 -0
  163. package/dist/components/layout/OpenpeepsContextProvider.d.ts +10 -0
  164. package/dist/components/layout/OpenpeepsContextProvider.js +63 -0
  165. package/dist/components/layout/OpenpeepsThemeProvider.d.ts +11 -0
  166. package/dist/components/layout/OpenpeepsThemeProvider.js +47 -0
  167. package/dist/components/layout/ProfileGuard.d.ts +14 -0
  168. package/dist/components/layout/ProfileGuard.js +38 -0
  169. package/dist/components/layout/ProfileProvider.d.ts +10 -0
  170. package/dist/components/layout/ProfileProvider.js +60 -0
  171. package/dist/components/layout/Root.d.ts +16 -0
  172. package/dist/components/layout/Root.js +36 -0
  173. package/dist/components/layout/ToastProvider.d.ts +22 -0
  174. package/dist/components/layout/ToastProvider.js +37 -0
  175. package/dist/components/layout/index.d.ts +21 -0
  176. package/dist/components/layout/index.js +11 -0
  177. package/dist/components/markdown/CompiledMarkdown.d.ts +5 -0
  178. package/dist/components/markdown/CompiledMarkdown.js +3 -0
  179. package/dist/components/markdown/OpenpeepsMarkdown.d.ts +16 -0
  180. package/dist/components/markdown/OpenpeepsMarkdown.js +66 -0
  181. package/dist/components/markdown/classes.d.ts +2 -0
  182. package/dist/components/markdown/classes.js +2 -0
  183. package/dist/components/markdown/compileMarkdown.d.ts +5 -0
  184. package/dist/components/markdown/compileMarkdown.js +36 -0
  185. package/dist/components/markdown/index.d.ts +11 -0
  186. package/dist/components/markdown/index.js +7 -0
  187. package/dist/components/markdown/linkTargets.d.ts +3 -0
  188. package/dist/components/markdown/linkTargets.js +27 -0
  189. package/dist/components/markdown/staticRender.d.ts +16 -0
  190. package/dist/components/markdown/staticRender.js +17 -0
  191. package/dist/components/navigation/ContentHeader.d.ts +1 -0
  192. package/dist/components/navigation/ContentHeader.js +18 -0
  193. package/dist/components/navigation/FooterMobile.d.ts +5 -0
  194. package/dist/components/navigation/FooterMobile.js +8 -0
  195. package/dist/components/navigation/HeaderMobile.d.ts +11 -0
  196. package/dist/components/navigation/HeaderMobile.js +26 -0
  197. package/dist/components/navigation/MobileMenuItem.d.ts +7 -0
  198. package/dist/components/navigation/MobileMenuItem.js +13 -0
  199. package/dist/components/navigation/PageHeaderAction.d.ts +5 -0
  200. package/dist/components/navigation/PageHeaderAction.js +7 -0
  201. package/dist/components/navigation/PlusButton.d.ts +1 -0
  202. package/dist/components/navigation/PlusButton.js +11 -0
  203. package/dist/components/navigation/SideBar.d.ts +16 -0
  204. package/dist/components/navigation/SideBar.js +24 -0
  205. package/dist/components/navigation/SidebarNavContext.d.ts +3 -0
  206. package/dist/components/navigation/SidebarNavContext.js +4 -0
  207. package/dist/components/navigation/breadcrumbs/Breadcrumbs.d.ts +1 -0
  208. package/dist/components/navigation/breadcrumbs/Breadcrumbs.js +10 -0
  209. package/dist/components/navigation/breadcrumbs/Crumb.d.ts +5 -0
  210. package/dist/components/navigation/breadcrumbs/Crumb.js +4 -0
  211. package/dist/components/navigation/index.d.ts +17 -0
  212. package/dist/components/navigation/index.js +11 -0
  213. package/dist/components/navigation/sideBarNavLinkClass.d.ts +4 -0
  214. package/dist/components/navigation/sideBarNavLinkClass.js +3 -0
  215. package/dist/components/notifications/NotificationErrorBoundary.d.ts +16 -0
  216. package/dist/components/notifications/NotificationErrorBoundary.js +21 -0
  217. package/dist/components/notifications/NotificationHeaderActions.d.ts +6 -0
  218. package/dist/components/notifications/NotificationHeaderActions.js +35 -0
  219. package/dist/components/notifications/NotificationItem.d.ts +5 -0
  220. package/dist/components/notifications/NotificationItem.js +6 -0
  221. package/dist/components/notifications/NotificationWrapper.d.ts +10 -0
  222. package/dist/components/notifications/NotificationWrapper.js +6 -0
  223. package/dist/components/notifications/NotificationsList.d.ts +12 -0
  224. package/dist/components/notifications/NotificationsList.js +88 -0
  225. package/dist/components/notifications/TypedNotification.d.ts +4 -0
  226. package/dist/components/notifications/TypedNotification.js +201 -0
  227. package/dist/components/notifications/index.d.ts +7 -0
  228. package/dist/components/notifications/index.js +5 -0
  229. package/dist/components/post/Feed.d.ts +20 -0
  230. package/dist/components/post/Feed.js +63 -0
  231. package/dist/components/post/FeedPost.d.ts +17 -0
  232. package/dist/components/post/FeedPost.js +31 -0
  233. package/dist/components/post/FeedPostContent.d.ts +5 -0
  234. package/dist/components/post/FeedPostContent.js +22 -0
  235. package/dist/components/post/FullPostLayout.d.ts +7 -0
  236. package/dist/components/post/FullPostLayout.js +23 -0
  237. package/dist/components/post/Markdown.d.ts +2 -0
  238. package/dist/components/post/Markdown.js +1 -0
  239. package/dist/components/post/NewEventButton.d.ts +14 -0
  240. package/dist/components/post/NewEventButton.js +39 -0
  241. package/dist/components/post/NewNoteButton.d.ts +14 -0
  242. package/dist/components/post/NewNoteButton.js +38 -0
  243. package/dist/components/post/PinnedPost.d.ts +5 -0
  244. package/dist/components/post/PinnedPost.js +15 -0
  245. package/dist/components/post/PostDetail.d.ts +4 -0
  246. package/dist/components/post/PostDetail.js +31 -0
  247. package/dist/components/post/ReplyBox.d.ts +5 -0
  248. package/dist/components/post/ReplyBox.js +30 -0
  249. package/dist/components/post/VideoPlayOverlay.d.ts +5 -0
  250. package/dist/components/post/VideoPlayOverlay.js +8 -0
  251. package/dist/components/post/attachmentPreview.d.ts +5 -0
  252. package/dist/components/post/attachmentPreview.js +14 -0
  253. package/dist/components/post/feed/events/EventsFeed.d.ts +7 -0
  254. package/dist/components/post/feed/events/EventsFeed.js +44 -0
  255. package/dist/components/post/feed/threaded/ThreadPost.d.ts +9 -0
  256. package/dist/components/post/feed/threaded/ThreadPost.js +19 -0
  257. package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +10 -0
  258. package/dist/components/post/feed/threaded/ThreadedFeed.js +8 -0
  259. package/dist/components/post/helpers.d.ts +6 -0
  260. package/dist/components/post/helpers.js +24 -0
  261. package/dist/components/post/index.d.ts +78 -0
  262. package/dist/components/post/index.js +57 -0
  263. package/dist/components/post/pieces/Attachments.d.ts +5 -0
  264. package/dist/components/post/pieces/Attachments.js +44 -0
  265. package/dist/components/post/pieces/EventLocation.d.ts +7 -0
  266. package/dist/components/post/pieces/EventLocation.js +28 -0
  267. package/dist/components/post/pieces/EventMenu.d.ts +6 -0
  268. package/dist/components/post/pieces/EventMenu.js +35 -0
  269. package/dist/components/post/pieces/EventRsvpButton.d.ts +5 -0
  270. package/dist/components/post/pieces/EventRsvpButton.js +60 -0
  271. package/dist/components/post/pieces/FeedPostStats.d.ts +5 -0
  272. package/dist/components/post/pieces/FeedPostStats.js +27 -0
  273. package/dist/components/post/pieces/GalleryModal.d.ts +7 -0
  274. package/dist/components/post/pieces/GalleryModal.js +16 -0
  275. package/dist/components/post/pieces/ParticipantsCard.d.ts +8 -0
  276. package/dist/components/post/pieces/ParticipantsCard.js +13 -0
  277. package/dist/components/post/pieces/PollContent.d.ts +5 -0
  278. package/dist/components/post/pieces/PollContent.js +109 -0
  279. package/dist/components/post/pieces/PostActions.d.ts +6 -0
  280. package/dist/components/post/pieces/PostActions.js +63 -0
  281. package/dist/components/post/pieces/PostInfoHeader.d.ts +7 -0
  282. package/dist/components/post/pieces/PostInfoHeader.js +8 -0
  283. package/dist/components/post/pieces/PostMenu.d.ts +6 -0
  284. package/dist/components/post/pieces/PostMenu.js +77 -0
  285. package/dist/components/post/pieces/PostReactionHeader.d.ts +12 -0
  286. package/dist/components/post/pieces/PostReactionHeader.js +31 -0
  287. package/dist/components/post/pieces/ShareMenu.d.ts +6 -0
  288. package/dist/components/post/pieces/ShareMenu.js +46 -0
  289. package/dist/components/post/pieces/UnreadPostIndicator.d.ts +9 -0
  290. package/dist/components/post/pieces/UnreadPostIndicator.js +6 -0
  291. package/dist/components/post/pieces/VideoPlayer.d.ts +16 -0
  292. package/dist/components/post/pieces/VideoPlayer.js +127 -0
  293. package/dist/components/post/pieces/modals/DeletePostModal.d.ts +8 -0
  294. package/dist/components/post/pieces/modals/DeletePostModal.js +20 -0
  295. package/dist/components/post/pieces/modals/ReactionsModal.d.ts +7 -0
  296. package/dist/components/post/pieces/modals/ReactionsModal.js +11 -0
  297. package/dist/components/post/pieces/modals/RepostModal.d.ts +7 -0
  298. package/dist/components/post/pieces/modals/RepostModal.js +13 -0
  299. package/dist/components/post/post-form/ArticleForm.d.ts +7 -0
  300. package/dist/components/post/post-form/ArticleForm.js +45 -0
  301. package/dist/components/post/post-form/AttachmentCard.d.ts +29 -0
  302. package/dist/components/post/post-form/AttachmentCard.js +120 -0
  303. package/dist/components/post/post-form/ComposeAttachments.d.ts +25 -0
  304. package/dist/components/post/post-form/ComposeAttachments.js +137 -0
  305. package/dist/components/post/post-form/ComposePreviewLinks.d.ts +4 -0
  306. package/dist/components/post/post-form/ComposePreviewLinks.js +9 -0
  307. package/dist/components/post/post-form/DescriptionEditModal.d.ts +13 -0
  308. package/dist/components/post/post-form/DescriptionEditModal.js +22 -0
  309. package/dist/components/post/post-form/EditPostModal.d.ts +6 -0
  310. package/dist/components/post/post-form/EditPostModal.js +81 -0
  311. package/dist/components/post/post-form/EditPostModalContext.d.ts +10 -0
  312. package/dist/components/post/post-form/EditPostModalContext.js +18 -0
  313. package/dist/components/post/post-form/EventForm.d.ts +7 -0
  314. package/dist/components/post/post-form/EventForm.js +104 -0
  315. package/dist/components/post/post-form/EventTypeSwitcher.d.ts +8 -0
  316. package/dist/components/post/post-form/EventTypeSwitcher.js +165 -0
  317. package/dist/components/post/post-form/NewPostModal.d.ts +13 -0
  318. package/dist/components/post/post-form/NewPostModal.js +272 -0
  319. package/dist/components/post/post-form/NewPostModalContext.d.ts +15 -0
  320. package/dist/components/post/post-form/NewPostModalContext.js +20 -0
  321. package/dist/components/post/post-form/OpenpeepsMarkdownInput.d.ts +19 -0
  322. package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +65 -0
  323. package/dist/components/post/post-form/PollComposerFields.d.ts +12 -0
  324. package/dist/components/post/post-form/PollComposerFields.js +19 -0
  325. package/dist/components/post/post-form/PostAudienceSelector.d.ts +12 -0
  326. package/dist/components/post/post-form/PostAudienceSelector.js +83 -0
  327. package/dist/components/post/post-form/PostTypeSwitcher.d.ts +16 -0
  328. package/dist/components/post/post-form/PostTypeSwitcher.js +22 -0
  329. package/dist/components/post/post-form/ReplyModal.d.ts +6 -0
  330. package/dist/components/post/post-form/ReplyModal.js +202 -0
  331. package/dist/components/post/post-form/ReplyModalContext.d.ts +10 -0
  332. package/dist/components/post/post-form/ReplyModalContext.js +18 -0
  333. package/dist/components/post/post-form/VisibilitySelector.d.ts +8 -0
  334. package/dist/components/post/post-form/VisibilitySelector.js +35 -0
  335. package/dist/components/post/post-form/audienceChoices.d.ts +14 -0
  336. package/dist/components/post/post-form/audienceChoices.js +66 -0
  337. package/dist/components/post/types/Article.d.ts +5 -0
  338. package/dist/components/post/types/Article.js +14 -0
  339. package/dist/components/post/types/Event.d.ts +5 -0
  340. package/dist/components/post/types/Event.js +19 -0
  341. package/dist/components/post/types/Note.d.ts +5 -0
  342. package/dist/components/post/types/Note.js +10 -0
  343. package/dist/components/post/types/Poll.d.ts +7 -0
  344. package/dist/components/post/types/Poll.js +11 -0
  345. package/dist/components/post/types/article/FullArticle.d.ts +5 -0
  346. package/dist/components/post/types/article/FullArticle.js +8 -0
  347. package/dist/components/post/types/event/CardEvent.d.ts +5 -0
  348. package/dist/components/post/types/event/CardEvent.js +45 -0
  349. package/dist/components/post/types/event/FullEvent.d.ts +5 -0
  350. package/dist/components/post/types/event/FullEvent.js +161 -0
  351. package/dist/components/post/types/event/ProfileEventRelationship.d.ts +5 -0
  352. package/dist/components/post/types/event/ProfileEventRelationship.js +31 -0
  353. package/dist/components/post/types/note/FullNote.d.ts +5 -0
  354. package/dist/components/post/types/note/FullNote.js +5 -0
  355. package/dist/components/post/types/poll/FullPoll.d.ts +5 -0
  356. package/dist/components/post/types/poll/FullPoll.js +7 -0
  357. package/dist/components/post/visibility.d.ts +7 -0
  358. package/dist/components/post/visibility.js +10 -0
  359. package/dist/components/preview-link/LocalPreviewLink.d.ts +4 -0
  360. package/dist/components/preview-link/LocalPreviewLink.js +12 -0
  361. package/dist/components/preview-link/PreviewLink.d.ts +4 -0
  362. package/dist/components/preview-link/PreviewLink.js +11 -0
  363. package/dist/components/preview-link/RemotePreviewLink.d.ts +4 -0
  364. package/dist/components/preview-link/RemotePreviewLink.js +21 -0
  365. package/dist/components/preview-link/helpers.d.ts +7 -0
  366. package/dist/components/preview-link/helpers.js +31 -0
  367. package/dist/components/preview-link/index.d.ts +3 -0
  368. package/dist/components/preview-link/index.js +2 -0
  369. package/dist/components/preview-link/local/GroupPreview.d.ts +4 -0
  370. package/dist/components/preview-link/local/GroupPreview.js +15 -0
  371. package/dist/components/preview-link/local/JamPreview.d.ts +9 -0
  372. package/dist/components/preview-link/local/JamPreview.js +20 -0
  373. package/dist/components/preview-link/local/PostPreview.d.ts +4 -0
  374. package/dist/components/preview-link/local/PostPreview.js +15 -0
  375. package/dist/components/profile/Avatar.d.ts +17 -0
  376. package/dist/components/profile/Avatar.js +36 -0
  377. package/dist/components/profile/AvatarWithName.d.ts +5 -0
  378. package/dist/components/profile/AvatarWithName.js +5 -0
  379. package/dist/components/profile/FollowUnfollowButton.d.ts +8 -0
  380. package/dist/components/profile/FollowUnfollowButton.js +27 -0
  381. package/dist/components/profile/ProfileBadge.d.ts +7 -0
  382. package/dist/components/profile/ProfileBadge.js +12 -0
  383. package/dist/components/profile/ProfileCard.d.ts +24 -0
  384. package/dist/components/profile/ProfileCard.js +12 -0
  385. package/dist/components/profile/ProfileFromId.d.ts +6 -0
  386. package/dist/components/profile/ProfileFromId.js +15 -0
  387. package/dist/components/profile/ProfileHeader.d.ts +10 -0
  388. package/dist/components/profile/ProfileHeader.js +16 -0
  389. package/dist/components/profile/ProfileLink.d.ts +9 -0
  390. package/dist/components/profile/ProfileLink.js +9 -0
  391. package/dist/components/profile/ProfilePageAction.d.ts +6 -0
  392. package/dist/components/profile/ProfilePageAction.js +35 -0
  393. package/dist/components/profile/ProfilePostsAndReplies.d.ts +9 -0
  394. package/dist/components/profile/ProfilePostsAndReplies.js +24 -0
  395. package/dist/components/profile/ProfileSelector.d.ts +14 -0
  396. package/dist/components/profile/ProfileSelector.js +72 -0
  397. package/dist/components/profile/ProfileStats.d.ts +5 -0
  398. package/dist/components/profile/ProfileStats.js +6 -0
  399. package/dist/components/profile/ProfileWithActionCard.d.ts +5 -0
  400. package/dist/components/profile/ProfileWithActionCard.js +6 -0
  401. package/dist/components/profile/ProfilesInput.d.ts +15 -0
  402. package/dist/components/profile/ProfilesInput.js +31 -0
  403. package/dist/components/profile/ReportProfileOrPostModal.d.ts +9 -0
  404. package/dist/components/profile/ReportProfileOrPostModal.js +75 -0
  405. package/dist/components/profile/index.d.ts +30 -0
  406. package/dist/components/profile/index.js +15 -0
  407. package/dist/components/registry/ErrorComponent.d.ts +6 -0
  408. package/dist/components/registry/ErrorComponent.js +7 -0
  409. package/dist/components/registry/PluginLoader.d.ts +3 -0
  410. package/dist/components/registry/PluginLoader.js +51 -0
  411. package/dist/components/registry/PluginRegistryProvider.d.ts +23 -0
  412. package/dist/components/registry/PluginRegistryProvider.js +57 -0
  413. package/dist/components/registry/PluginSlot.d.ts +7 -0
  414. package/dist/components/registry/PluginSlot.js +31 -0
  415. package/dist/components/registry/index.d.ts +10 -0
  416. package/dist/components/registry/index.js +16 -0
  417. package/dist/components/server-data/ServerDataProvider.d.ts +8 -0
  418. package/dist/components/server-data/ServerDataProvider.js +30 -0
  419. package/dist/components/server-data/context.d.ts +121 -0
  420. package/dist/components/server-data/context.js +10 -0
  421. package/dist/components/server-data/index.d.ts +4 -0
  422. package/dist/components/server-data/index.js +2 -0
  423. package/dist/components/server-data/types.d.ts +5 -0
  424. package/dist/components/server-data/types.js +1 -0
  425. package/dist/contexts/credentialsStore/index.d.ts +8 -0
  426. package/dist/contexts/credentialsStore/index.js +13 -0
  427. package/dist/contexts/credentialsStore/types.d.ts +4 -0
  428. package/dist/contexts/credentialsStore/types.js +1 -0
  429. package/dist/contexts/index.d.ts +3 -0
  430. package/dist/contexts/index.js +3 -0
  431. package/dist/contexts/openpeeps/helpers.d.ts +93 -0
  432. package/dist/contexts/openpeeps/helpers.js +311 -0
  433. package/dist/contexts/openpeeps/hooks/accounts.d.ts +302 -0
  434. package/dist/contexts/openpeeps/hooks/accounts.js +17 -0
  435. package/dist/contexts/openpeeps/hooks/admin.d.ts +17177 -0
  436. package/dist/contexts/openpeeps/hooks/admin.js +115 -0
  437. package/dist/contexts/openpeeps/hooks/auth.d.ts +55 -0
  438. package/dist/contexts/openpeeps/hooks/auth.js +22 -0
  439. package/dist/contexts/openpeeps/hooks/conversations.d.ts +9815 -0
  440. package/dist/contexts/openpeeps/hooks/conversations.js +6 -0
  441. package/dist/contexts/openpeeps/hooks/groups.d.ts +319 -0
  442. package/dist/contexts/openpeeps/hooks/groups.js +31 -0
  443. package/dist/contexts/openpeeps/hooks/index.d.ts +18 -0
  444. package/dist/contexts/openpeeps/hooks/index.js +26 -0
  445. package/dist/contexts/openpeeps/hooks/jams.d.ts +3318 -0
  446. package/dist/contexts/openpeeps/hooks/jams.js +32 -0
  447. package/dist/contexts/openpeeps/hooks/other.d.ts +239 -0
  448. package/dist/contexts/openpeeps/hooks/other.js +89 -0
  449. package/dist/contexts/openpeeps/hooks/payments.d.ts +36 -0
  450. package/dist/contexts/openpeeps/hooks/payments.js +10 -0
  451. package/dist/contexts/openpeeps/hooks/posts.d.ts +26001 -0
  452. package/dist/contexts/openpeeps/hooks/posts.js +139 -0
  453. package/dist/contexts/openpeeps/hooks/profiles.d.ts +6896 -0
  454. package/dist/contexts/openpeeps/hooks/profiles.js +43 -0
  455. package/dist/contexts/openpeeps/hooks/search.d.ts +9620 -0
  456. package/dist/contexts/openpeeps/hooks/search.js +24 -0
  457. package/dist/contexts/openpeeps/hooks/streaming.d.ts +26 -0
  458. package/dist/contexts/openpeeps/hooks/streaming.js +10 -0
  459. package/dist/contexts/openpeeps/hooks/useHasAuthToken.d.ts +2 -0
  460. package/dist/contexts/openpeeps/hooks/useHasAuthToken.js +35 -0
  461. package/dist/contexts/openpeeps/index.d.ts +21 -0
  462. package/dist/contexts/openpeeps/index.js +180 -0
  463. package/dist/contexts/openpeeps/types.d.ts +11 -0
  464. package/dist/contexts/openpeeps/types.js +1 -0
  465. package/dist/contexts/router/index.d.ts +28 -0
  466. package/dist/contexts/router/index.js +69 -0
  467. package/dist/email/index.d.ts +13 -0
  468. package/dist/email/index.js +10 -0
  469. package/dist/i18n/I18nProvider.d.ts +19 -0
  470. package/dist/i18n/I18nProvider.js +33 -0
  471. package/dist/i18n/context.d.ts +8 -0
  472. package/dist/i18n/context.js +10 -0
  473. package/dist/i18n/index.d.ts +5 -0
  474. package/dist/i18n/index.js +23 -0
  475. package/dist/index.d.ts +14 -0
  476. package/dist/index.js +14 -0
  477. package/dist/lib/apiErrorMessage.d.ts +3 -0
  478. package/dist/lib/apiErrorMessage.js +14 -0
  479. package/dist/lib/canvasUtils.d.ts +12 -0
  480. package/dist/lib/canvasUtils.js +104 -0
  481. package/dist/lib/configuration/helpers.d.ts +7 -0
  482. package/dist/lib/configuration/helpers.js +83 -0
  483. package/dist/lib/configuration/resolveSchema.d.ts +3 -0
  484. package/dist/lib/configuration/resolveSchema.js +8 -0
  485. package/dist/lib/groupCapabilityHelpers.d.ts +24 -0
  486. package/dist/lib/groupCapabilityHelpers.js +119 -0
  487. package/dist/lib/notificationBadge.d.ts +5 -0
  488. package/dist/lib/notificationBadge.js +25 -0
  489. package/dist/lib/postUnread.d.ts +2 -0
  490. package/dist/lib/postUnread.js +1 -0
  491. package/dist/lib/postViewCounter.d.ts +17 -0
  492. package/dist/lib/postViewCounter.js +162 -0
  493. package/dist/lib/threadHelpers.d.ts +5 -0
  494. package/dist/lib/threadHelpers.js +23 -0
  495. package/dist/lib/unseenCountsOptimistic.d.ts +15 -0
  496. package/dist/lib/unseenCountsOptimistic.js +43 -0
  497. package/dist/log/index.d.ts +11 -0
  498. package/dist/log/index.js +14 -0
  499. package/dist/push/index.d.ts +16 -0
  500. package/dist/push/index.js +145 -0
  501. package/dist/push/usePushSubscription.d.ts +18 -0
  502. package/dist/push/usePushSubscription.js +102 -0
  503. package/dist/push/vapid.d.ts +6 -0
  504. package/dist/push/vapid.js +12 -0
  505. package/dist/pwa/InstallPrompt.d.ts +13 -0
  506. package/dist/pwa/InstallPrompt.js +17 -0
  507. package/dist/pwa/NotificationPermissionPrompt.d.ts +22 -0
  508. package/dist/pwa/NotificationPermissionPrompt.js +56 -0
  509. package/dist/pwa/PwaProvider.d.ts +16 -0
  510. package/dist/pwa/PwaProvider.js +56 -0
  511. package/dist/pwa/UpdatePrompt.d.ts +14 -0
  512. package/dist/pwa/UpdatePrompt.js +14 -0
  513. package/dist/pwa/index.d.ts +18 -0
  514. package/dist/pwa/index.js +16 -0
  515. package/dist/pwa/navigationUrl.d.ts +16 -0
  516. package/dist/pwa/navigationUrl.js +51 -0
  517. package/dist/pwa/pushInvalidate.d.ts +7 -0
  518. package/dist/pwa/pushInvalidate.js +29 -0
  519. package/dist/pwa/registration.d.ts +28 -0
  520. package/dist/pwa/registration.js +71 -0
  521. package/dist/pwa/sw-types.d.ts +14 -0
  522. package/dist/pwa/sw-types.js +1 -0
  523. package/dist/pwa/sw.d.ts +2 -0
  524. package/dist/pwa/sw.js +171 -0
  525. package/dist/pwa/useInstallPrompt.d.ts +10 -0
  526. package/dist/pwa/useInstallPrompt.js +45 -0
  527. package/dist/pwa/useNotificationBadgeSync.d.ts +2 -0
  528. package/dist/pwa/useNotificationBadgeSync.js +23 -0
  529. package/dist/pwa/useServiceWorker.d.ts +19 -0
  530. package/dist/pwa/useServiceWorker.js +49 -0
  531. package/dist/pwa/vite.d.ts +50 -0
  532. package/dist/pwa/vite.js +53 -0
  533. package/dist/react-native.d.ts +11 -0
  534. package/dist/react-native.js +11 -0
  535. package/dist/setupTests.d.ts +1 -0
  536. package/dist/setupTests.js +5 -0
  537. package/dist/stores/breadcrumbs.d.ts +5 -0
  538. package/dist/stores/breadcrumbs.js +5 -0
  539. package/dist/stores/createStore.d.ts +19 -0
  540. package/dist/stores/createStore.js +63 -0
  541. package/dist/stores/index.d.ts +7 -0
  542. package/dist/stores/index.js +9 -0
  543. package/dist/stores/newPosts.d.ts +591 -0
  544. package/dist/stores/newPosts.js +191 -0
  545. package/dist/stores/pageHeader.d.ts +15 -0
  546. package/dist/stores/pageHeader.js +22 -0
  547. package/dist/stores/plusButton.d.ts +5 -0
  548. package/dist/stores/plusButton.js +13 -0
  549. package/dist/stores/types.d.ts +35 -0
  550. package/dist/stores/types.js +1 -0
  551. package/dist/streaming.d.ts +6 -0
  552. package/dist/streaming.js +6 -0
  553. package/dist/types/index.d.ts +0 -0
  554. package/dist/types/index.js +1 -0
  555. package/package.json +72 -0
  556. package/src/pwa/navigationUrl.ts +61 -0
  557. package/src/pwa/sw-types.ts +9 -0
  558. package/src/pwa/sw.ts +228 -0
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { FeedPostContent } from '../../post/FeedPostContent.js';
3
+ import { useOpenpeeps } from '../../../contexts/openpeeps/index.js';
4
+ import { LoadingSpinner } from '@openpeepshq/react-ui';
5
+ export function PostPreview({ path }) {
6
+ const postId = path.substring(7);
7
+ const { openpeepsApi } = useOpenpeeps();
8
+ const postQuery = openpeepsApi.usePost(postId);
9
+ if (postQuery.isLoading) {
10
+ return (_jsx("div", { className: "text-muted-foreground text-sm", children: _jsx(LoadingSpinner, {}) }));
11
+ }
12
+ if (!postQuery.data)
13
+ return null;
14
+ return _jsx(FeedPostContent, { post: postQuery.data });
15
+ }
@@ -0,0 +1,17 @@
1
+ import type { PublicProfile } from '@openpeepshq/common/types';
2
+ export interface AvatarProps {
3
+ profile?: PublicProfile;
4
+ /** rem-equivalent unit (matches Svelte version: 3.5 → 3.5rem). */
5
+ size?: number;
6
+ borderless?: boolean;
7
+ containerClassName?: string;
8
+ /** When true, wraps the avatar in an anchor to the profile page. */
9
+ navigate?: boolean;
10
+ }
11
+ /**
12
+ * Translation of `@openpeepshq/svelte/components/core/profile/Avatar.svelte`.
13
+ * Renders a circular avatar with the profile picture, falling back to the
14
+ * community's `defaultProfileAvatar` and finally to letter initials.
15
+ * Soft-deleted profiles use a dedicated glyph and never link to a profile page.
16
+ */
17
+ export declare function Avatar({ profile, size, borderless, containerClassName, navigate, }: AvatarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getTheme, isDeletedProfile } from '@openpeepshq/common';
3
+ import { UserX } from 'lucide-react';
4
+ import { useServerInfo } from '../server-data/index.js';
5
+ import { useCurrentProfileSettings } from '../layout/IdentityContext.js';
6
+ const initials = (profile) => {
7
+ const name = profile?.displayName || profile?.handle || '?';
8
+ const parts = name.split(' ');
9
+ return [parts.at(0), parts.at(-1)]
10
+ .filter(Boolean)
11
+ .map((part) => part?.substring(0, 1).toUpperCase())
12
+ .join('');
13
+ };
14
+ /**
15
+ * Translation of `@openpeepshq/svelte/components/core/profile/Avatar.svelte`.
16
+ * Renders a circular avatar with the profile picture, falling back to the
17
+ * community's `defaultProfileAvatar` and finally to letter initials.
18
+ * Soft-deleted profiles use a dedicated glyph and never link to a profile page.
19
+ */
20
+ export function Avatar({ profile, size = 3.5, borderless = false, containerClassName, navigate = false, }) {
21
+ const serverInfo = useServerInfo();
22
+ const profileSettings = useCurrentProfileSettings();
23
+ const defaultAvatar = getTheme(serverInfo.communityConfig, profileSettings).defaultProfileAvatar;
24
+ const deleted = isDeletedProfile(profile);
25
+ const src = deleted ? null : profile?.avatar || defaultAvatar;
26
+ const iconSize = Math.max(12, size * 8);
27
+ const borderClass = borderless
28
+ ? ''
29
+ : 'border-4 border-surface-300 hover:border-neutral-500';
30
+ const inner = (_jsx("div", { className: `bg-surface-200 relative inline-flex items-center justify-center overflow-hidden rounded-full ${borderClass}`, style: { width: `${size}rem`, height: `${size}rem` }, children: deleted ? (_jsx(UserX, { "aria-label": profile?.displayName || 'Deleted author', className: "text-muted-foreground", size: iconSize })) : src ? (_jsx("img", { src: src, alt: profile?.displayName || profile?.handle || 'avatar', className: "h-full w-full rounded-full object-cover" })) : (_jsx("span", { className: "text-foreground/80 text-sm font-medium", children: initials(profile) })) }));
31
+ return (_jsx("div", { className: containerClassName, style: {
32
+ width: `${size}rem`,
33
+ height: `${size}rem`,
34
+ minWidth: `${size}rem`,
35
+ }, children: navigate && profile && !deleted ? (_jsx("a", { href: `/@${profile.handle}`, children: inner })) : (inner) }));
36
+ }
@@ -0,0 +1,5 @@
1
+ import type { PublicProfile } from '@openpeepshq/common/types';
2
+ export interface AvatarWithNameProps {
3
+ profile?: PublicProfile;
4
+ }
5
+ export declare function AvatarWithName({ profile }: AvatarWithNameProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Avatar } from './Avatar.js';
3
+ export function AvatarWithName({ profile }) {
4
+ return (_jsxs("div", { className: "flex items-center gap-2 text-sm", children: [_jsx(Avatar, { profile: profile, size: 1.5, borderless: true }), profile?.displayName || profile?.handle] }));
5
+ }
@@ -0,0 +1,8 @@
1
+ import type { PublicProfile } from '@openpeepshq/common/types';
2
+ export interface FollowUnfollowButtonProps {
3
+ profile: PublicProfile;
4
+ compact?: boolean;
5
+ /** Render as a PopupMenuButton (for use inside a PopupMenu) instead of a Button. */
6
+ popup?: boolean;
7
+ }
8
+ export declare function FollowUnfollowButton({ profile, compact, popup, }: FollowUnfollowButtonProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Button, PopupMenuButton } from '@openpeepshq/react-ui';
3
+ import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
4
+ import { useT } from '../../i18n/index.js';
5
+ import { useCurrentProfile } from '../layout/IdentityContext.js';
6
+ export function FollowUnfollowButton({ profile, compact = false, popup = false, }) {
7
+ const t = useT();
8
+ const me = useCurrentProfile();
9
+ const { openpeepsApi } = useOpenpeeps();
10
+ const followProfile = openpeepsApi.followProfileAction({ id: profile.id });
11
+ const unfollowProfile = openpeepsApi.unfollowProfileAction({
12
+ id: profile.id,
13
+ });
14
+ if (!me || me.id === profile.id)
15
+ return null;
16
+ const isFollowing = me.following?.some((f) => f.id === profile.id);
17
+ if (popup) {
18
+ if (isFollowing) {
19
+ return (_jsx(PopupMenuButton, { title: t('profile.actions.unfollow', { defaultValue: 'Unfollow' }), text: t('profile.actions.unfollow', { defaultValue: 'Unfollow' }), action: () => unfollowProfile(undefined) }));
20
+ }
21
+ return (_jsx(PopupMenuButton, { title: t('profile.actions.follow', { defaultValue: 'Follow' }), text: t('profile.actions.follow', { defaultValue: 'Follow' }), action: () => followProfile({ reblogs: true, notify: true }) }));
22
+ }
23
+ if (isFollowing) {
24
+ return (_jsx(Button, { compact: compact, variant: "variant-ringed-secondary", action: () => unfollowProfile(undefined), children: t('profile.actions.unfollow', { defaultValue: 'Unfollow' }) }));
25
+ }
26
+ return (_jsx(Button, { compact: compact, variant: "variant-filled-primary", action: () => followProfile({ reblogs: true, notify: true }), children: t('profile.actions.follow', { defaultValue: 'Follow' }) }));
27
+ }
@@ -0,0 +1,7 @@
1
+ import type { PublicProfile } from '@openpeepshq/common/types';
2
+ export type ProfileBadgeProps = {
3
+ profile: PublicProfile;
4
+ onRemove?: () => void;
5
+ className?: string;
6
+ };
7
+ export declare const ProfileBadge: ({ profile, onRemove, className, }: ProfileBadgeProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { X } from 'lucide-react';
3
+ import { profileName } from '@openpeepshq/common/lib';
4
+ import { useT } from '../../i18n/index.js';
5
+ import { Avatar } from './Avatar.js';
6
+ export const ProfileBadge = ({ profile, onRemove, className, }) => {
7
+ const t = useT();
8
+ return (_jsxs("div", { className: `border-secondary bg-surface-50 text-primary flex items-center gap-1.5 rounded-md border px-2 py-1 text-sm ${className ?? ''}`, children: [_jsx(Avatar, { profile: profile, size: 0.75, borderless: true }), _jsx("span", { className: "max-w-40 truncate font-medium", children: profileName(profile) }), onRemove ? (_jsx("button", { type: "button", className: "hover:bg-secondary ml-0.5 rounded-full p-0.5 transition-colors", title: t('profile.selector.remove', { defaultValue: 'Remove' }), onClick: (e) => {
9
+ e.stopPropagation();
10
+ onRemove();
11
+ }, children: _jsx(X, { className: "size-3" }) })) : null] }));
12
+ };
@@ -0,0 +1,24 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { PublicProfile } from '@openpeepshq/common/types';
3
+ export interface ProfileCardProps {
4
+ profile: PublicProfile;
5
+ /**
6
+ * When provided, the card acts as a selection control: clicking it calls
7
+ * `onSelect` instead of navigating to the profile page. Used in selection
8
+ * contexts such as starting a new conversation.
9
+ */
10
+ onSelect?: (profile: PublicProfile) => void;
11
+ showAction?: boolean;
12
+ /**
13
+ * Custom action node rendered on the right of the card. When provided it
14
+ * replaces the default Follow/Unfollow button (mirrors the Svelte `action`
15
+ * snippet).
16
+ */
17
+ action?: ReactNode;
18
+ }
19
+ /**
20
+ * Compact card listing one profile (used by search results / member lists).
21
+ * Translation of `core/profile/ProfileCard.svelte`, including the
22
+ * Follow/Unfollow action button.
23
+ */
24
+ export declare function ProfileCard({ profile, onSelect, showAction, action, }: ProfileCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Avatar } from './Avatar.js';
3
+ import { FollowUnfollowButton } from './FollowUnfollowButton.js';
4
+ /**
5
+ * Compact card listing one profile (used by search results / member lists).
6
+ * Translation of `core/profile/ProfileCard.svelte`, including the
7
+ * Follow/Unfollow action button.
8
+ */
9
+ export function ProfileCard({ profile, onSelect, showAction = true, action, }) {
10
+ const details = (_jsxs(_Fragment, { children: [_jsx(Avatar, { profile: profile, size: 3 }), _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate text-sm font-semibold", children: profile.displayName || `@${profile.handle}` }), _jsxs("span", { className: "text-muted-foreground truncate text-xs", children: ["@", profile.handle] }), profile.bio && (_jsx("span", { className: "text-muted-foreground mt-1 line-clamp-2 text-sm", children: profile.bio }))] })] }));
11
+ return (_jsxs("div", { className: "hover:bg-surface-100 flex items-center justify-between gap-3 border-b p-4", children: [onSelect ? (_jsx("button", { type: "button", onClick: () => onSelect(profile), className: "flex min-w-0 flex-1 items-center gap-3 text-left", children: details })) : (_jsx("a", { href: `/@${profile.handle}`, className: "flex min-w-0 flex-1 items-center gap-3", children: details })), action ? (_jsx("div", { className: "flex-shrink-0", children: action })) : showAction ? (_jsx("div", { className: "flex-shrink-0", children: _jsx(FollowUnfollowButton, { profile: profile, compact: true }) })) : null] }));
12
+ }
@@ -0,0 +1,6 @@
1
+ export interface ProfileFromIdProps {
2
+ profileId: string;
3
+ avatarSize?: number;
4
+ action?: React.ReactNode;
5
+ }
6
+ export declare function ProfileFromId({ profileId, avatarSize, action, }: ProfileFromIdProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
3
+ import { Avatar } from './Avatar.js';
4
+ import { FollowUnfollowButton } from './FollowUnfollowButton.js';
5
+ export function ProfileFromId({ profileId, avatarSize = 2, action, }) {
6
+ const { openpeepsApi } = useOpenpeeps();
7
+ const profileQuery = openpeepsApi.useProfile(profileId);
8
+ const profile = profileQuery.data;
9
+ if (profileQuery.isLoading) {
10
+ return (_jsx("div", { className: "text-muted-foreground py-2 text-sm", children: "Loading\u2026" }));
11
+ }
12
+ if (!profile)
13
+ return null;
14
+ return (_jsxs("div", { className: "flex items-center justify-between py-2", children: [_jsxs("a", { href: `/@${profile.handle}`, className: "flex items-center gap-2", children: [_jsx(Avatar, { profile: profile, size: avatarSize }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-semibold", children: profile.displayName || profile.handle }), _jsxs("span", { className: "text-muted-foreground text-xs", children: ["@", profile.handle] })] })] }), action ?? _jsx(FollowUnfollowButton, { profile: profile, compact: true })] }));
15
+ }
@@ -0,0 +1,10 @@
1
+ import type { PublicProfile } from '@openpeepshq/common/types';
2
+ export interface ProfileHeaderProps {
3
+ profile: PublicProfile;
4
+ isCurrentProfile?: boolean;
5
+ }
6
+ /**
7
+ * Translation of `profilePage/ProfileHeader.svelte`. Renders the cover image
8
+ * + avatar + display name + handle + bio + location + custom fields.
9
+ */
10
+ export declare function ProfileHeader({ profile, isCurrentProfile, }: ProfileHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { MapPin } from 'lucide-react';
3
+ import { truncateText } from '@openpeepshq/common/lib';
4
+ import { useT } from '../../i18n/index.js';
5
+ import { Avatar } from './Avatar.js';
6
+ import { PostMarkdown } from '../post/Markdown.js';
7
+ import { ProfilePageAction } from './ProfilePageAction.js';
8
+ import { ProfileStats } from './ProfileStats.js';
9
+ /**
10
+ * Translation of `profilePage/ProfileHeader.svelte`. Renders the cover image
11
+ * + avatar + display name + handle + bio + location + custom fields.
12
+ */
13
+ export function ProfileHeader({ profile, isCurrentProfile = false, }) {
14
+ const t = useT();
15
+ return (_jsx("div", { className: "relative", children: _jsxs("div", { className: "mb-8", children: [_jsxs("div", { className: "relative aspect-[3/1] w-full", children: [_jsx("div", { className: "bg-surface-200 absolute inset-0 overflow-hidden", children: profile.header && (_jsx("img", { src: profile.header, alt: "banner", className: "h-full w-full object-cover" })) }), _jsx(Avatar, { profile: profile, size: 6, containerClassName: "absolute -bottom-12 left-4", borderless: true })] }), _jsx(ProfilePageAction, { profile: profile, isCurrentProfile: isCurrentProfile }), _jsxs("div", { className: "p-2", children: [_jsx("h1", { className: "mt-4 text-base font-semibold", "data-testid": "profile-header-title", children: truncateText(profile.displayName || profile.handle, 50) }), _jsxs("span", { className: "text-surface-500 my-1 text-sm font-normal", children: ["@", profile.handle] }), _jsx(PostMarkdown, { source: profile.bio || t('profile.noBio', { defaultValue: '' }) }), profile.location?.text && (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("span", { className: "input-group-shim", children: _jsx(MapPin, { className: "size-3" }) }), _jsx("p", { children: profile.location.text })] })), _jsx(ProfileStats, { profile: profile }), (profile.fields ?? []).map((field) => (_jsxs("div", { className: "mt-4 flex items-center gap-2", children: [_jsx("span", { className: "text-surface-500 text-sm", children: field.name }), _jsx(PostMarkdown, { source: field.value, className: "pt-1 text-sm" })] }, field.name)))] })] }) }));
16
+ }
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { PublicProfile } from '@openpeepshq/common/types';
3
+ export interface ProfileLinkProps {
4
+ profile?: PublicProfile;
5
+ className?: string;
6
+ children: ReactNode;
7
+ }
8
+ /** Links to /@handle unless the profile is soft-deleted. */
9
+ export declare const ProfileLink: ({ profile, className, children, }: ProfileLinkProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isDeletedProfile } from '@openpeepshq/common';
3
+ /** Links to /@handle unless the profile is soft-deleted. */
4
+ export const ProfileLink = ({ profile, className, children, }) => {
5
+ if (!profile || isDeletedProfile(profile)) {
6
+ return _jsx("span", { className: className, children: children });
7
+ }
8
+ return (_jsx("a", { href: `/@${profile.handle}`, className: className, children: children }));
9
+ };
@@ -0,0 +1,6 @@
1
+ import type { PublicProfile } from '@openpeepshq/common/types';
2
+ export interface ProfilePageActionProps {
3
+ profile: PublicProfile;
4
+ isCurrentProfile?: boolean;
5
+ }
6
+ export declare function ProfilePageAction({ profile, isCurrentProfile, }: ProfilePageActionProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Copy, Flag, MessageSquareText } from 'lucide-react';
4
+ import { canCreatePost } from '@openpeepshq/common/lib';
5
+ import { Button, PopupMenu, PopupMenuButton, } from '@openpeepshq/react-ui';
6
+ import { useT } from '../../i18n/index.js';
7
+ import { useAuthData, useCurrentProfile } from '../layout/IdentityContext.js';
8
+ import { useCreateNewConversation } from '../conversations/CreateNewConversationContext.js';
9
+ import { FollowUnfollowButton } from './FollowUnfollowButton.js';
10
+ import { ReportProfileOrPostModal } from './ReportProfileOrPostModal.js';
11
+ export function ProfilePageAction({ profile, isCurrentProfile = false, }) {
12
+ const t = useT();
13
+ const me = useCurrentProfile();
14
+ const authData = useAuthData();
15
+ const { openCreateConversation } = useCreateNewConversation();
16
+ const [reportOpen, setReportOpen] = useState(false);
17
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "mt-2 flex h-6 items-center justify-end gap-x-2 pr-2 pt-3", children: isCurrentProfile ? (_jsx(Button, { variant: "variant-ringed-surface", action: "/settings/public-profile", children: t('profile.edit.title', { defaultValue: 'Edit profile' }) })) : me ? (_jsxs(_Fragment, { children: [_jsxs(PopupMenu, { menuButton: _jsx("span", { className: "text-muted-foreground px-2 text-sm", children: "\u22EF" }), title: t('profile.actions.menu', {
18
+ defaultValue: 'Profile actions',
19
+ }), children: [_jsx(PopupMenuButton, { title: t('profile.actions.copyProfileLink', {
20
+ defaultValue: 'Copy profile link',
21
+ }), text: t('profile.actions.copyProfileLink', {
22
+ defaultValue: 'Copy profile link',
23
+ }), icon: Copy, action: () => void navigator.clipboard.writeText(window.location.href) }), _jsx(PopupMenuButton, { title: t('common.actions.reportProfile', {
24
+ defaultValue: 'Report @{{handle}}',
25
+ handle: profile.handle,
26
+ }), text: t('common.actions.reportProfile', {
27
+ defaultValue: 'Report @{{handle}}',
28
+ handle: profile.handle,
29
+ }), icon: Flag, action: () => setReportOpen(true), danger: true })] }), canCreatePost(authData, 'note', 'direct') ? (_jsx(Button, { variant: "variant-ringed-surface", title: t('conversations.newMessage', {
30
+ defaultValue: 'New message',
31
+ }), action: () => openCreateConversation({
32
+ profiles: [profile],
33
+ skipProfileSelection: true,
34
+ }), children: _jsx(MessageSquareText, { className: "size-5" }) })) : null, _jsx(FollowUnfollowButton, { profile: profile })] })) : null }), me ? (_jsx(ReportProfileOrPostModal, { reportType: "profile", profile: profile, open: reportOpen, onClose: () => setReportOpen(false) })) : null] }));
35
+ }
@@ -0,0 +1,9 @@
1
+ import type { PublicProfile } from '@openpeepshq/common/types';
2
+ export interface ProfilePostsAndRepliesProps {
3
+ profile: PublicProfile;
4
+ }
5
+ /**
6
+ * Translation of `profilePage/ProfilePostsAndReplies.svelte` with posts and
7
+ * common-groups tabs.
8
+ */
9
+ export declare function ProfilePostsAndReplies({ profile, }: ProfilePostsAndRepliesProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Users } from 'lucide-react';
4
+ import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
5
+ import { useT } from '../../i18n/index.js';
6
+ import { useNavigate } from '../../contexts/router/index.js';
7
+ import { AccessDeniedLoader } from '../layout/AccessDeniedLoader.js';
8
+ import { Feed } from '../post/Feed.js';
9
+ import { GroupCard } from '../groups/GroupCard.js';
10
+ /**
11
+ * Translation of `profilePage/ProfilePostsAndReplies.svelte` with posts and
12
+ * common-groups tabs.
13
+ */
14
+ export function ProfilePostsAndReplies({ profile, }) {
15
+ const t = useT();
16
+ const navigate = useNavigate();
17
+ const { openpeepsApi } = useOpenpeeps();
18
+ const postsQuery = openpeepsApi.usePostsByProfile(profile.id);
19
+ const commonGroupsQuery = openpeepsApi.useCommonGroups(profile.id);
20
+ const [tab, setTab] = useState('posts');
21
+ return (_jsxs("div", { children: [_jsxs("div", { className: "border-b flex", children: [_jsx("button", { type: "button", className: `flex-1 px-4 py-3 text-sm font-medium ${tab === 'posts' ? 'border-primary border-b-2' : 'text-muted-foreground'}`, onClick: () => setTab('posts'), children: t('profile.posts', { defaultValue: 'Posts' }) }), _jsx("button", { type: "button", className: `flex-1 px-4 py-3 text-sm font-medium ${tab === 'groups' ? 'border-primary border-b-2' : 'text-muted-foreground'}`, onClick: () => setTab('groups'), children: t('profile.groups.tabName', { defaultValue: 'Groups' }) })] }), tab === 'posts' ? (_jsx(Feed, { query: postsQuery })) : (_jsxs(AccessDeniedLoader, { queries: [commonGroupsQuery], children: [(commonGroupsQuery.data ?? []).map((group) => (_jsx(GroupCard, { group: group, onSelect: () => navigate(`/groups/@${group.handle}`) }, group.id))), !commonGroupsQuery.data?.length ? (_jsxs("div", { className: "flex h-[60vh] w-full flex-col items-center justify-center gap-y-6", children: [_jsx(Users, { size: 60 }), _jsx("p", { children: t('profile.groups.noCommonGroups', {
22
+ defaultValue: 'No groups in common',
23
+ }) })] })) : null] }))] }));
24
+ }
@@ -0,0 +1,14 @@
1
+ import type { PublicProfile } from '@openpeepshq/common/types';
2
+ export type ProfileSelectorMode = 'single' | 'multiple';
3
+ export type ProfileSelectorProps = {
4
+ open: boolean;
5
+ onOpenChange: (open: boolean) => void;
6
+ mode: ProfileSelectorMode;
7
+ selectedProfiles: PublicProfile[];
8
+ onConfirm: (profiles: PublicProfile[]) => void | Promise<void>;
9
+ filter?: (profile: PublicProfile) => boolean;
10
+ allowlist?: PublicProfile[];
11
+ banlist?: PublicProfile[] | string[];
12
+ title?: string;
13
+ };
14
+ export declare const ProfileSelector: ({ open, onOpenChange, mode, selectedProfiles, onConfirm, filter, allowlist, banlist, title, }: ProfileSelectorProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,72 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useState } from 'react';
3
+ import { Check, Search } from 'lucide-react';
4
+ import { matchesQuery, profileName, sortProfiles } from '@openpeepshq/common/lib';
5
+ import { Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, Input, } from '@openpeepshq/react-ui';
6
+ import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
7
+ import { useT } from '../../i18n/index.js';
8
+ import { Avatar } from './Avatar.js';
9
+ import { ProfileBadge } from './ProfileBadge.js';
10
+ const banlistIds = (banlist) => {
11
+ if (!banlist?.length)
12
+ return new Set();
13
+ return new Set(banlist.map((entry) => (typeof entry === 'string' ? entry : entry.id)));
14
+ };
15
+ const dialogContentClassName = 'flex max-h-[85vh] max-w-lg flex-col overflow-hidden max-sm:inset-0 max-sm:h-dvh max-sm:max-w-none max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-none max-sm:max-h-none';
16
+ export const ProfileSelector = ({ open, onOpenChange, mode, selectedProfiles, onConfirm, filter, allowlist, banlist, title, }) => {
17
+ const t = useT();
18
+ const { openpeepsApi } = useOpenpeeps();
19
+ const profilesQuery = openpeepsApi.useProfiles();
20
+ const [searchString, setSearchString] = useState('');
21
+ const [draft, setDraft] = useState(selectedProfiles);
22
+ useEffect(() => {
23
+ if (!open)
24
+ return;
25
+ setDraft(selectedProfiles);
26
+ setSearchString('');
27
+ }, [open, selectedProfiles]);
28
+ const banned = useMemo(() => banlistIds(banlist), [banlist]);
29
+ const selectableProfiles = useMemo(() => {
30
+ const source = allowlist ?? profilesQuery.data ?? [];
31
+ return sortProfiles(source
32
+ .filter((profile) => !banned.has(profile.id))
33
+ .filter((profile) => !filter || filter(profile))
34
+ .filter((profile) => !searchString || matchesQuery(profile, searchString)));
35
+ }, [allowlist, profilesQuery.data, banned, filter, searchString]);
36
+ const isSelected = (profileId) => draft.some((profile) => profile.id === profileId);
37
+ const toggleProfile = (profile) => {
38
+ if (mode === 'single') {
39
+ void Promise.resolve(onConfirm([profile])).then(() => {
40
+ onOpenChange(false);
41
+ });
42
+ return;
43
+ }
44
+ setDraft((prev) => prev.some((p) => p.id === profile.id)
45
+ ? prev.filter((p) => p.id !== profile.id)
46
+ : [...prev, profile]);
47
+ };
48
+ const removeDraft = (profileId) => {
49
+ setDraft((prev) => prev.filter((p) => p.id !== profileId));
50
+ };
51
+ const confirmMultiple = () => {
52
+ void Promise.resolve(onConfirm(draft)).then(() => {
53
+ onOpenChange(false);
54
+ });
55
+ };
56
+ const singleSelectionId = selectedProfiles[0]?.id;
57
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: dialogContentClassName, children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: title ??
58
+ t('profile.selector.title', { defaultValue: 'Select profiles' }) }) }), mode === 'multiple' && draft.length > 0 ? (_jsx("div", { className: "shrink-0 border-b pb-2", children: _jsx("div", { className: "flex max-h-40 flex-wrap content-start gap-2 overflow-y-auto", children: draft.map((profile) => (_jsx(ProfileBadge, { profile: profile, onRemove: () => removeDraft(profile.id) }, profile.id))) }) })) : null, _jsxs("div", { className: "relative", children: [_jsx(Search, { className: "text-muted-foreground absolute left-3 top-1/2 size-4 -translate-y-1/2" }), _jsx(Input, { value: searchString, onChange: (e) => setSearchString(e.target.value), className: "pl-9", placeholder: t('profile.selector.search', {
59
+ defaultValue: 'Search profiles…',
60
+ }), autoFocus: true })] }), _jsx("div", { className: "min-h-0 flex-1 space-y-1 overflow-y-auto", children: profilesQuery.isSuccess || allowlist ? (selectableProfiles.length === 0 ? (_jsx("p", { className: "text-muted-foreground p-4 text-center text-sm", children: searchString
61
+ ? t('profile.selector.emptySearch', {
62
+ defaultValue: 'No results found',
63
+ })
64
+ : t('profile.selector.empty', {
65
+ defaultValue: 'No profiles available',
66
+ }) })) : (selectableProfiles.map((profile) => {
67
+ const selected = mode === 'single'
68
+ ? profile.id === singleSelectionId || isSelected(profile.id)
69
+ : isSelected(profile.id);
70
+ return (_jsxs("button", { type: "button", className: `hover:bg-surface-100 flex w-full items-center gap-3 rounded-md p-2 text-left ${selected ? 'bg-secondary/40' : ''}`, onClick: () => toggleProfile(profile), children: [_jsx(Avatar, { profile: profile, size: 2.5, borderless: true }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate text-sm font-medium", children: profileName(profile) }), profile.handle ? (_jsxs("span", { className: "text-muted-foreground block truncate text-xs", children: ["@", profile.handle] })) : null] }), selected ? (_jsx(Check, { className: "text-primary size-4 shrink-0" })) : null] }, profile.id));
71
+ }))) : null }), mode === 'multiple' ? (_jsxs(DialogFooter, { children: [_jsx(Button, { variant: "variant-ringed-surface", action: () => onOpenChange(false), children: t('common.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "variant-filled-primary", action: confirmMultiple, children: t('profile.selector.confirm', { defaultValue: 'OK' }) })] })) : null] }) }));
72
+ };
@@ -0,0 +1,5 @@
1
+ import type { PublicProfile } from '@openpeepshq/common/types';
2
+ export interface ProfileStatsProps {
3
+ profile: PublicProfile;
4
+ }
5
+ export declare function ProfileStats({ profile }: ProfileStatsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useT } from '../../i18n/index.js';
3
+ export function ProfileStats({ profile }) {
4
+ const t = useT();
5
+ return (_jsxs("div", { className: "mt-2 flex items-center gap-x-4", children: [_jsxs("a", { href: `/@${profile.handle}/followers`, className: "text-sm hover:underline", children: [_jsx("span", { className: "font-semibold", children: profile.profileStats?.followersCount ?? 0 }), ' ', t('profile.followers.title', { defaultValue: 'Followers' })] }), _jsxs("a", { href: `/@${profile.handle}/following`, className: "text-sm hover:underline", children: [_jsx("span", { className: "font-semibold", children: profile.profileStats?.followingCount ?? 0 }), ' ', t('profile.following.title', { defaultValue: 'Following' })] })] }));
6
+ }
@@ -0,0 +1,5 @@
1
+ import type { PublicProfile } from '@openpeepshq/common/types';
2
+ export interface ProfileWithActionCardProps {
3
+ profile: PublicProfile;
4
+ }
5
+ export declare function ProfileWithActionCard({ profile }: ProfileWithActionCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Avatar } from './Avatar.js';
3
+ import { FollowUnfollowButton } from './FollowUnfollowButton.js';
4
+ export function ProfileWithActionCard({ profile }) {
5
+ return (_jsxs("div", { className: "mb-4 flex w-full items-center justify-between", children: [_jsxs("a", { href: `/@${profile.handle}`, className: "flex items-center gap-2", children: [_jsx(Avatar, { profile: profile }), _jsxs("div", { children: [_jsx("p", { className: "font-bold", children: profile.displayName || profile.handle }), _jsxs("span", { className: "text-muted-foreground text-sm", children: ["@", profile.handle] })] })] }), _jsx(FollowUnfollowButton, { profile: profile, compact: true })] }));
6
+ }
@@ -0,0 +1,15 @@
1
+ import type { PublicProfile } from '@openpeepshq/common/types';
2
+ import { type ProfileSelectorMode, type ProfileSelectorProps } from './ProfileSelector';
3
+ export type ProfilesInputProps = {
4
+ value: PublicProfile[];
5
+ onChange: (profiles: PublicProfile[]) => void;
6
+ mode?: ProfileSelectorMode;
7
+ placeholder?: string;
8
+ filter?: ProfileSelectorProps['filter'];
9
+ allowlist?: ProfileSelectorProps['allowlist'];
10
+ banlist?: ProfileSelectorProps['banlist'];
11
+ disabled?: boolean;
12
+ className?: string;
13
+ title?: string;
14
+ };
15
+ export declare const ProfilesInput: ({ value, onChange, mode, placeholder, filter, allowlist, banlist, disabled, className, title, }: ProfilesInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Users } from 'lucide-react';
4
+ import { useT } from '../../i18n/index.js';
5
+ import { ProfileBadge } from './ProfileBadge.js';
6
+ import { ProfileSelector, } from './ProfileSelector.js';
7
+ export const ProfilesInput = ({ value, onChange, mode = 'multiple', placeholder, filter, allowlist, banlist, disabled = false, className, title, }) => {
8
+ const t = useT();
9
+ const [open, setOpen] = useState(false);
10
+ const removeProfile = (profileId) => {
11
+ onChange(value.filter((profile) => profile.id !== profileId));
12
+ };
13
+ return (_jsxs(_Fragment, { children: [_jsx("div", { role: "button", tabIndex: disabled ? -1 : 0, "aria-disabled": disabled, className: `border-surface-300 bg-surface-200 flex max-h-40 min-h-10 w-full flex-wrap content-start items-center gap-1 overflow-y-auto rounded-lg border px-3 py-1.5 text-left ${disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer'} ${className ?? ''}`, onClick: () => {
14
+ if (!disabled)
15
+ setOpen(true);
16
+ }, onKeyDown: (e) => {
17
+ if (disabled)
18
+ return;
19
+ if (e.key === 'Enter' || e.key === ' ') {
20
+ e.preventDefault();
21
+ setOpen(true);
22
+ }
23
+ }, children: value.length === 0 ? (_jsxs("span", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [_jsx(Users, { className: "size-4 shrink-0" }), placeholder ??
24
+ t('profile.input.placeholder', {
25
+ defaultValue: 'Select profiles',
26
+ })] })) : (value.map((profile) => (_jsx(ProfileBadge, { profile: profile, onRemove: disabled
27
+ ? undefined
28
+ : () => {
29
+ removeProfile(profile.id);
30
+ } }, profile.id)))) }), _jsx(ProfileSelector, { open: open, onOpenChange: setOpen, mode: mode, selectedProfiles: value, onConfirm: onChange, filter: filter, allowlist: allowlist, banlist: banlist, title: title })] }));
31
+ };
@@ -0,0 +1,9 @@
1
+ import type { PublicPost, PublicProfile } from '@openpeepshq/common/types';
2
+ export interface ReportProfileOrPostModalProps {
3
+ reportType: 'profile' | 'post';
4
+ profile?: PublicProfile;
5
+ post?: PublicPost;
6
+ open: boolean;
7
+ onClose: () => void;
8
+ }
9
+ export declare function ReportProfileOrPostModal({ reportType, profile, post, open, onClose, }: ReportProfileOrPostModalProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,75 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, Textarea, } from '@openpeepshq/react-ui';
4
+ import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
5
+ import { useT } from '../../i18n/index.js';
6
+ import { useServerInfo } from '../server-data/index.js';
7
+ export function ReportProfileOrPostModal({ reportType, profile, post, open, onClose, }) {
8
+ const t = useT();
9
+ const serverInfo = useServerInfo();
10
+ const { openpeepsApi } = useOpenpeeps();
11
+ const createReport = openpeepsApi.createReportAction();
12
+ const [step, setStep] = useState(1);
13
+ const [category, setCategory] = useState('spam');
14
+ const [comment, setComment] = useState('');
15
+ const [submitting, setSubmitting] = useState(false);
16
+ const categories = [
17
+ {
18
+ value: 'spam',
19
+ label: t('reports.categories.spamDescription', {
20
+ defaultValue: 'Spam or misleading',
21
+ }),
22
+ },
23
+ {
24
+ value: 'violation',
25
+ label: t('reports.categories.violationDescription', {
26
+ defaultValue: 'Violates community rules',
27
+ }),
28
+ },
29
+ {
30
+ value: 'other',
31
+ label: t('reports.categories.otherDescription', {
32
+ defaultValue: 'Something else',
33
+ }),
34
+ },
35
+ ];
36
+ const submit = async () => {
37
+ setSubmitting(true);
38
+ try {
39
+ await createReport({
40
+ postIds: post ? [post.id] : [],
41
+ profileId: profile?.id ?? post?.profile.id ?? '',
42
+ report: { comment, category, forward: false },
43
+ });
44
+ onClose();
45
+ }
46
+ finally {
47
+ setSubmitting(false);
48
+ }
49
+ };
50
+ const communityName = serverInfo.communityConfig?.info.name ?? 'community';
51
+ return (_jsx(Dialog, { open: open, onOpenChange: (next) => {
52
+ if (!next) {
53
+ setStep(1);
54
+ onClose();
55
+ }
56
+ }, children: _jsxs(DialogContent, { className: "max-w-lg", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: reportType === 'profile'
57
+ ? t('reports.create.profile.title', {
58
+ defaultValue: 'Report @{{handle}}',
59
+ handle: profile?.handle,
60
+ })
61
+ : t('reports.create.post.title', { defaultValue: 'Report post' }) }) }), step === 1 ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: t(`reports.create.${reportType}.description`, {
62
+ defaultValue: 'Help moderators understand what is wrong.',
63
+ }) }), _jsx("div", { className: "space-y-2 py-2", children: categories.map((item) => (_jsxs("label", { className: "flex cursor-pointer items-center gap-2", children: [_jsx("input", { type: "radio", name: "category", checked: category === item.value, onChange: () => setCategory(item.value) }), _jsx("span", { className: "text-sm", children: item.label })] }, item.value))) }), _jsx(Textarea, { rows: 4, value: comment, onChange: (e) => setComment(e.target.value), placeholder: t(`reports.create.${reportType}.anythingElse`, {
64
+ defaultValue: 'Anything else we should know?',
65
+ }) }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "variant-ringed-surface", action: onClose, children: t('common.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "variant-filled-primary", action: () => setStep(2), children: t(`reports.create.${reportType}.continue`, {
66
+ defaultValue: 'Continue',
67
+ }) })] })] })) : (_jsxs(_Fragment, { children: [_jsx("h3", { className: "font-semibold", children: t(`reports.create.${reportType}.confirmMessageHeading`, {
68
+ defaultValue: 'Send report?',
69
+ handle: profile?.handle ?? post?.profile.handle,
70
+ }) }), reportType === 'profile' ? (_jsx("p", { className: "text-sm text-muted-foreground", children: t('reports.create.profile.confirmMessageDescription', {
71
+ defaultValue: 'Moderators at {{community}} will review this report.',
72
+ handle: profile?.handle,
73
+ community: communityName,
74
+ }) })) : null, _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "variant-ringed-surface", action: () => setStep(1), children: t('reports.create.back', { defaultValue: 'Back' }) }), _jsx(Button, { variant: "variant-filled-error", action: submit, disabled: submitting, children: t('reports.create.sendReport', { defaultValue: 'Send report' }) })] })] }))] }) }));
75
+ }