feat(editor): Add initial code for NodeView and Canvas rewrite (no-changelog) (#9135)

Co-authored-by: Csaba Tuncsik <csaba.tuncsik@gmail.com>
This commit is contained in:
Alex Grozav
2024-05-23 11:42:10 +03:00
committed by GitHub
parent 8566301731
commit 70948ec71b
49 changed files with 4208 additions and 21 deletions

View File

@@ -195,6 +195,7 @@ export const useUIStore = defineStore(STORES.UI, {
// This enables us to set a queue of notifications form outside (another component)
// and then show them when the view is initialized
pendingNotificationsForViews: {},
isCreateNodeActive: false,
}),
getters: {
appliedTheme(): AppliedThemeOption {

View File

@@ -305,6 +305,13 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, () => {
return workflow.value.nodes.map((node) => ({ ...node }));
}
function setNodePosition(id: string, position: INodeUi['position']): void {
const node = workflow.value.nodes.find((n) => n.id === id);
if (!node) return;
setNodeValue({ name: node.name, key: 'position', value: position });
}
function getWorkflow(nodes: INodeUi[], connections: IConnections, copyData?: boolean): Workflow {
const nodeTypes = getNodeTypes();
let cachedWorkflowId: string | undefined = workflowId.value;
@@ -1588,5 +1595,6 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, () => {
resetChatMessages,
appendChatMessage,
checkIfNodeHasChatParent,
setNodePosition,
};
});