@yorab/react-paint 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +173 -1
- package/dist/{components → canvas/components}/Canvas.d.ts +7 -9
- package/dist/{components/toolbox → canvas/components}/EditTextBox.d.ts +4 -4
- package/dist/canvas/constants/app.d.ts +44 -0
- package/dist/canvas/constants/grid.d.ts +1 -0
- package/dist/{constants → canvas/constants}/shapes.d.ts +1 -1
- package/dist/{hooks → canvas/hooks}/useComponent.d.ts +1 -1
- package/dist/{hooks → canvas/hooks}/useDrawableCanvas.d.ts +9 -16
- package/dist/{hooks → canvas/hooks}/useKeyboard.d.ts +4 -6
- package/dist/canvas/hooks/useReactPaint.d.ts +131 -0
- package/dist/{hooks → canvas/hooks}/useShapes.d.ts +7 -8
- package/dist/canvas/index.d.ts +13 -0
- package/dist/{utils → canvas/utils}/canvas.d.ts +3 -2
- package/dist/canvas/utils/data.d.ts +5 -0
- package/dist/{utils → canvas/utils}/file.d.ts +4 -3
- package/dist/canvas/utils/grid.d.ts +2 -0
- package/dist/{utils → canvas/utils}/intersect.d.ts +7 -6
- package/dist/{utils → canvas/utils}/selection/lineSelection.d.ts +5 -4
- package/dist/{utils → canvas/utils}/selection/rectSelection.d.ts +6 -6
- package/dist/canvas/utils/selection/selectionFrame.d.ts +3 -0
- package/dist/canvas/utils/selection.d.ts +8 -0
- package/dist/canvas/utils/shapes/brush.d.ts +20 -0
- package/dist/canvas/utils/shapes/circle.d.ts +17 -0
- package/dist/canvas/utils/shapes/curve.d.ts +17 -0
- package/dist/canvas/utils/shapes/ellipse.d.ts +17 -0
- package/dist/canvas/utils/shapes/index.d.ts +32 -0
- package/dist/canvas/utils/shapes/line.d.ts +17 -0
- package/dist/{utils → canvas/utils}/shapes/path.d.ts +3 -2
- package/dist/canvas/utils/shapes/picture.d.ts +12 -0
- package/dist/canvas/utils/shapes/polygon.d.ts +17 -0
- package/dist/canvas/utils/shapes/rectangle.d.ts +20 -0
- package/dist/{utils → canvas/utils}/shapes/text.d.ts +10 -10
- package/dist/{utils → canvas/utils}/shapes/triangle.d.ts +1 -1
- package/dist/{utils → canvas/utils}/string.d.ts +0 -1
- package/dist/canvas/utils/tools.d.ts +3 -0
- package/dist/{utils → canvas/utils}/transform.d.ts +6 -6
- package/dist/{utils → canvas/utils}/trigo.d.ts +4 -4
- package/dist/{types → common/types}/Shapes.d.ts +4 -6
- package/dist/common/utils/array.d.ts +1 -0
- package/dist/editor/components/common/Loading.d.ts +6 -0
- package/dist/{components → editor/components}/common/Modal.d.ts +2 -2
- package/dist/{components → editor/components}/common/Panel.d.ts +2 -2
- package/dist/{components → editor/components}/common/Snackbar.d.ts +2 -3
- package/dist/{components → editor/components}/settings/ColorField.d.ts +2 -2
- package/dist/{components → editor/components}/settings/DeleteButton.d.ts +2 -3
- package/dist/{components → editor/components}/settings/FontFamilyField.d.ts +2 -2
- package/dist/{components → editor/components}/settings/LayoutButton.d.ts +1 -2
- package/dist/{components → editor/components}/settings/Layouts.d.ts +5 -6
- package/dist/{components → editor/components}/settings/LineArrowField.d.ts +2 -2
- package/dist/{components → editor/components}/settings/LineTypeField.d.ts +3 -3
- package/dist/{components → editor/components}/settings/PointsNumberField.d.ts +2 -2
- package/dist/{components → editor/components}/settings/RangeField.d.ts +2 -2
- package/dist/{components → editor/components}/settings/SelectField.d.ts +2 -2
- package/dist/{components → editor/components}/settings/SettingsBar.d.ts +5 -6
- package/dist/{components → editor/components}/settings/ToggleField.d.ts +2 -2
- package/dist/{components → editor/components}/toolbox/LoadFileTool.d.ts +2 -3
- package/dist/{components → editor/components}/toolbox/MenuGroup.d.ts +3 -4
- package/dist/{components → editor/components}/toolbox/PictureUrlInput.d.ts +1 -2
- package/dist/{components → editor/components}/toolbox/Tool.d.ts +2 -3
- package/dist/{components → editor/components}/toolbox/Toolbar.d.ts +3 -4
- package/dist/{components → editor/components}/toolbox/ToolbarGroup.d.ts +2 -3
- package/dist/editor/constants/grid.d.ts +7 -0
- package/dist/editor/constants/options.d.ts +13 -0
- package/dist/{constants → editor/constants}/snackbar.d.ts +1 -1
- package/dist/{constants → editor/constants}/style.d.ts +0 -3
- package/dist/{constants → editor/constants}/tools.d.ts +1 -1
- package/dist/{hooks → editor/hooks}/useDrag.d.ts +2 -2
- package/dist/{hooks → editor/hooks}/useSnackbar.d.ts +3 -3
- package/dist/editor/index.d.ts +24 -0
- package/dist/{utils → editor/utils}/style.d.ts +1 -1
- package/dist/editor/utils/toolbar.d.ts +11 -0
- package/dist/index.d.ts +6 -0
- package/dist/react-paint.css +1 -1
- package/dist/react-paint.js +1087 -1053
- package/dist/react-paint.umd.cjs +1 -1
- package/package.json +61 -56
- package/dist/components/App.d.ts +0 -20
- package/dist/components/common/Loading.d.ts +0 -7
- package/dist/constants/app.d.ts +0 -45
- package/dist/utils/array.d.ts +0 -1
- package/dist/utils/data.d.ts +0 -4
- package/dist/utils/grid.d.ts +0 -3
- package/dist/utils/selection/selectionFrame.d.ts +0 -2
- package/dist/utils/selection.d.ts +0 -7
- package/dist/utils/shapes/brush.d.ts +0 -20
- package/dist/utils/shapes/circle.d.ts +0 -17
- package/dist/utils/shapes/curve.d.ts +0 -17
- package/dist/utils/shapes/ellipse.d.ts +0 -17
- package/dist/utils/shapes/index.d.ts +0 -35
- package/dist/utils/shapes/line.d.ts +0 -17
- package/dist/utils/shapes/picture.d.ts +0 -12
- package/dist/utils/shapes/polygon.d.ts +0 -17
- package/dist/utils/shapes/rectangle.d.ts +0 -20
- package/dist/utils/toolbar.d.ts +0 -13
- /package/dist/{constants → canvas/constants}/picture.d.ts +0 -0
- /package/dist/{hooks → canvas/hooks}/useDoubleClick.d.ts +0 -0
- /package/dist/{hooks → canvas/hooks}/useResizeObserver.d.ts +0 -0
- /package/dist/{types → common/types}/Mode.d.ts +0 -0
- /package/dist/{types → common/types}/react.d.ts +0 -0
- /package/dist/{types → common/types}/tools.d.ts +0 -0
- /package/dist/{types → common/types}/utils.d.ts +0 -0
- /package/dist/{utils → common/utils}/dom.d.ts +0 -0
- /package/dist/{utils → common/utils}/object.d.ts +0 -0
- /package/dist/{utils → common/utils}/util.d.ts +0 -0
- /package/dist/{components → editor/components}/common/Button.d.ts +0 -0
- /package/dist/{constants → editor/constants}/icons.d.ts +0 -0
- /package/dist/{constants → editor/constants}/loading.d.ts +0 -0
- /package/dist/{types → editor/types}/snackbar.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1 +1,173 @@
|
|
|
1
|
-
# React Paint V0.
|
|
1
|
+
# React Paint V0.11.0
|
|
2
|
+
|
|
3
|
+
An open-source canvas-based library for React used for image annotation or as a digital whiteboard
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Quick start
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm i @yorab/react-paint
|
|
12
|
+
```
|
|
13
|
+
Note : react-paint needs <a href="https://www.npmjs.com/package/react">react</a> and <a href="https://www.npmjs.com/package/react-dom">react-dom</a> packages to work properly
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### Basic usage
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { Canvas, Editor, useReactPaint } from '@yorab/react-paint'
|
|
21
|
+
|
|
22
|
+
const BasicUsage = () => {
|
|
23
|
+
const { editorProps, canvasProps } = useReactPaint()
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Editor editorProps={editorProps}>
|
|
27
|
+
<Canvas canvasProps={canvasProps} />
|
|
28
|
+
</Editor>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Advanced usage
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { useEffect, useState } from 'react'
|
|
37
|
+
import { Canvas, Editor, useReactPaint, type DrawableShape, type StateData } from '@yorab/react-paint'
|
|
38
|
+
|
|
39
|
+
const SHAPES_INIT = [
|
|
40
|
+
{
|
|
41
|
+
type: 'rect',
|
|
42
|
+
x: 300,
|
|
43
|
+
y: 300,
|
|
44
|
+
width: 100,
|
|
45
|
+
height: 200,
|
|
46
|
+
rotation: 0,
|
|
47
|
+
style: {
|
|
48
|
+
fillColor: '#6a4e01',
|
|
49
|
+
strokeColor: 'transparent',
|
|
50
|
+
opacity: 100,
|
|
51
|
+
lineWidth: 1,
|
|
52
|
+
lineDash: 0,
|
|
53
|
+
lineArrow: 0,
|
|
54
|
+
pointsCount: 3,
|
|
55
|
+
fontFamily: 'serif'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
const AdvancedUsage = () => {
|
|
61
|
+
const [shapes, setShapes] = useState<DrawableShape[] | undefined>(SHAPES_INIT) // keep shapes state for internal use
|
|
62
|
+
|
|
63
|
+
const { editorProps, canvasProps, registerEvent, unregisterEvent } = useReactPaint({
|
|
64
|
+
width: 1920,
|
|
65
|
+
height: 1080,
|
|
66
|
+
shapes,
|
|
67
|
+
options: {
|
|
68
|
+
canGrow: true,
|
|
69
|
+
canShrink: true,
|
|
70
|
+
brushAlgo: 'quadratic',
|
|
71
|
+
clearCallback: 'defaultShapes'
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const editorOptions = {
|
|
76
|
+
fontColor: '#2c1e69',
|
|
77
|
+
fontHoverColor: '#0d0931'
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const canvasOptions = {
|
|
81
|
+
canvasBackgroundColor: '#ffffff'
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
const onDataChanged = (data: StateData) => {
|
|
86
|
+
setShapes(data.shapes)
|
|
87
|
+
}
|
|
88
|
+
registerEvent('dataChanged', onDataChanged)
|
|
89
|
+
|
|
90
|
+
return () => {
|
|
91
|
+
unregisterEvent('dataChanged', onDataChanged)
|
|
92
|
+
}
|
|
93
|
+
}, [registerEvent, unregisterEvent])
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<Editor editorProps={editorProps} options={editorOptions}>
|
|
97
|
+
<Canvas canvasProps={canvasProps} options={canvasOptions} />
|
|
98
|
+
</Editor>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Other usages
|
|
104
|
+
|
|
105
|
+
you will find other usages in <a href="https://github.com/YoRab/react-paint-editor/tree/main/stories">stories</a>
|
|
106
|
+
|
|
107
|
+
### API
|
|
108
|
+
|
|
109
|
+
#### `useReactPaint`
|
|
110
|
+
|
|
111
|
+
##### Parameters
|
|
112
|
+
|
|
113
|
+
| Parameter | Type | Description | Default value |
|
|
114
|
+
| :--- | :--- | :--- | :--- |
|
|
115
|
+
| `width` | `number` | *Optional*. Canvas width in px | `1000` |
|
|
116
|
+
| `height` | `number` | *Optional*. Canvas height in px | `600` |
|
|
117
|
+
| `shapes` | [`DrawableShape[]`](####drawableshape) | *Optional*. Array of shapes used to init the canvas | `undefined` |
|
|
118
|
+
| `mode` | `editor\|viewer` | *Optional*. `editor` lets you interact with the canvas and editor. `viewer` hides the editor and makes the canvas read-only| `editor` |
|
|
119
|
+
| `disabled` | `boolean` | *Optional*. Global parameter used to prevent interaction with every element in the editor or canvas | `false` |
|
|
120
|
+
| `options` | [`OptionalOptions`](####optionaloptions) | *Optional*. Set of options to customize available features | See [`OptionalOptions`]((####optionaloptions)) |
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
##### Returns
|
|
124
|
+
|
|
125
|
+
| Parameter | Type | Description |
|
|
126
|
+
| :--- | :--- | :--- |
|
|
127
|
+
| `canvasProps` | `object` | Set of properties to forward to Canvas component |
|
|
128
|
+
| `editorProps` | `object` | Set of properties to forward to Editor component |
|
|
129
|
+
| `registerEvent` | `(event: "dataChanged", listener: (data: StateData) => void) => void` | registerEvent is used to register a listener for special events triggered by react-paint. The only currently available event is `dataChanged` |
|
|
130
|
+
| `unregisterEvent` | `(event: "dataChanged", listener?: ((data: StateData) => void) \| undefined) => void` | unregisterEvent is used to unregister a listener previously registered. Omitting listener will result in unregistering every listeners for the the given event |
|
|
131
|
+
| `resetCanvas` | `(shapes: DrawableShape[], clearHistory?: boolean) => Promise<void>` | reset canvas with the given shapes. use `[]` or `undefined` to clear the canvas. Set `false` to `clearHistory` to prevent history stack to be cleared |
|
|
132
|
+
| `getCurrentImage` | `() => string \| undefined` | Returns a data URL containing the content of the current canvas as a PNG image, or undefined if an error occured |
|
|
133
|
+
| `getCurrentData` | `() => StateData` | Returns the current state of the canvas |
|
|
134
|
+
|
|
135
|
+
#### Canvas
|
|
136
|
+
|
|
137
|
+
##### Parameters
|
|
138
|
+
|
|
139
|
+
| Parameter | Type | Description | Default value |
|
|
140
|
+
| :--- | :--- | :--- | :--- |
|
|
141
|
+
| `canvasProps` | `object` | **Required**. Set of properties coming from useReactPaint | |
|
|
142
|
+
| `className` | `string` | *Optional*. Classname for canvas parent node | `undefined` |
|
|
143
|
+
| `style` | `CSSProperties` | *Optional*. css properties to inject to canvas parent node | `undefined` |
|
|
144
|
+
| `options` | `{canvasBackgroundColor?: string}` | *Optional*. Set of properties to use to customize canvas style | `{canvasBackgroundColor: 'white'}` |
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
#### Editor
|
|
148
|
+
|
|
149
|
+
##### Parameters
|
|
150
|
+
|
|
151
|
+
| Parameter | Type | Description | Default value |
|
|
152
|
+
| :--- | :--- | :--- | :--- |
|
|
153
|
+
| `editorProps` | `object` | **Required**. Set of properties coming from useReactPaint | |
|
|
154
|
+
| `children` | `ReactNode` | **Required**. Need Canvas component to work properly | |
|
|
155
|
+
| `className` | `string` | *Optional*. Classname for canvas parent node | `undefined` |
|
|
156
|
+
| `style` | `CSSProperties` | *Optional*. css properties to inject to canvas parent node | `undefined` |
|
|
157
|
+
| `options` | `{ toolbarBackgroundColor?: string; dividerColor?: string; fontRadius?: number; fontDisabledColor?: string; fontDisabledBackgroundColor?: string; fontColor?: string; fontBackgroundColor?: string; fontSelectedColor?: string; fontSelectedBackgroundColor?: string; fontHoverColor?: string; fontHoverBackgroundColor?: string; }` | *Optional*. Set of properties to use to customize editor style | ` { toolbarBackgroundColor: 'white', dividerColor: '#36418129', fontRadius: 8, fontDisabledColor: '#3641812b', fontDisabledBackgroundColor: 'transparent', fontColor: '#364181', fontBackgroundColor: 'transparent', fontSelectedColor: 'white', fontSelectedBackgroundColor: '#364181', fontHoverColor: '#364181', fontHoverBackgroundColor: '#afd8d8'}` |
|
|
158
|
+
|
|
159
|
+
### Types
|
|
160
|
+
|
|
161
|
+
#### `DrawableShape`
|
|
162
|
+
#### `StateData`
|
|
163
|
+
#### `OptionalOptions`
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## Changelog
|
|
167
|
+
https://github.com/YoRab/react-paint-editor/blob/main/Changelog.md
|
|
168
|
+
|
|
169
|
+
## License
|
|
170
|
+
<a href="https://github.com/YoRab/react-paint-editor/blob/main/LICENSE.txt">MIT</a>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
## Contributing
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { type UtilsSettings } from './../../canvas/constants/app';
|
|
2
|
+
import type { SelectionModeData } from './../../common/types/Mode';
|
|
3
|
+
import type { Point, ShapeEntity } from './../../common/types/Shapes';
|
|
4
|
+
import type { ToolsType } from './../../common/types/tools';
|
|
1
5
|
import React from 'react';
|
|
2
|
-
import { type GridFormatType } from '../constants/app';
|
|
3
|
-
import type { SelectionModeData } from '../types/Mode';
|
|
4
|
-
import type { Point, ShapeEntity } from '../types/Shapes';
|
|
5
|
-
import type { ToolsType } from '../types/tools';
|
|
6
6
|
import './Canvas.css';
|
|
7
7
|
type DrawerType = {
|
|
8
|
-
gridFormat: GridFormatType;
|
|
9
8
|
disabled?: boolean;
|
|
10
9
|
canGrow?: boolean;
|
|
11
10
|
canvasSize: {
|
|
@@ -15,7 +14,7 @@ type DrawerType = {
|
|
|
15
14
|
};
|
|
16
15
|
selectionColor: string;
|
|
17
16
|
selectionWidth: number;
|
|
18
|
-
|
|
17
|
+
settings: UtilsSettings;
|
|
19
18
|
isEditMode: boolean;
|
|
20
19
|
shapes: ShapeEntity[];
|
|
21
20
|
saveShapes: () => void;
|
|
@@ -26,13 +25,12 @@ type DrawerType = {
|
|
|
26
25
|
setSelectionFrame: React.Dispatch<React.SetStateAction<[Point, Point] | undefined>>;
|
|
27
26
|
hoveredShape: ShapeEntity | undefined;
|
|
28
27
|
selectionFrame: [Point, Point] | undefined;
|
|
29
|
-
refreshHoveredShape: (e: MouseEvent | TouchEvent, ctx: CanvasRenderingContext2D, cursorPosition: Point,
|
|
30
|
-
refreshSelectedShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point,
|
|
28
|
+
refreshHoveredShape: (e: MouseEvent | TouchEvent, ctx: CanvasRenderingContext2D, cursorPosition: Point, settings: UtilsSettings) => void;
|
|
29
|
+
refreshSelectedShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point, settings: UtilsSettings) => void;
|
|
31
30
|
activeTool: ToolsType;
|
|
32
31
|
setActiveTool: React.Dispatch<React.SetStateAction<ToolsType>>;
|
|
33
32
|
canvasOffsetStartPosition: Point | undefined;
|
|
34
33
|
setCanvasOffsetStartPosition: React.Dispatch<React.SetStateAction<Point | undefined>>;
|
|
35
|
-
canvasOffset: Point;
|
|
36
34
|
setCanvasOffset: React.Dispatch<React.SetStateAction<Point>>;
|
|
37
35
|
isInsideComponent: boolean;
|
|
38
36
|
selectionMode: SelectionModeData<number | Point>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { DrawableShape } from '
|
|
1
|
+
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
2
|
+
import type { DrawableShape } from './../../common/types/Shapes';
|
|
3
3
|
import './EditTextBox.css';
|
|
4
4
|
type EditTextBoxType = {
|
|
5
5
|
scaleRatio: number;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
shape: DrawableShape<'text'>;
|
|
8
8
|
defaultValue: string[];
|
|
9
|
-
|
|
9
|
+
settings: UtilsSettings;
|
|
10
10
|
updateValue: (newValue: string[]) => void;
|
|
11
11
|
saveShapes: () => void;
|
|
12
12
|
};
|
|
13
|
-
declare const EditTextBox: ({ disabled, scaleRatio, shape, defaultValue, updateValue, saveShapes,
|
|
13
|
+
declare const EditTextBox: ({ disabled, scaleRatio, shape, defaultValue, updateValue, saveShapes, settings }: EditTextBoxType) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default EditTextBox;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { DrawableShape, Point } from './../../common/types/Shapes';
|
|
2
|
+
import type { CustomToolInput } from './../../common/types/tools';
|
|
3
|
+
import type { RecursivePartial } from './../../common/types/utils';
|
|
4
|
+
export declare const APP_NAME = "react_paint";
|
|
5
|
+
export declare const DRAWCANVAS_CLASSNAME = "react-paint-canvas-drawcanvas";
|
|
6
|
+
export declare const SELECTIONCANVAS_CLASSNAME = "react-paint-canvas-selectioncanvas";
|
|
7
|
+
export type BrushAlgo = 'simple' | 'quadratic';
|
|
8
|
+
export type UtilsSettings = {
|
|
9
|
+
brushAlgo: BrushAlgo;
|
|
10
|
+
gridGap: number;
|
|
11
|
+
canvasOffset: Point;
|
|
12
|
+
canvasSize: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
scaleRatio: number;
|
|
16
|
+
};
|
|
17
|
+
selectionPadding: number;
|
|
18
|
+
};
|
|
19
|
+
type AppOptionsType = {
|
|
20
|
+
layersManipulation: boolean;
|
|
21
|
+
grid: number;
|
|
22
|
+
canGrow: boolean;
|
|
23
|
+
canShrink: boolean;
|
|
24
|
+
availableTools: CustomToolInput[];
|
|
25
|
+
withExport: boolean;
|
|
26
|
+
withLoadAndSave: boolean;
|
|
27
|
+
withUploadPicture: boolean;
|
|
28
|
+
withUrlPicture: boolean;
|
|
29
|
+
withFrameSelection: boolean;
|
|
30
|
+
withSkeleton: boolean;
|
|
31
|
+
clearCallback: 'empty' | 'defaultShapes' | (() => DrawableShape[]);
|
|
32
|
+
brushAlgo: BrushAlgo;
|
|
33
|
+
selection: {
|
|
34
|
+
canvasSelectionColor: string;
|
|
35
|
+
canvasSelectionWidth: number;
|
|
36
|
+
canvasSelectionPadding: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type OptionalOptions = RecursivePartial<AppOptionsType>;
|
|
40
|
+
export declare const DEFAULT_OPTIONS: AppOptionsType;
|
|
41
|
+
export declare const DEFAULT_CANVAS_OPTIONS: {
|
|
42
|
+
canvasBackgroundColor: string;
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GRID_ROTATION_STEPS = 18;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type
|
|
1
|
+
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
2
|
+
import type { HoverModeData, SelectionModeData } from './../../common/types/Mode';
|
|
3
|
+
import type { Point, ShapeEntity } from './../../common/types/Shapes';
|
|
4
|
+
import type { ToolsType } from './../../common/types/tools';
|
|
5
|
+
import type React from 'react';
|
|
6
6
|
type UseCanvasType = {
|
|
7
7
|
disabled?: boolean;
|
|
8
|
-
canvasSize: {
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
scaleRatio: number;
|
|
12
|
-
};
|
|
13
8
|
shapes: ShapeEntity[];
|
|
14
9
|
saveShapes: () => void;
|
|
15
10
|
addShape: (newShape: ShapeEntity) => void;
|
|
@@ -18,12 +13,10 @@ type UseCanvasType = {
|
|
|
18
13
|
setSelectedShape: React.Dispatch<React.SetStateAction<ShapeEntity | undefined>>;
|
|
19
14
|
activeTool: ToolsType;
|
|
20
15
|
setActiveTool: React.Dispatch<React.SetStateAction<ToolsType>>;
|
|
21
|
-
refreshHoveredShape: (e: MouseEvent | TouchEvent, ctx: CanvasRenderingContext2D, cursorPosition: Point,
|
|
22
|
-
refreshSelectedShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point,
|
|
16
|
+
refreshHoveredShape: (e: MouseEvent | TouchEvent, ctx: CanvasRenderingContext2D, cursorPosition: Point, settings: UtilsSettings) => void;
|
|
17
|
+
refreshSelectedShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point, settings: UtilsSettings) => void;
|
|
23
18
|
canvasOffsetStartPosition: Point | undefined;
|
|
24
19
|
setCanvasOffsetStartPosition: React.Dispatch<React.SetStateAction<Point | undefined>>;
|
|
25
|
-
gridFormat: GridFormatType;
|
|
26
|
-
canvasOffset: Point;
|
|
27
20
|
setCanvasOffset: React.Dispatch<React.SetStateAction<Point>>;
|
|
28
21
|
isInsideComponent: boolean;
|
|
29
22
|
selectionMode: SelectionModeData<number | Point>;
|
|
@@ -31,11 +24,11 @@ type UseCanvasType = {
|
|
|
31
24
|
setSelectionFrame: React.Dispatch<React.SetStateAction<[Point, Point] | undefined>>;
|
|
32
25
|
drawCanvasRef: React.MutableRefObject<HTMLCanvasElement | null>;
|
|
33
26
|
selectionCanvasRef: React.MutableRefObject<HTMLCanvasElement | null>;
|
|
34
|
-
selectionPadding: number;
|
|
35
27
|
isShiftPressed: boolean;
|
|
36
28
|
withFrameSelection: boolean;
|
|
29
|
+
settings: UtilsSettings;
|
|
37
30
|
};
|
|
38
|
-
declare const useDrawableCanvas: ({ disabled, addShape,
|
|
31
|
+
declare const useDrawableCanvas: ({ disabled, addShape, drawCanvasRef, setActiveTool, refreshHoveredShape, shapes, selectionMode, activeTool, isInsideComponent, setCanvasOffset, selectedShape, selectionCanvasRef, canvasOffsetStartPosition, refreshSelectedShapes, setSelectedShape, setSelectionFrame, setCanvasOffsetStartPosition, updateSingleShape, saveShapes, setSelectionMode, settings, isShiftPressed, withFrameSelection }: UseCanvasType) => {
|
|
39
32
|
hoverMode: HoverModeData;
|
|
40
33
|
};
|
|
41
34
|
export default useDrawableCanvas;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
3
|
-
import type { ShapeEntity } from '
|
|
2
|
+
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
3
|
+
import type { ShapeEntity } from './../../common/types/Shapes';
|
|
4
4
|
type UseKeyboardType = {
|
|
5
5
|
isInsideComponent: boolean;
|
|
6
6
|
selectedShape: ShapeEntity | undefined;
|
|
@@ -12,9 +12,7 @@ type UseKeyboardType = {
|
|
|
12
12
|
forwardShape: () => void;
|
|
13
13
|
setShiftPressed: (value: React.SetStateAction<boolean>) => void;
|
|
14
14
|
isEditingText: boolean;
|
|
15
|
-
|
|
16
|
-
currentScale: number;
|
|
17
|
-
selectionPadding: number;
|
|
15
|
+
settings: UtilsSettings;
|
|
18
16
|
};
|
|
19
|
-
declare const useKeyboard: ({
|
|
17
|
+
declare const useKeyboard: ({ isInsideComponent, selectedShape, isEditingText, settings, setSelectedShape, removeShape, pasteShape, updateShape, backwardShape, forwardShape, setShiftPressed }: UseKeyboardType) => {};
|
|
20
18
|
export default useKeyboard;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type OptionalOptions, type UtilsSettings } from './../../canvas/constants/app';
|
|
3
|
+
import type { DrawableShape, StateData, Point, ShapeEntity } from './../../common/types/Shapes';
|
|
4
|
+
import type { ToolsType } from './../../common/types/tools';
|
|
5
|
+
type UseReactPaintProps = {
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
shapes?: DrawableShape[];
|
|
9
|
+
mode?: 'editor' | 'viewer';
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
options?: OptionalOptions;
|
|
12
|
+
};
|
|
13
|
+
declare const useReactPaint: ({ width, height, shapes: shapesFromProps, mode, disabled, options }: UseReactPaintProps) => {
|
|
14
|
+
editorProps: {
|
|
15
|
+
shapesRef: import("react").MutableRefObject<ShapeEntity[]>;
|
|
16
|
+
addPictureShape: (fileOrUrl: string | File, maxWidth?: number, maxHeight?: number) => Promise<ShapeEntity<"picture">>;
|
|
17
|
+
moveShapes: (firstShapeId: string, lastShapeId: string) => void;
|
|
18
|
+
toggleShapeVisibility: (shape: ShapeEntity) => void;
|
|
19
|
+
toggleShapeLock: (shape: ShapeEntity) => void;
|
|
20
|
+
canGoBackward: boolean;
|
|
21
|
+
canGoForward: boolean;
|
|
22
|
+
canClear: boolean;
|
|
23
|
+
selectedShape: ShapeEntity | undefined;
|
|
24
|
+
removeShape: (shape: ShapeEntity) => void;
|
|
25
|
+
updateShape: (updatedShape: ShapeEntity, withSave?: boolean) => void;
|
|
26
|
+
backwardShape: () => void;
|
|
27
|
+
forwardShape: () => void;
|
|
28
|
+
refs: {
|
|
29
|
+
canvas: import("react").RefObject<HTMLCanvasElement>;
|
|
30
|
+
editor: import("react").MutableRefObject<HTMLElement | null>;
|
|
31
|
+
setEditor: (node: HTMLElement | null) => void;
|
|
32
|
+
};
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
canvasSize: {
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
scaleRatio: number;
|
|
39
|
+
};
|
|
40
|
+
selectTool: (tool: ToolsType) => void;
|
|
41
|
+
selectShape: (shape: ShapeEntity) => void;
|
|
42
|
+
activeTool: ToolsType;
|
|
43
|
+
setActiveTool: import("react").Dispatch<import("react").SetStateAction<ToolsType>>;
|
|
44
|
+
setAvailableTools: import("react").Dispatch<import("react").SetStateAction<import("./../../common/types/tools").CustomTool[]>>;
|
|
45
|
+
isEditMode: boolean;
|
|
46
|
+
isDisabled: boolean;
|
|
47
|
+
availableTools: import("./../../common/types/tools").CustomTool[];
|
|
48
|
+
gridGap: number;
|
|
49
|
+
setGridGap: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
50
|
+
loadFile: (file: File) => Promise<void>;
|
|
51
|
+
exportPicture: () => void;
|
|
52
|
+
exportData: () => void;
|
|
53
|
+
clearCanvas: () => void;
|
|
54
|
+
settings: UtilsSettings;
|
|
55
|
+
canvas: {
|
|
56
|
+
selection: {
|
|
57
|
+
canvasSelectionColor: string;
|
|
58
|
+
canvasSelectionWidth: number;
|
|
59
|
+
canvasSelectionPadding: number;
|
|
60
|
+
};
|
|
61
|
+
withSkeleton: boolean;
|
|
62
|
+
withFrameSelection: boolean;
|
|
63
|
+
canGrow: boolean;
|
|
64
|
+
canShrink: boolean;
|
|
65
|
+
layersManipulation: boolean;
|
|
66
|
+
withExport: boolean;
|
|
67
|
+
withLoadAndSave: boolean;
|
|
68
|
+
withUploadPicture: boolean;
|
|
69
|
+
withUrlPicture: boolean;
|
|
70
|
+
clearCallback: "empty" | "defaultShapes" | (() => DrawableShape[]);
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
canvasProps: {
|
|
74
|
+
shapesRef: import("react").MutableRefObject<ShapeEntity[]>;
|
|
75
|
+
selectedShape: ShapeEntity | undefined;
|
|
76
|
+
selectionFrame: [Point, Point] | undefined;
|
|
77
|
+
hoveredShape: ShapeEntity | undefined;
|
|
78
|
+
addShape: (newShape: ShapeEntity) => void;
|
|
79
|
+
setSelectedShape: import("react").Dispatch<import("react").SetStateAction<ShapeEntity | undefined>>;
|
|
80
|
+
setSelectionFrame: import("react").Dispatch<import("react").SetStateAction<[Point, Point] | undefined>>;
|
|
81
|
+
refreshSelectedShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point) => void;
|
|
82
|
+
refreshHoveredShape: (e: MouseEvent | TouchEvent, ctx: CanvasRenderingContext2D, cursorPosition: Point) => void;
|
|
83
|
+
removeShape: (shape: ShapeEntity) => void;
|
|
84
|
+
updateShape: (updatedShape: ShapeEntity, withSave?: boolean) => void;
|
|
85
|
+
backwardShape: () => void;
|
|
86
|
+
forwardShape: () => void;
|
|
87
|
+
saveShapes: () => void;
|
|
88
|
+
refs: {
|
|
89
|
+
canvas: import("react").RefObject<HTMLCanvasElement>;
|
|
90
|
+
editor: import("react").MutableRefObject<HTMLElement | null>;
|
|
91
|
+
setEditor: (node: HTMLElement | null) => void;
|
|
92
|
+
};
|
|
93
|
+
width: number;
|
|
94
|
+
height: number;
|
|
95
|
+
settings: UtilsSettings;
|
|
96
|
+
canvasSize: {
|
|
97
|
+
width: number;
|
|
98
|
+
height: number;
|
|
99
|
+
scaleRatio: number;
|
|
100
|
+
};
|
|
101
|
+
setCanvasSize: import("react").Dispatch<import("react").SetStateAction<{
|
|
102
|
+
width: number;
|
|
103
|
+
height: number;
|
|
104
|
+
scaleRatio: number;
|
|
105
|
+
}>>;
|
|
106
|
+
setCanvasOffset: import("react").Dispatch<import("react").SetStateAction<Point>>;
|
|
107
|
+
selectShape: (shape: ShapeEntity) => void;
|
|
108
|
+
activeTool: ToolsType;
|
|
109
|
+
setActiveTool: import("react").Dispatch<import("react").SetStateAction<ToolsType>>;
|
|
110
|
+
isInsideComponent: boolean;
|
|
111
|
+
isEditMode: boolean;
|
|
112
|
+
isDisabled: boolean;
|
|
113
|
+
canvas: {
|
|
114
|
+
selection: {
|
|
115
|
+
canvasSelectionColor: string;
|
|
116
|
+
canvasSelectionWidth: number;
|
|
117
|
+
};
|
|
118
|
+
withSkeleton: boolean;
|
|
119
|
+
withFrameSelection: boolean;
|
|
120
|
+
canGrow: boolean;
|
|
121
|
+
canShrink: boolean;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
registerEvent: (event: "dataChanged", fn: (data: StateData) => void) => void;
|
|
125
|
+
unregisterEvent: (event: "dataChanged", fn?: ((data: StateData) => void) | undefined) => void;
|
|
126
|
+
resetCanvas: (json: DrawableShape[], clearHistory?: boolean) => Promise<void>;
|
|
127
|
+
getCurrentImage: () => string | undefined;
|
|
128
|
+
getCurrentData: () => StateData;
|
|
129
|
+
};
|
|
130
|
+
export type UseReactPaintReturnType = ReturnType<typeof useReactPaint>;
|
|
131
|
+
export default useReactPaint;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}) => {
|
|
2
|
+
import { type UtilsSettings } from './../../canvas/constants/app';
|
|
3
|
+
import type { StateData, Point, ShapeEntity } from './../../common/types/Shapes';
|
|
4
|
+
declare const useShapes: (settings: UtilsSettings) => {
|
|
5
|
+
registerEvent: (event: 'dataChanged', fn: (data: StateData) => void) => void;
|
|
6
|
+
unregisterEvent: (event: 'dataChanged', fn?: (data: StateData) => void) => void;
|
|
8
7
|
shapesRef: import("react").MutableRefObject<ShapeEntity[]>;
|
|
9
8
|
selectedShape: ShapeEntity | undefined;
|
|
10
9
|
hoveredShape: ShapeEntity | undefined;
|
|
11
10
|
selectionFrame: [Point, Point] | undefined;
|
|
12
11
|
setSelectionFrame: import("react").Dispatch<import("react").SetStateAction<[Point, Point] | undefined>>;
|
|
13
|
-
refreshSelectedShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point
|
|
12
|
+
refreshSelectedShapes: (ctx: CanvasRenderingContext2D, cursorPosition: Point) => void;
|
|
14
13
|
addShape: (newShape: ShapeEntity) => void;
|
|
15
14
|
addPictureShape: (fileOrUrl: File | string, maxWidth?: number, maxHeight?: number) => Promise<ShapeEntity<"picture">>;
|
|
16
15
|
moveShapes: (firstShapeId: string, lastShapeId: string) => void;
|
|
17
16
|
saveShapes: () => void;
|
|
18
17
|
setSelectedShape: import("react").Dispatch<import("react").SetStateAction<ShapeEntity | undefined>>;
|
|
19
|
-
refreshHoveredShape: (e: MouseEvent | TouchEvent, ctx: CanvasRenderingContext2D, cursorPosition: Point
|
|
18
|
+
refreshHoveredShape: (e: MouseEvent | TouchEvent, ctx: CanvasRenderingContext2D, cursorPosition: Point) => void;
|
|
20
19
|
toggleShapeVisibility: (shape: ShapeEntity) => void;
|
|
21
20
|
toggleShapeLock: (shape: ShapeEntity) => void;
|
|
22
21
|
removeShape: (shape: ShapeEntity) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { UseReactPaintReturnType } from './../canvas/hooks/useReactPaint';
|
|
2
|
+
import { type CSSProperties } from 'react';
|
|
3
|
+
import './index.css';
|
|
4
|
+
type AppProps = {
|
|
5
|
+
canvasProps: UseReactPaintReturnType['canvasProps'];
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
options?: {
|
|
9
|
+
canvasBackgroundColor?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
declare const App: ({ options, className, style, canvasProps }: AppProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default App;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
2
|
+
import type { Point } from './../../common/types/Shapes';
|
|
2
3
|
export declare const initCanvasContext: (ctx: CanvasRenderingContext2D) => void;
|
|
3
4
|
export declare const updateCanvasContext: (ctx: CanvasRenderingContext2D, style?: {
|
|
4
5
|
fillColor?: string;
|
|
@@ -8,4 +9,4 @@ export declare const updateCanvasContext: (ctx: CanvasRenderingContext2D, style?
|
|
|
8
9
|
lineDash?: number;
|
|
9
10
|
lineCap?: CanvasLineCap;
|
|
10
11
|
}) => void;
|
|
11
|
-
export declare const transformCanvas: (ctx: CanvasRenderingContext2D,
|
|
12
|
+
export declare const transformCanvas: (ctx: CanvasRenderingContext2D, settings: UtilsSettings, rotation?: number, translation?: Point) => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
2
|
+
import type { DrawableShape, StateData, ShapeEntity } from './../../common/types/Shapes';
|
|
3
|
+
export declare const cleanShapesBeforeExport: (shapes: DrawableShape[]) => DrawableShape[];
|
|
4
|
+
export declare const buildDataToExport: (shapes: DrawableShape[], width: number, height: number) => StateData;
|
|
5
|
+
export declare const addDefaultAndTempShapeProps: (shape: DrawableShape, settings: UtilsSettings) => ShapeEntity;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
2
|
+
import type { DrawableShape, ShapeEntity } from './../../common/types/Shapes';
|
|
2
3
|
export declare const addSizeAndConvertSvgToObjectUrl: (svgFileContent: string) => string;
|
|
3
4
|
export declare const isSvg: (fileOrUrl: File | string) => boolean;
|
|
4
5
|
export declare const fetchAndStringify: (url: string) => Promise<string>;
|
|
5
6
|
export declare const downloadFile: (content: string, fileName: string) => void;
|
|
6
7
|
export declare const getBase64Image: (img: HTMLImageElement) => string;
|
|
7
|
-
export declare const getCanvasImage: (shapes: DrawableShape[],
|
|
8
|
+
export declare const getCanvasImage: (shapes: DrawableShape[], width: number, height: number, settings: UtilsSettings) => string;
|
|
8
9
|
export declare const encodeShapesInString: (shapes: DrawableShape[], width: number, height: number) => string;
|
|
9
10
|
export declare const decodeJson: (file: File) => Promise<unknown>;
|
|
10
|
-
export declare const decodeImportedData: (shapesForJson:
|
|
11
|
+
export declare const decodeImportedData: (shapesForJson: DrawableShape[], settings: UtilsSettings) => Promise<ShapeEntity[]>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
1
|
+
import type { UtilsSettings } from './../../canvas/constants/app';
|
|
2
|
+
import type { HoverModeData } from './../../common/types/Mode';
|
|
3
|
+
import type { DrawableShape, Point, Rect } from './../../common/types/Shapes';
|
|
4
|
+
export declare const getCursorPosition: (e: MouseEvent | TouchEvent, canvas: HTMLCanvasElement | null, settings: UtilsSettings) => Point;
|
|
4
5
|
export declare const isTouchGesture: (e: MouseEvent | TouchEvent) => e is TouchEvent;
|
|
5
6
|
export declare const getPointPositionAfterCanvasTransformation: (point: Point, shapeRotation: number, [originX, originY]: Point, [canvasOffsetX, canvasOffsetY]: Point) => Point;
|
|
6
7
|
export declare const getPointPositionBeforeCanvasTransformation: (point: Point, shapeRotation: number, [originX, originY]: Point, [canvasOffsetX, canvasOffsetY]: Point) => Point;
|
|
7
|
-
export declare const checkSelectionIntersection: (shape: DrawableShape, position: Point,
|
|
8
|
-
export declare const checkPositionIntersection: (ctx: CanvasRenderingContext2D, shape: DrawableShape, position: Point,
|
|
8
|
+
export declare const checkSelectionIntersection: (shape: DrawableShape, position: Point, settings: UtilsSettings, checkAnchors?: boolean, radius?: number) => false | HoverModeData;
|
|
9
|
+
export declare const checkPositionIntersection: (ctx: CanvasRenderingContext2D, shape: DrawableShape, position: Point, settings: UtilsSettings) => false | HoverModeData;
|
|
9
10
|
export declare function getRectIntersection(rect1: Rect, rect2: Rect): Rect | undefined;
|
|
10
|
-
export declare const checkSelectionFrameCollision: (ctx: CanvasRenderingContext2D, shape: DrawableShape, selectionFrame: [Point, Point],
|
|
11
|
+
export declare const checkSelectionFrameCollision: (ctx: CanvasRenderingContext2D, shape: DrawableShape, selectionFrame: [Point, Point], settings: UtilsSettings) => boolean;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { UtilsSettings } from './../../../canvas/constants/app';
|
|
2
|
+
import type { DrawableShape, Point, SelectionLinesType } from './../../../common/types/Shapes';
|
|
2
3
|
export declare const createLineSelectionPath: (path: Path2D | undefined, shape: DrawableShape<'line' | 'polygon' | 'curve'> & {
|
|
3
4
|
points: readonly Point[];
|
|
4
|
-
},
|
|
5
|
-
export declare const drawLineSelection: ({ ctx, shape, withAnchors, selectionWidth, selectionColor,
|
|
5
|
+
}, settings: UtilsSettings, gravityAnchors?: boolean) => SelectionLinesType;
|
|
6
|
+
export declare const drawLineSelection: ({ ctx, shape, withAnchors, selectionWidth, selectionColor, settings }: {
|
|
6
7
|
ctx: CanvasRenderingContext2D;
|
|
7
8
|
shape: DrawableShape<'line'> | DrawableShape<'polygon'> | DrawableShape<'curve'>;
|
|
8
9
|
withAnchors: boolean;
|
|
9
10
|
selectionWidth: number;
|
|
10
11
|
selectionColor: string;
|
|
11
|
-
|
|
12
|
+
settings: UtilsSettings;
|
|
12
13
|
}) => void;
|