@yorab/react-paint 0.17.1 → 0.18.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/dist/_chunks/array-DuJem3vg.js +1 -0
- package/dist/_chunks/canvas-OCtokhMt.js +1 -0
- package/dist/_chunks/editor-CNTO8aYs.js +1 -0
- package/dist/canvas/components/Canvas.d.ts +1 -52
- package/dist/canvas/constants/app.d.ts +3 -25
- package/dist/canvas/constants/rendering.d.ts +3 -0
- package/dist/canvas/constants/tools.d.ts +4 -0
- package/dist/canvas/context/CanvasContext.d.ts +55 -0
- package/dist/canvas/hooks/useDrawableCanvas.d.ts +2 -43
- package/dist/canvas/hooks/useEventListener.d.ts +2 -0
- package/dist/canvas/hooks/useReactPaint.d.ts +8 -3
- package/dist/canvas/hooks/useShapes.d.ts +1 -0
- package/dist/canvas/index.d.ts +4 -0
- package/dist/canvas/index.js +1 -0
- package/dist/canvas/utils/canvas.d.ts +2 -1
- package/dist/canvas/utils/intersect.d.ts +4 -0
- package/dist/canvas/utils/selection.d.ts +0 -3
- package/dist/canvas/utils/shapes/index.d.ts +2 -3
- package/dist/canvas/utils/shapes/line.d.ts +2 -2
- package/dist/canvas/utils/shapes/path.d.ts +1 -0
- package/dist/canvas/utils/tools.d.ts +1 -1
- package/dist/canvas/utils/transform.d.ts +0 -1
- package/dist/common/hooks/useDebounce.d.ts +2 -0
- package/dist/common/types/Settings.d.ts +24 -0
- package/dist/common/utils/selection.d.ts +4 -0
- package/dist/editor/components/settings/Layouts.d.ts +1 -1
- package/dist/editor/components/settings/SettingsBar.d.ts +4 -2
- package/dist/editor/components/toolbox/ContextMenu.d.ts +4 -2
- package/dist/editor/components/toolbox/Toolbar.d.ts +1 -1
- package/dist/editor/hooks/useMenu.d.ts +2 -1
- package/dist/editor/index.d.ts +3 -2
- package/dist/editor/index.js +1 -0
- package/dist/editor/utils/style.d.ts +1 -1
- package/dist/index.d.ts +4 -6
- package/dist/react-paint.css +1 -0
- package/dist/react-paint.js +1 -1914
- package/dist/react-paint.umd.cjs +1 -1
- package/package.json +34 -18
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type OptionalOptions, type UtilsSettings } from './../../canvas/constants/app';
|
|
2
|
+
import { calculateTextFontSize } from './../../canvas/utils/shapes/text';
|
|
2
3
|
import type { CanvasSize } from './../../common/types/Canvas';
|
|
3
4
|
import type { SelectionModeData } from './../../common/types/Mode';
|
|
4
5
|
import type { ExportedDrawableShape, Point, SelectionType, ShapeEntity, StateData } from './../../common/types/Shapes';
|
|
@@ -12,8 +13,8 @@ type UseReactPaintProps = {
|
|
|
12
13
|
disabled?: boolean | undefined;
|
|
13
14
|
options?: OptionalOptions | undefined;
|
|
14
15
|
};
|
|
15
|
-
type EditorProps = {
|
|
16
|
-
|
|
16
|
+
export type EditorProps = {
|
|
17
|
+
shapes: ShapeEntity[];
|
|
17
18
|
addPictureShape: (fileOrUrl: File | string, maxWidth?: number, maxHeight?: number) => Promise<ShapeEntity>;
|
|
18
19
|
swapShapes: (startPositionShapeId: string, endPositionShapeId: string) => void;
|
|
19
20
|
moveShapes: (shapes: ShapeEntity[], action: 'first' | 'last' | 'forward' | 'backward') => void;
|
|
@@ -60,6 +61,10 @@ type EditorProps = {
|
|
|
60
61
|
settings: UtilsSettings;
|
|
61
62
|
setCanvasZoom: (action: 'unzoom' | 'zoom' | 'default') => void;
|
|
62
63
|
resetZoom: () => void;
|
|
64
|
+
buildShapesGroup: (shapes: ShapeEntity[]) => SelectionType | undefined;
|
|
65
|
+
copyShapes: (selection: SelectionType) => ShapeEntity[];
|
|
66
|
+
refreshShape: (shape: ShapeEntity) => ShapeEntity;
|
|
67
|
+
calculateTextFontSize: typeof calculateTextFontSize;
|
|
63
68
|
canvas: {
|
|
64
69
|
canGrow: boolean;
|
|
65
70
|
canShrink: boolean;
|
|
@@ -72,7 +77,7 @@ type EditorProps = {
|
|
|
72
77
|
};
|
|
73
78
|
};
|
|
74
79
|
type CanvasProps = {
|
|
75
|
-
|
|
80
|
+
shapes: ShapeEntity[];
|
|
76
81
|
selectedShape: SelectionType | undefined;
|
|
77
82
|
copiedShape: SelectionType | undefined;
|
|
78
83
|
setCopiedShape: React.Dispatch<React.SetStateAction<SelectionType | undefined>>;
|
|
@@ -3,6 +3,7 @@ import type { Point, SelectionType, ShapeEntity, StateData } from './../../commo
|
|
|
3
3
|
declare const useShapes: (settings: UtilsSettings, width: number, height: number, isShiftPressed: boolean) => {
|
|
4
4
|
registerEvent: (event: "dataChanged", fn: (data: StateData, source: "user" | "remote") => void) => void;
|
|
5
5
|
unregisterEvent: (event: "dataChanged", fn?: (data: StateData, source: "user" | "remote") => void) => void;
|
|
6
|
+
shapes: ShapeEntity[];
|
|
6
7
|
shapesRef: React.RefObject<ShapeEntity[]>;
|
|
7
8
|
selectedShape: SelectionType | undefined;
|
|
8
9
|
hoveredShape: ShapeEntity | undefined;
|
package/dist/canvas/index.d.ts
CHANGED
|
@@ -13,3 +13,7 @@ type AppProps = {
|
|
|
13
13
|
};
|
|
14
14
|
declare const App: ({ options, className, style, canvasProps }: AppProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export default App;
|
|
16
|
+
export type { OptionalOptions } from './../canvas/constants/app';
|
|
17
|
+
export { DEFAULT_OPTIONS } from './../canvas/constants/app';
|
|
18
|
+
export { default as useReactPaint } from './../canvas/hooks/useReactPaint';
|
|
19
|
+
export type { ExportedDrawableShape as DrawableShape, StateData } from './../common/types/Shapes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"../_chunks/canvas-OCtokhMt.js";export{t as DEFAULT_OPTIONS,n as default,e as useReactPaint};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
2
|
-
import type { Point } from './../../common/types/Shapes';
|
|
2
|
+
import type { Point, StyleShape } from './../../common/types/Shapes';
|
|
3
3
|
export declare const initCanvasContext: (ctx: CanvasRenderingContext2D) => void;
|
|
4
4
|
export declare const updateCanvasContext: (ctx: CanvasRenderingContext2D, style?: {
|
|
5
5
|
fillColor?: string;
|
|
@@ -12,3 +12,4 @@ export declare const updateCanvasContext: (ctx: CanvasRenderingContext2D, style?
|
|
|
12
12
|
shadowBlur?: number;
|
|
13
13
|
}) => void;
|
|
14
14
|
export declare const transformCanvas: (ctx: CanvasRenderingContext2D, settings: UtilsSettings, rotation?: number, translation?: Point) => void;
|
|
15
|
+
export declare const drawPathWithFillAndStroke: (ctx: CanvasRenderingContext2D, path: Path2D, style?: Pick<StyleShape, "fillColor" | "strokeColor">) => void;
|
|
@@ -21,3 +21,7 @@ export declare const checkCurveLinesSelectionIntersection: (ctx: CanvasRendering
|
|
|
21
21
|
export declare const checkPositionIntersection: (ctx: CanvasRenderingContext2D, shape: SelectionType, position: Point, settings: UtilsSettings) => false | HoverModeData;
|
|
22
22
|
export declare function getRectIntersection(rect1: Rect, rect2: Rect): Rect | undefined;
|
|
23
23
|
export declare const checkSelectionFrameCollision: (ctx: CanvasRenderingContext2D, shape: ShapeEntity, selectionFrame: [Point, Point]) => boolean;
|
|
24
|
+
export declare const shouldCancelLongPress: (e: MouseEvent | TouchEvent, startPosition: {
|
|
25
|
+
clientX: number;
|
|
26
|
+
clientY: number;
|
|
27
|
+
}) => boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
2
2
|
import type { HoverModeData, SelectionModeData } from './../../common/types/Mode';
|
|
3
3
|
import type { Point, SelectionType, ShapeEntity } from './../../common/types/Shapes';
|
|
4
|
-
import type { CustomTool } from './../../common/types/tools';
|
|
5
4
|
export declare const getNewSelectionData: (hoverMode: HoverModeData, selectedShape: SelectionType, cursorPosition: Point) => SelectionModeData<Point | number> | undefined;
|
|
6
5
|
export declare const selectShape: (ctx: CanvasRenderingContext2D, shapes: ShapeEntity[], cursorPosition: Point, settings: UtilsSettings, selectedShape: SelectionType | undefined, isTouchGesture: boolean, withFrameSelection: boolean, behavior?: "add" | "remove" | "replace") => {
|
|
7
6
|
mode: SelectionModeData<Point | number>;
|
|
@@ -9,7 +8,5 @@ export declare const selectShape: (ctx: CanvasRenderingContext2D, shapes: ShapeE
|
|
|
9
8
|
};
|
|
10
9
|
export declare const buildShapesGroup: (shapes: ShapeEntity[], settings: UtilsSettings) => SelectionType | undefined;
|
|
11
10
|
export declare const applyToSelectedShape: (applyToShape: (shape: ShapeEntity, settings: UtilsSettings) => ShapeEntity, settings: UtilsSettings) => (selection: SelectionType | undefined) => SelectionType | undefined;
|
|
12
|
-
export declare const getSelectedShapes: (selection: SelectionType | undefined) => ShapeEntity[];
|
|
13
11
|
export declare const addToSelectedShapes: (selection: SelectionType | undefined, shapes: ShapeEntity[]) => ShapeEntity[];
|
|
14
12
|
export declare const omitFromSelectedShapes: (selection: SelectionType | undefined, shape: ShapeEntity) => ShapeEntity[];
|
|
15
|
-
export declare const getSelectedShapesTools: (selection: SelectionType | undefined, availableTools: CustomTool[]) => CustomTool | undefined;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
2
|
import type { HoverModeData, SelectionModeData, SelectionModeResize } from './../../../common/types/Mode';
|
|
3
|
-
import type { DrawableShape, Point, SelectionType, ShapeEntity } from './../../../common/types/Shapes';
|
|
3
|
+
import type { DrawableShape, Point, Rect, SelectionType, ShapeEntity } from './../../../common/types/Shapes';
|
|
4
4
|
import type { CustomTool } from './../../../common/types/tools';
|
|
5
5
|
export declare const createShape: (ctx: CanvasRenderingContext2D, shape: Exclude<CustomTool, {
|
|
6
6
|
type: "picture";
|
|
7
7
|
}>, cursorPosition: Point, settings: UtilsSettings) => ShapeEntity | undefined;
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const drawShape: (ctx: CanvasRenderingContext2D, shape: ShapeEntity, settings: UtilsSettings) => void;
|
|
8
|
+
export declare const drawShape: (ctx: CanvasRenderingContext2D, shape: ShapeEntity, settings: UtilsSettings, currentView?: Rect) => void;
|
|
10
9
|
export declare const rotateShape: <T extends ShapeEntity>(shape: T, rotationToApply: number, selectionCenter: Point) => T;
|
|
11
10
|
export declare const resizeShape: <T extends ShapeEntity>(ctx: CanvasRenderingContext2D, cursorPosition: Point, originalShape: T, selectionMode: SelectionModeData<Point | number>, settings: UtilsSettings, isShiftPressed: boolean, isAltPressed: boolean) => T;
|
|
12
11
|
export declare const resizeShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point, originalShape: SelectionType, selectionMode: SelectionModeResize<Point | number>, settings: UtilsSettings, isShiftPressed: boolean, isAltPressed: boolean) => ShapeEntity[];
|
|
@@ -14,6 +14,6 @@ export declare const createLine: (shape: {
|
|
|
14
14
|
export declare const buildTriangleOnLine: (center: Point, rotation: number, lineStyle: StyleShape) => Triangle;
|
|
15
15
|
export declare const drawLine: (ctx: CanvasRenderingContext2D, shape: ShapeEntity<"line">) => void;
|
|
16
16
|
export declare const resizeLine: (cursorPosition: Point, originalShape: ShapeEntity<"line">, selectionMode: SelectionModeResize<number>, settings: UtilsSettings) => ShapeEntity<"line">;
|
|
17
|
-
export declare const resizeLinePolygonCurveInGroup:
|
|
17
|
+
export declare const resizeLinePolygonCurveInGroup: <T extends ShapeEntity<"line" | "polygon" | "curve">>(shape: T, group: SelectionType & {
|
|
18
18
|
type: "group";
|
|
19
|
-
}, groupCtx: GroupResizeContext) =>
|
|
19
|
+
}, groupCtx: GroupResizeContext) => T;
|
|
@@ -20,6 +20,7 @@ export declare const catmullRomToBezier: (p0: Point, p1: Point, p2: Point, p3: P
|
|
|
20
20
|
export declare const createCurvePath: (curve: DrawableShape<"curve">) => Path2D;
|
|
21
21
|
export declare const createPolygonPath: (polygon: DrawableShape<"polygon"> | DrawableShape<"curve">) => Path2D;
|
|
22
22
|
export declare const createTrianglePath: (triangle: DrawableShape<"triangle">) => Path2D;
|
|
23
|
+
export declare const expandRect: (rect: Rect, selectionPadding: number) => Rect;
|
|
23
24
|
export declare const getComputedShapeInfos: <T extends DrawableShape, U extends Pick<UtilsSettings, "selectionPadding">>(shape: T, getBorder: (shape: T, settings: U) => Rect, settings: U, getOuterBorder?: (shape: T, borders: Rect, settings: U) => Rect) => {
|
|
24
25
|
borders: Rect;
|
|
25
26
|
outerBorders: Rect;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { CustomTool, CustomToolInput } from './../../common/types/tools';
|
|
2
2
|
import type { RecursivePartial } from './../../common/types/utils';
|
|
3
|
-
export declare const sanitizeTools: (tools: RecursivePartial<CustomToolInput>[]
|
|
3
|
+
export declare const sanitizeTools: (tools: RecursivePartial<CustomToolInput>[]) => CustomTool[];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
2
2
|
import type { SelectionModeData } from './../../common/types/Mode';
|
|
3
3
|
import type { DrawableShape, Line, Point, SelectionType } from './../../common/types/Shapes';
|
|
4
|
-
export declare const getNormalizedSize: (originalWidth: number, originalHeight: number, width: number, height: number) => number[];
|
|
5
4
|
export declare const roundValues: (prop: number, precision?: number) => number;
|
|
6
5
|
export declare const scalePoint: (point: Point, minX: number, minY: number, scaleX?: number, scaleY?: number) => Point;
|
|
7
6
|
export declare const roundForGrid: (value: number, settings: UtilsSettings, gridOffset?: number) => number;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Point } from './../../common/types/Shapes';
|
|
2
|
+
export type BrushAlgo = 'simple' | 'quadratic';
|
|
3
|
+
export type UtilsSettings = {
|
|
4
|
+
brushAlgo: BrushAlgo;
|
|
5
|
+
isBrushShapeDoneOnMouseUp: boolean;
|
|
6
|
+
gridGap: number;
|
|
7
|
+
canvasOffset: Point;
|
|
8
|
+
canvasZoom: number;
|
|
9
|
+
canvasSize: {
|
|
10
|
+
realWidth: number;
|
|
11
|
+
realHeight: number;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
scaleRatio: number;
|
|
15
|
+
scaleRatioWithNoZoom: number;
|
|
16
|
+
};
|
|
17
|
+
selectionPadding: number;
|
|
18
|
+
size: 'infinite' | 'fixed';
|
|
19
|
+
features: {
|
|
20
|
+
zoom: boolean;
|
|
21
|
+
edition: boolean;
|
|
22
|
+
};
|
|
23
|
+
debug: boolean;
|
|
24
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SelectionType, ShapeEntity } from './../../common/types/Shapes';
|
|
2
|
+
import type { CustomTool } from './../../common/types/tools';
|
|
3
|
+
export declare const getSelectedShapes: (selection: SelectionType | undefined) => ShapeEntity[];
|
|
4
|
+
export declare const getSelectedShapesTools: (selection: SelectionType | undefined, availableTools: CustomTool[]) => CustomTool | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SelectionType, ShapeEntity } from './../../../common/types/Shapes';
|
|
2
2
|
import type { GridLabelType } from './../../../editor/constants/grid';
|
|
3
3
|
import './Layouts.css';
|
|
4
|
-
import type { UtilsSettings } from './../../../
|
|
4
|
+
import type { UtilsSettings } from './../../../common/types/Settings';
|
|
5
5
|
type LayoutsType = {
|
|
6
6
|
gridFormat: GridLabelType;
|
|
7
7
|
setGridFormat: (value: GridLabelType) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UtilsSettings } from './../../../
|
|
1
|
+
import type { UtilsSettings } from './../../../common/types/Settings';
|
|
2
2
|
import type { SelectionType, ShapeEntity } from './../../../common/types/Shapes';
|
|
3
3
|
import type { CustomTool, ToolsType } from './../../../common/types/tools';
|
|
4
4
|
import type React from 'react';
|
|
@@ -19,6 +19,8 @@ type SettingsBarType = {
|
|
|
19
19
|
setIsZoomPanelShown: React.Dispatch<React.SetStateAction<boolean>>;
|
|
20
20
|
setCanvasZoom: (action: 'unzoom' | 'zoom' | 'default') => void;
|
|
21
21
|
saveShapes: () => void;
|
|
22
|
+
refreshShape: (shape: ShapeEntity) => ShapeEntity;
|
|
23
|
+
calculateTextFontSize: (ctx: CanvasRenderingContext2D, text: string[], maxWidth: number, fontBold: boolean, fontItalic: boolean, fontFamily?: string) => number;
|
|
22
24
|
};
|
|
23
|
-
declare const SettingsBar: ({ width, availableTools, updateToolSettings, layersManipulation, toggleLayoutPanel, activeTool, saveShapes, selectedShape, canvas, settings, updateShape, removeShape, isZoomPanelShown, setIsZoomPanelShown }: SettingsBarType) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare const SettingsBar: ({ width, availableTools, updateToolSettings, layersManipulation, toggleLayoutPanel, activeTool, saveShapes, selectedShape, canvas, settings, updateShape, removeShape, isZoomPanelShown, setIsZoomPanelShown, refreshShape, calculateTextFontSize }: SettingsBarType) => import("react/jsx-runtime").JSX.Element;
|
|
24
26
|
export default SettingsBar;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UtilsSettings } from './../../../
|
|
1
|
+
import type { UtilsSettings } from './../../../common/types/Settings';
|
|
2
2
|
import './ContextMenu.css';
|
|
3
3
|
import type { SelectionModeContextMenu } from './../../../common/types/Mode';
|
|
4
4
|
import type { Point, SelectionType, ShapeEntity } from './../../../common/types/Shapes';
|
|
@@ -8,6 +8,8 @@ type ContextMenuType = {
|
|
|
8
8
|
canvasRef: React.RefObject<HTMLCanvasElement | null>;
|
|
9
9
|
selectAllShapes: () => void;
|
|
10
10
|
closeContextMenu: () => void;
|
|
11
|
+
buildShapesGroup: (shapes: ShapeEntity[]) => SelectionType | undefined;
|
|
12
|
+
copyShapes: (selection: SelectionType) => ShapeEntity[];
|
|
11
13
|
toggleShapeVisibility: (shapes: ShapeEntity[]) => void;
|
|
12
14
|
toggleShapeLock: (shapes: ShapeEntity[]) => void;
|
|
13
15
|
removeShape: (shapes: ShapeEntity[]) => void;
|
|
@@ -19,5 +21,5 @@ type ContextMenuType = {
|
|
|
19
21
|
removeShapePoint: (shape: ShapeEntity<'curve' | 'polygon'>, pointIndex: number) => void;
|
|
20
22
|
transformShape: (ctx: CanvasRenderingContext2D, shapes: ShapeEntity[], center: Point, action: 'flipHorizontally' | 'flipVertically' | 'rotateClockwise' | 'rotateCounterclockwise') => void;
|
|
21
23
|
};
|
|
22
|
-
declare const ContextMenu: ({ moveShapes, selectAllShapes, selectionMode, transformShape, settings, canvasRef, closeContextMenu, toggleShapeVisibility, toggleShapeLock, removeShape, duplicateShapes, copiedShape, setCopiedShape, pasteShapes, removeShapePoint }: ContextMenuType) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare const ContextMenu: ({ moveShapes, selectAllShapes, selectionMode, transformShape, settings, canvasRef, closeContextMenu, toggleShapeVisibility, toggleShapeLock, removeShape, duplicateShapes, copiedShape, setCopiedShape, pasteShapes, removeShapePoint, buildShapesGroup, copyShapes }: ContextMenuType) => import("react/jsx-runtime").JSX.Element;
|
|
23
25
|
export default ContextMenu;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CustomTool, ToolsType } from './../../../common/types/tools';
|
|
2
2
|
import './Toolbar.css';
|
|
3
|
-
import type { UtilsSettings } from './../../../
|
|
3
|
+
import type { UtilsSettings } from './../../../common/types/Settings';
|
|
4
4
|
type ToolboxType = {
|
|
5
5
|
width: number;
|
|
6
6
|
activeTool: ToolsType;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
type UseMenuProps = {
|
|
2
2
|
trigger?: 'click' | 'hover';
|
|
3
3
|
buttonElt: HTMLElement | null;
|
|
4
|
+
disabled?: boolean;
|
|
4
5
|
};
|
|
5
|
-
declare const useMenu: ({ trigger, buttonElt }: UseMenuProps) => {
|
|
6
|
+
declare const useMenu: ({ trigger, disabled, buttonElt }: UseMenuProps) => {
|
|
6
7
|
isOpen: boolean;
|
|
7
8
|
trigger: "click" | "hover";
|
|
8
9
|
closeMenu: () => void;
|
package/dist/editor/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EditorProps as CanvasEditorProps } from './../canvas/hooks/useReactPaint';
|
|
2
2
|
import { type CSSProperties, type ReactNode } from 'react';
|
|
3
3
|
import './index.css';
|
|
4
4
|
type EditorProps = {
|
|
5
|
-
editorProps:
|
|
5
|
+
editorProps: CanvasEditorProps;
|
|
6
6
|
className?: string;
|
|
7
7
|
style?: CSSProperties;
|
|
8
8
|
children: ReactNode;
|
|
@@ -22,3 +22,4 @@ type EditorProps = {
|
|
|
22
22
|
};
|
|
23
23
|
declare const Editor: ({ editorProps, className, style, options, children }: EditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
export default Editor;
|
|
25
|
+
export { DEFAULT_SHAPE_TOOLS } from './../editor/constants/tools';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"../_chunks/editor-CNTO8aYs.js";export{e as DEFAULT_SHAPE_TOOLS,t as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ShapeType } from './../../common/types/Shapes';
|
|
2
|
-
export declare const getShapePicture: (shape: ShapeType) => "<svg><path d=\"M5.146 17.5Q4.146 17.5 3.208 17Q2.271 16.5 1.667 15.708Q2.208 15.75 2.802 15.344Q3.396 14.938 3.396 14.104Q3.396 13.042 4.135 12.292Q4.875 11.542 5.958 11.542Q7.021 11.542 7.76 12.292Q8.5 13.042 8.5 14.104Q8.5 15.5 7.51 16.5Q6.521 17.5 5.146 17.5ZM9.917 12.5 7.562 10.146 14.917 2.729Q15.146 2.5 15.469 2.5Q15.792 2.5 16.021 2.729L17.271 3.958Q17.5 4.188 17.5 4.531Q17.5 4.875 17.271 5.125Z\"/></svg>" | "<svg><path d=\"M2.5 17.5V2.5H17.5V17.5ZM4.25 15.75H15.75V4.25H4.25ZM4.25 15.75V4.25V15.75Z\"/></svg>" | "<svg><path d=\"M10 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.333ZM10 16.583Q12.75 16.583 14.667 14.667Q16.583 12.75 16.583 10Q16.583 7.25 14.667 5.333Q12.75 3.417 10 3.417Q7.25 3.417 5.333 5.333Q3.417 7.25 3.417 10Q3.417 12.75 5.333 14.667Q7.25 16.583 10 16.583ZM10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Z\"/></svg>" | "<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>" | "<svg><path d=\"M4.792 15.083 8.333 11.542 9.833 13.021 11.667 10.708 15.167 15.083ZM6.667 8.417Q5.938 8.417 5.427 7.906Q4.917 7.396 4.917 6.667Q4.917 5.938 5.427 5.427Q5.938 4.917 6.667 4.917Q7.396 4.917 7.906 5.427Q8.417 5.938 8.417 6.667Q8.417 7.396 7.906 7.906Q7.396 8.417 6.667 8.417ZM4.167 18.333Q3.125 18.333 2.396 17.604Q1.667 16.875 1.667 15.833V4.167Q1.667 3.125 2.396 2.396Q3.125 1.667 4.167 1.667H15.833Q16.875 1.667 17.604 2.396Q18.333 3.125 18.333 4.167V15.833Q18.333 16.875 17.604 17.604Q16.875 18.333 15.833 18.333ZM4.167 16.583H15.833Q16.146 16.583 16.365 16.365Q16.583 16.146 16.583 15.833V4.167Q16.583 3.854 16.365 3.635Q16.146 3.417 15.833 3.417H4.167Q3.854 3.417 3.635 3.635Q3.417 3.854 3.417 4.167V15.833Q3.417 16.146 3.635 16.365Q3.854 16.583 4.167 16.583Z\"/></svg>" | "<svg><path d=\"M8.708 16.667V5.917H4.167V3.333H15.833V5.917H11.292V16.667Z\"/></svg>" | "<svg><path d=\"M7.5 15.833V14.083H12.833L3.333 4.583L4.583 3.333L14.083 12.833V7.5H15.833V15.833Z\"/></svg>" | "<svg><path d=\"M7.521 17.5Q6.125 17.5 5.146 16.51Q4.167 15.521 4.167 14.125V7.417Q3.438 7.125 2.969 6.49Q2.5 5.854 2.5 5.042Q2.5 3.979 3.24 3.24Q3.979 2.5 5.042 2.5Q6.104 2.5 6.844 3.24Q7.583 3.979 7.583 5.042Q7.583 5.854 7.115 6.49Q6.646 7.125 5.917 7.417V14.125Q5.917 14.792 6.385 15.271Q6.854 15.75 7.521 15.75Q8.188 15.75 8.656 15.271Q9.125 14.792 9.125 14.125V5.875Q9.125 4.479 10.104 3.49Q11.083 2.5 12.479 2.5Q13.875 2.5 14.854 3.49Q15.833 4.479 15.833 5.875V12.583Q16.562 12.875 17.031 13.51Q17.5 14.146 17.5 14.958Q17.5 16.021 16.76 16.76Q16.021 17.5 14.958 17.5Q13.896 17.5 13.156 16.76Q12.417 16.021 12.417 14.958Q12.417 14.146 12.885 13.5Q13.354 12.854 14.083 12.583V5.875Q14.083 5.208 13.615 4.729Q13.146 4.25 12.479 4.25Q11.812 4.25 11.344 4.729Q10.875 5.208 10.875 5.875V14.125Q10.875 15.521 9.896 16.51Q8.917 17.5 7.521 17.5Z\"/></svg>" | "<svg><path d=\"M3.333 17.5V16.667H7.5V17.5ZM3.333 14.167V13.333H9.167V14.167ZM3.333 10.833V10H10.833V10.833ZM3.333 7.5V6.667H12.5V7.5ZM3.333 4.167V3.333H13.333V4.167ZM3.333 0.833V0H16.667V0.833Z\"/></svg>"
|
|
2
|
+
export declare const getShapePicture: (shape: ShapeType) => "" | "<svg><path d=\"M5.146 17.5Q4.146 17.5 3.208 17Q2.271 16.5 1.667 15.708Q2.208 15.75 2.802 15.344Q3.396 14.938 3.396 14.104Q3.396 13.042 4.135 12.292Q4.875 11.542 5.958 11.542Q7.021 11.542 7.76 12.292Q8.5 13.042 8.5 14.104Q8.5 15.5 7.51 16.5Q6.521 17.5 5.146 17.5ZM9.917 12.5 7.562 10.146 14.917 2.729Q15.146 2.5 15.469 2.5Q15.792 2.5 16.021 2.729L17.271 3.958Q17.5 4.188 17.5 4.531Q17.5 4.875 17.271 5.125Z\"/></svg>" | "<svg><path d=\"M2.5 17.5V2.5H17.5V17.5ZM4.25 15.75H15.75V4.25H4.25ZM4.25 15.75V4.25V15.75Z\"/></svg>" | "<svg><path d=\"M10 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.333ZM10 16.583Q12.75 16.583 14.667 14.667Q16.583 12.75 16.583 10Q16.583 7.25 14.667 5.333Q12.75 3.417 10 3.417Q7.25 3.417 5.333 5.333Q3.417 7.25 3.417 10Q3.417 12.75 5.333 14.667Q7.25 16.583 10 16.583ZM10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Q10 10 10 10Z\"/></svg>" | "<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>" | "<svg><path d=\"M4.792 15.083 8.333 11.542 9.833 13.021 11.667 10.708 15.167 15.083ZM6.667 8.417Q5.938 8.417 5.427 7.906Q4.917 7.396 4.917 6.667Q4.917 5.938 5.427 5.427Q5.938 4.917 6.667 4.917Q7.396 4.917 7.906 5.427Q8.417 5.938 8.417 6.667Q8.417 7.396 7.906 7.906Q7.396 8.417 6.667 8.417ZM4.167 18.333Q3.125 18.333 2.396 17.604Q1.667 16.875 1.667 15.833V4.167Q1.667 3.125 2.396 2.396Q3.125 1.667 4.167 1.667H15.833Q16.875 1.667 17.604 2.396Q18.333 3.125 18.333 4.167V15.833Q18.333 16.875 17.604 17.604Q16.875 18.333 15.833 18.333ZM4.167 16.583H15.833Q16.146 16.583 16.365 16.365Q16.583 16.146 16.583 15.833V4.167Q16.583 3.854 16.365 3.635Q16.146 3.417 15.833 3.417H4.167Q3.854 3.417 3.635 3.635Q3.417 3.854 3.417 4.167V15.833Q3.417 16.146 3.635 16.365Q3.854 16.583 4.167 16.583Z\"/></svg>" | "<svg><path d=\"M8.708 16.667V5.917H4.167V3.333H15.833V5.917H11.292V16.667Z\"/></svg>" | "<svg><path d=\"M7.5 15.833V14.083H12.833L3.333 4.583L4.583 3.333L14.083 12.833V7.5H15.833V15.833Z\"/></svg>" | "<svg><path d=\"M7.521 17.5Q6.125 17.5 5.146 16.51Q4.167 15.521 4.167 14.125V7.417Q3.438 7.125 2.969 6.49Q2.5 5.854 2.5 5.042Q2.5 3.979 3.24 3.24Q3.979 2.5 5.042 2.5Q6.104 2.5 6.844 3.24Q7.583 3.979 7.583 5.042Q7.583 5.854 7.115 6.49Q6.646 7.125 5.917 7.417V14.125Q5.917 14.792 6.385 15.271Q6.854 15.75 7.521 15.75Q8.188 15.75 8.656 15.271Q9.125 14.792 9.125 14.125V5.875Q9.125 4.479 10.104 3.49Q11.083 2.5 12.479 2.5Q13.875 2.5 14.854 3.49Q15.833 4.479 15.833 5.875V12.583Q16.562 12.875 17.031 13.51Q17.5 14.146 17.5 14.958Q17.5 16.021 16.76 16.76Q16.021 17.5 14.958 17.5Q13.896 17.5 13.156 16.76Q12.417 16.021 12.417 14.958Q12.417 14.146 12.885 13.5Q13.354 12.854 14.083 12.583V5.875Q14.083 5.208 13.615 4.729Q13.146 4.25 12.479 4.25Q11.812 4.25 11.344 4.729Q10.875 5.208 10.875 5.875V14.125Q10.875 15.521 9.896 16.51Q8.917 17.5 7.521 17.5Z\"/></svg>" | "<svg><path d=\"M3.333 17.5V16.667H7.5V17.5ZM3.333 14.167V13.333H9.167V14.167ZM3.333 10.833V10H10.833V10.833ZM3.333 7.5V6.667H12.5V7.5ZM3.333 4.167V3.333H13.333V4.167ZM3.333 0.833V0H16.667V0.833Z\"/></svg>";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type { OptionalOptions } from './canvas/
|
|
2
|
-
import useReactPaint from './canvas/
|
|
3
|
-
import Canvas from './canvas/index';
|
|
4
|
-
import type { ExportedDrawableShape, StateData } from './common/types/Shapes';
|
|
1
|
+
import type { DrawableShape, OptionalOptions, StateData } from './canvas/index';
|
|
2
|
+
import Canvas, { useReactPaint as useCanvasReactPaint } from './canvas/index';
|
|
5
3
|
import Editor from './editor/index';
|
|
6
|
-
|
|
7
|
-
export {
|
|
4
|
+
declare const useReactPaint: ({ options, ...rest }?: Parameters<typeof useCanvasReactPaint>[0]) => import("./canvas/hooks/useReactPaint").UseReactPaintReturnType;
|
|
5
|
+
export { Canvas, type DrawableShape, Editor, type OptionalOptions, type StateData, useReactPaint };
|
package/dist/react-paint.css
CHANGED
|
@@ -1 +1,2 @@
|
|
|
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);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:focus:not(:focus-visible){outline:none}.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);-webkit-user-select:none;user-select:none;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=right]{top:0;left:100%}.react-paint-editor-panel[data-position=left]{top:0;right: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-rangefield [data-indeterminate="1"]{opacity:.25}.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-menu{flex-direction:column;display:flex}.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%}.react-paint-editor-toolbox-contextmenu{transform:var(--react-paint-editor-toolbox-contextmenu-transform);width:160px;top:0;left:0}.react-paint-editor-toolbox-contextmenu-group{flex-direction:column;display:flex;position:relative}
|
|
2
|
+
/*$vite$:1*/
|