@ihabdevteam/core 0.380.0 → 0.383.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 (31) hide show
  1. package/CHANGELOG.md +177 -1
  2. package/dist/components.cjs.js +169 -169
  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 +174 -174
  7. package/dist/ihabdevteam-core.d.ts +27 -3
  8. package/dist/packages/core/src/components/Table.d.ts +7 -0
  9. package/dist/packages/core/src/components/Table.js +20 -9
  10. package/dist/packages/core/src/components/Word/TableFilterPanel.d.ts +2 -0
  11. package/dist/packages/core/src/components/Word/TableFilterPanel.js +2 -2
  12. package/dist/packages/core/src/components/Word/WordTableBlock.d.ts +1 -1
  13. package/dist/packages/core/src/components/Word/WordTableBlock.js +43 -9
  14. package/dist/packages/core/src/components/Word/wordTableBlockTypes.d.ts +15 -0
  15. package/dist/packages/core/src/components/Word/wordTableSettings.d.ts +23 -5
  16. package/dist/packages/core/src/components/Word/wordTableSettings.js +29 -7
  17. package/dist/packages/core/src/components/WordTable.css +33 -8
  18. package/dist/packages/core/src/components/WordTable.js +44 -6
  19. package/dist/packages/core/src/components/tableSpanMeasure.d.ts +48 -0
  20. package/dist/packages/core/src/components/tableSpanMeasure.js +74 -0
  21. package/dist/packages/core/src/components/wordTableLayout.d.ts +1 -1
  22. package/dist/packages/core/src/i18n/locales/en.json +1 -0
  23. package/dist/packages/core/src/i18n/locales/ko.json +1 -0
  24. package/dist/packages/core/src/utils/headProbeStatus.d.ts +21 -0
  25. package/dist/packages/core/src/utils/headProbeStatus.js +23 -0
  26. package/dist/packages/core/src/utils/imageConfig.js +3 -2
  27. package/dist/packages/core/src/utils/ttsConfig.js +3 -2
  28. package/dist/packages/core/src/version.d.ts +1 -1
  29. package/dist/packages/core/src/version.js +1 -1
  30. package/dist/utils.cjs.js +160 -160
  31. 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.380.0";
1790
+ export declare const CORE_VERSION = "0.383.0";
1791
1791
 
1792
1792
  /** @public */
1793
1793
  declare const coreDefault: Record<string, unknown>;
@@ -7921,6 +7921,8 @@ declare interface TableFilterPanelShellProps extends TableFilterPanelBaseProps {
7921
7921
  declare interface TableFilterPanelSmartProps extends TableFilterPanelBaseProps {
7922
7922
  hasImage: boolean;
7923
7923
  hasColloquial: boolean;
7924
+ /** 이름표를 쥔 칸이 하나라도 있나 — '유형' 칩을 켤지 가른다(청 (334)) */
7925
+ hasCaption?: boolean;
7924
7926
  contentTypes: WordTableContentType[];
7925
7927
  orientation: WordTableOrientation;
7926
7928
  showOutline: boolean;
@@ -8013,11 +8015,18 @@ export declare type TableProps<T extends {
8013
8015
  *
8014
8016
  * 안 주면 전과 같다 — 줄이 `tabIndex` 와 설명으로만 눌린다((가) 그대로).
8015
8017
  */
8018
+ /**
8019
+ * 줄 하나를 칸들로. `span` 을 주면 그 칸이 **여러 열을 덮는다**(말귀 청 (215), 2026-10-28) —
8020
+ * 코어가 `grid-column: span N` 과 `aria-colspan` 을 붙이고, **'칸 너비 초기화' 가 재는
8021
+ * 자리도 그 수를 센다.** `style` 에 `gridColumn` 을 손으로 적어도 격자는 서지만 재는 쪽이
8022
+ * 모르므로, 덮는 칸은 `span` 으로 알려 줘야 한다.
8023
+ */
8016
8024
  renderRow: (item: T) => Array<{
8017
8025
  content: ReactNode;
8018
8026
  className?: string;
8019
8027
  style?: CSSProperties;
8020
8028
  rowLabel?: string;
8029
+ span?: number;
8021
8030
  }>;
8022
8031
  onRowClick?: (item: T) => void;
8023
8032
  /**
@@ -11523,7 +11532,7 @@ export declare interface WordSearchResultWord {
11523
11532
  */
11524
11533
  export declare function WordTable({ title, titleIcon, disc, className, orientation, contentTypes, baseItem, baseContentTypes, cutLine, showOutline, showDivLine, items, editCells, count, activeCell, onActivateCell, onRemoveCell, onRemoveItem, onReorder, renderCellAction, showFillerAdd, addableCount, contentRef, buttonSize, brand, code, pageNumber, pageNumberPosition, fitHeight, scoring, marks, onMarkClick, scoreIndexOffset, }: WordTableProps): JSX.Element;
11525
11534
 
11526
- export declare function WordTableBlock({ title, titleIcon, disc, filterTitle, filterCollapsible, filterDefaultCollapsed, filterCollapsed, onFilterCollapsedChange, filterHeaderSummary, brand, code, baseItem, baseContentTypes, cellCapacity, 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;
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;
11527
11536
 
11528
11537
  /** @public */
11529
11538
  export declare interface WordTableBlockProps {
@@ -11601,6 +11610,21 @@ export declare interface WordTableBlockProps {
11601
11610
  * 그쪽이 이긴다(사람이 고른 것이 마지막 말이다).
11602
11611
  */
11603
11612
  cellCapacity?: number;
11613
+ /**
11614
+ * **한 쪽에 설 수 있는 가장 많은 수** — '페이지당 개수' 고르개의 첫 칸이 여기서 멎는다.
11615
+ *
11616
+ * 사장님 지시(2026-10-28) *"단어 수 최대와 페이지당 단어 수 최대가 다른거야"* ·
11617
+ * *"단어는 20개더라도 페이지당 표현은 12로 선택할 수 있도록 해야지"*(말귀 청 (333)).
11618
+ * 활용표의 **칸 수는 낱말이 정하고**(동사 36 · 형용사 21), 종이 한 장에 열둘보다 많으면
11619
+ * 글자가 작아져 못 읽는다 — 그래서 둘이 다른 수다.
11620
+ *
11621
+ * 안 주면 지금까지대로 칸 수가 첫 칸이다. 칸 수보다 크면 무시한다(없는 자리를 고를 수 없다).
11622
+ *
11623
+ * **이것은 `cellCapacity` 와 다르다** — `cellCapacity` 는 *표가 몇 칸인가*, 이것은 *그
11624
+ * 칸들이 한 쪽에 몇씩 서는가* 다. 스무 칸짜리 표에 `maxItemsPerPage={12}` 면 칸은 스물
11625
+ * 그대로고 쪽이 둘로 나뉜다.
11626
+ */
11627
+ maxItemsPerPage?: number;
11604
11628
  disc?: ReactNode;
11605
11629
  /** 현재 표의 저장된 이름(불러온 표 등). 있으면 인쇄/PDF 저장 시 파일명으로 사용, 없으면 "오늘 날짜 + 단어표/대립쌍표" */
11606
11630
  tableName?: string;
@@ -11789,7 +11813,7 @@ export declare interface WordTableButtonProps {
11789
11813
  *
11790
11814
  * @public
11791
11815
  */
11792
- export declare type WordTableContentType = 'word' | 'image' | 'standardPron' | 'colloquialPron';
11816
+ export declare type WordTableContentType = 'word' | 'image' | 'standardPron' | 'colloquialPron' | 'caption';
11793
11817
 
11794
11818
  /** 칸 사이 선 — **코드다.** 보일 글은 사전(`wordTable.filter.show`·`.dotted`·`.corner`·`.hide`). @public */
11795
11819
  export declare type WordTableCutLine = 'show' | 'dashed' | 'corner' | 'hide';
@@ -127,11 +127,18 @@ export type TableProps<T extends {
127
127
  *
128
128
  * 안 주면 전과 같다 — 줄이 `tabIndex` 와 설명으로만 눌린다((가) 그대로).
129
129
  */
130
+ /**
131
+ * 줄 하나를 칸들로. `span` 을 주면 그 칸이 **여러 열을 덮는다**(말귀 청 (215), 2026-10-28) —
132
+ * 코어가 `grid-column: span N` 과 `aria-colspan` 을 붙이고, **'칸 너비 초기화' 가 재는
133
+ * 자리도 그 수를 센다.** `style` 에 `gridColumn` 을 손으로 적어도 격자는 서지만 재는 쪽이
134
+ * 모르므로, 덮는 칸은 `span` 으로 알려 줘야 한다.
135
+ */
130
136
  renderRow: (item: T) => Array<{
131
137
  content: ReactNode;
132
138
  className?: string;
133
139
  style?: CSSProperties;
134
140
  rowLabel?: string;
141
+ span?: number;
135
142
  }>;
136
143
  onRowClick?: (item: T) => void;
137
144
  /**
@@ -12,6 +12,7 @@ import { compareCellBlankLast } from '../utils/textSort';
12
12
  import { useTranslation } from 'react-i18next';
13
13
  import './Table.css';
14
14
  import './TableCell.css';
15
+ import { widestPerColumn, spanFromGridStyle } from './tableSpanMeasure';
15
16
  import './TableField.css';
16
17
  import { useState, useRef, useCallback, useEffect, useId, useMemo } from 'react';
17
18
  import ChevronUp from 'lucide-react/dist/esm/icons/chevron-up.mjs';
@@ -23,8 +24,14 @@ import useMediaQuery from '../hooks/useMediaQuery';
23
24
  /* 칸 하나 — `role="cell"` 이라야 낭독기가 **낱낱으로** 읽는다(말귀 요청 (56), 2026-10-02).
24
25
  역할이 없던 때는 줄 전체가 한 덩어리 글로 읽혀 `홍길동 010-1234-5678 2026-09-30 활성`
25
26
  이 한 호흡에 나갔다 — 어디까지가 이름이고 어디부터 전화인지 소리로는 알 수 없었다. */
26
- function TableCell({ children, className, style, rowLabel, onRowClick }) {
27
- return (_jsx("div", { role: "cell", className: className ? `table-cell ${className}` : 'table-cell', style: style, children: rowLabel && onRowClick
27
+ function TableCell({ children, className, style, span, rowLabel, onRowClick }) {
28
+ /* 부르는 쪽이 `style` 에 적은 `gridColumn` 은 그대로 둔다 — `span` 을 줬을 때만 코어가 짓는다.
29
+ 둘 다 주면 부르는 쪽 것이 이긴다(뒤에 놓인다): 격자는 그쪽 뜻대로 서고, 재는 자리는
30
+ `span` 을 보니 둘이 어긋나면 그것은 부르는 쪽이 고를 일이다. */
31
+ const cellStyle = span && span > 1
32
+ ? { gridColumn: `span ${span}`, ...style }
33
+ : style;
34
+ return (_jsx("div", { role: "cell", className: className ? `table-cell ${className}` : 'table-cell', style: cellStyle, "aria-colspan": span && span > 1 ? span : undefined, children: rowLabel && onRowClick
28
35
  /* **진짜 `<button>` 이라 Enter·Space 는 브라우저가 처리한다** — 손으로 키를 붙이지
29
36
  않는다(`TableField` 의 머리 단추와 같은 본). 클릭은 줄로 올라가 `onRowClick` 이
30
37
  한 번 불린다. 겉모양은 CSS 가 지운다(`.table-cell__row-button`). */
@@ -527,13 +534,17 @@ export default function Table({ fields: rawFields = [], sort: sortBinding, sorta
527
534
  이때는 열이 어긋나 보이지만, 같은 함수 안에서 되돌리므로 화면에는 안 나온다. */
528
535
  const rows = Array.from(wrap.querySelectorAll('.table-row'))
529
536
  .filter(r => !r.classList.contains('table-row--loading') && !r.classList.contains('table-row--empty'));
537
+ /* **열마다 가장 넓은 값** — 자식 번호가 아니라 **격자 번호**로 센다(말귀 청 (215)).
538
+ 규칙은 `tableSpanMeasure.ts` 가 든다(그 머리말에 까닭과 실측이 있다). 여기서는 DOM 에서
539
+ 폭과 덮는 수를 읽어 넘기기만 한다 — 머리 줄도 한 줄로 함께 넣는다. */
540
+ const cellsOf = (row) => Array.from(row.children).map(c => {
541
+ const cs = window.getComputedStyle(c);
542
+ return { width: c.getBoundingClientRect().width, span: spanFromGridStyle(cs.gridColumnStart, cs.gridColumnEnd) };
543
+ });
544
+ const columnGap = parseFloat(window.getComputedStyle(el).columnGap) || 0;
545
+ const widest = widestPerColumn([cellsOf(el), ...rows.map(cellsOf)], fields.length, columnGap);
530
546
  const measured = fields.map((_, i) => {
531
- let w = el.children[i]?.getBoundingClientRect().width ?? 0;
532
- for (const row of rows) {
533
- const c = row.children[i];
534
- if (c)
535
- w = Math.max(w, c.getBoundingClientRect().width);
536
- }
547
+ const w = widest[i];
537
548
  /* 고정 px 열은 정해 둔 값 그대로 — 최소 폭(MIN_COL_W)으로 올린 값을 고정 합에 넣으면 격자에는 원래 값(40px)으로 나가
538
549
  그만큼(8px) 표 오른쪽이 비었다(말귀 어드민 버그 탭·쿠폰) */
539
550
  const fixedWidth = isFixedPxRef.current(i) ? parseFloat(defaultColsRef.current[i]) : NaN;
@@ -887,6 +898,6 @@ export default function Table({ fields: rawFields = [], sort: sortBinding, sorta
887
898
  rowHasButton: renderRow(item).some(c => !!c.rowLabel), describedBy: rowHintId, onMouseEnter: onRowMouseEnter ? (e) => onRowMouseEnter(item, e) : undefined, onMouseLeave: onRowMouseLeave ? (e) => onRowMouseLeave(item, e) : undefined, onDragStart: onRowDragStart ? (e) => onRowDragStart(item, e) : undefined, onDragEnd: onRowDragEnd ? (e) => onRowDragEnd(item, e) : undefined, expandedContent: isExpanded && renderExpandedRow ? renderExpandedRow(item) : undefined, children: renderRow(item).map((cell, i) => (
888
899
  /* 열 맞춤(`fields[i].align`)은 **머리와 본문에 함께** 걸린다 —
889
900
  한쪽만 걸면 숫자 열의 머리와 값이 서로 다른 쪽으로 붙는다 */
890
- _jsx(TableCell, { className: cx(cell.className, alignClass(fields[i]?.align)), style: cell.style, rowLabel: clickable ? cell.rowLabel : undefined, onRowClick: clickable ? () => onRowClick(item) : undefined, children: cell.content }, i))) }, item.id != null ? `${typeof item.id}:${item.id}` : `__idx:${idx}`));
901
+ _jsx(TableCell, { className: cx(cell.className, alignClass(fields[i]?.align)), style: cell.style, span: cell.span, rowLabel: clickable ? cell.rowLabel : undefined, onRowClick: clickable ? () => onRowClick(item) : undefined, children: cell.content }, i))) }, item.id != null ? `${typeof item.id}:${item.id}` : `__idx:${idx}`));
891
902
  }) })] }))] })] }));
