@labelbee/lb-components 1.19.1-alpha.1 → 1.20.0-alpha.10

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 (195) hide show
  1. package/dist/assets/annotation/toolHotKeyIcon/icon_eraser.svg.js +1 -0
  2. package/dist/assets/annotation/toolHotKeyIcon/icon_line_static.svg.js +1 -0
  3. package/dist/assets/annotation/toolHotKeyIcon/icon_scribble.svg.js +1 -0
  4. package/dist/assets/annotation/toolHotKeyIcon/icon_strokeEnlarge.svg.js +1 -0
  5. package/dist/assets/annotation/toolHotKeyIcon/icon_strokeReduction.svg.js +1 -0
  6. package/dist/assets/annotation/video/icon_timePoint.svg.js +1 -0
  7. package/dist/assets/annotation/video/icon_videoCut.svg.js +1 -0
  8. package/dist/assets/annotation/video/icon_videoCutting.svg.js +1 -0
  9. package/dist/assets/attributeIcon/eraser.svg.js +1 -1
  10. package/dist/assets/attributeIcon/eraser_a.svg.js +1 -1
  11. package/dist/assets/attributeIcon/icon_eyeLock_a.svg.js +1 -0
  12. package/dist/assets/attributeIcon/icon_eyeLock_h.svg.js +1 -0
  13. package/dist/assets/attributeIcon/pen.svg.js +1 -1
  14. package/dist/assets/attributeIcon/pen_a.svg.js +1 -1
  15. package/dist/assets/icons/32b52174.svg +5 -0
  16. package/dist/assets/icons/ad8081bf.svg +13 -0
  17. package/dist/components/LLMToolView/sidebar/components/answerList/index.js +1 -1
  18. package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -1
  19. package/dist/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -0
  20. package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -1
  21. package/dist/components/LLMToolView/sidebar/components/textInputBox/index.module.scss.js +1 -0
  22. package/dist/components/LLMToolView/sidebar/index.js +1 -1
  23. package/dist/components/attributeList/index.js +1 -1
  24. package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
  25. package/dist/components/audioAnnotate/audioSide/labelFilterInput/index.js +1 -1
  26. package/dist/components/audioAnnotate/audioSide/labelSidebar/index.js +1 -1
  27. package/dist/components/audioAnnotate/index.js +1 -1
  28. package/dist/components/audioAnnotate/textInput/index.js +1 -1
  29. package/dist/components/audioPlayer/combineTip/index.js +1 -1
  30. package/dist/components/audioPlayer/index.js +1 -1
  31. package/dist/components/audioPlayer/labelDisplayToggle/index.js +1 -1
  32. package/dist/components/audioPlayer/segmentTip/index.js +1 -1
  33. package/dist/components/audioPlayer/zoomSlider/index.js +1 -1
  34. package/dist/components/latexEditor/constant/config.js +1 -0
  35. package/dist/components/latexEditor/index.js +1 -0
  36. package/dist/components/latexEditor/index.module.scss.js +1 -0
  37. package/dist/components/pointCloudView/PointCloudInfos.js +1 -1
  38. package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  39. package/dist/components/videoAnnotate/index.js +1 -1
  40. package/dist/components/videoAnnotate/videoClipTool/VideoClipToolContext.js +1 -0
  41. package/dist/components/videoAnnotate/videoClipTool/components/ToolTipForClip.js +1 -0
  42. package/dist/components/videoAnnotate/videoClipTool/components/annotatedList/index.js +1 -0
  43. package/dist/components/videoAnnotate/videoClipTool/components/annotatedList/index.module.scss.js +1 -0
  44. package/dist/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.js +1 -0
  45. package/dist/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.module.scss.js +1 -0
  46. package/dist/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.js +1 -0
  47. package/dist/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.module.scss.js +1 -0
  48. package/dist/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.js +1 -0
  49. package/dist/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.module.scss.js +1 -0
  50. package/dist/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.js +1 -0
  51. package/dist/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.module.scss.js +1 -0
  52. package/dist/components/videoAnnotate/videoClipTool/components/videoTrack/index.js +1 -0
  53. package/dist/components/videoAnnotate/videoClipTool/components/videoTrack/index.module.scss.js +1 -0
  54. package/dist/components/videoAnnotate/videoClipTool/constant.js +1 -0
  55. package/dist/components/videoAnnotate/videoClipTool/index.js +1 -0
  56. package/dist/components/videoAnnotate/videoClipTool/index.module.scss.js +1 -0
  57. package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -0
  58. package/dist/components/videoAnnotate/videoTextTool/index.js +1 -0
  59. package/dist/components/videoPlayer/VideoTagLayer.js +1 -1
  60. package/dist/components/videoPlayer/VideoTextLayer.js +2 -0
  61. package/dist/components/videoPlayer/components/SpeedController/index.js +1 -1
  62. package/dist/components/videoPlayer/components/controller/index.js +1 -1
  63. package/dist/components/videoPlayer/index.js +1 -1
  64. package/dist/components/videoPlayer/utils.js +1 -1
  65. package/dist/index.css +385 -3
  66. package/dist/index.js +1 -1
  67. package/dist/store/annotation/reducer.js +1 -1
  68. package/dist/types/App.d.ts +2 -2
  69. package/dist/types/components/LLMToolView/sidebar/components/textEditor/index.d.ts +1 -0
  70. package/dist/types/components/LLMToolView/types.d.ts +1 -0
  71. package/dist/types/components/audioAnnotate/audioSide/labelSidebar/index.d.ts +4 -21
  72. package/dist/types/components/audioAnnotate/index.d.ts +1 -1
  73. package/dist/types/components/latexEditor/constant/config.d.ts +18 -0
  74. package/dist/types/components/latexEditor/index.d.ts +12 -0
  75. package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +1 -1
  76. package/dist/types/components/pointCloudView/PointCloud3DView.d.ts +1 -1
  77. package/dist/types/components/pointCloudView/PointCloudBackView.d.ts +1 -1
  78. package/dist/types/components/pointCloudView/PointCloudListener.d.ts +1 -1
  79. package/dist/types/components/pointCloudView/PointCloudSegment.d.ts +1 -1
  80. package/dist/types/components/pointCloudView/PointCloudSegment2DView.d.ts +1 -1
  81. package/dist/types/components/pointCloudView/PointCloudSegmentListener.d.ts +1 -1
  82. package/dist/types/components/pointCloudView/PointCloudSideView.d.ts +1 -1
  83. package/dist/types/components/pointCloudView/PointCloudTopView.d.ts +3 -3
  84. package/dist/types/components/pointCloudView/index.d.ts +3 -3
  85. package/dist/types/components/videoAnnotate/index.d.ts +18 -7
  86. package/dist/types/components/videoAnnotate/videoClipTool/VideoClipToolContext.d.ts +27 -0
  87. package/dist/types/components/videoAnnotate/videoClipTool/components/ToolTipForClip.d.ts +8 -0
  88. package/dist/types/components/videoAnnotate/videoClipTool/components/annotatedList/index.d.ts +7 -0
  89. package/dist/types/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.d.ts +14 -0
  90. package/dist/types/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.d.ts +18 -0
  91. package/dist/types/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.d.ts +6 -0
  92. package/dist/types/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.d.ts +3 -0
  93. package/dist/types/components/videoAnnotate/videoClipTool/components/videoTrack/index.d.ts +11 -0
  94. package/dist/types/components/videoAnnotate/videoClipTool/constant.d.ts +26 -0
  95. package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +131 -0
  96. package/dist/types/components/{videoPlayer → videoAnnotate/videoTagTool}/TagToolInstanceAdaptor.d.ts +6 -10
  97. package/dist/types/components/videoAnnotate/videoTextTool/index.d.ts +56 -0
  98. package/dist/types/components/videoPlayer/VideoTagLayer.d.ts +1 -0
  99. package/dist/types/components/videoPlayer/VideoTextLayer.d.ts +2 -0
  100. package/dist/types/components/videoPlayer/components/controller/index.d.ts +4 -2
  101. package/dist/types/components/videoPlayer/index.d.ts +11 -0
  102. package/dist/types/components/videoPlayer/utils.d.ts +6 -0
  103. package/dist/types/hooks/annotation.d.ts +2 -2
  104. package/dist/types/index.d.ts +1 -1
  105. package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +2 -1
  106. package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/scribble/index.d.ts +25 -0
  107. package/dist/utils/audio.js +1 -1
  108. package/dist/views/MainView/LLMLayout/index.js +1 -1
  109. package/dist/views/MainView/index.js +1 -1
  110. package/dist/views/MainView/sidebar/ScribbleSidebar/index.js +1 -1
  111. package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  112. package/dist/views/MainView/sidebar/index.js +1 -1
  113. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.js +1 -1
  114. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js +1 -1
  115. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  116. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/scribble/index.js +1 -1
  117. package/es/assets/annotation/toolHotKeyIcon/icon_eraser.svg.js +1 -0
  118. package/es/assets/annotation/toolHotKeyIcon/icon_line_static.svg.js +1 -0
  119. package/es/assets/annotation/toolHotKeyIcon/icon_scribble.svg.js +1 -0
  120. package/es/assets/annotation/toolHotKeyIcon/icon_strokeEnlarge.svg.js +1 -0
  121. package/es/assets/annotation/toolHotKeyIcon/icon_strokeReduction.svg.js +1 -0
  122. package/es/assets/annotation/video/icon_timePoint.svg.js +1 -0
  123. package/es/assets/annotation/video/icon_videoCut.svg.js +1 -0
  124. package/es/assets/annotation/video/icon_videoCutting.svg.js +1 -0
  125. package/es/assets/attributeIcon/eraser.svg.js +1 -1
  126. package/es/assets/attributeIcon/eraser_a.svg.js +1 -1
  127. package/es/assets/attributeIcon/icon_eyeLock_a.svg.js +1 -0
  128. package/es/assets/attributeIcon/icon_eyeLock_h.svg.js +1 -0
  129. package/es/assets/attributeIcon/pen.svg.js +1 -1
  130. package/es/assets/attributeIcon/pen_a.svg.js +1 -1
  131. package/es/components/LLMToolView/sidebar/components/answerList/index.js +1 -1
  132. package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -1
  133. package/es/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -0
  134. package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -1
  135. package/es/components/LLMToolView/sidebar/components/textInputBox/index.module.scss.js +1 -0
  136. package/es/components/LLMToolView/sidebar/index.js +1 -1
  137. package/es/components/attributeList/index.js +1 -1
  138. package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
  139. package/es/components/audioAnnotate/audioSide/labelFilterInput/index.js +1 -1
  140. package/es/components/audioAnnotate/audioSide/labelSidebar/index.js +1 -1
  141. package/es/components/audioAnnotate/index.js +1 -1
  142. package/es/components/audioAnnotate/textInput/index.js +1 -1
  143. package/es/components/audioPlayer/combineTip/index.js +1 -1
  144. package/es/components/audioPlayer/index.js +1 -1
  145. package/es/components/audioPlayer/labelDisplayToggle/index.js +1 -1
  146. package/es/components/audioPlayer/segmentTip/index.js +1 -1
  147. package/es/components/audioPlayer/zoomSlider/index.js +1 -1
  148. package/es/components/latexEditor/constant/config.js +1 -0
  149. package/es/components/latexEditor/index.js +1 -0
  150. package/es/components/latexEditor/index.module.scss.js +1 -0
  151. package/es/components/pointCloudView/PointCloudInfos.js +1 -1
  152. package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  153. package/es/components/videoAnnotate/index.js +1 -1
  154. package/es/components/videoAnnotate/videoClipTool/VideoClipToolContext.js +1 -0
  155. package/es/components/videoAnnotate/videoClipTool/components/ToolTipForClip.js +1 -0
  156. package/es/components/videoAnnotate/videoClipTool/components/annotatedList/index.js +1 -0
  157. package/es/components/videoAnnotate/videoClipTool/components/annotatedList/index.module.scss.js +1 -0
  158. package/es/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.js +1 -0
  159. package/es/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.module.scss.js +1 -0
  160. package/es/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.js +1 -0
  161. package/es/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.module.scss.js +1 -0
  162. package/es/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.js +1 -0
  163. package/es/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.module.scss.js +1 -0
  164. package/es/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.js +1 -0
  165. package/es/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.module.scss.js +1 -0
  166. package/es/components/videoAnnotate/videoClipTool/components/videoTrack/index.js +1 -0
  167. package/es/components/videoAnnotate/videoClipTool/components/videoTrack/index.module.scss.js +1 -0
  168. package/es/components/videoAnnotate/videoClipTool/constant.js +1 -0
  169. package/es/components/videoAnnotate/videoClipTool/index.js +1 -0
  170. package/es/components/videoAnnotate/videoClipTool/index.module.scss.js +1 -0
  171. package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -0
  172. package/es/components/videoAnnotate/videoTextTool/index.js +1 -0
  173. package/es/components/videoPlayer/VideoTagLayer.js +1 -1
  174. package/es/components/videoPlayer/VideoTextLayer.js +2 -0
  175. package/es/components/videoPlayer/components/SpeedController/index.js +1 -1
  176. package/es/components/videoPlayer/components/controller/index.js +1 -1
  177. package/es/components/videoPlayer/index.js +1 -1
  178. package/es/components/videoPlayer/utils.js +1 -1
  179. package/es/index.css +385 -3
  180. package/es/index.js +1 -1
  181. package/es/store/annotation/reducer.js +1 -1
  182. package/es/utils/audio.js +1 -1
  183. package/es/views/MainView/index.js +1 -1
  184. package/es/views/MainView/sidebar/ScribbleSidebar/index.js +1 -1
  185. package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  186. package/es/views/MainView/sidebar/index.js +1 -1
  187. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.js +1 -1
  188. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js +1 -1
  189. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/scribble/index.js +1 -1
  190. package/package.json +6 -4
  191. package/dist/components/videoPlayer/TagToolInstanceAdaptor.js +0 -1
  192. package/es/components/videoPlayer/TagToolInstanceAdaptor.js +0 -1
  193. /package/dist/components/{videoPlayer → videoAnnotate/videoTagTool}/TagToolInstanceAdaptorI18nProvider.js +0 -0
  194. /package/dist/types/components/{videoPlayer → videoAnnotate/videoTagTool}/TagToolInstanceAdaptorI18nProvider.d.ts +0 -0
  195. /package/es/components/{videoPlayer → videoAnnotate/videoTagTool}/TagToolInstanceAdaptorI18nProvider.js +0 -0
@@ -1 +1 @@
1
- import{ViewportProvider as A}from"../../components/customResizeHook/index.js";import{prefix as C}from"../../constant/index.js";import{Spin as S}from"antd";import{Layout as v}from"antd/es";import t,{useState as b}from"react";import O from"./annotationOperation/index.js";import M from"./annotationTips/index.js";import V from"./sidebar/index.js";import h from"./toolFooter/index.js";import k from"./toolHeader/index.js";import{getStepConfig as _}from"../../store/annotation/reducer.js";import F from"../../components/videoAnnotate/index.js";import{connect as I}from"react-redux";import E from"../../utils/ToolUtils.js";import $ from"../../components/pointCloudView/index.js";import{getClassName as H}from"../../utils/dom.js";import{classnames as R}from"../../utils/index.js";import W from"../../components/predictTracking/previewResult/index.js";import{LabelBeeContext as p}from"../../store/ctx.js";import{EToolName as y}from"../../data/enums/ToolType.js";import B from"./LLMLayout/index.js";import D from"../../components/audioAnnotate/index.js";import{LoadingOutlined as U}from"@ant-design/icons";import{useTranslation as z}from"react-i18next";import{EAudioToolName as q,EPointCloudName as G}from"@labelbee/lb-annotation";var J=Object.defineProperty,L=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,x=(e,o,n)=>o in e?J(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,r=(e,o)=>{for(var n in o||(o={}))K.call(o,n)&&x(e,n,o[n]);if(L)for(var n of L(o))Q.call(o,n)&&x(e,n,o[n]);return e};const{Sider:X,Content:Y}=v,s=`${C}-layout`,Z=e=>{var o;return t.createElement(t.Fragment,null,e.showTips===!0&&t.createElement(M,{path:e.path,tips:e.tips}),t.createElement(O,r({},e)),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},ee=e=>{var o;return t.createElement(t.Fragment,null,t.createElement($,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit}),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},te=e=>{var o;const{stepList:n,step:i}=e,a=(o=_(n,i))==null?void 0:o.tool,d=E.isVideoTool(a),l=E.isPointCloudTool(a);return d?t.createElement(F,r({},e)):l?t.createElement(ee,r({},e)):t.createElement(Z,r({},e))},T=e=>{var o,n,i;const{t:a}=z(),{stepList:d,step:l}=e,m=(o=_(d,l))==null?void 0:o.tool,c=![y.LLM,q.AudioTextTool].includes(m),u=![y.LLM].includes(m),f=[G.PointCloud].includes(m);return t.createElement(A,null,t.createElement(S,{spinning:e.loading,indicator:t.createElement(U,null),tip:t.createElement("span",{style:{marginTop:200}},a("LoadingTips")),delay:500},t.createElement(v,{className:R([s,e.className]),style:(n=e.style)==null?void 0:n.layout},t.createElement("header",{className:`${s}__header`,style:(i=e.style)==null?void 0:i.header},t.createElement(k,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:c,hasHeaderOption:u,hasPredictTrackingIcon:f})),e.children)))},oe=e=>{var o,n,i,a,d,l,m;const[c,u]=b(void 0),f=(n=(o=e.style)==null?void 0:o.sider)==null?void 0:n.width,{stepList:j,step:P}=e,g=(i=_(j,P))==null?void 0:i.tool,w=y.LLM===g,N=E.isAudioTool(g);return w?t.createElement(T,r({},e),t.createElement(B,r({},e))):N?t.createElement(T,r({},e),t.createElement(D,r({},e))):t.createElement(T,r({},e),t.createElement(v,{className:H("layout","container")},e==null?void 0:e.leftSider,t.createElement(Y,{className:`${s}__content`},t.createElement(te,r({},e)),t.createElement(W,null)),t.createElement(X,{className:`${s}__side`,width:(a=c!=null?c:f)!=null?a:240,style:(d=e.style)==null?void 0:d.sider},t.createElement(V,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:u,propsSiderWidth:(m=(l=e.style)==null?void 0:l.sider)==null?void 0:m.width}))))},ne=({annotation:e})=>{var o,n,i;const{imgList:a,loading:d}=e,l=(o=a[e.imgIndex])!=null?o:{};return{path:(i=(n=l==null?void 0:l.path)!=null?n:l==null?void 0:l.url)!=null?i:"",loading:d}};var le=I(ne,null,null,{context:p})(oe);export{le as default};
1
+ import{ViewportProvider as S}from"../../components/customResizeHook/index.js";import{prefix as C}from"../../constant/index.js";import{Spin as b}from"antd";import{Layout as v}from"antd/es";import t,{useState as A}from"react";import O from"./annotationOperation/index.js";import M from"./annotationTips/index.js";import V from"./sidebar/index.js";import h from"./toolFooter/index.js";import k from"./toolHeader/index.js";import{getStepConfig as _}from"../../store/annotation/reducer.js";import F from"../../components/videoAnnotate/index.js";import{connect as I}from"react-redux";import y from"../../utils/ToolUtils.js";import $ from"../../components/pointCloudView/index.js";import{getClassName as H}from"../../utils/dom.js";import{classnames as R}from"../../utils/index.js";import W from"../../components/predictTracking/previewResult/index.js";import{LabelBeeContext as B}from"../../store/ctx.js";import{EToolName as E}from"../../data/enums/ToolType.js";import D from"./LLMLayout/index.js";import U from"../../components/audioAnnotate/index.js";import{LoadingOutlined as p}from"@ant-design/icons";import{useTranslation as z}from"react-i18next";import{EPointCloudName as q}from"@labelbee/lb-annotation";var G=Object.defineProperty,T=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,x=(e,o,n)=>o in e?G(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,a=(e,o)=>{for(var n in o||(o={}))J.call(o,n)&&x(e,n,o[n]);if(T)for(var n of T(o))K.call(o,n)&&x(e,n,o[n]);return e};const{Sider:Q,Content:X}=v,s=`${C}-layout`,Y=e=>{var o;return t.createElement(t.Fragment,null,e.showTips===!0&&t.createElement(M,{path:e.path,tips:e.tips}),t.createElement(O,a({},e)),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},Z=e=>{var o;return t.createElement(t.Fragment,null,t.createElement($,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit}),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},ee=e=>{var o;const{stepList:n,step:i}=e,r=(o=_(n,i))==null?void 0:o.tool,d=y.isPointCloudTool(r),l=y.isVideoTool(r);return d?t.createElement(Z,a({},e)):l?t.createElement(F,{drawLayerSlot:e.drawLayerSlot,footer:e.footer}):t.createElement(Y,a({},e))},L=e=>{var o,n,i;const{t:r}=z(),{stepList:d,step:l}=e,m=(o=_(d,l))==null?void 0:o.tool,c=![E.LLM].includes(m),u=![E.LLM].includes(m),f=[q.PointCloud].includes(m);return t.createElement(S,null,t.createElement(b,{spinning:e.loading,indicator:t.createElement(p,null),tip:t.createElement("span",{style:{marginTop:200}},r("LoadingTips")),delay:500},t.createElement(v,{className:R([s,e.className]),style:(n=e.style)==null?void 0:n.layout},t.createElement("header",{className:`${s}__header`,style:(i=e.style)==null?void 0:i.header},t.createElement(k,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:c,hasHeaderOption:u,hasPredictTrackingIcon:f})),e.children)))},te=e=>{var o,n,i,r,d,l,m;const[c,u]=A(void 0),f=(n=(o=e.style)==null?void 0:o.sider)==null?void 0:n.width,{stepList:w,step:j}=e,g=(i=_(w,j))==null?void 0:i.tool,P=E.LLM===g,N=y.isAudioTool(g);return P?t.createElement(L,a({},e),t.createElement(D,a({},e))):N?t.createElement(L,a({},e),t.createElement(U,a({},e))):t.createElement(L,a({},e),t.createElement(v,{className:H("layout","container")},e==null?void 0:e.leftSider,t.createElement(X,{className:`${s}__content`},t.createElement(ee,a({},e)),t.createElement(W,null)),t.createElement(Q,{className:`${s}__side`,width:(r=c!=null?c:f)!=null?r:240,style:(d=e.style)==null?void 0:d.sider},t.createElement(V,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:u,propsSiderWidth:(m=(l=e.style)==null?void 0:l.sider)==null?void 0:m.width}))))},oe=({annotation:e})=>{var o,n,i;const{imgList:r,loading:d}=e,l=(o=r[e.imgIndex])!=null?o:{};return{path:(i=(n=l==null?void 0:l.path)!=null?n:l==null?void 0:l.url)!=null?i:"",loading:d}};var ne=I(oe,null,null,{context:B})(te);export{ne as default};
@@ -1 +1 @@
1
- import e,{useState as n}from"react";import{Slider as p}from"antd";import u from"../../../../assets/attributeIcon/pen_a.svg.js";import g from"../../../../assets/attributeIcon/pen.svg.js";import S from"../../../../assets/attributeIcon/eraser_a.svg.js";import E from"../../../../assets/attributeIcon/eraser.svg.js";import{getClassName as r}from"../../../../utils/dom.js";import{EScribblePattern as t}from"../../../../data/enums/ToolType.js";import{useSelector as f}from"../../../../store/ctx.js";const v=m=>{const{onChange:b}=m,s=f(a=>a.annotation.toolInstance),[i,d]=n(20),[l,o]=n(t.Scribble),c=()=>{b(l,i)};return e.createElement("div",{className:r("scribble")},e.createElement("div",{className:r("scribble","select")},e.createElement("img",{src:l===t.Scribble?u:g,onClick:()=>{o(t.Scribble),s==null||s.setPattern(t.Scribble),c()}}),e.createElement("img",{src:l===t.Erase?S:E,onClick:()=>{o(t.Erase),s==null||s.setPattern(t.Erase),c()}})),e.createElement("div",{className:r("scribble","silder")},e.createElement("span",{className:r("scribble","circle")}),e.createElement(p,{onChange:a=>{d(a),c(),s==null||s.setPenSize(a)},min:1,max:50,style:{width:"60%"},value:i}),e.createElement("span",{className:r("scribble","circle"),style:{width:"10px",height:"10px"}})))};export{v as default};
1
+ import r,{useState as d,useEffect as w}from"react";import{Slider as k}from"antd";import y from"../../../../assets/attributeIcon/pen_a.svg.js";import h from"../../../../assets/attributeIcon/pen.svg.js";import C from"../../../../assets/attributeIcon/eraser_a.svg.js";import _ from"../../../../assets/attributeIcon/eraser.svg.js";import{getClassName as n}from"../../../../utils/dom.js";import{EScribblePattern as o}from"../../../../data/enums/ToolType.js";import{useSelector as j}from"../../../../store/ctx.js";import{cKeyCode as N}from"@labelbee/lb-annotation";const i=N.default,u=1,S=50,L=20,P=E=>{const{onChange:p}=E,s=j(t=>t.annotation.toolInstance),[e,l]=d(L),[m,f]=d(o.Scribble),a=()=>{p(m,e)};w(()=>(window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}),[e]);const b=t=>{const{keyCode:I}=t;switch(I){case i.Q:c(o.Scribble);break;case i.W:c(o.Erase);break;case i.F:g();break;case i.G:v();break}},g=()=>{e!==S&&(l(e+1),a(),s==null||s.setPenSize(e+1))},v=()=>{e!==u&&(l(e-1),a(),s==null||s.setPenSize(e-1))},c=t=>{f(t),s==null||s.setPattern(t),a()};return r.createElement("div",{className:n("scribble")},r.createElement("div",{className:n("scribble","select")},r.createElement("img",{src:m===o.Scribble?y:h,onClick:()=>c(o.Scribble)}),r.createElement("img",{src:m===o.Erase?C:_,onClick:()=>c(o.Erase)})),r.createElement("div",{className:n("scribble","slider")},r.createElement("span",{className:n("scribble","circle")}),r.createElement(k,{onChange:t=>{l(t),a(),s==null||s.setPenSize(t)},min:u,max:S,style:{width:"60%"},value:e}),r.createElement("span",{className:n("scribble","circle"),style:{width:"10px",height:"10px"}})))};export{P as default};
@@ -1 +1 @@
1
- import n,{useState as d,useEffect as _,useRef as K}from"react";import{connect as R}from"react-redux";import{cloneDeep as j}from"lodash";import{classnames as C}from"../../../../utils/index.js";import{Input as D}from"antd/es";import{cKeyCode as $}from"@labelbee/lb-annotation";import{PageForward as q}from"../../../../store/annotation/actionCreators.js";import{ConfigUtils as B}from"../../../../utils/ConfigUtils.js";import{useTranslation as U}from"react-i18next";import{LabelBeeContext as M}from"../../../../store/ctx.js";var z=Object.defineProperty,I=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,S=(e,t,a)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,G=(e,t)=>{for(var a in t||(t={}))V.call(t,a)&&S(e,a,t[a]);if(I)for(var a of I(t))W.call(t,a)&&S(e,a,t[a]);return e};const L=$.default,F=e=>{e.stopPropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},O=e=>{const{textareaProps:t,footer:a}=e;return n.createElement(n.Fragment,null,n.createElement(D.TextArea,G({bordered:!1,rows:6,onKeyDown:F,onKeyUp:F},t)),n.createElement("div",{className:C({textAreaLength:!0})},a))},k=e=>{var t;const a=K(null),[x,c]=d(!1),[w,g]=d(!1),{t:u}=U(),{disabled:l,config:i,result:v,updateText:E,index:T,switchToNextTextarea:h,hasMultiple:P,onNext:p}=e,{maxLength:m}=i,f=v?v[i.key]:"",b=(t=f==null?void 0:f.length)!=null?t:0,N=o=>{E&&(E(o,i.key),i.required&&g(!o))},y=P&&h,r={id:`textInput-${T}`,ref:a,disabled:l,value:f,maxLength:m,autoSize:{minRows:2,maxRows:6},onChange:o=>{const A=o.target.value;N(A)},onFocus:()=>{c(!0)},onBlur:o=>{c(!1),i.required&&g(!o.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:o=>{o.ctrlKey&&o.keyCode===L.Enter&&(p&&p(),o.preventDefault()),o.keyCode===L.Tab&&y&&(o.preventDefault(),o.nativeEvent.stopImmediatePropagation(),h(T)),o.nativeEvent.stopPropagation()}},s=n.createElement("div",{className:"textAreaFooter"},n.createElement("div",{className:"hotkeyTip"},y&&n.createElement("span",null,`[${u("Switch")}]Tab`),n.createElement("span",null,`[${u("TurnPage")}]Ctrl+Enter`)),n.createElement("div",{className:"wordCount"},n.createElement("span",{className:b>=m?"warning":""},b),"/",n.createElement("span",null,m)));return _(()=>{l&&c(!1)},[l]),n.createElement("div",{className:"textField"},n.createElement("div",{className:"label"},n.createElement("span",{className:C({required:i.required})},i.label),n.createElement("i",{className:C({clearText:!0,disabled:l}),onClick:()=>{l||N("")}})),n.createElement("div",{className:C({disabled:l,"textarea-outline":!0,"ant-input-focused":x,textareaContainer:!0,focus:x,invalid:w})},n.createElement(O,{footer:s,textareaProps:r})))},H=({toolInstance:e,imgIndex:t,dispatch:a,triggerEventAfterIndexChanged:x,step:c,stepList:w,basicResultList:g})=>{var u,l;const[i,v]=d([]),[E,T]=d(0),[,h]=d(0),P=r=>{const s=(r+1)%i.length;p(s)},p=r=>{setTimeout(()=>{const s=document.getElementById(`textInput-${r}`);s&&(T(r),s.focus(),s.select(),s.scrollIntoView({behavior:"smooth",block:"center"}))})};_(()=>{e&&(v(j(e.config.configList)),e.singleOn("valueUpdated",()=>{h(r=>r+1)}))},[e]);const m=(r,s)=>{e.updateTextValue(s,r)};_(()=>{t>-1&&x&&p(0)},[t]);const f=(l=(u=e.textList[0])==null?void 0:u.value)!=null?l:{},b=()=>{a(q(!0))},y=B.getStepConfig(w,c).dataSourceStep>0&&g.length===0;return n.createElement("div",{className:"textToolOperationMenu"},i.map((r,s)=>n.createElement(k,{config:r,key:r.key,index:s,result:f,updateText:m,switchToNextTextarea:P,hasMultiple:i.length>1,focus:E===s,onNext:b,disabled:y})))};function J(e){return{toolInstance:e.annotation.toolInstance,imgIndex:e.annotation.imgIndex,step:e.annotation.step,basicResultList:e.annotation.basicResultList,stepList:e.annotation.stepList,triggerEventAfterIndexChanged:e.annotation.triggerEventAfterIndexChanged}}var Q=R(J,null,null,{context:M})(H);export{k as SingleTextInput,O as TextareaWithFooter,Q as default};
1
+ import t,{useState as u,useEffect as F,useRef as U}from"react";import{connect as V}from"react-redux";import{cloneDeep as M}from"lodash";import{classnames as C}from"../../../../utils/index.js";import{Switch as z,Input as W}from"antd/es";import{cKeyCode as G,cTool as H}from"@labelbee/lb-annotation";import{PageForward as J}from"../../../../store/annotation/actionCreators.js";import{ConfigUtils as Q}from"../../../../utils/ConfigUtils.js";import{useTranslation as A}from"react-i18next";import{LabelBeeContext as X}from"../../../../store/ctx.js";var Y=Object.defineProperty,I=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,K=(e,o,n)=>o in e?Y(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,te=(e,o)=>{for(var n in o||(o={}))Z.call(o,n)&&K(e,n,o[n]);if(I)for(var n of I(o))ee.call(o,n)&&K(e,n,o[n]);return e};const R=G.default,{EVideoToolName:oe}=H,j=e=>{e.stopPropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},D=e=>{const{textareaProps:o,footer:n}=e;return t.createElement(t.Fragment,null,t.createElement(W.TextArea,te({bordered:!1,rows:6,onKeyDown:j,onKeyUp:j},o)),t.createElement("div",{className:C({textAreaLength:!0})},n))},$=e=>{var o;const n=U(null),[g,m]=u(!1),[N,v]=u(!1),{t:d}=A(),{disabled:i,config:s,result:c,updateText:T,index:E,switchToNextTextarea:h,hasMultiple:P,onNext:w}=e,{maxLength:p}=s,f=c?c[s.key]:"",b=(o=f==null?void 0:f.length)!=null?o:0,x=a=>{T&&(T(a,s.key),s.required&&v(!a))},y=P&&h,_={id:`textInput-${E}`,ref:n,disabled:i,value:f,maxLength:p,autoSize:{minRows:2,maxRows:6},onChange:a=>{const S=a.target.value;x(S)},onFocus:()=>{m(!0)},onBlur:a=>{m(!1),s.required&&v(!a.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:a=>{a.ctrlKey&&a.keyCode===R.Enter&&(w&&w(),a.preventDefault()),a.keyCode===R.Tab&&y&&(a.preventDefault(),a.nativeEvent.stopImmediatePropagation(),h(E)),a.nativeEvent.stopPropagation()}},L=t.createElement("div",{className:"textAreaFooter"},t.createElement("div",{className:"hotkeyTip"},y&&t.createElement("span",null,`[${d("Switch")}]Tab`),t.createElement("span",null,`[${d("TurnPage")}]Ctrl+Enter`)),t.createElement("div",{className:"wordCount"},t.createElement("span",{className:b>=p?"warning":""},b),"/",t.createElement("span",null,p)));return F(()=>{i&&m(!1)},[i]),t.createElement("div",{className:"textField"},t.createElement("div",{className:"label"},t.createElement("span",{className:C({required:s.required})},s.label),t.createElement("i",{className:C({clearText:!0,disabled:i}),onClick:()=>{i||x("")}})),t.createElement("div",{className:C({disabled:i,"textarea-outline":!0,"ant-input-focused":g,textareaContainer:!0,focus:g,invalid:N})},t.createElement(D,{footer:L,textareaProps:_})))},ne=({toolInstance:e,imgIndex:o,dispatch:n,triggerEventAfterIndexChanged:g,step:m,stepList:N,basicResultList:v})=>{var d,i,s;const[c,T]=u([]),[E,h]=u(0),[P,w]=u(!0),[,p]=u(0),{t:f}=A(),b=r=>{const l=(r+1)%c.length;x(l)},x=r=>{setTimeout(()=>{const l=document.getElementById(`textInput-${r}`);l&&(h(r),l.focus(),l.select(),l.scrollIntoView({behavior:"smooth",block:"center"}))})};F(()=>{e&&(T(M(e.config.configList)),e.singleOn("valueUpdated",()=>{p(r=>r+1)}))},[e]);const y=(s=(i=(d=e==null?void 0:e.textList)==null?void 0:d[0])==null?void 0:i.value)!=null?s:{},_=(r,l)=>{var k,O;(O=e==null?void 0:e.updateTextValue)==null||O.call(e,l,r,(k=e==null?void 0:e.textList)==null?void 0:k[0])};F(()=>{o>-1&&g&&x(0)},[o]);const L=()=>{n(J(!0))},a=r=>{w(r),e==null||e.toggleShowText(r)},S=Q.getStepConfig(N,m),q=S.dataSourceStep>0&&v.length===0,B=S.tool===oe.VideoTextTool;return e&&t.createElement("div",{className:"textToolOperationMenu"},c.map((r,l)=>t.createElement($,{config:r,key:r.key,index:l,result:y,updateText:_,switchToNextTextarea:b,hasMultiple:c.length>1,focus:E===l,onNext:L,disabled:q})),B&&t.createElement("div",{className:"textToolSwitchItem"},f("toggleShowText"),t.createElement(z,{style:{alignSelf:"center"},checked:P,onChange:r=>{a(r)}})))};function ae(e){return{toolInstance:e.annotation.toolInstance,imgIndex:e.annotation.imgIndex,step:e.annotation.step,basicResultList:e.annotation.basicResultList,stepList:e.annotation.stepList,triggerEventAfterIndexChanged:e.annotation.triggerEventAfterIndexChanged}}var re=V(ae,null,null,{context:X})(ne);export{$ as SingleTextInput,D as TextareaWithFooter,re as default};
@@ -1 +1 @@
1
- import{prefix as O}from"../../../constant/index.js";import{EToolName as n}from"../../../data/enums/ToolType.js";import F from"../../../utils/StepUtils.js";import{Collapse as d}from"antd/es";import e,{useState as K}from"react";import{useTranslation as R}from"react-i18next";import V from"./AnnotationText/index.js";import z from"./ClearIcon/index.js";import D,{PointCloudOperation as y}from"./GeneralOperation/index.js";import G from"./ImgAttributeInfo/index.js";import U from"./SwitchAttributeList/index.js";import u,{expandIconFuc as j}from"./TagSidebar/index.js";import C from"./TextToolSidebar/index.js";import N from"./PointCloudToolSidebar/index.js";import q from"./ToolStyle/index.js";import{cTool as H}from"@labelbee/lb-annotation";import J from"./ScribbleSidebar/index.js";import{ToolIcons as Q}from"./ToolIcons.js";import{useSelector as W}from"../../../store/ctx.js";import{Tabs as v}from"antd";import{classnames as X}from"../../../utils/index.js";import _ from"../../../assets/annotation/common/icon_menu_fold.svg.js";import Y from"../../../components/LLMToolView/sidebar/index.js";const{EVideoToolName:Z,EPointCloudName:ee}=H,{Panel:I}=d,t=`${O}-sidebar`,te=({sider:l,enableColorPicker:$,setSiderWidth:p,propsSiderWidth:ne,checkMode:L})=>{const f=W(r=>F.getCurrentStepInfo(r.annotation.step,r.annotation.stepList)),[c,A]=K(!0),o=f==null?void 0:f.tool,{t:E}=R();if(!o)return null;const P=r=>{const i=e.createElement(q,null);return e.createElement(I,{header:E("Style"),className:"panel",key:r},i)},b=e.createElement(Q,{toolName:o,onChange:()=>{}}),s=e.createElement(U,null),x=e.createElement(V,null),S=e.createElement(d,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:j},P("1")),T=e.createElement(d,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:j},e.createElement(I,{header:e.createElement("div",null,E("Adjust"),e.createElement(z,null)),className:"panel",key:"imgAttribute"},e.createElement(G,null))),a=e.createElement(D,null),w=e.createElement(u,null),k=e.createElement(C,null),g=e.createElement(J,{onChange:(r,i)=>{}}),h=e.createElement(Y,{checkMode:L}),m=e.createElement("div",{className:`${t}__horizontal`}),B=e.createElement(N,{enableColorPicker:$}),M=e.createElement(y,null);if(l)return typeof l=="function"?e.createElement("div",{className:`${t}`},l({toolIcon:b,attributeList:s,annotationText:x,toolStyle:S,imageAttributeInfo:T,operation:a,tagToolSideBar:w,textToolSideBar:k,horizontal:m,pointCloudToolSidebar:B,pointCloudOperation:M,scribbleSidebar:g,LLMSidebar:h})):l;if([n.Rect,n.Point,n.Line,n.Rect,n.Polygon,n.Cuboid].includes(o))return e.createElement("div",{className:`${t}`},b,m,s,x,m,e.createElement("div",{className:`${t}__content`},S,T),a);if(o===n.Tag)return e.createElement("div",{className:`${t}`},e.createElement(u,null));if(o===Z.VideoTagTool)return e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},e.createElement(u,null)),a);if(o===n.Text)return e.createElement("div",{className:`${t}`},e.createElement(C,null));if(o===ee.PointCloud){const r=()=>{A(!c),p&&p(c?48:void 0)},i=e.createElement("div",{style:{width:"48px",height:"100%",display:"flex",justifyContent:"center",background:"#ffffff"}},e.createElement("span",{onClick:()=>r()},e.createElement("img",{style:{width:"16px",height:"16px",marginTop:"18px",cursor:"pointer",transform:"rotate(180deg)"},src:_})));return c?e.createElement(v,{type:"card",activeKey:"1",className:X({[`${t}`]:!0,[`${t}__pointCloud`]:!0}),tabBarExtraContent:{left:e.createElement("span",{onClick:()=>r(),style:{padding:"0px 4px"}},e.createElement("img",{style:{width:"16px",height:"16px",marginLeft:"4px",cursor:"pointer"},src:_}))}},e.createElement(v.TabPane,{tab:"\u5DE5\u5177\u9762\u677F",key:"1",style:{height:"100%",display:"flex",flexDirection:"column"}},e.createElement("div",{className:`${t}__content`},e.createElement(N,null)),e.createElement(y,null))):i}return o===n.ScribbleTool?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},g,s),a):o===n.LLM?h:null};export{te as default,t as sidebarCls};
1
+ import{prefix as F}from"../../../constant/index.js";import{EToolName as o}from"../../../data/enums/ToolType.js";import K from"../../../utils/StepUtils.js";import{Collapse as d}from"antd/es";import e,{useState as R}from"react";import{useTranslation as z}from"react-i18next";import D from"./AnnotationText/index.js";import G from"./ClearIcon/index.js";import U,{PointCloudOperation as N}from"./GeneralOperation/index.js";import q from"./ImgAttributeInfo/index.js";import H from"./SwitchAttributeList/index.js";import u,{expandIconFuc as j}from"./TagSidebar/index.js";import p from"./TextToolSidebar/index.js";import _ from"./PointCloudToolSidebar/index.js";import J from"./ToolStyle/index.js";import{cTool as Q}from"@labelbee/lb-annotation";import W from"./ScribbleSidebar/index.js";import{ToolIcons as X}from"./ToolIcons.js";import{useSelector as Y}from"../../../store/ctx.js";import{Tabs as $}from"antd";import{classnames as Z}from"../../../utils/index.js";import I from"../../../assets/annotation/common/icon_menu_fold.svg.js";import ee from"../../../components/LLMToolView/sidebar/index.js";import te from"../../../components/videoAnnotate/videoClipTool/components/annotatedList/index.js";const{EVideoToolName:f,EPointCloudName:ne}=Q,{Panel:L}=d,t=`${F}-sidebar`,oe=({sider:i,enableColorPicker:A,setSiderWidth:E,propsSiderWidth:re,checkMode:P})=>{const b=Y(r=>K.getCurrentStepInfo(r.annotation.step,r.annotation.stepList)),[s,w]=R(!0),n=b==null?void 0:b.tool,{t:x}=z();if(!n)return null;const V=r=>{const c=e.createElement(J,null);return e.createElement(L,{header:x("Style"),className:"panel",key:r},c)},T=e.createElement(X,{toolName:n,onChange:()=>{}}),a=e.createElement(H,null),S=e.createElement(D,null),g=e.createElement(d,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:j},V("1")),h=e.createElement(d,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:j},e.createElement(L,{header:e.createElement("div",null,x("Adjust"),e.createElement(G,null)),className:"panel",key:"imgAttribute"},e.createElement(q,null))),l=e.createElement(U,null),k=e.createElement(u,null),B=e.createElement(p,null),v=e.createElement(W,{onChange:(r,c)=>{}}),C=e.createElement(te,null),y=e.createElement(ee,{checkMode:P}),m=e.createElement("div",{className:`${t}__horizontal`}),M=e.createElement(_,{enableColorPicker:A}),O=e.createElement(N,null);if(i)return typeof i=="function"?e.createElement("div",{className:`${t}`},i({toolIcon:T,attributeList:a,annotationText:S,toolStyle:g,imageAttributeInfo:h,operation:l,tagToolSideBar:k,textToolSideBar:B,horizontal:m,pointCloudToolSidebar:M,pointCloudOperation:O,scribbleSidebar:v,LLMSidebar:y,videoClipSidebar:C})):i;if([o.Rect,o.Point,o.Line,o.Rect,o.Polygon,o.Cuboid].includes(n))return e.createElement("div",{className:`${t}`},T,m,a,S,m,e.createElement("div",{className:`${t}__content`},g,h),l);if(n===o.Tag)return e.createElement("div",{className:`${t}`},e.createElement(u,null));if(n===f.VideoClipTool)return e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},C,a),l);if(n===f.VideoTagTool)return e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},e.createElement(u,null)),l);if(n===f.VideoTextTool)return e.createElement("div",{className:`${t}`},e.createElement(p,null));if(n===o.Text)return e.createElement("div",{className:`${t}`},e.createElement(p,null));if(n===ne.PointCloud){const r=()=>{w(!s),E&&E(s?48:void 0)},c=e.createElement("div",{style:{width:"48px",height:"100%",display:"flex",justifyContent:"center",background:"#ffffff"}},e.createElement("span",{onClick:()=>r()},e.createElement("img",{style:{width:"16px",height:"16px",marginTop:"18px",cursor:"pointer",transform:"rotate(180deg)"},src:I})));return s?e.createElement($,{type:"card",activeKey:"1",className:Z({[`${t}`]:!0,[`${t}__pointCloud`]:!0}),tabBarExtraContent:{left:e.createElement("span",{onClick:()=>r(),style:{padding:"0px 4px"}},e.createElement("img",{style:{width:"16px",height:"16px",marginLeft:"4px",cursor:"pointer"},src:I}))}},e.createElement($.TabPane,{tab:"\u5DE5\u5177\u9762\u677F",key:"1",style:{height:"100%",display:"flex",flexDirection:"column"}},e.createElement("div",{className:`${t}__content`},e.createElement(_,null)),e.createElement(N,null))):c}return n===o.ScribbleTool?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},v,a),l):n===o.LLM?y:null};export{oe as default,t as sidebarCls};
@@ -1 +1 @@
1
- import o from"lodash";import{forward as a,backward as c,rewind as i,forwardForward as l,speed as r,tag as e,toggleTagMode as d,period as s,clipSelected as u,saveResult as p,attributeLock as m,attributeClickLock as g,playPause as k,setValid as D,fullScreen as f,deleteRemark as T,preRemark as w,nextRemark as C}from"../common/index.js";import{preLine as x,nextLine as b}from"../line/index.js";import j from"../../../../../../assets/annotation/toolHotKeyIcon/icon_polygonMerge_kj.svg.js";import y from"../../../../../../assets/annotation/toolHotKeyIcon/icon_polygonCut_kj.svg.js";const A=o.cloneDeep(a),F=o.cloneDeep(c),R=o.cloneDeep(i),_=o.cloneDeep(l),h=o.cloneDeep(r),v=o.cloneDeep(e),I=o.cloneDeep(d),L=o.cloneDeep(s),M=o.cloneDeep(e),S=o.cloneDeep(u),P=o.cloneDeep(x),B=o.cloneDeep(b),t={name:"\u5408\u5E76\u533A\u95F4",icon:j,noticeInfo:"",shortCut:["Alt","Z"]},n={name:"\u5206\u5272\u533A\u95F4",icon:y,noticeInfo:"",shortCut:["Alt","X"]},H=[p,I,L,M,S,v,m,g,k,h,_,R,D,f,F,A,T,w,C,P,B,t,n];export{t as combineAudio,H as default,n as splitAudio};
1
+ import o from"lodash";import{forward as u,backward as g,rewind as k,forwardForward as f,speed as C,tag as t,toggleTagMode as D,period as T,clipSelected as w,saveResult as v,attributeLock as x,attributeClickLock as j,playPause as I,setValid as b,fullScreen as y,deleteRemark as A,preRemark as _,nextRemark as F}from"../common/index.js";import{preLine as h,nextLine as M}from"../line/index.js";import P from"../../../../../../assets/annotation/toolHotKeyIcon/icon_polygonMerge_kj.svg.js";import R from"../../../../../../assets/annotation/toolHotKeyIcon/icon_polygonCut_kj.svg.js";import S from"../../../../../../assets/annotation/toolHotKeyIcon/icon_frame_kj.svg.js";const a=o.cloneDeep(u),i=o.cloneDeep(g),c=o.cloneDeep(k),r=o.cloneDeep(f),L=o.cloneDeep(C),l=o.cloneDeep(t),B=o.cloneDeep(D),e=o.cloneDeep(T),n=o.cloneDeep(t),H=o.cloneDeep(w),s=o.cloneDeep(h),d=o.cloneDeep(M),p={name:"CombineAudio",icon:P,noticeInfo:"",shortCut:["Alt","Z"]},m={name:"ClipAudio",icon:R,noticeInfo:"",shortCut:["Alt","X"]};a.name="NextFile",i.name="PreviousFile",c.name="Forward0.1",r.name="Back0.1",e.name="SwitchClipMode",n.name="Clip",l.name="TaggingOrAttr",s.name="PreviousInterval",d.name="NextInterval",n.icon=S,e.noticeInfo="";const K=[v,B,e,n,H,l,x,j,I,L,r,c,b,y,i,a,A,_,F,s,d,p,m];export{p as combineAudio,K as default,m as splitAudio};
@@ -1 +1 @@
1
- import e from"../../../../../../assets/annotation/toolHotKeyIcon/icon_cencel_kj.svg.js";import i from"../../../../../../assets/annotation/toolHotKeyIcon/icon_reform_kj.svg.js";import a from"../../../../../../assets/annotation/toolHotKeyIcon/icon_loupe_kj.svg.js";import c from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_middle_kj.svg.js";import r from"../../../../../../assets/annotation/toolHotKeyIcon/icon_fullView_kj.svg.js";import m from"../../../../../../assets/annotation/toolHotKeyIcon/icon_reload_kj.svg.js";import u from"../../../../../../assets/annotation/toolHotKeyIcon/setValid.svg.js";import g from"../../../../../../assets/annotation/toolHotKeyIcon/icon_last_kj.svg.js";import l from"../../../../../../assets/annotation/toolHotKeyIcon/icon_next_kj.svg.js";import t from"../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js";import n from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js";import o from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import f from"../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js";import j from"../../../../../../assets/annotation/toolHotKeyIcon/icon_alttab_kj.svg.js";import p from"../../../../../../assets/annotation/toolHotKeyIcon/icon_save_kj.svg.js";import _ from"../../../../../../assets/annotation/toolHotKeyIcon/icon_lineSpecial_kj.svg.js";import h from"../../../../../../assets/annotation/toolHotKeyIcon/icon_noDisplay.svg.js";import s from"../../../../../../assets/annotation/toolHotKeyIcon/icon_eyeLock_kj.svg.js";import C from"../../../../../../assets/annotation/toolHotKeyIcon/icon_playPause.svg.js";import v from"../../../../../../assets/annotation/toolHotKeyIcon/icon_forward_kj.svg.js";import d from"../../../../../../assets/annotation/toolHotKeyIcon/icon_back_kj.svg.js";import k from"../../../../../../assets/annotation/toolHotKeyIcon/icon_speed_kj.svg.js";import I from"../../../../../../assets/annotation/audio/tag.svg.js";import y from"../../../../../../assets/annotation/toolHotKeyIcon/icon_tag_kj.svg.js";import H from"../../../../../../assets/annotation/video/icon_clip.svg.js";import $ from"../../../../../../assets/annotation/toolHotKeyIcon/icon_frameActive_kj.svg.js";import K from"../../../../../../assets/annotation/toolHotKeyIcon/deleteRemark.svg.js";import S from"../../../../../../assets/annotation/toolHotKeyIcon/preRemark.svg.js";import b from"../../../../../../assets/annotation/toolHotKeyIcon/nextRemark.svg.js";const E={name:"Undo",icon:e,shortCut:["Ctrl","Z"]},R={name:"Redo",icon:i,shortCut:["Ctrl","Shift","Z"]},F={name:"Scale",icon:a,shortCut:[c]},T={name:"Fullscreen",icon:r,shortCut:["F11"]},D={name:"Rotate",icon:m,shortCut:["R"],noticeInfo:"ToOriginalStep"},w={name:"ToggleEffectiveness",icon:u,shortCut:["Y"]},A={name:"PreviousImage",icon:g,shortCut:["A"]},B={name:"NextImage",icon:l,shortCut:["D"]},L={name:"Drag",icon:t,shortCut:[n],noticeInfo:"Press"},P={name:"Drag",icon:t,shortCut:["Space",o]},x={name:"SpecifiedAttributesOnly",icon:s,shortCut:["Shift","Number"]},U={name:"SpecifiedAttributesOnly",icon:s,shortCut:["Shift",o]},O={name:"ToggleSelected",icon:f,shortCut:["Tab"]},V={name:"ToggleSelectedReverse",icon:j,shortCut:["Shift","Tab"]},Z={name:"HideGraphics",icon:h,noticeInfo:"",shortCut:["Z"]},N={name:"ToggleLineParticularity",icon:_,noticeInfo:"ToSide",shortCut:["Shift",o]},W={name:"Save",icon:p,shortCut:["Ctrl","S"]},q={name:"Speed",icon:k,shortCut:["↑","↓"],shortCutUseHtml:!0},G={name:"PlayPause",icon:C,shortCut:["Space"]},M={name:"FastForward",icon:v,shortCut:["→"],shortCutUseHtml:!0},X={name:"Rewind",icon:d,shortCut:["←"],shortCutUseHtml:!0},Y={name:"\u5207\u6362\u6807\u7B7E\u6A21\u5F0F",icon:I,shortCut:["L"]},z={name:"\u6253\u6807\u7B7E",icon:y,shortCut:[o],noticeInfo:"\u5DE6\u51FB"},J={name:"\u622A\u53D6\u7247\u6BB5",icon:H,noticeInfo:"\u4E24\u6B21",shortCut:["X"]},Q={name:"\u622A\u53D6\u9009\u4E2D",icon:$,shortCut:[n],noticeInfo:"\u53F3\u51FB"},oo={name:"\u5220\u9664\u6279\u6CE8",icon:K,shortCut:["Delete"],noticeInfo:"\u9009\u4E2D\u65F6"},to={name:"\u4E0B\u4E00\u6761\u6279\u6CE8",icon:b,shortCut:["Tab"]},no={name:"\u4E0A\u4E00\u6761\u6279\u6CE8",icon:S,shortCut:["Shift","Tab"]};export{U as attributeClickLock,x as attributeLock,A as backward,N as changeSpecialLine,Q as clipSelected,P as dargWithLeftClick,L as dargWithRightClick,oo as deleteRemark,B as forward,M as forwardForward,T as fullScreen,Z as hidden,to as nextRemark,J as period,G as playPause,no as preRemark,R as restore,E as revoke,X as rewind,D as rotate,W as saveResult,F as scale,w as setValid,q as speed,O as tabChangeSelected,V as tabReverseChangeSelected,z as tag,Y as toggleTagMode};
1
+ import s from"../../../../../../assets/annotation/toolHotKeyIcon/icon_cencel_kj.svg.js";import i from"../../../../../../assets/annotation/toolHotKeyIcon/icon_reform_kj.svg.js";import a from"../../../../../../assets/annotation/toolHotKeyIcon/icon_loupe_kj.svg.js";import c from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_middle_kj.svg.js";import r from"../../../../../../assets/annotation/toolHotKeyIcon/icon_fullView_kj.svg.js";import m from"../../../../../../assets/annotation/toolHotKeyIcon/icon_reload_kj.svg.js";import g from"../../../../../../assets/annotation/toolHotKeyIcon/setValid.svg.js";import l from"../../../../../../assets/annotation/toolHotKeyIcon/icon_last_kj.svg.js";import u from"../../../../../../assets/annotation/toolHotKeyIcon/icon_next_kj.svg.js";import t from"../../../../../../assets/annotation/toolHotKeyIcon/icon_move_kj.svg.js";import n from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_right_kj.svg.js";import o from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import f from"../../../../../../assets/annotation/toolHotKeyIcon/icon_tab_kj.svg.js";import p from"../../../../../../assets/annotation/toolHotKeyIcon/icon_alttab_kj.svg.js";import j from"../../../../../../assets/annotation/toolHotKeyIcon/icon_save_kj.svg.js";import h from"../../../../../../assets/annotation/toolHotKeyIcon/icon_lineSpecial_kj.svg.js";import _ from"../../../../../../assets/annotation/toolHotKeyIcon/icon_noDisplay.svg.js";import e from"../../../../../../assets/annotation/toolHotKeyIcon/icon_eyeLock_kj.svg.js";import C from"../../../../../../assets/annotation/toolHotKeyIcon/icon_playPause.svg.js";import v from"../../../../../../assets/annotation/toolHotKeyIcon/icon_forward_kj.svg.js";import d from"../../../../../../assets/annotation/toolHotKeyIcon/icon_back_kj.svg.js";import k from"../../../../../../assets/annotation/toolHotKeyIcon/icon_speed_kj.svg.js";import I from"../../../../../../assets/annotation/audio/tag.svg.js";import y from"../../../../../../assets/annotation/toolHotKeyIcon/icon_tag_kj.svg.js";import H from"../../../../../../assets/annotation/video/icon_clip.svg.js";import S from"../../../../../../assets/annotation/toolHotKeyIcon/icon_frameActive_kj.svg.js";import $ from"../../../../../../assets/annotation/toolHotKeyIcon/deleteRemark.svg.js";import K from"../../../../../../assets/annotation/toolHotKeyIcon/preRemark.svg.js";import b from"../../../../../../assets/annotation/toolHotKeyIcon/nextRemark.svg.js";const R={name:"Undo",icon:s,shortCut:["Ctrl","Z"]},T={name:"Redo",icon:i,shortCut:["Ctrl","Shift","Z"]},w={name:"Scale",icon:a,shortCut:[c]},L={name:"Fullscreen",icon:r,shortCut:["F11"]},P={name:"Rotate",icon:m,shortCut:["R"],noticeInfo:"ToOriginalStep"},D={name:"ToggleEffectiveness",icon:g,shortCut:["Y"]},x={name:"PreviousImage",icon:l,shortCut:["A"]},A={name:"NextImage",icon:u,shortCut:["D"]},F={name:"Drag",icon:t,shortCut:[n],noticeInfo:"Press"},B={name:"Drag",icon:t,shortCut:["Space",o]},U={name:"SpecifiedAttributesOnly",icon:e,shortCut:["Shift","Number"]},E={name:"SpecifiedAttributesOnly",icon:e,shortCut:["Shift",o]},N={name:"ToggleSelected",icon:f,shortCut:["Tab"]},O={name:"ToggleSelectedReverse",icon:p,shortCut:["Shift","Tab"]},V={name:"HideGraphics",icon:_,noticeInfo:"",shortCut:["Z"]},Z={name:"ToggleLineParticularity",icon:h,noticeInfo:"ToSide",shortCut:["Shift",o]},M={name:"Save",icon:j,shortCut:["Ctrl","S"]},W={name:"Speed",icon:k,shortCut:["↑","↓"],shortCutUseHtml:!0},q={name:"PlayPause",icon:C,shortCut:["Space"]},G={name:"FastForward",icon:v,shortCut:["→"],shortCutUseHtml:!0},X={name:"Rewind",icon:d,shortCut:["←"],shortCutUseHtml:!0},Y={name:"SwitchTagMode",icon:I,shortCut:["L"]},z={name:"\u6253\u6807\u7B7E",icon:y,shortCut:[o],noticeInfo:"LeftClick"},J={name:"\u622A\u53D6\u7247\u6BB5",icon:H,noticeInfo:"\u4E24\u6B21",shortCut:["X"]},Q={name:"ClipSelect",icon:S,shortCut:[n],noticeInfo:"RightClick"},oo={name:"DeleteComment",icon:$,shortCut:["Delete"],noticeInfo:"SelectedStatus"},to={name:"NextComment",icon:b,shortCut:["Tab"]},no={name:"PreviousComment",icon:K,shortCut:["Shift","Tab"]};export{E as attributeClickLock,U as attributeLock,x as backward,Z as changeSpecialLine,Q as clipSelected,B as dargWithLeftClick,F as dargWithRightClick,oo as deleteRemark,A as forward,G as forwardForward,L as fullScreen,V as hidden,to as nextRemark,J as period,q as playPause,no as preRemark,T as restore,R as revoke,X as rewind,P as rotate,M as saveResult,w as scale,D as setValid,W as speed,N as tabChangeSelected,O as tabReverseChangeSelected,z as tag,Y as toggleTagMode};
@@ -1 +1 @@
1
- import{scale as e,saveResult as r,restore as t,revoke as a,rotate as o,backward as s,forward as i,dargWithRightClick as l,setValid as c}from"../common/index.js";const d=[e,r,t,a,o,s,i,l,c];export{d as default};
1
+ import i from"../../../../../../assets/annotation/toolHotKeyIcon/icon_mouse_left_kj.svg.js";import r from"../../../../../../assets/annotation/toolHotKeyIcon/icon_line_static.svg.js";import a from"../../../../../../assets/annotation/toolHotKeyIcon/icon_eraser.svg.js";import c from"../../../../../../assets/annotation/toolHotKeyIcon/icon_scribble.svg.js";import m from"../../../../../../assets/annotation/toolHotKeyIcon/icon_strokeEnlarge.svg.js";import l from"../../../../../../assets/annotation/toolHotKeyIcon/icon_strokeReduction.svg.js";import{scale as g,saveResult as b,restore as u,revoke as d,rotate as f,backward as k,forward as h,dargWithRightClick as _,setValid as j,hidden as p}from"../common/index.js";const o={name:"Scribble",icon:c,shortCut:["Q"]},t={name:"Erase",icon:a,shortCut:["W"]},s={name:"ScribbleLine",icon:r,shortCut:["Ctrl",i]},e={name:"StrokeEnlarge",icon:m,shortCut:["F"]},n={name:"StrokeReduction",icon:l,shortCut:["G"]},v=[o,t,s,e,n,g,b,u,d,f,k,h,_,j,p];export{v as default,t as eraseImg,o as scribbleImg,s as scribbleLine,e as strokeEnlarge,n as strokeReduction};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.19.1-alpha.1",
3
+ "version": "1.20.0-alpha.10",
4
4
  "description": "Provide a complete library of annotation components",
