@ihabdevteam/core 0.388.0 → 0.390.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 (32) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/dist/components.cjs.js +174 -174
  3. package/dist/components.esm.css +1 -1
  4. package/dist/hooks.cjs.js +5 -5
  5. package/dist/i18n.cjs.js +3 -3
  6. package/dist/ihabdevteam-core.cjs.js +40 -40
  7. package/dist/ihabdevteam-core.d.ts +87 -42
  8. package/dist/packages/core/src/components/Badge.css +27 -0
  9. package/dist/packages/core/src/components/Badge.d.ts +29 -31
  10. package/dist/packages/core/src/components/Badge.js +25 -49
  11. package/dist/packages/core/src/components/BottomNav.js +3 -3
  12. package/dist/packages/core/src/components/CircleBadge.d.ts +45 -11
  13. package/dist/packages/core/src/components/CircleBadge.js +58 -7
  14. package/dist/packages/core/src/components/Header.js +2 -2
  15. package/dist/packages/core/src/components/SideNav.js +3 -3
  16. package/dist/packages/core/src/components/Tooltip/MenuTooltip.js +2 -2
  17. package/dist/packages/core/src/components/Training/TrainingBlockButton.js +2 -2
  18. package/dist/packages/core/src/components/Training/TrainingWordCard.js +2 -2
  19. package/dist/packages/core/src/hooks/useWordAttributeFilter.js +27 -4
  20. package/dist/packages/core/src/i18n/locales/en.json +6 -1
  21. package/dist/packages/core/src/i18n/locales/ko.json +6 -1
  22. package/dist/packages/core/src/utils/phonemePairSearch.d.ts +2 -0
  23. package/dist/packages/core/src/utils/phonemePairSearch.js +1 -1
  24. package/dist/packages/core/src/utils/phonemePairSearchTypes.d.ts +12 -0
  25. package/dist/packages/core/src/utils/wordAttributeFilterCodes.d.ts +11 -1
  26. package/dist/packages/core/src/utils/wordAttributeFilterCodes.js +50 -8
  27. package/dist/packages/core/src/utils/wordTrainingPool.d.ts +3 -1
  28. package/dist/packages/core/src/utils/wordTrainingPool.js +2 -2
  29. package/dist/packages/core/src/version.d.ts +1 -1
  30. package/dist/packages/core/src/version.js +1 -1
  31. package/dist/utils.cjs.js +3 -3
  32. package/package.json +1 -1
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import './SideNav.css';
4
4
  import Icon from './Icon';
5
5
  import Button from './Button';
6
- import Badge from './Badge';
6
+ import CircleBadge from './CircleBadge';
7
7
  import React, { useCallback, useEffect, useRef, useState } from 'react';
8
8
  import { useTranslation } from 'react-i18next';
9
9
  import { isSafeOpenHref } from '../utils/safeHref';
@@ -26,7 +26,7 @@ function SideNavFooter(props) {
26
26
  // 하나도 없으면 바닥 자체를 비운다 — 빈 채로 두면 여백(margin-top + padding)만 남는다.
27
27
  if (!hasAny)
28
28
  return null;
29
- return (_jsxs("div", { className: "side-nav__footer", children: [onDebug && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "terminal", ariaLabel: t('nav.debug', '디버그'), onClick: onDebug, selected: activeKey === 'debug' })), onNotification && (_jsxs("span", { className: "side-nav__notification-wrap", children: [_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "bell", ariaLabel: nameWithCount(t, t('nav.notifications', '알림'), unreadCount), onClick: onNotification, selected: activeKey === 'notifications' }), !!unreadCount && unreadCount > 0 && (_jsx(Badge, { type: "dot", number: Math.min(unreadCount, 99), size: 24, "aria-hidden": true }))] })), onSetting && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "settings", ariaLabel: t('nav.settings', '설정'), onClick: onSetting, selected: activeKey === 'settings' })), onHelp && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "message-circle-question-mark", ariaLabel: t('nav.help', '도움말'), onClick: onHelp, selected: activeKey === 'help' })), onFeedback && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "bug", ariaLabel: t('nav.feedback', '버그신고'), onClick: onFeedback, selected: activeKey === 'feedback' })), onAccount && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "user-round", ariaLabel: t('nav.account', '계정'), onClick: onAccount, selected: activeKey === 'account' }))] }));
29
+ return (_jsxs("div", { className: "side-nav__footer", children: [onDebug && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "terminal", ariaLabel: t('nav.debug', '디버그'), onClick: onDebug, selected: activeKey === 'debug' })), onNotification && (_jsxs("span", { className: "side-nav__notification-wrap", children: [_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "bell", ariaLabel: nameWithCount(t, t('nav.notifications', '알림'), unreadCount), onClick: onNotification, selected: activeKey === 'notifications' }), !!unreadCount && unreadCount > 0 && (_jsx(CircleBadge, { number: Math.min(unreadCount, 99), size: 24, "aria-hidden": true }))] })), onSetting && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "settings", ariaLabel: t('nav.settings', '설정'), onClick: onSetting, selected: activeKey === 'settings' })), onHelp && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "message-circle-question-mark", ariaLabel: t('nav.help', '도움말'), onClick: onHelp, selected: activeKey === 'help' })), onFeedback && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "bug", ariaLabel: t('nav.feedback', '버그신고'), onClick: onFeedback, selected: activeKey === 'feedback' })), onAccount && (_jsx(Button, { htmlType: "button", size: 48, showTooltipInfo: true, type: "dot", shape: "pill", variant: variant, icon: "user-round", ariaLabel: t('nav.account', '계정'), onClick: onAccount, selected: activeKey === 'account' }))] }));
30
30
  }
