@openpeepshq/react 0.2.4 → 0.2.6

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 (463) hide show
  1. package/dist/components/CapabilityMatrix.d.ts +24 -0
  2. package/dist/components/CapabilityMatrix.js +51 -0
  3. package/dist/components/RelationCapabilitiesEditor.d.ts +1 -0
  4. package/dist/components/RelationCapabilitiesEditor.js +138 -0
  5. package/dist/components/RoleCapabilityMatrix.d.ts +10 -0
  6. package/dist/components/RoleCapabilityMatrix.js +100 -0
  7. package/dist/components/accounts/SignUpLoginModal.js +7 -5
  8. package/dist/components/configuration/ConfigMenuButton.d.ts +3 -1
  9. package/dist/components/configuration/ConfigMenuButton.js +2 -2
  10. package/dist/components/configuration/ConfigurationList.js +7 -4
  11. package/dist/components/configuration/ConfigurationValueEditor.js +2 -2
  12. package/dist/components/conversations/ConversationParticipantsModal.d.ts +7 -0
  13. package/dist/components/conversations/ConversationParticipantsModal.js +10 -0
  14. package/dist/components/conversations/CreateNewConversation.js +9 -7
  15. package/dist/components/conversations/MessageInThread.js +4 -1
  16. package/dist/components/conversations/index.d.ts +2 -0
  17. package/dist/components/conversations/index.js +1 -0
  18. package/dist/components/form/ImageEditModal.js +4 -4
  19. package/dist/components/form/LocationInput.js +2 -2
  20. package/dist/components/form/TimeZoneSelect.d.ts +7 -0
  21. package/dist/components/form/TimeZoneSelect.js +7 -0
  22. package/dist/components/form/index.d.ts +2 -0
  23. package/dist/components/form/index.js +1 -0
  24. package/dist/components/groups/ChangeGroupRolesModal.js +15 -4
  25. package/dist/components/groups/ConfirmGroupExitModal.js +4 -2
  26. package/dist/components/groups/ConfirmMemberRemovalModal.js +4 -2
  27. package/dist/components/groups/DeleteGroupModal.js +4 -2
  28. package/dist/components/groups/GroupAvatar.d.ts +2 -1
  29. package/dist/components/groups/GroupAvatar.js +9 -12
  30. package/dist/components/groups/GroupCapabilityMatrix.d.ts +6 -0
  31. package/dist/components/groups/GroupCapabilityMatrix.js +12 -0
  32. package/dist/components/groups/GroupCard.js +2 -2
  33. package/dist/components/groups/GroupFeed.js +2 -1
  34. package/dist/components/groups/GroupForm.d.ts +11 -1
  35. package/dist/components/groups/GroupForm.js +14 -67
  36. package/dist/components/groups/GroupMembersList.js +25 -17
  37. package/dist/components/groups/GroupOptionsMenu.js +13 -10
  38. package/dist/components/groups/index.d.ts +3 -1
  39. package/dist/components/groups/index.js +1 -0
  40. package/dist/components/index.d.ts +5 -0
  41. package/dist/components/index.js +3 -0
  42. package/dist/components/jams/CreateNewJam.js +5 -127
  43. package/dist/components/jams/JamCallParticipant.d.ts +7 -1
  44. package/dist/components/jams/JamCallParticipant.js +28 -38
  45. package/dist/components/jams/JamCapacityGate.d.ts +2 -1
  46. package/dist/components/jams/JamCapacityGate.js +2 -2
  47. package/dist/components/jams/JamChatDrawer.js +12 -47
  48. package/dist/components/jams/JamChatMessage.d.ts +3 -2
  49. package/dist/components/jams/JamChatMessage.js +13 -4
  50. package/dist/components/jams/JamConference.js +4 -3
  51. package/dist/components/jams/JamContext.d.ts +8 -3
  52. package/dist/components/jams/JamContext.js +4 -7
  53. package/dist/components/jams/JamDetailsDrawer.js +11 -8
  54. package/dist/components/jams/JamEventsContext.d.ts +3 -1
  55. package/dist/components/jams/JamEventsContext.js +1 -3
  56. package/dist/components/jams/JamFooter.js +12 -78
  57. package/dist/components/jams/JamGuestForm.js +0 -1
  58. package/dist/components/jams/JamLobby.d.ts +2 -6
  59. package/dist/components/jams/JamLobby.js +11 -57
  60. package/dist/components/jams/JamObserverShell.js +1 -1
  61. package/dist/components/jams/JamParticipantConference.js +5 -2
  62. package/dist/components/jams/JamPeopleDrawer.js +5 -41
  63. package/dist/components/jams/JamRequestJoin.d.ts +2 -6
  64. package/dist/components/jams/JamRequestJoin.js +3 -21
  65. package/dist/components/jams/JamRoom.d.ts +2 -1
  66. package/dist/components/jams/JamRoom.js +13 -175
  67. package/dist/components/jams/JamToolbarButton.js +2 -2
  68. package/dist/components/jams/JamVideoCall.d.ts +3 -2
  69. package/dist/components/jams/JamVideoCall.js +1 -1
  70. package/dist/components/jams/JamVideoLayout.d.ts +2 -2
  71. package/dist/components/jams/JamVideoLayout.js +81 -26
  72. package/dist/components/jams/LeaveCloseButton.js +2 -1
  73. package/dist/components/jams/LiveJamsSection.js +1 -1
  74. package/dist/components/jams/disconnectReason.d.ts +6 -0
  75. package/dist/components/jams/disconnectReason.js +19 -0
  76. package/dist/components/jams/jamEventActions.d.ts +3 -0
  77. package/dist/components/jams/jamEventActions.js +10 -0
  78. package/dist/components/jams/jamRecordingState.d.ts +6 -0
  79. package/dist/components/jams/jamRecordingState.js +15 -1
  80. package/dist/components/jams/reactionEmojis.d.ts +1 -28
  81. package/dist/components/jams/reactionEmojis.js +1 -55
  82. package/dist/components/jams/speakerLayout.d.ts +19 -0
  83. package/dist/components/jams/speakerLayout.js +33 -0
  84. package/dist/components/jams/useJamSpotlight.d.ts +14 -0
  85. package/dist/components/jams/useJamSpotlight.js +72 -0
  86. package/dist/components/layout/Auth.js +20 -3
  87. package/dist/components/layout/IdentityContext.js +7 -1
  88. package/dist/components/layout/OpenpeepsThemeProvider.d.ts +15 -0
  89. package/dist/components/layout/OpenpeepsThemeProvider.js +13 -3
  90. package/dist/components/layout/ProfileProvider.d.ts +2 -2
  91. package/dist/components/layout/ProfileProvider.js +15 -32
  92. package/dist/components/layout/Root.js +1 -1
  93. package/dist/components/layout/useProfileIdentity.d.ts +59 -0
  94. package/dist/components/layout/useProfileIdentity.js +38 -0
  95. package/dist/components/markdown/OpenpeepsMarkdown.js +2 -9
  96. package/dist/components/markdown/classes.d.ts +2 -2
  97. package/dist/components/markdown/classes.js +2 -2
  98. package/dist/components/markdown/staticRender.d.ts +2 -0
  99. package/dist/components/navigation/ContentHeader.js +1 -1
  100. package/dist/components/navigation/FooterMobile.js +4 -1
  101. package/dist/components/navigation/HeaderMobile.js +6 -2
  102. package/dist/components/navigation/MobileMenuItem.d.ts +3 -1
  103. package/dist/components/navigation/MobileMenuItem.js +6 -4
  104. package/dist/components/navigation/PlusButton.js +1 -1
  105. package/dist/components/navigation/SideBar.js +5 -1
  106. package/dist/components/notifications/NotificationHeaderActions.js +3 -1
  107. package/dist/components/notifications/NotificationsList.js +28 -16
  108. package/dist/components/notifications/TypedNotification.js +50 -6
  109. package/dist/components/post/CompactReplyParent.d.ts +7 -0
  110. package/dist/components/post/CompactReplyParent.js +121 -0
  111. package/dist/components/post/EventViewSwitch.d.ts +1 -0
  112. package/dist/components/post/EventViewSwitch.js +15 -0
  113. package/dist/components/post/Feed.d.ts +3 -1
  114. package/dist/components/post/Feed.js +11 -5
  115. package/dist/components/post/FeedFormatSwitch.d.ts +1 -0
  116. package/dist/components/post/FeedFormatSwitch.js +16 -0
  117. package/dist/components/post/FeedPost.js +9 -19
  118. package/dist/components/post/FeedPostContent.js +8 -1
  119. package/dist/components/post/FullPostLayout.js +8 -11
  120. package/dist/components/post/PinnedPost.js +1 -1
  121. package/dist/components/post/feed/events/EventsCalendar.d.ts +7 -0
  122. package/dist/components/post/feed/events/EventsCalendar.js +54 -0
  123. package/dist/components/post/feed/events/EventsView.d.ts +10 -0
  124. package/dist/components/post/feed/events/EventsView.js +9 -0
  125. package/dist/components/post/feed/events/eventCalendar.d.ts +36 -0
  126. package/dist/components/post/feed/events/eventCalendar.js +145 -0
  127. package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +1 -4
  128. package/dist/components/post/feed/threaded/ThreadedFeed.js +5 -2
  129. package/dist/components/post/helpers.js +3 -1
  130. package/dist/components/post/index.d.ts +11 -0
  131. package/dist/components/post/index.js +6 -0
  132. package/dist/components/post/pieces/Attachments.js +19 -13
  133. package/dist/components/post/pieces/AudioAttachment.d.ts +13 -0
  134. package/dist/components/post/pieces/AudioAttachment.js +93 -0
  135. package/dist/components/post/pieces/EventLocation.d.ts +2 -1
  136. package/dist/components/post/pieces/EventLocation.js +13 -9
  137. package/dist/components/post/pieces/EventMenu.d.ts +2 -1
  138. package/dist/components/post/pieces/EventMenu.js +26 -26
  139. package/dist/components/post/pieces/EventOccurrenceList.d.ts +10 -0
  140. package/dist/components/post/pieces/EventOccurrenceList.js +49 -0
  141. package/dist/components/post/pieces/EventRsvpButton.d.ts +3 -1
  142. package/dist/components/post/pieces/EventRsvpButton.js +15 -37
  143. package/dist/components/post/pieces/EventRsvpList.d.ts +12 -0
  144. package/dist/components/post/pieces/EventRsvpList.js +108 -0
  145. package/dist/components/post/pieces/EventRsvpScopeDialog.d.ts +16 -0
  146. package/dist/components/post/pieces/EventRsvpScopeDialog.js +92 -0
  147. package/dist/components/post/pieces/FeedPostStats.js +7 -6
  148. package/dist/components/post/pieces/FeedThreadPreview.d.ts +9 -0
  149. package/dist/components/post/pieces/FeedThreadPreview.js +37 -0
  150. package/dist/components/post/pieces/GalleryModal.js +8 -5
  151. package/dist/components/post/pieces/PollContent.js +36 -13
  152. package/dist/components/post/pieces/PostActions.js +2 -2
  153. package/dist/components/post/pieces/PostMenu.js +18 -2
  154. package/dist/components/post/pieces/ShareMenu.js +11 -16
  155. package/dist/components/post/pieces/VideoPlayer.js +1 -1
  156. package/dist/components/post/pieces/modals/DeletePostModal.js +6 -2
  157. package/dist/components/post/pieces/modals/ReactionsModal.js +2 -3
  158. package/dist/components/post/pieces/modals/RepostModal.d.ts +5 -3
  159. package/dist/components/post/pieces/modals/RepostModal.js +8 -7
  160. package/dist/components/post/post-form/ArticleForm.js +2 -14
  161. package/dist/components/post/post-form/AttachmentCard.js +18 -7
  162. package/dist/components/post/post-form/ComposeAttachments.d.ts +1 -0
  163. package/dist/components/post/post-form/ComposeAttachments.js +30 -7
  164. package/dist/components/post/post-form/DescriptionEditModal.js +2 -2
  165. package/dist/components/post/post-form/EditPostModal.js +9 -7
  166. package/dist/components/post/post-form/EventForm.d.ts +2 -1
  167. package/dist/components/post/post-form/EventForm.js +41 -61
  168. package/dist/components/post/post-form/EventTypeSwitcher.d.ts +1 -1
  169. package/dist/components/post/post-form/EventTypeSwitcher.js +15 -134
  170. package/dist/components/post/post-form/NewPostModal.js +14 -9
  171. package/dist/components/post/post-form/NewPostModalContext.js +6 -2
  172. package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +1 -1
  173. package/dist/components/post/post-form/PollComposerFields.js +7 -5
  174. package/dist/components/post/post-form/PostAudienceSelector.js +4 -2
  175. package/dist/components/post/post-form/PostTypeSwitcher.d.ts +5 -2
  176. package/dist/components/post/post-form/PostTypeSwitcher.js +19 -1
  177. package/dist/components/post/post-form/ReplyModal.js +13 -9
  178. package/dist/components/post/post-form/ReplyModalContext.d.ts +5 -8
  179. package/dist/components/post/post-form/ReplyModalContext.js +9 -12
  180. package/dist/components/post/post-form/audienceChoices.d.ts +4 -6
  181. package/dist/components/post/post-form/audienceChoices.js +12 -63
  182. package/dist/components/post/types/Article.js +3 -1
  183. package/dist/components/post/types/Event.js +13 -2
  184. package/dist/components/post/types/article/FullArticle.js +5 -1
  185. package/dist/components/post/types/event/CardEvent.d.ts +2 -1
  186. package/dist/components/post/types/event/CardEvent.js +16 -10
  187. package/dist/components/post/types/event/FullEvent.js +78 -44
  188. package/dist/components/preview-link/local/PostPreview.js +3 -2
  189. package/dist/components/profile/Avatar.d.ts +3 -3
  190. package/dist/components/profile/Avatar.js +15 -15
  191. package/dist/components/profile/FollowUnfollowButton.d.ts +2 -1
  192. package/dist/components/profile/FollowUnfollowButton.js +8 -15
  193. package/dist/components/profile/ProfileActivitySummary.d.ts +5 -0
  194. package/dist/components/profile/ProfileActivitySummary.js +41 -0
  195. package/dist/components/profile/ProfileCard.js +3 -1
  196. package/dist/components/profile/ProfileHeader.js +7 -1
  197. package/dist/components/profile/ProfilePageAction.js +46 -4
  198. package/dist/components/profile/ProfilePostsAndReplies.d.ts +4 -3
  199. package/dist/components/profile/ProfilePostsAndReplies.js +8 -5
  200. package/dist/components/profile/ProfileSelector.js +2 -2
  201. package/dist/components/profile/ProfileWithActionCard.d.ts +3 -1
  202. package/dist/components/profile/ProfileWithActionCard.js +2 -2
  203. package/dist/components/profile/ReportProfileOrPostModal.js +7 -7
  204. package/dist/components/profile/index.d.ts +2 -0
  205. package/dist/components/profile/index.js +1 -0
  206. package/dist/components/profile/profileFieldDisplay.d.ts +8 -0
  207. package/dist/components/profile/profileFieldDisplay.js +36 -0
  208. package/dist/components/registry/PluginRegistryProvider.d.ts +1 -0
  209. package/dist/components/registry/PluginRegistryProvider.js +6 -1
  210. package/dist/components/registry/PluginSlot.js +1 -1
  211. package/dist/components/server-data/context.d.ts +18 -1
  212. package/dist/contexts/openpeeps/helpers.js +12 -1
  213. package/dist/contexts/openpeeps/hooks/accounts.js +42 -1
  214. package/dist/contexts/openpeeps/hooks/admin.d.ts +5759 -12462
  215. package/dist/contexts/openpeeps/hooks/admin.js +51 -15
  216. package/dist/contexts/openpeeps/hooks/auth.d.ts +2 -1
  217. package/dist/contexts/openpeeps/hooks/conversations.d.ts +12 -9810
  218. package/dist/contexts/openpeeps/hooks/conversations.js +8 -2
  219. package/dist/contexts/openpeeps/hooks/groups.d.ts +15 -3
  220. package/dist/contexts/openpeeps/hooks/jams.d.ts +7511 -734
  221. package/dist/contexts/openpeeps/hooks/jams.js +20 -5
  222. package/dist/contexts/openpeeps/hooks/other.d.ts +18 -1
  223. package/dist/contexts/openpeeps/hooks/posts.d.ts +66236 -12355
  224. package/dist/contexts/openpeeps/hooks/profiles.d.ts +49 -6881
  225. package/dist/contexts/openpeeps/hooks/profiles.js +24 -4
  226. package/dist/contexts/openpeeps/hooks/search.d.ts +13 -9618
  227. package/dist/contexts/openpeeps/index.d.ts +1 -1
  228. package/dist/contexts/openpeeps/index.js +18 -9
  229. package/dist/hooks/auth/useAuthForms.d.ts +25 -0
  230. package/dist/hooks/auth/useAuthForms.js +101 -0
  231. package/dist/hooks/community/useCommunityInfoPages.d.ts +10 -0
  232. package/dist/hooks/community/useCommunityInfoPages.js +18 -0
  233. package/dist/hooks/conversations/useCreateConversation.d.ts +14 -2
  234. package/dist/hooks/events/useEventComposer.d.ts +10965 -0
  235. package/dist/hooks/events/useEventComposer.js +164 -0
  236. package/dist/hooks/events/useEventForm.d.ts +108 -0
  237. package/dist/hooks/events/useEventForm.js +154 -0
  238. package/dist/hooks/events/useEventMenu.d.ts +9 -0
  239. package/dist/hooks/events/useEventMenu.js +47 -0
  240. package/dist/hooks/events/useEventRsvp.d.ts +99 -0
  241. package/dist/hooks/events/useEventRsvp.js +111 -0
  242. package/dist/hooks/events/useEventTypeSwitcher.d.ts +102 -0
  243. package/dist/hooks/events/useEventTypeSwitcher.js +160 -0
  244. package/dist/hooks/events/useEventsCalendar.d.ts +19822 -0
  245. package/dist/hooks/events/useEventsCalendar.js +89 -0
  246. package/dist/hooks/groups/useEditGroup.d.ts +87 -0
  247. package/dist/hooks/groups/useEditGroup.js +80 -0
  248. package/dist/hooks/groups/useGroupTemplateSelection.d.ts +22 -0
  249. package/dist/hooks/groups/useGroupTemplateSelection.js +67 -0
  250. package/dist/hooks/groups/useNewGroup.d.ts +152 -0
  251. package/dist/hooks/groups/useNewGroup.js +75 -0
  252. package/dist/hooks/index.d.ts +58 -0
  253. package/dist/hooks/index.js +36 -0
  254. package/dist/hooks/jams/useCreateNewJamForm.d.ts +543 -0
  255. package/dist/hooks/jams/useCreateNewJamForm.js +140 -0
  256. package/dist/hooks/jams/useJamChat.d.ts +78 -0
  257. package/dist/hooks/jams/useJamChat.js +64 -0
  258. package/dist/hooks/jams/useJamDetails.d.ts +9921 -0
  259. package/dist/hooks/jams/useJamDetails.js +74 -0
  260. package/dist/hooks/jams/useJamFooterControls.d.ts +27 -0
  261. package/dist/hooks/jams/useJamFooterControls.js +92 -0
  262. package/dist/hooks/jams/useJamLobby.d.ts +105 -0
  263. package/dist/hooks/jams/useJamLobby.js +61 -0
  264. package/dist/hooks/jams/useJamParticipant.d.ts +11 -0
  265. package/dist/hooks/jams/useJamParticipant.js +49 -0
  266. package/dist/hooks/jams/useJamPeople.d.ts +79 -0
  267. package/dist/hooks/jams/useJamPeople.js +63 -0
  268. package/dist/hooks/jams/useJamRoom.d.ts +19934 -0
  269. package/dist/hooks/jams/useJamRoom.js +216 -0
  270. package/dist/hooks/jams/useJamStage.d.ts +21 -0
  271. package/dist/hooks/jams/useJamStage.js +48 -0
  272. package/dist/hooks/jams/useLeaveCloseJam.d.ts +2 -1
  273. package/dist/hooks/jams/useLeaveCloseJam.js +3 -3
  274. package/dist/hooks/posts/replyOpener.d.ts +9 -0
  275. package/dist/hooks/posts/replyOpener.js +12 -0
  276. package/dist/hooks/posts/useArticleComposer.d.ts +10879 -0
  277. package/dist/hooks/posts/useArticleComposer.js +112 -0
  278. package/dist/hooks/posts/useFeedPostActions.d.ts +3 -1
  279. package/dist/hooks/posts/useFeedPostActions.js +21 -10
  280. package/dist/hooks/posts/useFeedPostPresentation.d.ts +19827 -0
  281. package/dist/hooks/posts/useFeedPostPresentation.js +39 -0
  282. package/dist/hooks/posts/usePostDetailTitle.d.ts +9906 -0
  283. package/dist/hooks/posts/usePostDetailTitle.js +32 -0
  284. package/dist/hooks/posts/usePostThreads.d.ts +6 -0
  285. package/dist/hooks/posts/usePostThreads.js +17 -0
  286. package/dist/hooks/posts/useShareMenu.d.ts +14 -0
  287. package/dist/hooks/posts/useShareMenu.js +24 -0
  288. package/dist/hooks/profile/useFollowProfile.d.ts +8 -0
  289. package/dist/hooks/profile/useFollowProfile.js +21 -0
  290. package/dist/hooks/settings/useAccessTokens.d.ts +61 -0
  291. package/dist/hooks/settings/useAccessTokens.js +128 -0
  292. package/dist/hooks/settings/useFeedFormatPreference.d.ts +8 -0
  293. package/dist/hooks/settings/useFeedFormatPreference.js +35 -0
  294. package/dist/hooks/settings/useLanguagePreference.d.ts +11 -0
  295. package/dist/hooks/settings/useLanguagePreference.js +55 -0
  296. package/dist/hooks/settings/useNotificationPreferences.d.ts +26 -0
  297. package/dist/hooks/settings/useNotificationPreferences.js +79 -0
  298. package/dist/hooks/settings/usePushEnabledDevices.d.ts +111 -0
  299. package/dist/hooks/settings/usePushEnabledDevices.js +63 -0
  300. package/dist/hooks/settings/useThemePreference.d.ts +7 -0
  301. package/dist/hooks/settings/useThemePreference.js +27 -0
  302. package/dist/hooks/settings/useTimezonePreference.d.ts +14 -0
  303. package/dist/hooks/settings/useTimezonePreference.js +52 -0
  304. package/dist/hooks/useResolvedFeedFormat.d.ts +16 -0
  305. package/dist/hooks/useResolvedFeedFormat.js +20 -0
  306. package/dist/i18n/I18nProvider.js +21 -15
  307. package/dist/i18n/index.d.ts +14 -0
  308. package/dist/i18n/index.js +26 -0
  309. package/dist/lib/analyticsClicks.d.ts +1 -1
  310. package/dist/lib/analyticsClicks.js +4 -10
  311. package/dist/lib/audienceChoices.d.ts +14 -0
  312. package/dist/lib/audienceChoices.js +50 -0
  313. package/dist/lib/audienceSetting.d.ts +6 -0
  314. package/dist/lib/audienceSetting.js +18 -0
  315. package/dist/lib/capabilityMatrix.d.ts +76 -0
  316. package/dist/lib/capabilityMatrix.js +274 -0
  317. package/dist/lib/configuration/helpers.d.ts +12 -0
  318. package/dist/lib/configuration/helpers.js +38 -2
  319. package/dist/lib/groupCapabilityMatrix.d.ts +12 -0
  320. package/dist/lib/groupCapabilityMatrix.js +17 -0
  321. package/dist/lib/groupFormErrors.d.ts +15 -0
  322. package/dist/lib/groupFormErrors.js +61 -0
  323. package/dist/lib/initialsAvatar.d.ts +7 -0
  324. package/dist/lib/initialsAvatar.js +23 -0
  325. package/dist/lib/notificationBadge.d.ts +6 -2
  326. package/dist/lib/notificationBadge.js +17 -0
  327. package/dist/lib/postUnread.d.ts +7 -0
  328. package/dist/lib/postUnread.js +7 -0
  329. package/dist/lib/reactionEmojis.d.ts +28 -0
  330. package/dist/lib/reactionEmojis.js +55 -0
  331. package/dist/navigation/targets.d.ts +2 -1
  332. package/dist/pages/About.js +4 -7
  333. package/dist/pages/CodeOfConduct.js +4 -5
  334. package/dist/pages/Explore.js +2 -2
  335. package/dist/pages/PostDetail.js +11 -20
  336. package/dist/pages/Profile.js +9 -2
  337. package/dist/pages/Tags.d.ts +1 -1
  338. package/dist/pages/Tags.js +48 -6
  339. package/dist/pages/Tags.test.d.ts +1 -0
  340. package/dist/pages/Tags.test.js +75 -0
  341. package/dist/pages/Welcome.js +1 -1
  342. package/dist/pages/admin/Analytics.d.ts +1 -0
  343. package/dist/pages/admin/Analytics.js +1 -0
  344. package/dist/pages/admin/ConfigEditor.js +4 -8
  345. package/dist/pages/admin/Configuration.js +18 -2
  346. package/dist/pages/admin/ConfigurationCommunity.js +1 -1
  347. package/dist/pages/admin/ConfigurationCommunityFeed.d.ts +1 -0
  348. package/dist/pages/admin/ConfigurationCommunityFeed.js +69 -0
  349. package/dist/pages/admin/ConfigurationCommunityTimezone.d.ts +1 -0
  350. package/dist/pages/admin/ConfigurationCommunityTimezone.js +69 -0
  351. package/dist/pages/admin/ConfigurationPluginPage.d.ts +1 -0
  352. package/dist/pages/admin/ConfigurationPluginPage.js +21 -0
  353. package/dist/pages/admin/ConfigurationSso.d.ts +1 -0
  354. package/dist/pages/admin/ConfigurationSso.js +104 -0
  355. package/dist/pages/admin/ConfigurationSsoNew.d.ts +1 -0
  356. package/dist/pages/admin/ConfigurationSsoNew.js +44 -0
  357. package/dist/pages/admin/Dashboard.js +65 -20
  358. package/dist/pages/admin/Db.js +2 -2
  359. package/dist/pages/admin/GroupMembers.js +6 -39
  360. package/dist/pages/admin/Groups.js +4 -2
  361. package/dist/pages/admin/Invites.js +9 -4
  362. package/dist/pages/admin/MemberDetail.d.ts +1 -0
  363. package/dist/pages/admin/MemberDetail.js +66 -0
  364. package/dist/pages/admin/Members.js +39 -10
  365. package/dist/pages/admin/Plugins.d.ts +1 -0
  366. package/dist/pages/admin/Plugins.js +208 -0
  367. package/dist/pages/admin/Reports.js +17 -17
  368. package/dist/pages/admin/analytics/AnalyticsLayout.js +30 -5
  369. package/dist/pages/admin/analytics/Content.js +6 -6
  370. package/dist/pages/admin/analytics/Engagement.js +10 -10
  371. package/dist/pages/admin/analytics/Groups.js +5 -13
  372. package/dist/pages/admin/analytics/Members.js +10 -2
  373. package/dist/pages/admin/analytics/Overview.js +10 -10
  374. package/dist/pages/admin/analytics/PluginPage.d.ts +1 -0
  375. package/dist/pages/admin/analytics/PluginPage.js +26 -0
  376. package/dist/pages/admin/analytics/analyticsPluginTabs.d.ts +4 -0
  377. package/dist/pages/admin/analytics/analyticsPluginTabs.js +25 -0
  378. package/dist/pages/admin/community/CommunityRoles.js +107 -58
  379. package/dist/pages/admin/community/CommunityTheme.js +1 -1
  380. package/dist/pages/admin/community/useCommunityConfig.d.ts +6 -2
  381. package/dist/pages/admin/components/AdminGroupCard.js +1 -1
  382. package/dist/pages/admin/components/InviteWithEmailModal.js +5 -5
  383. package/dist/pages/admin/components/InviteWithLinkModal.d.ts +0 -1
  384. package/dist/pages/admin/components/InviteWithLinkModal.js +45 -14
  385. package/dist/pages/admin/components/ProfileRowActions.js +19 -13
  386. package/dist/pages/admin/components/RestoreBackupModal.js +6 -2
  387. package/dist/pages/admin/components/RestoreTestBackupModal.js +6 -4
  388. package/dist/pages/admin/components/ServerStatusSection.d.ts +5 -0
  389. package/dist/pages/admin/components/ServerStatusSection.js +62 -0
  390. package/dist/pages/admin/components/inviteQr.d.ts +8 -0
  391. package/dist/pages/admin/components/inviteQr.js +72 -0
  392. package/dist/pages/admin/components/serverStatusFormat.d.ts +3 -0
  393. package/dist/pages/admin/components/serverStatusFormat.js +32 -0
  394. package/dist/pages/admin/configurationPluginPages.d.ts +4 -0
  395. package/dist/pages/admin/configurationPluginPages.js +26 -0
  396. package/dist/pages/admin/configurationSsoShared.d.ts +307 -0
  397. package/dist/pages/admin/configurationSsoShared.js +192 -0
  398. package/dist/pages/articles/Edit.js +6 -40
  399. package/dist/pages/articles/Index.js +2 -1
  400. package/dist/pages/articles/New.js +6 -39
  401. package/dist/pages/auth/Closed.js +4 -2
  402. package/dist/pages/auth/Login.js +55 -21
  403. package/dist/pages/auth/Register.js +25 -9
  404. package/dist/pages/auth/RequestResetPassword.js +4 -4
  405. package/dist/pages/auth/ResetPassword.js +4 -4
  406. package/dist/pages/conversations/Index.js +19 -6
  407. package/dist/pages/conversations/Info.js +40 -3
  408. package/dist/pages/conversations/Show.js +29 -20
  409. package/dist/pages/events/Edit.js +11 -52
  410. package/dist/pages/events/Index.js +7 -4
  411. package/dist/pages/events/My.js +2 -2
  412. package/dist/pages/events/New.js +6 -57
  413. package/dist/pages/feeds/Bookmarks.js +4 -2
  414. package/dist/pages/feeds/Local.js +2 -1
  415. package/dist/pages/feeds/My.js +2 -1
  416. package/dist/pages/groups/Edit.js +11 -41
  417. package/dist/pages/groups/EditInfo.d.ts +1 -0
  418. package/dist/pages/groups/EditInfo.js +22 -0
  419. package/dist/pages/groups/EditRoles.d.ts +1 -0
  420. package/dist/pages/groups/EditRoles.js +29 -0
  421. package/dist/pages/groups/New.js +6 -58
  422. package/dist/pages/groups/Show.js +2 -2
  423. package/dist/pages/index.d.ts +13 -0
  424. package/dist/pages/index.js +13 -0
  425. package/dist/pages/jams/Event.js +3 -1
  426. package/dist/pages/jams/Index.js +3 -1
  427. package/dist/pages/payment/Success.js +2 -2
  428. package/dist/pages/settings/AccessTokens.js +10 -104
  429. package/dist/pages/settings/Account.js +43 -2
  430. package/dist/pages/settings/Billing.js +11 -7
  431. package/dist/pages/settings/Blocked.d.ts +1 -0
  432. package/dist/pages/settings/Blocked.js +29 -0
  433. package/dist/pages/settings/Feed.d.ts +1 -0
  434. package/dist/pages/settings/Feed.js +36 -0
  435. package/dist/pages/settings/Index.js +1 -1
  436. package/dist/pages/settings/Language.js +9 -44
  437. package/dist/pages/settings/NotificationPreferences.js +16 -68
  438. package/dist/pages/settings/PublicProfile.js +9 -0
  439. package/dist/pages/settings/PushEnabledDevices.js +10 -43
  440. package/dist/pages/settings/Theme.js +5 -21
  441. package/dist/pages/settings/Timezone.d.ts +1 -0
  442. package/dist/pages/settings/Timezone.js +19 -0
  443. package/dist/pwa/PwaProvider.d.ts +3 -2
  444. package/dist/pwa/PwaProvider.js +19 -2
  445. package/dist/pwa/pageReload.d.ts +12 -0
  446. package/dist/pwa/pageReload.js +30 -0
  447. package/dist/pwa/registration.js +3 -0
  448. package/dist/pwa/staleAppReload.d.ts +33 -0
  449. package/dist/pwa/staleAppReload.js +123 -0
  450. package/dist/pwa/useServiceWorker.d.ts +1 -1
  451. package/dist/pwa/useServiceWorker.js +15 -1
  452. package/dist/react-native.d.ts +46 -0
  453. package/dist/react-native.js +33 -0
  454. package/dist/stores/eventView.d.ts +10 -0
  455. package/dist/stores/eventView.js +14 -0
  456. package/dist/stores/feedFormat.d.ts +7 -0
  457. package/dist/stores/feedFormat.js +14 -0
  458. package/dist/stores/index.d.ts +3 -0
  459. package/dist/stores/index.js +2 -0
  460. package/dist/stores/newPosts.d.ts +70 -4
  461. package/package.json +12 -8
  462. package/dist/lib/groupCapabilityHelpers.d.ts +0 -24
  463. package/dist/lib/groupCapabilityHelpers.js +0 -119
