@labelbee/lb-components 1.23.0-alpha.14 → 1.23.0-alpha.140

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.
Files changed (325) hide show
  1. package/dist/App.js +1 -1
  2. package/dist/_virtual/2DViewWorker.js +1 -0
  3. package/dist/_virtual/highlightSegmentWorker.js +1 -1
  4. package/dist/assets/annotation/icon_link.svg.js +1 -0
  5. package/dist/assets/annotation/icon_unlink.svg.js +1 -0
  6. package/dist/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
  7. package/dist/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
  8. package/dist/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
  9. package/dist/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
  10. package/dist/assets/icons/ad33251.svg +26 -0
  11. package/dist/components/AnnotationView/hooks/useFilterAnnotations.js +1 -0
  12. package/dist/components/AnnotationView/index.js +1 -1
  13. package/dist/components/DynamicResizer/DynamicResizer.js +1 -0
  14. package/dist/components/DynamicResizer/assets/bottomToZero.svg.js +1 -0
  15. package/dist/components/DynamicResizer/assets/divider.svg.js +1 -0
  16. package/dist/components/DynamicResizer/assets/topToZero.svg.js +1 -0
  17. package/dist/components/DynamicResizer/hooks/useDrag.js +1 -0
  18. package/dist/components/DynamicResizer/hooks/useUpdateHeight.js +1 -0
  19. package/dist/components/DynamicResizer/index.js +1 -0
  20. package/dist/components/LLMMultiWheelView/dialogView/index.js +1 -0
  21. package/dist/components/LLMMultiWheelView/index.js +1 -0
  22. package/dist/components/LLMMultiWheelView/sidebar/index.js +1 -0
  23. package/dist/components/LLMToolView/index.js +1 -1
  24. package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
  25. package/dist/components/LLMToolView/questionView/components/imgView/index.js +1 -1
  26. package/dist/components/LLMToolView/questionView/index.js +1 -1
  27. package/dist/components/LLMToolView/sidebar/components/answerSort/index.js +1 -1
  28. package/dist/components/LLMToolView/sidebar/components/modelAnswerSort/index.js +1 -0
  29. package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
  30. package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
  31. package/dist/components/LLMToolView/sidebar/index.js +1 -1
  32. package/dist/components/attributeList/index.js +1 -1
  33. package/dist/components/audioAnnotate/audioContext/index.js +1 -1
  34. package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +2 -1
  35. package/dist/components/audioAnnotate/index.js +1 -1
  36. package/dist/components/audioAnnotate/textInput/index.js +1 -1
  37. package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -1
  38. package/dist/components/audioAnnotate/utils/dataTransform.js +1 -0
  39. package/dist/components/audioPlayer/clipRegion/index.js +1 -1
  40. package/dist/components/audioPlayer/index.js +1 -1
  41. package/dist/components/audioPlayer/useAudioCombine/index.js +3 -2
  42. package/dist/components/audioPlayer/useAudioScroll/index.js +1 -1
  43. package/dist/components/audioPlayer/useAudioSegment/index.js +1 -1
  44. package/dist/components/audioPlayer/zoomSlider/index.js +1 -1
  45. package/dist/components/longText/index.js +1 -1
  46. package/dist/components/markdownView/index.js +1 -1
  47. package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
  48. package/dist/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
  49. package/dist/components/pointCloud2DRectOperationView/util.js +1 -0
  50. package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
  51. package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
  52. package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
  53. package/dist/components/pointCloudView/PointCloudBackView.js +1 -1
  54. package/dist/components/pointCloudView/PointCloudContext.js +1 -1
  55. package/dist/components/pointCloudView/PointCloudInfos.js +1 -1
  56. package/dist/components/pointCloudView/PointCloudLayout.js +1 -1
  57. package/dist/components/pointCloudView/PointCloudListener.js +1 -1
  58. package/dist/components/pointCloudView/PointCloudSegment2DView.js +1 -1
  59. package/dist/components/pointCloudView/PointCloudSegmentListener.js +1 -1
  60. package/dist/components/pointCloudView/PointCloudSideView.js +1 -1
  61. package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
  62. package/dist/components/pointCloudView/components/HighlightVisible/index.js +1 -1
  63. package/dist/components/pointCloudView/hooks/useBoxes.js +1 -1
  64. package/dist/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
  65. package/dist/components/pointCloudView/hooks/useHighlight.js +1 -1
  66. package/dist/components/pointCloudView/hooks/useHistory.js +1 -1
  67. package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  68. package/dist/components/pointCloudView/hooks/usePolygon.js +1 -1
  69. package/dist/components/pointCloudView/hooks/useRotate.js +1 -1
  70. package/dist/components/pointCloudView/hooks/useRotateEdge.js +1 -0
  71. package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -1
  72. package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
  73. package/dist/components/pointCloudView/hooks/useTimeoutFunc.js +1 -0
  74. package/dist/components/pointCloudView/hooks/useUpdatePointCloudColor.js +1 -0
  75. package/dist/components/pointCloudView/hooks/useWindowKeydownListener.js +1 -0
  76. package/dist/components/pointCloudView/index.js +1 -1
  77. package/dist/components/pointCloudView/utils/event-polyfill.js +1 -0
  78. package/dist/components/pointCloudView/utils/map.js +1 -0
  79. package/dist/components/predictTracking/predictTrackingIcon/index.js +1 -1
  80. package/dist/components/predictTracking/previewResult/index.js +1 -1
  81. package/dist/components/subAttributeList/index.js +1 -0
  82. package/dist/components/videoAnnotate/videoClipTool/index.js +1 -1
  83. package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
  84. package/dist/data/enums/ToolType.js +1 -1
  85. package/dist/hooks/useToolStyle.js +1 -0
  86. package/dist/index.css +205 -16
  87. package/dist/index.js +1 -1
  88. package/dist/store/Actions.js +1 -1
  89. package/dist/store/LLMMultiWheel/index.js +1 -0
  90. package/dist/store/annotatedBox/index.js +1 -1
  91. package/dist/store/annotation/actionCreators.js +1 -1
  92. package/dist/store/annotation/reducer.js +1 -1
  93. package/dist/store/ctx.js +1 -1
  94. package/dist/store/toolConfig/baseToolConfig.js +1 -0
  95. package/dist/store/toolConfig/index.js +1 -0
  96. package/dist/store/toolConfig/pointCloudToolConfig.js +1 -0
  97. package/dist/types/App.d.ts +6 -1
  98. package/dist/types/components/AnnotationView/hooks/useFilterAnnotations.d.ts +2 -0
  99. package/dist/types/components/AnnotationView/index.d.ts +10 -0
  100. package/dist/types/components/DynamicResizer/DynamicResizer.d.ts +5 -0
  101. package/dist/types/components/DynamicResizer/hooks/useDrag.d.ts +12 -0
  102. package/dist/types/components/DynamicResizer/hooks/useUpdateHeight.d.ts +23 -0
  103. package/dist/types/components/DynamicResizer/index.d.ts +2 -0
  104. package/dist/types/components/DynamicResizer/types/interface.d.ts +17 -0
  105. package/dist/types/components/LLMMultiWheelView/dialogView/index.d.ts +15 -0
  106. package/dist/types/components/LLMMultiWheelView/index.d.ts +21 -0
  107. package/dist/types/components/LLMMultiWheelView/sidebar/index.d.ts +8 -0
  108. package/dist/types/components/LLMMultiWheelView/types.d.ts +62 -0
  109. package/dist/types/components/LLMToolView/questionView/components/header/index.d.ts +15 -0
  110. package/dist/types/components/LLMToolView/questionView/index.d.ts +7 -0
  111. package/dist/types/components/LLMToolView/sidebar/components/answerSort/index.d.ts +3 -0
  112. package/dist/types/components/LLMToolView/sidebar/components/modelAnswerSort/index.d.ts +30 -0
  113. package/dist/types/components/LLMToolView/sidebar/components/textInputBox/index.d.ts +2 -2
  114. package/dist/types/components/LLMToolView/sidebar/index.d.ts +10 -0
  115. package/dist/types/components/LLMToolView/types.d.ts +6 -2
  116. package/dist/types/components/LLMToolView/utils/data.d.ts +1 -0
  117. package/dist/types/components/audioAnnotate/audioContext/index.d.ts +10 -2
  118. package/dist/types/components/audioAnnotate/textInput/index.d.ts +1 -0
  119. package/dist/types/components/audioAnnotate/utils/dataTransform.d.ts +9 -0
  120. package/dist/types/components/audioPlayer/clipRegion/index.d.ts +1 -0
  121. package/dist/types/components/audioPlayer/index.d.ts +28 -21
  122. package/dist/types/components/audioPlayer/zoomSlider/index.d.ts +1 -0
  123. package/dist/types/components/longText/index.d.ts +1 -0
  124. package/dist/types/components/pointCloud2DRectOperationView/index.d.ts +1 -0
  125. package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +2 -0
  126. package/dist/types/components/pointCloud2DRectOperationView/util.d.ts +8 -0
  127. package/dist/types/components/pointCloudView/2DViewWorker.d.ts +1 -0
  128. package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +1 -0
  129. package/dist/types/components/pointCloudView/PointCloudContext.d.ts +23 -4
  130. package/dist/types/components/pointCloudView/PointCloudLayout.d.ts +1 -0
  131. package/dist/types/components/pointCloudView/PointCloudListener.d.ts +1 -0
  132. package/dist/types/components/pointCloudView/components/HighlightVisible/index.d.ts +2 -1
  133. package/dist/types/components/pointCloudView/hooks/useBoxes.d.ts +5 -3
  134. package/dist/types/components/pointCloudView/hooks/useDataLinkSwitch.d.ts +19 -0
  135. package/dist/types/components/pointCloudView/hooks/useHighlight.d.ts +1 -1
  136. package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +31 -1
  137. package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +9 -0
  138. package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +3 -2
  139. package/dist/types/components/pointCloudView/hooks/useTimeoutFunc.d.ts +6 -0
  140. package/dist/types/components/pointCloudView/hooks/useUpdatePointCloudColor.d.ts +4 -0
  141. package/dist/types/components/pointCloudView/hooks/useWindowKeydownListener.d.ts +16 -0
  142. package/dist/types/components/pointCloudView/index.d.ts +1 -0
  143. package/dist/types/components/pointCloudView/utils/event-polyfill.d.ts +8 -0
  144. package/dist/types/components/pointCloudView/utils/map.d.ts +11 -0
  145. package/dist/types/components/subAttributeList/index.d.ts +10 -0
  146. package/dist/types/components/videoAnnotate/index.d.ts +2 -1
  147. package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +2 -1
  148. package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
  149. package/dist/types/data/enums/ToolType.d.ts +2 -1
  150. package/dist/types/hooks/useToolStyle.d.ts +30 -0
  151. package/dist/types/index.d.ts +9 -2
  152. package/dist/types/store/Actions.d.ts +1 -0
  153. package/dist/types/store/LLMMultiWheel/index.d.ts +15 -0
  154. package/dist/types/store/annotatedBox/index.d.ts +2 -0
  155. package/dist/types/store/annotation/actionCreators.d.ts +4 -3
  156. package/dist/types/store/annotation/reducer.d.ts +1 -0
  157. package/dist/types/store/annotation/types.d.ts +9 -2
  158. package/dist/types/store/ctx.d.ts +7 -0
  159. package/dist/types/store/toolConfig/baseToolConfig.d.ts +4 -0
  160. package/dist/types/store/toolConfig/index.d.ts +3 -0
  161. package/dist/types/store/toolConfig/pointCloudToolConfig.d.ts +4 -0
  162. package/dist/types/store/toolConfig/types.d.ts +10 -0
  163. package/dist/types/utils/AnnotationDataUtils.d.ts +58 -1
  164. package/dist/types/utils/ToolPointCloudBoxRenderHelper.d.ts +24 -0
  165. package/dist/types/utils/data.d.ts +0 -2
  166. package/dist/types/utils/index.d.ts +27 -0
  167. package/dist/types/views/MainView/LLMMultiWheelLayout/index.d.ts +9 -0
  168. package/dist/types/views/MainView/sidebar/GeneralOperation/ActionsConfirm.d.ts +1 -0
  169. package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.d.ts +3 -0
  170. package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.d.ts +3 -0
  171. package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.d.ts +3 -0
  172. package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +1 -1
  173. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.d.ts +9 -0
  174. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.d.ts +3 -0
  175. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/index.d.ts +1 -0
  176. package/dist/types/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.d.ts +10 -2
  177. package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
  178. package/dist/types/views/MainView/toolHeader/StepSwitch/index.d.ts +1 -1
  179. package/dist/types/views/MainView/toolHeader/index.d.ts +1 -1
  180. package/dist/utils/AnnotationDataUtils.js +1 -1
  181. package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -0
  182. package/dist/utils/data.js +1 -1
  183. package/dist/utils/index.js +1 -1
  184. package/dist/views/MainView/LLMMultiWheelLayout/index.js +1 -0
  185. package/dist/views/MainView/index.js +1 -1
  186. package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
  187. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.js +1 -0
  188. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.module.scss.js +1 -0
  189. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
  190. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
  191. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.js +1 -0
  192. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.module.scss.js +1 -0
  193. package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  194. package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
  195. package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  196. package/dist/views/MainView/sidebar/index.js +1 -1
  197. package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
  198. package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
  199. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  200. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
  201. package/dist/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
  202. package/dist/views/MainView/toolFooter/index.js +1 -1
  203. package/dist/views/MainView/toolHeader/index.js +1 -1
  204. package/es/App.js +1 -1
  205. package/es/_virtual/2DViewWorker.js +1 -0
  206. package/es/_virtual/highlightSegmentWorker.js +1 -1
  207. package/es/assets/annotation/icon_link.svg.js +1 -0
  208. package/es/assets/annotation/icon_unlink.svg.js +1 -0
  209. package/es/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
  210. package/es/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
  211. package/es/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
  212. package/es/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
  213. package/es/components/AnnotationView/hooks/useFilterAnnotations.js +1 -0
  214. package/es/components/AnnotationView/index.js +1 -1
  215. package/es/components/DynamicResizer/DynamicResizer.js +1 -0
  216. package/es/components/DynamicResizer/assets/bottomToZero.svg.js +1 -0
  217. package/es/components/DynamicResizer/assets/divider.svg.js +1 -0
  218. package/es/components/DynamicResizer/assets/topToZero.svg.js +1 -0
  219. package/es/components/DynamicResizer/hooks/useDrag.js +1 -0
  220. package/es/components/DynamicResizer/hooks/useUpdateHeight.js +1 -0
  221. package/es/components/DynamicResizer/index.js +1 -0
  222. package/es/components/LLMMultiWheelView/dialogView/index.js +1 -0
  223. package/es/components/LLMMultiWheelView/index.js +1 -0
  224. package/es/components/LLMMultiWheelView/sidebar/index.js +1 -0
  225. package/es/components/LLMToolView/index.js +1 -1
  226. package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
  227. package/es/components/LLMToolView/questionView/components/imgView/index.js +1 -1
  228. package/es/components/LLMToolView/questionView/index.js +1 -1
  229. package/es/components/LLMToolView/sidebar/components/answerSort/index.js +1 -1
  230. package/es/components/LLMToolView/sidebar/components/modelAnswerSort/index.js +1 -0
  231. package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
  232. package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
  233. package/es/components/LLMToolView/sidebar/index.js +1 -1
  234. package/es/components/attributeList/index.js +1 -1
  235. package/es/components/audioAnnotate/audioContext/index.js +1 -1
  236. package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +2 -1
  237. package/es/components/audioAnnotate/index.js +1 -1
  238. package/es/components/audioAnnotate/textInput/index.js +1 -1
  239. package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -1
  240. package/es/components/audioAnnotate/utils/dataTransform.js +1 -0
  241. package/es/components/audioPlayer/clipRegion/index.js +1 -1
  242. package/es/components/audioPlayer/index.js +1 -1
  243. package/es/components/audioPlayer/useAudioCombine/index.js +3 -2
  244. package/es/components/audioPlayer/useAudioScroll/index.js +1 -1
  245. package/es/components/audioPlayer/useAudioSegment/index.js +1 -1
  246. package/es/components/audioPlayer/zoomSlider/index.js +1 -1
  247. package/es/components/longText/index.js +1 -1
  248. package/es/components/markdownView/index.js +1 -1
  249. package/es/components/pointCloud2DRectOperationView/index.js +1 -1
  250. package/es/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
  251. package/es/components/pointCloud2DRectOperationView/util.js +1 -0
  252. package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
  253. package/es/components/pointCloudView/PointCloud2DView.js +1 -1
  254. package/es/components/pointCloudView/PointCloud3DView.js +1 -1
  255. package/es/components/pointCloudView/PointCloudBackView.js +1 -1
  256. package/es/components/pointCloudView/PointCloudContext.js +1 -1
  257. package/es/components/pointCloudView/PointCloudInfos.js +1 -1
  258. package/es/components/pointCloudView/PointCloudLayout.js +1 -1
  259. package/es/components/pointCloudView/PointCloudListener.js +1 -1
  260. package/es/components/pointCloudView/PointCloudSegment2DView.js +1 -1
  261. package/es/components/pointCloudView/PointCloudSegmentListener.js +1 -1
  262. package/es/components/pointCloudView/PointCloudSideView.js +1 -1
  263. package/es/components/pointCloudView/PointCloudTopView.js +1 -1
  264. package/es/components/pointCloudView/components/HighlightVisible/index.js +1 -1
  265. package/es/components/pointCloudView/hooks/useBoxes.js +1 -1
  266. package/es/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
  267. package/es/components/pointCloudView/hooks/useHighlight.js +1 -1
  268. package/es/components/pointCloudView/hooks/useHistory.js +1 -1
  269. package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  270. package/es/components/pointCloudView/hooks/usePolygon.js +1 -1
  271. package/es/components/pointCloudView/hooks/useRotate.js +1 -1
  272. package/es/components/pointCloudView/hooks/useRotateEdge.js +1 -0
  273. package/es/components/pointCloudView/hooks/useSingleBox.js +1 -1
  274. package/es/components/pointCloudView/hooks/useStatus.js +1 -1
  275. package/es/components/pointCloudView/hooks/useTimeoutFunc.js +1 -0
  276. package/es/components/pointCloudView/hooks/useUpdatePointCloudColor.js +1 -0
  277. package/es/components/pointCloudView/hooks/useWindowKeydownListener.js +1 -0
  278. package/es/components/pointCloudView/index.js +1 -1
  279. package/es/components/pointCloudView/utils/event-polyfill.js +1 -0
  280. package/es/components/pointCloudView/utils/map.js +1 -0
  281. package/es/components/predictTracking/predictTrackingIcon/index.js +1 -1
  282. package/es/components/predictTracking/previewResult/index.js +1 -1
  283. package/es/components/subAttributeList/index.js +1 -0
  284. package/es/components/videoAnnotate/videoClipTool/index.js +1 -1
  285. package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
  286. package/es/data/enums/ToolType.js +1 -1
  287. package/es/hooks/useToolStyle.js +1 -0
  288. package/es/index.css +205 -16
  289. package/es/index.js +1 -1
  290. package/es/store/Actions.js +1 -1
  291. package/es/store/LLMMultiWheel/index.js +1 -0
  292. package/es/store/annotatedBox/index.js +1 -1
  293. package/es/store/annotation/actionCreators.js +1 -1
  294. package/es/store/annotation/reducer.js +1 -1
  295. package/es/store/ctx.js +1 -1
  296. package/es/store/toolConfig/baseToolConfig.js +1 -0
  297. package/es/store/toolConfig/index.js +1 -0
  298. package/es/store/toolConfig/pointCloudToolConfig.js +1 -0
  299. package/es/utils/AnnotationDataUtils.js +1 -1
  300. package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -0
  301. package/es/utils/data.js +1 -1
  302. package/es/utils/index.js +1 -1
  303. package/es/views/MainView/LLMMultiWheelLayout/index.js +1 -0
  304. package/es/views/MainView/index.js +1 -1
  305. package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
  306. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.js +1 -0
  307. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/firstFrameDataSwitch/index.module.scss.js +1 -0
  308. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
  309. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
  310. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.js +1 -0
  311. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/selectBoxVisibleSwitch/index.module.scss.js +1 -0
  312. package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  313. package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
  314. package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  315. package/es/views/MainView/sidebar/index.js +1 -1
  316. package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
  317. package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
  318. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  319. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
  320. package/es/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
  321. package/es/views/MainView/toolHeader/index.js +1 -1
  322. package/package.json +7 -4
  323. package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
  324. package/dist/assets/icons/9d70807.svg +0 -5
  325. 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("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIGM9T2JqZWN0LmRlZmluZVByb3BlcnR5LG89T2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyxsPU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHksZj1PYmplY3QucHJvdG90eXBlLnByb3BlcnR5SXNFbnVtZXJhYmxlLGE9KHIsZSx0KT0+ZSBpbiByP2MocixlLHtlbnVtZXJhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMCx3cml0YWJsZTohMCx2YWx1ZTp0fSk6cltlXT10LHU9KHIsZSk9Pntmb3IodmFyIHQgaW4gZXx8KGU9e30pKWwuY2FsbChlLHQpJiZhKHIsdCxlW3RdKTtpZihvKWZvcih2YXIgdCBvZiBvKGUpKWYuY2FsbChlLHQpJiZhKHIsdCxlW3RdKTtyZXR1cm4gcn07b25tZXNzYWdlPWZ1bmN0aW9uKGUpe2NvbnN0e2NhY2hlTWFwOnQsaW5kZXhlczpzLGRlZmF1bHRSR0JBOl99PWUuZGF0YSxkPXMubGVuZ3RoLHA9W107Zm9yKGxldCBuPTA7bjxkO249bisxKXtjb25zdCBpPXRbc1tuXV07aSYmcC5wdXNoKHUoe30saSkpfXBvc3RNZXNzYWdlKHthbm5vdGF0aW9uczpbe3R5cGU6InBpeGVsUG9pbnRzIixhbm5vdGF0aW9uOnAsZGVmYXVsdFJHQkE6X31dfSl9fSkoKTsKCg==",null,!1);export{Z as default};
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 a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(this,arguments)}var i=function(t){return o.createElement("svg",a({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
+ 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 a(){return a=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},a.apply(this,arguments)}var c=function(t){return i.createElement("svg",a({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};
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};
@@ -0,0 +1 @@
1
+ import{useMemo as u}from"react";const a=(n=[],t,r)=>u(()=>r&&(t==null?void 0:t.length)?n.filter(o=>t.includes(o.annotation.id)):n,[n,t,r]);export{a as default};
@@ -1 +1 @@
1
- import h,{useState as k,useRef as m,useImperativeHandle as x,useEffect as c}from"react";import{ViewOperation as N,ImgUtils as F}from"@labelbee/lb-annotation";import{Spin as H}from"antd/es";import T from"../../hooks/useRefCache.js";import $ from"../measureCanvas/index.js";var q=Object.defineProperty,P=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,S=(t,r,o)=>r in t?q(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o,I=(t,r)=>{for(var o in r||(r={}))B.call(r,o)&&S(t,o,r[o]);if(P)for(var o of P(r))G.call(r,o)&&S(t,o,r[o]);return t};const b={width:455,height:100},J=t=>{if(!t)return b;if(t.width&&t.height)return t;const r=I({},t);return r.width||(r.width=b.width),r.height||(r.height=b.height),r},K=(t,r)=>{var o,y;const{src:z,annotations:s=[],style:R={stroke:"blue",thickness:3},zoomChange:v,backgroundStyle:L={},onChange:g,showLoading:E=!1,globalStyle:A,afterImgOnLoad:V,measureVisible:_}=t,d=J(t.size),[j,p]=k(!1),w=m(null),n=m(),O=T(V),l=m([]),f=m(!0);x(r,()=>{const e=n.current;return e?{zoomIn:()=>e.zoomChanged(!0),zoomOut:()=>e.zoomChanged(!1),initImgPos:()=>e.initImgPos(),toolInstance:e}:{}},[n.current]),c(()=>(w.current&&(n.current=new N({container:w.current,size:d,style:R,annotations:s,config:"{}",zoomInfo:t.zoomInfo,staticMode:t.staticMode}),n.current.init()),()=>{var e;(e=n.current)==null||e.destroy()}),[_]),c(()=>{var e;n.current&&(p(!0),(e=n.current)==null||e.setLoading(!0),F.load(z).then(i=>{var a,u;(a=n.current)==null||a.setLoading(!1),p(!1),(u=n.current)==null||u.setImgNode(i),O.current&&O.current(i)}).catch(()=>{var i;(i=n.current)==null||i.setLoading(!1),p(!1)}))},[z,_]),c(()=>{if(f.current===!1){l.current.push(s);return}const e=()=>{f.current=!0,l.current=[]},i=()=>{var a;const u=l.current.length;if(u>0){const Z=l.current[u-1];l.current=[],(a=n.current)==null||a.updateData(Z).then(i).catch(e)}else f.current=!0};n.current&&(f.current=!1,n.current.updateData(s).then(i).catch(e))},[s]),c(()=>{const e=n.current;(e==null?void 0:e.setSize)&&(e.setSize(d),e.initPosition())},[(o=t.size)==null?void 0:o.width,(y=t.size)==null?void 0:y.height]),c(()=>{var e,i;return n.current&&((e=n.current)==null||e.on("onChange",(...a)=>{g==null||g.apply(null,a)}),(i=n.current)==null||i.on("renderZoom",a=>{v&&v(a)})),()=>{var a,u;(a=n.current)==null||a.unbindAll("onChange"),(u=n.current)==null||u.unbindAll("renderZoom")}},[v,g]);const D=h.createElement("div",{ref:w,style:I(I({position:"relative"},d),L)}),{imgNode:C,zoom:M,currentPos:U}=n.current||{};return h.createElement(H,{spinning:E||j,delay:300,style:A},_&&C?h.createElement($,{size:d,imgNode:C,zoom:M,currentPos:U}):D)};var Q=h.forwardRef(K);export{Q as default};
1
+ import w,{useState as Q,useRef as y,useContext as W,useImperativeHandle as X,useEffect as c,useCallback as D}from"react";import{ViewOperation as Y,ImgUtils as ee}from"@labelbee/lb-annotation";import{Spin as te}from"antd/es";import ne from"../../hooks/useRefCache.js";import re from"../measureCanvas/index.js";import{PointCloudContext as oe}from"../pointCloudView/PointCloudContext.js";import ie from"./hooks/useFilterAnnotations.js";import ae from"../../store/toolConfig/index.js";var le=Object.defineProperty,N=Object.getOwnPropertySymbols,ue=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,T=(n,r,o)=>r in n?le(n,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[r]=o,R=(n,r)=>{for(var o in r||(r={}))ue.call(r,o)&&T(n,o,r[o]);if(N)for(var o of N(r))ce.call(r,o)&&T(n,o,r[o]);return n},B=(n,r,o)=>new Promise((v,d)=>{var s=u=>{try{f(o.next(u))}catch(m){d(m)}},I=u=>{try{f(o.throw(u))}catch(m){d(m)}},f=u=>u.done?v(u.value):Promise.resolve(u.value).then(s,I);f((o=o.apply(n,r)).next())});const x={width:455,height:100},se=n=>{if(!n)return x;if(n.width&&n.height)return n;const r=R({},n);return r.width||(r.width=x.width),r.height||(r.height=x.height),r},de=(n,r)=>{var o,v;const{src:d,fallbackSrc:s,annotations:I=[],style:f={stroke:"blue",thickness:3},zoomChange:u,backgroundStyle:m={},onChange:P,showLoading:F=!1,globalStyle:M,afterImgOnLoad:U,measureVisible:S,onRightClick:g,pointCloudBoxList:A=[],hiddenText:E=!1,renderToolName:Z}=n,p=se(n.size),[H,k]=Q(!1),z=y(null),e=y(),L=ne(U),h=y([]),_=y(!0),{selectedIDs:$}=W(oe),{selectBoxVisibleSwitch:q}=ae(),C=ie(I,$,q);X(r,()=>{const t=e.current;return t?{zoomIn:()=>t.zoomChanged(!0),zoomOut:()=>t.zoomChanged(!1),initImgPos:()=>t.initImgPos(),toolInstance:t}:{}},[e.current]),c(()=>(z.current&&(e.current=new Y({container:z.current,size:p,style:f,annotations:C,config:"{}",zoomInfo:n.zoomInfo,staticMode:n.staticMode,renderToolName:Z}),e.current.init(),g&&e.current.on("onRightClick",g)),()=>{var t,a;g&&((t=e.current)==null||t.unbind("onRightClick",g)),(a=e.current)==null||a.destroy()}),[S]);const O=D(t=>B(void 0,null,function*(){var a,i;try{const l=yield ee.load(t);return(a=e.current)==null||a.setImgNode(l),(i=L.current)==null||i.call(L,l),null}catch(l){return console.error("Error loading image:",l),l}}),[]),j=D(t=>B(void 0,null,function*(){var a,i;if(k(!0),(a=e.current)==null||a.setLoading(!0),(yield O(t))&&s){const b=yield O(s);b&&console.error("Error loading fallback image:",b)}(i=e.current)==null||i.setLoading(!1),k(!1)}),[O,s]);c(()=>{e.current&&j(d)},[d,S,s,j]),c(()=>{(e==null?void 0:e.current)&&e.current.setPointCloudBoxList(A)},[A]),c(()=>{var t;(e==null?void 0:e.current)&&((t=e.current)==null||t.setHiddenText(E))},[E]),c(()=>{if(_.current===!1){h.current.push(C);return}const t=()=>{_.current=!0,h.current=[]},a=()=>{var i;const l=h.current.length;if(l>0){const b=h.current[l-1];h.current=[],(i=e.current)==null||i.updateData(b).then(a).catch(t)}else _.current=!0};e.current&&(_.current=!1,e.current.updateData(C).then(a).catch(t))},[C]),c(()=>{const t=e.current;(t==null?void 0:t.setSize)&&(t.setSize(p),t.initPosition())},[(o=n.size)==null?void 0:o.width,(v=n.size)==null?void 0:v.height]),c(()=>{var t,a;return e.current&&((t=e.current)==null||t.on("onChange",(...i)=>{P==null||P.apply(null,i)}),(a=e.current)==null||a.on("renderZoom",i=>{u&&u(i)})),()=>{var i,l;(i=e.current)==null||i.unbindAll("onChange"),(l=e.current)==null||l.unbindAll("renderZoom")}},[u,P]);const G=w.createElement("div",{ref:z,style:R(R({position:"relative"},p),m)}),{imgNode:V,zoom:J,currentPos:K}=e.current||{};return w.createElement(te,{spinning:F||H,delay:300,style:M},S&&V?w.createElement(re,{size:p,imgNode:V,zoom:J,currentPos:K}):G)};var fe=w.forwardRef(de);export{fe as default};
@@ -0,0 +1 @@
1
+ import e,{useRef as f}from"react";import h from"./hooks/useDrag.js";const g=s=>{const{minTopHeight:i=0,minBottomHeight:a=0,defaultHeight:o=50,axis:c="y",children:t,localKey:n="dynamicResizerHeights",customDivider:m,isShortcutButton:l=!1}=s,r=f(null),{rendered:d,topStyle:u,bottomStyle:y}=h({containerRef:r,minTopHeight:i,minBottomHeight:a,defaultHeight:o,axis:c,localKey:n,customDivider:m,isShortcutButton:l});return e.createElement("div",{className:"dynamic-resizer-content",ref:r},e.createElement("div",{className:"dynamic-resizer-top",style:u},t[0]),d,e.createElement("div",{className:"dynamic-resizer-bottom",style:y},t[1]))};export{g as default};
@@ -0,0 +1 @@
1
+ import"react";var t="data:image/svg+xml,%3csvg t='1720421473527' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5364' width='200' height='200'%3e %3cpath d='M94.8 304.5L512 721.8l416-416-833.2-1.3z m0 0' p-id='5365'%3e%3c/path%3e%3c/svg%3e";export{t as default};
@@ -0,0 +1 @@
1
+ import"react";var a="data:image/svg+xml,%3csvg t='1720596188811' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1478' width='200' height='200'%3e %3cpath d='M36.5551 360.072857h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551Q0 440.453119 0 400.314185q0-40.190131 36.5551-40.190131z' fill='%23999999' p-id='1479' %3e%3c/path%3e %3cpath d='M36.5551 583.550465h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551q-36.5551 0-36.5551-40.190131t36.5551-40.190131z' fill='%23999999' p-id='1480' %3e%3c/path%3e %3cpath d='M553.292672 10.700302l159.634177 89.237451a58.774867 58.774867 0 0 1 29.080248 67.990438 64.406605 64.406605 0 0 1-62.409898 44.388336H344.355187a64.406605 64.406605 0 0 1-62.409897-44.388336 58.774867 58.774867 0 0 1 29.080247-67.990438L470.659714 10.700302a85.448827 85.448827 0 0 1 82.632958 0z m0 1002.654177l159.634177-89.23745a58.774867 58.774867 0 0 0 29.080248-67.990439 64.406605 64.406605 0 0 0-62.409898-44.388336H344.355187a64.406605 64.406605 0 0 0-62.409897 44.388336 58.774867 58.774867 0 0 0 29.080247 67.990439l159.634177 89.23745a85.448827 85.448827 0 0 0 82.632958 0z' fill='%23999999' p-id='1481' %3e%3c/path%3e%3c/svg%3e";export{a as default};
@@ -0,0 +1 @@
1
+ import"react";var t="data:image/svg+xml,%3csvg t='1720421409111' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5202' width='200' height='200'%3e %3cpath d='M928 721.8L510.8 304.5l-416 416 833.2 1.3z m0 0' p-id='5203'%3e%3c/path%3e%3c/svg%3e";export{t as default};
@@ -0,0 +1 @@
1
+ import e,{useCallback as a,useMemo as b}from"react";import L from"react-draggable";import{useLocalStorageState as j}from"ahooks";import k from"./useUpdateHeight.js";import C from"../assets/topToZero.svg.js";import Z from"../assets/bottomToZero.svg.js";import P from"../assets/divider.svg.js";const F=({containerRef:t,minTopHeight:h=0,minBottomHeight:f=0,defaultHeight:E=50,axis:o,localKey:H,isShortcutButton:s=!1})=>{const l=H||"dynamicResizerHeights",{topHeight:i,position:d,bounds:m,topStyle:S,bottomStyle:T,updateELHeight:c,setTopHeightToZero:g,setBottomHeightToZero:n}=k(t,h,f,E,l),[U,p]=j(l),N=a(r=>{r.stopPropagation(),t.current&&t.current.classList.add("hide-scrollbar")},[t]),u=a((r,D)=>{r.stopPropagation(),c(D.y)},[c]),v=a(r=>{r.stopPropagation(),t.current&&t.current.classList.remove("hide-scrollbar"),p(i)},[t,p,i]),y=b(()=>s?e.createElement(e.Fragment,null,e.createElement("img",{src:C,className:"divider-top",draggable:"false",onClick:g}),e.createElement("div",{className:"divider-icon",draggable:"false"}),e.createElement("img",{src:Z,className:"divider-bottom",draggable:"false",onClick:n})):e.createElement(e.Fragment,null,e.createElement("img",{src:P,className:"divider-all",draggable:"false"}),e.createElement("div",{className:"divider-icon",draggable:"false"})),[s,g,n]);return{rendered:b(()=>{const r=e.createElement("div",{className:"divider"},y);return e.createElement(L,{axis:o,position:d,handle:".divider",onStart:N,onDrag:u,onStop:v,bounds:m},r)},[o,d,u,v,m]),topStyle:S,bottomStyle:T}};export{F as default};
@@ -0,0 +1 @@
1
+ import{useState as r,useEffect as M,useMemo as c,useCallback as _}from"react";import{useLocalStorageState as U}from"ahooks";const b=1e-5,z=(t,m,v,d,S)=>{const[l,I]=r(0),[n,x]=r(0),[s,B]=r(0),[u,L]=r(0),[h,p]=U(S),[a,N]=r(!1);M(()=>{D(),N(!0)},[]),M(()=>{if(a){const o=P();H(o),p(o)}},[a]);const y=c(()=>({x:0,y:l}),[l]),Z=c(()=>{var o;return{top:s,bottom:(((o=t.current)==null?void 0:o.offsetHeight)||0)-u}},[s,t]),E=c(()=>({height:l+"px"}),[l]),k=c(()=>({height:n+"px"}),[n]),D=()=>{var o,i,e,g;if(t){let f=m,T=v;m>=(((o=t.current)==null?void 0:o.offsetHeight)||0)/2&&(f=(((i=t.current)==null?void 0:i.offsetHeight)||0)/2),v>=(((e=t.current)==null?void 0:e.offsetHeight)||0)/2&&(T=(((g=t.current)==null?void 0:g.offsetHeight)||0)/2),B(f||b),L(T)}},P=_(()=>{var o,i;let e=0;return h!=null?e=isNaN(Number(h))?0:Number(h):e=d,e<s&&(e=s),t&&e>=(((o=t==null?void 0:t.current)==null?void 0:o.offsetHeight)||0)&&(e=(((i=t.current)==null?void 0:i.offsetHeight)||0)/2),e||b},[t,l,s,h,d]),H=_(o=>{var i;if(t){const e=((i=t==null?void 0:t.current)==null?void 0:i.offsetHeight)||0,g=e-u;o>=s&&o<=g&&(I(o),x(e-o))}},[t,s,u]);return{topHeight:l,bottomHeight:n,position:y,bounds:Z,topStyle:E,bottomStyle:k,updateELHeight:H,setBottomHeightToZero:()=>{var o;if(t){const i=((o=t==null?void 0:t.current)==null?void 0:o.offsetHeight)||0;H(i-u||0),p(i-u||0)}},setTopHeightToZero:()=>{t&&(H(s||0),p(s||0))}}};export{z as default};
@@ -0,0 +1 @@
1
+ import"./DynamicResizer.js";export{default}from"./DynamicResizer.js";
@@ -0,0 +1 @@
1
+ import{getTextControlByConfig as I,RenderAnswer as N}from"../../LLMToolView/questionView/index.js";import{RenderQuestion as V}from"../../LLMToolView/questionView/components/header/index.js";import j from"../../LLMToolView/questionView/components/imgView/index.js";import x from"../../../store/LLMMultiWheel/index.js";import{classnames as h}from"../../../utils/index.js";import{Button as s}from"antd";import e from"react";import{useTranslation as M}from"react-i18next";var T=Object.defineProperty,q=Object.defineProperties,D=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,d=(o,t,r)=>t in o?T(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,S=(o,t)=>{for(var r in t||(t={}))F.call(t,r)&&d(o,r,t[r]);if(p)for(var r of p(t))C.call(t,r)&&d(o,r,t[r]);return o},b=(o,t)=>q(o,D(t));const A=o=>{const{id:t,answerList:r,question:u,index:f,name:w="",answerIsImg:v,questionIsImg:_,LLMConfig:g}=o,{t:n}=M(),{dataFormatType:i,selectedID:E,setSelectedID:y}=x(),a=f+1,L=w||`${n("Dialog")}${a}`;return e.createElement("div",{key:t,onClick:()=>y(t),className:h({dialog:!0,selected:t===E})},e.createElement("div",{className:"header"},e.createElement("span",{className:"order"},a),e.createElement("div",{className:"name"},e.createElement("div",{className:"show-name"},L),e.createElement("div",{className:"tips"},"\uFF08",n("SelectionOfAnnotation"),"\uFF09"))),e.createElement("div",{className:"dialog-question"},e.createElement(s,{type:"primary"},n("Title"),a),e.createElement("div",null,e.createElement(V,{question:u,dataFormatType:i,isImg:_}))),e.createElement("div",{className:"dialog-answer"},v?e.createElement(e.Fragment,null,e.createElement(s,{type:"primary"},n("Answer")),e.createElement(j,{answerList:r})):r==null?void 0:r.map((O,l)=>{const m=l+1,c=b(S({},O),{order:m}),P=I(c,g);return e.createElement("div",{key:l},e.createElement(s,{type:"primary"},n("Answer"),m),e.createElement(N,{i:c,isTextControl:P,dataFormatType:i}))})))};export{A as default};
@@ -0,0 +1 @@
1
+ import i,{useEffect as M,useState as E}from"react";import{ELLMDataType as W}from"../../constant/index.js";import{getStepConfig as Y}from"../../store/annotation/reducer.js";import{LabelBeeContext as Z}from"../../store/ctx.js";import{jsonParser as ee}from"../../utils/index.js";import{connect as te}from"react-redux";import A from"../../store/LLMMultiWheel/index.js";import{LLMMultiWheelViewCls as $}from"../../views/MainView/LLMMultiWheelLayout/index.js";import{ToggleDataFormatType as ne}from"../LLMToolView/questionView/components/header/index.js";import oe from"./dialogView/index.js";import re from"../messageMaskLayer/index.js";import ie from"../../views/MainView/annotationTips/index.js";import{I18nextProvider as ae,useTranslation as se}from"react-i18next";import{LLMViewCls as le}from"../LLMToolView/questionView/index.js";import{Layout as ue}from"antd";import{i18n as F}from"@labelbee/lb-utils";var ce=Object.defineProperty,de=Object.defineProperties,pe=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,k=(t,e,n)=>e in t?ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,y=(t,e)=>{for(var n in e||(e={}))me.call(e,n)&&k(t,n,e[n]);if(N)for(var n of N(e))Le.call(e,n)&&k(t,n,e[n]);return t},h=(t,e)=>de(t,pe(e));const R=t=>{const{questionIsImg:e,answerIsImg:n,LLMConfig:l,dialogList:p,lang:u="cn"}=t,{dataFormatType:c,setDataFormatType:a}=A();return M(()=>{var o;u&&((o=F)==null||o.changeLanguage(u))},[u]),i.createElement(ae,{i18n:F},i.createElement("div",{className:`${$}`},i.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},i.createElement(ne,{dataFormatType:c,setDataFormatType:a})),i.createElement("div",{className:`${$}-container`},p==null?void 0:p.map((o,d)=>i.createElement(oe,h(y({},o),{key:d,index:d,questionIsImg:e,answerIsImg:n,LLMConfig:l}))))))},U=({type:t,questionIndex:e,answerIndex:n,llmFile:l})=>{if(t==="question")return l==null?void 0:l.find((u,c)=>e===c);let p=null;return l==null||l.forEach((u,c)=>{var a;(a=u.answerList)==null||a.forEach((o,d)=>{c===e&&n===d&&(p=o)})}),p},fe=t=>{var e,n;const{annotation:l,tips:p,showTips:u,drawLayerSlot:c}=t,{imgIndex:a,imgList:o,stepList:d,step:x,toolInstance:v}=l,[w,B]=E(),{setSelectedID:Q,newAnswerListMap:I}=A(),[z,T]=E([]),j=((e=w==null?void 0:w.dataType)==null?void 0:e.prompt)===W.Picture,P=((n=w==null?void 0:w.dataType)==null?void 0:n.response)===W.Picture,{t:G}=se(),[,H]=E(0);return M(()=>{var r,m,L;if(!o[a])return;const g=(r=o[a])!=null?r:{},f=(L=(m=g==null?void 0:g.questionList)==null?void 0:m.textList)!=null?L:[];T(f),(f==null?void 0:f.length)&&Q(f[0].id)},[a]),M(()=>{var r,m;const L=(r=o[a])!=null?r:{},g=L==null?void 0:L.questionList,f=(m=L==null?void 0:L.llmFile)==null?void 0:m.textList,V=g==null?void 0:g.textList,J=V==null?void 0:V.map((s,b)=>{var D;return h(y({},s),{question:j&&U({type:"question",questionIndex:b,llmFile:f})||(s==null?void 0:s.question),answerList:(D=s==null?void 0:s.answerList)==null?void 0:D.map((_,O)=>{var S,q,C;const K=`${(S=s==null?void 0:s.id)!=null?S:""}-${(q=_==null?void 0:_.id)!=null?q:""}`,X=P?U({type:"answer",questionIndex:b,answerIndex:O,llmFile:f})||{}:{};return y(h(y({},_),{answer:_.answer,newAnswer:(C=I[K])!=null?C:_.answer,order:O+1}),X)})})});T(J)},[I,j,P]),M(()=>{var r;if(d&&x){const m=(r=Y(d,x))==null?void 0:r.config;B(ee(m))}},[d,x]),M(()=>{if(v)return v.on("validUpdated",()=>{H(r=>r+1)}),()=>{v.unbindAll("validUpdated")}},[v]),i.createElement(ue,{className:le},!(v==null?void 0:v.valid)&&i.createElement(re,{message:G("InvalidQuestionAndSkip")}),c==null?void 0:c({}),u===!0&&i.createElement(ie,{tips:p}),i.createElement(R,{questionIsImg:j,answerIsImg:P,LLMConfig:w,dialogList:z}))},ve=t=>({annotation:t.annotation});var we=te(ve,null,null,{context:Z})(fe);export{R as LLMMultiWheelSourceView,we as default};
@@ -0,0 +1 @@
1
+ import r,{useState as T,useRef as It,useMemo as N,useEffect as $}from"react";import{LabelBeeContext as Vt}from"../../../store/ctx.js";import{connect as Nt}from"react-redux";import{prefix as $t}from"../../../constant/index.js";import{getStepConfig as Bt}from"../../../store/annotation/reducer.js";import{jsonParser as dt}from"../../../utils/index.js";import Wt,{getSorts as ct}from"../../LLMToolView/sidebar/components/modelAnswerSort/index.js";import{useTranslation as Ft}from"react-i18next";import{useCustomToolInstance as kt}from"../../../hooks/annotation.js";import{isBoolean as qt,isString as Gt,isNumber as Kt,isObject as zt,isArray as Ut}from"lodash";import{PageForward as B}from"../../../store/annotation/actionCreators.js";import{cKeyCode as Qt,EToolName as Jt}from"@labelbee/lb-annotation";import{getLLMIsNoConfig as Ht,EmptyConfig as Xt}from"../../LLMToolView/sidebar/index.js";import Yt from"../../LLMToolView/sidebar/components/textInputBox/index.js";import{Button as pt}from"antd";import Zt from"../../LLMToolView/sidebar/components/answerList/index.js";import te from"../../../store/LLMMultiWheel/index.js";import ee from"../../../utils/StepUtils.js";import{getRenderDataByResult as ne,getTagResult as oe,getCurrentResultFromResultList as re}from"../../LLMToolView/utils/data.js";import{useMemoizedFn as z}from"ahooks";import le from"../../LLMToolView/sidebar/components/answerSort/index.js";import ie from"../../tagList/components/overall/index.js";var se=Object.defineProperty,ae=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,ft=(p,d,m)=>d in p?se(p,d,{enumerable:!0,configurable:!0,writable:!0,value:m}):p[d]=m,l=(p,d)=>{for(var m in d||(d={}))de.call(d,m)&&ft(p,m,d[m]);if(mt)for(var m of mt(d))ce.call(d,m)&&ft(p,m,d[m]);return p},u=(p,d)=>ae(p,ue(d));const pe=Qt.default,vt=`${$t}-sidebar`,me={sort:[],answerSort:{},textAttribute:[],tagList:{}},fe=p=>{var d,m,U,Q,J,H;const{annotation:Lt,dispatch:R,checkMode:gt}=p,{imgIndex:M,imgList:W,stepList:A,step:h,skipBeforePageTurning:D}=Lt,[c,xt]=T(),{t:S}=Ft(),o=(d=W[M])!=null?d:{},X=dt(o==null?void 0:o.result),{toolInstanceRef:L}=kt({basicInfo:X}),[F,wt]=T(!0),[O,Y]=T({}),[g,Z]=T(me),k=It(),[_,q]=T({}),{selectedID:P,setNewAnswerListMap:tt,newAnswerListMap:et}=te(),b=N(()=>O[P],[P,O]),y=!L.current.valid||gt;$(()=>{var t;if(A&&h){const e=(t=Bt(A,h))==null?void 0:t.config;xt(dt(e))}},[h,JSON.stringify(A)]),$(()=>{!o||M===-1||(L.current.setValid=nt,L.current.clearResult=St,nt(),ot())},[M,c,o==null?void 0:o.id]);const St=()=>{var t,e,n,i;ot((t=o==null?void 0:o.questionList)==null?void 0:t.textList),((e=k.current)==null?void 0:e.clearValue)&&((n=k.current)==null||n.clearValue());const{waitSorts:f}=ct({selectedSort:(i=x==null?void 0:x.sort)!=null?i:[],initSelected:[],modelList:j?V!=null?V:[]:[]});q(u(l({},_),{waitSorts:f,newSort:[]}))},nt=t=>{var e;const n=t!=null?t:X.valid;qt(n)&&(wt(n),L.current.valid=n,(e=L.current)==null||e.emit("validUpdated"))},_t=()=>{const t=ee.getCurrentStepInfo(h,A);return re(o==null?void 0:o.result,t.step)},x=N(()=>_t(),[h,A,o]),ot=z(t=>{var e,n,i,f,s,w,C;const a=x;let E=(e=o==null?void 0:o.questionList)==null?void 0:e.textList;((n=a==null?void 0:a.modelData)==null?void 0:n.length)&&L.current.valid&&(E=a==null?void 0:a.modelData),t&&(E=t,a.sort=[],a.textAttribute=[],a.answerSort=[]);let at={};E==null||E.forEach((v,Dt)=>{var ut;const Ot=ne(c,u(l({},v),{answerList:(ut=v==null?void 0:v.answerList)==null?void 0:ut.map((K,Pt)=>(tt(u(l({},et),{[`${v.id}-${K.id}`]:K.answer})),u(l({},K),{order:Pt+1})))}));at[v.id]=u(l({},Ot),{order:Dt+1,id:v.id})});const{waitSorts:jt,newSort:Ct}=ct({selectedSort:(i=x==null?void 0:x.sort)!=null?i:[],modelList:j?V!=null?V:[]:[]});q({waitSorts:jt,newSort:Ct});const Tt=((f=c==null?void 0:c.inputList)==null?void 0:f.filter(v=>v==null?void 0:v.isOverall))||[],Rt=oe(Tt,a==null?void 0:a.tagList);Z({sort:(s=a==null?void 0:a.sort)!=null?s:[],textAttribute:(w=a==null?void 0:a.textAttribute)!=null?w:[],answerSort:(C=a==null?void 0:a.answerSort)!=null?C:{},tagList:Rt}),Y(at)});$(()=>{bt()},[O,F,g]),$(()=>(window.addEventListener("keydown",rt),()=>{window.removeEventListener("keydown",rt)}),[]);const bt=z(()=>{var t,e;const n=(e=(t=o==null?void 0:o.questionList)==null?void 0:t.textList)==null?void 0:e.map(f=>{var s;const w=(s=O[f.id])!=null?s:{};return{id:f.id,answerList:w.answerList}}),i=u(l({},g),{modelData:n});L.current.exportData=()=>[[i],{valid:F}],L.current.currentPageResult=u(l({},i),{toolName:Jt.LLMMultiWheel,valid:F})}),rt=t=>{if(t.ctrlKey&&t.keyCode===pe.Enter){if(D){D(()=>R(B()));return}R(B())}},yt=z(({order:t,value:e,key:n})=>{const{answerList:i}=b,f=i==null?void 0:i.map(s=>{var w,C;if((s==null?void 0:s.order)===t){if(n==="textEdit"&&Gt(e))return tt(u(l({},et),{[`${P}-${(w=s==null?void 0:s.id)!=null?w:""}`]:e})),u(l({},s),{newAnswer:e});if(Kt(e))return u(l({},s),{score:e});if(zt(e)&&n){const a={[e==null?void 0:e.key]:e.value},E=(C=s[n])!=null?C:{};return u(l({},s),{[n]:l(l({},E),a)})}}return s});Y(s=>u(l({},s),{[P]:u(l({},b),{answerList:f})}))}),I=(t,e)=>{Z(n=>u(l({},n),{[t]:e}))},{indicatorScore:lt=[],indicatorDetermine:it=[],isTextEdit:Et,dialogSort:j=!1,inputList:G=[],tagInputListConfigurable:st,enableSort:Mt=!1}=c||{},V=N(()=>{var t,e,n;return j?(n=(e=(t=o==null?void 0:o.questionList)==null?void 0:t.textList)==null?void 0:e.map((i,f)=>u(l({},i),{title:f+1})))!=null?n:[]:[]},[o,j]);if(N(()=>Ht(c),[c]))return r.createElement(Xt,null);const At=st&&((m=G.filter(t=>!t.isOverall))==null?void 0:m.length)>0,ht=(it==null?void 0:it.length)>0||(lt==null?void 0:lt.length)>0||Et||At;return r.createElement("div",{className:`${vt}`},r.createElement("div",{className:`${vt}__content`},r.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},S("GlobalAnnotation")),j&&r.createElement(le,{waitSortList:(_==null?void 0:_.waitSorts)||[],sortList:(_==null?void 0:_.newSort)||[],setSortList:t=>{const e=t.map(n=>n.map(i=>i.id));I("sort",e),q(u(l({},_),{newSort:t}))},disabeledAll:y,title:S("SortConversationQuality"),prefixId:"model"}),(c==null?void 0:c.text)&&r.createElement("div",{style:{padding:"0px 16px",marginTop:"16px"}},r.createElement(Yt,{textAttribute:(U=g==null?void 0:g.textAttribute)!=null?U:[],textConfig:(c==null?void 0:c.text)&&Ut(c.text)?c==null?void 0:c.text:[],setText:t=>I("textAttribute",t),disabeledAll:y})),Mt&&r.createElement(Wt,{modelData:(J=(Q=o==null?void 0:o.questionList)==null?void 0:Q.textList)!=null?J:[],selectedAnswerSort:t=>I("answerSort",t),selectedSort:(H=x==null?void 0:x.answerSort)!=null?H:[],ref:k,disabeledAll:y,imgIndex:M}),st&&G.length&&r.createElement(ie,{inputList:G,selectedTags:(g==null?void 0:g.tagList)||{},updateValue:t=>{const{key:e,value:n}=t,i=(g==null?void 0:g.tagList)||{};I("tagList",u(l({},i),{[e]:n}))},disabeledAll:y}),b&&r.createElement(r.Fragment,null,r.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},S("QualifiedAnnotation")),r.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"}},r.createElement(pt,{type:"primary",danger:!0},S("Annotating")),r.createElement("div",{style:{padding:16}},S("Group"),"\uFF1A",b.order)),r.createElement("div",null,ht&&r.createElement(Zt,{list:(b==null?void 0:b.answerList)||[],LLMConfig:c,updateValue:yt,disabeledAll:y})))),r.createElement("div",{style:{margin:"24px 16px",display:"flex"}},(W==null?void 0:W.length)-1!==M&&r.createElement(pt,{type:"primary",style:{marginLeft:"auto"},onClick:()=>{if(D){D(()=>R(B()));return}R(B())},disabled:y},S("Save"))))},ve=p=>({annotation:p.annotation});var Le=Nt(ve,null,null,{context:Vt})(fe);export{Le as default};
@@ -1 +1 @@
1
- import a,{useContext as N,useState as v,useEffect as u}from"react";import{connect as $}from"react-redux";import{LabelBeeContext as U,LLMContext as B}from"../../store/ctx.js";import{message as K}from"antd";import{ELLMDataType as L,prefix as W}from"../../constant/index.js";import{Layout as z}from"antd/es";import G from"./questionView/index.js";import{useTranslation as H}from"react-i18next";import J from"../../views/MainView/annotationTips/index.js";import{getCurrentResultFromResultList as O}from"./utils/data.js";import{getStepConfig as X}from"../../store/annotation/reducer.js";import{jsonParser as Y}from"../../utils/index.js";import Z from"../messageMaskLayer/index.js";const C=`${W}-LLMView`,ee=g=>{const{annotation:x,checkMode:M=!0,tips:q,showTips:A,drawLayerSlot:T}=g,{imgIndex:n,imgList:l,stepList:w,step:d,toolInstance:s}=x,{hoverKey:E,modelAPIResponse:R,setModelAPIResponse:I,newAnswerList:c}=N(B),[P,V]=v([]),[S,h]=v(""),[t,k]=v(),{t:y}=H(),[,Q]=v(0);return u(()=>{let e;if(!M)return e=setInterval(()=>{K.info(y("EfficientListening"))},1e3*60),()=>{e&&clearInterval(e)}},[]),u(()=>{if(s)return s.on("validUpdated",()=>{Q(e=>e+1)}),()=>{s.unbindAll("validUpdated")}},[s]),u(()=>{var e,o,i,r,_,j;if(!l[n])return;const b=((e=t==null?void 0:t.dataType)==null?void 0:e.prompt)===L.Picture,D=((o=t==null?void 0:t.dataType)==null?void 0:o.response)===L.Picture,m=(i=l[n])==null?void 0:i.questionList,p=(r=l[n])==null?void 0:r.llmFile,F=b?p==null?void 0:p.question:m==null?void 0:m.question;h(F);let f=(m==null?void 0:m.answerList)||[];D&&(f=(p==null?void 0:p.answerList)||[]),((_=t==null?void 0:t.dataType)==null?void 0:_.response)===L.None&&(f=[]),((j=t==null?void 0:t.dataType)==null?void 0:j.response)===L.Text&&(c==null?void 0:c.length)>0&&(f=c),V(f)},[n,c,t]),u(()=>{var e;if(!l[n])return;const o=(e=l[n])!=null?e:{},i=O(o==null?void 0:o.result,d),r=(i==null?void 0:i.length)>0?i[0]:i;I((r==null?void 0:r.modelAPIResponse)||[])},[n]),u(()=>{var e;if(w&&d){const o=(e=X(w,d))==null?void 0:e.config;k(Y(o))}},[w,d]),a.createElement(z,{className:C},!(s==null?void 0:s.valid)&&a.createElement(Z,{message:y("InvalidQuestionAndSkip")}),T==null?void 0:T({}),a.createElement("div",{className:`${C}-question`},A===!0&&a.createElement(J,{tips:q}),a.createElement(G,{hoverKey:E,question:S,answerList:P,modelAPIResponse:R,setModelAPIResponse:I,checkMode:M,annotation:x,LLMConfig:t})))},te=g=>({annotation:g.annotation});var ne=$(te,null,null,{context:U})(ee);export{ne as default};
1
+ 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:n})=>{const r=w(t)?t:"",a=b.language==="en"?v:h;if(n){const l=y(t)?t==null?void 0:t.url:"";return e.createElement(u,{src:l||a,fallback:a})}return e.createElement("div",{style:{whiteSpace:"pre-wrap"}},o===m.Markdown?e.createElement(x,{value:r}):r)},T=t=>{const{question:o,dataFormatType:n,setDataFormatType:r,isImg:a}=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"),!a&&e.createElement("span",{style:{display:"flex"}},e.createElement(i.Group,{value:n,onChange:d=>{r(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:n,isImg:a})))};export{T as default};
1
+ import e from"react";import{useTranslation as u}from"react-i18next";import{Resizable as f}from"re-resizable";import{Radio as i,Image as g}from"antd";import{EDataFormatType as m,prefix as E}from"../../../../../constant/index.js";import{FileTextOutlined as x}from"@ant-design/icons";import w from"../../../../markdownView/index.js";import{isString as y,isObject as T}from"lodash";import{i18n as b}from"@labelbee/lb-utils";import h from"../../../../../assets/annotation/LLMTool/imgFail_cn.svg.js";import v from"../../../../../assets/annotation/LLMTool/imgFail_en.svg.js";const s=`${E}-LLMView`,c=({question:t,dataFormatType:n,isImg:a})=>{const r=y(t)?t:"",o=b.language==="en"?v:h;if(a){const l=T(t)?t==null?void 0:t.url:"";return e.createElement(g,{src:l||o,fallback:o})}return e.createElement("div",{style:{whiteSpace:"pre-wrap"}},n===m.Markdown?e.createElement(w,{value:r}):r)},F=t=>{const{question:n,dataFormatType:a,setDataFormatType:r,isImg:o}=t,l=300,{t:p}=u();return e.createElement(f,{defaultSize:{width:"100%",height:l},minHeight:l,enable:{bottom:!0},style:{padding:"26px 32px",borderBottom:"1px solid #EBEBEB",overflow:"hidden"}},e.createElement("div",{className:`${s}__title`,style:{display:"flex",justifyContent:"space-between"}},p("Title"),e.createElement(d,{dataFormatType:a,setDataFormatType:r})),e.createElement("div",{className:`${s}__headerContent`},e.createElement(c,{question:n,dataFormatType:a,isImg:o})))},d=t=>{const{dataFormatType:n,setDataFormatType:a}=t;return e.createElement("span",{style:{display:"flex"}},e.createElement(i.Group,{value:n,onChange:r=>{a(r.target.value)}},e.createElement(i.Button,{value:m.Default,style:{textAlign:"center",width:"52px"}},"</>"),e.createElement(i.Button,{value:m.Markdown,style:{textAlign:"center",width:"52px"}},e.createElement(x,null))),e.createElement("span",{style:{marginLeft:"8px",width:"4px",background:"#1890ff"}}))};export{c as RenderQuestion,d as ToggleDataFormatType,F as default};
@@ -1 +1 @@
1
- import t from"react";import{Tag as i,Image as c}from"antd";import{prefix as 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=m=>{const{answerList:o,hoverKey:r}=m,l=p.language==="en"?u:f;return t.createElement("div",{className:a.imgView},o.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})))))};export{v as default};
1
+ import t from"react";import{Tag as i,Image as c}from"antd";import{prefix as d}from"../../../../../constant/index.js";import g from"classnames";import u from"../../../../../assets/annotation/LLMTool/imgFail_cn.svg.js";import f from"../../../../../assets/annotation/LLMTool/imgFail_en.svg.js";import{i18n as p}from"@labelbee/lb-utils";import a from"./index.module.scss.js";const o=`${d}-LLMView`,v=m=>{const{answerList:s,hoverKey:l}=m,n=p.language==="en"?f:u;return t.createElement("div",{className:a.imgView},s==null?void 0:s.map((e,r)=>t.createElement("div",{key:r,className:g({[`${a.item}`]:!0,[`${o}__contentActive`]:l===(e==null?void 0:e.order)})},t.createElement(i,{className:`${o}-tag`},e==null?void 0:e.order),t.createElement("div",{className:a.image},t.createElement(c,{src:e==null?void 0:e.url,fallback:n,style:{objectFit:"contain"}})))))};export{v as default};
@@ -1 +1 @@
1
- import r,{useState as j,useEffect as C}from"react";import{Tag as O}from"antd";import{EDataFormatType as v,ELLMDataType as w,prefix as S}from"../../../constant/index.js";import b from"classnames";import{I18nextProvider as N,useTranslation as $}from"react-i18next";import{i18n as _}from"@labelbee/lb-utils";import D from"../../markdownView/index.js";import k from"../modelAPIView/index.js";import R from"../../diffMatchPatchComponent/index.js";import F from"./components/header/index.js";import q from"./components/imgView/index.js";import{isString as B}from"lodash";var H=Object.defineProperty,E=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,g=(e,t,n)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K=(e,t)=>{for(var n in t||(t={}))Q.call(t,n)&&g(e,n,t[n]);if(E)for(var n of E(t))W.call(t,n)&&g(e,n,t[n]);return e};const l=`${S}-LLMView`,z=({i:e,dataFormatType:t,isTextControl:n})=>{var i;return t===v.Markdown?r.createElement(D,{value:(i=e==null?void 0:e.newAnswer)!=null?i:e==null?void 0:e.answer}):n?r.createElement("div",{style:{width:"100%",overflowWrap:"break-word"}},r.createElement(R,{originString:e==null?void 0:e.answer,currentString:e==null?void 0:e.newAnswer})):r.createElement("div",{style:{whiteSpace:"pre-wrap"}},(e==null?void 0:e.newAnswer)||(e==null?void 0:e.answer))},G=e=>{var t,n;const{hoverKey:i,answerList:d,question:m,lang:u,modelAPIResponse:x,setModelAPIResponse:y,checkMode:P=!0,LLMConfig:a,answerHeaderSlot:h}=e,[c,I]=j(v.Default),A=((t=a==null?void 0:a.dataType)==null?void 0:t.prompt)===w.Picture,M=((n=a==null?void 0:a.dataType)==null?void 0:n.response)===w.Picture,{t:T}=$();C(()=>{var o;u&&((o=_)==null||o.changeLanguage(u))},[]);const V=o=>{var s;return(a==null?void 0:a.isTextEdit)?!!((s=((a==null?void 0:a.textEdit)||[]).filter(f=>(f==null?void 0:f.title)===o.order)[0])==null?void 0:s.textControl):!1},L=r.createElement("div",null,d.map((o,s)=>{const p=V(o);return r.createElement("div",{className:b({[`${l}__content`]:!0,[`${l}__contentActive`]:i===(o==null?void 0:o.order)}),key:s},r.createElement(O,{className:`${l}-tag`},o==null?void 0:o.order),r.createElement(z,{i:o,isTextControl:p,dataFormatType:c}))}),B(m)&&r.createElement(k,{dataFormatType:c,modelAPIResponse:x,question:m,setModelAPIResponse:y,checkMode:P,annotation:e.annotation}));return r.createElement("div",{className:l},r.createElement(F,{question:m,dataFormatType:c,setDataFormatType:I,isImg:A}),r.createElement("div",{className:`${l}__textBox`},r.createElement("div",{className:`${l}__title`},T("Answer")," ",h),M?r.createElement(q,{hoverKey:i,answerList:d}):L))},J=e=>r.createElement(N,{i18n:_},r.createElement(G,K({},e)));export{l as LLMViewCls,J as default};
1
+ import n,{useState as M,useEffect as O}from"react";import{Tag as S}from"antd";import{prefix as N,EDataFormatType as u,ELLMDataType as p}from"../../../constant/index.js";import $ from"classnames";import{I18nextProvider as k,useTranslation as C}from"react-i18next";import{i18n as v}from"@labelbee/lb-utils";import D from"../../markdownView/index.js";import L from"../modelAPIView/index.js";import R from"../../diffMatchPatchComponent/index.js";import F from"./components/header/index.js";import W from"./components/imgView/index.js";import{isString as q}from"lodash";var B=Object.defineProperty,w=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,f=(e,t,r)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,K=(e,t)=>{for(var r in t||(t={}))H.call(t,r)&&f(e,r,t[r]);if(w)for(var r of w(t))Q.call(t,r)&&f(e,r,t[r]);return e};const a=`${N}-LLMView`,_=({i:e,dataFormatType:t,isTextControl:r})=>{var l;return t===u.Markdown?n.createElement(D,{value:(l=e==null?void 0:e.newAnswer)!=null?l:e==null?void 0:e.answer}):r?n.createElement("div",{style:{width:"100%",overflowWrap:"break-word"}},n.createElement(R,{originString:e==null?void 0:e.answer,currentString:e==null?void 0:e.newAnswer})):n.createElement("div",{style:{whiteSpace:"pre-wrap",overflowWrap:"break-word"}},(e==null?void 0:e.newAnswer)||(e==null?void 0:e.answer))},E=(e,t)=>{var r;return(t==null?void 0:t.isTextEdit)?!!((r=((t==null?void 0:t.textEdit)||[]).filter(s=>(s==null?void 0:s.title)===e.order)[0])==null?void 0:r.textControl):!1},z=e=>{var t,r;const{hoverKey:l,answerList:s,question:m,lang:c,modelAPIResponse:x,setModelAPIResponse:g,checkMode:y=!0,LLMConfig:i,answerHeaderSlot:P}=e,[d,h]=M(u.Default),I=((t=i==null?void 0:i.dataType)==null?void 0:t.prompt)===p.Picture,A=((r=i==null?void 0:i.dataType)==null?void 0:r.response)===p.Picture,{t:T}=C();O(()=>{var o;c&&((o=v)==null||o.changeLanguage(c))},[]);const V=n.createElement("div",null,s.map((o,b)=>{const j=E(o,i);return n.createElement("div",{className:$({[`${a}__content`]:!0,[`${a}__contentActive`]:l===(o==null?void 0:o.order)}),key:b},n.createElement(S,{className:`${a}-tag`},o==null?void 0:o.order),n.createElement(_,{i:o,isTextControl:j,dataFormatType:d}))}),q(m)&&n.createElement(L,{dataFormatType:d,modelAPIResponse:x,question:m,setModelAPIResponse:g,checkMode:y,annotation:e.annotation}));return n.createElement("div",{className:a},n.createElement(F,{question:m,dataFormatType:d,setDataFormatType:h,isImg:I}),n.createElement("div",{className:`${a}__textBox`},n.createElement("div",{className:`${a}__title`},T("Answer")," ",P),A?n.createElement(W,{hoverKey:l,answerList:s}):V))},G=e=>n.createElement(k,{i18n:v},n.createElement(z,K({},e)));export{a as LLMViewCls,_ as RenderAnswer,G as default,E as getTextControlByConfig};
@@ -1 +1 @@
1
- import s,{useReducer as Z,useContext as ee,useState as A,useEffect as K}from"react";import{prefix as te}from"../../../../../constant/index.js";import{Tag as ne}from"antd";import{useTranslation as U}from"react-i18next";import{LeftOutlined as oe}from"@ant-design/icons";import{classnames as ie}from"../../../../../utils/index.js";import{isArray as re,cloneDeep as se}from"lodash";import{MathUtils as _}from"@labelbee/lb-annotation";import{LLMContext as ae}from"../../../../../store/ctx.js";var le=Object.defineProperty,ce=Object.defineProperties,de=Object.getOwnPropertyDescriptors,X=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,Y=(i,p,a)=>p in i?le(i,p,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[p]=a,H=(i,p)=>{for(var a in p||(p={}))pe.call(p,a)&&Y(i,a,p[a]);if(X)for(var a of X(p))ue.call(p,a)&&Y(i,a,p[a]);return i},fe=(i,p)=>ce(i,de(p)),g;(function(i){i.Top="Top",i.Right="Right",i.Bottom="Bottom",i.Left="Left"})(g||(g={}));const b=`${te}-LLMSidebar-contentBox`,me=()=>{const{t:i}=U();return s.createElement("div",{className:`${b}__navigation`},s.createElement("span",null,i("Best")),s.createElement("div",{style:{display:"flex",alignItems:"center"}},s.createElement(oe,null),s.createElement("div",{style:{height:0,border:"1px solid #999999",width:"450px"}})),s.createElement("span",null,i("Worst")))},ge=i=>{const[,p]=Z(e=>e+1,0),{sortList:a,setSortList:M,waitSortList:j,disabeledAll:J}=i,{setHoverKey:k}=ee(ae),[N,y]=A(void 0),[B,F]=A(void 0),[h,Q]=A([]),{t:I}=U();K(()=>{Q(j)},[j]),K(()=>{z()},[JSON.stringify(a)]);const O=({item:e,operation:t,id:n})=>{const o={[`border${N}`]:"2px solid #8C9AFF"};return s.createElement("div",H({key:`${e==null?void 0:e.id}`,color:"#EBEBEB",id:n,className:ie({[`${b}__answerTag`]:!0}),style:B===(e==null?void 0:e.id)&&N?o:void 0,draggable:J||!(e==null?void 0:e.id)?"":"true",onMouseMove:()=>{k(e.id)},onMouseLeave:()=>{k(-1)}},t),e==null?void 0:e.title)},w=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),W=(e,t)=>{const n=_.getLineLength(e,w(t.tl,t.tr)),o=_.getLineLength(e,w(t.tr,t.tr)),c=_.getLineLength(e,w(t.bl,t.br)),d=_.getLineLength(e,w(t.tl,t.bl));return{minDistance:Math.min(n,o,c,d),toTopDistance:n,toRightDistance:o,toBottompDistance:c,toLeftDistance:d}},q=(e,t)=>{const{minDistance:n,toTopDistance:o,toRightDistance:c,toBottompDistance:d,toLeftDistance:u}=W(e,t);switch(n){case o:y(g.Top);break;case c:y(g.Right);break;case d:y(g.Bottom);break;case u:y(g.Left);break}},z=()=>{const e=document.getElementById("sortBox");if(e==null?void 0:e.childNodes){let t=[];e.childNodes.forEach((n,o)=>{var c;let d=n;((c=n==null?void 0:n.childNodes)==null?void 0:c.length)>1&&(d=n.childNodes[0]);const u=d.getBoundingClientRect()||{},{bottom:r,top:f,left:l,right:m,width:v,height:x,x:$,y:C}=u,R={x:l+v/2,y:f+x/2},T={tl:{x:$,y:C},tr:{x:m,y:f},br:{x:m,y:r},bl:{x:l,y:r}},G=a[o].reduce((V,E)=>{let D=E;return re(E)&&E.length>1&&(D=E[0]),D=fe(H({},D),{tagCenterPoint:R,tagVertexPoint:T}),[...V,D]},[]);t.push(G)}),M(t)}},P=e=>{var t,n,o,c,d,u;const r=e.pageX,f=e.pageY,l={x:r,y:f};let m=a;if((m==null?void 0:m.length)>0){let v=m[0];for(let x=0;x<m.length;x++)if(x>0){const $=(t=m[x][0])==null?void 0:t.tagCenterPoint,C=(n=v[0])==null?void 0:n.tagCenterPoint,R=_.getLineLength(l,$),T=_.getLineLength(l,C);R<T&&(v=a[x])}if(!l.x||!l.y)return;if(L(e.target.id)===((o=v[0])==null?void 0:o.id)){F(void 0);return}F((c=v[0])==null?void 0:c.id),((d=v[0])==null?void 0:d.tagVertexPoint)&&l&&q(l,(u=v[0])==null?void 0:u.tagVertexPoint)}},S=e=>{var t;const{target:n}=e;let o=-1,c=-1,d=-1,u=[],r=se(a);if(d=r.findIndex(f=>f[0].id===Number(B)),((t=n==null?void 0:n.parentNode)==null?void 0:t.parentNode.id)==="sortBox"){o=L(n.parentNode.id);const f=L(n.id);u=r[~~o].filter(m=>m.id===~~f);const l=r[~~o].findIndex(m=>m.id===~~f);r[~~o].splice(l,1)}if((n==null?void 0:n.parentNode.id)==="sortBox"){if(!B)return;o=L(n.id),c=r.findIndex(l=>l[0].id===o);const f=r.find(l=>l[0].id===o);f&&(u=f),r.splice(c,1),d=r.findIndex(l=>l[0].id===~~B)}switch(n.parentNode.id==="waitBox"&&(o=L(n.id),c=h.findIndex(f=>f.id===o),u=[h[c]],h.splice(c,1)),N){case g.Left:r.splice(d,0,u);break;case g.Right:r.splice(d+1,0,u);break;case g.Top:case g.Bottom:r[d].push(...u);break;default:r.push(u);break}M(r),y(void 0),p()},L=e=>{const t=e.indexOf("-");return Number(e.substring(t+1,e.length))};return s.createElement("div",{style:{padding:"0px 16px",marginBottom:"16px"}},s.createElement("div",{className:`${b}__title`},s.createElement("span",null,I("RankingQualityOfAnswers")),h.length>0&&s.createElement(ne,{color:"#FFD9D9",style:{color:"#F26549",marginLeft:8}},I("Unfinished"))),s.createElement("div",null,s.createElement("div",{style:{display:"flex",alignItems:"center"}},s.createElement("span",{style:{marginRight:"16px"}},I("ToBeSorted")),s.createElement("div",{id:"waitBox",className:`${b}__answerBox`},h.length>0&&h.map(e=>O({item:e,id:`waitBoxItem-${e==null?void 0:e.id}`,operation:{onDrag:P,onDragEnd:S}})))),s.createElement(me,null),s.createElement("div",{id:"sortBox",className:`${b}__answerBox`},a.map((e,t)=>{var n;return e.length>1?s.createElement("div",{key:`item-${t}`,id:`sortBox-${t}`},e.map(o=>O({item:o,id:`sortBoxItem-${o==null?void 0:o.id}`,operation:{onDrag:P,onDragEnd:S}}))):O({item:e[0],id:`sortBox-${(n=e[0])==null?void 0:n.id}`,operation:{onDrag:P,onDragEnd:S}})}))))};export{ge as default};
1
+ import s,{useReducer as ie,useContext as ae,useState as F,useEffect as se}from"react";import{prefix as le}from"../../../../../constant/index.js";import{Tag as de}from"antd";import{useTranslation as W}from"react-i18next";import{LeftOutlined as ce}from"@ant-design/icons";import{classnames as pe}from"../../../../../utils/index.js";import{isArray as ue,cloneDeep as fe}from"lodash";import{MathUtils as y}from"@labelbee/lb-annotation";import{LLMContext as ge}from"../../../../../store/ctx.js";var me=Object.defineProperty,ve=Object.defineProperties,xe=Object.getOwnPropertyDescriptors,q=Object.getOwnPropertySymbols,he=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable,z=(i,p,l)=>p in i?me(i,p,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[p]=l,J=(i,p)=>{for(var l in p||(p={}))he.call(p,l)&&z(i,l,p[l]);if(q)for(var l of q(p))_e.call(p,l)&&z(i,l,p[l]);return i},ye=(i,p)=>ve(i,xe(p)),m;(function(i){i.Top="Top",i.Right="Right",i.Bottom="Bottom",i.Left="Left"})(m||(m={}));const w=`${le}-LLMSidebar-contentBox`,B="@",be=()=>{const{t:i}=W();return s.createElement("div",{className:`${w}__navigation`},s.createElement("span",null,i("Best")),s.createElement("div",{style:{display:"flex",alignItems:"center",flex:1,margin:"0px 20px"}},s.createElement(ce,null),s.createElement("div",{style:{height:0,border:"1px solid #999999",width:"100%"}})),s.createElement("span",null,i("Worst")))},Le=i=>{const[,p]=ie(e=>e+1,0),{sortList:l,setSortList:K,waitSortList:U,disabeledAll:V,header:Y,title:X,prefixId:G="answer"}=i,N=`${G}-waitBox`,x=`${G}-sortBox`,{setHoverKey:H}=ae(ge),[O,b]=F(void 0),[E,Q]=F(void 0),[_,Z]=F([]),{t:S}=W();se(()=>{Z(U)},[U]);const T=({item:e,operation:t,id:n})=>{const o={[`border${O}`]:"2px solid #8C9AFF"};return s.createElement("div",J({key:`${e==null?void 0:e.id}`,color:"#EBEBEB",id:n,className:pe({[`${w}__answerTag`]:!0}),style:E===(e==null?void 0:e.id)&&O?o:void 0,draggable:V||!(e==null?void 0:e.id)?"":"true",onMouseMove:()=>{H(e.id)},onMouseLeave:()=>{H(-1)}},t),e==null?void 0:e.title)},D=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),ee=(e,t)=>{const n=y.getLineLength(e,D(t.tl,t.tr)),o=y.getLineLength(e,D(t.tr,t.tr)),d=y.getLineLength(e,D(t.bl,t.br)),c=y.getLineLength(e,D(t.tl,t.bl));return{minDistance:Math.min(n,o,d,c),toTopDistance:n,toRightDistance:o,toBottompDistance:d,toLeftDistance:c}},te=(e,t)=>{const{minDistance:n,toTopDistance:o,toRightDistance:d,toBottompDistance:c,toLeftDistance:u}=ee(e,t);switch(n){case o:b(m.Top);break;case d:b(m.Right);break;case c:b(m.Bottom);break;case u:b(m.Left);break}},C=()=>{const e=document.getElementById(x);if(e==null?void 0:e.childNodes){let t=[];e.childNodes.forEach((n,o)=>{var d;let c=n;((d=n==null?void 0:n.childNodes)==null?void 0:d.length)>1&&(c=n.childNodes[0]);const u=c.getBoundingClientRect()||{},{bottom:a,top:f,left:r,right:g,width:v,height:h,x:R,y:M}=u,j={x:r+v/2,y:f+h/2},k={tl:{x:R,y:M},tr:{x:g,y:f},br:{x:g,y:a},bl:{x:r,y:a}},oe=l[o].reduce((re,$)=>{let I=$;return ue($)&&$.length>1&&(I=$[0]),I=ye(J({},I),{tagCenterPoint:j,tagVertexPoint:k}),[...re,I]},[]);t.push(oe)}),K(t)}},P=e=>{var t,n,o,d,c,u;const a=e.pageX,f=e.pageY,r={x:a,y:f};let g=l;if((g==null?void 0:g.length)>0){let v=g[0];for(let h=0;h<g.length;h++)if(h>0){const R=(t=g[h][0])==null?void 0:t.tagCenterPoint,M=(n=v[0])==null?void 0:n.tagCenterPoint,j=y.getLineLength(r,R),k=y.getLineLength(r,M);j<k&&(v=l[h])}if(!r.x||!r.y)return;if(L(e.target.id)===((o=v[0])==null?void 0:o.id)){Q(void 0);return}Q((d=v[0])==null?void 0:d.id),((c=v[0])==null?void 0:c.tagVertexPoint)&&r&&(r==null?void 0:r.x)&&(r==null?void 0:r.y)&&te(r,(u=v[0])==null?void 0:u.tagVertexPoint)}},A=e=>{var t;const{target:n}=e;let o=-1,d=-1,c=-1,u=[],a=fe(l);if(c=a.findIndex(f=>f[0].id===Number(E)),((t=n==null?void 0:n.parentNode)==null?void 0:t.parentNode.id)===x){o=L(n.parentNode.id);const f=L(n.id);u=a[~~o].filter(g=>g.id===~~f);const r=a[~~o].findIndex(g=>g.id===~~f);a[~~o].splice(r,1)}if((n==null?void 0:n.parentNode.id)===x){if(!E)return;o=L(n.id),d=a.findIndex(r=>r[0].id===o);const f=a.find(r=>r[0].id===o);f&&(u=f),a.splice(d,1),c=a.findIndex(r=>r[0].id===~~E)}switch(n.parentNode.id===N&&(o=L(n.id),d=_.findIndex(f=>f.id===o),u=[_[d]],_.splice(d,1)),O){case m.Left:a.splice(c,0,u);break;case m.Right:a.splice(c+1,0,u);break;case m.Top:case m.Bottom:a[c].push(...u);break;default:a.push(u);break}K(a),b(void 0),p()},L=e=>{const t=e.indexOf(B);return Number(e.substring(t+1,e.length))},ne=Y!=null?Y:s.createElement("div",{className:`${w}__title`},s.createElement("span",null,X!=null?X:S("RankingQualityOfAnswers")),_.length>0&&s.createElement(de,{color:"#FFD9D9",style:{color:"#F26549",marginLeft:8}},S("Unfinished")));return s.createElement("div",{style:{padding:"0px 16px",marginBottom:"16px",width:"100%"}},ne,s.createElement("div",null,s.createElement("div",{style:{display:"flex",alignItems:"center"}},s.createElement("span",{style:{marginRight:"16px"}},S("ToBeSorted")),s.createElement("div",{id:N,className:`${w}__answerBox`},_.length>0&&_.map(e=>T({item:e,id:`${N}-waitBoxItem${B}${e==null?void 0:e.id}`,operation:{onDrag:P,onDragEnd:A,onDragStart:()=>C()}})))),s.createElement(be,null),s.createElement("div",{id:x,className:`${w}__answerBox`},l.map((e,t)=>{var n;return e.length>1?s.createElement("div",{key:`item-${t}`,id:`${x}${B}${t}`,style:{border:"1px dashed #d9d9d9"}},e.map(o=>T({item:o,id:`${x}-sortBoxItem${B}${o==null?void 0:o.id}`,operation:{onDrag:P,onDragEnd:A,onDragStart:()=>C()}}))):T({item:e[0],id:`${x}${B}${(n=e[0])==null?void 0:n.id}`,operation:{onDrag:P,onDragEnd:A,onDragStart:()=>C()}})}))))};export{Le as default};
@@ -0,0 +1 @@
1
+ import m,{forwardRef as V,useState as $,useMemo as A,useEffect as F,useImperativeHandle as M}from"react";import{useTranslation as R}from"react-i18next";import{useDebounceFn as T}from"ahooks";import H from"../answerSort/index.js";import{Tag as W}from"antd";import{isArray as z}from"lodash";var N=Object.defineProperty,Q=Object.defineProperties,U=Object.getOwnPropertyDescriptors,D=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,E=(a,t,r)=>t in a?N(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,g=(a,t)=>{for(var r in t||(t={}))k.call(t,r)&&E(a,r,t[r]);if(D)for(var r of D(t))q.call(t,r)&&E(a,r,t[r]);return a},_=(a,t)=>Q(a,U(t));const P=({selectedSort:a,initSelected:t,modelList:r})=>{var i;const d=t!=null?t:a;let S=[];const f=r.filter(s=>!(d&&(d==null?void 0:d.length)>0?d.flat():[]).includes(s.id));return d&&(d==null?void 0:d.length)>0&&(S=(i=d.map(s=>{var w;return(w=s.map(u=>r.find(h=>h.id===u)))==null?void 0:w.filter(u=>u)}))==null?void 0:i.filter(s=>(s==null?void 0:s.length)>0)),{waitSorts:f,newSort:S}},B=(a,t)=>{const{selectedSort:r,modelData:i,selectedAnswerSort:d,disabeledAll:S,imgIndex:f}=a,[s,w]=$({waitSorts:{},selecteds:r}),{t:u}=R(),h=A(()=>i.map((o,l)=>_(g({},o),{title:l+1})),[i,f]),x=A(()=>i.reduce((n,e)=>e.answerList.length>n.length?e.answerList:n,[]).map((n,e)=>({id:n.id,title:`${e+1}`}))||[],[i,f]);F(()=>{r&&i.length>0&&y()},[i,f]);const L=o=>(h.filter(n=>n.answerList.some(e=>e.id===o))||[]).map(n=>_(g({},n),{id:n.id,title:n.title})),y=o=>{const l=s,n=o!=null?o:r;x.forEach(e=>{const c=L(e.id),p=n==null?void 0:n[e.id],{waitSorts:v,newSort:O}=P({selectedSort:p,modelList:c});l.waitSorts[e.id]=v,l.selecteds[e.id]=O}),w(l)};M(t,()=>({clearValue:()=>y({})}),[i,f]);const b=(o,l)=>{if(l.some(e=>e.some(c=>c==null?void 0:c.id))){const e=_(g({},s.selecteds),{[o]:l}),c={};Object.keys(e).forEach(p=>{c[p]=e[p].map(v=>v.map(O=>O.id))}),d(c),w(_(g({},s),{selecteds:e}))}},{run:j}=T(b,{wait:0}),I=Object.keys(s.waitSorts).some(o=>x.some(l=>l.id===o)&&z(s.waitSorts[o])&&s.waitSorts[o].length>0);return m.createElement("div",null,m.createElement("div",{style:{fontWeight:500,fontSize:"16px",width:"100%",lineHeight:"46px",padding:"0px 16px"}},m.createElement("span",null,u("RankingQualityOfAnswers")),I&&m.createElement(W,{color:"#FFD9D9",style:{color:"#F26549",marginLeft:8}},u("Unfinished"))),x.map((o,l)=>{var n,e,c,p;return m.createElement("div",{key:l,style:{display:"flex"}},m.createElement("div",{style:{fontSize:"16px",fontWeight:500,width:"80px",lineHeight:"50px",textAlign:"center"}},`${u("Answer")}${l+1}`),m.createElement(H,{waitSortList:(e=(n=s==null?void 0:s.waitSorts)==null?void 0:n[o.id])!=null?e:[],sortList:(p=(c=s==null?void 0:s.selecteds)==null?void 0:c[o.id])!=null?p:[],setSortList:v=>{j(o.id,v)},disabeledAll:S,header:"",prefixId:`modelAnswer${l}`}))}))};var C=V(B);export{C as default,P as getSorts};
@@ -1,2 +1,2 @@
1
- import e,{useEffect as N}from"react";import{Form as m,Popover as S,Input as j,message as L}from"antd";import{useTranslation as A}from"react-i18next";import{InfoCircleOutlined as O}from"@ant-design/icons";import R from"../../../../markdownView/index.js";import k from"../../../../latexEditor/index.js";import c from"./index.module.scss.js";const B=w=>{const{disabeledAll:E,newAnswer:x,textEditObject:b,updateValue:f,answerIndex:g}=w,{max:a,min:u,isLaText:v,tip:h}=b,{TextArea:y}=j,[l]=m.useForm(),{t:o}=A(),V=o("LeastCharacterError",{num:u});N(()=>{l.setFieldsValue({value:x}),E||l.validateFields()},[x]);const I=n=>{var t,d;const T=`inputTextarea_${g}`,r=document.getElementById(T),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),C=s.substring(_,s.length),i=F+n+C;if(a&&(i==null?void 0:i.length)>a){L.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(S,{placement:"bottom",content:o("ShowEditingResultDifferencesInTextModeOnly")},e.createElement(O,{style:{margin:"0px 4px",cursor:"pointer"}}))),colon:!1,required:!!u}),e.createElement("div",{className:c.tip},h!=null?h:""),v&&e.createElement(k,{onSelectLatex:I,disabled:E}),e.createElement(m.Item,{name:"value",style:{marginBottom:24},rules:[{validator:(n,t="")=>u&&(t==null?void 0:t.length)<Number(u)?Promise.reject(V):Promise.resolve()}]},e.createElement(y,{maxLength:a,autoSize:{minRows:4,maxRows:10},allowClear:!0,disabled:E,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(R,{value:t}):""))}))};export{B as default};
1
+ import e,{useEffect as j}from"react";import{Form as m,Popover as C,Input as N,message as S}from"antd";import{useTranslation as A}from"react-i18next";import{InfoCircleOutlined as B}from"@ant-design/icons";import M from"../../../../markdownView/index.js";import O from"../../../../latexEditor/index.js";import c from"./index.module.scss.js";import R from"../../../../longText/index.js";const k=w=>{const{disabeledAll:x,newAnswer:E,textEditObject:b,updateValue:f,answerIndex:g}=w,{max:a,min:u,isLaText:v,tip:h}=b,{TextArea:y}=N,[l]=m.useForm(),{t:o}=A(),T=o("LeastCharacterError",{num:u});j(()=>{l.setFieldsValue({value:E}),x||l.validateFields()},[E]);const V=n=>{var t,d;const I=`inputTextarea_${g}`,r=document.getElementById(I),s=r.value||"",p=(t=r==null?void 0:r.selectionStart)!=null?t:s.length,_=(d=r.selectionEnd)!=null?d:s.length,F=s.substring(0,p),L=s.substring(_,s.length),i=F+n+L;if(a&&(i==null?void 0:i.length)>a){S.error(o("MaximumCharacterError",{num:a}));return}r.value=i,l.setFieldsValue({value:i}),f(i),r.selectionStart=p+n.length,r.selectionEnd=p+n.length,r.focus()};return e.createElement(m,{form:l,onValuesChange:(n,t)=>{const d=t.value;f(d)},className:c.form},e.createElement(m.Item,{name:"title",style:{marginBottom:0},label:e.createElement(e.Fragment,null,o("AnswerTextEdit"),e.createElement(C,{placement:"bottom",content:o("ShowEditingResultDifferencesInTextModeOnly")},e.createElement(B,{style:{margin:"0px 4px",cursor:"pointer"}}))),colon:!1,required:!!u}),e.createElement("div",{className:c.tip},e.createElement(R,{text:h!=null?h:"",overflowMaxLines:3,openByText:!0})),v&&e.createElement(O,{onSelectLatex:V,disabled:x}),e.createElement(m.Item,{name:"value",style:{marginBottom:24},rules:[{validator:(n,t="")=>u&&(t==null?void 0:t.length)<Number(u)?Promise.reject(T):Promise.resolve()}]},e.createElement(y,{maxLength:a,autoSize:{minRows:4,maxRows:10},allowClear:!0,disabled:x,showCount:!!a,style:{width:"100%"},id:`inputTextarea_${g}`})),v&&e.createElement(m.Item,{shouldUpdate:!0,noStyle:!0},()=>{const n=l.getFieldValue("value")||"",t=n.replace(/\n/g,`
2
+ `);return e.createElement("div",{className:c.outputDisplay},e.createElement("div",{className:c.title},o("OutputDisplay")),e.createElement("div",{className:c.content},n?e.createElement(M,{value:t}):""))}))};export{k as default};
@@ -1,2 +1,2 @@
1
- import r,{useEffect as j}from"react";import{Form as g,Input as F,message as L}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 D from"../../../../markdownView/index.js";var B=Object.defineProperty,R=Object.defineProperties,k=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,I=(a,e,t)=>e in a?B(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,q=(a,e)=>{for(var t in e||(e={}))M.call(e,t)&&I(a,t,e[t]);if(P)for(var t of P(e))$.call(e,t)&&I(a,t,e[t]);return a},z=(a,e)=>R(a,k(e));const U=a=>{const{disabeledAll:e,LLMConfig:t,textAttribute:y,setText:O}=a,h=(t==null?void 0:t.text)&&S(t.text)?t==null?void 0:t.text:[],{TextArea:T}=F,[v]=g.useForm(),{t:w}=C();j(()=>{const s=h.map((u,n)=>{var c;const m=(y==null?void 0:y.filter(o=>(o==null?void 0:o.textId)===(u==null?void 0:u.textId)))||[];return z(q({},u),{value:(c=m[0])==null?void 0:c.value})});v.setFieldsValue({text:s})},[h,y]);const V=({newText:s,fieldName:u,max:n})=>{var c,m;const o=`textInput_${u}`,l=document.getElementById(o),d=l.value||"",f=(c=l==null?void 0:l.selectionStart)!=null?c:d.length,p=(m=l.selectionEnd)!=null?m:d.length,_=d.substring(0,f),x=d.substring(p,d.length),i=_+s+x;if(n&&(i==null?void 0:i.length)>n){L.error(w("MaximumCharacterError",{num:n}));return}l.value=i,v.setFields([{name:["text",u,"value"],value:i,errors:[]}]),b(),l.selectionStart=f+s.length,l.selectionEnd=f+s.length,l.focus()},b=()=>{const s=v.getFieldValue("text");O(s)};return r.createElement(g,{form:v},r.createElement(g.List,{name:"text"},(s,u)=>r.createElement(r.Fragment,null,s.map((n,c)=>{const{max:m,min:o,title:l,tip:d,isLaText:f}=h[n.name]||{},p=l,_=w("LeastCharacterError",{num:o});return r.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"16px"},key:c},p&&r.createElement(g.Item,{name:[n.name,"title"],extra:d,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=>V({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(T,{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},w("OutputDisplay")),r.createElement("div",{className:E.content},x?r.createElement(D,{value:i}):""))}))}))))};export{U as default};
1
+ import t,{useEffect as V}from"react";import{Form as g,Input as j,message as F}from"antd";import L from"classnames";import{useTranslation as N}from"react-i18next";import S from"../../../../latexEditor/index.js";import E from"./index.module.scss.js";import C from"../../../../markdownView/index.js";import B from"../../../../longText/index.js";var D=Object.defineProperty,A=Object.defineProperties,R=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable,P=(a,e,r)=>e in a?D(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,$=(a,e)=>{for(var r in e||(e={}))k.call(e,r)&&P(a,r,e[r]);if(b)for(var r of b(e))M.call(e,r)&&P(a,r,e[r]);return a},q=(a,e)=>A(a,R(e));const z=a=>{const{disabeledAll:e,textConfig:r,textAttribute:w,setText:T}=a,{TextArea:I}=j,[v]=g.useForm(),{t:y}=N();V(()=>{const s=r.map((c,n)=>{var d;const m=(w==null?void 0:w.filter(o=>(o==null?void 0:o.textId)===(c==null?void 0:c.textId)))||[];return q($({},c),{value:(d=m[0])==null?void 0:d.value})});v.setFieldsValue({text:s})},[r,w]);const O=({newText:s,fieldName:c,max:n})=>{var d,m;const o=`textInput_${c}`,l=document.getElementById(o),u=l.value||"",f=(d=l==null?void 0:l.selectionStart)!=null?d:u.length,p=(m=l.selectionEnd)!=null?m:u.length,_=u.substring(0,f),x=u.substring(p,u.length),i=_+s+x;if(n&&(i==null?void 0:i.length)>n){F.error(y("MaximumCharacterError",{num:n}));return}l.value=i,v.setFields([{name:["text",c,"value"],value:i,errors:[]}]),h(),l.selectionStart=f+s.length,l.selectionEnd=f+s.length,l.focus()},h=()=>{const s=v.getFieldValue("text");T(s)};return t.createElement(g,{form:v},t.createElement(g.List,{name:"text"},(s,c)=>t.createElement(t.Fragment,null,s.map((n,d)=>{const{max:m,min:o,title:l,tip:u,isLaText:f}=r[n.name]||{},p=l,_=y("LeastCharacterError",{num:o});return t.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"16px"},key:d},p&&t.createElement(g.Item,{name:[n.name,"title"],extra:t.createElement(B,{text:u!=null?u:"",overflowMaxLines:3,openByText:!0}),className:E.textTitle,required:!!o,label:" ",colon:!1},l,p&&t.createElement("span",{className:L({clearText:!0,clearText__disabled:e}),style:{verticalAlign:"initial"},onClick:()=>{e||(v.setFields([{name:["text",n.name,"value"],value:void 0,errors:o?[_]:[]}]),h())}})),f&&p&&t.createElement(S,{onSelectLatex:x=>O({newText:x,fieldName:n.name,max:m}),disabled:e}),p&&t.createElement(g.Item,{name:[n.name,"value"],style:{marginBottom:24},rules:[{validator:(x,i)=>o&&(i==null?void 0:i.length)<Number(o)?Promise.reject(_):Promise.resolve()}],initialValue:void 0},t.createElement(I,{maxLength:m,disabled:e,showCount:!!m,autoSize:{minRows:4,maxRows:10},style:{width:"100%"},id:`textInput_${n.name}`,onChange:()=>h()})),f&&p&&t.createElement(g.Item,{shouldUpdate:!0,noStyle:!0},()=>{const x=v.getFieldValue(["text",n.name,"value"])||"",i=x.replace(/\n/g,`
2
+ `);return t.createElement("div",{className:E.outputDisplay},t.createElement("div",{className:E.title},y("OutputDisplay")),t.createElement("div",{className:E.content},x?t.createElement(C,{value:i}):""))}))}))))};export{z as default};
@@ -1 +1 @@
1
- import r,{useContext as q,useState as R,useEffect as C}from"react";import{prefix as at}from"../../../constant/index.js";import{Empty as lt,Button as ct}from"antd";import dt from"./components/answerSort/index.js";import{connect as ut}from"react-redux";import{isBoolean as mt,isString as pt,isNumber as ft,isObject as gt}from"lodash";import vt from"./components/answerList/index.js";import{LabelBeeContext as Lt,LLMContext as z}from"../../../store/ctx.js";import{jsonParser as F}from"../../../utils/index.js";import{getStepConfig as xt}from"../../../store/annotation/reducer.js";import{useCustomToolInstance as wt}from"../../../hooks/annotation.js";import{PageForward as j}from"../../../store/annotation/actionCreators.js";import{cKeyCode as St,EToolName as bt}from"@labelbee/lb-annotation";import{useTranslation as yt}from"react-i18next";import{getCurrentResultFromResultList as _t,getRenderDataByResult as Et,formatSort as ht}from"../utils/data.js";import Ct from"../../../assets/annotation/LLMTool/empty.svg.js";import jt from"./components/textInputBox/index.js";import Tt from"../../tagList/components/overall/index.js";import{getAnnotationStepByStepList as Pt}from"../../../utils/data.js";var At=Object.defineProperty,It=Object.defineProperties,Ot=Object.getOwnPropertyDescriptors,W=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable,G=(s,i,a)=>i in s?At(s,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[i]=a,d=(s,i)=>{for(var a in i||(i={}))Rt.call(i,a)&&G(s,a,i[a]);if(W)for(var a of W(i))Nt.call(i,a)&&G(s,a,i[a]);return s},p=(s,i)=>It(s,Ot(i));const Dt=St.default,T=`${at}-sidebar`,Mt=s=>{var i,a;const{annotation:J,dispatch:w,checkMode:Q}=s,{imgIndex:S,imgList:P,stepList:b,step:y,skipBeforePageTurning:_}=J,{modelAPIResponse:N,setModelAPIResponse:U}=q(z),{t:E}=yt(),u=(i=P[S])!=null?i:{},D=F(u==null?void 0:u.result),{toolInstanceRef:m}=wt({basicInfo:D}),[f,H]=R(),[,X]=R(0),{setNewAnswerList:Y}=q(z),[n,L]=R({}),x=!m.current.valid||Q;C(()=>{var t;if(b&&y){const e=(t=xt(b,y))==null?void 0:t.config;H(F(e))}},[y,JSON.stringify(b)]),C(()=>{!u||S===-1||(m.current.setValid=M,m.current.clearResult=Z,B())},[S,f]);const Z=()=>{B(u==null?void 0:u.questionList)},M=t=>{var e;mt(t)&&(m.current.valid=t,(e=m.current)==null||e.emit("validUpdated"),X(o=>o+1))},B=t=>{const e=Pt(b,y),o=_t(u==null?void 0:u.result,e);let l=u==null?void 0:u.questionList;(o==null?void 0:o.answerList)&&m.current.valid&&(l=o),t&&(l=t,o.sort=[]),M(D.valid);const g=Et(f,l);L(d({},g)),U([])};C(()=>{const{newSort:t,answerList:e,textAttribute:o,tagList:l}=n,g=ht(t||[]),c={answerList:e,sort:g,tagList:l,textAttribute:o,id:u==null?void 0:u.id,modelAPIResponse:N};m.current.exportData=()=>[[c],{valid:m.current.valid}],m.current.currentPageResult=p(d({},c),{toolName:bt.LLM}),Y(e||[])},[n,N,m.current.valid]),C(()=>(window.addEventListener("keydown",$),()=>{window.removeEventListener("keydown",$)}),[]);const $=t=>{if(t.ctrlKey&&t.keyCode===Dt.Enter){if(_){_(()=>w(j()));return}w(j())}},tt=({order:t,value:e,key:o})=>{const{answerList:l}=n,g=l==null?void 0:l.map(c=>{var h;if((c==null?void 0:c.order)===t){if(o==="textEdit"&&pt(e))return p(d({},c),{newAnswer:e});if(ft(e))return p(d({},c),{score:e});if(gt(e)&&o){const I={[e==null?void 0:e.key]:e.value},O=(h=c[o])!=null?h:{};return p(d({},c),{[o]:d(d({},O),I)})}}return c});L(p(d({},n),{answerList:g||[]}))};if((()=>{var t,e;const{indicatorScore:o=[],indicatorDetermine:l=[],text:g=[],enableSort:c,isTextEdit:h,tagInputListConfigurable:I}=f||{},O=((t=o==null?void 0:o.filter(v=>v.label&&v.value&&v.score))==null?void 0:t.length)>0,it=((e=l==null?void 0:l.filter(v=>v.label&&v.value))==null?void 0:e.length)>0,st=(g==null?void 0:g.length)>0;return!(O||it||st||c||h||I)})())return r.createElement("div",{className:`${T}`},r.createElement("div",{className:`${T}__content`,style:{display:"flex",justifyContent:"center",alignItems:"center"}},r.createElement(lt,{description:r.createElement("span",{style:{color:"#ccc"}},E("NoScoringScale")),imageStyle:{width:200,height:200},image:r.createElement("img",{src:Ct})})));const{indicatorScore:V=[],indicatorDetermine:k=[],enableSort:et,isTextEdit:nt,inputList:A=[],tagInputListConfigurable:K}=f||{},ot=K&&((a=A.filter(t=>!t.isOverall))==null?void 0:a.length)>0,rt=(k==null?void 0:k.length)>0||(V==null?void 0:V.length)>0||nt||ot;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"}},E("GlobalAnnotation")),et&&r.createElement(dt,{waitSortList:(n==null?void 0:n.waitSorts)||[],sortList:(n==null?void 0:n.newSort)||[],setSortList:t=>{L(p(d({},n),{newSort:t}))},disabeledAll:x}),K&&A.length&&r.createElement(Tt,{inputList:A,selectedTags:(n==null?void 0:n.tagList)||{},updateValue:t=>{const{key:e,value:o}=t,l=n==null?void 0:n.tagList;L(p(d({},n),{tagList:p(d({},l),{[e]:o})}))},disabeledAll:x}),(f==null?void 0:f.text)&&r.createElement("div",{style:{padding:"0px 16px",marginTop:"16px"}},r.createElement(jt,{textAttribute:(n==null?void 0:n.textAttribute)||[],LLMConfig:f,setText:t=>L(p(d({},n),{textAttribute:t})),disabeledAll:x})),r.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},E("QualifiedAnnotation")),r.createElement("div",null,rt&&r.createElement(vt,{list:(n==null?void 0:n.answerList)||[],LLMConfig:f,updateValue:tt,disabeledAll:x}))),r.createElement("div",{style:{margin:"24px 16px",display:"flex"}},(P==null?void 0:P.length)-1!==S&&r.createElement(ct,{type:"primary",style:{marginLeft:"auto"},onClick:()=>{if(_){_(()=>w(j()));return}w(j())},disabled:x},E("Save"))))},Bt=s=>({annotation:s.annotation});var $t=ut(Bt,null,null,{context:Lt})(Mt);export{$t as default};
1
+ import i,{useContext as q,useState as R,useEffect as P,useMemo as ct}from"react";import{prefix as dt}from"../../../constant/index.js";import{Button as ut,Empty as mt}from"antd";import pt from"./components/answerSort/index.js";import{connect as ft}from"react-redux";import{isBoolean as gt,isArray as vt,isString as xt,isNumber as Lt,isObject as wt}from"lodash";import St from"./components/answerList/index.js";import{LabelBeeContext as yt,LLMContext as z}from"../../../store/ctx.js";import{jsonParser as F}from"../../../utils/index.js";import{getStepConfig as Et}from"../../../store/annotation/reducer.js";import{useCustomToolInstance as bt}from"../../../hooks/annotation.js";import{PageForward as T}from"../../../store/annotation/actionCreators.js";import{cKeyCode as _t,EToolName as Ct}from"@labelbee/lb-annotation";import{useTranslation as W}from"react-i18next";import{getCurrentResultFromResultList as ht,getRenderDataByResult as jt,formatSort as Pt}from"../utils/data.js";import Tt from"../../../assets/annotation/LLMTool/empty.svg.js";import It from"./components/textInputBox/index.js";import At from"../../tagList/components/overall/index.js";import Ot from"../../../utils/StepUtils.js";var Nt=Object.defineProperty,Rt=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,J=(s,o,l)=>o in s?Nt(s,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[o]=l,d=(s,o)=>{for(var l in o||(o={}))Mt.call(o,l)&&J(s,l,o[l]);if(G)for(var l of G(o))Bt.call(o,l)&&J(s,l,o[l]);return s},p=(s,o)=>Rt(s,Dt(o));const $t=_t.default,I=`${dt}-sidebar`,Q=()=>{const{t:s}=W();return i.createElement("div",{className:`${I}`},i.createElement("div",{className:`${I}__content`,style:{display:"flex",justifyContent:"center",alignItems:"center"}},i.createElement(mt,{description:i.createElement("span",{style:{color:"#ccc"}},s("NoScoringScale")),imageStyle:{width:200,height:200},image:i.createElement("img",{src:Tt})})))},H=s=>{var o,l;const{indicatorScore:_=[],indicatorDetermine:g=[],text:C=[],enableSort:v,isTextEdit:S,tagInputListConfigurable:x,dialogSort:L=!1}=s||{},w=((o=_==null?void 0:_.filter(n=>n.label&&n.value&&n.score))==null?void 0:o.length)>0,h=((l=g==null?void 0:g.filter(n=>n.label&&n.value))==null?void 0:l.length)>0,A=(C==null?void 0:C.length)>0;return!(w||h||A||v||S||x||L)},Vt=s=>{var o,l;const{annotation:_,dispatch:g,checkMode:C}=s,{imgIndex:v,imgList:S,stepList:x,step:L,skipBeforePageTurning:w}=_,{modelAPIResponse:h,setModelAPIResponse:A}=q(z),{t:j}=W(),n=(o=S[v])!=null?o:{},D=F(n==null?void 0:n.result),{toolInstanceRef:f}=bt({basicInfo:D}),[c,X]=R(),[O,Y]=R(!0),{setNewAnswerList:Z}=q(z),[e,y]=R({}),E=!f.current.valid||C;P(()=>{var t;if(x&&L){const r=(t=Et(x,L))==null?void 0:t.config;X(F(r))}},[L,JSON.stringify(x)]),P(()=>{!n||v===-1||(f.current.setValid=M,f.current.clearResult=tt,M(),B())},[v,c,n==null?void 0:n.id]);const tt=()=>{B(n==null?void 0:n.questionList)},M=t=>{var r;const a=t!=null?t:D.valid;gt(a)&&(Y(a),f.current.valid=a,(r=f.current)==null||r.emit("validUpdated"))},B=t=>{const r=Ot.getCurrentStepInfo(L,x),a=ht(n==null?void 0:n.result,r.step);let u=n==null?void 0:n.questionList;(a==null?void 0:a.answerList)&&f.current.valid&&(u=a),t&&(u=t,a.sort=[]);const b=jt(c,u);y(d({},b)),A([])};P(()=>{et(),Z((e==null?void 0:e.answerList)||[])},[e,h,O]),P(()=>(window.addEventListener("keydown",$),()=>{window.removeEventListener("keydown",$)}),[]);const et=()=>{const{newSort:t,answerList:r,textAttribute:a,tagList:u}=e,b=Pt(t||[]),m={answerList:r,sort:b,tagList:u,textAttribute:a,id:n==null?void 0:n.id,modelAPIResponse:h};f.current.exportData=()=>[[m],{valid:O}],f.current.currentPageResult=p(d({},m),{toolName:Ct.LLM,valid:O})},$=t=>{if(t.ctrlKey&&t.keyCode===$t.Enter){if(w){w(()=>g(T()));return}g(T())}},nt=({order:t,value:r,key:a})=>{const{answerList:u}=e,b=u==null?void 0:u.map(m=>{var U;if((m==null?void 0:m.order)===t){if(a==="textEdit"&&xt(r))return p(d({},m),{newAnswer:r});if(Lt(r))return p(d({},m),{score:r});if(wt(r)&&a){const at={[r==null?void 0:r.key]:r.value},lt=(U=m[a])!=null?U:{};return p(d({},m),{[a]:d(d({},lt),at)})}}return m});y(p(d({},e),{answerList:b||[]}))};if(ct(()=>H(c),[c]))return i.createElement(Q,null);const{indicatorScore:V=[],indicatorDetermine:k=[],enableSort:ot,isTextEdit:rt,inputList:N=[],tagInputListConfigurable:K}=c||{},it=K&&((l=N.filter(t=>!t.isOverall))==null?void 0:l.length)>0,st=(k==null?void 0:k.length)>0||(V==null?void 0:V.length)>0||rt||it;return i.createElement("div",{className:`${I}`},i.createElement("div",{className:`${I}__content`},i.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},j("GlobalAnnotation")),ot&&i.createElement(pt,{waitSortList:(e==null?void 0:e.waitSorts)||[],sortList:(e==null?void 0:e.newSort)||[],setSortList:t=>{y(p(d({},e),{newSort:t}))},disabeledAll:E}),K&&N.length&&i.createElement(At,{inputList:N,selectedTags:(e==null?void 0:e.tagList)||{},updateValue:t=>{const{key:r,value:a}=t,u=e==null?void 0:e.tagList;y(p(d({},e),{tagList:p(d({},u),{[r]:a})}))},disabeledAll:E}),(c==null?void 0:c.text)&&i.createElement("div",{style:{padding:"0px 16px",marginTop:"16px"}},i.createElement(It,{textAttribute:(e==null?void 0:e.textAttribute)||[],textConfig:(c==null?void 0:c.text)&&vt(c.text)?c==null?void 0:c.text:[],setText:t=>y(p(d({},e),{textAttribute:t})),disabeledAll:E})),i.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},j("QualifiedAnnotation")),i.createElement("div",null,st&&i.createElement(St,{list:(e==null?void 0:e.answerList)||[],LLMConfig:c,updateValue:nt,disabeledAll:E}))),i.createElement("div",{style:{margin:"24px 16px",display:"flex"}},(S==null?void 0:S.length)-1!==v&&i.createElement(ut,{type:"primary",style:{marginLeft:"auto"},onClick:()=>{if(w){w(()=>g(T()));return}g(T())},disabled:E},j("Save"))))},kt=s=>({annotation:s.annotation});var Kt=ft(kt,null,null,{context:yt})(Vt);export{Q as EmptyConfig,Kt as default,H as getLLMIsNoConfig};
@@ -1 +1 @@
1
- import V from"../../assets/attributeIcon/icon_eyeLock_a.svg.js";import x from"../../assets/attributeIcon/icon_eyeLock_h.svg.js";import{COLORS_ARRAY as b,NULL_COLOR as K}from"../../data/Style.js";import{ColorTag as B}from"../colorTag/index.js";import{Radio as y}from"antd/es";import n,{useState as C,useEffect as F}from"react";import{Popover as G,message as H}from"antd";import M from"../colorPalette/index.js";import{CloseOutlined as W}from"@ant-design/icons";import{useTranslation as Y}from"react-i18next";import $ from"./components/limitPopover/index.js";import q from"lodash";import{CommonToolUtils as J,MathUtils as s}from"@labelbee/lb-annotation";const E=[K].concat(b),Q=n.forwardRef((e,R)=>{const _=n.useRef(),{t:g}=Y(),w=e.list||[],[A,m]=C(!1),[P,T]=C(void 0),[c,I]=C([]);let d=[...E];e.forbidDefault===!0&&(d=d.slice(1));let k="sensebee-radio-group";e.noHeightLimit&&(k="sensebee-radio-group-no-limit-height");const L=t=>{var l,u;if(!J.hotkeyFilter(t)||(e==null?void 0:e.forbidColor))return;let o=t.keyCode;e.forbidDefault===!0&&(o=o-1);let i;if(s.isInRange(t.keyCode,[48,57])&&(i=e.list[o-48]),s.isInRange(t.keyCode,[96,105])&&(i=e.list[o-96]),t.shiftKey&&i){if(!(e==null?void 0:e.attributeLockChange))return;f(t,i),t.preventDefault();return}(s.isInRange(t.keyCode,[48,57])||s.isInRange(t.keyCode,[96,105]))&&((u=e==null?void 0:e.attributeChanged)==null||u.call(e,(l=i==null?void 0:i.value)!=null?l:""))};F(()=>(window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)));const O=(t,l)=>{e.updateColorConfig&&e.updateColorConfig(t,l)},S=(t,l)=>{if(t.shiftKey&&(e==null?void 0:e.attributeLockChange)){f(t,l);return}e.attributeChanged(t.target.value)},f=(t,l)=>{var u;if(e==null?void 0:e.forbidColor)return;const o=c.includes(l.value);let i=q.cloneDeep(c);o?i=i.filter(a=>a!==l.value):i.push(l.value),I(i),(u=e==null?void 0:e.attributeLockChange)==null||u.call(e,i),o||H.success(g("AttributeLockNotify",{label:l.label})),t.preventDefault()};return n.createElement("div",{className:k,style:e.style},n.createElement(y.Group,{name:"radiogroup",defaultValue:e==null?void 0:e.selectedAttribute,value:e==null?void 0:e.selectedAttribute,ref:R},w.map((t,l)=>{var u,o,i;let a=(u=e==null?void 0:e.num)!=null?u:l;const D=(t==null?void 0:t.value)===(e==null?void 0:e.selectedAttribute);e.forbidDefault===!0&&typeof a=="number"&&a++,typeof a=="number"&&a<=9&&a>=0||(a="-");let v=l>8&&!e.forbidDefault?b[(l-1)%b.length]:d[l%d.length];(t==null?void 0:t.color)&&(v=t.color);const{defaultSize:j,logicalCondition:h,sizeRange:N}=((o=t==null?void 0:t.limit)==null?void 0:o.sizeLimit)||{},z=((i=t==null?void 0:t.limit)==null?void 0:i.positionLimit)||j||N||(h==null?void 0:h.length)>0,U=D&&z&&e.forbidShowLimitPopover!==!0;return n.createElement(y,{value:t.value,ref:_,key:t.label+l,onClick:r=>S(r,t)},n.createElement("span",{className:"sensebee-radio-label",title:t.label},!(e==null?void 0:e.forbidColor)&&n.createElement(G,{content:n.createElement(M,{defaultColor:v,setColor:r=>O(t.value,r)}),title:n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("span",null,g("Palette")),n.createElement(W,{onClick:()=>m(!1)})),visible:A&&P===l,onVisibleChange:r=>{!r||m(r)}},n.createElement(B,{color:v,style:{cursor:"pointer",marginRight:"8px"},onClick:()=>{(e==null?void 0:e.enableColorPicker)&&(T(l),m(!0))}})),t.label),!(e==null?void 0:e.forbidColor)&&(e==null?void 0:e.attributeLockChange)&&n.createElement("img",{onClick:r=>f(r,t),src:c.includes(t.value)?V:x,style:{display:c.includes(t.value)?"inline-block":""},className:"sensebee-radio-icon"}),U&&n.createElement($,{limit:t.limit,updateSize:e==null?void 0:e.updateSize}),n.createElement("span",{className:"sensebee-radio-num"},a))})))});export{E as ATTRIBUTE_COLORS,Q as default};
1
+ import K from"../../assets/attributeIcon/icon_eyeLock_a.svg.js";import B from"../../assets/attributeIcon/icon_eyeLock_h.svg.js";import{COLORS_ARRAY as b,NULL_COLOR as F}from"../../data/Style.js";import{ColorTag as G}from"../colorTag/index.js";import{Radio as y}from"antd/es";import n,{useState as C,useEffect as H}from"react";import{Popover as M,message as W}from"antd";import Y from"../colorPalette/index.js";import{CloseOutlined as $}from"@ant-design/icons";import{useTranslation as q}from"react-i18next";import J from"./components/limitPopover/index.js";import E from"lodash";import{CommonToolUtils as Q,MathUtils as s}from"@labelbee/lb-annotation";const R=[F].concat(b),X=n.forwardRef((e,_)=>{const w=n.useRef(),{t:g}=q(),A=e.list||[],[P,m]=C(!1),[T,D]=C(void 0),[c,I]=C([]);let d=[...R];e.forbidDefault===!0&&(d=d.slice(1));let k="sensebee-radio-group";e.noHeightLimit&&(k="sensebee-radio-group-no-limit-height");const L=t=>{var l,u;if(!Q.hotkeyFilter(t)||(e==null?void 0:e.forbidColor))return;let o=t.keyCode;e.forbidDefault===!0&&(o=o-1);let i;if(s.isInRange(t.keyCode,[48,57])&&(i=e.list[o-48]),s.isInRange(t.keyCode,[96,105])&&(i=e.list[o-96]),t.shiftKey&&i){if(!(e==null?void 0:e.attributeLockChange))return;f(t,i),t.preventDefault();return}(s.isInRange(t.keyCode,[48,57])||s.isInRange(t.keyCode,[96,105]))&&((u=e==null?void 0:e.attributeChanged)==null||u.call(e,(l=i==null?void 0:i.value)!=null?l:""))};H(()=>(window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)));const O=(t,l)=>{e.updateColorConfig&&e.updateColorConfig(t,l)},S=(t,l)=>{if(t.shiftKey&&(e==null?void 0:e.attributeLockChange)){f(t,l);return}e.attributeChanged(t.target.value)},j=E.debounce(S,100),f=(t,l)=>{var u;if(e==null?void 0:e.forbidColor)return;const o=c.includes(l.value);let i=E.cloneDeep(c);o?i=i.filter(a=>a!==l.value):i.push(l.value),I(i),(u=e==null?void 0:e.attributeLockChange)==null||u.call(e,i),o||W.success(g("AttributeLockNotify",{label:l.label})),t.preventDefault()};return n.createElement("div",{className:k,style:e.style},n.createElement(y.Group,{name:"radiogroup",defaultValue:e==null?void 0:e.selectedAttribute,value:e==null?void 0:e.selectedAttribute,ref:_},A.map((t,l)=>{var u,o,i;let a=(u=e==null?void 0:e.num)!=null?u:l;const N=(t==null?void 0:t.value)===(e==null?void 0:e.selectedAttribute);e.forbidDefault===!0&&typeof a=="number"&&a++,typeof a=="number"&&a<=9&&a>=0||(a="-");let v=l>8&&!e.forbidDefault?b[(l-1)%b.length]:d[l%d.length];(t==null?void 0:t.color)&&(v=t.color);const{defaultSize:z,logicalCondition:h,sizeRange:U}=((o=t==null?void 0:t.limit)==null?void 0:o.sizeLimit)||{},V=((i=t==null?void 0:t.limit)==null?void 0:i.positionLimit)||z||U||(h==null?void 0:h.length)>0,x=N&&V&&e.forbidShowLimitPopover!==!0;return n.createElement(y,{value:t.value,ref:w,key:t.label+l,onClick:r=>j(r,t)},n.createElement("span",{className:"sensebee-radio-label",title:t.label},!(e==null?void 0:e.forbidColor)&&n.createElement(M,{content:n.createElement(Y,{defaultColor:v,setColor:r=>O(t.value,r)}),title:n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("span",null,g("Palette")),n.createElement($,{onClick:()=>m(!1)})),visible:P&&T===l,onVisibleChange:r=>{!r||m(r)}},n.createElement(G,{color:v,style:{cursor:"pointer",marginRight:"8px"},onClick:()=>{(e==null?void 0:e.enableColorPicker)&&(D(l),m(!0))}})),t.label),!(e==null?void 0:e.forbidColor)&&(e==null?void 0:e.attributeLockChange)&&n.createElement("img",{onClick:r=>f(r,t),src:c.includes(t.value)?K:B,style:{display:c.includes(t.value)?"inline-block":""},className:"sensebee-radio-icon"}),x&&n.createElement(J,{limit:t.limit,updateSize:e==null?void 0:e.updateSize}),n.createElement("span",{className:"sensebee-radio-num"},a))})))});export{R as ATTRIBUTE_COLORS,X as default};
@@ -1 +1 @@
1
- import{RightOutlined as C}from"@ant-design/icons";import t,{useMemo as p,useContext as b,useState as u,useEffect as A}from"react";import{Input as g}from"antd";import{useSetState as x}from"ahooks";import a from"./index.module.scss.js";var s;(function(o){o.before="\u524D\u6587",o.after="\u540E\u6587"})(s||(s={}));const v=o=>{const{audioContext:e}=o;if(!e||!e.visible)return null;const{content:i,type:n}=e;return t.createElement(E,{title:s==null?void 0:s[n],content:i})},E=o=>{const[e,i]=u(!0),[n,m]=u(""),{title:f,content:l}=o,r=()=>{i(!e)};return A(()=>{m(l),i(!0)},[l]),t.createElement("div",{className:a.audioContextContainer},t.createElement("div",{className:a.title},t.createElement(C,{style:{marginRight:8},rotate:e?90:0,onClick:r}),t.createElement("span",{onClick:r},f)),e&&t.createElement("div",{className:a.content},t.createElement(g.TextArea,{bordered:!1,value:n,disabled:!0,style:{padding:0},autoSize:!0})))},c={selectedAttribute:"",selectedRegion:{},attributeLockList:[],clipConfigurable:!1,clipAttributeConfigurable:!1,clipAttributeList:[],clipTextConfigurable:!1,combined:!1,segment:!1},d=t.createContext({audioClipState:c,setAudioClipState:()=>{}}),S=()=>b(d),y=({children:o})=>{const[e,i]=x(c),n=p(()=>({audioClipState:e,setAudioClipState:i}),[e,i]);return t.createElement(d.Provider,{value:n},o)};export{y as AudioClipProvider,s as EContextType,v as default,S as useAudioClipStore};
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 t from"react";import L from"../../../attributeList/index.js";import{EventBus as v}from"@labelbee/lb-annotation";import $ from"../../../../assets/annotation/audio/clipSmall.svg.js";import R from"../../../../assets/annotation/audio/clipASmall.svg.js";import T from"../../../../assets/annotation/audio/delete.svg.js";import k from"../../../../assets/annotation/audio/loopA.svg.js";import{getAttributeShowText as F,timeFormat as b}from"../../../../utils/audio.js";import I from"../../../longText/index.js";import{classnames as D}from"../../../../utils/index.js";import i from"./index.module.scss.js";import{useTranslation as B}from"react-i18next";var V=Object.defineProperty,q=Object.defineProperties,z=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,_=(a,e,r)=>e in a?V(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,S=(a,e)=>{for(var r in e||(e={}))G.call(e,r)&&_(a,r,e[r]);if(E)for(var r of E(e))H.call(e,r)&&_(a,r,e[r]);return a},x=(a,e)=>q(a,z(e));const J=a=>{const{regions:e=[],updateRegion:r,useAudioClipStore:y}=a,{audioClipState:C,setAudioClipState:d}=y(),{t:n}=B(),{selectedAttribute:j,selectedRegion:p,clipTextConfigurable:g,clipAttributeList:m,clipAttributeConfigurable:c}=C,{id:l}=p,N=s=>{if(e.length&&l){const o=e.find(u=>u.id===l);r(x(S({},o),{attribute:s}))}d({selectedAttribute:s})},f=[{label:"\u65E0\u5C5E\u6027",value:"",key:"\u65E0\u5C5E\u6027"},...m.map(s=>x(S({},s),{label:s.key}))];return t.createElement("div",{className:i.clipSidebar},t.createElement("div",{className:i.clipResults},t.createElement("div",{className:i.title},n("ClippedAudio")),e.length>0?t.createElement("div",{className:i.regions},e.map(s=>{const{id:o,attribute:u,text:A,start:O,end:P}=s,h=o===l&&p.loop,w=`${c?F(u,f):""}${c&&g?"\uFF0C":""}${g?`${n("textTool")}\uFF1A${A}`:""}`;return t.createElement("div",{className:D({[i.region]:!0,[i.selected]:o===l}),key:o,onClick:()=>{v.emit("setSelectedRegion",{id:o,playImmediately:!0})}},t.createElement("div",{className:i.label},h&&t.createElement("img",{src:k}),t.createElement("div",{className:i.text},t.createElement(I,{text:w}))),t.createElement("div",{className:i.time},t.createElement("img",{src:l===o?R:$}),b(O,"ss.SSS")," -",b(P,"ss.SSS")),t.createElement("div",{className:i.delete,onClick:()=>{v.emit("removeRegionById",o)}},t.createElement("img",{src:T})))})):t.createElement("div",{className:i.empty},n("NoClippedData"))),c&&(m==null?void 0:m.length)>0&&t.createElement("div",{className:i.attributeList},t.createElement(L,{list:f,attributeChanged:N,selectedAttribute:j,attributeLockChange:s=>{d({attributeLockList:s})}})))};export{J as default};
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 i,{useState as F,useEffect as B,useMemo as ne}from"react";import{AudioPlayer as _e}from"../audioPlayer/index.js";import{getClassName as Ce}from"../../utils/dom.js";import Re from"../predictTracking/previewResult/index.js";import{Layout as oe}from"antd/es";import{Spin as Te}from"antd";import{prefix as je}from"../../constant/index.js";import{cKeyCode as Pe,CommonToolUtils as K,uuid as he,TagUtils as we,EventBus as Le,cTool as Oe}from"@labelbee/lb-annotation";import N from"./index.module.scss.js";import Ae from"./tagResultShow/index.js";import{AudioClipProvider as Ie,useAudioClipStore as Ne}from"./audioContext/index.js";import ke from"./textInput/index.js";import{connect as De}from"react-redux";import{a2MapStateToProps as $e}from"../../store/annotation/map.js";import{LabelBeeContext as Me}from"../../store/ctx.js";import{jsonParser as Ve}from"../../utils/index.js";import{useCustomToolInstance as Be}from"../../hooks/annotation.js";import{sidebarCls as Q}from"../../views/MainView/sidebar/index.js";import Ke from"./audioSide/labelSidebar/index.js";import We from"./audioSide/clipSidebar/index.js";import Ue from"../../assets/annotation/audio/tag.svg.js";import Fe from"../../assets/annotation/audio/tagA.svg.js";import Xe from"../../assets/annotation/audio/clip.svg.js";import qe from"../../assets/annotation/audio/clipA.svg.js";var ze=Object.defineProperty,Ge=Object.defineProperties,He=Object.getOwnPropertyDescriptors,ie=Object.getOwnPropertySymbols,Je=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,le=(t,n,s)=>n in t?ze(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s,E=(t,n)=>{for(var s in n||(n={}))Je.call(n,s)&&le(t,s,n[s]);if(ie)for(var s of ie(n))Qe.call(n,s)&&le(t,s,n[s]);return t},k=(t,n)=>Ge(t,He(n));const{EAudioToolName:Ye}=Oe,re=Pe.default,{Sider:Ze,Content:et}=oe,se=`${je}-layout`,tt=({setSideTab:t,sideTab:n})=>{const s=[{tab:"tag",commonSvg:Ue,selectedSvg:Fe},{tab:"clip",commonSvg:Xe,selectedSvg:qe}];return i.createElement("div",{className:N.toggleAudioOption},s.map((p,S)=>{const{tab:f,selectedSvg:x,commonSvg:R}=p;return i.createElement("div",{key:S,className:N.option},i.createElement("img",{className:N.icon,src:n===f?x:R,onClick:()=>{n!==f&&t(f)}}))}))},nt=({result:t,inputDisabled:n,updateText:s,configList:p,autofocus:S,preContext:f,isCheck:x,clipAttributeConfigurable:R,clipTextConfigurable:D,textConfigurable:g,updateRegion:_,clipAttributeList:m})=>i.createElement("div",{className:N.textareaContainer},i.createElement("div",{className:N.textareaContent},i.createElement(ke,{isCheck:x,result:t==null?void 0:t.value,textInputDisabled:n,textID:(t==null?void 0:t.id)||0,updateText:s,configList:p,autofocus:!n&&S,preContext:f,regions:t==null?void 0:t.regions,clipAttributeConfigurable:R,clipTextConfigurable:D,textConfigurable:g,updateRegion:_,clipAttributeList:m}))),ot=t=>{var n,s;const{sider:p,config:S,result:f,updateTagResult:x,updateRegion:R,isEdit:D,tagConfigurable:g,clipConfigurable:_}=t;let m=(S==null?void 0:S.inputList)||[],C=(n=f==null?void 0:f.tag)!=null?n:{},a=(s=f==null?void 0:f.regions)!=null?s:[];const[X,L]=F([]),[T,v]=F("tag");B(()=>{if(!g&&_){v("clip");return}v("tag")},[g,_]),B(()=>(window.addEventListener("keydown",$),()=>{window.removeEventListener("keydown",$)}));const $=l=>{if(g&&_)switch(l.keyCode){case re.L:v("tag");break;case re.X:v("clip");break}if(T==="tag"){if(!K.hotkeyFilter(l))return;K.isMoveKey(l==null?void 0:l.keyCode)&&l.preventDefault();let r=l.keyCode;if(r&&(r<=57&&r>=49||r<=105&&r>=97)){r>57?r=r-97:r=r-49;const d=X.slice();m.length===1?(j(0,r),L([0,r]),setTimeout(()=>{L([])},500)):d.length===1?(j(d[0],r),L([d[0],r]),setTimeout(()=>{L([])},500)):L([r])}}},j=(l,r)=>{if(l<m.length&&m[l].subSelected&&r<m[l].subSelected.length){const d=m[l].value,b=m[l].isMulti;let P=m[l].subSelected[r].value,q=0;const W=C;for(const h in C)if(h===m[l].value){if(q++,b===!0){const I=W[h].split(";").filter(z=>z!==""),V=I.indexOf(P);V===-1?I.push(P):I.splice(V,1),P=I.join(";")}P===""?delete W[h]:W[h]=P}q===0&&Object.assign(C,{[d]:P}),x(C)}},O=l=>{delete C[l],x(C)},A=g&&_&&i.createElement(tt,{setSideTab:v,sideTab:T}),M=T==="tag"&&i.createElement(Ke,{labelInfoSet:g?m:[],labelSelectedList:X,setLabel:j,tagResult:C,clearResult:O,isEdit:D,withPanelTab:!1}),u=T==="clip"&&i.createElement(We,{regions:a,updateRegion:R,useAudioClipStore:Ne});return p?typeof p=="function"?i.createElement("div",{className:`${Q}`},p({toggleAudioOption:A,labelSidebar:M,clipSidebar:u})):p:i.createElement("div",{className:`${Q}`},i.createElement("div",{className:`${Q}__content`},A,M,u))},it=t=>{var n,s,p,S,f,x,R,D,g;const _=(s=(n=t.style)==null?void 0:n.sider)==null?void 0:s.width,{step:m,stepList:C,audioContext:a,sider:X,drawLayerSlot:L,imgList:T,imgIndex:v,currentData:$,config:j,stepInfo:O}=t,A=K.getCurrentStepToolAndConfig(m,C),M=Ve($.result),{toolInstanceRef:u}=Be({basicInfo:M}),[l,r]=F(!0),[d,b]=F(null),[P,q]=F(0);B(()=>{r(!0)},[v]),B(()=>{l===!1&&pe()},[l]),B(()=>{W()},[]),B(()=>{u.current.exportData=()=>[[d],{duration:P,valid:H}],u.current.setResult=Se,u.current.clearResult=xe,u.current.currentPageResult=d==null?void 0:d.regions,u.current.emit("updatePageNumber")},[d]);const W=()=>{u.current.emit=e=>{const o=u.current.fns.get(e);o&&o.forEach(c=>{c&&(c==null||c())})},u.current.fns=new Map,u.current.singleOn=(e,o)=>{u.current.fns.set(e,[o])},u.current.on=(e,o)=>{u.current.singleOn(e,o)},u.current.unbindAll=e=>{u.current.fns.delete(e)}},h=ne(()=>{const e=M[`step_${O==null?void 0:O.step}`];return(e==null?void 0:e.result)||[]},[j,M,O]),{tagConfigurable:I,textConfigurable:V=!0,clipConfigurable:z=!1,clipAttributeConfigurable:Y=!1,clipAttributeList:Z=[],clipTextConfigurable:G=!1,inputList:ae=[],configList:ue=[]}=ne(()=>{if(A)return K.jsonParser(A==null?void 0:A.config)},[A]),ce={clipConfigurable:z,clipAttributeConfigurable:Y,clipAttributeList:Z,clipTextConfigurable:G},H=a?a==null?void 0:a.valid:!0,de=(S=(p=K.jsonParser($.result))==null?void 0:p.duration)!=null?S:0,fe=H?de:0,me=!H||l||![V,G].includes(!0);let ee={};if(v!==-1&&(T==null?void 0:T.length)){const e=(f=T[v])==null?void 0:f.preResult,o=(a==null?void 0:a.isEdit)?(x=a==null?void 0:a.stepConfig)==null?void 0:x.loadPreStep:O==null?void 0:O.loadPreStep;if(e&&o){const c=K.jsonParser(e),y=(D=(R=c==null?void 0:c.config)==null?void 0:R.context)!=null?D:{};Object.keys(y).forEach(w=>{w&&y[w]&&(ee[w]={visible:!0,content:y[w],type:w})})}}const pe=()=>{(h==null?void 0:h.length)>0?b(h[0]):b({id:he(),sourceID:"",value:te(),tag:ge(),regions:[]})},te=(e=!0)=>{const o={};let c=j.configList||[];return c.length>0&&c.forEach(y=>{o[y.key]=e&&y.default||""}),o},ge=()=>we.getDefaultResultByConfig(j.inputList||[]),ve=({duration:e,hasError:o})=>{r(!1),q(e)},be=e=>{b(o=>k(E({},o),{regions:((o==null?void 0:o.regions)||[]).filter(c=>c.id!==e)}))},J=e=>{b(o=>{var c;const y=(c=o==null?void 0:o.regions)!=null?c:[],{id:w}=e;return y.find(U=>U.id===w)?k(E({},o),{regions:y.map(U=>w===U.id?E(E({},U),e):U)}):k(E({},o),{regions:[...y,e]})})},ye=(e,o)=>{b(c=>k(E({},c),{value:k(E({},c.value),{[o]:e})}))},Ee=e=>{b(o=>k(E({},o),{tag:e}))},Se=e=>{b(e)},xe=()=>{b(e=>k(E({},e),{value:te(),tag:{},regions:[]})),Le.emit("clearRegions")};return i.createElement(Ie,null,i.createElement(Te,{spinning:l,wrapperClassName:"audio-tool-spinner"},i.createElement(oe,{className:Ce("layout","container"),style:{height:"100%"}},t==null?void 0:t.leftSider,i.createElement(et,{className:`${se}__content`},i.createElement("div",{className:N.containerWrapper},i.createElement("div",{className:N.audioWrapper},I&&i.createElement(Ae,{result:d==null?void 0:d.tag,labelInfoSet:ae,hasPromptLayer:!!(a==null?void 0:a.promptLayer)}),a==null?void 0:a.promptLayer,i.createElement(_e,E({context:{isEdit:a==null?void 0:a.isEdit,count:fe,toolName:Ye.AudioTextTool,imgIndex:v},drawLayerSlot:L,fileData:$,onLoaded:ve,invalid:!H,updateRegion:J,removeRegion:be,regions:d==null?void 0:d.regions,activeToolPanel:a==null?void 0:a.activeToolPanel,footer:t.footer},ce))),(V||G)&&i.createElement(nt,{preContext:ee,result:d,inputDisabled:me,updateText:ye,updateRegion:J,configList:ue,autofocus:!1,textConfigurable:V,clipTextConfigurable:G,clipAttributeList:Z,clipAttributeConfigurable:Y}))),i.createElement(Ze,{className:`${se}__side`,width:_!=null?_:240,style:(g=t.style)==null?void 0:g.sider},i.createElement(ot,{sider:X,config:j,result:d,updateTagResult:Ee,updateRegion:J,isEdit:a==null?void 0:a.isEdit,tagConfigurable:I,clipConfigurable:z})),i.createElement(Re,null))))};var lt=De($e,null,null,{context:Me})(it);export{lt as default};
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};