@ihabdevteam/core 0.394.0 → 0.396.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 +87 -0
- package/dist/components.cjs.js +170 -170
- package/dist/hooks.cjs.js +5 -5
- package/dist/i18n.cjs.js +3 -3
- package/dist/ihabdevteam-core.cjs.js +175 -175
- package/dist/ihabdevteam-core.d.ts +15 -1
- package/dist/packages/core/src/components/Badge.d.ts +14 -0
- package/dist/packages/core/src/components/Badge.js +10 -2
- package/dist/packages/core/src/components/WordTable.js +23 -2
- package/dist/packages/core/src/i18n/locales/en.json +3 -1
- package/dist/packages/core/src/i18n/locales/ko.json +3 -1
- package/dist/packages/core/src/version.d.ts +1 -1
- package/dist/packages/core/src/version.js +1 -1
- package/dist/utils.cjs.js +26 -26
- package/package.json +1 -1
|
@@ -247,6 +247,20 @@ export declare interface BadgeProps {
|
|
|
247
247
|
* 단추 이름을 "숙제, 3개" 로 짓고 뱃지는 숨긴다. 주면 `aria-label` 보다 이긴다.
|
|
248
248
|
*/
|
|
249
249
|
'aria-hidden'?: boolean;
|
|
250
|
+
/**
|
|
251
|
+
* 낭독기에 **끼어들게** 한다 — `alert`(실패·경고) · `status`(됨·진행).
|
|
252
|
+
*
|
|
253
|
+
* 띠를 *일이 어떻게 됐는지 말하는 줄*로 쓰는 자리에서 준다(말귀 청 (347), 2026-10-28).
|
|
254
|
+
* 안 주면 전과 똑같다 — `aria-label` 이 있으면 `img`, 없으면 역할이 없다.
|
|
255
|
+
*
|
|
256
|
+
* **한 가지 알아 둘 것** — `alert` · `status` 는 그 줄이 **새로 나타나거나 글자가 바뀔 때**
|
|
257
|
+
* 읽힌다. 처음부터 떠 있는 줄은 낭독기가 안 읽는 것이 보통이다. 눌러서 결과가 뜨는 자리면
|
|
258
|
+
* 맞고, 화면을 열 때 이미 서 있는 줄이면 글자를 곁의 이름에 넣는 편이 낫다.
|
|
259
|
+
*
|
|
260
|
+
* `aria-hidden` 과 함께 주면 **아무것도 안 읽힌다** — 숨긴 것은 끼어들 수 없다.
|
|
261
|
+
* 개발 모드에서 한 번 이른다.
|
|
262
|
+
*/
|
|
263
|
+
role?: string;
|
|
250
264
|
label?: string;
|
|
251
265
|
children?: ReactNode;
|
|
252
266
|
/**
|
|
@@ -1902,7 +1916,7 @@ export declare function copyText(text: string): Promise<boolean>;
|
|
|
1902
1916
|
*
|
|
1903
1917
|
* 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
|
|
1904
1918
|
*/
|
|
1905
|
-
export declare const CORE_VERSION = "0.
|
|
1919
|
+
export declare const CORE_VERSION = "0.396.0";
|
|
1906
1920
|
|
|
1907
1921
|
/** @public */
|
|
1908
1922
|
declare const coreDefault: Record<string, unknown>;
|
|
@@ -50,6 +50,20 @@ export interface BadgeProps {
|
|
|
50
50
|
* 단추 이름을 "숙제, 3개" 로 짓고 뱃지는 숨긴다. 주면 `aria-label` 보다 이긴다.
|
|
51
51
|
*/
|
|
52
52
|
'aria-hidden'?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* 낭독기에 **끼어들게** 한다 — `alert`(실패·경고) · `status`(됨·진행).
|
|
55
|
+
*
|
|
56
|
+
* 띠를 *일이 어떻게 됐는지 말하는 줄*로 쓰는 자리에서 준다(말귀 청 (347), 2026-10-28).
|
|
57
|
+
* 안 주면 전과 똑같다 — `aria-label` 이 있으면 `img`, 없으면 역할이 없다.
|
|
58
|
+
*
|
|
59
|
+
* **한 가지 알아 둘 것** — `alert` · `status` 는 그 줄이 **새로 나타나거나 글자가 바뀔 때**
|
|
60
|
+
* 읽힌다. 처음부터 떠 있는 줄은 낭독기가 안 읽는 것이 보통이다. 눌러서 결과가 뜨는 자리면
|
|
61
|
+
* 맞고, 화면을 열 때 이미 서 있는 줄이면 글자를 곁의 이름에 넣는 편이 낫다.
|
|
62
|
+
*
|
|
63
|
+
* `aria-hidden` 과 함께 주면 **아무것도 안 읽힌다** — 숨긴 것은 끼어들 수 없다.
|
|
64
|
+
* 개발 모드에서 한 번 이른다.
|
|
65
|
+
*/
|
|
66
|
+
role?: string;
|
|
53
67
|
label?: string;
|
|
54
68
|
children?: ReactNode;
|
|
55
69
|
/**
|
|
@@ -16,7 +16,7 @@ export default function Badge(props) {
|
|
|
16
16
|
const {
|
|
17
17
|
/* **기본값이 알약이다**(2026-10-28) — 전 기본값이 그리던 그림 그대로라, `type` 을 안 적은
|
|
18
18
|
자리(코어·앱 합쳐 쉰 곳 남짓)는 가만히 있는다. */
|
|
19
|
-
type = 'dot', size, className = '', 'aria-label': ariaLabel, 'aria-hidden': ariaHidden, } = props;
|
|
19
|
+
type = 'dot', size, className = '', 'aria-label': ariaLabel, 'aria-hidden': ariaHidden, role, } = props;
|
|
20
20
|
/**
|
|
21
21
|
* **옛 원형 뱃지의 프롭이 오면 한 번 이른다**(2026-10-28).
|
|
22
22
|
*
|
|
@@ -31,6 +31,12 @@ export default function Badge(props) {
|
|
|
31
31
|
'원형은 이제 CircleBadge 가 그립니다 — Badge 의 dot 는 작은 알약 이름표입니다. ' +
|
|
32
32
|
'그 자리를 <CircleBadge …/> 로 바꾸세요.');
|
|
33
33
|
}
|
|
34
|
+
/* **숨긴 것은 끼어들 수 없다** — 둘을 같이 주면 `alert` 가 조용히 아무 일도 안 한다.
|
|
35
|
+
타입으로는 못 막는다(둘 다 멀쩡한 프롭이다). 개발 모드에서 이른다. */
|
|
36
|
+
if (role && ariaHidden) {
|
|
37
|
+
devWarnOnce('badge-role-with-hidden', `[ihab/core] Badge 가 role="${role}" 과 aria-hidden 을 함께 받았습니다. ` +
|
|
38
|
+
'숨긴 것은 낭독기에 끼어들 수 없어 아무것도 안 읽힙니다 — 둘 중 하나만 주세요.');
|
|
39
|
+
}
|
|
34
40
|
// ── 그리기 — `dot`(알약) · `bar`(띠) 가 같은 색·같은 자를 쓴다 ───────────
|
|
35
41
|
const { label, children, variant = 'default', fill = 'filled', minWidth, iconLeft, iconRight, color } = props;
|
|
36
42
|
/* 넓게 눕는 띠인가 — 아니면 작은 알약이다(기본) */
|
|
@@ -61,5 +67,7 @@ export default function Badge(props) {
|
|
|
61
67
|
return (
|
|
62
68
|
// aria-label 을 받아 놓고 bar 에서는 버렸다 — dot 과 같이 건넨다. 이름만 두면 역할 없는
|
|
63
69
|
// span 이라 낭독기가 무시하므로 이름이 있을 때만 role="img" 를 붙인다(안 주면 예전 그대로).
|
|
64
|
-
|
|
70
|
+
/* 준 `role` 이 **스스로 짓는 `img` 를 이긴다** — 띠를 말하는 줄로 쓰는 자리가 그것이다.
|
|
71
|
+
안 주면 전과 한 글자도 안 달라진다(청 (347)). */
|
|
72
|
+
_jsxs("span", { className: cls, style: style, "aria-label": ariaHidden ? undefined : ariaLabel, role: role ?? (ariaLabel && !ariaHidden ? 'img' : undefined), "aria-hidden": ariaHidden || undefined, children: [iconLeft && _jsx(Icon, { icon: iconLeft, size: iconSize, className: "badge__icon" }), label ?? children, iconRight && _jsx(Icon, { icon: iconRight, size: iconSize, className: "badge__icon" })] }));
|
|
65
73
|
}
|
|
@@ -281,6 +281,27 @@ export default function WordTable({ title, titleIcon, disc, className, orientati
|
|
|
281
281
|
const clickMark = useCallback((cellIndex, clicked) => {
|
|
282
282
|
onMarkClick?.(scoreIndexOffset + cellIndex, clicked);
|
|
283
283
|
}, [onMarkClick, scoreIndexOffset]);
|
|
284
|
+
/**
|
|
285
|
+
* **✕ 가 무엇을 빼는지 말한다**(말귀 청 (348), 2026-10-29).
|
|
286
|
+
*
|
|
287
|
+
* 칸의 단추 넷 가운데 셋은 이미 낱말을 단다(`불러요 재생` · `불러요 낱말 정보` ·
|
|
288
|
+
* `불러요 순서 바꾸기`). ✕ 만 `단어 빼기` 한 글자라, 활용표 한 표에서 **열여덟이 다 같은
|
|
289
|
+
* 이름**이었다(말귀 실측). **지우는 단추**라 듣는 사람은 무엇을 지우는지 모르고 누른다.
|
|
290
|
+
*
|
|
291
|
+
* 떠오르는 풍선(`showTooltipInfo`)은 그대로 둔다 — 마우스를 올린 칸 **옆에** 뜨므로 어느
|
|
292
|
+
* 칸인지가 이미 보인다. 낱말이 없는 자리(빈 칸·`filler`)도 전 글자 그대로다.
|
|
293
|
+
*
|
|
294
|
+
* 짝인지 아닌지는 **칸의 수**로 가른다 — 이름으로 가르면 둘 중 하나가 빈 칸에서
|
|
295
|
+
* `대립쌍` 이 조용히 `단어` 가 된다.
|
|
296
|
+
*/
|
|
297
|
+
const removeAriaLabel = (names, isPair) => {
|
|
298
|
+
const name = names.filter(Boolean).join(' / ');
|
|
299
|
+
if (!name)
|
|
300
|
+
return isPair ? t('wordPrint.removePair', '대립쌍 빼기') : t('wordPrint.removeWord', '단어 빼기');
|
|
301
|
+
return isPair
|
|
302
|
+
? t('wordPrint.removePairFor', { name, defaultValue: `${name} 대립쌍 빼기` })
|
|
303
|
+
: t('wordPrint.removeWordFor', { name, defaultValue: `${name} 빼기` });
|
|
304
|
+
};
|
|
284
305
|
/* 칸 하나에 붙는 채점 표시. **대립쌍표는 한 칸이 낱말 둘이지만 시행은 한 번**이라
|
|
285
306
|
낱말이 아니라 칸에 매긴다(`wordTableScoring` 참고). */
|
|
286
307
|
const renderScore = (cellIndex, cellLabel) => {
|
|
@@ -622,7 +643,7 @@ export default function WordTable({ title, titleIcon, disc, className, orientati
|
|
|
622
643
|
gridTemplateRows: `repeat(${rows}, 1fr)`,
|
|
623
644
|
}, children: [isEdit ? (_jsx(_Fragment, { children: (editCells ?? []).map((cell, i) => (_jsx("div", { className: withLegacy(cx('word-table__edit-cell', cell ? 'word-table__edit-cell--filled' : 'word-table__edit-cell--empty', activeCell === i ? 'word-table__edit-cell--active' : '')), style: dotDashStyle(i, cols, rows, cutLine), children: cell ? (_jsxs(_Fragment, { children: [cell.map((e, wi) => (_jsxs(Fragment, { children: [wi > 0 && _jsx("div", { className: withLegacy("word-table__pair-divider") }), _jsx(WordCell, { outerScale: scale, label: e.word, subLabel: e.pronunciation,
|
|
624
645
|
// 편집 칸도 구어체 발음을 넘긴다 — 빠져 있어 '구어체 발음'을 켜도 편집 모드에서만 비었다.
|
|
625
|
-
colloquialLabel: e.colloquialPronunciation, homonum: e.homonum, showWord: show.word, showImage: show.image, showPronunciation: show.pron, showColloquial: show.colloq, showCaption: show.caption, buttonSize: buttonSize })] }, wi))), scoring && renderScore(i, cell.map(e => e.word).join(' / ')), onRemoveCell && (_jsx("div", { className: withLegacy("word-table__card-close"), children: _jsx(Button, { htmlType: "button", size: buttonSize, type: "dot", icon: "x", variant: "transparent-lightGray", useBorder: false, showTooltipInfo: cell.length > 1 ? t('wordPrint.removePair', '대립쌍 빼기') : t('wordPrint.removeWord', '단어 빼기'), ariaLabel: cell.
|
|
646
|
+
colloquialLabel: e.colloquialPronunciation, homonum: e.homonum, showWord: show.word, showImage: show.image, showPronunciation: show.pron, showColloquial: show.colloq, showCaption: show.caption, buttonSize: buttonSize })] }, wi))), scoring && renderScore(i, cell.map(e => e.word).join(' / ')), onRemoveCell && (_jsx("div", { className: withLegacy("word-table__card-close"), children: _jsx(Button, { htmlType: "button", size: buttonSize, type: "dot", icon: "x", variant: "transparent-lightGray", useBorder: false, showTooltipInfo: cell.length > 1 ? t('wordPrint.removePair', '대립쌍 빼기') : t('wordPrint.removeWord', '단어 빼기'), ariaLabel: removeAriaLabel(cell.map(e => e.word), cell.length > 1), onClick: () => onRemoveCell(i) }) }))] })) : (onActivateCell && (_jsx("div", { style: counterScale, children: _jsx(Button, { htmlType: "button", size: buttonSize, type: "dot", icon: "plus", variant: "default", ariaLabel: t('wordTable.addWord', '추가하기'), showTooltipInfo: t('wordTable.addWord', '추가하기'), onClick: () => onActivateCell(i) }) }))) }, i))) })) : (_jsxs(_Fragment, { children: [hasBase && baseItem && (
|
|
626
647
|
/* 걸치는 자리는 양쪽이 같은 식이다 — 가로면 왼쪽 `half.cols` 열 × 전체 `half.rows` 줄,
|
|
627
648
|
세로면 전체 `half.cols` 열 × 위 `half.rows` 줄. 둘 다 `1 / span` 으로 같게 적힌다. */
|
|
628
649
|
_jsx("div", { className: withLegacy("word-table__card word-table__card--base"), style: {
|
|
@@ -642,7 +663,7 @@ export default function WordTable({ title, titleIcon, disc, className, orientati
|
|
|
642
663
|
단어표에 맞춘 것이라 끼어들 단추가 없는 표에서 구멍이 났다(활용표: ✕ 밑이
|
|
643
664
|
48px 비고 손잡이만 홀로 내려가 있었다).
|
|
644
665
|
**자리를 수로 못 박지 않는다** — 쌓아서 세우면 몇 개가 들든 붙어 선다. */
|
|
645
|
-
_jsxs("div", { className: withLegacy("word-table__card-actions"), children: [onRemoveItem && (_jsx("div", { className: withLegacy("word-table__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 ?? []).
|
|
666
|
+
_jsxs("div", { className: withLegacy("word-table__card-actions"), children: [onRemoveItem && (_jsx("div", { className: withLegacy("word-table__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: removeAriaLabel((item.words ?? []).map(w => w.label), (item.words ?? []).length > 1), onClick: () => onRemoveItem(item.id) }) })), onCopyItem && (
|
|
646
667
|
/* **빼기 바로 아래** — 사장님이 화면에서 그 자리에 두셨다.
|
|
647
668
|
꼴은 위아래 이웃과 **한 글자도 안 다르다**(`type="dot"` ·
|
|
648
669
|
`transparent-lightGray` · `useBorder={false}`). 셋을 한자리에 적어 두는
|
|
@@ -747,7 +747,9 @@
|
|
|
747
747
|
"clearAllSelection": "Clear All Selections",
|
|
748
748
|
"divLine": "Contrast Line",
|
|
749
749
|
"removePair": "Remove pair",
|
|
750
|
-
"
|
|
750
|
+
"removePairFor": "Remove the pair {{name}}",
|
|
751
|
+
"removeWord": "Remove word",
|
|
752
|
+
"removeWordFor": "Remove {{name}}"
|
|
751
753
|
},
|
|
752
754
|
"topic": {
|
|
753
755
|
"title": "By Topic",
|
|
@@ -734,7 +734,9 @@
|
|
|
734
734
|
"clearAllSelection": "모두 선택 해제",
|
|
735
735
|
"divLine": "대립선",
|
|
736
736
|
"removePair": "대립쌍 빼기",
|
|
737
|
-
"
|
|
737
|
+
"removePairFor": "{{name}} 대립쌍 빼기",
|
|
738
|
+
"removeWord": "단어 빼기",
|
|
739
|
+
"removeWordFor": "{{name}} 빼기"
|
|
738
740
|
},
|
|
739
741
|
"topic": {
|
|
740
742
|
"title": "주제별 듣기",
|