@reactflow/background
Advanced tools
Comparing version 11.0.2 to 11.0.3
@@ -31,3 +31,3 @@ import { jsx, jsxs } from 'react/jsx-runtime'; | ||
}; | ||
const selector = (s) => ({ transform: s.transform, rfId: s.rfId }); | ||
const selector = (s) => ({ transform: s.transform, patternId: `pattern-${s.rfId}` }); | ||
function Background({ variant = BackgroundVariant.Dots, gap = 20, | ||
@@ -39,3 +39,3 @@ // only used for dots and cross | ||
const ref = useRef(null); | ||
const { transform, rfId } = useStore(selector, shallow); | ||
const { transform, patternId } = useStore(selector, shallow); | ||
const patternColor = color || defaultColor[variant]; | ||
@@ -59,3 +59,3 @@ const patternSize = size || defaultSize[variant]; | ||
left: 0, | ||
}, ref: ref, children: [jsx("pattern", { id: rfId, x: transform[0] % scaledGap[0], y: transform[1] % scaledGap[1], width: scaledGap[0], height: scaledGap[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${patternOffset[0]},-${patternOffset[1]})`, children: isDots ? (jsx(DotPattern, { color: patternColor, radius: scaledSize / 2 })) : (jsx(LinePattern, { dimensions: patternDimensions, color: patternColor, lineWidth: lineWidth })) }), jsx("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${rfId})` })] })); | ||
}, ref: ref, children: [jsx("pattern", { id: patternId, x: transform[0] % scaledGap[0], y: transform[1] % scaledGap[1], width: scaledGap[0], height: scaledGap[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${patternOffset[0]},-${patternOffset[1]})`, children: isDots ? (jsx(DotPattern, { color: patternColor, radius: scaledSize / 2 })) : (jsx(LinePattern, { dimensions: patternDimensions, color: patternColor, lineWidth: lineWidth })) }), jsx("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${patternId})` })] })); | ||
} | ||
@@ -62,0 +62,0 @@ Background.displayName = 'Background'; |
@@ -7,3 +7,3 @@ import { CSSProperties } from 'react'; | ||
} | ||
export interface BackgroundProps { | ||
export declare type BackgroundProps = { | ||
color?: string; | ||
@@ -16,3 +16,3 @@ className?: string; | ||
style?: CSSProperties; | ||
} | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -7,3 +7,3 @@ import { CSSProperties } from 'react'; | ||
} | ||
export interface BackgroundProps { | ||
export declare type BackgroundProps = { | ||
color?: string; | ||
@@ -16,3 +16,3 @@ className?: string; | ||
style?: CSSProperties; | ||
} | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@reactflow/background", | ||
"version": "11.0.2", | ||
"version": "11.0.3", | ||
"description": "Background component with different variants for React Flow", | ||
@@ -34,3 +34,3 @@ "keywords": [ | ||
"@babel/runtime": "^7.18.9", | ||
"@reactflow/core": "11.1.1", | ||
"@reactflow/core": "11.1.2", | ||
"classcat": "^5.0.3", | ||
@@ -37,0 +37,0 @@ "zustand": "^4.1.1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138702
632
+ Added@reactflow/core@11.1.2(transitive)
- Removed@reactflow/core@11.1.1(transitive)
Updated@reactflow/core@11.1.2