@lincle/react-web-minimap 0.4.0-next.7 → 0.4.0-next.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,12 +8,17 @@ const MiniMapPlain_1 = __importDefault(require("../MiniMapPlain"));
8
8
  const react_1 = require("react");
9
9
  const react_resize_detector_1 = require("react-resize-detector");
10
10
  const displayName = 'LincleMiniMap';
11
- const MiniMap = ({ gutter, height, node, width }) => {
11
+ const MiniMap = ({ className: givenClassname, gutter, height, node, style, width }) => {
12
12
  const { height: lincleHeight = 0, ref, width: lincleWidth = 0 } = (0, react_resize_detector_1.useResizeDetector)({
13
13
  refreshMode: 'debounce',
14
14
  refreshRate: 16
15
15
  });
16
- return ((0, jsx_runtime_1.jsx)("div", { className: 'lincle-minimap', ref: ref, children: (0, jsx_runtime_1.jsx)(MiniMapPlain_1.default, { className: 'lincle-minimap-container', gutter: gutter, height: height, lincleHeight: lincleHeight, lincleWidth: lincleWidth, node: node, width: width }) }));
16
+ const className = (0, react_1.useMemo)(() => {
17
+ return `lincle-minimap ${givenClassname}`;
18
+ }, [
19
+ givenClassname
20
+ ]);
21
+ return ((0, jsx_runtime_1.jsx)("div", { className: className, ref: ref, style: style, children: (0, jsx_runtime_1.jsx)(MiniMapPlain_1.default, { className: 'lincle-minimap-container', gutter: gutter, height: height, lincleHeight: lincleHeight, lincleWidth: lincleWidth, node: node, width: width }) }));
17
22
  };
18
23
  MiniMap.displayName = displayName;
19
24
  exports.default = (0, react_1.memo)(MiniMap);
@@ -7,8 +7,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const MiniMapNode_1 = __importDefault(require("../MiniMapNode"));
8
8
  const react_web_interactive_1 = require("@lincle/react-web-interactive");
9
9
  const react_1 = require("react");
10
- const displayName = 'LincleMiniMap';
11
- const MiniMap = ({ className, gutter: givenGutter = 8, height: givenMapHeight, lincleHeight = 0, lincleWidth = 0, node: nodeFunction, width: givenMapWidth }) => {
10
+ const displayName = 'LincleMiniMapPlain';
11
+ const MiniMapPlain = ({ className, gutter: givenGutter = 8, height: givenMapHeight, lincleHeight = 0, lincleWidth = 0, node: nodeFunction, width: givenMapWidth }) => {
12
12
  const nodePositions = (0, react_web_interactive_1.useNodePositions)();
13
13
  const { x: translateX, y: translateY } = (0, react_web_interactive_1.useTranslate)();
14
14
  const scale = (0, react_web_interactive_1.useScale)();
@@ -142,5 +142,5 @@ const MiniMap = ({ className, gutter: givenGutter = 8, height: givenMapHeight, l
142
142
  null :
143
143
  ((0, jsx_runtime_1.jsxs)("svg", { className: `lincle-minimap-svg ${className}`, height: map.height, viewBox: viewBox, width: map.width, children: [Nodes, (0, jsx_runtime_1.jsx)("path", { d: d, fill: 'rgba(238, 238, 238, 0.65)', fillRule: 'evenodd' })] }));
144
144
  };
145
- MiniMap.displayName = displayName;
146
- exports.default = (0, react_1.memo)(MiniMap);
145
+ MiniMapPlain.displayName = displayName;
146
+ exports.default = (0, react_1.memo)(MiniMapPlain);
package/dist/styles.g.css CHANGED
@@ -7,7 +7,7 @@
7
7
  .lincle-minimap-container {
8
8
  position: absolute;
9
9
  right: 16px;
10
- bottom: 32px;
10
+ bottom: 16px;
11
11
  }
12
12
 
13
13
  .lincle-minimap-pad {
package/dist/types.d.ts CHANGED
@@ -1,20 +1,22 @@
1
1
  import { type Dimensions, type Shape } from '@lincle/react-shared';
2
- import { type ReactElement } from 'react';
2
+ import { type CSSProperties, type ReactElement } from 'react';
3
3
  export type MiniMapProps = {
4
- gutter?: number;
5
- height?: number;
6
- node?: (dimensions: Dimensions) => ReactElement;
7
- width?: number;
4
+ readonly className?: string;
5
+ readonly gutter?: number;
6
+ readonly height?: number;
7
+ readonly node?: (dimensions: Dimensions) => ReactElement;
8
+ readonly style?: CSSProperties;
9
+ readonly width?: number;
8
10
  };
9
11
  export type MiniMapPlainProps = MiniMapProps & {
10
- className: string;
11
- lincleHeight: number;
12
- lincleWidth: number;
12
+ readonly className: string;
13
+ readonly lincleHeight: number;
14
+ readonly lincleWidth: number;
13
15
  };
14
16
  export type MiniMapNodeProps = {
15
- height: number;
16
- shape?: Shape;
17
- width: number;
18
- x: number;
19
- y: number;
17
+ readonly height: number;
18
+ readonly shape?: Shape;
19
+ readonly width: number;
20
+ readonly x: number;
21
+ readonly y: number;
20
22
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@lincle/react-web-minimap",
3
3
  "title": "lincle react web minimap",
4
4
  "license": "LGPL-3.0-or-later",
5
- "version": "0.4.0-next.7",
5
+ "version": "0.4.0-next.9",
6
6
  "private": false,
7
7
  "description": "A 'reactive' React node and edge generator",
8
8
  "author": "wallzero @wallzeroblog (http://wallzero.com)",
@@ -68,8 +68,8 @@
68
68
  "rimraf": "^6.0.1"
69
69
  },
70
70
  "dependencies": {
71
- "@lincle/react-shared": "^0.4.0-next.7",
72
- "@lincle/react-web-interactive": "^0.4.0-next.7",
71
+ "@lincle/react-shared": "^0.4.0-next.9",
72
+ "@lincle/react-web-interactive": "^0.4.0-next.9",
73
73
  "react-resize-detector": "^11.0.1"
74
74
  },
75
75
  "peerDependencies": {
@@ -91,5 +91,5 @@
91
91
  "acyclical graph",
92
92
  "cyclical graph"
93
93
  ],
94
- "gitHead": "4457d7dd7df752f71d0559c5db389177a008252e"
94
+ "gitHead": "d7fa7e864236834436e54af196d3836e9c46ab23"
95
95
  }