@labelbee/lb-components 1.23.0-alpha.10 → 1.23.0-alpha.101
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/questionView/components/imgView/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/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/audioPlayer/zoomSlider/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/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/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/hooks/useToolStyle.js +1 -0
- package/dist/index.css +140 -12
- 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 +6 -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/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 +13 -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/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/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 +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/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/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/questionView/components/imgView/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/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/audioPlayer/zoomSlider/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/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/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/hooks/useToolStyle.js +1 -0
- package/es/index.css +140 -12
- 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/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
|
|
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 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 +1 @@
|
|
|
1
|
-
import t from"react";import{Tag as i,Image as c}from"antd";import{prefix as g}from"../../../../../constant/index.js";import d from"classnames";import f from"../../../../../assets/annotation/LLMTool/imgFail_cn.svg.js";import u from"../../../../../assets/annotation/LLMTool/imgFail_en.svg.js";import{i18n as p}from"@labelbee/lb-utils";import a from"./index.module.scss.js";const s=`${g}-LLMView`,v=
|
|
1
|
+
import t from"react";import{Tag as i,Image as c}from"antd";import{prefix as g}from"../../../../../constant/index.js";import d from"classnames";import f from"../../../../../assets/annotation/LLMTool/imgFail_cn.svg.js";import u from"../../../../../assets/annotation/LLMTool/imgFail_en.svg.js";import{i18n as p}from"@labelbee/lb-utils";import a from"./index.module.scss.js";const s=`${g}-LLMView`,v=o=>{const{answerList:m,hoverKey:r}=o,l=p.language==="en"?u:f;return t.createElement("div",{className:a.imgView},m.map((e,n)=>t.createElement("div",{key:n,className:a.item},t.createElement(i,{className:`${s}-tag`},e==null?void 0:e.order),t.createElement("div",{className:d({[`${a.image}`]:!0,[`${s}__contentActive`]:r===(e==null?void 0:e.order)})},t.createElement(c,{src:e==null?void 0:e.url,fallback:l,style:{objectFit:"contain"}})))))};export{v 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,u=(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(),l=(i=P[S])!=null?i:{},M=F(l==null?void 0:l.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(()=>{!l||S===-1||(m.current.setValid=B,m.current.clearResult=tt,B(),$())},[S,f,l==null?void 0:l.id]);const tt=()=>{$(l==null?void 0:l.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(l==null?void 0:l.result,e.step);let c=l==null?void 0:l.questionList;(o==null?void 0:o.answerList)&&m.current.valid&&(c=o),t&&(c=t,o.sort=[]);const g=Ct(f,c);L(u({},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:c}=n,g=jt(t||[]),d={answerList:e,sort:g,tagList:c,textAttribute:o,id:l==null?void 0:l.id,modelAPIResponse:N};m.current.exportData=()=>[[d],{valid:I}],m.current.currentPageResult=p(u({},d),{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:c}=n,g=c==null?void 0:c.map(d=>{var h;if((d==null?void 0:d.order)===t){if(o==="textEdit"&>(e))return p(u({},d),{newAnswer:e});if(vt(e))return p(u({},d),{score:e});if(Lt(e)&&o){const A={[e==null?void 0:e.key]:e.value},R=(h=d[o])!=null?h:{};return p(u({},d),{[o]:u(u({},R),A)})}}return d});L(p(u({},n),{answerList:g||[]}))};if((()=>{var t,e;const{indicatorScore:o=[],indicatorDetermine:c=[],text:g=[],enableSort:d,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=c==null?void 0:c.filter(v=>v.label&&v.value))==null?void 0:e.length)>0,lt=(g==null?void 0:g.length)>0;return!(R||at||lt||d||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(u({},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,c=n==null?void 0:n.tagList;L(p(u({},n),{tagList:p(u({},c),{[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(u({},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{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};
|
|
@@ -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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import i,{useState as g,useRef as z,useEffect as A}from"react";import{getWebPcm2WavBase64 as Kt}from"../audioAnnotate/utils/getWebPcm2Wac.js";import Vt,{debounce as Gt,sortBy as Yt}from"lodash";import{PauseOutlined as Jt,CaretRightOutlined as Qt}from"@ant-design/icons";import{cKeyCode as er,cTool as tr,EventBus as _}from"@labelbee/lb-annotation";import{Button as rr}from"antd";import or from"../invalidPage/index.js";import nr from"../imageError/index.js";import{classnames as $}from"../../utils/index.js";import ir,{EPlayerType as lr}from"../videoPlayer/components/SpeedController/index.js";import sr from"@labelbee/wavesurfer";import ar from"@labelbee/wavesurfer/dist/plugin/wavesurfer.regions.js";import ur from"@labelbee/wavesurfer/dist/plugin/wavesurfer.cursor.js";import cr,{audioZoomInfo as Xe}from"./zoomSlider/index.js";import dr from"./labelDisplayToggle/index.js";import mr from"./clipRegion/index.js";import{useAudioClipStore as pr}from"../audioAnnotate/audioContext/index.js";import{useLatest as H,useUpdate as fr,useDeepCompareEffect as Ze,useThrottleFn as vr}from"ahooks";import gr from"./useAudioScroll/index.js";import b from"./index.module.scss.js";import{getAttributeColor as br,formatTime as qe,timeFormat as Ke,dispatchResizeEvent as yr,precisionMinus as Ve,isDoubleClick as _r,getCanMoveRange as Er}from"../../utils/audio.js";import hr from"./progressDot/index.js";import Pr from"./clipTip/index.js";import Sr from"./useSwitchHotkey/index.js";import Cr from"./useAudioCombine/index.js";import Rr from"./useAudioSegment/index.js";import wr from"./combineTip/index.js";import Tr from"./segmentTip/index.js";import Ar from"../../views/MainView/toolFooter/index.js";import{decimalReserved as U}from"../videoPlayer/utils.js";var jr=Object.defineProperty,xr=Object.defineProperties,Dr=Object.getOwnPropertyDescriptors,Ge=Object.getOwnPropertySymbols,Mr=Object.prototype.hasOwnProperty,kr=Object.prototype.propertyIsEnumerable,Ye=(f,a,u)=>a in f?jr(f,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):f[a]=u,Je=(f,a)=>{for(var u in a||(a={}))Mr.call(a,u)&&Ye(f,u,a[u]);if(Ge)for(var u of Ge(a))kr.call(a,u)&&Ye(f,u,a[u]);return f},Qe=(f,a)=>xr(f,Dr(a));const{EToolName:et}=tr,X=er.default,tt=.1,rt=i.createContext({count:0,isEdit:!1,toolName:et.Empty,imgIndex:0}),Ir=({fileData:f={},onLoaded:a,context:u,invalid:ot,height:nt,hideError:it,onError:ce,updateRegion:j,removeRegion:L,regions:x=[],activeToolPanel:lt,clipConfigurable:st,clipTextConfigurable:at,clipAttributeList:ut,clipAttributeConfigurable:de,isCheck:S,hoverRegionId:Z,footer:ct,drawLayerSlot:me})=>{var pe,fe;const{url:O,path:ve}=f,[q,K]=g(!1),[ge,be]=g(!1),[C,dt]=g(0),[mt,ye]=g(!1),[N,_e]=g(0),n=z(null),R=z(null),Ee=z(C),V=e=>{Ee.current=e,dt(e)},[he,pt]=g(0),[F,ft]=g(1),G=z(null),[Pe,vt]=g({}),{audioClipState:Y,setAudioClipState:k}=pr(),[J,Q]=g(!1),c=H(Y),Se=H(Pe),gt=H(q),D=H(x),Ce=fr(),[Re,bt]=g([]),[we,yt]=g({}),_t=Gt(()=>{_.emit("audioZoom")},500),Te=e=>{e<Xe.min||e>Xe.max||(ft(e),yr(),_t())};gr({container:G.current,target:document.querySelector(`[data-id=${(fe=(pe=c.current)==null?void 0:pe.selectedRegion)==null?void 0:fe.id}]`),clipping:J,zoom:F,zoomHandler:Te});const W=()=>{let e=D.current;const{attributeLockList:r}=c.current;r.length&&(e=e.filter(t=>r.includes(t.attribute))),te(),e.forEach(t=>{var o;(o=n.current)==null||o.addRegion(Qe(Je({},t),{drag:!S,resize:!S,color:"rgba(0, 0, 0, 0)"}))}),Ce()},m=e=>{var r,t,o,l,s,p,E;const{id:d,loop:v=!0,playImmediately:P=!1}=e;if(d){const M=(o=(t=(r=n.current)==null?void 0:r.regions)==null?void 0:t.list)!=null?o:{};Object.entries(M).forEach(([,y])=>{const{id:T}=y;d===T?y.select():y.cancelSelect()}),k({selectedRegion:{id:d,loop:v},selectedAttribute:(p=(s=(l=D.current)==null?void 0:l.find(y=>y.id===d))==null?void 0:s.attribute)!=null?p:""}),v&&P&&((E=I(d))==null||E.playLoop())}else k({selectedRegion:{}})},{combineInstance:Et}=Cr({waveRef:n,sortByStartRegions:Re,regionMap:we,updateRegion:j,removeRegion:L,generateRegions:W,setSelectedRegion:m}),{segmentInstance:ht,onRegionMouseMove:Pt,segmentTimeTip:St}=Rr({waveRef:n,regionMap:we,updateRegion:j,removeRegion:L,generateRegions:W,setSelectedRegion:m}),Ae={clipTextConfigurable:at,clipAttributeList:ut,clipAttributeConfigurable:de,clipConfigurable:st};A(()=>{k({selectedAttribute:""})},[de]),A(()=>{ee()},[Y.selectedAttribute]),A(()=>{W()},[Y.attributeLockList]),Ze(()=>{k(Ae),setTimeout(()=>{je()})},[Ae]),Ze(()=>{bt(Yt(x,["start"])),yt(x.reduce((e,r)=>{const{id:t}=r;return Qe(Je({},e),{[t]:r})},{}))},[x]),A(()=>{if(Z){const e=gt.current;m({id:Z,loop:e,playImmediately:!0})}else m({})},[Z]);const je=()=>{var e,r;c.current.clipConfigurable?(!S&&n.current&&((e=n.current)==null||e.enableDragSelection({slop:5})),W()):((r=n.current)==null||r.disableDragSelection(),te()),ee()},ee=()=>{var e,r,t,o,l;let s="";c.current.clipConfigurable?s=br(c.current.selectedAttribute,(e=c.current.clipAttributeList)!=null?e:[]):s="transparent",((t=(r=n==null?void 0:n.current)==null?void 0:r.cursor)==null?void 0:t.cursor)&&((l=(o=n==null?void 0:n.current)==null?void 0:o.cursor)==null||l.setStyle({border:`2px dashed ${s}`}))},I=e=>{var r,t,o;return((o=(t=(r=n.current)==null?void 0:r.regions)==null?void 0:t.list)!=null?o:{})[e]},xe=()=>{var e,r;if(O){const t=((r=(e=ve==null?void 0:ve.split("."))==null?void 0:e.pop())==null?void 0:r.toLowerCase())==="pcm";ye(!1),t?Kt(O).then(o=>{De(o)}):De(O)}},De=e=>{var r;e&&(be(!0),V(0),_e(0),(r=n==null?void 0:n.current)==null||r.load(e))},te=()=>{var e;(e=n.current)==null||e.clearRegions()},re=e=>{const r=I(e);r&&(Q(!1),r==null||r.remove(),L==null||L(e),m({}))},{run:Me}=vr(m,{wait:500});Sr({sortByStartRegions:Re,setSelectedRegion:m});const Ct=e=>{const{start:r,end:t}=Se.current;return(r||t)&&e.update(Se.current),e},Rt=({action:e,id:r,eventDownTime:t})=>{var o,l;if(!c.current.clipConfigurable)return;r&&m({id:r});const s=I((r!=null?r:(o=c.current.selectedRegion)==null?void 0:o.id)||""),p=[];(e==="create"?D.current:(l=D.current)==null?void 0:l.filter(v=>v.id!==s.id)).forEach(v=>{const{start:P,end:M,attribute:y}=v;y===c.current.selectedAttribute&&[P,M].forEach(T=>{p.includes(T)||p.push(T)})});const d=Er(p.sort((v,P)=>v-P),t);n.current.range=d},wt=e=>{ee(),setTimeout(()=>{Q(!1)});const r=Ct(e),{id:t,start:o,end:l}=r;m({id:t,playImmediately:!0});const s={id:t,start:U(o,3),end:U(l,3)};j==null||j(s),Ce()},Tt=()=>{const e=sr.create({container:"#waveform",waveColor:"#999",progressColor:"#999",height:nt||245,normalize:!0,cursorWidth:2,cursorColor:"white",responsive:0,hideScrollbar:!0,plugins:[ar.create({regions:x,dragSelection:{slop:5},canMove:!1}),ur.create({opacity:1,customStyle:{border:"2px dashed transparent"}})]}),r=()=>{var t;V(((t=n==null?void 0:n.current)==null?void 0:t.getCurrentTime())||0)};e.on("ready",()=>{var t;const o=((t=n==null?void 0:n.current)==null?void 0:t.getDuration())||0;_e(o),r(),a==null||a({duration:Math.round(o)}),be(!1),B(),_.on("setCurrentTimeByPosition",ne),_.on("clearRegions",te),_.on("removeRegionById",re),_.on("setSelectedRegion",Me),e.on("regions-eventDown",Rt),je()}),e.on("audioprocess",()=>{r()}),e.on("play",()=>{K(!0)}),e.on("pause",()=>{K(!1)}),e.on("finish",()=>{K(!1)}),e.on("seek",()=>{r()}),e.on("error",()=>{ye(!0),a==null||a({hasError:!0}),ce==null||ce()}),e.on("region-created",t=>{const{id:o,start:l,end:s}=t;if(D.current.find(E=>E.id===o))return;const p={id:o,start:U(l,3),end:U(s,3),attribute:c.current.selectedAttribute,text:""};j==null||j(p)}),e.on("region-updated",(t,o)=>{var l,s,p,E,d,v,P,M,y,T;const We=o==null?void 0:o.action;k({combined:!1,segment:!1}),We==="resize"&&((s=(l=n==null?void 0:n.current)==null?void 0:l.cursor)==null||s.setStyle({borderStyle:"solid"})),We==="drag"&&((E=(p=n==null?void 0:n.current)==null?void 0:p.cursor)==null||E.setStyle({borderColor:"transparent"}));const ie={},le=[],se={},Ft=(d=D.current)==null?void 0:d.filter(h=>h.id!==t.id),Wt=(M=(P=(v=n.current)==null?void 0:v.regions)==null?void 0:P.list)!=null?M:{};Ft.forEach(h=>{var $e,He;const{element:ae}=($e=Wt[h.id])!=null?$e:{},{start:Ht,end:Ut}=h;if(ae){const{x:Ue,width:Xt}=((He=ae.getBoundingClientRect)==null?void 0:He.call(ae))||{},Zt=Ue+Xt;[Ue,Zt].forEach((ue,qt)=>{le.includes(ue)||(le.push(ue),se[ue]=qt===0?Ht:Ut)})}});const{x:ze,width:zt}=((T=(y=t.element).getBoundingClientRect)==null?void 0:T.call(y))||{},$t=ze+zt;le.forEach(h=>{Math.abs(Ve(h,ze))<5&&(ie.start=se[h]),Math.abs(Ve(h,$t))<5&&(ie.end=se[h])}),vt(ie),Me({id:t.id}),Q(!0)}),e.on("region-update-end",t=>{wt(t)}),e.on("region-contextmenu",(t,o)=>{if(!S){if(o.preventDefault(),o.stopPropagation(),_r(o)){re(t.id);return}m({id:t.id,playImmediately:!0})}}),e.on("region-click",(t,o,l)=>{if(!S){if(o.preventDefault(),o.stopPropagation(),c.current.combined){Et(t);return}if(c.current.segment){ht(t,l);return}m({id:t.id,playImmediately:!0})}}),e.on("region-mousemove",Pt),n.current=e},At=q?i.createElement(Jt,null):i.createElement(Qt,null),ke=e=>e?`${parseFloat((e/N*100).toFixed(4))}%`:"0%",Ie=ke(C),jt=ke(he),w=()=>{if(!ge)return n==null?void 0:n.current},xt=()=>{var e;(e=w())==null||e.skipForward(tt)},Dt=()=>{var e;(e=w())==null||e.skipBackward(tt)},B=()=>{var e;(e=w())==null||e.playPause(),m({})},Be=e=>{var r;switch(e.keyCode){case X.Right:xt();break;case X.Left:Dt();break;case X.Space:e.preventDefault(),B();break;case X.Delete:if(!S){const{id:t}=((r=c.current)==null?void 0:r.selectedRegion)||{};t&&re(t)}break}},Mt=e=>{ne(e)},Le=Vt.throttle(Mt,50);let oe=!1;const Oe=()=>{oe&&(B(),oe=!1),document.removeEventListener("mousemove",Le),document.removeEventListener("mouseup",Oe)},kt=e=>{ne(e),q&&(oe=!0,B()),document.addEventListener("mousemove",Le),document.addEventListener("mouseup",Oe)},It=()=>{xe()};A(()=>(Tt(),()=>{var e;(e=n==null?void 0:n.current)==null||e.destroy(),n.current=null,_.unbindAll("setCurrentTimeByPosition"),_.unbindAll("clearRegions"),_.unbindAll("removeRegionById"),_.unbindAll("setSelectedRegion")}),[]);const Bt=e=>{var r,t,o;(r=w())==null||r.playPause(),(t=w())==null||t.setPlaybackRate(e),(o=w())==null||o.playPause()};A(()=>(document.addEventListener("keydown",Be),()=>{document.removeEventListener("keydown",Be)})),A(()=>{m({}),xe()},[O]);const Ne=e=>{var r,t,o,l;if((n==null?void 0:n.current)&&(R==null?void 0:R.current)){const s=(t=(r=n==null?void 0:n.current)==null?void 0:r.getDuration())!=null?t:0,p=(o=R==null?void 0:R.current)==null?void 0:o.getBoundingClientRect();let d=(e.clientX-p.left)/(((l=R==null?void 0:R.current)==null?void 0:l.clientWidth)||0)*s;return d>s&&(d=s),d}return 0},ne=e=>{var r;const t=Ne(e);(r=n==null?void 0:n.current)==null||r.skip(t-Ee.current),V(t)},Lt=e=>{pt(Ne(e))},Ot=N?Math.max(N-C,0):0,Nt=(u==null?void 0:u.toolName)!==et.Empty&&(u==null?void 0:u.isEdit)!==!0&&(lt==="remark"||S),Fe=i.createElement("div",{className:b.audioPlayer},mt&&!it&&i.createElement(nr,{fileTypeName:"\u97F3\u9891",ignoreOffsetY:!0,reloadImage:It,backgroundColor:"#ffffffbb"}),i.createElement(Pr,{getRegionInstanceById:I,clipping:J}),i.createElement(wr,{container:G.current}),i.createElement(Tr,{segmentTimeTip:St}),i.createElement("div",{className:b.waveformContainer,ref:G},i.createElement("div",{id:"waveform",style:{width:`${F*100}%`},className:$({[b.waveform]:!0,"bee-audio-combined":c.current.combined,"bee-audio-clip":c.current.clipConfigurable})},ot&&i.createElement(or,{isAudio:!0}),i.createElement("div",{ref:R,className:b.progress,onMouseDown:kt,onMouseMove:Lt},i.createElement("div",{className:$({[b.radioTooltip]:!0}),style:{left:Ie}},qe(C)),i.createElement("div",{className:$({[b.radioTooltip]:!0,[b.mouseTooltip]:!0}),style:{left:jt}},qe(he)),i.createElement(hr,{playPercentage:Ie})),Nt&&(me==null?void 0:me({currentTime:C,remainingTime:Ot,audioPlayer:w()})))),i.createElement("div",{className:b.controlBar},i.createElement(rr,{type:"link",icon:At,onClick:()=>{B()},className:$({[b.playButton]:!0,[b.playButtonDisabled]:ge})}),i.createElement("span",{className:b.time},`${Ke(C,"ss.SSS")} / -${Ke(N-C,"ss.SSS")}`),i.createElement(ir,{playerType:lr.Audio,onChange:e=>{Bt(e)}}),i.createElement(cr,{onChange:e=>{Te(e)},zoom:F}),i.createElement(dr,{EventBus:_})));return u?i.createElement(rt.Provider,{value:u},Fe,x.map(e=>{const{id:r}=e,t=document.querySelector(`[data-id=${r}]`);return t?i.createElement(mr,{el:t,key:r,region:e,edgeAdsorption:Pe,clipping:J,zoom:F,instance:I(r)}):null}),i.createElement(Ar,{footer:ct})):Fe};export{Ir as AudioPlayer,rt as AudioPlayerContext};
|
|
1
|
+
import i,{useState as g,useRef as U,useMemo as ar,useEffect as P}from"react";import{getWebPcm2WavBase64 as ur}from"../audioAnnotate/utils/getWebPcm2Wac.js";import cr,{debounce as dr,sortBy as mr}from"lodash";import{PauseOutlined as fr,CaretRightOutlined as pr}from"@ant-design/icons";import{cKeyCode as vr,cTool as gr,EventBus as E,TagUtils as br}from"@labelbee/lb-annotation";import{i18n as Je}from"@labelbee/lb-utils";import{Button as yr}from"antd";import _r from"../invalidPage/index.js";import Er from"../imageError/index.js";import{classnames as V}from"../../utils/index.js";import Sr,{EPlayerType as hr}from"../videoPlayer/components/SpeedController/index.js";import Rr from"@labelbee/wavesurfer";import Pr from"@labelbee/wavesurfer/dist/plugin/wavesurfer.regions.js";import Cr from"@labelbee/wavesurfer/dist/plugin/wavesurfer.cursor.js";import Tr,{audioZoomInfo as de}from"./zoomSlider/index.js";import wr from"./labelDisplayToggle/index.js";import Ar from"./clipRegion/index.js";import{useAudioClipStore as jr}from"../audioAnnotate/audioContext/index.js";import{useLatest as X,useUpdate as xr,useDeepCompareEffect as Qe,useThrottleFn as et}from"ahooks";import Dr from"./useAudioScroll/index.js";import y from"./index.module.scss.js";import{getAttributeColor as Lr,formatTime as tt,timeFormat as rt,dispatchResizeEvent as Ir,precisionMinus as nt,isDoubleClick as Mr,getCanMoveRange as kr}from"../../utils/audio.js";import Br from"./progressDot/index.js";import Or from"./clipTip/index.js";import Wr from"./useSwitchHotkey/index.js";import Nr from"./useAudioCombine/index.js";import zr from"./useAudioSegment/index.js";import Fr from"./combineTip/index.js";import $r from"./segmentTip/index.js";import Hr from"../../views/MainView/toolFooter/index.js";import{decimalReserved as Z}from"../videoPlayer/utils.js";import{I18nextProvider as Ur}from"react-i18next";import Vr from"../../hooks/useSize.js";var Xr=Object.defineProperty,Zr=Object.defineProperties,qr=Object.getOwnPropertyDescriptors,ot=Object.getOwnPropertySymbols,Kr=Object.prototype.hasOwnProperty,Gr=Object.prototype.propertyIsEnumerable,it=(f,u,d)=>u in f?Xr(f,u,{enumerable:!0,configurable:!0,writable:!0,value:d}):f[u]=d,me=(f,u)=>{for(var d in u||(u={}))Kr.call(u,d)&&it(f,d,u[d]);if(ot)for(var d of ot(u))Gr.call(u,d)&&it(f,d,u[d]);return f},lt=(f,u)=>Zr(f,qr(u));const{EToolName:st}=gr,q=vr.default,at=.1,ut=i.createContext({count:0,isEdit:!1,toolName:st.Empty,imgIndex:0}),ct=({fileData:f={},onLoaded:u,context:d,invalid:dt,height:mt,hideError:ft,onError:fe,updateRegion:L,removeRegion:$,regions:A=[],activeToolPanel:pt,clipConfigurable:vt,clipTextConfigurable:pe,clipAttributeList:gt,clipAttributeConfigurable:ve,secondaryAttributeConfigurable:bt,subAttributeList:yt,isCheck:S,hoverRegionId:K,footer:_t,drawLayerSlot:ge,clipTextList:Et,lang:be})=>{var ye,_e;const{url:H,path:Ee}=f,[G,Y]=g(!1),[Se,he]=g(!1),[j,St]=g(0),[ht,Re]=g(!1),[C,Pe]=g(0),o=U(null),x=U(null),Ce=U(j),J=e=>{Ce.current=e,St(e)},[Te,Rt]=g(0),[k,Pt]=g(de.defaultValue),h=U(null),[we,Ct]=g({}),{audioClipState:Q,setAudioClipState:B}=jr(),[ee,te]=g(!1),c=X(Q),Ae=X(we);X(G);const I=X(A),je=xr(),[xe,Tt]=g([]),[De,wt]=g({}),[At,Le]=g(""),[Ie,jt]=g({start:0,end:0}),xt=Vr(h),Dt=ar(()=>A.filter(e=>{const{start:t,end:r}=Ie;return e.start>=t&&e.start<=r||e.end>=t&&e.end<=r||e.id===At}),[A,Ie]),Lt=dr(()=>{E.emit("audioZoom")},500),Me=e=>{e<de.min||e>de.max||(Pt(e),Ir(),Lt())};Dr({container:h.current,target:document.querySelector(`[data-id=${(_e=(ye=c.current)==null?void 0:ye.selectedRegion)==null?void 0:_e.id}]`),clipping:ee,zoom:k,zoomHandler:Me});const O=()=>{let e=I.current;const{attributeLockList:t}=c.current;t.length&&(e=e.filter(r=>t.includes(r.attribute))),ne(),e.forEach(r=>{var n;(n=o.current)==null||n.addRegion(lt(me({},r),{drag:!S,resize:!S,color:"rgba(0, 0, 0, 0)"}))}),je()},p=e=>{var t,r,n,l,a,v,b;const{id:s,loop:m=!0,playImmediately:_=!1,isLoopStatus:z}=e,M=!1;if(s){const D=(n=(r=(t=o.current)==null?void 0:t.regions)==null?void 0:r.list)!=null?n:{};Object.entries(D).forEach(([,w])=>{const{id:F}=w;s===F?w.select():w.cancelSelect()}),B({selectedRegion:{id:s,loop:M},selectedAttribute:(v=(a=(l=I.current)==null?void 0:l.find(w=>w.id===s))==null?void 0:a.attribute)!=null?v:""}),_&&((b=W(s))==null||b.play())}else B({selectedRegion:{}})},{combineInstance:It}=Nr({waveRef:o,sortByStartRegions:xe,regionMap:De,updateRegion:L,removeRegion:$,generateRegions:O,setSelectedRegion:p}),{segmentInstance:Mt,onRegionMouseMove:kt,segmentTimeTip:Bt}=zr({waveRef:o,regionMap:De,updateRegion:L,removeRegion:$,generateRegions:O,setSelectedRegion:p}),ke={clipTextConfigurable:pe,clipAttributeList:gt,clipAttributeConfigurable:ve,clipConfigurable:vt,secondaryAttributeConfigurable:bt,subAttributeList:yt,clipTextList:Et};P(()=>{var e;be&&((e=Je)==null||e.changeLanguage(be))},[]),P(()=>{B({selectedAttribute:""})},[ve]),P(()=>{re()},[Q.selectedAttribute]),P(()=>{O()},[Q.attributeLockList]),Qe(()=>{B(ke),setTimeout(()=>{Be()})},[ke]),Qe(()=>{Tt(mr(A,["start"])),wt(A.reduce((e,t)=>{const{id:r}=t;return lt(me({},e),{[r]:t})},{})),S&&O()},[A]),P(()=>{p(K?{id:K,loop:!1,playImmediately:!0}:{})},[K]);const Be=()=>{var e,t;c.current.clipConfigurable?(!S&&o.current&&((e=o.current)==null||e.enableDragSelection({slop:5})),O()):((t=o.current)==null||t.disableDragSelection(),ne()),re()},re=()=>{var e,t,r,n,l;let a="";c.current.clipConfigurable?a=Lr(c.current.selectedAttribute,(e=c.current.clipAttributeList)!=null?e:[]):a="transparent",((r=(t=o==null?void 0:o.current)==null?void 0:t.cursor)==null?void 0:r.cursor)&&((l=(n=o==null?void 0:o.current)==null?void 0:n.cursor)==null||l.setStyle({border:`2px dashed ${a}`}))},W=e=>{var t,r,n;return((n=(r=(t=o.current)==null?void 0:t.regions)==null?void 0:r.list)!=null?n:{})[e]},Oe=()=>{var e,t;if(H){const r=((t=(e=Ee==null?void 0:Ee.split("."))==null?void 0:e.pop())==null?void 0:t.toLowerCase())==="pcm";Re(!1),r?ur(H).then(n=>{We(n)}):We(H)}},We=e=>{var t;e&&(he(!0),J(0),Pe(0),(t=o==null?void 0:o.current)==null||t.load(e))},ne=()=>{var e;(e=o.current)==null||e.clearRegions()},oe=e=>{const t=W(e);t&&(te(!1),t==null||t.remove(),$==null||$(e),p({}))},{run:Ne}=et(p,{wait:100});Wr({sortByStartRegions:xe,setSelectedRegion:p});const Ot=e=>{const{start:t,end:r}=Ae.current;return(t||r)&&e.update(Ae.current),e},Wt=({action:e,id:t,eventDownTime:r})=>{var n,l;if(!c.current.clipConfigurable)return;t&&p({id:t});const a=W((t!=null?t:(n=c.current.selectedRegion)==null?void 0:n.id)||""),v=[];(e==="create"?I.current:(l=I.current)==null?void 0:l.filter(m=>m.id!==a.id)).forEach(m=>{const{start:_,end:z,attribute:M}=m;M===c.current.selectedAttribute&&[_,z].forEach(D=>{v.includes(D)||v.push(D)})});const s=kr(v.sort((m,_)=>m-_),r);o.current.range=s},Nt=e=>{re(),setTimeout(()=>{te(!1)});const t=Ot(e),{id:r,start:n,end:l}=t;p({id:r,playImmediately:!0});const a={id:r,start:Z(n,3),end:Z(l,3)};L==null||L(a),je()},zt=()=>{const e=Rr.create({container:"#waveform",waveColor:"#999",progressColor:"#999",height:mt||245,normalize:!0,cursorWidth:2,cursorColor:"white",responsive:0,hideScrollbar:!0,plugins:[Pr.create({regions:A,dragSelection:{slop:5},canMove:!1}),Cr.create({opacity:1,customStyle:{border:"2px dashed transparent"}})]}),t=()=>{var r;J(((r=o==null?void 0:o.current)==null?void 0:r.getCurrentTime())||0)};e.on("ready",()=>{var r;const n=((r=o==null?void 0:o.current)==null?void 0:r.getDuration())||0;Pe(n),t(),u==null||u({duration:Math.round(n)}),he(!1),N(),E.on("setCurrentTimeByPosition",le),E.on("clearRegions",ne),E.on("removeRegionById",oe),E.on("setSelectedRegion",Ne),e.on("regions-eventDown",Wt),Be()}),e.on("audioprocess",()=>{t()}),e.on("play",()=>{Y(!0)}),e.on("pause",()=>{Y(!1)}),e.on("finish",()=>{Y(!1)}),e.on("seek",()=>{t()}),e.on("error",()=>{Re(!0),u==null||u({hasError:!0}),fe==null||fe()}),e.on("region-created",r=>{var n;const{id:l,start:a,end:v}=r;if(I.current.find(s=>s.id===l))return;Le(l);const b={id:l,start:Z(a,3),end:Z(v,3),attribute:c.current.selectedAttribute,text:""};if(c.current.secondaryAttributeConfigurable){const s=br.getDefaultResultByConfig((n=c.current.subAttributeList)!=null?n:[]);b.subAttribute=s!=null?s:{}}pe&&c.current.clipTextList.forEach((m,_)=>{_===0?Object.assign(b,{text:m==null?void 0:m.default}):Object.assign(b,{[m.key]:m==null?void 0:m.default})}),L==null||L(b)}),e.on("region-updated",(r,n)=>{var l,a,v,b,s,m,_,z,M,D;const w=n==null?void 0:n.action;B({combined:!1,segment:!1}),w==="resize"&&((a=(l=o==null?void 0:o.current)==null?void 0:l.cursor)==null||a.setStyle({borderStyle:"solid"})),w==="drag"&&((b=(v=o==null?void 0:o.current)==null?void 0:v.cursor)==null||b.setStyle({borderColor:"transparent"}));const F={},se=[],ae={},Qt=(s=I.current)==null?void 0:s.filter(R=>R.id!==r.id),er=(z=(_=(m=o.current)==null?void 0:m.regions)==null?void 0:_.list)!=null?z:{};Qt.forEach(R=>{var Ke,Ge;const{element:ue}=(Ke=er[R.id])!=null?Ke:{},{start:nr,end:or}=R;if(ue){const{x:Ye,width:ir}=((Ge=ue.getBoundingClientRect)==null?void 0:Ge.call(ue))||{},lr=Ye+ir;[Ye,lr].forEach((ce,sr)=>{se.includes(ce)||(se.push(ce),ae[ce]=sr===0?nr:or)})}});const{x:qe,width:tr}=((D=(M=r.element).getBoundingClientRect)==null?void 0:D.call(M))||{},rr=qe+tr;se.forEach(R=>{Math.abs(nt(R,qe))<5&&(F.start=ae[R]),Math.abs(nt(R,rr))<5&&(F.end=ae[R])}),Ct(F),Ne({id:r.id}),te(!0)}),e.on("region-update-end",r=>{Nt(r),Le("")}),e.on("region-contextmenu",(r,n)=>{if(!S){if(n.preventDefault(),n.stopPropagation(),Mr(n)){oe(r.id);return}p({id:r.id,playImmediately:!0})}}),e.on("region-click",(r,n,l)=>{if(!S){if(n.preventDefault(),n.stopPropagation(),c.current.combined){It(r);return}if(c.current.segment){Mt(r,l);return}p({id:r.id,playImmediately:!0})}}),e.on("region-mousemove",kt),o.current=e},Ft=G?i.createElement(fr,null):i.createElement(pr,null),ze=e=>e?`${parseFloat((e/C*100).toFixed(4))}%`:"0%",Fe=ze(j),$t=ze(Te),T=()=>{if(!Se)return o==null?void 0:o.current},Ht=()=>{var e;(e=T())==null||e.skipForward(at)},Ut=()=>{var e;(e=T())==null||e.skipBackward(at)},N=()=>{var e;(e=T())==null||e.playPause(),p({})},$e=e=>{var t;switch(e.keyCode){case q.Right:Ht();break;case q.Left:Ut();break;case q.Space:e.preventDefault(),N();break;case q.Delete:if(!S){const{id:r}=((t=c.current)==null?void 0:t.selectedRegion)||{};r&&oe(r)}break}},Vt=e=>{le(e)},He=cr.throttle(Vt,50);let ie=!1;const Ue=()=>{ie&&(N(),ie=!1),document.removeEventListener("mousemove",He),document.removeEventListener("mouseup",Ue)},Xt=e=>{le(e),G&&(ie=!0,N()),document.addEventListener("mousemove",He),document.addEventListener("mouseup",Ue)},Zt=()=>{Oe()};P(()=>(zt(),()=>{var e;(e=o==null?void 0:o.current)==null||e.destroy(),o.current=null,E.unbindAll("setCurrentTimeByPosition"),E.unbindAll("clearRegions"),E.unbindAll("removeRegionById"),E.unbindAll("setSelectedRegion")}),[]);const qt=e=>{var t,r,n;(t=T())==null||t.playPause(),(r=T())==null||r.setPlaybackRate(e),(n=T())==null||n.playPause()};P(()=>(document.addEventListener("keydown",$e),()=>{document.removeEventListener("keydown",$e)})),P(()=>{p({}),Oe()},[H]),P(()=>{Ve()},[xt,C,k]);const Kt=()=>{if(h.current&&C){const e=h.current.scrollLeft,t=h.current.clientWidth,r=e/h.current.scrollWidth*C,n=(e+t)/h.current.scrollWidth*C;jt({start:r,end:n})}},{run:Ve}=et(Kt,{wait:300}),Xe=e=>{var t,r,n,l;if((o==null?void 0:o.current)&&(x==null?void 0:x.current)){const a=(r=(t=o==null?void 0:o.current)==null?void 0:t.getDuration())!=null?r:0,v=(n=x==null?void 0:x.current)==null?void 0:n.getBoundingClientRect();let s=(e.clientX-v.left)/(((l=x==null?void 0:x.current)==null?void 0:l.clientWidth)||0)*a;return s>a&&(s=a),s}return 0},le=e=>{var t;const r=Xe(e);(t=o==null?void 0:o.current)==null||t.skip(r-Ce.current),J(r)},Gt=e=>{Rt(Xe(e))},Yt=C?Math.max(C-j,0):0,Jt=(d==null?void 0:d.toolName)!==st.Empty&&(d==null?void 0:d.isEdit)!==!0&&(pt==="remark"||S),Ze=i.createElement("div",{className:y.audioPlayer},ht&&!ft&&i.createElement(Er,{fileTypeName:"\u97F3\u9891",ignoreOffsetY:!0,reloadImage:Zt,backgroundColor:"#ffffffbb"}),i.createElement(Or,{getRegionInstanceById:W,clipping:ee}),i.createElement(Fr,{container:h.current}),i.createElement($r,{segmentTimeTip:Bt}),i.createElement("div",{className:y.waveformContainer,ref:h,onScroll:()=>Ve()},i.createElement("div",{id:"waveform",style:{width:`${k*100}%`},className:V({[y.waveform]:!0,"bee-audio-combined":c.current.combined,"bee-audio-clip":c.current.clipConfigurable})},dt&&i.createElement(_r,{isAudio:!0}),i.createElement("div",{ref:x,className:y.progress,onMouseDown:Xt,onMouseMove:Gt},i.createElement("div",{className:V({[y.radioTooltip]:!0}),style:{left:Fe}},tt(j)),i.createElement("div",{className:V({[y.radioTooltip]:!0,[y.mouseTooltip]:!0}),style:{left:$t}},tt(Te)),i.createElement(Br,{playPercentage:Fe})),Jt&&(ge==null?void 0:ge({currentTime:j,remainingTime:Yt,audioPlayer:T()})))),i.createElement("div",{className:y.controlBar},i.createElement(yr,{type:"link",icon:Ft,onClick:()=>{N()},className:V({[y.playButton]:!0,[y.playButtonDisabled]:Se})}),i.createElement("span",{className:y.time},`${rt(j,"ss.SSS")} / -${rt(C-j,"ss.SSS")}`),i.createElement(Sr,{playerType:hr.Audio,onChange:e=>{qt(e)}}),i.createElement(Tr,{onChange:e=>{var t;(t=T())==null||t.pause(),Me(e)},zoom:k}),i.createElement(wr,{EventBus:E})));return d?i.createElement(ut.Provider,{value:d},Ze,Dt.map(e=>{const{id:t}=e,r=document.querySelector(`[data-id=${t}]`);return r?i.createElement(Ar,{el:r,key:t,region:e,edgeAdsorption:we,clipping:ee,zoom:k,instance:W(t),isCheck:S}):null}),i.createElement(Hr,{footer:_t})):Ze},Yr=f=>i.createElement(Ur,{i18n:Je},i.createElement(ct,me({},f)));export{ct as AudioPlayer,ut as AudioPlayerContext,Yr as WrapAudioPlayer};
|