@yorab/react-paint 0.10.0 → 0.11.0
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/README.md +173 -1
- package/dist/{components → canvas/components}/Canvas.d.ts +7 -9
- package/dist/{components/toolbox → canvas/components}/EditTextBox.d.ts +4 -4
- package/dist/canvas/constants/app.d.ts +44 -0
- package/dist/canvas/constants/grid.d.ts +1 -0
- package/dist/{constants → canvas/constants}/shapes.d.ts +1 -1
- package/dist/{hooks → canvas/hooks}/useComponent.d.ts +1 -1
- package/dist/{hooks → canvas/hooks}/useDrawableCanvas.d.ts +9 -16
- package/dist/{hooks → canvas/hooks}/useKeyboard.d.ts +4 -6
- package/dist/canvas/hooks/useReactPaint.d.ts +131 -0
- package/dist/{hooks → canvas/hooks}/useShapes.d.ts +7 -8
- package/dist/canvas/index.d.ts +13 -0
- package/dist/{utils → canvas/utils}/canvas.d.ts +3 -2
- package/dist/canvas/utils/data.d.ts +5 -0
- package/dist/{utils → canvas/utils}/file.d.ts +4 -3
- package/dist/canvas/utils/grid.d.ts +2 -0
- package/dist/{utils → canvas/utils}/intersect.d.ts +7 -6
- package/dist/{utils → canvas/utils}/selection/lineSelection.d.ts +5 -4
- package/dist/{utils → canvas/utils}/selection/rectSelection.d.ts +6 -6
- package/dist/canvas/utils/selection/selectionFrame.d.ts +3 -0
- package/dist/canvas/utils/selection.d.ts +8 -0
- package/dist/canvas/utils/shapes/brush.d.ts +20 -0
- package/dist/canvas/utils/shapes/circle.d.ts +17 -0
- package/dist/canvas/utils/shapes/curve.d.ts +17 -0
- package/dist/canvas/utils/shapes/ellipse.d.ts +17 -0
- package/dist/canvas/utils/shapes/index.d.ts +32 -0
- package/dist/canvas/utils/shapes/line.d.ts +17 -0
- package/dist/{utils → canvas/utils}/shapes/path.d.ts +3 -2
- package/dist/canvas/utils/shapes/picture.d.ts +12 -0
- package/dist/canvas/utils/shapes/polygon.d.ts +17 -0
- package/dist/canvas/utils/shapes/rectangle.d.ts +20 -0
- package/dist/{utils → canvas/utils}/shapes/text.d.ts +10 -10
- package/dist/{utils → canvas/utils}/shapes/triangle.d.ts +1 -1
- package/dist/{utils → canvas/utils}/string.d.ts +0 -1
- package/dist/canvas/utils/tools.d.ts +3 -0
- package/dist/{utils → canvas/utils}/transform.d.ts +6 -6
- package/dist/{utils → canvas/utils}/trigo.d.ts +4 -4
- package/dist/{types → common/types}/Shapes.d.ts +4 -6
- package/dist/common/utils/array.d.ts +1 -0
- package/dist/editor/components/common/Loading.d.ts +6 -0
- package/dist/{components → editor/components}/common/Modal.d.ts +2 -2
- package/dist/{components → editor/components}/common/Panel.d.ts +2 -2
- package/dist/{components → editor/components}/common/Snackbar.d.ts +2 -3
- package/dist/{components → editor/components}/settings/ColorField.d.ts +2 -2
- package/dist/{components → editor/components}/settings/DeleteButton.d.ts +2 -3
- package/dist/{components → editor/components}/settings/FontFamilyField.d.ts +2 -2
- package/dist/{components → editor/components}/settings/LayoutButton.d.ts +1 -2
- package/dist/{components → editor/components}/settings/Layouts.d.ts +5 -6
- package/dist/{components → editor/components}/settings/LineArrowField.d.ts +2 -2
- package/dist/{components → editor/components}/settings/LineTypeField.d.ts +3 -3
- package/dist/{components → editor/components}/settings/PointsNumberField.d.ts +2 -2
- package/dist/{components → editor/components}/settings/RangeField.d.ts +2 -2
- package/dist/{components → editor/components}/settings/SelectField.d.ts +2 -2
- package/dist/{components → editor/components}/settings/SettingsBar.d.ts +5 -6
- package/dist/{components → editor/components}/settings/ToggleField.d.ts +2 -2
- package/dist/{components → editor/components}/toolbox/LoadFileTool.d.ts +2 -3
- package/dist/{components → editor/components}/toolbox/MenuGroup.d.ts +3 -4
- package/dist/{components → editor/components}/toolbox/PictureUrlInput.d.ts +1 -2
- package/dist/{components → editor/components}/toolbox/Tool.d.ts +2 -3
- package/dist/{components → editor/components}/toolbox/Toolbar.d.ts +3 -4
- package/dist/{components → editor/components}/toolbox/ToolbarGroup.d.ts +2 -3
- package/dist/editor/constants/grid.d.ts +7 -0
- package/dist/editor/constants/options.d.ts +13 -0
- package/dist/{constants → editor/constants}/snackbar.d.ts +1 -1
- package/dist/{constants → editor/constants}/style.d.ts +0 -3
- package/dist/{constants → editor/constants}/tools.d.ts +1 -1
- package/dist/{hooks → editor/hooks}/useDrag.d.ts +2 -2
- package/dist/{hooks → editor/hooks}/useSnackbar.d.ts +3 -3
- package/dist/editor/index.d.ts +24 -0
- package/dist/{utils → editor/utils}/style.d.ts +1 -1
- package/dist/editor/utils/toolbar.d.ts +11 -0
- package/dist/index.d.ts +6 -0
- package/dist/react-paint.css +1 -1
- package/dist/react-paint.js +1087 -1053
- package/dist/react-paint.umd.cjs +1 -1
- package/package.json +61 -56
- package/dist/components/App.d.ts +0 -20
- package/dist/components/common/Loading.d.ts +0 -7
- package/dist/constants/app.d.ts +0 -45
- package/dist/utils/array.d.ts +0 -1
- package/dist/utils/data.d.ts +0 -4
- package/dist/utils/grid.d.ts +0 -3
- package/dist/utils/selection/selectionFrame.d.ts +0 -2
- package/dist/utils/selection.d.ts +0 -7
- package/dist/utils/shapes/brush.d.ts +0 -20
- package/dist/utils/shapes/circle.d.ts +0 -17
- package/dist/utils/shapes/curve.d.ts +0 -17
- package/dist/utils/shapes/ellipse.d.ts +0 -17
- package/dist/utils/shapes/index.d.ts +0 -35
- package/dist/utils/shapes/line.d.ts +0 -17
- package/dist/utils/shapes/picture.d.ts +0 -12
- package/dist/utils/shapes/polygon.d.ts +0 -17
- package/dist/utils/shapes/rectangle.d.ts +0 -20
- package/dist/utils/toolbar.d.ts +0 -13
- /package/dist/{constants → canvas/constants}/picture.d.ts +0 -0
- /package/dist/{hooks → canvas/hooks}/useDoubleClick.d.ts +0 -0
- /package/dist/{hooks → canvas/hooks}/useResizeObserver.d.ts +0 -0
- /package/dist/{types → common/types}/Mode.d.ts +0 -0
- /package/dist/{types → common/types}/react.d.ts +0 -0
- /package/dist/{types → common/types}/tools.d.ts +0 -0
- /package/dist/{types → common/types}/utils.d.ts +0 -0
- /package/dist/{utils → common/utils}/dom.d.ts +0 -0
- /package/dist/{utils → common/utils}/object.d.ts +0 -0
- /package/dist/{utils → common/utils}/util.d.ts +0 -0
- /package/dist/{components → editor/components}/common/Button.d.ts +0 -0
- /package/dist/{constants → editor/constants}/icons.d.ts +0 -0
- /package/dist/{constants → editor/constants}/loading.d.ts +0 -0
- /package/dist/{types → editor/types}/snackbar.d.ts +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { SelectionModeResize } from '
|
|
3
|
-
import type { DrawableShape, Point, SelectionDefaultType } from '
|
|
4
|
-
export declare const createRecSelectionPath: (path: Path2D | undefined, rect: DrawableShape,
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeResize } from './../../../common/types/Mode';
|
|
3
|
+
import type { DrawableShape, Point, SelectionDefaultType } from './../../../common/types/Shapes';
|
|
4
|
+
export declare const createRecSelectionPath: (path: Path2D | undefined, rect: DrawableShape, settings: UtilsSettings) => SelectionDefaultType;
|
|
5
5
|
export declare const drawSelectionRect: (ctx: CanvasRenderingContext2D, shape: DrawableShape & {
|
|
6
6
|
selection?: SelectionDefaultType;
|
|
7
|
-
}, selectionColor: string, selectionWidth: number,
|
|
8
|
-
export declare const resizeRectSelection: (cursorPosition: Point, originalShape: DrawableShape, selectionMode: SelectionModeResize,
|
|
7
|
+
}, selectionColor: string, selectionWidth: number, settings: UtilsSettings, withAnchors: boolean) => void;
|
|
8
|
+
export declare const resizeRectSelection: (cursorPosition: Point, originalShape: DrawableShape, selectionMode: SelectionModeResize, settings: UtilsSettings, keepRatio?: boolean) => {
|
|
9
9
|
borderX: number;
|
|
10
10
|
borderHeight: number;
|
|
11
11
|
borderY: number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
2
|
+
import type { HoverModeData, SelectionModeData } from './../../common/types/Mode';
|
|
3
|
+
import type { Point, ShapeEntity } from './../../common/types/Shapes';
|
|
4
|
+
export declare const getNewSelectionData: (hoverMode: HoverModeData, selectedShape: ShapeEntity, cursorPosition: Point, settings: UtilsSettings) => SelectionModeData<Point | number> | undefined;
|
|
5
|
+
export declare const selectShape: (ctx: CanvasRenderingContext2D, shapes: ShapeEntity[], cursorPosition: Point, settings: UtilsSettings, selectedShape: ShapeEntity | undefined, isTouchGesture: boolean, withFrameSelection: boolean) => {
|
|
6
|
+
mode: SelectionModeData<Point | number>;
|
|
7
|
+
shape: ShapeEntity | undefined;
|
|
8
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeResize } from './../../../common/types/Mode';
|
|
3
|
+
import type { DrawableShape, Point, Rect, ShapeEntity } from './../../../common/types/Shapes';
|
|
4
|
+
import type { ToolsSettingsType } from './../../../common/types/tools';
|
|
5
|
+
export declare const refreshBrush: <T extends DrawableShape<"brush">>(brush: T, settings: UtilsSettings) => T;
|
|
6
|
+
export declare const createBrush: (shape: {
|
|
7
|
+
id: string;
|
|
8
|
+
type: 'brush';
|
|
9
|
+
settings: ToolsSettingsType<'brush'>;
|
|
10
|
+
}, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<'brush'>;
|
|
11
|
+
export declare const drawBrush: (ctx: CanvasRenderingContext2D, shape: DrawableShape<'brush'>) => void;
|
|
12
|
+
export declare const getBrushBorder: (brush: DrawableShape<'brush'>, { selectionPadding }: UtilsSettings) => Rect;
|
|
13
|
+
export declare const translateBrush: <U extends DrawableShape<"brush">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings) => U & {
|
|
14
|
+
points: Point[][];
|
|
15
|
+
};
|
|
16
|
+
export declare const resizeBrush: (cursorPosition: Point, originalShape: DrawableShape<'brush'>, selectionMode: SelectionModeResize, settings: UtilsSettings, keepRatio: boolean) => DrawableShape<'brush'>;
|
|
17
|
+
export declare const addNewPointToShape: <T extends DrawableShape<"brush">>(shape: T, cursorPosition: Point, settings: UtilsSettings) => T & {
|
|
18
|
+
points: Point[][];
|
|
19
|
+
};
|
|
20
|
+
export declare const addNewPointGroupToShape: <T extends DrawableShape<"brush">>(shape: T, cursorPosition: Point, settings: UtilsSettings) => T;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeResize } from './../../../common/types/Mode';
|
|
3
|
+
import type { Circle, DrawableShape, Point, Rect, ShapeEntity } from './../../../common/types/Shapes';
|
|
4
|
+
import type { ToolsSettingsType } from './../../../common/types/tools';
|
|
5
|
+
export declare const refreshCircle: <T extends DrawableShape<"circle">>(shape: T, settings: UtilsSettings) => T;
|
|
6
|
+
export declare const createCircle: (shape: {
|
|
7
|
+
id: string;
|
|
8
|
+
type: 'circle';
|
|
9
|
+
settings: ToolsSettingsType<'circle'>;
|
|
10
|
+
}, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<'circle'>;
|
|
11
|
+
export declare const drawCircle: (ctx: CanvasRenderingContext2D, circle: DrawableShape<'circle'>) => void;
|
|
12
|
+
export declare const getCircleBorder: (circle: Circle, settings: UtilsSettings) => Rect;
|
|
13
|
+
export declare const translateCircle: <U extends DrawableShape<"circle">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings) => U & {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const resizeCircle: (cursorPosition: Point, originalShape: DrawableShape<'circle'>, selectionMode: SelectionModeResize, settings: UtilsSettings) => DrawableShape<'circle'>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeResize } from './../../../common/types/Mode';
|
|
3
|
+
import type { DrawableShape, Point, ShapeEntity } from './../../../common/types/Shapes';
|
|
4
|
+
import type { ToolsSettingsType } from './../../../common/types/tools';
|
|
5
|
+
export declare const refreshCurve: <T extends DrawableShape<"curve">>(shape: T, settings: UtilsSettings) => T;
|
|
6
|
+
export declare const createCurve: (shape: {
|
|
7
|
+
id: string;
|
|
8
|
+
type: 'curve';
|
|
9
|
+
settings: ToolsSettingsType<'curve'>;
|
|
10
|
+
}, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<'curve'>;
|
|
11
|
+
export declare const resizeCurve: (cursorPosition: Point, originalShape: DrawableShape<'curve'>, selectionMode: SelectionModeResize<number>, settings: UtilsSettings) => DrawableShape<'curve'>;
|
|
12
|
+
export declare const drawCurve: (ctx: CanvasRenderingContext2D, curve: DrawableShape<'curve'>) => void;
|
|
13
|
+
export declare const getCurveBorder: (polygon: import("./../../../common/types/Shapes").Polygon, settings: UtilsSettings) => import("./../../../common/types/Shapes").Rect;
|
|
14
|
+
export declare const translateCurve: <U extends DrawableShape<"curve">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings) => U & {
|
|
15
|
+
points: [number, number][];
|
|
16
|
+
};
|
|
17
|
+
export declare const updateCurveLinesCount: <T extends DrawableShape<"curve">>(shape: T, newPointsCount: number, settings: UtilsSettings) => T;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeResize } from './../../../common/types/Mode';
|
|
3
|
+
import type { DrawableShape, Ellipse, Point, Rect, ShapeEntity } from './../../../common/types/Shapes';
|
|
4
|
+
import type { ToolsSettingsType } from './../../../common/types/tools';
|
|
5
|
+
export declare const refreshEllipse: <T extends DrawableShape<"ellipse">>(shape: T, settings: UtilsSettings) => T;
|
|
6
|
+
export declare const createEllipse: (shape: {
|
|
7
|
+
id: string;
|
|
8
|
+
type: 'ellipse';
|
|
9
|
+
settings: ToolsSettingsType<'ellipse'>;
|
|
10
|
+
}, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<'ellipse'>;
|
|
11
|
+
export declare const drawEllipse: (ctx: CanvasRenderingContext2D, ellipse: DrawableShape<'ellipse'>) => void;
|
|
12
|
+
export declare const getEllipseBorder: (ellipse: Ellipse, settings: UtilsSettings) => Rect;
|
|
13
|
+
export declare const translateEllipse: <U extends DrawableShape<"ellipse">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings) => U & {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const resizeEllipse: (cursorPosition: Point, originalShape: DrawableShape<'ellipse'>, selectionMode: SelectionModeResize, settings: UtilsSettings, keepRatio?: boolean) => DrawableShape<'ellipse'>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeData } from './../../../common/types/Mode';
|
|
3
|
+
import type { DrawableShape, Point, Rect, ShapeEntity } from './../../../common/types/Shapes';
|
|
4
|
+
import type { CustomTool } from './../../../common/types/tools';
|
|
5
|
+
export declare const createShape: (ctx: CanvasRenderingContext2D, shape: Exclude<CustomTool, {
|
|
6
|
+
type: 'picture';
|
|
7
|
+
}>, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity;
|
|
8
|
+
export declare const drawShape: (ctx: CanvasRenderingContext2D, shape: DrawableShape, settings: UtilsSettings) => void;
|
|
9
|
+
export declare const getShapeInfos: (shape: DrawableShape, settings: UtilsSettings) => {
|
|
10
|
+
borders: Rect;
|
|
11
|
+
center: Point;
|
|
12
|
+
};
|
|
13
|
+
export declare const rotateShape: <T extends DrawableShape>(shape: T, cursorPosition: Point, originalShape: T, originalCursorPosition: Point, shapeCenter: Point, settings: UtilsSettings) => T & {
|
|
14
|
+
rotation: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const resizeShape: <T extends DrawableShape>(ctx: CanvasRenderingContext2D, shape: T, cursorPosition: Point, originalShape: T, selectionMode: SelectionModeData<Point | number>, settings: UtilsSettings, isShiftPressed: boolean) => T;
|
|
17
|
+
export declare const translateShape: (cursorPosition: Point, originalShape: ShapeEntity, originalCursorPosition: Point, settings: UtilsSettings) => ShapeEntity;
|
|
18
|
+
export declare const refreshShape: (shape: ShapeEntity, settings: UtilsSettings) => ShapeEntity;
|
|
19
|
+
export declare const drawShapeSelection: ({ ctx, shape, settings, selectionWidth, selectionColor, withAnchors }: {
|
|
20
|
+
ctx: CanvasRenderingContext2D;
|
|
21
|
+
shape: DrawableShape;
|
|
22
|
+
settings: UtilsSettings;
|
|
23
|
+
selectionWidth: number;
|
|
24
|
+
selectionColor: string;
|
|
25
|
+
withAnchors?: boolean;
|
|
26
|
+
}) => void;
|
|
27
|
+
export declare const drawSelectionFrame: ({ ctx, selectionFrame, settings }: {
|
|
28
|
+
ctx: CanvasRenderingContext2D;
|
|
29
|
+
selectionFrame: [Point, Point];
|
|
30
|
+
settings: UtilsSettings;
|
|
31
|
+
}) => void;
|
|
32
|
+
export declare const copyShape: (shape: ShapeEntity, settings: UtilsSettings) => ShapeEntity;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeResize } from './../../../common/types/Mode';
|
|
3
|
+
import type { DrawableShape, Line, Point, Rect, ShapeEntity, StyleShape, Triangle } from './../../../common/types/Shapes';
|
|
4
|
+
import type { ToolsSettingsType } from './../../../common/types/tools';
|
|
5
|
+
export declare const refreshLine: <T extends DrawableShape<"line">>(line: T, settings: UtilsSettings) => T;
|
|
6
|
+
export declare const createLine: (shape: {
|
|
7
|
+
id: string;
|
|
8
|
+
type: 'line';
|
|
9
|
+
settings: ToolsSettingsType<'line'>;
|
|
10
|
+
}, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<'line'>;
|
|
11
|
+
export declare const buildTriangleOnLine: (center: Point, rotation: number, lineStyle: StyleShape) => Triangle;
|
|
12
|
+
export declare const drawLine: (ctx: CanvasRenderingContext2D, shape: DrawableShape<'line'>) => void;
|
|
13
|
+
export declare const getLineBorder: (line: Line, settings: UtilsSettings) => Rect;
|
|
14
|
+
export declare const translateLine: <U extends DrawableShape<"line">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings) => U & {
|
|
15
|
+
points: [Point, Point];
|
|
16
|
+
};
|
|
17
|
+
export declare const resizeLine: <U extends DrawableShape<"line">>(cursorPosition: Point, originalShape: U, selectionMode: SelectionModeResize<number>, settings: UtilsSettings) => U;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { Circle, DrawableShape, Line, Rect } from './../../../common/types/Shapes';
|
|
2
3
|
export declare const createRecPath: (rect: Rect) => Path2D;
|
|
3
4
|
export declare const createCirclePath: (shape: Circle) => Path2D;
|
|
4
5
|
export declare const createEllipsePath: (ellipse: DrawableShape<'ellipse'>) => Path2D;
|
|
5
6
|
export declare const createLinePath: (line: Line) => Path2D;
|
|
6
|
-
export declare const createBrushPath: (brush: DrawableShape<'brush'>,
|
|
7
|
+
export declare const createBrushPath: (brush: DrawableShape<'brush'>, settings: UtilsSettings) => Path2D | undefined;
|
|
7
8
|
export declare const createCurvePath: (curve: DrawableShape<'curve'>) => Path2D | undefined;
|
|
8
9
|
export declare const createPolygonPath: (polygon: DrawableShape<'polygon'>) => Path2D | undefined;
|
|
9
10
|
export declare const createTrianglePath: (triangle: DrawableShape<'triangle'>) => Path2D;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeResize } from './../../../common/types/Mode';
|
|
3
|
+
import type { DrawableShape, Picture, Point, Rect, ShapeEntity } from './../../../common/types/Shapes';
|
|
4
|
+
export declare const refreshPicture: <T extends DrawableShape<"picture">>(shape: T, settings: UtilsSettings) => T;
|
|
5
|
+
export declare const createPicture: (fileOrUrl: File | string, maxPictureWidth: number, maxPictureHeight: number, settings: UtilsSettings) => Promise<ShapeEntity<"picture">>;
|
|
6
|
+
export declare const drawPicture: (ctx: CanvasRenderingContext2D, picture: DrawableShape<'picture'>) => void;
|
|
7
|
+
export declare const getPictureBorder: (picture: Picture, settings: UtilsSettings) => Rect;
|
|
8
|
+
export declare const translatePicture: <U extends DrawableShape<"picture">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings) => U & {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const resizePicture: (cursorPosition: Point, originalShape: DrawableShape<'picture'>, selectionMode: SelectionModeResize, settings: UtilsSettings, keepRatio: boolean) => DrawableShape<'picture'>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeResize } from './../../../common/types/Mode';
|
|
3
|
+
import type { DrawableShape, Point, Polygon, Rect, ShapeEntity } from './../../../common/types/Shapes';
|
|
4
|
+
import type { ToolsSettingsType } from './../../../common/types/tools';
|
|
5
|
+
export declare const refreshPolygon: <T extends DrawableShape<"polygon">>(shape: T, settings: UtilsSettings) => T;
|
|
6
|
+
export declare const createPolygon: (shape: {
|
|
7
|
+
id: string;
|
|
8
|
+
type: 'polygon';
|
|
9
|
+
settings: ToolsSettingsType<'polygon'>;
|
|
10
|
+
}, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<'polygon'>;
|
|
11
|
+
export declare const drawPolygon: (ctx: CanvasRenderingContext2D, polygon: DrawableShape<'polygon'>) => void;
|
|
12
|
+
export declare const getPolygonBorder: (polygon: Polygon, settings: UtilsSettings) => Rect;
|
|
13
|
+
export declare const translatePolygon: <U extends DrawableShape<"polygon">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings) => U & {
|
|
14
|
+
points: [number, number][];
|
|
15
|
+
};
|
|
16
|
+
export declare const resizePolygon: (cursorPosition: Point, originalShape: DrawableShape<'polygon'>, selectionMode: SelectionModeResize<number>, settings: UtilsSettings) => DrawableShape<'polygon'>;
|
|
17
|
+
export declare const updatePolygonLinesCount: <T extends DrawableShape<"polygon">>(shape: T, newPointsCount: number, settings: UtilsSettings) => T;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeResize } from './../../../common/types/Mode';
|
|
3
|
+
import type { DrawableShape, Point, Rect, ShapeEntity } from './../../../common/types/Shapes';
|
|
4
|
+
import type { ToolsSettingsType } from './../../../common/types/tools';
|
|
5
|
+
type rectish = 'text' | 'rect' | 'square' | 'picture';
|
|
6
|
+
export declare const refreshRect: <T extends DrawableShape<rectish>>(rect: T, settings: UtilsSettings) => T;
|
|
7
|
+
export declare const createRectangle: <T extends "rect" | "square">(shape: {
|
|
8
|
+
id: string;
|
|
9
|
+
type: T;
|
|
10
|
+
settings: ToolsSettingsType<T>;
|
|
11
|
+
}, cursorPosition: Point, settings: UtilsSettings, width?: number, height?: number) => ShapeEntity<T>;
|
|
12
|
+
export declare const drawRect: (ctx: CanvasRenderingContext2D, shape: DrawableShape<'rect' | 'square'>) => void;
|
|
13
|
+
export declare const getRectBorder: (rect: Rect, settings: UtilsSettings) => Rect;
|
|
14
|
+
export declare const getRectOppositeAnchorAbsolutePosition: <T extends DrawableShape & Rect>(anchor: Point, center: Point, shape: T, settings: UtilsSettings, [negW, negH]?: [boolean, boolean]) => Point;
|
|
15
|
+
export declare const translateRect: <T extends "rect" | "square", U extends DrawableShape<T>>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings) => U & {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const resizeRect: <T extends rectish>(cursorPosition: Point, originalShape: DrawableShape<T>, selectionMode: SelectionModeResize, settings: UtilsSettings, keepRatio?: boolean) => DrawableShape<T>;
|
|
20
|
+
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SelectionModeResize } from '
|
|
3
|
-
import type { DrawableShape, Point, Rect, ShapeEntity, Text } from '
|
|
4
|
-
import type { ToolsSettingsType } from '
|
|
5
|
-
export declare const refreshText: <T extends DrawableShape<"text">>(shape: T,
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeResize } from './../../../common/types/Mode';
|
|
3
|
+
import type { DrawableShape, Point, Rect, ShapeEntity, Text } from './../../../common/types/Shapes';
|
|
4
|
+
import type { ToolsSettingsType } from './../../../common/types/tools';
|
|
5
|
+
export declare const refreshText: <T extends DrawableShape<"text">>(shape: T, settings: UtilsSettings) => T;
|
|
6
6
|
export declare const calculateTextFontSize: (ctx: CanvasRenderingContext2D, text: string[], maxWidth: number, fontBold: boolean, fontItalic: boolean, fontFamily?: string | undefined) => number;
|
|
7
7
|
export declare const createText: (ctx: CanvasRenderingContext2D, shape: {
|
|
8
8
|
id: string;
|
|
9
9
|
type: 'text';
|
|
10
10
|
settings: ToolsSettingsType<'text'>;
|
|
11
|
-
}, cursorPosition: Point,
|
|
11
|
+
}, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<'text'>;
|
|
12
12
|
export declare const drawText: (ctx: CanvasRenderingContext2D, text: DrawableShape<'text'>) => void;
|
|
13
|
-
export declare const getTextBorder: (text: Text,
|
|
14
|
-
export declare const translateText: <U extends DrawableShape<"text">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point,
|
|
13
|
+
export declare const getTextBorder: (text: Text, settings: UtilsSettings) => Rect;
|
|
14
|
+
export declare const translateText: <U extends DrawableShape<"text">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings) => U & {
|
|
15
15
|
x: number;
|
|
16
16
|
y: number;
|
|
17
17
|
};
|
|
18
|
-
export declare const resizeText: (ctx: CanvasRenderingContext2D, cursorPosition: Point, originalShape: DrawableShape<'text'>, selectionMode: SelectionModeResize,
|
|
19
|
-
export declare const resizeTextShapeWithNewContent: <U extends DrawableShape<"text">>(ctx: CanvasRenderingContext2D, shape: U, newValue: string[],
|
|
18
|
+
export declare const resizeText: (ctx: CanvasRenderingContext2D, cursorPosition: Point, originalShape: DrawableShape<'text'>, selectionMode: SelectionModeResize, settings: UtilsSettings) => DrawableShape<'text'>;
|
|
19
|
+
export declare const resizeTextShapeWithNewContent: <U extends DrawableShape<"text">>(ctx: CanvasRenderingContext2D, shape: U, newValue: string[], settings: UtilsSettings) => U;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DrawableShape, Triangle } from '
|
|
1
|
+
import type { DrawableShape, Triangle } from './../../../common/types/Shapes';
|
|
2
2
|
export declare const createTriangle: (triangle: Triangle) => DrawableShape<'triangle'>;
|
|
3
3
|
export declare const drawTriangle: (ctx: CanvasRenderingContext2D, triangle: DrawableShape<'triangle'>) => void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { SelectionModeData } from '
|
|
3
|
-
import type { DrawableShape, Line, Point, ShapeEntity } from '
|
|
1
|
+
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeData } from './../../common/types/Mode';
|
|
3
|
+
import type { DrawableShape, Line, Point, ShapeEntity } from './../../common/types/Shapes';
|
|
4
4
|
export declare const getNormalizedSize: (originalWidth: number, originalHeight: number, width: number, height: number) => number[];
|
|
5
5
|
export declare const roundValues: (prop: number, precision?: number) => number;
|
|
6
6
|
export declare const scalePoint: (point: Point, minX: number, minY: number, scaleX?: number, scaleY?: number) => Point;
|
|
7
|
-
export declare const roundForGrid: (value: number,
|
|
8
|
-
export declare const roundRotationForGrid: (rotation: number,
|
|
9
|
-
export declare const transformShape: (ctx: CanvasRenderingContext2D, shape: ShapeEntity, cursorPosition: Point,
|
|
7
|
+
export declare const roundForGrid: (value: number, settings: UtilsSettings, gridOffset?: number) => number;
|
|
8
|
+
export declare const roundRotationForGrid: (rotation: number, settings: UtilsSettings, gridOffset?: number) => number;
|
|
9
|
+
export declare const transformShape: (ctx: CanvasRenderingContext2D, shape: ShapeEntity, cursorPosition: Point, selectionMode: SelectionModeData<Point | number>, settings: UtilsSettings, isShiftPressed: boolean) => ShapeEntity;
|
|
10
10
|
export declare const fitContentInsideContainer: (contentWidth: number, contentHeight: number, containerWidth: number, containerHeight: number, shouldFillContainer?: boolean) => number[];
|
|
11
11
|
export declare const shortenLine: ({ line, size, direction }: {
|
|
12
12
|
line: DrawableShape<'line'>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Circle, Point, Rect } from '
|
|
1
|
+
import type { Circle, Point, Rect } from './../../common/types/Shapes';
|
|
2
2
|
type Vector = [Point, Point];
|
|
3
3
|
export declare const degreesToRadians: (degrees: number) => number;
|
|
4
4
|
export declare const radiansToDegrees: (radians: number) => number;
|
|
5
5
|
export declare const isPointInsideRect: (rect: Rect, point: Point) => boolean;
|
|
6
6
|
export declare const isCircleIntersectRect: (rect: Rect, circle: Circle) => boolean;
|
|
7
7
|
export declare const rotatePoint: ({ origin, point, rotation }: {
|
|
8
|
-
origin?: Point
|
|
8
|
+
origin?: Point;
|
|
9
9
|
point: Point;
|
|
10
10
|
rotation: number;
|
|
11
11
|
}) => Point;
|
|
12
12
|
export declare const getAngleFromVector: ({ targetVector: [point1, point2], radian, originVector }: {
|
|
13
13
|
targetVector: Vector;
|
|
14
|
-
radian?: boolean
|
|
15
|
-
originVector?: Vector
|
|
14
|
+
radian?: boolean;
|
|
15
|
+
originVector?: Vector;
|
|
16
16
|
}) => number;
|
|
17
17
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShapeTypeArray } from '
|
|
1
|
+
import type { ShapeTypeArray } from '../../canvas/constants/shapes';
|
|
2
2
|
export type ShapeType = (typeof ShapeTypeArray)[number];
|
|
3
3
|
export type Point = [number, number];
|
|
4
4
|
export type Rect = {
|
|
@@ -64,6 +64,7 @@ export type SelectionLinesType = {
|
|
|
64
64
|
anchors: Path2D[];
|
|
65
65
|
};
|
|
66
66
|
export type DrawableShape<T extends ShapeType = ShapeType> = {
|
|
67
|
+
toolId?: string;
|
|
67
68
|
visible?: boolean;
|
|
68
69
|
locked?: boolean;
|
|
69
70
|
rotation: number;
|
|
@@ -114,15 +115,12 @@ export type DrawableShape<T extends ShapeType = ShapeType> = {
|
|
|
114
115
|
scaleX?: number;
|
|
115
116
|
scaleY?: number;
|
|
116
117
|
} : never);
|
|
117
|
-
export type DrawableShapeJson<T extends ShapeType = ShapeType> = DrawableShape<T> & {
|
|
118
|
-
translation?: Point;
|
|
119
|
-
};
|
|
120
118
|
export type ShapeEntity<T extends Exclude<ShapeType, 'triangle'> = Exclude<ShapeType, 'triangle'>> = {
|
|
121
119
|
id: string;
|
|
122
120
|
toolId?: string;
|
|
123
121
|
} & DrawableShape<T>;
|
|
124
|
-
export type
|
|
125
|
-
shapes?:
|
|
122
|
+
export type StateData = {
|
|
123
|
+
shapes?: DrawableShape[];
|
|
126
124
|
config?: {
|
|
127
125
|
width: number;
|
|
128
126
|
height: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const compact: <T>(array: (T | undefined | null)[]) => T[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import './Modal.css';
|
|
3
3
|
type ModalType = {
|
|
4
4
|
children: ReactNode;
|
|
@@ -6,5 +6,5 @@ type ModalType = {
|
|
|
6
6
|
position?: 'center' | 'bottom';
|
|
7
7
|
className?: string;
|
|
8
8
|
};
|
|
9
|
-
declare const Modal: ({ children, onClose, position, className }: ModalType) =>
|
|
9
|
+
declare const Modal: ({ children, onClose, position, className }: ModalType) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default Modal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import './Panel.css';
|
|
3
3
|
type PanelType = {
|
|
4
4
|
vertical?: boolean;
|
|
@@ -9,5 +9,5 @@ type PanelType = {
|
|
|
9
9
|
position?: 'bottom' | 'top';
|
|
10
10
|
alignment?: 'left' | 'right' | 'center';
|
|
11
11
|
};
|
|
12
|
-
declare const Panel: ({ children, title, className, position, fitContainer, alignment }: PanelType) =>
|
|
12
|
+
declare const Panel: ({ children, title, className, position, fitContainer, alignment }: PanelType) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default Panel;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { SnackBarType } from '../../types/snackbar';
|
|
1
|
+
import type { SnackBarType } from './../../../editor/types/snackbar';
|
|
3
2
|
import './Snackbar.css';
|
|
4
3
|
type SnackbarContainerType = {
|
|
5
4
|
snackbarList: SnackBarType[];
|
|
6
5
|
};
|
|
7
|
-
declare const SnackbarContainer: ({ snackbarList }: SnackbarContainerType) =>
|
|
6
|
+
declare const SnackbarContainer: ({ snackbarList }: SnackbarContainerType) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export default SnackbarContainer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import './ColorField.css';
|
|
3
3
|
type ShapeStyleColorType = {
|
|
4
4
|
selectedSettings: string | undefined;
|
|
@@ -11,5 +11,5 @@ type ShapeStyleColorType = {
|
|
|
11
11
|
values: string[];
|
|
12
12
|
valueChanged: (field: string, value: string | number) => void;
|
|
13
13
|
};
|
|
14
|
-
declare const ColorField: ({ selectedSettings, setSelectedSettings, title, mode, disabled, values, field, value, valueChanged }: ShapeStyleColorType) =>
|
|
14
|
+
declare const ColorField: ({ selectedSettings, setSelectedSettings, title, mode, disabled, values, field, value, valueChanged }: ShapeStyleColorType) => import("react/jsx-runtime").JSX.Element | null;
|
|
15
15
|
export default ColorField;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { ShapeEntity } from '../../types/Shapes';
|
|
1
|
+
import type { ShapeEntity } from './../../../common/types/Shapes';
|
|
3
2
|
type DeleteShapeButtonType = {
|
|
4
3
|
disabled?: boolean;
|
|
5
4
|
selectedShape: ShapeEntity;
|
|
6
5
|
removeShape: (shape: ShapeEntity) => void;
|
|
7
6
|
};
|
|
8
|
-
declare const DeleteButton: ({ disabled, selectedShape, removeShape }: DeleteShapeButtonType) =>
|
|
7
|
+
declare const DeleteButton: ({ disabled, selectedShape, removeShape }: DeleteShapeButtonType) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default DeleteButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import './FontFamilyField.css';
|
|
3
3
|
type FontFamilyFieldType = {
|
|
4
4
|
selectedSettings: string | undefined;
|
|
@@ -8,5 +8,5 @@ type FontFamilyFieldType = {
|
|
|
8
8
|
defaultValue?: number | string | undefined;
|
|
9
9
|
valueChanged: (field: string, value: string | number) => void;
|
|
10
10
|
};
|
|
11
|
-
declare const FontFamilyField: ({ selectedSettings, setSelectedSettings, disabled, values, defaultValue, valueChanged }: FontFamilyFieldType) =>
|
|
11
|
+
declare const FontFamilyField: ({ selectedSettings, setSelectedSettings, disabled, values, defaultValue, valueChanged }: FontFamilyFieldType) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
12
|
export default FontFamilyField;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import './LayoutButton.css';
|
|
3
2
|
type LayoutButtonType = {
|
|
4
3
|
disabled: boolean;
|
|
5
4
|
toggleLayoutPanel: () => void;
|
|
6
5
|
};
|
|
7
|
-
declare const LayoutButton: ({ disabled, toggleLayoutPanel }: LayoutButtonType) =>
|
|
6
|
+
declare const LayoutButton: ({ disabled, toggleLayoutPanel }: LayoutButtonType) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export default LayoutButton;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
import type { GridFormatType } from '../../constants/app';
|
|
1
|
+
import type { ShapeEntity } from './../../../common/types/Shapes';
|
|
2
|
+
import type { GridLabelType } from './../../../editor/constants/grid';
|
|
4
3
|
import './Layouts.css';
|
|
5
4
|
type LayoutsType = {
|
|
6
|
-
gridFormat:
|
|
7
|
-
setGridFormat:
|
|
5
|
+
gridFormat: GridLabelType;
|
|
6
|
+
setGridFormat: (value: GridLabelType) => void;
|
|
8
7
|
disabled?: boolean;
|
|
9
8
|
shapes: ShapeEntity[];
|
|
10
9
|
removeShape: (shape: ShapeEntity) => void;
|
|
@@ -15,5 +14,5 @@ type LayoutsType = {
|
|
|
15
14
|
moveShapes: (firstShapeId: string, lastShapeId: string) => void;
|
|
16
15
|
isLayoutPanelShown: boolean;
|
|
17
16
|
};
|
|
18
|
-
declare const Layouts: ({ gridFormat, setGridFormat, disabled, shapes, removeShape, toggleShapeVisibility, toggleShapeLock, selectedShape, moveShapes, selectShape, isLayoutPanelShown }: LayoutsType) =>
|
|
17
|
+
declare const Layouts: ({ gridFormat, setGridFormat, disabled, shapes, removeShape, toggleShapeVisibility, toggleShapeLock, selectedShape, moveShapes, selectShape, isLayoutPanelShown }: LayoutsType) => import("react/jsx-runtime").JSX.Element | null;
|
|
19
18
|
export default Layouts;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import './LineArrowField.css';
|
|
3
3
|
type LineArrowType = {
|
|
4
4
|
selectedSettings: string | undefined;
|
|
@@ -8,5 +8,5 @@ type LineArrowType = {
|
|
|
8
8
|
defaultValue?: number | string | undefined;
|
|
9
9
|
valueChanged: (field: string, value: string | number) => void;
|
|
10
10
|
};
|
|
11
|
-
declare const LineArrowField: ({ selectedSettings, setSelectedSettings, disabled, values, defaultValue, valueChanged }: LineArrowType) =>
|
|
11
|
+
declare const LineArrowField: ({ selectedSettings, setSelectedSettings, disabled, values, defaultValue, valueChanged }: LineArrowType) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
12
|
export default LineArrowField;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import './LineTypeField.css';
|
|
3
3
|
type LineTypeOptionType = {
|
|
4
4
|
children: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const LineTypeOption: ({ children }: LineTypeOptionType) =>
|
|
6
|
+
export declare const LineTypeOption: ({ children }: LineTypeOptionType) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
type LineTypeType = {
|
|
8
8
|
selectedSettings: string | undefined;
|
|
9
9
|
setSelectedSettings: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
@@ -12,5 +12,5 @@ type LineTypeType = {
|
|
|
12
12
|
defaultValue?: number | string | undefined;
|
|
13
13
|
valueChanged: (field: string, value: string | number) => void;
|
|
14
14
|
};
|
|
15
|
-
declare const LineTypeField: ({ selectedSettings, setSelectedSettings, disabled, values, defaultValue, valueChanged }: LineTypeType) =>
|
|
15
|
+
declare const LineTypeField: ({ selectedSettings, setSelectedSettings, disabled, values, defaultValue, valueChanged }: LineTypeType) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
16
|
export default LineTypeField;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
type PointsNumberFieldType = {
|
|
3
3
|
selectedSettings: string | undefined;
|
|
4
4
|
setSelectedSettings: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
@@ -9,5 +9,5 @@ type PointsNumberFieldType = {
|
|
|
9
9
|
value?: number | undefined;
|
|
10
10
|
valueChanged: (field: string, value: string | number) => void;
|
|
11
11
|
};
|
|
12
|
-
declare const PointsNumberField: ({ selectedSettings, setSelectedSettings, disabled, min, max, step, value, valueChanged }: PointsNumberFieldType) =>
|
|
12
|
+
declare const PointsNumberField: ({ selectedSettings, setSelectedSettings, disabled, min, max, step, value, valueChanged }: PointsNumberFieldType) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
13
|
export default PointsNumberField;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import './RangeField.css';
|
|
3
3
|
type ShapeStyleColorType = {
|
|
4
4
|
selectedSettings: string | undefined;
|
|
@@ -14,5 +14,5 @@ type ShapeStyleColorType = {
|
|
|
14
14
|
value?: number | undefined;
|
|
15
15
|
valueChanged: (field: string, value: string | number, needHistorySave?: boolean) => void;
|
|
16
16
|
};
|
|
17
|
-
declare const RangeField: ({ selectedSettings, setSelectedSettings, title, icon, disabled, field, value, min, max, step, unity, valueChanged }: ShapeStyleColorType) =>
|
|
17
|
+
declare const RangeField: ({ selectedSettings, setSelectedSettings, title, icon, disabled, field, value, min, max, step, unity, valueChanged }: ShapeStyleColorType) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
18
|
export default RangeField;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import './SelectField.css';
|
|
3
3
|
type SelectFieldType = {
|
|
4
4
|
CustomOption: React.FC<{
|
|
@@ -14,5 +14,5 @@ type SelectFieldType = {
|
|
|
14
14
|
defaultValue?: number | string | undefined;
|
|
15
15
|
valueChanged: (field: string, value: string | number) => void;
|
|
16
16
|
};
|
|
17
|
-
declare const SelectField: ({ CustomOption, selectedSettings, setSelectedSettings, title, disabled, field, icon, values, defaultValue, valueChanged }: SelectFieldType) =>
|
|
17
|
+
declare const SelectField: ({ CustomOption, selectedSettings, setSelectedSettings, title, disabled, field, icon, values, defaultValue, valueChanged }: SelectFieldType) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
18
|
export default SelectField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { ShapeEntity } from '
|
|
3
|
-
import type { CustomTool, ToolsType } from '
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { ShapeEntity } from './../../../common/types/Shapes';
|
|
3
|
+
import type { CustomTool, ToolsType } from './../../../common/types/tools';
|
|
4
4
|
import './SettingsBar.css';
|
|
5
5
|
type SettingsBoxType = {
|
|
6
6
|
width: number;
|
|
@@ -11,11 +11,10 @@ type SettingsBoxType = {
|
|
|
11
11
|
activeTool: ToolsType;
|
|
12
12
|
selectedShape: ShapeEntity | undefined;
|
|
13
13
|
canvas: HTMLCanvasElement | null;
|
|
14
|
-
|
|
15
|
-
selectionPadding: number;
|
|
14
|
+
settings: UtilsSettings;
|
|
16
15
|
updateShape: (shape: ShapeEntity, withSave?: boolean) => void;
|
|
17
16
|
removeShape: (shape: ShapeEntity) => void;
|
|
18
17
|
toggleLayoutPanel: () => void;
|
|
19
18
|
};
|
|
20
|
-
declare const SettingsBar: ({ width, disabled, availableTools, updateToolSettings, layersManipulation, toggleLayoutPanel, activeTool, selectedShape, canvas,
|
|
19
|
+
declare const SettingsBar: ({ width, disabled, availableTools, updateToolSettings, layersManipulation, toggleLayoutPanel, activeTool, selectedShape, canvas, settings, updateShape, removeShape }: SettingsBoxType) => import("react/jsx-runtime").JSX.Element;
|
|
21
20
|
export default SettingsBar;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
type ShapeStyleSelectType = {
|
|
3
3
|
setSelectedSettings: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
4
4
|
disabled?: boolean;
|
|
@@ -8,5 +8,5 @@ type ShapeStyleSelectType = {
|
|
|
8
8
|
value?: boolean;
|
|
9
9
|
valueChanged: (field: string, value: boolean) => void;
|
|
10
10
|
};
|
|
11
|
-
declare const ToggleField: ({ setSelectedSettings, disabled, field, icon, values, value, valueChanged }: ShapeStyleSelectType) =>
|
|
11
|
+
declare const ToggleField: ({ setSelectedSettings, disabled, field, icon, values, value, valueChanged }: ShapeStyleSelectType) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
12
|
export default ToggleField;
|