@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.
- package/dist/assets/annotation/toolHotKeyIcon/icon_eraser.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_line_static.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_scribble.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_strokeEnlarge.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_strokeReduction.svg.js +1 -0
- package/dist/assets/annotation/video/icon_timePoint.svg.js +1 -0
- package/dist/assets/annotation/video/icon_videoCut.svg.js +1 -0
- package/dist/assets/annotation/video/icon_videoCutting.svg.js +1 -0
- package/dist/assets/attributeIcon/eraser.svg.js +1 -1
- package/dist/assets/attributeIcon/eraser_a.svg.js +1 -1
- package/dist/assets/attributeIcon/icon_eyeLock_a.svg.js +1 -0
- package/dist/assets/attributeIcon/icon_eyeLock_h.svg.js +1 -0
- package/dist/assets/attributeIcon/pen.svg.js +1 -1
- package/dist/assets/attributeIcon/pen_a.svg.js +1 -1
- package/dist/assets/icons/32b52174.svg +5 -0
- package/dist/assets/icons/ad8081bf.svg +13 -0
- package/dist/components/LLMToolView/sidebar/components/answerList/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -1
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -0
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -1
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.module.scss.js +1 -0
- package/dist/components/LLMToolView/sidebar/index.js +1 -1
- package/dist/components/attributeList/index.js +1 -1
- package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
- package/dist/components/audioAnnotate/audioSide/labelFilterInput/index.js +1 -1
- package/dist/components/audioAnnotate/audioSide/labelSidebar/index.js +1 -1
- package/dist/components/audioAnnotate/index.js +1 -1
- package/dist/components/audioAnnotate/textInput/index.js +1 -1
- package/dist/components/audioPlayer/combineTip/index.js +1 -1
- package/dist/components/audioPlayer/index.js +1 -1
- package/dist/components/audioPlayer/labelDisplayToggle/index.js +1 -1
- package/dist/components/audioPlayer/segmentTip/index.js +1 -1
- package/dist/components/audioPlayer/zoomSlider/index.js +1 -1
- package/dist/components/latexEditor/constant/config.js +1 -0
- package/dist/components/latexEditor/index.js +1 -0
- package/dist/components/latexEditor/index.module.scss.js +1 -0
- package/dist/components/pointCloudView/PointCloudInfos.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/videoAnnotate/index.js +1 -1
- package/dist/components/videoAnnotate/videoClipTool/VideoClipToolContext.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/ToolTipForClip.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/annotatedList/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/annotatedList/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/videoTrack/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/components/videoTrack/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/constant.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/index.module.scss.js +1 -0
- package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -0
- package/dist/components/videoAnnotate/videoTextTool/index.js +1 -0
- package/dist/components/videoPlayer/VideoTagLayer.js +1 -1
- package/dist/components/videoPlayer/VideoTextLayer.js +2 -0
- package/dist/components/videoPlayer/components/SpeedController/index.js +1 -1
- package/dist/components/videoPlayer/components/controller/index.js +1 -1
- package/dist/components/videoPlayer/index.js +1 -1
- package/dist/components/videoPlayer/utils.js +1 -1
- package/dist/index.css +385 -3
- package/dist/index.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/types/App.d.ts +2 -2
- package/dist/types/components/LLMToolView/sidebar/components/textEditor/index.d.ts +1 -0
- package/dist/types/components/LLMToolView/types.d.ts +1 -0
- package/dist/types/components/audioAnnotate/audioSide/labelSidebar/index.d.ts +4 -21
- package/dist/types/components/audioAnnotate/index.d.ts +1 -1
- package/dist/types/components/latexEditor/constant/config.d.ts +18 -0
- package/dist/types/components/latexEditor/index.d.ts +12 -0
- package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloud3DView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudBackView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudListener.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudSegment.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudSegment2DView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudSegmentListener.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudSideView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudTopView.d.ts +3 -3
- package/dist/types/components/pointCloudView/index.d.ts +3 -3
- package/dist/types/components/videoAnnotate/index.d.ts +18 -7
- package/dist/types/components/videoAnnotate/videoClipTool/VideoClipToolContext.d.ts +27 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/ToolTipForClip.d.ts +8 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/annotatedList/index.d.ts +7 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.d.ts +14 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.d.ts +18 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.d.ts +6 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.d.ts +3 -0
- package/dist/types/components/videoAnnotate/videoClipTool/components/videoTrack/index.d.ts +11 -0
- package/dist/types/components/videoAnnotate/videoClipTool/constant.d.ts +26 -0
- package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +131 -0
- package/dist/types/components/{videoPlayer → videoAnnotate/videoTagTool}/TagToolInstanceAdaptor.d.ts +6 -10
- package/dist/types/components/videoAnnotate/videoTextTool/index.d.ts +56 -0
- package/dist/types/components/videoPlayer/VideoTagLayer.d.ts +1 -0
- package/dist/types/components/videoPlayer/VideoTextLayer.d.ts +2 -0
- package/dist/types/components/videoPlayer/components/controller/index.d.ts +4 -2
- package/dist/types/components/videoPlayer/index.d.ts +11 -0
- package/dist/types/components/videoPlayer/utils.d.ts +6 -0
- package/dist/types/hooks/annotation.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +2 -1
- package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/scribble/index.d.ts +25 -0
- package/dist/utils/audio.js +1 -1
- package/dist/views/MainView/LLMLayout/index.js +1 -1
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/ScribbleSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/scribble/index.js +1 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_eraser.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_line_static.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_scribble.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_strokeEnlarge.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_strokeReduction.svg.js +1 -0
- package/es/assets/annotation/video/icon_timePoint.svg.js +1 -0
- package/es/assets/annotation/video/icon_videoCut.svg.js +1 -0
- package/es/assets/annotation/video/icon_videoCutting.svg.js +1 -0
- package/es/assets/attributeIcon/eraser.svg.js +1 -1
- package/es/assets/attributeIcon/eraser_a.svg.js +1 -1
- package/es/assets/attributeIcon/icon_eyeLock_a.svg.js +1 -0
- package/es/assets/attributeIcon/icon_eyeLock_h.svg.js +1 -0
- package/es/assets/attributeIcon/pen.svg.js +1 -1
- package/es/assets/attributeIcon/pen_a.svg.js +1 -1
- package/es/components/LLMToolView/sidebar/components/answerList/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -1
- package/es/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -0
- package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -1
- package/es/components/LLMToolView/sidebar/components/textInputBox/index.module.scss.js +1 -0
- package/es/components/LLMToolView/sidebar/index.js +1 -1
- package/es/components/attributeList/index.js +1 -1
- package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
- package/es/components/audioAnnotate/audioSide/labelFilterInput/index.js +1 -1
- package/es/components/audioAnnotate/audioSide/labelSidebar/index.js +1 -1
- package/es/components/audioAnnotate/index.js +1 -1
- package/es/components/audioAnnotate/textInput/index.js +1 -1
- package/es/components/audioPlayer/combineTip/index.js +1 -1
- package/es/components/audioPlayer/index.js +1 -1
- package/es/components/audioPlayer/labelDisplayToggle/index.js +1 -1
- package/es/components/audioPlayer/segmentTip/index.js +1 -1
- package/es/components/audioPlayer/zoomSlider/index.js +1 -1
- package/es/components/latexEditor/constant/config.js +1 -0
- package/es/components/latexEditor/index.js +1 -0
- package/es/components/latexEditor/index.module.scss.js +1 -0
- package/es/components/pointCloudView/PointCloudInfos.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/videoAnnotate/index.js +1 -1
- package/es/components/videoAnnotate/videoClipTool/VideoClipToolContext.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/ToolTipForClip.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/annotatedList/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/annotatedList/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/resizableSnippet/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/timeSliceRange/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/videoClipToolHotkey/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/videoTimeSlicesOverVideo/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/videoTrack/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/components/videoTrack/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/constant.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/index.module.scss.js +1 -0
- package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -0
- package/es/components/videoAnnotate/videoTextTool/index.js +1 -0
- package/es/components/videoPlayer/VideoTagLayer.js +1 -1
- package/es/components/videoPlayer/VideoTextLayer.js +2 -0
- package/es/components/videoPlayer/components/SpeedController/index.js +1 -1
- package/es/components/videoPlayer/components/controller/index.js +1 -1
- package/es/components/videoPlayer/index.js +1 -1
- package/es/components/videoPlayer/utils.js +1 -1
- package/es/index.css +385 -3
- package/es/index.js +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/utils/audio.js +1 -1
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/ScribbleSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/audioText/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/scribble/index.js +1 -1
- package/package.json +6 -4
- package/dist/components/videoPlayer/TagToolInstanceAdaptor.js +0 -1
- package/es/components/videoPlayer/TagToolInstanceAdaptor.js +0 -1
- /package/dist/components/{videoPlayer → videoAnnotate/videoTagTool}/TagToolInstanceAdaptorI18nProvider.js +0 -0
- /package/dist/types/components/{videoPlayer → videoAnnotate/videoTagTool}/TagToolInstanceAdaptorI18nProvider.d.ts +0 -0
- /package/es/components/{videoPlayer → videoAnnotate/videoTagTool}/TagToolInstanceAdaptorI18nProvider.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ViewportProvider as
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
47
|
-
"@labelbee/lb-utils": "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};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|