@ihabdevteam/core 0.440.0 → 0.442.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/components.cjs.js +178 -178
  3. package/dist/components.esm.css +1 -1
  4. package/dist/hooks.cjs.js +5 -5
  5. package/dist/i18n.cjs.js +1 -1
  6. package/dist/ihabdevteam-core.cjs.js +187 -187
  7. package/dist/ihabdevteam-core.d.ts +203 -2
  8. package/dist/packages/core/src/components/CardSection.css +26 -0
  9. package/dist/packages/core/src/components/CardSection.d.ts +32 -0
  10. package/dist/packages/core/src/components/CardSection.js +23 -0
  11. package/dist/packages/core/src/components/FolderGrid.js +9 -17
  12. package/dist/packages/core/src/components/FolderSearchSections.d.ts +25 -0
  13. package/dist/packages/core/src/components/FolderSearchSections.js +18 -0
  14. package/dist/packages/core/src/components/Popup/ListPopup.js +3 -1
  15. package/dist/packages/core/src/components/Popup/useDiscardGuard.d.ts +26 -0
  16. package/dist/packages/core/src/components/Popup/useDiscardGuard.js +28 -0
  17. package/dist/packages/core/src/components.d.ts +6 -2
  18. package/dist/packages/core/src/components.js +4 -1
  19. package/dist/packages/core/src/hooks/useCardDragToGroup.d.ts +33 -0
  20. package/dist/packages/core/src/hooks/useCardDragToGroup.js +52 -0
  21. package/dist/packages/core/src/hooks/useFolderBrowse.d.ts +30 -0
  22. package/dist/packages/core/src/hooks/useFolderBrowse.js +38 -0
  23. package/dist/packages/core/src/hooks/usePageSizeOptions.d.ts +19 -0
  24. package/dist/packages/core/src/hooks/usePageSizeOptions.js +25 -0
  25. package/dist/packages/core/src/hooks.d.ts +3 -0
  26. package/dist/packages/core/src/hooks.js +4 -0
  27. package/dist/packages/core/src/utils/folderMenu.d.ts +27 -0
  28. package/dist/packages/core/src/utils/folderMenu.js +19 -0
  29. package/dist/packages/core/src/utils.d.ts +2 -0
  30. package/dist/packages/core/src/utils.js +1 -0
  31. package/dist/packages/core/src/version.d.ts +1 -1
  32. package/dist/packages/core/src/version.js +1 -1
  33. package/dist/utils.cjs.js +164 -164
  34. package/package.json +1 -1
@@ -2,7 +2,7 @@ import { ComponentType } from 'react';
2
2
  import { Context } from 'react';
3
3
  import { CSSProperties } from 'react';
4
4
  import { Dispatch } from 'react';
5
- import type { DragEvent as DragEvent_2 } from 'react';
5
+ import { DragEvent as DragEvent_2 } from 'react';
6
6
  import type { ElementType } from 'react';
7
7
  import { FC } from 'react';
8
8
  import { FocusEvent as FocusEvent_2 } from 'react';
@@ -1256,6 +1256,37 @@ export declare const CAPABILITY: Record<WordTrainingTypeKey, {
1256
1256
  group: WordTrainingGroup;
1257
1257
  }>;
1258
1258
 
1259
+ /**
1260
+ * **카드를 끌어 묶음(폴더)에 놓는다** — HTML5 끌어 놓기를 한 벌로 쥔다(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
1261
+ *
1262
+ * 카드 요소에는 `cardProps(payload)` 를, 놓일 자리(폴더 칸 등)에는 `groupProps(key)` 를 얹는다. 실제로 옮기는 일은
1263
+ * `onDrop(payload, key)` 에 맡긴다(열쇠 → 묶음 찾기는 부르는 쪽 몫). `dragging` · `draggingId` · `dragOverKey` 로 그리는 꼴을 바꾼다.
1264
+ *
1265
+ * · 기본은 `T = string`(카드 id 가 곧 짐)이다. 여러 종류를 한 화면에서 다루면 `T` 를 객체로 두고 `getId` 로 id 를 뽑고,
1266
+ * `groupProps` 의 `accept` 로 자리마다 받을 짐을 가린다.
1267
+ * · 강조(`dragOverKey`)는 `onDragEnter` 와 `onDragOver` 양쪽에서 건다 — 자리가 `onDragEnter` 를 안 넘기는 조각이어도 선다.
1268
+ * · 자식으로 옮겨 가며 나는 `dragleave` 는 버린다 — `relatedTarget` 이 자리 **밖**일 때만 강조를 끈다.
1269
+ *
1270
+ * `FolderGrid` 의 폴더 칸 끌기도 이 훅으로 선다(전에는 같은 상태를 제 안에서 다시 지었다).
1271
+ * @public
1272
+ */
1273
+ export declare interface CardDragToGroup<T> {
1274
+ dragging: T | null;
1275
+ draggingId: string | null;
1276
+ dragOverKey: string | null;
1277
+ cardProps: (payload: T) => {
1278
+ draggable: true;
1279
+ onDragStart: (e: DragEvent_2<HTMLElement>) => void;
1280
+ onDragEnd: () => void;
1281
+ };
1282
+ groupProps: (groupKey: string, accept?: (payload: T) => boolean) => {
1283
+ onDragOver: (e: DragEvent_2<HTMLElement>) => void;
1284
+ onDragEnter: () => void;
1285
+ onDragLeave: (e: DragEvent_2<HTMLElement>) => void;
1286
+ onDrop: (e: DragEvent_2<HTMLElement>) => void;
1287
+ };
1288
+ }
1289
+
1259
1290
  /** @public */
1260
1291
  declare function CardOrderStep({ _stepIndex, _totalSteps, ...rest }: StepWrapperProps): JSX.Element;
1261
1292
 
