memi-board 0.44.0 → 0.45.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/README.md +54 -3
- package/dist/ar-BCQdRw_S.js +622 -0
- package/dist/ar-BCQdRw_S.js.map +1 -0
- package/dist/composables/fetchPublicSeo.d.ts +4 -1
- package/dist/composables/useMemiBoardAutoTranslate.d.ts +33 -0
- package/dist/composables/useMemiBoardModeration.d.ts +5 -1
- package/dist/composables/useMemiBoardReports.d.ts +6 -1
- package/dist/composables/useMemiBoardSections.d.ts +2 -1
- package/dist/composables/useMemiBoardUsers.d.ts +4 -0
- package/dist/composables/useMemiBoardWritingAssistant.d.ts +9 -1
- package/dist/config.d.ts +5 -0
- package/dist/de-ddWQNaqs.js +622 -0
- package/dist/de-ddWQNaqs.js.map +1 -0
- package/dist/en-BVUBLkxc.js +648 -0
- package/dist/en-BVUBLkxc.js.map +1 -0
- package/dist/es-7JHjGVlM.js +622 -0
- package/dist/es-7JHjGVlM.js.map +1 -0
- package/dist/fr-C3NCMNoy.js +622 -0
- package/dist/fr-C3NCMNoy.js.map +1 -0
- package/dist/id-C8hCAMPJ.js +622 -0
- package/dist/id-C8hCAMPJ.js.map +1 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +1218 -1487
- package/dist/index.js.map +1 -1
- package/dist/ja-oTWri4hY.js +622 -0
- package/dist/ja-oTWri4hY.js.map +1 -0
- package/dist/module.mjs +55 -31
- package/dist/module.mjs.map +1 -1
- package/dist/pt-B9EH4scA.js +622 -0
- package/dist/pt-B9EH4scA.js.map +1 -0
- package/dist/runtime/components/Attachments.vue +4 -2
- package/dist/runtime/components/AuthorMenu.vue +14 -12
- package/dist/runtime/components/AvatarCropModal.vue +8 -5
- package/dist/runtime/components/CategorySettings.vue +65 -43
- package/dist/runtime/components/CommentFeed.vue +9 -7
- package/dist/runtime/components/CommentForm.vue +16 -10
- package/dist/runtime/components/CommentItem.vue +25 -26
- package/dist/runtime/components/CommentList.vue +7 -4
- package/dist/runtime/components/CommentThread.vue +7 -5
- package/dist/runtime/components/Detail.vue +20 -15
- package/dist/runtime/components/Editor.vue +145 -135
- package/dist/runtime/components/Footer.vue +14 -13
- package/dist/runtime/components/List.vue +31 -29
- package/dist/runtime/components/ListDefault.vue +4 -3
- package/dist/runtime/components/ListDense.vue +6 -5
- package/dist/runtime/components/ListImage.vue +4 -2
- package/dist/runtime/components/ListVideo.vue +3 -2
- package/dist/runtime/components/ListViewSwitch.vue +10 -6
- package/dist/runtime/components/MiniCard.vue +3 -2
- package/dist/runtime/components/MiniComments.vue +5 -4
- package/dist/runtime/components/MiniList.vue +3 -2
- package/dist/runtime/components/MiniPicker.vue +10 -9
- package/dist/runtime/components/MiniPost.vue +3 -2
- package/dist/runtime/components/MiniPosts.vue +5 -4
- package/dist/runtime/components/Profile.vue +12 -7
- package/dist/runtime/components/ProfileEditModal.vue +14 -13
- package/dist/runtime/components/ReportButton.vue +20 -10
- package/dist/runtime/components/ReportList.vue +11 -10
- package/dist/runtime/components/Section.vue +3 -2
- package/dist/runtime/components/Settings.vue +84 -62
- package/dist/runtime/components/ShareButton.vue +3 -1
- package/dist/runtime/components/SignIn.vue +14 -8
- package/dist/runtime/components/SwipeHint.vue +5 -3
- package/dist/runtime/components/UserCommentList.vue +8 -6
- package/dist/runtime/components/UserPostList.vue +6 -4
- package/dist/runtime/components/Users.vue +16 -10
- package/dist/runtime/composables/useMemiBoardSeo.ts +16 -10
- package/dist/slugify-6bG6GSO_.js +942 -0
- package/dist/slugify-6bG6GSO_.js.map +1 -0
- package/dist/storage.js +72 -71
- package/dist/storage.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/utils/boardSeo.d.ts +5 -5
- package/dist/utils/compressImage.d.ts +2 -1
- package/dist/utils/formatDate.d.ts +6 -4
- package/dist/utils/imeSafeSubmit.d.ts +2 -0
- package/dist/utils/moderation-prompt.d.ts +18 -1
- package/dist/utils/moderation-strike.d.ts +2 -1
- package/dist/utils/section.d.ts +15 -2
- package/dist/zh-D5rDYV6E.js +622 -0
- package/dist/zh-D5rDYV6E.js.map +1 -0
- package/package.json +2 -3
- package/dist/slugify-Cm_pi2al.js +0 -124
- package/dist/slugify-Cm_pi2al.js.map +0 -1
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { computed, ref, resolveComponent } from 'vue'
|
|
3
3
|
import type { BoardListView, PostModel } from 'memi-board/runtime'
|
|
4
4
|
import {
|
|
5
|
-
formatRelativeDate,
|
|
6
5
|
miniPostImage,
|
|
7
6
|
miniPostLink,
|
|
8
7
|
miniPostTitle,
|
|
9
8
|
miniViewGroup,
|
|
9
|
+
useMemiBoardI18n,
|
|
10
10
|
useMemiBoardSettings,
|
|
11
11
|
videoListCoverUrl,
|
|
12
12
|
} from 'memi-board/runtime'
|
|
@@ -21,6 +21,7 @@ const props = defineProps<{
|
|
|
21
21
|
const NuxtLink = resolveComponent('NuxtLink')
|
|
22
22
|
const now = ref(Date.now())
|
|
23
23
|
const { categoryLabel } = useMemiBoardSettings()
|
|
24
|
+
const { formatRelativeDate, locale } = useMemiBoardI18n()
|
|
24
25
|
const group = computed(() => miniViewGroup(props.view))
|
|
25
26
|
|
|
26
27
|
function cover(post: PostModel) {
|
|
@@ -51,7 +52,7 @@ function postTo(post: PostModel) {
|
|
|
51
52
|
<img
|
|
52
53
|
v-if="cover(post)"
|
|
53
54
|
:src="cover(post)"
|
|
54
|
-
:alt="miniPostTitle(post)"
|
|
55
|
+
:alt="miniPostTitle(post, locale)"
|
|
55
56
|
class="size-full object-cover transition duration-300 group-hover:scale-105"
|
|
56
57
|
>
|
|
57
58
|
<div v-else class="flex size-full items-center justify-center text-muted">
|
|
@@ -85,7 +86,7 @@ function postTo(post: PostModel) {
|
|
|
85
86
|
<div class="min-w-0 flex-1">
|
|
86
87
|
<div class="flex min-w-0 items-start gap-1.5">
|
|
87
88
|
<p class="min-w-0 flex-1 truncate text-sm font-medium text-inherit">
|
|
88
|
-
{{ miniPostTitle(post) }}
|
|
89
|
+
{{ miniPostTitle(post, locale) }}
|
|
89
90
|
</p>
|
|
90
91
|
<span class="mt-0.5 inline-flex shrink-0 items-center gap-0.5 text-[11px] tabular-nums text-muted">
|
|
91
92
|
<UIcon name="i-lucide-message-square" class="size-3" />
|
|
@@ -105,7 +106,7 @@ function postTo(post: PostModel) {
|
|
|
105
106
|
>
|
|
106
107
|
<img
|
|
107
108
|
:src="miniPostImage(post)!"
|
|
108
|
-
:alt="miniPostTitle(post)"
|
|
109
|
+
:alt="miniPostTitle(post, locale)"
|
|
109
110
|
class="size-full object-cover"
|
|
110
111
|
>
|
|
111
112
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, ref } from 'vue'
|
|
3
|
-
import {
|
|
3
|
+
import { useMemiBoardAuth, useMemiBoardI18n, useMemiBoardUserProfile } from 'memi-board/runtime'
|
|
4
4
|
import MemiBoardProfileEditModal from './ProfileEditModal.vue'
|
|
5
5
|
|
|
6
6
|
const props = defineProps<{
|
|
@@ -10,7 +10,12 @@ const props = defineProps<{
|
|
|
10
10
|
const { profile, profilePending } = useMemiBoardUserProfile(() => props.uid)
|
|
11
11
|
const now = ref(Date.now())
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const { t, formatRelativeDate } = useMemiBoardI18n()
|
|
14
|
+
|
|
15
|
+
const roleLabel = computed(() => {
|
|
16
|
+
const role = profile.value?.role
|
|
17
|
+
return role === 'admin' || role === 'staff' || role === 'user' ? t(`common.role.${role}`) : undefined
|
|
18
|
+
})
|
|
14
19
|
|
|
15
20
|
const { user } = useMemiBoardAuth()
|
|
16
21
|
const isOwnProfile = computed(() => !!user.value?.uid && user.value.uid === props.uid)
|
|
@@ -33,7 +38,7 @@ const editOpen = ref(false)
|
|
|
33
38
|
v-else-if="!profile"
|
|
34
39
|
class="text-sm text-muted"
|
|
35
40
|
>
|
|
36
|
-
|
|
41
|
+
{{ t('profile.notFound') }}
|
|
37
42
|
</p>
|
|
38
43
|
|
|
39
44
|
<div
|
|
@@ -43,14 +48,14 @@ const editOpen = ref(false)
|
|
|
43
48
|
<div class="flex items-center gap-3">
|
|
44
49
|
<UAvatar
|
|
45
50
|
:src="profile.photoURL ?? undefined"
|
|
46
|
-
:alt="profile.displayName ?? '
|
|
51
|
+
:alt="profile.displayName ?? t('common.label.anonymous')"
|
|
47
52
|
size="xl"
|
|
48
53
|
class="shrink-0"
|
|
49
54
|
/>
|
|
50
55
|
<div class="flex min-w-0 flex-1 flex-col gap-0.5">
|
|
51
56
|
<div class="flex min-w-0 items-center gap-2">
|
|
52
57
|
<h2 class="min-w-0 truncate text-lg font-bold text-highlighted">
|
|
53
|
-
{{ profile.displayName ?? '
|
|
58
|
+
{{ profile.displayName ?? t('profile.noName') }}
|
|
54
59
|
</h2>
|
|
55
60
|
<UBadge
|
|
56
61
|
v-if="roleLabel && profile.role !== 'user'"
|
|
@@ -61,12 +66,12 @@ const editOpen = ref(false)
|
|
|
61
66
|
/>
|
|
62
67
|
</div>
|
|
63
68
|
<p class="text-xs text-muted">
|
|
64
|
-
|
|
69
|
+
{{ t('profile.joined', { time: formatRelativeDate(profile.joinedAt, now) }) }} · {{ t('profile.lastVisit', { time: formatRelativeDate(profile.lastVisitAt, now) }) }}
|
|
65
70
|
</p>
|
|
66
71
|
</div>
|
|
67
72
|
<UButton
|
|
68
73
|
v-if="isOwnProfile"
|
|
69
|
-
label="
|
|
74
|
+
:label="t('common.action.edit')"
|
|
70
75
|
icon="i-lucide-pencil"
|
|
71
76
|
color="neutral"
|
|
72
77
|
variant="outline"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed, ref, watch } from 'vue'
|
|
3
3
|
import { query, serverTimestamp, where, writeBatch, getDocs } from 'firebase/firestore'
|
|
4
4
|
import { useFirestore } from 'vuefire'
|
|
5
|
-
import { boardUserDoc, commentsCol, postsCol, useBoardPathConfig } from 'memi-board/runtime'
|
|
5
|
+
import { boardUserDoc, commentsCol, postsCol, useBoardPathConfig, useMemiBoardI18n } from 'memi-board/runtime'
|
|
6
6
|
import type { BoardUserModel } from 'memi-board/runtime'
|
|
7
7
|
import { useMemiBoardStorage } from 'memi-board/storage'
|
|
8
8
|
import MemiBoardAvatarCropModal from './AvatarCropModal.vue'
|
|
@@ -17,6 +17,7 @@ const props = defineProps<{
|
|
|
17
17
|
const emit = defineEmits<{ saved: [] }>()
|
|
18
18
|
|
|
19
19
|
const db = useFirestore()
|
|
20
|
+
const { t } = useMemiBoardI18n()
|
|
20
21
|
|
|
21
22
|
const displayName = ref('')
|
|
22
23
|
const bio = ref('')
|
|
@@ -47,7 +48,7 @@ function onPickAvatar(event: Event) {
|
|
|
47
48
|
input.value = ''
|
|
48
49
|
if (!file) return
|
|
49
50
|
if (!file.type.startsWith('image/')) {
|
|
50
|
-
error.value = '
|
|
51
|
+
error.value = t('profileEditModal.imageOnly')
|
|
51
52
|
return
|
|
52
53
|
}
|
|
53
54
|
if (cropSrc.value.startsWith('blob:')) URL.revokeObjectURL(cropSrc.value)
|
|
@@ -119,7 +120,7 @@ async function onSave() {
|
|
|
119
120
|
if (saving.value) return
|
|
120
121
|
const trimmedName = displayName.value.trim()
|
|
121
122
|
if (!trimmedName) {
|
|
122
|
-
error.value = '
|
|
123
|
+
error.value = t('profileEditModal.nameRequired')
|
|
123
124
|
return
|
|
124
125
|
}
|
|
125
126
|
saving.value = true
|
|
@@ -139,7 +140,7 @@ async function onSave() {
|
|
|
139
140
|
emit('saved')
|
|
140
141
|
}
|
|
141
142
|
catch (cause) {
|
|
142
|
-
error.value = cause instanceof Error ? cause.message : '
|
|
143
|
+
error.value = cause instanceof Error ? cause.message : t('profileEditModal.saveFailed')
|
|
143
144
|
}
|
|
144
145
|
finally {
|
|
145
146
|
saving.value = false
|
|
@@ -151,7 +152,7 @@ async function onSave() {
|
|
|
151
152
|
<template>
|
|
152
153
|
<UModal
|
|
153
154
|
v-model:open="open"
|
|
154
|
-
title="
|
|
155
|
+
:title="t('profileEditModal.title')"
|
|
155
156
|
:ui="{ content: 'sm:max-w-md' }"
|
|
156
157
|
>
|
|
157
158
|
<template #body>
|
|
@@ -159,11 +160,11 @@ async function onSave() {
|
|
|
159
160
|
<div class="flex items-center gap-3">
|
|
160
161
|
<UAvatar
|
|
161
162
|
:src="avatarPreview"
|
|
162
|
-
:alt="displayName || '
|
|
163
|
+
:alt="displayName || t('common.label.anonymous')"
|
|
163
164
|
size="xl"
|
|
164
165
|
/>
|
|
165
166
|
<UButton
|
|
166
|
-
label="
|
|
167
|
+
:label="t('profileEditModal.changePhoto')"
|
|
167
168
|
icon="i-lucide-camera"
|
|
168
169
|
color="neutral"
|
|
169
170
|
variant="outline"
|
|
@@ -179,21 +180,21 @@ async function onSave() {
|
|
|
179
180
|
>
|
|
180
181
|
</div>
|
|
181
182
|
|
|
182
|
-
<UFormField label="
|
|
183
|
+
<UFormField :label="t('profileEditModal.name')">
|
|
183
184
|
<UInput
|
|
184
185
|
v-model="displayName"
|
|
185
|
-
placeholder="
|
|
186
|
+
:placeholder="t('profileEditModal.name')"
|
|
186
187
|
:maxlength="40"
|
|
187
188
|
class="w-full"
|
|
188
189
|
/>
|
|
189
190
|
</UFormField>
|
|
190
191
|
|
|
191
|
-
<UFormField label="
|
|
192
|
+
<UFormField :label="t('profileEditModal.bio')">
|
|
192
193
|
<UTextarea
|
|
193
194
|
v-model="bio"
|
|
194
195
|
:rows="3"
|
|
195
196
|
:maxlength="200"
|
|
196
|
-
placeholder="
|
|
197
|
+
:placeholder="t('profileEditModal.bioPlaceholder')"
|
|
197
198
|
class="w-full"
|
|
198
199
|
/>
|
|
199
200
|
</UFormField>
|
|
@@ -215,13 +216,13 @@ async function onSave() {
|
|
|
215
216
|
:disabled="saving"
|
|
216
217
|
@click="open = false"
|
|
217
218
|
>
|
|
218
|
-
|
|
219
|
+
{{ t('common.action.cancel') }}
|
|
219
220
|
</UButton>
|
|
220
221
|
<UButton
|
|
221
222
|
:loading="saving"
|
|
222
223
|
@click="onSave"
|
|
223
224
|
>
|
|
224
|
-
|
|
225
|
+
{{ t('common.action.save') }}
|
|
225
226
|
</UButton>
|
|
226
227
|
</div>
|
|
227
228
|
</template>
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { imeSafeSubmitClick, imeSafeSubmitPointerDown } from 'memi-board/runtime'
|
|
2
3
|
import { computed, ref } from 'vue'
|
|
3
4
|
import {
|
|
4
5
|
REPORT_DETAIL_MAX_LENGTH,
|
|
5
6
|
REPORT_REASONS,
|
|
7
|
+
reportReasonLabel,
|
|
6
8
|
useMemiBoardAuth,
|
|
9
|
+
useMemiBoardI18n,
|
|
7
10
|
useMemiBoardReports,
|
|
8
11
|
} from 'memi-board/runtime'
|
|
9
12
|
import type { BoardReportReason } from 'memi-board/runtime'
|
|
@@ -17,6 +20,10 @@ const props = defineProps<{
|
|
|
17
20
|
}>()
|
|
18
21
|
|
|
19
22
|
const { isSignedIn, user } = useMemiBoardAuth()
|
|
23
|
+
const { t, locale, formatNumber } = useMemiBoardI18n()
|
|
24
|
+
const reasonItems = computed(() =>
|
|
25
|
+
REPORT_REASONS.map(item => ({ ...item, label: reportReasonLabel(item.value, locale.value) })),
|
|
26
|
+
)
|
|
20
27
|
const { hasReported, pending, submitReport } = useMemiBoardReports(props.boardId, props.postId)
|
|
21
28
|
|
|
22
29
|
const open = ref(false)
|
|
@@ -38,6 +45,7 @@ function openModal() {
|
|
|
38
45
|
}
|
|
39
46
|
|
|
40
47
|
async function submit() {
|
|
48
|
+
if (pending.value) return
|
|
41
49
|
error.value = ''
|
|
42
50
|
try {
|
|
43
51
|
await submitReport({
|
|
@@ -50,7 +58,7 @@ async function submit() {
|
|
|
50
58
|
done.value = true
|
|
51
59
|
}
|
|
52
60
|
catch (cause) {
|
|
53
|
-
error.value = cause instanceof Error ? cause.message : '
|
|
61
|
+
error.value = cause instanceof Error ? cause.message : t('reportButton.failed')
|
|
54
62
|
}
|
|
55
63
|
}
|
|
56
64
|
</script>
|
|
@@ -62,14 +70,14 @@ async function submit() {
|
|
|
62
70
|
size="sm"
|
|
63
71
|
variant="ghost"
|
|
64
72
|
:color="hasReported ? 'warning' : 'neutral'"
|
|
65
|
-
:label="hasReported ? '
|
|
73
|
+
:label="hasReported ? t('reportButton.reported') : t('common.action.report')"
|
|
66
74
|
:disabled="hasReported"
|
|
67
75
|
@click="openModal"
|
|
68
76
|
/>
|
|
69
|
-
<UModal v-model:open="open" title="
|
|
77
|
+
<UModal v-model:open="open" :title="t('reportButton.title')">
|
|
70
78
|
<template #body>
|
|
71
79
|
<div v-if="done" class="py-4 text-sm text-muted">
|
|
72
|
-
|
|
80
|
+
{{ t('reportButton.done') }}
|
|
73
81
|
</div>
|
|
74
82
|
<form
|
|
75
83
|
v-else
|
|
@@ -78,18 +86,18 @@ async function submit() {
|
|
|
78
86
|
>
|
|
79
87
|
<URadioGroup
|
|
80
88
|
v-model="reason"
|
|
81
|
-
:items="
|
|
89
|
+
:items="reasonItems"
|
|
82
90
|
value-key="value"
|
|
83
|
-
legend="
|
|
91
|
+
:legend="t('reportButton.reason')"
|
|
84
92
|
/>
|
|
85
93
|
<UTextarea
|
|
86
94
|
v-model="detail"
|
|
87
95
|
:rows="3"
|
|
88
96
|
:maxlength="REPORT_DETAIL_MAX_LENGTH"
|
|
89
|
-
placeholder="
|
|
97
|
+
:placeholder="t('reportButton.detailPlaceholder')"
|
|
90
98
|
/>
|
|
91
99
|
<p class="text-right text-xs text-dimmed">
|
|
92
|
-
{{ detail.length
|
|
100
|
+
{{ formatNumber(detail.length) }} / {{ formatNumber(REPORT_DETAIL_MAX_LENGTH) }}
|
|
93
101
|
</p>
|
|
94
102
|
<p v-if="error" class="text-xs text-error">
|
|
95
103
|
{{ error }}
|
|
@@ -99,14 +107,16 @@ async function submit() {
|
|
|
99
107
|
type="button"
|
|
100
108
|
color="neutral"
|
|
101
109
|
variant="ghost"
|
|
102
|
-
label="
|
|
110
|
+
:label="t('common.action.cancel')"
|
|
103
111
|
:disabled="pending"
|
|
104
112
|
@click="open = false"
|
|
105
113
|
/>
|
|
106
114
|
<UButton
|
|
107
115
|
type="submit"
|
|
116
|
+
@pointerdown="imeSafeSubmitPointerDown"
|
|
117
|
+
@click="imeSafeSubmitClick"
|
|
108
118
|
color="warning"
|
|
109
|
-
label="
|
|
119
|
+
:label="t('reportButton.submit')"
|
|
110
120
|
:loading="pending"
|
|
111
121
|
/>
|
|
112
122
|
</div>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, resolveComponent } from 'vue'
|
|
3
3
|
import {
|
|
4
|
-
formatRelativeDate,
|
|
5
4
|
reportReasonLabel,
|
|
6
5
|
useMemiBoardAuth,
|
|
6
|
+
useMemiBoardI18n,
|
|
7
7
|
useMemiBoardReportQueue,
|
|
8
8
|
} from 'memi-board/runtime'
|
|
9
9
|
import type { BoardReportModel } from 'memi-board/runtime'
|
|
@@ -14,6 +14,7 @@ const props = defineProps<{
|
|
|
14
14
|
}>()
|
|
15
15
|
|
|
16
16
|
const NuxtLink = resolveComponent('NuxtLink')
|
|
17
|
+
const { t, locale, formatRelativeDate } = useMemiBoardI18n()
|
|
17
18
|
const { canManageContent } = useMemiBoardAuth()
|
|
18
19
|
const { reports, pending, loadingMore, hasMore, loadError, loadMore, dismissReport, actionReport } = useMemiBoardReportQueue({
|
|
19
20
|
boardId: () => props.boardId || '',
|
|
@@ -44,7 +45,7 @@ async function handle(report: BoardReportModel, action: 'dismiss' | 'action') {
|
|
|
44
45
|
v-if="!canManageContent"
|
|
45
46
|
class="py-8 text-center text-sm text-muted"
|
|
46
47
|
>
|
|
47
|
-
|
|
48
|
+
{{ t('reportList.staffOnly') }}
|
|
48
49
|
</p>
|
|
49
50
|
<template v-else-if="pending">
|
|
50
51
|
<USkeleton v-for="i in 4" :key="i" class="h-16 w-full" />
|
|
@@ -53,13 +54,13 @@ async function handle(report: BoardReportModel, action: 'dismiss' | 'action') {
|
|
|
53
54
|
v-else-if="loadError"
|
|
54
55
|
class="py-8 text-center text-sm text-error"
|
|
55
56
|
>
|
|
56
|
-
|
|
57
|
+
{{ t('reportList.loadFailed', { error: String(loadError) }) }}
|
|
57
58
|
</p>
|
|
58
59
|
<p
|
|
59
60
|
v-else-if="!reports.length"
|
|
60
61
|
class="py-8 text-center text-sm text-muted"
|
|
61
62
|
>
|
|
62
|
-
|
|
63
|
+
{{ t('reportList.empty') }}
|
|
63
64
|
</p>
|
|
64
65
|
<ul
|
|
65
66
|
v-else
|
|
@@ -77,11 +78,11 @@ async function handle(report: BoardReportModel, action: 'dismiss' | 'action') {
|
|
|
77
78
|
class="truncate text-sm font-medium text-highlighted"
|
|
78
79
|
:class="postLink(report) ? 'hover:underline' : ''"
|
|
79
80
|
>
|
|
80
|
-
{{ report.postTitle || '
|
|
81
|
+
{{ report.postTitle || t('reportList.untitled') }}
|
|
81
82
|
</component>
|
|
82
83
|
<p class="mt-0.5 text-xs text-muted">
|
|
83
|
-
{{ reportReasonLabel(report.reason) }}
|
|
84
|
-
<span v-if="report.authorName"> ·
|
|
84
|
+
{{ reportReasonLabel(report.reason, locale.value) }}
|
|
85
|
+
<span v-if="report.authorName"> · {{ t('reportList.author', { name: report.authorName }) }}</span>
|
|
85
86
|
· {{ formatRelativeDate(report.createdAt, now) }}
|
|
86
87
|
</p>
|
|
87
88
|
<p
|
|
@@ -96,7 +97,7 @@ async function handle(report: BoardReportModel, action: 'dismiss' | 'action') {
|
|
|
96
97
|
size="xs"
|
|
97
98
|
color="neutral"
|
|
98
99
|
variant="soft"
|
|
99
|
-
label="
|
|
100
|
+
:label="t('reportList.dismiss')"
|
|
100
101
|
:loading="actingId === report.id"
|
|
101
102
|
@click="handle(report, 'dismiss')"
|
|
102
103
|
/>
|
|
@@ -104,7 +105,7 @@ async function handle(report: BoardReportModel, action: 'dismiss' | 'action') {
|
|
|
104
105
|
size="xs"
|
|
105
106
|
color="warning"
|
|
106
107
|
variant="soft"
|
|
107
|
-
label="
|
|
108
|
+
:label="t('reportList.confirm')"
|
|
108
109
|
:loading="actingId === report.id"
|
|
109
110
|
@click="handle(report, 'action')"
|
|
110
111
|
/>
|
|
@@ -115,7 +116,7 @@ async function handle(report: BoardReportModel, action: 'dismiss' | 'action') {
|
|
|
115
116
|
v-if="canManageContent && !pending && hasMore"
|
|
116
117
|
variant="outline"
|
|
117
118
|
color="neutral"
|
|
118
|
-
label="
|
|
119
|
+
:label="t('common.action.more')"
|
|
119
120
|
block
|
|
120
121
|
:loading="loadingMore"
|
|
121
122
|
@click="loadMore"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import type { BoardSection, CommentModel, PostModel } from 'memi-board/runtime'
|
|
4
|
-
import { miniMoreLink, sectionColClass, sectionMinHeight } from 'memi-board/runtime'
|
|
4
|
+
import { miniMoreLink, sectionColClass, sectionMinHeight, useMemiBoardI18n } from 'memi-board/runtime'
|
|
5
5
|
import MemiBoardMiniComments from './MiniComments.vue'
|
|
6
6
|
import MemiBoardMiniList from './MiniList.vue'
|
|
7
7
|
import MemiBoardMiniPost from './MiniPost.vue'
|
|
@@ -13,6 +13,7 @@ const props = defineProps<{
|
|
|
13
13
|
getMoreLink?: (section: BoardSection) => string | undefined
|
|
14
14
|
}>()
|
|
15
15
|
|
|
16
|
+
const { t } = useMemiBoardI18n()
|
|
16
17
|
const moreTo = computed(() => props.getMoreLink?.(props.section) ?? miniMoreLink(props.section))
|
|
17
18
|
</script>
|
|
18
19
|
|
|
@@ -40,7 +41,7 @@ const moreTo = computed(() => props.getMoreLink?.(props.section) ?? miniMoreLink
|
|
|
40
41
|
size="xs"
|
|
41
42
|
trailing-icon="i-lucide-chevron-right"
|
|
42
43
|
class="shrink-0 px-0"
|
|
43
|
-
label="
|
|
44
|
+
:label="t('common.action.more')"
|
|
44
45
|
/>
|
|
45
46
|
</header>
|
|
46
47
|
<MemiBoardMiniList
|