@labelbee/lb-components 1.12.2 → 1.13.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/components/LLMToolView/index.js +1 -0
  2. package/dist/components/LLMToolView/questionView/index.js +1 -0
  3. package/dist/components/LLMToolView/sidebar/components/answerList/index.js +1 -0
  4. package/dist/components/LLMToolView/sidebar/components/answerSort/index.js +1 -0
  5. package/dist/components/LLMToolView/sidebar/components/determineGroup/index.js +1 -0
  6. package/dist/components/LLMToolView/sidebar/components/scoreGroupButton/index.js +1 -0
  7. package/dist/components/LLMToolView/sidebar/index.js +1 -0
  8. package/dist/components/LLMToolView/utils/data.js +1 -0
  9. package/dist/components/longText/index.js +1 -0
  10. package/dist/data/enums/ToolType.js +1 -1
  11. package/dist/index.css +156 -0
  12. package/dist/index.js +1 -1
  13. package/dist/store/annotation/reducer.js +1 -1
  14. package/dist/store/ctx.js +1 -1
  15. package/dist/types/components/LLMToolView/index.d.ts +11 -0
  16. package/dist/types/components/LLMToolView/questionView/index.d.ts +10 -0
  17. package/dist/types/components/LLMToolView/sidebar/components/answerList/index.d.ts +17 -0
  18. package/dist/types/components/LLMToolView/sidebar/components/answerSort/index.d.ts +10 -0
  19. package/dist/types/components/LLMToolView/sidebar/components/determineGroup/index.d.ts +9 -0
  20. package/dist/types/components/LLMToolView/sidebar/components/scoreGroupButton/index.d.ts +10 -0
  21. package/dist/types/components/LLMToolView/sidebar/index.d.ts +10 -0
  22. package/dist/types/components/LLMToolView/types.d.ts +54 -0
  23. package/dist/types/components/LLMToolView/utils/data.d.ts +2 -0
  24. package/dist/types/components/longText/index.d.ts +18 -0
  25. package/dist/types/data/enums/ToolType.d.ts +2 -1
  26. package/dist/types/hooks/annotation.d.ts +1 -1
  27. package/dist/types/index.d.ts +3 -1
  28. package/dist/types/store/ctx.d.ts +7 -0
  29. package/dist/types/utils/ToolUtils.d.ts +7 -0
  30. package/dist/types/views/MainView/LLMLayout/index.d.ts +8 -0
  31. package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/LLM/index.d.ts +6 -0
  32. package/dist/types/views/MainView/toolHeader/index.d.ts +3 -0
  33. package/dist/utils/ToolUtils.js +1 -1
  34. package/dist/views/MainView/LLMLayout/index.js +1 -0
  35. package/dist/views/MainView/index.js +1 -1
  36. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/LLM/index.js +1 -0
  37. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  38. package/dist/views/MainView/toolHeader/index.js +1 -1
  39. package/es/components/LLMToolView/index.js +1 -0
  40. package/es/components/LLMToolView/questionView/index.js +1 -0
  41. package/es/components/LLMToolView/sidebar/components/answerList/index.js +1 -0
  42. package/es/components/LLMToolView/sidebar/components/answerSort/index.js +1 -0
  43. package/es/components/LLMToolView/sidebar/components/determineGroup/index.js +1 -0
  44. package/es/components/LLMToolView/sidebar/components/scoreGroupButton/index.js +1 -0
  45. package/es/components/LLMToolView/sidebar/index.js +1 -0
  46. package/es/components/LLMToolView/utils/data.js +1 -0
  47. package/es/components/longText/index.js +1 -0
  48. package/es/data/enums/ToolType.js +1 -1
  49. package/es/index.css +156 -0
  50. package/es/index.js +1 -1
  51. package/es/store/annotation/reducer.js +1 -1
  52. package/es/store/ctx.js +1 -1
  53. package/es/utils/ToolUtils.js +1 -1
  54. package/es/views/MainView/LLMLayout/index.js +1 -0
  55. package/es/views/MainView/index.js +1 -1
  56. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/LLM/index.js +1 -0
  57. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  58. package/es/views/MainView/toolHeader/index.js +1 -1
  59. package/package.json +5 -5
