@yorab/react-paint 0.2.2 → 0.3.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/Changelog.md +24 -0
- package/LICENSE.txt +21 -0
- package/README.md +6 -89
- package/dist/components/App.js +125 -102
- package/dist/components/Canvas.js +17 -14
- package/dist/components/settings/LayoutButton.js +3 -3
- package/dist/components/settings/Layouts.js +6 -19
- package/dist/components/settings/SettingsBar.js +3 -3
- package/dist/components/toolbox/EditTextBox.js +3 -2
- package/dist/components/toolbox/MenuGroup.js +1 -0
- package/dist/components/toolbox/PictureUrlInput.js +8 -7
- package/dist/hooks/useDrawableCanvas.js +19 -17
- package/dist/hooks/useResizeObserver.js +40 -0
- package/dist/hooks/useShapes.js +12 -8
- package/dist/styles.css +16 -17
- package/dist/utils/data.js +71 -19
- package/dist/utils/draw.js +53 -44
- package/dist/utils/file.js +26 -60
- package/dist/utils/intersect.js +18 -14
- package/dist/utils/selection.js +3 -3
- package/dist/utils/transform.js +18 -2
- package/package.json +6 -7
- package/dist/components/App.d.ts +0 -20
- package/dist/components/Canvas.d.ts +0 -28
- package/dist/components/common/Button.d.ts +0 -14
- package/dist/components/common/Loading.d.ts +0 -6
- package/dist/components/common/Modal.d.ts +0 -8
- package/dist/components/common/Panel.d.ts +0 -10
- package/dist/components/common/Snackbar.d.ts +0 -7
- package/dist/components/settings/ColorField.d.ts +0 -12
- package/dist/components/settings/DeleteButton.d.ts +0 -9
- package/dist/components/settings/FontFamilyField.d.ts +0 -10
- package/dist/components/settings/LayoutButton.d.ts +0 -8
- package/dist/components/settings/Layouts.d.ts +0 -18
- package/dist/components/settings/LineArrowField.d.ts +0 -10
- package/dist/components/settings/LineTypeField.d.ts +0 -14
- package/dist/components/settings/PointsNumberField.d.ts +0 -11
- package/dist/components/settings/RangeField.d.ts +0 -16
- package/dist/components/settings/SelectField.d.ts +0 -16
- package/dist/components/settings/SettingsBar.d.ts +0 -16
- package/dist/components/toolbox/EditTextBox.d.ts +0 -10
- package/dist/components/toolbox/LoadFileTool.d.ts +0 -11
- package/dist/components/toolbox/MenuGroup.d.ts +0 -23
- package/dist/components/toolbox/PictureUrlInput.d.ts +0 -7
- package/dist/components/toolbox/Tool.d.ts +0 -13
- package/dist/components/toolbox/Toolbar.d.ts +0 -20
- package/dist/components/toolbox/ToolbarGroup.d.ts +0 -18
- package/dist/constants/draw.d.ts +0 -2
- package/dist/constants/draw.js +0 -10
- package/dist/constants/icons.d.ts +0 -36
- package/dist/constants/shapes.d.ts +0 -5
- package/dist/constants/snackbar.d.ts +0 -11
- package/dist/constants/style.d.ts +0 -12
- package/dist/hooks/useComponent.d.ts +0 -9
- package/dist/hooks/useDrag.d.ts +0 -15
- package/dist/hooks/useDrawableCanvas.d.ts +0 -30
- package/dist/hooks/useKeyboard.d.ts +0 -15
- package/dist/hooks/useShapes.d.ts +0 -22
- package/dist/hooks/useSnackbar.d.ts +0 -16
- package/dist/schemas/drawableShape.json +0 -1021
- package/dist/types/Mode.d.ts +0 -51
- package/dist/types/Shapes.d.ts +0 -122
- package/dist/types/keyboard.d.ts +0 -15
- package/dist/utils/data.d.ts +0 -4
- package/dist/utils/draw.d.ts +0 -18
- package/dist/utils/file.d.ts +0 -33
- package/dist/utils/intersect.d.ts +0 -8
- package/dist/utils/selection.d.ts +0 -7
- package/dist/utils/shapeData.d.ts +0 -5
- package/dist/utils/string.d.ts +0 -3
- package/dist/utils/style.d.ts +0 -2
- package/dist/utils/toolbar.d.ts +0 -12
- package/dist/utils/transform.d.ts +0 -271
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DrawableShape } from 'types/Shapes';
|
|
3
|
-
declare type UseKeyboardType = {
|
|
4
|
-
isInsideComponent: boolean;
|
|
5
|
-
selectedShape: DrawableShape | undefined;
|
|
6
|
-
pasteShape: (shape: DrawableShape) => void;
|
|
7
|
-
updateShape: (shape: DrawableShape) => void;
|
|
8
|
-
setSelectedShape: (value: React.SetStateAction<DrawableShape | undefined>) => void;
|
|
9
|
-
removeShape: (shape: DrawableShape) => void;
|
|
10
|
-
backwardShape: () => void;
|
|
11
|
-
forwardShape: () => void;
|
|
12
|
-
isEditingText: boolean;
|
|
13
|
-
};
|
|
14
|
-
declare const useKeyboard: ({ isInsideComponent, selectedShape, isEditingText, setSelectedShape, removeShape, pasteShape, updateShape, backwardShape, forwardShape }: UseKeyboardType) => {};
|
|
15
|
-
export default useKeyboard;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DrawableShape } from 'types/Shapes';
|
|
3
|
-
declare const useShapes: (onDataChanged?: () => void) => {
|
|
4
|
-
shapesRef: import("react").MutableRefObject<DrawableShape[]>;
|
|
5
|
-
selectedShape: DrawableShape | undefined;
|
|
6
|
-
addShape: (newShape: DrawableShape) => void;
|
|
7
|
-
addPictureShape: (fileOrUrl: File | string, maxSize?: number) => Promise<import("types/Shapes").DrawablePicture>;
|
|
8
|
-
moveShapes: (firstShapeId: string, lastShapeId: string) => void;
|
|
9
|
-
saveShapes: () => void;
|
|
10
|
-
setSelectedShape: import("react").Dispatch<import("react").SetStateAction<DrawableShape | undefined>>;
|
|
11
|
-
toggleShapeVisibility: (shape: DrawableShape) => void;
|
|
12
|
-
toggleShapeLock: (shape: DrawableShape) => void;
|
|
13
|
-
removeShape: (shape: DrawableShape) => void;
|
|
14
|
-
updateShape: (updatedShape: DrawableShape, withSave?: boolean) => void;
|
|
15
|
-
backwardShape: () => void;
|
|
16
|
-
forwardShape: () => void;
|
|
17
|
-
clearShapes: (shapesToInit?: DrawableShape[], clearHistory?: boolean) => void;
|
|
18
|
-
canGoBackward: boolean;
|
|
19
|
-
canGoForward: boolean;
|
|
20
|
-
canClear: boolean;
|
|
21
|
-
};
|
|
22
|
-
export default useShapes;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SnackbarTypeEnum } from 'constants/snackbar';
|
|
2
|
-
export declare type SnackBarType = {
|
|
3
|
-
id: string;
|
|
4
|
-
type: SnackbarTypeEnum;
|
|
5
|
-
text: string;
|
|
6
|
-
duration: number;
|
|
7
|
-
};
|
|
8
|
-
declare const useSnackbar: () => {
|
|
9
|
-
snackbarList: SnackBarType[];
|
|
10
|
-
addSnackbar: ({ type, duration, text }: {
|
|
11
|
-
type?: SnackbarTypeEnum | undefined;
|
|
12
|
-
duration?: number | undefined;
|
|
13
|
-
text: string;
|
|
14
|
-
}) => void;
|
|
15
|
-
};
|
|
16
|
-
export default useSnackbar;
|