@meith/web 0.30.1 → 0.32.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/app/(board)/[slug]/feed.xml/route.ts +5 -3
- package/app/(board)/[slug]/new/page.tsx +5 -0
- package/app/(board)/[slug]/page.tsx +7 -1
- package/app/(board)/discover/[view]/page.tsx +6 -1
- package/app/(board)/member/[id]/page.tsx +3 -5
- package/app/(board)/member/[id]/reputation/page.tsx +8 -15
- package/app/(board)/members/page.tsx +3 -8
- package/app/(board)/messages/[id]/page.tsx +3 -7
- package/app/(board)/messages/page.tsx +3 -5
- package/app/(board)/modcp/ip/page.tsx +3 -5
- package/app/(board)/modcp/plugins/[key]/[[...path]]/page.tsx +84 -0
- package/app/(board)/moderation/reports/page.tsx +53 -15
- package/app/(board)/moderation/warn/page.tsx +3 -6
- package/app/(board)/notifications/page.tsx +5 -10
- package/app/(board)/notifications/preferences/page.tsx +8 -0
- package/app/(board)/online/page.tsx +12 -6
- package/app/(board)/staff/page.tsx +4 -5
- package/app/(board)/stats/page.tsx +10 -3
- package/app/(board)/subscriptions/page.tsx +5 -10
- package/app/(board)/thread/[slug]/edit/page.tsx +21 -0
- package/app/(board)/thread/[slug]/feed.xml/route.ts +6 -3
- package/app/(board)/thread/[slug]/page.tsx +49 -11
- package/app/(board)/thread/[slug]/reply/page.tsx +5 -0
- package/app/(board)/unsubscribe/page.tsx +8 -11
- package/app/(board)/usercp/contacts/page.tsx +3 -5
- package/app/(board)/usercp/drafts/page.tsx +70 -0
- package/app/(board)/usercp/options/page.tsx +8 -1
- package/app/(board)/usercp/security/page.tsx +16 -0
- package/app/admin/antispam/page.tsx +4 -12
- package/app/admin/content/attachments/page.tsx +3 -6
- package/app/admin/content/page.tsx +3 -13
- package/app/admin/forums/[id]/permissions/page.tsx +9 -12
- package/app/admin/groups/page.tsx +7 -9
- package/app/admin/page.tsx +12 -6
- package/app/admin/plugins/[key]/[[...path]]/page.tsx +6 -7
- package/app/admin/plugins/page.tsx +3 -6
- package/app/admin/users/[id]/page.tsx +5 -11
- package/app/admin/users/prune/page.tsx +4 -12
- package/app/admin/webhooks/page.tsx +144 -0
- package/app/api/subscribe/thread/[id]/route.ts +53 -0
- package/app/api/unsubscribe/thread/[id]/route.ts +42 -0
- package/app/atom.xml/route.ts +2 -2
- package/app/auth/sso/[provider]/callback/route.ts +10 -0
- package/app/feed.xml/route.ts +2 -2
- package/app/offline/route.ts +98 -0
- package/next.config.mjs +1 -0
- package/package.json +49 -48
- package/public/sw.js +42 -2
- package/src/components/account/draft-forms.tsx +39 -0
- package/src/components/account/feed-token.tsx +95 -0
- package/src/components/account/notification-forms.tsx +37 -2
- package/src/components/account/relation-forms.tsx +3 -2
- package/src/components/account/subscription-forms.tsx +20 -6
- package/src/components/account/usercp-forms.tsx +44 -0
- package/src/components/admin/api-token-forms.tsx +11 -7
- package/src/components/admin/ban-filter-forms.tsx +15 -11
- package/src/components/admin/content-forms.tsx +31 -14
- package/src/components/admin/forum-forms.tsx +241 -129
- package/src/components/admin/forum-tree.tsx +5 -7
- package/src/components/admin/navigation-forms.tsx +43 -26
- package/src/components/admin/navigation-tree.tsx +8 -13
- package/src/components/admin/oklch-picker.tsx +2 -1
- package/src/components/admin/theme-changes.tsx +3 -2
- package/src/components/admin/theme-forms.tsx +3 -2
- package/src/components/admin/webhook-forms.tsx +137 -0
- package/src/components/auth/register-form.tsx +4 -7
- package/src/components/board/live-region.tsx +3 -1
- package/src/components/content/attachment-field.tsx +93 -22
- package/src/components/content/combobox-keys.ts +38 -0
- package/src/components/content/edit-post-form.tsx +75 -1
- package/src/components/content/markdown-editor.tsx +29 -86
- package/src/components/content/mention-combobox.tsx +137 -0
- package/src/components/content/multiquote-button.tsx +15 -12
- package/src/components/content/new-thread-form.tsx +95 -17
- package/src/components/content/poll-edit-form.tsx +61 -39
- package/src/components/content/poll-vote-form.tsx +91 -0
- package/src/components/content/poll.tsx +12 -48
- package/src/components/content/progressive-marker.tsx +13 -0
- package/src/components/content/recipient-segment.ts +39 -0
- package/src/components/content/reply-form.tsx +9 -1
- package/src/components/content/thanks-button.tsx +12 -7
- package/src/components/messages/message-forms.tsx +53 -43
- package/src/components/messages/recipient-field.tsx +88 -0
- package/src/components/moderation/inline-moderation-form.tsx +2 -0
- package/src/components/moderation/modcp-shell.tsx +17 -3
- package/src/components/moderation/queue-form.tsx +3 -6
- package/src/components/moderation/report-forms.tsx +24 -5
- package/src/components/moderation/thread-tools-form.tsx +2 -0
- package/src/components/shell/board-notice.tsx +22 -1
- package/src/components/shell/confirm-dialog.tsx +93 -0
- package/src/components/shell/nav-disclosure-enhancer.tsx +36 -0
- package/src/components/shell/notice-toast.tsx +40 -0
- package/src/components/shell/notification-menu.tsx +5 -3
- package/src/components/shell/page-shell.tsx +3 -0
- package/src/components/shell/scheme-toggle.tsx +72 -0
- package/src/components/shell/theme-switcher.tsx +16 -36
- package/src/server/admin-settings-actions.ts +5 -0
- package/src/server/api/search.ts +8 -2
- package/src/server/api-token-actions.ts +4 -0
- package/src/server/appearance-actions.ts +21 -0
- package/src/server/attachments.ts +35 -0
- package/src/server/auth-actions.ts +2 -0
- package/src/server/auth-form-state.ts +28 -0
- package/src/server/auto-watch.ts +31 -0
- package/src/server/ban-filter-admin-actions.ts +5 -0
- package/src/server/confirm.ts +19 -0
- package/src/server/content-actions.ts +129 -19
- package/src/server/content-admin-actions.ts +31 -0
- package/src/server/discovery.ts +11 -1
- package/src/server/feed-routes.ts +13 -4
- package/src/server/feed-token-actions.ts +61 -0
- package/src/server/feed-token.ts +78 -0
- package/src/server/fixture-post-repo.ts +18 -0
- package/src/server/forum-admin-actions.ts +23 -16
- package/src/server/forum-admin.ts +10 -1
- package/src/server/inline-moderation-actions.ts +6 -0
- package/src/server/message-actions.ts +9 -0
- package/src/server/navigation-admin-actions.ts +6 -0
- package/src/server/plugin-admin.ts +7 -2
- package/src/server/plugin-pages.ts +50 -0
- package/src/server/plugin-panel.ts +34 -1
- package/src/server/plugin-routes.ts +8 -0
- package/src/server/plugin-view.tsx +46 -7
- package/src/server/poll-actions.ts +13 -1
- package/src/server/presence.ts +23 -0
- package/src/server/reply-core.ts +8 -1
- package/src/server/report-actions.ts +13 -2
- package/src/server/reputation-actions.ts +12 -1
- package/src/server/search-page.ts +8 -2
- package/src/server/search.ts +18 -5
- package/src/server/subscription-actions.ts +9 -0
- package/src/server/thread-core.ts +10 -2
- package/src/server/thread-tool-actions.ts +6 -0
- package/src/server/unread-goto.ts +28 -0
- package/src/server/upgrade-notice.ts +1 -1
- package/src/server/usercp-actions.ts +31 -1
- package/src/server/viewer-preferences.ts +5 -0
- package/src/server/webhook-actions.ts +98 -0
- package/src/server/webhooks-admin.ts +122 -0
- package/src/theme/contract.fixture.ts +36 -5
- package/src/view/account-copy.ts +39 -0
- package/src/view/admin-copy.ts +4 -9
- package/src/view/admin-nav.ts +6 -0
- package/src/view/admin-panel-copy.ts +23 -0
- package/src/view/attachments.ts +33 -1
- package/src/view/board-index.ts +31 -2
- package/src/view/board-title.ts +1 -0
- package/src/view/content-copy.ts +22 -12
- package/src/view/copy.ts +17 -0
- package/src/view/discovery-view.ts +2 -1
- package/src/view/drafts.ts +45 -0
- package/src/view/editor-toolbar.ts +14 -0
- package/src/view/forum-display.ts +39 -7
- package/src/view/modcp-nav.ts +32 -0
- package/src/view/moderation-copy.ts +20 -0
- package/src/view/notifications.ts +1 -0
- package/src/view/plugin-panel.ts +13 -0
- package/src/view/poll-vote.ts +46 -0
- package/src/view/post-link.ts +8 -1
- package/src/view/progressive-enhancement.ts +5 -0
- package/src/view/shell.ts +2 -1
- package/src/view/subscriptions.ts +1 -0
- package/src/view/thread-view.ts +41 -2
- package/src/view/usercp-nav.ts +6 -0
- package/src/view/usercp.ts +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meith/web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "The board itself: the Next.js app, and the forum-web bin that materializes it into an external board workspace.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -43,53 +43,54 @@
|
|
|
43
43
|
"react-dom": "19.2.8",
|
|
44
44
|
"tailwindcss": "^4.3.3",
|
|
45
45
|
"typescript": "7.0.2",
|
|
46
|
-
"@meith/accounts": "0.
|
|
47
|
-
"@meith/admin": "0.
|
|
48
|
-
"@meith/antispam": "0.
|
|
49
|
-
"@meith/api": "0.
|
|
50
|
-
"@meith/attachments": "0.
|
|
51
|
-
"@meith/authorization": "0.
|
|
52
|
-
"@meith/avatars": "0.
|
|
53
|
-
"@meith/
|
|
54
|
-
"@meith/
|
|
55
|
-
"@meith/
|
|
56
|
-
"@meith/demo": "0.
|
|
57
|
-
"@meith/
|
|
58
|
-
"@meith/
|
|
59
|
-
"@meith/
|
|
60
|
-
"@meith/forums": "0.
|
|
61
|
-
"@meith/
|
|
62
|
-
"@meith/
|
|
63
|
-
"@meith/
|
|
64
|
-
"@meith/
|
|
65
|
-
"@meith/
|
|
66
|
-
"@meith/
|
|
67
|
-
"@meith/
|
|
68
|
-
"@meith/
|
|
69
|
-
"@meith/
|
|
70
|
-
"@meith/
|
|
71
|
-
"@meith/plugin-
|
|
72
|
-
"@meith/plugin-
|
|
73
|
-
"@meith/
|
|
74
|
-
"@meith/
|
|
75
|
-
"@meith/
|
|
76
|
-
"@meith/
|
|
77
|
-
"@meith/
|
|
78
|
-
"@meith/
|
|
79
|
-
"@meith/
|
|
80
|
-
"@meith/
|
|
81
|
-
"@meith/
|
|
82
|
-
"@meith/
|
|
83
|
-
"@meith/
|
|
84
|
-
"@meith/
|
|
85
|
-
"@meith/theme-
|
|
86
|
-
"@meith/theme-
|
|
87
|
-
"@meith/theme-
|
|
88
|
-
"@meith/theme-
|
|
89
|
-
"@meith/theme-
|
|
90
|
-
"@meith/
|
|
91
|
-
"@meith/
|
|
92
|
-
"@meith/
|
|
46
|
+
"@meith/accounts": "0.32.0",
|
|
47
|
+
"@meith/admin": "0.32.0",
|
|
48
|
+
"@meith/antispam": "0.32.0",
|
|
49
|
+
"@meith/api": "0.32.0",
|
|
50
|
+
"@meith/attachments": "0.32.0",
|
|
51
|
+
"@meith/authorization": "0.32.0",
|
|
52
|
+
"@meith/avatars": "0.32.0",
|
|
53
|
+
"@meith/board-digest": "0.32.0",
|
|
54
|
+
"@meith/core": "0.32.0",
|
|
55
|
+
"@meith/db": "0.32.0",
|
|
56
|
+
"@meith/demo": "0.32.0",
|
|
57
|
+
"@meith/drafts": "0.32.0",
|
|
58
|
+
"@meith/drivers": "0.32.0",
|
|
59
|
+
"@meith/events": "0.32.0",
|
|
60
|
+
"@meith/forums": "0.32.0",
|
|
61
|
+
"@meith/groups": "0.32.0",
|
|
62
|
+
"@meith/i18n": "0.32.0",
|
|
63
|
+
"@meith/import": "0.32.0",
|
|
64
|
+
"@meith/install": "0.32.0",
|
|
65
|
+
"@meith/mail": "0.32.0",
|
|
66
|
+
"@meith/markdown": "0.32.0",
|
|
67
|
+
"@meith/marketplace": "0.32.0",
|
|
68
|
+
"@meith/messages": "0.32.0",
|
|
69
|
+
"@meith/moderation": "0.32.0",
|
|
70
|
+
"@meith/notifications": "0.32.0",
|
|
71
|
+
"@meith/plugin-calendar": "0.32.0",
|
|
72
|
+
"@meith/plugin-dues": "0.32.0",
|
|
73
|
+
"@meith/plugin-kit": "0.32.0",
|
|
74
|
+
"@meith/polls": "0.32.0",
|
|
75
|
+
"@meith/posts": "0.32.0",
|
|
76
|
+
"@meith/profile-fields": "0.32.0",
|
|
77
|
+
"@meith/relations": "0.32.0",
|
|
78
|
+
"@meith/reputation": "0.32.0",
|
|
79
|
+
"@meith/runtime": "0.32.0",
|
|
80
|
+
"@meith/search": "0.32.0",
|
|
81
|
+
"@meith/settings": "0.32.0",
|
|
82
|
+
"@meith/signatures": "0.32.0",
|
|
83
|
+
"@meith/subscriptions": "0.32.0",
|
|
84
|
+
"@meith/tasks": "0.32.0",
|
|
85
|
+
"@meith/theme-clubhouse": "0.32.0",
|
|
86
|
+
"@meith/theme-default": "0.32.0",
|
|
87
|
+
"@meith/theme-kit": "0.32.0",
|
|
88
|
+
"@meith/theme-midnight": "0.32.0",
|
|
89
|
+
"@meith/theme-phasebook": "0.32.0",
|
|
90
|
+
"@meith/theme-raidframe": "0.32.0",
|
|
91
|
+
"@meith/threads": "0.32.0",
|
|
92
|
+
"@meith/ui": "0.32.0",
|
|
93
|
+
"@meith/upgrade": "0.32.0"
|
|
93
94
|
},
|
|
94
95
|
"scripts": {
|
|
95
96
|
"dev": "next dev",
|
package/public/sw.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const FALLBACK_HREF = '/notifications'
|
|
2
2
|
|
|
3
|
+
const OFFLINE_URL = '/offline'
|
|
4
|
+
const OFFLINE_CACHE = 'meith-offline-v1'
|
|
5
|
+
|
|
3
6
|
function readPayload(event) {
|
|
4
7
|
if (!event.data) return null
|
|
5
8
|
|
|
@@ -28,12 +31,49 @@ function targetUrl(href) {
|
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
self.addEventListener('install', () => {
|
|
34
|
+
self.addEventListener('install', (event) => {
|
|
32
35
|
self.skipWaiting()
|
|
36
|
+
|
|
37
|
+
event.waitUntil(
|
|
38
|
+
fetch(OFFLINE_URL, { cache: 'reload' })
|
|
39
|
+
.then((response) => {
|
|
40
|
+
if (!response.ok) return
|
|
41
|
+
return caches.open(OFFLINE_CACHE).then((cache) => cache.put(OFFLINE_URL, response))
|
|
42
|
+
})
|
|
43
|
+
.catch(() => {}),
|
|
44
|
+
)
|
|
33
45
|
})
|
|
34
46
|
|
|
35
47
|
self.addEventListener('activate', (event) => {
|
|
36
|
-
event.waitUntil(
|
|
48
|
+
event.waitUntil(
|
|
49
|
+
caches
|
|
50
|
+
.keys()
|
|
51
|
+
.then((keys) =>
|
|
52
|
+
Promise.all(
|
|
53
|
+
keys
|
|
54
|
+
.filter((key) => key.startsWith('meith-offline-') && key !== OFFLINE_CACHE)
|
|
55
|
+
.map((key) => caches.delete(key)),
|
|
56
|
+
),
|
|
57
|
+
)
|
|
58
|
+
.catch(() => {})
|
|
59
|
+
.then(() => self.clients.claim()),
|
|
60
|
+
)
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
self.addEventListener('fetch', (event) => {
|
|
64
|
+
if (event.request.mode !== 'navigate') return
|
|
65
|
+
|
|
66
|
+
const retryRequest = event.request.clone()
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
event.respondWith(
|
|
70
|
+
fetch(event.request).catch(() =>
|
|
71
|
+
caches.match(OFFLINE_URL).then((cached) => cached || fetch(retryRequest)),
|
|
72
|
+
),
|
|
73
|
+
)
|
|
74
|
+
} catch (_error) {
|
|
75
|
+
event.respondWith(fetch(retryRequest))
|
|
76
|
+
}
|
|
37
77
|
})
|
|
38
78
|
|
|
39
79
|
self.addEventListener('push', (event) => {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useActionState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
6
|
+
import { deleteDraftAction } from '@/server/content-actions'
|
|
7
|
+
|
|
8
|
+
import { FormError, PendingButton } from '../auth/form-controls'
|
|
9
|
+
import { ConfirmDialog } from '../shell/confirm-dialog'
|
|
10
|
+
import { type Copy, fromCopy } from '../shell/copy'
|
|
11
|
+
|
|
12
|
+
export function DeleteDraftForm({
|
|
13
|
+
forumId,
|
|
14
|
+
threadId,
|
|
15
|
+
copy,
|
|
16
|
+
}: {
|
|
17
|
+
forumId: number
|
|
18
|
+
threadId: number | null
|
|
19
|
+
copy: Copy
|
|
20
|
+
}) {
|
|
21
|
+
const [state, action] = useActionState(deleteDraftAction, EMPTY_STATE)
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div className="shrink-0">
|
|
25
|
+
<form action={action}>
|
|
26
|
+
<FormError message={state.error} />
|
|
27
|
+
<input type="hidden" name="forumId" value={forumId} />
|
|
28
|
+
{threadId !== null && <input type="hidden" name="threadId" value={threadId} />}
|
|
29
|
+
<PendingButton
|
|
30
|
+
showWorking
|
|
31
|
+
className="inline-flex h-9 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-destructive transition-colors hover:bg-destructive/10 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
32
|
+
>
|
|
33
|
+
{fromCopy(copy, 'draftsPage.delete')}
|
|
34
|
+
</PendingButton>
|
|
35
|
+
</form>
|
|
36
|
+
<ConfirmDialog confirm={state.confirm} action={action} />
|
|
37
|
+
</div>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useActionState } from 'react'
|
|
4
|
+
|
|
5
|
+
import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
6
|
+
import { regenerateFeedTokenAction, revokeFeedTokenAction } from '@/server/feed-token-actions'
|
|
7
|
+
|
|
8
|
+
import { FormError, PendingButton } from '../auth/form-controls'
|
|
9
|
+
import { type Copy, fromCopy } from '../shell/copy'
|
|
10
|
+
|
|
11
|
+
const CARD = 'flex flex-col gap-4 rounded-lg border border-border bg-card p-5'
|
|
12
|
+
|
|
13
|
+
const BUTTON =
|
|
14
|
+
'inline-flex h-9 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'
|
|
15
|
+
|
|
16
|
+
const GHOST_BUTTON =
|
|
17
|
+
'inline-flex h-9 items-center justify-center rounded-md border border-border bg-background px-4 text-sm font-medium transition-opacity hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring'
|
|
18
|
+
|
|
19
|
+
const REVEAL_CODE = 'block overflow-x-auto rounded-sm bg-card px-2 py-1 font-mono text-xs'
|
|
20
|
+
|
|
21
|
+
export function FeedTokenPanel({
|
|
22
|
+
active,
|
|
23
|
+
detail,
|
|
24
|
+
copy,
|
|
25
|
+
}: {
|
|
26
|
+
active: boolean
|
|
27
|
+
detail: string | null
|
|
28
|
+
copy: Copy
|
|
29
|
+
}) {
|
|
30
|
+
const [genState, genAction] = useActionState(regenerateFeedTokenAction, EMPTY_STATE)
|
|
31
|
+
const [revState, revAction] = useActionState(revokeFeedTokenAction, EMPTY_STATE)
|
|
32
|
+
|
|
33
|
+
const reveal = genState.notice === 'feed:issued' ? genState.values : undefined
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<section className={CARD}>
|
|
37
|
+
<div className="flex flex-col gap-1">
|
|
38
|
+
<h2 className="text-lg font-semibold tracking-tight">
|
|
39
|
+
{fromCopy(copy, 'accountForm.feed.title')}
|
|
40
|
+
</h2>
|
|
41
|
+
<p className="text-sm text-muted-foreground">{fromCopy(copy, 'accountForm.feed.blurb')}</p>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<FormError message={genState.error ?? revState.error} />
|
|
45
|
+
|
|
46
|
+
{reveal?.token !== undefined && (
|
|
47
|
+
<div
|
|
48
|
+
role="status"
|
|
49
|
+
className="flex flex-col gap-2 rounded-md border border-accent bg-post-highlight px-3 py-3"
|
|
50
|
+
>
|
|
51
|
+
<p className="text-sm font-semibold">{fromCopy(copy, 'accountForm.feed.copyNow')}</p>
|
|
52
|
+
<code className="block overflow-x-auto rounded-sm bg-card px-2 py-1 font-mono text-sm">
|
|
53
|
+
{reveal.token}
|
|
54
|
+
</code>
|
|
55
|
+
<p className="text-sm font-medium">{fromCopy(copy, 'accountForm.feed.rssLabel')}</p>
|
|
56
|
+
<code className={REVEAL_CODE}>{reveal.rssUrl}</code>
|
|
57
|
+
<p className="text-sm font-medium">{fromCopy(copy, 'accountForm.feed.atomLabel')}</p>
|
|
58
|
+
<code className={REVEAL_CODE}>{reveal.atomUrl}</code>
|
|
59
|
+
<p className="text-xs text-muted-foreground">
|
|
60
|
+
{fromCopy(copy, 'accountForm.feed.revealHint')}
|
|
61
|
+
</p>
|
|
62
|
+
</div>
|
|
63
|
+
)}
|
|
64
|
+
|
|
65
|
+
<p className="text-sm">
|
|
66
|
+
{active
|
|
67
|
+
? fromCopy(copy, 'accountForm.feed.active')
|
|
68
|
+
: fromCopy(copy, 'accountForm.feed.none')}
|
|
69
|
+
{active && detail !== null && (
|
|
70
|
+
<span className="mt-1 block text-xs text-muted-foreground">{detail}</span>
|
|
71
|
+
)}
|
|
72
|
+
</p>
|
|
73
|
+
|
|
74
|
+
<p className="text-xs text-muted-foreground">{fromCopy(copy, 'accountForm.feed.warning')}</p>
|
|
75
|
+
|
|
76
|
+
<div className="flex flex-wrap gap-3">
|
|
77
|
+
<form action={genAction}>
|
|
78
|
+
<PendingButton showWorking className={BUTTON}>
|
|
79
|
+
{active
|
|
80
|
+
? fromCopy(copy, 'accountForm.feed.regenerate')
|
|
81
|
+
: fromCopy(copy, 'accountForm.feed.generate')}
|
|
82
|
+
</PendingButton>
|
|
83
|
+
</form>
|
|
84
|
+
|
|
85
|
+
{active && (
|
|
86
|
+
<form action={revAction}>
|
|
87
|
+
<PendingButton showWorking className={GHOST_BUTTON}>
|
|
88
|
+
{fromCopy(copy, 'accountForm.feed.revoke')}
|
|
89
|
+
</PendingButton>
|
|
90
|
+
</form>
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
</section>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { useActionState } from 'react'
|
|
4
4
|
|
|
5
|
+
import { textLinkVariants } from '@meith/ui'
|
|
6
|
+
|
|
5
7
|
import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
6
8
|
import {
|
|
7
9
|
markAllNotificationsReadAction,
|
|
@@ -9,6 +11,7 @@ import {
|
|
|
9
11
|
saveMassMailOptInAction,
|
|
10
12
|
saveNotificationPreferencesAction,
|
|
11
13
|
} from '@/server/notification-actions'
|
|
14
|
+
import { saveBoardDigestCadenceAction } from '@/server/usercp-actions'
|
|
12
15
|
|
|
13
16
|
import { FormError, PendingButton } from '../auth/form-controls'
|
|
14
17
|
import { type Copy, fromCopy } from '../shell/copy'
|
|
@@ -16,8 +19,7 @@ import { type Copy, fromCopy } from '../shell/copy'
|
|
|
16
19
|
const BUTTON =
|
|
17
20
|
'inline-flex h-9 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'
|
|
18
21
|
|
|
19
|
-
const LINK_BUTTON =
|
|
20
|
-
'text-sm 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'
|
|
22
|
+
const LINK_BUTTON = `${textLinkVariants({ size: 'sm' })} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`
|
|
21
23
|
|
|
22
24
|
export function MarkNotificationReadForm({
|
|
23
25
|
notificationId,
|
|
@@ -200,3 +202,36 @@ export function AnnouncementsOptInForm({ optedIn, copy }: { optedIn: boolean; co
|
|
|
200
202
|
</form>
|
|
201
203
|
)
|
|
202
204
|
}
|
|
205
|
+
|
|
206
|
+
const FIELD =
|
|
207
|
+
'w-full max-w-xs rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring'
|
|
208
|
+
|
|
209
|
+
export function BoardDigestCadenceForm({ cadence, copy }: { cadence: string; copy: Copy }) {
|
|
210
|
+
const [state, action] = useActionState(saveBoardDigestCadenceAction, EMPTY_STATE)
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
<form
|
|
214
|
+
action={action}
|
|
215
|
+
className="flex flex-col gap-4 rounded-lg border border-border bg-card p-5"
|
|
216
|
+
>
|
|
217
|
+
<FormError message={state.error} />
|
|
218
|
+
|
|
219
|
+
<label className="flex flex-col gap-1 text-sm">
|
|
220
|
+
<span className="font-medium">{fromCopy(copy, 'accountForm.boardDigest.legend')}</span>
|
|
221
|
+
<span className="text-xs text-muted-foreground">
|
|
222
|
+
{fromCopy(copy, 'accountForm.boardDigest.description')}
|
|
223
|
+
</span>
|
|
224
|
+
<select name="cadence" defaultValue={cadence} className={FIELD}>
|
|
225
|
+
<option value="weekly">{fromCopy(copy, 'accountForm.boardDigest.weekly')}</option>
|
|
226
|
+
<option value="monthly">{fromCopy(copy, 'accountForm.boardDigest.monthly')}</option>
|
|
227
|
+
</select>
|
|
228
|
+
</label>
|
|
229
|
+
|
|
230
|
+
<div>
|
|
231
|
+
<PendingButton showWorking className={BUTTON}>
|
|
232
|
+
{fromCopy(copy, 'accountForm.boardDigest.submit')}
|
|
233
|
+
</PendingButton>
|
|
234
|
+
</div>
|
|
235
|
+
</form>
|
|
236
|
+
)
|
|
237
|
+
}
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { useActionState } from 'react'
|
|
4
4
|
|
|
5
|
+
import { textLinkVariants } from '@meith/ui'
|
|
6
|
+
|
|
5
7
|
import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
6
8
|
import { removeRelationAction, setRelationAction } from '@/server/relation-actions'
|
|
7
9
|
|
|
8
10
|
import { FormError, PendingButton } from '../auth/form-controls'
|
|
9
11
|
|
|
10
|
-
const LINK_BUTTON =
|
|
11
|
-
'text-sm 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'
|
|
12
|
+
const LINK_BUTTON = `${textLinkVariants({ size: 'sm' })} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`
|
|
12
13
|
|
|
13
14
|
const QUIET_BUTTON =
|
|
14
15
|
'text-sm text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { useActionState } from 'react'
|
|
3
|
+
import { useActionState, useEffect, useState } from 'react'
|
|
4
4
|
|
|
5
5
|
import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
6
6
|
import {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from '@/server/subscription-actions'
|
|
11
11
|
|
|
12
12
|
import { FormError, PendingButton } from '../auth/form-controls'
|
|
13
|
+
import { ProgressiveMarker } from '../content/progressive-marker'
|
|
13
14
|
import { type Copy, fromCopy } from '../shell/copy'
|
|
14
15
|
|
|
15
16
|
const BUTTON =
|
|
@@ -48,6 +49,17 @@ export function FollowForm({
|
|
|
48
49
|
}) {
|
|
49
50
|
const [state, action] = useActionState(subscribeAction, EMPTY_STATE)
|
|
50
51
|
const [stopState, stopAction] = useActionState(unsubscribeAction, EMPTY_STATE)
|
|
52
|
+
const [resolved, setResolved] = useState<boolean | null>(null)
|
|
53
|
+
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (state.subscribed !== undefined) setResolved(state.subscribed)
|
|
56
|
+
}, [state])
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (stopState.subscribed !== undefined) setResolved(stopState.subscribed)
|
|
60
|
+
}, [stopState])
|
|
61
|
+
|
|
62
|
+
const subscribed = resolved ?? mode !== null
|
|
51
63
|
|
|
52
64
|
return (
|
|
53
65
|
<section aria-label={label} className="flex flex-col gap-2">
|
|
@@ -58,10 +70,11 @@ export function FollowForm({
|
|
|
58
70
|
<input type="hidden" name="target" value={target} />
|
|
59
71
|
<input type="hidden" name="targetId" value={targetId} />
|
|
60
72
|
<input type="hidden" name="back" value={back} />
|
|
73
|
+
<ProgressiveMarker />
|
|
61
74
|
|
|
62
75
|
<label className="text-sm">
|
|
63
76
|
<span className="mr-2">
|
|
64
|
-
{
|
|
77
|
+
{subscribed ? fromCopy(copy, 'accountForm.follow.notifyMe') : label}
|
|
65
78
|
</span>
|
|
66
79
|
<select
|
|
67
80
|
name="mode"
|
|
@@ -78,17 +91,18 @@ export function FollowForm({
|
|
|
78
91
|
</label>
|
|
79
92
|
|
|
80
93
|
<PendingButton className={QUIET_BUTTON}>
|
|
81
|
-
{
|
|
82
|
-
? fromCopy(copy, 'accountForm.follow.
|
|
83
|
-
: fromCopy(copy, 'accountForm.follow.
|
|
94
|
+
{subscribed
|
|
95
|
+
? fromCopy(copy, 'accountForm.follow.save')
|
|
96
|
+
: fromCopy(copy, 'accountForm.follow.follow')}
|
|
84
97
|
</PendingButton>
|
|
85
98
|
</form>
|
|
86
99
|
|
|
87
|
-
{
|
|
100
|
+
{subscribed && (
|
|
88
101
|
<form action={stopAction}>
|
|
89
102
|
<input type="hidden" name="target" value={target} />
|
|
90
103
|
<input type="hidden" name="targetId" value={targetId} />
|
|
91
104
|
<input type="hidden" name="back" value={back} />
|
|
105
|
+
<ProgressiveMarker />
|
|
92
106
|
<PendingButton className={GHOST_BUTTON}>
|
|
93
107
|
{fromCopy(copy, 'accountForm.follow.stop')}
|
|
94
108
|
</PendingButton>
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { useActionState } from 'react'
|
|
4
4
|
|
|
5
|
+
import type { SubscriptionMode } from '@meith/subscriptions'
|
|
6
|
+
|
|
5
7
|
import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
6
8
|
import {
|
|
7
9
|
changePasswordAction,
|
|
@@ -132,6 +134,9 @@ export function OptionsForm({
|
|
|
132
134
|
postsPerPage,
|
|
133
135
|
threadsPerPage,
|
|
134
136
|
invisible,
|
|
137
|
+
autoWatchOwnThreads,
|
|
138
|
+
autoWatchRepliedThreads,
|
|
139
|
+
autoWatchChoices,
|
|
135
140
|
copy,
|
|
136
141
|
}: {
|
|
137
142
|
timezone: string
|
|
@@ -141,6 +146,9 @@ export function OptionsForm({
|
|
|
141
146
|
postsPerPage: string
|
|
142
147
|
threadsPerPage: string
|
|
143
148
|
invisible: boolean
|
|
149
|
+
autoWatchOwnThreads: SubscriptionMode
|
|
150
|
+
autoWatchRepliedThreads: SubscriptionMode
|
|
151
|
+
autoWatchChoices: readonly { value: SubscriptionMode; label: string }[]
|
|
144
152
|
copy: Copy
|
|
145
153
|
}) {
|
|
146
154
|
const [state, action] = useActionState(saveOptionsAction, EMPTY_STATE)
|
|
@@ -213,6 +221,42 @@ export function OptionsForm({
|
|
|
213
221
|
</span>
|
|
214
222
|
</label>
|
|
215
223
|
|
|
224
|
+
<label className="flex flex-col gap-1 text-sm">
|
|
225
|
+
<span className="font-medium">
|
|
226
|
+
{fromCopy(copy, 'accountForm.options.autoWatchOwnThreads')}
|
|
227
|
+
</span>
|
|
228
|
+
<select name="autoWatchOwnThreads" defaultValue={autoWatchOwnThreads} className={FIELD}>
|
|
229
|
+
{autoWatchChoices.map((choice) => (
|
|
230
|
+
<option key={choice.value} value={choice.value}>
|
|
231
|
+
{choice.label}
|
|
232
|
+
</option>
|
|
233
|
+
))}
|
|
234
|
+
</select>
|
|
235
|
+
<span className="text-xs text-muted-foreground">
|
|
236
|
+
{fromCopy(copy, 'accountForm.options.autoWatchOwnThreadsHint')}
|
|
237
|
+
</span>
|
|
238
|
+
</label>
|
|
239
|
+
|
|
240
|
+
<label className="flex flex-col gap-1 text-sm">
|
|
241
|
+
<span className="font-medium">
|
|
242
|
+
{fromCopy(copy, 'accountForm.options.autoWatchRepliedThreads')}
|
|
243
|
+
</span>
|
|
244
|
+
<select
|
|
245
|
+
name="autoWatchRepliedThreads"
|
|
246
|
+
defaultValue={autoWatchRepliedThreads}
|
|
247
|
+
className={FIELD}
|
|
248
|
+
>
|
|
249
|
+
{autoWatchChoices.map((choice) => (
|
|
250
|
+
<option key={choice.value} value={choice.value}>
|
|
251
|
+
{choice.label}
|
|
252
|
+
</option>
|
|
253
|
+
))}
|
|
254
|
+
</select>
|
|
255
|
+
<span className="text-xs text-muted-foreground">
|
|
256
|
+
{fromCopy(copy, 'accountForm.options.autoWatchRepliedThreadsHint')}
|
|
257
|
+
</span>
|
|
258
|
+
</label>
|
|
259
|
+
|
|
216
260
|
<div>
|
|
217
261
|
<PendingButton showWorking className={BUTTON}>
|
|
218
262
|
{fromCopy(copy, 'accountForm.options.submit')}
|
|
@@ -6,6 +6,7 @@ import { issueApiTokenAction, revokeApiTokenAction } from '@/server/api-token-ac
|
|
|
6
6
|
import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
7
7
|
|
|
8
8
|
import { FormError, SubmitButton } from '../auth/form-controls'
|
|
9
|
+
import { ConfirmDialog } from '../shell/confirm-dialog'
|
|
9
10
|
import { type Copy, fromCopy } from '../shell/copy'
|
|
10
11
|
|
|
11
12
|
export function IssueTokenForm({ scopes, copy }: { scopes: readonly string[]; copy: Copy }) {
|
|
@@ -78,12 +79,15 @@ export function RevokeTokenForm({ tokenId, copy }: { tokenId: number; copy: Copy
|
|
|
78
79
|
const [state, action] = useActionState(revokeApiTokenAction, EMPTY_STATE)
|
|
79
80
|
|
|
80
81
|
return (
|
|
81
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
<>
|
|
83
|
+
<form action={action}>
|
|
84
|
+
<input type="hidden" name="tokenId" value={tokenId} />
|
|
85
|
+
<SubmitButton>{fromCopy(copy, 'adminPanel.token.revoke')}</SubmitButton>
|
|
86
|
+
{state.error !== undefined && (
|
|
87
|
+
<span className="ml-2 text-xs text-destructive">{state.error}</span>
|
|
88
|
+
)}
|
|
89
|
+
</form>
|
|
90
|
+
<ConfirmDialog confirm={state.confirm} action={action} />
|
|
91
|
+
</>
|
|
88
92
|
)
|
|
89
93
|
}
|
|
@@ -6,6 +6,7 @@ import { EMPTY_STATE } from '@/server/auth-form-state'
|
|
|
6
6
|
import { addBanFilterAction, removeBanFilterAction } from '@/server/ban-filter-admin-actions'
|
|
7
7
|
|
|
8
8
|
import { FormError, PendingButton, SubmitButton } from '../auth/form-controls'
|
|
9
|
+
import { ConfirmDialog } from '../shell/confirm-dialog'
|
|
9
10
|
import { type Copy, formatFromCopy, fromCopy } from '../shell/copy'
|
|
10
11
|
import { INPUT, Saved } from './form-bits'
|
|
11
12
|
|
|
@@ -89,16 +90,19 @@ export function RemoveBanFilterForm({
|
|
|
89
90
|
const [state, action] = useActionState(removeBanFilterAction, EMPTY_STATE)
|
|
90
91
|
|
|
91
92
|
return (
|
|
92
|
-
<
|
|
93
|
-
<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
<div className="flex flex-col items-end gap-1">
|
|
94
|
+
<form action={action} className="flex flex-col items-end gap-1">
|
|
95
|
+
<FormError message={state.error} />
|
|
96
|
+
<input type="hidden" name="id" value={id} />
|
|
97
|
+
<PendingButton
|
|
98
|
+
showWorking
|
|
99
|
+
className="text-xs text-destructive hover:underline"
|
|
100
|
+
aria-label={formatFromCopy(copy, 'adminBanFilter.removeFilter', { pattern })}
|
|
101
|
+
>
|
|
102
|
+
{fromCopy(copy, 'admin.remove')}
|
|
103
|
+
</PendingButton>
|
|
104
|
+
</form>
|
|
105
|
+
<ConfirmDialog confirm={state.confirm} action={action} />
|
|
106
|
+
</div>
|
|
103
107
|
)
|
|
104
108
|
}
|