@conboai/storybook.components 0.6.61 → 0.6.64

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,9 +1,5 @@
1
1
  import { FC } from 'react';
2
2
 
3
- export interface Point {
4
- x: number;
5
- y: number;
6
- }
7
3
  interface ICrossLineArrowProps {
8
4
  points: {
9
5
  x: number;
@@ -1,3 +1,3 @@
1
- import { Point } from './index';
1
+ import { IPoint } from '../types';
2
2
 
3
- export declare const useDirectionState: (directionFromProps: number | undefined, points: Point[], rect: DOMRect | null) => number | undefined;
3
+ export declare const useDirectionState: (directionFromProps: number | undefined, points: IPoint[], rect: DOMRect | null) => number | undefined;
@@ -1,4 +1,4 @@
1
- import { Point } from '../types';
1
+ import { IPoint } from '../types';
2
2
 
3
- export declare const getMidpoint: (points: Point[]) => Point;
4
- export declare const getLineAngle: (p1: Point, p2: Point, rect: DOMRect) => number;
3
+ export declare const getMidpoint: (points: IPoint[]) => IPoint;
4
+ export declare const getLineAngle: (p1: IPoint, p2: IPoint, rect: DOMRect) => number;
@@ -1,4 +1,4 @@
1
- import { Point } from '../types';
1
+ import { IPoint } from '../types';
2
2
 
3
3
  export interface IHeaderProps {
4
4
  header: {
@@ -6,5 +6,5 @@ export interface IHeaderProps {
6
6
  };
7
7
  styles?: Record<string, any>;
8
8
  rect: DOMRect | null;
9
- point: Point;
9
+ point: IPoint;
10
10
  }
@@ -1,11 +1,11 @@
1
- import { Point, Shape, ShapeMode } from '../types';
1
+ import { IPoint, Shape, ShapeMode } from '../types';
2
2
 
3
3
  export interface IMenuProps {
4
4
  onClear: () => void;
5
5
  mode: ShapeMode;
6
6
  onModeChange: (mode: ShapeMode) => void;
7
- drawCoordinates: Point[];
8
- setDrawCoordinates: (coordinates: Point[]) => void;
7
+ drawCoordinates: IPoint[];
8
+ setDrawCoordinates: (coordinates: IPoint[]) => void;
9
9
  selectedShape?: Shape | null;
10
10
  allowAdd: boolean;
11
11
  allowEdit: boolean;
@@ -1,8 +1,8 @@
1
1
  import { default as React } from 'react';
2
- import { Point } from '../types';
2
+ import { IPoint } from '../types';
3
3
 
4
4
  export declare const MousePoint: ({ coordinates, rect, isInFov, styles }: {
5
- coordinates: Point;
5
+ coordinates: IPoint;
6
6
  rect: DOMRect | null;
7
7
  isInFov?: boolean;
8
8
  styles?: {
@@ -1,8 +1,8 @@
1
1
  import { default as React } from 'react';
2
- import { Point } from '../types';
2
+ import { IPoint } from '../types';
3
3
 
4
4
  export declare const NumericMarker: ({ point, number, rect }: {
5
- point: Point;
5
+ point: IPoint;
6
6
  number: number;
7
7
  rect: DOMRect;
8
8
  }) => React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { IPoint } from '../types';
3
+
4
+ export declare const Point: ({ coordinates, rect, styles }: {
5
+ coordinates: IPoint;
6
+ rect: DOMRect | null;
7
+ isInFov?: boolean;
8
+ styles?: {
9
+ fill?: string;
10
+ stroke?: string;
11
+ };
12
+ }) => React.JSX.Element | null;
@@ -1,13 +1,14 @@
1
1
  import { ReactNode } from 'react';
2
2
 
3
- export interface Point {
3
+ export interface IPoint {
4
4
  x: number;
5
5
  y: number;
6
6
  }
7
7
  export declare enum ShapeType {
8
- Point = 0,
9
- Polygon = 1,
10
- Polyline = 2
8
+ MousePoint = 0,
9
+ Point = 1,
10
+ Polygon = 2,
11
+ Polyline = 3
11
12
  }
12
13
  export declare enum ShapeMode {
13
14
  View = 0,
@@ -21,7 +22,7 @@ export interface Shape {
21
22
  type: ShapeType;
22
23
  forbidEdit?: boolean;
23
24
  isCompleted?: boolean;
24
- points: Point[];
25
+ points: IPoint[];
25
26
  isInFov?: boolean;
26
27
  styles?: Record<string, any>;
27
28
  crossLine?: {
@@ -33,7 +34,8 @@ export interface Shape {
33
34
  styles?: Record<string, any>;
34
35
  };
35
36
  showDirection?: boolean;
36
- showEndDirection?: boolean;
37
+ showStartMarker?: boolean;
38
+ showEndMarker?: boolean;
37
39
  }
38
40
  export interface IShapesProps {
39
41
  children?: ReactNode;
@@ -52,7 +54,7 @@ export interface IShapesProps {
52
54
  };
53
55
  onShapeChange?: <T extends Shape>(updatedShape: T | null, updatedShapesList: T[], rect?: DOMRect) => void;
54
56
  onShapeSelect?: <T extends Shape>(selectedShape: T | null, shapesList: T[]) => void;
55
- onMouseMove?: (mousePoint: Point) => void;
57
+ onMouseMove?: (mousePoint: IPoint) => void;
56
58
  showDirection?: boolean;
57
59
  showNumbers?: boolean;
58
60
  showOnlyPoints?: boolean;
@@ -66,7 +68,8 @@ export interface IShapesProps {
66
68
  startMarkerLabel?: string;
67
69
  endMarkerLabel?: string;
68
70
  showEndDirection?: boolean;
69
- showPolylineMarkerEnd?: boolean;
71
+ showStartMarker?: boolean;
72
+ showEndMarker?: boolean;
70
73
  polylineStroke?: string;
71
74
  polylineCircleFill?: string;
72
75
  textFill?: string;
@@ -1,20 +1,20 @@
1
- import { Point, Shape } from './types';
1
+ import { IPoint, Shape } from './types';
2
2
 
3
3
  export declare const generateRainbowColor: (id: string, total: number) => string;
4
- export declare const _snapToBoundaries: (point: Point, threshold?: number) => Point;
5
- export declare const toNormalizedCoords: (x: number, y: number, rect: DOMRect) => Point;
6
- export declare const toPixelCoords: (x: number, y: number, rect: DOMRect) => Point;
7
- export declare const calculateCoordinates: (points: Point[], rect: DOMRect | null) => string | undefined;
8
- export declare const getLineOrientation: (p1: Point, p2: Point, rect: DOMRect) => "horizontal" | "vertical";
9
- export declare const isPointNearTargetPoint: (point: Point, targetPoint: Point, threshold?: number) => boolean;
10
- export declare const calculateDistanceToSegment: (point: Point, segmentStart: Point, segmentEnd: Point) => number;
11
- export declare const shapePointsToArray: (shapePoints: Point[]) => Array<[number, number]>;
12
- export declare const arrayToShapePoints: (pixelsList?: number[][] | undefined) => Point[];
4
+ export declare const _snapToBoundaries: (point: IPoint, threshold?: number) => IPoint;
5
+ export declare const toNormalizedCoords: (x: number, y: number, rect: DOMRect) => IPoint;
6
+ export declare const toPixelCoords: (x: number, y: number, rect: DOMRect) => IPoint;
7
+ export declare const calculateCoordinates: (points: IPoint[], rect: DOMRect | null) => string | undefined;
8
+ export declare const getLineOrientation: (p1: IPoint, p2: IPoint, rect: DOMRect) => "horizontal" | "vertical";
9
+ export declare const isPointNearTargetPoint: (point: IPoint, targetPoint: IPoint, threshold?: number) => boolean;
10
+ export declare const calculateDistanceToSegment: (point: IPoint, segmentStart: IPoint, segmentEnd: IPoint) => number;
11
+ export declare const shapePointsToArray: (shapePoints: IPoint[]) => Array<[number, number]>;
12
+ export declare const arrayToShapePoints: (pixelsList?: number[][] | undefined) => IPoint[];
13
13
  export declare const getAspectRatio: (width?: number, height?: number) => string;
14
14
  export declare const calculateArea: (polygon: Shape) => number;
15
15
  export declare const findClickedShapes: (clickX: number, clickY: number, shapes: Shape[], svgRect: DOMRect) => Shape[];
16
16
  export declare const findSmallestShape: (shapes: Shape[]) => Shape;
17
17
  export declare function sortPolygonsByArea(polygons: Shape[]): Shape[];
18
- export declare const removeSamePoint: (coordinates?: Point[]) => Point[];
19
- export declare const pointInPolygon: (polygon: Point[], point: Point) => boolean;
20
- export declare const getPolygonCenter: (points?: Point[]) => Point;
18
+ export declare const removeSamePoint: (coordinates?: IPoint[]) => IPoint[];
19
+ export declare const pointInPolygon: (polygon: IPoint[], point: IPoint) => boolean;
20
+ export declare const getPolygonCenter: (points?: IPoint[]) => IPoint;
@@ -1,5 +1,5 @@
1
- import { Point } from '../Shapes/types';
1
+ import { IPoint } from '../Shapes/types';
2
2
  import { CoordinatePoint } from '../Geo/types';
3
3
 
4
- export declare const arrayToShapePoints: (points: number[][]) => Point[];
4
+ export declare const arrayToShapePoints: (points: number[][]) => IPoint[];
5
5
  export declare const arrayToGeoCoordinates: (coordinates: number[][]) => CoordinatePoint[];