Commit Graph
67 Commits
Author SHA1 Message Date
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 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 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 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 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 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 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 6a68292f7c feat: merge store with props
* 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>
2021-11-19 23:45:39 +01:00
Braks 37388ddf47 feat(types): Add NodeTypes and EdgeTypes
* Interface for passing an object of NodeTypes/EdgeTypes
* Object needs to be passed with components markedRaw

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-19 17:47:57 +01:00
Braks 054e71a609 feat: Add instance to store
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-19 13:46:37 +01:00
Braks 70b077a1f5 fix!: props and composable not merging together properly
* 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>
2021-11-19 01:43:07 +01:00
Braks 470ab3782a update: remove useHooks usage
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-18 23:17:09 +01:00
Braks 99dbd4b2cc feat!: Add hooks to store
* 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>
2021-11-18 21:24:20 +01:00
Braks 6c2bdcdae6 fix(types): remove sourceX/Y, targetX/Y attributes from edge type
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-16 17:55:14 +01:00
Braks 413c7ac688 update(types!): Merge EdgeProps into Edge type
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-16 17:45:01 +01:00
Braks 490983bebe fix: todo in useHandle
* edge update end only emits the mouse event, not the edge

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-16 13:04:55 +01:00
Braks 7c66cf5d9b update!: Remove update node internals composable
* It's practically useless as vue doesn't need the trigger to catch a re-render
* Remove unused types

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-16 12:58:16 +01:00
Braks d1dab4cda8 feat: Extend options to pass custom nodes / edges
* Accept either a Record<string, Component | boolean> or string[] as nodetypes option
* If bool / string is used a slot will be expected, otherwise no node/edge will be rendered

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-16 09:43:17 +01:00
Braks 61779638ac update(dist): Remove rollup and use vite to build lib
* Remove custom tsconfig paths to avoid resolving issues on published package
2021-11-06 08:54:35 +01:00
Braks 64df75d405 feat(docs): Initial commit for docs in nuxt 3 2021-11-06 08:54:35 +01:00
Braks 6ec8258f33 fix: typings 2021-10-22 14:29:27 +02:00
Braks babcbd0e1f update: Flow instance provides update node internals func
* Rename onLoadParams to FlowInstance
* Pass update node internals to instance
2021-10-22 12:39:55 +02:00
Braks 3ee3843af6 fix: Edge updates not triggering properly
update(types): Add FlowEvents type
2021-10-22 10:46:12 +02:00
Braks 3f863ef71c update(examples): Add Save & Restore example
* add localforage to dev deps
2021-10-22 10:00:21 +02:00
Braks 0a45e09c32 feat: Add node/edge types id
* ID can be used to switch between different types of nodes/edges
* Add example
2021-10-22 08:49:53 +02:00
Braks 20e9d1d396 update: fix names 2021-10-21 17:42:33 +02:00
Braks cd02dd0444 fix: node type change not triggering recalculation of node dimensions 2021-10-21 16:23:23 +02:00
Braks ca2901bc01 fix: zoom pan helper not being initialized timely 2021-10-21 13:46:15 +02:00
Braks 77d2e01fc0 update: types
* Add elements to flowoptions type
* add window interface to custom shims
2021-10-21 00:24:59 +02:00
Braks 5f500bca18 fix: store actions blocking main thread
* map function overwriting nodes causes main thread to be blocked
* instead use splice
2021-10-20 23:46:47 +02:00
Braks b2b1fe822f feat: add useStore and useHooks composables that provide default store/hooks 2021-10-20 22:39:54 +02:00
Braks 61dc9dea33 fix: edges and edge anchors not re-calculating correctly 2021-10-20 22:39:54 +02:00
Braks 9d9a90e9a7 update: Add slots to CustomConnectionLine.vue, Edge.vue, Node.vue 2021-10-20 22:39:54 +02:00
Braks 6cfe5f6d43 chore(deps): remove unused deps
* update deps
* some ts fixes
2021-10-20 22:39:54 +02:00
Braks c3fb3cd10a fix: zoom pan helper 2021-10-20 22:39:54 +02:00
Braks a895853b64 update: Add injection keys 2021-10-20 22:39:54 +02:00
Braks 6b4e7ab3ce fix: Minimap 2021-10-20 22:39:54 +02:00
Braks 1ff3a8dc9c update(script-setup): Refactor additional-components
* Remove jsx files

fix: ConnectionLine.vue not recalculating properly
2021-10-20 22:39:54 +02:00
Braks 560bdc203b update(script-setup): Refactor remaining files to script setup style 2021-10-20 22:39:54 +02:00
Braks 9307c9066a feat: script setup style
* Replace jsx with script setup syntax
* Simplify logic and make it more "composable"
    * Move Zoom functions to useZoom composable
* Update eslint config & tsconfig
2021-10-20 22:39:54 +02:00
Braks 3557284a40 refactor(types): Split types into separate files
* for better organization split typings into separate files
* use index as barrel file
2021-10-20 22:39:54 +02:00
Braks 77eac0c12a chore(lint): Update eslint rules
* Remove semi
2021-10-20 22:39:54 +02:00
Braks 3b5857febb fix: typecast edges and nodes
* make GraphView props all required
refactor: renamed "NodesTypeType" to "NodeType" and "EdgesTypeType" to "EdgeType"
2021-08-08 19:28:45 +02:00
Braks 1d542aba65 refactor: back to jsx 🥇 2021-08-08 19:28:45 +02:00