memi-board 0.58.0 → 0.59.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 +2 -0
- package/dist/{ar-GNguZBN4.js → ar-DsYwkqiP.js} +5 -2
- package/dist/ar-DsYwkqiP.js.map +1 -0
- package/dist/{commentImages-CRK_2uVi.js → commentImages-BZOxzRy6.js} +40 -11
- package/dist/commentImages-BZOxzRy6.js.map +1 -0
- package/dist/composables/useMemiBoardBannerGeneration.d.ts +8 -0
- package/dist/composables/useMemiBoardStorage.d.ts +2 -1
- package/dist/config.d.ts +4 -0
- package/dist/{de-CS0iRLqe.js → de-Ckqy6xMr.js} +5 -2
- package/dist/de-Ckqy6xMr.js.map +1 -0
- package/dist/{en-DeExi-DR.js → en-Dshxokpu.js} +28 -2
- package/dist/en-Dshxokpu.js.map +1 -0
- package/dist/{es-dlEFrox-.js → es-BkaAuj2h.js} +5 -2
- package/dist/es-BkaAuj2h.js.map +1 -0
- package/dist/{fr-B9sjKJF4.js → fr-BrhcNuxW.js} +5 -2
- package/dist/fr-BrhcNuxW.js.map +1 -0
- package/dist/{id-Ca7skouh.js → id-B_7SWGzM.js} +5 -2
- package/dist/id-B_7SWGzM.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +642 -550
- package/dist/index.js.map +1 -1
- package/dist/{ja-ByVLGIDd.js → ja-DyexZuXX.js} +5 -2
- package/dist/ja-DyexZuXX.js.map +1 -0
- package/dist/{pt-COQL_Q7A.js → pt-Az3vABvC.js} +5 -2
- package/dist/pt-Az3vABvC.js.map +1 -0
- package/dist/runtime/components/AuthorMenu.vue +17 -13
- package/dist/runtime/components/BannerEditor.vue +198 -0
- package/dist/runtime/components/BoardInfo.vue +29 -49
- package/dist/runtime/components/CategorySettings.vue +25 -2
- package/dist/runtime/components/CommentFeed.vue +6 -7
- package/dist/runtime/components/CommentItem.vue +13 -14
- package/dist/runtime/components/Detail.vue +31 -40
- package/dist/runtime/components/LikeButton.vue +9 -10
- package/dist/runtime/components/List.vue +23 -11
- package/dist/runtime/components/ListCard.vue +5 -3
- package/dist/runtime/components/ListDefault.vue +14 -12
- package/dist/runtime/components/ListDense.vue +9 -9
- package/dist/runtime/components/ListImage.vue +6 -4
- package/dist/runtime/components/ListVideo.vue +10 -13
- package/dist/runtime/components/MiniComments.vue +6 -7
- package/dist/runtime/components/Settings.vue +26 -2
- package/dist/storage.js +18 -1
- package/dist/storage.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/utils/bannerGeneration.d.ts +9 -0
- package/dist/{zh-DBjX9qAS.js → zh-B55IygiW.js} +5 -2
- package/dist/zh-B55IygiW.js.map +1 -0
- package/docs/firebase-setup.md +50 -0
- package/docs/storage.rules.example +19 -0
- package/package.json +1 -1
- package/dist/ar-GNguZBN4.js.map +0 -1
- package/dist/commentImages-CRK_2uVi.js.map +0 -1
- package/dist/de-CS0iRLqe.js.map +0 -1
- package/dist/en-DeExi-DR.js.map +0 -1
- package/dist/es-dlEFrox-.js.map +0 -1
- package/dist/fr-B9sjKJF4.js.map +0 -1
- package/dist/id-Ca7skouh.js.map +0 -1
- package/dist/ja-ByVLGIDd.js.map +0 -1
- package/dist/pt-COQL_Q7A.js.map +0 -1
- package/dist/zh-DBjX9qAS.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { computed, ref } from 'vue'
|
|
3
3
|
import { formatDate, useMemiBoardI18n, useMemiBoardSettings } from 'memi-board/runtime'
|
|
4
4
|
import MemiBoardInfoPerson from './BoardInfoPerson.vue'
|
|
5
5
|
|
|
6
6
|
const props = defineProps<{
|
|
7
7
|
boardId?: string
|
|
8
|
-
title
|
|
8
|
+
title?: string
|
|
9
9
|
description?: string
|
|
10
10
|
/** 만든 사람/관리자/스태프 메뉴 중 "프로필 보기" 링크. */
|
|
11
11
|
authorProfileTo?: (authorUid: string) => string | undefined
|
|
@@ -25,34 +25,31 @@ const staff = computed(() => (board.value?.allowedStaffUids ?? []).filter(uid =>
|
|
|
25
25
|
const creatorUid = computed(() => board.value?.createdByUid)
|
|
26
26
|
const createdAt = computed(() => formatDate(board.value?.createdAt, locale.value))
|
|
27
27
|
const hasInfo = computed(() => !!(props.description || managers.value.length || staff.value.length || creatorUid.value))
|
|
28
|
+
const open = ref(false)
|
|
28
29
|
</script>
|
|
29
30
|
|
|
30
31
|
<template>
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
>
|
|
32
|
+
<div class="flex min-w-0 flex-col gap-2">
|
|
33
|
+
<h1 v-if="title" class="min-w-0 text-2xl font-bold tracking-tight text-highlighted">
|
|
34
|
+
<UButton
|
|
35
|
+
v-if="hasInfo"
|
|
36
|
+
:label="title"
|
|
37
|
+
color="neutral"
|
|
38
|
+
variant="ghost"
|
|
39
|
+
trailing-icon="i-lucide-chevron-down"
|
|
40
|
+
:aria-expanded="open"
|
|
41
|
+
class="-mx-1.5 h-auto max-w-full min-w-0 justify-start px-1.5 py-0.5 text-start text-2xl font-bold tracking-tight text-highlighted"
|
|
42
|
+
:ui="{ label: 'truncate', trailingIcon: open ? 'size-5 rotate-180 text-muted transition-transform' : 'size-5 text-muted transition-transform' }"
|
|
43
|
+
@click="open = !open"
|
|
44
|
+
/>
|
|
45
|
+
<span v-else class="block truncate">{{ title }}</span>
|
|
46
|
+
</h1>
|
|
47
|
+
<div v-if="hasInfo && open" class="flex flex-col gap-3">
|
|
48
|
+
<p v-if="description" class="whitespace-pre-line break-words text-sm text-default">
|
|
49
49
|
{{ description }}
|
|
50
50
|
</p>
|
|
51
|
-
<dl class="flex flex-col gap-
|
|
52
|
-
<div
|
|
53
|
-
v-if="creatorUid"
|
|
54
|
-
class="flex flex-col gap-1"
|
|
55
|
-
>
|
|
51
|
+
<dl class="flex flex-col gap-3 text-sm sm:flex-row sm:flex-wrap sm:gap-x-6">
|
|
52
|
+
<div v-if="creatorUid" class="flex flex-col gap-1 rounded-lg border border-default px-3 py-2">
|
|
56
53
|
<dt class="text-xs text-muted">
|
|
57
54
|
{{ t('list.boardInfo.creator') }}
|
|
58
55
|
</dt>
|
|
@@ -63,22 +60,16 @@ const hasInfo = computed(() => !!(props.description || managers.value.length ||
|
|
|
63
60
|
:author-posts-to="authorPostsTo"
|
|
64
61
|
:author-comments-to="authorCommentsTo"
|
|
65
62
|
/>
|
|
66
|
-
<span
|
|
67
|
-
v-if="createdAt"
|
|
68
|
-
class="text-xs text-muted"
|
|
69
|
-
>
|
|
63
|
+
<span v-if="createdAt" class="text-xs text-muted">
|
|
70
64
|
{{ createdAt }}
|
|
71
65
|
</span>
|
|
72
66
|
</dd>
|
|
73
67
|
</div>
|
|
74
|
-
<div
|
|
75
|
-
v-if="managers.length"
|
|
76
|
-
class="flex flex-col gap-1"
|
|
77
|
-
>
|
|
68
|
+
<div v-if="managers.length" class="flex flex-col gap-1 rounded-lg border border-default px-3 py-2">
|
|
78
69
|
<dt class="text-xs text-muted">
|
|
79
70
|
{{ t('list.boardInfo.managers') }}
|
|
80
71
|
</dt>
|
|
81
|
-
<dd class="flex flex-
|
|
72
|
+
<dd class="flex flex-wrap items-center gap-x-3 gap-y-1">
|
|
82
73
|
<MemiBoardInfoPerson
|
|
83
74
|
v-for="uid in managers"
|
|
84
75
|
:key="uid"
|
|
@@ -89,14 +80,11 @@ const hasInfo = computed(() => !!(props.description || managers.value.length ||
|
|
|
89
80
|
/>
|
|
90
81
|
</dd>
|
|
91
82
|
</div>
|
|
92
|
-
<div
|
|
93
|
-
v-if="staff.length"
|
|
94
|
-
class="flex flex-col gap-1"
|
|
95
|
-
>
|
|
83
|
+
<div v-if="staff.length" class="flex flex-col gap-1 rounded-lg border border-default px-3 py-2">
|
|
96
84
|
<dt class="text-xs text-muted">
|
|
97
85
|
{{ t('list.boardInfo.staff') }}
|
|
98
86
|
</dt>
|
|
99
|
-
<dd class="flex flex-
|
|
87
|
+
<dd class="flex flex-wrap items-center gap-x-3 gap-y-1">
|
|
100
88
|
<MemiBoardInfoPerson
|
|
101
89
|
v-for="uid in staff"
|
|
102
90
|
:key="uid"
|
|
@@ -108,14 +96,6 @@ const hasInfo = computed(() => !!(props.description || managers.value.length ||
|
|
|
108
96
|
</dd>
|
|
109
97
|
</div>
|
|
110
98
|
</dl>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
</UPopover>
|
|
114
|
-
<span
|
|
115
|
-
v-else
|
|
116
|
-
class="block truncate"
|
|
117
|
-
>
|
|
118
|
-
{{ title }}
|
|
119
|
-
</span>
|
|
120
|
-
</h1>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
121
101
|
</template>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import MemiBoardSurface from './BoardSurface.vue'
|
|
3
|
+
import { useMemiBoardStorage } from 'memi-board/storage'
|
|
3
4
|
import { computed, onMounted, ref, watch } from 'vue'
|
|
4
5
|
import { boardCopyIsTranslated, boardTranslationLocales, MEMI_BOARD_LOCALES, memiBoardEnabledLocales, useMemiBoardAuth, useMemiBoardPostTranslations, useMemiBoardI18n, useMemiBoardSettings, useMemiBoardUsers } from 'memi-board/runtime'
|
|
5
6
|
import type { BoardCategory, BoardEditorType, BoardListView, BoardVisibility, BoardWriteRole } from 'memi-board/runtime'
|
|
6
7
|
import MemiBoardCustomFieldEditor from './CustomFieldEditor.vue'
|
|
7
8
|
import MemiBoardOptionCards from './OptionCards.vue'
|
|
9
|
+
import MemiBoardBannerEditor from './BannerEditor.vue'
|
|
8
10
|
|
|
9
11
|
const props = withDefaults(defineProps<{
|
|
10
12
|
categoryId: string
|
|
@@ -104,6 +106,9 @@ const translating = ref(false)
|
|
|
104
106
|
const translatedDraft = ref(false)
|
|
105
107
|
const saved = ref(false)
|
|
106
108
|
const error = ref('')
|
|
109
|
+
const bannerBusy = ref(false)
|
|
110
|
+
const bannerFile = ref<File | null | undefined>()
|
|
111
|
+
const { uploadBoardBanner, deleteAttachment } = useMemiBoardStorage()
|
|
107
112
|
|
|
108
113
|
function emptyDraft(id: string): BoardCategory {
|
|
109
114
|
return {
|
|
@@ -154,6 +159,7 @@ function toDraft(category: BoardCategory): BoardCategory {
|
|
|
154
159
|
// 카테고리 전환·최초 로드 시에만 draft를 서버 값으로 맞춘다.
|
|
155
160
|
// 저장 직후 onSnapshot 갱신으로 draft.description 이 비워지거나 입력 중이던 값이 덮이지 않게 한다.
|
|
156
161
|
watch(() => props.categoryId, (id) => {
|
|
162
|
+
bannerFile.value = undefined
|
|
157
163
|
translatedDraft.value = false
|
|
158
164
|
if (source.value) draft.value = toDraft(source.value)
|
|
159
165
|
else if (canCreate.value) draft.value = emptyDraft(id)
|
|
@@ -208,11 +214,12 @@ async function translateCopy() {
|
|
|
208
214
|
}
|
|
209
215
|
|
|
210
216
|
async function save() {
|
|
211
|
-
if (!draft.value || translating.value || saving.value) return
|
|
217
|
+
if (!draft.value || translating.value || saving.value || bannerBusy.value) return
|
|
212
218
|
saving.value = true
|
|
213
219
|
saved.value = false
|
|
214
220
|
error.value = ''
|
|
215
221
|
const snapshot = { ...draft.value, autoTranslate: draft.value.autoTranslate === true }
|
|
222
|
+
let uploadedPath: string | undefined
|
|
216
223
|
let translateFailed = false
|
|
217
224
|
if (translationEnabled.value && snapshot.autoTranslate) {
|
|
218
225
|
try {
|
|
@@ -229,7 +236,12 @@ async function save() {
|
|
|
229
236
|
}
|
|
230
237
|
try {
|
|
231
238
|
const order = isNew.value ? categories.value.length : (snapshot.order ?? 0)
|
|
239
|
+
if (bannerFile.value !== undefined) {
|
|
240
|
+
snapshot.banner = bannerFile.value ? await uploadBoardBanner(snapshot.id, bannerFile.value) : null
|
|
241
|
+
uploadedPath = snapshot.banner?.path
|
|
242
|
+
}
|
|
232
243
|
await saveCategory(snapshot, order)
|
|
244
|
+
bannerFile.value = undefined
|
|
233
245
|
snapshot.order = order
|
|
234
246
|
snapshot.visibilityTransition = undefined
|
|
235
247
|
// 저장 성공 직후 draft 유지 (스냅샷 오기 전에 watch가 비우지 않도록)
|
|
@@ -240,6 +252,7 @@ async function save() {
|
|
|
240
252
|
if (translateFailed) error.value = t('settings.autoTranslate.failed', { count: translationCount(snapshot) })
|
|
241
253
|
}
|
|
242
254
|
catch (cause) {
|
|
255
|
+
if (uploadedPath) await deleteAttachment({ path: uploadedPath }).catch(() => {})
|
|
243
256
|
error.value = cause instanceof Error ? cause.message : t('settings.error.saveFailed')
|
|
244
257
|
}
|
|
245
258
|
finally {
|
|
@@ -262,6 +275,16 @@ async function save() {
|
|
|
262
275
|
:title="t('settings.newBoard.title')"
|
|
263
276
|
:description="t('settings.newBoard.description')"
|
|
264
277
|
/>
|
|
278
|
+
<MemiBoardBannerEditor
|
|
279
|
+
:key="draft.id"
|
|
280
|
+
:banner="draft.banner"
|
|
281
|
+
:board-id="draft.id"
|
|
282
|
+
:title="draft.label"
|
|
283
|
+
:description="draft.description"
|
|
284
|
+
@busy="bannerBusy = $event"
|
|
285
|
+
:disabled="saving || translating"
|
|
286
|
+
@change="bannerFile = $event; saved = false"
|
|
287
|
+
/>
|
|
265
288
|
<div class="grid gap-2 sm:grid-cols-[9rem_1fr] sm:items-center">
|
|
266
289
|
<div><p class="text-sm font-medium">{{ t('settings.id.label') }}</p><p class="text-xs text-muted">{{ t('settings.id.help') }}</p></div>
|
|
267
290
|
<UInput :model-value="draft.id" disabled class="font-mono" />
|
|
@@ -386,7 +409,7 @@ async function save() {
|
|
|
386
409
|
/>
|
|
387
410
|
</div>
|
|
388
411
|
<div class="flex justify-end border-t border-default pt-4">
|
|
389
|
-
<UButton :label="isNew ? t('settings.action.create') : t('common.action.save')" :icon="isNew ? 'i-lucide-plus' : 'i-lucide-save'" :loading="saving" :disabled="translating" @click="save" />
|
|
412
|
+
<UButton :label="isNew ? t('settings.action.create') : t('common.action.save')" :icon="isNew ? 'i-lucide-plus' : 'i-lucide-save'" :loading="saving" :disabled="translating || bannerBusy" @click="save" />
|
|
390
413
|
</div>
|
|
391
414
|
<UAlert v-if="error" color="error" variant="subtle" :description="error" />
|
|
392
415
|
<UAlert v-if="saved" color="success" variant="subtle" :description="isNew ? t('settings.created') : t('settings.savedSettings')" />
|
|
@@ -119,13 +119,12 @@ const emptyMessage = computed(() =>
|
|
|
119
119
|
class="mr-1 text-primary"
|
|
120
120
|
>@{{ comment.replyToName }}</span><span v-text="displayCommentBody(comment, locale)" />
|
|
121
121
|
</p>
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
</p>
|
|
122
|
+
<UTooltip v-if="(comment.likeCount ?? 0) > 0" :text="t('list.likeCount', { count: comment.likeCount ?? 0 })" :delay-duration="200" :content="{ side: 'top' }">
|
|
123
|
+
<p class="mt-1 flex items-center gap-1 text-xs text-muted">
|
|
124
|
+
<UIcon name="i-lucide-heart" class="size-3" />
|
|
125
|
+
{{ comment.likeCount }}
|
|
126
|
+
</p>
|
|
127
|
+
</UTooltip>
|
|
129
128
|
</component>
|
|
130
129
|
</li>
|
|
131
130
|
</ul>
|
|
@@ -208,19 +208,17 @@ async function toggleLike() {
|
|
|
208
208
|
:author-comments-to="authorCommentsTo"
|
|
209
209
|
/>
|
|
210
210
|
<span v-else class="text-sm font-medium">{{ comment.authorName ?? t('common.label.anonymous') }}</span>
|
|
211
|
-
<
|
|
211
|
+
<UTooltip :delay-duration="200" :content="{ side: 'top' }" :ui="{ content: 'h-auto px-3 py-2' }">
|
|
212
212
|
<time
|
|
213
213
|
:datetime="date?.toISOString()"
|
|
214
|
-
class="
|
|
214
|
+
class="text-xs text-muted"
|
|
215
215
|
>
|
|
216
216
|
{{ relativeDate }}
|
|
217
217
|
</time>
|
|
218
218
|
<template #content>
|
|
219
|
-
<
|
|
220
|
-
{{ timestampDetails }}
|
|
221
|
-
</p>
|
|
219
|
+
<span class="whitespace-pre-line">{{ timestampDetails }}</span>
|
|
222
220
|
</template>
|
|
223
|
-
</
|
|
221
|
+
</UTooltip>
|
|
224
222
|
</div>
|
|
225
223
|
<form
|
|
226
224
|
v-if="editing"
|
|
@@ -331,14 +329,15 @@ async function toggleLike() {
|
|
|
331
329
|
@click="toggleLike"
|
|
332
330
|
/>
|
|
333
331
|
</UTooltip>
|
|
334
|
-
<
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
332
|
+
<UTooltip v-else :text="t('list.likeCount', { count: localLikeCount })" :delay-duration="200" :content="{ side: 'top' }">
|
|
333
|
+
<span
|
|
334
|
+
class="flex items-center gap-0.5 px-1 text-xs text-muted"
|
|
335
|
+
:aria-label="t('list.likeCount', { count: localLikeCount })"
|
|
336
|
+
>
|
|
337
|
+
<UIcon name="i-lucide-heart" class="size-3.5" />
|
|
338
|
+
{{ localLikeCount }}
|
|
339
|
+
</span>
|
|
340
|
+
</UTooltip>
|
|
342
341
|
<UTooltip v-if="canEditComment(comment) && comment.id && !localBlinded" :text="t('commentItem.edit')" :delay-duration="200">
|
|
343
342
|
<UButton
|
|
344
343
|
icon="i-lucide-pencil"
|
|
@@ -256,8 +256,8 @@ watch(() => props.postId, () => {
|
|
|
256
256
|
</div>
|
|
257
257
|
|
|
258
258
|
<header class="flex flex-col gap-2">
|
|
259
|
-
<div class="flex items-start
|
|
260
|
-
<div class="flex items-center gap-2
|
|
259
|
+
<div class="flex items-start gap-3">
|
|
260
|
+
<div class="flex min-w-0 flex-1 items-center gap-2">
|
|
261
261
|
<UBadge
|
|
262
262
|
v-if="post.category"
|
|
263
263
|
:label="shownBoardLabel"
|
|
@@ -271,31 +271,6 @@ watch(() => props.postId, () => {
|
|
|
271
271
|
{{ shownTitle }}
|
|
272
272
|
</h1>
|
|
273
273
|
</div>
|
|
274
|
-
<UTooltip :text="t('detail.backToList')" :delay-duration="200">
|
|
275
|
-
<UButton
|
|
276
|
-
icon="i-lucide-arrow-left"
|
|
277
|
-
:aria-label="t('detail.backToList')"
|
|
278
|
-
color="neutral"
|
|
279
|
-
variant="ghost"
|
|
280
|
-
size="sm"
|
|
281
|
-
class="shrink-0"
|
|
282
|
-
@click="emit('list')"
|
|
283
|
-
/>
|
|
284
|
-
</UTooltip>
|
|
285
|
-
</div>
|
|
286
|
-
<div
|
|
287
|
-
v-if="post.tags?.length"
|
|
288
|
-
class="flex gap-1"
|
|
289
|
-
>
|
|
290
|
-
<UBadge
|
|
291
|
-
v-for="tag in post.tags"
|
|
292
|
-
:key="tag"
|
|
293
|
-
variant="subtle"
|
|
294
|
-
color="neutral"
|
|
295
|
-
size="sm"
|
|
296
|
-
>
|
|
297
|
-
{{ tag }}
|
|
298
|
-
</UBadge>
|
|
299
274
|
</div>
|
|
300
275
|
</header>
|
|
301
276
|
|
|
@@ -325,6 +300,25 @@ watch(() => props.postId, () => {
|
|
|
325
300
|
</div>
|
|
326
301
|
</dl>
|
|
327
302
|
|
|
303
|
+
<div v-if="post.tags?.length" class="flex flex-wrap justify-end gap-1">
|
|
304
|
+
<UTooltip
|
|
305
|
+
v-for="tag in post.tags"
|
|
306
|
+
:key="tag"
|
|
307
|
+
:text="t('detail.tag')"
|
|
308
|
+
:delay-duration="200"
|
|
309
|
+
:content="{ side: 'top' }"
|
|
310
|
+
:ui="{ content: 'h-auto px-3 py-2' }"
|
|
311
|
+
>
|
|
312
|
+
<UBadge
|
|
313
|
+
variant="subtle"
|
|
314
|
+
color="primary"
|
|
315
|
+
size="sm"
|
|
316
|
+
>
|
|
317
|
+
{{ tag }}
|
|
318
|
+
</UBadge>
|
|
319
|
+
</UTooltip>
|
|
320
|
+
</div>
|
|
321
|
+
|
|
328
322
|
<div class="flex flex-col items-end gap-2">
|
|
329
323
|
<div class="flex items-center justify-end gap-3 text-sm text-muted">
|
|
330
324
|
<MemiBoardAuthorMenu
|
|
@@ -335,23 +329,20 @@ watch(() => props.postId, () => {
|
|
|
335
329
|
:author-profile-to="authorProfileTo"
|
|
336
330
|
:author-comments-to="authorCommentsTo"
|
|
337
331
|
/>
|
|
338
|
-
<
|
|
339
|
-
<
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
>
|
|
332
|
+
<UTooltip :text="t('common.label.viewCount', { count: post.viewCount ?? 0 })" :delay-duration="200" :content="{ side: 'top' }">
|
|
333
|
+
<span class="inline-flex items-center gap-1 tabular-nums">
|
|
334
|
+
<UIcon name="i-lucide-eye" class="size-3.5" />
|
|
335
|
+
{{ post.viewCount ?? 0 }}
|
|
336
|
+
</span>
|
|
337
|
+
</UTooltip>
|
|
338
|
+
<UTooltip :delay-duration="200" :content="{ side: 'top' }" :ui="{ content: 'h-auto px-3 py-2' }">
|
|
339
|
+
<time :datetime="post.createdAt?.toDate?.().toISOString()">
|
|
347
340
|
{{ formatRelativeDate(post.createdAt, now) }}
|
|
348
341
|
</time>
|
|
349
342
|
<template #content>
|
|
350
|
-
<
|
|
351
|
-
{{ formatTimestampDetails(post.createdAt, post.updatedAt).join('\n') }}
|
|
352
|
-
</p>
|
|
343
|
+
<span class="whitespace-pre-line">{{ formatTimestampDetails(post.createdAt, post.updatedAt).join('\n') }}</span>
|
|
353
344
|
</template>
|
|
354
|
-
</
|
|
345
|
+
</UTooltip>
|
|
355
346
|
</div>
|
|
356
347
|
<div v-if="canPin || canEdit(post) || canDelete(post)" class="flex gap-2">
|
|
357
348
|
<UButton
|
|
@@ -26,14 +26,13 @@ const { isLiked, likePending, toggleLike } = useMemiBoardLikes(props.boardId, pr
|
|
|
26
26
|
@click="toggleLike"
|
|
27
27
|
/>
|
|
28
28
|
</UTooltip>
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</span>
|
|
29
|
+
<UTooltip v-else :text="t('list.likeCount', { count: likeCount ?? 0 })" :delay-duration="200" :content="{ side: 'top' }">
|
|
30
|
+
<span class="flex items-center gap-1 text-sm text-muted">
|
|
31
|
+
<UIcon
|
|
32
|
+
name="i-lucide-heart"
|
|
33
|
+
class="size-4"
|
|
34
|
+
/>
|
|
35
|
+
{{ likeCount ?? 0 }}
|
|
36
|
+
</span>
|
|
37
|
+
</UTooltip>
|
|
39
38
|
</template>
|
|
@@ -38,8 +38,8 @@ const props = withDefaults(defineProps<{
|
|
|
38
38
|
/** 목록 위 헤더에 표시할 제목(예: 카테고리 이름). 지정하면 헤더 행(제목 + 버튼들)을 보여준다. */
|
|
39
39
|
title?: string
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
41
|
+
* 보드 문서에 설명이 없을 때 제목 아래에 보여줄 문구.
|
|
42
|
+
* 보드 설정 설명이 있으면 그 전문을 쓰고, 이것만 있으면 이 값을 쓴다.
|
|
43
43
|
*/
|
|
44
44
|
description?: string
|
|
45
45
|
/** '게시판 설정' 버튼 링크. 지정하면(그리고 canManageSettings가 true면) 헤더에 버튼을 보여준다. */
|
|
@@ -70,10 +70,9 @@ const resolvedBoardId = computed(() => props.boardId || props.category || '')
|
|
|
70
70
|
const { t, dir, locale } = useMemiBoardI18n({ boardLocale: () => getBoard(resolvedBoardId.value)?.locale })
|
|
71
71
|
const introductionText = computed(() => props.introduction ?? t('list.introduction'))
|
|
72
72
|
const listDescription = computed(() => {
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
return undefined
|
|
73
|
+
const fromBoard = resolvedBoardId.value ? boardDescription(resolvedBoardId.value, locale.value) : undefined
|
|
74
|
+
if (fromBoard) return fromBoard
|
|
75
|
+
return props.description?.trim() || undefined
|
|
77
76
|
})
|
|
78
77
|
const { posts, notices, postsPending, hasMore, loadingMore, loadError, loadMore } = useMemiBoardPostList(
|
|
79
78
|
resolvedBoardId,
|
|
@@ -100,10 +99,14 @@ function cancelAutomaticLoad() {
|
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
// 옵저버가 트리거를 보자마자 바로 불러오면 스크롤 중 살짝만 걸쳐도 계속 재요청된다 —
|
|
103
|
-
//
|
|
102
|
+
// 1초 뒤에도 여전히 보이는 경우에만(자동 요청) 실제로 더 불러온다. 버튼 클릭은 즉시 실행.
|
|
104
103
|
function scheduleLoadMore(automatic = false) {
|
|
105
104
|
if (loadMoreDelayTimer || loadingMore.value || !hasMore.value) return
|
|
106
|
-
|
|
105
|
+
if (!automatic) {
|
|
106
|
+
void loadMore()
|
|
107
|
+
return
|
|
108
|
+
}
|
|
109
|
+
automaticRequest = true
|
|
107
110
|
waitingToLoad.value = true
|
|
108
111
|
loadMoreDelayTimer = setTimeout(() => {
|
|
109
112
|
loadMoreDelayTimer = undefined
|
|
@@ -115,7 +118,7 @@ function scheduleLoadMore(automatic = false) {
|
|
|
115
118
|
automaticRequest = false
|
|
116
119
|
waitingToLoad.value = false
|
|
117
120
|
if (hasMore.value && !loadingMore.value) void loadMore()
|
|
118
|
-
},
|
|
121
|
+
}, 1000)
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
onMounted(() => {
|
|
@@ -220,9 +223,10 @@ function postTo(post: PostModel): string | undefined {
|
|
|
220
223
|
<template>
|
|
221
224
|
<MemiBoardSurface :introduction="introduction">
|
|
222
225
|
<div class="flex flex-col gap-2" :dir="dir">
|
|
223
|
-
<div v-if="hasHeader" class="flex items-
|
|
226
|
+
<div v-if="hasHeader" class="flex items-start justify-between gap-4">
|
|
224
227
|
<MemiBoardInfo
|
|
225
228
|
v-if="title"
|
|
229
|
+
class="min-w-0 flex-1"
|
|
226
230
|
:board-id="resolvedBoardId"
|
|
227
231
|
:title="title"
|
|
228
232
|
:description="listDescription"
|
|
@@ -230,7 +234,7 @@ function postTo(post: PostModel): string | undefined {
|
|
|
230
234
|
:author-posts-to="authorPostsTo"
|
|
231
235
|
:author-comments-to="authorCommentsTo"
|
|
232
236
|
/>
|
|
233
|
-
<div class="flex shrink-0 items-center gap-2">
|
|
237
|
+
<div v-if="(settingsTo && canManageSettings) || (writeTo && canWrite)" class="flex shrink-0 items-center gap-2">
|
|
234
238
|
<UButton
|
|
235
239
|
v-if="settingsTo && canManageSettings"
|
|
236
240
|
:to="settingsTo"
|
|
@@ -252,6 +256,14 @@ function postTo(post: PostModel): string | undefined {
|
|
|
252
256
|
/>
|
|
253
257
|
</div>
|
|
254
258
|
</div>
|
|
259
|
+
<img
|
|
260
|
+
v-if="getBoard(resolvedBoardId)?.banner?.url"
|
|
261
|
+
:src="getBoard(resolvedBoardId)?.banner?.url"
|
|
262
|
+
alt=""
|
|
263
|
+
width="2400"
|
|
264
|
+
height="300"
|
|
265
|
+
class="mb-2 aspect-[8/1] w-full rounded-xl object-cover"
|
|
266
|
+
>
|
|
255
267
|
<!-- 테스트용 목록 뷰 전환 UI.
|
|
256
268
|
<div v-else-if="view === undefined" class="flex justify-end">
|
|
257
269
|
<MemiBoardListViewSwitch :model-value="viewMode" @update:model-value="setViewMode" />
|
|
@@ -80,9 +80,11 @@ function image(post: PostModel): string | undefined {
|
|
|
80
80
|
truncate
|
|
81
81
|
class="min-w-0"
|
|
82
82
|
/>
|
|
83
|
-
<
|
|
84
|
-
<
|
|
85
|
-
|
|
83
|
+
<UTooltip :text="t('list.likeCount', { count: post.likeCount ?? 0 })" :delay-duration="200" :content="{ side: 'top' }">
|
|
84
|
+
<span class="inline-flex shrink-0 items-center gap-1 tabular-nums">
|
|
85
|
+
<UIcon name="i-lucide-heart" class="size-3.5" />{{ post.likeCount ?? 0 }}
|
|
86
|
+
</span>
|
|
87
|
+
</UTooltip>
|
|
86
88
|
</div>
|
|
87
89
|
</template>
|
|
88
90
|
</UCard>
|
|
@@ -114,19 +114,17 @@ function image(post: PostModel): string | undefined {
|
|
|
114
114
|
truncate
|
|
115
115
|
class="max-w-full"
|
|
116
116
|
/>
|
|
117
|
-
<
|
|
117
|
+
<UTooltip :delay-duration="200" :content="{ side: 'top' }" :ui="{ content: 'h-auto px-3 py-2' }">
|
|
118
118
|
<time
|
|
119
119
|
:datetime="post.createdAt?.toDate?.().toISOString()"
|
|
120
|
-
class="
|
|
120
|
+
class="text-xs leading-snug text-muted"
|
|
121
121
|
>
|
|
122
122
|
{{ formatRelativeDate(post.createdAt, now) }}
|
|
123
123
|
</time>
|
|
124
124
|
<template #content>
|
|
125
|
-
<
|
|
126
|
-
{{ formatTimestampDetails(post.createdAt, post.updatedAt).join('\n') }}
|
|
127
|
-
</p>
|
|
125
|
+
<span class="whitespace-pre-line">{{ formatTimestampDetails(post.createdAt, post.updatedAt).join('\n') }}</span>
|
|
128
126
|
</template>
|
|
129
|
-
</
|
|
127
|
+
</UTooltip>
|
|
130
128
|
<div class="flex flex-wrap items-center justify-end gap-x-2 gap-y-0.5 text-xs leading-snug text-muted">
|
|
131
129
|
<span
|
|
132
130
|
v-if="post.attachments?.length"
|
|
@@ -134,12 +132,16 @@ function image(post: PostModel): string | undefined {
|
|
|
134
132
|
>
|
|
135
133
|
<UIcon name="i-lucide-paperclip" class="size-3 shrink-0" />{{ post.attachments.length }}
|
|
136
134
|
</span>
|
|
137
|
-
<
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
135
|
+
<UTooltip :text="t('common.label.viewCount', { count: post.viewCount ?? 0 })" :delay-duration="200" :content="{ side: 'top' }">
|
|
136
|
+
<span class="inline-flex items-center gap-0.5 tabular-nums">
|
|
137
|
+
<UIcon name="i-lucide-eye" class="size-3 shrink-0" />{{ post.viewCount ?? 0 }}
|
|
138
|
+
</span>
|
|
139
|
+
</UTooltip>
|
|
140
|
+
<UTooltip :text="t('list.likeCount', { count: post.likeCount ?? 0 })" :delay-duration="200" :content="{ side: 'top' }">
|
|
141
|
+
<span class="inline-flex items-center gap-0.5 tabular-nums">
|
|
142
|
+
<UIcon name="i-lucide-heart" class="size-3 shrink-0" />{{ post.likeCount ?? 0 }}
|
|
143
|
+
</span>
|
|
144
|
+
</UTooltip>
|
|
143
145
|
</div>
|
|
144
146
|
</div>
|
|
145
147
|
</div>
|
|
@@ -67,19 +67,17 @@ function thumb(post: PostModel): string | undefined {
|
|
|
67
67
|
</component>
|
|
68
68
|
|
|
69
69
|
<div class="flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 text-[11px] leading-none text-muted">
|
|
70
|
-
<
|
|
70
|
+
<UTooltip :delay-duration="200" :content="{ side: 'top' }" :ui="{ content: 'h-auto px-3 py-2' }">
|
|
71
71
|
<time
|
|
72
72
|
:datetime="post.createdAt?.toDate?.().toISOString()"
|
|
73
|
-
class="
|
|
73
|
+
class="tabular-nums"
|
|
74
74
|
>
|
|
75
75
|
{{ formatRelativeDate(post.createdAt, now) }}
|
|
76
76
|
</time>
|
|
77
77
|
<template #content>
|
|
78
|
-
<
|
|
79
|
-
{{ formatTimestampDetails(post.createdAt, post.updatedAt).join('\n') }}
|
|
80
|
-
</p>
|
|
78
|
+
<span class="whitespace-pre-line">{{ formatTimestampDetails(post.createdAt, post.updatedAt).join('\n') }}</span>
|
|
81
79
|
</template>
|
|
82
|
-
</
|
|
80
|
+
</UTooltip>
|
|
83
81
|
<span class="text-default/40" aria-hidden="true">|</span>
|
|
84
82
|
<span class="font-medium text-toned">
|
|
85
83
|
<MemiBoardAuthorMenu
|
|
@@ -99,9 +97,11 @@ function thumb(post: PostModel): string | undefined {
|
|
|
99
97
|
>
|
|
100
98
|
<UIcon name="i-lucide-paperclip" class="size-3 shrink-0" />{{ post.attachments.length }}
|
|
101
99
|
</span>
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
|
|
100
|
+
<UTooltip :text="t('common.label.viewCount', { count: post.viewCount ?? 0 })" :delay-duration="200" :content="{ side: 'top' }">
|
|
101
|
+
<span class="inline-flex items-center gap-0.5 tabular-nums">
|
|
102
|
+
<UIcon name="i-lucide-eye" class="size-3 shrink-0" />{{ post.viewCount ?? 0 }}
|
|
103
|
+
</span>
|
|
104
|
+
</UTooltip>
|
|
105
105
|
<template v-if="(post.likeCount ?? 0) > 0">
|
|
106
106
|
<span class="text-default/40" aria-hidden="true">|</span>
|
|
107
107
|
<span class="inline-flex items-center gap-0.5 tabular-nums">
|
|
@@ -84,10 +84,12 @@ function image(post: PostModel): string | undefined {
|
|
|
84
84
|
</div>
|
|
85
85
|
|
|
86
86
|
<!-- 우측 상단: 좋아요 개수만 -->
|
|
87
|
-
<
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
<UTooltip :text="t('list.likeCount', { count: post.likeCount ?? 0 })" :delay-duration="200" :content="{ side: 'top' }" class="absolute right-2.5 top-2.5 sm:right-3 sm:top-3">
|
|
88
|
+
<span class="flex items-center gap-1 rounded-full bg-black/50 px-2 py-0.5 text-xs tabular-nums text-white">
|
|
89
|
+
<UIcon name="i-lucide-heart" class="size-3" />
|
|
90
|
+
{{ post.likeCount ?? 0 }}
|
|
91
|
+
</span>
|
|
92
|
+
</UTooltip>
|
|
91
93
|
</component>
|
|
92
94
|
</div>
|
|
93
95
|
</MemiBoardSurface>
|