@openpeepshq/react 0.9.23 → 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 +3 -3
- 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 +25 -16
- package/dist/contexts/openpeeps/hooks/admin.d.ts +2 -2
- package/dist/contexts/openpeeps/hooks/auth.d.ts +1 -1
- package/dist/contexts/openpeeps/hooks/other.d.ts +1 -0
- 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 +7 -3
- 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/community/useCommunityConfig.d.ts +2 -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 +19 -5
- 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 +30 -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
|
@@ -64,7 +64,7 @@ export function AdminConfigurationCommunityProfileFields() {
|
|
|
64
64
|
if (configQuery.isLoading) {
|
|
65
65
|
return (
|
|
66
66
|
<div className="text-muted-foreground flex h-32 items-center justify-center text-sm">
|
|
67
|
-
{t('common.
|
|
67
|
+
{t('common.states.loading', { defaultValue: 'Loading…' })}
|
|
68
68
|
</div>
|
|
69
69
|
);
|
|
70
70
|
}
|
|
@@ -93,10 +93,10 @@ export function AdminConfigurationCommunityProfileFields() {
|
|
|
93
93
|
<Button
|
|
94
94
|
variant="outline"
|
|
95
95
|
action={() => setFields((prev) => prev.slice(0, -1))}
|
|
96
|
-
title={t('common.
|
|
96
|
+
title={t('common.actions.remove')}
|
|
97
97
|
>
|
|
98
98
|
<MinusSquare className="mr-1 size-4" />
|
|
99
|
-
{t('common.
|
|
99
|
+
{t('common.actions.remove')}
|
|
100
100
|
</Button>
|
|
101
101
|
) : null}
|
|
102
102
|
<Button
|
|
@@ -110,9 +110,9 @@ export function AdminConfigurationCommunityProfileFields() {
|
|
|
110
110
|
<Button
|
|
111
111
|
variant="ghost"
|
|
112
112
|
action={handleSubmit}
|
|
113
|
-
title={t('common.
|
|
113
|
+
title={t('common.actions.save')}
|
|
114
114
|
>
|
|
115
|
-
{t('common.
|
|
115
|
+
{t('common.actions.save')}
|
|
116
116
|
</Button>
|
|
117
117
|
{status ? (
|
|
118
118
|
<Toast variant={status.type} onDismiss={() => setStatus(null)}>
|
|
@@ -82,9 +82,9 @@ function DefaultRoles({ base }: { base: CommunityConfig }) {
|
|
|
82
82
|
<Button
|
|
83
83
|
variant="default"
|
|
84
84
|
action={handleSubmit}
|
|
85
|
-
title={t('common.save', { defaultValue: 'Save' })}
|
|
85
|
+
title={t('common.actions.save', { defaultValue: 'Save' })}
|
|
86
86
|
>
|
|
87
|
-
{t('common.save', { defaultValue: 'Save' })}
|
|
87
|
+
{t('common.actions.save', { defaultValue: 'Save' })}
|
|
88
88
|
</Button>
|
|
89
89
|
<Button
|
|
90
90
|
variant="outline"
|
|
@@ -168,7 +168,7 @@ function NewRoleForm() {
|
|
|
168
168
|
<div className="flex flex-col gap-3 rounded-md border p-4">
|
|
169
169
|
<Label
|
|
170
170
|
htmlFor="new-role-name"
|
|
171
|
-
title={t('
|
|
171
|
+
title={t('common.labels.name', {
|
|
172
172
|
defaultValue: 'Name',
|
|
173
173
|
})}
|
|
174
174
|
required
|
|
@@ -177,7 +177,7 @@ function NewRoleForm() {
|
|
|
177
177
|
id="new-role-name"
|
|
178
178
|
value={name}
|
|
179
179
|
maxLength={32}
|
|
180
|
-
placeholder={t('
|
|
180
|
+
placeholder={t('common.labels.name', {
|
|
181
181
|
defaultValue: 'Name',
|
|
182
182
|
})}
|
|
183
183
|
onChange={(e) => {
|
|
@@ -194,7 +194,7 @@ function NewRoleForm() {
|
|
|
194
194
|
) : null}
|
|
195
195
|
<Label
|
|
196
196
|
htmlFor="new-role-description"
|
|
197
|
-
title={t('
|
|
197
|
+
title={t('common.labels.description', {
|
|
198
198
|
defaultValue: 'Description',
|
|
199
199
|
})}
|
|
200
200
|
>
|
|
@@ -209,7 +209,7 @@ function NewRoleForm() {
|
|
|
209
209
|
variant="default"
|
|
210
210
|
disabled={!key || creating}
|
|
211
211
|
action={handleCreate}
|
|
212
|
-
title={t('
|
|
212
|
+
title={t('common.actions.create', { defaultValue: 'Create' })}
|
|
213
213
|
loadingContent={t('capabilities.roles.creating', {
|
|
214
214
|
defaultValue: 'Creating…',
|
|
215
215
|
})}
|
|
@@ -218,10 +218,10 @@ function NewRoleForm() {
|
|
|
218
218
|
? t('capabilities.roles.creating', {
|
|
219
219
|
defaultValue: 'Creating…',
|
|
220
220
|
})
|
|
221
|
-
: t('
|
|
221
|
+
: t('common.actions.create', { defaultValue: 'Create' })}
|
|
222
222
|
</Button>
|
|
223
223
|
<Button variant="outline" action={handleCancel}>
|
|
224
|
-
{t('common.cancel', { defaultValue: 'Cancel' })}
|
|
224
|
+
{t('common.actions.cancel', { defaultValue: 'Cancel' })}
|
|
225
225
|
</Button>
|
|
226
226
|
</div>
|
|
227
227
|
</div>
|
|
@@ -269,7 +269,7 @@ export function AdminConfigurationCommunityRoles() {
|
|
|
269
269
|
if (loading) {
|
|
270
270
|
return (
|
|
271
271
|
<div className="text-muted-foreground flex h-32 items-center justify-center text-sm">
|
|
272
|
-
{t('common.
|
|
272
|
+
{t('common.states.loading', { defaultValue: 'Loading…' })}
|
|
273
273
|
</div>
|
|
274
274
|
);
|
|
275
275
|
}
|
|
@@ -3,6 +3,7 @@ import type { CommunityConfig } from '@openpeepshq/common/types';
|
|
|
3
3
|
import { useT, useSetPageHeader, useOpenpeeps, equal } from '../../../index';
|
|
4
4
|
import { Button, ThemeFontSelect, Toast } from '@openpeepshq/react-ui';
|
|
5
5
|
import { useCommunityConfig } from './useCommunityConfig';
|
|
6
|
+
import { ThemeColorPreview } from './ThemeColorPreview';
|
|
6
7
|
|
|
7
8
|
type Mode = 'light' | 'dark';
|
|
8
9
|
|
|
@@ -51,7 +52,7 @@ export function AdminConfigurationCommunityTheme() {
|
|
|
51
52
|
if (isLoading || !cfg) {
|
|
52
53
|
return (
|
|
53
54
|
<div className="text-muted-foreground flex h-32 items-center justify-center text-sm">
|
|
54
|
-
{t('common.
|
|
55
|
+
{t('common.states.loading', { defaultValue: 'Loading…' })}
|
|
55
56
|
</div>
|
|
56
57
|
);
|
|
57
58
|
}
|
|
@@ -117,29 +118,31 @@ export function AdminConfigurationCommunityTheme() {
|
|
|
117
118
|
{t('configuration.community.color')}
|
|
118
119
|
</h4>
|
|
119
120
|
<span>{t('configuration.community.colorDescription')}</span>
|
|
120
|
-
<div className="mt-
|
|
121
|
+
<div className="mt-4 grid gap-6 lg:grid-cols-2">
|
|
121
122
|
{(['light', 'dark'] as Mode[]).map((mode) => (
|
|
122
|
-
<div
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
123
|
+
<div key={mode} className="flex flex-col gap-3">
|
|
124
|
+
<div className="flex flex-wrap items-center gap-x-4 gap-y-2">
|
|
125
|
+
<span>{t(`configuration.community.${mode}Theme.color`)}</span>
|
|
126
|
+
<input
|
|
127
|
+
className="border-border !size-8 !rounded-full border [&::-moz-color-swatch]:!m-0 [&::-moz-color-swatch]:!rounded-full [&::-moz-color-swatch]:!border-0 [&::-webkit-color-swatch-wrapper]:!p-0 [&::-webkit-color-swatch]:!rounded-full [&::-webkit-color-swatch]:!border-0"
|
|
128
|
+
type="color"
|
|
129
|
+
value={cfg.theme[mode].primaryHex}
|
|
130
|
+
onChange={(e) =>
|
|
131
|
+
patch((c) => (c.theme[mode].primaryHex = e.target.value))
|
|
132
|
+
}
|
|
133
|
+
/>
|
|
134
|
+
<input
|
|
135
|
+
className="op-input w-32"
|
|
136
|
+
type="text"
|
|
137
|
+
value={cfg.theme[mode].primaryHex}
|
|
138
|
+
readOnly
|
|
139
|
+
tabIndex={-1}
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
<ThemeColorPreview
|
|
143
|
+
mode={mode}
|
|
144
|
+
primaryHex={cfg.theme[mode].primaryHex}
|
|
145
|
+
buttonRadius={cfg.theme[mode].buttonRadius}
|
|
143
146
|
/>
|
|
144
147
|
</div>
|
|
145
148
|
))}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import { Bell, Home, Newspaper } from 'lucide-react';
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
contrastRatio,
|
|
6
|
+
generateA11yOnColor,
|
|
7
|
+
hexToTailwindRgbString,
|
|
8
|
+
themeBackgroundHex,
|
|
9
|
+
} from '@openpeepshq/react-ui';
|
|
10
|
+
import { useT } from '../../../i18n';
|
|
11
|
+
|
|
12
|
+
type Mode = 'light' | 'dark';
|
|
13
|
+
|
|
14
|
+
type ThemeStyle = CSSProperties & Record<`--${string}`, string>;
|
|
15
|
+
|
|
16
|
+
// 3:1 is the WCAG 1.4.11 floor for icons and controls against the page
|
|
17
|
+
// background (text needs 4.5:1, so the warning only covers non-text uses).
|
|
18
|
+
const MIN_CONTRAST = 3;
|
|
19
|
+
|
|
20
|
+
// Keeps a sentence translatable as one string: the translator places the
|
|
21
|
+
// token where the link belongs, and we splice the styled link in around it.
|
|
22
|
+
const LINK_TOKEN = '{{link}}';
|
|
23
|
+
|
|
24
|
+
const splitAroundLink = (sentence: string) => {
|
|
25
|
+
const i = sentence.indexOf(LINK_TOKEN);
|
|
26
|
+
return i < 0
|
|
27
|
+
? { before: sentence, after: '' }
|
|
28
|
+
: {
|
|
29
|
+
before: sentence.slice(0, i),
|
|
30
|
+
after: sentence.slice(i + LINK_TOKEN.length),
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const themeName = {
|
|
35
|
+
light: 'OpenpeepsLight',
|
|
36
|
+
dark: 'OpenpeepsDark',
|
|
37
|
+
} as const;
|
|
38
|
+
|
|
39
|
+
export type ThemeColorPreviewProps = {
|
|
40
|
+
mode: Mode;
|
|
41
|
+
primaryHex: string;
|
|
42
|
+
buttonRadius?: string;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const ThemeColorPreview = ({
|
|
46
|
+
mode,
|
|
47
|
+
primaryHex,
|
|
48
|
+
buttonRadius,
|
|
49
|
+
}: ThemeColorPreviewProps) => {
|
|
50
|
+
const t = useT();
|
|
51
|
+
const ratio = contrastRatio(primaryHex, themeBackgroundHex[mode]);
|
|
52
|
+
const channels = hexToTailwindRgbString(primaryHex);
|
|
53
|
+
const valid = channels !== '(invalid)';
|
|
54
|
+
const { before: articleBefore, after: articleAfter } = splitAroundLink(
|
|
55
|
+
t('configuration.community.preview.articleText', { link: LINK_TOKEN }),
|
|
56
|
+
);
|
|
57
|
+
const style: ThemeStyle | undefined = valid
|
|
58
|
+
? {
|
|
59
|
+
'--color-primary': channels,
|
|
60
|
+
'--color-primary-foreground': generateA11yOnColor(
|
|
61
|
+
primaryHex.startsWith('#') ? primaryHex : `#${primaryHex}`,
|
|
62
|
+
),
|
|
63
|
+
'--theme-rounded-base': buttonRadius?.trim() || '9999px',
|
|
64
|
+
}
|
|
65
|
+
: undefined;
|
|
66
|
+
|
|
67
|
+
const linkKeys = [
|
|
68
|
+
'configuration.community.preview.linkGuidelines',
|
|
69
|
+
'configuration.community.preview.linkEvents',
|
|
70
|
+
'configuration.community.preview.linkMembers',
|
|
71
|
+
] as const;
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<div className="flex flex-col gap-2">
|
|
75
|
+
{ratio !== null && ratio < MIN_CONTRAST ? (
|
|
76
|
+
<p className="text-destructive text-sm" role="status">
|
|
77
|
+
{t('configuration.community.contrastPoor', {
|
|
78
|
+
mode: t(`configuration.community.${mode}Theme.mode`),
|
|
79
|
+
ratio: ratio.toFixed(1),
|
|
80
|
+
})}
|
|
81
|
+
</p>
|
|
82
|
+
) : null}
|
|
83
|
+
<div
|
|
84
|
+
aria-hidden="true"
|
|
85
|
+
data-theme={themeName[mode]}
|
|
86
|
+
style={style}
|
|
87
|
+
className="pointer-events-none bg-background text-foreground overflow-hidden rounded-lg border"
|
|
88
|
+
>
|
|
89
|
+
<div className="grid">
|
|
90
|
+
<div className="border-b p-3">
|
|
91
|
+
<p className="text-muted-foreground mb-2 text-xs font-medium">
|
|
92
|
+
{t('configuration.community.preview.navigation')}
|
|
93
|
+
</p>
|
|
94
|
+
<div className="text-foreground/70 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm">
|
|
95
|
+
<Home className="size-4" />
|
|
96
|
+
{t('configuration.community.preview.home')}
|
|
97
|
+
</div>
|
|
98
|
+
<div className="text-primary flex items-center gap-2 rounded-md px-2 py-1.5 text-sm font-bold">
|
|
99
|
+
<Newspaper className="size-4" />
|
|
100
|
+
{t('configuration.community.preview.feed')}
|
|
101
|
+
</div>
|
|
102
|
+
<div className="text-foreground/70 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm">
|
|
103
|
+
<Bell className="size-4" />
|
|
104
|
+
{t('configuration.community.preview.notifications')}
|
|
105
|
+
</div>
|
|
106
|
+
<Button className="mt-3" size="sm" variant="default" tabIndex={-1}>
|
|
107
|
+
{t('configuration.community.preview.join')}
|
|
108
|
+
</Button>
|
|
109
|
+
</div>
|
|
110
|
+
<div className="p-3">
|
|
111
|
+
<p className="text-muted-foreground mb-2 text-xs font-medium">
|
|
112
|
+
{t('configuration.community.preview.article')}
|
|
113
|
+
</p>
|
|
114
|
+
<p className="text-sm font-semibold">
|
|
115
|
+
{t('configuration.community.preview.articleTitle')}
|
|
116
|
+
</p>
|
|
117
|
+
<p className="mt-1 text-sm">
|
|
118
|
+
{articleBefore}
|
|
119
|
+
<span className="text-primary underline">
|
|
120
|
+
{t('configuration.community.preview.articleLink')}
|
|
121
|
+
</span>
|
|
122
|
+
{articleAfter}
|
|
123
|
+
</p>
|
|
124
|
+
<p className="text-muted-foreground mb-1 mt-3 text-xs font-medium">
|
|
125
|
+
{t('configuration.community.preview.links')}
|
|
126
|
+
</p>
|
|
127
|
+
<ul className="space-y-1">
|
|
128
|
+
{linkKeys.map((key) => (
|
|
129
|
+
<li key={key}>
|
|
130
|
+
<span className="text-primary text-sm underline">
|
|
131
|
+
{t(key)}
|
|
132
|
+
</span>
|
|
133
|
+
</li>
|
|
134
|
+
))}
|
|
135
|
+
</ul>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
};
|
|
@@ -81,11 +81,11 @@ export function AdminGroupCard({ group, onDelete }: AdminGroupCardProps) {
|
|
|
81
81
|
{formatDate(group.lastPostAt)}
|
|
82
82
|
</p>
|
|
83
83
|
<p>
|
|
84
|
-
{t('
|
|
84
|
+
{t('common.entities.members', { defaultValue: 'Members' })}:{' '}
|
|
85
85
|
{group.membersCount}
|
|
86
86
|
</p>
|
|
87
87
|
<p>
|
|
88
|
-
{t('
|
|
88
|
+
{t('common.entities.posts', { defaultValue: 'Posts' })}:{' '}
|
|
89
89
|
{group.postsCount}
|
|
90
90
|
</p>
|
|
91
91
|
<p className="sm:col-span-2">
|
|
@@ -251,9 +251,9 @@ export const EditInviteLinkModal = ({
|
|
|
251
251
|
) : null}
|
|
252
252
|
</div>
|
|
253
253
|
<DialogActions
|
|
254
|
-
cancelLabel={t('common.cancel', { defaultValue: 'Cancel' })}
|
|
254
|
+
cancelLabel={t('common.actions.cancel', { defaultValue: 'Cancel' })}
|
|
255
255
|
onCancel={onClose}
|
|
256
|
-
actionLabel={t('common.save', { defaultValue: 'Save' })}
|
|
256
|
+
actionLabel={t('common.actions.save', { defaultValue: 'Save' })}
|
|
257
257
|
onAction={submit}
|
|
258
258
|
disabled={submitting}
|
|
259
259
|
/>
|
|
@@ -180,7 +180,7 @@ export function InviteWithEmailModal({ onClose }: { onClose: () => void }) {
|
|
|
180
180
|
})}
|
|
181
181
|
</option>
|
|
182
182
|
<option value="P100Y">
|
|
183
|
-
{t('
|
|
183
|
+
{t('common.states.never', {
|
|
184
184
|
defaultValue: 'Never',
|
|
185
185
|
})}
|
|
186
186
|
</option>
|
|
@@ -201,7 +201,7 @@ export function InviteWithEmailModal({ onClose }: { onClose: () => void }) {
|
|
|
201
201
|
/>
|
|
202
202
|
) : (
|
|
203
203
|
<DialogActions
|
|
204
|
-
cancelLabel={t('common.cancel', { defaultValue: 'Cancel' })}
|
|
204
|
+
cancelLabel={t('common.actions.cancel', { defaultValue: 'Cancel' })}
|
|
205
205
|
onCancel={onClose}
|
|
206
206
|
actionLabel={t('admin.inviteEmail.sendInvite', {
|
|
207
207
|
defaultValue: 'Send Invite',
|
|
@@ -190,7 +190,7 @@ export function InviteWithLinkModal({ onClose }: { onClose: () => void }) {
|
|
|
190
190
|
</p>
|
|
191
191
|
<div className="space-y-2">
|
|
192
192
|
<Label htmlFor="invite-slug">
|
|
193
|
-
{t('
|
|
193
|
+
{t('common.labels.link', { defaultValue: 'Link' })}
|
|
194
194
|
</Label>
|
|
195
195
|
<Input
|
|
196
196
|
id="invite-slug"
|
|
@@ -252,7 +252,7 @@ export function InviteWithLinkModal({ onClose }: { onClose: () => void }) {
|
|
|
252
252
|
})}
|
|
253
253
|
</option>
|
|
254
254
|
<option value="P100Y">
|
|
255
|
-
{t('
|
|
255
|
+
{t('common.states.never', { defaultValue: 'Never' })}
|
|
256
256
|
</option>
|
|
257
257
|
</select>
|
|
258
258
|
</div>
|
|
@@ -305,7 +305,7 @@ export function InviteWithLinkModal({ onClose }: { onClose: () => void }) {
|
|
|
305
305
|
/>
|
|
306
306
|
) : (
|
|
307
307
|
<DialogActions
|
|
308
|
-
cancelLabel={t('common.cancel', { defaultValue: 'Cancel' })}
|
|
308
|
+
cancelLabel={t('common.actions.cancel', { defaultValue: 'Cancel' })}
|
|
309
309
|
onCancel={onClose}
|
|
310
310
|
actionLabel={t('admin.inviteLink.generateButton', {
|
|
311
311
|
defaultValue: 'Create Link',
|
|
@@ -81,7 +81,7 @@ export function ProfileRowActions({ profile }: ProfileRowActionsProps) {
|
|
|
81
81
|
title={t('profile.table.deleteMember', {
|
|
82
82
|
defaultValue: 'Delete Member',
|
|
83
83
|
})}
|
|
84
|
-
text={t('
|
|
84
|
+
text={t('common.actions.delete', { defaultValue: 'Delete' })}
|
|
85
85
|
action={() => setActiveModal('delete')}
|
|
86
86
|
danger
|
|
87
87
|
/>
|
|
@@ -158,7 +158,7 @@ function EditEmailModal({
|
|
|
158
158
|
</DialogHeader>
|
|
159
159
|
<div className="space-y-2 px-1">
|
|
160
160
|
<Label htmlFor="edit-email-input">
|
|
161
|
-
{t('
|
|
161
|
+
{t('common.labels.email', { defaultValue: 'Email' })}
|
|
162
162
|
</Label>
|
|
163
163
|
<Input
|
|
164
164
|
id="edit-email-input"
|
|
@@ -173,7 +173,7 @@ function EditEmailModal({
|
|
|
173
173
|
</p>
|
|
174
174
|
) : null}
|
|
175
175
|
<DialogActions
|
|
176
|
-
cancelLabel={t('common.cancel', { defaultValue: 'Cancel' })}
|
|
176
|
+
cancelLabel={t('common.actions.cancel', { defaultValue: 'Cancel' })}
|
|
177
177
|
onCancel={onClose}
|
|
178
178
|
actionLabel={t('accounts.editEmail.saveChanges', {
|
|
179
179
|
defaultValue: 'Update Email',
|
|
@@ -280,7 +280,7 @@ function EditRolesModal({
|
|
|
280
280
|
</p>
|
|
281
281
|
) : null}
|
|
282
282
|
<DialogActions
|
|
283
|
-
cancelLabel={t('common.cancel', { defaultValue: 'Cancel' })}
|
|
283
|
+
cancelLabel={t('common.actions.cancel', { defaultValue: 'Cancel' })}
|
|
284
284
|
onCancel={onClose}
|
|
285
285
|
actionLabel={t('profile.modals.editProfile.saveChanges', {
|
|
286
286
|
defaultValue: 'Save Changes',
|
|
@@ -350,9 +350,9 @@ function DeleteProfileModal({
|
|
|
350
350
|
</p>
|
|
351
351
|
) : null}
|
|
352
352
|
<DialogActions
|
|
353
|
-
cancelLabel={t('common.cancel', { defaultValue: 'Cancel' })}
|
|
353
|
+
cancelLabel={t('common.actions.cancel', { defaultValue: 'Cancel' })}
|
|
354
354
|
onCancel={onClose}
|
|
355
|
-
actionLabel={t('
|
|
355
|
+
actionLabel={t('common.actions.delete', {
|
|
356
356
|
defaultValue: 'Delete',
|
|
357
357
|
})}
|
|
358
358
|
onAction={submit}
|
|
@@ -63,11 +63,11 @@ export function RestoreBackupModal({ onClose }: RestoreBackupModalProps) {
|
|
|
63
63
|
</p>
|
|
64
64
|
) : null}
|
|
65
65
|
<DialogActions
|
|
66
|
-
cancelLabel={t('
|
|
66
|
+
cancelLabel={t('common.actions.cancel', {
|
|
67
67
|
defaultValue: 'Cancel',
|
|
68
68
|
})}
|
|
69
69
|
onCancel={onClose}
|
|
70
|
-
actionLabel={t('
|
|
70
|
+
actionLabel={t('common.actions.confirm', {
|
|
71
71
|
defaultValue: 'Confirm',
|
|
72
72
|
})}
|
|
73
73
|
onAction={submit}
|
package/src/pages/auth/Login.tsx
CHANGED
|
@@ -203,7 +203,7 @@ export function Register({ invite = false }: RegisterProps) {
|
|
|
203
203
|
render={({ field }) => (
|
|
204
204
|
<FormItem>
|
|
205
205
|
<FormLabel>
|
|
206
|
-
{t('
|
|
206
|
+
{t('common.labels.handle', { defaultValue: 'Handle' })}
|
|
207
207
|
</FormLabel>
|
|
208
208
|
<FormControl>
|
|
209
209
|
<Input
|
|
@@ -226,7 +226,7 @@ export function Register({ invite = false }: RegisterProps) {
|
|
|
226
226
|
render={({ field }) => (
|
|
227
227
|
<FormItem>
|
|
228
228
|
<FormLabel>
|
|
229
|
-
{t('
|
|
229
|
+
{t('common.labels.name', { defaultValue: 'Name' })}
|
|
230
230
|
</FormLabel>
|
|
231
231
|
<FormControl>
|
|
232
232
|
<Input
|
|
@@ -249,7 +249,7 @@ export function Register({ invite = false }: RegisterProps) {
|
|
|
249
249
|
render={({ field }) => (
|
|
250
250
|
<FormItem>
|
|
251
251
|
<FormLabel>
|
|
252
|
-
{t('
|
|
252
|
+
{t('common.labels.email', { defaultValue: 'Email' })}
|
|
253
253
|
</FormLabel>
|
|
254
254
|
<FormControl>
|
|
255
255
|
<Input
|
|
@@ -143,7 +143,7 @@ export function ConversationInfo() {
|
|
|
143
143
|
</p>
|
|
144
144
|
) : null}
|
|
145
145
|
<DialogActions
|
|
146
|
-
cancelLabel={t('common.cancel', { defaultValue: 'Cancel' })}
|
|
146
|
+
cancelLabel={t('common.actions.cancel', { defaultValue: 'Cancel' })}
|
|
147
147
|
onCancel={() => setConfirmOpen(false)}
|
|
148
148
|
actionLabel={t('conversations.leaveConversation.leave', {
|
|
149
149
|
defaultValue: 'Leave',
|