@conboai/storybook.components 0.5.10 → 0.5.12

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.
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { GeoComponentProps } from './types';
3
3
 
4
- declare const Geo: (props: GeoComponentProps) => React.JSX.Element;
4
+ declare const Geo: ({ mode: modeFromProps, resetKey: resetKeyFromProps, onChange: onChangeFromProps, onComplete, data, selectedGeoId: selectedGeoIdFromProps, onSelect, onMouseMove, onDragEnd, showDirection, showNumbers, allowDelete, allowAdd, disableControls, fitZoom, mapCentering, showOnlyPoints, initialCenter, zoom: zoomFromProps, onLoad, onError, googleMapsApiKey, googleMapsOptions }: GeoComponentProps) => React.JSX.Element;
5
5
  export default Geo;
@@ -1,13 +1,17 @@
1
+ import { ReactElement } from 'react';
2
+
1
3
  export declare enum EntityTypes {
2
4
  Marker = "marker",
3
5
  Infobox = "infobox",
4
6
  Polygon = "polygon",
5
- Polyline = "polyline"
7
+ Polyline = "polyline",
8
+ Circle = "circle"
6
9
  }
7
10
  export interface GeoType {
8
11
  id: string;
9
12
  name?: string;
10
13
  type: EntityTypes;
14
+ color?: string;
11
15
  coordinates: CoordinatePoint[];
12
16
  zoom?: number;
13
17
  isInFov?: boolean;
@@ -42,7 +46,7 @@ export interface GeoComponentProps {
42
46
  showNumbers?: boolean;
43
47
  allowDelete?: boolean;
44
48
  allowAdd?: boolean;
45
- selectedGeoId?: string;
49
+ selectedGeoId?: string | null;
46
50
  zoom?: number;
47
51
  fitZoom?: boolean;
48
52
  mapCentering?: boolean;
@@ -51,6 +55,14 @@ export interface GeoComponentProps {
51
55
  showOnlyPoints?: boolean;
52
56
  disableControls?: boolean;
53
57
  onDragEnd?: (mapInstance: google.maps.Map | null) => void;
58
+ googleMapsApiKey: string;
59
+ onLoad?: (map: google.maps.Map) => void | Promise<void>;
60
+ onError?: (error?: Error) => void | Promise<void>;
61
+ googleMapsOptions?: {
62
+ loadingJSX?: ReactElement;
63
+ errorJSX?: ReactElement;
64
+ options?: Record<string, any>;
65
+ } | null;
54
66
  }
55
67
  export declare enum LibraryTypes {
56
68
  DRAWING = "drawing",
@@ -2,7 +2,7 @@ import { CoordinatePoint } from './types';
2
2
 
3
3
  export declare const getLatLngArray: (path: google.maps.LatLng[]) => CoordinatePoint[];
4
4
  export declare const pointsAreClose: (p1: google.maps.LatLng, p2: google.maps.LatLng, threshold?: number) => boolean;
5
- export declare const findPolygonCenter: (points: CoordinatePoint[]) => CoordinatePoint;
5
+ export declare const findPolygonCenter: (points?: CoordinatePoint[]) => CoordinatePoint | undefined;
6
6
  export declare const findPolylineCenter: (points: CoordinatePoint[]) => CoordinatePoint;
7
7
  export declare const fitBoundsToPoints: (mapInstance: google.maps.Map | null, points: CoordinatePoint[]) => void;
8
8
  export declare const addRandomDecimal: (number: number) => number;
@@ -0,0 +1,22 @@
1
+ import { default as React, CSSProperties, ReactNode } from 'react';
2
+
3
+ interface IGoogleMap {
4
+ googleMapsApiKey: string;
5
+ onMouseMove: (e: google.maps.MapMouseEvent) => void;
6
+ onDragEnd: () => void;
7
+ children: ReactNode;
8
+ options?: google.maps.MapOptions;
9
+ onLoad?: (map: google.maps.Map) => void | Promise<void>;
10
+ onError?: (error?: Error) => void | Promise<void>;
11
+ center?: google.maps.LatLng | google.maps.LatLngLiteral;
12
+ styles?: CSSProperties;
13
+ googleMapsOptions?: {
14
+ loadingJSX?: ReactNode;
15
+ errorJSX?: ReactNode;
16
+ options?: Record<string, any>;
17
+ } | null;
18
+ id?: string;
19
+ zoom: number;
20
+ }
21
+ export declare const GoogleMap: ({ googleMapsApiKey, onMouseMove, onDragEnd, children, options, onLoad, onError, center, styles, zoom, id, googleMapsOptions }: IGoogleMap) => React.JSX.Element;
22
+ export {};
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FC } from 'react';
2
2
  import { SxProps } from '@mui/material';
3
3
  import { CoordinatePoint, GeoMode, GeoType } from '../Geo/types';
4
4
 
@@ -26,6 +26,7 @@ export interface IMapPlayerProps {
26
26
  allowDelete?: boolean;
27
27
  allowAdd?: boolean;
28
28
  mode?: GeoMode;
29
+ googleMapsApiKey: string;
29
30
  }
30
- declare const MapPlayer: React.FC<IMapPlayerProps>;
31
+ declare const MapPlayer: FC<IMapPlayerProps>;
31
32
  export default MapPlayer;
@@ -1,8 +1,25 @@
1
1
  import { MetromapPalleteData } from './MetroMapUtils';
2
2
  import { default as React } from 'react';
3
3
 
4
+ export type MetroMapElementType = {
5
+ tag: string;
6
+ children: MetroMapElementType[];
7
+ attributes: {
8
+ [key: string]: string;
9
+ };
10
+ text?: string;
11
+ fill?: string;
12
+ stroke?: string;
13
+ key?: string | number;
14
+ style?: {
15
+ pointerEvents?: string;
16
+ display?: string;
17
+ textAnchor?: string;
18
+ };
19
+ className?: string;
20
+ };
4
21
  interface IMetroMap {
5
- elements: IElement;
22
+ elements: MetroMapElementType | null;
6
23
  selectedCluster?: string | string[];
7
24
  minor?: string[];
8
25
  major?: string[];
@@ -20,26 +37,6 @@ interface IMetroMap {
20
37
  timing?: MetromapPalleteData[];
21
38
  disabledSectors?: string[];
22
39
  }
23
- interface IElement {
24
- tag: string;
25
- id: string;
26
- text?: string;
27
- attributes: {
28
- [key: string]: string;
29
- };
30
- onClick?: () => void;
31
- onMouseEnter?: () => void;
32
- fill?: string;
33
- stroke?: string;
34
- key?: string | number;
35
- style?: {
36
- pointerEvents?: string;
37
- display?: string;
38
- textAnchor?: string;
39
- };
40
- children: IElement[];
41
- className?: string;
42
- }
43
40
  declare function MetroMap({ elements, onSelect, selectedCluster, minor, major, isMultiSelect, onHover, svgAttributes, showFullNames, isMap, pollutions, timing, disabledSectors }: IMetroMap): React.JSX.Element | null;
44
41
  declare const _default: React.MemoExoticComponent<typeof MetroMap>;
45
42
  export default _default;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FC } from 'react';
2
2
 
3
3
  export declare enum TrailPathType {
4
4
  Geo = 0,
@@ -9,13 +9,15 @@ interface IGeoPath {
9
9
  coordinates: Array<[number, number]>;
10
10
  points?: never;
11
11
  feedUrl?: never;
12
+ googleMapsApiKey: string;
12
13
  }
13
14
  interface IFeedPath {
14
15
  type: TrailPathType.Feed;
15
16
  points: Array<[number, number]>;
16
17
  feedUrl: string;
17
18
  coordinates?: never;
19
+ googleMapsApiKey?: never;
18
20
  }
19
21
  export type ITrailPathView = IGeoPath | IFeedPath;
20
- declare const TrailPathView: React.FC<ITrailPathView>;
22
+ declare const TrailPathView: FC<ITrailPathView>;
21
23
  export default TrailPathView;