* Slot remains, but default built-in renderer isn't part of the library export
* If a custom renderer is desired, a slot can be used to implement one
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* store values are passed down by main vue flow component
* store is only used to emit events or if really necessary in the component
* add keys with store id to elements
*
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* graphnode is a node containing internal Vue Flow data
* move util files to util directory
* move flow actions type into store file
* rename panel type file to zoom
* rename types file to flow
* Rename Node to NodeWrapper
* Rename Edge to EdgeWrapper
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* more flexibility by having the ability to use the node/edge-renderer and wrapper
* export renderer and wrapper from lib entry
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* no more elements prop - v-model instead!
* Instead of passing an object map to components just pass in an array of strings as nodeTypes/edgeTypes object
* the string name will either be resolved to a dynamic component with :is="type" or a slot with the type-name
* update all examples
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* While the graph is suspended we open up a loading indicator slot
* a prop option has to be passed to enable the indicator
* add some styles for a default loading text
* move loading event to after store has been initialized *and* zoom pane dimensions are present
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* when we're not in ssr environment we use a web worker to parse the elements as this blocks the main thread when there's a good amount of nodes/edges to parse
* when in ssr we don't really care about the main thread blocking so we just parse them like usual
* update vite to latest
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* move invoke to vueflow to suspend
* await dimensions in Node/Edge-wrapper components
* await nodes/edges in renderer
* await elements in VueFlow
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* if options are passed to useVueFlow, we want to merge them with possibly passed props
* renamed flowStore to stateStore
* fix examples
* add store prop to pass an already existing store to flow
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* check for selected value inside Node instead of the wrapping renderer
* instead of "parsing" elements just return the current store.elements object
* use map funct to find index
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* "disables" warnings about injection not being found
* we assume that the injection can be undefined, so we don't need to be spammed about missing injections
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* add vmodel for elements and a new modelValue prop (which should replace the elements prop further along the road to avoid confusion)
*
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* Add getter for node/edge types
* change nodeTypes prop type to only Record<string, NodeType> - same for edges
* Add rgb example
* remove v-model for elements
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* For easier access and to avoid context issues with injections hooks are put into the store
* hooks can be accessed and will emit events when the flow has bound its emit function to the hooks
* useHooks and useStore are not exported anymore! Instead, useVueFlow is provided, which will return an instance of the current vue flow store
* Rename NodeIdContextKey to NodeId
* Add addElements function to store to add elements without having to re-set the whole store
* use v-model for elements, re-set elements only if there's an actual change
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* Allows for use of the vue flow instance without having to listen to the onLoad event
* fix usekeypress export
* Add types for controls events
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>