892
903
  }
@@ -34,6 +34,8 @@ export interface TableFilterPanelShellProps extends TableFilterPanelBaseProps {
34
34
  export interface TableFilterPanelSmartProps extends TableFilterPanelBaseProps {
35
35
  hasImage: boolean;
36
36
  hasColloquial: boolean;
37
+ /** 이름표를 쥔 칸이 하나라도 있나 — '유형' 칩을 켤지 가른다(청 (334)) */
38
+ hasCaption?: boolean;
37
39
  contentTypes: WordTableContentType[];
38
40
  orientation: WordTableOrientation;
39
41
  showOutline: boolean;
@@ -22,9 +22,9 @@ export default function TableFilterPanel(props) {
22
22
  if (isShellProps(props)) {
23
23
  return (_jsx(FilterPanel, { className: className, title: title ?? t('wordTable.filterTitle', '표 설정'), sections: props.sections, selected: props.selected, onSelect: props.onSelect, ...collapseProps, align: "inline" }));
24
24
  }
25
- const { hasImage, hasColloquial, contentTypes, orientation, showOutline, cutLine, showDivLine, setters, showCutLine = false, showDivLine2 = false, middleSections = [], extraSelected = {}, onExtraSelect, showPaperBands = false, showTopInfo = true, showBottomInfo = true, } = props;
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 }),
27
+ buildCompositionSection(t, { hasImage, hasColloquial, hasCaption }),
28
28
  buildOrientationSection(t),
29
29
  ...middleSections,
30
30
  buildBorderSection(t),
@@ -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, 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, 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;
@@ -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, 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, 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;
@@ -83,7 +83,9 @@ export default function WordTableBlock({ title, titleIcon, disc, filterTitle, fi
83
83
  const band = brand && { ...brand, top: showTopInfo, bottom: showBottomInfo };
84
84
  // 공통 단어 표 설정 상태
85
85
  const [orientation, setOrientation] = useState('landscape');
86
- const [contentTypes, setContentTypes] = useState(['image', 'word', 'standardPron']);
86
+ /* `caption` 이 처음부터 켜져 있다 — 안 넣으면 (334) 가 들어오는 날 **지금까지 서던
87
+ 이름표가 통째로 사라진다**(`showOf` 는 빈 배열일 때만 다 켠다). 끄는 것은 사람이 한다. */
88
+ const [contentTypes, setContentTypes] = useState(['image', 'word', 'caption', 'standardPron']);
87
89
  const [cutLine, setCutLine] = useState('show');
88
90
  const [showOutline, setShowOutline] = useState(true);
89
91
  const [showDivLine, setShowDivLine] = useState(true);
@@ -135,11 +137,35 @@ export default function WordTableBlock({ title, titleIcon, disc, filterTitle, fi
135
137
  **항목 수가 아니라 자리 수로 조인다**(청 (327)). 항목이 하나뿐인 열두 칸짜리 표를
136
138
  항목 수로 조이면 한 쪽에 한 칸씩 **열두 쪽**이 된다. `cellCapacity` 를 안 주면
137
139
  자리 수 = 항목 수라 지금까지와 같다. */
138
- const effectiveItemsPerPage = Math.min(itemsPerPageSetting, Math.max(capacity, 1));
140
+ /* 천장이 있으면 거기서 멎는다 — 칸 수와 **한 쪽에 서는 수**는 다른 것이다(청 (333)) */
141
+ const perPageCeiling = Math.max(1, Math.min(capacity, maxItemsPerPage ?? capacity));
142
+ const effectiveItemsPerPage = Math.min(itemsPerPageSetting, perPageCeiling);
139
143
  const itemsPerPage = pagesEnabled ? effectiveItemsPerPage : count;
140
- /* 쪽은 **항목이 아니라 자리**로 센다 — 빈 칸만 남은 쪽도 서야 '추가하기' 가 닿는다.
141
- 항목이 모자란 쪽은 빈 배열을 받는다. */
142
- const pageCount = pagesEnabled ? Math.max(1, Math.ceil(capacity / Math.max(1, itemsPerPage))) : 0;
144
+ /* 쪽은 **쓸 자리가 닿는 곳까지만** 센다(말귀 청 (337), 2026-10-28,
145
+ 사장님 *"모두 빈칸이 되면 없어야지"*).
146
+
147
+ 규칙 한 줄: **한 쪽은 항목을 쥐었거나, 다음에 들어갈 첫 빈자리를 쥐었을 때 선다.**
148
+ 그 뒤는 안 선다.
149
+
150
+ 전에는 **자리 수**로 셌다 — `올림(capacity / 쪽당)`. 빈 칸만 남은 쪽도 서야 거기
151
+ '추가하기' 가 닿는다고 보았는데(청 (327)), 자리 수를 부르는 쪽이 못 박아 넘기면
152
+ **아무것도 없는 쪽이 여럿** 선다: 자리 36 · 항목 27 · 쪽당 6 이면 다섯째 쪽에 셋과 빈 칸
153
+ 셋이 서고 **여섯째 쪽은 통째로 빈 종이**다(말귀 실측).
154
+
155
+ 위 규칙은 둘을 다 지킨다 — 첫 빈자리를 쥔 쪽까지는 서니 '추가하기' 가 늘 닿고(청 (327)
156
+ 의 자리 10 · 항목 8 · 쪽당 4 도 셋째 쪽이 그대로 선다), 그 **뒤**는 더할 자리가 없으므로
157
+ 안 선다.
158
+
159
+ **쪽이 딱 나누어떨어질 때는 빈 쪽 하나가 선다** — 항목 24 · 자리 36 · 쪽당 12 면 첫
160
+ 빈자리가 셋째 쪽 머리라 셋째 쪽이 선다. 그 한 장까지 없애려면 부르는 쪽이 자리 수를
161
+ 항목 수에 맞춰 줘야 한다(말귀는 `올림(항목/12) × 12` 로 이미 그렇게 쥔다 — 항목 24 면
162
+ 자리도 24 라 두 쪽이다). 여기서 더 줄이면 **더할 자리가 사라진다.** */
163
+ const pagesWithItems = Math.ceil((items?.length ?? 0) / Math.max(1, itemsPerPage));
164
+ /* 첫 빈자리는 `items.length` 번 칸이다 — 자리가 남았을 때만 있다 */
165
+ const pageOfFirstFree = (items?.length ?? 0) < capacity
166
+ ? Math.floor((items?.length ?? 0) / Math.max(1, itemsPerPage)) + 1
167
+ : 0;
168
+ const pageCount = pagesEnabled ? Math.max(1, pagesWithItems, pageOfFirstFree) : 0;
143
169
  const pages = pagesEnabled
144
170
  ? Array.from({ length: pageCount }, (_, i) => (items ?? []).slice(i * itemsPerPage, (i + 1) * itemsPerPage))
145
171
  : null;
@@ -183,6 +209,11 @@ export default function WordTableBlock({ title, titleIcon, disc, filterTitle, fi
183
209
  const hasColloquial = isEditable
184
210
  ? visibleCells.some(c => c?.some(e => !!e.colloquialPronunciation))
185
211
  : (items ?? []).some(item => (item.words ?? []).some(w => !!w.colloquialLabel));
212
+ /* 이름표를 쥔 칸이 하나라도 있나 — 없으면 '유형' 칩이 회색으로 선다(청 (334)).
213
+ 편집 격자에는 이름표를 담는 자리가 없다(`WordEntry` 에 없다) — 거기서는 늘 꺼진다.
214
+ 머리 칸도 센다 — 활용표의 머리 칸만 이름표를 쥐는 일이 있다(청 (329) 와 같은 결). */
215
+ const hasCaption = !isEditable && [...(baseItem ? [baseItem] : []), ...(items ?? [])]
216
+ .some(item => (item.words ?? []).some(w => !!w.captionBadge || !!w.captionLabel));
186
217
  // 표에 실제로 이미지가 있는지 — resolver(word)는 존재 여부와 무관하게 항상 URL을 만들어 반환하므로
187
218
  // 그 truthiness만으로는 판정할 수 없다(항상 true가 되어 이미지 없는 표에서도 '이미지' 토글이
188
219
  // 활성화되는 문제가 있었다). checkImageExists로 실제 HEAD 요청(+캐시) 확인을 거친다.
@@ -220,11 +251,11 @@ export default function WordTableBlock({ title, titleIcon, disc, filterTitle, fi
220
251
  const middleSections = useMemo(() => [
221
252
  ...((isEditable || showCellCount) ? [{ label: t('wordTable.filter.columns', '칸 수'), items: CELL_COUNTS.map(n => ({ value: `${n}칸`, displayLabel: t('wordTable.filter.column', { count: n }) })), display: 'segmented' }] : []),
222
253
  // 내용이 있는(1개 이상) 표면 '페이지당 대립쌍/단어 수'를 항상 노출한다(표시 모드 한정).
223
- ...(pagesEnabled && (items?.length ?? 0) > 0 ? [buildItemsPerPageSection(t, { hasPairs, itemCount: capacity })] : []),
254
+ ...(pagesEnabled && (items?.length ?? 0) > 0 ? [buildItemsPerPageSection(t, { hasPairs, itemCount: capacity, max: maxItemsPerPage })] : []),
224
255
  /* 이 블록은 종이 띠를 안 받는다 — 쪽 번호가 설 데가 여기뿐이라 자리 고르개를 그대로 둔다
225
256
  (띠를 쓰는 `WordTable` 쪽만 이 절을 걷는다). */
226
257
  ...(isPaginated ? [buildPageNumberSection(t)] : []),
227
- ], [t, isEditable, showCellCount, pagesEnabled, items?.length, hasPairs, capacity, isPaginated]);
258
+ ], [t, isEditable, showCellCount, pagesEnabled, items?.length, hasPairs, capacity, maxItemsPerPage, isPaginated]);
228
259
  const middleSelected = {
229
260
  ...((isEditable || showCellCount) ? { [t('wordTable.filter.columns', '칸 수')]: `${count}칸` } : {}),
230
261
  ...(pagesEnabled && (items?.length ?? 0) > 0 ? { [t(hasPairs ? 'wordTable.filter.itemsPerPagePair' : 'wordTable.filter.itemsPerPageWord')]: `${effectiveItemsPerPage}개` } : {}),
@@ -240,6 +271,9 @@ export default function WordTableBlock({ title, titleIcon, disc, filterTitle, fi
240
271
  setChosenCellCount(parseInt(value));
241
272
  }
242
273
  else if (sectionLabel === t(hasPairs ? 'wordTable.filter.itemsPerPagePair' : 'wordTable.filter.itemsPerPageWord')) {
274
+ /* **칸 수**로 묻는다 — 천장이 아니다. 천장을 주면 첫 칸(열둘)이 곧 천장이라
275
+ `n >= 천장` 이 늘 참이 되어 **고른 수가 전부로 담긴다**(심어 확인했다: 천장을
276
+ 떼는 순간 한 쪽이 됐다). '전부' 는 *칸을 다 담는다* 는 뜻이지 *첫 칸* 이 아니다. */
243
277
  setItemsPerPageSetting(itemsPerPageFromChoice(parseInt(value), capacity));
244
278
  }
245
279
  else if (sectionLabel === t('wordTable.filter.pageNumber', '페이지 번호')) {
@@ -345,7 +379,7 @@ export default function WordTableBlock({ title, titleIcon, disc, filterTitle, fi
345
379
  setActiveCell(null);
346
380
  },
347
381
  onClose: handleCloseWordSearch,
348
- }), !hideControls && (_jsx(TableFilterPanel, { title: filterTitle, collapsible: filterCollapsible, defaultCollapsed: filterDefaultCollapsed, collapsed: filterCollapsed, onCollapsedChange: onFilterCollapsedChange, headerSummary: filterHeaderSummary, hasImage: hasImage, hasColloquial: hasColloquial, 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,
382
+ }), !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,
349
383
  /* 쪽마다 머리 칸이 선다 — 한 장만 들고 보는 종이에 머리 낱말이 없으면
350
384
  나머지 칸이 무엇의 활용인지 알 수 없다 */
351
385
  baseItem: baseItem, baseContentTypes: baseContentTypes, onRemoveItem: onRemoveItem,
@@ -91,6 +91,21 @@ export interface WordTableBlockProps {
91
91
  * 그쪽이 이긴다(사람이 고른 것이 마지막 말이다).
92
92
  */
93
93
  cellCapacity?: number;
94
+ /**
95
+ * **한 쪽에 설 수 있는 가장 많은 수** — '페이지당 개수' 고르개의 첫 칸이 여기서 멎는다.
96
+ *
97
+ * 사장님 지시(2026-10-28) *"단어 수 최대와 페이지당 단어 수 최대가 다른거야"* ·
98
+ * *"단어는 20개더라도 페이지당 표현은 12로 선택할 수 있도록 해야지"*(말귀 청 (333)).
99
+ * 활용표의 **칸 수는 낱말이 정하고**(동사 36 · 형용사 21), 종이 한 장에 열둘보다 많으면
100
+ * 글자가 작아져 못 읽는다 — 그래서 둘이 다른 수다.
101
+ *
102
+ * 안 주면 지금까지대로 칸 수가 첫 칸이다. 칸 수보다 크면 무시한다(없는 자리를 고를 수 없다).
103
+ *
104
+ * **이것은 `cellCapacity` 와 다르다** — `cellCapacity` 는 *표가 몇 칸인가*, 이것은 *그
105
+ * 칸들이 한 쪽에 몇씩 서는가* 다. 스무 칸짜리 표에 `maxItemsPerPage={12}` 면 칸은 스물
106
+ * 그대로고 쪽이 둘로 나뉜다.
107
+ */
108
+ maxItemsPerPage?: number;
94
109
  disc?: ReactNode;
95
110
  /** 현재 표의 저장된 이름(불러온 표 등). 있으면 인쇄/PDF 저장 시 파일명으로 사용, 없으면 "오늘 날짜 + 단어표/대립쌍표" */
96
111
  tableName?: string;
@@ -4,6 +4,7 @@ import type { WordTableOrientation, WordTableContentType, WordTableCutLine, Page
4
4
  export declare function buildCompositionSection(t: TFunction, opts: {
5
5
  hasImage: boolean;
6
6
  hasColloquial: boolean;
7
+ hasCaption?: boolean;
7
8
  }): FilterPanelSection;
8
9
  /** @public 용지 방향(가로/세로) 세그먼트 섹션. */
9
10
  export declare function buildOrientationSection(t: TFunction): FilterPanelSection;
@@ -17,18 +18,35 @@ export declare function buildBottomInfoSection(t: TFunction): FilterPanelSection
17
18
  export declare function buildCutLineSection(t: TFunction): FilterPanelSection;
18
19
  /** @public 구분선(대립선, 표시/미표시) 세그먼트 섹션 — 대립쌍표에만 노출. */
19
20
  export declare function buildDivLineSection(t: TFunction): FilterPanelSection;
20
- /** @public 페이지당 대립쌍/단어 수 세그먼트 섹션. 첫 옵션은 항상 전체(itemCount=한 페이지에 전부), 나머지는 그보다 작은 표준 분할값. */
21
+ /**
22
+ * @public 페이지당 대립쌍/단어 수 세그먼트 섹션.
23
+ *
24
+ * 첫 칸은 **한 쪽에 들어갈 수 있는 가장 큰 수**고, 나머지는 그보다 작은 표준 분할값이다.
25
+ *
26
+ * `max` 를 주면 첫 칸이 거기서 멎는다(말귀 청 (333), 2026-10-28 — 사장님 *"단어는 20개더라도
27
+ * 페이지당 표현은 12로 선택할 수 있도록 해야지"*). **칸 수와 한 쪽에 서는 수는 다른 것**이다 —
28
+ * 활용표의 칸 수는 낱말이 정하고(동사 36 · 형용사 21), 종이 한 장에 열둘보다 많으면 글자가
29
+ * 작아져 못 읽는다. `max` 가 없으면 지금까지대로 `itemCount` 가 첫 칸이다.
30
+ */
21
31
  export declare function buildItemsPerPageSection(t: TFunction, opts: {
22
32
  hasPairs: boolean;
23
33
  itemCount: number;
34
+ max?: number;
24
35
  }): FilterPanelSection;
25
36
  /**
26
37
  * 페이지당 개수 섹션에서 고른 값 → 기억할 페이지당 개수.
27
38
  *
28
- * **첫 칸(그때의 항목 수 = 한 쪽에 전부)을 고르면 늘 전체(`Infinity`)** 로 기억한다 — 항목 수가 표준값(8·4·2·1)과
29
- * 같을 때 숫자로 담으면, 4개일 때 '4개(전부)' 를 골라 둔 표에 낱말을 더 담는 순간 4개씩 두 쪽으로 나뉘었다
30
- * (5개일 때 '5개' 는 목록에 없는 수라 전체로 기억돼 한 쪽에 남았다 — 같은 첫 칸인데 뜻이 갈렸다).
31
- * 목록에 없는 수(항목이 줄어 사라진 옛 선택)도 전체로 본다. 나머지 표준값은 그 수로 나눈다.
39
+ * **'한 쪽에 전부' 를 고르면 전체(`Infinity`)** 로 기억한다 — 숫자로 담으면, 4개일 때
40
+ * '4개(전부)' 를 골라 둔 표에 낱말을 더 담는 순간 4개씩 두 쪽으로 나뉘었다(5개일 때 '5개' 는
41
+ * 목록에 없는 수라 전체로 기억돼 한 쪽에 남았다 — 같은 첫 칸인데 뜻이 갈렸다).
42
+ *
43
+ * **천장이 생기면 첫 칸이 '전부' 가 아니다**(말귀 청 (333), 2026-10-28). 스무 칸짜리 표에서
44
+ * `12개` 는 전부가 아니라 **두 쪽**이다 — 그래서 *"첫 칸이면 전부"* 가 아니라
45
+ * **"칸 수에 닿으면 전부"** 로 묻는다. 천장이 없으면 첫 칸이 곧 칸 수라 지금까지와 같다.
46
+ *
47
+ * > 옛 글은 *"목록에 없는 수도 전부로 본다"* 고 했는데, 이 함수는 **사람이 칩을 누를 때만**
48
+ * > 불린다 — 그때의 `n` 은 늘 그 순간 목록에 있는 수다. 천장이 생기면 첫 칸(열둘)이
49
+ * > 표준값 목록에 없으므로, 그 가름을 그대로 두면 **방금 고른 수가 전부로 바뀐다.**
32
50
  */
33
51
  export declare function itemsPerPageFromChoice(n: number, itemCount: number): number;
34
52
  /** @public 페이지 번호 위치(왼쪽/중앙/오른쪽/미표시) 세그먼트 섹션 — 실제 2페이지 이상일 때만 노출. */
@@ -21,6 +21,11 @@ export function buildCompositionSection(t, opts) {
21
21
  items: [
22
22
  { value: 'image', disabled: !opts.hasImage, displayLabel: t('wordTable.filter.image', '이미지') },
23
23
  { value: 'word', displayLabel: t('wordTable.filter.word', '단어') },
24
+ /* **유형**(이름표) — 말귀 청 (334), 2026-10-28. 이름은 사장님 말씀 그대로다.
25
+ 자리는 `단어` 뒤다. 칸에 서는 차례(이름표 → 낱말 → 발음)와는 어긋나지만, 이미 있던
26
+ 넷의 차례를 덜 흔드는 쪽이다. 이름표를 쥔 칸이 하나도 없으면 회색으로 선다 —
27
+ 단어표에는 이름표가 없다. */
28
+ { value: 'caption', disabled: !opts.hasCaption, displayLabel: t('wordTable.filter.caption', '유형') },
24
29
  { value: 'standardPron', displayLabel: t('wordTable.filter.standardPron', '표준 발음') },
25
30
  { value: 'colloquialPron', disabled: !opts.hasColloquial, displayLabel: t('wordTable.filter.colloquialPron', '구어체 발음') },
26
31
  ],
@@ -96,11 +101,21 @@ export function buildDivLineSection(t) {
96
101
  display: 'segmented',
97
102
  };
98
103
  }
99
- /** @public 페이지당 대립쌍/단어 수 세그먼트 섹션. 첫 옵션은 항상 전체(itemCount=한 페이지에 전부), 나머지는 그보다 작은 표준 분할값. */
104
+ /**
105
+ * @public 페이지당 대립쌍/단어 수 세그먼트 섹션.
106
+ *
107
+ * 첫 칸은 **한 쪽에 들어갈 수 있는 가장 큰 수**고, 나머지는 그보다 작은 표준 분할값이다.
108
+ *
109
+ * `max` 를 주면 첫 칸이 거기서 멎는다(말귀 청 (333), 2026-10-28 — 사장님 *"단어는 20개더라도
110
+ * 페이지당 표현은 12로 선택할 수 있도록 해야지"*). **칸 수와 한 쪽에 서는 수는 다른 것**이다 —
111
+ * 활용표의 칸 수는 낱말이 정하고(동사 36 · 형용사 21), 종이 한 장에 열둘보다 많으면 글자가
112
+ * 작아져 못 읽는다. `max` 가 없으면 지금까지대로 `itemCount` 가 첫 칸이다.
113
+ */
100
114
  export function buildItemsPerPageSection(t, opts) {
115
+ const first = Math.max(1, Math.min(opts.itemCount, opts.max ?? opts.itemCount));
101
116
  return {
102
117
  label: t(opts.hasPairs ? 'wordTable.filter.itemsPerPagePair' : 'wordTable.filter.itemsPerPageWord'),
103
- items: [opts.itemCount, ...ITEMS_PER_PAGE_OPTIONS.filter(n => n < opts.itemCount)].map(n => ({
118
+ items: [first, ...ITEMS_PER_PAGE_OPTIONS.filter(n => n < first)].map(n => ({
104
119
  value: `${n}개`, displayLabel: t('wordTable.filter.itemsPerPageOption', { count: n }),
105
120
  })),
106
121
  display: 'segmented',
@@ -109,13 +124,20 @@ export function buildItemsPerPageSection(t, opts) {
109
124
  /**
110
125
  * 페이지당 개수 섹션에서 고른 값 → 기억할 페이지당 개수.
111
126
  *
112
- * **첫 칸(그때의 항목 수 = 한 쪽에 전부)을 고르면 늘 전체(`Infinity`)** 로 기억한다 — 항목 수가 표준값(8·4·2·1)과
113
- * 같을 때 숫자로 담으면, 4개일 때 '4개(전부)' 를 골라 둔 표에 낱말을 더 담는 순간 4개씩 두 쪽으로 나뉘었다
114
- * (5개일 때 '5개' 는 목록에 없는 수라 전체로 기억돼 한 쪽에 남았다 — 같은 첫 칸인데 뜻이 갈렸다).
115
- * 목록에 없는 수(항목이 줄어 사라진 옛 선택)도 전체로 본다. 나머지 표준값은 그 수로 나눈다.
127
+ * **'한 쪽에 전부' 를 고르면 전체(`Infinity`)** 로 기억한다 — 숫자로 담으면, 4개일 때
128
+ * '4개(전부)' 를 골라 둔 표에 낱말을 더 담는 순간 4개씩 두 쪽으로 나뉘었다(5개일 때 '5개' 는
129
+ * 목록에 없는 수라 전체로 기억돼 한 쪽에 남았다 — 같은 첫 칸인데 뜻이 갈렸다).
130
+ *
131
+ * **천장이 생기면 첫 칸이 '전부' 가 아니다**(말귀 청 (333), 2026-10-28). 스무 칸짜리 표에서
132
+ * `12개` 는 전부가 아니라 **두 쪽**이다 — 그래서 *"첫 칸이면 전부"* 가 아니라
133
+ * **"칸 수에 닿으면 전부"** 로 묻는다. 천장이 없으면 첫 칸이 곧 칸 수라 지금까지와 같다.
134
+ *
135
+ * > 옛 글은 *"목록에 없는 수도 전부로 본다"* 고 했는데, 이 함수는 **사람이 칩을 누를 때만**
136
+ * > 불린다 — 그때의 `n` 은 늘 그 순간 목록에 있는 수다. 천장이 생기면 첫 칸(열둘)이
137
+ * > 표준값 목록에 없으므로, 그 가름을 그대로 두면 **방금 고른 수가 전부로 바뀐다.**
116
138
  */
117
139
  export function itemsPerPageFromChoice(n, itemCount) {
118
- return n === itemCount || !ITEMS_PER_PAGE_OPTIONS.includes(n) ? Number.POSITIVE_INFINITY : n;
140
+ return n >= itemCount ? Number.POSITIVE_INFINITY : n;
119
141
  }
120
142
  /** @public 페이지 번호 위치(왼쪽/중앙/오른쪽/미표시) 세그먼트 섹션 — 실제 2페이지 이상일 때만 노출. */
121
143
  export function buildPageNumberSection(t) {
@@ -322,6 +322,31 @@
322
322
  }
323
323
 
324
324
  /* ── 카드 ───────────────────────────────────────────────── */
325
+ /* **손 단추의 들여쓰기는 칸 폭을 따른다**(`--wt-hand-inset`, 사장님 지시 2026-10-28:
326
+ *"작아졌을때 패딩 20이 너무 커 보여 기준점 잡아서 패딩 낮춰줘"*).
327
+
328
+ **기준점은 네 칸짜리 표다** — 거기서 칸이 종이 좌표로 503px 이고, 지금까지 쓰던 20px 이
329
+ 그 폭의 **4%** 다. 그 비를 그대로 쓰면 큰 칸은 지금과 똑같고 작은 칸만 줄어든다.
330
+
331
+ 재 보니 `20 + 단추 40` 이 칸 폭에서 차지하는 몫이 이랬다(종이 좌표, 2026-10-28) —
332
+
333
+ | 칸 수 | 칸 폭 | 지금 | 고친 뒤 |
334
+ |---|---|---|---|
335
+ | 4 | 503 | 11.9% | 11.9%(그대로) |
336
+ | 8 | 251 | 23.9% | 19.9% |
337
+ | 16 | 169 | 35.6% | 27.7% |
338
+
339
+ 바닥을 6px 로 둔 것은 더 내려가면 단추가 칸 모서리에 붙어 **잘린 것처럼** 보여서다.
340
+ 천장이 20px 인 것은 큰 칸에서 지금보다 더 벌어지지 않게 하려는 것이다.
341
+
342
+ > **남은 몫은 단추 자신이다.** 열여섯 칸에서 단추 40px 만으로 칸 폭의 23.7% 다 —
343
+ > 들여쓰기를 0 으로 해도 거기까지만 준다. 그쪽은 `buttonSize` 가 쥔다. */
344
+ .word-table__card,
345
+ .word-table__edit-cell {
346
+ container-type: inline-size;
347
+ --wt-hand-inset: clamp(6px, 4cqw, 20px);
348
+ }
349
+
325
350
  .word-table__card {
326
351
  display: flex;
327
352
  /* 칸(.word-table-cell)은 투명이고 **이 카드가 면을 쥔다** — 그래서 `--cut-show` 의 선 바탕 위에
@@ -379,8 +404,8 @@
379
404
  /* 옮기기 손잡이 — 빼기 단추와 같은 규칙(평소엔 숨고 hover·초점에 드러난다), 자리만 왼쪽이다 */
380
405
  .word-table__card-handle {
381
406
  position: absolute;
382
- top: 20px;
383
- left: 20px;
407
+ top: var(--wt-hand-inset, 20px);
408
+ left: var(--wt-hand-inset, 20px);
384
409
  z-index: 1;
385
410
  opacity: 0;
386
411
  transition: opacity 0.15s;
@@ -400,8 +425,8 @@
400
425
 
401
426
  .word-table__card-close {
402
427
  position: absolute;
403
- top: 20px;
404
- right: 20px;
428
+ top: var(--wt-hand-inset, 20px);
429
+ right: var(--wt-hand-inset, 20px);
405
430
  z-index: 1;
406
431
  opacity: 0;
407
432
  transition: opacity 0.15s;
@@ -419,8 +444,8 @@
419
444
  0 이라, 재생과 빼기가 같은 높이에 선다. */
420
445
  .word-table__card-actions {
421
446
  position: absolute;
422
- top: 20px;
423
- right: 20px;
447
+ top: var(--wt-hand-inset, 20px);
448
+ right: var(--wt-hand-inset, 20px);
424
449
  z-index: 1;
425
450
  display: flex;
426
451
  flex-direction: column;
@@ -606,8 +631,8 @@
606
631
  재생과 빼기 · 정보와 그 아래 것이 서로 같은 높이에 선다(사장님 2026-10-12). */
607
632
  .word-table-cell__side {
608
633
  position: absolute;
609
- top: 20px;
610
- left: 20px;
634
+ top: var(--wt-hand-inset, 20px);
635
+ left: var(--wt-hand-inset, 20px);
611
636
  z-index: 1;
612
637
  display: flex;
613
638
  flex-direction: column;