@ihabdevteam/core 0.219.0 → 0.221.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 +72 -0
- package/dist/components.cjs.js +76 -37
- package/dist/components.esm.css +2 -2
- package/dist/hooks.cjs.js +1 -1
- package/dist/i18n.cjs.js +1 -1
- package/dist/ihabdevteam-core.cjs.js +120 -81
- package/dist/ihabdevteam-core.d.ts +8 -1
- package/dist/packages/core/src/components/Word/useWordTablePrint.d.ts +7 -0
- package/dist/packages/core/src/components/Word/wordTablePrint.js +39 -7
- package/dist/packages/core/src/components/WordTable.css +19 -21
- package/dist/packages/core/src/components/WordTable.js +1 -8
- 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
|
@@ -1626,7 +1626,7 @@ export declare function copyText(text: string): Promise<boolean>;
|
|
|
1626
1626
|
*
|
|
1627
1627
|
* 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
|
|
1628
1628
|
*/
|
|
1629
|
-
export declare const CORE_VERSION = "0.
|
|
1629
|
+
export declare const CORE_VERSION = "0.220.0";
|
|
1630
1630
|
|
|
1631
1631
|
/** @public */
|
|
1632
1632
|
declare const coreDefault: Record<string, unknown>;
|
|
@@ -9796,6 +9796,13 @@ export declare interface UseWordTablePrintOptions {
|
|
|
9796
9796
|
onPopupBlocked?: () => void;
|
|
9797
9797
|
/** 종이 맨 위에 찍을 한 줄(누구의·언제·무슨 표). 인쇄되는 것은 격자뿐이라
|
|
9798
9798
|
* 이것이 없으면 뽑아 둔 종이에 아무 단서도 안 남는다. */
|
|
9799
|
+
/**
|
|
9800
|
+
* 쪽마다 종이 **맨 위**에 찍는 한 줄(누구의 · 언제 · 무슨 표).
|
|
9801
|
+
*
|
|
9802
|
+
* **띠(`brand`)를 쓰면 대개 이것은 안 준다** — 띠 위 오른쪽이 표 이름·기관·번호를
|
|
9803
|
+
* 이미 싣는다. 둘 다 주면 번호가 종이에 **두 번** 찍힌다(말귀가 그 잔재를 걷었다,
|
|
9804
|
+
* 2026-09-30). 띠를 안 쓰는 종이(채점지 등)에는 이 줄이 유일한 식별자다.
|
|
9805
|
+
*/
|
|
9799
9806
|
header?: string;
|
|
9800
9807
|
}
|
|
9801
9808
|
|
|
@@ -11,6 +11,13 @@ export interface UseWordTablePrintOptions {
|
|
|
11
11
|
onPopupBlocked?: () => void;
|
|
12
12
|
/** 종이 맨 위에 찍을 한 줄(누구의·언제·무슨 표). 인쇄되는 것은 격자뿐이라
|
|
13
13
|
* 이것이 없으면 뽑아 둔 종이에 아무 단서도 안 남는다. */
|
|
14
|
+
/**
|
|
15
|
+
* 쪽마다 종이 **맨 위**에 찍는 한 줄(누구의 · 언제 · 무슨 표).
|
|
16
|
+
*
|
|
17
|
+
* **띠(`brand`)를 쓰면 대개 이것은 안 준다** — 띠 위 오른쪽이 표 이름·기관·번호를
|
|
18
|
+
* 이미 싣는다. 둘 다 주면 번호가 종이에 **두 번** 찍힌다(말귀가 그 잔재를 걷었다,
|
|
19
|
+
* 2026-09-30). 띠를 안 쓰는 종이(채점지 등)에는 이 줄이 유일한 식별자다.
|
|
20
|
+
*/
|
|
14
21
|
header?: string;
|
|
15
22
|
}
|
|
16
23
|
/** @public */
|
|
@@ -105,13 +105,6 @@ export function captureHtml(els, paperW, paperH, autoPrint = false, fileName = '
|
|
|
105
105
|
아무도 opacity 를 되돌리지 않아 **빈칸으로 인쇄**되고, 새 창·내려받은 HTML 에서는 스피너가 영영 돈다(말귀 내 단어표
|
|
106
106
|
'인쇄' 는 열자마자 100ms 뒤 인쇄해 처음 보는 표는 거의 늘 이랬다). */
|
|
107
107
|
clone.querySelectorAll('.word-table-cell__spinner').forEach(s => s.remove());
|
|
108
|
-
/* **머리·바닥 띠의 배율 되돌림을 걷는다.**
|
|
109
|
-
화면의 표는 미리보기 상자에 맞춰 줄어 있고, 띠가 그만큼 줄지 않도록 격자에
|
|
110
|
-
`--wt-unscale`(1/배율)이 **인라인으로** 박혀 있다. 이 문서는 그 격자를 인라인 스타일째
|
|
111
|
-
복사해 오는데 여기서는 종이가 제 크기다 — 그대로 두면 미리보기가 좁았을수록 로고와
|
|
112
|
-
글씨가 그 배수만큼 커진다(0.5 로 보고 있었으면 두 배). CSS 로 덮으려면 인라인을
|
|
113
|
-
이겨야 해 `!important` 가 필요하니, 아예 지운다. */
|
|
114
|
-
clone.style.removeProperty('--wt-unscale');
|
|
115
108
|
/* 불러오는 중이던 그림은 opacity 를 **그대로 두고** 받아지면 보이고 실패하면 숨게 한다 — 지우기만 하면 없는 그림(404, 화면에서는
|
|
116
109
|
onError 로 칸이 사라짐)이 인쇄 문서에서 깨진 그림 아이콘과 alt 글자로 찍혔다. autoPrint 는 그림 로드를 기다린 뒤 인쇄한다. */
|
|
117
110
|
clone.querySelectorAll('img').forEach(i => {
|
|
@@ -206,6 +199,43 @@ export function captureHtml(els, paperW, paperH, autoPrint = false, fileName = '
|
|
|
206
199
|
scale();
|
|
207
200
|
window.addEventListener('resize', scale);
|
|
208
201
|
|
|
202
|
+
/* **칸 글씨를 이 종이 칸에 맞춰 다시 센다.**
|
|
203
|
+
화면의 칸은 'ResizeObserver' 로 재서 'transform: scale(n)' 을 칸 안쪽에 직접 써
|
|
204
|
+
둔다. 그 값이 클론을 타고 여기까지 따라오는데, 여기 칸은 화면 칸이 아니다 —
|
|
205
|
+
종이(paper-wrap)는 제 치수를 갖고, 인쇄가 걸리면 다시 100% x 100vh 로 바뀐다.
|
|
206
|
+
사람이 인쇄 대화상자에서 A4 아닌 종이를 고르면 그 100vh 가 또 달라진다. 굳은
|
|
207
|
+
배율을 그대로 쓰면 화면에서 칸을 꽉 채우던 글씨가 종이에서 작아진다(Letter 가로
|
|
208
|
+
실측 -3.4%, 사용자 신고 2026-09-30).
|
|
209
|
+
그래서 칸마다 새겨 둔 기준값(data-ref-w/h)으로 **화면과 똑같은 셈**을 여기서 다시
|
|
210
|
+
한다 — 'Math.min(w/refW, h/refH)', 1 을 넘겨도 천장을 안 씌운다(2026-09-22 결정).
|
|
211
|
+
'clientWidth' 는 배치 좌표라 종이에 걸린 'transform: scale()' 에 안 흔들린다. */
|
|
212
|
+
function refit() {
|
|
213
|
+
var cells = document.querySelectorAll('.word-table-cell[data-ref-w]');
|
|
214
|
+
Array.prototype.forEach.call(cells, function (cell) {
|
|
215
|
+
var inner = cell.querySelector('.word-table-cell__inner');
|
|
216
|
+
if (!inner) return;
|
|
217
|
+
var rw = parseFloat(cell.getAttribute('data-ref-w'));
|
|
218
|
+
var rh = parseFloat(cell.getAttribute('data-ref-h'));
|
|
219
|
+
if (!(rw > 0) || !(rh > 0)) return;
|
|
220
|
+
var cs = getComputedStyle(cell);
|
|
221
|
+
var w = cell.clientWidth - parseFloat(cs.paddingLeft || 0) - parseFloat(cs.paddingRight || 0);
|
|
222
|
+
var h = cell.clientHeight - parseFloat(cs.paddingTop || 0) - parseFloat(cs.paddingBottom || 0);
|
|
223
|
+
/* 아직 자리를 못 잡은 칸(0)은 건드리지 않는다 — 화면이 준 배율이 0 보다는 낫다 */
|
|
224
|
+
if (!(w > 0) || !(h > 0)) return;
|
|
225
|
+
inner.style.transform = 'scale(' + Math.min(w / rw, h / rh) + ')';
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
refit();
|
|
229
|
+
window.addEventListener('resize', refit);
|
|
230
|
+
/* 인쇄 배치로 바뀌는 순간을 브라우저마다 다른 신호로 알린다 — 크롬은 beforeprint,
|
|
231
|
+
파이어폭스는 print 매체 질의가 먼저 켜진다. 둘 다 걸어 두고 두 번 세도 값이 같다. */
|
|
232
|
+
window.addEventListener('beforeprint', refit);
|
|
233
|
+
try {
|
|
234
|
+
var mq = window.matchMedia('print');
|
|
235
|
+
if (mq.addEventListener) mq.addEventListener('change', refit);
|
|
236
|
+
else if (mq.addListener) mq.addListener(refit);
|
|
237
|
+
} catch (e) { /* matchMedia 가 없는 환경 — 위 둘로 충분하다 */ }
|
|
238
|
+
|
|
209
239
|
function resetWrap(w) {
|
|
210
240
|
var pp = w.querySelector('[data-play-state="play"]');
|
|
211
241
|
var pa = w.querySelector('[data-play-state="pause"]');
|
|
@@ -253,6 +283,8 @@ export function captureHtml(els, paperW, paperH, autoPrint = false, fileName = '
|
|
|
253
283
|
if (printed) return;
|
|
254
284
|
printed = true;
|
|
255
285
|
requestAnimationFrame(function () {
|
|
286
|
+
/* 그림·글꼴이 다 온 뒤 한 번 더 — 그림이 늦게 오면 칸 높이가 달라진다 */
|
|
287
|
+
refit();
|
|
256
288
|
requestAnimationFrame(function () { window.print(); });
|
|
257
289
|
});
|
|
258
290
|
}
|
|
@@ -72,6 +72,11 @@
|
|
|
72
72
|
선언도 따라간다. 여기서는 기본값을 **선언하지 않고** `var(…, 기본)` 의 뒷값으로만
|
|
73
73
|
둔다: 선언해 버리면 이 마디가 `:root` 보다 가까워 부르는 쪽 값이 진다.
|
|
74
74
|
|
|
75
|
+
**값은 종이 좌표다 — 띠도 표와 함께 줄어든다.** 한때 띠만 배율을 되돌려(`--wt-unscale`)
|
|
76
|
+
화면에서 크기를 고정했는데, 그러면 미리보기 폭마다 **표와 띠의 견줌이 달라져** 화면이
|
|
77
|
+
종이를 못 닮았다(실측 2026-09-30: 미리보기 60%에서 낱말÷띠가 0.64 → 0.33). 종이에서는
|
|
78
|
+
띠도 같은 비율로 찍히므로, 미리보기가 할 일은 그 비율을 그대로 보여 주는 것이다.
|
|
79
|
+
|
|
75
80
|
| 변수 | 기본 |
|
|
76
81
|
|---|---|
|
|
77
82
|
| `--wt-band-top-height` · `--wt-band-top-size` · `--wt-band-top-align` | 28px · 11px · center |
|
|
@@ -82,10 +87,10 @@
|
|
|
82
87
|
키웠을 때 띠가 표를 파고들고(위 −4px · 아래 −6px), 테두리가 칸 없는 빈 자리에 그려졌다.
|
|
83
88
|
한 값에서 나오게 두면 그 둘이 다시 안 어긋난다. */
|
|
84
89
|
.word-table-block__content--brand-top {
|
|
85
|
-
padding-top: calc(
|
|
90
|
+
padding-top: calc(var(--wt-band-top-height, 28px) + 4px);
|
|
86
91
|
}
|
|
87
92
|
.word-table-block__content--brand-bottom {
|
|
88
|
-
padding-bottom: calc(
|
|
93
|
+
padding-bottom: calc(var(--wt-band-bottom-height, 22px) + 4px);
|
|
89
94
|
}
|
|
90
95
|
/* 절취선 바탕·외곽선은 칸이 있는 데까지만 — 띠까지 두르면 로고가 표 안에 든 것처럼 보인다 */
|
|
91
96
|
.word-table-block__content--brand-top.word-table-block__content--cut-show,
|
|
@@ -94,10 +99,10 @@
|
|
|
94
99
|
}
|
|
95
100
|
/* 위 여백과 **같은 셈**이다 — 따로 적지 않는다(그래서 어긋날 수가 없다) */
|
|
96
101
|
.word-table-block__content--brand-top.word-table-block__content--outline::after {
|
|
97
|
-
top: calc(
|
|
102
|
+
top: calc(var(--wt-band-top-height, 28px) + 4px);
|
|
98
103
|
}
|
|
99
104
|
.word-table-block__content--brand-bottom.word-table-block__content--outline::after {
|
|
100
|
-
bottom: calc(
|
|
105
|
+
bottom: calc(var(--wt-band-bottom-height, 22px) + 4px);
|
|
101
106
|
}
|
|
102
107
|
|
|
103
108
|
.word-table__band {
|
|
@@ -106,7 +111,7 @@
|
|
|
106
111
|
right: 0;
|
|
107
112
|
display: flex;
|
|
108
113
|
justify-content: space-between;
|
|
109
|
-
gap:
|
|
114
|
+
gap: 12px;
|
|
110
115
|
z-index: 2;
|
|
111
116
|
pointer-events: none;
|
|
112
117
|
color: var(--color-gray);
|
|
@@ -118,8 +123,8 @@
|
|
|
118
123
|
배율 되돌림은 그대로 받는다. */
|
|
119
124
|
.word-table__band--top {
|
|
120
125
|
top: 0;
|
|
121
|
-
height:
|
|
122
|
-
font-size:
|
|
126
|
+
height: var(--wt-band-top-height, 28px);
|
|
127
|
+
font-size: var(--wt-band-top-size, 13px);
|
|
123
128
|
line-height: 1.35;
|
|
124
129
|
align-items: var(--wt-band-top-align, center);
|
|
125
130
|
}
|
|
@@ -127,14 +132,14 @@
|
|
|
127
132
|
/* 로고까지 이 색을 받는다 — 마스크를 `currentColor` 로 칠하므로 글씨와 늘 같은 색이다 */
|
|
128
133
|
color: var(--color-gray);
|
|
129
134
|
bottom: 0;
|
|
130
|
-
height:
|
|
131
|
-
font-size:
|
|
135
|
+
height: var(--wt-band-bottom-height, 22px);
|
|
136
|
+
font-size: var(--wt-band-bottom-size, 11px);
|
|
132
137
|
line-height: 1.35;
|
|
133
138
|
align-items: var(--wt-band-bottom-align, center);
|
|
134
139
|
}
|
|
135
140
|
|
|
136
141
|
.word-table__brand-logo {
|
|
137
|
-
height:
|
|
142
|
+
height: var(--wt-brand-logo-height, 28px);
|
|
138
143
|
width: auto;
|
|
139
144
|
display: block;
|
|
140
145
|
flex-shrink: 0;
|
|
@@ -153,7 +158,7 @@
|
|
|
153
158
|
(마스크가 `contain` 이라 좁은 쪽에 맞는다). 말귀 로고(`<img>`)와 같은 규약이 된다. */
|
|
154
159
|
.word-table__brand-logo--ihab {
|
|
155
160
|
display: block;
|
|
156
|
-
height:
|
|
161
|
+
height: var(--wt-brand-ihab-height, 17px);
|
|
157
162
|
width: auto;
|
|
158
163
|
aspect-ratio: 264 / 100;
|
|
159
164
|
flex-shrink: 0;
|
|
@@ -188,7 +193,7 @@
|
|
|
188
193
|
.word-table__brand-by {
|
|
189
194
|
display: flex;
|
|
190
195
|
align-items: center;
|
|
191
|
-
gap:
|
|
196
|
+
gap: var(--wt-brand-gap, 8px);
|
|
192
197
|
min-width: 0;
|
|
193
198
|
}
|
|
194
199
|
.word-table__copyright {
|
|
@@ -201,7 +206,7 @@
|
|
|
201
206
|
.word-table__band-end {
|
|
202
207
|
display: flex;
|
|
203
208
|
align-items: center;
|
|
204
|
-
gap:
|
|
209
|
+
gap: 12px;
|
|
205
210
|
min-width: 0;
|
|
206
211
|
}
|
|
207
212
|
|
|
@@ -209,7 +214,7 @@
|
|
|
209
214
|
.word-table__ident {
|
|
210
215
|
display: flex;
|
|
211
216
|
align-items: center;
|
|
212
|
-
gap:
|
|
217
|
+
gap: 6px;
|
|
213
218
|
min-width: 0;
|
|
214
219
|
}
|
|
215
220
|
/* 이름이 길면 이름만 줄어든다 — 번호는 잘리면 확인 글자가 사라져 뜻이 없다 */
|
|
@@ -636,13 +641,6 @@
|
|
|
636
641
|
transform: none !important;
|
|
637
642
|
}
|
|
638
643
|
|
|
639
|
-
/* 표가 제 크기로 돌아오니 띠의 배율 되돌림도 끈다 — 안 끄면 화면에서 좁게 보던 만큼
|
|
640
|
-
로고와 글씨가 커져 찍힌다. 인라인으로 박힌 값이라 `!important` 라야 이긴다
|
|
641
|
-
(위 `transform` 과 같은 까닭). */
|
|
642
|
-
.word-table-block__content {
|
|
643
|
-
--wt-unscale: 1 !important;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
644
|
.word-table-block__card-close,
|
|
647
645
|
.word-table-block__card-actions,
|
|
648
646
|
.word-table-block__card-handle { display: none; }
|
|
@@ -160,7 +160,7 @@ function WordCell({ label, subLabel, colloquialLabel, homonum, showWord = true,
|
|
|
160
160
|
obs.observe(el);
|
|
161
161
|
return () => obs.disconnect();
|
|
162
162
|
}, [refW, refH]);
|
|
163
|
-
return (_jsxs("div", { ref: outerRef, className: cx('word-table-cell', hasImage ? 'word-table-cell--with-image' : ''), 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 })] })), 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__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, showTooltipInfo: 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', '멈춤'), onClick: handlePlay }) })] }), wordInfo && (_jsxs("div", { ref: infoRef, className: "word-table-cell__info-button", onPointerEnter: (e) => { if (!isTouchPointer(e))
|
|
163
|
+
return (_jsxs("div", { ref: outerRef, className: cx('word-table-cell', 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 })] })), 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__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, showTooltipInfo: 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', '멈춤'), onClick: handlePlay }) })] }), wordInfo && (_jsxs("div", { ref: infoRef, className: "word-table-cell__info-button", onPointerEnter: (e) => { if (!isTouchPointer(e))
|
|
164
164
|
handleInfoEnter(); }, onPointerLeave: (e) => { if (!isTouchPointer(e))
|
|
165
165
|
handleInfoLeave(); },
|
|
166
166
|
// 이 div 자체는 포커스 대상이 아니지만 안의 Button이 포커스를 받으면
|
|
@@ -375,7 +375,6 @@ export default function WordTable({ title, titleIcon, disc, className, orientati
|
|
|
375
375
|
/* 띠를 쓰기로 한 종이인가 — 한쪽을 꺼도 이 종이는 '띠를 쓰는 꼴'이다.
|
|
376
376
|
쪽 번호가 어디에 서는지를 이 값이 가른다(아래를 보라). */
|
|
377
377
|
const 브랜드쓰나 = Boolean(brand?.show);
|
|
378
|
-
const 띠쓰나 = 브랜드쓰나 && (brand?.top !== false || brand?.bottom !== false);
|
|
379
378
|
const 위띠쓰나 = Boolean(brand?.show) && brand?.top !== false;
|
|
380
379
|
const 아래띠쓰나 = Boolean(brand?.show) && brand?.bottom !== false;
|
|
381
380
|
const 저작권 = brand?.copyright ?? '© IHAB, Inc. All rights reserved.';
|
|
@@ -400,12 +399,6 @@ export default function WordTable({ title, titleIcon, disc, className, orientati
|
|
|
400
399
|
className: cx('word-table', !wrapped && className), style: { width, height, transform: `scale(${scale})`, transformOrigin: 'top left', marginLeft: offset }, children: _jsxs("div", { ref: 내용ref, className: contentClass, style: {
|
|
401
400
|
gridTemplateColumns: `repeat(${cols}, 1fr)`,
|
|
402
401
|
gridTemplateRows: `repeat(${rows}, 1fr)`,
|
|
403
|
-
/* **띠는 표와 함께 줄지 않는다**(사용자 지시 2026-09-30). 종이는 미리보기 상자에
|
|
404
|
-
맞춰 통째로 줄어드는데(`scale`), 그러면 로고와 글씨가 상자 폭마다 달라 보인다.
|
|
405
|
-
띠 안의 치수를 배율로 나눠 두면 줄어든 만큼 되돌아와 **화면 크기가 한결같다.**
|
|
406
|
-
자리를 비우는 여백도 같이 나눠야 띠가 칸을 안 침범한다.
|
|
407
|
-
배율이 1인 종이(인쇄)에서는 1 이라 아무것도 안 달라진다. */
|
|
408
|
-
...(띠쓰나 ? { ['--wt-unscale']: String(1 / (scale || 1)) } : {}),
|
|
409
402
|
}, children: [isEdit ? (_jsx(_Fragment, { children: (editCells ?? []).map((cell, i) => (_jsx("div", { className: cx('word-table-block__edit-cell', cell ? 'word-table-block__edit-cell--filled' : 'word-table-block__edit-cell--empty', activeCell === i ? 'word-table-block__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: "word-table-block__pair-divider" }), _jsx(WordCell, { label: e.word, subLabel: e.pronunciation,
|
|
410
403
|
// 편집 칸도 구어체 발음을 넘긴다 — 빠져 있어 '구어체 발음'을 켜도 편집 모드에서만 비었다.
|
|
411
404
|
colloquialLabel: e.colloquialPronunciation, homonum: e.homonum, showWord: show.word, showImage: show.image, showPronunciation: show.pron, showColloquial: show.colloq, buttonSize: buttonSize })] }, wi))), scoring && renderScore(i, cell.map(e => e.word).join(' / ')), onRemoveCell && (_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: cell.length > 1 ? t('wordPrint.removePair', '대립쌍 빼기') : t('wordPrint.removeWord', '단어 빼기'), ariaLabel: cell.length > 1 ? t('wordPrint.removePair', '대립쌍 빼기') : t('wordPrint.removeWord', '단어 빼기'), onClick: () => onRemoveCell(i) }) }))] })) : (onActivateCell && (_jsx("div", { style: counterScale, children: _jsx(Button, { htmlType: "button", size: "48", type: "bar", icon: "plus", label: t('wordTable.addWord', '추가하기'), onClick: () => onActivateCell(i) }) }))) }, i))) })) : (_jsxs(_Fragment, { children: [(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' : ''}${끌기 === index ? ' word-table-block__card--dragging' : ''}`, style: dotDashStyle(index, cols, rows, cutLine), draggable: !!onReorder, onPointerDown: onReorder ? (e) => 길게눌러끌기(e, index) : undefined, onKeyDown: onReorder ? (e) => 키로옮기기(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) {
|