@abidibo/react-cam-roi 0.5.0 → 0.7.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 +36 -22
- package/dist/Components/RoiEditor/Header.module.css +7 -4
- package/dist/Components/RoiEditor/RoiEditor.module.css +4 -0
- package/dist/index.cjs.css +1 -1
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +140 -123
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.css.map +1 -1
- package/dist/index.esm.js +140 -123
- package/dist/index.esm.js.map +1 -1
- package/dist/types/Components/RoiEditor/Point.d.ts +1 -1
- package/dist/types/Components/RoiEditor/Types.d.ts +2 -0
- package/dist/types/Components/RoiEditor/Utils.d.ts +1 -1
- package/dist/types/Components/RoiEditor/index.d.ts +1 -1
- package/dist/types/Components/TextField/index.d.ts +1 -0
- package/dist/types/Providers/EditorProvider.d.ts +5 -1
- package/dist/types/Providers/UiProvider.d.ts +21 -18
- package/dist/types/Types.d.ts +1 -1
- package/package.json +1 -1
@@ -7,7 +7,7 @@ export declare const copyPoint: (editorId: string, canvas: fabric.Canvas, point:
|
|
7
7
|
originX: "center";
|
8
8
|
originY: "center";
|
9
9
|
radius: number;
|
10
|
-
fill: string
|
10
|
+
fill: string;
|
11
11
|
stroke: string | fabric.TFiller | null;
|
12
12
|
strokeWidth: number;
|
13
13
|
strokeUniform: true;
|
@@ -5,7 +5,7 @@ export declare const enableRois: (configuration: Configuration) => boolean;
|
|
5
5
|
export declare const enableMainMetadata: (configuration: Configuration) => boolean;
|
6
6
|
export declare const canDrawShape: (configuration: Configuration, shapeType: Omit<ToolEnum, ToolEnum.Pointer>, shapes: Shapes, notify?: INotify, message?: string) => boolean;
|
7
7
|
export declare const validateParametersForm: (parameters: ConfigurationParameter[], fields: Record<string, unknown>, setErrors: (errors: Record<string, string>) => void, strings: Record<string, string>) => boolean;
|
8
|
-
export declare const validate: (configuration: Configuration, shapes: Shapes, metadata: Metadata, strings: Record<string, string>) => [boolean, string[]];
|
8
|
+
export declare const validate: (configuration: Configuration, presetName: string, shapes: Shapes, metadata: Metadata, strings: Record<string, string>) => [boolean, string[]];
|
9
9
|
export declare const fabricShapeToOutputShape: (shape: Shape, type: ShapeType, imageSize: {
|
10
10
|
width: number;
|
11
11
|
height: number;
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Configuration, Output } from './Types';
|
3
3
|
export type RoiEditorProps = {
|
4
|
+
editorId: string;
|
4
5
|
imageUrl: string;
|
5
6
|
configuration: Configuration;
|
6
7
|
onSubmit: (data: Output) => void;
|
7
8
|
onUpdate?: (data: Output) => void;
|
8
9
|
initialData?: Output;
|
9
|
-
editorId: string;
|
10
10
|
};
|
11
11
|
declare const RoiEditor: React.FC<RoiEditorProps>;
|
12
12
|
export default RoiEditor;
|
@@ -6,6 +6,10 @@ type EditorContextType = {
|
|
6
6
|
setActiveTool: (tool: ToolEnum) => void;
|
7
7
|
activeColor: string;
|
8
8
|
setActiveColor: (color: string) => void;
|
9
|
+
presetName: string;
|
10
|
+
setPresetName: (name: string) => void;
|
11
|
+
presetDescription: string;
|
12
|
+
setPresetDescription: (name: string) => void;
|
9
13
|
shapes: Shapes;
|
10
14
|
setShapes: (shapes: Shapes) => void;
|
11
15
|
addShape: (id: string, type: ShapeType, shape: Shape) => void;
|
@@ -23,5 +27,5 @@ type EditorContextType = {
|
|
23
27
|
};
|
24
28
|
export declare const EditorContext: import("react").Context<EditorContextType | undefined>;
|
25
29
|
export declare function useEditorContext(): EditorContextType;
|
26
|
-
declare const EditorProvider: ({ children, editorId, hideForbiddenTools, activeTool, setActiveTool, activeColor, setActiveColor, shapes, setShapes, addShape, addShapes, removeShape, configuration, metadata, setMetadata, onSubmit, }: PropsWithChildren<EditorContextType>) => import("react/jsx-runtime").JSX.Element;
|
30
|
+
declare const EditorProvider: ({ children, editorId, hideForbiddenTools, activeTool, setActiveTool, activeColor, setActiveColor, presetName, setPresetName, presetDescription, setPresetDescription, shapes, setShapes, addShape, addShapes, removeShape, configuration, metadata, setMetadata, onSubmit, }: PropsWithChildren<EditorContextType>) => import("react/jsx-runtime").JSX.Element;
|
27
31
|
export default EditorProvider;
|
@@ -1,18 +1,18 @@
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
2
|
-
import
|
2
|
+
import BoolField from '../Components/BoolField';
|
3
|
+
import Button from '../Components/Button';
|
4
|
+
import EnumField from '../Components/EnumField';
|
3
5
|
import IconButton from '../Components/IconButton';
|
4
|
-
import
|
5
|
-
import
|
6
|
+
import Modal from '../Components/Modal';
|
7
|
+
import NumberField from '../Components/NumberField';
|
6
8
|
import { INotify } from '../Components/RoiEditor/Types';
|
7
|
-
import
|
9
|
+
import TextField from '../Components/TextField';
|
10
|
+
import Typography from '../Components/Typography';
|
8
11
|
import AnnotateIcon from '../Icons/AnnotateIcon';
|
9
|
-
import Modal from '../Components/Modal';
|
10
12
|
import CloseIcon from '../Icons/CloseIcon';
|
11
|
-
import
|
12
|
-
import
|
13
|
-
import
|
14
|
-
import EnumField from '../Components/EnumField';
|
15
|
-
import Button from '../Components/Button';
|
13
|
+
import CopyIcon from '../Icons/CopyIcon';
|
14
|
+
import DeleteIcon from '../Icons/DeleteIcon';
|
15
|
+
import EditIcon from '../Icons/EditIcon';
|
16
16
|
import SaveIcon from '../Icons/SaveIcon';
|
17
17
|
type UiContextType = {
|
18
18
|
children?: React.ReactNode;
|
@@ -45,14 +45,9 @@ type UiContextType = {
|
|
45
45
|
id: string;
|
46
46
|
invalidSubmission: string;
|
47
47
|
mainParametersMetadata: string;
|
48
|
+
missingPresetName: string;
|
48
49
|
missingRequiredValuesInMainParameters: string;
|
49
50
|
missingRequiredValuesInShapeParameters: string;
|
50
|
-
roiMultiplicityEqRule: string;
|
51
|
-
roiMultiplicityGtRule: string;
|
52
|
-
roiMultiplicityGteRule: string;
|
53
|
-
roiMultiplicityLtRule: string;
|
54
|
-
roiMultiplicityLteRule: string;
|
55
|
-
roiMultiplicityNoRule: string;
|
56
51
|
name: string;
|
57
52
|
point: string;
|
58
53
|
pointHelpText: string;
|
@@ -60,10 +55,18 @@ type UiContextType = {
|
|
60
55
|
polygonHelpText: string;
|
61
56
|
polyline: string;
|
62
57
|
polylineHelpText: string;
|
63
|
-
|
64
|
-
|
58
|
+
presetDescription: string;
|
59
|
+
presetName: string;
|
65
60
|
pointer: string;
|
66
61
|
pointerHelpText: string;
|
62
|
+
rect: string;
|
63
|
+
rectHelpText: string;
|
64
|
+
roiMultiplicityEqRule: string;
|
65
|
+
roiMultiplicityGtRule: string;
|
66
|
+
roiMultiplicityGteRule: string;
|
67
|
+
roiMultiplicityLtRule: string;
|
68
|
+
roiMultiplicityLteRule: string;
|
69
|
+
roiMultiplicityNoRule: string;
|
67
70
|
roisToBeDrawn: string;
|
68
71
|
role: string;
|
69
72
|
requiredField: string;
|
package/dist/types/Types.d.ts
CHANGED