@ihabdevteam/core 0.442.0 → 0.444.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 (66) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/components.cjs.js +195 -190
  3. package/dist/components.esm.css +2 -2
  4. package/dist/hooks.cjs.js +5 -5
  5. package/dist/i18n.cjs.js +3 -3
  6. package/dist/ihabdevteam-core.cjs.js +191 -186
  7. package/dist/ihabdevteam-core.d.ts +346 -1
  8. package/dist/packages/core/src/components/DatePicker.css +8 -0
  9. package/dist/packages/core/src/components/DatePicker.js +13 -1
  10. package/dist/packages/core/src/components/ErrorBoundary.d.ts +55 -0
  11. package/dist/packages/core/src/components/ErrorBoundary.js +52 -0
  12. package/dist/packages/core/src/components/FolderAddPopup.d.ts +25 -0
  13. package/dist/packages/core/src/components/FolderAddPopup.js +21 -0
  14. package/dist/packages/core/src/components/FolderList.css +18 -0
  15. package/dist/packages/core/src/components/FolderList.d.ts +28 -0
  16. package/dist/packages/core/src/components/FolderList.js +23 -0
  17. package/dist/packages/core/src/components/KeepScreenAwake.d.ts +9 -0
  18. package/dist/packages/core/src/components/KeepScreenAwake.js +12 -0
  19. package/dist/packages/core/src/components/MarkIcon.css +12 -0
  20. package/dist/packages/core/src/components/MarkIcon.d.ts +20 -0
  21. package/dist/packages/core/src/components/MarkIcon.js +18 -0
  22. package/dist/packages/core/src/components/PagePopup.d.ts +52 -0
  23. package/dist/packages/core/src/components/PagePopup.js +77 -0
  24. package/dist/packages/core/src/components/Popup/Popup.css +14 -0
  25. package/dist/packages/core/src/components/Popup/Popup.d.ts +9 -0
  26. package/dist/packages/core/src/components/Popup/Popup.js +23 -4
  27. package/dist/packages/core/src/components/ScoreMarkCounts.css +9 -0
  28. package/dist/packages/core/src/components/ScoreMarkCounts.d.ts +19 -0
  29. package/dist/packages/core/src/components/ScoreMarkCounts.js +16 -0
  30. package/dist/packages/core/src/components/TextField.css +20 -0
  31. package/dist/packages/core/src/components/TextField.d.ts +17 -0
  32. package/dist/packages/core/src/components/TextField.js +19 -4
  33. package/dist/packages/core/src/components/Training/TrainingBlockGrid.js +25 -1
  34. package/dist/packages/core/src/components.d.ts +14 -0
  35. package/dist/packages/core/src/components.js +9 -0
  36. package/dist/packages/core/src/hooks/useBackClosable.d.ts +8 -0
  37. package/dist/packages/core/src/hooks/useBackClosable.js +97 -0
  38. package/dist/packages/core/src/hooks/useClosingDelay.d.ts +12 -0
  39. package/dist/packages/core/src/hooks/useClosingDelay.js +30 -0
  40. package/dist/packages/core/src/hooks/useOnline.d.ts +9 -0
  41. package/dist/packages/core/src/hooks/useOnline.js +23 -0
  42. package/dist/packages/core/src/hooks/useOutsideClose.d.ts +11 -0
  43. package/dist/packages/core/src/hooks/useOutsideClose.js +23 -0
  44. package/dist/packages/core/src/hooks/useSaveOnHide.d.ts +14 -0
  45. package/dist/packages/core/src/hooks/useSaveOnHide.js +32 -0
  46. package/dist/packages/core/src/hooks/useScreenWakeLock.d.ts +12 -0
  47. package/dist/packages/core/src/hooks/useScreenWakeLock.js +53 -0
  48. package/dist/packages/core/src/hooks.d.ts +6 -0
  49. package/dist/packages/core/src/hooks.js +7 -0
  50. package/dist/packages/core/src/i18n/locales/en.json +10 -3
  51. package/dist/packages/core/src/i18n/locales/ko.json +10 -3
  52. package/dist/packages/core/src/utils/jamoSpeech.d.ts +19 -0
  53. package/dist/packages/core/src/utils/jamoSpeech.js +53 -0
  54. package/dist/packages/core/src/utils/kstDateTime.d.ts +21 -0
  55. package/dist/packages/core/src/utils/kstDateTime.js +38 -0
  56. package/dist/packages/core/src/utils/lucideIconSet.js +2 -0
  57. package/dist/packages/core/src/utils/popupTiming.d.ts +7 -0
  58. package/dist/packages/core/src/utils/popupTiming.js +7 -0
  59. package/dist/packages/core/src/utils/wordTrainingGenerators.d.ts +1 -6
  60. package/dist/packages/core/src/utils/wordTrainingGenerators.js +3 -45
  61. package/dist/packages/core/src/utils.d.ts +2 -0
  62. package/dist/packages/core/src/utils.js +1 -0
  63. package/dist/packages/core/src/version.d.ts +1 -1
  64. package/dist/packages/core/src/version.js +1 -1
  65. package/dist/utils.cjs.js +171 -166
  66. package/package.json +1 -1
@@ -1,9 +1,11 @@
1
+ import { Component } from 'react';
1
2
  import { ComponentType } from 'react';
2
3
  import { Context } from 'react';
3
4
  import { CSSProperties } from 'react';
4
5
  import { Dispatch } from 'react';
5
6
  import { DragEvent as DragEvent_2 } from 'react';
6
7
  import type { ElementType } from 'react';
8
+ import { ErrorInfo } from 'react';
7
9
  import { FC } from 'react';
8
10
  import { FocusEvent as FocusEvent_2 } from 'react';
9
11
  import { ForwardRefExoticComponent } from 'react';
@@ -2225,7 +2227,7 @@ export declare function copyText(text: string): Promise<boolean>;
2225
2227
  *
2226
2228
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
2227
2229
  */
2228
- export declare const CORE_VERSION = "0.442.0";
2230
+ export declare const CORE_VERSION = "0.444.0";
2229
2231
 
2230
2232
  /** @public */
2231
2233
  declare const coreDefault: Record<string, unknown>;
