Commit Graph
243 Commits
Author SHA1 Message Date
Braks d22e21041d fix(edges): edges not reacting to hidden nodes
* Change getEdges to parse edges with source & target nodes and filter if one of them is missing
* add new type for Edges w sourceTargetNode called GraphEdge which is the return type of getEdges
*

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 18:25:08 +01:00
Braks cddf875b6d feat(types): Add GraphEdge type
* GraphEdges are edges that have been parsed and have a sourceTargetNode property

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 17:46:55 +01:00
Braks 091f3f82c2 update(types): export flowprops and custom connection line props type
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 17:46:28 +01:00
Braks ca46d6a771 update(zoom): when zoom is deactivated we disbale scrolling
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 17:35:40 +01:00
Braks c286b3b7ff fix(flow): preventScrolling missing in props definition
* remove console log from ZoomPane
* Add missing name to VueFlow

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 17:18:35 +01:00
Braks c0f7e5c9e9 update: add scale prop to draggable
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 16:56:16 +01:00
Braks dbe82a718a fix: node selection not working if selectable === undefined
* selectable has to be explicitly false for node selection to skip the node

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 16:17:46 +01:00
Braks 8d08f67ee6 update: remove fallback operator
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 16:17:20 +01:00
Braks 54d5780feb fix: missing props on Draggable
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 16:17:02 +01:00
Braks 67634fd72e feat(connection): Extend connection line props for more advanced usage
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 14:38:49 +01:00
Braks 46ecec5366 feat(options): add preventScrolling option
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 14:12:43 +01:00
Braks 17f7e4b0e7 fix(nodes): dont select nodes when selectable=false closes
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 14:01:02 +01:00
Braks 0e803839d6 feat(BezierEdge): use quadratic bezier curve for top-left and bottom-right edges
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 13:58:20 +01:00
Braks 9ec1c4dc2b fix: remove deep flag from elements and store-elements watcher
* deep watching causes a reset after positions change
* fallback to non-worker parsing

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 13:55:41 +01:00
Braks d87388fbe6 fix: connection line position incorrectly calculated
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 13:00:29 +01:00
Braks 0dd5ed7836 fix(types): edge text type
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 21:38:31 +01:00
Braks 0b57ee167e refactor: remove node/edge-renderer slots
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 17:42:00 +01:00
Braks c7dca2cbd0 refactor: change prop types for NodeWrapper
* don't split node prop into smaller ones

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 17:33:12 +01:00
Braks f86033c1e8 refactor: change prop types for EdgeWrapper
* don't split edge prop into smaller ones

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 17:25:25 +01:00
Braks b9bb3cfb1a update(types): remove null types and use undefined
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 17:14:57 +01:00
Braks fec38a129a fix!: prop typings
* remove wrapper exports from library

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 15:49:27 +01:00
Braks 4932c64d52 update: define emittable events for EdgeWrapper
* add onEdgeUpdateEnd callback to useHandle

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 15:13:46 +01:00
Braks 1ea6e4f8da update: pass selected elements as prop to nodesselection
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 14:22:35 +01:00
Braks 5c3a1fba13 update: remove useStore from handle
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 14:22:11 +01:00
Braks 049b701580 update: use controlledComputed for edges/nodes
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 14:10:49 +01:00
Braks 2b065b4e56 update: pass store state as props to edge-renderer and edge
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 13:40:25 +01:00
Braks ebd0f9e738 update!: Remove renderer exports
* 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>
2021-11-22 12:26:47 +01:00
Braks 6059b02e44 update: Pass down values as props instead of relying on store
* 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>
2021-11-22 12:25:32 +01:00
Braks c35673c622 refactor: pass props to edge/nodewrapper separately
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 01:22:27 +01:00
Braks a55e33f91f feat: add draghandle prop to node
* specify a drag handle on the node

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 21:50:49 +01:00
Braks b10207021f refactor(types)!: Change ConnectionLineComponentProps to ConnectionLineProps
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 19:05:24 +01:00
Braks 3e4433c175 fix: skip dimensions check when ssr
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 18:48:24 +01:00
Braks f64ae24ee2 update: Add name to flow component
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 18:20:51 +01:00
Braks 502be52572 update: add hmr to statestore
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 18:20:03 +01:00
Braks a67e6c4430 fix: minimap prop type missing
* cant import stringfunc type (string literal and all...)

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 18:19:43 +01:00
Braks c48a0a9e2a fix: add missing click and doubleclick events to nodes/edges
* ssr bug

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 18:19:06 +01:00
Braks fd71e1e16e update: Add names to components
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 16:54:59 +01:00
Braks d24de0c0c2 update: move component related types to component-type file
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 16:54:24 +01:00
Braks 062aee45b2 update!: graphnode and node typing
* 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>
2021-11-21 16:25:27 +01:00
Braks ba24f3ca62 update(edges): useAttrs on edges to use style
* remove class and style props, pass them as attrs

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 13:33:59 +01:00
Braks e4ead738c9 update(types): Correct __vf typing
* fix all uses of __vf so the actual type works properly
* correct the class and style props

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 13:33:12 +01:00
Braks 0e9f8c5fc2 refactor: rename internal data field to __vf
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 12:54:04 +01:00
Braks 71ba905348 fix: zoom values being initialized before zoom is ready
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 12:49:44 +01:00
Braks da29a613f0 feat(slots): Add node and edge renderer slots
* 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>
2021-11-21 12:34:28 +01:00
Braks 39b21faa5b refactor(types)!: Remove elements prop, change EdgeTypes/NodeTypes prop to string[]
* 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>
2021-11-20 22:10:25 +01:00
Braks 0a1c2d4ede update: some comments
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-20 20:11:33 +01:00
Braks e648e1a179 feat: make worker optional
* worker can be enabled with prop, defaults to false
* add deep unref function

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-20 19:56:35 +01:00
Braks 668fed1dc4 feat: Add dedicated default loading component
* add option to pass a transition name

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-20 18:22:30 +01:00
Braks 4e8ff6201a feat: Add loading indicator slot and prop
* 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>
2021-11-20 17:33:27 +01:00
Braks d335944e56 feat: offload parsing elements to worker
* 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>
2021-11-20 16:22:31 +01:00