@openpeepshq/react 0.10.0 → 0.11.0
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.
- package/dist/components/RelationCapabilitiesEditor.js +3 -3
- package/dist/components/RoleCapabilityMatrix.js +2 -2
- package/dist/components/accounts/SignUpLoginModal.js +1 -1
- package/dist/components/configuration/ConfigurationList.js +2 -2
- package/dist/components/conversations/ConversationMessageBubble.js +8 -1
- package/dist/components/conversations/CreateNewConversation.js +34 -17
- package/dist/components/form/ImageEditModal.js +2 -2
- package/dist/components/groups/ChangeGroupRolesModal.js +1 -1
- package/dist/components/groups/ConfirmGroupExitModal.js +1 -1
- package/dist/components/groups/ConfirmMemberRemovalModal.js +1 -1
- package/dist/components/groups/DeleteGroupModal.js +1 -1
- package/dist/components/groups/GroupForm.js +2 -2
- package/dist/components/groups/GroupNotificationSettingsModal.js +2 -2
- package/dist/components/jams/JamCallParticipant.js +4 -3
- package/dist/components/jams/JamGuestForm.js +1 -1
- package/dist/components/jams/jamEventActions.d.ts +10 -0
- package/dist/components/jams/jamEventActions.js +13 -0
- package/dist/components/navigation/ContentHeader.js +1 -1
- package/dist/components/navigation/FooterMobile.js +1 -1
- package/dist/components/navigation/SideBar.js +1 -1
- package/dist/components/post/FullPostLayout.js +1 -1
- package/dist/components/post/index.d.ts +1 -0
- package/dist/components/post/index.js +1 -0
- package/dist/components/post/pieces/EventRsvpList.js +1 -1
- package/dist/components/post/pieces/EventRsvpScopeDialog.js +2 -2
- package/dist/components/post/pieces/EventWaitlistJoinDialog.js +1 -1
- package/dist/components/post/pieces/GalleryModal.js +1 -1
- package/dist/components/post/pieces/modals/DeletePostModal.js +2 -2
- package/dist/components/post/post-form/ComposeAttachments.d.ts +2 -0
- package/dist/components/post/post-form/ComposeAttachments.js +8 -0
- package/dist/components/post/post-form/DescriptionEditModal.js +1 -1
- package/dist/components/post/post-form/EditPostModal.js +2 -2
- package/dist/components/post/post-form/EventForm.js +4 -26
- package/dist/components/post/post-form/PostAudienceSelector.js +2 -2
- package/dist/components/post/post-form/ReplyModal.js +1 -1
- package/dist/components/post/types/event/FullEvent.js +3 -3
- package/dist/components/post/types/resource/FullResource.js +2 -1
- package/dist/components/preview-link/RemotePreviewLink.js +32 -4
- package/dist/components/preview-link/RemotePreviewLink.test.d.ts +1 -0
- package/dist/components/preview-link/RemotePreviewLink.test.js +118 -0
- package/dist/components/profile/ProfileActivitySummary.js +4 -4
- package/dist/components/profile/ProfileBadge.js +1 -1
- package/dist/components/profile/ProfilePageAction.js +1 -1
- package/dist/components/profile/ProfilePostsAndReplies.js +1 -1
- package/dist/components/profile/ProfileSelector.js +1 -1
- package/dist/components/profile/ReportProfileOrPostModal.js +4 -2
- package/dist/components/resources/CategoryPathPicker.js +1 -1
- package/dist/components/resources/ResourceCard.js +5 -3
- package/dist/components/resources/ResourceLibrary.js +61 -8
- package/dist/components/resources/ResourceLibrary.test.d.ts +1 -0
- package/dist/components/resources/ResourceLibrary.test.js +122 -0
- package/dist/components/server-data/context.d.ts +24 -16
- package/dist/contexts/openpeeps/hooks/admin.d.ts +2 -2
- package/dist/contexts/openpeeps/hooks/auth.d.ts +1 -1
- package/dist/contexts/router/index.d.ts +8 -0
- package/dist/contexts/router/index.js +27 -2
- package/dist/hooks/conversations/dmMessage.d.ts +15 -0
- package/dist/hooks/conversations/dmMessage.js +12 -0
- package/dist/hooks/conversations/useCreateConversation.d.ts +40 -0
- package/dist/hooks/conversations/useCreateConversation.js +6 -0
- package/dist/hooks/events/useEventForm.d.ts +3 -0
- package/dist/hooks/events/useEventForm.js +31 -2
- package/dist/hooks/events/useEventForm.test.d.ts +1 -0
- package/dist/hooks/events/useEventForm.test.js +107 -0
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/posts/useFeedPostActions.js +4 -15
- package/dist/hooks/posts/usePostReactionToggle.d.ts +14 -0
- package/dist/hooks/posts/usePostReactionToggle.js +46 -0
- package/dist/hooks/resources/useResourceLibrary.d.ts +8 -1
- package/dist/hooks/resources/useResourceLibrary.js +5 -5
- package/dist/hooks/settings/useAccessTokens.d.ts +3 -3
- package/dist/hooks/settings/useAccessTokens.js +1 -0
- package/dist/lib/downloadUrl.d.ts +6 -0
- package/dist/lib/downloadUrl.js +6 -0
- package/dist/navigation/menuItems.js +4 -4
- package/dist/pages/Explore.js +1 -1
- package/dist/pages/admin/ApiKeys.js +3 -3
- package/dist/pages/admin/ConfigEditor.js +1 -1
- package/dist/pages/admin/ConfigurationCommunityFeed.js +2 -2
- package/dist/pages/admin/ConfigurationCommunityLanguage.js +2 -2
- package/dist/pages/admin/ConfigurationCommunityTimezone.js +2 -2
- package/dist/pages/admin/ConfigurationEmail.js +2 -2
- package/dist/pages/admin/ConfigurationI18n.js +1 -1
- package/dist/pages/admin/ConfigurationSso.js +1 -1
- package/dist/pages/admin/ConfigurationSsoNew.js +1 -1
- package/dist/pages/admin/Dashboard.js +1 -1
- package/dist/pages/admin/Db.js +4 -4
- package/dist/pages/admin/DiagnosticsEmail.js +3 -3
- package/dist/pages/admin/DiagnosticsJob.js +2 -2
- package/dist/pages/admin/DiagnosticsLivekit.js +1 -1
- package/dist/pages/admin/DiagnosticsLogs.js +2 -2
- package/dist/pages/admin/DiagnosticsPerformance.js +1 -1
- package/dist/pages/admin/GroupMembers.js +5 -5
- package/dist/pages/admin/Groups.js +2 -2
- package/dist/pages/admin/Invites.js +3 -3
- package/dist/pages/admin/Media.js +2 -2
- package/dist/pages/admin/MemberDetail.js +7 -7
- package/dist/pages/admin/Members.js +2 -2
- package/dist/pages/admin/analytics/AnalyticsLayout.js +3 -1
- package/dist/pages/admin/analytics/Content.js +1 -1
- package/dist/pages/admin/analytics/Engagement.js +1 -1
- package/dist/pages/admin/analytics/Groups.js +1 -1
- package/dist/pages/admin/analytics/ReportSettings.js +1 -1
- package/dist/pages/admin/community/CommunityAccess.js +1 -1
- package/dist/pages/admin/community/CommunityFavicons.js +1 -1
- package/dist/pages/admin/community/CommunityForbiddenUsernames.js +2 -2
- package/dist/pages/admin/community/CommunityInfo.js +1 -1
- package/dist/pages/admin/community/CommunityLinks.js +1 -1
- package/dist/pages/admin/community/CommunityMarkdownPage.js +1 -1
- package/dist/pages/admin/community/CommunityProfileFields.js +2 -2
- package/dist/pages/admin/community/CommunityRoles.js +7 -7
- package/dist/pages/admin/community/CommunityTheme.js +3 -2
- package/dist/pages/admin/community/ThemeColorPreview.d.ts +8 -0
- package/dist/pages/admin/community/ThemeColorPreview.js +46 -0
- package/dist/pages/admin/community/ThemeColorPreview.test.d.ts +1 -0
- package/dist/pages/admin/community/ThemeColorPreview.test.js +49 -0
- package/dist/pages/admin/components/AdminGroupCard.js +1 -1
- package/dist/pages/admin/components/EditInviteLinkModal.js +1 -1
- package/dist/pages/admin/components/InviteWithEmailModal.js +2 -2
- package/dist/pages/admin/components/InviteWithLinkModal.js +3 -3
- package/dist/pages/admin/components/ProfileRowActions.js +4 -4
- package/dist/pages/admin/components/RestoreBackupModal.js +2 -2
- package/dist/pages/admin/components/RestoreTestBackupModal.js +1 -1
- package/dist/pages/auth/Login.js +1 -1
- package/dist/pages/auth/Register.js +3 -3
- package/dist/pages/auth/RequestResetPassword.js +1 -1
- package/dist/pages/conversations/Info.js +1 -1
- package/dist/pages/conversations/Show.js +45 -15
- package/dist/pages/events/Index.js +1 -1
- package/dist/pages/feeds/Bookmarks.js +1 -1
- package/dist/pages/groups/EditInfo.js +1 -1
- package/dist/pages/groups/EditRoles.js +1 -1
- package/dist/pages/groups/Index.js +1 -1
- package/dist/pages/groups/Members.js +2 -2
- package/dist/pages/groups/New.js +1 -1
- package/dist/pages/groups/Show.js +2 -2
- package/dist/pages/settings/AccessTokens.js +4 -4
- package/dist/pages/settings/Account.js +1 -1
- package/dist/pages/settings/Feed.js +1 -1
- package/dist/pages/settings/Language.js +1 -1
- package/dist/pages/settings/PublicProfile.js +3 -3
- package/dist/pages/settings/PushEnabledDevices.js +1 -1
- package/dist/pages/settings/Theme.js +1 -1
- package/dist/pages/settings/Timezone.js +1 -1
- package/dist/react-native.d.ts +1 -1
- package/dist/react-native.js +1 -1
- package/package.json +9 -9
- package/src/components/RelationCapabilitiesEditor.tsx +3 -3
- package/src/components/RoleCapabilityMatrix.tsx +2 -2
- package/src/components/accounts/SignUpLoginModal.tsx +1 -1
- package/src/components/configuration/ConfigurationList.tsx +2 -2
- package/src/components/conversations/ConversationMessageBubble.tsx +24 -0
- package/src/components/conversations/CreateNewConversation.tsx +114 -78
- package/src/components/form/ImageEditModal.tsx +2 -2
- package/src/components/groups/ChangeGroupRolesModal.tsx +1 -1
- package/src/components/groups/ConfirmGroupExitModal.tsx +1 -1
- package/src/components/groups/ConfirmMemberRemovalModal.tsx +2 -2
- package/src/components/groups/DeleteGroupModal.tsx +2 -2
- package/src/components/groups/GroupForm.tsx +2 -2
- package/src/components/groups/GroupNotificationSettingsModal.tsx +2 -2
- package/src/components/jams/JamCallParticipant.tsx +4 -3
- package/src/components/jams/JamGuestForm.tsx +1 -1
- package/src/components/jams/jamEventActions.ts +21 -0
- package/src/components/navigation/ContentHeader.tsx +3 -3
- package/src/components/navigation/FooterMobile.tsx +1 -1
- package/src/components/navigation/SideBar.tsx +3 -3
- package/src/components/post/FullPostLayout.tsx +1 -1
- package/src/components/post/index.ts +1 -0
- package/src/components/post/pieces/EventRsvpList.tsx +1 -1
- package/src/components/post/pieces/EventRsvpScopeDialog.tsx +2 -2
- package/src/components/post/pieces/EventWaitlistJoinDialog.tsx +1 -1
- package/src/components/post/pieces/GalleryModal.tsx +1 -1
- package/src/components/post/pieces/modals/DeletePostModal.tsx +2 -2
- package/src/components/post/post-form/ComposeAttachments.tsx +10 -0
- package/src/components/post/post-form/DescriptionEditModal.tsx +1 -1
- package/src/components/post/post-form/EditPostModal.tsx +2 -2
- package/src/components/post/post-form/EventForm.tsx +8 -26
- package/src/components/post/post-form/PostAudienceSelector.tsx +2 -2
- package/src/components/post/post-form/ReplyModal.tsx +1 -1
- package/src/components/post/types/event/FullEvent.tsx +3 -3
- package/src/components/post/types/resource/FullResource.tsx +2 -1
- package/src/components/preview-link/RemotePreviewLink.tsx +92 -25
- package/src/components/profile/ProfileActivitySummary.tsx +4 -4
- package/src/components/profile/ProfileBadge.tsx +1 -1
- package/src/components/profile/ProfilePageAction.tsx +1 -1
- package/src/components/profile/ProfilePostsAndReplies.tsx +2 -2
- package/src/components/profile/ProfileSelector.tsx +1 -1
- package/src/components/profile/ReportProfileOrPostModal.tsx +4 -2
- package/src/components/resources/CategoryPathPicker.tsx +1 -1
- package/src/components/resources/ResourceCard.tsx +5 -3
- package/src/components/resources/ResourceLibrary.tsx +79 -4
- package/src/contexts/router/index.tsx +40 -1
- package/src/hooks/conversations/dmMessage.ts +26 -0
- package/src/hooks/conversations/useCreateConversation.ts +7 -0
- package/src/hooks/events/useEventForm.ts +32 -1
- package/src/hooks/index.ts +10 -1
- package/src/hooks/posts/useFeedPostActions.ts +4 -18
- package/src/hooks/posts/usePostReactionToggle.ts +60 -0
- package/src/hooks/resources/useResourceLibrary.ts +20 -5
- package/src/hooks/settings/useAccessTokens.ts +1 -0
- package/src/lib/downloadUrl.ts +7 -0
- package/src/navigation/menuItems.ts +4 -4
- package/src/pages/Explore.tsx +4 -4
- package/src/pages/admin/ApiKeys.tsx +4 -4
- package/src/pages/admin/ConfigEditor.tsx +1 -1
- package/src/pages/admin/ConfigurationCommunityFeed.tsx +2 -2
- package/src/pages/admin/ConfigurationCommunityLanguage.tsx +2 -2
- package/src/pages/admin/ConfigurationCommunityTimezone.tsx +2 -2
- package/src/pages/admin/ConfigurationEmail.tsx +2 -2
- package/src/pages/admin/ConfigurationI18n.tsx +1 -1
- package/src/pages/admin/ConfigurationSso.tsx +1 -1
- package/src/pages/admin/ConfigurationSsoNew.tsx +1 -1
- package/src/pages/admin/Dashboard.tsx +1 -1
- package/src/pages/admin/Db.tsx +6 -6
- package/src/pages/admin/DiagnosticsEmail.tsx +5 -5
- package/src/pages/admin/DiagnosticsJob.tsx +2 -2
- package/src/pages/admin/DiagnosticsLivekit.tsx +3 -3
- package/src/pages/admin/DiagnosticsLogs.tsx +4 -4
- package/src/pages/admin/DiagnosticsPerformance.tsx +1 -1
- package/src/pages/admin/GroupMembers.tsx +6 -6
- package/src/pages/admin/Groups.tsx +2 -2
- package/src/pages/admin/Invites.tsx +4 -4
- package/src/pages/admin/Media.tsx +2 -2
- package/src/pages/admin/MemberDetail.tsx +7 -7
- package/src/pages/admin/Members.tsx +2 -2
- package/src/pages/admin/analytics/AnalyticsLayout.tsx +5 -1
- package/src/pages/admin/analytics/Content.tsx +1 -1
- package/src/pages/admin/analytics/Engagement.tsx +1 -1
- package/src/pages/admin/analytics/Groups.tsx +1 -1
- package/src/pages/admin/analytics/ReportSettings.tsx +1 -1
- package/src/pages/admin/community/CommunityAccess.tsx +1 -1
- package/src/pages/admin/community/CommunityFavicons.tsx +1 -1
- package/src/pages/admin/community/CommunityForbiddenUsernames.tsx +2 -2
- package/src/pages/admin/community/CommunityInfo.tsx +1 -1
- package/src/pages/admin/community/CommunityLinks.tsx +1 -1
- package/src/pages/admin/community/CommunityMarkdownPage.tsx +1 -1
- package/src/pages/admin/community/CommunityProfileFields.tsx +5 -5
- package/src/pages/admin/community/CommunityRoles.tsx +9 -9
- package/src/pages/admin/community/CommunityTheme.tsx +26 -23
- package/src/pages/admin/community/ThemeColorPreview.tsx +141 -0
- package/src/pages/admin/components/AdminGroupCard.tsx +2 -2
- package/src/pages/admin/components/EditInviteLinkModal.tsx +2 -2
- package/src/pages/admin/components/InviteWithEmailModal.tsx +2 -2
- package/src/pages/admin/components/InviteWithLinkModal.tsx +3 -3
- package/src/pages/admin/components/ProfileRowActions.tsx +6 -6
- package/src/pages/admin/components/RestoreBackupModal.tsx +2 -2
- package/src/pages/admin/components/RestoreTestBackupModal.tsx +1 -1
- package/src/pages/auth/Login.tsx +1 -1
- package/src/pages/auth/Register.tsx +3 -3
- package/src/pages/auth/RequestResetPassword.tsx +1 -1
- package/src/pages/conversations/Info.tsx +1 -1
- package/src/pages/conversations/Show.tsx +94 -33
- package/src/pages/events/Index.tsx +1 -1
- package/src/pages/feeds/Bookmarks.tsx +3 -1
- package/src/pages/groups/EditInfo.tsx +1 -1
- package/src/pages/groups/EditRoles.tsx +1 -1
- package/src/pages/groups/Index.tsx +1 -1
- package/src/pages/groups/Members.tsx +2 -2
- package/src/pages/groups/New.tsx +1 -1
- package/src/pages/groups/Show.tsx +4 -4
- package/src/pages/settings/AccessTokens.tsx +4 -4
- package/src/pages/settings/Account.tsx +1 -1
- package/src/pages/settings/Feed.tsx +1 -1
- package/src/pages/settings/Language.tsx +1 -1
- package/src/pages/settings/PublicProfile.tsx +3 -3
- package/src/pages/settings/PushEnabledDevices.tsx +3 -6
- package/src/pages/settings/Theme.tsx +1 -1
- package/src/pages/settings/Timezone.tsx +1 -1
- package/src/react-native.ts +1 -0
|
@@ -109,7 +109,7 @@ export function InviteWithLinkModal({ onClose }) {
|
|
|
109
109
|
defaultValue: 'Copied to clipboard',
|
|
110
110
|
}) })) : null, _jsx(InviteQrPreview, { slug: createdSlug })] })) : (_jsxs("div", { className: "space-y-4 px-1", children: [_jsx("p", { className: "text-muted-foreground text-sm", children: t('admin.inviteLink.description', {
|
|
111
111
|
defaultValue: 'Invite Links can be limited to a number of uses or by date',
|
|
112
|
-
}) }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "invite-slug", children: t('
|
|
112
|
+
}) }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "invite-slug", children: t('common.labels.link', { defaultValue: 'Link' }) }), _jsx(Input, { id: "invite-slug", value: slug, placeholder: t('admin.inviteLink.generateButton', {
|
|
113
113
|
defaultValue: 'Create Link',
|
|
114
114
|
}), onChange: (e) => setSlug(e.target.value) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "invite-uses", children: t('admin.inviteLink.numberOfUses', {
|
|
115
115
|
defaultValue: 'Number of Uses',
|
|
@@ -119,11 +119,11 @@ export function InviteWithLinkModal({ onClose }) {
|
|
|
119
119
|
defaultValue: 'Expires After',
|
|
120
120
|
}) }), _jsxs("select", { id: "invite-expiry", className: "border-input bg-background w-full rounded-md border p-2 text-sm", value: expiry, onChange: (e) => setExpiry(e.target.value), children: [_jsx("option", { value: "P1D", children: t('admin.inviteLink.oneDay', { defaultValue: 'One Day' }) }), _jsx("option", { value: "P2D", children: t('admin.inviteLink.twoDays', { defaultValue: 'Two Days' }) }), _jsx("option", { value: "P1W", children: t('admin.inviteLink.oneWeek', { defaultValue: 'One Week' }) }), _jsx("option", { value: "P1M", children: t('admin.inviteLink.oneMonth', {
|
|
121
121
|
defaultValue: 'One Month',
|
|
122
|
-
}) }), _jsx("option", { value: "P100Y", children: t('
|
|
122
|
+
}) }), _jsx("option", { value: "P100Y", children: t('common.states.never', { defaultValue: 'Never' }) })] })] }), groups.length > 0 ? (_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "invite-groups", children: t('admin.inviteLink.autoJoinGroups', {
|
|
123
123
|
defaultValue: 'Auto-join groups',
|
|
124
124
|
}) }), _jsx("p", { className: "text-muted-foreground text-xs", children: t('admin.inviteLink.autoJoinGroupsHint', {
|
|
125
125
|
defaultValue: 'People who register with this link are added as members of the groups you select.',
|
|
126
|
-
}) }), _jsx("div", { id: "invite-groups", className: "max-h-40 space-y-1 overflow-y-auto rounded-md border p-2", children: groups.map((g) => (_jsxs("label", { className: "flex items-center justify-between gap-2 text-sm", children: [_jsx("span", { children: g.displayName || `@${g.handle}` }), _jsx("input", { type: "checkbox", className: "size-4", checked: selectedGroups.has(g.id), onChange: (e) => toggleGroup(g.id, e.target.checked) })] }, g.id))) })] })) : null, error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null] })), createdSlug ? (_jsx(DialogActions, { actionLabel: t('admin.inviteLink.done', { defaultValue: 'Done' }), onAction: onClose })) : (_jsx(DialogActions, { cancelLabel: t('common.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('admin.inviteLink.generateButton', {
|
|
126
|
+
}) }), _jsx("div", { id: "invite-groups", className: "max-h-40 space-y-1 overflow-y-auto rounded-md border p-2", children: groups.map((g) => (_jsxs("label", { className: "flex items-center justify-between gap-2 text-sm", children: [_jsx("span", { children: g.displayName || `@${g.handle}` }), _jsx("input", { type: "checkbox", className: "size-4", checked: selectedGroups.has(g.id), onChange: (e) => toggleGroup(g.id, e.target.checked) })] }, g.id))) })] })) : null, error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null] })), createdSlug ? (_jsx(DialogActions, { actionLabel: t('admin.inviteLink.done', { defaultValue: 'Done' }), onAction: onClose })) : (_jsx(DialogActions, { cancelLabel: t('common.actions.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('admin.inviteLink.generateButton', {
|
|
127
127
|
defaultValue: 'Create Link',
|
|
128
128
|
}), onAction: submit, disabled: submitting }))] }) }));
|
|
129
129
|
}
|
|
@@ -17,7 +17,7 @@ export function ProfileRowActions({ profile }) {
|
|
|
17
17
|
defaultValue: 'View Details',
|
|
18
18
|
}), action: viewDetails }), _jsx(PopupMenuButton, { icon: MailIcon, title: t('profile.table.editEmail', { defaultValue: 'Edit Email' }), text: t('profile.table.editEmail', { defaultValue: 'Edit Email' }), action: () => setActiveModal('email') }), _jsx(PopupMenuButton, { icon: PencilIcon, title: t('profile.table.editRoles', { defaultValue: 'Edit Roles' }), text: t('profile.table.editRoles', { defaultValue: 'Edit Roles' }), action: () => setActiveModal('roles') }), _jsx(PopupMenuButton, { icon: Trash2, title: t('profile.table.deleteMember', {
|
|
19
19
|
defaultValue: 'Delete Member',
|
|
20
|
-
}), text: t('
|
|
20
|
+
}), text: t('common.actions.delete', { defaultValue: 'Delete' }), action: () => setActiveModal('delete'), danger: true })] }), activeModal === 'email' && account ? (_jsx(EditEmailModal, { profile: profile, onClose: () => setActiveModal(null) })) : null, activeModal === 'roles' ? (_jsx(EditRolesModal, { profile: profile, onClose: () => setActiveModal(null) })) : null, activeModal === 'delete' ? (_jsx(DeleteProfileModal, { profile: profile, onClose: () => setActiveModal(null) })) : null] }));
|
|
21
21
|
}
|
|
22
22
|
function EditEmailModal({ profile, onClose, }) {
|
|
23
23
|
const t = useT();
|
|
@@ -49,7 +49,7 @@ function EditEmailModal({ profile, onClose, }) {
|
|
|
49
49
|
setSubmitting(false);
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-sm", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('accounts.editEmail.title', { defaultValue: 'Edit Email' }) }) }), _jsxs("div", { className: "space-y-2 px-1", children: [_jsx(Label, { htmlFor: "edit-email-input", children: t('
|
|
52
|
+
return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-sm", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('accounts.editEmail.title', { defaultValue: 'Edit Email' }) }) }), _jsxs("div", { className: "space-y-2 px-1", children: [_jsx(Label, { htmlFor: "edit-email-input", children: t('common.labels.email', { defaultValue: 'Email' }) }), _jsx(Input, { id: "edit-email-input", type: "email", value: email, onChange: (e) => setEmail(e.target.value) })] }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(DialogActions, { cancelLabel: t('common.actions.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('accounts.editEmail.saveChanges', {
|
|
53
53
|
defaultValue: 'Update Email',
|
|
54
54
|
}), onAction: submit, disabled: submitting })] }) }));
|
|
55
55
|
}
|
|
@@ -93,7 +93,7 @@ function EditRolesModal({ profile, onClose, }) {
|
|
|
93
93
|
defaultValue: 'Edit Roles',
|
|
94
94
|
}) }) }), _jsx("p", { className: "px-1 text-sm", children: t('profile.modals.editProfile.description', {
|
|
95
95
|
defaultValue: 'Choose one or more roles for this profile',
|
|
96
|
-
}) }), _jsx("div", { className: "space-y-3 px-1", children: allRoles.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('profile.modals.editProfile.roles', { defaultValue: 'Roles' }) })) : (allRoles.map((role) => (_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsx(Label, { htmlFor: `role-${role.key}`, classes: "text-base font-medium", children: role.displayName || role.key }), _jsx("input", { id: `role-${role.key}`, type: "checkbox", checked: selected.has(role.key), onChange: (e) => toggle(role.key, e.target.checked), className: "size-4" })] }, role.key)))) }), 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('profile.modals.editProfile.saveChanges', {
|
|
96
|
+
}) }), _jsx("div", { className: "space-y-3 px-1", children: allRoles.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('profile.modals.editProfile.roles', { defaultValue: 'Roles' }) })) : (allRoles.map((role) => (_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsx(Label, { htmlFor: `role-${role.key}`, classes: "text-base font-medium", children: role.displayName || role.key }), _jsx("input", { id: `role-${role.key}`, type: "checkbox", checked: selected.has(role.key), onChange: (e) => toggle(role.key, e.target.checked), className: "size-4" })] }, role.key)))) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(DialogActions, { cancelLabel: t('common.actions.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('profile.modals.editProfile.saveChanges', {
|
|
97
97
|
defaultValue: 'Save Changes',
|
|
98
98
|
}), onAction: submit, disabled: submitting })] }) }));
|
|
99
99
|
}
|
|
@@ -131,7 +131,7 @@ function DeleteProfileModal({ profile, onClose, }) {
|
|
|
131
131
|
defaultValue: 'Are you sure you want to delete this profile? This action cannot be undone.',
|
|
132
132
|
username: profile.displayName || profile.handle,
|
|
133
133
|
handle: profile.handle,
|
|
134
|
-
}) }), 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('
|
|
134
|
+
}) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(DialogActions, { cancelLabel: t('common.actions.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('common.actions.delete', {
|
|
135
135
|
defaultValue: 'Delete',
|
|
136
136
|
}), onAction: submit, actionVariant: "destructive", disabled: submitting })] }) }));
|
|
137
137
|
}
|
|
@@ -29,9 +29,9 @@ export function RestoreBackupModal({ onClose }) {
|
|
|
29
29
|
};
|
|
30
30
|
return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-md", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('admin.backups.restore.title', {
|
|
31
31
|
defaultValue: 'Restore backup',
|
|
32
|
-
}) }) }), _jsx("div", { className: "px-1", children: _jsx("input", { type: "file", accept: ".zip", className: "w-full rounded-md border p-2 text-sm", onChange: (e) => setFile(e.target.files?.item(0) ?? null) }) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(DialogActions, { cancelLabel: t('
|
|
32
|
+
}) }) }), _jsx("div", { className: "px-1", children: _jsx("input", { type: "file", accept: ".zip", className: "w-full rounded-md border p-2 text-sm", onChange: (e) => setFile(e.target.files?.item(0) ?? 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.actions.cancel', {
|
|
33
33
|
defaultValue: 'Cancel',
|
|
34
|
-
}), onCancel: onClose, actionLabel: t('
|
|
34
|
+
}), onCancel: onClose, actionLabel: t('common.actions.confirm', {
|
|
35
35
|
defaultValue: 'Confirm',
|
|
36
36
|
}), onAction: submit, disabled: !file || submitting })] }) }));
|
|
37
37
|
}
|
|
@@ -30,7 +30,7 @@ export function RestoreTestBackupModal({ onClose, }) {
|
|
|
30
30
|
defaultValue: 'Restore test data',
|
|
31
31
|
}) }) }), _jsx("p", { className: "px-1 text-sm", children: t('admin.backups.testRestore.confirm', {
|
|
32
32
|
defaultValue: 'This will restore sample test data into the community. Are you sure?',
|
|
33
|
-
}) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(DialogActions, { cancelLabel: t('
|
|
33
|
+
}) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(DialogActions, { cancelLabel: t('common.actions.cancel', {
|
|
34
34
|
defaultValue: 'Cancel',
|
|
35
35
|
}), onCancel: onClose, actionLabel: t('admin.backups.testRestore.continue', {
|
|
36
36
|
defaultValue: 'Continue',
|
package/dist/pages/auth/Login.js
CHANGED
|
@@ -88,7 +88,7 @@ export function Login() {
|
|
|
88
88
|
}
|
|
89
89
|
return layout(_jsxs(_Fragment, { children: [_jsx(Form, { ...form, children: _jsxs("form", { className: "flex flex-col gap-3", onSubmit: onSubmit, children: [_jsx("h2", { className: "text-xl", "data-testid": "auth-login-title", children: t('auth.login.title', { defaultValue: 'Login' }) }), _jsx("p", { children: t('auth.login.welcomeBack', {
|
|
90
90
|
defaultValue: 'Welcome back, enter details below to log into your community',
|
|
91
|
-
}) }), _jsx(FormField, { control: form.control, name: "email", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('
|
|
91
|
+
}) }), _jsx(FormField, { control: form.control, name: "email", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('common.labels.email', { defaultValue: 'Email' }) }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "email", autoComplete: "email", placeholder: t('auth.login.emailPlaceholder', {
|
|
92
92
|
defaultValue: 'you@email.org',
|
|
93
93
|
}), "data-testid": "auth-login-email" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "password", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('auth.login.password', { defaultValue: 'Password' }) }), _jsx(FormControl, { children: _jsxs("div", { className: "relative", children: [_jsx(Input, { ...field, type: showPassword ? 'text' : 'password', autoComplete: "current-password", "data-testid": "auth-login-password", className: "pr-10" }), _jsxs("button", { type: "button", onClick: () => setShowPassword((v) => !v), "aria-label": showPassword
|
|
94
94
|
? t('auth.login.hidePassword', {
|
|
@@ -127,11 +127,11 @@ export function Register({ invite = false }) {
|
|
|
127
127
|
}) }), invite && (_jsx("p", { className: "my-2", children: t('auth.register.inviteMessage', {
|
|
128
128
|
communityName: serverInfo.communityConfig?.info?.name,
|
|
129
129
|
defaultValue: "You've been invited to join {{communityName}}, enter details below to be a part of the community.",
|
|
130
|
-
}) })), _jsx(FormField, { control: form.control, name: "handle", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('
|
|
130
|
+
}) })), _jsx(FormField, { control: form.control, name: "handle", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('common.labels.handle', { defaultValue: 'Handle' }) }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", placeholder: t('auth.register.handlePlaceholder', {
|
|
131
131
|
defaultValue: 'Handle',
|
|
132
|
-
}), "data-testid": "auth-register-handle" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "displayName", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('
|
|
132
|
+
}), "data-testid": "auth-register-handle" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "displayName", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('common.labels.name', { defaultValue: 'Name' }) }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", placeholder: t('auth.register.namePlaceholder', {
|
|
133
133
|
defaultValue: 'Name',
|
|
134
|
-
}), "data-testid": "auth-register-name" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "email", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('
|
|
134
|
+
}), "data-testid": "auth-register-name" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "email", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('common.labels.email', { defaultValue: 'Email' }) }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "email", placeholder: t('auth.register.emailPlaceholder', {
|
|
135
135
|
defaultValue: 'you@email.org',
|
|
136
136
|
}), "data-testid": "auth-register-email" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "password", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('auth.register.password', { defaultValue: 'Password' }) }), _jsx(FormControl, { children: _jsxs("div", { className: "relative", children: [_jsx(Input, { ...field, type: showPassword ? 'text' : 'password', "data-testid": "auth-register-password", className: "pr-10" }), _jsxs("button", { type: "button", onClick: () => setShowPassword((v) => !v), "aria-label": showPassword
|
|
137
137
|
? t('auth.register.hidePassword', {
|
|
@@ -40,7 +40,7 @@ export function RequestResetPassword() {
|
|
|
40
40
|
void handleSubmit();
|
|
41
41
|
}, children: [_jsx("h2", { className: "text-xl", "data-testid": "auth-request-reset-heading", children: t('auth.requestResetPassword.heading', {
|
|
42
42
|
defaultValue: 'Request Password Reset',
|
|
43
|
-
}) }), _jsx("p", { className: "pt-4", children: prompt }), _jsx(Label, { title: t('
|
|
43
|
+
}) }), _jsx("p", { className: "pt-4", children: prompt }), _jsx(Label, { title: t('common.labels.email', {
|
|
44
44
|
defaultValue: 'Email',
|
|
45
45
|
}), children: _jsx(Input, { type: "email", "data-testid": "auth-request-reset-email", value: email, onChange: (e) => setEmail(e.target.value), required: true, placeholder: t('auth.requestResetPassword.emailPlaceholder', {
|
|
46
46
|
defaultValue: 'you@email.org',
|
|
@@ -57,7 +57,7 @@ export function ConversationInfo() {
|
|
|
57
57
|
defaultValue: 'Leave Conversation',
|
|
58
58
|
}) }) }), _jsx("p", { className: "px-1 text-sm", children: t('conversations.leaveConversation.description', {
|
|
59
59
|
defaultValue: 'Are you sure you want to leave this conversation?',
|
|
60
|
-
}) }), leaveError ? (_jsx("p", { className: "text-destructive border-destructive/30 rounded-md border p-2 text-sm", children: leaveError })) : null, _jsx(DialogActions, { cancelLabel: t('common.cancel', { defaultValue: 'Cancel' }), onCancel: () => setConfirmOpen(false), actionLabel: t('conversations.leaveConversation.leave', {
|
|
60
|
+
}) }), leaveError ? (_jsx("p", { className: "text-destructive border-destructive/30 rounded-md border p-2 text-sm", children: leaveError })) : null, _jsx(DialogActions, { cancelLabel: t('common.actions.cancel', { defaultValue: 'Cancel' }), onCancel: () => setConfirmOpen(false), actionLabel: t('conversations.leaveConversation.leave', {
|
|
61
61
|
defaultValue: 'Leave',
|
|
62
62
|
}), onAction: handleLeave, actionVariant: "destructive", disabled: isLeaving })] }) })] }));
|
|
63
63
|
}
|
|
@@ -1,15 +1,52 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { useParams, useSearchParams } from 'react-router-dom';
|
|
4
|
-
import { Info, Search } from 'lucide-react';
|
|
4
|
+
import { Image, Info, Search } from 'lucide-react';
|
|
5
5
|
import { useT, useOpenpeeps, useSetPageHeader, usePostViewFlush, adjustUnseenCounts, useNavigate, } from '../../index.js';
|
|
6
6
|
import { canCreatePost } from '@openpeepshq/common';
|
|
7
|
-
import { Avatar, ConversationParticipantsModal, DirectMessageSearch, MessageInThread, OpenpeepsMarkdownInput, ProfileCard, useAuthData, useCurrentProfile, useToast, } from '../../components/index.js';
|
|
7
|
+
import { Avatar, ConversationParticipantsModal, DirectMessageSearch, MessageInThread, OpenpeepsMarkdownInput, ProfileCard, useAuthData, useComposeAttachments, useCurrentProfile, useToast, } from '../../components/index.js';
|
|
8
8
|
import { apiErrorMessage } from '../../lib/apiErrorMessage.js';
|
|
9
|
+
import { canSendDmMessage, DM_MAX_ATTACHMENTS, } from '../../hooks/conversations/dmMessage.js';
|
|
9
10
|
import { Button, LoadingSpinner } from '@openpeepshq/react-ui';
|
|
10
11
|
const MAX_LENGTH = 500;
|
|
11
12
|
const isMessageId = (value) => !!value &&
|
|
12
13
|
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value);
|
|
14
|
+
const ConversationComposer = ({ sending, onSend, }) => {
|
|
15
|
+
const t = useT();
|
|
16
|
+
const [text, setText] = useState('');
|
|
17
|
+
const [attachments, setAttachments] = useState([]);
|
|
18
|
+
const compose = useComposeAttachments({
|
|
19
|
+
attachments,
|
|
20
|
+
onChange: setAttachments,
|
|
21
|
+
});
|
|
22
|
+
const canSend = canSendDmMessage({
|
|
23
|
+
sending,
|
|
24
|
+
uploadsPending: compose.pending,
|
|
25
|
+
text,
|
|
26
|
+
attachments,
|
|
27
|
+
});
|
|
28
|
+
const send = async () => {
|
|
29
|
+
if (!canSend)
|
|
30
|
+
return;
|
|
31
|
+
const sent = await onSend({
|
|
32
|
+
type: 'note',
|
|
33
|
+
content: text.trim(),
|
|
34
|
+
attachments: attachments.length ? attachments : undefined,
|
|
35
|
+
});
|
|
36
|
+
if (!sent)
|
|
37
|
+
return;
|
|
38
|
+
setText('');
|
|
39
|
+
compose.clear();
|
|
40
|
+
};
|
|
41
|
+
const addImageLabel = t('posts.form.addImage', {
|
|
42
|
+
defaultValue: 'Add Media',
|
|
43
|
+
});
|
|
44
|
+
return (_jsxs("footer", { className: "space-y-2 border-t p-3", children: [compose.previews, _jsx(OpenpeepsMarkdownInput, { rows: 3, value: text, onChange: setText, maxLength: MAX_LENGTH, placeholder: t('conversations.placeholder', {
|
|
45
|
+
defaultValue: 'Write a message…',
|
|
46
|
+
}) }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx(Button, { compact: true, variant: "ghost", title: addImageLabel, action: compose.openImagePicker, disabled: attachments.length >= DM_MAX_ATTACHMENTS, "data-testid": "conversation-add-image", children: _jsx(Image, { className: "size-5" }) }), _jsx(Button, { title: t('common.send', { defaultValue: 'Send' }), variant: "default", action: send, disabled: !canSend, children: sending
|
|
47
|
+
? t('common.sending', { defaultValue: 'Sending…' })
|
|
48
|
+
: t('common.send', { defaultValue: 'Send' }) })] }), compose.inputs] }));
|
|
49
|
+
};
|
|
13
50
|
export function ConversationShow() {
|
|
14
51
|
const t = useT();
|
|
15
52
|
const { id = '' } = useParams();
|
|
@@ -61,7 +98,7 @@ export function ConversationShow() {
|
|
|
61
98
|
}, [multipleParticipants, participantNames, openParticipantsLabel]);
|
|
62
99
|
const navigate = useNavigate();
|
|
63
100
|
const searchLabel = searchOpen
|
|
64
|
-
? t('common.close', { defaultValue: 'Close' })
|
|
101
|
+
? t('common.actions.close', { defaultValue: 'Close' })
|
|
65
102
|
: t('conversations.search.toggle', {
|
|
66
103
|
defaultValue: 'Search this conversation',
|
|
67
104
|
});
|
|
@@ -71,31 +108,29 @@ export function ConversationShow() {
|
|
|
71
108
|
defaultValue: 'Conversation info',
|
|
72
109
|
}), className: "text-muted-foreground hover:text-foreground rounded-md p-1.5", children: _jsx(Info, { size: 18 }) })] })), [id, navigate, searchLabel, searchOpen, t]);
|
|
73
110
|
useSetPageHeader(headerTitle, headerActions);
|
|
74
|
-
const [text, setText] = useState('');
|
|
75
111
|
const [sending, setSending] = useState(false);
|
|
76
|
-
const
|
|
77
|
-
if (!text.trim() || text.length > MAX_LENGTH)
|
|
78
|
-
return;
|
|
112
|
+
const sendMessage = async (data) => {
|
|
79
113
|
setSending(true);
|
|
80
114
|
try {
|
|
81
115
|
const payload = {
|
|
82
116
|
visibility: 'direct',
|
|
83
117
|
audience: lastMessage?.audience ?? participants,
|
|
84
118
|
type: 'note',
|
|
85
|
-
data
|
|
119
|
+
data,
|
|
86
120
|
};
|
|
87
121
|
await createMessage(payload);
|
|
88
|
-
setText('');
|
|
89
122
|
await conversationQuery.refetch();
|
|
90
123
|
await queryClient.invalidateQueries({
|
|
91
124
|
queryKey: client.conversations.list.queryKey({}),
|
|
92
125
|
refetchType: 'all',
|
|
93
126
|
});
|
|
127
|
+
return true;
|
|
94
128
|
}
|
|
95
129
|
catch (err) {
|
|
96
130
|
toast.error(apiErrorMessage(err, t, t('conversations.sendError', {
|
|
97
131
|
defaultValue: 'Failed to send message',
|
|
98
132
|
})));
|
|
133
|
+
return false;
|
|
99
134
|
}
|
|
100
135
|
finally {
|
|
101
136
|
setSending(false);
|
|
@@ -156,7 +191,6 @@ export function ConversationShow() {
|
|
|
156
191
|
if (conversationQuery.isLoading && messages.length === 0) {
|
|
157
192
|
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
158
193
|
}
|
|
159
|
-
const overLimit = text.length > MAX_LENGTH;
|
|
160
194
|
return (_jsxs("div", { className: "flex h-[calc(100vh-8rem)] flex-col", children: [_jsx("header", { className: "border-b", children: participants.length === 1 && participants[0] ? (_jsx(ProfileCard, { profile: participants[0], showAction: false })) : multipleParticipants ? (_jsxs("button", { type: "button", className: "flex w-full min-w-0 items-center gap-2 p-3 text-left", onClick: () => setParticipantsOpen(true), title: openParticipantsLabel, "aria-haspopup": "dialog", children: [_jsx("div", { className: "flex shrink-0 -space-x-2", children: participants.slice(0, 4).map((p) => (_jsx(Avatar, { profile: p, size: 2.25, borderless: true }, p.id))) }), _jsx("div", { className: "min-w-0 truncate text-sm font-medium", children: participantNames })] })) : null }), _jsx(ConversationParticipantsModal, { open: participantsOpen, onOpenChange: setParticipantsOpen, participants: participants }), searchOpen ? (_jsx("div", { id: "conversation-message-search", children: _jsx(DirectMessageSearch, { conversationId: id, autoFocus: true, onSelect: (hit) => {
|
|
161
195
|
const next = new URLSearchParams(searchParams);
|
|
162
196
|
next.set('message', hit.message.id);
|
|
@@ -164,9 +198,5 @@ export function ConversationShow() {
|
|
|
164
198
|
setSearchOpen(false);
|
|
165
199
|
} }) })) : null, _jsxs("div", { role: "log", "aria-live": "polite", "aria-label": t('conversations.messageLog', {
|
|
166
200
|
defaultValue: 'Messages',
|
|
167
|
-
}), className: "flex-1 overflow-y-auto px-3", children: [messages.map((m, index) => (_jsx(MessageInThread, { previous: messages[index - 1], message: m, multipleParticipants: multipleParticipants, conversationRootId: id, highlighted: m.id === focusId }, m.id))), _jsx("div", { ref: endRef })] }), canCreate && (
|
|
168
|
-
defaultValue: 'Write a message…',
|
|
169
|
-
}) }), _jsx("div", { className: "flex justify-end", children: _jsx(Button, { title: "Send", variant: "default", action: send, disabled: sending || !text.trim() || overLimit, children: sending
|
|
170
|
-
? t('common.sending', { defaultValue: 'Sending…' })
|
|
171
|
-
: t('common.send', { defaultValue: 'Send' }) }) })] }))] }));
|
|
201
|
+
}), className: "flex-1 overflow-y-auto px-3", children: [messages.map((m, index) => (_jsx(MessageInThread, { previous: messages[index - 1], message: m, multipleParticipants: multipleParticipants, conversationRootId: id, highlighted: m.id === focusId }, m.id))), _jsx("div", { ref: endRef })] }), canCreate && (_jsx(ConversationComposer, { sending: sending, onSend: sendMessage }, id))] }));
|
|
172
202
|
}
|
|
@@ -16,7 +16,7 @@ export function EventsIndex() {
|
|
|
16
16
|
const pastQuery = openpeepsApi.usePastEventsFeed();
|
|
17
17
|
const activeQuery = tab === 'upcoming' ? upcomingQuery : pastQuery;
|
|
18
18
|
const headerActions = useMemo(() => (_jsx(PopupMenu, { icon: MoreHorizontal, compact: true, children: _jsx(PopupMenuButton, { icon: ChevronRight, title: t('navigation.myEvents', { defaultValue: 'My events' }), text: t('navigation.myEvents', { defaultValue: 'My events' }), action: "/events/my" }) })), [t]);
|
|
19
|
-
useSetPageHeader(t('
|
|
19
|
+
useSetPageHeader(t('common.entities.events', { defaultValue: 'Events' }), headerActions, 'events-page-heading');
|
|
20
20
|
return (_jsxs("div", { className: "p-4", children: [_jsx(NewEventButton, { visibility: visibility, currentProfile: currentProfile, onNavigate: () => navigate('/events/new'), showButton: false }), _jsxs("nav", { "aria-label": t('events.feed.label', {
|
|
21
21
|
defaultValue: 'Event timeframe',
|
|
22
22
|
}), className: "border-border mb-4 flex border-b", children: [_jsx(TabButton, { active: tab === 'upcoming', onClick: () => setTab('upcoming'), children: t('events.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: tab === 'past', onClick: () => setTab('past'), children: t('events.feed.past', { defaultValue: 'Past' }) })] }), _jsx(EventsView, { query: activeQuery, agenda: tab, list: _jsx(EventsFeed, { query: activeQuery }) })] }));
|
|
@@ -7,6 +7,6 @@ export function FeedsBookmarks() {
|
|
|
7
7
|
const { openpeepsApi } = useOpenpeeps();
|
|
8
8
|
// Bookmarks can be replies; threaded would hide them.
|
|
9
9
|
const query = openpeepsApi.useBookmarkedPosts(useFeedListParams({ format: 'linear' }));
|
|
10
|
-
useSetPageHeader(t('
|
|
10
|
+
useSetPageHeader(t('common.entities.bookmarks', { defaultValue: 'Bookmarks' }));
|
|
11
11
|
return _jsx(Feed, { query: query, formatSwitch: false });
|
|
12
12
|
}
|
|
@@ -18,5 +18,5 @@ export function EditGroupInfo() {
|
|
|
18
18
|
}
|
|
19
19
|
return (_jsxs("div", { className: "space-y-4 p-4 pb-12", children: [_jsx(GroupForm, { groupData: groupData, fieldErrors: fieldErrors, isEdit: true, sections: ['info'], onChange: setGroupData }), error && (_jsx(Toast, { variant: "error", onDismiss: clearError, children: error })), _jsx(Button, { title: "Save", variant: "default", action: submit, disabled: submitting, children: submitting
|
|
20
20
|
? t('common.saving', { defaultValue: 'Saving…' })
|
|
21
|
-
: t('common.save', { defaultValue: 'Save' }) })] }));
|
|
21
|
+
: t('common.actions.save', { defaultValue: 'Save' }) })] }));
|
|
22
22
|
}
|
|
@@ -25,5 +25,5 @@ export function EditGroupRoles() {
|
|
|
25
25
|
}
|
|
26
26
|
return (_jsxs("div", { className: "space-y-4 p-4 pb-12", children: [_jsx(GroupForm, { groupData: groupData, isEdit: true, sections: ['roles'], onChange: setGroupData }), error && (_jsx(Toast, { variant: "error", onDismiss: clearError, children: error })), _jsx(Button, { title: "Save", variant: "default", action: submit, disabled: submitting, children: submitting
|
|
27
27
|
? t('common.saving', { defaultValue: 'Saving…' })
|
|
28
|
-
: t('common.save', { defaultValue: 'Save' }) })] }));
|
|
28
|
+
: t('common.actions.save', { defaultValue: 'Save' }) })] }));
|
|
29
29
|
}
|
|
@@ -29,7 +29,7 @@ export function GroupsIndex() {
|
|
|
29
29
|
}
|
|
30
30
|
: undefined, [canCreate, t]);
|
|
31
31
|
useSetPlusButtonActions(plusButton);
|
|
32
|
-
useSetPageHeader(t('
|
|
32
|
+
useSetPageHeader(t('common.entities.groups', { defaultValue: 'Groups' }));
|
|
33
33
|
const filtered = useMemo(() => tabGroups.filter((g) => !search || matchesQuery(g, search)), [tabGroups, search]);
|
|
34
34
|
return (_jsxs("div", { className: "p-4", children: [_jsxs("nav", { "aria-label": t('groups.tabs.label', {
|
|
35
35
|
defaultValue: 'Group lists',
|
|
@@ -14,8 +14,8 @@ export function GroupMembers() {
|
|
|
14
14
|
const groupQuery = openpeepsApi.useGroupByHandle(handle);
|
|
15
15
|
const group = groupQuery.data;
|
|
16
16
|
const headerTitle = group
|
|
17
|
-
? `${groupName(group)} - ${t('
|
|
18
|
-
: t('
|
|
17
|
+
? `${groupName(group)} - ${t('common.entities.members', { defaultValue: 'Members' })}`
|
|
18
|
+
: t('common.entities.members', { defaultValue: 'Members' });
|
|
19
19
|
const headerActions = useMemo(() => (group ? _jsx(AddGroupMembersButton, { group: group }) : undefined), [group]);
|
|
20
20
|
useSetPageHeader(headerTitle, headerActions);
|
|
21
21
|
if (groupQuery.isLoading) {
|
package/dist/pages/groups/New.js
CHANGED
|
@@ -14,7 +14,7 @@ export function NewGroup() {
|
|
|
14
14
|
if (!canCreate) {
|
|
15
15
|
return me ? _jsx(Navigate, { to: "/groups", replace: true }) : null;
|
|
16
16
|
}
|
|
17
|
-
return (_jsxs("div", { className: "space-y-4 p-4 pb-12", children: [_jsx(GroupForm, { groupData: groupData, fieldErrors: fieldErrors, onChange: setGroupData }), _jsxs("div", { className: "space-y-2 px-1", children: [_jsx(Label, { htmlFor: "group-members", children: t('
|
|
17
|
+
return (_jsxs("div", { className: "space-y-4 p-4 pb-12", children: [_jsx(GroupForm, { groupData: groupData, fieldErrors: fieldErrors, onChange: setGroupData }), _jsxs("div", { className: "space-y-2 px-1", children: [_jsx(Label, { htmlFor: "group-members", children: t('common.entities.members', { defaultValue: 'Members' }) }), _jsx(ProfilesInput, { value: members, onChange: setMembers, banlist: me ? [me] : [], placeholder: t('groups.form.membersPlaceholder', {
|
|
18
18
|
defaultValue: 'Add members to this group',
|
|
19
19
|
}) })] }), error && (_jsx(Toast, { variant: "error", testId: "groups-duplicate-handle-error", onDismiss: clearError, children: error })), _jsx(Button, { title: "Create group", variant: "default", action: submit, disabled: submitting, "data-testid": "groups-create-submit", children: submitting
|
|
20
20
|
? t('common.submitting', { defaultValue: 'Creating…' })
|
|
@@ -60,9 +60,9 @@ export function GroupShow() {
|
|
|
60
60
|
}
|
|
61
61
|
return (_jsxs("div", { children: [_jsx(GroupHeader, { group: group }), _jsxs("nav", { "aria-label": t('groups.sections.label', {
|
|
62
62
|
defaultValue: 'Group sections',
|
|
63
|
-
}), className: "border-border flex border-b", "data-testid": "tab-group", children: [_jsx(TabLink, { active: tab === 'posts', hash: "", children: t('
|
|
63
|
+
}), className: "border-border flex border-b", "data-testid": "tab-group", children: [_jsx(TabLink, { active: tab === 'posts', hash: "", children: t('common.entities.posts', { defaultValue: 'Posts' }) }), _jsx(TabLink, { active: tab === 'events', hash: "#events", testId: "groups-tab-events", children: t('common.entities.events', { defaultValue: 'Events' }) }), _jsx(TabLink, { active: tab === 'resources', hash: "#resources", testId: "groups-tab-resources", children: t('groups.sections.resources', { defaultValue: 'Resources' }) }), _jsx(TabLink, { active: tab === 'description', hash: "#description", testId: "groups-tab-description", children: t('common.labels.description', { defaultValue: 'Description' }) })] }), tab === 'posts' && _jsx(GroupFeed, { group: group }), tab === 'events' && (_jsxs("div", { children: [_jsx(NewEventButton, { visibility: "group", currentProfile: currentProfile, group: group, onNavigate: () => navigate('/events/new') }), _jsxs("nav", { "aria-label": t('groups.eventsTabs.label', {
|
|
64
64
|
defaultValue: 'Event timeframe',
|
|
65
|
-
}), className: "border-border flex border-b", children: [_jsx(TabButton, { active: eventsTab === 'upcoming', onClick: () => setEventsTab('upcoming'), children: t('events.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: eventsTab === 'past', onClick: () => setEventsTab('past'), children: t('events.feed.past', { defaultValue: 'Past' }) })] }), _jsx(EventsView, { query: eventsTab === 'upcoming' ? upcomingEvents : pastEvents, agenda: eventsTab, list: _jsx(Feed, { query: eventsTab === 'upcoming' ? upcomingEvents : pastEvents, formatSwitch: false }) })] })), tab === 'resources' && (_jsxs("div", { children: [_jsx(NewResourceButton, { visibility: "group", currentProfile: currentProfile, group: group }), _jsx(ResourceLibrary, { groupId: group.id })] })), tab === 'description' && (_jsxs("div", { className: "space-y-2 p-4", children: [_jsxs("section", { className: "border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Description" }), _jsx(PostMarkdown, { source: group.description || 'No description yet' })] }), _jsxs("section", { className: "space-y-2 border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Details" }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: "Created" }), _jsx("p", { children: new Date(group.createdAt).toLocaleDateString() })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('
|
|
65
|
+
}), className: "border-border flex border-b", children: [_jsx(TabButton, { active: eventsTab === 'upcoming', onClick: () => setEventsTab('upcoming'), children: t('events.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: eventsTab === 'past', onClick: () => setEventsTab('past'), children: t('events.feed.past', { defaultValue: 'Past' }) })] }), _jsx(EventsView, { query: eventsTab === 'upcoming' ? upcomingEvents : pastEvents, agenda: eventsTab, list: _jsx(Feed, { query: eventsTab === 'upcoming' ? upcomingEvents : pastEvents, formatSwitch: false }) })] })), tab === 'resources' && (_jsxs("div", { children: [_jsx(NewResourceButton, { visibility: "group", currentProfile: currentProfile, group: group }), _jsx(ResourceLibrary, { groupId: group.id })] })), tab === 'description' && (_jsxs("div", { className: "space-y-2 p-4", children: [_jsxs("section", { className: "border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Description" }), _jsx(PostMarkdown, { source: group.description || 'No description yet' })] }), _jsxs("section", { className: "space-y-2 border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Details" }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: "Created" }), _jsx("p", { children: new Date(group.createdAt).toLocaleDateString() })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('common.labels.visibility') }), _jsx("p", { children: t(`groups.visibility.${visibilityValue}.description`) })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.whoCanJoin.title') }), _jsx("p", { children: t(`groups.whoCanJoin.${whoCanJoinValue}.description`) })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.whoCanPost.title') }), _jsxs("p", { children: [t(`groups.whoCanPost.${whoCanPostValue}.description`), ".", ' ', t(`groups.whoCanPostEvents.${whoCanPostEventsValue}.description`)] })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.postsVisibility.title') }), _jsx("p", { children: t(`groups.postsVisibility.${postsVisibilityValue}.description`) })] })] }), _jsxs("section", { className: "border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Rules" }), _jsx(PostMarkdown, { source: group.rules || 'No rules yet' })] })] }))] }));
|
|
66
66
|
}
|
|
67
67
|
const TabLink = ({ active, hash, children, testId, }) => {
|
|
68
68
|
const location = useLocation();
|
|
@@ -11,9 +11,9 @@ export function AccessTokensSettings() {
|
|
|
11
11
|
defaultValue: 'Create token',
|
|
12
12
|
}) }), _jsx("p", { className: "text-muted-foreground text-sm", children: t('settings.accessTokens.createDescription', {
|
|
13
13
|
defaultValue: 'Create a personal access token to use the API.',
|
|
14
|
-
}) }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "token-name", children: t('
|
|
14
|
+
}) }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "token-name", children: t('common.labels.name', { defaultValue: 'Name' }) }), _jsx(Input, { id: "token-name", value: form.name, placeholder: t('settings.accessTokens.namePlaceholder', {
|
|
15
15
|
defaultValue: 'My integration',
|
|
16
|
-
}), onChange: (e) => setForm((f) => ({ ...f, name: e.target.value })) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "token-description", children: t('
|
|
16
|
+
}), onChange: (e) => setForm((f) => ({ ...f, name: e.target.value })) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "token-description", children: t('common.labels.description', {
|
|
17
17
|
defaultValue: 'Description',
|
|
18
18
|
}) }), _jsx(Input, { id: "token-description", value: form.description ?? '', placeholder: t('settings.accessTokens.descriptionPlaceholder', {
|
|
19
19
|
defaultValue: 'What is this token for?',
|
|
@@ -23,7 +23,7 @@ export function AccessTokensSettings() {
|
|
|
23
23
|
scopeLevel: e.target.value,
|
|
24
24
|
}), children: ACCESS_TOKEN_SCOPE_LEVELS.map((level) => (_jsx("option", { value: level, children: level }, level))) }), _jsx("select", { className: "border-input bg-background rounded-md border px-2 py-2 text-sm", value: scope.resource.type, onChange: (e) => updateScope(index, {
|
|
25
25
|
resourceType: e.target.value,
|
|
26
|
-
}), children: ACCESS_TOKEN_RESOURCE_TYPES.map((type) => (_jsx("option", { value: type, children: type }, type))) }), _jsx(Button, { variant: "outline", disabled: (form.scopes?.length ?? 0) === 1, action: () => removeScope(index), children: t('common.remove', { defaultValue: 'Remove' }) })] }, index))), _jsx(Button, { variant: "outline", action: addScope, children: t('settings.accessTokens.addScope', { defaultValue: 'Add scope' }) }), error ? (_jsx(Toast, { variant: "error", onDismiss: clearError, children: error })) : null, _jsx(Button, { variant: "default", disabled: creating, action: create, children: creating
|
|
26
|
+
}), children: ACCESS_TOKEN_RESOURCE_TYPES.map((type) => (_jsx("option", { value: type, children: type }, type))) }), _jsx(Button, { variant: "outline", disabled: (form.scopes?.length ?? 0) === 1, action: () => removeScope(index), children: t('common.actions.remove', { defaultValue: 'Remove' }) })] }, index))), _jsx(Button, { variant: "outline", action: addScope, children: t('settings.accessTokens.addScope', { defaultValue: 'Add scope' }) }), error ? (_jsx(Toast, { variant: "error", onDismiss: clearError, children: error })) : null, _jsx(Button, { variant: "default", disabled: creating, action: create, children: creating
|
|
27
27
|
? t('settings.accessTokens.creating', {
|
|
28
28
|
defaultValue: 'Creating…',
|
|
29
29
|
})
|
|
@@ -41,7 +41,7 @@ export function AccessTokensSettings() {
|
|
|
41
41
|
defaultValue: 'Expires',
|
|
42
42
|
}), ":", ' ', token.expiresAt
|
|
43
43
|
? new Date(token.expiresAt).toLocaleString()
|
|
44
|
-
: t('
|
|
44
|
+
: t('common.states.never', {
|
|
45
45
|
defaultValue: 'Never',
|
|
46
46
|
})] })] }), _jsx(Button, { variant: "outline", disabled: !!token.revokedAt, action: () => revoke(token.id), children: token.revokedAt
|
|
47
47
|
? t('settings.accessTokens.revoked', {
|
|
@@ -116,7 +116,7 @@ export function AccountSettings() {
|
|
|
116
116
|
defaultValue: 'Enter your current password',
|
|
117
117
|
}), onChange: (e) => setOldPassword(e.target.value), "data-testid": "settings-current-password-input" }), _jsx("p", { className: "text-muted-foreground text-xs", children: t('settings.account.oldPasswordDescription', {
|
|
118
118
|
defaultValue: 'Required to change your email or password.',
|
|
119
|
-
}) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "email", children: t('
|
|
119
|
+
}) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "email", children: t('common.labels.email', { defaultValue: 'Email' }) }), _jsx(Input, { id: "email", type: "email", value: email, placeholder: t('settings.account.emailPlaceholder', {
|
|
120
120
|
defaultValue: 'Enter your email',
|
|
121
121
|
}), onChange: (e) => setEmail(e.target.value), "data-testid": "settings-email-input" })] }), !account?.emailValidated ? (_jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-muted-foreground text-sm", children: t('settings.account.verifyEmailDescription', {
|
|
122
122
|
defaultValue: 'Your email is not verified. Resend a verification email.',
|
|
@@ -32,5 +32,5 @@ export function FeedSettings() {
|
|
|
32
32
|
defaultValue: option === 'threaded' ? 'Threaded' : 'Linear',
|
|
33
33
|
}) })] }, option))) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null, _jsx(Button, { variant: "default", action: onSave, disabled: submitting, children: submitting
|
|
34
34
|
? t('common.saving', { defaultValue: 'Saving…' })
|
|
35
|
-
: t('common.save', { defaultValue: 'Save' }) })] }));
|
|
35
|
+
: t('common.actions.save', { defaultValue: 'Save' }) })] }));
|
|
36
36
|
}
|
|
@@ -15,5 +15,5 @@ export function LanguageSettings() {
|
|
|
15
15
|
defaultValue: 'Choose your preferred language.',
|
|
16
16
|
}) }), _jsx("div", { className: "mt-4 flex flex-wrap items-center gap-x-4 gap-y-2", children: AVAILABLE_UI_LANGUAGES.map((code) => (_jsxs("label", { className: "flex items-center gap-2", children: [_jsx("input", { type: "radio", className: "h-4 w-4", checked: language === code, onChange: () => setLanguage(code) }), _jsxs("span", { children: [LANGUAGE_LABELS[code], code === communityDefaultLanguage ? (_jsx("span", { className: "ml-1 text-sm opacity-60", children: t('settings.language.default', {
|
|
17
17
|
defaultValue: '(community default)',
|
|
18
|
-
}) })) : null] })] }, code))) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: clearStatus, children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: saving, children: t('common.
|
|
18
|
+
}) })) : null] })] }, code))) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: clearStatus, children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: saving, children: t('common.actions.save', { defaultValue: 'Save' }) })] }));
|
|
19
19
|
}
|
|
@@ -138,7 +138,7 @@ export function PublicProfileSettings() {
|
|
|
138
138
|
return { ...d, fields };
|
|
139
139
|
});
|
|
140
140
|
};
|
|
141
|
-
return (_jsxs("div", { className: "space-y-4 p-4", children: [_jsx(HeaderAvatarInput, { header: draft.header ?? undefined, avatar: draft.avatar ?? undefined, onHeaderChange: (header) => setDraft((d) => ({ ...d, header })), onAvatarChange: (avatar) => setDraft((d) => ({ ...d, avatar })) }), _jsxs("div", { className: "space-y-2 pt-4", children: [_jsx(Label, { htmlFor: "displayName", children: t('profile.form.displayName', { defaultValue: 'Display name' }) }), _jsx(Input, { id: "displayName", value: draft.displayName ?? '', onChange: (e) => setDraft((d) => ({ ...d, displayName: e.target.value })), "data-testid": "settings-display-name-input" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "handle", children: t('
|
|
141
|
+
return (_jsxs("div", { className: "space-y-4 p-4", children: [_jsx(HeaderAvatarInput, { header: draft.header ?? undefined, avatar: draft.avatar ?? undefined, onHeaderChange: (header) => setDraft((d) => ({ ...d, header })), onAvatarChange: (avatar) => setDraft((d) => ({ ...d, avatar })) }), _jsxs("div", { className: "space-y-2 pt-4", children: [_jsx(Label, { htmlFor: "displayName", children: t('profile.form.displayName', { defaultValue: 'Display name' }) }), _jsx(Input, { id: "displayName", value: draft.displayName ?? '', onChange: (e) => setDraft((d) => ({ ...d, displayName: e.target.value })), "data-testid": "settings-display-name-input" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "handle", children: t('common.labels.handle', { defaultValue: 'Handle' }) }), _jsx(Input, { id: "handle", value: draft.handle ?? '', maxLength: 16, "aria-invalid": Boolean(handleError), "aria-describedby": "handle-hint", onChange: (e) => {
|
|
142
142
|
const handle = e.target.value.replace(/^@/, '');
|
|
143
143
|
setDraft((d) => ({ ...d, handle }));
|
|
144
144
|
if (handleError)
|
|
@@ -150,7 +150,7 @@ export function PublicProfileSettings() {
|
|
|
150
150
|
: 'text-muted-foreground text-sm', "data-testid": "settings-handle-hint", children: handleError ??
|
|
151
151
|
t('profile.form.handleHint', {
|
|
152
152
|
defaultValue: '1–16 characters. Letters, numbers, underscores, and hyphens only — no spaces or punctuation.',
|
|
153
|
-
}) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "bio", children: t('profile.form.bio', { defaultValue: 'Bio' }) }), _jsx(Textarea, { id: "bio", rows: 4, value: draft.bio ?? '', onChange: (e) => setDraft((d) => ({ ...d, bio: e.target.value })), "data-testid": "settings-bio-input" })] }), _jsx(LocationInput, { title: t('profile.form.location', { defaultValue: 'Location' }), value: draft.location, onChange: (location) => setDraft((d) => ({ ...d, location })) }), additionalFieldDefs.map((field, index) => (_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: `field-${index}`, children: field.label }), _jsx(Input, { id: `field-${index}`, value: draft.fields?.[index]?.value ?? '', placeholder: field.label, onChange: (e) => patchField(index, e.target.value) })] }, field.label))), _jsx(Button, { title: t('common.save', { defaultValue: 'Save' }), variant: "default", action: submit, disabled: submitting, "data-testid": "settings-save-button", children: submitting
|
|
153
|
+
}) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "bio", children: t('profile.form.bio', { defaultValue: 'Bio' }) }), _jsx(Textarea, { id: "bio", rows: 4, value: draft.bio ?? '', onChange: (e) => setDraft((d) => ({ ...d, bio: e.target.value })), "data-testid": "settings-bio-input" })] }), _jsx(LocationInput, { title: t('profile.form.location', { defaultValue: 'Location' }), value: draft.location, onChange: (location) => setDraft((d) => ({ ...d, location })) }), additionalFieldDefs.map((field, index) => (_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: `field-${index}`, children: field.label }), _jsx(Input, { id: `field-${index}`, value: draft.fields?.[index]?.value ?? '', placeholder: field.label, onChange: (e) => patchField(index, e.target.value) })] }, field.label))), _jsx(Button, { title: t('common.actions.save', { defaultValue: 'Save' }), variant: "default", action: submit, disabled: submitting, "data-testid": "settings-save-button", children: submitting
|
|
154
154
|
? t('common.saving', { defaultValue: 'Saving…' })
|
|
155
|
-
: t('common.save', { defaultValue: 'Save' }) })] }));
|
|
155
|
+
: t('common.actions.save', { defaultValue: 'Save' }) })] }));
|
|
156
156
|
}
|
|
@@ -25,7 +25,7 @@ export function PushEnabledDevices() {
|
|
|
25
25
|
defaultValue: 'This device',
|
|
26
26
|
}) })) : null] }), _jsx("p", { className: "text-muted-foreground text-xs", children: subscription.type })] })] }), confirming ? (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { variant: "destructive", disabled: deletingId === subscription.id, action: () => remove(subscription), children: t('settings.notifications.pushEnabledDevices.delete.confirm', {
|
|
27
27
|
defaultValue: 'Delete',
|
|
28
|
-
}) }), _jsx(Button, { variant: "ghost", action: () => setConfirmId(null), children: t('
|
|
28
|
+
}) }), _jsx(Button, { variant: "ghost", action: () => setConfirmId(null), children: t('common.actions.cancel', {
|
|
29
29
|
defaultValue: 'Cancel',
|
|
30
30
|
}) })] })) : (_jsx("button", { type: "button", className: "text-muted-foreground hover:text-error p-2 transition-colors", title: t('common.actions.delete', {
|
|
31
31
|
defaultValue: 'Delete',
|
|
@@ -17,5 +17,5 @@ export function ThemeSettings() {
|
|
|
17
17
|
defaultValue: 'Choose how the application looks for you.',
|
|
18
18
|
}) }), _jsx("div", { className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-2", children: THEME_OPTIONS.map((option) => (_jsxs("label", { className: "inline-flex items-center gap-2", children: [_jsx("input", { type: "radio", className: "h-4 w-4", name: "theme", value: option, checked: theme === option, onChange: () => setTheme(option) }), _jsx("span", { children: t(`settings.theme.${option}.mode`, { defaultValue: option }) })] }, option))) })] }), _jsx(Button, { title: "Save", variant: "default", action: submit, disabled: submitting, children: submitting
|
|
19
19
|
? t('common.saving', { defaultValue: 'Saving…' })
|
|
20
|
-
: t('common.save', { defaultValue: 'Save' }) })] }));
|
|
20
|
+
: t('common.actions.save', { defaultValue: 'Save' }) })] }));
|
|
21
21
|
}
|
|
@@ -15,5 +15,5 @@ export function TimezoneSettings() {
|
|
|
15
15
|
? `${tz} ${t('settings.timezone.communityDefault', {
|
|
16
16
|
defaultValue: '(community default)',
|
|
17
17
|
})}`
|
|
18
|
-
: tz }) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: clearStatus, children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: saving, children: t('common.
|
|
18
|
+
: tz }) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: clearStatus, children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: saving, children: t('common.actions.save', { defaultValue: 'Save' }) })] }));
|
|
19
19
|
}
|
package/dist/react-native.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export { JamProvider, useJamContext, useJamObserver, } from './components/jams/J
|
|
|
49
49
|
export type { JamContextValue, JamProviderProps, } from './components/jams/JamContext';
|
|
50
50
|
export { JamEventsProvider, useJamEventsContext, useMaybeJamEventsContext, } from './components/jams/JamEventsContext';
|
|
51
51
|
export type { JamEventsContextValue } from './components/jams/JamEventsContext';
|
|
52
|
-
export { mentionProfilesFromParticipants, parseJamEventPayload, parseParticipantMetadata, sendAttendance, sendJamEvent, sendReaction, toggleHand, } from './components/jams/jamEventActions';
|
|
52
|
+
export { mentionProfilesFromParticipants, parseJamEventPayload, parseParticipantMetadata, participantTileProfile, 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
55
|
export { useDropLateAudio } from './components/jams/dropLateAudio';
|
package/dist/react-native.js
CHANGED
|
@@ -38,7 +38,7 @@ export { extractUrlsFromText, isValidUrl, } from './components/preview-link/help
|
|
|
38
38
|
// Jam logic that only depends on livekit-client (no @livekit/components-react).
|
|
39
39
|
export { JamProvider, useJamContext, useJamObserver, } from './components/jams/JamContext.js';
|
|
40
40
|
export { JamEventsProvider, useJamEventsContext, useMaybeJamEventsContext, } from './components/jams/JamEventsContext.js';
|
|
41
|
-
export { mentionProfilesFromParticipants, parseJamEventPayload, parseParticipantMetadata, sendAttendance, sendJamEvent, sendReaction, toggleHand, } from './components/jams/jamEventActions.js';
|
|
41
|
+
export { mentionProfilesFromParticipants, parseJamEventPayload, parseParticipantMetadata, participantTileProfile, sendAttendance, sendJamEvent, sendReaction, toggleHand, } from './components/jams/jamEventActions.js';
|
|
42
42
|
export { useRaisedHands } from './components/jams/useJamHands.js';
|
|
43
43
|
export { useDropLateAudio } from './components/jams/dropLateAudio.js';
|
|
44
44
|
export { calculateRecordingState, calculateRtmpStreamState, formatRecordingElapsed, useJamRecordingElapsed, useJamRecordingState, useJamRtmpStreamState, } from './components/jams/jamRecordingState.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpeepshq/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"@livekit/components-styles": "^1.1.6",
|
|
35
35
|
"@tanstack/react-query": "5.90.16",
|
|
36
36
|
"@videojs/react": "^10.0.0-beta.24",
|
|
37
|
-
"dompurify": "
|
|
37
|
+
"dompurify": "3.4.17",
|
|
38
38
|
"emoji-picker-element": "^1.29.1",
|
|
39
39
|
"heic2any": "^0.0.4",
|
|
40
40
|
"i18next": "^24.2.3",
|
|
41
|
-
"i18next-http-backend": "^3.0.
|
|
41
|
+
"i18next-http-backend": "^3.0.6",
|
|
42
42
|
"js-base64": "^3.7.7",
|
|
43
43
|
"livekit-client": "2.19.2",
|
|
44
44
|
"lucide-react": "^0.469.0",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"react-i18next": "^15.4.1",
|
|
52
52
|
"simple-icons": "^16.31.0",
|
|
53
53
|
"uuidv7": "^1.0.2",
|
|
54
|
+
"@openpeepshq/common": "^0.6.1",
|
|
54
55
|
"@openpeepshq/client": "^0.3.0",
|
|
55
56
|
"@openpeepshq/greenscreen": "^0.2.1",
|
|
56
|
-
"@openpeepshq/react-ui": "^0.
|
|
57
|
-
"@openpeepshq/common": "^0.6.0"
|
|
57
|
+
"@openpeepshq/react-ui": "^0.5.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"react": "^18.3.0 || ^19.0.0",
|
|
@@ -68,14 +68,14 @@
|
|
|
68
68
|
"@types/react-dom": "19.2.3",
|
|
69
69
|
"@typescript-eslint/eslint-plugin": "^8.72.0",
|
|
70
70
|
"@typescript-eslint/parser": "^8.72.0",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
71
|
+
"eslint": "^10.14.0",
|
|
72
|
+
"concurrently": "^9.2.5",
|
|
73
73
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
74
74
|
"jsdom": "^25.0.1",
|
|
75
|
-
"react-router-dom": "^7.
|
|
75
|
+
"react-router-dom": "^7.18.5",
|
|
76
76
|
"tsc-alias": "^1.8.10",
|
|
77
77
|
"typescript": "^6.0.2",
|
|
78
|
-
"vitest": "^
|
|
78
|
+
"vitest": "^4.1.12",
|
|
79
79
|
"eslint-config-prettier": "^9.1.0",
|
|
80
80
|
"@eslint/js": "^9.17.0",
|
|
81
81
|
"@openpeepshq/fetch-client": "^0.2.1"
|