@ihabdevteam/core 0.384.0 → 0.387.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 (29) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/dist/components.cjs.js +173 -173
  3. package/dist/components.esm.css +1 -1
  4. package/dist/hooks.cjs.js +3 -3
  5. package/dist/i18n.cjs.js +3 -3
  6. package/dist/ihabdevteam-core.cjs.js +180 -180
  7. package/dist/ihabdevteam-core.d.ts +58 -5
  8. package/dist/packages/core/src/components/Table.js +8 -3
  9. package/dist/packages/core/src/components/Training/WordTablePopup.d.ts +16 -2
  10. package/dist/packages/core/src/components/Training/WordTablePopup.js +5 -3
  11. package/dist/packages/core/src/components/Word/TableFilterPanel.js +1 -1
  12. package/dist/packages/core/src/components/Word/WordSearchResultBlock.css +19 -0
  13. package/dist/packages/core/src/components/Word/WordSearchResultBlock.d.ts +20 -1
  14. package/dist/packages/core/src/components/Word/WordSearchResultBlock.js +5 -2
  15. package/dist/packages/core/src/components/Word/WordTableBlock.d.ts +1 -1
  16. package/dist/packages/core/src/components/Word/WordTableBlock.js +8 -7
  17. package/dist/packages/core/src/components/Word/useWordTableDisplaySettings.d.ts +8 -0
  18. package/dist/packages/core/src/components/Word/useWordTableDisplaySettings.js +14 -6
  19. package/dist/packages/core/src/components/Word/wordTableBlockTypes.d.ts +2 -0
  20. package/dist/packages/core/src/components/Word/wordTableSettings.d.ts +30 -1
  21. package/dist/packages/core/src/components/Word/wordTableSettings.js +31 -1
  22. package/dist/packages/core/src/components/WordTable.d.ts +11 -1
  23. package/dist/packages/core/src/components/WordTable.js +11 -3
  24. package/dist/packages/core/src/i18n/locales/en.json +2 -0
  25. package/dist/packages/core/src/i18n/locales/ko.json +2 -0
  26. package/dist/packages/core/src/version.d.ts +1 -1
  27. package/dist/packages/core/src/version.js +1 -1
  28. package/dist/utils.cjs.js +23 -23
  29. package/package.json +1 -1
@@ -1787,7 +1787,7 @@ export declare function copyText(text: string): Promise<boolean>;
1787
1787
  *
1788
1788
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
1789
1789
  */
1790
- export declare const CORE_VERSION = "0.384.0";
1790
+ export declare const CORE_VERSION = "0.387.0";
1791
1791
 
1792
1792
  /** @public */
1793
1793
  declare const coreDefault: Record<string, unknown>;