31
31
  function SideNavButton(props) {
32
32
  const { t } = useTranslation();
@@ -53,7 +53,7 @@ function SideNavButton(props) {
53
53
  }
54
54
  onClick?.(key, e.currentTarget, fromPointer);
55
55
  }, [isDisabled, key, onClick]);
56
- return (_jsxs("button", { type: "button", className: btnClass, onClick: handleClick, "aria-label": typeof text === 'string' ? nameWithCount(t, text, badgeCount) : undefined, "aria-current": active ? 'page' : undefined, style: style, "aria-disabled": isDisabled, children: [iconElement, _jsx("span", { className: `side-nav__label button-1 f`, style: labelStyle, children: text }), badgeCount > 0 && (_jsx(Badge, { type: "dot", position: "inline", number: Math.min(badgeCount, 99), size: 24, "aria-hidden": true })), state === 'loading' && (_jsx("span", { className: "side-nav__spinner", role: "img", "aria-label": t('loader.loading', '불러오는 중…') }))] }));
56
+ return (_jsxs("button", { type: "button", className: btnClass, onClick: handleClick, "aria-label": typeof text === 'string' ? nameWithCount(t, text, badgeCount) : undefined, "aria-current": active ? 'page' : undefined, style: style, "aria-disabled": isDisabled, children: [iconElement, _jsx("span", { className: `side-nav__label button-1 f`, style: labelStyle, children: text }), badgeCount > 0 && (_jsx(CircleBadge, { position: "inline", number: Math.min(badgeCount, 99), size: 24, "aria-hidden": true })), state === 'loading' && (_jsx("span", { className: "side-nav__spinner", role: "img", "aria-label": t('loader.loading', '불러오는 중…') }))] }));
57
57
  }
58
58
  /** @public */
59
59
  export default function SideNav(props) {
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Fragment, useCallback, useMemo, useState, useEffect, useRef } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import Button from '../Button';
6
- import Badge from '../Badge';
6
+ import CircleBadge from '../CircleBadge';
7
7
  import './MenuTooltip.css';
8
8
  import { withLegacy } from '../../utils/legacyBlocks';
9
9
  /** @public */
