Merge remote-tracking branch 'origin/main' into arrow-heads-fallback-color
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@xyflow/react': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Omit `defaultValue` from `Node`'s `domAttributes` to fix type incompatibility when using `WritableDraft`
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@xyflow/react': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Prevent a 0 added to the markup for edges when interactionWidth is 0
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@xyflow/svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Export `BuiltInEdge` type
|
||||||
@@ -6,13 +6,17 @@ import routes from './routes';
|
|||||||
export default function Header() {
|
export default function Header() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [currentPath, setCurrentPath] = useState(location.pathname);
|
|
||||||
|
const pathParts = location.pathname.split('/').filter(Boolean);
|
||||||
|
const initialExample = pathParts.length > 1 ? pathParts[1] : 'basic';
|
||||||
|
|
||||||
|
const [currentPath, setCurrentPath] = useState(initialExample);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const name = routes.find((route) => route.path === currentPath)?.name;
|
const name = routes.find((route) => route.path === currentPath)?.name;
|
||||||
document.title = `React Flow Examples${name ? ' - ' + name : ''}`;
|
document.title = `React Flow Examples${name ? ' - ' + name : ''}`;
|
||||||
navigate(currentPath);
|
navigate(currentPath);
|
||||||
}, [currentPath]);
|
}, [currentPath, navigate]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -20,7 +24,11 @@ export default function Header() {
|
|||||||
<a className="logo" href="https://github.com/xyflow/xyflow">
|
<a className="logo" href="https://github.com/xyflow/xyflow">
|
||||||
React Flow Dev
|
React Flow Dev
|
||||||
</a>
|
</a>
|
||||||
<select value={currentPath} onChange={(event) => setCurrentPath(event.target.value)}>
|
<select
|
||||||
|
value={currentPath}
|
||||||
|
onChange={(event) => setCurrentPath(event.target.value)}
|
||||||
|
aria-label="select an example"
|
||||||
|
>
|
||||||
{routes.map((route) => (
|
{routes.map((route) => (
|
||||||
<option value={route.path} key={route.path}>
|
<option value={route.path} key={route.path}>
|
||||||
{route.name}
|
{route.name}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export function BaseEdge({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<path {...props} d={path} fill="none" className={cc(['react-flow__edge-path', props.className])} />
|
<path {...props} d={path} fill="none" className={cc(['react-flow__edge-path', props.className])} />
|
||||||
{interactionWidth && (
|
{interactionWidth ? (
|
||||||
<path
|
<path
|
||||||
d={path}
|
d={path}
|
||||||
fill="none"
|
fill="none"
|
||||||
@@ -55,7 +55,7 @@ export function BaseEdge({
|
|||||||
strokeWidth={interactionWidth}
|
strokeWidth={interactionWidth}
|
||||||
className="react-flow__edge-interaction"
|
className="react-flow__edge-interaction"
|
||||||
/>
|
/>
|
||||||
)}
|
) : null}
|
||||||
{label && isNumeric(labelX) && isNumeric(labelY) ? (
|
{label && isNumeric(labelX) && isNumeric(labelY) ? (
|
||||||
<EdgeText
|
<EdgeText
|
||||||
x={labelX}
|
x={labelX}
|
||||||
|
|||||||
@@ -545,7 +545,7 @@ export interface ReactFlowProps<NodeType extends Node = Node, EdgeType extends E
|
|||||||
noDragClassName?: string;
|
noDragClassName?: string;
|
||||||
/**
|
/**
|
||||||
* Typically, scrolling the mouse wheel when the mouse is over the canvas will zoom the viewport.
|
* Typically, scrolling the mouse wheel when the mouse is over the canvas will zoom the viewport.
|
||||||
* Adding the `"nowheel"` class to an element n the canvas will prevent this behavior and this prop
|
* Adding the `"nowheel"` class to an element in the canvas will prevent this behavior and this prop
|
||||||
* allows you to change the name of that class.
|
* allows you to change the name of that class.
|
||||||
* @default "nowheel"
|
* @default "nowheel"
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -29,7 +29,14 @@ export type Node<
|
|||||||
*/
|
*/
|
||||||
domAttributes?: Omit<
|
domAttributes?: Omit<
|
||||||
HTMLAttributes<HTMLDivElement>,
|
HTMLAttributes<HTMLDivElement>,
|
||||||
'id' | 'style' | 'className' | 'draggable' | 'role' | 'aria-label' | keyof DOMAttributes<HTMLDivElement>
|
| 'id'
|
||||||
|
| 'style'
|
||||||
|
| 'className'
|
||||||
|
| 'draggable'
|
||||||
|
| 'role'
|
||||||
|
| 'aria-label'
|
||||||
|
| 'defaultValue'
|
||||||
|
| keyof DOMAttributes<HTMLDivElement>
|
||||||
>;
|
>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ export type SvelteFlowProps<
|
|||||||
noDragClass?: string;
|
noDragClass?: string;
|
||||||
/**
|
/**
|
||||||
* Typically, scrolling the mouse wheel when the mouse is over the canvas will zoom the viewport.
|
* Typically, scrolling the mouse wheel when the mouse is over the canvas will zoom the viewport.
|
||||||
* Adding the `"nowheel"` class to an element n the canvas will prevent this behavior and this prop
|
* Adding the `"nowheel"` class to an element in the canvas will prevent this behavior and this prop
|
||||||
* allows you to change the name of that class.
|
* allows you to change the name of that class.
|
||||||
* @default "nowheel"
|
* @default "nowheel"
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ export type {
|
|||||||
StepEdgeProps,
|
StepEdgeProps,
|
||||||
StraightEdgeProps,
|
StraightEdgeProps,
|
||||||
EdgeTypes,
|
EdgeTypes,
|
||||||
DefaultEdgeOptions
|
DefaultEdgeOptions,
|
||||||
|
BuiltInEdge,
|
||||||
} from '$lib/types/edges';
|
} from '$lib/types/edges';
|
||||||
export type * from '$lib/types/general';
|
export type * from '$lib/types/general';
|
||||||
export type { Node, NodeTypes, BuiltInNode, NodeProps, InternalNode } from '$lib/types/nodes';
|
export type { Node, NodeTypes, BuiltInNode, NodeProps, InternalNode } from '$lib/types/nodes';
|
||||||
|
|||||||
Reference in New Issue
Block a user