@@ -0,0 +1,24 @@
1
+ import { type MatrixCapabilities } from '../lib/capabilityMatrix';
2
+ export interface CapabilityMatrixColumn {
3
+ key: string;
4
+ label: string;
5
+ }
6
+ export interface CapabilityMatrixProps {
7
+ /** Editor capability keys (leaves + wildcard allows). */
8
+ editorKeys: readonly string[];
9
+ /** Columns rendered across the matrix (relationships or roles). */
10
+ columns: CapabilityMatrixColumn[];
11
+ value: MatrixCapabilities;
12
+ onChange: (value: MatrixCapabilities) => void;
13
+ /** i18n prefix for title/description/capability/allowAll/stateHint. */
14
+ i18nPrefix: string;
15
+ /** Prefix for cell-state tooltips; defaults to `${i18nPrefix}.state`. */
16
+ stateI18nPrefix?: string;
17
+ /** Column that applies to everyone and cascades; omit to disable cascading. */
18
+ everyoneColumn?: string;
19
+ /** Hide the descriptive help text (matrix used inline). */
20
+ compact?: boolean;
21
+ /** Default capabilities to compare against for change highlighting. */
22
+ defaultCapabilities?: MatrixCapabilities;
23
+ }
24
+ export declare function CapabilityMatrix({ editorKeys, columns, value, onChange, i18nPrefix, stateI18nPrefix, everyoneColumn, compact, defaultCapabilities, }: CapabilityMatrixProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Fragment } from 'react';
3
+ import { Label } from '@openpeepshq/react-ui';
4
+ import { useT } from '../i18n/index.js';
5
+ import { capabilityEditorGroups, cycleCapabilityCell, getCapabilityCellState, } from '../lib/capabilityMatrix.js';
6
+ const cellClass = {
7
+ none: 'border-border bg-background hover:bg-surface',
8
+ 'implicit-remove': 'border-error/40 bg-error/15 text-error cursor-not-allowed',
9
+ 'implicit-add': 'border-success/40 bg-success/10 text-success hover:bg-success/20',
10
+ 'specific-add': 'border-success bg-success/25 text-success hover:bg-success/35',
11
+ 'specific-remove': 'border-error bg-error/25 text-error hover:bg-error/35',
12
+ };
13
+ export function CapabilityMatrix({ editorKeys, columns, value, onChange, i18nPrefix, stateI18nPrefix, everyoneColumn, compact = false, defaultCapabilities, }) {
14
+ const t = useT();
15
+ const options = {
16
+ editorKeys,
17
+ columns: columns.map((column) => column.key),
18
+ everyoneColumn,
19
+ };
20
+ const groups = capabilityEditorGroups(editorKeys);
21
+ const statePrefix = stateI18nPrefix ?? `${i18nPrefix}.state`;
22
+ const stateLabel = (state) => t(`${statePrefix}.${state}`, { defaultValue: state });
23
+ const cycleCap = (column, cap) => {
24
+ onChange(cycleCapabilityCell(options, value, column, cap));
25
+ };
26
+ const CapabilityCell = ({ column, cap, subLabel, }) => {
27
+ const state = getCapabilityCellState(options, value, column, cap);
28
+ const locked = state === 'implicit-remove';
29
+ const changed = getCapabilityCellState(options, defaultCapabilities ?? {}, column, cap) !== state;
30
+ return (_jsxs("button", { type: "button", disabled: locked, "aria-label": `${column} ${cap}: ${stateLabel(state)}`, title: stateLabel(state), "data-testid": `cap-cell-${column}-${cap}`, "data-cap-state": state, "data-changed": changed ? 'true' : undefined, className: `mx-auto flex h-7 w-7 flex-col items-center justify-center rounded border text-[0.6rem] font-semibold leading-none ${cellClass[state]} ${changed ? 'ring-primary ring-2' : ''}`, onClick: () => cycleCap(column, cap), children: [state === 'implicit-add' ? '~' : null, state === 'specific-add' ? '+' : null, state === 'specific-remove' ? '−' : null, state === 'implicit-remove' ? '×' : null, subLabel ? (_jsx("span", { className: "text-muted-foreground mt-0.5 text-[0.55rem] font-normal", children: subLabel })) : null] }));
31
+ };
32
+ return (_jsxs("div", { className: "space-y-2 px-1", children: [compact ? null : (_jsxs(_Fragment, { children: [_jsx(Label, { children: t(`${i18nPrefix}.title`, {
33
+ defaultValue: 'Role capabilities',
34
+ }) }), _jsx("p", { className: "text-muted-foreground text-sm", children: t(`${i18nPrefix}.description`, {
35
+ defaultValue: 'Click a cell to toggle a capability for this relationship.',
36
+ }) }), _jsx("p", { className: "text-muted-foreground text-xs", children: t(`${i18nPrefix}.stateHint`, {
37
+ defaultValue: 'Click a cell to cycle: empty → allow (+) → deny (−). ~ = allowed by a wildcard. × = denied by a wildcard and cannot be changed.',
38
+ }) })] })), _jsx("div", { className: "overflow-x-auto rounded-md border", children: _jsxs("table", { className: "w-full table-fixed text-left text-xs", children: [_jsxs("colgroup", { children: [_jsx("col", { className: "w-28" }), columns.map((column) => (_jsx("col", {}, column.key)))] }), _jsx("thead", { className: "bg-surface", children: _jsxs("tr", { children: [_jsx("th", { className: "p-2 font-medium", children: t(`${i18nPrefix}.capability`, {
39
+ defaultValue: 'Capability',
40
+ }) }), columns.map((column) => (_jsx("th", { className: "h-32 p-2 text-center font-medium", title: column.label, children: _jsx("span", { className: "block -rotate-90 whitespace-nowrap", children: column.label }) }, column.key)))] }) }), _jsx("tbody", { children: groups.map((group) => {
41
+ const groupLabel = group.prefix.replace(/-$/, '');
42
+ return (_jsxs(Fragment, { children: [_jsxs("tr", { className: "bg-surface/60 border-t", children: [_jsx("td", { className: "truncate p-2 font-medium", title: groupLabel, children: groupLabel || group.wildcard }), columns.map((column) => (_jsx("td", { className: "p-2 text-center", children: _jsx(CapabilityCell, { column: column.key, cap: group.wildcard, subLabel: t(`${i18nPrefix}.allowAll`, {
43
+ defaultValue: 'All',
44
+ }) }) }, column.key)))] }), group.leaves.map((cap) => {
45
+ const capLabel = cap.startsWith(group.prefix)
46
+ ? cap.slice(group.prefix.length)
47
+ : cap;
48
+ return (_jsxs("tr", { className: "border-t", children: [_jsx("td", { className: "truncate p-2 pl-4 font-mono", title: cap, children: capLabel }), columns.map((column) => (_jsx("td", { className: "p-2 text-center", children: _jsx(CapabilityCell, { column: column.key, cap: cap }) }, column.key)))] }, cap));
49
+ })] }, group.wildcard));
50
+ }) })] }) })] }));
51
+ }
@@ -0,0 +1 @@
1
+ export declare function RelationCapabilitiesEditor(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,138 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useState } from 'react';
3
+ import { accessTokenCapabilityEditorKeys, accessTokenRelationships, postCapabilityEditorKeys, postRelationships, profileCapabilityEditorKeys, profileRelationships, reportCapabilityEditorKeys, reportRelationships, } from '@openpeepshq/common/types';
4
+ import { checkRoleCapabilities } from '@openpeepshq/common/lib';
5
+ import { Button, Toast } from '@openpeepshq/react-ui';
6
+ import { useT } from '../i18n/index.js';
7
+ import { useOpenpeeps } from '../contexts/openpeeps/index.js';
8
+ import { useCurrentProfile } from './layout/IdentityContext.js';
9
+ import { CapabilityMatrix } from './CapabilityMatrix.js';
10
+ import { diffRelationshipMatrix } from '../lib/capabilityMatrix.js';
11
+ const relationObjects = [
12
+ {
13
+ key: 'post',
14
+ editorKeys: postCapabilityEditorKeys,
15
+ baseRelationships: postRelationships,
16
+ titleI18n: 'capabilities.relations.post.title',
17
+ descriptionI18n: 'capabilities.relations.post.description',
18
+ },
19
+ {
20
+ key: 'profile',
21
+ editorKeys: profileCapabilityEditorKeys,
22
+ baseRelationships: profileRelationships,
23
+ titleI18n: 'capabilities.relations.profile.title',
24
+ descriptionI18n: 'capabilities.relations.profile.description',
25
+ },
26
+ {
27
+ key: 'report',
28
+ editorKeys: reportCapabilityEditorKeys,
29
+ baseRelationships: reportRelationships,
30
+ titleI18n: 'capabilities.relations.report.title',
31
+ descriptionI18n: 'capabilities.relations.report.description',
32
+ },
33
+ {
34
+ key: 'accessToken',
35
+ editorKeys: accessTokenCapabilityEditorKeys,
36
+ baseRelationships: accessTokenRelationships,
37
+ titleI18n: 'capabilities.relations.accessToken.title',
38
+ descriptionI18n: 'capabilities.relations.accessToken.description',
39
+ },
40
+ ];
41
+ export function RelationCapabilitiesEditor() {
42
+ const t = useT();
43
+ const { openpeepsApi } = useOpenpeeps();
44
+ const currentProfile = useCurrentProfile();
45
+ const configQuery = openpeepsApi.admin.useConfigRead('openpeeps', 'capabilities');
46
+ const updateConfig = openpeepsApi.admin.updateConfigAction({
47
+ namespace: 'openpeeps',
48
+ name: 'capabilities',
49
+ });
50
+ const [draft, setDraft] = useState(null);
51
+ const [saving, setSaving] = useState(false);
52
+ const [status, setStatus] = useState(null);
53
+ const merged = configQuery.data?.config;
54
+ const defaults = configQuery.data?.defaults;
55
+ useEffect(() => {
56
+ if (merged) {
57
+ setDraft(JSON.parse(JSON.stringify(merged)));
58
+ }
59
+ }, [merged]);
60
+ // Sparse patch: only relationship buckets that diverge from the defaults, so
61
+ // saves never persist values identical to the shipped defaults.
62
+ const diffPatch = useMemo(() => {
63
+ if (!draft || !defaults)
64
+ return null;
65
+ const patch = {};
66
+ for (const obj of relationObjects) {
67
+ const edited = (draft[obj.key] ?? {});
68
+ const df = (defaults[obj.key] ?? {});
69
+ const columns = new Set([
70
+ ...obj.baseRelationships,
71
+ ...Object.keys(edited),
72
+ ...Object.keys(df),
73
+ ]);
74
+ const changed = diffRelationshipMatrix(edited, df, [...columns]);
75
+ if (Object.keys(changed).length > 0) {
76
+ patch[obj.key] = changed;
77
+ }
78
+ }
79
+ return Object.keys(patch).length === 0
80
+ ? null
81
+ : patch;
82
+ }, [draft, defaults]);
83
+ const objectColumns = (obj) => {
84
+ const rels = new Set(obj.baseRelationships);
85
+ const draftObj = draft?.[obj.key] ?? {};
86
+ Object.keys(draftObj).forEach((rel) => rels.add(rel));
87
+ return [...rels].map((rel) => ({ key: rel, label: rel }));
88
+ };
89
+ const updateObject = (objKey, next) => {
90
+ setDraft((prev) => prev
91
+ ? { ...prev, [objKey]: next }
92
+ : { [objKey]: next });
93
+ };
94
+ const canUpdateConfig = checkRoleCapabilities(currentProfile?.roles ?? [], [
95
+ 'core-config-update',
96
+ ]).success;
97
+ const handleSave = async () => {
98
+ if (!diffPatch || !canUpdateConfig)
99
+ return;
100
+ setSaving(true);
101
+ setStatus(null);
102
+ try {
103
+ await updateConfig({ config: diffPatch });
104
+ setStatus({
105
+ type: 'success',
106
+ message: t('capabilities.relations.saveSuccess', {
107
+ defaultValue: 'Relationship capabilities updated',
108
+ }),
109
+ });
110
+ // Capabilities config is consumed by boot-time singletons, so a reload
111
+ // re-initializes the in-memory config the same way AdminConfigEditor does.
112
+ window.location.reload();
113
+ }
114
+ catch (err) {
115
+ setStatus({ type: 'error', message: err.message });
116
+ }
117
+ finally {
118
+ setSaving(false);
119
+ }
120
+ };
121
+ const handleRestoreDefaults = () => {
122
+ if (defaults) {
123
+ setDraft(JSON.parse(JSON.stringify(defaults)));
124
+ }
125
+ };
126
+ if (configQuery.isLoading || !draft) {
127
+ return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
128
+ }
129
+ return (_jsxs("div", { className: "flex flex-col gap-6", children: [relationObjects.map((obj) => (_jsxs("div", { className: "space-y-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: t(obj.titleI18n) }), _jsx(CapabilityMatrix, { editorKeys: [...obj.editorKeys], columns: objectColumns(obj), value: (draft[obj.key] ?? {}), onChange: (next) => updateObject(obj.key, next), i18nPrefix: "capabilities.relations", stateI18nPrefix: "groups.capabilities.state", everyoneColumn: "none", compact: true, defaultCapabilities: (defaults?.[obj.key] ?? {}) }), _jsx("p", { className: "text-muted-foreground text-xs", children: t(obj.descriptionI18n, {
130
+ defaultValue: 'Choose what each relationship can do for this object type.',
131
+ }) })] }, obj.key))), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Button, { variant: "default", action: handleSave, disabled: saving || !canUpdateConfig || !diffPatch, loadingContent: t('common.saving', { defaultValue: 'Saving…' }), title: t('common.save', { defaultValue: 'Save' }), children: saving
132
+ ? t('common.saving', { defaultValue: 'Saving…' })
133
+ : t('common.save', { defaultValue: 'Save' }) }), canUpdateConfig && diffPatch ? (_jsx(Button, { variant: "outline", action: handleRestoreDefaults, title: t('common.restoreDefaults', {
134
+ defaultValue: 'Restore defaults',
135
+ }), children: t('common.restoreDefaults', { defaultValue: 'Restore defaults' }) })) : null, !canUpdateConfig ? (_jsx("span", { className: "text-muted-foreground text-xs", children: t('capabilities.relations.noUpdateCapability', {
136
+ defaultValue: 'You can view but not edit relationship capabilities without core-config-update.',
137
+ }) })) : null] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null] }));
138
+ }
@@ -0,0 +1,10 @@
1
+ import type { Role } from '@openpeepshq/common/types';
2
+ export interface RoleCapabilityMatrixProps {
3
+ roles: Role[];
4
+ }
5
+ /**
6
+ * Instance-admin matrix for the capabilities of every role. Columns are the
7
+ * instance roles, rows are the role capability keys — mirrors the group roles
8
+ * matrix, but without an "everyone" column since roles are independent.
9
+ */
10
+ export declare function RoleCapabilityMatrix({ roles }: RoleCapabilityMatrixProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,100 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useState } from 'react';
3
+ import { currentRoleDefaults, defaultRoles, roleCapabilityEditorKeys, } from '@openpeepshq/common/types';
4
+ import { checkRoleCapabilities } from '@openpeepshq/common/lib';
5
+ import { Button, Input, Switch, Toast } from '@openpeepshq/react-ui';
6
+ import { useT } from '../i18n/index.js';
7
+ import { useOpenpeeps } from '../contexts/openpeeps/index.js';
8
+ import { useCurrentProfile } from './layout/IdentityContext.js';
9
+ import { CapabilityMatrix } from './CapabilityMatrix.js';
10
+ import { filterRoles, roleDefaultCapabilities } from '../lib/capabilityMatrix.js';
11
+ const builtInRoleKeys = new Set(defaultRoles.map((role) => role.key));
12
+ /**
13
+ * Instance-admin matrix for the capabilities of every role. Columns are the
14
+ * instance roles, rows are the role capability keys — mirrors the group roles
15
+ * matrix, but without an "everyone" column since roles are independent.
16
+ */
17
+ export function RoleCapabilityMatrix({ roles }) {
18
+ const t = useT();
19
+ const { openpeepsApi } = useOpenpeeps();
20
+ const currentProfile = useCurrentProfile();
21
+ const updateRole = openpeepsApi.admin.updateRoleAction();
22
+ const [draft, setDraft] = useState({});
23
+ const [saving, setSaving] = useState(false);
24
+ const [showDefault, setShowDefault] = useState(true);
25
+ const [showCustom, setShowCustom] = useState(true);
26
+ const [filter, setFilter] = useState('');
27
+ const [status, setStatus] = useState(null);
28
+ const loadedDraft = useMemo(() => Object.fromEntries(roles.map((role) => [
29
+ role.key,
30
+ role.capabilities ?? { add: [], remove: [] },
31
+ ])), [roles]);
32
+ useEffect(() => {
33
+ setDraft(loadedDraft);
34
+ }, [loadedDraft]);
35
+ const roleDefaults = useMemo(() => roleDefaultCapabilities(roles), [roles]);
36
+ const columns = useMemo(() => filterRoles(roles, { showDefault, showCustom, filter }).map((role) => ({
37
+ key: role.key,
38
+ label: role.displayName || role.key,
39
+ })), [roles, showDefault, showCustom, filter]);
40
+ const visibleCount = columns.length;
41
+ const changedRoleIds = useMemo(() => roles
42
+ .filter((role) => JSON.stringify(draft[role.key]) !==
43
+ JSON.stringify(role.capabilities ?? { add: [], remove: [] }))
44
+ .map((role) => role.id), [roles, draft]);
45
+ const deviatesFromDefaults = useMemo(() => roles.some((role) => JSON.stringify(draft[role.key]) !==
46
+ JSON.stringify(roleDefaults[role.key])), [roles, draft, roleDefaults]);
47
+ const canUpdateRoles = checkRoleCapabilities(currentProfile?.roles ?? [], [
48
+ 'core-roles-update',
49
+ ]).success;
50
+ const handleSave = async () => {
51
+ if (!canUpdateRoles || changedRoleIds.length === 0)
52
+ return;
53
+ setSaving(true);
54
+ setStatus(null);
55
+ try {
56
+ await Promise.all(roles
57
+ .filter((role) => changedRoleIds.includes(role.id))
58
+ .map((role) => updateRole({
59
+ key: role.key,
60
+ default: role.default,
61
+ displayName: role.displayName,
62
+ description: role.description,
63
+ capabilities: draft[role.key] ?? role.capabilities,
64
+ // Anchor built-in roles to the defaults version they are
65
+ // customized against, so later default changes can be merged
66
+ // back into the customization on server start.
67
+ ...(builtInRoleKeys.has(role.key)
68
+ ? { baseVersion: currentRoleDefaults.version }
69
+ : {}),
70
+ }, { roleId: role.id })));
71
+ setStatus({
72
+ type: 'success',
73
+ message: t('capabilities.roles.saveSuccess', {
74
+ defaultValue: 'Role capabilities updated',
75
+ }),
76
+ });
77
+ }
78
+ catch (err) {
79
+ setStatus({ type: 'error', message: err.message });
80
+ }
81
+ finally {
82
+ setSaving(false);
83
+ }
84
+ };
85
+ return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-x-5 gap-y-2 px-1", children: [_jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx(Switch, { checked: showDefault, onCheckedChange: setShowDefault }), t('capabilities.roles.defaultRoles', {
86
+ defaultValue: 'Default roles',
87
+ })] }), _jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx(Switch, { checked: showCustom, onCheckedChange: setShowCustom }), t('capabilities.roles.customRoles', {
88
+ defaultValue: 'Custom roles',
89
+ })] }), _jsx(Input, { className: "max-w-56", value: filter, placeholder: t('capabilities.roles.filterPlaceholder', {
90
+ defaultValue: 'Filter roles…',
91
+ }), onChange: (e) => setFilter(e.target.value) })] }), visibleCount === 0 ? (_jsx("p", { className: "text-muted-foreground px-1 text-sm", children: t('capabilities.roles.noRolesMatch', {
92
+ defaultValue: 'No roles match the filter.',
93
+ }) })) : (_jsx(CapabilityMatrix, { editorKeys: [...roleCapabilityEditorKeys], columns: columns, value: draft, onChange: setDraft, i18nPrefix: "capabilities.roles", stateI18nPrefix: "groups.capabilities.state", everyoneColumn: undefined, defaultCapabilities: loadedDraft })), _jsxs("div", { className: "flex items-center gap-3 px-1", children: [_jsx(Button, { variant: "default", action: handleSave, disabled: saving || !canUpdateRoles || changedRoleIds.length === 0, loadingContent: t('common.saving', { defaultValue: 'Saving…' }), title: t('common.save', { defaultValue: 'Save' }), children: saving
94
+ ? t('common.saving', { defaultValue: 'Saving…' })
95
+ : t('common.save', { defaultValue: 'Save' }) }), canUpdateRoles && deviatesFromDefaults ? (_jsx(Button, { variant: "outline", action: () => setDraft(roleDefaults), title: t('common.restoreDefaults', {
96
+ defaultValue: 'Restore defaults',
97
+ }), children: t('common.restoreDefaults', { defaultValue: 'Restore defaults' }) })) : null, !canUpdateRoles ? (_jsx("span", { className: "text-muted-foreground text-xs", children: t('capabilities.roles.noUpdateCapability', {
98
+ defaultValue: 'You can view but not edit role capabilities without core-roles-update.',
99
+ }) })) : null] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null] }));
100
+ }
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@openpeepshq/react-ui';
2
+ import { Dialog, DialogActions, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from '@openpeepshq/react-ui';
3
3
  import { useT } from '../../i18n/index.js';
4
4
  import { useRouter } from '../../contexts/router/index.js';
5
5
  /**
@@ -12,8 +12,10 @@ export function SignUpLoginModal({ onClose }) {
12
12
  const router = useRouter();
13
13
  return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-md", showCloseButton: false, children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: t('accounts.login.title', { defaultValue: 'Login' }) }), _jsx(DialogDescription, { children: t('accounts.login.description', {
14
14
  defaultValue: 'Login to your account',
15
- }) })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", action: onClose, children: t('common.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "default", action: () => {
16
- router.navigate({ type: 'auth', mode: 'login' });
17
- onClose();
18
- }, children: t('accounts.login.loginButton', { defaultValue: 'Log In' }) })] })] }) }));
15
+ }) })] }), _jsx(DialogActions, { cancelLabel: t('common.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('accounts.login.loginButton', {
16
+ defaultValue: 'Log In',
17
+ }), onAction: () => {
18
+ router.navigate({ type: 'auth', mode: 'login' });
19
+ onClose();
20
+ } })] }) }));
19
21
  }
@@ -2,9 +2,11 @@ export interface ConfigMenuButtonProps {
2
2
  translationPrefix: string;
3
3
  action: string;
4
4
  testId?: string;
5
+ titleFallback?: string;
6
+ descriptionFallback?: string;
5
7
  }
6
8
  /**
7
9
  * Row in a settings / configuration menu: title, description and a chevron.
8
10
  * Shared by the admin configuration screens and the user settings index.
9
11
  */
10
- export declare function ConfigMenuButton({ translationPrefix, action, testId, }: ConfigMenuButtonProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function ConfigMenuButton({ translationPrefix, action, testId, titleFallback, descriptionFallback, }: ConfigMenuButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -6,7 +6,7 @@ import { useT } from '../../i18n/index.js';
6
6
  * Row in a settings / configuration menu: title, description and a chevron.
7
7
  * Shared by the admin configuration screens and the user settings index.
8
8
  */
9
- export function ConfigMenuButton({ translationPrefix, action, testId, }) {
9
+ export function ConfigMenuButton({ translationPrefix, action, testId, titleFallback, descriptionFallback, }) {
10
10
  const t = useT();
11
- return (_jsxs(Link, { to: action, "data-testid": testId, className: "hover:bg-surface flex w-full items-center justify-between px-4 py-3 text-start", children: [_jsxs("div", { children: [_jsx("div", { className: "font-medium", children: t(`${translationPrefix}.title`) }), _jsx("div", { className: "text-muted-foreground text-xs", children: t(`${translationPrefix}.description`) })] }), _jsx("span", { "aria-hidden": "true", children: _jsx(ChevronRight, { className: "h-4 w-4" }) })] }));
11
+ return (_jsxs(Link, { to: action, "data-testid": testId, className: "hover:bg-surface flex w-full items-center justify-between px-4 py-3 text-start", children: [_jsxs("div", { children: [_jsx("div", { className: "font-medium", children: t(`${translationPrefix}.title`, titleFallback ? { defaultValue: titleFallback } : {}) }), _jsx("div", { className: "text-muted-foreground text-xs", children: t(`${translationPrefix}.description`, descriptionFallback ? { defaultValue: descriptionFallback } : {}) })] }), _jsx("span", { "aria-hidden": "true", children: _jsx(ChevronRight, { className: "h-4 w-4" }) })] }));
12
12
  }
@@ -3,7 +3,7 @@ import { useMemo, useState } from 'react';
3
3
  import { z, ZodArray } from 'zod';
4
4
  import { Minus, Plus } from 'lucide-react';
5
5
  import { useT } from '../../i18n/index.js';
6
- import { equal, unwrap } from '../../lib/configuration/helpers.js';
6
+ import { defaultFromSchema, equal, unwrap, } from '../../lib/configuration/helpers.js';
7
7
  import { ConfigurationCategory } from './ConfigurationCategory.js';
8
8
  import { ConfigurationValueEditor } from './ConfigurationValueEditor.js';
9
9
  export function ConfigurationList({ schema, config, path = [], value: valueProp, onChange, disabled: disabledProp, }) {
@@ -11,14 +11,15 @@ export function ConfigurationList({ schema, config, path = [], value: valueProp,
11
11
  const disabled = disabledProp ?? schema.description === 'fixed';
12
12
  const elementSchema = (schema.element ?? schema._def.type);
13
13
  const unwrappedElementSchema = unwrap(elementSchema);
14
- const defaults = useMemo(() => elementSchema.parse(undefined), [elementSchema]);
14
+ const defaults = useMemo(() => defaultFromSchema(elementSchema), [elementSchema]);
15
15
  const [value, setValue] = useState(valueProp ?? [...config]);
16
16
  const setAndNotify = (next) => {
17
17
  setValue(next);
18
18
  onChange(next);
19
19
  };
20
20
  const dirty = !equal(config, value); // list roots are arrays
21
- return (_jsxs("div", { className: "mt-4 pl-4", children: [_jsx("p", { className: dirty ? 'font-bold' : '', children: path.at(-1) || t('admin.configuration.unnamedSection', { defaultValue: 'Section' }) }), value.map((_, index) => (_jsxs("div", { children: [unwrappedElementSchema instanceof z.ZodObject ? (_jsx(ConfigurationCategory, { schema: unwrappedElementSchema, path: [...path, String(index)], config: (config?.[index] ?? defaults), defaults: defaults, value: (value[index] ?? defaults), onChange: (entry) => {
21
+ return (_jsxs("div", { className: "mt-4 pl-4", children: [_jsx("p", { className: dirty ? 'font-bold' : '', children: path.at(-1) ||
22
+ t('admin.configuration.unnamedSection', { defaultValue: 'Section' }) }), value.map((_, index) => (_jsxs("div", { children: [unwrappedElementSchema instanceof z.ZodObject ? (_jsx(ConfigurationCategory, { schema: unwrappedElementSchema, path: [...path, String(index)], config: (config?.[index] ?? defaults), defaults: defaults, value: (value[index] ?? defaults), onChange: (entry) => {
22
23
  const next = [...value];
23
24
  next[index] = entry;
24
25
  setAndNotify(next);
@@ -26,5 +27,7 @@ export function ConfigurationList({ schema, config, path = [], value: valueProp,
26
27
  const next = [...value];
27
28
  next[index] = entry;
28
29
  setAndNotify(next);
29
- }, disabled: disabled })), _jsx("button", { type: "button", title: t('common.listEditor.removeTitle', { defaultValue: 'Remove' }), onClick: () => setAndNotify(value.toSpliced(index, 1)), children: _jsx(Minus, { className: "h-4 w-4" }) })] }, index))), _jsx("button", { type: "button", title: t('common.listEditor.addTitle', { defaultValue: 'Add' }), onClick: () => setAndNotify([...value, structuredClone(defaults)]), children: _jsx(Plus, { className: "h-4 w-4" }) })] }));
30
+ }, disabled: disabled })), _jsx("button", { type: "button", title: t('common.listEditor.removeTitle', {
31
+ defaultValue: 'Remove',
32
+ }), onClick: () => setAndNotify(value.toSpliced(index, 1)), children: _jsx(Minus, { className: "h-4 w-4" }) })] }, index))), _jsx("button", { type: "button", title: t('common.listEditor.addTitle', { defaultValue: 'Add' }), onClick: () => setAndNotify([...value, structuredClone(defaults)]), children: _jsx(Plus, { className: "h-4 w-4" }) })] }));
30
33
  }
@@ -3,7 +3,7 @@ import { useEffect, useMemo, useState } from 'react';
3
3
  import { z } from 'zod';
4
4
  import { Input, Textarea } from '@openpeepshq/react-ui';
5
5
  import { useT } from '../../i18n/index.js';
6
- import { unwrap } from '../../lib/configuration/helpers.js';
6
+ import { configurationLabelKey, unwrap } from '../../lib/configuration/helpers.js';
7
7
  export function ConfigurationValueEditor({ schema, config, defaults, path, value: valueProp, onChange, disabled: disabledProp, }) {
8
8
  const t = useT();
9
9
  const unwrappedSchema = useMemo(() => unwrap(schema), [schema]);
@@ -17,7 +17,7 @@ export function ConfigurationValueEditor({ schema, config, defaults, path, value
17
17
  onChange(next);
18
18
  };
19
19
  const dirty = value !== config;
20
- const label = t(String(path.at(-1)), {
20
+ const label = t(configurationLabelKey(path), {
21
21
  defaultValue: String(path.at(-1)),
22
22
  });
23
23
  const password = schema.description === 'password';
@@ -0,0 +1,7 @@
1
+ import type { PublicProfile } from '@openpeepshq/common/types';
2
+ export interface ConversationParticipantsModalProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ participants: PublicProfile[];
6
+ }
7
+ export declare const ConversationParticipantsModal: ({ open, onOpenChange, participants, }: ConversationParticipantsModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog, DialogContent, DialogHeader, DialogTitle, } from '@openpeepshq/react-ui';
3
+ import { useT } from '../../i18n/index.js';
4
+ import { ProfileCard } from '../profile/index.js';
5
+ export const ConversationParticipantsModal = ({ open, onOpenChange, participants, }) => {
6
+ const t = useT();
7
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "flex max-h-[85vh] max-w-md flex-col gap-0 overflow-hidden p-0", children: [_jsx(DialogHeader, { className: "p-6 pb-2 pr-12", children: _jsx(DialogTitle, { children: t('conversations.participants.title', {
8
+ defaultValue: 'Participants',
9
+ }) }) }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: participants.map((profile) => (_jsx(ProfileCard, { profile: profile, showAction: false }, profile.id))) })] }) }));
10
+ };
@@ -1,7 +1,9 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, } from '@openpeepshq/react-ui';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { blockedPairIds } from '@openpeepshq/common/lib';
3
+ import { Button, Dialog, DialogActions, DialogContent, DialogFooter, DialogHeader, DialogTitle, } from '@openpeepshq/react-ui';
3
4
  import { useT } from '../../i18n/index.js';
4
5
  import { useCreateConversation } from '../../hooks/conversations/useCreateConversation.js';
6
+ import { OpenpeepsMarkdownInput } from '../post/index.js';
5
7
  import { ProfilesInput } from '../profile/index.js';
6
8
  const MAX_MESSAGE_LENGTH = 500;
7
9
  export const CreateNewConversation = ({ profiles: initialProfiles = [], message: initialMessage = '', skipProfileSelection = false, onClose, }) => {
@@ -14,15 +16,15 @@ export const CreateNewConversation = ({ profiles: initialProfiles = [], message:
14
16
  });
15
17
  return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsx(DialogContent, { className: "flex max-h-[85vh] max-w-lg flex-col overflow-hidden", children: step === 1 ? (_jsxs(_Fragment, { children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('conversations.createNew.title', {
16
18
  defaultValue: 'New message',
17
- }) }) }), _jsx("div", { className: "min-h-0 flex-1 space-y-2 overflow-y-auto", children: _jsx(ProfilesInput, { value: selectedProfiles, onChange: setSelectedProfiles, banlist: me ? [me] : [], placeholder: t('conversations.createNew.searchPlaceholder', {
19
+ }) }) }), _jsx("div", { className: "min-h-0 flex-1 space-y-2 overflow-y-auto", children: _jsx(ProfilesInput, { value: selectedProfiles, onChange: setSelectedProfiles, banlist: me ? [me.id, ...blockedPairIds(me)] : [], placeholder: t('conversations.createNew.searchPlaceholder', {
18
20
  defaultValue: 'Search members…',
19
21
  }), title: t('conversations.createNew.title', {
20
22
  defaultValue: 'New message',
21
- }) }) }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "ghost", action: onClose, children: t('common.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "default", disabled: selectedProfiles.length === 0, action: () => setStep(2), children: t('common.next', { defaultValue: 'Next' }) })] })] })) : (_jsxs(_Fragment, { children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('conversations.createNew.sendMessage', {
23
+ }) }) }), _jsx(DialogActions, { cancelLabel: t('common.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('common.next', { defaultValue: 'Next' }), onAction: () => setStep(2), disabled: selectedProfiles.length === 0 })] })) : (_jsxs(_Fragment, { children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('conversations.createNew.sendMessage', {
22
24
  defaultValue: 'Send message',
23
- }) }) }), _jsx("textarea", { className: "bg-surface min-h-32 w-full rounded-lg border p-3 text-sm outline-none", placeholder: t('conversations.createNew.messagePlaceholder', {
24
- defaultValue: 'Write a message…',
25
- }), value: message, maxLength: MAX_MESSAGE_LENGTH, onChange: (e) => setMessage(e.target.value) }), error ? _jsx("p", { className: "text-error text-sm", children: error }) : null, _jsxs(DialogFooter, { className: "flex-wrap gap-2", children: [!skipProfileSelection ? (_jsx(Button, { variant: "outline", action: () => setStep(1), children: t('common.back', { defaultValue: 'Back' }) })) : (_jsx(Button, { variant: "outline", action: onClose, children: t('common.cancel', { defaultValue: 'Cancel' }) })), _jsx("span", { className: "text-muted-foreground flex-1 text-right text-sm", children: MAX_MESSAGE_LENGTH - message.length }), _jsx(Button, { variant: "default", disabled: submitting || selectedProfiles.length === 0, action: send, children: submitting
25
+ }) }) }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsx(OpenpeepsMarkdownInput, { rows: 5, value: message, onChange: setMessage, maxLength: MAX_MESSAGE_LENGTH, placeholder: t('conversations.createNew.messagePlaceholder', {
26
+ defaultValue: 'Write a message…',
27
+ }) }) }), error ? _jsx("p", { className: "text-error text-sm", children: error }) : null, _jsxs(DialogFooter, { className: "flex-wrap gap-2", children: [!skipProfileSelection ? (_jsx(Button, { variant: "outline", action: () => setStep(1), children: t('common.back', { defaultValue: 'Back' }) })) : (_jsx(Button, { variant: "outline", action: onClose, children: t('common.cancel', { defaultValue: 'Cancel' }) })), _jsx(Button, { variant: "default", disabled: submitting || selectedProfiles.length === 0, action: send, children: submitting
26
28
  ? t('common.sending', { defaultValue: 'Sending…' })
27
29
  : t('conversations.createNew.send', {
28
30
  defaultValue: 'Send',
@@ -30,11 +30,14 @@ export function MessageInThread({ previous, message, multipleParticipants = true
30
30
  adjustUnread: isUnread,
31
31
  });
32
32
  const { added, removed } = audienceDiff(previous, message);
33
+ // The author leaving their own conversation is shown via the "left" label
34
+ // below, so exclude them from the "removedBy" avatars to avoid redundancy.
35
+ const removedOthers = removed.filter((p) => p.id !== message.profile.id);
33
36
  const name = profileName(message.profile);
34
37
  const isMe = message.profile.id === me?.id;
35
38
  return (_jsxs(_Fragment, { children: [!previous && (_jsx("div", { className: "mt-2 w-full text-center text-sm", children: message.inReplyToId
36
39
  ? t('conversations.messageInThread.addedBy', { name })
37
40
  : t('conversations.messageInThread.startedBy', { name }) })), previous &&
38
41
  inAudience(previous, message.profile) &&
39
- !inAudience(message, message.profile) && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Avatar, { profile: message.profile, size: 2.5, borderless: true, navigate: true }), t('conversations.messageInThread.left', { name })] })), previous && added.length > 0 && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex -space-x-2", children: added.map((p) => (_jsx(Avatar, { profile: p, size: 2.5, borderless: true, navigate: true }, p.id))) }), t('conversations.messageInThread.addedBy', { name })] })), removed.length > 0 && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex -space-x-2", children: removed.map((p) => (_jsx(Avatar, { profile: p, size: 2.5, borderless: true, navigate: true }, p.id))) }), t('conversations.messageInThread.removedBy', { name })] })), _jsxs("article", { ref: postViewRef, className: "flex", children: [!isMe && multipleParticipants && (_jsx(Avatar, { containerClassName: "mt-6 mr-2", profile: message.profile, navigate: true })), _jsx("div", { className: "min-w-0 flex-1", children: _jsx(ConversationMessageBubble, { message: message, unread: isUnread }) })] }), _jsxs("div", { className: `mt-2 w-full text-sm ${isMe ? 'text-right' : 'text-left'}`, children: [multipleParticipants && !isMe && _jsxs("span", { children: [name, " \u00B7 "] }), _jsx(UpdatingDate, { date: message.createdAt })] })] }));
42
+ !inAudience(message, message.profile) && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Avatar, { profile: message.profile, size: 2.5, borderless: true, navigate: true }), t('conversations.messageInThread.left', { name })] })), previous && added.length > 0 && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex -space-x-2", children: added.map((p) => (_jsx(Avatar, { profile: p, size: 2.5, borderless: true, navigate: true }, p.id))) }), t('conversations.messageInThread.addedBy', { name })] })), removedOthers.length > 0 && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex -space-x-2", children: removedOthers.map((p) => (_jsx(Avatar, { profile: p, size: 2.5, borderless: true, navigate: true }, p.id))) }), t('conversations.messageInThread.removedBy', { name })] })), _jsxs("article", { ref: postViewRef, className: "flex", children: [!isMe && multipleParticipants && (_jsx(Avatar, { containerClassName: "mt-6 mr-2", profile: message.profile, navigate: true })), _jsx("div", { className: "min-w-0 flex-1", children: _jsx(ConversationMessageBubble, { message: message, unread: isUnread }) })] }), _jsxs("div", { className: `mt-2 w-full text-sm ${isMe ? 'text-right' : 'text-left'}`, children: [multipleParticipants && !isMe && _jsxs("span", { children: [name, " \u00B7 "] }), _jsx(UpdatingDate, { date: message.createdAt })] })] }));
40
43
  }
