@yorab/react-paint 0.15.0 → 0.15.1
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/canvas/components/Canvas.d.ts +1 -0
- package/dist/canvas/hooks/useDrawableCanvas.d.ts +2 -1
- package/dist/canvas/hooks/useReactPaint.d.ts +2 -0
- package/dist/canvas/hooks/useShapes.d.ts +1 -0
- package/dist/common/types/Mode.d.ts +1 -0
- package/dist/editor/components/settings/RangeField.d.ts +2 -1
- package/dist/editor/components/settings/SettingsBar.d.ts +2 -1
- package/dist/react-paint.js +1296 -1288
- package/dist/react-paint.umd.cjs +1 -1
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ type DrawerType = {
|
|
|
11
11
|
settings: UtilsSettings;
|
|
12
12
|
isEditMode: boolean;
|
|
13
13
|
shapes: ShapeEntity[];
|
|
14
|
+
duplicateShapes: (shapesToDuplicate: ShapeEntity[]) => void;
|
|
14
15
|
saveShapes: () => void;
|
|
15
16
|
addShapes: (newShape: ShapeEntity[]) => void;
|
|
16
17
|
updateSingleShape: (updatedShape: ShapeEntity[], withSave?: boolean) => void;
|
|
@@ -14,6 +14,7 @@ type UseCanvasType = {
|
|
|
14
14
|
setActiveTool: React.Dispatch<React.SetStateAction<ToolsType>>;
|
|
15
15
|
refreshHoveredShape: (e: MouseEvent | TouchEvent, ctx: CanvasRenderingContext2D, cursorPosition: Point, isInsideMask: boolean) => void;
|
|
16
16
|
refreshSelectedShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point, settings: UtilsSettings) => void;
|
|
17
|
+
duplicateShapes: (shapesToDuplicate: ShapeEntity[]) => void;
|
|
17
18
|
canvasOffsetStartData: {
|
|
18
19
|
start: Point;
|
|
19
20
|
originalOffset: Point;
|
|
@@ -38,7 +39,7 @@ type UseCanvasType = {
|
|
|
38
39
|
settings: UtilsSettings;
|
|
39
40
|
isSpacePressed: boolean;
|
|
40
41
|
};
|
|
41
|
-
declare const useDrawableCanvas: ({ addShapes, drawCanvasRef, setActiveTool, refreshHoveredShape, shapes, selectionMode, activeTool, isInsideComponent, setCanvasOffset, selectedShape, canvasOffsetStartData, refreshSelectedShapes, setSelectedShape, setSelectionFrame, setCanvasOffsetStartData, updateSingleShape, saveShapes, setSelectionMode, setCanvasMoveAcceleration, settings, isShiftPressed, isAltPressed, withFrameSelection, isSpacePressed }: UseCanvasType) => {
|
|
42
|
+
declare const useDrawableCanvas: ({ addShapes, drawCanvasRef, setActiveTool, refreshHoveredShape, shapes, selectionMode, activeTool, isInsideComponent, setCanvasOffset, selectedShape, canvasOffsetStartData, refreshSelectedShapes, setSelectedShape, setSelectionFrame, setCanvasOffsetStartData, updateSingleShape, duplicateShapes, saveShapes, setSelectionMode, setCanvasMoveAcceleration, settings, isShiftPressed, isAltPressed, withFrameSelection, isSpacePressed }: UseCanvasType) => {
|
|
42
43
|
hoverMode: HoverModeData;
|
|
43
44
|
};
|
|
44
45
|
export default useDrawableCanvas;
|
|
@@ -493,6 +493,7 @@ declare const useReactPaint: ({ width, height, shapes: defaultShapes, mode, disa
|
|
|
493
493
|
path?: Path2D | undefined;
|
|
494
494
|
type: "group";
|
|
495
495
|
}) | undefined;
|
|
496
|
+
saveShapes: () => void;
|
|
496
497
|
removeShape: (shapes: ShapeEntity[]) => void;
|
|
497
498
|
updateShape: (updatedShapes: ShapeEntity[], withSave?: boolean) => void;
|
|
498
499
|
backwardShape: () => void;
|
|
@@ -1922,6 +1923,7 @@ declare const useReactPaint: ({ width, height, shapes: defaultShapes, mode, disa
|
|
|
1922
1923
|
refreshHoveredShape: (e: MouseEvent | TouchEvent, ctx: CanvasRenderingContext2D, cursorPosition: Point, isInsideMask: boolean) => void;
|
|
1923
1924
|
removeShape: (shapes: ShapeEntity[]) => void;
|
|
1924
1925
|
updateShape: (updatedShapes: ShapeEntity[], withSave?: boolean) => void;
|
|
1926
|
+
duplicateShapes: (shapesToDuplicate: ShapeEntity[]) => void;
|
|
1925
1927
|
backwardShape: () => void;
|
|
1926
1928
|
forwardShape: () => void;
|
|
1927
1929
|
saveShapes: () => void;
|
|
@@ -703,6 +703,7 @@ declare const useShapes: (settings: UtilsSettings, width: number, height: number
|
|
|
703
703
|
} | undefined>>;
|
|
704
704
|
refreshSelectedShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point) => void;
|
|
705
705
|
addShapes: (newShapes: ShapeEntity[]) => void;
|
|
706
|
+
duplicateShapes: (shapesToDuplicate: ShapeEntity[]) => void;
|
|
706
707
|
addPictureShape: (fileOrUrl: File | string, maxWidth?: number, maxHeight?: number) => Promise<ShapeEntity<"picture">>;
|
|
707
708
|
moveShapes: (startPositionShapeId: string, endPositionShapeId: string) => void;
|
|
708
709
|
saveShapes: () => void;
|
|
@@ -31,6 +31,7 @@ export type SelectionModeTranslate = {
|
|
|
31
31
|
mode: 'translate';
|
|
32
32
|
cursorStartPosition: Point;
|
|
33
33
|
originalShape: SelectionType;
|
|
34
|
+
hasBeenDuplicated: boolean;
|
|
34
35
|
dateStart: number;
|
|
35
36
|
};
|
|
36
37
|
export type SelectionModeData<AnchorType extends Point | number> = SelectionModeDefault | SelectionModeSelectionFrame | SelectionModeBrush | SelectionModeResize<AnchorType> | SelectionModeRotate | SelectionModeTranslate | SelectionModeEditText | SelectionModePreview;
|
|
@@ -12,7 +12,8 @@ type ShapeStyleColorType = {
|
|
|
12
12
|
step?: number;
|
|
13
13
|
unity?: string;
|
|
14
14
|
value?: number | undefined;
|
|
15
|
+
saveShapes: () => void;
|
|
15
16
|
valueChanged: (field: string, value: string | number, needHistorySave?: boolean) => void;
|
|
16
17
|
};
|
|
17
|
-
declare const RangeField: ({ selectedSettings, setSelectedSettings, title, icon, disabled, field, value, min, max, step, unity, valueChanged }: ShapeStyleColorType) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
declare const RangeField: ({ selectedSettings, setSelectedSettings, title, icon, disabled, field, value, min, max, step, unity, valueChanged, saveShapes }: ShapeStyleColorType) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
19
|
export default RangeField;
|
|
@@ -18,6 +18,7 @@ type SettingsBarType = {
|
|
|
18
18
|
isZoomPanelShown: boolean;
|
|
19
19
|
setIsZoomPanelShown: React.Dispatch<React.SetStateAction<boolean>>;
|
|
20
20
|
setCanvasZoom: (action: 'unzoom' | 'zoom' | 'default') => void;
|
|
21
|
+
saveShapes: () => void;
|
|
21
22
|
};
|
|
22
|
-
declare const SettingsBar: ({ width, availableTools, updateToolSettings, layersManipulation, toggleLayoutPanel, activeTool, selectedShape, canvas, settings, updateShape, removeShape, isZoomPanelShown, setIsZoomPanelShown }: SettingsBarType) => import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
23
24
|
export default SettingsBar;
|