@@ -1266,6 +1297,38 @@ declare function CardOrderStep({ _stepIndex, _totalSteps, ...rest }: StepWrapper
1266
1297
  */
1267
1298
  export declare function cardQuestionTitle(typeKey: string | undefined, item: Record<string, unknown>, parts: string[]): string;
1268
1299
 
1300
+ /**
1301
+ * **카드가 서는 자리** — 회색 그룹 칸 없이 카드가 쪽 바탕에 바로 선다(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
1302
+ *
1303
+ * 전에는 목록마다 `TrainingCardGroup`(회색 칸 + 제목 + 수)이 감쌌다. 말귀 사장님 지시로 그 칸을 걷었다(*"숙제관리, 고객별 숙제
1304
+ * 페이지, 등등 그룹 ui 를 사용하고 있는곳이 많아. 모두 정리해주고"*) — 목록이 하나뿐인 자리에서는 칸의 제목과 수가 위의 탭 ·
1305
+ * 도구줄과 **같은 말을 한 번 더** 했고, 화면마다 칸이 있고 없고가 갈려 같은 카드가 다르게 보였다.
1306
+ *
1307
+ * · **목록이 하나뿐이면 제목을 안 준다** — 무엇의 목록인지는 탭과 도구줄이 이미 말한다.
1308
+ * · **여러 묶음을 한 화면에 나눠 세울 때만 제목을 준다**(진행 중 / 완료 · 훈련 종류별 · 폴더별) — 가르는 것이 정보인 자리다.
1309
+ * 제목은 가벼운 한 줄(이름 + 수)이고 칸을 두르지 않는다.
1310
+ * · 비었을 때의 말(`emptyContent`)은 **목록 자리에** 선다 — 못 받음 · 못 찾음 · 아직 없음을 갈라 말하던 것 그대로.
1311
+ * @public
1312
+ */
1313
+ export declare function CardSection({ title, count, titleLevel, actions, empty, emptyContent, className, children }: CardSectionProps): JSX.Element;
1314
+
1315
+ /** @public */
1316
+ export declare interface CardSectionProps {
1317
+ /** 묶음의 이름 — 한 화면에 묶음이 여럿일 때만 준다 */
1318
+ title?: ReactNode;
1319
+ /** 그 묶음의 수(쪽에 선 수가 아니라 전부) */
1320
+ count?: number;
1321
+ /** 제목의 머리글 급 — 쪽에 바로 서면 2, 창 안이면 3 */
1322
+ titleLevel?: 2 | 3 | 4;
1323
+ /** 제목 줄 오른쪽에 설 것 */
1324
+ actions?: ReactNode;
1325
+ /** 비었나 — 참이면 목록 대신 `emptyContent` 가 목록 자리에 선다 */
1326
+ empty?: boolean;
1327
+ emptyContent?: ReactNode;
1328
+ className?: string;
1329
+ children?: ReactNode;
1330
+ }
1331
+
1269
1332
  /** @public */
1270
1333
  export declare function CardStep({ _stepIndex, _totalSteps, ...rest }: StepWrapperProps): JSX.Element;
1271
1334
 
@@ -2162,7 +2225,7 @@ export declare function copyText(text: string): Promise<boolean>;
2162
2225
  *
2163
2226
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
2164
2227
  */
2165
- export declare const CORE_VERSION = "0.440.0";
2228
+ export declare const CORE_VERSION = "0.442.0";
2166
2229
 
2167
2230
  /** @public */
2168
2231
  declare const coreDefault: Record<string, unknown>;
@@ -2478,6 +2541,9 @@ export declare const DEFAULT_LOCALE = "ko";
2478
2541
 
2479
2542
  export declare const DEFAULT_NOISE_SETTINGS: CoreNoiseSettings;
2480
2543
 
2544
+ /** @public 목록 쪽당 개수의 기본값 — 말귀 회원앱 목록들이 쓰던 넷 */
2545
+ export declare const DEFAULT_PAGE_SIZES: readonly [10, 25, 50, 100];
2546
+
2481
2547
  /** @public */
2482
2548
  export declare function deriveNoiseContexts(trainingData: Record<string, unknown> | null | undefined): NoiseContext_2[];
2483
2549
 
@@ -3207,6 +3273,35 @@ export declare const folderJoin: (parent: string | null, name: string) => string
3207
3273
  /** @public 화면에 보일 이름 — 길의 마지막 마디 */
3208
3274
  export declare function folderLeaf(path: string): string;
3209
3275
 
3276
+ /** @public 폴더 메뉴의 줄을 정해진 차례 · 아이콘으로 짓는다 */
3277
+ export declare function folderMenuItems(lines: {
3278
+ /** 이 자리에 하나 더 만든다(무엇을 만드는지는 화면 몫) */
3279
+ add: FolderMenuLine;
3280
+ addFolder: FolderMenuLine;
3281
+ rename?: FolderMenuLine;
3282
+ remove?: FolderMenuLine;
3283
+ }): {
3284
+ label: string;
3285
+ icon: string;
3286
+ onClick: () => void;
3287
+ closeOnSelect: true;
3288
+ }[];
3289
+
3290
+ /**
3291
+ * **폴더 메뉴의 줄** — 길의 「이름 ▾」 와 폴더 칸의 ⋯ 가 여는 메뉴(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
3292
+ *
3293
+ * 화면마다 차례와 아이콘이 갈리면 안 되는 자리다: **더하기 → 폴더 추가 → (이름 바꾸기) → 폴더 삭제**. 구분선은 없고, 줄을 고르면 닫힌다.
3294
+ * 이름표는 부르는 쪽이 준다(무엇을 '더하는지' 는 화면마다 다르다 — 단어표 · 훈련 …).
3295
+ * · 맨 위의 메뉴는 `rename` · `remove` 를 안 준다(지울 폴더가 없다).
3296
+ * · 이름 바꾸기는 그 일이 있는 화면만 준다.
3297
+ * 돌려준 줄은 `FolderHead` 의 `folderMenu` · `rootMenu`, `FolderGrid` 의 `menuItems` 에 그대로 넘긴다.
3298
+ */
3299
+ /** @public 메뉴 한 줄 — 이름표와 할 일 */
3300
+ export declare interface FolderMenuLine {
3301
+ label: string;
3302
+ onClick: () => void;
3303
+ }
3304
+
3210
3305
  /**
3211
3306
  * 폴더 `from` 을 `toParent` 안으로 **옮겼을 때** `path` 의 새 길(사장님 지시 2026-11-13 "드래드 해서 다른 폴더에 넣거나 뺄 수
3212
3307
  * 있도록"). `path` 가 `from` 그 자체나 그 아래면 앞머리를 갈아 돌려주고, 상관없는 길이면 `undefined`.
@@ -3227,6 +3322,32 @@ export declare function folderMoveVerdict(from: string, into: string | null, exi
3227
3322
  /** @public 한 층 위 폴더의 길 — 맨 위 폴더면 `null`(맨 위) */
3228
3323
  export declare function folderParent(path: string): string | null;
3229
3324
 
3325
+ /**
3326
+ * **찾은 것을 폴더마다 나눠 세운다** — 찾는 중의 목록(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
3327
+ *
3328
+ * 찾는 중에는 폴더를 가리지 않고 **전부에서** 찾는다(`useFolderBrowse`). 찾은 것이 여러 폴더에 걸치므로 어느 폴더의 것인지가
3329
+ * 보여야 한다 — 폴더마다 가벼운 제목 한 줄(길 · 수)을 두고 그 아래 카드를 세운다(`CardSection`). 회색 그룹 칸은 두르지 않는다.
3330
+ * 폴더를 다루는 일(이름 고치기 · 지우기 · 끌어 놓기)은 여기 없다 — 찾는 중에 하는 일이 아니고, 폴더 메뉴에 있다.
3331
+ *
3332
+ * · **빈 폴더는 안 세운다** — 찾은 것이 없는 폴더의 제목만 줄줄이 서면 찾은 것이 묻힌다.
3333
+ * · 폴더 안의 폴더는 길(`앙/하위`)을 `앙 › 하위` 로 이어 보인다.
3334
+ * · 폴더 없는 것은 `noneLabel` 아래에 선다.
3335
+ * @public
3336
+ */
3337
+ export declare function FolderSearchSections<T>({ bundles, noneKey, noneLabel, titleLevel, rowRender }: FolderSearchSectionsProps<T>): JSX.Element;
3338
+
3339
+ /** @public */
3340
+ export declare interface FolderSearchSectionsProps<T> {
3341
+ /** 폴더마다의 찾은 것 — `[폴더의 길(없으면 noneKey), 그 줄들]`. 차례는 받은 그대로 */
3342
+ bundles: readonly (readonly [string, readonly T[]])[];
3343
+ /** 폴더 없는 것을 가리키는 열쇠 */
3344
+ noneKey: string;
3345
+ /** 폴더 없는 것의 이름 */
3346
+ noneLabel: string;
3347
+ titleLevel?: 2 | 3 | 4;
3348
+ rowRender: (row: T, slot: number) => ReactNode;
3349
+ }
3350
+
3230
3351
  /** @public 맨 위에서 그 폴더까지의 길 — 층마다 `{ path, label }`(길 · 보일 이름) */
3231
3352
  export declare function folderTrail(path: string): {
3232
3353
  path: string;
@@ -11373,6 +11494,9 @@ export declare interface UseCalendarMonthResult {
11373
11494
  setViewYM: (y: number, m: number) => void;
11374
11495
  }
11375
11496
 
11497
+ /** @public */
11498
+ export declare function useCardDragToGroup<T = string>(onDrop: (payload: T, groupKey: string) => void, getId?: (payload: T) => string): CardDragToGroup<T>;
11499
+
11376
11500
  /**
11377
11501
  * TextField의 `suggestions` 옵션이 쓰는 자동완성 콤보박스 상태/키보드 로직.
11378
11502
  * 순수 입력(값 관리)과 분리해서, 자동완성이 필요 없는 TextField 사용처는
@@ -11564,6 +11688,37 @@ export declare interface UseFitScaleResult {
11564
11688
  offset: number;
11565
11689
  }
11566
11690
 
11691
+ /**
11692
+ * **폴더로 보는 화면의 자리** — 지금 어느 폴더 안에 있나, 찾는 중인가, 새 폴더는 어디에 서나(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다).
11693
+ *
11694
+ * 말귀의 나의 단어표 · 나의 단어훈련 · 나의 문장훈련이 이 규칙을 한 벌씩 들고 있다가 앱에서 한 벌로 모았고, 코어 `FolderHead` 식구로 옮겼다.
11695
+ * 화면마다 같아야 하는 규칙이다:
11696
+ *
11697
+ * · **목록에 없는 폴더는 안 연 것으로 친다** — 들어가 있던 폴더를 지웠거나 보기(갈래)를 바꿔 그 폴더가 없으면 맨 위로 돌아온다.
11698
+ * · **찾는 중에는 폴더를 가리지 않는다** — 그때 새 폴더는 맨 위에 선다(길이 안 보이는데 안 보이는 폴더 안에 만들면 안 된다).
11699
+ * · 폴더를 열면 **첫 쪽으로** 돌아간다(`onOpen`) — 3쪽을 보다가 폴더에 들어가면 그 폴더의 3쪽(대개 빈 화면)이 선다.
11700
+ * · 들어가 있던 폴더가 옮겨지거나 이름이 바뀌면 **그 새 길로 따라간다** — 안 따라가면 맨 위로 튕긴다.
11701
+ * @public
11702
+ */
11703
+ export declare function useFolderBrowse({ paths, search, onOpen }: {
11704
+ /** 있는 폴더 전부의 길(중간 폴더까지 채운 것 — `withAncestors`) */
11705
+ paths: readonly string[];
11706
+ /** 찾는 말 — 비어 있지 않으면 찾는 중이다 */
11707
+ search: string;
11708
+ /** 폴더를 열거나 맨 위로 갈 때 함께 할 일 — 쪽을 첫 쪽으로 돌린다 */
11709
+ onOpen?: () => void;
11710
+ }): {
11711
+ opened: string | null;
11712
+ searching: boolean;
11713
+ open: (path: string | null) => void;
11714
+ reset: () => void;
11715
+ followMove: (from: string, into: string | null) => void;
11716
+ followRename: (from: string, to: string) => void;
11717
+ newFolderParent: string | null;
11718
+ /** 새 폴더가 설 자리에 이미 있는 이름들 — 같은 이름을 또 못 짓게 견준다 */
11719
+ siblingNames: string[];
11720
+ };
11721
+
11567
11722
  /** @public */
11568
11723
  export declare function useFontScale({ storageKey, baseFont, minScale, maxScale, step, lineHeightRatio, }?: UseFontScaleOptions): {
11569
11724
  scale: number;
@@ -11702,6 +11857,24 @@ export declare function usePagedList<T>(items: T[], perPage: number, page: numbe
11702
11857
  */
11703
11858
  export declare function usePageResetOnChange(key: string, setPage: (n: number) => void): void;
11704
11859
 
11860
+ /**
11861
+ * **"N개씩 보기" 보기 목록** — `Toolbar` 의 `pageSize.options` · `Dropdown` 에 그대로 넘긴다(말귀 청 (437) ㉳ⓐ, 2026-11-13).
11862
+ *
11863
+ * 코어가 `ListPopup` 안에서 `common.pageSizeLabel` 로 이 목록을 짓고도 내주지 않아, 말귀 앱 · 어드민이 사전 열쇠 세 벌과
11864
+ * 박은 한국어로 같은 것을 다시 지었다. 문구는 사전(`common.pageSizeLabel` — `{{n}}개씩 보기` · `Show {{n}}`) 한 벌이고,
11865
+ * 값(몇 개씩)은 화면마다 다르니 받는다. 값은 문자열로 돌려준다(드롭다운 값이 문자열이다).
11866
+ *
11867
+ * ```tsx
11868
+ * const options = usePageSizeOptions() // 10 · 25 · 50 · 100
11869
+ * const cards = usePageSizeOptions([12, 24, 48]) // 화면마다 다른 값
11870
+ * ```
11871
+ * @public
11872
+ */
11873
+ export declare function usePageSizeOptions(counts?: readonly number[]): {
11874
+ value: string;
11875
+ label: string;
11876
+ }[];
11877
+
11705
11878
  /**
11706
11879
  * 비밀번호 변경 폼 상태와 핸들러를 캡슐화한 훅.
11707
11880
  * showModal 상태는 컴포넌트가 직접 관리 (훅 밖에 두어야 모달 열기 트리거 제어 가능).
@@ -11889,6 +12062,26 @@ export declare function useTrainingTypeLabels(): {
11889
12062
  all: Record<string, string>;
11890
12063
  };
11891
12064
 
12065
+ /**
12066
+ * **값으로 묻는 닫기 막이** — 창이 처음 열린 때의 값과 지금 값을 견줘, 달라졌으면 닫기 전에 묻는다
12067
+ * (말귀 청 (437) ㉯, 2026-11-13).
12068
+ *
12069
+ * `useDiscardGuard` 는 참 · 거짓만 받는다. 그래서 말귀 앱 여섯 창이 저마다
12070
+ * `const [first] = useState(() => JSON.stringify(x))` 로 첫 모습을 얼리고 `JSON.stringify(cur) !== first` 를 넘겼다
12071
+ * (회사 정보 · 정보 입력 · 방문 고치기 · 방문 등록 · 고객 추가 · 단어훈련 묶음). 그 두 줄을 여기 한 벌로 둔다.
12072
+ *
12073
+ * · 첫 값은 **처음 그릴 때 한 번** 얼린다 — 그 뒤 부르는 쪽이 새 객체를 넘겨도 기준은 안 바뀐다.
12074
+ * · 견주기는 JSON 꼴로 한다 — 자리만 같고 새로 만든 객체 · 배열이어도 내용이 같으면 '안 달라짐' 이다.
12075
+ * (그래서 값에는 JSON 으로 옮길 수 있는 것만 넣는다 — 함수 · `Date` 의 시각 차 · `undefined` 칸은 견주기에서 빠진다.)
12076
+ * · 값을 늦게 불러오는 창은 다 불러온 뒤 `rebase()` 를 부른다 — 안 부르면 빈 첫 값과 견줘 늘 '달라짐' 이 된다.
12077
+ *
12078
+ * ```tsx
12079
+ * const { beforeClose, discardPopup, allowClose, isDirty } = useValueDiscardGuard(form, onClose)
12080
+ * ```
12081
+ * @public
12082
+ */
12083
+ export declare function useValueDiscardGuard(value: unknown, onClose: () => void, labels?: DiscardGuardLabels): ValueDiscardGuard;
12084
+
11892
12085
  /**
11893
12086
  * 통합 방문 전체보기 팝업의 검색/필터/페이지네이션 상태를 관리하는 훅.
11894
12087
  * `mergedVisits`(예정+완료+미방문)를 받아 파생 데이터를 계산.
@@ -12161,6 +12354,14 @@ export declare function validateSyllableSearchInput(input: string): {
12161
12354
  ok: boolean;
12162
12355
  };
12163
12356
 
12357
+ /** @public `useValueDiscardGuard` 가 돌려주는 것 — `DiscardGuard` 에 지금 달라졌나 · 기준 다시 잡기를 더한 것 */
12358
+ export declare interface ValueDiscardGuard extends DiscardGuard {
12359
+ /** 첫 값과 지금 값이 다른가 — 저장 단추를 켜고 끌 때도 쓴다 */
12360
+ isDirty: boolean;
12361
+ /** **지금 값을 새 기준으로 잡는다** — 늦게 불러온 값을 채운 뒤나, 저장해 놓고 창을 안 닫고 이어 쓸 때 부른다 */
12362
+ rebase: () => void;
12363
+ }
12364
+
12164
12365
  /** 선택 값(자모 문자열, 병합 버튼은 다자모)을 실제 매칭 자모 배열로 분해. NO_CODA는 빈 배열. */
12165
12366
  export declare const valueToJamos: (v: string) => string[];
12166
12367
 
@@ -0,0 +1,26 @@
1
+ /* **카드가 서는 자리**(`CardSection`) — 회색 그룹 칸 없이 카드가 쪽 바탕에 바로 선다(말귀 청 (437) ㉮).
2
+ 카드는 제 폭(360 · 작은 것 120)을 쥐고 있어 드는 만큼 나란히 선다. 한 줄의 카드는 키를 맞춘다. */
3
+ .card-section { display: flex; flex-direction: column; gap: var(--spacing-s); min-width: 0; }
4
+ /* 묶음이 여럿이면 묶음 사이를 넉넉히 띄운다 — 칸이 없으니 간격이 가름이다 */
5
+ .card-section + .card-section { margin-top: var(--spacing-l); }
6
+
7
+ /* 제목 줄 — 이름 · 수 · (오른쪽에) 단추. 칸을 두르지 않는 가벼운 한 줄이다 */
8
+ .card-section__head { display: flex; align-items: center; gap: var(--spacing-xs); min-height: 32px; }
9
+ .card-section__title { margin: 0; color: var(--color-text-primary); }
10
+ .card-section__count { color: var(--color-main-ink, var(--color-main)); }
11
+ .card-section__actions { margin-left: auto; display: inline-flex; align-items: center; gap: var(--spacing-xs); }
12
+
13
+ .card-section__list {
14
+ display: flex;
15
+ flex-wrap: wrap;
16
+ align-items: stretch;
17
+ gap: var(--spacing-s);
18
+ }
19
+ /* 카드가 자리보다 넓으면 줄어들 수 있게(폰) — 안 주면 360 이 버틴다 */
20
+ .card-section__list > * { min-width: 0; }
21
+
22
+ .card-section__empty {
23
+ padding: var(--spacing-xl) var(--spacing-m);
24
+ text-align: center;
25
+ color: var(--color-gray);
26
+ }
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from 'react';
2
+ import './CardSection.css';
3
+ /** @public */
4
+ export interface CardSectionProps {
5
+ /** 묶음의 이름 — 한 화면에 묶음이 여럿일 때만 준다 */
6
+ title?: ReactNode;
7
+ /** 그 묶음의 수(쪽에 선 수가 아니라 전부) */
8
+ count?: number;
9
+ /** 제목의 머리글 급 — 쪽에 바로 서면 2, 창 안이면 3 */
10
+ titleLevel?: 2 | 3 | 4;
11
+ /** 제목 줄 오른쪽에 설 것 */
12
+ actions?: ReactNode;
13
+ /** 비었나 — 참이면 목록 대신 `emptyContent` 가 목록 자리에 선다 */
14
+ empty?: boolean;
15
+ emptyContent?: ReactNode;
16
+ className?: string;
17
+ children?: ReactNode;
18
+ }
19
+ /**
20
+ * **카드가 서는 자리** — 회색 그룹 칸 없이 카드가 쪽 바탕에 바로 선다(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
21
+ *
22
+ * 전에는 목록마다 `TrainingCardGroup`(회색 칸 + 제목 + 수)이 감쌌다. 말귀 사장님 지시로 그 칸을 걷었다(*"숙제관리, 고객별 숙제
23
+ * 페이지, 등등 그룹 ui 를 사용하고 있는곳이 많아. 모두 정리해주고"*) — 목록이 하나뿐인 자리에서는 칸의 제목과 수가 위의 탭 ·
24
+ * 도구줄과 **같은 말을 한 번 더** 했고, 화면마다 칸이 있고 없고가 갈려 같은 카드가 다르게 보였다.
25
+ *
26
+ * · **목록이 하나뿐이면 제목을 안 준다** — 무엇의 목록인지는 탭과 도구줄이 이미 말한다.
27
+ * · **여러 묶음을 한 화면에 나눠 세울 때만 제목을 준다**(진행 중 / 완료 · 훈련 종류별 · 폴더별) — 가르는 것이 정보인 자리다.
28
+ * 제목은 가벼운 한 줄(이름 + 수)이고 칸을 두르지 않는다.
29
+ * · 비었을 때의 말(`emptyContent`)은 **목록 자리에** 선다 — 못 받음 · 못 찾음 · 아직 없음을 갈라 말하던 것 그대로.
30
+ * @public
31
+ */
32
+ export default function CardSection({ title, count, titleLevel, actions, empty, emptyContent, className, children }: CardSectionProps): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cx } from '../utils/cx';
4
+ import './CardSection.css';
5
+ /**
6
+ * **카드가 서는 자리** — 회색 그룹 칸 없이 카드가 쪽 바탕에 바로 선다(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
7
+ *
8
+ * 전에는 목록마다 `TrainingCardGroup`(회색 칸 + 제목 + 수)이 감쌌다. 말귀 사장님 지시로 그 칸을 걷었다(*"숙제관리, 고객별 숙제
9
+ * 페이지, 등등 그룹 ui 를 사용하고 있는곳이 많아. 모두 정리해주고"*) — 목록이 하나뿐인 자리에서는 칸의 제목과 수가 위의 탭 ·
10
+ * 도구줄과 **같은 말을 한 번 더** 했고, 화면마다 칸이 있고 없고가 갈려 같은 카드가 다르게 보였다.
11
+ *
12
+ * · **목록이 하나뿐이면 제목을 안 준다** — 무엇의 목록인지는 탭과 도구줄이 이미 말한다.
13
+ * · **여러 묶음을 한 화면에 나눠 세울 때만 제목을 준다**(진행 중 / 완료 · 훈련 종류별 · 폴더별) — 가르는 것이 정보인 자리다.
14
+ * 제목은 가벼운 한 줄(이름 + 수)이고 칸을 두르지 않는다.
15
+ * · 비었을 때의 말(`emptyContent`)은 **목록 자리에** 선다 — 못 받음 · 못 찾음 · 아직 없음을 갈라 말하던 것 그대로.
16
+ * @public
17
+ */
18
+ export default function CardSection({ title, count, titleLevel = 3, actions, empty = false, emptyContent, className, children }) {
19
+ const Heading = `h${titleLevel}`;
20
+ return (_jsxs("section", { className: cx('card-section', className), children: [title != null && (_jsxs("header", { className: "card-section__head", children: [_jsx(Heading, { className: "card-section__title h5b", children: title }), count != null && _jsx("span", { className: "card-section__count body-3b", children: count }), actions != null && _jsx("span", { className: "card-section__actions", children: actions })] })), empty
21
+ ? _jsx("div", { className: "card-section__empty body-3", children: emptyContent })
22
+ : _jsx("div", { className: "card-section__list", children: children })] }));
23
+ }
@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next';
5
5
  import Button from './Button';
6
6
  import Tooltip from './Tooltip/Tooltip';
7
7
  import MenuTooltip from './Tooltip/MenuTooltip';
8
+ import { useCardDragToGroup } from '../hooks/useCardDragToGroup';
8
9
  import './FolderGrid.css';
9
10
  /**
10
11
  * **폴더 칸의 격자** — 폴더 하나가 단추 하나(아이콘 · 이름 · 든 수)이고, 누르면 그 안으로 들어간다(말귀 청 (435)).
@@ -22,31 +23,22 @@ export default function FolderGrid({ folders, onOpen, dropProps, dropOver, menuI
22
23
  const { t } = useTranslation();
23
24
  /** 메뉴가 열린 폴더와 그 단추 */
24
25
  const [menu, setMenu] = useState(null);
25
- /** 지금 끌고 있는 폴더 칸 · 그것이 떠 있는 칸 — 카드 끌기(화면의 손)와 따로 쥔다 */
26
- const [draggingFolder, setDraggingFolder] = useState(null);
27
- const [folderOver, setFolderOver] = useState(null);
26
+ /* **폴더 칸 끌기는 끌기 훅 한 벌로**(말귀 청 (437) ㉮, 2026-11-13) — 전에는 끄는 중 · 위에 떠 있나 · `relatedTarget` 나감 판정을
27
+ 여기서 다시 지었다. 카드 끌기(화면이 `dropProps` 로 주는 손)와는 따로 쥔다 — 폴더를 끄는 동안에는 폴더가 놓일 자리만 산다. */
28
+ const folderDrag = useCardDragToGroup((from, into) => onMove?.(from, into));
29
+ const draggingFolder = folderDrag.dragging;
28
30
  /** 그 칸의 끌기 손 — 폴더를 끄는 중이면 폴더가 놓일 자리, 아니면 카드가 놓일 자리(화면이 준 손) */
29
31
  const cellDrag = (name) => {
30
- const grab = onMove ? {
31
- draggable: true,
32
- onDragStart: (e) => { e.dataTransfer.effectAllowed = 'move'; e.dataTransfer.setData('text/plain', name); setDraggingFolder(name); },
33
- onDragEnd: () => { setDraggingFolder(null); setFolderOver(null); },
34
- } : {};
32
+ const grab = onMove ? folderDrag.cardProps(name) : {};
35
33
  if (draggingFolder === null)
36
34
  return { ...dropProps?.(name), ...grab };
37
35
  if (!onMove || draggingFolder === name)
38
36
  return grab;
39
- return {
40
- ...grab,
41
- onDragOver: (e) => { e.preventDefault(); e.dataTransfer.dropEffect = 'move'; if (folderOver !== name)
42
- setFolderOver(name); },
43
- onDragLeave: (e) => { if (!e.currentTarget.contains(e.relatedTarget))
44
- setFolderOver(now => (now === name ? null : now)); },
45
- onDrop: (e) => { e.preventDefault(); const from = draggingFolder; setDraggingFolder(null); setFolderOver(null); onMove(from, name); },
46
- };
37
+ /* 제 자신에게는 안 놓인다 — 위에서 걸렀다 */
38
+ return { ...grab, ...folderDrag.groupProps(name) };
47
39
  };
48
40
  /** 그 칸 위에 무엇이 떠 있나 — 카드든 폴더든 같은 꼴로 말한다 */
49
- const isOver = (name) => (draggingFolder === null ? dropOver === name : folderOver === name);
41
+ const isOver = (name) => (draggingFolder === null ? dropOver === name : folderDrag.dragOverKey === name);
50
42
  /* 열린 채 ⋯ 를 다시 누르면 닫힌다 — 그 누름은 메뉴에게 '바깥 누름' 이라 메뉴가 먼저 닫히는데, 이어서 이 손이 도로 열면
51
43
  닫을 길이 없다. 방금 닫힌 그 폴더면 다시 열지 않는다. */
52
44
  const justClosed = useRef(null);
@@ -0,0 +1,25 @@
1
+ import type { ReactNode } from 'react';
2
+ /** @public */
3
+ export interface FolderSearchSectionsProps<T> {
4
+ /** 폴더마다의 찾은 것 — `[폴더의 길(없으면 noneKey), 그 줄들]`. 차례는 받은 그대로 */
5
+ bundles: readonly (readonly [string, readonly T[]])[];
6
+ /** 폴더 없는 것을 가리키는 열쇠 */
7
+ noneKey: string;
8
+ /** 폴더 없는 것의 이름 */
9
+ noneLabel: string;
10
+ titleLevel?: 2 | 3 | 4;
11
+ rowRender: (row: T, slot: number) => ReactNode;
12
+ }
13
+ /**
14
+ * **찾은 것을 폴더마다 나눠 세운다** — 찾는 중의 목록(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
15
+ *
16
+ * 찾는 중에는 폴더를 가리지 않고 **전부에서** 찾는다(`useFolderBrowse`). 찾은 것이 여러 폴더에 걸치므로 어느 폴더의 것인지가
17
+ * 보여야 한다 — 폴더마다 가벼운 제목 한 줄(길 · 수)을 두고 그 아래 카드를 세운다(`CardSection`). 회색 그룹 칸은 두르지 않는다.
18
+ * 폴더를 다루는 일(이름 고치기 · 지우기 · 끌어 놓기)은 여기 없다 — 찾는 중에 하는 일이 아니고, 폴더 메뉴에 있다.
19
+ *
20
+ * · **빈 폴더는 안 세운다** — 찾은 것이 없는 폴더의 제목만 줄줄이 서면 찾은 것이 묻힌다.
21
+ * · 폴더 안의 폴더는 길(`앙/하위`)을 `앙 › 하위` 로 이어 보인다.
22
+ * · 폴더 없는 것은 `noneLabel` 아래에 선다.
23
+ * @public
24
+ */
25
+ export default function FolderSearchSections<T>({ bundles, noneKey, noneLabel, titleLevel, rowRender }: FolderSearchSectionsProps<T>): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import CardSection from './CardSection';
4
+ /**
5
+ * **찾은 것을 폴더마다 나눠 세운다** — 찾는 중의 목록(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
6
+ *
7
+ * 찾는 중에는 폴더를 가리지 않고 **전부에서** 찾는다(`useFolderBrowse`). 찾은 것이 여러 폴더에 걸치므로 어느 폴더의 것인지가
8
+ * 보여야 한다 — 폴더마다 가벼운 제목 한 줄(길 · 수)을 두고 그 아래 카드를 세운다(`CardSection`). 회색 그룹 칸은 두르지 않는다.
9
+ * 폴더를 다루는 일(이름 고치기 · 지우기 · 끌어 놓기)은 여기 없다 — 찾는 중에 하는 일이 아니고, 폴더 메뉴에 있다.
10
+ *
11
+ * · **빈 폴더는 안 세운다** — 찾은 것이 없는 폴더의 제목만 줄줄이 서면 찾은 것이 묻힌다.
12
+ * · 폴더 안의 폴더는 길(`앙/하위`)을 `앙 › 하위` 로 이어 보인다.
13
+ * · 폴더 없는 것은 `noneLabel` 아래에 선다.
14
+ * @public
15
+ */
16
+ export default function FolderSearchSections({ bundles, noneKey, noneLabel, titleLevel = 2, rowRender }) {
17
+ return (_jsx(_Fragment, { children: bundles.filter(([, rows]) => rows.length > 0).map(([folder, rows]) => (_jsx(CardSection, { titleLevel: titleLevel, title: folder === noneKey ? noneLabel : folder.split('/').join(' › '), count: rows.length, children: rows.map((row, i) => rowRender(row, i)) }, folder))) }));
18
+ }
@@ -8,6 +8,7 @@ import Toolbar from '../Toolbar';
8
8
  import './ListPopup.css';
9
9
  import { compareCellBlankLast } from '../../utils/textSort';
10
10
  import { cx } from '../../utils/cx';
11
+ import { usePageSizeOptions } from '../../hooks/usePageSizeOptions';
11
12
  /** @public */
12
13
  export default function ListPopup(props) {
13
14
  const { title, items, columns, resizeStorageKey, gridTemplateColumns, mobileGridTemplateColumns, searchPlaceholder, searchFn, defaultSortKey, defaultSortAsc = true, selectedId, selectedIds, onSelect, onClose, pageSizeOptions = [10, 25, 50, 100], initialPageSize, emptyText, noMatchText, countLabel, topContent, className = '', } = props;
@@ -98,7 +99,8 @@ export default function ListPopup(props) {
98
99
  className: col.className,
99
100
  sortDir: col.sortable !== false && sortKey === col.key ? (sortAsc ? 'asc' : 'desc') : null,
100
101
  })), [columns, sortKey, sortAsc, handleSort]);
101
- const pageSizeOpts = useMemo(() => pageSizeOptions.map(n => ({ value: String(n), label: t('common.pageSizeLabel', { n }) })), [pageSizeOptions, t]);
102
+ /* "N개씩 보기" 목록은 공용 훅 한 벌(청 (437) ㉳ⓐ) — 전엔 여기서 같은 것을 지었다 */
103
+ const pageSizeOpts = usePageSizeOptions(pageSizeOptions);
102
104
  return (_jsxs(Popup, { className: `popup-list ${className}`, title: title, onClose: onClose, children: [topContent, 'label' in countParts && _jsx("p", { className: "toolbar__count body-1", children: countParts.label }), _jsx(Toolbar, { count: 'label' in countParts ? undefined : { value: filtered.length, prefix: countParts.prefix, suffix: countParts.suffix }, search: searchEnabled ? { value: search, onChange: setSearch, placeholder: resolvedSearchPlaceholder } : undefined, pageSize: { options: pageSizeOpts, value: pageSize, onChange: setPageSize }, pagination: { page: clampedPage, total: totalPages, onChange: setPage } }), _jsx(Table, { gridTemplateColumns: gridTemplateColumns, mobileGridTemplateColumns: mobileGridTemplateColumns,
103
105
  /* 폭 조절은 켜고, 저장 열쇠는 **부르는 쪽이 고른다**((306), 2026-10-14).
104
106
 
@@ -46,3 +46,29 @@ export interface DiscardGuard {
46
46
  * @public
47
47
  */
48
48
  export declare function useDiscardGuard(isDirty: boolean, onClose: () => void, labels?: DiscardGuardLabels): DiscardGuard;
49
+ /** @public `useValueDiscardGuard` 가 돌려주는 것 — `DiscardGuard` 에 지금 달라졌나 · 기준 다시 잡기를 더한 것 */
50
+ export interface ValueDiscardGuard extends DiscardGuard {
51
+ /** 첫 값과 지금 값이 다른가 — 저장 단추를 켜고 끌 때도 쓴다 */
52
+ isDirty: boolean;
53
+ /** **지금 값을 새 기준으로 잡는다** — 늦게 불러온 값을 채운 뒤나, 저장해 놓고 창을 안 닫고 이어 쓸 때 부른다 */
54
+ rebase: () => void;
55
+ }
56
+ /**
57
+ * **값으로 묻는 닫기 막이** — 창이 처음 열린 때의 값과 지금 값을 견줘, 달라졌으면 닫기 전에 묻는다
58
+ * (말귀 청 (437) ㉯, 2026-11-13).
59
+ *
60
+ * `useDiscardGuard` 는 참 · 거짓만 받는다. 그래서 말귀 앱 여섯 창이 저마다
61
+ * `const [first] = useState(() => JSON.stringify(x))` 로 첫 모습을 얼리고 `JSON.stringify(cur) !== first` 를 넘겼다
62
+ * (회사 정보 · 정보 입력 · 방문 고치기 · 방문 등록 · 고객 추가 · 단어훈련 묶음). 그 두 줄을 여기 한 벌로 둔다.
63
+ *
64
+ * · 첫 값은 **처음 그릴 때 한 번** 얼린다 — 그 뒤 부르는 쪽이 새 객체를 넘겨도 기준은 안 바뀐다.
65
+ * · 견주기는 JSON 꼴로 한다 — 자리만 같고 새로 만든 객체 · 배열이어도 내용이 같으면 '안 달라짐' 이다.
66
+ * (그래서 값에는 JSON 으로 옮길 수 있는 것만 넣는다 — 함수 · `Date` 의 시각 차 · `undefined` 칸은 견주기에서 빠진다.)
67
+ * · 값을 늦게 불러오는 창은 다 불러온 뒤 `rebase()` 를 부른다 — 안 부르면 빈 첫 값과 견줘 늘 '달라짐' 이 된다.
68
+ *
69
+ * ```tsx
70
+ * const { beforeClose, discardPopup, allowClose, isDirty } = useValueDiscardGuard(form, onClose)
71
+ * ```
72
+ * @public
73
+ */
74
+ export declare function useValueDiscardGuard(value: unknown, onClose: () => void, labels?: DiscardGuardLabels): ValueDiscardGuard;
@@ -54,3 +54,31 @@ export function useDiscardGuard(isDirty, onClose, labels = {}) {
54
54
  const discardPopup = confirming ? (_jsx(ConfirmPopup, { title: labels.title ?? t('common.discardConfirm.title', '입력을 취소할까요?'), message: labels.message ?? t('common.discardConfirm.body', '저장하지 않으면 지금까지 입력한 내용이 사라집니다.'), confirmLabel: labels.confirmLabel ?? t('common.discardConfirm.confirm', '입력 취소'), confirmVariant: "danger", onConfirm: () => { setConfirming(false); onClose(); }, onClose: () => setConfirming(false) })) : null;
55
55
  return { beforeClose, discardPopup, allowClose };
56
56
  }
57
+ /**
58
+ * **값으로 묻는 닫기 막이** — 창이 처음 열린 때의 값과 지금 값을 견줘, 달라졌으면 닫기 전에 묻는다
59
+ * (말귀 청 (437) ㉯, 2026-11-13).
60
+ *
61
+ * `useDiscardGuard` 는 참 · 거짓만 받는다. 그래서 말귀 앱 여섯 창이 저마다
62
+ * `const [first] = useState(() => JSON.stringify(x))` 로 첫 모습을 얼리고 `JSON.stringify(cur) !== first` 를 넘겼다
63
+ * (회사 정보 · 정보 입력 · 방문 고치기 · 방문 등록 · 고객 추가 · 단어훈련 묶음). 그 두 줄을 여기 한 벌로 둔다.
64
+ *
65
+ * · 첫 값은 **처음 그릴 때 한 번** 얼린다 — 그 뒤 부르는 쪽이 새 객체를 넘겨도 기준은 안 바뀐다.
66
+ * · 견주기는 JSON 꼴로 한다 — 자리만 같고 새로 만든 객체 · 배열이어도 내용이 같으면 '안 달라짐' 이다.
67
+ * (그래서 값에는 JSON 으로 옮길 수 있는 것만 넣는다 — 함수 · `Date` 의 시각 차 · `undefined` 칸은 견주기에서 빠진다.)
68
+ * · 값을 늦게 불러오는 창은 다 불러온 뒤 `rebase()` 를 부른다 — 안 부르면 빈 첫 값과 견줘 늘 '달라짐' 이 된다.
69
+ *
70
+ * ```tsx
71
+ * const { beforeClose, discardPopup, allowClose, isDirty } = useValueDiscardGuard(form, onClose)
72
+ * ```
73
+ * @public
74
+ */
75
+ export function useValueDiscardGuard(value, onClose, labels = {}) {
76
+ const now = JSON.stringify(value);
77
+ const [first, setFirst] = useState(now);
78
+ const isDirty = now !== first;
79
+ const guard = useDiscardGuard(isDirty, onClose, labels);
80
+ const nowRef = useRef(now);
81
+ nowRef.current = now;
82
+ const rebase = useCallback(() => setFirst(nowRef.current), []);
83
+ return { ...guard, isDirty, rebase };
84
+ }
@@ -107,6 +107,10 @@ export { default as FolderHead } from './components/FolderHead';
107
107
  export type { FolderHeadProps } from './components/FolderHead';
108
108
  export { default as FolderGrid } from './components/FolderGrid';
109
109
  export type { FolderGridProps, FolderEntry } from './components/FolderGrid';
110
+ export { default as CardSection } from './components/CardSection';
111
+ export type { CardSectionProps } from './components/CardSection';
112
+ export { default as FolderSearchSections } from './components/FolderSearchSections';
113
+ export type { FolderSearchSectionsProps } from './components/FolderSearchSections';
110
114
  export { default as FolderTreeButton } from './components/FolderTreeButton';
111
115
  export type { FolderTreeButtonProps } from './components/FolderTreeButton';
112
116
  export { default as FolderTreeTooltip } from './components/Tooltip/FolderTreeTooltip';
@@ -265,8 +269,8 @@ export { default as ListPopup } from './components/Popup/ListPopup';
265
269
  export type { PopupListProps, PopupListColumn } from './components/Popup/ListPopup';
266
270
  export { default as ConfirmPopup } from './components/Popup/ConfirmPopup';
267
271
  export type { ConfirmPopupProps } from './components/Popup/ConfirmPopup';
268
- export { useDiscardGuard } from './components/Popup/useDiscardGuard';
269
- export type { DiscardGuard, DiscardGuardLabels } from './components/Popup/useDiscardGuard';
272
+ export { useDiscardGuard, useValueDiscardGuard } from './components/Popup/useDiscardGuard';
273
+ export type { DiscardGuard, DiscardGuardLabels, ValueDiscardGuard } from './components/Popup/useDiscardGuard';
270
274
  export { default as CouponInputPopup } from './components/Popup/CouponInputPopup';
271
275
  export type { CouponInputPopupProps } from './components/Popup/CouponInputPopup';
272
276
  export { default as MenuTooltip } from './components/Tooltip/MenuTooltip';
@@ -74,6 +74,9 @@ export { default as Breadcrumb } from './components/Breadcrumb';
74
74
  /* 폴더로 보는 화면 — 구조 단추 · 길 · 폴더 칸(말귀 청 (435), 2026-11-13). 길 셈은 `utils` 의 `folder*` 다 */
75
75
  export { default as FolderHead } from './components/FolderHead';
76
76
  export { default as FolderGrid } from './components/FolderGrid';
77
+ /* 폴더 화면의 남은 조각(말귀 청 (437) ㉮, 2026-11-13) — 카드가 서는 자리 · 찾는 중 폴더마다 나눠 세우기 */
78
+ export { default as CardSection } from './components/CardSection';
79
+ export { default as FolderSearchSections } from './components/FolderSearchSections';
77
80
  export { default as FolderTreeButton } from './components/FolderTreeButton';
78
81
  export { default as FolderTreeTooltip } from './components/Tooltip/FolderTreeTooltip';
79
82
  export { default as Rating } from './components/Rating';
@@ -193,7 +196,7 @@ export { default as TableFilterPanel } from './components/Word/TableFilterPanel'
193
196
  export { default as ContrastFilterPanel } from './components/Word/ContrastFilterPanel';
194
197
  export { default as ListPopup } from './components/Popup/ListPopup';
195
198
  export { default as ConfirmPopup } from './components/Popup/ConfirmPopup';
196
- export { useDiscardGuard } from './components/Popup/useDiscardGuard';
199
+ export { useDiscardGuard, useValueDiscardGuard } from './components/Popup/useDiscardGuard';
197
200
  export { default as CouponInputPopup } from './components/Popup/CouponInputPopup';
198
201
  export { default as MenuTooltip } from './components/Tooltip/MenuTooltip';
199
202
  export { default as InfoTooltip } from './components/Tooltip/InfoTooltip';
@@ -0,0 +1,33 @@
1
+ import { type DragEvent } from 'react';
2
+ /**
3
+ * **카드를 끌어 묶음(폴더)에 놓는다** — HTML5 끌어 놓기를 한 벌로 쥔다(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
4
+ *
5
+ * 카드 요소에는 `cardProps(payload)` 를, 놓일 자리(폴더 칸 등)에는 `groupProps(key)` 를 얹는다. 실제로 옮기는 일은
6
+ * `onDrop(payload, key)` 에 맡긴다(열쇠 → 묶음 찾기는 부르는 쪽 몫). `dragging` · `draggingId` · `dragOverKey` 로 그리는 꼴을 바꾼다.
7
+ *
8
+ * · 기본은 `T = string`(카드 id 가 곧 짐)이다. 여러 종류를 한 화면에서 다루면 `T` 를 객체로 두고 `getId` 로 id 를 뽑고,
9
+ * `groupProps` 의 `accept` 로 자리마다 받을 짐을 가린다.
10
+ * · 강조(`dragOverKey`)는 `onDragEnter` 와 `onDragOver` 양쪽에서 건다 — 자리가 `onDragEnter` 를 안 넘기는 조각이어도 선다.
11
+ * · 자식으로 옮겨 가며 나는 `dragleave` 는 버린다 — `relatedTarget` 이 자리 **밖**일 때만 강조를 끈다.
12
+ *
13
+ * `FolderGrid` 의 폴더 칸 끌기도 이 훅으로 선다(전에는 같은 상태를 제 안에서 다시 지었다).
14
+ * @public
15
+ */
16
+ export interface CardDragToGroup<T> {
17
+ dragging: T | null;
18
+ draggingId: string | null;
19
+ dragOverKey: string | null;
20
+ cardProps: (payload: T) => {
21
+ draggable: true;
22
+ onDragStart: (e: DragEvent<HTMLElement>) => void;
23
+ onDragEnd: () => void;
24
+ };
25
+ groupProps: (groupKey: string, accept?: (payload: T) => boolean) => {
26
+ onDragOver: (e: DragEvent<HTMLElement>) => void;
27
+ onDragEnter: () => void;
28
+ onDragLeave: (e: DragEvent<HTMLElement>) => void;
29
+ onDrop: (e: DragEvent<HTMLElement>) => void;
30
+ };
31
+ }
32
+ /** @public */
33
+ export declare function useCardDragToGroup<T = string>(onDrop: (payload: T, groupKey: string) => void, getId?: (payload: T) => string): CardDragToGroup<T>;