From d8099190845ec2b8f2567c92de938eb3eb361dac Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Mon, 10 Jul 2023 22:44:48 -0300 Subject: [PATCH 1/3] Fixed node text selecting when selecting nodes --- .../src/pages/FlowPage/components/PageComponent/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx index 23033d174..785afec96 100644 --- a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx @@ -338,7 +338,8 @@ export default function Page({ flow }: { flow: FlowType }) { const onSelectionEnd = useCallback(() => { setSelectionEnded(true); }, []); - const onSelectionStart = useCallback(() => { + const onSelectionStart = useCallback((event) => { + event.preventDefault(); setSelectionEnded(false); }, []); @@ -410,7 +411,6 @@ export default function Page({ flow }: { flow: FlowType }) { nodesDraggable={!disableCopyPaste} panOnDrag={!disableCopyPaste} zoomOnDoubleClick={!disableCopyPaste} - selectNodesOnDrag={false} className="theme-attribution" minZoom={0.01} maxZoom={8} From 51c3bf3b8f948e2b1f29f5e8e473ae02f97452b1 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 10 Jul 2023 22:54:06 -0300 Subject: [PATCH 2/3] fix dark mode for connections --- src/frontend/src/contexts/tabsContext.tsx | 5 ++--- src/frontend/src/index.css | 7 +++++-- .../FlowPage/components/ConnectionLineComponent/index.tsx | 3 +-- .../src/pages/FlowPage/components/PageComponent/index.tsx | 6 +++--- src/frontend/tailwind.config.js | 1 + 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index fee9aa3df..a7ddf11f8 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -539,11 +539,10 @@ export function TabsProvider({ children }: { children: ReactNode }) { const updateEdges = (edges) => { edges.forEach((edge) => { - edge.style = { stroke: "inherit" }; edge.className = - edge.targetHandle.split("|")[0] === "Text" + (edge.targetHandle.split("|")[0] === "Text" ? "stroke-gray-800 " - : "stroke-gray-900 "; + : "stroke-gray-900 ") + " stroke-connection"; edge.animated = edge.targetHandle.split("|")[0] === "Text"; }); }; diff --git a/src/frontend/src/index.css b/src/frontend/src/index.css index 5af8ff70a..007effc15 100644 --- a/src/frontend/src/index.css +++ b/src/frontend/src/index.css @@ -27,8 +27,7 @@ --destructive: 0 100% 50%; /* hsl(0 100% 50%) */ --destructive-foreground: 210 40% 98%; /* hsl(210 40% 98%) */ --radius: 0.5rem; - --ring: 215 20.2% 65.1%; /* hsl(215 20% 65%) */ - + --ring: 215 20.2% 65.1%; /* hsl(215 20% 65%) */ --round-btn-shadow: #00000063; --error-background: #fef2f2; @@ -55,6 +54,8 @@ --status-yellow: #eab308; --status-green: #4ade80; --status-blue:#2563eb; + --connection: #555; + } .dark { @@ -113,6 +114,8 @@ --status-yellow: #eab308; --status-green: #4ade80; --status-blue: #2563eb; + --connection: #555; + }} @layer base { diff --git a/src/frontend/src/pages/FlowPage/components/ConnectionLineComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/ConnectionLineComponent/index.tsx index bc78bc5bd..61a493613 100644 --- a/src/frontend/src/pages/FlowPage/components/ConnectionLineComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/ConnectionLineComponent/index.tsx @@ -12,9 +12,8 @@ const ConnectionLineComponent = ({ diff --git a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx index 23033d174..810836307 100644 --- a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx @@ -184,11 +184,11 @@ export default function Page({ flow }: { flow: FlowType }) { addEdge( { ...params, - style: { stroke: "inherit" }, + style: { stroke: "#555" }, className: - params.targetHandle.split("|")[0] === "Text" + (params.targetHandle.split("|")[0] === "Text" ? "stroke-foreground " - : "stroke-foreground ", + : "stroke-foreground ") + " stroke-connection", animated: params.targetHandle.split("|")[0] === "Text", }, eds diff --git a/src/frontend/tailwind.config.js b/src/frontend/tailwind.config.js index 739308b92..0408cc053 100644 --- a/src/frontend/tailwind.config.js +++ b/src/frontend/tailwind.config.js @@ -43,6 +43,7 @@ module.exports = { "accordion-up": "accordion-up 0.2s ease-out", }, colors: { + connection: "var(--connection)", "almost-dark-gray": "var(--almost-dark-gray)", "almost-light-blue": "var(--almost-light-blue)", "almost-medium-blue": "var(--almost-medium-blue)", From 9331c9b9c08ca1b37dd6331b2f95ecaa47a39709 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Mon, 10 Jul 2023 22:54:50 -0300 Subject: [PATCH 3/3] Fix copy paste on text area --- src/frontend/src/components/textAreaComponent/index.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/frontend/src/components/textAreaComponent/index.tsx b/src/frontend/src/components/textAreaComponent/index.tsx index 2a7abe859..8083b4eb7 100644 --- a/src/frontend/src/components/textAreaComponent/index.tsx +++ b/src/frontend/src/components/textAreaComponent/index.tsx @@ -5,6 +5,7 @@ import { TextAreaComponentType } from "../../types/components"; import { TypeModal } from "../../utils"; import { ExternalLink } from "lucide-react"; +import { TabsContext } from "../../contexts/tabsContext"; export default function TextAreaComponent({ value, @@ -14,6 +15,7 @@ export default function TextAreaComponent({ }: TextAreaComponentType) { const [myValue, setMyValue] = useState(value); const { openPopUp, closePopUp } = useContext(PopUpContext); + const { setDisableCopyPaste } = useContext(TabsContext); useEffect(() => { if (disabled) { @@ -31,6 +33,12 @@ export default function TextAreaComponent({
{ + setDisableCopyPaste(true); + }} + onBlur={() => { + setDisableCopyPaste(false); + }} className={ editNode ? " input-edit-node "