@labelbee/lb-components 1.6.0-alpha.0 → 1.6.0-alpha.10
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/lineTool/icon_line.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/changePointCloudValid.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/copy.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/nextBox.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/nodata.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/patse.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/prevBox.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/selectAll.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/selectMultiple.svg.js +1 -0
- package/dist/assets/annotation/pointTool/icon_point.svg.js +1 -0
- package/dist/assets/annotation/polygonTool/icon_polygon.svg.js +1 -0
- package/dist/assets/annotation/rectTool/icon_rect.svg.js +1 -0
- package/dist/assets/annotation/rectTool/{icon_rectPattern.svg.js → icon_rect_a.svg.js} +0 -0
- package/dist/assets/attributeIcon/eraser.svg.js +1 -0
- package/dist/assets/attributeIcon/eraser_a.svg.js +1 -0
- package/dist/assets/attributeIcon/pen.svg.js +1 -0
- package/dist/assets/attributeIcon/pen_a.svg.js +1 -0
- package/dist/assets/{cssIcon/annotation/icon_clearSmall.svg → icons/25541b4d.svg} +0 -0
- package/dist/assets/icons/25ef334b.svg +8 -0
- package/dist/assets/icons/7eadb9c4.svg +5 -0
- package/dist/assets/icons/9d70807.svg +5 -0
- package/dist/assets/icons/c5b4262e.png +0 -0
- package/dist/assets/{cssIcon/slide_btn.svg → icons/cc550fff.svg} +0 -0
- package/dist/assets/{cssIcon/annotation/icon_clearSmall_a.svg → icons/dc9b6bfc.svg} +0 -0
- package/dist/assets/icons/e4f0b7fe.png +0 -0
- package/dist/components/AnnotationView/index.js +1 -1
- package/dist/components/AnnotationView/pointCloudAnnotationView.js +1 -0
- package/dist/components/attributeList/index.js +1 -1
- package/dist/components/customResizeHook/index.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DView.js +1 -0
- package/dist/components/pointCloudView/PointCloud3DView.js +1 -0
- package/dist/components/pointCloudView/PointCloudBackView.js +1 -0
- package/dist/components/pointCloudView/PointCloudContext.js +1 -0
- package/dist/components/pointCloudView/PointCloudInfos.js +1 -0
- package/dist/components/pointCloudView/PointCloudLayout.js +1 -0
- package/dist/components/pointCloudView/PointCloudListener.js +1 -0
- package/dist/components/pointCloudView/PointCloudSideView.js +1 -0
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -0
- package/dist/components/pointCloudView/components/EmptyPage/index.js +1 -0
- package/dist/components/pointCloudView/hooks/useBoxes.js +1 -0
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -0
- package/dist/components/pointCloudView/hooks/usePolygon.js +1 -0
- package/dist/components/pointCloudView/hooks/useRotate.js +1 -0
- package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -0
- package/dist/components/pointCloudView/hooks/useStatus.js +1 -0
- package/dist/components/pointCloudView/hooks/useZoom.js +1 -0
- package/dist/components/pointCloudView/index.js +1 -0
- package/dist/components/videoAnnotate/index.js +1 -1
- package/dist/data/enums/ToolType.js +1 -1
- package/dist/hooks/annotation.js +1 -0
- package/dist/hooks/useSize.js +1 -1
- package/dist/index.css +314 -44
- package/dist/index.js +1 -1
- package/dist/store/Actions.js +1 -1
- package/dist/store/annotation/actionCreators.js +1 -1
- package/dist/store/annotation/map.js +1 -0
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/store/ctx.js +1 -0
- package/dist/types/App.d.ts +10 -2
- package/dist/types/components/AnnotationView/index.d.ts +6 -5
- package/dist/types/components/AnnotationView/pointCloudAnnotationView.d.ts +10 -0
- package/dist/types/components/attributeList/index.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +6 -0
- package/dist/types/components/pointCloudView/PointCloud3DView.d.ts +6 -0
- package/dist/types/components/pointCloudView/PointCloudBackView.d.ts +3 -0
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +33 -0
- package/dist/types/components/pointCloudView/PointCloudInfos.d.ts +19 -0
- package/dist/types/components/pointCloudView/PointCloudLayout.d.ts +7 -0
- package/dist/types/components/pointCloudView/PointCloudListener.d.ts +6 -0
- package/dist/types/components/pointCloudView/PointCloudSideView.d.ts +6 -0
- package/dist/types/components/pointCloudView/PointCloudTopView.d.ts +6 -0
- package/dist/types/components/pointCloudView/components/EmptyPage/index.d.ts +2 -0
- package/dist/types/components/pointCloudView/hooks/useBoxes.d.ts +10 -0
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +63 -0
- package/dist/types/components/pointCloudView/hooks/usePolygon.d.ts +9 -0
- package/dist/types/components/pointCloudView/hooks/useRotate.d.ts +8 -0
- package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +13 -0
- package/dist/types/components/pointCloudView/hooks/useStatus.d.ts +11 -0
- package/dist/types/components/pointCloudView/hooks/useZoom.d.ts +7 -0
- package/dist/types/components/pointCloudView/index.d.ts +15 -0
- package/dist/types/components/videoPlayer/TagToolInstanceAdaptor.d.ts +1 -1
- package/dist/types/components/videoPlayer/index.d.ts +1 -1
- package/dist/types/data/enums/ToolType.d.ts +14 -8
- package/dist/types/hooks/annotation.d.ts +32 -0
- package/dist/types/hooks/useSize.d.ts +2 -2
- package/dist/types/index.d.ts +3 -1
- package/dist/types/store/Actions.d.ts +3 -0
- package/dist/types/store/annotation/actionCreators.d.ts +15 -5
- package/dist/types/store/annotation/map.d.ts +13 -0
- package/dist/types/store/annotation/reducer.d.ts +1 -1
- package/dist/types/store/annotation/types.d.ts +2 -0
- package/dist/types/store/ctx.d.ts +4 -0
- package/dist/types/utils/PageOperator.d.ts +1 -1
- package/dist/types/utils/StepUtils.d.ts +7 -0
- package/dist/types/utils/ToolUtils.d.ts +10 -0
- package/dist/types/utils/data.d.ts +1 -1
- package/dist/types/utils/dom.d.ts +1 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/views/MainView/annotationOperation/index.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/GeneralOperation/ActionsConfirm.d.ts +12 -0
- package/dist/types/views/MainView/sidebar/GeneralOperation/index.d.ts +5 -1
- package/dist/types/views/MainView/sidebar/GeneralOperation/useOperationList.d.ts +12 -0
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/index.d.ts +11 -0
- package/dist/types/views/MainView/sidebar/ScribbleSidebar/index.d.ts +6 -0
- package/dist/types/views/MainView/sidebar/ToolIcons.d.ts +11 -0
- package/dist/types/views/MainView/sidebar/ToolStyle/index.d.ts +1 -1
- package/dist/types/views/MainView/sidebar/index.d.ts +1 -0
- package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.d.ts +3 -0
- package/dist/types/views/MainView/toolFooter/Pagination.d.ts +12 -2
- package/dist/types/views/MainView/toolFooter/ZoomController/ZoomLevel/index.d.ts +1 -0
- package/dist/types/views/MainView/toolFooter/ZoomController/index.d.ts +15 -4
- package/dist/types/views/MainView/toolFooter/index.d.ts +7 -9
- package/dist/types/views/MainView/toolHeader/ExportData/index.d.ts +1 -1
- package/dist/utils/StepUtils.js +1 -1
- package/dist/utils/ToolUtils.js +1 -0
- package/dist/utils/data.js +1 -1
- package/dist/utils/dom.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/views/MainView/annotationOperation/index.js +1 -1
- package/dist/views/MainView/annotationTips/index.js +1 -1
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/AnnotationText/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -0
- package/dist/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/useOperationList.js +1 -0
- package/dist/views/MainView/sidebar/ImgAttributeInfo/index.js +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -0
- package/dist/views/MainView/sidebar/ScribbleSidebar/index.js +1 -0
- package/dist/views/MainView/sidebar/SwitchAttributeList/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/sidebar/ToolIcons.js +1 -0
- package/dist/views/MainView/sidebar/ToolStyle/index.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -0
- package/dist/views/MainView/toolFooter/FooterTips/index.js +1 -1
- package/dist/views/MainView/toolFooter/HiddenTips/index.js +1 -1
- package/dist/views/MainView/toolFooter/PageNumber/index.js +1 -1
- package/dist/views/MainView/toolFooter/Pagination.js +1 -1
- package/dist/views/MainView/toolFooter/ZoomController/ZoomLevel/index.js +1 -1
- package/dist/views/MainView/toolFooter/ZoomController/index.js +1 -1
- package/dist/views/MainView/toolFooter/index.js +1 -1
- package/dist/views/MainView/toolHeader/ExportData/index.js +1 -1
- package/dist/views/MainView/toolHeader/StepSwitch/index.js +1 -1
- package/dist/views/MainView/toolHeader/headerOption/index.js +1 -1
- package/dist/views/MainView/toolHeader/index.js +1 -1
- package/es/App.js +1 -1
- package/es/App.js.map +1 -1
- package/es/assets/annotation/lineTool/icon_line.svg.js +1 -0
- package/es/assets/annotation/lineTool/icon_line.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/changePointCloudValid.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/changePointCloudValid.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/copy.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/copy.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/nextBox.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/nextBox.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/nodata.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/nodata.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/patse.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/patse.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/prevBox.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/prevBox.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/selectAll.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/selectAll.svg.js.map +1 -0
- package/es/assets/annotation/pointCloudTool/selectMultiple.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/selectMultiple.svg.js.map +1 -0
- package/es/assets/annotation/pointTool/icon_point.svg.js +1 -0
- package/es/assets/annotation/pointTool/icon_point.svg.js.map +1 -0
- package/es/assets/annotation/polygonTool/icon_polygon.svg.js +1 -0
- package/es/assets/annotation/polygonTool/icon_polygon.svg.js.map +1 -0
- package/es/assets/annotation/rectTool/icon_rect.svg.js +1 -0
- package/es/assets/annotation/rectTool/icon_rect.svg.js.map +1 -0
- package/es/assets/annotation/rectTool/icon_rectPattern.svg.js +4 -1
- package/es/assets/annotation/rectTool/icon_rect_a.svg.js +1 -0
- package/es/assets/annotation/rectTool/icon_rect_a.svg.js.map +1 -0
- package/es/assets/attributeIcon/eraser.svg.js +1 -0
- package/es/assets/attributeIcon/eraser.svg.js.map +1 -0
- package/es/assets/attributeIcon/eraser_a.svg.js +1 -0
- package/es/assets/attributeIcon/eraser_a.svg.js.map +1 -0
- package/es/assets/attributeIcon/pen.svg.js +1 -0
- package/es/assets/attributeIcon/pen.svg.js.map +1 -0
- package/es/assets/attributeIcon/pen_a.svg.js +1 -0
- package/es/assets/attributeIcon/pen_a.svg.js.map +1 -0
- package/es/components/AnnotationView/index.js +1 -1
- package/es/components/AnnotationView/index.js.map +1 -1
- package/es/components/AnnotationView/pointCloudAnnotationView.js +1 -0
- package/es/components/AnnotationView/pointCloudAnnotationView.js.map +1 -0
- package/es/components/attributeList/index.js +1 -1
- package/es/components/attributeList/index.js.map +1 -1
- package/es/components/customResizeHook/index.js +1 -1
- package/es/components/customResizeHook/index.js.map +1 -1
- package/es/components/pointCloudView/PointCloud2DView.js +1 -0
- package/es/components/pointCloudView/PointCloud2DView.js.map +1 -0
- package/es/components/pointCloudView/PointCloud3DView.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js.map +1 -0
- package/es/components/pointCloudView/PointCloudBackView.js +1 -0
- package/es/components/pointCloudView/PointCloudBackView.js.map +1 -0
- package/es/components/pointCloudView/PointCloudContext.js +1 -0
- package/es/components/pointCloudView/PointCloudContext.js.map +1 -0
- package/es/components/pointCloudView/PointCloudInfos.js +1 -0
- package/es/components/pointCloudView/PointCloudInfos.js.map +1 -0
- package/es/components/pointCloudView/PointCloudLayout.js +1 -1
- package/es/components/pointCloudView/PointCloudLayout.js.map +1 -0
- package/es/components/pointCloudView/PointCloudListener.js +1 -0
- package/es/components/pointCloudView/PointCloudListener.js.map +1 -0
- package/es/components/pointCloudView/PointCloudSideView.js +1 -0
- package/es/components/pointCloudView/PointCloudSideView.js.map +1 -0
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js.map +1 -0
- package/es/components/pointCloudView/components/EmptyPage/index.js +1 -0
- package/es/components/pointCloudView/components/EmptyPage/index.js.map +1 -0
- package/es/components/pointCloudView/data.js +4 -0
- package/es/components/pointCloudView/data.js.map +1 -0
- package/es/components/pointCloudView/hooks/useBoxes.js +1 -0
- package/es/components/pointCloudView/hooks/useBoxes.js.map +1 -0
- package/es/components/pointCloudView/hooks/useConfig.js +19 -0
- package/es/components/pointCloudView/hooks/useConfig.js.map +1 -0
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -0
- package/es/components/pointCloudView/hooks/usePointCloudViews.js.map +1 -0
- package/es/components/pointCloudView/hooks/usePolygon.js +1 -0
- package/es/components/pointCloudView/hooks/usePolygon.js.map +1 -0
- package/es/components/pointCloudView/hooks/useRotate.js +1 -0
- package/es/components/pointCloudView/hooks/useRotate.js.map +1 -0
- package/es/components/pointCloudView/hooks/useSingleBox.js +1 -0
- package/es/components/pointCloudView/hooks/useSingleBox.js.map +1 -0
- package/es/components/pointCloudView/hooks/useStatus.js +1 -0
- package/es/components/pointCloudView/hooks/useStatus.js.map +1 -0
- package/es/components/pointCloudView/hooks/useZoom.js +1 -0
- package/es/components/pointCloudView/hooks/useZoom.js.map +1 -0
- package/es/components/pointCloudView/index.js +1 -1
- package/es/components/pointCloudView/index.js.map +1 -0
- package/es/components/videoAnnotate/index.js +1 -1
- package/es/components/videoAnnotate/index.js.map +1 -1
- package/es/data/enums/ToolType.js +1 -1
- package/es/data/enums/ToolType.js.map +1 -1
- package/es/hooks/annotation.js +1 -0
- package/es/hooks/annotation.js.map +1 -0
- package/es/hooks/useConfig.js +18 -0
- package/es/hooks/useConfig.js.map +1 -0
- package/es/hooks/useSize.js +1 -1
- package/es/hooks/useSize.js.map +1 -1
- package/es/index.css +1404 -0
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/store/Actions.js +1 -1
- package/es/store/Actions.js.map +1 -1
- package/es/store/annotation/actionCreators.js +1 -1
- package/es/store/annotation/actionCreators.js.map +1 -1
- package/es/store/annotation/map.js +1 -0
- package/es/store/annotation/map.js.map +1 -0
- package/es/store/annotation/reducer.js +1 -1
- package/es/store/annotation/reducer.js.map +1 -1
- package/es/store/ctx.js +1 -0
- package/es/store/ctx.js.map +1 -0
- package/es/utils/StepUtils.js +1 -1
- package/es/utils/StepUtils.js.map +1 -1
- package/es/utils/ToolUtils.js.map +1 -0
- package/es/utils/data.js +1 -1
- package/es/utils/data.js.map +1 -1
- package/es/utils/dom.js +1 -1
- package/es/utils/dom.js.map +1 -1
- package/es/utils/index.js +1 -1
- package/es/utils/index.js.map +1 -1
- package/es/views/MainView/annotationOperation/index.js +1 -1
- package/es/views/MainView/annotationOperation/index.js.map +1 -1
- package/es/views/MainView/annotationTips/index.js +1 -1
- package/es/views/MainView/annotationTips/index.js.map +1 -1
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/index.js.map +1 -1
- package/es/views/MainView/sidebar/AnnotationText/index.js +1 -1
- package/es/views/MainView/sidebar/AnnotationText/index.js.map +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -0
- package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js.map +1 -0
- package/es/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/index.js.map +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/useOperationList.js +1 -0
- package/es/views/MainView/sidebar/GeneralOperation/useOperationList.js.map +1 -0
- package/es/views/MainView/sidebar/ImgAttributeInfo/index.js +1 -1
- package/es/views/MainView/sidebar/ImgAttributeInfo/index.js.map +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js.map +1 -0
- package/es/views/MainView/sidebar/ScribbleSidebar/index.js +1 -0
- package/es/views/MainView/sidebar/ScribbleSidebar/index.js.map +1 -0
- package/es/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
- package/es/views/MainView/sidebar/SwitchAttributeList/index.js.map +1 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js.map +1 -1
- package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TextToolSidebar/index.js.map +1 -1
- package/es/views/MainView/sidebar/ToolIcons.js +1 -0
- package/es/views/MainView/sidebar/ToolIcons.js.map +1 -0
- package/es/views/MainView/sidebar/ToolStyle/index.js +1 -1
- package/es/views/MainView/sidebar/ToolStyle/index.js.map +1 -1
- package/es/views/MainView/sidebar/index.js +1 -1
- package/es/views/MainView/sidebar/index.js.map +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js.map +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -0
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js.map +1 -0
- package/es/views/MainView/toolFooter/FooterTips/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/index.js.map +1 -1
- package/es/views/MainView/toolFooter/HiddenTips/index.js +1 -1
- package/es/views/MainView/toolFooter/HiddenTips/index.js.map +1 -1
- package/es/views/MainView/toolFooter/PageNumber/index.js +1 -1
- package/es/views/MainView/toolFooter/PageNumber/index.js.map +1 -1
- package/es/views/MainView/toolFooter/Pagination.js +1 -1
- package/es/views/MainView/toolFooter/Pagination.js.map +1 -1
- package/es/views/MainView/toolFooter/ZoomController/ZoomLevel/index.js +1 -1
- package/es/views/MainView/toolFooter/ZoomController/ZoomLevel/index.js.map +1 -1
- package/es/views/MainView/toolFooter/ZoomController/index.js +1 -1
- package/es/views/MainView/toolFooter/ZoomController/index.js.map +1 -1
- package/es/views/MainView/toolFooter/index.js +1 -1
- package/es/views/MainView/toolFooter/index.js.map +1 -1
- package/es/views/MainView/toolHeader/ExportData/index.js +1 -1
- package/es/views/MainView/toolHeader/ExportData/index.js.map +1 -1
- package/es/views/MainView/toolHeader/StepSwitch/index.js +1 -1
- package/es/views/MainView/toolHeader/StepSwitch/index.js.map +1 -1
- package/es/views/MainView/toolHeader/headerOption/index.js +1 -1
- package/es/views/MainView/toolHeader/headerOption/index.js.map +1 -1
- package/es/views/MainView/toolHeader/index.js +1 -1
- package/es/views/MainView/toolHeader/index.js.map +1 -1
- package/package.json +9 -8
- package/dist/index.css.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{store as
|
|
1
|
+
import{store as L}from"../../../index.js";import{LabelBeeContext as N}from"../../../store/ctx.js";import{message as I}from"antd/es";import D from"lodash";import u,{useState as O,useRef as _,useEffect as a}from"react";import{connect as M}from"react-redux";import U from"../../../components/fileException/FileError.js";import Z from"../../../hooks/useSize.js";import{InitToolStyleConfig as k}from"../../../store/toolStyle/actionCreators.js";import{ImgUtils as B}from"@labelbee/lb-annotation";import{i18n as P}from"@labelbee/lb-utils";import F from"../../../utils/StepUtils.js";var T=Object.defineProperty,V=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,j=(o,t,n)=>t in o?T(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,h=(o,t)=>{for(var n in t||(t={}))$.call(t,n)&&j(o,n,t[n]);if(E)for(var n of E(t))q.call(t,n)&&j(o,n,t[n]);return o},G=(o,t)=>V(o,Y(t));const H=o=>{const[,t]=O(0),{imgAttribute:n,toolStyle:l,toolInstance:e,annotationEngine:r,imgList:p,imgIndex:w,dataInjectionAtCreation:d,renderEnhance:g,customRenderStyle:f,stepList:v,step:x,drawLayerSlot:S}=o,[A,y]=O({zoom:1,currentPos:{x:0,y:0}}),b=_(null),C=_(null),c=Z(b);a(()=>{L.dispatch(k())},[]),a(()=>{if(!!r){switch(P.language){case"cn":case"en":r.setLang(P.language);break}r==null||r.setDataInjectionAtCreation(d),r==null||r.setRenderEnhance(g),f&&(r==null||r.setCustomRenderStyle(f))}},[r,d,g,f]),a(()=>{const s=(i,z)=>{y({zoom:i,currentPos:z})},m=i=>{y(i)};return e&&(e.singleOn("messageError",i=>{I.error(i)}),e.singleOn("messageInfo",i=>{I.info(i)}),e.singleOn("changeAnnotationShow",()=>{t(i=>i+1)}),e.on("renderZoom",s),e.on("dragMove",m)),()=>{e&&(e.unbind("renderZoom",s),e.unbind("dragMove",m))}},[e]),a(()=>{e&&e.setImgAttribute(n)},[n]),a(()=>{e&&e.setStyle(l),r&&r.setStyle(l)},[l]),a(()=>{(e==null?void 0:e.setSize)&&e.setSize(c),r&&r.setSize(c)},[c]),a(()=>{const s=F.getCurrentStepInfo(x,v);e==null||e.setConfig(s.config)},[v]);const R=()=>{const s=p==null?void 0:p[w];!(s==null?void 0:s.url)||B.load(s.url).then(m=>{r.setImgNode(m)})};return u.createElement("div",{ref:b,className:"annotationOperation"},u.createElement("div",{className:"canvas",ref:C,style:c,id:"toolContainer"},S==null?void 0:S(A)),(e==null?void 0:e.isImgError)===!0&&u.createElement(U,G(h({},c),{reloadImage:R,backgroundColor:"#e2e2e2",ignoreOffsetY:!0})))},J=o=>{const t=D.pickBy(o.annotation,(n,l)=>["imgList","imgIndex","stepList","step","toolInstance","annotationEngine","loading"].includes(l));return h({imgAttribute:o.imgAttribute,toolStyle:o.toolStyle},t)};var K=M(J,null,null,{context:N})(H);export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/views/MainView/annotationOperation/index.tsx"],"sourcesContent":["import { store } from '@/index';\nimport { message } from 'antd/es';\nimport _ from 'lodash';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { connect } from 'react-redux';\nimport { AppState } from 'src/store';\nimport { ImgAttributeState } from 'src/store/imgAttribute/types';\n\nimport { AppProps } from '@/App';\nimport FileError from '@/components/fileException/FileError';\nimport useSize from '@/hooks/useSize';\nimport { InitToolStyleConfig } from '@/store/toolStyle/actionCreators';\nimport { AnnotationEngine, ImgUtils } from '@labelbee/lb-annotation';\nimport { i18n } from '@labelbee/lb-utils';\n\ninterface IProps extends AppState, AppProps {\n imgAttribute: ImgAttributeState;\n imgIndex: number;\n annotationEngine: AnnotationEngine;\n loading: boolean;\n}\n\nconst AnnotationOperation: React.FC<IProps> = (props: IProps) => {\n const [, forceRender] = useState<number>(0);\n\n const {\n imgAttribute,\n toolStyle,\n toolInstance,\n annotationEngine,\n imgList,\n imgIndex,\n dataInjectionAtCreation,\n renderEnhance,\n customRenderStyle,\n } = props;\n const
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/views/MainView/annotationOperation/index.tsx"],"sourcesContent":["import { store } from '@/index';\nimport { LabelBeeContext } from '@/store/ctx';\nimport { message } from 'antd/es';\nimport _ from 'lodash';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { connect } from 'react-redux';\nimport { AppState } from 'src/store';\nimport { ImgAttributeState } from 'src/store/imgAttribute/types';\n\nimport { AppProps } from '@/App';\nimport FileError from '@/components/fileException/FileError';\nimport useSize from '@/hooks/useSize';\nimport { InitToolStyleConfig } from '@/store/toolStyle/actionCreators';\nimport { AnnotationEngine, ImgUtils } from '@labelbee/lb-annotation';\nimport { i18n } from '@labelbee/lb-utils';\nimport { IStepInfo } from '@/types/step';\nimport StepUtils from '@/utils/StepUtils';\n\ninterface IProps extends AppState, AppProps {\n imgAttribute: ImgAttributeState;\n imgIndex: number;\n annotationEngine: AnnotationEngine;\n loading: boolean;\n stepList: IStepInfo[];\n step: number;\n}\n\nconst AnnotationOperation: React.FC<IProps> = (props: IProps) => {\n const [, forceRender] = useState<number>(0);\n\n const {\n imgAttribute,\n toolStyle,\n toolInstance,\n annotationEngine,\n imgList,\n imgIndex,\n dataInjectionAtCreation,\n renderEnhance,\n customRenderStyle,\n stepList,\n step,\n drawLayerSlot,\n } = props;\n const [annotationPos, setAnnotationPos] = useState({ zoom: 1, currentPos: { x: 0, y: 0 } });\n const annotationRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const size = useSize(annotationRef);\n\n useEffect(() => {\n store.dispatch(InitToolStyleConfig());\n }, []);\n\n useEffect(() => {\n if (!annotationEngine) {\n return;\n }\n\n // 更改 toolInstance 内部国际化语言\n switch (i18n.language) {\n case 'cn':\n case 'en':\n annotationEngine.setLang(i18n.language);\n break;\n default: {\n //\n break;\n }\n }\n annotationEngine?.setDataInjectionAtCreation(dataInjectionAtCreation);\n annotationEngine?.setRenderEnhance(renderEnhance);\n if (customRenderStyle) {\n annotationEngine?.setCustomRenderStyle(customRenderStyle);\n }\n }, [annotationEngine, dataInjectionAtCreation, renderEnhance, customRenderStyle]);\n\n useEffect(() => {\n const renderZoom = (zoom: number, currentPos: { x: number; y: number }) => {\n setAnnotationPos({ zoom, currentPos });\n };\n\n const dragMove = (props: { currentPos: { x: number; y: number }; zoom: number }) => {\n setAnnotationPos(props);\n };\n\n if (toolInstance) {\n toolInstance.singleOn('messageError', (error: string) => {\n message.error(error);\n });\n\n toolInstance.singleOn('messageInfo', (info: string) => {\n message.info(info);\n });\n\n toolInstance.singleOn('changeAnnotationShow', () => {\n forceRender((s) => s + 1);\n });\n\n toolInstance.on('renderZoom', renderZoom);\n toolInstance.on('dragMove', dragMove);\n }\n\n return () => {\n if (toolInstance) {\n toolInstance.unbind('renderZoom', renderZoom);\n toolInstance.unbind('dragMove', dragMove);\n }\n };\n }, [toolInstance]);\n\n useEffect(() => {\n if (toolInstance) {\n toolInstance.setImgAttribute(imgAttribute);\n }\n }, [imgAttribute]);\n\n /** 样式同步 */\n useEffect(() => {\n if (toolInstance) {\n toolInstance.setStyle(toolStyle);\n }\n if (annotationEngine) {\n annotationEngine.setStyle(toolStyle);\n }\n }, [toolStyle]);\n\n /** 窗口大小监听 */\n useEffect(() => {\n if (toolInstance?.setSize) {\n toolInstance.setSize(size);\n }\n\n if (annotationEngine) {\n annotationEngine.setSize(size);\n }\n }, [size]);\n\n useEffect(() => {\n // Update StepList When it update by outside\n const currentStepInfo = StepUtils.getCurrentStepInfo(step, stepList);\n toolInstance?.setConfig(currentStepInfo.config);\n }, [stepList]);\n\n /**\n * 重新加载图片,避免网络问题导致的图片无法加载\n * @returns\n */\n const reloadImg = () => {\n const imgInfo = imgList?.[imgIndex];\n if (!imgInfo?.url) {\n return;\n }\n\n ImgUtils.load(imgInfo.url).then((imgNode) => {\n annotationEngine.setImgNode(imgNode as HTMLImageElement);\n });\n };\n\n return (\n <div ref={annotationRef} className='annotationOperation'>\n <div className='canvas' ref={containerRef} style={size} id='toolContainer'>\n {drawLayerSlot?.(annotationPos)}\n </div>\n {toolInstance?.isImgError === true && (\n <FileError\n {...size}\n reloadImage={reloadImg}\n backgroundColor='#e2e2e2'\n ignoreOffsetY={true}\n />\n )}\n </div>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n const annotationState = _.pickBy(state.annotation, (v, k) =>\n [\n 'imgList',\n 'imgIndex',\n 'stepList',\n 'step',\n 'toolInstance',\n 'annotationEngine',\n 'loading',\n ].includes(k),\n );\n return {\n imgAttribute: state.imgAttribute,\n toolStyle: state.toolStyle,\n ...annotationState,\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(\n AnnotationOperation,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,mBAAA,GAAwC,CAAC,KAAkB,KAAA;AAC/D,EAAM,MAAA,GAAG,WAAA,CAAA,GAAe,QAAiB,CAAA,CAAA,CAAA,CAAA;AAEzC,EAAM,MAAA;AAAA,IACJ,YAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,gBAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,uBAAA;AAAA,IACA,aAAA;AAAA,IACA,iBAAA;AAAA,IACA,QAAA;AAAA,IACA,IAAA;AAAA,IACA,aAAA;AAAA,GACE,GAAA,KAAA,CAAA;AACJ,EAAM,MAAA,CAAC,aAAe,EAAA,gBAAA,CAAA,GAAoB,QAAS,CAAA,CAAE,IAAM,EAAA,CAAA,EAAG,UAAY,EAAA,CAAE,CAAG,EAAA,CAAA,EAAG,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACrF,EAAA,MAAM,gBAAgB,MAAuB,CAAA,IAAA,CAAA,CAAA;AAC7C,EAAA,MAAM,eAAe,MAAuB,CAAA,IAAA,CAAA,CAAA;AAC5C,EAAA,MAAM,OAAO,OAAQ,CAA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AAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,aAAA,CAAgB,iBAElB,CAAc,YAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,YAAA,CAAA,UAAA,MAAe,wBAC3B,KAAA,CAAA,aAAA,CAAA,SAAA,EAAD,iCACM,IADN,CAAA,EAAA;AAAA,IAEE,WAAa,EAAA,SAAA;AAAA,IACb,eAAgB,EAAA,SAAA;AAAA,IAChB,aAAe,EAAA,IAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAOzB,MAAM,eAAA,GAAkB,CAAC,KAAoB,KAAA;AAC3C,EAAA,MAAM,kBAAkB,CAAE,CAAA,MAAA,CAAO,MAAM,UAAY,EAAA,CAAC,GAAG,CACrD,KAAA;AAAA,IACE,SAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,MAAA;AAAA,IACA,cAAA;AAAA,IACA,kBAAA;AAAA,IACA,SAAA;AAAA,GAAA,CACA,QAAS,CAAA,CAAA,CAAA,CAAA,CAAA;AAEb,EAAO,OAAA,cAAA,CAAA;AAAA,IACL,cAAc,KAAM,CAAA,YAAA;AAAA,IACpB,WAAW,KAAM,CAAA,SAAA;AAAA,GACd,EAAA,eAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAIP,4BAAe,QAAQ,eAAiB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC7D,CAAA,CAAA,CAAA,mBAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{Tooltip as
|
|
1
|
+
import e from"react";import{Tooltip as n}from"antd";import{prefix as a}from"../../../constant/index.js";const r=({tips:t})=>t?e.createElement("div",{className:`${a}-tips`},e.createElement(n,{placement:"bottomRight",title:t},e.createElement("span",{className:`${a}-tips__path`},t))):null;export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/views/MainView/annotationTips/index.tsx"],"sourcesContent":["/*\n * Annotation Tips Showing\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-05-11 17:15:30\n * @LastEditors: Laoluo luozefeng@sensetime.com\n * @LastEditTime: 2022-05-12 19:34:32\n */\nimport React from 'react';\nimport { Tooltip } from 'antd';\nimport { prefix } from '@/constant';\n\ninterface IProps {\n tips: string;\n}\n\nconst AnnotationTips = ({ tips }: IProps) => {\n if (!tips) {\n return null;\n }\n\n return (\n <div className={`${prefix}-tips`}>\n <
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/views/MainView/annotationTips/index.tsx"],"sourcesContent":["/*\n * Annotation Tips Showing\n * @Author: Laoluo luozefeng@sensetime.com\n * @Date: 2022-05-11 17:15:30\n * @LastEditors: Laoluo luozefeng@sensetime.com\n * @LastEditTime: 2022-05-12 19:34:32\n */\nimport React from 'react';\nimport { Tooltip } from 'antd';\nimport { prefix } from '@/constant';\n\ninterface IProps {\n tips: string;\n}\n\nconst AnnotationTips = ({ tips }: IProps) => {\n if (!tips) {\n return null;\n }\n\n return (\n <div className={`${prefix}-tips`}>\n <Tooltip placement='bottomRight' title={tips}>\n <span className={`${prefix}-tips__path`}>{tips}</span>\n </Tooltip>\n </div>\n );\n};\n\nexport default AnnotationTips;\n"],"names":[],"mappings":";;;;AAeM,MAAA,cAAA,GAAiB,CAAC,CAAE,IAAmB,CAAA,KAAA;AAC3C,EAAA,IAAI,CAAC,IAAM,EAAA;AACT,IAAO,OAAA,IAAA,CAAA;AAAA,GAAA;AAGT,EAAA,2CACG,KAAD,EAAA;AAAA,IAAK,WAAW,CAAG,EAAA,MAAA,CAAA,KAAA,CAAA;AAAA,GAAA,sCAChB,OAAD,EAAA;AAAA,IAAS,SAAU,EAAA,aAAA;AAAA,IAAc,KAAO,EAAA,IAAA;AAAA,GAAA,sCACrC,MAAD,EAAA;AAAA,IAAM,WAAW,CAAG,EAAA,MAAA,CAAA,WAAA,CAAA;AAAA,GAAsB,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ViewportProvider as
|
|
1
|
+
import{ViewportProvider as _}from"../../components/customResizeHook/index.js";import{prefix as y}from"../../constant/index.js";import{Spin as E}from"antd";import{Layout as s}from"antd/es";import o from"react";import x from"./annotationOperation/index.js";import g from"./annotationTips/index.js";import h from"./sidebar/index.js";import c from"./toolFooter/index.js";import j from"./toolHeader/index.js";import{getStepConfig as w}from"../../store/annotation/reducer.js";import P from"../../components/videoAnnotate/index.js";import{connect as T}from"react-redux";import u from"../../utils/ToolUtils.js";import N from"../../components/pointCloudView/index.js";import{getClassName as C}from"../../utils/dom.js";import{classnames as O}from"../../utils/index.js";import{LabelBeeContext as V}from"../../store/ctx.js";var A=Object.defineProperty,f=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,v=(e,t,n)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t)=>{for(var n in t||(t={}))S.call(t,n)&&v(e,n,t[n]);if(f)for(var n of f(t))b.call(t,n)&&v(e,n,t[n]);return e};const{Sider:I,Content:$}=s,d=`${y}-layout`,F=e=>{var t;return o.createElement(o.Fragment,null,e.showTips===!0&&o.createElement(g,{tips:e.path}),o.createElement(x,m({},e)),o.createElement(c,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},L=e=>{var t;return o.createElement(o.Fragment,null,o.createElement(N,null),o.createElement(c,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},p=e=>{var t;const{stepList:n,step:l}=e,a=(t=w(n,l))==null?void 0:t.tool,i=u.isVideoTool(a),r=u.isPointCloudTool(a);return i?o.createElement(P,m({},e)):r?o.createElement(L,m({},e)):o.createElement(F,m({},e))},B=e=>{var t,n,l,a,i;const r=(n=(t=e.style)==null?void 0:t.sider)==null?void 0:n.width;return o.createElement(_,null,o.createElement(E,{spinning:e.loading},o.createElement(s,{className:O([d,e.className]),style:(l=e.style)==null?void 0:l.layout},o.createElement("header",{className:`${d}__header`,style:(a=e.style)==null?void 0:a.header},o.createElement(j,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData})),o.createElement(s,{className:C("layout","container")},e==null?void 0:e.leftSider,o.createElement($,{className:`${d}__content`},o.createElement(p,m({},e))),o.createElement(I,{className:`${d}__side`,width:r||240,style:(i=e.style)==null?void 0:i.sider},o.createElement(h,{sider:e==null?void 0:e.sider}))))))},H=({annotation:e})=>{var t,n,l;const{imgList:a,loading:i}=e,r=(t=a[e.imgIndex])!=null?t:{};return{path:(l=(n=r==null?void 0:r.path)!=null?n:r==null?void 0:r.url)!=null?l:"",loading:i}};var D=T(H,null,null,{context:V})(B);export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/views/MainView/index.tsx"],"sourcesContent":["import { AppProps } from '@/App';\nimport { ViewportProvider } from '@/components/customResizeHook';\nimport { prefix } from '@/constant';\nimport { Spin } from 'antd';\nimport { Layout } from 'antd/es';\nimport _ from 'lodash';\nimport React from 'react';\nimport AnnotationOperation from './annotationOperation';\nimport AnnotationTips from './annotationTips';\nimport Sidebar from './sidebar';\nimport ToolFooter from './toolFooter';\nimport ToolHeader from './toolHeader';\nimport { getStepConfig } from '@/store/annotation/reducer';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/views/MainView/index.tsx"],"sourcesContent":["import { AppProps } from '@/App';\nimport { ViewportProvider } from '@/components/customResizeHook';\nimport { prefix } from '@/constant';\nimport { Spin } from 'antd';\nimport { Layout } from 'antd/es';\nimport _ from 'lodash';\nimport React from 'react';\nimport AnnotationOperation from './annotationOperation';\nimport AnnotationTips from './annotationTips';\nimport Sidebar from './sidebar';\nimport ToolFooter from './toolFooter';\nimport ToolHeader from './toolHeader';\nimport { getStepConfig } from '@/store/annotation/reducer';\n\nimport VideoAnnotate from '@/components/videoAnnotate';\nimport { AppState } from '@/store';\nimport { connect } from 'react-redux';\nimport ToolUtils from '@/utils/ToolUtils';\nimport PointCloudView from '@/components/pointCloudView';\nimport { getClassName } from '@/utils/dom';\nimport { classnames } from '@/utils';\nimport { LabelBeeContext } from '@/store/ctx';\n\ninterface IProps {\n path: string;\n loading: boolean;\n}\n\nconst { Sider, Content } = Layout;\n\nconst layoutCls = `${prefix}-layout`;\n\nconst ImageAnnotate: React.FC<AppProps & IProps> = (props) => {\n return (\n <>\n {props.showTips === true && <AnnotationTips tips={props.path} />}\n <AnnotationOperation {...props} />\n <ToolFooter style={props.style?.footer} mode={props.mode} footer={props?.footer} />\n </>\n );\n};\n\nconst PointCloudAnnotate: React.FC<AppProps & IProps> = (props) => {\n return (\n <>\n <PointCloudView />\n <ToolFooter style={props.style?.footer} mode={props.mode} footer={props?.footer} />\n </>\n );\n};\n\nconst AnnotatedArea: React.FC<AppProps & IProps> = (props) => {\n const { stepList, step } = props;\n const currentToolName = getStepConfig(stepList, step)?.tool;\n const isVideoTool = ToolUtils.isVideoTool(currentToolName);\n const isPointCloudTool = ToolUtils.isPointCloudTool(currentToolName);\n\n if (isVideoTool) {\n return <VideoAnnotate {...props} />;\n }\n\n if (isPointCloudTool) {\n return <PointCloudAnnotate {...props} />;\n }\n\n return <ImageAnnotate {...props} />;\n};\n\nconst MainView: React.FC<AppProps & IProps> = (props) => {\n const siderWidth = props.style?.sider?.width;\n\n return (\n <ViewportProvider>\n <Spin spinning={props.loading}>\n <Layout className={classnames([layoutCls, props.className])} style={props.style?.layout}>\n <header className={`${layoutCls}__header`} style={props.style?.header}>\n <ToolHeader\n header={props?.header}\n headerName={props.headerName}\n goBack={props.goBack}\n exportData={props.exportData}\n />\n </header>\n\n <Layout className={getClassName('layout', 'container')}>\n {props?.leftSider}\n <Content className={`${layoutCls}__content`}>\n <AnnotatedArea {...props} />\n </Content>\n <Sider\n className={`${layoutCls}__side`}\n width={siderWidth ? siderWidth : 240}\n style={props.style?.sider}\n >\n <Sidebar sider={props?.sider} />\n </Sider>\n </Layout>\n </Layout>\n </Spin>\n </ViewportProvider>\n );\n};\n\nconst mapStateToProps = ({ annotation }: AppState) => {\n const { imgList, loading } = annotation;\n const imgInfo = imgList[annotation.imgIndex] ?? {};\n return {\n path: imgInfo?.path ?? imgInfo?.url ?? '', // 将当前路径的数据注入\n loading,\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(MainView);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,CAAE,OAAO,OAAY,CAAA,GAAA,MAAA,CAAA;AAE3B,MAAM,YAAY,CAAG,EAAA,MAAA,CAAA,OAAA,CAAA,CAAA;AAErB,MAAM,aAAA,GAA6C,CAAC,KAAU,KAAA;AAhC9D,EAAA,IAAA,EAAA,CAAA;AAiCE,EAAA,uBAEK,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,KAAA,CAAM,QAAa,KAAA,IAAA,wCAAS,cAAD,EAAA;AAAA,IAAgB,MAAM,KAAM,CAAA,IAAA;AAAA,GAAA,CAAA,kBACvD,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAD,cAAyB,CAAA,EAAA,EAAA,KAAA,CAAA,CAAA,sCACxB,UAAD,EAAA;AAAA,IAAY,KAAA,EAAO,CAAM,EAAA,GAAA,KAAA,CAAA,KAAA,KAAN,IAAa,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAA;AAAA,IAAQ,MAAM,KAAM,CAAA,IAAA;AAAA,IAAM,QAAQ,KAAO,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,MAAA;AAAA,GAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAK/E,MAAM,kBAAA,GAAkD,CAAC,KAAU,KAAA;AA1CnE,EAAA,IAAA,EAAA,CAAA;AA2CE,EAAA,uBAEI,KAAA,CA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;AAAA,IACvC,OAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAIJ,iBAAe,QAAQ,eAAiB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAAmB,CAAA,CAAA,CAAA,QAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o,{useState as a,useEffect as l}from"react";import{message as u}from"antd/es";import m from"../TextAreaFormat/index.js";import{TextUtils as x}from"../../../../utils/TextUtils.js";import{connect as c}from"react-redux";import{LabelBeeContext as s}from"../../../../store/ctx.js";const f=({toolInstance:e})=>{var n;const[,i]=a(0);if(l(()=>{e&&(e.singleOn("selectedChange",()=>{i(r=>r+1)}),e.singleOn("updateTextAttribute",()=>{i(r=>r+1)}),e.singleOn("messageError",r=>{u.error(r)}))},[e]),!e)return null;const{config:t}=e;return o.createElement("div",null,((n=e==null?void 0:e.config)==null?void 0:n.textConfigurable)&&e.selectedID&&o.createElement(m,{onChange:e.textChange,textValue:e.selectedText,checkString:x.checkString(t==null?void 0:t.textCheckType,t==null?void 0:t.customFormat),textCheckType:t.textCheckType}))};function d(e){return{toolInstance:e.annotation.toolInstance}}var g=c(d,null,null,{context:s})(f);export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/AnnotationText/index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { message } from 'antd/es';\nimport TextAreaFormat from '@/views/MainView/sidebar/TextAreaFormat';\nimport { TextUtils } from '@/utils/TextUtils';\nimport { AppState } from '@/store';\nimport { GraphToolInstance } from '@/store/annotation/types';\nimport { connect } from 'react-redux';\n\ninterface IProps {\n toolInstance: GraphToolInstance;\n}\n\nconst AnnotationText: React.FC<IProps> = ({ toolInstance }) => {\n const [, forceRender] = useState<number>(0);\n useEffect(() => {\n if (toolInstance) {\n toolInstance.singleOn('selectedChange', () => {\n forceRender((s) => s + 1);\n });\n toolInstance.singleOn('updateTextAttribute', () => {\n // 文本属性的更新\n\n forceRender((s) => s + 1);\n });\n\n toolInstance.singleOn('messageError', (error: string) => {\n message.error(error);\n });\n }\n }, [toolInstance]);\n\n if (!toolInstance) {\n return null;\n }\n\n const { config } = toolInstance;\n\n return (\n <div>\n {toolInstance?.config?.textConfigurable && toolInstance.selectedID && (\n <TextAreaFormat\n onChange={toolInstance.textChange}\n textValue={toolInstance.selectedText}\n checkString={TextUtils.checkString(config?.textCheckType, config?.customFormat)}\n textCheckType={config.textCheckType}\n />\n )}\n </div>\n );\n};\n\nfunction mapStateToProps(state: AppState) {\n return { toolInstance: state.annotation.toolInstance };\n}\n\nexport default connect(mapStateToProps)(AnnotationText);\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/AnnotationText/index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { message } from 'antd/es';\nimport TextAreaFormat from '@/views/MainView/sidebar/TextAreaFormat';\nimport { TextUtils } from '@/utils/TextUtils';\nimport { AppState } from '@/store';\nimport { GraphToolInstance } from '@/store/annotation/types';\nimport { connect } from 'react-redux';\nimport { LabelBeeContext } from '@/store/ctx';\n\ninterface IProps {\n toolInstance: GraphToolInstance;\n}\n\nconst AnnotationText: React.FC<IProps> = ({ toolInstance }) => {\n const [, forceRender] = useState<number>(0);\n useEffect(() => {\n if (toolInstance) {\n toolInstance.singleOn('selectedChange', () => {\n forceRender((s) => s + 1);\n });\n toolInstance.singleOn('updateTextAttribute', () => {\n // 文本属性的更新\n\n forceRender((s) => s + 1);\n });\n\n toolInstance.singleOn('messageError', (error: string) => {\n message.error(error);\n });\n }\n }, [toolInstance]);\n\n if (!toolInstance) {\n return null;\n }\n\n const { config } = toolInstance;\n\n return (\n <div>\n {toolInstance?.config?.textConfigurable && toolInstance.selectedID && (\n <TextAreaFormat\n onChange={toolInstance.textChange}\n textValue={toolInstance.selectedText}\n checkString={TextUtils.checkString(config?.textCheckType, config?.customFormat)}\n textCheckType={config.textCheckType}\n />\n )}\n </div>\n );\n};\n\nfunction mapStateToProps(state: AppState) {\n return { toolInstance: state.annotation.toolInstance };\n}\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(AnnotationText);\n"],"names":[],"mappings":";;;;;;;AAaA,MAAM,cAAA,GAAmC,CAAC,CAAE,YAAmB,CAAA,KAAA;AAb/D,EAAA,IAAA,EAAA,CAAA;AAcE,EAAM,MAAA,GAAG,WAAA,CAAA,GAAe,QAAiB,CAAA,CAAA,CAAA,CAAA;AACzC,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,YAAc,EAAA;AAChB,MAAa,YAAA,CAAA,QAAA,CAAS,kBAAkB,MAAM;AAC5C,QAAY,WAAA,CAAA,CAAC,MAAM,CAAI,GAAA,CAAA,CAAA,CAAA;AAAA,OAAA,CAAA,CAAA;AAEzB,MAAa,YAAA,CAAA,QAAA,CAAS,uBAAuB,MAAM;AAGjD,QAAY,WAAA,CAAA,CAAC,MAAM,CAAI,GAAA,CAAA,CAAA,CAAA;AAAA,OAAA,CAAA,CAAA;AAGzB,MAAa,YAAA,CAAA,QAAA,CAAS,cAAgB,EAAA,CAAC,KAAkB,KAAA;AACvD,QAAA,OAAA,CAAQ,KAAM,CAAA,KAAA,CAAA,CAAA;AAAA,OAAA,CAAA,CAAA;AAAA,KAAA;AAAA,GAAA,EAGjB,CAAC,YAAA,CAAA,CAAA,CAAA;AAEJ,EAAA,IAAI,CAAC,YAAc,EAAA;AACjB,IAAO,OAAA,IAAA,CAAA;AAAA,GAAA;AAGT,EAAA,MAAM,CAAE,MAAW,CAAA,GAAA,YAAA,CAAA;AAEnB,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,KAAD,EAAA,IAAA,EACG,CAAc,CAAA,EAAA,GAAA,YAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,YAAA,CAAA,MAAA,KAAd,mBAAsB,gBAAoB,KAAA,YAAA,CAAa,UACtD,oBAAA,KAAA,CAAA,aAAA,CAAC,cAAD,EAAA;AAAA,IACE,UAAU,YAAa,CAAA,UAAA;AAAA,IACvB,WAAW,YAAa,CAAA,YAAA;AAAA,IACxB,WAAa,EAAA,SAAA,CAAU,WAAY,CAAA,MAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,MAAA,CAAQ,eAAe,MAAQ,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,MAAA,CAAA,YAAA,CAAA;AAAA,IAClE,eAAe,MAAO,CAAA,aAAA;AAAA,GAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAOhC,SAAA,eAAA,CAAyB,KAAiB,EAAA;AACxC,EAAO,OAAA,CAAE,YAAc,EAAA,KAAA,CAAM,UAAW,CAAA,YAAA,CAAA,CAAA;AAAA,CAAA;AAG1C,uBAAe,QAAQ,eAAiB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAAmB,CAAA,CAAA,CAAA,cAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t,{useState as s}from"react";import{Col as i,Popconfirm as u}from"antd";import{useTranslation as o}from"react-i18next";const p=({info:e})=>{const{t:r}=o();return e.key.startsWith("sure")?t.createElement("div",{key:e.key},`${r("ConfirmTo")}${e.name.slice(0)}\uFF1F`):t.createElement("span",null,e.name)},E=({icon:e})=>typeof e=="string"?t.createElement("img",{width:23,height:25,src:e}):e,k=({allOperation:e})=>{const[r,a]=s(null),{t:c}=o(),m=Math.floor(24/e.length);return t.createElement("div",{className:"generalOperation"},e.map((n,l)=>t.createElement(i,{span:m,key:l},t.createElement("div",{key:n.key,className:"item",onMouseEnter:()=>{a(n.key)},onMouseLeave:()=>{a(null)}},t.createElement(u,{title:t.createElement(p,{info:n}),placement:"topRight",okText:c("Confirm"),cancelText:c("Cancel"),onConfirm:n.onClick},t.createElement("div",{className:"icon"},t.createElement(E,{icon:n.key===r?n.hoverSvg:n.imgSvg})),t.createElement("div",{className:"toolName",style:{color:n.key===r?"#666fff":""}},n.name))))))};export{k as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionsConfirm.js","sources":["../../../../../src/views/MainView/sidebar/GeneralOperation/ActionsConfirm.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Col, Popconfirm } from 'antd';\nimport { useTranslation } from 'react-i18next';\n\nexport interface IOperationConfig {\n name: string;\n key: string;\n imgSvg: string | React.ReactElement;\n hoverSvg: string | React.ReactElement;\n onClick: () => void;\n}\n\nconst PopconfirmTitle = ({ info }: { info: IOperationConfig }) => {\n const { t } = useTranslation();\n if (info.key.startsWith('sure')) {\n return <div key={info.key}>{`${t('ConfirmTo')}${info.name.slice(0)}?`}</div>;\n }\n\n return <span>{info.name}</span>;\n};\n\nconst ActionIcon = ({ icon }: { icon: React.ReactElement | string }) => {\n if (typeof icon === 'string') {\n return <img width={23} height={25} src={icon} />;\n }\n return icon;\n};\n\nconst ActionsConfirm: React.FC<{ allOperation: IOperationConfig[] }> = ({ allOperation }) => {\n const [isHover, setHover] = useState<string | null>(null);\n const { t } = useTranslation();\n const annotationLength = Math.floor(24 / allOperation.length);\n\n return (\n <div className='generalOperation'>\n {allOperation.map((info, index) => (\n <Col span={annotationLength} key={index}>\n <div\n key={info.key}\n className='item'\n onMouseEnter={() => {\n setHover(info.key);\n }}\n onMouseLeave={() => {\n setHover(null);\n }}\n >\n <Popconfirm\n title={<PopconfirmTitle info={info} />}\n placement='topRight'\n okText={t('Confirm')}\n cancelText={t('Cancel')}\n onConfirm={info.onClick}\n >\n <div className='icon'>\n <ActionIcon icon={info.key === isHover ? info.hoverSvg : info.imgSvg} />\n </div>\n <div className='toolName' style={{ color: info.key === isHover ? '#666fff' : '' }}>\n {info.name}\n </div>\n </Popconfirm>\n </div>\n </Col>\n ))}\n </div>\n );\n};\n\nexport default ActionsConfirm;\n"],"names":[],"mappings":";;;;AAYA,MAAM,eAAA,GAAkB,CAAC,CAAE,IAAuC,CAAA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,IAAK,IAAM,EAAA,gBAAA;AAAA,IAAkB,GAAK,EAAA,KAAA;AAAA,GAAA,sCAC/B,KAAD,EAAA;AAAA,IACE,KAAK,IAAK,CAAA,GAAA;AAAA,IACV,SAAU,EAAA,MAAA;AAAA,IACV,cAAc,MAAM;AAClB,MAAA,QAAA,CAAS,IAAK,CAAA,GAAA,CAAA,CAAA;AAAA,KAAA;AAAA,IAEhB,cAAc,MAAM;AAClB,MAAS,QAAA,CAAA,IAAA,CAAA,CAAA;AAAA,KAAA;AAAA,GAAA,sCAGV,UAAD,EAAA;AAAA,IACE,KAAA,sCAAQ,eAAD,EAAA;AAAA,MAAiB,IAAA;AAAA,KAAA,CAAA;AAAA,IACxB,SAAU,EAAA,UAAA;AAAA,IACV,QAAQ,CAAE,CAAA,SAAA,CAAA;AAAA,IACV,YAAY,CAAE,CAAA,QAAA,CAAA;AAAA,IACd,WAAW,IAAK,CAAA,OAAA;AAAA,GAAA,sCAEf,KAAD,EAAA;AAAA,IAAK,SAAU,EAAA,MAAA;AAAA,GAAA,sCACZ,UAAD,EAAA;AAAA,IAAY,MAAM,IAAK,CAAA,GAAA,KAAQ,OAAU,GAAA,IAAA,CAAK,WAAW,IAAK,CAAA,MAAA;AAAA,GAAA,CAAA,CAAA,sCAE/D,KAAD,EAAA;AAAA,IAAK,SAAU,EAAA,UAAA;AAAA,IAAW,OAAO,CAAE,KAAA,EAAO,IAAK,CAAA,GAAA,KAAQ,UAAU,SAAY,GAAA,EAAA,CAAA;AAAA,GAAA,EAC1E,IAAK,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"react";import{connect as a}from"react-redux";import u from"../../../../utils/StepUtils.js";import{jsonParser as m}from"../../../../utils/index.js";import s from"./ActionsConfirm.js";import l from"./useOperationList.js";import{LabelBeeContext as p}from"../../../../store/ctx.js";const c=o=>{var n,t;const e=u.getCurrentStepInfo((n=o.annotation)==null?void 0:n.step,(t=o.annotation)==null?void 0:t.stepList);return{toolInstance:o.annotation.toolInstance,stepInfo:e,imgList:o.annotation.imgList,imgIndex:o.annotation.imgIndex}},d=({toolInstance:o,stepInfo:n})=>{const t=l(o),e=m(n==null?void 0:n.config),i=[t.empty];return(n==null?void 0:n.dataSourceStep)===0&&i.push(t.setValidity),(e==null?void 0:e.copyBackwardResult)&&i.push(t.copyPrevious),r.createElement(s,{allOperation:i})},f=a(c,null,null,{context:p})(({toolInstance:o,stepInfo:n})=>{const t=l(o),e=[t.copyPrevious,t.empty,t.setValidity];return r.createElement(s,{allOperation:e})});var v=a(c,null,null,{context:p})(d);export{f as PointCloudOperation,v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/GeneralOperation/index.tsx"],"sourcesContent":["import React
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/GeneralOperation/index.tsx"],"sourcesContent":["import React from 'react';\nimport { AppState } from '@/store';\nimport { connect, ConnectedComponent } from 'react-redux';\nimport { ToolInstance } from '@/store/annotation/types';\nimport StepUtils from '@/utils/StepUtils';\nimport { IStepInfo } from '@/types/step';\nimport { jsonParser } from '@/utils';\nimport { AnnotationFileList } from '@/types/data';\nimport ActionsConfirm, { IOperationConfig } from './ActionsConfirm';\nimport useOperationList from './useOperationList';\nimport { LabelBeeContext } from '@/store/ctx';\n\nconst mapStateToProps = (state: AppState) => {\n const stepInfo = StepUtils.getCurrentStepInfo(state.annotation?.step, state.annotation?.stepList);\n\n return {\n toolInstance: state.annotation.toolInstance,\n stepInfo,\n imgList: state.annotation.imgList,\n imgIndex: state.annotation.imgIndex,\n };\n};\ninterface IProps {\n toolInstance: ToolInstance;\n stepInfo: IStepInfo;\n imgList: AnnotationFileList;\n imgIndex: number;\n}\n\nconst GeneralOperation: React.FC<IProps> = ({ toolInstance, stepInfo }) => {\n const operationList = useOperationList(toolInstance);\n const config = jsonParser(stepInfo?.config);\n const allOperation: IOperationConfig[] = [operationList.empty];\n\n if (stepInfo?.dataSourceStep === 0) {\n allOperation.push(operationList.setValidity);\n }\n\n if (config?.copyBackwardResult) {\n allOperation.push(operationList.copyPrevious);\n }\n\n return <ActionsConfirm allOperation={allOperation} />;\n};\n\nexport const PointCloudOperation: ConnectedComponent<\n React.FC<IProps>,\n Omit<\n IProps & {\n children?: React.ReactNode;\n },\n 'toolInstance' | 'stepInfo' | 'imgList' | 'imgIndex'\n >\n> = connect(mapStateToProps, null, null, { context: LabelBeeContext })(\n ({ toolInstance, stepInfo }) => {\n const operationList = useOperationList(toolInstance);\n const allOperation: IOperationConfig[] = [\n operationList.copyPrevious,\n operationList.empty,\n operationList.setValidity,\n ];\n return <ActionsConfirm allOperation={allOperation} />;\n },\n);\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(GeneralOperation);\n"],"names":[],"mappings":";;;;;;;;AAYA,MAAM,eAAA,GAAkB,CAAC,KAAoB,KAAA;AAZ7C,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AAaE,EAAM,MAAA,QAAA,GAAW,UAAU,kBAAmB,CAAA,CAAA,EAAA,GAAA,KAAA,CAAM,eAAN,IAAkB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,EAAM,CAAM,EAAA,GAAA,KAAA,CAAA,UAAA,KAAN,IAAkB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,QAAA,CAAA,CAAA;AAExF,EAAO,OAAA;AAAA,IACL,YAAA,EAAc,MAAM,UAAW,CAAA,YAAA;AAAA,IAC/B,QAAA;AAAA,IACA,OAAA,EAAS,MAAM,UAAW,CAAA,OAAA;AAAA,IAC1B,QAAA,EAAU,MAAM,UAAW,CAAA,QAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAU/B,MAAM,gBAAqC,GAAA,CAAC,CAAE,YAAA,EAAc,QAAe,CAAA,KAAA;AACzE,EAAA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icon_clear.svg.js";import _ from"../../../../assets/annotation/common/icon_clear_a.svg.js";import S from"../../../../assets/annotation/common/icon_invalid.svg.js";import h from"../../../../assets/annotation/common/icon_invalid_a.svg.js";import{StopOutlined as a}from"@ant-design/icons";import{useTranslation as j}from"react-i18next";import s,{useMemo as O,useState as P}from"react";import{CopyBackWordResult as x}from"../../../../store/annotation/actionCreators.js";import{store as C}from"../../../../index.js";import{useSelector as k}from"../../../../store/ctx.js";var w=Object.defineProperty,m=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,c=(e,t,r)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,R=(e,t)=>{for(var r in t||(t={}))V.call(t,r)&&c(e,r,t[r]);if(m)for(var r of m(t))E.call(t,r)&&c(e,r,t[r]);return e};const b=e=>{const[t,r]=P(0),{t:o,i18n:l}=j(),{currentData:p}=k(i=>{const{imgList:g,imgIndex:d}=i.annotation;return{currentData:g[d]}}),n={height:"25px",lineHeight:"25px",display:"flex",justifyContent:"center",alignItems:"center"},u={name:o("ClearLabel"),key:"empty",imgSvg:y,hoverSvg:_,onClick:()=>{e==null||e.clearResult()}},v={name:o((e==null?void 0:e.valid)===!1?"SetAsValid":"SetAsInvalid"),key:"setValidity",imgSvg:s.createElement(a,{style:n}),hoverSvg:s.createElement(a,{style:R({color:"#666fff"},n)}),onClick:()=>{e.setValid(!e.valid),setTimeout(()=>{r(i=>i+1)})}},f={name:o("CopyThePrevious"),key:"copyPrevious",imgSvg:S,hoverSvg:h,onClick:()=>{C.dispatch(x())}};return O(()=>({empty:u,setValidity:v,copyPrevious:f}),[e,t,p,l.language])};export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOperationList.js","sources":["../../../../../src/views/MainView/sidebar/GeneralOperation/useOperationList.tsx"],"sourcesContent":["import { IOperationConfig } from './ActionsConfirm';\nimport clearResultSvg from '@/assets/annotation/common/icon_clear.svg';\nimport clearResultASvg from '@/assets/annotation/common/icon_clear_a.svg';\nimport copyBackStepSvg from '@/assets/annotation/common/icon_invalid.svg';\nimport copyBackStepASvg from '@/assets/annotation/common/icon_invalid_a.svg';\nimport { StopOutlined } from '@ant-design/icons';\nimport { useTranslation } from 'react-i18next';\nimport React, { useMemo, useState } from 'react';\nimport { CopyBackWordResult } from '@/store/annotation/actionCreators';\nimport { store } from '@/index';\nimport { AppState } from '@/store';\nimport { useSelector } from '@/store/ctx';\n\n/**\n * Hooks for sidebar common operations' config\n * @param toolInstance\n * @returns\n */\nconst useOperationList = (toolInstance: any) => {\n const [updateNum, forceRender] = useState(0);\n const { t, i18n } = useTranslation();\n const { currentData } = useSelector((state: AppState) => {\n const { imgList, imgIndex } = state.annotation;\n\n return {\n currentData: imgList[imgIndex],\n };\n });\n\n const iconStyle = {\n height: '25px',\n lineHeight: '25px',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n };\n\n /**\n * Empty current file result\n */\n const empty: IOperationConfig = {\n name: t('ClearLabel'),\n key: 'empty',\n imgSvg: clearResultSvg,\n hoverSvg: clearResultASvg,\n onClick: () => {\n toolInstance?.clearResult();\n },\n };\n\n /**\n * Set set validity for current file\n */\n const setValidity: IOperationConfig = {\n name: t(toolInstance?.valid === false ? 'SetAsValid' : 'SetAsInvalid'),\n key: 'setValidity',\n imgSvg: <StopOutlined style={iconStyle} />,\n hoverSvg: <StopOutlined style={{ color: '#666fff', ...iconStyle }} />,\n onClick: () => {\n toolInstance.setValid(!toolInstance.valid);\n setTimeout(() => {\n forceRender((v) => v + 1);\n });\n },\n };\n\n /**\n * Copy previous file result\n */\n const copyPrevious: IOperationConfig = {\n name: t('CopyThePrevious'),\n key: 'copyPrevious',\n imgSvg: copyBackStepSvg,\n hoverSvg: copyBackStepASvg,\n onClick: () => {\n store.dispatch(CopyBackWordResult());\n },\n };\n\n return useMemo(() => {\n return {\n empty,\n setValidity,\n copyPrevious,\n };\n }, [toolInstance, updateNum,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Ae,GAAA,cAAA,CAAA;AAAA,IACvD,GAAK,EAAA,aAAA;AAAA,IACL,MAAA,sCAAS,YAAD,EAAA;AAAA,MAAc,KAAO,EAAA,SAAA;AAAA,KAAA,CAAA;AAAA,IAC7B,QAAA,sCAAW,YAAD,EAAA;AAAA,MAAc,KAAA,EAAO,cAAE,CAAA,CAAA,KAAA,EAAO,SAAc,CAAA,EAAA,SAAA,CAAA;AAAA,KAAA,CAAA;AAAA,IACtD,SAAS,MAAM;AACb,MAAa,YAAA,CAAA,QAAA,CAAS,CAAC,YAAa,CAAA,KAAA,CAAA,CAAA;AACpC,MAAA,UAAA,CAAW,MAAM;AACf,QAAY,WAAA,CAAA,CAAC,MAAM,CAAI,GAAA,CAAA,CAAA,CAAA;AAAA,OAAA,CAAA,CAAA;AAAA,KAAA;AAAA,GAAA,CAAA;AAQ7B,EAAA,MAAM,YAAiC,GAAA;AAAA,IACrC,MAAM,CAAE,CAAA,iBAAA,CAAA;AAAA,IACR,GAAK,EAAA,cAAA;AAAA,IACL,MAAQ,EAAAC,KAAA;AAAA,IACR,QAAU,EAAAC,KAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAA,KAAA,CAAM,QAAS,CAAA,kBAAA,EAAA,CAAA,CAAA;AAAA,KAAA;AAAA,GAAA,CAAA;AAInB,EAAA,OAAO,QAAQ,MAAM;AACnB,IAAO,OAAA;AAAA,MACL,KAAA;AAAA,MACA,WAAA;AAAA,MACA,YAAA;AAAA,KAAA,CAAA;AAAA,GAAA,EAED,CAAC,YAAA,EAAc,SAAW,EAAA,WAAA,EAAa,IAAK,CAAA,QAAA,CAAA,CAAA,CAAA;AAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Row as s,Col as n,Slider as E,Input as h,Switch as
|
|
1
|
+
import{Row as s,Col as n,Slider as E,Input as h,Switch as x}from"antd/es";import{connect as b}from"react-redux";import{throttle as f}from"lodash";import e,{useEffect as C}from"react";import o from"../../../../store/imgAttribute/actionCreators.js";import{store as i}from"../../../../index.js";import{LabelBeeContext as A}from"../../../../store/ctx.js";import I from"../../../../assets/annotation/image/saturation.svg.js";import N from"../../../../assets/annotation/image/contrast.svg.js";import S from"../../../../assets/annotation/image/brightness.svg.js";import j from"../../../../assets/attributeIcon/zoomUp.svg.js";import y from"../../../../assets/annotation/image/icon_yuantu.svg.js";import{useTranslation as z}from"react-i18next";const $=r=>{const{imgAttribute:{contrast:l,saturation:c,brightness:g,zoomRatio:p,isOriginalSize:u}}=r,{t:m}=z(),a=f(t=>{i.dispatch(o.UpdateImgAttribute(t))},60,{trailing:!0}),d=[{name:"Saturation",min:-100,max:500,step:2,onChange:t=>a({saturation:t}),value:c,svg:I},{name:"Contrast",min:-100,max:300,step:2,onChange:t=>a({contrast:t}),value:l,svg:N},{name:"Exposure",min:-100,max:400,step:2,onChange:t=>a({brightness:t}),value:g,svg:S},{name:"ScreenRatio",min:.1,max:10,step:.1,onChange:t=>a({zoomRatio:t}),value:p,svg:j}];return C(()=>()=>{i.dispatch(o.InitImgAttribute())},[]),e.createElement("div",null,d.map((t,v)=>e.createElement("div",{className:"imgAttributeController",key:`option_${v}`},e.createElement(s,{className:"tools",style:{padding:"0px 0"}},e.createElement(n,{span:24},e.createElement("span",{className:"singleTool"},e.createElement("img",{width:12,height:12,src:t.svg}),e.createElement("span",{className:"toolName"},m(t.name))))),e.createElement(s,null,e.createElement(n,{span:20},e.createElement(E,{min:t.min,max:t.max,step:t.step,value:t.value,onChange:t.onChange,trackStyle:{background:"#666fff"}})),e.createElement(n,{span:4},e.createElement(h,{value:t.value,disabled:!0,style:{fontSize:12,marginBottom:23,padding:"0px 2px",textAlign:"center"}}))))),e.createElement("div",{className:"imgAttributeController"},e.createElement(s,{className:"tools",style:{padding:"10px 0"}},e.createElement(n,{span:18},e.createElement("span",{className:"singleTool"},e.createElement("img",{src:y,width:16,style:{marginTop:"-2px"}}),e.createElement("span",{className:"toolName"},m("OriginalScale")))),e.createElement(n,null,e.createElement(x,{checked:u,onChange:t=>a({isOriginalSize:t})})))))};function R({imgAttribute:r}){return{imgAttribute:r}}var T=b(R,null,null,{context:A})($);export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/ImgAttributeInfo/index.tsx"],"sourcesContent":["import { Col, Row, Slider, Switch, Input } from 'antd/es';\nimport { connect } from 'react-redux';\nimport { throttle } from 'lodash';\nimport React, { useEffect } from 'react';\nimport { ImgAttributeState } from '@/store/imgAttribute/types';\nimport ImgAttribute from '@/store/imgAttribute/actionCreators';\nimport { store } from '@/index';\n\nimport saturationSvg from '@/assets/annotation/image/saturation.svg';\nimport contrastSvg from '@/assets/annotation/image/contrast.svg';\nimport brightnessSvg from '@/assets/annotation/image/brightness.svg';\nimport ZoomUpSvg from '@/assets/attributeIcon/zoomUp.svg';\nimport originalPic from '@/assets/annotation/image/icon_yuantu.svg';\nimport { useTranslation } from 'react-i18next';\n\ninterface IProps {\n imgAttribute: ImgAttributeState;\n}\n\nconst ImgAttributeInfo = (props: IProps) => {\n const {\n imgAttribute: { contrast, saturation, brightness, zoomRatio, isOriginalSize },\n } = props;\n\n const { t } = useTranslation();\n\n const imgAttributeChange = throttle(\n (payload: Partial<ImgAttributeState>) => {\n store.dispatch(ImgAttribute.UpdateImgAttribute(payload as ImgAttributeState));\n },\n 60,\n { trailing: true },\n );\n\n const imgAttributeInfo = [\n {\n name: 'Saturation',\n min: -100,\n max: 500,\n step: 2,\n onChange: (v: number) => imgAttributeChange({ saturation: v }),\n value: saturation,\n svg: saturationSvg,\n },\n {\n name: 'Contrast',\n min: -100,\n max: 300,\n step: 2,\n onChange: (v: number) => imgAttributeChange({ contrast: v }),\n value: contrast,\n svg: contrastSvg,\n },\n {\n name: 'Exposure',\n min: -100,\n max: 400,\n step: 2,\n onChange: (v: number) => imgAttributeChange({ brightness: v }),\n value: brightness,\n svg: brightnessSvg,\n },\n {\n name: 'ScreenRatio',\n min: 0.1,\n max: 10,\n step: 0.1,\n onChange: (v: number) => imgAttributeChange({ zoomRatio: v }),\n value: zoomRatio,\n svg: ZoomUpSvg,\n },\n ];\n\n useEffect(() => {\n return () => {\n store.dispatch(ImgAttribute.InitImgAttribute());\n };\n }, []);\n\n return (\n <div>\n {imgAttributeInfo.map((info: any, index: number) => (\n <div className='imgAttributeController' key={`option_${index}`}>\n <Row className='tools' style={{ padding: '0px 0' }}>\n <Col span={24}>\n <span className='singleTool'>\n <img width={12} height={12} src={info.svg} />\n <span className='toolName'>{t(info.name)}</span>\n </span>\n </Col>\n </Row>\n <Row>\n <Col span={20}>\n <Slider\n min={info.min}\n max={info.max}\n step={info.step}\n value={info.value}\n onChange={info.onChange}\n trackStyle={{ background: '#666fff' }}\n />\n </Col>\n <Col span={4}>\n <Input\n value={info.value}\n disabled\n style={{\n fontSize: 12,\n marginBottom: 23,\n padding: '0px 2px',\n textAlign: 'center',\n }}\n />\n </Col>\n </Row>\n </div>\n ))}\n <div className='imgAttributeController'>\n <Row className='tools' style={{ padding: '10px 0' }}>\n <Col span={18}>\n <span className='singleTool'>\n <img src={originalPic} width={16} style={{ marginTop: '-2px' }} />\n <span className='toolName'>{t('OriginalScale')}</span>\n </span>\n </Col>\n <Col>\n <Switch\n checked={isOriginalSize}\n onChange={(v: boolean) => imgAttributeChange({ isOriginalSize: v })}\n />\n </Col>\n </Row>\n </div>\n </div>\n );\n};\n\nfunction mapStateToProps({ imgAttribute }: any) {\n return { imgAttribute };\n}\n\nexport default connect(mapStateToProps)(ImgAttributeInfo);\n"],"names":["saturationSvg","contrastSvg","brightnessSvg","ZoomUpSvg","originalPic"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/ImgAttributeInfo/index.tsx"],"sourcesContent":["import { Col, Row, Slider, Switch, Input } from 'antd/es';\nimport { connect } from 'react-redux';\nimport { throttle } from 'lodash';\nimport React, { useEffect } from 'react';\nimport { ImgAttributeState } from '@/store/imgAttribute/types';\nimport ImgAttribute from '@/store/imgAttribute/actionCreators';\nimport { store } from '@/index';\nimport { LabelBeeContext } from '@/store/ctx';\n\nimport saturationSvg from '@/assets/annotation/image/saturation.svg';\nimport contrastSvg from '@/assets/annotation/image/contrast.svg';\nimport brightnessSvg from '@/assets/annotation/image/brightness.svg';\nimport ZoomUpSvg from '@/assets/attributeIcon/zoomUp.svg';\nimport originalPic from '@/assets/annotation/image/icon_yuantu.svg';\nimport { useTranslation } from 'react-i18next';\n\ninterface IProps {\n imgAttribute: ImgAttributeState;\n}\n\nconst ImgAttributeInfo = (props: IProps) => {\n const {\n imgAttribute: { contrast, saturation, brightness, zoomRatio, isOriginalSize },\n } = props;\n\n const { t } = useTranslation();\n\n const imgAttributeChange = throttle(\n (payload: Partial<ImgAttributeState>) => {\n store.dispatch(ImgAttribute.UpdateImgAttribute(payload as ImgAttributeState));\n },\n 60,\n { trailing: true },\n );\n\n const imgAttributeInfo = [\n {\n name: 'Saturation',\n min: -100,\n max: 500,\n step: 2,\n onChange: (v: number) => imgAttributeChange({ saturation: v }),\n value: saturation,\n svg: saturationSvg,\n },\n {\n name: 'Contrast',\n min: -100,\n max: 300,\n step: 2,\n onChange: (v: number) => imgAttributeChange({ contrast: v }),\n value: contrast,\n svg: contrastSvg,\n },\n {\n name: 'Exposure',\n min: -100,\n max: 400,\n step: 2,\n onChange: (v: number) => imgAttributeChange({ brightness: v }),\n value: brightness,\n svg: brightnessSvg,\n },\n {\n name: 'ScreenRatio',\n min: 0.1,\n max: 10,\n step: 0.1,\n onChange: (v: number) => imgAttributeChange({ zoomRatio: v }),\n value: zoomRatio,\n svg: ZoomUpSvg,\n },\n ];\n\n useEffect(() => {\n return () => {\n store.dispatch(ImgAttribute.InitImgAttribute());\n };\n }, []);\n\n return (\n <div>\n {imgAttributeInfo.map((info: any, index: number) => (\n <div className='imgAttributeController' key={`option_${index}`}>\n <Row className='tools' style={{ padding: '0px 0' }}>\n <Col span={24}>\n <span className='singleTool'>\n <img width={12} height={12} src={info.svg} />\n <span className='toolName'>{t(info.name)}</span>\n </span>\n </Col>\n </Row>\n <Row>\n <Col span={20}>\n <Slider\n min={info.min}\n max={info.max}\n step={info.step}\n value={info.value}\n onChange={info.onChange}\n trackStyle={{ background: '#666fff' }}\n />\n </Col>\n <Col span={4}>\n <Input\n value={info.value}\n disabled\n style={{\n fontSize: 12,\n marginBottom: 23,\n padding: '0px 2px',\n textAlign: 'center',\n }}\n />\n </Col>\n </Row>\n </div>\n ))}\n <div className='imgAttributeController'>\n <Row className='tools' style={{ padding: '10px 0' }}>\n <Col span={18}>\n <span className='singleTool'>\n <img src={originalPic} width={16} style={{ marginTop: '-2px' }} />\n <span className='toolName'>{t('OriginalScale')}</span>\n </span>\n </Col>\n <Col>\n <Switch\n checked={isOriginalSize}\n onChange={(v: boolean) => imgAttributeChange({ isOriginalSize: v })}\n />\n </Col>\n </Row>\n </div>\n </div>\n );\n};\n\nfunction mapStateToProps({ imgAttribute }: any) {\n return { imgAttribute };\n}\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(ImgAttributeInfo);\n"],"names":["saturationSvg","contrastSvg","brightnessSvg","ZoomUpSvg","originalPic"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAM,gBAAA,GAAmB,CAAC,KAAkB,KAAA;AAC1C,EAAM,MAAA;AAAA,IACJ,YAAc,EAAA,CAAE,QAAU,EAAA,UAAA,EAAY,YAAY,SAAW,EAAA,cAAA,CAAA;AAAA,GAC3D,GAAA,KAAA,CAAA;AAEJ,EAAA,MAAM,CAAE,CAAM,CAAA,GAAA,cAAA,EAAA,CAAA;AAEd,EAAM,MAAA,kBAAA,GAAqB,QACzB,CAAA,CAAC,OAAwC,KAAA;AACvC,IAAM,KAAA,CAAA,QAAA,CAAS,aAAa,kBAAmB,CAAA,OAAA,CAAA,CAAA,CAAA;AAAA,GAEjD,EAAA,EAAA,EACA,CAAE,QAAU,EAAA,IAAA,CAAA,CAAA,CAAA;AAGd,EAAA,MAAM,gBAAmB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A,OAAO,CAAE,YAAA,CAAA,CAAA;AAAA,CAAA;AAGX,yBAAe,QAAQ,eAAiB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAAmB,CAAA,CAAA,CAAA,gBAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e,{useContext as y}from"react";import{ToolIcons as S}from"../ToolIcons.js";import{cTool as x}from"@labelbee/lb-annotation";import{PointCloudContext as b}from"../../../../components/pointCloudView/PointCloudContext.js";import{Row as f,Col as d,Radio as C,Select as g}from"antd";import E from"../../../../utils/StepUtils.js";import{connect as P}from"react-redux";import{jsonParser as B}from"../../../../utils/index.js";import{useStatus as h}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as j}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as T}from"react-i18next";import{LabelBeeContext as k}from"../../../../store/ctx.js";const _=({attributeList:r,subAttributeList:i,toolInstance:n})=>{var l;const s=y(b),{t:o}=T(),c={fontWeight:400,fontSize:14,marginBottom:14},a=t=>{n.setDefaultAttribute(t)},p=(t,u)=>{n.setSubAttribute(t,u)};return e.createElement("div",{style:{padding:24,borderBottom:"1px solid #eee"}},e.createElement("div",{style:{marginBottom:20,fontSize:14,fontWeight:500}},o("Tag")),e.createElement(f,{style:{marginBottom:12}},e.createElement(d,{span:9,style:c},o("Attribute")),e.createElement(d,{span:15},e.createElement(C.Group,{style:{width:"100%"},value:(l=s.selectedPointCloudBox)==null?void 0:l.attribute,onChange:t=>a(t.target.value)},r.map(t=>e.createElement(C,{key:t.value,value:t.value,style:{marginBottom:16}},t.key))))),e.createElement("div",{style:c}," ",o("SubAttribute")),i.map(t=>{var u,v;return(t==null?void 0:t.subSelected)&&e.createElement(f,{key:t.value,style:{marginBottom:18}},e.createElement(d,{span:9,style:{color:"#999999",display:"flex",justifyContent:"flex-start",alignItems:"center"}},t.key),e.createElement(d,{span:15},e.createElement(g,{style:{width:"100%"},bordered:!1,value:(v=(u=s.selectedPointCloudBox)==null?void 0:u.subAttribute)==null?void 0:v[t.value],placeholder:o("PleaseSelect"),onChange:m=>p(t.value,m)},t.subSelected.map(m=>e.createElement(g.Option,{key:m.value,value:m.value},m.key)))))}))},w=({stepInfo:r,toolInstance:i})=>{var n,l;const{selectedBox:s}=j(),{updatePointCloudPattern:o,pointCloudPattern:c}=h(),a=B(r.config),p=(n=a==null?void 0:a.attributeList)!=null?n:[],t=(a==null?void 0:a.secondaryAttributeConfigurable)===!0?(l=a==null?void 0:a.inputList)!=null?l:[]:[];return e.createElement(e.Fragment,null,e.createElement(S,{toolName:x.EPointCloudName.PointCloud,selectedToolName:c,onChange:u=>o==null?void 0:o(u)}),s&&e.createElement(_,{toolInstance:i,attributeList:p,subAttributeList:t}))},I=r=>{var i,n,l;const s=E.getCurrentStepInfo((i=r.annotation)==null?void 0:i.step,(n=r.annotation)==null?void 0:n.stepList),o=(l=r.annotation)==null?void 0:l.toolInstance;return{stepInfo:s,toolInstance:o}};var L=P(I,null,null,{context:k})(w);export{L as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/PointCloudToolSidebar/index.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { ToolIcons } from '../ToolIcons';\nimport { cTool } from '@labelbee/lb-annotation';\nimport { PointCloudContext } from '@/components/pointCloudView/PointCloudContext';\nimport { Col, Radio, Row, Select } from 'antd';\nimport { AppState } from '@/store';\nimport StepUtils from '@/utils/StepUtils';\nimport { connect } from 'react-redux';\nimport { IStepInfo } from '@/types/step';\nimport { jsonParser } from '@/utils';\nimport { ICustomToolInstance } from '@/hooks/annotation';\nimport { useStatus } from '@/components/pointCloudView/hooks/useStatus';\nimport { useSingleBox } from '@/components/pointCloudView/hooks/useSingleBox';\nimport { useTranslation } from 'react-i18next';\nimport { LabelBeeContext } from '@/store/ctx';\n\ninterface IProps {\n stepInfo: IStepInfo;\n toolInstance: ICustomToolInstance; // Created by useCustomToolInstance.\n}\n\n// Temporarily hidden, this feature does not support the function for the time being.\n// const AnnotatedBox = () => {\n// const ptCtx = useContext(PointCloudContext);\n// const { pointCloudBoxList } = ptCtx;\n\n// return (\n// <div style={{ padding: 24, borderBottom: '1px solid #eee' }}>\n// <div style={{ marginBottom: 16 }}>所有已标注的框ID</div>\n// <div>\n// {pointCloudBoxList\n// .sort((a, b) => a.trackID - b.trackID)\n// .map((i) => (\n// <Tag color='#F3F4FF' key={i.trackID} style={{ color: '#666', marginBottom: 8 }}>\n// {i.trackID}\n// </Tag>\n// ))}\n// </div>\n// </div>\n// );\n// };\n\n// const BoxTrackIDInput = () => {\n// const [isEdit, setIsEdit] = useState(false);\n// const { pointCloudBoxList } = useContext(PointCloudContext);\n// const { selectedBox, updateSelectedBox } = useSingleBox();\n// const [inputValue, setInputValue] = useState('');\n\n// const selectedBoxTrackID = selectedBox?.info.trackID;\n\n// const hasDuplicateTrackID = (trackID: number) => {\n// const duplicateBox = pointCloudBoxList.find((i) => i.trackID === selectedBoxTrackID);\n// return duplicateBox && duplicateBox.id !== selectedBox?.info.id;\n// };\n\n// const applyInputValue = (isBlurEvent = false) => {\n// const newTrackID = parseInt(inputValue, 10);\n\n// if (isBlurEvent) {\n// setIsEdit(false);\n// }\n\n// if (inputValue.indexOf('.') > -1) {\n// message.error('输入trackID不允许包含小数点');\n// return;\n// }\n\n// if (hasDuplicateTrackID(newTrackID)) {\n// message.error('存在重复的trackID');\n// return;\n// }\n\n// if (!(newTrackID > 0)) {\n// message.error('输入trackID必须为正整数!');\n// }\n\n// updateSelectedBox({ trackID: ~~inputValue });\n// };\n\n// useEffect(() => {\n// setIsEdit(false);\n// }, [selectedBoxTrackID]);\n\n// return (\n// <div style={{ padding: 24 }}>\n// <div\n// style={{\n// marginBottom: 16,\n// display: 'flex',\n// justifyContent: 'space-between',\n// alignItems: 'center',\n// }}\n// >\n// <span>当前标注框ID</span>\n// <span>批量修改</span>\n// </div>\n// <div\n// style={{\n// display: 'flex',\n// justifyContent: 'space-between',\n// alignItems: 'center',\n// }}\n// >\n// {isEdit && selectedBoxTrackID ? (\n// <Input\n// defaultValue={selectedBoxTrackID}\n// onChange={(e) => {\n// setInputValue(e.target.value);\n// }}\n// disabled={!selectedBoxTrackID}\n// size='small'\n// onBlur={() => {\n// applyInputValue();\n// }}\n// onPressEnter={() => {\n// applyInputValue(true);\n// }}\n// />\n// ) : (\n// <span>{selectedBoxTrackID}</span>\n// )}\n// <EditFilled\n// style={{\n// color: '#999',\n// marginLeft: 16,\n// cursor: selectedBoxTrackID ? 'pointer' : 'not-allowed',\n// }}\n// onClick={() => {\n// if (selectedBoxTrackID) {\n// setIsEdit(!isEdit);\n// }\n// }}\n// />\n// </div>\n// </div>\n// );\n// };\n\nconst AttributeUpdater = ({\n attributeList,\n subAttributeList,\n toolInstance,\n}: {\n toolInstance: ICustomToolInstance;\n attributeList: any[]; // TODO\n subAttributeList: any[]; // TODO\n}) => {\n const ptx = useContext(PointCloudContext);\n const { t } = useTranslation();\n\n const titleStyle = {\n fontWeight: 400,\n fontSize: 14,\n marginBottom: 14,\n };\n\n const setAttribute = (attribute: string) => {\n toolInstance.setDefaultAttribute(attribute);\n };\n\n const setSubAttribute = (key: string, value: string) => {\n toolInstance.setSubAttribute(key, value);\n };\n\n return (\n <div style={{ padding: 24, borderBottom: '1px solid #eee' }}>\n <div style={{ marginBottom: 20, fontSize: 14, fontWeight: 500 }}>{t('Tag')}</div>\n <Row style={{ marginBottom: 12 }}>\n <Col span={9} style={titleStyle}>\n {t('Attribute')}\n </Col>\n <Col span={15}>\n <Radio.Group\n style={{ width: '100%' }}\n value={ptx.selectedPointCloudBox?.attribute}\n onChange={(e) => setAttribute(e.target.value)}\n >\n {attributeList.map((v) => (\n <Radio key={v.value} value={v.value} style={{ marginBottom: 16 }}>\n {v.key}\n </Radio>\n ))}\n </Radio.Group>\n </Col>\n </Row>\n <div style={titleStyle}> {t('SubAttribute')}</div>\n {subAttributeList.map(\n (subAttribute) =>\n subAttribute?.subSelected && (\n <Row key={subAttribute.value} style={{ marginBottom: 18 }}>\n <Col\n span={9}\n style={{\n color: '#999999',\n display: 'flex',\n justifyContent: 'flex-start',\n alignItems: 'center',\n }}\n >\n {subAttribute.key}\n </Col>\n <Col span={15}>\n <Select\n style={{ width: '100%' }}\n bordered={false}\n value={ptx.selectedPointCloudBox?.subAttribute?.[subAttribute.value]}\n placeholder={t('PleaseSelect')}\n onChange={(value) => setSubAttribute(subAttribute.value, value)}\n >\n {subAttribute.subSelected.map((sub: any) => (\n <Select.Option key={sub.value} value={sub.value}>\n {sub.key}\n </Select.Option>\n ))}\n </Select>\n </Col>\n </Row>\n ),\n )}\n </div>\n );\n};\n\nconst PointCloudToolSidebar: React.FC<IProps> = ({ stepInfo, toolInstance }) => {\n const { selectedBox } = useSingleBox();\n const { updatePointCloudPattern, pointCloudPattern } = useStatus();\n\n const config = jsonParser(stepInfo.config);\n const attributeList = config?.attributeList ?? [];\n const subAttributeList =\n config?.secondaryAttributeConfigurable === true ? config?.inputList ?? [] : [];\n\n return (\n <>\n <ToolIcons\n toolName={cTool.EPointCloudName.PointCloud}\n selectedToolName={pointCloudPattern}\n onChange={(v) => updatePointCloudPattern?.(v)}\n />\n {/* <AnnotatedBox />\n <BoxTrackIDInput /> */}\n {selectedBox && (\n <AttributeUpdater\n toolInstance={toolInstance}\n attributeList={attributeList}\n subAttributeList={subAttributeList}\n />\n )}\n </>\n );\n};\n\nconst mapStateToProps = (state: AppState) => {\n const stepInfo = StepUtils.getCurrentStepInfo(state.annotation?.step, state.annotation?.stepList);\n const toolInstance = state.annotation?.toolInstance;\n\n return {\n stepInfo,\n toolInstance,\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(\n PointCloudToolSidebar,\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;AA0IA,MAAM,mBAAmB,CAAC;AAAA,EACxB,aAAA;AAAA,EACA,gBAAA;AAAA,EACA,YAAA;AAAA,CAKI,KAA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EAAM,IAAM,EAAA,CAAE,SAAS,eAC7D,CAAA,CAAA,CAAA,qBAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e,{useState as m}from"react";import{Slider as p}from"antd";import u from"../../../../assets/attributeIcon/pen_a.svg.js";import g from"../../../../assets/attributeIcon/pen.svg.js";import S from"../../../../assets/attributeIcon/eraser_a.svg.js";import E from"../../../../assets/attributeIcon/eraser.svg.js";import{getClassName as r}from"../../../../utils/dom.js";import{EScribblePattern as t}from"../../../../data/enums/ToolType.js";import{useSelector as f}from"../../../../store/ctx.js";const v=b=>{const{onChange:d}=b,s=f(a=>a.annotation.toolInstance),[o,l]=m(20),[c,n]=m(t.Scribble),i=()=>{d(c,o)};return e.createElement("div",{className:r("scribble")},e.createElement("div",{className:r("scribble","select")},e.createElement("img",{src:c===t.Scribble?u:g,onClick:()=>{l(20),n(t.Scribble),s==null||s.setPattern(t.Scribble),i()}}),e.createElement("img",{src:c===t.Erase?S:E,onClick:()=>{l(20),n(t.Erase),s==null||s.setPattern(t.Erase),i()}})),e.createElement("div",{className:r("scribble","silder")},e.createElement("span",{className:r("scribble","circle")}),e.createElement(p,{onChange:a=>{l(a),i(),s==null||s.setPenSize(a)},min:1,max:50,style:{width:"60%"},value:o}),e.createElement("span",{className:r("scribble","circle"),style:{width:"10px",height:"10px"}})))};export{v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/ScribbleSidebar/index.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { Slider } from 'antd';\nimport penActivate from '@/assets/attributeIcon/pen_a.svg';\nimport pen from '@/assets/attributeIcon/pen.svg';\nimport eraserActivate from '@/assets/attributeIcon/eraser_a.svg';\nimport eraser from '@/assets/attributeIcon/eraser.svg';\nimport { getClassName } from '@/utils/dom';\nimport { AppState } from '@/store';\nimport { EScribblePattern } from '@/data/enums/ToolType';\nimport { useSelector } from '@/store/ctx';\n\ninterface IProps {\n // toolInstance?: GraphToolInstance;\n // stepInfo?: IStepInfo;\n onChange: (tool: number, values: number) => void;\n}\n\nconst ScribbleSidebar: React.FC<IProps> = (props) => {\n const { onChange } = props;\n // 查看时候默认值\n const toolInstance = useSelector((state: AppState) => state.annotation.toolInstance);\n const [silderValue, setSilderValue] = useState(20);\n const [selectTool, setSelectTool] = useState(EScribblePattern.Scribble);\n\n const changeValue = () => {\n onChange(selectTool, silderValue);\n };\n\n return (\n <div className={getClassName('scribble')}>\n <div className={getClassName('scribble', 'select')}>\n <img\n src={selectTool === EScribblePattern.Scribble ? penActivate : pen}\n onClick={() => {\n setSilderValue(20);\n setSelectTool(EScribblePattern.Scribble);\n toolInstance?.setPattern(EScribblePattern.Scribble);\n changeValue();\n }}\n />\n <img\n src={selectTool === EScribblePattern.Erase ? eraserActivate : eraser}\n onClick={() => {\n setSilderValue(20);\n setSelectTool(EScribblePattern.Erase);\n toolInstance?.setPattern(EScribblePattern.Erase);\n\n changeValue();\n }}\n />\n </div>\n <div className={getClassName('scribble', 'silder')}>\n <span className={getClassName('scribble', 'circle')} />\n <Slider\n onChange={(v: number) => {\n setSilderValue(v);\n changeValue();\n toolInstance?.setPenSize(v);\n }}\n min={1}\n max={50}\n style={{ width: '60%' }}\n value={silderValue}\n />\n <span\n className={getClassName('scribble', 'circle')}\n style={{ width: '10px', height: '10px' }}\n />\n </div>\n </div>\n );\n};\n\nexport default ScribbleSidebar;\n"],"names":["penActivate","pen","eraserActivate","eraser"],"mappings":";;;;;;;;;;AAkBM,MAAA,eAAA,GAAoC,CAAC,KAAU,KAAA;AACnD,EAAA,MAAM,CAAE,QAAa,CAAA,GAAA,KAAA,CAAA;AAErB,EAAA,MAAM,YAAe,GAAA,WAAA,CAAY,CAAC,KAAA,KAAoB,MAAM,UAAW,CAAA,YAAA,CAAA,CAAA;AACvE,EAAM,MAAA,CAAC,WAAa,EAAA,cAAA,CAAA,GAAkB,QAAS,CAAA,EAAA,CAAA,CAAA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CAAA;AAAA,GAAA,sCACtC,MAAD,EAAA;AAAA,IAAM,SAAA,EAAW,aAAa,UAAY,EAAA,QAAA,CAAA;AAAA,GAAA,CAAA,sCACzC,MAAD,EAAA;AAAA,IACE,QAAA,EAAU,CAAC,CAAc,KAAA;AACvB,MAAe,cAAA,CAAA,CAAA,CAAA,CAAA;AACf,MAAA,WAAA,EAAA,CAAA;AACA,MAAA,YAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,YAAA,CAAc,UAAW,CAAA,CAAA,CAAA,CAAA;AAAA,KAAA;AAAA,IAE3B,GAAK,EAAA,CAAA;AAAA,IACL,GAAK,EAAA,EAAA;AAAA,IACL,KAAA,EAAO,CAAE,KAAO,EAAA,KAAA,CAAA;AAAA,IAChB,KAAO,EAAA,WAAA;AAAA,GAAA,CAAA,sCAER,MAAD,EAAA;AAAA,IACE,SAAA,EAAW,aAAa,UAAY,EAAA,QAAA,CAAA;AAAA,IACpC,KAAO,EAAA,CAAE,KAAO,EAAA,MAAA,EAAQ,MAAQ,EAAA,MAAA,CAAA;AAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import f,{useState as d,useRef as p,useEffect as v}from"react";import{connect as S}from"react-redux";import A from"../../../../components/attributeList/index.js";import g from"../../../../utils/StepUtils.js";import{jsonParser as I}from"../../../../utils/index.js";import{useTranslation as x}from"react-i18next";import{EToolName as L}from"../../../../data/enums/ToolType.js";import{LabelBeeContext as h}from"../../../../store/ctx.js";const T=t=>{var o;const[c,l]=d(0),i=p(null),{toolInstance:n}=t,{t:b}=x();if(v(()=>(n&&n.singleOn("changeAttributeSidebar",a=>{var s;l(e=>e+1),!!i.current&&((s=i.current.children[a])==null||s.scrollIntoView({block:"center"}))}),()=>{n.unbindAll("changeAttributeSidebar")}),[n,i]),!t.stepInfo)return null;const r=I(t.stepInfo.config),u=t.stepInfo.tool===L.ScribbleTool;if(r.attributeConfigurable!==!0&&!u)return null;if((r.attributeConfigurable===!0||u)&&(r==null?void 0:r.attributeList)){const a=r.attributeList.map(e=>({label:e.key,value:e.value,color:e==null?void 0:e.color}));u||a.unshift({label:b("NoAttribute"),value:""});const s=e=>{n.setDefaultAttribute(e),l(m=>m+1)};return f.createElement("div",null,f.createElement(A,{list:a,attributeChanged:s,selectedAttribute:(o=n==null?void 0:n.defaultAttribute)!=null?o:"",ref:i,forbidDefault:u}))}return null},j=t=>{var o,c;const l=g.getCurrentStepInfo((o=t.annotation)==null?void 0:o.step,(c=t.annotation)==null?void 0:c.stepList);return{toolInstance:t.annotation.toolInstance,stepInfo:l}};var C=S(j,null,null,{context:h})(T);export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/SwitchAttributeList/index.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/SwitchAttributeList/index.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\nimport { connect } from 'react-redux';\nimport { AppState } from 'src/store';\nimport { GraphToolInstance } from 'src/store/annotation/types';\nimport AttributeList from '@/components/attributeList';\nimport StepUtils from '@/utils/StepUtils';\nimport { IStepInfo } from '@/types/step';\nimport { jsonParser } from '@/utils';\nimport { useTranslation } from 'react-i18next';\nimport { EToolName } from '@/data/enums/ToolType';\nimport { LabelBeeContext } from '@/store/ctx';\n\ninterface IProps {\n toolInstance: GraphToolInstance;\n stepInfo: IStepInfo;\n}\n\nconst SwitchAttributeList: React.FC<IProps> = (props) => {\n const [_, forceRender] = useState(0);\n const listRef = useRef<HTMLElement>(null);\n const { toolInstance } = props;\n const { t } = useTranslation();\n\n useEffect(() => {\n if (toolInstance) {\n toolInstance.singleOn('changeAttributeSidebar', (index: number) => {\n forceRender((s) => s + 1);\n\n if (!listRef.current) {\n return;\n }\n\n listRef.current.children[index]?.scrollIntoView({ block: 'center' });\n });\n }\n return () => {\n toolInstance.unbindAll('changeAttributeSidebar');\n };\n }, [toolInstance, listRef]);\n\n if (!props.stepInfo) {\n return null;\n }\n\n const config = jsonParser(props.stepInfo.config);\n const isScribbleTool = props.stepInfo.tool === EToolName.ScribbleTool;\n\n if (config.attributeConfigurable !== true && !isScribbleTool) {\n return null;\n }\n\n if ((config.attributeConfigurable === true || isScribbleTool) && config?.attributeList) {\n const list = config.attributeList.map((i: any) => ({\n label: i.key,\n value: i.value,\n color: i?.color,\n }));\n\n if (!isScribbleTool) {\n list.unshift({ label: t('NoAttribute'), value: '' });\n }\n\n const attributeChanged = (v: string) => {\n toolInstance.setDefaultAttribute(v);\n forceRender((s) => s + 1);\n };\n\n return (\n <div>\n <AttributeList\n list={list}\n attributeChanged={attributeChanged}\n selectedAttribute={toolInstance?.defaultAttribute ?? ''}\n ref={listRef}\n forbidDefault={isScribbleTool}\n />\n </div>\n );\n }\n\n return null;\n};\n\nconst mapStateToProps = (state: AppState) => {\n const stepInfo = StepUtils.getCurrentStepInfo(state.annotation?.step, state.annotation?.stepList);\n\n return {\n toolInstance: state.annotation.toolInstance,\n stepInfo,\n };\n};\n\nexport default connect(mapStateToProps, null, null, { context: LabelBeeContext })(\n SwitchAttributeList,\n);\n"],"names":[],"mappings":";;;;;;;;;AAiBA,MAAM,mBAAA,GAAwC,CAAC,KAAU,KAAA;AAjBzD,EAAA,IAAA,EAAA,CAAA;AAkBE,EAAM,MAAA,CAAC,CAAG,EAAA,WAAA,CAAA,GAAe,QAAS,CAAA,CAAA,CAAA,CAAA;AAClC,EAAA,MAAM,UAAU,MAAoB,CAAA,IAAA,CAAA,CAAA;AACpC,EAAA,MAAM,CAAE,YAAiB,CAAA,GAAA,KAAA,CAAA;AACzB,EAAA,MAAM,CAAE,CAAM,CAAA,GAAA,cAAA,EAAA,CAAA;AAEd,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,YAAc,EAAA;AAChB,MAAa,YAAA,CAAA,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AO,OAAA;AAAA,IACL,YAAA,EAAc,MAAM,UAAW,CAAA,YAAA;AAAA,IAC/B,QAAA;AAAA,GAAA,CAAA;AAAA,CAAA,CAAA;AAIJ,4BAAe,QAAQ,eAAiB,EAAA,IAAA,EAAM,IAAM,EAAA,CAAE,SAAS,eAC7D,CAAA,CAAA,CAAA,mBAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import K from"../../../../components/attributeList/index.js";import M from"../../../../components/checkboxList/index.js";import{CaretRightOutlined as P}from"@ant-design/icons";import{Collapse as T,Tooltip as H,Badge as x}from"antd/es";import{cloneDeep as F}from"lodash";import n,{useState as p,useRef as U,useEffect as v,useCallback as q}from"react";import z from"../../../../assets/annotation/common/icon_clearSmall.svg.js";import G from"../../../../assets/annotation/common/icon_clearSmall_a.svg.js";import{TagUtils as J}from"@labelbee/lb-annotation";import{connect as Q}from"react-redux";import{useTranslation as V}from"react-i18next";import{LabelBeeContext as W}from"../../../../store/ctx.js";const{Panel:X}=T,$=({isActive:a})=>n.createElement(P,{rotate:a?90:0}),Y=({toolInstance:a,imgIndex:N})=>{const[o,g]=p([]),i=U(null),[,j]=p(0),[w,f]=p(-1),{t:b}=V();v(()=>{a&&(g(a.config.inputList.map(e=>e.value)),a.singleOn("render",()=>{j(e=>e+1)}))},[a]),v(()=>{if(a&&(a.singleOn("expend",O),a.labelSelectedList.length===1)){let e=0;for(let l=0;l<a.labelSelectedList[0];l++)e+=46,s[l]&&o[l]!==""&&s[l].subSelected.forEach(r=>{e+=40});i.current&&(i.current.children[0].scrollTop=e)}}),v(()=>{i.current&&(i.current.children[0].scrollTop=0)},[N]);const O=()=>{var e;const l=a.labelSelectedList[0],r=(e=s.filter((t,m)=>m===l)[0])==null?void 0:e.value;h(l,r,!0)},h=q((e,l,r)=>{const t=F(o);t[e]===""||r===!0?t[e]=l:t[e]="",g(t)},[o]);if(!a)return null;const{labelSelectedList:c,config:{inputList:s},currentTagResult:u,setLabel:E}=a,A=e=>c.length>0&&c[0]===e?n.createElement("span",{className:"keyDownIconActive"},e+1):n.createElement("span",{className:"keyDownIcon"},e+1),y=(e,l=-1)=>e?e.map((r,t)=>{var m,L,k,_,C;if(r.subSelected){const R=J.judgeResultIsInInputList(r.value,(m=u==null?void 0:u.result)==null?void 0:m[r.value],s);return n.createElement(T,{bordered:!1,expandIcon:$,key:`collapse_${t}_${l+1}`,onChange:()=>h(t,r.value),activeKey:[o[t]]},n.createElement(X,{header:n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flex:1}},n.createElement("span",null,r.key,n.createElement(H,{placement:"bottom",title:b("ClearThisOption")},n.createElement("img",{style:{marginLeft:5,cursor:"pointer"},onClick:D=>{D.stopPropagation(),a.clearResult(!0,r.value)},src:w===t||R?G:z,onMouseEnter:()=>{f(t)},onMouseLeave:()=>{f(-1)}})),R&&o[t]===""&&n.createElement(x,{color:"#87d068"})),(s==null?void 0:s.length)>1&&A(t)),key:r.value},n.createElement("div",{className:"level",style:{backgroundColor:c.length>0&&c[0]===t?"rgba(158, 158, 158, 0.18)":""}},y(r.subSelected,t))))}const d=(s==null?void 0:s[l])?s==null?void 0:s[l].value:0,S=((_=(k=(L=u==null?void 0:u.result)==null?void 0:L[d])==null?void 0:k.split(";"))==null?void 0:_.indexOf(r.value))>-1?r.value:"";return((C=s==null?void 0:s[l])==null?void 0:C.isMulti)===!0?n.createElement("div",{className:"singleBar",key:`${d}_${l}_${t}`},n.createElement(M,{attributeChanged:()=>E(l,t),selectedAttribute:[S],list:[{value:r.value,label:r.key}],num:t+1})):n.createElement("div",{className:"singleBar",key:`${d}_${l}_${t}`},n.createElement(K,{forbidColor:!0,attributeChanged:()=>E(l,t),selectedAttribute:S,list:[{value:r.value,label:r.key}],num:t+1}))}):null,B=window.innerHeight-61-80;return n.createElement("div",{className:"tagOperationMenu",ref:i},(s==null?void 0:s.length)===0?n.createElement("div",{style:{padding:20,textAlign:"center"}},b("NoConfiguration")):n.createElement("div",{className:"main",style:{height:B}},y(s)))};function Z(a){return{toolInstance:a.annotation.toolInstance,imgIndex:a.annotation.imgIndex}}var I=Q(Z,null,null,{context:W})(Y);export{I as default,$ as expandIconFuc};
|