feat(ui): migrate add node popover to cmdk

Put this together as a way to figure out the library before moving on to the full app cmdk. Works great.
This commit is contained in:
psychedelicious
2024-08-28 21:32:10 +10:00
parent 2adffc84d4
commit d558aefcc7
9 changed files with 755 additions and 291 deletions

View File

@@ -2,9 +2,9 @@ import { useStore } from '@nanostores/react';
import { useAppStore } from 'app/store/storeHooks';
import { $mouseOverNode } from 'features/nodes/hooks/useMouseOverNode';
import {
$addNodeCmdk,
$didUpdateEdge,
$edgePendingUpdate,
$isAddNodePopoverOpen,
$pendingConnection,
$templates,
edgesChanged,
@@ -107,7 +107,7 @@ export const useConnection = () => {
$pendingConnection.set(null);
} else {
// The mouse is not over a node - we should open the add node popover
$isAddNodePopoverOpen.set(true);
$addNodeCmdk.set(true);
}
}, [store, templates, updateNodeInternals]);