diff --git a/examples/react/src/examples/A11y/index.tsx b/examples/react/src/examples/A11y/index.tsx index c837c14c..39c486d6 100644 --- a/examples/react/src/examples/A11y/index.tsx +++ b/examples/react/src/examples/A11y/index.tsx @@ -67,7 +67,7 @@ const A11y = () => { 'a11yDescription.edge.default': 'Custom Edge Desc.', 'controls.zoomin.title': 'Custom Zoom in', 'controls.zoomout.title': 'Custom Zoom Out', - 'controls.fitview.title': 'Custom Fit View', + // 'controls.fitview.title': 'Custom Fit View', 'controls.interactive.title': 'Custom Toggle Interactivity', }} > diff --git a/examples/svelte/src/routes/examples/a11y/+page.svelte b/examples/svelte/src/routes/examples/a11y/+page.svelte index 18a50dcc..9ca28ae6 100644 --- a/examples/svelte/src/routes/examples/a11y/+page.svelte +++ b/examples/svelte/src/routes/examples/a11y/+page.svelte @@ -39,7 +39,7 @@ 'a11yDescription.edge.default': 'Svelte Custom Edge Desc.', 'controls.zoomin.title': 'Svelte Custom Zoom in', 'controls.zoomout.title': 'Svelte Custom Zoom Out', - 'controls.fitview.title': 'Svelte Custom Fit View', + // 'controls.fitview.title': 'Svelte Custom Fit View', 'controls.interactive.title': 'Svelte Custom Toggle Interactivity', }} > diff --git a/packages/react/src/components/StoreUpdater/index.tsx b/packages/react/src/components/StoreUpdater/index.tsx index dc1163dc..d2fb3cae 100644 --- a/packages/react/src/components/StoreUpdater/index.tsx +++ b/packages/react/src/components/StoreUpdater/index.tsx @@ -5,7 +5,7 @@ */ import { useEffect, useRef } from 'react'; import { shallow } from 'zustand/shallow'; -import { infiniteExtent, type CoordinateExtent } from '@xyflow/system'; +import { infiniteExtent, type CoordinateExtent, mergeLabelConfig, LabelConfig } from '@xyflow/system'; import { useStore, useStoreApi } from '../../hooks/useStore'; import type { Node, Edge, ReactFlowState, ReactFlowProps, FitViewOptions } from '../../types'; @@ -157,6 +157,10 @@ export function StoreUpdater Math.min(Math.max(val, min), max); export const clampPosition = ( @@ -418,3 +420,7 @@ export function withResolvers(): { }); return { promise, resolve, reject }; } + +export function mergeLabelConfig(partial?: Partial): LabelConfig { + return { ...defaultLabelConfig, ...(partial || {}) }; +}