@ehfuse/taskbox 0.7.45 → 0.7.47

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.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 글 입력칸 도우미(2026-10-16) — "@" 언급 자동완성과 "/" 명령(이모지 넣기).
3
+ *
4
+ * - "@" 뒤로 치는 글자로 사람 후보(TaskboxConfig.mentionCandidates)를 걸러 고르면 "@이름 " 이 들어간다.
5
+ * - "/" 뒤로 치는 글자로 명령(TaskboxConfig.slashCommands — true 면 기본 이모지 목록)을 걸러 고르면 그 글(이모지)이 들어간다.
6
+ * 위 · 아래 화살표로 옮기고 Enter · Tab 으로 고르며 Esc 로 닫는다. 소비처가 후보 · 명령을 안 넘기면 아무것도 하지 않는다(지금과 같다).
7
+ *
8
+ * 쓰는 법 — 입력칸에 `inputRef` 와 `onKeyDown`(먼저 부르고, true 면 자기 키 처리를 건너뛴다) · `onSelectionChange`(onSelect) 를 잇고, `popper` 를 옆에 그린다.
9
+ * 입력칸의 값 · 바꾸기(value · setValue)는 소비처 것을 그대로 쓴다(제어 입력칸).
10
+ */
11
+ import { type KeyboardEvent, type ReactNode } from "react";
12
+ import type { TaskboxMentionCandidate, TaskboxSlashCommand } from "../types/provider";
13
+ /** 기본 "/" 명령 — 자주 쓰는 이모지. 이름(한글) · 다른 이름으로 찾는다. */
14
+ export declare const DEFAULT_SLASH_COMMANDS: TaskboxSlashCommand[];
15
+ /** "@" 언급 · "/" 명령 도우미. 이름은 처음 만든 "@" 자동완성 이름을 그대로 둔다(소비처 import 호환). */
16
+ export declare function useMentionAutocomplete({ value, setValue, candidates, slashCommands, }: {
17
+ value: string;
18
+ setValue: (next: string) => void;
19
+ candidates?: TaskboxMentionCandidate[];
20
+ slashCommands?: TaskboxSlashCommand[] | boolean;
21
+ }): {
22
+ inputRef: (element: HTMLTextAreaElement | HTMLInputElement | null) => void;
23
+ onKeyDown: (event: KeyboardEvent) => boolean;
24
+ onSelectionChange: () => void;
25
+ popper: ReactNode;
26
+ };
@@ -24,6 +24,19 @@ export interface TaskboxFileUrlOptions {
24
24
  thumb?: "sm" | "md" | "lg";
25
25
  download?: boolean;
26
26
  }
27
+ /** @이름 언급 후보 한 사람이다. */
28
+ export interface TaskboxMentionCandidate {
29
+ name: string;
30
+ avatar?: string;
31
+ subtitle?: string;
32
+ }
33
+ /** "/" 명령 한 줄이다 — 고르면 insert 글이 "/검색어" 자리에 들어간다. */
34
+ export interface TaskboxSlashCommand {
35
+ key: string;
36
+ label: string;
37
+ insert: string;
38
+ keywords?: string[];
39
+ }
27
40
  /** UI 교체 슬롯 모음이다. */
28
41
  export interface TaskboxSlots {
29
42
  avatar?: ComponentType<TaskboxAvatarProps>;
@@ -104,6 +117,16 @@ export interface TaskboxConfig {
104
117
  * prop 을 따로 뚫지 않은 자리(ReceiverAvatarStack)는 여기서 읽는다(없으면 이니셜).
105
118
  */
106
119
  avatarSrcByName?: Map<string, string>;
120
+ /**
121
+ * @이름 언급 후보(2026-10-16) — 지정하면 댓글 입력칸에서 "@" 를 치면 이 목록에서 고르는 자동완성이 뜬다.
122
+ * 미지정(기본)=자동완성 없음(지금과 같다). 고르면 "@이름 " 이 글에 들어가고, 알림은 소비처 서버가 글에서 찾아 보낸다.
123
+ */
124
+ mentionCandidates?: TaskboxMentionCandidate[];
125
+ /**
126
+ * "/" 명령(2026-10-16) — 댓글 입력칸에서 "/" 를 치면 고르는 목록(이모지 넣기 등). true = 기본 이모지 목록(DEFAULT_SLASH_COMMANDS).
127
+ * 미지정 · false(기본)=끔(지금과 같다).
128
+ */
129
+ slashCommands?: boolean | TaskboxSlashCommand[];
107
130
  /** 로그인 계정 seq — 완료 "되돌리기" 판정 등 화면 곳곳의 본인 판정에 쓴다(prop 을 안 받는 자리용). */
108
131
  myAccountSeq?: number;
109
132
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ehfuse/taskbox",
3
- "version": "0.7.45",
3
+ "version": "0.7.47",
4
4
  "description": "A React/MUI task inbox component with notices, per-user assignments, read tracking, and mobile card UI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",