@conboai/storybook.components 0.2.71 → 0.2.73

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.
Files changed (29) hide show
  1. package/dist/build/index.d.ts +1 -1
  2. package/dist/components/Geo/LoadScriptWrapper.d.ts +7 -0
  3. package/dist/components/Geo/components/NumericMarker/index.d.ts +4 -0
  4. package/dist/components/Geo/components/NumericMarker/types.d.ts +6 -0
  5. package/dist/components/Geo/components/Polygon/index.d.ts +11 -0
  6. package/dist/components/Geo/components/Polyline/index.d.ts +9 -0
  7. package/dist/components/Geo/components/ShapeDrawer/index.d.ts +13 -0
  8. package/dist/components/Geo/constants.d.ts +13 -0
  9. package/dist/components/Geo/index.d.ts +5 -0
  10. package/dist/components/Geo/styles.d.ts +43 -0
  11. package/dist/components/Geo/types.d.ts +44 -0
  12. package/dist/components/Geo/useFullscreen.d.ts +2 -0
  13. package/dist/components/Geo/useMousePosition.d.ts +11 -0
  14. package/dist/components/Geo/utils.d.ts +5 -0
  15. package/dist/components/Shapes/Menu/index.d.ts +4 -0
  16. package/dist/components/Shapes/Menu/styles.d.ts +30 -0
  17. package/dist/components/Shapes/Menu/types.d.ts +13 -0
  18. package/dist/components/Shapes/MousePoint/index.d.ts +8 -0
  19. package/dist/components/Shapes/NumericMarker/index.d.ts +8 -0
  20. package/dist/components/Shapes/Text/index.d.ts +9 -0
  21. package/dist/components/Shapes/constants.d.ts +7 -0
  22. package/dist/components/Shapes/index.d.ts +5 -0
  23. package/dist/components/Shapes/types.d.ts +47 -0
  24. package/dist/components/Shapes/utils.d.ts +8 -0
  25. package/dist/components/TrailPathView/utils.d.ts +2 -2
  26. package/dist/helpers/utils/date.d.ts +2 -0
  27. package/dist/interfaces/datePicker.d.ts +1 -1
  28. package/dist/storybook.components.mjs +9250 -9188
  29. package/package.json +1 -1
@@ -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 '../core/Geo/LoadScriptWrapper';
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,7 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ import { LibraryTypes } from './types';
3
+
4
+ export declare const libraries: LibraryTypes[];
5
+ export declare const LoadScriptWrapper: ({ children }: {
6
+ children: ReactNode;
7
+ }) => React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { NumericMarkerPropsType } from './types';
3
+
4
+ export default function NumericMarker({ coordinates: { lat, lng }, index }: NumericMarkerPropsType): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { CoordinatePoint } from '../../types';
2
+
3
+ export interface NumericMarkerPropsType {
4
+ index: number;
5
+ coordinates: CoordinatePoint;
6
+ }
@@ -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,13 @@
1
+ import { EntityTypes } from './types';
2
+
3
+ export declare const defaultProps: {
4
+ center: {
5
+ lat: number;
6
+ lng: number;
7
+ };
8
+ zoom: number;
9
+ };
10
+ export declare const defaultGeoObject: {
11
+ type: EntityTypes;
12
+ coordinates: never[];
13
+ };
@@ -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,2 @@
1
+ declare const useFullscreen: () => boolean;
2
+ export default useFullscreen;
@@ -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,4 @@
1
+ import { default as React } from 'react';
2
+ import { IMenuProps } from './types';
3
+
4
+ export declare const Menu: ({ onClear, mode, onModeChange, drawCoordinates, setDrawCoordinates, selectedShape, allowAdd, allowEdit, allowDelete }: IMenuProps) => React.JSX.Element;
@@ -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,8 @@
1
+ import { default as React } from 'react';
2
+ import { Point } from '../types';
3
+
4
+ export declare const MousePoint: ({ coordinates, rect, isInFov }: {
5
+ coordinates: Point;
6
+ rect: DOMRect | null;
7
+ isInFov?: boolean;
8
+ }) => React.JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { Point } from '../types';
3
+
4
+ export declare const NumericMarker: ({ point, number, rect }: {
5
+ point: Point;
6
+ number: number;
7
+ rect: DOMRect;
8
+ }) => React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { Shape } from '../types';
3
+
4
+ interface TextProps {
5
+ shape: Shape;
6
+ rect: DOMRect | null;
7
+ }
8
+ export declare const Text: ({ shape, rect }: TextProps) => React.JSX.Element | undefined;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ShapeType } from './types';
2
+
3
+ export declare const emptyShape: {
4
+ id: string;
5
+ type: ShapeType;
6
+ points: never[];
7
+ };
@@ -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 '../../core/Shapes/types';
2
- import { CoordinatePoint } from '../../core/Geo/types';
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[];
@@ -14,3 +14,5 @@ export declare const convertUTCToTimeZone: (utcDateStr: string, timeZone: string
14
14
  export declare const convertTimezone: (dateString: Date | undefined, targetTimezone: string) => string;
15
15
  export declare const convertLocalToUTCWithFormattedDate: (inputDate: Date, timezone: string) => string;
16
16
  export declare const convertDateFromUTCWithFormattedDateAndDuration: (inputDate: Date, timezone: string, duration: number) => string;
17
+ export declare const isTimeZoneNegative: (time: string | Date, timezone: string) => boolean;
18
+ export declare const convertToUTC: (time: string | Date, timezone: string) => string;
@@ -17,5 +17,5 @@ export interface IDatePicker {
17
17
  format?: string;
18
18
  readonly?: boolean;
19
19
  disabled?: boolean;
20
- timezone: string;
20
+ timezone?: string;
21
21
  }