@yorab/react-paint 0.11.21 → 0.13.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 +8 -9
- package/dist/canvas/components/Canvas.d.ts +12 -11
- package/dist/canvas/components/EditTextBox.d.ts +1 -2
- package/dist/canvas/constants/app.d.ts +12 -0
- package/dist/canvas/constants/zoom.d.ts +5 -0
- package/dist/canvas/hooks/useComponent.d.ts +4 -3
- package/dist/canvas/hooks/useDrawableCanvas.d.ts +14 -9
- package/dist/canvas/hooks/useKeyboard.d.ts +8 -2
- package/dist/canvas/hooks/usePinchZoomAndMove.d.ts +17 -0
- package/dist/canvas/hooks/useReactPaint.d.ts +40 -27
- package/dist/canvas/hooks/useResizeObserver.d.ts +1 -1
- package/dist/canvas/hooks/useShapes.d.ts +2 -2
- package/dist/canvas/hooks/useZoom.d.ts +21 -0
- package/dist/canvas/utils/file.d.ts +5 -1
- package/dist/canvas/utils/grid.d.ts +1 -1
- package/dist/canvas/utils/intersect.d.ts +12 -3
- package/dist/canvas/utils/selection/lineSelection.d.ts +1 -1
- package/dist/canvas/utils/selection/rectSelection.d.ts +1 -1
- package/dist/canvas/utils/shapes/brush.d.ts +2 -2
- package/dist/canvas/utils/shapes/circle.d.ts +2 -2
- package/dist/canvas/utils/shapes/curve.d.ts +3 -2
- package/dist/canvas/utils/shapes/ellipse.d.ts +2 -2
- package/dist/canvas/utils/shapes/index.d.ts +4 -3
- package/dist/canvas/utils/shapes/line.d.ts +1 -1
- package/dist/canvas/utils/shapes/path.d.ts +2 -2
- package/dist/canvas/utils/shapes/picture.d.ts +2 -2
- package/dist/canvas/utils/shapes/polygon.d.ts +3 -2
- package/dist/canvas/utils/shapes/rectangle.d.ts +3 -3
- package/dist/canvas/utils/shapes/text.d.ts +2 -2
- package/dist/canvas/utils/transform.d.ts +3 -2
- package/dist/canvas/utils/trigo.d.ts +2 -0
- package/dist/canvas/utils/zoom.d.ts +58 -0
- package/dist/common/types/Canvas.d.ts +8 -0
- package/dist/common/types/Mode.d.ts +8 -2
- package/dist/common/types/Shapes.d.ts +3 -1
- package/dist/common/types/tools.d.ts +4 -7
- package/dist/common/utils/util.d.ts +2 -0
- package/dist/editor/components/common/Modal.d.ts +3 -2
- package/dist/editor/components/common/Panel.d.ts +3 -1
- package/dist/editor/components/settings/ClosedPointsField.d.ts +10 -0
- package/dist/editor/components/settings/Layouts.d.ts +3 -2
- package/dist/editor/components/settings/SettingsBar.d.ts +6 -3
- package/dist/editor/components/settings/ZoomButton.d.ts +8 -0
- package/dist/editor/components/toolbox/ExportModal.d.ts +7 -0
- package/dist/editor/components/toolbox/MenuGroup.d.ts +3 -3
- package/dist/editor/components/toolbox/Toolbar.d.ts +5 -5
- package/dist/editor/constants/icons.d.ts +4 -4
- package/dist/editor/hooks/useDrag.d.ts +2 -2
- package/dist/react-paint.css +1 -1
- package/dist/react-paint.js +1249 -1038
- package/dist/react-paint.umd.cjs +1 -1
- package/package.json +18 -23
|
@@ -4,7 +4,7 @@ export declare const createRecPath: (rect: Rect) => Path2D;
|
|
|
4
4
|
export declare const createCirclePath: (shape: Circle) => Path2D;
|
|
5
5
|
export declare const createEllipsePath: (ellipse: DrawableShape<"ellipse">) => Path2D;
|
|
6
6
|
export declare const createLinePath: (line: Line) => Path2D;
|
|
7
|
-
export declare const createBrushPath: (brush: DrawableShape<"brush">,
|
|
7
|
+
export declare const createBrushPath: (brush: DrawableShape<"brush">, { brushAlgo }: UtilsSettings) => Path2D | undefined;
|
|
8
8
|
export declare const createCurvePath: (curve: DrawableShape<"curve">) => Path2D | undefined;
|
|
9
|
-
export declare const createPolygonPath: (polygon: DrawableShape<"polygon">) => Path2D | undefined;
|
|
9
|
+
export declare const createPolygonPath: (polygon: DrawableShape<"polygon"> | DrawableShape<"curve">) => Path2D | undefined;
|
|
10
10
|
export declare const createTrianglePath: (triangle: DrawableShape<"triangle">) => Path2D;
|
|
@@ -5,8 +5,8 @@ export declare const refreshPicture: <T extends DrawableShape<"picture">>(shape:
|
|
|
5
5
|
export declare const createPicture: (fileOrUrl: File | string, maxPictureWidth: number, maxPictureHeight: number, settings: UtilsSettings) => Promise<ShapeEntity<"picture">>;
|
|
6
6
|
export declare const drawPicture: (ctx: CanvasRenderingContext2D, picture: DrawableShape<"picture">) => void;
|
|
7
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 & {
|
|
8
|
+
export declare const translatePicture: <U extends DrawableShape<"picture">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings, singleAxis: boolean) => U & {
|
|
9
9
|
x: number;
|
|
10
10
|
y: number;
|
|
11
11
|
};
|
|
12
|
-
export declare const resizePicture: (cursorPosition: Point, originalShape: DrawableShape<"picture">, selectionMode: SelectionModeResize, settings: UtilsSettings,
|
|
12
|
+
export declare const resizePicture: (cursorPosition: Point, originalShape: DrawableShape<"picture">, selectionMode: SelectionModeResize, settings: UtilsSettings, resizeFromCenter: boolean) => DrawableShape<"picture">;
|
|
@@ -10,8 +10,9 @@ export declare const createPolygon: (shape: {
|
|
|
10
10
|
}, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<"polygon">;
|
|
11
11
|
export declare const drawPolygon: (ctx: CanvasRenderingContext2D, polygon: DrawableShape<"polygon">) => void;
|
|
12
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 & {
|
|
13
|
+
export declare const translatePolygon: <U extends DrawableShape<"polygon">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings, singleAxis: boolean) => U & {
|
|
14
14
|
points: [number, number][];
|
|
15
15
|
};
|
|
16
16
|
export declare const resizePolygon: (cursorPosition: Point, originalShape: DrawableShape<"polygon">, selectionMode: SelectionModeResize<number>, settings: UtilsSettings) => DrawableShape<"polygon">;
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const addPolygonLine: <T extends DrawableShape<"polygon">>(shape: T, lineIndex: number, settings: UtilsSettings) => T;
|
|
18
|
+
export declare const addPolygonPoint: <T extends DrawableShape<"polygon">>(shape: T, cursorPosition: Point, settings: UtilsSettings, temporary?: boolean) => T;
|
|
@@ -11,10 +11,10 @@ export declare const createRectangle: <T extends "rect" | "square">(shape: {
|
|
|
11
11
|
}, cursorPosition: Point, settings: UtilsSettings, width?: number, height?: number) => ShapeEntity<T>;
|
|
12
12
|
export declare const drawRect: (ctx: CanvasRenderingContext2D, shape: DrawableShape<"rect" | "square">) => void;
|
|
13
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,
|
|
15
|
-
export declare const translateRect: <T extends "rect" | "square", U extends DrawableShape<T>>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings) => U & {
|
|
14
|
+
export declare const getRectOppositeAnchorAbsolutePosition: <T extends DrawableShape & Rect>(anchor: Point, center: Point, shape: T, [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, singleAxis: boolean) => U & {
|
|
16
16
|
x: number;
|
|
17
17
|
y: number;
|
|
18
18
|
};
|
|
19
|
-
export declare const resizeRect: <T extends rectish>(cursorPosition: Point, originalShape: DrawableShape<T>, selectionMode: SelectionModeResize, settings: UtilsSettings, keepRatio?: boolean) => DrawableShape<T>;
|
|
19
|
+
export declare const resizeRect: <T extends rectish>(cursorPosition: Point, originalShape: DrawableShape<T>, selectionMode: SelectionModeResize, settings: UtilsSettings, keepRatio?: boolean, resizeFromCenter?: boolean) => DrawableShape<T>;
|
|
20
20
|
export {};
|
|
@@ -11,9 +11,9 @@ export declare const createText: (ctx: CanvasRenderingContext2D, shape: {
|
|
|
11
11
|
}, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity<"text">;
|
|
12
12
|
export declare const drawText: (ctx: CanvasRenderingContext2D, text: DrawableShape<"text">) => void;
|
|
13
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 & {
|
|
14
|
+
export declare const translateText: <U extends DrawableShape<"text">>(cursorPosition: Point, originalShape: U, originalCursorPosition: Point, settings: UtilsSettings, singleAxis: boolean) => 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, settings: UtilsSettings) => DrawableShape<"text">;
|
|
18
|
+
export declare const resizeText: (ctx: CanvasRenderingContext2D, cursorPosition: Point, originalShape: DrawableShape<"text">, selectionMode: SelectionModeResize, settings: UtilsSettings, resizeFromCenter: boolean) => DrawableShape<"text">;
|
|
19
19
|
export declare const resizeTextShapeWithNewContent: <U extends DrawableShape<"text">>(ctx: CanvasRenderingContext2D, shape: U, newValue: string[], settings: UtilsSettings) => U;
|
|
@@ -5,8 +5,9 @@ export declare const getNormalizedSize: (originalWidth: number, originalHeight:
|
|
|
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
7
|
export declare const roundForGrid: (value: number, settings: UtilsSettings, gridOffset?: number) => number;
|
|
8
|
-
export declare const roundRotationForGrid: (rotation: number, settings: UtilsSettings,
|
|
9
|
-
export declare const
|
|
8
|
+
export declare const roundRotationForGrid: (rotation: number, settings: UtilsSettings, isShiftPressed: boolean) => number;
|
|
9
|
+
export declare const boundVectorToSingleAxis: (vector: Point, isShiftPressed: boolean) => number[];
|
|
10
|
+
export declare const transformShape: (ctx: CanvasRenderingContext2D, shape: ShapeEntity, cursorPosition: Point, selectionMode: SelectionModeData<Point | number>, settings: UtilsSettings, isShiftPressed: boolean, isAltPressed: boolean) => ShapeEntity;
|
|
10
11
|
export declare const fitContentInsideContainer: (contentWidth: number, contentHeight: number, containerWidth: number, containerHeight: number, shouldFillContainer?: boolean) => number[];
|
|
11
12
|
export declare const shortenLine: ({ line, size, direction }: {
|
|
12
13
|
line: DrawableShape<"line">;
|
|
@@ -14,4 +14,6 @@ export declare const getAngleFromVector: ({ targetVector: [point1, point2], radi
|
|
|
14
14
|
radian?: boolean;
|
|
15
15
|
originVector?: Vector;
|
|
16
16
|
}) => number;
|
|
17
|
+
export declare const getDistanceBetweenPoints: (p1: Point, p2: Point) => number;
|
|
18
|
+
export declare const getCenter: (e1: Point, e2: Point) => Point;
|
|
17
19
|
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
2
|
+
import type { CanvasSize, Size } from './../../common/types/Canvas';
|
|
3
|
+
import type { Point, Rect } from './../../common/types/Shapes';
|
|
4
|
+
export declare const getNewOffset: ({ size, zoom, newOffset: [x, y], canvasSize }: {
|
|
5
|
+
zoom: number;
|
|
6
|
+
size: Size;
|
|
7
|
+
newOffset: Point;
|
|
8
|
+
canvasSize: CanvasSize;
|
|
9
|
+
}) => {
|
|
10
|
+
zoom: number;
|
|
11
|
+
offset: Point;
|
|
12
|
+
};
|
|
13
|
+
export declare const calculateNewZoomAndOffset: ({ size, canvasSize, currentOffset, currentZoom, zoom, centerPoint: iCenterPoint }: {
|
|
14
|
+
size: Size;
|
|
15
|
+
canvasSize: CanvasSize;
|
|
16
|
+
currentOffset: Point;
|
|
17
|
+
currentZoom: number;
|
|
18
|
+
zoom: number;
|
|
19
|
+
centerPoint: Point;
|
|
20
|
+
}) => {
|
|
21
|
+
offset: Point;
|
|
22
|
+
zoom: number;
|
|
23
|
+
};
|
|
24
|
+
export declare const getNewZoomAndOffset: ({ size, canvasSize, currentOffset, currentZoom, action }: {
|
|
25
|
+
size: Size;
|
|
26
|
+
canvasSize: CanvasSize;
|
|
27
|
+
currentOffset: Point;
|
|
28
|
+
currentZoom: number;
|
|
29
|
+
action: "unzoom" | "zoom" | "default";
|
|
30
|
+
}) => {
|
|
31
|
+
offset: Point;
|
|
32
|
+
zoom: number;
|
|
33
|
+
};
|
|
34
|
+
export declare const getNewZoomAndOffsetFromDelta: ({ size, canvasSize, currentOffset, currentZoom, delta, centerPoint }: {
|
|
35
|
+
size: Size;
|
|
36
|
+
canvasSize: CanvasSize;
|
|
37
|
+
currentOffset: Point;
|
|
38
|
+
currentZoom: number;
|
|
39
|
+
delta: number;
|
|
40
|
+
centerPoint: Point;
|
|
41
|
+
}) => {
|
|
42
|
+
offset: Point;
|
|
43
|
+
zoom: number;
|
|
44
|
+
};
|
|
45
|
+
export declare const getCurrentView: (settings: UtilsSettings) => Rect;
|
|
46
|
+
export declare const getMaskRect: (settings: UtilsSettings) => {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
};
|
|
52
|
+
export declare const clipMask: (ctx: CanvasRenderingContext2D, settings: UtilsSettings) => void;
|
|
53
|
+
export declare const drawMask: (ctx: CanvasRenderingContext2D, settings: UtilsSettings) => void;
|
|
54
|
+
export declare const isCursorInsideMask: (cursorPosition: Point, settings: UtilsSettings) => boolean;
|
|
55
|
+
export declare const normalizeWheel: (event: WheelEvent, lastTimeEvent: number) => {
|
|
56
|
+
deltaX: number;
|
|
57
|
+
deltaY: number;
|
|
58
|
+
};
|
|
@@ -8,12 +8,16 @@ export type SelectionModeSelectionFrame = {
|
|
|
8
8
|
export type SelectionModeBrush = {
|
|
9
9
|
mode: 'brush';
|
|
10
10
|
};
|
|
11
|
+
export type SelectionModePreview = {
|
|
12
|
+
mode: 'preview';
|
|
13
|
+
};
|
|
11
14
|
export type SelectionModeEditText = {
|
|
12
15
|
mode: 'textedition';
|
|
13
16
|
defaultValue: string[];
|
|
14
17
|
};
|
|
15
18
|
export type SelectionModeResize<AnchorType extends Point | number = Point> = {
|
|
16
19
|
mode: 'resize';
|
|
20
|
+
isCreating: boolean;
|
|
17
21
|
cursorStartPosition: Point;
|
|
18
22
|
originalShape: ShapeEntity;
|
|
19
23
|
anchor: AnchorType;
|
|
@@ -29,8 +33,10 @@ export type SelectionModeTranslate = {
|
|
|
29
33
|
cursorStartPosition: Point;
|
|
30
34
|
originalShape: ShapeEntity;
|
|
31
35
|
};
|
|
32
|
-
export type SelectionModeData<AnchorType extends Point | number> = SelectionModeDefault | SelectionModeSelectionFrame | SelectionModeBrush | SelectionModeResize<AnchorType> | SelectionModeRotate | SelectionModeTranslate | SelectionModeEditText;
|
|
36
|
+
export type SelectionModeData<AnchorType extends Point | number> = SelectionModeDefault | SelectionModeSelectionFrame | SelectionModeBrush | SelectionModeResize<AnchorType> | SelectionModeRotate | SelectionModeTranslate | SelectionModeEditText | SelectionModePreview;
|
|
33
37
|
export type HoverModeData = {
|
|
38
|
+
outOfView?: boolean;
|
|
39
|
+
} & ({
|
|
34
40
|
mode: 'default';
|
|
35
41
|
} | {
|
|
36
42
|
mode: 'selectionFrame';
|
|
@@ -45,4 +51,4 @@ export type HoverModeData = {
|
|
|
45
51
|
mode: 'translate';
|
|
46
52
|
} | {
|
|
47
53
|
mode: 'textedition';
|
|
48
|
-
};
|
|
54
|
+
});
|
|
@@ -22,9 +22,11 @@ export type Triangle = {
|
|
|
22
22
|
};
|
|
23
23
|
export type Polygon = {
|
|
24
24
|
points: Point[];
|
|
25
|
+
tempPoint?: Point;
|
|
25
26
|
};
|
|
26
27
|
export type Curve = {
|
|
27
28
|
points: Point[];
|
|
29
|
+
tempPoint?: Point;
|
|
28
30
|
};
|
|
29
31
|
export type Brush = {
|
|
30
32
|
points: Point[][];
|
|
@@ -47,7 +49,7 @@ export type StyleShape = {
|
|
|
47
49
|
lineWidth?: number;
|
|
48
50
|
lineDash?: number;
|
|
49
51
|
lineArrow?: number;
|
|
50
|
-
|
|
52
|
+
closedPoints?: number;
|
|
51
53
|
fontFamily?: string;
|
|
52
54
|
fontItalic?: boolean;
|
|
53
55
|
fontBold?: boolean;
|
|
@@ -132,11 +132,8 @@ export type SettingsFont = {
|
|
|
132
132
|
hidden?: boolean;
|
|
133
133
|
};
|
|
134
134
|
};
|
|
135
|
-
export type
|
|
136
|
-
|
|
137
|
-
min: number;
|
|
138
|
-
max: number;
|
|
139
|
-
step: number;
|
|
135
|
+
export type SettingsClosedPoints = {
|
|
136
|
+
closedPoints: {
|
|
140
137
|
default: number;
|
|
141
138
|
hidden?: boolean;
|
|
142
139
|
};
|
|
@@ -148,8 +145,8 @@ export type ToolsEllipseSettings = SettingsStrokeColor & SettingsFillColor & Set
|
|
|
148
145
|
export type ToolsTextSettings = SettingsOpacity & SettingsStrokeColor & SettingsFont;
|
|
149
146
|
export type ToolsLineSettings = SettingsOpacity & SettingsStrokeColor & SettingsLineWidth & SettingsLineDash & SettingsLineArrow;
|
|
150
147
|
export type ToolsBrushSettings = SettingsOpacity & SettingsStrokeColor & SettingsLineWidth & SettingsLineDash;
|
|
151
|
-
export type ToolsPolygonSettings = SettingsOpacity & SettingsStrokeColor & SettingsFillColor & SettingsLineWidth & SettingsLineDash &
|
|
152
|
-
export type ToolsCurveSettings = SettingsOpacity & SettingsStrokeColor & SettingsFillColor & SettingsLineWidth & SettingsLineDash &
|
|
148
|
+
export type ToolsPolygonSettings = SettingsOpacity & SettingsStrokeColor & SettingsFillColor & SettingsLineWidth & SettingsLineDash & SettingsClosedPoints;
|
|
149
|
+
export type ToolsCurveSettings = SettingsOpacity & SettingsStrokeColor & SettingsFillColor & SettingsLineWidth & SettingsLineDash & SettingsClosedPoints;
|
|
153
150
|
export type ToolsTriangleSettings = SettingsStrokeColor & SettingsFillColor & SettingsOpacity & SettingsLineWidth & SettingsLineDash;
|
|
154
151
|
export type ToolsPictureSettings = SettingsOpacity;
|
|
155
152
|
export type ToolsSettingsType<T extends ShapeType> = T extends 'rect' ? ToolsRectSettings : T extends 'square' ? ToolsSquareSettings : T extends 'circle' ? ToolsCircleSettings : T extends 'ellipse' ? ToolsEllipseSettings : T extends 'text' ? ToolsTextSettings : T extends 'line' ? ToolsLineSettings : T extends 'brush' ? ToolsBrushSettings : T extends 'polygon' ? ToolsPolygonSettings : T extends 'curve' ? ToolsCurveSettings : T extends 'triangle' ? ToolsTriangleSettings : T extends 'picture' ? ToolsPictureSettings : never;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
import './Modal.css';
|
|
3
3
|
type ModalType = {
|
|
4
4
|
children: ReactNode;
|
|
5
|
+
title: string;
|
|
5
6
|
onClose: () => void;
|
|
6
7
|
position?: 'center' | 'bottom';
|
|
7
8
|
className?: string;
|
|
8
9
|
};
|
|
9
|
-
declare const Modal: ({ children, onClose, position, className }: ModalType) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const Modal: ({ children, onClose, position, title, className }: ModalType) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export default Modal;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import './Panel.css';
|
|
3
|
+
import type { CSSProperties } from 'react';
|
|
3
4
|
type PanelType = {
|
|
4
5
|
vertical?: boolean;
|
|
5
6
|
children: React.ReactNode;
|
|
7
|
+
style?: CSSProperties;
|
|
6
8
|
title?: string;
|
|
7
9
|
className?: string;
|
|
8
10
|
fitContainer?: boolean;
|
|
9
11
|
position?: 'bottom' | 'top';
|
|
10
12
|
alignment?: 'left' | 'right' | 'center';
|
|
11
13
|
};
|
|
12
|
-
declare const Panel: ({ children, title, className, position, fitContainer, alignment }: PanelType) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const Panel: ({ children, title, className, position, fitContainer, alignment, style, ...props }: PanelType) => import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export default Panel;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
type ClosedPointsType = {
|
|
3
|
+
selectedSettings: string | undefined;
|
|
4
|
+
setSelectedSettings: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
defaultValue?: number | undefined;
|
|
7
|
+
valueChanged: (field: string, value: string | number) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const ClosedPointsField: ({ selectedSettings, setSelectedSettings, disabled, defaultValue, valueChanged }: ClosedPointsType) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default ClosedPointsField;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ShapeEntity } from './../../../common/types/Shapes';
|
|
2
2
|
import type { GridLabelType } from './../../../editor/constants/grid';
|
|
3
3
|
import './Layouts.css';
|
|
4
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
4
5
|
type LayoutsType = {
|
|
5
6
|
gridFormat: GridLabelType;
|
|
6
7
|
setGridFormat: (value: GridLabelType) => void;
|
|
7
|
-
|
|
8
|
+
settings: UtilsSettings;
|
|
8
9
|
shapes: ShapeEntity[];
|
|
9
10
|
removeShape: (shape: ShapeEntity) => void;
|
|
10
11
|
toggleShapeVisibility: (shape: ShapeEntity) => void;
|
|
@@ -14,5 +15,5 @@ type LayoutsType = {
|
|
|
14
15
|
moveShapes: (firstShapeId: string, lastShapeId: string) => void;
|
|
15
16
|
isLayoutPanelShown: boolean;
|
|
16
17
|
};
|
|
17
|
-
declare const Layouts: ({ gridFormat, setGridFormat,
|
|
18
|
+
declare const Layouts: ({ gridFormat, setGridFormat, settings, shapes, removeShape, toggleShapeVisibility, toggleShapeLock, selectedShape, moveShapes, selectShape, isLayoutPanelShown }: LayoutsType) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
19
|
export default Layouts;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
2
|
import type { ShapeEntity } from './../../../common/types/Shapes';
|
|
3
3
|
import type { CustomTool, ToolsType } from './../../../common/types/tools';
|
|
4
|
+
import type React from 'react';
|
|
4
5
|
import './SettingsBar.css';
|
|
5
|
-
type
|
|
6
|
+
type SettingsBarType = {
|
|
6
7
|
width: number;
|
|
7
|
-
disabled?: boolean;
|
|
8
8
|
availableTools: CustomTool[];
|
|
9
9
|
updateToolSettings: (toolId: string, field: string, value: string | number | boolean) => void;
|
|
10
10
|
layersManipulation?: boolean;
|
|
@@ -15,6 +15,9 @@ type SettingsBoxType = {
|
|
|
15
15
|
updateShape: (shape: ShapeEntity, withSave?: boolean) => void;
|
|
16
16
|
removeShape: (shape: ShapeEntity) => void;
|
|
17
17
|
toggleLayoutPanel: () => void;
|
|
18
|
+
isZoomPanelShown: boolean;
|
|
19
|
+
setIsZoomPanelShown: React.Dispatch<React.SetStateAction<boolean>>;
|
|
20
|
+
setCanvasZoom: (action: 'unzoom' | 'zoom' | 'default') => void;
|
|
18
21
|
};
|
|
19
|
-
declare const SettingsBar: ({ width,
|
|
22
|
+
declare const SettingsBar: ({ width, availableTools, updateToolSettings, layersManipulation, toggleLayoutPanel, activeTool, selectedShape, canvas, settings, updateShape, removeShape, isZoomPanelShown, setIsZoomPanelShown }: SettingsBarType) => import("react/jsx-runtime").JSX.Element;
|
|
20
23
|
export default SettingsBar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './ZoomButton.css';
|
|
2
|
+
type ZoomButtonType = {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
toggleZoomPanel: () => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const ZoomButton: ({ disabled, className, toggleZoomPanel }: ZoomButtonType) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default ZoomButton;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import './ExportModal.css';
|
|
2
|
+
type ExportModalProps = {
|
|
3
|
+
toggleExportModal: () => void;
|
|
4
|
+
exportCanvasInFile: (view: 'fitToShapes' | 'defaultView' | 'currentZoom') => void;
|
|
5
|
+
};
|
|
6
|
+
declare const ExportModal: ({ toggleExportModal, exportCanvasInFile }: ExportModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ExportModal;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ShapeType } from './../../../common/types/Shapes';
|
|
2
2
|
import type { ToolsType } from './../../../common/types/tools';
|
|
3
3
|
import './MenuGroup.css';
|
|
4
|
-
type
|
|
4
|
+
type MenuGroupType = {
|
|
5
5
|
activeTool: ToolsType;
|
|
6
6
|
withActionsInMenu: boolean;
|
|
7
7
|
group: {
|
|
@@ -17,7 +17,7 @@ type ToolbarGroupType = {
|
|
|
17
17
|
loadFile: (file: File) => void;
|
|
18
18
|
addPicture: (file: File) => Promise<void>;
|
|
19
19
|
saveFile: () => void;
|
|
20
|
-
|
|
20
|
+
toggleExportModal: () => void;
|
|
21
21
|
togglePictureUrlModal: () => void;
|
|
22
22
|
withLoadAndSave: boolean;
|
|
23
23
|
withExport: boolean;
|
|
@@ -30,5 +30,5 @@ type ToolbarGroupType = {
|
|
|
30
30
|
redoAction: () => void;
|
|
31
31
|
clearCanvas: () => void;
|
|
32
32
|
};
|
|
33
|
-
declare const MenuGroup: ({ activeTool, withActionsInMenu, hasActionToUndo, hasActionToRedo, hasActionToClear, undoAction, redoAction, clearCanvas, alignment, group, vertical, disabled, withLoadAndSave, withExport, addPicture: addPictureFromProps, loadFile: loadFileFromProps, togglePictureUrlModal, saveFile,
|
|
33
|
+
declare const MenuGroup: ({ activeTool, withActionsInMenu, hasActionToUndo, hasActionToRedo, hasActionToClear, undoAction, redoAction, clearCanvas, alignment, group, vertical, disabled, withLoadAndSave, withExport, addPicture: addPictureFromProps, loadFile: loadFileFromProps, togglePictureUrlModal, saveFile, toggleExportModal, withUploadPicture, withUrlPicture }: MenuGroupType) => import("react/jsx-runtime").JSX.Element | null;
|
|
34
34
|
export default MenuGroup;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { ToolsType } from './../../../common/types/tools';
|
|
2
|
-
import type { CustomTool } from './../../../common/types/tools';
|
|
1
|
+
import type { CustomTool, ToolsType } from './../../../common/types/tools';
|
|
3
2
|
import './Toolbar.css';
|
|
3
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
4
4
|
type ToolboxType = {
|
|
5
5
|
width: number;
|
|
6
|
-
disabled?: boolean;
|
|
7
6
|
activeTool: ToolsType;
|
|
8
7
|
hasActionToUndo?: boolean;
|
|
9
8
|
hasActionToRedo?: boolean;
|
|
@@ -15,12 +14,13 @@ type ToolboxType = {
|
|
|
15
14
|
loadFile: (file: File) => void;
|
|
16
15
|
addPicture: (file: File | string) => Promise<void>;
|
|
17
16
|
saveFile: () => void;
|
|
18
|
-
exportCanvasInFile: () => void;
|
|
17
|
+
exportCanvasInFile: (view: 'fitToShapes' | 'defaultView' | 'currentZoom') => void;
|
|
19
18
|
availableTools: CustomTool[];
|
|
20
19
|
withLoadAndSave: boolean;
|
|
21
20
|
withExport: boolean;
|
|
22
21
|
withUrlPicture: boolean;
|
|
23
22
|
withUploadPicture: boolean;
|
|
23
|
+
settings: UtilsSettings;
|
|
24
24
|
};
|
|
25
|
-
declare const Toolbar: ({
|
|
25
|
+
declare const Toolbar: ({ settings, width, activeTool, hasActionToUndo, hasActionToRedo, hasActionToClear, withLoadAndSave, withExport, clearCanvas, setActiveTool: setActiveToolFromProps, undoAction, redoAction, addPicture, loadFile, saveFile, exportCanvasInFile, availableTools, withUrlPicture, withUploadPicture }: ToolboxType) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
export default Toolbar;
|
|
@@ -6,7 +6,6 @@ export declare const circleIcon = "<svg><path d=\"M10 18.333Q8.271 18.333 6.75 1
|
|
|
6
6
|
export declare const polygonIcon = "<svg><path d=\"M12.25 18.333V16.167L6.833 13.458H2.5V8.208H6.25L8.25 5.917V1.667H13.5V6.917H9.708L7.75 9.146V11.958L12.25 14.208V13.083H17.5V18.333Z\"/></svg>";
|
|
7
7
|
export declare const trashIcon = "<svg><path d=\"M4.125 5.083V3.333H7.062L7.896 2.5H12.104L12.938 3.333H15.875V5.083ZM6.75 17.5Q6.021 17.5 5.51 16.99Q5 16.479 5 15.75V5.958H15V15.75Q15 16.479 14.49 16.99Q13.979 17.5 13.25 17.5Z\"/></svg>";
|
|
8
8
|
export declare const opacityIcon = "<svg><path d=\"M10 17.5Q7.208 17.5 5.271 15.594Q3.333 13.688 3.333 10.958Q3.333 9.583 3.854 8.396Q4.375 7.208 5.292 6.292L10 1.667L14.688 6.292Q15.604 7.208 16.135 8.396Q16.667 9.583 16.667 10.958Q16.667 13.688 14.719 15.594Q12.771 17.5 10 17.5ZM5.146 11.667H14.854Q15.083 10.188 14.552 9.146Q14.021 8.104 13.479 7.562L10 4.125L6.521 7.562Q5.979 8.104 5.448 9.146Q4.917 10.188 5.146 11.667Z\"/></svg>";
|
|
9
|
-
export declare const dotsIcon = "<svg><path d=\"M10.021 16.667Q9.354 16.667 8.875 16.188Q8.396 15.708 8.396 15.042Q8.396 14.375 8.875 13.896Q9.354 13.417 10.021 13.417Q10.688 13.417 11.167 13.896Q11.646 14.375 11.646 15.042Q11.646 15.708 11.167 16.188Q10.688 16.667 10.021 16.667ZM10.021 11.625Q9.354 11.625 8.875 11.146Q8.396 10.667 8.396 10Q8.396 9.333 8.875 8.854Q9.354 8.375 10.021 8.375Q10.688 8.375 11.167 8.854Q11.646 9.333 11.646 10Q11.646 10.667 11.167 11.146Q10.688 11.625 10.021 11.625ZM10.021 6.583Q9.354 6.583 8.875 6.104Q8.396 5.625 8.396 4.958Q8.396 4.292 8.875 3.813Q9.354 3.333 10.021 3.333Q10.688 3.333 11.167 3.813Q11.646 4.292 11.646 4.958Q11.646 5.625 11.167 6.104Q10.688 6.583 10.021 6.583Z\"/></svg>";
|
|
10
9
|
export declare const undoIcon = "<svg><path d=\"M11.708 15.833H5.854V14.083H11.708Q13 14.083 13.958 13.292Q14.917 12.5 14.917 11.271Q14.917 10.042 13.958 9.24Q13 8.438 11.708 8.438H6.667L8.792 10.562L7.562 11.792L3.333 7.562L7.562 3.333L8.792 4.562L6.667 6.688H11.708Q13.729 6.688 15.198 7.99Q16.667 9.292 16.667 11.25Q16.667 13.208 15.198 14.521Q13.729 15.833 11.708 15.833Z\"/></svg>";
|
|
11
10
|
export declare const redoIcon = "<svg><path d=\"M8.292 15.833Q6.271 15.833 4.802 14.521Q3.333 13.208 3.333 11.25Q3.333 9.292 4.802 7.99Q6.271 6.688 8.292 6.688H13.333L11.208 4.562L12.438 3.333L16.667 7.562L12.438 11.792L11.208 10.562L13.333 8.438H8.292Q7 8.438 6.042 9.229Q5.083 10.021 5.083 11.25Q5.083 12.5 6.042 13.292Q7 14.083 8.292 14.083H14.146V15.833Z\"/></svg>";
|
|
12
11
|
export declare const layersIcon = "<svg><path d=\"M10 17.646 2.438 11.75 3.875 10.646 10 15.396 16.125 10.646 17.562 11.75ZM10 13.188 2.5 7.354 10 1.521 17.5 7.354Z\"/></svg>";
|
|
@@ -18,12 +17,11 @@ export declare const pictureIcon = "<svg><path d=\"M4.792 15.083 8.333 11.542 9.
|
|
|
18
17
|
export declare const textIcon = "<svg><path d=\"M8.708 16.667V5.917H4.167V3.333H15.833V5.917H11.292V16.667Z\"/></svg>";
|
|
19
18
|
export declare const arrowIcon = "<svg><path d=\"M7.5 15.833V14.083H12.833L3.333 4.583L4.583 3.333L14.083 12.833V7.5H15.833V15.833Z\"/></svg>";
|
|
20
19
|
export declare const cursorIcon = "<svg><path d=\"M8.0145 11.1707C8.38484 10.9914 8.82183 11.1558 8.99959 11.5295L10.7031 15.2591L12.0363 14.6238L10.3254 10.9017C10.1476 10.528 10.3106 10.0795 10.6809 9.90761L10.8883 9.84782L12.5918 9.51148L6.48133 4.33192V12.389L7.82934 11.2903L8.0145 11.1707ZM10.6587 16.9258C10.2883 17.1052 9.84395 16.9482 9.67359 16.5745L8.05894 13.0318L6.19988 14.5416C6.07396 14.6462 5.91842 14.706 5.74066 14.706C5.54423 14.706 5.35584 14.6272 5.21694 14.4871C5.07803 14.3469 5 14.1568 5 13.9586V2.74741C5 2.54919 5.07803 2.35908 5.21694 2.21891C5.35584 2.07874 5.54423 2 5.74066 2C5.91842 2 6.08878 2.06727 6.21469 2.1719L6.2221 2.16443L14.7323 9.36947C15.0508 9.63854 15.0879 10.1094 14.8286 10.4233C14.7175 10.5579 14.562 10.6475 14.4064 10.6774L12.0659 11.1408L13.6954 14.6761C13.888 15.0498 13.7102 15.4908 13.3399 15.6627L10.6587 16.9258Z\"/></svg>";
|
|
20
|
+
export declare const moveIcon = "<svg viewBox=\"0 -960 960 960\"><path d=\"M412-48q-21.95 0-40.98-9Q352-66 338-83L48-434l27-28q17-17 41.5-20.5T162-473l126 74v-381q0-15.3 10.29-25.65Q308.58-816 323.79-816t25.71 10.35Q360-795.3 360-780v300h80v-396q0-15.3 10.29-25.65Q460.58-912 475.79-912t25.71 10.35Q512-891.3 512-876v396h80v-348q0-15.3 10.29-25.65Q612.58-864 627.79-864t25.71 10.35Q664-843.3 664-828v348h80v-252q0-15.3 10.29-25.65Q764.58-768 779.79-768t25.71 10.35Q816-747.3 816-732v540q0 60-42 102T672-48H412Z\"/></svg>";
|
|
21
21
|
export declare const menuIcon = "<svg><path d=\"M2.5 15V13.25H17.5V15ZM2.5 10.875V9.125H17.5V10.875ZM2.5 6.75V5H17.5V6.75Z\"/></svg>";
|
|
22
22
|
export declare const visibilityIcon = "<svg><path d=\"M10 13.354Q11.583 13.354 12.688 12.25Q13.792 11.146 13.792 9.562Q13.792 7.979 12.688 6.875Q11.583 5.771 10 5.771Q8.417 5.771 7.312 6.875Q6.208 7.979 6.208 9.562Q6.208 11.146 7.312 12.25Q8.417 13.354 10 13.354ZM10 11.812Q9.062 11.812 8.406 11.156Q7.75 10.5 7.75 9.562Q7.75 8.625 8.406 7.969Q9.062 7.312 10 7.312Q10.938 7.312 11.594 7.969Q12.25 8.625 12.25 9.562Q12.25 10.5 11.594 11.156Q10.938 11.812 10 11.812ZM10 15.833Q6.938 15.833 4.448 14.125Q1.958 12.417 0.833 9.562Q1.958 6.708 4.458 5.021Q6.958 3.333 10 3.333Q13.042 3.333 15.542 5.021Q18.042 6.708 19.167 9.562Q18.042 12.417 15.552 14.125Q13.062 15.833 10 15.833ZM10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562Q10 9.562 10 9.562ZM10 14.083Q12.333 14.083 14.281 12.865Q16.229 11.646 17.25 9.562Q16.229 7.479 14.281 6.281Q12.333 5.083 10 5.083Q7.667 5.083 5.708 6.281Q3.75 7.479 2.729 9.562Q3.75 11.646 5.708 12.865Q7.667 14.083 10 14.083Z\"/></svg>";
|
|
23
23
|
export declare const visibilityOffIcon = "<svg><path d=\"M13.521 11.021 12.25 9.75Q12.333 8.75 11.604 7.979Q10.875 7.208 9.812 7.312L8.542 6.042Q8.896 5.896 9.26 5.833Q9.625 5.771 10 5.771Q11.583 5.771 12.688 6.875Q13.792 7.979 13.792 9.562Q13.792 9.979 13.719 10.354Q13.646 10.729 13.521 11.021ZM16.167 13.646 14.917 12.417Q15.667 11.833 16.25 11.146Q16.833 10.458 17.25 9.562Q16.229 7.479 14.292 6.281Q12.354 5.083 10 5.083Q9.396 5.083 8.885 5.156Q8.375 5.229 7.875 5.375L6.5 4Q7.354 3.646 8.208 3.49Q9.062 3.333 10 3.333Q13.146 3.333 15.615 5.052Q18.083 6.771 19.167 9.562Q18.688 10.792 17.917 11.823Q17.146 12.854 16.167 13.646ZM16.396 18.854 12.938 15.396Q12.208 15.625 11.479 15.729Q10.75 15.833 10 15.833Q6.833 15.833 4.375 14.094Q1.917 12.354 0.833 9.562Q1.25 8.479 1.917 7.552Q2.583 6.625 3.417 5.875L1.125 3.562L2.375 2.354L17.625 17.625ZM4.604 7.062Q4.021 7.604 3.542 8.219Q3.062 8.833 2.729 9.562Q3.75 11.646 5.688 12.865Q7.625 14.083 10 14.083Q10.354 14.083 10.74 14.052Q11.125 14.021 11.479 13.938L10.812 13.271Q10.625 13.312 10.417 13.333Q10.208 13.354 10 13.354Q8.417 13.354 7.312 12.25Q6.208 11.146 6.208 9.562Q6.208 9.354 6.24 9.167Q6.271 8.979 6.312 8.771ZM11.375 8.875Q11.375 8.875 11.375 8.875Q11.375 8.875 11.375 8.875Q11.375 8.875 11.375 8.875Q11.375 8.875 11.375 8.875Q11.375 8.875 11.375 8.875Q11.375 8.875 11.375 8.875ZM8.042 10.5Q8.042 10.5 8.042 10.5Q8.042 10.5 8.042 10.5Q8.042 10.5 8.042 10.5Q8.042 10.5 8.042 10.5Q8.042 10.5 8.042 10.5Q8.042 10.5 8.042 10.5Z\"/></svg>";
|
|
24
24
|
export declare const paletteIcon = "<svg><path d=\"M9.958 18.333Q8.25 18.333 6.74 17.677Q5.229 17.021 4.104 15.885Q2.979 14.75 2.323 13.229Q1.667 11.708 1.667 10Q1.667 8.271 2.333 6.75Q3 5.229 4.156 4.104Q5.312 2.979 6.854 2.323Q8.396 1.667 10.125 1.667Q11.771 1.667 13.26 2.25Q14.75 2.833 15.875 3.854Q17 4.875 17.667 6.26Q18.333 7.646 18.333 9.25Q18.333 11.688 16.792 12.948Q15.25 14.208 13.188 14.208H11.75Q11.625 14.208 11.562 14.281Q11.5 14.354 11.5 14.458Q11.5 14.688 11.812 15.219Q12.125 15.75 12.125 16.458Q12.125 17.458 11.51 17.896Q10.896 18.333 9.958 18.333ZM5.458 10.875Q6 10.875 6.375 10.5Q6.75 10.125 6.75 9.583Q6.75 9.042 6.375 8.667Q6 8.292 5.458 8.292Q4.917 8.292 4.542 8.667Q4.167 9.042 4.167 9.583Q4.167 10.125 4.542 10.5Q4.917 10.875 5.458 10.875ZM7.917 7.583Q8.458 7.583 8.833 7.208Q9.208 6.833 9.208 6.292Q9.208 5.75 8.833 5.375Q8.458 5 7.917 5Q7.375 5 7 5.375Q6.625 5.75 6.625 6.292Q6.625 6.833 7 7.208Q7.375 7.583 7.917 7.583ZM12.021 7.583Q12.562 7.583 12.938 7.208Q13.312 6.833 13.312 6.292Q13.312 5.75 12.938 5.375Q12.562 5 12.021 5Q11.479 5 11.104 5.375Q10.729 5.75 10.729 6.292Q10.729 6.833 11.104 7.208Q11.479 7.583 12.021 7.583ZM14.479 10.875Q15.021 10.875 15.396 10.5Q15.771 10.125 15.771 9.583Q15.771 9.042 15.396 8.667Q15.021 8.292 14.479 8.292Q13.938 8.292 13.562 8.667Q13.188 9.042 13.188 9.583Q13.188 10.125 13.562 10.5Q13.938 10.875 14.479 10.875Z\"/></svg>";
|
|
25
|
-
export declare const penIcon = "<svg><path d=\"M2.5 17.5V13.771L13.479 2.792Q14 2.271 14.719 2.271Q15.438 2.271 15.958 2.792L17.208 4.042Q17.708 4.542 17.708 5.281Q17.708 6.021 17.208 6.521L6.229 17.5ZM14.729 6.5 15.958 5.271 14.729 4.042 13.5 5.271Z\"/></svg>";
|
|
26
|
-
export declare const paintIcon = "<svg><path d=\"M9.167 18.333Q8.438 18.333 7.927 17.823Q7.417 17.312 7.417 16.583V13.438H5.083Q4.354 13.438 3.844 12.927Q3.333 12.417 3.333 11.688V5.938Q3.333 4.5 4.333 3.5Q5.333 2.5 6.75 2.5H16.667V11.688Q16.667 12.417 16.156 12.927Q15.646 13.438 14.917 13.438H12.542V16.583Q12.542 17.312 12.031 17.823Q11.521 18.333 10.792 18.333ZM5.083 8.312H14.917V4.25H14.125V7.562H12.375V4.25H11.667V5.917H9.917V4.25H6.75Q6.062 4.25 5.573 4.75Q5.083 5.25 5.083 5.938Z\"/></svg>";
|
|
27
25
|
export declare const publicIcon = "<svg><path d=\"M9.188 16.542V14.938Q8.5 14.938 8.021 14.458Q7.542 13.979 7.542 13.292V12.458L3.583 8.5Q3.5 8.875 3.458 9.25Q3.417 9.625 3.417 10Q3.417 12.5 5.062 14.365Q6.708 16.229 9.188 16.542ZM14.854 14.438Q15.708 13.521 16.146 12.385Q16.583 11.25 16.583 10Q16.583 7.979 15.469 6.313Q14.354 4.646 12.479 3.917V4.229Q12.479 4.917 12 5.396Q11.521 5.875 10.833 5.875H9.188V7.521Q9.188 7.875 8.948 8.115Q8.708 8.354 8.354 8.354H6.708V10H11.646Q12 10 12.24 10.229Q12.479 10.458 12.479 10.812V13.292H13.292Q13.833 13.292 14.26 13.604Q14.688 13.917 14.854 14.438ZM10 18.333Q8.271 18.333 6.75 17.677Q5.229 17.021 4.104 15.896Q2.979 14.771 2.323 13.25Q1.667 11.729 1.667 10Q1.667 8.271 2.323 6.75Q2.979 5.229 4.104 4.104Q5.229 2.979 6.75 2.323Q8.271 1.667 10 1.667Q11.729 1.667 13.25 2.323Q14.771 2.979 15.896 4.104Q17.021 5.229 17.677 6.75Q18.333 8.271 18.333 10Q18.333 11.729 17.677 13.25Q17.021 14.771 15.896 15.896Q14.771 17.021 13.25 17.677Q11.729 18.333 10 18.333Z\"/></svg>";
|
|
28
26
|
export declare const lockedIcon = "<svg><path d=\"M10 0.833Q11.771 0.833 12.99 2.052Q14.208 3.271 14.208 5.042V6.667H14.917Q15.646 6.667 16.156 7.177Q16.667 7.688 16.667 8.417V16.562Q16.667 17.292 16.156 17.812Q15.646 18.333 14.917 18.333H5.083Q4.354 18.333 3.844 17.812Q3.333 17.292 3.333 16.562V8.417Q3.333 7.688 3.844 7.177Q4.354 6.667 5.083 6.667H5.792V5.042Q5.792 3.271 7.01 2.052Q8.229 0.833 10 0.833ZM10 2.583Q8.979 2.583 8.26 3.302Q7.542 4.021 7.542 5.042V6.667H12.458V5.042Q12.458 4.021 11.74 3.302Q11.021 2.583 10 2.583ZM5.083 16.583H14.917Q14.917 16.583 14.917 16.583Q14.917 16.583 14.917 16.583V8.417Q14.917 8.417 14.917 8.417Q14.917 8.417 14.917 8.417H5.083Q5.083 8.417 5.083 8.417Q5.083 8.417 5.083 8.417V16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583ZM10 10.812Q9.292 10.812 8.802 11.302Q8.312 11.792 8.312 12.5Q8.312 13.208 8.802 13.698Q9.292 14.188 10 14.188Q10.708 14.188 11.198 13.698Q11.688 13.208 11.688 12.5Q11.688 11.792 11.198 11.302Q10.708 10.812 10 10.812ZM5.083 8.417Q5.083 8.417 5.083 8.417Q5.083 8.417 5.083 8.417V16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583V8.417Q5.083 8.417 5.083 8.417Q5.083 8.417 5.083 8.417Z\"/></svg>";
|
|
29
27
|
export declare const unlockedIcon = "<svg><path d=\"M5.792 5.042Q5.792 3.271 7.01 2.052Q8.229 0.833 10 0.833Q11.771 0.833 12.99 2.052Q14.208 3.271 14.208 5.042V6.667H14.917Q15.646 6.667 16.156 7.177Q16.667 7.688 16.667 8.417V16.562Q16.667 17.292 16.156 17.812Q15.646 18.333 14.917 18.333H5.083Q4.354 18.333 3.844 17.812Q3.333 17.292 3.333 16.562V8.417Q3.333 7.688 3.844 7.177Q4.354 6.667 5.083 6.667H12.458V5.042Q12.458 4.021 11.74 3.302Q11.021 2.583 10 2.583Q8.979 2.583 8.26 3.302Q7.542 4.021 7.542 5.042ZM5.083 16.583H14.917Q14.917 16.583 14.917 16.583Q14.917 16.583 14.917 16.583V8.417Q14.917 8.417 14.917 8.417Q14.917 8.417 14.917 8.417H5.083Q5.083 8.417 5.083 8.417Q5.083 8.417 5.083 8.417V16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583ZM10 10.812Q9.292 10.812 8.802 11.302Q8.312 11.792 8.312 12.5Q8.312 13.208 8.802 13.698Q9.292 14.188 10 14.188Q10.708 14.188 11.198 13.698Q11.688 13.208 11.688 12.5Q11.688 11.792 11.198 11.302Q10.708 10.812 10 10.812ZM5.083 8.417Q5.083 8.417 5.083 8.417Q5.083 8.417 5.083 8.417V16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583Q5.083 16.583 5.083 16.583V8.417Q5.083 8.417 5.083 8.417Q5.083 8.417 5.083 8.417Z\"/></svg>";
|
|
@@ -38,4 +36,6 @@ export declare const fontIcon = "<svg><path d=\"M5.312 14.979H7.125L8.042 12.479
|
|
|
38
36
|
export declare const lineEndIcon = "<svg><path d=\"M6 17 2 13 6 9 7.062 10.062 4.875 12.25H17V13.75H4.875L7.062 15.938ZM14 11 12.938 9.938 15.125 7.75H3V6.25H15.125L12.938 4.062L14 3L18 7Z\"/></svg>";
|
|
39
37
|
export declare const settingsIcon = "<svg><path d=\"M2.5 15.833V14.083H7.667V15.833ZM2.5 5.917V4.167H10.771V5.917ZM9.208 17.5V12.438H10.958V14.083H17.5V15.833H10.958V17.5ZM5.917 12.542V10.875H2.5V9.125H5.917V7.479H7.667V12.542ZM9.208 10.875V9.125H17.5V10.875ZM12.333 7.562V2.5H14.083V4.167H17.5V5.917H14.083V7.562Z\"/></svg>";
|
|
40
38
|
export declare const noStrokeIcon = "<svg><path d=\"M16.354 18.833 14.521 17Q13.542 17.646 12.396 17.99Q11.25 18.333 10 18.333Q8.271 18.333 6.75 17.677Q5.229 17.021 4.104 15.896Q2.979 14.771 2.323 13.25Q1.667 11.729 1.667 10Q1.667 8.729 2.01 7.594Q2.354 6.458 3 5.458L1.167 3.625L2.396 2.396L17.583 17.604ZM10 16.583Q10.896 16.583 11.708 16.365Q12.521 16.146 13.25 15.729L4.292 6.75Q3.875 7.479 3.646 8.292Q3.417 9.104 3.417 10Q3.417 12.729 5.344 14.656Q7.271 16.583 10 16.583ZM17 14.562 15.708 13.271Q16.125 12.542 16.354 11.719Q16.583 10.896 16.583 10Q16.583 7.271 14.656 5.344Q12.729 3.417 10 3.417Q9.104 3.417 8.292 3.646Q7.479 3.875 6.75 4.292L5.458 3Q6.458 2.354 7.594 2.01Q8.729 1.667 10 1.667Q11.729 1.667 13.25 2.323Q14.771 2.979 15.896 4.104Q17.021 5.229 17.677 6.75Q18.333 8.271 18.333 10Q18.333 11.271 17.979 12.417Q17.625 13.562 17 14.562ZM11.229 8.771Q11.229 8.771 11.229 8.771Q11.229 8.771 11.229 8.771Q11.229 8.771 11.229 8.771Q11.229 8.771 11.229 8.771Q11.229 8.771 11.229 8.771Q11.229 8.771 11.229 8.771ZM8.771 11.229Q8.771 11.229 8.771 11.229Q8.771 11.229 8.771 11.229Q8.771 11.229 8.771 11.229Q8.771 11.229 8.771 11.229Q8.771 11.229 8.771 11.229Q8.771 11.229 8.771 11.229Z\"/></svg>";
|
|
41
|
-
export declare const noFillIcon = "<svg
|
|
39
|
+
export declare const noFillIcon = "<svg><path d=\"M16.354 18.833 14.521 17Q13.542 17.646 12.396 17.99Q11.25 18.333 10 18.333Q8.271 18.333 6.75 17.677Q5.229 17.021 4.104 15.896Q2.979 14.771 2.323 13.25Q1.667 11.729 1.667 10Q1.667 8.729 2.01 7.594Q2.354 6.458 3 5.458L1.167 3.625L2.396 2.396L17.583 17.604ZM17 14.562 5.458 3Q6.458 2.354 7.594 2.01Q8.729 1.667 10 1.667Q11.729 1.667 13.25 2.323Q14.771 2.979 15.896 4.104Q17.021 5.229 17.677 6.75Q18.333 8.271 18.333 10Q18.333 11.271 17.979 12.417Q17.625 13.562 17 14.562Z\"/></svg>";
|
|
40
|
+
export declare const zoomIn = "<svg viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Zm-40-60v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Z\"/></svg>";
|
|
41
|
+
export declare const zoomOut = "<svg viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400ZM280-540v-80h200v80H280Z\"/></svg>";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type RefObject } from 'react';
|
|
2
1
|
import type { ShapeEntity } from './../../common/types/Shapes';
|
|
2
|
+
import { type RefObject } from 'react';
|
|
3
3
|
type useDragType = {
|
|
4
4
|
disabled?: boolean;
|
|
5
|
-
ref: RefObject<HTMLDivElement>;
|
|
5
|
+
ref: RefObject<HTMLDivElement | null>;
|
|
6
6
|
shape: ShapeEntity;
|
|
7
7
|
layoutDragging: string | undefined;
|
|
8
8
|
setLayoutDragging: (shapeId: string | undefined) => void;
|
package/dist/react-paint.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.react-paint-canvas-box{flex:1;justify-content:center;align-items:center;display:flex}.react-paint-canvas-container{background-color:var(--react-paint-app-canvas-bg);background-repeat:repeat;background-size:16px;display:grid;position:relative;overflow:hidden}.react-paint-canvas-container[data-grow=true]{width:100%;height:100%}.react-paint-canvas-drawcanvas{-webkit-user-select:none;user-select:none;touch-action:none;grid-area:1/1;max-width:100%;display:block}.react-paint-canvas-drawcanvas[data-grow=true]{width:100%}.react-paint-canvas-selectioncanvas{-webkit-user-select:none;user-select:none;touch-action:none;cursor:var(--react-paint-canvas-cursor);grid-area:1/1;max-width:100%;display:block;position:relative}.react-paint-canvas-selectioncanvas[data-grow=true]{width:100%}.react-paint-editor-toolbox-edittextbox{transform-origin:0 0;box-sizing:border-box;transform:var(--react-paint-editor-toolbox-edittextbox-transform);color:var(--react-paint-editor-toolbox-edittextbox-color);padding:var(--react-paint-editor-toolbox-edittextbox-padding);line-height:1;font-size:var(--react-paint-editor-toolbox-edittextbox-fontsize);font-family:var(--react-paint-editor-toolbox-edittextbox-fontfamily);opacity:var(--react-paint-editor-toolbox-edittextbox-opacity);background:0 0;outline:none;width:max-content;display:inline-block;position:absolute;top:0;left:0}.react-paint-editor-toolbox-edittextbox[data-fontbold=true]{font-weight:700}.react-paint-editor-toolbox-edittextbox[data-fontitalic=true]{font-style:italic}.react-paint-app-row{aspect-ratio:var(--react-paint-app-row-aspectratio);width:100%;max-width:100%;position:relative}.react-paint-app-row[data-grow=false]{max-width:var(--react-paint-app-canvaswidth)}.react-paint-app-row[data-shrink=false]{min-width:var(--react-paint-app-canvaswidth)}.react-paint-editor-loading{z-index:var(--react-paint-editor-loading-zindex);transition:opacity var(--react-paint-editor-loading-transition-duration)linear;opacity:0;background:#00000050;justify-content:center;align-items:center;display:flex;position:absolute;top:0;bottom:0;left:0;right:0}.react-paint-editor-loading[data-loading=visible]{opacity:1}@keyframes react-paint-editor-loading-rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.react-paint-editor-loader{width:40px;height:40px;animation:1s infinite react-paint-editor-loading-rotation;position:relative;transform:rotate(10deg)}.react-paint-editor-loader>div{border-radius:50%;width:15px;height:15px;position:absolute}.react-paint-editor-loader>div:first-child{background-color:#5c6bc0;left:0}.react-paint-editor-loader>div:nth-child(2){background-color:#8bc34a;right:0}.react-paint-editor-loader>div:nth-child(3){background-color:#ffb74d;bottom:0}.react-paint-editor-loader>div:nth-child(4){background-color:#f44336;bottom:0;right:0}.react-paint-editor-snackbar-container{z-index:var(--react-paint-editor-snackbar-zindex);flex-direction:column-reverse;align-items:center;height:0;display:flex;position:absolute;bottom:0;left:0;right:0}.react-paint-editor-snackbar{color:#fff;overflow-wrap:break-word;box-sizing:border-box;transition:all var(--react-paint-editor-panel-transition-duration);opacity:0;max-width:calc(100% - 24px);margin:4px;padding:12px 48px;display:inline-block;transform:translateY(40px)}.react-paint-editor-snackbar[data-type=infos]{background:#646464}.react-paint-editor-snackbar[data-type=error]{background:#911717}.react-paint-editor-snackbar[data-type=success]{background:#088900}.react-paint-editor-snackbar[data-is-shown="1"]{opacity:1;transform:translate(0,0)}.react-paint-editor-snackbar[data-is-shown="0"]{opacity:0;transform:translateY(40px)}.react-paint-editor-button{vertical-align:middle;box-sizing:border-box;cursor:pointer;border-radius:var(--react-paint-editor-app-font-radius);color:var(--react-paint-editor-app-font-color);padding:var(--react-paint-editor-button-padding,0);background:0 0;border:none;justify-content:center;align-items:center;min-width:32px;height:32px;margin:2px 4px;font-size:14px;display:inline-flex}.react-paint-editor-button[data-selected="1"]{color:var(--react-paint-editor-app-font-selected-color);background:var(--react-paint-editor-app-font-selected-bg)}.react-paint-editor-button[data-hidden="1"]{visibility:hidden}.react-paint-editor-button[data-disabled="1"]{cursor:default;color:var(--react-paint-editor-app-font-disabled-color);background:var(--react-paint-editor-app-font-disabled-bg)}.react-paint-editor-button[data-selected="0"][data-disabled="0"]{background:var(--react-paint-editor-app-font-bg);color:var(--react-paint-editor-app-font-color)}.react-paint-editor-button[data-selected="0"][data-disabled="0"]:hover{color:var(--react-paint-editor-app-font-hover-color);background:var(--react-paint-editor-app-font-hover-bg)}.react-paint-editor-button[data-disabled="0"]{cursor:pointer}.react-paint-editor-button svg{fill:currentColor;width:20px;height:20px}.react-paint-editor-button input{display:none}.react-paint-editor-button-content{box-sizing:border-box;width:100%;padding:2px 6px;display:flex}.react-paint-editor-button-icon{align-items:center;display:flex}.react-paint-editor-button-children{text-align:left;flex:1;align-items:center;display:flex}.react-paint-editor-button-children+.react-paint-editor-button-icon{margin-left:12px}.react-paint-editor-panel{z-index:var(--react-paint-editor-panel-zindex);background:var(--react-paint-editor-app-toolbar-bg);white-space:nowrap;box-sizing:border-box;border-radius:8px;padding:8px;position:absolute;box-shadow:0 3px 8px #0000003d}.react-paint-editor-panel[data-alignment=left]{margin:4px;left:0}.react-paint-editor-panel[data-alignment=center]{margin:4px 0;left:50%;transform:translate(-50%)}.react-paint-editor-panel[data-alignment=right]{margin:4px;right:0}.react-paint-editor-panel[data-position=bottom]{bottom:100%}.react-paint-editor-panel[data-position=top]{top:100%}.react-paint-editor-panel[data-fitcontainer=true]{max-width:100%}.react-paint-editor-panel-title{margin-top:4px;margin-bottom:8px;font-size:18px}.react-paint-editor-layouts{background:var(--react-paint-editor-app-toolbar-bg);box-sizing:border-box;min-width:200px;display:inline-block;overflow-y:auto}.react-paint-editor-layouts-remove-button.react-paint-editor-layouts-remove-button{margin:2px 0}.react-paint-editor-layouts-remove-button.react-paint-editor-layouts-remove-button:not(:hover){opacity:.2}.react-paint-editor-layout{background:var(--react-paint-editor-app-toolbar-bg);box-sizing:border-box;border:3px solid #0000;justify-content:space-between;align-items:center;padding:4px 0;display:flex;position:relative}.react-paint-editor-layout[data-is-over="1"]{border:3px dotted var(--react-paint-editor-app-font-hover-bg)}.react-paint-editor-layout[data-is-dragging="1"]{opacity:.4}.react-paint-editor-layout[data-selected="1"]{color:var(--react-paint-editor-app-font-selected-color);background:var(--react-paint-editor-app-font-selected-bg)}.react-paint-editor-layout[data-selected="1"] .react-paint-editor-layouts-remove-button{color:#fff}.react-paint-editor-layout[data-selected="0"][data-disabled="0"]{background:var(--react-paint-editor-app-font-bg);color:var(--react-paint-editor-app-font-color)}.react-paint-editor-layout[data-selected="0"][data-disabled="0"]:hover{color:var(--react-paint-editor-app-font-hover-color);background:var(--react-paint-editor-app-font-hover-bg)}.react-paint-editor-layout[data-disabled="1"]{cursor:default;color:var(--react-paint-editor-app-font-disabled-color);background:var(--react-paint-editor-app-font-disabled-bg)}.react-paint-editor-layout[data-disabled="0"]{cursor:move}.react-paint-editor-layout>span{color:#8a8a8a;height:20px;line-height:1}.react-paint-editor-layout>span>svg{fill:#8a8a8a;width:20px;height:20px;padding:0 4px;transform:scale(.75)}.react-paint-editor-layouts-visible-button.react-paint-editor-layouts-visible-button{margin:2px 0}.react-paint-editor-layouts-visible-button.react-paint-editor-layouts-visible-button[data-visible=false]{opacity:.2}.react-paint-editor-layouts-locked-button.react-paint-editor-layouts-locked-button{margin:2px 0}.react-paint-editor-layouts-locked-button.react-paint-editor-layouts-locked-button[data-locked=false]{opacity:.2}.react-paint-editor-layouts-grid-button.react-paint-editor-layouts-grid-button span{justify-content:center}.react-paint-editor-layouts-subtitle{min-width:60px;font-weight:700}.react-paint-editor-layouts-separator{flex:1}.react-paint-editor-layouts-panel.react-paint-editor-layouts-panel.react-paint-editor-layouts-panel{bottom:36px;top:unset}.react-paint-editor-layouts-panel-content{flex-direction:column;max-height:100%;display:flex}.react-paint-editor-layouts-scrolling-content{flex-direction:column;display:flex;overflow-y:auto}.react-paint-editor-layouts-row{align-items:center;display:flex}.react-paint-editor-layouts-placeholder{opacity:.6;text-align:center;padding:12px 0}.react-paint-editor-modal{z-index:var(--react-paint-editor-modal-zindex);justify-content:center;align-items:center;display:flex;position:absolute;top:0;bottom:0;left:0;right:0}.react-paint-editor-modal[data-position=center]{align-items:center}.react-paint-editor-modal[data-position=bottom]{align-items:end}.react-paint-editor-modal-panel{background:var(--react-paint-editor-app-toolbar-bg);white-space:nowrap;border-radius:8px;padding:4px;display:grid;position:relative;box-shadow:0 3px 8px #0000003d}.react-paint-editor-modal-mask{background:#00000073;position:absolute;top:0;bottom:0;left:0;right:0}.react-paint-editor-colorfield-color{box-sizing:border-box;border-radius:50%;width:20px;height:20px}.react-paint-editor-colorfield-color[data-mode=fill]{background:var(--react-paint-editor-colorfield-color-value);border:1px solid #80808038}.react-paint-editor-colorfield-color[data-mode=stroke]{border:4px solid #80808038}.react-paint-editor-colorfield-color[data-mode=stroke]:after{content:"";border:2px solid var(--react-paint-editor-colorfield-color-value);box-sizing:border-box;border-radius:100%;width:18px;height:18px;display:block;position:relative;top:-3px;left:-3px}.react-paint-editor-colorfield-wrapper{flex-wrap:wrap;display:flex}.react-paint-editor-colorfield-customcolor{box-sizing:border-box;color:var(--react-paint-editor-colorfield-color-value);border-radius:50%;justify-content:center;align-items:baseline;width:20px;height:20px;font-weight:700;display:flex}.react-paint-editor-fontfamily-option{font-family:var(--react-paint-editor-fontfamily-family)}.react-paint-editor-selectfield-wrapper{flex-wrap:wrap;display:flex}.react-paint-editor-layout-opened .react-paint-editor-layout-button.react-paint-editor-layout-button.react-paint-editor-layout-button{color:var(--react-paint-editor-app-font-selected-color);background:var(--react-paint-editor-app-font-selected-bg)}.react-paint-editor-linearrow-left{border-top:5px solid #0000;border-bottom:5px solid #0000;border-right:15px solid;width:0;height:0;display:inline-block;position:absolute;top:50%;left:0;transform:translate(-25%,-50%)}.react-paint-editor-linearrow-right{border-top:5px solid #0000;border-bottom:5px solid #0000;border-left:15px solid;width:0;height:0;display:inline-block;position:absolute;top:50%;right:0;transform:translate(25%,-50%)}.react-paint-editor-linearrow-option{vertical-align:middle;background:currentColor;width:60px;height:2px;display:inline-block;position:relative}.react-paint-editor-linearrow-option[data-type="0"] .react-paint-editor-linearrow-left,.react-paint-editor-linearrow-option[data-type="1"] .react-paint-editor-linearrow-left,.react-paint-editor-linearrow-option[data-type="0"] .react-paint-editor-linearrow-right,.react-paint-editor-linearrow-option[data-type="2"] .react-paint-editor-linearrow-right{display:none}.react-paint-editor-linetype-option{display:inline-block}.react-paint-editor-linetype-option[data-type="0"]>span{background:currentColor}.react-paint-editor-linetype-option[data-type="2"]{position:relative;left:3px}.react-paint-editor-linetype-option[data-type="2"]>span:nth-child(3n-1){background:currentColor;width:12px}.react-paint-editor-linetype-option[data-type="2"]>span:nth-child(n+11){display:none}.react-paint-editor-linetype-option[data-type="1"]>span:nth-child(odd){background:currentColor}.react-paint-editor-linetype-option>span{vertical-align:middle;background:0 0;width:6px;height:2px;display:inline-block}.react-paint-editor-rangefield{flex-wrap:wrap;align-items:center;max-width:100%;display:inline-flex}.react-paint-editor-settings-bar{-webkit-user-select:none;user-select:none;background:var(--react-paint-editor-app-toolbar-bg);border-top:1px solid var(--react-paint-editor-app-divider-color);box-sizing:border-box;height:36px;display:flex;position:relative}.react-paint-editor-settings-shrinkable{text-align:left;flex:1;height:100%;position:relative}.react-paint-editor-settings-modal{grid-template-columns:repeat(auto-fill,40px);width:100%}.react-paint-editor-toolbox-panel-content{display:flex}.react-paint-editor-toolbox-panel-content[data-vertical="1"]{flex-direction:column}.react-paint-editor-toolbox-relative{display:inline-block;position:relative}.react-paint-editor-toolbox-pictureinput-modal form{grid-template-columns:3fr 1fr 1fr}.react-paint-editor-toolbox-pictureinput-modal form input{color:var(--react-paint-editor-app-font-color);border:1px solid var(--react-paint-editor-app-font-color);background:var(--react-paint-editor-app-toolbar-bg);outline:none}.react-paint-editor-toolbar-shrinkable{text-align:center;flex:1;height:100%;position:relative}.react-paint-editor-toolbar-toolbox{background:var(--react-paint-editor-app-toolbar-bg);border-bottom:1px solid var(--react-paint-editor-app-divider-color);box-sizing:border-box;max-height:36px;display:flex}.react-paint-editor-toolbar-modal{grid-template-columns:1fr 1fr 1fr}.react-paint-editor-toolbargroup-panel-content{display:flex}.react-paint-editor-toolbargroup-panel-content[data-vertical="1"]{flex-direction:column}.react-paint-editor-toolbargroup-relative{display:inline-block;position:relative}.react-paint-editor-app{color:var(--react-paint-editor-app-font-color);max-width:min(100%,var(--react-paint-editor-app-maxWidth));flex-direction:column;font-family:Arial,Helvetica,sans-serif;display:flex;position:relative}.react-paint-editor-app hr{border:none;border-top:1px solid var(--react-paint-editor-app-divider-color);width:100%}
|
|
1
|
+
.react-paint-canvas-box{flex:1;justify-content:center;align-items:center;display:flex}.react-paint-canvas-container{background-color:var(--react-paint-app-canvas-bg);cursor:var(--react-paint-canvas-cursor);background-repeat:repeat;background-size:16px;display:grid;position:relative;overflow:hidden}.react-paint-canvas-container[data-grow=true]{width:100%;height:100%}.react-paint-canvas-drawcanvas{-webkit-user-select:none;user-select:none;touch-action:none;grid-area:1/1;max-width:100%;display:block;position:relative}.react-paint-canvas-drawcanvas[data-grow=true]{width:100%}.react-paint-canvas-selectioncanvas{-webkit-user-select:none;user-select:none;pointer-events:none;touch-action:none;grid-area:1/1;max-width:100%;display:block;position:relative}.react-paint-canvas-selectioncanvas[data-grow=true]{width:100%}.react-paint-editor-toolbox-edittextbox{transform-origin:0 0;box-sizing:border-box;transform:var(--react-paint-editor-toolbox-edittextbox-transform);color:var(--react-paint-editor-toolbox-edittextbox-color);padding:var(--react-paint-editor-toolbox-edittextbox-padding);line-height:1;font-size:var(--react-paint-editor-toolbox-edittextbox-fontsize);font-family:var(--react-paint-editor-toolbox-edittextbox-fontfamily);opacity:var(--react-paint-editor-toolbox-edittextbox-opacity);background:0 0;outline:none;width:max-content;display:inline-block;position:absolute;top:0;left:0}.react-paint-editor-toolbox-edittextbox[data-fontbold=true]{font-weight:700}.react-paint-editor-toolbox-edittextbox[data-fontitalic=true]{font-style:italic}.react-paint-app-row{max-width:100%;aspect-ratio:var(--react-paint-app-row-aspectratio);width:100%;position:relative}.react-paint-app-row[data-grow=false]{max-width:calc(var(--react-paint-app-canvaswidth)*1px)}.react-paint-app-row[data-shrink=false]{min-width:calc(var(--react-paint-app-canvaswidth)*1px)}.react-paint-editor-loading{z-index:var(--react-paint-editor-loading-zindex);transition:opacity var(--react-paint-editor-loading-transition-duration)linear;opacity:0;background:#00000050;justify-content:center;align-items:center;display:flex;position:absolute;top:0;bottom:0;left:0;right:0}.react-paint-editor-loading[data-loading=visible]{opacity:1}@keyframes react-paint-editor-loading-rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.react-paint-editor-loader{width:40px;height:40px;animation:1s infinite react-paint-editor-loading-rotation;position:relative;transform:rotate(10deg)}.react-paint-editor-loader>div{border-radius:50%;width:15px;height:15px;position:absolute}.react-paint-editor-loader>div:first-child{background-color:#5c6bc0;left:0}.react-paint-editor-loader>div:nth-child(2){background-color:#8bc34a;right:0}.react-paint-editor-loader>div:nth-child(3){background-color:#ffb74d;bottom:0}.react-paint-editor-loader>div:nth-child(4){background-color:#f44336;bottom:0;right:0}.react-paint-editor-snackbar-container{z-index:var(--react-paint-editor-snackbar-zindex);flex-direction:column-reverse;align-items:center;height:0;display:flex;position:absolute;bottom:0;left:0;right:0}.react-paint-editor-snackbar{color:#fff;overflow-wrap:break-word;box-sizing:border-box;max-width:calc(100% - 24px);transition:all var(--react-paint-editor-panel-transition-duration);opacity:0;margin:4px;padding:12px 48px;display:inline-block;transform:translateY(40px)}.react-paint-editor-snackbar[data-type=infos]{background:#646464}.react-paint-editor-snackbar[data-type=error]{background:#911717}.react-paint-editor-snackbar[data-type=success]{background:#088900}.react-paint-editor-snackbar[data-is-shown="1"]{opacity:1;transform:translate(0,0)}.react-paint-editor-snackbar[data-is-shown="0"]{opacity:0;transform:translateY(40px)}.react-paint-editor-button{vertical-align:middle;box-sizing:border-box;cursor:pointer;border-radius:var(--react-paint-editor-app-font-radius);min-width:32px;height:32px;color:var(--react-paint-editor-app-font-color);padding:var(--react-paint-editor-button-padding,0);background:0 0;border:none;justify-content:center;align-items:center;margin:2px 4px;font-size:14px;display:inline-flex}.react-paint-editor-button[data-selected="1"]{color:var(--react-paint-editor-app-font-selected-color);background:var(--react-paint-editor-app-font-selected-bg)}.react-paint-editor-button[data-hidden="1"]{visibility:hidden}.react-paint-editor-button[data-disabled="1"]{cursor:default;color:var(--react-paint-editor-app-font-disabled-color);background:var(--react-paint-editor-app-font-disabled-bg)}.react-paint-editor-button[data-selected="0"][data-disabled="0"]{background:var(--react-paint-editor-app-font-bg);color:var(--react-paint-editor-app-font-color)}.react-paint-editor-button[data-selected="0"][data-disabled="0"]:hover{color:var(--react-paint-editor-app-font-hover-color);background:var(--react-paint-editor-app-font-hover-bg)}.react-paint-editor-button[data-disabled="0"]{cursor:pointer}.react-paint-editor-button svg{fill:currentColor;width:20px;height:20px}.react-paint-editor-button input{display:none}.react-paint-editor-button-content{box-sizing:border-box;width:100%;padding:2px 6px;display:flex}.react-paint-editor-button-icon{align-items:center;display:flex}.react-paint-editor-button-children{text-align:left;flex:1;align-items:center;display:flex}.react-paint-editor-button-children+.react-paint-editor-button-icon{margin-left:12px}.react-paint-editor-panel{z-index:var(--react-paint-editor-panel-zindex);background:var(--react-paint-editor-app-toolbar-bg);white-space:nowrap;box-sizing:border-box;border-radius:8px;padding:8px;position:absolute;box-shadow:0 3px 8px #0000003d}.react-paint-editor-panel[data-alignment=left]{margin:4px;left:0}.react-paint-editor-panel[data-alignment=center]{margin:4px 0;left:50%;transform:translate(-50%)}.react-paint-editor-panel[data-alignment=right]{margin:4px;right:0}.react-paint-editor-panel[data-position=bottom]{bottom:100%}.react-paint-editor-panel[data-position=top]{top:100%}.react-paint-editor-panel[data-fitcontainer=true]{max-width:100%}.react-paint-editor-panel-title{margin-top:4px;margin-bottom:8px;font-size:18px}.react-paint-editor-layouts{background:var(--react-paint-editor-app-toolbar-bg);box-sizing:border-box;min-width:200px;display:inline-block;overflow-y:auto}.react-paint-editor-layouts-remove-button.react-paint-editor-layouts-remove-button{margin:2px 0}.react-paint-editor-layouts-remove-button.react-paint-editor-layouts-remove-button:not(:hover){opacity:.2}.react-paint-editor-layout{background:var(--react-paint-editor-app-toolbar-bg);box-sizing:border-box;border:3px solid #0000;justify-content:space-between;align-items:center;padding:4px 0;display:flex;position:relative}.react-paint-editor-layout[data-is-over="1"]{border:3px dotted var(--react-paint-editor-app-font-hover-bg)}.react-paint-editor-layout[data-is-dragging="1"]{opacity:.4}.react-paint-editor-layout[data-selected="1"]{color:var(--react-paint-editor-app-font-selected-color);background:var(--react-paint-editor-app-font-selected-bg)}.react-paint-editor-layout[data-selected="1"] .react-paint-editor-layouts-remove-button{color:#fff}.react-paint-editor-layout[data-selected="0"][data-disabled="0"]{background:var(--react-paint-editor-app-font-bg);color:var(--react-paint-editor-app-font-color)}.react-paint-editor-layout[data-selected="0"][data-disabled="0"]:hover{color:var(--react-paint-editor-app-font-hover-color);background:var(--react-paint-editor-app-font-hover-bg)}.react-paint-editor-layout[data-disabled="1"]{cursor:default;color:var(--react-paint-editor-app-font-disabled-color);background:var(--react-paint-editor-app-font-disabled-bg)}.react-paint-editor-layout[data-disabled="0"]{cursor:move}.react-paint-editor-layout>span{color:#8a8a8a;height:20px;line-height:1}.react-paint-editor-layout>span>svg{fill:#8a8a8a;width:20px;height:20px;padding:0 4px;transform:scale(.75)}.react-paint-editor-layouts-visible-button.react-paint-editor-layouts-visible-button{margin:2px 0}.react-paint-editor-layouts-visible-button.react-paint-editor-layouts-visible-button[data-visible=false]{opacity:.2}.react-paint-editor-layouts-locked-button.react-paint-editor-layouts-locked-button{margin:2px 0}.react-paint-editor-layouts-locked-button.react-paint-editor-layouts-locked-button[data-locked=false]{opacity:.2}.react-paint-editor-layouts-grid-button.react-paint-editor-layouts-grid-button span{justify-content:center}.react-paint-editor-layouts-subtitle{min-width:60px;font-weight:700}.react-paint-editor-layouts-separator{flex:1}.react-paint-editor-layouts-panel.react-paint-editor-layouts-panel.react-paint-editor-layouts-panel{bottom:36px;top:unset}.react-paint-editor-layouts-panel.react-paint-editor-layouts-panel.react-paint-editor-layouts-panel[data-edit="0"]{bottom:0;top:unset}.react-paint-editor-layouts-panel-content{flex-direction:column;max-height:100%;display:flex}.react-paint-editor-layouts-scrolling-content{flex-direction:column;display:flex;overflow-y:auto}.react-paint-editor-layouts-row{align-items:center;display:flex}.react-paint-editor-layouts-placeholder{opacity:.6;text-align:center;padding:12px 0}.react-paint-editor-modal{z-index:var(--react-paint-editor-modal-zindex);justify-content:center;align-items:center;display:flex;position:absolute;top:0;bottom:0;left:0;right:0}.react-paint-editor-modal[data-position=center]{align-items:center}.react-paint-editor-modal[data-position=bottom]{align-items:end}.react-paint-editor-modal-panel{background:var(--react-paint-editor-app-toolbar-bg);white-space:nowrap;border-radius:8px;padding:4px;display:grid;position:relative;box-shadow:0 3px 8px #0000003d}.react-paint-editor-modal-mask{background:#00000073;position:absolute;top:0;bottom:0;left:0;right:0}.react-paint-editor-colorfield-color{box-sizing:border-box;border-radius:50%;width:20px;height:20px}.react-paint-editor-colorfield-color[data-mode=fill]{background:var(--react-paint-editor-colorfield-color-value);border:1px solid #80808038}.react-paint-editor-colorfield-color[data-mode=stroke]{border:4px solid #80808038}.react-paint-editor-colorfield-color[data-mode=stroke]:after{content:"";border:2px solid var(--react-paint-editor-colorfield-color-value);box-sizing:border-box;border-radius:100%;width:18px;height:18px;display:block;position:relative;top:-3px;left:-3px}.react-paint-editor-colorfield-wrapper{flex-wrap:wrap;display:flex}.react-paint-editor-colorfield-customcolor{box-sizing:border-box;width:20px;height:20px;color:var(--react-paint-editor-colorfield-color-value);border-radius:50%;justify-content:center;align-items:baseline;font-weight:700;display:flex}.react-paint-editor-fontfamily-option{font-family:var(--react-paint-editor-fontfamily-family)}.react-paint-editor-selectfield-wrapper{flex-wrap:wrap;display:flex}.react-paint-editor-layout-opened .react-paint-editor-layout-button.react-paint-editor-layout-button.react-paint-editor-layout-button{color:var(--react-paint-editor-app-font-selected-color);background:var(--react-paint-editor-app-font-selected-bg)}.react-paint-editor-linearrow-left{border-top:5px solid #0000;border-bottom:5px solid #0000;border-right:15px solid;width:0;height:0;display:inline-block;position:absolute;top:50%;left:0;transform:translate(-25%,-50%)}.react-paint-editor-linearrow-right{border-top:5px solid #0000;border-bottom:5px solid #0000;border-left:15px solid;width:0;height:0;display:inline-block;position:absolute;top:50%;right:0;transform:translate(25%,-50%)}.react-paint-editor-linearrow-option{vertical-align:middle;background:currentColor;width:60px;height:2px;display:inline-block;position:relative}.react-paint-editor-linearrow-option[data-type="0"] .react-paint-editor-linearrow-left,.react-paint-editor-linearrow-option[data-type="1"] .react-paint-editor-linearrow-left,.react-paint-editor-linearrow-option[data-type="0"] .react-paint-editor-linearrow-right,.react-paint-editor-linearrow-option[data-type="2"] .react-paint-editor-linearrow-right{display:none}.react-paint-editor-linetype-option{display:inline-block}.react-paint-editor-linetype-option>span{vertical-align:middle;background:0 0;width:6px;height:2px;display:inline-block}.react-paint-editor-linetype-option[data-type="0"]>span{background:currentColor}.react-paint-editor-linetype-option[data-type="2"]{position:relative;left:3px}.react-paint-editor-linetype-option[data-type="2"]>span:nth-child(3n-1){background:currentColor;width:12px}.react-paint-editor-linetype-option[data-type="2"]>span:nth-child(n+11){display:none}.react-paint-editor-linetype-option[data-type="1"]>span:nth-child(odd){background:currentColor}.react-paint-editor-rangefield{flex-wrap:wrap;align-items:center;max-width:100%;display:inline-flex}.react-paint-editor-settings-bar{-webkit-user-select:none;user-select:none;background:var(--react-paint-editor-app-toolbar-bg);border-top:1px solid var(--react-paint-editor-app-divider-color);box-sizing:border-box;height:36px;display:flex;position:relative}.react-paint-editor-settings-shrinkable{text-align:left;flex:1;height:100%;display:flex;position:relative}.react-paint-editor-settings-modal{grid-template-columns:repeat(auto-fill,40px);width:100%}.react-paint-editor-zoom-button{margin:0}.react-paint-editor-zoom-button .react-paint-editor-button-children{justify-content:center}.react-paint-editor-zoom-button-value{min-width:60px}.react-paint-editor-bar-zoom-button-opened.react-paint-editor-bar-zoom-button-opened.react-paint-editor-bar-zoom-button-opened.react-paint-editor-bar-zoom-button-opened{color:var(--react-paint-editor-app-font-selected-color);background:var(--react-paint-editor-app-font-selected-bg)}.react-paint-editor-toolbox-panel-content{display:flex}.react-paint-editor-toolbox-panel-content[data-vertical="1"]{flex-direction:column}.react-paint-editor-toolbox-relative{display:inline-block;position:relative}.react-paint-editor-toolbox-pictureinput-modal form{grid-template-columns:3fr 1fr 1fr}.react-paint-editor-toolbox-pictureinput-modal form input{color:var(--react-paint-editor-app-font-color);border:1px solid var(--react-paint-editor-app-font-color);background:var(--react-paint-editor-app-toolbar-bg);outline:none}.react-paint-editor-toolbar-shrinkable{text-align:center;flex:1;height:100%;position:relative}.react-paint-editor-toolbar-toolbox{background:var(--react-paint-editor-app-toolbar-bg);border-bottom:1px solid var(--react-paint-editor-app-divider-color);box-sizing:border-box;max-height:36px;min-width:var(--react-paint-editor-toolbar-minwidth);display:flex}.react-paint-editor-toolbar-modal{grid-template-columns:1fr 1fr 1fr}.react-paint-editor-toolbox-export-modal h3{margin-top:8px;margin-bottom:0;font-size:18px}.react-paint-editor-toolbargroup-panel-content{display:flex}.react-paint-editor-toolbargroup-panel-content[data-vertical="1"]{flex-direction:column}.react-paint-editor-toolbargroup-relative{display:inline-block;position:relative}.react-paint-editor-app{color:var(--react-paint-editor-app-font-color);max-width:min(100%,var(--react-paint-editor-app-maxWidth));flex-direction:column;font-family:Arial,Helvetica,sans-serif;display:flex;position:relative}.react-paint-editor-app hr{border:none;border-top:1px solid var(--react-paint-editor-app-divider-color);width:100%}
|