@@ -10813,6 +10813,14 @@ export declare function useWordTableDisplaySettings(items: WordSearchResultItem[
10813
10813
  * 안 쓰는 화면에 켜고 끌 것이 없는 절이 서면 안 되므로 기본은 거짓이다. */
10814
10814
  opts?: {
10815
10815
  paperBands?: boolean;
10816
+ /**
10817
+ * 한 쪽에 설 수 있는 **최대 칸 수** — 칸 수와는 다른 것이다(말귀 청 (333)·(340)).
10818
+ *
10819
+ * 활용표의 칸 수는 낱말이 정해서 서른여섯까지 가는데, 종이 한 장에 열둘보다 많으면
10820
+ * 글자가 작아져 못 읽는다. `WordTableBlock` 에는 (333) 으로 들어갔고 **이 길에는
10821
+ * 빠져 있었다** — 저장된 표를 열면 쪽당 첫 칸이 '13개'(칸 수 전부)로 섰다.
10822
+ */
10823
+ maxItemsPerPage?: number;
10816
10824
  }): UseWordTableDisplaySettingsResult;
10817
10825
 
10818
10826
  /** @public */
@@ -11431,7 +11439,7 @@ export declare interface WordSearchFilterPanelProps {
11431
11439
  }
11432
11440
 
11433
11441
  /** @public */
11434
- export declare function WordSearchResultBlock({ titleIcon, resultCount, resultUnit, searchQuery, items, groups, selected, onSelect, maxSelect, onClearSelection, onPrint, onPrintEmpty, className, emptyHint, sectionType, disc, }: WordSearchResultBlockProps): JSX.Element;
11442
+ export declare function WordSearchResultBlock({ titleIcon, resultCount, resultUnit, searchQuery, items, groups, selected, onSelect, maxSelect, onClearSelection, onPrint, onPrintEmpty, className, emptyHint, showEmptyText, sectionType, disc, }: WordSearchResultBlockProps): JSX.Element;
11435
11443
 
11436
11444
  /** @public */
11437
11445
  export declare interface WordSearchResultBlockProps {
@@ -11466,6 +11474,25 @@ export declare interface WordSearchResultBlockProps {
11466
11474
  * 왜 없는지를 말해 주는 자리다.
11467
11475
  */
11468
11476
  emptyHint?: ReactNode;
11477
+ /**
11478
+ * 결과가 0 일 때 **"검색 결과가 없습니다." 를 세울지** — 기본 참(말귀 청 (341), 2026-10-28,
11479
+ * 사장님 지시 *"결과가 0이면 '검색 결과가 없습니다.' 제거하고 filterpanel 접었을때와 동일한
11480
+ * 높이로"*).
11481
+ *
11482
+ * **0 에는 두 가지가 있다.**
11483
+ *
11484
+ * | | 보기 | 빈 말이 |
11485
+ * |---|---|---|
11486
+ * | **아직 안 찾았다** | 활용표에서 글자를 치기 전 | **군더더기** — 찾은 적이 없다 |
11487
+ * | **찾았는데 없다** | `ㅋㅋㅋ` 를 친 뒤 | **쓸모 있다** — 왜 비었는지 말해 준다 |
11488
+ *
11489
+ * 코어는 `items.length === 0` 하나로 둘을 같게 본다. **부르는 쪽은 둘을 안다**(찾기를
11490
+ * 돌렸는지 아닌지를 아니까). 그래서 통째로 없애지 않고 **끌 손잡이**만 둔다 — 찾기 전에만
11491
+ * 끄면 된다. 끄면 그 자리가 통째로 빠져 머리 한 줄만 남는다.
11492
+ *
11493
+ * `emptyHint` 는 이것과 **따로 간다** — 끈 채로 힌트만 보일 일이 있다면 그 뜻대로 선다.
11494
+ */
11495
+ showEmptyText?: boolean;
11469
11496
  }
11470
11497
 
11471
11498
  /** @public */
@@ -11530,9 +11557,9 @@ export declare interface WordSearchResultWord {
11530
11557
  * 표시(items)·편집(editCells) 두 모드를 지원한다.
11531
11558
  * @public
11532
11559
  */
11533
- export declare function WordTable({ title, titleIcon, disc, className, orientation, contentTypes, baseItem, baseContentTypes, cutLine, showOutline, showDivLine, items, editCells, count, activeCell, onActivateCell, onRemoveCell, onRemoveItem, onReorder, indexOffset, totalCount, renderCellAction, showFillerAdd, addableCount, contentRef, buttonSize, brand, code, pageNumber, pageNumberPosition, fitHeight, scoring, marks, onMarkClick, scoreIndexOffset, }: WordTableProps): JSX.Element;
11560
+ export declare function WordTable({ title, titleIcon, disc, className, orientation, contentTypes, baseItem, baseContentTypes, cutLine, showOutline, showDivLine, items, editCells, count, activeCell, onActivateCell, onRemoveCell, onRemoveItem, onReorder, onCopyItem, indexOffset, totalCount, renderCellAction, showFillerAdd, addableCount, contentRef, buttonSize, brand, code, pageNumber, pageNumberPosition, fitHeight, scoring, marks, onMarkClick, scoreIndexOffset, }: WordTableProps): JSX.Element;
11534
11561
 
11535
- export declare function WordTableBlock({ title, titleIcon, disc, filterTitle, filterCollapsible, filterDefaultCollapsed, filterCollapsed, onFilterCollapsedChange, filterHeaderSummary, brand, code, baseItem, baseContentTypes, cellCapacity, maxItemsPerPage, items, onSaveComplete, onLoad, onRemoveItem, onReset, resetLabel, saveButtonLabel, secondarySaveButtonLabel, onReorder, showCellCount, onAddItem, className, renderSavePopup, renderWordSearch, hideControls, saveOnly, tableName, nameValue, onNameChange, descriptionValue, onDescriptionChange, namePlaceholder, descriptionPlaceholder, existingNames, editingName, onCancel, initialItemsPerPage, renderCellAction, actionsLeftExtra }: WordTableBlockProps): JSX.Element;
11562
+ export declare function WordTableBlock({ title, titleIcon, disc, filterTitle, filterCollapsible, filterDefaultCollapsed, filterCollapsed, onFilterCollapsedChange, filterHeaderSummary, brand, code, baseItem, baseContentTypes, cellCapacity, maxItemsPerPage, items, onSaveComplete, onLoad, onRemoveItem, onCopyItem, onReset, resetLabel, saveButtonLabel, secondarySaveButtonLabel, onReorder, showCellCount, onAddItem, className, renderSavePopup, renderWordSearch, hideControls, saveOnly, tableName, nameValue, onNameChange, descriptionValue, onDescriptionChange, namePlaceholder, descriptionPlaceholder, existingNames, editingName, onCancel, initialItemsPerPage, renderCellAction, actionsLeftExtra }: WordTableBlockProps): JSX.Element;
11536
11563
 
11537
11564
  /** @public */
11538
11565
  export declare interface WordTableBlockProps {
@@ -11635,6 +11662,8 @@ export declare interface WordTableBlockProps {
11635
11662
  onSaveComplete?: (name: string, items: WordSearchResultItem[], description?: string, saveAsNew?: boolean) => void;
11636
11663
  onLoad?: () => void;
11637
11664
  onRemoveItem?: (id: string) => void;
11665
+ /** 주면 칸에 **복사 단추**가 선다 — 그 낱말을 한 칸 더 만든다. 꼴은 코어가 빼기·옮기기와 같게 짓는다. */
11666
+ onCopyItem?: (id: string, index: number) => void;
11638
11667
  /** 전달하면 액션 영역 왼쪽에 초기화 버튼 표시 */
11639
11668
  onReset?: () => void;
11640
11669
  resetLabel?: string;
@@ -11850,7 +11879,7 @@ export declare type WordTableOrientation = 'landscape' | 'portrait';
11850
11879
  * 표 내부에는 제목을 두지 않아 팝업 헤더 제목과 중복되지 않는다.
11851
11880
  * @public
11852
11881
  */
11853
- export declare function WordTablePopup({ items, words, title, subtitle, emptyText, buttons, renderButtons, renderFooter, footerClassName, footerLayout, printFileName, showSettings, autoPrint, className, onClose, scoring, onScoreChange, printHeader, brand, code, beforeClose }: WordTablePopupProps): JSX.Element;
11882
+ export declare function WordTablePopup({ items, words, baseItem, baseContentTypes, maxItemsPerPage, title, subtitle, emptyText, buttons, renderButtons, renderFooter, footerClassName, footerLayout, printFileName, showSettings, autoPrint, className, onClose, scoring, onScoreChange, printHeader, brand, code, beforeClose }: WordTablePopupProps): JSX.Element;
11854
11883
 
11855
11884
  /** @public */
11856
11885
  export declare interface WordTablePopupActions {
@@ -11864,6 +11893,20 @@ export declare interface WordTablePopupActions {
11864
11893
  export declare interface WordTablePopupProps {
11865
11894
  /** 표시할 단어표 항목(저장된 표 등). 지정 시 words보다 우선. */
11866
11895
  items?: WordSearchResultItem[];
11896
+ /**
11897
+ * **절반을 쓰는 머리 칸** — 안쪽 `WordTable` 의 같은 이름 프롭으로 그대로 간다(말귀 청 (340)).
11898
+ *
11899
+ * 활용표의 칸은 **모두 같은 낱말의 다른 꼴**이라, 머리 칸이 없으면 종이에
11900
+ * `가벼워요 · 가벼운 · 가볍기 …` 만 남고 **그것이 `가볍다` 의 활용이라는 말이 아무 데도
11901
+ * 없다.** 이름표(`두루높임`)는 *어떤 꼴인가* 를 말할 뿐 *무엇의 꼴인가* 는 말하지 않는다.
11902
+ * 만들기 화면에는 서는 칸이라, 이것이 없으면 **저장하면 사라지는 꼴**이었다(청 (325) 가
11903
+ * `WordTableBlock` 에만 들어갔다).
11904
+ */
11905
+ baseItem?: WordSearchResultItem;
11906
+ /** 머리 칸에만 따로 걸 구성 — 안 주면 표의 것을 따른다(활용표는 그림을 머리 칸에만 둔다). */
11907
+ baseContentTypes?: WordTableContentType[];
11908
+ /** 한 쪽에 설 수 있는 최대 칸 수 — 칸 수와는 다른 것이다(청 (333)·(340)). */
11909
+ maxItemsPerPage?: number;
11867
11910
  /** 표시할 단어 목록(문자열). 각 단어를 한 칸으로 매핑한다. items 미지정 시 사용. */
11868
11911
  words?: unknown[];
11869
11912
  /** 팝업 제목. 기본값 '주요 단어'. */
@@ -11958,6 +12001,16 @@ export declare interface WordTableProps {
11958
12001
  * 초점을 두고 `Alt`+`←`/`→`, 그리고 **길게 눌러**(400ms) 손가락으로 끌기.
11959
12002
  * 키보드로 옮기면 초점이 그 칸을 따라가고 바뀐 자리를 `role="status"` 로 알린다.
11960
12003
  */
12004
+ /**
12005
+ * 칸을 **한 칸 더** 만든다 — 주면 칸의 오른쪽 기둥에 복사 단추가 선다(사용자 지시 2026-10-28).
12006
+ *
12007
+ * **코어가 그린다.** 전에는 부르는 쪽이 `renderCellAction` 으로 제 단추를 얹었는데, 그러면
12008
+ * 같은 자리에 선 단추인데 **꼴이 저마다**가 된다 — `useBorder` 가 기본 `true` 라 안 적은
12009
+ * 쪽만 테두리가 생겨 칸 위에서 혼자 튀었다(사장님이 화면에서 짚으셨다. 2026-09-27 에도
12010
+ * 같은 것을 이르셨다: *"다른 단어로 버튼만 다르네? 베리언트 동일하게"*).
12011
+ * 여기서 그리면 빼기·옮기기와 **같은 꼴로 지어진다** — 맞출 것이 없다.
12012
+ */
12013
+ onCopyItem?: (id: string, index: number) => void;
11961
12014
  onReorder?: (fromIndex: number, toIndex: number) => void;
11962
12015
  /**
11963
12016
  * 이 표의 첫 칸이 **전체 목록에서 몇 번째**인가 — 쪽으로 나뉜 표에서 `WordTableBlock` 이 준다
@@ -26,9 +26,14 @@ import useMediaQuery from '../hooks/useMediaQuery';
26
26
  역할이 없던 때는 줄 전체가 한 덩어리 글로 읽혀 `홍길동 010-1234-5678 2026-09-30 활성`
27
27
  이 한 호흡에 나갔다 — 어디까지가 이름이고 어디부터 전화인지 소리로는 알 수 없었다. */
28
28
  function TableCell({ children, className, style, span, rowLabel, onRowClick }) {
29
- /* 부르는 쪽이 `style` 에 적은 `gridColumn` 은 그대로 둔다 — `span` 을 줬을 때만 코어가 짓는다.
30
- 둘 다 주면 부르는 쪽 것이 이긴다(뒤에 놓인다): 격자는 그쪽 뜻대로 서고, 재는 자리는
31
- `span` 을 보니 둘이 어긋나면 그것은 부르는 쪽이 고를 일이다. */
29
+ /* 부르는 쪽이 `style` 에 적은 `gridColumn` 은 그대로 둔다 — `span` 을 줬을 때만 코어가 짓고,
30
+ 둘 다 주면 부르는 쪽 것이 이긴다(뒤에 놓인다).
31
+
32
+ **어긋날 자리가 없다.** 재는 쪽(`measureAutoWidths`)이 이 프롭이 아니라 **선 격자**를
33
+ 읽으므로(`spanFromGridStyle`), `style` 로 덮으면 격자와 셈이 함께 따라간다. 화면 폭에
34
+ 따라 덮는 수를 바꾸는 표도 그래서 그냥 맞는다(`span 1` 이면 `gridColumn` 을 아예 안
35
+ 붙이고, 읽는 쪽도 1 로 본다). `aria-colspan` 은 이 프롭을 받을 때만 붙으므로 셈의
36
+ 열쇠로 쓰지 않는다 — 그것만 믿으면 손으로 적은 줄을 못 본다. */
32
37
  const cellStyle = span && span > 1
33
38
  ? { gridColumn: `span ${span}`, ...style }
34
39
  : style;
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type PopupProps } from '../Popup/Popup';
3
- import type { WordTableProps } from '../WordTable';
3
+ import type { WordTableProps, WordTableContentType } from '../WordTable';
4
4
  import type { WordSearchResultItem } from '../../types/wordSearch';
5
5
  import { type ScoreMark } from '../Word/wordTableScoring';
6
6
  import './WordTablePopup.css';
@@ -15,6 +15,20 @@ export interface WordTablePopupActions {
15
15
  export interface WordTablePopupProps {
16
16
  /** 표시할 단어표 항목(저장된 표 등). 지정 시 words보다 우선. */
17
17
  items?: WordSearchResultItem[];
18
+ /**
19
+ * **절반을 쓰는 머리 칸** — 안쪽 `WordTable` 의 같은 이름 프롭으로 그대로 간다(말귀 청 (340)).
20
+ *
21
+ * 활용표의 칸은 **모두 같은 낱말의 다른 꼴**이라, 머리 칸이 없으면 종이에
22
+ * `가벼워요 · 가벼운 · 가볍기 …` 만 남고 **그것이 `가볍다` 의 활용이라는 말이 아무 데도
23
+ * 없다.** 이름표(`두루높임`)는 *어떤 꼴인가* 를 말할 뿐 *무엇의 꼴인가* 는 말하지 않는다.
24
+ * 만들기 화면에는 서는 칸이라, 이것이 없으면 **저장하면 사라지는 꼴**이었다(청 (325) 가
25
+ * `WordTableBlock` 에만 들어갔다).
26
+ */
27
+ baseItem?: WordSearchResultItem;
28
+ /** 머리 칸에만 따로 걸 구성 — 안 주면 표의 것을 따른다(활용표는 그림을 머리 칸에만 둔다). */
29
+ baseContentTypes?: WordTableContentType[];
30
+ /** 한 쪽에 설 수 있는 최대 칸 수 — 칸 수와는 다른 것이다(청 (333)·(340)). */
31
+ maxItemsPerPage?: number;
18
32
  /** 표시할 단어 목록(문자열). 각 단어를 한 칸으로 매핑한다. items 미지정 시 사용. */
19
33
  words?: unknown[];
20
34
  /** 팝업 제목. 기본값 '주요 단어'. */
@@ -71,4 +85,4 @@ export interface WordTablePopupProps {
71
85
  * 표 내부에는 제목을 두지 않아 팝업 헤더 제목과 중복되지 않는다.
72
86
  * @public
73
87
  */
74
- export default function WordTablePopup({ items, words, title, subtitle, emptyText, buttons, renderButtons, renderFooter, footerClassName, footerLayout, printFileName, showSettings, autoPrint, className, onClose, scoring, onScoreChange, printHeader, brand, code, beforeClose }: WordTablePopupProps): import("react").JSX.Element;
88
+ export default function WordTablePopup({ items, words, baseItem, baseContentTypes, maxItemsPerPage, title, subtitle, emptyText, buttons, renderButtons, renderFooter, footerClassName, footerLayout, printFileName, showSettings, autoPrint, className, onClose, scoring, onScoreChange, printHeader, brand, code, beforeClose }: WordTablePopupProps): import("react").JSX.Element;
@@ -19,7 +19,7 @@ import { useToastState } from '../../hooks/useToastState';
19
19
  * 표 내부에는 제목을 두지 않아 팝업 헤더 제목과 중복되지 않는다.
20
20
  * @public
21
21
  */
22
- export default function WordTablePopup({ items, words, title, subtitle, emptyText, buttons, renderButtons, renderFooter, footerClassName, footerLayout, printFileName, showSettings, autoPrint, className, onClose, scoring = false, onScoreChange, printHeader, brand, code, beforeClose }) {
22
+ export default function WordTablePopup({ items, words, baseItem, baseContentTypes, maxItemsPerPage, title, subtitle, emptyText, buttons, renderButtons, renderFooter, footerClassName, footerLayout, printFileName, showSettings, autoPrint, className, onClose, scoring = false, onScoreChange, printHeader, brand, code, beforeClose }) {
23
23
  const { t } = useTranslation();
24
24
  // items 우선, 없으면 문자열 words → 한 단어=한 칸으로 매핑
25
25
  const tableItems = useMemo(() => {
@@ -30,7 +30,7 @@ export default function WordTablePopup({ items, words, title, subtitle, emptyTex
30
30
  .map((w, i) => ({ id: `${w}-${i}`, words: [{ label: w }] }));
31
31
  }, [items, words]);
32
32
  // 표 설정(구성·용지 방향·외곽선·페이지당 개수 등) — showSettings일 때만 FilterPanel로 노출하고, 값은 항상 표에 반영한다.
33
- const { settings, filterSections, filterSelected, handleSelect, pages, isPaginated, pageNumberPosition } = useWordTableDisplaySettings(tableItems, { paperBands: Boolean(brand?.show) });
33
+ const { settings, filterSections, filterSelected, handleSelect, pages, isPaginated, pageNumberPosition } = useWordTableDisplaySettings(tableItems, { paperBands: Boolean(brand?.show), maxItemsPerPage });
34
34
  /* 쪽마다 첫 칸이 표 전체에서 몇 번째인지 — 쪽 안에서 0부터 다시 세는 번호를
35
35
  표 전체 번호로 옮긴다. */
36
36
  const pageStart = useMemo(() => pageStartIndexes(pages.map(p => p.length)), [pages]);
@@ -115,5 +115,7 @@ export default function WordTablePopup({ items, words, title, subtitle, emptyTex
115
115
  }, 100);
116
116
  return () => window.clearTimeout(id);
117
117
  }, [autoPrint]);
118
- return (_jsxs(Popup, { title: title ?? t('keyWords.title', '주요 단어'), subtitle: subtitle, size: "large", className: cx('word-table-popup', className), buttons: footerButtons, footer: customFooter, footerClassName: footerClassName, footerLayout: footerLayout, beforeClose: beforeClose, onClose: onClose, children: [tableItems.length > 0 ? (_jsxs("div", { className: "word-table-popup__body", children: [showSettings && (_jsx(TableFilterPanel, { sections: filterSections, selected: filterSelected, onSelect: handleSelect })), isPaginated ? (_jsx("div", { className: "word-table-popup__pages", children: pages.map((page, i) => (_jsx(WordTable, { items: page, orientation: settings.orientation, contentTypes: settings.contentTypes, cutLine: settings.cutLine, showOutline: settings.showOutline, showDivLine: settings.showDivLine, count: settings.count, contentRef: el => { pageRefs.current[i] = el; }, pageNumber: { current: i + 1, total: pages.length }, pageNumberPosition: pageNumberPosition, brand: brand && { ...brand, top: settings.showTopInfo, bottom: settings.showBottomInfo }, code: code, scoring: scoring, scoreIndexOffset: pageStart[i], marks: marksForTable, onMarkClick: handleMarkClick }, i))) })) : (_jsx("div", { className: "word-table-popup__table", children: _jsx(WordTable, { items: tableItems, orientation: settings.orientation, contentTypes: settings.contentTypes, cutLine: settings.cutLine, showOutline: settings.showOutline, showDivLine: settings.showDivLine, count: settings.count, contentRef: contentRef, fitHeight: true, scoring: scoring, marks: marksForTable, onMarkClick: handleMarkClick, brand: brand && { ...brand, top: settings.showTopInfo, bottom: settings.showBottomInfo }, code: code }) }))] })) : (_jsx("p", { className: "word-table-popup__empty body-3", children: emptyText ?? t('keyWords.empty', '추출된 주요 단어가 없습니다.') })), _jsx(Toast, { message: toastMsg, position: "top", onClose: handleToastClose }, toastKey)] }));
118
+ return (_jsxs(Popup, { title: title ?? t('keyWords.title', '주요 단어'), subtitle: subtitle, size: "large", className: cx('word-table-popup', className), buttons: footerButtons, footer: customFooter, footerClassName: footerClassName, footerLayout: footerLayout, beforeClose: beforeClose, onClose: onClose, children: [tableItems.length > 0 ? (_jsxs("div", { className: "word-table-popup__body", children: [showSettings && (_jsx(TableFilterPanel, { sections: filterSections, selected: filterSelected, onSelect: handleSelect })), isPaginated ? (_jsx("div", { className: "word-table-popup__pages", children: pages.map((page, i) => (_jsx(WordTable, { items: page, orientation: settings.orientation, contentTypes: settings.contentTypes,
119
+ /* 쪽마다 머리 칸이 선다 — 한 장만 뽑아 들어도 무엇의 활용인지 알 수 있게 */
120
+ baseItem: baseItem, baseContentTypes: baseContentTypes, cutLine: settings.cutLine, showOutline: settings.showOutline, showDivLine: settings.showDivLine, count: settings.count, contentRef: el => { pageRefs.current[i] = el; }, pageNumber: { current: i + 1, total: pages.length }, pageNumberPosition: pageNumberPosition, brand: brand && { ...brand, top: settings.showTopInfo, bottom: settings.showBottomInfo }, code: code, scoring: scoring, scoreIndexOffset: pageStart[i], marks: marksForTable, onMarkClick: handleMarkClick }, i))) })) : (_jsx("div", { className: "word-table-popup__table", children: _jsx(WordTable, { items: tableItems, orientation: settings.orientation, contentTypes: settings.contentTypes, baseItem: baseItem, baseContentTypes: baseContentTypes, cutLine: settings.cutLine, showOutline: settings.showOutline, showDivLine: settings.showDivLine, count: settings.count, contentRef: contentRef, fitHeight: true, scoring: scoring, marks: marksForTable, onMarkClick: handleMarkClick, brand: brand && { ...brand, top: settings.showTopInfo, bottom: settings.showBottomInfo }, code: code }) }))] })) : (_jsx("p", { className: "word-table-popup__empty body-3", children: emptyText ?? t('keyWords.empty', '추출된 주요 단어가 없습니다.') })), _jsx(Toast, { message: toastMsg, position: "top", onClose: handleToastClose }, toastKey)] }));
119
121
  }
@@ -24,7 +24,7 @@ export default function TableFilterPanel(props) {
24
24
  }
25
25
  const { hasImage, hasColloquial, hasCaption, contentTypes, orientation, showOutline, cutLine, showDivLine, setters, showCutLine = false, showDivLine2 = false, middleSections = [], extraSelected = {}, onExtraSelect, showPaperBands = false, showTopInfo = true, showBottomInfo = true, } = props;
26
26
  const sections = [
27
- buildCompositionSection(t, { hasImage, hasColloquial, hasCaption }),
27
+ buildCompositionSection(t, { hasImage, hasColloquial, hasCaption: hasCaption ?? false }),
28
28
  buildOrientationSection(t),
29
29
  ...middleSections,
30
30
  buildBorderSection(t),
@@ -167,3 +167,22 @@
167
167
  /* 부제가 두 줄이 될 때 — 알림(걸러지고 있다) 위, 선택 안내 아래로 쌓는다.
168
168
  Section 의 disc 는 한 줄을 전제하므로 여기서 블록으로 만든다. */
169
169
 
170
+
171
+ /* **머리 한 줄만 남은 꼴** — 접힌 `FilterPanel` 과 나란히 서는 자리라 높이를 맞춘다
172
+ (말귀 청 (341), 2026-10-28. 사장님 지시 *"filterpanel 접었을때와 동일한 높이로"*).
173
+
174
+ 접힌 판은 세로 여백이 0 이고 머리의 `min-height: 60px` 로 선다. 이 상자는 위아래로
175
+ `--spacing-l` 을 더 두므로 그대로면 더 높다(실측: 접힌 판 62px · 이 상자 88px).
176
+ **결과가 있을 때의 여백은 안 건드린다** — 그 여백은 사용자 지시로 맞춰 둔 것이고,
177
+ 여기서 바뀌는 것은 *머리뿐인 그때*의 세로 자뿐이다. */
178
+ .word-search-result-block__inner--head-only {
179
+ padding-top: 0;
180
+ padding-bottom: 0;
181
+ /* **틈도 0 이다.** 결과가 없어도 빈 `__items` 격자는 그대로 서는데(높이 0),
182
+ 상자가 세로 flex 라 **그 0짜리 칸과의 틈 16px 이 그대로 든다** — 여백만 0 으로 두고
183
+ 재니 78px 이었다(실측). 머리 하나뿐일 때는 틈이 설 자리가 없다. */
184
+ gap: 0;
185
+ }
186
+ .word-search-result-block__inner--head-only .word-search-result-block__head {
187
+ min-height: 60px;
188
+ }
@@ -40,6 +40,25 @@ export interface WordSearchResultBlockProps {
40
40
  * 왜 없는지를 말해 주는 자리다.
41
41
  */
42
42
  emptyHint?: ReactNode;
43
+ /**
44
+ * 결과가 0 일 때 **"검색 결과가 없습니다." 를 세울지** — 기본 참(말귀 청 (341), 2026-10-28,
45
+ * 사장님 지시 *"결과가 0이면 '검색 결과가 없습니다.' 제거하고 filterpanel 접었을때와 동일한
46
+ * 높이로"*).
47
+ *
48
+ * **0 에는 두 가지가 있다.**
49
+ *
50
+ * | | 보기 | 빈 말이 |
51
+ * |---|---|---|
52
+ * | **아직 안 찾았다** | 활용표에서 글자를 치기 전 | **군더더기** — 찾은 적이 없다 |
53
+ * | **찾았는데 없다** | `ㅋㅋㅋ` 를 친 뒤 | **쓸모 있다** — 왜 비었는지 말해 준다 |
54
+ *
55
+ * 코어는 `items.length === 0` 하나로 둘을 같게 본다. **부르는 쪽은 둘을 안다**(찾기를
56
+ * 돌렸는지 아닌지를 아니까). 그래서 통째로 없애지 않고 **끌 손잡이**만 둔다 — 찾기 전에만
57
+ * 끄면 된다. 끄면 그 자리가 통째로 빠져 머리 한 줄만 남는다.
58
+ *
59
+ * `emptyHint` 는 이것과 **따로 간다** — 끈 채로 힌트만 보일 일이 있다면 그 뜻대로 선다.
60
+ */
61
+ showEmptyText?: boolean;
43
62
  }
44
63
  /** @public */
45
- export default function WordSearchResultBlock({ titleIcon, resultCount, resultUnit, searchQuery, items, groups, selected, onSelect, maxSelect, onClearSelection, onPrint, onPrintEmpty, className, emptyHint, sectionType, disc, }: WordSearchResultBlockProps): import("react").JSX.Element;
64
+ export default function WordSearchResultBlock({ titleIcon, resultCount, resultUnit, searchQuery, items, groups, selected, onSelect, maxSelect, onClearSelection, onPrint, onPrintEmpty, className, emptyHint, showEmptyText, sectionType, disc, }: WordSearchResultBlockProps): import("react").JSX.Element;
@@ -16,7 +16,7 @@ import { useHoverAnchor } from '../../hooks/useHoverAnchor';
16
16
  import { makeWordQueryMatcher } from '../../utils/koreanSyllable';
17
17
  import { withIga, withEulReul } from '../../utils/josa';
18
18
  /** @public */
19
- export default function WordSearchResultBlock({ titleIcon, resultCount, resultUnit, searchQuery, items, groups, selected = [], onSelect, maxSelect, onClearSelection, onPrint, onPrintEmpty, className, emptyHint, sectionType = 'page', disc, }) {
19
+ export default function WordSearchResultBlock({ titleIcon, resultCount, resultUnit, searchQuery, items, groups, selected = [], onSelect, maxSelect, onClearSelection, onPrint, onPrintEmpty, className, emptyHint, showEmptyText = true, sectionType = 'page', disc, }) {
20
20
  const { t, i18n } = useTranslation();
21
21
  // 한국어에서만 조사(이/가·을/를)를 unit 말미에 붙인다 — 문구에는 조사를 고정하지 않는다.
22
22
  const ko = i18n.language?.startsWith('ko') ?? false;
@@ -174,6 +174,9 @@ export default function WordSearchResultBlock({ titleIcon, resultCount, resultUn
174
174
  그 알림을 **안 보이는 쪽**을 골랐다(위 지시). 다시 필요해지면 `disc` 가 아니라
175
175
  안내 줄 곁에 설 자리를 새로 내야 한다. */
176
176
  const discNode = disc ?? discLabel;
177
+ /* 상자 안에 **머리 한 줄만** 남는가 — 결과도 없고 빈 말도 안 세우는 그 꼴이다 */
178
+ const noResults = groups ? groups.length === 0 : items.length === 0;
179
+ const isHeadOnly = noResults && !showEmptyText && !emptyHint;
177
180
  return (
178
181
  /* 제목·부제·조작부가 **상자 안** 에 선다(사용자 지시 2026-09-29) — 전에는 `Section` 의 머리가
179
182
  상자 밖에 서서 제목이 테두리 위에 뜨고 좌우 여백도 옆의 `FilterPanel` 과 달라 보였다.
@@ -183,7 +186,7 @@ export default function WordSearchResultBlock({ titleIcon, resultCount, resultUn
183
186
  과 아주 같은 h4 로 맞췄는데, 그러니 결과 덩이의 머리가 그 위 판 제목들(`검색 옵션` ·
184
187
  `단어 검색 설정`)과 같은 급이 되어 **무엇이 무엇의 머리인지 안 보였다.** 거르개 판은
185
188
  결과를 고르는 도구고 이 덩이는 그 결과라, 나란한 것이 아니라 아래 딸린 것이다. */
186
- _jsxs(Section, { type: sectionType, className: cx('word-search-result-block', className), children: [_jsxs("div", { className: "word-search-result-block__inner", children: [(titleLabel || toolbar || discNode) && (_jsxs("div", { className: "word-search-result-block__head", children: [_jsxs("div", { className: "word-search-result-block__head-main", children: [titleIcon && _jsx(Icon, { icon: titleIcon, className: "word-search-result-block__head-icon" }), titleLabel && _jsx("span", { className: "word-search-result-block__title h3", children: titleLabel })] }), toolbar && _jsx("div", { className: "word-search-result-block__head-actions", children: toolbar }), discNode && _jsx("div", { className: "word-search-result-block__head-disc body-3", children: discNode })] })), (groups ? groups.length === 0 : items.length === 0) && (_jsxs("div", { className: "word-search-result-block__empty-wrap", children: [_jsx("p", { className: "word-search-result-block__empty body-3", children: t('wordSearch.emptyResult', '검색 결과가 없습니다.') }), emptyHint && _jsx("p", { className: "word-search-result-block__empty-hint body-3", children: emptyHint })] })), groups ? ((pagedGroups ?? []).map((group) => (
189
+ _jsxs(Section, { type: sectionType, className: cx('word-search-result-block', className), children: [_jsxs("div", { className: cx('word-search-result-block__inner', isHeadOnly && 'word-search-result-block__inner--head-only'), children: [(titleLabel || toolbar || discNode) && (_jsxs("div", { className: "word-search-result-block__head", children: [_jsxs("div", { className: "word-search-result-block__head-main", children: [titleIcon && _jsx(Icon, { icon: titleIcon, className: "word-search-result-block__head-icon" }), titleLabel && _jsx("span", { className: "word-search-result-block__title h3", children: titleLabel })] }), toolbar && _jsx("div", { className: "word-search-result-block__head-actions", children: toolbar }), discNode && _jsx("div", { className: "word-search-result-block__head-disc body-3", children: discNode })] })), noResults && (showEmptyText || emptyHint) && (_jsxs("div", { className: "word-search-result-block__empty-wrap", children: [showEmptyText && _jsx("p", { className: "word-search-result-block__empty body-3", children: t('wordSearch.emptyResult', '검색 결과가 없습니다.') }), emptyHint && _jsx("p", { className: "word-search-result-block__empty-hint body-3", children: emptyHint })] })), groups ? ((pagedGroups ?? []).map((group) => (
187
190
  /* **묶음 이름을 머리로 그린다**(말귀 청 (308), 2026-10-19).
188
191
  `pagedGroups` 가 `label` 을 들고 왔는데 **그리는 자리에서 안 썼다** — 받은 이름이
189
192
  `key` 로만 쓰이고 사라져, 보는 사람은 어느 자리가 갈린 쌍인지 모른 채 한 덩어리로
@@ -1,4 +1,4 @@
1
1
  import './WordTableBlock.css';
2
2
  import type { WordTableBlockProps } from './wordTableBlockTypes';
3
3
  export type { WordEntry, WordTableBlockProps } from './wordTableBlockTypes';
4
- export default function WordTableBlock({ title, titleIcon, disc, filterTitle, filterCollapsible, filterDefaultCollapsed, filterCollapsed, onFilterCollapsedChange, filterHeaderSummary, brand, code, baseItem, baseContentTypes, cellCapacity, maxItemsPerPage, items, onSaveComplete, onLoad, onRemoveItem, onReset, resetLabel, saveButtonLabel, secondarySaveButtonLabel, onReorder, showCellCount, onAddItem, className, renderSavePopup, renderWordSearch, hideControls, saveOnly, tableName, nameValue, onNameChange, descriptionValue, onDescriptionChange, namePlaceholder, descriptionPlaceholder, existingNames, editingName, onCancel, initialItemsPerPage, renderCellAction, actionsLeftExtra }: WordTableBlockProps): import("react").JSX.Element;
4
+ export default function WordTableBlock({ title, titleIcon, disc, filterTitle, filterCollapsible, filterDefaultCollapsed, filterCollapsed, onFilterCollapsedChange, filterHeaderSummary, brand, code, baseItem, baseContentTypes, cellCapacity, maxItemsPerPage, items, onSaveComplete, onLoad, onRemoveItem, onCopyItem, onReset, resetLabel, saveButtonLabel, secondarySaveButtonLabel, onReorder, showCellCount, onAddItem, className, renderSavePopup, renderWordSearch, hideControls, saveOnly, tableName, nameValue, onNameChange, descriptionValue, onDescriptionChange, namePlaceholder, descriptionPlaceholder, existingNames, editingName, onCancel, initialItemsPerPage, renderCellAction, actionsLeftExtra }: WordTableBlockProps): import("react").JSX.Element;
@@ -11,7 +11,7 @@ import Panel, { PanelRow } from '../Panel';
11
11
  import Popup from '../Popup/Popup';
12
12
  import WordTable, { WORD_TABLE_PAPER } from '../WordTable';
13
13
  import TableFilterPanel from './TableFilterPanel';
14
- import { buildItemsPerPageSection, buildPageNumberSection, parsePageNumberPosition, itemsPerPageFromChoice } from './wordTableSettings';
14
+ import { buildItemsPerPageSection, buildPageNumberSection, parsePageNumberPosition, itemsPerPageFromChoice, hasCaptionIn, DEFAULT_CONTENT_TYPES } from './wordTableSettings';
15
15
  import Toast from '../Toast';
16
16
  import { useToastState } from '../../hooks/useToastState';
17
17
  import { getImageResolver, checkImageExists } from '../../utils/imageConfig';
@@ -44,7 +44,7 @@ function withUniqueIds(list) {
44
44
  return id === it.id ? it : { ...it, id };
45
45
  });
46
46
  }
47
- export default function WordTableBlock({ title, titleIcon, disc, filterTitle, filterCollapsible, filterDefaultCollapsed, filterCollapsed, onFilterCollapsedChange, filterHeaderSummary, brand, code, baseItem, baseContentTypes, cellCapacity, maxItemsPerPage, items, onSaveComplete, onLoad, onRemoveItem, onReset, resetLabel, saveButtonLabel, secondarySaveButtonLabel, onReorder, showCellCount, onAddItem, className, renderSavePopup, renderWordSearch, hideControls, saveOnly, tableName, nameValue, onNameChange, descriptionValue, onDescriptionChange, namePlaceholder, descriptionPlaceholder, existingNames, editingName, onCancel, initialItemsPerPage, renderCellAction, actionsLeftExtra }) {
47
+ export default function WordTableBlock({ title, titleIcon, disc, filterTitle, filterCollapsible, filterDefaultCollapsed, filterCollapsed, onFilterCollapsedChange, filterHeaderSummary, brand, code, baseItem, baseContentTypes, cellCapacity, maxItemsPerPage, items, onSaveComplete, onLoad, onRemoveItem, onCopyItem, onReset, resetLabel, saveButtonLabel, secondarySaveButtonLabel, onReorder, showCellCount, onAddItem, className, renderSavePopup, renderWordSearch, hideControls, saveOnly, tableName, nameValue, onNameChange, descriptionValue, onDescriptionChange, namePlaceholder, descriptionPlaceholder, existingNames, editingName, onCancel, initialItemsPerPage, renderCellAction, actionsLeftExtra }) {
48
48
  const { t } = useTranslation();
49
49
  const resolvedResetLabel = resetLabel ?? t('wordPrint.clearAllSelection', '모두 선택 해제');
50
50
  const isEditable = items === undefined;
@@ -85,7 +85,7 @@ export default function WordTableBlock({ title, titleIcon, disc, filterTitle, fi
85
85
  const [orientation, setOrientation] = useState('landscape');
86
86
  /* `caption` 이 처음부터 켜져 있다 — 안 넣으면 (334) 가 들어오는 날 **지금까지 서던
87
87
  이름표가 통째로 사라진다**(`showOf` 는 빈 배열일 때만 다 켠다). 끄는 것은 사람이 한다. */
88
- const [contentTypes, setContentTypes] = useState(['image', 'word', 'caption', 'standardPron']);
88
+ const [contentTypes, setContentTypes] = useState([...DEFAULT_CONTENT_TYPES]);
89
89
  const [cutLine, setCutLine] = useState('show');
90
90
  const [showOutline, setShowOutline] = useState(true);
91
91
  const [showDivLine, setShowDivLine] = useState(true);
@@ -212,8 +212,7 @@ export default function WordTableBlock({ title, titleIcon, disc, filterTitle, fi
212
212
  /* 이름표를 쥔 칸이 하나라도 있나 — 없으면 '유형' 칩이 회색으로 선다(청 (334)).
213
213
  편집 격자에는 이름표를 담는 자리가 없다(`WordEntry` 에 없다) — 거기서는 늘 꺼진다.
214
214
  머리 칸도 센다 — 활용표의 머리 칸만 이름표를 쥐는 일이 있다(청 (329) 와 같은 결). */
215
- const hasCaption = !isEditable && [...(baseItem ? [baseItem] : []), ...(items ?? [])]
216
- .some(item => (item.words ?? []).some(w => !!w.captionBadge || !!w.captionLabel));
215
+ const hasCaption = !isEditable && hasCaptionIn([...(baseItem ? [baseItem] : []), ...(items ?? [])]);
217
216
  // 표에 실제로 이미지가 있는지 — resolver(word)는 존재 여부와 무관하게 항상 URL을 만들어 반환하므로
218
217
  // 그 truthiness만으로는 판정할 수 없다(항상 true가 되어 이미지 없는 표에서도 '이미지' 토글이
219
218
  // 활성화되는 문제가 있었다). checkImageExists로 실제 HEAD 요청(+캐시) 확인을 거친다.
@@ -382,7 +381,7 @@ export default function WordTableBlock({ title, titleIcon, disc, filterTitle, fi
382
381
  }), !hideControls && (_jsx(TableFilterPanel, { title: filterTitle, collapsible: filterCollapsible, defaultCollapsed: filterDefaultCollapsed, collapsed: filterCollapsed, onCollapsedChange: onFilterCollapsedChange, headerSummary: filterHeaderSummary, hasImage: hasImage, hasColloquial: hasColloquial, hasCaption: hasCaption, contentTypes: contentTypes, orientation: orientation, showOutline: showOutline, cutLine: cutLine, showDivLine: showDivLine, setters: { setContentTypes, setOrientation, setShowOutline, setCutLine, setShowDivLine, setShowTopInfo, setShowBottomInfo }, showCutLine: (pagesEnabled ? itemsPerPage : count) > 1, showDivLine2: hasPairs, middleSections: middleSections, extraSelected: middleSelected, onExtraSelect: handleMiddleSelect, showPaperBands: showBand, showTopInfo: showTopInfo, showBottomInfo: showBottomInfo })), isPaginated && pages ? (_jsx("div", { className: "word-table-block__pages", children: pages.map((page, i) => (_jsx(WordTable, { orientation: orientation, contentTypes: contentTypes, cutLine: cutLine, showOutline: showOutline, showDivLine: showDivLine, count: itemsPerPage, items: page,
383
382
  /* 쪽마다 머리 칸이 선다 — 한 장만 들고 보는 종이에 머리 낱말이 없으면
384
383
  나머지 칸이 무엇의 활용인지 알 수 없다 */
385
- baseItem: baseItem, baseContentTypes: baseContentTypes, onRemoveItem: onRemoveItem,
384
+ baseItem: baseItem, baseContentTypes: baseContentTypes, onRemoveItem: onRemoveItem, onCopyItem: onCopyItem,
386
385
  /* 쪽이 나뉘면 끌어 옮기기가 통째로 꺼졌다(말귀 단어 찾기: 9개부터). 쪽 안의 자리를 전체 자리로 옮겨 넘긴다 —
387
386
  쪽을 넘는 이동은 하지 않는다. */
388
387
  onReorder: onReorder && ((from, to) => onReorder(from + i * itemsPerPage, to + i * itemsPerPage)),
@@ -399,7 +398,9 @@ export default function WordTableBlock({ title, titleIcon, disc, filterTitle, fi
399
398
  showFillerAdd: !!onAddItem, onActivateCell: onAddItem ? (n => setActiveCell(n + i * itemsPerPage)) : undefined,
400
399
  /* 칸 크기가 쪽마다 같아야 해서 `count` 는 모든 쪽이 '페이지당 개수' 다 —
401
400
  채울 자리는 마지막 쪽에서 모자랄 수 있으니 그것만 따로 센다. */
402
- addableCount: Math.max(0, Math.min(itemsPerPage, capacity - i * itemsPerPage)), brand: band, code: code, contentRef: el => { pageRefs.current[i] = el; }, pageNumber: { current: i + 1, total: pages.length }, pageNumberPosition: pageNumberPosition }, i))) })) : (_jsx(WordTable, { orientation: orientation, contentTypes: contentTypes, cutLine: cutLine, showOutline: showOutline, showDivLine: showDivLine, count: count, items: isEditable ? undefined : (items ?? []), baseItem: isEditable ? undefined : baseItem, baseContentTypes: baseContentTypes, editCells: isEditable ? visibleCells : undefined, activeCell: activeCell, onActivateCell: (isEditable || onAddItem) ? setActiveCell : undefined, onRemoveCell: isEditable ? handleRemove : undefined, onRemoveItem: !isEditable ? onRemoveItem : undefined, onReorder: !isEditable ? onReorder : undefined,
401
+ addableCount: Math.max(0, Math.min(itemsPerPage, capacity - i * itemsPerPage)), brand: band, code: code, contentRef: el => { pageRefs.current[i] = el; }, pageNumber: { current: i + 1, total: pages.length }, pageNumberPosition: pageNumberPosition }, i))) })) : (_jsx(WordTable, { orientation: orientation, contentTypes: contentTypes, cutLine: cutLine, showOutline: showOutline, showDivLine: showDivLine, count: count, items: isEditable ? undefined : (items ?? []), baseItem: isEditable ? undefined : baseItem, baseContentTypes: baseContentTypes, editCells: isEditable ? visibleCells : undefined, activeCell: activeCell, onActivateCell: (isEditable || onAddItem) ? setActiveCell : undefined, onRemoveCell: isEditable ? handleRemove : undefined, onRemoveItem: !isEditable ? onRemoveItem : undefined,
402
+ /* 편집 격자에는 '한 칸 더' 가 뜻이 없다 — 거기선 칸을 손으로 채운다 */
403
+ onCopyItem: !isEditable ? onCopyItem : undefined, onReorder: !isEditable ? onReorder : undefined,
403
404
  /* 편집 모드에는 얹을 항목이 없다 — 칸을 손으로 채우는 꼴이다 */
404
405
  renderCellAction: !isEditable ? renderCellAction : undefined, brand: band, code: code, showFillerAdd: !!onAddItem, contentRef: contentRef })), !hideControls && !saveOnly && actionsLeftExtra != null && (_jsx("div", { className: "word-table-block__table-actions", children: actionsLeftExtra })), inlineNameFields && !hideControls && (_jsxs(Panel, { size: "medium", labelWidth: 64, useBorder: false, useRowBorder: false, className: "word-table-block__meta", children: [_jsx(PanelRow, { variant: "custom", label: t('wordTable.save.nameLabel', '이름'), required: true, align: "vertical", useFullWidth: true, children: _jsx(TextField, { required: true, value: nameValue ?? '', onChange: onNameChange, placeholder: namePlaceholder ? namePlaceholder + t('wordTable.save.autoFillHint', ' (Tab 또는 space 입력시 자동 입력)') : t('wordTable.save.placeholder', '이 단어표에 대한 제목을 입력하세요.'),
405
406
  /* PanelRow의 라벨은 시각적으로만 붙어 있고 입력과 연결돼 있지 않아, 낭독기에는
@@ -41,4 +41,12 @@ export declare function useWordTableDisplaySettings(items: WordSearchResultItem[
41
41
  * 안 쓰는 화면에 켜고 끌 것이 없는 절이 서면 안 되므로 기본은 거짓이다. */
42
42
  opts?: {
43
43
  paperBands?: boolean;
44
+ /**
45
+ * 한 쪽에 설 수 있는 **최대 칸 수** — 칸 수와는 다른 것이다(말귀 청 (333)·(340)).
46
+ *
47
+ * 활용표의 칸 수는 낱말이 정해서 서른여섯까지 가는데, 종이 한 장에 열둘보다 많으면
48
+ * 글자가 작아져 못 읽는다. `WordTableBlock` 에는 (333) 으로 들어갔고 **이 길에는
49
+ * 빠져 있었다** — 저장된 표를 열면 쪽당 첫 칸이 '13개'(칸 수 전부)로 섰다.
50
+ */
51
+ maxItemsPerPage?: number;
44
52
  }): UseWordTableDisplaySettingsResult;
@@ -3,7 +3,7 @@ import { useMemo, useState, useCallback, useEffect } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { chunkItems } from '../wordTableLayout';
5
5
  import { getImageResolver, checkImageExists } from '../../utils/imageConfig';
6
- import { buildCompositionSection, buildOrientationSection, buildBorderSection, buildCutLineSection, buildDivLineSection, buildTopInfoSection, buildBottomInfoSection, buildItemsPerPageSection, buildTableSettingsSelected, applyTableSettingsSelect, parsePageNumberPosition, itemsPerPageFromChoice, } from './wordTableSettings';
6
+ import { buildCompositionSection, buildOrientationSection, buildBorderSection, buildCutLineSection, buildDivLineSection, buildTopInfoSection, buildBottomInfoSection, buildItemsPerPageSection, buildTableSettingsSelected, applyTableSettingsSelect, hasCaptionIn, DEFAULT_CONTENT_TYPES, parsePageNumberPosition, itemsPerPageFromChoice, } from './wordTableSettings';
7
7
  /**
8
8
  * 표시 전용 단어표(편집 없음)의 '표 설정' FilterPanel 상태·섹션을 제공하는 훅.
9
9
  * 구성·용지 방향·외곽선, 내용이 있으면 페이지당 개수, 2페이지 이상이면 페이지 번호, 항목이 2개 이상이면
@@ -17,8 +17,9 @@ export function useWordTableDisplaySettings(items,
17
17
  opts) {
18
18
  const { t } = useTranslation();
19
19
  const showBands = opts?.paperBands === true;
20
+ const maxItemsPerPage = opts?.maxItemsPerPage;
20
21
  const [orientation, setOrientation] = useState('landscape');
21
- const [contentTypes, setContentTypes] = useState(['image', 'word', 'standardPron']);
22
+ const [contentTypes, setContentTypes] = useState([...DEFAULT_CONTENT_TYPES]);
22
23
  const [cutLine, setCutLine] = useState('show');
23
24
  const [showOutline, setShowOutline] = useState(true);
24
25
  /* 종이 머리·바닥 띠 — 기본은 켬(브랜드가 찍힌 종이가 기본값이다) */
@@ -31,8 +32,15 @@ opts) {
31
32
  // 저장소에서 온 항목에 words 가 빠져 있을 수 있다({ id }) — 빈 낱말로 본다
32
33
  const hasPairs = items.some(item => (item.words ?? []).length > 1);
33
34
  const hasColloquial = items.some(item => (item.words ?? []).some(w => !!w.colloquialLabel));
35
+ /* 이름표를 쥔 칸이 하나라도 있나 — **이 훅이 안 세고 있었다**(말귀 청 (339), 2026-10-28).
36
+ 저장된 표는 이 길로 그려지는데 `hasCaption` 을 안 넘겨 `유형` 칩이 늘 잠겼고, 이름표를
37
+ 쥔 칸이 열세이던 표에서도 종이에 이름표가 안 찍혔다. 셈은 `hasCaptionIn` 한 자리다.
38
+ 이 훅에는 머리 칸이 없으므로 `items` 만 센다. */
39
+ const hasCaption = hasCaptionIn(items);
34
40
  // 페이지 분할 — 페이지당 개수(기본 8, 실제 개수보다 크면 전체로 클램프)로 나눈다. 항목이 없으면 1칸짜리 빈 표.
35
- const effectiveItemsPerPage = Math.min(itemsPerPageSetting, Math.max(itemCount, 1));
41
+ /* 천장이 있으면 거기서 멎는다 — 칸 수와 **한 쪽에 서는 수**는 다른 것이다(청 (333)) */
42
+ const perPageCeiling = Math.max(1, Math.min(Math.max(itemCount, 1), maxItemsPerPage ?? Math.max(itemCount, 1)));
43
+ const effectiveItemsPerPage = Math.min(itemsPerPageSetting, perPageCeiling);
36
44
  const pages = useMemo(() => chunkItems(items, effectiveItemsPerPage), [items, effectiveItemsPerPage]);
37
45
  const isPaginated = pages.length > 1;
38
46
  // 표 렌더의 칸 수 = 페이지당 개수(마지막 페이지가 적어도 그리드 칸 수는 통일).
@@ -57,10 +65,10 @@ opts) {
57
65
  // 기본 5개 섹션은 공용 빌더(wordTableSettings)로 조립 — WordTableBlock과 문구·항목이 어긋나지 않는다.
58
66
  // 편집(칸 수)은 표시 전용이라 제외하고, 페이지당 개수·페이지 번호는 WordTableBlock 표시 모드와 동일하게 포함한다.
59
67
  const filterSections = useMemo(() => [
60
- buildCompositionSection(t, { hasImage, hasColloquial }),
68
+ buildCompositionSection(t, { hasImage, hasColloquial, hasCaption }),
61
69
  buildOrientationSection(t),
62
70
  // 내용이 있는(1개 이상) 표면 페이지당 개수를 항상 노출.
63
- ...(itemCount > 0 ? [buildItemsPerPageSection(t, { hasPairs, itemCount })] : []),
71
+ ...(itemCount > 0 ? [buildItemsPerPageSection(t, { hasPairs, itemCount, max: maxItemsPerPage })] : []),
64
72
  /* **'페이지 번호' 자리 고르개는 없앤다** — 띠를 쓰든 안 쓰든 아예 안 세운다.
65
73
  사용자 지시다(2026-09-30). `pageNumberPosition` 프롭은 남아 있어 부르는 쪽이 코드로
66
74
  자리를 정할 수는 있고, 다만 화면에서 고르게 하지 않는다.
@@ -73,7 +81,7 @@ opts) {
73
81
  ...(hasPairs ? [buildDivLineSection(t)] : []),
74
82
  /* 띠를 쓰는 화면에서만 — 안 쓰는 표에 켜고 끌 것이 없는 절이 서면 안 된다 */
75
83
  ...(showBands ? [buildTopInfoSection(t), buildBottomInfoSection(t)] : []),
76
- ], [t, hasImage, hasColloquial, itemCount, hasPairs, isPaginated, count, showBands]);
84
+ ], [t, hasImage, hasColloquial, hasCaption, itemCount, hasPairs, isPaginated, count, showBands, maxItemsPerPage]);
77
85
  const filterSelected = {
78
86
  ...buildTableSettingsSelected(t, { contentTypes, orientation, showOutline, cutLine, showDivLine, showTopInfo, showBottomInfo }),
79
87
  ...(itemCount > 0 ? { [t(hasPairs ? 'wordTable.filter.itemsPerPagePair' : 'wordTable.filter.itemsPerPageWord')]: `${effectiveItemsPerPage}개` } : {}),
@@ -116,6 +116,8 @@ export interface WordTableBlockProps {
116
116
  onSaveComplete?: (name: string, items: WordSearchResultItem[], description?: string, saveAsNew?: boolean) => void;
117
117
  onLoad?: () => void;
118
118
  onRemoveItem?: (id: string) => void;
119
+ /** 주면 칸에 **복사 단추**가 선다 — 그 낱말을 한 칸 더 만든다. 꼴은 코어가 빼기·옮기기와 같게 짓는다. */
120
+ onCopyItem?: (id: string, index: number) => void;
119
121
  /** 전달하면 액션 영역 왼쪽에 초기화 버튼 표시 */
120
122
  onReset?: () => void;
121
123
  resetLabel?: string;
@@ -1,10 +1,39 @@
1
1
  import type { TFunction } from 'i18next';
2
2
  import { type FilterPanelSection } from '../FilterPanel';
3
3
  import type { WordTableOrientation, WordTableContentType, WordTableCutLine, PageNumberPosition } from '../WordTable';
4
+ /**
5
+ * **표를 처음 열 때 켜져 있는 구성** — 두 길이 같은 것을 쓴다(말귀 청 (339), 2026-10-28).
6
+ *
7
+ * 청 (334) 로 `caption`(이름표)을 넣을 때 `WordTableBlock` 의 처음 값에만 넣었고, 저장된
8
+ * 표를 그리는 `useWordTableDisplaySettings` 는 그대로였다. 그래서 칩이 켜져도 **처음에는
9
+ * 이름표가 안 찍혔다** — 사람이 칩을 한 번 눌러야 나왔다. 처음 값을 두 자리에 적으면
10
+ * 한 자리가 조용히 뒤처진다.
11
+ *
12
+ * 이름표가 없는 표에 `caption` 이 들어 있어도 해롭지 않다 — 그릴 것이 없으면 안 그리고,
13
+ * 칩은 `hasCaption` 이 꺼 둔다.
14
+ */
15
+ export declare const DEFAULT_CONTENT_TYPES: readonly WordTableContentType[];
16
+ /**
17
+ * **이름표를 쥔 칸이 하나라도 있나** — `유형` 칩을 켤지 가른다(청 (334)).
18
+ *
19
+ * **셈을 한 자리에 둔다**(말귀 청 (339), 2026-10-28). 전에는 `WordTableBlock` 안에만
20
+ * 있었고, 저장된 표를 그리는 **둘째 길**(`useWordTableDisplaySettings`)은 그 셈을 아예 안
21
+ * 했다 — `hasCaption` 이 `undefined` 로 가서 칩이 **늘 잠겼다.** 자료는 다 왔는데 그리라는
22
+ * 말이 안 간 꼴이다(말귀 실측: 열세 칸 전부 `captionBadge` 를 쥐었는데 `showCaption: false`).
23
+ * 같은 물음을 두 자리에서 따로 세면 한 자리가 조용히 틀린다.
24
+ *
25
+ * 머리 칸도 함께 넘긴다 — 활용표의 머리 칸만 이름표를 쥐는 일이 있다(청 (329) 와 같은 결).
26
+ */
27
+ export declare function hasCaptionIn(items: readonly {
28
+ words?: readonly {
29
+ captionBadge?: string;
30
+ captionLabel?: string;
31
+ }[];
32
+ }[]): boolean;
4
33
  export declare function buildCompositionSection(t: TFunction, opts: {
5
34
  hasImage: boolean;
6
35
  hasColloquial: boolean;
7
- hasCaption?: boolean;
36
+ hasCaption: boolean;
8
37
  }): FilterPanelSection;
9
38
  /** @public 용지 방향(가로/세로) 세그먼트 섹션. */
10
39
  export declare function buildOrientationSection(t: TFunction): FilterPanelSection;
@@ -15,7 +15,37 @@ import { ITEMS_PER_PAGE_OPTIONS } from './wordTableBlockTypes';
15
15
  */
16
16
  const SHOW = 'show';
17
17
  const HIDE = 'hide';
18
- export function buildCompositionSection(t, opts) {
18
+ /**
19
+ * **표를 처음 열 때 켜져 있는 구성** — 두 길이 같은 것을 쓴다(말귀 청 (339), 2026-10-28).
20
+ *
21
+ * 청 (334) 로 `caption`(이름표)을 넣을 때 `WordTableBlock` 의 처음 값에만 넣었고, 저장된
22
+ * 표를 그리는 `useWordTableDisplaySettings` 는 그대로였다. 그래서 칩이 켜져도 **처음에는
23
+ * 이름표가 안 찍혔다** — 사람이 칩을 한 번 눌러야 나왔다. 처음 값을 두 자리에 적으면
24
+ * 한 자리가 조용히 뒤처진다.
25
+ *
26
+ * 이름표가 없는 표에 `caption` 이 들어 있어도 해롭지 않다 — 그릴 것이 없으면 안 그리고,
27
+ * 칩은 `hasCaption` 이 꺼 둔다.
28
+ */
29
+ export const DEFAULT_CONTENT_TYPES = ['image', 'word', 'caption', 'standardPron'];
30
+ /**
31
+ * **이름표를 쥔 칸이 하나라도 있나** — `유형` 칩을 켤지 가른다(청 (334)).
32
+ *
33
+ * **셈을 한 자리에 둔다**(말귀 청 (339), 2026-10-28). 전에는 `WordTableBlock` 안에만
34
+ * 있었고, 저장된 표를 그리는 **둘째 길**(`useWordTableDisplaySettings`)은 그 셈을 아예 안
35
+ * 했다 — `hasCaption` 이 `undefined` 로 가서 칩이 **늘 잠겼다.** 자료는 다 왔는데 그리라는
36
+ * 말이 안 간 꼴이다(말귀 실측: 열세 칸 전부 `captionBadge` 를 쥐었는데 `showCaption: false`).
37
+ * 같은 물음을 두 자리에서 따로 세면 한 자리가 조용히 틀린다.
38
+ *
39
+ * 머리 칸도 함께 넘긴다 — 활용표의 머리 칸만 이름표를 쥐는 일이 있다(청 (329) 와 같은 결).
40
+ */
41
+ export function hasCaptionIn(items) {
42
+ return items.some(item => (item.words ?? []).some(w => !!w.captionBadge || !!w.captionLabel));
43
+ }
44
+ export function buildCompositionSection(
45
+ /* `hasCaption` 은 **없어도 되는 것이 아니다.** 안 주면 칩이 잠기는데 화면에는 아무 표시도
46
+ 안 나므로, 빠뜨린 자리를 **tsc 가 잡게** 못 박아 둔다(청 (339) 가 바로 그 자리였다).
47
+ 이름표가 없는 표는 `false` 를 **적어서** 준다 — 빠뜨린 것과 없다고 말한 것이 갈린다. */
48
+ t, opts) {
19
49
  return {
20
50
  label: t('wordTable.filter.composition', '구성'),
21
51
  items: [
@@ -49,6 +49,16 @@ export interface WordTableProps {
49
49
  * 초점을 두고 `Alt`+`←`/`→`, 그리고 **길게 눌러**(400ms) 손가락으로 끌기.
50
50
  * 키보드로 옮기면 초점이 그 칸을 따라가고 바뀐 자리를 `role="status"` 로 알린다.
51
51
  */
52
+ /**
53
+ * 칸을 **한 칸 더** 만든다 — 주면 칸의 오른쪽 기둥에 복사 단추가 선다(사용자 지시 2026-10-28).
54
+ *
55
+ * **코어가 그린다.** 전에는 부르는 쪽이 `renderCellAction` 으로 제 단추를 얹었는데, 그러면
56
+ * 같은 자리에 선 단추인데 **꼴이 저마다**가 된다 — `useBorder` 가 기본 `true` 라 안 적은
57
+ * 쪽만 테두리가 생겨 칸 위에서 혼자 튀었다(사장님이 화면에서 짚으셨다. 2026-09-27 에도
58
+ * 같은 것을 이르셨다: *"다른 단어로 버튼만 다르네? 베리언트 동일하게"*).
59
+ * 여기서 그리면 빼기·옮기기와 **같은 꼴로 지어진다** — 맞출 것이 없다.
60
+ */
61
+ onCopyItem?: (id: string, index: number) => void;
52
62
  onReorder?: (fromIndex: number, toIndex: number) => void;
53
63
  /**
54
64
  * 이 표의 첫 칸이 **전체 목록에서 몇 번째**인가 — 쪽으로 나뉜 표에서 `WordTableBlock` 이 준다
@@ -227,4 +237,4 @@ export interface WordTableProps {
227
237
  * 표시(items)·편집(editCells) 두 모드를 지원한다.
228
238
  * @public
229
239
  */
230
- export default function WordTable({ title, titleIcon, disc, className, orientation, contentTypes, baseItem, baseContentTypes, cutLine, showOutline, showDivLine, items, editCells, count, activeCell, onActivateCell, onRemoveCell, onRemoveItem, onReorder, indexOffset, totalCount, renderCellAction, showFillerAdd, addableCount, contentRef, buttonSize, brand, code, pageNumber, pageNumberPosition, fitHeight, scoring, marks, onMarkClick, scoreIndexOffset, }: WordTableProps): import("react").JSX.Element;
240
+ export default function WordTable({ title, titleIcon, disc, className, orientation, contentTypes, baseItem, baseContentTypes, cutLine, showOutline, showDivLine, items, editCells, count, activeCell, onActivateCell, onRemoveCell, onRemoveItem, onReorder, onCopyItem, indexOffset, totalCount, renderCellAction, showFillerAdd, addableCount, contentRef, buttonSize, brand, code, pageNumber, pageNumberPosition, fitHeight, scoring, marks, onMarkClick, scoreIndexOffset, }: WordTableProps): import("react").JSX.Element;