@reactflow/minimap
Advanced tools
Comparing version 11.6.3 to 11.7.0
@@ -1,3 +0,2 @@ | ||
import { jsx, Fragment, jsxs } from 'react/jsx-runtime'; | ||
import { memo, useRef, useEffect } from 'react'; | ||
import React, { memo, useRef, useEffect } from 'react'; | ||
import cc from 'classcat'; | ||
@@ -12,3 +11,3 @@ import { shallow } from 'zustand/shallow'; | ||
const fill = (color || background || backgroundColor); | ||
return (jsx("rect", { className: cc(['react-flow__minimap-node', { selected }, className]), x: x, y: y, rx: borderRadius, ry: borderRadius, width: width, height: height, fill: fill, stroke: strokeColor, strokeWidth: strokeWidth, shapeRendering: shapeRendering, onClick: onClick ? (event) => onClick(event, id) : undefined })); | ||
return (React.createElement("rect", { className: cc(['react-flow__minimap-node', { selected }, className]), x: x, y: y, rx: borderRadius, ry: borderRadius, width: width, height: height, fill: fill, stroke: strokeColor, strokeWidth: strokeWidth, shapeRendering: shapeRendering, onClick: onClick ? (event) => onClick(event, id) : undefined })); | ||
}; | ||
@@ -18,2 +17,3 @@ MiniMapNode.displayName = 'MiniMapNode'; | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
const selector$1 = (s) => s.nodeOrigin; | ||
@@ -32,9 +32,10 @@ const selectorNodes = (s) => s.getNodes().filter((node) => !node.hidden && node.width && node.height); | ||
const shapeRendering = typeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision'; | ||
return (jsx(Fragment, { children: nodes.map((node) => { | ||
const { x, y } = getNodePositionWithOrigin(node, nodeOrigin).positionAbsolute; | ||
return (jsx(NodeComponent, { x: x, y: y, width: node.width, height: node.height, style: node.style, selected: node.selected, className: nodeClassNameFunc(node), color: nodeColorFunc(node), borderRadius: nodeBorderRadius, strokeColor: nodeStrokeColorFunc(node), strokeWidth: nodeStrokeWidth, shapeRendering: shapeRendering, onClick: onClick, id: node.id }, node.id)); | ||
}) })); | ||
return (React.createElement(React.Fragment, null, nodes.map((node) => { | ||
const { x, y } = getNodePositionWithOrigin(node, nodeOrigin).positionAbsolute; | ||
return (React.createElement(NodeComponent, { key: node.id, x: x, y: y, width: node.width, height: node.height, style: node.style, selected: node.selected, className: nodeClassNameFunc(node), color: nodeColorFunc(node), borderRadius: nodeBorderRadius, strokeColor: nodeStrokeColorFunc(node), strokeWidth: nodeStrokeWidth, shapeRendering: shapeRendering, onClick: onClick, id: node.id })); | ||
}))); | ||
} | ||
var MiniMapNodes$1 = memo(MiniMapNodes); | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
const defaultWidth = 200; | ||
@@ -60,3 +61,3 @@ const defaultHeight = 150; | ||
// a component properly. | ||
nodeComponent, maskColor = 'rgb(240, 240, 240, 0.6)', maskStrokeColor = 'none', maskStrokeWidth = 1, position = 'bottom-right', onClick, onNodeClick, pannable = false, zoomable = false, ariaLabel = 'React Flow mini map', inversePan = false, zoomStep = 10, offsetScale = 5 }) { | ||
nodeComponent, maskColor = 'rgb(240, 240, 240, 0.6)', maskStrokeColor = 'none', maskStrokeWidth = 1, position = 'bottom-right', onClick, onNodeClick, pannable = false, zoomable = false, ariaLabel = 'React Flow mini map', inversePan = false, zoomStep = 10, offsetScale = 5, }) { | ||
const store = useStoreApi(); | ||
@@ -136,4 +137,8 @@ const svg = useRef(null); | ||
: undefined; | ||
return (jsx(Panel, { position: position, style: style, className: cc(['react-flow__minimap', className]), "data-testid": "rf__minimap", children: jsxs("svg", { width: elementWidth, height: elementHeight, viewBox: `${x} ${y} ${width} ${height}`, role: "img", "aria-labelledby": labelledBy, ref: svg, onClick: onSvgClick, children: [ariaLabel && jsx("title", { id: labelledBy, children: ariaLabel }), jsx(MiniMapNodes$1, { onClick: onSvgNodeClick, nodeColor: nodeColor, nodeStrokeColor: nodeStrokeColor, nodeBorderRadius: nodeBorderRadius, nodeClassName: nodeClassName, nodeStrokeWidth: nodeStrokeWidth, nodeComponent: nodeComponent }), jsx("path", { className: "react-flow__minimap-mask", d: `M${x - offset},${y - offset}h${width + offset * 2}v${height + offset * 2}h${-width - offset * 2}z | ||
M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`, fill: maskColor, fillRule: "evenodd", stroke: maskStrokeColor, strokeWidth: maskStrokeWidth, pointerEvents: "none" })] }) })); | ||
return (React.createElement(Panel, { position: position, style: style, className: cc(['react-flow__minimap', className]), "data-testid": "rf__minimap" }, | ||
React.createElement("svg", { width: elementWidth, height: elementHeight, viewBox: `${x} ${y} ${width} ${height}`, role: "img", "aria-labelledby": labelledBy, ref: svg, onClick: onSvgClick }, | ||
ariaLabel && React.createElement("title", { id: labelledBy }, ariaLabel), | ||
React.createElement(MiniMapNodes$1, { onClick: onSvgNodeClick, nodeColor: nodeColor, nodeStrokeColor: nodeStrokeColor, nodeBorderRadius: nodeBorderRadius, nodeClassName: nodeClassName, nodeStrokeWidth: nodeStrokeWidth, nodeComponent: nodeComponent }), | ||
React.createElement("path", { className: "react-flow__minimap-mask", d: `M${x - offset},${y - offset}h${width + offset * 2}v${height + offset * 2}h${-width - offset * 2}z | ||
M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`, fill: maskColor, fillRule: "evenodd", stroke: maskStrokeColor, strokeWidth: maskStrokeWidth, pointerEvents: "none" })))); | ||
} | ||
@@ -140,0 +145,0 @@ MiniMap.displayName = 'MiniMap'; |
@@ -1,9 +0,9 @@ | ||
/// <reference types="react" /> | ||
import React from 'react'; | ||
import type { MiniMapProps } from './types'; | ||
declare function MiniMap({ style, className, nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent, maskColor, maskStrokeColor, maskStrokeWidth, position, onClick, onNodeClick, pannable, zoomable, ariaLabel, inversePan, zoomStep, offsetScale }: MiniMapProps): JSX.Element; | ||
declare function MiniMap({ style, className, nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent, maskColor, maskStrokeColor, maskStrokeWidth, position, onClick, onNodeClick, pannable, zoomable, ariaLabel, inversePan, zoomStep, offsetScale, }: MiniMapProps): JSX.Element; | ||
declare namespace MiniMap { | ||
var displayName: string; | ||
} | ||
declare const _default: import("react").MemoExoticComponent<typeof MiniMap>; | ||
declare const _default: React.MemoExoticComponent<typeof MiniMap>; | ||
export default _default; | ||
//# sourceMappingURL=MiniMap.d.ts.map |
@@ -1,4 +0,4 @@ | ||
/// <reference types="react" /> | ||
import React from 'react'; | ||
import type { MiniMapNodeProps } from './types'; | ||
declare const _default: import("react").MemoExoticComponent<{ | ||
declare const _default: React.MemoExoticComponent<{ | ||
({ id, x, y, width, height, style, color, strokeColor, strokeWidth, className, borderRadius, shapeRendering, onClick, selected, }: MiniMapNodeProps): JSX.Element; | ||
@@ -5,0 +5,0 @@ displayName: string; |
@@ -1,6 +0,6 @@ | ||
/// <reference types="react" /> | ||
import React from 'react'; | ||
import type { MiniMapNodes } from './types'; | ||
declare function MiniMapNodes({ nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent: NodeComponent, onClick, }: MiniMapNodes): JSX.Element; | ||
declare const _default: import("react").MemoExoticComponent<typeof MiniMapNodes>; | ||
declare const _default: React.MemoExoticComponent<typeof MiniMapNodes>; | ||
export default _default; | ||
//# sourceMappingURL=MiniMapNodes.d.ts.map |
@@ -1,9 +0,9 @@ | ||
/// <reference types="react" /> | ||
import React from 'react'; | ||
import type { MiniMapProps } from './types'; | ||
declare function MiniMap({ style, className, nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent, maskColor, maskStrokeColor, maskStrokeWidth, position, onClick, onNodeClick, pannable, zoomable, ariaLabel, inversePan, zoomStep, offsetScale }: MiniMapProps): JSX.Element; | ||
declare function MiniMap({ style, className, nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent, maskColor, maskStrokeColor, maskStrokeWidth, position, onClick, onNodeClick, pannable, zoomable, ariaLabel, inversePan, zoomStep, offsetScale, }: MiniMapProps): JSX.Element; | ||
declare namespace MiniMap { | ||
var displayName: string; | ||
} | ||
declare const _default: import("react").MemoExoticComponent<typeof MiniMap>; | ||
declare const _default: React.MemoExoticComponent<typeof MiniMap>; | ||
export default _default; | ||
//# sourceMappingURL=MiniMap.d.ts.map |
@@ -1,4 +0,4 @@ | ||
/// <reference types="react" /> | ||
import React from 'react'; | ||
import type { MiniMapNodeProps } from './types'; | ||
declare const _default: import("react").MemoExoticComponent<{ | ||
declare const _default: React.MemoExoticComponent<{ | ||
({ id, x, y, width, height, style, color, strokeColor, strokeWidth, className, borderRadius, shapeRendering, onClick, selected, }: MiniMapNodeProps): JSX.Element; | ||
@@ -5,0 +5,0 @@ displayName: string; |
@@ -1,6 +0,6 @@ | ||
/// <reference types="react" /> | ||
import React from 'react'; | ||
import type { MiniMapNodes } from './types'; | ||
declare function MiniMapNodes({ nodeStrokeColor, nodeColor, nodeClassName, nodeBorderRadius, nodeStrokeWidth, nodeComponent: NodeComponent, onClick, }: MiniMapNodes): JSX.Element; | ||
declare const _default: import("react").MemoExoticComponent<typeof MiniMapNodes>; | ||
declare const _default: React.MemoExoticComponent<typeof MiniMapNodes>; | ||
export default _default; | ||
//# sourceMappingURL=MiniMapNodes.d.ts.map |
{ | ||
"name": "@reactflow/minimap", | ||
"version": "11.6.3", | ||
"version": "11.7.0", | ||
"description": "Minimap component for React Flow.", | ||
@@ -23,3 +23,3 @@ "keywords": [ | ||
"types": "./dist/esm/index.d.ts", | ||
"import": "./dist/esm/index.js", | ||
"import": "./dist/esm/index.mjs", | ||
"require": "./dist/umd/index.js" | ||
@@ -48,3 +48,3 @@ }, | ||
"zustand": "^4.4.1", | ||
"@reactflow/core": "11.8.3" | ||
"@reactflow/core": "11.9.0" | ||
}, | ||
@@ -51,0 +51,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
170679
952
+ Added@reactflow/core@11.9.0(transitive)
- Removed@reactflow/core@11.8.3(transitive)
Updated@reactflow/core@11.9.0