@labelbee/lb-components 1.6.0 → 1.6.2
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/components/pointCloudView/components/EmptyPage/index.js +1 -1
- package/dist/types/components/AnnotationView/index.d.ts +1 -1
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +2 -2
- package/dist/types/components/videoPlayer/TagToolInstanceAdaptor.d.ts +1 -1
- package/dist/types/components/videoPlayer/index.d.ts +1 -1
- package/dist/types/components/videoPlayer/types.d.ts +1 -1
- package/dist/types/store/annotation/actionCreators.d.ts +4 -4
- package/dist/types/store/annotation/reducer.d.ts +1 -1
- package/dist/types/store/annotation/types.d.ts +3 -3
- package/dist/types/store/imgAttribute/types.d.ts +1 -1
- package/dist/types/store/index.d.ts +1 -1
- package/dist/types/store/toolStyle/types.d.ts +1 -1
- package/dist/types/utils/PageOperator.d.ts +1 -1
- package/dist/types/utils/dom.d.ts +3 -3
- package/dist/types/views/MainView/sidebar/ToolStyle/index.d.ts +1 -1
- package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
- package/dist/types/views/MainView/toolHeader/ExportData/index.d.ts +1 -1
- package/dist/views/MainView/annotationOperation/index.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/es/assets/annotation/pointCloudTool/unitAttribute.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/unitAttribute.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/unitAttributeForbid.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/unitAttributeForbid.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/unitAttributeHover.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/unitAttributeHover.svg.js.map +1 -0
- package/es/components/pointCloudView/components/EmptyPage/index.js +1 -1
- package/es/components/pointCloudView/components/EmptyPage/index.js.map +1 -1
- package/es/components/pointCloudView/components/UnifiedParamsModal/index.js +228 -0
- package/es/components/pointCloudView/components/UnifiedParamsModal/index.js.map +1 -0
- package/es/components/pointCloudView/components/UnifyParamsModal/index.js +1 -0
- package/es/components/pointCloudView/components/UnifyParamsModal/index.js.map +1 -0
- package/es/components/pointCloudView/hooks/useAttribute.js +1 -0
- package/es/components/pointCloudView/hooks/useAttribute.js.map +1 -0
- package/es/components/pointCloudView/hooks/useConfig.js +16 -11
- package/es/components/pointCloudView/hooks/useConfig.js.map +1 -1
- package/es/components/pointCloudView/hooks/useHistory.js +1 -0
- package/es/components/pointCloudView/hooks/useHistory.js.map +1 -0
- package/es/views/MainView/annotationOperation/index.js +1 -1
- package/es/views/MainView/annotationOperation/index.js.map +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/useOperationList.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/batchUpdateModal/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/batchUpdateModal/index.js.map +1 -0
- package/package.json +4 -5
- package/LICENSE +0 -203
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),nodata=require("../../../../assets/annotation/pointCloudTool/nodata.svg.js"),dom=require("../../../../utils/dom.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const EmptyPage=()=>React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","empty-page")},React__default.default.createElement("img",{src:nodata}),React__default.default.createElement("span",{className:dom.getClassName("point-cloud-container","empty-page","text")},"
|
|
1
|
+
"use strict";var React=require("react"),nodata=require("../../../../assets/annotation/pointCloudTool/nodata.svg.js"),dom=require("../../../../utils/dom.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const EmptyPage=()=>{const{t:e}=reactI18next.useTranslation();return React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","empty-page")},React__default.default.createElement("img",{src:nodata}),React__default.default.createElement("span",{className:dom.getClassName("point-cloud-container","empty-page","text")},e("NoData")))};module.exports=EmptyPage;
|
|
@@ -19,7 +19,7 @@ export declare const transferCanvas2World: (currentPos: {
|
|
|
19
19
|
x: number;
|
|
20
20
|
y: number;
|
|
21
21
|
};
|
|
22
|
-
export declare const topViewPolygon2PointCloud: (newPolygon: any, size: ISize, pointCloud?: PointCloud
|
|
22
|
+
export declare const topViewPolygon2PointCloud: (newPolygon: any, size: ISize, pointCloud?: PointCloud, selectedPointCloudBox?: IPointCloudBox, defaultValue?: {
|
|
23
23
|
[v: string]: any;
|
|
24
24
|
} | undefined) => Omit<IPointCloudBox, "trackID">;
|
|
25
25
|
/**
|
|
@@ -39,7 +39,7 @@ export declare const synchronizeBackView: (boxParams: IPointCloudBox, newPolygon
|
|
|
39
39
|
* @param boxParams
|
|
40
40
|
* @param newPolygon TODO! Need to add type
|
|
41
41
|
*/
|
|
42
|
-
export declare const synchronizeTopView: (newBoxParams: IPointCloudBox, newPolygon: any, topViewInstance?: PointCloudAnnotation
|
|
42
|
+
export declare const synchronizeTopView: (newBoxParams: IPointCloudBox, newPolygon: any, topViewInstance?: PointCloudAnnotation, mainViewInstance?: PointCloud) => void;
|
|
43
43
|
export declare const usePointCloudViews: () => {
|
|
44
44
|
topViewAddBox: () => void;
|
|
45
45
|
topViewSelectedChanged: () => void;
|
|
@@ -40,7 +40,7 @@ export declare class TagToolInstanceAdaptor extends React.Component<IVideoTagIns
|
|
|
40
40
|
};
|
|
41
41
|
get currentTagResult(): any;
|
|
42
42
|
get valid(): boolean;
|
|
43
|
-
clearResult: (sendMsg?: boolean, value?: string
|
|
43
|
+
clearResult: (sendMsg?: boolean, value?: string) => void;
|
|
44
44
|
exportData: () => (any[] | {
|
|
45
45
|
valid: boolean;
|
|
46
46
|
duration: number;
|
|
@@ -9,7 +9,7 @@ export declare const VideoPlayerCtx: React.Context<{
|
|
|
9
9
|
videoRef?: React.RefObject<HTMLVideoElement> | null | undefined;
|
|
10
10
|
isPlay: boolean;
|
|
11
11
|
playPause: () => void;
|
|
12
|
-
updateNextPlaybackRate: (isForward?: boolean
|
|
12
|
+
updateNextPlaybackRate: (isForward?: boolean) => void;
|
|
13
13
|
setCurrentTime: (time: number) => void;
|
|
14
14
|
playbackRate: number;
|
|
15
15
|
currentTime: number;
|
|
@@ -36,12 +36,12 @@ export declare function InitTaskData({ onSubmit, onSave, onPageChange, onStepCha
|
|
|
36
36
|
*/
|
|
37
37
|
export declare function UpdateInjectFunc({ onSubmit, onSave, onPageChange, onStepChange, getFileData, pageSize, loadFileList, stepList, beforeRotate }: any): any;
|
|
38
38
|
/** 切换到下一步 */
|
|
39
|
-
export declare const ToNextStep: (pageNumber?: number
|
|
39
|
+
export declare const ToNextStep: (pageNumber?: number) => (dispatch: any, getState: any) => any[];
|
|
40
40
|
/**
|
|
41
41
|
* 更新当前操作的步骤
|
|
42
42
|
* @param {number} toStep
|
|
43
43
|
*/
|
|
44
|
-
export declare const UpdateProcessingStep: (toStep: number, index?: number
|
|
44
|
+
export declare const UpdateProcessingStep: (toStep: number, index?: number) => (dispatch: any, getState: any) => any[];
|
|
45
45
|
/**
|
|
46
46
|
* 提交当前的文件数据
|
|
47
47
|
* @param submitType
|
|
@@ -63,7 +63,7 @@ export declare const PageJump: (toIndex: number, triggerEventAfterIndexChanged?:
|
|
|
63
63
|
* @param nextIndex 需要加载的图片index
|
|
64
64
|
* @param isInitial // 是否为初始化加载
|
|
65
65
|
*/
|
|
66
|
-
export declare const loadImgList: (dispatch: any, getState: any, nextIndex: number, isInitial?: boolean
|
|
66
|
+
export declare const loadImgList: (dispatch: any, getState: any, nextIndex: number, isInitial?: boolean) => Promise<true | undefined>;
|
|
67
67
|
/**
|
|
68
68
|
* 判断翻页还是切换依赖数据
|
|
69
69
|
* @param dispatch
|
|
@@ -71,7 +71,7 @@ export declare const loadImgList: (dispatch: any, getState: any, nextIndex: numb
|
|
|
71
71
|
* @param pageTurningOperation
|
|
72
72
|
* @param toIndex
|
|
73
73
|
*/
|
|
74
|
-
export declare const DispatcherTurning: (dispatch: any, getState: any, pageTurningOperation: EPageTurningOperation, triggerEventAfterIndexChanged?: boolean, toIndex?: number
|
|
74
|
+
export declare const DispatcherTurning: (dispatch: any, getState: any, pageTurningOperation: EPageTurningOperation, triggerEventAfterIndexChanged?: boolean, toIndex?: number) => Promise<any>;
|
|
75
75
|
/**
|
|
76
76
|
* 保存当前页数据
|
|
77
77
|
* */
|
|
@@ -10,5 +10,5 @@ export declare const getTotalPage: (state: AnnotationState) => number;
|
|
|
10
10
|
* @param nextIndex
|
|
11
11
|
* @param nextBasicIndex
|
|
12
12
|
*/
|
|
13
|
-
export declare const LoadFileAndFileData: (nextIndex: number, nextBasicIndex?: number
|
|
13
|
+
export declare const LoadFileAndFileData: (nextIndex: number, nextBasicIndex?: number) => any;
|
|
14
14
|
export declare const annotationReducer: (state: AnnotationState | undefined, action: AnnotationActionTypes) => AnnotationState;
|
|
@@ -3,8 +3,8 @@ import { ANNOTATION_ACTIONS } from '@/store/Actions';
|
|
|
3
3
|
import { IStepInfo } from '@/types/step';
|
|
4
4
|
import { OnSubmit, IFileItem, GetFileData, OnSave, OnPageChange, OnStepChange, LoadFileList } from '@/types/data';
|
|
5
5
|
import { ESubmitType } from '@/constant';
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type GraphToolInstance = RectOperation | PointOperation | PolygonOperation | LineToolOperation;
|
|
7
|
+
export type ToolInstance = GraphToolInstance | TagOperation | TextToolOperation;
|
|
8
8
|
interface CommonActions {
|
|
9
9
|
type: string;
|
|
10
10
|
payload?: any;
|
|
@@ -127,5 +127,5 @@ interface UpdateGetFileList {
|
|
|
127
127
|
interface CopyBackWordResult extends CommonActions {
|
|
128
128
|
type: typeof ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT;
|
|
129
129
|
}
|
|
130
|
-
export
|
|
130
|
+
export type AnnotationActionTypes = UpdateToolInstance | UpdateImgList | UpdateAnnotationConfig | SubmitFileData | LoadFileData | SetTaskConfig | InitTool | UpdateOnSubmit | UpdateOnPageChange | UpdateOnStepChange | UpdateGetFileData | UpdatePageSize | UpdateGetFileList | CopyBackWordResult | UpdateOnSave;
|
|
131
131
|
export {};
|
|
@@ -19,5 +19,5 @@ interface InitImgAttribute {
|
|
|
19
19
|
type: typeof IMAGE_ATTRIBUTE_ACTIONS.INIT_IMG_ATTRIBUTE;
|
|
20
20
|
payload: {};
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export type ImgAttributeActionTypes = UpdateImgAttribute | InitImgAttribute;
|
|
23
23
|
export {};
|
|
@@ -19,5 +19,5 @@ interface InitToolStyleConfig {
|
|
|
19
19
|
type: typeof TOOL_STYLE_ACTIONS.INIT_TOOL_STYLE_CONFIG;
|
|
20
20
|
payload: undefined;
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export type ToolStyleActionTypes = InitToolStyleConfig | UpdateToolStyleConfig;
|
|
23
23
|
export {};
|
|
@@ -43,6 +43,6 @@ declare class PageOperator {
|
|
|
43
43
|
* @param pageTurningOperation
|
|
44
44
|
* @param fileIndex
|
|
45
45
|
*/
|
|
46
|
-
static getNextFileIndex: (pageTurningOperation: EPageTurningOperation, pageInfo: IPageInfo, fileIndex?: number
|
|
46
|
+
static getNextFileIndex: (pageTurningOperation: EPageTurningOperation, pageInfo: IPageInfo, fileIndex?: number) => number;
|
|
47
47
|
}
|
|
48
48
|
export default PageOperator;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export type BasicTarget<T = HTMLElement> = (() => T | null) | T | null | MutableRefObject<T | null | undefined>;
|
|
3
|
+
type TargetElement = HTMLElement | Element | Document | Window;
|
|
4
4
|
export declare function getTargetElement(target?: BasicTarget<TargetElement>, defaultElement?: TargetElement): TargetElement | undefined | null;
|
|
5
5
|
/**
|
|
6
6
|
* Get class like BEM
|
|
7
7
|
* @param elm
|
|
8
8
|
* @param modify
|
|
9
9
|
*/
|
|
10
|
-
export declare const getClassName: (block: string, elm?: string
|
|
10
|
+
export declare const getClassName: (block: string, elm?: string, modify?: string) => string;
|
|
11
11
|
export {};
|
|
@@ -3,5 +3,5 @@ interface IProps {
|
|
|
3
3
|
toolStyle: ToolStyleState;
|
|
4
4
|
config: string;
|
|
5
5
|
}
|
|
6
|
-
declare const _default: import("react-redux").ConnectedComponent<(props: IProps) => JSX.Element, import("react-redux").Omit<IProps, "
|
|
6
|
+
declare const _default: import("react-redux").ConnectedComponent<(props: IProps) => JSX.Element, import("react-redux").Omit<IProps, "config" | "toolStyle">>;
|
|
7
7
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RenderFooter } from '@/types/main';
|
|
2
2
|
import { IStepInfo } from '@/types/step';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export
|
|
4
|
+
export type FooterTheme = 'light' | 'dark';
|
|
5
5
|
interface IProps {
|
|
6
6
|
totalPage: number;
|
|
7
7
|
imgIndex: number;
|
|
@@ -11,5 +11,5 @@ interface IProps {
|
|
|
11
11
|
}
|
|
12
12
|
declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
|
|
13
13
|
children?: React.ReactNode;
|
|
14
|
-
}, "imgList" | "
|
|
14
|
+
}, "imgList" | "toolInstance" | "onSubmit" | "dispatch">>;
|
|
15
15
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var index=require("../../../index.js"),ctx=require("../../../store/ctx.js"),es=require("antd/es"),_=require("lodash"),React=require("react"),reactRedux=require("react-redux"),FileError=require("../../../components/fileException/FileError.js"),useSize=require("../../../hooks/useSize.js"),actionCreators=require("../../../store/toolStyle/actionCreators.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),StepUtils=require("../../../utils/StepUtils.js");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";var index=require("../../../index.js"),ctx=require("../../../store/ctx.js"),es=require("antd/es"),_=require("lodash"),React=require("react"),reactRedux=require("react-redux"),FileError=require("../../../components/fileException/FileError.js"),useSize=require("../../../hooks/useSize.js"),actionCreators=require("../../../store/toolStyle/actionCreators.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),StepUtils=require("../../../utils/StepUtils.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var ___default=_interopDefaultLegacy(_),React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,r,o)=>r in t?__defProp(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o,__spreadValues=(t,r)=>{for(var o in r||(r={}))__hasOwnProp.call(r,o)&&__defNormalProp(t,o,r[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(r))__propIsEnum.call(r,o)&&__defNormalProp(t,o,r[o]);return t},__spreadProps=(t,r)=>__defProps(t,__getOwnPropDescs(r));const AnnotationOperation=t=>{const[,r]=React.useState(0),{imgAttribute:o,toolStyle:s,toolInstance:e,annotationEngine:n,imgList:f,imgIndex:b,dataInjectionAtCreation:d,renderEnhance:g,customRenderStyle:c,stepList:v,step:y,drawLayerSlot:p}=t,[E,m]=React.useState({zoom:1,currentPos:{x:0,y:0}}),S=React.useRef(null),I=React.useRef(null),l=useSize(S);React.useEffect(()=>{index.store.dispatch(actionCreators.InitToolStyleConfig())},[]),React.useEffect(()=>{if(!!n){switch(lbUtils.i18n.language){case"cn":case"en":n.setLang(lbUtils.i18n.language);break}n==null||n.setDataInjectionAtCreation(d),n==null||n.setRenderEnhance(g),c&&(n==null||n.setCustomRenderStyle(c))}},[n,d,g,c]),React.useEffect(()=>{const a=(i,P)=>{m({zoom:i,currentPos:P})},u=i=>{m(i)};return e&&(e.singleOn("messageError",i=>{es.message.error(i)}),e.singleOn("messageInfo",i=>{es.message.info(i)}),e.singleOn("changeAnnotationShow",()=>{r(i=>i+1)}),e.on("renderZoom",a),e.on("dragMove",u)),()=>{e&&(e.unbind("renderZoom",a),e.unbind("dragMove",u))}},[e]),React.useEffect(()=>{var a;(n==null?void 0:n.setImgAttribute)?n.setImgAttribute(o):(a=e==null?void 0:e.setImgAttribute)==null||a.call(e,o)},[o,n]),React.useEffect(()=>{e&&e.setStyle(s),n&&n.setStyle(s)},[s]),React.useEffect(()=>{(e==null?void 0:e.setSize)&&e.setSize(l),n&&n.setSize(l)},[l]),React.useEffect(()=>{const a=StepUtils.getCurrentStepInfo(y,v);e==null||e.setConfig(a.config)},[v]);const O=()=>{const a=f==null?void 0:f[b];!(a==null?void 0:a.url)||lbAnnotation.ImgUtils.load(a.url).then(u=>{n.setImgNode(u)})};return React__default.default.createElement("div",{ref:S,className:"annotationOperation"},React__default.default.createElement("div",{className:"canvas",ref:I,style:l,id:"toolContainer"},p==null?void 0:p(E)),(e==null?void 0:e.isImgError)===!0&&React__default.default.createElement(FileError,__spreadProps(__spreadValues({},l),{reloadImage:O,backgroundColor:"#e2e2e2",ignoreOffsetY:!0})))},mapStateToProps=t=>{const r=___default.default.pickBy(t.annotation,(o,s)=>["imgList","imgIndex","stepList","step","toolInstance","annotationEngine","loading"].includes(s));return __spreadValues({imgAttribute:t.imgAttribute,toolStyle:t.toolStyle},r)};var AnnotationOperation$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(AnnotationOperation);module.exports=AnnotationOperation$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../../../constant/index.js"),ToolType=require("../../../data/enums/ToolType.js"),StepUtils=require("../../../utils/StepUtils.js"),es=require("antd/es"),React=require("react"),reactI18next=require("react-i18next"),index$
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../../../constant/index.js"),ToolType=require("../../../data/enums/ToolType.js"),StepUtils=require("../../../utils/StepUtils.js"),es=require("antd/es"),React=require("react"),reactI18next=require("react-i18next"),index$8=require("./AnnotationText/index.js"),index$2=require("./ClearIcon/index.js"),index$6=require("./GeneralOperation/index.js"),index$3=require("./ImgAttributeInfo/index.js"),index$7=require("./SwitchAttributeList/index.js"),index$1=require("./TagSidebar/index.js"),index$4=require("./TextToolSidebar/index.js"),index$5=require("./PointCloudToolSidebar/index.js"),index$a=require("./ToolStyle/index.js"),lbAnnotation=require("@labelbee/lb-annotation"),index$9=require("./ScribbleSidebar/index.js"),ToolIcons=require("./ToolIcons.js"),ctx=require("../../../store/ctx.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const{EVideoToolName,EPointCloudName}=lbAnnotation.cTool,{Panel}=es.Collapse,sidebarCls=`${index.prefix}-sidebar`,Sidebar=({sider:e})=>{const o=ctx.useSelector(a=>StepUtils.getCurrentStepInfo(a.annotation.step,a.annotation.stepList)),t=o==null?void 0:o.tool,{t:i}=reactI18next.useTranslation();if(!t)return null;const E=a=>{const m=React__default.default.createElement(index$a,null);return React__default.default.createElement(Panel,{header:i("Style"),className:"panel",key:a},m)},u=React__default.default.createElement(ToolIcons.ToolIcons,{toolName:t,onChange:()=>{}}),n=React__default.default.createElement(index$7,null),d=React__default.default.createElement(index$8,null),c=React__default.default.createElement(es.Collapse,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${sidebarCls}__content`,expandIcon:index$1.expandIconFuc},E("1")),s=React__default.default.createElement(es.Collapse,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${sidebarCls}__content`,expandIcon:index$1.expandIconFuc},React__default.default.createElement(Panel,{header:React__default.default.createElement("div",null,i("Adjust"),React__default.default.createElement(index$2,null)),className:"panel",key:"imgAttribute"},React__default.default.createElement(index$3,null))),l=React__default.default.createElement(index$6.default,null),x=React__default.default.createElement(index$1.default,null),v=React__default.default.createElement(index$4.default,null),f=React__default.default.createElement(index$9,{onChange:(a,m)=>{}}),r=React__default.default.createElement("div",{className:`${sidebarCls}__horizontal`}),p=React__default.default.createElement(index$5,null),T=React__default.default.createElement(index$6.PointCloudOperation,null);return e?typeof e=="function"?React__default.default.createElement("div",{className:`${sidebarCls}`},e({toolIcon:u,attributeList:n,annotationText:d,toolStyle:c,imageAttributeInfo:s,operation:l,tagToolSideBar:x,textToolSideBar:v,horizontal:r,pointCloudToolSidebar:p,pointCloudOperation:T,scribbleSidebar:f})):e:[ToolType.EToolName.Rect,ToolType.EToolName.Point,ToolType.EToolName.Line,ToolType.EToolName.Rect,ToolType.EToolName.Polygon].includes(t)?React__default.default.createElement("div",{className:`${sidebarCls}`},u,r,n,d,r,React__default.default.createElement("div",{className:`${sidebarCls}__content`},c,s),l):t===ToolType.EToolName.Tag?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement(index$1.default,null)):t===EVideoToolName.VideoTagTool?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},React__default.default.createElement(index$1.default,null)),l):t===ToolType.EToolName.Text?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement(index$4.default,null)):t===EPointCloudName.PointCloud?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},React__default.default.createElement(index$5,null)),React__default.default.createElement(index$6.PointCloudOperation,null)):t===ToolType.EToolName.ScribbleTool?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},f,n),l):null};exports.default=Sidebar,exports.sidebarCls=sidebarCls;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M12.0355 1.96447L8.5 5.5L12.0354 9.03545L15.571 5.49991L12.0355 1.96447Z' stroke='%23666666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M18.5355 8.46447L15 12L18.5354 15.5354L22.071 11.9999L18.5355 8.46447Z' stroke='%23666666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M5.53553 8.46447L2 12L5.53544 15.5354L9.07098 11.9999L5.53553 8.46447Z' stroke='%23666666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M12.0355 14.9645L8.5 18.5L12.0354 22.0354L15.571 18.4999L12.0355 14.9645Z' stroke='%23666666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unitAttribute.svg.js","sources":["../../../../src/assets/annotation/pointCloudTool/unitAttribute.svg"],"sourcesContent":["var img = \"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M12.0355 1.96447L8.5 5.5L12.0354 9.03545L15.571 5.49991L12.0355 1.96447Z' stroke='%23666666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M18.5355 8.46447L15 12L18.5354 15.5354L22.071 11.9999L18.5355 8.46447Z' stroke='%23666666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M5.53553 8.46447L2 12L5.53544 15.5354L9.07098 11.9999L5.53553 8.46447Z' stroke='%23666666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M12.0355 14.9645L8.5 18.5L12.0354 22.0354L15.571 18.4999L12.0355 14.9645Z' stroke='%23666666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e\";\n export default img;"],"names":[],"mappings":"AAAG,IAAC,GAAG,GAAG;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M12.0355 1.96447L8.5 5.5L12.0354 9.03545L15.571 5.49991L12.0355 1.96447Z' stroke='%23CCCCCC' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M18.5355 8.46447L15 12L18.5354 15.5354L22.071 11.9999L18.5355 8.46447Z' stroke='%23CCCCCC' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M5.53553 8.46447L2 12L5.53544 15.5354L9.07098 11.9999L5.53553 8.46447Z' stroke='%23CCCCCC' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M12.0355 14.9645L8.5 18.5L12.0354 22.0354L15.571 18.4999L12.0355 14.9645Z' stroke='%23CCCCCC' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unitAttributeForbid.svg.js","sources":["../../../../src/assets/annotation/pointCloudTool/unitAttributeForbid.svg"],"sourcesContent":["var img = \"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M12.0355 1.96447L8.5 5.5L12.0354 9.03545L15.571 5.49991L12.0355 1.96447Z' stroke='%23CCCCCC' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M18.5355 8.46447L15 12L18.5354 15.5354L22.071 11.9999L18.5355 8.46447Z' stroke='%23CCCCCC' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M5.53553 8.46447L2 12L5.53544 15.5354L9.07098 11.9999L5.53553 8.46447Z' stroke='%23CCCCCC' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M12.0355 14.9645L8.5 18.5L12.0354 22.0354L15.571 18.4999L12.0355 14.9645Z' stroke='%23CCCCCC' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e\";\n export default img;"],"names":[],"mappings":"AAAG,IAAC,GAAG,GAAG;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M12.0355 1.96447L8.5 5.5L12.0354 9.03545L15.571 5.49991L12.0355 1.96447Z' stroke='%23666FFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M18.5355 8.46447L15 12L18.5354 15.5354L22.071 11.9999L18.5355 8.46447Z' stroke='%23666FFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M5.53553 8.46447L2 12L5.53544 15.5354L9.07098 11.9999L5.53553 8.46447Z' stroke='%23666FFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M12.0355 14.9645L8.5 18.5L12.0354 22.0354L15.571 18.4999L12.0355 14.9645Z' stroke='%23666FFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unitAttributeHover.svg.js","sources":["../../../../src/assets/annotation/pointCloudTool/unitAttributeHover.svg"],"sourcesContent":["var img = \"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M12.0355 1.96447L8.5 5.5L12.0354 9.03545L15.571 5.49991L12.0355 1.96447Z' stroke='%23666FFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M18.5355 8.46447L15 12L18.5354 15.5354L22.071 11.9999L18.5355 8.46447Z' stroke='%23666FFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M5.53553 8.46447L2 12L5.53544 15.5354L9.07098 11.9999L5.53553 8.46447Z' stroke='%23666FFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M12.0355 14.9645L8.5 18.5L12.0354 22.0354L15.571 18.4999L12.0355 14.9645Z' stroke='%23666FFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e\";\n export default img;"],"names":[],"mappings":"AAAG,IAAC,GAAG,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"react";import
|
|
1
|
+
import t from"react";import o from"../../../../assets/annotation/pointCloudTool/nodata.svg.js";import{getClassName as e}from"../../../../utils/dom.js";import{useTranslation as n}from"react-i18next";const m=()=>{const{t:a}=n();return t.createElement("div",{className:e("point-cloud-container","empty-page")},t.createElement("img",{src:o}),t.createElement("span",{className:e("point-cloud-container","empty-page","text")},a("NoData")))};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/pointCloudView/components/EmptyPage/index.tsx"],"sourcesContent":["/**\n * @file EmptyPage\n * @createDate 2022-08-31\n * @author Ron <ron.f.luo@gmail.com>\n */\nimport React from 'react';\nimport NoDataSvg from '@/assets/annotation/pointCloudTool/nodata.svg';\nimport { getClassName } from '@/utils/dom';\n\nconst EmptyPage = () => {\n return (\n <div className={getClassName('point-cloud-container', 'empty-page')}>\n <img src={NoDataSvg} />\n <span className={getClassName('point-cloud-container', 'empty-page', 'text')}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/pointCloudView/components/EmptyPage/index.tsx"],"sourcesContent":["/**\n * @file EmptyPage\n * @createDate 2022-08-31\n * @author Ron <ron.f.luo@gmail.com>\n */\nimport React from 'react';\nimport NoDataSvg from '@/assets/annotation/pointCloudTool/nodata.svg';\nimport { getClassName } from '@/utils/dom';\nimport { useTranslation } from 'react-i18next';\n\nconst EmptyPage = () => {\n const { t } = useTranslation();\n\n return (\n <div className={getClassName('point-cloud-container', 'empty-page')}>\n <img src={NoDataSvg} />\n <span className={getClassName('point-cloud-container', 'empty-page', 'text')}>\n {t('NoData')}\n </span>\n </div>\n );\n};\n\nexport default EmptyPage;\n"],"names":["NoDataSvg"],"mappings":";;;;;AAUA,MAAM,YAAY,MAAM;AACtB,EAAA,MAAM,CAAE,CAAM,CAAA,GAAA,cAAA,EAAA,CAAA;AAEd,EAAA,2CACG,KAAD,EAAA;AAAA,IAAK,SAAA,EAAW,aAAa,uBAAyB,EAAA,YAAA,CAAA;AAAA,GAAA,sCACnD,KAAD,EAAA;AAAA,IAAK,GAAK,EAAAA,GAAA;AAAA,GAAA,CAAA,sCACT,MAAD,EAAA;AAAA,IAAM,SAAA,EAAW,YAAa,CAAA,uBAAA,EAAyB,YAAc,EAAA,MAAA,CAAA;AAAA,GAAA,EAClE,CAAE,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA;AAAA;;;;"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { ESubmitType } from '../../../../constant/index.js';
|
|
2
|
+
import { ToSubmitFileData, BatchUpdateResultByTrackID } from '../../../../store/annotation/actionCreators.js';
|
|
3
|
+
import { LabelBeeContext, useDispatch } from '../../../../store/ctx.js';
|
|
4
|
+
import { Form, Modal, InputNumber, Select, Popover, message } from 'antd';
|
|
5
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
8
|
+
import { PointCloudUtils } from '@labelbee/lb-utils';
|
|
9
|
+
import { connect } from 'react-redux';
|
|
10
|
+
import { useSingleBox } from '../../hooks/useSingleBox.js';
|
|
11
|
+
import { MathUtils } from '@labelbee/lb-annotation';
|
|
12
|
+
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __defProps = Object.defineProperties;
|
|
15
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
16
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
17
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
19
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value;
|
|
20
|
+
var __spreadValues = (a, b) => {
|
|
21
|
+
for (var prop in b || (b = {}))
|
|
22
|
+
if (__hasOwnProp.call(b, prop))
|
|
23
|
+
__defNormalProp(a, prop, b[prop]);
|
|
24
|
+
if (__getOwnPropSymbols)
|
|
25
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
26
|
+
if (__propIsEnum.call(b, prop))
|
|
27
|
+
__defNormalProp(a, prop, b[prop]);
|
|
28
|
+
}
|
|
29
|
+
return a;
|
|
30
|
+
};
|
|
31
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
32
|
+
const layout = {
|
|
33
|
+
labelCol: {span: 8},
|
|
34
|
+
wrapperCol: {span: 16}
|
|
35
|
+
};
|
|
36
|
+
const defaultNumberRules = [{required: true, message: "\u8BF7\u586B\u5199\u4E00\u4E2A\u6570\u5B57"}];
|
|
37
|
+
const defaultSelectedAttribute = [{required: true, message: "\u8BF7\u9009\u62E9\u4E3B\u5C5E\u6027"}];
|
|
38
|
+
const PrefixTag = ({text}) => {
|
|
39
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
40
|
+
style: {
|
|
41
|
+
borderRadius: "4px 0px 0px 4px",
|
|
42
|
+
padding: "0px 12px",
|
|
43
|
+
background: "#FAFAFA",
|
|
44
|
+
border: "1px solid rgb(217 217 217)",
|
|
45
|
+
borderRight: "0",
|
|
46
|
+
display: "flex",
|
|
47
|
+
alignItems: "center",
|
|
48
|
+
height: 32
|
|
49
|
+
}
|
|
50
|
+
}, text);
|
|
51
|
+
};
|
|
52
|
+
const UnifiedParamsModal = ({id, visible, onCancel, config, imgList, imgIndex}) => {
|
|
53
|
+
const dispatch = useDispatch();
|
|
54
|
+
const {selectedBox} = useSingleBox();
|
|
55
|
+
const [size, setSize] = useState();
|
|
56
|
+
const [form] = Form.useForm();
|
|
57
|
+
const {t} = useTranslation();
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (visible === false) {
|
|
60
|
+
form.resetFields();
|
|
61
|
+
setSize(void 0);
|
|
62
|
+
}
|
|
63
|
+
}, [visible]);
|
|
64
|
+
const onFinish = (values) => {
|
|
65
|
+
var _a;
|
|
66
|
+
if (!id) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (!size) {
|
|
70
|
+
message.info("\u8BE5\u8303\u56F4\u4E0D\u5B58\u5728\u66F4\u6539\u6570\u636E, \u8BF7\u66F4\u6539\u7EDF\u4E00\u8303\u56F4");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
dispatch(ToSubmitFileData(ESubmitType.SyncImgList));
|
|
74
|
+
const newData = {
|
|
75
|
+
attribute: values.attribute
|
|
76
|
+
};
|
|
77
|
+
if (config.secondaryAttributeConfigurable) {
|
|
78
|
+
const newSubAttribute = {};
|
|
79
|
+
(_a = config.inputList) == null ? void 0 : _a.forEach((data) => {
|
|
80
|
+
const subData = values[data.value];
|
|
81
|
+
if (subData !== void 0) {
|
|
82
|
+
Object.assign(newSubAttribute, {[data.value]: subData});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
if (Object.keys(newSubAttribute).length > 0) {
|
|
86
|
+
Object.assign(newData, {subAttribute: newSubAttribute});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (size) {
|
|
90
|
+
Object.assign(newData, size);
|
|
91
|
+
}
|
|
92
|
+
dispatch(BatchUpdateResultByTrackID(id, newData, [values.prevPage - 1, values.nextPage - 1]));
|
|
93
|
+
onCancel();
|
|
94
|
+
};
|
|
95
|
+
const recalculateSize = useCallback(() => {
|
|
96
|
+
var _a;
|
|
97
|
+
const {prevPage, nextPage} = form.getFieldsValue(["prevPage", "nextPage"]);
|
|
98
|
+
const newImgList = imgList.filter((_, i) => MathUtils.isInRange(i, [prevPage - 1, nextPage - 1]));
|
|
99
|
+
if (!((newImgList == null ? void 0 : newImgList.length) > 0) || !(selectedBox == null ? void 0 : selectedBox.info) || ((_a = selectedBox == null ? void 0 : selectedBox.info) == null ? void 0 : _a.trackID) === void 0) {
|
|
100
|
+
setSize(void 0);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const newMaxSize = PointCloudUtils.getMaxSizeFromBox({
|
|
104
|
+
trackID: selectedBox.info.trackID,
|
|
105
|
+
imgList: newImgList
|
|
106
|
+
});
|
|
107
|
+
setSize(newMaxSize);
|
|
108
|
+
}, [imgList, selectedBox, imgIndex]);
|
|
109
|
+
const onOk = () => form.submit();
|
|
110
|
+
const sizeShow = () => {
|
|
111
|
+
if (!size || !(selectedBox == null ? void 0 : selectedBox.info)) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const style = {marginRight: 16};
|
|
115
|
+
const {length, width, height} = PointCloudUtils.transferBox2Kitti(__spreadValues(__spreadValues({}, selectedBox == null ? void 0 : selectedBox.info), size));
|
|
116
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", {
|
|
117
|
+
style
|
|
118
|
+
}, t("Length"), ": ", length.toFixed(2)), /* @__PURE__ */ React.createElement("span", {
|
|
119
|
+
style
|
|
120
|
+
}, t("Width"), ": ", width.toFixed(2)), /* @__PURE__ */ React.createElement("span", {
|
|
121
|
+
style
|
|
122
|
+
}, t("Height"), ": ", height.toFixed(2)), /* @__PURE__ */ React.createElement(Popover, {
|
|
123
|
+
placement: "rightBottom",
|
|
124
|
+
content: "\u7EDF\u4E00\u5C3A\u5BF8\u4E3A\u8BE5ID\u7684\u6240\u6709\u6807\u6CE8\u6846\u4E2D\u6700\u5927\u7684\u5C3A\u5BF8"
|
|
125
|
+
}, /* @__PURE__ */ React.createElement(QuestionCircleOutlined, null)));
|
|
126
|
+
};
|
|
127
|
+
const selectStyle = {
|
|
128
|
+
width: "200px"
|
|
129
|
+
};
|
|
130
|
+
const attributeStyle = {
|
|
131
|
+
marginBottom: "24px",
|
|
132
|
+
display: "flex",
|
|
133
|
+
alignItems: "center"
|
|
134
|
+
};
|
|
135
|
+
return /* @__PURE__ */ React.createElement(Modal, {
|
|
136
|
+
title: t("UnifiedParams"),
|
|
137
|
+
visible,
|
|
138
|
+
onCancel,
|
|
139
|
+
onOk,
|
|
140
|
+
wrapClassName: "labelbee-custom-modal"
|
|
141
|
+
}, /* @__PURE__ */ React.createElement(Form, __spreadProps(__spreadValues({}, layout), {
|
|
142
|
+
form,
|
|
143
|
+
onFinish
|
|
144
|
+
}), /* @__PURE__ */ React.createElement(Form.Item, {
|
|
145
|
+
name: "id",
|
|
146
|
+
label: t("CurrentBoxTrackIDs")
|
|
147
|
+
}, id), /* @__PURE__ */ React.createElement(Form.Item, {
|
|
148
|
+
label: t("UnifiedTrackIDRange"),
|
|
149
|
+
required: true
|
|
150
|
+
}, /* @__PURE__ */ React.createElement(Form.Item, {
|
|
151
|
+
style: {display: "inline-block"},
|
|
152
|
+
rules: defaultNumberRules,
|
|
153
|
+
name: "prevPage",
|
|
154
|
+
noStyle: true
|
|
155
|
+
}, /* @__PURE__ */ React.createElement(InputNumber, {
|
|
156
|
+
min: 1,
|
|
157
|
+
style: {width: "80px"},
|
|
158
|
+
onChange: () => recalculateSize()
|
|
159
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
160
|
+
style: {
|
|
161
|
+
display: "inline-block",
|
|
162
|
+
width: "24px",
|
|
163
|
+
textAlign: "center"
|
|
164
|
+
}
|
|
165
|
+
}, "-"), /* @__PURE__ */ React.createElement(Form.Item, {
|
|
166
|
+
style: {display: "inline-block"},
|
|
167
|
+
rules: defaultNumberRules,
|
|
168
|
+
name: "nextPage",
|
|
169
|
+
noStyle: true
|
|
170
|
+
}, /* @__PURE__ */ React.createElement(InputNumber, {
|
|
171
|
+
min: 1,
|
|
172
|
+
style: {width: "80px"},
|
|
173
|
+
onChange: () => recalculateSize()
|
|
174
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
175
|
+
style: {
|
|
176
|
+
display: "inline-block",
|
|
177
|
+
width: "40x",
|
|
178
|
+
marginLeft: "10px",
|
|
179
|
+
textAlign: "center"
|
|
180
|
+
}
|
|
181
|
+
}, t("Page"))), /* @__PURE__ */ React.createElement(Form.Item, {
|
|
182
|
+
name: "UnifiedSize",
|
|
183
|
+
label: t("UnifiedSize")
|
|
184
|
+
}, sizeShow()), /* @__PURE__ */ React.createElement(Form.Item, {
|
|
185
|
+
label: t("UnifiedTag"),
|
|
186
|
+
required: true
|
|
187
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
188
|
+
style: attributeStyle
|
|
189
|
+
}, /* @__PURE__ */ React.createElement(PrefixTag, {
|
|
190
|
+
text: t("Attribute")
|
|
191
|
+
}), /* @__PURE__ */ React.createElement(Form.Item, {
|
|
192
|
+
name: "attribute",
|
|
193
|
+
noStyle: true,
|
|
194
|
+
rules: defaultSelectedAttribute
|
|
195
|
+
}, /* @__PURE__ */ React.createElement(Select, {
|
|
196
|
+
style: selectStyle
|
|
197
|
+
}, config.attributeList.map((v) => /* @__PURE__ */ React.createElement(Select.Option, {
|
|
198
|
+
key: v.value,
|
|
199
|
+
value: v.value
|
|
200
|
+
}, v.key))))), config.secondaryAttributeConfigurable && config.inputList.map((v) => {
|
|
201
|
+
var _a;
|
|
202
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
203
|
+
key: v.value,
|
|
204
|
+
style: attributeStyle
|
|
205
|
+
}, /* @__PURE__ */ React.createElement(PrefixTag, {
|
|
206
|
+
text: v.key
|
|
207
|
+
}), /* @__PURE__ */ React.createElement(Form.Item, {
|
|
208
|
+
name: v.value,
|
|
209
|
+
noStyle: true,
|
|
210
|
+
required: false
|
|
211
|
+
}, /* @__PURE__ */ React.createElement(Select, {
|
|
212
|
+
style: selectStyle
|
|
213
|
+
}, (_a = v.subSelected) == null ? void 0 : _a.map((subData) => /* @__PURE__ */ React.createElement(Select.Option, {
|
|
214
|
+
key: subData.value,
|
|
215
|
+
value: subData.value
|
|
216
|
+
}, subData.key)))));
|
|
217
|
+
}))));
|
|
218
|
+
};
|
|
219
|
+
const mapStateToProps = (state) => {
|
|
220
|
+
return {
|
|
221
|
+
imgList: state.annotation.imgList,
|
|
222
|
+
imgIndex: state.annotation.imgIndex
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
var UnifiedParamsModal$1 = connect(mapStateToProps, null, null, {context: LabelBeeContext})(UnifiedParamsModal);
|
|
226
|
+
|
|
227
|
+
export { UnifiedParamsModal$1 as default };
|
|
228
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/pointCloudView/components/UnifiedParamsModal/index.tsx"],"sourcesContent":["import { ESubmitType } from '@/constant';\nimport { BatchUpdateResultByTrackID, ToSubmitFileData } from '@/store/annotation/actionCreators';\nimport { LabelBeeContext, useDispatch } from '@/store/ctx';\nimport { Form, InputNumber, message, Modal, Popover, Select } from 'antd';\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { QuestionCircleOutlined } from '@ant-design/icons';\nimport { IPointCloudConfig, PointCloudUtils } from '@labelbee/lb-utils';\nimport { connect } from 'react-redux';\nimport { AppState } from '@/store';\nimport { AnnotationFileList } from '@/types/data';\nimport { useSingleBox } from '../../hooks/useSingleBox';\nimport { MathUtils } from '@labelbee/lb-annotation';\n\ninterface IProps {\n id?: number;\n visible: boolean;\n onCancel: () => void;\n config: IPointCloudConfig;\n imgList: AnnotationFileList;\n imgIndex: number;\n}\n\nconst layout = {\n labelCol: { span: 8 },\n wrapperCol: { span: 16 },\n};\n\nconst defaultNumberRules = [{ required: true, message: '请填写一个数字' }];\nconst defaultSelectedAttribute = [{ required: true, message: '请选择主属性' }];\nconst DECIMAL_PLACES = 2;\n\nconst PrefixTag: React.FC<{ text: string }> = ({ text }) => {\n return (\n <span\n style={{\n borderRadius: '4px 0px 0px 4px',\n padding: '0px 12px',\n background: '#FAFAFA',\n border: '1px solid rgb(217 217 217)',\n borderRight: '0',\n display: 'flex',\n alignItems: 'center',\n height: 32,\n }}\n >\n {text}\n </span>\n );\n};\n\nconst UnifiedParamsModal = ({ id, visible, onCancel, config, imgList, imgIndex }: IProps) => {\n const dispatch = useDispatch();\n const { selectedBox } = useSingleBox();\n const [size, setSize] = useState<{ width: number; height: number; depth: number }>();\n\n const [form] = Form.useForm();\n const { t } = useTranslation();\n\n useEffect(() => {\n if (visible === false) {\n // Clear All Data\n form.resetFields();\n setSize(undefined);\n }\n }, [visible]);\n\n const onFinish = (values: any) => {\n if (!id) {\n return;\n }\n\n if (!size) {\n message.info('该范围不存在更改数据, 请更改统一范围');\n return;\n }\n\n dispatch(ToSubmitFileData(ESubmitType.SyncImgList));\n const newData = {\n attribute: values.attribute,\n };\n\n if (config.secondaryAttributeConfigurable) {\n const newSubAttribute = {};\n config.inputList?.forEach((data) => {\n const subData = values[data.value];\n if (subData !== undefined) {\n Object.assign(newSubAttribute, { [data.value]: subData });\n }\n });\n\n if (Object.keys(newSubAttribute).length > 0) {\n Object.assign(newData, { subAttribute: newSubAttribute });\n }\n }\n\n if (size) {\n Object.assign(newData, size);\n }\n\n dispatch(BatchUpdateResultByTrackID(id, newData, [values.prevPage - 1, values.nextPage - 1]));\n onCancel();\n };\n\n const recalculateSize = useCallback(() => {\n const { prevPage, nextPage } = form.getFieldsValue(['prevPage', 'nextPage']);\n\n // 1. Filter the imgInfo in range.\n const newImgList = imgList.filter((_, i) =>\n MathUtils.isInRange(i, [prevPage - 1, nextPage - 1]),\n );\n\n if (\n !(newImgList?.length > 0) ||\n !selectedBox?.info ||\n selectedBox?.info?.trackID === undefined\n ) {\n setSize(undefined);\n return;\n }\n\n // 2. Get the Max Size of imgList\n const newMaxSize = PointCloudUtils.getMaxSizeFromBox({\n trackID: selectedBox.info.trackID,\n imgList: newImgList as Array<{ result: string }>,\n });\n\n setSize(newMaxSize);\n }, [imgList, selectedBox, imgIndex]);\n\n const onOk = () => form.submit();\n\n const sizeShow = () => {\n if (!size || !selectedBox?.info) {\n return;\n }\n const style = { marginRight: 16 };\n\n const { length, width, height } = PointCloudUtils.transferBox2Kitti({\n ...selectedBox?.info, // Just for the type check\n ...size,\n });\n\n return (\n <div>\n <span style={style}>\n {t('Length')}: {length.toFixed(2)}\n </span>\n <span style={style}>\n {t('Width')}: {width.toFixed(2)}\n </span>\n <span style={style}>\n {t('Height')}: {height.toFixed(2)}\n </span>\n <Popover placement='rightBottom' content='统一尺寸为该ID的所有标注框中最大的尺寸'>\n <QuestionCircleOutlined />\n </Popover>\n </div>\n );\n };\n const selectStyle = {\n width: '200px',\n };\n\n const attributeStyle = {\n marginBottom: '24px',\n display: 'flex',\n alignItems: 'center',\n };\n\n return (\n <Modal\n title={t('UnifiedParams')}\n visible={visible}\n onCancel={onCancel}\n onOk={onOk}\n wrapClassName='labelbee-custom-modal'\n >\n <Form {...layout} form={form} onFinish={onFinish}>\n <Form.Item name='id' label={t('CurrentBoxTrackIDs')}>\n {id}\n </Form.Item>\n\n <Form.Item label={t('UnifiedTrackIDRange')} required={true}>\n <Form.Item\n style={{ display: 'inline-block' }}\n rules={defaultNumberRules}\n name='prevPage'\n noStyle={true}\n >\n <InputNumber min={1} style={{ width: '80px' }} onChange={() => recalculateSize()} />\n </Form.Item>\n <span\n style={{\n display: 'inline-block',\n width: '24px',\n textAlign: 'center',\n }}\n >\n -\n </span>\n <Form.Item\n style={{ display: 'inline-block' }}\n rules={defaultNumberRules}\n name='nextPage'\n noStyle={true}\n >\n <InputNumber min={1} style={{ width: '80px' }} onChange={() => recalculateSize()} />\n </Form.Item>\n <span\n style={{\n display: 'inline-block',\n width: '40x',\n marginLeft: '10px',\n textAlign: 'center',\n }}\n >\n {t('Page')}\n </span>\n </Form.Item>\n\n <Form.Item name='UnifiedSize' label={t('UnifiedSize')}>\n {sizeShow()}\n </Form.Item>\n\n <Form.Item label={t('UnifiedTag')} required={true}>\n <div style={attributeStyle}>\n <PrefixTag text={t('Attribute')} />\n <Form.Item name='attribute' noStyle={true} rules={defaultSelectedAttribute}>\n <Select style={selectStyle}>\n {config.attributeList.map((v) => (\n <Select.Option key={v.value} value={v.value}>\n {v.key}\n </Select.Option>\n ))}\n </Select>\n </Form.Item>\n </div>\n {config.secondaryAttributeConfigurable &&\n config.inputList.map((v) => (\n <div key={v.value} style={attributeStyle}>\n <PrefixTag text={v.key} />\n <Form.Item name={v.value} noStyle={true} required={false}>\n <Select style={selectStyle}>\n {v.subSelected?.map((subData) => (\n <Select.Option key={subData.value} value={subData.value}>\n {subData.key}\n </Select.Option>\n ))}\n </Select>\n </Form.Item>\n </div>\n ))}\n </Form.Item>\n </Form>\n </Modal>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n return {\n imgList: state.annotation.imgList,\n imgIndex: state.annotation.imgIndex,\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(\n UnifiedParamsModal,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,MAAS,GAAA;AAAA,EACb,QAAA,EAAU,CAAE,IAAM,EAAA,CAAA,CAAA;AAAA,EAClB,UAAA,EAAY,CAAE,IAAM,EAAA,EAAA,CAAA;AAAA,CAAA,CAAA;AAGtB,MAAM,kBAAqB,GAAA,CAAC,CAAE,QAAA,EAAU,MAAM,OAAS,EAAA,4CAAA,CAAA,CAAA,CAAA;AACvD,MAAM,wBAA2B,GAAA,CAAC,CAAE,QAAA,EAAU,MAAM,OAAS,EAAA,sCAAA,CAAA,CAAA,CAAA;AAG7D,MAAM,SAAA,GAAwC,CAAC,CAAE,IAAW,CAAA,KAAA;AAC1D,EAAA,2CACG,MAAD,EAAA;AAAA,IACE,K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../constant/index.js";import{ToSubmitFileData as z,BatchUpdateResultByTrackID as R}from"../../../../store/annotation/actionCreators.js";import{LabelBeeContext as T,useDispatch as M}from"../../../../store/ctx.js";import{Form as u,Modal as q,InputNumber as F,Select as g,Popover as N,message as V}from"antd";import e,{useState as H,useEffect as K,useCallback as Q}from"react";import{useTranslation as W}from"react-i18next";import{QuestionCircleOutlined as $}from"@ant-design/icons";import{PointCloudUtils as _}from"@labelbee/lb-utils";import{connect as G}from"react-redux";import{useSingleBox as J}from"../../hooks/useSingleBox.js";import{MathUtils as X}from"@labelbee/lb-annotation";var Y=Object.defineProperty,Z=Object.defineProperties,ee=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,w=(r,n,a)=>n in r?Y(r,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[n]=a,v=(r,n)=>{for(var a in n||(n={}))te.call(n,a)&&w(r,a,n[a]);if(B)for(var a of B(n))re.call(n,a)&&w(r,a,n[a]);return r},ne=(r,n)=>Z(r,ee(n));const ae={labelCol:{span:8},wrapperCol:{span:16}},O=[{required:!0,message:"\u8BF7\u586B\u5199\u4E00\u4E2A\u6570\u5B57"}],le=[{required:!0,message:"\u8BF7\u9009\u62E9\u4E3B\u5C5E\u6027"}],h=2,k=({text:r})=>e.createElement("span",{style:{borderRadius:"4px 0px 0px 4px",padding:"0px 12px",background:"#FAFAFA",border:"1px solid rgb(217 217 217)",borderRight:"0",display:"flex",alignItems:"center",height:32}},r),ie=({id:r,visible:n,onCancel:a,config:m,imgList:y,imgIndex:A})=>{const P=M(),{selectedBox:i}=J(),[p,E]=H(),[d]=u.useForm(),{t:o}=W();K(()=>{n===!1?(d.resetFields(),E(void 0)):b()},[n]);const C=t=>{var s;if(!r)return;if(!p){V.info("\u8BE5\u8303\u56F4\u4E0D\u5B58\u5728\u66F4\u6539\u6570\u636E, \u8BF7\u66F4\u6539\u7EDF\u4E00\u8303\u56F4");return}P(z(L.SyncImgList));const l={attribute:t.attribute};if(m.secondaryAttributeConfigurable){const c={};(s=m.inputList)==null||s.forEach(f=>{const x=t[f.value];x!==void 0&&Object.assign(c,{[f.value]:x})}),Object.keys(c).length>0&&Object.assign(l,{subAttribute:c})}p&&Object.assign(l,p),P(R(r,l,[t.prevPage-1,t.nextPage-1])),a()},b=Q(()=>{var t;const{prevPage:s,nextPage:l}=d.getFieldsValue(["prevPage","nextPage"]),c=y.filter((x,U)=>X.isInRange(U,[s-1,l-1]));if(!((c==null?void 0:c.length)>0)||!(i==null?void 0:i.info)||((t=i==null?void 0:i.info)==null?void 0:t.trackID)===void 0){E(void 0);return}const f=_.getMaxSizeFromBox({trackID:i.info.trackID,imgList:c});E(f)},[y,i,A]),D=()=>d.submit(),j=()=>{if(!p||!(i==null?void 0:i.info))return;const t={marginRight:16},{length:s,width:l,height:c}=_.transferBox2Kitti(v(v({},i==null?void 0:i.info),p));return e.createElement("div",null,e.createElement("span",{style:t},o("Length"),": ",s.toFixed(h)),e.createElement("span",{style:t},o("Width"),": ",l.toFixed(h)),e.createElement("span",{style:t},o("Height"),": ",c.toFixed(h)),e.createElement(N,{placement:"rightBottom",content:"\u7EDF\u4E00\u5C3A\u5BF8\u4E3A\u8BE5ID\u7684\u6240\u6709\u6807\u6CE8\u6846\u4E2D\u6700\u5927\u7684\u5C3A\u5BF8"},e.createElement($,null)))},S={width:"200px"},I={marginBottom:"24px",display:"flex",alignItems:"center"};return e.createElement(q,{title:o("UnifyParams"),visible:n,onCancel:a,onOk:D,wrapClassName:"labelbee-custom-modal"},e.createElement(u,ne(v({},ae),{form:d,onFinish:C}),e.createElement(u.Item,{name:"id",label:o("UnifyTrackID")},r),e.createElement(u.Item,{label:o("UnifyAttributeRange"),required:!0},e.createElement(u.Item,{style:{display:"inline-block"},rules:O,name:"prevPage",noStyle:!0,initialValue:1},e.createElement(F,{precision:0,min:1,style:{width:"80px"},onChange:()=>b()})),e.createElement("span",{style:{display:"inline-block",width:"24px",textAlign:"center"}},"-"),e.createElement(u.Item,{style:{display:"inline-block"},rules:O,name:"nextPage",noStyle:!0,initialValue:y.length},e.createElement(F,{precision:0,min:1,style:{width:"80px"},onChange:()=>b()})),e.createElement("span",{style:{display:"inline-block",width:"40x",marginLeft:"10px",textAlign:"center"}},o("Page"))),e.createElement(u.Item,{name:"UnifySize",label:o("UnifySize")},j()),e.createElement(u.Item,{label:o("UnifyTag"),required:!0},e.createElement("div",{style:I},e.createElement(k,{text:o("Attribute")}),e.createElement(u.Item,{name:"attribute",noStyle:!0,rules:le},e.createElement(g,{style:S},m.attributeList.map(t=>e.createElement(g.Option,{key:t.value,value:t.value},t.key))))),m.secondaryAttributeConfigurable&&m.inputList.map(t=>{var s;return e.createElement("div",{key:t.value,style:I},e.createElement(k,{text:t.key}),e.createElement(u.Item,{name:t.value,noStyle:!0,required:!1},e.createElement(g,{style:S},(s=t.subSelected)==null?void 0:s.map(l=>e.createElement(g.Option,{key:l.value,value:l.value},l.key)))))}))))},oe=r=>({imgIndex:r.annotation.imgIndex});var ue=G(oe,null,null,{context:T})(ie);export{ue as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/pointCloudView/components/UnifyParamsModal/index.tsx"],"sourcesContent":["import { ESubmitType } from '@/constant';\nimport { BatchUpdateResultByTrackID, ToSubmitFileData } from '@/store/annotation/actionCreators';\nimport { LabelBeeContext, useDispatch } from '@/store/ctx';\nimport { Form, InputNumber, message, Modal, Popover, Select } from 'antd';\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { QuestionCircleOutlined } from '@ant-design/icons';\nimport { IPointCloudConfig, PointCloudUtils } from '@labelbee/lb-utils';\nimport { connect } from 'react-redux';\nimport { AppState } from '@/store';\nimport { AnnotationFileList } from '@/types/data';\nimport { useSingleBox } from '../../hooks/useSingleBox';\nimport { MathUtils } from '@labelbee/lb-annotation';\n\ninterface IProps {\n id?: number;\n visible: boolean;\n onCancel: () => void;\n config: IPointCloudConfig;\n imgList: AnnotationFileList;\n imgIndex: number;\n}\n\nconst layout = {\n labelCol: { span: 8 },\n wrapperCol: { span: 16 },\n};\n\nconst defaultNumberRules = [{ required: true, message: '请填写一个数字' }];\nconst defaultSelectedAttribute = [{ required: true, message: '请选择主属性' }];\nconst DECIMAL_PLACES = 2;\n\nconst PrefixTag: React.FC<{ text: string }> = ({ text }) => {\n return (\n <span\n style={{\n borderRadius: '4px 0px 0px 4px',\n padding: '0px 12px',\n background: '#FAFAFA',\n border: '1px solid rgb(217 217 217)',\n borderRight: '0',\n display: 'flex',\n alignItems: 'center',\n height: 32,\n }}\n >\n {text}\n </span>\n );\n};\n\nconst UnifyParamsModal = ({ id, visible, onCancel, config, imgList, imgIndex }: IProps) => {\n const dispatch = useDispatch();\n const { selectedBox } = useSingleBox();\n const [size, setSize] = useState<{ width: number; height: number; depth: number }>();\n\n const [form] = Form.useForm();\n const { t } = useTranslation();\n\n useEffect(() => {\n if (visible === false) {\n // Clear All Data\n form.resetFields();\n setSize(undefined);\n } else {\n // Init\n recalculateSize();\n }\n }, [visible]);\n\n const onFinish = (values: any) => {\n if (!id) {\n return;\n }\n\n if (!size) {\n message.info('该范围不存在更改数据, 请更改统一范围');\n return;\n }\n\n dispatch(ToSubmitFileData(ESubmitType.SyncImgList));\n const newData = {\n attribute: values.attribute,\n };\n\n if (config.secondaryAttributeConfigurable) {\n const newSubAttribute = {};\n config.inputList?.forEach((data) => {\n const subData = values[data.value];\n if (subData !== undefined) {\n Object.assign(newSubAttribute, { [data.value]: subData });\n }\n });\n\n if (Object.keys(newSubAttribute).length > 0) {\n Object.assign(newData, { subAttribute: newSubAttribute });\n }\n }\n\n if (size) {\n Object.assign(newData, size);\n }\n\n dispatch(BatchUpdateResultByTrackID(id, newData, [values.prevPage - 1, values.nextPage - 1]));\n onCancel();\n };\n\n const recalculateSize = useCallback(() => {\n const { prevPage, nextPage } = form.getFieldsValue(['prevPage', 'nextPage']);\n\n // 1. Filter the imgInfo in range.\n const newImgList = imgList.filter((_, i) =>\n MathUtils.isInRange(i, [prevPage - 1, nextPage - 1]),\n );\n\n if (\n !(newImgList?.length > 0) ||\n !selectedBox?.info ||\n selectedBox?.info?.trackID === undefined\n ) {\n setSize(undefined);\n return;\n }\n\n // 2. Get the Max Size of imgList\n const newMaxSize = PointCloudUtils.getMaxSizeFromBox({\n trackID: selectedBox.info.trackID,\n imgList: newImgList as Array<{ result: string }>,\n });\n\n setSize(newMaxSize);\n }, [imgList, selectedBox, imgIndex]);\n\n const onOk = () => form.submit();\n\n const sizeShow = () => {\n if (!size || !selectedBox?.info) {\n return;\n }\n const style = { marginRight: 16 };\n\n const { length, width, height } = PointCloudUtils.transferBox2Kitti({\n ...selectedBox?.info, // Just for the type check\n ...size,\n });\n\n return (\n <div>\n <span style={style}>\n {t('Length')}: {length.toFixed(DECIMAL_PLACES)}\n </span>\n <span style={style}>\n {t('Width')}: {width.toFixed(DECIMAL_PLACES)}\n </span>\n <span style={style}>\n {t('Height')}: {height.toFixed(DECIMAL_PLACES)}\n </span>\n <Popover placement='rightBottom' content='统一尺寸为该ID的所有标注框中最大的尺寸'>\n <QuestionCircleOutlined />\n </Popover>\n </div>\n );\n };\n const selectStyle = {\n width: '200px',\n };\n\n const attributeStyle = {\n marginBottom: '24px',\n display: 'flex',\n alignItems: 'center',\n };\n\n return (\n <Modal\n title={t('UnifyParams')}\n visible={visible}\n onCancel={onCancel}\n onOk={onOk}\n wrapClassName='labelbee-custom-modal'\n >\n <Form {...layout} form={form} onFinish={onFinish}>\n <Form.Item name='id' label={t('UnifyTrackID')}>\n {id}\n </Form.Item>\n\n <Form.Item label={t('UnifyAttributeRange')} required={true}>\n <Form.Item\n style={{ display: 'inline-block' }}\n rules={defaultNumberRules}\n name='prevPage'\n noStyle={true}\n initialValue={1} // First Page \n >\n <InputNumber\n precision={0}\n min={1}\n style={{ width: '80px' }}\n onChange={() => recalculateSize()}\n />\n </Form.Item>\n <span\n style={{\n display: 'inline-block',\n width: '24px',\n textAlign: 'center',\n }}\n >\n -\n </span>\n <Form.Item\n style={{ display: 'inline-block' }}\n rules={defaultNumberRules}\n name='nextPage'\n noStyle={true}\n initialValue={imgList.length} // Last Page \n >\n <InputNumber\n precision={0}\n min={1}\n style={{ width: '80px' }}\n onChange={() => recalculateSize()}\n />\n </Form.Item>\n <span\n style={{\n display: 'inline-block',\n width: '40x',\n marginLeft: '10px',\n textAlign: 'center',\n }}\n >\n {t('Page')}\n </span>\n </Form.Item>\n\n <Form.Item name='UnifySize' label={t('UnifySize')}>\n {sizeShow()}\n </Form.Item>\n\n <Form.Item label={t('UnifyTag')} required={true}>\n <div style={attributeStyle}>\n <PrefixTag text={t('Attribute')} />\n <Form.Item name='attribute' noStyle={true} rules={defaultSelectedAttribute}>\n <Select style={selectStyle}>\n {config.attributeList.map((v) => (\n <Select.Option key={v.value} value={v.value}>\n {v.key}\n </Select.Option>\n ))}\n </Select>\n </Form.Item>\n </div>\n {config.secondaryAttributeConfigurable &&\n config.inputList.map((v) => (\n <div key={v.value} style={attributeStyle}>\n <PrefixTag text={v.key} />\n <Form.Item name={v.value} noStyle={true} required={false}>\n <Select style={selectStyle}>\n {v.subSelected?.map((subData) => (\n <Select.Option key={subData.value} value={subData.value}>\n {subData.key}\n </Select.Option>\n ))}\n </Select>\n </Form.Item>\n </div>\n ))}\n </Form.Item>\n </Form>\n </Modal>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n return {\n imgIndex: state.annotation.imgIndex,\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(UnifyParamsModal);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAM,MAAS,GAAA;AAAA,EACb,QAAA,EAAU,CAAE,IAAM,EAAA,CAAA,CAAA;AAAA,EAClB,UAAA,EAAY,CAAE,IAAM,EAAA,EAAA,CAAA;AAAA,CAAA,CAAA;AAGtB,MAAM,kB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CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAajC,MAAM,eAAA,GAAkB,CAAC,KAAoB,KAAA;AAC3C,EAAO,OAAA;AAAA,IACL,QAAA,EAAU,MAAM,UAAW,CAAA,QAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAI/B,yBAAe,QAAQ,eAAiB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAAmB,CAAA,CAAA,CAAA,gBAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useContext as p,useState as s,useEffect as b}from"react";import{PointCloudContext as c}from"../PointCloudContext.js";const C=()=>{var o,n;const{topViewInstance:t,sideViewInstance:i,backViewInstance:u,mainViewInstance:l}=p(c),[r,a]=s((n=(o=t==null?void 0:t.pointCloud2dOperation)==null?void 0:o.defaultAttribute)!=null?n:"");return b(()=>{if(!(t==null?void 0:t.pointCloud2dOperation))return;const e=()=>{a(t==null?void 0:t.pointCloud2dOperation.defaultAttribute)};return t==null||t.pointCloud2dOperation.on("changeAttributeSidebar",e),()=>{t==null||t.pointCloud2dOperation.unbind("changeAttributeSidebar",e)}},[t==null?void 0:t.pointCloud2dOperation]),{syncThreeViewsAttribute:e=>{[t==null?void 0:t.pointCloud2dOperation,i==null?void 0:i.pointCloud2dOperation,u==null?void 0:u.pointCloud2dOperation].forEach(d=>{d==null||d.setDefaultAttribute(e)})},updateDefaultAttribute:e=>{t==null||t.pointCloud2dOperation.setDefaultAttribute(e)},reRenderPointCloud3DBox:e=>{l==null||l.generateBox(e)},defaultAttribute:r}};export{C as useAttribute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAttribute.js","sources":["../../../../src/components/pointCloudView/hooks/useAttribute.ts"],"sourcesContent":["import { IPointCloudBox } from '@labelbee/lb-utils';\nimport { useContext, useEffect, useState } from 'react';\nimport { PointCloudContext } from '../PointCloudContext';\n\nexport const useAttribute = () => {\n const { topViewInstance, sideViewInstance, backViewInstance, mainViewInstance } =\n useContext(PointCloudContext);\n const [defaultAttribute, setDefaultAttribute] = useState(\n topViewInstance?.pointCloud2dOperation?.defaultAttribute ?? '',\n );\n\n useEffect(() => {\n if (!topViewInstance?.pointCloud2dOperation) {\n return;\n }\n\n const updateDefaultAttribute = () => {\n setDefaultAttribute(topViewInstance?.pointCloud2dOperation.defaultAttribute);\n };\n\n topViewInstance?.pointCloud2dOperation.on('changeAttributeSidebar', updateDefaultAttribute);\n\n return () => {\n topViewInstance?.pointCloud2dOperation.unbind(\n 'changeAttributeSidebar',\n updateDefaultAttribute,\n );\n };\n }, [topViewInstance?.pointCloud2dOperation]);\n\n const syncThreeViewsAttribute = (attribute?: string) => {\n [\n topViewInstance?.pointCloud2dOperation,\n sideViewInstance?.pointCloud2dOperation,\n backViewInstance?.pointCloud2dOperation,\n ].forEach((instance) => {\n instance?.setDefaultAttribute(attribute);\n });\n };\n\n const updateDefaultAttribute = (attribute?: string) => {\n topViewInstance?.pointCloud2dOperation.setDefaultAttribute(attribute);\n };\n\n const reRenderPointCloud3DBox = (newBox: IPointCloudBox) => {\n mainViewInstance?.generateBox(newBox);\n };\n\n return {\n syncThreeViewsAttribute,\n updateDefaultAttribute,\n reRenderPointCloud3DBox,\n defaultAttribute,\n };\n};\n"],"names":[],"mappings":";;;AAIO,MAAM,eAAe,MAAM;AAJlC,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AAKE,EAAA,MAAM,CAAE,eAAA,EAAiB,gBAAkB,EAAA,gBAAA,EAAkB,oBAC3D,UAAW,CAAA,iBAAA,CAAA,CAAA;AACb,EAAM,MAAA,CAAC,kBAAkB,mBAAuB,CAAA,GAAA,QAAA,CAC9C,+DAAiB,qBAAjB,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAwC,qBAAxC,IAA4D,GAAA,EAAA,GAAA,EAAA,CAAA,CAA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AoB,CAAA,SAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAG7D,EAAM,MAAA,uBAAA,GAA0B,CAAC,MAA2B,KAAA;AAC1D,IAAA,gBAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,gBAAA,CAAkB,WAAY,CAAA,MAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAGhC,EAAO,OAAA;AAAA,IACL,uBAAA;AAAA,IACA,sBAAA;AAAA,IACA,uBAAA;AAAA,IACA,gBAAA;AAAA,GAAA,CAAA;AAAA;;;;"}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import StepUtils from '../../../utils/StepUtils.js';
|
|
1
|
+
import { PointCloudContext } from '../PointCloudContext.js';
|
|
2
|
+
import { useContext } from 'react';
|
|
4
3
|
|
|
5
4
|
const useConfig = () => {
|
|
6
|
-
const {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
5
|
+
const {topViewInstance, sideViewInstance, backViewInstance, mainViewInstance} = useContext(PointCloudContext);
|
|
6
|
+
const syncAllViewsConfig = (config) => {
|
|
7
|
+
[topViewInstance, sideViewInstance, backViewInstance].forEach((instance) => {
|
|
8
|
+
instance == null ? void 0 : instance.updateConfig(config);
|
|
9
|
+
});
|
|
10
|
+
mainViewInstance == null ? void 0 : mainViewInstance.setConfig(config);
|
|
11
|
+
};
|
|
12
|
+
const reRenderTopViewRange = (radius) => {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
(_b = (_a = topViewInstance == null ? void 0 : topViewInstance.pointCloudInstance) == null ? void 0 : _a.generateRange) == null ? void 0 : _b.call(_a, radius);
|
|
15
|
+
(_c = topViewInstance == null ? void 0 : topViewInstance.pointCloudInstance) == null ? void 0 : _c.render();
|
|
16
|
+
};
|
|
13
17
|
return {
|
|
14
|
-
|
|
18
|
+
syncAllViewsConfig,
|
|
19
|
+
reRenderTopViewRange
|
|
15
20
|
};
|
|
16
21
|
};
|
|
17
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConfig.js","sources":["../../../../src/components/pointCloudView/hooks/useConfig.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"useConfig.js","sources":["../../../../src/components/pointCloudView/hooks/useConfig.ts"],"sourcesContent":["import { PointCloudContext } from '../PointCloudContext';\nimport { useContext } from 'react';\nimport { IPointCloudConfig } from '@labelbee/lb-utils';\n\nexport const useConfig = () => {\n const { topViewInstance, sideViewInstance, backViewInstance, mainViewInstance } =\n useContext(PointCloudContext);\n\n const syncAllViewsConfig = (config: IPointCloudConfig) => {\n [topViewInstance, sideViewInstance, backViewInstance].forEach((instance) => {\n instance?.updateConfig(config);\n });\n mainViewInstance?.setConfig(config);\n };\n \n const reRenderTopViewRange = (radius: number) => {\n topViewInstance?.pointCloudInstance?.generateRange?.(radius);\n topViewInstance?.pointCloudInstance?.render();\n }\n\n return {\n syncAllViewsConfig,\n reRenderTopViewRange,\n };\n};\n"],"names":[],"mappings":";;;AAIO,MAAM,YAAY,MAAM;AAC7B,EAAA,MAAM,CAAE,eAAA,EAAiB,gBAAkB,EAAA,gBAAA,EAAkB,oBAC3D,UAAW,CAAA,iBAAA,CAAA,CAAA;AAEb,EAAM,MAAA,kBAAA,GAAqB,CAAC,MAA8B,KAAA;AACxD,IAAA,CAAC,eAAiB,EAAA,gBAAA,EAAkB,gBAAkB,CAAA,CAAA,OAAA,CAAQ,CAAC,QAAa,KAAA;AAC1E,MAAA,QAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,QAAA,CAAU,YAAa,CAAA,MAAA,CAAA,CAAA;AAAA,KAAA,CAAA,CAAA;AAEzB,IAAA,gBAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,gBAAA,CAAkB,SAAU,CAAA,MAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAG9B,EAAM,MAAA,oBAAA,GAAuB,CAAC,MAAmB,KAAA;AAfnD,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAgBI,IAAiB,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,eAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,eAAA,CAAA,kBAAA,KAAjB,IAAqC,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,aAAA,KAArC,IAAqD,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,EAAA,MAAA,CAAA,CAAA;AACrD,IAAA,CAAA,EAAA,GAAA,eAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,eAAA,CAAiB,uBAAjB,IAAqC,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAA,EAAA,CAAA;AAAA,GAAA,CAAA;AAGvC,EAAO,OAAA;AAAA,IACL,kBAAA;AAAA,IACA,oBAAA;AAAA,GAAA,CAAA;AAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useContext as v}from"react";import{PointCloudContext as B}from"../PointCloudContext.js";var m=Object.defineProperty,f=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,L=(i,n,s)=>n in i?m(i,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[n]=s,w=(i,n)=>{for(var s in n||(n={}))O.call(n,s)&&L(i,s,n[s]);if(f)for(var s of f(n))H.call(n,s)&&L(i,s,n[s]);return i};const I=()=>{const{history:i,setPointCloudResult:n,setSelectedIDs:s,pointCloudBoxList:r,mainViewInstance:u,topViewInstance:p,polygonList:l,setPolygonList:a}=v(B),g=({newBoxParams:t,newPolygon:o})=>{const e={pointCloudBoxList:r,polygonList:l};t&&(e.pointCloudBoxList=r.concat(t)),o&&(e.polygonList=l.concat(o)),i.pushHistory(e)},C=t=>{const o={pointCloudBoxList:r,polygonList:l};t.pointCloudBoxList&&(o.pointCloudBoxList=t.pointCloudBoxList),t.polygonList&&(o.polygonList=t.polygonList),i.pushHistory(o)},P=t=>{l.find(e=>e.id===t.id)&&i.pushHistory({pointCloudBoxList:r,polygonList:l.map(e=>e.id===t.id?t:w({},e))})},h=({pointCloudBoxList:t,polygonList:o})=>{i.initRecord([{pointCloudBoxList:t,polygonList:o}],!0)},y=t=>{if(!t)return;const{pointCloudBoxList:o,polygonList:e}=t;if(o){r.length!==o.length&&s();const x=r.filter(d=>o.findIndex(c=>c.id===d.id)>=0),_=o.filter(d=>r.findIndex(c=>c.id!==d.id)>=0);x.forEach(d=>{u==null||u.removeObjectByName(d.id)}),_.forEach(d=>{u==null||u.generateBox(d)}),n(o)}e&&a(e),p==null||p.updatePolygonList(o!=null?o:[],e!=null?e:[])};return{addHistory:g,pushHistoryWithList:C,initHistory:h,pushHistoryUnderUpdatePolygon:P,redo:()=>{y(i.redo())},undo:()=>{y(i.undo())}}};export{I as useHistory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHistory.js","sources":["../../../../src/components/pointCloudView/hooks/useHistory.ts"],"sourcesContent":["import { IPointCloudBox, IPointCloudBoxList, IPolygonData } from '@labelbee/lb-utils';\nimport { useContext } from 'react';\nimport { PointCloudContext } from '../PointCloudContext';\n\nexport const useHistory = () => {\n const {\n history,\n setPointCloudResult,\n setSelectedIDs,\n pointCloudBoxList,\n mainViewInstance,\n topViewInstance,\n polygonList,\n setPolygonList,\n } = useContext(PointCloudContext);\n\n const addHistory = ({\n newBoxParams,\n newPolygon,\n }: {\n newBoxParams?: IPointCloudBox;\n newPolygon?: IPolygonData;\n }) => {\n const historyRecord = {\n pointCloudBoxList,\n polygonList,\n };\n\n if (newBoxParams) {\n historyRecord.pointCloudBoxList = pointCloudBoxList.concat(newBoxParams);\n }\n\n if (newPolygon) {\n historyRecord.polygonList = polygonList.concat(newPolygon);\n }\n\n history.pushHistory(historyRecord);\n };\n\n const pushHistoryWithList = (\n params: Partial<{\n pointCloudBoxList: IPointCloudBoxList;\n polygonList: IPolygonData[];\n }>,\n ) => {\n const historyRecord = {\n pointCloudBoxList,\n polygonList,\n };\n\n if (params.pointCloudBoxList) {\n historyRecord.pointCloudBoxList = params.pointCloudBoxList;\n }\n\n if (params.polygonList) {\n historyRecord.polygonList = params.polygonList;\n }\n\n history.pushHistory(historyRecord);\n };\n\n const pushHistoryUnderUpdatePolygon = (polygon: IPolygonData) => {\n const selectedPolygon = polygonList.find((v) => v.id === polygon.id);\n\n if (selectedPolygon) {\n history.pushHistory({\n pointCloudBoxList,\n polygonList: polygonList.map((v) => {\n if (v.id === polygon.id) {\n return polygon;\n }\n return {\n ...v,\n };\n }),\n });\n }\n };\n\n const initHistory = ({\n pointCloudBoxList,\n polygonList,\n }: {\n pointCloudBoxList: IPointCloudBoxList;\n polygonList: IPolygonData[];\n }) => {\n history.initRecord([{ pointCloudBoxList, polygonList }], true);\n };\n\n const updatePointCloud = (params?: {\n pointCloudBoxList: IPointCloudBoxList;\n polygonList: IPolygonData[];\n }) => {\n if (!params) {\n return;\n }\n\n const { pointCloudBoxList: newPointCloudBoxList, polygonList: newPolygonList } = params;\n\n if (newPointCloudBoxList) {\n if (pointCloudBoxList.length !== newPointCloudBoxList.length) {\n setSelectedIDs();\n }\n\n const deletePointCloudList = pointCloudBoxList.filter(\n (v) => newPointCloudBoxList.findIndex((d) => d.id === v.id) >= 0,\n );\n const addPointCloudList = newPointCloudBoxList.filter(\n (v) => pointCloudBoxList.findIndex((d) => d.id !== v.id) >= 0,\n );\n\n // Clear All Data\n deletePointCloudList.forEach((v) => {\n mainViewInstance?.removeObjectByName(v.id);\n });\n\n // Add Init Box\n addPointCloudList.forEach((v) => {\n mainViewInstance?.generateBox(v);\n });\n\n setPointCloudResult(newPointCloudBoxList);\n }\n\n if (newPolygonList) {\n setPolygonList(newPolygonList);\n }\n\n topViewInstance?.updatePolygonList(newPointCloudBoxList ?? [], newPolygonList ?? []);\n };\n\n const redo = () => {\n updatePointCloud(history.redo());\n };\n\n const undo = () => {\n updatePointCloud(history.und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AM,OAAO,MAAM;AACjB,IAAA,gBAAA,CAAiB,OAAQ,CAAA,IAAA,EAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAG3B,EAAO,OAAA;AAAA,IACL,UAAA;AAAA,IACA,mBAAA;AAAA,IACA,WAAA;AAAA,IACA,6BAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,GAAA,CAAA;AAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{store as L}from"../../../index.js";import{LabelBeeContext as N}from"../../../store/ctx.js";import{message as
|
|
1
|
+
import{store as L}from"../../../index.js";import{LabelBeeContext as N}from"../../../store/ctx.js";import{message as y}from"antd/es";import D from"lodash";import f,{useState as _,useRef as O,useEffect as a}from"react";import{connect as M}from"react-redux";import U from"../../../components/fileException/FileError.js";import Z from"../../../hooks/useSize.js";import{InitToolStyleConfig as k}from"../../../store/toolStyle/actionCreators.js";import{ImgUtils as B}from"@labelbee/lb-annotation";import{i18n as P}from"@labelbee/lb-utils";import F from"../../../utils/StepUtils.js";var T=Object.defineProperty,V=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,j=(n,o,r)=>o in n?T(n,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[o]=r,A=(n,o)=>{for(var r in o||(o={}))$.call(o,r)&&j(n,r,o[r]);if(E)for(var r of E(o))q.call(o,r)&&j(n,r,o[r]);return n},G=(n,o)=>V(n,Y(o));const H=n=>{const[,o]=_(0),{imgAttribute:r,toolStyle:l,toolInstance:e,annotationEngine:t,imgList:d,imgIndex:h,dataInjectionAtCreation:p,renderEnhance:g,customRenderStyle:u,stepList:v,step:w,drawLayerSlot:S}=n,[x,b]=_({zoom:1,currentPos:{x:0,y:0}}),I=O(null),C=O(null),c=Z(I);a(()=>{L.dispatch(k())},[]),a(()=>{if(!!t){switch(P.language){case"cn":case"en":t.setLang(P.language);break}t==null||t.setDataInjectionAtCreation(p),t==null||t.setRenderEnhance(g),u&&(t==null||t.setCustomRenderStyle(u))}},[t,p,g,u]),a(()=>{const i=(s,z)=>{b({zoom:s,currentPos:z})},m=s=>{b(s)};return e&&(e.singleOn("messageError",s=>{y.error(s)}),e.singleOn("messageInfo",s=>{y.info(s)}),e.singleOn("changeAnnotationShow",()=>{o(s=>s+1)}),e.on("renderZoom",i),e.on("dragMove",m)),()=>{e&&(e.unbind("renderZoom",i),e.unbind("dragMove",m))}},[e]),a(()=>{var i;(t==null?void 0:t.setImgAttribute)?t.setImgAttribute(r):(i=e==null?void 0:e.setImgAttribute)==null||i.call(e,r)},[r,t]),a(()=>{e&&e.setStyle(l),t&&t.setStyle(l)},[l]),a(()=>{(e==null?void 0:e.setSize)&&e.setSize(c),t&&t.setSize(c)},[c]),a(()=>{const i=F.getCurrentStepInfo(w,v);e==null||e.setConfig(i.config)},[v]);const R=()=>{const i=d==null?void 0:d[h];!(i==null?void 0:i.url)||B.load(i.url).then(m=>{t.setImgNode(m)})};return f.createElement("div",{ref:I,className:"annotationOperation"},f.createElement("div",{className:"canvas",ref:C,style:c,id:"toolContainer"},S==null?void 0:S(x)),(e==null?void 0:e.isImgError)===!0&&f.createElement(U,G(A({},c),{reloadImage:R,backgroundColor:"#e2e2e2",ignoreOffsetY:!0})))},J=n=>{const o=D.pickBy(n.annotation,(r,l)=>["imgList","imgIndex","stepList","step","toolInstance","annotationEngine","loading"].includes(l));return A({imgAttribute:n.imgAttribute,toolStyle:n.toolStyle},o)};var K=M(J,null,null,{context:N})(H);export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/views/MainView/annotationOperation/index.tsx"],"sourcesContent":["import { store } from '@/index';\nimport { LabelBeeContext } from '@/store/ctx';\nimport { message } from 'antd/es';\nimport _ from 'lodash';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { connect } from 'react-redux';\nimport { AppState } from 'src/store';\nimport { ImgAttributeState } from 'src/store/imgAttribute/types';\n\nimport { AppProps } from '@/App';\nimport FileError from '@/components/fileException/FileError';\nimport useSize from '@/hooks/useSize';\nimport { InitToolStyleConfig } from '@/store/toolStyle/actionCreators';\nimport { AnnotationEngine, ImgUtils } from '@labelbee/lb-annotation';\nimport { i18n } from '@labelbee/lb-utils';\nimport { IStepInfo } from '@/types/step';\nimport StepUtils from '@/utils/StepUtils';\n\ninterface IProps extends AppState, AppProps {\n imgAttribute: ImgAttributeState;\n imgIndex: number;\n annotationEngine: AnnotationEngine;\n loading: boolean;\n stepList: IStepInfo[];\n step: number;\n}\n\nconst AnnotationOperation: React.FC<IProps> = (props: IProps) => {\n const [, forceRender] = useState<number>(0);\n\n const {\n imgAttribute,\n toolStyle,\n toolInstance,\n annotationEngine,\n imgList,\n imgIndex,\n dataInjectionAtCreation,\n renderEnhance,\n customRenderStyle,\n stepList,\n step,\n drawLayerSlot,\n } = props;\n const [annotationPos, setAnnotationPos] = useState({ zoom: 1, currentPos: { x: 0, y: 0 } });\n const annotationRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const size = useSize(annotationRef);\n\n useEffect(() => {\n store.dispatch(InitToolStyleConfig());\n }, []);\n\n useEffect(() => {\n if (!annotationEngine) {\n return;\n }\n\n // 更改 toolInstance 内部国际化语言\n switch (i18n.language) {\n case 'cn':\n case 'en':\n annotationEngine.setLang(i18n.language);\n break;\n default: {\n //\n break;\n }\n }\n annotationEngine?.setDataInjectionAtCreation(dataInjectionAtCreation);\n annotationEngine?.setRenderEnhance(renderEnhance);\n if (customRenderStyle) {\n annotationEngine?.setCustomRenderStyle(customRenderStyle);\n }\n }, [annotationEngine, dataInjectionAtCreation, renderEnhance, customRenderStyle]);\n\n useEffect(() => {\n const renderZoom = (zoom: number, currentPos: { x: number; y: number }) => {\n setAnnotationPos({ zoom, currentPos });\n };\n\n const dragMove = (props: { currentPos: { x: number; y: number }; zoom: number }) => {\n setAnnotationPos(props);\n };\n\n if (toolInstance) {\n toolInstance.singleOn('messageError', (error: string) => {\n message.error(error);\n });\n\n toolInstance.singleOn('messageInfo', (info: string) => {\n message.info(info);\n });\n\n toolInstance.singleOn('changeAnnotationShow', () => {\n forceRender((s) => s + 1);\n });\n\n toolInstance.on('renderZoom', renderZoom);\n toolInstance.on('dragMove', dragMove);\n }\n\n return () => {\n if (toolInstance) {\n toolInstance.unbind('renderZoom', renderZoom);\n toolInstance.unbind('dragMove', dragMove);\n }\n };\n }, [toolInstance]);\n\n useEffect(() => {\n if (toolInstance) {\n toolInstance.setImgAttribute(imgAttribute);\n }\n }, [imgAttribute]);\n\n /** 样式同步 */\n useEffect(() => {\n if (toolInstance) {\n toolInstance.setStyle(toolStyle);\n }\n if (annotationEngine) {\n annotationEngine.setStyle(toolStyle);\n }\n }, [toolStyle]);\n\n /** 窗口大小监听 */\n useEffect(() => {\n if (toolInstance?.setSize) {\n toolInstance.setSize(size);\n }\n\n if (annotationEngine) {\n annotationEngine.setSize(size);\n }\n }, [size]);\n\n useEffect(() => {\n // Update StepList When it update by outside\n const currentStepInfo = StepUtils.getCurrentStepInfo(step, stepList);\n toolInstance?.setConfig(currentStepInfo.config);\n }, [stepList]);\n\n /**\n * 重新加载图片,避免网络问题导致的图片无法加载\n * @returns\n */\n const reloadImg = () => {\n const imgInfo = imgList?.[imgIndex];\n if (!imgInfo?.url) {\n return;\n }\n\n ImgUtils.load(imgInfo.url).then((imgNode) => {\n annotationEngine.setImgNode(imgNode as HTMLImageElement);\n });\n };\n\n return (\n <div ref={annotationRef} className='annotationOperation'>\n <div className='canvas' ref={containerRef} style={size} id='toolContainer'>\n {drawLayerSlot?.(annotationPos)}\n </div>\n {toolInstance?.isImgError === true && (\n <FileError\n {...size}\n reloadImage={reloadImg}\n backgroundColor='#e2e2e2'\n ignoreOffsetY={true}\n />\n )}\n </div>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n const annotationState = _.pickBy(state.annotation, (v, k) =>\n [\n 'imgList',\n 'imgIndex',\n 'stepList',\n 'step',\n 'toolInstance',\n 'annotationEngine',\n 'loading',\n ].includes(k),\n );\n return {\n imgAttribute: state.imgAttribute,\n toolStyle: state.toolStyle,\n ...annotationState,\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(\n AnnotationOperation,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,mBAAA,GAAwC,CAAC,KAAkB,KAAA;AAC/D,EAAM,MAAA,GAAG,WAAA,CAAA,GAAe,QAAiB,CAAA,CAAA,CAAA,CAAA;AAEzC,EAAM,MAAA;AAAA,IACJ,YAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,gBAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,uBAAA;AAAA,IACA,aAAA;AAAA,IACA,iBAAA;AAAA,IACA,QAAA;AAAA,IACA,IAAA;AAAA,IACA,aAAA;AAAA,GACE,GAAA,KAAA,CAAA;AACJ,EAAM,MAAA,CAAC,aAAe,EAAA,gBAAA,CAAA,GAAoB,QAAS,CAAA,CAAE,IAAM,EAAA,CAAA,EAAG,UAAY,EAAA,CAAE,CAAG,EAAA,CAAA,EAAG,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACrF,EAAA,MAAM,gBAAgB,MAAuB,CAAA,IAAA,CAAA,CAAA;AAC7C,EAAA,MAAM,eAAe,MAAuB,CAAA,IAAA,CAAA,CAAA;AAC5C,EAAA,MAAM,OAAO,OAAQ,CAAA,aAAA,CAAA,CAAA;AAErB,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,KAAA,CAAM,QAAS,CAAA,mBAAA,EAAA,CAAA,CAAA;AAAA,GACd,EAAA,EAAA,CAAA,CAAA;AAEH,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,gBAAkB,EAAA;AACrB,MAAA,OAAA;AAAA,KAAA;AAIF,IAAA,QAAQ,IAAK,CAAA,QAA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,EAAA,IAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAOzB,MAAM,eAAA,GAAkB,CAAC,KAAoB,KAAA;AAC3C,EAAA,MAAM,kBAAkB,CAAE,CAAA,MAAA,CAAO,MAAM,UAAY,EAAA,CAAC,GAAG,CACrD,KAAA;AAAA,IACE,SAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,MAAA;AAAA,IACA,cAAA;AAAA,IACA,kBAAA;AAAA,IACA,SAAA;AAAA,GAAA,CACA,QAAS,CAAA,CAAA,CAAA,CAAA,CAAA;AAEb,EAAO,OAAA,cAAA,CAAA;AAAA,IACL,cAAc,KAAM,CAAA,YAAA;AAAA,IACpB,WAAW,KAAM,CAAA,SAAA;AAAA,GACd,EAAA,eAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAIP,4BAAe,QAAQ,eAAiB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC7D,CAAA,CAAA,CAAA,mBAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/views/MainView/annotationOperation/index.tsx"],"sourcesContent":["import { store } from '@/index';\nimport { LabelBeeContext } from '@/store/ctx';\nimport { message } from 'antd/es';\nimport _ from 'lodash';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { connect } from 'react-redux';\nimport { AppState } from 'src/store';\nimport { ImgAttributeState } from 'src/store/imgAttribute/types';\n\nimport { AppProps } from '@/App';\nimport FileError from '@/components/fileException/FileError';\nimport useSize from '@/hooks/useSize';\nimport { InitToolStyleConfig } from '@/store/toolStyle/actionCreators';\nimport { AnnotationEngine, ImgUtils } from '@labelbee/lb-annotation';\nimport { i18n } from '@labelbee/lb-utils';\nimport { IStepInfo } from '@/types/step';\nimport StepUtils from '@/utils/StepUtils';\n\ninterface IProps extends AppState, AppProps {\n imgAttribute: ImgAttributeState;\n imgIndex: number;\n annotationEngine: AnnotationEngine;\n loading: boolean;\n stepList: IStepInfo[];\n step: number;\n}\n\nconst AnnotationOperation: React.FC<IProps> = (props: IProps) => {\n const [, forceRender] = useState<number>(0);\n\n const {\n imgAttribute,\n toolStyle,\n toolInstance,\n annotationEngine,\n imgList,\n imgIndex,\n dataInjectionAtCreation,\n renderEnhance,\n customRenderStyle,\n stepList,\n step,\n drawLayerSlot,\n } = props;\n const [annotationPos, setAnnotationPos] = useState({ zoom: 1, currentPos: { x: 0, y: 0 } });\n const annotationRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const size = useSize(annotationRef);\n\n useEffect(() => {\n store.dispatch(InitToolStyleConfig());\n }, []);\n\n useEffect(() => {\n if (!annotationEngine) {\n return;\n }\n\n // 更改 toolInstance 内部国际化语言\n switch (i18n.language) {\n case 'cn':\n case 'en':\n annotationEngine.setLang(i18n.language);\n break;\n default: {\n //\n break;\n }\n }\n annotationEngine?.setDataInjectionAtCreation(dataInjectionAtCreation);\n annotationEngine?.setRenderEnhance(renderEnhance);\n if (customRenderStyle) {\n annotationEngine?.setCustomRenderStyle(customRenderStyle);\n }\n }, [annotationEngine, dataInjectionAtCreation, renderEnhance, customRenderStyle]);\n\n useEffect(() => {\n const renderZoom = (zoom: number, currentPos: { x: number; y: number }) => {\n setAnnotationPos({ zoom, currentPos });\n };\n\n const dragMove = (props: { currentPos: { x: number; y: number }; zoom: number }) => {\n setAnnotationPos(props);\n };\n\n if (toolInstance) {\n toolInstance.singleOn('messageError', (error: string) => {\n message.error(error);\n });\n\n toolInstance.singleOn('messageInfo', (info: string) => {\n message.info(info);\n });\n\n toolInstance.singleOn('changeAnnotationShow', () => {\n forceRender((s) => s + 1);\n });\n\n toolInstance.on('renderZoom', renderZoom);\n toolInstance.on('dragMove', dragMove);\n }\n\n return () => {\n if (toolInstance) {\n toolInstance.unbind('renderZoom', renderZoom);\n toolInstance.unbind('dragMove', dragMove);\n }\n };\n }, [toolInstance]);\n\n useEffect(() => {\n if (annotationEngine?.setImgAttribute) {\n annotationEngine.setImgAttribute(imgAttribute);\n } else {\n // Old version.\n toolInstance?.setImgAttribute?.(imgAttribute);\n }\n }, [imgAttribute, annotationEngine]);\n\n /** 样式同步 */\n useEffect(() => {\n if (toolInstance) {\n toolInstance.setStyle(toolStyle);\n }\n if (annotationEngine) {\n annotationEngine.setStyle(toolStyle);\n }\n }, [toolStyle]);\n\n /** 窗口大小监听 */\n useEffect(() => {\n if (toolInstance?.setSize) {\n toolInstance.setSize(size);\n }\n\n if (annotationEngine) {\n annotationEngine.setSize(size);\n }\n }, [size]);\n\n useEffect(() => {\n // Update StepList When it update by outside\n const currentStepInfo = StepUtils.getCurrentStepInfo(step, stepList);\n toolInstance?.setConfig(currentStepInfo.config);\n }, [stepList]);\n\n /**\n * 重新加载图片,避免网络问题导致的图片无法加载\n * @returns\n */\n const reloadImg = () => {\n const imgInfo = imgList?.[imgIndex];\n if (!imgInfo?.url) {\n return;\n }\n\n ImgUtils.load(imgInfo.url).then((imgNode) => {\n annotationEngine.setImgNode(imgNode as HTMLImageElement);\n });\n };\n\n return (\n <div ref={annotationRef} className='annotationOperation'>\n <div className='canvas' ref={containerRef} style={size} id='toolContainer'>\n {drawLayerSlot?.(annotationPos)}\n </div>\n {toolInstance?.isImgError === true && (\n <FileError\n {...size}\n reloadImage={reloadImg}\n backgroundColor='#e2e2e2'\n ignoreOffsetY={true}\n />\n )}\n </div>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n const annotationState = _.pickBy(state.annotation, (v, k) =>\n [\n 'imgList',\n 'imgIndex',\n 'stepList',\n 'step',\n 'toolInstance',\n 'annotationEngine',\n 'loading',\n ].includes(k),\n );\n return {\n imgAttribute: state.imgAttribute,\n toolStyle: state.toolStyle,\n ...annotationState,\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(\n AnnotationOperation,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,mBAAA,GAAwC,CAAC,KA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,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAOzB,MAAM,eAAA,GAAkB,CAAC,KAAoB,KAAA;AAC3C,EAAA,MAAM,kBAAkB,CAAE,CAAA,MAAA,CAAO,MAAM,UAAY,EAAA,CAAC,GAAG,CACrD,KAAA;AAAA,IACE,SAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,MAAA;AAAA,IACA,cAAA;AAAA,IACA,kBAAA;AAAA,IACA,SAAA;AAAA,GAAA,CACA,QAAS,CAAA,CAAA,CAAA,CAAA,CAAA;AAEb,EAAO,OAAA,cAAA,CAAA;AAAA,IACL,cAAc,KAAM,CAAA,YAAA;AAAA,IACpB,WAAW,KAAM,CAAA,SAAA;AAAA,GACd,EAAA,eAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAIP,4BAAe,QAAQ,eAAiB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC7D,CAAA,CAAA,CAAA,mBAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import y from"../../../../assets/annotation/common/icon_clear.svg.js";import _ from"../../../../assets/annotation/common/icon_clear_a.svg.js";import S from"../../../../assets/annotation/common/icon_invalid.svg.js";import h from"../../../../assets/annotation/common/icon_invalid_a.svg.js";import{StopOutlined as a}from"@ant-design/icons";import{useTranslation as j}from"react-i18next";import s,{
|
|
1
|
+
import y from"../../../../assets/annotation/common/icon_clear.svg.js";import _ from"../../../../assets/annotation/common/icon_clear_a.svg.js";import S from"../../../../assets/annotation/common/icon_invalid.svg.js";import h from"../../../../assets/annotation/common/icon_invalid_a.svg.js";import{StopOutlined as a}from"@ant-design/icons";import{useTranslation as j}from"react-i18next";import s,{useState as O,useMemo as P}from"react";import{CopyBackWordResult as x}from"../../../../store/annotation/actionCreators.js";import{store as C}from"../../../../index.js";import{useSelector as k}from"../../../../store/ctx.js";var w=Object.defineProperty,m=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,c=(e,t,r)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,R=(e,t)=>{for(var r in t||(t={}))V.call(t,r)&&c(e,r,t[r]);if(m)for(var r of m(t))E.call(t,r)&&c(e,r,t[r]);return e};const b=e=>{const[t,r]=O(0),{t:o,i18n:l}=j(),{currentData:p}=k(i=>{const{imgList:g,imgIndex:d}=i.annotation;return{currentData:g[d]}}),n={height:"25px",lineHeight:"25px",display:"flex",justifyContent:"center",alignItems:"center"},u={name:o("ClearLabel"),key:"empty",imgSvg:y,hoverSvg:_,onClick:()=>{e==null||e.clearResult()}},v={name:o((e==null?void 0:e.valid)===!1?"SetAsValid":"SetAsInvalid"),key:"setValidity",imgSvg:s.createElement(a,{style:n}),hoverSvg:s.createElement(a,{style:R({color:"#666fff"},n)}),onClick:()=>{e.setValid(!e.valid),setTimeout(()=>{r(i=>i+1)})}},f={name:o("CopyThePrevious"),key:"copyPrevious",imgSvg:S,hoverSvg:h,onClick:()=>{C.dispatch(x())}};return P(()=>({empty:u,setValidity:v,copyPrevious:f}),[e,t,p,l.language])};export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BatchUpdateTrackID as _}from"../../../../../../store/annotation/actionCreators.js";import{composeResultByToolInstance as E}from"../../../../../../store/annotation/reducer.js";import{LabelBeeContext as w,useDispatch as h}from"../../../../../../store/ctx.js";import{Form as o,Modal as v,InputNumber as c}from"antd";import r,{useState as O}from"react";import{useTranslation as D}from"react-i18next";import{connect as k}from"react-redux";var C=Object.defineProperty,T=Object.defineProperties,B=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,d=(e,t,n)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))j.call(t,n)&&d(e,n,t[n]);if(u)for(var n of u(t))F.call(t,n)&&d(e,n,t[n]);return e},S=(e,t)=>T(e,B(t));const U={labelCol:{span:8},wrapperCol:{span:16}},m={width:"80px"},N=({id:e,stepList:t,imgList:n,imgIndex:f,toolInstance:y})=>{const g=h(),[I,l]=O(!1),[p]=o.useForm(),{t:a}=D(),b=i=>{g(_({id:e,newID:i.newID,rangeIndex:[i.prevPage-1,i.nextPage-1],imgList:E({toolInstance:y,imgList:n,imgIndex:f,stepList:t})})),l(!1)},x=()=>l(!1),P=()=>p.submit(),s=[{required:!0,message:a("PositiveIntegerCheck")}];return r.createElement(r.Fragment,null,r.createElement("a",{style:{color:"#666FFF"},onClick:()=>l(!0)},a("BatchUpdateText")),r.createElement(v,{title:a("BatchUpdateTrackID"),visible:I,onCancel:x,onOk:P,wrapClassName:"labelbee-custom-modal"},r.createElement(o,S(L({},U),{form:p,onFinish:b}),r.createElement(o.Item,{name:"id",label:a("CurrentBoxTrackIDs")},e),r.createElement(o.Item,{name:"newID",label:a("TrackIDUnifyAs"),rules:s},r.createElement(c,{precision:0,min:1,style:m})),r.createElement(o.Item,{label:a("UnifyTrackIDRange"),required:!0},r.createElement(o.Item,{style:{display:"inline-block"},rules:s,name:"prevPage",noStyle:!0},r.createElement(c,{precision:0,min:1,style:m})),r.createElement("span",{style:{display:"inline-block",width:"24px",textAlign:"center"}},"-"),r.createElement(o.Item,{style:{display:"inline-block"},rules:s,name:"nextPage",noStyle:!0},r.createElement(c,{precision:0,min:1,style:m})),r.createElement("span",{style:{display:"inline-block",width:"40x",marginLeft:"10px",textAlign:"center"}},a("Page"))))))},R=e=>({toolInstance:e.annotation.toolInstance,imgList:e.annotation.imgList,imgIndex:e.annotation.imgIndex,stepList:e.annotation.stepList});var A=k(R,null,null,{context:w})(N);export{A as default};
|
package/es/views/MainView/sidebar/PointCloudToolSidebar/components/batchUpdateModal/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../src/views/MainView/sidebar/PointCloudToolSidebar/components/batchUpdateModal/index.tsx"],"sourcesContent":["import { AppState } from '@/store';\nimport { BatchUpdateTrackID } from '@/store/annotation/actionCreators';\nimport { composeResultByToolInstance } from '@/store/annotation/reducer';\nimport { ToolInstance } from '@/store/annotation/types';\nimport { LabelBeeContext, useDispatch } from '@/store/ctx';\nimport { AnnotationFileList } from '@/types/data';\nimport { IStepInfo } from '@/types/step';\nimport { Form, InputNumber, Modal } from 'antd';\nimport React, { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { connect } from 'react-redux';\n\nconst layout = {\n labelCol: { span: 8 },\n wrapperCol: { span: 16 },\n};\n\n/**\n * 检查当前数字是否为有效数字\n * @param value\n * @param nonZero 是否包括 0\n * @returns\n */\nexport const isInvalidNumber = (value: any, nonZero = false) => {\n const intValue = Number(value);\n if (typeof value === 'undefined' || intValue < 0 || isNaN(intValue)) {\n return true;\n }\n if (nonZero === true && intValue === 0) {\n return true;\n }\n return false;\n};\n\ninterface IProps {\n id: number;\n toolInstance: ToolInstance;\n imgList: AnnotationFileList;\n imgIndex: number;\n stepList: IStepInfo[];\n}\n\nconst inputStyle = {\n width: '80px',\n};\n\nconst BatchUpdateModal = ({ id, stepList, imgList, imgIndex, toolInstance }: IProps) => {\n const dispatch = useDispatch();\n const [visible, setVisible] = useState(false);\n const [form] = Form.useForm();\n const { t } = useTranslation();\n\n const onFinish = (values: any) => {\n // New ImgList without UpdateData\n dispatch(\n BatchUpdateTrackID({\n id,\n newID: values.newID,\n rangeIndex: [values.prevPage - 1, values.nextPage - 1],\n // TODO: Not to submit result, just to compose result.\n imgList: composeResultByToolInstance({ toolInstance, imgList, imgIndex, stepList }),\n }),\n );\n setVisible(false);\n };\n\n const onCancel = () => setVisible(false);\n\n const onOk = () => form.submit();\n const defaultNumberRules = [{ required: true, message: t('PositiveIntegerCheck') }];\n\n return (\n <>\n <a style={{ color: '#666FFF' }} onClick={() => setVisible(true)}>\n {t('BatchUpdateText')}\n </a>\n <Modal\n title={t('BatchUpdateTrackID')}\n visible={visible}\n onCancel={onCancel}\n onOk={onOk}\n wrapClassName='labelbee-custom-modal'\n >\n <Form {...layout} form={form} onFinish={onFinish}>\n <Form.Item name='id' label={t('CurrentBoxTrackIDs')}>\n {id}\n </Form.Item>\n\n <Form.Item name='newID' label={t('TrackIDUnifyAs')} rules={defaultNumberRules}>\n <InputNumber precision={0} min={1} style={inputStyle} />\n </Form.Item>\n <Form.Item label={t('UnifyTrackIDRange')} required={true}>\n <Form.Item\n style={{ display: 'inline-block' }}\n rules={defaultNumberRules}\n name='prevPage'\n noStyle={true}\n >\n <InputNumber precision={0} min={1} style={inputStyle} />\n </Form.Item>\n <span\n style={{\n display: 'inline-block',\n width: '24px',\n textAlign: 'center',\n }}\n >\n -\n </span>\n <Form.Item\n style={{ display: 'inline-block' }}\n rules={defaultNumberRules}\n name='nextPage'\n noStyle={true}\n >\n <InputNumber precision={0} min={1} style={inputStyle} />\n </Form.Item>\n <span\n style={{\n display: 'inline-block',\n width: '40x',\n marginLeft: '10px',\n textAlign: 'center',\n }}\n >\n {t('Page')}\n </span>\n </Form.Item>\n </Form>\n </Modal>\n </>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n return {\n toolInstance: state.annotation.toolInstance,\n imgList: state.annotation.imgList,\n imgIndex: state.annotation.imgIndex,\n stepList: state.annotation.stepList,\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(BatchUpdateModal);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,MAAS,GAAA;AAAA,EACb,QAAA,EAAU,CAAE,IAAM,EAAA,CAAA,CAAA;AAAA,EAClB,UAAA,EAAY,CAAE,IAAM,EAAA,EAAA,CAAA;AAAA,CAAA,CAAA;AA4BtB,MAAM,UAAa,GAAA;AAAA,EACjB,KAAO,EAAA,MAAA;AAAA,CAAA,CAAA;AAGT,MAAM,mBAAmB,CAAC,CAAE,IAAI,QAAU,EAAA,OAAA,EAAS,UAAU,YAA2B,CAA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
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@ant-design/icons": "^4.6.2",
|
|
44
|
-
"@labelbee/lb-annotation": "^1.9.
|
|
45
|
-
"@labelbee/lb-utils": "^1.3.
|
|
44
|
+
"@labelbee/lb-annotation": "^1.9.1",
|
|
45
|
+
"@labelbee/lb-utils": "^1.3.2",
|
|
46
46
|
"ahooks": "^3.4.0",
|
|
47
47
|
"classnames": "^2.3.0",
|
|
48
48
|
"lodash": "^4.17.21",
|
|
@@ -96,6 +96,5 @@
|
|
|
96
96
|
"commitizen": {
|
|
97
97
|
"path": "node_modules/cz-conventional-changelog"
|
|
98
98
|
}
|
|
99
|
-
}
|
|
100
|
-
"gitHead": "f4aa456021fb60c76d994f350b38a7b6cc40ac75"
|
|
99
|
+
}
|
|
101
100
|
}
|
package/LICENSE
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
Copyright 2018-2023 OpenMMLab. All rights reserved.
|
|
2
|
-
|
|
3
|
-
Apache License
|
|
4
|
-
Version 2.0, January 2004
|
|
5
|
-
http://www.apache.org/licenses/
|
|
6
|
-
|
|
7
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
-
|
|
9
|
-
1. Definitions.
|
|
10
|
-
|
|
11
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
12
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
13
|
-
|
|
14
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
15
|
-
the copyright owner that is granting the License.
|
|
16
|
-
|
|
17
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
18
|
-
other entities that control, are controlled by, or are under common
|
|
19
|
-
control with that entity. For the purposes of this definition,
|
|
20
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
21
|
-
direction or management of such entity, whether by contract or
|
|
22
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
23
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
24
|
-
|
|
25
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
26
|
-
exercising permissions granted by this License.
|
|
27
|
-
|
|
28
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
29
|
-
including but not limited to software source code, documentation
|
|
30
|
-
source, and configuration files.
|
|
31
|
-
|
|
32
|
-
"Object" form shall mean any form resulting from mechanical
|
|
33
|
-
transformation or translation of a Source form, including but
|
|
34
|
-
not limited to compiled object code, generated documentation,
|
|
35
|
-
and conversions to other media types.
|
|
36
|
-
|
|
37
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
38
|
-
Object form, made available under the License, as indicated by a
|
|
39
|
-
copyright notice that is included in or attached to the work
|
|
40
|
-
(an example is provided in the Appendix below).
|
|
41
|
-
|
|
42
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
43
|
-
form, that is based on (or derived from) the Work and for which the
|
|
44
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
45
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
46
|
-
of this License, Derivative Works shall not include works that remain
|
|
47
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
48
|
-
the Work and Derivative Works thereof.
|
|
49
|
-
|
|
50
|
-
"Contribution" shall mean any work of authorship, including
|
|
51
|
-
the original version of the Work and any modifications or additions
|
|
52
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
53
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
54
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
55
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
56
|
-
means any form of electronic, verbal, or written communication sent
|
|
57
|
-
to the Licensor or its representatives, including but not limited to
|
|
58
|
-
communication on electronic mailing lists, source code control systems,
|
|
59
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
60
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
61
|
-
excluding communication that is conspicuously marked or otherwise
|
|
62
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
63
|
-
|
|
64
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
65
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
66
|
-
subsequently incorporated within the Work.
|
|
67
|
-
|
|
68
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
69
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
70
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
71
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
72
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
73
|
-
Work and such Derivative Works in Source or Object form.
|
|
74
|
-
|
|
75
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
76
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
77
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
78
|
-
(except as stated in this section) patent license to make, have made,
|
|
79
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
80
|
-
where such license applies only to those patent claims licensable
|
|
81
|
-
by such Contributor that are necessarily infringed by their
|
|
82
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
83
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
84
|
-
institute patent litigation against any entity (including a
|
|
85
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
86
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
87
|
-
or contributory patent infringement, then any patent licenses
|
|
88
|
-
granted to You under this License for that Work shall terminate
|
|
89
|
-
as of the date such litigation is filed.
|
|
90
|
-
|
|
91
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
92
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
93
|
-
modifications, and in Source or Object form, provided that You
|
|
94
|
-
meet the following conditions:
|
|
95
|
-
|
|
96
|
-
(a) You must give any other recipients of the Work or
|
|
97
|
-
Derivative Works a copy of this License; and
|
|
98
|
-
|
|
99
|
-
(b) You must cause any modified files to carry prominent notices
|
|
100
|
-
stating that You changed the files; and
|
|
101
|
-
|
|
102
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
103
|
-
that You distribute, all copyright, patent, trademark, and
|
|
104
|
-
attribution notices from the Source form of the Work,
|
|
105
|
-
excluding those notices that do not pertain to any part of
|
|
106
|
-
the Derivative Works; and
|
|
107
|
-
|
|
108
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
109
|
-
distribution, then any Derivative Works that You distribute must
|
|
110
|
-
include a readable copy of the attribution notices contained
|
|
111
|
-
within such NOTICE file, excluding those notices that do not
|
|
112
|
-
pertain to any part of the Derivative Works, in at least one
|
|
113
|
-
of the following places: within a NOTICE text file distributed
|
|
114
|
-
as part of the Derivative Works; within the Source form or
|
|
115
|
-
documentation, if provided along with the Derivative Works; or,
|
|
116
|
-
within a display generated by the Derivative Works, if and
|
|
117
|
-
wherever such third-party notices normally appear. The contents
|
|
118
|
-
of the NOTICE file are for informational purposes only and
|
|
119
|
-
do not modify the License. You may add Your own attribution
|
|
120
|
-
notices within Derivative Works that You distribute, alongside
|
|
121
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
122
|
-
that such additional attribution notices cannot be construed
|
|
123
|
-
as modifying the License.
|
|
124
|
-
|
|
125
|
-
You may add Your own copyright statement to Your modifications and
|
|
126
|
-
may provide additional or different license terms and conditions
|
|
127
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
128
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
129
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
130
|
-
the conditions stated in this License.
|
|
131
|
-
|
|
132
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
133
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
134
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
135
|
-
this License, without any additional terms or conditions.
|
|
136
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
137
|
-
the terms of any separate license agreement you may have executed
|
|
138
|
-
with Licensor regarding such Contributions.
|
|
139
|
-
|
|
140
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
141
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
142
|
-
except as required for reasonable and customary use in describing the
|
|
143
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
144
|
-
|
|
145
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
146
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
147
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
148
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
149
|
-
implied, including, without limitation, any warranties or conditions
|
|
150
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
151
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
152
|
-
appropriateness of using or redistributing the Work and assume any
|
|
153
|
-
risks associated with Your exercise of permissions under this License.
|
|
154
|
-
|
|
155
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
156
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
157
|
-
unless required by applicable law (such as deliberate and grossly
|
|
158
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
159
|
-
liable to You for damages, including any direct, indirect, special,
|
|
160
|
-
incidental, or consequential damages of any character arising as a
|
|
161
|
-
result of this License or out of the use or inability to use the
|
|
162
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
163
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
164
|
-
other commercial damages or losses), even if such Contributor
|
|
165
|
-
has been advised of the possibility of such damages.
|
|
166
|
-
|
|
167
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
168
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
169
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
170
|
-
or other liability obligations and/or rights consistent with this
|
|
171
|
-
License. However, in accepting such obligations, You may act only
|
|
172
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
173
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
174
|
-
defend, and hold each Contributor harmless for any liability
|
|
175
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
176
|
-
of your accepting any such warranty or additional liability.
|
|
177
|
-
|
|
178
|
-
END OF TERMS AND CONDITIONS
|
|
179
|
-
|
|
180
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
181
|
-
|
|
182
|
-
To apply the Apache License to your work, attach the following
|
|
183
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
184
|
-
replaced with your own identifying information. (Don't include
|
|
185
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
186
|
-
comment syntax for the file format. We also recommend that a
|
|
187
|
-
file or class name and description of purpose be included on the
|
|
188
|
-
same "printed page" as the copyright notice for easier
|
|
189
|
-
identification within third-party archives.
|
|
190
|
-
|
|
191
|
-
Copyright 2018-2023 OpenMMLab.
|
|
192
|
-
|
|
193
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
-
you may not use this file except in compliance with the License.
|
|
195
|
-
You may obtain a copy of the License at
|
|
196
|
-
|
|
197
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
-
|
|
199
|
-
Unless required by applicable law or agreed to in writing, software
|
|
200
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
-
See the License for the specific language governing permissions and
|
|
203
|
-
limitations under the License.
|