chore(core): cleanup
This commit is contained in:
@@ -13,7 +13,7 @@ import { useNodeId } from './useNodeId'
|
|||||||
* Meaning if you do not provide an id, this composable has to be called in a child of your custom node component, or it will throw
|
* Meaning if you do not provide an id, this composable has to be called in a child of your custom node component, or it will throw
|
||||||
*/
|
*/
|
||||||
export function useNode<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>(id?: string) {
|
export function useNode<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>(id?: string) {
|
||||||
const nodeId = id ?? useNodeId()
|
const nodeId = id ?? useNodeId() ?? ''
|
||||||
const nodeEl = inject(NodeRef, ref(null))
|
const nodeEl = inject(NodeRef, ref(null))
|
||||||
|
|
||||||
const { findNode, edges, emits } = useVueFlow()
|
const { findNode, edges, emits } = useVueFlow()
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export enum ErrorCode {
|
|||||||
const messages = {
|
const messages = {
|
||||||
[ErrorCode.MISSING_VIEWPORT_DIMENSIONS]: () => 'The Vue Flow parent container needs a width and a height to render the graph',
|
[ErrorCode.MISSING_VIEWPORT_DIMENSIONS]: () => 'The Vue Flow parent container needs a width and a height to render the graph',
|
||||||
[ErrorCode.NODE_INVALID]: (id?: string) => `Node is invalid\nNode: ${id}`,
|
[ErrorCode.NODE_INVALID]: (id?: string) => `Node is invalid\nNode: ${id}`,
|
||||||
[ErrorCode.NODE_NOT_FOUND]: (id: string) => `Node not found\nNode: ${id}`,
|
[ErrorCode.NODE_NOT_FOUND]: (id: string | null) => `Node not found\nNode: ${id}`,
|
||||||
[ErrorCode.NODE_MISSING_PARENT]: (id: string, parentId: string) => `Node is missing a parent\nNode: ${id}\nParent: ${parentId}`,
|
[ErrorCode.NODE_MISSING_PARENT]: (id: string, parentId: string) => `Node is missing a parent\nNode: ${id}\nParent: ${parentId}`,
|
||||||
[ErrorCode.NODE_TYPE_MISSING]: (type: string) => `Node type is missing\nType: ${type}`,
|
[ErrorCode.NODE_TYPE_MISSING]: (type: string) => `Node type is missing\nType: ${type}`,
|
||||||
[ErrorCode.NODE_EXTENT_INVALID]: (id: string) => `Only child nodes can use a parent extent\nNode: ${id}`,
|
[ErrorCode.NODE_EXTENT_INVALID]: (id: string) => `Only child nodes can use a parent extent\nNode: ${id}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user