@@ -0,0 +1 @@
1
+ "use strict";var React=require("react"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),antd=require("antd"),index$3=require("../../constant/index.js"),es=require("antd/es"),index$2=require("./sidebar/index.js"),reducer=require("../../store/annotation/reducer.js"),index$1=require("./questionView/index.js"),reactI18next=require("react-i18next"),index=require("../../views/MainView/annotationTips/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const{Sider}=es.Layout,LLMViewCls=`${index$3.prefix}-LLMView`,layoutCls=`${index$3.prefix}-layout`,LLMToolView=e=>{var r;const{annotation:u,checkMode:i,tips:c,showTips:l}=e,{imgIndex:a,imgList:s,stepList:d,step:f}=u,{hoverKey:v}=React.useContext(ctx.LLMContext),[L,x]=React.useState([]),[q,m]=React.useState(""),o=(r=reducer.getStepConfig(d,f))==null?void 0:r.config,{t:p}=reactI18next.useTranslation();return React.useEffect(()=>{let t;if(!i)return t=setInterval(()=>{antd.message.info(p("EfficientListening"))},1e3*60),()=>{t&&clearInterval(t)}},[]),React.useEffect(()=>{var t;if(!s[a])return;const n=(t=s[a])==null?void 0:t.questionList;m(n==null?void 0:n.question),x((n==null?void 0:n.answerList)||[])},[a]),React__default.default.createElement(es.Layout,{className:LLMViewCls},React__default.default.createElement("div",{className:`${LLMViewCls}-question`},l===!0&&React__default.default.createElement(index,{tips:c}),React__default.default.createElement(index$1,{hoverKey:v,question:q,answerList:L})),o&&o!=="{}"&&React__default.default.createElement(Sider,{className:`${layoutCls}__side`,width:600},React__default.default.createElement(index$2,{checkMode:i})))},mapStateToProps=e=>({annotation:e.annotation});var LLMToolView$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(LLMToolView);module.exports=LLMToolView$1;
@@ -0,0 +1 @@
1
+ "use strict";var React=require("react"),antd=require("antd"),index=require("../../longText/index.js"),index$1=require("../../../constant/index.js"),classNames=require("classnames"),reactI18next=require("react-i18next"),lbUtils=require("@labelbee/lb-utils");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,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};const LLMViewCls=`${index$1.prefix}-LLMView`,QuestionView=e=>{const{hoverKey:t,question:r,answerList:o,lang:n}=e,{t:l}=reactI18next.useTranslation();return React.useEffect(()=>{var a;n&&((a=lbUtils.i18n)==null||a.changeLanguage(n))},[]),React__default.default.createElement("div",{className:LLMViewCls},React__default.default.createElement("div",{className:`${LLMViewCls}__textBox`,style:{borderBottom:"1px solid #EBEBEB"}},React__default.default.createElement("div",{className:`${LLMViewCls}__title`},l("Title")),React__default.default.createElement("div",{className:`${LLMViewCls}__content`},React__default.default.createElement(index,{wordCount:200,text:r}))),React__default.default.createElement("div",{className:`${LLMViewCls}__textBox`},React__default.default.createElement("div",{className:`${LLMViewCls}__title`},l("Answer")),o.map((a,s)=>React__default.default.createElement("div",{className:classNames__default.default({[`${LLMViewCls}__content`]:!0,[`${LLMViewCls}__contentActive`]:t===(a==null?void 0:a.order)}),key:s},React__default.default.createElement(antd.Tag,{style:{color:"#666FFF",background:"#eeefff",height:"20px",padding:"0px 8px",border:"none"}},a==null?void 0:a.order),React__default.default.createElement(index,{wordCount:1e3,text:a==null?void 0:a.answer})))))},WrapQuestionView=e=>React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(QuestionView,__spreadValues({},e)));module.exports=WrapQuestionView;
@@ -0,0 +1 @@
1
+ "use strict";var React=require("react"),index$4=require("../../../../../constant/index.js"),antd=require("antd"),reactI18next=require("react-i18next"),index$2=require("../scoreGroupButton/index.js"),index$3=require("../determineGroup/index.js"),ctx=require("../../../../../store/ctx.js"),index$1=require("../../../../../utils/index.js"),icons=require("@ant-design/icons"),index=require("../../../../../views/MainView/sidebar/TagSidebar/index.js"),_=require("lodash"),index$5=require("../../../../longText/index.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),ETagType;(function(t){t[t.Finish=0]="Finish",t[t.UnFinish=1]="UnFinish",t[t.Default=2]="Default"})(ETagType||(ETagType={}));const{Panel}=antd.Collapse,LLMSidebarCls=`${index$4.prefix}-LLMSidebar`,AnswerList=t=>{const{list:g=[],LLMConfig:b={},updateValue:h,checkMode:F}=t,{hoverKey:$,setHoverKey:y}=React.useContext(ctx.LLMContext),{t:x}=reactI18next.useTranslation(),S=F,D=e=>{const{indicatorScore:n=[],indicatorDetermine:a=[],score:d}=b;let r=2;if(d){if(!e.score||(e==null?void 0:e.score)>d)return r=1,r;r=0}if((n==null?void 0:n.length)>0){if(n.some(o=>{var c,s;return!((c=e==null?void 0:e.indicatorScore)==null?void 0:c[o.value])||((s=e==null?void 0:e.indicatorScore)==null?void 0:s[o.value])>Number(o==null?void 0:o.score)}))return r=1,r;r=0}if((a==null?void 0:a.length)>0){if(a.some(o=>{var c;const s=(c=e==null?void 0:e.indicatorDetermine)==null?void 0:c[o.value];return!_.isBoolean(s)}))return r=1,r;r=0}return r},k=e=>{const n=D(e);let a=e.order;switch(n){case 0:return{backgroundColor:"#D9FFDF",fontColor:"#36B34A",tagText:`${a} ${x("Finished")}`,tagStatus:n};case 1:return{backgroundColor:"#FFD9D9",fontColor:"#F26549",tagText:`${a} ${x("Unfinished")}`,tagStatus:n};default:return{backgroundColor:"#EBEBEB",fontColor:"#999999",tagText:a,tagStatus:n}}};return React__default.default.createElement(antd.Collapse,{bordered:!1,expandIcon:index.expandIconFuc,expandIconPosition:"end",defaultActiveKey:g.length>0?g.map((e,n)=>n):void 0,style:{margin:"16px 0px"}},g.map((e,n)=>{var a,d;const{score:r,indicatorScore:i=[],indicatorDetermine:o=[]}=b,{backgroundColor:c,fontColor:s,tagText:q,tagStatus:E}=k(e),L=((a=i==null?void 0:i.filter(l=>l.label&&l.value&&l.score))==null?void 0:a.length)>0,w=((d=o==null?void 0:o.filter(l=>l.label&&l.value))==null?void 0:d.length)>0,M=!(r||L||w),j=React__default.default.createElement("div",{style:{display:"flex",width:"500px",alignItems:"center",whiteSpace:"nowrap"},onMouseMove:()=>{y(e.order)},onMouseLeave:()=>{y(-1)}},React__default.default.createElement(antd.Tag,{color:c,style:{color:s,padding:"0px 8px"}},q),React__default.default.createElement("span",{style:{textOverflow:"ellipsis",overflow:"hidden",lineHeight:"32px",paddingRight:"24px"}},e.answer));return React__default.default.createElement(Panel,{header:j,key:n,className:index$1.classnames({[`${LLMSidebarCls}-panel`]:!0,[`${LLMSidebarCls}-panelHover`]:$===e.order,[`${LLMSidebarCls}-errorPanel`]:E===1})},r&&React__default.default.createElement(index$2,{selectScore:e.score,score:r,title:x("OverallScore"),updateScore:l=>h({order:e.order,value:l}),isDisableAll:S}),(i==null?void 0:i.length)>0&&i.map((l,C)=>{var u;const{label:v,text:f,value:p,score:m}=l,I=React__default.default.createElement("div",{className:`${LLMSidebarCls}-indicatorScore`},React__default.default.createElement(index$5,{text:v,openByText:!0}),f&&React__default.default.createElement(antd.Popover,{placement:"bottom",content:f,overlayClassName:`${LLMSidebarCls}-indicatorScore-title`},React__default.default.createElement(icons.InfoCircleOutlined,{style:{margin:"0px 4px",cursor:"pointer"}})));return v&&m?React__default.default.createElement(index$2,{score:m,title:I,selectScore:(u=e==null?void 0:e.indicatorScore)==null?void 0:u[p],updateScore:B=>{const U={key:p,value:B};h({order:e.order,value:U,key:"indicatorScore"})},key:C,isDisableAll:S}):null}),(o==null?void 0:o.length)>0&&o.map((l,C)=>{var u;const{label:v,value:f}=l;return v?React__default.default.createElement(index$3,{selectValue:(u=e==null?void 0:e.indicatorDetermine)==null?void 0:u[f],title:v,updateValue:p=>{const m={key:f,value:p};h({order:e.order,value:m,key:"indicatorDetermine"})},key:C,isDisableAll:S}):null}),M&&React__default.default.createElement("div",{style:{padding:"8px 0px",color:"#CCCCCC"}},x("NoScoringScale")))}))};module.exports=AnswerList;
@@ -0,0 +1 @@
1
+ "use strict";var React=require("react"),index=require("../../../../../constant/index.js"),antd=require("antd"),reactI18next=require("react-i18next"),icons=require("@ant-design/icons"),index$1=require("../../../../../utils/index.js"),_=require("lodash"),lbAnnotation=require("@labelbee/lb-annotation"),ctx=require("../../../../../store/ctx.js");function _interopDefaultLegacy(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}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=(i,c,a)=>c in i?__defProp(i,c,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[c]=a,__spreadValues=(i,c)=>{for(var a in c||(c={}))__hasOwnProp.call(c,a)&&__defNormalProp(i,a,c[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(c))__propIsEnum.call(c,a)&&__defNormalProp(i,a,c[a]);return i},__spreadProps=(i,c)=>__defProps(i,__getOwnPropDescs(c)),EDirection;(function(i){i.Top="Top",i.Right="Right",i.Bottom="Bottom",i.Left="Left"})(EDirection||(EDirection={}));const contentBoxCls=`${index.prefix}-LLMSidebar-contentBox`,Navigation=()=>{const{t:i}=reactI18next.useTranslation();return React__default.default.createElement("div",{className:`${contentBoxCls}__navigation`},React__default.default.createElement("span",null,i("Best")),React__default.default.createElement("div",{style:{display:"flex",alignItems:"center"}},React__default.default.createElement(icons.LeftOutlined,null),React__default.default.createElement("div",{style:{height:0,border:"1px solid #999999",width:"450px"}})),React__default.default.createElement("span",null,i("Worst")))},AnswerSort=i=>{const[,c]=React.useReducer(e=>e+1,0),{sortList:a,setSortList:P,waitSortList:R,checkMode:C}=i,{setHoverKey:T}=React.useContext(ctx.LLMContext),q=C,[w,x]=React.useState(void 0),[y,A]=React.useState(void 0),[m,j]=React.useState([]),{t:E}=reactI18next.useTranslation();React.useEffect(()=>{j(R)},[R]),React.useEffect(()=>{F()},[JSON.stringify(a)]);const D=({item:e,operation:t,id:n})=>{const o={[`border${w}`]:"2px solid #8C9AFF"};return React__default.default.createElement("div",__spreadValues({key:`${e==null?void 0:e.id}`,color:"#EBEBEB",id:n,className:index$1.classnames({[`${contentBoxCls}__answerTag`]:!0}),style:y===(e==null?void 0:e.id)&&w?o:void 0,draggable:q?"":"true",onMouseMove:()=>{T(e.id)},onMouseLeave:()=>{T(-1)}},t),e==null?void 0:e.title)},b=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),k=(e,t)=>{const n=lbAnnotation.MathUtils.getLineLength(e,b(t.tl,t.tr)),o=lbAnnotation.MathUtils.getLineLength(e,b(t.tr,t.tr)),l=lbAnnotation.MathUtils.getLineLength(e,b(t.bl,t.br)),d=lbAnnotation.MathUtils.getLineLength(e,b(t.tl,t.bl));return{minDistance:Math.min(n,o,l,d),toTopDistance:n,toRightDistance:o,toBottompDistance:l,toLeftDistance:d}},U=(e,t)=>{const{minDistance:n,toTopDistance:o,toRightDistance:l,toBottompDistance:d,toLeftDistance:u}=k(e,t);switch(n){case o:x(EDirection.Top);break;case l:x(EDirection.Right);break;case d:x(EDirection.Bottom);break;case u:x(EDirection.Left);break}},F=()=>{const e=document.getElementById("sortBox");if(e==null?void 0:e.childNodes){let t=[];e.childNodes.forEach((n,o)=>{var l;let d=n;((l=n==null?void 0:n.childNodes)==null?void 0:l.length)>1&&(d=n.childNodes[0]);const u=d.getBoundingClientRect()||{},{bottom:r,top:f,left:s,right:p,width:g,height:v,x:O,y:S}=u,M={x:s+g/2,y:f+v/2},$={tl:{x:O,y:S},tr:{x:p,y:f},br:{x:p,y:r},bl:{x:s,y:r}},K=a[o].reduce((X,L)=>{let B=L;return _.isArray(L)&&L.length>1&&(B=L[0]),B=__spreadProps(__spreadValues({},B),{tagCenterPoint:M,tagVertexPoint:$}),[...X,B]},[]);t.push(K)}),P(t)}},N=e=>{var t,n,o,l,d,u;const r=e.pageX,f=e.pageY,s={x:r,y:f};let p=a;if((p==null?void 0:p.length)>0){let g=p[0];for(let v=0;v<p.length;v++)if(v>0){const O=(t=p[v][0])==null?void 0:t.tagCenterPoint,S=(n=g[0])==null?void 0:n.tagCenterPoint,M=lbAnnotation.MathUtils.getLineLength(s,O),$=lbAnnotation.MathUtils.getLineLength(s,S);M<$&&(g=a[v])}if(!s.x||!s.y)return;if(h(e.target.id)===((o=g[0])==null?void 0:o.id)){A(void 0);return}A((l=g[0])==null?void 0:l.id),((d=g[0])==null?void 0:d.tagVertexPoint)&&s&&U(s,(u=g[0])==null?void 0:u.tagVertexPoint)}},I=e=>{var t;const{target:n}=e;let o=-1,l=-1,d=-1,u=[],r=_.cloneDeep(a);if(d=r.findIndex(f=>f[0].id===Number(y)),((t=n==null?void 0:n.parentNode)==null?void 0:t.parentNode.id)==="sortBox"){o=h(n.parentNode.id);const f=h(n.id);u=r[~~o].filter(p=>p.id===~~f);const s=r[~~o].findIndex(p=>p.id===~~f);r[~~o].splice(s,1)}if((n==null?void 0:n.parentNode.id)==="sortBox"){if(!y)return;o=h(n.id),l=r.findIndex(s=>s[0].id===o);const f=r.find(s=>s[0].id===o);f&&(u=f),r.splice(l,1),d=r.findIndex(s=>s[0].id===~~y)}switch(n.parentNode.id==="waitBox"&&(o=h(n.id),l=m.findIndex(f=>f.id===o),u=[m[l]],m.splice(l,1)),w){case EDirection.Left:r.splice(d,0,u);break;case EDirection.Right:r.splice(d+1,0,u);break;case EDirection.Top:case EDirection.Bottom:r[d].push(...u);break;default:r.push(u);break}P(r),x(void 0),c()},h=e=>{const t=e.indexOf("-");return Number(e.substring(t+1,e.length))};return React__default.default.createElement("div",{style:{padding:"0px 16px",marginBottom:"16px"}},React__default.default.createElement("div",{className:`${contentBoxCls}__title`},React__default.default.createElement("span",null,E("RankingQualityOfAnswers")),m.length>0&&React__default.default.createElement(antd.Tag,{color:"#FFD9D9",style:{color:"#F26549",marginLeft:8}},E("Unfinished"))),React__default.default.createElement("div",null,React__default.default.createElement("div",{style:{display:"flex",alignItems:"center"}},React__default.default.createElement("span",{style:{marginRight:"16px"}},E("ToBeSorted")),React__default.default.createElement("div",{id:"waitBox",className:`${contentBoxCls}__answerBox`},m.length>0&&m.map(e=>D({item:e,id:`waitBoxItem-${e==null?void 0:e.id}`,operation:{onDrag:N,onDragEnd:I}})))),React__default.default.createElement(Navigation,null),React__default.default.createElement("div",{id:"sortBox",className:`${contentBoxCls}__answerBox`},a.map((e,t)=>{var n;return e.length>1?React__default.default.createElement("div",{key:`item-${t}`,id:`sortBox-${t}`},e.map(o=>D({item:o,id:`sortBoxItem-${o==null?void 0:o.id}`,operation:{onDrag:N,onDragEnd:I}}))):D({item:e[0],id:`sortBox-${(n=e[0])==null?void 0:n.id}`,operation:{onDrag:N,onDragEnd:I}})}))))};module.exports=AnswerSort;
@@ -0,0 +1 @@
1
+ "use strict";var React=require("react"),index=require("../../../../../constant/index.js"),antd=require("antd"),reactI18next=require("react-i18next"),index$1=require("../../../../longText/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const DetermineGroup=e=>{const{title:a,selectValue:r,isDisableAll:n,updateValue:l}=e,{t}=reactI18next.useTranslation();return React__default.default.createElement("div",{className:`${index.prefix}-LLMSidebar-contentBox`},React__default.default.createElement("span",{style:{width:"160px"}},React__default.default.createElement(index$1,{text:a,openByText:!0})),React__default.default.createElement(antd.Radio.Group,{value:r,onChange:u=>l(u.target.value),disabled:n},React__default.default.createElement(antd.Radio,{value:!0,key:1},t("Yes")),React__default.default.createElement(antd.Radio,{value:!1,key:2},t("No"))))};module.exports=DetermineGroup;
@@ -0,0 +1 @@
1
+ "use strict";var React=require("react"),index=require("../../../../../constant/index.js"),antd=require("antd");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const ScoreGroupButton=e=>{const{title:r,score:n=5,selectScore:l,updateScore:o,isDisableAll:u}=e,c=Array.from({length:n},(t,a)=>a+1);return React__default.default.createElement("div",{className:`${index.prefix}-LLMSidebar-contentBox`},React__default.default.createElement("span",{style:{width:"100px"}},r),React__default.default.createElement(antd.Radio.Group,{value:l,onChange:t=>o(Number(t.target.value)),disabled:u},c.map((t,a)=>React__default.default.createElement(antd.Radio.Button,{value:t,key:a,style:{padding:"0px 16px"}},t))))};module.exports=ScoreGroupButton;
@@ -0,0 +1 @@
1
+ "use strict";var React=require("react"),index$3=require("../../../constant/index.js"),antd=require("antd"),index$2=require("./components/answerSort/index.js"),reactRedux=require("react-redux"),_=require("lodash"),index$1=require("./components/answerList/index.js"),ctx=require("../../../store/ctx.js"),index=require("../../../utils/index.js"),reducer=require("../../../store/annotation/reducer.js"),annotation=require("../../../hooks/annotation.js"),actionCreators=require("../../../store/annotation/actionCreators.js"),lbAnnotation=require("@labelbee/lb-annotation"),reactI18next=require("react-i18next"),data=require("../utils/data.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,n,a)=>n in t?__defProp(t,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[n]=a,__spreadValues=(t,n)=>{for(var a in n||(n={}))__hasOwnProp.call(n,a)&&__defNormalProp(t,a,n[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(n))__propIsEnum.call(n,a)&&__defNormalProp(t,a,n[a]);return t},__spreadProps=(t,n)=>__defProps(t,__getOwnPropDescs(n));const{TextArea}=antd.Input,sidebarCls=`${index$3.prefix}-sidebar`,contentBoxCls=`${index$3.prefix}-LLMSidebar-contentBox`,Sidebar=t=>{var n;const{annotation:a,dispatch:j,checkMode:m}=t,{imgIndex:b,imgList:S,stepList:w,step:h,skipBeforePageTurning:E}=a,{t:q}=reactI18next.useTranslation(),o=(n=S[b])!=null?n:{},R=index.jsonParser(o==null?void 0:o.result),{toolInstanceRef:C}=annotation.useCustomToolInstance({basicInfo:R}),[c,$]=React.useState(),[u,y]=React.useState([]),[x,O]=React.useState(void 0),[g,P]=React.useState([]),[A,D]=React.useState([]);React.useEffect(()=>{var e;if(w&&h){const r=(e=reducer.getStepConfig(w,h))==null?void 0:e.config;$(index.jsonParser(r))}},[w,h]),React.useEffect(()=>{if(!o)return;const e=data.getCurrentResultFromResultList(o==null?void 0:o.result);let r=(e==null?void 0:e.answerList)?e:o==null?void 0:o.questionList;(r==null?void 0:r.answerList)&&(I(r.answerList),y(r.answerList||[])),O(e==null?void 0:e.textAttribute)},[b,o]),React.useEffect(()=>{C.current.exportData=()=>{const i=data.formatSort(g);return[[{answerList:u,sort:i,textAttribute:x,id:o==null?void 0:o.id}],{}]};const e=data.formatSort(g),r={answerList:u,sort:e,textAttribute:x,id:o==null?void 0:o.id,toolName:lbAnnotation.EToolName.LLM};C.current.currentPageResult=r},[u,g,x]);const I=e=>{var r;if(P([]),(e==null?void 0:e.length)>0){let i=[],f=[];const s=data.getCurrentResultFromResultList(o==null?void 0:o.result),v=(s==null?void 0:s.length)>0?s[0]:s;((r=v==null?void 0:v.sort)==null?void 0:r.length)>0&&(f=v.sort.reduce((l,d)=>{let p=[{title:d[0],id:d[0]}];return d.length>1&&(p=d.map(L=>({title:L,id:L}))),[...l,p]},[]),P(f)),e.forEach(l=>{f.some(p=>p.length>1?p.some(L=>L.id===l.order):p[0].id===l.order)||i.push({title:l.order,id:l.order})}),D(i)}},M=({order:e,value:r,key:i})=>{const f=u==null?void 0:u.map(s=>{var v;if((s==null?void 0:s.order)===e){if(_.isNumber(r))return __spreadProps(__spreadValues({},s),{score:r});if(_.isObject(r)&&i){const l={[r==null?void 0:r.key]:r.value},d=(v=s[i])!=null?v:{};return __spreadProps(__spreadValues({},s),{[i]:__spreadValues(__spreadValues({},d),l)})}}return s});y(f)};return React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},React__default.default.createElement("div",{style:{padding:"0px 16px"}},u.length>0&&c&&React__default.default.createElement(index$1,{list:u,LLMConfig:c,updateValue:M,checkMode:m}),(c==null?void 0:c.enableSort)&&React__default.default.createElement(index$2,{waitSortList:A,sortList:g,setSortList:P,checkMode:m}),(c==null?void 0:c.text)&&React__default.default.createElement("div",{style:{padding:"0px 16px",marginBottom:"16px"}},React__default.default.createElement("div",{className:`${contentBoxCls}__title`},q("AdditionalContent")),React__default.default.createElement("div",{style:{display:"flex",alignItems:"center"}},React__default.default.createElement(TextArea,{value:x,onChange:e=>{O(e.target.value)},maxLength:1e3,disabled:m,showCount:!0,style:{width:"100%"}}))),React__default.default.createElement("div",{style:{margin:"24px 16px",display:"flex"}},(S==null?void 0:S.length)-1!==b&&React__default.default.createElement(antd.Button,{type:"primary",style:{marginLeft:"auto"},onClick:()=>{if(E){E(()=>j(actionCreators.PageForward()));return}j(actionCreators.PageForward())},disabled:m},q("Submit"))))))},mapStateToProps=t=>({annotation:t.annotation});var LLMSidebar=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(Sidebar);module.exports=LLMSidebar;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../../../utils/index.js");const getCurrentResultFromResultList=s=>{var n,r;const t=index.jsonParser(s),e="step_1";return(r=(n=t==null?void 0:t[e])==null?void 0:n.result[0])!=null?r:{}},formatSort=s=>s.reduce((r,t)=>{let e=t;return t.length>1?e=t.map(o=>o.id):e=[t[0].id],[...r,e]},[]);exports.formatSort=formatSort,exports.getCurrentResultFromResultList=getCurrentResultFromResultList;
@@ -0,0 +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:o,placement:l="bottom",icon:p=React__default.default.createElement(icons.SearchOutlined,null),openByText:f,style:i,isToolTips:d,wordCount:s}=e,a=React.useRef(null);ahooks.useSize(a);const c=a.current&&((t=a.current)==null?void 0:t.clientWidth)<((r=a.current)==null?void 0:r.scrollWidth);if(s)if((o==null?void 0:o.length)>s){const n=o.slice(0,s);return React__default.default.createElement(antd.Popover,{placement:l,overlayClassName:`${longTextCls}-popover`,content:o},React__default.default.createElement("span",{style:{cursor:"pointer"}},n,"..."))}else return React__default.default.createElement("div",null," ",o);if(f){let n={placement:l,overlayClassName:`${longTextCls}-popover`,content:o,key:`${c}`};c||Object.assign(n,{open:!1});const u=React__default.default.createElement("div",{className:`${longTextCls}-text`,style:i,ref:a},o);return d?React__default.default.createElement(antd.Tooltip,__spreadProps(__spreadValues({},n),{title:o}),u):React__default.default.createElement(antd.Popover,__spreadValues({},n),u)}return React__default.default.createElement("div",{className:longTextCls,style:i},React__default.default.createElement("div",{className:`${longTextCls}-text`,ref:a},o),c&&React__default.default.createElement(antd.Popover,{placement:l,overlayClassName:`${longTextCls}-popover`,content:o},p))};module.exports=LongText;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EScribblePattern=void 0,function(o){o[o.Scribble=1]="Scribble",o[o.Erase=2]="Erase"}(exports.EScribblePattern||(exports.EScribblePattern={})),exports.EToolName=void 0,function(o){o.Rect="rectTool",o.Tag="tagTool",o.Point="pointTool",o.PointMarker="pointMarkerTool",o.Segmentation="segmentationTool",o.Filter="filterTool",o.Text="textTool",o.Polygon="polygonTool",o.Line="lineTool",o.LineMarker="lineMarkerTool",o.Empty="emptyTool",o.FolderTag="folderTagTool",o.RectTrack="rectTrackTool",o.ScribbleTool="scribbleTool",o.Face="faceTool",o.ClientAttribute="clientAttributeTool",o.OCRRelation="OCRRelationTool",o.SegmentByRect="segmentByRectTool",o.Cuboid="cuboidTool",o.PointCloudPolygon="pointCloudPolygon"}(exports.EToolName||(exports.EToolName={})),exports.ETextType=void 0,function(o){o[o.AnyString=0]="AnyString",o[o.Order=1]="Order",o[o.EnglishOnly=2]="EnglishOnly",o[o.NumberOnly=3]="NumberOnly",o[o.CustomFormat=4]="CustomFormat"}(exports.ETextType||(exports.ETextType={}));const TEXT_ATTRIBUTE_MAX_LENGTH=1e3;exports.TEXT_ATTRIBUTE_MAX_LENGTH=TEXT_ATTRIBUTE_MAX_LENGTH;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EScribblePattern=void 0,function(o){o[o.Scribble=1]="Scribble",o[o.Erase=2]="Erase"}(exports.EScribblePattern||(exports.EScribblePattern={})),exports.EToolName=void 0,function(o){o.Rect="rectTool",o.Tag="tagTool",o.Point="pointTool",o.PointMarker="pointMarkerTool",o.Segmentation="segmentationTool",o.Filter="filterTool",o.Text="textTool",o.Polygon="polygonTool",o.Line="lineTool",o.LineMarker="lineMarkerTool",o.Empty="emptyTool",o.FolderTag="folderTagTool",o.RectTrack="rectTrackTool",o.ScribbleTool="scribbleTool",o.Face="faceTool",o.ClientAttribute="clientAttributeTool",o.OCRRelation="OCRRelationTool",o.SegmentByRect="segmentByRectTool",o.Cuboid="cuboidTool",o.PointCloudPolygon="pointCloudPolygon",o.LLM="LLMTool"}(exports.EToolName||(exports.EToolName={})),exports.ETextType=void 0,function(o){o[o.AnyString=0]="AnyString",o[o.Order=1]="Order",o[o.EnglishOnly=2]="EnglishOnly",o[o.NumberOnly=3]="NumberOnly",o[o.CustomFormat=4]="CustomFormat"}(exports.ETextType||(exports.ETextType={}));const TEXT_ATTRIBUTE_MAX_LENGTH=1e3;exports.TEXT_ATTRIBUTE_MAX_LENGTH=TEXT_ATTRIBUTE_MAX_LENGTH;
package/dist/index.css CHANGED
@@ -1544,6 +1544,162 @@
1544
1544
  width: 24px;
1545
1545
  }
