@ihabdevteam/core 0.376.0 → 0.379.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 +222 -0
- package/dist/components.cjs.js +181 -181
- package/dist/components.esm.css +5 -5
- package/dist/hooks.cjs.js +1 -1
- package/dist/i18n.cjs.js +1 -1
- package/dist/ihabdevteam-core.cjs.js +193 -193
- package/dist/ihabdevteam-core.d.ts +19 -8
- package/dist/packages/core/src/components/Badge.css +0 -76
- package/dist/packages/core/src/components/Badge.d.ts +1 -0
- package/dist/packages/core/src/components/Badge.js +4 -0
- package/dist/packages/core/src/components/BarChart.css +29 -29
- package/dist/packages/core/src/components/BarChart.js +20 -19
- package/dist/packages/core/src/components/BottomNav.js +3 -2
- package/dist/packages/core/src/components/ChartSection.css +70 -45
- package/dist/packages/core/src/components/ChartSection.d.ts +3 -3
- package/dist/packages/core/src/components/ChartSection.js +8 -7
- package/dist/packages/core/src/components/CircleBadge.css +87 -0
- package/dist/packages/core/src/components/CircleBadge.d.ts +1 -0
- package/dist/packages/core/src/components/CircleBadge.js +1 -0
- package/dist/packages/core/src/components/CountTile.js +1 -1
- package/dist/packages/core/src/components/Header.js +3 -2
- package/dist/packages/core/src/components/RingChart.js +6 -5
- package/dist/packages/core/src/components/Section.css +1 -1
- package/dist/packages/core/src/components/SectionHeadFloat.d.ts +1 -1
- package/dist/packages/core/src/components/SectionHeadFloat.js +1 -1
- package/dist/packages/core/src/components/StatChart.css +17 -17
- package/dist/packages/core/src/components/StatChart.d.ts +1 -1
- package/dist/packages/core/src/components/StatChart.js +3 -2
- package/dist/packages/core/src/components/Toolbar.css +1 -1
- package/dist/packages/core/src/components/Tooltip/DescriptionTooltip.css +9 -9
- package/dist/packages/core/src/components/Tooltip/DescriptionTooltip.js +3 -2
- package/dist/packages/core/src/components/Tooltip/InfoTooltip.css +6 -6
- package/dist/packages/core/src/components/Tooltip/InfoTooltip.js +2 -1
- package/dist/packages/core/src/components/Tooltip/MenuTooltip.css +15 -15
- package/dist/packages/core/src/components/Tooltip/MenuTooltip.js +2 -1
- package/dist/packages/core/src/components/Tooltip/TextBoxTooltip.css +15 -15
- package/dist/packages/core/src/components/Tooltip/TextBoxTooltip.js +4 -3
- package/dist/packages/core/src/components/Tooltip/Tooltip.css +21 -21
- package/dist/packages/core/src/components/Tooltip/Tooltip.js +4 -3
- package/dist/packages/core/src/components/Tooltip/TrainingTooltip.css +20 -5
- package/dist/packages/core/src/components/Tooltip/TrainingTooltip.d.ts +1 -1
- package/dist/packages/core/src/components/Tooltip/TrainingTooltip.js +5 -4
- package/dist/packages/core/src/components/Tooltip/WordImageTooltip.css +7 -7
- package/dist/packages/core/src/components/Tooltip/WordImageTooltip.js +5 -4
- package/dist/packages/core/src/components/Training/NoiseSettingsTooltip.css +15 -15
- package/dist/packages/core/src/components/Training/NoiseSettingsTooltip.js +3 -2
- package/dist/packages/core/src/components/Training/TrainingPagePopupBottom.js +1 -1
- package/dist/packages/core/src/components/Training/TrainingStepTextBox.css +1 -1
- package/dist/packages/core/src/components/Training/TrainingStepTitle.js +2 -2
- package/dist/packages/core/src/components/Training/useFloatingFocus.d.ts +1 -1
- package/dist/packages/core/src/components/Training/useFloatingFocus.js +2 -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/wordTablePrint.js +4 -4
- package/dist/packages/core/src/components/WordTable.css +112 -85
- package/dist/packages/core/src/components/WordTable.js +59 -37
- package/dist/packages/core/src/components/barChartTypes.d.ts +1 -1
- package/dist/packages/core/src/components/wordTableLayout.js +2 -2
- package/dist/packages/core/src/hooks/touchToggle.d.ts +1 -1
- package/dist/packages/core/src/hooks/touchToggle.js +2 -2
- package/dist/packages/core/src/types/wordSearch.d.ts +11 -0
- package/dist/packages/core/src/utils/legacyBlocks.d.ts +53 -0
- package/dist/packages/core/src/utils/legacyBlocks.js +131 -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 +1 -1
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ import { FOCUSABLE_SELECTOR } from '../../hooks/useFocusTrap';
|
|
|
7
7
|
import { devWarnOnce } from '../../utils/devWarn';
|
|
8
8
|
import { pushEsc } from '../../hooks/escStack';
|
|
9
9
|
import { usePrefersReducedMotion } from '../../hooks/usePrefersReducedMotion';
|
|
10
|
+
import { withLegacy } from '../../utils/legacyBlocks';
|
|
10
11
|
/** @public */
|
|
11
12
|
export default function Tooltip(props) {
|
|
12
13
|
const { anchorRect, anchorEl, offset = 20, edgeMargin = 20, onClose, closeOnOutsideClick = true, className = '', role = 'dialog', ariaLabel = '', children, backdrop = false, isMobilePopup = false, useBorder = true, header, focusOnOpen, } = props || {};
|
|
@@ -18,7 +19,7 @@ export default function Tooltip(props) {
|
|
|
18
19
|
const [isMobile, setIsMobile] = useState(false);
|
|
19
20
|
// anchorEl 제공 시 항상 live rect 사용, 아니면 anchorRect prop 사용
|
|
20
21
|
/* 붙일 자리가 없으면 **글 흐름 안에** 그린다 — 아래에서 포털도 위치 계산도 건너뛴다.
|
|
21
|
-
그런데 `.
|
|
22
|
+
그런데 `.tooltip__content` 는 `position:absolute` 라, 여기서 인라인 표시를 붙여
|
|
22
23
|
주지 않으면 스타일시트가 그 결정을 도로 눌러 버린다. 그러면 anchor 없는 툴팁이
|
|
23
24
|
여럿일 때 **모두 한 점에 겹쳐** 하나만 보인다(놀이터 #tooltip 미리보기에서 넷이
|
|
24
25
|
735,671 한 자리에 포개져 있었다 — 2026-09-09 실측). */
|
|
@@ -461,7 +462,7 @@ export default function Tooltip(props) {
|
|
|
461
462
|
devWarnOnce('tooltip-no-name', '[ihab/Tooltip] 이름 없는 role="dialog" 입니다 — ariaLabel 을 주세요. 낭독기가 "대화상자" 라고만 읽습니다.');
|
|
462
463
|
}
|
|
463
464
|
}, [role, ariaLabel]);
|
|
464
|
-
const el = (_jsxs("div", { ref: ref, className: `
|
|
465
|
+
const el = (_jsxs("div", { ref: ref, className: withLegacy(`tooltip__content ${isInline ? 'tooltip__content--inline' : ''} ${useBorder ? 'tooltip__content--bordered' : ''} ${closing ? 'is-closing' : ''} ${className} ${isMobile && isMobilePopup ? 'is-mobile' : ''}`), role: role, "aria-label": ariaLabel || undefined, style: isInline ? {} : { ...posStyle, visibility: measured ? 'visible' : 'hidden' }, tabIndex: -1, "data-placement": placement, "data-left": !isInline ? posStyle.left : '', "data-top": !isInline ? posStyle.top : '', "data-anchor-left": anchorRect ? Math.round(anchorRect.left) : '', "data-anchor-top": anchorRect ? Math.round(anchorRect.top) : '', "data-anchor-width": anchorRect ? Math.round(anchorRect.width) : '', "data-anchor-height": anchorRect ? Math.round(anchorRect.height) : '', children: [header != null && _jsx("div", { className: withLegacy("tooltip__header h5"), children: header }), children] }));
|
|
465
466
|
if (isInline)
|
|
466
467
|
return el;
|
|
467
468
|
if (typeof document === 'undefined')
|
|
@@ -469,7 +470,7 @@ export default function Tooltip(props) {
|
|
|
469
470
|
// When backdrop is requested, render a full-screen overlay behind the tooltip
|
|
470
471
|
// For mobile, only show as popup/backdrop when `isMobilePopup` is true
|
|
471
472
|
if (backdrop || (isMobile && isMobilePopup)) {
|
|
472
|
-
const portal = (_jsxs("div", { className: "
|
|
473
|
+
const portal = (_jsxs("div", { className: withLegacy("tooltip__portal"), children: [_jsx("div", { className: withLegacy("tooltip__backdrop"), onClick: () => { if (closeOnOutsideClick)
|
|
473
474
|
startClose(true); } }), el] }));
|
|
474
475
|
return createPortal(portal, document.body);
|
|
475
476
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
+
/* **옛 이름이 선택자에 함께 적혀 있다**(`.manager-*` · `.tooltip-training__*`) — 지우지 말 것.
|
|
2
|
+
*
|
|
3
|
+
* 마크업 쌍둥이(`withLegacy`)는 **코어가 그리는 마디**만 덮는다. 말귀는 제 마디에 코어
|
|
4
|
+
* 이름을 손으로 적어 겉모습을 빌려 쓴다(실측 2026-10-28: `<li className="manager-section
|
|
5
|
+
* manager-section--grid sgc">` 처럼 **15개 이름 · 19곳**). 그 자리는 코어 마디가 아니라
|
|
6
|
+
* 쌍둥이가 안 닿는다 — 선택자가 옛 이름도 함께 받아야 그 화면이 안 깨진다.
|
|
7
|
+
*
|
|
8
|
+
* 말귀가 다 옮겼다고 알려 오면 **쉼표 뒤의 옛 이름만** 지운다. 규칙 자체는 한 벌이다.
|
|
9
|
+
* `NAMING.md` 의 *"이름을 바꿀 때"* 와 `src/utils/legacyBlocks.ts` 를 함께 볼 것.
|
|
10
|
+
*/
|
|
1
11
|
/* ── TrainingTooltip — 훈련 계획 내용 미리보기 툴팁 ──────────────────────── */
|
|
2
12
|
|
|
3
|
-
/* wrapper(.
|
|
13
|
+
/* wrapper(.tooltip__content)의 배경 없앰(background/box-shadow)은 Tooltip.css의 공용
|
|
4
14
|
variant 규칙으로 정규화됨. 이 파일엔 TrainingTooltip 전용 pointer-events만 남긴다. */
|
|
5
|
-
.
|
|
15
|
+
.tooltip__content.training-tooltip {
|
|
6
16
|
pointer-events: none; /* 마우스 통과 — 행 hover 유지 */
|
|
7
17
|
}
|
|
8
|
-
|
|
18
|
+
.training-tooltip__box,
|
|
9
19
|
.tooltip-training__box {
|
|
10
20
|
padding: 10px 14px;
|
|
11
21
|
background: var(--color-white);
|
|
@@ -14,6 +24,7 @@
|
|
|
14
24
|
}
|
|
15
25
|
|
|
16
26
|
/* 훈련 타입 그룹 목록 — 가로 배치 */
|
|
27
|
+
.training-tooltip__groups,
|
|
17
28
|
.tooltip-training__groups {
|
|
18
29
|
display: flex;
|
|
19
30
|
flex-direction: row;
|
|
@@ -22,6 +33,7 @@
|
|
|
22
33
|
}
|
|
23
34
|
|
|
24
35
|
/* 섹션 */
|
|
36
|
+
.training-tooltip__section,
|
|
25
37
|
.tooltip-training__section {
|
|
26
38
|
display: flex;
|
|
27
39
|
flex-direction: column;
|
|
@@ -31,11 +43,12 @@
|
|
|
31
43
|
}
|
|
32
44
|
|
|
33
45
|
/* 섹션 헤더 */
|
|
46
|
+
.training-tooltip__section-header,
|
|
34
47
|
.tooltip-training__section-header {
|
|
35
48
|
display: flex;
|
|
36
49
|
align-items: center;
|
|
37
50
|
}
|
|
38
|
-
|
|
51
|
+
.training-tooltip__type-label,
|
|
39
52
|
.tooltip-training__type-label {
|
|
40
53
|
color: var(--color-darkGray);
|
|
41
54
|
white-space: nowrap;
|
|
@@ -44,7 +57,7 @@
|
|
|
44
57
|
}
|
|
45
58
|
|
|
46
59
|
/* 섹션 사이 짧은 구분선 */
|
|
47
|
-
.
|
|
60
|
+
.training-tooltip__divider {
|
|
48
61
|
width: 1px;
|
|
49
62
|
height: 20px;
|
|
50
63
|
background: var(--color-whiteLine);
|
|
@@ -54,6 +67,7 @@
|
|
|
54
67
|
}
|
|
55
68
|
|
|
56
69
|
/* 항목 목록 — pointer-events: none 으로 버튼 상호작용 차단 */
|
|
70
|
+
.training-tooltip__items,
|
|
57
71
|
.tooltip-training__items {
|
|
58
72
|
display: flex;
|
|
59
73
|
flex-direction: column;
|
|
@@ -62,6 +76,7 @@
|
|
|
62
76
|
}
|
|
63
77
|
|
|
64
78
|
/* compact 버튼: pointer-events 차단 */
|
|
79
|
+
.training-tooltip__items .training-block-button--compact,
|
|
65
80
|
.tooltip-training__items .training-block-button--compact {
|
|
66
81
|
cursor: default;
|
|
67
82
|
}
|
|
@@ -9,7 +9,7 @@ export declare const TRAINING_TOOLTIP_HOVER_DELAY_MS = 200;
|
|
|
9
9
|
/**
|
|
10
10
|
* **자료를 손에 들고 주는 길**(말귀 요청 (111), 사용자 지시 2026-10-10). 갈래 이름표 하나에 그 갈래의
|
|
11
11
|
* `trainingData` 들 — `plan` 처럼 **풀에서 찾지 않는다.** 단어 숙제 세트는 문장 풀에 없어 `plan` 으로는
|
|
12
|
-
* 못 그렸고, 앱이 `
|
|
12
|
+
* 못 그렸고, 앱이 `training-tooltip__*` 클래스를 **빌려** 같은 모양을 손으로 짰다. 같은 상자를 쓴다.
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
15
|
export interface TrainingTooltipGroup {
|
|
@@ -7,6 +7,7 @@ import './TrainingTooltip.css';
|
|
|
7
7
|
import { translateTrainingTypes } from '../../utils/CategoryData';
|
|
8
8
|
import { getTrainingPools } from '../../utils/getTrainingData';
|
|
9
9
|
import TrainingBlockButton from '../Training/TrainingBlockButton';
|
|
10
|
+
import { withLegacy } from '../../utils/legacyBlocks';
|
|
10
11
|
/** 타입 칩 호버 → TrainingTooltip 표시까지의 지연(ms). 말귀자료실 카드와
|
|
11
12
|
* 훈련설정 페이지가 동일한 호버 프리뷰 동작을 각자 구현하고 있어 공유한다.
|
|
12
13
|
* @public */
|
|
@@ -44,14 +45,14 @@ export default function TrainingTooltip({ plan, groups: givenGroups, anchorRect,
|
|
|
44
45
|
}, [givenGroups, plan?.items, t]);
|
|
45
46
|
if (groups.length === 0)
|
|
46
47
|
return null;
|
|
47
|
-
const box = (_jsx("div", { className: "
|
|
48
|
-
idx > 0 ? _jsx("div", { className: "
|
|
49
|
-
_jsxs("div", { className: "
|
|
48
|
+
const box = (_jsx("div", { className: withLegacy("training-tooltip__box"), children: _jsx("div", { className: withLegacy("training-tooltip__groups"), children: groups.flatMap(({ key, label, type, data }, idx) => [
|
|
49
|
+
idx > 0 ? _jsx("div", { className: withLegacy("training-tooltip__divider") }, `div-${key}`) : null,
|
|
50
|
+
_jsxs("div", { className: withLegacy("training-tooltip__section"), children: [_jsx("div", { className: withLegacy("training-tooltip__section-header"), children: _jsx("span", { className: withLegacy("training-tooltip__type-label body-3b"), children: label }) }), _jsx("div", { className: withLegacy("training-tooltip__items"), children: data.map((td, i) => (_jsx(TrainingBlockButton, { index: i, type: type, trainingData: td, size: "compact", hideCheckBadge: true }, String(td.id ?? i)))) })] }, key),
|
|
50
51
|
]) }) }));
|
|
51
52
|
// anchorRect 없으면 박스를 직접 렌더 (position: absolute 없음 — 인라인 미리보기용)
|
|
52
53
|
if (!anchorRect)
|
|
53
54
|
return box;
|
|
54
|
-
return (_jsx(Tooltip, { anchorRect: anchorRect, offset: offset, onClose: onClose, closeOnOutsideClick: false, className: "tooltip
|
|
55
|
+
return (_jsx(Tooltip, { anchorRect: anchorRect, offset: offset, onClose: onClose, closeOnOutsideClick: false, className: withLegacy("training-tooltip"),
|
|
55
56
|
/* 이름 없는 `role="dialog"` 는 "대화상자" 로만 읽힌다. */
|
|
56
57
|
ariaLabel: t('tooltip.training', '훈련 안내'), children: box }));
|
|
57
58
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
.word-image-tooltip {
|
|
2
2
|
position: fixed;
|
|
3
3
|
padding: var(--spacing-s);
|
|
4
4
|
background: var(--color-white);
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
z-index: var(--z-tooltip);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.
|
|
10
|
+
.word-image-tooltip__cells {
|
|
11
11
|
display: flex;
|
|
12
12
|
gap: var(--spacing-s);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.
|
|
15
|
+
.word-image-tooltip__cell {
|
|
16
16
|
position: relative;
|
|
17
17
|
width: 120px;
|
|
18
18
|
height: 120px;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
overflow: hidden;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
.
|
|
25
|
+
.word-image-tooltip__cell img {
|
|
26
26
|
width: 100%;
|
|
27
27
|
height: 100%;
|
|
28
28
|
object-fit: cover;
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
transition: opacity 0.2s;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.
|
|
33
|
+
.word-image-tooltip__spinner {
|
|
34
34
|
position: absolute;
|
|
35
35
|
inset: 0;
|
|
36
36
|
display: flex;
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
justify-content: center;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.
|
|
41
|
+
.word-image-tooltip__spinner::after {
|
|
42
42
|
content: '';
|
|
43
43
|
width: 24px;
|
|
44
44
|
height: 24px;
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
to { transform: rotate(360deg); }
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.
|
|
55
|
+
.word-image-tooltip__cell--text {
|
|
56
56
|
display: flex;
|
|
57
57
|
align-items: center;
|
|
58
58
|
justify-content: center;
|
|
@@ -5,13 +5,14 @@ import { createPortal } from 'react-dom';
|
|
|
5
5
|
import { getImageResolver } from '../../utils/imageConfig';
|
|
6
6
|
import { useWordImage } from '../../hooks/useWordImage';
|
|
7
7
|
import './WordImageTooltip.css';
|
|
8
|
+
import { withLegacy } from '../../utils/legacyBlocks';
|
|
8
9
|
function WordImageCell({ label, homonum }) {
|
|
9
10
|
const imageUrl = getImageResolver()?.(label, homonum) ?? '';
|
|
10
11
|
const { imgRef, loading, hasImage, onLoad, onError } = useWordImage(imageUrl);
|
|
11
12
|
if (!hasImage) {
|
|
12
|
-
return (_jsx("div", { className: "
|
|
13
|
+
return (_jsx("div", { className: withLegacy("word-image-tooltip__cell word-image-tooltip__cell--text h3"), children: _jsx("span", { children: label }) }));
|
|
13
14
|
}
|
|
14
|
-
return (_jsxs("div", { className: "
|
|
15
|
+
return (_jsxs("div", { className: withLegacy("word-image-tooltip__cell"), children: [loading && _jsx("div", { className: withLegacy("word-image-tooltip__spinner") }), _jsx("img", { ref: imgRef, src: imageUrl, alt: label, draggable: false, style: { opacity: loading ? 0 : 1 }, onLoad: onLoad, onError: onError })] }));
|
|
15
16
|
}
|
|
16
17
|
/** @public */
|
|
17
18
|
export default function WordImageTooltip({ words, anchorRect }) {
|
|
@@ -31,9 +32,9 @@ export default function WordImageTooltip({ words, anchorRect }) {
|
|
|
31
32
|
}, [anchorRect]);
|
|
32
33
|
if (!anchorRect || words.length === 0)
|
|
33
34
|
return null;
|
|
34
|
-
return createPortal(_jsx("div", { ref: ref, className: "
|
|
35
|
+
return createPortal(_jsx("div", { ref: ref, className: withLegacy("word-image-tooltip"), style: {
|
|
35
36
|
visibility: pos ? 'visible' : 'hidden',
|
|
36
37
|
left: pos?.left ?? 0,
|
|
37
38
|
top: pos?.top ?? -9999,
|
|
38
|
-
}, children: _jsx("div", { className: "
|
|
39
|
+
}, children: _jsx("div", { className: withLegacy("word-image-tooltip__cells"), children: words.map((w) => (_jsx(WordImageCell, { label: w.label, homonum: w.homonum }, `${w.label}_${w.homonum ?? 1}`))) }) }), document.body);
|
|
39
40
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* useBorder=false라 row 자체 좌우 패딩이 0이 되므로, Panel 바깥쪽에 사방 20px 패딩을 둔다.
|
|
2
2
|
Tooltip의 edgeMargin(기본 20px, 좌우 합 40px)을 넘지 않도록 max-width로 모바일 폭 잘림을 방지 —
|
|
3
3
|
패딩까지 포함해 계산되도록 box-sizing을 border-box로 둔다.
|
|
4
|
-
Panel 기본 border-radius(--radius-card, 12px)가 이 Panel을 감싸는 Tooltip 래퍼(.
|
|
4
|
+
Panel 기본 border-radius(--radius-card, 12px)가 이 Panel을 감싸는 Tooltip 래퍼(.tooltip__content)의
|
|
5
5
|
border-radius(--radius-m, 20px)보다 작아서, Panel의 각진 배경이 Tooltip의 둥근 모서리 안쪽에 그대로
|
|
6
|
-
보여 모서리가 제대로 표현되지 않았다 — Panel이
|
|
7
|
-
.noise-settings {
|
|
8
|
-
/* 위는 0 — 머리(.
|
|
6
|
+
보여 모서리가 제대로 표현되지 않았다 — Panel이 tooltip__content 전체를 꽉 채우므로 반지름을 맞춘다. */
|
|
7
|
+
.noise-settings-tooltip {
|
|
8
|
+
/* 위는 0 — 머리(.tooltip__header)의 구분선이 이미 위를 가르고, 첫 줄(.panel-row)이
|
|
9
9
|
제 높이 가운데에 내용을 세우므로 패널 위 안쪽 여백이 겹치면 첫 줄만 떠 보인다.
|
|
10
10
|
20px(말귀 사용자 "여백이 넓어보이네?") → 16px(0.119.0, 줄 사이 리듬에 맞춤) 뒤에도 떠 보인다는
|
|
11
11
|
말귀 사용자 판단으로 0(0.122.0). 좌우·아래는 그대로. */
|
|
@@ -15,35 +15,35 @@
|
|
|
15
15
|
border-radius: var(--radius-m);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
/* Tooltip 공용 header(.
|
|
19
|
-
기본값이라 이 툴팁엔 좁고 밋밋했다 — 이 헤더를 쓰는
|
|
18
|
+
/* Tooltip 공용 header(.tooltip__header)는 좌우 2px 패딩·고정 40px 높이·구분선 없음이
|
|
19
|
+
기본값이라 이 툴팁엔 좁고 밋밋했다 — 이 헤더를 쓰는 tooltip__content에 한해 Panel 본문(20px
|
|
20
20
|
인셋)과 좌우가 맞는 패딩과, 본문과 분리되어 보이도록 구분선을 준다(Panel 자체 헤더와 동일 패턴). */
|
|
21
|
-
.
|
|
21
|
+
.tooltip__content:has(.noise-settings-tooltip__header) .tooltip__header {
|
|
22
22
|
height: 60px;
|
|
23
23
|
/* 세로 패딩 없이 align-items:center로 높이만큼 자동 중앙정렬 — 닫기 버튼(40px) 기준으로 계산 불필요 */
|
|
24
24
|
padding: 0 20px;
|
|
25
25
|
border-bottom: 1px solid var(--color-darkWhite);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.noise-
|
|
28
|
+
.noise-settings-tooltip__header {
|
|
29
29
|
display: flex;
|
|
30
30
|
align-items: center;
|
|
31
31
|
justify-content: space-between;
|
|
32
32
|
width: 100%;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
.noise-
|
|
35
|
+
.noise-settings-tooltip__header span {
|
|
36
36
|
color: var(--color-darkGray);
|
|
37
37
|
font-weight: 600;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/* Panel/PanelRow(variant="custom" useFullWidth) 레이아웃 위에서, 슬라이더는 남는 폭을 채우고
|
|
41
41
|
값 텍스트는 오른쪽에 고정폭으로 붙는다. */
|
|
42
|
-
.noise-
|
|
42
|
+
.noise-settings-tooltip__slider-input.slider--horizontal {
|
|
43
43
|
flex: 1 1 auto;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.noise-
|
|
46
|
+
.noise-settings-tooltip__value {
|
|
47
47
|
color: var(--color-main);
|
|
48
48
|
flex: 0 0 auto;
|
|
49
49
|
/* min-width가 아니라 고정 width — 값 문자열 길이가 바뀔 때(예: 80% → 100%, 0.50x → 1.25x)
|
|
@@ -59,21 +59,21 @@
|
|
|
59
59
|
슬라이더만 흐리면 옆의 `1.0배` 가 또렷하게 남아 **여전히 켜져 있다는 거짓말**을 한다 —
|
|
60
60
|
끄는 것과 "안 쓰인다고 보이는 것" 은 한 벌이다. 값 자체는 그대로 둔다(종류를 다시
|
|
61
61
|
고르면 쓰던 비율로 돌아온다). */
|
|
62
|
-
.noise-
|
|
62
|
+
.noise-settings-tooltip__value--disabled {
|
|
63
63
|
opacity: 0.4;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
/* (208) 폭만 빌리는 그림자 줄 — NoiseSettingsTooltip.tsx 의 `noise-
|
|
66
|
+
/* (208) 폭만 빌리는 그림자 줄 — NoiseSettingsTooltip.tsx 의 `noise-settings-tooltip__width-ghost` 주석을 볼 것.
|
|
67
67
|
가로 폭은 참 줄과 똑같이 내고(그래서 좌우 패딩은 그대로), 높이만 0 으로 접는다.
|
|
68
68
|
`visibility: hidden` 이라 선도 그림자도 안 그린다. 줄 사이 구분선은 `.panel-row + .panel-row` 인데
|
|
69
69
|
이 감싸개는 `.panel-row` 가 아니라 그 규칙에 안 걸린다 — 그래도 안쪽 줄의 선·여백·최소높이를 0 으로 둔다. */
|
|
70
|
-
.noise-
|
|
70
|
+
.noise-settings-tooltip__width-ghost {
|
|
71
71
|
visibility: hidden;
|
|
72
72
|
height: 0;
|
|
73
73
|
overflow: hidden;
|
|
74
74
|
pointer-events: none;
|
|
75
75
|
}
|
|
76
|
-
.noise-
|
|
76
|
+
.noise-settings-tooltip__width-ghost .panel-row {
|
|
77
77
|
padding-top: 0;
|
|
78
78
|
padding-bottom: 0;
|
|
79
79
|
margin: 0;
|
|
@@ -12,6 +12,7 @@ import { cx } from '../../utils/cx';
|
|
|
12
12
|
import { getNoiseTypeOptions } from '../Tooltip/tooltipConstants';
|
|
13
13
|
import { useNoisePlayer, noiseRatioOf, DEFAULT_NOISE_SETTINGS, NOISE_RATIO_MAX, NOISE_RATIO_STEP } from './NoisePlayerContext';
|
|
14
14
|
import './NoiseSettingsTooltip.css';
|
|
15
|
+
import { withLegacy } from '../../utils/legacyBlocks';
|
|
15
16
|
// 소음 종류 세그먼트의 "없음" — 별도 CoreNoiseType이 아니라 enabled=false를 의미(type은 마지막 값 유지).
|
|
16
17
|
// enabled/소음 비율=0으로 이미 "무음"을 표현하고 있어(다른 곳의 소음 크기 "없음"과 동일 패턴), 새 타입을
|
|
17
18
|
// 추가하는 대신 세그먼트 선택값만 enabled 여부로 매핑한다.
|
|
@@ -22,7 +23,7 @@ const PLAY_SPEED_MAX = 1.5;
|
|
|
22
23
|
const PLAY_SPEED_STEP = 0.25;
|
|
23
24
|
/** 제목 + 가로 슬라이더 + 값 라벨 PanelRow */
|
|
24
25
|
function SliderPanelRow({ title, valueLabel, value, min, max, step, tickStep, size, disabled, onChange }) {
|
|
25
|
-
return (_jsxs(PanelRow, { variant: "custom", label: title, useFullWidth: true, children: [_jsx(Slider, { value: value, onChange: onChange, min: min, max: max, step: step, size: size, showBgTick: true, tickStep: tickStep, ariaLabel: title, disabled: disabled, className: "noise-
|
|
26
|
+
return (_jsxs(PanelRow, { variant: "custom", label: title, useFullWidth: true, children: [_jsx(Slider, { value: value, onChange: onChange, min: min, max: max, step: step, size: size, showBgTick: true, tickStep: tickStep, ariaLabel: title, disabled: disabled, className: withLegacy("noise-settings-tooltip__slider-input") }), _jsx("div", { className: withLegacy(cx('noise-settings-tooltip__value', 'button-1', disabled ? 'noise-settings-tooltip__value--disabled' : '')), children: valueLabel })] }));
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* 소음 설정 툴팁 — 각 항목을 행으로 세로 배치, 슬라이더는 가로 방향.
|
|
@@ -80,5 +81,5 @@ export default function NoiseSettingsTooltip({ anchorRect, onClose, hideNoiseRow
|
|
|
80
81
|
{ key: NONE_KEY, label: t('training.noise.type.none', '없음') },
|
|
81
82
|
...getNoiseTypeOptions(t).map(opt => ({ key: opt.value, label: opt.label })),
|
|
82
83
|
];
|
|
83
|
-
return (_jsx(Tooltip, { anchorRect: anchorRect, offset: 12, onClose: onClose, ariaLabel: t('training.trainingSettingsTitle', '훈련 설정'), isMobilePopup: false, closeOnOutsideClick: false, header: _jsxs("div", { className: "noise-
|
|
84
|
+
return (_jsx(Tooltip, { anchorRect: anchorRect, offset: 12, onClose: onClose, ariaLabel: t('training.trainingSettingsTitle', '훈련 설정'), isMobilePopup: false, closeOnOutsideClick: false, header: _jsxs("div", { className: withLegacy("noise-settings-tooltip__header"), children: [_jsx("span", { children: t('training.trainingSettingsTitle', '훈련 설정') }), _jsx(Button, { htmlType: "button", size: 40, type: "dot", icon: "x", variant: "transparent-gray", useBorder: false, ariaLabel: t('common.close', '닫기'), onClick: onClose })] }), children: _jsxs(Panel, { className: withLegacy("noise-settings-tooltip"), useBorder: false, labelWidth: 72, children: [_jsx(SliderPanelRow, { title: t('training.playVolumeTitle', '전체 소리'), valueLabel: `${volPct}%`, value: volPct, min: 0, max: 100, step: 10, size: sliderSize, onChange: handlePlayVolumeChange }), _jsx(SliderPanelRow, { title: t('training.playSpeedTitle', '재생 속도'), valueLabel: `${playbackRate.toFixed(2)}x`, value: playbackRate, min: PLAY_SPEED_MIN, max: PLAY_SPEED_MAX, step: PLAY_SPEED_STEP, size: sliderSize, onChange: handlePlaySpeedChange }), !hideNoiseRows && (_jsxs(_Fragment, { children: [_jsx(PanelRow, { variant: "custom", label: t('training.noiseTypeTitle', '소음 종류'), useFullWidth: true, children: _jsx(SegmentedControl, { ariaLabel: t('training.noiseTypeTitle', '소음 종류'), size: 40, shape: "rounded", options: kindOptions, value: noiseEnabled ? noiseType : NONE_KEY, onChange: handleTypeChange }) }), _jsx(SliderPanelRow, { title: t('training.noiseRatioTitle', '소음 비율'), valueLabel: t('training.noiseRatioValue', '{{ratio}}배', { ratio: ratio.toFixed(1) }), value: ratio, min: 0, max: NOISE_RATIO_MAX, step: NOISE_RATIO_STEP, size: sliderSize, disabled: !noiseEnabled, onChange: handleRatioChange })] })), hideNoiseRows && (_jsx("div", { className: withLegacy("noise-settings-tooltip__width-ghost"), "aria-hidden": "true", inert: true, children: _jsx(PanelRow, { variant: "custom", label: '\u00a0', useFullWidth: true, children: _jsx(SegmentedControl, { ariaLabel: "width-ghost", size: 40, shape: "rounded", options: kindOptions, value: NONE_KEY, onChange: () => { } }) }) }))] }) }));
|
|
84
85
|
}
|
|
@@ -87,7 +87,7 @@ export default function TrainingPagePopupBottom({ useNoiseSettingBtn = false, on
|
|
|
87
87
|
const meters = (_jsxs(_Fragment, { children: [_jsxs("div", { className: "pp-bottom__meter", children: [_jsx("span", { className: "pp-bottom__meter-label caption-1", children: t('training.meter.sentence', '재생') }), _jsx(AudioMeter, { analyser: noisePlayer?.mainAnalyser ?? null, orientation: "horizontal", length: 112, label: "db", labelPos: "left", ariaLabel: t('training.meter.sentence', '재생') })] }), _jsxs("div", { className: "pp-bottom__meter", children: [_jsx("span", { className: "pp-bottom__meter-label caption-1", children: t('training.meter.noise', '소음') }), _jsx(AudioMeter, { analyser: noisePlayer?.noiseAnalyser ?? null, orientation: "horizontal", length: 112, label: "db", labelPos: "left", ariaLabel: t('training.meter.noise', '소음') })] })] }));
|
|
88
88
|
/* 설정 창은 판 밖(body)으로 포털된다 — 열리면 초점을 창 첫 칸으로, 닫히면 연 단추로(useFloatingFocus 참고) */
|
|
89
89
|
const panelOpen = useNoiseSettingBtn && open;
|
|
90
|
-
useFloatingFocus(panelOpen, () => (typeof document !== 'undefined' ? document.querySelector('.noise-
|
|
90
|
+
useFloatingFocus(panelOpen, () => (typeof document !== 'undefined' ? document.querySelector('.noise-settings-tooltip__header')?.closest('.tooltip__content') ?? null : null), () => {
|
|
91
91
|
const visibleButtons = [desktopRef.current, mobileRef.current]
|
|
92
92
|
.map((w) => w?.querySelector('button') ?? null)
|
|
93
93
|
.find((b) => !!b && b.getClientRects().length > 0);
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
width: 100%;
|
|
106
106
|
}
|
|
107
107
|
/* ensure tooltip/text color inside dark mode is readable */
|
|
108
|
-
.training-text-box.is-dark .
|
|
108
|
+
.training-text-box.is-dark .text-box-tooltip__text,
|
|
109
109
|
.training-text-box.is-dark .training-text-box__inner {
|
|
110
110
|
color: var(--color-deepWhite);
|
|
111
111
|
}
|
|
@@ -23,9 +23,9 @@ export default function TrainingStepTitle({ title, children, className = "", sta
|
|
|
23
23
|
useFloatingFocus(showPreview && !!anchorRect, () => {
|
|
24
24
|
if (typeof document === 'undefined')
|
|
25
25
|
return null;
|
|
26
|
-
const tooltipEls = Array.from(document.querySelectorAll('.
|
|
26
|
+
const tooltipEls = Array.from(document.querySelectorAll('.tooltip__content'));
|
|
27
27
|
for (let i = tooltipEls.length - 1; i >= 0; i--)
|
|
28
|
-
if (tooltipEls[i].querySelector('.
|
|
28
|
+
if (tooltipEls[i].querySelector('.text-box-tooltip__root'))
|
|
29
29
|
return tooltipEls[i];
|
|
30
30
|
return null;
|
|
31
31
|
}, () => btnRef.current?.querySelector('button') ?? null);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* 않고, 창 안 Tab 은 Tooltip 이 스스로 가두며, 낭독기는 초점이 든 창을 읽는다. 공용 파일은 건드리지 않는다.
|
|
8
8
|
*
|
|
9
9
|
* @param open 창이 열려 있나
|
|
10
|
-
* @param findRoot 열린 창의 뿌리(.
|
|
10
|
+
* @param findRoot 열린 창의 뿌리(.tooltip__content)를 찾는다 — 포털이라 ref 대신 찾는다
|
|
11
11
|
* @param returnTo 닫힐 때 초점을 돌려줄 곳(연 단추). 초점이 이미 다른 칸으로 옮겨 갔으면 빼앗지 않는다.
|
|
12
12
|
*/
|
|
13
13
|
export declare function useFloatingFocus(open: boolean, findRoot: () => HTMLElement | null, returnTo: () => HTMLElement | null): void;
|
|
@@ -10,7 +10,7 @@ import { FOCUSABLE_SELECTOR } from '../../hooks/useFocusTrap';
|
|
|
10
10
|
* 않고, 창 안 Tab 은 Tooltip 이 스스로 가두며, 낭독기는 초점이 든 창을 읽는다. 공용 파일은 건드리지 않는다.
|
|
11
11
|
*
|
|
12
12
|
* @param open 창이 열려 있나
|
|
13
|
-
* @param findRoot 열린 창의 뿌리(.
|
|
13
|
+
* @param findRoot 열린 창의 뿌리(.tooltip__content)를 찾는다 — 포털이라 ref 대신 찾는다
|
|
14
14
|
* @param returnTo 닫힐 때 초점을 돌려줄 곳(연 단추). 초점이 이미 다른 칸으로 옮겨 갔으면 빼앗지 않는다.
|
|
15
15
|
*/
|
|
16
16
|
export function useFloatingFocus(open, findRoot, returnTo) {
|
|
@@ -45,7 +45,7 @@ export function useFloatingFocus(open, findRoot, returnTo) {
|
|
|
45
45
|
cancelAnimationFrame(raf);
|
|
46
46
|
// 닫혔다(또는 떠난다) — 초점이 창과 함께 사라져 body 로 떨어졌을 때만 연 단추로 돌려준다
|
|
47
47
|
const active = document.activeElement;
|
|
48
|
-
if (!active || active === document.body || !document.contains(active) || !!active.closest('.
|
|
48
|
+
if (!active || active === document.body || !document.contains(active) || !!active.closest('.tooltip__content')) {
|
|
49
49
|
const returnButton = returnToRef.current();
|
|
50
50
|
if (returnButton) {
|
|
51
51
|
try {
|
|
@@ -149,13 +149,6 @@
|
|
|
149
149
|
border-top: 1px solid var(--color-darkWhite);
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
/* 결과 하단 페이지네이션 — 상단 툴바와 별개로 목록 아래에도 노출(긴 목록 편의) */
|
|
153
|
-
.word-search-result-block__pagination-bottom {
|
|
154
|
-
display: flex;
|
|
155
|
-
justify-content: center;
|
|
156
|
-
margin-top: 16px;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
152
|
/* 결과 없음 아래 한 줄 — 왜 없는지 설명한다. 본문보다 옅게 두되, 읽히지 않을 만큼
|
|
160
153
|
옅으면 안 된다(--color-sub 는 tokens.css 에 정의돼 있다). */
|
|
161
154
|
.word-search-result-block__empty-wrap {
|
|
@@ -208,5 +208,5 @@ export default function WordSearchResultBlock({ titleIcon, resultCount, resultUn
|
|
|
208
208
|
}, onMouseLeave: handleHoverLeave, children: _jsx(Button, { htmlType: "button", size: "word", align: "grid", label: (item.words ?? []).map(w => w.label), subLabel: (item.words ?? []).some(w => w.subLabel)
|
|
209
209
|
? (item.words ?? []).map(w => w.subLabel)
|
|
210
210
|
: undefined, selected: isSelected, onClick: () => handleClick(item.id), minWidth: 200 }) }, item.id));
|
|
211
|
-
}) })), hoverWords && hoverAnchorRect && (_jsx(WordImageTooltip, { words: hoverWords, anchorRect: hoverAnchorRect }))] }),
|
|
211
|
+
}) })), hoverWords && hoverAnchorRect && (_jsx(WordImageTooltip, { words: hoverWords, anchorRect: hoverAnchorRect }))] }), (onClearSelection || onPrint) && (_jsxs("div", { className: "word-search-result-block__actions", children: [onClearSelection && (_jsx(Button, { htmlType: "button", size: "56", type: "bar", label: t('common.resetSelection', '선택 초기화'), selected: false, disabled: selected.length === 0, onClick: selected.length === 0 ? undefined : onClearSelection })), onPrint && (_jsx("div", { onClick: selected.length === 0 ? onPrintEmpty : undefined, children: _jsx(Button, { htmlType: "button", size: "56", type: "bar", variant: "main", label: t('wordTable.title', '단어 표 만들기'), disabled: selected.length === 0, onClick: selected.length === 0 ? undefined : onPrint }) }))] }))] }));
|
|
212
212
|
}
|
|
@@ -191,8 +191,8 @@ export function captureHtml(els, paperW, paperH, autoPrint = false, fileName = '
|
|
|
191
191
|
}
|
|
192
192
|
/* 만드는 동안만 쓰는 손잡이들 — 종이에는 안 나간다(renderCellAction 이 얹은 것도 이 줄 안에 있다).
|
|
193
193
|
**여기는 템플릿 글 안이다** — 홑따옴표 대신 역따옴표를 쓰면 글이 거기서 끊긴다. */
|
|
194
|
-
.word-
|
|
195
|
-
.word-
|
|
194
|
+
.word-table__card-close,
|
|
195
|
+
.word-table__card-actions { display: none; }
|
|
196
196
|
/* 머리글은 격자 위에 얹힌다. 용지 안쪽 여백(57px)을 이미 .paper-wrap 이 갖고 있어
|
|
197
197
|
여기서는 아래 간격만 준다. 격자는 제 높이를 스스로 잡으므로 밀려도 잘리지 않는다. */
|
|
198
198
|
.paper-head {
|
|
@@ -213,7 +213,7 @@ export function captureHtml(els, paperW, paperH, autoPrint = false, fileName = '
|
|
|
213
213
|
@page { size: A4 ${paperW > paperH ? 'landscape' : 'portrait'}; margin: 0; }
|
|
214
214
|
/* 본 문서에서 복사해온 WordTable.css의 print 규칙은 body * 를 전부 숨기고
|
|
215
215
|
.word-table 만 다시 보여주는데, 이 팝업엔 .word-table 래퍼가 없어(내용은
|
|
216
|
-
.word-
|
|
216
|
+
.word-table__content 클론) 전부 숨겨진 채 인쇄된다. 여기서 복원한다. */
|
|
217
217
|
body * { visibility: visible; }
|
|
218
218
|
html, body { background: #fff; overflow: visible; padding: 0; gap: 0; }
|
|
219
219
|
/* 종이 한 장 = 한 쪽. height:100% 는 앱에 html·body 높이가 없으면 auto 로 풀려 종이가 내용만큼 커지고(2장 → 4쪽),
|
|
@@ -224,7 +224,7 @@ export function captureHtml(els, paperW, paperH, autoPrint = false, fileName = '
|
|
|
224
224
|
display: flex; flex-direction: column; overflow: hidden;
|
|
225
225
|
page-break-after: always; break-after: page;
|
|
226
226
|
}
|
|
227
|
-
.paper-wrap > .word-
|
|
227
|
+
.paper-wrap > .word-table__content { flex: 1 1 0; min-height: 0; height: auto; }
|
|
228
228
|
.paper-wrap:last-of-type { page-break-after: auto; break-after: auto; }
|
|
229
229
|
.word-table-cell__play-button { display: none; }
|
|
230
230
|
.new-window-close { display: none; }
|