@labelbee/lb-components 1.23.0-alpha.9 → 1.23.0-alpha.91
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/LLMToolView/index.js +1 -1
- package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/index.js +1 -1
- package/dist/components/LLMToolView/utils/data.js +1 -1
- package/dist/components/NLPToolView/index.js +1 -1
- package/dist/components/audioAnnotate/audioContext/index.js +1 -1
- package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +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/useAudioSegment/index.js +1 -1
- package/dist/components/longText/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
- package/dist/components/pointCloud2DRectOperationView/util.js +1 -0
- package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
- package/dist/components/pointCloudView/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/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/useWindowKeydownListener.js +1 -0
- package/dist/components/pointCloudView/index.js +1 -1
- package/dist/components/pointCloudView/utils/event-polyfill.js +1 -0
- package/dist/components/pointCloudView/utils/map.js +1 -0
- package/dist/components/subAttributeList/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/index.js +1 -1
- package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
- package/dist/hooks/useToolStyle.js +1 -0
- package/dist/index.css +140 -17
- package/dist/index.js +1 -1
- package/dist/store/Actions.js +1 -1
- package/dist/store/annotatedBox/index.js +1 -1
- package/dist/store/annotation/actionCreators.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/types/App.d.ts +5 -1
- package/dist/types/components/AnnotationView/index.d.ts +1 -0
- package/dist/types/components/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/LLMToolView/utils/data.d.ts +1 -1
- package/dist/types/components/audioAnnotate/audioContext/index.d.ts +10 -2
- package/dist/types/components/audioAnnotate/textInput/index.d.ts +1 -0
- package/dist/types/components/audioAnnotate/utils/dataTransform.d.ts +9 -0
- package/dist/types/components/audioPlayer/clipRegion/index.d.ts +1 -0
- package/dist/types/components/audioPlayer/index.d.ts +28 -21
- package/dist/types/components/longText/index.d.ts +1 -0
- package/dist/types/components/pointCloud2DRectOperationView/index.d.ts +1 -0
- package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +2 -0
- package/dist/types/components/pointCloud2DRectOperationView/util.d.ts +8 -0
- package/dist/types/components/pointCloudView/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/components/HighlightVisible/index.d.ts +2 -1
- package/dist/types/components/pointCloudView/hooks/useDataLinkSwitch.d.ts +19 -0
- package/dist/types/components/pointCloudView/hooks/useHighlight.d.ts +1 -1
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +8 -0
- package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +9 -0
- package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +3 -2
- package/dist/types/components/pointCloudView/hooks/useTimeoutFunc.d.ts +6 -0
- package/dist/types/components/pointCloudView/hooks/useWindowKeydownListener.d.ts +16 -0
- package/dist/types/components/pointCloudView/utils/event-polyfill.d.ts +8 -0
- package/dist/types/components/pointCloudView/utils/map.d.ts +11 -0
- package/dist/types/components/subAttributeList/index.d.ts +10 -0
- package/dist/types/components/videoAnnotate/index.d.ts +2 -1
- package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +2 -1
- package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
- package/dist/types/hooks/useToolStyle.d.ts +30 -0
- package/dist/types/index.d.ts +7 -2
- package/dist/types/store/Actions.d.ts +1 -0
- package/dist/types/store/annotatedBox/index.d.ts +2 -0
- package/dist/types/store/annotation/actionCreators.d.ts +3 -2
- package/dist/types/store/annotation/reducer.d.ts +1 -0
- package/dist/types/store/annotation/types.d.ts +9 -2
- package/dist/types/utils/AnnotationDataUtils.d.ts +58 -1
- package/dist/types/utils/ToolPointCloudBoxRenderHelper.d.ts +23 -0
- package/dist/types/utils/index.d.ts +31 -1
- package/dist/types/views/MainView/sidebar/GeneralOperation/ActionsConfirm.d.ts +1 -0
- package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +1 -1
- package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.d.ts +9 -0
- package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.d.ts +3 -0
- package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/index.d.ts +1 -0
- package/dist/types/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.d.ts +10 -2
- package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
- package/dist/types/views/MainView/toolHeader/StepSwitch/index.d.ts +1 -1
- package/dist/types/views/MainView/toolHeader/index.d.ts +1 -1
- package/dist/utils/AnnotationDataUtils.js +1 -1
- package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -0
- package/dist/utils/index.js +1 -1
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/dist/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
- package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/dist/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
- package/dist/views/MainView/toolFooter/index.js +1 -1
- package/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/LLMToolView/index.js +1 -1
- package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/es/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
- package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/es/components/LLMToolView/sidebar/index.js +1 -1
- package/es/components/LLMToolView/utils/data.js +1 -1
- package/es/components/NLPToolView/index.js +1 -1
- package/es/components/audioAnnotate/audioContext/index.js +1 -1
- package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +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/useAudioSegment/index.js +1 -1
- package/es/components/longText/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
- package/es/components/pointCloud2DRectOperationView/util.js +1 -0
- package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/es/components/pointCloudView/PointCloud2DView.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js +1 -1
- package/es/components/pointCloudView/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/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/useWindowKeydownListener.js +1 -0
- package/es/components/pointCloudView/index.js +1 -1
- package/es/components/pointCloudView/utils/event-polyfill.js +1 -0
- package/es/components/pointCloudView/utils/map.js +1 -0
- package/es/components/subAttributeList/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/index.js +1 -1
- package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
- package/es/hooks/useToolStyle.js +1 -0
- package/es/index.css +140 -17
- package/es/index.js +1 -1
- package/es/store/Actions.js +1 -1
- package/es/store/annotatedBox/index.js +1 -1
- package/es/store/annotation/actionCreators.js +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/utils/AnnotationDataUtils.js +1 -1
- package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -0
- package/es/utils/index.js +1 -1
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/es/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
- package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
- package/es/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
- package/es/views/MainView/toolHeader/index.js +1 -1
- package/package.json +5 -3
- package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
- package/dist/assets/icons/9d70807.svg +0 -5
- package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
|
@@ -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 T,useRef as b,useImperativeHandle as $,useEffect as v,useCallback as k}from"react";import{ViewOperation as q,ImgUtils as B}from"@labelbee/lb-annotation";import{Spin as G}from"antd/es";import J from"../../hooks/useRefCache.js";import K from"../measureCanvas/index.js";var Q=Object.defineProperty,V=Object.getOwnPropertySymbols,W=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,j=(t,n,o)=>n in t?Q(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,S=(t,n)=>{for(var o in n||(n={}))W.call(n,o)&&j(t,o,n[o]);if(V)for(var o of V(n))X.call(n,o)&&j(t,o,n[o]);return t},D=(t,n,o)=>new Promise((g,d)=>{var c=l=>{try{f(o.next(l))}catch(m){d(m)}},s=l=>{try{f(o.throw(l))}catch(m){d(m)}},f=l=>l.done?g(l.value):Promise.resolve(l.value).then(c,s);f((o=o.apply(t,n)).next())});const C={width:455,height:100},Y=t=>{if(!t)return C;if(t.width&&t.height)return t;const n=S({},t);return n.width||(n.width=C.width),n.height||(n.height=C.height),n},ee=(t,n)=>{var o,g;const{src:d,fallbackSrc:c,annotations:s=[],style:f={stroke:"blue",thickness:3},zoomChange:l,backgroundStyle:m={},onChange:I,showLoading:N=!1,globalStyle:M,afterImgOnLoad:U,measureVisible:z}=t,_=Y(t.size),[Z,E]=T(!1),O=b(null),r=b(),R=J(U),h=b([]),p=b(!0);$(n,()=>{const e=r.current;return e?{zoomIn:()=>e.zoomChanged(!0),zoomOut:()=>e.zoomChanged(!1),initImgPos:()=>e.initImgPos(),toolInstance:e}:{}},[r.current]),v(()=>(O.current&&(r.current=new q({container:O.current,size:_,style:f,annotations:s,config:"{}",zoomInfo:t.zoomInfo,staticMode:t.staticMode}),r.current.init()),()=>{var e;(e=r.current)==null||e.destroy()}),[z]);const P=k(e=>D(void 0,null,function*(){var u,a;try{const i=yield B.load(e);return(u=r.current)==null||u.setImgNode(i),(a=R.current)==null||a.call(R,i),null}catch(i){return console.error("Error loading image:",i),i}}),[]),A=k(e=>D(void 0,null,function*(){var u,a;if(E(!0),(u=r.current)==null||u.setLoading(!0),(yield P(e))&&c){const y=yield P(c);y&&console.error("Error loading fallback image:",y)}(a=r.current)==null||a.setLoading(!1),E(!1)}),[P,c]);v(()=>{r.current&&A(d)},[d,z,c,A]),v(()=>{if(p.current===!1){h.current.push(s);return}const e=()=>{p.current=!0,h.current=[]},u=()=>{var a;const i=h.current.length;if(i>0){const y=h.current[i-1];h.current=[],(a=r.current)==null||a.updateData(y).then(u).catch(e)}else p.current=!0};r.current&&(p.current=!1,r.current.updateData(s).then(u).catch(e))},[s]),v(()=>{const e=r.current;(e==null?void 0:e.setSize)&&(e.setSize(_),e.initPosition())},[(o=t.size)==null?void 0:o.width,(g=t.size)==null?void 0:g.height]),v(()=>{var e,u;return r.current&&((e=r.current)==null||e.on("onChange",(...a)=>{I==null||I.apply(null,a)}),(u=r.current)==null||u.on("renderZoom",a=>{l&&l(a)})),()=>{var a,i;(a=r.current)==null||a.unbindAll("onChange"),(i=r.current)==null||i.unbindAll("renderZoom")}},[l,I]);const x=w.createElement("div",{ref:O,style:S(S({position:"relative"},_),m)}),{imgNode:L,zoom:F,currentPos:H}=r.current||{};return w.createElement(G,{spinning:N||Z,delay:300,style:M},z&&L?w.createElement(K,{size:_,imgNode:L,zoom:F,currentPos:H}):x)};var te=w.forwardRef(ee);export{te 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";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import a,{useContext as N,useState as
|
|
1
|
+
import a,{useContext as N,useState as v,useEffect as u}from"react";import{connect as $}from"react-redux";import{LabelBeeContext as U,LLMContext as B}from"../../store/ctx.js";import{message as K}from"antd";import{ELLMDataType as L,prefix as W}from"../../constant/index.js";import{Layout as z}from"antd/es";import G from"./questionView/index.js";import{useTranslation as H}from"react-i18next";import J from"../../views/MainView/annotationTips/index.js";import{getCurrentResultFromResultList as O}from"./utils/data.js";import{getStepConfig as X}from"../../store/annotation/reducer.js";import{jsonParser as Y}from"../../utils/index.js";import Z from"../messageMaskLayer/index.js";const C=`${W}-LLMView`,ee=g=>{const{annotation:x,checkMode:M=!0,tips:q,showTips:A,drawLayerSlot:T}=g,{imgIndex:n,imgList:l,stepList:w,step:d,toolInstance:s}=x,{hoverKey:E,modelAPIResponse:R,setModelAPIResponse:I,newAnswerList:c}=N(B),[P,V]=v([]),[S,h]=v(""),[t,k]=v(),{t:y}=H(),[,Q]=v(0);return u(()=>{let e;if(!M)return e=setInterval(()=>{K.info(y("EfficientListening"))},1e3*60),()=>{e&&clearInterval(e)}},[]),u(()=>{if(s)return s.on("validUpdated",()=>{Q(e=>e+1)}),()=>{s.unbindAll("validUpdated")}},[s]),u(()=>{var e,o,i,r,_,j;if(!l[n])return;const b=((e=t==null?void 0:t.dataType)==null?void 0:e.prompt)===L.Picture,D=((o=t==null?void 0:t.dataType)==null?void 0:o.response)===L.Picture,m=(i=l[n])==null?void 0:i.questionList,p=(r=l[n])==null?void 0:r.llmFile,F=b?p==null?void 0:p.question:m==null?void 0:m.question;h(F);let f=(m==null?void 0:m.answerList)||[];D&&(f=(p==null?void 0:p.answerList)||[]),((_=t==null?void 0:t.dataType)==null?void 0:_.response)===L.None&&(f=[]),((j=t==null?void 0:t.dataType)==null?void 0:j.response)===L.Text&&(c==null?void 0:c.length)>0&&(f=c),V(f)},[n,c,t]),u(()=>{var e;if(!l[n])return;const o=(e=l[n])!=null?e:{},i=O(o==null?void 0:o.result,d),r=(i==null?void 0:i.length)>0?i[0]:i;I((r==null?void 0:r.modelAPIResponse)||[])},[n]),u(()=>{var e;if(w&&d){const o=(e=X(w,d))==null?void 0:e.config;k(Y(o))}},[w,d]),a.createElement(z,{className:C},!(s==null?void 0:s.valid)&&a.createElement(Z,{message:y("InvalidQuestionAndSkip")}),T==null?void 0:T({}),a.createElement("div",{className:`${C}-question`},A===!0&&a.createElement(J,{tips:q}),a.createElement(G,{hoverKey:E,question:S,answerList:P,modelAPIResponse:R,setModelAPIResponse:I,checkMode:M,annotation:x,LLMConfig:t})))},te=g=>({annotation:g.annotation});var ne=$(te,null,null,{context:U})(ee);export{ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{useTranslation as p}from"react-i18next";import{Resizable as f}from"re-resizable";import{Radio as i,Image as u}from"antd";import{EDataFormatType as m,prefix as g}from"../../../../../constant/index.js";import{FileTextOutlined as E}from"@ant-design/icons";import x from"../../../../markdownView/index.js";import{isString as w,isObject as y}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=`${g}-LLMView`,L=({question:t,dataFormatType:o,isImg:
|
|
1
|
+
import e from"react";import{useTranslation as p}from"react-i18next";import{Resizable as f}from"re-resizable";import{Radio as i,Image as u}from"antd";import{EDataFormatType as m,prefix as g}from"../../../../../constant/index.js";import{FileTextOutlined as E}from"@ant-design/icons";import x from"../../../../markdownView/index.js";import{isString as w,isObject as y}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=`${g}-LLMView`,L=({question:t,dataFormatType:o,isImg:a})=>{const n=w(t)?t:"",r=b.language==="en"?v:h;if(a){const l=y(t)?t==null?void 0:t.url:"";return e.createElement(u,{src:l||r,fallback:r})}return e.createElement("div",{style:{whiteSpace:"pre-wrap"}},o===m.Markdown?e.createElement(x,{value:n}):n)},T=t=>{const{question:o,dataFormatType:a,setDataFormatType:n,isImg:r}=t,l=300,{t:c}=p();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"}},c("Title"),e.createElement("span",{style:{display:"flex"}},e.createElement(i.Group,{value:a,onChange:d=>{n(d.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(E,null))),e.createElement("span",{style:{marginLeft:"8px",width:"4px",background:"#1890ff"}}))),e.createElement("div",{className:`${s}__headerContent`},e.createElement(L,{question:o,dataFormatType:a,isImg:r})))};export{T as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{useEffect as
|
|
2
|
-
`);return e.createElement("div",{className:
|
|
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 +1 @@
|
|
|
1
|
-
var e={form:"index-module_form__IypXc",outputDisplay:"index-module_outputDisplay__5dS48",title:"index-module_title__vhMCp",content:"index-module_content__Iml6l"};export{e as default};
|
|
1
|
+
var e={form:"index-module_form__IypXc",outputDisplay:"index-module_outputDisplay__5dS48",title:"index-module_title__vhMCp",content:"index-module_content__Iml6l",tip:"index-module_tip__NFru6"};export{e as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r,{useEffect as
|
|
2
|
-
`);return r.createElement("div",{className:E.outputDisplay},r.createElement("div",{className:E.title},
|
|
1
|
+
import r,{useEffect as V}from"react";import{Form as g,Input as j,message as F}from"antd";import N from"classnames";import{useTranslation as C}from"react-i18next";import{isArray as S}from"lodash";import A from"../../../../latexEditor/index.js";import E from"./index.module.scss.js";import B from"../../../../markdownView/index.js";import D from"../../../../longText/index.js";var M=Object.defineProperty,R=Object.defineProperties,k=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,T=(a,e,t)=>e in a?M(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,z=(a,e)=>{for(var t in e||(e={}))$.call(e,t)&&T(a,t,e[t]);if(P)for(var t of P(e))q.call(e,t)&&T(a,t,e[t]);return a},U=(a,e)=>R(a,k(e));const G=a=>{const{disabeledAll:e,LLMConfig:t,textAttribute:y,setText:I}=a,w=(t==null?void 0:t.text)&&S(t.text)?t==null?void 0:t.text:[],{TextArea:O}=j,[v]=g.useForm(),{t:h}=C();V(()=>{const s=w.map((c,n)=>{var d;const m=(y==null?void 0:y.filter(o=>(o==null?void 0:o.textId)===(c==null?void 0:c.textId)))||[];return U(z({},c),{value:(d=m[0])==null?void 0:d.value})});v.setFieldsValue({text:s})},[w,y]);const L=({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(h("MaximumCharacterError",{num:n}));return}l.value=i,v.setFields([{name:["text",c,"value"],value:i,errors:[]}]),b(),l.selectionStart=f+s.length,l.selectionEnd=f+s.length,l.focus()},b=()=>{const s=v.getFieldValue("text");I(s)};return r.createElement(g,{form:v},r.createElement(g.List,{name:"text"},(s,c)=>r.createElement(r.Fragment,null,s.map((n,d)=>{const{max:m,min:o,title:l,tip:u,isLaText:f}=w[n.name]||{},p=l,_=h("LeastCharacterError",{num:o});return r.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"16px"},key:d},p&&r.createElement(g.Item,{name:[n.name,"title"],extra:r.createElement(D,{text:u!=null?u:"",overflowMaxLines:3,openByText:!0}),className:E.textTitle,required:!!o,label:" ",colon:!1},l,p&&r.createElement("span",{className:N({clearText:!0,clearText__disabled:e}),style:{verticalAlign:"initial"},onClick:()=>{e||(v.setFields([{name:["text",n.name,"value"],value:void 0,errors:o?[_]:[]}]),b())}})),f&&p&&r.createElement(A,{onSelectLatex:x=>L({newText:x,fieldName:n.name,max:m}),disabled:e}),p&&r.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},r.createElement(O,{maxLength:m,disabled:e,showCount:!!m,autoSize:{minRows:4,maxRows:10},style:{width:"100%"},id:`textInput_${n.name}`,onChange:()=>b()})),f&&p&&r.createElement(g.Item,{shouldUpdate:!0,noStyle:!0},()=>{const x=v.getFieldValue(["text",n.name,"value"])||"",i=x.replace(/\n/g,`
|
|
2
|
+
`);return r.createElement("div",{className:E.outputDisplay},r.createElement("div",{className:E.title},h("OutputDisplay")),r.createElement("div",{className:E.content},x?r.createElement(B,{value:i}):""))}))}))))};export{G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r,{useContext as
|
|
1
|
+
import r,{useContext as q,useState as D,useEffect as C}from"react";import{prefix as ct}from"../../../constant/index.js";import{Empty as dt,Button as ut}from"antd";import pt from"./components/answerSort/index.js";import{connect as mt}from"react-redux";import{isBoolean as ft,isString as gt,isNumber as vt,isObject as Lt}from"lodash";import xt from"./components/answerList/index.js";import{LabelBeeContext as wt,LLMContext as z}from"../../../store/ctx.js";import{jsonParser as F}from"../../../utils/index.js";import{getStepConfig as St}from"../../../store/annotation/reducer.js";import{useCustomToolInstance as bt}from"../../../hooks/annotation.js";import{PageForward as j}from"../../../store/annotation/actionCreators.js";import{cKeyCode as Et,EToolName as _t}from"@labelbee/lb-annotation";import{useTranslation as yt}from"react-i18next";import{getCurrentResultFromResultList as ht,getRenderDataByResult as Ct,formatSort as jt}from"../utils/data.js";import Tt from"../../../assets/annotation/LLMTool/empty.svg.js";import Pt from"./components/textInputBox/index.js";import It from"../../tagList/components/overall/index.js";import Ot from"../../../utils/StepUtils.js";var At=Object.defineProperty,Rt=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,W=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,Mt=Object.prototype.propertyIsEnumerable,G=(s,i,a)=>i in s?At(s,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[i]=a,d=(s,i)=>{for(var a in i||(i={}))Nt.call(i,a)&&G(s,a,i[a]);if(W)for(var a of W(i))Mt.call(i,a)&&G(s,a,i[a]);return s},p=(s,i)=>Rt(s,Dt(i));const Bt=Et.default,T=`${ct}-sidebar`,$t=s=>{var i,a;const{annotation:J,dispatch:w,checkMode:Q}=s,{imgIndex:S,imgList:P,stepList:b,step:E,skipBeforePageTurning:_}=J,{modelAPIResponse:N,setModelAPIResponse:H}=q(z),{t:y}=yt(),u=(i=P[S])!=null?i:{},M=F(u==null?void 0:u.result),{toolInstanceRef:m}=bt({basicInfo:M}),[f,X]=D(),[I,Y]=D(!0),{setNewAnswerList:Z}=q(z),[n,L]=D({}),x=!m.current.valid||Q;C(()=>{var t;if(b&&E){const e=(t=St(b,E))==null?void 0:t.config;X(F(e))}},[E,JSON.stringify(b)]),C(()=>{!u||S===-1||(m.current.setValid=B,m.current.clearResult=tt,B(),$())},[S,f]);const tt=()=>{$(u==null?void 0:u.questionList)},B=t=>{var e;const o=t!=null?t:M.valid;ft(o)&&(Y(o),m.current.valid=o,(e=m.current)==null||e.emit("validUpdated"))},$=t=>{const e=Ot.getCurrentStepInfo(E,b),o=ht(u==null?void 0:u.result,e.step);let l=u==null?void 0:u.questionList;(o==null?void 0:o.answerList)&&m.current.valid&&(l=o),t&&(l=t,o.sort=[]);const g=Ct(f,l);L(d({},g)),H([])};C(()=>{et(),Z((n==null?void 0:n.answerList)||[])},[n,N,I]),C(()=>(window.addEventListener("keydown",V),()=>{window.removeEventListener("keydown",V)}),[]);const et=()=>{const{newSort:t,answerList:e,textAttribute:o,tagList:l}=n,g=jt(t||[]),c={answerList:e,sort:g,tagList:l,textAttribute:o,id:u==null?void 0:u.id,modelAPIResponse:N};m.current.exportData=()=>[[c],{valid:I}],m.current.currentPageResult=p(d({},c),{toolName:_t.LLM,valid:I})},V=t=>{if(t.ctrlKey&&t.keyCode===Bt.Enter){if(_){_(()=>w(j()));return}w(j())}},nt=({order:t,value:e,key:o})=>{const{answerList:l}=n,g=l==null?void 0:l.map(c=>{var h;if((c==null?void 0:c.order)===t){if(o==="textEdit"&>(e))return p(d({},c),{newAnswer:e});if(vt(e))return p(d({},c),{score:e});if(Lt(e)&&o){const A={[e==null?void 0:e.key]:e.value},R=(h=c[o])!=null?h:{};return p(d({},c),{[o]:d(d({},R),A)})}}return c});L(p(d({},n),{answerList:g||[]}))};if((()=>{var t,e;const{indicatorScore:o=[],indicatorDetermine:l=[],text:g=[],enableSort:c,isTextEdit:h,tagInputListConfigurable:A}=f||{},R=((t=o==null?void 0:o.filter(v=>v.label&&v.value&&v.score))==null?void 0:t.length)>0,at=((e=l==null?void 0:l.filter(v=>v.label&&v.value))==null?void 0:e.length)>0,lt=(g==null?void 0:g.length)>0;return!(R||at||lt||c||h||A)})())return r.createElement("div",{className:`${T}`},r.createElement("div",{className:`${T}__content`,style:{display:"flex",justifyContent:"center",alignItems:"center"}},r.createElement(dt,{description:r.createElement("span",{style:{color:"#ccc"}},y("NoScoringScale")),imageStyle:{width:200,height:200},image:r.createElement("img",{src:Tt})})));const{indicatorScore:k=[],indicatorDetermine:K=[],enableSort:ot,isTextEdit:rt,inputList:O=[],tagInputListConfigurable:U}=f||{},it=U&&((a=O.filter(t=>!t.isOverall))==null?void 0:a.length)>0,st=(K==null?void 0:K.length)>0||(k==null?void 0:k.length)>0||rt||it;return r.createElement("div",{className:`${T}`},r.createElement("div",{className:`${T}__content`},r.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},y("GlobalAnnotation")),ot&&r.createElement(pt,{waitSortList:(n==null?void 0:n.waitSorts)||[],sortList:(n==null?void 0:n.newSort)||[],setSortList:t=>{L(p(d({},n),{newSort:t}))},disabeledAll:x}),U&&O.length&&r.createElement(It,{inputList:O,selectedTags:(n==null?void 0:n.tagList)||{},updateValue:t=>{const{key:e,value:o}=t,l=n==null?void 0:n.tagList;L(p(d({},n),{tagList:p(d({},l),{[e]:o})}))},disabeledAll:x}),(f==null?void 0:f.text)&&r.createElement("div",{style:{padding:"0px 16px",marginTop:"16px"}},r.createElement(Pt,{textAttribute:(n==null?void 0:n.textAttribute)||[],LLMConfig:f,setText:t=>L(p(d({},n),{textAttribute:t})),disabeledAll:x})),r.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},y("QualifiedAnnotation")),r.createElement("div",null,st&&r.createElement(xt,{list:(n==null?void 0:n.answerList)||[],LLMConfig:f,updateValue:nt,disabeledAll:x}))),r.createElement("div",{style:{margin:"24px 16px",display:"flex"}},(P==null?void 0:P.length)-1!==S&&r.createElement(ut,{type:"primary",style:{marginLeft:"auto"},onClick:()=>{if(_){_(()=>w(j()));return}w(j())},disabled:x},y("Save"))))},Vt=s=>({annotation:s.annotation});var kt=mt(Vt,null,null,{context:wt})($t);export{kt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isArray as L}from"lodash";import{jsonParser as O}from"../../../utils/index.js";var P=Object.defineProperty,S=Object.defineProperties,b=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,g=(l,t,r)=>t in l?P(l,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[t]=r,
|
|
1
|
+
import{isArray as L}from"lodash";import{jsonParser as O}from"../../../utils/index.js";var P=Object.defineProperty,S=Object.defineProperties,b=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,g=(l,t,r)=>t in l?P(l,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[t]=r,v=(l,t)=>{for(var r in t||(t={}))A.call(t,r)&&g(l,r,t[r]);if(w)for(var r of w(t))E.call(t,r)&&g(l,r,t[r]);return l},c=(l,t)=>S(l,b(t));const x=(l,t=1)=>{var r,n;const i=O(l),o=`step_${t}`;return(n=(r=i==null?void 0:i[o])==null?void 0:r.result[0])!=null?n:{}},j=l=>l.reduce((r,n)=>{var i;let o=n;return n.length>1?o=n.map(e=>e==null?void 0:e.id):o=[(i=n[0])==null?void 0:i.id],[...r,o]},[]),p=(l,t)=>{let r={};return l.forEach(n=>{var i;let o=[];t&&t[n==null?void 0:n.value]?o=t[n.value]:((i=n==null?void 0:n.subSelected)==null?void 0:i.length)>0&&n.subSelected.forEach(e=>{(e==null?void 0:e.isDefault)&&(e==null?void 0:e.value)&&o.push(e.value)}),o.length>0&&(r=c(v({},r),{[n.value]:o}))}),r},f=(l,t)=>{var r;let n=[],i=[];if((l==null?void 0:l.length)>0){const o=L(t)?t[0]:t;((r=o==null?void 0:o.sort)==null?void 0:r.length)>0&&(i=o.sort.reduce((e,s)=>{let a=[{title:s[0],id:s[0]}];return s.length>1&&(a=s.map(u=>({title:u,id:u}))),[...e,a]},[])),l.forEach(e=>{i.some(a=>a.length>1?a.some(u=>u.id===e.order):a[0].id===e.order)||n.push({title:e.order,id:e.order})})}return{newSort:i,waitSorts:n}},m=(l,t)=>{const{isTextEdit:r,textEdit:n=[],inputList:i=[]}=t||{};return l.map(e=>{var s,a;const u=i.filter(d=>!(d==null?void 0:d.isOverall))||[],_=p(u,e==null?void 0:e.tagList);return r&&((s=n.filter(h=>h.title===e.order)[0])==null?void 0:s.isFillAnswer)?c(v({},e),{newAnswer:(a=e==null?void 0:e.newAnswer)!=null?a:e.answer,tagList:_}):c(v({},e),{tagList:_})})},R=(l,t)=>{var r;let n=[],i=[],o=[],e={};(t==null?void 0:t.answerList)&&(n=m(t.answerList,l)||[],i=f(t.answerList,t).newSort,o=f(t.answerList,t).waitSorts);const s=((r=l==null?void 0:l.inputList)==null?void 0:r.filter(a=>a==null?void 0:a.isOverall))||[];return e=p(s,t==null?void 0:t.tagList),{newSort:i,waitSorts:o,answerList:n,tagList:e,textAttribute:t==null?void 0:t.textAttribute}};export{j as formatSort,x as getCurrentResultFromResultList,R as getRenderDataByResult,p as getTagResult,f as getWaitSortList,m as initAnswerList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import x,{useContext as ut,useState as
|
|
1
|
+
import x,{useContext as ut,useState as g,useMemo as M,useEffect as C}from"react";import{connect as lt}from"react-redux";import{LabelBeeContext as dt,NLPContext as ft}from"../../store/ctx.js";import{prefix as pt}from"../../constant/index.js";import mt from"./textContent/index.js";import gt from"../../views/MainView/annotationTips/index.js";import{getStepConfig as vt}from"../../store/annotation/reducer.js";import{jsonParser as xt}from"../../utils/index.js";import{getCurrentResultFromResultList as bt}from"../LLMToolView/utils/data.js";import{useCustomToolInstance as At}from"../../hooks/annotation.js";import{uuid as ht}from"@labelbee/lb-annotation";var _t=Object.defineProperty,Lt=Object.defineProperties,wt=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,Pt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,K=(i,e,a)=>e in i?_t(i,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[e]=a,b=(i,e)=>{for(var a in e||(e={}))Pt.call(e,a)&&K(i,a,e[a]);if(B)for(var a of B(e))Ct.call(e,a)&&K(i,a,e[a]);return i},A=(i,e)=>Lt(i,wt(e));const $=`${pt}-NLPView`,yt=i=>{const{annotation:e,checkMode:a,tips:H,showTips:q,extraLayer:F,extraData:Q,onChangeAnnotation:y,customAnnotationData:W}=i,{imgIndex:u,imgList:v,stepList:h,step:_}=e,{highlightKey:z,setHighlightKey:G}=ut(ft),{toolInstanceRef:n}=At(),[D,J]=g(""),[L,U]=g([]),[w,X]=g(void 0),[Y,Z]=g([{content:""}]),[o,d]=g({id:1,newText:"",indicatorDetermine:{},textAnnotation:[]}),tt=M(()=>(o==null?void 0:o.textAnnotation)?(w&&(o.textAnnotation=w),o.textAnnotation.filter(t=>L.length===0||L.includes(t.attribute))):[],[o,L,w]),l=M(()=>{var t;if(h&&_){const r=(t=vt(h,_))==null?void 0:t.config;return xt(r)}},[h,_]);C(()=>{var t;if(!v[u])return;const r=(t=v[u])==null?void 0:t.textData;Z(r),(l==null?void 0:l.attributeConfigurable)||f([])},[u,l]),C(()=>{var t;if(!v[u])return;const r=(t=v[u])!=null?t:{},c=bt(r==null?void 0:r.result);d(c),f(c.textAnnotation)},[u]),C(()=>{n.current.exportData=()=>[[o],{}],n.current.setResult=()=>{},n.current.updateResult=t=>{d(t)},n.current.clearResult=ot,n.current.setDefaultAttribute=et,n.current.setHighlightKey=G,n.current.deleteTextAnnotation=rt,n.current.setAttributeLockList=nt,n.current.setVisibleResult=f,P()},[o]);const P=()=>{n.current.emit("changeAttributeSidebar"),n.current.emit("changeIndicatorDetermine")},et=t=>{n.current.defaultAttribute=t,J(t),P()},nt=t=>{U(t),n.current.attributeLockList=t,n.current.emit("changeAttributeSidebar")},f=t=>{X(t)},ot=()=>{d({id:1,newText:"",indicatorDetermine:{},textAnnotation:[]}),f([]),P()},rt=t=>{const r=o.textAnnotation.filter(c=>c.id!==t);d(A(b({},o),{textAnnotation:r})),f(r)},it=(t,r)=>{var c,p;if(r===""||!t)return;const s=window.getSelection(),{anchorOffset:O=0,focusOffset:S=0,anchorNode:st,focusNode:ct}=s||{};if(st===ct){const j=Math.min(O,S),N=Math.max(O,S);let R;if((t==null?void 0:t.current)&&s){const m=(c=t.current)==null?void 0:c.getBoundingClientRect(),E=s.getRangeAt(0).getBoundingClientRect(),k=E.right-m.left,I=E.top-m.top;k&&I&&(R={left:k,top:I})}const T={id:ht(8,62),start:j,end:N,text:r};if(typeof y=="function"){y(A(b({},T),{endPosition:R}));return}if(at(j,N,D,o==null?void 0:o.textAnnotation)||a)return;if(l==null?void 0:l.attributeConfigurable){const m=(o==null?void 0:o.textAnnotation)||[];m.push(A(b({},T),{attribute:D}));const V=A(b({},o),{textAnnotation:m});d(V)}(p=window.getSelection())==null||p.empty()}},at=(t,r,c,p)=>p==null?void 0:p.some(s=>(s==null?void 0:s.start)===t&&(s==null?void 0:s.end)===r&&(s==null?void 0:s.attribute)===c);return x.createElement("div",{className:$,id:"NLPView"},x.createElement("div",{className:`${$}-question`},q===!0&&x.createElement(gt,{tips:H}),x.createElement(mt,{highlightKey:z,textData:Y,NLPConfig:l,textAnnotation:tt,onSelectionChange:it,extraLayer:F,extraData:Q,customAnnotationData:W})))},Dt=i=>({annotation:i.annotation});var Ot=lt(Dt,null,null,{context:dt})(yt);export{Ot as default};
|
|
@@ -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 ot=Object.defineProperty,nt=Object.defineProperties,it=Object.getOwnPropertyDescriptors,ue=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,ce=(o,n,s)=>n in o?ot(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,S=(o,n)=>{for(var s in n||(n={}))lt.call(n,s)&&ce(o,s,n[s]);if(ue)for(var s of ue(n))rt.call(n,s)&&ce(o,s,n[s]);return o},N=(o,n)=>nt(o,it(n));const{EAudioToolName:st}=Ve,de=ke.default,{Sider:at,Content:ut}=se,fe=`${Ne}-layout`,ct=({setSideTab:o,sideTab:n})=>{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:n===d?x:L,onClick:()=>{n!==d&&o(d)}}))}))},dt=({result:o,inputDisabled:n,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:o==null?void 0:o.value,textInputDisabled:n,textID:(o==null?void 0:o.id)||0,updateText:s,configList:p,autofocus:!n&&_,preContext:d,regions:o==null?void 0:o.regions,clipAttributeConfigurable:L,clipTextConfigurable:k,textConfigurable:b,updateRegion:C,clipAttributeList:f,clipTextList:g}))),ft=o=>{var n,s;const{sider:p,config:_,result:d,updateTagResult:x,updateRegion:L,isEdit:k,tagConfigurable:b,clipConfigurable:C}=o;let f=(_==null?void 0:_.inputList)||[],g=(n=d==null?void 0:d.tag)!=null?n:{},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 y in g)if(y===f[t].value){if(X++,m===!0){const A=W[y].split(";").filter(z=>z!==""),G=A.indexOf(c);G===-1?A.push(c):A.splice(G,1),c=A.join(";")}c===""?delete W[y]:W[y]=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=o=>{var n,s,p,_,d,x,L,k,b;const C=(s=(n=o.style)==null?void 0:n.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:$}=o,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),[y,A]=M(!0);B(()=>{h(!0)},[v]),B(()=>{r===!1&&_e()},[r]),B(()=>{z()},[]),B(()=>{t.current.exportData=()=>[[m],{duration:X,valid:y}],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,y]);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:oe=[],clipTextConfigurable:q=!1,subAttributeList:me=[],secondaryAttributeConfigurable:pe=!1,inputList:ge=[],configList:ve=[],clipTextList:ne=Ke}=re(()=>{if(I)return K.jsonParser(I==null?void 0:I.config)},[I]),be={clipConfigurable:ee,clipAttributeConfigurable:te,clipAttributeList:oe,clipTextConfigurable:q,subAttributeList:me,secondaryAttributeConfigurable:pe,clipTextList:ne},ye=(_=(p=K.jsonParser(D.result))==null?void 0:p.duration)!=null?_:0,Ee=y?ye:0,Se=!y||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),E=(k=(L=u==null?void 0:u.config)==null?void 0:L.context)!=null?k:{};Object.keys(E).forEach(j=>{j&&E[j]&&(ie[j]={visible:!0,content:E[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(E=>{i[E.key]=e&&E.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(S({},i),{regions:((i==null?void 0:i.regions)||[]).filter(u=>u.id!==e)}))},Q=e=>{c(i=>{var u;const E=(u=i==null?void 0:i.regions)!=null?u:[],{id:j}=e;return E.find(F=>F.id===j)?N(S({},i),{regions:E.map(F=>j===F.id?S(S({},F),e):F)}):N(S({},i),{regions:[...E,e]})})},Le=(e,i)=>{c(u=>N(S({},u),{value:N(S({},u.value),{[i]:e})}))},Re=e=>{c(i=>N(S({},i),{tag:e}))},he=e=>{c(e)},je=()=>{c(e=>N(S({},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%"}},o==null?void 0:o.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,S({context:{isEdit:a==null?void 0:a.isEdit,count:Ee,toolName:st.AudioTextTool,imgIndex:v},drawLayerSlot:P,fileData:D,onLoaded:Ce,invalid:!y,updateRegion:Q,removeRegion:Te,regions:m==null?void 0:m.regions,activeToolPanel:a==null?void 0:a.activeToolPanel,footer:o.footer,isCheck:$},be))),(J||q)&&l.createElement(dt,{preContext:ie,result:m,inputDisabled:Se,updateText:Le,updateRegion:Q,configList:ve,autofocus:!1,textConfigurable:J,clipTextConfigurable:q,clipAttributeList:oe,clipAttributeConfigurable:te,clipTextList:ne,isCheck:$}))),l.createElement(at,{className:`${fe}__side`,width:C!=null?C:240,style:(b=o.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={textInputContainer:"index-module_textInputContainer__ES6X3",textField:"index-module_textField__uRcb7",label:"index-module_label__xE6hM",required:"index-module_required__iElYl",extra:"index-module_extra__PW5Qk",textareaContainer:"index-module_textareaContainer__dTIv4",textAreaFooter:"index-module_textAreaFooter__h1Vv-",warning:"index-module_warning__NKpW6",hotkeyTip:"index-module_hotkeyTip__BSJ6A",wordCount:"index-module_wordCount__OD4eL",focus:"index-module_focus__H07-Y",invalid:"index-module_invalid__F9RC5",inputCount:"index-module_inputCount__--XiT",notify:"index-module_notify__rYuqq",switchItem:"index-module_switchItem__Q256x",placeholderHotkey:"index-module_placeholderHotkey__0SKPo",title:"index-module_title__YRpw9",questionIcon:"index-module_questionIcon__oK1HK",attribute:"index-module_attribute__g8Vbl",clearIcon:"index-module_clearIcon__ZBZqI",disabled:"index-module_disabled__zqh8C"};export{e as default};
|
|
1
|
+
var e={textInputContainer:"index-module_textInputContainer__ES6X3",textField:"index-module_textField__uRcb7",label:"index-module_label__xE6hM",labelText:"index-module_labelText__Zg1c4",titleText:"index-module_titleText__BRM44",required:"index-module_required__iElYl",extra:"index-module_extra__PW5Qk",textareaContainer:"index-module_textareaContainer__dTIv4",textAreaFooter:"index-module_textAreaFooter__h1Vv-",warning:"index-module_warning__NKpW6",hotkeyTip:"index-module_hotkeyTip__BSJ6A",wordCount:"index-module_wordCount__OD4eL",focus:"index-module_focus__H07-Y",invalid:"index-module_invalid__F9RC5",inputCount:"index-module_inputCount__--XiT",notify:"index-module_notify__rYuqq",switchItem:"index-module_switchItem__Q256x",placeholderHotkey:"index-module_placeholderHotkey__0SKPo",title:"index-module_title__YRpw9",questionIcon:"index-module_questionIcon__oK1HK",attribute:"index-module_attribute__g8Vbl",clearIcon:"index-module_clearIcon__ZBZqI",disabled:"index-module_disabled__zqh8C"};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"lodash";class o{}o.getClipTextByConfig=(a,f,l=!1)=>{const t=r.cloneDeep(a);return f.forEach((e,c)=>{var s;const n=(s=e==null?void 0:e.default)!=null?s:"";c===0?Object.assign(t,{text:l?n:a[e.key]}):Object.assign(t,{[e.key]:l?n:a[e.key]})}),t};export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r,{useRef as I}from"react";import B from"react-dom";import{useAudioClipStore as M}from"../../audioAnnotate/audioContext/index.js";import{getAttributeColor as U,getAttributeFontColor as V,updateColorOpacity as Y,getAttributeShowText as q}from"../../../utils/audio.js";import z from"../../../assets/annotation/audio/loop.svg.js";import{Typography as G}from"antd";import{useClickAway as H}from"ahooks";import{classnames as J}from"../../../utils/index.js";import n from"./index.module.scss.js";import{useTranslation as K}from"react-i18next";import{TagUtils as Q}from"@labelbee/lb-annotation";var W=Object.defineProperty,X=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,w=(o,e,t)=>e in o?W(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,oe=(o,e)=>{for(var t in e||(e={}))ee.call(e,t)&&w(o,t,e[t]);if(h)for(var t of h(e))te.call(e,t)&&w(o,t,e[t]);return o},re=(o,e)=>X(o,Z(e));const{Paragraph:E}=G,le=({result:o,subAttributeList:e,textStyle:t})=>{const u=Q.getTagNameList(o,e);return r.createElement("div",null,u.map((a,c)=>r.createElement(E,{ellipsis:{rows:2},className:n.text,key:c,style:re(oe({},t),{marginBottom:0})},`${a.keyName}\uFF1A${a.value.join("\u3001")}`)))},se=o=>{const{t:e}=K(),{audioClipState:t,setAudioClipState:u}=M(),{clipAttributeList:a,clipAttributeConfigurable:c,clipTextConfigurable:P,selectedRegion:b,clipTextList:g,secondaryAttributeConfigurable:j,subAttributeList:v}=t,x=I(null),{el:L,region:y,edgeAdsorption:R,clipping:S,instance:_,isCheck:T}=o,{attribute:p="",text:ie="",id:d,start:k,end:N,subAttribute:C}=y,{id:m}=b,s=U(p,a),f={color:V(p,a),backgroundColor:s},l={border:`2px solid ${s}`,overflowY:T?"initial":"auto"};if(d===m)l.backgroundColor=Y(s,.6),l.borderLeft=`2px solid ${s}`,l.borderRight=`2px solid ${s}`;else if(_==null||_.setLoop(!1),l.borderLeft=`2px solid ${s}`,l.borderRight=`2px solid ${s}`,S){const i=Object.values(R);i.includes(k)&&(l.borderLeft="3px dashed #fff"),i.includes(N)&&(l.borderRight="3px dashed #fff")}H(()=>{d===m&&u({selectedRegion:{}})},x,["contextmenu"]);const $=d===m&&b.loop,F=r.createElement("div",{style:l,ref:x,className:J({[n.container]:!0})},$&&r.createElement("div",{className:n.loop},r.createElement("img",{src:z})),c&&r.createElement("div",null,r.createElement("div",{style:f,className:n.attribute},q(p,[{value:"",key:"\u65E0\u5C5E\u6027"},...a])),j&&C&&v&&r.createElement(le,{result:C,subAttributeList:v,textStyle:f})),P&&(g==null?void 0:g.map((i,D)=>{var A,O;return r.createElement(E,{ellipsis:{rows:2},className:n.text,style:f,key:D},(A=i==null?void 0:i.label)!=null?A:e("textTool"),":",(O=y[i==null?void 0:i.key])!=null?O:"")})));return r.createElement(r.Fragment,null,B.createPortal(F,L))};export{se as default};
|