31 KiB
@xyflow/svelte
0.1.35
Patch Changes
-
#5158
06696060Thanks @dimaMachina! - Fix typo in TSDoc commentsReact Flow->Svelte Flow -
Updated dependencies [
02a3b746,cbe305e1,1f671bd4,aaebc462,6ec942fc]:- @xyflow/system@0.0.55
0.1.34
Patch Changes
-
#5139
89de9ca8Thanks @dimaMachina! - Usergbafor colors with opacity instead ofrgbforMiniMapmask color -
Updated dependencies [
f819005b,24a1bc89,36657cd6,89de9ca8,2ac6e155,f0f378e5]:- @xyflow/system@0.0.54
0.1.33
Patch Changes
- #5124
b76f7f9eThanks @bjornosal! - Export NodeConnection type
0.1.32
Patch Changes
-
#5059
065ff89dThanks @bcakmakoglu! - Prevent onPaneClick when connection is in progress. Closes #5057 -
#5067
cb685281Thanks @peterkogo! - Fix fitView not working immediately after adding new nodes -
#5093
65825e89Thanks @moklick! - Hidden nodes are not displayed in the mini map anymore -
Updated dependencies [
5d15b01b,cb685281,a79f30b3]:- @xyflow/system@0.0.53
0.1.31
Patch Changes
-
#5019
3e80317cThanks @dimaMachina! - Add"./package.json" to theexports` field so that users can import it -
Updated dependencies [
99dd7d35]:- @xyflow/system@0.0.52
0.1.30
Patch Changes
-
#5010
6c121d42Thanks @moklick! - Add more TSDocs to components, hooks, utils funcs and types -
Updated dependencies [
6c121d42,4947029c,e8e0d684]:- @xyflow/system@0.0.51
0.1.29
Patch Changes
-
#4957
fe843982Thanks @peterkogo! - Narrow properties selected, selectable, deletable, draggable of NodeProps type to be required. -
Updated dependencies [
fe843982,e73ef09f]:- @xyflow/system@0.0.50
0.1.28
Patch Changes
-
#4949
592c7eafThanks @peterkogo! - Fix useNodeConnection hook not returning all connected edges. -
Updated dependencies [
592c7eaf]:- @xyflow/system@0.0.49
0.1.27
Patch Changes
-
#4937
9d940300Thanks @jrmoynihan! - Expose props of Controls -
#4947
868aa3f3Thanks @moklick! - Export ResizeControlVariant correctly as a value. -
#4880
e2d849dcThanks @crimx! - Add type check for all event targets -
#4725
e10f53cfThanks @peterkogo! - Add useNodeConnections hook to track all connections to a node. Can be filtered by handleType and handleId. -
Updated dependencies [
e2d849dc,e10f53cf,4947f683]:- @xyflow/system@0.0.48
0.1.26
Patch Changes
- #4897
c6890512Thanks @peterkogo! - Freeze required @svelte-put/shortcut version to 3.1.1 to prevent breaking of key inputs.
0.1.25
Patch Changes
-
#4865
2c4acc2bThanks @moklick! - Add group node to BuiltInNode type. Thanks @sjdemartini! -
#4877
9a8309daThanks @peterkogo! - Fix intersections for nodes with origins other than [0,0]. Thanks @gmvrpw! -
Updated dependencies [
d60331e6]:- @xyflow/system@0.0.47
0.1.24
Patch Changes
-
#4790
2fa9a920Thanks @peterkogo! - Fix node dragging & resizing while zooming on flow that does not cover whole browser window. -
#4782
323e1b35Thanks @peterkogo! - Fix node intersections in nested flow. -
Updated dependencies [
2fa9a920,323e1b35]:- @xyflow/system@0.0.46
0.1.23
Patch Changes
-
#4772
7f670ab0Thanks @mistic! - Splits exports field in package.json to support an explicit resolution for browser, node and default to resolve issues with webpack esm module resolution. -
Updated dependencies [
7f670ab0]:- @xyflow/system@0.0.45
0.1.22
Patch Changes
-
#4730
2c590b90Thanks @peterkogo! - Fixed rare crash while dragging -
#4758
e555bd1bThanks @peterkogo! - Bump Svelte peer dependency to 5.0.0 -
Updated dependencies [
005ae1c0,2c590b90]:- @xyflow/system@0.0.44
0.1.21
Patch Changes
- #4718
51f08aacThanks @peterkogo! - Fixed hook useNodesData unexpectedly returning undefined
0.1.20
Patch Changes
-
#4670
b056564cThanks @peterkogo! - Fix initialfitViewnot working correctly fornodeOriginother than [0,0] -
#4670
b056564cThanks @peterkogo! - ImprovefitViewto respect clamped node positions based onnodeExtent -
#4653
02390f99Thanks @bcakmakoglu! - Calculate viewport dimensions infitViewinstead of using stored dimensions. Fixes #4652 -
Updated dependencies [
99ba64ac,b056564c]:- @xyflow/system@0.0.43
0.1.19
Patch Changes
-
#4477
d5592e75Thanks @peterkogo! - AddgetNodesBoundstouseReactFlow/useSvelteFlowhook as the new recommended way of determining node bounds. -
#4572
1445e148Thanks @peterkogo! - Add nodeExtent prop to<SvelteFlow />. You can now restrict nodes from leaving a specified extent. -
#4572
d9563505Thanks @peterkogo! - Improve handling of global and individualnodeExtents. Nodes will never render outside of specified extents. -
Updated dependencies [
d5592e75,d9563505]:- @xyflow/system@0.0.42
0.1.18
Patch Changes
-
#4611
2aaa709cThanks @moklick! - make onViewportChange a dynamic prop -
Updated dependencies [
2aaa709c]:- @xyflow/system@0.0.41
0.1.17
Patch Changes
-
#4574
b65aed19Thanks @bcakmakoglu! - AddgetHandleConnectionshelper touseReactFlow&useSvelteFlow -
Updated dependencies [
5138d90b,12dbe125]:- @xyflow/system@0.0.40
0.1.16
Patch Changes
-
#4568
c3e62782Thanks @peterkogo! - Only display grab cursor when panOnDrag is on left mouse button -
#4569
54bfb6d9Thanks @peterkogo! - Fix getIntersectingNodes for subflows -
Updated dependencies [
c3e62782]:- @xyflow/system@0.0.39
0.1.15
Patch Changes
-
#4510
12313a5bThanks @bcakmakoglu! - RenameisConnectableprop locally toisConnectablePropto avoid naming collision with derived value ofisConnectablein<Handle>component. -
#4517
085951bcThanks @ghostdevv! - fix: make svelte-preprocess a dev dep -
#4549
99733c01Thanks @moklick! - feat(onConnectEnd): pass connectionState param -
Updated dependencies [
b63a3734,24e87e39,692e6440,559d4926,4ecfd7e1,e7ef328f,99733c01]:- @xyflow/system@0.0.38
0.1.14
Patch Changes
- #4498
7a6e9e30Thanks @peterkogo! - fix(pane) only capture pointer after a valid selection has started, fixes #4492
0.1.13
Patch Changes
0.1.12
Patch Changes
-
#4446
80baf53bThanks @moklick! - fix(resizer): export types -
Updated dependencies [
80baf53b,4cccd06a]:- @xyflow/system@0.0.36
0.1.11
Patch Changes
-
#4434
1bda2451Thanks @moklick! - fix(selection): handle pointer capture for selectionOnDrag -
Updated dependencies [
d2da5765]:- @xyflow/system@0.0.35
0.1.10
- add
paneDistanceClickprop (max distance between mousedown/up that will trigger a click) - returned nodes in
on:nodedragstopare set todragging=false
0.1.9
- return Promises for
setViewport,fitView,fitBoundsandzoomToto be able to await viewport update
0.1.8
useConnectionreturnsConnectionStatewithtoNodeandtoHandle- node origin is part of position absolute
- refactor connection handling
0.1.7
- revise selection usability (capture while dragging out of the flow)
- only prevent shift scrolling when selection is actually in progress
- use correct end handle position when drawing a connection lines
- determine correct end positions for connection lines
0.1.6
- fix node origin bug
0.1.5
- prevent zooming on mobile if zoomOnPinch is false
- add straight edge to path built-in-types
- abort drag when multiple touches are detected
- fix merge_styles error
0.1.4
- add
selectable,deletableanddraggableto node and edge props - add
parentIdto node props - add
on:edgemouseenterandon:edgemouseleaveevent handler - fix deselection of edges
- remove pointer events from panel when user selection is active
- fix viewport initialization with user viewport
- fix parent node lookup in
evaluateAbsolutePosition- thanks @lcsfort
0.1.3
- fix
NodeToolbarfor subflows
0.1.2
- export
InternalNodetype
0.1.1
- export
useInternalNodehook
0.1.0
This is a bigger update for Svelte Flow to keep up with the latest changes we made for React Flow and the Svelte5 rewrite. The biggest change is the separation of user nodes (type Node) and internal nodes (type InternalNode), which includes a renaming of the node.computed attribute to node.measured. In the previous versions, we stored internals in node[internalsSymbol]. This doesn't exist anymore, but we only add it to our internal nodes in node.internals..
⚠️ Breaking
- rename
node.computedtonode.measured- this attribute only includeswidthandheightand nopositionAbsoluteanymore. For this we added the helpersgetInternalNodeanduseInternalNode - rename
node.parentNodetonode.parentId
More updates:
- add
isValidConnectionfor<Handle />component - add
fitViewOptionsfor<Controls />component - add
getInternalNodetouseSvelteFlow - add
useInternalNodehook - don't reset nodes and edges when svelte flow unmounts - thanks @darabos
- fix node event types - thanks @RedPhoenixQ
- make handleId and isTarget reactive - thanks @darabos
- fix MiniMap interaction for touch devices
- fix pane: pinch zoom on windows
- fix nodes: return user node in node event handlers
0.0.41
- fix: re-observe nodes when not initialized
0.0.40
- add
orientation('horizontal' or 'vertical'),styleandclassprop forControlscomponent - allow multiple keys for
deleteKey,selectionKey,multiSelectionKey,panActivationKeyandzoomActivationKey - fix node observe / unobserve
- fix edge and node types
- active context menu releases pressed keys to reset selection
0.0.39
⚠️ Breaking changes
on:nodedragstart,on:nodedragandon:nodedragstopare also getting fired if a selection bix is being dragged. We renamed thenodeparam totargetNodeand set it tonullif a selection is being dragged.
Patch changes
- export
EdgeLabelcomponent - add "connectionindicator" class for
Handlecomponent - address a11y warnings
0.0.38
⚠️ Breaking changes
NodePropsgeneric is a node and not only node data.type $$Props = NodeProps<AppNode>
Patch changes
- unify
EdgeandNodetype handling - fix safari: prevent selection of viewport
0.0.37
⚠️ Breaking changes
useNodesDatanot only returns data objects but also the type and the id of the node- status class names for Handle components are slightly different. It's now "connectingfrom" and "connectingto" instead of "connecting"
Patch changes
- better cursor defaults for the pane, nodes and edges
- add
initialWidthandinitialHeightnode attributes for specifying initial dimensions for ssr - always re-measure nodes when new nodes get passed
- fix
NodeResizerwhen used in combination withnodeOrigin
0.0.36
Patch changes
- a better NodeResizer (child nodes do not move when parent node gets resized)
- fix
on:panecontextmenu - add
role="button"to<EdgeLabel />to prevent a11y warnings - don't delete node when input is focused and user presses Backspace + Ctrl (or any other mod key)
useHandleConnections: use context node id when no node id is passed- don't trigger drag start / end when node is not draggable
0.0.35
Minor changes
- add
getNode,getNodes,getEdgeandgetEdgestouseSvelteFlow - add
useInitialized/useNNodesInitializedhooks andoninithandler
Patch changes
- selection box is not interrupted by selectionKey being let go
- Edge label has a default background and is clickable
- do not use fallback handle if a specific id is being used
- use correct id for
<Handle />data-id attribute - fix
getNodesBoundsand add second param for passing options
0.0.34
Minor changes
- add second option param to
screenToFlowPositionfor configuring ifsnapToGridshould be used - add slot to
Controls
Patch changes
- cleanup
ControlButtontypes - infer types for
getIncomers,getOutgoers,updateEdge,addEdgeandgetConnectedEdgesthanks @joeyballentine - refactor handles: prefix with flow id for handling nested flows
- add comments for types like
SvelteFlowPropsorNodefor a better developer experience
0.0.33
Bugfix
- fix
deleteElements - fix dragging when
draggable=false - add
ariaLabelprop for<Controls />
⚠️ Breaking
deleteElementsfunction now takes one object as an argument{ nodes: [], edges: [] }instead of two(nodes, edges)
0.0.32
Features
- add
NodeResizerandNodeResizeControlcomponents for resizing nodes
0.0.31
Bugfix
- fix edge rendering
0.0.30
Features
- add
onbeforedeletehandler to prevent/ manage deletions - TSDocs for hooks and some types
Patch changes
- new nodeDragThreshold default is 1
- refactor/simplify edge rendering
0.0.29
Another huge update for Svelte Flow 🙏 Handling data flows will be way easier with the new hooks and functions. You can now subscribe to connected nodes, receive data and update nodes more easily. We fix a big issue about the <Handle /> component. No more on:connect that only worked for target <Handle /> components but onconnect and ondisconnect that works for every <Handle />.
Features
- add
useHandleConnectionshook for receiving connected node and handle ids for a specific handle - add
useNodesData(ids: string | string[])hook for receiving data from other nodes - export
updateNodeandupdateNodeDatafromuseSvelteFlowto update a node or the data object - add
onedgecreatefunction for passing a certain id or other attributes to a newly created edge
⚠️ Breaking
- replace
on:connect,on:connectstartandon:connectendwithonconnect,onconnectstartandonconnectend, no need to forwardon:connect..anymore
Fixes and minor changes
onconnectandondisconnectcallback work for<Handle />component- don't delete a node when user presses Backspace inside an input/textarea/.nokey element
bgColorprop for Background didn't work- prefix css vars with "xy-"
- don't update nodes and edges on pane click if not necessary
- cleaner types for exported edges
- fix
getIntersectingNodesbug when passingRect
0.0.28
This is a huge update! We added a new <NodeToolbar /> component and a new colorMode ('light' | 'dark' | 'system') prop for toggling dark/light mode.
There are also some breaking changes again (sorry!) but we are very close to the final API for Svelte Flow 1.0.0. The biggest change is that we group node attriubutes (width, height, positionAbsolute) that are added by the library under node.computed. This makes it easier to understand, that this stuff comes from the library itself. node.width and node.height is still an optional node option and can be used to set certain dimensions for SSR or on the client.
- add
<NodeToolbar />component - add
on:selectionclickandon:selectioncontextmenuevent handlers - add
ondelete({ nodes, edges })handler - add
zoomActivationKeyprop - add
widthandheightprop to customNodePropstype - add
colorModeprop ('light' | 'dark' | 'system') - ⚠️ replace
xPosandyPoswithpositionAbsoluteprop to customNodePropstype - ⚠️
node.width/heightandnode.positionAbsolutecan now be found undernode.computed.width/height/positionAbsolute - ⚠️
node.width/heightis still optional an can be used for forcing certain dimensions and SSR - refactor keys: you can now disable keys by setting them to
null(e.g.selectionKey={null}) - performance optimization with internal node lookup
0.0.27
- add
selectionOnDragprop - can be used to create figma-like controls in combination withpanOnDrag={false}/panOnDrag={[1, 2]}+panOnScroll={true} - ⚠️ rename
screenToFlowCoordinatetoscreenToFlowPosition - ⚠️ rename
flowToScreenCoordinatetoflowToScreenPosition - ⚠️ rename
getTransformForBoundstogetViewportForBounds(return{ x: number, y: number, zoom: number }instead of[number, number, number]) - ⚠️ rename
getRectOfNodestogetNodesBounds - simplify handle default styles, so that it's easier to override them
- added e2e tests
0.0.26
- fixes broken version on npm
0.0.25
- add
toObjecttouseSvelteFlowhook - export
BezierEdge,StepEdgeandSmoothStepEdgecomponents - handle window resize (Minimap updates its viewport)
- fix wrongly selected nodes
- fix connection line z-index
- fix broken edges (
interactionWidthwas missing)
0.0.24
- update node automatically when
type,sourcePositionortargetPositionoption changes - prevent dev tool warnings when using built-in node types
- updates
useSvelteFlowhook: - add node type "group"
- add
classprop for BaseEdge - add
idprop for Background - add
selectedprop for MiniMap Node - rename Controls prop
showInteractivetoshowLock
0.0.23
- updates
useSvelteFlowhook:- add
screenToFlowCoordinateandflowToScreenCoordinate - add
getConnectedEdges,getIncomersandgetOutgoers - add
deleteElements - add
fitBounds - add
getIntersectingNodesandisNodeIntersecting
- add
- add
useConnectionhook - add
useNodeshook - add
useEdgeshook - add
viewportprop (writable viewport) - fix selection style
- fix Background component with lines variant
0.0.22
- add
connectionLineslot for rendering a custom connection line - add
connectionLineStyleandconnectionLineContainerStyleprops - add
useConnectionhook - add
nodeDragThresholdprop - add
fitViewOptionsprop - add
defaultEdgeOptionsprop - add
on:edgecontextmenuevent handler prop - add
connectionModeprop - add
attributionPositionprop
0.0.21
- add
on:nodedragstart,on:nodedragandon:nodedragstop - add
on:nodecontextmenu
0.0.20
- [breaking change] use same convention for all custom events: Always pass the original event if possible and additional data
- before:
on:nodeclick: CustomEvent<Node> - after:
on:nodeclick: CustomEvent<{event: MouseEvent, node: Node}>
- before:
- fix
on:connectstartandon:connectendhandlers - fix default styles for
<Controls />component - fix
dragHandlenode option - expose
styleprop for minimap
0.0.19
- make it possible to change edge type dynamically
- fix
hiddenoption for nodes and edges - add
useUpdateNodeInternalshook
0.0.18
- add
nodesDraggableprop - minimap: add default background
0.0.17
- export
useStoreto access internals
0.0.16
- center edge label by default
0.0.15
- fix wrongly displayed connectionline
0.0.14
- export css correctly
0.0.13
- [breaking change] from now on it's necessary to import the styles like
@xyflow/svelte/styles/style.cssor@xyflow/svelte/styles/base.css. This makes it easier to work with tailwind or overwrite styles with regular CSS.
0.0.7 ... 0.0.12
- fix event handlers and rename from
on:node:clicktoon:nodeclick - add
panActivationKeyprop - elevate nodes by default when selected
- use css vars internally and let users overwrite them
0.0.6
- use svelte 4
0.0.5
this release fixes the path bug introduced in 0.0.4
0.0.4
this version is broken because of a wrong path in the package.json
0.0.3
- add
snapGridprop - add
onlyRenderVisibleElementsprop - cleanup some exports and types
0.0.2
- add
connectionRadius
0.0.1
Svelte Flow alpha is here 🔥 You can expect some changes until we reach 1.0.0 but we try to stick as close as possible to the React Flow API. There are no docs yet, but we are working on it! For now the easiest way is to use the autocomplete of your IDE, lookup the props in the SvelteFlow component or check out the React Flow docs.
This very first release comes with lots of features already:
- pass
nodesandedgesas writables - draggable, selectable and deletable nodes
- support for custom
nodeTypesandedgeTypes - basic viewport settings like
fitView,minZoomandmaxZoom - additional components:
<MiniMap />,<Controls />&<Background />