@ihabdevteam/core 0.438.0 → 0.441.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 +46 -0
- package/README.md +3 -3
- package/dist/components.cjs.js +190 -180
- package/dist/components.esm.css +1 -1
- package/dist/hooks.cjs.js +5 -5
- package/dist/i18n.cjs.js +3 -3
- package/dist/ihabdevteam-core.cjs.js +196 -186
- package/dist/ihabdevteam-core.d.ts +435 -5
- package/dist/packages/core/src/components/Breadcrumb.css +52 -0
- package/dist/packages/core/src/components/Breadcrumb.d.ts +19 -1
- package/dist/packages/core/src/components/Breadcrumb.js +12 -4
- package/dist/packages/core/src/components/Button.css +9 -2
- package/dist/packages/core/src/components/CardSection.css +26 -0
- package/dist/packages/core/src/components/CardSection.d.ts +32 -0
- package/dist/packages/core/src/components/CardSection.js +23 -0
- package/dist/packages/core/src/components/FolderGrid.css +28 -0
- package/dist/packages/core/src/components/FolderGrid.d.ts +47 -0
- package/dist/packages/core/src/components/FolderGrid.js +68 -0
- package/dist/packages/core/src/components/FolderHead.css +8 -0
- package/dist/packages/core/src/components/FolderHead.d.ts +42 -0
- package/dist/packages/core/src/components/FolderHead.js +62 -0
- package/dist/packages/core/src/components/FolderSearchSections.d.ts +25 -0
- package/dist/packages/core/src/components/FolderSearchSections.js +18 -0
- package/dist/packages/core/src/components/FolderTreeButton.css +2 -0
- package/dist/packages/core/src/components/FolderTreeButton.d.ts +34 -0
- package/dist/packages/core/src/components/FolderTreeButton.js +44 -0
- package/dist/packages/core/src/components/Popup/ConfirmPopup.d.ts +8 -2
- package/dist/packages/core/src/components/Popup/ConfirmPopup.js +3 -3
- package/dist/packages/core/src/components/Tooltip/FolderTreeTooltip.css +99 -0
- package/dist/packages/core/src/components/Tooltip/FolderTreeTooltip.d.ts +60 -0
- package/dist/packages/core/src/components/Tooltip/FolderTreeTooltip.js +81 -0
- package/dist/packages/core/src/components/Tooltip/Tooltip.d.ts +6 -0
- package/dist/packages/core/src/components/Tooltip/Tooltip.js +10 -4
- package/dist/packages/core/src/components.d.ts +12 -0
- package/dist/packages/core/src/components.js +8 -0
- package/dist/packages/core/src/hooks/useCardDragToGroup.d.ts +33 -0
- package/dist/packages/core/src/hooks/useCardDragToGroup.js +52 -0
- package/dist/packages/core/src/hooks/useFolderBrowse.d.ts +30 -0
- package/dist/packages/core/src/hooks/useFolderBrowse.js +38 -0
- package/dist/packages/core/src/hooks.d.ts +2 -0
- package/dist/packages/core/src/hooks.js +3 -0
- package/dist/packages/core/src/i18n/locales/en.json +10 -0
- package/dist/packages/core/src/i18n/locales/ko.json +9 -0
- package/dist/packages/core/src/utils/folderMenu.d.ts +27 -0
- package/dist/packages/core/src/utils/folderMenu.js +19 -0
- package/dist/packages/core/src/utils/folderPath.d.ts +50 -0
- package/dist/packages/core/src/utils/folderPath.js +98 -0
- package/dist/packages/core/src/utils/lucideIconSet.js +4 -0
- package/dist/packages/core/src/utils.d.ts +3 -0
- package/dist/packages/core/src/utils.js +3 -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 +175 -165
- package/package.json +3 -3
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* **폴더 구조 나무**(`FolderTreeTooltip`) — 구조 단추(`FolderTreeButton`)가 띄우는 통의 속(말귀 청 (435), 사장님 지시 2026-11-13
|
|
2
|
+
"폴더 구조를 보여줄 수 있는 ui로 … 새로운 tooltip"). 뜨는 통(그림자 · 모서리 · 자리)은 `Tooltip` 이 쥐고, 여기는 **줄**만 그린다.
|
|
3
|
+
줄 = (폴더 아이콘 · 이름 · 든 수) · 접는 화살표. 층은 줄의 왼쪽 여백이다(`--folder-depth`). */
|
|
4
|
+
.folder-tree-tooltip {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
min-width: 220px;
|
|
8
|
+
max-width: 320px;
|
|
9
|
+
/* 폴더가 많으면 통 안에서 구른다 — 화면 밖으로 넘치지 않게 */
|
|
10
|
+
max-height: min(60vh, 420px);
|
|
11
|
+
overflow-y: auto;
|
|
12
|
+
padding: var(--spacing-xs);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.folder-tree-tooltip__row {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
min-height: 36px;
|
|
19
|
+
/* 한 층에 24px — 위 폴더 아이콘의 가운데에서 내려온 선이 제 아이콘까지 꺾여 닿을 만큼(16 이면 꺾일 자리가 없다) */
|
|
20
|
+
padding-left: calc(var(--folder-depth, 0) * 24px);
|
|
21
|
+
border-radius: var(--radius-s);
|
|
22
|
+
}
|
|
23
|
+
.folder-tree-tooltip__row:hover { background: var(--color-darkWhite); }
|
|
24
|
+
/* **폴더 안의 폴더 앞에 꺾인 선**(└)을 긋는다(사장님 지시 2026-11-13 — 「앙」 아래 「ㅁㅁ」 앞에 L 을 그려 보이시며
|
|
25
|
+
"이 표현 가능해?") — 어느 폴더에 딸렸는지가 들여쓰기만으로는 약했다. 줄의 왼쪽 여백 끝(위 폴더의 아이콘 아래쯤)에서
|
|
26
|
+
내려와 제 아이콘 쪽으로 꺾인다. 꾸밈이라 낭독기에는 없다(층은 `aria-level` 이 말한다). */
|
|
27
|
+
.folder-tree-tooltip__row { position: relative; }
|
|
28
|
+
.folder-tree-tooltip__row--nested::before {
|
|
29
|
+
content: '';
|
|
30
|
+
position: absolute;
|
|
31
|
+
/* **위 폴더의 아이콘 가운데 아래**에서 내려와 **제 아이콘 앞**까지 꺾인다(사장님 지시 2026-11-13 "맞았으면 좋겠는데") —
|
|
32
|
+
위 폴더의 아이콘 가운데 = (층-1)×24 + 이름 여백 8 + 아이콘 반 9 = (층-1)×24 + 17.
|
|
33
|
+
제 아이콘의 왼끝은 거기서 15px 오른쪽이라, 2px 를 띄우고 13px 를 간다. */
|
|
34
|
+
left: calc((var(--folder-depth, 1) - 1) * 24px + 16px);
|
|
35
|
+
/* 작은 꺾쇠다(사장님 지시 2026-11-13 "ㄴ 이 좀 너무 큰거 같기도 한데") — 처음엔 위 폴더의 아이콘 밑에서부터 길게 내려
|
|
36
|
+
그었다. 이제 제 줄 안에서만 짧게 꺾인다(세로 10 · 가로 10). 왼끝은 그대로 위 폴더 아이콘의 가운데다. */
|
|
37
|
+
top: 8px;
|
|
38
|
+
width: 10px;
|
|
39
|
+
height: 10px;
|
|
40
|
+
/* 선의 색은 `--color-lightGray` 다(사장님 지시 2026-11-13 — darkWhite · whiteLine 을 거쳐 작은 꺾쇠가 되고서 다시 "lightGray") */
|
|
41
|
+
border-left: 1.5px solid var(--color-lightGray);
|
|
42
|
+
border-bottom: 1.5px solid var(--color-lightGray);
|
|
43
|
+
border-bottom-left-radius: 4px;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
}
|
|
46
|
+
/* 지금 있는 자리 — 옅은 바탕과 굵은 글자로 말한다 */
|
|
47
|
+
.folder-tree-tooltip__row--here { background: var(--color-main-a10); }
|
|
48
|
+
.folder-tree-tooltip__row--here:hover { background: var(--color-main-a10); }
|
|
49
|
+
.folder-tree-tooltip__row--here .folder-tree-tooltip__label { font-weight: var(--text-body-2-weight-bold); }
|
|
50
|
+
/* 끌어 옮기기 — 쥔 줄은 흐려지고, 놓을 수 있는 줄 위에 뜨면 테를 두른다(폴더 칸의 '놓을 자리' 와 같은 말) */
|
|
51
|
+
.folder-tree-tooltip__row--dragging { opacity: 0.4; }
|
|
52
|
+
.folder-tree-tooltip__row--over { box-shadow: inset 0 0 0 2px var(--color-main); }
|
|
53
|
+
.folder-tree-tooltip__row[draggable="true"] { cursor: grab; }
|
|
54
|
+
|
|
55
|
+
/* 접는 화살표 — 줄의 **오른쪽 끝**에 선다(왼쪽은 꺾인 선의 자리다). 접혀 있으면 ›, 펴져 있으면 ⌄ */
|
|
56
|
+
.folder-tree-tooltip__twist {
|
|
57
|
+
flex: none;
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
width: 28px;
|
|
62
|
+
height: 28px;
|
|
63
|
+
margin-right: var(--spacing-xs);
|
|
64
|
+
padding: 0;
|
|
65
|
+
border: none;
|
|
66
|
+
border-radius: var(--radius-xs);
|
|
67
|
+
background: none;
|
|
68
|
+
color: var(--color-gray);
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
transition: transform 0.12s;
|
|
71
|
+
}
|
|
72
|
+
.folder-tree-tooltip__twist--open { transform: rotate(90deg); }
|
|
73
|
+
.folder-tree-tooltip__twist:focus-visible { outline: 2px solid var(--color-main); outline-offset: 1px; }
|
|
74
|
+
|
|
75
|
+
.folder-tree-tooltip__name {
|
|
76
|
+
flex: 1;
|
|
77
|
+
min-width: 0;
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
gap: var(--spacing-xs);
|
|
81
|
+
min-height: 36px;
|
|
82
|
+
padding: 0 var(--spacing-xs);
|
|
83
|
+
border: none;
|
|
84
|
+
border-radius: var(--radius-s);
|
|
85
|
+
background: none;
|
|
86
|
+
color: var(--color-text-primary);
|
|
87
|
+
font-family: inherit;
|
|
88
|
+
text-align: left;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
}
|
|
91
|
+
.folder-tree-tooltip__name:focus-visible { outline: 2px solid var(--color-main); outline-offset: -2px; }
|
|
92
|
+
/* 폴더 아이콘은 `--color-lightGray` 다(사장님 지시 2026-11-13 "폴더 아이콘 색상도 lightGray") — 처음엔 `--color-gray` 였다 */
|
|
93
|
+
.folder-tree-tooltip__icon { flex: none; display: inline-flex; align-items: center; color: var(--color-lightGray); }
|
|
94
|
+
/* 이름은 남는 만큼 — 길면 한 줄에서 줄인다 */
|
|
95
|
+
.folder-tree-tooltip__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
96
|
+
.folder-tree-tooltip__count { flex: none; color: var(--color-gray); }
|
|
97
|
+
|
|
98
|
+
/* 접는 화살표의 그림 — 감싸개가 줄 높이만큼 커지지 않게 */
|
|
99
|
+
.folder-tree-tooltip__twist-mark { display: inline-flex; align-items: center; }
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import './FolderTreeTooltip.css';
|
|
2
|
+
/**
|
|
3
|
+
* 나무의 한 줄 — `folderTree`(`utils`)가 내주는 꼴에 든 수를 얹은 것.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface FolderTreeNode {
|
|
7
|
+
/** 폴더의 온 길(`앙/하위`) — 고르면 이것을 돌려준다 */
|
|
8
|
+
path: string;
|
|
9
|
+
/** 보일 이름 — 길의 마지막 마디 */
|
|
10
|
+
label: string;
|
|
11
|
+
/** 층 — 맨 위 폴더가 0 */
|
|
12
|
+
depth: number;
|
|
13
|
+
/** 그 폴더에 든 수 — 0 이면 안 적는다 */
|
|
14
|
+
count: number;
|
|
15
|
+
}
|
|
16
|
+
/** @public */
|
|
17
|
+
export interface FolderTreeTooltipProps {
|
|
18
|
+
/** 통이 붙을 마디 — 띄운 단추 */
|
|
19
|
+
anchorEl: Element | null;
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
/** 맨 위의 이름 — 나무의 첫 줄 */
|
|
22
|
+
rootLabel: string;
|
|
23
|
+
/** 지금 있는 폴더의 온 길(맨 위면 `null`) — 그 줄에 표시가 붙는다 */
|
|
24
|
+
opened: string | null;
|
|
25
|
+
/** 줄을 골랐다 — 폴더의 온 길, 맨 위면 `null` */
|
|
26
|
+
onPick: (path: string | null) => void;
|
|
27
|
+
/** 나무를 **펼친 차례**로 — 부모 바로 뒤에 자식이 선다(`folderTree`) */
|
|
28
|
+
tree: readonly FolderTreeNode[];
|
|
29
|
+
/** 낭독기가 읽을 통의 이름 */
|
|
30
|
+
ariaLabel: string;
|
|
31
|
+
/**
|
|
32
|
+
* 폴더를 끌어 **다른 폴더에 넣거나 뺀다** — 주면 폴더 줄을 쥐고 끌 수 있고, 다른 폴더 줄에 놓으면 그 안으로, 맨 위 줄에
|
|
33
|
+
* 놓으면 맨 위로 뺀다. `into` 는 놓은 폴더의 온 길(맨 위면 `null`). 제 자신 · 제 아래 · 이미 있는 자리에는 안 놓인다
|
|
34
|
+
* (`canMoveFolder`). 통은 옮긴 뒤에도 떠 있다 — 이어서 더 옮길 수 있게.
|
|
35
|
+
*/
|
|
36
|
+
onMove?: (path: string, into: string | null) => void;
|
|
37
|
+
/**
|
|
38
|
+
* **든 것(카드)을 나무의 줄에 끌어다 놓는다** — 화면이 카드를 끄는 중일 때 그 줄을 놓을 자리로 만드는 손이다(폴더 칸
|
|
39
|
+
* `FolderGrid` 가 쓰는 것과 같은 손). `path` 가 `null` 이면 맨 위 줄이다. 폴더 줄을 끄는 중(폴더 옮기기)에는 안 쓴다 —
|
|
40
|
+
* 두 가지 끌기가 한 줄에서 겹치지 않게.
|
|
41
|
+
*/
|
|
42
|
+
itemDropProps?: (path: string | null) => Record<string, unknown>;
|
|
43
|
+
/** 끌고 있는 카드가 지금 그 줄 위에 떠 있나 */
|
|
44
|
+
itemDropOver?: (path: string | null) => boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* **폴더 구조를 나무로 띄우는 툴팁** — `MenuTooltip` 의 짝이다. 그쪽이 '할 일의 줄' 이라면 이쪽은 **'어디에 있나' 의 나무**다
|
|
48
|
+
* (말귀 청 (435), 사장님 지시 2026-11-13 *"menu 툴팁 사용하지말고 폴더 구조를 보여줄 수 있는 ui로 구성되도록 새로운 tooltip
|
|
49
|
+
* 만들어줘"*). 뜨는 통(그림자 · 모서리 · 자리 · 바깥 누름)은 `Tooltip` 그대로이고 속만 여기서 그린다: 줄마다 폴더 아이콘 ·
|
|
50
|
+
* 이름 · 든 수 · 접는 화살표가 서고, 층은 들여쓰기와 꺾쇠(└)다. 지금 자리는 옅은 바탕 · 굵은 글자 · 열린 폴더 아이콘으로 말한다.
|
|
51
|
+
*
|
|
52
|
+
* · **맨 위(뿌리)가 첫 줄**이다 — `rootLabel`. 고르면 `null` 을 돌려준다.
|
|
53
|
+
* · 하위 폴더가 있는 줄은 오른쪽 끝의 화살표로 **접고 편다**(처음엔 다 펴져 있다). 접힘은 이 통이 떠 있는 동안만 기억한다.
|
|
54
|
+
* · 줄을 고르면 `onPick` 을 부르고 **닫는다**(`onClose`). 닫을지는 부르는 쪽이 쥔다 — 통을 띄운 단추가 제 상태를 안다.
|
|
55
|
+
* · 아래로 펼친다(`prefer="bottom"`) — 위로 뜨면 쪽 제목을 덮는다.
|
|
56
|
+
*
|
|
57
|
+
* 띄우는 단추는 따로 있다(`FolderTreeButton`).
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
export default function FolderTreeTooltip({ anchorEl, onClose, rootLabel, opened, onPick, tree, ariaLabel, onMove, itemDropProps, itemDropOver, }: FolderTreeTooltipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import Tooltip from './Tooltip';
|
|
6
|
+
import Icon from '../Icon';
|
|
7
|
+
import { canMoveFolder, isInFolder } from '../../utils/folderPath';
|
|
8
|
+
import './FolderTreeTooltip.css';
|
|
9
|
+
/** 맨 위 줄의 열쇠 — 폴더 이름에는 빗금을 못 쓰니 겹칠 일이 없다 */
|
|
10
|
+
const ROOT = '/';
|
|
11
|
+
/**
|
|
12
|
+
* **폴더 구조를 나무로 띄우는 툴팁** — `MenuTooltip` 의 짝이다. 그쪽이 '할 일의 줄' 이라면 이쪽은 **'어디에 있나' 의 나무**다
|
|
13
|
+
* (말귀 청 (435), 사장님 지시 2026-11-13 *"menu 툴팁 사용하지말고 폴더 구조를 보여줄 수 있는 ui로 구성되도록 새로운 tooltip
|
|
14
|
+
* 만들어줘"*). 뜨는 통(그림자 · 모서리 · 자리 · 바깥 누름)은 `Tooltip` 그대로이고 속만 여기서 그린다: 줄마다 폴더 아이콘 ·
|
|
15
|
+
* 이름 · 든 수 · 접는 화살표가 서고, 층은 들여쓰기와 꺾쇠(└)다. 지금 자리는 옅은 바탕 · 굵은 글자 · 열린 폴더 아이콘으로 말한다.
|
|
16
|
+
*
|
|
17
|
+
* · **맨 위(뿌리)가 첫 줄**이다 — `rootLabel`. 고르면 `null` 을 돌려준다.
|
|
18
|
+
* · 하위 폴더가 있는 줄은 오른쪽 끝의 화살표로 **접고 편다**(처음엔 다 펴져 있다). 접힘은 이 통이 떠 있는 동안만 기억한다.
|
|
19
|
+
* · 줄을 고르면 `onPick` 을 부르고 **닫는다**(`onClose`). 닫을지는 부르는 쪽이 쥔다 — 통을 띄운 단추가 제 상태를 안다.
|
|
20
|
+
* · 아래로 펼친다(`prefer="bottom"`) — 위로 뜨면 쪽 제목을 덮는다.
|
|
21
|
+
*
|
|
22
|
+
* 띄우는 단추는 따로 있다(`FolderTreeButton`).
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export default function FolderTreeTooltip({ anchorEl, onClose, rootLabel, opened, onPick, tree, ariaLabel, onMove, itemDropProps, itemDropOver, }) {
|
|
26
|
+
const { t } = useTranslation();
|
|
27
|
+
/** 접어 둔 폴더들 — 그 아래 줄은 안 선다 */
|
|
28
|
+
const [folded, setFolded] = useState(new Set());
|
|
29
|
+
const pick = (path) => { onPick(path); onClose(); };
|
|
30
|
+
/** 지금 끌고 있는 폴더 · 그것이 떠 있는 줄(맨 위 줄은 `ROOT`) */
|
|
31
|
+
const [dragging, setDragging] = useState(null);
|
|
32
|
+
const [over, setOver] = useState(null);
|
|
33
|
+
/** 그 줄을 놓을 자리로 만드는 손 — 못 놓는 자리면 아무것도 안 얹는다(금지 커서가 선다) */
|
|
34
|
+
const dropOn = (into) => {
|
|
35
|
+
/* 폴더를 끄는 중이 아니면 **카드가 놓일 자리**다(화면이 준 손) */
|
|
36
|
+
if (dragging === null)
|
|
37
|
+
return itemDropProps?.(into) ?? {};
|
|
38
|
+
if (!onMove || !canMoveFolder(dragging, into))
|
|
39
|
+
return {};
|
|
40
|
+
const key = into ?? ROOT;
|
|
41
|
+
return {
|
|
42
|
+
onDragOver: (e) => { e.preventDefault(); e.dataTransfer.dropEffect = 'move'; if (over !== key)
|
|
43
|
+
setOver(key); },
|
|
44
|
+
onDragLeave: () => setOver(now => (now === key ? null : now)),
|
|
45
|
+
onDrop: (e) => { e.preventDefault(); const from = dragging; setDragging(null); setOver(null); onMove(from, into); },
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** 폴더 줄을 쥐는 손 */
|
|
49
|
+
const dragFrom = (path) => (onMove ? {
|
|
50
|
+
draggable: true,
|
|
51
|
+
onDragStart: (e) => { e.dataTransfer.effectAllowed = 'move'; e.dataTransfer.setData('text/plain', path); setDragging(path); },
|
|
52
|
+
onDragEnd: () => { setDragging(null); setOver(null); },
|
|
53
|
+
} : {});
|
|
54
|
+
const toggle = (path) => setFolded(now => {
|
|
55
|
+
const next = new Set(now);
|
|
56
|
+
if (next.has(path))
|
|
57
|
+
next.delete(path);
|
|
58
|
+
else
|
|
59
|
+
next.add(path);
|
|
60
|
+
return next;
|
|
61
|
+
});
|
|
62
|
+
/* 접힌 폴더의 **아래** 줄은 뺀다(접힌 폴더 그 줄은 남는다) */
|
|
63
|
+
const rows = tree.filter(node => ![...folded].some(f => f !== node.path && isInFolder(node.path, f)));
|
|
64
|
+
const rowClass = (extra) => ['folder-tree-tooltip__row', ...extra].filter(Boolean).join(' ');
|
|
65
|
+
return (_jsx(Tooltip, { anchorEl: anchorEl, onClose: onClose, closeOnOutsideClick: true, offset: 4, prefer: "bottom", ariaLabel: ariaLabel, children: _jsxs("div", { className: "folder-tree-tooltip", role: "tree", "aria-label": ariaLabel, children: [_jsx("div", { role: "none", ...dropOn(null), className: rowClass([
|
|
66
|
+
opened === null && 'folder-tree-tooltip__row--here',
|
|
67
|
+
(over === ROOT || (dragging === null && !!itemDropOver?.(null))) && 'folder-tree-tooltip__row--over',
|
|
68
|
+
]), children: _jsxs("button", { type: "button", className: "folder-tree-tooltip__name body-2", role: "treeitem", "aria-level": 1, "aria-current": opened === null ? 'page' : undefined, onClick: () => pick(null), children: [_jsx(Icon, { icon: "folder-open", size: 18, className: "folder-tree-tooltip__icon" }), _jsx("span", { className: "folder-tree-tooltip__label", children: rootLabel })] }) }), rows.map((node, i) => {
|
|
69
|
+
const hasChildren = tree.some(other => other.path !== node.path && isInFolder(other.path, node.path));
|
|
70
|
+
const isFolded = folded.has(node.path);
|
|
71
|
+
const here = opened === node.path;
|
|
72
|
+
return (_jsxs("div", { role: "none", ...dragFrom(node.path), ...dropOn(node.path), className: rowClass([
|
|
73
|
+
node.depth > 0 && 'folder-tree-tooltip__row--nested',
|
|
74
|
+
here && 'folder-tree-tooltip__row--here',
|
|
75
|
+
(over === node.path || (dragging === null && !!itemDropOver?.(node.path))) && 'folder-tree-tooltip__row--over',
|
|
76
|
+
dragging === node.path && 'folder-tree-tooltip__row--dragging',
|
|
77
|
+
]), style: { '--folder-depth': node.depth + 1 }, children: [_jsxs("button", { type: "button", className: "folder-tree-tooltip__name body-2", role: "treeitem", "aria-level": node.depth + 2, "aria-posinset": i + 1, "aria-current": here ? 'page' : undefined, onClick: () => pick(node.path), children: [_jsx(Icon, { icon: here ? 'folder-open' : 'folder', size: 18, className: "folder-tree-tooltip__icon" }), _jsx("span", { className: "folder-tree-tooltip__label", children: node.label }), node.count > 0 && _jsx("span", { className: "folder-tree-tooltip__count caption-1", children: node.count })] }), hasChildren && (_jsx("button", { type: "button", className: `folder-tree-tooltip__twist${isFolded ? '' : ' folder-tree-tooltip__twist--open'}`, "aria-label": isFolded
|
|
78
|
+
? t('folder.unfold', { name: node.label, defaultValue: '{{name}} 펼치기' })
|
|
79
|
+
: t('folder.fold', { name: node.label, defaultValue: '{{name}} 접기' }), "aria-expanded": !isFolded, onClick: () => toggle(node.path), children: _jsx(Icon, { icon: "chevron-right", size: 16, className: "folder-tree-tooltip__twist-mark" }) }))] }, node.path));
|
|
80
|
+
})] }) }));
|
|
81
|
+
}
|
|
@@ -8,6 +8,12 @@ export interface TooltipProps {
|
|
|
8
8
|
anchorEl?: Element | null;
|
|
9
9
|
offset?: number;
|
|
10
10
|
edgeMargin?: number;
|
|
11
|
+
/**
|
|
12
|
+
* 먼저 고를 쪽. 기본 `top` — 전처럼 위에 자리가 있으면 위로 뜬다.
|
|
13
|
+
* `bottom` 을 주면 **아래에 자리가 있을 때 아래로** 뜬다(없으면 위 · 옆으로 전과 같이 넘어간다) — 단추에서 펼쳐 내리는
|
|
14
|
+
* 메뉴(「폴더 이름 ▾」)에 쓴다(말귀 청 (432), 사장님 지시 2026-11-13 "tooltip 아래로 나오도록").
|
|
15
|
+
*/
|
|
16
|
+
prefer?: 'top' | 'bottom';
|
|
11
17
|
onClose?: () => void;
|
|
12
18
|
closeOnOutsideClick?: boolean;
|
|
13
19
|
className?: string;
|
|
@@ -10,7 +10,7 @@ import { usePrefersReducedMotion } from '../../hooks/usePrefersReducedMotion';
|
|
|
10
10
|
import { withLegacy } from '../../utils/legacyBlocks';
|
|
11
11
|
/** @public */
|
|
12
12
|
export default function Tooltip(props) {
|
|
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 || {};
|
|
13
|
+
const { anchorRect, anchorEl, offset = 20, edgeMargin = 20, prefer = 'top', onClose, closeOnOutsideClick = true, className = '', role = 'dialog', ariaLabel = '', children, backdrop = false, isMobilePopup = false, useBorder = true, header, focusOnOpen, } = props || {};
|
|
14
14
|
const ref = useRef(null);
|
|
15
15
|
const [posStyle, setPosStyle] = useState({ position: 'fixed', left: 0, top: -9999 });
|
|
16
16
|
const [closing, setClosing] = useState(false);
|
|
@@ -53,12 +53,18 @@ export default function Tooltip(props) {
|
|
|
53
53
|
let left = 0;
|
|
54
54
|
let top = 0;
|
|
55
55
|
let chosen = 'top';
|
|
56
|
-
|
|
56
|
+
const fitsTop = spaceTop >= h + offset;
|
|
57
|
+
const fitsBottom = spaceBottom >= h + offset;
|
|
58
|
+
/* 먼저 고를 쪽(`prefer`)에 자리가 있으면 그쪽, 없으면 맞은쪽 — 둘 다 없을 때의 차례는 전과 같다 */
|
|
59
|
+
const vertical = prefer === 'bottom'
|
|
60
|
+
? (fitsBottom ? 'bottom' : fitsTop ? 'top' : null)
|
|
61
|
+
: (fitsTop ? 'top' : fitsBottom ? 'bottom' : null);
|
|
62
|
+
if (vertical === 'top') {
|
|
57
63
|
chosen = 'top';
|
|
58
64
|
top = rect.top - offset - h;
|
|
59
65
|
left = rect.left + rect.width / 2 - w / 2;
|
|
60
66
|
}
|
|
61
|
-
else if (
|
|
67
|
+
else if (vertical === 'bottom') {
|
|
62
68
|
chosen = 'bottom';
|
|
63
69
|
top = rect.bottom + offset;
|
|
64
70
|
left = rect.left + rect.width / 2 - w / 2;
|
|
@@ -111,7 +117,7 @@ export default function Tooltip(props) {
|
|
|
111
117
|
setPosStyle({ position: 'fixed', left: leftRounded, top: topRounded });
|
|
112
118
|
setMeasured(true);
|
|
113
119
|
}
|
|
114
|
-
}, [isMobile, isMobilePopup, anchorEl, anchorRect, offset, edgeMargin, placement]);
|
|
120
|
+
}, [isMobile, isMobilePopup, anchorEl, anchorRect, offset, edgeMargin, placement, prefer]);
|
|
115
121
|
/* 앵커가 바뀌면 담아 둔 것을 비운다 — 다음 앵커를 새로 재야 한다 */
|
|
116
122
|
useEffect(() => () => { openAnchorRectRef.current = null; }, [anchorEl, anchorRect]);
|
|
117
123
|
// anchor/모드 변경 시 위치를 재계산하는 의도된 동기화다
|
|
@@ -103,6 +103,18 @@ export { default as FileUpload } from './components/FileUpload';
|
|
|
103
103
|
export type { FileUploadProps } from './components/FileUpload';
|
|
104
104
|
export { default as Breadcrumb } from './components/Breadcrumb';
|
|
105
105
|
export type { BreadcrumbProps, BreadcrumbItem } from './components/Breadcrumb';
|
|
106
|
+
export { default as FolderHead } from './components/FolderHead';
|
|
107
|
+
export type { FolderHeadProps } from './components/FolderHead';
|
|
108
|
+
export { default as FolderGrid } from './components/FolderGrid';
|
|
109
|
+
export type { FolderGridProps, FolderEntry } from './components/FolderGrid';
|
|
110
|
+
export { default as CardSection } from './components/CardSection';
|
|
111
|
+
export type { CardSectionProps } from './components/CardSection';
|
|
112
|
+
export { default as FolderSearchSections } from './components/FolderSearchSections';
|
|
113
|
+
export type { FolderSearchSectionsProps } from './components/FolderSearchSections';
|
|
114
|
+
export { default as FolderTreeButton } from './components/FolderTreeButton';
|
|
115
|
+
export type { FolderTreeButtonProps } from './components/FolderTreeButton';
|
|
116
|
+
export { default as FolderTreeTooltip } from './components/Tooltip/FolderTreeTooltip';
|
|
117
|
+
export type { FolderTreeTooltipProps, FolderTreeNode } from './components/Tooltip/FolderTreeTooltip';
|
|
106
118
|
export { default as Rating } from './components/Rating';
|
|
107
119
|
export type { RatingProps, RatingSize } from './components/Rating';
|
|
108
120
|
export { default as ColorPicker } from './components/ColorPicker';
|
|
@@ -71,6 +71,14 @@ export { default as Tabs } from './components/Tabs';
|
|
|
71
71
|
export { default as Avatar } from './components/Avatar';
|
|
72
72
|
export { default as FileUpload } from './components/FileUpload';
|
|
73
73
|
export { default as Breadcrumb } from './components/Breadcrumb';
|
|
74
|
+
/* 폴더로 보는 화면 — 구조 단추 · 길 · 폴더 칸(말귀 청 (435), 2026-11-13). 길 셈은 `utils` 의 `folder*` 다 */
|
|
75
|
+
export { default as FolderHead } from './components/FolderHead';
|
|
76
|
+
export { default as FolderGrid } from './components/FolderGrid';
|
|
77
|
+
/* 폴더 화면의 남은 조각(말귀 청 (437) ㉮, 2026-11-13) — 카드가 서는 자리 · 찾는 중 폴더마다 나눠 세우기 */
|
|
78
|
+
export { default as CardSection } from './components/CardSection';
|
|
79
|
+
export { default as FolderSearchSections } from './components/FolderSearchSections';
|
|
80
|
+
export { default as FolderTreeButton } from './components/FolderTreeButton';
|
|
81
|
+
export { default as FolderTreeTooltip } from './components/Tooltip/FolderTreeTooltip';
|
|
74
82
|
export { default as Rating } from './components/Rating';
|
|
75
83
|
export { default as ColorPicker } from './components/ColorPicker';
|
|
76
84
|
export { default as CountTile } from './components/CountTile';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type DragEvent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* **카드를 끌어 묶음(폴더)에 놓는다** — HTML5 끌어 놓기를 한 벌로 쥔다(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
|
|
4
|
+
*
|
|
5
|
+
* 카드 요소에는 `cardProps(payload)` 를, 놓일 자리(폴더 칸 등)에는 `groupProps(key)` 를 얹는다. 실제로 옮기는 일은
|
|
6
|
+
* `onDrop(payload, key)` 에 맡긴다(열쇠 → 묶음 찾기는 부르는 쪽 몫). `dragging` · `draggingId` · `dragOverKey` 로 그리는 꼴을 바꾼다.
|
|
7
|
+
*
|
|
8
|
+
* · 기본은 `T = string`(카드 id 가 곧 짐)이다. 여러 종류를 한 화면에서 다루면 `T` 를 객체로 두고 `getId` 로 id 를 뽑고,
|
|
9
|
+
* `groupProps` 의 `accept` 로 자리마다 받을 짐을 가린다.
|
|
10
|
+
* · 강조(`dragOverKey`)는 `onDragEnter` 와 `onDragOver` 양쪽에서 건다 — 자리가 `onDragEnter` 를 안 넘기는 조각이어도 선다.
|
|
11
|
+
* · 자식으로 옮겨 가며 나는 `dragleave` 는 버린다 — `relatedTarget` 이 자리 **밖**일 때만 강조를 끈다.
|
|
12
|
+
*
|
|
13
|
+
* `FolderGrid` 의 폴더 칸 끌기도 이 훅으로 선다(전에는 같은 상태를 제 안에서 다시 지었다).
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export interface CardDragToGroup<T> {
|
|
17
|
+
dragging: T | null;
|
|
18
|
+
draggingId: string | null;
|
|
19
|
+
dragOverKey: string | null;
|
|
20
|
+
cardProps: (payload: T) => {
|
|
21
|
+
draggable: true;
|
|
22
|
+
onDragStart: (e: DragEvent<HTMLElement>) => void;
|
|
23
|
+
onDragEnd: () => void;
|
|
24
|
+
};
|
|
25
|
+
groupProps: (groupKey: string, accept?: (payload: T) => boolean) => {
|
|
26
|
+
onDragOver: (e: DragEvent<HTMLElement>) => void;
|
|
27
|
+
onDragEnter: () => void;
|
|
28
|
+
onDragLeave: (e: DragEvent<HTMLElement>) => void;
|
|
29
|
+
onDrop: (e: DragEvent<HTMLElement>) => void;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** @public */
|
|
33
|
+
export declare function useCardDragToGroup<T = string>(onDrop: (payload: T, groupKey: string) => void, getId?: (payload: T) => string): CardDragToGroup<T>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
const defaultGetId = (p) => String(p);
|
|
4
|
+
/** @public */
|
|
5
|
+
export function useCardDragToGroup(onDrop, getId = defaultGetId) {
|
|
6
|
+
const [dragging, setDragging] = useState(null);
|
|
7
|
+
const [dragOverKey, setDragOverKey] = useState(null);
|
|
8
|
+
const cardProps = useCallback((payload) => ({
|
|
9
|
+
draggable: true,
|
|
10
|
+
onDragStart: (e) => {
|
|
11
|
+
setDragging(payload);
|
|
12
|
+
e.dataTransfer.effectAllowed = 'move';
|
|
13
|
+
e.dataTransfer.setData('text/plain', getId(payload));
|
|
14
|
+
},
|
|
15
|
+
onDragEnd: () => { setDragging(null); setDragOverKey(null); },
|
|
16
|
+
}), [getId]);
|
|
17
|
+
const groupProps = useCallback((groupKey, accept) => {
|
|
18
|
+
/* 지금 끄는 짐을 이 자리가 받나(`accept` 를 안 주면 다 받는다) */
|
|
19
|
+
const active = dragging != null && (!accept || accept(dragging));
|
|
20
|
+
return {
|
|
21
|
+
onDragOver: (e) => {
|
|
22
|
+
if (!active)
|
|
23
|
+
return;
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
e.dataTransfer.dropEffect = 'move';
|
|
26
|
+
setDragOverKey(groupKey);
|
|
27
|
+
},
|
|
28
|
+
onDragEnter: () => { if (active)
|
|
29
|
+
setDragOverKey(groupKey); },
|
|
30
|
+
onDragLeave: (e) => {
|
|
31
|
+
if (active && !e.currentTarget.contains(e.relatedTarget))
|
|
32
|
+
setDragOverKey(now => (now === groupKey ? null : now));
|
|
33
|
+
},
|
|
34
|
+
onDrop: (e) => {
|
|
35
|
+
if (!active || dragging == null)
|
|
36
|
+
return;
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
const payload = dragging;
|
|
39
|
+
setDragOverKey(null);
|
|
40
|
+
setDragging(null);
|
|
41
|
+
onDrop(payload, groupKey);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}, [dragging, onDrop]);
|
|
45
|
+
return {
|
|
46
|
+
dragging,
|
|
47
|
+
draggingId: dragging == null ? null : getId(dragging),
|
|
48
|
+
dragOverKey,
|
|
49
|
+
cardProps,
|
|
50
|
+
groupProps,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **폴더로 보는 화면의 자리** — 지금 어느 폴더 안에 있나, 찾는 중인가, 새 폴더는 어디에 서나(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다).
|
|
3
|
+
*
|
|
4
|
+
* 말귀의 나의 단어표 · 나의 단어훈련 · 나의 문장훈련이 이 규칙을 한 벌씩 들고 있다가 앱에서 한 벌로 모았고, 코어 `FolderHead` 식구로 옮겼다.
|
|
5
|
+
* 화면마다 같아야 하는 규칙이다:
|
|
6
|
+
*
|
|
7
|
+
* · **목록에 없는 폴더는 안 연 것으로 친다** — 들어가 있던 폴더를 지웠거나 보기(갈래)를 바꿔 그 폴더가 없으면 맨 위로 돌아온다.
|
|
8
|
+
* · **찾는 중에는 폴더를 가리지 않는다** — 그때 새 폴더는 맨 위에 선다(길이 안 보이는데 안 보이는 폴더 안에 만들면 안 된다).
|
|
9
|
+
* · 폴더를 열면 **첫 쪽으로** 돌아간다(`onOpen`) — 3쪽을 보다가 폴더에 들어가면 그 폴더의 3쪽(대개 빈 화면)이 선다.
|
|
10
|
+
* · 들어가 있던 폴더가 옮겨지거나 이름이 바뀌면 **그 새 길로 따라간다** — 안 따라가면 맨 위로 튕긴다.
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export declare function useFolderBrowse({ paths, search, onOpen }: {
|
|
14
|
+
/** 있는 폴더 전부의 길(중간 폴더까지 채운 것 — `withAncestors`) */
|
|
15
|
+
paths: readonly string[];
|
|
16
|
+
/** 찾는 말 — 비어 있지 않으면 찾는 중이다 */
|
|
17
|
+
search: string;
|
|
18
|
+
/** 폴더를 열거나 맨 위로 갈 때 함께 할 일 — 쪽을 첫 쪽으로 돌린다 */
|
|
19
|
+
onOpen?: () => void;
|
|
20
|
+
}): {
|
|
21
|
+
opened: string | null;
|
|
22
|
+
searching: boolean;
|
|
23
|
+
open: (path: string | null) => void;
|
|
24
|
+
reset: () => void;
|
|
25
|
+
followMove: (from: string, into: string | null) => void;
|
|
26
|
+
followRename: (from: string, to: string) => void;
|
|
27
|
+
newFolderParent: string | null;
|
|
28
|
+
/** 새 폴더가 설 자리에 이미 있는 이름들 — 같은 이름을 또 못 짓게 견준다 */
|
|
29
|
+
siblingNames: string[];
|
|
30
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { folderChildren, folderLeaf, folderMoved } from '../utils/folderPath';
|
|
4
|
+
/**
|
|
5
|
+
* **폴더로 보는 화면의 자리** — 지금 어느 폴더 안에 있나, 찾는 중인가, 새 폴더는 어디에 서나(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다).
|
|
6
|
+
*
|
|
7
|
+
* 말귀의 나의 단어표 · 나의 단어훈련 · 나의 문장훈련이 이 규칙을 한 벌씩 들고 있다가 앱에서 한 벌로 모았고, 코어 `FolderHead` 식구로 옮겼다.
|
|
8
|
+
* 화면마다 같아야 하는 규칙이다:
|
|
9
|
+
*
|
|
10
|
+
* · **목록에 없는 폴더는 안 연 것으로 친다** — 들어가 있던 폴더를 지웠거나 보기(갈래)를 바꿔 그 폴더가 없으면 맨 위로 돌아온다.
|
|
11
|
+
* · **찾는 중에는 폴더를 가리지 않는다** — 그때 새 폴더는 맨 위에 선다(길이 안 보이는데 안 보이는 폴더 안에 만들면 안 된다).
|
|
12
|
+
* · 폴더를 열면 **첫 쪽으로** 돌아간다(`onOpen`) — 3쪽을 보다가 폴더에 들어가면 그 폴더의 3쪽(대개 빈 화면)이 선다.
|
|
13
|
+
* · 들어가 있던 폴더가 옮겨지거나 이름이 바뀌면 **그 새 길로 따라간다** — 안 따라가면 맨 위로 튕긴다.
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export function useFolderBrowse({ paths, search, onOpen }) {
|
|
17
|
+
const [pick, setPick] = useState(null);
|
|
18
|
+
const opened = pick && paths.includes(pick) ? pick : null;
|
|
19
|
+
const searching = search.trim() !== '';
|
|
20
|
+
const open = useCallback((path) => { setPick(path); onOpen?.(); }, [onOpen]);
|
|
21
|
+
/** 폴더 `from` 이 `into` 안으로 옮겨졌다 — 그 안에 들어가 있었으면 새 길로 따라간다 */
|
|
22
|
+
const followMove = useCallback((from, into) => {
|
|
23
|
+
setPick(now => folderMoved(now, from, into) ?? now);
|
|
24
|
+
}, []);
|
|
25
|
+
/** 폴더 `from` 의 길이 `to` 로 바뀌었다(이름 바꾸기) — 그 안에 들어가 있었으면 새 길로 따라간다 */
|
|
26
|
+
const followRename = useCallback((from, to) => {
|
|
27
|
+
setPick(now => (now === from ? to : now?.startsWith(`${from}/`) ? to + now.slice(from.length) : now));
|
|
28
|
+
}, []);
|
|
29
|
+
/** 맨 위로 — 보기(갈래)를 바꿀 때 */
|
|
30
|
+
const reset = useCallback(() => setPick(null), []);
|
|
31
|
+
/** 새 폴더가 설 자리 — 찾는 중에는 맨 위 */
|
|
32
|
+
const newFolderParent = searching ? null : opened;
|
|
33
|
+
return {
|
|
34
|
+
opened, searching, open, reset, followMove, followRename, newFolderParent,
|
|
35
|
+
/** 새 폴더가 설 자리에 이미 있는 이름들 — 같은 이름을 또 못 짓게 견준다 */
|
|
36
|
+
siblingNames: folderChildren(paths, newFolderParent).map(folderLeaf),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -33,3 +33,5 @@ export type { UseAnchoredMenuOptions, UseAnchoredMenuResult } from './hooks/useA
|
|
|
33
33
|
export { useSoundCompassExam } from './hooks/useSoundCompassExam';
|
|
34
34
|
export type { SoundCompassMode, SoundCompassPhase, SoundCompassExam, UseSoundCompassExamOptions } from './hooks/useSoundCompassExam';
|
|
35
35
|
export { useInlineSvg } from './hooks/useInlineSvg';
|
|
36
|
+
export * from './hooks/useFolderBrowse';
|
|
37
|
+
export * from './hooks/useCardDragToGroup';
|
|
@@ -37,3 +37,6 @@ export { useAnchoredMenu } from './hooks/useAnchoredMenu';
|
|
|
37
37
|
export { useSoundCompassExam } from './hooks/useSoundCompassExam';
|
|
38
38
|
/* SVG 글자를 얻는다 — 속에 넣어 칠하려는 쪽이 쓴다(`BrandLogo` 의 `textColor`). */
|
|
39
39
|
export { useInlineSvg } from './hooks/useInlineSvg';
|
|
40
|
+
/* 폴더 화면(말귀 청 (437) ㉮, 2026-11-13) — 지금 연 폴더 · 카드를 끌어 폴더에 놓기 */
|
|
41
|
+
export * from './hooks/useFolderBrowse';
|
|
42
|
+
export * from './hooks/useCardDragToGroup';
|
|
@@ -1111,6 +1111,16 @@
|
|
|
1111
1111
|
"breadcrumb": {
|
|
1112
1112
|
"ariaLabel": "Breadcrumb"
|
|
1113
1113
|
},
|
|
1114
|
+
"folder": {
|
|
1115
|
+
"list": "Folders",
|
|
1116
|
+
"open_one": "Open folder {{name}}, {{count}} item",
|
|
1117
|
+
"open_other": "Open folder {{name}}, {{count}} items",
|
|
1118
|
+
"menu": "{{name}} folder menu",
|
|
1119
|
+
"placeMenu": "{{name}} menu",
|
|
1120
|
+
"tree": "Show folder structure",
|
|
1121
|
+
"fold": "Collapse {{name}}",
|
|
1122
|
+
"unfold": "Expand {{name}}"
|
|
1123
|
+
},
|
|
1114
1124
|
"board": {
|
|
1115
1125
|
"empty": "No items yet."
|
|
1116
1126
|
},
|
|
@@ -1094,6 +1094,15 @@
|
|
|
1094
1094
|
"breadcrumb": {
|
|
1095
1095
|
"ariaLabel": "이동 경로"
|
|
1096
1096
|
},
|
|
1097
|
+
"folder": {
|
|
1098
|
+
"list": "폴더",
|
|
1099
|
+
"open": "{{name}} 폴더 열기, {{count}}개",
|
|
1100
|
+
"menu": "{{name}} 폴더 메뉴",
|
|
1101
|
+
"placeMenu": "{{name}} 메뉴",
|
|
1102
|
+
"tree": "폴더 구조 보기",
|
|
1103
|
+
"fold": "{{name}} 접기",
|
|
1104
|
+
"unfold": "{{name}} 펼치기"
|
|
1105
|
+
},
|
|
1097
1106
|
"board": {
|
|
1098
1107
|
"empty": "등록된 항목이 없습니다."
|
|
1099
1108
|
},
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **폴더 메뉴의 줄** — 길의 「이름 ▾」 와 폴더 칸의 ⋯ 가 여는 메뉴(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
|
|
3
|
+
*
|
|
4
|
+
* 화면마다 차례와 아이콘이 갈리면 안 되는 자리다: **더하기 → 폴더 추가 → (이름 바꾸기) → 폴더 삭제**. 구분선은 없고, 줄을 고르면 닫힌다.
|
|
5
|
+
* 이름표는 부르는 쪽이 준다(무엇을 '더하는지' 는 화면마다 다르다 — 단어표 · 훈련 …).
|
|
6
|
+
* · 맨 위의 메뉴는 `rename` · `remove` 를 안 준다(지울 폴더가 없다).
|
|
7
|
+
* · 이름 바꾸기는 그 일이 있는 화면만 준다.
|
|
8
|
+
* 돌려준 줄은 `FolderHead` 의 `folderMenu` · `rootMenu`, `FolderGrid` 의 `menuItems` 에 그대로 넘긴다.
|
|
9
|
+
*/
|
|
10
|
+
/** @public 메뉴 한 줄 — 이름표와 할 일 */
|
|
11
|
+
export interface FolderMenuLine {
|
|
12
|
+
label: string;
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
}
|
|
15
|
+
/** @public 폴더 메뉴의 줄을 정해진 차례 · 아이콘으로 짓는다 */
|
|
16
|
+
export declare function folderMenuItems(lines: {
|
|
17
|
+
/** 이 자리에 하나 더 만든다(무엇을 만드는지는 화면 몫) */
|
|
18
|
+
add: FolderMenuLine;
|
|
19
|
+
addFolder: FolderMenuLine;
|
|
20
|
+
rename?: FolderMenuLine;
|
|
21
|
+
remove?: FolderMenuLine;
|
|
22
|
+
}): {
|
|
23
|
+
label: string;
|
|
24
|
+
icon: string;
|
|
25
|
+
onClick: () => void;
|
|
26
|
+
closeOnSelect: true;
|
|
27
|
+
}[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **폴더 메뉴의 줄** — 길의 「이름 ▾」 와 폴더 칸의 ⋯ 가 여는 메뉴(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
|
|
3
|
+
*
|
|
4
|
+
* 화면마다 차례와 아이콘이 갈리면 안 되는 자리다: **더하기 → 폴더 추가 → (이름 바꾸기) → 폴더 삭제**. 구분선은 없고, 줄을 고르면 닫힌다.
|
|
5
|
+
* 이름표는 부르는 쪽이 준다(무엇을 '더하는지' 는 화면마다 다르다 — 단어표 · 훈련 …).
|
|
6
|
+
* · 맨 위의 메뉴는 `rename` · `remove` 를 안 준다(지울 폴더가 없다).
|
|
7
|
+
* · 이름 바꾸기는 그 일이 있는 화면만 준다.
|
|
8
|
+
* 돌려준 줄은 `FolderHead` 의 `folderMenu` · `rootMenu`, `FolderGrid` 의 `menuItems` 에 그대로 넘긴다.
|
|
9
|
+
*/
|
|
10
|
+
/** @public 폴더 메뉴의 줄을 정해진 차례 · 아이콘으로 짓는다 */
|
|
11
|
+
export function folderMenuItems(lines) {
|
|
12
|
+
const row = (line, icon) => ({ ...line, icon, closeOnSelect: true });
|
|
13
|
+
return [
|
|
14
|
+
row(lines.add, 'plus'),
|
|
15
|
+
row(lines.addFolder, 'folder-plus'),
|
|
16
|
+
...(lines.rename ? [row(lines.rename, 'edit-2')] : []),
|
|
17
|
+
...(lines.remove ? [row(lines.remove, 'trash-2')] : []),
|
|
18
|
+
];
|
|
19
|
+
}
|