@labelbee/lb-components 1.23.0-alpha.9 → 1.23.0-alpha.90

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 (250) 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/index.js +1 -1
  12. package/dist/components/DynamicResizer/DynamicResizer.js +1 -0
  13. package/dist/components/DynamicResizer/assets/bottomToZero.svg.js +1 -0
  14. package/dist/components/DynamicResizer/assets/divider.svg.js +1 -0
  15. package/dist/components/DynamicResizer/assets/topToZero.svg.js +1 -0
  16. package/dist/components/DynamicResizer/hooks/useDrag.js +1 -0
  17. package/dist/components/DynamicResizer/hooks/useUpdateHeight.js +1 -0
  18. package/dist/components/DynamicResizer/index.js +1 -0
  19. package/dist/components/LLMToolView/index.js +1 -1
  20. package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
  21. package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
  22. package/dist/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
  23. package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
  24. package/dist/components/LLMToolView/sidebar/index.js +1 -1
  25. package/dist/components/LLMToolView/utils/data.js +1 -1
  26. package/dist/components/NLPToolView/index.js +1 -1
  27. package/dist/components/audioAnnotate/audioContext/index.js +1 -1
  28. package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +2 -1
  29. package/dist/components/audioAnnotate/index.js +1 -1
  30. package/dist/components/audioAnnotate/textInput/index.js +1 -1
  31. package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -1
  32. package/dist/components/audioAnnotate/utils/dataTransform.js +1 -0
  33. package/dist/components/audioPlayer/clipRegion/index.js +1 -1
  34. package/dist/components/audioPlayer/index.js +1 -1
  35. package/dist/components/audioPlayer/useAudioCombine/index.js +3 -2
  36. package/dist/components/audioPlayer/useAudioSegment/index.js +1 -1
  37. package/dist/components/longText/index.js +1 -1
  38. package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
  39. package/dist/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
  40. package/dist/components/pointCloud2DRectOperationView/util.js +1 -0
  41. package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
  42. package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
  43. package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
  44. package/dist/components/pointCloudView/PointCloudBackView.js +1 -1
  45. package/dist/components/pointCloudView/PointCloudContext.js +1 -1
  46. package/dist/components/pointCloudView/PointCloudInfos.js +1 -1
  47. package/dist/components/pointCloudView/PointCloudLayout.js +1 -1
  48. package/dist/components/pointCloudView/PointCloudListener.js +1 -1
  49. package/dist/components/pointCloudView/PointCloudSegment2DView.js +1 -1
  50. package/dist/components/pointCloudView/PointCloudSideView.js +1 -1
  51. package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
  52. package/dist/components/pointCloudView/components/HighlightVisible/index.js +1 -1
  53. package/dist/components/pointCloudView/hooks/useBoxes.js +1 -1
  54. package/dist/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
  55. package/dist/components/pointCloudView/hooks/useHighlight.js +1 -1
  56. package/dist/components/pointCloudView/hooks/useHistory.js +1 -1
  57. package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  58. package/dist/components/pointCloudView/hooks/usePolygon.js +1 -1
  59. package/dist/components/pointCloudView/hooks/useRotate.js +1 -1
  60. package/dist/components/pointCloudView/hooks/useRotateEdge.js +1 -0
  61. package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -1
  62. package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
  63. package/dist/components/pointCloudView/hooks/useTimeoutFunc.js +1 -0
  64. package/dist/components/pointCloudView/hooks/useWindowKeydownListener.js +1 -0
  65. package/dist/components/pointCloudView/index.js +1 -1
  66. package/dist/components/pointCloudView/utils/event-polyfill.js +1 -0
  67. package/dist/components/pointCloudView/utils/map.js +1 -0
  68. package/dist/components/subAttributeList/index.js +1 -0
  69. package/dist/components/videoAnnotate/videoClipTool/index.js +1 -1
  70. package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
  71. package/dist/hooks/useToolStyle.js +1 -0
  72. package/dist/index.css +140 -17
  73. package/dist/index.js +1 -1
  74. package/dist/store/Actions.js +1 -1
  75. package/dist/store/annotatedBox/index.js +1 -1
  76. package/dist/store/annotation/actionCreators.js +1 -1
  77. package/dist/store/annotation/reducer.js +1 -1
  78. package/dist/types/App.d.ts +5 -1
  79. package/dist/types/components/AnnotationView/index.d.ts +1 -0
  80. package/dist/types/components/DynamicResizer/DynamicResizer.d.ts +5 -0
  81. package/dist/types/components/DynamicResizer/hooks/useDrag.d.ts +12 -0
  82. package/dist/types/components/DynamicResizer/hooks/useUpdateHeight.d.ts +23 -0
  83. package/dist/types/components/DynamicResizer/index.d.ts +2 -0
  84. package/dist/types/components/DynamicResizer/types/interface.d.ts +17 -0
  85. package/dist/types/components/LLMToolView/utils/data.d.ts +1 -1
  86. package/dist/types/components/audioAnnotate/audioContext/index.d.ts +10 -2
  87. package/dist/types/components/audioAnnotate/textInput/index.d.ts +1 -0
  88. package/dist/types/components/audioAnnotate/utils/dataTransform.d.ts +9 -0
  89. package/dist/types/components/audioPlayer/clipRegion/index.d.ts +1 -0
  90. package/dist/types/components/audioPlayer/index.d.ts +28 -21
  91. package/dist/types/components/longText/index.d.ts +1 -0
  92. package/dist/types/components/pointCloud2DRectOperationView/index.d.ts +1 -0
  93. package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +2 -0
  94. package/dist/types/components/pointCloud2DRectOperationView/util.d.ts +8 -0
  95. package/dist/types/components/pointCloudView/2DViewWorker.d.ts +1 -0
  96. package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +2 -1
  97. package/dist/types/components/pointCloudView/PointCloudContext.d.ts +28 -4
  98. package/dist/types/components/pointCloudView/PointCloudLayout.d.ts +1 -0
  99. package/dist/types/components/pointCloudView/components/HighlightVisible/index.d.ts +2 -1
  100. package/dist/types/components/pointCloudView/hooks/useDataLinkSwitch.d.ts +19 -0
  101. package/dist/types/components/pointCloudView/hooks/useHighlight.d.ts +1 -1
  102. package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +8 -0
  103. package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +9 -0
  104. package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +3 -2
  105. package/dist/types/components/pointCloudView/hooks/useTimeoutFunc.d.ts +6 -0
  106. package/dist/types/components/pointCloudView/hooks/useWindowKeydownListener.d.ts +16 -0
  107. package/dist/types/components/pointCloudView/utils/event-polyfill.d.ts +8 -0
  108. package/dist/types/components/pointCloudView/utils/map.d.ts +11 -0
  109. package/dist/types/components/subAttributeList/index.d.ts +10 -0
  110. package/dist/types/components/videoAnnotate/index.d.ts +2 -1
  111. package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +2 -1
  112. package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
  113. package/dist/types/hooks/useToolStyle.d.ts +30 -0
  114. package/dist/types/index.d.ts +7 -2
  115. package/dist/types/store/Actions.d.ts +1 -0
  116. package/dist/types/store/annotatedBox/index.d.ts +2 -0
  117. package/dist/types/store/annotation/actionCreators.d.ts +3 -2
  118. package/dist/types/store/annotation/reducer.d.ts +1 -0
  119. package/dist/types/store/annotation/types.d.ts +9 -2
  120. package/dist/types/utils/AnnotationDataUtils.d.ts +58 -1
  121. package/dist/types/utils/ToolPointCloudBoxRenderHelper.d.ts +23 -0
  122. package/dist/types/utils/index.d.ts +31 -1
  123. package/dist/types/views/MainView/sidebar/GeneralOperation/ActionsConfirm.d.ts +1 -0
  124. package/dist/types/views/MainView/sidebar/GeneralOperation/index.d.ts +2 -0
  125. package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.d.ts +3 -0
  126. package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +1 -1
  127. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.d.ts +9 -0
  128. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.d.ts +3 -0
  129. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/index.d.ts +1 -0
  130. package/dist/types/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.d.ts +10 -2
  131. package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
  132. package/dist/types/views/MainView/toolHeader/StepSwitch/index.d.ts +1 -1
  133. package/dist/types/views/MainView/toolHeader/index.d.ts +1 -1
  134. package/dist/utils/AnnotationDataUtils.js +1 -1
  135. package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -0
  136. package/dist/utils/index.js +1 -1
  137. package/dist/views/MainView/index.js +1 -1
  138. package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
  139. package/dist/views/MainView/sidebar/GeneralOperation/index.js +1 -1
  140. package/dist/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
  141. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
  142. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
  143. package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  144. package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
  145. package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  146. package/dist/views/MainView/sidebar/index.js +1 -1
  147. package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
  148. package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
  149. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
  150. package/dist/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
  151. package/dist/views/MainView/toolFooter/index.js +1 -1
  152. package/dist/views/MainView/toolHeader/index.js +1 -1
  153. package/es/App.js +1 -1
  154. package/es/_virtual/2DViewWorker.js +1 -0
  155. package/es/_virtual/highlightSegmentWorker.js +1 -1
  156. package/es/assets/annotation/icon_link.svg.js +1 -0
  157. package/es/assets/annotation/icon_unlink.svg.js +1 -0
  158. package/es/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
  159. package/es/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
  160. package/es/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
  161. package/es/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
  162. package/es/components/AnnotationView/index.js +1 -1
  163. package/es/components/DynamicResizer/DynamicResizer.js +1 -0
  164. package/es/components/DynamicResizer/assets/bottomToZero.svg.js +1 -0
  165. package/es/components/DynamicResizer/assets/divider.svg.js +1 -0
  166. package/es/components/DynamicResizer/assets/topToZero.svg.js +1 -0
  167. package/es/components/DynamicResizer/hooks/useDrag.js +1 -0
  168. package/es/components/DynamicResizer/hooks/useUpdateHeight.js +1 -0
  169. package/es/components/DynamicResizer/index.js +1 -0
  170. package/es/components/LLMToolView/index.js +1 -1
  171. package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
  172. package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
  173. package/es/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
  174. package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
  175. package/es/components/LLMToolView/sidebar/index.js +1 -1
  176. package/es/components/LLMToolView/utils/data.js +1 -1
  177. package/es/components/NLPToolView/index.js +1 -1
  178. package/es/components/audioAnnotate/audioContext/index.js +1 -1
  179. package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +2 -1
  180. package/es/components/audioAnnotate/index.js +1 -1
  181. package/es/components/audioAnnotate/textInput/index.js +1 -1
  182. package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -1
  183. package/es/components/audioAnnotate/utils/dataTransform.js +1 -0
  184. package/es/components/audioPlayer/clipRegion/index.js +1 -1
  185. package/es/components/audioPlayer/index.js +1 -1
  186. package/es/components/audioPlayer/useAudioCombine/index.js +3 -2
  187. package/es/components/audioPlayer/useAudioSegment/index.js +1 -1
  188. package/es/components/longText/index.js +1 -1
  189. package/es/components/pointCloud2DRectOperationView/index.js +1 -1
  190. package/es/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
  191. package/es/components/pointCloud2DRectOperationView/util.js +1 -0
  192. package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
  193. package/es/components/pointCloudView/PointCloud2DView.js +1 -1
  194. package/es/components/pointCloudView/PointCloud3DView.js +1 -1
  195. package/es/components/pointCloudView/PointCloudBackView.js +1 -1
  196. package/es/components/pointCloudView/PointCloudContext.js +1 -1
  197. package/es/components/pointCloudView/PointCloudInfos.js +1 -1
  198. package/es/components/pointCloudView/PointCloudLayout.js +1 -1
  199. package/es/components/pointCloudView/PointCloudListener.js +1 -1
  200. package/es/components/pointCloudView/PointCloudSegment2DView.js +1 -1
  201. package/es/components/pointCloudView/PointCloudSideView.js +1 -1
  202. package/es/components/pointCloudView/PointCloudTopView.js +1 -1
  203. package/es/components/pointCloudView/components/HighlightVisible/index.js +1 -1
  204. package/es/components/pointCloudView/hooks/useBoxes.js +1 -1
  205. package/es/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
  206. package/es/components/pointCloudView/hooks/useHighlight.js +1 -1
  207. package/es/components/pointCloudView/hooks/useHistory.js +1 -1
  208. package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  209. package/es/components/pointCloudView/hooks/usePolygon.js +1 -1
  210. package/es/components/pointCloudView/hooks/useRotate.js +1 -1
  211. package/es/components/pointCloudView/hooks/useRotateEdge.js +1 -0
  212. package/es/components/pointCloudView/hooks/useSingleBox.js +1 -1
  213. package/es/components/pointCloudView/hooks/useStatus.js +1 -1
  214. package/es/components/pointCloudView/hooks/useTimeoutFunc.js +1 -0
  215. package/es/components/pointCloudView/hooks/useWindowKeydownListener.js +1 -0
  216. package/es/components/pointCloudView/index.js +1 -1
  217. package/es/components/pointCloudView/utils/event-polyfill.js +1 -0
  218. package/es/components/pointCloudView/utils/map.js +1 -0
  219. package/es/components/subAttributeList/index.js +1 -0
  220. package/es/components/videoAnnotate/videoClipTool/index.js +1 -1
  221. package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
  222. package/es/hooks/useToolStyle.js +1 -0
  223. package/es/index.css +140 -17
  224. package/es/index.js +1 -1
  225. package/es/store/Actions.js +1 -1
  226. package/es/store/annotatedBox/index.js +1 -1
  227. package/es/store/annotation/actionCreators.js +1 -1
  228. package/es/store/annotation/reducer.js +1 -1
  229. package/es/utils/AnnotationDataUtils.js +1 -1
  230. package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -0
  231. package/es/utils/index.js +1 -1
  232. package/es/views/MainView/index.js +1 -1
  233. package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
  234. package/es/views/MainView/sidebar/GeneralOperation/index.js +1 -1
  235. package/es/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
  236. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
  237. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
  238. package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  239. package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
  240. package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  241. package/es/views/MainView/sidebar/index.js +1 -1
  242. package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
  243. package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
  244. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
  245. package/es/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
  246. package/es/views/MainView/toolHeader/index.js +1 -1
  247. package/package.json +5 -3
  248. package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
  249. package/dist/assets/icons/9d70807.svg +0 -5
  250. 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};
