Commit Graph
100 Commits
Author SHA1 Message Date
Braks 65d079db20 feat: use a storage class to map flow instances
* improves cleanup of instances
2022-03-23 06:47:57 +01:00
Braks 11da181d0f v0.4.0-7 2022-03-16 16:08:01 +01:00
Braks dcd2ec471e update: Remove useWindow export 2022-03-16 16:06:42 +01:00
Braks 05929299d3 refactor(zoom): Move paneReady event to transformation pane mounted hook
* await dimensions in fitView function
2022-03-16 16:02:26 +01:00
Braks 93e3d8b84f v0.4.0-6 2022-03-14 21:28:27 +01:00
Braks 6729588504 update: remove exports field 2022-03-14 21:25:32 +01:00
Braks 79bac64cc9 v0.4.0-5 2022-03-14 20:43:07 +01:00
Braks c70c816f4b chore: update auto-imports.d.ts 2022-03-14 20:42:30 +01:00
Braks ac9f380d15 update: fix export order 2022-03-14 20:23:35 +01:00
Braks f3b1c5e79a v0.4.0-4 2022-03-14 18:28:40 +01:00
Braks c21ac7dca4 feat(docs): Add comments to types 2022-03-14 18:20:58 +01:00
Braks 3b8c49e654 feat(theme): use postcss to parse default theme into a simple css file 2022-03-14 15:07:12 +01:00
Braks 25e5b92843 feat(docs): Add typedoc 2022-03-14 14:10:38 +01:00
Braks 2fa7e22b5f feat(background): Allow background height/width to be set
* allow for bgColor to be set
* allow for no pattern to be used
2022-03-14 14:10:38 +01:00
Braks d948f5eef4 feat(zoom): Allow zoomOnScroll & panOnScroll to be used without an activation key
* activation key is undefined by default, if undefined key is always "pressed"
2022-03-14 14:10:38 +01:00
Braks 9317f786b3 update(examples): Use Shift for panOnScroll on Windows OS 2022-03-12 18:38:30 +01:00
Braks afaa038584 fix(zoom): prevent zoom when zoomOnScroll is disabled 2022-03-12 18:28:35 +01:00
bcakmakoglu e4e5e67687 v0.4.0-3 2022-03-08 18:45:05 +01:00
bcakmakoglu 40bb91f608 update(store): deprecare setElements action
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 18:44:14 +01:00
bcakmakoglu fd951e8bb8 fix(zoom): fitViewOnInit not passed to zoomPane
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 17:29:29 +01:00
bcakmakoglu 994b403089 feat(edges): allow markers to have unique id
* fix overwriting by spreading marker def

Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 17:11:54 +01:00
bcakmakoglu c31deb897d update(edges): filter edges of hidden nodes
* we don't want to show edges that go seemingly nowhere

Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 16:34:50 +01:00
bcakmakoglu 46a63c29aa fix(store): updateEdge action not fully updating an edge
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 16:10:33 +01:00
bcakmakoglu b7c19547f2 fix(edges): edge text height not centered
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 15:40:17 +01:00
bcakmakoglu 743b0bd004 feat: Add names (node-types as name) to minimap node slots
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 15:35:51 +01:00
bcakmakoglu 4f42fd0e6b fix(edges): edge text not aligning to center
* use scaling to properly align edge labels and bg width
* remove getMarkerEnd util, replaced by getMarkerId or just using the actual prop markerEnd/markerStart

Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 15:35:24 +01:00
bcakmakoglu cd2b89828d update(edges): remove scope dispose from useHandle
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 12:58:06 +01:00
bcakmakoglu 300886c8b1 update: remove copy plugin
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 12:29:23 +01:00
bcakmakoglu ac6f62f0a3 update(flow): deprecate modelValue prop
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 12:08:25 +01:00
bcakmakoglu 6746d6bb46 fix(flow): fix typo in paneMovable prop
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 12:07:57 +01:00
bcakmakoglu 158f81d5e5 update(examples): unidirectional example
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 11:06:45 +01:00
bcakmakoglu 36ac64f054 refactor: add default theme to style.css
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 08:49:45 +01:00
bcakmakoglu 1def3a9fb3 fix(edges): Markers not displayed
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 08:47:14 +01:00
bcakmakoglu 2bb3ecbe73 feat(nodes): Add nodeElement as Prop to Nodes
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-07 12:57:44 +01:00
bcakmakoglu 0c5e4a47aa v0.4.0-2 2022-02-22 10:38:05 +01:00
bcakmakoglu 6e5c58fcae refactor: Remove link from deps
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-22 10:35:38 +01:00
bcakmakoglu 776000ccf1 v0.4.0-1 2022-02-21 20:28:48 +01:00
bcakmakoglu a9b1b1ad6d chore: update yarn.lock
* add settings.json

Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:27:30 +01:00
bcakmakoglu 17561604b6 fix(nodes): clear all empty values before passing as props
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu fe31112c5a chore: fix tsconfig
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu b51c26f6bb update: Add tsconfig.build.json
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu b7abb31c24 chore: couple minor fixes
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu 3518e1dab2 chore: update yarn.lock
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu c5b39d4588 feat: try to dispose states on unmount
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu d835e4546c update: add missing property to store
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu a3b2348ea7 update: use prop for fitViewOnInit
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu bd36dee54c chore: tsconfig dev
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu 54e8301ddb refactor: use dist pkg for examples
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu 8260eabc58 fix: typings for UseVueFlow
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu 78c58688a2 feat(examples): Add OptionsAPI example
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu ae3cb8f80c chore(deps): update deps
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu 2731d0bf5e fix: typings for UseVueFlow
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu f44784b1d0 chore: fix examples
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
Braks ca85d8002e refactor(flow)!: Remove useElementsState utility
* to avoid confusion and duplicates remove the useElementsState utilities
* move functionality to store actions

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
Braks 16997494ab update(zoom): set store instance before emitting pane-ready event
* add missing generics on getters
* replace ? notation with undefined (does not mean the exact same, i.e.
`instance?: FlowInstance` will become `Ref<FlowInstance | undefined> | undefined`
using `instance: FlowInstance | undefined` results in `Ref<FlowInstance | undefined>`

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
Braks 082bc51599 v0.4.0-0 2021-12-20 19:37:58 +01:00
Braks 124338b8d4 update(examples): correct examples
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks dcbe9865e9 refactor(flow): remove defaults for props
* defaults are set by store
* use watcher immediate trigger only if prop exists

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks fbe62b9ab9 fix(nodes): watch parent nodes deeply to trigger xyz-pos calculation
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 0e82420142 fix(nodes): correctly calculate xyzpos from parent
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 983c86c938 fix(edges): Handles emitting connect and update simulteanously
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 2910731c3b refactor(flow): set elements when initializing store
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks f2fe93f1db update(edges): use computed getters to group edges by z-level
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks c28376950d refactor(flow)!: make opts for useElementsState optional
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 8fbfca1e7a refactor(edges)!: Replace getMarkerEnd utility with getMarkerId
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 35165c3a98 refactor: make nodes/edges for useStates helpers optional
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks a9e7eb31ea feat(flow): Narrow options type for useNodesState/useEdgesState/useElementsState
* remove storageKey
* make modelValue optional

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks ee6bf3252e refactor(flow): Watch models
* replace model value after re-setting elements/nodes/edges

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 5457106905 refactor(store): remove setting elements without parsing in state
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks df17da71fa update: remove v-if on edge-renderer
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 4c7cf39e7b refactor(flow): add options to useElementsState
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks d2ac41e4f7 update: correctly overwrite nodes on re-parsing
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 7367345d8d update: v-if on node/edgerenderer
* add applyDefault to state

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 445718d6f4 update(examples): correct examples
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks b12863f297 refactor(flow): lowercase event names (OnPaneLoad -> onPaneLoad)
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 425fc500b0 fix: selection changes overwriting itself
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks a76e2cacf4 update: use draggablecore for nodes selection
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks f0f68ff63f update: add key to NodesSelection.vue
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 7736915720 feat(flow): Add state as refs, getters and actions to vueFlow object for easier access
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks e64f6b7bc6 update(types)!: Rename FlowActions/FlowGetters etc. to Actions, Getters
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks a62a891243 update(nodes): Remove computed properties in nodes selection
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 8f6ce13226 update(nodes, edges): watch source/target pos to update position so edges get properly re-rendered
* use standard computed for source/target pos in edges

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 212c91107f update(types): Use node/edge component type to define defaults
* import handleprops from types
*

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 947baefa02 update(nodes): Add draggable,selectable and connectable as props to nodes
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks e91188de5c feat(edges): add selectable option to edges
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 69dc45c3be update(examples): fix examples
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 8118325d4e refactor(edges): Disable connecting handles inside the same node
* Disable connecting a nodes source handle with its own target handle
* disable emitting connections when node is not connectable

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks e2e094b987 feat(flow): Add option to disable default change handlers globally
* overwrites applyDefault setting for useEdgeState/useNodeState/useElementsState
* export apply change handlers

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 423f6aa78d refactor(flow): remove separate apply changes function and add them to useNodesState useEdgesState
* immedatiely execute props watcher

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 25b64fe3a7 fix(types): shims overwriting component internal instance type
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 5139b0786b update(examples): correct examples
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 994dd9929c feat(flow): export applychanges utilities separately
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 39501d0bb0 refactor(flow): export useNodesState and useEdgesState separately from useVueFlow
* bind vueFlow instance to currentInstance when useVueFlow is called multiple times in a single setup call

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 63bf3b3a26 fix(tests): properly set store
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks bb91ab711b fix(tests): check if state initialized
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks b9a417a629 chore: remove unused imports
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 535f7e60f2 fix(flow): re-set elements if elements are empty and modelValue contains els
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 304e8f5423 fix(tests): import path of initial state helper
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 1b206c942c feat(edges): Add source-target-pos to graph-edge
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 600e3866c4 fix: replace store id with flow id
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00