@openpeepshq/react 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/dist/components/configuration/ConfigurationCategory.js +3 -2
  2. package/dist/components/configuration/ConfigurationList.js +1 -1
  3. package/dist/components/form/LocationInput.js +1 -1
  4. package/dist/components/jams/JamCapacityGate.js +1 -1
  5. package/dist/components/jams/JamConference.js +2 -0
  6. package/dist/components/jams/JamParticipantConference.js +2 -0
  7. package/dist/components/jams/JamRoom.js +2 -3
  8. package/dist/components/jams/LiveJamsSection.js +8 -2
  9. package/dist/components/jams/LivekitUnavailableNotice.d.ts +9 -0
  10. package/dist/components/jams/LivekitUnavailableNotice.js +19 -0
  11. package/dist/components/jams/dropLateAudio.d.ts +22 -0
  12. package/dist/components/jams/dropLateAudio.js +115 -0
  13. package/dist/components/jams/index.d.ts +1 -0
  14. package/dist/components/jams/index.js +1 -0
  15. package/dist/components/notifications/TypedNotification.js +46 -4
  16. package/dist/components/post/Markdown.d.ts +2 -2
  17. package/dist/components/post/Markdown.js +1 -1
  18. package/dist/components/post/attachmentPreview.js +1 -1
  19. package/dist/components/post/pieces/Attachments.js +23 -17
  20. package/dist/components/post/pieces/EventRsvpButton.js +37 -7
  21. package/dist/components/post/pieces/EventRsvpList.js +23 -3
  22. package/dist/components/post/pieces/EventRsvpScopeDialog.d.ts +1 -1
  23. package/dist/components/post/pieces/EventRsvpScopeDialog.js +34 -22
  24. package/dist/components/post/pieces/EventWaitlistJoinDialog.d.ts +10 -0
  25. package/dist/components/post/pieces/EventWaitlistJoinDialog.js +26 -0
  26. package/dist/components/post/pieces/ParticipantsCard.d.ts +1 -1
  27. package/dist/components/post/pieces/ParticipantsCard.js +1 -1
  28. package/dist/components/post/pieces/PostActions.d.ts +1 -1
  29. package/dist/components/post/pieces/PostActions.js +20 -12
  30. package/dist/components/post/pieces/ShareMenu.d.ts +6 -1
  31. package/dist/components/post/pieces/ShareMenu.js +40 -7
  32. package/dist/components/post/post-form/EventForm.js +10 -2
  33. package/dist/components/post/types/Article.js +1 -1
  34. package/dist/components/post/types/article/FullArticle.js +1 -1
  35. package/dist/components/post/types/event/CardEvent.js +2 -1
  36. package/dist/components/post/types/event/FullEvent.js +22 -13
  37. package/dist/components/post/types/event/ProfileEventRelationship.js +8 -0
  38. package/dist/components/preview-link/LocalPreviewLink.js +4 -2
  39. package/dist/components/preview-link/PreviewLink.js +1 -1
  40. package/dist/components/preview-link/helpers.d.ts +5 -0
  41. package/dist/components/preview-link/helpers.js +27 -1
  42. package/dist/components/preview-link/local/WelcomePreview.d.ts +1 -0
  43. package/dist/components/preview-link/local/WelcomePreview.js +6 -0
  44. package/dist/components/profile/Avatar.js +2 -2
  45. package/dist/components/profile/ProfileFromId.js +1 -1
  46. package/dist/components/server-data/context.d.ts +1 -0
  47. package/dist/contexts/openpeeps/hooks/accounts.d.ts +5 -5
  48. package/dist/contexts/openpeeps/hooks/accounts.js +1 -3
  49. package/dist/contexts/openpeeps/hooks/admin.d.ts +165 -66
  50. package/dist/contexts/openpeeps/hooks/admin.js +11 -3
  51. package/dist/contexts/openpeeps/hooks/auth.d.ts +2 -2
  52. package/dist/contexts/openpeeps/hooks/groups.d.ts +8 -8
  53. package/dist/contexts/openpeeps/hooks/jams.d.ts +73 -24
  54. package/dist/contexts/openpeeps/hooks/other.d.ts +7 -6
  55. package/dist/contexts/openpeeps/hooks/payments.d.ts +2 -2
  56. package/dist/contexts/openpeeps/hooks/posts.d.ts +368 -170
  57. package/dist/contexts/openpeeps/hooks/streaming.d.ts +1 -1
  58. package/dist/hooks/admin/useCanAccessAdminSection.d.ts +13 -0
  59. package/dist/hooks/admin/useCanAccessAdminSection.js +21 -0
  60. package/dist/hooks/events/useEventComposer.d.ts +94 -41
  61. package/dist/hooks/events/useEventForm.d.ts +1 -0
  62. package/dist/hooks/events/useEventRsvp.d.ts +11 -2
  63. package/dist/hooks/events/useEventRsvp.js +46 -5
  64. package/dist/hooks/events/useEventsCalendar.d.ts +174 -76
  65. package/dist/hooks/groups/useNewGroup.js +22 -2
  66. package/dist/hooks/index.d.ts +5 -1
  67. package/dist/hooks/index.js +4 -1
  68. package/dist/hooks/jams/useCanDiagnoseLivekit.d.ts +2 -0
  69. package/dist/hooks/jams/useCanDiagnoseLivekit.js +3 -0
  70. package/dist/hooks/jams/useCreateNewJamForm.d.ts +3 -1
  71. package/dist/hooks/jams/useJamDetails.d.ts +87 -38
  72. package/dist/hooks/jams/useJamLobby.d.ts +1 -0
  73. package/dist/hooks/jams/useJamRoom.d.ts +175 -76
  74. package/dist/hooks/posts/useArticleComposer.d.ts +93 -41
  75. package/dist/hooks/posts/useFeedPostPresentation.d.ts +174 -76
  76. package/dist/hooks/posts/usePostDetailTitle.d.ts +87 -38
  77. package/dist/hooks/posts/useResourceComposer.d.ts +93 -41
  78. package/dist/hooks/posts/useResourceComposer.js +4 -2
  79. package/dist/hooks/posts/useShareMenu.d.ts +2 -0
  80. package/dist/hooks/posts/useShareMenu.js +7 -0
  81. package/dist/hooks/resources/useResourceLibrary.d.ts +176 -78
  82. package/dist/hooks/settings/useNotificationPreferences.d.ts +1 -1
  83. package/dist/hooks/useWelcomePreview.d.ts +13 -0
  84. package/dist/hooks/useWelcomePreview.js +39 -0
  85. package/dist/lib/groupFormErrors.d.ts +1 -0
  86. package/dist/lib/groupFormErrors.js +5 -2
  87. package/dist/lib/threadHelpers.js +1 -5
  88. package/dist/pages/admin/ConfigurationCommunity.js +1 -1
  89. package/dist/pages/admin/Diagnostics.js +1 -1
  90. package/dist/pages/admin/DiagnosticsLivekit.d.ts +1 -0
  91. package/dist/pages/admin/DiagnosticsLivekit.js +50 -0
  92. package/dist/pages/admin/Invites.js +5 -3
  93. package/dist/pages/admin/Media.d.ts +1 -0
  94. package/dist/pages/admin/Media.js +135 -0
  95. package/dist/pages/admin/community/CommunityForbiddenUsernames.d.ts +1 -0
  96. package/dist/pages/admin/community/CommunityForbiddenUsernames.js +106 -0
  97. package/dist/pages/admin/community/CommunityRoles.js +1 -1
  98. package/dist/pages/admin/community/useCommunityConfig.d.ts +2 -0
  99. package/dist/pages/admin/components/EditInviteLinkModal.d.ts +5 -0
  100. package/dist/pages/admin/components/EditInviteLinkModal.js +131 -0
  101. package/dist/pages/auth/Register.js +30 -8
  102. package/dist/pages/conversations/Show.js +11 -0
  103. package/dist/pages/index.d.ts +3 -0
  104. package/dist/pages/index.js +3 -0
  105. package/dist/pages/jams/Index.js +2 -4
  106. package/dist/pages/settings/PublicProfile.js +15 -3
  107. package/dist/pwa/sw.d.ts +0 -1
  108. package/dist/react-native.d.ts +1 -0
  109. package/dist/react-native.js +1 -0
  110. package/dist/stores/newPosts.d.ts +4 -2
  111. package/dist/stores/newPosts.js +6 -1
  112. package/package.json +12 -7
  113. package/src/components/configuration/ConfigurationCategory.tsx +23 -10
  114. package/src/components/configuration/ConfigurationList.tsx +6 -1
  115. package/src/components/form/LocationInput.tsx +7 -1
  116. package/src/components/jams/JamCapacityGate.tsx +1 -1
  117. package/src/components/jams/JamConference.tsx +2 -0
  118. package/src/components/jams/JamParticipantConference.tsx +2 -0
  119. package/src/components/jams/JamRoom.tsx +2 -6
  120. package/src/components/jams/LiveJamsSection.tsx +16 -2
  121. package/src/components/jams/LivekitUnavailableNotice.tsx +40 -0
  122. package/src/components/jams/dropLateAudio.ts +153 -0
  123. package/src/components/jams/index.ts +1 -0
  124. package/src/components/notifications/TypedNotification.tsx +81 -9
  125. package/src/components/post/Markdown.tsx +8 -2
  126. package/src/components/post/attachmentPreview.ts +1 -3
  127. package/src/components/post/pieces/Attachments.tsx +93 -78
  128. package/src/components/post/pieces/EventRsvpButton.tsx +107 -7
  129. package/src/components/post/pieces/EventRsvpList.tsx +64 -0
  130. package/src/components/post/pieces/EventRsvpScopeDialog.tsx +39 -27
  131. package/src/components/post/pieces/EventWaitlistJoinDialog.tsx +77 -0
  132. package/src/components/post/pieces/ParticipantsCard.tsx +4 -1
  133. package/src/components/post/pieces/PostActions.tsx +73 -42
  134. package/src/components/post/pieces/ShareMenu.tsx +67 -9
  135. package/src/components/post/post-form/EventForm.tsx +26 -0
  136. package/src/components/post/post-form/VisibilitySelector.tsx +1 -2
  137. package/src/components/post/types/Article.tsx +1 -1
  138. package/src/components/post/types/article/FullArticle.tsx +2 -2
  139. package/src/components/post/types/event/CardEvent.tsx +26 -14
  140. package/src/components/post/types/event/FullEvent.tsx +48 -35
  141. package/src/components/post/types/event/ProfileEventRelationship.tsx +8 -0
  142. package/src/components/post/types/note/FullNote.tsx +1 -4
  143. package/src/components/post/types/poll/FullPoll.tsx +1 -4
  144. package/src/components/preview-link/LocalPreviewLink.tsx +4 -1
  145. package/src/components/preview-link/PreviewLink.tsx +2 -7
  146. package/src/components/preview-link/helpers.ts +32 -1
  147. package/src/components/preview-link/local/GroupPreview.tsx +1 -1
  148. package/src/components/preview-link/local/JamPreview.tsx +1 -1
  149. package/src/components/preview-link/local/WelcomePreview.tsx +36 -0
  150. package/src/components/profile/Avatar.tsx +6 -2
  151. package/src/components/profile/ProfileFromId.tsx +1 -5
  152. package/src/components/resources/ResourceCard.tsx +0 -1
  153. package/src/contexts/openpeeps/hooks/accounts.ts +1 -3
  154. package/src/contexts/openpeeps/hooks/admin.ts +11 -3
  155. package/src/contexts/openpeeps/hooks/other.ts +9 -12
  156. package/src/contexts/openpeeps/hooks/streaming.ts +3 -3
  157. package/src/css.d.ts +4 -0
  158. package/src/hooks/admin/useCanAccessAdminSection.ts +27 -0
  159. package/src/hooks/events/useEventRsvp.ts +51 -7
  160. package/src/hooks/groups/useNewGroup.ts +28 -3
  161. package/src/hooks/index.ts +8 -1
  162. package/src/hooks/jams/useCanDiagnoseLivekit.ts +5 -0
  163. package/src/hooks/posts/useResourceComposer.ts +8 -6
  164. package/src/hooks/posts/useShareMenu.ts +9 -0
  165. package/src/hooks/useWelcomePreview.ts +57 -0
  166. package/src/i18n/I18nProvider.tsx +1 -4
  167. package/src/lib/groupFormErrors.ts +9 -2
  168. package/src/lib/threadHelpers.ts +1 -5
  169. package/src/pages/admin/ConfigurationCommunity.tsx +5 -0
  170. package/src/pages/admin/Diagnostics.tsx +4 -0
  171. package/src/pages/admin/DiagnosticsLivekit.tsx +147 -0
  172. package/src/pages/admin/Invites.tsx +23 -1
  173. package/src/pages/admin/Media.tsx +290 -0
  174. package/src/pages/admin/community/CommunityForbiddenUsernames.tsx +223 -0
  175. package/src/pages/admin/community/CommunityRoles.tsx +2 -2
  176. package/src/pages/admin/components/EditInviteLinkModal.tsx +263 -0
  177. package/src/pages/auth/Register.tsx +33 -4
  178. package/src/pages/conversations/Show.tsx +11 -0
  179. package/src/pages/index.ts +3 -0
  180. package/src/pages/jams/Index.tsx +2 -6
  181. package/src/pages/settings/PublicProfile.tsx +20 -2
  182. package/src/pwa/sw.ts +6 -3
  183. package/src/pwa/useNotificationBadgeSync.ts +3 -1
  184. package/src/react-native.ts +1 -0
  185. package/src/stores/newPosts.ts +6 -1
  186. package/src/streaming.ts +3 -3
  187. package/dist/setupTests.d.ts +0 -1
  188. package/dist/setupTests.js +0 -5
