@ehfuse/taskbox 0.7.46 → 0.7.48
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/dist/index.esm.js +15 -15
- package/dist/index.esm.js.map +3 -3
- package/dist/index.js +37 -37
- package/dist/index.js.map +3 -3
- package/dist/sections/useMentionAutocomplete.d.ts +12 -5
- package/dist/types/provider.d.ts +12 -0
- package/package.json +1 -1
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* 고르면 "@" 부터 친 글자까지를 "@이름 " 으로 바꾼다. 후보가 없으면(소비처가 mentionCandidates 를 안 넘기면) 아무것도 하지 않는다.
|
|
2
|
+
* 글 입력칸 도우미(2026-10-16) — "@" 언급 자동완성과 "/" 명령(이모지 넣기).
|
|
4
3
|
*
|
|
5
|
-
*
|
|
4
|
+
* - "@" 뒤로 치는 글자로 사람 후보(TaskboxConfig.mentionCandidates)를 걸러 고르면 "@이름 " 이 들어간다.
|
|
5
|
+
* - "/" 뒤로 치는 글자로 명령(TaskboxConfig.slashCommands — true 면 기본 이모지 목록)을 걸러 고르면 그 글(이모지)이 들어간다.
|
|
6
|
+
* 위 · 아래 화살표로 옮기고 Enter · Tab 으로 고르며 Esc 로 닫는다. 소비처가 후보 · 명령을 안 넘기면 아무것도 하지 않는다(지금과 같다).
|
|
7
|
+
*
|
|
8
|
+
* 쓰는 법 — 입력칸에 `inputRef` 와 `onKeyDown`(먼저 부르고, true 면 자기 키 처리를 건너뛴다) · `onSelectionChange`(onSelect) 를 잇고, `popper` 를 옆에 그린다.
|
|
6
9
|
* 입력칸의 값 · 바꾸기(value · setValue)는 소비처 것을 그대로 쓴다(제어 입력칸).
|
|
7
10
|
*/
|
|
8
11
|
import { type KeyboardEvent, type ReactNode } from "react";
|
|
9
|
-
import type { TaskboxMentionCandidate } from "../types/provider";
|
|
10
|
-
|
|
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, }: {
|
|
11
17
|
value: string;
|
|
12
18
|
setValue: (next: string) => void;
|
|
13
19
|
candidates?: TaskboxMentionCandidate[];
|
|
20
|
+
slashCommands?: TaskboxSlashCommand[] | boolean;
|
|
14
21
|
}): {
|
|
15
22
|
inputRef: (element: HTMLTextAreaElement | HTMLInputElement | null) => void;
|
|
16
23
|
onKeyDown: (event: KeyboardEvent) => boolean;
|
package/dist/types/provider.d.ts
CHANGED
|
@@ -30,6 +30,13 @@ export interface TaskboxMentionCandidate {
|
|
|
30
30
|
avatar?: string;
|
|
31
31
|
subtitle?: string;
|
|
32
32
|
}
|
|
33
|
+
/** "/" 명령 한 줄이다 — 고르면 insert 글이 "/검색어" 자리에 들어간다. */
|
|
34
|
+
export interface TaskboxSlashCommand {
|
|
35
|
+
key: string;
|
|
36
|
+
label: string;
|
|
37
|
+
insert: string;
|
|
38
|
+
keywords?: string[];
|
|
39
|
+
}
|
|
33
40
|
/** UI 교체 슬롯 모음이다. */
|
|
34
41
|
export interface TaskboxSlots {
|
|
35
42
|
avatar?: ComponentType<TaskboxAvatarProps>;
|
|
@@ -115,6 +122,11 @@ export interface TaskboxConfig {
|
|
|
115
122
|
* 미지정(기본)=자동완성 없음(지금과 같다). 고르면 "@이름 " 이 글에 들어가고, 알림은 소비처 서버가 글에서 찾아 보낸다.
|
|
116
123
|
*/
|
|
117
124
|
mentionCandidates?: TaskboxMentionCandidate[];
|
|
125
|
+
/**
|
|
126
|
+
* "/" 명령(2026-10-16) — 댓글 입력칸에서 "/" 를 치면 고르는 목록(이모지 넣기 등). true = 기본 이모지 목록(DEFAULT_SLASH_COMMANDS).
|
|
127
|
+
* 미지정 · false(기본)=끔(지금과 같다).
|
|
128
|
+
*/
|
|
129
|
+
slashCommands?: boolean | TaskboxSlashCommand[];
|
|
118
130
|
/** 로그인 계정 seq — 완료 "되돌리기" 판정 등 화면 곳곳의 본인 판정에 쓴다(prop 을 안 받는 자리용). */
|
|
119
131
|
myAccountSeq?: number;
|
|
120
132
|
/**
|
package/package.json
CHANGED