@ihabdevteam/core 0.9.1 → 0.9.3
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/README.md +3 -3
- package/dist/components.cjs.js +11 -11
- package/dist/components.esm.js +13 -13
- package/dist/hooks.cjs.js +5 -5
- package/dist/hooks.esm.js +5 -5
- package/dist/ihabdevteam-core.cjs.js +13 -13
- package/dist/ihabdevteam-core.d.ts +10 -6
- package/dist/ihabdevteam-core.esm.js +15 -15
- package/dist/packages/core/src/components.d.ts +2 -0
- package/dist/packages/core/src/components.js +8 -0
- package/dist/packages/core/src/hooks/useVisitAllPanel.js +12 -5
- package/dist/packages/core/src/hooks/useWordTrainingDataGeneration.js +10 -2
- package/package.json +1 -1
|
@@ -230,8 +230,10 @@ export type { ConfirmPopupProps } from './components/Popup/ConfirmPopup';
|
|
|
230
230
|
export { default as CouponInputPopup } from './components/Popup/CouponInputPopup';
|
|
231
231
|
export type { CouponInputPopupProps } from './components/Popup/CouponInputPopup';
|
|
232
232
|
export { default as MenuTooltip } from './components/Tooltip/MenuTooltip';
|
|
233
|
+
export { default as InfoTooltip } from './components/Tooltip/InfoTooltip';
|
|
233
234
|
export { default as TooltipInfo } from './components/Tooltip/InfoTooltip';
|
|
234
235
|
export { default as DescriptionTooltip } from './components/Tooltip/DescriptionTooltip';
|
|
236
|
+
export { default as TextBoxTooltip } from './components/Tooltip/TextBoxTooltip';
|
|
235
237
|
export { default as TooltipTextBox } from './components/Tooltip/TextBoxTooltip';
|
|
236
238
|
export { default as TrainingTooltip, TRAINING_TOOLTIP_HOVER_DELAY_MS } from './components/Tooltip/TrainingTooltip';
|
|
237
239
|
export type { TooltipTrainingProps } from './components/Tooltip/TrainingTooltip';
|
|
@@ -164,10 +164,18 @@ export { default as ListPopup } from './components/Popup/ListPopup';
|
|
|
164
164
|
export { default as ConfirmPopup } from './components/Popup/ConfirmPopup';
|
|
165
165
|
export { default as CouponInputPopup } from './components/Popup/CouponInputPopup';
|
|
166
166
|
export { default as MenuTooltip } from './components/Tooltip/MenuTooltip';
|
|
167
|
+
export { default as InfoTooltip } from './components/Tooltip/InfoTooltip';
|
|
168
|
+
/* 배럴 이름이 파일명과 뒤집혀 있었다(TooltipInfo). 소비자가 그것을 알아채고
|
|
169
|
+
`import { TooltipInfo as InfoTooltip }` 로 도로 바꿔 쓰고 있었다 — 이름이 틀렸다는
|
|
170
|
+
가장 분명한 증거다. 파일명·형제 컴포넌트(DescriptionTooltip, MenuTooltip)와 맞췄다.
|
|
171
|
+
옛 이름은 깨뜨리지 않으려고 남겨둔다. 소비자가 다 옮기면 지운다. */
|
|
167
172
|
export { default as TooltipInfo } from './components/Tooltip/InfoTooltip';
|
|
168
173
|
/* 제목 + 사유 목록을 띄우는 툴팁. 컴포넌트는 진작 있었는데 배럴에 없어 소비자가
|
|
169
174
|
쓸 수 없었다(어드민이 '왜 재생성 권고인지'를 이걸로 알린다). */
|
|
170
175
|
export { default as DescriptionTooltip } from './components/Tooltip/DescriptionTooltip';
|
|
176
|
+
export { default as TextBoxTooltip } from './components/Tooltip/TextBoxTooltip';
|
|
177
|
+
/* 같은 까닭. 이쪽은 옛 이름을 쓰는 소비자가 한 곳도 없어(실측 0건) 원래는 그냥
|
|
178
|
+
바꿔도 됐지만, 짝이 되는 InfoTooltip 과 다르게 다룰 까닭이 없어 나란히 남긴다. */
|
|
171
179
|
export { default as TooltipTextBox } from './components/Tooltip/TextBoxTooltip';
|
|
172
180
|
export { default as TrainingTooltip, TRAINING_TOOLTIP_HOVER_DELAY_MS } from './components/Tooltip/TrainingTooltip';
|
|
173
181
|
export { default as EffectPartyPopper } from './components/Effect/EffectPartyPopper';
|
|
@@ -26,16 +26,23 @@ export function useVisitAllPanel(mergedVisits) {
|
|
|
26
26
|
return true;
|
|
27
27
|
}), [mergedVisits, vapSearch, vapStatus]);
|
|
28
28
|
const vapTotal = Math.max(1, Math.ceil(vapFiltered.length / Number(vapPageSize)));
|
|
29
|
-
//
|
|
29
|
+
// 결과가 줄면 지금 쪽이 총 쪽수를 넘는다. 자르는 자리에서는 진작 조이고 있었는데
|
|
30
|
+
// **돌려주는 vapPage 는 날것이었다** — 그래서 쪽 표시에 그대로 넣으면 "3 / 1" 처럼
|
|
31
|
+
// 없는 쪽이 떴다. 찾기 칸은 그 자리에서 쪽을 1로 되돌려 줘서 가려져 있었고, 목록이
|
|
32
|
+
// 밖에서 줄어드는 길(다른 고객으로 바뀜·서버가 다시 준 목록)에서 드러났다.
|
|
33
|
+
//
|
|
34
|
+
// 상태는 손대지 않고 돌려주는 값만 조인다. 상태는 "어디로 가려 했나"(의도)이고
|
|
35
|
+
// 돌려주는 값은 "지금 어디인가"(사실)다. 그래서 setVapPage 의 뜻이 안 바뀌어
|
|
36
|
+
// 소비자를 깨뜨리지 않고, 줄었다 늘어나면 원래 보던 쪽으로 돌아온다.
|
|
37
|
+
const vapPageClamped = Math.min(vapPage, vapTotal);
|
|
30
38
|
const vapPageItems = useMemo(() => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, [vapFiltered, vapPage, vapPageSize, vapTotal]);
|
|
39
|
+
return vapFiltered.slice((vapPageClamped - 1) * Number(vapPageSize), vapPageClamped * Number(vapPageSize));
|
|
40
|
+
}, [vapFiltered, vapPageClamped, vapPageSize]);
|
|
34
41
|
return {
|
|
35
42
|
vapSearch, setVapSearch,
|
|
36
43
|
vapPageSize, setVapPageSize,
|
|
37
44
|
vapStatus, setVapStatus,
|
|
38
|
-
vapPage, setVapPage,
|
|
45
|
+
vapPage: vapPageClamped, setVapPage,
|
|
39
46
|
vapFiltered,
|
|
40
47
|
vapTotal,
|
|
41
48
|
vapPageItems,
|
|
@@ -27,6 +27,15 @@ export function useWordTrainingDataGeneration(types, difficulty, contrastCount,
|
|
|
27
27
|
const [perTypeData, setPerTypeData] = useState({});
|
|
28
28
|
const [generating, setGenerating] = useState(false);
|
|
29
29
|
const { cho = null, jung = null, jong = null, syllable = null } = composition ?? {};
|
|
30
|
+
// gradeFilter 는 **내용**으로 의존해야 한다. 배열 자체를 의존성에 넣으면 끝나지 않는다:
|
|
31
|
+
// 배치가 끝날 때마다 setPerTypeData 로 다시 그려지고, 그때 새 배열이 생겨 effect 가
|
|
32
|
+
// 또 돌고, 또 끝나고… 실측으로 아무것도 안 누른 채 1533번을 만들었다.
|
|
33
|
+
//
|
|
34
|
+
// 인자를 생략하면 특히 그렇다 — 기본값 `[]` 는 부를 때마다 새로 만들어진다.
|
|
35
|
+
// composition 은 cho/jung/jong/syllable 로 풀어 원시값으로 의존하고 있었는데,
|
|
36
|
+
// 배열인 이쪽만 빠져 있었다. effect 안에서 어차피 정렬해 문자열로 쓰고 있으니
|
|
37
|
+
// 그 문자열을 의존성으로 삼는다. 내용이 같으면 다시 만들지 않는다.
|
|
38
|
+
const gradeKey = gradeFilter.length > 0 ? gradeFilter.slice().sort().join(',') : '';
|
|
30
39
|
// 단어풀 갱신 시 사전 계산 (백그라운드 fire-and-forget)
|
|
31
40
|
useEffect(() => {
|
|
32
41
|
if (poolVersion > 0) {
|
|
@@ -40,7 +49,6 @@ export function useWordTrainingDataGeneration(types, difficulty, contrastCount,
|
|
|
40
49
|
setGenerating(true);
|
|
41
50
|
(async () => {
|
|
42
51
|
const compFilter = toCompositionFilter({ cho, jung, jong, syllable });
|
|
43
|
-
const gradeKey = gradeFilter.length > 0 ? gradeFilter.slice().sort().join(',') : '';
|
|
44
52
|
const compKey = `${cho ?? ''}_${jung ?? ''}_${jong ?? ''}_${syllable ?? ''}_${gradeKey}`;
|
|
45
53
|
const results = {};
|
|
46
54
|
await Promise.all(types.map(async (t) => {
|
|
@@ -92,7 +100,7 @@ export function useWordTrainingDataGeneration(types, difficulty, contrastCount,
|
|
|
92
100
|
}
|
|
93
101
|
})();
|
|
94
102
|
return () => { cancelled = true; };
|
|
95
|
-
}, [difficulty, contrastCount, cho, jung, jong, syllable, excludeNoImage, sameStructureOnly, phonemeView, poolVersion,
|
|
103
|
+
}, [difficulty, contrastCount, cho, jung, jong, syllable, excludeNoImage, sameStructureOnly, phonemeView, poolVersion, gradeKey]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
96
104
|
/* eslint-enable react-hooks/set-state-in-effect */
|
|
97
105
|
return { perTypeData, generating };
|
|
98
106
|
}
|