@labelbee/lb-components 1.23.0-alpha.4 → 1.23.0-alpha.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.js +1 -1
- package/dist/assets/annotation/icon_link.svg.js +1 -0
- package/dist/assets/annotation/icon_unlink.svg.js +1 -0
- package/dist/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
- package/dist/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
- package/dist/components/LLMToolView/index.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
- package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/dist/components/LLMToolView/sidebar/index.js +1 -1
- package/dist/components/LLMToolView/utils/data.js +1 -1
- package/dist/components/NLPToolView/index.js +1 -1
- package/dist/components/NLPToolView/textContent/index.js +1 -1
- package/dist/components/audioAnnotate/audioContext/index.js +1 -1
- package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
- package/dist/components/audioAnnotate/index.js +1 -1
- package/dist/components/audioAnnotate/textInput/index.js +1 -1
- package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -1
- package/dist/components/audioAnnotate/utils/dataTransform.js +1 -0
- package/dist/components/audioPlayer/clipRegion/index.js +1 -1
- package/dist/components/audioPlayer/index.js +1 -1
- package/dist/components/audioPlayer/useAudioCombine/index.js +3 -2
- package/dist/components/audioPlayer/useAudioSegment/index.js +1 -1
- package/dist/components/longText/index.js +1 -1
- package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
- package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
- package/dist/components/pointCloudView/PointCloudContext.js +1 -1
- package/dist/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
- package/dist/components/pointCloudView/index.js +1 -1
- package/dist/components/subAttributeList/index.js +1 -0
- package/dist/components/videoAnnotate/videoClipTool/index.js +1 -1
- package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
- package/dist/index.css +31 -9
- package/dist/index.js +1 -1
- package/dist/store/Actions.js +1 -1
- package/dist/store/annotation/actionCreators.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/types/App.d.ts +3 -1
- package/dist/types/components/LLMToolView/utils/data.d.ts +1 -1
- package/dist/types/components/audioAnnotate/audioContext/index.d.ts +10 -2
- package/dist/types/components/audioAnnotate/textInput/index.d.ts +1 -0
- package/dist/types/components/audioAnnotate/utils/dataTransform.d.ts +9 -0
- package/dist/types/components/audioPlayer/index.d.ts +28 -21
- package/dist/types/components/longText/index.d.ts +1 -0
- package/dist/types/components/pointCloud2DRectOperationView/index.d.ts +1 -0
- package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +1 -1
- package/dist/types/components/pointCloudView/PointCloudContext.d.ts +12 -1
- package/dist/types/components/pointCloudView/hooks/useDataLinkSwitch.d.ts +21 -0
- package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +5 -0
- package/dist/types/components/subAttributeList/index.d.ts +10 -0
- package/dist/types/components/videoAnnotate/index.d.ts +2 -1
- package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +2 -1
- package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/store/Actions.d.ts +1 -0
- package/dist/types/store/annotation/actionCreators.d.ts +3 -2
- package/dist/types/store/annotation/reducer.d.ts +1 -0
- package/dist/types/store/annotation/types.d.ts +9 -2
- package/dist/types/utils/AnnotationDataUtils.d.ts +57 -1
- package/dist/types/utils/index.d.ts +25 -1
- package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +1 -1
- package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
- package/dist/types/views/MainView/toolHeader/StepSwitch/index.d.ts +1 -1
- package/dist/types/views/MainView/toolHeader/index.d.ts +1 -1
- package/dist/utils/AnnotationDataUtils.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/dist/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/es/App.js +1 -1
- package/es/assets/annotation/icon_link.svg.js +1 -0
- package/es/assets/annotation/icon_unlink.svg.js +1 -0
- package/es/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
- package/es/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
- package/es/components/LLMToolView/index.js +1 -1
- package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
- package/es/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
- package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
- package/es/components/LLMToolView/sidebar/index.js +1 -1
- package/es/components/LLMToolView/utils/data.js +1 -1
- package/es/components/NLPToolView/index.js +1 -1
- package/es/components/NLPToolView/textContent/index.js +1 -1
- package/es/components/audioAnnotate/audioContext/index.js +1 -1
- package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
- package/es/components/audioAnnotate/index.js +1 -1
- package/es/components/audioAnnotate/textInput/index.js +1 -1
- package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -1
- package/es/components/audioAnnotate/utils/dataTransform.js +1 -0
- package/es/components/audioPlayer/clipRegion/index.js +1 -1
- package/es/components/audioPlayer/index.js +1 -1
- package/es/components/audioPlayer/useAudioCombine/index.js +3 -2
- package/es/components/audioPlayer/useAudioSegment/index.js +1 -1
- package/es/components/longText/index.js +1 -1
- package/es/components/pointCloud2DRectOperationView/index.js +1 -1
- package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
- package/es/components/pointCloudView/PointCloud2DView.js +1 -1
- package/es/components/pointCloudView/PointCloud3DView.js +1 -1
- package/es/components/pointCloudView/PointCloudContext.js +1 -1
- package/es/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/components/pointCloudView/hooks/useStatus.js +1 -1
- package/es/components/pointCloudView/index.js +1 -1
- package/es/components/subAttributeList/index.js +1 -0
- package/es/components/videoAnnotate/videoClipTool/index.js +1 -1
- package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
- package/es/index.css +31 -9
- package/es/index.js +1 -1
- package/es/store/Actions.js +1 -1
- package/es/store/annotation/actionCreators.js +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/utils/AnnotationDataUtils.js +1 -1
- package/es/utils/index.js +1 -1
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/ActionsConfirm.js +1 -1
- package/es/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ViewportProvider as b}from"../../components/customResizeHook/index.js";import{prefix as C}from"../../constant/index.js";import{Spin as A}from"antd";import{Layout as y}from"antd/es";import t,{useState as O}from"react";import V from"./annotationOperation/index.js";import M from"./annotationTips/index.js";import k from"./sidebar/index.js";import h from"./toolFooter/index.js";import F from"./toolHeader/index.js";import{getStepConfig as E}from"../../store/annotation/reducer.js";import I from"../../components/videoAnnotate/index.js";import{connect as
|
|
1
|
+
import{ViewportProvider as b}from"../../components/customResizeHook/index.js";import{prefix as C}from"../../constant/index.js";import{Spin as A}from"antd";import{Layout as y}from"antd/es";import t,{useState as O}from"react";import V from"./annotationOperation/index.js";import M from"./annotationTips/index.js";import k from"./sidebar/index.js";import h from"./toolFooter/index.js";import F from"./toolHeader/index.js";import{getStepConfig as E}from"../../store/annotation/reducer.js";import I from"../../components/videoAnnotate/index.js";import{connect as B}from"react-redux";import g 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 D}from"../../store/ctx.js";import{EToolName as c}from"../../data/enums/ToolType.js";import U from"./LLMLayout/index.js";import z from"./NLPLayout/index.js";import q from"../../components/audioAnnotate/index.js";import{LoadingOutlined as G}from"@ant-design/icons";import{useTranslation as J}from"react-i18next";import{EPointCloudName as K}from"@labelbee/lb-annotation";var Q=Object.defineProperty,T=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,P=(e,o,n)=>o in e?Q(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,i=(e,o)=>{for(var n in o||(o={}))X.call(o,n)&&P(e,n,o[n]);if(T)for(var n of T(o))Y.call(o,n)&&P(e,n,o[n]);return e};const{Sider:Z,Content:p}=y,u=`${C}-layout`,ee=e=>{var o;return t.createElement(t.Fragment,null,e.showTips===!0&&t.createElement(M,{path:e.path,tips:e.tips}),t.createElement(V,i({},e)),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;return t.createElement(t.Fragment,null,t.createElement($,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit,measureVisible:e.measureVisible}),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},oe=e=>{var o;const{stepList:n,step:r}=e,a=(o=E(n,r))==null?void 0:o.tool,m=g.isPointCloudTool(a),l=g.isVideoTool(a);return m?t.createElement(te,i({},e)):l?t.createElement(I,{drawLayerSlot:e.drawLayerSlot,footer:e.footer,annotationBefore:e==null?void 0:e.annotationBefore}):t.createElement(ee,i({},e))},f=e=>{var o,n,r;const{t:a}=J(),{stepList:m,step:l}=e,d=(o=E(m,l))==null?void 0:o.tool,s=![c.LLM,c.NLP].includes(d),v=![c.LLM,c.NLP].includes(d),L=[K.PointCloud].includes(d);return t.createElement(b,null,t.createElement(A,{spinning:e.loading,indicator:t.createElement(G,null),tip:t.createElement("span",{style:{marginTop:200}},a("LoadingTips")),delay:500},t.createElement(y,{className:R([u,e.className]),style:(n=e.style)==null?void 0:n.layout},t.createElement("header",{className:`${u}__header`,style:(r=e.style)==null?void 0:r.header},t.createElement(F,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:s,hasHeaderOption:v,hasPredictTrackingIcon:L})),e.children)))},ne=e=>{var o,n,r,a,m,l,d;const[s,v]=O(void 0),L=(n=(o=e.style)==null?void 0:o.sider)==null?void 0:n.width,{stepList:x,step:N}=e,_=(r=E(x,N))==null?void 0:r.tool,j=c.LLM===_,w=c.NLP===_,S=g.isAudioTool(_);return j?t.createElement(f,i({},e),t.createElement(U,i({},e))):w?t.createElement(f,i({},e),t.createElement(z,i({},e))):S?t.createElement(f,i({},e),t.createElement(q,i({},e))):t.createElement(f,i({},e),t.createElement(y,{className:H("layout","container")},e==null?void 0:e.leftSider,t.createElement(p,{className:`${u}__content`},t.createElement(oe,i({},e)),t.createElement(W,null)),t.createElement(Z,{className:`${u}__side`,width:(a=s!=null?s:L)!=null?a:240,style:(m=e.style)==null?void 0:m.sider},t.createElement(k,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:v,propsSiderWidth:(d=(l=e.style)==null?void 0:l.sider)==null?void 0:d.width}))))},le=({annotation:e})=>{var o,n,r;const{imgList:a,loading:m}=e,l=(o=a[e.imgIndex])!=null?o:{};return{path:(r=(n=l==null?void 0:l.path)!=null?n:l==null?void 0:l.url)!=null?r:"",loading:m}};var ie=B(le,null,null,{context:D})(ne);export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{useRef as d,useState as
|
|
1
|
+
import t,{useRef as d,useState as p}from"react";import{Col as v,Popconfirm as C}from"antd";import{useTranslation as m}from"react-i18next";import{prefix as E}from"../../../../constant/index.js";const y={color:"#CCCCCC"},f=({info:r})=>{const{t:e}=m();return r.key.startsWith("sure")?t.createElement("div",{key:r.key},`${e("ConfirmTo")}${r.name.slice(0)}\uFF1F`):t.createElement("span",null,r.name)},g=({icon:r})=>typeof r=="string"?t.createElement("img",{width:23,height:25,src:r}):r,i=({isHover:r,info:e})=>{const n=!!e.forbidOperation,o=e.key===r&&!n;let a={color:o?"#666fff":""};return n&&(a=y),t.createElement("div",{style:{cursor:n?"not-allowed":"default"},onClick:()=>{var c;return(e==null?void 0:e.forbidConfirm)&&!n&&((c=e==null?void 0:e.onClick)==null?void 0:c.call(e))}},t.createElement("div",{className:"icon"},t.createElement(g,{icon:o?e.hoverSvg:e.imgSvg})),t.createElement("div",{className:"toolName",style:a},e.name))},k=({allOperation:r})=>{const e=d(null),[n,o]=p(null),{t:a}=m(),c=Math.floor(24/r.length);return t.createElement("div",{className:"generalOperation",ref:e},r.map((l,u)=>t.createElement(v,{span:c,key:u,className:"generalOperation-col"},t.createElement("div",{key:l.key,className:"item",onMouseEnter:()=>{o(l.key)},onMouseLeave:()=>{o(null)}},l.forbidConfirm?t.createElement(i,{info:l,isHover:n}):t.createElement(C,{title:t.createElement(f,{info:l}),placement:"topRight",okText:a("Confirm"),cancelText:a("Cancel"),getPopupContainer:()=>{var s;return(s=e.current)!=null?s:document.body},onConfirm:l.onClick,overlayClassName:`${E}-pop-confirm`},t.createElement("div",null,t.createElement(i,{info:l,isHover:n})))))))};export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i,{useState as P,useRef as A,useEffect as S}from"react";import{connect as w}from"react-redux";import I from"../../../../utils/StepUtils.js";import{useTranslation as R}from"react-i18next";import{LabelBeeContext as D}from"../../../../store/ctx.js";import{prefix as b}from"../../../../constant/index.js";import{jsonParser as B,classnames as H}from"../../../../utils/index.js";import{Row as K,Col as h,Popconfirm as k}from"antd";import{CloseOutlined as F}from"@ant-design/icons";import L from"../../../../components/longText/index.js";var U=Object.defineProperty,M=Object.defineProperties,V=Object.getOwnPropertyDescriptors,C=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,T=(n,t,e)=>t in n?U(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,G=(n,t)=>{for(var e in t||(t={}))q.call(t,e)&&T(n,e,t[e]);if(C)for(var e of C(t))z.call(t,e)&&T(n,e,t[e]);return n},J=(n,t)=>M(n,V(t));const c=`${b}-sidebar`,Q=(n,t,e)=>{const l=(n==null?void 0:n.attributeList)||[],m=t.map(a=>{var p,o;const _=((o=(p=l.filter(d=>d.value===a.attribute))==null?void 0:p[0])==null?void 0:o.key)||"";return J(G({},a),{label:_})});return(e==null?void 0:e.length)>0?m.filter(a=>e.includes(a.attribute)):m},W=n=>{var t,e,l;const[m,a]=P(0),p=A(null),{toolInstance:o,checkMode:_,stepInfo:d}=n,{t:u}=R(),y=B(d.config),[g,E]=P("");S(()=>(o&&o.on("changeAttributeSidebar",r=>{a(s=>s+1)}),()=>{o==null||o.unbindAll("changeAttributeSidebar")}),[o,p]);const[x]=o.exportData(),O=(e=(t=x==null?void 0:x[0])==null?void 0:t.textAnnotation)!=null?e:[],f=Q(y,O,(l=o==null?void 0:o.attributeLockList)!=null?l:[]),N=r=>{let s=r===g?"":r;o==null||o.setHighlightKey(s),E(s)},j=r=>{o==null||o.deleteTextAnnotation(r.id)};return(f==null?void 0:f.length)===0?null:i.createElement("div",{className:`${c}__content__NLPList`},f.map((r,s)=>{const $=g===r.id;return i.createElement("div",{key:s,className:H({[`${c}__content__NLPList__item`]:!0,[`${c}__content__NLPList__item__active`]:$}),onClick:()=>N(r.id)},i.createElement(K,{className:`${c}__content__NLPList__item__text`},i.createElement(h,{span:7},i.createElement(L,{text:`${r.label}\uFF0C${u("textTool")}: `,openByText:!0,isToolTips:!0})),i.createElement(h,{span:16,offset:1},i.createElement(L,{text:r.text,openByText:!0,isToolTips:!0}))),!_&&i.createElement(k,{title:u("DeleteCommentConfirm"),placement:"topRight",okText:u("Confirm"),cancelText:u("Cancel"),getPopupContainer:v=>v.parentElement,onConfirm:()=>j(r),overlayClassName:`${b}-pop-confirm`},i.createElement(F,{className:`${c}-pop-remove`,onClick:v=>{v.stopPropagation()}})))}))},X=n=>{var t,e;const l=I.getCurrentStepInfo((t=n.annotation)==null?void 0:t.step,(e=n.annotation)==null?void 0:e.stepList);return{toolInstance:n.annotation.toolInstance,stepInfo:l}};var Y=w(X,null,null,{context:D})(W);export{Y as default,c as sidebarCls};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e,{useState as y,useContext as T,useEffect as j}from"react";import{EditFilled as ot}from"@ant-design/icons";import{ToolIcons as nt}from"../ToolIcons.js";import{EToolName as rt}from"../../../../data/enums/ToolType.js";import{cTool as lt}from"@labelbee/lb-annotation";import{PointCloudContext as D}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as h,Input as it,message as I}from"antd";import st from"../../../../utils/StepUtils.js";import{connect as at}from"react-redux";import{jsonParser as ct,classnames as ut}from"../../../../utils/index.js";import{useStatus as $}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as R}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as k}from"react-i18next";import{LabelBeeContext as dt,useDispatch as mt}from"../../../../store/ctx.js";import pt from"./components/batchUpdateModal/index.js";import ft from"./components/annotatedBox/index.js";import gt from"./components/findTrackIDIndex/index.js";import{EPointCloudSegmentStatus as w,EPointCloudPattern as vt}from"@labelbee/lb-utils";import St from"../../../../components/attributeList/index.js";import{useAttribute as bt}from"../../../../components/pointCloudView/hooks/useAttribute.js";import Ct from"../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import _t from"../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js";import Pt from"../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import xt from"../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js";import Et from"../../../../assets/annotation/rectTool/icon_rect.svg.js";import yt from"../../../../assets/annotation/rectTool/icon_rect_a.svg.js";import{sidebarCls as L}from"../index.js";import{SetTaskStepList as It}from"../../../../store/annotation/actionCreators.js";import{usePointCloudViews as wt}from"../../../../components/pointCloudView/hooks/usePointCloudViews.js";import Lt from"../../../../components/subAttributeList/index.js";var Tt=Object.defineProperty,jt=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,z=(o,t,n)=>t in o?Tt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,A=(o,t)=>{for(var n in t||(t={}))ht.call(t,n)&&z(o,n,t[n]);if(U)for(var n of U(t))kt.call(t,n)&&z(o,n,t[n]);return o},V=(o,t)=>jt(o,Dt(t));const At=()=>{const[o,t]=y(!1),n=T(D),{pointCloudBoxList:a}=n,{selectedBox:c,updateSelectedBox:r}=R(),[u,d]=y(""),{t:g}=k(),p=c==null?void 0:c.info.trackID,s=m=>!!a.find(b=>b.trackID===m&&b.id!==(c==null?void 0:c.info.id)),i=(m=!1)=>{const f=parseInt(u,10);if(m&&t(!1),isNaN(f)){I.error(g("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){I.error(g("NotAllowDecimalPointsInTrackID"));return}if(s(f)){I.error(g("DuplicateTrackIDsExist"));return}if(!(f>0)){I.error(g("PositiveIntegerCheck"));return}S(f)};j(()=>{t(!1)},[p]);const S=m=>{var f;const b=r({trackID:m});(f=n==null?void 0:n.topViewInstance)==null||f.updatePolygonList(b!=null?b:[])};return e.createElement("div",{style:{padding:24}},e.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",null,g("CurrentBoxTrackIDs")),p&&e.createElement(pt,{id:p,updateCurrentPolygonList:m=>S(m)})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},o&&p?e.createElement(it,{defaultValue:p,onChange:m=>{d(m.target.value)},disabled:!p,size:"small",onBlur:()=>{i()},onPressEnter:()=>{i(!0)}}):e.createElement("span",null,p),e.createElement(ot,{style:{color:"#999",marginLeft:16,cursor:typeof p!="undefined"?"pointer":"not-allowed"},onClick:()=>{p&&t(!o)}})))},F=({segmentStatus:o,globalPattern:t})=>t===vt.Segmentation&&![w.Edit,w.Ready].includes(o),M=({attributeList:o,subAttributeList:t,toolInstance:n,config:a,stepList:c,stepInfo:r,enableColorPicker:u})=>{const[d,g]=y({segmentStatus:w.Ready}),{selectedBox:p}=R(),s=T(D),{ptSegmentInstance:i}=s,{t:S}=k(),{defaultAttribute:m}=bt(),f=wt(),{isPointCloudSegmentationPattern:b}=$(),H=mt(),J={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};j(()=>{if(!!i)return i.on("syncPointCloudStatus",g),()=>{i.unbind("syncPointCloudStatus",g)}},[i]);const X=(l,C)=>{var _,P,x,B,N;const E=(_=a==null?void 0:a.attributeList)==null?void 0:_.map(v=>v.value===l?V(A({},v),{color:C}):v),O=V(A({},a),{attributeList:E}),tt=JSON.stringify(O),et=c==null?void 0:c.map(v=>(v==null?void 0:v.step)===(r==null?void 0:r.step)?V(A({},v),{config:tt}):v);(P=s==null?void 0:s.topViewInstance)==null||P.updateAttributeList(E),(x=s==null?void 0:s.sideViewInstance)==null||x.updateAttributeList(E),(B=s==null?void 0:s.backViewInstance)==null||B.updateAttributeList(E),(N=s==null?void 0:s.mainViewInstance)==null||N.setConfig(O),H(It({stepList:et}))},Y=l=>{f.updateViewsByDefaultSize&&f.updateViewsByDefaultSize(l)},q=l=>{F({globalPattern:s.globalPattern,segmentStatus:d.segmentStatus})||n.setDefaultAttribute(l)},G=(l,C)=>{F({globalPattern:s.globalPattern,segmentStatus:d.segmentStatus})||n.setSubAttribute(l,C)},K=o.map(l=>({label:l.key,value:l.value,color:l==null?void 0:l.color,limit:l==null?void 0:l.limit,isDefault:l==null?void 0:l.isDefault})),Q=p||d.cacheSegData&&d.segmentStatus===w.Edit,Z=b;return e.createElement("div",{style:{flex:1,overflowX:"hidden",overflowY:"auto"}},e.createElement("div",{style:J},S("Attribute")),e.createElement(St,{list:K,forbidDefault:!0,selectedAttribute:m!=null?m:"",attributeChanged:l=>q(l),updateColorConfig:X,enableColorPicker:u,updateSize:Y,forbidShowLimitPopover:Z}),e.createElement(h,{style:{margin:0}}),Q&&e.createElement(Lt,{subAttributeList:t,setSubAttribute:G,getValue:l=>{var C,_,P,x;return((_=(C=s.selectedPointCloudBox)==null?void 0:C.subAttribute)==null?void 0:_[l.value])||((x=(P=d.cacheSegData)==null?void 0:P.subAttribute)==null?void 0:x[l.value])}}))},Vt=[{toolName:"LassoSelector",commonSvg:Ct,selectedSvg:_t},{toolName:"RectSelector",commonSvg:Et,selectedSvg:yt},{toolName:"CircleSelector",commonSvg:Pt,selectedSvg:xt}],W=({toolInstance:o})=>{const{ptSegmentInstance:t}=T(D),[n,a]=y("LassoSelector"),{t:c}=k();return j(()=>{if(!t)return;const r=()=>{a("LassoSelector")},u=()=>{a("RectSelector")},d=()=>{a("CircleSelector")};return t.on("LassoSelector",r),t.on("RectSelector",u),t.on("CircleSelector",d),()=>{t.unbind("LassoSelector",r),t.unbind("RectSelector",u),t.unbind("CircleSelector",d)}},[t]),e.createElement("div",{className:`${L}__level`},Vt.map(r=>{const u=n===r.toolName;return e.createElement("span",{className:`${L}__toolOption`,key:r.toolName,onClick:()=>t==null?void 0:t.emit(r.toolName)},e.createElement("img",{className:`${L}__singleTool`,src:u?r==null?void 0:r.selectedSvg:r==null?void 0:r.commonSvg}),e.createElement("span",{className:ut({[`${L}__toolOption__selected`]:u})},c(r.toolName)))}))},Bt=({stepInfo:o,toolInstance:t,imgList:n,imgIndex:a,stepList:c,enableColorPicker:r})=>{var u,d;const{updatePointCloudPattern:g,pointCloudPattern:p,isPointCloudSegmentationPattern:s}=$(),i=ct(o.config),S=(u=i==null?void 0:i.attributeList)!=null?u:[],m=(i==null?void 0:i.secondaryAttributeConfigurable)===!0?(d=i==null?void 0:i.inputList)!=null?d:[]:[];return s?e.createElement(e.Fragment,null,e.createElement(W,{toolInstance:t}),e.createElement(M,{toolInstance:t,attributeList:S,subAttributeList:m,config:i,stepList:c,stepInfo:o,enableColorPicker:r})):e.createElement(e.Fragment,null,e.createElement(nt,{toolName:lt.EPointCloudName.PointCloud,selectedToolName:p,onChange:f=>g==null?void 0:g(f)}),e.createElement(M,{toolInstance:t,attributeList:S,subAttributeList:m,config:i,stepList:c,stepInfo:o,enableColorPicker:r}),(i==null?void 0:i.trackConfigurable)===!0&&p===rt.Rect&&e.createElement("div",{style:{flexShrink:0,height:280,overflow:"auto"}},e.createElement(At,null),e.createElement(h,{style:{margin:0}}),e.createElement(ft,{imgList:n,imgIndex:a}),e.createElement(h,{style:{margin:0}}),e.createElement(gt,{imgList:n,imgIndex:a})))},Nt=o=>{var t,n,a,c;const r=st.getCurrentStepInfo((t=o.annotation)==null?void 0:t.step,(n=o.annotation)==null?void 0:n.stepList),u=(a=o.annotation)==null?void 0:a.toolInstance,d=(c=o.annotation)==null?void 0:c.stepList;return{stepInfo:r,toolInstance:u,imgList:o.annotation.imgList,imgIndex:o.annotation.imgIndex,stepList:d}};var Ot=at(Nt,null,null,{context:dt})(Bt);export{W as PointCloudSegToolIcon,Ot as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import K from"../../../../components/attributeList/index.js";import M from"../../../../components/checkboxList/index.js";import{CaretRightOutlined as P}from"@ant-design/icons";import{Collapse as T,Tooltip as H,Badge as x}from"antd/es";import{cloneDeep as F}from"lodash";import
|
|
1
|
+
import K from"../../../../components/attributeList/index.js";import M from"../../../../components/checkboxList/index.js";import{CaretRightOutlined as P}from"@ant-design/icons";import{Collapse as T,Tooltip as H,Badge as x}from"antd/es";import{cloneDeep as F}from"lodash";import a,{useState as v,useRef as U,useEffect as p,useCallback as q}from"react";import z from"../../../../assets/annotation/common/icon_clearSmall.svg.js";import G from"../../../../assets/annotation/common/icon_clearSmall_a.svg.js";import{TagUtils as J}from"@labelbee/lb-annotation";import{connect as Q}from"react-redux";import{useTranslation as V}from"react-i18next";import{LabelBeeContext as W}from"../../../../store/ctx.js";const{Panel:X}=T,$=({isActive:n})=>a.createElement(P,{rotate:n?90:0}),Y=({toolInstance:n,imgIndex:N})=>{const[s,g]=v([]),i=U(null),[,j]=v(0),[w,f]=v(-1),{t:b}=V();p(()=>{var r,l;n&&(g((l=(r=n.config)==null?void 0:r.inputList)==null?void 0:l.map(e=>e.value)),n.singleOn("render",()=>{j(e=>e+1)}))},[n]),p(()=>{var r;if(n&&(n.singleOn("expend",O),((r=n==null?void 0:n.labelSelectedList)==null?void 0:r.length)===1)){let l=0;for(let e=0;e<n.labelSelectedList[0];e++)l+=46,o[e]&&s[e]!==""&&o[e].subSelected.forEach(t=>{l+=40});i.current&&(i.current.children[0].scrollTop=l)}}),p(()=>{i.current&&(i.current.children[0].scrollTop=0)},[N]);const O=()=>{var r;const l=n.labelSelectedList[0],e=(r=o.filter((t,m)=>m===l)[0])==null?void 0:r.value;h(l,e,!0)},h=q((r,l,e)=>{const t=F(s);t[r]===""||e===!0?t[r]=l:t[r]="",g(t)},[s]);if(!n)return null;const{labelSelectedList:u,config:{inputList:o},currentTagResult:c,setLabel:E}=n,A=r=>u.length>0&&u[0]===r?a.createElement("span",{className:"keyDownIconActive"},r+1):a.createElement("span",{className:"keyDownIcon"},r+1),y=(r,l=-1)=>r?r.map((e,t)=>{var m,_,L,k,C;if(e.subSelected){const R=J.judgeResultIsInInputList(e.value,(m=c==null?void 0:c.result)==null?void 0:m[e.value],o);return a.createElement(T,{bordered:!1,expandIcon:$,key:`collapse_${t}_${l+1}`,onChange:()=>h(t,e.value),activeKey:[s[t]]},a.createElement(X,{header:a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flex:1}},a.createElement("span",null,e.key,a.createElement(H,{placement:"bottom",title:b("ClearThisOption")},a.createElement("img",{style:{marginLeft:5,cursor:"pointer"},onClick:D=>{D.stopPropagation(),n.clearResult(!0,e.value)},src:w===t||R?G:z,onMouseEnter:()=>{f(t)},onMouseLeave:()=>{f(-1)}})),R&&s[t]===""&&a.createElement(x,{color:"#87d068"})),(o==null?void 0:o.length)>1&&A(t)),key:e.value},a.createElement("div",{className:"level",style:{backgroundColor:u.length>0&&u[0]===t?"rgba(158, 158, 158, 0.18)":""}},y(e.subSelected,t))))}const d=(o==null?void 0:o[l])?o==null?void 0:o[l].value:0,S=((k=(L=(_=c==null?void 0:c.result)==null?void 0:_[d])==null?void 0:L.split(";"))==null?void 0:k.indexOf(e.value))>-1?e.value:"";return((C=o==null?void 0:o[l])==null?void 0:C.isMulti)===!0?a.createElement("div",{className:"singleBar",key:`${d}_${l}_${t}`},a.createElement(M,{attributeChanged:()=>E(l,t),selectedAttribute:[S],list:[{value:e.value,label:e.key}],num:t+1})):a.createElement("div",{className:"singleBar",key:`${d}_${l}_${t}`},a.createElement(K,{forbidColor:!0,attributeChanged:()=>E(l,t),selectedAttribute:S,list:[{value:e.value,label:e.key}],num:t+1}))}):null,B=window.innerHeight-61-80;return a.createElement("div",{className:"tagOperationMenu",ref:i},(o==null?void 0:o.length)===0?a.createElement("div",{style:{padding:20,textAlign:"center"}},b("NoConfiguration")):a.createElement("div",{className:"main",style:{height:B}},y(o)))};function Z(n){return{toolInstance:n.annotation.toolInstance,imgIndex:n.annotation.imgIndex}}var I=Q(Z,null,null,{context:W})(Y);export{I as default,$ as expandIconFuc};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o,{useState as
|
|
1
|
+
import o,{useState as d,useEffect as h,useRef as I}from"react";import{connect as M}from"react-redux";import{cloneDeep as z}from"lodash";import{classnames as S}from"../../../../utils/index.js";import{Switch as W,Input as J}from"antd/es";import{cKeyCode as G,cTool as H}from"@labelbee/lb-annotation";import{PageForward as Q}from"../../../../store/annotation/actionCreators.js";import{ConfigUtils as X}from"../../../../utils/ConfigUtils.js";import{useTranslation as A}from"react-i18next";import{LabelBeeContext as Y}from"../../../../store/ctx.js";var Z=Object.defineProperty,K=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,$=(e,t,r)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ne=(e,t)=>{for(var r in t||(t={}))ee.call(t,r)&&$(e,r,t[r]);if(K)for(var r of K(t))te.call(t,r)&&$(e,r,t[r]);return e};const j=G.default,{EVideoToolName:oe}=H,V=e=>{e.stopPropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},D=e=>{const{textareaProps:t,footer:r}=e;return o.createElement(o.Fragment,null,o.createElement(J.TextArea,ne({key:`${t.id}-${t.defaultValue}`,bordered:!1,rows:6,onKeyDown:V,onKeyUp:V},t)),o.createElement("div",{className:S({textAreaLength:!0})},r))},q=e=>{var t;const r=I(null),[E,f]=d(!1),[N,P]=d(!1),{t:w}=A(),{disabled:s,config:i,result:m,updateText:p,index:u,switchToNextTextarea:y,hasMultiple:L,onNext:b}=e,{maxLength:g}=i,c=m?m[i.key]:"",[_,C]=d((t=c==null?void 0:c.length)!=null?t:0);h(()=>{var n;C((n=c==null?void 0:c.length)!=null?n:0)},[c]);const v=(n,T)=>{p&&(p(n,i.key,T),i.required&&P(!n))},x=L&&y,k={id:`textInput-${u}`,ref:r,disabled:s,defaultValue:c,maxLength:g,autoSize:{minRows:2,maxRows:6},onChange:n=>{const T=n.target.value;C(n.target.value.length),v(T,!1)},onFocus:()=>{f(!0)},onBlur:n=>{f(!1),v(n.target.value,!0),i.required&&P(!n.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:n=>{n.ctrlKey&&n.keyCode===j.Enter&&(b&&b(),n.preventDefault()),n.keyCode===j.Tab&&x&&(n.preventDefault(),n.nativeEvent.stopImmediatePropagation(),y(u)),n.nativeEvent.stopPropagation()}},F=o.createElement("div",{className:"textAreaFooter"},o.createElement("div",{className:"hotkeyTip"},x&&o.createElement("span",null,`[${w("Switch")}]Tab`),o.createElement("span",null,`[${w("TurnPage")}]Ctrl+Enter`)),o.createElement("div",{className:"wordCount"},o.createElement("span",{className:_>=g?"warning":""},_),"/",o.createElement("span",null,g)));return h(()=>{s&&f(!1)},[s]),o.createElement("div",{className:"textField"},o.createElement("div",{className:"label"},o.createElement("span",{className:S({required:i.required})},i.label),o.createElement("i",{className:S({clearText:!0,disabled:s}),onClick:()=>{s||v("",!0)}})),o.createElement("div",{className:S({disabled:s,"textarea-outline":!0,"ant-input-focused":E,textareaContainer:!0,focus:E,invalid:N})},o.createElement(D,{footer:F,textareaProps:k})))},ae=({toolInstance:e,imgIndex:t,dispatch:r,triggerEventAfterIndexChanged:E,step:f,stepList:N,basicResultList:P,disabled:w})=>{var s,i,m,p;const[u,y]=d([]),[L,b]=d(0),[g,c]=d(!0),[,_]=d(0),{t:C}=A(),v=a=>{const l=(a+1)%u.length;x(l)},x=a=>{setTimeout(()=>{const l=document.getElementById(`textInput-${a}`);l&&(b(a),l.focus(),l.select(),l.scrollIntoView({behavior:"smooth",block:"center"}))})};h(()=>{e&&e.singleOn("valueUpdated",()=>{_(a=>a+1)})},[e]),h(()=>{var a;e&&y(z((a=e==null?void 0:e.config)==null?void 0:a.configList))},[JSON.stringify((s=e==null?void 0:e.config)==null?void 0:s.configList)]);const k=(p=(m=(i=e==null?void 0:e.textList)==null?void 0:i[0])==null?void 0:m.value)!=null?p:{},F=(a,l,U=!1)=>{var O,R;(R=e==null?void 0:e.updateTextValue)==null||R.call(e,l,a,U,(O=e==null?void 0:e.textList)==null?void 0:O[0])};h(()=>{t>-1&&E&&x(0)},[t]);const n=()=>{r(Q(!0))},T=a=>{c(a),e==null||e.toggleShowText(a)},B=X.getStepConfig(N,f).tool===oe.VideoTextTool;return e&&o.createElement("div",{className:"textToolOperationMenu"},u==null?void 0:u.map((a,l)=>o.createElement(q,{config:a,key:a.key,index:l,result:k,updateText:F,switchToNextTextarea:v,hasMultiple:u.length>1,focus:L===l,onNext:n,disabled:w})),B&&o.createElement("div",{className:"textToolSwitchItem"},C("toggleShowText"),o.createElement(W,{style:{alignSelf:"center"},checked:g,onChange:a=>{T(a)}})))};function re(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 le=M(re,null,null,{context:Y})(ae);export{q as SingleTextInput,D as TextareaWithFooter,le as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.23.0-alpha.
|
|
3
|
+
"version": "1.23.0-alpha.40",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ant-design/icons": "^4.6.2",
|
|
46
|
-
"@labelbee/lb-annotation": "1.27.0-alpha.
|
|
47
|
-
"@labelbee/lb-utils": "1.19.0-alpha.
|
|
46
|
+
"@labelbee/lb-annotation": "1.27.0-alpha.20",
|
|
47
|
+
"@labelbee/lb-utils": "1.19.0-alpha.14",
|
|
48
48
|
"@labelbee/wavesurfer": "1.0.0",
|
|
49
49
|
"@types/react-dom": "^18.2.7",
|
|
50
50
|
"@types/react-transition-group": "^4.4.9",
|