@labelbee/lb-components 1.17.1-alpha.2 → 1.18.0-dev.1
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/LLMToolView/questionView/index.js +1 -1
- package/dist/components/longText/index.js +1 -1
- package/dist/components/markdownView/index.js +1 -0
- package/dist/components/markdownView/index.module.scss.js +1 -0
- package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
- package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/dist/constant/index.js +1 -1
- package/dist/index.css +5 -0
- package/dist/index.js +1 -1
- package/dist/types/components/markdownView/index.d.ts +11 -0
- package/dist/types/constant/index.d.ts +4 -0
- package/dist/views/MainView/index.js +1 -1
- package/es/components/LLMToolView/questionView/index.js +1 -1
- package/es/components/longText/index.js +1 -1
- package/es/components/markdownView/index.js +1 -0
- package/es/components/markdownView/index.module.scss.js +1 -0
- package/es/components/pointCloudView/PointCloud2DView.js +1 -1
- package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
- package/es/constant/index.js +1 -1
- package/es/index.css +5 -0
- package/es/index.js +1 -1
- package/es/views/MainView/index.js +1 -1
- package/package.json +10 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),antd=require("antd"),index=require("../../longText/index.js"),index
|
|
1
|
+
"use strict";var React=require("react"),antd=require("antd"),index$2=require("../../longText/index.js"),index=require("../../../constant/index.js"),classNames=require("classnames"),reactI18next=require("react-i18next"),lbUtils=require("@labelbee/lb-utils"),index$1=require("../../markdownView/index.js"),icons=require("@ant-design/icons");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e};const LLMViewCls=`${index.prefix}-LLMView`,Header=({setDataFormatType:e,dataFormatType:t})=>{const{t:a}=reactI18next.useTranslation();return React__default.default.createElement("div",{className:`${LLMViewCls}__title`,style:{display:"flex",justifyContent:"space-between"}},a("Title"),React__default.default.createElement("span",{style:{display:"flex"}},React__default.default.createElement(antd.Radio.Group,{value:t,onChange:n=>{e(n.target.value)}},React__default.default.createElement(antd.Radio.Button,{value:index.EDataFormatType.Default,style:{textAlign:"center",width:"52px"}},"</>"),React__default.default.createElement(antd.Radio.Button,{value:index.EDataFormatType.Markdown,style:{textAlign:"center",width:"52px"}},React__default.default.createElement(icons.FileTextOutlined,null))),React__default.default.createElement("span",{style:{marginLeft:"8px",width:"4px",background:"#1890ff"}})))},QuestionView=e=>{const{hoverKey:t,answerList:a,question:n,lang:o}=e,[l,u]=React.useState(index.EDataFormatType.Default),{t:s}=reactI18next.useTranslation();return React.useEffect(()=>{var r;o&&((r=lbUtils.i18n)==null||r.changeLanguage(o))},[]),React__default.default.createElement("div",{className:LLMViewCls},React__default.default.createElement("div",{className:`${LLMViewCls}__textBox`,style:{borderBottom:"1px solid #EBEBEB"}},React__default.default.createElement(Header,{setDataFormatType:u,dataFormatType:l}),React__default.default.createElement("div",{className:`${LLMViewCls}__content`},l===index.EDataFormatType.Markdown?React__default.default.createElement(index$1,{value:n}):React__default.default.createElement(index$2,{wordCount:200,text:n}))),React__default.default.createElement("div",{className:`${LLMViewCls}__textBox`},React__default.default.createElement("div",{className:`${LLMViewCls}__title`},s("Answer")),a.map((r,d)=>React__default.default.createElement("div",{className:classNames__default.default({[`${LLMViewCls}__content`]:!0,[`${LLMViewCls}__contentActive`]:t===(r==null?void 0:r.order)}),key:d},React__default.default.createElement(antd.Tag,{style:{color:"#666FFF",background:"#eeefff",height:"20px",padding:"0px 8px",border:"none"}},r==null?void 0:r.order),l===index.EDataFormatType.Markdown?React__default.default.createElement(index$1,{value:r==null?void 0:r.answer}):React__default.default.createElement(index$2,{wordCount:1e3,text:r==null?void 0:r.answer})))))},WrapQuestionView=e=>React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(QuestionView,__spreadValues({},e)));module.exports=WrapQuestionView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),antd=require("antd"),ahooks=require("ahooks"),index=require("../../constant/index.js"),icons=require("@ant-design/icons");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,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const longTextCls=`${index.prefix}-longText`,LongText=e=>{var t,r;const{text:
|
|
1
|
+
"use strict";var React=require("react"),antd=require("antd"),ahooks=require("ahooks"),index=require("../../constant/index.js"),icons=require("@ant-design/icons");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,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const longTextCls=`${index.prefix}-longText`,LongText=e=>{var t,r;const{text:a,placement:l="bottom",icon:u=React__default.default.createElement(icons.SearchOutlined,null),openByText:f,style:i,isToolTips:d,wordCount:s}=e,o=React.useRef(null);ahooks.useSize(o);const c=o.current&&((t=o.current)==null?void 0:t.clientWidth)<((r=o.current)==null?void 0:r.scrollWidth);if(s)if((a==null?void 0:a.length)>s){const n=a.slice(0,s);return React__default.default.createElement(antd.Popover,{placement:l,overlayClassName:`${longTextCls}-popover`,content:a},React__default.default.createElement("span",{style:{cursor:"pointer",whiteSpace:"pre-wrap"}},n,"..."))}else return React__default.default.createElement("div",{style:{whiteSpace:"pre-wrap"}}," ",a);if(f){let n={placement:l,overlayClassName:`${longTextCls}-popover`,content:a,key:`${c}`};c||Object.assign(n,{open:!1});const p=React__default.default.createElement("div",{className:`${longTextCls}-text`,style:i,ref:o},a);return d?React__default.default.createElement(antd.Tooltip,__spreadProps(__spreadValues({},n),{title:a}),p):React__default.default.createElement(antd.Popover,__spreadValues({},n),p)}return React__default.default.createElement("div",{className:longTextCls,style:i},React__default.default.createElement("div",{className:`${longTextCls}-text`,ref:o},a),c&&React__default.default.createElement(antd.Popover,{placement:l,overlayClassName:`${longTextCls}-popover`,content:a},u))};module.exports=LongText;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var React=require("react"),Markdown=require("react-markdown"),remarkMath=require("remark-math"),rehypeKatex=require("rehype-katex"),SyntaxHighlighter=require("react-syntax-highlighter"),hljs=require("react-syntax-highlighter/dist/esm/styles/hljs"),remarkGfm=require("remark-gfm");require("github-markdown-css");var index_module=require("./index.module.scss.js"),index=require("../../utils/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),Markdown__default=_interopDefaultLegacy(Markdown),remarkMath__default=_interopDefaultLegacy(remarkMath),rehypeKatex__default=_interopDefaultLegacy(rehypeKatex),SyntaxHighlighter__default=_interopDefaultLegacy(SyntaxHighlighter),remarkGfm__default=_interopDefaultLegacy(remarkGfm),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,r,a)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,__spreadValues=(e,r)=>{for(var a in r||(r={}))__hasOwnProp.call(r,a)&&__defNormalProp(e,a,r[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(r))__propIsEnum.call(r,a)&&__defNormalProp(e,a,r[a]);return e},__spreadProps=(e,r)=>__defProps(e,__getOwnPropDescs(r)),__objRest=(e,r)=>{var a={};for(var t in e)__hasOwnProp.call(e,t)&&r.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))r.indexOf(t)<0&&__propIsEnum.call(e,t)&&(a[t]=e[t]);return a};const MarkdownView=e=>{const{value:r,transformImageUri:a,transformLinkUri:t,components:d}=e,u=f=>{var n=f,{node:m,inline:c,className:l,children:i}=n,o=__objRest(n,["node","inline","className","children"]);const s=/language-(\w+)/.exec(l||"");return!c&&s?React__default.default.createElement(SyntaxHighlighter__default.default,__spreadProps(__spreadValues({},o),{className:"markdown-code-viewer",language:s[1],style:hljs.docco,PreTag:"div"}),String(i).replace(/\n$/,"")):React__default.default.createElement("code",__spreadProps(__spreadValues({},o),{className:l}),i)};return React__default.default.createElement(Markdown__default.default,{className:index.classnames({"markdown-body":!0,[index_module.markdownView]:!0}),remarkPlugins:[remarkGfm__default.default,remarkMath__default.default],rehypePlugins:[rehypeKatex__default.default],transformImageUri:a,transformLinkUri:t,components:__spreadValues({code:u},d)},r)};module.exports=MarkdownView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var styles={markdownView:"index-module_markdownView__B6eyL"};module.exports=styles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),reactRedux=require("react-redux"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),map=require("../../store/annotation/map.js"),lbUtils=require("@labelbee/lb-utils"),PointCloud2DSingleView=require("./PointCloud2DSingleView.js"),index=require("./components/TitleButton/index.js"),icons=require("@ant-design/icons"),classNames=require("classnames"),icon_esc=require("../../assets/annotation/common/icon_esc.svg.js"),icon_left_squareOutlined=require("../../assets/annotation/common/icon_left_squareOutlined.svg.js"),icon_right_squareOutlined=require("../../assets/annotation/common/icon_right_squareOutlined.svg.js")
|
|
1
|
+
"use strict";var dom=require("../../utils/dom.js"),React=require("react"),PointCloudLayout=require("./PointCloudLayout.js"),PointCloudContext=require("./PointCloudContext.js"),reactRedux=require("react-redux"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../store/ctx.js"),map=require("../../store/annotation/map.js"),lbUtils=require("@labelbee/lb-utils"),PointCloud2DSingleView=require("./PointCloud2DSingleView.js"),index=require("./components/TitleButton/index.js"),icons=require("@ant-design/icons"),classNames=require("classnames"),icon_esc=require("../../assets/annotation/common/icon_esc.svg.js"),icon_left_squareOutlined=require("../../assets/annotation/common/icon_left_squareOutlined.svg.js"),icon_right_squareOutlined=require("../../assets/annotation/common/icon_right_squareOutlined.svg.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,n,t)=>n in e?__defProp(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,__spreadValues=(e,n)=>{for(var t in n||(n={}))__hasOwnProp.call(n,t)&&__defNormalProp(e,t,n[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(n))__propIsEnum.call(n,t)&&__defNormalProp(e,t,n[t]);return e},__spreadProps=(e,n)=>__defProps(e,__getOwnPropDescs(n));const EKeyCode=lbAnnotation.cKeyCode.default,ContainerTitle=({showEnlarge:e,isEnlargeTopView:n,data:t,setIsEnlarge:v,setCurIndex:u,curIndex:p=0,index:E,annotations2d:c})=>n?React__default.default.createElement(index,{title:t==null?void 0:t.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}):e?React__default.default.createElement("div",{style:{display:"flex",alignItems:"center"}},React__default.default.createElement(icons.LeftOutlined,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{v(!1),u(void 0)}}),React__default.default.createElement("span",null,t==null?void 0:t.calName),React__default.default.createElement("span",{style:{marginLeft:"8px"}},p+1,"/",c==null?void 0:c.length)):React__default.default.createElement(index,{title:t==null?void 0:t.calName,onClick:()=>{v(!0),u(E)},style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}),PointCloud2DView=({currentData:e,config:n,thumbnailWidth:t,isEnlargeTopView:v,highlightAttribute:u,loadPCDFileLoading:p,checkMode:E})=>{var c;const[s,j]=React.useState([]),{topViewInstance:k,displayPointCloudList:w}=React.useContext(PointCloudContext.PointCloudContext),[_,I]=React.useState(""),[m,b]=React.useState(!1),[a,g]=React.useState(void 0);React.useEffect(()=>{var l;if(!p&&k&&(e==null?void 0:e.mappingImgList)&&((l=e==null?void 0:e.mappingImgList)==null?void 0:l.length)>0){const o={fill:"transparent",color:"green"};let i=[];e==null||e.mappingImgList.forEach(r=>{var d;const V=w.reduce((A,f)=>{var h,L;const T=f.id===_||u===f.attribute,{transferViewData:q,viewRangePointList:y}=(h=lbAnnotation.pointCloudLidar2image(f,r.calib,{createRange:T}))!=null?h:{};if(!q||!y)return[];const O=(L=lbUtils.toolStyleConverter.getColorFromConfig({attribute:f.attribute},__spreadProps(__spreadValues({},n),{attributeConfigurable:!0}),{}))==null?void 0:L.stroke,K=S({viewDataPointList:q,pointCloudBox:f,defaultViewStyle:o,stroke:O}),F=[...A,...K];return(y==null?void 0:y.length)>0&&F.unshift({type:"polygon",annotation:__spreadProps(__spreadValues({id:_,pointList:y},o),{stroke:O,fill:"rgba(255, 255, 255, 0.6)"})}),F},[]);i.push({annotations:V,url:r==null?void 0:r.url,calName:(d=r==null?void 0:r.calib)==null?void 0:d.calName,calib:r==null?void 0:r.calib,path:r==null?void 0:r.path})}),j(i)}},[w,e==null?void 0:e.mappingImgList,_,u,p]),React.useEffect(()=>(window.addEventListener("keydown",x),()=>{window.removeEventListener("keydown",x)}),[a]);const x=l=>{const{keyCode:o}=l;switch(o){case EKeyCode.Esc:m&&b(!1);break;case EKeyCode.Left:C();break;case EKeyCode.Right:P();break}},C=()=>{a===void 0||!m||Number(a)>0&&g(a-1)},P=()=>{a===void 0||!m||Number(a)<(s==null?void 0:s.length)-1&&g(a+1)},S=({viewDataPointList:l,pointCloudBox:o,defaultViewStyle:i,stroke:r})=>l?l.map(d=>({type:d.type,annotation:__spreadProps(__spreadValues({id:o.id,pointList:d.pointList},i),{stroke:r})})):[],N=!e||!(e==null?void 0:e.mappingImgList)||!(((c=e==null?void 0:e.mappingImgList)==null?void 0:c.length)>0),R=React__default.default.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:"14px"}},React__default.default.createElement("img",{src:icon_left_squareOutlined,style:{height:"24px",marginRight:"8px",cursor:"pointer"},onClick:()=>C()}),React__default.default.createElement("span",{style:{marginRight:"12px"}},"\u952E\u76D8\u5DE6\u952E\u4E0A\u4E00\u5F20"),React__default.default.createElement("span",{style:{margin:"0px 8px 0px 12px"}},"\u952E\u76D8\u53F3\u952E\u4E0A\u4E00\u5F20"),React__default.default.createElement("img",{src:icon_right_squareOutlined,style:{height:"24px",marginRight:"12px",cursor:"pointer"},onClick:()=>P()}),React__default.default.createElement("img",{src:icon_esc,style:{height:"24px",margin:"0px 8px 0px 12px",cursor:"pointer"},onClick:()=>{b(!1),g(void 0)}}),React__default.default.createElement("span",null,"\u952E\u9000\u51FA"));return(s==null?void 0:s.length)>0?React__default.default.createElement(React__default.default.Fragment,null,s.map((l,o)=>{const i=m&&o===a;return React__default.default.createElement(PointCloudLayout.PointCloudContainer,{className:classNames__default.default({[dom.getClassName("point-cloud-2d-container")]:!0,[dom.getClassName("point-cloud-container","zoom")]:i}),title:React__default.default.createElement(ContainerTitle,{showEnlarge:i,isEnlargeTopView:v,data:l,setIsEnlarge:b,setCurIndex:g,curIndex:a,index:o,annotations2d:s}),titleOnSurface:!i,style:{display:N?"none":"flex",width:i?"100%":t},key:o,toolbar:R},(l==null?void 0:l.annotations)&&(l==null?void 0:l.url)&&React__default.default.createElement(PointCloud2DSingleView,{currentData:e,view2dData:l,setSelectedID:I,showEnlarge:i,checkMode:E}))})):null};var PointCloud2DView$1=reactRedux.connect(map.a2MapStateToProps,null,null,{context:ctx.LabelBeeContext})(PointCloud2DView);module.exports=PointCloud2DView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),useSphere=require("./useSphere.js"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),antd=require("antd"),reactI18next=require("react-i18next"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),ahooks=require("ahooks"),__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)),__async=(e,t,n)=>new Promise((a,o)=>{var d=u=>{try{c(n.next(u))}catch(h){o(h)}},P=u=>{try{c(n.throw(u))}catch(h){o(h)}},c=u=>u.done?a(u.value):Promise.resolve(u.value).then(d,P);c((n=n.apply(e,t)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,INTELLIGENT_FIT_MARGIN=.01,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPoint2PointCloud=(e,t,n,a,o)=>{const{x:d,y:P}=lbUtils.PointCloudUtils.transferCanvas2World(e,t),{defaultZ:c}=lbUtils.DEFAULT_SPHERE_PARAMS,u={center:{x:d,y:P,z:c},id:e.id},h=a?__spreadValues(__spreadValues({},a),u):__spreadProps(__spreadValues({},u),{attribute:"",valid:!0});return o&&Object.assign(h,o),h},topViewPolygon2PointCloud=(e,t,n,a,o,d)=>{let P=e.pointList.map(L=>lbUtils.PointCloudUtils.transferCanvas2World(L,t)),c=0,u=1,h={};if(n){const L=n.getSensesPointZAxisInPolygon(P,void 0,d);d&&L.fittedCoordinates.length>0&&(P=L.fittedCoordinates),c=(L.maxZ+L.minZ)/2,u=L.maxZ-L.minZ,h={count:L.zCount}}const[v,b,T]=P,V=lbAnnotation.MathUtils.getLineCenterPoint([v,T]),_=lbAnnotation.MathUtils.getLineLength(v,b),D=lbAnnotation.MathUtils.getLineLength(b,T),A=lbAnnotation.MathUtils.getRadiusFromQuadrangle(e.pointList);a&&(c=a.center.z,u=a.depth);const k={center:{x:V.x,y:V.y,z:c},width:d?D+INTELLIGENT_FIT_MARGIN:D,height:d?_+INTELLIGENT_FIT_MARGIN:_,depth:u,rotation:A,id:e.id},O=__spreadValues(a?__spreadValues(__spreadValues({},a),k):__spreadProps(__spreadValues({},k),{attribute:"",valid:!0}),h);o&&Object.assign(O,o);const z=P.map(L=>lbUtils.PointCloudUtils.transferWorld2Canvas(L,t));return{boxParams:O,newPointList:z}},sideViewPoint2PointCloud=(e,t,n)=>{const a={x:e.x-t.x,y:e.y-t.y};return __spreadProps(__spreadValues({},n),{center:{x:n.center.x-a.x,y:n.center.y,z:n.center.z-a.y}})},sideViewPolygon2PointCloud=(e,t,n,a)=>{const[o,d,P]=e.pointList,[c,u,h]=t.pointList,v=lbAnnotation.MathUtils.getLineCenterPoint([o,P]),b=lbAnnotation.MathUtils.getLineCenterPoint([c,h]),V={x:{x:v.x-b.x,y:v.y-b.y}.x,y:0,z:v.y-b.y},_=lbAnnotation.MathUtils.getLineLength(o,d),D=lbAnnotation.MathUtils.getLineLength(c,u),A=_-D,k=lbAnnotation.MathUtils.getLineLength(d,P),O=lbAnnotation.MathUtils.getLineLength(u,h),z=k-O,{newBoxParams:L}=a.getNewBoxBySideUpdate(V,z,A,n);return L},backViewPoint2PointCloud=(e,t,n)=>{const a={x:e.x-t.x,y:e.y-t.y};return __spreadProps(__spreadValues({},n),{center:{x:n.center.x,y:n.center.y-a.x,z:n.center.z-a.y}})},backViewPolygon2PointCloud=(e,t,n,a)=>{const[o,d,P]=e.pointList,[c,u,h]=t.pointList,v=lbAnnotation.MathUtils.getLineCenterPoint([o,P]),b=lbAnnotation.MathUtils.getLineCenterPoint([c,h]),V={x:{x:v.x-b.x,y:v.y-b.y}.x,y:0,z:v.y-b.y},_=lbAnnotation.MathUtils.getLineLength(o,d),D=lbAnnotation.MathUtils.getLineLength(c,u),A=_-D,k=lbAnnotation.MathUtils.getLineLength(d,P),O=lbAnnotation.MathUtils.getLineLength(u,h),z=k-O;let{newBoxParams:L}=a.getNewBoxByBackUpdate(V,z,A,n);return L},syncSideViewByPoint=(e,t,n,a,o)=>{var d;if(!n)return;const{toolInstance:P,pointCloudInstance:c}=n;c.loadPCDFile(a,(d=o==null?void 0:o.radius)!=null?d:DEFAULT_RADIUS);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,lbUtils.EPerspectiveView.Left);c.setInitCameraPosition(u);const{point2d:h,zoom:v}=c.getSphereSidePoint2DCoordinate(e);c.camera.zoom=v,c.camera.updateProjectionMatrix(),c.render(),P.initPosition(),P.zoomChangeOnCenter(v),P.setResult([__spreadProps(__spreadValues(__spreadValues({},t),h),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),P.setSelectedID(t.id)},synchronizeSideView=(e,t,n,a)=>{if(!n)return;const{pointCloud2dOperation:o,pointCloudInstance:d}=n;d.loadPCDFileByBox(a,e,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:P}=d.updateOrthoCamera(e,lbUtils.EPerspectiveView.Left);d.setInitCameraPosition(P);const{polygon2d:c,zoom:u}=d.getBoxSidePolygon2DCoordinate(e);d.camera.zoom=u,d.camera.updateProjectionMatrix(),d.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},syncBackViewByPoint=(e,t,n,a,o)=>{var d;if(!n)return;const{toolInstance:P,pointCloudInstance:c}=n;c.loadPCDFile(a,(d=o==null?void 0:o.radius)!=null?d:DEFAULT_RADIUS);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,lbUtils.EPerspectiveView.Back);c.setInitCameraPosition(u);const{point2d:h,zoom:v}=c.getSphereBackPoint2DCoordinate(e);c.camera.zoom=v,c.camera.updateProjectionMatrix(),c.render(),P.initPosition(),P.zoomChangeOnCenter(v),P.setResult([__spreadProps(__spreadValues(__spreadValues({},t),h),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),P.setSelectedID(t.id)},synchronizeBackView=(e,t,n,a)=>{if(!n)return;const{pointCloud2dOperation:o,pointCloudInstance:d}=n;d.loadPCDFileByBox(a,e,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:P}=d.updateOrthoCamera(e,lbUtils.EPerspectiveView.Back);d.setInitCameraPosition(P);const{polygon2d:c,zoom:u}=d.getBoxBackPolygon2DCoordinate(e);d.camera.zoom=u,d.camera.updateProjectionMatrix(),d.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},syncTopViewByPoint=(e,t,n,a)=>{if(!n||!a)return;a.generateSphere(e),a.updateCameraBySphere(e,lbUtils.EPerspectiveView.Top),a.render();const{toolInstance:o,pointCloudInstance:d}=n,{point2d:P}=d.getSphereTopPoint2DCoordinate(e),c=[...o.pointList].map(u=>u.id===t.id?__spreadProps(__spreadValues(__spreadValues({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute}):u);o.setResult(c),o.setSelectedID(t.id)},synchronizeTopView=(e,t,n,a)=>{var o,d;if(!n||!a)return;a.generateBox(e,t.id),a.render();const{pointCloud2dOperation:P,pointCloudInstance:c}=n,{polygon2d:u}=c.getBoxTopPolygon2DCoordinate(e),h=[...P.polygonList],v=h.find(b=>b.id===t.id);v?(v.pointList=u,v.valid=(o=e.valid)!=null?o:!0):h.push({id:t.id,pointList:u,textAttribute:"",isRect:!0,valid:(d=e.valid)!=null?d:!0}),P.setResultAndSelectedID(h,t.id)},usePointCloudViews=()=>{const e=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:t,sideViewInstance:n,backViewInstance:a,mainViewInstance:o,addPointCloudBox:d,addPointCloudSphere:P,setSelectedIDs:c,selectedIDs:u,pointCloudBoxList:h,pointCloudSphereList:v,hideAttributes:b,setHighlight2DDataList:T,cuboidBoxIn2DView:V,imageSizes:_}=e,{addHistory:D,initHistory:A,pushHistoryUnderUpdatePolygon:k}=useHistory.useHistory(),{selectedPolygon:O}=usePolygon.usePolygon(),{getPointCloudSphereByID:z,updatePointCloudSphere:L,selectedSphere:q}=useSphere.useSphere(),{currentData:j,config:m}=ctx.useSelector(i=>{const{stepList:r,step:p,imgList:s,imgIndex:l}=i.annotation;return{currentData:s[l],config:index.jsonParser(StepUtils.getCurrentStepInfo(p,r).config)}}),R=ctx.useDispatch(),tt=ahooks.useLatest(V),W=i=>{if(!tt.current){const{mappingImgList:r=[]}=j,p=r.map(s=>index.getRectPointCloudBox({pointCloudBox:i,mappingData:s,imageSizes:_}));Object.assign(i,{rects:p.filter(s=>s!==void 0)})}},{selectedBox:I,updateSelectedBox:ot,updateSelectedBoxes:Z,getPointCloudByID:et}=useSingleBox.useSingleBox({generateRects:W}),{t:it}=reactI18next.useTranslation(),X=I==null?void 0:I.info;if(!t||!n||!a)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:G}=t,nt=i=>{o==null||o.generateBox(i),o==null||o.controls.update(),o==null||o.render()},st=i=>{o==null||o.generateSphere(i),o==null||o.controls.update(),o==null||o.render()},rt=({newPoint:i,size:r,zoom:p,trackConfigurable:s})=>{var l;const C={attribute:(l=t.toolInstance.defaultAttribute)!=null?l:""};s===!0&&Object.assign(C,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:v})});const g=topViewPoint2PointCloud(i,r,G,void 0,C);c(i.id);const f=P(g);H(PointCloudView.Top,i,g,p,f,m),D({newSphereParams:g})},lt=({polygon:i,size:r,imgList:p,trackConfigurable:s,zoom:l,intelligentFit:C})=>{var g,f;const x={attribute:(g=t.toolInstance.defaultAttribute)!=null?g:""};s===!0&&Object.assign(x,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:h,extraSphereList:v})});const B=t==null?void 0:t.toolInstance,w=__spreadValues({},i);let{boxParams:y,newPointList:U}=topViewPolygon2PointCloud(w,r,G,void 0,x,C);if(y=R(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[y],stepConfig:m,action:"viewUpdateBox"}))[0],(m==null?void 0:m.lowerLimitPointsNumInBox)&&typeof y.count=="number"&&y.count<m.lowerLimitPointsNumInBox){antd.message.info(it("LowerLimitPointsNumInBox",{num:m.lowerLimitPointsNumInBox})),B.deletePolygon(y.id);return}C&&(U==null?void 0:U.length)&&(w.pointList=U);const S=b.includes(w.attribute);W(y);const N=d(y),Q=(f=e==null?void 0:e.polygonList)!=null?f:[];t==null||t.updatePolygonList(N!=null?N:[],Q),S?c([]):(c(y.id),B.selection.setSelectedIDs(w.id),E({omitView:PointCloudView.Top,polygon:w,boxParams:y,zoom:l,newPointCloudBoxList:N}),C&&synchronizeTopView(y,w,t,o)),D({newBoxParams:y})},at=i=>{const{boxID:r,imageName:p,width:s,height:l,x:C,y:g}=i,f=h.find(x=>x.id===r);if(f==null?void 0:f.rects){const{rects:x=[]}=f,B=x.find(w=>w.imageName===p);if(B){let w=x;const y=__spreadProps(__spreadValues({},B),{width:s,height:l,x:C,y:g});w=x.map(S=>S===B?y:S);const U=__spreadProps(__spreadValues({},f),{rects:w}),M=h.map(S=>S===f?U:S);return t==null||t.updatePolygonList(M!=null?M:[]),M}}},dt=({newSelectedBox:i,newPointCloudList:r,newSelectedSphere:p,newSphereList:s})=>{var l;const C=t==null?void 0:t.toolInstance;if(!(u.length===0||!C)){if(i||(I==null?void 0:I.info)){const g=i!=null?i:I==null?void 0:I.info;(l=C==null?void 0:C.selection)==null||l.setSelectedIDs(u[0]);const f=C.selectedPolygon;if(u.length===1&&g){E({omitView:PointCloudView.Top,polygon:f,boxParams:g,newPointCloudBoxList:r});return}}if((p||q)&&u.length===1){const g=p!=null?p:q;C.setSelectedID(u[0]);const f=C.selectedPoint;g&&H(PointCloudView.Top,f,g,void 0,s,m)}}},Y=(i,r,p)=>{if(X){let s,l;switch(p){case PointCloudView.Back:s=backViewPolygon2PointCloud;break;case PointCloudView.Side:s=sideViewPolygon2PointCloud;break;default:s=sideViewPolygon2PointCloud;break}l=s(i,r,X,n.pointCloudInstance);const g=R(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[l],stepConfig:m,action:"viewUpdateBox"}))[0],f=l.valid!==g.valid;if(l=g,o){const{count:B}=o.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(l).polygonPointList,[l.center.z-l.depth/2,l.center.z+l.depth/2]);l=__spreadProps(__spreadValues({},l),{count:B})}const x=ot(l);return l=x.find(B=>B.id===l.id),E({omitView:f?void 0:p,polygon:i,boxParams:l,newPointCloudBoxList:x}),x}},J=(i,r,p)=>{if(q){let s,l;switch(p){case PointCloudView.Back:s=backViewPoint2PointCloud;break;case PointCloudView.Side:s=sideViewPoint2PointCloud;break;default:s=sideViewPoint2PointCloud;break}l=s(i,r,q);const C=L(l);return H(p,i,l,void 0,C,m),C}},ct=(i,r)=>{J(i,r,PointCloudView.Side)},ut=(i,r)=>{J(i,r,PointCloudView.Back)},pt=(i,r)=>{Y(i,r,PointCloudView.Side)},Pt=(i,r)=>{Y(i,r,PointCloudView.Back)},Ct=(i,r)=>{const p=z(i.id),s=topViewPoint2PointCloud(i,r,G,p),l=L(s);H(PointCloudView.Top,i,s,void 0,l,m)},gt=(i,r)=>{if(O){const s=__spreadValues({},i[0].newPolygon);s.pointList=s.pointList.map(l=>lbUtils.PointCloudUtils.transferCanvas2World(l,r)),k(s);return}let p=i.map(({newPolygon:s})=>{const l=et(s.id),{boxParams:C}=topViewPolygon2PointCloud(s,r,t.pointCloudInstance,l);return C});if(p=R(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:p,stepConfig:m,action:"viewUpdateBox"})),p.length===1){const{newPolygon:s}=i[0],l=Z(p);E({polygon:s,boxParams:p[0],newPointCloudBoxList:l})}else{const s=Z(p);s&&e.syncAllViewPointCloudColor(s)}},ht=i=>{var r,p,s,l,C;if(I){const g=Number(i.widthDefault),f=Number(i.depthDefault),x=Number(i.heightDefault),B=I==null?void 0:I.info.trackID,y=((r=t==null?void 0:t.toolInstance)==null?void 0:r.polygonList).find(F=>(F==null?void 0:F.trackID)===B),U={width:(s=(p=t==null?void 0:t.toolInstance)==null?void 0:p.basicImgInfo)==null?void 0:s.width,height:(C=(l=t==null?void 0:t.toolInstance)==null?void 0:l.basicImgInfo)==null?void 0:C.height},M=y.pointList.map(F=>lbUtils.PointCloudUtils.transferCanvas2World(F,U)),S=lbAnnotation.MathUtils.getModifiedRectangleCoordinates(M,x,g),N=S[0],Q=S[2],K=lbAnnotation.MathUtils.getLineCenterPoint([N,Q]),ft=I.info.center.z-I.info.depth/2,$=__spreadProps(__spreadValues({},I.info),{center:{x:K.x,y:K.y,z:ft+f/2},width:g,height:x,depth:f,valid:!0}),xt=Z([$]);E({omitView:PointCloudView["3D"],polygon:y,boxParams:$,newPointCloudBoxList:xt})}},H=(i,r,p,s,l,C)=>__async(void 0,null,function*(){const g=j==null?void 0:j.url,f={[PointCloudView.Side]:()=>{syncSideViewByPoint(p,r,n,g,C)},[PointCloudView.Back]:()=>{a&&syncBackViewByPoint(p,r,a,g,C)},[PointCloudView.Top]:()=>{syncTopViewByPoint(p,r,t,o)}};Object.keys(f).forEach(x=>{x!==i&&f[x]()}),s&&(o==null||o.updateCameraZoom(s)),st(p)}),E=i=>__async(void 0,null,function*(){const{omitView:r,polygon:p,boxParams:s,zoom:l,newPointCloudBoxList:C}=i,g=j==null?void 0:j.url;C&&(yield e.syncAllViewPointCloudColor(C));const f={[PointCloudView.Side]:()=>{synchronizeSideView(s,p,n,g)},[PointCloudView.Back]:()=>{a&&synchronizeBackView(s,p,a,g)},[PointCloudView.Top]:()=>{synchronizeTopView(s,p,t,o)}};Object.keys(f).forEach(x=>{x!==r&&f[x]()}),l&&(o==null||o.updateCameraZoom(l)),nt(s)});return{topViewAddSphere:rt,topViewAddBox:lt,topViewSelectedChanged:dt,topViewUpdatePoint:Ct,sideViewUpdatePoint:ct,backViewUpdatePoint:ut,topViewUpdateBox:gt,sideViewUpdateBox:pt,backViewUpdateBox:Pt,pointCloudBoxListUpdated:i=>{t.updatePolygonList(i),o==null||o.generateBoxes(i)},initPointCloud3d:i=>{if(!o)return;const r=lbUtils.PointCloudUtils.getDefaultOrthographicParams(i);o.initOrthographicCamera(r),o.initRenderer(),o.render()},updatePointCloudData:(...i)=>__async(void 0,[...i],function*(r=j){var p,s,l,C,g,f;if(!(r==null?void 0:r.url)||!o)return;T([]),actionCreators.SetPointCloudLoading(R,!0),actionCreators.SetLoadPCDFileLoading(R,!0),yield o.loadPCDFile(r.url,(p=m==null?void 0:m.radius)!=null?p:DEFAULT_RADIUS),o==null||o.clearAllBox(),o==null||o.clearAllSphere();let x=[],B=[],w=[],y=[];o.updateTopCamera();const U=(l=(s=index.jsonParser(r.result))==null?void 0:s.valid)!=null?l:!0;e.setPointCloudValid(U),(C=e.sideViewInstance)==null||C.clearAllData(),(g=e.backViewInstance)==null||g.clearAllData(),t.updateData(r.url,r.result,{radius:(f=m==null?void 0:m.radius)!=null?f:DEFAULT_RADIUS}),r.result&&(x=lbUtils.PointCloudUtils.getBoxParamsFromResultList(r.result),w=lbUtils.PointCloudUtils.getPolygonListFromResultList(r.result),B=lbUtils.PointCloudUtils.getLineListFromResultList(r.result),y=lbUtils.PointCloudUtils.getSphereParamsFromResultList(r.result),o==null||o.generateBoxes(x),o==null||o.generateSpheres(y),yield e.syncAllViewPointCloudColor(x,[])),A({pointCloudBoxList:x,polygonList:w,lineList:B,pointCloudSphereList:y}),actionCreators.SetPointCloudLoading(R,!1),actionCreators.SetLoadPCDFileLoading(R,!1)}),updateViewsByDefaultSize:ht,generateRects:W,update2DViewRect:at}};exports.syncBackViewByPoint=syncBackViewByPoint,exports.syncSideViewByPoint=syncSideViewByPoint,exports.syncTopViewByPoint=syncTopViewByPoint,exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPoint2PointCloud=topViewPoint2PointCloud,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),PointCloudContext=require("../PointCloudContext.js"),useSingleBox=require("./useSingleBox.js"),useSphere=require("./useSphere.js"),ctx=require("../../../store/ctx.js"),StepUtils=require("../../../utils/StepUtils.js"),index=require("../../../utils/index.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),antd=require("antd"),reactI18next=require("react-i18next"),useHistory=require("./useHistory.js"),usePolygon=require("./usePolygon.js"),ahooks=require("ahooks"),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,i)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,__spreadValues=(e,t)=>{for(var i in t||(t={}))__hasOwnProp.call(t,i)&&__defNormalProp(e,i,t[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(t))__propIsEnum.call(t,i)&&__defNormalProp(e,i,t[i]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,i)=>new Promise((a,o)=>{var d=u=>{try{c(i.next(u))}catch(h){o(h)}},P=u=>{try{c(i.throw(u))}catch(h){o(h)}},c=u=>u.done?a(u.value):Promise.resolve(u.value).then(d,P);c((i=i.apply(e,t)).next())});const DEFAULT_SCOPE=5,DEFAULT_RADIUS=90,INTELLIGENT_FIT_MARGIN=.01,PointCloudView={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},topViewPoint2PointCloud=(e,t,i,a,o)=>{const{x:d,y:P}=lbUtils.PointCloudUtils.transferCanvas2World(e,t),{defaultZ:c}=lbUtils.DEFAULT_SPHERE_PARAMS,u={center:{x:d,y:P,z:c},id:e.id},h=a?__spreadValues(__spreadValues({},a),u):__spreadProps(__spreadValues({},u),{attribute:"",valid:!0});return o&&Object.assign(h,o),h},topViewPolygon2PointCloud=(e,t,i,a,o,d)=>{let P=e.pointList.map(L=>lbUtils.PointCloudUtils.transferCanvas2World(L,t)),c=0,u=1,h={};if(i){const L=i.getSensesPointZAxisInPolygon(P,void 0,d);d&&L.fittedCoordinates.length>0&&(P=L.fittedCoordinates),c=(L.maxZ+L.minZ)/2,u=L.maxZ-L.minZ,h={count:L.zCount}}const[v,b,T]=P,V=lbAnnotation.MathUtils.getLineCenterPoint([v,T]),_=lbAnnotation.MathUtils.getLineLength(v,b),D=lbAnnotation.MathUtils.getLineLength(b,T),A=lbAnnotation.MathUtils.getRadiusFromQuadrangle(e.pointList);a&&(c=a.center.z,u=a.depth);const k={center:{x:V.x,y:V.y,z:c},width:d?D+INTELLIGENT_FIT_MARGIN:D,height:d?_+INTELLIGENT_FIT_MARGIN:_,depth:u,rotation:A,id:e.id},O=__spreadValues(a?__spreadValues(__spreadValues({},a),k):__spreadProps(__spreadValues({},k),{attribute:"",valid:!0}),h);o&&Object.assign(O,o);const z=P.map(L=>lbUtils.PointCloudUtils.transferWorld2Canvas(L,t));return{boxParams:O,newPointList:z}},sideViewPoint2PointCloud=(e,t,i)=>{const a={x:e.x-t.x,y:e.y-t.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x-a.x,y:i.center.y,z:i.center.z-a.y}})},sideViewPolygon2PointCloud=(e,t,i,a)=>{const[o,d,P]=e.pointList,[c,u,h]=t.pointList,v=lbAnnotation.MathUtils.getLineCenterPoint([o,P]),b=lbAnnotation.MathUtils.getLineCenterPoint([c,h]),V={x:{x:v.x-b.x,y:v.y-b.y}.x,y:0,z:v.y-b.y},_=lbAnnotation.MathUtils.getLineLength(o,d),D=lbAnnotation.MathUtils.getLineLength(c,u),A=_-D,k=lbAnnotation.MathUtils.getLineLength(d,P),O=lbAnnotation.MathUtils.getLineLength(u,h),z=k-O,{newBoxParams:L}=a.getNewBoxBySideUpdate(V,z,A,i);return L},backViewPoint2PointCloud=(e,t,i)=>{const a={x:e.x-t.x,y:e.y-t.y};return __spreadProps(__spreadValues({},i),{center:{x:i.center.x,y:i.center.y-a.x,z:i.center.z-a.y}})},backViewPolygon2PointCloud=(e,t,i,a)=>{const[o,d,P]=e.pointList,[c,u,h]=t.pointList,v=lbAnnotation.MathUtils.getLineCenterPoint([o,P]),b=lbAnnotation.MathUtils.getLineCenterPoint([c,h]),V={x:{x:v.x-b.x,y:v.y-b.y}.x,y:0,z:v.y-b.y},_=lbAnnotation.MathUtils.getLineLength(o,d),D=lbAnnotation.MathUtils.getLineLength(c,u),A=_-D,k=lbAnnotation.MathUtils.getLineLength(d,P),O=lbAnnotation.MathUtils.getLineLength(u,h),z=k-O;let{newBoxParams:L}=a.getNewBoxByBackUpdate(V,z,A,i);return L},syncSideViewByPoint=(e,t,i,a,o)=>{var d;if(!i)return;const{toolInstance:P,pointCloudInstance:c}=i;c.loadPCDFile(a,(d=o==null?void 0:o.radius)!=null?d:DEFAULT_RADIUS);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,lbUtils.EPerspectiveView.Left);c.setInitCameraPosition(u);const{point2d:h,zoom:v}=c.getSphereSidePoint2DCoordinate(e);c.camera.zoom=v,c.camera.updateProjectionMatrix(),c.render(),P.initPosition(),P.zoomChangeOnCenter(v),P.setResult([__spreadProps(__spreadValues(__spreadValues({},t),h),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),P.setSelectedID(t.id)},synchronizeSideView=(e,t,i,a)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:d}=i;d.loadPCDFileByBox(a,e,{width:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:P}=d.updateOrthoCamera(e,lbUtils.EPerspectiveView.Left);d.setInitCameraPosition(P);const{polygon2d:c,zoom:u}=d.getBoxSidePolygon2DCoordinate(e);d.camera.zoom=u,d.camera.updateProjectionMatrix(),d.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},syncBackViewByPoint=(e,t,i,a,o)=>{var d;if(!i)return;const{toolInstance:P,pointCloudInstance:c}=i;c.loadPCDFile(a,(d=o==null?void 0:o.radius)!=null?d:DEFAULT_RADIUS);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,lbUtils.EPerspectiveView.Back);c.setInitCameraPosition(u);const{point2d:h,zoom:v}=c.getSphereBackPoint2DCoordinate(e);c.camera.zoom=v,c.camera.updateProjectionMatrix(),c.render(),P.initPosition(),P.zoomChangeOnCenter(v),P.setResult([__spreadProps(__spreadValues(__spreadValues({},t),h),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),P.setSelectedID(t.id)},synchronizeBackView=(e,t,i,a)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:d}=i;d.loadPCDFileByBox(a,e,{height:DEFAULT_SCOPE,depth:DEFAULT_SCOPE});const{cameraPositionVector:P}=d.updateOrthoCamera(e,lbUtils.EPerspectiveView.Back);d.setInitCameraPosition(P);const{polygon2d:c,zoom:u}=d.getBoxBackPolygon2DCoordinate(e);d.camera.zoom=u,d.camera.updateProjectionMatrix(),d.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},syncTopViewByPoint=(e,t,i,a)=>{if(!i||!a)return;a.generateSphere(e),a.updateCameraBySphere(e,lbUtils.EPerspectiveView.Top),a.render();const{toolInstance:o,pointCloudInstance:d}=i,{point2d:P}=d.getSphereTopPoint2DCoordinate(e),c=[...o.pointList].map(u=>u.id===t.id?__spreadProps(__spreadValues(__spreadValues({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute}):u);o.setResult(c),o.setSelectedID(t.id)},synchronizeTopView=(e,t,i,a)=>{var o,d;if(!i||!a)return;a.generateBox(e,t.id),a.render();const{pointCloud2dOperation:P,pointCloudInstance:c}=i,{polygon2d:u}=c.getBoxTopPolygon2DCoordinate(e),h=[...P.polygonList],v=h.find(b=>b.id===t.id);v?(v.pointList=u,v.valid=(o=e.valid)!=null?o:!0):h.push({id:t.id,pointList:u,textAttribute:"",isRect:!0,valid:(d=e.valid)!=null?d:!0}),P.setResultAndSelectedID(h,t.id)},usePointCloudViews=()=>{const e=React.useContext(PointCloudContext.PointCloudContext),{topViewInstance:t,sideViewInstance:i,backViewInstance:a,mainViewInstance:o,addPointCloudBox:d,addPointCloudSphere:P,setSelectedIDs:c,selectedIDs:u,pointCloudBoxList:h,pointCloudSphereList:v,hideAttributes:b,setHighlight2DDataList:T,cuboidBoxIn2DView:V,imageSizes:_}=e,{addHistory:D,initHistory:A,pushHistoryUnderUpdatePolygon:k}=useHistory.useHistory(),{selectedPolygon:O}=usePolygon.usePolygon(),{getPointCloudSphereByID:z,updatePointCloudSphere:L,selectedSphere:q}=useSphere.useSphere(),{currentData:j,config:m}=ctx.useSelector(n=>{const{stepList:s,step:p,imgList:r,imgIndex:l}=n.annotation;return{currentData:r[l],config:index.jsonParser(StepUtils.getCurrentStepInfo(p,s).config)}}),R=ctx.useDispatch(),tt=ahooks.useLatest(V),W=n=>{if(!tt.current){const{mappingImgList:s=[]}=j,p=s.map(r=>index.getRectPointCloudBox({pointCloudBox:n,mappingData:r,imageSizes:_}));Object.assign(n,{rects:p.filter(r=>r!==void 0)})}},{selectedBox:I,updateSelectedBox:ot,updateSelectedBoxes:Z,getPointCloudByID:et}=useSingleBox.useSingleBox({generateRects:W}),{t:nt}=reactI18next.useTranslation(),X=I==null?void 0:I.info;if(!t||!i||!a)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:G}=t,it=n=>{o==null||o.generateBox(n),o==null||o.controls.update(),o==null||o.render()},st=n=>{o==null||o.generateSphere(n),o==null||o.controls.update(),o==null||o.render()},rt=({newPoint:n,size:s,zoom:p,trackConfigurable:r})=>{var l;const C={attribute:(l=t.toolInstance.defaultAttribute)!=null?l:""};r===!0&&Object.assign(C,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:v})});const g=topViewPoint2PointCloud(n,s,G,void 0,C);c(n.id);const f=P(g);H(PointCloudView.Top,n,g,p,f,m),D({newSphereParams:g})},lt=({polygon:n,size:s,imgList:p,trackConfigurable:r,zoom:l,intelligentFit:C})=>{var g,f;const x={attribute:(g=t.toolInstance.defaultAttribute)!=null?g:""};r===!0&&Object.assign(x,{trackID:lbUtils.PointCloudUtils.getNextTrackID({imgList:[],extraBoxList:h,extraSphereList:v})});const B=t==null?void 0:t.toolInstance,w=__spreadValues({},n);let{boxParams:y,newPointList:U}=topViewPolygon2PointCloud(w,s,G,void 0,x,C);if(y=R(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[y],stepConfig:m,action:"viewUpdateBox"}))[0],(m==null?void 0:m.lowerLimitPointsNumInBox)&&typeof y.count=="number"&&y.count<m.lowerLimitPointsNumInBox){antd.message.info(nt("LowerLimitPointsNumInBox",{num:m.lowerLimitPointsNumInBox})),B.deletePolygon(y.id);return}C&&(U==null?void 0:U.length)&&(w.pointList=U);const S=b.includes(w.attribute);W(y);const N=d(y),Q=(f=e==null?void 0:e.polygonList)!=null?f:[];t==null||t.updatePolygonList(N!=null?N:[],Q),S?c([]):(c(y.id),B.selection.setSelectedIDs(w.id),E({omitView:PointCloudView.Top,polygon:w,boxParams:y,zoom:l,newPointCloudBoxList:N}),C&&synchronizeTopView(y,w,t,o)),D({newBoxParams:y})},at=n=>{const{boxID:s,imageName:p,width:r,height:l,x:C,y:g}=n,f=h.find(x=>x.id===s);if(f==null?void 0:f.rects){const{rects:x=[]}=f,B=x.find(w=>w.imageName===p);if(B){let w=x;const y=__spreadProps(__spreadValues({},B),{width:r,height:l,x:C,y:g});w=x.map(S=>S===B?y:S);const U=__spreadProps(__spreadValues({},f),{rects:w}),M=h.map(S=>S===f?U:S);return t==null||t.updatePolygonList(M!=null?M:[]),M}}},dt=({newSelectedBox:n,newPointCloudList:s,newSelectedSphere:p,newSphereList:r})=>{var l;const C=t==null?void 0:t.toolInstance;if(!(u.length===0||!C)){if(n||(I==null?void 0:I.info)){const g=n!=null?n:I==null?void 0:I.info;(l=C==null?void 0:C.selection)==null||l.setSelectedIDs(u[0]);const f=C.selectedPolygon;if(u.length===1&&g){E({omitView:PointCloudView.Top,polygon:f,boxParams:g,newPointCloudBoxList:s});return}}if((p||q)&&u.length===1){const g=p!=null?p:q;C.setSelectedID(u[0]);const f=C.selectedPoint;g&&H(PointCloudView.Top,f,g,void 0,r,m)}}},Y=(n,s,p)=>{if(X){let r,l;switch(p){case PointCloudView.Back:r=backViewPolygon2PointCloud;break;case PointCloudView.Side:r=sideViewPolygon2PointCloud;break;default:r=sideViewPolygon2PointCloud;break}l=r(n,s,X,i.pointCloudInstance);const g=R(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:[l],stepConfig:m,action:"viewUpdateBox"}))[0],f=l.valid!==g.valid;if(l=g,o){const{count:B}=o.getSensesPointZAxisInPolygon(lbAnnotation.getCuboidFromPointCloudBox(l).polygonPointList,[l.center.z-l.depth/2,l.center.z+l.depth/2]);l=__spreadProps(__spreadValues({},l),{count:B})}const x=ot(l);return l=x.find(B=>B.id===l.id),E({omitView:f?void 0:p,polygon:n,boxParams:l,newPointCloudBoxList:x}),x}},J=(n,s,p)=>{if(q){let r,l;switch(p){case PointCloudView.Back:r=backViewPoint2PointCloud;break;case PointCloudView.Side:r=sideViewPoint2PointCloud;break;default:r=sideViewPoint2PointCloud;break}l=r(n,s,q);const C=L(l);return H(p,n,l,void 0,C,m),C}},ct=(n,s)=>{J(n,s,PointCloudView.Side)},ut=(n,s)=>{J(n,s,PointCloudView.Back)},pt=(n,s)=>{Y(n,s,PointCloudView.Side)},Pt=(n,s)=>{Y(n,s,PointCloudView.Back)},Ct=(n,s)=>{const p=z(n.id),r=topViewPoint2PointCloud(n,s,G,p),l=L(r);H(PointCloudView.Top,n,r,void 0,l,m)},gt=(n,s)=>{if(O){const r=n[0].newPolygon;r.pointList=r.pointList.map(l=>lbUtils.PointCloudUtils.transferCanvas2World(l,s)),k(n[0].newPolygon);return}let p=n.map(({newPolygon:r})=>{const l=et(r.id),{boxParams:C}=topViewPolygon2PointCloud(r,s,t.pointCloudInstance,l);return C});if(p=R(actionCreators.PreDataProcess({tool:lbAnnotation.EPointCloudName.PointCloud,dataList:p,stepConfig:m,action:"viewUpdateBox"})),p.length===1){const{newPolygon:r}=n[0],l=Z(p);E({polygon:r,boxParams:p[0],newPointCloudBoxList:l})}else{const r=Z(p);r&&e.syncAllViewPointCloudColor(r)}},ht=n=>{var s,p,r,l,C;if(I){const g=Number(n.widthDefault),f=Number(n.depthDefault),x=Number(n.heightDefault),B=I==null?void 0:I.info.trackID,y=((s=t==null?void 0:t.toolInstance)==null?void 0:s.polygonList).find(F=>(F==null?void 0:F.trackID)===B),U={width:(r=(p=t==null?void 0:t.toolInstance)==null?void 0:p.basicImgInfo)==null?void 0:r.width,height:(C=(l=t==null?void 0:t.toolInstance)==null?void 0:l.basicImgInfo)==null?void 0:C.height},M=y.pointList.map(F=>lbUtils.PointCloudUtils.transferCanvas2World(F,U)),S=lbAnnotation.MathUtils.getModifiedRectangleCoordinates(M,x,g),N=S[0],Q=S[2],K=lbAnnotation.MathUtils.getLineCenterPoint([N,Q]),ft=I.info.center.z-I.info.depth/2,$=__spreadProps(__spreadValues({},I.info),{center:{x:K.x,y:K.y,z:ft+f/2},width:g,height:x,depth:f,valid:!0}),xt=Z([$]);E({omitView:PointCloudView["3D"],polygon:y,boxParams:$,newPointCloudBoxList:xt})}},H=(n,s,p,r,l,C)=>__async(void 0,null,function*(){const g=j==null?void 0:j.url,f={[PointCloudView.Side]:()=>{syncSideViewByPoint(p,s,i,g,C)},[PointCloudView.Back]:()=>{a&&syncBackViewByPoint(p,s,a,g,C)},[PointCloudView.Top]:()=>{syncTopViewByPoint(p,s,t,o)}};Object.keys(f).forEach(x=>{x!==n&&f[x]()}),r&&(o==null||o.updateCameraZoom(r)),st(p)}),E=n=>__async(void 0,null,function*(){const{omitView:s,polygon:p,boxParams:r,zoom:l,newPointCloudBoxList:C}=n,g=j==null?void 0:j.url;C&&(yield e.syncAllViewPointCloudColor(C));const f={[PointCloudView.Side]:()=>{synchronizeSideView(r,p,i,g)},[PointCloudView.Back]:()=>{a&&synchronizeBackView(r,p,a,g)},[PointCloudView.Top]:()=>{synchronizeTopView(r,p,t,o)}};Object.keys(f).forEach(x=>{x!==s&&f[x]()}),l&&(o==null||o.updateCameraZoom(l)),it(r)});return{topViewAddSphere:rt,topViewAddBox:lt,topViewSelectedChanged:dt,topViewUpdatePoint:Ct,sideViewUpdatePoint:ct,backViewUpdatePoint:ut,topViewUpdateBox:gt,sideViewUpdateBox:pt,backViewUpdateBox:Pt,pointCloudBoxListUpdated:n=>{t.updatePolygonList(n),o==null||o.generateBoxes(n)},initPointCloud3d:n=>{if(!o)return;const s=lbUtils.PointCloudUtils.getDefaultOrthographicParams(n);o.initOrthographicCamera(s),o.initRenderer(),o.render()},updatePointCloudData:(...n)=>__async(void 0,[...n],function*(s=j){var p,r,l,C,g,f;if(!(s==null?void 0:s.url)||!o)return;T([]),actionCreators.SetPointCloudLoading(R,!0),actionCreators.SetLoadPCDFileLoading(R,!0),yield o.loadPCDFile(s.url,(p=m==null?void 0:m.radius)!=null?p:DEFAULT_RADIUS),o==null||o.clearAllBox(),o==null||o.clearAllSphere();let x=[],B=[],w=[],y=[];o.updateTopCamera();const U=(l=(r=index.jsonParser(s.result))==null?void 0:r.valid)!=null?l:!0;e.setPointCloudValid(U),(C=e.sideViewInstance)==null||C.clearAllData(),(g=e.backViewInstance)==null||g.clearAllData(),t.updateData(s.url,s.result,{radius:(f=m==null?void 0:m.radius)!=null?f:DEFAULT_RADIUS}),s.result&&(x=lbUtils.PointCloudUtils.getBoxParamsFromResultList(s.result),w=lbUtils.PointCloudUtils.getPolygonListFromResultList(s.result),B=lbUtils.PointCloudUtils.getLineListFromResultList(s.result),y=lbUtils.PointCloudUtils.getSphereParamsFromResultList(s.result),o==null||o.generateBoxes(x),o==null||o.generateSpheres(y),yield e.syncAllViewPointCloudColor(x,[])),A({pointCloudBoxList:x,polygonList:w,lineList:B,pointCloudSphereList:y}),actionCreators.SetPointCloudLoading(R,!1),actionCreators.SetLoadPCDFileLoading(R,!1)}),updateViewsByDefaultSize:ht,generateRects:W,update2DViewRect:at}};exports.syncBackViewByPoint=syncBackViewByPoint,exports.syncSideViewByPoint=syncSideViewByPoint,exports.syncTopViewByPoint=syncTopViewByPoint,exports.synchronizeBackView=synchronizeBackView,exports.synchronizeSideView=synchronizeSideView,exports.synchronizeTopView=synchronizeTopView,exports.topViewPoint2PointCloud=topViewPoint2PointCloud,exports.topViewPolygon2PointCloud=topViewPolygon2PointCloud,exports.usePointCloudViews=usePointCloudViews;
|
package/dist/constant/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EStepType=void 0,function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EStepType=void 0,function(a){a[a.Check=0]="Check",a[a.ANNOTATION=1]="ANNOTATION",a[a.QUALITY_INSPECTION=2]="QUALITY_INSPECTION",a[a.PRE_ANNOTATION=3]="PRE_ANNOTATION",a[a.MANUAL_CORRECTION=4]="MANUAL_CORRECTION"}(exports.EStepType||(exports.EStepType={})),exports.ESubmitType=void 0,function(a){a[a.Backward=1]="Backward",a[a.Forward=2]="Forward",a[a.Jump=3]="Jump",a[a.Quit=4]="Quit",a[a.Export=5]="Export",a[a.StepChanged=6]="StepChanged",a[a.Save=7]="Save",a[a.BatchUpdateTrackID=8]="BatchUpdateTrackID",a[a.BatchUpdateImgList=9]="BatchUpdateImgList",a[a.SyncImgList=10001]="SyncImgList",a[a.SyncCurrentPageData=10002]="SyncCurrentPageData"}(exports.ESubmitType||(exports.ESubmitType={}));const prefix="bee",componentCls=`${prefix}-component`;exports.EDataFormatType=void 0,function(a){a.Default="default",a.Markdown="markdown"}(exports.EDataFormatType||(exports.EDataFormatType={})),exports.componentCls=componentCls,exports.prefix=prefix;
|
package/dist/index.css
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
.index-module_markdownView__B6eyL h1,
|
|
2
|
+
.index-module_markdownView__B6eyL h2 {
|
|
3
|
+
border-bottom: none !important;
|
|
4
|
+
}
|
|
1
5
|
.index-module_speedControllerWrap__aFz7r {
|
|
2
6
|
display: flex;
|
|
3
7
|
color: white;
|
|
@@ -2543,6 +2547,7 @@
|
|
|
2543
2547
|
max-height: 400px;
|
|
2544
2548
|
overflow: auto;
|
|
2545
2549
|
word-break: break-all;
|
|
2550
|
+
white-space: pre-wrap;
|
|
2546
2551
|
}
|
|
2547
2552
|
|
|
2548
2553
|
/** PointCloud样式 end */
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$1=require("./components/AnnotationView/index.js"),pointCloudAnnotationView=require("./components/AnnotationView/pointCloudAnnotationView.js"),index$2=require("./components/LLMToolView/questionView/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),App=require("./App.js"),configureStore=require("./configureStore.js"),actionCreators=require("./store/annotation/actionCreators.js"),TagToolInstanceAdaptorI18nProvider=require("./components/videoPlayer/TagToolInstanceAdaptorI18nProvider.js"),PointCloudContext=require("./components/pointCloudView/PointCloudContext.js"),ctx=require("./store/ctx.js"),index$4=require("./components/predictTracking/predictTrackingIcon/index.js"),index$3=require("./components/LLMToolView/index.js"),index$5=require("./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js"),index$6=require("./constant/index.js");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,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const store=configureStore(),OutputApp=(e,t)=>{const[r,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$1=require("./components/AnnotationView/index.js"),pointCloudAnnotationView=require("./components/AnnotationView/pointCloudAnnotationView.js"),index$2=require("./components/LLMToolView/questionView/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),App=require("./App.js"),configureStore=require("./configureStore.js"),actionCreators=require("./store/annotation/actionCreators.js"),TagToolInstanceAdaptorI18nProvider=require("./components/videoPlayer/TagToolInstanceAdaptorI18nProvider.js"),PointCloudContext=require("./components/pointCloudView/PointCloudContext.js"),ctx=require("./store/ctx.js"),index$4=require("./components/predictTracking/predictTrackingIcon/index.js"),index$3=require("./components/LLMToolView/index.js"),index$5=require("./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js"),index$6=require("./constant/index.js");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,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const store=configureStore(),OutputApp=(e,t)=>{const[r,a]=React.useState();return React.useImperativeHandle(t,()=>({toolInstance:r,annotationEngine:store.getState().annotation.annotationEngine,pageBackwardActions:()=>store.dispatch(actionCreators.PageBackward()),pageForwardActions:()=>store.dispatch(actionCreators.PageForward()),pageJump:o=>{const n=~~o-1;store.dispatch(actionCreators.PageJump(n))},hello:()=>alert("hello labelBee!!!")}),[r]),React__default.default.createElement(reactRedux.Provider,{store,context:ctx.LabelBeeContext},React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(PointCloudContext.PointCloudProvider,null,React__default.default.createElement(App,__spreadProps(__spreadValues({},e),{setToolInstance:o=>{var n;a(o),(n=e.onLoad)==null||n.call(e,{toolInstance:o})}})))))};var index=React__default.default.forwardRef(OutputApp);exports.AnnotationView=index$1,exports.PointCloudAnnotationView=pointCloudAnnotationView,exports.QuestionView=index$2,Object.defineProperty(exports,"i18n",{enumerable:!0,get:function(){return lbUtils.i18n}}),exports.VideoTagTool=TagToolInstanceAdaptorI18nProvider.VideoTagTool,exports.PredictTracking=index$4,exports.LLMToolView=index$3,exports.SwitchCuboidBoxIn2DView=index$5,Object.defineProperty(exports,"EDataFormatType",{enumerable:!0,get:function(){return index$6.EDataFormatType}}),Object.defineProperty(exports,"EStepType",{enumerable:!0,get:function(){return index$6.EStepType}}),Object.defineProperty(exports,"ESubmitType",{enumerable:!0,get:function(){return index$6.ESubmitType}}),exports.componentCls=index$6.componentCls,exports.prefix=index$6.prefix,exports.default=index,exports.store=store;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Components } from 'react-markdown';
|
|
3
|
+
import 'github-markdown-css';
|
|
4
|
+
interface IProps {
|
|
5
|
+
value: string;
|
|
6
|
+
transformImageUri?: (uri: string) => string;
|
|
7
|
+
transformLinkUri?: (uri: string) => string;
|
|
8
|
+
components?: Components;
|
|
9
|
+
}
|
|
10
|
+
declare const MarkdownView: (props: IProps) => React.JSX.Element;
|
|
11
|
+
export default MarkdownView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var index$6=require("../../components/customResizeHook/index.js"),index$4=require("../../constant/index.js"),antd=require("antd"),es=require("antd/es"),React=require("react"),index$a=require("./annotationOperation/index.js"),index$9=require("./annotationTips/index.js"),index$3=require("./sidebar/index.js"),index$b=require("./toolFooter/index.js"),index$8=require("./toolHeader/index.js"),reducer=require("../../store/annotation/reducer.js"),index$5=require("../../components/videoAnnotate/index.js"),reactRedux=require("react-redux"),ToolUtils=require("../../utils/ToolUtils.js"),index$c=require("../../components/pointCloudView/index.js"),dom=require("../../utils/dom.js"),index$7=require("../../utils/index.js"),index$2=require("../../components/predictTracking/previewResult/index.js"),ctx=require("../../store/ctx.js"),ToolType=require("../../data/enums/ToolType.js"),index=require("./LLMLayout/index.js"),index$1=require("../../components/audioAnnotate/index.js"),icons=require("@ant-design/icons"),reactI18next=require("react-i18next"),lbAnnotation=require("@labelbee/lb-annotation");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,t,
|
|
1
|
+
"use strict";var index$6=require("../../components/customResizeHook/index.js"),index$4=require("../../constant/index.js"),antd=require("antd"),es=require("antd/es"),React=require("react"),index$a=require("./annotationOperation/index.js"),index$9=require("./annotationTips/index.js"),index$3=require("./sidebar/index.js"),index$b=require("./toolFooter/index.js"),index$8=require("./toolHeader/index.js"),reducer=require("../../store/annotation/reducer.js"),index$5=require("../../components/videoAnnotate/index.js"),reactRedux=require("react-redux"),ToolUtils=require("../../utils/ToolUtils.js"),index$c=require("../../components/pointCloudView/index.js"),dom=require("../../utils/dom.js"),index$7=require("../../utils/index.js"),index$2=require("../../components/predictTracking/previewResult/index.js"),ctx=require("../../store/ctx.js"),ToolType=require("../../data/enums/ToolType.js"),index=require("./LLMLayout/index.js"),index$1=require("../../components/audioAnnotate/index.js"),icons=require("@ant-design/icons"),reactI18next=require("react-i18next"),lbAnnotation=require("@labelbee/lb-annotation");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,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};const{Sider,Content}=es.Layout,layoutCls=`${index$4.prefix}-layout`,ImageAnnotate=e=>{var t;return React__default.default.createElement(React__default.default.Fragment,null,e.showTips===!0&&React__default.default.createElement(index$9,{path:e.path,tips:e.tips}),React__default.default.createElement(index$a,__spreadValues({},e)),React__default.default.createElement(index$b.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},PointCloudAnnotate=e=>{var t;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$c,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit}),React__default.default.createElement(index$b.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},AnnotatedArea=e=>{var t;const{stepList:n,step:l}=e,r=(t=reducer.getStepConfig(n,l))==null?void 0:t.tool,i=ToolUtils.isVideoTool(r),a=ToolUtils.isPointCloudTool(r);return i?React__default.default.createElement(index$5,__spreadValues({},e)):a?React__default.default.createElement(PointCloudAnnotate,__spreadValues({},e)):React__default.default.createElement(ImageAnnotate,__spreadValues({},e))},ViewportProviderLayout=e=>{var t,n,l;const{t:r}=reactI18next.useTranslation(),{stepList:i,step:a}=e,o=(t=reducer.getStepConfig(i,a))==null?void 0:t.tool,d=![ToolType.EToolName.LLM,lbAnnotation.EAudioToolName.AudioTextTool].includes(o),u=![ToolType.EToolName.LLM].includes(o),c=[lbAnnotation.EPointCloudName.PointCloud].includes(o);return React__default.default.createElement(index$6.ViewportProvider,null,React__default.default.createElement(antd.Spin,{spinning:e.loading,indicator:React__default.default.createElement(icons.LoadingOutlined,null),tip:React__default.default.createElement("span",{style:{marginTop:200}},r("LoadingTips")),delay:500},React__default.default.createElement(es.Layout,{className:index$7.classnames([layoutCls,e.className]),style:(n=e.style)==null?void 0:n.layout},React__default.default.createElement("header",{className:`${layoutCls}__header`,style:(l=e.style)==null?void 0:l.header},React__default.default.createElement(index$8,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:d,hasHeaderOption:u,hasPredictTrackingIcon:c})),e.children)))},MainView=e=>{var t,n,l,r,i,a,o;const[d,u]=React.useState(void 0),c=(n=(t=e.style)==null?void 0:t.sider)==null?void 0:n.width,{stepList:m,step:f}=e,s=(l=reducer.getStepConfig(m,f))==null?void 0:l.tool,v=ToolType.EToolName.LLM===s,x=ToolUtils.isAudioTool(s);return v?React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(index,__spreadValues({},e))):x?React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(index$1,__spreadValues({},e))):React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(es.Layout,{className:dom.getClassName("layout","container")},e==null?void 0:e.leftSider,React__default.default.createElement(Content,{className:`${layoutCls}__content`},React__default.default.createElement(AnnotatedArea,__spreadValues({},e)),React__default.default.createElement(index$2,null)),React__default.default.createElement(Sider,{className:`${layoutCls}__side`,width:(r=d!=null?d:c)!=null?r:240,style:(i=e.style)==null?void 0:i.sider},React__default.default.createElement(index$3.default,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:u,propsSiderWidth:(o=(a=e.style)==null?void 0:a.sider)==null?void 0:o.width}))))},mapStateToProps=({annotation:e})=>{var t,n,l;const{imgList:r,loading:i}=e,a=(t=r[e.imgIndex])!=null?t:{};return{path:(l=(n=a==null?void 0:a.path)!=null?n:a==null?void 0:a.url)!=null?l:"",loading:i}};var MainView$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(MainView);module.exports=MainView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e,{useState as y,useEffect as g}from"react";import{Tag as b,Radio as c}from"antd";import d from"../../longText/index.js";import{EDataFormatType as l,prefix as h}from"../../../constant/index.js";import N from"classnames";import{I18nextProvider as O,useTranslation as p}from"react-i18next";import{i18n as u}from"@labelbee/lb-utils";import f from"../../markdownView/index.js";import{FileTextOutlined as T}from"@ant-design/icons";var B=Object.defineProperty,v=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,x=(a,t,r)=>t in a?B(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,$=(a,t)=>{for(var r in t||(t={}))L.call(t,r)&&x(a,r,t[r]);if(v)for(var r of v(t))P.call(t,r)&&x(a,r,t[r]);return a};const o=`${h}-LLMView`,F=({setDataFormatType:a,dataFormatType:t})=>{const{t:r}=p();return e.createElement("div",{className:`${o}__title`,style:{display:"flex",justifyContent:"space-between"}},r("Title"),e.createElement("span",{style:{display:"flex"}},e.createElement(c.Group,{value:t,onChange:s=>{a(s.target.value)}},e.createElement(c.Button,{value:l.Default,style:{textAlign:"center",width:"52px"}},"</>"),e.createElement(c.Button,{value:l.Markdown,style:{textAlign:"center",width:"52px"}},e.createElement(T,null))),e.createElement("span",{style:{marginLeft:"8px",width:"4px",background:"#1890ff"}})))},V=a=>{const{hoverKey:t,answerList:r,question:s,lang:m}=a,[i,E]=y(l.Default),{t:_}=p();return g(()=>{var n;m&&((n=u)==null||n.changeLanguage(m))},[]),e.createElement("div",{className:o},e.createElement("div",{className:`${o}__textBox`,style:{borderBottom:"1px solid #EBEBEB"}},e.createElement(F,{setDataFormatType:E,dataFormatType:i}),e.createElement("div",{className:`${o}__content`},i===l.Markdown?e.createElement(f,{value:s}):e.createElement(d,{wordCount:200,text:s}))),e.createElement("div",{className:`${o}__textBox`},e.createElement("div",{className:`${o}__title`},_("Answer")),r.map((n,w)=>e.createElement("div",{className:N({[`${o}__content`]:!0,[`${o}__contentActive`]:t===(n==null?void 0:n.order)}),key:w},e.createElement(b,{style:{color:"#666FFF",background:"#eeefff",height:"20px",padding:"0px 8px",border:"none"}},n==null?void 0:n.order),i===l.Markdown?e.createElement(f,{value:n==null?void 0:n.answer}):e.createElement(d,{wordCount:1e3,text:n==null?void 0:n.answer})))))},j=a=>e.createElement(O,{i18n:u},e.createElement(V,$({},a)));export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import n,{useRef as
|
|
1
|
+
import n,{useRef as P}from"react";import{Popover as m,Tooltip as x}from"antd";import{useSize as E}from"ahooks";import{prefix as g}from"../../constant/index.js";import{SearchOutlined as h}from"@ant-design/icons";var T=Object.defineProperty,b=Object.defineProperties,N=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable,d=(r,e,t)=>e in r?T(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,_=(r,e)=>{for(var t in e||(e={}))$.call(e,t)&&d(r,t,e[t]);if(v)for(var t of v(e))j.call(e,t)&&d(r,t,e[t]);return r},S=(r,e)=>b(r,N(e));const l=`${g}-longText`,C=r=>{var e,t;const{text:o,placement:c="bottom",icon:y=n.createElement(h,null),openByText:O,style:f,isToolTips:w,wordCount:p}=r,a=P(null);E(a);const i=a.current&&((e=a.current)==null?void 0:e.clientWidth)<((t=a.current)==null?void 0:t.scrollWidth);if(p)if((o==null?void 0:o.length)>p){const s=o.slice(0,p);return n.createElement(m,{placement:c,overlayClassName:`${l}-popover`,content:o},n.createElement("span",{style:{cursor:"pointer",whiteSpace:"pre-wrap"}},s,"..."))}else return n.createElement("div",{style:{whiteSpace:"pre-wrap"}}," ",o);if(O){let s={placement:c,overlayClassName:`${l}-popover`,content:o,key:`${i}`};i||Object.assign(s,{open:!1});const u=n.createElement("div",{className:`${l}-text`,style:f,ref:a},o);return w?n.createElement(x,S(_({},s),{title:o}),u):n.createElement(m,_({},s),u)}return n.createElement("div",{className:l,style:f},n.createElement("div",{className:`${l}-text`,ref:a},o),i&&n.createElement(m,{placement:c,overlayClassName:`${l}-popover`,content:o},y))};export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"react";import u from"react-markdown";import P from"remark-math";import O from"rehype-katex";import k from"react-syntax-highlighter";import{docco as x}from"react-syntax-highlighter/dist/esm/styles/hljs";import b from"remark-gfm";import"github-markdown-css";import j from"./index.module.scss.js";import{classnames as E}from"../../utils/index.js";var N=Object.defineProperty,S=Object.defineProperties,I=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,g=(r,e,t)=>e in r?N(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,i=(r,e)=>{for(var t in e||(e={}))f.call(e,t)&&g(r,t,e[t]);if(o)for(var t of o(e))d.call(e,t)&&g(r,t,e[t]);return r},_=(r,e)=>S(r,I(e)),M=(r,e)=>{var t={};for(var a in r)f.call(r,a)&&e.indexOf(a)<0&&(t[a]=r[a]);if(r!=null&&o)for(var a of o(r))e.indexOf(a)<0&&d.call(r,a)&&(t[a]=r[a]);return t};const V=r=>{const{value:e,transformImageUri:t,transformLinkUri:a,components:h}=r,v=w=>{var m=w,{node:D,inline:y,className:s,children:l}=m,c=M(m,["node","inline","className","children"]);const p=/language-(\w+)/.exec(s||"");return!y&&p?n.createElement(k,_(i({},c),{className:"markdown-code-viewer",language:p[1],style:x,PreTag:"div"}),String(l).replace(/\n$/,"")):n.createElement("code",_(i({},c),{className:s}),l)};return n.createElement(u,{className:E({"markdown-body":!0,[j.markdownView]:!0}),remarkPlugins:[b,P],rehypePlugins:[O],transformImageUri:t,transformLinkUri:a,components:i({code:v},h)},e)};export{V as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={markdownView:"index-module_markdownView__B6eyL"};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getClassName as
|
|
1
|
+
import{getClassName as R}from"../../utils/dom.js";import n,{useState as b,useContext as Y,useEffect as A}from"react";import{PointCloudContainer as Z}from"./PointCloudLayout.js";import{PointCloudContext as B}from"./PointCloudContext.js";import{connect as D}from"react-redux";import{cKeyCode as ee,pointCloudLidar2image as te}from"@labelbee/lb-annotation";import{LabelBeeContext as ne}from"../../store/ctx.js";import{a2MapStateToProps as oe}from"../../store/annotation/map.js";import{toolStyleConverter as ie}from"@labelbee/lb-utils";import le from"./PointCloud2DSingleView.js";import T from"./components/TitleButton/index.js";import{LeftOutlined as re}from"@ant-design/icons";import se from"classnames";import ae from"../../assets/annotation/common/icon_esc.svg.js";import ue from"../../assets/annotation/common/icon_left_squareOutlined.svg.js";import ce from"../../assets/annotation/common/icon_right_squareOutlined.svg.js";var me=Object.defineProperty,pe=Object.defineProperties,de=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,fe=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,$=(e,o,t)=>o in e?me(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,h=(e,o)=>{for(var t in o||(o={}))fe.call(o,t)&&$(e,t,o[t]);if(K)for(var t of K(o))ge.call(o,t)&&$(e,t,o[t]);return e},x=(e,o)=>pe(e,de(o));const C=ee.default,ve=({showEnlarge:e,isEnlargeTopView:o,data:t,setIsEnlarge:f,setCurIndex:c,curIndex:g=0,index:w,annotations2d:m})=>o?n.createElement(T,{title:t==null?void 0:t.calName,style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}):e?n.createElement("div",{style:{display:"flex",alignItems:"center"}},n.createElement(re,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{f(!1),c(void 0)}}),n.createElement("span",null,t==null?void 0:t.calName),n.createElement("span",{style:{marginLeft:"8px"}},g+1,"/",m==null?void 0:m.length)):n.createElement(T,{title:t==null?void 0:t.calName,onClick:()=>{f(!0),c(w)},style:{background:"rgba(0, 0, 0, 0.74)",color:"#FFFFFF"}}),ye=({currentData:e,config:o,thumbnailWidth:t,isEnlargeTopView:f,highlightAttribute:c,loadPCDFileLoading:g,checkMode:w})=>{var m;const[u,q]=b([]),{topViewInstance:z,displayPointCloudList:L}=Y(B),[_,M]=b(""),[v,P]=b(!1),[a,y]=b(void 0);A(()=>{var i;if(!g&&z&&(e==null?void 0:e.mappingImgList)&&((i=e==null?void 0:e.mappingImgList)==null?void 0:i.length)>0){const r={fill:"transparent",color:"green"};let s=[];e==null||e.mappingImgList.forEach(l=>{var p;const Q=L.reduce((U,d)=>{var k,I;const W=d.id===_||c===d.attribute,{transferViewData:N,viewRangePointList:E}=(k=te(d,l.calib,{createRange:W}))!=null?k:{};if(!N||!E)return[];const S=(I=ie.getColorFromConfig({attribute:d.attribute},x(h({},o),{attributeConfigurable:!0}),{}))==null?void 0:I.stroke,X=G({viewDataPointList:N,pointCloudBox:d,defaultViewStyle:r,stroke:S}),V=[...U,...X];return(E==null?void 0:E.length)>0&&V.unshift({type:"polygon",annotation:x(h({id:_,pointList:E},r),{stroke:S,fill:"rgba(255, 255, 255, 0.6)"})}),V},[]);s.push({annotations:Q,url:l==null?void 0:l.url,calName:(p=l==null?void 0:l.calib)==null?void 0:p.calName,calib:l==null?void 0:l.calib,path:l==null?void 0:l.path})}),q(s)}},[L,e==null?void 0:e.mappingImgList,_,c,g]),A(()=>(window.addEventListener("keydown",F),()=>{window.removeEventListener("keydown",F)}),[a]);const F=i=>{const{keyCode:r}=i;switch(r){case C.Esc:v&&P(!1);break;case C.Left:O();break;case C.Right:j();break}},O=()=>{a===void 0||!v||Number(a)>0&&y(a-1)},j=()=>{a===void 0||!v||Number(a)<(u==null?void 0:u.length)-1&&y(a+1)},G=({viewDataPointList:i,pointCloudBox:r,defaultViewStyle:s,stroke:l})=>i?i.map(p=>({type:p.type,annotation:x(h({id:r.id,pointList:p.pointList},s),{stroke:l})})):[],H=!e||!(e==null?void 0:e.mappingImgList)||!(((m=e==null?void 0:e.mappingImgList)==null?void 0:m.length)>0),J=n.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:"14px"}},n.createElement("img",{src:ue,style:{height:"24px",marginRight:"8px",cursor:"pointer"},onClick:()=>O()}),n.createElement("span",{style:{marginRight:"12px"}},"\u952E\u76D8\u5DE6\u952E\u4E0A\u4E00\u5F20"),n.createElement("span",{style:{margin:"0px 8px 0px 12px"}},"\u952E\u76D8\u53F3\u952E\u4E0A\u4E00\u5F20"),n.createElement("img",{src:ce,style:{height:"24px",marginRight:"12px",cursor:"pointer"},onClick:()=>j()}),n.createElement("img",{src:ae,style:{height:"24px",margin:"0px 8px 0px 12px",cursor:"pointer"},onClick:()=>{P(!1),y(void 0)}}),n.createElement("span",null,"\u952E\u9000\u51FA"));return(u==null?void 0:u.length)>0?n.createElement(n.Fragment,null,u.map((i,r)=>{const s=v&&r===a;return n.createElement(Z,{className:se({[R("point-cloud-2d-container")]:!0,[R("point-cloud-container","zoom")]:s}),title:n.createElement(ve,{showEnlarge:s,isEnlargeTopView:f,data:i,setIsEnlarge:P,setCurIndex:y,curIndex:a,index:r,annotations2d:u}),titleOnSurface:!s,style:{display:H?"none":"flex",width:s?"100%":t},key:r,toolbar:J},(i==null?void 0:i.annotations)&&(i==null?void 0:i.url)&&n.createElement(le,{currentData:e,view2dData:i,setSelectedID:M,showEnlarge:s,checkMode:w}))})):null};var Ee=D(oe,null,null,{context:ne})(ye);export{Ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EPointCloudName as nt,MathUtils as w,getCuboidFromPointCloudBox as Gt}from"@labelbee/lb-annotation";import{EPerspectiveView as Q,PointCloudUtils as V,DEFAULT_SPHERE_PARAMS as Qt}from"@labelbee/lb-utils";import{useContext as Xt}from"react";import{PointCloudContext as Yt}from"../PointCloudContext.js";import{useSingleBox as qt}from"./useSingleBox.js";import{useSphere as Jt}from"./useSphere.js";import{useSelector as Kt,useDispatch as $t}from"../../../store/ctx.js";import to from"../../../utils/StepUtils.js";import{jsonParser as ft,getRectPointCloudBox as oo}from"../../../utils/index.js";import{PreDataProcess as it,SetPointCloudLoading as Ct,SetLoadPCDFileLoading as Pt}from"../../../store/annotation/actionCreators.js";import{message as eo}from"antd";import{useTranslation as no}from"react-i18next";import{useHistory as io}from"./useHistory.js";import{usePolygon as so}from"./usePolygon.js";import{useLatest as ro}from"ahooks";var lo=Object.defineProperty,ao=Object.defineProperties,co=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,uo=Object.prototype.hasOwnProperty,po=Object.prototype.propertyIsEnumerable,xt=(e,t,i)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,L=(e,t)=>{for(var i in t||(t={}))uo.call(t,i)&&xt(e,i,t[i]);if(mt)for(var i of mt(t))po.call(t,i)&&xt(e,i,t[i]);return e},O=(e,t)=>ao(e,co(t)),st=(e,t,i)=>new Promise((d,o)=>{var a=u=>{try{c(i.next(u))}catch(P){o(P)}},g=u=>{try{c(i.throw(u))}catch(P){o(P)}},c=u=>u.done?d(u.value):Promise.resolve(u.value).then(a,g);c((i=i.apply(e,t)).next())});const J=5,K=90,ht=.01,v={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},rt=(e,t,i,d,o)=>{const{x:a,y:g}=V.transferCanvas2World(e,t),{defaultZ:c}=Qt,u={center:{x:a,y:g,z:c},id:e.id},P=d?L(L({},d),u):O(L({},u),{attribute:"",valid:!0});return o&&Object.assign(P,o),P},lt=(e,t,i,d,o,a)=>{let g=e.pointList.map(B=>V.transferCanvas2World(B,t)),c=0,u=1,P={};if(i){const B=i.getSensesPointZAxisInPolygon(g,void 0,a);a&&B.fittedCoordinates.length>0&&(g=B.fittedCoordinates),c=(B.maxZ+B.minZ)/2,u=B.maxZ-B.minZ,P={count:B.zCount}}const[h,S,F]=g,R=w.getLineCenterPoint([h,F]),z=w.getLineLength(h,S),A=w.getLineLength(S,F),N=w.getRadiusFromQuadrangle(e.pointList);d&&(c=d.center.z,u=d.depth);const T={center:{x:R.x,y:R.y,z:c},width:a?A+ht:A,height:a?z+ht:z,depth:u,rotation:N,id:e.id},j=L(d?L(L({},d),T):O(L({},T),{attribute:"",valid:!0}),P);o&&Object.assign(j,o);const E=g.map(B=>V.transferWorld2Canvas(B,t));return{boxParams:j,newPointList:E}},Lt=(e,t,i)=>{const d={x:e.x-t.x,y:e.y-t.y};return O(L({},i),{center:{x:i.center.x-d.x,y:i.center.y,z:i.center.z-d.y}})},yt=(e,t,i,d)=>{const[o,a,g]=e.pointList,[c,u,P]=t.pointList,h=w.getLineCenterPoint([o,g]),S=w.getLineCenterPoint([c,P]),R={x:{x:h.x-S.x,y:h.y-S.y}.x,y:0,z:h.y-S.y},z=w.getLineLength(o,a),A=w.getLineLength(c,u),N=z-A,T=w.getLineLength(a,g),j=w.getLineLength(u,P),E=T-j,{newBoxParams:B}=d.getNewBoxBySideUpdate(R,E,N,i);return B},go=(e,t,i)=>{const d={x:e.x-t.x,y:e.y-t.y};return O(L({},i),{center:{x:i.center.x,y:i.center.y-d.x,z:i.center.z-d.y}})},fo=(e,t,i,d)=>{const[o,a,g]=e.pointList,[c,u,P]=t.pointList,h=w.getLineCenterPoint([o,g]),S=w.getLineCenterPoint([c,P]),R={x:{x:h.x-S.x,y:h.y-S.y}.x,y:0,z:h.y-S.y},z=w.getLineLength(o,a),A=w.getLineLength(c,u),N=z-A,T=w.getLineLength(a,g),j=w.getLineLength(u,P),E=T-j;let{newBoxParams:B}=d.getNewBoxByBackUpdate(R,E,N,i);return B},vt=(e,t,i,d,o)=>{var a;if(!i)return;const{toolInstance:g,pointCloudInstance:c}=i;c.loadPCDFile(d,(a=o==null?void 0:o.radius)!=null?a:K);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,Q.Left);c.setInitCameraPosition(u);const{point2d:P,zoom:h}=c.getSphereSidePoint2DCoordinate(e);c.camera.zoom=h,c.camera.updateProjectionMatrix(),c.render(),g.initPosition(),g.zoomChangeOnCenter(h),g.setResult([O(L(L({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),g.setSelectedID(t.id)},Bt=(e,t,i,d)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:a}=i;a.loadPCDFileByBox(d,e,{width:J,depth:J});const{cameraPositionVector:g}=a.updateOrthoCamera(e,Q.Left);a.setInitCameraPosition(g);const{polygon2d:c,zoom:u}=a.getBoxSidePolygon2DCoordinate(e);a.camera.zoom=u,a.camera.updateProjectionMatrix(),a.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},wt=(e,t,i,d,o)=>{var a;if(!i)return;const{toolInstance:g,pointCloudInstance:c}=i;c.loadPCDFile(d,(a=o==null?void 0:o.radius)!=null?a:K);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,Q.Back);c.setInitCameraPosition(u);const{point2d:P,zoom:h}=c.getSphereBackPoint2DCoordinate(e);c.camera.zoom=h,c.camera.updateProjectionMatrix(),c.render(),g.initPosition(),g.zoomChangeOnCenter(h),g.setResult([O(L(L({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),g.setSelectedID(t.id)},bt=(e,t,i,d)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:a}=i;a.loadPCDFileByBox(d,e,{height:J,depth:J});const{cameraPositionVector:g}=a.updateOrthoCamera(e,Q.Back);a.setInitCameraPosition(g);const{polygon2d:c,zoom:u}=a.getBoxBackPolygon2DCoordinate(e);a.camera.zoom=u,a.camera.updateProjectionMatrix(),a.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},It=(e,t,i,d)=>{if(!i||!d)return;d.generateSphere(e),d.updateCameraBySphere(e,Q.Top),d.render();const{toolInstance:o,pointCloudInstance:a}=i,{point2d:g}=a.getSphereTopPoint2DCoordinate(e),c=[...o.pointList].map(u=>u.id===t.id?O(L(L({},t),g),{valid:e.valid,textAttribute:"",attribute:e.attribute}):u);o.setResult(c),o.setSelectedID(t.id)},dt=(e,t,i,d)=>{var o,a;if(!i||!d)return;d.generateBox(e,t.id),d.render();const{pointCloud2dOperation:g,pointCloudInstance:c}=i,{polygon2d:u}=c.getBoxTopPolygon2DCoordinate(e),P=[...g.polygonList],h=P.find(S=>S.id===t.id);h?(h.pointList=u,h.valid=(o=e.valid)!=null?o:!0):P.push({id:t.id,pointList:u,textAttribute:"",isRect:!0,valid:(a=e.valid)!=null?a:!0}),g.setResultAndSelectedID(P,t.id)},Co=()=>{const e=Xt(Yt),{topViewInstance:t,sideViewInstance:i,backViewInstance:d,mainViewInstance:o,addPointCloudBox:a,addPointCloudSphere:g,setSelectedIDs:c,selectedIDs:u,pointCloudBoxList:P,pointCloudSphereList:h,hideAttributes:S,setHighlight2DDataList:F,cuboidBoxIn2DView:R,imageSizes:z}=e,{addHistory:A,initHistory:N,pushHistoryUnderUpdatePolygon:T}=io(),{selectedPolygon:j}=so(),{getPointCloudSphereByID:E,updatePointCloudSphere:B,selectedSphere:X}=Jt(),{currentData:W,config:b}=Kt(n=>{const{stepList:r,step:p,imgList:s,imgIndex:l}=n.annotation;return{currentData:s[l],config:ft(to.getCurrentStepInfo(p,r).config)}}),H=$t(),Dt=ro(R),$=n=>{if(!Dt.current){const{mappingImgList:r=[]}=W,p=r.map(s=>oo({pointCloudBox:n,mappingData:s,imageSizes:z}));Object.assign(n,{rects:p.filter(s=>s!==void 0)})}},{selectedBox:_,updateSelectedBox:St,updateSelectedBoxes:tt,getPointCloudByID:_t}=qt({generateRects:$}),{t:Vt}=no(),at=_==null?void 0:_.info;if(!t||!i||!d)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:ot}=t,Ot=n=>{o==null||o.generateBox(n),o==null||o.controls.update(),o==null||o.render()},kt=n=>{o==null||o.generateSphere(n),o==null||o.controls.update(),o==null||o.render()},At=({newPoint:n,size:r,zoom:p,trackConfigurable:s})=>{var l;const f={attribute:(l=t.toolInstance.defaultAttribute)!=null?l:""};s===!0&&Object.assign(f,{trackID:V.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:h})});const C=rt(n,r,ot,void 0,f);c(n.id);const m=g(C);Y(v.Top,n,C,p,m,b),A({newSphereParams:C})},Ut=({polygon:n,size:r,imgList:p,trackConfigurable:s,zoom:l,intelligentFit:f})=>{var C,m;const x={attribute:(C=t.toolInstance.defaultAttribute)!=null?C:""};s===!0&&Object.assign(x,{trackID:V.getNextTrackID({imgList:[],extraBoxList:P,extraSphereList:h})});const I=t==null?void 0:t.toolInstance,D=L({},n);let{boxParams:y,newPointList:U}=lt(D,r,ot,void 0,x,f);if(y=H(it({tool:nt.PointCloud,dataList:[y],stepConfig:b,action:"viewUpdateBox"}))[0],(b==null?void 0:b.lowerLimitPointsNumInBox)&&typeof y.count=="number"&&y.count<b.lowerLimitPointsNumInBox){eo.info(Vt("LowerLimitPointsNumInBox",{num:b.lowerLimitPointsNumInBox})),I.deletePolygon(y.id);return}f&&(U==null?void 0:U.length)&&(D.pointList=U);const k=S.includes(D.attribute);$(y);const G=a(y),et=(m=e==null?void 0:e.polygonList)!=null?m:[];t==null||t.updatePolygonList(G!=null?G:[],et),k?c([]):(c(y.id),I.selection.setSelectedIDs(D.id),M({omitView:v.Top,polygon:D,boxParams:y,zoom:l,newPointCloudBoxList:G}),f&&dt(y,D,t,o)),A({newBoxParams:y})},Rt=n=>{const{boxID:r,imageName:p,width:s,height:l,x:f,y:C}=n,m=P.find(x=>x.id===r);if(m==null?void 0:m.rects){const{rects:x=[]}=m,I=x.find(D=>D.imageName===p);if(I){let D=x;const y=O(L({},I),{width:s,height:l,x:f,y:C});D=x.map(k=>k===I?y:k);const U=O(L({},m),{rects:D}),Z=P.map(k=>k===m?U:k);return t==null||t.updatePolygonList(Z!=null?Z:[]),Z}}},zt=({newSelectedBox:n,newPointCloudList:r,newSelectedSphere:p,newSphereList:s})=>{var l;const f=t==null?void 0:t.toolInstance;if(!(u.length===0||!f)){if(n||(_==null?void 0:_.info)){const C=n!=null?n:_==null?void 0:_.info;(l=f==null?void 0:f.selection)==null||l.setSelectedIDs(u[0]);const m=f.selectedPolygon;if(u.length===1&&C){M({omitView:v.Top,polygon:m,boxParams:C,newPointCloudBoxList:r});return}}if((p||X)&&u.length===1){const C=p!=null?p:X;f.setSelectedID(u[0]);const m=f.selectedPoint;C&&Y(v.Top,m,C,void 0,s,b)}}},ct=(n,r,p)=>{if(at){let s,l;switch(p){case v.Back:s=fo;break;case v.Side:s=yt;break;default:s=yt;break}l=s(n,r,at,i.pointCloudInstance);const C=H(it({tool:nt.PointCloud,dataList:[l],stepConfig:b,action:"viewUpdateBox"}))[0],m=l.valid!==C.valid;if(l=C,o){const{count:I}=o.getSensesPointZAxisInPolygon(Gt(l).polygonPointList,[l.center.z-l.depth/2,l.center.z+l.depth/2]);l=O(L({},l),{count:I})}const x=St(l);return l=x.find(I=>I.id===l.id),M({omitView:m?void 0:p,polygon:n,boxParams:l,newPointCloudBoxList:x}),x}},ut=(n,r,p)=>{if(X){let s,l;switch(p){case v.Back:s=go;break;case v.Side:s=Lt;break;default:s=Lt;break}l=s(n,r,X);const f=B(l);return Y(p,n,l,void 0,f,b),f}},Tt=(n,r)=>{ut(n,r,v.Side)},jt=(n,r)=>{ut(n,r,v.Back)},Nt=(n,r)=>{ct(n,r,v.Side)},Et=(n,r)=>{ct(n,r,v.Back)},Ht=(n,r)=>{const p=E(n.id),s=rt(n,r,ot,p),l=B(s);Y(v.Top,n,s,void 0,l,b)},Ft=(n,r)=>{if(j){const s=L({},n[0].newPolygon);s.pointList=s.pointList.map(l=>V.transferCanvas2World(l,r)),T(s);return}let p=n.map(({newPolygon:s})=>{const l=_t(s.id),{boxParams:f}=lt(s,r,t.pointCloudInstance,l);return f});if(p=H(it({tool:nt.PointCloud,dataList:p,stepConfig:b,action:"viewUpdateBox"})),p.length===1){const{newPolygon:s}=n[0],l=tt(p);M({polygon:s,boxParams:p[0],newPointCloudBoxList:l})}else{const s=tt(p);s&&e.syncAllViewPointCloudColor(s)}},Wt=n=>{var r,p,s,l,f;if(_){const C=Number(n.widthDefault),m=Number(n.depthDefault),x=Number(n.heightDefault),I=_==null?void 0:_.info.trackID,y=((r=t==null?void 0:t.toolInstance)==null?void 0:r.polygonList).find(q=>(q==null?void 0:q.trackID)===I),U={width:(s=(p=t==null?void 0:t.toolInstance)==null?void 0:p.basicImgInfo)==null?void 0:s.width,height:(f=(l=t==null?void 0:t.toolInstance)==null?void 0:l.basicImgInfo)==null?void 0:f.height},Z=y.pointList.map(q=>V.transferCanvas2World(q,U)),k=w.getModifiedRectangleCoordinates(Z,x,C),G=k[0],et=k[2],pt=w.getLineCenterPoint([G,et]),Zt=_.info.center.z-_.info.depth/2,gt=O(L({},_.info),{center:{x:pt.x,y:pt.y,z:Zt+m/2},width:C,height:x,depth:m,valid:!0}),Mt=tt([gt]);M({omitView:v["3D"],polygon:y,boxParams:gt,newPointCloudBoxList:Mt})}},Y=(n,r,p,s,l,f)=>st(void 0,null,function*(){const C=W==null?void 0:W.url,m={[v.Side]:()=>{vt(p,r,i,C,f)},[v.Back]:()=>{d&&wt(p,r,d,C,f)},[v.Top]:()=>{It(p,r,t,o)}};Object.keys(m).forEach(x=>{x!==n&&m[x]()}),s&&(o==null||o.updateCameraZoom(s)),kt(p)}),M=n=>st(void 0,null,function*(){const{omitView:r,polygon:p,boxParams:s,zoom:l,newPointCloudBoxList:f}=n,C=W==null?void 0:W.url;f&&(yield e.syncAllViewPointCloudColor(f));const m={[v.Side]:()=>{Bt(s,p,i,C)},[v.Back]:()=>{d&&bt(s,p,d,C)},[v.Top]:()=>{dt(s,p,t,o)}};Object.keys(m).forEach(x=>{x!==r&&m[x]()}),l&&(o==null||o.updateCameraZoom(l)),Ot(s)});return{topViewAddSphere:At,topViewAddBox:Ut,topViewSelectedChanged:zt,topViewUpdatePoint:Ht,sideViewUpdatePoint:Tt,backViewUpdatePoint:jt,topViewUpdateBox:Ft,sideViewUpdateBox:Nt,backViewUpdateBox:Et,pointCloudBoxListUpdated:n=>{t.updatePolygonList(n),o==null||o.generateBoxes(n)},initPointCloud3d:n=>{if(!o)return;const r=V.getDefaultOrthographicParams(n);o.initOrthographicCamera(r),o.initRenderer(),o.render()},updatePointCloudData:(...n)=>st(void 0,[...n],function*(r=W){var p,s,l,f,C,m;if(!(r==null?void 0:r.url)||!o)return;F([]),Ct(H,!0),Pt(H,!0),yield o.loadPCDFile(r.url,(p=b==null?void 0:b.radius)!=null?p:K),o==null||o.clearAllBox(),o==null||o.clearAllSphere();let x=[],I=[],D=[],y=[];o.updateTopCamera();const U=(l=(s=ft(r.result))==null?void 0:s.valid)!=null?l:!0;e.setPointCloudValid(U),(f=e.sideViewInstance)==null||f.clearAllData(),(C=e.backViewInstance)==null||C.clearAllData(),t.updateData(r.url,r.result,{radius:(m=b==null?void 0:b.radius)!=null?m:K}),r.result&&(x=V.getBoxParamsFromResultList(r.result),D=V.getPolygonListFromResultList(r.result),I=V.getLineListFromResultList(r.result),y=V.getSphereParamsFromResultList(r.result),o==null||o.generateBoxes(x),o==null||o.generateSpheres(y),yield e.syncAllViewPointCloudColor(x,[])),N({pointCloudBoxList:x,polygonList:D,lineList:I,pointCloudSphereList:y}),Ct(H,!1),Pt(H,!1)}),updateViewsByDefaultSize:Wt,generateRects:$,update2DViewRect:Rt}};export{wt as syncBackViewByPoint,vt as syncSideViewByPoint,It as syncTopViewByPoint,bt as synchronizeBackView,Bt as synchronizeSideView,dt as synchronizeTopView,rt as topViewPoint2PointCloud,lt as topViewPolygon2PointCloud,Co as usePointCloudViews};
|
|
1
|
+
import{EPointCloudName as nt,MathUtils as w,getCuboidFromPointCloudBox as Gt}from"@labelbee/lb-annotation";import{EPerspectiveView as Q,PointCloudUtils as V,DEFAULT_SPHERE_PARAMS as Qt}from"@labelbee/lb-utils";import{useContext as Xt}from"react";import{PointCloudContext as Yt}from"../PointCloudContext.js";import{useSingleBox as qt}from"./useSingleBox.js";import{useSphere as Jt}from"./useSphere.js";import{useSelector as Kt,useDispatch as $t}from"../../../store/ctx.js";import to from"../../../utils/StepUtils.js";import{jsonParser as ft,getRectPointCloudBox as oo}from"../../../utils/index.js";import{PreDataProcess as it,SetPointCloudLoading as Ct,SetLoadPCDFileLoading as Pt}from"../../../store/annotation/actionCreators.js";import{message as eo}from"antd";import{useTranslation as no}from"react-i18next";import{useHistory as io}from"./useHistory.js";import{usePolygon as so}from"./usePolygon.js";import{useLatest as ro}from"ahooks";var lo=Object.defineProperty,ao=Object.defineProperties,co=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,uo=Object.prototype.hasOwnProperty,po=Object.prototype.propertyIsEnumerable,xt=(e,t,i)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,L=(e,t)=>{for(var i in t||(t={}))uo.call(t,i)&&xt(e,i,t[i]);if(mt)for(var i of mt(t))po.call(t,i)&&xt(e,i,t[i]);return e},O=(e,t)=>ao(e,co(t)),st=(e,t,i)=>new Promise((d,o)=>{var a=u=>{try{c(i.next(u))}catch(P){o(P)}},g=u=>{try{c(i.throw(u))}catch(P){o(P)}},c=u=>u.done?d(u.value):Promise.resolve(u.value).then(a,g);c((i=i.apply(e,t)).next())});const J=5,K=90,ht=.01,v={"3D":"3D",Top:"Top",Side:"Side",Back:"Back"},rt=(e,t,i,d,o)=>{const{x:a,y:g}=V.transferCanvas2World(e,t),{defaultZ:c}=Qt,u={center:{x:a,y:g,z:c},id:e.id},P=d?L(L({},d),u):O(L({},u),{attribute:"",valid:!0});return o&&Object.assign(P,o),P},lt=(e,t,i,d,o,a)=>{let g=e.pointList.map(B=>V.transferCanvas2World(B,t)),c=0,u=1,P={};if(i){const B=i.getSensesPointZAxisInPolygon(g,void 0,a);a&&B.fittedCoordinates.length>0&&(g=B.fittedCoordinates),c=(B.maxZ+B.minZ)/2,u=B.maxZ-B.minZ,P={count:B.zCount}}const[h,S,F]=g,R=w.getLineCenterPoint([h,F]),z=w.getLineLength(h,S),A=w.getLineLength(S,F),N=w.getRadiusFromQuadrangle(e.pointList);d&&(c=d.center.z,u=d.depth);const T={center:{x:R.x,y:R.y,z:c},width:a?A+ht:A,height:a?z+ht:z,depth:u,rotation:N,id:e.id},j=L(d?L(L({},d),T):O(L({},T),{attribute:"",valid:!0}),P);o&&Object.assign(j,o);const E=g.map(B=>V.transferWorld2Canvas(B,t));return{boxParams:j,newPointList:E}},Lt=(e,t,i)=>{const d={x:e.x-t.x,y:e.y-t.y};return O(L({},i),{center:{x:i.center.x-d.x,y:i.center.y,z:i.center.z-d.y}})},yt=(e,t,i,d)=>{const[o,a,g]=e.pointList,[c,u,P]=t.pointList,h=w.getLineCenterPoint([o,g]),S=w.getLineCenterPoint([c,P]),R={x:{x:h.x-S.x,y:h.y-S.y}.x,y:0,z:h.y-S.y},z=w.getLineLength(o,a),A=w.getLineLength(c,u),N=z-A,T=w.getLineLength(a,g),j=w.getLineLength(u,P),E=T-j,{newBoxParams:B}=d.getNewBoxBySideUpdate(R,E,N,i);return B},go=(e,t,i)=>{const d={x:e.x-t.x,y:e.y-t.y};return O(L({},i),{center:{x:i.center.x,y:i.center.y-d.x,z:i.center.z-d.y}})},fo=(e,t,i,d)=>{const[o,a,g]=e.pointList,[c,u,P]=t.pointList,h=w.getLineCenterPoint([o,g]),S=w.getLineCenterPoint([c,P]),R={x:{x:h.x-S.x,y:h.y-S.y}.x,y:0,z:h.y-S.y},z=w.getLineLength(o,a),A=w.getLineLength(c,u),N=z-A,T=w.getLineLength(a,g),j=w.getLineLength(u,P),E=T-j;let{newBoxParams:B}=d.getNewBoxByBackUpdate(R,E,N,i);return B},vt=(e,t,i,d,o)=>{var a;if(!i)return;const{toolInstance:g,pointCloudInstance:c}=i;c.loadPCDFile(d,(a=o==null?void 0:o.radius)!=null?a:K);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,Q.Left);c.setInitCameraPosition(u);const{point2d:P,zoom:h}=c.getSphereSidePoint2DCoordinate(e);c.camera.zoom=h,c.camera.updateProjectionMatrix(),c.render(),g.initPosition(),g.zoomChangeOnCenter(h),g.setResult([O(L(L({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),g.setSelectedID(t.id)},Bt=(e,t,i,d)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:a}=i;a.loadPCDFileByBox(d,e,{width:J,depth:J});const{cameraPositionVector:g}=a.updateOrthoCamera(e,Q.Left);a.setInitCameraPosition(g);const{polygon2d:c,zoom:u}=a.getBoxSidePolygon2DCoordinate(e);a.camera.zoom=u,a.camera.updateProjectionMatrix(),a.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},wt=(e,t,i,d,o)=>{var a;if(!i)return;const{toolInstance:g,pointCloudInstance:c}=i;c.loadPCDFile(d,(a=o==null?void 0:o.radius)!=null?a:K);const{cameraPositionVector:u}=c.updateOrthoCameraBySphere(e,Q.Back);c.setInitCameraPosition(u);const{point2d:P,zoom:h}=c.getSphereBackPoint2DCoordinate(e);c.camera.zoom=h,c.camera.updateProjectionMatrix(),c.render(),g.initPosition(),g.zoomChangeOnCenter(h),g.setResult([O(L(L({},t),P),{valid:e.valid,textAttribute:"",attribute:e.attribute})]),g.setSelectedID(t.id)},bt=(e,t,i,d)=>{if(!i)return;const{pointCloud2dOperation:o,pointCloudInstance:a}=i;a.loadPCDFileByBox(d,e,{height:J,depth:J});const{cameraPositionVector:g}=a.updateOrthoCamera(e,Q.Back);a.setInitCameraPosition(g);const{polygon2d:c,zoom:u}=a.getBoxBackPolygon2DCoordinate(e);a.camera.zoom=u,a.camera.updateProjectionMatrix(),a.render(),o.initPosition(),o.zoomChangeOnCenter(u),o.setResultAndSelectedID([{id:t.id,valid:e.valid,pointList:c,textAttribute:"",isRect:!0,attribute:e.attribute}],t.id)},It=(e,t,i,d)=>{if(!i||!d)return;d.generateSphere(e),d.updateCameraBySphere(e,Q.Top),d.render();const{toolInstance:o,pointCloudInstance:a}=i,{point2d:g}=a.getSphereTopPoint2DCoordinate(e),c=[...o.pointList].map(u=>u.id===t.id?O(L(L({},t),g),{valid:e.valid,textAttribute:"",attribute:e.attribute}):u);o.setResult(c),o.setSelectedID(t.id)},dt=(e,t,i,d)=>{var o,a;if(!i||!d)return;d.generateBox(e,t.id),d.render();const{pointCloud2dOperation:g,pointCloudInstance:c}=i,{polygon2d:u}=c.getBoxTopPolygon2DCoordinate(e),P=[...g.polygonList],h=P.find(S=>S.id===t.id);h?(h.pointList=u,h.valid=(o=e.valid)!=null?o:!0):P.push({id:t.id,pointList:u,textAttribute:"",isRect:!0,valid:(a=e.valid)!=null?a:!0}),g.setResultAndSelectedID(P,t.id)},Co=()=>{const e=Xt(Yt),{topViewInstance:t,sideViewInstance:i,backViewInstance:d,mainViewInstance:o,addPointCloudBox:a,addPointCloudSphere:g,setSelectedIDs:c,selectedIDs:u,pointCloudBoxList:P,pointCloudSphereList:h,hideAttributes:S,setHighlight2DDataList:F,cuboidBoxIn2DView:R,imageSizes:z}=e,{addHistory:A,initHistory:N,pushHistoryUnderUpdatePolygon:T}=io(),{selectedPolygon:j}=so(),{getPointCloudSphereByID:E,updatePointCloudSphere:B,selectedSphere:X}=Jt(),{currentData:W,config:b}=Kt(n=>{const{stepList:s,step:p,imgList:r,imgIndex:l}=n.annotation;return{currentData:r[l],config:ft(to.getCurrentStepInfo(p,s).config)}}),H=$t(),Dt=ro(R),$=n=>{if(!Dt.current){const{mappingImgList:s=[]}=W,p=s.map(r=>oo({pointCloudBox:n,mappingData:r,imageSizes:z}));Object.assign(n,{rects:p.filter(r=>r!==void 0)})}},{selectedBox:_,updateSelectedBox:St,updateSelectedBoxes:tt,getPointCloudByID:_t}=qt({generateRects:$}),{t:Vt}=no(),at=_==null?void 0:_.info;if(!t||!i||!d)return{topViewAddSphere:()=>{},topViewAddBox:()=>{},topViewSelectedChanged:()=>{},sideViewUpdateBox:()=>{},backViewUpdateBox:()=>{}};const{pointCloudInstance:ot}=t,Ot=n=>{o==null||o.generateBox(n),o==null||o.controls.update(),o==null||o.render()},kt=n=>{o==null||o.generateSphere(n),o==null||o.controls.update(),o==null||o.render()},At=({newPoint:n,size:s,zoom:p,trackConfigurable:r})=>{var l;const f={attribute:(l=t.toolInstance.defaultAttribute)!=null?l:""};r===!0&&Object.assign(f,{trackID:V.getNextTrackID({imgList:[],extraBoxList:[],extraSphereList:h})});const C=rt(n,s,ot,void 0,f);c(n.id);const m=g(C);Y(v.Top,n,C,p,m,b),A({newSphereParams:C})},Ut=({polygon:n,size:s,imgList:p,trackConfigurable:r,zoom:l,intelligentFit:f})=>{var C,m;const x={attribute:(C=t.toolInstance.defaultAttribute)!=null?C:""};r===!0&&Object.assign(x,{trackID:V.getNextTrackID({imgList:[],extraBoxList:P,extraSphereList:h})});const I=t==null?void 0:t.toolInstance,D=L({},n);let{boxParams:y,newPointList:U}=lt(D,s,ot,void 0,x,f);if(y=H(it({tool:nt.PointCloud,dataList:[y],stepConfig:b,action:"viewUpdateBox"}))[0],(b==null?void 0:b.lowerLimitPointsNumInBox)&&typeof y.count=="number"&&y.count<b.lowerLimitPointsNumInBox){eo.info(Vt("LowerLimitPointsNumInBox",{num:b.lowerLimitPointsNumInBox})),I.deletePolygon(y.id);return}f&&(U==null?void 0:U.length)&&(D.pointList=U);const k=S.includes(D.attribute);$(y);const G=a(y),et=(m=e==null?void 0:e.polygonList)!=null?m:[];t==null||t.updatePolygonList(G!=null?G:[],et),k?c([]):(c(y.id),I.selection.setSelectedIDs(D.id),M({omitView:v.Top,polygon:D,boxParams:y,zoom:l,newPointCloudBoxList:G}),f&&dt(y,D,t,o)),A({newBoxParams:y})},Rt=n=>{const{boxID:s,imageName:p,width:r,height:l,x:f,y:C}=n,m=P.find(x=>x.id===s);if(m==null?void 0:m.rects){const{rects:x=[]}=m,I=x.find(D=>D.imageName===p);if(I){let D=x;const y=O(L({},I),{width:r,height:l,x:f,y:C});D=x.map(k=>k===I?y:k);const U=O(L({},m),{rects:D}),Z=P.map(k=>k===m?U:k);return t==null||t.updatePolygonList(Z!=null?Z:[]),Z}}},zt=({newSelectedBox:n,newPointCloudList:s,newSelectedSphere:p,newSphereList:r})=>{var l;const f=t==null?void 0:t.toolInstance;if(!(u.length===0||!f)){if(n||(_==null?void 0:_.info)){const C=n!=null?n:_==null?void 0:_.info;(l=f==null?void 0:f.selection)==null||l.setSelectedIDs(u[0]);const m=f.selectedPolygon;if(u.length===1&&C){M({omitView:v.Top,polygon:m,boxParams:C,newPointCloudBoxList:s});return}}if((p||X)&&u.length===1){const C=p!=null?p:X;f.setSelectedID(u[0]);const m=f.selectedPoint;C&&Y(v.Top,m,C,void 0,r,b)}}},ct=(n,s,p)=>{if(at){let r,l;switch(p){case v.Back:r=fo;break;case v.Side:r=yt;break;default:r=yt;break}l=r(n,s,at,i.pointCloudInstance);const C=H(it({tool:nt.PointCloud,dataList:[l],stepConfig:b,action:"viewUpdateBox"}))[0],m=l.valid!==C.valid;if(l=C,o){const{count:I}=o.getSensesPointZAxisInPolygon(Gt(l).polygonPointList,[l.center.z-l.depth/2,l.center.z+l.depth/2]);l=O(L({},l),{count:I})}const x=St(l);return l=x.find(I=>I.id===l.id),M({omitView:m?void 0:p,polygon:n,boxParams:l,newPointCloudBoxList:x}),x}},ut=(n,s,p)=>{if(X){let r,l;switch(p){case v.Back:r=go;break;case v.Side:r=Lt;break;default:r=Lt;break}l=r(n,s,X);const f=B(l);return Y(p,n,l,void 0,f,b),f}},Tt=(n,s)=>{ut(n,s,v.Side)},jt=(n,s)=>{ut(n,s,v.Back)},Nt=(n,s)=>{ct(n,s,v.Side)},Et=(n,s)=>{ct(n,s,v.Back)},Ht=(n,s)=>{const p=E(n.id),r=rt(n,s,ot,p),l=B(r);Y(v.Top,n,r,void 0,l,b)},Ft=(n,s)=>{if(j){const r=n[0].newPolygon;r.pointList=r.pointList.map(l=>V.transferCanvas2World(l,s)),T(n[0].newPolygon);return}let p=n.map(({newPolygon:r})=>{const l=_t(r.id),{boxParams:f}=lt(r,s,t.pointCloudInstance,l);return f});if(p=H(it({tool:nt.PointCloud,dataList:p,stepConfig:b,action:"viewUpdateBox"})),p.length===1){const{newPolygon:r}=n[0],l=tt(p);M({polygon:r,boxParams:p[0],newPointCloudBoxList:l})}else{const r=tt(p);r&&e.syncAllViewPointCloudColor(r)}},Wt=n=>{var s,p,r,l,f;if(_){const C=Number(n.widthDefault),m=Number(n.depthDefault),x=Number(n.heightDefault),I=_==null?void 0:_.info.trackID,y=((s=t==null?void 0:t.toolInstance)==null?void 0:s.polygonList).find(q=>(q==null?void 0:q.trackID)===I),U={width:(r=(p=t==null?void 0:t.toolInstance)==null?void 0:p.basicImgInfo)==null?void 0:r.width,height:(f=(l=t==null?void 0:t.toolInstance)==null?void 0:l.basicImgInfo)==null?void 0:f.height},Z=y.pointList.map(q=>V.transferCanvas2World(q,U)),k=w.getModifiedRectangleCoordinates(Z,x,C),G=k[0],et=k[2],pt=w.getLineCenterPoint([G,et]),Zt=_.info.center.z-_.info.depth/2,gt=O(L({},_.info),{center:{x:pt.x,y:pt.y,z:Zt+m/2},width:C,height:x,depth:m,valid:!0}),Mt=tt([gt]);M({omitView:v["3D"],polygon:y,boxParams:gt,newPointCloudBoxList:Mt})}},Y=(n,s,p,r,l,f)=>st(void 0,null,function*(){const C=W==null?void 0:W.url,m={[v.Side]:()=>{vt(p,s,i,C,f)},[v.Back]:()=>{d&&wt(p,s,d,C,f)},[v.Top]:()=>{It(p,s,t,o)}};Object.keys(m).forEach(x=>{x!==n&&m[x]()}),r&&(o==null||o.updateCameraZoom(r)),kt(p)}),M=n=>st(void 0,null,function*(){const{omitView:s,polygon:p,boxParams:r,zoom:l,newPointCloudBoxList:f}=n,C=W==null?void 0:W.url;f&&(yield e.syncAllViewPointCloudColor(f));const m={[v.Side]:()=>{Bt(r,p,i,C)},[v.Back]:()=>{d&&bt(r,p,d,C)},[v.Top]:()=>{dt(r,p,t,o)}};Object.keys(m).forEach(x=>{x!==s&&m[x]()}),l&&(o==null||o.updateCameraZoom(l)),Ot(r)});return{topViewAddSphere:At,topViewAddBox:Ut,topViewSelectedChanged:zt,topViewUpdatePoint:Ht,sideViewUpdatePoint:Tt,backViewUpdatePoint:jt,topViewUpdateBox:Ft,sideViewUpdateBox:Nt,backViewUpdateBox:Et,pointCloudBoxListUpdated:n=>{t.updatePolygonList(n),o==null||o.generateBoxes(n)},initPointCloud3d:n=>{if(!o)return;const s=V.getDefaultOrthographicParams(n);o.initOrthographicCamera(s),o.initRenderer(),o.render()},updatePointCloudData:(...n)=>st(void 0,[...n],function*(s=W){var p,r,l,f,C,m;if(!(s==null?void 0:s.url)||!o)return;F([]),Ct(H,!0),Pt(H,!0),yield o.loadPCDFile(s.url,(p=b==null?void 0:b.radius)!=null?p:K),o==null||o.clearAllBox(),o==null||o.clearAllSphere();let x=[],I=[],D=[],y=[];o.updateTopCamera();const U=(l=(r=ft(s.result))==null?void 0:r.valid)!=null?l:!0;e.setPointCloudValid(U),(f=e.sideViewInstance)==null||f.clearAllData(),(C=e.backViewInstance)==null||C.clearAllData(),t.updateData(s.url,s.result,{radius:(m=b==null?void 0:b.radius)!=null?m:K}),s.result&&(x=V.getBoxParamsFromResultList(s.result),D=V.getPolygonListFromResultList(s.result),I=V.getLineListFromResultList(s.result),y=V.getSphereParamsFromResultList(s.result),o==null||o.generateBoxes(x),o==null||o.generateSpheres(y),yield e.syncAllViewPointCloudColor(x,[])),N({pointCloudBoxList:x,polygonList:D,lineList:I,pointCloudSphereList:y}),Ct(H,!1),Pt(H,!1)}),updateViewsByDefaultSize:Wt,generateRects:$,update2DViewRect:Rt}};export{wt as syncBackViewByPoint,vt as syncSideViewByPoint,It as syncTopViewByPoint,bt as synchronizeBackView,Bt as synchronizeSideView,dt as synchronizeTopView,rt as topViewPoint2PointCloud,lt as topViewPolygon2PointCloud,Co as usePointCloudViews};
|
package/es/constant/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var n;(function(a){a[a.Check=0]="Check",a[a.ANNOTATION=1]="ANNOTATION",a[a.QUALITY_INSPECTION=2]="QUALITY_INSPECTION",a[a.PRE_ANNOTATION=3]="PRE_ANNOTATION",a[a.MANUAL_CORRECTION=4]="MANUAL_CORRECTION"})(n||(n={}));var c;(function(a){a[a.Backward=1]="Backward",a[a.Forward=2]="Forward",a[a.Jump=3]="Jump",a[a.Quit=4]="Quit",a[a.Export=5]="Export",a[a.StepChanged=6]="StepChanged",a[a.Save=7]="Save",a[a.BatchUpdateTrackID=8]="BatchUpdateTrackID",a[a.BatchUpdateImgList=9]="BatchUpdateImgList",a[a.SyncImgList=10001]="SyncImgList",a[a.SyncCurrentPageData=10002]="SyncCurrentPageData"})(c||(c={}));const N="bee",I=`${N}-component`;var r;(function(a){a.Default="default",a.Markdown="markdown"})(r||(r={}));export{r as EDataFormatType,n as EStepType,c as ESubmitType,I as componentCls,N as prefix};
|
package/es/index.css
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
.index-module_markdownView__B6eyL h1,
|
|
2
|
+
.index-module_markdownView__B6eyL h2 {
|
|
3
|
+
border-bottom: none !important;
|
|
4
|
+
}
|
|
1
5
|
.index-module_speedControllerWrap__aFz7r {
|
|
2
6
|
display: flex;
|
|
3
7
|
color: white;
|
|
@@ -2543,6 +2547,7 @@
|
|
|
2543
2547
|
max-height: 400px;
|
|
2544
2548
|
overflow: auto;
|
|
2545
2549
|
word-break: break-all;
|
|
2550
|
+
white-space: pre-wrap;
|
|
2546
2551
|
}
|
|
2547
2552
|
|
|
2548
2553
|
/** PointCloud样式 end */
|
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as AnnotationView}from"./components/AnnotationView/index.js";export{default as PointCloudAnnotationView}from"./components/AnnotationView/pointCloudAnnotationView.js";export{default as QuestionView}from"./components/LLMToolView/questionView/index.js";import{i18n as c}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import n,{useState as d,useImperativeHandle as m}from"react";import{I18nextProvider as f}from"react-i18next";import{Provider as u}from"react-redux";import w from"./App.js";import x from"./configureStore.js";import{PageBackward as P,PageForward as g,PageJump as v}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoPlayer/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as _}from"./components/pointCloudView/PointCloudContext.js";import{LabelBeeContext as j}from"./store/ctx.js";export{default as PredictTracking}from"./components/predictTracking/predictTrackingIcon/index.js";export{default as LLMToolView}from"./components/LLMToolView/index.js";export{default as SwitchCuboidBoxIn2DView}from"./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js";export{EStepType,ESubmitType,componentCls,prefix}from"./constant/index.js";var V=Object.defineProperty,b=Object.defineProperties,T=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,s=(o,e,t)=>e in o?V(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,
|
|
1
|
+
export{default as AnnotationView}from"./components/AnnotationView/index.js";export{default as PointCloudAnnotationView}from"./components/AnnotationView/pointCloudAnnotationView.js";export{default as QuestionView}from"./components/LLMToolView/questionView/index.js";import{i18n as c}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import n,{useState as d,useImperativeHandle as m}from"react";import{I18nextProvider as f}from"react-i18next";import{Provider as u}from"react-redux";import w from"./App.js";import x from"./configureStore.js";import{PageBackward as P,PageForward as g,PageJump as v}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoPlayer/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as _}from"./components/pointCloudView/PointCloudContext.js";import{LabelBeeContext as j}from"./store/ctx.js";export{default as PredictTracking}from"./components/predictTracking/predictTrackingIcon/index.js";export{default as LLMToolView}from"./components/LLMToolView/index.js";export{default as SwitchCuboidBoxIn2DView}from"./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js";export{EDataFormatType,EStepType,ESubmitType,componentCls,prefix}from"./constant/index.js";var V=Object.defineProperty,b=Object.defineProperties,T=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,s=(o,e,t)=>e in o?V(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,y=(o,e)=>{for(var t in e||(e={}))I.call(e,t)&&s(o,t,e[t]);if(p)for(var t of p(e))O.call(e,t)&&s(o,t,e[t]);return o},A=(o,e)=>b(o,T(e));const r=x(),C=(o,e)=>{const[t,l]=d();return m(e,()=>({toolInstance:t,annotationEngine:r.getState().annotation.annotationEngine,pageBackwardActions:()=>r.dispatch(P()),pageForwardActions:()=>r.dispatch(g()),pageJump:a=>{const i=~~a-1;r.dispatch(v(i))},hello:()=>alert("hello labelBee!!!")}),[t]),n.createElement(u,{store:r,context:j},n.createElement(f,{i18n:c},n.createElement(_,null,n.createElement(w,A(y({},o),{setToolInstance:a=>{var i;l(a),(i=o.onLoad)==null||i.call(o,{toolInstance:a})}})))))};var E=n.forwardRef(C);export{E as default,r as store};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ViewportProvider as
|
|
1
|
+
import{ViewportProvider as A}from"../../components/customResizeHook/index.js";import{prefix as C}from"../../constant/index.js";import{Spin as S}from"antd";import{Layout as v}from"antd/es";import t,{useState as b}from"react";import O from"./annotationOperation/index.js";import M from"./annotationTips/index.js";import V from"./sidebar/index.js";import h from"./toolFooter/index.js";import k from"./toolHeader/index.js";import{getStepConfig as _}from"../../store/annotation/reducer.js";import F from"../../components/videoAnnotate/index.js";import{connect as I}from"react-redux";import E from"../../utils/ToolUtils.js";import $ from"../../components/pointCloudView/index.js";import{getClassName as H}from"../../utils/dom.js";import{classnames as R}from"../../utils/index.js";import W from"../../components/predictTracking/previewResult/index.js";import{LabelBeeContext as p}from"../../store/ctx.js";import{EToolName as y}from"../../data/enums/ToolType.js";import B from"./LLMLayout/index.js";import D from"../../components/audioAnnotate/index.js";import{LoadingOutlined as U}from"@ant-design/icons";import{useTranslation as z}from"react-i18next";import{EAudioToolName as q,EPointCloudName as G}from"@labelbee/lb-annotation";var J=Object.defineProperty,L=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,x=(e,o,n)=>o in e?J(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,r=(e,o)=>{for(var n in o||(o={}))K.call(o,n)&&x(e,n,o[n]);if(L)for(var n of L(o))Q.call(o,n)&&x(e,n,o[n]);return e};const{Sider:X,Content:Y}=v,s=`${C}-layout`,Z=e=>{var o;return t.createElement(t.Fragment,null,e.showTips===!0&&t.createElement(M,{path:e.path,tips:e.tips}),t.createElement(O,r({},e)),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},ee=e=>{var o;return t.createElement(t.Fragment,null,t.createElement($,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit}),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},te=e=>{var o;const{stepList:n,step:i}=e,a=(o=_(n,i))==null?void 0:o.tool,d=E.isVideoTool(a),l=E.isPointCloudTool(a);return d?t.createElement(F,r({},e)):l?t.createElement(ee,r({},e)):t.createElement(Z,r({},e))},T=e=>{var o,n,i;const{t:a}=z(),{stepList:d,step:l}=e,m=(o=_(d,l))==null?void 0:o.tool,c=![y.LLM,q.AudioTextTool].includes(m),u=![y.LLM].includes(m),f=[G.PointCloud].includes(m);return t.createElement(A,null,t.createElement(S,{spinning:e.loading,indicator:t.createElement(U,null),tip:t.createElement("span",{style:{marginTop:200}},a("LoadingTips")),delay:500},t.createElement(v,{className:R([s,e.className]),style:(n=e.style)==null?void 0:n.layout},t.createElement("header",{className:`${s}__header`,style:(i=e.style)==null?void 0:i.header},t.createElement(k,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:c,hasHeaderOption:u,hasPredictTrackingIcon:f})),e.children)))},oe=e=>{var o,n,i,a,d,l,m;const[c,u]=b(void 0),f=(n=(o=e.style)==null?void 0:o.sider)==null?void 0:n.width,{stepList:j,step:P}=e,g=(i=_(j,P))==null?void 0:i.tool,w=y.LLM===g,N=E.isAudioTool(g);return w?t.createElement(T,r({},e),t.createElement(B,r({},e))):N?t.createElement(T,r({},e),t.createElement(D,r({},e))):t.createElement(T,r({},e),t.createElement(v,{className:H("layout","container")},e==null?void 0:e.leftSider,t.createElement(Y,{className:`${s}__content`},t.createElement(te,r({},e)),t.createElement(W,null)),t.createElement(X,{className:`${s}__side`,width:(a=c!=null?c:f)!=null?a:240,style:(d=e.style)==null?void 0:d.sider},t.createElement(V,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:u,propsSiderWidth:(m=(l=e.style)==null?void 0:l.sider)==null?void 0:m.width}))))},ne=({annotation:e})=>{var o,n,i;const{imgList:a,loading:d}=e,l=(o=a[e.imgIndex])!=null?o:{};return{path:(i=(n=l==null?void 0:l.path)!=null?n:l==null?void 0:l.url)!=null?i:"",loading:d}};var le=I(ne,null,null,{context:p})(oe);export{le as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0-dev.1",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -43,21 +43,27 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ant-design/icons": "^4.6.2",
|
|
46
|
-
"@labelbee/lb-annotation": "1.21.0-
|
|
47
|
-
"@labelbee/lb-utils": "1.
|
|
46
|
+
"@labelbee/lb-annotation": "1.21.0-dev.1",
|
|
47
|
+
"@labelbee/lb-utils": "1.14.0-dev.1",
|
|
48
48
|
"@labelbee/wavesurfer": "1.0.0",
|
|
49
49
|
"@types/react-dom": "^18.2.7",
|
|
50
50
|
"ahooks": "^3.4.0",
|
|
51
51
|
"classnames": "^2.3.0",
|
|
52
52
|
"decimal.js": "^10.4.3",
|
|
53
|
+
"github-markdown-css": "^5.2.0",
|
|
53
54
|
"lodash": "^4.17.21",
|
|
54
55
|
"postcss-url": "^10.1.3",
|
|
55
56
|
"react-colorful": "^5.6.1",
|
|
56
57
|
"react-i18next": "^11.12.0",
|
|
58
|
+
"react-markdown": "^8.0.7",
|
|
57
59
|
"react-redux": "^7.2.3",
|
|
60
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
58
61
|
"redux": "^4.0.5",
|
|
59
62
|
"redux-actions": "^2.6.5",
|
|
60
63
|
"redux-thunk": "^2.3.0",
|
|
64
|
+
"rehype-katex": "^6.0.3",
|
|
65
|
+
"remark-math": "^5.1.1",
|
|
66
|
+
"remark-gfm": "^3.0.1",
|
|
61
67
|
"resize-observer-polyfill": "^1.5.1"
|
|
62
68
|
},
|
|
63
69
|
"peerDependencies": {
|
|
@@ -75,6 +81,7 @@
|
|
|
75
81
|
"@types/lodash": "^4.14.168",
|
|
76
82
|
"@types/react": "^16.13.1",
|
|
77
83
|
"@types/react-redux": "^7.1.16",
|
|
84
|
+
"@types/react-syntax-highlighter": "^15.5.0",
|
|
78
85
|
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
|
79
86
|
"@typescript-eslint/parser": "^4.15.1",
|
|
80
87
|
"antd": "^4.15.0",
|