@meith/web 0.16.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/LICENSE.md +165 -0
- package/app/(auth)/layout.tsx +6 -0
- package/app/(auth)/login/page.tsx +106 -0
- package/app/(auth)/login/verify/page.tsx +55 -0
- package/app/(auth)/register/page.tsx +83 -0
- package/app/(auth)/reset/confirm/page.tsx +45 -0
- package/app/(auth)/reset/page.tsx +22 -0
- package/app/(auth)/verify/page.tsx +44 -0
- package/app/(auth)/verify/resend/page.tsx +51 -0
- package/app/(board)/[slug]/feed.xml/route.ts +48 -0
- package/app/(board)/[slug]/new/page.tsx +112 -0
- package/app/(board)/[slug]/page.tsx +403 -0
- package/app/(board)/discover/[view]/page.tsx +115 -0
- package/app/(board)/discover/page.tsx +5 -0
- package/app/(board)/layout.tsx +22 -0
- package/app/(board)/member/[id]/page.tsx +187 -0
- package/app/(board)/member/[id]/reputation/page.tsx +195 -0
- package/app/(board)/member/by-name/[name]/page.tsx +32 -0
- package/app/(board)/messages/[id]/page.tsx +103 -0
- package/app/(board)/messages/compose/page.tsx +60 -0
- package/app/(board)/messages/layout.tsx +5 -0
- package/app/(board)/messages/page.tsx +179 -0
- package/app/(board)/modcp/forums/page.tsx +59 -0
- package/app/(board)/modcp/ip/page.tsx +158 -0
- package/app/(board)/modcp/layout.tsx +5 -0
- package/app/(board)/modcp/log/page.tsx +98 -0
- package/app/(board)/modcp/page.tsx +112 -0
- package/app/(board)/moderation/layout.tsx +5 -0
- package/app/(board)/moderation/page.tsx +111 -0
- package/app/(board)/moderation/reports/page.tsx +193 -0
- package/app/(board)/moderation/warn/page.tsx +158 -0
- package/app/(board)/notifications/layout.tsx +5 -0
- package/app/(board)/notifications/page.tsx +144 -0
- package/app/(board)/notifications/preferences/page.tsx +65 -0
- package/app/(board)/online/page.tsx +119 -0
- package/app/(board)/page.tsx +195 -0
- package/app/(board)/plugins/[key]/[[...path]]/page.tsx +72 -0
- package/app/(board)/privacy/page.tsx +12 -0
- package/app/(board)/report/page.tsx +71 -0
- package/app/(board)/rules/page.tsx +12 -0
- package/app/(board)/search/[token]/page.tsx +130 -0
- package/app/(board)/search/page.tsx +289 -0
- package/app/(board)/stats/page.tsx +202 -0
- package/app/(board)/subscriptions/layout.tsx +5 -0
- package/app/(board)/subscriptions/page.tsx +142 -0
- package/app/(board)/terms/page.tsx +12 -0
- package/app/(board)/thread/[slug]/edit/page.tsx +107 -0
- package/app/(board)/thread/[slug]/feed.xml/route.ts +42 -0
- package/app/(board)/thread/[slug]/page.tsx +707 -0
- package/app/(board)/thread/[slug]/poll/page.tsx +41 -0
- package/app/(board)/thread/[slug]/post/[postId]/history/page.tsx +160 -0
- package/app/(board)/thread/[slug]/reply/page.tsx +136 -0
- package/app/(board)/unsubscribe/page.tsx +73 -0
- package/app/(board)/usercp/avatar/page.tsx +56 -0
- package/app/(board)/usercp/contacts/page.tsx +141 -0
- package/app/(board)/usercp/email/confirm/page.tsx +52 -0
- package/app/(board)/usercp/layout.tsx +23 -0
- package/app/(board)/usercp/options/page.tsx +56 -0
- package/app/(board)/usercp/page.tsx +71 -0
- package/app/(board)/usercp/profile/page.tsx +81 -0
- package/app/(board)/usercp/security/page.tsx +238 -0
- package/app/(board)/usercp/security/verify/page.tsx +92 -0
- package/app/(board)/usercp/signature/page.tsx +67 -0
- package/app/admin/antispam/page.tsx +155 -0
- package/app/admin/api/marketplace/screenshot/route.ts +68 -0
- package/app/admin/api/plugins/[key]/[...path]/route.ts +27 -0
- package/app/admin/api-tokens/page.tsx +129 -0
- package/app/admin/content/announcements/page.tsx +110 -0
- package/app/admin/content/attachments/page.tsx +199 -0
- package/app/admin/content/navigation/page.tsx +123 -0
- package/app/admin/content/page.tsx +170 -0
- package/app/admin/forums/[id]/page.tsx +96 -0
- package/app/admin/forums/[id]/permissions/page.tsx +108 -0
- package/app/admin/forums/page.tsx +45 -0
- package/app/admin/groups/[id]/page.tsx +133 -0
- package/app/admin/groups/memberships/page.tsx +56 -0
- package/app/admin/groups/page.tsx +104 -0
- package/app/admin/groups/promotions/page.tsx +143 -0
- package/app/admin/layout.tsx +86 -0
- package/app/admin/log/page.tsx +116 -0
- package/app/admin/page.tsx +206 -0
- package/app/admin/plugins/[key]/[[...path]]/page.tsx +276 -0
- package/app/admin/plugins/browse/page.tsx +70 -0
- package/app/admin/plugins/page.tsx +165 -0
- package/app/admin/security/page.tsx +124 -0
- package/app/admin/settings/page.tsx +190 -0
- package/app/admin/system/page.tsx +303 -0
- package/app/admin/themes/[key]/page.tsx +110 -0
- package/app/admin/themes/browse/page.tsx +70 -0
- package/app/admin/themes/page.tsx +163 -0
- package/app/admin/users/[id]/merge/page.tsx +136 -0
- package/app/admin/users/[id]/page.tsx +208 -0
- package/app/admin/users/mail/page.tsx +68 -0
- package/app/admin/users/page.tsx +260 -0
- package/app/admin/users/prune/page.tsx +186 -0
- package/app/api/health/route.ts +11 -0
- package/app/api/metrics/route.ts +66 -0
- package/app/api/plugins/[key]/[...path]/route.ts +27 -0
- package/app/api/read/all/route.ts +15 -0
- package/app/api/read/forum/[id]/route.ts +29 -0
- package/app/api/read/thread/[id]/route.ts +40 -0
- package/app/api/ready/route.ts +63 -0
- package/app/api/system/tick/route.ts +77 -0
- package/app/api/v1/[...path]/route.ts +208 -0
- package/app/api/v1/openapi.json/route.ts +12 -0
- package/app/apple-icon.ts +11 -0
- package/app/atom.xml/route.ts +7 -0
- package/app/attachment/[id]/route.ts +10 -0
- package/app/attachment/[id]/thumb/route.ts +10 -0
- package/app/auth/passkey/options/route.ts +145 -0
- package/app/auth/passkey/verify/route.ts +241 -0
- package/app/auth/resume/route.ts +55 -0
- package/app/auth/sso/[provider]/callback/route.ts +173 -0
- package/app/auth/sso/[provider]/go/route.ts +57 -0
- package/app/auth/sso/[provider]/route.ts +105 -0
- package/app/avatar/[id]/route.ts +31 -0
- package/app/brand/icon-192.png/route.ts +7 -0
- package/app/brand/icon-512.png/route.ts +7 -0
- package/app/brand/icon-maskable.png/route.ts +7 -0
- package/app/demo/stripe/[[...path]]/route.ts +27 -0
- package/app/error.tsx +15 -0
- package/app/feed.xml/route.ts +7 -0
- package/app/forumdisplay.php/page.tsx +11 -0
- package/app/group/[id]/badge/[scheme]/route.ts +26 -0
- package/app/icon.ts +13 -0
- package/app/install/page.tsx +221 -0
- package/app/jump/page.tsx +28 -0
- package/app/layout.tsx +124 -0
- package/app/logo/[scheme]/route.ts +24 -0
- package/app/manifest.ts +43 -0
- package/app/member.php/page.tsx +11 -0
- package/app/memberlist.php/page.tsx +11 -0
- package/app/not-found.tsx +14 -0
- package/app/opengraph-image.ts +11 -0
- package/app/redirect/page.tsx +44 -0
- package/app/robots.txt/route.ts +35 -0
- package/app/showthread.php/page.tsx +11 -0
- package/app/sitemap/[page]/route.ts +64 -0
- package/app/sitemap.xml/route.ts +31 -0
- package/app/twitter-image.ts +11 -0
- package/app/viewforum.php/page.tsx +11 -0
- package/app/viewtopic.php/page.tsx +11 -0
- package/bin/forum-web.mjs +241 -0
- package/components.json +21 -0
- package/instrumentation.ts +18 -0
- package/next.config.mjs +182 -0
- package/package.json +99 -0
- package/postcss.config.mjs +7 -0
- package/proxy.ts +160 -0
- package/src/components/account/active-sessions.tsx +87 -0
- package/src/components/account/avatar-form.tsx +119 -0
- package/src/components/account/credential-proof-form.tsx +76 -0
- package/src/components/account/logout-form.tsx +14 -0
- package/src/components/account/notification-forms.tsx +157 -0
- package/src/components/account/passkey-enrol.tsx +81 -0
- package/src/components/account/passkey-proof-button.tsx +47 -0
- package/src/components/account/push-device-form.tsx +193 -0
- package/src/components/account/relation-forms.tsx +69 -0
- package/src/components/account/reputation-forms.tsx +124 -0
- package/src/components/account/security-activity.tsx +46 -0
- package/src/components/account/sign-in-methods.tsx +166 -0
- package/src/components/account/subscription-forms.tsx +151 -0
- package/src/components/account/two-factor-forms.tsx +226 -0
- package/src/components/account/usercp-forms.tsx +387 -0
- package/src/components/account/usercp-nav.tsx +14 -0
- package/src/components/account/usercp-shell.tsx +34 -0
- package/src/components/admin/admin-forms.tsx +92 -0
- package/src/components/admin/admin-nav.tsx +52 -0
- package/src/components/admin/admin-undo.tsx +32 -0
- package/src/components/admin/api-token-forms.tsx +89 -0
- package/src/components/admin/badge-forms.tsx +97 -0
- package/src/components/admin/branding-forms.tsx +102 -0
- package/src/components/admin/content-forms.tsx +712 -0
- package/src/components/admin/form-bits.tsx +11 -0
- package/src/components/admin/forum-forms.tsx +524 -0
- package/src/components/admin/forum-tree.tsx +454 -0
- package/src/components/admin/group-forms.tsx +646 -0
- package/src/components/admin/mail-test-card.tsx +90 -0
- package/src/components/admin/marketplace-forms.tsx +30 -0
- package/src/components/admin/marketplace-listing.tsx +123 -0
- package/src/components/admin/navigation-forms.tsx +229 -0
- package/src/components/admin/navigation-tree.tsx +442 -0
- package/src/components/admin/oklch-picker.tsx +180 -0
- package/src/components/admin/plugin-forms.tsx +225 -0
- package/src/components/admin/settings-form.tsx +148 -0
- package/src/components/admin/system-forms.tsx +169 -0
- package/src/components/admin/theme-changes.tsx +354 -0
- package/src/components/admin/theme-forms.tsx +636 -0
- package/src/components/admin/theme-palette.tsx +119 -0
- package/src/components/admin/theme-preview.tsx +461 -0
- package/src/components/admin/user-bulk-toolbar.tsx +99 -0
- package/src/components/admin/user-forms.tsx +488 -0
- package/src/components/auth/auth-page.tsx +45 -0
- package/src/components/auth/form-controls.tsx +117 -0
- package/src/components/auth/login-form.tsx +47 -0
- package/src/components/auth/passkey-client.ts +171 -0
- package/src/components/auth/passkey-second-factor.tsx +69 -0
- package/src/components/auth/passkey-sign-in.tsx +61 -0
- package/src/components/auth/register-form.tsx +136 -0
- package/src/components/auth/resend-verification-form.tsx +34 -0
- package/src/components/auth/reset-confirm-form.tsx +43 -0
- package/src/components/auth/reset-request-form.tsx +35 -0
- package/src/components/auth/second-factor-form.tsx +51 -0
- package/src/components/auth/sso-buttons.tsx +47 -0
- package/src/components/board/live-region.tsx +74 -0
- package/src/components/board/search-off-notice.tsx +18 -0
- package/src/components/board/section-page.tsx +114 -0
- package/src/components/content/attachment-field.tsx +51 -0
- package/src/components/content/composer-field.ts +31 -0
- package/src/components/content/composer-ids.ts +6 -0
- package/src/components/content/composer-intents.tsx +27 -0
- package/src/components/content/composer-recovery.tsx +215 -0
- package/src/components/content/edit-post-form.tsx +121 -0
- package/src/components/content/markdown-editor.tsx +590 -0
- package/src/components/content/markdown-syntax.ts +53 -0
- package/src/components/content/mention-token.ts +23 -0
- package/src/components/content/multiquote-button.tsx +32 -0
- package/src/components/content/multiquote-selection.tsx +105 -0
- package/src/components/content/multiquote.ts +125 -0
- package/src/components/content/new-thread-form.tsx +169 -0
- package/src/components/content/poll-edit-form.tsx +96 -0
- package/src/components/content/poll.tsx +89 -0
- package/src/components/content/quote-in-place.tsx +51 -0
- package/src/components/content/reply-form.tsx +113 -0
- package/src/components/content/thanks-button.tsx +65 -0
- package/src/components/content/thread-rating.tsx +143 -0
- package/src/components/install/install-form.tsx +497 -0
- package/src/components/legal/legal-document.tsx +22 -0
- package/src/components/messages/message-forms.tsx +152 -0
- package/src/components/moderation/inline-moderation-form.tsx +158 -0
- package/src/components/moderation/modcp-nav.tsx +15 -0
- package/src/components/moderation/modcp-shell.tsx +41 -0
- package/src/components/moderation/queue-form.tsx +96 -0
- package/src/components/moderation/report-forms.tsx +120 -0
- package/src/components/moderation/signature-lock-form.tsx +83 -0
- package/src/components/moderation/thread-surgery-form.tsx +96 -0
- package/src/components/moderation/thread-tools-form.tsx +137 -0
- package/src/components/moderation/warning-forms.tsx +125 -0
- package/src/components/profile/custom-field.tsx +79 -0
- package/src/components/shell/appearance-icons.tsx +35 -0
- package/src/components/shell/board-notice.tsx +21 -0
- package/src/components/shell/copy-record.ts +20 -0
- package/src/components/shell/copy.tsx +17 -0
- package/src/components/shell/crash-notice.tsx +86 -0
- package/src/components/shell/demo-banner.tsx +49 -0
- package/src/components/shell/group-name-style.tsx +6 -0
- package/src/components/shell/measure.ts +1 -0
- package/src/components/shell/notification-menu.tsx +361 -0
- package/src/components/shell/offline-notice.tsx +29 -0
- package/src/components/shell/onboarding-banner.tsx +39 -0
- package/src/components/shell/page-shell.tsx +167 -0
- package/src/components/shell/panel-list.tsx +95 -0
- package/src/components/shell/panel-nav.tsx +40 -0
- package/src/components/shell/panel-overview.tsx +81 -0
- package/src/components/shell/panel-page.tsx +96 -0
- package/src/components/shell/panel-pagination.tsx +28 -0
- package/src/components/shell/panel-shell.tsx +31 -0
- package/src/components/shell/theme-runtime-style.tsx +6 -0
- package/src/components/shell/theme-switcher.tsx +97 -0
- package/src/components/shell/timezone-probe.tsx +45 -0
- package/src/components/shell/view-tabs.tsx +60 -0
- package/src/config.ts +13 -0
- package/src/server/absent-services.ts +29 -0
- package/src/server/admin-actions.ts +171 -0
- package/src/server/admin-settings-actions.ts +83 -0
- package/src/server/admin-undo-actions.ts +70 -0
- package/src/server/admin-undo.ts +75 -0
- package/src/server/admin.ts +112 -0
- package/src/server/announcements.ts +82 -0
- package/src/server/antispam.ts +310 -0
- package/src/server/api/content.ts +486 -0
- package/src/server/api/http.ts +119 -0
- package/src/server/api/members.ts +109 -0
- package/src/server/api/messages.ts +113 -0
- package/src/server/api/registry.ts +30 -0
- package/src/server/api/search.ts +98 -0
- package/src/server/api/subscriptions.ts +106 -0
- package/src/server/api-auth.ts +66 -0
- package/src/server/api-token-actions.ts +85 -0
- package/src/server/api-tokens-admin.ts +95 -0
- package/src/server/appearance-actions.ts +39 -0
- package/src/server/attachment-download.ts +43 -0
- package/src/server/attachment-embed.ts +63 -0
- package/src/server/attachment-upload-actions.ts +92 -0
- package/src/server/attachments.ts +257 -0
- package/src/server/auth-actions.ts +479 -0
- package/src/server/auth-config.ts +61 -0
- package/src/server/auth-events.ts +92 -0
- package/src/server/auth-form-state.ts +14 -0
- package/src/server/auth-mail.ts +104 -0
- package/src/server/avatars.ts +83 -0
- package/src/server/board-latest-actions.ts +7 -0
- package/src/server/board-latest.tsx +103 -0
- package/src/server/board-offline.ts +23 -0
- package/src/server/board-url.ts +14 -0
- package/src/server/brand-assets.ts +151 -0
- package/src/server/brand-mark.tsx +110 -0
- package/src/server/branding-actions.ts +53 -0
- package/src/server/branding.ts +101 -0
- package/src/server/cache-targets.ts +13 -0
- package/src/server/code-highlighting.ts +33 -0
- package/src/server/container.ts +402 -0
- package/src/server/content-actions.ts +459 -0
- package/src/server/content-admin-actions.ts +492 -0
- package/src/server/content-admin.ts +95 -0
- package/src/server/content-security-policy.ts +35 -0
- package/src/server/context.ts +32 -0
- package/src/server/cookies.ts +139 -0
- package/src/server/credential-proof-actions.ts +42 -0
- package/src/server/credential-proof.ts +35 -0
- package/src/server/current-location.ts +19 -0
- package/src/server/demo-stripe.ts +104 -0
- package/src/server/demo-uploads.ts +28 -0
- package/src/server/demo.ts +80 -0
- package/src/server/discovery.ts +104 -0
- package/src/server/embeds.ts +113 -0
- package/src/server/error-notice.tsx +41 -0
- package/src/server/federation-actions.ts +113 -0
- package/src/server/federation.ts +138 -0
- package/src/server/feed-builder.ts +72 -0
- package/src/server/feed-routes.ts +122 -0
- package/src/server/fixture-actor-source.ts +62 -0
- package/src/server/fixture-forum-repo.ts +59 -0
- package/src/server/fixture-member-profile-repo.ts +30 -0
- package/src/server/fixture-post-repo.ts +108 -0
- package/src/server/fixture-thread-repo.ts +98 -0
- package/src/server/form-state-reporter.ts +34 -0
- package/src/server/form-values.ts +23 -0
- package/src/server/forum-admin-actions.ts +353 -0
- package/src/server/forum-admin.ts +98 -0
- package/src/server/group-admin-actions.ts +341 -0
- package/src/server/group-admin.ts +98 -0
- package/src/server/group-badge-actions.ts +61 -0
- package/src/server/group-badge.ts +62 -0
- package/src/server/group-identity.ts +104 -0
- package/src/server/i18n-catalogs.ts +42 -0
- package/src/server/i18n.ts +69 -0
- package/src/server/image-upload.ts +109 -0
- package/src/server/inline-moderation-actions.ts +129 -0
- package/src/server/install-actions.ts +124 -0
- package/src/server/install.ts +281 -0
- package/src/server/legacy-redirect.ts +83 -0
- package/src/server/legal.ts +43 -0
- package/src/server/location-header.ts +37 -0
- package/src/server/mail-brand.ts +43 -0
- package/src/server/mail-health.ts +41 -0
- package/src/server/mail-send.ts +44 -0
- package/src/server/mail-test-actions.ts +67 -0
- package/src/server/mail-test.ts +56 -0
- package/src/server/markdown-pipeline.ts +31 -0
- package/src/server/marketplace-actions.ts +47 -0
- package/src/server/marketplace-admin.ts +260 -0
- package/src/server/mention-actions.ts +21 -0
- package/src/server/mention-search.ts +35 -0
- package/src/server/message-actions.ts +110 -0
- package/src/server/messages.ts +141 -0
- package/src/server/modcp.ts +125 -0
- package/src/server/moderation-actions.ts +165 -0
- package/src/server/navigation-admin-actions.ts +217 -0
- package/src/server/navigation.ts +112 -0
- package/src/server/nonce.ts +13 -0
- package/src/server/notification-actions.ts +84 -0
- package/src/server/notification-audience.ts +10 -0
- package/src/server/notification-menu-actions.ts +82 -0
- package/src/server/notification-menu.ts +96 -0
- package/src/server/notifications.ts +93 -0
- package/src/server/onboarding-actions.ts +27 -0
- package/src/server/onboarding.ts +89 -0
- package/src/server/page-metadata.ts +14 -0
- package/src/server/passkey-challenge.ts +42 -0
- package/src/server/plugin-admin-actions.ts +232 -0
- package/src/server/plugin-admin.ts +276 -0
- package/src/server/plugin-host.ts +143 -0
- package/src/server/plugin-pages.ts +192 -0
- package/src/server/plugin-panel.ts +49 -0
- package/src/server/plugin-routes.ts +298 -0
- package/src/server/plugin-view.tsx +58 -0
- package/src/server/poll-actions.ts +104 -0
- package/src/server/poll-scope.ts +52 -0
- package/src/server/post-notifications.ts +71 -0
- package/src/server/post-scope.ts +86 -0
- package/src/server/presence.ts +177 -0
- package/src/server/profile-fields.ts +112 -0
- package/src/server/push-actions.ts +113 -0
- package/src/server/push.ts +40 -0
- package/src/server/redirect-back.ts +15 -0
- package/src/server/registration.ts +7 -0
- package/src/server/relation-actions.ts +89 -0
- package/src/server/relations.ts +45 -0
- package/src/server/reply-core.ts +173 -0
- package/src/server/report-actions.ts +165 -0
- package/src/server/report-scope.ts +21 -0
- package/src/server/reputation-actions.ts +146 -0
- package/src/server/reputation-target.ts +49 -0
- package/src/server/reputation.ts +70 -0
- package/src/server/request-fingerprint.ts +65 -0
- package/src/server/safe-path.ts +16 -0
- package/src/server/same-origin.ts +45 -0
- package/src/server/search-page.ts +313 -0
- package/src/server/search.ts +45 -0
- package/src/server/secret-auth.ts +20 -0
- package/src/server/see-other.ts +11 -0
- package/src/server/seed-board.ts +417 -0
- package/src/server/session-actions.ts +78 -0
- package/src/server/session-cookies.ts +124 -0
- package/src/server/session-key.ts +17 -0
- package/src/server/settings.ts +47 -0
- package/src/server/signatures.ts +62 -0
- package/src/server/sso-handshake.ts +79 -0
- package/src/server/stats.ts +63 -0
- package/src/server/subscription-actions.ts +161 -0
- package/src/server/surgery-actions.ts +180 -0
- package/src/server/syndication.ts +77 -0
- package/src/server/system-admin-actions.ts +134 -0
- package/src/server/system-admin.ts +90 -0
- package/src/server/test-container.ts +114 -0
- package/src/server/theme-admin-actions.ts +242 -0
- package/src/server/theme-admin.ts +203 -0
- package/src/server/theme-runtime.ts +89 -0
- package/src/server/theme-style.ts +279 -0
- package/src/server/theme.ts +52 -0
- package/src/server/thread-core.ts +207 -0
- package/src/server/thread-rating-actions.ts +55 -0
- package/src/server/thread-tool-actions.ts +154 -0
- package/src/server/two-factor-actions.ts +178 -0
- package/src/server/two-factor.ts +86 -0
- package/src/server/upgrade-notice.ts +41 -0
- package/src/server/user-admin-actions.ts +572 -0
- package/src/server/user-admin.ts +165 -0
- package/src/server/usercp-actions.ts +263 -0
- package/src/server/usercp-mail.ts +120 -0
- package/src/server/viewer-preferences.ts +64 -0
- package/src/server/warning-actions.ts +122 -0
- package/src/styles/globals.css +969 -0
- package/src/theme/contract.fixture.ts +793 -0
- package/src/view/account-copy.ts +351 -0
- package/src/view/admin-content-copy.ts +66 -0
- package/src/view/admin-copy.ts +106 -0
- package/src/view/admin-forum-tree-copy.ts +40 -0
- package/src/view/admin-group-copy.ts +80 -0
- package/src/view/admin-log.ts +58 -0
- package/src/view/admin-nav.ts +164 -0
- package/src/view/admin-navigation-copy.ts +58 -0
- package/src/view/admin-panel-copy.ts +194 -0
- package/src/view/admin-settings.ts +173 -0
- package/src/view/admin-theme-copy.ts +229 -0
- package/src/view/admin-user-copy.ts +96 -0
- package/src/view/attachments.ts +51 -0
- package/src/view/auth-copy.ts +147 -0
- package/src/view/board-index.ts +167 -0
- package/src/view/board-latest.ts +101 -0
- package/src/view/breadcrumb.ts +50 -0
- package/src/view/contacts.ts +85 -0
- package/src/view/content-copy.ts +118 -0
- package/src/view/contrast.ts +286 -0
- package/src/view/copy.ts +101 -0
- package/src/view/count.ts +8 -0
- package/src/view/discovery-view.ts +74 -0
- package/src/view/editor-toolbar.ts +84 -0
- package/src/view/error-notice.ts +52 -0
- package/src/view/feed.ts +130 -0
- package/src/view/forum-cursor.ts +54 -0
- package/src/view/forum-display.ts +152 -0
- package/src/view/forum-jump.ts +60 -0
- package/src/view/forum-notice.ts +24 -0
- package/src/view/inline-moderation.ts +87 -0
- package/src/view/install-copy.ts +95 -0
- package/src/view/legal.ts +58 -0
- package/src/view/locale.ts +40 -0
- package/src/view/marketplace-panel.ts +51 -0
- package/src/view/member-identity.ts +23 -0
- package/src/view/member-profile.ts +65 -0
- package/src/view/messages.ts +222 -0
- package/src/view/metadata.ts +75 -0
- package/src/view/modcp-nav.ts +76 -0
- package/src/view/moderation-copy.ts +84 -0
- package/src/view/moderation-queue.ts +67 -0
- package/src/view/navigation-arrange.ts +188 -0
- package/src/view/navigation.ts +173 -0
- package/src/view/notification-menu.ts +202 -0
- package/src/view/notifications.ts +84 -0
- package/src/view/onboarding.ts +26 -0
- package/src/view/pager.ts +191 -0
- package/src/view/panel-nav.ts +203 -0
- package/src/view/plugin-panel.ts +42 -0
- package/src/view/post-form.ts +61 -0
- package/src/view/post-link.ts +29 -0
- package/src/view/presence.ts +99 -0
- package/src/view/promotion-rules.ts +52 -0
- package/src/view/redirect-notice.ts +21 -0
- package/src/view/reputation.ts +107 -0
- package/src/view/search-controls.ts +103 -0
- package/src/view/search-results.ts +291 -0
- package/src/view/security-activity.ts +73 -0
- package/src/view/setting-groups.ts +43 -0
- package/src/view/shell.ts +164 -0
- package/src/view/slug-id.ts +12 -0
- package/src/view/sso-hand-off.ts +44 -0
- package/src/view/sso-notices.ts +48 -0
- package/src/view/subscriptions.ts +76 -0
- package/src/view/theme-draft.ts +167 -0
- package/src/view/theme-preference.ts +30 -0
- package/src/view/theme-tokens.ts +333 -0
- package/src/view/thread-view.ts +280 -0
- package/src/view/time.ts +31 -0
- package/src/view/timezone.ts +35 -0
- package/src/view/two-factor.ts +6 -0
- package/src/view/usercp-nav.ts +103 -0
- package/src/view/usercp.ts +196 -0
- package/src/view/warnings.ts +128 -0
- package/src/view/word-filter.ts +5 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useActionState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { BOARD_MEASURE } from '@/components/shell/measure'
|
|
6
|
+
import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
7
|
+
import { inlineModerateAction } from '@/server/inline-moderation-actions'
|
|
8
|
+
import { splitSelectedAction } from '@/server/surgery-actions'
|
|
9
|
+
|
|
10
|
+
import { FormError } from '../auth/form-controls'
|
|
11
|
+
import { type Copy, fromCopy } from '../shell/copy'
|
|
12
|
+
|
|
13
|
+
const BUTTON =
|
|
14
|
+
'inline-flex h-8 items-center rounded-md border border-border px-3 text-xs font-medium hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring'
|
|
15
|
+
|
|
16
|
+
export interface InlineMoveOption {
|
|
17
|
+
readonly id: number
|
|
18
|
+
readonly title: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface InlineToolRights {
|
|
22
|
+
readonly approve: boolean
|
|
23
|
+
readonly lock: boolean
|
|
24
|
+
readonly stick: boolean
|
|
25
|
+
readonly move: boolean
|
|
26
|
+
readonly delete: boolean
|
|
27
|
+
readonly restore: boolean
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function InlineModerationForm({
|
|
31
|
+
formId,
|
|
32
|
+
scope,
|
|
33
|
+
rights,
|
|
34
|
+
moveTargets,
|
|
35
|
+
returnTo,
|
|
36
|
+
splitFrom,
|
|
37
|
+
copy,
|
|
38
|
+
}: {
|
|
39
|
+
formId: string
|
|
40
|
+
scope: 'threads' | 'posts'
|
|
41
|
+
rights: InlineToolRights
|
|
42
|
+
moveTargets: readonly InlineMoveOption[]
|
|
43
|
+
returnTo: string
|
|
44
|
+
splitFrom?: number | null
|
|
45
|
+
copy: Copy
|
|
46
|
+
}) {
|
|
47
|
+
const [state, action] = useActionState(inlineModerateAction, EMPTY_STATE)
|
|
48
|
+
const [splitState, splitAction] = useActionState(splitSelectedAction, EMPTY_STATE)
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div className={`${BOARD_MEASURE} mb-6`}>
|
|
52
|
+
<form
|
|
53
|
+
id={formId}
|
|
54
|
+
action={action}
|
|
55
|
+
aria-label={
|
|
56
|
+
scope === 'threads'
|
|
57
|
+
? fromCopy(copy, 'moderationForm.inline.moderateThreads')
|
|
58
|
+
: fromCopy(copy, 'moderationForm.inline.moderatePosts')
|
|
59
|
+
}
|
|
60
|
+
className="flex flex-wrap items-center gap-3 rounded-lg border border-border bg-secondary px-4 py-3"
|
|
61
|
+
>
|
|
62
|
+
<FormError message={state.error} />
|
|
63
|
+
<FormError message={splitState.error} />
|
|
64
|
+
<input type="hidden" name="returnTo" value={returnTo} />
|
|
65
|
+
|
|
66
|
+
<span className="text-xs font-medium text-muted-foreground">
|
|
67
|
+
{scope === 'threads'
|
|
68
|
+
? fromCopy(copy, 'moderationForm.inline.withThreads')
|
|
69
|
+
: fromCopy(copy, 'moderationForm.inline.withPosts')}
|
|
70
|
+
</span>
|
|
71
|
+
|
|
72
|
+
{rights.approve && (
|
|
73
|
+
<button type="submit" name="tool" value="approve" className={BUTTON}>
|
|
74
|
+
{fromCopy(copy, 'moderationForm.inline.approve')}
|
|
75
|
+
</button>
|
|
76
|
+
)}
|
|
77
|
+
{rights.lock && scope === 'threads' && (
|
|
78
|
+
<>
|
|
79
|
+
<button type="submit" name="tool" value="lock" className={BUTTON}>
|
|
80
|
+
{fromCopy(copy, 'moderationForm.tool.lock')}
|
|
81
|
+
</button>
|
|
82
|
+
<button type="submit" name="tool" value="unlock" className={BUTTON}>
|
|
83
|
+
{fromCopy(copy, 'moderationForm.tool.unlock')}
|
|
84
|
+
</button>
|
|
85
|
+
</>
|
|
86
|
+
)}
|
|
87
|
+
{rights.stick && scope === 'threads' && (
|
|
88
|
+
<>
|
|
89
|
+
<button type="submit" name="tool" value="stick" className={BUTTON}>
|
|
90
|
+
{fromCopy(copy, 'moderationForm.tool.pin')}
|
|
91
|
+
</button>
|
|
92
|
+
<button type="submit" name="tool" value="unstick" className={BUTTON}>
|
|
93
|
+
{fromCopy(copy, 'moderationForm.tool.unpin')}
|
|
94
|
+
</button>
|
|
95
|
+
</>
|
|
96
|
+
)}
|
|
97
|
+
{rights.restore && (
|
|
98
|
+
<button type="submit" name="tool" value="restore" className={BUTTON}>
|
|
99
|
+
{fromCopy(copy, 'moderationForm.inline.restore')}
|
|
100
|
+
</button>
|
|
101
|
+
)}
|
|
102
|
+
|
|
103
|
+
{rights.move && scope === 'threads' && moveTargets.length > 0 && (
|
|
104
|
+
<span className="flex items-center gap-2">
|
|
105
|
+
<label className="flex items-center gap-2 text-xs">
|
|
106
|
+
<span className="sr-only">{fromCopy(copy, 'moderationForm.moveTo')}</span>
|
|
107
|
+
<select
|
|
108
|
+
name="toForumId"
|
|
109
|
+
className="h-8 rounded-md border border-border bg-background px-2 text-xs focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
110
|
+
>
|
|
111
|
+
{moveTargets.map((forum) => (
|
|
112
|
+
<option key={forum.id} value={forum.id}>
|
|
113
|
+
{forum.title}
|
|
114
|
+
</option>
|
|
115
|
+
))}
|
|
116
|
+
</select>
|
|
117
|
+
</label>
|
|
118
|
+
<button type="submit" name="tool" value="move" className={BUTTON}>
|
|
119
|
+
{fromCopy(copy, 'moderationForm.tool.move')}
|
|
120
|
+
</button>
|
|
121
|
+
</span>
|
|
122
|
+
)}
|
|
123
|
+
|
|
124
|
+
{splitFrom != null && scope === 'posts' && (
|
|
125
|
+
<span className="flex items-center gap-2">
|
|
126
|
+
<input type="hidden" name="threadId" value={splitFrom} />
|
|
127
|
+
<label className="flex items-center gap-2 text-xs">
|
|
128
|
+
<span className="sr-only">
|
|
129
|
+
{fromCopy(copy, 'moderationForm.inline.splitTitleSr')}
|
|
130
|
+
</span>
|
|
131
|
+
<input
|
|
132
|
+
type="text"
|
|
133
|
+
name="title"
|
|
134
|
+
maxLength={150}
|
|
135
|
+
placeholder={fromCopy(copy, 'moderationForm.newThreadTitle')}
|
|
136
|
+
className="h-8 w-48 rounded-md border border-border bg-background px-2 text-xs focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
137
|
+
/>
|
|
138
|
+
</label>
|
|
139
|
+
<button type="submit" formAction={splitAction} className={BUTTON}>
|
|
140
|
+
{fromCopy(copy, 'moderationForm.inline.splitOut')}
|
|
141
|
+
</button>
|
|
142
|
+
</span>
|
|
143
|
+
)}
|
|
144
|
+
|
|
145
|
+
{rights.delete && (
|
|
146
|
+
<button
|
|
147
|
+
type="submit"
|
|
148
|
+
name="tool"
|
|
149
|
+
value="delete"
|
|
150
|
+
className={`${BUTTON} border-destructive/40 text-destructive`}
|
|
151
|
+
>
|
|
152
|
+
{fromCopy(copy, 'moderationForm.inline.delete')}
|
|
153
|
+
</button>
|
|
154
|
+
)}
|
|
155
|
+
</form>
|
|
156
|
+
</div>
|
|
157
|
+
)
|
|
158
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PanelNavRegion } from '@/components/shell/panel-nav'
|
|
2
|
+
import { MODCP_OVERVIEW } from '@/view/modcp-nav'
|
|
3
|
+
import type { PanelCounts, PanelNav as PanelNavTree } from '@/view/panel-nav'
|
|
4
|
+
|
|
5
|
+
export function ModCpNav({
|
|
6
|
+
nav,
|
|
7
|
+
counts,
|
|
8
|
+
}: {
|
|
9
|
+
readonly nav: PanelNavTree
|
|
10
|
+
readonly counts: PanelCounts
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
<PanelNavRegion panel="modcp" nav={nav} overviewHref={MODCP_OVERVIEW.href} counts={counts} />
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { notFound } from 'next/navigation'
|
|
2
|
+
|
|
3
|
+
import { ModCpNav } from '@/components/moderation/modcp-nav'
|
|
4
|
+
import { PanelShell } from '@/components/shell/panel-shell'
|
|
5
|
+
import { getActor } from '@/server/context'
|
|
6
|
+
import { getTranslator } from '@/server/i18n'
|
|
7
|
+
import { modCpCounts, resolveModCpAccess } from '@/server/modcp'
|
|
8
|
+
import { modCpNav } from '@/view/modcp-nav'
|
|
9
|
+
import { buildPanelLinks } from '@/view/shell'
|
|
10
|
+
|
|
11
|
+
export async function ModCpShell({ children }: { children: React.ReactNode }) {
|
|
12
|
+
const access = await resolveModCpAccess()
|
|
13
|
+
if (access === null) notFound()
|
|
14
|
+
|
|
15
|
+
const counts = await modCpCounts()
|
|
16
|
+
|
|
17
|
+
const actor = await getActor()
|
|
18
|
+
const links = buildPanelLinks({
|
|
19
|
+
t: await getTranslator(),
|
|
20
|
+
current: 'modcp',
|
|
21
|
+
canAccessAdminCp: actor.global.canAccessAdminCp === true,
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<PanelShell
|
|
26
|
+
panel="modcp"
|
|
27
|
+
nav={
|
|
28
|
+
<ModCpNav
|
|
29
|
+
nav={modCpNav(access)}
|
|
30
|
+
counts={{
|
|
31
|
+
'/moderation': counts.pending,
|
|
32
|
+
'/moderation/reports': counts.openReports,
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
35
|
+
}
|
|
36
|
+
links={links}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</PanelShell>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useActionState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
6
|
+
import { moderateQueueAction } from '@/server/moderation-actions'
|
|
7
|
+
|
|
8
|
+
import { FormError } from '../auth/form-controls'
|
|
9
|
+
import { type Copy, formatFromCopy, fromCopy } from '../shell/copy'
|
|
10
|
+
|
|
11
|
+
export interface QueueFormRow {
|
|
12
|
+
readonly value: string
|
|
13
|
+
readonly kindLabel: string
|
|
14
|
+
readonly forumTitle: string
|
|
15
|
+
readonly threadTitle: string
|
|
16
|
+
readonly href: string
|
|
17
|
+
readonly authorUsername: string
|
|
18
|
+
readonly authorHref: string | null
|
|
19
|
+
readonly excerpt: string
|
|
20
|
+
readonly postedAt: { readonly iso: string; readonly label: string }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function QueueForm({ rows, copy }: { rows: readonly QueueFormRow[]; copy: Copy }) {
|
|
24
|
+
const [state, action] = useActionState(moderateQueueAction, EMPTY_STATE)
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<form action={action} className="flex flex-col gap-4">
|
|
28
|
+
<FormError message={state.error} />
|
|
29
|
+
|
|
30
|
+
<ul className="flex flex-col gap-3">
|
|
31
|
+
{rows.map((row) => (
|
|
32
|
+
<li key={row.value} className="rounded-lg border border-border bg-card p-4">
|
|
33
|
+
<label className="flex items-start gap-3">
|
|
34
|
+
<input
|
|
35
|
+
type="checkbox"
|
|
36
|
+
name="item"
|
|
37
|
+
value={row.value}
|
|
38
|
+
className="mt-1 size-4 shrink-0"
|
|
39
|
+
/>
|
|
40
|
+
<span className="flex min-w-0 flex-col gap-1">
|
|
41
|
+
<span className="flex flex-wrap items-baseline gap-2 text-sm">
|
|
42
|
+
<span className="font-medium">{row.kindLabel}</span>
|
|
43
|
+
<span className="text-muted-foreground">
|
|
44
|
+
{formatFromCopy(copy, 'moderationForm.queue.inForum', {
|
|
45
|
+
forum: row.forumTitle,
|
|
46
|
+
})}
|
|
47
|
+
</span>
|
|
48
|
+
<a
|
|
49
|
+
href={row.href}
|
|
50
|
+
className="font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground"
|
|
51
|
+
>
|
|
52
|
+
{row.threadTitle}
|
|
53
|
+
</a>
|
|
54
|
+
</span>
|
|
55
|
+
<span className="text-xs text-muted-foreground">
|
|
56
|
+
{copy['moderationForm.queue.byLead']}
|
|
57
|
+
{row.authorHref === null ? (
|
|
58
|
+
row.authorUsername
|
|
59
|
+
) : (
|
|
60
|
+
<a href={row.authorHref} className="hover:text-foreground">
|
|
61
|
+
{row.authorUsername}
|
|
62
|
+
</a>
|
|
63
|
+
)}
|
|
64
|
+
{copy['moderationForm.queue.byTail']} ·{' '}
|
|
65
|
+
<time dateTime={row.postedAt.iso}>{row.postedAt.label}</time>
|
|
66
|
+
</span>
|
|
67
|
+
<span className="whitespace-pre-wrap break-words text-sm leading-relaxed">
|
|
68
|
+
{row.excerpt}
|
|
69
|
+
</span>
|
|
70
|
+
</span>
|
|
71
|
+
</label>
|
|
72
|
+
</li>
|
|
73
|
+
))}
|
|
74
|
+
</ul>
|
|
75
|
+
|
|
76
|
+
<div className="flex flex-wrap gap-3">
|
|
77
|
+
<button
|
|
78
|
+
type="submit"
|
|
79
|
+
name="decision"
|
|
80
|
+
value="approve"
|
|
81
|
+
className="inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
82
|
+
>
|
|
83
|
+
{fromCopy(copy, 'moderationForm.queue.approve')}
|
|
84
|
+
</button>
|
|
85
|
+
<button
|
|
86
|
+
type="submit"
|
|
87
|
+
name="decision"
|
|
88
|
+
value="reject"
|
|
89
|
+
className="inline-flex h-10 items-center justify-center rounded-md border border-destructive/40 px-4 text-sm font-medium text-destructive transition-opacity hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
90
|
+
>
|
|
91
|
+
{fromCopy(copy, 'moderationForm.queue.reject')}
|
|
92
|
+
</button>
|
|
93
|
+
</div>
|
|
94
|
+
</form>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useActionState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { Card, CardContent, Field, Textarea } from '@meith/ui'
|
|
6
|
+
|
|
7
|
+
import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
8
|
+
import { assignReportAction, closeReportAction, fileReportAction } from '@/server/report-actions'
|
|
9
|
+
|
|
10
|
+
import { FormError, SubmitButton } from '../auth/form-controls'
|
|
11
|
+
import { type Copy, fromCopy } from '../shell/copy'
|
|
12
|
+
|
|
13
|
+
export function ReportForm({
|
|
14
|
+
kind,
|
|
15
|
+
targetId,
|
|
16
|
+
copy,
|
|
17
|
+
}: {
|
|
18
|
+
kind: string
|
|
19
|
+
targetId: number
|
|
20
|
+
copy: Copy
|
|
21
|
+
}) {
|
|
22
|
+
const [state, action] = useActionState(fileReportAction, EMPTY_STATE)
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Card>
|
|
26
|
+
<CardContent>
|
|
27
|
+
<form action={action} className="flex flex-col gap-4" noValidate>
|
|
28
|
+
<FormError message={state.error} />
|
|
29
|
+
<input type="hidden" name="kind" value={kind} />
|
|
30
|
+
<input type="hidden" name="targetId" value={targetId} />
|
|
31
|
+
|
|
32
|
+
<Field
|
|
33
|
+
name="reason"
|
|
34
|
+
label={fromCopy(copy, 'moderationForm.report.label')}
|
|
35
|
+
description={fromCopy(copy, 'moderationForm.report.hint')}
|
|
36
|
+
>
|
|
37
|
+
{(control) => (
|
|
38
|
+
<Textarea {...control} required defaultValue={state.values?.reason ?? ''} />
|
|
39
|
+
)}
|
|
40
|
+
</Field>
|
|
41
|
+
|
|
42
|
+
<div>
|
|
43
|
+
<SubmitButton className="w-full sm:w-auto sm:px-8">
|
|
44
|
+
{fromCopy(copy, 'moderationForm.report.submit')}
|
|
45
|
+
</SubmitButton>
|
|
46
|
+
</div>
|
|
47
|
+
</form>
|
|
48
|
+
</CardContent>
|
|
49
|
+
</Card>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function AssignReportForm({
|
|
54
|
+
reportId,
|
|
55
|
+
mine,
|
|
56
|
+
copy,
|
|
57
|
+
}: {
|
|
58
|
+
reportId: number
|
|
59
|
+
mine: boolean
|
|
60
|
+
copy: Copy
|
|
61
|
+
}) {
|
|
62
|
+
const [state, action] = useActionState(assignReportAction, EMPTY_STATE)
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<form action={action} className="inline">
|
|
66
|
+
<FormError message={state.error} />
|
|
67
|
+
<input type="hidden" name="reportId" value={reportId} />
|
|
68
|
+
<input type="hidden" name="take" value={mine ? '0' : '1'} />
|
|
69
|
+
<button
|
|
70
|
+
type="submit"
|
|
71
|
+
className="text-xs font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
72
|
+
>
|
|
73
|
+
{mine
|
|
74
|
+
? fromCopy(copy, 'moderationForm.report.putBack')
|
|
75
|
+
: fromCopy(copy, 'moderationForm.report.take')}
|
|
76
|
+
</button>
|
|
77
|
+
</form>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function CloseReportForm({ reportId, copy }: { reportId: number; copy: Copy }) {
|
|
82
|
+
const [state, action] = useActionState(closeReportAction, EMPTY_STATE)
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<form action={action} className="mt-3 flex flex-col gap-2 border-t border-border pt-3">
|
|
86
|
+
<FormError message={state.error} />
|
|
87
|
+
<input type="hidden" name="reportId" value={reportId} />
|
|
88
|
+
<label className="flex flex-col gap-1 text-xs">
|
|
89
|
+
<span className="font-medium text-muted-foreground">
|
|
90
|
+
{fromCopy(copy, 'moderationForm.report.note')}
|
|
91
|
+
</span>
|
|
92
|
+
<input
|
|
93
|
+
type="text"
|
|
94
|
+
name="note"
|
|
95
|
+
maxLength={1000}
|
|
96
|
+
defaultValue={state.values?.note ?? ''}
|
|
97
|
+
className="rounded-md border border-border bg-background px-2 py-1 text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
98
|
+
/>
|
|
99
|
+
</label>
|
|
100
|
+
<div className="flex flex-wrap gap-2">
|
|
101
|
+
<button
|
|
102
|
+
type="submit"
|
|
103
|
+
name="status"
|
|
104
|
+
value="resolved"
|
|
105
|
+
className="inline-flex h-8 items-center rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
106
|
+
>
|
|
107
|
+
{fromCopy(copy, 'moderationForm.report.resolve')}
|
|
108
|
+
</button>
|
|
109
|
+
<button
|
|
110
|
+
type="submit"
|
|
111
|
+
name="status"
|
|
112
|
+
value="rejected"
|
|
113
|
+
className="inline-flex h-8 items-center rounded-md border border-border px-3 text-xs font-medium hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
114
|
+
>
|
|
115
|
+
{fromCopy(copy, 'moderationForm.report.dismiss')}
|
|
116
|
+
</button>
|
|
117
|
+
</div>
|
|
118
|
+
</form>
|
|
119
|
+
)
|
|
120
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useActionState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
6
|
+
import { setAvatarLockAction, setSignatureLockAction } from '@/server/moderation-actions'
|
|
7
|
+
|
|
8
|
+
import { FormError } from '../auth/form-controls'
|
|
9
|
+
import { type Copy, fromCopy } from '../shell/copy'
|
|
10
|
+
|
|
11
|
+
const REASON_INPUT = 'h-8 rounded-md border border-border bg-background px-2 text-xs'
|
|
12
|
+
const LOCK_BUTTON =
|
|
13
|
+
'text-xs text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring'
|
|
14
|
+
|
|
15
|
+
export function SignatureLockForm({
|
|
16
|
+
userId,
|
|
17
|
+
locked,
|
|
18
|
+
copy,
|
|
19
|
+
}: {
|
|
20
|
+
userId: number
|
|
21
|
+
locked: boolean
|
|
22
|
+
copy: Copy
|
|
23
|
+
}) {
|
|
24
|
+
const [state, action] = useActionState(setSignatureLockAction, EMPTY_STATE)
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<form action={action} className="flex flex-wrap items-center gap-2">
|
|
28
|
+
<FormError message={state.error} />
|
|
29
|
+
<input type="hidden" name="userId" value={userId} />
|
|
30
|
+
<input type="hidden" name="locked" value={locked ? '0' : '1'} />
|
|
31
|
+
|
|
32
|
+
{locked ? null : (
|
|
33
|
+
<input
|
|
34
|
+
name="reason"
|
|
35
|
+
placeholder={fromCopy(copy, 'moderationForm.lock.why')}
|
|
36
|
+
className={REASON_INPUT}
|
|
37
|
+
required
|
|
38
|
+
/>
|
|
39
|
+
)}
|
|
40
|
+
|
|
41
|
+
<button type="submit" className={LOCK_BUTTON}>
|
|
42
|
+
{locked
|
|
43
|
+
? fromCopy(copy, 'moderationForm.lock.unlockSignature')
|
|
44
|
+
: fromCopy(copy, 'moderationForm.lock.signature')}
|
|
45
|
+
</button>
|
|
46
|
+
</form>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function AvatarLockForm({
|
|
51
|
+
userId,
|
|
52
|
+
locked,
|
|
53
|
+
copy,
|
|
54
|
+
}: {
|
|
55
|
+
userId: number
|
|
56
|
+
locked: boolean
|
|
57
|
+
copy: Copy
|
|
58
|
+
}) {
|
|
59
|
+
const [state, action] = useActionState(setAvatarLockAction, EMPTY_STATE)
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<form action={action} className="flex flex-wrap items-center gap-2">
|
|
63
|
+
<FormError message={state.error} />
|
|
64
|
+
<input type="hidden" name="userId" value={userId} />
|
|
65
|
+
<input type="hidden" name="locked" value={locked ? '0' : '1'} />
|
|
66
|
+
|
|
67
|
+
{locked ? null : (
|
|
68
|
+
<input
|
|
69
|
+
name="reason"
|
|
70
|
+
placeholder={fromCopy(copy, 'moderationForm.lock.why')}
|
|
71
|
+
className={REASON_INPUT}
|
|
72
|
+
required
|
|
73
|
+
/>
|
|
74
|
+
)}
|
|
75
|
+
|
|
76
|
+
<button type="submit" className={LOCK_BUTTON}>
|
|
77
|
+
{locked
|
|
78
|
+
? fromCopy(copy, 'moderationForm.lock.unlockAvatar')
|
|
79
|
+
: fromCopy(copy, 'moderationForm.lock.avatar')}
|
|
80
|
+
</button>
|
|
81
|
+
</form>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useActionState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
6
|
+
import { mergeThreadAction, splitThreadAction } from '@/server/surgery-actions'
|
|
7
|
+
|
|
8
|
+
import { FormError } from '../auth/form-controls'
|
|
9
|
+
import { type Copy, formatFromCopy, fromCopy } from '../shell/copy'
|
|
10
|
+
|
|
11
|
+
const BUTTON =
|
|
12
|
+
'inline-flex h-8 items-center rounded-md border border-border px-3 text-xs font-medium hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring'
|
|
13
|
+
const FIELD =
|
|
14
|
+
'h-8 rounded-md border border-border bg-background px-2 text-xs focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring'
|
|
15
|
+
|
|
16
|
+
export interface SplitPoint {
|
|
17
|
+
readonly id: number
|
|
18
|
+
readonly number: number
|
|
19
|
+
readonly author: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function ThreadSurgeryForm({
|
|
23
|
+
threadId,
|
|
24
|
+
rights,
|
|
25
|
+
splitPoints,
|
|
26
|
+
copy,
|
|
27
|
+
}: {
|
|
28
|
+
threadId: number
|
|
29
|
+
rights: { merge: boolean; split: boolean }
|
|
30
|
+
splitPoints: readonly SplitPoint[]
|
|
31
|
+
copy: Copy
|
|
32
|
+
}) {
|
|
33
|
+
const [splitState, splitAction] = useActionState(splitThreadAction, EMPTY_STATE)
|
|
34
|
+
const [mergeState, mergeAction] = useActionState(mergeThreadAction, EMPTY_STATE)
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
{rights.split && splitPoints.length > 0 && (
|
|
39
|
+
<form action={splitAction} className="flex flex-wrap items-center gap-2">
|
|
40
|
+
<FormError message={splitState.error} />
|
|
41
|
+
<input type="hidden" name="threadId" value={threadId} />
|
|
42
|
+
<label className="flex items-center gap-2 text-xs">
|
|
43
|
+
<span className="sr-only">{fromCopy(copy, 'moderationForm.surgery.fromSr')}</span>
|
|
44
|
+
<select name="fromPostId" className={FIELD}>
|
|
45
|
+
{splitPoints.map((point) => (
|
|
46
|
+
<option key={point.id} value={point.id}>
|
|
47
|
+
{formatFromCopy(copy, 'moderationForm.surgery.splitPoint', {
|
|
48
|
+
number: point.number,
|
|
49
|
+
author: point.author,
|
|
50
|
+
})}
|
|
51
|
+
</option>
|
|
52
|
+
))}
|
|
53
|
+
</select>
|
|
54
|
+
</label>
|
|
55
|
+
<label className="flex items-center gap-2 text-xs">
|
|
56
|
+
<span className="sr-only">{fromCopy(copy, 'moderationForm.surgery.titleSr')}</span>
|
|
57
|
+
<input
|
|
58
|
+
type="text"
|
|
59
|
+
name="title"
|
|
60
|
+
required
|
|
61
|
+
minLength={3}
|
|
62
|
+
maxLength={150}
|
|
63
|
+
placeholder={fromCopy(copy, 'moderationForm.newThreadTitle')}
|
|
64
|
+
className={`${FIELD} w-48`}
|
|
65
|
+
/>
|
|
66
|
+
</label>
|
|
67
|
+
<button type="submit" className={BUTTON}>
|
|
68
|
+
{fromCopy(copy, 'moderationForm.surgery.split')}
|
|
69
|
+
</button>
|
|
70
|
+
</form>
|
|
71
|
+
)}
|
|
72
|
+
|
|
73
|
+
{rights.merge && (
|
|
74
|
+
<form action={mergeAction} className="flex flex-wrap items-center gap-2">
|
|
75
|
+
<FormError message={mergeState.error} />
|
|
76
|
+
<input type="hidden" name="threadId" value={threadId} />
|
|
77
|
+
<label className="flex items-center gap-2 text-xs">
|
|
78
|
+
<span className="sr-only">{fromCopy(copy, 'moderationForm.surgery.mergeSr')}</span>
|
|
79
|
+
<input
|
|
80
|
+
type="number"
|
|
81
|
+
name="targetThreadId"
|
|
82
|
+
required
|
|
83
|
+
min={1}
|
|
84
|
+
step={1}
|
|
85
|
+
placeholder={fromCopy(copy, 'moderationForm.surgery.mergePlaceholder')}
|
|
86
|
+
className={`${FIELD} w-40`}
|
|
87
|
+
/>
|
|
88
|
+
</label>
|
|
89
|
+
<button type="submit" className={`${BUTTON} border-destructive/40 text-destructive`}>
|
|
90
|
+
{fromCopy(copy, 'moderationForm.surgery.merge')}
|
|
91
|
+
</button>
|
|
92
|
+
</form>
|
|
93
|
+
)}
|
|
94
|
+
</>
|
|
95
|
+
)
|
|
96
|
+
}
|