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:
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user