1546
1546
 
1547
+ /** LLM style */
1548
+ .bee-LLMLayout {
1549
+ overflow: hidden;
1550
+ }
1551
+
1552
+ .bee-LLMCheckContext {
1553
+ height: calc(100vh - 61px);
1554
+ }
1555
+
1556
+ .bee-LLMView-question {
1557
+ flex: 1;
1558
+ overflow: hidden;
1559
+ }
1560
+
1561
+ .bee-LLMView {
1562
+ height: 100%;
1563
+ background-color: #ffffff;
1564
+ overflow-y: auto;
1565
+ flex: auto;
1566
+ }
1567
+ .bee-LLMView .ant-layout {
1568
+ flex: 1;
1569
+ }
1570
+ .bee-LLMView__textBox {
1571
+ padding: 24px;
1572
+ }
1573
+ .bee-LLMView__title {
1574
+ font-weight: 500;
1575
+ font-size: 18px;
1576
+ margin-bottom: 24px;
1577
+ }
1578
+ .bee-LLMView__content {
1579
+ font-weight: 500;
1580
+ font-size: 14px;
1581
+ display: flex;
1582
+ margin-bottom: 24px;
1583
+ min-width: 240px;
1584
+ padding: 16px;
1585
+ }
1586
+ .bee-LLMView__contentActive {
1587
+ background-color: #eeefff;
1588
+ border: 1px solid #666fff;
1589
+ }
1590
+
1591
+ .bee-LLMSidebar {
1592
+ overflow-y: auto;
1593
+ }
1594
+
1595
+ .bee-LLMSidebar-contentBox {
1596
+ display: flex;
1597
+ align-items: center;
1598
+ margin-bottom: 16px;
1599
+ }
1600
+ .bee-LLMSidebar-contentBox__title {
1601
+ font-weight: 500;
1602
+ font-size: 16px;
1603
+ width: 100%;
1604
+ line-height: 46px;
1605
+ }
1606
+ .bee-LLMSidebar-contentBox__navigation {
1607
+ display: flex;
1608
+ align-items: center;
1609
+ justify-content: space-between;
1610
+ font-size: 14px;
1611
+ height: 46px;
1612
+ }
1613
+ .bee-LLMSidebar-contentBox__answerBox {
1614
+ display: flex;
1615
+ border: 1px dashed #d9d9d9;
1616
+ border-radius: 4px;
1617
+ flex: 1;
1618
+ min-height: 46px;
1619
+ flex-wrap: wrap;
1620
+ }
1621
+ .bee-LLMSidebar-contentBox__answerTag {
1622
+ display: flex;
1623
+ justify-content: center;
1624
+ align-items: center;
1625
+ width: 40px;
1626
+ height: 40px;
1627
+ background-color: #ebebeb;
1628
+ font-size: 14px;
1629
+ color: #333333;
1630
+ margin: 4px;
1631
+ cursor: pointer;
1632
+ }
1633
+ .bee-LLMSidebar-contentBox__answerTagGhost {
1634
+ border: 1px dashed #d9d9d9;
1635
+ background: none;
1636
+ }
1637
+
1638
+ .bee-LLMSidebar-contentBox-sortableHelper {
1639
+ background-color: #8c9aff;
1640
+ cursor: row-resize;
1641
+ z-index: 100;
1642
+ cursor: pointer;
1643
+ }
1644
+
1645
+ .bee-LLMSidebar-indicatorScore {
1646
+ display: flex;
1647
+ align-items: center;
1648
+ }
1649
+
1650
+ .bee-LLMSidebar-indicatorScore-title .ant-popover-inner-content {
1651
+ max-width: 300px;
1652
+ max-height: 400px;
1653
+ overflow: auto;
1654
+ word-break: break-all;
1655
+ }
1656
+
1657
+ .bee-LLMSidebar-panel {
1658
+ padding: 16px;
1659
+ }
1660
+ .bee-LLMSidebar-panel .ant-collapse-header {
1661
+ padding: 0px 16px !important;
1662
+ margin-bottom: 12px;
1663
+ }
1664
+ .bee-LLMSidebar-panel .ant-collapse-content > .ant-collapse-content-box {
1665
+ padding: 0;
1666
+ }
1667
+
1668
+ .bee-LLMSidebar-errorPanel .ant-collapse-header {
1669
+ border: 1px solid #f26549;
1670
+ border-radius: 2px;
1671
+ }
1672
+
1673
+ .bee-LLMSidebar-panelHover .ant-collapse-header {
1674
+ background-color: #eeefff;
1675
+ }
1676
+
1677
+ /** longText style */
1678
+ .bee-longText {
1679
+ display: flex;
1680
+ align-items: center;
1681
+ }
1682
+ .bee-longText .moreIcon {
1683
+ color: #999;
1684
+ cursor: pointer;
1685
+ }
1686
+ .bee-longText .ant-popover-open {
1687
+ color: #1664ff;
1688
+ }
1689
+
1690
+ .bee-longText-text {
1691
+ white-space: nowrap;
1692
+ overflow: hidden;
1693
+ text-overflow: ellipsis;
1694
+ }
1695
+
1696
+ .bee-longText-popover .ant-popover-inner-content {
1697
+ max-width: 300px;
1698
+ max-height: 400px;
1699
+ overflow: auto;
1700
+ word-break: break-all;
1701
+ }
1702
+
1547
1703
  /** PointCloud样式 end */