@@ -3,6 +3,8 @@ export type { CreateNewConversationProps } from './CreateNewConversation';
3
3
  export { CreateNewConversationProvider, useCreateNewConversation, } from './CreateNewConversationContext';
4
4
  export type { CreateConversationOptions } from './CreateNewConversationContext';
5
5
  export { DirectMessagesHeaderActions } from './DirectMessagesHeaderActions';
6
+ export { ConversationParticipantsModal } from './ConversationParticipantsModal';
7
+ export type { ConversationParticipantsModalProps } from './ConversationParticipantsModal';
6
8
  export { ConversationMessageBubble } from './ConversationMessageBubble';
7
9
  export { MessageInThread } from './MessageInThread';
8
10
  export type { MessageInThreadProps } from './MessageInThread';
@@ -1,5 +1,6 @@
1
1
  export { CreateNewConversation } from './CreateNewConversation.js';
2
2
  export { CreateNewConversationProvider, useCreateNewConversation, } from './CreateNewConversationContext.js';
3
3
  export { DirectMessagesHeaderActions } from './DirectMessagesHeaderActions.js';
4
+ export { ConversationParticipantsModal } from './ConversationParticipantsModal.js';
4
5
  export { ConversationMessageBubble } from './ConversationMessageBubble.js';
5
6
  export { MessageInThread } from './MessageInThread.js';
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useState } from 'react';
3
3
  import Cropper, {} from 'react-easy-crop';