@@ -85,7 +85,7 @@ export default function MenuTooltip({ columns = [], onClose, className = '', siz
85
85
  return (_jsxs("div", { className: withLegacy(`menu-tooltip menu-tooltip--${size} ${className}`), children: [(stack.length > 1 || current.title) && (_jsxs("div", { className: withLegacy("menu-tooltip__header"), children: [stack.length > 1 ? (_jsx(Button, { htmlType: "button", size: itemSize, type: "dot", icon: "chevron-left", ariaLabel: t('common.back', '뒤로'), onClick: goBack, variant: "transparent-gray", useBorder: false })) : null, _jsx("div", { className: withLegacy("menu-tooltip__title button-1"), children: current.title })] })), _jsx("div", { className: withLegacy("menu-tooltip__columns"), ref: itemsWrapRef, children: current.columns && current.columns.map((col, ci) => (_jsxs("div", { className: withLegacy("menu-tooltip__column"), children: [col.title ? _jsx("div", { className: withLegacy("menu-tooltip__column-title body-3"), children: col.title }) : null, _jsx("div", { className: withLegacy("menu-tooltip__items"), children: (col.items || []).map((item, idx) => (_jsxs(Fragment, { children: [item.separatorBefore && idx > 0 && _jsx("div", { className: withLegacy("menu-tooltip__separator"), role: "separator" }), _jsx(Button, { htmlType: "button", className: withLegacy("menu-tooltip__item"), size: itemSize, type: item.label ? 'bar' : 'dot', icon: item.selected ? 'check' : (item.icon || 'none'), rightIcon: Array.isArray(item.children) && item.children.length
86
86
  ? 'chevron-right'
87
87
  : item.badgeCount
88
- ? _jsx(Badge, { type: "dot", position: "inline", number: Math.min(item.badgeCount, 99), size: 24, "aria-hidden": true })
88
+ ? _jsx(CircleBadge, { position: "inline", number: Math.min(item.badgeCount, 99), size: 24, "aria-hidden": true })
89
89
  : undefined, label: item.label,
90
90
  /* 개수는 이름에 붙인다 — ariaLabel 이 글자뿐이라 배지 수가 이름에서 빠져 "알림" 으로만 읽혔다
91
91
  (SideNav·BottomNav 와 같은 nav.badgeLabel "알림, 5개"). */
@@ -9,7 +9,7 @@ import Button from '../Button';
9
9
  import CategoryIcon from './CategoryIcon';
10
10
  import InfoTooltip from '../Tooltip/InfoTooltip';
11
11
  import DescriptionTooltip from '../Tooltip/DescriptionTooltip';
12
- import Badge from '../Badge';
12
+ import CircleBadge from '../CircleBadge';
13
13
  import { useWindowEvent } from '../../hooks/useWindowEvent';
14
14
  import './TrainingBlockButton.css';
15
15
  import { useAudioPreview } from './useAudioPreview';
@@ -213,7 +213,7 @@ export default function TrainingBlockButton(props) {
213
213
  .map(x => String(x ?? '').trim()).filter(Boolean).join(' ');
214
214
  return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: btnRef, className: `training-block-button${isList ? ' training-block-button--list' : ''}${isRow ? ' training-block-button--row' : ''}${isCompact ? ' training-block-button--compact' : ''}${isSmall ? ' training-block-button--small' : ''}${isCompleted ? ' training-block-button--completed' : ''}${isSelected ? ' training-block-button--selected' : ''}${typeLabelRendered && !isSmall ? ' training-block-button--withType' : ''}${isSmall && !typeLabelRendered ? ' training-block-button--no-type-label' : ''}`, onClick: handleActivate, onPointerEnter: handleBtnHoverOn, onPointerLeave: handleBtnHoverClose, role: "button", tabIndex: 0, onKeyDown: handleKeyDown, "aria-label": typeof ariaLabel === 'string' ? ariaLabel : (ariaParts || undefined),
215
215
  /* tooltipText 만 주고 useDescriptionTooltip 을 안 켜면 글이 어디에도 안 떴다 — 그때는 title(가리키면 뜨고 낭독기엔 설명)로 준다 */
216
- title: !useDescriptionTooltip && tooltipText ? (Array.isArray(tooltipText) ? tooltipText.filter(Boolean).join('\n') : tooltipText) || undefined : undefined, children: [_jsxs("div", { className: "training-block-button__left", children: [showTypeLabel && type?.label && type.label !== String(itemTitle) && (_jsx("span", { className: "training-block-button__type-label caption-1", children: type.label })), isSmall && trainingTypeName && trainingTypeName !== String(itemTitle) && (_jsx("span", { className: "training-block-button__type-label caption-2", children: trainingTypeName })), _jsx(CategoryIcon, { icon: iconForBtn, label: itemTitle, tooltip: popupIconTooltip, wrapperStyle: wrapperStyle, iconSize: (isSmall || isCompact) ? 'small' : 'medium' }), !hideCheckBadge && (isCompleted || isSelected) && !(onRemove && btnHover) && (_jsx(Badge, { className: onRemove ? 'training-block-button__check--removable' : undefined, type: "dot", icon: "check", position: "top-left", size: "medium", "aria-label": isCompleted ? t('training.completed', '훈련 완료') : t('training.selected', '선택됨') })), onRemove && (_jsx(Badge, { className: `training-block-button__remove${btnHover ? ' is-hover' : ''}`, type: "dot", icon: "remove", position: "top-left", size: "medium", "aria-label": t('common.remove', '제거'), onClick: handleRemoveClick })), _jsx("div", { className: `training-block-button__title ${isCompact ? 'body-3' : isSmall ? 'body-3b' : 'h3'}`, children: String(itemTitle) }), _jsxs("div", { className: "training-block-button__description", children: [shownCount ? (_jsx("div", { className: `training-block-button__count ${isSmall ? 'caption-2' : 'caption-1'}`, children: shownCount })) : null, _jsx("div", { className: "training-block-button__chevron", children: _jsx(Icon, { icon: "chevron-right", label: t('training.next', '다음'), className: "training-block-button__chevron-icon", imgClassName: "training-block-button__chevron-icon-image", maskClassName: "training-block-button__chevron-icon-mask", svgClassName: "training-block-button__chevron-icon-svg", size: isSmall ? 12 : 20 }) })] }), ((isList && !isRow) || isSmall) && previewUrls.length > 0 && (_jsx("div", { ref: previewBtnRef, className: "training-block-button__preview", "data-tooltip-ignore": true, onClick: handlePreviewAreaClick, onPointerEnter: handlePreviewHoverOn, onPointerLeave: handlePreviewHoverClose, children: _jsx(Button, { htmlType: "button", size: isSmall ? 28 : 32, type: "dot", icon: playing ? 'pause' : 'play', variant: isSmall ? 'transparent-lightGray' : 'default', useBorder: false, selected: playing,
216
+ title: !useDescriptionTooltip && tooltipText ? (Array.isArray(tooltipText) ? tooltipText.filter(Boolean).join('\n') : tooltipText) || undefined : undefined, children: [_jsxs("div", { className: "training-block-button__left", children: [showTypeLabel && type?.label && type.label !== String(itemTitle) && (_jsx("span", { className: "training-block-button__type-label caption-1", children: type.label })), isSmall && trainingTypeName && trainingTypeName !== String(itemTitle) && (_jsx("span", { className: "training-block-button__type-label caption-2", children: trainingTypeName })), _jsx(CategoryIcon, { icon: iconForBtn, label: itemTitle, tooltip: popupIconTooltip, wrapperStyle: wrapperStyle, iconSize: (isSmall || isCompact) ? 'small' : 'medium' }), !hideCheckBadge && (isCompleted || isSelected) && !(onRemove && btnHover) && (_jsx(CircleBadge, { className: onRemove ? 'training-block-button__check--removable' : undefined, icon: "check", position: "top-left", size: 32, "aria-label": isCompleted ? t('training.completed', '훈련 완료') : t('training.selected', '선택됨') })), onRemove && (_jsx(CircleBadge, { className: `training-block-button__remove${btnHover ? ' is-hover' : ''}`, icon: "remove", position: "top-left", size: 32, "aria-label": t('common.remove', '제거'), onClick: handleRemoveClick })), _jsx("div", { className: `training-block-button__title ${isCompact ? 'body-3' : isSmall ? 'body-3b' : 'h3'}`, children: String(itemTitle) }), _jsxs("div", { className: "training-block-button__description", children: [shownCount ? (_jsx("div", { className: `training-block-button__count ${isSmall ? 'caption-2' : 'caption-1'}`, children: shownCount })) : null, _jsx("div", { className: "training-block-button__chevron", children: _jsx(Icon, { icon: "chevron-right", label: t('training.next', '다음'), className: "training-block-button__chevron-icon", imgClassName: "training-block-button__chevron-icon-image", maskClassName: "training-block-button__chevron-icon-mask", svgClassName: "training-block-button__chevron-icon-svg", size: isSmall ? 12 : 20 }) })] }), ((isList && !isRow) || isSmall) && previewUrls.length > 0 && (_jsx("div", { ref: previewBtnRef, className: "training-block-button__preview", "data-tooltip-ignore": true, onClick: handlePreviewAreaClick, onPointerEnter: handlePreviewHoverOn, onPointerLeave: handlePreviewHoverClose, children: _jsx(Button, { htmlType: "button", size: isSmall ? 28 : 32, type: "dot", icon: playing ? 'pause' : 'play', variant: isSmall ? 'transparent-lightGray' : 'default', useBorder: false, selected: playing,
217
217
  /* **칸 이름을 넣는다**(말귀 요청 (54)②, 2026-10-02). 묶음 칸이 스물넷이면
218
218
  낭독기로 단추 목록을 불렀을 때 `미리 듣기` 가 **스물네 번** 선다. 바로 옆
219
219
  '더보기' 는 ㊺ 에서 이미 칸 이름을 달았는데 이쪽만 안 따라왔다 — 고칠 값은
@@ -4,7 +4,7 @@ import { cx } from '../../utils/cx';
4
4
  import { forwardRef, useCallback, useState, useEffect, useImperativeHandle, useRef } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import Button from '../Button';
7
- import Badge from '../Badge';
7
+ import CircleBadge from '../CircleBadge';
8
8
  import useMediaQuery from '../../hooks/useMediaQuery';
9
9
  import { getImageResolver } from '../../utils/imageConfig';
10
10
  import { getWordPool } from '../../utils/wordPool';
@@ -273,6 +273,6 @@ const TrainingWordCard = forwardRef(function TrainingWordCard({ item, disabled =
273
273
  onSelect?.();
274
274
  }
275
275
  }
276
- : undefined, children: _jsxs("div", { className: "training-word-card__flipper", style: { transitionDelay: showBack ? '0ms' : `${flipDelay}ms` }, children: [_jsxs("div", { className: "training-word-card__front", children: [selected && (_jsx("div", { className: "training-word-card__selected-badge", onClick: handleStopProp, children: _jsx(Badge, { type: "dot", size: 40, position: "inline", animate: true, icon: orderRank != null ? undefined : 'check', number: orderRank ?? undefined, "aria-label": orderRank != null ? t('training.nthSelected', { n: orderRank }) : t('training.selected', '선택됨') }) })), _jsx("div", { className: "training-word-card__image-wrap", children: textCard ? (_jsx("div", { className: "training-word-card__text-face", children: front.label })) : hasImage ? (_jsxs(_Fragment, { children: [imgLoading && _jsx("div", { className: "training-word-card__spinner" }), _jsx("img", { ref: imgRef, className: "training-word-card__image", src: imageUrl, alt: front.label || t('common.image', '이미지'), style: { opacity: imgLoading ? 0 : 1 }, onLoad: handleImgLoad, onError: handleImgError })] })) : (_jsx("div", { className: "training-word-card__placeholder" })) }), !hideLabel && (_jsxs("div", { className: "training-word-card__body", children: [!textCard && _jsx("div", { className: "training-word-card__word", children: front.label }), front.subLabel && (_jsxs("div", { className: "training-word-card__pronunciation", children: ["[", front.subLabel, "]"] })), front.colloquialLabel && (_jsxs("div", { className: "training-word-card__colloquial caption-1", children: ["[", front.colloquialLabel, "]"] }))] })), !hideAudio && (_jsx("div", { className: "training-word-card__bottom", onClick: selectable ? handleStopProp : undefined, children: _jsx(Button, { htmlType: "button", size: isMobile ? 40 : 48, type: isMobile ? 'dot' : 'bar', icon: playing ? 'pause' : 'play', label: isMobile ? undefined : t('training.playSound', '소리 듣기'), selected: playing, loading: waiting, onClick: handlePlay, disabled: disabled, ariaLabel: t('training.playSound', '소리 듣기') }) }))] }), _jsx("div", { className: "training-word-card__back", "aria-hidden": "true", children: _jsx("span", { className: "training-word-card__disabled-symbol", style: { ['--disabled-symbol-src']: `url("${symbolSrc}")` } }) })] }) }));
276
+ : undefined, children: _jsxs("div", { className: "training-word-card__flipper", style: { transitionDelay: showBack ? '0ms' : `${flipDelay}ms` }, children: [_jsxs("div", { className: "training-word-card__front", children: [selected && (_jsx("div", { className: "training-word-card__selected-badge", onClick: handleStopProp, children: _jsx(CircleBadge, { size: 40, position: "inline", animate: true, icon: orderRank != null ? undefined : 'check', number: orderRank ?? undefined, "aria-label": orderRank != null ? t('training.nthSelected', { n: orderRank }) : t('training.selected', '선택됨') }) })), _jsx("div", { className: "training-word-card__image-wrap", children: textCard ? (_jsx("div", { className: "training-word-card__text-face", children: front.label })) : hasImage ? (_jsxs(_Fragment, { children: [imgLoading && _jsx("div", { className: "training-word-card__spinner" }), _jsx("img", { ref: imgRef, className: "training-word-card__image", src: imageUrl, alt: front.label || t('common.image', '이미지'), style: { opacity: imgLoading ? 0 : 1 }, onLoad: handleImgLoad, onError: handleImgError })] })) : (_jsx("div", { className: "training-word-card__placeholder" })) }), !hideLabel && (_jsxs("div", { className: "training-word-card__body", children: [!textCard && _jsx("div", { className: "training-word-card__word", children: front.label }), front.subLabel && (_jsxs("div", { className: "training-word-card__pronunciation", children: ["[", front.subLabel, "]"] })), front.colloquialLabel && (_jsxs("div", { className: "training-word-card__colloquial caption-1", children: ["[", front.colloquialLabel, "]"] }))] })), !hideAudio && (_jsx("div", { className: "training-word-card__bottom", onClick: selectable ? handleStopProp : undefined, children: _jsx(Button, { htmlType: "button", size: isMobile ? 40 : 48, type: isMobile ? 'dot' : 'bar', icon: playing ? 'pause' : 'play', label: isMobile ? undefined : t('training.playSound', '소리 듣기'), selected: playing, loading: waiting, onClick: handlePlay, disabled: disabled, ariaLabel: t('training.playSound', '소리 듣기') }) }))] }), _jsx("div", { className: "training-word-card__back", "aria-hidden": "true", children: _jsx("span", { className: "training-word-card__disabled-symbol", style: { ['--disabled-symbol-src']: `url("${symbolSrc}")` } }) })] }) }));
277
277
  });
278
278
  export default TrainingWordCard;
@@ -13,7 +13,7 @@ export { toWordAttributeFilterCodes, wordAttributeFilterFromCodes, normalizeWord
13
13
  export function useWordAttributeFilterKeys() {
14
14
  const { t } = useTranslation();
15
15
  return useMemo(() => ({
16
- difficulty: t('wordSearch.filter.difficulty', '등급'),
16
+ difficulty: t('wordSearch.filter.difficulty', '난이도'),
17
17
  syllables: t('wordSearch.filter.syllables', '음절 수'),
18
18
  syllable5plus: t('wordSearch.filter.syllable5plus', '5음절 이상'),
19
19
  partOfSpeech: t('wordSearch.filter.partOfSpeech', '품사'),
@@ -44,12 +44,31 @@ export function useWordAttributeFilterKeys() {
44
44
  export function buildGradeSection(t, keys, opts) {
45
45
  return {
46
46
  label: keys.difficulty,
47
- items: [...[1, 2, 3, 4].map(n => t('wordSearch.filter.grade', { n })), t('wordSearch.filter.gradeNone', '없음')],
47
+ /* **앞은 나이, 뒤는 등급이다**(말귀 청 (342), 2026-10-28).
48
+ 1등급 하나에 낱말 5,000개가 몰려 있어 치료사가 또래를 고를 수 없었다. 그래서 1등급만
49
+ 나이 다섯으로 가르고(`3세`~`7세`) 2~4등급은 그대로 두었다 — 그 셋은 그만큼 잘게 나눌
50
+ 자료가 없다. 한 줄에 두 가지 자가 섞이는 셈이라 **그 까닭을 `labelInfo` 가 말한다.**
51
+ `1등급` 칩은 여기서 빠지지만 **저장된 표는 그대로 열린다**(코드는 살아 있다). */
52
+ items: [
53
+ ...[3, 4, 5, 6, 7].map(n => t('wordSearch.filter.age', { n, defaultValue: `${n}세` })),
54
+ ...[2, 3, 4].map(n => t('wordSearch.filter.grade', { n })),
55
+ t('wordSearch.filter.gradeNone', '없음'),
56
+ ],
48
57
  multiple: true,
49
58
  allOption: true,
50
59
  allLabel: opts?.allLabel,
51
60
  labelAction: opts?.labelAction,
52
- labelInfo: opts?.labelInfo,
61
+ /* **왜 앞은 나이고 뒤는 등급인지**를 `i` 가 말한다(청 (342)). 한 줄에 두 가지 자가
62
+ 섞여 서니 묻게 되는 자리다 — 부르는 쪽이 제 글을 넘기면 그것이 이기고, 안 넘기면
63
+ **세 화면이 다 같은 설명**을 본다(각 화면이 따로 적으면 한 자리가 안 따라온다). */
64
+ labelInfo: opts?.labelInfo ?? {
65
+ title: keys.difficulty,
66
+ items: [
67
+ t('wordSearch.filter.difficultyInfoAge', '3세~7세: 가장 쉬운 낱말(1등급)을 또래별로 나눈 것입니다.'),
68
+ t('wordSearch.filter.difficultyInfoGrade', '2~4등급: 그보다 어려운 낱말이고, 나이로는 나누지 않습니다.'),
69
+ t('wordSearch.filter.difficultyInfoNone', '없음: 난이도가 매겨지지 않은 낱말입니다.'),
70
+ ],
71
+ },
53
72
  };
54
73
  }
55
74
  /** @public 품사 FilterPanelSection — 세 화면 공용. */
@@ -82,7 +101,11 @@ export function buildSyllableSection(t, keys) {
82
101
  * labelAction(정보 툴팁)은 호출부가 자신의 안내 문구로 구성해 넘긴다.
83
102
  */
84
103
  export function buildSelectSection(t, opts) {
85
- const items = [t('wordPairs.filter.onlyHasImage', '이미지 있는 단어만')];
104
+ const items = [
105
+ t('wordPairs.filter.onlyHasImage', '이미지 있는 단어만'),
106
+ /* 활용도 — 사전이 들고 오는 `WordEntry.usage` 를 본다(청 (342)) */
107
+ t('wordPairs.filter.onlyHighUsage', '활용도 높은 단어만'),
108
+ ];
86
109
  if (opts?.includeStructure)
87
110
  items.push(t('wordPairs.filter.onlySameStructure', '음소 구조 같은 단어만'));
88
111
  return { label: t('wordPairs.filter.selectLabel', '선택'), items, multiple: true, labelAction: opts?.labelAction, labelInfo: opts?.labelInfo };
@@ -668,8 +668,12 @@
668
668
  "positionHead": "Start",
669
669
  "positionMid": "Middle",
670
670
  "positionTail": "End",
671
- "difficulty": "Grade",
671
+ "difficulty": "Difficulty",
672
672
  "grade": "Grade {{n}}",
673
+ "age": "Age {{n}}",
674
+ "difficultyInfoAge": "Age 3–7: the easiest words (grade 1), split by age.",
675
+ "difficultyInfoGrade": "Grades 2–4: harder words, not split by age.",
676
+ "difficultyInfoNone": "None: words with no difficulty assigned.",
673
677
  "gradeNone": "None",
674
678
  "syllables": "Syllables",
675
679
  "syllable": "{{n}} Syll.",
@@ -884,6 +888,7 @@
884
888
  ],
885
889
  "selectLabel": "Select",
886
890
  "onlyHasImage": "Only words with images",
891
+ "onlyHighUsage": "High-use words only",
887
892
  "onlySameStructure": "Only same phoneme structure"
888
893
  },
889
894
  "confirmMessage": "The word table with {{count}} selected {{unit}} will be lost.",
@@ -655,8 +655,12 @@
655
655
  "positionHead": "어두",
656
656
  "positionMid": "어중",
657
657
  "positionTail": "어말",
658
- "difficulty": "등급",
658
+ "difficulty": "난이도",
659
659
  "grade": "{{n}}등급",
660
+ "age": "{{n}}세",
661
+ "difficultyInfoAge": "3세~7세: 가장 쉬운 낱말(1등급)을 또래별로 나눈 것입니다.",
662
+ "difficultyInfoGrade": "2~4등급: 그보다 어려운 낱말이고, 나이로는 나누지 않습니다.",
663
+ "difficultyInfoNone": "없음: 난이도가 매겨지지 않은 낱말입니다.",
660
664
  "gradeNone": "없음",
661
665
  "syllables": "음절 수",
662
666
  "syllable": "{{n}}음절",
@@ -871,6 +875,7 @@
871
875
  ],
872
876
  "selectLabel": "선택",
873
877
  "onlyHasImage": "이미지 있는 단어만",
878
+ "onlyHighUsage": "활용도 높은 단어만",
874
879
  "onlySameStructure": "음소 구조 같은 단어만"
875
880
  },
876
881
  "confirmMessage": "선택한 {{unit}} {{count}}개를 포함한 단어 표 정보가 사라집니다.",
@@ -8,6 +8,8 @@ import type { PairFilterKeys } from './phonemePairSearchTypes';
8
8
  * 사후 필터링하는 두 경우 모두 같은 판정 로직을 재사용하기 위함). */
9
9
  export interface FilterableWord {
10
10
  grade?: string;
11
+ /** 나이 — 1등급 안을 가르는 칩(`3세`~`7세`)이 이것을 본다(청 (342)) */
12
+ age?: number;
11
13
  syllables?: number;
12
14
  pos?: string;
13
15
  wordType?: string;
@@ -168,7 +168,7 @@ export function matchesFilters(word, filterSelected, keys = DEFAULT_PAIR_FILTER_
168
168
  되거름(숫자만 남기기)이 `''` 를 내면 **버린다** — 빈 되거름이 그대로 가면 빈 등급 단어가 **우연히**
169
169
  걸려, 사전에서 라벨이 빠진 날 `없음` 이 겉보기엔 되는 꼴이 된다. 그 흠은 제일 늦게 들킨다. */
170
170
  const codes = grades.map(g => wordAttributeValueCodeOf('grade', g) ?? g.replace(/\D/g, '')).filter(c => c !== '');
171
- if (codes.length === 0 || !matchesGradeCodes(codes, word.grade))
171
+ if (codes.length === 0 || !matchesGradeCodes(codes, word.grade, word.age))
172
172
  return false;
173
173
  }
174
174
  if (syls.length) {
@@ -4,6 +4,18 @@ export interface WordEntry {
4
4
  pronunciation: string;
5
5
  colloquialPronunciation?: string;
6
6
  grade?: string;
7
+ /**
8
+ * **나이** — `grade` 가 `'1'` 인 낱말을 더 잘게 가른다(말귀 청 (342), 2026-10-28).
9
+ *
10
+ * 1등급 5,000개가 한 칸에 몰려 있어 치료사가 또래를 고를 수 없었다. 그래서 `grade` 는
11
+ * **그대로 두고**(저장된 표 열셋이 그 코드를 쥐고 있다) 그 안을 이 칸으로 가른다 —
12
+ * 거르개의 `age3`~`age7` 이 `grade === '1' && age === n` 을 뜻한다.
13
+ *
14
+ * 2~4등급에는 이 값이 없다. 그 셋은 등급 그대로 고른다.
15
+ */
16
+ age?: number;
17
+ /** **활용도가 높은 낱말인가** — 거르개의 '활용도 높은 단어만' 이 이것을 본다(청 (342)). */
18
+ usage?: boolean;
7
19
  pos?: string;
8
20
  wordType?: string;
9
21
  field?: string;
@@ -34,12 +34,22 @@ export declare function isGradeCode(v: unknown): v is string;
34
34
  * **같은 결정이 세 자리에 적혀 있으면 하나는 안 따라온다.** 그래서 세 자리가 이 하나를 부른다.
35
35
  * `codes` 가 비면 거르지 않는다(전체).
36
36
  */
37
- export declare function matchesGradeCodes(codes: ReadonlySet<string> | readonly string[] | null | undefined, grade: string | null | undefined): boolean;
37
+ export declare function matchesGradeCodes(codes: ReadonlySet<string> | readonly string[] | null | undefined, grade: string | null | undefined,
38
+ /**
39
+ * 낱말의 나이(`WordEntry.age`) — `age3`~`age7` 을 고른 때에만 본다(청 (342)).
40
+ *
41
+ * **안 넘기면 나이 칩이 한 낱말도 안 건진다.** 그러면 거르개는 멀쩡히 켜져 보이는데 결과가
42
+ * 0 이다 — `없음` 이 밟았던 그 꼴이다. 부르는 자리가 셋뿐이라 셋 다 넘기게 했고,
43
+ * `test/gradeAgeCodes1028.test.ts` 가 **그 셋을 센다.**
44
+ */
45
+ age?: number | null): boolean;
38
46
  /**
39
47
  * @public 공용 속성 필터를 **언어와 무관한 코드**로 담은 모양 — 저장(DB config·로컬 저장소)용.
40
48
  * 예: `{ grade: ['1', '2'], syllables: ['5+'], pos: ['noun'], wordType: ['sino'] }`
41
49
  */
42
50
  export type WordAttributeFilterCodes = Partial<Record<WordAttributeSectionCode, string[]>>;
51
+ /** 나이 코드인가 — `age3`~`age7`. 맞다면 그 숫자를, 아니면 `null`. */
52
+ export declare function ageOfGradeCode(code: string): number | null;
43
53
  /** 품사 코드 → 사전 품사 약자(단어의 pos 에 들어 있는지 본다) · 어종 코드 → 사전 어종 값 */
44
54
  export declare const POS_CODE_TARGETS: Record<string, string[]>;
45
55
  export declare const WORD_TYPE_CODE_VALUES: Record<string, string>;
@@ -61,7 +61,15 @@ export function isGradeCode(v) {
61
61
  * **같은 결정이 세 자리에 적혀 있으면 하나는 안 따라온다.** 그래서 세 자리가 이 하나를 부른다.
62
62
  * `codes` 가 비면 거르지 않는다(전체).
63
63
  */
64
- export function matchesGradeCodes(codes, grade) {
64
+ export function matchesGradeCodes(codes, grade,
65
+ /**
66
+ * 낱말의 나이(`WordEntry.age`) — `age3`~`age7` 을 고른 때에만 본다(청 (342)).
67
+ *
68
+ * **안 넘기면 나이 칩이 한 낱말도 안 건진다.** 그러면 거르개는 멀쩡히 켜져 보이는데 결과가
69
+ * 0 이다 — `없음` 이 밟았던 그 꼴이다. 부르는 자리가 셋뿐이라 셋 다 넘기게 했고,
70
+ * `test/gradeAgeCodes1028.test.ts` 가 **그 셋을 센다.**
71
+ */
72
+ age) {
65
73
  if (!codes)
66
74
  return true;
67
75
  const set = codes instanceof Set ? codes : new Set(codes);
@@ -69,11 +77,30 @@ export function matchesGradeCodes(codes, grade) {
69
77
  return true;
70
78
  if (isBlankGrade(grade))
71
79
  return set.has(GRADE_NONE);
72
- return set.has(String(grade));
80
+ const g = String(grade);
81
+ if (set.has(g))
82
+ return true;
83
+ /* **나이 칩은 1등급 안을 가른다** — `age5` 는 `grade === '1' && age === 5` 다.
84
+ 2~4등급에는 나이가 없으므로 위 `set.has(g)` 에서 이미 갈린다. */
85
+ if (g !== '1' || age == null)
86
+ return false;
87
+ return set.has(`age${age}`);
73
88
  }
74
89
  const sectionCodes = ['grade', 'syllables', 'pos', 'wordType', 'field'];
75
- /** 등급 코드 — `'none'` 은 **등급이 빈 단어**다(값이 아니라 **빔**이다. GRADE_NONE 주석을 볼 것) */
76
- const gradeValues = ['1', '2', '3', '4', 'none'];
90
+ /**
91
+ * 난이도 코드 — `'none'` 은 **등급이 빈 단어**다(값이 아니라 **빔**이다. GRADE_NONE 주석을 볼 것).
92
+ *
93
+ * **`'1'` 은 화면에서 빠졌지만 여기 남는다**(말귀 청 (342), 2026-10-28). 1등급을 나이
94
+ * 다섯(`age3`~`age7`)으로 가르면서 칩에서는 뺐는데, **저장된 표 열셋이 그 코드를 쥐고 있다**
95
+ * (말귀 실측 2026-10-28). 읽을 줄 모르면 그 열셋이 안 열린다 — 읽을 줄은 알되 새로 고르게만
96
+ * 안 한다. 그래서 **마이그레이션이 필요 없다.**
97
+ */
98
+ const gradeValues = ['1', '2', '3', '4', 'none', 'age3', 'age4', 'age5', 'age6', 'age7'];
99
+ /** 나이 코드인가 — `age3`~`age7`. 맞다면 그 숫자를, 아니면 `null`. */
100
+ export function ageOfGradeCode(code) {
101
+ const m = /^age([3-7])$/.exec(code);
102
+ return m ? Number(m[1]) : null;
103
+ }
77
104
  const syllableValues = ['1', '2', '3', '4', '5+'];
78
105
  const posValues = ['noun', 'verb', 'modifier'];
79
106
  const wordTypeValues = ['native', 'sino', 'foreign', 'mixed'];
@@ -83,7 +110,11 @@ const valuesBySection = { grade: gradeValues, syllables: syllableValues, pos: po
83
110
  export const POS_CODE_TARGETS = { noun: ['명', '수'], verb: ['동', '형'], modifier: ['부', '관'] };
84
111
  export const WORD_TYPE_CODE_VALUES = { native: '고유', sino: '한자', foreign: '외래', mixed: '혼종' };
85
112
  /* 사전 밖의 옛 라벨 — phonemePairSearch 의 DEFAULT_PAIR_FILTER_KEYS 가 쓰던 것(쉼표 뒤 빈칸 없음·'난이도 등급') */
86
- const legacySectionLabels = { grade: ['난이도 등급'] };
113
+ const legacySectionLabels = {
114
+ /* `등급` 은 **2026-10-28 까지 쓰던 이름**이다(청 (342) 로 `난이도` 가 되었다). 저장된 표가
115
+ 그 글자를 열쇠로 쥐고 있으므로 읽을 줄 알아야 한다 — `Difficulty` 는 영어 쪽 옛 이름이다. */
116
+ grade: ['난이도 등급', '등급', 'Grade', 'Difficulty'],
117
+ };
87
118
  const legacyValueLabels = {
88
119
  pos: { noun: ['체언(명사,수사)'], verb: ['용언(동사,형용사)'], modifier: ['수식언(부사,관형사)'] },
89
120
  };
@@ -100,7 +131,7 @@ function dictFor(lng) {
100
131
  const t = i18n.getFixedT(lng);
101
132
  const d = {
102
133
  section: {
103
- grade: t('wordSearch.filter.difficulty', '등급'),
134
+ grade: t('wordSearch.filter.difficulty', '난이도'),
104
135
  syllables: t('wordSearch.filter.syllables', '음절 수'),
105
136
  pos: t('wordSearch.filter.partOfSpeech', '품사'),
106
137
  wordType: t('wordSearch.filter.wordType', '유형'),
@@ -108,7 +139,11 @@ function dictFor(lng) {
108
139
  },
109
140
  value: {
110
141
  grade: {
111
- ...Object.fromEntries(gradeValues.filter(n => n !== GRADE_NONE).map((n) => [n, t('wordSearch.filter.grade', { n: Number(n), defaultValue: `${n}등급` })])),
142
+ /* 등급 칩 — `'1'` 은 화면에서 빠졌지만 **읽을 줄은 안다**(저장된 표가 쥐고 있다) */
143
+ ...Object.fromEntries(['1', '2', '3', '4'].map((n) => [n, t('wordSearch.filter.grade', { n: Number(n), defaultValue: `${n}등급` })])),
144
+ /* 나이 칩 — 1등급 안을 가른다(청 (342)). 숫자 틀이 등급과 **달라야 한다**:
145
+ `3세` 를 `3등급` 과 같은 틀로 지으면 둘이 같은 글자가 되어 서로를 덮는다. */
146
+ ...Object.fromEntries([3, 4, 5, 6, 7].map((n) => [`age${n}`, t('wordSearch.filter.age', { n, defaultValue: `${n}세` })])),
112
147
  /* **`없음` 은 숫자 틀을 안 쓴다** — `t('…grade', { n: Number('none') })` 은 `NaN등급` 이 된다 */
113
148
  [GRADE_NONE]: t('wordSearch.filter.gradeNone', '없음'),
114
149
  },
@@ -166,7 +201,14 @@ export function wordAttributeValueCodeOf(section, value) {
166
201
  for (const [code, labels] of Object.entries(legacyValueLabels[section] ?? {}))
167
202
  if (labels.includes(value))
168
203
  return code;
169
- /* 등급·음절은 숫자로도 읽는다('Grade 3'·'3등급'·'6음절') — 사전에 없는 꼴이 와도 풀리지 않게 */
204
+ /* 등급·음절은 숫자로도 읽는다('Grade 3'·'3등급'·'6음절') — 사전에 없는 꼴이 와도 풀리지 않게.
205
+
206
+ **나이는 이 길로 보내지 않는다**(청 (342)). `3세` 에서 숫자만 뽑으면 `3` 이고, 그러면
207
+ **3등급으로 읽힌다** — 고른 것과 걸리는 낱말이 통째로 달라지는데 화면에는 아무 표시가
208
+ 없다. 위 사전이 ko·en 을 다 보므로 제 이름으로는 이미 읽혔고, 여기 오는 것은 사전에 없는
209
+ 꼴뿐이다. 나이 꼴이면 **읽기를 포기한다** — 엉뚱하게 읽느니 안 읽는 편이 낫다. */
210
+ if (section === 'grade' && /(세|살|years?\s*old|yrs?)\s*$/i.test(value.trim()))
211
+ return null;
170
212
  if (section === 'grade' || section === 'syllables') {
171
213
  const n = parseInt(value.replace(/\D/g, ''), 10);
172
214
  if (Number.isFinite(n) && n >= 1) {
@@ -17,8 +17,10 @@ export interface MvpWord {
17
17
  p: string[];
18
18
  /** 표준발음 — 스펠링은 다르지만 소리가 같은 동음이의어를 오답에서 배제하는 데 사용. 데이터 없으면 w로 폴백. */
19
19
  pron: string;
20
- /** 난이도 등급('1'~'4'). 데이터 없으면 undefined — 난이도 등급 필터 미적용 시 무시된다. */
20
+ /** 난이도 등급('1'~'4'). 데이터 없으면 undefined — 난이도 필터 미적용 시 무시된다. */
21
21
  grade?: string;
22
+ /** 나이 — 1등급 안을 가르는 칩(`3세`~`7세`)이 이것을 본다(청 (342)). 없으면 그 칩에 안 걸린다. */
23
+ age?: number;
22
24
  }
23
25
  export declare const MVP: MvpWord[];
24
26
  export declare function pickOne<T>(arr: T[]): T | undefined;
@@ -269,7 +269,7 @@ export function answerWordFilter(opts) {
269
269
  return null;
270
270
  const pron = opts.phonemeView === 'pron';
271
271
  return (w) => {
272
- if (!matchesGradeCodes(gradeSet, w.grade))
272
+ if (!matchesGradeCodes(gradeSet, w.grade, w.age))
273
273
  return false;
274
274
  if (preds.length === 0)
275
275
  return true;
@@ -318,7 +318,7 @@ async function _buildUsablePool(opts) {
318
318
  let candidates = MVP.filter(w => {
319
319
  if (!w.w)
320
320
  return false;
321
- if (!matchesGradeCodes(gradeSet, w.grade))
321
+ if (!matchesGradeCodes(gradeSet, w.grade, w.age))
322
322
  return false;
323
323
  if (useAllCandidates)
324
324
  return true;
@@ -46,4 +46,4 @@
46
46
  *
47
47
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
48
48
  */
49
- export declare const CORE_VERSION = "0.388.0";
49
+ export declare const CORE_VERSION = "0.390.0";
@@ -46,4 +46,4 @@
46
46
  *
47
47
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
48
48
  */
49
- export const CORE_VERSION = '0.388.0';
49
+ export const CORE_VERSION = '0.390.0';