@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
@@ -0,0 +1,131 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { useOpenpeeps, useT } from '../../../index.js';
4
+ import { Dialog, DialogActions, DialogContent, DialogHeader, DialogTitle, Input, Label, } from '@openpeepshq/react-ui';
5
+ import { DAY_MS, EXPIRY_OPTIONS, UNLIMITED_USES } from './InviteWithLinkModal.js';
6
+ const NEVER_DAYS = EXPIRY_OPTIONS.find((option) => option.value === 'P100Y')?.days ?? 365 * 100;
7
+ const FAR_FUTURE_MS = 50 * 365 * DAY_MS;
8
+ const pad = (value) => String(value).padStart(2, '0');
9
+ const toDatetimeLocal = (iso) => {
10
+ const date = new Date(iso);
11
+ if (Number.isNaN(date.getTime()))
12
+ return '';
13
+ const day = [
14
+ date.getFullYear(),
15
+ pad(date.getMonth() + 1),
16
+ pad(date.getDate()),
17
+ ].join('-');
18
+ const time = [pad(date.getHours()), pad(date.getMinutes())].join(':');
19
+ return `${day}T${time}`;
20
+ };
21
+ const isFarFuture = (iso) => new Date(iso).getTime() - Date.now() > FAR_FUTURE_MS;
22
+ const useChoices = (invite) => {
23
+ const floor = Math.max(invite.redemptions.length, 1);
24
+ const current = invite.maxUses < UNLIMITED_USES ? [invite.maxUses] : [];
25
+ return [...new Set([1, 5, 10, 15, 20, ...current])]
26
+ .filter((count) => count >= floor)
27
+ .sort((a, b) => a - b);
28
+ };
29
+ const initialUses = (invite) => {
30
+ if (invite.maxUses >= UNLIMITED_USES ||
31
+ invite.maxUses < invite.redemptions.length) {
32
+ return 'unlimited';
33
+ }
34
+ return String(invite.maxUses);
35
+ };
36
+ const errorMessage = (err, fallback) => {
37
+ if (err &&
38
+ typeof err === 'object' &&
39
+ 'message' in err &&
40
+ typeof err.message === 'string' &&
41
+ err.message) {
42
+ return err.message;
43
+ }
44
+ return fallback;
45
+ };
46
+ export const EditInviteLinkModal = ({ invite, onClose, }) => {
47
+ const t = useT();
48
+ const { openpeepsApi } = useOpenpeeps();
49
+ const updateInvite = openpeepsApi.admin.updateInviteAction({
50
+ id: invite.id,
51
+ });
52
+ const used = invite.redemptions.length;
53
+ const choices = useChoices(invite);
54
+ const startsNever = isFarFuture(invite.expiresAt);
55
+ const [maxUses, setMaxUses] = useState(() => initialUses(invite));
56
+ const [never, setNever] = useState(startsNever);
57
+ const [expiresLocal, setExpiresLocal] = useState(() => toDatetimeLocal(startsNever
58
+ ? new Date(Date.now() + 7 * DAY_MS).toISOString()
59
+ : invite.expiresAt));
60
+ const [submitting, setSubmitting] = useState(false);
61
+ const [error, setError] = useState(null);
62
+ const parsedExpiry = new Date(expiresLocal);
63
+ const expiresInPast = !never &&
64
+ expiresLocal !== '' &&
65
+ !Number.isNaN(parsedExpiry.getTime()) &&
66
+ parsedExpiry.getTime() <= Date.now();
67
+ const submit = async () => {
68
+ setError(null);
69
+ const unlimited = maxUses === 'unlimited';
70
+ const nextMaxUses = unlimited ? UNLIMITED_USES : Number(maxUses);
71
+ if (!unlimited && (!Number.isInteger(nextMaxUses) || nextMaxUses < used)) {
72
+ setError(t('admin.invites.maxUsesTooLow', {
73
+ defaultValue: 'Number of uses cannot be lower than {{count}}, the number of accounts that already joined.',
74
+ count: used,
75
+ }));
76
+ return;
77
+ }
78
+ const patch = {};
79
+ if (nextMaxUses !== invite.maxUses)
80
+ patch.maxUses = nextMaxUses;
81
+ if (never) {
82
+ if (!startsNever) {
83
+ patch.expiresAt = new Date(Date.now() + NEVER_DAYS * DAY_MS).toISOString();
84
+ }
85
+ }
86
+ else if (toDatetimeLocal(invite.expiresAt) !== expiresLocal) {
87
+ if (!expiresLocal || Number.isNaN(parsedExpiry.getTime())) {
88
+ setError(t('admin.invites.expiresRequired', {
89
+ defaultValue: 'Choose an expiration date.',
90
+ }));
91
+ return;
92
+ }
93
+ patch.expiresAt = parsedExpiry.toISOString();
94
+ }
95
+ if (patch.maxUses == null && patch.expiresAt == null) {
96
+ onClose();
97
+ return;
98
+ }
99
+ setSubmitting(true);
100
+ try {
101
+ await updateInvite(patch);
102
+ onClose();
103
+ }
104
+ catch (err) {
105
+ setError(errorMessage(err, t('admin.invites.updateError', {
106
+ defaultValue: 'Failed to update invite link',
107
+ })));
108
+ }
109
+ finally {
110
+ setSubmitting(false);
111
+ }
112
+ };
113
+ return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-md", "data-testid": "edit-invite-link", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('admin.invites.editTitle', {
114
+ defaultValue: 'Edit invite link',
115
+ }) }) }), _jsxs("div", { className: "space-y-4 px-1", children: [_jsx("p", { className: "text-muted-foreground text-sm", children: t('admin.invites.editDescription', {
116
+ defaultValue: 'Update how many times this link can be used, or when it expires.',
117
+ }) }), _jsx("p", { className: "font-mono text-xs", children: invite.slug }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "edit-invite-uses", children: t('admin.inviteLink.numberOfUses', {
118
+ defaultValue: 'Number of Uses',
119
+ }) }), _jsxs("select", { id: "edit-invite-uses", className: "border-input bg-background w-full rounded-md border p-2 text-sm", value: maxUses, onChange: (e) => setMaxUses(e.target.value), children: [choices.map((count) => (_jsx("option", { value: String(count), children: count }, count))), _jsx("option", { value: "unlimited", children: t('admin.inviteLink.unlimited', {
120
+ defaultValue: 'Unlimited',
121
+ }) })] }), used > 0 ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('admin.invites.alreadyJoined', {
122
+ defaultValue: 'Already joined: {{count}}',
123
+ count: used,
124
+ }) })) : null] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "edit-invite-expiry", children: t('admin.invites.expirationDate', {
125
+ defaultValue: 'Expiration date',
126
+ }) }), _jsx(Input, { id: "edit-invite-expiry", type: "datetime-local", value: expiresLocal, disabled: never, onChange: (e) => setExpiresLocal(e.target.value) }), _jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx("input", { type: "checkbox", className: "size-4", checked: never, onChange: (e) => setNever(e.target.checked) }), _jsx("span", { children: t('admin.invites.neverExpires', {
127
+ defaultValue: 'Never expires',
128
+ }) })] }), expiresInPast ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('admin.invites.pastExpiration', {
129
+ defaultValue: 'This date is in the past, so the link will be inactive.',
130
+ }) })) : null] }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null] }), _jsx(DialogActions, { cancelLabel: t('common.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('common.save', { defaultValue: 'Save' }), onAction: submit, disabled: submitting })] }) }));
131
+ };
@@ -4,7 +4,7 @@ import { Link as RouterLink, useNavigate, useSearchParams, } from 'react-router-
4
4
  import { Eye, EyeOff } from 'lucide-react';
5
5
  import { useForm } from 'react-hook-form';
6
6
  import { zodResolver } from '@hookform/resolvers/zod';
7
- import { registerRequestSchema, } from '@openpeepshq/common/types';
7
+ import { accountNameSchema, HANDLE_RESERVED_MESSAGE, isForbiddenHandle, registerRequestSchema, } from '@openpeepshq/common/types';
8
8
  import { Button, Form, FormControl, FormField, FormItem, FormLabel, FormMessage, Input, Link, Toast, } from '@openpeepshq/react-ui';
9
9
  import { useT, useOpenpeeps } from '../../index.js';
10
10
  import { AuthLayout, useServerInfo, useToast } from '../../components/index.js';
@@ -15,7 +15,7 @@ const INVITE_INACTIVE_MESSAGES = new Set([
15
15
  'Max Uses Reached',
16
16
  'Invalid Invite Code',
17
17
  ]);
18
- const buildRegisterFormSchema = (t) => registerRequestSchema
18
+ const buildRegisterFormSchema = (t, additionalForbiddenHandles = []) => registerRequestSchema
19
19
  .refine((d) => d.password === d.confirmPassword, {
20
20
  message: t('auth.register.passwordsDoNotMatch', {
21
21
  defaultValue: 'Passwords do not match',
@@ -27,12 +27,33 @@ const buildRegisterFormSchema = (t) => registerRequestSchema
27
27
  defaultValue: 'You must agree to the privacy policy',
28
28
  }),
29
29
  path: ['privacyPolicyAccepted'],
30
+ })
31
+ .superRefine((data, ctx) => {
32
+ if (!isForbiddenHandle(data.handle, additionalForbiddenHandles))
33
+ return;
34
+ // Built-in names already fail accountNameSchema.
35
+ if (!accountNameSchema.safeParse(data.handle).success)
36
+ return;
37
+ ctx.addIssue({
38
+ code: 'custom',
39
+ path: ['handle'],
40
+ message: t('profile.form.handleReserved', {
41
+ defaultValue: 'That handle is reserved. Please choose another.',
42
+ }),
43
+ });
30
44
  });
31
- const registerErrorCopy = (raw, t) => INVITE_INACTIVE_MESSAGES.has(raw)
32
- ? t('auth.register.inviteInactive', {
33
- defaultValue: 'This invite link is expired or no longer active.',
34
- })
35
- : t(raw);
45
+ const registerErrorCopy = (raw, t) => {
46
+ if (raw === HANDLE_RESERVED_MESSAGE) {
47
+ return t('profile.form.handleReserved', {
48
+ defaultValue: 'That handle is reserved. Please choose another.',
49
+ });
50
+ }
51
+ return INVITE_INACTIVE_MESSAGES.has(raw)
52
+ ? t('auth.register.inviteInactive', {
53
+ defaultValue: 'This invite link is expired or no longer active.',
54
+ })
55
+ : t(raw);
56
+ };
36
57
  export function Register({ invite = false }) {
37
58
  const t = useT();
38
59
  const navigate = useNavigate();
@@ -42,7 +63,8 @@ export function Register({ invite = false }) {
42
63
  const { register } = useRegisterAccount();
43
64
  const serverInfo = useServerInfo();
44
65
  const { success, error: toastError } = useToast();
45
- const registerFormSchema = useMemo(() => buildRegisterFormSchema(t), [t]);
66
+ const additionalForbiddenHandles = serverInfo.communityConfig?.settings?.additionalForbiddenHandles;
67
+ const registerFormSchema = useMemo(() => buildRegisterFormSchema(t, additionalForbiddenHandles ?? []), [t, additionalForbiddenHandles]);
46
68
  const paymentParam = searchParams.get('payment');
47
69
  useEffect(() => {
48
70
  if (paymentParam === 'success') {
@@ -85,6 +85,17 @@ export function ConversationShow() {
85
85
  void flushPostViews();
86
86
  };
87
87
  }, [id, client, queryClient, flushPostViews]);
88
+ // The URL may point at any root of a merged 1:1 conversation (e.g.
89
+ // notification links); unseen counts are merged under the pair's oldest
90
+ // root, so clear that key once the conversation's first message is known.
91
+ const firstMessageId = messages[0]?.id;
92
+ useEffect(() => {
93
+ if (!id || !firstMessageId || firstMessageId === id)
94
+ return;
95
+ adjustUnseenCounts(queryClient, client, {
96
+ clearConversation: firstMessageId,
97
+ });
98
+ }, [id, firstMessageId, client, queryClient]);
88
99
  useEffect(() => {
89
100
  if (!id || !me || conversationQuery.isLoading)
90
101
  return;
@@ -56,6 +56,7 @@ export { AnalyticsGroupsPage } from './admin/Analytics';
56
56
  export { AnalyticsPluginPage } from './admin/Analytics';
57
57
  export { AnalyticsReportSettingsPage } from './admin/Analytics';
58
58
  export { AdminBackups } from './admin/Backups';
59
+ export { AdminMedia } from './admin/Media';
59
60
  export { AdminGroups } from './admin/Groups';
60
61
  export { AdminInvites } from './admin/Invites';
61
62
  export { AdminMembers } from './admin/Members';
@@ -81,6 +82,7 @@ export { CommunityMarkdownPage } from './admin/community/CommunityMarkdownPage';
81
82
  export { AdminConfigurationCommunityFavicons } from './admin/community/CommunityFavicons';
82
83
  export { AdminConfigurationCommunityTheme } from './admin/community/CommunityTheme';
83
84
  export { AdminConfigurationCommunityProfileFields } from './admin/community/CommunityProfileFields';
85
+ export { AdminConfigurationCommunityForbiddenUsernames } from './admin/community/CommunityForbiddenUsernames';
84
86
  export { AdminConfigurationCommunityRoles } from './admin/community/CommunityRoles';
85
87
  export { AdminGroupMembers } from './admin/GroupMembers';
86
88
  export { AdminReports } from './admin/Reports';
@@ -88,6 +90,7 @@ export { AdminApiKeys } from './admin/ApiKeys';
88
90
  export { AdminPlugins } from './admin/Plugins';
89
91
  export { AdminDiagnostics } from './admin/Diagnostics';
90
92
  export { AdminDiagnosticsEmail } from './admin/DiagnosticsEmail';
93
+ export { AdminDiagnosticsLivekit } from './admin/DiagnosticsLivekit';
91
94
  export { AdminDiagnosticsLogs } from './admin/DiagnosticsLogs';
92
95
  export { AdminConfigurationEmail } from './admin/ConfigurationEmail';
93
96
  export { AdminConfigurationSso } from './admin/ConfigurationSso';
@@ -56,6 +56,7 @@ export { AnalyticsGroupsPage } from './admin/Analytics.js';
56
56
  export { AnalyticsPluginPage } from './admin/Analytics.js';
57
57
  export { AnalyticsReportSettingsPage } from './admin/Analytics.js';
58
58
  export { AdminBackups } from './admin/Backups.js';
59
+ export { AdminMedia } from './admin/Media.js';
59
60
  export { AdminGroups } from './admin/Groups.js';
60
61
  export { AdminInvites } from './admin/Invites.js';
61
62
  export { AdminMembers } from './admin/Members.js';
@@ -81,6 +82,7 @@ export { CommunityMarkdownPage } from './admin/community/CommunityMarkdownPage.j
81
82
  export { AdminConfigurationCommunityFavicons } from './admin/community/CommunityFavicons.js';
82
83
  export { AdminConfigurationCommunityTheme } from './admin/community/CommunityTheme.js';
83
84
  export { AdminConfigurationCommunityProfileFields } from './admin/community/CommunityProfileFields.js';
85
+ export { AdminConfigurationCommunityForbiddenUsernames } from './admin/community/CommunityForbiddenUsernames.js';
84
86
  export { AdminConfigurationCommunityRoles } from './admin/community/CommunityRoles.js';
85
87
  export { AdminGroupMembers } from './admin/GroupMembers.js';
86
88
  export { AdminReports } from './admin/Reports.js';
@@ -88,6 +90,7 @@ export { AdminApiKeys } from './admin/ApiKeys.js';
88
90
  export { AdminPlugins } from './admin/Plugins.js';
89
91
  export { AdminDiagnostics } from './admin/Diagnostics.js';
90
92
  export { AdminDiagnosticsEmail } from './admin/DiagnosticsEmail.js';
93
+ export { AdminDiagnosticsLivekit } from './admin/DiagnosticsLivekit.js';
91
94
  export { AdminDiagnosticsLogs } from './admin/DiagnosticsLogs.js';
92
95
  export { AdminConfigurationEmail } from './admin/ConfigurationEmail.js';
93
96
  export { AdminConfigurationSso } from './admin/ConfigurationSso.js';
@@ -3,7 +3,7 @@ import { useMemo, useState } from 'react';
3
3
  import { Link } from 'react-router-dom';
4
4
  import { ChevronRight, MoreHorizontal, PhoneCall } from 'lucide-react';
5
5
  import { useT, useOpenpeeps, useSetPlusButtonActions, useSetPageHeader, } from '../../index.js';
6
- import { EventsFeed, LiveJamsSection, useCreateNewJam, useServerInfo, } from '../../components/index.js';
6
+ import { EventsFeed, LiveJamsSection, LivekitUnavailableNotice, useCreateNewJam, useServerInfo, } from '../../components/index.js';
7
7
  import { PopupMenu, PopupMenuButton } from '@openpeepshq/react-ui';
8
8
  export function JamsIndex({ my = false }) {
9
9
  const t = useT();
@@ -37,9 +37,7 @@ export function JamsIndex({ my = false }) {
37
37
  ? openpeepsApi.useMyPastJamsFeed()
38
38
  : openpeepsApi.usePastJamsFeed();
39
39
  const activeQuery = tab === 'upcoming' ? upcoming : past;
40
- return (_jsxs("div", { className: "p-4", children: [!serverInfo.jams.livekit.enabled ? (_jsx("p", { role: "status", className: "text-destructive mb-4 text-sm", children: t('jams.unavailable.message', {
41
- defaultValue: 'Jams are unavailable because LiveKit is not connected.',
42
- }) })) : null, !my && serverInfo.jams.livekit.enabled ? _jsx(LiveJamsSection, {}) : null, _jsxs("nav", { "aria-label": t('jams.feed.label', { defaultValue: 'Jam timeframe' }), className: "border-border mb-4 flex border-b", children: [_jsx(TabButton, { active: tab === 'upcoming', onClick: () => setTab('upcoming'), children: t('jams.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: tab === 'past', onClick: () => setTab('past'), children: t('jams.feed.past', { defaultValue: 'Past' }) })] }), _jsx(EventsFeed, { query: activeQuery })] }));
40
+ return (_jsxs("div", { className: "p-4", children: [!serverInfo.jams.livekit.enabled ? (_jsx(LivekitUnavailableNotice, { className: "text-destructive mb-4 text-sm" })) : null, !my && serverInfo.jams.livekit.enabled ? _jsx(LiveJamsSection, {}) : null, _jsxs("nav", { "aria-label": t('jams.feed.label', { defaultValue: 'Jam timeframe' }), className: "border-border mb-4 flex border-b", children: [_jsx(TabButton, { active: tab === 'upcoming', onClick: () => setTab('upcoming'), children: t('jams.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: tab === 'past', onClick: () => setTab('past'), children: t('jams.feed.past', { defaultValue: 'Past' }) })] }), _jsx(EventsFeed, { query: activeQuery })] }));
43
41
  }
44
42
  function TabButton({ active, onClick, children, }) {
45
43
  return (_jsx("button", { type: "button", onClick: onClick, className: `px-4 py-2 text-sm ${active ? 'border-primary border-b-2 font-semibold' : 'text-muted-foreground hover:text-foreground'}`, children: children }));
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useRef, useState } from 'react';
3
- import { accountNameSchema, profileDataSchema, } from '@openpeepshq/common/types';
3
+ import { accountNameSchema, HANDLE_RESERVED_MESSAGE, isForbiddenHandle, profileDataSchema, } from '@openpeepshq/common/types';
4
4
  import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
5
5
  import { HeaderAvatarInput, LocationInput, useCurrentProfile, useServerInfo, useToast, } from '../../components/index.js';
6
6
  import { Button, Input, Label, Textarea } from '@openpeepshq/react-ui';
@@ -41,12 +41,18 @@ export function PublicProfileSettings() {
41
41
  }, [me?.id, additionalFieldDefs]);
42
42
  if (!me)
43
43
  return null;
44
+ const additionalForbiddenHandles = serverInfo.communityConfig?.settings?.additionalForbiddenHandles;
44
45
  const validateHandle = (value) => {
46
+ if (isForbiddenHandle(value, additionalForbiddenHandles)) {
47
+ return t('profile.form.handleReserved', {
48
+ defaultValue: 'That handle is reserved. Please choose another.',
49
+ });
50
+ }
45
51
  const result = accountNameSchema.safeParse(value);
46
52
  if (result.success)
47
53
  return null;
48
54
  const message = firstZodMessage(result.error);
49
- if (message === 'Handle is reserved') {
55
+ if (message === HANDLE_RESERVED_MESSAGE) {
50
56
  return t('profile.form.handleReserved', {
51
57
  defaultValue: 'That handle is reserved. Please choose another.',
52
58
  });
@@ -88,7 +94,7 @@ export function PublicProfileSettings() {
88
94
  if (err instanceof ZodError) {
89
95
  const message = firstZodMessage(err);
90
96
  if (message?.toLowerCase().includes('handle')) {
91
- setHandleError(message === 'Handle is reserved'
97
+ setHandleError(message === HANDLE_RESERVED_MESSAGE
92
98
  ? t('profile.form.handleReserved', {
93
99
  defaultValue: 'That handle is reserved. Please choose another.',
94
100
  })
@@ -98,6 +104,12 @@ export function PublicProfileSettings() {
98
104
  return;
99
105
  }
100
106
  }
107
+ if (err.message === HANDLE_RESERVED_MESSAGE) {
108
+ setHandleError(t('profile.form.handleReserved', {
109
+ defaultValue: 'That handle is reserved. Please choose another.',
110
+ }));
111
+ return;
112
+ }
101
113
  if (isDuplicateHandleError(err)) {
102
114
  const msg = t('profiles.handleExists', {
103
115
  defaultValue: 'This handle is already in use by someone else.',
package/dist/pwa/sw.d.ts CHANGED
@@ -1,2 +1 @@
1
- /// <reference no-default-lib="true"/>
2
1
  export {};
@@ -52,6 +52,7 @@ export type { JamEventsContextValue } from './components/jams/JamEventsContext';
52
52
  export { mentionProfilesFromParticipants, parseJamEventPayload, parseParticipantMetadata, sendAttendance, sendJamEvent, sendReaction, toggleHand, } from './components/jams/jamEventActions';
53
53
  export type { JamParticipantMetadata } from './components/jams/jamEventActions';
54
54
  export { useRaisedHands } from './components/jams/useJamHands';
55
+ export { useDropLateAudio } from './components/jams/dropLateAudio';
55
56
  export { calculateRecordingState, calculateRtmpStreamState, formatRecordingElapsed, useJamRecordingElapsed, useJamRecordingState, useJamRtmpStreamState, } from './components/jams/jamRecordingState';
56
57
  export { shouldReconnectAfterDisconnect } from './components/jams/disconnectReason';
57
58
  export { JAM_EMOJIS, defaultRoomOptions, emojis, } from './components/jams/constants';
@@ -40,6 +40,7 @@ export { JamProvider, useJamContext, useJamObserver, } from './components/jams/J
40
40
  export { JamEventsProvider, useJamEventsContext, useMaybeJamEventsContext, } from './components/jams/JamEventsContext.js';
41
41
  export { mentionProfilesFromParticipants, parseJamEventPayload, parseParticipantMetadata, sendAttendance, sendJamEvent, sendReaction, toggleHand, } from './components/jams/jamEventActions.js';
42
42
  export { useRaisedHands } from './components/jams/useJamHands.js';
43
+ export { useDropLateAudio } from './components/jams/dropLateAudio.js';
43
44
  export { calculateRecordingState, calculateRtmpStreamState, formatRecordingElapsed, useJamRecordingElapsed, useJamRecordingState, useJamRtmpStreamState, } from './components/jams/jamRecordingState.js';
44
45
  export { shouldReconnectAfterDisconnect } from './components/jams/disconnectReason.js';
45
46
  export { JAM_EMOJIS, defaultRoomOptions, emojis, } from './components/jams/constants.js';
@@ -126,6 +126,7 @@ export declare const getReplyStore: (inReplyToId: string) => import("./createSto
126
126
  image?: string | undefined;
127
127
  end?: string | undefined;
128
128
  maxAttendees?: number | undefined;
129
+ waitlistOfferMinutes?: number | undefined;
129
130
  attendeeListPublic?: boolean | undefined;
130
131
  moderators?: string[] | undefined;
131
132
  jam?: {
@@ -208,7 +209,7 @@ export declare const getReplyStore: (inReplyToId: string) => import("./createSto
208
209
  } | {
209
210
  type: "resource";
210
211
  title: string;
211
- resourceKind: "link" | "file" | "video" | "gallery" | "audio";
212
+ resourceKind: "file" | "link" | "video" | "gallery" | "audio";
212
213
  content?: string | undefined;
213
214
  sensitive?: boolean | undefined;
214
215
  spoilerText?: string | undefined;
@@ -487,6 +488,7 @@ export declare const useReplyStore: (inReplyToId: string) => import("./createSto
487
488
  image?: string | undefined;
488
489
  end?: string | undefined;
489
490
  maxAttendees?: number | undefined;
491
+ waitlistOfferMinutes?: number | undefined;
490
492
  attendeeListPublic?: boolean | undefined;
491
493
  moderators?: string[] | undefined;
492
494
  jam?: {
@@ -569,7 +571,7 @@ export declare const useReplyStore: (inReplyToId: string) => import("./createSto
569
571
  } | {
570
572
  type: "resource";
571
573
  title: string;
572
- resourceKind: "link" | "file" | "video" | "gallery" | "audio";
574
+ resourceKind: "file" | "link" | "video" | "gallery" | "audio";
573
575
  content?: string | undefined;
574
576
  sensitive?: boolean | undefined;
575
577
  spoilerText?: string | undefined;
@@ -79,7 +79,12 @@ export const eventSanitizer = (publicContent = false) => {
79
79
  end: event.data.end,
80
80
  attendeeListPublic: event.data.attendeeListPublic,
81
81
  ...(event.data.maxAttendees != null
82
- ? { maxAttendees: event.data.maxAttendees }
82
+ ? {
83
+ maxAttendees: event.data.maxAttendees,
84
+ ...(event.data.waitlistOfferMinutes != null
85
+ ? { waitlistOfferMinutes: event.data.waitlistOfferMinutes }
86
+ : {}),
87
+ }
83
88
  : {}),
84
89
  },
85
90
  mentions: event.mentions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpeepshq/react",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -52,9 +52,9 @@
52
52
  "simple-icons": "^16.31.0",
53
53
  "uuidv7": "^1.0.2",
54
54
  "@openpeepshq/client": "^0.2.1",
55
- "@openpeepshq/react-ui": "^0.4.1",
55
+ "@openpeepshq/greenscreen": "^0.2.1",
56
56
  "@openpeepshq/common": "^0.4.0",
57
- "@openpeepshq/greenscreen": "^0.2.1"
57
+ "@openpeepshq/react-ui": "^0.4.1"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "react": "^18.3.0 || ^19.0.0",
@@ -66,18 +66,23 @@
66
66
  "@types/qrcode": "^1.5.6",
67
67
  "@types/react": "19.2.14",
68
68
  "@types/react-dom": "19.2.3",
69
+ "@typescript-eslint/eslint-plugin": "^8.72.0",
70
+ "@typescript-eslint/parser": "^8.72.0",
69
71
  "concurrently": "^9.1.2",
70
- "eslint": "^9.19.0",
72
+ "eslint": "^10.1.0",
73
+ "eslint-plugin-react-hooks": "^5.2.0",
71
74
  "jsdom": "^25.0.1",
72
75
  "react-router-dom": "^7.0.0",
73
76
  "tsc-alias": "^1.8.10",
74
- "typescript": "^5.7.3",
77
+ "typescript": "^6.0.2",
75
78
  "vitest": "^2.1.8",
79
+ "eslint-config-prettier": "^9.1.0",
80
+ "@eslint/js": "^9.17.0",
76
81
  "@openpeepshq/fetch-client": "^0.2.1"
77
82
  },
78
83
  "scripts": {
79
- "lint": "prettier --check . && ESLINT_USE_FLAT_CONFIG=false eslint .",
80
- "format": "prettier --write .",
84
+ "lint": "eslint .",
85
+ "format": "prettier --write --ignore-path ../../.prettierignore .",
81
86
  "clean": "rm -rf tsconfig.tsbuildinfo dist",
82
87
  "typecheck": "tsc --noEmit",
83
88
  "build": "tsc && tsc-alias",
@@ -1,5 +1,10 @@
1
1
  import { useEffect, useMemo, useState } from 'react';
2
- import { ZodObject, type ZodRawShape, ZodArray, type ZodType } from '@openpeepshq/common/zod';
2
+ import {
3
+ ZodObject,
4
+ type ZodRawShape,
5
+ ZodArray,
6
+ type ZodType,
7
+ } from '@openpeepshq/common/zod';
3
8
  import type { ConfigTree } from '@openpeepshq/common/types';
4
9
  import { capitalizeFirstLetter } from '@openpeepshq/common';
5
10
  import { ExpandableBox } from '@openpeepshq/react-ui';
@@ -36,8 +41,8 @@ export function ConfigurationCategory({
36
41
  }: ConfigurationCategoryProps) {
37
42
  const t = useT();
38
43
  const disabled = disabledProp ?? schema.description === 'fixed';
39
- const [value, setValue] = useState<Record<string, unknown>>(
40
- () => structuredClone(valueProp ?? config),
44
+ const [value, setValue] = useState<Record<string, unknown>>(() =>
45
+ structuredClone(valueProp ?? config),
41
46
  );
42
47
 
43
48
  useEffect(() => {
@@ -51,10 +56,10 @@ export function ConfigurationCategory({
51
56
 
52
57
  const dirty = !equal(config as ConfigTree, value as ConfigTree);
53
58
  const dirtyPaths = useMemo(() => {
54
- const diff = diffConfigTrees(config as ConfigTree, value as ConfigTree) as Record<
55
- string,
56
- unknown
57
- >;
59
+ const diff = diffConfigTrees(
60
+ config as ConfigTree,
61
+ value as ConfigTree,
62
+ ) as Record<string, unknown>;
58
63
  return Object.keys(diff).flatMap((key) => [...path.map(String), key]);
59
64
  }, [config, value, path]);
60
65
 
@@ -110,11 +115,18 @@ export function ConfigurationCategory({
110
115
  />
111
116
  );
112
117
  return collapsible ? (
113
- <ExpandableBox key={String(field.key)} title={title} initialOpen={false}>
118
+ <ExpandableBox
119
+ key={String(field.key)}
120
+ title={title}
121
+ initialOpen={false}
122
+ >
114
123
  {nested}
115
124
  </ExpandableBox>
116
125
  ) : (
117
- <div key={String(field.key)}>{title}{nested}</div>
126
+ <div key={String(field.key)}>
127
+ {title}
128
+ {nested}
129
+ </div>
118
130
  );
119
131
  }
120
132
 
@@ -152,7 +164,8 @@ export function ConfigurationCategory({
152
164
  <div className={collapsible ? 'mt-4 pl-4' : ''}>
153
165
  {collapsible && (
154
166
  <p className={dirty ? 'font-bold' : ''}>
155
- {pathName || t('configuration.title', { defaultValue: 'Configuration' })}
167
+ {pathName ||
168
+ t('configuration.title', { defaultValue: 'Configuration' })}
156
169
  </p>
157
170
  )}
158
171
  {body}
@@ -1,5 +1,10 @@
1
1
  import { useMemo, useState } from 'react';
2
- import { z, ZodArray, type ZodType, type ZodTypeAny } from '@openpeepshq/common/zod';
2
+ import {
3
+ z,
4
+ ZodArray,
5
+ type ZodType,
6
+ type ZodTypeAny,
7
+ } from '@openpeepshq/common/zod';
3
8
  import { Minus, Plus } from 'lucide-react';
4
9
  import { useT } from '../../i18n';
5
10
  import {
@@ -1,6 +1,12 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
2
  import { MapPin } from 'lucide-react';
3
- import { Button, Input, Label, LoadingSpinner, cn } from '@openpeepshq/react-ui';
3
+ import {
4
+ Button,
5
+ Input,
6
+ Label,
7
+ LoadingSpinner,
8
+ cn,
9
+ } from '@openpeepshq/react-ui';
4
10
  import type { GeocodingResult, Location } from '@openpeepshq/common';
5
11
  import { useOpenpeeps } from '../../contexts/openpeeps';
6
12
  import { useT } from '../../i18n';
@@ -21,7 +21,7 @@ export const JamCapacityGate = ({
21
21
  const me = useCurrentProfile();
22
22
  const eventData = jamPost.data?.type === 'event' ? jamPost.data : undefined;
23
23
  const showRsvp =
24
- reason === 'rsvp-required' &&
24
+ (reason === 'rsvp-required' || reason === 'full') &&
25
25
  !!me &&
26
26
  !!eventData &&
27
27
  isCapacityEvent(eventData);
@@ -6,6 +6,7 @@ import {
6
6
  } from '@livekit/components-react';
7
7
  import { Track } from 'livekit-client';
8
8
  import { useJamObserver } from './JamContext';
9
+ import { useDropLateAudio } from './dropLateAudio';
9
10
  import { JamParticipantConference } from './JamParticipantConference';
10
11
  import { JamEventsProvider } from './JamEventsContext';
11
12
  import { JamObserverShell } from './JamObserverShell';
@@ -50,6 +51,7 @@ function JamObserverConference() {
50
51
 
51
52
  function JamObserverRoom() {
52
53
  const room = useRoomContext();
54
+ useDropLateAudio(room);
53
55
  return (
54
56
  <JamEventsProvider room={room}>
55
57
  <JamObserverConference />
@@ -19,6 +19,7 @@ import { JamPeopleDrawer } from './JamPeopleDrawer';
19
19
  import { JamNetworkQuality, JamRecordingIndicator } from './JamRoomIndicators';
20
20
  import { JamVideoLayout } from './JamVideoLayout';
21
21
  import { useJamLocalSettings } from './jamLocalSettings';
22
+ import { useDropLateAudio } from './dropLateAudio';
22
23
 
23
24
  type Drawer = 'chat' | 'people' | 'details' | null;
24
25
 
@@ -162,6 +163,7 @@ function JamParticipantConferenceInner() {
162
163
  */
163
164
  export function JamParticipantConference() {
164
165
  const room = useRoomContext();
166
+ useDropLateAudio(room);
165
167
  return (
166
168
  <JamEventsProvider room={room}>
167
169
  <JamParticipantConferenceInner />
@@ -11,6 +11,7 @@ import { JamLobby } from './JamLobby';
11
11
  import { JamCapacityGate } from './JamCapacityGate';
12
12
  import { JamRequestJoin } from './JamRequestJoin';
13
13
  import { JamVideoCall } from './JamVideoCall';
14
+ import { LivekitUnavailableNotice } from './LivekitUnavailableNotice';
14
15
 
15
16
  export interface JamRoomProps {
16
17
  jamPost: PublicPost;
@@ -81,12 +82,7 @@ function JamRoomInner() {
81
82
  <div className="w-full max-w-md space-y-5 text-center">
82
83
  <h3 className="text-lg">{jamEvent.name}</h3>
83
84
  <div className="bg-surface flex w-full flex-col items-center justify-center space-y-3 rounded border p-4">
84
- <p role="status">
85
- {t('jams.unavailable.message', {
86
- defaultValue:
87
- 'Jams are unavailable because LiveKit is not connected.',
88
- })}
89
- </p>
85
+ <LivekitUnavailableNotice />
90
86
  <a
91
87
  href={`/posts/${jamPost.id}`}
92
88
  className="text-primary text-sm underline"