@vuer-ai/vuer-uikit 0.0.47 → 0.0.49
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/dist/{chunk-IMIHCOOE.js → chunk-2FCKLHWA.js} +1 -1
- package/dist/chunk-53PX4SCN.js +61 -0
- package/dist/{chunk-UZFOWGVD.mjs → chunk-5CWWM4L7.mjs} +9 -2
- package/dist/chunk-7NHWT7CO.mjs +26 -0
- package/dist/{chunk-5VYIGLGB.mjs → chunk-AJKD26TR.mjs} +1 -1
- package/dist/{chunk-NSN3O6CZ.mjs → chunk-AQENEOV3.mjs} +2 -2
- package/dist/{chunk-NKNUMZJL.mjs → chunk-DDG2W6BX.mjs} +36 -27
- package/dist/{chunk-KDRYDUQT.js → chunk-DWK23X7J.js} +1 -0
- package/dist/{chunk-R3SHGA4V.js → chunk-EOTROHFU.js} +36 -27
- package/dist/chunk-GCIH5IMQ.mjs +118 -0
- package/dist/chunk-HOQHWWLY.mjs +37 -0
- package/dist/{chunk-AKBWNVRH.js → chunk-HYVF2TGW.js} +2 -2
- package/dist/{chunk-QQMHPZFI.js → chunk-JIRSHP3D.js} +9 -2
- package/dist/chunk-KYWKRMXK.js +48 -0
- package/dist/chunk-N6DZ364I.mjs +15 -0
- package/dist/chunk-NXTGTCPA.mjs +19 -0
- package/dist/{chunk-3WAI7WDK.mjs → chunk-PDXJXH4A.mjs} +1 -1
- package/dist/chunk-PF36CKO7.mjs +599 -0
- package/dist/{chunk-I5UCKLLT.mjs → chunk-PZ3FWTMB.mjs} +1 -1
- package/dist/chunk-QPQSH53G.js +17 -0
- package/dist/chunk-VAEPAW5L.js +126 -0
- package/dist/{chunk-M3S7NSGR.mjs → chunk-VSFCQCKQ.mjs} +2 -2
- package/dist/{chunk-YGSTPCLB.mjs → chunk-VSYSYSVQ.mjs} +47 -31
- package/dist/{chunk-BGXUSJT2.js → chunk-WEHNW5KY.js} +2 -2
- package/dist/{chunk-HE63LZKF.js → chunk-XBKQWS7J.js} +3 -3
- package/dist/chunk-YFPY5SLS.js +41 -0
- package/dist/{chunk-VEUXQSY3.js → chunk-YNKO5FOU.js} +47 -31
- package/dist/chunk-YOKGP5F7.js +624 -0
- package/dist/highlight-cursor/cursor-provider.js +2 -2
- package/dist/highlight-cursor/cursor-provider.mjs +1 -1
- package/dist/highlight-cursor/enhanced-components.d.mts +3 -3
- package/dist/highlight-cursor/enhanced-components.d.ts +3 -3
- package/dist/highlight-cursor/enhanced-components.js +10 -10
- package/dist/highlight-cursor/enhanced-components.mjs +5 -5
- package/dist/highlight-cursor/index.d.mts +3 -3
- package/dist/highlight-cursor/index.d.ts +3 -3
- package/dist/highlight-cursor/index.js +12 -12
- package/dist/highlight-cursor/index.mjs +6 -6
- package/dist/hooks/index.js +7 -7
- package/dist/hooks/index.mjs +2 -2
- package/dist/hooks/use-mobile.d.mts +3 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +10 -0
- package/dist/hooks/use-mobile.mjs +1 -0
- package/dist/hooks/useDragSelect.js +2 -2
- package/dist/hooks/useDragSelect.mjs +1 -1
- package/dist/index.d.mts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +285 -139
- package/dist/index.mjs +28 -22
- package/dist/ui/avatar.js +2 -2
- package/dist/ui/avatar.mjs +2 -2
- package/dist/ui/badge.d.mts +2 -2
- package/dist/ui/badge.d.ts +2 -2
- package/dist/ui/badge.js +2 -2
- package/dist/ui/badge.mjs +2 -2
- package/dist/ui/button.d.mts +2 -2
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/button.js +8 -4
- package/dist/ui/button.mjs +3 -3
- package/dist/ui/card.js +2 -2
- package/dist/ui/card.mjs +2 -2
- package/dist/ui/checkbox.js +2 -2
- package/dist/ui/checkbox.mjs +2 -2
- package/dist/ui/collapsible.js +2 -2
- package/dist/ui/collapsible.mjs +2 -2
- package/dist/ui/drawer.js +2 -2
- package/dist/ui/drawer.mjs +2 -2
- package/dist/ui/dropdown.js +2 -2
- package/dist/ui/dropdown.mjs +2 -2
- package/dist/ui/form/CmInput.js +2 -2
- package/dist/ui/form/CmInput.mjs +2 -2
- package/dist/ui/form/DegInput.js +2 -2
- package/dist/ui/form/DegInput.mjs +2 -2
- package/dist/ui/form/EulerDegInput.js +2 -2
- package/dist/ui/form/EulerDegInput.mjs +2 -2
- package/dist/ui/form/EulerInput.js +2 -2
- package/dist/ui/form/EulerInput.mjs +2 -2
- package/dist/ui/form/EulerRadInput.js +2 -2
- package/dist/ui/form/EulerRadInput.mjs +2 -2
- package/dist/ui/form/InchInput.js +2 -2
- package/dist/ui/form/InchInput.mjs +2 -2
- package/dist/ui/form/IntInput.js +2 -2
- package/dist/ui/form/IntInput.mjs +2 -2
- package/dist/ui/form/KVectorInput.js +2 -2
- package/dist/ui/form/KVectorInput.mjs +2 -2
- package/dist/ui/form/NumberInput.js +2 -2
- package/dist/ui/form/NumberInput.mjs +2 -2
- package/dist/ui/form/QuaternionInput.js +2 -2
- package/dist/ui/form/QuaternionInput.mjs +2 -2
- package/dist/ui/form/RadInput.js +2 -2
- package/dist/ui/form/RadInput.mjs +2 -2
- package/dist/ui/form/TimeInput.js +2 -2
- package/dist/ui/form/TimeInput.mjs +2 -2
- package/dist/ui/form/Vec3Input.js +2 -2
- package/dist/ui/form/Vec3Input.mjs +2 -2
- package/dist/ui/form/VectorInput.js +2 -2
- package/dist/ui/form/VectorInput.mjs +2 -2
- package/dist/ui/form/index.js +17 -17
- package/dist/ui/form/index.mjs +5 -5
- package/dist/ui/index.d.mts +9 -3
- package/dist/ui/index.d.ts +9 -3
- package/dist/ui/index.js +270 -124
- package/dist/ui/index.mjs +26 -20
- package/dist/ui/input-numbers.js +2 -2
- package/dist/ui/input-numbers.mjs +2 -2
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/input.d.ts +1 -1
- package/dist/ui/input.js +2 -2
- package/dist/ui/input.mjs +2 -2
- package/dist/ui/layout.js +2 -2
- package/dist/ui/layout.mjs +2 -2
- package/dist/ui/modal.js +2 -2
- package/dist/ui/modal.mjs +2 -2
- package/dist/ui/pagination.d.mts +18 -0
- package/dist/ui/pagination.d.ts +18 -0
- package/dist/ui/pagination.js +43 -0
- package/dist/ui/pagination.mjs +10 -0
- package/dist/ui/popover.js +2 -2
- package/dist/ui/popover.mjs +2 -2
- package/dist/ui/radio-group.js +2 -2
- package/dist/ui/radio-group.mjs +2 -2
- package/dist/ui/resizable.d.mts +14 -0
- package/dist/ui/resizable.d.ts +14 -0
- package/dist/ui/resizable.js +25 -0
- package/dist/ui/resizable.mjs +8 -0
- package/dist/ui/select.d.mts +1 -1
- package/dist/ui/select.d.ts +1 -1
- package/dist/ui/select.js +2 -2
- package/dist/ui/select.mjs +2 -2
- package/dist/ui/separator.d.mts +7 -0
- package/dist/ui/separator.d.ts +7 -0
- package/dist/ui/separator.js +17 -0
- package/dist/ui/separator.mjs +8 -0
- package/dist/ui/sheet.js +2 -2
- package/dist/ui/sheet.mjs +2 -2
- package/dist/ui/sidebar.d.mts +75 -0
- package/dist/ui/sidebar.d.ts +75 -0
- package/dist/ui/sidebar.js +116 -0
- package/dist/ui/sidebar.mjs +15 -0
- package/dist/ui/skeleton.d.mts +6 -0
- package/dist/ui/skeleton.d.ts +6 -0
- package/dist/ui/skeleton.js +17 -0
- package/dist/ui/skeleton.mjs +8 -0
- package/dist/ui/slider.js +2 -2
- package/dist/ui/slider.mjs +2 -2
- package/dist/ui/switch.js +2 -2
- package/dist/ui/switch.mjs +2 -2
- package/dist/ui/tabs.js +2 -2
- package/dist/ui/tabs.mjs +2 -2
- package/dist/ui/textarea.js +2 -2
- package/dist/ui/textarea.mjs +2 -2
- package/dist/ui/timeline.js +5 -5
- package/dist/ui/timeline.mjs +4 -4
- package/dist/ui/toggle-group.js +2 -2
- package/dist/ui/toggle-group.mjs +2 -2
- package/dist/ui/toggle.js +2 -2
- package/dist/ui/toggle.mjs +2 -2
- package/dist/ui/tooltip.js +2 -2
- package/dist/ui/tooltip.mjs +2 -2
- package/dist/ui/tree-view-v2.d.mts +5 -1
- package/dist/ui/tree-view-v2.d.ts +5 -1
- package/dist/ui/tree-view-v2.js +4 -4
- package/dist/ui/tree-view-v2.mjs +3 -3
- package/dist/ui/tree-view.js +4 -4
- package/dist/ui/tree-view.mjs +3 -3
- package/dist/ui/version-badge.js +4 -4
- package/dist/ui/version-badge.mjs +3 -3
- package/package.json +2 -1
- package/src/hooks/useDragSelect.ts +12 -2
- package/src/ui/index.ts +1 -0
- package/src/ui/resizable.tsx +50 -0
- package/src/ui/sidebar.tsx +13 -13
- package/src/ui/tree-view-v2.tsx +47 -22
- /package/dist/{chunk-YQKZSWI6.js → chunk-GLGYNU3Q.js} +0 -0
- /package/dist/{chunk-4IXZRYYD.mjs → chunk-ZFWQLAQA.mjs} +0 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkDWK23X7J_js = require('./chunk-DWK23X7J.js');
|
|
4
|
+
var chunk7KYAICHB_js = require('./chunk-7KYAICHB.js');
|
|
5
|
+
var chunkOTPUWWEB_js = require('./chunk-OTPUWWEB.js');
|
|
6
|
+
var lucideReact = require('lucide-react');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
function Pagination({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11
|
+
"nav",
|
|
12
|
+
{
|
|
13
|
+
role: "navigation",
|
|
14
|
+
"aria-label": "pagination",
|
|
15
|
+
"data-slot": "pagination",
|
|
16
|
+
className: chunk7KYAICHB_js.cn("mx-auto flex w-full justify-center", className),
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function PaginationContent({ className, ...props }) {
|
|
22
|
+
const { setCursorTarget } = chunkOTPUWWEB_js.useTabsCursor();
|
|
23
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkOTPUWWEB_js.TabsCursorProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
24
|
+
"ul",
|
|
25
|
+
{
|
|
26
|
+
onMouseLeave: () => setCursorTarget(null),
|
|
27
|
+
"data-slot": "pagination-content",
|
|
28
|
+
className: chunk7KYAICHB_js.cn("gap-xs flex flex-row items-center", className),
|
|
29
|
+
style: {
|
|
30
|
+
marginBottom: "0px"
|
|
31
|
+
},
|
|
32
|
+
...props
|
|
33
|
+
}
|
|
34
|
+
) });
|
|
35
|
+
}
|
|
36
|
+
function PaginationItem({ ...props }) {
|
|
37
|
+
const { setCursorTarget } = chunkOTPUWWEB_js.useTabsCursor();
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
"li",
|
|
40
|
+
{
|
|
41
|
+
onMouseEnter: (e) => setCursorTarget(e.currentTarget),
|
|
42
|
+
"data-slot": "pagination-item",
|
|
43
|
+
className: "rounded-uk-sm",
|
|
44
|
+
style: {
|
|
45
|
+
marginBottom: "0px"
|
|
46
|
+
},
|
|
47
|
+
...props
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function PaginationLink({
|
|
52
|
+
className,
|
|
53
|
+
isActive,
|
|
54
|
+
...props
|
|
55
|
+
}) {
|
|
56
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
57
|
+
"a",
|
|
58
|
+
{
|
|
59
|
+
"aria-current": isActive ? "page" : void 0,
|
|
60
|
+
"data-slot": "pagination-link",
|
|
61
|
+
"data-active": isActive,
|
|
62
|
+
className: chunk7KYAICHB_js.cn(
|
|
63
|
+
chunkDWK23X7J_js.buttonVariants({
|
|
64
|
+
variant: isActive ? "secondary" : "ghost"
|
|
65
|
+
}),
|
|
66
|
+
"hover:bg-transparent",
|
|
67
|
+
"hover:text-text-primary",
|
|
68
|
+
className
|
|
69
|
+
),
|
|
70
|
+
...props
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
function PaginationPrevious({ className, ...props }) {
|
|
75
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
76
|
+
PaginationLink,
|
|
77
|
+
{
|
|
78
|
+
"aria-label": "Go to previous page",
|
|
79
|
+
size: "base",
|
|
80
|
+
className: chunk7KYAICHB_js.cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
81
|
+
...props,
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, {}),
|
|
84
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:block", children: "Previous" })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function PaginationNext({ className, ...props }) {
|
|
90
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
91
|
+
PaginationLink,
|
|
92
|
+
{
|
|
93
|
+
"aria-label": "Go to next page",
|
|
94
|
+
size: "base",
|
|
95
|
+
className: chunk7KYAICHB_js.cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
96
|
+
...props,
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:block", children: "Next" }),
|
|
99
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, {})
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function PaginationEllipsis({ className, ...props }) {
|
|
105
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
106
|
+
"span",
|
|
107
|
+
{
|
|
108
|
+
"aria-hidden": true,
|
|
109
|
+
"data-slot": "pagination-ellipsis",
|
|
110
|
+
className: chunk7KYAICHB_js.cn("text-text-primary flex size-9 items-center justify-center", className),
|
|
111
|
+
...props,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontalIcon, { className: "size-4" }),
|
|
114
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More pages" })
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
exports.Pagination = Pagination;
|
|
121
|
+
exports.PaginationContent = PaginationContent;
|
|
122
|
+
exports.PaginationEllipsis = PaginationEllipsis;
|
|
123
|
+
exports.PaginationItem = PaginationItem;
|
|
124
|
+
exports.PaginationLink = PaginationLink;
|
|
125
|
+
exports.PaginationNext = PaginationNext;
|
|
126
|
+
exports.PaginationPrevious = PaginationPrevious;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SelectTrigger } from './chunk-TZLILQLV.mjs';
|
|
2
1
|
import { Tabs } from './chunk-EXM36UYZ.mjs';
|
|
3
2
|
import { Textarea } from './chunk-MWJQTO2F.mjs';
|
|
3
|
+
import { SelectTrigger } from './chunk-TZLILQLV.mjs';
|
|
4
4
|
import { InputRoot } from './chunk-INX2EB5H.mjs';
|
|
5
|
-
import { Button } from './chunk-
|
|
5
|
+
import { Button } from './chunk-PZ3FWTMB.mjs';
|
|
6
6
|
import { withCursor } from './chunk-44KW6PTD.mjs';
|
|
7
7
|
|
|
8
8
|
// src/highlight-cursor/enhanced-components.tsx
|
|
@@ -10,7 +10,10 @@ function TreeView({
|
|
|
10
10
|
onVisibleDataChange,
|
|
11
11
|
onItemHover,
|
|
12
12
|
className,
|
|
13
|
-
hoveredId
|
|
13
|
+
hoveredId,
|
|
14
|
+
isSelectable = false,
|
|
15
|
+
selectedItemId,
|
|
16
|
+
onSelectChange
|
|
14
17
|
}) {
|
|
15
18
|
const [expandedItems, setExpandedItems] = useState(() => {
|
|
16
19
|
const initial = /* @__PURE__ */ new Set();
|
|
@@ -34,6 +37,11 @@ function TreeView({
|
|
|
34
37
|
return newSet;
|
|
35
38
|
});
|
|
36
39
|
};
|
|
40
|
+
const handleItemSelect = (id) => {
|
|
41
|
+
if (isSelectable && onSelectChange) {
|
|
42
|
+
onSelectChange(selectedItemId === id ? null : id);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
37
45
|
const childrenMap = useMemo(() => {
|
|
38
46
|
const map = /* @__PURE__ */ new Map();
|
|
39
47
|
data.forEach((item) => {
|
|
@@ -176,10 +184,12 @@ function TreeView({
|
|
|
176
184
|
{
|
|
177
185
|
className: cn(
|
|
178
186
|
"group relative flex h-[32px] cursor-pointer items-center",
|
|
179
|
-
hoveredId === item.id && "bg-bg-secondary/80"
|
|
187
|
+
hoveredId === item.id && "bg-bg-secondary/80",
|
|
188
|
+
isSelectable && selectedItemId === item.id && "bg-brand-primary"
|
|
180
189
|
),
|
|
181
190
|
onMouseEnter: () => onItemHover == null ? void 0 : onItemHover(item.id),
|
|
182
191
|
onMouseLeave: () => onItemHover == null ? void 0 : onItemHover(null),
|
|
192
|
+
onClick: () => handleItemSelect(item.id),
|
|
183
193
|
children: [
|
|
184
194
|
/* @__PURE__ */ jsxs("div", { className: "absolute top-0 left-[-0.28rem] z-0 flex h-full items-center", children: [
|
|
185
195
|
item.ancestors.map((ancestor, index) => {
|
|
@@ -214,38 +224,44 @@ function TreeView({
|
|
|
214
224
|
/* @__PURE__ */ jsxs(
|
|
215
225
|
"div",
|
|
216
226
|
{
|
|
217
|
-
className: "text-uk-md z-10 flex w-full items-center
|
|
227
|
+
className: "text-uk-md z-10 flex w-full items-center justify-between px-2 whitespace-nowrap",
|
|
218
228
|
style: { paddingLeft: `${item.indent * 1.25 + 0.5}rem` },
|
|
219
229
|
children: [
|
|
220
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
230
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
231
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex size-4 items-center justify-center", children: [
|
|
232
|
+
item.isCollapsible && /* @__PURE__ */ jsx(
|
|
233
|
+
"button",
|
|
234
|
+
{
|
|
235
|
+
onClick: (e) => {
|
|
236
|
+
e.stopPropagation();
|
|
237
|
+
toggleItem(item.id);
|
|
238
|
+
},
|
|
239
|
+
className: "absolute z-20 flex cursor-pointer items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",
|
|
240
|
+
children: /* @__PURE__ */ jsx(
|
|
241
|
+
ChevronDown,
|
|
242
|
+
{
|
|
243
|
+
className: cn(
|
|
244
|
+
"size-4 transition-transform",
|
|
245
|
+
!expandedItems.has(item.id) && "-rotate-90"
|
|
246
|
+
)
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
/* @__PURE__ */ jsx(
|
|
252
|
+
"div",
|
|
253
|
+
{
|
|
254
|
+
className: cn(
|
|
255
|
+
"cursor-pointer transition-opacity",
|
|
256
|
+
item.isCollapsible && "group-hover:opacity-0"
|
|
257
|
+
),
|
|
258
|
+
children: getIcon(item)
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
] }),
|
|
262
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: renderLabel(item.label) })
|
|
247
263
|
] }),
|
|
248
|
-
/* @__PURE__ */ jsx("
|
|
264
|
+
item.actions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", onClick: (e) => e.stopPropagation(), children: item.actions })
|
|
249
265
|
]
|
|
250
266
|
}
|
|
251
267
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYNKO5FOU_js = require('./chunk-YNKO5FOU.js');
|
|
4
4
|
var chunkER6XHUS7_js = require('./chunk-ER6XHUS7.js');
|
|
5
5
|
var chunk7KYAICHB_js = require('./chunk-7KYAICHB.js');
|
|
6
6
|
var lucideReact = require('lucide-react');
|
|
@@ -510,7 +510,7 @@ function Timeline({
|
|
|
510
510
|
}, [viewStart, viewDuration, updateCursor]);
|
|
511
511
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-bg-primary text-text-primary border-line-secondary/20 rounded-uk-md mx-auto w-full max-w-7xl overflow-hidden border font-sans shadow-[0_4px_16px_0_var(--color-shadow-secondary)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-[minmax(300px,30%)_1fr]", children: [
|
|
512
512
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
513
|
-
|
|
513
|
+
chunkYNKO5FOU_js.TreeView,
|
|
514
514
|
{
|
|
515
515
|
data,
|
|
516
516
|
getIcon,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var chunkCZBGKVGH_js = require('./chunk-CZBGKVGH.js');
|
|
4
3
|
var chunkW3AIC7FW_js = require('./chunk-W3AIC7FW.js');
|
|
5
4
|
var chunkKCA5PXNO_js = require('./chunk-KCA5PXNO.js');
|
|
5
|
+
var chunkCZBGKVGH_js = require('./chunk-CZBGKVGH.js');
|
|
6
6
|
var chunk3YODEBOY_js = require('./chunk-3YODEBOY.js');
|
|
7
|
-
var
|
|
7
|
+
var chunkDWK23X7J_js = require('./chunk-DWK23X7J.js');
|
|
8
8
|
var chunkUFHMEEGL_js = require('./chunk-UFHMEEGL.js');
|
|
9
9
|
|
|
10
10
|
// src/highlight-cursor/enhanced-components.tsx
|
|
11
|
-
var CursorButton = chunkUFHMEEGL_js.withCursor(
|
|
11
|
+
var CursorButton = chunkUFHMEEGL_js.withCursor(chunkDWK23X7J_js.Button);
|
|
12
12
|
var CursorTabs = chunkUFHMEEGL_js.withCursor(chunkW3AIC7FW_js.Tabs);
|
|
13
13
|
var CursorInputRoot = chunkUFHMEEGL_js.withCursor(chunk3YODEBOY_js.InputRoot);
|
|
14
14
|
var CursorSelectTrigger = chunkUFHMEEGL_js.withCursor(chunkCZBGKVGH_js.SelectTrigger);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function _interopNamespace(e) {
|
|
6
|
+
if (e && e.__esModule) return e;
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
24
|
+
|
|
25
|
+
// src/hooks/use-mobile.ts
|
|
26
|
+
var MOBILE_BREAKPOINT = 768;
|
|
27
|
+
function useIsMobile() {
|
|
28
|
+
const [isMobile, setIsMobile] = React__namespace.useState(void 0);
|
|
29
|
+
React__namespace.useEffect(() => {
|
|
30
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
31
|
+
const onChange = () => {
|
|
32
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
33
|
+
};
|
|
34
|
+
mql.addEventListener("change", onChange);
|
|
35
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
36
|
+
return () => mql.removeEventListener("change", onChange);
|
|
37
|
+
}, []);
|
|
38
|
+
return !!isMobile;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
exports.useIsMobile = useIsMobile;
|
|
@@ -12,7 +12,10 @@ function TreeView({
|
|
|
12
12
|
onVisibleDataChange,
|
|
13
13
|
onItemHover,
|
|
14
14
|
className,
|
|
15
|
-
hoveredId
|
|
15
|
+
hoveredId,
|
|
16
|
+
isSelectable = false,
|
|
17
|
+
selectedItemId,
|
|
18
|
+
onSelectChange
|
|
16
19
|
}) {
|
|
17
20
|
const [expandedItems, setExpandedItems] = react.useState(() => {
|
|
18
21
|
const initial = /* @__PURE__ */ new Set();
|
|
@@ -36,6 +39,11 @@ function TreeView({
|
|
|
36
39
|
return newSet;
|
|
37
40
|
});
|
|
38
41
|
};
|
|
42
|
+
const handleItemSelect = (id) => {
|
|
43
|
+
if (isSelectable && onSelectChange) {
|
|
44
|
+
onSelectChange(selectedItemId === id ? null : id);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
39
47
|
const childrenMap = react.useMemo(() => {
|
|
40
48
|
const map = /* @__PURE__ */ new Map();
|
|
41
49
|
data.forEach((item) => {
|
|
@@ -178,10 +186,12 @@ function TreeView({
|
|
|
178
186
|
{
|
|
179
187
|
className: chunk7KYAICHB_js.cn(
|
|
180
188
|
"group relative flex h-[32px] cursor-pointer items-center",
|
|
181
|
-
hoveredId === item.id && "bg-bg-secondary/80"
|
|
189
|
+
hoveredId === item.id && "bg-bg-secondary/80",
|
|
190
|
+
isSelectable && selectedItemId === item.id && "bg-brand-primary"
|
|
182
191
|
),
|
|
183
192
|
onMouseEnter: () => onItemHover == null ? void 0 : onItemHover(item.id),
|
|
184
193
|
onMouseLeave: () => onItemHover == null ? void 0 : onItemHover(null),
|
|
194
|
+
onClick: () => handleItemSelect(item.id),
|
|
185
195
|
children: [
|
|
186
196
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute top-0 left-[-0.28rem] z-0 flex h-full items-center", children: [
|
|
187
197
|
item.ancestors.map((ancestor, index) => {
|
|
@@ -216,38 +226,44 @@ function TreeView({
|
|
|
216
226
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
217
227
|
"div",
|
|
218
228
|
{
|
|
219
|
-
className: "text-uk-md z-10 flex w-full items-center
|
|
229
|
+
className: "text-uk-md z-10 flex w-full items-center justify-between px-2 whitespace-nowrap",
|
|
220
230
|
style: { paddingLeft: `${item.indent * 1.25 + 0.5}rem` },
|
|
221
231
|
children: [
|
|
222
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
232
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
233
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex size-4 items-center justify-center", children: [
|
|
234
|
+
item.isCollapsible && /* @__PURE__ */ jsxRuntime.jsx(
|
|
235
|
+
"button",
|
|
236
|
+
{
|
|
237
|
+
onClick: (e) => {
|
|
238
|
+
e.stopPropagation();
|
|
239
|
+
toggleItem(item.id);
|
|
240
|
+
},
|
|
241
|
+
className: "absolute z-20 flex cursor-pointer items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",
|
|
242
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
243
|
+
lucideReact.ChevronDown,
|
|
244
|
+
{
|
|
245
|
+
className: chunk7KYAICHB_js.cn(
|
|
246
|
+
"size-4 transition-transform",
|
|
247
|
+
!expandedItems.has(item.id) && "-rotate-90"
|
|
248
|
+
)
|
|
249
|
+
}
|
|
250
|
+
)
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
254
|
+
"div",
|
|
255
|
+
{
|
|
256
|
+
className: chunk7KYAICHB_js.cn(
|
|
257
|
+
"cursor-pointer transition-opacity",
|
|
258
|
+
item.isCollapsible && "group-hover:opacity-0"
|
|
259
|
+
),
|
|
260
|
+
children: getIcon(item)
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
] }),
|
|
264
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: renderLabel(item.label) })
|
|
249
265
|
] }),
|
|
250
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
266
|
+
item.actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", onClick: (e) => e.stopPropagation(), children: item.actions })
|
|
251
267
|
]
|
|
252
268
|
}
|
|
253
269
|
)
|