4
- import { Badge, Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, Label, Textarea, } from '@openpeepshq/react-ui';
4
+ import { Badge, Dialog, DialogActions, DialogContent, DialogHeader, DialogTitle, Label, Textarea, } from '@openpeepshq/react-ui';
5
5
  import { useT } from '../../i18n/index.js';
6
6
  import { convertToWebpIfHeic, getCroppedImg } from '../../lib/canvasUtils.js';
7
7
  const parseAspectRatio = (ratio) => {
@@ -67,7 +67,7 @@ export function ImageEditModal({ file, previewUrl, open, onClose, onConfirm, sho
67
67
  defaultValue: 'Crop ratio',
68
68
  }) }), _jsx("div", { className: "flex flex-wrap gap-2", children: ASPECT_RATIOS.map((item, index) => (_jsx("button", { type: "button", title: item.label, onClick: () => setAspectIndex(index), children: _jsx(Badge, { status: item.label, variant: aspectIndex === index ? 'default' : 'outline' }) }, item.label))) })] })) : null, showAltInput ? (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: "alt-text", children: t('common.media.altText', { defaultValue: 'Alt text' }) }), _jsx(Textarea, { id: "alt-text", rows: 3, value: description, onChange: (e) => setDescription(e.target.value), placeholder: t('common.media.altTextDescription', {
69
69
  defaultValue: 'Describe the image for accessibility',
70
- }) })] })) : null] })) : null] }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "ghost", action: onClose, children: t('common.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "default", action: confirm, disabled: submitting, children: submitting
71
- ? t('common.uploading', { defaultValue: 'Uploading…' })
72
- : t('common.add', { defaultValue: 'Add' }) })] })] }) }));
70
+ }) })] })) : null] })) : null] }), _jsx(DialogActions, { cancelLabel: t('common.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: submitting
71
+ ? t('common.uploading', { defaultValue: 'Uploading…' })
72
+ : t('common.add', { defaultValue: 'Add' }), onAction: confirm, disabled: submitting })] }) }));
73
73
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useRef, useState } from 'react';
3
3
  import { MapPin } from 'lucide-react';
