@ihabdevteam/core 0.441.0 → 0.443.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 +21 -0
- package/dist/components.cjs.js +190 -190
- package/dist/components.esm.css +2 -2
- package/dist/hooks.cjs.js +5 -5
- package/dist/i18n.cjs.js +1 -1
- package/dist/ihabdevteam-core.cjs.js +186 -186
- package/dist/ihabdevteam-core.d.ts +296 -1
- package/dist/packages/core/src/components/ErrorBoundary.d.ts +55 -0
- package/dist/packages/core/src/components/ErrorBoundary.js +52 -0
- package/dist/packages/core/src/components/KeepScreenAwake.d.ts +9 -0
- package/dist/packages/core/src/components/KeepScreenAwake.js +12 -0
- package/dist/packages/core/src/components/MarkIcon.css +12 -0
- package/dist/packages/core/src/components/MarkIcon.d.ts +20 -0
- package/dist/packages/core/src/components/MarkIcon.js +18 -0
- package/dist/packages/core/src/components/PagePopup.d.ts +43 -0
- package/dist/packages/core/src/components/PagePopup.js +71 -0
- package/dist/packages/core/src/components/Popup/ListPopup.js +3 -1
- package/dist/packages/core/src/components/Popup/Popup.js +2 -1
- package/dist/packages/core/src/components/Popup/useDiscardGuard.d.ts +26 -0
- package/dist/packages/core/src/components/Popup/useDiscardGuard.js +28 -0
- package/dist/packages/core/src/components/ScoreMarkCounts.css +9 -0
- package/dist/packages/core/src/components/ScoreMarkCounts.d.ts +19 -0
- package/dist/packages/core/src/components/ScoreMarkCounts.js +16 -0
- package/dist/packages/core/src/components.d.ts +12 -2
- package/dist/packages/core/src/components.js +8 -1
- package/dist/packages/core/src/hooks/useClosingDelay.d.ts +12 -0
- package/dist/packages/core/src/hooks/useClosingDelay.js +30 -0
- package/dist/packages/core/src/hooks/useOnline.d.ts +9 -0
- package/dist/packages/core/src/hooks/useOnline.js +23 -0
- package/dist/packages/core/src/hooks/useOutsideClose.d.ts +11 -0
- package/dist/packages/core/src/hooks/useOutsideClose.js +23 -0
- package/dist/packages/core/src/hooks/usePageSizeOptions.d.ts +19 -0
- package/dist/packages/core/src/hooks/usePageSizeOptions.js +25 -0
- package/dist/packages/core/src/hooks/useSaveOnHide.d.ts +14 -0
- package/dist/packages/core/src/hooks/useSaveOnHide.js +32 -0
- package/dist/packages/core/src/hooks/useScreenWakeLock.d.ts +12 -0
- package/dist/packages/core/src/hooks/useScreenWakeLock.js +53 -0
- package/dist/packages/core/src/hooks.d.ts +6 -0
- package/dist/packages/core/src/hooks.js +7 -0
- package/dist/packages/core/src/utils/kstDateTime.d.ts +21 -0
- package/dist/packages/core/src/utils/kstDateTime.js +38 -0
- package/dist/packages/core/src/utils/popupTiming.d.ts +7 -0
- package/dist/packages/core/src/utils/popupTiming.js +7 -0
- package/dist/packages/core/src/utils.d.ts +2 -0
- package/dist/packages/core/src/utils.js +1 -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 +166 -166
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **화면이 고른 한국 시각(벽시계)을 서버가 아는 순간으로, 또 그 반대로**(말귀 청 (437) ㉳ⓒ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
|
|
3
|
+
*
|
|
4
|
+
* `timestamptz` 칸에 시간대 표기가 없는 문자열(`2026-09-06T12:55:00`)을 보내면 서버가 UTC 로 읽어 **9시간이 밀린다**
|
|
5
|
+
* (말귀 실측: 12:55 → 21:55, 저녁 것은 날짜까지 하루). 기기 시간대가 아니라 **한국 시각**으로 읽는다 — 뉴욕 기기에서
|
|
6
|
+
* 12:55 를 골라도 KST 12:55 다. 한국은 서머타임이 없어 +09:00 한 값이다. KST 날짜 셈의 다른 식구는 `utils/date.ts`.
|
|
7
|
+
*/
|
|
8
|
+
const KST_OFFSET_H = 9;
|
|
9
|
+
/** @public `YYYY-MM-DD` + `HH:mm`(한국 시각) → `Z` 붙은 ISO. 못 읽을 값(2월 31일 · 25시 …)이면 `null` */
|
|
10
|
+
export function kstToIso(date, time) {
|
|
11
|
+
const day = /^(\d{4})-(\d{2})-(\d{2})$/.exec(date);
|
|
12
|
+
const hm = /^(\d{1,2}):(\d{2})$/.exec(time);
|
|
13
|
+
if (!day || !hm)
|
|
14
|
+
return null;
|
|
15
|
+
const [y, m, d] = [Number(day[1]), Number(day[2]), Number(day[3])];
|
|
16
|
+
const [hh, mm] = [Number(hm[1]), Number(hm[2])];
|
|
17
|
+
if (hh > 23 || mm > 59)
|
|
18
|
+
return null;
|
|
19
|
+
/* 2월 31일은 Date 가 조용히 다음 달로 넘긴다 — 넘어갔으면 못 읽은 것. 조용히 다른 날로 저장하느니 안 보내는 편이 낫다 */
|
|
20
|
+
const calendar = new Date(Date.UTC(y, m - 1, d));
|
|
21
|
+
if (calendar.getUTCMonth() !== m - 1 || calendar.getUTCDate() !== d)
|
|
22
|
+
return null;
|
|
23
|
+
return new Date(Date.UTC(y, m - 1, d, hh - KST_OFFSET_H, mm)).toISOString();
|
|
24
|
+
}
|
|
25
|
+
/** @public 칸(한국 시각)이 가리키는 순간. 못 읽으면 Invalid Date */
|
|
26
|
+
export function kstPartsAt(p) {
|
|
27
|
+
const iso = kstToIso(`${p.year}-${p.month.padStart(2, '0')}-${p.day.padStart(2, '0')}`, `${p.hour}:${p.minute.padStart(2, '0')}`);
|
|
28
|
+
return new Date(iso ?? NaN);
|
|
29
|
+
}
|
|
30
|
+
/** @public 그 순간의 한국 시각을 칸으로 — 기본은 지금. 두 자리로 채운다 */
|
|
31
|
+
export function kstNowParts(now = new Date()) {
|
|
32
|
+
const korea = new Date(now.getTime() + KST_OFFSET_H * 3600_000);
|
|
33
|
+
const two = (n) => String(n).padStart(2, '0');
|
|
34
|
+
return {
|
|
35
|
+
year: String(korea.getUTCFullYear()), month: two(korea.getUTCMonth() + 1), day: two(korea.getUTCDate()),
|
|
36
|
+
hour: two(korea.getUTCHours()), minute: two(korea.getUTCMinutes()),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **`Popup` 이 사라지는 데 걸리는 시간** — `.popup--closing { transition: opacity 260ms }` 과 닫힘 타이머가 이 수를 쓴다
|
|
3
|
+
* (말귀 청 (437) ㉳ⓑ, 2026-11-13 — 앱이 이 수를 베껴 들고 "창이 다 사라진 뒤에 일을 치르려" 기다렸다. 코어가 바꾸면 조용히 어긋났다).
|
|
4
|
+
* 움직임 줄이기에서는 `Popup` 이 0 으로 닫는다 — 기다릴 때는 `useClosingDelay` 를 쓰면 그것까지 따른다.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare const POPUP_CLOSE_MS = 260;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **`Popup` 이 사라지는 데 걸리는 시간** — `.popup--closing { transition: opacity 260ms }` 과 닫힘 타이머가 이 수를 쓴다
|
|
3
|
+
* (말귀 청 (437) ㉳ⓑ, 2026-11-13 — 앱이 이 수를 베껴 들고 "창이 다 사라진 뒤에 일을 치르려" 기다렸다. 코어가 바꾸면 조용히 어긋났다).
|
|
4
|
+
* 움직임 줄이기에서는 `Popup` 이 0 으로 닫는다 — 기다릴 때는 `useClosingDelay` 를 쓰면 그것까지 따른다.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export const POPUP_CLOSE_MS = 260;
|
|
@@ -25,6 +25,8 @@ export { reorderArray, shuffle, sample } from './utils/array';
|
|
|
25
25
|
export { getErrorMessage, toUserErrorMessage, isNetworkErrorMessage, NETWORK_ERROR_MESSAGE } from './utils/errorMessage';
|
|
26
26
|
export { sortToValue, parseSortValue } from './utils/sortValue';
|
|
27
27
|
export { folderLeaf, folderParent, folderJoin, isFolderNameOk, isInFolder, withAncestors, folderChildren, folderTrail, folderTree, folderMoved, canMoveFolder, folderMoveVerdict, } from './utils/folderPath';
|
|
28
|
+
export { kstToIso, kstPartsAt, kstNowParts } from './utils/kstDateTime';
|
|
29
|
+
export type { KstParts } from './utils/kstDateTime';
|
|
28
30
|
export { folderMenuItems } from './utils/folderMenu';
|
|
29
31
|
export type { FolderMenuLine } from './utils/folderMenu';
|
|
30
32
|
export { escapeCsvField, downloadCsvText } from './utils/csv';
|
|
@@ -24,6 +24,7 @@ export { getErrorMessage, toUserErrorMessage, isNetworkErrorMessage, NETWORK_ERR
|
|
|
24
24
|
export { sortToValue, parseSortValue } from './utils/sortValue';
|
|
25
25
|
/* 폴더 안의 폴더 — 이름을 길로 적는 셈(말귀 청 (435), 2026-11-13). 그리는 조각은 `FolderHead` 식구다 */
|
|
26
26
|
export { folderLeaf, folderParent, folderJoin, isFolderNameOk, isInFolder, withAncestors, folderChildren, folderTrail, folderTree, folderMoved, canMoveFolder, folderMoveVerdict, } from './utils/folderPath';
|
|
27
|
+
export { kstToIso, kstPartsAt, kstNowParts } from './utils/kstDateTime'; // 한국 벽시계 ↔ 순간(말귀 청 (437) ㉳ⓒ)
|
|
27
28
|
export { folderMenuItems } from './utils/folderMenu'; // 폴더 메뉴의 줄(말귀 청 (437) ㉮)
|
|
28
29
|
export { escapeCsvField, downloadCsvText } from './utils/csv';
|
|
29
30
|
export { setWordPool, getWordPool } from './utils/wordPool';
|