@labelbee/lb-components 1.23.0-alpha.7 → 1.23.0-alpha.70
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/App.js +1 -1
- package/dist/assets/annotation/icon_link.svg.js +1 -0
- package/dist/assets/annotation/icon_unlink.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
- package/dist/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
- package/dist/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
- package/dist/assets/icons/ad33251.svg +26 -0
- package/dist/components/AnnotationView/index.js +1 -1
- package/dist/components/LLMToolView/index.js +1 -1
- package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/index.js +1 -1
- package/dist/components/LLMToolView/utils/data.js +1 -1
- package/dist/components/NLPToolView/index.js +1 -1
- package/dist/components/audioAnnotate/audioContext/index.js +1 -1
- package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
- package/dist/components/audioAnnotate/index.js +1 -1
- package/dist/components/audioAnnotate/textInput/index.js +1 -1
- package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -1
- package/dist/components/audioAnnotate/utils/dataTransform.js +1 -0
- package/dist/components/audioPlayer/clipRegion/index.js +1 -1
- package/dist/components/audioPlayer/index.js +1 -1
- package/dist/components/audioPlayer/useAudioCombine/index.js +3 -2
- package/dist/components/audioPlayer/useAudioSegment/index.js +1 -1
- package/dist/components/longText/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
- package/dist/components/pointCloud2DRectOperationView/util.js +1 -0
- package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudContext.js +1 -1
- package/dist/components/pointCloudView/PointCloudInfos.js +1 -1
- package/dist/components/pointCloudView/PointCloudListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudSegment2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
- package/dist/components/pointCloudView/components/HighlightVisible/index.js +1 -1
- package/dist/components/pointCloudView/hooks/useBoxes.js +1 -1
- package/dist/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
- package/dist/components/pointCloudView/hooks/useHighlight.js +1 -1
- package/dist/components/pointCloudView/hooks/useHistory.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/pointCloudView/hooks/usePolygon.js +1 -1
- package/dist/components/pointCloudView/hooks/useRotate.js +1 -1
- package/dist/components/pointCloudView/hooks/useRotateEdge.js +1 -0
- package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -1
- package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
- package/dist/components/pointCloudView/hooks/useTimeoutFunc.js +1 -0
- package/dist/components/pointCloudView/hooks/useWindowKeydownListener.js +1 -0
- package/dist/components/pointCloudView/index.js +1 -1
- package/dist/components/pointCloudView/utils/event-polyfill.js +1 -0
- package/dist/components/pointCloudView/utils/map.js +1 -0
- package/dist/components/subAttributeList/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/index.js +1 -1
- package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
- package/dist/hooks/useToolStyle.js +1 -0
- package/dist/index.css +59 -17
- package/dist/index.js +1 -1
- package/dist/store/Actions.js +1 -1
- package/dist/store/annotatedBox/index.js +1 -1
- package/dist/store/annotation/actionCreators.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/types/App.d.ts +5 -1
- package/dist/types/components/AnnotationView/index.d.ts +1 -0
- package/dist/types/components/LLMToolView/utils/data.d.ts +1 -1
- package/dist/types/components/audioAnnotate/audioContext/index.d.ts +10 -2
- package/dist/types/components/audioAnnotate/textInput/index.d.ts +1 -0
- package/dist/types/components/audioAnnotate/utils/dataTransform.d.ts +9 -0
- package/dist/types/components/audioPlayer/index.d.ts +28 -21
- package/dist/types/components/longText/index.d.ts +1 -0
- package/dist/types/components/pointCloud2DRectOperationView/index.d.ts +1 -0
- package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +2 -0
- package/dist/types/components/pointCloud2DRectOperationView/util.d.ts +8 -0
- package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +2 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +28 -4
- package/dist/types/components/pointCloudView/components/HighlightVisible/index.d.ts +2 -1
- package/dist/types/components/pointCloudView/hooks/useDataLinkSwitch.d.ts +19 -0
- package/dist/types/components/pointCloudView/hooks/useHighlight.d.ts +1 -1
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +8 -0
- package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +9 -0
- package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +3 -2
- package/dist/types/components/pointCloudView/hooks/useTimeoutFunc.d.ts +6 -0
- package/dist/types/components/pointCloudView/hooks/useWindowKeydownListener.d.ts +16 -0
- package/dist/types/components/pointCloudView/utils/event-polyfill.d.ts +8 -0
- package/dist/types/components/pointCloudView/utils/map.d.ts +11 -0
- package/dist/types/components/subAttributeList/index.d.ts +10 -0
- package/dist/types/components/videoAnnotate/index.d.ts +2 -1
- package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +2 -1
- package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
- package/dist/types/hooks/useToolStyle.d.ts +30 -0
- package/dist/types/index.d.ts +7 -2
- package/dist/types/store/Actions.d.ts +1 -0
- package/dist/types/store/annotatedBox/index.d.ts +2 -0
- package/dist/types/store/annotation/actionCreators.d.ts +3 -2
- package/dist/types/store/annotation/reducer.d.ts +1 -0
- package/dist/types/store/annotation/types.d.ts +9 -2
- package/dist/types/utils/AnnotationDataUtils.d.ts +58 -1
- package/dist/types/utils/ToolPointCloudBoxRenderHelper.d.ts +23 -0
- package/dist/types/utils/index.d.ts +31 -1
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +1 -1
- package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.d.ts +9 -0
- package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.d.ts +3 -0
- package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/index.d.ts +1 -0
- package/dist/types/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.d.ts +10 -2
- package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
- package/dist/types/views/MainView/toolHeader/StepSwitch/index.d.ts +1 -1
- package/dist/types/views/MainView/toolHeader/index.d.ts +1 -1
- package/dist/utils/AnnotationDataUtils.js +1 -1
- package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -0
- package/dist/utils/index.js +1 -1
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
- package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/dist/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
- package/dist/views/MainView/toolFooter/index.js +1 -1
- package/es/App.js +1 -1
- package/es/assets/annotation/icon_link.svg.js +1 -0
- package/es/assets/annotation/icon_unlink.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
- package/es/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
- package/es/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
- package/es/components/AnnotationView/index.js +1 -1
- package/es/components/LLMToolView/index.js +1 -1
- package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/es/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
- package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/es/components/LLMToolView/sidebar/index.js +1 -1
- package/es/components/LLMToolView/utils/data.js +1 -1
- package/es/components/NLPToolView/index.js +1 -1
- package/es/components/audioAnnotate/audioContext/index.js +1 -1
- package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
- package/es/components/audioAnnotate/index.js +1 -1
- package/es/components/audioAnnotate/textInput/index.js +1 -1
- package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -1
- package/es/components/audioAnnotate/utils/dataTransform.js +1 -0
- package/es/components/audioPlayer/clipRegion/index.js +1 -1
- package/es/components/audioPlayer/index.js +1 -1
- package/es/components/audioPlayer/useAudioCombine/index.js +3 -2
- package/es/components/audioPlayer/useAudioSegment/index.js +1 -1
- package/es/components/longText/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
- package/es/components/pointCloud2DRectOperationView/util.js +1 -0
- package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/es/components/pointCloudView/PointCloud2DView.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js +1 -1
- package/es/components/pointCloudView/PointCloudContext.js +1 -1
- package/es/components/pointCloudView/PointCloudInfos.js +1 -1
- package/es/components/pointCloudView/PointCloudListener.js +1 -1
- package/es/components/pointCloudView/PointCloudSegment2DView.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/components/HighlightVisible/index.js +1 -1
- package/es/components/pointCloudView/hooks/useBoxes.js +1 -1
- package/es/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
- package/es/components/pointCloudView/hooks/useHighlight.js +1 -1
- package/es/components/pointCloudView/hooks/useHistory.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/pointCloudView/hooks/usePolygon.js +1 -1
- package/es/components/pointCloudView/hooks/useRotate.js +1 -1
- package/es/components/pointCloudView/hooks/useRotateEdge.js +1 -0
- package/es/components/pointCloudView/hooks/useSingleBox.js +1 -1
- package/es/components/pointCloudView/hooks/useStatus.js +1 -1
- package/es/components/pointCloudView/hooks/useTimeoutFunc.js +1 -0
- package/es/components/pointCloudView/hooks/useWindowKeydownListener.js +1 -0
- package/es/components/pointCloudView/index.js +1 -1
- package/es/components/pointCloudView/utils/event-polyfill.js +1 -0
- package/es/components/pointCloudView/utils/map.js +1 -0
- package/es/components/subAttributeList/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/index.js +1 -1
- package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
- package/es/hooks/useToolStyle.js +1 -0
- package/es/index.css +59 -17
- package/es/index.js +1 -1
- package/es/store/Actions.js +1 -1
- package/es/store/annotatedBox/index.js +1 -1
- package/es/store/annotation/actionCreators.js +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/utils/AnnotationDataUtils.js +1 -1
- package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -0
- package/es/utils/index.js +1 -1
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
- package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/es/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
- package/package.json +3 -3
- package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
- package/dist/assets/icons/9d70807.svg +0 -5
- package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$1=require("./components/AnnotationView/index.js"),pointCloudAnnotationView=require("./components/AnnotationView/pointCloudAnnotationView.js"),index$2=require("./components/LLMToolView/questionView/index.js"),index$3=require("./components/NLPToolView/textContent/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),App=require("./App.js"),configureStore=require("./configureStore.js"),actionCreators=require("./store/annotation/actionCreators.js"),TagToolInstanceAdaptorI18nProvider=require("./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js"),PointCloudContext=require("./components/pointCloudView/PointCloudContext.js"),ctx=require("./store/ctx.js"),index$5=require("./components/predictTracking/predictTrackingIcon/index.js"),index$4=require("./components/LLMToolView/index.js"),index$6=require("./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js"),index$7=require("./components/measureCanvas/index.js"),index$8=require("./views/MainView/sidebar/PointCloudToolSidebar/components/annotatedBox/index.js"),index$9=require("./views/MainView/sidebar/PointCloudToolSidebar/components/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$1=require("./components/AnnotationView/index.js"),pointCloudAnnotationView=require("./components/AnnotationView/pointCloudAnnotationView.js"),index$2=require("./components/LLMToolView/questionView/index.js"),index$3=require("./components/NLPToolView/textContent/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),App=require("./App.js"),configureStore=require("./configureStore.js"),actionCreators=require("./store/annotation/actionCreators.js"),TagToolInstanceAdaptorI18nProvider=require("./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js"),PointCloudContext=require("./components/pointCloudView/PointCloudContext.js"),ctx=require("./store/ctx.js"),index$5=require("./components/predictTracking/predictTrackingIcon/index.js"),index$4=require("./components/LLMToolView/index.js"),index$6=require("./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js"),BatchSwitchConnectIn2DView=require("./views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js"),index$7=require("./components/measureCanvas/index.js"),index$8=require("./views/MainView/sidebar/PointCloudToolSidebar/components/annotatedBox/index.js"),index$9=require("./views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js"),index$a=require("./views/MainView/sidebar/PointCloudToolSidebar/components/findTrackIDIndex/index.js"),index$b=require("./components/audioPlayer/index.js"),index$c=require("./utils/index.js"),index$d=require("./components/subAttributeList/index.js"),useToolStyle=require("./hooks/useToolStyle.js"),index$e=require("./constant/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var 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=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const store=configureStore(),OutputApp=(e,t)=>{const[r,i]=React.useState();return React.useImperativeHandle(t,()=>({toolInstance:r,annotationEngine:store.getState().annotation.annotationEngine,pageBackwardActions:()=>store.dispatch(actionCreators.PageBackward()),pageForwardActions:()=>store.dispatch(actionCreators.PageForward()),pageJump:o=>{const n=~~o-1;store.dispatch(actionCreators.PageJump(n))},hello:()=>alert("hello labelBee!!!")}),[r]),React__default.default.createElement(reactRedux.Provider,{store,context:ctx.LabelBeeContext},React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(useToolStyle.ToolStyleProvider,{value:e.toolStyle},React__default.default.createElement(PointCloudContext.PointCloudProvider,null,React__default.default.createElement(App,__spreadProps(__spreadValues({},e),{setToolInstance:o=>{var n;i(o),(n=e.onLoad)==null||n.call(e,{toolInstance:o})}}))))))};var index=React__default.default.forwardRef(OutputApp);exports.AnnotationView=index$1,exports.PointCloudAnnotationView=pointCloudAnnotationView,exports.QuestionView=index$2.default,exports.TextContent=index$3,Object.defineProperty(exports,"i18n",{enumerable:!0,get:function(){return lbUtils.i18n}}),exports.VideoTagTool=TagToolInstanceAdaptorI18nProvider.VideoTagTool,exports.PredictTracking=index$5,exports.LLMToolView=index$4,exports.SwitchCuboidBoxIn2DView=index$6.default,Object.defineProperty(exports,"SwitchCuboidBoxIn2DViewStateMode",{enumerable:!0,get:function(){return index$6.SwitchCuboidBoxIn2DViewStateMode}}),exports.BatchSwitchConnectIn2DView=BatchSwitchConnectIn2DView.default,exports.MeasureCanvas=index$7,exports.AnnotatedBox=index$8,exports.RectRotateSensitivitySlider=index$9,exports.FindTrackIDIndex=index$a.FindTrackIDIndexInCheckMode,exports.AudioPlayer=index$b.WrapAudioPlayer,exports.generatePointCloudBoxRects=index$c.generatePointCloudBoxRects,exports.SubAttributeList=index$d,Object.defineProperty(exports,"EDataFormatType",{enumerable:!0,get:function(){return index$e.EDataFormatType}}),Object.defineProperty(exports,"ELLMDataType",{enumerable:!0,get:function(){return index$e.ELLMDataType}}),Object.defineProperty(exports,"EStepType",{enumerable:!0,get:function(){return index$e.EStepType}}),Object.defineProperty(exports,"ESubmitType",{enumerable:!0,get:function(){return index$e.ESubmitType}}),exports.componentCls=index$e.componentCls,exports.prefix=index$e.prefix,exports.default=index,exports.store=store;
|
package/dist/store/Actions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const ANNOTATION_ACTIONS={INIT_ALL_STATE:"@@INIT_ALL_STATE",UPDATE_TOOL_INSTANCE:"@@UPDATE_TOOL_INSTANCE",UPDATE_IMG_LIST:"@@UPDATE_IMG_LIST",UPDATE_ANNOTATION_CONFIG:"@@UPDATE_ANNOTATION_CONFIG",LOAD_FILE_DATA:"@@LOAD_FILE_DATA",SUBMIT_FILE_DATA:"@@SUBMIT_FILE_DATA",SET_TASK_CONFIG:"@@SET_TASK_CONFIG",INIT_TOOL:"@@INIT_TOOL",SET_TOOL:"@@SET_TOOL",UPDATE_ON_SUBMIT:"@@UPDATE_ON_SUBMIT",UPDATE_ON_SAVE:"@@UPDATE_ON_SAVE",UPDATE_ON_PAGE_CHANGE:"@@UPDATE_ON_PAGE_CHANGE",UPDATE_ON_STEP_CHANGE:"@@UPDATE_ON_STEP_CHANGE",UPDATE_ROTATE:"@@UPDATE_ROTATE",UPDATE_GET_FILE_DATA:"@@UPDATE_GET_FILE_DATA",UPDATE_PAGE_SIZE:"@@UPDATE_PAGE_SIZE",UPDATE_LOAD_FILE_LIST:"@@UPDATE_LOAD_FILE_LIST",GET_FILE_DATA:"@@GET_FILE_DATA",SET_FILE_DATA:"@@SET_FILE_DATA",COPY_BACKWARD_RESULT:"@@COPY_BACKWARD_RESULT",SET_STEP:"@@SET_STEP",SUBMIT_RESULT:"@@SUBMIT_RESULT",SAVE_RESULT:"@@SAVE_RESULT",SET_BASIC_INDEX:"@@SET_BASIC_INDEX",CALC_STEP_PROGRESS:"@@CALC_STEP_PROGRESS",SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:"@@SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED",SKIP_BEFORE_PAGE_TURNING:"@@SKIP_BEFORE_PAGE_TURNING",UPDATE_BEFORE_ROTATE:"@@UPDATE_BEFORE_ROTATE",SET_LOADING:"@@SET_LOADING",SET_LOADPCDFILE_LOADING:"@@SET_LOADPCDFILE_LOADING",SET_POINT_CLOUD_LOADING:"@@SET_POINT_CLOUD_LOADING",SET_CHECK_MODE:"@@SET_CHECK_MODE",SET_TASK_STEP_LIST:"@@SET_TASK_STEP_LIST",UPDATE_ANNOTATION_VALID:"@@UPDATE_ANNOTATION_VALID",BATCH_UPDATE_TRACK_ID:"@@BATCH_UPDATE_TRACK_ID",BATCH_UPDATE_RESULT_BY_TRACK_ID:"@@BATCH_UPDATE_RESULT_BY_TRACK_ID",BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:"@@BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT",SET_PREDICT_RESULT_VISIBLE:"@@SET_PREDICT_RESULT_VISIBLE",SET_PREDICT_RESULT:"@@SET_PREDICT_RESULT",SET_HIGHLIGHT_ATTRIBUTE:"@@SET_HIGHLIGHT_ATTRIBUTE",UPDATE_PRE_DATA_PROCESS:"@@UPDATE_PRE_DATA_PROCESS"},IMAGE_ATTRIBUTE_ACTIONS={UPDATE_IMG_ATTRIBUTE:"@@UPDATE_IMG_ATTRIBUTE",INIT_IMG_ATTRIBUTE:"@@INIT_IMG_ATTRIBUTE"},TOOL_STYLE_ACTIONS={INIT_TOOL_STYLE_CONFIG:"@@INIT_TOOL_STYLE_CONFIG",UPDATE_TOOL_STYLE_CONFIG:"@@UPDATE_TOOL_STYLE_CONFIG"};exports.ANNOTATION_ACTIONS=ANNOTATION_ACTIONS,exports.IMAGE_ATTRIBUTE_ACTIONS=IMAGE_ATTRIBUTE_ACTIONS,exports.TOOL_STYLE_ACTIONS=TOOL_STYLE_ACTIONS;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const ANNOTATION_ACTIONS={INIT_ALL_STATE:"@@INIT_ALL_STATE",UPDATE_TOOL_INSTANCE:"@@UPDATE_TOOL_INSTANCE",UPDATE_IMG_LIST:"@@UPDATE_IMG_LIST",UPDATE_ANNOTATION_CONFIG:"@@UPDATE_ANNOTATION_CONFIG",LOAD_FILE_DATA:"@@LOAD_FILE_DATA",SUBMIT_FILE_DATA:"@@SUBMIT_FILE_DATA",SET_TASK_CONFIG:"@@SET_TASK_CONFIG",INIT_TOOL:"@@INIT_TOOL",SET_TOOL:"@@SET_TOOL",UPDATE_ON_SUBMIT:"@@UPDATE_ON_SUBMIT",UPDATE_ON_SAVE:"@@UPDATE_ON_SAVE",UPDATE_ON_PAGE_CHANGE:"@@UPDATE_ON_PAGE_CHANGE",UPDATE_ON_STEP_CHANGE:"@@UPDATE_ON_STEP_CHANGE",UPDATE_ROTATE:"@@UPDATE_ROTATE",UPDATE_GET_FILE_DATA:"@@UPDATE_GET_FILE_DATA",UPDATE_PAGE_SIZE:"@@UPDATE_PAGE_SIZE",UPDATE_LOAD_FILE_LIST:"@@UPDATE_LOAD_FILE_LIST",GET_FILE_DATA:"@@GET_FILE_DATA",SET_FILE_DATA:"@@SET_FILE_DATA",COPY_BACKWARD_RESULT:"@@COPY_BACKWARD_RESULT",SET_STEP:"@@SET_STEP",SUBMIT_RESULT:"@@SUBMIT_RESULT",SAVE_RESULT:"@@SAVE_RESULT",SET_BASIC_INDEX:"@@SET_BASIC_INDEX",CALC_STEP_PROGRESS:"@@CALC_STEP_PROGRESS",SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:"@@SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED",SKIP_BEFORE_PAGE_TURNING:"@@SKIP_BEFORE_PAGE_TURNING",UPDATE_BEFORE_ROTATE:"@@UPDATE_BEFORE_ROTATE",SET_LOADING:"@@SET_LOADING",SET_LOADPCDFILE_LOADING:"@@SET_LOADPCDFILE_LOADING",SET_POINT_CLOUD_LOADING:"@@SET_POINT_CLOUD_LOADING",SET_CHECK_MODE:"@@SET_CHECK_MODE",SET_TASK_STEP_LIST:"@@SET_TASK_STEP_LIST",UPDATE_ANNOTATION_VALID:"@@UPDATE_ANNOTATION_VALID",BATCH_UPDATE_TRACK_ID:"@@BATCH_UPDATE_TRACK_ID",BATCH_UPDATE_RESULT_BY_TRACK_ID:"@@BATCH_UPDATE_RESULT_BY_TRACK_ID",BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:"@@BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT",SET_PREDICT_RESULT_VISIBLE:"@@SET_PREDICT_RESULT_VISIBLE",SET_PREDICT_RESULT:"@@SET_PREDICT_RESULT",SET_HIGHLIGHT_ATTRIBUTE:"@@SET_HIGHLIGHT_ATTRIBUTE",UPDATE_PRE_DATA_PROCESS:"@@UPDATE_PRE_DATA_PROCESS",UPDATE_IMG_INDEX_BY_EXTERNAL:"@@UPDATE_IMG_INDEX_BY_EXTERNAL"},IMAGE_ATTRIBUTE_ACTIONS={UPDATE_IMG_ATTRIBUTE:"@@UPDATE_IMG_ATTRIBUTE",INIT_IMG_ATTRIBUTE:"@@INIT_IMG_ATTRIBUTE"},TOOL_STYLE_ACTIONS={INIT_TOOL_STYLE_CONFIG:"@@INIT_TOOL_STYLE_CONFIG",UPDATE_TOOL_STYLE_CONFIG:"@@UPDATE_TOOL_STYLE_CONFIG"};exports.ANNOTATION_ACTIONS=ANNOTATION_ACTIONS,exports.IMAGE_ATTRIBUTE_ACTIONS=IMAGE_ATTRIBUTE_ACTIONS,exports.TOOL_STYLE_ACTIONS=TOOL_STYLE_ACTIONS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var zustand=require("zustand");const useAnnotatedBoxStore=zustand.create(e=>({ptCtx:{},pointCloudBoxList:[],setPointCloudBoxList:t=>e(s=>({pointCloudBoxList:t})),highlightIDs:[],setHighlightIDs:t=>e(s=>({highlightIDs:t})),selectedIDs:[],setSelectedIDs:t=>e(s=>({selectedIDs:t})),setPtCtx:t=>e(s=>({ptCtx:t}))}));module.exports=useAnnotatedBoxStore;
|
|
1
|
+
"use strict";var zustand=require("zustand");const useAnnotatedBoxStore=zustand.create(e=>({ptCtx:{},pointCloudBoxList:[],setPointCloudBoxList:t=>e(s=>({pointCloudBoxList:t})),highlightIDs:[],setHighlightIDs:t=>e(s=>({highlightIDs:t})),selectedIDs:[],setSelectedIDs:t=>e(s=>({selectedIDs:t})),rectRotateSensitivity:2,setRectRotateSensitivity:t=>e(s=>({rectRotateSensitivity:t})),setPtCtx:t=>e(s=>({ptCtx:t}))}));module.exports=useAnnotatedBoxStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Actions=require("../Actions.js"),reducer=require("./reducer.js"),index=require("../../constant/index.js"),AnnotationSize=require("../../data/enums/AnnotationSize.js"),PageOperator=require("../../utils/PageOperator.js"),index$1=require("../../utils/index.js"),util=require("../../components/predictTracking/previewResult/util.js"),__async=(t,e,n)=>new Promise((a,r)=>{var o=s=>{try{u(n.next(s))}catch(i){r(i)}},T=s=>{try{u(n.throw(s))}catch(i){r(i)}},u=s=>s.done?a(s.value):Promise.resolve(s.value).then(o,T);u((n=n.apply(t,e)).next())});const dispatchTasks=(t,e)=>e.map(n=>t(n)),getSubmitByPageOperation=t=>t===AnnotationSize.EPageTurningOperation.Forward?index.ESubmitType.Forward:t===AnnotationSize.EPageTurningOperation.Backward?index.ESubmitType.Backward:t===AnnotationSize.EPageTurningOperation.Jump?index.ESubmitType.Jump:index.ESubmitType.Forward,getBasicIndex=(t,e)=>{var n,a;const{imgList:r,imgIndex:o}=t,{dataSourceStep:T}=reducer.getStepConfig(t.stepList,t.step);return((a=(n=index$1.jsonParser(r[o-1].result)[`step_${T}`])==null?void 0:n.result)==null?void 0:a.length)-1||e};function UpdateToolInstance(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE,payload:{toolInstance:t}}}function SetTaskStepList({stepList:t}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST,payload:{stepList:t}}}function SetTaskConfig({stepList:t,step:e}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG,payload:{stepList:t,step:e}}}function UpdateOnSubmit(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT,payload:{onSubmit:t}}}function UpdateOnSave(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE,payload:{onSave:t}}}function UpdateOnPageChange(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE,payload:{onPageChange:t}}}function UpdateOnStepChange(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE,payload:{onStepChange:t}}}function UpdateGetFileData(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA,payload:{getFileData:t}}}function UpdatePageSize(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE,payload:{pageSize:t}}}function UpdateGetFileList(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST,payload:{loadFileList:t}}}function UpdateRotate(){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE}}function UpdateSkipBeforePageTurning(t){return{type:Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING,payload:{skipBeforePageTurning:t}}}function UpdateBeforeRotate(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE,payload:{beforeRotate:t}}}function UpdatePreDataProcess(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS,payload:{preDataProcess:t}}}function CopyBackWordResult(){return{type:Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT}}function BatchUpdateTrackID({id:t,newID:e,rangeIndex:n,imgList:a}){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID,payload:{id:t,newID:e,rangeIndex:n,imgList:a}}}function BatchUpdateResultByTrackID(t,e,n){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID,payload:{id:t,newData:e,rangeIndex:n}}}function BatchUpdateImgListResultByPredictResult(){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT,payload:{}}}const UpdateCheckMode=t=>({type:Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE,payload:{checkMode:t}}),UpdateHighlightAttribute=t=>({type:Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE,payload:{attribute:t}});function InitTaskData({onSubmit:t,onSave:e,onPageChange:n,onStepChange:a,getFileData:r,pageSize:o,loadFileList:T,step:u,stepList:s,skipBeforePageTurning:i,beforeRotate:N,checkMode:p,highlightAttribute:I,preDataProcess:O}){const A=[];return t&&A.push(UpdateOnSubmit(t)),e&&A.push(UpdateOnSave(e)),n&&A.push(UpdateOnPageChange(n)),a&&A.push(UpdateOnStepChange(a)),r&&A.push(UpdateGetFileData(r)),T&&A.push(UpdateGetFileList(T)),o&&A.push(UpdatePageSize(o)),i&&A.push(UpdateSkipBeforePageTurning(i)),N&&A.push(UpdateBeforeRotate(N)),O&&A.push(UpdatePreDataProcess(O)),typeof p=="boolean"&&A.push(UpdateCheckMode(p)),A.push(UpdateHighlightAttribute(I)),A.push(SetTaskConfig({stepList:s,step:u})),A.push({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),A.push({type:Actions.ANNOTATION_ACTIONS.INIT_TOOL}),d=>dispatchTasks(d,A)}function UpdateInjectFunc({onSubmit:t,onSave:e,onPageChange:n,onStepChange:a,getFileData:r,pageSize:o,loadFileList:T,stepList:u,beforeRotate:s,highlightAttribute:i,preDataProcess:N}){const p=[];return t&&p.push(UpdateOnSubmit(t)),e&&p.push(UpdateOnSave(e)),n&&p.push(UpdateOnPageChange(n)),a&&p.push(UpdateOnStepChange(a)),r&&p.push(UpdateGetFileData(r)),T&&p.push(UpdateGetFileList(T)),o&&p.push(UpdatePageSize(o)),s&&p.push(UpdateBeforeRotate(s)),N&&p.push(UpdatePreDataProcess(N)),p.push(UpdateHighlightAttribute(i)),p.push(SetTaskStepList({stepList:u})),I=>dispatchTasks(I,p)}const getNextStep=(t,e)=>{var n;const a=e==null?void 0:e.findIndex(r=>(r==null?void 0:r.step)===t);return(n=e[a+1])==null?void 0:n.step},ToNextStep=t=>(e,n)=>{const{annotation:a}=n(),{step:r,stepList:o}=a,T=getNextStep(r,o);return[e(UpdateProcessingStep(T,t))]},UpdateProcessingStep=(t,e)=>(n,a)=>{var r,o;const{annotation:T}=a();(r=T==null?void 0:T.onStepChange)==null||r.call(T,t);const u=(o=T==null?void 0:T.imgIndex)!=null?o:0;return[n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:index.ESubmitType.StepChanged}}),n({type:Actions.ANNOTATION_ACTIONS.SET_STEP,payload:{toStep:t}}),n({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),n(reducer.LoadFileAndFileData(e!=null?e:u,0))]},ToSubmitFileData=t=>e=>[e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:t}})],SubmitAndChangeFileIndex=(t,e,n,a)=>[t(ToSubmitFileData(n)),t(reducer.LoadFileAndFileData(e,a))],ChangeBasicIndex=(t,e)=>[t({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),t({type:Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX,payload:{basicIndex:e}})],ChangeTriggerEventAfterIndexChanged=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED,payload:{triggerEventAfterIndexChanged:e}})},PageBackward=(t=!1)=>(e,n)=>DispatcherTurning(e,n,AnnotationSize.EPageTurningOperation.Backward,t),PageForward=(t=!1)=>(e,n)=>DispatcherTurning(e,n,AnnotationSize.EPageTurningOperation.Forward,t),PageJump=(t,e=!1)=>(n,a)=>{if(t!==a().imgIndex)return DispatcherTurning(n,a,AnnotationSize.EPageTurningOperation.Jump,e,t)},loadImgList=(t,e,n,a)=>__async(void 0,null,function*(){var r;const{loadFileList:o,imgList:T,pageSize:u}=e().annotation,s=Math.floor(n/u);SetAnnotationLoading(t,!0);try{const i=yield o(s,u);if(SetAnnotationLoading(t,!1),!((r=i==null?void 0:i.fileList)==null?void 0:r.length)||!(i==null?void 0:i.total))throw new Error("fileList and total are required");const N=a?new Array(i.total):[...T];return N.splice(s*u,u,...i.fileList),t({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:N}}),!0}catch(i){SetAnnotationLoading(t,!1),console.error(i)}}),DispatcherTurning=(t,e,n,a=!1,r)=>__async(void 0,null,function*(){var o;const T=e().annotation,{fileIndexChanged:u,fileIndex:s,basicIndexChanged:i,basicIndex:N}=PageOperator.getNextPageInfo(n,T,r),p=getSubmitByPageOperation(n);if(ChangeTriggerEventAfterIndexChanged(t,a),u){if(T.loading||!T.imgList[s]&&!(yield loadImgList(t,e,s)))return;(o=T.onPageChange)==null||o.call(T,s);const I=p===index.ESubmitType.Backward?getBasicIndex(e().annotation,N):N;return SubmitAndChangeFileIndex(t,s,p,I)}return i?ChangeBasicIndex(t,N):t(ToSubmitFileData(p))}),ChangeSave=t=>{t(ToSubmitFileData(index.ESubmitType.Save)),t({type:Actions.ANNOTATION_ACTIONS.SAVE_RESULT})},SetAnnotationLoading=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_LOADING,payload:{loading:e}})},SetPointCloudLoading=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_LOADING,payload:{loading:e}})},SetLoadPCDFileLoading=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING,payload:{loadPCDFileLoading:e}})},InitAnnotationState=t=>{t({type:Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE,payload:{}})},SetPredictResult=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT,payload:{result:e}})},SetPredictResultVisible=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE,payload:{visible:e}})},GetBoxesByID=(t,e)=>(n,a)=>{const{imgList:r,step:o}=a().annotation;return util.getBoxesByTrackID(r,o,t,e)},PreDataProcess=t=>(e,n)=>{var a,r;const{annotation:o}=n();return(r=(a=o==null?void 0:o.preDataProcess)==null?void 0:a.call(o,t))!=null?r:t.dataList};exports.BatchUpdateImgListResultByPredictResult=BatchUpdateImgListResultByPredictResult,exports.BatchUpdateResultByTrackID=BatchUpdateResultByTrackID,exports.BatchUpdateTrackID=BatchUpdateTrackID,exports.ChangeSave=ChangeSave,exports.CopyBackWordResult=CopyBackWordResult,exports.DispatcherTurning=DispatcherTurning,exports.GetBoxesByID=GetBoxesByID,exports.InitAnnotationState=InitAnnotationState,exports.InitTaskData=InitTaskData,exports.PageBackward=PageBackward,exports.PageForward=PageForward,exports.PageJump=PageJump,exports.PreDataProcess=PreDataProcess,exports.SetAnnotationLoading=SetAnnotationLoading,exports.SetLoadPCDFileLoading=SetLoadPCDFileLoading,exports.SetPointCloudLoading=SetPointCloudLoading,exports.SetPredictResult=SetPredictResult,exports.SetPredictResultVisible=SetPredictResultVisible,exports.SetTaskConfig=SetTaskConfig,exports.SetTaskStepList=SetTaskStepList,exports.ToNextStep=ToNextStep,exports.ToSubmitFileData=ToSubmitFileData,exports.UpdateBeforeRotate=UpdateBeforeRotate,exports.UpdateCheckMode=UpdateCheckMode,exports.UpdateGetFileData=UpdateGetFileData,exports.UpdateGetFileList=UpdateGetFileList,exports.UpdateHighlightAttribute=UpdateHighlightAttribute,exports.UpdateInjectFunc=UpdateInjectFunc,exports.UpdateOnPageChange=UpdateOnPageChange,exports.UpdateOnSave=UpdateOnSave,exports.UpdateOnStepChange=UpdateOnStepChange,exports.UpdateOnSubmit=UpdateOnSubmit,exports.UpdatePageSize=UpdatePageSize,exports.UpdatePreDataProcess=UpdatePreDataProcess,exports.UpdateProcessingStep=UpdateProcessingStep,exports.UpdateRotate=UpdateRotate,exports.UpdateSkipBeforePageTurning=UpdateSkipBeforePageTurning,exports.UpdateToolInstance=UpdateToolInstance,exports.loadImgList=loadImgList;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Actions=require("../Actions.js"),reducer=require("./reducer.js"),index=require("../../constant/index.js"),AnnotationSize=require("../../data/enums/AnnotationSize.js"),PageOperator=require("../../utils/PageOperator.js"),index$1=require("../../utils/index.js"),util=require("../../components/predictTracking/previewResult/util.js"),__async=(t,e,n)=>new Promise((a,r)=>{var T=s=>{try{o(n.next(s))}catch(p){r(p)}},i=s=>{try{o(n.throw(s))}catch(p){r(p)}},o=s=>s.done?a(s.value):Promise.resolve(s.value).then(T,i);o((n=n.apply(t,e)).next())});const dispatchTasks=(t,e)=>e.map(n=>t(n)),getSubmitByPageOperation=t=>t===AnnotationSize.EPageTurningOperation.Forward?index.ESubmitType.Forward:t===AnnotationSize.EPageTurningOperation.Backward?index.ESubmitType.Backward:t===AnnotationSize.EPageTurningOperation.Jump?index.ESubmitType.Jump:index.ESubmitType.Forward,getBasicIndex=(t,e)=>{var n,a,r;const{imgList:T,imgIndex:i}=t,{dataSourceStep:o}=reducer.getStepConfig(t.stepList,t.step);return((r=(a=index$1.jsonParser((n=T[i-1])==null?void 0:n.result)[`step_${o}`])==null?void 0:a.result)==null?void 0:r.length)-1||e};function UpdateToolInstance(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE,payload:{toolInstance:t}}}function SetTaskStepList({stepList:t}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST,payload:{stepList:t}}}function SetTaskConfig({stepList:t,step:e}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG,payload:{stepList:t,step:e}}}function UpdateOnSubmit(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT,payload:{onSubmit:t}}}function UpdateOnSave(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE,payload:{onSave:t}}}function UpdateOnPageChange(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE,payload:{onPageChange:t}}}function UpdateOnStepChange(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE,payload:{onStepChange:t}}}function UpdateGetFileData(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA,payload:{getFileData:t}}}function UpdatePageSize(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE,payload:{pageSize:t}}}function UpdateGetFileList(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST,payload:{loadFileList:t}}}function UpdateRotate(){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE}}function UpdateSkipBeforePageTurning(t){return{type:Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING,payload:{skipBeforePageTurning:t}}}function UpdateBeforeRotate(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE,payload:{beforeRotate:t}}}function UpdatePreDataProcess(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS,payload:{preDataProcess:t}}}function CopyBackWordResult(){return{type:Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT}}function UpdateImgIndexByExternal(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_INDEX_BY_EXTERNAL,payload:{getImgIndexByExternal:t}}}function BatchUpdateTrackID({id:t,newID:e,rangeIndex:n,imgList:a}){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID,payload:{id:t,newID:e,rangeIndex:n,imgList:a}}}function BatchUpdateResultByTrackID(t,e,n){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID,payload:{id:t,newData:e,rangeIndex:n}}}function BatchUpdateImgListResultByPredictResult(){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT,payload:{}}}const UpdateCheckMode=t=>({type:Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE,payload:{checkMode:t}}),UpdateHighlightAttribute=t=>({type:Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE,payload:{attribute:t}});function InitTaskData({onSubmit:t,onSave:e,onPageChange:n,onStepChange:a,getFileData:r,pageSize:T,loadFileList:i,step:o,stepList:s,skipBeforePageTurning:p,beforeRotate:N,checkMode:A,highlightAttribute:I,preDataProcess:d,getImgIndexByExternal:l}){const u=[];return t&&u.push(UpdateOnSubmit(t)),e&&u.push(UpdateOnSave(e)),n&&u.push(UpdateOnPageChange(n)),a&&u.push(UpdateOnStepChange(a)),r&&u.push(UpdateGetFileData(r)),i&&u.push(UpdateGetFileList(i)),T&&u.push(UpdatePageSize(T)),p&&u.push(UpdateSkipBeforePageTurning(p)),N&&u.push(UpdateBeforeRotate(N)),d&&u.push(UpdatePreDataProcess(d)),typeof A=="boolean"&&u.push(UpdateCheckMode(A)),l&&u.push(UpdateImgIndexByExternal(l)),u.push(UpdateHighlightAttribute(I)),u.push(SetTaskConfig({stepList:s,step:o})),u.push({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),u.push({type:Actions.ANNOTATION_ACTIONS.INIT_TOOL}),O=>dispatchTasks(O,u)}function UpdateInjectFunc({onSubmit:t,onSave:e,onPageChange:n,onStepChange:a,getFileData:r,pageSize:T,loadFileList:i,stepList:o,beforeRotate:s,highlightAttribute:p,preDataProcess:N}){const A=[];return t&&A.push(UpdateOnSubmit(t)),e&&A.push(UpdateOnSave(e)),n&&A.push(UpdateOnPageChange(n)),a&&A.push(UpdateOnStepChange(a)),r&&A.push(UpdateGetFileData(r)),i&&A.push(UpdateGetFileList(i)),T&&A.push(UpdatePageSize(T)),s&&A.push(UpdateBeforeRotate(s)),N&&A.push(UpdatePreDataProcess(N)),A.push(UpdateHighlightAttribute(p)),A.push(SetTaskStepList({stepList:o})),I=>dispatchTasks(I,A)}const getNextStep=(t,e)=>{var n;const a=e==null?void 0:e.findIndex(r=>(r==null?void 0:r.step)===t);return(n=e[a+1])==null?void 0:n.step},ToNextStep=t=>(e,n)=>{const{annotation:a}=n(),{step:r,stepList:T}=a,i=getNextStep(r,T);return[e(UpdateProcessingStep(i,t))]},UpdateProcessingStep=(t,e)=>(n,a)=>{var r,T;const{annotation:i}=a();(r=i==null?void 0:i.onStepChange)==null||r.call(i,t);const o=(T=i==null?void 0:i.imgIndex)!=null?T:0;return[n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:index.ESubmitType.StepChanged}}),n({type:Actions.ANNOTATION_ACTIONS.SET_STEP,payload:{toStep:t}}),n({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),n(reducer.LoadFileAndFileData(e!=null?e:o,0))]},ToSubmitFileData=t=>e=>[e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:t}})],SubmitAndChangeFileIndex=(t,e,n,a)=>[t(ToSubmitFileData(n)),t(reducer.LoadFileAndFileData(e,a))],ChangeBasicIndex=(t,e)=>[t({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),t({type:Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX,payload:{basicIndex:e}})],ChangeTriggerEventAfterIndexChanged=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED,payload:{triggerEventAfterIndexChanged:e}})},PageBackward=(t=!1)=>(e,n)=>DispatcherTurning(e,n,AnnotationSize.EPageTurningOperation.Backward,t),PageForward=(t=!1)=>(e,n)=>DispatcherTurning(e,n,AnnotationSize.EPageTurningOperation.Forward,t),PageJump=(t,e=!1)=>(n,a)=>{if(t!==a().imgIndex)return DispatcherTurning(n,a,AnnotationSize.EPageTurningOperation.Jump,e,t)},loadImgList=(t,e,n,a)=>__async(void 0,null,function*(){var r;const{loadFileList:T,imgList:i,pageSize:o}=e().annotation,s=Math.floor(n/o);SetAnnotationLoading(t,!0);try{const p=yield T(s,o);if(SetAnnotationLoading(t,!1),!((r=p==null?void 0:p.fileList)==null?void 0:r.length)||!(p==null?void 0:p.total))throw new Error("fileList and total are required");const N=a?new Array(p.total):[...i];return N.splice(s*o,o,...p.fileList),t({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:N}}),!0}catch(p){SetAnnotationLoading(t,!1),console.error(p)}}),DispatcherTurning=(t,e,n,a=!1,r)=>__async(void 0,null,function*(){var T,i;const o=e().annotation,s=getSubmitByPageOperation(n);let{fileIndexChanged:p,fileIndex:N,basicIndexChanged:A,basicIndex:I}=PageOperator.getNextPageInfo(n,o,r);const d=(T=o==null?void 0:o.getImgIndexByExternal)==null?void 0:T.call(o,o.imgIndex,s);if(d!==void 0&&(p=!0,N=d),ChangeTriggerEventAfterIndexChanged(t,a),p){if(o.loading||!o.imgList[N]&&!(yield loadImgList(t,e,N)))return;(i=o.onPageChange)==null||i.call(o,N);const l=s===index.ESubmitType.Backward?getBasicIndex(e().annotation,I):I;return SubmitAndChangeFileIndex(t,N,s,l)}return A?ChangeBasicIndex(t,I):t(ToSubmitFileData(s))}),ChangeSave=t=>{t(ToSubmitFileData(index.ESubmitType.Save)),t({type:Actions.ANNOTATION_ACTIONS.SAVE_RESULT})},SetAnnotationLoading=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_LOADING,payload:{loading:e}})},SetPointCloudLoading=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_LOADING,payload:{loading:e}})},SetLoadPCDFileLoading=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING,payload:{loadPCDFileLoading:e}})},InitAnnotationState=t=>{t({type:Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE,payload:{}})},SetPredictResult=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT,payload:{result:e}})},SetPredictResultVisible=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE,payload:{visible:e}})},GetBoxesByID=(t,e)=>(n,a)=>{const{imgList:r,step:T}=a().annotation;return util.getBoxesByTrackID(r,T,t,e)},PreDataProcess=t=>(e,n)=>{var a,r;const{annotation:T}=n();return(r=(a=T==null?void 0:T.preDataProcess)==null?void 0:a.call(T,t))!=null?r:t.dataList};exports.BatchUpdateImgListResultByPredictResult=BatchUpdateImgListResultByPredictResult,exports.BatchUpdateResultByTrackID=BatchUpdateResultByTrackID,exports.BatchUpdateTrackID=BatchUpdateTrackID,exports.ChangeSave=ChangeSave,exports.CopyBackWordResult=CopyBackWordResult,exports.DispatcherTurning=DispatcherTurning,exports.GetBoxesByID=GetBoxesByID,exports.InitAnnotationState=InitAnnotationState,exports.InitTaskData=InitTaskData,exports.PageBackward=PageBackward,exports.PageForward=PageForward,exports.PageJump=PageJump,exports.PreDataProcess=PreDataProcess,exports.SetAnnotationLoading=SetAnnotationLoading,exports.SetLoadPCDFileLoading=SetLoadPCDFileLoading,exports.SetPointCloudLoading=SetPointCloudLoading,exports.SetPredictResult=SetPredictResult,exports.SetPredictResultVisible=SetPredictResultVisible,exports.SetTaskConfig=SetTaskConfig,exports.SetTaskStepList=SetTaskStepList,exports.ToNextStep=ToNextStep,exports.ToSubmitFileData=ToSubmitFileData,exports.UpdateBeforeRotate=UpdateBeforeRotate,exports.UpdateCheckMode=UpdateCheckMode,exports.UpdateGetFileData=UpdateGetFileData,exports.UpdateGetFileList=UpdateGetFileList,exports.UpdateHighlightAttribute=UpdateHighlightAttribute,exports.UpdateImgIndexByExternal=UpdateImgIndexByExternal,exports.UpdateInjectFunc=UpdateInjectFunc,exports.UpdateOnPageChange=UpdateOnPageChange,exports.UpdateOnSave=UpdateOnSave,exports.UpdateOnStepChange=UpdateOnStepChange,exports.UpdateOnSubmit=UpdateOnSubmit,exports.UpdatePageSize=UpdatePageSize,exports.UpdatePreDataProcess=UpdatePreDataProcess,exports.UpdateProcessingStep=UpdateProcessingStep,exports.UpdateRotate=UpdateRotate,exports.UpdateSkipBeforePageTurning=UpdateSkipBeforePageTurning,exports.UpdateToolInstance=UpdateToolInstance,exports.loadImgList=loadImgList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$2=require("../../components/customResizeHook/index.js"),index$1=require("../../constant/index.js"),styleString=require("../../constant/styleString.js"),Actions=require("../Actions.js"),index=require("../../utils/index.js"),AnnotationDataUtils=require("../../utils/AnnotationDataUtils.js"),ConfigUtils=require("../../utils/ConfigUtils.js"),data=require("../../utils/data.js"),StepUtils=require("../../utils/StepUtils.js"),ToolUtils=require("../../utils/ToolUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),antd=require("antd"),es=require("antd/es"),_=require("lodash"),actionCreators=require("./actionCreators.js"),ToolType=require("../../data/enums/ToolType.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,s)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,__spreadValues=(e,t)=>{for(var s in t||(t={}))__hasOwnProp.call(t,s)&&__defNormalProp(e,s,t[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(t))__propIsEnum.call(t,s)&&__defNormalProp(e,s,t[s]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,s)=>new Promise((g,u)=>{var S=I=>{try{N(s.next(I))}catch(m){u(m)}},A=I=>{try{N(s.throw(I))}catch(m){u(m)}},N=I=>I.done?g(I.value):Promise.resolve(I.value).then(S,A);N((s=s.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(s=>s.step===t),initialState={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},getTotalPage=e=>{const{imgList:t,imgPageSize:s}=e;return Math.ceil(t.length/s)},calcStepProgress=(e,t)=>e.reduce((s,g)=>{if(g){const u=g.result;if(index.jsonParser(u)[`step_${t}`])return s+1}return s},0)/e.length,updateToolInstance=(e,t)=>{const{step:s,stepList:g}=e,u=StepUtils.getCurrentStepInfo(s,g),S=ConfigUtils.ConfigUtils.jsonParser(u.config);if(ToolUtils.isVideoTool(u==null?void 0:u.tool)||ToolUtils.isAudioTool(u==null?void 0:u.tool)||ToolUtils.isPointCloudTool(u==null?void 0:u.tool)||[ToolType.EToolName.LLM,ToolType.EToolName.NLP].includes(u==null?void 0:u.tool))return;const A=document.getElementById("toolContainer");if(!A)throw"Not exist dom named id-toolContainer";const N=index$2.getFormatSize({width:window.innerWidth,height:window.innerHeight}),I=new lbAnnotation.AnnotationEngine({container:A,toolName:u.tool,size:N,imgNode:t,config:S,style:JSON.parse(styleString)});return{toolInstance:I==null?void 0:I.toolInstance,annotationEngine:I}},LoadFileAndFileData=(e,t)=>(s,g)=>__async(void 0,null,function*(){var u,S;const{stepList:A,step:N}=g().annotation,I=StepUtils.currentToolIsVideo(N,A),m=StepUtils.currentToolIsPointCloud(N,A),D=((u=StepUtils.getCurrentStepInfo(N,A))==null?void 0:u.tool)===ToolType.EToolName.LLM,y=((S=StepUtils.getCurrentStepInfo(N,A))==null?void 0:S.tool)===ToolType.EToolName.NLP,P=StepUtils.currentToolIsAudio(N,A);if(actionCreators.SetAnnotationLoading(s,!0),yield s(TryGetFileDataByAPI(e)),I){s(AfterVideoLoaded(e));return}if(m||D||P||y){s(AfterCommonLoaded(e));return}s(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,s)=>__async(void 0,null,function*(){const{getFileData:g,imgList:u}=s().annotation;if(g){const S=yield g(u[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:S,index:e}})}}),AfterVideoLoaded=e=>t=>{t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterCommonLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(s,g)=>{var u;const{toolInstance:S,imgList:A}=g().annotation,N=(u=A==null?void 0:A[e])==null?void 0:u.url;lbAnnotation.ImgUtils.load(N).then(I=>{actionCreators.SetAnnotationLoading(s,!1),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:I,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(s,!1),S==null||S.setErrorImg(),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},composeResultByToolInstance=({toolInstance:e,imgList:t,imgIndex:s,stepList:g,step:u=1})=>{var S,A,N,I;const m=((S=t[s])==null?void 0:S.result)||"",[D,y,P]=(A=e==null?void 0:e.exportData())!=null?A:[],x=(I=(N=e==null?void 0:e.exportCustomData)==null?void 0:N.call(e))!=null?I:{},B=data.composeResultWithBasicImgInfo(m,y),w=data.composeResult(B,{step:u,stepList:g},{rect:D},x);return t.map((b,F)=>F===s?__spreadValues(__spreadProps(__spreadValues({},b),{result:w}),P):__spreadValues({},b))},annotationReducer=(e=__spreadValues({},initialState),t)=>{var s,g,u,S,A,N,I,m,D,y,P,x,B,w,b,F,G,V,M,q,k,H,z,K,W;switch(t.type){case Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE:return __spreadValues(__spreadValues({},e),initialState);case Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE:return __spreadProps(__spreadValues({},e),{toolInstance:t.payload.toolInstance});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST:return __spreadProps(__spreadValues({},e),{imgList:t.payload.imgList});case Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS:{const{imgList:n,step:o}=e,l=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:l})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:l,stepList:i,toolInstance:a,onSubmit:r,resultList:p}=e;if(!a||!n[o])return e;const d=((s=n[o])==null?void 0:s.result)||"",[,c,T]=(g=a==null?void 0:a.exportData())!=null?g:[],O=(S=(u=a==null?void 0:a.exportCustomData)==null?void 0:u.call(a))!=null?S:{},f=data.composeResultWithBasicImgInfo(d,c),C=data.composeResult(f,{step:l,stepList:i},{rect:p},O),L=e.imgList.map((v,E)=>{if(E===o){const U=AnnotationDataUtils.dataCorrection(C,d,l,i);return __spreadValues(__spreadProps(__spreadValues({},v),{result:U}),T)}return v});if(((A=t.payload)==null?void 0:A.submitType)===index$1.ESubmitType.SyncImgList)return __spreadProps(__spreadValues({},e),{imgList:L});r&&r([L[o]],(N=t.payload)==null?void 0:N.submitType,o,L);const R=calcStepProgress(L,l);return __spreadProps(__spreadValues({},e),{stepProgress:R,imgList:L})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:l}=e;return l==null||l(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:l,toolInstance:i,basicResultList:a}=e;if(!i)return e;const[r]=(I=i==null?void 0:i.exportData())!=null?I:[];let p=r;if((a==null?void 0:a.length)>0){const d=(m=a[o])==null?void 0:m.id,c=r.map(T=>__spreadProps(__spreadValues({},T),{sourceID:d}));p=___default.default.cloneDeep(l).filter(T=>T.sourceID!==d),p.push(...c)}return __spreadProps(__spreadValues({},e),{resultList:p,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:l,imgIndex:i,stepList:a,annotationEngine:r,resultList:p,basicResultList:d}=e;if(!n||!r)return e;const c=t.payload.basicIndex,T=(D=d[c])==null?void 0:D.id,O=index.jsonParser((y=l[i])==null?void 0:y.result),f=(p||[]).filter(U=>U.sourceID===T),C=getStepConfig(a,o),{dataSourceStep:L,tool:R}=C,v=getStepConfig(a,L);let E=[];return L&&R&&(E=(P=O[`step_${L}`])==null?void 0:P.result,(E==null?void 0:E.length)>0?(r==null||r.setBasicInfo(v.tool,E[c]),r==null||r.launchOperation()):(r==null||r.setBasicInfo(v.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:c})}case Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=t.payload;return __spreadProps(__spreadValues({},e),{triggerEventAfterIndexChanged:!!n})}case Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA:{const{imgList:n,step:o,toolInstance:l,annotationEngine:i,stepList:a}=e;if(!l)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const r=StepUtils.getCurrentStepInfo(o,a),{nextIndex:p,imgNode:d,nextBasicIndex:c,imgError:T}=t.payload,O=c!=null?c:0,f=index.jsonParser((x=n[p])==null?void 0:x.result),C=f[`step_${r.step}`],L=!C,R={rotate:(B=f.rotate)!=null?B:0,valid:(w=f.valid)!=null?w:!0};d&&T!==!0?i==null||i.setImgNode(d,R):l==null||l.setValid(R.valid);const v=getStepConfig(a,r.step),{dataSourceStep:E,tool:U}=v,$=getStepConfig(a,E),Y=E&&U,h=(F=(b=f[`step_${E}`])==null?void 0:b.result)!=null?F:[],j=AnnotationDataUtils.getInitialResultList(C==null?void 0:C.result,l,v,h,L);if(i==null||i.launchOperation(),Y&&((h==null?void 0:h.length)>0?i==null||i.setBasicInfo($.tool,h[O]):(i==null||i.setBasicInfo($.tool),i==null||i.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),r.tool!=="check"){const J=(V=(G=h[O])==null?void 0:G.id)!=null?V:"",X=Y?j.filter(Z=>lbAnnotation.CommonToolUtils.isSameSourceID(Z.sourceID,J)):j;(M=l==null?void 0:l.history)==null||M.initRecord(j,!0),l==null||l.setResult(X)}return __spreadProps(__spreadValues({},e),{imgIndex:p,basicIndex:O,basicResultList:h,resultList:j})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(q=t.payload.config)!=null?q:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST:{const{stepList:n}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n})}case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:o}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:o})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,o=updateToolInstance(e,n);if(o){const{toolInstance:l,annotationEngine:i}=o;return __spreadProps(__spreadValues({},e),{toolInstance:l,annotationEngine:i})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(k=t.payload)==null?void 0:k.instance;return n?__spreadProps(__spreadValues({},e),{toolInstance:n}):__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT:return __spreadProps(__spreadValues({},e),{onSubmit:t.payload.onSubmit});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE:return __spreadProps(__spreadValues({},e),{onSave:t.payload.onSave});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE:return __spreadProps(__spreadValues({},e),{onPageChange:t.payload.onPageChange});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT:return __spreadProps(__spreadValues({},e),{predictionResult:t.payload.result});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE:return __spreadProps(__spreadValues({},e),{predictionResultVisible:t.payload.visible});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE:return __spreadProps(__spreadValues({},e),{onStepChange:t.payload.onStepChange});case Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA:return __spreadProps(__spreadValues({},e),{getFileData:t.payload.getFileData});case Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE:return __spreadProps(__spreadValues({},e),{pageSize:t.payload.pageSize});case Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST:return __spreadProps(__spreadValues({},e),{loadFileList:t.payload.loadFileList});case Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE:return __spreadProps(__spreadValues({},e),{beforeRotate:t.payload.beforeRotate});case Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS:return __spreadProps(__spreadValues({},e),{preDataProcess:t.payload.preDataProcess});case Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING:return __spreadProps(__spreadValues({},e),{skipBeforePageTurning:t.payload.skipBeforePageTurning});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:o}=t.payload,{imgList:l}=e,i=[...l];return i[o]=__spreadValues(__spreadValues({},i[o]),n),__spreadProps(__spreadValues({},e),{imgList:i})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:o}=e;return o&&o()===!1||(H=n==null?void 0:n.updateRotate)==null||H.call(n),e}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=e,o=(z=n==null?void 0:n.valid)!=null?z:!0;return antd.Modal.destroyAll(),antd.Modal.confirm({content:lbUtils.i18n.t(o?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!o)},okText:lbUtils.i18n.t("Confirm"),cancelText:lbUtils.i18n.t("Cancel")}),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:o,imgList:l,step:i}=e;if(!n)return e;if(o===0||o>=l.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const a=l[o-1].result;if(!a)return e;const r=AnnotationDataUtils.copyResultChange(a,i,(K=l[o].result)!=null?K:"");l[o]=__spreadProps(__spreadValues({},l[o]),{result:r});const d=index.jsonParser(r)[`step_${i}`],c=(d==null?void 0:d.result)||[];return n==null||n.setResult(c),n==null||n.history.pushHistory(c),(W=n==null?void 0:n.asyncData)==null||W.call(n,l[o]),__spreadProps(__spreadValues({},e),{imgList:[...l]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:o}=e,{toStep:l}=t.payload;if(!o)return e;const i=getStepConfig(n,l);return o==null||o.setToolName(i.tool,i.config),__spreadProps(__spreadValues({},e),{step:l,toolInstance:o==null?void 0:o.toolInstance})}case Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loadPCDFileLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{pointCloudLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE:{const{checkMode:n}=t.payload;return __spreadProps(__spreadValues({},e),{checkMode:!!n})}case Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=t.payload;return __spreadProps(__spreadValues({},e),{highlightAttribute:n})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:o,rangeIndex:l,imgList:i}=t.payload,{imgIndex:a,onSubmit:r}=e,p=[],d=i.map((c,T)=>{if(lbAnnotation.MathUtils.isInRange(T,l)){const O=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateTrackID({id:n,newID:o,result:c.result})});return p.push({imgIndex:T,newInfo:O}),O}return c});return r&&r([d[a]],index$1.ESubmitType.BatchUpdateTrackID,a,d,{updateImgList:p}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:o,rangeIndex:l}=t.payload,{imgList:i,imgIndex:a,onSubmit:r}=e,p=[],d=i.map((c,T)=>{if(lbAnnotation.MathUtils.isInRange(T,l)){const O=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateResultByTrackID({id:n,newData:o,result:c.result})});return p.push({imgIndex:T,newInfo:O}),O}return c});return r&&r([d[a]],index$1.ESubmitType.BatchUpdateTrackID,a,d,{updateImgList:p}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:o,stepList:l,step:i,predictionResult:a}=e,r={};a.forEach(T=>{const{index:O}=T;r[O]=___default.default.pick(T,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const p=`step_${i}`,d=[],c=o.map((T,O)=>{if(r[O]){const f=T.result==="{}"?index.jsonParser(data.composeResult("",{step:i,stepList:l},{rect:[]},{})):index.jsonParser(T.result);f[p].result.push(r[O]);const C=__spreadProps(__spreadValues({},T),{result:JSON.stringify(f)});return d.push({imgIndex:O,newInfo:C}),C}return T});return n==null||n(c,index$1.ESubmitType.BatchUpdateImgList,-1,c,{updateImgList:d}),__spreadProps(__spreadValues({},e),{imgList:c})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.composeResultByToolInstance=composeResultByToolInstance,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$2=require("../../components/customResizeHook/index.js"),index$1=require("../../constant/index.js"),styleString=require("../../constant/styleString.js"),Actions=require("../Actions.js"),index=require("../../utils/index.js"),AnnotationDataUtils=require("../../utils/AnnotationDataUtils.js"),ConfigUtils=require("../../utils/ConfigUtils.js"),data=require("../../utils/data.js"),StepUtils=require("../../utils/StepUtils.js"),ToolUtils=require("../../utils/ToolUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),antd=require("antd"),es=require("antd/es"),_=require("lodash"),actionCreators=require("./actionCreators.js"),ToolType=require("../../data/enums/ToolType.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,l)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,__spreadValues=(e,t)=>{for(var l in t||(t={}))__hasOwnProp.call(t,l)&&__defNormalProp(e,l,t[l]);if(__getOwnPropSymbols)for(var l of __getOwnPropSymbols(t))__propIsEnum.call(t,l)&&__defNormalProp(e,l,t[l]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,l)=>new Promise((g,u)=>{var S=I=>{try{O(l.next(I))}catch(E){u(E)}},p=I=>{try{O(l.throw(I))}catch(E){u(E)}},O=I=>I.done?g(I.value):Promise.resolve(I.value).then(S,p);O((l=l.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(l=>l.step===t),initialState={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},getTotalPage=e=>{const{imgList:t,imgPageSize:l}=e;return Math.ceil(t.length/l)},calcStepProgress=(e,t)=>e.reduce((l,g)=>{if(g){const u=g.result;if(index.jsonParser(u)[`step_${t}`])return l+1}return l},0)/e.length,updateToolInstance=(e,t)=>{const{step:l,stepList:g}=e,u=StepUtils.getCurrentStepInfo(l,g),S=ConfigUtils.ConfigUtils.jsonParser(u.config);if(ToolUtils.isVideoTool(u==null?void 0:u.tool)||ToolUtils.isAudioTool(u==null?void 0:u.tool)||ToolUtils.isPointCloudTool(u==null?void 0:u.tool)||[ToolType.EToolName.LLM,ToolType.EToolName.NLP].includes(u==null?void 0:u.tool))return;const p=document.getElementById("toolContainer");if(!p)throw"Not exist dom named id-toolContainer";const O=index$2.getFormatSize({width:window.innerWidth,height:window.innerHeight}),I=new lbAnnotation.AnnotationEngine({container:p,toolName:u.tool,size:O,imgNode:t,config:S,style:JSON.parse(styleString)});return{toolInstance:I==null?void 0:I.toolInstance,annotationEngine:I}},LoadFileAndFileData=(e,t)=>(l,g)=>__async(void 0,null,function*(){var u,S;const{stepList:p,step:O}=g().annotation,I=StepUtils.currentToolIsVideo(O,p),E=StepUtils.currentToolIsPointCloud(O,p),D=((u=StepUtils.getCurrentStepInfo(O,p))==null?void 0:u.tool)===ToolType.EToolName.LLM,y=((S=StepUtils.getCurrentStepInfo(O,p))==null?void 0:S.tool)===ToolType.EToolName.NLP,P=StepUtils.currentToolIsAudio(O,p);if(actionCreators.SetAnnotationLoading(l,!0),yield l(TryGetFileDataByAPI(e)),I){l(AfterVideoLoaded(e));return}if(E||D||P||y){l(AfterCommonLoaded(e));return}l(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,l)=>__async(void 0,null,function*(){const{getFileData:g,imgList:u}=l().annotation;if(g){const S=yield g(u[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:S,index:e}})}}),AfterVideoLoaded=e=>t=>{t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterCommonLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(l,g)=>{var u;const{toolInstance:S,imgList:p}=g().annotation,O=(u=p==null?void 0:p[e])==null?void 0:u.url;lbAnnotation.ImgUtils.load(O).then(I=>{actionCreators.SetAnnotationLoading(l,!1),l({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:I,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(l,!1),S==null||S.setErrorImg(),l({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},composeResultByToolInstance=({toolInstance:e,imgList:t,imgIndex:l,stepList:g,step:u=1})=>{var S,p,O,I;const E=((S=t[l])==null?void 0:S.result)||"",[D,y,P]=(p=e==null?void 0:e.exportData())!=null?p:[],x=(I=(O=e==null?void 0:e.exportCustomData)==null?void 0:O.call(e))!=null?I:{},B=data.composeResultWithBasicImgInfo(E,y),w=data.composeResult(B,{step:u,stepList:g},{rect:D},x);return t.map((b,F)=>F===l?__spreadValues(__spreadProps(__spreadValues({},b),{result:w}),P):__spreadValues({},b))},annotationReducer=(e=__spreadValues({},initialState),t)=>{var l,g,u,S,p,O,I,E,D,y,P,x,B,w,b,F,G,M,V,q,k,H,z,K,W,$,X,Y,J;switch(t.type){case Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE:return __spreadValues(__spreadValues({},e),initialState);case Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE:return __spreadProps(__spreadValues({},e),{toolInstance:t.payload.toolInstance});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST:return __spreadProps(__spreadValues({},e),{imgList:t.payload.imgList});case Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS:{const{imgList:n,step:o}=e,s=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:s})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:s,stepList:i,toolInstance:a,onSubmit:r,resultList:A}=e;if(!a||!n[o])return e;const T=((l=n[o])==null?void 0:l.result)||"",[,d,c]=(g=a==null?void 0:a.exportData())!=null?g:[],N=(S=(u=a==null?void 0:a.exportCustomData)==null?void 0:u.call(a))!=null?S:{},f=data.composeResultWithBasicImgInfo(T,d),L=data.composeResult(f,{step:s,stepList:i},{rect:A},N),m=e.imgList.map((v,C)=>{if(C===o){const U=AnnotationDataUtils.dataCorrection(L,T,s,i);return __spreadValues(__spreadProps(__spreadValues({},v),{result:U}),c)}return v});if(((p=t.payload)==null?void 0:p.submitType)===index$1.ESubmitType.SyncImgList)return __spreadProps(__spreadValues({},e),{imgList:m});r&&r([m[o]],(O=t.payload)==null?void 0:O.submitType,o,m);const R=calcStepProgress(m,s);return __spreadProps(__spreadValues({},e),{stepProgress:R,imgList:m})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:s}=e;return s==null||s(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:s,toolInstance:i,basicResultList:a}=e;if(!i)return e;const[r]=(I=i==null?void 0:i.exportData())!=null?I:[];let A=r;if((a==null?void 0:a.length)>0){const T=(E=a[o])==null?void 0:E.id,d=r.map(c=>__spreadProps(__spreadValues({},c),{sourceID:T}));A=___default.default.cloneDeep(s).filter(c=>c.sourceID!==T),A.push(...d)}return __spreadProps(__spreadValues({},e),{resultList:A,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:s,imgIndex:i,stepList:a,annotationEngine:r,resultList:A,basicResultList:T}=e;if(!n||!r)return e;const d=t.payload.basicIndex,c=(D=T[d])==null?void 0:D.id,N=index.jsonParser((y=s[i])==null?void 0:y.result),f=(A||[]).filter(U=>U.sourceID===c),L=getStepConfig(a,o),{dataSourceStep:m,tool:R}=L,v=getStepConfig(a,m);let C=[];return m&&R&&(C=(P=N[`step_${m}`])==null?void 0:P.result,(C==null?void 0:C.length)>0?(r==null||r.setBasicInfo(v.tool,C[d]),r==null||r.launchOperation()):(r==null||r.setBasicInfo(v.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:d})}case Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=t.payload;return __spreadProps(__spreadValues({},e),{triggerEventAfterIndexChanged:!!n})}case Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA:{const{imgList:n,step:o,toolInstance:s,annotationEngine:i,stepList:a}=e;if(!s)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const r=StepUtils.getCurrentStepInfo(o,a),{nextIndex:A,imgNode:T,nextBasicIndex:d,imgError:c}=t.payload,N=d!=null?d:0,f=index.jsonParser((x=n[A])==null?void 0:x.result),L=f[`step_${r.step}`],m=!L,R={rotate:(B=f.rotate)!=null?B:0,valid:(w=f.valid)!=null?w:!0};T&&c!==!0?i==null||i.setImgNode(T,R):s==null||s.setValid(R.valid);const v=getStepConfig(a,r.step),{dataSourceStep:C,tool:U}=v,Z=getStepConfig(a,C),Q=C&&U,h=(F=(b=f[`step_${C}`])==null?void 0:b.result)!=null?F:[],j=AnnotationDataUtils.getInitialResultList(L==null?void 0:L.result,s,v,h,m);if(i==null||i.launchOperation(),Q&&((h==null?void 0:h.length)>0?i==null||i.setBasicInfo(Z.tool,h[N]):(i==null||i.setBasicInfo(Z.tool),i==null||i.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),r.tool!=="check"){const ee=(M=(G=h[N])==null?void 0:G.id)!=null?M:"",te=Q?j.filter(ne=>lbAnnotation.CommonToolUtils.isSameSourceID(ne.sourceID,ee)):j;(V=s==null?void 0:s.history)==null||V.initRecord(j,!0),s==null||s.setResult(te)}return __spreadProps(__spreadValues({},e),{imgIndex:A,basicIndex:N,basicResultList:h,resultList:j})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(q=t.payload.config)!=null?q:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST:{const{stepList:n}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n})}case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:o}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:o})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,o=updateToolInstance(e,n);if(o){const{toolInstance:s,annotationEngine:i}=o;return __spreadProps(__spreadValues({},e),{toolInstance:s,annotationEngine:i})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(k=t.payload)==null?void 0:k.instance;return n?__spreadProps(__spreadValues({},e),{toolInstance:n}):__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT:return __spreadProps(__spreadValues({},e),{onSubmit:t.payload.onSubmit});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE:return __spreadProps(__spreadValues({},e),{onSave:t.payload.onSave});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE:return __spreadProps(__spreadValues({},e),{onPageChange:t.payload.onPageChange});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT:return __spreadProps(__spreadValues({},e),{predictionResult:t.payload.result});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE:return __spreadProps(__spreadValues({},e),{predictionResultVisible:t.payload.visible});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE:return __spreadProps(__spreadValues({},e),{onStepChange:t.payload.onStepChange});case Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA:return __spreadProps(__spreadValues({},e),{getFileData:t.payload.getFileData});case Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE:return __spreadProps(__spreadValues({},e),{pageSize:t.payload.pageSize});case Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST:return __spreadProps(__spreadValues({},e),{loadFileList:t.payload.loadFileList});case Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE:return __spreadProps(__spreadValues({},e),{beforeRotate:t.payload.beforeRotate});case Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS:return __spreadProps(__spreadValues({},e),{preDataProcess:t.payload.preDataProcess});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_INDEX_BY_EXTERNAL:return __spreadProps(__spreadValues({},e),{getImgIndexByExternal:t.payload.getImgIndexByExternal});case Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING:return __spreadProps(__spreadValues({},e),{skipBeforePageTurning:t.payload.skipBeforePageTurning});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:o}=t.payload,{imgList:s}=e,i=[...s];return i[o]=__spreadValues(__spreadValues({},i[o]),n),__spreadProps(__spreadValues({},e),{imgList:i})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:o}=e;return o&&o()===!1||(H=n==null?void 0:n.updateRotate)==null||H.call(n),e}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=e,o=(z=n==null?void 0:n.valid)!=null?z:!0;return antd.Modal.destroyAll(),antd.Modal.confirm({content:lbUtils.i18n.t(o?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!o)},okText:lbUtils.i18n.t("Confirm"),cancelText:lbUtils.i18n.t("Cancel")}),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:o,imgList:s,step:i,stepList:a}=e;if(!n)return e;if(o===0||o>=s.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const r=s[o-1].result;if(!r)return e;const A=StepUtils.getCurrentStepInfo(i,a),T=(K=A==null?void 0:A.step)!=null?K:i,d=(W=n==null?void 0:n.valid)!=null?W:!0,c=AnnotationDataUtils.copyResultChange({copyResult:r,step:T,currentResult:($=s[o].result)!=null?$:"",preMappingImgList:(X=s[o-1].mappingImgList)!=null?X:[],mappingImgList:(Y=s[o].mappingImgList)!=null?Y:[],valid:d});s[o]=__spreadProps(__spreadValues({},s[o]),{result:c});const f=index.jsonParser(c)[`step_${i}`],L=(f==null?void 0:f.result)||[];return n==null||n.setResult(L),n==null||n.history.pushHistory(L),(J=n==null?void 0:n.asyncData)==null||J.call(n,s[o]),__spreadProps(__spreadValues({},e),{imgList:[...s]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:o}=e,{toStep:s}=t.payload;if(o){const i=getStepConfig(n,s);return o==null||o.setToolName(i.tool,i.config),__spreadProps(__spreadValues({},e),{step:s,toolInstance:o==null?void 0:o.toolInstance})}return __spreadProps(__spreadValues({},e),{step:s})}case Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loadPCDFileLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{pointCloudLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE:{const{checkMode:n}=t.payload;return __spreadProps(__spreadValues({},e),{checkMode:!!n})}case Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=t.payload;return __spreadProps(__spreadValues({},e),{highlightAttribute:n})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:o,rangeIndex:s,imgList:i}=t.payload,{imgIndex:a,onSubmit:r}=e,A=[],T=i.map((d,c)=>{if(lbAnnotation.MathUtils.isInRange(c,s)){const N=__spreadProps(__spreadValues({},d),{result:lbUtils.PointCloudUtils.batchUpdateTrackID({id:n,newID:o,result:d.result})});return A.push({imgIndex:c,newInfo:N}),N}return d});return r&&r([T[a]],index$1.ESubmitType.BatchUpdateTrackID,a,T,{updateImgList:A}),__spreadProps(__spreadValues({},e),{imgList:T})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:o,rangeIndex:s}=t.payload,{imgList:i,imgIndex:a,onSubmit:r}=e,A=[],T=i.map((d,c)=>{if(lbAnnotation.MathUtils.isInRange(c,s)){const N=__spreadProps(__spreadValues({},d),{result:lbUtils.PointCloudUtils.batchUpdateResultByTrackID({id:n,newData:o,result:d.result})});return A.push({imgIndex:c,newInfo:N}),N}return d});return r&&r([T[a]],index$1.ESubmitType.BatchUpdateTrackID,a,T,{updateImgList:A}),__spreadProps(__spreadValues({},e),{imgList:T})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:o,stepList:s,step:i,predictionResult:a}=e,r={};a.forEach(c=>{const{index:N}=c;r[N]=___default.default.pick(c,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const A=`step_${i}`,T=[],d=o.map((c,N)=>{if(r[N]){const f=c.result==="{}"?index.jsonParser(data.composeResult("",{step:i,stepList:s},{rect:[]},{})):index.jsonParser(c.result);f[A].result.push(r[N]);const L=__spreadProps(__spreadValues({},c),{result:JSON.stringify(f)});return T.push({imgIndex:N,newInfo:L}),L}return c});return n==null||n(d,index$1.ESubmitType.BatchUpdateImgList,-1,d,{updateImgList:T}),__spreadProps(__spreadValues({},e),{imgList:d})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.composeResultByToolInstance=composeResultByToolInstance,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
|
package/dist/types/App.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IPointCloudBox } from '@labelbee/lb-utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ToolInstance } from './store/annotation/types';
|
|
4
|
-
import { GetFileData, IFileItem, LoadFileList, OnPageChange, OnSave, OnStepChange, OnSubmit } from './types/data';
|
|
4
|
+
import { GetFileData, GetImgIndexByExternal, IFileItem, LoadFileList, OnPageChange, OnSave, OnStepChange, OnSubmit } from './types/data';
|
|
5
5
|
import { Header, RenderFooter, Sider, DrawLayerSlot } from './types/main';
|
|
6
6
|
import { IStepInfo } from './types/step';
|
|
7
7
|
import { EPointCloudName } from '@labelbee/lb-annotation';
|
|
8
|
+
import type { ToolStyle } from './types/toolStyle';
|
|
8
9
|
interface IAnnotationStyle {
|
|
9
10
|
strokeColor: string;
|
|
10
11
|
fillColor: string;
|
|
@@ -77,6 +78,9 @@ export interface AppProps {
|
|
|
77
78
|
}) => void;
|
|
78
79
|
preDataProcess?: (params: IPreDataProcessParams) => IPointCloudBox[];
|
|
79
80
|
auditContext?: any;
|
|
81
|
+
getImgIndexByExternal: GetImgIndexByExternal;
|
|
82
|
+
annotationBefore?: (setAnnotationData: Function) => void;
|
|
83
|
+
toolStyle?: ToolStyle;
|
|
80
84
|
}
|
|
81
85
|
declare const _default: import("react-redux").ConnectedComponent<React.FC<AppProps>, import("react-redux").Omit<AppProps & {
|
|
82
86
|
children?: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAnswerList, IAnswerSort, ILLMBoxResult, ILLMToolConfig, IWaitAnswerSort, IInputList, ISelectedTags } from '../types';
|
|
2
|
-
export declare const getCurrentResultFromResultList: (result: string) => any;
|
|
2
|
+
export declare const getCurrentResultFromResultList: (result: string, step?: number) => any;
|
|
3
3
|
export declare const formatSort: (sortList: any) => any;
|
|
4
4
|
export declare const getTagResult: (inputList: IInputList[], result?: ISelectedTags) => {};
|
|
5
5
|
export declare const getWaitSortList: (answerList: IAnswerList[], result?: ILLMBoxResult) => {
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SetState } from 'ahooks/lib/useSetState';
|
|
3
|
-
import { IAudioTextToolConfig } from '@labelbee/lb-utils';
|
|
3
|
+
import { IAudioTextToolConfig, ITextConfigItem } from '@labelbee/lb-utils';
|
|
4
4
|
export declare enum EContextType {
|
|
5
5
|
before = "\u524D\u6587",
|
|
6
6
|
after = "\u540E\u6587"
|
|
7
7
|
}
|
|
8
|
+
export declare const DEFAULT_CLIP_TEXT_CONFIG_ITEM: {
|
|
9
|
+
label: string;
|
|
10
|
+
key: string;
|
|
11
|
+
required: boolean;
|
|
12
|
+
default: string;
|
|
13
|
+
maxLength: number;
|
|
14
|
+
}[];
|
|
8
15
|
interface IAudioContextProps {
|
|
9
16
|
audioContext: {
|
|
10
17
|
visible?: boolean;
|
|
@@ -19,7 +26,7 @@ export interface ISelectedRegion {
|
|
|
19
26
|
id?: string;
|
|
20
27
|
loop?: boolean;
|
|
21
28
|
}
|
|
22
|
-
type IAudioClipConfig = Pick<IAudioTextToolConfig, 'clipConfigurable' | 'clipAttributeConfigurable' | 'clipAttributeList' | 'clipTextConfigurable'>;
|
|
29
|
+
type IAudioClipConfig = Pick<IAudioTextToolConfig, 'clipConfigurable' | 'clipAttributeConfigurable' | 'clipAttributeList' | 'clipTextConfigurable' | 'secondaryAttributeConfigurable' | 'subAttributeList'>;
|
|
23
30
|
interface IAudioClipState extends IAudioClipConfig {
|
|
24
31
|
/** 选中的截取属性,新建截取片段的默认属性 */
|
|
25
32
|
selectedAttribute: string;
|
|
@@ -31,6 +38,7 @@ interface IAudioClipState extends IAudioClipConfig {
|
|
|
31
38
|
combined: boolean;
|
|
32
39
|
/** 是否按下分割键 */
|
|
33
40
|
segment: boolean;
|
|
41
|
+
clipTextList: ITextConfigItem[];
|
|
34
42
|
}
|
|
35
43
|
interface IAudioClipContext {
|
|
36
44
|
audioClipState: IAudioClipState;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Process audio tool data
|
|
3
|
+
* @author lixinghua <lixinghua_vendor@sensetime.com>
|
|
4
|
+
* @date 2024.05.14
|
|
5
|
+
*/
|
|
6
|
+
import { IAudioTimeSlice, ITextConfigItem } from '@labelbee/lb-utils';
|
|
7
|
+
export default class DataTransform {
|
|
8
|
+
static getClipTextByConfig: (region: IAudioTimeSlice, clipTextList: ITextConfigItem[], isDefault?: boolean) => IAudioTimeSlice;
|
|
9
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IAudioTimeSlice } from '@labelbee/lb-utils';
|
|
2
|
+
import { IAudioTimeSlice, ITextConfigItem } from '@labelbee/lb-utils';
|
|
3
3
|
import { ISelectedRegion } from '@/components/audioAnnotate/audioContext';
|
|
4
4
|
import { IInputList, RenderFooter } from '@/types/main';
|
|
5
5
|
export interface ISetSelectedRegionParams extends ISelectedRegion {
|
|
6
6
|
/** 是否立即播放截取片段 */
|
|
7
7
|
playImmediately?: boolean;
|
|
8
|
+
isLoopStatus?: boolean;
|
|
8
9
|
}
|
|
9
10
|
interface IAudioPlayerContext {
|
|
10
11
|
count?: number;
|
|
@@ -12,32 +13,38 @@ interface IAudioPlayerContext {
|
|
|
12
13
|
toolName: string;
|
|
13
14
|
imgIndex: number;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
export declare const AudioPlayer: ({ fileData, onLoaded, context, invalid, height, hideError, onError, updateRegion, removeRegion, regions, activeToolPanel, clipConfigurable, clipTextConfigurable, clipAttributeList, clipAttributeConfigurable, isCheck, hoverRegionId, footer, drawLayerSlot, }: {
|
|
16
|
+
interface IProps {
|
|
17
17
|
fileData: any;
|
|
18
|
-
height?: number
|
|
18
|
+
height?: number;
|
|
19
19
|
invalid: boolean;
|
|
20
20
|
onLoaded?: any;
|
|
21
|
-
onError?: (
|
|
22
|
-
context?: IAudioPlayerContext
|
|
23
|
-
hideError?: boolean
|
|
24
|
-
/**
|
|
25
|
-
regions?: IAudioTimeSlice[]
|
|
26
|
-
/**
|
|
27
|
-
updateRegion?: (
|
|
28
|
-
/**
|
|
29
|
-
removeRegion?: (
|
|
30
|
-
/**
|
|
31
|
-
activeToolPanel?: string
|
|
21
|
+
onError?: () => void;
|
|
22
|
+
context?: IAudioPlayerContext;
|
|
23
|
+
hideError?: boolean;
|
|
24
|
+
/** Intercepting fragment data: area changes do not trigger updates */
|
|
25
|
+
regions?: IAudioTimeSlice[];
|
|
26
|
+
/** Update the intercepted fragment. If the passed id does not exist, a new data will be created. */
|
|
27
|
+
updateRegion?: (region: IAudioTimeSlice) => void;
|
|
28
|
+
/** Delete intercepted data based on ID */
|
|
29
|
+
removeRegion?: (id: string) => void;
|
|
30
|
+
/** The currently used tool panel is used to determine whether to display the annotation layer */
|
|
31
|
+
activeToolPanel?: string;
|
|
32
32
|
clipConfigurable: boolean;
|
|
33
33
|
clipTextConfigurable: boolean;
|
|
34
34
|
clipAttributeConfigurable: boolean;
|
|
35
|
+
secondaryAttributeConfigurable: boolean;
|
|
36
|
+
subAttributeList: IInputList[];
|
|
35
37
|
clipAttributeList: IInputList[];
|
|
36
|
-
/**
|
|
37
|
-
isCheck?: boolean
|
|
38
|
-
/**
|
|
39
|
-
hoverRegionId?: string
|
|
40
|
-
footer?: RenderFooter
|
|
38
|
+
/** Whether it is in view mode: In view mode, the new and adjustment functions of interception need to be disabled */
|
|
39
|
+
isCheck?: boolean;
|
|
40
|
+
/** View the hoverId used in the pattern */
|
|
41
|
+
hoverRegionId?: string;
|
|
42
|
+
footer?: RenderFooter;
|
|
41
43
|
drawLayerSlot?: any;
|
|
42
|
-
|
|
44
|
+
clipTextList: ITextConfigItem[];
|
|
45
|
+
lang?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare const AudioPlayerContext: React.Context<IAudioPlayerContext>;
|
|
48
|
+
export declare const AudioPlayer: ({ fileData, onLoaded, context, invalid, height, hideError, onError, updateRegion, removeRegion, regions, activeToolPanel, clipConfigurable, clipTextConfigurable, clipAttributeList, clipAttributeConfigurable, secondaryAttributeConfigurable, subAttributeList, isCheck, hoverRegionId, footer, drawLayerSlot, clipTextList, lang, }: IProps) => React.JSX.Element;
|
|
49
|
+
export declare const WrapAudioPlayer: (props: IProps) => React.JSX.Element;
|
|
43
50
|
export {};
|
|
@@ -10,6 +10,7 @@ interface IPointCloud2DRectOperationViewProps {
|
|
|
10
10
|
config: any;
|
|
11
11
|
checkMode?: boolean;
|
|
12
12
|
afterImgOnLoad: TAfterImgOnLoad;
|
|
13
|
+
shouldExcludePointCloudBoxListUpdate?: boolean;
|
|
13
14
|
}
|
|
14
15
|
declare const _default: import("react-redux").ConnectedComponent<(props: IPointCloud2DRectOperationViewProps) => React.JSX.Element, import("react-redux").Omit<IPointCloud2DRectOperationViewProps, "config">>;
|
|
15
16
|
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IPointCloudBoxRect, IPointCloud2DRectOperationViewRect } from '@labelbee/lb-utils';
|
|
2
|
+
/**
|
|
3
|
+
* 2D视图仅显示选中框体
|
|
4
|
+
*
|
|
5
|
+
* @description 参考 https://y631vj6044.feishu.cn/docx/VZLBdgvU8oJUfSxkOy3cswkKn3f
|
|
6
|
+
* ```选择俯视图对应框体,在选中状态下,2D视图仅展示该框体,其它框体隐藏,非选中状态下还是保持和现有一致都展示```
|
|
7
|
+
*/
|
|
8
|
+
export declare const selectSpecifiedRectsFromTopViewSelectedIds: (selectedIdsByBoxList: string[], rectListByBoxList: IPointCloud2DRectOperationViewRect[], rectListInImage: IPointCloudBoxRect[]) => (IPointCloudBoxRect | IPointCloud2DRectOperationViewRect)[];
|
|
@@ -14,6 +14,7 @@ export interface IAnnotationDataTemporarily {
|
|
|
14
14
|
export interface IAnnotationData2dView {
|
|
15
15
|
annotations: IAnnotationDataTemporarily[];
|
|
16
16
|
url: string;
|
|
17
|
+
fallbackUrl?: string;
|
|
17
18
|
calName?: string;
|
|
18
19
|
calib?: ICalib;
|
|
19
20
|
path: string;
|
|
@@ -24,5 +25,5 @@ interface IProps extends IA2MapStateProps {
|
|
|
24
25
|
checkMode?: boolean;
|
|
25
26
|
measureVisible?: boolean;
|
|
26
27
|
}
|
|
27
|
-
declare const _default: import("react-redux").ConnectedComponent<({ currentData, config, thumbnailWidth, isEnlargeTopView, highlightAttribute, loadPCDFileLoading, checkMode, measureVisible }: IProps) => React.JSX.Element | null, import("react-redux").Omit<IProps, "imgIndex" | "imgList" | "config" | "highlightAttribute" | "loadPCDFileLoading" | "stepInfo" | "currentData" | "configString">>;
|
|
28
|
+
declare const _default: import("react-redux").ConnectedComponent<({ currentData, config, thumbnailWidth, isEnlargeTopView, highlightAttribute, loadPCDFileLoading, checkMode, measureVisible, }: IProps) => React.JSX.Element | null, import("react-redux").Omit<IProps, "imgIndex" | "imgList" | "config" | "highlightAttribute" | "loadPCDFileLoading" | "stepInfo" | "currentData" | "configString">>;
|
|
28
29
|
export default _default;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { IPointCloudBox, IPointCloudBoxList, IPolygonData, IPointCloudSphereList, IPointCloudSphere, ILine, EPointCloudPattern, IPointCloudSegmentation, ICalib, ISize } from '@labelbee/lb-utils';
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import { IPointCloudBox, IPointCloudBoxList, IPolygonData, IPointCloudSphereList, IPointCloudSphere, ILine, EPointCloudPattern, IPointCloudSegmentation, ICalib, ISize, IPointCloudBoxRect, IPointCloud2DRectOperationViewRect } from '@labelbee/lb-utils';
|
|
2
|
+
import React, { PropsWithChildren } from 'react';
|
|
3
|
+
import { EPointCloudBoxRenderTrigger } from '@/utils/ToolPointCloudBoxRenderHelper';
|
|
3
4
|
import { PointCloud, PointCloudAnnotation, ActionsHistory, EToolName } from '@labelbee/lb-annotation';
|
|
5
|
+
import type { MapIndirectWeakSet } from './utils/map';
|
|
6
|
+
import { WindowKeydownListenerHooker } from './hooks/useWindowKeydownListener';
|
|
4
7
|
interface IPointCloudContextInstances {
|
|
5
8
|
topViewInstance?: PointCloudAnnotation;
|
|
6
9
|
sideViewInstance?: PointCloudAnnotation;
|
|
@@ -22,10 +25,14 @@ interface IPointCloudSegment {
|
|
|
22
25
|
type AttrPanelLayout = '' | 'left' | 'right';
|
|
23
26
|
interface IHighlight2DData {
|
|
24
27
|
url: string;
|
|
28
|
+
fallbackUrl: string;
|
|
25
29
|
calib?: ICalib;
|
|
26
30
|
}
|
|
31
|
+
type PickRectObjct = Pick<IPointCloud2DRectOperationViewRect, 'id' | 'attribute' | 'width' | 'height' | 'x' | 'y' | 'imageName'>;
|
|
32
|
+
type UpdateRectListByReducer = (reducer: (prevRectList: IPointCloudBoxRect[], pickRectObject: (item: IPointCloud2DRectOperationViewRect) => PickRectObjct) => IPointCloudBoxRect[]) => void;
|
|
27
33
|
export interface IPointCloudContext extends IPointCloudContextInstances, IPointCloudStatus, IPointCloudSegment {
|
|
28
34
|
pointCloudBoxList: IPointCloudBoxList;
|
|
35
|
+
rectList: IPointCloudBoxRect[];
|
|
29
36
|
pointCloudSphereList: IPointCloudSphereList;
|
|
30
37
|
displayPointCloudList: IPointCloudBoxList;
|
|
31
38
|
displaySphereList: IPointCloudSphereList;
|
|
@@ -47,6 +54,10 @@ export interface IPointCloudContext extends IPointCloudContextInstances, IPointC
|
|
|
47
54
|
addPointCloudSphere: (sphereParams: IPointCloudSphere) => IPointCloudSphere[];
|
|
48
55
|
polygonList: IPolygonData[];
|
|
49
56
|
setPolygonList: (polygonList: IPolygonData[]) => void;
|
|
57
|
+
setRectList: (rectList: IPointCloudBoxRect[]) => void;
|
|
58
|
+
addRectIn2DView: (rect: IPointCloud2DRectOperationViewRect) => void;
|
|
59
|
+
removeRectIn2DView: (rects: IPointCloud2DRectOperationViewRect[]) => void;
|
|
60
|
+
updateRectIn2DView: (rect: IPointCloud2DRectOperationViewRect, mergeSelf?: boolean) => void;
|
|
50
61
|
lineList: ILine[];
|
|
51
62
|
setLineList: (lineList: ILine[]) => void;
|
|
52
63
|
zoom: number;
|
|
@@ -60,7 +71,7 @@ export interface IPointCloudContext extends IPointCloudContextInstances, IPointC
|
|
|
60
71
|
reRender: (_displayPointCloudList: IPointCloudBoxList, _polygonList: IPolygonData[], _displaySphereList: IPointCloudSphereList, _lineList: ILine[], _segmentation: IPointCloudSegmentation[]) => void;
|
|
61
72
|
attrPanelLayout: AttrPanelLayout;
|
|
62
73
|
setAttrPanelLayout: (layout: AttrPanelLayout) => void;
|
|
63
|
-
syncAllViewPointCloudColor: (newPointCloudList?: IPointCloudBox[], newHighlight2DDataList?: IHighlight2DData[]) => Promise<any>;
|
|
74
|
+
syncAllViewPointCloudColor: (syncByTrigger: EPointCloudBoxRenderTrigger, newPointCloudList?: IPointCloudBox[], newHighlight2DDataList?: IHighlight2DData[]) => Promise<any>;
|
|
64
75
|
defaultAttribute: string;
|
|
65
76
|
setDefaultAttribute: (defaultAttribute: string) => void;
|
|
66
77
|
pointCloudPattern: EToolName.Rect | EToolName.Polygon | EToolName.Point | EToolName.Line;
|
|
@@ -71,6 +82,8 @@ export interface IPointCloudContext extends IPointCloudContextInstances, IPointC
|
|
|
71
82
|
clearAllDetectionInstance: () => void;
|
|
72
83
|
highlight2DDataList: IHighlight2DData[];
|
|
73
84
|
setHighlight2DDataList: (urlList: IHighlight2DData[]) => void;
|
|
85
|
+
highlight2DLoading: boolean;
|
|
86
|
+
setHighlight2DLoading: (loading: boolean) => void;
|
|
74
87
|
imageSizes: {
|
|
75
88
|
[key: string]: ISize;
|
|
76
89
|
};
|
|
@@ -78,7 +91,18 @@ export interface IPointCloudContext extends IPointCloudContextInstances, IPointC
|
|
|
78
91
|
imgNode: HTMLImageElement;
|
|
79
92
|
path: string;
|
|
80
93
|
}) => void;
|
|
94
|
+
addRectFromPointCloudBoxByImageName: (imageName: string) => boolean;
|
|
95
|
+
removeRectBySpecifyId: (imageName: string, ids: string[], idField?: keyof IPointCloudBoxRect) => boolean;
|
|
96
|
+
removeRectByPointCloudBoxId: (imageName: string) => boolean;
|
|
97
|
+
rectRotateSensitivity: number;
|
|
98
|
+
setRectRotateSensitivity: (sensitivity: number) => void;
|
|
99
|
+
/** imageName -> pointCloudBox.id -> [pointCloudBox, ...] */
|
|
100
|
+
imageNamePointCloudBoxMap: MapIndirectWeakSet<IPointCloudBox>;
|
|
101
|
+
/** imageName -> pointCloudBox.id -> [rect, ...] */
|
|
102
|
+
linkageImageNameRectMap: MapIndirectWeakSet<IPointCloudBoxRect>;
|
|
103
|
+
updateRectListByReducer: UpdateRectListByReducer;
|
|
104
|
+
windowKeydownListenerHook: WindowKeydownListenerHooker;
|
|
81
105
|
}
|
|
82
106
|
export declare const PointCloudContext: React.Context<IPointCloudContext>;
|
|
83
|
-
export declare const PointCloudProvider: React.FC<{}
|
|
107
|
+
export declare const PointCloudProvider: React.FC<PropsWithChildren<{}>>;
|
|
84
108
|
export {};
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Render Component for highlight.
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
|
-
declare const HighlightVisible: ({ visible, style, onClick, loading, }: {
|
|
5
|
+
declare const HighlightVisible: ({ visible, style, onClick, loading, disabled, }: {
|
|
6
6
|
visible: boolean;
|
|
7
7
|
loading: boolean;
|
|
8
8
|
style?: React.CSSProperties | undefined;
|
|
9
9
|
onClick: () => void;
|
|
10
|
+
disabled?: boolean | undefined;
|
|
10
11
|
}) => React.JSX.Element;
|
|
11
12
|
export default HighlightVisible;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface UseDataLinkSwitchOptions {
|
|
3
|
+
/** DOM显示层级 */
|
|
4
|
+
zIndex: number;
|
|
5
|
+
/** 是否2d框 */
|
|
6
|
+
is2DView: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* 用来判断图片项,
|
|
9
|
+
* 具体参考:packages/lb-components/src/components/pointCloud2DRectOperationView/index.tsx, getRectListByBoxList函数
|
|
10
|
+
*
|
|
11
|
+
* 基于上参考,此值需确保唯一性!
|
|
12
|
+
*/
|
|
13
|
+
imageName: string;
|
|
14
|
+
}
|
|
15
|
+
declare const useDataLinkSwitch: (opts: UseDataLinkSwitchOptions) => {
|
|
16
|
+
rendered: React.JSX.Element | null;
|
|
17
|
+
isLinking: boolean;
|
|
18
|
+
};
|
|
19
|
+
export default useDataLinkSwitch;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { IAnnotationStateProps } from '../../../store/annotation/map';
|
|
7
7
|
import { ICalib } from '@labelbee/lb-utils';
|
|
8
8
|
declare const useHighlight: ({ currentData }: Partial<IAnnotationStateProps>) => {
|
|
9
|
-
toggle2dVisible: (url: string, calib?: ICalib) => Promise<void>;
|
|
9
|
+
toggle2dVisible: (url: string, fallbackUrl: string, calib?: ICalib) => Promise<void>;
|
|
10
10
|
isHighlightVisible: (url: string) => boolean;
|
|
11
11
|
};
|
|
12
12
|
export { useHighlight };
|
|
@@ -69,6 +69,7 @@ export declare const usePointCloudViews: () => {
|
|
|
69
69
|
updateViewsByDefaultSize?: undefined;
|
|
70
70
|
generateRects?: undefined;
|
|
71
71
|
update2DViewRect?: undefined;
|
|
72
|
+
remove2DViewRect?: undefined;
|
|
72
73
|
} | {
|
|
73
74
|
topViewAddSphere: ({ newPoint, size, zoom, trackConfigurable, }: {
|
|
74
75
|
newPoint: IPointUnit;
|
|
@@ -105,4 +106,11 @@ export declare const usePointCloudViews: () => {
|
|
|
105
106
|
boxID: string;
|
|
106
107
|
imageName: string;
|
|
107
108
|
}) => IPointCloudBox[] | undefined;
|
|
109
|
+
remove2DViewRect: (params: {
|
|
110
|
+
boxID: string;
|
|
111
|
+
imageName: string;
|
|
112
|
+
}) => IPointCloudBox[] | undefined;
|
|
113
|
+
};
|
|
114
|
+
export declare const useSyncRectPositionDimensionToPointCloudList: () => {
|
|
115
|
+
syncToPointCloudBoxList: () => IPointCloudBox[] | null;
|
|
108
116
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { IAnnotationStateProps } from '@/store/annotation/map';
|
|
3
|
+
/**
|
|
4
|
+
* PointCloud Rotate Hook
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare const useRotateEdge: ({ currentData }: IAnnotationStateProps) => {
|
|
8
|
+
updateRotateEdge: import("lodash").DebouncedFunc<(angle: number) => void>;
|
|
9
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IPointCloudBox, PartialIPointCloudBoxList } from '@labelbee/lb-utils';
|
|
2
|
+
import { IFileItem } from '@/types/data';
|
|
2
3
|
interface IUseSingleBoxParams {
|
|
3
4
|
generateRects?: (box: IPointCloudBox) => void;
|
|
4
5
|
}
|
|
@@ -13,10 +14,10 @@ export declare const useSingleBox: (props?: IUseSingleBoxParams) => {
|
|
|
13
14
|
changeValidByID: (id: string) => import("@labelbee/lb-utils").IPointCloudBoxList | undefined;
|
|
14
15
|
selectNextBox: (manual?: boolean) => void;
|
|
15
16
|
selectPrevBox: (manual?: boolean) => void;
|
|
16
|
-
deletePointCloudBox: (id: string) => void;
|
|
17
|
+
deletePointCloudBox: (id: string, shouldUpdateMatchingRectList?: boolean) => void;
|
|
17
18
|
selectedBoxes: IPointCloudBox[];
|
|
18
19
|
updateSelectedBoxes: (updateList: PartialIPointCloudBoxList) => import("@labelbee/lb-utils").IPointCloudBoxList | undefined;
|
|
19
20
|
getPointCloudByID: (id: string) => IPointCloudBox | undefined;
|
|
20
|
-
deleteSelectedPointCloudBoxAndPolygon: () => void;
|
|
21
|
+
deleteSelectedPointCloudBoxAndPolygon: (currentData: IFileItem) => void;
|
|
21
22
|
};
|
|
22
23
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proivde the `useWindowKeydownListener` hook (more power except `https://github.com/alibaba/hooks/blob/master/packages/hooks/src/useEventListener/index.ts`)
|
|
3
|
+
* which will have `preappend` or `append` event in your order.
|
|
4
|
+
*/
|
|
5
|
+
import '../utils/event-polyfill';
|
|
6
|
+
type KeydownListener = (e: KeyboardEvent) => void;
|
|
7
|
+
type Caller = (fn: KeydownListener) => () => void;
|
|
8
|
+
export interface WindowKeydownListenerHooker {
|
|
9
|
+
appendEventListener: Caller;
|
|
10
|
+
preappendEventListener: Caller;
|
|
11
|
+
/** Alias for `appendEventListener`, user-friendly name */
|
|
12
|
+
addEventListener: Caller;
|
|
13
|
+
}
|
|
14
|
+
export declare const getEmptyUseWindowKeydownListener: () => WindowKeydownListenerHooker;
|
|
15
|
+
declare const useWindowKeydownListener: () => WindowKeydownListenerHooker;
|
|
16
|
+
export default useWindowKeydownListener;
|