@labelbee/lb-components 1.23.0-alpha.13 → 1.23.0-alpha.130
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/_virtual/2DViewWorker.js +1 -0
- package/dist/_virtual/highlightSegmentWorker.js +1 -1
- package/dist/assets/annotation/icon_link.svg.js +1 -0
- package/dist/assets/annotation/icon_unlink.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
- package/dist/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
- package/dist/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
- package/dist/assets/icons/ad33251.svg +26 -0
- package/dist/components/AnnotationView/index.js +1 -1
- package/dist/components/DynamicResizer/DynamicResizer.js +1 -0
- package/dist/components/DynamicResizer/assets/bottomToZero.svg.js +1 -0
- package/dist/components/DynamicResizer/assets/divider.svg.js +1 -0
- package/dist/components/DynamicResizer/assets/topToZero.svg.js +1 -0
- package/dist/components/DynamicResizer/hooks/useDrag.js +1 -0
- package/dist/components/DynamicResizer/hooks/useUpdateHeight.js +1 -0
- package/dist/components/DynamicResizer/index.js +1 -0
- package/dist/components/LLMMultiWheelView/dialogView/index.js +1 -0
- package/dist/components/LLMMultiWheelView/index.js +1 -0
- package/dist/components/LLMMultiWheelView/sidebar/index.js +1 -0
- package/dist/components/LLMToolView/index.js +1 -1
- package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/dist/components/LLMToolView/questionView/components/imgView/index.js +1 -1
- package/dist/components/LLMToolView/questionView/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/answerSort/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/modelAnswerSort/index.js +1 -0
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/index.js +1 -1
- package/dist/components/audioAnnotate/audioContext/index.js +1 -1
- package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +2 -1
- package/dist/components/audioAnnotate/index.js +1 -1
- package/dist/components/audioAnnotate/textInput/index.js +1 -1
- package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -1
- package/dist/components/audioAnnotate/utils/dataTransform.js +1 -0
- package/dist/components/audioPlayer/clipRegion/index.js +1 -1
- package/dist/components/audioPlayer/index.js +1 -1
- package/dist/components/audioPlayer/useAudioCombine/index.js +3 -2
- package/dist/components/audioPlayer/useAudioScroll/index.js +1 -1
- package/dist/components/audioPlayer/useAudioSegment/index.js +1 -1
- package/dist/components/audioPlayer/zoomSlider/index.js +1 -1
- package/dist/components/longText/index.js +1 -1
- package/dist/components/markdownView/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
- package/dist/components/pointCloud2DRectOperationView/util.js +1 -0
- package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudBackView.js +1 -1
- package/dist/components/pointCloudView/PointCloudContext.js +1 -1
- package/dist/components/pointCloudView/PointCloudInfos.js +1 -1
- package/dist/components/pointCloudView/PointCloudLayout.js +1 -1
- package/dist/components/pointCloudView/PointCloudListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudSegment2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudSegmentListener.js +1 -1
- package/dist/components/pointCloudView/PointCloudSideView.js +1 -1
- package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
- package/dist/components/pointCloudView/components/HighlightVisible/index.js +1 -1
- package/dist/components/pointCloudView/hooks/useBoxes.js +1 -1
- package/dist/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
- package/dist/components/pointCloudView/hooks/useHighlight.js +1 -1
- package/dist/components/pointCloudView/hooks/useHistory.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/pointCloudView/hooks/usePolygon.js +1 -1
- package/dist/components/pointCloudView/hooks/useRotate.js +1 -1
- package/dist/components/pointCloudView/hooks/useRotateEdge.js +1 -0
- package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -1
- package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
- package/dist/components/pointCloudView/hooks/useTimeoutFunc.js +1 -0
- package/dist/components/pointCloudView/hooks/useUpdatePointCloudColor.js +1 -0
- package/dist/components/pointCloudView/hooks/useWindowKeydownListener.js +1 -0
- package/dist/components/pointCloudView/index.js +1 -1
- package/dist/components/pointCloudView/utils/event-polyfill.js +1 -0
- package/dist/components/pointCloudView/utils/map.js +1 -0
- package/dist/components/predictTracking/predictTrackingIcon/index.js +1 -1
- package/dist/components/predictTracking/previewResult/index.js +1 -1
- package/dist/components/subAttributeList/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/index.js +1 -1
- package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
- package/dist/data/enums/ToolType.js +1 -1
- package/dist/hooks/useToolStyle.js +1 -0
- package/dist/index.css +205 -16
- package/dist/index.js +1 -1
- package/dist/store/Actions.js +1 -1
- package/dist/store/LLMMultiWheel/index.js +1 -0
- package/dist/store/annotatedBox/index.js +1 -1
- package/dist/store/annotation/actionCreators.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/store/ctx.js +1 -1
- package/dist/store/toolConfig/baseToolConfig.js +1 -0
- package/dist/store/toolConfig/index.js +1 -0
- package/dist/store/toolConfig/pointCloudToolConfig.js +1 -0
- package/dist/types/App.d.ts +6 -1
- package/dist/types/components/AnnotationView/index.d.ts +8 -0
- package/dist/types/components/DynamicResizer/DynamicResizer.d.ts +5 -0
- package/dist/types/components/DynamicResizer/hooks/useDrag.d.ts +12 -0
- package/dist/types/components/DynamicResizer/hooks/useUpdateHeight.d.ts +23 -0
- package/dist/types/components/DynamicResizer/index.d.ts +2 -0
- package/dist/types/components/DynamicResizer/types/interface.d.ts +17 -0
- package/dist/types/components/LLMMultiWheelView/dialogView/index.d.ts +15 -0
- package/dist/types/components/LLMMultiWheelView/index.d.ts +20 -0
- package/dist/types/components/LLMMultiWheelView/sidebar/index.d.ts +8 -0
- package/dist/types/components/LLMMultiWheelView/types.d.ts +62 -0
- package/dist/types/components/LLMToolView/questionView/components/header/index.d.ts +15 -0
- package/dist/types/components/LLMToolView/questionView/index.d.ts +7 -0
- package/dist/types/components/LLMToolView/sidebar/components/answerSort/index.d.ts +3 -0
- package/dist/types/components/LLMToolView/sidebar/components/modelAnswerSort/index.d.ts +30 -0
- package/dist/types/components/LLMToolView/sidebar/components/textInputBox/index.d.ts +2 -2
- package/dist/types/components/LLMToolView/sidebar/index.d.ts +10 -0
- package/dist/types/components/LLMToolView/types.d.ts +6 -2
- package/dist/types/components/LLMToolView/utils/data.d.ts +1 -0
- package/dist/types/components/audioAnnotate/audioContext/index.d.ts +10 -2
- package/dist/types/components/audioAnnotate/textInput/index.d.ts +1 -0
- package/dist/types/components/audioAnnotate/utils/dataTransform.d.ts +9 -0
- package/dist/types/components/audioPlayer/clipRegion/index.d.ts +1 -0
- package/dist/types/components/audioPlayer/index.d.ts +28 -21
- package/dist/types/components/audioPlayer/zoomSlider/index.d.ts +1 -0
- package/dist/types/components/longText/index.d.ts +1 -0
- package/dist/types/components/pointCloud2DRectOperationView/index.d.ts +1 -0
- package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +2 -0
- package/dist/types/components/pointCloud2DRectOperationView/util.d.ts +8 -0
- package/dist/types/components/pointCloudView/2DViewWorker.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +2 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +28 -4
- package/dist/types/components/pointCloudView/PointCloudLayout.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloudListener.d.ts +1 -0
- package/dist/types/components/pointCloudView/components/HighlightVisible/index.d.ts +2 -1
- package/dist/types/components/pointCloudView/hooks/useBoxes.d.ts +5 -3
- package/dist/types/components/pointCloudView/hooks/useDataLinkSwitch.d.ts +19 -0
- package/dist/types/components/pointCloudView/hooks/useHighlight.d.ts +1 -1
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +31 -1
- package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +9 -0
- package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +3 -2
- package/dist/types/components/pointCloudView/hooks/useTimeoutFunc.d.ts +6 -0
- package/dist/types/components/pointCloudView/hooks/useUpdatePointCloudColor.d.ts +4 -0
- package/dist/types/components/pointCloudView/hooks/useWindowKeydownListener.d.ts +16 -0
- package/dist/types/components/pointCloudView/index.d.ts +1 -0
- package/dist/types/components/pointCloudView/utils/event-polyfill.d.ts +8 -0
- package/dist/types/components/pointCloudView/utils/map.d.ts +11 -0
- package/dist/types/components/subAttributeList/index.d.ts +10 -0
- package/dist/types/components/videoAnnotate/index.d.ts +2 -1
- package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +2 -1
- package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
- package/dist/types/data/enums/ToolType.d.ts +2 -1
- package/dist/types/hooks/useToolStyle.d.ts +30 -0
- package/dist/types/index.d.ts +9 -2
- package/dist/types/store/Actions.d.ts +1 -0
- package/dist/types/store/LLMMultiWheel/index.d.ts +15 -0
- package/dist/types/store/annotatedBox/index.d.ts +2 -0
- package/dist/types/store/annotation/actionCreators.d.ts +4 -3
- package/dist/types/store/annotation/reducer.d.ts +1 -0
- package/dist/types/store/annotation/types.d.ts +9 -2
- package/dist/types/store/ctx.d.ts +7 -0
- package/dist/types/store/toolConfig/baseToolConfig.d.ts +4 -0
- package/dist/types/store/toolConfig/index.d.ts +3 -0
- package/dist/types/store/toolConfig/pointCloudToolConfig.d.ts +4 -0
- package/dist/types/store/toolConfig/types.d.ts +10 -0
- package/dist/types/utils/AnnotationDataUtils.d.ts +58 -1
- package/dist/types/utils/ToolPointCloudBoxRenderHelper.d.ts +24 -0
- package/dist/types/utils/data.d.ts +0 -2
- package/dist/types/utils/index.d.ts +31 -1
- package/dist/types/views/MainView/LLMMultiWheelLayout/index.d.ts +9 -0
- package/dist/types/views/MainView/sidebar/GeneralOperation/ActionsConfirm.d.ts +1 -0
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +1 -1
- package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.d.ts +9 -0
- package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.d.ts +3 -0
- package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/index.d.ts +1 -0
- package/dist/types/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.d.ts +10 -2
- package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
- package/dist/types/views/MainView/toolHeader/StepSwitch/index.d.ts +1 -1
- package/dist/types/views/MainView/toolHeader/index.d.ts +1 -1
- package/dist/utils/AnnotationDataUtils.js +1 -1
- package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -0
- package/dist/utils/data.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/views/MainView/LLMMultiWheelLayout/index.js +1 -0
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.module.scss.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.module.scss.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
- package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/dist/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
- package/dist/views/MainView/toolFooter/index.js +1 -1
- package/dist/views/MainView/toolHeader/index.js +1 -1
- package/es/App.js +1 -1
- package/es/_virtual/2DViewWorker.js +1 -0
- package/es/_virtual/highlightSegmentWorker.js +1 -1
- package/es/assets/annotation/icon_link.svg.js +1 -0
- package/es/assets/annotation/icon_unlink.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
- package/es/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
- package/es/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
- package/es/components/AnnotationView/index.js +1 -1
- package/es/components/DynamicResizer/DynamicResizer.js +1 -0
- package/es/components/DynamicResizer/assets/bottomToZero.svg.js +1 -0
- package/es/components/DynamicResizer/assets/divider.svg.js +1 -0
- package/es/components/DynamicResizer/assets/topToZero.svg.js +1 -0
- package/es/components/DynamicResizer/hooks/useDrag.js +1 -0
- package/es/components/DynamicResizer/hooks/useUpdateHeight.js +1 -0
- package/es/components/DynamicResizer/index.js +1 -0
- package/es/components/LLMMultiWheelView/dialogView/index.js +1 -0
- package/es/components/LLMMultiWheelView/index.js +1 -0
- package/es/components/LLMMultiWheelView/sidebar/index.js +1 -0
- package/es/components/LLMToolView/index.js +1 -1
- package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/es/components/LLMToolView/questionView/components/imgView/index.js +1 -1
- package/es/components/LLMToolView/questionView/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/answerSort/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/modelAnswerSort/index.js +1 -0
- package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/es/components/LLMToolView/sidebar/index.js +1 -1
- package/es/components/audioAnnotate/audioContext/index.js +1 -1
- package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +2 -1
- package/es/components/audioAnnotate/index.js +1 -1
- package/es/components/audioAnnotate/textInput/index.js +1 -1
- package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -1
- package/es/components/audioAnnotate/utils/dataTransform.js +1 -0
- package/es/components/audioPlayer/clipRegion/index.js +1 -1
- package/es/components/audioPlayer/index.js +1 -1
- package/es/components/audioPlayer/useAudioCombine/index.js +3 -2
- package/es/components/audioPlayer/useAudioScroll/index.js +1 -1
- package/es/components/audioPlayer/useAudioSegment/index.js +1 -1
- package/es/components/audioPlayer/zoomSlider/index.js +1 -1
- package/es/components/longText/index.js +1 -1
- package/es/components/markdownView/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
- package/es/components/pointCloud2DRectOperationView/util.js +1 -0
- package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/es/components/pointCloudView/PointCloud2DView.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js +1 -1
- package/es/components/pointCloudView/PointCloudBackView.js +1 -1
- package/es/components/pointCloudView/PointCloudContext.js +1 -1
- package/es/components/pointCloudView/PointCloudInfos.js +1 -1
- package/es/components/pointCloudView/PointCloudLayout.js +1 -1
- package/es/components/pointCloudView/PointCloudListener.js +1 -1
- package/es/components/pointCloudView/PointCloudSegment2DView.js +1 -1
- package/es/components/pointCloudView/PointCloudSegmentListener.js +1 -1
- package/es/components/pointCloudView/PointCloudSideView.js +1 -1
- package/es/components/pointCloudView/PointCloudTopView.js +1 -1
- package/es/components/pointCloudView/components/HighlightVisible/index.js +1 -1
- package/es/components/pointCloudView/hooks/useBoxes.js +1 -1
- package/es/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
- package/es/components/pointCloudView/hooks/useHighlight.js +1 -1
- package/es/components/pointCloudView/hooks/useHistory.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/pointCloudView/hooks/usePolygon.js +1 -1
- package/es/components/pointCloudView/hooks/useRotate.js +1 -1
- package/es/components/pointCloudView/hooks/useRotateEdge.js +1 -0
- package/es/components/pointCloudView/hooks/useSingleBox.js +1 -1
- package/es/components/pointCloudView/hooks/useStatus.js +1 -1
- package/es/components/pointCloudView/hooks/useTimeoutFunc.js +1 -0
- package/es/components/pointCloudView/hooks/useUpdatePointCloudColor.js +1 -0
- package/es/components/pointCloudView/hooks/useWindowKeydownListener.js +1 -0
- package/es/components/pointCloudView/index.js +1 -1
- package/es/components/pointCloudView/utils/event-polyfill.js +1 -0
- package/es/components/pointCloudView/utils/map.js +1 -0
- package/es/components/predictTracking/predictTrackingIcon/index.js +1 -1
- package/es/components/predictTracking/previewResult/index.js +1 -1
- package/es/components/subAttributeList/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/index.js +1 -1
- package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
- package/es/data/enums/ToolType.js +1 -1
- package/es/hooks/useToolStyle.js +1 -0
- package/es/index.css +205 -16
- package/es/index.js +1 -1
- package/es/store/Actions.js +1 -1
- package/es/store/LLMMultiWheel/index.js +1 -0
- package/es/store/annotatedBox/index.js +1 -1
- package/es/store/annotation/actionCreators.js +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/store/ctx.js +1 -1
- package/es/store/toolConfig/baseToolConfig.js +1 -0
- package/es/store/toolConfig/index.js +1 -0
- package/es/store/toolConfig/pointCloudToolConfig.js +1 -0
- package/es/utils/AnnotationDataUtils.js +1 -1
- package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -0
- package/es/utils/data.js +1 -1
- package/es/utils/index.js +1 -1
- package/es/views/MainView/LLMMultiWheelLayout/index.js +1 -0
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.module.scss.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.module.scss.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/index.js +1 -1
- package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
- package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/es/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
- package/es/views/MainView/toolHeader/index.js +1 -1
- package/package.json +7 -4
- package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
- package/dist/assets/icons/9d70807.svg +0 -5
- package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createBase64WorkerFactory as l}from"./_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js";var Z=l("
|
|
1
|
+
import{createBase64WorkerFactory as l}from"./_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js";var Z=l("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIGU9T2JqZWN0LmRlZmluZVByb3BlcnR5LHQ9T2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyxuPU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHksbz1PYmplY3QucHJvdG90eXBlLnByb3BlcnR5SXNFbnVtZXJhYmxlLGE9KHQsbixvKT0+biBpbiB0P2UodCxuLHtlbnVtZXJhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMCx3cml0YWJsZTohMCx2YWx1ZTpvfSk6dFtuXT1vLHI9KGUscik9Pntmb3IodmFyIHMgaW4gcnx8KHI9e30pKW4uY2FsbChyLHMpJiZhKGUscyxyW3NdKTtpZih0KWZvcih2YXIgcyBvZiB0KHIpKW8uY2FsbChyLHMpJiZhKGUscyxyW3NdKTtyZXR1cm4gZX07b25tZXNzYWdlPWZ1bmN0aW9uKGUpe2NvbnN0e2NhY2hlTWFwOnQsaW5kZXhlczpuLGRlZmF1bHRSR0JBOm99PWUuZGF0YSxhPW4ubGVuZ3RoLHM9W107Zm9yKGxldCBlPTA7ZTxhO2UrPTEpe2NvbnN0IG89dFtuW2VdXTtvJiZzLnB1c2gocih7fSxvKSl9cG9zdE1lc3NhZ2Uoe2Fubm90YXRpb25zOlt7dHlwZToicGl4ZWxQb2ludHMiLGFubm90YXRpb246cyxkZWZhdWx0UkdCQTpvfV19KX19KCk7Cgo=",null,!1);export{Z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react";var a="data:image/svg+xml,%3csvg class='icon' style='width: 1em%3bheight: 1em%3bvertical-align: middle%3bfill: currentColor%3boverflow: hidden%3b' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M633.417143 429.007238a174.567619 174.567619 0 0 1 0 246.857143l-155.306667 155.306667a186.709333 186.709333 0 1 1-264.045714-264.045715l76.483048-76.507428 51.73638 51.736381-76.507428 76.507428a113.566476 113.566476 0 1 0 160.597333 160.597334l155.306667-155.306667a101.424762 101.424762 0 0 0 0-143.408762z m208.603428-225.816381a186.709333 186.709333 0 0 1 0 264.045714L765.561905 543.744l-51.736381-51.712 76.507428-76.507429a113.566476 113.566476 0 1 0-160.597333-160.597333l-155.306667 155.306667a101.424762 101.424762 0 0 0 0 143.408762l-51.736381 51.736381a174.567619 174.567619 0 0 1 0-246.857143l155.306667-155.306667a186.709333 186.709333 0 0 1 264.045714 0z' fill='white'%3e%3c/path%3e%3c/svg%3e";export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react";var l="data:image/svg+xml,%3csvg class='icon' style='width: 1em%3bheight: 1em%3bvertical-align: middle%3bfill: currentColor%3boverflow: hidden%3b' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M384 128v128h64V128H384zM523.328 613.824l-147.072 147.072a80 80 0 0 1-113.152-113.152l147.072-147.072-45.248-45.248-147.072 147.072a144 144 0 0 0 203.648 203.648l147.072-147.072-45.248-45.248zM613.76 523.328l45.312 45.248 147.072-147.072a144 144 0 1 0-203.648-203.648L455.424 364.928l45.248 45.248 147.072-147.072a80 80 0 0 1 113.152 113.152L613.824 523.328zM768 576h128v64h-128V576zM128 448h128V384H128v64zM640 768v128H576v-128h64zM750.848 705.6l103.808 103.744-45.312 45.248-103.68-103.68 45.184-45.312zM169.344 214.592l103.808 103.808 45.248-45.248-103.744-103.808-45.312 45.248z' fill='white'%3e%3c/path%3e%3c/svg%3e";export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react";var c="data:image/svg+xml,%3csvg t='1718704851867' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='6005' width='200' height='200'%3e %3cpath d='M178.4 276C292.8 106.4 514.4 48 697.6 138.4c204.8 102.4 288.8 350.4 189.6 556-96.8 204-341.6 291.2-545.6 193.6-83.2-40-151.2-106.4-192-189.6-10.4-20.8-2.4-45.6 18.4-56 20-10.4 44.8-2.4 55.2 18.4v0.8c80 162.4 276 229.6 438.4 149.6 66.4-32.8 119.2-86.4 151.2-152.8 80-164.8 12-362.4-151.2-444.8-156-76.8-344-18.4-429.6 132.8h70.4c23.2 0 41.6 18.4 41.6 41.6s-18.4 41.6-41.6 41.6H136.8c-23.2 0-41.6-18.4-40.8-41.6V221.6c0-23.2 18.4-41.6 40.8-41.6 23.2 0 41.6 18.4 40.8 41.6v54.4z' fill='%23666666' p-id='6006' %3e%3c/path%3e%3c/svg%3e";export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as o from"react";var c;function
|
|
1
|
+
import*as o from"react";var c;function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},n.apply(null,arguments)}var i=function(t){return o.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","data-icon":"left",viewBox:"64 64 896 896"},t),c||(c=o.createElement("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6"})))};export{i as ReactComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as i from"react";var o;function
|
|
1
|
+
import*as i from"react";var o;function n(){return n=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var a in e)({}).hasOwnProperty.call(e,a)&&(r[a]=e[a])}return r},n.apply(null,arguments)}var c=function(t){return i.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","data-icon":"right",viewBox:"64 64 896 896"},t),o||(o=i.createElement("path",{d:"M765.7 486.8 314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4"})))};export{c as ReactComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react";var a="data:image/svg+xml,%3csvg t='1717751173252' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='3511' width='16' height='16'%3e %3cpath d='M490.666667 59.733333C240.896 59.733333 38.4 262.229333 38.4 512c0 249.770667 202.496 452.266667 452.266667 452.266667a452.266667 452.266667 0 0 0 406.954666-254.72 25.6 25.6 0 0 0-46.08-22.4A401.066667 401.066667 0 1 1 891.733333 512a25.6 25.6 0 0 0 51.242667 0c0-249.770667-202.496-452.266667-452.266667-452.266667z' fill='black' p-id='3512' %3e%3c/path%3e %3cpath d='M917.333333 192a21.333333 21.333333 0 0 0-20.992 17.493333L896 213.333333v298.666667a21.333333 21.333333 0 0 0 42.325333 3.84L938.666667 512V213.333333a21.333333 21.333333 0 0 0-21.333334-21.333333z' fill='black' p-id='3513' %3e%3c/path%3e %3cpath d='M322.688 523.093333c-29.568 0-45.696-20.736-45.696-56.832 0-36.864 19.2-58.752 43.392-58.752 30.72 0 51.84 25.344 56.064 81.024-16.896 24.576-36.48 34.56-53.76 34.56z m-82.176 113.28c16.512 16.896 39.552 29.952 72.192 29.952 54.528 0 105.216-44.544 105.216-155.904 0-93.312-43.776-137.088-97.92-137.088-45.696 0-84.096 36.864-84.096 92.928 0 59.136 31.872 88.704 79.104 88.704 21.504 0 45.696-12.672 62.208-33.024-2.688 80.64-32.256 108.288-66.432 108.288-18.048 0-35.328-8.448-46.464-21.12l-23.808 27.264zM547.712 666.325333c55.296 0 91.392-49.152 91.392-147.456 0-97.536-36.096-145.536-91.392-145.536-55.68 0-91.392 47.616-91.392 145.536 0 98.304 35.712 147.456 91.392 147.456z m0-34.944c-28.8 0-49.152-30.72-49.152-112.512 0-81.024 20.352-110.592 49.152-110.592 28.8 0 49.152 29.568 49.152 110.592 0 81.792-20.352 112.512-49.152 112.512zM730.88 480.085333c31.104 0 56.832-23.04 56.832-57.216 0-34.176-25.728-57.216-56.832-57.216-30.336 0-56.448 23.04-56.448 57.216 0 34.176 26.112 57.216 56.448 57.216z m0-23.04c-18.432 0-31.104-14.208-31.104-34.176 0-20.352 12.672-34.56 31.104-34.56 18.816 0 31.488 14.208 31.488 34.56 0 19.968-12.672 34.176-31.488 34.176z' fill='black' p-id='3514' %3e%3c/path%3e%3c/svg%3e";export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import w,{useState as q,useRef as y,useContext as G,useImperativeHandle as J,useEffect as c,useCallback as j}from"react";import{ViewOperation as K,ImgUtils as Q}from"@labelbee/lb-annotation";import{Spin as W}from"antd/es";import X from"../../hooks/useRefCache.js";import Y from"../measureCanvas/index.js";import{PointCloudContext as ee}from"../pointCloudView/PointCloudContext.js";var te=Object.defineProperty,D=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,N=(n,r,o)=>r in n?te(n,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[r]=o,R=(n,r)=>{for(var o in r||(r={}))ne.call(r,o)&&N(n,o,r[o]);if(D)for(var o of D(r))re.call(r,o)&&N(n,o,r[o]);return n},M=(n,r,o)=>new Promise((g,f)=>{var s=u=>{try{m(o.next(u))}catch(h){f(h)}},d=u=>{try{m(o.throw(u))}catch(h){f(h)}},m=u=>u.done?g(u.value):Promise.resolve(u.value).then(s,d);m((o=o.apply(n,r)).next())});const S={width:455,height:100},oe=n=>{if(!n)return S;if(n.width&&n.height)return n;const r=R({},n);return r.width||(r.width=S.width),r.height||(r.height=S.height),r},ie=(n,r)=>{var o,g;const{src:f,fallbackSrc:s,annotations:d=[],style:m={stroke:"blue",thickness:3},zoomChange:u,backgroundStyle:h={},onChange:I,showLoading:T=!1,globalStyle:U,afterImgOnLoad:Z,measureVisible:P,onRightClick:_,pointCloudBoxList:E=[],hiddenText:L=!1}=n,p=oe(n.size),[B,k]=q(!1),z=y(null),e=y(),x=X(Z),v=y([]),C=y(!0);G(ee),J(r,()=>{const t=e.current;return t?{zoomIn:()=>t.zoomChanged(!0),zoomOut:()=>t.zoomChanged(!1),initImgPos:()=>t.initImgPos(),toolInstance:t}:{}},[e.current]),c(()=>(z.current&&(e.current=new K({container:z.current,size:p,style:m,annotations:d,config:"{}",zoomInfo:n.zoomInfo,staticMode:n.staticMode}),e.current.init(),_&&e.current.on("onRightClick",_)),()=>{var t,a;_&&((t=e.current)==null||t.unbind("onRightClick",_)),(a=e.current)==null||a.destroy()}),[P]);const O=j(t=>M(void 0,null,function*(){var a,i;try{const l=yield Q.load(t);return(a=e.current)==null||a.setImgNode(l),(i=x.current)==null||i.call(x,l),null}catch(l){return console.error("Error loading image:",l),l}}),[]),A=j(t=>M(void 0,null,function*(){var a,i;if(k(!0),(a=e.current)==null||a.setLoading(!0),(yield O(t))&&s){const b=yield O(s);b&&console.error("Error loading fallback image:",b)}(i=e.current)==null||i.setLoading(!1),k(!1)}),[O,s]);c(()=>{e.current&&A(f)},[f,P,s,A]),c(()=>{(e==null?void 0:e.current)&&e.current.setPointCloudBoxList(E)},[E]),c(()=>{var t;(e==null?void 0:e.current)&&((t=e.current)==null||t.setHiddenText(L))},[L]),c(()=>{if(C.current===!1){v.current.push(d);return}const t=()=>{C.current=!0,v.current=[]},a=()=>{var i;const l=v.current.length;if(l>0){const b=v.current[l-1];v.current=[],(i=e.current)==null||i.updateData(b).then(a).catch(t)}else C.current=!0};e.current&&(C.current=!1,e.current.updateData(d).then(a).catch(t))},[d]),c(()=>{const t=e.current;(t==null?void 0:t.setSize)&&(t.setSize(p),t.initPosition())},[(o=n.size)==null?void 0:o.width,(g=n.size)==null?void 0:g.height]),c(()=>{var t,a;return e.current&&((t=e.current)==null||t.on("onChange",(...i)=>{I==null||I.apply(null,i)}),(a=e.current)==null||a.on("renderZoom",i=>{u&&u(i)})),()=>{var i,l;(i=e.current)==null||i.unbindAll("onChange"),(l=e.current)==null||l.unbindAll("renderZoom")}},[u,I]);const H=w.createElement("div",{ref:z,style:R(R({position:"relative"},p),h)}),{imgNode:V,zoom:F,currentPos:$}=e.current||{};return w.createElement(W,{spinning:T||B,delay:300,style:U},P&&V?w.createElement(Y,{size:p,imgNode:V,zoom:F,currentPos:$}):H)};var ae=w.forwardRef(ie);export{ae as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e,{useRef as f}from"react";import h from"./hooks/useDrag.js";const g=s=>{const{minTopHeight:i=0,minBottomHeight:a=0,defaultHeight:o=50,axis:c="y",children:t,localKey:n="dynamicResizerHeights",customDivider:m,isShortcutButton:l=!1}=s,r=f(null),{rendered:d,topStyle:u,bottomStyle:y}=h({containerRef:r,minTopHeight:i,minBottomHeight:a,defaultHeight:o,axis:c,localKey:n,customDivider:m,isShortcutButton:l});return e.createElement("div",{className:"dynamic-resizer-content",ref:r},e.createElement("div",{className:"dynamic-resizer-top",style:u},t[0]),d,e.createElement("div",{className:"dynamic-resizer-bottom",style:y},t[1]))};export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react";var t="data:image/svg+xml,%3csvg t='1720421473527' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5364' width='200' height='200'%3e %3cpath d='M94.8 304.5L512 721.8l416-416-833.2-1.3z m0 0' p-id='5365'%3e%3c/path%3e%3c/svg%3e";export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react";var a="data:image/svg+xml,%3csvg t='1720596188811' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1478' width='200' height='200'%3e %3cpath d='M36.5551 360.072857h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551Q0 440.453119 0 400.314185q0-40.190131 36.5551-40.190131z' fill='%23999999' p-id='1479' %3e%3c/path%3e %3cpath d='M36.5551 583.550465h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551q-36.5551 0-36.5551-40.190131t36.5551-40.190131z' fill='%23999999' p-id='1480' %3e%3c/path%3e %3cpath d='M553.292672 10.700302l159.634177 89.237451a58.774867 58.774867 0 0 1 29.080248 67.990438 64.406605 64.406605 0 0 1-62.409898 44.388336H344.355187a64.406605 64.406605 0 0 1-62.409897-44.388336 58.774867 58.774867 0 0 1 29.080247-67.990438L470.659714 10.700302a85.448827 85.448827 0 0 1 82.632958 0z m0 1002.654177l159.634177-89.23745a58.774867 58.774867 0 0 0 29.080248-67.990439 64.406605 64.406605 0 0 0-62.409898-44.388336H344.355187a64.406605 64.406605 0 0 0-62.409897 44.388336 58.774867 58.774867 0 0 0 29.080247 67.990439l159.634177 89.23745a85.448827 85.448827 0 0 0 82.632958 0z' fill='%23999999' p-id='1481' %3e%3c/path%3e%3c/svg%3e";export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react";var t="data:image/svg+xml,%3csvg t='1720421409111' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5202' width='200' height='200'%3e %3cpath d='M928 721.8L510.8 304.5l-416 416 833.2 1.3z m0 0' p-id='5203'%3e%3c/path%3e%3c/svg%3e";export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e,{useCallback as a,useMemo as b}from"react";import L from"react-draggable";import{useLocalStorageState as j}from"ahooks";import k from"./useUpdateHeight.js";import C from"../assets/topToZero.svg.js";import Z from"../assets/bottomToZero.svg.js";import P from"../assets/divider.svg.js";const F=({containerRef:t,minTopHeight:h=0,minBottomHeight:f=0,defaultHeight:E=50,axis:o,localKey:H,isShortcutButton:s=!1})=>{const l=H||"dynamicResizerHeights",{topHeight:i,position:d,bounds:m,topStyle:S,bottomStyle:T,updateELHeight:c,setTopHeightToZero:g,setBottomHeightToZero:n}=k(t,h,f,E,l),[U,p]=j(l),N=a(r=>{r.stopPropagation(),t.current&&t.current.classList.add("hide-scrollbar")},[t]),u=a((r,D)=>{r.stopPropagation(),c(D.y)},[c]),v=a(r=>{r.stopPropagation(),t.current&&t.current.classList.remove("hide-scrollbar"),p(i)},[t,p,i]),y=b(()=>s?e.createElement(e.Fragment,null,e.createElement("img",{src:C,className:"divider-top",draggable:"false",onClick:g}),e.createElement("div",{className:"divider-icon",draggable:"false"}),e.createElement("img",{src:Z,className:"divider-bottom",draggable:"false",onClick:n})):e.createElement(e.Fragment,null,e.createElement("img",{src:P,className:"divider-all",draggable:"false"}),e.createElement("div",{className:"divider-icon",draggable:"false"})),[s,g,n]);return{rendered:b(()=>{const r=e.createElement("div",{className:"divider"},y);return e.createElement(L,{axis:o,position:d,handle:".divider",onStart:N,onDrag:u,onStop:v,bounds:m},r)},[o,d,u,v,m]),topStyle:S,bottomStyle:T}};export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useState as r,useEffect as M,useMemo as c,useCallback as _}from"react";import{useLocalStorageState as U}from"ahooks";const b=1e-5,z=(t,m,v,d,S)=>{const[l,I]=r(0),[n,x]=r(0),[s,B]=r(0),[u,L]=r(0),[h,p]=U(S),[a,N]=r(!1);M(()=>{D(),N(!0)},[]),M(()=>{if(a){const o=P();H(o),p(o)}},[a]);const y=c(()=>({x:0,y:l}),[l]),Z=c(()=>{var o;return{top:s,bottom:(((o=t.current)==null?void 0:o.offsetHeight)||0)-u}},[s,t]),E=c(()=>({height:l+"px"}),[l]),k=c(()=>({height:n+"px"}),[n]),D=()=>{var o,i,e,g;if(t){let f=m,T=v;m>=(((o=t.current)==null?void 0:o.offsetHeight)||0)/2&&(f=(((i=t.current)==null?void 0:i.offsetHeight)||0)/2),v>=(((e=t.current)==null?void 0:e.offsetHeight)||0)/2&&(T=(((g=t.current)==null?void 0:g.offsetHeight)||0)/2),B(f||b),L(T)}},P=_(()=>{var o,i;let e=0;return h!=null?e=isNaN(Number(h))?0:Number(h):e=d,e<s&&(e=s),t&&e>=(((o=t==null?void 0:t.current)==null?void 0:o.offsetHeight)||0)&&(e=(((i=t.current)==null?void 0:i.offsetHeight)||0)/2),e||b},[t,l,s,h,d]),H=_(o=>{var i;if(t){const e=((i=t==null?void 0:t.current)==null?void 0:i.offsetHeight)||0,g=e-u;o>=s&&o<=g&&(I(o),x(e-o))}},[t,s,u]);return{topHeight:l,bottomHeight:n,position:y,bounds:Z,topStyle:E,bottomStyle:k,updateELHeight:H,setBottomHeightToZero:()=>{var o;if(t){const i=((o=t==null?void 0:t.current)==null?void 0:o.offsetHeight)||0;H(i-u||0),p(i-u||0)}},setTopHeightToZero:()=>{t&&(H(s||0),p(s||0))}}};export{z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./DynamicResizer.js";export{default}from"./DynamicResizer.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getTextControlByConfig as P,RenderAnswer as I}from"../../LLMToolView/questionView/index.js";import{RenderQuestion as N}from"../../LLMToolView/questionView/components/header/index.js";import V from"../../LLMToolView/questionView/components/imgView/index.js";import j from"../../../store/LLMMultiWheel/index.js";import{classnames as h}from"../../../utils/index.js";import{Button as n}from"antd";import e from"react";var x=Object.defineProperty,D=Object.defineProperties,M=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,u=(o,t,r)=>t in o?x(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,B=(o,t)=>{for(var r in t||(t={}))F.call(t,r)&&u(o,r,t[r]);if(c)for(var r of c(t))q.call(t,r)&&u(o,r,t[r]);return o},C=(o,t)=>D(o,M(t));const T=o=>{const{id:t,answerList:r,question:d,index:p,name:f="",answerIsImg:w,questionIsImg:E,LLMConfig:v}=o,{dataFormatType:s,selectedID:_,setSelectedID:g}=j(),a=p+1,y=f||`\u5BF9\u8BDD${a}`;return e.createElement("div",{key:t,onClick:()=>g(t),className:h({dialog:!0,selected:t===_})},e.createElement("div",{className:"header"},e.createElement("span",{className:"order"},a),e.createElement("div",{className:"name"},e.createElement("div",{className:"show-name"},y),e.createElement("div",{className:"tips"},"\uFF08\u9009\u4E2D\u6807\u6CE8\uFF09"))),e.createElement("div",{className:"dialog-question"},e.createElement(n,{type:"primary"},"\u9898\u76EE",a),e.createElement("div",null,e.createElement(N,{question:d,dataFormatType:s,isImg:E}))),e.createElement("div",{className:"dialog-answer"},w?e.createElement(e.Fragment,null,e.createElement(n,{type:"primary"},"\u7B54\u6848"),e.createElement(V,{answerList:r})):r==null?void 0:r.map((L,i)=>{const l=i+1,m=C(B({},L),{order:l}),O=P(m,v);return e.createElement("div",{key:i},e.createElement(n,{type:"primary"},"\u7B54\u6848",l),e.createElement(I,{i:m,isTextControl:O,dataFormatType:s}))})))};export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a,{useState as E,useEffect as M}from"react";import{ELLMDataType as W}from"../../constant/index.js";import{getStepConfig as X}from"../../store/annotation/reducer.js";import{LabelBeeContext as Y}from"../../store/ctx.js";import{jsonParser as Z}from"../../utils/index.js";import{connect as ee}from"react-redux";import A from"../../store/LLMMultiWheel/index.js";import{LLMMultiWheelViewCls as $}from"../../views/MainView/LLMMultiWheelLayout/index.js";import{ToggleDataFormatType as te}from"../LLMToolView/questionView/components/header/index.js";import ne from"./dialogView/index.js";import oe from"../messageMaskLayer/index.js";import re from"../../views/MainView/annotationTips/index.js";import{useTranslation as ie}from"react-i18next";import{LLMViewCls as ae}from"../LLMToolView/questionView/index.js";import{Layout as se}from"antd";var le=Object.defineProperty,ue=Object.defineProperties,de=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,ce=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,N=(t,e,n)=>e in t?le(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,y=(t,e)=>{for(var n in e||(e={}))ce.call(e,n)&&N(t,n,e[n]);if(F)for(var n of F(e))pe.call(e,n)&&N(t,n,e[n]);return t},h=(t,e)=>ue(t,de(e));const k=t=>{const{questionIsImg:e,answerIsImg:n,LLMConfig:s,dialogList:d}=t,{dataFormatType:L,setDataFormatType:l}=A();return a.createElement("div",{className:`${$}`},a.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},a.createElement(te,{dataFormatType:L,setDataFormatType:l})),a.createElement("div",{className:`${$}-container`},d==null?void 0:d.map((r,u)=>a.createElement(ne,h(y({},r),{key:u,index:u,questionIsImg:e,answerIsImg:n,LLMConfig:s})))))},R=({type:t,questionIndex:e,answerIndex:n,llmFile:s})=>{if(t==="question")return s==null?void 0:s.find((L,l)=>e===l);let d=null;return s==null||s.forEach((L,l)=>{var r;(r=L.answerList)==null||r.forEach((u,v)=>{l===e&&n===v&&(d=u)})}),d},me=t=>{var e,n;const{annotation:s,tips:d,showTips:L,drawLayerSlot:l}=t,{imgIndex:r,imgList:u,stepList:v,step:x,toolInstance:f}=s,[w,U]=E(),{setSelectedID:B,newAnswerListMap:T}=A(),[Q,V]=E([]),j=((e=w==null?void 0:w.dataType)==null?void 0:e.prompt)===W.Picture,P=((n=w==null?void 0:w.dataType)==null?void 0:n.response)===W.Picture,{t:z}=ie(),[,G]=E(0);return M(()=>{var o,c,p;if(!u[r])return;const _=(o=u[r])!=null?o:{},m=(p=(c=_==null?void 0:_.questionList)==null?void 0:c.textList)!=null?p:[];V(m),(m==null?void 0:m.length)&&B(m[0].id)},[r]),M(()=>{var o,c;const p=(o=u[r])!=null?o:{},_=p==null?void 0:p.questionList,m=(c=p==null?void 0:p.llmFile)==null?void 0:c.textList,I=_==null?void 0:_.textList,H=I==null?void 0:I.map((i,D)=>{var O;return h(y({},i),{question:j&&R({type:"question",questionIndex:D,llmFile:m})||(i==null?void 0:i.question),answerList:(O=i==null?void 0:i.answerList)==null?void 0:O.map((g,S)=>{var b,q,C;const J=`${(b=i==null?void 0:i.id)!=null?b:""}-${(q=g==null?void 0:g.id)!=null?q:""}`,K=P?R({type:"answer",questionIndex:D,answerIndex:S,llmFile:m})||{}:{};return y(h(y({},g),{answer:g.answer,newAnswer:(C=T[J])!=null?C:g.answer,order:S+1}),K)})})});V(H)},[T,j,P]),M(()=>{var o;if(v&&x){const c=(o=X(v,x))==null?void 0:o.config;U(Z(c))}},[v,x]),M(()=>{if(f)return f.on("validUpdated",()=>{G(o=>o+1)}),()=>{f.unbindAll("validUpdated")}},[f]),a.createElement(se,{className:ae},!(f==null?void 0:f.valid)&&a.createElement(oe,{message:z("InvalidQuestionAndSkip")}),l==null?void 0:l({}),L===!0&&a.createElement(re,{tips:d}),a.createElement(k,{questionIsImg:j,answerIsImg:P,LLMConfig:w,dialogList:Q}))},Le=t=>({annotation:t.annotation});var fe=ee(Le,null,null,{context:Y})(me);export{k as LLMMultiWheelSourceView,fe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import l,{useState as M,useRef as Dt,useMemo as G,useEffect as V}from"react";import{LabelBeeContext as It}from"../../../store/ctx.js";import{connect as Ot}from"react-redux";import{prefix as Vt}from"../../../constant/index.js";import{getStepConfig as Nt}from"../../../store/annotation/reducer.js";import{jsonParser as ut}from"../../../utils/index.js";import Bt,{getSorts as dt}from"../../LLMToolView/sidebar/components/modelAnswerSort/index.js";import{useTranslation as $t}from"react-i18next";import{useCustomToolInstance as Wt}from"../../../hooks/annotation.js";import{isBoolean as Ft,isString as qt,isNumber as kt,isObject as Gt,isArray as Kt}from"lodash";import{PageForward as N}from"../../../store/annotation/actionCreators.js";import{cKeyCode as zt,EToolName as Ut}from"@labelbee/lb-annotation";import{getLLMIsNoConfig as Qt,EmptyConfig as Jt}from"../../LLMToolView/sidebar/index.js";import Ht from"../../LLMToolView/sidebar/components/textInputBox/index.js";import{Button as ct}from"antd";import Xt from"../../LLMToolView/sidebar/components/answerList/index.js";import Yt from"../../../store/LLMMultiWheel/index.js";import Zt from"../../../utils/StepUtils.js";import{getCurrentResultFromResultList as te,getRenderDataByResult as ee}from"../../LLMToolView/utils/data.js";import{useMemoizedFn as K}from"ahooks";import ne from"../../LLMToolView/sidebar/components/answerSort/index.js";var oe=Object.defineProperty,re=Object.defineProperties,le=Object.getOwnPropertyDescriptors,pt=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,mt=(c,s,p)=>s in c?oe(c,s,{enumerable:!0,configurable:!0,writable:!0,value:p}):c[s]=p,i=(c,s)=>{for(var p in s||(s={}))ie.call(s,p)&&mt(c,p,s[p]);if(pt)for(var p of pt(s))se.call(s,p)&&mt(c,p,s[p]);return c},a=(c,s)=>re(c,le(s));const ae=zt.default,ft=`${Vt}-sidebar`,ue={sort:[],answerSort:{},textAttribute:[]},de=c=>{var s,p,z,U,Q,J,H;const{annotation:vt,dispatch:C,checkMode:Lt}=c,{imgIndex:S,imgList:B,stepList:A,step:h,skipBeforePageTurning:j}=vt,[m,xt]=M(),{t:T}=$t(),r=(s=B[S])!=null?s:{},X=ut(r==null?void 0:r.result),{toolInstanceRef:v}=Wt({basicInfo:X}),[$,gt]=M(!0),[R,Y]=M({}),[P,Z]=M(ue),W=Dt(),[x,F]=M({}),{selectedID:D,setNewAnswerListMap:tt,newAnswerListMap:et}=Yt(),g=G(()=>R[D],[D,R]),b=!v.current.valid||Lt;V(()=>{var t;if(A&&h){const e=(t=Nt(A,h))==null?void 0:t.config;xt(ut(e))}},[h,JSON.stringify(A)]),V(()=>{!r||S===-1||(v.current.setValid=nt,v.current.clearResult=wt,nt(),ot())},[S,m,r==null?void 0:r.id]);const wt=()=>{var t,e,n,u,f;ot((t=r==null?void 0:r.questionList)==null?void 0:t.textList),((e=W.current)==null?void 0:e.clearValue)&&((n=W.current)==null||n.clearValue());const{waitSorts:o}=dt({selectedSort:(f=(u=I())==null?void 0:u.sort)!=null?f:[],initSelected:[],modelList:E?O!=null?O:[]:[]});F(a(i({},x),{waitSorts:o,newSort:[]}))},nt=t=>{var e;const n=t!=null?t:X.valid;Ft(n)&&(gt(n),v.current.valid=n,(e=v.current)==null||e.emit("validUpdated"))},I=()=>{const t=Zt.getCurrentStepInfo(h,A);return te(r==null?void 0:r.result,t.step)},ot=K(t=>{var e,n,u,f,o,L,y;const d=I();let w=(e=r==null?void 0:r.questionList)==null?void 0:e.textList;((n=d==null?void 0:d.modelData)==null?void 0:n.length)&&v.current.valid&&(w=d==null?void 0:d.modelData),t&&(w=t,d.sort=[],d.textAttribute=[],d.answerSort=[]);let st={};w==null||w.forEach((_,Tt)=>{var at;const Rt=ee(m,a(i({},_),{answerList:(at=_==null?void 0:_.answerList)==null?void 0:at.map((k,Pt)=>(tt(a(i({},et),{[`${_.id}-${k.id}`]:k.answer})),a(i({},k),{order:Pt+1})))}));st[_.id]=a(i({},Rt),{order:Tt+1,id:_.id})});const{waitSorts:ht,newSort:jt}=dt({selectedSort:(f=(u=I())==null?void 0:u.sort)!=null?f:[],modelList:E?O!=null?O:[]:[]});F({waitSorts:ht,newSort:jt}),Z({sort:(o=d==null?void 0:d.sort)!=null?o:[],textAttribute:(L=d==null?void 0:d.textAttribute)!=null?L:[],answerSort:(y=d==null?void 0:d.answerSort)!=null?y:{}}),Y(st)});V(()=>{_t()},[R,$,P]),V(()=>(window.addEventListener("keydown",rt),()=>{window.removeEventListener("keydown",rt)}),[]);const _t=K(()=>{var t,e;const n=(e=(t=r==null?void 0:r.questionList)==null?void 0:t.textList)==null?void 0:e.map(f=>{var o;const L=(o=R[f.id])!=null?o:{};return{id:f.id,answerList:L.answerList}}),u=a(i({},P),{modelData:n});v.current.exportData=()=>[[u],{valid:$}],v.current.currentPageResult=a(i({},u),{toolName:Ut.LLMMultiWheel,valid:$})}),rt=t=>{if(t.ctrlKey&&t.keyCode===ae.Enter){if(j){j(()=>C(N()));return}C(N())}},St=K(({order:t,value:e,key:n})=>{const{answerList:u}=g,f=u==null?void 0:u.map(o=>{var L,y;if((o==null?void 0:o.order)===t){if(n==="textEdit"&&qt(e))return tt(a(i({},et),{[`${D}-${(L=o==null?void 0:o.id)!=null?L:""}`]:e})),a(i({},o),{newAnswer:e});if(kt(e))return a(i({},o),{score:e});if(Gt(e)&&n){const d={[e==null?void 0:e.key]:e.value},w=(y=o[n])!=null?y:{};return a(i({},o),{[n]:i(i({},w),d)})}}return o});Y(o=>a(i({},o),{[D]:a(i({},g),{answerList:f})}))}),q=(t,e)=>{Z(n=>a(i({},n),{[t]:e}))},{indicatorScore:lt=[],indicatorDetermine:it=[],isTextEdit:bt,dialogSort:E=!1,inputList:Et=[],tagInputListConfigurable:yt,enableSort:Mt=!1}=m||{},O=G(()=>{var t,e,n;return E?(n=(e=(t=r==null?void 0:r.questionList)==null?void 0:t.textList)==null?void 0:e.map((u,f)=>a(i({},u),{title:f+1})))!=null?n:[]:[]},[r,E]);if(G(()=>Qt(m),[m]))return l.createElement(Jt,null);const Ct=yt&&((p=Et.filter(t=>!t.isOverall))==null?void 0:p.length)>0,At=(it==null?void 0:it.length)>0||(lt==null?void 0:lt.length)>0||bt||Ct;return l.createElement("div",{className:`${ft}`},l.createElement("div",{className:`${ft}__content`},l.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},T("GlobalAnnotation")),E&&l.createElement(ne,{waitSortList:(x==null?void 0:x.waitSorts)||[],sortList:(x==null?void 0:x.newSort)||[],setSortList:t=>{const e=t.map(n=>n.map(u=>u.id));q("sort",e),F(a(i({},x),{newSort:t}))},disabeledAll:b,title:T("SortConversationQuality"),prefixId:"model"}),(m==null?void 0:m.text)&&l.createElement("div",{style:{padding:"0px 16px",marginTop:"16px"}},l.createElement(Ht,{textAttribute:(z=P==null?void 0:P.textAttribute)!=null?z:[],textConfig:(m==null?void 0:m.text)&&Kt(m.text)?m==null?void 0:m.text:[],setText:t=>q("textAttribute",t),disabeledAll:b})),Mt&&l.createElement(Bt,{modelData:(Q=(U=r==null?void 0:r.questionList)==null?void 0:U.textList)!=null?Q:[],selectedAnswerSort:t=>q("answerSort",t),selectedSort:(H=(J=I())==null?void 0:J.answerSort)!=null?H:[],ref:W,disabeledAll:b,imgIndex:S}),g&&l.createElement(l.Fragment,null,l.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},T("QualifiedAnnotation")),l.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"}},l.createElement(ct,{type:"primary",danger:!0},"\u6B63\u5728\u6807\u6CE8"),l.createElement("div",{style:{padding:16}},"\u7EC4\uFF1A",g.order)),l.createElement("div",null,At&&l.createElement(Xt,{list:(g==null?void 0:g.answerList)||[],LLMConfig:m,updateValue:St,disabeledAll:b})))),l.createElement("div",{style:{margin:"24px 16px",display:"flex"}},(B==null?void 0:B.length)-1!==S&&l.createElement(ct,{type:"primary",style:{marginLeft:"auto"},onClick:()=>{if(j){j(()=>C(N()));return}C(N())},disabled:b},T("Save"))))},ce=c=>({annotation:c.annotation});var pe=Ot(ce,null,null,{context:It})(de);export{pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import a,{useContext as
|
|
1
|
+
import a,{useContext as $,useState as v,useEffect as u}from"react";import{connect as U}from"react-redux";import{LabelBeeContext as B,LLMContext as K}from"../../store/ctx.js";import{message as W}from"antd";import{ELLMDataType as L,prefix as z}from"../../constant/index.js";import{Layout as G}from"antd/es";import H from"./questionView/index.js";import{useTranslation as J}from"react-i18next";import O from"../../views/MainView/annotationTips/index.js";import{getCurrentResultFromResultList as X}from"./utils/data.js";import{getStepConfig as Y}from"../../store/annotation/reducer.js";import{jsonParser as Z}from"../../utils/index.js";import ee from"../messageMaskLayer/index.js";const q=`${z}-LLMView`,te=g=>{var x;const{annotation:M,checkMode:T=!0,tips:A,showTips:E,drawLayerSlot:I}=g,{imgIndex:n,imgList:s,stepList:w,step:d,toolInstance:l}=M,{hoverKey:R,modelAPIResponse:P,setModelAPIResponse:_,newAnswerList:c}=$(K),[V,S]=v([]),[h,k]=v(""),[t,Q]=v(),{t:y}=J(),[,b]=v(0);return u(()=>{let e;if(!T)return e=setInterval(()=>{W.info(y("EfficientListening"))},1e3*60),()=>{e&&clearInterval(e)}},[]),u(()=>{if(l)return l.on("validUpdated",()=>{b(e=>e+1)}),()=>{l.unbindAll("validUpdated")}},[l]),u(()=>{var e,o,i,r,j,C;if(!s[n])return;const D=((e=t==null?void 0:t.dataType)==null?void 0:e.prompt)===L.Picture,F=((o=t==null?void 0:t.dataType)==null?void 0:o.response)===L.Picture,m=(i=s[n])==null?void 0:i.questionList,p=(r=s[n])==null?void 0:r.llmFile,N=D?p==null?void 0:p.question:m==null?void 0:m.question;k(N);let f=(m==null?void 0:m.answerList)||[];F&&(f=(p==null?void 0:p.answerList)||[]),((j=t==null?void 0:t.dataType)==null?void 0:j.response)===L.None&&(f=[]),((C=t==null?void 0:t.dataType)==null?void 0:C.response)===L.Text&&(c==null?void 0:c.length)>0&&(f=c),S(f)},[n,c,t,(x=s[n])==null?void 0:x.id]),u(()=>{var e;if(!s[n])return;const o=(e=s[n])!=null?e:{},i=X(o==null?void 0:o.result,d),r=(i==null?void 0:i.length)>0?i[0]:i;_((r==null?void 0:r.modelAPIResponse)||[])},[n]),u(()=>{var e;if(w&&d){const o=(e=Y(w,d))==null?void 0:e.config;Q(Z(o))}},[w,d]),a.createElement(G,{className:q},!(l==null?void 0:l.valid)&&a.createElement(ee,{message:y("InvalidQuestionAndSkip")}),I==null?void 0:I({}),a.createElement("div",{className:`${q}-question`},E===!0&&a.createElement(O,{tips:A}),a.createElement(H,{hoverKey:R,question:h,answerList:V,modelAPIResponse:P,setModelAPIResponse:_,checkMode:T,annotation:M,LLMConfig:t})))},ne=g=>({annotation:g.annotation});var oe=U(ne,null,null,{context:B})(te);export{oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{useTranslation as
|
|
1
|
+
import e from"react";import{useTranslation as u}from"react-i18next";import{Resizable as f}from"re-resizable";import{Radio as i,Image as g}from"antd";import{EDataFormatType as m,prefix as E}from"../../../../../constant/index.js";import{FileTextOutlined as x}from"@ant-design/icons";import w from"../../../../markdownView/index.js";import{isString as y,isObject as T}from"lodash";import{i18n as b}from"@labelbee/lb-utils";import h from"../../../../../assets/annotation/LLMTool/imgFail_cn.svg.js";import v from"../../../../../assets/annotation/LLMTool/imgFail_en.svg.js";const s=`${E}-LLMView`,c=({question:t,dataFormatType:n,isImg:a})=>{const r=y(t)?t:"",o=b.language==="en"?v:h;if(a){const l=T(t)?t==null?void 0:t.url:"";return e.createElement(g,{src:l||o,fallback:o})}return e.createElement("div",{style:{whiteSpace:"pre-wrap"}},n===m.Markdown?e.createElement(w,{value:r}):r)},F=t=>{const{question:n,dataFormatType:a,setDataFormatType:r,isImg:o}=t,l=300,{t:p}=u();return e.createElement(f,{defaultSize:{width:"100%",height:l},minHeight:l,enable:{bottom:!0},style:{padding:"26px 32px",borderBottom:"1px solid #EBEBEB",overflow:"hidden"}},e.createElement("div",{className:`${s}__title`,style:{display:"flex",justifyContent:"space-between"}},p("Title"),e.createElement(d,{dataFormatType:a,setDataFormatType:r})),e.createElement("div",{className:`${s}__headerContent`},e.createElement(c,{question:n,dataFormatType:a,isImg:o})))},d=t=>{const{dataFormatType:n,setDataFormatType:a}=t;return e.createElement("span",{style:{display:"flex"}},e.createElement(i.Group,{value:n,onChange:r=>{a(r.target.value)}},e.createElement(i.Button,{value:m.Default,style:{textAlign:"center",width:"52px"}},"</>"),e.createElement(i.Button,{value:m.Markdown,style:{textAlign:"center",width:"52px"}},e.createElement(x,null))),e.createElement("span",{style:{marginLeft:"8px",width:"4px",background:"#1890ff"}}))};export{c as RenderQuestion,d as ToggleDataFormatType,F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"react";import{Tag as i,Image as c}from"antd";import{prefix as
|
|
1
|
+
import t from"react";import{Tag as i,Image as c}from"antd";import{prefix as d}from"../../../../../constant/index.js";import g from"classnames";import u from"../../../../../assets/annotation/LLMTool/imgFail_cn.svg.js";import f from"../../../../../assets/annotation/LLMTool/imgFail_en.svg.js";import{i18n as p}from"@labelbee/lb-utils";import a from"./index.module.scss.js";const o=`${d}-LLMView`,v=m=>{const{answerList:s,hoverKey:l}=m,n=p.language==="en"?f:u;return t.createElement("div",{className:a.imgView},s==null?void 0:s.map((e,r)=>t.createElement("div",{key:r,className:g({[`${a.item}`]:!0,[`${o}__contentActive`]:l===(e==null?void 0:e.order)})},t.createElement(i,{className:`${o}-tag`},e==null?void 0:e.order),t.createElement("div",{className:a.image},t.createElement(c,{src:e==null?void 0:e.url,fallback:n,style:{objectFit:"contain"}})))))};export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import n,{useState as M,useEffect as O}from"react";import{Tag as S}from"antd";import{prefix as N,EDataFormatType as u,ELLMDataType as p}from"../../../constant/index.js";import $ from"classnames";import{I18nextProvider as k,useTranslation as C}from"react-i18next";import{i18n as v}from"@labelbee/lb-utils";import D from"../../markdownView/index.js";import L from"../modelAPIView/index.js";import R from"../../diffMatchPatchComponent/index.js";import F from"./components/header/index.js";import W from"./components/imgView/index.js";import{isString as q}from"lodash";var B=Object.defineProperty,w=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,f=(e,t,r)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,K=(e,t)=>{for(var r in t||(t={}))H.call(t,r)&&f(e,r,t[r]);if(w)for(var r of w(t))Q.call(t,r)&&f(e,r,t[r]);return e};const a=`${N}-LLMView`,_=({i:e,dataFormatType:t,isTextControl:r})=>{var l;return t===u.Markdown?n.createElement(D,{value:(l=e==null?void 0:e.newAnswer)!=null?l:e==null?void 0:e.answer}):r?n.createElement("div",{style:{width:"100%",overflowWrap:"break-word"}},n.createElement(R,{originString:e==null?void 0:e.answer,currentString:e==null?void 0:e.newAnswer})):n.createElement("div",{style:{whiteSpace:"pre-wrap",overflowWrap:"break-word"}},(e==null?void 0:e.newAnswer)||(e==null?void 0:e.answer))},E=(e,t)=>{var r;return(t==null?void 0:t.isTextEdit)?!!((r=((t==null?void 0:t.textEdit)||[]).filter(s=>(s==null?void 0:s.title)===e.order)[0])==null?void 0:r.textControl):!1},z=e=>{var t,r;const{hoverKey:l,answerList:s,question:m,lang:c,modelAPIResponse:x,setModelAPIResponse:g,checkMode:y=!0,LLMConfig:i,answerHeaderSlot:P}=e,[d,h]=M(u.Default),I=((t=i==null?void 0:i.dataType)==null?void 0:t.prompt)===p.Picture,A=((r=i==null?void 0:i.dataType)==null?void 0:r.response)===p.Picture,{t:T}=C();O(()=>{var o;c&&((o=v)==null||o.changeLanguage(c))},[]);const V=n.createElement("div",null,s.map((o,b)=>{const j=E(o,i);return n.createElement("div",{className:$({[`${a}__content`]:!0,[`${a}__contentActive`]:l===(o==null?void 0:o.order)}),key:b},n.createElement(S,{className:`${a}-tag`},o==null?void 0:o.order),n.createElement(_,{i:o,isTextControl:j,dataFormatType:d}))}),q(m)&&n.createElement(L,{dataFormatType:d,modelAPIResponse:x,question:m,setModelAPIResponse:g,checkMode:y,annotation:e.annotation}));return n.createElement("div",{className:a},n.createElement(F,{question:m,dataFormatType:d,setDataFormatType:h,isImg:I}),n.createElement("div",{className:`${a}__textBox`},n.createElement("div",{className:`${a}__title`},T("Answer")," ",P),A?n.createElement(W,{hoverKey:l,answerList:s}):V))},G=e=>n.createElement(k,{i18n:v},n.createElement(z,K({},e)));export{a as LLMViewCls,_ as RenderAnswer,G as default,E as getTextControlByConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import s,{useReducer as
|
|
1
|
+
import s,{useReducer as ie,useContext as ae,useState as F,useEffect as se}from"react";import{prefix as le}from"../../../../../constant/index.js";import{Tag as de}from"antd";import{useTranslation as W}from"react-i18next";import{LeftOutlined as ce}from"@ant-design/icons";import{classnames as pe}from"../../../../../utils/index.js";import{isArray as ue,cloneDeep as fe}from"lodash";import{MathUtils as y}from"@labelbee/lb-annotation";import{LLMContext as ge}from"../../../../../store/ctx.js";var me=Object.defineProperty,ve=Object.defineProperties,xe=Object.getOwnPropertyDescriptors,q=Object.getOwnPropertySymbols,he=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable,z=(i,p,l)=>p in i?me(i,p,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[p]=l,J=(i,p)=>{for(var l in p||(p={}))he.call(p,l)&&z(i,l,p[l]);if(q)for(var l of q(p))_e.call(p,l)&&z(i,l,p[l]);return i},ye=(i,p)=>ve(i,xe(p)),m;(function(i){i.Top="Top",i.Right="Right",i.Bottom="Bottom",i.Left="Left"})(m||(m={}));const w=`${le}-LLMSidebar-contentBox`,B="@",be=()=>{const{t:i}=W();return s.createElement("div",{className:`${w}__navigation`},s.createElement("span",null,i("Best")),s.createElement("div",{style:{display:"flex",alignItems:"center",flex:1,margin:"0px 20px"}},s.createElement(ce,null),s.createElement("div",{style:{height:0,border:"1px solid #999999",width:"100%"}})),s.createElement("span",null,i("Worst")))},Le=i=>{const[,p]=ie(e=>e+1,0),{sortList:l,setSortList:K,waitSortList:U,disabeledAll:V,header:Y,title:X,prefixId:G="answer"}=i,N=`${G}-waitBox`,x=`${G}-sortBox`,{setHoverKey:H}=ae(ge),[O,b]=F(void 0),[E,Q]=F(void 0),[_,Z]=F([]),{t:S}=W();se(()=>{Z(U)},[U]);const T=({item:e,operation:t,id:n})=>{const o={[`border${O}`]:"2px solid #8C9AFF"};return s.createElement("div",J({key:`${e==null?void 0:e.id}`,color:"#EBEBEB",id:n,className:pe({[`${w}__answerTag`]:!0}),style:E===(e==null?void 0:e.id)&&O?o:void 0,draggable:V||!(e==null?void 0:e.id)?"":"true",onMouseMove:()=>{H(e.id)},onMouseLeave:()=>{H(-1)}},t),e==null?void 0:e.title)},D=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),ee=(e,t)=>{const n=y.getLineLength(e,D(t.tl,t.tr)),o=y.getLineLength(e,D(t.tr,t.tr)),d=y.getLineLength(e,D(t.bl,t.br)),c=y.getLineLength(e,D(t.tl,t.bl));return{minDistance:Math.min(n,o,d,c),toTopDistance:n,toRightDistance:o,toBottompDistance:d,toLeftDistance:c}},te=(e,t)=>{const{minDistance:n,toTopDistance:o,toRightDistance:d,toBottompDistance:c,toLeftDistance:u}=ee(e,t);switch(n){case o:b(m.Top);break;case d:b(m.Right);break;case c:b(m.Bottom);break;case u:b(m.Left);break}},C=()=>{const e=document.getElementById(x);if(e==null?void 0:e.childNodes){let t=[];e.childNodes.forEach((n,o)=>{var d;let c=n;((d=n==null?void 0:n.childNodes)==null?void 0:d.length)>1&&(c=n.childNodes[0]);const u=c.getBoundingClientRect()||{},{bottom:a,top:f,left:r,right:g,width:v,height:h,x:R,y:M}=u,j={x:r+v/2,y:f+h/2},k={tl:{x:R,y:M},tr:{x:g,y:f},br:{x:g,y:a},bl:{x:r,y:a}},oe=l[o].reduce((re,$)=>{let I=$;return ue($)&&$.length>1&&(I=$[0]),I=ye(J({},I),{tagCenterPoint:j,tagVertexPoint:k}),[...re,I]},[]);t.push(oe)}),K(t)}},P=e=>{var t,n,o,d,c,u;const a=e.pageX,f=e.pageY,r={x:a,y:f};let g=l;if((g==null?void 0:g.length)>0){let v=g[0];for(let h=0;h<g.length;h++)if(h>0){const R=(t=g[h][0])==null?void 0:t.tagCenterPoint,M=(n=v[0])==null?void 0:n.tagCenterPoint,j=y.getLineLength(r,R),k=y.getLineLength(r,M);j<k&&(v=l[h])}if(!r.x||!r.y)return;if(L(e.target.id)===((o=v[0])==null?void 0:o.id)){Q(void 0);return}Q((d=v[0])==null?void 0:d.id),((c=v[0])==null?void 0:c.tagVertexPoint)&&r&&(r==null?void 0:r.x)&&(r==null?void 0:r.y)&&te(r,(u=v[0])==null?void 0:u.tagVertexPoint)}},A=e=>{var t;const{target:n}=e;let o=-1,d=-1,c=-1,u=[],a=fe(l);if(c=a.findIndex(f=>f[0].id===Number(E)),((t=n==null?void 0:n.parentNode)==null?void 0:t.parentNode.id)===x){o=L(n.parentNode.id);const f=L(n.id);u=a[~~o].filter(g=>g.id===~~f);const r=a[~~o].findIndex(g=>g.id===~~f);a[~~o].splice(r,1)}if((n==null?void 0:n.parentNode.id)===x){if(!E)return;o=L(n.id),d=a.findIndex(r=>r[0].id===o);const f=a.find(r=>r[0].id===o);f&&(u=f),a.splice(d,1),c=a.findIndex(r=>r[0].id===~~E)}switch(n.parentNode.id===N&&(o=L(n.id),d=_.findIndex(f=>f.id===o),u=[_[d]],_.splice(d,1)),O){case m.Left:a.splice(c,0,u);break;case m.Right:a.splice(c+1,0,u);break;case m.Top:case m.Bottom:a[c].push(...u);break;default:a.push(u);break}K(a),b(void 0),p()},L=e=>{const t=e.indexOf(B);return Number(e.substring(t+1,e.length))},ne=Y!=null?Y:s.createElement("div",{className:`${w}__title`},s.createElement("span",null,X!=null?X:S("RankingQualityOfAnswers")),_.length>0&&s.createElement(de,{color:"#FFD9D9",style:{color:"#F26549",marginLeft:8}},S("Unfinished")));return s.createElement("div",{style:{padding:"0px 16px",marginBottom:"16px",width:"100%"}},ne,s.createElement("div",null,s.createElement("div",{style:{display:"flex",alignItems:"center"}},s.createElement("span",{style:{marginRight:"16px"}},S("ToBeSorted")),s.createElement("div",{id:N,className:`${w}__answerBox`},_.length>0&&_.map(e=>T({item:e,id:`${N}-waitBoxItem${B}${e==null?void 0:e.id}`,operation:{onDrag:P,onDragEnd:A,onDragStart:()=>C()}})))),s.createElement(be,null),s.createElement("div",{id:x,className:`${w}__answerBox`},l.map((e,t)=>{var n;return e.length>1?s.createElement("div",{key:`item-${t}`,id:`${x}${B}${t}`,style:{border:"1px dashed #d9d9d9"}},e.map(o=>T({item:o,id:`${x}-sortBoxItem${B}${o==null?void 0:o.id}`,operation:{onDrag:P,onDragEnd:A,onDragStart:()=>C()}}))):T({item:e[0],id:`${x}${B}${(n=e[0])==null?void 0:n.id}`,operation:{onDrag:P,onDragEnd:A,onDragStart:()=>C()}})}))))};export{Le as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import m,{forwardRef as V,useState as $,useMemo as A,useEffect as F,useImperativeHandle as M}from"react";import{useTranslation as R}from"react-i18next";import{useDebounceFn as T}from"ahooks";import H from"../answerSort/index.js";import{Tag as W}from"antd";import{isArray as z}from"lodash";var N=Object.defineProperty,Q=Object.defineProperties,U=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,E=(a,t,r)=>t in a?N(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,g=(a,t)=>{for(var r in t||(t={}))k.call(t,r)&&E(a,r,t[r]);if(D)for(var r of D(t))q.call(t,r)&&E(a,r,t[r]);return a},_=(a,t)=>Q(a,U(t));const P=({selectedSort:a,initSelected:t,modelList:r})=>{var i;const d=t!=null?t:a;let S=[];const f=r.filter(s=>!(d&&(d==null?void 0:d.length)>0?d.flat():[]).includes(s.id));return d&&(d==null?void 0:d.length)>0&&(S=(i=d.map(s=>{var w;return(w=s.map(u=>r.find(h=>h.id===u)))==null?void 0:w.filter(u=>u)}))==null?void 0:i.filter(s=>(s==null?void 0:s.length)>0)),{waitSorts:f,newSort:S}},B=(a,t)=>{const{selectedSort:r,modelData:i,selectedAnswerSort:d,disabeledAll:S,imgIndex:f}=a,[s,w]=$({waitSorts:{},selecteds:r}),{t:u}=R(),h=A(()=>i.map((o,l)=>_(g({},o),{title:l+1})),[i,f]),x=A(()=>i.reduce((n,e)=>e.answerList.length>n.length?e.answerList:n,[]).map((n,e)=>({id:n.id,title:`${e+1}`}))||[],[i,f]);F(()=>{r&&i.length>0&&y()},[i,f]);const L=o=>(h.filter(n=>n.answerList.some(e=>e.id===o))||[]).map(n=>_(g({},n),{id:n.id,title:n.title})),y=o=>{const l=s,n=o!=null?o:r;x.forEach(e=>{const c=L(e.id),p=n==null?void 0:n[e.id],{waitSorts:v,newSort:O}=P({selectedSort:p,modelList:c});l.waitSorts[e.id]=v,l.selecteds[e.id]=O}),w(l)};M(t,()=>({clearValue:()=>y({})}),[i,f]);const b=(o,l)=>{if(l.some(e=>e.some(c=>c==null?void 0:c.id))){const e=_(g({},s.selecteds),{[o]:l}),c={};Object.keys(e).forEach(p=>{c[p]=e[p].map(v=>v.map(O=>O.id))}),d(c),w(_(g({},s),{selecteds:e}))}},{run:j}=T(b,{wait:0}),I=Object.keys(s.waitSorts).some(o=>x.some(l=>l.id===o)&&z(s.waitSorts[o])&&s.waitSorts[o].length>0);return m.createElement("div",null,m.createElement("div",{style:{fontWeight:500,fontSize:"16px",width:"100%",lineHeight:"46px",padding:"0px 16px"}},m.createElement("span",null,u("RankingQualityOfAnswers")),I&&m.createElement(W,{color:"#FFD9D9",style:{color:"#F26549",marginLeft:8}},u("Unfinished"))),x.map((o,l)=>{var n,e,c,p;return m.createElement("div",{key:l,style:{display:"flex"}},m.createElement("div",{style:{fontSize:"16px",fontWeight:500,width:"80px",lineHeight:"50px",textAlign:"center"}},`${u("Answer")}${l+1}`),m.createElement(H,{waitSortList:(e=(n=s==null?void 0:s.waitSorts)==null?void 0:n[o.id])!=null?e:[],sortList:(p=(c=s==null?void 0:s.selecteds)==null?void 0:c[o.id])!=null?p:[],setSortList:v=>{j(o.id,v)},disabeledAll:S,header:"",prefixId:`modelAnswer${l}`}))}))};var C=V(B);export{C as default,P as getSorts};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{useEffect as
|
|
2
|
-
`);return e.createElement("div",{className:c.outputDisplay},e.createElement("div",{className:c.title},o("OutputDisplay")),e.createElement("div",{className:c.content},n?e.createElement(
|
|
1
|
+
import e,{useEffect as j}from"react";import{Form as m,Popover as C,Input as N,message as S}from"antd";import{useTranslation as A}from"react-i18next";import{InfoCircleOutlined as B}from"@ant-design/icons";import M from"../../../../markdownView/index.js";import O from"../../../../latexEditor/index.js";import c from"./index.module.scss.js";import R from"../../../../longText/index.js";const k=w=>{const{disabeledAll:x,newAnswer:E,textEditObject:b,updateValue:f,answerIndex:g}=w,{max:a,min:u,isLaText:v,tip:h}=b,{TextArea:y}=N,[l]=m.useForm(),{t:o}=A(),T=o("LeastCharacterError",{num:u});j(()=>{l.setFieldsValue({value:E}),x||l.validateFields()},[E]);const V=n=>{var t,d;const I=`inputTextarea_${g}`,r=document.getElementById(I),s=r.value||"",p=(t=r==null?void 0:r.selectionStart)!=null?t:s.length,_=(d=r.selectionEnd)!=null?d:s.length,F=s.substring(0,p),L=s.substring(_,s.length),i=F+n+L;if(a&&(i==null?void 0:i.length)>a){S.error(o("MaximumCharacterError",{num:a}));return}r.value=i,l.setFieldsValue({value:i}),f(i),r.selectionStart=p+n.length,r.selectionEnd=p+n.length,r.focus()};return e.createElement(m,{form:l,onValuesChange:(n,t)=>{const d=t.value;f(d)},className:c.form},e.createElement(m.Item,{name:"title",style:{marginBottom:0},label:e.createElement(e.Fragment,null,o("AnswerTextEdit"),e.createElement(C,{placement:"bottom",content:o("ShowEditingResultDifferencesInTextModeOnly")},e.createElement(B,{style:{margin:"0px 4px",cursor:"pointer"}}))),colon:!1,required:!!u}),e.createElement("div",{className:c.tip},e.createElement(R,{text:h!=null?h:"",overflowMaxLines:3,openByText:!0})),v&&e.createElement(O,{onSelectLatex:V,disabled:x}),e.createElement(m.Item,{name:"value",style:{marginBottom:24},rules:[{validator:(n,t="")=>u&&(t==null?void 0:t.length)<Number(u)?Promise.reject(T):Promise.resolve()}]},e.createElement(y,{maxLength:a,autoSize:{minRows:4,maxRows:10},allowClear:!0,disabled:x,showCount:!!a,style:{width:"100%"},id:`inputTextarea_${g}`})),v&&e.createElement(m.Item,{shouldUpdate:!0,noStyle:!0},()=>{const n=l.getFieldValue("value")||"",t=n.replace(/\n/g,`
|
|
2
|
+
`);return e.createElement("div",{className:c.outputDisplay},e.createElement("div",{className:c.title},o("OutputDisplay")),e.createElement("div",{className:c.content},n?e.createElement(M,{value:t}):""))}))};export{k as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
`);return
|
|
1
|
+
import t,{useEffect as V}from"react";import{Form as g,Input as j,message as F}from"antd";import L from"classnames";import{useTranslation as N}from"react-i18next";import S from"../../../../latexEditor/index.js";import E from"./index.module.scss.js";import C from"../../../../markdownView/index.js";import B from"../../../../longText/index.js";var D=Object.defineProperty,A=Object.defineProperties,R=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable,P=(a,e,r)=>e in a?D(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,$=(a,e)=>{for(var r in e||(e={}))k.call(e,r)&&P(a,r,e[r]);if(b)for(var r of b(e))M.call(e,r)&&P(a,r,e[r]);return a},q=(a,e)=>A(a,R(e));const z=a=>{const{disabeledAll:e,textConfig:r,textAttribute:w,setText:T}=a,{TextArea:I}=j,[v]=g.useForm(),{t:y}=N();V(()=>{const s=r.map((c,n)=>{var d;const m=(w==null?void 0:w.filter(o=>(o==null?void 0:o.textId)===(c==null?void 0:c.textId)))||[];return q($({},c),{value:(d=m[0])==null?void 0:d.value})});v.setFieldsValue({text:s})},[r,w]);const O=({newText:s,fieldName:c,max:n})=>{var d,m;const o=`textInput_${c}`,l=document.getElementById(o),u=l.value||"",f=(d=l==null?void 0:l.selectionStart)!=null?d:u.length,p=(m=l.selectionEnd)!=null?m:u.length,_=u.substring(0,f),x=u.substring(p,u.length),i=_+s+x;if(n&&(i==null?void 0:i.length)>n){F.error(y("MaximumCharacterError",{num:n}));return}l.value=i,v.setFields([{name:["text",c,"value"],value:i,errors:[]}]),h(),l.selectionStart=f+s.length,l.selectionEnd=f+s.length,l.focus()},h=()=>{const s=v.getFieldValue("text");T(s)};return t.createElement(g,{form:v},t.createElement(g.List,{name:"text"},(s,c)=>t.createElement(t.Fragment,null,s.map((n,d)=>{const{max:m,min:o,title:l,tip:u,isLaText:f}=r[n.name]||{},p=l,_=y("LeastCharacterError",{num:o});return t.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"16px"},key:d},p&&t.createElement(g.Item,{name:[n.name,"title"],extra:t.createElement(B,{text:u!=null?u:"",overflowMaxLines:3,openByText:!0}),className:E.textTitle,required:!!o,label:" ",colon:!1},l,p&&t.createElement("span",{className:L({clearText:!0,clearText__disabled:e}),style:{verticalAlign:"initial"},onClick:()=>{e||(v.setFields([{name:["text",n.name,"value"],value:void 0,errors:o?[_]:[]}]),h())}})),f&&p&&t.createElement(S,{onSelectLatex:x=>O({newText:x,fieldName:n.name,max:m}),disabled:e}),p&&t.createElement(g.Item,{name:[n.name,"value"],style:{marginBottom:24},rules:[{validator:(x,i)=>o&&(i==null?void 0:i.length)<Number(o)?Promise.reject(_):Promise.resolve()}],initialValue:void 0},t.createElement(I,{maxLength:m,disabled:e,showCount:!!m,autoSize:{minRows:4,maxRows:10},style:{width:"100%"},id:`textInput_${n.name}`,onChange:()=>h()})),f&&p&&t.createElement(g.Item,{shouldUpdate:!0,noStyle:!0},()=>{const x=v.getFieldValue(["text",n.name,"value"])||"",i=x.replace(/\n/g,`
|
|
2
|
+
`);return t.createElement("div",{className:E.outputDisplay},t.createElement("div",{className:E.title},y("OutputDisplay")),t.createElement("div",{className:E.content},x?t.createElement(C,{value:i}):""))}))}))))};export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i,{useContext as q,useState as R,useEffect as P,useMemo as ct}from"react";import{prefix as dt}from"../../../constant/index.js";import{Button as ut,Empty as mt}from"antd";import pt from"./components/answerSort/index.js";import{connect as ft}from"react-redux";import{isBoolean as gt,isArray as vt,isString as xt,isNumber as Lt,isObject as wt}from"lodash";import St from"./components/answerList/index.js";import{LabelBeeContext as yt,LLMContext as z}from"../../../store/ctx.js";import{jsonParser as F}from"../../../utils/index.js";import{getStepConfig as Et}from"../../../store/annotation/reducer.js";import{useCustomToolInstance as bt}from"../../../hooks/annotation.js";import{PageForward as T}from"../../../store/annotation/actionCreators.js";import{cKeyCode as _t,EToolName as Ct}from"@labelbee/lb-annotation";import{useTranslation as W}from"react-i18next";import{getCurrentResultFromResultList as ht,getRenderDataByResult as jt,formatSort as Pt}from"../utils/data.js";import Tt from"../../../assets/annotation/LLMTool/empty.svg.js";import It from"./components/textInputBox/index.js";import At from"../../tagList/components/overall/index.js";import Ot from"../../../utils/StepUtils.js";var Nt=Object.defineProperty,Rt=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,J=(s,o,l)=>o in s?Nt(s,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[o]=l,d=(s,o)=>{for(var l in o||(o={}))Mt.call(o,l)&&J(s,l,o[l]);if(G)for(var l of G(o))Bt.call(o,l)&&J(s,l,o[l]);return s},p=(s,o)=>Rt(s,Dt(o));const $t=_t.default,I=`${dt}-sidebar`,Q=()=>{const{t:s}=W();return i.createElement("div",{className:`${I}`},i.createElement("div",{className:`${I}__content`,style:{display:"flex",justifyContent:"center",alignItems:"center"}},i.createElement(mt,{description:i.createElement("span",{style:{color:"#ccc"}},s("NoScoringScale")),imageStyle:{width:200,height:200},image:i.createElement("img",{src:Tt})})))},H=s=>{var o,l;const{indicatorScore:_=[],indicatorDetermine:g=[],text:C=[],enableSort:v,isTextEdit:S,tagInputListConfigurable:x,dialogSort:L=!1}=s||{},w=((o=_==null?void 0:_.filter(n=>n.label&&n.value&&n.score))==null?void 0:o.length)>0,h=((l=g==null?void 0:g.filter(n=>n.label&&n.value))==null?void 0:l.length)>0,A=(C==null?void 0:C.length)>0;return!(w||h||A||v||S||x||L)},Vt=s=>{var o,l;const{annotation:_,dispatch:g,checkMode:C}=s,{imgIndex:v,imgList:S,stepList:x,step:L,skipBeforePageTurning:w}=_,{modelAPIResponse:h,setModelAPIResponse:A}=q(z),{t:j}=W(),n=(o=S[v])!=null?o:{},D=F(n==null?void 0:n.result),{toolInstanceRef:f}=bt({basicInfo:D}),[c,X]=R(),[O,Y]=R(!0),{setNewAnswerList:Z}=q(z),[e,y]=R({}),E=!f.current.valid||C;P(()=>{var t;if(x&&L){const r=(t=Et(x,L))==null?void 0:t.config;X(F(r))}},[L,JSON.stringify(x)]),P(()=>{!n||v===-1||(f.current.setValid=M,f.current.clearResult=tt,M(),B())},[v,c,n==null?void 0:n.id]);const tt=()=>{B(n==null?void 0:n.questionList)},M=t=>{var r;const a=t!=null?t:D.valid;gt(a)&&(Y(a),f.current.valid=a,(r=f.current)==null||r.emit("validUpdated"))},B=t=>{const r=Ot.getCurrentStepInfo(L,x),a=ht(n==null?void 0:n.result,r.step);let u=n==null?void 0:n.questionList;(a==null?void 0:a.answerList)&&f.current.valid&&(u=a),t&&(u=t,a.sort=[]);const b=jt(c,u);y(d({},b)),A([])};P(()=>{et(),Z((e==null?void 0:e.answerList)||[])},[e,h,O]),P(()=>(window.addEventListener("keydown",$),()=>{window.removeEventListener("keydown",$)}),[]);const et=()=>{const{newSort:t,answerList:r,textAttribute:a,tagList:u}=e,b=Pt(t||[]),m={answerList:r,sort:b,tagList:u,textAttribute:a,id:n==null?void 0:n.id,modelAPIResponse:h};f.current.exportData=()=>[[m],{valid:O}],f.current.currentPageResult=p(d({},m),{toolName:Ct.LLM,valid:O})},$=t=>{if(t.ctrlKey&&t.keyCode===$t.Enter){if(w){w(()=>g(T()));return}g(T())}},nt=({order:t,value:r,key:a})=>{const{answerList:u}=e,b=u==null?void 0:u.map(m=>{var U;if((m==null?void 0:m.order)===t){if(a==="textEdit"&&xt(r))return p(d({},m),{newAnswer:r});if(Lt(r))return p(d({},m),{score:r});if(wt(r)&&a){const at={[r==null?void 0:r.key]:r.value},lt=(U=m[a])!=null?U:{};return p(d({},m),{[a]:d(d({},lt),at)})}}return m});y(p(d({},e),{answerList:b||[]}))};if(ct(()=>H(c),[c]))return i.createElement(Q,null);const{indicatorScore:V=[],indicatorDetermine:k=[],enableSort:ot,isTextEdit:rt,inputList:N=[],tagInputListConfigurable:K}=c||{},it=K&&((l=N.filter(t=>!t.isOverall))==null?void 0:l.length)>0,st=(k==null?void 0:k.length)>0||(V==null?void 0:V.length)>0||rt||it;return i.createElement("div",{className:`${I}`},i.createElement("div",{className:`${I}__content`},i.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},j("GlobalAnnotation")),ot&&i.createElement(pt,{waitSortList:(e==null?void 0:e.waitSorts)||[],sortList:(e==null?void 0:e.newSort)||[],setSortList:t=>{y(p(d({},e),{newSort:t}))},disabeledAll:E}),K&&N.length&&i.createElement(At,{inputList:N,selectedTags:(e==null?void 0:e.tagList)||{},updateValue:t=>{const{key:r,value:a}=t,u=e==null?void 0:e.tagList;y(p(d({},e),{tagList:p(d({},u),{[r]:a})}))},disabeledAll:E}),(c==null?void 0:c.text)&&i.createElement("div",{style:{padding:"0px 16px",marginTop:"16px"}},i.createElement(It,{textAttribute:(e==null?void 0:e.textAttribute)||[],textConfig:(c==null?void 0:c.text)&&vt(c.text)?c==null?void 0:c.text:[],setText:t=>y(p(d({},e),{textAttribute:t})),disabeledAll:E})),i.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},j("QualifiedAnnotation")),i.createElement("div",null,st&&i.createElement(St,{list:(e==null?void 0:e.answerList)||[],LLMConfig:c,updateValue:nt,disabeledAll:E}))),i.createElement("div",{style:{margin:"24px 16px",display:"flex"}},(S==null?void 0:S.length)-1!==v&&i.createElement(ut,{type:"primary",style:{marginLeft:"auto"},onClick:()=>{if(w){w(()=>g(T()));return}g(T())},disabled:E},j("Save"))))},kt=s=>({annotation:s.annotation});var Kt=ft(kt,null,null,{context:yt})(Vt);export{Q as EmptyConfig,Kt as default,H as getLLMIsNoConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{RightOutlined as
|
|
1
|
+
import{RightOutlined as p}from"@ant-design/icons";import t,{useMemo as b,useContext as x,useState as u,useEffect as A}from"react";import{Input as E}from"antd";import{useSetState as g}from"ahooks";import l from"./index.module.scss.js";var s;(function(o){o.before="\u524D\u6587",o.after="\u540E\u6587"})(s||(s={}));const c=[{label:"\u6587\u672C",key:"text",required:!1,default:"",maxLength:3e3}],v=o=>{const{audioContext:e}=o;if(!e||!e.visible)return null;const{content:i,type:n}=e;return t.createElement(S,{title:s==null?void 0:s[n],content:i})},S=o=>{const[e,i]=u(!0),[n,C]=u(""),{title:f,content:a}=o,r=()=>{i(!e)};return A(()=>{C(a),i(!0)},[a]),t.createElement("div",{className:l.audioContextContainer},t.createElement("div",{className:l.title},t.createElement(p,{style:{marginRight:8},rotate:e?90:0,onClick:r}),t.createElement("span",{onClick:r},f)),e&&t.createElement("div",{className:l.content},t.createElement(E.TextArea,{bordered:!1,value:n,disabled:!0,style:{padding:0},autoSize:!0})))},d={selectedAttribute:"",selectedRegion:{},attributeLockList:[],clipConfigurable:!1,clipAttributeConfigurable:!1,clipAttributeList:[],clipTextConfigurable:!1,combined:!1,segment:!1,clipTextList:c},m=t.createContext({audioClipState:d,setAudioClipState:()=>{}}),L=()=>x(m),T=({children:o})=>{const[e,i]=g(d),n=b(()=>({audioClipState:e,setAudioClipState:i}),[e,i]);return t.createElement(m.Provider,{value:n},o)};export{T as AudioClipProvider,c as DEFAULT_CLIP_TEXT_CONFIG_ITEM,s as EContextType,v as default,L as useAudioClipStore};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i,{useMemo as B}from"react";import V from"../../../attributeList/index.js";import{EventBus as C,TagUtils as M}from"@labelbee/lb-annotation";import U from"../../../../assets/annotation/audio/clipSmall.svg.js";import W from"../../../../assets/annotation/audio/clipASmall.svg.js";import q from"../../../../assets/annotation/audio/delete.svg.js";import z from"../../../../assets/annotation/audio/loopA.svg.js";import{timeFormat as h,getAttributeShowText as G}from"../../../../utils/audio.js";import H from"../../../longText/index.js";import{classnames as J}from"../../../../utils/index.js";import a from"./index.module.scss.js";import{useTranslation as K}from"react-i18next";import Q from"../../../subAttributeList/index.js";var X=Object.defineProperty,Y=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,j=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,N=(o,e,s)=>e in o?X(o,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[e]=s,b=(o,e)=>{for(var s in e||(e={}))ee.call(e,s)&&N(o,s,e[s]);if(j)for(var s of j(e))te.call(e,s)&&N(o,s,e[s]);return o},g=(o,e)=>Y(o,Z(e));const re=o=>{const{regions:e=[],updateRegion:s,useAudioClipStore:L}=o,{audioClipState:$,setAudioClipState:A}=L(),{t:S}=K(),{selectedAttribute:T,selectedRegion:_,clipTextConfigurable:w,clipAttributeList:v,clipAttributeConfigurable:f,secondaryAttributeConfigurable:O,subAttributeList:x,clipTextList:E}=$,{id:n}=_,u=B(()=>e.find(t=>t.id===n),[e,n]),P=t=>{e.length&&n&&s(g(b({},u),{attribute:t})),A({selectedAttribute:t})},F=(t,r)=>{var l;if(e.length&&n){const c=(l=u==null?void 0:u.subAttribute)!=null?l:{};s(g(b({},u),{subAttribute:g(b({},c),{[t]:r})}))}},y=[{label:"\u65E0\u5C5E\u6027",value:"",key:"\u65E0\u5C5E\u6027"},...v.map(t=>g(b({},t),{label:t.key}))],k=(t,r)=>{const l=G(t,y),c=r?M.getTagNameList(r,x):[];let m="";const d=`\uFF0C
|
|
2
|
+
`;return c.forEach(p=>{m+=`${p.keyName}\uFF1A${p.value.join("\u3001")}${d}`}),`${l}${d}${m}`},R=t=>{let r="";return w&&(E==null?void 0:E.length)>0&&E.forEach((l,c)=>{const m=!f&&c===0?"":"\uFF0C";r=r+`${l.label}\uFF1A${t[l.key]}${m}`}),r};return i.createElement("div",{className:a.clipSidebar},i.createElement("div",{className:a.clipResults},i.createElement("div",{className:a.title},S("ClippedAudio")),e.length>0?i.createElement("div",{className:a.regions},e.map(t=>{const{id:r,attribute:l,text:c,start:m,end:d,subAttribute:p}=t,I=r===n&&_.loop,D=`${f?k(l,p):""}${R(t)}`;return i.createElement("div",{className:J({[a.region]:!0,[a.selected]:r===n}),key:r,onClick:()=>{C.emit("setSelectedRegion",{id:r,playImmediately:!0})}},i.createElement("div",{className:a.label},I&&i.createElement("img",{src:z}),i.createElement("div",{className:a.text},i.createElement(H,{text:D}))),i.createElement("div",{className:a.time},i.createElement("img",{src:n===r?W:U}),h(m,"ss.SSS")," -",h(d,"ss.SSS")),i.createElement("div",{className:a.delete,onClick:()=>{C.emit("removeRegionById",r)}},i.createElement("img",{src:q})))})):i.createElement("div",{className:a.empty},S("NoClippedData"))),f&&(v==null?void 0:v.length)>0&&i.createElement("div",{className:a.attributeList},i.createElement(V,{list:y,attributeChanged:P,selectedAttribute:T,attributeLockChange:t=>{A({attributeLockList:t})}}),n&&O&&i.createElement(Q,{subAttributeList:x,setSubAttribute:F,getValue:t=>{var r;return(r=u==null?void 0:u.subAttribute)==null?void 0:r[t.value]}})))};export{re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l,{useState as M,useEffect as B,useMemo as re}from"react";import{AudioPlayer as we}from"../audioPlayer/index.js";import{getClassName as Ie}from"../../utils/dom.js";import Ae from"../predictTracking/previewResult/index.js";import{Layout as se}from"antd/es";import{Spin as Oe}from"antd";import{prefix as Ne}from"../../constant/index.js";import{cKeyCode as ke,CommonToolUtils as K,EventBus as ae,uuid as De,TagUtils as $e,cTool as Ve}from"@labelbee/lb-annotation";import O from"./index.module.scss.js";import Me from"./tagResultShow/index.js";import{AudioClipProvider as Be,DEFAULT_CLIP_TEXT_CONFIG_ITEM as Ke,useAudioClipStore as We}from"./audioContext/index.js";import Fe from"./textInput/index.js";import{connect as Ue}from"react-redux";import{a2MapStateToProps as Xe}from"../../store/annotation/map.js";import{LabelBeeContext as Ge}from"../../store/ctx.js";import{jsonParser as qe}from"../../utils/index.js";import{useCustomToolInstance as ze}from"../../hooks/annotation.js";import{sidebarCls as Y}from"../../views/MainView/sidebar/index.js";import He from"./audioSide/labelSidebar/index.js";import Je from"./audioSide/clipSidebar/index.js";import Qe from"../../assets/annotation/audio/tag.svg.js";import Ye from"../../assets/annotation/audio/tagA.svg.js";import Ze from"../../assets/annotation/audio/clip.svg.js";import et from"../../assets/annotation/audio/clipA.svg.js";import{isImageValue as tt}from"../../utils/audio.js";var nt=Object.defineProperty,ot=Object.defineProperties,it=Object.getOwnPropertyDescriptors,ue=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,ce=(n,o,s)=>o in n?nt(n,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[o]=s,E=(n,o)=>{for(var s in o||(o={}))lt.call(o,s)&&ce(n,s,o[s]);if(ue)for(var s of ue(o))rt.call(o,s)&&ce(n,s,o[s]);return n},N=(n,o)=>ot(n,it(o));const{EAudioToolName:st}=Ve,de=ke.default,{Sider:at,Content:ut}=se,fe=`${Ne}-layout`,ct=({setSideTab:n,sideTab:o})=>{const s=[{tab:"tag",commonSvg:Qe,selectedSvg:Ye},{tab:"clip",commonSvg:Ze,selectedSvg:et}];return l.createElement("div",{className:O.toggleAudioOption},s.map((p,_)=>{const{tab:d,selectedSvg:x,commonSvg:L}=p;return l.createElement("div",{key:_,className:O.option},l.createElement("img",{className:O.icon,src:o===d?x:L,onClick:()=>{o!==d&&n(d)}}))}))},dt=({result:n,inputDisabled:o,updateText:s,configList:p,autofocus:_,preContext:d,isCheck:x,clipAttributeConfigurable:L,clipTextConfigurable:k,textConfigurable:b,updateRegion:C,clipAttributeList:f,clipTextList:g})=>l.createElement("div",{className:O.textareaContainer},l.createElement("div",{className:O.textareaContent},l.createElement(Fe,{isCheck:x,result:n==null?void 0:n.value,textInputDisabled:o,textID:(n==null?void 0:n.id)||0,updateText:s,configList:p,autofocus:!o&&_,preContext:d,regions:n==null?void 0:n.regions,clipAttributeConfigurable:L,clipTextConfigurable:k,textConfigurable:b,updateRegion:C,clipAttributeList:f,clipTextList:g}))),ft=n=>{var o,s;const{sider:p,config:_,result:d,updateTagResult:x,updateRegion:L,isEdit:k,tagConfigurable:b,clipConfigurable:C}=n;let f=(_==null?void 0:_.inputList)||[],g=(o=d==null?void 0:d.tag)!=null?o:{},a=(s=d==null?void 0:d.regions)!=null?s:[];const[U,P]=M([]),[T,v]=M("tag");B(()=>{if(!b&&C){v("clip");return}v("tag")},[b,C]),B(()=>(window.addEventListener("keydown",D),()=>{window.removeEventListener("keydown",D)}));const D=t=>{if(b&&C)switch(t.keyCode){case de.L:v("tag");break;case de.X:v("clip");break}if(T==="tag"){if(!K.hotkeyFilter(t))return;K.isMoveKey(t==null?void 0:t.keyCode)&&t.preventDefault();let r=t.keyCode;if(r&&(r<=57&&r>=49||r<=105&&r>=97)){r>57?r=r-97:r=r-49;const h=U.slice();f.length===1?(R(0,r),P([0,r]),setTimeout(()=>{P([])},500)):h.length===1?(R(h[0],r),P([h[0],r]),setTimeout(()=>{P([])},500)):P([r])}}},R=(t,r)=>{if(t<f.length&&f[t].subSelected&&r<f[t].subSelected.length){const h=f[t].value,m=f[t].isMulti;let c=f[t].subSelected[r].value,X=0;const W=g;for(const S in g)if(S===f[t].value){if(X++,m===!0){const A=W[S].split(";").filter(z=>z!==""),G=A.indexOf(c);G===-1?A.push(c):A.splice(G,1),c=A.join(";")}c===""?delete W[S]:W[S]=c}X===0&&Object.assign(g,{[h]:c}),x(g)}},w=t=>{delete g[t],x(g)},$=b&&C&&l.createElement(ct,{setSideTab:v,sideTab:T}),I=T==="tag"&&l.createElement(He,{labelInfoSet:b?f:[],labelSelectedList:U,setLabel:R,tagResult:g,clearResult:w,isEdit:k,withPanelTab:!1}),V=T==="clip"&&l.createElement(Je,{regions:a,updateRegion:L,useAudioClipStore:We});return p?typeof p=="function"?l.createElement("div",{className:`${Y}`},p({toggleAudioOption:$,labelSidebar:I,clipSidebar:V})):p:l.createElement("div",{className:`${Y}`},l.createElement("div",{className:`${Y}__content`},$,I,V))},mt=n=>{var o,s,p,_,d,x,L,k,b;const C=(s=(o=n.style)==null?void 0:o.sider)==null?void 0:s.width,{step:f,stepList:g,audioContext:a,sider:U,drawLayerSlot:P,imgList:T,imgIndex:v,currentData:D,config:R,stepInfo:w,checkMode:$}=n,I=K.getCurrentStepToolAndConfig(f,g),V=qe(D.result),{toolInstanceRef:t}=ze({basicInfo:V}),[r,h]=M(!0),[m,c]=M(null),[X,W]=M(0),[S,A]=M(!0);B(()=>{h(!0)},[v]),B(()=>{r===!1&&_e()},[r]),B(()=>{z()},[]),B(()=>{t.current.exportData=()=>[[m],{duration:X,valid:S}],t.current.setResult=he,t.current.clearResult=je,t.current.currentPageResult=m==null?void 0:m.regions,t.current.emit("updatePageNumber"),t.current.setSelectedRegion=G,t.current.setValid=Pe},[m,S]);const G=e=>{ae.emit("setSelectedRegion",{id:e,isLoopStatus:!0,playImmediately:!0})},z=()=>{t.current.emit=e=>{const i=t.current.fns.get(e);i&&i.forEach(u=>{u&&(u==null||u())})},t.current.fns=new Map,t.current.singleOn=(e,i)=>{t.current.fns.set(e,[i])},t.current.on=(e,i)=>{t.current.singleOn(e,i)},t.current.unbindAll=e=>{t.current.fns.delete(e)}},H=re(()=>{const e=V[`step_${w==null?void 0:w.step}`];return(e==null?void 0:e.result)||[]},[R,V,w]),{tagConfigurable:Z,textConfigurable:J=!0,clipConfigurable:ee=!1,clipAttributeConfigurable:te=!1,clipAttributeList:ne=[],clipTextConfigurable:q=!1,subAttributeList:me=[],secondaryAttributeConfigurable:pe=!1,inputList:ge=[],configList:ve=[],clipTextList:oe=Ke}=re(()=>{if(I)return K.jsonParser(I==null?void 0:I.config)},[I]),be={clipConfigurable:ee,clipAttributeConfigurable:te,clipAttributeList:ne,clipTextConfigurable:q,subAttributeList:me,secondaryAttributeConfigurable:pe,clipTextList:oe},Se=(_=(p=K.jsonParser(D.result))==null?void 0:p.duration)!=null?_:0,ye=S?Se:0,Ee=!S||r||![J,q].includes(!0)||$;let ie={};if(v!==-1&&(T==null?void 0:T.length)){const e=(d=T[v])==null?void 0:d.preResult,i=(a==null?void 0:a.isEdit)?(x=a==null?void 0:a.stepConfig)==null?void 0:x.loadPreStep:w==null?void 0:w.loadPreStep;if(e&&i){const u=K.jsonParser(e),y=(k=(L=u==null?void 0:u.config)==null?void 0:L.context)!=null?k:{};Object.keys(y).forEach(j=>{j&&y[j]&&(ie[j]={visible:!0,content:y[j],type:j})})}}const _e=()=>{(H==null?void 0:H.length)>0?c(H[0]):c({id:De(),sourceID:"",value:le(),tag:xe(),regions:[]});const e=tt(T[v].result||"[]");A(e)},le=(e=!0)=>{const i={};let u=R.configList||[];return u.length>0&&u.forEach(y=>{i[y.key]=e&&y.default||""}),i},xe=()=>$e.getDefaultResultByConfig(R.inputList||[]),Ce=({duration:e,hasError:i})=>{(a==null?void 0:a.onLoaded)&&(a==null||a.onLoaded()),h(!1),W(e)},Te=e=>{c(i=>N(E({},i),{regions:((i==null?void 0:i.regions)||[]).filter(u=>u.id!==e)}))},Q=e=>{c(i=>{var u;const y=(u=i==null?void 0:i.regions)!=null?u:[],{id:j}=e;return y.find(F=>F.id===j)?N(E({},i),{regions:y.map(F=>j===F.id?E(E({},F),e):F)}):N(E({},i),{regions:[...y,e]})})},Le=(e,i)=>{c(u=>N(E({},u),{value:N(E({},u.value),{[i]:e})}))},Re=e=>{c(i=>N(E({},i),{tag:e}))},he=e=>{c(e)},je=()=>{c(e=>N(E({},e),{value:le(),tag:{},regions:[]})),ae.emit("clearRegions")},Pe=e=>{A(e)};return l.createElement(Be,null,l.createElement(Oe,{spinning:r,wrapperClassName:"audio-tool-spinner"},l.createElement(se,{className:Ie("layout","container"),style:{height:"100%",userSelect:"none"}},n==null?void 0:n.leftSider,l.createElement(ut,{className:`${fe}__content`},l.createElement("div",{className:O.containerWrapper},l.createElement("div",{className:O.audioWrapper},Z&&l.createElement(Me,{result:m==null?void 0:m.tag,labelInfoSet:ge,hasPromptLayer:!!(a==null?void 0:a.promptLayer)}),a==null?void 0:a.promptLayer,l.createElement(we,E({context:{isEdit:a==null?void 0:a.isEdit,count:ye,toolName:st.AudioTextTool,imgIndex:v},drawLayerSlot:P,fileData:D,onLoaded:Ce,invalid:!S,updateRegion:Q,removeRegion:Te,regions:m==null?void 0:m.regions,activeToolPanel:a==null?void 0:a.activeToolPanel,footer:n.footer,isCheck:$},be))),(J||q)&&l.createElement(dt,{preContext:ie,result:m,inputDisabled:Ee,updateText:Le,updateRegion:Q,configList:ve,autofocus:!1,textConfigurable:J,clipTextConfigurable:q,clipAttributeList:ne,clipAttributeConfigurable:te,clipTextList:oe,isCheck:$}))),l.createElement(at,{className:`${fe}__side`,width:C!=null?C:240,style:(b=n.style)==null?void 0:b.sider},l.createElement(ft,{sider:U,config:R,result:m,updateTagResult:Re,updateRegion:Q,isEdit:a==null?void 0:a.isEdit,tagConfigurable:Z,clipConfigurable:ee})),l.createElement(Ae,null))))};var pt=Ue(Xe,null,null,{context:Ge})(mt);export{pt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useState as
|
|
1
|
+
import e,{useState as O,useRef as te,useEffect as q,useMemo as Ce}from"react";import{Tooltip as ae,Radio as H,Switch as be}from"antd";import{QuestionCircleOutlined as ye}from"@ant-design/icons";import{TextareaWithFooter as Ne}from"../../../views/MainView/sidebar/TextToolSidebar/index.js";import{timeFormat as ne,getAttributeColor as we,getAttributeFontColor as Be,getAttributeShowText as _e,updateColorOpacity as ke,DEFAULT_TEXT_CONFIG_ITEM as Ie}from"../../../utils/audio.js";import{cKeyCode as Se}from"@labelbee/lb-annotation";import U from"classnames";import oe,{useAudioClipStore as De,DEFAULT_CLIP_TEXT_CONFIG_ITEM as Ae}from"../audioContext/index.js";import l from"./index.module.scss.js";import{useTranslation as le}from"react-i18next";import re from"../../longText/index.js";import Le from"../../../assets/annotation/common/icon_clearSmall_a.svg.js";import Pe from"../../../assets/annotation/common/icon_clearSmall.svg.js";var Oe=Object.defineProperty,$e=Object.defineProperties,je=Object.getOwnPropertyDescriptors,ue=Object.getOwnPropertySymbols,Me=Object.prototype.hasOwnProperty,Re=Object.prototype.propertyIsEnumerable,se=(u,o,r)=>o in u?Oe(u,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[o]=r,X=(u,o)=>{for(var r in o||(o={}))Me.call(o,r)&&se(u,r,o[r]);if(ue)for(var r of ue(o))Re.call(o,r)&&se(u,r,o[r]);return u},ie=(u,o)=>$e(u,je(o));const p=Se.default,ce=({onClick:u,title:o,disabled:r})=>{const[C,i]=O(!1);return e.createElement(ae,{placement:"bottom",title:o},e.createElement("img",{onMouseEnter:()=>{r||i(!0)},onMouseLeave:()=>i(!1),className:U({[l.clearIcon]:!0,[l.disabled]:r}),src:C?Le:Pe,onClick:u}))},Q=u=>{var o;const{t:r}=le(),C=te(null),[i,B]=O(!1),[_,x]=O(!1),{disabled:c,config:m,result:$,updateText:g,index:T,switchToNextTextarea:j,hasMultiple:k,textID:b,addPlaceholder:F,onFocus:I,onBlur:y,onFocusStyle:N={},extra:w,errorText:S}=u,{maxLength:h}=m,D=$?$[m.key]:"",A=(o=D==null?void 0:D.length)!=null?o:0,L=n=>{g&&(g(n,m.key),m.required&&x(!n))},M=k&&j,f={id:`textInput-${T}`,ref:C,disabled:c,value:D,maxLength:h,autoSize:{minRows:2,maxRows:6},onChange:n=>{const E=n.target.value;L(E)},onFocus:n=>{B(!0),I==null||I(n),n.target.value&&x(!1)},onBlur:n=>{B(!1),y==null||y(n),m.required&&x(!n.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:n=>{const{keyCode:E}=n;if(n.ctrlKey){if(E===p.Enter&&n.preventDefault(),F&&[p.One,p.Two,p.Three].includes(E))switch(n.preventDefault(),E){case p.One:F("\u4986");break;case p.Two:F("\u652B");break;case p.Three:F("\u7383");break}}else E===p.Tab&&M?(n.preventDefault(),n.nativeEvent.stopImmediatePropagation(),j(T)):n.nativeEvent.stopPropagation()}},v=e.createElement("div",{className:l.textAreaFooter},e.createElement("div",{className:l.hotkeyTip},M&&e.createElement("span",null,"[",r("Switch"),"]Tab"),e.createElement("span",null,"[",r("TurnPage"),"]Ctrl+Enter")),e.createElement("div",{className:l.wordCount},e.createElement("span",{className:A>=h?l.warning:""},A),"/",e.createElement("span",null,h)));return q(()=>{c&&B(!1)},[c]),q(()=>{x(!1)},[b]),e.createElement("div",{className:l.textField},e.createElement("div",{className:l.label},e.createElement("div",{className:l.labelText},e.createElement("span",{className:U({[l.titleText]:!0,[l.required]:m.required})},e.createElement(re,{text:m.label,openByText:!0,isToolTips:!0})),e.createElement(ce,{onClick:()=>{c||L("")},title:"",disabled:c})),e.createElement("div",{className:l.extra},w)),e.createElement("div",{className:U({disabled:c,"textarea-outline":!0,"ant-input-focused":i,[l.textareaContainer]:!0,[l.focus]:i,[l.invalid]:_}),style:i?N:{}},e.createElement(Ne,{footer:v,textareaProps:f})),S&&e.createElement("span",{style:{color:"#ff4d4f",lineHeight:"22px"}},S))},qe=u=>{const{configList:o,autofocus:r,textID:C,result:i,showText:B,updateText:_,toggleShowText:x,textInputDisabled:c,isCheck:m,isEdit:$,config:g,preContext:T,regions:j=[],textConfigurable:k=!0,clipTextConfigurable:b,clipAttributeConfigurable:F,updateRegion:I,clipAttributeList:y=[],clipTextList:N=Ae}=u,{t:w}=le(),[S,h]=O(0),[D,A]=O(""),L=te(null),{audioClipState:M}=De(),f=o||[X({},Ie)];let v=j;if(b&&!m){const t=M.selectedRegion.id;v=v.filter(a=>a.id===t)}const n=t=>{setTimeout(()=>{const a=document.getElementById(`textInput-${t}`);a&&(h(t),a.focus(),a.select(),a.scrollIntoView({behavior:"smooth",block:"center"}))})},E=t=>{const a=k?f.length:0,d=b?v.length*N.length:0,s=a+d,P=(t+1)%s;n(P)},J=t=>{t.keyCode===p.Tab&&(t.preventDefault(),(f.length>0||b&&N.length>0)&&n(0))},R=t=>{const a=document.getElementById(`textInput-${S}`);if(!(g==null?void 0:g.enablePlaceholderHotkey)||!a||!_)return;const{value:d,selectionStart:s,selectionEnd:P}=a,G=`${d.slice(0,s)}${t}${d.slice(P)}`;_(G,f[S].key),A(t),setTimeout(()=>{a.setSelectionRange(s+1,s+1),a.focus()},0),clearTimeout(L.current),L.current=setTimeout(()=>{A("")},400)};q(()=>($||document.addEventListener("keydown",J),()=>{document.removeEventListener("keydown",J)}),[o]),q(()=>{r&&!c&&n(0)},[C]);let K=f;m&&(K=f.filter(t=>(i==null?void 0:i[t.key])!==void 0));const me=Ce(()=>N.reduce((t,a)=>(v.forEach(d=>{d&&t.push(ie(X({},a),{clipTextResult:d}))}),t),[]),[N,v]);return e.createElement(e.Fragment,null,(g==null?void 0:g.enablePlaceholderHotkey)&&e.createElement("div",{className:l.placeholderHotkey},e.createElement("div",{className:l.title},"\u5360\u4F4D\u7B26\u5FEB\u6377\u8F93\u5165",e.createElement(ae,{overlayStyle:{maxWidth:240},title:e.createElement("div",null,e.createElement("div",null,"\u4986\uFF08Ctrl+1\uFF09\uFF1A"),e.createElement("div",{style:{marginBottom:12}},"\u6587\u5B57\u5F02\u5E38\uFF0C\u4F46\u53EA\u6839\u636E\u8FD9\u4E2A\u5B57\u7684\u5F62\u72B6\u5C31\u53EF\u4EE5\u731C\u51FA\u662F\u4EC0\u4E48\u5B57"),e.createElement("div",null,"\u652B\uFF08Ctrl+2\uFF09\uFF1A"),e.createElement("div",{style:{marginBottom:12}},"\u6587\u5B57\u5F02\u5E38\uFF0C\u4E14\u65E0\u6CD5\u6839\u636E\u5F62\u72B6\u731C\u5B57\uFF0C\u4F46\u80FD\u7ED3\u5408\u4E0A\u4E0B\u6587\u8BED\u4E49\u5224\u65AD\u51FA\u662F\u4EC0\u4E48\u5B57"),e.createElement("div",null,"\u7383\uFF08Ctrl+3\uFF09\uFF1A"),e.createElement("div",null,"\u5B8C\u5168\u65E0\u6CD5\u5224\u65AD\u662F\u4EC0\u4E48\u5B57")),placement:"bottom"},e.createElement(ye,{className:l.questionIcon}))),e.createElement(H.Group,{value:D},e.createElement(H.Button,{value:"\u4986",onClick:t=>R(t.target.value)},e.createElement("div",{className:"label"},e.createElement("div",{className:"text"},"\u4986 (\u89C6\u89C9)"),e.createElement("div",{className:"hotkey"},"Ctrl+1"))),e.createElement(H.Button,{value:"\u652B",onClick:t=>R(t.target.value)},e.createElement("div",{className:"label"},e.createElement("div",{className:"text"},"\u652B (\u8BED\u4E49)"),e.createElement("div",{className:"hotkey"},"Ctrl+2"))),e.createElement(H.Button,{value:"\u7383",onClick:t=>R(t.target.value)},e.createElement("div",{className:"label"},e.createElement("div",{className:"text"},"\u7383 (\u65E0\u6548)"),e.createElement("div",{className:"hotkey"},"Ctrl+3"))))),e.createElement("div",{className:l.textInputContainer},e.createElement(oe,{audioContext:T==null?void 0:T.before}),k&&K.map((t,a)=>e.createElement(Q,{config:t,key:a,index:a,result:i,updateText:_,switchToNextTextarea:E,hasMultiple:f.length>1,disabled:c,textID:C,addPlaceholder:R,onFocus:()=>h(a)})),b&&v.length>0&&me.map((t,a)=>{var d;const{clipTextResult:s}=t,{id:P,start:G,end:de,attribute:V}=s,{maxLength:Ee=3e3,label:Y,key:Z,required:pe}=t,ee=s==null?void 0:s[Z],fe={[s.id]:ee},ve={label:`${Y!=null?Y:w("textTool")}\uFF08${ne(G,"ss.SSS")} - ${ne(de,"ss.SSS")}\uFF09`,key:P,maxLength:Ee},W=(k?K.length:0)+a,z=we(V,y),xe={color:Be(V,y),backgroundColor:z},ge=w("LeastCharacterError",{num:1}),Te=pe&&ee.length<1?ge:void 0,Fe=(d=_e(V,[{value:"",key:w("NoAttribute")},...y]))!=null?d:"";return e.createElement(Q,{config:ve,key:a,index:W,disabled:c,result:fe,updateText:he=>{I==null||I(ie(X({},s),{[Z]:he}))},switchToNextTextarea:()=>{E(W)},hasMultiple:!0,onFocus:()=>h(W),onFocusStyle:F?{borderColor:z,boxShadow:`0 0 0 2px ${ke(z,.4)}`}:{},extra:F?e.createElement("div",{style:xe,className:l.attribute},e.createElement(re,{text:Fe,openByText:!0,isToolTips:!0})):null,errorText:Te})}),e.createElement(oe,{audioContext:T==null?void 0:T.after}),x&&e.createElement("div",{className:l.switchItem},w("toggleShowText"),e.createElement(be,{style:{alignSelf:"center"},checked:B,onChange:t=>{x(t)}}))))};export{ce as ClearIcon,Q as SingleTextInput,qe as default};
|