@meith/web 0.23.1 → 0.23.3
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]/new/page.tsx +7 -5
- package/app/(board)/thread/[slug]/edit/page.tsx +7 -5
- package/app/(board)/thread/[slug]/page.tsx +19 -1
- package/app/(board)/thread/[slug]/reply/page.tsx +7 -5
- package/app/(board)/usercp/security/verify/page.tsx +3 -0
- package/app/admin/layout.tsx +4 -4
- package/package.json +48 -48
- package/src/components/account/credential-proof-form.tsx +14 -4
- package/src/components/account/two-factor-forms.tsx +4 -4
- package/src/components/admin/admin-forms.tsx +8 -13
- package/src/components/admin/badge-forms.tsx +6 -7
- package/src/components/admin/branding-forms.tsx +5 -10
- package/src/components/admin/form-bits.tsx +6 -4
- package/src/components/admin/forum-forms.tsx +180 -78
- package/src/components/admin/mail-test-card.tsx +2 -5
- package/src/components/admin/marketplace-forms.tsx +4 -5
- package/src/components/admin/marketplace-listing.tsx +1 -1
- package/src/components/admin/plugin-forms.tsx +2 -6
- package/src/components/admin/settings-form.tsx +2 -6
- package/src/components/admin/system-forms.tsx +2 -5
- package/src/components/auth/otp-field.tsx +142 -0
- package/src/components/auth/second-factor-form.tsx +4 -3
- package/src/components/content/composer-recovery.tsx +19 -1
- package/src/components/content/edit-post-form.tsx +3 -2
- package/src/components/content/markdown-editor.tsx +123 -104
- package/src/components/content/new-thread-form.tsx +3 -2
- package/src/components/content/reply-form.tsx +3 -2
- package/src/components/moderation/thread-surgery-form.tsx +51 -47
- package/src/components/moderation/thread-tools-form.tsx +67 -87
- package/src/server/marketplace-admin.ts +2 -2
- package/src/server/upgrade-notice.ts +1 -1
- package/src/theme/contract.fixture.ts +2 -2
- package/src/view/account-copy.ts +2 -0
- package/src/view/admin-copy.ts +9 -0
- package/src/view/admin-panel-copy.ts +2 -0
- package/src/view/auth-copy.ts +17 -10
- package/src/view/content-copy.ts +11 -6
- package/src/view/forum-display.ts +1 -0
|
@@ -11,36 +11,6 @@ import { type Copy, fromCopy } from '../shell/copy'
|
|
|
11
11
|
const BUTTON =
|
|
12
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
13
|
|
|
14
|
-
function ToolButton({
|
|
15
|
-
threadId,
|
|
16
|
-
tool,
|
|
17
|
-
label,
|
|
18
|
-
destructive,
|
|
19
|
-
}: {
|
|
20
|
-
threadId: number
|
|
21
|
-
tool: string
|
|
22
|
-
label: string
|
|
23
|
-
destructive?: boolean
|
|
24
|
-
}) {
|
|
25
|
-
const [state, action] = useActionState(threadToolAction, EMPTY_STATE)
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<form action={action} className="inline">
|
|
29
|
-
<FormError message={state.error} />
|
|
30
|
-
<input type="hidden" name="threadId" value={threadId} />
|
|
31
|
-
<input type="hidden" name="tool" value={tool} />
|
|
32
|
-
<button
|
|
33
|
-
type="submit"
|
|
34
|
-
className={
|
|
35
|
-
destructive === true ? `${BUTTON} border-destructive/40 text-destructive` : BUTTON
|
|
36
|
-
}
|
|
37
|
-
>
|
|
38
|
-
{label}
|
|
39
|
-
</button>
|
|
40
|
-
</form>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
14
|
export interface MoveOption {
|
|
45
15
|
readonly id: number
|
|
46
16
|
readonly title: string
|
|
@@ -65,73 +35,83 @@ export function ThreadToolsForm({
|
|
|
65
35
|
copy: Copy
|
|
66
36
|
children?: React.ReactNode
|
|
67
37
|
}) {
|
|
68
|
-
const [
|
|
38
|
+
const [state, action] = useActionState(threadToolAction, EMPTY_STATE)
|
|
69
39
|
|
|
70
40
|
return (
|
|
71
41
|
<section
|
|
72
42
|
aria-label={heading}
|
|
73
|
-
className="flex flex-
|
|
43
|
+
className="flex flex-col gap-2 rounded-lg border border-border bg-secondary px-4 py-3"
|
|
74
44
|
>
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
{rights.lock && (
|
|
78
|
-
<ToolButton
|
|
79
|
-
threadId={threadId}
|
|
80
|
-
tool={isLocked ? 'unlock' : 'lock'}
|
|
81
|
-
label={
|
|
82
|
-
isLocked
|
|
83
|
-
? fromCopy(copy, 'moderationForm.tool.unlock')
|
|
84
|
-
: fromCopy(copy, 'moderationForm.tool.lock')
|
|
85
|
-
}
|
|
86
|
-
/>
|
|
87
|
-
)}
|
|
88
|
-
{rights.stick && (
|
|
89
|
-
<ToolButton
|
|
90
|
-
threadId={threadId}
|
|
91
|
-
tool={isSticky ? 'unstick' : 'stick'}
|
|
92
|
-
label={
|
|
93
|
-
isSticky
|
|
94
|
-
? fromCopy(copy, 'moderationForm.tool.unpin')
|
|
95
|
-
: fromCopy(copy, 'moderationForm.tool.pin')
|
|
96
|
-
}
|
|
97
|
-
/>
|
|
98
|
-
)}
|
|
99
|
-
{rights.delete && (
|
|
100
|
-
<ToolButton
|
|
101
|
-
threadId={threadId}
|
|
102
|
-
tool="delete"
|
|
103
|
-
label={fromCopy(copy, 'moderationForm.tool.deleteThread')}
|
|
104
|
-
destructive
|
|
105
|
-
/>
|
|
106
|
-
)}
|
|
45
|
+
<div className="flex flex-wrap items-center gap-3">
|
|
46
|
+
<span className="text-xs font-medium text-muted-foreground">{heading}</span>
|
|
107
47
|
|
|
108
|
-
|
|
109
|
-
<form action={moveAction} className="flex items-center gap-2">
|
|
110
|
-
<FormError message={moveState.error} />
|
|
48
|
+
<form action={action} className="flex flex-wrap items-center gap-3">
|
|
111
49
|
<input type="hidden" name="threadId" value={threadId} />
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
50
|
+
|
|
51
|
+
{rights.lock && (
|
|
52
|
+
<button
|
|
53
|
+
type="submit"
|
|
54
|
+
name="tool"
|
|
55
|
+
value={isLocked ? 'unlock' : 'lock'}
|
|
56
|
+
className={BUTTON}
|
|
57
|
+
>
|
|
58
|
+
{isLocked
|
|
59
|
+
? fromCopy(copy, 'moderationForm.tool.unlock')
|
|
60
|
+
: fromCopy(copy, 'moderationForm.tool.lock')}
|
|
61
|
+
</button>
|
|
62
|
+
)}
|
|
63
|
+
{rights.stick && (
|
|
64
|
+
<button
|
|
65
|
+
type="submit"
|
|
66
|
+
name="tool"
|
|
67
|
+
value={isSticky ? 'unstick' : 'stick'}
|
|
68
|
+
className={BUTTON}
|
|
117
69
|
>
|
|
118
|
-
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
70
|
+
{isSticky
|
|
71
|
+
? fromCopy(copy, 'moderationForm.tool.unpin')
|
|
72
|
+
: fromCopy(copy, 'moderationForm.tool.pin')}
|
|
73
|
+
</button>
|
|
74
|
+
)}
|
|
75
|
+
{rights.delete && (
|
|
76
|
+
<button
|
|
77
|
+
type="submit"
|
|
78
|
+
name="tool"
|
|
79
|
+
value="delete"
|
|
80
|
+
className={`${BUTTON} border-destructive/40 text-destructive`}
|
|
81
|
+
>
|
|
82
|
+
{fromCopy(copy, 'moderationForm.tool.deleteThread')}
|
|
83
|
+
</button>
|
|
84
|
+
)}
|
|
85
|
+
|
|
86
|
+
{rights.move && moveTargets.length > 0 && (
|
|
87
|
+
<span className="flex items-center gap-2">
|
|
88
|
+
<label className="flex items-center gap-2 text-xs">
|
|
89
|
+
<span className="sr-only">{fromCopy(copy, 'moderationForm.moveTo')}</span>
|
|
90
|
+
<select
|
|
91
|
+
name="toForumId"
|
|
92
|
+
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"
|
|
93
|
+
>
|
|
94
|
+
{moveTargets.map((forum) => (
|
|
95
|
+
<option key={forum.id} value={forum.id}>
|
|
96
|
+
{forum.title}
|
|
97
|
+
</option>
|
|
98
|
+
))}
|
|
99
|
+
</select>
|
|
100
|
+
</label>
|
|
101
|
+
<button type="submit" name="tool" value="move" className={BUTTON}>
|
|
102
|
+
{fromCopy(copy, 'moderationForm.tool.move')}
|
|
103
|
+
</button>
|
|
104
|
+
<button type="submit" name="tool" value="copy" className={BUTTON}>
|
|
105
|
+
{fromCopy(copy, 'moderationForm.tool.copy')}
|
|
106
|
+
</button>
|
|
107
|
+
</span>
|
|
108
|
+
)}
|
|
131
109
|
</form>
|
|
132
|
-
)}
|
|
133
110
|
|
|
134
|
-
|
|
111
|
+
{children}
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<FormError message={state.error} />
|
|
135
115
|
</section>
|
|
136
116
|
)
|
|
137
117
|
}
|
|
@@ -93,12 +93,12 @@ export interface MarketplaceCatalogView {
|
|
|
93
93
|
function installSteps(kind: ListingKind, packageName: string): readonly string[] {
|
|
94
94
|
return kind === 'plugin'
|
|
95
95
|
? [
|
|
96
|
-
`
|
|
96
|
+
`npm install ${packageName}`,
|
|
97
97
|
`community plugin:add ${packageName}`,
|
|
98
98
|
'Rebuild and redeploy for it to take effect.',
|
|
99
99
|
]
|
|
100
100
|
: [
|
|
101
|
-
`
|
|
101
|
+
`npm install ${packageName}`,
|
|
102
102
|
'Register it in community.config.ts (and set it as defaultTheme if it should be the board default).',
|
|
103
103
|
'Rebuild and redeploy for it to take effect.',
|
|
104
104
|
]
|
|
@@ -6,7 +6,7 @@ import { planUpgrade, type UpgradeState, upgradeNotice } from '@meith/upgrade'
|
|
|
6
6
|
|
|
7
7
|
import { activeDefinitions } from './plugin-host'
|
|
8
8
|
|
|
9
|
-
export const CODE_VERSION = '0.23.
|
|
9
|
+
export const CODE_VERSION = '0.23.3'
|
|
10
10
|
|
|
11
11
|
export async function pendingUpgradeNotice(): Promise<string | null> {
|
|
12
12
|
if (env.DATA_SOURCE !== 'postgres') return null
|
|
@@ -326,8 +326,8 @@ export const SLOT_FIXTURES: { readonly [K in SlotName]?: SlotFixture<K> } = {
|
|
|
326
326
|
},
|
|
327
327
|
|
|
328
328
|
ThreadRow: {
|
|
329
|
-
model: { thread: THREAD, select: null },
|
|
330
|
-
requires: ['Bikeshedding the bike shed', '/thread/91-bikeshedding', '27'],
|
|
329
|
+
model: { thread: { ...THREAD, visibility: 'deleted' }, select: null },
|
|
330
|
+
requires: ['Bikeshedding the bike shed', '/thread/91-bikeshedding', '27', 'data-visibility'],
|
|
331
331
|
},
|
|
332
332
|
|
|
333
333
|
SubforumList: {
|
package/src/view/account-copy.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Translator } from '@meith/i18n'
|
|
2
2
|
|
|
3
|
+
import { otpFieldCopy } from './auth-copy'
|
|
3
4
|
import { copyFor, splitAround } from './copy'
|
|
4
5
|
import { untranslated } from './time'
|
|
5
6
|
|
|
@@ -201,6 +202,7 @@ export function twoFactorFormsCopy(
|
|
|
201
202
|
'accountForm.twoFactor.codes': t.t('accountForm.twoFactor.codes', {
|
|
202
203
|
count: recoveryCodesLeft,
|
|
203
204
|
}),
|
|
205
|
+
...otpFieldCopy(t),
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
208
|
|
package/src/view/admin-copy.ts
CHANGED
|
@@ -55,6 +55,14 @@ export function forumAdminCopy(t: Translator = untranslated()): Readonly<Record<
|
|
|
55
55
|
'adminForum.perm.grant',
|
|
56
56
|
'adminForum.perm.deny',
|
|
57
57
|
'adminForum.perm.ancestor',
|
|
58
|
+
'adminForum.permGroup.viewing',
|
|
59
|
+
'adminForum.permGroup.posting',
|
|
60
|
+
'adminForum.permGroup.ownContent',
|
|
61
|
+
'adminForum.permGroup.moderation',
|
|
62
|
+
'adminForum.permGroup.attachments',
|
|
63
|
+
'adminForum.permGroup.approvals',
|
|
64
|
+
'adminForum.permGroup.other',
|
|
65
|
+
'adminForum.inheritsAll',
|
|
58
66
|
'adminForum.copied',
|
|
59
67
|
'adminForum.copyNote',
|
|
60
68
|
'adminForum.topLevel',
|
|
@@ -99,6 +107,7 @@ export function forumAdminCopy(t: Translator = untranslated()): Readonly<Record<
|
|
|
99
107
|
'adminForum.perm.inheritedFrom',
|
|
100
108
|
'adminForum.saveGroup',
|
|
101
109
|
'adminForum.copyTo',
|
|
110
|
+
'adminForum.overridesSet',
|
|
102
111
|
],
|
|
103
112
|
t,
|
|
104
113
|
),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Translator } from '@meith/i18n'
|
|
2
2
|
|
|
3
3
|
import { adminSharedCopy } from './admin-copy'
|
|
4
|
+
import { otpFieldCopy } from './auth-copy'
|
|
4
5
|
import { copyFor, patternCopy, splitAround } from './copy'
|
|
5
6
|
import { untranslated } from './time'
|
|
6
7
|
|
|
@@ -21,6 +22,7 @@ export function adminFormsCopy(t: Translator = untranslated()): Readonly<Record<
|
|
|
21
22
|
t,
|
|
22
23
|
),
|
|
23
24
|
...patternCopy(['adminPanel.idleNote'], t),
|
|
25
|
+
...otpFieldCopy(t),
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
|
package/src/view/auth-copy.ts
CHANGED
|
@@ -79,19 +79,26 @@ export function resendVerificationFormCopy(
|
|
|
79
79
|
return copyFor(['authForm.email', 'authForm.resend.submit'], t)
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
export function otpFieldCopy(t: Translator = untranslated()): Readonly<Record<string, string>> {
|
|
83
|
+
return copyFor(['otp.recoveryLabel', 'otp.useApp', 'otp.useRecovery'], t)
|
|
84
|
+
}
|
|
85
|
+
|
|
82
86
|
export function secondFactorFormCopy(
|
|
83
87
|
t: Translator = untranslated(),
|
|
84
88
|
): Readonly<Record<string, string>> {
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
return {
|
|
90
|
+
...copyFor(
|
|
91
|
+
[
|
|
92
|
+
'authForm.secondFactor.code',
|
|
93
|
+
'authForm.secondFactor.recoveryHint',
|
|
94
|
+
'authForm.secondFactor.recoveryHintExhausted',
|
|
95
|
+
'authForm.secondFactor.submit',
|
|
96
|
+
'authForm.secondFactor.cancel',
|
|
97
|
+
],
|
|
98
|
+
t,
|
|
99
|
+
),
|
|
100
|
+
...otpFieldCopy(t),
|
|
101
|
+
}
|
|
95
102
|
}
|
|
96
103
|
|
|
97
104
|
export function passkeyCopy(t: Translator = untranslated()): Readonly<Record<string, string>> {
|
package/src/view/content-copy.ts
CHANGED
|
@@ -3,16 +3,20 @@ import type { Translator } from '@meith/i18n'
|
|
|
3
3
|
import { copyFor, patternCopy, splitAround } from './copy'
|
|
4
4
|
import { untranslated } from './time'
|
|
5
5
|
|
|
6
|
+
const RECOVERY_KEYS = [
|
|
7
|
+
'composer.autosave.failed',
|
|
8
|
+
'composer.autosave.saved',
|
|
9
|
+
'composer.autosave.saving',
|
|
10
|
+
'composer.recovery.available',
|
|
11
|
+
'composer.recovery.discard',
|
|
12
|
+
'composer.recovery.restore',
|
|
13
|
+
] as const
|
|
14
|
+
|
|
6
15
|
export function replyFormCopy(t: Translator = untranslated()): Readonly<Record<string, string>> {
|
|
7
16
|
return copyFor(
|
|
8
17
|
[
|
|
18
|
+
...RECOVERY_KEYS,
|
|
9
19
|
'composer.draftSaved',
|
|
10
|
-
'composer.autosave.failed',
|
|
11
|
-
'composer.autosave.saved',
|
|
12
|
-
'composer.autosave.saving',
|
|
13
|
-
'composer.recovery.available',
|
|
14
|
-
'composer.recovery.discard',
|
|
15
|
-
'composer.recovery.restore',
|
|
16
20
|
'composer.notifyReplies',
|
|
17
21
|
'composer.reply.submit',
|
|
18
22
|
'composer.reply.write',
|
|
@@ -44,6 +48,7 @@ export function newThreadFormCopy(
|
|
|
44
48
|
return {
|
|
45
49
|
...copyFor(
|
|
46
50
|
[
|
|
51
|
+
...RECOVERY_KEYS,
|
|
47
52
|
'composer.draftSaved',
|
|
48
53
|
'composer.notifyReplies',
|
|
49
54
|
'composer.newThread.subject',
|