memi-board 0.4.14 → 0.5.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 CHANGED
@@ -227,21 +227,21 @@ const router = useRouter()
227
227
  **List props:** `pageSize`, `category`, `postLinkBase`, `getPostLink(post)`, `linkBase`(deprecated)
228
228
 
229
229
  **Editor props:** `postId`(수정), `fixedCategory`(path 고정 시 선택 UI 숨김)
230
- 본문은 Nuxt UI **`UEditor`**(TipTap, `content-type="markdown"`). 호스트 `@nuxt/ui` 4.x 에 Editor 포함 필요.
230
+ 본문은 Nuxt UI **`UEditor`**(TipTap, `content-type="html"`). 호스트 `@nuxt/ui` 4.x 에 Editor 포함 필요.
231
231
 
232
232
  **에디터 이미지:** 툴바 / 붙여넣기 / 드롭 → Firebase Storage
233
233
  `{prefix}/posts/{postId}/images/*` + `.../images/thumbnails/*` (원본+썸네일).
234
- 본문 markdown 에는 원본 URL. 수정 중 버려진 파일은 호스트 스케줄러로 정리 (`extractEditorImageUrls` 로 본문 참조 비교).
234
+ 본문 HTML에는 원본 URL. 수정 중 버려진 파일은 호스트 스케줄러로 정리 (`extractEditorImageUrls` 로 본문 참조 비교).
235
235
 
236
236
  **composables:**
237
237
  `useMemiBoardAuth`, `useMemiBoardPosts`, `useMemiBoardComments`, `useMemiBoardStorage`, `useMemiBoardModeration`, `useMemiBoardSettings`
238
238
 
239
239
  ### 카테고리
240
240
 
241
- - 문서: `{prefix}Settings/config` → `categories: { id, label }[]`
242
- - 문서 없으면 UI는 기본(자유/공지/질문)으로 동작
243
- - **로그인 사용자**가 글쓰기 폼에서 카테고리 추가 가능 (`ensureSettings`로 문서 시드)
244
- - 관리자 전용 설정 UI는 없음 — 콘솔에서 배열 수정 가능
241
+ - 문서: `{prefix}Settings/config/categories/{categoryId}` → `{ label, listView, order, updatedAt }`
242
+ - 설정이 없으면 빈 목록이며 기본 카테고리를 자동 생성하지 않음
243
+ - `MemiBoardSettings`에서 관리자가 카테고리별 저장·삭제·순서·리스트뷰 관리
244
+ - `categoryId`는 문서 ID이자 게시글의 `category` 참조값이므로 생성 후 변경하지 않는 것을 권장
245
245
 
246
246
  ### 로그인 공급자
247
247
 
@@ -1,6 +1,8 @@
1
1
  import { DocumentData, QueryDocumentSnapshot } from 'firebase/firestore';
2
2
  import { Attachment, PostDetail, PostModel } from '../types';
3
3
  export interface CreatePostInput {
4
+ /** 작성 화면 진입 시 미리 만든 Firestore 자동 ID. Storage namespace와 동일하게 사용한다. */
5
+ postId?: string;
4
6
  title: string;
5
7
  content: string;
6
8
  tags?: string[];
@@ -20,6 +22,7 @@ export interface UpdatePostInput {
20
22
  }
21
23
  /** 목록 조회는 posts/{id} 메타만 읽고, 본문(body/main)은 상세 조회 시에만 읽는다. */
22
24
  export declare function useMemiBoardPosts(): {
25
+ createPostId: () => string;
23
26
  getPosts: (opts?: {
24
27
  pageSize?: number;
25
28
  cursor?: QueryDocumentSnapshot<DocumentData>;
@@ -31,6 +34,11 @@ export declare function useMemiBoardPosts(): {
31
34
  hasMore: boolean;
32
35
  }>;
33
36
  getPost: (id: string) => Promise<PostDetail | null>;
37
+ getPostBySlug: (category: string, slug: string) => Promise<PostDetail | null>;
38
+ getAdjacentPosts: (current: PostModel) => Promise<{
39
+ previous: PostModel | null;
40
+ next: PostModel | null;
41
+ }>;
34
42
  createPost: (input: CreatePostInput) => Promise<string>;
35
43
  updatePost: (id: string, input: UpdatePostInput) => Promise<void>;
36
44
  deletePost: (id: string) => Promise<void>;
@@ -1,19 +1,15 @@
1
1
  import { BoardCategory } from '../types';
2
- /** 설정 문서가 없을 때 UI·시드에 쓰는 기본 카테고리. */
2
+ /** 필요할 때 호스트가 명시적으로 사용할 수 있는 예시 카테고리. 자동 적용하지 않는다. */
3
3
  export declare const DEFAULT_CATEGORIES: BoardCategory[];
4
- /**
5
- * 게시판 설정({prefix}Settings/config) — 카테고리 옵션 목록.
6
- *
7
- * - 읽기: 전체 공개 (useDocument 실시간)
8
- * - 문서 없음: DEFAULT 로 보여 주고, 로그인 사용자가 처음 쓰거나 추가할 때 시드 생성
9
- * - 카테고리 추가: 로그인 사용자 (글쓰기 폼에서 즉시 추가)
10
- */
4
+ /** 게시판 카테고리 — `{prefix}Settings/config/categories/{categoryId}` 개별 문서. */
11
5
  export declare function useMemiBoardSettings(): {
12
6
  categories: import('vue').ComputedRef<BoardCategory[]>;
13
7
  categoryLabel: (id: string | undefined) => string | undefined;
14
8
  settingsPending: import('vue').Ref<boolean, boolean>;
15
9
  ensureSettings: () => Promise<void>;
16
10
  addCategory: (label: string) => Promise<string>;
11
+ saveCategory: (category: BoardCategory, order?: number) => Promise<void>;
17
12
  saveCategories: (next: BoardCategory[]) => Promise<void>;
13
+ deleteCategory: (id: string) => Promise<void>;
18
14
  DEFAULT_CATEGORIES: BoardCategory[];
19
15
  };
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { useMemiBoardSettings, DEFAULT_CATEGORIES } from './composables/useMemiB
12
12
  export { versionHistory } from './data/versionHistory';
13
13
  export type { VersionHistoryEntry } from './data/versionHistory';
14
14
  export { formatDate } from './utils/formatDate';
15
+ export { slugify } from './utils/slugify';
15
16
  export { DEFAULT_BLOCK_BAN_THRESHOLD, DEFAULT_BLOCK_BAN_DECAY_MS, effectiveModerationBlockCount, isModerationWriteRestricted, moderationWriteRestrictedUntilMs, formatRestrictedUntilLabel, } from './utils/moderation-strike';
16
17
  export type { Attachment, EditorImageEntry, ModerationStatus, PostModel, PostDetail, CommentModel, BoardUserRole, BoardCategory, BoardListView, BoardSettingsModel, ModerationResult, } from './types';
17
18
  export { compressImage } from './utils/compressImage';