Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

feat: toolbar actions

dextmorgne3d382488306
diff --git a/flowsint-api/app/main.py b/flowsint-api/app/main.py
index ea757dac..17182c88 100644
--- a/flowsint-api/app/main.py
+++ b/flowsint-api/app/main.py
@@ -173,10 +173,9 @@ class NodeInput(BaseModel):
def dict_to_cypher_props(props: dict) -> str:
return ", ".join(f"{key}: ${key}" for key in props)
[email protected]("/sketch/{sketch_id}/add")
-def add_node_to_sketch(sketch_id: str, node: NodeInput):
[email protected]("/sketch/{sketch_id}/nodes/add")
+def add_node(sketch_id: str, node: NodeInput):
- print(node)
node_type = getattr(node, "type", "unknown")
node_data = getattr(node, "data", {})
@@ -219,4 +218,44 @@ def add_node_to_sketch(sketch_id: str, node: NodeInput):
return {
"status": "node added",
"node": new_node,
+ }
+
+class EdgeInput(BaseModel):
+ from_node: dict
+ to_node: dict
+ type: str
+
[email protected]("/sketch/{sketch_id}/edges/add")
+def add_edge(sketch_id: str, edge: EdgeInput):
+ from_props = flatten(edge.from_node)
+ to_props = flatten(edge.to_node)
+
+ from_cypher = dict_to_cypher_props(from_props)
+ to_cypher = dict_to_cypher_props(to_props)
+
+ query = f"""
+ MATCH (a {{ {from_cypher} }})
+ MATCH (b {{ {to_cypher} }})
+ MERGE (a)-[r:`{edge.type}` {{sketch_id: $sketch_id}}]->(b)
+ RETURN r
+ """
+
+ params = {
+ **from_props,
+ **to_props,
+ "sketch_id": sketch_id,
+ }
+
+ try:
+ result = neo4j_connection.query(query, params)
+ except Exception as e:
+ print(f"Edge creation error: {e}")
+ raise HTTPException(status_code=500, detail="Failed to create edge")
+
+ if not result:
+ raise HTTPException(status_code=400, detail="Edge creation failed")
+
+ return {
+ "status": "edge added",
+ "edge": result[0]["r"],
}
\ No newline at end of file
diff --git a/flowsint-api/tests/api/__init__.py b/flowsint-api/tests/api/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/flowsint-api/tests/api/edges.py b/flowsint-api/tests/api/edges.py
new file mode 100644
index 00000000..7e578d65
--- /dev/null
+++ b/flowsint-api/tests/api/edges.py
@@ -0,0 +1,27 @@
+from fastapi.testclient import TestClient
+from unittest.mock import patch, MagicMock
+from app.main import app
+
+client = TestClient(app)
+
+def test_add_edge_success():
+ sketch_id = "sketch-123"
+ edge_input = {
+ "from_node": {"uuid": "node-1"},
+ "to_node": {"uuid": "node-2"},
+ "type": "HAS_SUBDOMAIN"
+ }
+
+ mock_result = [{"r": {"type": "HAS_SUBDOMAIN", "sketch_id": sketch_id}}]
+
+ with patch("main.neo4j_connection.query", return_value=mock_result) as mock_query:
+ response = client.post(f"/sketch/{sketch_id}/edges/add", json=edge_input)
+
+ assert response.status_code == 200
+ assert response.json()["status"] == "edge added"
+ assert response.json()["edge"]["sketch_id"] == sketch_id
+
+ expected_query_part = "MERGE (a)-[r:`HAS_SUBDOMAIN`"
+ args, kwargs = mock_query.call_args
+ assert expected_query_part in args[0]
+ assert kwargs is None or kwargs.get("sketch_id") == sketch_id
diff --git a/flowsint-api/tests/api/nodes.py b/flowsint-api/tests/api/nodes.py
new file mode 100644
index 00000000..5bb3bee1
--- /dev/null
+++ b/flowsint-api/tests/api/nodes.py
@@ -0,0 +1,44 @@
+from fastapi.testclient import TestClient
+from unittest.mock import patch
+from app.main import app
+
+client = TestClient(app)
+
+def test_add_node_success():
+ sketch_id = "sketch-abc"
+ node_payload = {
+ "type": "Domain",
+ "data": {
+ "label": "example.com",
+ "color": "#ff0000",
+ "ip": "1.2.3.4"
+ }
+ }
+
+ # Mock de la réponse Neo4j attendue
+ mock_result = [{
+ "node": {
+ "uuid": "node-uuid-123",
+ "type": "Domain",
+ "label": "example.com",
+ "color": "#ff0000",
+ "ip": "1.2.3.4",
+ "caption": "example.com",
+ "size": 40,
+ "sketch_id": sketch_id,
+ }
+ }]
+
+ with patch("main.neo4j_connection.query", return_value=mock_result) as mock_query:
+ response = client.post(f"/sketch/{sketch_id}/nodes/add", json=node_payload)
+
+ assert response.status_code == 200
+ json_data = response.json()
+ assert json_data["status"] == "node added"
+ assert json_data["node"]["label"] == "example.com"
+ assert json_data["node"]["data"] == node_payload["data"]
+
+ # Vérifie qu'on a bien appelé Neo4j avec une requête contenant MERGE et le bon type
+ args, kwargs = mock_query.call_args
+ assert f"MERGE (d:`{node_payload['type']}`" in args[0]
+ assert kwargs is None or kwargs.get("sketch_id") == sketch_id
diff --git a/flowsint-web/public/socials.svg b/flowsint-web/public/socials.svg
index f498d06e..b62b5b20 100644
--- a/flowsint-web/public/socials.svg
+++ b/flowsint-web/public/socials.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-circle-heart-icon lucide-message-circle-heart"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/><path d="M15.8 9.2a2.5 2.5 0 0 0-3.5 0l-.3.4-.35-.3a2.42 2.42 0 1 0-3.2 3.6l3.6 3.5 3.6-3.5c1.2-1.2 1.1-2.7.2-3.7"/></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-send-icon lucide-send"><path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"/><path d="m21.854 2.147-10.94 10.939"/></svg>
\ No newline at end of file
diff --git a/flowsint-web/public/subdomain.svg b/flowsint-web/public/subdomain.svg
new file mode 100644
index 00000000..2b5d68e5
--- /dev/null
+++ b/flowsint-web/public/subdomain.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-send-to-back-icon lucide-send-to-back"><rect x="14" y="14" width="8" height="8" rx="2"/><rect x="2" y="2" width="8" height="8" rx="2"/><path d="M7 14v1a2 2 0 0 0 2 2h1"/><path d="M14 7h1a2 2 0 0 1 2 2v1"/></svg>
\ No newline at end of file
diff --git a/flowsint-web/public/username.svg b/flowsint-web/public/username.svg
new file mode 100644
index 00000000..f9b65f97
--- /dev/null
+++ b/flowsint-web/public/username.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-user-check-icon lucide-user-check"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><polyline points="16 11 18 13 22 9"/></svg>
\ No newline at end of file
diff --git a/flowsint-web/src/app/api/transforms/route.ts b/flowsint-web/src/app/api/transforms/route.ts
index 4389b787..65f3ffc6 100644
--- a/flowsint-web/src/app/api/transforms/route.ts
+++ b/flowsint-web/src/app/api/transforms/route.ts
@@ -18,7 +18,7 @@ export async function GET(request: NextRequest) {
const { data: transforms, error } = await supabase.from("transforms")
.select("id, name, description, category, created_at, last_updated_at")
.order("last_updated_at", { ascending: false })
- .eq("category", type)
+ .contains('category', [type])
if (error) {
console.log(error)
return NextResponse.json({ error: error.message }, { status: 500 })
diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/client.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/client.tsx
index ea509b0f..4599e273 100644
--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/client.tsx
+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/client.tsx
@@ -25,14 +25,11 @@ const stateSelector = (state: { currentNode: any; setCurrentNode: any }) => ({
})
export default function DashboardClient({ investigationId, sketchId, sketch, user_id }: DashboardClientProps) {
- const [open, setOpen] = useState(false)
const [isLeftPanelCollapsed, setIsLeftPanelCollapsed] = useState(false)
const [isRightPanelCollapsed, setIsRightPanelCollapsed] = useState(false)
- const minimapRef = useRef<HTMLDivElement>(null)
const {
currentNode,
- setCurrentNode
} = useSketchStore(stateSelector, shallow)
const graphQuery = useQuery({
@@ -58,11 +55,10 @@ export default function DashboardClient({ investigationId, sketchId, sketch, use
/>
<ResizableHandle withHandle />
<ResizablePanel defaultSize={65}>
- <GraphPanel minimapRef={minimapRef} query={graphQuery} />
+ <GraphPanel query={graphQuery} />
</ResizablePanel>
<ResizableHandle withHandle />
<RightPanel
- minimapRef={minimapRef}
sketchId={sketchId}
isLoading={graphQuery.isLoading}
isCollapsed={isRightPanelCollapsed}
@@ -70,7 +66,6 @@ export default function DashboardClient({ investigationId, sketchId, sketch, use
currentNode={currentNode}
/>
</ResizablePanelGroup>
- {/* <ActionDialog setCurrentNode={setCurrentNode} setOpenDialog={setOpen} openDialog={open} /> */}
</div>
<SettingsModal />
</>
diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/color-badge.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/color-badge.tsx
index a0028e9a..530f4eba 100644
--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/color-badge.tsx
+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/color-badge.tsx
@@ -1,4 +1,4 @@
-import { type ItemType, useColorSettings } from "@/store/color-settings"
+import { type ItemType, useNodesDisplaySettings } from "@/store/node-display-settings"
interface ColorBadgeProps {
itemType: ItemType
@@ -7,7 +7,7 @@ interface ColorBadgeProps {
}
export default function ColorBadge({ itemType, label, className = "" }: ColorBadgeProps) {
- const { colors } = useColorSettings()
+ const { colors } = useNodesDisplaySettings()
return (
<span
diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/draggable-item.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/draggable-item.tsx
new file mode 100644
index 00000000..6c02b088
--- /dev/null
+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/draggable-item.tsx
@@ -0,0 +1,44 @@
+"use client"
+
+import { IconContainer } from "@/components/icon-container"
+import { LucideIcon } from "lucide-react"
+import { memo } from "react"
+
+export interface DraggableItemProps {
+ label: string
+ icon: LucideIcon
+ type: string
+ color?: string
+ disabled?: boolean
+ description?: string
+}
+
+export const DraggableItem = memo(function DraggableItem({
+ label,
+ icon,
+ type,
+ color,
+ disabled = false,
+ description,
+}: DraggableItemProps) {
+ return (
+ <div
+ draggable={!disabled}
+ className="px-2 py-1 rounded-md relative overflow-hidden border-l-primary cursor-grab bg-card border hover:shadow-md transition-shadow"
+ style={{
+ borderLeftWidth: "4px",
+ borderLeftColor: color,
+ cursor: disabled ? "not-allowed" : "grab",
+ opacity: disabled ? 0.5 : 1,
+ }}
+ >
+ <div className="flex justify-start items-center gap-2">
+ <IconContainer icon={icon} color={color} type={type} />
+ <div className="space-y-1">
+ <h3 className="text-sm font-medium">{label}</h3>
+ <p className="text-xs text-muted-foreground">{description || label}</p>
+ </div>
+ </div>
+ </div>
+ )
+})
diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/graph-panel.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/graph-panel.tsx
index f14da19f..3a29442d 100644
--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/graph-panel.tsx
+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/graph-panel.tsx
@@ -1,19 +1,16 @@
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@/components/ui/resizable'
import { ConsolePanel } from './console-panel'
import { memo, useState, useRef, useEffect } from 'react'
-import Neo4jGraph from './graph'
+import Graph from './graph'
interface GraphPanelProps {
query: any
- minimapRef: any
}
-export const GraphPanel = memo(function GraphPanel({ query, minimapRef }: GraphPanelProps) {
+export const GraphPanel = memo(function GraphPanel({ query }: GraphPanelProps) {
const [isBottomPanelCollapsed, setIsBottomPanelCollapsed] = useState(false)
const [panelDimensions, setPanelDimensions] = useState({ width: 0, height: 0 })
const graphPanelRef = useRef<HTMLDivElement>(null)
-
- // Fonction pour mettre à jour les dimensions du panel
const updatePanelDimensions = () => {
if (!graphPanelRef.current) return
@@ -23,27 +20,18 @@ export const GraphPanel = memo(function GraphPanel({ query, minimapRef }: GraphP
height: rect.height
})
}
-
- // Mettre à jour les dimensions au montage et lors des redimensionnements
useEffect(() => {
updatePanelDimensions()
-
- // Observer les changements de taille
const resizeObserver = new ResizeObserver(() => {
updatePanelDimensions()
})
-
if (graphPanelRef.current) {
resizeObserver.observe(graphPanelRef.current)
}
-
- // Nettoyer l'observer
return () => {
resizeObserver.disconnect()
}
}, [])
-
- // Mettre à jour les dimensions lors des changements de fenêtre
useEffect(() => {
window.addEventListener('resize', updatePanelDimensions)
return () => {
@@ -65,8 +53,7 @@ export const GraphPanel = memo(function GraphPanel({ query, minimapRef }: GraphP
onResize={updatePanelDimensions}
>
<div ref={graphPanelRef} className="h-full w-full">
- <Neo4jGraph
- minimapRef={minimapRef}
+ <Graph
data={query.data}
isLoading={query.isLoading}
width={panelDimensions.width}
@@ -74,10 +61,7 @@ export const GraphPanel = memo(function GraphPanel({ query, minimapRef }: GraphP
/>
</div>
</ResizablePanel>
-
<ResizableHandle withHandle />
-
- {/* Bottom Console Panel */}
<ResizablePanel
defaultSize={20}
minSize={10}
diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/graph.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/graph.tsx
index 02477329..ae7d1294 100644
--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/graph.tsx
+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/graph.tsx
@@ -1,6 +1,6 @@
"use client"
-import { memo, useCallback, useEffect, useRef, useState } from "react"
+import { memo, useCallback, useEffect, useRef } from "react"
import dynamic from "next/dynamic"
import { Button } from "@/components/ui/button"
import Loader from "@/components/loader"
@@ -8,8 +8,22 @@ import NewActions from "@/components/sketches/new-actions"
import { PlusIcon } from "lucide-react"
import { useSketchStore } from "@/store/sketch-store"
import { shallow } from "zustand/shallow"
-import { useColorSettings } from "@/store/color-settings"
+import { useNodesDisplaySettings } from "@/store/node-display-settings"
import type { NodeData, EdgeData } from "@/types"
+import { useGraphControls } from "@/store/graph-controls-store"
+
+const ARROW_COLOR = "rgba(255, 255, 255, 0.37)";
+const LINE_COLOR = "rgba(255, 255, 255, 0.21)";
+const LINE_WIDTH = 1;
+const ARROW_HEAD_LENGTH = 5;
+
+
+const getNodeSize = (type: string) =>
+ ["individual", "username", "domain", "organization"].includes(type) ? 80 : 45;
+
+const getNodeRadius = (type: string, isSelected = false) =>
+ getNodeSize(type) / 10 + (isSelected ? 0.5 : 0);
+
const ForceGraph2D = dynamic(() => import("react-force-graph-2d").then((mod) => mod), {
ssr: false,
@@ -17,46 +31,78 @@ const ForceGraph2D = dynamic(() => import("react-force-graph-2d").then((mod) =>
interface GraphProps {
isLoading: boolean
- minimapRef: any
data: { nds: Node[]; rls: EdgeData[] }
- // Nouvelles props pour les dimensions
width?: number
height?: number
}
const stateSelector = (state: {
setCurrentNode: any
+ toggleNodeSelection: any
+ clearSelectedNodes: any
nodes: NodeData[]
edges: EdgeData[]
setNodes: any
setEdges: any
addNode: any
- currentNode: NodeData | null
+ currentNode: NodeData | null,
+ selectedNodes: NodeData[],
+ setSelectedNodes: any
+ panelOpen: boolean
+ setPanelOpen: any
}) => ({
setCurrentNode: state.setCurrentNode,
+ toggleNodeSelection: state.toggleNodeSelection,
+ clearSelectedNodes: state.clearSelectedNodes,
nodes: state.nodes,
edges: state.edges,
setNodes: state.setNodes,
setEdges: state.setEdges,
addNode: state.addNode,
currentNode: state.currentNode,
+ selectedNodes: state.selectedNodes,
+ setSelectedNodes: state.setSelectedNodes,
+ panelOpen: state.panelOpen,
+ setPanelOpen: state.setPanelOpen
})
-const Graph = ({ data, isLoading, minimapRef, width, height }: GraphProps) => {
+const Graph = ({ data, isLoading, width, height }: GraphProps) => {
const fgRef = useRef<any>(null)
- const [ready, setReady] = useState(false)
-
- const { colors } = useColorSettings()
- const { currentNode, setCurrentNode, addNode, setNodes, setEdges, nodes, edges } = useSketchStore(
+ const { colors, getIcon } = useNodesDisplaySettings()
+ const {
+ currentNode,
+ selectedNodes,
+ toggleNodeSelection,
+ clearSelectedNodes,
+ addNode,
+ setNodes,
+ setEdges,
+ nodes,
+ edges,
+ panelOpen,
+ setPanelOpen
+ } = useSketchStore(
stateSelector,
shallow,
)
+ const setActions = useGraphControls((s) => s.setActions);
+
useEffect(() => {
- if (minimapRef?.current) {
- setReady(true)
- }
- }, [minimapRef])
+ if (!fgRef.current) return;
+ setActions({
+ zoomToFit: () => fgRef.current?.zoomToFit(400),
+ zoomIn: () => {
+ const zoom = fgRef.current?.zoom() ?? 1;
+ fgRef.current?.zoom(zoom * 1.2);
+ },
+ zoomOut: () => {
+ const zoom = fgRef.current?.zoom() ?? 1;
+ fgRef.current?.zoom(zoom / 1.2);
+ },
+ });
+ }, [!!fgRef.current]);
+
useEffect(() => {
if (isLoading) return
@@ -71,14 +117,27 @@ const Graph = ({ data, isLoading, minimapRef, width, height }: GraphProps) => {
}
}, [currentNode])
- const onNodeClick = useCallback(
+ const onNodeClick = useCallback((node: any, event: any) => {
+ const multiSelect = event.ctrlKey || event.shiftKey || event.altKey
+ toggleNodeSelection(node, multiSelect)
+ if (!panelOpen) {
+ setPanelOpen(true)
+ }
+ }, [toggleNodeSelection, panelOpen, setPanelOpen])
+
+ const nodeColor = useCallback(
(node: any) => {
- setCurrentNode(node)
+ const typedNode = node as NodeData;
+ return selectedNodes.some(n => n.id === typedNode.id) ? '#FFCC00' : '#888888';
},
- [setCurrentNode],
+ [selectedNodes]
)
- if (isLoading || !ready) {
+ const handleBackgroundClick = useCallback(() => {
+ clearSelectedNodes()
+ }, [clearSelectedNodes])
+
+ if (isLoading) {
return <Loader label="Loading..." />
}
@@ -97,6 +156,7 @@ const Graph = ({ data, isLoading, minimapRef, width, height }: GraphProps) => {
return (
<div className="relative h-full w-full">
+ {/* Bouton pour ajouter un nouveau nœud */}
<div className="top-3 left-3 absolute z-50">
<NewActions addNodes={addNode}>
<Button
@@ -108,12 +168,17 @@ const Graph = ({ data, isLoading, minimapRef, width, height }: GraphProps) => {
</NewActions>
</div>
+ {/* Panneau de débogage */}
+ <div className="absolute bottom-3 left-3 z-50 bg-card p-2 rounded-lg text-xs opacity-70">
+ Selected: {selectedNodes.length}
+ </div>
+
<ForceGraph2D
ref={fgRef}
graphData={{ nodes, links: edges }}
nodeId="id"
linkSource="from"
- nodeLabel={"label"}
+ nodeLabel="label"
linkTarget="to"
nodeAutoColorBy="label"
d3VelocityDecay={0.3}
@@ -121,33 +186,107 @@ const Graph = ({ data, isLoading, minimapRef, width, height }: GraphProps) => {
cooldownTicks={50}
width={width}
height={height}
+ nodeColor={nodeColor}
+ linkCanvasObject={(link, ctx) => {
+ const start = link.target as any;
+ const end = link.source as any;
+ if (
+ !start || !end ||
+ typeof start.x !== "number" || typeof start.y !== "number" ||
+ typeof end.x !== "number" || typeof end.y !== "number"
+ ) return;
+ const dx = end.x - start.x;
+ const dy = end.y - start.y;
+ const angle = Math.atan2(dy, dx);
+ const targetRadius = getNodeRadius(end.type);
+ const tx = end.x - Math.cos(angle) * targetRadius;
+ const ty = end.y - Math.sin(angle) * targetRadius;
+ ctx.strokeStyle = LINE_COLOR;
+ ctx.lineWidth = LINE_WIDTH;
+ ctx.beginPath();
+ ctx.moveTo(start.x, start.y);
+ ctx.lineTo(tx, ty);
+ ctx.stroke();
+ ctx.fillStyle = ARROW_COLOR;
+ ctx.beginPath();
+ ctx.moveTo(tx, ty);
+ ctx.lineTo(
+ tx - ARROW_HEAD_LENGTH * Math.cos(angle - Math.PI / 10),
+ ty - ARROW_HEAD_LENGTH * Math.sin(angle - Math.PI / 10)
+ );
+ ctx.lineTo(
+ tx - ARROW_HEAD_LENGTH * Math.cos(angle + Math.PI / 10),
+ ty - ARROW_HEAD_LENGTH * Math.sin(angle + Math.PI / 10)
+ );
+ ctx.closePath();
+ ctx.fill();
+ if (link.caption) {
+ const midX = (start.x + tx) / 2;
+ const midY = (start.y + ty) / 2;
+ ctx.save();
+ ctx.translate(midX, midY);
+ ctx.rotate(angle);
+ ctx.fillStyle = "#333";
+ ctx.font = "3px Sans-Serif";
+ ctx.textAlign = "center";
+ ctx.textBaseline = "middle";
+ ctx.fillText(link.caption, 0, -4);
+ ctx.restore();
+ }
+ }}
+ linkWidth={link => link ? 2 : 1}
onNodeClick={onNodeClick}
- onBackgroundClick={() => setCurrentNode(null)}
- linkColor={"red"}
+ onBackgroundClick={handleBackgroundClick}
onNodeDragEnd={(node) => {
node.fx = node.x
node.fy = node.y
node.fz = node.z
}}
nodeCanvasObject={(node: any, ctx, globalScale) => {
- const radius = node.size / 10
- const background = getComputedStyle(document.documentElement).getPropertyValue("--card")?.trim()
+ const isSelected = selectedNodes.some(n => n.id === node.id);
+ const isCurrent = currentNode?.id === node.id;
+ const color = colors[node.type as keyof typeof colors]
+ const nodeSize = ["individual", "username", "domain", "organization"].includes(node?.type) ? 80 : 45
+ const radius = nodeSize / 10 + (isSelected ? 0.5 : 0)
const fontSize = globalScale * 0.2462
ctx.font = `${fontSize}px Sans-Serif`
- ctx.fillStyle = background
+ ctx.fillStyle = color
ctx.beginPath()
- ctx.arc(node.x!, node.y!, node.size / 10, 0, 2 * Math.PI, false)
+ ctx.arc(node.x!, node.y!, radius, 0, 2 * Math.PI, false)
ctx.fill()
- // Contour
ctx.beginPath()
ctx.arc(node.x!, node.y!, radius, 0, 2 * Math.PI, false)
- ctx.strokeStyle = colors[node.type as keyof typeof colors] || "black"
- ctx.lineWidth = 0.4
+ ctx.strokeStyle = color || "black"
+ ctx.lineWidth = isSelected ? 0.5 : 0.2
ctx.stroke()
+ const size = ["individual", "username", "domain", "organization"].includes(node?.type) ? 8 : 4
+ ctx.drawImage(getIcon(node.type), node.x - size / 2, node.y - size / 2, size, size);
+ if (isSelected) {
+ ctx.beginPath()
+ ctx.arc(node.x!, node.y!, radius + 0.8, 0, 2 * Math.PI, false)
+ ctx.strokeStyle = '#FFCC00'
+ ctx.lineWidth = 0.3
+ ctx.stroke()
+ if (node.label) {
+ ctx.fillStyle = '#FFFFFF'
+ ctx.font = `bold ${fontSize * 1.2}px Sans-Serif`
+ ctx.textAlign = 'center'
+ ctx.fillText(node.label, node.x!, node.y! + radius + 4.5)
+ }
+ }
+ if (isCurrent) {
+ ctx.beginPath()
+ ctx.arc(node.x!, node.y!, radius + 1.5, 0, 2 * Math.PI, false)
+ ctx.strokeStyle = 'white'
+ ctx.lineWidth = 0.2
+ ctx.setLineDash([0.5, 0.5])
+ ctx.stroke()
+ ctx.setLineDash([])
+ }
}}
/>
</div>
)
}
-export default memo(Graph)
+export default memo(Graph)
\ No newline at end of file
diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/left-panel.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/left-panel.tsx
index 95e22b41..f37b0bbe 100644
--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/left-panel.tsx
+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/left-panel.tsx
@@ -1,16 +1,12 @@
"use client"
import { Button } from "@/components/ui/button"
-import {
- ResizablePanel,
- ResizablePanelGroup
-} from "@/components/ui/resizable"
-import { ScrollArea } from "@/components/ui/scroll-area"
+import { ResizablePanel } from "@/components/ui/resizable"
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion"
-import { ChevronDown, ChevronRight } from 'lucide-react'
-import { memo } from "react"
+import { ChevronRight } from "lucide-react"
+import { memo, useCallback } from "react"
import { actionItems } from "@/lib/action-items"
-import { IconContainer } from "@/components/icon-container"
+import { DraggableItem } from "./draggable-item"
interface LeftPanelProps {
isCollapsed: boolean
@@ -18,6 +14,9 @@ interface LeftPanelProps {
}
export const LeftPanel = memo(function LeftPanel({ isCollapsed, setIsCollapsed }: LeftPanelProps) {
+ const handleExpand = useCallback(() => setIsCollapsed(false), [setIsCollapsed])
+ const handleCollapse = useCallback(() => setIsCollapsed(true), [setIsCollapsed])
+
return (
<ResizablePanel
defaultSize={15}
@@ -26,90 +25,66 @@ export const LeftPanel = memo(function LeftPanel({ isCollapsed, setIsCollapsed }
className="h-[calc(100vh_-_92px)] bg-card"
collapsible={true}
collapsedSize={2}
- onCollapse={() => setIsCollapsed(true)}
- onExpand={() => setIsCollapsed(false)}
+ onCollapse={handleCollapse}
+ onExpand={handleExpand}
>
{!isCollapsed ? (
<div className="overflow-auto bg-card h-full flex flex-col w-full !p-0 !m-0">
- <div>
- <div className="p-4">
- <div className="grid grid-cols-1 gap-2">
- {actionItems.map((item) => {
- if (item.children && item.children.length > 0) {
- return (
- <Accordion key={item.id} type="single" collapsible className="border-b border-border">
- <AccordionItem value={item.id.toString()}>
- <AccordionTrigger className="py-1 text-sm">
- <div className="flex items-center gap-2">
- <span>{item.label}</span>
- {item.comingSoon && <span className="ml-1 text-xs text-muted-foreground">(Soon)</span>}
- </div>
- </AccordionTrigger>
- <AccordionContent>
- <div className="grid grid-cols-1 gap-2 p-2">
- {item.children.map((childItem) => {
- return (
- <div
- key={childItem.id}
- draggable
- className="p-2 rounded-md relative overflow-hidden border-l-primary cursor-grab bg-card border hover:shadow-md transition-shadow"
- style={{ borderLeftWidth: "4px", borderLeftColor: childItem.color, cursor: "grab" }}
- >
- <div className="flex justify-start items-center gap-2">
- <IconContainer
- icon={childItem.icon}
- color={childItem.color}
- type={childItem.type}
- />
- <div className="space-y-1">
- {/* <Badge variant={"outline"} className="">{scanner.type}</Badge> */}
- <h3 className="text-sm font-medium">{childItem.label}</h3>
- <p className="text-xs text-muted-foreground">{childItem.label}</p>
- </div>
- </div>
- </div>
- );
- })}
- </div>
- </AccordionContent>
- </AccordionItem>
- </Accordion>
- );
- }
-
- // Otherwise, render it as a regular item
+ <div className="p-4">
+ <div className="grid grid-cols-1 gap-2">
+ {actionItems.map((item) => {
+ if (item.children && item.children.length > 0) {
return (
- <div
- key={item.id}
- draggable
- className="p-2 px-4 rounded-md relative overflow-hidden border-l-primary cursor-grab bg-card border hover:shadow-md transition-shadow"
- style={{ borderLeftWidth: "4px", cursor: "grab" }}
- >
- <div className="flex justify-start items-center gap-2">
- <IconContainer
- icon={item.icon}
- type={item.type}
- />
- <div className="space-y-1">
- {/* <Badge variant={"outline"} className="">{scanner.type}</Badge> */}
- <h3 className="text-sm font-medium">{item.label}</h3>
- <p className="text-xs text-muted-foreground">{item.label}</p>
- </div>
- </div>
- </div>
- );
- })}
- </div>
+ <Accordion key={item.id} type="single" collapsible className="border-b border-border">
+ <AccordionItem value={item.id.toString()}>
+ <AccordionTrigger className="py-1 text-sm">
+ <div className="flex items-center gap-2">
+ <span>{item.label}</span>
+ {item.comingSoon && <span className="ml-1 text-xs text-muted-foreground">(Soon)</span>}
+ </div>
+ </AccordionTrigger>
+ <AccordionContent>
+ <div className="grid grid-cols-1 gap-2 p-2">
+ {item.children.map((childItem) => (
+ <DraggableItem
+ key={childItem.id}
+ label={childItem.label}
+ icon={childItem.icon}
+ type={childItem.type}
+ color={childItem.color}
+ disabled={childItem.disabled}
+ description={childItem.label}
+ />
+ ))}
+ </div>
+ </AccordionContent>
+ </AccordionItem>
+ </Accordion>
+ )
+ }
+
+ return (
+ <DraggableItem
+ key={item.id}
+ label={item.label}
+ icon={item.icon}
+ type={item.type}
+ color={item.color}
+ disabled={item.disabled}
+ description={item.label}
+ />
+ )
+ })}
</div>
</div>
</div>
) : (
<div className="flex h-full items-center justify-center">
- <Button variant="ghost" size="icon" className="h-8 w-8" onClick={() => setIsCollapsed(false)}>
+ <Button variant="ghost" size="icon" className="h-8 w-8" onClick={handleExpand}>
<ChevronRight className="h-4 w-4" />
</Button>
</div>
)}
</ResizablePanel>
- );
-});
+ )
+})
diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/right-panel.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/right-panel.tsx
index 4de5c159..2720fae3 100644
--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/right-panel.tsx
+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/right-panel.tsx
@@ -1,12 +1,13 @@
import { Button } from '@/components/ui/button'
import { ResizablePanel, ResizablePanelGroup, ResizableHandle } from '@/components/ui/resizable'
-import { ChevronDown, ChevronLeft } from 'lucide-react'
+import { ChevronDown, ChevronLeft, InfoIcon } from 'lucide-react'
import NodesPanel from '@/components/sketches/sketch/nodes-panel'
import ProfilePanel from '@/components/sketches/sketch/profile-panel'
import { memo, useMemo, useRef } from 'react'
import { useSketchStore } from '@/store/sketch-store'
import { shallow } from 'zustand/shallow'
import { MiniMap } from '@xyflow/react'
+import { NodeData } from '@/types'
interface RightPanelProps {
isCollapsed: boolean
@@ -14,15 +15,18 @@ interface RightPanelProps {
currentNode: any,
isLoading: boolean
sketchId: string
- minimapRef: any
}
-export const RightPanel = memo(function RightPanel({ isCollapsed, isLoading, setIsCollapsed, currentNode, sketchId, minimapRef }: RightPanelProps) {
- const stateSelector = (state: { nodes: any }) => ({
+export const RightPanel = memo(function RightPanel({ isCollapsed, isLoading, setIsCollapsed, currentNode, sketchId }: RightPanelProps) {
+ const stateSelector = (state: { nodes: any, selectedNodes: any, clearSelectedNodes: any }) => ({
nodes: state.nodes,
+ selectedNodes: state.selectedNodes,
+ clearSelectedNodes: state.clearSelectedNodes
})
const {
nodes,
+ selectedNodes,
+ clearSelectedNodes
} = useSketchStore(stateSelector, shallow)
const processedNodes = useMemo(() =>
nodes.map((node: any) => (node))
@@ -43,22 +47,39 @@ export const RightPanel = memo(function RightPanel({ isCollapsed, isLoading, set
>
{!isCollapsed ? (
<ResizablePanelGroup autoSaveId="conditional" direction="vertical">
- <ResizablePanel order={1} id="map" defaultSize={30} className='flex bg-background items-center justfify-center p-4 overflow-hidden'>
- <div className='w-full h-full overflow-hidden z-[50]' ref={minimapRef} />
- </ResizablePanel>
-
- {currentNode ? (
+ {selectedNodes.length > 0 &&
+ <>
+ <ResizablePanel order={1} id="map" defaultSize={30}>
+ <div className="overflow-y-auto overflow-x-hidden h-full p-4">
+ <h3 className="text-sm font-semibold mb-2 flex items-center">
+ <InfoIcon className="mr-2" size={16} />
+ {selectedNodes.length === 1 ? 'Selected Node' : `${selectedNodes.length} nodes selected`}
+ </h3>
+ {selectedNodes.map((node: NodeData) => (
+ <div key={node.id} className="mb-2 pb-2 border-b last:border-0">
+ <p>label: <strong className='text-sm'>{node.label}</strong></p>
+ </div>
+ ))}
+ <Button
+ className="mt-2 w-full"
+ variant="outline"
+ onClick={clearSelectedNodes}
+ >
+ Search selection
+ </Button>
+ </div>
+ </ResizablePanel>
+ <ResizableHandle withHandle className='z-[100]' />
+ </>
+ }
+ {currentNode && (
<>
- <ResizableHandle withHandle className='z-[11]' />
<ResizablePanel order={2} id="infos" defaultSize={30}>
<ProfilePanel sketch_id={sketchId} data={currentNode.data} />
</ResizablePanel>
<ResizableHandle withHandle />
</>
- ) : (
- <ResizableHandle withHandle />
)}
-
<ResizablePanel order={3} id="nodes" defaultSize={40}>
<NodesPanel isLoading={isLoading} nodes={processedNodes} />
</ResizablePanel>
diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/settings-modal.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/settings-modal.tsx
index 1ebe0da9..e14de4d3 100644
--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/settings-modal.tsx
+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/settings-modal.tsx
@@ -7,12 +7,12 @@ import { ScrollArea } from "@/components/ui/scroll-area"
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
-import { ITEM_TYPES, type ItemType, useColorSettings } from "@/store/color-settings"
+import { ITEM_TYPES, type ItemType, useNodesDisplaySettings } from "@/store/node-display-settings"
import { useModalStore } from "@/store/store-settings"
export default function SettingsModal() {
const { isSettingsOpen, closeSettings } = useModalStore()
- const { colors, setColor, resetColors } = useColorSettings()
+ const { colors, setColor, resetAll } = useNodesDisplaySettings()
const [localColors, setLocalColors] = useState<Record<ItemType, string>>({ ...colors })
const handleColorChange = (itemType: ItemType, color: string) => {
@@ -37,8 +37,8 @@ export default function SettingsModal() {
}
const handleReset = () => {
- resetColors()
- setLocalColors({ ...useColorSettings.getState().colors })
+ resetAll()
+ setLocalColors({ ...useNodesDisplaySettings.getState().colors })
}
return (
diff --git a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/toolbar.tsx b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/toolbar.tsx
index a357d2db..1409f4a4 100644
--- a/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/toolbar.tsx
+++ b/flowsint-web/src/app/dashboard/investigations/[investigation_id]/sketches/[sketch_id]/toolbar.tsx
@@ -7,6 +7,7 @@ import { ScanButton } from "@/components/sketches/scans-drawer/scan-button"
import { Button } from "@/components/ui/button"
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"
import { cn } from "@/lib/utils"
+import { useGraphControls } from "@/store/graph-controls-store"
import { useSketchStore } from "@/store/sketch-store"
import { useModalStore } from "@/store/store-settings"
import type { Profile } from "@/types"
@@ -85,6 +86,10 @@ export const Toolbar = memo(function Toolbar({
)
const { toggleSettings } = useModalStore()
+ const zoomToFit = useGraphControls((s) => s.zoomToFit);
+ const zoomIn = useGraphControls((s) => s.zoomIn);
+ const zoomOut = useGraphControls((s) => s.zoomOut);
+
const { refetch, isRefetching } = useQuery({
queryKey: ["investigations", investigation_id, 'sketches', sketch_id, "data"],
queryFn: async () => {
@@ -131,21 +136,19 @@ export const Toolbar = memo(function Toolbar({
<ToolbarButton
icon={<ZoomIn className="h-4 w-4 opacity-70" />}
tooltip="Zoom In"
- onClick={() => { }}
+ onClick={zoomIn}
/>
<ToolbarButton
icon={<Minus className="h-4 w-4 opacity-70" />}
tooltip="Zoom Out"
- onClick={() => { }}
+ onClick={zoomOut}
/>
<ToolbarButton
icon={<Maximize className="h-4 w-4 opacity-70" />}
tooltip="Fit to View"
- onClick={() => { }}
+ onClick={zoomToFit}
/>
-
<Separator />
-
<ToolbarButton icon={<LayoutGrid className="h-4 w-4 opacity-70" />} tooltip="Layout" />
<ToolbarButton icon={<Layers className="h-4 w-4 opacity-70" />} tooltip="Layers" />
<ToolbarButton onClick={toggleSettings} icon={<GearIcon className="h-4 w-4 opacity-70" />} tooltip="Settings" />
diff --git a/flowsint-web/src/app/dashboard/layout.tsx b/flowsint-web/src/app/dashboard/layout.tsx
index 66220701..b3772208 100644
--- a/flowsint-web/src/app/dashboard/layout.tsx
+++ b/flowsint-web/src/app/dashboard/layout.tsx
@@ -40,7 +40,7 @@ const DashboardLayout = async ({
className="absolute inset-2 rounded-full border-2 border-cyan-500"
/>
</div>
- <span className='opacity-60 text-sm'>/</span>
+ {/* <span className='opacity-60 text-sm'>/</span> */}
</Link>
{/* <Separator orientation="vertical" className="h-6" /> */}
<MainNav className="mx-6" />
diff --git a/flowsint-web/src/app/dashboard/transforms/page.tsx b/flowsint-web/src/app/dashboard/transforms/page.tsx
index 304ad801..867de79c 100644
--- a/flowsint-web/src/app/dashboard/transforms/page.tsx
+++ b/flowsint-web/src/app/dashboard/transforms/page.tsx
@@ -3,7 +3,7 @@ import { Button } from "@/components/ui/button"
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
import { createClient } from "@/lib/supabase/server"
import { hexToRgba } from "@/lib/utils"
-import { useColorSettings } from "@/store/color-settings"
+import { useNodesDisplaySettings } from "@/store/node-display-settings"
import { PlusCircle, FileCode2, ArrowRight, Calendar } from "lucide-react"
import Link from "next/link"
import { useMemo } from "react"
diff --git a/flowsint-web/src/app/dashboard/transforms/transform-item.tsx b/flowsint-web/src/app/dashboard/transforms/transform-item.tsx
index 89f83bb7..5203b550 100644
--- a/flowsint-web/src/app/dashboard/transforms/transform-item.tsx
+++ b/flowsint-web/src/app/dashboard/transforms/transform-item.tsx
@@ -2,7 +2,7 @@
import { Badge } from "@/components/ui/badge"
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "@/components/ui/card"
import { hexToRgba } from "@/lib/utils"
-import { useColorSettings } from "@/store/color-settings"
+import { useNodesDisplaySettings } from "@/store/node-display-settings"
import { FileCode2, Calendar, ArrowRight } from "lucide-react"
import Link from "next/link"
import { memo, useMemo } from "react"
@@ -17,7 +17,7 @@ export const TransformItem = memo(({ transform }: { transform: any }) => {
: null
const stepsCount = transform?.transform_schema?.edges?.length || 0
- const color = useColorSettings((state) => state.colors[transform.category as keyof typeof state.colors] || "#000000")
+ const color = useNodesDisplaySettings((state) => state.colors[transform.category as keyof typeof state.colors] || "#000000")
const bgColor = useMemo(() => hexToRgba(color, 0.3), [color])
return (
@@ -26,7 +26,7 @@ export const TransformItem = memo(({ transform }: { transform: any }) => {
<CardHeader className="pb-2 relative">
<CardTitle className="text-lg w-full flex items-start justify-between font-medium">
<p className=" line-clamp-2">{transform.name}</p>
- <Badge style={{ backgroundColor: bgColor }}>{transform.category}</Badge>
+ <Badge style={{ backgroundColor: bgColor }}>{transform.category.join(", ")}</Badge>
</CardTitle>
<CardDescription className="line-clamp-2">
{transform.description || "No description provided"}
diff --git a/flowsint-web/src/app/layout.tsx b/flowsint-web/src/app/layout.tsx
index abe5f86a..6f0720b6 100644
--- a/flowsint-web/src/app/layout.tsx
+++ b/flowsint-web/src/app/layout.tsx
@@ -36,12 +36,12 @@ export default function RootLayout({
return (
<html suppressHydrationWarning lang="en">
<head>
- {process.env.NODE_ENV === "development" && (
+ {/* {process.env.NODE_ENV === "development" && ( */}
<script
crossOrigin="anonymous"
src="//unpkg.com/react-scan/dist/auto.global.js"
/>
- )}
+ {/* )} */}
</head>
<body
className={clsx(
diff --git a/flowsint-web/src/components/icon-container.tsx b/flowsint-web/src/components/icon-container.tsx
index d7e43483..3daec235 100644
--- a/flowsint-web/src/components/icon-container.tsx
+++ b/flowsint-web/src/components/icon-container.tsx
@@ -1,4 +1,4 @@
-import { useColorSettings } from "@/store/color-settings"
+import { useNodesDisplaySettings } from "@/store/node-display-settings"
import type { LucideIcon } from "lucide-react"
import { useMemo } from "react"
@@ -19,7 +19,7 @@ interface IconContainerProps {
export function IconContainer({ type, color, icon: Icon, size = 12 }: IconContainerProps) {
const containerSize = size + 16 // Make container slightly larger than icon
- const col = color ? color : useColorSettings((state) => state.colors[type as keyof typeof state.colors] || "#000000")
+ const col = color ? color : useNodesDisplaySettings((state) => state.colors[type as keyof typeof state.colors] || "#000000")
const bgColor = useMemo(() => hexToRgba(col, 0.3), [color])
return (
diff --git a/flowsint-web/src/components/sketches/new-actions.tsx b/flowsint-web/src/components/sketches/new-actions.tsx
index fba76771..6e6fd5c5 100644
--- a/flowsint-web/src/components/sketches/new-actions.tsx
+++ b/flowsint-web/src/components/sketches/new-actions.tsx
@@ -15,7 +15,7 @@ import { AnimatePresence, motion } from "framer-motion"
import { DynamicForm } from "@/components/sketches/dynamic-form"
import { Badge } from "@/components/ui/badge"
import { saveNode } from "@/lib/actions/sketches"
-import { useColorSettings } from "@/store/color-settings"
+import { useNodesDisplaySettings } from "@/store/node-display-settings"
interface ActionDialogProps {
children: React.ReactNode
@@ -25,7 +25,7 @@ interface ActionDialogProps {
export default function ActionDialog({ children, addNodes, setCurrentNode }: ActionDialogProps) {
const { sketch_id } = useParams()
- const { colors } = useColorSettings()
+ const { colors } = useNodesDisplaySettings()
const [openDialog, setOpenDialog] = useState(false)
const [openAddNodeModal, setOpenNodeModal] = useState(false)
const [currentNodeType, setCurrentNodeType] = useState<ActionItem | null>(null)
diff --git a/flowsint-web/src/components/sketches/sketch/profile-panel.tsx b/flowsint-web/src/components/sketches/sketch/profile-panel.tsx
index 2a02b47b..cd0a31a6 100644
--- a/flowsint-web/src/components/sketches/sketch/profile-panel.tsx
+++ b/flowsint-web/src/components/sketches/sketch/profile-panel.tsx
@@ -22,7 +22,7 @@ export default function ProfilePanel({ data, sketch_id }: { data: any, sketch_id
)
const Icon = item?.icon || HelpCircle
return (
- <div className=" overflow-y-auto overflow-x-hidden h-full">
+ <div className="overflow-y-auto overflow-x-hidden h-full">
<div className="flex items-center sticky bg-card top-0 border-b justify-start px-4 py-2 gap-2 z-50">
<IconContainer
type={data?.type}
diff --git a/flowsint-web/src/components/transforms/editor.tsx b/flowsint-web/src/components/transforms/editor.tsx
index 948e929b..4da26433 100644
--- a/flowsint-web/src/components/transforms/editor.tsx
+++ b/flowsint-web/src/components/transforms/editor.tsx
@@ -231,7 +231,7 @@ const FlowEditor = memo(
.insert({
name: name,
description: description,
- category: inputType,
+ category: [inputType],
transform_schema: {
nodes,
edges,
diff --git a/flowsint-web/src/components/type-badge.tsx b/flowsint-web/src/components/type-badge.tsx
index da40df56..50a2b569 100644
--- a/flowsint-web/src/components/type-badge.tsx
+++ b/flowsint-web/src/components/type-badge.tsx
@@ -1,6 +1,6 @@
import { Badge } from "@/components/ui/badge"
import { cn, hexToRgba } from "@/lib/utils"
-import { useColorSettings } from "@/store/color-settings"
+import { useNodesDisplaySettings } from "@/store/node-display-settings"
import { memo } from "react"
type TypeBadgeProps = {
@@ -9,7 +9,7 @@ type TypeBadgeProps = {
}
function TypeBadgeComponent({ type, className }: TypeBadgeProps) {
- const { colors } = useColorSettings()
+ const { colors } = useNodesDisplaySettings()
const color = colors[type as keyof typeof colors] || "bg-gray-100 text-gray-800 hover:bg-gray-100/80 dark:bg-gray-800/50 dark:text-gray-300 dark:hover:bg-gray-800/60"
return (
diff --git a/flowsint-web/src/lib/actions/sketches.ts b/flowsint-web/src/lib/actions/sketches.ts
index 3cb1b7bc..eab0c521 100644
--- a/flowsint-web/src/lib/actions/sketches.ts
+++ b/flowsint-web/src/lib/actions/sketches.ts
@@ -40,7 +40,7 @@ export async function saveNode(schema: Schema) {
await supabase.auth.refreshSession()
const { data: { session } } = await supabase.auth.getSession();
const jwt = session?.access_token;
- const response = await fetch(`${process.env.NEXT_PUBLIC_DOCKER_FLOWSINT_API}/sketch/${sketch_id}/add`, {
+ const response = await fetch(`${process.env.NEXT_PUBLIC_DOCKER_FLOWSINT_API}/sketch/${sketch_id}/nodes/add`, {
method: "POST",
body: JSON.stringify(node),
headers: {
diff --git a/flowsint-web/src/store/color-settings.ts b/flowsint-web/src/store/color-settings.ts
deleted file mode 100644
index 82b7d850..00000000
--- a/flowsint-web/src/store/color-settings.ts
+++ /dev/null
@@ -1,108 +0,0 @@
-"use client"
-import { create } from "zustand"
-import { persist } from "zustand/middleware"
-
-export type ItemType =
- | "individual"
- | "phone"
- | "address"
- | "email"
- | "ip"
- | "social_profile"
- | "organization"
- | "vehicle"
- | "website"
- | "domain"
- | "subdomain"
- | "document"
- | "financial"
- | "event"
- | "device"
- | "media"
- | "education"
- | "relationship"
- | "online_activity"
- | "digital_footprint"
- | "biometric"
- | "credential"
- | "username"
-
-export const ITEM_TYPES: ItemType[] = [
- "individual",
- "phone",
- "address",
- "email",
- "ip",
- "social_profile",
- "organization",
- "vehicle",
- "website",
- "domain",
- "subdomain",
- "document",
- "financial",
- "event",
- "device",
- "media",
- "education",
- "relationship",
- "online_activity",
- "digital_footprint",
- "biometric",
- "credential",
- "username"
-]
-
-const primary = '#009bc2'
-
-const DEFAULT_COLORS: Record<ItemType, string> = {
- individual: primary, // Bleu moyen
- phone: primary, // Vert/gris doux
- address: primary, // Vert forêt
- email: primary, // Rouge doux
- ip: primary, // Orange chaud
- social_profile: primary, // Mauve gris
- organization: primary, // Brun/bronze
- vehicle: primary, // Jaune sable
- website: primary, // Rose grisé
- domain: primary, // Bleu-vert foncé
- subdomain: primary, // Bleu clair
- document: primary, // Bleu pâle grisé
- financial: primary, // Rose saumon
- event: primary, // Bleu ciel
- device: primary, // Jaune doux
- media: primary, // Orange ocre
- education: primary, // Bleu acier
- relationship: primary, // Pêche
- online_activity: primary, // Vert herbe
- digital_footprint: primary, // Rouge terre
- username: primary, // Bleu lavande
- credential: primary, // Gris neutre
- biometric: primary, // Gris neutre
-}
-
-
-interface ColorSettingsState {
- colors: Record<ItemType, string>
- setColor: (itemType: ItemType, color: string) => void
- resetColors: () => void
-}
-
-export const useColorSettings = create<ColorSettingsState>()(
- persist(
- (set) => ({
- colors: { ...DEFAULT_COLORS },
- setColor: (itemType, color) =>
- set((state) => ({
- colors: {
- ...state.colors,
- [itemType]: color,
- },
- })),
- resetColors: () => set({ colors: { ...DEFAULT_COLORS } }),
- }),
- {
- name: "color-settings",
- },
- ),
-)
diff --git a/flowsint-web/src/store/graph-controls-store.ts b/flowsint-web/src/store/graph-controls-store.ts
new file mode 100644
index 00000000..1c47dc3e
--- /dev/null
+++ b/flowsint-web/src/store/graph-controls-store.ts
@@ -0,0 +1,15 @@
+import { create } from 'zustand';
+
+type GraphControlsStore = {
+ zoomToFit: () => void;
+ zoomIn: () => void;
+ zoomOut: () => void;
+ setActions: (actions: Partial<GraphControlsStore>) => void;
+};
+
+export const useGraphControls = create<GraphControlsStore>((set) => ({
+ zoomToFit: () => { },
+ zoomIn: () => { },
+ zoomOut: () => { },
+ setActions: (actions) => set(actions),
+}));
diff --git a/flowsint-web/src/store/node-display-settings.ts b/flowsint-web/src/store/node-display-settings.ts
new file mode 100644
index 00000000..e5741893
--- /dev/null
+++ b/flowsint-web/src/store/node-display-settings.ts
@@ -0,0 +1,159 @@
+"use client"
+import { create } from "zustand"
+import { persist } from "zustand/middleware"
+
+export type ItemType =
+ | "individual"
+ | "phone"
+ | "address"
+ | "email"
+ | "ip"
+ | "social_profile"
+ | "organization"
+ | "vehicle"
+ | "website"
+ | "domain"
+ | "subdomain"
+ | "document"
+ | "financial"
+ | "event"
+ | "device"
+ | "media"
+ | "education"
+ | "relationship"
+ | "online_activity"
+ | "digital_footprint"
+ | "biometric"
+ | "credential"
+ | "username"
+
+export const ITEM_TYPES: ItemType[] = [
+ "individual",
+ "phone",
+ "address",
+ "email",
+ "ip",
+ "social_profile",
+ "organization",
+ "vehicle",
+ "website",
+ "domain",
+ "subdomain",
+ "document",
+ "financial",
+ "event",
+ "device",
+ "media",
+ "education",
+ "relationship",
+ "online_activity",
+ "digital_footprint",
+ "biometric",
+ "credential",
+ "username",
+]
+
+const primary = "#f59e0b"
+
+const DEFAULT_COLORS: Record<ItemType, string> = {
+ individual: primary, // Bleu moyen
+ phone: primary, // Vert/gris doux
+ address: primary, // Vert forêt
+ email: primary, // Rouge doux
+ ip: primary, // Orange chaud
+ social_profile: primary, // Mauve gris
+ organization: primary, // Brun/bronze
+ vehicle: primary, // Jaune sable
+ website: primary, // Rose grisé
+ domain: primary, // Bleu-vert foncé
+ subdomain: primary, // Bleu clair
+ document: primary, // Bleu pâle grisé
+ financial: primary, // Rose saumon
+ event: primary, // Bleu ciel
+ device: primary, // Jaune doux
+ media: primary, // Orange ocre
+ education: primary, // Bleu acier
+ relationship: primary, // Pêche
+ online_activity: primary, // Vert herbe
+ digital_footprint: primary, // Rouge terre
+ username: primary, // Bleu lavande
+ credential: primary, // Gris neutre
+ biometric: primary, // Gris neutre
+}
+
+// Définition des icônes par défaut pour chaque type d'élément
+const DEFAULT_ICONS: Record<ItemType, string> = {
+ individual: "/person.svg",
+ phone: "/phone.svg",
+ address: "/address.svg",
+ email: "/email.svg",
+ ip: "/ip.svg",
+ social_profile: "/socials.svg",
+ organization: "/organization.svg",
+ vehicle: "/car.svg",
+ website: "/website.svg",
+ domain: "/website.svg",
+ subdomain: "/subdomain.svg",
+ document: "/file-text.svg",
+ financial: "/credit-card.svg",
+ event: "/calendar.svg",
+ device: "/smartphone.svg",
+ media: "/image.svg",
+ education: "/book.svg",
+ relationship: "/users.svg",
+ online_activity: "/activity.svg",
+ digital_footprint: "/footprints.svg",
+ biometric: "/fingerprint.svg",
+ credential: "/key.svg",
+ username: "/username.svg",
+}
+
+interface NodesDisplaySettingsState {
+ colors: Record<ItemType, string>
+ icons: Record<ItemType, string>
+ setColor: (itemType: ItemType, color: string) => void
+ setIcon: (itemType: ItemType, iconPath: string) => void
+ resetColors: () => void
+ resetIcons: () => void
+ resetAll: () => void
+ getIcon: (itemType: ItemType) => HTMLImageElement
+}
+
+export const useNodesDisplaySettings = create<NodesDisplaySettingsState>()(
+ persist(
+ (set, get) => ({
+ colors: { ...DEFAULT_COLORS },
+ icons: { ...DEFAULT_ICONS },
+ setColor: (itemType, color) =>
+ set((state) => ({
+ colors: {
+ ...state.colors,
+ [itemType]: color,
+ },
+ })),
+ setIcon: (itemType, iconPath) =>
+ set((state) => ({
+ icons: {
+ ...state.icons,
+ [itemType]: iconPath,
+ },
+ })),
+ resetColors: () => set({ colors: { ...DEFAULT_COLORS } }),
+ resetIcons: () => set({ icons: { ...DEFAULT_ICONS } }),
+ resetAll: () =>
+ set({
+ colors: { ...DEFAULT_COLORS },
+ icons: { ...DEFAULT_ICONS },
+ }),
+ getIcon: (itemType) => {
+ const img = new Image()
+ img.src = get().icons[itemType]
+ img.crossOrigin = "anonymous"
+ return img
+ },
+ }),
+ {
+ name: "nodes-display-settings",
+ },
+ ),
+)
diff --git a/flowsint-web/src/store/sketch-store.ts b/flowsint-web/src/store/sketch-store.ts
index 06922756..7e2eddaf 100644
--- a/flowsint-web/src/store/sketch-store.ts
+++ b/flowsint-web/src/store/sketch-store.ts
@@ -1,6 +1,7 @@
"use client"
import { create } from "zustand"
+import { devtools } from "zustand/middleware"
import type { Sketch } from "@/types/sketch"
import { EdgeData, NodeData } from "@/types"
@@ -12,6 +13,7 @@ interface SketchState {
setEdges: (edges: EdgeData[]) => void
filters: Record<string, unknown>
currentNode: NodeData | null
+ selectedNodes: NodeData[]
panelOpen: boolean
openNewNode: boolean
openActionDialog: boolean
@@ -20,33 +22,100 @@ interface SketchState {
setFilters: (filters: Record<string, unknown>) => void
setOpenNewNode: (open: boolean) => void
setCurrentNode: (node: NodeData | null) => void
+ setSelectedNodes: (nodes: NodeData[]) => void
+ toggleNodeSelection: (node: NodeData, multiSelect?: boolean) => void
setPanelOpen: (open: boolean) => void
setSketch: (sketch: Sketch | null) => void
setOpenActionDialog: (open: boolean) => void
+ clearSelectedNodes: () => void
}
-export const useSketchStore = create<SketchState>((set, get) => ({
- nodes: [],
- edges: [],
- filters: {},
- currentNode: null,
- panelOpen: false,
- openNewNode: false,
- openActionDialog: false,
- sketch: null,
- isRefetching: false,
-
- setNodes: (nodes) => set({ nodes }),
- addNode: (newNode) => {
- const { nodes, setNodes } = get()
- const newNodes = [...nodes, { ...newNode }] as NodeData[]
- setNodes(newNodes)
- },
- setEdges: (edges) => set({ edges }),
- setFilters: (filters) => set({ filters }),
- setOpenNewNode: (open) => set({ openNewNode: open }),
- setCurrentNode: (node) => set({ currentNode: node }),
- setPanelOpen: (open) => set({ panelOpen: open }),
- setSketch: (sketch) => set({ sketch }),
- setOpenActionDialog: (open) => set({ openActionDialog: open }),
-}))
+// Ajout d'outils de développement pour faciliter le debug
+export const useSketchStore = create<SketchState>()(
+ devtools(
+ (set, get) => ({
+ nodes: [],
+ edges: [],
+ filters: {},
+ currentNode: null,
+ selectedNodes: [],
+ panelOpen: false,
+ openNewNode: false,
+ openActionDialog: false,
+ sketch: null,
+ isRefetching: false,
+
+ setNodes: (nodes) => set({ nodes }, false, "setNodes"),
+ addNode: (newNode) => {
+ const { nodes } = get()
+ // S'assurer que le nœud a un ID unique s'il n'en a pas déjà un
+ const nodeWithId = {
+ id: newNode.id || `node-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
+ ...newNode
+ } as NodeData
+
+ const newNodes = [...nodes, nodeWithId]
+ set({ nodes: newNodes }, false, "addNode")
+ return nodeWithId
+ },
+ setEdges: (edges) => set({ edges }, false, "setEdges"),
+ setFilters: (filters) => set({ filters }, false, "setFilters"),
+ setOpenNewNode: (open) => set({ openNewNode: open }, false, "setOpenNewNode"),
+
+ setCurrentNode: (node) => {
+ console.log("Setting current node:", node)
+ set({ currentNode: node }, false, "setCurrentNode")
+ // Si nous définissons un nœud actuel et que le panneau n'est pas ouvert, ouvrons-le
+ if (node && !get().panelOpen) {
+ set({ panelOpen: true }, false, "openPanelWithNode")
+ }
+ },
+
+ setSelectedNodes: (nodes) => {
+ console.log("Setting selected nodes:", nodes)
+ set({ selectedNodes: nodes }, false, "setSelectedNodes")
+ },
+
+ toggleNodeSelection: (node, multiSelect = false) => {
+ const { selectedNodes } = get()
+ const isSelected = selectedNodes.some(n => n.id === node.id)
+
+ if (multiSelect) {
+ // Mode multi-sélection: ajouter ou retirer le nœud
+ if (isSelected) {
+ set(
+ { selectedNodes: selectedNodes.filter(n => n.id !== node.id) },
+ false,
+ "removeNodeFromSelection"
+ )
+ } else {
+ set(
+ { selectedNodes: [...selectedNodes, node] },
+ false,
+ "addNodeToSelection"
+ )
+ }
+ } else {
+ // Mode sélection unique: remplacer ou désélectionner
+ if (isSelected && selectedNodes.length === 1) {
+ set({ selectedNodes: [] }, false, "deselectNode")
+ } else {
+ set({ selectedNodes: [node] }, false, "selectSingleNode")
+ }
+ }
+
+ // Définir également comme nœud actuel
+ set({ currentNode: isSelected ? null : node }, false, "updateCurrentNodeWithSelection")
+ },
+
+ clearSelectedNodes: () => {
+ set({ selectedNodes: [], currentNode: null }, false, "clearSelectedNodes")
+ },
+
+ setPanelOpen: (open) => set({ panelOpen: open }, false, "setPanelOpen"),
+ setSketch: (sketch) => set({ sketch }, false, "setSketch"),
+ setOpenActionDialog: (open) => set({ openActionDialog: open }, false, "setOpenActionDialog"),
+ }),
+ { name: "sketch-store" }
+ )
+)
\ No newline at end of file
diff --git a/flowsint-web/src/types/index.ts b/flowsint-web/src/types/index.ts
index 2af270f6..ef88533a 100644
--- a/flowsint-web/src/types/index.ts
+++ b/flowsint-web/src/types/index.ts
@@ -9,6 +9,7 @@ export type NodeData = {
position: any,
type: string,
data: any,
+ label: string,
width?: number,
height?: number,
x?: number,
diff --git a/flowsint-web/styles/globals.css b/flowsint-web/styles/globals.css
index 69cb12df..a375fd61 100644
--- a/flowsint-web/styles/globals.css
+++ b/flowsint-web/styles/globals.css
@@ -113,97 +113,97 @@ body {
}
:root {
- --background: oklch(.98 0 0);
- --foreground: oklch(0.32 0 0);
+ --background: oklch(1.00 0 0);
+ --foreground: oklch(0.27 0 0);
--card: oklch(1.00 0 0);
- --card-foreground: oklch(0.32 0 0);
+ --card-foreground: oklch(0.27 0 0);
--popover: oklch(1.00 0 0);
- --popover-foreground: oklch(0.32 0 0);
- --primary: oklch(0.64 0.1202 223.94);
- --primary-foreground: oklch(1.00 0 0);
+ --popover-foreground: oklch(0.27 0 0);
+ --primary: oklch(0.77 0.16 70.08);
+ --primary-foreground: oklch(0 0 0);
--secondary: oklch(0.97 0.00 264.54);
--secondary-foreground: oklch(0.45 0.03 256.80);
--muted: oklch(0.98 0.00 247.84);
--muted-foreground: oklch(0.55 0.02 264.36);
- --accent: oklch(0.91 0.02 243.82);
- --accent-foreground: oklch(0.38 0.14 265.52);
+ --accent: oklch(0.99 0.02 95.28);
+ --accent-foreground: oklch(0.47 0.12 46.20);
--destructive: oklch(0.64 0.21 25.33);
--destructive-foreground: oklch(1.00 0 0);
- --border: oklch(0.90 0.01 247.88);
- --input: oklch(0.97 0.00 264.54);
- --ring: oklch(0.64 0.17 36.44);
- --chart-1: oklch(0.72 0.06 248.68);
- --chart-2: oklch(0.79 0.09 35.96);
- --chart-3: oklch(0.58 0.08 254.16);
- --chart-4: oklch(0.50 0.08 259.49);
- --chart-5: oklch(0.42 0.10 264.03);
- --sidebar: oklch(0.90 0.00 258.33);
- --sidebar-foreground: oklch(0.32 0 0);
- --sidebar-primary: oklch(0.64 0.17 36.44);
+ --border: oklch(0.93 0.01 264.53);
+ --input: oklch(0.93 0.01 264.53);
+ --ring: oklch(0.77 0.16 70.08);
+ --chart-1: oklch(0.77 0.16 70.08);
+ --chart-2: oklch(0.67 0.16 58.32);
+ --chart-3: oklch(0.56 0.15 49.00);
+ --chart-4: oklch(0.47 0.12 46.20);
+ --chart-5: oklch(0.41 0.11 45.90);
+ --sidebar: oklch(0.98 0.00 247.84);
+ --sidebar-foreground: oklch(0.27 0 0);
+ --sidebar-primary: oklch(0.77 0.16 70.08);
--sidebar-primary-foreground: oklch(1.00 0 0);
- --sidebar-accent: oklch(0.91 0.02 243.82);
- --sidebar-accent-foreground: oklch(0.38 0.14 265.52);
+ --sidebar-accent: oklch(0.99 0.02 95.28);
+ --sidebar-accent-foreground: oklch(0.47 0.12 46.20);
--sidebar-border: oklch(0.93 0.01 264.53);
- --sidebar-ring: oklch(0.64 0.17 36.44);
+ --sidebar-ring: oklch(0.77 0.16 70.08);
--font-sans: Inter, sans-serif;
--font-serif: Source Serif 4, serif;
--font-mono: JetBrains Mono, monospace;
- --radius: 0.75rem;
- --shadow-2xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.05);
- --shadow-xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.05);
- --shadow-sm: 0px 1px 3px 0px hsl(0 0% 0% / 0.10), 0px 1px 2px -1px hsl(0 0% 0% / 0.10);
- --shadow: 0px 1px 3px 0px hsl(0 0% 0% / 0.10), 0px 1px 2px -1px hsl(0 0% 0% / 0.10);
- --shadow-md: 0px 1px 3px 0px hsl(0 0% 0% / 0.10), 0px 2px 4px -1px hsl(0 0% 0% / 0.10);
- --shadow-lg: 0px 1px 3px 0px hsl(0 0% 0% / 0.10), 0px 4px 6px -1px hsl(0 0% 0% / 0.10);
- --shadow-xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.10), 0px 8px 10px -1px hsl(0 0% 0% / 0.10);
- --shadow-2xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.25);
+ --radius: 0.375rem;
+ --shadow-2xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
+ --shadow-xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
+ --shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 1px 2px -2px hsl(0 0% 0% / 0.10);
+ --shadow: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 1px 2px -2px hsl(0 0% 0% / 0.10);
+ --shadow-md: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 2px 4px -2px hsl(0 0% 0% / 0.10);
+ --shadow-lg: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 4px 6px -2px hsl(0 0% 0% / 0.10);
+ --shadow-xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 8px 10px -2px hsl(0 0% 0% / 0.10);
+ --shadow-2xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.25);
}
.dark {
- --background: oklch(0.27 0.02 268.40);
+ --background: oklch(0.20 0 0);
--foreground: oklch(0.92 0 0);
- --card: oklch(0.25 0.02 268.40);
+ --card: oklch(0.27 0 0);
--card-foreground: oklch(0.92 0 0);
- --popover: oklch(0.29 0.02 268.40);
+ --popover: oklch(0.27 0 0);
--popover-foreground: oklch(0.92 0 0);
- --primary: oklch(0.64 0.1202 223.94);
- --primary-foreground: oklch(1.00 0 0);
- --secondary: oklch(0.31 0.03 266.71);
+ --primary: oklch(0.77 0.16 70.08);
+ --primary-foreground: oklch(0 0 0);
+ --secondary: oklch(0.27 0 0);
--secondary-foreground: oklch(0.92 0 0);
- --muted: oklch(0.31 0.03 266.71);
+ --muted: oklch(0.27 0 0);
--muted-foreground: oklch(0.72 0 0);
- --accent: oklch(0.34 0.06 267.59);
- --accent-foreground: oklch(0.88 0.06 254.13);
+ --accent: oklch(0.47 0.12 46.20);
+ --accent-foreground: oklch(0.92 0.12 95.75);
--destructive: oklch(0.64 0.21 25.33);
--destructive-foreground: oklch(1.00 0 0);
- --border: oklch(0.38 0.03 269.73);
- --input: oklch(0.38 0.03 269.73);
- --ring: oklch(0.64 0.17 36.44);
- --chart-1: oklch(0.72 0.06 248.68);
- --chart-2: oklch(0.77 0.09 34.19);
- --chart-3: oklch(0.58 0.08 254.16);
- --chart-4: oklch(0.50 0.08 259.49);
- --chart-5: oklch(0.42 0.10 264.03);
- --sidebar: oklch(0.31 0.03 267.74);
+ --border: oklch(0.37 0 0);
+ --input: oklch(0.37 0 0);
+ --ring: oklch(0.77 0.16 70.08);
+ --chart-1: oklch(0.84 0.16 84.43);
+ --chart-2: oklch(0.67 0.16 58.32);
+ --chart-3: oklch(0.47 0.12 46.20);
+ --chart-4: oklch(0.56 0.15 49.00);
+ --chart-5: oklch(0.47 0.12 46.20);
+ --sidebar: oklch(0.17 0 0);
--sidebar-foreground: oklch(0.92 0 0);
- --sidebar-primary: oklch(0.64 0.17 36.44);
+ --sidebar-primary: oklch(0.77 0.16 70.08);
--sidebar-primary-foreground: oklch(1.00 0 0);
- --sidebar-accent: oklch(0.34 0.06 267.59);
- --sidebar-accent-foreground: oklch(0.88 0.06 254.13);
- --sidebar-border: oklch(0.38 0.03 269.73);
- --sidebar-ring: oklch(0.64 0.17 36.44);
+ --sidebar-accent: oklch(0.47 0.12 46.20);
+ --sidebar-accent-foreground: oklch(0.92 0.12 95.75);
+ --sidebar-border: oklch(0.37 0 0);
+ --sidebar-ring: oklch(0.77 0.16 70.08);
--font-sans: Inter, sans-serif;
--font-serif: Source Serif 4, serif;
--font-mono: JetBrains Mono, monospace;
- --radius: 0.75rem;
- --shadow-2xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.05);
- --shadow-xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.05);
- --shadow-sm: 0px 1px 3px 0px hsl(0 0% 0% / 0.10), 0px 1px 2px -1px hsl(0 0% 0% / 0.10);
- --shadow: 0px 1px 3px 0px hsl(0 0% 0% / 0.10), 0px 1px 2px -1px hsl(0 0% 0% / 0.10);
- --shadow-md: 0px 1px 3px 0px hsl(0 0% 0% / 0.10), 0px 2px 4px -1px hsl(0 0% 0% / 0.10);
- --shadow-lg: 0px 1px 3px 0px hsl(0 0% 0% / 0.10), 0px 4px 6px -1px hsl(0 0% 0% / 0.10);
- --shadow-xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.10), 0px 8px 10px -1px hsl(0 0% 0% / 0.10);
- --shadow-2xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.25);
+ --radius: 0.375rem;
+ --shadow-2xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
+ --shadow-xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
+ --shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 1px 2px -2px hsl(0 0% 0% / 0.10);
+ --shadow: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 1px 2px -2px hsl(0 0% 0% / 0.10);
+ --shadow-md: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 2px 4px -2px hsl(0 0% 0% / 0.10);
+ --shadow-lg: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 4px 6px -2px hsl(0 0% 0% / 0.10);
+ --shadow-xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.10), 0px 8px 10px -2px hsl(0 0% 0% / 0.10);
+ --shadow-2xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.25);
}
@theme inline {