1548
1704
  .bee-point-cloud-predict-tracking-container .bee-point-cloud-predict-tracking-container__bar {
1549
1705
  position: fixed;
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"),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$2=require("./components/predictTracking/predictTrackingIcon/index.js"),index$3=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,Object.defineProperty(exports,"i18n",{enumerable:!0,get:function(){return lbUtils.i18n}}),exports.VideoTagTool=TagToolInstanceAdaptorI18nProvider.VideoTagTool,exports.PredictTracking=index$2,Object.defineProperty(exports,"EStepType",{enumerable:!0,get:function(){return index$3.EStepType}}),Object.defineProperty(exports,"ESubmitType",{enumerable:!0,get:function(){return index$3.ESubmitType}}),exports.componentCls=index$3.componentCls,exports.prefix=index$3.prefix,exports.default=index,exports.store=store;
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("./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,Object.defineProperty(exports,"EStepType",{enumerable:!0,get:function(){return index$5.EStepType}}),Object.defineProperty(exports,"ESubmitType",{enumerable:!0,get:function(){return index$5.ESubmitType}}),exports.componentCls=index$5.componentCls,exports.prefix=index$5.prefix,exports.default=index,exports.store=store;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$2=require("../../components/customResizeHook/index.js"),index$1=require("../../constant/index.js"),styleString=require("../../constant/styleString.js"),Actions=require("../Actions.js"),index=require("../../utils/index.js"),AnnotationDataUtils=require("../../utils/AnnotationDataUtils.js"),ConfigUtils=require("../../utils/ConfigUtils.js"),data=require("../../utils/data.js"),StepUtils=require("../../utils/StepUtils.js"),ToolUtils=require("../../utils/ToolUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),antd=require("antd"),es=require("antd/es"),_=require("lodash"),actionCreators=require("./actionCreators.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,s)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,__spreadValues=(e,t)=>{for(var s in t||(t={}))__hasOwnProp.call(t,s)&&__defNormalProp(e,s,t[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(t))__propIsEnum.call(t,s)&&__defNormalProp(e,s,t[s]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,s)=>new Promise((p,c)=>{var O=I=>{try{S(s.next(I))}catch(E){c(E)}},g=I=>{try{S(s.throw(I))}catch(E){c(E)}},S=I=>I.done?p(I.value):Promise.resolve(I.value).then(O,g);S((s=s.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(s=>s.step===t),initialState={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},getTotalPage=e=>{const{imgList:t,imgPageSize:s}=e;return Math.ceil(t.length/s)},calcStepProgress=(e,t)=>e.reduce((s,p)=>{if(p){const c=p.result;if(index.jsonParser(c)[`step_${t}`])return s+1}return s},0)/e.length,updateToolInstance=(e,t)=>{const{step:s,stepList:p}=e,c=StepUtils.getCurrentStepInfo(s,p),O=ConfigUtils.ConfigUtils.jsonParser(c.config);if(ToolUtils.isVideoTool(c==null?void 0:c.tool)||ToolUtils.isPointCloudTool(c==null?void 0:c.tool))return;const g=document.getElementById("toolContainer");if(!g)throw"Not exist dom named id-toolContainer";const S=index$2.getFormatSize({width:window.innerWidth,height:window.innerHeight}),I=new lbAnnotation.AnnotationEngine({container:g,toolName:c.tool,size:S,imgNode:t,config:O,style:JSON.parse(styleString)});return{toolInstance:I==null?void 0:I.toolInstance,annotationEngine:I}},LoadFileAndFileData=(e,t)=>(s,p)=>__async(void 0,null,function*(){const{stepList:c,step:O}=p().annotation,g=StepUtils.currentToolIsVideo(O,c),S=StepUtils.currentToolIsPointCloud(O,c);if(actionCreators.SetAnnotationLoading(s,!0),yield s(TryGetFileDataByAPI(e)),g||S){s(AfterVideoLoaded(e));return}s(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,s)=>__async(void 0,null,function*(){const{getFileData:p,imgList:c}=s().annotation;if(p){const O=yield p(c[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:O,index:e}})}}),AfterVideoLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(s,p)=>{var c;const{toolInstance:O,imgList:g}=p().annotation,S=(c=g==null?void 0:g[e])==null?void 0:c.url;lbAnnotation.ImgUtils.load(S).then(I=>{actionCreators.SetAnnotationLoading(s,!1),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:I,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(s,!1),O==null||O.setErrorImg(),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},composeResultByToolInstance=({toolInstance:e,imgList:t,imgIndex:s,stepList:p,step:c=1})=>{var O,g,S,I;const E=((O=t[s])==null?void 0:O.result)||"",[h,b,U]=(g=e==null?void 0:e.exportData())!=null?g:[],x=(I=(S=e==null?void 0:e.exportCustomData)==null?void 0:S.call(e))!=null?I:{},B=data.composeResultWithBasicImgInfo(E,b),w=data.composeResult(B,{step:c,stepList:p},{rect:h},x);return t.map((R,j)=>j===s?__spreadValues(__spreadProps(__spreadValues({},R),{result:w}),U):__spreadValues({},R))},annotationReducer=(e=__spreadValues({},initialState),t)=>{var s,p,c,O,g,S,I,E,h,b,U,x,B,w,R,j,G,V,q,M,k,H,z;switch(t.type){case Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE:return __spreadValues(__spreadValues({},e),initialState);case Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE:return __spreadProps(__spreadValues({},e),{toolInstance:t.payload.toolInstance});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST:return __spreadProps(__spreadValues({},e),{imgList:t.payload.imgList});case Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS:{const{imgList:n,step:o}=e,i=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:i})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:i,stepList:r,toolInstance:u,onSubmit:l,resultList:A}=e;if(!u||!n[o])return e;const d=((s=n[o])==null?void 0:s.result)||"",[,a,T]=(p=u==null?void 0:u.exportData())!=null?p:[],N=(O=(c=u==null?void 0:u.exportCustomData)==null?void 0:c.call(u))!=null?O:{},f=data.composeResultWithBasicImgInfo(d,a),L=data.composeResult(f,{step:i,stepList:r},{rect:A},N),m=e.imgList.map((v,C)=>{if(C===o){const P=AnnotationDataUtils.dataCorrection(L,d,i,r);return __spreadValues(__spreadProps(__spreadValues({},v),{result:P}),T)}return v});if(((g=t.payload)==null?void 0:g.submitType)===index$1.ESubmitType.SyncImgList)return __spreadProps(__spreadValues({},e),{imgList:m});l&&l([m[o]],(S=t.payload)==null?void 0:S.submitType,o,m);const D=calcStepProgress(m,i);return __spreadProps(__spreadValues({},e),{stepProgress:D,imgList:m})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:i}=e;return i==null||i(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:i,toolInstance:r,basicResultList:u}=e;if(!r)return e;const[l]=(I=r==null?void 0:r.exportData())!=null?I:[];let A=l;if((u==null?void 0:u.length)>0){const d=(E=u[o])==null?void 0:E.id,a=l.map(T=>__spreadProps(__spreadValues({},T),{sourceID:d}));A=___default.default.cloneDeep(i).filter(T=>T.sourceID!==d),A.push(...a)}return __spreadProps(__spreadValues({},e),{resultList:A,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:i,imgIndex:r,stepList:u,annotationEngine:l,resultList:A,basicResultList:d}=e;if(!n||!l)return e;const a=t.payload.basicIndex,T=(h=d[a])==null?void 0:h.id,N=index.jsonParser((b=i[r])==null?void 0:b.result),f=(A||[]).filter(P=>P.sourceID===T),L=getStepConfig(u,o),{dataSourceStep:m,tool:D}=L,v=getStepConfig(u,m);let C=[];return m&&D&&(C=(U=N[`step_${m}`])==null?void 0:U.result,(C==null?void 0:C.length)>0?(l==null||l.setBasicInfo(v.tool,C[a]),l==null||l.launchOperation()):(l==null||l.setBasicInfo(v.tool),l==null||l.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:a})}case Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=t.payload;return __spreadProps(__spreadValues({},e),{triggerEventAfterIndexChanged:!!n})}case Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA:{const{imgList:n,step:o,toolInstance:i,annotationEngine:r,stepList:u}=e;if(!i)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const l=StepUtils.getCurrentStepInfo(o,u),{nextIndex:A,imgNode:d,nextBasicIndex:a,imgError:T}=t.payload,N=a!=null?a:0,f=index.jsonParser((x=n[A])==null?void 0:x.result),L=f[`step_${l.step}`],m=!L,D={rotate:(B=f.rotate)!=null?B:0,valid:(w=f.valid)!=null?w:!0};d&&T!==!0?r==null||r.setImgNode(d,D):i==null||i.setValid(D.valid);const v=getStepConfig(u,l.step),{dataSourceStep:C,tool:P}=v,K=getStepConfig(u,C),W=C&&P,y=(j=(R=f[`step_${C}`])==null?void 0:R.result)!=null?j:[],F=AnnotationDataUtils.getInitialResultList(L==null?void 0:L.result,i,v,y,m);if(r==null||r.launchOperation(),W&&((y==null?void 0:y.length)>0?r==null||r.setBasicInfo(K.tool,y[N]):(r==null||r.setBasicInfo(K.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),l.tool!=="check"){const $=(V=(G=y[N])==null?void 0:G.id)!=null?V:"",Y=W?F.filter(J=>lbAnnotation.CommonToolUtils.isSameSourceID(J.sourceID,$)):F;i==null||i.history.initRecord(F,!0),i==null||i.setResult(Y)}return __spreadProps(__spreadValues({},e),{imgIndex:A,basicIndex:N,basicResultList:y,resultList:F})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(q=t.payload.config)!=null?q:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST:{const{stepList:n}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n})}case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:o}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:o})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,o=updateToolInstance(e,n);if(o){const{toolInstance:i,annotationEngine:r}=o;return __spreadProps(__spreadValues({},e),{toolInstance:i,annotationEngine:r})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(M=t.payload)==null?void 0:M.instance;return n?__spreadProps(__spreadValues({},e),{toolInstance:n}):__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT:return __spreadProps(__spreadValues({},e),{onSubmit:t.payload.onSubmit});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE:return __spreadProps(__spreadValues({},e),{onSave:t.payload.onSave});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE:return __spreadProps(__spreadValues({},e),{onPageChange:t.payload.onPageChange});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT:return __spreadProps(__spreadValues({},e),{predictionResult:t.payload.result});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE:return __spreadProps(__spreadValues({},e),{predictionResultVisible:t.payload.visible});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE:return __spreadProps(__spreadValues({},e),{onStepChange:t.payload.onStepChange});case Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA:return __spreadProps(__spreadValues({},e),{getFileData:t.payload.getFileData});case Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE:return __spreadProps(__spreadValues({},e),{pageSize:t.payload.pageSize});case Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST:return __spreadProps(__spreadValues({},e),{loadFileList:t.payload.loadFileList});case Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE:return __spreadProps(__spreadValues({},e),{beforeRotate:t.payload.beforeRotate});case Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING:return __spreadProps(__spreadValues({},e),{skipBeforePageTurning:t.payload.skipBeforePageTurning});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:o}=t.payload,{imgList:i}=e,r=[...i];return r[o]=__spreadValues(__spreadValues({},r[o]),n),__spreadProps(__spreadValues({},e),{imgList:r})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:o}=e;return o&&o()===!1||n==null||n.updateRotate(),e}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=e,o=(k=n==null?void 0:n.valid)!=null?k:!0;return antd.Modal.destroyAll(),antd.Modal.confirm({content:lbUtils.i18n.t(o?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!o)},okText:lbUtils.i18n.t("Confirm"),cancelText:lbUtils.i18n.t("Cancel")}),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:o,imgList:i,step:r}=e;if(!n)return e;if(o===0||o>=i.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const u=i[o-1].result;if(!u)return e;const l=AnnotationDataUtils.copyResultChange(u,r,(H=i[o].result)!=null?H:"");i[o]=__spreadProps(__spreadValues({},i[o]),{result:l});const d=index.jsonParser(l)[`step_${r}`],a=(d==null?void 0:d.result)||[];return n==null||n.setResult(a),n==null||n.history.pushHistory(a),(z=n==null?void 0:n.asyncData)==null||z.call(n,i[o]),__spreadProps(__spreadValues({},e),{imgList:[...i]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:o}=e,{toStep:i}=t.payload;if(!o)return e;const r=getStepConfig(n,i);return o==null||o.setToolName(r.tool,r.config),__spreadProps(__spreadValues({},e),{step:i,toolInstance:o==null?void 0:o.toolInstance})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{pointCloudLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE:{const{checkMode:n}=t.payload;return __spreadProps(__spreadValues({},e),{checkMode:!!n})}case Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=t.payload;return __spreadProps(__spreadValues({},e),{highlightAttribute:n})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:o,rangeIndex:i,imgList:r}=t.payload,{imgIndex:u,onSubmit:l}=e,A=[],d=r.map((a,T)=>{if(lbAnnotation.MathUtils.isInRange(T,i)){const N=__spreadProps(__spreadValues({},a),{result:lbUtils.PointCloudUtils.batchUpdateTrackID({id:n,newID:o,result:a.result})});return A.push({imgIndex:T,newInfo:N}),N}return a});return l&&l([d[u]],index$1.ESubmitType.BatchUpdateTrackID,u,d,{updateImgList:A}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:o,rangeIndex:i}=t.payload,{imgList:r,imgIndex:u,onSubmit:l}=e,A=[],d=r.map((a,T)=>{if(lbAnnotation.MathUtils.isInRange(T,i)){const N=__spreadProps(__spreadValues({},a),{result:lbUtils.PointCloudUtils.batchUpdateResultByTrackID({id:n,newData:o,result:a.result})});return A.push({imgIndex:T,newInfo:N}),N}return a});return l&&l([d[u]],index$1.ESubmitType.BatchUpdateTrackID,u,d,{updateImgList:A}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:o,stepList:i,step:r,predictionResult:u}=e,l={};u.forEach(T=>{const{index:N}=T;l[N]=___default.default.pick(T,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const A=`step_${r}`,d=[],a=o.map((T,N)=>{if(l[N]){const f=T.result==="{}"?index.jsonParser(data.composeResult("",{step:r,stepList:i},{rect:[]},{})):index.jsonParser(T.result);f[A].result.push(l[N]);const L=__spreadProps(__spreadValues({},T),{result:JSON.stringify(f)});return d.push({imgIndex:N,newInfo:L}),L}return T});return n==null||n(a,index$1.ESubmitType.BatchUpdateImgList,-1,a,{updateImgList:d}),__spreadProps(__spreadValues({},e),{imgList:a})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.composeResultByToolInstance=composeResultByToolInstance,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$2=require("../../components/customResizeHook/index.js"),index$1=require("../../constant/index.js"),styleString=require("../../constant/styleString.js"),Actions=require("../Actions.js"),index=require("../../utils/index.js"),AnnotationDataUtils=require("../../utils/AnnotationDataUtils.js"),ConfigUtils=require("../../utils/ConfigUtils.js"),data=require("../../utils/data.js"),StepUtils=require("../../utils/StepUtils.js"),ToolUtils=require("../../utils/ToolUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),antd=require("antd"),es=require("antd/es"),_=require("lodash"),actionCreators=require("./actionCreators.js"),ToolType=require("../../data/enums/ToolType.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,s)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,__spreadValues=(e,t)=>{for(var s in t||(t={}))__hasOwnProp.call(t,s)&&__defNormalProp(e,s,t[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(t))__propIsEnum.call(t,s)&&__defNormalProp(e,s,t[s]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,s)=>new Promise((O,a)=>{var A=I=>{try{S(s.next(I))}catch(L){a(L)}},g=I=>{try{S(s.throw(I))}catch(L){a(L)}},S=I=>I.done?O(I.value):Promise.resolve(I.value).then(A,g);S((s=s.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(s=>s.step===t),initialState={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},getTotalPage=e=>{const{imgList:t,imgPageSize:s}=e;return Math.ceil(t.length/s)},calcStepProgress=(e,t)=>e.reduce((s,O)=>{if(O){const a=O.result;if(index.jsonParser(a)[`step_${t}`])return s+1}return s},0)/e.length,updateToolInstance=(e,t)=>{const{step:s,stepList:O}=e,a=StepUtils.getCurrentStepInfo(s,O),A=ConfigUtils.ConfigUtils.jsonParser(a.config);if(ToolUtils.isVideoTool(a==null?void 0:a.tool)||ToolUtils.isPointCloudTool(a==null?void 0:a.tool)||ToolType.EToolName.LLM===(a==null?void 0:a.tool))return;const g=document.getElementById("toolContainer");if(!g)throw"Not exist dom named id-toolContainer";const S=index$2.getFormatSize({width:window.innerWidth,height:window.innerHeight}),I=new lbAnnotation.AnnotationEngine({container:g,toolName:a.tool,size:S,imgNode:t,config:A,style:JSON.parse(styleString)});return{toolInstance:I==null?void 0:I.toolInstance,annotationEngine:I}},LoadFileAndFileData=(e,t)=>(s,O)=>__async(void 0,null,function*(){var a;const{stepList:A,step:g}=O().annotation,S=StepUtils.currentToolIsVideo(g,A),I=StepUtils.currentToolIsPointCloud(g,A),L=((a=StepUtils.getCurrentStepInfo(g,A))==null?void 0:a.tool)===ToolType.EToolName.LLM;if(actionCreators.SetAnnotationLoading(s,!0),yield s(TryGetFileDataByAPI(e)),S||I||L){s(AfterVideoLoaded(e));return}s(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,s)=>__async(void 0,null,function*(){const{getFileData:O,imgList:a}=s().annotation;if(O){const A=yield O(a[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:A,index:e}})}}),AfterVideoLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(s,O)=>{var a;const{toolInstance:A,imgList:g}=O().annotation,S=(a=g==null?void 0:g[e])==null?void 0:a.url;lbAnnotation.ImgUtils.load(S).then(I=>{actionCreators.SetAnnotationLoading(s,!1),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:I,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(s,!1),A==null||A.setErrorImg(),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},composeResultByToolInstance=({toolInstance:e,imgList:t,imgIndex:s,stepList:O,step:a=1})=>{var A,g,S,I;const L=((A=t[s])==null?void 0:A.result)||"",[h,b,U]=(g=e==null?void 0:e.exportData())!=null?g:[],x=(I=(S=e==null?void 0:e.exportCustomData)==null?void 0:S.call(e))!=null?I:{},B=data.composeResultWithBasicImgInfo(L,b),w=data.composeResult(B,{step:a,stepList:O},{rect:h},x);return t.map((R,j)=>j===s?__spreadValues(__spreadProps(__spreadValues({},R),{result:w}),U):__spreadValues({},R))},annotationReducer=(e=__spreadValues({},initialState),t)=>{var s,O,a,A,g,S,I,L,h,b,U,x,B,w,R,j,G,V,M,q,k,H,z;switch(t.type){case Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE:return __spreadValues(__spreadValues({},e),initialState);case Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE:return __spreadProps(__spreadValues({},e),{toolInstance:t.payload.toolInstance});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST:return __spreadProps(__spreadValues({},e),{imgList:t.payload.imgList});case Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS:{const{imgList:n,step:o}=e,i=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:i})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:i,stepList:r,toolInstance:u,onSubmit:l,resultList:N}=e;if(!u||!n[o])return e;const d=((s=n[o])==null?void 0:s.result)||"",[,c,T]=(O=u==null?void 0:u.exportData())!=null?O:[],p=(A=(a=u==null?void 0:u.exportCustomData)==null?void 0:a.call(u))!=null?A:{},f=data.composeResultWithBasicImgInfo(d,c),v=data.composeResult(f,{step:i,stepList:r},{rect:N},p),m=e.imgList.map((E,C)=>{if(C===o){const P=AnnotationDataUtils.dataCorrection(v,d,i,r);return __spreadValues(__spreadProps(__spreadValues({},E),{result:P}),T)}return E});if(((g=t.payload)==null?void 0:g.submitType)===index$1.ESubmitType.SyncImgList)return __spreadProps(__spreadValues({},e),{imgList:m});l&&l([m[o]],(S=t.payload)==null?void 0:S.submitType,o,m);const D=calcStepProgress(m,i);return __spreadProps(__spreadValues({},e),{stepProgress:D,imgList:m})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:i}=e;return i==null||i(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:i,toolInstance:r,basicResultList:u}=e;if(!r)return e;const[l]=(I=r==null?void 0:r.exportData())!=null?I:[];let N=l;if((u==null?void 0:u.length)>0){const d=(L=u[o])==null?void 0:L.id,c=l.map(T=>__spreadProps(__spreadValues({},T),{sourceID:d}));N=___default.default.cloneDeep(i).filter(T=>T.sourceID!==d),N.push(...c)}return __spreadProps(__spreadValues({},e),{resultList:N,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:i,imgIndex:r,stepList:u,annotationEngine:l,resultList:N,basicResultList:d}=e;if(!n||!l)return e;const c=t.payload.basicIndex,T=(h=d[c])==null?void 0:h.id,p=index.jsonParser((b=i[r])==null?void 0:b.result),f=(N||[]).filter(P=>P.sourceID===T),v=getStepConfig(u,o),{dataSourceStep:m,tool:D}=v,E=getStepConfig(u,m);let C=[];return m&&D&&(C=(U=p[`step_${m}`])==null?void 0:U.result,(C==null?void 0:C.length)>0?(l==null||l.setBasicInfo(E.tool,C[c]),l==null||l.launchOperation()):(l==null||l.setBasicInfo(E.tool),l==null||l.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:c})}case Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=t.payload;return __spreadProps(__spreadValues({},e),{triggerEventAfterIndexChanged:!!n})}case Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA:{const{imgList:n,step:o,toolInstance:i,annotationEngine:r,stepList:u}=e;if(!i)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const l=StepUtils.getCurrentStepInfo(o,u),{nextIndex:N,imgNode:d,nextBasicIndex:c,imgError:T}=t.payload,p=c!=null?c:0,f=index.jsonParser((x=n[N])==null?void 0:x.result),v=f[`step_${l.step}`],m=!v,D={rotate:(B=f.rotate)!=null?B:0,valid:(w=f.valid)!=null?w:!0};d&&T!==!0?r==null||r.setImgNode(d,D):i==null||i.setValid(D.valid);const E=getStepConfig(u,l.step),{dataSourceStep:C,tool:P}=E,K=getStepConfig(u,C),W=C&&P,y=(j=(R=f[`step_${C}`])==null?void 0:R.result)!=null?j:[],F=AnnotationDataUtils.getInitialResultList(v==null?void 0:v.result,i,E,y,m);if(r==null||r.launchOperation(),W&&((y==null?void 0:y.length)>0?r==null||r.setBasicInfo(K.tool,y[p]):(r==null||r.setBasicInfo(K.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),l.tool!=="check"){const $=(V=(G=y[p])==null?void 0:G.id)!=null?V:"",Y=W?F.filter(J=>lbAnnotation.CommonToolUtils.isSameSourceID(J.sourceID,$)):F;i==null||i.history.initRecord(F,!0),i==null||i.setResult(Y)}return __spreadProps(__spreadValues({},e),{imgIndex:N,basicIndex:p,basicResultList:y,resultList:F})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(M=t.payload.config)!=null?M:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST:{const{stepList:n}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n})}case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:o}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:o})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,o=updateToolInstance(e,n);if(o){const{toolInstance:i,annotationEngine:r}=o;return __spreadProps(__spreadValues({},e),{toolInstance:i,annotationEngine:r})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(q=t.payload)==null?void 0:q.instance;return n?__spreadProps(__spreadValues({},e),{toolInstance:n}):__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT:return __spreadProps(__spreadValues({},e),{onSubmit:t.payload.onSubmit});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE:return __spreadProps(__spreadValues({},e),{onSave:t.payload.onSave});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE:return __spreadProps(__spreadValues({},e),{onPageChange:t.payload.onPageChange});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT:return __spreadProps(__spreadValues({},e),{predictionResult:t.payload.result});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE:return __spreadProps(__spreadValues({},e),{predictionResultVisible:t.payload.visible});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE:return __spreadProps(__spreadValues({},e),{onStepChange:t.payload.onStepChange});case Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA:return __spreadProps(__spreadValues({},e),{getFileData:t.payload.getFileData});case Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE:return __spreadProps(__spreadValues({},e),{pageSize:t.payload.pageSize});case Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST:return __spreadProps(__spreadValues({},e),{loadFileList:t.payload.loadFileList});case Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE:return __spreadProps(__spreadValues({},e),{beforeRotate:t.payload.beforeRotate});case Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING:return __spreadProps(__spreadValues({},e),{skipBeforePageTurning:t.payload.skipBeforePageTurning});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:o}=t.payload,{imgList:i}=e,r=[...i];return r[o]=__spreadValues(__spreadValues({},r[o]),n),__spreadProps(__spreadValues({},e),{imgList:r})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:o}=e;return o&&o()===!1||n==null||n.updateRotate(),e}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=e,o=(k=n==null?void 0:n.valid)!=null?k:!0;return antd.Modal.destroyAll(),antd.Modal.confirm({content:lbUtils.i18n.t(o?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!o)},okText:lbUtils.i18n.t("Confirm"),cancelText:lbUtils.i18n.t("Cancel")}),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:o,imgList:i,step:r}=e;if(!n)return e;if(o===0||o>=i.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const u=i[o-1].result;if(!u)return e;const l=AnnotationDataUtils.copyResultChange(u,r,(H=i[o].result)!=null?H:"");i[o]=__spreadProps(__spreadValues({},i[o]),{result:l});const d=index.jsonParser(l)[`step_${r}`],c=(d==null?void 0:d.result)||[];return n==null||n.setResult(c),n==null||n.history.pushHistory(c),(z=n==null?void 0:n.asyncData)==null||z.call(n,i[o]),__spreadProps(__spreadValues({},e),{imgList:[...i]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:o}=e,{toStep:i}=t.payload;if(!o)return e;const r=getStepConfig(n,i);return o==null||o.setToolName(r.tool,r.config),__spreadProps(__spreadValues({},e),{step:i,toolInstance:o==null?void 0:o.toolInstance})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{pointCloudLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE:{const{checkMode:n}=t.payload;return __spreadProps(__spreadValues({},e),{checkMode:!!n})}case Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=t.payload;return __spreadProps(__spreadValues({},e),{highlightAttribute:n})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:o,rangeIndex:i,imgList:r}=t.payload,{imgIndex:u,onSubmit:l}=e,N=[],d=r.map((c,T)=>{if(lbAnnotation.MathUtils.isInRange(T,i)){const p=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateTrackID({id:n,newID:o,result:c.result})});return N.push({imgIndex:T,newInfo:p}),p}return c});return l&&l([d[u]],index$1.ESubmitType.BatchUpdateTrackID,u,d,{updateImgList:N}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:o,rangeIndex:i}=t.payload,{imgList:r,imgIndex:u,onSubmit:l}=e,N=[],d=r.map((c,T)=>{if(lbAnnotation.MathUtils.isInRange(T,i)){const p=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateResultByTrackID({id:n,newData:o,result:c.result})});return N.push({imgIndex:T,newInfo:p}),p}return c});return l&&l([d[u]],index$1.ESubmitType.BatchUpdateTrackID,u,d,{updateImgList:N}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:o,stepList:i,step:r,predictionResult:u}=e,l={};u.forEach(T=>{const{index:p}=T;l[p]=___default.default.pick(T,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const N=`step_${r}`,d=[],c=o.map((T,p)=>{if(l[p]){const f=T.result==="{}"?index.jsonParser(data.composeResult("",{step:r,stepList:i},{rect:[]},{})):index.jsonParser(T.result);f[N].result.push(l[p]);const v=__spreadProps(__spreadValues({},T),{result:JSON.stringify(f)});return d.push({imgIndex:p,newInfo:v}),v}return T});return n==null||n(c,index$1.ESubmitType.BatchUpdateImgList,-1,c,{updateImgList:d}),__spreadProps(__spreadValues({},e),{imgList:c})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.composeResultByToolInstance=composeResultByToolInstance,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
package/dist/store/ctx.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const LabelBeeContext=React__default.default.createContext(void 0),useDispatch=reactRedux.createDispatchHook(LabelBeeContext),useSelector=reactRedux.createSelectorHook(LabelBeeContext);exports.LabelBeeContext=LabelBeeContext,exports.useDispatch=useDispatch,exports.useSelector=useSelector;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const LabelBeeContext=React__default.default.createContext(void 0),useDispatch=reactRedux.createDispatchHook(LabelBeeContext),useSelector=reactRedux.createSelectorHook(LabelBeeContext),LLMContext=React__default.default.createContext({hoverKey:-1,setHoverKey:()=>{}});exports.LLMContext=LLMContext,exports.LabelBeeContext=LabelBeeContext,exports.useDispatch=useDispatch,exports.useSelector=useSelector;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ checkMode?: boolean;
4
+ annotation?: any;
5
+ showTips?: boolean;
6
+ tips?: string;
7
+ }
8
+ declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
9
+ children?: React.ReactNode;
10
+ }, "annotation">>;
11
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { IAnswerList } from '@/components/LLMToolView/types';
3
+ interface IProps {
4
+ hoverKey?: number;
5
+ question: string;
6
+ answerList: IAnswerList[];
7
+ lang?: string;
8
+ }
9
+ declare const WrapQuestionView: (props: IProps) => React.JSX.Element;
10
+ export default WrapQuestionView;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { ILLMToolConfig, IAnswerList } from '@/components/LLMToolView/types';
3
+ interface IProps {
4
+ list?: IAnswerList[];
5
+ checkMode?: boolean;
6
+ LLMConfig?: ILLMToolConfig;
7
+ updateValue: ({ order, value, key, }: {
8
+ order: number;
9
+ value: number | {
10
+ key: string;
11
+ value: number | boolean;
12
+ };
13
+ key?: string;
14
+ }) => void;
15
+ }
16
+ declare const AnswerList: (props: IProps) => React.JSX.Element;
17
+ export default AnswerList;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { IAnswerSort, IWaitAnswerSort } from '@/components/LLMToolView/types';
3
+ interface IProps {
4
+ setSortList: (value: IAnswerSort[][]) => void;
5
+ sortList: IAnswerSort[][];
6
+ waitSortList: IWaitAnswerSort[];
7
+ checkMode?: boolean;
8
+ }
9
+ declare const AnswerSort: (props: IProps) => React.JSX.Element;
10
+ export default AnswerSort;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ title: string;
4
+ selectValue?: boolean;
5
+ isDisableAll?: boolean;
6
+ updateValue: (changeValue: boolean) => void;
7
+ }
8
+ declare const DetermineGroup: (props: IProps) => React.JSX.Element;
9
+ export default DetermineGroup;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ title: React.ReactNode;
4
+ score?: number;
5
+ selectScore?: number;
6
+ isDisableAll?: boolean;
7
+ updateScore: (score: number) => void;
8
+ }
9
+ declare const ScoreGroupButton: (props: IProps) => React.JSX.Element;
10
+ export default ScoreGroupButton;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ annotation?: any;
4
+ dispatch: any;
5
+ checkMode?: boolean;
6
+ }
7
+ declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
8
+ children?: React.ReactNode;
9
+ }, "annotation" | "dispatch">>;
10
+ export default _default;
@@ -0,0 +1,54 @@
1
+ export interface IndicatorScore {
2
+ label: string;
3
+ value: string;
4
+ text?: string;
5
+ score?: number;
6
+ }
7
+ export interface IndicatorDetermine {
8
+ label: string;
9
+ value: string;
10
+ }
11
+ export interface IAnswerList {
12
+ order: number;
13
+ answer: string;
14
+ score?: number;
15
+ indicatorScore?: {
16
+ [key: string]: number;
17
+ };
18
+ indicatorDetermine?: {
19
+ [key: string]: boolean;
20
+ };
21
+ }
22
+ export interface ILLMToolConfig {
23
+ enableSort?: boolean;
24
+ indicatorScore?: IndicatorScore[];
25
+ indicatorDetermine?: IndicatorDetermine[];
26
+ score?: number;
27
+ text?: boolean;
28
+ }
29
+ export interface IWaitAnswerSort {
30
+ title: number;
31
+ id: number;
32
+ }
33
+ export interface IPoint {
34
+ x: number;
35
+ y: number;
36
+ }
37
+ export interface ITagVertexPoint {
38
+ bl: IPoint;
39
+ br: IPoint;
40
+ tl: IPoint;
41
+ tr: IPoint;
42
+ }
43
+ export interface IAnswerSort {
44
+ title: number;
45
+ id: number;
46
+ tagCenterPoint?: IPoint;
47
+ tagVertexPoint?: ITagVertexPoint;
48
+ }
49
+ export interface ILLMBoxResult {
50
+ answerList: IAnswerList[];
51
+ id: number;
52
+ sort?: number[][];
53
+ textAttribute?: string;
54
+ }
@@ -0,0 +1,2 @@
1
+ export declare const getCurrentResultFromResultList: (result: string) => any;
2
+ export declare const formatSort: (sortList: any) => any;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @file Text exceeds display view more
3
+ * @author lixinghua <lixinghua@sensetime.com>;
4
+ * @date 2023-04-10
5
+ */
6
+ import React, { ReactElement, CSSProperties } from 'react';
7
+ import { TooltipPlacement } from 'antd/es/tooltip';
8
+ interface IProps {
9
+ text: string;
10
+ placement?: TooltipPlacement;
11
+ icon?: ReactElement | null;
12
+ openByText?: boolean;
13
+ style?: CSSProperties;
14
+ isToolTips?: boolean;
15
+ wordCount?: number;
16
+ }
17
+ declare const LongText: (props: IProps) => React.JSX.Element;
18
+ export default LongText;
@@ -41,7 +41,8 @@ export declare enum EToolName {
41
41
  SegmentByRect = "segmentByRectTool",
42
42
  Cuboid = "cuboidTool",
43
43
  /** 点云多边形工具 */
44
- PointCloudPolygon = "pointCloudPolygon"
44
+ PointCloudPolygon = "pointCloudPolygon",
45
+ LLM = "LLMTool"
45
46
  }
