@ihabdevteam/core 0.456.0 → 0.457.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 +14 -0
- package/dist/components.cjs.js +183 -183
- package/dist/components.esm.css +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/i18n.cjs.js +1 -1
- package/dist/ihabdevteam-core.cjs.js +188 -188
- package/dist/ihabdevteam-core.d.ts +34 -4
- package/dist/packages/core/src/components/FolderGrid.css +2 -0
- package/dist/packages/core/src/components/FolderGrid.d.ts +17 -2
- package/dist/packages/core/src/components/FolderGrid.js +4 -4
- package/dist/packages/core/src/components/FolderHead.d.ts +4 -1
- package/dist/packages/core/src/components/FolderHead.js +2 -2
- package/dist/packages/core/src/components/Popup/Popup.css +3 -0
- package/dist/packages/core/src/components/Tooltip/MenuTooltip.css +18 -0
- package/dist/packages/core/src/components/Tooltip/MenuTooltip.d.ts +11 -0
- package/dist/packages/core/src/components/Tooltip/MenuTooltip.js +38 -1
- package/dist/packages/core/src/components.d.ts +1 -1
- 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
|
@@ -2245,7 +2245,7 @@ export declare function copyText(text: string): Promise<boolean>;
|
|
|
2245
2245
|
*
|
|
2246
2246
|
* 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
|
|
2247
2247
|
*/
|
|
2248
|
-
export declare const CORE_VERSION = "0.
|
|
2248
|
+
export declare const CORE_VERSION = "0.457.0";
|
|
2249
2249
|
|
|
2250
2250
|
/** @public */
|
|
2251
2251
|
declare const coreDefault: Record<string, unknown>;
|
|
@@ -3259,6 +3259,16 @@ export declare type FlowState = {
|
|
|
3259
3259
|
|
|
3260
3260
|
export declare function fmtBytes(n: number): string;
|
|
3261
3261
|
|
|
3262
|
+
/**
|
|
3263
|
+
* 「새 폴더」 칸 — 누르면 화면이 폴더 추가 창(`FolderAddPopup`)을 연다.
|
|
3264
|
+
* @public
|
|
3265
|
+
*/
|
|
3266
|
+
export declare interface FolderAddEntry {
|
|
3267
|
+
/** 칸 이름 — 낭독기도 이 글자를 그대로 읽는다 */
|
|
3268
|
+
label: string;
|
|
3269
|
+
onClick: () => void;
|
|
3270
|
+
}
|
|
3271
|
+
|
|
3262
3272
|
/**
|
|
3263
3273
|
* **폴더 추가 창**(말귀 청 (438) ㉴ — 말귀 앱에서 옮겨 왔다, 2026-11-14). `FolderHead` · `FolderGrid` · `FolderList` 와 한 벌이다.
|
|
3264
3274
|
*
|
|
@@ -3337,10 +3347,10 @@ export declare interface FolderEntry {
|
|
|
3337
3347
|
*
|
|
3338
3348
|
* · 칸은 `Button`(bar · 48 · default · 왼쪽 맞춤)이고 폭은 200 으로 고정이다 — 긴 이름은 단추가 줄인다.
|
|
3339
3349
|
* · **놓을 자리이기도 하다** — 카드든 폴더든 끌고 그 위에 오면 단추가 기본 호버 꼴(`is-hover`)이 된다. 따로 테를 두르지 않는다.
|
|
3340
|
-
* · 폴더가 없으면 아무것도 안 그린다(빈 격자가 자리를 먹지 않는다). 「위로」 칸(`up`)을 주면 그 칸만으로 선다.
|
|
3350
|
+
* · 폴더가 없으면 아무것도 안 그린다(빈 격자가 자리를 먹지 않는다). 「위로」 칸(`up`) · 「새 폴더」 칸(`add`)을 주면 그 칸만으로 선다.
|
|
3341
3351
|
* @public
|
|
3342
3352
|
*/
|
|
3343
|
-
export declare function FolderGrid({ folders, onOpen, dropProps, dropOver, menuItems, onMove, up }: FolderGridProps): JSX.Element | null;
|
|
3353
|
+
export declare function FolderGrid({ folders, onOpen, dropProps, dropOver, menuItems, onMove, up, add }: FolderGridProps): JSX.Element | null;
|
|
3344
3354
|
|
|
3345
3355
|
/** @public */
|
|
3346
3356
|
export declare interface FolderGridProps {
|
|
@@ -3366,6 +3376,12 @@ export declare interface FolderGridProps {
|
|
|
3366
3376
|
* 폴더가 하나도 없어도 이 칸만으로 격자가 선다. `FolderHead` 는 폴더 안에 있는 동안 늘 준다.
|
|
3367
3377
|
*/
|
|
3368
3378
|
up?: FolderUpEntry;
|
|
3379
|
+
/**
|
|
3380
|
+
* **맨 끝의 「새 폴더」 칸**(말귀 청 (448), 사장님 결정 2026-11-16) — 주면 폴더 칸과 같은 크기의 칸이 맨 끝에 선다(「위로」 · 폴더들 ·
|
|
3381
|
+
* 「새 폴더」 차례). 폴더가 하나도 없어도 이 칸만으로 격자가 서서, 맨 위에서 폴더 줄이 통째로 빠져 아래 목록이 튀지 않는다.
|
|
3382
|
+
* 폴더 칸과 갈리게 테두리가 점선이다. 안 주면 전과 같다(고르기만 하는 창).
|
|
3383
|
+
*/
|
|
3384
|
+
add?: FolderAddEntry;
|
|
3369
3385
|
}
|
|
3370
3386
|
|
|
3371
3387
|
/**
|
|
@@ -3381,7 +3397,7 @@ export declare interface FolderGridProps {
|
|
|
3381
3397
|
* · 길 줄의 키는 40 으로 고정이다(`Breadcrumb size="medium"`) — 폴더를 드나들 때 아래가 안 튄다.
|
|
3382
3398
|
* @public
|
|
3383
3399
|
*/
|
|
3384
|
-
export declare function FolderHead({ rootLabel, opened, onOpen, paths, countOf, folderMenu, rootMenu, dropProps, dropOver, onMoveFolder, itemDragging, rootDropKey, }: FolderHeadProps): JSX.Element;
|
|
3400
|
+
export declare function FolderHead({ rootLabel, opened, onOpen, paths, countOf, folderMenu, rootMenu, dropProps, dropOver, onMoveFolder, itemDragging, rootDropKey, add, }: FolderHeadProps): JSX.Element;
|
|
3385
3401
|
|
|
3386
3402
|
/** @public */
|
|
3387
3403
|
export declare interface FolderHeadProps {
|
|
@@ -3408,6 +3424,8 @@ export declare interface FolderHeadProps {
|
|
|
3408
3424
|
itemDragging?: boolean;
|
|
3409
3425
|
/** 맨 위(폴더 밖)로 놓을 때의 열쇠 — `dropProps` · `dropOver` 가 맨 위를 가리키는 그 값. 안 주면 나무의 맨 위 줄에는 못 놓는다 */
|
|
3410
3426
|
rootDropKey?: string;
|
|
3427
|
+
/** 폴더 칸 줄 맨 끝의 「새 폴더」 칸(말귀 청 (448)) — 주면 맨 위 · 폴더 안 어디서나 선다. `FolderGrid` 의 `add` 그대로 */
|
|
3428
|
+
add?: FolderAddEntry;
|
|
3411
3429
|
}
|
|
3412
3430
|
|
|
3413
3431
|
/** @public 폴더 안에 새 폴더의 길을 짓는다 — `parent` 가 없으면 맨 위에 선다 */
|
|
@@ -8604,6 +8622,9 @@ export declare interface ShortcutBadgeProps {
|
|
|
8604
8622
|
className?: string;
|
|
8605
8623
|
}
|
|
8606
8624
|
|
|
8625
|
+
/** 단축키 글자 → 자판 자리(`KeyE` · `Digit1`). 글자 · 숫자 하나가 아니면 `null` */
|
|
8626
|
+
export declare function shortcutCode(shortcut: string | undefined): string | null;
|
|
8627
|
+
|
|
8607
8628
|
/**
|
|
8608
8629
|
* 채점 화면을 떠나려 할 때 **물어봐야 하는가.**
|
|
8609
8630
|
*
|
|
@@ -10278,6 +10299,15 @@ export declare type TooltipMenuColumnItem = {
|
|
|
10278
10299
|
/** 우측 원형 배지 숫자(알림 개수 등). 라벨에 "(5)"를 붙이는 대신 SideNav와 같은
|
|
10279
10300
|
* Badge type="dot"으로 표시한다 — 두 메뉴가 같은 항목을 다르게 보여주지 않도록. */
|
|
10280
10301
|
badgeCount?: number;
|
|
10302
|
+
/**
|
|
10303
|
+
* **단축키**(말귀 청 (447), 사장님 지시 2026-11-16 *"버튼 단축키 가능한가? · 쇼컷을 이름에 붙이지 말고 우측에 보이도록"*) — 글자 하나
|
|
10304
|
+
* (`'E'`) 또는 숫자 하나(`'1'`).
|
|
10305
|
+
* · 보이기: 항목 오른쪽 끝에 키캡으로 따로 선다. 이름이 길면 이름이 줄고 키캡은 안 잘린다. 하위 메뉴(`children`) · 배지가 있으면 그쪽이 선다.
|
|
10306
|
+
* · 누르기: 메뉴가 떠 있는 동안 그 키를 누르면 이 항목을 누른 것과 같다(`closeOnSelect` 그대로). **자판 자리(`event.code`)로 맞춰**
|
|
10307
|
+
* 한글 입력 상태에서도 먹는다. 꺼진 항목 · 입력칸에 초점이 있을 때 · Ctrl/⌘/Alt 와 함께 누를 때는 안 먹는다. 지금 보이는 목록만 본다.
|
|
10308
|
+
* · 낭독기: `aria-keyshortcuts` 로 알린다.
|
|
10309
|
+
*/
|
|
10310
|
+
shortcut?: string;
|
|
10281
10311
|
};
|
|
10282
10312
|
|
|
10283
10313
|
/** @public */
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
list-style: none;
|
|
12
12
|
}
|
|
13
13
|
.folder-grid__cell { position: relative; min-width: 0; }
|
|
14
|
+
/* 「새 폴더」 칸(청 (448)) — 폴더와 같은 크기, 테두리만 점선으로 갈린다(색은 단추 제 테두리 그대로) */
|
|
15
|
+
.folder-grid__cell--add .button { border-style: dashed; }
|
|
14
16
|
/* 칸 오른쪽의 ⋯ — 폴더 단추 위에 얹는다(세로 가운데). 단추 안에는 같은 폭의 빈자리를 둔다 */
|
|
15
17
|
.folder-grid__more {
|
|
16
18
|
position: absolute;
|
|
@@ -36,6 +36,21 @@ export interface FolderGridProps {
|
|
|
36
36
|
* 폴더가 하나도 없어도 이 칸만으로 격자가 선다. `FolderHead` 는 폴더 안에 있는 동안 늘 준다.
|
|
37
37
|
*/
|
|
38
38
|
up?: FolderUpEntry;
|
|
39
|
+
/**
|
|
40
|
+
* **맨 끝의 「새 폴더」 칸**(말귀 청 (448), 사장님 결정 2026-11-16) — 주면 폴더 칸과 같은 크기의 칸이 맨 끝에 선다(「위로」 · 폴더들 ·
|
|
41
|
+
* 「새 폴더」 차례). 폴더가 하나도 없어도 이 칸만으로 격자가 서서, 맨 위에서 폴더 줄이 통째로 빠져 아래 목록이 튀지 않는다.
|
|
42
|
+
* 폴더 칸과 갈리게 테두리가 점선이다. 안 주면 전과 같다(고르기만 하는 창).
|
|
43
|
+
*/
|
|
44
|
+
add?: FolderAddEntry;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 「새 폴더」 칸 — 누르면 화면이 폴더 추가 창(`FolderAddPopup`)을 연다.
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
export interface FolderAddEntry {
|
|
51
|
+
/** 칸 이름 — 낭독기도 이 글자를 그대로 읽는다 */
|
|
52
|
+
label: string;
|
|
53
|
+
onClick: () => void;
|
|
39
54
|
}
|
|
40
55
|
/**
|
|
41
56
|
* 「위로」 칸 — 누르면 한 층 위로. 끌어다 놓는 화면에서는 **한 층 위로 옮기는 놓을 자리**도 된다.
|
|
@@ -59,7 +74,7 @@ export interface FolderUpEntry {
|
|
|
59
74
|
*
|
|
60
75
|
* · 칸은 `Button`(bar · 48 · default · 왼쪽 맞춤)이고 폭은 200 으로 고정이다 — 긴 이름은 단추가 줄인다.
|
|
61
76
|
* · **놓을 자리이기도 하다** — 카드든 폴더든 끌고 그 위에 오면 단추가 기본 호버 꼴(`is-hover`)이 된다. 따로 테를 두르지 않는다.
|
|
62
|
-
* · 폴더가 없으면 아무것도 안 그린다(빈 격자가 자리를 먹지 않는다). 「위로」 칸(`up`)을 주면 그 칸만으로 선다.
|
|
77
|
+
* · 폴더가 없으면 아무것도 안 그린다(빈 격자가 자리를 먹지 않는다). 「위로」 칸(`up`) · 「새 폴더」 칸(`add`)을 주면 그 칸만으로 선다.
|
|
63
78
|
* @public
|
|
64
79
|
*/
|
|
65
|
-
export default function FolderGrid({ folders, onOpen, dropProps, dropOver, menuItems, onMove, up }: FolderGridProps): import("react").JSX.Element | null;
|
|
80
|
+
export default function FolderGrid({ folders, onOpen, dropProps, dropOver, menuItems, onMove, up, add }: FolderGridProps): import("react").JSX.Element | null;
|
|
@@ -18,10 +18,10 @@ const UP_KEY = '\u0000up';
|
|
|
18
18
|
*
|
|
19
19
|
* · 칸은 `Button`(bar · 48 · default · 왼쪽 맞춤)이고 폭은 200 으로 고정이다 — 긴 이름은 단추가 줄인다.
|
|
20
20
|
* · **놓을 자리이기도 하다** — 카드든 폴더든 끌고 그 위에 오면 단추가 기본 호버 꼴(`is-hover`)이 된다. 따로 테를 두르지 않는다.
|
|
21
|
-
* · 폴더가 없으면 아무것도 안 그린다(빈 격자가 자리를 먹지 않는다). 「위로」 칸(`up`)을 주면 그 칸만으로 선다.
|
|
21
|
+
* · 폴더가 없으면 아무것도 안 그린다(빈 격자가 자리를 먹지 않는다). 「위로」 칸(`up`) · 「새 폴더」 칸(`add`)을 주면 그 칸만으로 선다.
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
|
-
export default function FolderGrid({ folders, onOpen, dropProps, dropOver, menuItems, onMove, up }) {
|
|
24
|
+
export default function FolderGrid({ folders, onOpen, dropProps, dropOver, menuItems, onMove, up, add }) {
|
|
25
25
|
const { t } = useTranslation();
|
|
26
26
|
/** 메뉴가 열린 폴더와 그 단추 */
|
|
27
27
|
const [menu, setMenu] = useState(null);
|
|
@@ -59,7 +59,7 @@ export default function FolderGrid({ folders, onOpen, dropProps, dropOver, menuI
|
|
|
59
59
|
const upOver = !!up && (draggingFolder === null
|
|
60
60
|
? up.cardDropKey != null && dropOver === up.cardDropKey
|
|
61
61
|
: !!up.onFolderDrop && folderDrag.dragOverKey === UP_KEY);
|
|
62
|
-
if (folders.length === 0 && !up)
|
|
62
|
+
if (folders.length === 0 && !up && !add)
|
|
63
63
|
return null;
|
|
64
64
|
return (_jsxs("ul", { className: "folder-grid", "aria-label": t('folder.list', '폴더'), children: [up && (_jsx("li", { className: ['folder-grid__cell', 'folder-grid__cell--up', upOver && 'folder-grid__cell--over'].filter(Boolean).join(' '), ...upDrag(), children: _jsx(Button, { htmlType: "button", type: "bar", size: 48, variant: "default", align: "left", width: "100%", ellipsis: true, className: upOver ? 'is-hover' : undefined, icon: "arrow-up", label: t('folder.up', '위로'), ariaLabel: t('folder.upTo', { name: up.targetLabel, defaultValue: '한 층 위로 — {{name}}' }), onClick: up.onOpen }) }, UP_KEY)), folders.map(folder => {
|
|
65
65
|
const label = folder.label ?? folder.name;
|
|
@@ -77,5 +77,5 @@ export default function FolderGrid({ folders, onOpen, dropProps, dropOver, menuI
|
|
|
77
77
|
const anchor = e.currentTarget;
|
|
78
78
|
setMenu(now => (now?.name === folder.name ? null : { name: folder.name, label, anchor }));
|
|
79
79
|
} }) }))] }, folder.name));
|
|
80
|
-
}), menu && menuItems && (_jsx(Tooltip, { anchorEl: menu.anchor, onClose: closeMenu, closeOnOutsideClick: true, offset: 4, prefer: "bottom", ariaLabel: t('folder.menu', { name: menu.label, defaultValue: '{{name}} 폴더 메뉴' }), children: _jsx(MenuTooltip, { columns: [{ items: menuItems(menu.name) }], size: "small", onClose: closeMenu }) }))] }));
|
|
80
|
+
}), add && (_jsx("li", { className: "folder-grid__cell folder-grid__cell--add", children: _jsx(Button, { htmlType: "button", type: "bar", size: 48, variant: "default", align: "left", width: "100%", ellipsis: true, icon: "folder-plus", label: add.label, onClick: add.onClick }) }, "__add")), menu && menuItems && (_jsx(Tooltip, { anchorEl: menu.anchor, onClose: closeMenu, closeOnOutsideClick: true, offset: 4, prefer: "bottom", ariaLabel: t('folder.menu', { name: menu.label, defaultValue: '{{name}} 폴더 메뉴' }), children: _jsx(MenuTooltip, { columns: [{ items: menuItems(menu.name) }], size: "small", onClose: closeMenu }) }))] }));
|
|
81
81
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type TooltipMenuColumnItem } from './Tooltip/MenuTooltip';
|
|
2
|
+
import { type FolderAddEntry } from './FolderGrid';
|
|
2
3
|
import './FolderHead.css';
|
|
3
4
|
/** @public */
|
|
4
5
|
export interface FolderHeadProps {
|
|
@@ -25,6 +26,8 @@ export interface FolderHeadProps {
|
|
|
25
26
|
itemDragging?: boolean;
|
|
26
27
|
/** 맨 위(폴더 밖)로 놓을 때의 열쇠 — `dropProps` · `dropOver` 가 맨 위를 가리키는 그 값. 안 주면 나무의 맨 위 줄에는 못 놓는다 */
|
|
27
28
|
rootDropKey?: string;
|
|
29
|
+
/** 폴더 칸 줄 맨 끝의 「새 폴더」 칸(말귀 청 (448)) — 주면 맨 위 · 폴더 안 어디서나 선다. `FolderGrid` 의 `add` 그대로 */
|
|
30
|
+
add?: FolderAddEntry;
|
|
28
31
|
}
|
|
29
32
|
/**
|
|
30
33
|
* **폴더로 보는 화면의 머리** — 구조 단추 · 길(브레드크럼) · 지금 자리의 폴더 칸들. 도구줄 **위**에 선다(말귀 청 (435)).
|
|
@@ -39,4 +42,4 @@ export interface FolderHeadProps {
|
|
|
39
42
|
* · 길 줄의 키는 40 으로 고정이다(`Breadcrumb size="medium"`) — 폴더를 드나들 때 아래가 안 튄다.
|
|
40
43
|
* @public
|
|
41
44
|
*/
|
|
42
|
-
export default function FolderHead({ rootLabel, opened, onOpen, paths, countOf, folderMenu, rootMenu, dropProps, dropOver, onMoveFolder, itemDragging, rootDropKey, }: FolderHeadProps): import("react").JSX.Element;
|
|
45
|
+
export default function FolderHead({ rootLabel, opened, onOpen, paths, countOf, folderMenu, rootMenu, dropProps, dropOver, onMoveFolder, itemDragging, rootDropKey, add, }: FolderHeadProps): import("react").JSX.Element;
|
|
@@ -22,7 +22,7 @@ import './FolderHead.css';
|
|
|
22
22
|
* · 길 줄의 키는 40 으로 고정이다(`Breadcrumb size="medium"`) — 폴더를 드나들 때 아래가 안 튄다.
|
|
23
23
|
* @public
|
|
24
24
|
*/
|
|
25
|
-
export default function FolderHead({ rootLabel, opened, onOpen, paths, countOf, folderMenu, rootMenu, dropProps, dropOver, onMoveFolder, itemDragging, rootDropKey, }) {
|
|
25
|
+
export default function FolderHead({ rootLabel, opened, onOpen, paths, countOf, folderMenu, rootMenu, dropProps, dropOver, onMoveFolder, itemDragging, rootDropKey, add, }) {
|
|
26
26
|
const { t } = useTranslation();
|
|
27
27
|
/** 길의 메뉴가 붙을 단추 — 열려 있으면 그 단추 */
|
|
28
28
|
const [menuAnchor, setMenuAnchor] = useState(null);
|
|
@@ -65,5 +65,5 @@ export default function FolderHead({ rootLabel, opened, onOpen, paths, countOf,
|
|
|
65
65
|
onOpen: () => onOpen(parent),
|
|
66
66
|
cardDropKey: parent ?? rootDropKey,
|
|
67
67
|
onFolderDrop: onMoveFolder ? path => onMoveFolder(path, parent) : undefined,
|
|
68
|
-
} : undefined }), menuAnchor && hasMenu && (_jsx(Tooltip, { anchorEl: menuAnchor, onClose: closeMenu, closeOnOutsideClick: true, offset: 4, prefer: "bottom", ariaLabel: menuLabel, children: _jsx(MenuTooltip, { columns: [{ items: (opened ? folderMenu?.(opened) : rootMenu) ?? [] }], size: "small", onClose: closeMenu }) }))] }));
|
|
68
|
+
} : undefined, add: add }), menuAnchor && hasMenu && (_jsx(Tooltip, { anchorEl: menuAnchor, onClose: closeMenu, closeOnOutsideClick: true, offset: 4, prefer: "bottom", ariaLabel: menuLabel, children: _jsx(MenuTooltip, { columns: [{ items: (opened ? folderMenu?.(opened) : rootMenu) ?? [] }], size: "small", onClose: closeMenu }) }))] }));
|
|
69
69
|
}
|
|
@@ -257,6 +257,9 @@
|
|
|
257
257
|
(처음에 "표(`panel-row`)와 선을 맞춘다" 로 읽어 20px 들여쓰기로 올렸다가 사장님께
|
|
258
258
|
바로잡혔다. 눈에 보인 어긋남과 말씀하신 것이 달랐다.) */
|
|
259
259
|
.confirm-popup__message {
|
|
260
|
+
/* **제목보다 한 단계 옅게**(말귀 청 (446-1), 사장님 지시 2026-11-16 *"색상이 너무 진한데"*, 색은 사장님이 골랐다) — 색이 없어 제목과
|
|
261
|
+
같은 --color-black 을 물려받았다 */
|
|
262
|
+
color: var(--color-darkGray);
|
|
260
263
|
padding: 8px 0;
|
|
261
264
|
margin: 0 auto;
|
|
262
265
|
width: fit-content;
|
|
@@ -90,3 +90,21 @@
|
|
|
90
90
|
flex-direction: column;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
|
|
94
|
+
/* **단축키 키캡**(말귀 청 (447)) — 항목 오른쪽 끝, 이름과 따로. 이름이 길면 이름이 줄고 키캡은 안 잘린다.
|
|
95
|
+
색은 이 메뉴에 있던 값 그대로 — 글자는 열 머리글(lightGray), 테두리는 구분선(whiteLine). */
|
|
96
|
+
.menu-tooltip__shortcut {
|
|
97
|
+
flex-shrink: 0;
|
|
98
|
+
min-width: 22px;
|
|
99
|
+
height: 22px;
|
|
100
|
+
padding: 0 6px;
|
|
101
|
+
display: inline-flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
border: 1px solid var(--color-whiteLine);
|
|
106
|
+
border-radius: var(--radius-xs);
|
|
107
|
+
color: var(--color-lightGray);
|
|
108
|
+
font-family: inherit;
|
|
109
|
+
line-height: 1;
|
|
110
|
+
}
|
|
@@ -19,7 +19,18 @@ export type TooltipMenuColumnItem = {
|
|
|
19
19
|
/** 우측 원형 배지 숫자(알림 개수 등). 라벨에 "(5)"를 붙이는 대신 SideNav와 같은
|
|
20
20
|
* Badge type="dot"으로 표시한다 — 두 메뉴가 같은 항목을 다르게 보여주지 않도록. */
|
|
21
21
|
badgeCount?: number;
|
|
22
|
+
/**
|
|
23
|
+
* **단축키**(말귀 청 (447), 사장님 지시 2026-11-16 *"버튼 단축키 가능한가? · 쇼컷을 이름에 붙이지 말고 우측에 보이도록"*) — 글자 하나
|
|
24
|
+
* (`'E'`) 또는 숫자 하나(`'1'`).
|
|
25
|
+
* · 보이기: 항목 오른쪽 끝에 키캡으로 따로 선다. 이름이 길면 이름이 줄고 키캡은 안 잘린다. 하위 메뉴(`children`) · 배지가 있으면 그쪽이 선다.
|
|
26
|
+
* · 누르기: 메뉴가 떠 있는 동안 그 키를 누르면 이 항목을 누른 것과 같다(`closeOnSelect` 그대로). **자판 자리(`event.code`)로 맞춰**
|
|
27
|
+
* 한글 입력 상태에서도 먹는다. 꺼진 항목 · 입력칸에 초점이 있을 때 · Ctrl/⌘/Alt 와 함께 누를 때는 안 먹는다. 지금 보이는 목록만 본다.
|
|
28
|
+
* · 낭독기: `aria-keyshortcuts` 로 알린다.
|
|
29
|
+
*/
|
|
30
|
+
shortcut?: string;
|
|
22
31
|
};
|
|
32
|
+
/** 단축키 글자 → 자판 자리(`KeyE` · `Digit1`). 글자 · 숫자 하나가 아니면 `null` */
|
|
33
|
+
export declare function shortcutCode(shortcut: string | undefined): string | null;
|
|
23
34
|
/** @public */
|
|
24
35
|
export type TooltipMenuColumn = {
|
|
25
36
|
/**
|
|
@@ -6,6 +6,15 @@ import Button from '../Button';
|
|
|
6
6
|
import CircleBadge from '../CircleBadge';
|
|
7
7
|
import './MenuTooltip.css';
|
|
8
8
|
import { withLegacy } from '../../utils/legacyBlocks';
|
|
9
|
+
/** 단축키 글자 → 자판 자리(`KeyE` · `Digit1`). 글자 · 숫자 하나가 아니면 `null` */
|
|
10
|
+
export function shortcutCode(shortcut) {
|
|
11
|
+
const k = (shortcut ?? '').trim().toUpperCase();
|
|
12
|
+
if (/^[A-Z]$/.test(k))
|
|
13
|
+
return `Key${k}`;
|
|
14
|
+
if (/^[0-9]$/.test(k))
|
|
15
|
+
return `Digit${k}`;
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
9
18
|
/** @public */
|
|
10
19
|
export default function MenuTooltip({ columns = [], onClose, className = '', size = 'medium' }) {
|
|
11
20
|
const { t } = useTranslation();
|
|
@@ -82,6 +91,32 @@ export default function MenuTooltip({ columns = [], onClose, className = '', siz
|
|
|
82
91
|
}
|
|
83
92
|
catch (err) { }
|
|
84
93
|
}, [onClose, visibleDepth]);
|
|
94
|
+
/* **단축키**(청 (447)) — 떠 있는 동안 지금 보이는 목록의 항목을 자판 자리로 누른다. 최신 목록 · 손은 ref 로 읽어 듣개를 한 번만 건다 */
|
|
95
|
+
const shortcutRef = useRef({ columns: current.columns, handleClick });
|
|
96
|
+
shortcutRef.current = { columns: current.columns, handleClick };
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
const onKey = (e) => {
|
|
99
|
+
if (e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey)
|
|
100
|
+
return;
|
|
101
|
+
const target = e.target;
|
|
102
|
+
if (target && (target.closest?.('input, textarea, select, [contenteditable=""], [contenteditable="true"]')))
|
|
103
|
+
return;
|
|
104
|
+
const { columns: cols, handleClick: press } = shortcutRef.current;
|
|
105
|
+
for (let ci = 0; ci < (cols?.length ?? 0); ci++) {
|
|
106
|
+
const items = cols[ci]?.items ?? [];
|
|
107
|
+
for (let ii = 0; ii < items.length; ii++) {
|
|
108
|
+
const it = items[ii];
|
|
109
|
+
if (!it || it.disabled || shortcutCode(it.shortcut) !== e.code)
|
|
110
|
+
continue;
|
|
111
|
+
e.preventDefault();
|
|
112
|
+
press(it, ci, ii);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
window.addEventListener('keydown', onKey);
|
|
118
|
+
return () => window.removeEventListener('keydown', onKey);
|
|
119
|
+
}, []);
|
|
85
120
|
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) => {
|
|
86
121
|
/**
|
|
87
122
|
* **아무도 안 쓰는 왼쪽 자리는 안 세운다**(말귀 청 (349), 2026-10-29).
|
|
@@ -111,7 +146,9 @@ export default function MenuTooltip({ columns = [], onClose, className = '', siz
|
|
|
111
146
|
? 'chevron-right'
|
|
112
147
|
: item.badgeCount
|
|
113
148
|
? _jsx(CircleBadge, { position: "inline", number: Math.min(item.badgeCount, 99), size: 24, "aria-hidden": true })
|
|
114
|
-
:
|
|
149
|
+
: shortcutCode(item.shortcut)
|
|
150
|
+
? _jsx("kbd", { className: withLegacy('menu-tooltip__shortcut caption-1'), "aria-hidden": "true", children: item.shortcut.trim().toUpperCase() })
|
|
151
|
+
: undefined, "aria-keyshortcuts": shortcutCode(item.shortcut) ? item.shortcut.trim().toUpperCase() : undefined, ellipsis: shortcutCode(item.shortcut) ? true : undefined, label: item.label,
|
|
115
152
|
/* 개수는 이름에 붙인다 — ariaLabel 이 글자뿐이라 배지 수가 이름에서 빠져 "알림" 으로만 읽혔다
|
|
116
153
|
(SideNav·BottomNav 와 같은 nav.badgeLabel "알림, 5개"). */
|
|
117
154
|
ariaLabel: item.label && item.badgeCount && item.badgeCount > 0
|
|
@@ -106,7 +106,7 @@ export type { BreadcrumbProps, BreadcrumbItem } from './components/Breadcrumb';
|
|
|
106
106
|
export { default as FolderHead } from './components/FolderHead';
|
|
107
107
|
export type { FolderHeadProps } from './components/FolderHead';
|
|
108
108
|
export { default as FolderGrid } from './components/FolderGrid';
|
|
109
|
-
export type { FolderGridProps, FolderEntry, FolderUpEntry } from './components/FolderGrid';
|
|
109
|
+
export type { FolderGridProps, FolderEntry, FolderUpEntry, FolderAddEntry } from './components/FolderGrid';
|
|
110
110
|
export { default as FolderList } from './components/FolderList';
|
|
111
111
|
export type { FolderListProps } from './components/FolderList';
|
|
112
112
|
export { default as FolderAddPopup } from './components/FolderAddPopup';
|