From 9240326a8945e0c2a1c1df0f9c69bac71a01bb25 Mon Sep 17 00:00:00 2001 From: girl-loves-coding <100626279+girl-loves-coding@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:46:26 +0200 Subject: [PATCH 01/10] Replace custom controls with shadcn and add AddBlockDropdown --- packages/editor/src/components/RightPanel.tsx | 21 +- .../controls/ActionToolsControls.tsx | 61 +- .../components/controls/AddBlockDropdown.tsx | 71 + .../src/components/controls/ControlButton.tsx | 24 - .../components/controls/ControlSeparator.tsx | 9 - .../controls/MiniMapZoomControls.tsx | 29 +- .../components/controls/UndoRedoControls.tsx | 24 +- .../editor/src/components/controls/index.tsx | 5 + .../src/components/controls/minimap/index.tsx | 1 + .../panelViews/LogicNodePanelView.tsx | 2 - packages/editor/src/utils/customLogger.ts | 1 - packages/shared/package.json | 2 + .../src/ui/components/ui/dropdown-menu.tsx | 198 + .../shared/src/ui/components/ui/tooltip.tsx | 28 + pnpm-lock.yaml | 14935 +++++++--------- 15 files changed, 6997 insertions(+), 8414 deletions(-) create mode 100644 packages/editor/src/components/controls/AddBlockDropdown.tsx delete mode 100644 packages/editor/src/components/controls/ControlButton.tsx delete mode 100644 packages/editor/src/components/controls/ControlSeparator.tsx create mode 100644 packages/shared/src/ui/components/ui/dropdown-menu.tsx create mode 100644 packages/shared/src/ui/components/ui/tooltip.tsx diff --git a/packages/editor/src/components/RightPanel.tsx b/packages/editor/src/components/RightPanel.tsx index c2e9de2..3f06be9 100644 --- a/packages/editor/src/components/RightPanel.tsx +++ b/packages/editor/src/components/RightPanel.tsx @@ -3,10 +3,11 @@ import { useReactFlowState } from "@/hooks/useReactFlowState"; import { useLayoutState } from "@/hooks/useLayoutState"; import { updateNodesData } from "@/slices/reactFlowSlice"; import { useDispatch } from "react-redux"; -import { GitBranch } from "lucide-react"; +import { X } from "lucide-react"; import LogicNodePanelView from "./panelViews/LogicNodePanelView"; import { ICondition } from "@data-river/shared/interfaces/ICondition"; - +import { Button } from "@data-river/shared/ui/components/ui/button"; +import { toggleRightPanelVisible } from "@/store"; const RightPanel = () => { const { isRightPanelVisible } = useLayoutState(); const { nodes, selectedNodeId } = useReactFlowState(); @@ -31,11 +32,6 @@ const RightPanel = () => { ); }; - const handleDeleteNode = () => { - // Implement node deletion logic here - console.log("Delete node:", selectedNode?.id); - }; - const renderPanelView = () => { switch (selectedNode.data.block) { case "logic@0.1": @@ -50,7 +46,6 @@ const RightPanel = () => { } onConfigChange={handleConfigChange} inputs={selectedNode.data.inputs || {}} - onDeleteNode={handleDeleteNode} /> ); // Add cases for other node types here @@ -61,11 +56,17 @@ const RightPanel = () => { return (