Commit Graph

99 Commits

Author SHA1 Message Date
Braks
409a268ddd fix(examples): wrong type added to button-edge
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-24 01:05:03 +01:00
Braks
f4559398f6 fix(examples): interaction example firing events wrong
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-24 00:22:09 +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
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
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
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
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
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
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
1b6ea1e1b5 update: make types for nodes and edges a computed prop
* remove nodeTypesId (was used in react to manually trigger a nodeTypes change)

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-20 03:28:46 +01:00
Braks
6a1571e6e3 fix: Flow not properly pre-loading state
* pass key to initFlow to possibly find a pre-existing state

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-20 00:40:42 +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
ee95fbe34a update(examples): rgb flow styles
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-19 15:41:25 +01:00
Braks
f92c5462bf update: a couple more perfomance related updates
* 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>
2021-11-19 15:41:00 +01:00
Braks
f99dca1c11 update(examples): Use vmodel for custom node
* use v-model for save & restore example

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-19 13:47:09 +01:00
Braks
f534572cef fix!: v-model implemented again
* fix store usage

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-19 02:13:47 +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
156287b9d2 chore(deps): update deps
* replace fast-deep-equal with microdiff
* remove localforage (using useStorage instead)

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-18 15:29:50 +01:00
Braks
6b4cb9e937 update(docs): README.md
* minor updates in zoompane and interaction example

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-17 00:35:21 +01:00
Braks
9b604e7628 fix: pass props to store state
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-16 20:04:00 +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
ffdadda051 update!: Rename Flow container to VueFlow
* Export renamed to VueFlow

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-15 20:34:02 +01:00
Braks
d6ee5f8868 fix: wrong watch source in nodes
* causes console warnings

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-15 12:50:03 +01:00
Braks
482a1aa4af fix(examples): Proper events for listeners
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-15 10:43:58 +01:00
Braks
066155b9f7 feat: copy default theme css file separately to dist
* to enable overwriting the default theme export it separately
* add rollup plugin copy for copying the css file

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-06 15:42:05 +01:00
Braks
412a84a898 update(docs): styling of sidebar and header
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>

update(docs): target server generation

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-06 15:42:05 +01:00
Braks
aaf5f608f5 feat: add path alias for src
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-06 09:38:02 +01:00
Braks
3931a59524 fix(docs): dedupe and add alias for vue
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
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
cb96b1ab00 fix: missing node id in node components/slots 2021-10-22 13:04:33 +02:00
Braks
8779a58bab update(examples): Add validation and zoom pan helper example 2021-10-22 13:03:14 +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
cd32f14a5a update(examples): Add update node example 2021-10-22 11:05:27 +02:00
Braks
0cc7ef4805 update(examples): Add Unidirectional and updatable edge example 2021-10-22 10:46:54 +02:00
Braks
c23bbfaa4a update(examples): Add switch example 2021-10-22 10:00:38 +02:00
Braks
5611f79ea8 update(examples): Add stress example 2021-10-22 10:00:21 +02:00
Braks
3f863ef71c update(examples): Add Save & Restore example
* add localforage to dev deps
2021-10-22 10:00:21 +02:00
Braks
eb9714b898 update(examples): Add Provider example
* Provider example shows usage of store outside of Flow
2021-10-22 10:00:20 +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
26b3901bd5 fix: node not updating handlebounds when handle pos changes
* watch source & target pos and update node dimensions on next tick
2021-10-22 08:16:32 +02:00