This commit is contained in:
anovazzi1 2023-10-31 18:20:39 -03:00 • committed by GitHub
commit 002eb97b66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 360 additions and 324 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
import { AxiosError } from "axios"; import { AxiosError } from "axios";
import _ from "lodash"; import _, { cloneDeep } from "lodash";
import { import {
ReactNode, ReactNode,
createContext, createContext,
@ -428,6 +428,7 @@ export function TabsProvider({ children }: { children: ReactNode }) {
id: source, id: source,
}); });
sourceHandleObject.id = source; sourceHandleObject.id = source;
edge.data.sourceHandle = sourceHandleObject; edge.data.sourceHandle = sourceHandleObject;
const targetHandleObject: targetHandleType = scapeJSONParse( const targetHandleObject: targetHandleType = scapeJSONParse(
edge.targetHandle! edge.targetHandle!
@ -452,6 +453,7 @@ export function TabsProvider({ children }: { children: ReactNode }) {
sourceHandle, sourceHandle,
targetHandle, targetHandle,
id, id,
data: cloneDeep(edge.data),
style: { stroke: "#555" }, style: { stroke: "#555" },
className: className:
targetHandleObject.type === "Text" targetHandleObject.type === "Text"
@ -508,7 +510,8 @@ export function TabsProvider({ children }: { children: ReactNode }) {
let data = flow?.data ? flow.data : null; let data = flow?.data ? flow.data : null;
if (data) { if (data) {
processFlowEdges(flow); processFlowEdges(flow);
processFlowNodes(flow); //prevent node update for now
// processFlowNodes(flow);
//add animation to text type edges //add animation to text type edges
updateEdges(data.edges); updateEdges(data.edges);
// updateNodes(data.nodes, data.edges); // updateNodes(data.nodes, data.edges);

View file

@ -310,7 +310,6 @@ export default function Page({
event.dataTransfer.getData("nodedata") event.dataTransfer.getData("nodedata")
); );
// If data type is not "chatInput" or if there are no "chatInputNode" nodes present in the ReactFlow instance, create a new node
// Calculate the position where the node should be created // Calculate the position where the node should be created
const position = reactFlowInstance!.project({ const position = reactFlowInstance!.project({
x: event.clientX - reactflowBounds!.left, x: event.clientX - reactflowBounds!.left,

View file

@ -981,7 +981,8 @@ export function expandGroupNode(
gNodes[nodeIndex].data.node!.template[field].show = show; gNodes[nodeIndex].data.node!.template[field].show = show;
gNodes[nodeIndex].data.node!.template[field].advanced = advanced; gNodes[nodeIndex].data.node!.template[field].advanced = advanced;
gNodes[nodeIndex].data.node!.template[field].display_name = display_name; gNodes[nodeIndex].data.node!.template[field].display_name = display_name;
gNodes[nodeIndex].selected = false; // keep the nodes selected after ungrouping
// gNodes[nodeIndex].selected = false;
if (proxy) { if (proxy) {
gNodes[nodeIndex].data.node!.template[field].proxy = proxy; gNodes[nodeIndex].data.node!.template[field].proxy = proxy;
} else { } else {