@@ -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 T,useRef as b,useImperativeHandle as $,useEffect as v,useCallback as k}from"react";import{ViewOperation as q,ImgUtils as B}from"@labelbee/lb-annotation";import{Spin as G}from"antd/es";import J from"../../hooks/useRefCache.js";import K from"../measureCanvas/index.js";var Q=Object.defineProperty,V=Object.getOwnPropertySymbols,W=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,j=(t,n,o)=>n in t?Q(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,S=(t,n)=>{for(var o in n||(n={}))W.call(n,o)&&j(t,o,n[o]);if(V)for(var o of V(n))X.call(n,o)&&j(t,o,n[o]);return t},D=(t,n,o)=>new Promise((g,d)=>{var c=l=>{try{f(o.next(l))}catch(m){d(m)}},s=l=>{try{f(o.throw(l))}catch(m){d(m)}},f=l=>l.done?g(l.value):Promise.resolve(l.value).then(c,s);f((o=o.apply(t,n)).next())});const C={width:455,height:100},Y=t=>{if(!t)return C;if(t.width&&t.height)return t;const n=S({},t);return n.width||(n.width=C.width),n.height||(n.height=C.height),n},ee=(t,n)=>{var o,g;const{src:d,fallbackSrc:c,annotations:s=[],style:f={stroke:"blue",thickness:3},zoomChange:l,backgroundStyle:m={},onChange:I,showLoading:N=!1,globalStyle:M,afterImgOnLoad:U,measureVisible:z}=t,_=Y(t.size),[Z,E]=T(!1),O=b(null),r=b(),R=J(U),h=b([]),p=b(!0);$(n,()=>{const e=r.current;return e?{zoomIn:()=>e.zoomChanged(!0),zoomOut:()=>e.zoomChanged(!1),initImgPos:()=>e.initImgPos(),toolInstance:e}:{}},[r.current]),v(()=>(O.current&&(r.current=new q({container:O.current,size:_,style:f,annotations:s,config:"{}",zoomInfo:t.zoomInfo,staticMode:t.staticMode}),r.current.init()),()=>{var e;(e=r.current)==null||e.destroy()}),[z]);const P=k(e=>D(void 0,null,function*(){var u,a;try{const i=yield B.load(e);return(u=r.current)==null||u.setImgNode(i),(a=R.current)==null||a.call(R,i),null}catch(i){return console.error("Error loading image:",i),i}}),[]),A=k(e=>D(void 0,null,function*(){var u,a;if(E(!0),(u=r.current)==null||u.setLoading(!0),(yield P(e))&&c){const y=yield P(c);y&&console.error("Error loading fallback image:",y)}(a=r.current)==null||a.setLoading(!1),E(!1)}),[P,c]);v(()=>{r.current&&A(d)},[d,z,c,A]),v(()=>{if(p.current===!1){h.current.push(s);return}const e=()=>{p.current=!0,h.current=[]},u=()=>{var a;const i=h.current.length;if(i>0){const y=h.current[i-1];h.current=[],(a=r.current)==null||a.updateData(y).then(u).catch(e)}else p.current=!0};r.current&&(p.current=!1,r.current.updateData(s).then(u).catch(e))},[s]),v(()=>{const e=r.current;(e==null?void 0:e.setSize)&&(e.setSize(_),e.initPosition())},[(o=t.size)==null?void 0:o.width,(g=t.size)==null?void 0:g.height]),v(()=>{var e,u;return r.current&&((e=r.current)==null||e.on("onChange",(...a)=>{I==null||I.apply(null,a)}),(u=r.current)==null||u.on("renderZoom",a=>{l&&l(a)})),()=>{var a,i;(a=r.current)==null||a.unbindAll("onChange"),(i=r.current)==null||i.unbindAll("renderZoom")}},[l,I]);const x=w.createElement("div",{ref:O,style:S(S({position:"relative"},_),m)}),{imgNode:L,zoom:F,currentPos:H}=r.current||{};return w.createElement(G,{spinning:N||Z,delay:300,style:M},z&&L?w.createElement(K,{size:_,imgNode:L,zoom:F,currentPos:H}):x)};var te=w.forwardRef(ee);export{te as default};
@@ -0,0 +1 @@
1
+ import e,{useRef as f}from"react";import h from"./hooks/useDrag.js";const g=s=>{const{minTopHeight:i=0,minBottomHeight:a=0,defaultHeight:o=50,axis:c="y",children:t,localKey:n="dynamicResizerHeights",customDivider:m,isShortcutButton:l=!1}=s,r=f(null),{rendered:d,topStyle:u,bottomStyle:y}=h({containerRef:r,minTopHeight:i,minBottomHeight:a,defaultHeight:o,axis:c,localKey:n,customDivider:m,isShortcutButton:l});return e.createElement("div",{className:"dynamic-resizer-content",ref:r},e.createElement("div",{className:"dynamic-resizer-top",style:u},t[0]),d,e.createElement("div",{className:"dynamic-resizer-bottom",style:y},t[1]))};export{g as default};
@@ -0,0 +1 @@
1
+ import"react";var t="data:image/svg+xml,%3csvg t='1720421473527' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5364' width='200' height='200'%3e %3cpath d='M94.8 304.5L512 721.8l416-416-833.2-1.3z m0 0' p-id='5365'%3e%3c/path%3e%3c/svg%3e";export{t as default};
@@ -0,0 +1 @@
1
+ import"react";var a="data:image/svg+xml,%3csvg t='1720596188811' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1478' width='200' height='200'%3e %3cpath d='M36.5551 360.072857h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551Q0 440.453119 0 400.314185q0-40.190131 36.5551-40.190131z' fill='%23999999' p-id='1479' %3e%3c/path%3e %3cpath d='M36.5551 583.550465h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551q-36.5551 0-36.5551-40.190131t36.5551-40.190131z' fill='%23999999' p-id='1480' %3e%3c/path%3e %3cpath d='M553.292672 10.700302l159.634177 89.237451a58.774867 58.774867 0 0 1 29.080248 67.990438 64.406605 64.406605 0 0 1-62.409898 44.388336H344.355187a64.406605 64.406605 0 0 1-62.409897-44.388336 58.774867 58.774867 0 0 1 29.080247-67.990438L470.659714 10.700302a85.448827 85.448827 0 0 1 82.632958 0z m0 1002.654177l159.634177-89.23745a58.774867 58.774867 0 0 0 29.080248-67.990439 64.406605 64.406605 0 0 0-62.409898-44.388336H344.355187a64.406605 64.406605 0 0 0-62.409897 44.388336 58.774867 58.774867 0 0 0 29.080247 67.990439l159.634177 89.23745a85.448827 85.448827 0 0 0 82.632958 0z' fill='%23999999' p-id='1481' %3e%3c/path%3e%3c/svg%3e";export{a as default};
@@ -0,0 +1 @@
1
+ import"react";var t="data:image/svg+xml,%3csvg t='1720421409111' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5202' width='200' height='200'%3e %3cpath d='M928 721.8L510.8 304.5l-416 416 833.2 1.3z m0 0' p-id='5203'%3e%3c/path%3e%3c/svg%3e";export{t as default};
@@ -0,0 +1 @@
1
+ import e,{useCallback as a,useMemo as b}from"react";import L from"react-draggable";import{useLocalStorageState as j}from"ahooks";import k from"./useUpdateHeight.js";import C from"../assets/topToZero.svg.js";import Z from"../assets/bottomToZero.svg.js";import P from"../assets/divider.svg.js";const F=({containerRef:t,minTopHeight:h=0,minBottomHeight:f=0,defaultHeight:E=50,axis:o,localKey:H,isShortcutButton:s=!1})=>{const l=H||"dynamicResizerHeights",{topHeight:i,position:d,bounds:m,topStyle:S,bottomStyle:T,updateELHeight:c,setTopHeightToZero:g,setBottomHeightToZero:n}=k(t,h,f,E,l),[U,p]=j(l),N=a(r=>{r.stopPropagation(),t.current&&t.current.classList.add("hide-scrollbar")},[t]),u=a((r,D)=>{r.stopPropagation(),c(D.y)},[c]),v=a(r=>{r.stopPropagation(),t.current&&t.current.classList.remove("hide-scrollbar"),p(i)},[t,p,i]),y=b(()=>s?e.createElement(e.Fragment,null,e.createElement("img",{src:C,className:"divider-top",draggable:"false",onClick:g}),e.createElement("div",{className:"divider-icon",draggable:"false"}),e.createElement("img",{src:Z,className:"divider-bottom",draggable:"false",onClick:n})):e.createElement(e.Fragment,null,e.createElement("img",{src:P,className:"divider-all",draggable:"false"}),e.createElement("div",{className:"divider-icon",draggable:"false"})),[s,g,n]);return{rendered:b(()=>{const r=e.createElement("div",{className:"divider"},y);return e.createElement(L,{axis:o,position:d,handle:".divider",onStart:N,onDrag:u,onStop:v,bounds:m},r)},[o,d,u,v,m]),topStyle:S,bottomStyle:T}};export{F as default};
@@ -0,0 +1 @@
1
+ import{useState as r,useEffect as M,useMemo as c,useCallback as _}from"react";import{useLocalStorageState as U}from"ahooks";const b=1e-5,z=(t,m,v,d,S)=>{const[l,I]=r(0),[n,x]=r(0),[s,B]=r(0),[u,L]=r(0),[h,p]=U(S),[a,N]=r(!1);M(()=>{D(),N(!0)},[]),M(()=>{if(a){const o=P();H(o),p(o)}},[a]);const y=c(()=>({x:0,y:l}),[l]),Z=c(()=>{var o;return{top:s,bottom:(((o=t.current)==null?void 0:o.offsetHeight)||0)-u}},[s,t]),E=c(()=>({height:l+"px"}),[l]),k=c(()=>({height:n+"px"}),[n]),D=()=>{var o,i,e,g;if(t){let f=m,T=v;m>=(((o=t.current)==null?void 0:o.offsetHeight)||0)/2&&(f=(((i=t.current)==null?void 0:i.offsetHeight)||0)/2),v>=(((e=t.current)==null?void 0:e.offsetHeight)||0)/2&&(T=(((g=t.current)==null?void 0:g.offsetHeight)||0)/2),B(f||b),L(T)}},P=_(()=>{var o,i;let e=0;return h!=null?e=isNaN(Number(h))?0:Number(h):e=d,e<s&&(e=s),t&&e>=(((o=t==null?void 0:t.current)==null?void 0:o.offsetHeight)||0)&&(e=(((i=t.current)==null?void 0:i.offsetHeight)||0)/2),e||b},[t,l,s,h,d]),H=_(o=>{var i;if(t){const e=((i=t==null?void 0:t.current)==null?void 0:i.offsetHeight)||0,g=e-u;o>=s&&o<=g&&(I(o),x(e-o))}},[t,s,u]);return{topHeight:l,bottomHeight:n,position:y,bounds:Z,topStyle:E,bottomStyle:k,updateELHeight:H,setBottomHeightToZero:()=>{var o;if(t){const i=((o=t==null?void 0:t.current)==null?void 0:o.offsetHeight)||0;H(i-u||0),p(i-u||0)}},setTopHeightToZero:()=>{t&&(H(s||0),p(s||0))}}};export{z as default};
@@ -0,0 +1 @@
1
+ import"./DynamicResizer.js";export{default}from"./DynamicResizer.js";
@@ -1 +1 @@
1
- import a,{useContext as N,useState as f,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 v,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=L=>{const{annotation:x,checkMode:M=!0,tips:q,showTips:A,drawLayerSlot:T}=L,{imgIndex:n,imgList:l,stepList:g,step:w,toolInstance:s}=x,{hoverKey:E,modelAPIResponse:R,setModelAPIResponse:I,newAnswerList:d}=N(B),[P,V]=f([]),[S,h]=f(""),[t,k]=f(),{t:y}=H(),[,Q]=f(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)===v.Picture,D=((o=t==null?void 0:t.dataType)==null?void 0:o.response)===v.Picture,c=(i=l[n])==null?void 0:i.questionList,m=(r=l[n])==null?void 0:r.llmFile,F=b?m==null?void 0:m.question:c==null?void 0:c.question;h(F);let p=(c==null?void 0:c.answerList)||[];D&&(p=(m==null?void 0:m.answerList)||[]),((_=t==null?void 0:t.dataType)==null?void 0:_.response)===v.None&&(p=[]),((j=t==null?void 0:t.dataType)==null?void 0:j.response)===v.Text&&(d==null?void 0:d.length)>0&&(p=d),V(p)},[n,d,t]),u(()=>{var e;if(!l[n])return;const o=(e=l[n])!=null?e:{},i=O(o==null?void 0:o.result),r=(i==null?void 0:i.length)>0?i[0]:i;I((r==null?void 0:r.modelAPIResponse)||[])},[n]),u(()=>{var e;if(g&&w){const o=(e=X(g,w))==null?void 0:e.config;k(Y(o))}},[g,w]),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=L=>({annotation:L.annotation});var ne=$(te,null,null,{context:U})(ee);export{ne as default};
1
+ import a,{useContext as N,useState as v,useEffect as u}from"react";import{connect as $}from"react-redux";import{LabelBeeContext as U,LLMContext as B}from"../../store/ctx.js";import{message as K}from"antd";import{ELLMDataType as L,prefix as W}from"../../constant/index.js";import{Layout as z}from"antd/es";import G from"./questionView/index.js";import{useTranslation as H}from"react-i18next";import J from"../../views/MainView/annotationTips/index.js";import{getCurrentResultFromResultList as O}from"./utils/data.js";import{getStepConfig as X}from"../../store/annotation/reducer.js";import{jsonParser as Y}from"../../utils/index.js";import Z from"../messageMaskLayer/index.js";const C=`${W}-LLMView`,ee=g=>{const{annotation:x,checkMode:M=!0,tips:q,showTips:A,drawLayerSlot:T}=g,{imgIndex:n,imgList:l,stepList:w,step:d,toolInstance:s}=x,{hoverKey:E,modelAPIResponse:R,setModelAPIResponse:I,newAnswerList:c}=N(B),[P,V]=v([]),[S,h]=v(""),[t,k]=v(),{t:y}=H(),[,Q]=v(0);return u(()=>{let e;if(!M)return e=setInterval(()=>{K.info(y("EfficientListening"))},1e3*60),()=>{e&&clearInterval(e)}},[]),u(()=>{if(s)return s.on("validUpdated",()=>{Q(e=>e+1)}),()=>{s.unbindAll("validUpdated")}},[s]),u(()=>{var e,o,i,r,_,j;if(!l[n])return;const b=((e=t==null?void 0:t.dataType)==null?void 0:e.prompt)===L.Picture,D=((o=t==null?void 0:t.dataType)==null?void 0:o.response)===L.Picture,m=(i=l[n])==null?void 0:i.questionList,p=(r=l[n])==null?void 0:r.llmFile,F=b?p==null?void 0:p.question:m==null?void 0:m.question;h(F);let f=(m==null?void 0:m.answerList)||[];D&&(f=(p==null?void 0:p.answerList)||[]),((_=t==null?void 0:t.dataType)==null?void 0:_.response)===L.None&&(f=[]),((j=t==null?void 0:t.dataType)==null?void 0:j.response)===L.Text&&(c==null?void 0:c.length)>0&&(f=c),V(f)},[n,c,t]),u(()=>{var e;if(!l[n])return;const o=(e=l[n])!=null?e:{},i=O(o==null?void 0:o.result,d),r=(i==null?void 0:i.length)>0?i[0]:i;I((r==null?void 0:r.modelAPIResponse)||[])},[n]),u(()=>{var e;if(w&&d){const o=(e=X(w,d))==null?void 0:e.config;k(Y(o))}},[w,d]),a.createElement(z,{className:C},!(s==null?void 0:s.valid)&&a.createElement(Z,{message:y("InvalidQuestionAndSkip")}),T==null?void 0:T({}),a.createElement("div",{className:`${C}-question`},A===!0&&a.createElement(J,{tips:q}),a.createElement(G,{hoverKey:E,question:S,answerList:P,modelAPIResponse:R,setModelAPIResponse:I,checkMode:M,annotation:x,LLMConfig:t})))},te=g=>({annotation:g.annotation});var ne=$(te,null,null,{context:U})(ee);export{ne as default};
@@ -1 +1 @@
1
- import e from"react";import{useTranslation as p}from"react-i18next";import{Resizable as f}from"re-resizable";import{Radio as i,Image as u}from"antd";import{EDataFormatType as m,prefix as g}from"../../../../../constant/index.js";import{FileTextOutlined as E}from"@ant-design/icons";import x from"../../../../markdownView/index.js";import{isString as w,isObject as y}from"lodash";import{i18n as b}from"@labelbee/lb-utils";import h from"../../../../../assets/annotation/LLMTool/imgFail_cn.svg.js";import v from"../../../../../assets/annotation/LLMTool/imgFail_en.svg.js";const s=`${g}-LLMView`,L=({question:t,dataFormatType:o,isImg: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 p}from"react-i18next";import{Resizable as f}from"re-resizable";import{Radio as i,Image as u}from"antd";import{EDataFormatType as m,prefix as g}from"../../../../../constant/index.js";import{FileTextOutlined as E}from"@ant-design/icons";import x from"../../../../markdownView/index.js";import{isString as w,isObject as y}from"lodash";import{i18n as b}from"@labelbee/lb-utils";import h from"../../../../../assets/annotation/LLMTool/imgFail_cn.svg.js";import v from"../../../../../assets/annotation/LLMTool/imgFail_en.svg.js";const s=`${g}-LLMView`,L=({question:t,dataFormatType:o,isImg:a})=>{const n=w(t)?t:"",r=b.language==="en"?v:h;if(a){const l=y(t)?t==null?void 0:t.url:"";return e.createElement(u,{src:l||r,fallback:r})}return e.createElement("div",{style:{whiteSpace:"pre-wrap"}},o===m.Markdown?e.createElement(x,{value:n}):n)},T=t=>{const{question:o,dataFormatType:a,setDataFormatType:n,isImg:r}=t,l=300,{t:c}=p();return e.createElement(f,{defaultSize:{width:"100%",height:l},minHeight:l,enable:{bottom:!0},style:{padding:"26px 32px",borderBottom:"1px solid #EBEBEB",overflow:"hidden"}},e.createElement("div",{className:`${s}__title`,style:{display:"flex",justifyContent:"space-between"}},c("Title"),e.createElement("span",{style:{display:"flex"}},e.createElement(i.Group,{value:a,onChange:d=>{n(d.target.value)}},e.createElement(i.Button,{value:m.Default,style:{textAlign:"center",width:"52px"}},"</>"),e.createElement(i.Button,{value:m.Markdown,style:{textAlign:"center",width:"52px"}},e.createElement(E,null))),e.createElement("span",{style:{marginLeft:"8px",width:"4px",background:"#1890ff"}}))),e.createElement("div",{className:`${s}__headerContent`},e.createElement(L,{question:o,dataFormatType:a,isImg:r})))};export{T as default};
@@ -1,2 +1,2 @@
1
- import e,{useEffect as C}from"react";import{Form as m,Popover as S,Input as j,message as L}from"antd";import{useTranslation as N}from"react-i18next";import{InfoCircleOutlined as A}from"@ant-design/icons";import O from"../../../../markdownView/index.js";import R from"../../../../latexEditor/index.js";import d from"./index.module.scss.js";const k=h=>{const{disabeledAll:x,newAnswer:p,textEditObject:w,updateValue:f,answerIndex:g}=h,{max:a,min:u,isLaText:v}=w,{TextArea:b}=j,[l]=m.useForm(),{t:o}=N(),y=o("LeastCharacterError",{num:u});C(()=>{l.setFieldsValue({value:p}),x||l.validateFields()},[p]);const V=n=>{var t,c;const I=`inputTextarea_${g}`,r=document.getElementById(I),s=r.value||"",E=(t=r==null?void 0:r.selectionStart)!=null?t:s.length,T=(c=r.selectionEnd)!=null?c:s.length,_=s.substring(0,E),F=s.substring(T,s.length),i=_+n+F;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=E+n.length,r.selectionEnd=E+n.length,r.focus()};return e.createElement(m,{form:l,onValuesChange:(n,t)=>{const c=t.value;f(c)},className:d.form},e.createElement(m.Item,{name:"title",style:{marginBottom:"8px"},label:e.createElement(e.Fragment,null,o("AnswerTextEdit"),e.createElement(S,{placement:"bottom",content:o("ShowEditingResultDifferencesInTextModeOnly")},e.createElement(A,{style:{margin:"0px 4px",cursor:"pointer"}}))),colon:!1,required:!!u}),v&&e.createElement(R,{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(y):Promise.resolve()}]},e.createElement(b,{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:d.outputDisplay},e.createElement("div",{className:d.title},o("OutputDisplay")),e.createElement("div",{className:d.content},n?e.createElement(O,{value:t}):""))}))};export{k 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 +1 @@
1
- var e={form:"index-module_form__IypXc",outputDisplay:"index-module_outputDisplay__5dS48",title:"index-module_title__vhMCp",content:"index-module_content__Iml6l"};export{e as default};
1
+ var e={form:"index-module_form__IypXc",outputDisplay:"index-module_outputDisplay__5dS48",title:"index-module_title__vhMCp",content:"index-module_content__Iml6l",tip:"index-module_tip__NFru6"};export{e as default};
@@ -1,2 +1,2 @@
1
- import r,{useEffect as 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 r,{useEffect as V}from"react";import{Form as g,Input as j,message as F}from"antd";import N from"classnames";import{useTranslation as C}from"react-i18next";import{isArray as S}from"lodash";import A from"../../../../latexEditor/index.js";import E from"./index.module.scss.js";import B from"../../../../markdownView/index.js";import D from"../../../../longText/index.js";var M=Object.defineProperty,R=Object.defineProperties,k=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,T=(a,e,t)=>e in a?M(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,z=(a,e)=>{for(var t in e||(e={}))$.call(e,t)&&T(a,t,e[t]);if(P)for(var t of P(e))q.call(e,t)&&T(a,t,e[t]);return a},U=(a,e)=>R(a,k(e));const G=a=>{const{disabeledAll:e,LLMConfig:t,textAttribute:y,setText:I}=a,w=(t==null?void 0:t.text)&&S(t.text)?t==null?void 0:t.text:[],{TextArea:O}=j,[v]=g.useForm(),{t:h}=C();V(()=>{const s=w.map((c,n)=>{var d;const m=(y==null?void 0:y.filter(o=>(o==null?void 0:o.textId)===(c==null?void 0:c.textId)))||[];return U(z({},c),{value:(d=m[0])==null?void 0:d.value})});v.setFieldsValue({text:s})},[w,y]);const L=({newText:s,fieldName:c,max:n})=>{var d,m;const o=`textInput_${c}`,l=document.getElementById(o),u=l.value||"",f=(d=l==null?void 0:l.selectionStart)!=null?d:u.length,p=(m=l.selectionEnd)!=null?m:u.length,_=u.substring(0,f),x=u.substring(p,u.length),i=_+s+x;if(n&&(i==null?void 0:i.length)>n){F.error(h("MaximumCharacterError",{num:n}));return}l.value=i,v.setFields([{name:["text",c,"value"],value:i,errors:[]}]),b(),l.selectionStart=f+s.length,l.selectionEnd=f+s.length,l.focus()},b=()=>{const s=v.getFieldValue("text");I(s)};return r.createElement(g,{form:v},r.createElement(g.List,{name:"text"},(s,c)=>r.createElement(r.Fragment,null,s.map((n,d)=>{const{max:m,min:o,title:l,tip:u,isLaText:f}=w[n.name]||{},p=l,_=h("LeastCharacterError",{num:o});return r.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"16px"},key:d},p&&r.createElement(g.Item,{name:[n.name,"title"],extra:r.createElement(D,{text:u!=null?u:"",overflowMaxLines:3,openByText:!0}),className:E.textTitle,required:!!o,label:" ",colon:!1},l,p&&r.createElement("span",{className:N({clearText:!0,clearText__disabled:e}),style:{verticalAlign:"initial"},onClick:()=>{e||(v.setFields([{name:["text",n.name,"value"],value:void 0,errors:o?[_]:[]}]),b())}})),f&&p&&r.createElement(A,{onSelectLatex:x=>L({newText:x,fieldName:n.name,max:m}),disabled:e}),p&&r.createElement(g.Item,{name:[n.name,"value"],style:{marginBottom:24},rules:[{validator:(x,i)=>o&&(i==null?void 0:i.length)<Number(o)?Promise.reject(_):Promise.resolve()}],initialValue:void 0},r.createElement(O,{maxLength:m,disabled:e,showCount:!!m,autoSize:{minRows:4,maxRows:10},style:{width:"100%"},id:`textInput_${n.name}`,onChange:()=>b()})),f&&p&&r.createElement(g.Item,{shouldUpdate:!0,noStyle:!0},()=>{const x=v.getFieldValue(["text",n.name,"value"])||"",i=x.replace(/\n/g,`
2
+ `);return r.createElement("div",{className:E.outputDisplay},r.createElement("div",{className:E.title},h("OutputDisplay")),r.createElement("div",{className:E.content},x?r.createElement(B,{value:i}):""))}))}))))};export{G as default};
@@ -1 +1 @@
1
- import r,{useContext as K,useState as R,useEffect as E}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 vt}from"lodash";import gt from"./components/answerList/index.js";import{LabelBeeContext as Lt,LLMContext as q}from"../../../store/ctx.js";import{jsonParser as z}from"../../../utils/index.js";import{getStepConfig as xt}from"../../../store/annotation/reducer.js";import{useCustomToolInstance as wt}from"../../../hooks/annotation.js";import{PageForward as h}from"../../../store/annotation/actionCreators.js";import{cKeyCode as bt,EToolName as St}from"@labelbee/lb-annotation";import{useTranslation as _t}from"react-i18next";import{getCurrentResultFromResultList as yt,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";var Pt=Object.defineProperty,It=Object.defineProperties,Ot=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable,W=(s,i,a)=>i in s?Pt(s,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[i]=a,u=(s,i)=>{for(var a in i||(i={}))At.call(i,a)&&W(s,a,i[a]);if(F)for(var a of F(i))Rt.call(i,a)&&W(s,a,i[a]);return s},p=(s,i)=>It(s,Ot(i));const Nt=bt.default,C=`${at}-sidebar`,Dt=s=>{var i,a;const{annotation:G,dispatch:w,checkMode:J}=s,{imgIndex:b,imgList:j,stepList:T,step:P,skipBeforePageTurning:S}=G,{modelAPIResponse:N,setModelAPIResponse:Q}=K(q),{t:_}=_t(),m=(i=j[b])!=null?i:{},U=z(m==null?void 0:m.result),{toolInstanceRef:c}=wt({basicInfo:U}),[f,H]=R(),[,X]=R(0),{setNewAnswerList:Y}=K(q),[o,L]=R({}),x=!c.current.valid||J;E(()=>{var t;if(T&&P){const e=(t=xt(T,P))==null?void 0:t.config;H(z(e))}},[P,JSON.stringify(T)]),E(()=>{!m||b===-1||(c.current.setValid=D,c.current.clearResult=Z,M())},[b,f]);const Z=()=>{M(m==null?void 0:m.questionList)},D=t=>{var e;mt(t)&&(c.current.valid=t,(e=c.current)==null||e.emit("validUpdated"),X(n=>n+1))},M=t=>{var e;const n=yt(m==null?void 0:m.result);let l=m==null?void 0:m.questionList;(n==null?void 0:n.answerList)&&c.current.valid&&(l=n),t&&(l=t,n.sort=[],n.valid=(e=c.current.valid)!=null?e:!0),D(n.valid);const v=Et(f,l);L(u({},v)),Q([])};E(()=>{const{newSort:t,answerList:e,textAttribute:n,tagList:l}=o,v=ht(t||[]),d={answerList:e,sort:v,tagList:l,textAttribute:n,id:m==null?void 0:m.id,modelAPIResponse:N,valid:c.current.valid};c.current.exportData=()=>[[d],{valid:c.current.valid}],c.current.currentPageResult=p(u({},d),{toolName:St.LLM}),Y(e||[])},[o,N,c.current.valid]),E(()=>(window.addEventListener("keydown",B),()=>{window.removeEventListener("keydown",B)}),[]);const B=t=>{if(t.ctrlKey&&t.keyCode===Nt.Enter){if(S){S(()=>w(h()));return}w(h())}},tt=({order:t,value:e,key:n})=>{const{answerList:l}=o,v=l==null?void 0:l.map(d=>{var y;if((d==null?void 0:d.order)===t){if(n==="textEdit"&&pt(e))return p(u({},d),{newAnswer:e});if(ft(e))return p(u({},d),{score:e});if(vt(e)&&n){const O={[e==null?void 0:e.key]:e.value},A=(y=d[n])!=null?y:{};return p(u({},d),{[n]:u(u({},A),O)})}}return d});L(p(u({},o),{answerList:v||[]}))};if((()=>{var t,e;const{indicatorScore:n=[],indicatorDetermine:l=[],text:v=[],enableSort:d,isTextEdit:y,tagInputListConfigurable:O}=f||{},A=((t=n==null?void 0:n.filter(g=>g.label&&g.value&&g.score))==null?void 0:t.length)>0,it=((e=l==null?void 0:l.filter(g=>g.label&&g.value))==null?void 0:e.length)>0,st=(v==null?void 0:v.length)>0;return!(A||it||st||d||y||O)})())return r.createElement("div",{className:`${C}`},r.createElement("div",{className:`${C}__content`,style:{display:"flex",justifyContent:"center",alignItems:"center"}},r.createElement(lt,{description:r.createElement("span",{style:{color:"#ccc"}},_("NoScoringScale")),imageStyle:{width:200,height:200},image:r.createElement("img",{src:Ct})})));const{indicatorScore:$=[],indicatorDetermine:V=[],enableSort:et,isTextEdit:nt,inputList:I=[],tagInputListConfigurable:k}=f||{},ot=k&&((a=I.filter(t=>!t.isOverall))==null?void 0:a.length)>0,rt=(V==null?void 0:V.length)>0||($==null?void 0:$.length)>0||nt||ot;return r.createElement("div",{className:`${C}`},r.createElement("div",{className:`${C}__content`},r.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},_("GlobalAnnotation")),et&&r.createElement(dt,{waitSortList:(o==null?void 0:o.waitSorts)||[],sortList:(o==null?void 0:o.newSort)||[],setSortList:t=>{L(p(u({},o),{newSort:t}))},disabeledAll:x}),k&&I.length&&r.createElement(Tt,{inputList:I,selectedTags:(o==null?void 0:o.tagList)||{},updateValue:t=>{const{key:e,value:n}=t,l=o==null?void 0:o.tagList;L(p(u({},o),{tagList:p(u({},l),{[e]:n})}))},disabeledAll:x}),(f==null?void 0:f.text)&&r.createElement("div",{style:{padding:"0px 16px",marginTop:"16px"}},r.createElement(jt,{textAttribute:(o==null?void 0:o.textAttribute)||[],LLMConfig:f,setText:t=>L(p(u({},o),{textAttribute:t})),disabeledAll:x})),r.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},_("QualifiedAnnotation")),r.createElement("div",null,rt&&r.createElement(gt,{list:(o==null?void 0:o.answerList)||[],LLMConfig:f,updateValue:tt,disabeledAll:x}))),r.createElement("div",{style:{margin:"24px 16px",display:"flex"}},(j==null?void 0:j.length)-1!==b&&r.createElement(ct,{type:"primary",style:{marginLeft:"auto"},onClick:()=>{if(S){S(()=>w(h()));return}w(h())},disabled:x},_("Save"))))},Mt=s=>({annotation:s.annotation});var Bt=ut(Mt,null,null,{context:Lt})(Dt);export{Bt as default};
1
+ import r,{useContext as q,useState as D,useEffect as C}from"react";import{prefix as ct}from"../../../constant/index.js";import{Empty as dt,Button as ut}from"antd";import pt from"./components/answerSort/index.js";import{connect as mt}from"react-redux";import{isBoolean as ft,isString as gt,isNumber as vt,isObject as Lt}from"lodash";import xt from"./components/answerList/index.js";import{LabelBeeContext as wt,LLMContext as z}from"../../../store/ctx.js";import{jsonParser as F}from"../../../utils/index.js";import{getStepConfig as St}from"../../../store/annotation/reducer.js";import{useCustomToolInstance as bt}from"../../../hooks/annotation.js";import{PageForward as j}from"../../../store/annotation/actionCreators.js";import{cKeyCode as Et,EToolName as _t}from"@labelbee/lb-annotation";import{useTranslation as yt}from"react-i18next";import{getCurrentResultFromResultList as ht,getRenderDataByResult as Ct,formatSort as jt}from"../utils/data.js";import Tt from"../../../assets/annotation/LLMTool/empty.svg.js";import Pt from"./components/textInputBox/index.js";import It from"../../tagList/components/overall/index.js";import Ot from"../../../utils/StepUtils.js";var At=Object.defineProperty,Rt=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,W=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,Mt=Object.prototype.propertyIsEnumerable,G=(s,i,a)=>i in s?At(s,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[i]=a,d=(s,i)=>{for(var a in i||(i={}))Nt.call(i,a)&&G(s,a,i[a]);if(W)for(var a of W(i))Mt.call(i,a)&&G(s,a,i[a]);return s},p=(s,i)=>Rt(s,Dt(i));const Bt=Et.default,T=`${ct}-sidebar`,$t=s=>{var i,a;const{annotation:J,dispatch:w,checkMode:Q}=s,{imgIndex:S,imgList:P,stepList:b,step:E,skipBeforePageTurning:_}=J,{modelAPIResponse:N,setModelAPIResponse:H}=q(z),{t:y}=yt(),u=(i=P[S])!=null?i:{},M=F(u==null?void 0:u.result),{toolInstanceRef:m}=bt({basicInfo:M}),[f,X]=D(),[I,Y]=D(!0),{setNewAnswerList:Z}=q(z),[n,L]=D({}),x=!m.current.valid||Q;C(()=>{var t;if(b&&E){const e=(t=St(b,E))==null?void 0:t.config;X(F(e))}},[E,JSON.stringify(b)]),C(()=>{!u||S===-1||(m.current.setValid=B,m.current.clearResult=tt,B(),$())},[S,f]);const tt=()=>{$(u==null?void 0:u.questionList)},B=t=>{var e;const o=t!=null?t:M.valid;ft(o)&&(Y(o),m.current.valid=o,(e=m.current)==null||e.emit("validUpdated"))},$=t=>{const e=Ot.getCurrentStepInfo(E,b),o=ht(u==null?void 0:u.result,e.step);let l=u==null?void 0:u.questionList;(o==null?void 0:o.answerList)&&m.current.valid&&(l=o),t&&(l=t,o.sort=[]);const g=Ct(f,l);L(d({},g)),H([])};C(()=>{et(),Z((n==null?void 0:n.answerList)||[])},[n,N,I]),C(()=>(window.addEventListener("keydown",V),()=>{window.removeEventListener("keydown",V)}),[]);const et=()=>{const{newSort:t,answerList:e,textAttribute:o,tagList:l}=n,g=jt(t||[]),c={answerList:e,sort:g,tagList:l,textAttribute:o,id:u==null?void 0:u.id,modelAPIResponse:N};m.current.exportData=()=>[[c],{valid:I}],m.current.currentPageResult=p(d({},c),{toolName:_t.LLM,valid:I})},V=t=>{if(t.ctrlKey&&t.keyCode===Bt.Enter){if(_){_(()=>w(j()));return}w(j())}},nt=({order:t,value:e,key:o})=>{const{answerList:l}=n,g=l==null?void 0:l.map(c=>{var h;if((c==null?void 0:c.order)===t){if(o==="textEdit"&&gt(e))return p(d({},c),{newAnswer:e});if(vt(e))return p(d({},c),{score:e});if(Lt(e)&&o){const A={[e==null?void 0:e.key]:e.value},R=(h=c[o])!=null?h:{};return p(d({},c),{[o]:d(d({},R),A)})}}return c});L(p(d({},n),{answerList:g||[]}))};if((()=>{var t,e;const{indicatorScore:o=[],indicatorDetermine:l=[],text:g=[],enableSort:c,isTextEdit:h,tagInputListConfigurable:A}=f||{},R=((t=o==null?void 0:o.filter(v=>v.label&&v.value&&v.score))==null?void 0:t.length)>0,at=((e=l==null?void 0:l.filter(v=>v.label&&v.value))==null?void 0:e.length)>0,lt=(g==null?void 0:g.length)>0;return!(R||at||lt||c||h||A)})())return r.createElement("div",{className:`${T}`},r.createElement("div",{className:`${T}__content`,style:{display:"flex",justifyContent:"center",alignItems:"center"}},r.createElement(dt,{description:r.createElement("span",{style:{color:"#ccc"}},y("NoScoringScale")),imageStyle:{width:200,height:200},image:r.createElement("img",{src:Tt})})));const{indicatorScore:k=[],indicatorDetermine:K=[],enableSort:ot,isTextEdit:rt,inputList:O=[],tagInputListConfigurable:U}=f||{},it=U&&((a=O.filter(t=>!t.isOverall))==null?void 0:a.length)>0,st=(K==null?void 0:K.length)>0||(k==null?void 0:k.length)>0||rt||it;return r.createElement("div",{className:`${T}`},r.createElement("div",{className:`${T}__content`},r.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},y("GlobalAnnotation")),ot&&r.createElement(pt,{waitSortList:(n==null?void 0:n.waitSorts)||[],sortList:(n==null?void 0:n.newSort)||[],setSortList:t=>{L(p(d({},n),{newSort:t}))},disabeledAll:x}),U&&O.length&&r.createElement(It,{inputList:O,selectedTags:(n==null?void 0:n.tagList)||{},updateValue:t=>{const{key:e,value:o}=t,l=n==null?void 0:n.tagList;L(p(d({},n),{tagList:p(d({},l),{[e]:o})}))},disabeledAll:x}),(f==null?void 0:f.text)&&r.createElement("div",{style:{padding:"0px 16px",marginTop:"16px"}},r.createElement(Pt,{textAttribute:(n==null?void 0:n.textAttribute)||[],LLMConfig:f,setText:t=>L(p(d({},n),{textAttribute:t})),disabeledAll:x})),r.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},y("QualifiedAnnotation")),r.createElement("div",null,st&&r.createElement(xt,{list:(n==null?void 0:n.answerList)||[],LLMConfig:f,updateValue:nt,disabeledAll:x}))),r.createElement("div",{style:{margin:"24px 16px",display:"flex"}},(P==null?void 0:P.length)-1!==S&&r.createElement(ut,{type:"primary",style:{marginLeft:"auto"},onClick:()=>{if(_){_(()=>w(j()));return}w(j())},disabled:x},y("Save"))))},Vt=s=>({annotation:s.annotation});var kt=mt(Vt,null,null,{context:wt})($t);export{kt as default};
@@ -1 +1 @@
1
- import{isArray as L}from"lodash";import{jsonParser as O}from"../../../utils/index.js";var P=Object.defineProperty,S=Object.defineProperties,b=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,g=(l,t,r)=>t in l?P(l,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[t]=r,d=(l,t)=>{for(var r in t||(t={}))A.call(t,r)&&g(l,r,t[r]);if(w)for(var r of w(t))E.call(t,r)&&g(l,r,t[r]);return l},v=(l,t)=>S(l,b(t));const x=l=>{var t,r,n;const i=O(l),o="step_1",e=(r=(t=i==null?void 0:i[o])==null?void 0:t.result[0])!=null?r:{};return v(d({},e),{valid:(n=e==null?void 0:e.valid)!=null?n:!0})},j=l=>l.reduce((r,n)=>{var i;let o=n;return n.length>1?o=n.map(e=>e==null?void 0:e.id):o=[(i=n[0])==null?void 0:i.id],[...r,o]},[]),p=(l,t)=>{let r={};return l.forEach(n=>{var i;let o=[];t&&t[n==null?void 0:n.value]?o=t[n.value]:((i=n==null?void 0:n.subSelected)==null?void 0:i.length)>0&&n.subSelected.forEach(e=>{(e==null?void 0:e.isDefault)&&(e==null?void 0:e.value)&&o.push(e.value)}),o.length>0&&(r=v(d({},r),{[n.value]:o}))}),r},f=(l,t)=>{var r;let n=[],i=[];if((l==null?void 0:l.length)>0){const o=L(t)?t[0]:t;((r=o==null?void 0:o.sort)==null?void 0:r.length)>0&&(i=o.sort.reduce((e,s)=>{let a=[{title:s[0],id:s[0]}];return s.length>1&&(a=s.map(u=>({title:u,id:u}))),[...e,a]},[])),l.forEach(e=>{i.some(a=>a.length>1?a.some(u=>u.id===e.order):a[0].id===e.order)||n.push({title:e.order,id:e.order})})}return{newSort:i,waitSorts:n}},m=(l,t)=>{const{isTextEdit:r,textEdit:n=[],inputList:i=[]}=t||{};return l.map(e=>{var s,a;const u=i.filter(c=>!(c==null?void 0:c.isOverall))||[],_=p(u,e==null?void 0:e.tagList);return r&&((s=n.filter(h=>h.title===e.order)[0])==null?void 0:s.isFillAnswer)?v(d({},e),{newAnswer:(a=e==null?void 0:e.newAnswer)!=null?a:e.answer,tagList:_}):v(d({},e),{tagList:_})})},R=(l,t)=>{var r;let n=[],i=[],o=[],e={};(t==null?void 0:t.answerList)&&(n=m(t.answerList,l)||[],i=f(t.answerList,t).newSort,o=f(t.answerList,t).waitSorts);const s=((r=l==null?void 0:l.inputList)==null?void 0:r.filter(a=>a==null?void 0:a.isOverall))||[];return e=p(s,t==null?void 0:t.tagList),{newSort:i,waitSorts:o,answerList:n,tagList:e,textAttribute:t==null?void 0:t.textAttribute}};export{j as formatSort,x as getCurrentResultFromResultList,R as getRenderDataByResult,p as getTagResult,f as getWaitSortList,m as initAnswerList};
1
+ import{isArray as L}from"lodash";import{jsonParser as O}from"../../../utils/index.js";var P=Object.defineProperty,S=Object.defineProperties,b=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,g=(l,t,r)=>t in l?P(l,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[t]=r,v=(l,t)=>{for(var r in t||(t={}))A.call(t,r)&&g(l,r,t[r]);if(w)for(var r of w(t))E.call(t,r)&&g(l,r,t[r]);return l},c=(l,t)=>S(l,b(t));const x=(l,t=1)=>{var r,n;const i=O(l),o=`step_${t}`;return(n=(r=i==null?void 0:i[o])==null?void 0:r.result[0])!=null?n:{}},j=l=>l.reduce((r,n)=>{var i;let o=n;return n.length>1?o=n.map(e=>e==null?void 0:e.id):o=[(i=n[0])==null?void 0:i.id],[...r,o]},[]),p=(l,t)=>{let r={};return l.forEach(n=>{var i;let o=[];t&&t[n==null?void 0:n.value]?o=t[n.value]:((i=n==null?void 0:n.subSelected)==null?void 0:i.length)>0&&n.subSelected.forEach(e=>{(e==null?void 0:e.isDefault)&&(e==null?void 0:e.value)&&o.push(e.value)}),o.length>0&&(r=c(v({},r),{[n.value]:o}))}),r},f=(l,t)=>{var r;let n=[],i=[];if((l==null?void 0:l.length)>0){const o=L(t)?t[0]:t;((r=o==null?void 0:o.sort)==null?void 0:r.length)>0&&(i=o.sort.reduce((e,s)=>{let a=[{title:s[0],id:s[0]}];return s.length>1&&(a=s.map(u=>({title:u,id:u}))),[...e,a]},[])),l.forEach(e=>{i.some(a=>a.length>1?a.some(u=>u.id===e.order):a[0].id===e.order)||n.push({title:e.order,id:e.order})})}return{newSort:i,waitSorts:n}},m=(l,t)=>{const{isTextEdit:r,textEdit:n=[],inputList:i=[]}=t||{};return l.map(e=>{var s,a;const u=i.filter(d=>!(d==null?void 0:d.isOverall))||[],_=p(u,e==null?void 0:e.tagList);return r&&((s=n.filter(h=>h.title===e.order)[0])==null?void 0:s.isFillAnswer)?c(v({},e),{newAnswer:(a=e==null?void 0:e.newAnswer)!=null?a:e.answer,tagList:_}):c(v({},e),{tagList:_})})},R=(l,t)=>{var r;let n=[],i=[],o=[],e={};(t==null?void 0:t.answerList)&&(n=m(t.answerList,l)||[],i=f(t.answerList,t).newSort,o=f(t.answerList,t).waitSorts);const s=((r=l==null?void 0:l.inputList)==null?void 0:r.filter(a=>a==null?void 0:a.isOverall))||[];return e=p(s,t==null?void 0:t.tagList),{newSort:i,waitSorts:o,answerList:n,tagList:e,textAttribute:t==null?void 0:t.textAttribute}};export{j as formatSort,x as getCurrentResultFromResultList,R as getRenderDataByResult,p as getTagResult,f as getWaitSortList,m as initAnswerList};
@@ -1 +1 @@
1
- import x,{useContext as ut,useState as m,useMemo as k,useEffect as C}from"react";import{connect as lt}from"react-redux";import{LabelBeeContext as dt,NLPContext as ft}from"../../store/ctx.js";import{prefix as pt}from"../../constant/index.js";import mt from"./textContent/index.js";import gt from"../../views/MainView/annotationTips/index.js";import{getStepConfig as vt}from"../../store/annotation/reducer.js";import{jsonParser as xt}from"../../utils/index.js";import{getCurrentResultFromResultList as bt}from"../LLMToolView/utils/data.js";import{useCustomToolInstance as At}from"../../hooks/annotation.js";import{uuid as _t}from"@labelbee/lb-annotation";var ht=Object.defineProperty,wt=Object.defineProperties,Pt=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,Lt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,K=(r,e,i)=>e in r?ht(r,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[e]=i,b=(r,e)=>{for(var i in e||(e={}))Lt.call(e,i)&&K(r,i,e[i]);if(B)for(var i of B(e))Ct.call(e,i)&&K(r,i,e[i]);return r},A=(r,e)=>wt(r,Pt(e));const $=`${pt}-NLPView`,yt=r=>{const{annotation:e,checkMode:i,tips:H,showTips:q,extraLayer:F,extraData:Q,onChangeAnnotation:y,customAnnotationData:W}=r,{imgIndex:u,imgList:g,stepList:_,step:h}=e,{highlightKey:z,setHighlightKey:G}=ut(ft),{toolInstanceRef:s}=At(),[D,J]=m(""),[w,U]=m([]),[P,X]=m(void 0),[Y,Z]=m([{content:""}]),[n,d]=m({id:1,newText:"",indicatorDetermine:{},textAnnotation:[]}),tt=k(()=>(n==null?void 0:n.textAnnotation)?(P&&(n.textAnnotation=P),n.textAnnotation.filter(t=>w.length===0||w.includes(t.attribute))):[],[n,w,P]),l=k(()=>{var t;if(_&&h){const o=(t=vt(_,h))==null?void 0:t.config;return xt(o)}},[_,h]);C(()=>{var t;if(!g[u])return;const o=(t=g[u])==null?void 0:t.textData;Z(o),(l==null?void 0:l.attributeConfigurable)||v([])},[u,l]),C(()=>{var t;if(!g[u])return;const o=(t=g[u])!=null?t:{},c=bt(o==null?void 0:o.result);d(c)},[u]),C(()=>{s.current.exportData=()=>[[n],{}],s.current.setResult=()=>{},s.current.updateResult=t=>{d(t)},s.current.clearResult=ot,s.current.setDefaultAttribute=et,s.current.setHighlightKey=G,s.current.deleteTextAnnotation=rt,s.current.setAttributeLockList=nt,s.current.setVisibleResult=v,L()},[n]);const L=()=>{s.current.emit("changeAttributeSidebar"),s.current.emit("changeIndicatorDetermine")},et=t=>{s.current.defaultAttribute=t,J(t),L()},nt=t=>{U(t)},v=t=>{X(t)},ot=()=>{d({id:1,newText:"",indicatorDetermine:{},textAnnotation:[]}),v([]),L()},rt=t=>{const o=n.textAnnotation.filter(c=>c.id!==t);d(A(b({},n),{textAnnotation:o})),v(o)},it=(t,o)=>{var c,f;if(o===""||!t)return;const a=window.getSelection(),{anchorOffset:O=0,focusOffset:S=0,anchorNode:at,focusNode:ct}=a||{};if(at===ct){const j=Math.min(O,S),N=Math.max(O,S);let R;if((t==null?void 0:t.current)&&a){const p=(c=t.current)==null?void 0:c.getBoundingClientRect(),E=a.getRangeAt(0).getBoundingClientRect(),I=E.right-p.left,M=E.top-p.top;I&&M&&(R={left:I,top:M})}const T={id:_t(8,62),start:j,end:N,text:o};if(typeof y=="function"){y(A(b({},T),{endPosition:R}));return}if(st(j,N,D,n==null?void 0:n.textAnnotation)||i)return;if(l==null?void 0:l.attributeConfigurable){const p=(n==null?void 0:n.textAnnotation)||[];p.push(A(b({},T),{attribute:D}));const V=A(b({},n),{textAnnotation:p});d(V)}(f=window.getSelection())==null||f.empty()}},st=(t,o,c,f)=>f==null?void 0:f.some(a=>(a==null?void 0:a.start)===t&&(a==null?void 0:a.end)===o&&(a==null?void 0:a.attribute)===c);return x.createElement("div",{className:$,id:"NLPView"},x.createElement("div",{className:`${$}-question`},q===!0&&x.createElement(gt,{tips:H}),x.createElement(mt,{highlightKey:z,textData:Y,NLPConfig:l,textAnnotation:tt,onSelectionChange:it,extraLayer:F,extraData:Q,customAnnotationData:W})))},Dt=r=>({annotation:r.annotation});var Ot=lt(Dt,null,null,{context:dt})(yt);export{Ot as default};
1
+ import x,{useContext as ut,useState as g,useMemo as M,useEffect as C}from"react";import{connect as lt}from"react-redux";import{LabelBeeContext as dt,NLPContext as ft}from"../../store/ctx.js";import{prefix as pt}from"../../constant/index.js";import mt from"./textContent/index.js";import gt from"../../views/MainView/annotationTips/index.js";import{getStepConfig as vt}from"../../store/annotation/reducer.js";import{jsonParser as xt}from"../../utils/index.js";import{getCurrentResultFromResultList as bt}from"../LLMToolView/utils/data.js";import{useCustomToolInstance as At}from"../../hooks/annotation.js";import{uuid as ht}from"@labelbee/lb-annotation";var _t=Object.defineProperty,Lt=Object.defineProperties,wt=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,Pt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,K=(i,e,a)=>e in i?_t(i,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[e]=a,b=(i,e)=>{for(var a in e||(e={}))Pt.call(e,a)&&K(i,a,e[a]);if(B)for(var a of B(e))Ct.call(e,a)&&K(i,a,e[a]);return i},A=(i,e)=>Lt(i,wt(e));const $=`${pt}-NLPView`,yt=i=>{const{annotation:e,checkMode:a,tips:H,showTips:q,extraLayer:F,extraData:Q,onChangeAnnotation:y,customAnnotationData:W}=i,{imgIndex:u,imgList:v,stepList:h,step:_}=e,{highlightKey:z,setHighlightKey:G}=ut(ft),{toolInstanceRef:n}=At(),[D,J]=g(""),[L,U]=g([]),[w,X]=g(void 0),[Y,Z]=g([{content:""}]),[o,d]=g({id:1,newText:"",indicatorDetermine:{},textAnnotation:[]}),tt=M(()=>(o==null?void 0:o.textAnnotation)?(w&&(o.textAnnotation=w),o.textAnnotation.filter(t=>L.length===0||L.includes(t.attribute))):[],[o,L,w]),l=M(()=>{var t;if(h&&_){const r=(t=vt(h,_))==null?void 0:t.config;return xt(r)}},[h,_]);C(()=>{var t;if(!v[u])return;const r=(t=v[u])==null?void 0:t.textData;Z(r),(l==null?void 0:l.attributeConfigurable)||f([])},[u,l]),C(()=>{var t;if(!v[u])return;const r=(t=v[u])!=null?t:{},c=bt(r==null?void 0:r.result);d(c),f(c.textAnnotation)},[u]),C(()=>{n.current.exportData=()=>[[o],{}],n.current.setResult=()=>{},n.current.updateResult=t=>{d(t)},n.current.clearResult=ot,n.current.setDefaultAttribute=et,n.current.setHighlightKey=G,n.current.deleteTextAnnotation=rt,n.current.setAttributeLockList=nt,n.current.setVisibleResult=f,P()},[o]);const P=()=>{n.current.emit("changeAttributeSidebar"),n.current.emit("changeIndicatorDetermine")},et=t=>{n.current.defaultAttribute=t,J(t),P()},nt=t=>{U(t),n.current.attributeLockList=t,n.current.emit("changeAttributeSidebar")},f=t=>{X(t)},ot=()=>{d({id:1,newText:"",indicatorDetermine:{},textAnnotation:[]}),f([]),P()},rt=t=>{const r=o.textAnnotation.filter(c=>c.id!==t);d(A(b({},o),{textAnnotation:r})),f(r)},it=(t,r)=>{var c,p;if(r===""||!t)return;const s=window.getSelection(),{anchorOffset:O=0,focusOffset:S=0,anchorNode:st,focusNode:ct}=s||{};if(st===ct){const j=Math.min(O,S),N=Math.max(O,S);let R;if((t==null?void 0:t.current)&&s){const m=(c=t.current)==null?void 0:c.getBoundingClientRect(),E=s.getRangeAt(0).getBoundingClientRect(),k=E.right-m.left,I=E.top-m.top;k&&I&&(R={left:k,top:I})}const T={id:ht(8,62),start:j,end:N,text:r};if(typeof y=="function"){y(A(b({},T),{endPosition:R}));return}if(at(j,N,D,o==null?void 0:o.textAnnotation)||a)return;if(l==null?void 0:l.attributeConfigurable){const m=(o==null?void 0:o.textAnnotation)||[];m.push(A(b({},T),{attribute:D}));const V=A(b({},o),{textAnnotation:m});d(V)}(p=window.getSelection())==null||p.empty()}},at=(t,r,c,p)=>p==null?void 0:p.some(s=>(s==null?void 0:s.start)===t&&(s==null?void 0:s.end)===r&&(s==null?void 0:s.attribute)===c);return x.createElement("div",{className:$,id:"NLPView"},x.createElement("div",{className:`${$}-question`},q===!0&&x.createElement(gt,{tips:H}),x.createElement(mt,{highlightKey:z,textData:Y,NLPConfig:l,textAnnotation:tt,onSelectionChange:it,extraLayer:F,extraData:Q,customAnnotationData:W})))},Dt=i=>({annotation:i.annotation});var Ot=lt(Dt,null,null,{context:dt})(yt);export{Ot as default};
@@ -1 +1 @@
1
- import{RightOutlined as 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 ot=Object.defineProperty,nt=Object.defineProperties,it=Object.getOwnPropertyDescriptors,ue=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,ce=(o,n,s)=>n in o?ot(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,S=(o,n)=>{for(var s in n||(n={}))lt.call(n,s)&&ce(o,s,n[s]);if(ue)for(var s of ue(n))rt.call(n,s)&&ce(o,s,n[s]);return o},N=(o,n)=>nt(o,it(n));const{EAudioToolName:st}=Ve,de=ke.default,{Sider:at,Content:ut}=se,fe=`${Ne}-layout`,ct=({setSideTab:o,sideTab:n})=>{const s=[{tab:"tag",commonSvg:Qe,selectedSvg:Ye},{tab:"clip",commonSvg:Ze,selectedSvg:et}];return l.createElement("div",{className:O.toggleAudioOption},s.map((p,_)=>{const{tab:d,selectedSvg:x,commonSvg:L}=p;return l.createElement("div",{key:_,className:O.option},l.createElement("img",{className:O.icon,src:n===d?x:L,onClick:()=>{n!==d&&o(d)}}))}))},dt=({result:o,inputDisabled:n,updateText:s,configList:p,autofocus:_,preContext:d,isCheck:x,clipAttributeConfigurable:L,clipTextConfigurable:k,textConfigurable:b,updateRegion:C,clipAttributeList:f,clipTextList:g})=>l.createElement("div",{className:O.textareaContainer},l.createElement("div",{className:O.textareaContent},l.createElement(Fe,{isCheck:x,result:o==null?void 0:o.value,textInputDisabled:n,textID:(o==null?void 0:o.id)||0,updateText:s,configList:p,autofocus:!n&&_,preContext:d,regions:o==null?void 0:o.regions,clipAttributeConfigurable:L,clipTextConfigurable:k,textConfigurable:b,updateRegion:C,clipAttributeList:f,clipTextList:g}))),ft=o=>{var n,s;const{sider:p,config:_,result:d,updateTagResult:x,updateRegion:L,isEdit:k,tagConfigurable:b,clipConfigurable:C}=o;let f=(_==null?void 0:_.inputList)||[],g=(n=d==null?void 0:d.tag)!=null?n:{},a=(s=d==null?void 0:d.regions)!=null?s:[];const[U,P]=M([]),[T,v]=M("tag");B(()=>{if(!b&&C){v("clip");return}v("tag")},[b,C]),B(()=>(window.addEventListener("keydown",D),()=>{window.removeEventListener("keydown",D)}));const D=t=>{if(b&&C)switch(t.keyCode){case de.L:v("tag");break;case de.X:v("clip");break}if(T==="tag"){if(!K.hotkeyFilter(t))return;K.isMoveKey(t==null?void 0:t.keyCode)&&t.preventDefault();let r=t.keyCode;if(r&&(r<=57&&r>=49||r<=105&&r>=97)){r>57?r=r-97:r=r-49;const h=U.slice();f.length===1?(R(0,r),P([0,r]),setTimeout(()=>{P([])},500)):h.length===1?(R(h[0],r),P([h[0],r]),setTimeout(()=>{P([])},500)):P([r])}}},R=(t,r)=>{if(t<f.length&&f[t].subSelected&&r<f[t].subSelected.length){const h=f[t].value,m=f[t].isMulti;let c=f[t].subSelected[r].value,X=0;const W=g;for(const y in g)if(y===f[t].value){if(X++,m===!0){const A=W[y].split(";").filter(z=>z!==""),G=A.indexOf(c);G===-1?A.push(c):A.splice(G,1),c=A.join(";")}c===""?delete W[y]:W[y]=c}X===0&&Object.assign(g,{[h]:c}),x(g)}},w=t=>{delete g[t],x(g)},$=b&&C&&l.createElement(ct,{setSideTab:v,sideTab:T}),I=T==="tag"&&l.createElement(He,{labelInfoSet:b?f:[],labelSelectedList:U,setLabel:R,tagResult:g,clearResult:w,isEdit:k,withPanelTab:!1}),V=T==="clip"&&l.createElement(Je,{regions:a,updateRegion:L,useAudioClipStore:We});return p?typeof p=="function"?l.createElement("div",{className:`${Y}`},p({toggleAudioOption:$,labelSidebar:I,clipSidebar:V})):p:l.createElement("div",{className:`${Y}`},l.createElement("div",{className:`${Y}__content`},$,I,V))},mt=o=>{var n,s,p,_,d,x,L,k,b;const C=(s=(n=o.style)==null?void 0:n.sider)==null?void 0:s.width,{step:f,stepList:g,audioContext:a,sider:U,drawLayerSlot:P,imgList:T,imgIndex:v,currentData:D,config:R,stepInfo:w,checkMode:$}=o,I=K.getCurrentStepToolAndConfig(f,g),V=qe(D.result),{toolInstanceRef:t}=ze({basicInfo:V}),[r,h]=M(!0),[m,c]=M(null),[X,W]=M(0),[y,A]=M(!0);B(()=>{h(!0)},[v]),B(()=>{r===!1&&_e()},[r]),B(()=>{z()},[]),B(()=>{t.current.exportData=()=>[[m],{duration:X,valid:y}],t.current.setResult=he,t.current.clearResult=je,t.current.currentPageResult=m==null?void 0:m.regions,t.current.emit("updatePageNumber"),t.current.setSelectedRegion=G,t.current.setValid=Pe},[m,y]);const G=e=>{ae.emit("setSelectedRegion",{id:e,isLoopStatus:!0,playImmediately:!0})},z=()=>{t.current.emit=e=>{const i=t.current.fns.get(e);i&&i.forEach(u=>{u&&(u==null||u())})},t.current.fns=new Map,t.current.singleOn=(e,i)=>{t.current.fns.set(e,[i])},t.current.on=(e,i)=>{t.current.singleOn(e,i)},t.current.unbindAll=e=>{t.current.fns.delete(e)}},H=re(()=>{const e=V[`step_${w==null?void 0:w.step}`];return(e==null?void 0:e.result)||[]},[R,V,w]),{tagConfigurable:Z,textConfigurable:J=!0,clipConfigurable:ee=!1,clipAttributeConfigurable:te=!1,clipAttributeList:oe=[],clipTextConfigurable:q=!1,subAttributeList:me=[],secondaryAttributeConfigurable:pe=!1,inputList:ge=[],configList:ve=[],clipTextList:ne=Ke}=re(()=>{if(I)return K.jsonParser(I==null?void 0:I.config)},[I]),be={clipConfigurable:ee,clipAttributeConfigurable:te,clipAttributeList:oe,clipTextConfigurable:q,subAttributeList:me,secondaryAttributeConfigurable:pe,clipTextList:ne},ye=(_=(p=K.jsonParser(D.result))==null?void 0:p.duration)!=null?_:0,Ee=y?ye:0,Se=!y||r||![J,q].includes(!0)||$;let ie={};if(v!==-1&&(T==null?void 0:T.length)){const e=(d=T[v])==null?void 0:d.preResult,i=(a==null?void 0:a.isEdit)?(x=a==null?void 0:a.stepConfig)==null?void 0:x.loadPreStep:w==null?void 0:w.loadPreStep;if(e&&i){const u=K.jsonParser(e),E=(k=(L=u==null?void 0:u.config)==null?void 0:L.context)!=null?k:{};Object.keys(E).forEach(j=>{j&&E[j]&&(ie[j]={visible:!0,content:E[j],type:j})})}}const _e=()=>{(H==null?void 0:H.length)>0?c(H[0]):c({id:De(),sourceID:"",value:le(),tag:xe(),regions:[]});const e=tt(T[v].result||"[]");A(e)},le=(e=!0)=>{const i={};let u=R.configList||[];return u.length>0&&u.forEach(E=>{i[E.key]=e&&E.default||""}),i},xe=()=>$e.getDefaultResultByConfig(R.inputList||[]),Ce=({duration:e,hasError:i})=>{(a==null?void 0:a.onLoaded)&&(a==null||a.onLoaded()),h(!1),W(e)},Te=e=>{c(i=>N(S({},i),{regions:((i==null?void 0:i.regions)||[]).filter(u=>u.id!==e)}))},Q=e=>{c(i=>{var u;const E=(u=i==null?void 0:i.regions)!=null?u:[],{id:j}=e;return E.find(F=>F.id===j)?N(S({},i),{regions:E.map(F=>j===F.id?S(S({},F),e):F)}):N(S({},i),{regions:[...E,e]})})},Le=(e,i)=>{c(u=>N(S({},u),{value:N(S({},u.value),{[i]:e})}))},Re=e=>{c(i=>N(S({},i),{tag:e}))},he=e=>{c(e)},je=()=>{c(e=>N(S({},e),{value:le(),tag:{},regions:[]})),ae.emit("clearRegions")},Pe=e=>{A(e)};return l.createElement(Be,null,l.createElement(Oe,{spinning:r,wrapperClassName:"audio-tool-spinner"},l.createElement(se,{className:Ie("layout","container"),style:{height:"100%"}},o==null?void 0:o.leftSider,l.createElement(ut,{className:`${fe}__content`},l.createElement("div",{className:O.containerWrapper},l.createElement("div",{className:O.audioWrapper},Z&&l.createElement(Me,{result:m==null?void 0:m.tag,labelInfoSet:ge,hasPromptLayer:!!(a==null?void 0:a.promptLayer)}),a==null?void 0:a.promptLayer,l.createElement(we,S({context:{isEdit:a==null?void 0:a.isEdit,count:Ee,toolName:st.AudioTextTool,imgIndex:v},drawLayerSlot:P,fileData:D,onLoaded:Ce,invalid:!y,updateRegion:Q,removeRegion:Te,regions:m==null?void 0:m.regions,activeToolPanel:a==null?void 0:a.activeToolPanel,footer:o.footer,isCheck:$},be))),(J||q)&&l.createElement(dt,{preContext:ie,result:m,inputDisabled:Se,updateText:Le,updateRegion:Q,configList:ve,autofocus:!1,textConfigurable:J,clipTextConfigurable:q,clipAttributeList:oe,clipAttributeConfigurable:te,clipTextList:ne,isCheck:$}))),l.createElement(at,{className:`${fe}__side`,width:C!=null?C:240,style:(b=o.style)==null?void 0:b.sider},l.createElement(ft,{sider:U,config:R,result:m,updateTagResult:Re,updateRegion:Q,isEdit:a==null?void 0:a.isEdit,tagConfigurable:Z,clipConfigurable:ee})),l.createElement(Ae,null))))};var pt=Ue(Xe,null,null,{context:Ge})(mt);export{pt as default};
@@ -1 +1 @@
1
- import e,{useState as M,useRef as X,useEffect as q}from"react";import{Tooltip as J,Radio as K,Switch as se}from"antd";import{QuestionCircleOutlined as ce}from"@ant-design/icons";import{TextareaWithFooter as ie}from"../../../views/MainView/sidebar/TextToolSidebar/index.js";import{timeFormat as Y,getAttributeColor as de,getAttributeFontColor as me,updateColorOpacity as Ee,getAttributeShowText as pe,DEFAULT_TEXT_CONFIG_ITEM as fe}from"../../../utils/audio.js";import{cKeyCode as ve}from"@labelbee/lb-annotation";import z from"classnames";import Z,{useAudioClipStore as xe}from"../audioContext/index.js";import o from"./index.module.scss.js";import{useTranslation as ee}from"react-i18next";var Fe=Object.defineProperty,ge=Object.defineProperties,Ce=Object.getOwnPropertyDescriptors,te=Object.getOwnPropertySymbols,he=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,ae=(u,n,r)=>n in u?Fe(u,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[n]=r,le=(u,n)=>{for(var r in n||(n={}))he.call(n,r)&&ae(u,r,n[r]);if(te)for(var r of te(n))be.call(n,r)&&ae(u,r,n[r]);return u},Te=(u,n)=>ge(u,Ce(n));const d=ve.default,ne=({onClick:u,title:n,disabled:r})=>e.createElement(J,{placement:"bottom",title:n},e.createElement("span",{className:z({[o.clearIcon]:!0,[o.disabled]:r}),onClick:u})),G=u=>{var n;const{t:r}=ee(),D=X(null),[f,y]=M(!1),[w,v]=M(!1),{disabled:s,config:c,result:P,updateText:x,index:F,switchToNextTextarea:O,hasMultiple:L,textID:b,addPlaceholder:g,onFocus:N,onBlur:T,onFocusStyle:k={},extra:$}=u,{maxLength:C}=c,B=P?P[c.key]:"",I=(n=B==null?void 0:B.length)!=null?n:0,S=a=>{x&&(x(a,c.key),c.required&&v(!a))},j=L&&O,m={id:`textInput-${F}`,ref:D,disabled:s,value:B,maxLength:C,autoSize:{minRows:2,maxRows:6},onChange:a=>{const i=a.target.value;S(i)},onFocus:a=>{y(!0),N==null||N(a),a.target.value&&v(!1)},onBlur:a=>{y(!1),T==null||T(a),c.required&&v(!a.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:a=>{const{keyCode:i}=a;if(a.ctrlKey){if(i===d.Enter&&a.preventDefault(),g&&[d.One,d.Two,d.Three].includes(i))switch(a.preventDefault(),i){case d.One:g("\u4986");break;case d.Two:g("\u652B");break;case d.Three:g("\u7383");break}}else i===d.Tab&&j?(a.preventDefault(),a.nativeEvent.stopImmediatePropagation(),O(F)):a.nativeEvent.stopPropagation()}},E=e.createElement("div",{className:o.textAreaFooter},e.createElement("div",{className:o.hotkeyTip},j&&e.createElement("span",null,"[",r("Switch"),"]Tab"),e.createElement("span",null,"[",r("TurnPage"),"]Ctrl+Enter")),e.createElement("div",{className:o.wordCount},e.createElement("span",{className:I>=C?o.warning:""},I),"/",e.createElement("span",null,C)));return q(()=>{s&&y(!1)},[s]),q(()=>{v(!1)},[b]),e.createElement("div",{className:o.textField},e.createElement("div",{className:o.label},e.createElement("span",{className:z({[o.required]:c.required})},c.label),e.createElement(ne,{onClick:()=>{s||S("")},title:"",disabled:s}),e.createElement("div",{className:o.extra},$)),e.createElement("div",{className:z({disabled:s,"textarea-outline":!0,"ant-input-focused":f,[o.textareaContainer]:!0,[o.focus]:f,[o.invalid]:w}),style:f?k:{}},e.createElement(ie,{footer:E,textareaProps:m})))},ye=u=>{const{configList:n,autofocus:r,textID:D,result:f,showText:y,updateText:w,toggleShowText:v,textInputDisabled:s,isCheck:c,isEdit:P,config:x,preContext:F,regions:O=[],textConfigurable:L=!0,clipTextConfigurable:b,clipAttributeConfigurable:g,updateRegion:N,clipAttributeList:T=[]}=u,{t:k}=ee(),[$,C]=M(0),[B,I]=M(""),S=X(null),{audioClipState:j}=xe(),m=n||[le({},fe)];let E=O;if(b&&!c){const t=j.selectedRegion.id;E=E.filter(l=>l.id===t)}const a=t=>{setTimeout(()=>{const l=document.getElementById(`textInput-${t}`);l&&(C(t),l.focus(),l.select(),l.scrollIntoView({behavior:"smooth",block:"center"}))})},i=t=>{const l=L?m.length:0,p=b?E.length:0,h=l+p,_=(t+1)%h;a(_)},Q=t=>{t.keyCode===d.Tab&&(t.preventDefault(),m.length>0&&a(0))},R=t=>{const l=document.getElementById(`textInput-${$}`);if(!(x==null?void 0:x.enablePlaceholderHotkey)||!l||!w)return;const{value:p,selectionStart:h,selectionEnd:_}=l,A=`${p.slice(0,h)}${t}${p.slice(_)}`;w(A,m[$].key),I(t),setTimeout(()=>{l.setSelectionRange(h+1,h+1),l.focus()},0),clearTimeout(S.current),S.current=setTimeout(()=>{I("")},400)};q(()=>(P||document.addEventListener("keydown",Q),()=>{document.removeEventListener("keydown",Q)}),[n]),q(()=>{r&&!s&&a(0)},[D]);let H=m;c&&(H=m.filter(t=>(f==null?void 0:f[t.key])!==void 0));let U={};return b&&E&&E.forEach(t=>{const{id:l,text:p}=t;U[l]=p}),e.createElement(e.Fragment,null,(x==null?void 0:x.enablePlaceholderHotkey)&&e.createElement("div",{className:o.placeholderHotkey},e.createElement("div",{className:o.title},"\u5360\u4F4D\u7B26\u5FEB\u6377\u8F93\u5165",e.createElement(J,{overlayStyle:{maxWidth:240},title:e.createElement("div",null,e.createElement("div",null,"\u4986\uFF08Ctrl+1\uFF09\uFF1A"),e.createElement("div",{style:{marginBottom:12}},"\u6587\u5B57\u5F02\u5E38\uFF0C\u4F46\u53EA\u6839\u636E\u8FD9\u4E2A\u5B57\u7684\u5F62\u72B6\u5C31\u53EF\u4EE5\u731C\u51FA\u662F\u4EC0\u4E48\u5B57"),e.createElement("div",null,"\u652B\uFF08Ctrl+2\uFF09\uFF1A"),e.createElement("div",{style:{marginBottom:12}},"\u6587\u5B57\u5F02\u5E38\uFF0C\u4E14\u65E0\u6CD5\u6839\u636E\u5F62\u72B6\u731C\u5B57\uFF0C\u4F46\u80FD\u7ED3\u5408\u4E0A\u4E0B\u6587\u8BED\u4E49\u5224\u65AD\u51FA\u662F\u4EC0\u4E48\u5B57"),e.createElement("div",null,"\u7383\uFF08Ctrl+3\uFF09\uFF1A"),e.createElement("div",null,"\u5B8C\u5168\u65E0\u6CD5\u5224\u65AD\u662F\u4EC0\u4E48\u5B57")),placement:"bottom"},e.createElement(ce,{className:o.questionIcon}))),e.createElement(K.Group,{value:B},e.createElement(K.Button,{value:"\u4986",onClick:t=>R(t.target.value)},e.createElement("div",{className:"label"},e.createElement("div",{className:"text"},"\u4986 (\u89C6\u89C9)"),e.createElement("div",{className:"hotkey"},"Ctrl+1"))),e.createElement(K.Button,{value:"\u652B",onClick:t=>R(t.target.value)},e.createElement("div",{className:"label"},e.createElement("div",{className:"text"},"\u652B (\u8BED\u4E49)"),e.createElement("div",{className:"hotkey"},"Ctrl+2"))),e.createElement(K.Button,{value:"\u7383",onClick:t=>R(t.target.value)},e.createElement("div",{className:"label"},e.createElement("div",{className:"text"},"\u7383 (\u65E0\u6548)"),e.createElement("div",{className:"hotkey"},"Ctrl+3"))))),e.createElement("div",{className:o.textInputContainer},e.createElement(Z,{audioContext:F==null?void 0:F.before}),L&&H.map((t,l)=>e.createElement(G,{config:t,key:l,index:l,result:f,updateText:w,switchToNextTextarea:i,hasMultiple:m.length>1,disabled:s,textID:D,addPlaceholder:R,onFocus:()=>C(l)})),b&&E.map((t,l)=>{const{id:p,start:h,end:_,attribute:A}=t,oe={label:`${k("textTool")}\uFF08${Y(h,"ss.SSS")} - ${Y(_,"ss.SSS")}\uFF09`,key:p,maxLength:3e3},V=H.length+l,W=de(A,T),re={color:me(A,T),backgroundColor:W};return e.createElement(G,{config:oe,key:l,index:V,disabled:s,result:U,updateText:ue=>{N==null||N(Te(le({},t),{text:ue}))},switchToNextTextarea:()=>{i(V)},hasMultiple:!0,onFocus:()=>C(V),onFocusStyle:g?{borderColor:W,boxShadow:`0 0 0 2px ${Ee(W,.4)}`}:{},extra:g?e.createElement("div",{style:re,className:o.attribute},pe(A,[{value:"",key:k("NoAttribute")},...T])):null})}),e.createElement(Z,{audioContext:F==null?void 0:F.after}),v&&e.createElement("div",{className:o.switchItem},k("toggleShowText"),e.createElement(se,{style:{alignSelf:"center"},checked:y,onChange:t=>{v(t)}}))))};export{ne as ClearIcon,G as SingleTextInput,ye as default};
1
+ import e,{useState as O,useRef as te,useEffect as q,useMemo as Ce}from"react";import{Tooltip as ae,Radio as H,Switch as be}from"antd";import{QuestionCircleOutlined as ye}from"@ant-design/icons";import{TextareaWithFooter as Ne}from"../../../views/MainView/sidebar/TextToolSidebar/index.js";import{timeFormat as ne,getAttributeColor as we,getAttributeFontColor as Be,getAttributeShowText as _e,updateColorOpacity as ke,DEFAULT_TEXT_CONFIG_ITEM as Ie}from"../../../utils/audio.js";import{cKeyCode as Se}from"@labelbee/lb-annotation";import U from"classnames";import oe,{useAudioClipStore as De,DEFAULT_CLIP_TEXT_CONFIG_ITEM as Ae}from"../audioContext/index.js";import l from"./index.module.scss.js";import{useTranslation as le}from"react-i18next";import re from"../../longText/index.js";import Le from"../../../assets/annotation/common/icon_clearSmall_a.svg.js";import Pe from"../../../assets/annotation/common/icon_clearSmall.svg.js";var Oe=Object.defineProperty,$e=Object.defineProperties,je=Object.getOwnPropertyDescriptors,ue=Object.getOwnPropertySymbols,Me=Object.prototype.hasOwnProperty,Re=Object.prototype.propertyIsEnumerable,se=(u,o,r)=>o in u?Oe(u,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):u[o]=r,X=(u,o)=>{for(var r in o||(o={}))Me.call(o,r)&&se(u,r,o[r]);if(ue)for(var r of ue(o))Re.call(o,r)&&se(u,r,o[r]);return u},ie=(u,o)=>$e(u,je(o));const p=Se.default,ce=({onClick:u,title:o,disabled:r})=>{const[C,i]=O(!1);return e.createElement(ae,{placement:"bottom",title:o},e.createElement("img",{onMouseEnter:()=>{r||i(!0)},onMouseLeave:()=>i(!1),className:U({[l.clearIcon]:!0,[l.disabled]:r}),src:C?Le:Pe,onClick:u}))},Q=u=>{var o;const{t:r}=le(),C=te(null),[i,B]=O(!1),[_,x]=O(!1),{disabled:c,config:m,result:$,updateText:g,index:T,switchToNextTextarea:j,hasMultiple:k,textID:b,addPlaceholder:F,onFocus:I,onBlur:y,onFocusStyle:N={},extra:w,errorText:S}=u,{maxLength:h}=m,D=$?$[m.key]:"",A=(o=D==null?void 0:D.length)!=null?o:0,L=n=>{g&&(g(n,m.key),m.required&&x(!n))},M=k&&j,f={id:`textInput-${T}`,ref:C,disabled:c,value:D,maxLength:h,autoSize:{minRows:2,maxRows:6},onChange:n=>{const E=n.target.value;L(E)},onFocus:n=>{B(!0),I==null||I(n),n.target.value&&x(!1)},onBlur:n=>{B(!1),y==null||y(n),m.required&&x(!n.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:n=>{const{keyCode:E}=n;if(n.ctrlKey){if(E===p.Enter&&n.preventDefault(),F&&[p.One,p.Two,p.Three].includes(E))switch(n.preventDefault(),E){case p.One:F("\u4986");break;case p.Two:F("\u652B");break;case p.Three:F("\u7383");break}}else E===p.Tab&&M?(n.preventDefault(),n.nativeEvent.stopImmediatePropagation(),j(T)):n.nativeEvent.stopPropagation()}},v=e.createElement("div",{className:l.textAreaFooter},e.createElement("div",{className:l.hotkeyTip},M&&e.createElement("span",null,"[",r("Switch"),"]Tab"),e.createElement("span",null,"[",r("TurnPage"),"]Ctrl+Enter")),e.createElement("div",{className:l.wordCount},e.createElement("span",{className:A>=h?l.warning:""},A),"/",e.createElement("span",null,h)));return q(()=>{c&&B(!1)},[c]),q(()=>{x(!1)},[b]),e.createElement("div",{className:l.textField},e.createElement("div",{className:l.label},e.createElement("div",{className:l.labelText},e.createElement("span",{className:U({[l.titleText]:!0,[l.required]:m.required})},e.createElement(re,{text:m.label,openByText:!0,isToolTips:!0})),e.createElement(ce,{onClick:()=>{c||L("")},title:"",disabled:c})),e.createElement("div",{className:l.extra},w)),e.createElement("div",{className:U({disabled:c,"textarea-outline":!0,"ant-input-focused":i,[l.textareaContainer]:!0,[l.focus]:i,[l.invalid]:_}),style:i?N:{}},e.createElement(Ne,{footer:v,textareaProps:f})),S&&e.createElement("span",{style:{color:"#ff4d4f",lineHeight:"22px"}},S))},qe=u=>{const{configList:o,autofocus:r,textID:C,result:i,showText:B,updateText:_,toggleShowText:x,textInputDisabled:c,isCheck:m,isEdit:$,config:g,preContext:T,regions:j=[],textConfigurable:k=!0,clipTextConfigurable:b,clipAttributeConfigurable:F,updateRegion:I,clipAttributeList:y=[],clipTextList:N=Ae}=u,{t:w}=le(),[S,h]=O(0),[D,A]=O(""),L=te(null),{audioClipState:M}=De(),f=o||[X({},Ie)];let v=j;if(b&&!m){const t=M.selectedRegion.id;v=v.filter(a=>a.id===t)}const n=t=>{setTimeout(()=>{const a=document.getElementById(`textInput-${t}`);a&&(h(t),a.focus(),a.select(),a.scrollIntoView({behavior:"smooth",block:"center"}))})},E=t=>{const a=k?f.length:0,d=b?v.length*N.length:0,s=a+d,P=(t+1)%s;n(P)},J=t=>{t.keyCode===p.Tab&&(t.preventDefault(),(f.length>0||b&&N.length>0)&&n(0))},R=t=>{const a=document.getElementById(`textInput-${S}`);if(!(g==null?void 0:g.enablePlaceholderHotkey)||!a||!_)return;const{value:d,selectionStart:s,selectionEnd:P}=a,G=`${d.slice(0,s)}${t}${d.slice(P)}`;_(G,f[S].key),A(t),setTimeout(()=>{a.setSelectionRange(s+1,s+1),a.focus()},0),clearTimeout(L.current),L.current=setTimeout(()=>{A("")},400)};q(()=>($||document.addEventListener("keydown",J),()=>{document.removeEventListener("keydown",J)}),[o]),q(()=>{r&&!c&&n(0)},[C]);let K=f;m&&(K=f.filter(t=>(i==null?void 0:i[t.key])!==void 0));const me=Ce(()=>N.reduce((t,a)=>(v.forEach(d=>{d&&t.push(ie(X({},a),{clipTextResult:d}))}),t),[]),[N,v]);return e.createElement(e.Fragment,null,(g==null?void 0:g.enablePlaceholderHotkey)&&e.createElement("div",{className:l.placeholderHotkey},e.createElement("div",{className:l.title},"\u5360\u4F4D\u7B26\u5FEB\u6377\u8F93\u5165",e.createElement(ae,{overlayStyle:{maxWidth:240},title:e.createElement("div",null,e.createElement("div",null,"\u4986\uFF08Ctrl+1\uFF09\uFF1A"),e.createElement("div",{style:{marginBottom:12}},"\u6587\u5B57\u5F02\u5E38\uFF0C\u4F46\u53EA\u6839\u636E\u8FD9\u4E2A\u5B57\u7684\u5F62\u72B6\u5C31\u53EF\u4EE5\u731C\u51FA\u662F\u4EC0\u4E48\u5B57"),e.createElement("div",null,"\u652B\uFF08Ctrl+2\uFF09\uFF1A"),e.createElement("div",{style:{marginBottom:12}},"\u6587\u5B57\u5F02\u5E38\uFF0C\u4E14\u65E0\u6CD5\u6839\u636E\u5F62\u72B6\u731C\u5B57\uFF0C\u4F46\u80FD\u7ED3\u5408\u4E0A\u4E0B\u6587\u8BED\u4E49\u5224\u65AD\u51FA\u662F\u4EC0\u4E48\u5B57"),e.createElement("div",null,"\u7383\uFF08Ctrl+3\uFF09\uFF1A"),e.createElement("div",null,"\u5B8C\u5168\u65E0\u6CD5\u5224\u65AD\u662F\u4EC0\u4E48\u5B57")),placement:"bottom"},e.createElement(ye,{className:l.questionIcon}))),e.createElement(H.Group,{value:D},e.createElement(H.Button,{value:"\u4986",onClick:t=>R(t.target.value)},e.createElement("div",{className:"label"},e.createElement("div",{className:"text"},"\u4986 (\u89C6\u89C9)"),e.createElement("div",{className:"hotkey"},"Ctrl+1"))),e.createElement(H.Button,{value:"\u652B",onClick:t=>R(t.target.value)},e.createElement("div",{className:"label"},e.createElement("div",{className:"text"},"\u652B (\u8BED\u4E49)"),e.createElement("div",{className:"hotkey"},"Ctrl+2"))),e.createElement(H.Button,{value:"\u7383",onClick:t=>R(t.target.value)},e.createElement("div",{className:"label"},e.createElement("div",{className:"text"},"\u7383 (\u65E0\u6548)"),e.createElement("div",{className:"hotkey"},"Ctrl+3"))))),e.createElement("div",{className:l.textInputContainer},e.createElement(oe,{audioContext:T==null?void 0:T.before}),k&&K.map((t,a)=>e.createElement(Q,{config:t,key:a,index:a,result:i,updateText:_,switchToNextTextarea:E,hasMultiple:f.length>1,disabled:c,textID:C,addPlaceholder:R,onFocus:()=>h(a)})),b&&v.length>0&&me.map((t,a)=>{var d;const{clipTextResult:s}=t,{id:P,start:G,end:de,attribute:V}=s,{maxLength:Ee=3e3,label:Y,key:Z,required:pe}=t,ee=s==null?void 0:s[Z],fe={[s.id]:ee},ve={label:`${Y!=null?Y:w("textTool")}\uFF08${ne(G,"ss.SSS")} - ${ne(de,"ss.SSS")}\uFF09`,key:P,maxLength:Ee},W=(k?K.length:0)+a,z=we(V,y),xe={color:Be(V,y),backgroundColor:z},ge=w("LeastCharacterError",{num:1}),Te=pe&&ee.length<1?ge:void 0,Fe=(d=_e(V,[{value:"",key:w("NoAttribute")},...y]))!=null?d:"";return e.createElement(Q,{config:ve,key:a,index:W,disabled:c,result:fe,updateText:he=>{I==null||I(ie(X({},s),{[Z]:he}))},switchToNextTextarea:()=>{E(W)},hasMultiple:!0,onFocus:()=>h(W),onFocusStyle:F?{borderColor:z,boxShadow:`0 0 0 2px ${ke(z,.4)}`}:{},extra:F?e.createElement("div",{style:xe,className:l.attribute},e.createElement(re,{text:Fe,openByText:!0,isToolTips:!0})):null,errorText:Te})}),e.createElement(oe,{audioContext:T==null?void 0:T.after}),x&&e.createElement("div",{className:l.switchItem},w("toggleShowText"),e.createElement(be,{style:{alignSelf:"center"},checked:B,onChange:t=>{x(t)}}))))};export{ce as ClearIcon,Q as SingleTextInput,qe as default};
@@ -1 +1 @@
1
- var e={textInputContainer:"index-module_textInputContainer__ES6X3",textField:"index-module_textField__uRcb7",label:"index-module_label__xE6hM",required:"index-module_required__iElYl",extra:"index-module_extra__PW5Qk",textareaContainer:"index-module_textareaContainer__dTIv4",textAreaFooter:"index-module_textAreaFooter__h1Vv-",warning:"index-module_warning__NKpW6",hotkeyTip:"index-module_hotkeyTip__BSJ6A",wordCount:"index-module_wordCount__OD4eL",focus:"index-module_focus__H07-Y",invalid:"index-module_invalid__F9RC5",inputCount:"index-module_inputCount__--XiT",notify:"index-module_notify__rYuqq",switchItem:"index-module_switchItem__Q256x",placeholderHotkey:"index-module_placeholderHotkey__0SKPo",title:"index-module_title__YRpw9",questionIcon:"index-module_questionIcon__oK1HK",attribute:"index-module_attribute__g8Vbl",clearIcon:"index-module_clearIcon__ZBZqI",disabled:"index-module_disabled__zqh8C"};export{e as default};
1
+ var e={textInputContainer:"index-module_textInputContainer__ES6X3",textField:"index-module_textField__uRcb7",label:"index-module_label__xE6hM",labelText:"index-module_labelText__Zg1c4",titleText:"index-module_titleText__BRM44",required:"index-module_required__iElYl",extra:"index-module_extra__PW5Qk",textareaContainer:"index-module_textareaContainer__dTIv4",textAreaFooter:"index-module_textAreaFooter__h1Vv-",warning:"index-module_warning__NKpW6",hotkeyTip:"index-module_hotkeyTip__BSJ6A",wordCount:"index-module_wordCount__OD4eL",focus:"index-module_focus__H07-Y",invalid:"index-module_invalid__F9RC5",inputCount:"index-module_inputCount__--XiT",notify:"index-module_notify__rYuqq",switchItem:"index-module_switchItem__Q256x",placeholderHotkey:"index-module_placeholderHotkey__0SKPo",title:"index-module_title__YRpw9",questionIcon:"index-module_questionIcon__oK1HK",attribute:"index-module_attribute__g8Vbl",clearIcon:"index-module_clearIcon__ZBZqI",disabled:"index-module_disabled__zqh8C"};export{e as default};
@@ -0,0 +1 @@
1
+ import r from"lodash";class o{}o.getClipTextByConfig=(a,f,l=!1)=>{const t=r.cloneDeep(a);return f.forEach((e,c)=>{var s;const n=(s=e==null?void 0:e.default)!=null?s:"";c===0?Object.assign(t,{text:l?n:a[e.key]}):Object.assign(t,{[e.key]:l?n:a[e.key]})}),t};export{o as default};
@@ -1 +1 @@
1
- import t,{useRef as k}from"react";import S from"react-dom";import{useAudioClipStore as $}from"../../audioAnnotate/audioContext/index.js";import{getAttributeColor as w,getAttributeFontColor as N,updateColorOpacity as O,getAttributeShowText as T}from"../../../utils/audio.js";import F from"../../../assets/annotation/audio/loop.svg.js";import{Typography as P}from"antd";import{useClickAway as _}from"ahooks";import{classnames as D}from"../../../utils/index.js";import r from"./index.module.scss.js";const{Paragraph:I}=P,M=m=>{const{audioClipState:f,setAudioClipState:g}=$(),{clipAttributeList:i,clipAttributeConfigurable:b,clipTextConfigurable:x,selectedRegion:n}=f,c=k(null),{el:C,region:h,edgeAdsorption:y,clipping:A,instance:d}=m,{attribute:s="",text:v="",id:l,start:E,end:R}=h,{id:a}=n,o=w(s,i),u={color:N(s,i),backgroundColor:o},e={border:`2px solid ${o}`};if(l===a)e.backgroundColor=O(o,.6),e.borderLeft=`2px solid ${o}`,e.borderRight=`2px solid ${o}`;else if(d==null||d.setLoop(!1),e.borderLeft=`2px solid ${o}`,e.borderRight=`2px solid ${o}`,A){const p=Object.values(y);p.includes(E)&&(e.borderLeft="3px dashed #fff"),p.includes(R)&&(e.borderRight="3px dashed #fff")}_(()=>{l===a&&g({selectedRegion:{}})},c,["contextmenu"]);const j=l===a&&n.loop,L=t.createElement("div",{style:e,ref:c,className:D({[r.container]:!0})},j&&t.createElement("div",{className:r.loop},t.createElement("img",{src:F})),b&&t.createElement("div",null,t.createElement("div",{style:u,className:r.attribute},T(s,[{value:"",key:"\u65E0\u5C5E\u6027"},...i]))),x&&t.createElement(I,{ellipsis:{rows:2},className:r.text,style:u},"\u6587\u672C:",v));return t.createElement(t.Fragment,null,S.createPortal(L,C))};export{M as default};
1
+ import r,{useRef as I}from"react";import B from"react-dom";import{useAudioClipStore as M}from"../../audioAnnotate/audioContext/index.js";import{getAttributeColor as U,getAttributeFontColor as V,updateColorOpacity as Y,getAttributeShowText as q}from"../../../utils/audio.js";import z from"../../../assets/annotation/audio/loop.svg.js";import{Typography as G}from"antd";import{useClickAway as H}from"ahooks";import{classnames as J}from"../../../utils/index.js";import n from"./index.module.scss.js";import{useTranslation as K}from"react-i18next";import{TagUtils as Q}from"@labelbee/lb-annotation";var W=Object.defineProperty,X=Object.defineProperties,Z=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,w=(o,e,t)=>e in o?W(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,oe=(o,e)=>{for(var t in e||(e={}))ee.call(e,t)&&w(o,t,e[t]);if(h)for(var t of h(e))te.call(e,t)&&w(o,t,e[t]);return o},re=(o,e)=>X(o,Z(e));const{Paragraph:E}=G,le=({result:o,subAttributeList:e,textStyle:t})=>{const u=Q.getTagNameList(o,e);return r.createElement("div",null,u.map((a,c)=>r.createElement(E,{ellipsis:{rows:2},className:n.text,key:c,style:re(oe({},t),{marginBottom:0})},`${a.keyName}\uFF1A${a.value.join("\u3001")}`)))},se=o=>{const{t:e}=K(),{audioClipState:t,setAudioClipState:u}=M(),{clipAttributeList:a,clipAttributeConfigurable:c,clipTextConfigurable:P,selectedRegion:b,clipTextList:g,secondaryAttributeConfigurable:j,subAttributeList:v}=t,x=I(null),{el:L,region:y,edgeAdsorption:R,clipping:S,instance:_,isCheck:T}=o,{attribute:p="",text:ie="",id:d,start:k,end:N,subAttribute:C}=y,{id:m}=b,s=U(p,a),f={color:V(p,a),backgroundColor:s},l={border:`2px solid ${s}`,overflowY:T?"initial":"auto"};if(d===m)l.backgroundColor=Y(s,.6),l.borderLeft=`2px solid ${s}`,l.borderRight=`2px solid ${s}`;else if(_==null||_.setLoop(!1),l.borderLeft=`2px solid ${s}`,l.borderRight=`2px solid ${s}`,S){const i=Object.values(R);i.includes(k)&&(l.borderLeft="3px dashed #fff"),i.includes(N)&&(l.borderRight="3px dashed #fff")}H(()=>{d===m&&u({selectedRegion:{}})},x,["contextmenu"]);const $=d===m&&b.loop,F=r.createElement("div",{style:l,ref:x,className:J({[n.container]:!0})},$&&r.createElement("div",{className:n.loop},r.createElement("img",{src:z})),c&&r.createElement("div",null,r.createElement("div",{style:f,className:n.attribute},q(p,[{value:"",key:"\u65E0\u5C5E\u6027"},...a])),j&&C&&v&&r.createElement(le,{result:C,subAttributeList:v,textStyle:f})),P&&(g==null?void 0:g.map((i,D)=>{var A,O;return r.createElement(E,{ellipsis:{rows:2},className:n.text,style:f,key:D},(A=i==null?void 0:i.label)!=null?A:e("textTool"),":",(O=y[i==null?void 0:i.key])!=null?O:"")})));return r.createElement(r.Fragment,null,B.createPortal(F,L))};export{se as default};