@alepha/devtools 0.14.1 → 0.14.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/assets/devtools/{asset.Bhpm0ujk.css → asset.DbJSgVPr.css} +1 -1
- package/assets/devtools/chunk.B3_W5FaN.js +1 -0
- package/assets/devtools/chunk.BBrq-Wwo.js +7 -0
- package/assets/devtools/chunk.BC4Lys4j.js +1 -0
- package/assets/devtools/chunk.BNC0DJB8.js +1 -0
- package/assets/devtools/chunk.BOc4btAA.js +2 -0
- package/assets/devtools/chunk.BPjMdorr.js +1 -0
- package/assets/devtools/chunk.Bdi_dTor.js +1 -0
- package/assets/devtools/chunk.BeYM7pih.js +1 -0
- package/assets/devtools/{chunk.aHk99chr.js → chunk.BjjA59Pf.js} +1 -1
- package/assets/devtools/{chunk.BkBlh2Dt.js → chunk.ByuRJbSC.js} +1 -1
- package/assets/devtools/chunk.C1yl87Yo.js +1 -0
- package/assets/devtools/chunk.C5K_AIru.js +1 -0
- package/assets/devtools/chunk.C6NWzsJg.js +1 -0
- package/assets/devtools/chunk.CAWWjC4E.js +1 -0
- package/assets/devtools/chunk.CQ8PqHT0.js +1 -0
- package/assets/devtools/{chunk.CaVuq3Op.js → chunk.CYVZxO-p.js} +1 -1
- package/assets/devtools/{chunk.XGXwPH1e.js → chunk.ChDpavl2.js} +1 -1
- package/assets/devtools/chunk.DAVfKvCa.js +2 -0
- package/assets/devtools/chunk.DF8tZYh8.js +1 -0
- package/assets/devtools/{chunk.DPzX4t8Q.js → chunk.DI-f4xNk.js} +1 -1
- package/assets/devtools/{chunk.uTsm7un3.js → chunk.DLDchrhP.js} +1 -1
- package/assets/devtools/{chunk.Djkuv-DD.js → chunk.DN-SKgAD.js} +1 -1
- package/assets/devtools/{chunk.BVciOoK-.js → chunk.DcaVw31J.js} +1 -1
- package/assets/devtools/chunk.Dwv4A_H_.js +1 -0
- package/assets/devtools/chunk.DxjqPOcc.js +1 -0
- package/assets/devtools/{chunk.Duwrcaca.js → chunk.I1TSx4X4.js} +1 -1
- package/assets/devtools/chunk.INuuLdYd.js +1 -0
- package/assets/devtools/chunk.PWK2K2kI.js +1 -0
- package/assets/devtools/chunk.UAANdYnt.js +1 -0
- package/assets/devtools/chunk.XsVAJU_N.js +9 -0
- package/assets/devtools/chunk.iyc5GsVj.js +1 -0
- package/assets/devtools/chunk.mJxmm31y.js +1 -0
- package/assets/devtools/chunk.ospt8-RN.js +1 -0
- package/assets/devtools/entry.DBfTnVUe.js +75 -0
- package/assets/devtools/index.html +2 -2
- package/dist/index.d.ts +29 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/__tests__/DevCollectorProvider.spec.ts +7 -0
- package/src/api/providers/DevToolsDatabaseProvider.ts +16 -0
- package/src/ui/AppRouter.tsx +1 -1
- package/src/ui/components/DevAtomsViewer.tsx +2 -1
- package/src/ui/components/DevDashboard.tsx +13 -163
- package/src/ui/components/DevLayout.tsx +23 -48
- package/src/ui/components/DevTopicsViewer.tsx +3 -7
- package/src/ui/components/graph/DevDependencyGraph.tsx +123 -104
- package/src/ui/components/graph/GraphControls.tsx +31 -25
- package/src/ui/main.ts +8 -2
- package/assets/devtools/chunk.0pKzkQ-k.js +0 -1
- package/assets/devtools/chunk.B5eTVHku.js +0 -1
- package/assets/devtools/chunk.B9h7IAR1.js +0 -1
- package/assets/devtools/chunk.BChtaeaz.js +0 -1
- package/assets/devtools/chunk.BLm9NSIJ.js +0 -9
- package/assets/devtools/chunk.BRzkf5AB.js +0 -2
- package/assets/devtools/chunk.BiYuhEvJ.js +0 -1
- package/assets/devtools/chunk.BmVQcEyT.js +0 -1
- package/assets/devtools/chunk.ByjndBdY.js +0 -6
- package/assets/devtools/chunk.C8MW3asi.js +0 -1
- package/assets/devtools/chunk.CLYiSTOf.js +0 -1
- package/assets/devtools/chunk.CioNo4ZJ.js +0 -1
- package/assets/devtools/chunk.CjoaeVq1.js +0 -7
- package/assets/devtools/chunk.Ct5753mG.js +0 -1
- package/assets/devtools/chunk.D4sT5zWZ.js +0 -1
- package/assets/devtools/chunk.Ddpv5E_O.js +0 -1
- package/assets/devtools/chunk.DtstekP0.js +0 -1
- package/assets/devtools/chunk.R7-m7OZO.js +0 -1
- package/assets/devtools/chunk.VgeujX8m.js +0 -2
- package/assets/devtools/chunk.VjygskIP.js +0 -1
- package/assets/devtools/chunk.W1p_0xSo.js +0 -1
- package/assets/devtools/chunk.arBxf8N4.js +0 -1
- package/assets/devtools/chunk.bYKDU_ru.js +0 -1
- package/assets/devtools/chunk.cMS5bixD.js +0 -1
- package/assets/devtools/chunk.e1Pq7Nwk.js +0 -1
- package/assets/devtools/entry.Cjxjbqvs.js +0 -75
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
ActionButton,
|
|
4
|
-
AdminShell,
|
|
5
|
-
DarkModeButton,
|
|
6
|
-
OmnibarButton,
|
|
7
|
-
ui,
|
|
8
|
-
} from "@alepha/ui";
|
|
1
|
+
import { AdminShell, DarkModeButton, OmnibarButton, ui } from "@alepha/ui";
|
|
9
2
|
import { Flex } from "@mantine/core";
|
|
10
3
|
import {
|
|
11
4
|
IconApi,
|
|
@@ -16,7 +9,6 @@ import {
|
|
|
16
9
|
IconLogs,
|
|
17
10
|
IconMessageCircle,
|
|
18
11
|
IconStack2,
|
|
19
|
-
IconTools,
|
|
20
12
|
IconTopologyRing,
|
|
21
13
|
IconVariable,
|
|
22
14
|
} from "@tabler/icons-react";
|
|
@@ -24,23 +16,16 @@ import {
|
|
|
24
16
|
export const DevLayout = () => {
|
|
25
17
|
return (
|
|
26
18
|
<AdminShell
|
|
27
|
-
|
|
28
|
-
withBorder: false,
|
|
19
|
+
appShellHeaderProps={{
|
|
29
20
|
bg: ui.colors.background,
|
|
30
21
|
}}
|
|
31
22
|
appShellNavbarProps={{
|
|
32
|
-
bg:
|
|
33
|
-
}}
|
|
34
|
-
appShellHeaderProps={{
|
|
35
|
-
bg: ui.colors.transparent,
|
|
36
|
-
style: {
|
|
37
|
-
backdropFilter: "blur(10px)",
|
|
38
|
-
},
|
|
23
|
+
bg: "transparent",
|
|
39
24
|
}}
|
|
40
25
|
sidebarProps={{
|
|
41
|
-
gap:
|
|
26
|
+
gap: 4,
|
|
42
27
|
collapsed: true,
|
|
43
|
-
|
|
28
|
+
items: [
|
|
44
29
|
{
|
|
45
30
|
label: "Dashboard",
|
|
46
31
|
icon: <IconDashboard />,
|
|
@@ -102,19 +87,26 @@ export const DevLayout = () => {
|
|
|
102
87
|
{
|
|
103
88
|
position: "left",
|
|
104
89
|
element: (
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
90
|
+
<Flex
|
|
91
|
+
h={"60px"}
|
|
92
|
+
w={"78px"}
|
|
93
|
+
style={{
|
|
94
|
+
marginLeft: "-32px",
|
|
95
|
+
borderRight: "1px solid var(--mantine-color-default-border)",
|
|
96
|
+
}}
|
|
97
|
+
/>
|
|
113
98
|
),
|
|
114
99
|
},
|
|
115
100
|
{
|
|
116
|
-
position: "
|
|
117
|
-
element:
|
|
101
|
+
position: "left",
|
|
102
|
+
element: (
|
|
103
|
+
<OmnibarButton
|
|
104
|
+
actionProps={{
|
|
105
|
+
variant: "outline",
|
|
106
|
+
bd: "1px solid var(--mantine-color-default-border)",
|
|
107
|
+
}}
|
|
108
|
+
/>
|
|
109
|
+
),
|
|
118
110
|
},
|
|
119
111
|
{
|
|
120
112
|
position: "right",
|
|
@@ -122,24 +114,7 @@ export const DevLayout = () => {
|
|
|
122
114
|
},
|
|
123
115
|
],
|
|
124
116
|
}}
|
|
125
|
-
|
|
126
|
-
<Flex
|
|
127
|
-
className={"overflow-auto"}
|
|
128
|
-
w={"100%"}
|
|
129
|
-
flex={1}
|
|
130
|
-
direction={"column"}
|
|
131
|
-
bd={`1px solid ${ui.colors.border}`}
|
|
132
|
-
bg={ui.colors.elevated}
|
|
133
|
-
ml={-16}
|
|
134
|
-
mr={-16}
|
|
135
|
-
mt={-16}
|
|
136
|
-
style={{
|
|
137
|
-
borderTopLeftRadius: 16,
|
|
138
|
-
}}
|
|
139
|
-
>
|
|
140
|
-
<NestedView />
|
|
141
|
-
</Flex>
|
|
142
|
-
</AdminShell>
|
|
117
|
+
/>
|
|
143
118
|
);
|
|
144
119
|
};
|
|
145
120
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useInject } from "@alepha/react";
|
|
2
|
-
import {
|
|
2
|
+
import { ui } from "@alepha/ui";
|
|
3
|
+
import { JsonViewer } from "@alepha/ui/json";
|
|
3
4
|
import {
|
|
4
5
|
ActionIcon,
|
|
5
6
|
Badge,
|
|
@@ -434,12 +435,7 @@ const MessagesTab = ({ topic }: { topic: DevTopicMetadata }) => {
|
|
|
434
435
|
borderRadius: 4,
|
|
435
436
|
}}
|
|
436
437
|
>
|
|
437
|
-
<JsonViewer
|
|
438
|
-
data={msg.payload}
|
|
439
|
-
maxDepth={3}
|
|
440
|
-
size="xs"
|
|
441
|
-
copyable={false}
|
|
442
|
-
/>
|
|
438
|
+
<JsonViewer data={msg.payload} maxDepth={3} size="xs" />
|
|
443
439
|
</Box>
|
|
444
440
|
</Box>
|
|
445
441
|
))}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { useInject } from "@alepha/react";
|
|
2
|
-
import { ui } from "@alepha/ui";
|
|
1
|
+
import { useAction, useInject } from "@alepha/react";
|
|
2
|
+
import { ui, useDialog } from "@alepha/ui";
|
|
3
3
|
import {
|
|
4
4
|
ActionIcon,
|
|
5
5
|
Alert,
|
|
6
6
|
Badge,
|
|
7
|
-
Box,
|
|
8
7
|
Flex,
|
|
9
8
|
Group,
|
|
10
9
|
Loader,
|
|
@@ -35,7 +34,6 @@ import "@xyflow/react/dist/style.css";
|
|
|
35
34
|
import { HttpClient } from "alepha/server";
|
|
36
35
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
37
36
|
import { devMetadataSchema } from "../../../api/schemas/DevMetadata.ts";
|
|
38
|
-
import type { DevProviderMetadata } from "../../../api/schemas/DevProviderMetadata.ts";
|
|
39
37
|
import { getModuleColor } from "./constants.ts";
|
|
40
38
|
import { GraphControls } from "./GraphControls.tsx";
|
|
41
39
|
import {
|
|
@@ -58,60 +56,8 @@ const nodeTypes = {
|
|
|
58
56
|
provider: ProviderNode,
|
|
59
57
|
};
|
|
60
58
|
|
|
61
|
-
const FlowControls = () => {
|
|
62
|
-
const { zoomIn, zoomOut, fitView } = useReactFlow();
|
|
63
|
-
const [isLocked, setIsLocked] = useState(false);
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<Stack
|
|
67
|
-
gap={4}
|
|
68
|
-
style={{
|
|
69
|
-
position: "absolute",
|
|
70
|
-
bottom: 16,
|
|
71
|
-
left: 16,
|
|
72
|
-
zIndex: 10,
|
|
73
|
-
backgroundColor: ui.colors.elevated,
|
|
74
|
-
border: `1px solid ${ui.colors.border}`,
|
|
75
|
-
borderRadius: 8,
|
|
76
|
-
padding: 4,
|
|
77
|
-
}}
|
|
78
|
-
>
|
|
79
|
-
<Tooltip label="Zoom in" position="right">
|
|
80
|
-
<ActionIcon size="sm" variant="subtle" onClick={() => zoomIn()}>
|
|
81
|
-
<IconPlus size={14} />
|
|
82
|
-
</ActionIcon>
|
|
83
|
-
</Tooltip>
|
|
84
|
-
<Tooltip label="Zoom out" position="right">
|
|
85
|
-
<ActionIcon size="sm" variant="subtle" onClick={() => zoomOut()}>
|
|
86
|
-
<IconMinus size={14} />
|
|
87
|
-
</ActionIcon>
|
|
88
|
-
</Tooltip>
|
|
89
|
-
<Tooltip label="Fit view" position="right">
|
|
90
|
-
<ActionIcon
|
|
91
|
-
size="sm"
|
|
92
|
-
variant="subtle"
|
|
93
|
-
onClick={() => fitView({ padding: 0.2 })}
|
|
94
|
-
>
|
|
95
|
-
<IconFocusCentered size={14} />
|
|
96
|
-
</ActionIcon>
|
|
97
|
-
</Tooltip>
|
|
98
|
-
<Tooltip label={isLocked ? "Unlock" : "Lock"} position="right">
|
|
99
|
-
<ActionIcon
|
|
100
|
-
size="sm"
|
|
101
|
-
variant="subtle"
|
|
102
|
-
onClick={() => setIsLocked(!isLocked)}
|
|
103
|
-
>
|
|
104
|
-
{isLocked ? <IconLock size={14} /> : <IconLockOpen size={14} />}
|
|
105
|
-
</ActionIcon>
|
|
106
|
-
</Tooltip>
|
|
107
|
-
</Stack>
|
|
108
|
-
);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
59
|
export const DevDependencyGraph = () => {
|
|
112
60
|
const http = useInject(HttpClient);
|
|
113
|
-
const [providers, setProviders] = useState<DevProviderMetadata[]>([]);
|
|
114
|
-
const [loading, setLoading] = useState(true);
|
|
115
61
|
const [nodes, setNodes, onNodesChange] = useNodesState<ProviderNodeType>([]);
|
|
116
62
|
const [edges, setEdges, onEdgesChange] = useEdgesState<ProviderEdge>([]);
|
|
117
63
|
const [selectedNode, setSelectedNode] = useState<{
|
|
@@ -126,17 +72,18 @@ export const DevDependencyGraph = () => {
|
|
|
126
72
|
viewMode: "modules",
|
|
127
73
|
});
|
|
128
74
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
75
|
+
const { loading, result } = useAction(
|
|
76
|
+
{
|
|
77
|
+
runOnInit: true,
|
|
78
|
+
handler: () =>
|
|
79
|
+
http.fetch("/devtools/api/metadata", {
|
|
80
|
+
schema: { response: devMetadataSchema },
|
|
81
|
+
}),
|
|
82
|
+
},
|
|
83
|
+
[],
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const providers = result?.data.providers || [];
|
|
140
87
|
|
|
141
88
|
// Get unique modules
|
|
142
89
|
const modules = useMemo(() => {
|
|
@@ -246,6 +193,8 @@ export const DevDependencyGraph = () => {
|
|
|
246
193
|
[nodes, handleNodeClick],
|
|
247
194
|
);
|
|
248
195
|
|
|
196
|
+
const dialog = useDialog();
|
|
197
|
+
|
|
249
198
|
// Export as PNG
|
|
250
199
|
const handleExport = useCallback(() => {
|
|
251
200
|
// Get the react-flow viewport element
|
|
@@ -253,7 +202,10 @@ export const DevDependencyGraph = () => {
|
|
|
253
202
|
if (!viewport) return;
|
|
254
203
|
|
|
255
204
|
// Use html2canvas or similar - for now just alert
|
|
256
|
-
alert(
|
|
205
|
+
return dialog.alert({
|
|
206
|
+
title: "Export",
|
|
207
|
+
message: "Export feature requires html2canvas library. Coming soon!",
|
|
208
|
+
});
|
|
257
209
|
}, []);
|
|
258
210
|
|
|
259
211
|
if (loading) {
|
|
@@ -265,9 +217,15 @@ export const DevDependencyGraph = () => {
|
|
|
265
217
|
}
|
|
266
218
|
|
|
267
219
|
return (
|
|
268
|
-
<Flex direction="column" gap="md" w="100%" h="100%">
|
|
220
|
+
<Flex p="xl" direction="column" gap="md" w="100%" h="100%" flex={1} mih={0}>
|
|
269
221
|
<Group justify="space-between" wrap="nowrap">
|
|
270
222
|
<Group gap="sm">
|
|
223
|
+
<Flex
|
|
224
|
+
bdrs={"sm"}
|
|
225
|
+
h={"20px"}
|
|
226
|
+
w={"4px"}
|
|
227
|
+
bg={"var(--mantine-primary-color-filled)"}
|
|
228
|
+
/>
|
|
271
229
|
<IconTopologyRing size={24} opacity={0.7} />
|
|
272
230
|
<Text size="lg" fw={500}>
|
|
273
231
|
Dependency Graph
|
|
@@ -309,50 +267,111 @@ export const DevDependencyGraph = () => {
|
|
|
309
267
|
</Alert>
|
|
310
268
|
)}
|
|
311
269
|
|
|
312
|
-
<
|
|
270
|
+
<Flex
|
|
271
|
+
flex={1}
|
|
272
|
+
h={"100%"}
|
|
313
273
|
style={{
|
|
314
|
-
flex: 1,
|
|
315
274
|
borderRadius: 8,
|
|
316
275
|
border: `1px solid ${ui.colors.border}`,
|
|
317
|
-
overflow: "hidden",
|
|
318
276
|
position: "relative",
|
|
319
277
|
}}
|
|
320
278
|
>
|
|
321
|
-
<
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
279
|
+
<Flex
|
|
280
|
+
h={"100%"}
|
|
281
|
+
style={{
|
|
282
|
+
position: "absolute",
|
|
283
|
+
top: 0,
|
|
284
|
+
left: 0,
|
|
285
|
+
right: 0,
|
|
286
|
+
bottom: 0,
|
|
287
|
+
}}
|
|
288
|
+
>
|
|
289
|
+
<ReactFlowProvider>
|
|
290
|
+
<ReactFlow
|
|
291
|
+
nodes={nodes}
|
|
292
|
+
edges={edges}
|
|
293
|
+
onNodesChange={onNodesChange}
|
|
294
|
+
onEdgesChange={onEdgesChange}
|
|
295
|
+
onNodeClick={handleNodeClick as any}
|
|
296
|
+
onPaneClick={handlePaneClick}
|
|
297
|
+
nodeTypes={nodeTypes as any}
|
|
298
|
+
fitView
|
|
299
|
+
fitViewOptions={{ padding: 0.2 }}
|
|
300
|
+
minZoom={0.1}
|
|
301
|
+
maxZoom={2}
|
|
302
|
+
proOptions={{ hideAttribution: true }}
|
|
303
|
+
>
|
|
304
|
+
<Background variant={BackgroundVariant.Dots} gap={20} size={1} />
|
|
305
|
+
<MiniMap
|
|
306
|
+
nodeColor={(node) =>
|
|
307
|
+
getModuleColor((node.data as ProviderNodeData)?.module)
|
|
308
|
+
}
|
|
309
|
+
maskColor="rgba(0, 0, 0, 0.5)"
|
|
310
|
+
style={{ backgroundColor: ui.colors.surface }}
|
|
311
|
+
/>
|
|
312
|
+
<FlowControls />
|
|
313
|
+
</ReactFlow>
|
|
314
|
+
</ReactFlowProvider>
|
|
347
315
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
316
|
+
<NodeDetails
|
|
317
|
+
node={selectedNode}
|
|
318
|
+
onClose={() => handlePaneClick()}
|
|
319
|
+
onNodeClick={handleDetailsNodeClick}
|
|
320
|
+
/>
|
|
321
|
+
</Flex>
|
|
322
|
+
</Flex>
|
|
354
323
|
</Flex>
|
|
355
324
|
);
|
|
356
325
|
};
|
|
357
326
|
|
|
358
327
|
export default DevDependencyGraph;
|
|
328
|
+
|
|
329
|
+
const FlowControls = () => {
|
|
330
|
+
const { zoomIn, zoomOut, fitView } = useReactFlow();
|
|
331
|
+
const [isLocked, setIsLocked] = useState(false);
|
|
332
|
+
|
|
333
|
+
return (
|
|
334
|
+
<Stack
|
|
335
|
+
gap={4}
|
|
336
|
+
style={{
|
|
337
|
+
position: "absolute",
|
|
338
|
+
bottom: 16,
|
|
339
|
+
left: 16,
|
|
340
|
+
zIndex: 10,
|
|
341
|
+
backgroundColor: ui.colors.elevated,
|
|
342
|
+
border: `1px solid ${ui.colors.border}`,
|
|
343
|
+
borderRadius: 8,
|
|
344
|
+
padding: 4,
|
|
345
|
+
}}
|
|
346
|
+
>
|
|
347
|
+
<Tooltip label="Zoom in" position="right">
|
|
348
|
+
<ActionIcon size="sm" variant="subtle" onClick={() => zoomIn()}>
|
|
349
|
+
<IconPlus size={14} />
|
|
350
|
+
</ActionIcon>
|
|
351
|
+
</Tooltip>
|
|
352
|
+
<Tooltip label="Zoom out" position="right">
|
|
353
|
+
<ActionIcon size="sm" variant="subtle" onClick={() => zoomOut()}>
|
|
354
|
+
<IconMinus size={14} />
|
|
355
|
+
</ActionIcon>
|
|
356
|
+
</Tooltip>
|
|
357
|
+
<Tooltip label="Fit view" position="right">
|
|
358
|
+
<ActionIcon
|
|
359
|
+
size="sm"
|
|
360
|
+
variant="subtle"
|
|
361
|
+
onClick={() => fitView({ padding: 0.2 })}
|
|
362
|
+
>
|
|
363
|
+
<IconFocusCentered size={14} />
|
|
364
|
+
</ActionIcon>
|
|
365
|
+
</Tooltip>
|
|
366
|
+
<Tooltip label={isLocked ? "Unlock" : "Lock"} position="right">
|
|
367
|
+
<ActionIcon
|
|
368
|
+
size="sm"
|
|
369
|
+
variant="subtle"
|
|
370
|
+
onClick={() => setIsLocked(!isLocked)}
|
|
371
|
+
>
|
|
372
|
+
{isLocked ? <IconLock size={14} /> : <IconLockOpen size={14} />}
|
|
373
|
+
</ActionIcon>
|
|
374
|
+
</Tooltip>
|
|
375
|
+
</Stack>
|
|
376
|
+
);
|
|
377
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ui } from "@alepha/ui";
|
|
1
2
|
import {
|
|
2
3
|
ActionIcon,
|
|
3
4
|
Badge,
|
|
@@ -45,31 +46,36 @@ export const GraphControls = ({
|
|
|
45
46
|
|
|
46
47
|
return (
|
|
47
48
|
<Flex gap="sm" wrap="wrap" align="center">
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
49
|
+
<Flex>
|
|
50
|
+
<SegmentedControl
|
|
51
|
+
size="xs"
|
|
52
|
+
value={filters.viewMode}
|
|
53
|
+
onChange={(value) =>
|
|
54
|
+
onFiltersChange({ ...filters, viewMode: value as ViewMode })
|
|
55
|
+
}
|
|
56
|
+
data={[
|
|
57
|
+
{
|
|
58
|
+
label: (
|
|
59
|
+
<Tooltip label="Modules">
|
|
60
|
+
<IconBoxMultiple
|
|
61
|
+
size={ui.sizes.icon.sm}
|
|
62
|
+
style={{ marginTop: 2 }}
|
|
63
|
+
/>
|
|
64
|
+
</Tooltip>
|
|
65
|
+
),
|
|
66
|
+
value: "modules",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: (
|
|
70
|
+
<Tooltip label="Services">
|
|
71
|
+
<IconBox size={ui.sizes.icon.sm} style={{ marginTop: 2 }} />
|
|
72
|
+
</Tooltip>
|
|
73
|
+
),
|
|
74
|
+
value: "providers",
|
|
75
|
+
},
|
|
76
|
+
]}
|
|
77
|
+
/>
|
|
78
|
+
</Flex>
|
|
73
79
|
|
|
74
80
|
<TextInput
|
|
75
81
|
placeholder={isModuleView ? "Search modules..." : "Search services..."}
|
package/src/ui/main.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { alephaThemeListAtom, midnightTheme } from "@alepha/ui";
|
|
2
|
+
import { Alepha, run } from "alepha";
|
|
2
3
|
import { AppRouter } from "./AppRouter.tsx";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
const alepha = Alepha.create();
|
|
6
|
+
|
|
7
|
+
alepha.with(AppRouter);
|
|
8
|
+
alepha.set(alephaThemeListAtom, [midnightTheme]);
|
|
9
|
+
|
|
10
|
+
run(alepha);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{w as o}from"./entry.Cjxjbqvs.js";const l=[["path",{d:"M3 21h4l13 -13a1.5 1.5 0 0 0 -4 -4l-13 13v4",key:"svg-0"}],["path",{d:"M14.5 5.5l4 4",key:"svg-1"}],["path",{d:"M12 8l-5 -5l-4 4l5 5",key:"svg-2"}],["path",{d:"M7 8l-1.5 1.5",key:"svg-3"}],["path",{d:"M16 12l5 5l-4 4l-5 -5",key:"svg-4"}],["path",{d:"M16 17l-1.5 1.5",key:"svg-5"}]],e=o("outline","tools","Tools",l);export{e as I};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as b,b as x,q as f,s as g,j,B as N,v as R}from"./entry.Cjxjbqvs.js";var a={root:"m_b183c0a2"};const h=g((e,{color:s})=>({root:{"--code-bg":s?R(s,e):void 0}})),r=b((e,s)=>{const o=x("Code",null,e),{classNames:c,className:l,style:n,styles:m,unstyled:d,vars:p,color:B,block:t,variant:i,mod:v,attributes:u,...y}=o,C=f({name:"Code",props:o,classes:a,className:l,style:n,classNames:c,styles:m,unstyled:d,attributes:u,vars:p,varsResolver:h});return j.jsx(N,{component:t?"pre":"code",variant:i,ref:s,mod:[{block:t},v],...C("root"),...y,dir:"ltr"})});r.classes=a;r.displayName="@mantine/core/Code";export{r as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aD as h,g as d,j as i,I as q,i as w,k as p,b9 as v,f as C,b as P,q as V,aE as E,B}from"./entry.Cjxjbqvs.js";import{a as F}from"./chunk.BiYuhEvJ.js";function f(s){return typeof s=="object"&&s!==null?"base"in s?s.base:void 0:s}function I({spacing:s,verticalSpacing:o,cols:t,selector:m}){const a=w(),l=o===void 0?s:o,c=h({"--sg-spacing-x":d(f(s)),"--sg-spacing-y":d(f(l)),"--sg-cols":f(t)?.toString()}),u=p(a.breakpoints).reduce((e,n)=>(e[n]||(e[n]={}),typeof s=="object"&&s[n]!==void 0&&(e[n]["--sg-spacing-x"]=d(s[n])),typeof l=="object"&&l[n]!==void 0&&(e[n]["--sg-spacing-y"]=d(l[n])),typeof t=="object"&&t[n]!==void 0&&(e[n]["--sg-cols"]=t[n]),e),{}),r=F(p(u),a.breakpoints).filter(e=>p(u[e.value]).length>0).map(e=>({query:`(min-width: ${a.breakpoints[e.value]})`,styles:u[e.value]}));return i.jsx(q,{styles:c,media:r,selector:m})}function x(s){return typeof s=="object"&&s!==null?p(s):[]}function M(s){return s.sort((o,t)=>v(o)-v(t))}function R({spacing:s,verticalSpacing:o,cols:t}){const m=Array.from(new Set([...x(s),...x(o),...x(t)]));return M(m)}function A({spacing:s,verticalSpacing:o,cols:t,selector:m}){const a=o===void 0?s:o,l=h({"--sg-spacing-x":d(f(s)),"--sg-spacing-y":d(f(a)),"--sg-cols":f(t)?.toString()}),c=R({spacing:s,verticalSpacing:o,cols:t}),u=c.reduce((r,e)=>(r[e]||(r[e]={}),typeof s=="object"&&s[e]!==void 0&&(r[e]["--sg-spacing-x"]=d(s[e])),typeof a=="object"&&a[e]!==void 0&&(r[e]["--sg-spacing-y"]=d(a[e])),typeof t=="object"&&t[e]!==void 0&&(r[e]["--sg-cols"]=t[e]),r),{}),y=c.map(r=>({query:`simple-grid (min-width: ${r})`,styles:u[r]}));return i.jsx(q,{styles:l,container:y,selector:m})}var N={container:"m_925c2d2c",root:"m_2415a157"};const D={cols:1,spacing:"md",type:"media"},G=C((s,o)=>{const t=P("SimpleGrid",D,s),{classNames:m,className:a,style:l,styles:c,unstyled:u,vars:y,cols:r,verticalSpacing:e,spacing:n,type:_,attributes:$,...S}=t,j=V({name:"SimpleGrid",classes:N,props:t,className:a,style:l,classNames:m,styles:c,unstyled:u,attributes:$,vars:y}),g=E();return _==="container"?i.jsxs(i.Fragment,{children:[i.jsx(A,{...t,selector:`.${g}`}),i.jsx("div",{...j("container"),children:i.jsx(B,{ref:o,...j("root",{className:g}),...S})})]}):i.jsxs(i.Fragment,{children:[i.jsx(I,{...t,selector:`.${g}`}),i.jsx(B,{ref:o,...j("root",{className:g}),...S})]})});G.classes=N;G.displayName="@mantine/core/SimpleGrid";export{G as S,f as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m,f as E,b as A,q as se,s as re,j as i,B as L,v as ee,t as oe,c as Eo,aB as me,b7 as jo,b8 as Ue,ay as ge,bc as Po,$ as fe,a0 as te,aI as He,e as Ce,aw as Ro,U as To,a1 as we,b6 as qe,ai as We,aj as Ze,aG as $o,ac as Vo,d as Mo,av as Bo,a3 as Je,w as ye}from"./entry.Cjxjbqvs.js";import{I as zo,a as Fo,b as Lo}from"./chunk.C8MW3asi.js";import{P as he}from"./chunk.DtstekP0.js";function Go(e){const o=m.useRef(void 0);return m.useEffect(()=>{o.current=e},[e]),o.current}function be(e,o=document){const t=o.querySelector(e);if(t)return t;const s=o.querySelectorAll("*");for(let r=0;r<s.length;r+=1){const a=s[r];if(a.shadowRoot){const n=be(e,a.shadowRoot);if(n)return n}}return null}function U(e,o=document){const t=[],s=o.querySelectorAll(e);t.push(...Array.from(s));const r=o.querySelectorAll("*");for(let a=0;a<r.length;a+=1){const n=r[a];if(n.shadowRoot){const l=U(e,n.shadowRoot);t.push(...l)}}return t}function H(e){if(!e)return document;const o=e.getRootNode();return o instanceof ShadowRoot||o instanceof Document?o:document}function Qe(e){return typeof e=="string"?{value:e,label:e}:"value"in e&&!("label"in e)?{value:e.value,label:e.value,disabled:e.disabled}:typeof e=="number"?{value:e.toString(),label:e.toString()}:"group"in e?{group:e.group,items:e.items.map(o=>Qe(o))}:e}function Ko(e){return e?e.map(o=>Qe(o)):[]}function Xe(e){return e.reduce((o,t)=>"group"in t?{...o,...Xe(t.items)}:(o[t.value]=t,o),{})}var P={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2",optionsDropdownCheckPlaceholder:"m_a530ee0a"};const Ho={error:null},Uo=re((e,{size:o,color:t})=>({chevron:{"--combobox-chevron-size":oe(o,"combobox-chevron-size"),"--combobox-chevron-color":t?ee(t,e):void 0}})),ke=E((e,o)=>{const t=A("ComboboxChevron",Ho,e),{size:s,error:r,style:a,className:n,classNames:l,styles:c,unstyled:d,vars:p,mod:u,...b}=t,x=se({name:"ComboboxChevron",classes:P,props:t,style:a,className:n,classNames:l,styles:c,unstyled:d,vars:p,varsResolver:Uo,rootSelector:"chevron"});return i.jsx(L,{component:"svg",...b,...x("chevron"),size:s,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:r},u],ref:o,children:i.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});ke.classes=P;ke.displayName="@mantine/core/ComboboxChevron";const[qo,M]=Eo("Combobox component was not found in tree"),Ye=m.forwardRef(({size:e,onMouseDown:o,onClick:t,onClear:s,...r},a)=>i.jsx(me.ClearButton,{ref:a,tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:n=>{n.preventDefault(),o?.(n)},onClick:n=>{s(),t?.(n)}}));Ye.displayName="@mantine/core/ComboboxClearButton";const Se=E((e,o)=>{const{classNames:t,styles:s,className:r,style:a,hidden:n,...l}=A("ComboboxDropdown",null,e),c=M();return i.jsx(he.Dropdown,{...l,ref:o,role:"presentation","data-hidden":n||void 0,...c.getStyles("dropdown",{className:r,style:a,classNames:t,styles:s})})});Se.classes=P;Se.displayName="@mantine/core/ComboboxDropdown";const Wo={refProp:"ref"},eo=E((e,o)=>{const{children:t,refProp:s}=A("ComboboxDropdownTarget",Wo,e);if(M(),!jo(t))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return i.jsx(he.Target,{ref:o,refProp:s,children:t})});eo.displayName="@mantine/core/ComboboxDropdownTarget";const Oe=E((e,o)=>{const{classNames:t,className:s,style:r,styles:a,vars:n,...l}=A("ComboboxEmpty",null,e),c=M();return i.jsx(L,{ref:o,...c.getStyles("empty",{className:s,classNames:t,styles:a,style:r}),...l})});Oe.classes=P;Oe.displayName="@mantine/core/ComboboxEmpty";function De({onKeyDown:e,withKeyboardNavigation:o,withAriaAttributes:t,withExpandedAttribute:s,targetType:r,autoComplete:a}){const n=M(),[l,c]=m.useState(null),d=u=>{if(e?.(u),!n.readOnly&&o){if(u.nativeEvent.isComposing)return;if(u.nativeEvent.code==="ArrowDown"&&(u.preventDefault(),n.store.dropdownOpened?c(n.store.selectNextOption()):(n.store.openDropdown("keyboard"),c(n.store.selectActiveOption()),n.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),u.nativeEvent.code==="ArrowUp"&&(u.preventDefault(),n.store.dropdownOpened?c(n.store.selectPreviousOption()):(n.store.openDropdown("keyboard"),c(n.store.selectActiveOption()),n.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),u.nativeEvent.code==="Enter"||u.nativeEvent.code==="NumpadEnter"){if(u.nativeEvent.keyCode===229)return;const b=n.store.getSelectedOptionIndex();n.store.dropdownOpened&&b!==-1?(u.preventDefault(),n.store.clickSelectedOption()):r==="button"&&(u.preventDefault(),n.store.openDropdown("keyboard"))}u.key==="Escape"&&n.store.closeDropdown("keyboard"),u.nativeEvent.code==="Space"&&r==="button"&&(u.preventDefault(),n.store.toggleDropdown("keyboard"))}};return{...t?{"aria-haspopup":"listbox","aria-expanded":s?!!(n.store.listId&&n.store.dropdownOpened):void 0,"aria-controls":n.store.dropdownOpened&&n.store.listId?n.store.listId:void 0,"aria-activedescendant":n.store.dropdownOpened&&l||void 0,autoComplete:a,"data-expanded":n.store.dropdownOpened||void 0,"data-mantine-stop-propagation":n.store.dropdownOpened||void 0}:{},onKeyDown:d}}const Zo={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},oo=E((e,o)=>{const{children:t,refProp:s,withKeyboardNavigation:r,withAriaAttributes:a,withExpandedAttribute:n,targetType:l,autoComplete:c,...d}=A("ComboboxEventsTarget",Zo,e),p=Ue(t);if(!p)throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=M(),b=De({targetType:l,withAriaAttributes:a,withKeyboardNavigation:r,withExpandedAttribute:n,onKeyDown:p.props.onKeyDown,autoComplete:c});return m.cloneElement(p,{...b,...d,[s]:ge(o,u.store.targetRef,Po(p))})});oo.displayName="@mantine/core/ComboboxEventsTarget";const _e=E((e,o)=>{const{classNames:t,className:s,style:r,styles:a,vars:n,...l}=A("ComboboxFooter",null,e),c=M();return i.jsx(L,{ref:o,...c.getStyles("footer",{className:s,classNames:t,style:r,styles:a}),...l,onMouseDown:d=>{d.preventDefault()}})});_e.classes=P;_e.displayName="@mantine/core/ComboboxFooter";const Ne=E((e,o)=>{const{classNames:t,className:s,style:r,styles:a,vars:n,children:l,label:c,id:d,...p}=A("ComboboxGroup",null,e),u=M(),b=fe(d);return i.jsxs(L,{ref:o,role:"group","aria-labelledby":c?b:void 0,...u.getStyles("group",{className:s,classNames:t,style:r,styles:a}),...p,children:[c&&i.jsx("div",{id:b,...u.getStyles("groupLabel",{classNames:t,styles:a}),children:c}),l]})});Ne.classes=P;Ne.displayName="@mantine/core/ComboboxGroup";const Ie=E((e,o)=>{const{classNames:t,className:s,style:r,styles:a,vars:n,...l}=A("ComboboxHeader",null,e),c=M();return i.jsx(L,{ref:o,...c.getStyles("header",{className:s,classNames:t,style:r,styles:a}),...l,onMouseDown:d=>{d.preventDefault()}})});Ie.classes=P;Ie.displayName="@mantine/core/ComboboxHeader";function to({value:e,valuesDivider:o=",",...t}){return i.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(o):e||"",...t})}to.displayName="@mantine/core/ComboboxHiddenInput";const Ae=E((e,o)=>{const t=A("ComboboxOption",null,e),{classNames:s,className:r,style:a,styles:n,vars:l,onClick:c,id:d,active:p,onMouseDown:u,onMouseOver:b,disabled:x,selected:k,mod:g,...w}=t,S=M(),D=m.useId(),_=d||D;return i.jsx(L,{...S.getStyles("option",{className:r,classNames:s,styles:n,style:a}),...w,ref:o,id:_,mod:["combobox-option",{"combobox-active":p,"combobox-disabled":x,"combobox-selected":k},g],role:"option",onClick:h=>{x?h.preventDefault():(S.onOptionSubmit?.(t.value,t),c?.(h))},onMouseDown:h=>{h.preventDefault(),u?.(h)},onMouseOver:h=>{S.resetSelectionOnOptionHover&&S.store.resetSelectedOption(),b?.(h)}})});Ae.classes=P;Ae.displayName="@mantine/core/ComboboxOption";const Ee=E((e,o)=>{const t=A("ComboboxOptions",null,e),{classNames:s,className:r,style:a,styles:n,id:l,onMouseDown:c,labelledBy:d,...p}=t,u=M(),b=fe(l);return m.useEffect(()=>{u.store.setListId(b)},[b]),i.jsx(L,{ref:o,...u.getStyles("options",{className:r,style:a,classNames:s,styles:n}),...p,id:b,role:"listbox","aria-labelledby":d,onMouseDown:x=>{x.preventDefault(),c?.(x)}})});Ee.classes=P;Ee.displayName="@mantine/core/ComboboxOptions";const Jo={withAriaAttributes:!0,withKeyboardNavigation:!0},je=E((e,o)=>{const t=A("ComboboxSearch",Jo,e),{classNames:s,styles:r,unstyled:a,vars:n,withAriaAttributes:l,onKeyDown:c,withKeyboardNavigation:d,size:p,...u}=t,b=M(),x=b.getStyles("search"),k=De({targetType:"input",withAriaAttributes:l,withKeyboardNavigation:d,withExpandedAttribute:!1,onKeyDown:c,autoComplete:"off"});return i.jsx(me,{ref:ge(o,b.store.searchRef),classNames:[{input:x.className},s],styles:[{input:x.style},r],size:p||b.size,...k,...u,__staticSelector:"Combobox"})});je.classes=P;je.displayName="@mantine/core/ComboboxSearch";const Qo={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},no=E((e,o)=>{const{children:t,refProp:s,withKeyboardNavigation:r,withAriaAttributes:a,withExpandedAttribute:n,targetType:l,autoComplete:c,...d}=A("ComboboxTarget",Qo,e),p=Ue(t);if(!p)throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=M(),b=De({targetType:l,withAriaAttributes:a,withKeyboardNavigation:r,withExpandedAttribute:n,onKeyDown:p.props.onKeyDown,autoComplete:c}),x=m.cloneElement(p,{...b,...d});return i.jsx(he.Target,{ref:ge(o,u.store.targetRef),children:x})});no.displayName="@mantine/core/ComboboxTarget";function Xo(e,o,t){for(let s=e-1;s>=0;s-=1)if(!o[s].hasAttribute("data-combobox-disabled"))return s;if(t){for(let s=o.length-1;s>-1;s-=1)if(!o[s].hasAttribute("data-combobox-disabled"))return s}return e}function Yo(e,o,t){for(let s=e+1;s<o.length;s+=1)if(!o[s].hasAttribute("data-combobox-disabled"))return s;if(t){for(let s=0;s<o.length;s+=1)if(!o[s].hasAttribute("data-combobox-disabled"))return s}return e}function et(e){for(let o=0;o<e.length;o+=1)if(!e[o].hasAttribute("data-combobox-disabled"))return o;return-1}function so({defaultOpened:e,opened:o,onOpenedChange:t,onDropdownClose:s,onDropdownOpen:r,loop:a=!0,scrollBehavior:n="instant"}={}){const[l,c]=te({value:o,defaultValue:e,finalValue:!1,onChange:t}),d=m.useRef(null),p=m.useRef(-1),u=m.useRef(null),b=m.useRef(null),x=m.useRef(-1),k=m.useRef(-1),g=m.useRef(-1),w=m.useCallback((f="unknown")=>{l||(c(!0),r?.(f))},[c,r,l]),S=m.useCallback((f="unknown")=>{l&&(c(!1),s?.(f))},[c,s,l]),D=m.useCallback((f="unknown")=>{l?S(f):w(f)},[S,w,l]),_=m.useCallback(()=>{const f=H(b.current),O=be(`#${d.current} [data-combobox-selected]`,f);O?.removeAttribute("data-combobox-selected"),O?.removeAttribute("aria-selected")},[]),h=m.useCallback(f=>{const O=H(b.current),z=be(`#${d.current}`,O),N=z?U("[data-combobox-option]",z):null;if(!N)return null;const I=f>=N.length?0:f<0?N.length-1:f;return p.current=I,N?.[I]&&!N[I].hasAttribute("data-combobox-disabled")?(_(),N[I].setAttribute("data-combobox-selected","true"),N[I].setAttribute("aria-selected","true"),N[I].scrollIntoView({block:"nearest",behavior:n}),N[I].id):null},[n,_]),C=m.useCallback(()=>{const f=H(b.current),O=be(`#${d.current} [data-combobox-active]`,f);if(O){const N=U(`#${d.current} [data-combobox-option]`,f).findIndex(I=>I===O);return h(N)}return h(0)},[h]),j=m.useCallback(()=>{const f=H(b.current),O=U(`#${d.current} [data-combobox-option]`,f);return h(Yo(p.current,O,a))},[h,a]),R=m.useCallback(()=>{const f=H(b.current),O=U(`#${d.current} [data-combobox-option]`,f);return h(Xo(p.current,O,a))},[h,a]),ce=m.useCallback(()=>{const f=H(b.current),O=U(`#${d.current} [data-combobox-option]`,f);return h(et(O))},[h]),J=m.useCallback((f="selected",O)=>{g.current=window.setTimeout(()=>{const z=H(b.current),N=U(`#${d.current} [data-combobox-option]`,z),I=N.findIndex(Y=>Y.hasAttribute(`data-combobox-${f}`));p.current=I,O?.scrollIntoView&&N[I]?.scrollIntoView({block:"nearest",behavior:n})},0)},[]),le=m.useCallback(()=>{p.current=-1,_()},[_]),q=m.useCallback(()=>{const f=H(b.current);U(`#${d.current} [data-combobox-option]`,f)?.[p.current]?.click()},[]),B=m.useCallback(f=>{d.current=f},[]),Q=m.useCallback(()=>{x.current=window.setTimeout(()=>u.current?.focus(),0)},[]),K=m.useCallback(()=>{k.current=window.setTimeout(()=>b.current?.focus(),0)},[]),X=m.useCallback(()=>p.current,[]);return m.useEffect(()=>()=>{window.clearTimeout(x.current),window.clearTimeout(k.current),window.clearTimeout(g.current)},[]),{dropdownOpened:l,openDropdown:w,closeDropdown:S,toggleDropdown:D,selectedOptionIndex:p.current,getSelectedOptionIndex:X,selectOption:h,selectFirstOption:ce,selectActiveOption:C,selectNextOption:j,selectPreviousOption:R,resetSelectedOption:le,updateSelectedOptionIndex:J,listId:d.current,setListId:B,clickSelectedOption:q,searchRef:u,focusSearchInput:Q,targetRef:b,focusTarget:K}}const ot={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},tt=re((e,{size:o,dropdownPadding:t})=>({options:{"--combobox-option-fz":He(o),"--combobox-option-padding":oe(o,"combobox-option-padding")},dropdown:{"--combobox-padding":t===void 0?void 0:Ce(t),"--combobox-option-fz":He(o),"--combobox-option-padding":oe(o,"combobox-option-padding")}}));function v(e){const o=A("Combobox",ot,e),{classNames:t,styles:s,unstyled:r,children:a,store:n,vars:l,onOptionSubmit:c,onClose:d,size:p,dropdownPadding:u,resetSelectionOnOptionHover:b,__staticSelector:x,readOnly:k,attributes:g,...w}=o,S=so(),D=n||S,_=se({name:x||"Combobox",classes:P,props:o,classNames:t,styles:s,unstyled:r,attributes:g,vars:l,varsResolver:tt}),h=()=>{d?.(),D.closeDropdown()};return i.jsx(qo,{value:{getStyles:_,store:D,onOptionSubmit:c,size:p,resetSelectionOnOptionHover:b,readOnly:k},children:i.jsx(he,{opened:D.dropdownOpened,preventPositionChangeWhenVisible:!0,...w,onChange:C=>!C&&h(),withRoles:!1,unstyled:r,children:a})})}const nt=e=>e;v.extend=nt;v.classes=P;v.displayName="@mantine/core/Combobox";v.Target=no;v.Dropdown=Se;v.Options=Ee;v.Option=Ae;v.Search=je;v.Empty=Oe;v.Chevron=ke;v.Footer=_e;v.Header=Ie;v.EventsTarget=oo;v.DropdownTarget=eo;v.Group=Ne;v.ClearButton=Ye;v.HiddenInput=to;const ro=m.createContext(null),st=ro.Provider,ao=()=>m.useContext(ro),[rt,at]=Ro();var co={card:"m_26775b0a"};const ct={withBorder:!0},lt=re((e,{radius:o})=>({card:{"--card-radius":we(o)}})),Pe=E((e,o)=>{const t=A("CheckboxCard",ct,e),{classNames:s,className:r,style:a,styles:n,unstyled:l,vars:c,checked:d,mod:p,withBorder:u,value:b,onClick:x,defaultChecked:k,onChange:g,attributes:w,...S}=t,D=se({name:"CheckboxCard",classes:co,props:t,className:r,style:a,classNames:s,styles:n,unstyled:l,attributes:w,vars:c,varsResolver:lt,rootSelector:"card"}),_=ao(),h=typeof d=="boolean"?d:_?_.value.includes(b||""):void 0,[C,j]=te({value:h,defaultValue:k,finalValue:!1,onChange:g});return i.jsx(rt,{value:{checked:C},children:i.jsx(To,{ref:o,mod:[{"with-border":u,checked:C},p],...D("card"),...S,role:"checkbox","aria-checked":C,onClick:R=>{x?.(R),_?.onChange(b||""),j(!C)}})})});Pe.displayName="@mantine/core/CheckboxCard";Pe.classes=co;const Re=E((e,o)=>{const{value:t,defaultValue:s,onChange:r,size:a,wrapperProps:n,children:l,readOnly:c,disabled:d,...p}=A("CheckboxGroup",null,e),[u,b]=te({value:t,defaultValue:s,finalValue:[],onChange:r}),x=k=>{const g=typeof k=="string"?k:k.currentTarget.value;!c&&b(u.includes(g)?u.filter(w=>w!==g):[...u,g])};return i.jsx(st,{value:{value:u,onChange:x,size:a,disabled:d},children:i.jsx(me.Wrapper,{size:a,ref:o,...n,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:i.jsx(zo,{role:"group",children:l})})})});Re.classes=me.Wrapper.classes;Re.displayName="@mantine/core/CheckboxGroup";function lo({size:e,style:o,...t}){const s=e!==void 0?{width:Ce(e),height:Ce(e),...o}:o;return i.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:s,"aria-hidden":!0,...t,children:i.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function io({indeterminate:e,...o}){return e?i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...o,children:i.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):i.jsx(lo,{...o})}var uo={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const it={icon:io,variant:"filled"},dt=re((e,{radius:o,color:t,size:s,iconColor:r,variant:a,autoContrast:n})=>{const l=qe({color:t||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--checkbox-size":oe(s,"checkbox-size"),"--checkbox-radius":o===void 0?void 0:we(o),"--checkbox-color":a==="outline"?c:ee(t,e),"--checkbox-icon-color":r?ee(r,e):Ze(n,e)?We({color:t,theme:e,autoContrast:n}):void 0}}}),Te=E((e,o)=>{const t=A("CheckboxIndicator",it,e),{classNames:s,className:r,style:a,styles:n,unstyled:l,vars:c,icon:d,indeterminate:p,radius:u,color:b,iconColor:x,autoContrast:k,checked:g,mod:w,variant:S,disabled:D,attributes:_,...h}=t,C=se({name:"CheckboxIndicator",classes:uo,props:t,className:r,style:a,classNames:s,styles:n,unstyled:l,attributes:_,vars:c,varsResolver:dt,rootSelector:"indicator"}),j=at(),R=typeof g=="boolean"||typeof p=="boolean"?g||p:j?.checked||!1;return i.jsx(L,{ref:o,...C("indicator",{variant:S}),variant:S,mod:[{checked:R,disabled:D},w],...h,children:i.jsx(d,{indeterminate:p,...C("icon")})})});Te.displayName="@mantine/core/CheckboxIndicator";Te.classes=uo;var po={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const ut={labelPosition:"right",icon:io,variant:"filled"},pt=re((e,{radius:o,color:t,size:s,iconColor:r,variant:a,autoContrast:n})=>{const l=qe({color:t||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--checkbox-size":oe(s,"checkbox-size"),"--checkbox-radius":o===void 0?void 0:we(o),"--checkbox-color":a==="outline"?c:ee(t,e),"--checkbox-icon-color":r?ee(r,e):Ze(n,e)?We({color:t,theme:e,autoContrast:n}):void 0}}}),ae=E((e,o)=>{const t=A("Checkbox",ut,e),{classNames:s,className:r,style:a,styles:n,unstyled:l,vars:c,color:d,label:p,id:u,size:b,radius:x,wrapperProps:k,checked:g,labelPosition:w,description:S,error:D,disabled:_,variant:h,indeterminate:C,icon:j,rootRef:R,iconColor:ce,onChange:J,autoContrast:le,mod:q,attributes:B,...Q}=t,K=ao(),X=b||K?.size,f=se({name:"Checkbox",props:t,classes:po,className:r,style:a,classNames:s,styles:n,unstyled:l,attributes:B,vars:c,varsResolver:pt}),{styleProps:O,rest:z}=$o(Q),N=fe(u),I={checked:K?.value.includes(z.value)??g,onChange:ie=>{K?.onChange(ie),J?.(ie)},disabled:K?.disabled??_},Y=m.useRef(null),F=o||Y;return m.useEffect(()=>{F&&"current"in F&&F.current&&(F.current.indeterminate=C||!1,C?F.current.setAttribute("data-indeterminate","true"):F.current.removeAttribute("data-indeterminate"))},[C,F]),i.jsx(Fo,{...f("root"),__staticSelector:"Checkbox",__stylesApiProps:t,id:N,size:X,labelPosition:w,label:p,description:S,error:D,disabled:I.disabled,classNames:s,styles:n,unstyled:l,"data-checked":I.checked||g||void 0,variant:h,ref:R,mod:q,...O,...k,children:i.jsxs(L,{...f("inner"),mod:{"data-label-position":w},children:[i.jsx(L,{component:"input",id:N,ref:F,mod:{error:!!D},...f("input",{focusable:!0,variant:h}),...z,...I,type:"checkbox"}),i.jsx(j,{indeterminate:C,...f("icon")})]})})});ae.classes={...po,...Lo};ae.displayName="@mantine/core/Checkbox";ae.Group=Re;ae.Indicator=Te;ae.Card=Pe;function ne(e){return"group"in e}function bo({options:e,search:o,limit:t}){const s=o.trim().toLowerCase(),r=[];for(let a=0;a<e.length;a+=1){const n=e[a];if(r.length===t)return r;ne(n)&&r.push({group:n.group,items:bo({options:n.items,search:o,limit:t-r.length})}),ne(n)||n.label.toLowerCase().includes(s)&&r.push(n)}return r}function bt(e){if(e.length===0)return!0;for(const o of e)if(!("group"in o)||o.items.length>0)return!1;return!0}function mo(e,o=new Set){if(Array.isArray(e))for(const t of e)if(ne(t))mo(t.items,o);else{if(typeof t.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof t.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof t.value}`);if(o.has(t.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${t.value}" was provided more than once`);o.add(t.value)}}function mt(e,o){return Array.isArray(e)?e.includes(o):e===o}function fo({data:e,withCheckIcon:o,withAlignedLabels:t,value:s,checkIconPosition:r,unstyled:a,renderOption:n}){if(!ne(e)){const c=mt(s,e.value),d=o&&(c?i.jsx(lo,{className:P.optionsDropdownCheckIcon}):t?i.jsx("div",{className:P.optionsDropdownCheckPlaceholder}):null),p=i.jsxs(i.Fragment,{children:[r==="left"&&d,i.jsx("span",{children:e.label}),r==="right"&&d]});return i.jsx(v.Option,{value:e.value,disabled:e.disabled,className:Mo({[P.optionsDropdownOption]:!a}),"data-reverse":r==="right"||void 0,"data-checked":c||void 0,"aria-selected":c,active:c,children:typeof n=="function"?n({option:e,checked:c}):p})}const l=e.items.map(c=>i.jsx(fo,{data:c,value:s,unstyled:a,withCheckIcon:o,withAlignedLabels:t,checkIconPosition:r,renderOption:n},c.value));return i.jsx(v.Group,{label:e.group,children:l})}function ft({data:e,hidden:o,hiddenWhenEmpty:t,filter:s,search:r,limit:a,maxDropdownHeight:n,withScrollArea:l=!0,filterOptions:c=!0,withCheckIcon:d=!1,withAlignedLabels:p=!1,value:u,checkIconPosition:b,nothingFoundMessage:x,unstyled:k,labelId:g,renderOption:w,scrollAreaProps:S,"aria-label":D}){mo(e);const h=typeof r=="string"?(s||bo)({options:e,search:c?r:"",limit:a??1/0}):e,C=bt(h),j=h.map(R=>i.jsx(fo,{data:R,withCheckIcon:d,withAlignedLabels:p,value:u,checkIconPosition:b,unstyled:k,renderOption:w},ne(R)?R.group:R.value));return i.jsx(v.Dropdown,{hidden:o||t&&C,"data-composed":!0,children:i.jsxs(v.Options,{labelledBy:g,"aria-label":D,children:[l?i.jsx(Vo.Autosize,{mah:n??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...S,children:j}):j,C&&x&&i.jsx(v.Empty,{children:x})]})})}const ht={withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left"},ho=E((e,o)=>{const t=A("Select",ht,e),{classNames:s,styles:r,unstyled:a,vars:n,dropdownOpened:l,defaultDropdownOpened:c,onDropdownClose:d,onDropdownOpen:p,onFocus:u,onBlur:b,onClick:x,onChange:k,data:g,value:w,defaultValue:S,selectFirstOptionOnChange:D,onOptionSubmit:_,comboboxProps:h,readOnly:C,disabled:j,filter:R,limit:ce,withScrollArea:J,maxDropdownHeight:le,size:q,searchable:B,rightSection:Q,checkIconPosition:K,withCheckIcon:X,withAlignedLabels:f,nothingFoundMessage:O,name:z,form:N,searchValue:I,defaultSearchValue:Y,onSearchChange:F,allowDeselect:ie,error:$e,rightSectionPointerEvents:xo,id:vo,clearable:Co,clearButtonProps:go,hiddenInputProps:wo,renderOption:yo,onClear:ko,autoComplete:So,scrollAreaProps:Oo,__defaultRightSection:gt,__clearSection:wt,__clearable:yt,chevronColor:Do,autoSelectOnBlur:Ve,attributes:Me,...de}=t,xe=m.useMemo(()=>Ko(g),[g]),ue=m.useRef({}),$=m.useMemo(()=>Xe(xe),[xe]),Be=fe(vo),[y,ze,Fe]=te({value:w,defaultValue:S,finalValue:null,onChange:k}),G=typeof y=="string"?y in $?$[y]:ue.current[y]:void 0,Le=Go(G),[pe,_o,No]=te({value:I,defaultValue:Y,finalValue:G?G.label:"",onChange:F}),V=so({opened:l,defaultOpened:c,onDropdownOpen:()=>{p?.(),V.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{d?.(),setTimeout(V.resetSelectedOption,0)}}),W=T=>{_o(T),V.resetSelectedOption()},{resolvedClassNames:Ge,resolvedStyles:Ke}=Bo({props:t,styles:r,classNames:s});m.useEffect(()=>{D&&V.selectFirstOption()},[D,pe]),m.useEffect(()=>{w===null&&W(""),typeof w=="string"&&G&&(Le?.value!==G.value||Le?.label!==G.label)&&W(G.label)},[w,G]),m.useEffect(()=>{!Fe&&!No&&W(typeof y=="string"?y in $?$[y]?.label:ue.current[y]?.label||"":"")},[$,y]),m.useEffect(()=>{y&&y in $&&(ue.current[y]=$[y])},[$,y]);const Io=i.jsx(v.ClearButton,{...go,onClear:()=>{ze(null,null),W(""),ko?.()}}),Ao=Co&&!!y&&!j&&!C;return i.jsxs(i.Fragment,{children:[i.jsxs(v,{store:V,__staticSelector:"Select",classNames:Ge,styles:Ke,unstyled:a,readOnly:C,size:q,attributes:Me,keepMounted:Ve,onOptionSubmit:T=>{_?.(T);const Z=ie&&$[T].value===y?null:$[T],ve=Z?Z.value:null;ve!==y&&ze(ve,Z),!Fe&&W(typeof ve=="string"&&Z?.label||""),V.closeDropdown()},...h,children:[i.jsx(v.Target,{targetType:B?"input":"button",autoComplete:So,children:i.jsx(Je,{id:Be,ref:o,__defaultRightSection:i.jsx(v.Chevron,{size:q,error:$e,unstyled:a,color:Do}),__clearSection:Io,__clearable:Ao,rightSection:Q,rightSectionPointerEvents:xo||"none",...de,size:q,__staticSelector:"Select",disabled:j,readOnly:C||!B,value:pe,onChange:T=>{W(T.currentTarget.value),V.openDropdown(),D&&V.selectFirstOption()},onFocus:T=>{B&&V.openDropdown(),u?.(T)},onBlur:T=>{Ve&&V.clickSelectedOption(),B&&V.closeDropdown();const Z=typeof y=="string"&&(y in $?$[y]:ue.current[y]);W(Z&&Z.label||""),b?.(T)},onClick:T=>{B?V.openDropdown():V.toggleDropdown(),x?.(T)},classNames:Ge,styles:Ke,unstyled:a,pointer:!B,error:$e,attributes:Me})}),i.jsx(ft,{data:xe,hidden:C||j,filter:R,search:pe,limit:ce,hiddenWhenEmpty:!O,withScrollArea:J,maxDropdownHeight:le,filterOptions:!!B&&G?.label!==pe,value:y,checkIconPosition:K,withCheckIcon:X,withAlignedLabels:f,nothingFoundMessage:O,unstyled:a,labelId:de.label?`${Be}-label`:void 0,"aria-label":de.label?void 0:de["aria-label"],renderOption:yo,scrollAreaProps:Oo})]}),i.jsx(v.HiddenInput,{value:y,name:z,form:N,disabled:j,...wo})]})});ho.classes={...Je.classes,...v.classes};ho.displayName="@mantine/core/Select";const xt=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]],Dt=ye("outline","arrow-down","ArrowDown",xt);const vt=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]],_t=ye("outline","arrow-up","ArrowUp",vt);const Ct=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],Nt=ye("outline","plus","Plus",Ct);export{ae as C,Dt as I,ft as O,ho as S,_t as a,Nt as b,Xe as c,v as d,lo as e,Ko as g,ne as i,so as u};
|