5
5
  "main": "./dist/index.js",
6
6
  "es": "./es/index.js",
@@ -43,27 +43,29 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@ant-design/icons": "^4.6.2",
46
- "@labelbee/lb-annotation": "1.23.1-alpha.1",
47
- "@labelbee/lb-utils": "1.15.1-alpha.1",
46
+ "@labelbee/lb-annotation": "1.24.0-alpha.7",
47
+ "@labelbee/lb-utils": "1.16.0-alpha.4",
48
48
  "@labelbee/wavesurfer": "1.0.0",
49
49
  "@types/react-dom": "^18.2.7",
50
+ "@types/react-transition-group": "^4.4.9",
50
51
  "ahooks": "^3.4.0",
51
52
  "classnames": "^2.3.0",
52
53
  "decimal.js": "^10.4.3",
53
54
  "github-markdown-css": "^5.2.0",
54
55
  "lodash": "^4.17.21",
55
56
  "postcss-url": "^10.1.3",
57
+ "re-resizable": "^6.9.9",
56
58
  "react-colorful": "^5.6.1",
57
59
  "react-i18next": "^11.12.0",
58
60
  "react-markdown": "^8.0.7",
59
61
  "react-redux": "^7.2.3",
60
62
  "react-syntax-highlighter": "^15.5.0",
