@labelbee/lb-components 1.24.0-alpha.14 → 1.24.0-alpha.16
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/components/DynamicResizer/DynamicResizer.js +1 -1
- package/dist/components/DynamicResizer/hooks/useDrag.js +1 -1
- package/dist/components/DynamicResizer/hooks/useDraggingAllowed.js +1 -0
- package/dist/components/DynamicResizer/hooks/useUpdateHeight.js +1 -1
- package/dist/components/DynamicResizer/utils/index.js +1 -0
- package/dist/components/audioAnnotate/index.js +1 -1
- package/dist/components/pointCloudView/index.js +1 -1
- package/dist/index.css +50 -53
- package/dist/types/components/DynamicResizer/DynamicResizer.d.ts +3 -3
- package/dist/types/components/DynamicResizer/hooks/useDrag.d.ts +24 -7
- package/dist/types/components/DynamicResizer/hooks/useDraggingAllowed.d.ts +12 -0
- package/dist/types/components/DynamicResizer/hooks/useUpdateHeight.d.ts +10 -21
- package/dist/types/components/DynamicResizer/types/interface.d.ts +13 -6
- package/dist/types/components/DynamicResizer/utils/index.d.ts +4 -0
- package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/es/components/DynamicResizer/DynamicResizer.js +1 -1
- package/es/components/DynamicResizer/hooks/useDrag.js +1 -1
- package/es/components/DynamicResizer/hooks/useDraggingAllowed.js +1 -0
- package/es/components/DynamicResizer/hooks/useUpdateHeight.js +1 -1
- package/es/components/DynamicResizer/utils/index.js +1 -0
- package/es/components/audioAnnotate/index.js +1 -1
- package/es/components/pointCloudView/index.js +1 -1
- package/es/index.css +50 -53
- package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
- package/package.json +1 -1
- package/dist/components/DynamicResizer/assets/bottomToZero.svg.js +0 -1
- package/dist/components/DynamicResizer/assets/divider.svg.js +0 -1
- package/dist/components/DynamicResizer/assets/topToZero.svg.js +0 -1
- package/es/components/DynamicResizer/assets/bottomToZero.svg.js +0 -1
- package/es/components/DynamicResizer/assets/divider.svg.js +0 -1
- package/es/components/DynamicResizer/assets/topToZero.svg.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),useDrag=require("./hooks/useDrag.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React)
|
|
1
|
+
"use strict";var React=require("react"),reResizable=require("re-resizable"),useDrag=require("./hooks/useDrag.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,r,t)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r||(r={}))__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e};const DynamicResizer=({direction:e="vertical",children:r,defaultWidth:t,defaultHeight:l,minTopHeight:s,minBottomHeight:o,minLeftWidth:i,minRightWidth:n,localKey:c,enableEdges:u=["right","bottom"],onResizeStart:f,onResize:m,onResizeStop:p})=>{const a=React.useRef(null),d=useDrag({direction:e,containerRef:a,defaultHeight:l,defaultWidth:t,minTopHeight:s,minBottomHeight:o,minLeftWidth:i,minRightWidth:n,localKey:c,enableEdges:u,onResizeStart:f,onResize:m,onResizeStop:p});return React__default.default.createElement("div",{className:`dynamic-resizer-content ${e}`,ref:a},React__default.default.createElement(reResizable.Resizable,__spreadValues({},d),React__default.default.createElement("div",{className:"resizable-child"},r[0])),React__default.default.createElement("div",{className:"resizable-child-two"},r[1]))};module.exports=DynamicResizer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),
|
|
1
|
+
"use strict";var React=require("react"),useUpdateHeight=require("./useUpdateHeight.js"),useDraggingAllowed=require("./useDraggingAllowed.js");const useDrag=({containerRef:e,direction:t,defaultHeight:g,defaultWidth:l,minTopHeight:n,minBottomHeight:c,minLeftWidth:o,minRightWidth:u,localKey:m,enableEdges:f,onResizeStart:s,onResize:i,onResizeStop:r})=>{const{width:p,height:z,minWidth:H,minHeight:b,maxWidth:D,maxHeight:v,updateHeight:y,updateWidth:W}=useUpdateHeight({direction:t,containerRef:e,minTopHeight:n,minBottomHeight:c,defaultHeight:g,minLeftWidth:o,minRightWidth:u,defaultWidth:l,localKey:m}),q=useDraggingAllowed(t,f),[a,d]=React.useState(!1),w=()=>{d(!0),s&&s()},x=()=>{i&&i()},S=(A,L,h)=>{d(!1),W(h.offsetWidth),y(h.offsetHeight),r&&r()};return React.useEffect(()=>{e.current&&(a?e.current.classList.add("hide-scrollbar"):e.current.classList.remove("hide-scrollbar"))},[a,e.current]),{size:{width:p,height:z},onResizeStart:w,onResize:x,onResizeStop:S,enable:q,handleClasses:{right:"dynamic-right-handle",bottom:"dynamic-bottom-handle"},minWidth:H,maxWidth:D,minHeight:b,maxHeight:v}};module.exports=useDrag;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var React=require("react");const useDraggingAllowed=(l="vertical",o)=>{const t=(e,r)=>l===e&&(o==null?void 0:o.includes(r));return React.useMemo(()=>{const e=t("vertical","top"),r=t("vertical","bottom"),s=t("horizontal","left"),n=t("horizontal","right");return{top:e,bottom:r,left:s,right:n,topLeft:!1,ropRight:!1,bottomLeft:!1,bottomRight:!1}},[l,o])};module.exports=useDraggingAllowed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),ahooks=require("ahooks");const
|
|
1
|
+
"use strict";var React=require("react"),ahooks=require("ahooks"),index=require("../utils/index.js");const useUpdateHeight=({containerRef:t,direction:l,defaultHeight:M=10,defaultWidth:W=10,minTopHeight:c=10,minBottomHeight:i=10,minLeftWidth:d=10,minRightWidth:h=10,localKey:o="dynamicResizerLocalKey"})=>{var r,v;const[S,z]=React.useState(0),[n,k]=React.useState(0),[b,p]=React.useState(void 0),[C,D]=React.useState(void 0),[E,j]=React.useState(void 0),[q,I]=React.useState(void 0),[w,A]=ahooks.useLocalStorageState(o+"width"),[L,_]=ahooks.useLocalStorageState(o+"height"),[u,g]=React.useState(!1);React.useEffect(()=>(g(!0),()=>{g(!1)}),[]),React.useEffect(()=>{u&&y()},[u]),React.useEffect(()=>{u&&l==="vertical"&&F()},[u,(r=t.current)==null?void 0:r.offsetHeight,c,i]),React.useEffect(()=>{u&&l==="horizontal"&&U()},[u,(v=t.current)==null?void 0:v.offsetWidth,d,h]);const y=()=>{if(t==null?void 0:t.current){const e=t==null?void 0:t.current.offsetWidth,s=t==null?void 0:t.current.offsetHeight;let a=e,f=s;l==="vertical"?f=index.adjustDefaultSize(L,c,i,s,M):l==="horizontal"&&(a=index.adjustDefaultSize(w,d,h,e,W)),x(a),H(f)}},U=React.useCallback(()=>{if(t==null?void 0:t.current){const e=t==null?void 0:t.current.offsetWidth;let s=e,a=e;s=index.calcMinSize(d,e),a=index.calcMaxSize(h,e),p(s),j(a)}},[t,d,h]),F=React.useCallback(()=>{if(t==null?void 0:t.current){const e=t==null?void 0:t.current.offsetHeight;let s=e,a=e;s=index.calcMinSize(c,e),a=index.calcMaxSize(i,e),D(s),I(a)}},[t,c,i]),x=React.useCallback(e=>{const s=l==="horizontal"?e:"100%";z(s),A(s)},[l,S]),H=React.useCallback(e=>{const s=l==="vertical"?e:"100%";k(s),_(s)},[l,n]);return{width:S,height:n,minWidth:b,minHeight:C,maxWidth:E,maxHeight:q,updateWidth:x,updateHeight:H}};module.exports=useUpdateHeight;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const isPercentage=t=>typeof t=="string"&&t.endsWith("%")&&!isNaN(parseFloat(t)),calculatePercentage=(t,s)=>{const e=parseFloat(t);return isNaN(e)?0:e/100*s},isValidSize=t=>typeof t=="number"&&t>0||isPercentage(t),calcMaxSize=(t,s)=>isValidSize(t)?typeof t=="string"&&isPercentage(t)?calculatePercentage(t,s):s-Number(t):s,calcMinSize=(t,s)=>isValidSize(t)?typeof t=="string"&&isPercentage(t)?calculatePercentage(t,s):Number(t):0,adjustDefaultSize=(t,s,e,r=0,n)=>{if(!isValidSize(t))return n<r?n:Math.min(r,calcMinSize(s,r));if(calcMinSize(s,r)+calcMinSize(e,r)>r)return r*.5;const f=calcMinSize(s,r),p=r-calcMinSize(e,r),a=typeof t=="string"&&isPercentage(t)?calculatePercentage(t,r):Number(t)||0;return Math.min(Math.max(a,f),p)};exports.adjustDefaultSize=adjustDefaultSize,exports.calcMaxSize=calcMaxSize,exports.calcMinSize=calcMinSize,exports.isValidSize=isValidSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),index$3=require("../audioPlayer/index.js"),dom=require("../../utils/dom.js"),index$4=require("../predictTracking/previewResult/index.js"),es=require("antd/es"),antd=require("antd"),index$5=require("../../constant/index.js"),lbAnnotation=require("@labelbee/lb-annotation"),index_module=require("./index.module.scss.js"),index$2=require("./tagResultShow/index.js"),index$1=require("./audioContext/index.js"),index$6=require("./textInput/index.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),index=require("../../utils/index.js"),annotation=require("../../hooks/annotation.js"),index$7=require("../../views/MainView/sidebar/index.js"),index$8=require("./audioSide/labelSidebar/index.js"),index$9=require("./audioSide/clipSidebar/index.js"),tag=require("../../assets/annotation/audio/tag.svg.js"),tagA=require("../../assets/annotation/audio/tagA.svg.js"),clip=require("../../assets/annotation/audio/clip.svg.js"),clipA=require("../../assets/annotation/audio/clipA.svg.js"),audio=require("../../utils/audio.js"),dataTransform=require("./utils/dataTransform.js"),ahooks=require("ahooks");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,o,r)=>o in t?__defProp(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r,__spreadValues=(t,o)=>{for(var r in o||(o={}))__hasOwnProp.call(o,r)&&__defNormalProp(t,r,o[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(o))__propIsEnum.call(o,r)&&__defNormalProp(t,r,o[r]);return t},__spreadProps=(t,o)=>__defProps(t,__getOwnPropDescs(o));const{EAudioToolName}=lbAnnotation.cTool,EKeyCode=lbAnnotation.cKeyCode.default,{Sider,Content}=es.Layout,layoutCls=`${index$5.prefix}-layout`,ToggleAudioOption=({setSideTab:t,sideTab:o})=>{const r=[{tab:"tag",commonSvg:tag,selectedSvg:tagA},{tab:"clip",commonSvg:clip,selectedSvg:clipA}];return React__default.default.createElement("div",{className:index_module.toggleAudioOption},r.map((f,x)=>{const{tab:d,selectedSvg:E,commonSvg:C}=f;return React__default.default.createElement("div",{key:x,className:index_module.option},React__default.default.createElement("img",{className:index_module.icon,src:o===d?E:C,onClick:()=>{o!==d&&t(d)}}))}))},AudioTextToolTextarea=({result:t,inputDisabled:o,updateText:r,configList:f,autofocus:x,preContext:d,isCheck:E,clipAttributeConfigurable:C,clipTextConfigurable:A,textConfigurable:m,updateRegion:S,clipAttributeList:c,clipTextList:v})=>React__default.default.createElement(index$6.default,{isCheck:E,result:t==null?void 0:t.value,textInputDisabled:o,textID:(t==null?void 0:t.id)||0,updateText:r,configList:f,autofocus:!o&&x,preContext:d,regions:t==null?void 0:t.regions,clipAttributeConfigurable:C,clipTextConfigurable:A,textConfigurable:m,updateRegion:S,clipAttributeList:c,clipTextList:v}),AudioSideBar=t=>{var o,r;const{sider:f,config:x,result:d,updateTagResult:E,updateRegion:C,isEdit:A,tagConfigurable:m,clipConfigurable:S}=t;let c=(x==null?void 0:x.inputList)||[],v=(o=d==null?void 0:d.tag)!=null?o:{},s=(r=d==null?void 0:d.regions)!=null?r:[];const[D,j]=React.useState([]),[y,g]=React.useState("tag");React.useEffect(()=>{if(!m&&S){g("clip");return}g("tag")},[m,S]),React.useEffect(()=>(window.addEventListener("keydown",I),()=>{window.removeEventListener("keydown",I)}));const I=n=>{if(m&&S)switch(n.keyCode){case EKeyCode.L:g("tag");break;case EKeyCode.X:g("clip");break}if(y==="tag"){if(!lbAnnotation.CommonToolUtils.hotkeyFilter(n))return;lbAnnotation.CommonToolUtils.isMoveKey(n==null?void 0:n.keyCode)&&n.preventDefault();let l=n.keyCode;if(l&&(l<=57&&l>=49||l<=105&&l>=97)){l>57?l=l-97:l=l-49;const R=D.slice();c.length===1?(T(0,l),j([0,l]),setTimeout(()=>{j([])},500)):R.length===1?(T(R[0],l),j([R[0],l]),setTimeout(()=>{j([])},500)):j([l])}}},T=(n,l)=>{if(n<c.length&&c[n].subSelected&&l<c[n].subSelected.length){const R=c[n].value,a=c[n].isMulti;let L=c[n].subSelected[l].value,M=0;const N=v;for(const b in v)if(b===c[n].value){if(M++,a===!0){const w=N[b].split(";").filter(U=>U!==""),p=w.indexOf(L);p===-1?w.push(L):w.splice(p,1),L=w.join(";")}L===""?delete N[b]:N[b]=L}M===0&&Object.assign(v,{[R]:L}),E(v)}},h=n=>{delete v[n],E(v)},O=m&&S&&React__default.default.createElement(ToggleAudioOption,{setSideTab:g,sideTab:y}),P=y==="tag"&&React__default.default.createElement(index$8.default,{labelInfoSet:m?c:[],labelSelectedList:D,setLabel:T,tagResult:v,clearResult:h,isEdit:A,withPanelTab:!1}),k=y==="clip"&&React__default.default.createElement(index$9,{regions:s,updateRegion:C,useAudioClipStore:index$1.useAudioClipStore});return f?typeof f=="function"?React__default.default.createElement("div",{className:`${index$7.sidebarCls}`},f({toggleAudioOption:O,labelSidebar:P,clipSidebar:k})):f:React__default.default.createElement("div",{className:`${index$7.sidebarCls}`},React__default.default.createElement("div",{className:`${index$7.sidebarCls}__content`},O,P,k))},AudioAnnotate=t=>{var o,r,f,x,d,E,C,A,m;const S=(r=(o=t.style)==null?void 0:o.sider)==null?void 0:r.width,{step:c,stepList:v,audioContext:s,sider:D,drawLayerSlot:j,imgList:y,imgIndex:g,currentData:I,config:T,stepInfo:h,checkMode:O}=t,P=lbAnnotation.CommonToolUtils.getCurrentStepToolAndConfig(c,v),k=index.jsonParser(I.result),{toolInstanceRef:n}=annotation.useCustomToolInstance({basicInfo:k}),[l,R]=React.useState(!0),[a,L]=React.useState(null),[M,N]=React.useState(0),[b,w]=React.useState(!0),p=e=>{if(!e)return;const i=dataTransform.fixData(e);L(i)};React.useEffect(()=>{R(!0)},[g]),React.useEffect(()=>{l===!1&&se()},[l]),React.useEffect(()=>{Z()},[]),React.useEffect(()=>{n.current.exportData=()=>[[a],{duration:M,valid:b}],n.current.setResult=ge,n.current.clearResult=pe,n.current.currentPageResult=a==null?void 0:a.regions,n.current.emit("updatePageNumber"),n.current.setSelectedRegion=U,n.current.setValid=me},[a,b]);const U=e=>{lbAnnotation.EventBus.emit("setSelectedRegion",{id:e,isLoopStatus:!0,playImmediately:!0})},Z=()=>{n.current.emit=e=>{const i=n.current.fns.get(e);i&&i.forEach(u=>{u&&(u==null||u())})},n.current.fns=new Map,n.current.singleOn=(e,i)=>{n.current.fns.set(e,[i])},n.current.on=(e,i)=>{n.current.singleOn(e,i)},n.current.unbindAll=e=>{n.current.fns.delete(e)}},B=React.useMemo(()=>{const e=k[`step_${h==null?void 0:h.step}`];return(e==null?void 0:e.result)||[]},[T,k,h]),{tagConfigurable:z,textConfigurable:F=!0,clipConfigurable:X=!1,clipAttributeConfigurable:G=!1,clipAttributeList:H=[],clipTextConfigurable:V=!1,subAttributeList:ee=[],secondaryAttributeConfigurable:te=!1,inputList:ne=[],configList:oe=[],clipTextList:J=index$1.DEFAULT_CLIP_TEXT_CONFIG_ITEM}=React.useMemo(()=>{if(P)return lbAnnotation.CommonToolUtils.jsonParser(P==null?void 0:P.config)},[P]),le={clipConfigurable:X,clipAttributeConfigurable:G,clipAttributeList:H,clipTextConfigurable:V,subAttributeList:ee,secondaryAttributeConfigurable:te,clipTextList:J},ie=(x=(f=lbAnnotation.CommonToolUtils.jsonParser(I.result))==null?void 0:f.duration)!=null?x:0,ae=b?ie:0,re=!b||l||![F,V].includes(!0)||O;let Q={};if(g!==-1&&(y==null?void 0:y.length)){const e=(d=y[g])==null?void 0:d.preResult,i=(s==null?void 0:s.isEdit)?(E=s==null?void 0:s.stepConfig)==null?void 0:E.loadPreStep:h==null?void 0:h.loadPreStep;if(e&&i){const u=lbAnnotation.CommonToolUtils.jsonParser(e),_=(A=(C=u==null?void 0:u.config)==null?void 0:C.context)!=null?A:{};Object.keys(_).forEach(q=>{q&&_[q]&&(Q[q]={visible:!0,content:_[q],type:q})})}}const se=()=>{(B==null?void 0:B.length)>0?p(B[0]):p({id:lbAnnotation.uuid(),sourceID:"",value:Y(),tag:ue(),regions:[]});const e=audio.isImageValue(y[g].result||"[]");w(e)},Y=(e=!0)=>{const i={};let u=T.configList||[];return u.length>0&&u.forEach(_=>{i[_.key]=e&&_.default||""}),i},ue=()=>lbAnnotation.TagUtils.getDefaultResultByConfig(T.inputList||[]),de=({duration:e,hasError:i})=>{(s==null?void 0:s.onLoaded)&&(s==null||s.onLoaded()),R(!1),N(e)},ce=ahooks.useMemoizedFn(e=>{p(__spreadProps(__spreadValues({},a||{}),{regions:((a==null?void 0:a.regions)||[]).filter(i=>i.id!==e)}))}),K=ahooks.useMemoizedFn(e=>{var i;const u=(i=a==null?void 0:a.regions)!=null?i:[],{id:_}=e,q=u.find($=>$.id===_);let W=[];q?W=u.map($=>_===$.id?__spreadValues(__spreadValues({},$),e):$):W=[...u,e],p(__spreadProps(__spreadValues({},a),{regions:W}))}),fe=(e,i)=>{const u=__spreadProps(__spreadValues({},a),{value:__spreadProps(__spreadValues({},a.value),{[i]:e})});p(u)},ve=e=>{const i=__spreadProps(__spreadValues({},a),{tag:e});p(i)},ge=e=>{p(e)},pe=()=>{const e=__spreadProps(__spreadValues({},a),{value:Y(),tag:{},regions:[]});p(e),lbAnnotation.EventBus.emit("clearRegions")},me=e=>{w(e)};return React__default.default.createElement(index$1.AudioClipProvider,null,React__default.default.createElement(antd.Spin,{spinning:l,wrapperClassName:"audio-tool-spinner"},React__default.default.createElement(es.Layout,{className:dom.getClassName("layout","container"),style:{height:"100%",userSelect:"none"}},t==null?void 0:t.leftSider,React__default.default.createElement(Content,{className:`${layoutCls}__content`},React__default.default.createElement("div",{className:index_module.containerWrapper},React__default.default.createElement("div",{className:index_module.audioWrapper},z&&React__default.default.createElement(index$2,{result:a==null?void 0:a.tag,labelInfoSet:ne,hasPromptLayer:!!(s==null?void 0:s.promptLayer)}),s==null?void 0:s.promptLayer,React__default.default.createElement(index$3.AudioPlayer,__spreadValues({context:{isEdit:s==null?void 0:s.isEdit,count:ae,toolName:EAudioToolName.AudioTextTool,imgIndex:g},drawLayerSlot:j,fileData:I,onLoaded:de,invalid:!b,updateRegion:K,removeRegion:ce,regions:a==null?void 0:a.regions,activeToolPanel:s==null?void 0:s.activeToolPanel,footer:t.footer,isCheck:O},le))),(F||V)&&React__default.default.createElement(AudioTextToolTextarea,{preContext:Q,result:a,inputDisabled:re,updateText:fe,updateRegion:K,configList:oe,autofocus:!1,textConfigurable:F,clipTextConfigurable:V,clipAttributeList:H,clipAttributeConfigurable:G,clipTextList:J,isCheck:O}))),React__default.default.createElement(Sider,{className:`${layoutCls}__side`,width:S!=null?S:240,style:(m=t.style)==null?void 0:m.sider},React__default.default.createElement(AudioSideBar,{sider:D,config:T,result:a,updateTagResult:ve,updateRegion:K,isEdit:s==null?void 0:s.isEdit,tagConfigurable:z,clipConfigurable:X})),React__default.default.createElement(index$4,null))))};var AudioAnnotate$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(AudioAnnotate);module.exports=AudioAnnotate$1;
|
|
1
|
+
"use strict";var React=require("react"),index$3=require("../audioPlayer/index.js"),dom=require("../../utils/dom.js"),index$4=require("../predictTracking/previewResult/index.js"),es=require("antd/es"),antd=require("antd"),index$5=require("../../constant/index.js"),lbAnnotation=require("@labelbee/lb-annotation"),index_module=require("./index.module.scss.js"),index$2=require("./tagResultShow/index.js"),index$1=require("./audioContext/index.js"),index$6=require("./textInput/index.js"),reactRedux=require("react-redux"),map=require("../../store/annotation/map.js"),ctx=require("../../store/ctx.js"),index=require("../../utils/index.js"),annotation=require("../../hooks/annotation.js"),index$7=require("../../views/MainView/sidebar/index.js"),index$8=require("./audioSide/labelSidebar/index.js"),index$9=require("./audioSide/clipSidebar/index.js"),tag=require("../../assets/annotation/audio/tag.svg.js"),tagA=require("../../assets/annotation/audio/tagA.svg.js"),clip=require("../../assets/annotation/audio/clip.svg.js"),clipA=require("../../assets/annotation/audio/clipA.svg.js"),audio=require("../../utils/audio.js"),dataTransform=require("./utils/dataTransform.js"),ahooks=require("ahooks");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,l,s)=>l in t?__defProp(t,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[l]=s,__spreadValues=(t,l)=>{for(var s in l||(l={}))__hasOwnProp.call(l,s)&&__defNormalProp(t,s,l[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(l))__propIsEnum.call(l,s)&&__defNormalProp(t,s,l[s]);return t},__spreadProps=(t,l)=>__defProps(t,__getOwnPropDescs(l));const{EAudioToolName}=lbAnnotation.cTool,EKeyCode=lbAnnotation.cKeyCode.default,{Sider,Content}=es.Layout,layoutCls=`${index$5.prefix}-layout`,ToggleAudioOption=({setSideTab:t,sideTab:l})=>{const s=[{tab:"tag",commonSvg:tag,selectedSvg:tagA},{tab:"clip",commonSvg:clip,selectedSvg:clipA}];return React__default.default.createElement("div",{className:index_module.toggleAudioOption},s.map((g,E)=>{const{tab:c,selectedSvg:S,commonSvg:R}=g;return React__default.default.createElement("div",{key:E,className:index_module.option},React__default.default.createElement("img",{className:index_module.icon,src:l===c?S:R,onClick:()=>{l!==c&&t(c)}}))}))},AudioTextToolTextarea=({result:t,inputDisabled:l,updateText:s,configList:g,autofocus:E,preContext:c,isCheck:S,clipAttributeConfigurable:R,clipTextConfigurable:q,textConfigurable:p,updateRegion:y,clipAttributeList:I,clipTextList:f})=>React__default.default.createElement(index$6.default,{isCheck:S,result:t==null?void 0:t.value,textInputDisabled:l,textID:(t==null?void 0:t.id)||0,updateText:s,configList:g,autofocus:!l&&E,preContext:c,regions:t==null?void 0:t.regions,clipAttributeConfigurable:R,clipTextConfigurable:q,textConfigurable:p,updateRegion:y,clipAttributeList:I,clipTextList:f}),AudioSideBar=t=>{var l,s;const{sider:g,config:E,result:c,updateTagResult:S,updateRegion:R,isEdit:q,tagConfigurable:p,clipConfigurable:y,valid:I}=t;let f=(E==null?void 0:E.inputList)||[],n=(l=c==null?void 0:c.tag)!=null?l:{},V=(s=c==null?void 0:c.regions)!=null?s:[];const[N,m]=React.useState([]),[b,_]=React.useState("tag");React.useEffect(()=>{if(!p&&y){_("clip");return}_("tag")},[p,y]),React.useEffect(()=>(window.addEventListener("keydown",j),()=>{window.removeEventListener("keydown",j)}));const j=a=>{if(p&&y)switch(a.keyCode){case EKeyCode.L:_("tag");break;case EKeyCode.X:_("clip");break}if(b==="tag"){if(!lbAnnotation.CommonToolUtils.hotkeyFilter(a))return;lbAnnotation.CommonToolUtils.isMoveKey(a==null?void 0:a.keyCode)&&a.preventDefault();let r=a.keyCode;if(r&&(r<=57&&r>=49||r<=105&&r>=97)){r>57?r=r-97:r=r-49;const o=N.slice();f.length===1?(C(0,r),m([0,r]),setTimeout(()=>{m([])},500)):o.length===1?(C(o[0],r),m([o[0],r]),setTimeout(()=>{m([])},500)):m([r])}}},C=(a,r)=>{if(a<f.length&&f[a].subSelected&&r<f[a].subSelected.length){const o=f[a].value,U=f[a].isMulti;let L=f[a].subSelected[r].value,$=0;const x=n;for(const P in n)if(P===f[a].value){if($++,U===!0){const v=x[P].split(";").filter(B=>B!==""),D=v.indexOf(L);D===-1?v.push(L):v.splice(D,1),L=v.join(";")}L===""?delete x[P]:x[P]=L}$===0&&Object.assign(n,{[o]:L}),S(n)}},O=a=>{delete n[a],S(n)},h=p&&y&&React__default.default.createElement(ToggleAudioOption,{setSideTab:_,sideTab:b}),A=b==="tag"&&React__default.default.createElement(index$8.default,{labelInfoSet:p?f:[],labelSelectedList:N,setLabel:C,tagResult:n,clearResult:O,isEdit:q,withPanelTab:!1}),u=b==="clip"&&React__default.default.createElement(index$9,{regions:V,updateRegion:R,useAudioClipStore:index$1.useAudioClipStore});return g?typeof g=="function"?React__default.default.createElement("div",{className:`${index$7.sidebarCls}`},g({toggleAudioOption:h,labelSidebar:A,clipSidebar:u,valid:I})):g:React__default.default.createElement("div",{className:`${index$7.sidebarCls}`},React__default.default.createElement("div",{className:`${index$7.sidebarCls}__content`},h,A,u))},AudioAnnotate=t=>{var l,s,g,E,c,S,R,q,p;const y=(s=(l=t.style)==null?void 0:l.sider)==null?void 0:s.width,{step:I,stepList:f,audioContext:n,sider:V,drawLayerSlot:N,imgList:m,imgIndex:b,currentData:_,config:j,stepInfo:C,checkMode:O}=t,h=lbAnnotation.CommonToolUtils.getCurrentStepToolAndConfig(I,f),A=index.jsonParser(_.result),{toolInstanceRef:u}=annotation.useCustomToolInstance({basicInfo:A}),[a,r]=React.useState(!0),[o,U]=React.useState(null),[L,$]=React.useState(0),[x,P]=React.useState(!0),v=e=>{if(!e)return;const i=dataTransform.fixData(e);U(i)};React.useEffect(()=>{r(!0)},[b]),React.useEffect(()=>{a===!1&&se()},[a]),React.useEffect(()=>{B()},[]),React.useEffect(()=>{u.current.exportData=()=>[[o],{duration:L,valid:x}],u.current.setResult=ge,u.current.clearResult=pe,u.current.currentPageResult=o==null?void 0:o.regions,u.current.emit("updatePageNumber"),u.current.setSelectedRegion=D,u.current.setValid=me},[o,x]);const D=e=>{lbAnnotation.EventBus.emit("setSelectedRegion",{id:e,isLoopStatus:!0,playImmediately:!0})},B=()=>{u.current.emit=e=>{const i=u.current.fns.get(e);i&&i.forEach(d=>{d&&(d==null||d())})},u.current.fns=new Map,u.current.singleOn=(e,i)=>{u.current.fns.set(e,[i])},u.current.on=(e,i)=>{u.current.singleOn(e,i)},u.current.unbindAll=e=>{u.current.fns.delete(e)}},F=React.useMemo(()=>{const e=A[`step_${C==null?void 0:C.step}`];return(e==null?void 0:e.result)||[]},[j,A,C]),{tagConfigurable:X,textConfigurable:K=!0,clipConfigurable:G=!1,clipAttributeConfigurable:H=!1,clipAttributeList:J=[],clipTextConfigurable:M=!1,subAttributeList:ee=[],secondaryAttributeConfigurable:te=!1,inputList:ne=[],configList:oe=[],clipTextList:Q=index$1.DEFAULT_CLIP_TEXT_CONFIG_ITEM}=React.useMemo(()=>{if(h)return lbAnnotation.CommonToolUtils.jsonParser(h==null?void 0:h.config)},[h]),le={clipConfigurable:G,clipAttributeConfigurable:H,clipAttributeList:J,clipTextConfigurable:M,subAttributeList:ee,secondaryAttributeConfigurable:te,clipTextList:Q},ie=(E=(g=lbAnnotation.CommonToolUtils.jsonParser(_.result))==null?void 0:g.duration)!=null?E:0,ae=x?ie:0,re=!x||a||![K,M].includes(!0)||O;let Y={};if(b!==-1&&(m==null?void 0:m.length)){const e=(c=m[b])==null?void 0:c.preResult,i=(n==null?void 0:n.isEdit)?(S=n==null?void 0:n.stepConfig)==null?void 0:S.loadPreStep:C==null?void 0:C.loadPreStep;if(e&&i){const d=lbAnnotation.CommonToolUtils.jsonParser(e),T=(q=(R=d==null?void 0:d.config)==null?void 0:R.context)!=null?q:{};Object.keys(T).forEach(w=>{w&&T[w]&&(Y[w]={visible:!0,content:T[w],type:w})})}}const se=()=>{(F==null?void 0:F.length)>0?v(F[0]):v({id:lbAnnotation.uuid(),sourceID:"",value:Z(),tag:ue(),regions:[]});const e=audio.isImageValue(m[b].result||"[]");P(e)},Z=(e=!0)=>{const i={};let d=j.configList||[];return d.length>0&&d.forEach(T=>{i[T.key]=e&&T.default||""}),i},ue=()=>lbAnnotation.TagUtils.getDefaultResultByConfig(j.inputList||[]),de=({duration:e,hasError:i})=>{(n==null?void 0:n.onLoaded)&&(n==null||n.onLoaded()),r(!1),$(e)},ce=ahooks.useMemoizedFn(e=>{v(__spreadProps(__spreadValues({},o||{}),{regions:((o==null?void 0:o.regions)||[]).filter(i=>i.id!==e)}))}),W=ahooks.useMemoizedFn(e=>{var i;const d=(i=o==null?void 0:o.regions)!=null?i:[],{id:T}=e,w=d.find(k=>k.id===T);let z=[];w?z=d.map(k=>T===k.id?__spreadValues(__spreadValues({},k),e):k):z=[...d,e],v(__spreadProps(__spreadValues({},o),{regions:z}))}),fe=(e,i)=>{const d=__spreadProps(__spreadValues({},o),{value:__spreadProps(__spreadValues({},o.value),{[i]:e})});v(d)},ve=e=>{const i=__spreadProps(__spreadValues({},o),{tag:e});v(i)},ge=e=>{v(e)},pe=()=>{const e=__spreadProps(__spreadValues({},o),{value:Z(),tag:{},regions:[]});v(e),lbAnnotation.EventBus.emit("clearRegions")},me=e=>{P(e)};return React__default.default.createElement(index$1.AudioClipProvider,null,React__default.default.createElement(antd.Spin,{spinning:a,wrapperClassName:"audio-tool-spinner"},React__default.default.createElement(es.Layout,{className:dom.getClassName("layout","container"),style:{height:"100%",userSelect:"none"}},t==null?void 0:t.leftSider,React__default.default.createElement(Content,{className:`${layoutCls}__content`},React__default.default.createElement("div",{className:index_module.containerWrapper},React__default.default.createElement("div",{className:index_module.audioWrapper},X&&React__default.default.createElement(index$2,{result:o==null?void 0:o.tag,labelInfoSet:ne,hasPromptLayer:!!(n==null?void 0:n.promptLayer)}),n==null?void 0:n.promptLayer,React__default.default.createElement(index$3.AudioPlayer,__spreadValues({context:{isEdit:n==null?void 0:n.isEdit,count:ae,toolName:EAudioToolName.AudioTextTool,imgIndex:b},drawLayerSlot:N,fileData:_,onLoaded:de,invalid:!x,updateRegion:W,removeRegion:ce,regions:o==null?void 0:o.regions,activeToolPanel:n==null?void 0:n.activeToolPanel,footer:t.footer,isCheck:O},le))),(K||M)&&React__default.default.createElement(AudioTextToolTextarea,{preContext:Y,result:o,inputDisabled:re,updateText:fe,updateRegion:W,configList:oe,autofocus:!1,textConfigurable:K,clipTextConfigurable:M,clipAttributeList:J,clipAttributeConfigurable:H,clipTextList:Q,isCheck:O}))),React__default.default.createElement(Sider,{className:`${layoutCls}__side`,width:y!=null?y:240,style:(p=t.style)==null?void 0:p.sider},React__default.default.createElement(AudioSideBar,{sider:V,config:j,result:o,updateTagResult:ve,updateRegion:W,isEdit:n==null?void 0:n.isEdit,tagConfigurable:X,clipConfigurable:G,valid:x})),React__default.default.createElement(index$4,null))))};var AudioAnnotate$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(AudioAnnotate);module.exports=AudioAnnotate$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),PointCloudSegmentListener=require("./PointCloudSegmentListener.js"),PointCloudSegment=require("./PointCloudSegment.js"),PointCloudSegmentStatus=require("./PointCloudSegmentStatus.js"),PointCloudSegmentToolbar=require("./PointCloudSegmentToolbar.js"),PointCloudSegment2DView=require("./PointCloudSegment2DView.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index$1=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),annotation=require("../../hooks/annotation.js"),index=require("../../utils/index.js"),map=require("../../store/annotation/map.js"),classNames=require("classnames"),index$2=require("./components/sideAndBackOverView/index.js"),actionCreators=require("../../store/annotation/actionCreators.js");function _interopDefaultLegacy(
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloud3DView=require("./PointCloud3DView.js"),PointCloudBackView=require("./PointCloudBackView.js"),PointCloudTopView=require("./PointCloudTopView.js"),PointCloudSideView=require("./PointCloudSideView.js"),PointCloud2DView=require("./PointCloud2DView.js"),PointCloudListener=require("./PointCloudListener.js"),PointCloudSegmentListener=require("./PointCloudSegmentListener.js"),PointCloudSegment=require("./PointCloudSegment.js"),PointCloudSegmentStatus=require("./PointCloudSegmentStatus.js"),PointCloudSegmentToolbar=require("./PointCloudSegmentToolbar.js"),PointCloudSegment2DView=require("./PointCloudSegment2DView.js"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index$1=require("../../views/MainView/toolFooter/AnnotatedAttributes/index.js"),PointCloudContext=require("./PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),annotation=require("../../hooks/annotation.js"),index=require("../../utils/index.js"),map=require("../../store/annotation/map.js"),classNames=require("classnames"),index$2=require("./components/sideAndBackOverView/index.js"),actionCreators=require("../../store/annotation/actionCreators.js"),DynamicResizer=require("../DynamicResizer/DynamicResizer.js");function _interopDefaultLegacy(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames);const PointCloudView=i=>{const{currentData:s,imgList:L,drawLayerSlot:m,checkMode:l,intelligentFit:h,imgIndex:x,config:S,measureVisible:q,setResourceLoading:C,stepInfo:t}=i,e=React.useContext(PointCloudContext.PointCloudContext),{globalPattern:f,setGlobalPattern:w,selectedIDs:v}=e,b=ctx.useDispatch(),g=React.useRef(null),p=React.useRef(null),[j,D]=React.useState(0),[a,P]=React.useState(!1),V=(v==null?void 0:v.length)>0&&a,N=index.jsonParser(s.result),{toolInstanceRef:r,clearToolInstance:y}=annotation.useCustomToolInstance({basicInfo:N});if(React.useEffect(()=>{r.current.setPointCloudGlobalPattern=n=>{n!==f&&(w(n),e.clearAllDetectionInstance(),y())}},[f]),React.useEffect(()=>{var n;if(actionCreators.SetLoadPCDFileLoading(b,!0),s){const{boxParamsList:o,polygonList:u,lineList:d,sphereParamsList:c,segmentation:R,rectList:I}=lbUtils.PointCloudUtils.parsePointCloudCurrentResult((n=s==null?void 0:s.result)!=null?n:"");e.setPointCloudResult(o),e.setPolygonList(u),e.setLineList(d),e.setPointCloudSphereList(c),e.setRectList(I),e.setSegmentation(R)}},[x]),React.useEffect(()=>{var n;if(g.current){const o=((n=g.current)==null?void 0:n.offsetHeight)-233;D(o)}},[p.current]),React.useEffect(()=>{r.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],r.current.exportCustomData=()=>{var n,o,u,d,c;return{resultPolygon:(n=e.polygonList)!=null?n:[],resultLine:(o=e.lineList)!=null?o:[],resultPoint:(u=e.pointCloudSphereList)!=null?u:[],resultRect:(d=e.rectList)!=null?d:[],segmentation:(c=e.segmentation)!=null?c:[]}}},[e.pointCloudBoxList,e.rectList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),L.length===0)return null;if(f===lbUtils.EPointCloudPattern.Segmentation)return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegmentListener,{checkMode:l,toolInstanceRef:r}),React__default.default.createElement(PointCloudSegmentToolbar,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout")},React__default.default.createElement(PointCloudSegment,{checkMode:l}),React__default.default.createElement(PointCloudSegment2DView,null)),React__default.default.createElement(PointCloudSegmentStatus,{config:S}),m==null?void 0:m({direct:!0}));let E=React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left-bottom")},React__default.default.createElement(PointCloudBackView,{checkMode:l}),React__default.default.createElement(PointCloudSideView,{checkMode:l}));return a&&(E=React__default.default.createElement(index$2,{selectAndEnlarge:V,checkMode:l})),React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudListener,{checkMode:l,toolInstanceRef:r,setResourceLoading:C}),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-layout"),onContextMenu:n=>n.preventDefault()},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-wrapper")},React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedLeft,null),React__default.default.createElement("div",{className:dom.getClassName("point-cloud-content"),ref:p},React__default.default.createElement(DynamicResizer,{direction:"horizontal",localKey:"leftAllViewid:"+(t==null?void 0:t.id)+"taskID:"+(t==null?void 0:t.taskID)+"step:"+(t==null?void 0:t.step)+"type:"+(t==null?void 0:t.type),defaultWidth:360,minLeftWidth:244,minRightWidth:"50%"},React__default.default.createElement("div",{className:dom.getClassName("point-cloud-container","left")},React__default.default.createElement(PointCloud3DView,{setResourceLoading:C}),E),React__default.default.createElement("div",{className:classNames__default.default({[dom.getClassName("point-cloud-container","right")]:!0,[dom.getClassName("point-cloud-container","rightZoom")]:a}),ref:g},React__default.default.createElement(DynamicResizer,{localKey:"rightAllViewid:"+(t==null?void 0:t.id)+"taskID:"+(t==null?void 0:t.taskID)+"step:"+(t==null?void 0:t.step)+"type:"+(t==null?void 0:t.type),defaultHeight:300,minTopHeight:j,minBottomHeight:160},React__default.default.createElement(PointCloudTopView,{drawLayerSlot:m,checkMode:l,intelligentFit:h,setIsEnlargeTopView:P,onExitZoom:()=>{P(!1)},isEnlargeTopView:a}),React__default.default.createElement("div",{className:classNames__default.default({[dom.getClassName("point-cloud-container","right-bottom")]:!a,[dom.getClassName("point-cloud-container","right-bottom-floatLeft")]:a})},React__default.default.createElement(PointCloud2DView,{isEnlargeTopView:a,thumbnailWidth:a?300:455,checkMode:l,measureVisible:q})))))),React__default.default.createElement(index$1.AnnotatedAttributesPanelFixedRight,null))))};var PointCloudView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudView);module.exports=PointCloudView$1;
|
package/dist/index.css
CHANGED
|
@@ -81,73 +81,62 @@
|
|
|
81
81
|
margin-right: 8px;
|
|
82
82
|
}
|
|
83
83
|
.dynamic-resizer-content {
|
|
84
|
+
display: flex;
|
|
84
85
|
width: 100%;
|
|
85
86
|
height: 100%;
|
|
86
|
-
flex-shrink: 0;
|
|
87
|
-
flex-grow: 0;
|
|
88
87
|
position: relative;
|
|
88
|
+
overflow: hidden;
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
position: absolute;
|
|
95
|
-
top: -5px;
|
|
96
|
-
left: 0;
|
|
97
|
-
cursor: row-resize;
|
|
98
|
-
user-select: none;
|
|
99
|
-
display: flex;
|
|
100
|
-
align-items: center;
|
|
90
|
+
.dynamic-resizer-content.horizontal {
|
|
91
|
+
flex-direction: row;
|
|
92
|
+
}
|
|
93
|
+
.dynamic-resizer-content.vertical {
|
|
101
94
|
flex-direction: column;
|
|
102
|
-
justify-content: center;
|
|
103
95
|
}
|
|
104
|
-
.
|
|
105
|
-
display:
|
|
96
|
+
.dynamic-resizer-content .resizable-container {
|
|
97
|
+
display: flex;
|
|
106
98
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
.dynamic-resizer-content .resizable-child {
|
|
100
|
+
width: 100%;
|
|
101
|
+
height: 100%;
|
|
102
|
+
}
|
|
103
|
+
.dynamic-resizer-content .resizable-child-two {
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: 100%;
|
|
106
|
+
overflow-y: auto;
|
|
107
|
+
position: relative;
|
|
108
|
+
}
|
|
109
|
+
.dynamic-resizer-content .divider-all {
|
|
111
110
|
width: 20px;
|
|
112
111
|
height: 20px;
|
|
113
|
-
cursor: pointer;
|
|
114
|
-
display: none;
|
|
115
|
-
user-select: none;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.divider-all {
|
|
119
112
|
position: absolute;
|
|
120
|
-
top:
|
|
113
|
+
top: 0;
|
|
121
114
|
left: 50%;
|
|
122
|
-
transform: translate(-50%);
|
|
115
|
+
transform: translate(-50%, -50%);
|
|
116
|
+
z-index: 1;
|
|
123
117
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
width:
|
|
127
|
-
height:
|
|
128
|
-
|
|
118
|
+
.dynamic-resizer-content .split-divider {
|
|
119
|
+
background-color: #ccc;
|
|
120
|
+
width: 5px;
|
|
121
|
+
height: 100%;
|
|
122
|
+
}
|
|
123
|
+
.dynamic-resizer-content .dynamic-right-handle {
|
|
124
|
+
cursor: ew-resize !important;
|
|
125
|
+
z-index: 100;
|
|
129
126
|
}
|
|
130
|
-
.
|
|
127
|
+
.dynamic-resizer-content .dynamic-bottom-handle {
|
|
128
|
+
cursor: ns-resize !important;
|
|
129
|
+
z-index: 100;
|
|
130
|
+
}
|
|
131
|
+
.dynamic-resizer-content .dynamic-bottom-handle::after {
|
|
131
132
|
content: "";
|
|
132
|
-
display: block;
|
|
133
133
|
position: absolute;
|
|
134
|
-
top: 50%;
|
|
135
134
|
left: 0;
|
|
136
135
|
right: 0;
|
|
137
|
-
|
|
136
|
+
top: 50%;
|
|
137
|
+
transform: translateY(-50%);
|
|
138
138
|
height: 1px;
|
|
139
139
|
background: #ccc;
|
|
140
|
-
margin: 0 auto;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.dynamic-resizer-top {
|
|
144
|
-
width: 100%;
|
|
145
|
-
overflow-y: auto;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.dynamic-resizer-bottom {
|
|
149
|
-
width: 100%;
|
|
150
|
-
overflow-y: auto;
|
|
151
140
|
}
|
|
152
141
|
|
|
153
142
|
.hide-scrollbar * {
|
|
@@ -2623,17 +2612,22 @@
|
|
|
2623
2612
|
line-height: 40px;
|
|
2624
2613
|
display: flex;
|
|
2625
2614
|
justify-content: space-between;
|
|
2615
|
+
height: auto;
|
|
2626
2616
|
}
|
|
2627
2617
|
.bee-point-cloud-wrapper .bee-point-cloud-container__header-title {
|
|
2628
|
-
flex:
|
|
2618
|
+
flex-shrink: 0;
|
|
2629
2619
|
overflow: hidden;
|
|
2630
2620
|
text-overflow: ellipsis;
|
|
2631
2621
|
font-weight: 500;
|
|
2622
|
+
height: 40px;
|
|
2632
2623
|
}
|
|
2633
2624
|
.bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar {
|
|
2625
|
+
flex: 1;
|
|
2634
2626
|
display: flex;
|
|
2635
2627
|
align-items: center;
|
|
2636
2628
|
font-size: 14px;
|
|
2629
|
+
flex-wrap: wrap;
|
|
2630
|
+
justify-content: flex-end;
|
|
2637
2631
|
}
|
|
2638
2632
|
.bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar .bee-point-cloud__rotate-reserve {
|
|
2639
2633
|
display: inline-block;
|
|
@@ -2721,7 +2715,7 @@
|
|
|
2721
2715
|
display: none;
|
|
2722
2716
|
}
|
|
2723
2717
|
.bee-point-cloud-wrapper .bee-point-cloud-container__left {
|
|
2724
|
-
width:
|
|
2718
|
+
width: 100%;
|
|
2725
2719
|
display: flex;
|
|
2726
2720
|
flex-direction: column;
|
|
2727
2721
|
border-right: 1px solid #fff;
|
|
@@ -2730,6 +2724,7 @@
|
|
|
2730
2724
|
flex-shrink: 0;
|
|
2731
2725
|
}
|
|
2732
2726
|
.bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-3d-container {
|
|
2727
|
+
background: #444;
|
|
2733
2728
|
display: flex;
|
|
2734
2729
|
flex-direction: column;
|
|
2735
2730
|
overflow: hidden;
|
|
@@ -2888,7 +2883,7 @@
|
|
|
2888
2883
|
}
|
|
2889
2884
|
.bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-container__left-bottom .bee-point-cloud-container__side-view .bee-point-cloud-container__bottom-view-content,
|
|
2890
2885
|
.bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-container__left-bottom .bee-point-cloud-container__back-view .bee-point-cloud-container__bottom-view-content {
|
|
2891
|
-
|
|
2886
|
+
height: 100%;
|
|
2892
2887
|
}
|
|
2893
2888
|
.bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-container__left-bottom .bee-point-cloud-container__side-view .bee-point-cloud-container__bottom-view-content .bee-point-cloud-container__core-instance,
|
|
2894
2889
|
.bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-container__left-bottom .bee-point-cloud-container__back-view .bee-point-cloud-container__bottom-view-content .bee-point-cloud-container__core-instance {
|
|
@@ -2917,13 +2912,15 @@
|
|
|
2917
2912
|
font-size: 14px;
|
|
2918
2913
|
}
|
|
2919
2914
|
.bee-point-cloud-wrapper .bee-point-cloud-container__right {
|
|
2920
|
-
|
|
2915
|
+
width: 100%;
|
|
2916
|
+
height: 100%;
|
|
2921
2917
|
display: flex;
|
|
2922
2918
|
flex-direction: column;
|
|
2923
2919
|
overflow: hidden;
|
|
2924
2920
|
background-color: #444;
|
|
2925
2921
|
}
|
|
2926
2922
|
.bee-point-cloud-wrapper .bee-point-cloud-container__right .bee-point-cloud-container__top-view {
|
|
2923
|
+
height: 100%;
|
|
2927
2924
|
border-bottom: 1px solid #fff;
|
|
2928
2925
|
overflow: hidden;
|
|
2929
2926
|
display: flex;
|
|
@@ -2952,7 +2949,7 @@
|
|
|
2952
2949
|
border-bottom: 1px solid #fff;
|
|
2953
2950
|
}
|
|
2954
2951
|
.bee-point-cloud-wrapper .bee-point-cloud-container__right .bee-point-cloud-container__right-bottom {
|
|
2955
|
-
|
|
2952
|
+
height: 100%;
|
|
2956
2953
|
display: flex;
|
|
2957
2954
|
overflow: auto;
|
|
2958
2955
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import './DynamicResizer.scss';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import { DynamicResizerProps } from './types/interface';
|
|
4
|
-
|
|
3
|
+
import './styles.scss';
|
|
4
|
+
declare const DynamicResizer: React.FC<DynamicResizerProps>;
|
|
5
5
|
export default DynamicResizer;
|
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { DragProps } from '../types/interface';
|
|
3
|
-
declare const useDrag: ({ containerRef, minTopHeight, minBottomHeight,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
height: string;
|
|
2
|
+
declare const useDrag: ({ containerRef, direction, defaultHeight, defaultWidth, minTopHeight, minBottomHeight, minLeftWidth, minRightWidth, localKey, enableEdges, onResizeStart, onResize, onResizeStop, }: DragProps) => {
|
|
3
|
+
size: {
|
|
4
|
+
width: string | number;
|
|
5
|
+
height: string | number;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
onResizeStart: () => void;
|
|
8
|
+
onResize: () => void;
|
|
9
|
+
onResizeStop: (e: any, direction: any, ref: HTMLElement) => void;
|
|
10
|
+
enable: {
|
|
11
|
+
top: boolean | undefined;
|
|
12
|
+
bottom: boolean | undefined;
|
|
13
|
+
left: boolean | undefined;
|
|
14
|
+
right: boolean | undefined;
|
|
15
|
+
topLeft: boolean;
|
|
16
|
+
ropRight: boolean;
|
|
17
|
+
bottomLeft: boolean;
|
|
18
|
+
bottomRight: boolean;
|
|
10
19
|
};
|
|
20
|
+
handleClasses: {
|
|
21
|
+
right: string;
|
|
22
|
+
bottom: string;
|
|
23
|
+
};
|
|
24
|
+
minWidth: string | number | undefined;
|
|
25
|
+
maxWidth: string | number | undefined;
|
|
26
|
+
minHeight: string | number | undefined;
|
|
27
|
+
maxHeight: string | number | undefined;
|
|
11
28
|
};
|
|
12
29
|
export default useDrag;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EdgeDirection, ResizableDirection } from '../types/interface';
|
|
2
|
+
declare const useDraggingAllowed: (direction?: ResizableDirection, enableEdges?: EdgeDirection[]) => {
|
|
3
|
+
top: boolean | undefined;
|
|
4
|
+
bottom: boolean | undefined;
|
|
5
|
+
left: boolean | undefined;
|
|
6
|
+
right: boolean | undefined;
|
|
7
|
+
topLeft: boolean;
|
|
8
|
+
ropRight: boolean;
|
|
9
|
+
bottomLeft: boolean;
|
|
10
|
+
bottomRight: boolean;
|
|
11
|
+
};
|
|
12
|
+
export default useDraggingAllowed;
|
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const useUpdateHeight: (containerRef
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
bottom: number;
|
|
12
|
-
};
|
|
13
|
-
topStyle: {
|
|
14
|
-
height: string;
|
|
15
|
-
};
|
|
16
|
-
bottomStyle: {
|
|
17
|
-
height: string;
|
|
18
|
-
};
|
|
19
|
-
updateELHeight: (newTopHeight: number) => void;
|
|
20
|
-
setBottomHeightToZero: () => void;
|
|
21
|
-
setTopHeightToZero: () => void;
|
|
1
|
+
import { DragProps } from '../types/interface';
|
|
2
|
+
declare const useUpdateHeight: ({ containerRef, direction, defaultHeight, defaultWidth, minTopHeight, minBottomHeight, minLeftWidth, minRightWidth, localKey, }: DragProps) => {
|
|
3
|
+
width: string | number;
|
|
4
|
+
height: string | number;
|
|
5
|
+
minWidth: string | number | undefined;
|
|
6
|
+
minHeight: string | number | undefined;
|
|
7
|
+
maxWidth: string | number | undefined;
|
|
8
|
+
maxHeight: string | number | undefined;
|
|
9
|
+
updateWidth: (width: number) => void;
|
|
10
|
+
updateHeight: (height: number) => void;
|
|
22
11
|
};
|
|
23
12
|
export default useUpdateHeight;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { ReactElement, RefObject } from 'react';
|
|
2
|
+
export type ResizableDirection = 'horizontal' | 'vertical';
|
|
3
|
+
export type EdgeDirection = 'top' | 'bottom' | 'left' | 'right';
|
|
2
4
|
interface Common {
|
|
5
|
+
direction?: ResizableDirection;
|
|
6
|
+
defaultWidth?: number;
|
|
3
7
|
defaultHeight?: number;
|
|
4
|
-
minTopHeight?: number;
|
|
5
|
-
minBottomHeight?: number;
|
|
6
|
-
|
|
8
|
+
minTopHeight?: number | string;
|
|
9
|
+
minBottomHeight?: number | string;
|
|
10
|
+
minLeftWidth?: number | string;
|
|
11
|
+
minRightWidth?: number | string;
|
|
7
12
|
localKey?: string;
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
enableEdges?: EdgeDirection[];
|
|
14
|
+
onResizeStart?: () => void;
|
|
15
|
+
onResize?: () => void;
|
|
16
|
+
onResizeStop?: () => void;
|
|
10
17
|
}
|
|
11
18
|
export interface DynamicResizerProps extends Common {
|
|
12
|
-
children: ReactElement[]
|
|
19
|
+
children: ReactElement[];
|
|
13
20
|
}
|
|
14
21
|
export interface DragProps extends Common {
|
|
15
22
|
containerRef: RefObject<HTMLDivElement>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const isValidSize: (value: any) => boolean;
|
|
2
|
+
export declare const calcMaxSize: (curSize: number | string, limitSize: number) => number;
|
|
3
|
+
export declare const calcMinSize: (curSize: number | string, totalSize: number) => number;
|
|
4
|
+
export declare const adjustDefaultSize: (curSize: number | string | undefined, minPrimarySize: number | string, minSecondarySize: number | string, containerSize: number | undefined, defaultSize: number) => number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),icons=require("@ant-design/icons"),ToolIcons=require("../ToolIcons.js"),ToolType=require("../../../../data/enums/ToolType.js"),lbAnnotation=require("@labelbee/lb-annotation"),PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),StepUtils=require("../../../../utils/StepUtils.js"),reactRedux=require("react-redux"),index=require("../../../../utils/index.js"),useStatus=require("../../../../components/pointCloudView/hooks/useStatus.js"),useSingleBox=require("../../../../components/pointCloudView/hooks/useSingleBox.js"),reactI18next=require("react-i18next"),ctx=require("../../../../store/ctx.js"),index$6=require("./components/batchUpdateModal/index.js"),index$1=require("./components/annotatedBox/index.js"),index$3=require("./components/rectRotateSensitivitySlider/index.js"),index$2=require("./components/findTrackIDIndex/index.js"),index$4=require("./components/firstFrameDataSwitch/index.js"),index$5=require("./components/selectBoxVisibleSwitch/index.js"),lbUtils=require("@labelbee/lb-utils"),index$7=require("../../../../components/attributeList/index.js"),useAttribute=require("../../../../components/pointCloudView/hooks/useAttribute.js"),lassoSelector=require("../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js"),lassoSelector_a=require("../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js"),circleSelector=require("../../../../assets/annotation/pointCloudTool/circleSelector.svg.js"),circleSelector_a=require("../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js"),icon_rect=require("../../../../assets/annotation/rectTool/icon_rect.svg.js"),icon_rect_a=require("../../../../assets/annotation/rectTool/icon_rect_a.svg.js"),index$9=require("../index.js"),actionCreators=require("../../../../store/annotation/actionCreators.js"),usePointCloudViews=require("../../../../components/pointCloudView/hooks/usePointCloudViews.js"),index$8=require("../../../../components/subAttributeList/index.js"),DynamicResizer=require("../../../../components/DynamicResizer/DynamicResizer.js"),_=require("lodash");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const BoxTrackIDInput=()=>{const[e,t]=React.useState(!1),n=React.useContext(PointCloudContext.PointCloudContext),{pointCloudBoxList:i}=n,{selectedBox:s,updateSelectedBox:o}=useSingleBox.useSingleBox(),[u,c]=React.useState(""),{t:v}=reactI18next.useTranslation(),m=s==null?void 0:s.info.trackID,r=React.useMemo(()=>_.isNumber(m)&&m>=0,[m]),a=d=>!!i.find(C=>C.trackID===d&&C.id!==(s==null?void 0:s.info.id)),g=(d=!1)=>{const p=parseInt(u,10);if(d&&t(!1),isNaN(p)){antd.message.error(v("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){antd.message.error(v("NotAllowDecimalPointsInTrackID"));return}if(a(p)){antd.message.error(v("DuplicateTrackIDsExist"));return}if(!(p>0)){antd.message.error(v("PositiveIntegerCheck"));return}f(p)};React.useEffect(()=>{t(!1)},[m]);const f=d=>{var p;const C=o({trackID:d});(p=n==null?void 0:n.topViewInstance)==null||p.updatePolygonList(C!=null?C:[]),n.mainViewInstance&&n.selectedPointCloudBox&&(n==null||n.mainViewInstance.generateBox(n==null?void 0:n.selectedPointCloudBox))};return React__default.default.createElement("div",{style:{padding:24}},React__default.default.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},React__default.default.createElement("span",null,v("CurrentBoxTrackIDs")),r&&React__default.default.createElement(index$6,{id:m,updateCurrentPolygonList:d=>f(d)})),React__default.default.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},e&&r?React__default.default.createElement(antd.Input,{defaultValue:m,onChange:d=>{c(d.target.value)},disabled:!r,size:"small",onBlur:()=>{g()},onPressEnter:()=>{g(!0)}}):React__default.default.createElement("span",null,m),React__default.default.createElement(icons.EditFilled,{style:{color:"#999",marginLeft:16,cursor:typeof m!="undefined"?"pointer":"not-allowed"},onClick:()=>{r&&t(!e)}})))},isAllowUpdateInSegment=({segmentStatus:e,globalPattern:t})=>t===lbUtils.EPointCloudPattern.Segmentation&&![lbUtils.EPointCloudSegmentStatus.Edit,lbUtils.EPointCloudSegmentStatus.Ready].includes(e),AttributeUpdater=({attributeList:e,subAttributeList:t,toolInstance:n,config:i,stepList:s,stepInfo:o,enableColorPicker:u})=>{const[c,v]=React.useState({segmentStatus:lbUtils.EPointCloudSegmentStatus.Ready}),{selectedBox:m}=useSingleBox.useSingleBox(),r=React.useContext(PointCloudContext.PointCloudContext),{ptSegmentInstance:a}=r,{t:g}=reactI18next.useTranslation(),{defaultAttribute:f}=useAttribute.useAttribute(),d=usePointCloudViews.usePointCloudViews(),{isPointCloudSegmentationPattern:p}=useStatus.useStatus(),C=ctx.useDispatch(),j={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};React.useEffect(()=>{if(!!a)return a.on("syncPointCloudStatus",v),()=>{a.unbind("syncPointCloudStatus",v)}},[a]);const q=(l,x)=>{var b,P,E,w,D;const y=(b=i==null?void 0:i.attributeList)==null?void 0:b.map(S=>S.value===l?__spreadProps(__spreadValues({},S),{color:x}):S),T=__spreadProps(__spreadValues({},i),{attributeList:y}),A=JSON.stringify(T),N=s==null?void 0:s.map(S=>(S==null?void 0:S.step)===(o==null?void 0:o.step)?__spreadProps(__spreadValues({},S),{config:A}):S);(P=r==null?void 0:r.topViewInstance)==null||P.updateAttributeList(y),(E=r==null?void 0:r.sideViewInstance)==null||E.updateAttributeList(y),(w=r==null?void 0:r.backViewInstance)==null||w.updateAttributeList(y),(D=r==null?void 0:r.mainViewInstance)==null||D.setConfig(T),C(actionCreators.SetTaskStepList({stepList:N}))},I=l=>{d.updateViewsByDefaultSize&&d.updateViewsByDefaultSize(l)},h=l=>{isAllowUpdateInSegment({globalPattern:r.globalPattern,segmentStatus:c.segmentStatus})||n.setDefaultAttribute(l)},L=(l,x)=>{isAllowUpdateInSegment({globalPattern:r.globalPattern,segmentStatus:c.segmentStatus})||n.setSubAttribute(l,x)},B=e.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})),V=m||c.cacheSegData&&c.segmentStatus===lbUtils.EPointCloudSegmentStatus.Edit,k=p;return React__default.default.createElement("div",{style:{height:"100%",overflow:"auto",display:"flex",flexDirection:"column"}},React__default.default.createElement("div",{style:j},g("Attribute")),React__default.default.createElement("div",{style:{height:0,flex:1,overflowY:"auto",overflowX:"hidden"}},React__default.default.createElement(index$7.default,{list:B,forbidDefault:!0,selectedAttribute:f!=null?f:"",attributeChanged:l=>h(l),updateColorConfig:q,enableColorPicker:u,updateSize:I,forbidShowLimitPopover:k}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),V&&React__default.default.createElement(index$8,{subAttributeList:t,setSubAttribute:L,getValue:l=>{var x,b,P,E;return((b=(x=r.selectedPointCloudBox)==null?void 0:x.subAttribute)==null?void 0:b[l.value])||((E=(P=c.cacheSegData)==null?void 0:P.subAttribute)==null?void 0:E[l.value])}})))},renderSegmentTools=[{toolName:"LassoSelector",commonSvg:lassoSelector,selectedSvg:lassoSelector_a},{toolName:"RectSelector",commonSvg:icon_rect,selectedSvg:icon_rect_a},{toolName:"CircleSelector",commonSvg:circleSelector,selectedSvg:circleSelector_a}],PointCloudSegToolIcon=({toolInstance:e})=>{const{ptSegmentInstance:t}=React.useContext(PointCloudContext.PointCloudContext),[n,i]=React.useState("LassoSelector"),{t:s}=reactI18next.useTranslation();return React.useEffect(()=>{if(!t)return;const o=()=>{i("LassoSelector")},u=()=>{i("RectSelector")},c=()=>{i("CircleSelector")};return t.on("LassoSelector",o),t.on("RectSelector",u),t.on("CircleSelector",c),()=>{t.unbind("LassoSelector",o),t.unbind("RectSelector",u),t.unbind("CircleSelector",c)}},[t]),React__default.default.createElement("div",{className:`${index$9.sidebarCls}__level`},renderSegmentTools.map(o=>{const u=n===o.toolName;return React__default.default.createElement("span",{className:`${index$9.sidebarCls}__toolOption`,key:o.toolName,onClick:()=>t==null?void 0:t.emit(o.toolName)},React__default.default.createElement("img",{className:`${index$9.sidebarCls}__singleTool`,src:u?o==null?void 0:o.selectedSvg:o==null?void 0:o.commonSvg}),React__default.default.createElement("span",{className:index.classnames({[`${index$9.sidebarCls}__toolOption__selected`]:u})},s(o.toolName)))}))},PointCloudToolSidebar=({stepInfo:e,toolInstance:t,imgList:n,imgIndex:i,stepList:s,enableColorPicker:o})=>{var u,c;const{updatePointCloudPattern:v,pointCloudPattern:m,isPointCloudSegmentationPattern:r}=useStatus.useStatus(),a=index.jsonParser(e.config),g=(u=a==null?void 0:a.attributeList)!=null?u:[],f=(a==null?void 0:a.secondaryAttributeConfigurable)===!0?(c=a==null?void 0:a.inputList)!=null?c:[]:[];return r?React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegToolIcon,{toolInstance:t}),React__default.default.createElement(AttributeUpdater,{toolInstance:t,attributeList:g,subAttributeList:f,config:a,stepList:s,stepInfo:e,enableColorPicker:o})):React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(ToolIcons.ToolIcons,{toolName:lbAnnotation.cTool.EPointCloudName.PointCloud,selectedToolName:m,onChange:d=>v==null?void 0:v(d)}),React__default.default.createElement("div",{style:{flex:1,overflow:"hidden"}},React__default.default.createElement(DynamicResizer,{minTopHeight:42,defaultHeight:400,localKey:"id:"+(e==null?void 0:e.id)+"taskID:"+(e==null?void 0:e.taskID)+"step:"+(e==null?void 0:e.step)+"type:"+(e==null?void 0:e.type)},React__default.default.createElement(AttributeUpdater,{toolInstance:t,attributeList:g,subAttributeList:f,config:a,stepList:s,stepInfo:e,enableColorPicker:o}),(a==null?void 0:a.trackConfigurable)===!0&&m===ToolType.EToolName.Rect?React__default.default.createElement("div",{style:{height:"100%",overflow:"auto"}},React__default.default.createElement(BoxTrackIDInput,null),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(index$1,{imgList:n,imgIndex:i}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(index$2.default,{imgList:n,imgIndex:i}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(index$3,null),e.loadPreStep>0&&React__default.default.createElement(index$4,null),React__default.default.createElement(index$5,null)):React__default.default.createElement("div",null))))},mapStateToProps=e=>{var t,n,i,s;const o=StepUtils.getCurrentStepInfo((t=e.annotation)==null?void 0:t.step,(n=e.annotation)==null?void 0:n.stepList),u=(i=e.annotation)==null?void 0:i.toolInstance,c=(s=e.annotation)==null?void 0:s.stepList;return{stepInfo:o,toolInstance:u,imgList:e.annotation.imgList,imgIndex:e.annotation.imgIndex,stepList:c}};var PointCloudToolSidebar$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudToolSidebar);exports.PointCloudSegToolIcon=PointCloudSegToolIcon,exports.default=PointCloudToolSidebar$1;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),icons=require("@ant-design/icons"),ToolIcons=require("../ToolIcons.js"),ToolType=require("../../../../data/enums/ToolType.js"),lbAnnotation=require("@labelbee/lb-annotation"),PointCloudContext=require("../../../../components/pointCloudView/PointCloudContext.js"),antd=require("antd"),StepUtils=require("../../../../utils/StepUtils.js"),reactRedux=require("react-redux"),index=require("../../../../utils/index.js"),useStatus=require("../../../../components/pointCloudView/hooks/useStatus.js"),useSingleBox=require("../../../../components/pointCloudView/hooks/useSingleBox.js"),reactI18next=require("react-i18next"),ctx=require("../../../../store/ctx.js"),index$6=require("./components/batchUpdateModal/index.js"),index$1=require("./components/annotatedBox/index.js"),index$3=require("./components/rectRotateSensitivitySlider/index.js"),index$2=require("./components/findTrackIDIndex/index.js"),index$4=require("./components/firstFrameDataSwitch/index.js"),index$5=require("./components/selectBoxVisibleSwitch/index.js"),lbUtils=require("@labelbee/lb-utils"),index$7=require("../../../../components/attributeList/index.js"),useAttribute=require("../../../../components/pointCloudView/hooks/useAttribute.js"),lassoSelector=require("../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js"),lassoSelector_a=require("../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js"),circleSelector=require("../../../../assets/annotation/pointCloudTool/circleSelector.svg.js"),circleSelector_a=require("../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js"),icon_rect=require("../../../../assets/annotation/rectTool/icon_rect.svg.js"),icon_rect_a=require("../../../../assets/annotation/rectTool/icon_rect_a.svg.js"),index$9=require("../index.js"),actionCreators=require("../../../../store/annotation/actionCreators.js"),usePointCloudViews=require("../../../../components/pointCloudView/hooks/usePointCloudViews.js"),index$8=require("../../../../components/subAttributeList/index.js"),DynamicResizer=require("../../../../components/DynamicResizer/DynamicResizer.js"),_=require("lodash");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const BoxTrackIDInput=()=>{const[e,t]=React.useState(!1),n=React.useContext(PointCloudContext.PointCloudContext),{pointCloudBoxList:i}=n,{selectedBox:s,updateSelectedBox:o}=useSingleBox.useSingleBox(),[u,c]=React.useState(""),{t:v}=reactI18next.useTranslation(),m=s==null?void 0:s.info.trackID,r=React.useMemo(()=>_.isNumber(m)&&m>=0,[m]),a=d=>!!i.find(C=>C.trackID===d&&C.id!==(s==null?void 0:s.info.id)),g=(d=!1)=>{const p=parseInt(u,10);if(d&&t(!1),isNaN(p)){antd.message.error(v("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){antd.message.error(v("NotAllowDecimalPointsInTrackID"));return}if(a(p)){antd.message.error(v("DuplicateTrackIDsExist"));return}if(!(p>0)){antd.message.error(v("PositiveIntegerCheck"));return}f(p)};React.useEffect(()=>{t(!1)},[m]);const f=d=>{var p;const C=o({trackID:d});(p=n==null?void 0:n.topViewInstance)==null||p.updatePolygonList(C!=null?C:[]),n.mainViewInstance&&n.selectedPointCloudBox&&(n==null||n.mainViewInstance.generateBox(n==null?void 0:n.selectedPointCloudBox))};return React__default.default.createElement("div",{style:{padding:24}},React__default.default.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},React__default.default.createElement("span",null,v("CurrentBoxTrackIDs")),r&&React__default.default.createElement(index$6,{id:m,updateCurrentPolygonList:d=>f(d)})),React__default.default.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},e&&r?React__default.default.createElement(antd.Input,{defaultValue:m,onChange:d=>{c(d.target.value)},disabled:!r,size:"small",onBlur:()=>{g()},onPressEnter:()=>{g(!0)}}):React__default.default.createElement("span",null,m),React__default.default.createElement(icons.EditFilled,{style:{color:"#999",marginLeft:16,cursor:typeof m!="undefined"?"pointer":"not-allowed"},onClick:()=>{r&&t(!e)}})))},isAllowUpdateInSegment=({segmentStatus:e,globalPattern:t})=>t===lbUtils.EPointCloudPattern.Segmentation&&![lbUtils.EPointCloudSegmentStatus.Edit,lbUtils.EPointCloudSegmentStatus.Ready].includes(e),AttributeUpdater=({attributeList:e,subAttributeList:t,toolInstance:n,config:i,stepList:s,stepInfo:o,enableColorPicker:u})=>{const[c,v]=React.useState({segmentStatus:lbUtils.EPointCloudSegmentStatus.Ready}),{selectedBox:m}=useSingleBox.useSingleBox(),r=React.useContext(PointCloudContext.PointCloudContext),{ptSegmentInstance:a}=r,{t:g}=reactI18next.useTranslation(),{defaultAttribute:f}=useAttribute.useAttribute(),d=usePointCloudViews.usePointCloudViews(),{isPointCloudSegmentationPattern:p}=useStatus.useStatus(),C=ctx.useDispatch(),j={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};React.useEffect(()=>{if(!!a)return a.on("syncPointCloudStatus",v),()=>{a.unbind("syncPointCloudStatus",v)}},[a]);const q=(l,x)=>{var b,P,E,w,D;const y=(b=i==null?void 0:i.attributeList)==null?void 0:b.map(S=>S.value===l?__spreadProps(__spreadValues({},S),{color:x}):S),T=__spreadProps(__spreadValues({},i),{attributeList:y}),A=JSON.stringify(T),N=s==null?void 0:s.map(S=>(S==null?void 0:S.step)===(o==null?void 0:o.step)?__spreadProps(__spreadValues({},S),{config:A}):S);(P=r==null?void 0:r.topViewInstance)==null||P.updateAttributeList(y),(E=r==null?void 0:r.sideViewInstance)==null||E.updateAttributeList(y),(w=r==null?void 0:r.backViewInstance)==null||w.updateAttributeList(y),(D=r==null?void 0:r.mainViewInstance)==null||D.setConfig(T),C(actionCreators.SetTaskStepList({stepList:N}))},I=l=>{d.updateViewsByDefaultSize&&d.updateViewsByDefaultSize(l)},h=l=>{isAllowUpdateInSegment({globalPattern:r.globalPattern,segmentStatus:c.segmentStatus})||n.setDefaultAttribute(l)},L=(l,x)=>{isAllowUpdateInSegment({globalPattern:r.globalPattern,segmentStatus:c.segmentStatus})||n.setSubAttribute(l,x)},B=e.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})),V=m||c.cacheSegData&&c.segmentStatus===lbUtils.EPointCloudSegmentStatus.Edit,k=p;return React__default.default.createElement("div",{style:{height:"100%",overflow:"auto",display:"flex",flexDirection:"column"}},React__default.default.createElement("div",{style:j},g("Attribute")),React__default.default.createElement("div",{style:{height:0,flex:1,overflowY:"auto",overflowX:"hidden"}},React__default.default.createElement(index$7.default,{list:B,forbidDefault:!0,selectedAttribute:f!=null?f:"",attributeChanged:l=>h(l),updateColorConfig:q,enableColorPicker:u,updateSize:I,forbidShowLimitPopover:k}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),V&&React__default.default.createElement(index$8,{subAttributeList:t,setSubAttribute:L,getValue:l=>{var x,b,P,E;return((b=(x=r.selectedPointCloudBox)==null?void 0:x.subAttribute)==null?void 0:b[l.value])||((E=(P=c.cacheSegData)==null?void 0:P.subAttribute)==null?void 0:E[l.value])}})))},renderSegmentTools=[{toolName:"LassoSelector",commonSvg:lassoSelector,selectedSvg:lassoSelector_a},{toolName:"RectSelector",commonSvg:icon_rect,selectedSvg:icon_rect_a},{toolName:"CircleSelector",commonSvg:circleSelector,selectedSvg:circleSelector_a}],PointCloudSegToolIcon=({toolInstance:e})=>{const{ptSegmentInstance:t}=React.useContext(PointCloudContext.PointCloudContext),[n,i]=React.useState("LassoSelector"),{t:s}=reactI18next.useTranslation();return React.useEffect(()=>{if(!t)return;const o=()=>{i("LassoSelector")},u=()=>{i("RectSelector")},c=()=>{i("CircleSelector")};return t.on("LassoSelector",o),t.on("RectSelector",u),t.on("CircleSelector",c),()=>{t.unbind("LassoSelector",o),t.unbind("RectSelector",u),t.unbind("CircleSelector",c)}},[t]),React__default.default.createElement("div",{className:`${index$9.sidebarCls}__level`},renderSegmentTools.map(o=>{const u=n===o.toolName;return React__default.default.createElement("span",{className:`${index$9.sidebarCls}__toolOption`,key:o.toolName,onClick:()=>t==null?void 0:t.emit(o.toolName)},React__default.default.createElement("img",{className:`${index$9.sidebarCls}__singleTool`,src:u?o==null?void 0:o.selectedSvg:o==null?void 0:o.commonSvg}),React__default.default.createElement("span",{className:index.classnames({[`${index$9.sidebarCls}__toolOption__selected`]:u})},s(o.toolName)))}))},PointCloudToolSidebar=({stepInfo:e,toolInstance:t,imgList:n,imgIndex:i,stepList:s,enableColorPicker:o})=>{var u,c;const{updatePointCloudPattern:v,pointCloudPattern:m,isPointCloudSegmentationPattern:r}=useStatus.useStatus(),a=index.jsonParser(e.config),g=(u=a==null?void 0:a.attributeList)!=null?u:[],f=(a==null?void 0:a.secondaryAttributeConfigurable)===!0?(c=a==null?void 0:a.inputList)!=null?c:[]:[];return r?React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(PointCloudSegToolIcon,{toolInstance:t}),React__default.default.createElement(AttributeUpdater,{toolInstance:t,attributeList:g,subAttributeList:f,config:a,stepList:s,stepInfo:e,enableColorPicker:o})):React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(ToolIcons.ToolIcons,{toolName:lbAnnotation.cTool.EPointCloudName.PointCloud,selectedToolName:m,onChange:d=>v==null?void 0:v(d)}),React__default.default.createElement("div",{style:{flex:1,overflow:"hidden"}},React__default.default.createElement(DynamicResizer,{minTopHeight:42,defaultHeight:400,localKey:"settingid:"+(e==null?void 0:e.id)+"taskID:"+(e==null?void 0:e.taskID)+"step:"+(e==null?void 0:e.step)+"type:"+(e==null?void 0:e.type)},React__default.default.createElement(AttributeUpdater,{toolInstance:t,attributeList:g,subAttributeList:f,config:a,stepList:s,stepInfo:e,enableColorPicker:o}),(a==null?void 0:a.trackConfigurable)===!0&&m===ToolType.EToolName.Rect?React__default.default.createElement("div",{style:{height:"100%",overflow:"auto"}},React__default.default.createElement(BoxTrackIDInput,null),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(index$1,{imgList:n,imgIndex:i}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(index$2.default,{imgList:n,imgIndex:i}),React__default.default.createElement(antd.Divider,{style:{margin:0}}),React__default.default.createElement(index$3,null),e.loadPreStep>0&&React__default.default.createElement(index$4,null),React__default.default.createElement(index$5,null)):React__default.default.createElement("div",null))))},mapStateToProps=e=>{var t,n,i,s;const o=StepUtils.getCurrentStepInfo((t=e.annotation)==null?void 0:t.step,(n=e.annotation)==null?void 0:n.stepList),u=(i=e.annotation)==null?void 0:i.toolInstance,c=(s=e.annotation)==null?void 0:s.stepList;return{stepInfo:o,toolInstance:u,imgList:e.annotation.imgList,imgIndex:e.annotation.imgIndex,stepList:c}};var PointCloudToolSidebar$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloudToolSidebar);exports.PointCloudSegToolIcon=PointCloudSegToolIcon,exports.default=PointCloudToolSidebar$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a,{useRef as O}from"react";import{Resizable as P}from"re-resizable";import b from"./hooks/useDrag.js";var z=Object.defineProperty,s=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,l=(t,e,r)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E=(t,e)=>{for(var r in e||(e={}))g.call(e,r)&&l(t,r,e[r]);if(s)for(var r of s(e))w.call(e,r)&&l(t,r,e[r]);return t};const R=({direction:t="vertical",children:e,defaultWidth:r,defaultHeight:i,minTopHeight:n,minBottomHeight:c,minLeftWidth:m,minRightWidth:p,localKey:f,enableEdges:u=["right","bottom"],onResizeStart:_,onResize:d,onResizeStop:v})=>{const o=O(null),y=b({direction:t,containerRef:o,defaultHeight:i,defaultWidth:r,minTopHeight:n,minBottomHeight:c,minLeftWidth:m,minRightWidth:p,localKey:f,enableEdges:u,onResizeStart:_,onResize:d,onResizeStop:v});return a.createElement("div",{className:`dynamic-resizer-content ${t}`,ref:o},a.createElement(P,E({},y),a.createElement("div",{className:"resizable-child"},e[0])),a.createElement("div",{className:"resizable-child-two"},e[1]))};export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{useState as L,useEffect as P}from"react";import U from"./useUpdateHeight.js";import v from"./useDraggingAllowed.js";const C=({containerRef:e,direction:t,defaultHeight:h,defaultWidth:g,minTopHeight:l,minBottomHeight:n,minLeftWidth:c,minRightWidth:m,localKey:u,enableEdges:f,onResizeStart:s,onResize:i,onResizeStop:a})=>{const{width:p,height:z,minWidth:H,minHeight:b,maxWidth:D,maxHeight:y,updateHeight:W,updateWidth:w}=U({direction:t,containerRef:e,minTopHeight:l,minBottomHeight:n,defaultHeight:h,minLeftWidth:c,minRightWidth:m,defaultWidth:g,localKey:u}),x=v(t,f),[r,d]=L(!1),S=()=>{d(!0),s&&s()},j=()=>{i&&i()},A=(I,R,o)=>{d(!1),w(o.offsetWidth),W(o.offsetHeight),a&&a()};return P(()=>{e.current&&(r?e.current.classList.add("hide-scrollbar"):e.current.classList.remove("hide-scrollbar"))},[r,e.current]),{size:{width:p,height:z},onResizeStart:S,onResize:j,onResizeStop:A,enable:x,handleClasses:{right:"dynamic-right-handle",bottom:"dynamic-bottom-handle"},minWidth:H,maxWidth:D,minHeight:b,maxHeight:y}};export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useMemo as s}from"react";const i=(r="vertical",o)=>{const t=(e,l)=>r===e&&(o==null?void 0:o.includes(l));return s(()=>{const e=t("vertical","top"),l=t("vertical","bottom"),n=t("horizontal","left"),a=t("horizontal","right");return{top:e,bottom:l,left:n,right:a,topLeft:!1,ropRight:!1,bottomLeft:!1,bottomRight:!1}},[r,o])};export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as
|
|
1
|
+
import{useState as a,useEffect as r,useCallback as n}from"react";import{useLocalStorageState as z}from"ahooks";import{adjustDefaultSize as D,calcMinSize as I,calcMaxSize as b}from"../utils/index.js";const Q=({containerRef:t,direction:e,defaultHeight:j=10,defaultWidth:k=10,minTopHeight:c=10,minBottomHeight:o=10,minLeftWidth:h=10,minRightWidth:d=10,localKey:v="dynamicResizerLocalKey"})=>{var g,H;const[W,w]=a(0),[x,A]=a(0),[_,y]=a(void 0),[C,E]=a(void 0),[L,U]=a(void 0),[m,q]=a(void 0),[F,G]=z(v+"width"),[J,K]=z(v+"height"),[u,M]=a(!1);r(()=>(M(!0),()=>{M(!1)}),[]),r(()=>{u&&N()},[u]),r(()=>{u&&e==="vertical"&&P()},[u,(g=t.current)==null?void 0:g.offsetHeight,c,o]),r(()=>{u&&e==="horizontal"&&O()},[u,(H=t.current)==null?void 0:H.offsetWidth,h,d]);const N=()=>{if(t==null?void 0:t.current){const l=t==null?void 0:t.current.offsetWidth,s=t==null?void 0:t.current.offsetHeight;let i=l,p=s;e==="vertical"?p=D(J,c,o,s,j):e==="horizontal"&&(i=D(F,h,d,l,k)),f(i),S(p)}},O=n(()=>{if(t==null?void 0:t.current){const l=t==null?void 0:t.current.offsetWidth;let s=l,i=l;s=I(h,l),i=b(d,l),y(s),U(i)}},[t,h,d]),P=n(()=>{if(t==null?void 0:t.current){const l=t==null?void 0:t.current.offsetHeight;let s=l,i=l;s=I(c,l),i=b(o,l),E(s),q(i)}},[t,c,o]),f=n(l=>{const s=e==="horizontal"?l:"100%";w(s),G(s)},[e,W]),S=n(l=>{const s=e==="vertical"?l:"100%";A(s),K(s)},[e,x]);return{width:W,height:x,minWidth:_,minHeight:C,maxWidth:L,maxHeight:m,updateWidth:f,updateHeight:S}};export{Q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const p=t=>typeof t=="string"&&t.endsWith("%")&&!isNaN(parseFloat(t)),o=(t,s)=>{const f=parseFloat(t);return isNaN(f)?0:f/100*s},g=t=>typeof t=="number"&&t>0||p(t),b=(t,s)=>g(t)?typeof t=="string"&&p(t)?o(t,s):s-Number(t):s,n=(t,s)=>g(t)?typeof t=="string"&&p(t)?o(t,s):Number(t):0,h=(t,s,f,r=0,N)=>{if(!g(t))return N<r?N:Math.min(r,n(s,r));if(n(s,r)+n(f,r)>r)return r*.5;const a=n(s,r),u=r-n(f,r),M=typeof t=="string"&&p(t)?o(t,r):Number(t)||0;return Math.min(Math.max(M,a),u)};export{h as adjustDefaultSize,b as calcMaxSize,n as calcMinSize,g as isValidSize};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import s,{useState as N,useEffect as D,useMemo as ae}from"react";import{AudioPlayer as Oe}from"../audioPlayer/index.js";import{getClassName as ke}from"../../utils/dom.js";import Ne from"../predictTracking/previewResult/index.js";import{Layout as ue}from"antd/es";import{Spin as De}from"antd";import{prefix as $e}from"../../constant/index.js";import{cKeyCode as Me,CommonToolUtils as $,EventBus as ce,uuid as Ve,TagUtils as Be,cTool as Fe}from"@labelbee/lb-annotation";import K from"./index.module.scss.js";import Ke from"./tagResultShow/index.js";import{AudioClipProvider as We,DEFAULT_CLIP_TEXT_CONFIG_ITEM as Ue,useAudioClipStore as Xe}from"./audioContext/index.js";import ze from"./textInput/index.js";import{connect as Ge}from"react-redux";import{a2MapStateToProps as qe}from"../../store/annotation/map.js";import{LabelBeeContext as He}from"../../store/ctx.js";import{jsonParser as Je}from"../../utils/index.js";import{useCustomToolInstance as Qe}from"../../hooks/annotation.js";import{sidebarCls as ee}from"../../views/MainView/sidebar/index.js";import Ye from"./audioSide/labelSidebar/index.js";import Ze from"./audioSide/clipSidebar/index.js";import et from"../../assets/annotation/audio/tag.svg.js";import tt from"../../assets/annotation/audio/tagA.svg.js";import ot from"../../assets/annotation/audio/clip.svg.js";import nt from"../../assets/annotation/audio/clipA.svg.js";import{isImageValue as it}from"../../utils/audio.js";import lt from"./utils/dataTransform.js";import{useMemoizedFn as de}from"ahooks";var st=Object.defineProperty,rt=Object.defineProperties,at=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,ut=Object.prototype.hasOwnProperty,ct=Object.prototype.propertyIsEnumerable,me=(t,i,u)=>i in t?st(t,i,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[i]=u,L=(t,i)=>{for(var u in i||(i={}))ut.call(i,u)&&me(t,u,i[u]);if(fe)for(var u of fe(i))ct.call(i,u)&&me(t,u,i[u]);return t},M=(t,i)=>rt(t,at(i));const{EAudioToolName:dt}=Fe,pe=Me.default,{Sider:ft,Content:mt}=ue,ge=`${$e}-layout`,pt=({setSideTab:t,sideTab:i})=>{const u=[{tab:"tag",commonSvg:et,selectedSvg:tt},{tab:"clip",commonSvg:ot,selectedSvg:nt}];return s.createElement("div",{className:K.toggleAudioOption},u.map((g,_)=>{const{tab:f,selectedSvg:E,commonSvg:h}=g;return s.createElement("div",{key:_,className:K.option},s.createElement("img",{className:K.icon,src:i===f?E:h,onClick:()=>{i!==f&&t(f)}}))}))},gt=({result:t,inputDisabled:i,updateText:u,configList:g,autofocus:_,preContext:f,isCheck:E,clipAttributeConfigurable:h,clipTextConfigurable:O,textConfigurable:v,updateRegion:x,clipAttributeList:V,clipTextList:m})=>s.createElement(ze,{isCheck:E,result:t==null?void 0:t.value,textInputDisabled:i,textID:(t==null?void 0:t.id)||0,updateText:u,configList:g,autofocus:!i&&_,preContext:f,regions:t==null?void 0:t.regions,clipAttributeConfigurable:h,clipTextConfigurable:O,textConfigurable:v,updateRegion:x,clipAttributeList:V,clipTextList:m}),vt=t=>{var i,u;const{sider:g,config:_,result:f,updateTagResult:E,updateRegion:h,isEdit:O,tagConfigurable:v,clipConfigurable:x,valid:V}=t;let m=(_==null?void 0:_.inputList)||[],o=(i=f==null?void 0:f.tag)!=null?i:{},G=(u=f==null?void 0:f.regions)!=null?u:[];const[W,b]=N([]),[S,C]=N("tag");D(()=>{if(!v&&x){C("clip");return}C("tag")},[v,x]),D(()=>(window.addEventListener("keydown",w),()=>{window.removeEventListener("keydown",w)}));const w=r=>{if(v&&x)switch(r.keyCode){case pe.L:C("tag");break;case pe.X:C("clip");break}if(S==="tag"){if(!$.hotkeyFilter(r))return;$.isMoveKey(r==null?void 0:r.keyCode)&&r.preventDefault();let a=r.keyCode;if(a&&(a<=57&&a>=49||a<=105&&a>=97)){a>57?a=a-97:a=a-49;const n=W.slice();m.length===1?(R(0,a),b([0,a]),setTimeout(()=>{b([])},500)):n.length===1?(R(n[0],a),b([n[0],a]),setTimeout(()=>{b([])},500)):b([a])}}},R=(r,a)=>{if(r<m.length&&m[r].subSelected&&a<m[r].subSelected.length){const n=m[r].value,q=m[r].isMulti;let j=m[r].subSelected[a].value,U=0;const y=o;for(const A in o)if(A===m[r].value){if(U++,q===!0){const p=y[A].split(";").filter(H=>H!==""),X=p.indexOf(j);X===-1?p.push(j):p.splice(X,1),j=p.join(";")}j===""?delete y[A]:y[A]=j}U===0&&Object.assign(o,{[n]:j}),E(o)}},B=r=>{delete o[r],E(o)},P=v&&x&&s.createElement(pt,{setSideTab:C,sideTab:S}),k=S==="tag"&&s.createElement(Ye,{labelInfoSet:v?m:[],labelSelectedList:W,setLabel:R,tagResult:o,clearResult:B,isEdit:O,withPanelTab:!1}),c=S==="clip"&&s.createElement(Ze,{regions:G,updateRegion:h,useAudioClipStore:Xe});return g?typeof g=="function"?s.createElement("div",{className:`${ee}`},g({toggleAudioOption:P,labelSidebar:k,clipSidebar:c,valid:V})):g:s.createElement("div",{className:`${ee}`},s.createElement("div",{className:`${ee}__content`},P,k,c))},bt=t=>{var i,u,g,_,f,E,h,O,v;const x=(u=(i=t.style)==null?void 0:i.sider)==null?void 0:u.width,{step:V,stepList:m,audioContext:o,sider:G,drawLayerSlot:W,imgList:b,imgIndex:S,currentData:C,config:w,stepInfo:R,checkMode:B}=t,P=$.getCurrentStepToolAndConfig(V,m),k=Je(C.result),{toolInstanceRef:c}=Qe({basicInfo:k}),[r,a]=N(!0),[n,q]=N(null),[j,U]=N(0),[y,A]=N(!0),p=e=>{if(!e)return;const l=lt.fixData(e);q(l)};D(()=>{a(!0)},[S]),D(()=>{r===!1&&Re()},[r]),D(()=>{H()},[]),D(()=>{c.current.exportData=()=>[[n],{duration:j,valid:y}],c.current.setResult=Pe,c.current.clearResult=Ae,c.current.currentPageResult=n==null?void 0:n.regions,c.current.emit("updatePageNumber"),c.current.setSelectedRegion=X,c.current.setValid=Ie},[n,y]);const X=e=>{ce.emit("setSelectedRegion",{id:e,isLoopStatus:!0,playImmediately:!0})},H=()=>{c.current.emit=e=>{const l=c.current.fns.get(e);l&&l.forEach(d=>{d&&(d==null||d())})},c.current.fns=new Map,c.current.singleOn=(e,l)=>{c.current.fns.set(e,[l])},c.current.on=(e,l)=>{c.current.singleOn(e,l)},c.current.unbindAll=e=>{c.current.fns.delete(e)}},J=ae(()=>{const e=k[`step_${R==null?void 0:R.step}`];return(e==null?void 0:e.result)||[]},[w,k,R]),{tagConfigurable:te,textConfigurable:Q=!0,clipConfigurable:oe=!1,clipAttributeConfigurable:ne=!1,clipAttributeList:ie=[],clipTextConfigurable:z=!1,subAttributeList:ve=[],secondaryAttributeConfigurable:be=!1,inputList:Se=[],configList:ye=[],clipTextList:le=Ue}=ae(()=>{if(P)return $.jsonParser(P==null?void 0:P.config)},[P]),_e={clipConfigurable:oe,clipAttributeConfigurable:ne,clipAttributeList:ie,clipTextConfigurable:z,subAttributeList:ve,secondaryAttributeConfigurable:be,clipTextList:le},Ee=(_=(g=$.jsonParser(C.result))==null?void 0:g.duration)!=null?_:0,xe=y?Ee:0,Ce=!y||r||![Q,z].includes(!0)||B;let se={};if(S!==-1&&(b==null?void 0:b.length)){const e=(f=b[S])==null?void 0:f.preResult,l=(o==null?void 0:o.isEdit)?(E=o==null?void 0:o.stepConfig)==null?void 0:E.loadPreStep:R==null?void 0:R.loadPreStep;if(e&&l){const d=$.jsonParser(e),T=(O=(h=d==null?void 0:d.config)==null?void 0:h.context)!=null?O:{};Object.keys(T).forEach(I=>{I&&T[I]&&(se[I]={visible:!0,content:T[I],type:I})})}}const Re=()=>{(J==null?void 0:J.length)>0?p(J[0]):p({id:Ve(),sourceID:"",value:re(),tag:Te(),regions:[]});const e=it(b[S].result||"[]");A(e)},re=(e=!0)=>{const l={};let d=w.configList||[];return d.length>0&&d.forEach(T=>{l[T.key]=e&&T.default||""}),l},Te=()=>Be.getDefaultResultByConfig(w.inputList||[]),Le=({duration:e,hasError:l})=>{(o==null?void 0:o.onLoaded)&&(o==null||o.onLoaded()),a(!1),U(e)},he=de(e=>{p(M(L({},n||{}),{regions:((n==null?void 0:n.regions)||[]).filter(l=>l.id!==e)}))}),Y=de(e=>{var l;const d=(l=n==null?void 0:n.regions)!=null?l:[],{id:T}=e,I=d.find(F=>F.id===T);let Z=[];I?Z=d.map(F=>T===F.id?L(L({},F),e):F):Z=[...d,e],p(M(L({},n),{regions:Z}))}),je=(e,l)=>{const d=M(L({},n),{value:M(L({},n.value),{[l]:e})});p(d)},we=e=>{const l=M(L({},n),{tag:e});p(l)},Pe=e=>{p(e)},Ae=()=>{const e=M(L({},n),{value:re(),tag:{},regions:[]});p(e),ce.emit("clearRegions")},Ie=e=>{A(e)};return s.createElement(We,null,s.createElement(De,{spinning:r,wrapperClassName:"audio-tool-spinner"},s.createElement(ue,{className:ke("layout","container"),style:{height:"100%",userSelect:"none"}},t==null?void 0:t.leftSider,s.createElement(mt,{className:`${ge}__content`},s.createElement("div",{className:K.containerWrapper},s.createElement("div",{className:K.audioWrapper},te&&s.createElement(Ke,{result:n==null?void 0:n.tag,labelInfoSet:Se,hasPromptLayer:!!(o==null?void 0:o.promptLayer)}),o==null?void 0:o.promptLayer,s.createElement(Oe,L({context:{isEdit:o==null?void 0:o.isEdit,count:xe,toolName:dt.AudioTextTool,imgIndex:S},drawLayerSlot:W,fileData:C,onLoaded:Le,invalid:!y,updateRegion:Y,removeRegion:he,regions:n==null?void 0:n.regions,activeToolPanel:o==null?void 0:o.activeToolPanel,footer:t.footer,isCheck:B},_e))),(Q||z)&&s.createElement(gt,{preContext:se,result:n,inputDisabled:Ce,updateText:je,updateRegion:Y,configList:ye,autofocus:!1,textConfigurable:Q,clipTextConfigurable:z,clipAttributeList:ie,clipAttributeConfigurable:ne,clipTextList:le,isCheck:B}))),s.createElement(ft,{className:`${ge}__side`,width:x!=null?x:240,style:(v=t.style)==null?void 0:v.sider},s.createElement(vt,{sider:G,config:w,result:n,updateTagResult:we,updateRegion:Y,isEdit:o==null?void 0:o.isEdit,tagConfigurable:te,clipConfigurable:oe,valid:y})),s.createElement(Ne,null))))};var St=Ge(qe,null,null,{context:He})(bt);export{St as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as
|
|
1
|
+
import{getClassName as i}from"../../utils/dom.js";import t,{useContext as z,useRef as S,useState as w,useEffect as p}from"react";import W from"./PointCloud3DView.js";import G from"./PointCloudBackView.js";import K from"./PointCloudTopView.js";import O from"./PointCloudSideView.js";import Z from"./PointCloud2DView.js";import U from"./PointCloudListener.js";import $ from"./PointCloudSegmentListener.js";import q from"./PointCloudSegment.js";import J from"./PointCloudSegmentStatus.js";import Q from"./PointCloudSegmentToolbar.js";import X from"./PointCloudSegment2DView.js";import{connect as Y}from"react-redux";import{LabelBeeContext as tt,useDispatch as et}from"../../store/ctx.js";import{AnnotatedAttributesPanelFixedLeft as ot,AnnotatedAttributesPanelFixedRight as nt}from"../../views/MainView/toolFooter/AnnotatedAttributes/index.js";import{PointCloudContext as it}from"./PointCloudContext.js";import{PointCloudUtils as lt,EPointCloudPattern as rt}from"@labelbee/lb-utils";import{useCustomToolInstance as st}from"../../hooks/annotation.js";import{jsonParser as at}from"../../utils/index.js";import{a2MapStateToProps as mt}from"../../store/annotation/map.js";import V from"classnames";import ut from"./components/sideAndBackOverView/index.js";import{SetLoadPCDFileLoading as ct}from"../../store/annotation/actionCreators.js";import j from"../DynamicResizer/DynamicResizer.js";const dt=x=>{const{currentData:m,imgList:b,drawLayerSlot:f,checkMode:l,intelligentFit:D,imgIndex:y,config:R,measureVisible:I,setResourceLoading:P,stepInfo:o}=x,e=z(it),{globalPattern:g,setGlobalPattern:A,selectedIDs:L}=e,k=et(),C=S(null),E=S(null),[T,N]=w(0),[r,v]=w(!1),_=(L==null?void 0:L.length)>0&&r,B=at(m.result),{toolInstanceRef:a,clearToolInstance:F}=st({basicInfo:B});if(p(()=>{a.current.setPointCloudGlobalPattern=n=>{n!==g&&(A(n),e.clearAllDetectionInstance(),F())}},[g]),p(()=>{var n;if(ct(k,!0),m){const{boxParamsList:s,polygonList:u,lineList:c,sphereParamsList:d,segmentation:H,rectList:M}=lt.parsePointCloudCurrentResult((n=m==null?void 0:m.result)!=null?n:"");e.setPointCloudResult(s),e.setPolygonList(u),e.setLineList(c),e.setPointCloudSphereList(d),e.setRectList(M),e.setSegmentation(H)}},[y]),p(()=>{var n;if(C.current){const s=((n=C.current)==null?void 0:n.offsetHeight)-233;N(s)}},[E.current]),p(()=>{a.current.exportData=()=>[e.pointCloudBoxList,{valid:e.valid}],a.current.exportCustomData=()=>{var n,s,u,c,d;return{resultPolygon:(n=e.polygonList)!=null?n:[],resultLine:(s=e.lineList)!=null?s:[],resultPoint:(u=e.pointCloudSphereList)!=null?u:[],resultRect:(c=e.rectList)!=null?c:[],segmentation:(d=e.segmentation)!=null?d:[]}}},[e.pointCloudBoxList,e.rectList,e.valid,e.polygonList,e.lineList,e.pointCloudSphereList,e.ptSegmentInstance,e.segmentation]),b.length===0)return null;if(g===rt.Segmentation)return t.createElement(t.Fragment,null,t.createElement($,{checkMode:l,toolInstanceRef:a}),t.createElement(Q,null),t.createElement("div",{className:i("point-cloud-layout")},t.createElement(q,{checkMode:l}),t.createElement(X,null)),t.createElement(J,{config:R}),f==null?void 0:f({direct:!0}));let h=t.createElement("div",{className:i("point-cloud-container","left-bottom")},t.createElement(G,{checkMode:l}),t.createElement(O,{checkMode:l}));return r&&(h=t.createElement(ut,{selectAndEnlarge:_,checkMode:l})),t.createElement(t.Fragment,null,t.createElement(U,{checkMode:l,toolInstanceRef:a,setResourceLoading:P}),t.createElement("div",{className:i("point-cloud-layout"),onContextMenu:n=>n.preventDefault()},t.createElement("div",{className:i("point-cloud-wrapper")},t.createElement(ot,null),t.createElement("div",{className:i("point-cloud-content"),ref:E},t.createElement(j,{direction:"horizontal",localKey:"leftAllViewid:"+(o==null?void 0:o.id)+"taskID:"+(o==null?void 0:o.taskID)+"step:"+(o==null?void 0:o.step)+"type:"+(o==null?void 0:o.type),defaultWidth:360,minLeftWidth:244,minRightWidth:"50%"},t.createElement("div",{className:i("point-cloud-container","left")},t.createElement(W,{setResourceLoading:P}),h),t.createElement("div",{className:V({[i("point-cloud-container","right")]:!0,[i("point-cloud-container","rightZoom")]:r}),ref:C},t.createElement(j,{localKey:"rightAllViewid:"+(o==null?void 0:o.id)+"taskID:"+(o==null?void 0:o.taskID)+"step:"+(o==null?void 0:o.step)+"type:"+(o==null?void 0:o.type),defaultHeight:300,minTopHeight:T,minBottomHeight:160},t.createElement(K,{drawLayerSlot:f,checkMode:l,intelligentFit:D,setIsEnlargeTopView:v,onExitZoom:()=>{v(!1)},isEnlargeTopView:r}),t.createElement("div",{className:V({[i("point-cloud-container","right-bottom")]:!r,[i("point-cloud-container","right-bottom-floatLeft")]:r})},t.createElement(Z,{isEnlargeTopView:r,thumbnailWidth:r?300:455,checkMode:l,measureVisible:I})))))),t.createElement(nt,null))))};var pt=Y(mt,null,null,{context:tt})(dt);export{pt as default};
|
package/es/index.css
CHANGED
|
@@ -81,73 +81,62 @@
|
|
|
81
81
|
margin-right: 8px;
|
|
82
82
|
}
|
|
83
83
|
.dynamic-resizer-content {
|
|
84
|
+
display: flex;
|
|
84
85
|
width: 100%;
|
|
85
86
|
height: 100%;
|
|
86
|
-
flex-shrink: 0;
|
|
87
|
-
flex-grow: 0;
|
|
88
87
|
position: relative;
|
|
88
|
+
overflow: hidden;
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
position: absolute;
|
|
95
|
-
top: -5px;
|
|
96
|
-
left: 0;
|
|
97
|
-
cursor: row-resize;
|
|
98
|
-
user-select: none;
|
|
99
|
-
display: flex;
|
|
100
|
-
align-items: center;
|
|
90
|
+
.dynamic-resizer-content.horizontal {
|
|
91
|
+
flex-direction: row;
|
|
92
|
+
}
|
|
93
|
+
.dynamic-resizer-content.vertical {
|
|
101
94
|
flex-direction: column;
|
|
102
|
-
justify-content: center;
|
|
103
95
|
}
|
|
104
|
-
.
|
|
105
|
-
display:
|
|
96
|
+
.dynamic-resizer-content .resizable-container {
|
|
97
|
+
display: flex;
|
|
106
98
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
.dynamic-resizer-content .resizable-child {
|
|
100
|
+
width: 100%;
|
|
101
|
+
height: 100%;
|
|
102
|
+
}
|
|
103
|
+
.dynamic-resizer-content .resizable-child-two {
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: 100%;
|
|
106
|
+
overflow-y: auto;
|
|
107
|
+
position: relative;
|
|
108
|
+
}
|
|
109
|
+
.dynamic-resizer-content .divider-all {
|
|
111
110
|
width: 20px;
|
|
112
111
|
height: 20px;
|
|
113
|
-
cursor: pointer;
|
|
114
|
-
display: none;
|
|
115
|
-
user-select: none;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.divider-all {
|
|
119
112
|
position: absolute;
|
|
120
|
-
top:
|
|
113
|
+
top: 0;
|
|
121
114
|
left: 50%;
|
|
122
|
-
transform: translate(-50%);
|
|
115
|
+
transform: translate(-50%, -50%);
|
|
116
|
+
z-index: 1;
|
|
123
117
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
width:
|
|
127
|
-
height:
|
|
128
|
-
|
|
118
|
+
.dynamic-resizer-content .split-divider {
|
|
119
|
+
background-color: #ccc;
|
|
120
|
+
width: 5px;
|
|
121
|
+
height: 100%;
|
|
122
|
+
}
|
|
123
|
+
.dynamic-resizer-content .dynamic-right-handle {
|
|
124
|
+
cursor: ew-resize !important;
|
|
125
|
+
z-index: 100;
|
|
129
126
|
}
|
|
130
|
-
.
|
|
127
|
+
.dynamic-resizer-content .dynamic-bottom-handle {
|
|
128
|
+
cursor: ns-resize !important;
|
|
129
|
+
z-index: 100;
|
|
130
|
+
}
|
|
131
|
+
.dynamic-resizer-content .dynamic-bottom-handle::after {
|
|
131
132
|
content: "";
|
|
132
|
-
display: block;
|
|
133
133
|
position: absolute;
|
|
134
|
-
top: 50%;
|
|
135
134
|
left: 0;
|
|
136
135
|
right: 0;
|
|
137
|
-
|
|
136
|
+
top: 50%;
|
|
137
|
+
transform: translateY(-50%);
|
|
138
138
|
height: 1px;
|
|
139
139
|
background: #ccc;
|
|
140
|
-
margin: 0 auto;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.dynamic-resizer-top {
|
|
144
|
-
width: 100%;
|
|
145
|
-
overflow-y: auto;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.dynamic-resizer-bottom {
|
|
149
|
-
width: 100%;
|
|
150
|
-
overflow-y: auto;
|
|
151
140
|
}
|
|
152
141
|
|
|
153
142
|
.hide-scrollbar * {
|
|
@@ -2623,17 +2612,22 @@
|
|
|
2623
2612
|
line-height: 40px;
|
|
2624
2613
|
display: flex;
|
|
2625
2614
|
justify-content: space-between;
|
|
2615
|
+
height: auto;
|
|
2626
2616
|
}
|
|
2627
2617
|
.bee-point-cloud-wrapper .bee-point-cloud-container__header-title {
|
|
2628
|
-
flex:
|
|
2618
|
+
flex-shrink: 0;
|
|
2629
2619
|
overflow: hidden;
|
|
2630
2620
|
text-overflow: ellipsis;
|
|
2631
2621
|
font-weight: 500;
|
|
2622
|
+
height: 40px;
|
|
2632
2623
|
}
|
|
2633
2624
|
.bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar {
|
|
2625
|
+
flex: 1;
|
|
2634
2626
|
display: flex;
|
|
2635
2627
|
align-items: center;
|
|
2636
2628
|
font-size: 14px;
|
|
2629
|
+
flex-wrap: wrap;
|
|
2630
|
+
justify-content: flex-end;
|
|
2637
2631
|
}
|
|
2638
2632
|
.bee-point-cloud-wrapper .bee-point-cloud-container__header-toolbar .bee-point-cloud__rotate-reserve {
|
|
2639
2633
|
display: inline-block;
|
|
@@ -2721,7 +2715,7 @@
|
|
|
2721
2715
|
display: none;
|
|
2722
2716
|
}
|
|
2723
2717
|
.bee-point-cloud-wrapper .bee-point-cloud-container__left {
|
|
2724
|
-
width:
|
|
2718
|
+
width: 100%;
|
|
2725
2719
|
display: flex;
|
|
2726
2720
|
flex-direction: column;
|
|
2727
2721
|
border-right: 1px solid #fff;
|
|
@@ -2730,6 +2724,7 @@
|
|
|
2730
2724
|
flex-shrink: 0;
|
|
2731
2725
|
}
|
|
2732
2726
|
.bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-3d-container {
|
|
2727
|
+
background: #444;
|
|
2733
2728
|
display: flex;
|
|
2734
2729
|
flex-direction: column;
|
|
2735
2730
|
overflow: hidden;
|
|
@@ -2888,7 +2883,7 @@
|
|
|
2888
2883
|
}
|
|
2889
2884
|
.bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-container__left-bottom .bee-point-cloud-container__side-view .bee-point-cloud-container__bottom-view-content,
|
|
2890
2885
|
.bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-container__left-bottom .bee-point-cloud-container__back-view .bee-point-cloud-container__bottom-view-content {
|
|
2891
|
-
|
|
2886
|
+
height: 100%;
|
|
2892
2887
|
}
|
|
2893
2888
|
.bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-container__left-bottom .bee-point-cloud-container__side-view .bee-point-cloud-container__bottom-view-content .bee-point-cloud-container__core-instance,
|
|
2894
2889
|
.bee-point-cloud-wrapper .bee-point-cloud-container__left .bee-point-cloud-container__left-bottom .bee-point-cloud-container__back-view .bee-point-cloud-container__bottom-view-content .bee-point-cloud-container__core-instance {
|
|
@@ -2917,13 +2912,15 @@
|
|
|
2917
2912
|
font-size: 14px;
|
|
2918
2913
|
}
|
|
2919
2914
|
.bee-point-cloud-wrapper .bee-point-cloud-container__right {
|
|
2920
|
-
|
|
2915
|
+
width: 100%;
|
|
2916
|
+
height: 100%;
|
|
2921
2917
|
display: flex;
|
|
2922
2918
|
flex-direction: column;
|
|
2923
2919
|
overflow: hidden;
|
|
2924
2920
|
background-color: #444;
|
|
2925
2921
|
}
|
|
2926
2922
|
.bee-point-cloud-wrapper .bee-point-cloud-container__right .bee-point-cloud-container__top-view {
|
|
2923
|
+
height: 100%;
|
|
2927
2924
|
border-bottom: 1px solid #fff;
|
|
2928
2925
|
overflow: hidden;
|
|
2929
2926
|
display: flex;
|
|
@@ -2952,7 +2949,7 @@
|
|
|
2952
2949
|
border-bottom: 1px solid #fff;
|
|
2953
2950
|
}
|
|
2954
2951
|
.bee-point-cloud-wrapper .bee-point-cloud-container__right .bee-point-cloud-container__right-bottom {
|
|
2955
|
-
|
|
2952
|
+
height: 100%;
|
|
2956
2953
|
display: flex;
|
|
2957
2954
|
overflow: auto;
|
|
2958
2955
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useState as w,useContext as T,useMemo as ot,useEffect as L}from"react";import{EditFilled as nt}from"@ant-design/icons";import{ToolIcons as
|
|
1
|
+
import e,{useState as w,useContext as T,useMemo as ot,useEffect as L}from"react";import{EditFilled as nt}from"@ant-design/icons";import{ToolIcons as it}from"../ToolIcons.js";import{EToolName as lt}from"../../../../data/enums/ToolType.js";import{cTool as rt}from"@labelbee/lb-annotation";import{PointCloudContext as B}from"../../../../components/pointCloudView/PointCloudContext.js";import{Divider as D,Input as st,message as h}from"antd";import at from"../../../../utils/StepUtils.js";import{connect as ct}from"react-redux";import{jsonParser as ut,classnames as mt}from"../../../../utils/index.js";import{useStatus as $}from"../../../../components/pointCloudView/hooks/useStatus.js";import{useSingleBox as z}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{useTranslation as k}from"react-i18next";import{LabelBeeContext as dt,useDispatch as pt}from"../../../../store/ctx.js";import ft from"./components/batchUpdateModal/index.js";import vt from"./components/annotatedBox/index.js";import gt from"./components/rectRotateSensitivitySlider/index.js";import St from"./components/findTrackIDIndex/index.js";import bt from"./components/firstFrameDataSwitch/index.js";import Ct from"./components/selectBoxVisibleSwitch/index.js";import{EPointCloudSegmentStatus as j,EPointCloudPattern as xt}from"@labelbee/lb-utils";import Et from"../../../../components/attributeList/index.js";import{useAttribute as Pt}from"../../../../components/pointCloudView/hooks/useAttribute.js";import _t from"../../../../assets/annotation/pointCloudTool/lassoSelector.svg.js";import yt from"../../../../assets/annotation/pointCloudTool/lassoSelector_a.svg.js";import wt from"../../../../assets/annotation/pointCloudTool/circleSelector.svg.js";import Dt from"../../../../assets/annotation/pointCloudTool/circleSelector_a.svg.js";import ht from"../../../../assets/annotation/rectTool/icon_rect.svg.js";import jt from"../../../../assets/annotation/rectTool/icon_rect_a.svg.js";import{sidebarCls as I}from"../index.js";import{SetTaskStepList as It}from"../../../../store/annotation/actionCreators.js";import{usePointCloudViews as Tt}from"../../../../components/pointCloudView/hooks/usePointCloudViews.js";import Lt from"../../../../components/subAttributeList/index.js";import Bt from"../../../../components/DynamicResizer/DynamicResizer.js";import{isNumber as kt}from"lodash";var Vt=Object.defineProperty,At=Object.defineProperties,Nt=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,Ot=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable,U=(o,t,n)=>t in o?Vt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,V=(o,t)=>{for(var n in t||(t={}))Ot.call(t,n)&&U(o,n,t[n]);if(F)for(var n of F(t))Rt.call(t,n)&&U(o,n,t[n]);return o},A=(o,t)=>At(o,Nt(t));const $t=()=>{const[o,t]=w(!1),n=T(B),{pointCloudBoxList:a}=n,{selectedBox:c,updateSelectedBox:i}=z(),[u,m]=w(""),{t:f}=k(),p=c==null?void 0:c.info.trackID,r=ot(()=>kt(p)&&p>=0,[p]),s=d=>!!a.find(C=>C.trackID===d&&C.id!==(c==null?void 0:c.info.id)),b=(d=!1)=>{const v=parseInt(u,10);if(d&&t(!1),isNaN(v)){h.error(f("PositiveIntegerCheck"));return}if(u.indexOf(".")>-1){h.error(f("NotAllowDecimalPointsInTrackID"));return}if(s(v)){h.error(f("DuplicateTrackIDsExist"));return}if(!(v>0)){h.error(f("PositiveIntegerCheck"));return}g(v)};L(()=>{t(!1)},[p]);const g=d=>{var v;const C=i({trackID:d});(v=n==null?void 0:n.topViewInstance)==null||v.updatePolygonList(C!=null?C:[]),n.mainViewInstance&&n.selectedPointCloudBox&&(n==null||n.mainViewInstance.generateBox(n==null?void 0:n.selectedPointCloudBox))};return e.createElement("div",{style:{padding:24}},e.createElement("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",null,f("CurrentBoxTrackIDs")),r&&e.createElement(ft,{id:p,updateCurrentPolygonList:d=>g(d)})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",lineHeight:"12px"}},o&&r?e.createElement(st,{defaultValue:p,onChange:d=>{m(d.target.value)},disabled:!r,size:"small",onBlur:()=>{b()},onPressEnter:()=>{b(!0)}}):e.createElement("span",null,p),e.createElement(nt,{style:{color:"#999",marginLeft:16,cursor:typeof p!="undefined"?"pointer":"not-allowed"},onClick:()=>{r&&t(!o)}})))},H=({segmentStatus:o,globalPattern:t})=>t===xt.Segmentation&&![j.Edit,j.Ready].includes(o),M=({attributeList:o,subAttributeList:t,toolInstance:n,config:a,stepList:c,stepInfo:i,enableColorPicker:u})=>{const[m,f]=w({segmentStatus:j.Ready}),{selectedBox:p}=z(),r=T(B),{ptSegmentInstance:s}=r,{t:b}=k(),{defaultAttribute:g}=Pt(),d=Tt(),{isPointCloudSegmentationPattern:v}=$(),C=pt(),J={fontWeight:500,fontSize:14,margin:"12px 0 8px 20px"};L(()=>{if(!!s)return s.on("syncPointCloudStatus",f),()=>{s.unbind("syncPointCloudStatus",f)}},[s]);const K=(l,x)=>{var E,P,_,N,O;const y=(E=a==null?void 0:a.attributeList)==null?void 0:E.map(S=>S.value===l?A(V({},S),{color:x}):S),R=A(V({},a),{attributeList:y}),tt=JSON.stringify(R),et=c==null?void 0:c.map(S=>(S==null?void 0:S.step)===(i==null?void 0:i.step)?A(V({},S),{config:tt}):S);(P=r==null?void 0:r.topViewInstance)==null||P.updateAttributeList(y),(_=r==null?void 0:r.sideViewInstance)==null||_.updateAttributeList(y),(N=r==null?void 0:r.backViewInstance)==null||N.updateAttributeList(y),(O=r==null?void 0:r.mainViewInstance)==null||O.setConfig(R),C(It({stepList:et}))},X=l=>{d.updateViewsByDefaultSize&&d.updateViewsByDefaultSize(l)},Y=l=>{H({globalPattern:r.globalPattern,segmentStatus:m.segmentStatus})||n.setDefaultAttribute(l)},q=(l,x)=>{H({globalPattern:r.globalPattern,segmentStatus:m.segmentStatus})||n.setSubAttribute(l,x)},G=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||m.cacheSegData&&m.segmentStatus===j.Edit,Z=v;return e.createElement("div",{style:{height:"100%",overflow:"auto",display:"flex",flexDirection:"column"}},e.createElement("div",{style:J},b("Attribute")),e.createElement("div",{style:{height:0,flex:1,overflowY:"auto",overflowX:"hidden"}},e.createElement(Et,{list:G,forbidDefault:!0,selectedAttribute:g!=null?g:"",attributeChanged:l=>Y(l),updateColorConfig:K,enableColorPicker:u,updateSize:X,forbidShowLimitPopover:Z}),e.createElement(D,{style:{margin:0}}),Q&&e.createElement(Lt,{subAttributeList:t,setSubAttribute:q,getValue:l=>{var x,E,P,_;return((E=(x=r.selectedPointCloudBox)==null?void 0:x.subAttribute)==null?void 0:E[l.value])||((_=(P=m.cacheSegData)==null?void 0:P.subAttribute)==null?void 0:_[l.value])}})))},zt=[{toolName:"LassoSelector",commonSvg:_t,selectedSvg:yt},{toolName:"RectSelector",commonSvg:ht,selectedSvg:jt},{toolName:"CircleSelector",commonSvg:wt,selectedSvg:Dt}],W=({toolInstance:o})=>{const{ptSegmentInstance:t}=T(B),[n,a]=w("LassoSelector"),{t:c}=k();return L(()=>{if(!t)return;const i=()=>{a("LassoSelector")},u=()=>{a("RectSelector")},m=()=>{a("CircleSelector")};return t.on("LassoSelector",i),t.on("RectSelector",u),t.on("CircleSelector",m),()=>{t.unbind("LassoSelector",i),t.unbind("RectSelector",u),t.unbind("CircleSelector",m)}},[t]),e.createElement("div",{className:`${I}__level`},zt.map(i=>{const u=n===i.toolName;return e.createElement("span",{className:`${I}__toolOption`,key:i.toolName,onClick:()=>t==null?void 0:t.emit(i.toolName)},e.createElement("img",{className:`${I}__singleTool`,src:u?i==null?void 0:i.selectedSvg:i==null?void 0:i.commonSvg}),e.createElement("span",{className:mt({[`${I}__toolOption__selected`]:u})},c(i.toolName)))}))},Ft=({stepInfo:o,toolInstance:t,imgList:n,imgIndex:a,stepList:c,enableColorPicker:i})=>{var u,m;const{updatePointCloudPattern:f,pointCloudPattern:p,isPointCloudSegmentationPattern:r}=$(),s=ut(o.config),b=(u=s==null?void 0:s.attributeList)!=null?u:[],g=(s==null?void 0:s.secondaryAttributeConfigurable)===!0?(m=s==null?void 0:s.inputList)!=null?m:[]:[];return r?e.createElement(e.Fragment,null,e.createElement(W,{toolInstance:t}),e.createElement(M,{toolInstance:t,attributeList:b,subAttributeList:g,config:s,stepList:c,stepInfo:o,enableColorPicker:i})):e.createElement(e.Fragment,null,e.createElement(it,{toolName:rt.EPointCloudName.PointCloud,selectedToolName:p,onChange:d=>f==null?void 0:f(d)}),e.createElement("div",{style:{flex:1,overflow:"hidden"}},e.createElement(Bt,{minTopHeight:42,defaultHeight:400,localKey:"settingid:"+(o==null?void 0:o.id)+"taskID:"+(o==null?void 0:o.taskID)+"step:"+(o==null?void 0:o.step)+"type:"+(o==null?void 0:o.type)},e.createElement(M,{toolInstance:t,attributeList:b,subAttributeList:g,config:s,stepList:c,stepInfo:o,enableColorPicker:i}),(s==null?void 0:s.trackConfigurable)===!0&&p===lt.Rect?e.createElement("div",{style:{height:"100%",overflow:"auto"}},e.createElement($t,null),e.createElement(D,{style:{margin:0}}),e.createElement(vt,{imgList:n,imgIndex:a}),e.createElement(D,{style:{margin:0}}),e.createElement(St,{imgList:n,imgIndex:a}),e.createElement(D,{style:{margin:0}}),e.createElement(gt,null),o.loadPreStep>0&&e.createElement(bt,null),e.createElement(Ct,null)):e.createElement("div",null))))},Ut=o=>{var t,n,a,c;const i=at.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,m=(c=o.annotation)==null?void 0:c.stepList;return{stepInfo:i,toolInstance:u,imgList:o.annotation.imgList,imgIndex:o.annotation.imgIndex,stepList:m}};var Ht=ct(Ut,null,null,{context:dt})(Ft);export{W as PointCloudSegToolIcon,Ht as default};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("react");var img="data:image/svg+xml,%3csvg t='1720421473527' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5364' width='200' height='200'%3e %3cpath d='M94.8 304.5L512 721.8l416-416-833.2-1.3z m0 0' p-id='5365'%3e%3c/path%3e%3c/svg%3e";module.exports=img;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("react");var img="data:image/svg+xml,%3csvg t='1720596188811' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1478' width='200' height='200'%3e %3cpath d='M36.5551 360.072857h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551Q0 440.453119 0 400.314185q0-40.190131 36.5551-40.190131z' fill='%23999999' p-id='1479' %3e%3c/path%3e %3cpath d='M36.5551 583.550465h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551q-36.5551 0-36.5551-40.190131t36.5551-40.190131z' fill='%23999999' p-id='1480' %3e%3c/path%3e %3cpath d='M553.292672 10.700302l159.634177 89.237451a58.774867 58.774867 0 0 1 29.080248 67.990438 64.406605 64.406605 0 0 1-62.409898 44.388336H344.355187a64.406605 64.406605 0 0 1-62.409897-44.388336 58.774867 58.774867 0 0 1 29.080247-67.990438L470.659714 10.700302a85.448827 85.448827 0 0 1 82.632958 0z m0 1002.654177l159.634177-89.23745a58.774867 58.774867 0 0 0 29.080248-67.990439 64.406605 64.406605 0 0 0-62.409898-44.388336H344.355187a64.406605 64.406605 0 0 0-62.409897 44.388336 58.774867 58.774867 0 0 0 29.080247 67.990439l159.634177 89.23745a85.448827 85.448827 0 0 0 82.632958 0z' fill='%23999999' p-id='1481' %3e%3c/path%3e%3c/svg%3e";module.exports=img;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("react");var img="data:image/svg+xml,%3csvg t='1720421409111' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5202' width='200' height='200'%3e %3cpath d='M928 721.8L510.8 304.5l-416 416 833.2 1.3z m0 0' p-id='5203'%3e%3c/path%3e%3c/svg%3e";module.exports=img;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"react";var t="data:image/svg+xml,%3csvg t='1720421473527' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5364' width='200' height='200'%3e %3cpath d='M94.8 304.5L512 721.8l416-416-833.2-1.3z m0 0' p-id='5365'%3e%3c/path%3e%3c/svg%3e";export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"react";var a="data:image/svg+xml,%3csvg t='1720596188811' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1478' width='200' height='200'%3e %3cpath d='M36.5551 360.072857h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551Q0 440.453119 0 400.314185q0-40.190131 36.5551-40.190131z' fill='%23999999' p-id='1479' %3e%3c/path%3e %3cpath d='M36.5551 583.550465h950.842186q36.5551 0 36.5551 40.190131t-36.5551 40.190131H36.5551q-36.5551 0-36.5551-40.190131t36.5551-40.190131z' fill='%23999999' p-id='1480' %3e%3c/path%3e %3cpath d='M553.292672 10.700302l159.634177 89.237451a58.774867 58.774867 0 0 1 29.080248 67.990438 64.406605 64.406605 0 0 1-62.409898 44.388336H344.355187a64.406605 64.406605 0 0 1-62.409897-44.388336 58.774867 58.774867 0 0 1 29.080247-67.990438L470.659714 10.700302a85.448827 85.448827 0 0 1 82.632958 0z m0 1002.654177l159.634177-89.23745a58.774867 58.774867 0 0 0 29.080248-67.990439 64.406605 64.406605 0 0 0-62.409898-44.388336H344.355187a64.406605 64.406605 0 0 0-62.409897 44.388336 58.774867 58.774867 0 0 0 29.080247 67.990439l159.634177 89.23745a85.448827 85.448827 0 0 0 82.632958 0z' fill='%23999999' p-id='1481' %3e%3c/path%3e%3c/svg%3e";export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"react";var t="data:image/svg+xml,%3csvg t='1720421409111' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5202' width='200' height='200'%3e %3cpath d='M928 721.8L510.8 304.5l-416 416 833.2 1.3z m0 0' p-id='5203'%3e%3c/path%3e%3c/svg%3e";export{t as default};
|