@glodon-aiot/dataset-annotation 3.14.0-alpha.32 → 3.14.0-alpha.33
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/es/components/VLMAnnotation/RegionItem.mjs +1 -1
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useAIButtonHover.mjs +193 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.mjs +300 -237
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.mjs +158 -56
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/index.mjs +424 -397
- package/dist/es/components/VLMAnnotation/components/AIErrorTooltip/AIErrorTooltip.less.mjs +4 -0
- package/dist/es/components/VLMAnnotation/components/AIErrorTooltip/index.mjs +24 -0
- package/dist/es/components/VLMAnnotation/components/ZoomControls.mjs +1 -1
- package/dist/es/components/VLMAnnotation/constants.mjs +1 -1
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +4 -4
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useAIButtonHover.d.ts +16 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.d.ts +2 -1
- package/dist/src/components/VLMAnnotation/components/AIErrorTooltip/index.d.ts +8 -0
- package/dist/src/components/VLMAnnotation/constants.d.ts +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { fabric } from 'fabric';
|
|
2
|
+
interface UseAIButtonHoverParams {
|
|
3
|
+
canvas: fabric.Canvas | undefined;
|
|
4
|
+
ocrErrorRef: React.MutableRefObject<Set<string>>;
|
|
5
|
+
rectMapRef: React.MutableRefObject<Map<fabric.Rect, any>>;
|
|
6
|
+
onAIButtonHover?: (regionId: string | null, position: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
} | null) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Hook for detecting hover on AI button
|
|
13
|
+
* @param params - AI button hover configuration parameters
|
|
14
|
+
*/
|
|
15
|
+
export declare const useAIButtonHover: ({ canvas, ocrErrorRef, rectMapRef, onAIButtonHover, }: UseAIButtonHoverParams) => void;
|
|
16
|
+
export {};
|
|
@@ -21,6 +21,7 @@ interface UseDrawingModeParams {
|
|
|
21
21
|
onRegionSelect?: (region: Region | null) => void;
|
|
22
22
|
rectMapRef: React.MutableRefObject<Map<fabric.Rect, Region>>;
|
|
23
23
|
textLayersMapRef: React.MutableRefObject<Map<fabric.Rect, fabric.Rect[]>>;
|
|
24
|
+
regionNameTextMapRef: React.MutableRefObject<Map<fabric.Rect, fabric.Text>>;
|
|
24
25
|
setupBoundaryCheck: (rect: fabric.Rect) => (() => void) | undefined;
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
@@ -28,7 +29,7 @@ interface UseDrawingModeParams {
|
|
|
28
29
|
* @param params - Drawing mode configuration parameters
|
|
29
30
|
* @returns stopDraw function to stop drawing
|
|
30
31
|
*/
|
|
31
|
-
export declare const useDrawingMode: ({ canvas, drawingMode, draggable, setDrawingMode, canvasToImageCoords, labelDefinitions, onChange, cropRegionImage, updateRegionShapeAndImage, performOCRIfNeeded, createDeleteControl, createOCRControl, updateRegionNameText, onRegionChange, onRegionSelect, rectMapRef, textLayersMapRef, setupBoundaryCheck, }: UseDrawingModeParams) => {
|
|
32
|
+
export declare const useDrawingMode: ({ canvas, drawingMode, draggable, setDrawingMode, canvasToImageCoords, labelDefinitions, onChange, cropRegionImage, updateRegionShapeAndImage, performOCRIfNeeded, createDeleteControl, createOCRControl, updateRegionNameText, onRegionChange, onRegionSelect, rectMapRef, textLayersMapRef, regionNameTextMapRef, setupBoundaryCheck, }: UseDrawingModeParams) => {
|
|
32
33
|
stopDraw: () => void;
|
|
33
34
|
};
|
|
34
35
|
export {};
|
|
@@ -84,13 +84,13 @@ export declare const DELETE_ICON_SIZE = 24;
|
|
|
84
84
|
/** 删除控件 X 轴偏移(像素) */
|
|
85
85
|
export declare const DELETE_CONTROL_OFFSET_X = 20;
|
|
86
86
|
/** 删除控件 Y 轴偏移(像素) */
|
|
87
|
-
export declare const DELETE_CONTROL_OFFSET_Y =
|
|
87
|
+
export declare const DELETE_CONTROL_OFFSET_Y = 8;
|
|
88
88
|
/** AI图标大小(像素) */
|
|
89
89
|
export declare const AI_ICON_SIZE = 24;
|
|
90
90
|
/** AI控件 X 轴偏移(像素) */
|
|
91
91
|
export declare const AI_CONTROL_OFFSET_X = 20;
|
|
92
92
|
/** AI控件 Y 轴偏移(像素) */
|
|
93
|
-
export declare const AI_CONTROL_OFFSET_Y =
|
|
93
|
+
export declare const AI_CONTROL_OFFSET_Y = 8;
|
|
94
94
|
/** AI控件与删除控件之间的间距(像素) */
|
|
95
95
|
export declare const AI_DELETE_CONTROL_SPACING = 40;
|
|
96
96
|
/** 区域名称文本颜色 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glodon-aiot/dataset-annotation",
|
|
3
|
-
"version": "3.14.0-alpha.
|
|
3
|
+
"version": "3.14.0-alpha.33",
|
|
4
4
|
"module": "./dist/es/index.mjs",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ant-design/icons": "^5.3.4",
|
|
39
39
|
"@aws-crypto/sha256-js": "^3.0.0",
|
|
40
|
-
"@glodon-aiot/apis": "^3.14.0-alpha.
|
|
40
|
+
"@glodon-aiot/apis": "^3.14.0-alpha.33",
|
|
41
41
|
"@glodon-aiot/minio": "^0.1.6",
|
|
42
42
|
"@reduxjs/toolkit": "^1.9.5",
|
|
43
43
|
"@types/fabric": "^5.3.2",
|