memi-board 0.7.0 → 0.9.1
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/composables/useMemiBoardComments.d.ts +81 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +462 -282
- package/dist/index.js.map +1 -1
- package/dist/runtime/components/CommentForm.vue +21 -6
- package/dist/runtime/components/CommentItem.vue +73 -0
- package/dist/runtime/components/CommentList.vue +83 -39
- package/dist/runtime/components/CommentSkeleton.vue +12 -0
- package/dist/runtime/components/CommentThread.vue +121 -0
- package/dist/runtime/components/Detail.vue +3 -6
- package/dist/runtime/components/Users.vue +2 -3
- package/dist/types.d.ts +11 -0
- package/docs/firestore.rules.example +65 -4
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -236,6 +236,8 @@ const router = useRouter()
|
|
|
236
236
|
**composables:**
|
|
237
237
|
`useMemiBoardAuth`, `useMemiBoardPosts`, `useMemiBoardComments`, `useMemiBoardStorage`, `useMemiBoardModeration`, `useMemiBoardSettings`, `useMemiBoardUsers`
|
|
238
238
|
|
|
239
|
+
댓글은 시간순으로 10개씩 cursor 조회하며, 실제 `댓글 더보기` 버튼이 화면에 들어오면 1초 후 자동으로 다음 페이지를 읽는다. 기존 댓글을 모두 읽은 뒤에만 최신 댓글 1개를 실시간 구독한다. 대댓글은 5개씩 조회하고 모두 읽은 뒤 최신 답글 1개를 실시간 구독하며, 화면 깊이는 최대 2단계로 표시한다.
|
|
240
|
+
|
|
239
241
|
### 카테고리
|
|
240
242
|
|
|
241
243
|
- 문서: `{prefix}Settings/config/categories/{categoryId}` → `{ label, listView, writeRole, order, updatedAt }`
|
|
@@ -6,9 +6,86 @@ export interface AddCommentInput {
|
|
|
6
6
|
authorName: string | null;
|
|
7
7
|
authorPhoto: string | null;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export interface AddReplyInput extends AddCommentInput {
|
|
10
|
+
parent: CommentModel;
|
|
11
|
+
}
|
|
12
|
+
/** 10개씩 순차 조회한 뒤 마지막 페이지에서만 최신 1개를 실시간 구독한다. */
|
|
13
|
+
export declare function useMemiBoardComments(postId: string | Ref<string>, options?: {
|
|
14
|
+
subscribe?: boolean;
|
|
15
|
+
}): {
|
|
16
|
+
comments: import('vue').ComputedRef<CommentModel[]>;
|
|
17
|
+
commentsPending: import('vue').ComputedRef<boolean>;
|
|
18
|
+
hasMore: Ref<boolean, boolean>;
|
|
19
|
+
loadingMore: Ref<boolean, boolean>;
|
|
20
|
+
loadMore: () => Promise<void>;
|
|
12
21
|
addComment: (input: AddCommentInput) => Promise<void>;
|
|
13
|
-
|
|
22
|
+
addReply: (input: AddReplyInput) => Promise<void>;
|
|
23
|
+
deleteComment: (comment: CommentModel) => Promise<void>;
|
|
24
|
+
};
|
|
25
|
+
/** 펼친 스레드의 답글을 5개씩 일회성 조회한다. */
|
|
26
|
+
export declare function useMemiBoardReplies(postId: string, rootId: string): {
|
|
27
|
+
replies: Ref<{
|
|
28
|
+
id?: string | undefined;
|
|
29
|
+
postId: string;
|
|
30
|
+
body: string;
|
|
31
|
+
authorUid: string;
|
|
32
|
+
authorName: string | null;
|
|
33
|
+
authorPhoto: string | null;
|
|
34
|
+
moderationStatus: import('..').ModerationStatus;
|
|
35
|
+
createdAt: {
|
|
36
|
+
readonly seconds: number;
|
|
37
|
+
readonly nanoseconds: number;
|
|
38
|
+
toDate: () => Date;
|
|
39
|
+
toMillis: () => number;
|
|
40
|
+
isEqual: (other: import('firebase/firestore').Timestamp) => boolean;
|
|
41
|
+
toString: () => string;
|
|
42
|
+
toJSON: () => {
|
|
43
|
+
seconds: number;
|
|
44
|
+
nanoseconds: number;
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
valueOf: () => string;
|
|
48
|
+
};
|
|
49
|
+
parentId?: string | null | undefined;
|
|
50
|
+
rootId?: string | undefined;
|
|
51
|
+
depth?: number | undefined;
|
|
52
|
+
replyToUid?: string | null | undefined;
|
|
53
|
+
replyToName?: string | null | undefined;
|
|
54
|
+
replyCount?: number | undefined;
|
|
55
|
+
isReply?: boolean | undefined;
|
|
56
|
+
}[], CommentModel[] | {
|
|
57
|
+
id?: string | undefined;
|
|
58
|
+
postId: string;
|
|
59
|
+
body: string;
|
|
60
|
+
authorUid: string;
|
|
61
|
+
authorName: string | null;
|
|
62
|
+
authorPhoto: string | null;
|
|
63
|
+
moderationStatus: import('..').ModerationStatus;
|
|
64
|
+
createdAt: {
|
|
65
|
+
readonly seconds: number;
|
|
66
|
+
readonly nanoseconds: number;
|
|
67
|
+
toDate: () => Date;
|
|
68
|
+
toMillis: () => number;
|
|
69
|
+
isEqual: (other: import('firebase/firestore').Timestamp) => boolean;
|
|
70
|
+
toString: () => string;
|
|
71
|
+
toJSON: () => {
|
|
72
|
+
seconds: number;
|
|
73
|
+
nanoseconds: number;
|
|
74
|
+
type: string;
|
|
75
|
+
};
|
|
76
|
+
valueOf: () => string;
|
|
77
|
+
};
|
|
78
|
+
parentId?: string | null | undefined;
|
|
79
|
+
rootId?: string | undefined;
|
|
80
|
+
depth?: number | undefined;
|
|
81
|
+
replyToUid?: string | null | undefined;
|
|
82
|
+
replyToName?: string | null | undefined;
|
|
83
|
+
replyCount?: number | undefined;
|
|
84
|
+
isReply?: boolean | undefined;
|
|
85
|
+
}[]>;
|
|
86
|
+
loading: Ref<boolean, boolean>;
|
|
87
|
+
loaded: Ref<boolean, boolean>;
|
|
88
|
+
hasMore: Ref<boolean, boolean>;
|
|
89
|
+
loadMore: () => Promise<void>;
|
|
90
|
+
refresh: () => Promise<void>;
|
|
14
91
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export type { MemiBoardConfig, MemiBoardAuthOptions, MemiBoardModerationOptions
|
|
|
4
4
|
export { useMemiBoardAuth } from './composables/useMemiBoardAuth';
|
|
5
5
|
export { useMemiBoardPosts } from './composables/useMemiBoardPosts';
|
|
6
6
|
export type { CreatePostInput, UpdatePostInput } from './composables/useMemiBoardPosts';
|
|
7
|
-
export { useMemiBoardComments } from './composables/useMemiBoardComments';
|
|
8
|
-
export type { AddCommentInput } from './composables/useMemiBoardComments';
|
|
7
|
+
export { useMemiBoardComments, useMemiBoardReplies } from './composables/useMemiBoardComments';
|
|
8
|
+
export type { AddCommentInput, AddReplyInput } from './composables/useMemiBoardComments';
|
|
9
9
|
export { useMemiBoardModeration } from './composables/useMemiBoardModeration';
|
|
10
10
|
export { useMemiBoardStorage } from './composables/useMemiBoardStorage';
|
|
11
11
|
export { useMemiBoardSettings, DEFAULT_CATEGORIES } from './composables/useMemiBoardSettings';
|