@@ -2891,6 +2893,58 @@ export declare interface EmptyStateProps {
2891
2893
  */
2892
2894
  export declare function ensureTrainingDataLoaded(timeout?: number): Promise<boolean>;
2893
2895
 
2896
+ /**
2897
+ * **오류 울타리** — 아래 화면이 그리다 넘어지면 잡아서 넘어진 화면을 세운다(말귀 청 (437) ㉴ — 말귀 앱 · 어드민 두 벌을 하나로, 2026-11-13).
2898
+ *
2899
+ * · **운영에서도 남긴다** — `console.error(error, '[ErrorBoundary]', 줄기)` 로. 앱의 오류 보고가 `console.error` 를 가로채 보낸다.
2900
+ * `Error` 를 **첫 인자로** 준다 — 문자열이 앞이면 보고가 새 `Error` 를 만들어 줄기(스택)가 사라진다.
2901
+ * · `resetKeys` 가 바뀌면 오류를 푼다(쪽을 옮기면 빠져나올 수 있게).
2902
+ * · 낡은 묶음 오류(`isChunkLoadError`)면 `staleChunk` 를 참으로 넘긴다 — 되살리기가 아니라 새로고침을 권할 자리다.
2903
+ * · 넘어진 화면의 문구 · 모양 · 개발용 다시 그리기는 앱이 넘긴다(`fallback` · `registerHealth`).
2904
+ * @public
2905
+ */
2906
+ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, State> {
2907
+ state: State;
2908
+ private releaseHealth?;
2909
+ static getDerivedStateFromError(error: Error): State;
2910
+ componentDidCatch(error: Error, info: ErrorInfo): void;
2911
+ componentDidMount(): void;
2912
+ componentWillUnmount(): void;
2913
+ componentDidUpdate(prevProps: ErrorBoundaryProps): void;
2914
+ render(): ReactNode;
2915
+ }
2916
+
2917
+ /** @public */
2918
+ export declare interface ErrorBoundaryProps {
2919
+ children: ReactNode;
2920
+ /** 넘어진 화면 — 문구 · 모양은 앱 몫이다. 안 주면 아무것도 안 그린다 */
2921
+ fallback?: (p: ErrorFallbackProps) => ReactNode;
2922
+ onError?: (error: Error, info: ErrorInfo) => void;
2923
+ /**
2924
+ * 이 값들이 바뀌면 오류를 푼다 — 보통 지금 쪽의 열쇠를 넘긴다. 울타리가 쪽 전환보다 바깥에 있으면 쪽을 바꿔도 같은 울타리가
2925
+ * 남아 오류 화면에 붙박이고, 머리 · 바닥 내비만 눌리는 채 빠져나갈 길이 새로고침뿐이 된다.
2926
+ */
2927
+ resetKeys?: readonly unknown[];
2928
+ /** 새로고침을 바꿔 끼운다 — 시험이 jsdom 의 `location.reload` 를 못 부르므로 */
2929
+ reload?: () => void;
2930
+ /**
2931
+ * 개발 중 고쳐 끼우기(HMR)가 왔을 때 '이 울타리가 오류 화면인가' 를 알릴 자리 — 앱의 개발용 손을 넘긴다.
2932
+ * 받은 함수를 부르면 지금 오류 화면인지 답하고, 돌려준 함수는 떼어 낼 때 부른다.
2933
+ */
2934
+ registerHealth?: (isBroken: () => boolean) => () => void;
2935
+ }
2936
+
2937
+ /** @public 넘어진 화면을 그릴 때 받는 것 */
2938
+ export declare interface ErrorFallbackProps {
2939
+ error?: Error;
2940
+ /** 다시 그려 본다 — 일시적인 렌더 오류는 이것으로 풀리는 수가 많다 */
2941
+ retry: () => void;
2942
+ /** 쪽을 새로 고친다 — 낡은 묶음(배포 뒤 옛 조각) 오류는 되살려도 같은 오류가 다시 난다 */
2943
+ reload: () => void;
2944
+ /** 낡은 묶음 오류인가 — 참이면 `reload` 를 권한다 */
2945
+ staleChunk: boolean;
2946
+ }
2947
+
2894
2948
  export declare function ErrorState({ message, hint, icon, onRetry, retryLabel, className }: ErrorStateProps): JSX.Element;
2895
2949
 
2896
2950
  /** @public
@@ -3174,6 +3228,33 @@ export declare type FlowState = {
3174
3228
 
3175
3229
  export declare function fmtBytes(n: number): string;
3176
3230
 
3231
+ /**
3232
+ * **폴더 추가 창**(말귀 청 (438) ㉴ — 말귀 앱에서 옮겨 왔다, 2026-11-14). `FolderHead` · `FolderGrid` · `FolderList` 와 한 벌이다.
3233
+ *
3234
+ * 작은 확인 창, 제목 아래 부제, 이름표 없는 입력칸 하나, 취소 · 추가.
3235
+ * · **못 만들 이름이면 「추가」 가 꺼진다**(`canAdd`).
3236
+ * · **닫는 길을 넘겨준다**(`onAdd(close)`) — 되면 그때 닫는다. 이름이 틀렸을 때 열린 채로 남아야 고쳐 넣는다.
3237
+ * · **한글을 조합하는 중의 Enter 로는 안 만든다** — 조합 확정 Enter 는 `TextField.onEnter` 가 가린다.
3238
+ * · 글 넷은 코어 사전(`folder.add.*` · `common.add`)이다.
3239
+ * @public
3240
+ */
3241
+ export declare function FolderAddPopup({ value, onChange, canAdd, error, onAdd, onClose, maxLength }: FolderAddPopupProps): JSX.Element;
3242
+
3243
+ /** @public */
3244
+ export declare interface FolderAddPopupProps {
3245
+ value: string;
3246
+ onChange: (value: string) => void;
3247
+ /** 지금 이름으로 만들 수 있나 — 아니면 「추가」 가 꺼지고 Enter 도 안 먹는다. 무엇이 못 만들 이름인지는 화면이 정한다 */
3248
+ canAdd: boolean;
3249
+ /** 입력칸 아래에 보일 말(이미 있는 이름 등) — 없으면 안 선다 */
3250
+ error?: string;
3251
+ /** 만든다 — 받은 `close` 로 닫는다(안 부르면 창이 남아 이름을 고쳐 넣는다) */
3252
+ onAdd: (close: () => void) => void;
3253
+ onClose: () => void;
3254
+ /** 이름 길이 상한 — 폴더 이름은 길과 폴더 칸에 그대로 나온다. 안 주면 상한 없음 */
3255
+ maxLength?: number;
3256
+ }
3257
+
3177
3258
  /** @public `parent` 바로 아래의 폴더들(한 층만) — `parent` 가 `null` 이면 맨 위의 폴더들. 받은 차례 그대로 */
3178
3259
  export declare function folderChildren(paths: readonly string[], parent: string | null): string[];
3179
3260
 
@@ -3273,6 +3354,34 @@ export declare const folderJoin: (parent: string | null, name: string) => string
3273
3354
  /** @public 화면에 보일 이름 — 길의 마지막 마디 */
3274
3355
  export declare function folderLeaf(path: string): string;
3275
3356
 
3357
+ /**
3358
+ * **폴더로 볼 때 지금 자리의 목록**(말귀 청 (438) ㉴ — 말귀 앱에서 옮겨 왔다, 2026-11-14).
3359
+ *
3360
+ * 맨 위면 그룹 없는 것, 폴더 안이면 그 폴더의 카드가 쪽 바탕에 바로 선다. 카드는 제 폭을 쥐고 있어 드는 만큼
3361
+ * 나란히 서고, 한 줄의 카드는 키를 맞춘다. **끌어다 놓는 자리는 남는다** — 맨 위의 목록은 '그룹 없음' 으로
3362
+ * 되돌리는 자리다. `FolderHead` · `FolderGrid` 와 한 벌이다.
3363
+ *
3364
+ * 앱 사본과 다른 것 하나: **정렬을 안 한다.** 앱 사본은 앱의 정렬 셈을 불렀다 — 세운 줄을 받으면 앱에 기대는
3365
+ * 것이 없다.
3366
+ * @public
3367
+ */
3368
+ export declare function FolderList<T>({ rows, rowRender, emptySpeech, dropProps, dropOver, className }: FolderListProps<T>): JSX.Element | null;
3369
+
3370
+ /** @public */
3371
+ export declare interface FolderListProps<T> {
3372
+ /** 그릴 줄 — **이미 세운 차례대로** 준다. 정렬은 부르는 쪽이 한다(정렬 열쇠는 화면마다 다르다) */
3373
+ rows: T[];
3374
+ /** 줄 하나를 그린다 — 두 번째 인자는 그 줄의 자리(0부터) */
3375
+ rowRender: (row: T, slot: number) => ReactNode;
3376
+ /** 비었을 때의 말 — 안 주면 비었을 때 아무것도 안 선다(맨 위처럼 폴더만 서면 되는 자리) */
3377
+ emptySpeech?: string;
3378
+ /** 끌어다 놓는 손(`useCardDragToGroup` 의 받는 쪽 등) — 목록 칸(비었으면 빈 말)에 그대로 얹는다 */
3379
+ dropProps?: HTMLAttributes<HTMLElement> | Record<string, unknown>;
3380
+ /** 끈 것이 이 위에 있다 — 테두리 빛을 켠다 */
3381
+ dropOver?: boolean;
3382
+ className?: string;
3383
+ }
3384
+
3276
3385
  /** @public 폴더 메뉴의 줄을 정해진 차례 · 아이콘으로 짓는다 */
3277
3386
  export declare function folderMenuItems(lines: {
3278
3387
  /** 이 자리에 하나 더 만든다(무엇을 만드는지는 화면 몫) */
@@ -4510,6 +4619,30 @@ export declare const JONGSEONG: readonly ["", "ㄱ", "ㄲ", "ㄳ", "ㄴ", "ㄵ",
4510
4619
 
4511
4620
  export declare const JUNGSEONG: readonly ["ㅏ", "ㅐ", "ㅑ", "ㅒ", "ㅓ", "ㅔ", "ㅕ", "ㅖ", "ㅗ", "ㅘ", "ㅙ", "ㅚ", "ㅛ", "ㅜ", "ㅝ", "ㅞ", "ㅟ", "ㅠ", "ㅡ", "ㅢ", "ㅣ"];
4512
4621
 
4622
+ /**
4623
+ * **감싼 것이 떠 있는 동안 폰 화면이 꺼지지 않게 한다** — 자리를 차지하지 않는다(말귀 청 (437) ㉲).
4624
+ * 훈련 창을 띄우는 길목을 이것으로 감싼다. 켜고 끄는 조건이 따로 있으면 `useScreenWakeLock(active)` 를 바로 쓴다.
4625
+ * @public
4626
+ */
4627
+ export declare function KeepScreenAwake({ children }: {
4628
+ children: ReactNode;
4629
+ }): JSX.Element;
4630
+
4631
+ /** @public 그 순간의 한국 시각을 칸으로 — 기본은 지금. 두 자리로 채운다 */
4632
+ export declare function kstNowParts(now?: Date): KstParts;
4633
+
4634
+ /** @public 연 · 월 · 일 · 시 · 분 칸(한국 시각) */
4635
+ export declare interface KstParts {
4636
+ year: string;
4637
+ month: string;
4638
+ day: string;
4639
+ hour: string;
4640
+ minute: string;
4641
+ }
4642
+
4643
+ /** @public 칸(한국 시각)이 가리키는 순간. 못 읽으면 Invalid Date */
4644
+ export declare function kstPartsAt(p: KstParts): Date;
4645
+
4513
4646
  /**
4514
4647
  * KST 달력 날짜(연, 0부터 세는 월, 일)의 **00:00 KST 순간.** 일·월은 넘쳐도 된다(`Date.UTC` 처럼 — 32일은 다음 달 1일).
4515
4648
  * 서버에 기간을 물을 때(`toISOString()`) 기기 시간대가 아니라 KST 의 하루로 자르려고 쓴다.
@@ -4518,6 +4651,16 @@ export declare const JUNGSEONG: readonly ["ㅏ", "ㅐ", "ㅑ", "ㅒ", "ㅓ", "
4518
4651
  */
4519
4652
  export declare function kstStartOfDay(year: number, month0: number, day: number): Date;
4520
4653
 
4654
+ /**
4655
+ * **화면이 고른 한국 시각(벽시계)을 서버가 아는 순간으로, 또 그 반대로**(말귀 청 (437) ㉳ⓒ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
4656
+ *
4657
+ * `timestamptz` 칸에 시간대 표기가 없는 문자열(`2026-09-06T12:55:00`)을 보내면 서버가 UTC 로 읽어 **9시간이 밀린다**
4658
+ * (말귀 실측: 12:55 → 21:55, 저녁 것은 날짜까지 하루). 기기 시간대가 아니라 **한국 시각**으로 읽는다 — 뉴욕 기기에서
4659
+ * 12:55 를 골라도 KST 12:55 다. 한국은 서머타임이 없어 +09:00 한 값이다. KST 날짜 셈의 다른 식구는 `utils/date.ts`.
4660
+ */
4661
+ /** @public `YYYY-MM-DD` + `HH:mm`(한국 시각) → `Z` 붙은 ISO. 못 읽을 값(2월 31일 · 25시 …)이면 `null` */
4662
+ export declare function kstToIso(date: string, time: string): string | null;
4663
+
4521
4664
  /**
4522
4665
  * {@link cellKey} 로 만든 칸 낱말에서 동형어 번호를 뗀 보이는 글자 — `배#2 / 패` → `배 / 패`. 번호가 없으면 그대로.
4523
4666
  *
@@ -5067,6 +5210,26 @@ export declare const MARK_VARIANT: Record<ScoreMark, 'main' | 'warn' | 'danger'>
5067
5210
  */
5068
5211
  export declare function markAfterClick(current: ScoreMark | null, clicked: ScoreMark): ScoreMark | null;
5069
5212
 
5213
+ /**
5214
+ * **평가 표시(○ △ ✕) — 단어표 칸에 찍히는 그 그림 그대로**(말귀 청 (437) ㉱ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
5215
+ *
5216
+ * 원은 `CircleBadge`, 그림은 단어표가 쓰는 `MARK_ICON`, **색은 단어표의 `MARK_VARIANT` 를 그대로 따른다** — 앱 사본은 CSS 에
5217
+ * 색 셋(○ main · △ warn · ✕ error)을 다시 적고 있어 표의 색이 바뀌면 갈릴 수 있었다. 여기서는 클래스가 `MARK_VARIANT` 의
5218
+ * 값으로 정해지므로 표와 늘 같다. **모양과 색 둘 다로 가른다** — 색만으로 가르면 색을 잘 못 가리는 사람에게 셋이 같아진다.
5219
+ * @public
5220
+ */
5221
+ export declare function MarkIcon({ mark, label }: MarkIconProps): JSX.Element;
5222
+
5223
+ /** @public */
5224
+ export declare interface MarkIconProps {
5225
+ mark: ScoreMark;
5226
+ /**
5227
+ * 낭독기에 읽힐 이름. **빈 글자면 그림으로만 두고 숨긴다** — 곁에서 같은 것을 이미 말하고 있는 자리가 있다
5228
+ * (채점 창 바닥의 셈은 `role="status"` 한 줄이 통째로 읽는다). 이름 없는 `role="img"` 는 '그림' 이라고만 들린다.
5229
+ */
5230
+ label: string;
5231
+ }
5232
+
5070
5233
  /** 매길 수 있는 표시 — 화면에 이 순서로 늘어놓는다(맞음 → 애매 → 틀림) */
5071
5234
  export declare const MARKS: readonly ScoreMark[];
5072
5235
 
@@ -5583,6 +5746,45 @@ export declare namespace Page {
5583
5746
  /** @public */
5584
5747
  declare type PageNumberPosition = 'left' | 'center' | 'right' | 'none';
5585
5748
 
5749
+ /**
5750
+ * **훈련이 아닌 전체 화면 창의 껍데기**(말귀 청 (437) ㉰ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
5751
+ *
5752
+ * 생김새는 `TrainingPagePopup` 과 같은 `page-popup` 이고, 걸음 넘기기 · 소음 · 결과는 없다 — 단어표 채점 창처럼 화면을 덮는
5753
+ * 아무 창이나 담는다. 자리 셋(`top` · 본문 · `bottom`)만 쥐고 내용은 부르는 쪽이 넣는다. 닫힘은 `usePagePopupClose` 와 짝이다.
5754
+ *
5755
+ * · **열 때 판 안으로 초점을 옮기고, 닫힐 때 부른 자리로 되돌린다.** 부른 자리는 효과가 아니라 **그리는 중**에 적는다 —
5756
+ * 자식의 `autoFocus` 는 커밋 중에 걸려, 효과에서 읽으면 부른 사람이 아니라 그 자식이 적힌다.
5757
+ * · Tab 은 판 안을 돈다(`useFocusTrap`).
5758
+ * @public
5759
+ */
5760
+ export declare function PagePopup({ children, top, bottom, mode, contentFull, closing, onClose, backClosable, beforeClose, className, 'aria-label': ariaLabel }: PagePopupProps): JSX.Element;
5761
+
5762
+ /** @public */
5763
+ export declare interface PagePopupProps {
5764
+ children?: ReactNode;
5765
+ /** 위에 붙는 자리(제목 · 뒤로 단추 등) */
5766
+ top?: ReactNode;
5767
+ /** 아래에 붙는 자리(단추 · 걸음 표시 등) */
5768
+ bottom?: ReactNode;
5769
+ /** 본문 세로 맞춤 — `top`(기본, 위부터) · `center`(짧으면 가운데) */
5770
+ mode?: 'top' | 'center';
5771
+ /** 속 통의 폭 · 여백 제약을 푼다 — 안에 넣는 화면이 제 폭과 여백을 그대로 쓰는 쓰임(표 한 판을 꽉 채우는 창) */
5772
+ contentFull?: boolean;
5773
+ /** 닫히는 중 — `usePagePopupClose` 의 `closing` 을 넘긴다 */
5774
+ closing?: boolean;
5775
+ /**
5776
+ * 닫는 손 — 주면 **폰 '뒤로' 가 이 창을 닫는다**(말귀 청 (438) ㉯, 2026-11-14). 보통 `usePagePopupClose` 의
5777
+ * `handleClose` 를 넘긴다. 이 껍데기는 닫기 단추를 그리지 않으므로(단추는 `top` 에 부르는 쪽이 넣는다) 뒤로에만 쓴다.
5778
+ */
5779
+ onClose?: () => void;
5780
+ /** 뒤로로 닫기 — 기본 true. `onClose` 가 있을 때만 건다. 길(route)로 띄운 창은 끈다. */
5781
+ backClosable?: boolean;
5782
+ /** 뒤로가 왔을 때 먼저 묻는다 — `false` 면 안 닫고 그대로 둔다(고치다 만 것을 확인 창으로 묻는 자리). `Popup` 과 같다. */
5783
+ beforeClose?: () => boolean;
5784
+ className?: string;
5785
+ 'aria-label'?: string;
5786
+ }
5787
+
5586
5788
  /**
5587
5789
  * Compound Page Component that groups steps for multi-page training
5588
5790
  */
@@ -6520,6 +6722,14 @@ export declare type PlanTier = 'none' | 'free' | 'personal_standard' | 'mgr_free
6520
6722
  /** @public */
6521
6723
  export declare function Popup(props: PopupProps): JSX.Element;
6522
6724
 
6725
+ /**
6726
+ * **`Popup` 이 사라지는 데 걸리는 시간** — `.popup--closing { transition: opacity 260ms }` 과 닫힘 타이머가 이 수를 쓴다
6727
+ * (말귀 청 (437) ㉳ⓑ, 2026-11-13 — 앱이 이 수를 베껴 들고 "창이 다 사라진 뒤에 일을 치르려" 기다렸다. 코어가 바꾸면 조용히 어긋났다).
6728
+ * 움직임 줄이기에서는 `Popup` 이 0 으로 닫는다 — 기다릴 때는 `useClosingDelay` 를 쓰면 그것까지 따른다.
6729
+ * @public
6730
+ */
6731
+ export declare const POPUP_CLOSE_MS = 260;
6732
+
6523
6733
  /** footer buttons 배열로 전달할 때 사용하는 버튼 설정 */
6524
6734
  export declare type PopupButtonConfig = {
6525
6735
  label: string;
@@ -6763,6 +6973,15 @@ export declare interface PopupProps {
6763
6973
  * 바깥을 잘못 눌러 입력이 날아가면 안 되는 창은 `beforeClose` 로 묻거나 이것을 끈다.
6764
6974
  */
6765
6975
  closeOnBackdrop?: boolean;
6976
+ /**
6977
+ * **폰 '뒤로' 로 닫는다.** 기본 true(말귀 청 (438) ㉯, 2026-11-14).
6978
+ *
6979
+ * 열릴 때 역사 칸 하나를 쌓고, 뒤로가 오면 **맨 위 창 하나만** 닫는다(`useBackClosable`). 닫기는
6980
+ * X · ESC 와 같은 길이라 `closeDisabled` · `beforeClose` 가 막으면 안 닫히고 칸이 도로 쌓인다.
6981
+ * ESC 와 같은 조건(`inline` 이 아니고 `onClose` 가 있을 때)에서만 건다. 길(route)로 띄운 창처럼
6982
+ * 뒤로가 이미 제 뜻을 갖는 자리는 끈다.
6983
+ */
6984
+ backClosable?: boolean;
6766
6985
  className?: string;
6767
6986
  /**
6768
6987
  * 다이얼로그 접근명 — 제목을 그리지 않는 팝업(`title` 이 없거나 useTitle=false)에서 쓴다.
@@ -7859,6 +8078,25 @@ export declare function scoreKey(cellIndex: number): string;
7859
8078
  /** 채점 표시. `null` 은 아직 안 매긴 것 — 0점과는 다르다. */
7860
8079
  export declare type ScoreMark = 'o' | 'triangle' | 'x';
7861
8080
 
8081
+ /**
8082
+ * **매긴 셈 한 묶음 — ○ n · △ n · ✕ n**(말귀 청 (437) ㉱ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
8083
+ *
8084
+ * · **셋을 늘 함께 세운다. 0 도 세운다** — 빠지면 `○ 2 · ✕ 1` 이 되어 △ 를 안 매긴 것인지 △ 가 없는 표인지 가릴 수 없다.
8085
+ * · **들리는 말은 여기서 안 낸다** — 쓰는 자리마다 곁에 `role="status"` 한 줄이 셈을 통째로 읽는다. 곁에 그런 줄이 없으면 `label` 을 준다.
8086
+ * @public
8087
+ */
8088
+ export declare function ScoreMarkCounts({ o, triangle, x, label, className }: ScoreMarkCountsProps): JSX.Element;
8089
+
8090
+ /** @public */
8091
+ export declare interface ScoreMarkCountsProps {
8092
+ o: number;
8093
+ triangle: number;
8094
+ x: number;
8095
+ /** 낭독기에 읽힐 이름 — **곁에 셈을 읽는 줄이 없을 때만** 준다. 안 주면 셋 다 그림으로만 선다 */
8096
+ label?: (mark: ScoreMark, count: number) => string;
8097
+ className?: string;
8098
+ }
8099
+
7862
8100
  /**
7863
8101
  * 쌓인 채점으로 **무엇이 부족하고 다음에 무엇을 할지** 읽어 낸다.
7864
8102
  *
@@ -8785,6 +9023,11 @@ export declare interface StatChartProps {
8785
9023
  /** @deprecated `ChartSectionSize` 를 쓴다 — `auto`→`small` · `ring`→`medium`(2026-11-02) @public */
8786
9024
  export declare type StatChartSize = ChartSectionSize;
8787
9025
 
9026
+ declare interface State {
9027
+ hasError: boolean;
9028
+ error?: Error;
9029
+ }
9030
+
8788
9031
  /**
8789
9032
  * Compound Step Components that work within TrainingPagePopup context
8790
9033
  */
@@ -9572,6 +9815,23 @@ export declare interface TextFieldProps {
9572
9815
  /** 모바일 키패드 종류 힌트 */
9573
9816
  inputMode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
9574
9817
  autoComplete?: string;
9818
+ /**
9819
+ * 첫 글자 대문자 바꾸기(모바일 키보드) — `<input>` 에 그대로 넘긴다(말귀 청 (438) ㉰, 2026-11-14).
9820
+ *
9821
+ * **안 주면 칸의 쓰임을 보고 정한다** — `type` 이 `email`·`tel`·`password`·`url` 이거나
9822
+ * `autoComplete` 가 `username`·`email`·`one-time-code` 면 `'none'`, 그 밖은 브라우저 기본.
9823
+ * iOS 가 로그인 아이디 첫 글자를 대문자로 바꿔 '아이디가 틀렸다' 가 났다.
9824
+ */
9825
+ autoCapitalize?: 'none' | 'off' | 'sentences' | 'words' | 'characters' | 'on';
9826
+ /** 자동 고침(iOS) — 기본은 `autoCapitalize` 와 같은 칸에서 `'off'`. 그 밖은 브라우저 기본. */
9827
+ autoCorrect?: 'on' | 'off';
9828
+ /**
9829
+ * 비밀번호 보기/숨기기 단추(말귀 청 (438) ㉱) — `type="password"` 일 때만 선다. 기본 거짓.
9830
+ *
9831
+ * 단추는 지우기 단추 뒤, `rightIcon` 앞에 **나란히** 선다(겹치지 않는다). 보일 때도 값은
9832
+ * HTML 속성에 안 박힌다 — 비밀번호 칸의 평문 보호(아래 `isPasswordControlled`)는 **원래 `type`** 을 본다.
9833
+ */
9834
+ revealable?: boolean;
9575
9835
  className?: string;
9576
9836
  onFocus?: (e: FocusEvent_2<HTMLInputElement | HTMLTextAreaElement>) => void;
9577
9837
  onBlur?: (e: FocusEvent_2<HTMLInputElement | HTMLTextAreaElement>) => void;
@@ -11457,6 +11717,15 @@ export declare interface UseAnchoredMenuResult<Trigger extends HTMLElement, Menu
11457
11717
  menuRef: RefObject<Menu | null>;
11458
11718
  }
11459
11719
 
11720
+ /**
11721
+ * 열려 있는 동안 폰 '뒤로' 로 닫히게 한다.
11722
+ *
11723
+ * @param open 열려 있는가. 거짓이면 아무것도 안 한다.
11724
+ * @param onBack 뒤로가 왔을 때 부른다 — 닫는다. **`false` 를 돌려주면 안 닫은 것**으로 보고 칸을 도로 쌓는다.
11725
+ * @public
11726
+ */
11727
+ export declare function useBackClosable(open: boolean, onBack: () => boolean | void): void;
11728
+
11460
11729
  /**
11461
11730
  * BarChart 기간 상태/옵션/네비게이션을 캡슐화한 훅.
11462
11731
  * 여러 BarChart가 하나의 컨트롤을 공유하려면 이 훅을 상위에서 호출해 control을 내려준다.
@@ -11497,6 +11766,19 @@ export declare interface UseCalendarMonthResult {
11497
11766
  /** @public */
11498
11767
  export declare function useCardDragToGroup<T = string>(onDrop: (payload: T, groupKey: string) => void, getId?: (payload: T) => string): CardDragToGroup<T>;
11499
11768
 
11769
+ /**
11770
+ * **창이 사라질 짬을 준 뒤에 치른다**(말귀 청 (437) ㉳ⓑ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
11771
+ *
11772
+ * 고객을 지우는 것처럼 **이 창 자체가 없어지는** 일은, 곧바로 치르면 창이 붙은 채로 바깥이 목록을 다시 그려 사라지는 그림과
11773
+ * 겹친다. 한 박자 늦추면 창이 먼저 가고 목록이 그다음이다. 기다리는 시간은 `Popup` 의 닫힘 시간(`POPUP_CLOSE_MS`) — 움직임
11774
+ * 줄이기에서는 `Popup` 처럼 0 이다(앱 사본은 260 을 베껴 들고 움직임 줄이기를 몰랐다).
11775
+ *
11776
+ * · **기다리는 동안 창이 먼저 없어질 수 있다** — 걷힐 때 반드시 시계를 끈다(없는 창이 남긴 일이 뒤늦게 터지지 않게).
11777
+ * · 한 번에 **하나만** 잰다 — 다시 부르면 앞의 것을 덮어쓴다. 두 번 눌러도 일은 한 번만 난다.
11778
+ * @public
11779
+ */
11780
+ export declare function useClosingDelay(waitMs?: number): (todo?: () => void) => void;
11781
+
11500
11782
  /**
11501
11783
  * TextField의 `suggestions` 옵션이 쓰는 자동완성 콤보박스 상태/키보드 로직.
11502
11784
  * 순수 입력(값 관리)과 분리해서, 자동완성이 필요 없는 TextField 사용처는
@@ -11810,6 +12092,27 @@ export declare function useMediaQuery(query: string): boolean;
11810
12092
  /** @public */
11811
12093
  export declare function useNoisePlayer(): NoisePlayerContextValue | null;
11812
12094
 
12095
+ /**
12096
+ * **망이 붙어 있나**(말귀 청 (437) ㉲ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
12097
+ *
12098
+ * `navigator.onLine` 이 **참이라고 인터넷이 되는 것은 아니다**(공유기에만 붙은 상태도 참). 거짓일 때만 믿는다 — 그래서 이 값은
12099
+ * "끊겼다" 를 말하는 데만 쓰고 "붙었다" 를 보장하는 데는 안 쓴다. `useSyncExternalStore` 로 그릴 때마다 바깥 값을 읽어,
12100
+ * 첫 그림과 효과 사이에 바뀐 것을 놓치지 않는다. `navigator` 가 없는 터전(서버)에서는 붙은 것으로 친다 — 틀린 띠가 더 나쁘다.
12101
+ * @public
12102
+ */
12103
+ export declare function useOnline(): boolean;
12104
+
12105
+ /**
12106
+ * **밖을 누르면 접는다** — 펴 둔 목록 · 판을 닫는 한 가지 배선(말귀 청 (437) ㉲ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
12107
+ *
12108
+ * · **`mousedown` 에서 닫는다**(`click` 이 아니라) — 누르는 순간 닫혀야 그 아래 것이 눌리지 않는다. 통 **안**이면 아무 일도 안 한다.
12109
+ * · **펴 있을 때만 듣는다** — 접힌 목록 수십 개가 문서 듣개를 물고 있을 까닭이 없다.
12110
+ * · 닫는 함수는 ref 로 들고 최신 것을 부른다 — 인라인 함수를 넘겨도 렌더마다 듣개를 다시 걸지 않는다.
12111
+ * 닻이 있는 떠 있는 메뉴는 `useAnchoredMenu` 가 같은 일을 한다 — 이것은 제자리에 펴지는 목록 · 판 몫이다.
12112
+ * @public
12113
+ */
12114
+ export declare function useOutsideClose(isOpen: boolean, boxRef: RefObject<HTMLElement | null>, close: () => void): void;
12115
+
11813
12116
  /**
11814
12117
  * 클라이언트 페이지네이션 — 목록·페이지크기·현재 페이지로 현재 쪽 항목·총 쪽수·보정된
11815
12118
  * 현재 쪽을 낸다. 목록이 줄어 page 가 총 쪽수를 넘으면 마지막 쪽으로 조인다(curPage).
@@ -11834,6 +12137,20 @@ export declare function usePagedList<T>(items: T[], perPage: number, page: numbe
11834
12137
  curPage: number;
11835
12138
  };
11836
12139
 
12140
+ /**
12141
+ * **전체 화면 창이 사라지는 동안의 뒷일** — `PagePopup` 의 짝(말귀 청 (437) ㉰).
12142
+ *
12143
+ * · **한 번만 닫힌다** — ESC · 닫기 단추 · 안쪽 '완료' 가 잇달아 들어와도 첫 번째만 먹는다(타이머가 여럿 걸려 `onClose` 가 두 번 불리지 않게).
12144
+ * · **다 사라진 뒤에 떼어 낸다** — `closing` 을 켜고 `PAGE_POPUP_CLOSE_MS` 기다렸다가 `onClose`. **움직임 줄이기면 0** 이다.
12145
+ * · **`onClose` 가 던지면 풀린다** — 안 풀면 닫기 가드가 걸린 채 남아 다시는 못 닫는다(`TrainingPagePopup` 과 같은 고침 — 앱 사본엔 둘 다 없었다).
12146
+ * · 떠 있는 동안 뒤 화면 스크롤을 잠근다. 화면을 떠나면 타이머를 끈다.
12147
+ * @public
12148
+ */
12149
+ export declare function usePagePopupClose(onClose: () => void): {
12150
+ closing: boolean;
12151
+ handleClose: () => void;
12152
+ };
12153
+
11837
12154
  /**
11838
12155
  * **거르는 조건이 바뀌면 첫 쪽으로 돌아간다.** `usePagedList` 의 짝이다.
11839
12156
  *
@@ -11912,6 +12229,34 @@ export declare function usePasswordChange(onChangePassword?: (current: string, n
11912
12229
  */
11913
12230
  export declare function useRelativeDay(): (iso?: string | null) => string;
11914
12231
 
12232
+ /**
12233
+ * **쪽이 숨는 순간 초안을 바로 적는다**(말귀 청 (437) ㉲ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
12234
+ *
12235
+ * 고치던 것을 늦춰(디바운스) 적는 화면은, 마지막 손질 뒤 그 짬 안에 탭이 사라지면 그 손질만 빠진다. 폰에서는 드물지 않다 —
12236
+ * 글자를 치고 바로 홈 단추를 누르거나 전화가 와서 앱이 뒤로 밀린다. 묻는 길(`beforeunload`)은 iOS 사파리가 거의 안 쏴서 못 쓴다.
12237
+ *
12238
+ * · `visibilitychange` → `hidden` 이 폰에서 실제로 오는 신호다(홈 · 앱 전환 · 화면 잠금).
12239
+ * · `pagehide` 는 탭을 닫거나 옮길 때 · 뒤로-앞으로 캐시로 들어갈 때 와서 `hidden` 이 안 오는 경우를 메운다.
12240
+ * 둘 다 올 수 있다 — 같은 값을 두 번 적어도 해가 없게(멱등하게) 적는다.
12241
+ *
12242
+ * **여기서 비동기를 하지 않는다** — 숨는 순간 브라우저는 약속이 끝나기를 안 기다린다. `localStorage` 처럼 그 자리에서 끝나는 쓰기만.
12243
+ * @public
12244
+ */
12245
+ export declare function useSaveOnHide(save: () => void, enabled?: boolean): void;
12246
+
12247
+ /**
12248
+ * **켜 둔 동안 폰 화면이 저절로 꺼지지 않게 한다**(말귀 청 (437) ㉲ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
12249
+ *
12250
+ * 훈련은 "듣고 → 고르기" 라 손이 화면에 닿지 않는 구간이 길다 — 폰의 화면 꺼짐(30초 · 1분)이 먼저 와서 소리는 나는데 화면이
12251
+ * 꺼지고, 깨우면 잠금 화면이 가로막는다.
12252
+ *
12253
+ * · `active` 인 동안 `wakeLock.request('screen')` 을 잡는다. 못 잡으면(저전력 모드 · 안 되는 브라우저) **조용히** 지나간다.
12254
+ * · 탭이 숨겨지면 브라우저가 알아서 놓는다. **다시 보이면 다시 잡는다**(`visibilitychange`).
12255
+ * · 끝나면 놓는다. 잡는 중에 끝났으면 잡힌 것을 바로 놓는다(언마운트 뒤에 남는 잠금이 없게).
12256
+ * @public
12257
+ */
12258
+ export declare function useScreenWakeLock(active: boolean): void;
12259
+
11915
12260
  export declare function useSoundCompassExam(speakers: SpeakerPos[], { mode, autoStart, onPlaySpeaker, onComplete, playMs, feedbackMs, }?: UseSoundCompassExamOptions): SoundCompassExam;
11916
12261
 
11917
12262
  export declare interface UseSoundCompassExamOptions {
@@ -243,3 +243,11 @@
243
243
  cursor: not-allowed;
244
244
  }
245
245
 
246
+
247
+ /* **다 쳤는데 못 받는 날짜** — 칸에만 빨간 줄, 값은 안 바뀐다(말귀 청 (438) ㉲, 2026-11-14).
248
+ 색은 `TextField` 의 오류 꼴과 같은 토큰이다. 열린 꼴 · 포커스 꼴보다 뒤에 두어 이긴다. */
249
+ .date-picker--invalid .date-picker__trigger,
250
+ .date-picker--invalid .date-picker__trigger:focus {
251
+ border-color: var(--color-error);
252
+ box-shadow: 0 0 0 3px var(--color-error-a10);
253
+ }
@@ -354,6 +354,18 @@ export default function DatePicker({ value, onChange, size: sizeProp, min, max,
354
354
  const [y, m] = iso.split('-');
355
355
  setViewYM(+y, +m - 1);
356
356
  }, [min, max, onChange, setViewYM]);
357
+ /**
358
+ * **다 쳤는데 못 받는 글** — 빨간 줄만 두고 값은 안 바꾼다(말귀 청 (438) ㉲, 2026-11-14).
359
+ *
360
+ * 숫자 여덟을 다 쳤는데 없는 날이거나 `min`·`max` 밖이면 칸에만 표시한다. 치는 중(여덟 아래)에는
361
+ * 아직 틀린 것이 아니라 안 칠한다. 칸을 떠나면 친 글을 버리므로(아래) 표시도 같이 사라진다.
362
+ */
363
+ const typedInvalid = (() => {
364
+ if (typed == null || typed.replace(/\D/g, '').length < 8)
365
+ return false;
366
+ const iso = parseTyped(typed);
367
+ return !iso || (!!min && iso < min) || (!!max && iso > max);
368
+ })();
357
369
  /** 다 못 친 글은 **버린다** — 고른 값으로 되돌린다. 반쪽 글을 남겨 두면 날짜처럼 보인다 */
358
370
  const commitTyped = useCallback(() => { setTyped(null); }, []);
359
371
  const onFieldKeyDown = useCallback((e) => {
@@ -381,5 +393,5 @@ export default function DatePicker({ value, onChange, size: sizeProp, min, max,
381
393
  const col = (i % 7);
382
394
  return (_jsx("button", { type: "button", disabled: dis, "data-day": d, tabIndex: d === tabIndexOf ? 0 : -1, "aria-current": isToday ? 'date' : undefined, onClick: () => !dis && selectDay(d), className: cx('date-picker__day caption-1', isSelected && 'date-picker__day--selected', isToday && !isSelected && 'date-picker__day--today', dis && 'date-picker__day--disabled', col === 0 && 'date-picker__day--sun', col === 6 && 'date-picker__day--sat'), children: d }, d));
383
395
  })] })] }), document.body) : null;
384
- return (_jsxs("div", { className: cx('date-picker', `date-picker--s${size}`, open && 'date-picker--open', className), children: [_jsxs("div", { className: "date-picker__field", children: [_jsx("input", { ref: triggerRef, type: "text", className: "date-picker__trigger body-2", value: typed ?? formatDisplay(value), placeholder: placeholder, onChange: (e) => onTyped(e.target.value), onClick: () => !disabled && !open && toggle(), onKeyDown: onFieldKeyDown, onBlur: commitTyped, disabled: disabled, "aria-haspopup": "dialog", "aria-expanded": open, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, inputMode: "numeric", autoComplete: "off" }), _jsx("button", { type: "button", className: "date-picker__icon-btn", onClick: () => !disabled && toggle(), disabled: disabled, tabIndex: -1, "aria-label": placeholder, "aria-haspopup": "dialog", "aria-expanded": open, children: _jsx(Calendar, { size: iconSize, className: "date-picker__icon", strokeWidth: 1.5 }) })] }), dropdown] }));
396
+ return (_jsxs("div", { className: cx('date-picker', `date-picker--s${size}`, open && 'date-picker--open', typedInvalid && 'date-picker--invalid', className), children: [_jsxs("div", { className: "date-picker__field", children: [_jsx("input", { ref: triggerRef, type: "text", className: "date-picker__trigger body-2", value: typed ?? formatDisplay(value), placeholder: placeholder, onChange: (e) => onTyped(e.target.value), onClick: () => !disabled && !open && toggle(), onKeyDown: onFieldKeyDown, onBlur: commitTyped, disabled: disabled, "aria-haspopup": "dialog", "aria-expanded": open, "aria-invalid": typedInvalid || undefined, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, inputMode: "numeric", autoComplete: "off" }), _jsx("button", { type: "button", className: "date-picker__icon-btn", onClick: () => !disabled && toggle(), disabled: disabled, tabIndex: -1, "aria-label": placeholder, "aria-haspopup": "dialog", "aria-expanded": open, children: _jsx(Calendar, { size: iconSize, className: "date-picker__icon", strokeWidth: 1.5 }) })] }), dropdown] }));
385
397
  }
@@ -0,0 +1,55 @@
1
+ import { Component, type ErrorInfo, type ReactNode } from 'react';
2
+ /** @public 넘어진 화면을 그릴 때 받는 것 */
3
+ export interface ErrorFallbackProps {
4
+ error?: Error;
5
+ /** 다시 그려 본다 — 일시적인 렌더 오류는 이것으로 풀리는 수가 많다 */
6
+ retry: () => void;
7
+ /** 쪽을 새로 고친다 — 낡은 묶음(배포 뒤 옛 조각) 오류는 되살려도 같은 오류가 다시 난다 */
8
+ reload: () => void;
9
+ /** 낡은 묶음 오류인가 — 참이면 `reload` 를 권한다 */
10
+ staleChunk: boolean;
11
+ }
12
+ /** @public */
13
+ export interface ErrorBoundaryProps {
14
+ children: ReactNode;
15
+ /** 넘어진 화면 — 문구 · 모양은 앱 몫이다. 안 주면 아무것도 안 그린다 */
16
+ fallback?: (p: ErrorFallbackProps) => ReactNode;
17
+ onError?: (error: Error, info: ErrorInfo) => void;
18
+ /**
19
+ * 이 값들이 바뀌면 오류를 푼다 — 보통 지금 쪽의 열쇠를 넘긴다. 울타리가 쪽 전환보다 바깥에 있으면 쪽을 바꿔도 같은 울타리가
20
+ * 남아 오류 화면에 붙박이고, 머리 · 바닥 내비만 눌리는 채 빠져나갈 길이 새로고침뿐이 된다.
21
+ */
22
+ resetKeys?: readonly unknown[];
23
+ /** 새로고침을 바꿔 끼운다 — 시험이 jsdom 의 `location.reload` 를 못 부르므로 */
24
+ reload?: () => void;
25
+ /**
26
+ * 개발 중 고쳐 끼우기(HMR)가 왔을 때 '이 울타리가 오류 화면인가' 를 알릴 자리 — 앱의 개발용 손을 넘긴다.
27
+ * 받은 함수를 부르면 지금 오류 화면인지 답하고, 돌려준 함수는 떼어 낼 때 부른다.
28
+ */
29
+ registerHealth?: (isBroken: () => boolean) => () => void;
30
+ }
31
+ interface State {
32
+ hasError: boolean;
33
+ error?: Error;
34
+ }
35
+ /**
36
+ * **오류 울타리** — 아래 화면이 그리다 넘어지면 잡아서 넘어진 화면을 세운다(말귀 청 (437) ㉴ — 말귀 앱 · 어드민 두 벌을 하나로, 2026-11-13).
37
+ *
38
+ * · **운영에서도 남긴다** — `console.error(error, '[ErrorBoundary]', 줄기)` 로. 앱의 오류 보고가 `console.error` 를 가로채 보낸다.
39
+ * `Error` 를 **첫 인자로** 준다 — 문자열이 앞이면 보고가 새 `Error` 를 만들어 줄기(스택)가 사라진다.
40
+ * · `resetKeys` 가 바뀌면 오류를 푼다(쪽을 옮기면 빠져나올 수 있게).
41
+ * · 낡은 묶음 오류(`isChunkLoadError`)면 `staleChunk` 를 참으로 넘긴다 — 되살리기가 아니라 새로고침을 권할 자리다.
42
+ * · 넘어진 화면의 문구 · 모양 · 개발용 다시 그리기는 앱이 넘긴다(`fallback` · `registerHealth`).
43
+ * @public
44
+ */
45
+ export default class ErrorBoundary extends Component<ErrorBoundaryProps, State> {
46
+ state: State;
47
+ private releaseHealth?;
48
+ static getDerivedStateFromError(error: Error): State;
49
+ componentDidCatch(error: Error, info: ErrorInfo): void;
50
+ componentDidMount(): void;
51
+ componentWillUnmount(): void;
52
+ componentDidUpdate(prevProps: ErrorBoundaryProps): void;
53
+ render(): ReactNode;
54
+ }
55
+ export {};
@@ -0,0 +1,52 @@
1
+ 'use client';
2
+ import { Component } from 'react';
3
+ import { isChunkLoadError } from '../utils/chunkSkew';
4
+ /**
5
+ * **오류 울타리** — 아래 화면이 그리다 넘어지면 잡아서 넘어진 화면을 세운다(말귀 청 (437) ㉴ — 말귀 앱 · 어드민 두 벌을 하나로, 2026-11-13).
6
+ *
7
+ * · **운영에서도 남긴다** — `console.error(error, '[ErrorBoundary]', 줄기)` 로. 앱의 오류 보고가 `console.error` 를 가로채 보낸다.
8
+ * `Error` 를 **첫 인자로** 준다 — 문자열이 앞이면 보고가 새 `Error` 를 만들어 줄기(스택)가 사라진다.
9
+ * · `resetKeys` 가 바뀌면 오류를 푼다(쪽을 옮기면 빠져나올 수 있게).
10
+ * · 낡은 묶음 오류(`isChunkLoadError`)면 `staleChunk` 를 참으로 넘긴다 — 되살리기가 아니라 새로고침을 권할 자리다.
11
+ * · 넘어진 화면의 문구 · 모양 · 개발용 다시 그리기는 앱이 넘긴다(`fallback` · `registerHealth`).
12
+ * @public
13
+ */
14
+ export default class ErrorBoundary extends Component {
15
+ state = { hasError: false };
16
+ releaseHealth;
17
+ static getDerivedStateFromError(error) {
18
+ return { hasError: true, error };
19
+ }
20
+ componentDidCatch(error, info) {
21
+ this.props.onError?.(error, info);
22
+ console.error(error, '[ErrorBoundary]', info.componentStack);
23
+ }
24
+ componentDidMount() {
25
+ this.releaseHealth = this.props.registerHealth?.(() => this.state.hasError);
26
+ }
27
+ componentWillUnmount() {
28
+ this.releaseHealth?.();
29
+ }
30
+ componentDidUpdate(prevProps) {
31
+ if (!this.state.hasError)
32
+ return;
33
+ const prev = prevProps.resetKeys;
34
+ const next = this.props.resetKeys;
35
+ if (!prev || !next)
36
+ return;
37
+ if (prev.length !== next.length || prev.some((k, i) => !Object.is(k, next[i]))) {
38
+ this.setState({ hasError: false, error: undefined });
39
+ }
40
+ }
41
+ render() {
42
+ if (!this.state.hasError)
43
+ return this.props.children;
44
+ const error = this.state.error;
45
+ return this.props.fallback?.({
46
+ error,
47
+ retry: () => this.setState({ hasError: false, error: undefined }),
48
+ reload: this.props.reload ?? (() => { window.location.reload(); }),
49
+ staleChunk: isChunkLoadError(error),
50
+ }) ?? null;
51
+ }
52
+ }
@@ -0,0 +1,25 @@
1
+ /** @public */
2
+ export interface FolderAddPopupProps {
3
+ value: string;
4
+ onChange: (value: string) => void;
5
+ /** 지금 이름으로 만들 수 있나 — 아니면 「추가」 가 꺼지고 Enter 도 안 먹는다. 무엇이 못 만들 이름인지는 화면이 정한다 */
6
+ canAdd: boolean;
7
+ /** 입력칸 아래에 보일 말(이미 있는 이름 등) — 없으면 안 선다 */
8
+ error?: string;
9
+ /** 만든다 — 받은 `close` 로 닫는다(안 부르면 창이 남아 이름을 고쳐 넣는다) */
10
+ onAdd: (close: () => void) => void;
11
+ onClose: () => void;
12
+ /** 이름 길이 상한 — 폴더 이름은 길과 폴더 칸에 그대로 나온다. 안 주면 상한 없음 */
13
+ maxLength?: number;
14
+ }
15
+ /**
16
+ * **폴더 추가 창**(말귀 청 (438) ㉴ — 말귀 앱에서 옮겨 왔다, 2026-11-14). `FolderHead` · `FolderGrid` · `FolderList` 와 한 벌이다.
17
+ *
18
+ * 작은 확인 창, 제목 아래 부제, 이름표 없는 입력칸 하나, 취소 · 추가.
19
+ * · **못 만들 이름이면 「추가」 가 꺼진다**(`canAdd`).
20
+ * · **닫는 길을 넘겨준다**(`onAdd(close)`) — 되면 그때 닫는다. 이름이 틀렸을 때 열린 채로 남아야 고쳐 넣는다.
21
+ * · **한글을 조합하는 중의 Enter 로는 안 만든다** — 조합 확정 Enter 는 `TextField.onEnter` 가 가린다.
22
+ * · 글 넷은 코어 사전(`folder.add.*` · `common.add`)이다.
23
+ * @public
24
+ */
25
+ export default function FolderAddPopup({ value, onChange, canAdd, error, onAdd, onClose, maxLength }: FolderAddPopupProps): import("react").JSX.Element;