@conboai/storybook.components 0.2.70 → 0.2.72
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/build/index.d.ts +1 -1
- package/dist/components/Geo/LoadScriptWrapper.d.ts +7 -0
- package/dist/components/Geo/components/NumericMarker/index.d.ts +4 -0
- package/dist/components/Geo/components/NumericMarker/types.d.ts +6 -0
- package/dist/components/Geo/components/Polygon/index.d.ts +11 -0
- package/dist/components/Geo/components/Polyline/index.d.ts +9 -0
- package/dist/components/Geo/components/ShapeDrawer/index.d.ts +13 -0
- package/dist/components/Geo/constants.d.ts +13 -0
- package/dist/components/Geo/index.d.ts +5 -0
- package/dist/components/Geo/styles.d.ts +43 -0
- package/dist/components/Geo/types.d.ts +44 -0
- package/dist/components/Geo/useFullscreen.d.ts +2 -0
- package/dist/components/Geo/useMousePosition.d.ts +11 -0
- package/dist/components/Geo/utils.d.ts +5 -0
- package/dist/components/Shapes/Menu/index.d.ts +4 -0
- package/dist/components/Shapes/Menu/styles.d.ts +30 -0
- package/dist/components/Shapes/Menu/types.d.ts +13 -0
- package/dist/components/Shapes/MousePoint/index.d.ts +8 -0
- package/dist/components/Shapes/NumericMarker/index.d.ts +8 -0
- package/dist/components/Shapes/Text/index.d.ts +9 -0
- package/dist/components/Shapes/constants.d.ts +7 -0
- package/dist/components/Shapes/index.d.ts +5 -0
- package/dist/components/Shapes/types.d.ts +47 -0
- package/dist/components/Shapes/utils.d.ts +8 -0
- package/dist/components/TrailPathView/utils.d.ts +2 -2
- package/dist/storybook.components.mjs +16519 -16448
- package/package.json +1 -1
package/dist/build/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export { AlertPopup } from '../components/AlertPopup';
|
|
|
30
30
|
export { extractPrefix, extractZip, startsWithAny, parseSvg, getParsedSvgViewsFromZip } from '../components/MetroMap/MetroMapUtils';
|
|
31
31
|
export { TimelineChart } from '../components/TimelineChart';
|
|
32
32
|
export { TrailPathView } from '../components/TrailPathView';
|
|
33
|
-
export { LoadScriptWrapper } from '../
|
|
33
|
+
export { LoadScriptWrapper } from '../components/Geo/LoadScriptWrapper';
|
|
34
34
|
export * from '../interfaces/filter';
|
|
35
35
|
export * from '../interfaces/tab';
|
|
36
36
|
export * from '../interfaces/detailsView';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CoordinatePoint, GeoMode, GeoType } from '../../types';
|
|
3
|
+
|
|
4
|
+
export interface IPolygonProps {
|
|
5
|
+
onChange?: (polygonPath: CoordinatePoint[]) => void;
|
|
6
|
+
data?: GeoType | null;
|
|
7
|
+
mode?: GeoMode;
|
|
8
|
+
showNumbers?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Polygon: ({ onChange: onChangeFromProps, data, mode, showNumbers }: IPolygonProps) => React.JSX.Element;
|
|
11
|
+
export default Polygon;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CoordinatePoint, GeoType } from '../../types';
|
|
3
|
+
|
|
4
|
+
declare const Polyline: ({ onChange: onChangeFromProps, data, showNumbers, }: {
|
|
5
|
+
onChange?: (polygonPath: CoordinatePoint[]) => void;
|
|
6
|
+
data?: GeoType | null;
|
|
7
|
+
showNumbers?: boolean;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export default Polyline;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React, Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { CoordinatePoint, GeoMode } from '../../types';
|
|
3
|
+
|
|
4
|
+
interface ShapeDrawerProps {
|
|
5
|
+
mapInstance: google.maps.Map | null;
|
|
6
|
+
onComplete?: (path: CoordinatePoint[]) => void;
|
|
7
|
+
onChange?: (path: CoordinatePoint[], isCompleted?: boolean) => void;
|
|
8
|
+
resetKey: number;
|
|
9
|
+
mode: GeoMode;
|
|
10
|
+
setMode: Dispatch<SetStateAction<GeoMode>>;
|
|
11
|
+
}
|
|
12
|
+
export declare const ShapeDrawer: ({ mapInstance, onComplete, onChange, resetKey, mode, setMode }: ShapeDrawerProps) => React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { GeoComponentProps } from './types';
|
|
3
|
+
|
|
4
|
+
declare const Geo: ({ mode: modeFromProps, resetKey: resetKeyFromProps, onChange: onChangeFromProps, onComplete, data, onMouseMove, showNumbers, zoom }: GeoComponentProps) => React.JSX.Element;
|
|
5
|
+
export default Geo;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const resetStyles: {
|
|
2
|
+
width: string;
|
|
3
|
+
height: string;
|
|
4
|
+
minHeight: string;
|
|
5
|
+
borderRadius: string;
|
|
6
|
+
position: string;
|
|
7
|
+
right: string;
|
|
8
|
+
top: string;
|
|
9
|
+
zIndex: string;
|
|
10
|
+
color: string;
|
|
11
|
+
cursor: string;
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
border: string;
|
|
14
|
+
fontWeight: string;
|
|
15
|
+
boxShadow: string;
|
|
16
|
+
'&.${buttonClasses.disabled}': {
|
|
17
|
+
cursor: string;
|
|
18
|
+
opacity: string;
|
|
19
|
+
};
|
|
20
|
+
'&:hover': {
|
|
21
|
+
color: string;
|
|
22
|
+
backgroundColor: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const drawingManagerPolygonOptions: {
|
|
26
|
+
fillColor: string;
|
|
27
|
+
strokeColor: string;
|
|
28
|
+
fillOpacity: number;
|
|
29
|
+
strokeOpacity: number;
|
|
30
|
+
strokeWeight: number;
|
|
31
|
+
zIndex: number;
|
|
32
|
+
editable: boolean;
|
|
33
|
+
};
|
|
34
|
+
export declare const drawingManagerPolylineOptions: {
|
|
35
|
+
fillColor: string;
|
|
36
|
+
strokeColor: string;
|
|
37
|
+
fillOpacity: number;
|
|
38
|
+
strokeOpacity: number;
|
|
39
|
+
editable: boolean;
|
|
40
|
+
clickable: boolean;
|
|
41
|
+
strokeWeight: number;
|
|
42
|
+
zIndex: number;
|
|
43
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare enum EntityTypes {
|
|
2
|
+
Marker = "marker",
|
|
3
|
+
Infobox = "infobox",
|
|
4
|
+
Polygon = "polygon",
|
|
5
|
+
Polyline = "polyline"
|
|
6
|
+
}
|
|
7
|
+
export interface GeoType {
|
|
8
|
+
id?: string;
|
|
9
|
+
type: EntityTypes;
|
|
10
|
+
coordinates: Array<CoordinatePoint>;
|
|
11
|
+
zoom?: number;
|
|
12
|
+
isInFov?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface CoordinatePoint {
|
|
15
|
+
lat: number;
|
|
16
|
+
lng: number;
|
|
17
|
+
}
|
|
18
|
+
export type GeoMode = {
|
|
19
|
+
type: 'view';
|
|
20
|
+
shape: 'polyline' | 'polygon';
|
|
21
|
+
} | {
|
|
22
|
+
type: 'edit';
|
|
23
|
+
shape: '';
|
|
24
|
+
} | {
|
|
25
|
+
type: 'drawing';
|
|
26
|
+
shape: 'polyline' | 'polygon';
|
|
27
|
+
};
|
|
28
|
+
export interface GeoComponentProps {
|
|
29
|
+
onChange?: (polygonPath: CoordinatePoint[], isCompleted?: boolean) => void;
|
|
30
|
+
onComplete?: (polygonPath: CoordinatePoint[]) => void;
|
|
31
|
+
mode?: GeoMode;
|
|
32
|
+
resetKey?: number;
|
|
33
|
+
data?: GeoType[] | null;
|
|
34
|
+
onMouseMove?: (coordinatePoint: CoordinatePoint) => void;
|
|
35
|
+
showNumbers?: boolean;
|
|
36
|
+
zoom?: number;
|
|
37
|
+
}
|
|
38
|
+
export declare enum LibraryTypes {
|
|
39
|
+
DRAWING = "drawing",
|
|
40
|
+
GEOMETRY = "geometry",
|
|
41
|
+
MARKER = "marker",
|
|
42
|
+
PLACES = "places",
|
|
43
|
+
VISUALISATION = "visualization"
|
|
44
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const useMousePosition: (path: google.maps.LatLng[] | undefined, isPolygonComplete: boolean) => {
|
|
2
|
+
mousePositionPath: (google.maps.LatLng | {
|
|
3
|
+
lat: number;
|
|
4
|
+
lng: number;
|
|
5
|
+
} | undefined)[];
|
|
6
|
+
onMouseMove: (event: google.maps.MapMouseEvent) => void;
|
|
7
|
+
mouseCoordinates: {
|
|
8
|
+
lat: number;
|
|
9
|
+
lng: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CoordinatePoint } from './types';
|
|
2
|
+
|
|
3
|
+
export declare const getCoordinates: (polyPath: google.maps.MVCArray<google.maps.LatLng>) => CoordinatePoint[];
|
|
4
|
+
export declare const getLatLngArray: (path: google.maps.LatLng[]) => CoordinatePoint[];
|
|
5
|
+
export declare const pointsAreClose: (p1: google.maps.LatLng, p2: google.maps.LatLng, threshold?: number) => boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const defaultStyle: {
|
|
2
|
+
opacity: number;
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
color: string;
|
|
5
|
+
borderRadius: string;
|
|
6
|
+
border: string;
|
|
7
|
+
'&:hover': {
|
|
8
|
+
backgroundColor: string;
|
|
9
|
+
cursor: string;
|
|
10
|
+
color: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const disabledStyle: {
|
|
14
|
+
color: string;
|
|
15
|
+
opacity: number;
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
'&:hover': {
|
|
18
|
+
cursor: string;
|
|
19
|
+
filter: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare const mainContainerStyles: {
|
|
23
|
+
display: string;
|
|
24
|
+
gap: number;
|
|
25
|
+
position: string;
|
|
26
|
+
zIndex: number;
|
|
27
|
+
cursor: string;
|
|
28
|
+
right: number;
|
|
29
|
+
top: number;
|
|
30
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ShapeMode, Point, Shape } from '../types';
|
|
2
|
+
|
|
3
|
+
export interface IMenuProps {
|
|
4
|
+
onClear: () => void;
|
|
5
|
+
mode: ShapeMode;
|
|
6
|
+
onModeChange: (mode: ShapeMode) => void;
|
|
7
|
+
drawCoordinates: Point[];
|
|
8
|
+
setDrawCoordinates: (coordinates: Point[]) => void;
|
|
9
|
+
selectedShape?: Shape | null;
|
|
10
|
+
allowAdd: boolean;
|
|
11
|
+
allowEdit: boolean;
|
|
12
|
+
allowDelete: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IShapesProps } from './types';
|
|
3
|
+
|
|
4
|
+
declare const Shapes: ({ children, mode: modeFromProps, onModeChange: _onModeChange, shapes: shapesFromProps, selected, onShapeChange, onShapeSelect, onMouseMove, menu, showNumbers, showPoints, showId }: IShapesProps) => React.JSX.Element;
|
|
5
|
+
export default Shapes;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface Point {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}
|
|
7
|
+
export declare enum ShapeType {
|
|
8
|
+
Point = 0,
|
|
9
|
+
Polygon = 1,
|
|
10
|
+
Polyline = 2
|
|
11
|
+
}
|
|
12
|
+
export declare enum ShapeMode {
|
|
13
|
+
View = 0,
|
|
14
|
+
Edit = 1,
|
|
15
|
+
CreatePolygon = 2
|
|
16
|
+
}
|
|
17
|
+
export interface Shape {
|
|
18
|
+
id: string;
|
|
19
|
+
type: ShapeType;
|
|
20
|
+
points: Point[];
|
|
21
|
+
isInFov?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface NormalizedPoint {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
}
|
|
27
|
+
export interface IShapesProps {
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
mode?: ShapeMode;
|
|
30
|
+
onModeChange?: (mode: ShapeMode) => void;
|
|
31
|
+
shapes: Shape[];
|
|
32
|
+
selected?: Shape | null;
|
|
33
|
+
showId?: boolean;
|
|
34
|
+
menu?: {
|
|
35
|
+
show: boolean;
|
|
36
|
+
options?: {
|
|
37
|
+
edit: boolean;
|
|
38
|
+
add: boolean;
|
|
39
|
+
delete: boolean;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
onShapeChange?: (updatedShape: Shape | null, updatedShapesList: Shape[]) => void;
|
|
43
|
+
onShapeSelect?: (selectedShape: Shape | null, shapesList: Shape[]) => void;
|
|
44
|
+
onMouseMove?: (mousePoint: NormalizedPoint) => void;
|
|
45
|
+
showNumbers?: boolean;
|
|
46
|
+
showPoints?: boolean;
|
|
47
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NormalizedPoint, Point } from './types';
|
|
2
|
+
|
|
3
|
+
export declare const generateRainbowColor: (id: string, total: number) => string;
|
|
4
|
+
export declare const toNormalizedCoords: (x: number, y: number, rect: DOMRect) => NormalizedPoint;
|
|
5
|
+
export declare const toPixelCoords: (x: number, y: number, rect: DOMRect) => NormalizedPoint;
|
|
6
|
+
export declare const calculateCoordinates: (points: Point[], rect: DOMRect | null) => string | undefined;
|
|
7
|
+
export declare const isPointNearFirstPoint: (point: NormalizedPoint, firstPoint: NormalizedPoint, threshold?: number) => boolean;
|
|
8
|
+
export declare const calculateDistanceToSegment: (point: Point, segmentStart: Point, segmentEnd: Point) => number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Point } from '
|
|
2
|
-
import { CoordinatePoint } from '
|
|
1
|
+
import { Point } from '../Shapes/types';
|
|
2
|
+
import { CoordinatePoint } from '../Geo/types';
|
|
3
3
|
|
|
4
4
|
export declare const arrayToShapePoints: (points: number[][]) => Point[];
|
|
5
5
|
export declare const arrayToGeoCoordinates: (coordinates: number[][]) => CoordinatePoint[];
|