63
+ "react-transition-group": "^4.4.5",
61
64
  "redux": "^4.0.5",
62
65
  "redux-actions": "^2.6.5",
63
66
  "redux-thunk": "^2.3.0",
64
67
  "rehype-katex": "^6.0.3",
65
68
  "diff-match-patch": "^1.0.5",
66
- "re-resizable": "^6.9.9",
67
69
  "remark-math": "^5.1.1",
68
70
  "remark-gfm": "^3.0.1",
69
71
  "resize-observer-polyfill": "^1.5.1"
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),StepUtils=require("../../utils/StepUtils.js"),index=require("../../utils/index.js"),index$1=require("./index.js"),VideoTagLayer=require("./VideoTagLayer.js"),_=require("lodash"),utils=require("./utils.js");function _interopDefaultLegacy(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_);class TagToolInstanceAdaptor extends React__default.default.Component{constructor(i){super(i);this.fns={},this.labelSelectedList=[],this.clearResult=(t=!0,e)=>{const s=e?this.state.tagResult.map(l=>((l==null?void 0:l.result[e])&&delete l.result[e],l)):[];this.setState({tagResult:s},()=>this.emitEvent("render"))},this.exportData=()=>{var t,e,s,l,o,n,r;const a=(e=(t=this.videoRef)==null?void 0:t.duration)!=null?e:0,d=(s=this.videoRef)==null?void 0:s.getVideoPlaybackQuality(),u=d==null?void 0:d.totalVideoFrames,c=(o=(l=this.videoRef)==null?void 0:l.videoWidth)!=null?o:0,v=(r=(n=this.videoRef)==null?void 0:n.videoHeight)!=null?r:0;return[this.state.tagResult,{valid:this.state.valid,duration:a,frames:u,videoWidth:c,videoHeight:v}]},this.emitEvent=t=>{this.fns[t]&&this.fns[t]()},this.combineResult=(t,e={})=>{var s,l;const{isMulti:o}=t,{key:n,value:r}=t.value;if(o){let a=(l=(s=e[n])==null?void 0:s.split(";"))!=null?l:[];a.includes(r)?a=a.filter(u=>u!==r):a.push(r);const d=new Set(a);return e[n]=Array.from(d).join(";"),___default.default.pickBy(e,u=>u)}return e[n]=e[n]===r?void 0:r,___default.default.pickBy(e,a=>a)},this.setResult=t=>{this.setState({tagResult:t}),this.fns.render&&this.fns.render()},this.setLabel=(t,e)=>{this.setLabelBySelectedList(t,e)},this.keydown=t=>{const e=utils.getKeyCodeNumber(t.keyCode);if(e){const s=e-1;if(this.config.inputList.length===1){this.labelSelectedList=[0,s],this.setLabel(0,s),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500);return}this.labelSelectedList.length===1?(this.labelSelectedList=[this.labelSelectedList[0],s],this.setLabel(this.labelSelectedList[0],s),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500)):(this.labelSelectedList=[s],this.emitEvent("expend"))}},this.setValid=t=>{this.setState({valid:t}),t===!1&&this.setState({tagResult:[]}),this.emitEvent("render")},this.setResultFromImgList=t=>{var e;const{imgList:s,imgIndex:l,step:o}=t;if(!s[l])return;const n=index.jsonParser(s[l].result),r=n[`step_${o}`];this.setState({tagResult:(e=r==null?void 0:r.result)!=null?e:[],valid:(n==null?void 0:n.valid)===void 0?!0:n.valid})},this.state={tagResult:[],labelSelectedList:[],valid:!0}}get config(){const i=StepUtils.getCurrentStepInfo(this.props.step,this.props.stepList);return index.jsonParser(i==null?void 0:i.config)}get history(){return{initRecord:()=>{},pushHistory:()=>{}}}get currentTagResult(){var i;return(i=this.state.tagResult[0])!=null?i:{}}get valid(){return this.state.valid}singleOn(i,t){this.fns[i]=t}on(i,t){this.singleOn(i,t)}getTagResultByCode(i,t){var e,s,l;try{const o=(s=(e=this.config)==null?void 0:e.inputList)!=null?s:[],n=o.length>1,r=t!==void 0?i:0,a=t!==void 0?t:i,d=n?o[r]:o[0],u=((l=d.subSelected)!=null?l:[])[a];if(d&&u)return{value:{key:d.value,value:u.value},isMulti:d.isMulti}}catch(o){return}}setLabelBySelectedList(i,t){var e,s,l,o;const n=this.getTagResultByCode(i,t);if(n){const r=this.combineResult(n,(s=(e=this.state.tagResult[0])==null?void 0:e.result)!=null?s:{}),a=[{sourceID:lbAnnotation.CommonToolUtils.getSourceID(),id:(o=(l=this.currentTagResult)==null?void 0:l.id)!=null?o:lbAnnotation.uuid(8,62),result:r}];this.setState({tagResult:a},()=>this.emitEvent("render"))}}componentDidMount(){document.addEventListener("keydown",this.keydown),this.props.onMounted(this),this.setResultFromImgList(this.props)}componentWillUnmount(){document.addEventListener("keydown",this.keydown),this.props.onUnmounted()}shouldComponentUpdate(i){return i.imgIndex!==this.props.imgIndex&&this.setResultFromImgList(i),!0}render(){var i;const{imgIndex:t,imgList:e,pageForward:s,pageJump:l,pageBackward:o}=this.props,{tagResult:n,valid:r}=this.state;return React__default.default.createElement("div",{style:{height:"100%",width:"100%",position:"relative"}},React__default.default.createElement(index$1.VideoPlayer,{imgIndex:t,imgList:e,pageBackward:o,pageForward:s,pageJump:l,valid:r,setVideoRef:a=>{this.videoRef=a}}),React__default.default.createElement(VideoTagLayer.VideoTagLayer,{result:n,inputList:(i=this.config)==null?void 0:i.inputList}))}}exports.TagToolInstanceAdaptor=TagToolInstanceAdaptor;
@@ -1 +0,0 @@
1
- import h from"react";import{CommonToolUtils as p,uuid as f}from"@labelbee/lb-annotation";import y from"../../utils/StepUtils.js";import{jsonParser as c}from"../../utils/index.js";import{VideoPlayer as L}from"./index.js";import{VideoTagLayer as R}from"./VideoTagLayer.js";import g from"lodash";import{getKeyCodeNumber as b}from"./utils.js";class S extends h.Component{constructor(i){super(i);this.fns={},this.labelSelectedList=[],this.clearResult=(t=!0,e)=>{const s=e?this.state.tagResult.map(l=>((l==null?void 0:l.result[e])&&delete l.result[e],l)):[];this.setState({tagResult:s},()=>this.emitEvent("render"))},this.exportData=()=>{var t,e,s,l,r,n,o;const a=(e=(t=this.videoRef)==null?void 0:t.duration)!=null?e:0,d=(s=this.videoRef)==null?void 0:s.getVideoPlaybackQuality(),u=d==null?void 0:d.totalVideoFrames,m=(r=(l=this.videoRef)==null?void 0:l.videoWidth)!=null?r:0,v=(o=(n=this.videoRef)==null?void 0:n.videoHeight)!=null?o:0;return[this.state.tagResult,{valid:this.state.valid,duration:a,frames:u,videoWidth:m,videoHeight:v}]},this.emitEvent=t=>{this.fns[t]&&this.fns[t]()},this.combineResult=(t,e={})=>{var s,l;const{isMulti:r}=t,{key:n,value:o}=t.value;if(r){let a=(l=(s=e[n])==null?void 0:s.split(";"))!=null?l:[];a.includes(o)?a=a.filter(u=>u!==o):a.push(o);const d=new Set(a);return e[n]=Array.from(d).join(";"),g.pickBy(e,u=>u)}return e[n]=e[n]===o?void 0:o,g.pickBy(e,a=>a)},this.setResult=t=>{this.setState({tagResult:t}),this.fns.render&&this.fns.render()},this.setLabel=(t,e)=>{this.setLabelBySelectedList(t,e)},this.keydown=t=>{const e=b(t.keyCode);if(e){const s=e-1;if(this.config.inputList.length===1){this.labelSelectedList=[0,s],this.setLabel(0,s),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500);return}this.labelSelectedList.length===1?(this.labelSelectedList=[this.labelSelectedList[0],s],this.setLabel(this.labelSelectedList[0],s),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500)):(this.labelSelectedList=[s],this.emitEvent("expend"))}},this.setValid=t=>{this.setState({valid:t}),t===!1&&this.setState({tagResult:[]}),this.emitEvent("render")},this.setResultFromImgList=t=>{var e;const{imgList:s,imgIndex:l,step:r}=t;if(!s[l])return;const n=c(s[l].result),o=n[`step_${r}`];this.setState({tagResult:(e=o==null?void 0:o.result)!=null?e:[],valid:(n==null?void 0:n.valid)===void 0?!0:n.valid})},this.state={tagResult:[],labelSelectedList:[],valid:!0}}get config(){const i=y.getCurrentStepInfo(this.props.step,this.props.stepList);return c(i==null?void 0:i.config)}get history(){return{initRecord:()=>{},pushHistory:()=>{}}}get currentTagResult(){var i;return(i=this.state.tagResult[0])!=null?i:{}}get valid(){return this.state.valid}singleOn(i,t){this.fns[i]=t}on(i,t){this.singleOn(i,t)}getTagResultByCode(i,t){var e,s,l;try{const r=(s=(e=this.config)==null?void 0:e.inputList)!=null?s:[],n=r.length>1,o=t!==void 0?i:0,a=t!==void 0?t:i,d=n?r[o]:r[0],u=((l=d.subSelected)!=null?l:[])[a];if(d&&u)return{value:{key:d.value,value:u.value},isMulti:d.isMulti}}catch(r){return}}setLabelBySelectedList(i,t){var e,s,l,r;const n=this.getTagResultByCode(i,t);if(n){const o=this.combineResult(n,(s=(e=this.state.tagResult[0])==null?void 0:e.result)!=null?s:{}),a=[{sourceID:p.getSourceID(),id:(r=(l=this.currentTagResult)==null?void 0:l.id)!=null?r:f(8,62),result:o}];this.setState({tagResult:a},()=>this.emitEvent("render"))}}componentDidMount(){document.addEventListener("keydown",this.keydown),this.props.onMounted(this),this.setResultFromImgList(this.props)}componentWillUnmount(){document.addEventListener("keydown",this.keydown),this.props.onUnmounted()}shouldComponentUpdate(i){return i.imgIndex!==this.props.imgIndex&&this.setResultFromImgList(i),!0}render(){var i;const{imgIndex:t,imgList:e,pageForward:s,pageJump:l,pageBackward:r}=this.props,{tagResult:n,valid:o}=this.state;return h.createElement("div",{style:{height:"100%",width:"100%",position:"relative"}},h.createElement(L,{imgIndex:t,imgList:e,pageBackward:r,pageForward:s,pageJump:l,valid:o,setVideoRef:a=>{this.videoRef=a}}),h.createElement(R,{result:n,inputList:(i=this.config)==null?void 0:i.inputList}))}}export{S as TagToolInstanceAdaptor};