diff --git a/.changeset/friendly-monkeys-fry.md b/.changeset/friendly-monkeys-fry.md new file mode 100644 index 00000000..5da27a70 --- /dev/null +++ b/.changeset/friendly-monkeys-fry.md @@ -0,0 +1,5 @@ +--- +'@xyflow/svelte': patch +--- + +Fix data in EdgeProps not typed correctly diff --git a/.changeset/grumpy-spiders-play.md b/.changeset/grumpy-spiders-play.md new file mode 100644 index 00000000..cf7d295f --- /dev/null +++ b/.changeset/grumpy-spiders-play.md @@ -0,0 +1,7 @@ +--- +'@xyflow/react': minor +'@xyflow/svelte': minor +'@xyflow/system': minor +--- + +Improve typing for Nodes diff --git a/.changeset/hip-fireants-change.md b/.changeset/hip-fireants-change.md new file mode 100644 index 00000000..90137725 --- /dev/null +++ b/.changeset/hip-fireants-change.md @@ -0,0 +1,5 @@ +--- +'@xyflow/svelte': patch +--- + +Fix setting nodesInitialized multiple times diff --git a/.changeset/late-taxis-press.md b/.changeset/late-taxis-press.md new file mode 100644 index 00000000..e48f797b --- /dev/null +++ b/.changeset/late-taxis-press.md @@ -0,0 +1,7 @@ +--- +'@xyflow/react': minor +'@xyflow/svelte': minor +'@xyflow/system': minor +--- + +Add an `ease` and `interpolate` option to all function that alter the viewport diff --git a/.changeset/nine-crabs-help.md b/.changeset/nine-crabs-help.md new file mode 100644 index 00000000..747174ac --- /dev/null +++ b/.changeset/nine-crabs-help.md @@ -0,0 +1,5 @@ +--- +'@xyflow/svelte': patch +--- + +Change a11y description inline styles to classes diff --git a/.changeset/tough-rivers-tell.md b/.changeset/tough-rivers-tell.md new file mode 100644 index 00000000..d2e2e7e4 --- /dev/null +++ b/.changeset/tough-rivers-tell.md @@ -0,0 +1,5 @@ +--- +'@xyflow/svelte': patch +--- + +Export missing callback types diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a6710280..dfd9ac5d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,19 +20,19 @@ That being said, our libraries are only interesting because of the people who ma The things we need the most help for the library and its community are: -**🐛 Bug reports:** We simply can’t catch them all. Check [existing issues](https://github.com/wbkd/react-flow/issues/new/choose) and discussion first, then [create a new issue](https://github.com/wbkd/react-flow/issues/new/choose) to tell us what’s up. +**🐛 Bug reports:** We simply can’t catch them all. Check [existing issues](https://github.com/xyflow/xyflow/issues/) and discussion first, then [create a new issue](https://github.com/xyflow/xyflow/issues/new/choose) to tell us what’s up. -**💬 Answering questions** in our [Discord Server](https://discord.gg/Bqt6xrs) and [Github discussions](https://github.com/wbkd/react-flow/discussions). +**💬 Answering questions** in our [Discord Server](https://discord.gg/Bqt6xrs) and [Github discussions](https://github.com/xyflow/xyflow/discussions). 🎬 **Create tutorials**. Send them to us and we’ll happily share them! -**✏️ Edit our [Docs](https://reactflow.dev/docs/introduction/)**: Make changes in the [react-flow-docs repo](https://github.com/wbkd/react-flow-docs), or click the "edit this page” button that lives on every doc site. +**✏️ Edit our [Docs](https://reactflow.dev/learn/concepts/introduction/)**: Make changes in our [web repo](https://github.com/xyflow/web), where our docs live. -All interactions should be done with care following our [Code of Conduct](https://github.com/wbkd/react-flow/blob/main/CODE_OF_CONDUCT.md). +All interactions should be done with care following our [Code of Conduct](https://github.com/xyflow/xyflow/blob/main/CODE_OF_CONDUCT.md). ## Enhancements -If you have an idea or suggestion for an enhancement to the React Flow or Svelte Flow library, please use the [New Features](https://github.com/wbkd/react-flow/discussions/categories/new-features) discussion section. If you want to build it yourself, **please reach out to us before you dive into a new pull request.** The direction of React Flow/ Svelte Flow and which new features are added are discussed in our Discord Server and in [this Github discussions section](https://github.com/wbkd/react-flow/discussions/categories/new-features), and in the end they are decided by the core team. +If you have an idea or suggestion for an enhancement to the React Flow or Svelte Flow library, please use the [New Features](https://github.com/xyflow/xyflow/discussions/categories/new-features) discussion section. If you want to build it yourself, **please reach out to us before you dive into a new pull request.** The direction of React Flow/ Svelte Flow and which new features are added are discussed in our Discord Server and in [this Github discussions section](https://github.com/xyflow/xyflow/discussions/categories/new-features), and in the end they are decided by the core team. Talking to us first about the enhancement you want to build will be the most likely way to get your pull request into the library (see Our Contributing Philosophy above). We would hate to see you write code you’re proud of, just to learn that we’ve already been working on the same thing, or that we feel doesn’t fit into the core library. diff --git a/README.md b/README.md index 585dac0e..3ed80c4b 100644 --- a/README.md +++ b/README.md @@ -159,16 +159,9 @@ For releasing packages we are using [changesets](https://github.com/changesets/c 3. changset creates a PR that bumps all packages based on the changesets 4. merge changeset PR if you want to release to Github and npm -## The xyflow team - -React Flow and Svelte Flow are maintained by the team behind [xyflow](https://xyflow.com). If you need help or want to talk to us about a collaboration, reach out through our [contact form](https://xyflow.com/contact) or by joining our [Discord Server](https://discord.gg/Bqt6xrs). - -- Christopher • [Twitter](https://twitter.com/chrtze) • [Github](https://github.com/chrtze) -- Hayleigh • [Twitter](https://twitter.com/hayleighdotdev) • [Github](https://github.com/hayleigh-dot-dev) -- Abbey • [Github](https://github.com/printerscanner) -- Moritz • [Twitter](https://twitter.com/moklick) • [Github](https://github.com/moklick) -- Peter • [Github](https://github.com/peterkogo) +## Built by [xyflow](https://xyflow.com) +React Flow and Svelte Flow are maintained by the [xyflow team](https://xyflow.com/about). If you need help or want to talk to us about a collaboration, reach out through our [contact form](https://xyflow.com/contact) or by joining our [Discord Server](https://discord.gg/Bqt6xrs). ## License diff --git a/examples/react/src/examples/UseReactFlow/index.tsx b/examples/react/src/examples/UseReactFlow/index.tsx index cf6ae59f..3e1d8f92 100644 --- a/examples/react/src/examples/UseReactFlow/index.tsx +++ b/examples/react/src/examples/UseReactFlow/index.tsx @@ -170,7 +170,6 @@ const UseZoomPanHelperFlow = () => { onConnect={onConnect} onPaneClick={onPaneClick} fitView - fitViewOptions={{ duration: 1200, padding: 0.2 }} maxZoom={Infinity} > @@ -183,7 +182,16 @@ const UseZoomPanHelperFlow = () => { console.log('fit view success'); }} > - fitView + fitView default + + diff --git a/examples/svelte/src/routes/examples/usesvelteflow/Flow.svelte b/examples/svelte/src/routes/examples/usesvelteflow/Flow.svelte index aa37a49a..cab0bdde 100644 --- a/examples/svelte/src/routes/examples/usesvelteflow/Flow.svelte +++ b/examples/svelte/src/routes/examples/usesvelteflow/Flow.svelte @@ -44,7 +44,7 @@
- + diff --git a/examples/svelte/src/routes/examples/usesvelteflow/Sidebar.svelte b/examples/svelte/src/routes/examples/usesvelteflow/Sidebar.svelte index c64131f0..3b687eb3 100644 --- a/examples/svelte/src/routes/examples/usesvelteflow/Sidebar.svelte +++ b/examples/svelte/src/routes/examples/usesvelteflow/Sidebar.svelte @@ -30,7 +30,10 @@ - + + diff --git a/packages/react/src/hooks/useViewportHelper.ts b/packages/react/src/hooks/useViewportHelper.ts index a88bd3fc..fc01a150 100644 --- a/packages/react/src/hooks/useViewportHelper.ts +++ b/packages/react/src/hooks/useViewportHelper.ts @@ -53,7 +53,7 @@ const useViewportHelper = (): ViewportHelperFunctions => { y: viewport.y ?? tY, zoom: viewport.zoom ?? tZoom, }, - { duration: options?.duration } + options ); return Promise.resolve(true); @@ -78,7 +78,7 @@ const useViewportHelper = (): ViewportHelperFunctions => { y: centerY, zoom: nextZoom, }, - { duration: options?.duration } + { duration: options?.duration, ease: options?.ease, interpolate: options?.interpolate } ); return Promise.resolve(true); @@ -91,7 +91,11 @@ const useViewportHelper = (): ViewportHelperFunctions => { return Promise.resolve(false); } - await panZoom.setViewport(viewport, { duration: options?.duration }); + await panZoom.setViewport(viewport, { + duration: options?.duration, + ease: options?.ease, + interpolate: options?.interpolate, + }); return Promise.resolve(true); }, diff --git a/packages/react/src/types/general.ts b/packages/react/src/types/general.ts index 98302a86..80acc45c 100644 --- a/packages/react/src/types/general.ts +++ b/packages/react/src/types/general.ts @@ -149,6 +149,7 @@ export type ViewportHelperFunctions = { * * @param viewport - the viewport to set * @param options.duration - optional duration. If set, a transition will be applied + * @param options.ease - optional ease function. */ setViewport: SetViewport; /** @@ -164,6 +165,8 @@ export type ViewportHelperFunctions = { * @param x - x position * @param y - y position * @param options.zoom - optional zoom + * @param options.duration - optional duration. If set, a transition will be applied + * @param options.ease - optional ease function. */ setCenter: SetCenter; /** @@ -173,6 +176,8 @@ export type ViewportHelperFunctions = { * * @param bounds - the bounds ({ x: number, y: number, width: number, height: number }) to fit the view to * @param options.padding - optional padding + * @param options.duration - optional duration. If set, a transition will be applied + * @param options.ease - optional ease function. */ fitBounds: FitBounds; /** diff --git a/packages/react/src/types/nodes.ts b/packages/react/src/types/nodes.ts index b07c0337..8dc213d7 100644 --- a/packages/react/src/types/nodes.ts +++ b/packages/react/src/types/nodes.ts @@ -12,7 +12,7 @@ import { NodeTypes } from './general'; */ export type Node< NodeData extends Record = Record, - NodeType extends string = string + NodeType extends string | undefined = string | undefined > = NodeBase & { style?: CSSProperties; className?: string; diff --git a/packages/svelte/src/lib/components/A11yDescriptions/A11yDescriptions.svelte b/packages/svelte/src/lib/components/A11yDescriptions/A11yDescriptions.svelte index 0383629e..875d7f83 100644 --- a/packages/svelte/src/lib/components/A11yDescriptions/A11yDescriptions.svelte +++ b/packages/svelte/src/lib/components/A11yDescriptions/A11yDescriptions.svelte @@ -1,21 +1,18 @@ -