package/src/pwa/sw.ts CHANGED
@@ -23,7 +23,10 @@
23
23
  * - notificationclick `goto:` action → focus matching client / open window
24
24
  */
25
25
 
26
- import type { NotificationOptionsType, PushMessage } from '@openpeepshq/common';
26
+ import type {
27
+ NotificationOptions as NotificationOptionsData,
28
+ PushMessage,
29
+ } from '@openpeepshq/common';
27
30
  import { resolveGotoTarget } from './navigationUrl';
28
31
 
29
32
  const PUSH_BASE_INVALIDATE_KEYS = [
@@ -120,7 +123,7 @@ self.addEventListener('push', (event) => {
120
123
  if (notification) {
121
124
  await self.registration.showNotification(
122
125
  notification.title ?? '',
123
- notification.options,
126
+ notification.options as unknown as NotificationOptions,
124
127
  );
125
128
  }
126
129
  })(),
@@ -130,7 +133,7 @@ self.addEventListener('push', (event) => {
130
133
  self.addEventListener('notificationclick', (event) => {
131
134
  const action =
132
135
  event.action ||
133
- (event.notification as unknown as NotificationOptionsType)?.actions?.[0]
136
+ (event.notification as unknown as NotificationOptionsData)?.actions?.[0]
134
137
  ?.action ||
135
138
  '';
136
139
 
@@ -27,7 +27,9 @@ export const useNotificationBadgeSync = (): void => {
27
27
  syncFromCache();
28
28
 
29
29
  return queryClient.getQueryCache().subscribe((event) => {
30
- if (!matchesQueryKey(event.query.queryKey, NOTIFICATION_STATS_QUERY_KEY)) {
30
+ if (
31
+ !matchesQueryKey(event.query.queryKey, NOTIFICATION_STATS_QUERY_KEY)
32
+ ) {
31
33
  return;
32
34
  }
33
35
  syncFromCache();
@@ -138,6 +138,7 @@ export {
138
138
  } from './components/jams/jamEventActions';
139
139
  export type { JamParticipantMetadata } from './components/jams/jamEventActions';
140
140
  export { useRaisedHands } from './components/jams/useJamHands';
141
+ export { useDropLateAudio } from './components/jams/dropLateAudio';
141
142
  export {
142
143
  calculateRecordingState,
143
144
  calculateRtmpStreamState,
@@ -92,7 +92,12 @@ export const eventSanitizer = (publicContent = false) => {
92
92
  end: event.data.end,
93
93
  attendeeListPublic: event.data.attendeeListPublic,
94
94
  ...(event.data.maxAttendees != null
95
- ? { maxAttendees: event.data.maxAttendees }
95
+ ? {
96
+ maxAttendees: event.data.maxAttendees,
97
+ ...(event.data.waitlistOfferMinutes != null
98
+ ? { waitlistOfferMinutes: event.data.waitlistOfferMinutes }
99
+ : {}),
100
+ }
96
101
  : {}),
97
102
  },
98
103
  mentions: event.mentions,
package/src/streaming.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * the origin the source URL was served from rather than the API base URL.
5
5
  */
6
6
  export const vodMasterPlaylistUrl = (
7
- storageId: string,
8
- origin: string,
7
+ storageId: string,
8
+ origin: string,
9
9
  ): string =>
10
- `${origin.replace(/\/$/, '')}/media/streaming/${storageId}/hls.m3u8`;
10
+ `${origin.replace(/\/$/, '')}/media/streaming/${storageId}/hls.m3u8`;
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom';
@@ -1,5 +0,0 @@
1
- // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
- // allows you to do things like:
3
- // expect(element).toHaveTextContent(/react/i)
4
- // learn more: https://github.com/testing-library/jest-dom
5
- import '@testing-library/jest-dom';