4
- import { Button, Input, Label, LoadingIcon, cn } from '@openpeepshq/react-ui';
4
+ import { Button, Input, Label, LoadingSpinner, cn } from '@openpeepshq/react-ui';
5
5
  import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
6
6
  import { useT } from '../../i18n/index.js';
7
7
  /**
@@ -55,5 +55,5 @@ export function LocationInput({ title = '', description = '', value, onChange, p
55
55
  });
56
56
  }, debounceMs);
57
57
  };
58
- return (_jsxs(Label, { title: title, description: description, classes: "relative", children: [_jsxs("div", { className: cn('op-input-group grid grid-cols-[auto_1fr_auto] rounded-full'), children: [_jsx("div", { className: "op-input-group-shim", children: _jsx(MapPin, { className: "size-4" }) }), _jsx(Input, { value: name, type: "text", placeholder: placeholder ?? title, disabled: disabled, readOnly: readOnly, onChange: onTextChange })] }), (pending || suggestions) && (_jsx("div", { className: "op-card absolute bottom-16 flex w-full flex-col items-start gap-3 p-2 text-sm", children: pending ? (_jsxs("div", { className: "flex w-full flex-col items-center justify-center gap-2 p-4", children: [_jsx("span", { children: t('location.lookup', { name }) }), _jsx(LoadingIcon, {})] })) : (_jsxs(_Fragment, { children: [_jsx(Button, { className: "border-border hover:bg-surface w-full border p-2 text-left", action: () => onSelection({ name }), children: name }), suggestions?.map((res, idx) => (_jsx(Button, { className: "border-border hover:bg-surface w-full border p-2 text-left", action: () => onSelection(res), children: res.name }, idx)))] })) }))] }));
58
+ return (_jsxs(Label, { title: title, description: description, classes: "relative", children: [_jsxs("div", { className: cn('op-input-group grid grid-cols-[auto_1fr_auto] rounded-full'), children: [_jsx("div", { className: "op-input-group-shim", children: _jsx(MapPin, { className: "size-4" }) }), _jsx(Input, { value: name, type: "text", placeholder: placeholder ?? title, disabled: disabled, readOnly: readOnly, onChange: onTextChange })] }), (pending || suggestions) && (_jsx("div", { className: "op-card absolute bottom-16 flex w-full flex-col items-start gap-3 p-2 text-sm", children: pending ? (_jsxs("div", { className: "flex w-full flex-col items-center justify-center gap-2 p-4", children: [_jsx("span", { children: t('location.lookup', { name }) }), _jsx(LoadingSpinner, {})] })) : (_jsxs(_Fragment, { children: [_jsx(Button, { className: "border-border hover:bg-surface w-full border p-2 text-left", action: () => onSelection({ name }), children: name }), suggestions?.map((res, idx) => (_jsx(Button, { className: "border-border hover:bg-surface w-full border p-2 text-left", action: () => onSelection(res), children: res.name }, idx)))] })) }))] }));
59
59
  }
@@ -0,0 +1,7 @@
1
+ export interface TimeZoneSelectProps {
2
+ id?: string;
3
+ value: string;
4
+ onChange: (timeZone: string) => void;
5
+ optionLabel?: (timeZone: string) => string;
6
+ }
7
+ export declare function TimeZoneSelect({ id, value, onChange, optionLabel, }: TimeZoneSelectProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ianaTimeZones } from '@openpeepshq/common/lib';
3
+ export function TimeZoneSelect({ id, value, onChange, optionLabel, }) {
4
+ const zones = ianaTimeZones();
5
+ const options = value && !zones.includes(value) ? [value, ...zones] : zones;
6
+ return (_jsx("select", { id: id, className: "bg-background w-full rounded-md border px-3 py-2 text-sm", value: value, onChange: (e) => onChange(e.target.value), children: options.map((tz) => (_jsx("option", { value: tz, children: optionLabel ? optionLabel(tz) : tz }, tz))) }));
7
+ }