Merge branch 'form_io' of https://github.com/logspace-ai/langflow into form_io
This commit is contained in:
commit
dccf83ff17
6 changed files with 22 additions and 12 deletions
|
|
@ -5,6 +5,7 @@ import { TextAreaComponentType } from "../../types/components";
|
||||||
import { TypeModal } from "../../utils";
|
import { TypeModal } from "../../utils";
|
||||||
|
|
||||||
import { ExternalLink } from "lucide-react";
|
import { ExternalLink } from "lucide-react";
|
||||||
|
import { TabsContext } from "../../contexts/tabsContext";
|
||||||
|
|
||||||
export default function TextAreaComponent({
|
export default function TextAreaComponent({
|
||||||
value,
|
value,
|
||||||
|
|
@ -14,6 +15,7 @@ export default function TextAreaComponent({
|
||||||
}: TextAreaComponentType) {
|
}: TextAreaComponentType) {
|
||||||
const [myValue, setMyValue] = useState(value);
|
const [myValue, setMyValue] = useState(value);
|
||||||
const { openPopUp, closePopUp } = useContext(PopUpContext);
|
const { openPopUp, closePopUp } = useContext(PopUpContext);
|
||||||
|
const { setDisableCopyPaste } = useContext(TabsContext);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
|
|
@ -31,6 +33,12 @@ export default function TextAreaComponent({
|
||||||
<div className="flex w-full items-center">
|
<div className="flex w-full items-center">
|
||||||
<input
|
<input
|
||||||
value={myValue}
|
value={myValue}
|
||||||
|
onFocus={() => {
|
||||||
|
setDisableCopyPaste(true);
|
||||||
|
}}
|
||||||
|
onBlur={() => {
|
||||||
|
setDisableCopyPaste(false);
|
||||||
|
}}
|
||||||
className={
|
className={
|
||||||
editNode
|
editNode
|
||||||
? " input-edit-node "
|
? " input-edit-node "
|
||||||
|
|
|
||||||
|
|
@ -539,11 +539,10 @@ export function TabsProvider({ children }: { children: ReactNode }) {
|
||||||
|
|
||||||
const updateEdges = (edges) => {
|
const updateEdges = (edges) => {
|
||||||
edges.forEach((edge) => {
|
edges.forEach((edge) => {
|
||||||
edge.style = { stroke: "inherit" };
|
|
||||||
edge.className =
|
edge.className =
|
||||||
edge.targetHandle.split("|")[0] === "Text"
|
(edge.targetHandle.split("|")[0] === "Text"
|
||||||
? "stroke-gray-800 "
|
? "stroke-gray-800 "
|
||||||
: "stroke-gray-900 ";
|
: "stroke-gray-900 ") + " stroke-connection";
|
||||||
edge.animated = edge.targetHandle.split("|")[0] === "Text";
|
edge.animated = edge.targetHandle.split("|")[0] === "Text";
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,7 @@
|
||||||
--destructive: 0 100% 50%; /* hsl(0 100% 50%) */
|
--destructive: 0 100% 50%; /* hsl(0 100% 50%) */
|
||||||
--destructive-foreground: 210 40% 98%; /* hsl(210 40% 98%) */
|
--destructive-foreground: 210 40% 98%; /* hsl(210 40% 98%) */
|
||||||
--radius: 0.5rem;
|
--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;
|
--round-btn-shadow: #00000063;
|
||||||
|
|
||||||
--error-background: #fef2f2;
|
--error-background: #fef2f2;
|
||||||
|
|
@ -55,6 +54,8 @@
|
||||||
--status-yellow: #eab308;
|
--status-yellow: #eab308;
|
||||||
--status-green: #4ade80;
|
--status-green: #4ade80;
|
||||||
--status-blue:#2563eb;
|
--status-blue:#2563eb;
|
||||||
|
--connection: #555;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark {
|
.dark {
|
||||||
|
|
@ -113,6 +114,8 @@
|
||||||
--status-yellow: #eab308;
|
--status-yellow: #eab308;
|
||||||
--status-green: #4ade80;
|
--status-green: #4ade80;
|
||||||
--status-blue: #2563eb;
|
--status-blue: #2563eb;
|
||||||
|
--connection: #555;
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,8 @@ const ConnectionLineComponent = ({
|
||||||
<path
|
<path
|
||||||
fill="none"
|
fill="none"
|
||||||
// ! Replace hash # colors here
|
// ! Replace hash # colors here
|
||||||
stroke="#222"
|
|
||||||
strokeWidth={1.5}
|
strokeWidth={1.5}
|
||||||
className="animated "
|
className="animated stroke-connection "
|
||||||
d={`M${fromX},${fromY} C ${fromX} ${toY} ${fromX} ${toY} ${toX},${toY}`}
|
d={`M${fromX},${fromY} C ${fromX} ${toY} ${fromX} ${toY} ${toX},${toY}`}
|
||||||
style={connectionLineStyle}
|
style={connectionLineStyle}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -184,11 +184,11 @@ export default function Page({ flow }: { flow: FlowType }) {
|
||||||
addEdge(
|
addEdge(
|
||||||
{
|
{
|
||||||
...params,
|
...params,
|
||||||
style: { stroke: "inherit" },
|
style: { stroke: "#555" },
|
||||||
className:
|
className:
|
||||||
params.targetHandle.split("|")[0] === "Text"
|
(params.targetHandle.split("|")[0] === "Text"
|
||||||
? "stroke-foreground "
|
? "stroke-foreground "
|
||||||
: "stroke-foreground ",
|
: "stroke-foreground ") + " stroke-connection",
|
||||||
animated: params.targetHandle.split("|")[0] === "Text",
|
animated: params.targetHandle.split("|")[0] === "Text",
|
||||||
},
|
},
|
||||||
eds
|
eds
|
||||||
|
|
@ -338,7 +338,8 @@ export default function Page({ flow }: { flow: FlowType }) {
|
||||||
const onSelectionEnd = useCallback(() => {
|
const onSelectionEnd = useCallback(() => {
|
||||||
setSelectionEnded(true);
|
setSelectionEnded(true);
|
||||||
}, []);
|
}, []);
|
||||||
const onSelectionStart = useCallback(() => {
|
const onSelectionStart = useCallback((event) => {
|
||||||
|
event.preventDefault();
|
||||||
setSelectionEnded(false);
|
setSelectionEnded(false);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
@ -410,7 +411,6 @@ export default function Page({ flow }: { flow: FlowType }) {
|
||||||
nodesDraggable={!disableCopyPaste}
|
nodesDraggable={!disableCopyPaste}
|
||||||
panOnDrag={!disableCopyPaste}
|
panOnDrag={!disableCopyPaste}
|
||||||
zoomOnDoubleClick={!disableCopyPaste}
|
zoomOnDoubleClick={!disableCopyPaste}
|
||||||
selectNodesOnDrag={false}
|
|
||||||
className="theme-attribution"
|
className="theme-attribution"
|
||||||
minZoom={0.01}
|
minZoom={0.01}
|
||||||
maxZoom={8}
|
maxZoom={8}
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ module.exports = {
|
||||||
"accordion-up": "accordion-up 0.2s ease-out",
|
"accordion-up": "accordion-up 0.2s ease-out",
|
||||||
},
|
},
|
||||||
colors: {
|
colors: {
|
||||||
|
connection: "var(--connection)",
|
||||||
"almost-dark-gray": "var(--almost-dark-gray)",
|
"almost-dark-gray": "var(--almost-dark-gray)",
|
||||||
"almost-light-blue": "var(--almost-light-blue)",
|
"almost-light-blue": "var(--almost-light-blue)",
|
||||||
"almost-medium-blue": "var(--almost-medium-blue)",
|
"almost-medium-blue": "var(--almost-medium-blue)",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue