Socket
Socket
Sign inDemoInstall

@zityspace/react-annotate

Package Overview
Dependencies
133
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.11.1 to 0.12.0-beta.1

1

dist/components/Annotator.d.ts

@@ -1,2 +0,1 @@

/// <reference types="react" />
import { ImageData, LabelConfigs } from '../interfaces/basic';

@@ -3,0 +2,0 @@ export declare const Annotator: ({ imagesList, initIndex, categories, getImage, onSave, onError, onAddCategory, onRenameCategory, labelConfigs, }: {

@@ -1,2 +0,1 @@

/// <reference types="react" />
export declare const Button: ({ children, canUse, isUsing, onClick, }: {

@@ -3,0 +2,0 @@ children: any;

@@ -1,2 +0,1 @@

/// <reference types="react" />
import { DataOperation } from '../hooks/useData';

@@ -3,0 +2,0 @@ export declare const ButtonBar: ({ dataOperation, }: {

@@ -1,2 +0,1 @@

/// <reference types="react" />
import { Label } from '../../labels';

@@ -3,0 +2,0 @@ export declare const AnnotationsGrid: ({ annotations }: {

@@ -1,4 +0,3 @@

/// <reference types="react" />
export declare const CategoryName: ({ categoryName }: {
categoryName: string;
}) => JSX.Element;

@@ -1,2 +0,1 @@

/// <reference types="react" />
import { LabeledImageData } from '../../interfaces/basic';

@@ -3,0 +2,0 @@ export declare const OperationPanel: ({ imagesList, onAddCategory, onRenameCategory, }: {

@@ -1,2 +0,1 @@

/// <reference types="react" />
export declare const useContainer: () => JSX.Element;

@@ -1,2 +0,1 @@

/// <reference types="react" />
export declare const useLabels: () => JSX.Element;

1

dist/labels/Base.d.ts

@@ -0,1 +1,2 @@

import * as fabric from 'fabric';
export declare enum LabelType {

@@ -2,0 +3,0 @@ None = "none",

@@ -1,2 +0,2 @@

import { fabric } from 'fabric';
import * as fabric from 'fabric';
import { Label, CoordSystemType } from '../Base';

@@ -3,0 +3,0 @@ export declare class BoxLabel extends Label {

@@ -1,2 +0,1 @@

import { fabric } from 'fabric';
export declare const useBoxListeners: (syncCanvasToState: (id?: number) => void) => {

@@ -7,12 +6,12 @@ drawBoxListeners?: undefined;

drawBoxListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
};
editBoxListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:up': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'object:moving': (e: fabric.IEvent<Event>) => void;
'object:modified': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:up': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
'object:moving': (e: IEvent<MouseEvent>) => void;
'object:modified': (e: IEvent<MouseEvent>) => void;
};
};

@@ -1,2 +0,1 @@

/// <reference types="react" />
export declare const useLabelComponents: () => JSX.Element;

@@ -9,8 +9,8 @@ export declare const IS_TOUCH_SCREEN: boolean;

export declare const ANCHOR_CENTER: {
originX: string;
originY: string;
originX: TOriginX;
originY: TOriginY;
};
export declare const ANCHOR_LEFT_TOP: {
originX: string;
originY: string;
originX: TOriginX;
originY: TOriginY;
};

@@ -31,9 +31,80 @@ export declare const NO_BORDER: {

};
export declare const CANVAS_CONFIG: fabric.ICanvasOptions;
export declare const POINT_DEFAULT_CONFIG: fabric.ICircleOptions;
export declare const LINE_DEFAULT_CONFIG: fabric.ILineOptions;
export declare const RECT_DEFAULT_CONFIG: fabric.IRectOptions | any;
export declare const POLYGON_DEFAULT_CONFIG: fabric.IPolylineOptions;
export declare const POLYLINE_DEFAULT_CONFIG: fabric.IPolylineOptions;
export declare const TEXTBOX_DEFAULT_CONFIG: fabric.ITextboxOptions;
export declare const CANVAS_CONFIG: {
defaultCursor: string;
selection: boolean;
uniformScaling: boolean;
targetFindTolerance: number;
fireRightClick: boolean;
stopContextMenu: boolean;
};
export declare const POINT_DEFAULT_CONFIG: {
selectable: boolean;
radius: number;
strokeWidth: number;
perPixelTargetFind: boolean;
hasControls: boolean;
hasBorders: boolean;
originX: TOriginX;
originY: TOriginY;
};
export declare const LINE_DEFAULT_CONFIG: {
strokeWidth: number;
selectable: boolean;
perPixelTargetFind: boolean;
hasControls: boolean;
hasBorders: boolean;
originX: TOriginX;
originY: TOriginY;
};
export declare const RECT_DEFAULT_CONFIG: {
hasBorders: boolean;
_controlsVisibility: {
mtr: boolean;
};
selectable: boolean;
strokeUniform: boolean;
noScaleCache: boolean;
cornerSize: number;
transparentCorners: boolean;
perPixelTargetFind: boolean;
fill: string;
strokeWidth: number;
originX: TOriginX;
originY: TOriginY;
};
export declare const POLYGON_DEFAULT_CONFIG: {
perPixelTargetFind: boolean;
selectable: boolean;
fillRule: string;
hoverCursor: string;
lockMovementX: boolean;
lockMovementY: boolean;
lockRotation: boolean;
fill: string;
strokeWidth: number;
hasControls: boolean;
hasBorders: boolean;
originX: TOriginX;
originY: TOriginY;
};
export declare const POLYLINE_DEFAULT_CONFIG: {
perPixelTargetFind: boolean;
selectable: boolean;
hoverCursor: string;
lockMovementX: boolean;
lockMovementY: boolean;
lockRotation: boolean;
fill: string;
strokeWidth: number;
hasControls: boolean;
hasBorders: boolean;
originX: TOriginX;
originY: TOriginY;
};
export declare const TEXTBOX_DEFAULT_CONFIG: {
fill: string;
selectable: boolean;
hoverCursor: string;
fontSize: number;
};
export declare const checkCursor: string;

@@ -1,4 +0,3 @@

/// <reference types="react" />
export declare const useKeypointsComponents: () => {
KeypointsStructure: JSX.Element;
};

@@ -1,2 +0,2 @@

import { fabric } from 'fabric';
import * as fabric from 'fabric';
import { Label, CoordSystemType } from '../Base';

@@ -3,0 +3,0 @@ declare type Keypoints = {

@@ -1,2 +0,1 @@

import { fabric } from 'fabric';
export declare const useKeypointsListeners: (syncCanvasToState: (id?: number) => void, syncStateToCanvas: (id?: number) => void) => {

@@ -8,16 +7,16 @@ drawKeypointsListeners?: undefined;

drawKeypointsListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:dblclick': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:dblclick': (e: IEvent<MouseEvent>) => void;
};
editKeypointsListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:up': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'mouse:dblclick': (e: fabric.IEvent<Event>) => void;
'object:modified': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:up': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
'mouse:dblclick': (e: IEvent<MouseEvent>) => void;
'object:modified': (e: IEvent<MouseEvent>) => void;
};
advancedDrawKeypointsListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:dblclick': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:dblclick': (e: IEvent<MouseEvent>) => void;
};
};

@@ -1,2 +0,2 @@

import { fabric } from 'fabric';
import * as fabric from 'fabric';
import { Label, CoordSystemType } from '../Base';

@@ -3,0 +3,0 @@ export declare class LineLabel extends Label {

@@ -1,2 +0,1 @@

import { fabric } from 'fabric';
export declare const useLineListeners: (syncCanvasToState: (id?: number) => void) => {

@@ -7,11 +6,11 @@ drawLineListeners?: undefined;

drawLineListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
};
editLineListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:up': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'object:modified': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:up': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
'object:modified': (e: IEvent<MouseEvent>) => void;
};
};

@@ -1,2 +0,1 @@

import { fabric } from 'fabric';
export declare const useDefaultListeners: () => {

@@ -7,10 +6,10 @@ sharedListeners?: undefined;

sharedListeners: {
'selection:created': (e: fabric.IEvent<Event>) => void;
'mouse:wheel': (e: fabric.IEvent<Event>) => void;
'selection:created': (e: IEvent<MouseEvent>) => void;
'mouse:wheel': (e: IEvent<WheelEvent>) => void;
};
defaultListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'mouse:up': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
'mouse:up': (e: IEvent<MouseEvent>) => void;
};
};
/// <reference types="react" />
import { LabeledObject, LabelType } from '../Base';
export declare const setup: () => {
canvas: import("fabric/fabric-impl").Canvas | null;
canvas: import("fabric/*").Canvas | null;
canvasInitSize: {

@@ -26,3 +26,3 @@ w: number;

getColor: (key: string, inColorMapDefault?: boolean | undefined) => string;
lastPosition: import("react").MutableRefObject<import("fabric/fabric-impl").Point>;
lastPosition: import("react").MutableRefObject<import("fabric/*").Point>;
origPosition: import("react").MutableRefObject<{

@@ -29,0 +29,0 @@ x: number;

@@ -1,2 +0,2 @@

import { fabric } from 'fabric';
import * as fabric from 'fabric';
import { Label, CoordSystemType } from '../Base';

@@ -45,4 +45,4 @@ interface Path {

toImageCoordSystem: (inplace?: boolean) => MaskLabel;
toCanvasObjects: (color: string, mode: string) => (fabric.Textbox | fabric.Polygon[])[] | (fabric.Polyline[] | fabric.Line[][] | fabric.Circle[][])[];
toCanvasObjects: (color: string, mode: string) => (fabric.Textbox | fabric.Polyline[])[] | (fabric.Polyline[] | fabric.Line[][] | fabric.Circle[][])[];
}
export {};

@@ -1,2 +0,1 @@

import { fabric } from 'fabric';
export declare const useMaskListeners: (syncCanvasToState: (id?: number) => void) => {

@@ -8,18 +7,18 @@ drawMaskListeners?: undefined;

drawMaskListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:dblclick': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:dblclick': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
};
editMaskListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:up': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'mouse:dblclick': (e: fabric.IEvent<Event>) => void;
'object:modified': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:up': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
'mouse:dblclick': (e: IEvent<MouseEvent>) => void;
'object:modified': (e: IEvent<MouseEvent>) => void;
};
advancedDrawMaskListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:dblclick': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:dblclick': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
};
};

@@ -1,2 +0,2 @@

import { fabric } from 'fabric';
import * as fabric from 'fabric';
import { Label, CoordSystemType } from '../Base';

@@ -3,0 +3,0 @@ export declare class PointLabel extends Label {

@@ -1,2 +0,1 @@

import { fabric } from 'fabric';
export declare const usePointListeners: (syncCanvasToState: (id?: number) => void) => {

@@ -7,10 +6,10 @@ drawPointListeners?: undefined;

drawPointListeners: {
'mouse:up': (e: fabric.IEvent<Event>) => void;
'mouse:up': (e: IEvent<MouseEvent>) => void;
};
editPointListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:up': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'object:modified': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:up': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
'object:modified': (e: IEvent<MouseEvent>) => void;
};
};

@@ -1,2 +0,2 @@

import { fabric } from 'fabric';
import * as fabric from 'fabric';
import { Label, CoordSystemType } from '../Base';

@@ -43,3 +43,3 @@ export declare class PolylineLabel extends Label {

toImageCoordSystem: (inplace?: boolean) => PolylineLabel;
toCanvasObjects: (color: string, mode: string) => (fabric.Polyline[] | fabric.Line[][] | fabric.Circle[][])[] | (fabric.Textbox | fabric.Polyline[])[];
toCanvasObjects: (color: string, mode: string) => (fabric.Textbox | fabric.Polyline[])[] | (fabric.Polyline[] | fabric.Line[][] | fabric.Circle[][])[];
}

@@ -1,2 +0,1 @@

import { fabric } from 'fabric';
export declare const usePolylineListeners: (syncCanvasToState: (id?: number) => void) => {

@@ -8,18 +7,18 @@ drawPolylineListeners?: undefined;

drawPolylineListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:dblclick': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:dblclick': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
};
editPolylineListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:up': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'mouse:dblclick': (e: fabric.IEvent<Event>) => void;
'object:modified': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:up': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
'mouse:dblclick': (e: IEvent<MouseEvent>) => void;
'object:modified': (e: IEvent<MouseEvent>) => void;
};
advancedDrawPolylineListeners: {
'mouse:down': (e: fabric.IEvent<Event>) => void;
'mouse:dblclick': (e: fabric.IEvent<Event>) => void;
'mouse:move': (e: fabric.IEvent<Event>) => void;
'mouse:down': (e: IEvent<MouseEvent>) => void;
'mouse:dblclick': (e: IEvent<MouseEvent>) => void;
'mouse:move': (e: IEvent<MouseEvent>) => void;
};
};

@@ -0,1 +1,2 @@

import { TPointerEventInfo as IEvent } from 'fabric/src/EventTypeDefs';
import { LabeledObject } from '../Base';

@@ -9,7 +10,8 @@ import { PointLabel } from '../Point/label';

export declare const getBoundedValue: (value: number, min: number, max: number) => number;
export declare function parseEvent<T extends MouseEvent | WheelEvent>(e: fabric.IEvent<T>): {
button: number | undefined;
target: import("fabric/fabric-impl").Object | undefined;
pointer: import("fabric/fabric-impl").Point | undefined;
evt: T;
export declare function parseEvent<T extends MouseEvent | WheelEvent>(e: IEvent<T>): {
button: IEvent<T>;
target: IEvent<T>;
pointer: IEvent<T>;
evt: IEvent<T>;
absolutePointer: IEvent<T>;
};

@@ -16,0 +18,0 @@ export declare const newLabelFromCanvasObject: ({ obj, grp, scale, offset, timestamp, hash, }: {

/// <reference types="react" />
import { fabric } from 'fabric';
import * as fabric from 'fabric';
import { StoreApi } from 'zustand';

@@ -4,0 +4,0 @@ interface StoreData {

/// <reference types="react" />
import * as fabric from 'fabric';
import { StoreApi } from 'zustand';

@@ -3,0 +4,0 @@ import { DataState } from '../interfaces/basic';

@@ -1,10 +0,12 @@

import { fabric } from 'fabric';
import * as fabric from 'fabric';
import { TPointerEventInfo as IEvent } from 'fabric/src/EventTypeDefs';
import React from 'react';
import { StoreApi } from 'zustand';
export interface TrySwitchGroupFunction {
(e: fabric.IEvent<Event>, currentGroup: string): {
pointer: fabric.Point | undefined;
(e: IEvent<MouseEvent>, currentGroup: string): {
pointer: fabric.Point;
switched: boolean;
target: fabric.Object | undefined;
evt: MouseEvent;
absolutePointer: fabric.Point;
};

@@ -11,0 +13,0 @@ }

{
"name": "@zityspace/react-annotate",
"version": "0.11.1",
"version": "0.12.0-beta.1",
"description": "React library for annotating computer vision datasets",

@@ -42,7 +42,6 @@ "author": "ZitySpace",

"@testing-library/react": "^12.1.2",
"@types/fabric": "^4.5.15",
"@types/jest": "^27.4.0",
"@types/md5": "^2.3.2",
"@types/randomcolor": "^0.5.6",
"@types/react": "^17.0.38",
"@types/react": "^18.0.28",
"@typescript-eslint/eslint-plugin": "^5.31.0",

@@ -63,4 +62,2 @@ "@typescript-eslint/parser": "^5.31.0",

"prettier": "^2.7.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rollup": "^2.62.0",

@@ -78,4 +75,4 @@ "rollup-plugin-peer-deps-external": "^2.2.4",

"peerDependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},

@@ -85,3 +82,3 @@ "dependencies": {

"@use-gesture/react": "^10.2.4",
"fabric": "^5.3.0",
"fabric": "^6.0.0-beta1",
"md5": "^2.3.0",

@@ -88,0 +85,0 @@ "randomcolor": "^0.6.2",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc