reac-mapper 0.1.1
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.
- package/dist/index.d.mts +95 -0
- package/dist/index.d.ts +95 -0
- package/dist/index.js +1044 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1017 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +75 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type Point$1 = {
|
|
5
|
+
id: string;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
10
|
+
type Edge = {
|
|
11
|
+
id: string;
|
|
12
|
+
from: string;
|
|
13
|
+
to: string;
|
|
14
|
+
};
|
|
15
|
+
type NaturalSize = {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
type ImageSource = {
|
|
20
|
+
type: "img";
|
|
21
|
+
src: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: "next";
|
|
24
|
+
src: string;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type ImageWithPointsProps = {
|
|
30
|
+
image: ImageSource;
|
|
31
|
+
naturalSize?: NaturalSize;
|
|
32
|
+
edges?: Edge[];
|
|
33
|
+
pointRadius?: number;
|
|
34
|
+
pointFill?: string;
|
|
35
|
+
lineWidth?: number;
|
|
36
|
+
lineStroke?: string;
|
|
37
|
+
className?: string;
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
title?: string;
|
|
40
|
+
desc?: string;
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
points: Point$1[];
|
|
43
|
+
};
|
|
44
|
+
declare function ImageWithPoints({ image, naturalSize, edges, pointRadius, pointFill, lineWidth, lineStroke, className, style, title, desc, children, points }: ImageWithPointsProps): react_jsx_runtime.JSX.Element;
|
|
45
|
+
|
|
46
|
+
type DrawerMode = "pan" | "add" | "move" | "erase";
|
|
47
|
+
type FloorMapDrawerProps = {
|
|
48
|
+
image: ImageSource;
|
|
49
|
+
naturalSize?: NaturalSize;
|
|
50
|
+
points?: Point$1[];
|
|
51
|
+
edges?: Edge[];
|
|
52
|
+
defaultPoints?: Point$1[];
|
|
53
|
+
defaultEdges?: Edge[];
|
|
54
|
+
onChange?: (data: {
|
|
55
|
+
points: Point$1[];
|
|
56
|
+
edges: Edge[];
|
|
57
|
+
}) => void;
|
|
58
|
+
onModeChange?: (mode: DrawerMode) => void;
|
|
59
|
+
pointRadius?: number;
|
|
60
|
+
activePointRadius?: number;
|
|
61
|
+
pointFill?: string;
|
|
62
|
+
activePointFill?: string;
|
|
63
|
+
lineWidth?: number;
|
|
64
|
+
lineStroke?: string;
|
|
65
|
+
connectSequential?: boolean;
|
|
66
|
+
panEnabled?: boolean;
|
|
67
|
+
zoomEnabled?: boolean;
|
|
68
|
+
minZoom?: number;
|
|
69
|
+
maxZoom?: number;
|
|
70
|
+
zoomStep?: number;
|
|
71
|
+
zoomOnCtrlWheel?: boolean;
|
|
72
|
+
showToolbar?: boolean;
|
|
73
|
+
initialMode?: DrawerMode;
|
|
74
|
+
className?: string;
|
|
75
|
+
style?: React.CSSProperties;
|
|
76
|
+
svgClassName?: string;
|
|
77
|
+
title?: string;
|
|
78
|
+
desc?: string;
|
|
79
|
+
};
|
|
80
|
+
declare function FloorMapDrawer(props: FloorMapDrawerProps): react_jsx_runtime.JSX.Element;
|
|
81
|
+
|
|
82
|
+
type Point = {
|
|
83
|
+
id: number;
|
|
84
|
+
x: number;
|
|
85
|
+
y: number;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
interface MapperProps {
|
|
89
|
+
src?: string;
|
|
90
|
+
initialPoints?: Omit<Point, "id">[];
|
|
91
|
+
maxWidth?: number;
|
|
92
|
+
}
|
|
93
|
+
declare const Mapper: ({ src, initialPoints, maxWidth, }: MapperProps) => react_jsx_runtime.JSX.Element;
|
|
94
|
+
|
|
95
|
+
export { type Edge, FloorMapDrawer, type ImageSource, ImageWithPoints, Mapper, type NaturalSize, type Point$1 as Point };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type Point$1 = {
|
|
5
|
+
id: string;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
10
|
+
type Edge = {
|
|
11
|
+
id: string;
|
|
12
|
+
from: string;
|
|
13
|
+
to: string;
|
|
14
|
+
};
|
|
15
|
+
type NaturalSize = {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
type ImageSource = {
|
|
20
|
+
type: "img";
|
|
21
|
+
src: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: "next";
|
|
24
|
+
src: string;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type ImageWithPointsProps = {
|
|
30
|
+
image: ImageSource;
|
|
31
|
+
naturalSize?: NaturalSize;
|
|
32
|
+
edges?: Edge[];
|
|
33
|
+
pointRadius?: number;
|
|
34
|
+
pointFill?: string;
|
|
35
|
+
lineWidth?: number;
|
|
36
|
+
lineStroke?: string;
|
|
37
|
+
className?: string;
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
title?: string;
|
|
40
|
+
desc?: string;
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
points: Point$1[];
|
|
43
|
+
};
|
|
44
|
+
declare function ImageWithPoints({ image, naturalSize, edges, pointRadius, pointFill, lineWidth, lineStroke, className, style, title, desc, children, points }: ImageWithPointsProps): react_jsx_runtime.JSX.Element;
|
|
45
|
+
|
|
46
|
+
type DrawerMode = "pan" | "add" | "move" | "erase";
|
|
47
|
+
type FloorMapDrawerProps = {
|
|
48
|
+
image: ImageSource;
|
|
49
|
+
naturalSize?: NaturalSize;
|
|
50
|
+
points?: Point$1[];
|
|
51
|
+
edges?: Edge[];
|
|
52
|
+
defaultPoints?: Point$1[];
|
|
53
|
+
defaultEdges?: Edge[];
|
|
54
|
+
onChange?: (data: {
|
|
55
|
+
points: Point$1[];
|
|
56
|
+
edges: Edge[];
|
|
57
|
+
}) => void;
|
|
58
|
+
onModeChange?: (mode: DrawerMode) => void;
|
|
59
|
+
pointRadius?: number;
|
|
60
|
+
activePointRadius?: number;
|
|
61
|
+
pointFill?: string;
|
|
62
|
+
activePointFill?: string;
|
|
63
|
+
lineWidth?: number;
|
|
64
|
+
lineStroke?: string;
|
|
65
|
+
connectSequential?: boolean;
|
|
66
|
+
panEnabled?: boolean;
|
|
67
|
+
zoomEnabled?: boolean;
|
|
68
|
+
minZoom?: number;
|
|
69
|
+
maxZoom?: number;
|
|
70
|
+
zoomStep?: number;
|
|
71
|
+
zoomOnCtrlWheel?: boolean;
|
|
72
|
+
showToolbar?: boolean;
|
|
73
|
+
initialMode?: DrawerMode;
|
|
74
|
+
className?: string;
|
|
75
|
+
style?: React.CSSProperties;
|
|
76
|
+
svgClassName?: string;
|
|
77
|
+
title?: string;
|
|
78
|
+
desc?: string;
|
|
79
|
+
};
|
|
80
|
+
declare function FloorMapDrawer(props: FloorMapDrawerProps): react_jsx_runtime.JSX.Element;
|
|
81
|
+
|
|
82
|
+
type Point = {
|
|
83
|
+
id: number;
|
|
84
|
+
x: number;
|
|
85
|
+
y: number;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
interface MapperProps {
|
|
89
|
+
src?: string;
|
|
90
|
+
initialPoints?: Omit<Point, "id">[];
|
|
91
|
+
maxWidth?: number;
|
|
92
|
+
}
|
|
93
|
+
declare const Mapper: ({ src, initialPoints, maxWidth, }: MapperProps) => react_jsx_runtime.JSX.Element;
|
|
94
|
+
|
|
95
|
+
export { type Edge, FloorMapDrawer, type ImageSource, ImageWithPoints, Mapper, type NaturalSize, type Point$1 as Point };
|