@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.
@@ -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 | fabric.TFiller | null;
10
+ fill: string;
11
11
  stroke: string | fabric.TFiller | null;
12
12
  strokeWidth: number;
13
13
  strokeUniform: true;
@@ -167,6 +167,8 @@ export interface OutputRoi {
167
167
  }
168
168
  export interface Output {
169
169
  parameters: OutputParameter[];
170
+ presetName: string;
171
+ presetDescription: string;
170
172
  rois: OutputRoi[];
171
173
  }
172
174
  export declare enum UpdateEventType {
@@ -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;
@@ -1,6 +1,7 @@
1
1
  import { FieldProps } from '../../Types';
2
2
  export interface TextFieldProps extends FieldProps<string> {
3
3
  type?: 'text' | 'email' | 'password';
4
+ fullWidth?: boolean;
4
5
  }
5
6
  declare const TextField: React.FC<TextFieldProps>;
6
7
  export default TextField;
@@ -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 Typography from '../Components/Typography';
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 DeleteIcon from '../Icons/DeleteIcon';
5
- import EditIcon from '../Icons/EditIcon';
6
+ import Modal from '../Components/Modal';
7
+ import NumberField from '../Components/NumberField';
6
8
  import { INotify } from '../Components/RoiEditor/Types';
7
- import CopyIcon from '../Icons/CopyIcon';
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 TextField from '../Components/TextField';
12
- import NumberField from '../Components/NumberField';
13
- import BoolField from '../Components/BoolField';
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
- rect: string;
64
- rectHelpText: string;
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;
@@ -1,7 +1,7 @@
1
1
  export interface FieldProps<T> {
2
2
  onChange: (value: T) => void;
3
3
  value: T;
4
- label: string;
4
+ label?: string;
5
5
  helperText?: string;
6
6
  error?: boolean;
7
7
  required?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abidibo/react-cam-roi",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "A react component for drawing ROI over images and managing metadata",
5
5
  "repository": {
6
6
  "type": "git",