46
47
  export declare enum ETextType {
47
48
  AnyString = 0,
@@ -2,7 +2,7 @@
2
2
  import { EPointCloudPattern } from '@labelbee/lb-utils';
3
3
  export interface ICustomToolInstance {
4
4
  valid: boolean;
5
- exportData: () => [any[], {}];
5
+ exportData: () => [any, {}];
6
6
  exportCustomData: () => {};
7
7
  singleOn: () => void;
8
8
  clearResult: () => void;
@@ -1,16 +1,18 @@
1
1
  import { AppProps } from '@/App';
2
2
  import AnnotationView from '@/components/AnnotationView';
3
3
  import PointCloudAnnotationView from '@/components/AnnotationView/pointCloudAnnotationView';
4
+ import QuestionView from '@/components/LLMToolView/questionView';
4
5
  import { i18n } from '@labelbee/lb-utils';
5
6
  import React from 'react';
6
7
  import { VideoTagTool } from '@/components/videoPlayer/TagToolInstanceAdaptorI18nProvider';
7
8
  import './index.scss';
8
9
  import PredictTracking from '@/components/predictTracking';
10
+ import LLMToolView from '@/components/LLMToolView';
9
11
  export declare const store: import("redux").Store<{}, import("redux").Action<any>> & {
10
12
  dispatch: unknown;
11
13
  };
12
14
  declare const _default: React.ForwardRefExoticComponent<AppProps & React.RefAttributes<unknown>>;
13
15
  export default _default;
14
- export { AnnotationView, PointCloudAnnotationView, i18n, VideoTagTool, PredictTracking };
16
+ export { AnnotationView, PointCloudAnnotationView, QuestionView, LLMToolView, i18n, VideoTagTool, PredictTracking, };
15
17
  export * from './constant';
16
18
  export * from './typeTem';
@@ -1,4 +1,11 @@
1
+ import React from 'react';
1
2
  import { AnyAction, Dispatch } from 'redux';
3
+ interface ILLMContext {
4
+ hoverKey: number;
5
+ setHoverKey: (value: number) => void;
6
+ }
2
7
  export declare const LabelBeeContext: any;
3
8
  export declare const useDispatch: () => Dispatch<AnyAction | any>;
4
9
  export declare const useSelector: <Selected extends unknown>(selector: (state: any) => Selected, equalityFn?: ((previous: Selected, next: Selected) => boolean) | undefined) => Selected;
10
+ export declare const LLMContext: React.Context<ILLMContext>;
11
+ export {};
@@ -4,9 +4,16 @@
4
4
  * @date 2022-06-20
5
5
  */
6
6
  import { cTool } from '@labelbee/lb-annotation';
7
+ interface IPoint {
8
+ x: number;
9
+ y: number;
10
+ }
7
11
  declare class ToolUtils {
8
12
  static isVideoTool(tool?: string): boolean;
9
13
  static isPointCloudTool(tool?: string): boolean;
10
14
  static getPointCloudToolList(): cTool.EToolName[];
15
+ static getPointToLineDistance(pt: IPoint, // A point outside the straight line
16
+ begin: IPoint, // Straight line start point
17
+ end: IPoint): number;
11
18
  }
12
19
  export default ToolUtils;
@@ -0,0 +1,8 @@
1
+ import { AppProps } from '@/App';
2
+ import React from 'react';
3
+ interface IProps {
4
+ path: string;
5
+ loading: boolean;
6
+ }
7
+ declare const LLMLayout: React.FC<AppProps & IProps>;
8
+ export default LLMLayout;
@@ -0,0 +1,6 @@
1
+ declare const LLMShortCutTable: {
2
+ name: string;
3
+ icon: any;
4
+ shortCut: string[];
5
+ }[];
6
+ export default LLMShortCutTable;
@@ -16,6 +16,9 @@ interface IToolHeaderProps {
16
16
  stepInfo: IStepInfo;
17
17
  stepList: IStepInfo[];
18
18
  step: number;
19
+ hasLangNode: boolean;
20
+ hasHeaderOption: boolean;
21
+ hasPredictTrackingIcon: boolean;
19
22
  }
20
23
  declare const _default: import("react-redux").ConnectedComponent<React.FC<IToolHeaderProps>, import("react-redux").Omit<IToolHeaderProps & {
21
24
  children?: React.ReactNode;