@ihabdevteam/core 0.375.0 → 0.377.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.
- package/CHANGELOG.md +147 -0
- package/dist/components.cjs.js +173 -173
- package/dist/components.esm.css +3 -3
- package/dist/hooks.cjs.js +3 -3
- package/dist/i18n.cjs.js +3 -3
- package/dist/ihabdevteam-core.cjs.js +177 -177
- package/dist/ihabdevteam-core.d.ts +55 -3
- package/dist/packages/core/src/components/Button.css +8 -0
- package/dist/packages/core/src/components/Button.js +18 -5
- package/dist/packages/core/src/components/Training/TrainingWordCard.js +14 -2
- package/dist/packages/core/src/components/Word/WordSearchResultBlock.css +0 -7
- package/dist/packages/core/src/components/Word/WordSearchResultBlock.js +1 -1
- package/dist/packages/core/src/components/Word/WordTableBlock.d.ts +1 -1
- package/dist/packages/core/src/components/Word/WordTableBlock.js +38 -16
- package/dist/packages/core/src/components/Word/wordTableBlockTypes.d.ts +15 -0
- package/dist/packages/core/src/components/WordTable.css +45 -18
- package/dist/packages/core/src/components/WordTable.d.ts +10 -1
- package/dist/packages/core/src/components/WordTable.js +69 -31
- package/dist/packages/core/src/components/buttonTypes.d.ts +17 -0
- package/dist/packages/core/src/i18n/locales/en.json +1 -0
- package/dist/packages/core/src/i18n/locales/ko.json +1 -0
- package/dist/packages/core/src/types/wordSearch.d.ts +11 -0
- package/dist/packages/core/src/version.d.ts +1 -1
- package/dist/packages/core/src/version.js +1 -1
- package/dist/utils.cjs.js +3 -3
- package/package.json +2 -1
|
@@ -6,6 +6,7 @@ import { useRef, useState, useEffect, useCallback, useMemo, Fragment, } from 're
|
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import './WordTable.css';
|
|
8
8
|
import Button from './Button';
|
|
9
|
+
import Badge from './Badge';
|
|
9
10
|
import Section from './Section';
|
|
10
11
|
import DescriptionTooltip from './Tooltip/DescriptionTooltip';
|
|
11
12
|
import { getTTSUrlResolver, getTTSFallbackUrlResolver } from '../utils/ttsConfig';
|
|
@@ -47,13 +48,17 @@ const srOnly = {
|
|
|
47
48
|
const LONG_PRESS_MS = 400;
|
|
48
49
|
/** 길게 누르기가 익기 전에 이만큼 움직이면 그건 끌기가 아니라 **스크롤**이라 취소한다 */
|
|
49
50
|
const MOVE_THRESHOLD_PX = 8;
|
|
50
|
-
function WordCell({ label, subLabel, colloquialLabel, captionLabel, homonum, showWord = true, showImage = true, showPronunciation = true, showColloquial = true, buttonSize = 40, wordInfo, outerScale = 1, }) {
|
|
51
|
+
function WordCell({ label, subLabel, colloquialLabel, captionLabel, captionBadge, homonum, showWord = true, showImage = true, showPronunciation = true, showColloquial = true, buttonSize = 40, wordInfo, outerScale = 1, }) {
|
|
51
52
|
const { t } = useTranslation();
|
|
52
53
|
const outerRef = useRef(null);
|
|
53
54
|
const infoRef = useRef(null);
|
|
54
55
|
const audioRef = useRef(null);
|
|
55
56
|
const [scale, setScale] = useState(1);
|
|
56
57
|
const [playing, setPlaying] = useState(false);
|
|
58
|
+
/* **받아 오는 중** — `playing` 과 따로 둔다(말귀 청 (330), 2026-10-28). 전에는 합성을
|
|
59
|
+
기다리는 동안에도 `playing` 만 세워, 단추가 곧바로 '멈춤' 이 되는데 소리는 한참 뒤에
|
|
60
|
+
났다. 사람 눈에는 *눌렀는데 멈춰 있는* 꼴이다(실측 처음 3,567ms · 캐시 772ms). */
|
|
61
|
+
const [waiting, setWaiting] = useState(false);
|
|
57
62
|
/* 받은 주소에 **어느 낱말의 것인지** 를 함께 둔다 — 주소만 들고 있으면 같은 칸의 낱말이 바뀐 뒤 새 주소를 받는 동안(또는
|
|
58
63
|
못 받으면) 누를 때 앞 낱말 소리가 났다(틀린 자극). 지금 낱말의 것일 때만 쓴다. */
|
|
59
64
|
const [fetchedAudio, setFetchedAudio] = useState({ for: '', url: '' });
|
|
@@ -87,6 +92,18 @@ function WordCell({ label, subLabel, colloquialLabel, captionLabel, homonum, sho
|
|
|
87
92
|
}, [wordInfo, t]);
|
|
88
93
|
const audioKey = pron || label;
|
|
89
94
|
const audioUrl = fetchedAudio.for === audioKey ? fetchedAudio.url : '';
|
|
95
|
+
/* **칸은 낱말마다 한 번만 묻는다.** 받은 답이 뒤에 나아져도 다시 묻지 않는다.
|
|
96
|
+
말귀가 (326) 뒤에 그 자리를 밟았다(2026-10-28): 그쪽 음원 색인은 *낱말 소리를 처음
|
|
97
|
+
찾는 순간* 뒤에서 받는데, 활용표에서는 그 '처음' 이 **표를 그리는 그 순간**이라 칸이
|
|
98
|
+
색인보다 앞에 섰다. 색인 앞에서는 주소가 '없다' 가 아니라 '모른다' 라 규약으로 지은
|
|
99
|
+
주소가 나가고, 그것이 400 이었다 — **빈 글자가 아니므로 아래 폴백도 안 돈다.**
|
|
100
|
+
훈련 카드는 틀어 보고 실패하면 폴백으로 가니 넘어가는데, 표의 칸은 그 주소를 한 번
|
|
101
|
+
받아 그대로 눌러앉았다(열두 칸 모두 400).
|
|
102
|
+
말귀는 쪽이 열릴 때 색인을 미리 받는 것으로 막았다. 코어에는 *"답이 나아졌다"* 를
|
|
103
|
+
들을 길이 없으니(`clearAudioExistsCache` 는 '음성 있음' 거르개의 것이지 이 자리의
|
|
104
|
+
것이 아니다) 여기서 고칠 수 있는 것이 아니다 — **밟을 수 있는 자리라는 것만 적어
|
|
105
|
+
둔다.** 리졸버가 때에 따라 다른 답을 주는 곳이면, 표를 그리기 전에 그 때를 지나 둬야
|
|
106
|
+
한다. */
|
|
90
107
|
useEffect(() => {
|
|
91
108
|
const resolver = getTTSUrlResolver();
|
|
92
109
|
const ttsText = pron || label;
|
|
@@ -128,7 +145,9 @@ function WordCell({ label, subLabel, colloquialLabel, captionLabel, homonum, sho
|
|
|
128
145
|
playReqRef.current.cancelled = true; }, []);
|
|
129
146
|
const handlePlay = useCallback((e) => {
|
|
130
147
|
e.stopPropagation();
|
|
131
|
-
|
|
148
|
+
/* **기다리는 중에 누르면 기다림이 접힌다**(청 (330)) — `playing` 만 보면 그때 손이
|
|
149
|
+
`stop` 에 안 닿아 **합성이 한 번 더 나간다.** 둘 다 본다. */
|
|
150
|
+
if (playing || waiting) {
|
|
132
151
|
stopRef.current?.();
|
|
133
152
|
return;
|
|
134
153
|
}
|
|
@@ -145,12 +164,13 @@ function WordCell({ label, subLabel, colloquialLabel, captionLabel, homonum, sho
|
|
|
145
164
|
const stop = () => {
|
|
146
165
|
req.cancelled = true;
|
|
147
166
|
req.stop?.();
|
|
167
|
+
setWaiting(false);
|
|
148
168
|
setPlaying(false);
|
|
149
169
|
releaseRef.current?.();
|
|
150
170
|
};
|
|
151
171
|
stopRef.current = stop;
|
|
152
172
|
releaseRef.current = claimSound(stop);
|
|
153
|
-
|
|
173
|
+
setWaiting(true);
|
|
154
174
|
void Promise.resolve()
|
|
155
175
|
.then(() => fallback(ttsText))
|
|
156
176
|
.then(url => {
|
|
@@ -166,6 +186,10 @@ function WordCell({ label, subLabel, colloquialLabel, captionLabel, homonum, sho
|
|
|
166
186
|
const sound = playOneShot(url, () => { setPlaying(false); releaseRef.current?.(); });
|
|
167
187
|
audioRef.current = sound.el;
|
|
168
188
|
req.stop = sound.stop;
|
|
189
|
+
/* 소리가 생긴 **그때** 기다림이 끝난다 — 둘을 한 번에 바꾸면 도는 표시가 한 틱
|
|
190
|
+
더 남거나 '멈춤' 이 한 틱 먼저 선다. */
|
|
191
|
+
setWaiting(false);
|
|
192
|
+
setPlaying(true);
|
|
169
193
|
})
|
|
170
194
|
.catch(() => { stop(); });
|
|
171
195
|
return;
|
|
@@ -183,7 +207,7 @@ function WordCell({ label, subLabel, colloquialLabel, captionLabel, homonum, sho
|
|
|
183
207
|
stopRef.current = sound.stop;
|
|
184
208
|
/* 자물쇠를 잡으면 앞서 울리던 것(다른 칸·훈련 카드 등)이 멈추고, 남이 잡으면 stop 이 불려 내가 멈춘다 */
|
|
185
209
|
releaseRef.current = claimSound(sound.stop);
|
|
186
|
-
}, [playing, audioUrl, pron, label]);
|
|
210
|
+
}, [playing, waiting, audioUrl, pron, label]);
|
|
187
211
|
const hasImage = showImage && !!imageUrl && !imgFailed;
|
|
188
212
|
const refW = hasImage && showWord ? REF_W_BOTH : hasImage ? REF_W_IMAGE_ONLY : REF_W_TEXT_ONLY;
|
|
189
213
|
const refH = hasImage && showWord ? REF_H_BOTH : hasImage ? REF_H_IMAGE_ONLY : REF_H_TEXT_ONLY;
|
|
@@ -228,17 +252,22 @@ function WordCell({ label, subLabel, colloquialLabel, captionLabel, homonum, sho
|
|
|
228
252
|
* 안 곱하면 또 조용히 헛돈다.
|
|
229
253
|
*/
|
|
230
254
|
const tapTooSmall = buttonSize * outerScale < MIN_TAP_PX;
|
|
231
|
-
return (_jsxs("div", { ref: outerRef, className: cx('word-table-cell', tapTooSmall && 'word-table-cell--tap-too-small', hasImage ? 'word-table-cell--with-image' : ''), "data-ref-w": refW, "data-ref-h": refH, children: [_jsxs("div", { className: "word-table-cell__inner", style: { transform: `scale(${scale})` }, children: [hasImage && (_jsxs("div", { className: "word-table-cell__image-wrap", children: [imgLoading && _jsx("div", { className: "word-table-cell__spinner" }), _jsx("img", { ref: imgRef, className: "word-table-cell__image", src: imageUrl, alt: label, draggable: false, style: { opacity: imgLoading ? 0 : 1 }, onLoad: handleImgLoad, onError: handleImgError })] })),
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
255
|
+
return (_jsxs("div", { ref: outerRef, className: cx('word-table-cell', tapTooSmall && 'word-table-cell--tap-too-small', hasImage ? 'word-table-cell--with-image' : ''), "data-ref-w": refW, "data-ref-h": refH, children: [_jsxs("div", { className: "word-table-cell__inner", style: { transform: `scale(${scale})` }, children: [hasImage && (_jsxs("div", { className: "word-table-cell__image-wrap", children: [imgLoading && _jsx("div", { className: "word-table-cell__spinner" }), _jsx("img", { ref: imgRef, className: "word-table-cell__image", src: imageUrl, alt: label, draggable: false, style: { opacity: imgLoading ? 0 : 1 }, onLoad: handleImgLoad, onError: handleImgError })] })), (captionBadge || captionLabel) && (
|
|
256
|
+
/* **[배지][이름표] 한 줄** — 둘은 성격이 다르다(청 (328)). 배지는 *무엇을 하는
|
|
257
|
+
말인가*(치료사가 고르는 잣대), 이름표는 *어떤 꼬리가 붙는가*(학습자가 낼
|
|
258
|
+
소리)다. 한 글자로 붙여 놓으면 그 둘이 안 갈린다. 가운뎃점은 안 쓴다 —
|
|
259
|
+
배지가 이미 경계다. */
|
|
260
|
+
_jsxs("span", { className: "word-table-cell__caption", children: [captionBadge && _jsx(Badge, { type: "bar", fill: "soft", size: "small", label: captionBadge }), captionLabel && _jsx("span", { className: "word-table-cell__caption-tail h5", children: captionLabel })] })), showWord && _jsx("span", { className: "word-table-cell__word h0", children: label }), showPronunciation && pron && _jsxs("span", { className: "word-table-cell__sub h3", children: ["[", pron, "]"] }), showColloquial && colloquialLabel && _jsxs("span", { className: "word-table-cell__colloquial h5", children: ["[", colloquialLabel, "]"] })] }), _jsxs("div", { className: "word-table-cell__side", children: [_jsxs("div", { className: "word-table-cell__play-button", "data-audio-src": audioUrl, children: [_jsx("span", { "data-play-state": "play", style: { display: playing ? 'none' : undefined }, children: _jsx(Button, { htmlType: "button", size: buttonSize, type: "dot", icon: "play", variant: "transparent-lightGray", useBorder: false, loading: waiting, showTooltipInfo: waiting ? t('common.loading', '불러오는 중') : t('common.play', '재생'), ariaLabel: label ? t('common.playFor', { name: label, defaultValue: `${label} 재생` }) : t('common.play', '재생'), onClick: handlePlay }) }), _jsx("span", { "data-play-state": "pause", style: { display: playing ? undefined : 'none' }, children: _jsx(Button, { htmlType: "button", size: buttonSize, type: "dot", icon: "pause", useBorder: false, selected: true, showTooltipInfo: t('common.pause', '멈춤'), ariaLabel: label ? t('common.pauseFor', { name: label, defaultValue: `${label} 멈춤` }) : t('common.pause', '멈춤'), onClick: handlePlay }) })] }), wordInfo && (_jsxs("div", { ref: infoRef, className: "word-table-cell__info-button", onPointerEnter: (e) => { if (!isTouchPointer(e))
|
|
261
|
+
handleInfoEnter(); }, onPointerLeave: (e) => { if (!isTouchPointer(e))
|
|
262
|
+
handleInfoLeave(); },
|
|
263
|
+
// 이 div 자체는 포커스 대상이 아니지만 안의 Button이 포커스를 받으면
|
|
264
|
+
// focusin이 여기로 올라온다 — 그래서 래퍼에 걸어도 동작한다. 톡으로 온 초점은 톡 토글이 정한다.
|
|
265
|
+
onFocus: () => { if (!recentlyTouched())
|
|
266
|
+
handleInfoEnter(); }, onBlur: handleInfoLeave, children: [_jsx(Button, { htmlType: "button", size: buttonSize, type: "dot", icon: "info", variant: "transparent-lightGray", useBorder: false, showTooltipInfo: false,
|
|
267
|
+
/* 아이콘만 있는 버튼이라 이름이 없으면 화면 낭독기가 "버튼"으로만 읽는다.
|
|
268
|
+
한 표에 칸마다 하나씩 있어 열두 개가 다 "버튼"이 된다 — 어느 낱말의
|
|
269
|
+
것인지 알 길이 없으므로 낱말을 이름에 넣는다. */
|
|
270
|
+
ariaLabel: t('wordTable.wordInfo', '{{word}} 낱말 정보', { word: label }), onClick: (e) => { e.stopPropagation(); infoToggle.touchPress(); } }), infoAnchor && infoTooltipItems && (_jsx(DescriptionTooltip, { anchorRect: infoAnchor, items: infoTooltipItems, showIndex: false }))] }))] })] }));
|
|
242
271
|
}
|
|
243
272
|
/**
|
|
244
273
|
* 단어표(표 디자인) — A4 종이를 컨테이너에 맞춰 축소(scale)하고,
|
|
@@ -246,7 +275,7 @@ function WordCell({ label, subLabel, colloquialLabel, captionLabel, homonum, sho
|
|
|
246
275
|
* 표시(items)·편집(editCells) 두 모드를 지원한다.
|
|
247
276
|
* @public
|
|
248
277
|
*/
|
|
249
|
-
export default function WordTable({ title, titleIcon, disc, className, orientation = 'landscape', contentTypes = ['image', 'word', 'standardPron'], baseItem, baseContentTypes, cutLine = 'show', showOutline = true, showDivLine = true, items, editCells, count, activeCell = null, onActivateCell, onRemoveCell, onRemoveItem, onReorder, renderCellAction, showFillerAdd = false, contentRef, buttonSize = 40, brand, code, pageNumber, pageNumberPosition = 'right', fitHeight = false, scoring = false, marks, onMarkClick, scoreIndexOffset = 0, }) {
|
|
278
|
+
export default function WordTable({ title, titleIcon, disc, className, orientation = 'landscape', contentTypes = ['image', 'word', 'standardPron'], baseItem, baseContentTypes, cutLine = 'show', showOutline = true, showDivLine = true, items, editCells, count, activeCell = null, onActivateCell, onRemoveCell, onRemoveItem, onReorder, renderCellAction, showFillerAdd = false, addableCount, contentRef, buttonSize = 40, brand, code, pageNumber, pageNumberPosition = 'right', fitHeight = false, scoring = false, marks, onMarkClick, scoreIndexOffset = 0, }) {
|
|
250
279
|
const clickMark = useCallback((cellIndex, clicked) => {
|
|
251
280
|
onMarkClick?.(scoreIndexOffset + cellIndex, clicked);
|
|
252
281
|
}, [onMarkClick, scoreIndexOffset]);
|
|
@@ -548,22 +577,31 @@ export default function WordTable({ title, titleIcon, disc, className, orientati
|
|
|
548
577
|
gridRow: `1 / span ${half.rows}`,
|
|
549
578
|
/* 머리 칸과 나머지 절반을 가르는 점선 — 가로면 오른쪽, 세로면 아래쪽 */
|
|
550
579
|
...dotDashStyle(0, orientation === 'landscape' ? 2 : 1, orientation === 'landscape' ? 1 : 2, cutLine),
|
|
551
|
-
}, children: (baseItem.words ?? []).map((w, wi) => (_jsxs(Fragment, { children: [wi > 0 && _jsx("div", { className: "word-table-block__pair-divider" }), _jsx(WordCell, { outerScale: scale, label: w.label, subLabel: w.subLabel, colloquialLabel: w.colloquialLabel, captionLabel: w.captionLabel, homonum: w.homonum, showWord: baseShow.word, showImage: baseShow.image, showPronunciation: baseShow.pron, showColloquial: baseShow.colloq, buttonSize: buttonSize, wordInfo: (w.grade || w.syllables != null || w.pos || w.wordType) ? { grade: w.grade, syllables: w.syllables, pos: w.pos, wordType: w.wordType } : undefined })] }, wi))) })), (items ?? []).map((item, index) => (_jsxs("div", { "data-wordtable-cell": onReorder ? index : undefined, className: `word-table-block__card${onReorder ? ' word-table-block__card--draggable' : ''}${dragOver === index ? ' word-table-block__card--drag-over' : ''}${dragging === index ? ' word-table-block__card--dragging' : ''}`, style: dotDashStyle(index, itemCols, itemRows, cutLine), draggable: !!onReorder, onPointerDown: onReorder ? (e) => longPressDrag(e, index) : undefined, onKeyDown: onReorder ? (e) => moveByKey(e, index) : undefined, onDragStart: onReorder ? () => { dragIndex.current = index; } : undefined, onDragOver: onReorder ? (e) => { e.preventDefault(); setDragOver(index); } : undefined, onDragLeave: onReorder ? () => setDragOver(null) : undefined, onDrop: onReorder ? (e) => { e.preventDefault(); if (dragIndex.current !== null && dragIndex.current !== index) {
|
|
580
|
+
}, children: (baseItem.words ?? []).map((w, wi) => (_jsxs(Fragment, { children: [wi > 0 && _jsx("div", { className: "word-table-block__pair-divider" }), _jsx(WordCell, { outerScale: scale, label: w.label, subLabel: w.subLabel, colloquialLabel: w.colloquialLabel, captionLabel: w.captionLabel, captionBadge: w.captionBadge, homonum: w.homonum, showWord: baseShow.word, showImage: baseShow.image, showPronunciation: baseShow.pron, showColloquial: baseShow.colloq, buttonSize: buttonSize, wordInfo: (w.grade || w.syllables != null || w.pos || w.wordType) ? { grade: w.grade, syllables: w.syllables, pos: w.pos, wordType: w.wordType } : undefined })] }, wi))) })), (items ?? []).map((item, index) => (_jsxs("div", { "data-wordtable-cell": onReorder ? index : undefined, className: `word-table-block__card${onReorder ? ' word-table-block__card--draggable' : ''}${dragOver === index ? ' word-table-block__card--drag-over' : ''}${dragging === index ? ' word-table-block__card--dragging' : ''}`, style: dotDashStyle(index, itemCols, itemRows, cutLine), draggable: !!onReorder, onPointerDown: onReorder ? (e) => longPressDrag(e, index) : undefined, onKeyDown: onReorder ? (e) => moveByKey(e, index) : undefined, onDragStart: onReorder ? () => { dragIndex.current = index; } : undefined, onDragOver: onReorder ? (e) => { e.preventDefault(); setDragOver(index); } : undefined, onDragLeave: onReorder ? () => setDragOver(null) : undefined, onDrop: onReorder ? (e) => { e.preventDefault(); if (dragIndex.current !== null && dragIndex.current !== index) {
|
|
552
581
|
onReorder(dragIndex.current, index);
|
|
553
|
-
} ; dragIndex.current = null; setDragOver(null); } : undefined, onDragEnd: onReorder ? () => { dragIndex.current = null; setDragOver(null); } : undefined, children: [(item.words ?? []).map((w, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx("div", { className: "word-table-block__pair-divider" }), _jsx(WordCell, { outerScale: scale, label: w.label, subLabel: w.subLabel, colloquialLabel: w.colloquialLabel, captionLabel: w.captionLabel, homonum: w.homonum, showWord: show.word, showImage: show.image, showPronunciation: show.pron, showColloquial: show.colloq, buttonSize: buttonSize, wordInfo: (w.grade || w.syllables != null || w.pos || w.wordType) ? { grade: w.grade, syllables: w.syllables, pos: w.pos, wordType: w.wordType } : undefined })] }, i))), scoring && renderScore(index, (item.words ?? []).map(w => w.label).join(' / ')), onReorder && (
|
|
554
|
-
/*
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
582
|
+
} ; dragIndex.current = null; setDragOver(null); } : undefined, onDragEnd: onReorder ? () => { dragIndex.current = null; setDragOver(null); } : undefined, children: [(item.words ?? []).map((w, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx("div", { className: "word-table-block__pair-divider" }), _jsx(WordCell, { outerScale: scale, label: w.label, subLabel: w.subLabel, colloquialLabel: w.colloquialLabel, captionLabel: w.captionLabel, captionBadge: w.captionBadge, homonum: w.homonum, showWord: show.word, showImage: show.image, showPronunciation: show.pron, showColloquial: show.colloq, buttonSize: buttonSize, wordInfo: (w.grade || w.syllables != null || w.pos || w.wordType) ? { grade: w.grade, syllables: w.syllables, pos: w.pos, wordType: w.wordType } : undefined })] }, i))), scoring && renderScore(index, (item.words ?? []).map(w => w.label).join(' / ')), (renderCellAction || onRemoveItem || onReorder) && (
|
|
583
|
+
/* **오른쪽 기둥** — 빼기 → 부르는 쪽이 얹은 것 → 옮기기 손잡이 차례로 쌓인다
|
|
584
|
+
(말귀 청 (331), 2026-10-28). 전에는 빼기와 얹은 것만 **한 줄**로 서고
|
|
585
|
+
손잡이는 왼쪽 위에 따로 섰다 — 재생 단추와 **같은 자리라 겹쳤다.**
|
|
586
|
+
사장님이 세 번 세로를 이르셔서(2026-09-25 *"핸들은 닫기 버튼 아래에"* ·
|
|
587
|
+
09-27 *"닫기와 핸들 사이"* · 10-12 *"다른 쌍으로 버튼과 정보 버튼이 같은
|
|
588
|
+
높이에"*) 앱이 줄 밖으로 하나씩 꺼내 **숫자로 쌓아** 두었는데, 그 숫자가
|
|
589
|
+
단어표에 맞춘 것이라 끼어들 단추가 없는 표에서 구멍이 났다(활용표: ✕ 밑이
|
|
590
|
+
48px 비고 손잡이만 홀로 내려가 있었다).
|
|
591
|
+
**자리를 수로 못 박지 않는다** — 쌓아서 세우면 몇 개가 들든 붙어 선다. */
|
|
592
|
+
_jsxs("div", { className: "word-table-block__card-actions", children: [onRemoveItem && (_jsx("div", { className: "word-table-block__card-close", children: _jsx(Button, { htmlType: "button", size: buttonSize, type: "dot", icon: "x", variant: "transparent-lightGray", useBorder: false, showTooltipInfo: (item.words ?? []).length > 1 ? t('wordPrint.removePair', '대립쌍 빼기') : t('wordPrint.removeWord', '단어 빼기'), ariaLabel: (item.words ?? []).length > 1 ? t('wordPrint.removePair', '대립쌍 빼기') : t('wordPrint.removeWord', '단어 빼기'), onClick: () => onRemoveItem(item.id) }) })), renderCellAction?.(index, item), onReorder && (
|
|
593
|
+
/* **옮기기 손잡이.** 키보드로 순서를 바꾸려면 초점이 갈 자리가 있어야 하는데,
|
|
594
|
+
칸 자체를 초점 대상으로 만들면 칸마다 뜻 없는 탭 정지점이 하나씩 늘고
|
|
595
|
+
낭독기는 그것이 무엇인지 말할 수 없다. 이름 붙은 진짜 단추를 둔다 —
|
|
596
|
+
"끌 수 있다"는 것을 눈으로도 알려 주는 몫까지 겸한다.
|
|
597
|
+
기둥 **맨 아래**가 사장님이 이르신 차례다. */
|
|
598
|
+
_jsx("div", { className: "word-table-block__card-handle", children: _jsx(Button, { htmlType: "button", size: buttonSize, type: "dot", icon: "grip-vertical", variant: "transparent-lightGray", useBorder: false, showTooltipInfo: t('wordTable.reorder.hint', 'Alt + ← → 로 순서 바꾸기'),
|
|
599
|
+
/* 표에 손잡이가 열둘이면 "버튼" 만으로는 어느 칸인지 알 길이 없다 — 낱말을 이름에 넣는다 */
|
|
600
|
+
ariaLabel: t('wordTable.reorder.handle', {
|
|
601
|
+
word: (item.words ?? []).map(w => w.label).join(' / '),
|
|
602
|
+
defaultValue: '{{word}} 순서 바꾸기 (Alt + 화살표)',
|
|
603
|
+
}) }) }))] }))] }, index))), Array.from({ length: Math.max(0, itemCols * itemRows - (items?.length ?? 0)) }).map((_, i) => {
|
|
604
|
+
const isWithinCount = (items?.length ?? 0) + i < (addableCount ?? cellCount);
|
|
567
605
|
return (_jsx("div", { className: "word-table-block__card word-table-block__card--filler", children: showFillerAdd && onActivateCell && isWithinCount && (_jsx("div", { style: counterScale, children: _jsx(Button, { htmlType: "button", size: buttonSize, type: "bar", icon: "plus", label: t('wordTable.addWord', '추가하기'), onClick: () => onActivateCell((items?.length ?? 0) + i) }) })) }, `filler-${i}`));
|
|
568
606
|
})] })), showTopBand && (_jsx(_Fragment, { children: _jsxs("div", { className: "word-table__band word-table__band--top", children: [_jsx("img", { className: "word-table__brand-logo", src: brand?.topLogo?.src ?? speechearLogo, alt: brand?.topLogo?.alt ?? '말귀' }), (() => {
|
|
569
607
|
/* 표 제목 · 기관 이름 · 표 번호 — 있는 것끼리만 가운뎃점으로 잇는다
|
|
@@ -90,6 +90,23 @@ export interface ButtonProps {
|
|
|
90
90
|
/** 이 단추가 여닫는 영역의 id — `aria-controls` 로 단다(`ariaExpanded` 와 함께 쓴다) */
|
|
91
91
|
ariaControls?: string;
|
|
92
92
|
disabled?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* **기다리는 중** — 아이콘 자리에 도는 표시(`Loader variant="spinner"`)가 서고 다시 눌리지 않는다.
|
|
95
|
+
*
|
|
96
|
+
* 소리 단추가 쥐는 때는 **셋**인데 꼴은 둘뿐이었다 — `재생`/`멈춤` 만 있고 *받아 오는 중*
|
|
97
|
+
* 이 없었다(말귀 청 (330), 2026-10-28). 음원이 없는 낱말은 누른 뒤 합성을 기다리는데
|
|
98
|
+
* (실측 처음 3,567ms · 캐시가 있을 때 772ms), 그동안 단추가 곧바로 '멈춤' 이 되어
|
|
99
|
+
* **눌렀는데 멈춰 있는** 꼴로 보였다.
|
|
100
|
+
*
|
|
101
|
+
* **보이는 꼴만 바꾼다 — 손은 그대로 받는다.** 막으려면 `disabled` 를 함께 준다.
|
|
102
|
+
*
|
|
103
|
+
* 막는 것까지 여기 묶지 않은 까닭은, 기다리는 단추를 누르는 뜻이 자리마다 갈려서다.
|
|
104
|
+
* 저장 단추는 **아무 일도 안 나야** 하고(두 번 누르면 두 번 저장된다), 소리 단추는
|
|
105
|
+
* **기다림을 접어야** 한다(옆 칸을 누르거나 마음이 바뀐다). 하나의 참/거짓으로 둘을 다
|
|
106
|
+
* 말할 수 없다 — 그래서 *보이는 꼴*만 맡고, 막는 일은 이미 그 일을 하는 `disabled` 에
|
|
107
|
+
* 둔다. 빠져나갈 구멍을 하나 더 뚫는 것보다 **뜻이 하나씩인 쪽**이 낫다.
|
|
108
|
+
*/
|
|
109
|
+
loading?: boolean;
|
|
93
110
|
/** label을 숨기려면 false로 설정 */
|
|
94
111
|
useLabel?: boolean;
|
|
95
112
|
useBorder?: boolean;
|
|
@@ -15,6 +15,17 @@ export interface WordSearchResultWord {
|
|
|
15
15
|
* (말귀가 활용표를 옮기며 실측 2026-10-27).
|
|
16
16
|
*/
|
|
17
17
|
captionLabel?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 이름표 앞에 서는 **배지** — `captionLabel` 과 한 줄로 낱말 **위**에 선다.
|
|
20
|
+
*
|
|
21
|
+
* 활용표의 이름표가 성격이 다른 둘이 되어서다(말귀 청 (328), 2026-10-28 사장님 지시
|
|
22
|
+
* *"양보 는 badge 로 표현하도록"*). `양보` 는 **무엇을 하는 말인가** — 치료사가 꼴을
|
|
23
|
+
* 고르는 잣대다. `-아/어도` 는 **어떤 꼬리가 붙는가** — 학습자가 낼 소리다. 한 글자로
|
|
24
|
+
* 붙여 놓으면 그 둘이 안 갈린다.
|
|
25
|
+
*
|
|
26
|
+
* 배지만 주거나 이름표만 줘도 된다. 둘 다 없으면 아무것도 안 선다.
|
|
27
|
+
*/
|
|
28
|
+
captionBadge?: string;
|
|
18
29
|
homonum?: number;
|
|
19
30
|
grade?: string;
|
|
20
31
|
syllables?: number;
|