@labelbee/lb-components 1.24.0-alpha.16 → 1.24.0-alpha.18

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 (23) hide show
  1. package/dist/components/LLMMultiWheelView/dialogView/index.js +1 -1
  2. package/dist/components/LLMMultiWheelView/index.js +1 -1
  3. package/dist/components/LLMToolView/index.js +1 -1
  4. package/dist/components/LLMToolView/questionView/components/audioView/index.js +1 -0
  5. package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
  6. package/dist/components/LLMToolView/questionView/index.js +1 -1
  7. package/dist/constant/index.js +1 -1
  8. package/dist/types/components/LLMMultiWheelView/dialogView/index.d.ts +2 -0
  9. package/dist/types/components/LLMMultiWheelView/index.d.ts +2 -0
  10. package/dist/types/components/LLMToolView/questionView/components/audioView/index.d.ts +8 -0
  11. package/dist/types/components/LLMToolView/questionView/components/header/index.d.ts +3 -1
  12. package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +0 -1
  13. package/dist/types/components/pointCloudView/hooks/useRotate.d.ts +1 -2
  14. package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +1 -2
  15. package/dist/types/constant/index.d.ts +2 -1
  16. package/es/components/LLMMultiWheelView/dialogView/index.js +1 -1
  17. package/es/components/LLMMultiWheelView/index.js +1 -1
  18. package/es/components/LLMToolView/index.js +1 -1
  19. package/es/components/LLMToolView/questionView/components/audioView/index.js +1 -0
  20. package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
  21. package/es/components/LLMToolView/questionView/index.js +1 -1
  22. package/es/constant/index.js +1 -1
  23. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";var index$4=require("../../LLMToolView/questionView/index.js"),index$2=require("../../LLMToolView/questionView/components/header/index.js"),index$3=require("../../LLMToolView/questionView/components/imgView/index.js"),index=require("../../../store/LLMMultiWheel/index.js"),index$1=require("../../../utils/index.js"),antd=require("antd"),React=require("react"),reactI18next=require("react-i18next");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 DialogView=e=>{const{id:t,answerList:r,question:d,index:u,name:c="",answerIsImg:m,questionIsImg:f,LLMConfig:p}=e,{t:a}=reactI18next.useTranslation(),{dataFormatType:l,selectedID:v,setSelectedID:w}=index(),n=u+1,_=c||`${a("Dialog")}${n}`;return React__default.default.createElement("div",{key:t,onClick:()=>w(t),className:index$1.classnames({dialog:!0,selected:t===v})},React__default.default.createElement("div",{className:"header"},React__default.default.createElement("span",{className:"order"},n),React__default.default.createElement("div",{className:"name"},React__default.default.createElement("div",{className:"show-name"},_),React__default.default.createElement("div",{className:"tips"},"\uFF08",a("SelectionOfAnnotation"),"\uFF09"))),React__default.default.createElement("div",{className:"dialog-question"},React__default.default.createElement(antd.Button,{type:"primary"},a("Title"),n),React__default.default.createElement("div",null,React__default.default.createElement(index$2.RenderQuestion,{question:d,dataFormatType:l,isImg:f}))),React__default.default.createElement("div",{className:"dialog-answer"},m?React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(antd.Button,{type:"primary"},a("Answer")),React__default.default.createElement(index$3,{answerList:r})):r==null?void 0:r.map((g,i)=>{const s=i+1,o=__spreadProps(__spreadValues({},g),{order:s}),y=index$4.getTextControlByConfig(o,p);return React__default.default.createElement("div",{key:i},React__default.default.createElement(antd.Button,{type:"primary"},a("Answer"),s),React__default.default.createElement(index$4.RenderAnswer,{i:o,isTextControl:y,dataFormatType:l}))})))};module.exports=DialogView;
1
+ "use strict";var index$5=require("../../LLMToolView/questionView/index.js"),index$4=require("../../LLMToolView/questionView/components/audioView/index.js"),index$2=require("../../LLMToolView/questionView/components/header/index.js"),index$3=require("../../LLMToolView/questionView/components/imgView/index.js"),index=require("../../../store/LLMMultiWheel/index.js"),index$1=require("../../../utils/index.js"),antd=require("antd"),React=require("react"),reactI18next=require("react-i18next");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 DialogView=e=>{const{id:t,answerList:r,question:d,index:u,name:c="",answerIsImg:m,questionIsImg:f,questionIsAudio:p,answerIsAudio:v,LLMConfig:w}=e,{t:a}=reactI18next.useTranslation(),{dataFormatType:i,selectedID:E,setSelectedID:g}=index(),n=u+1,y=c||`${a("Dialog")}${n}`,_=()=>m?React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(antd.Button,{type:"primary"},a("Answer")),React__default.default.createElement(index$3,{answerList:r})):v?React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(antd.Button,{type:"primary"},a("Answer")),React__default.default.createElement(index$4,{answerList:r})):r==null?void 0:r.map((x,l)=>{const o=l+1,s=__spreadProps(__spreadValues({},x),{order:o}),q=index$5.getTextControlByConfig(s,w);return React__default.default.createElement("div",{key:l},React__default.default.createElement(antd.Button,{type:"primary"},a("Answer"),o),React__default.default.createElement(index$5.RenderAnswer,{i:s,isTextControl:q,dataFormatType:i}))});return React__default.default.createElement("div",{key:t,onClick:()=>g(t),className:index$1.classnames({dialog:!0,selected:t===E})},React__default.default.createElement("div",{className:"header"},React__default.default.createElement("span",{className:"order"},n),React__default.default.createElement("div",{className:"name"},React__default.default.createElement("div",{className:"show-name"},y),React__default.default.createElement("div",{className:"tips"},"\uFF08",a("SelectionOfAnnotation"),"\uFF09"))),React__default.default.createElement("div",{className:"dialog-question"},React__default.default.createElement(antd.Button,{type:"primary"},a("Title"),n),React__default.default.createElement("div",null,React__default.default.createElement(index$2.RenderQuestion,{question:d,dataFormatType:i,isImg:f,isAudio:p}))),React__default.default.createElement("div",{className:"dialog-answer"},_()))};module.exports=DialogView;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),index$4=require("../../constant/index.js"),reducer=require("../../store/annotation/reducer.js"),ctx=require("../../store/ctx.js"),index$5=require("../../utils/index.js"),reactRedux=require("react-redux"),index=require("../../store/LLMMultiWheel/index.js"),index$1=require("../../views/MainView/LLMMultiWheelLayout/index.js"),index$2=require("../LLMToolView/questionView/components/header/index.js"),index$3=require("./dialogView/index.js"),index$7=require("../messageMaskLayer/index.js"),index$8=require("../../views/MainView/annotationTips/index.js"),reactI18next=require("react-i18next"),index$6=require("../LLMToolView/questionView/index.js"),antd=require("antd"),lbUtils=require("@labelbee/lb-utils");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const LLMMultiWheelSourceView=e=>{const{questionIsImg:t,answerIsImg:n,LLMConfig:o,dialogList:c,lang:s="cn"}=e,{dataFormatType:u,setDataFormatType:i}=index();return React.useEffect(()=>{var r;s&&((r=lbUtils.i18n)==null||r.changeLanguage(s))},[s]),React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement("div",{className:`${index$1.LLMMultiWheelViewCls}`},React__default.default.createElement("div",{style:{display:"flex",justifyContent:"flex-end",margin:"10px"}},React__default.default.createElement(index$2.ToggleDataFormatType,{dataFormatType:u,setDataFormatType:i})),React__default.default.createElement("div",{className:`${index$1.LLMMultiWheelViewCls}-container`},c==null?void 0:c.map((r,d)=>React__default.default.createElement(index$3,__spreadProps(__spreadValues({},r),{key:d,index:d,questionIsImg:t,answerIsImg:n,LLMConfig:o}))))))},getInfoFromLLMFile=({type:e,questionIndex:t,answerIndex:n,llmFile:o})=>{if(e==="question")return o==null?void 0:o.find((s,u)=>t===u);let c=null;return o==null||o.forEach((s,u)=>{var i;(i=s.answerList)==null||i.forEach((r,d)=>{u===t&&n===d&&(c=r)})}),c},LLMMultiWheelView=e=>{var t,n;const{annotation:o,tips:c,showTips:s,drawLayerSlot:u}=e,{imgIndex:i,imgList:r,stepList:d,step:x,toolInstance:p}=o,[w,T]=React.useState(),{setSelectedID:D,newAnswerListMap:y}=index(),[O,q]=React.useState([]),m=((t=w==null?void 0:w.dataType)==null?void 0:t.prompt)===index$4.ELLMDataType.Picture,M=((n=w==null?void 0:w.dataType)==null?void 0:n.response)===index$4.ELLMDataType.Picture,{t:S}=reactI18next.useTranslation(),[,$]=React.useState(0);return React.useEffect(()=>{var a,v,f;if(!r[i])return;const _=(a=r[i])!=null?a:{},L=(f=(v=_==null?void 0:_.questionList)==null?void 0:v.textList)!=null?f:[];q(L),(L==null?void 0:L.length)&&D(L[0].id)},[i]),React.useEffect(()=>{var a,v;const f=(a=r[i])!=null?a:{},_=f==null?void 0:f.questionList,L=(v=f==null?void 0:f.llmFile)==null?void 0:v.textList,E=_==null?void 0:_.textList,C=E==null?void 0:E.map((l,j)=>{var P;return __spreadProps(__spreadValues({},l),{question:m&&getInfoFromLLMFile({type:"question",questionIndex:j,llmFile:L})||(l==null?void 0:l.question),answerList:(P=l==null?void 0:l.answerList)==null?void 0:P.map((g,b)=>{var h,I,V;const W=`${(h=l==null?void 0:l.id)!=null?h:""}-${(I=g==null?void 0:g.id)!=null?I:""}`,A=M?getInfoFromLLMFile({type:"answer",questionIndex:j,answerIndex:b,llmFile:L})||{}:{};return __spreadValues(__spreadProps(__spreadValues({},g),{answer:g.answer,newAnswer:(V=y[W])!=null?V:g.answer,order:b+1}),A)})})});q(C)},[y,m,M]),React.useEffect(()=>{var a;if(d&&x){const v=(a=reducer.getStepConfig(d,x))==null?void 0:a.config;T(index$5.jsonParser(v))}},[d,x]),React.useEffect(()=>{if(p)return p.on("validUpdated",()=>{$(a=>a+1)}),()=>{p.unbindAll("validUpdated")}},[p]),React__default.default.createElement(antd.Layout,{className:index$6.LLMViewCls},!(p==null?void 0:p.valid)&&React__default.default.createElement(index$7,{message:S("InvalidQuestionAndSkip")}),u==null?void 0:u({}),s===!0&&React__default.default.createElement(index$8,{tips:c}),React__default.default.createElement(LLMMultiWheelSourceView,{questionIsImg:m,answerIsImg:M,LLMConfig:w,dialogList:O}))},mapStateToProps=e=>({annotation:e.annotation});var LLMMultiWheelView$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(LLMMultiWheelView);exports.LLMMultiWheelSourceView=LLMMultiWheelSourceView,exports.default=LLMMultiWheelView$1;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),index$4=require("../../constant/index.js"),reducer=require("../../store/annotation/reducer.js"),ctx=require("../../store/ctx.js"),index$5=require("../../utils/index.js"),reactRedux=require("react-redux"),index=require("../../store/LLMMultiWheel/index.js"),index$1=require("../../views/MainView/LLMMultiWheelLayout/index.js"),index$2=require("../LLMToolView/questionView/components/header/index.js"),index$3=require("./dialogView/index.js"),index$7=require("../messageMaskLayer/index.js"),index$8=require("../../views/MainView/annotationTips/index.js"),reactI18next=require("react-i18next"),index$6=require("../LLMToolView/questionView/index.js"),antd=require("antd"),lbUtils=require("@labelbee/lb-utils");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const LLMMultiWheelSourceView=e=>{const{questionIsImg:t,answerIsImg:n,questionIsAudio:o,answerIsAudio:c,LLMConfig:L,dialogList:u,lang:d="cn"}=e,{dataFormatType:w,setDataFormatType:r}=index();return React.useEffect(()=>{var a;d&&((a=lbUtils.i18n)==null||a.changeLanguage(d))},[d]),React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement("div",{className:`${index$1.LLMMultiWheelViewCls}`},React__default.default.createElement("div",{style:{display:"flex",justifyContent:"flex-end",margin:"10px"}},React__default.default.createElement(index$2.ToggleDataFormatType,{dataFormatType:w,setDataFormatType:r})),React__default.default.createElement("div",{className:`${index$1.LLMMultiWheelViewCls}-container`},u==null?void 0:u.map((a,_)=>React__default.default.createElement(index$3,__spreadProps(__spreadValues({},a),{key:_,index:_,questionIsImg:t,answerIsImg:n,questionIsAudio:o,answerIsAudio:c,LLMConfig:L}))))))},getInfoFromLLMFile=({type:e,questionIndex:t,answerIndex:n,llmFile:o})=>{if(e==="question")return o==null?void 0:o.find((L,u)=>t===u);let c=null;return o==null||o.forEach((L,u)=>{var d;(d=L.answerList)==null||d.forEach((w,r)=>{u===t&&n===r&&(c=w)})}),c},LLMMultiWheelView=e=>{var t,n,o,c;const{annotation:L,tips:u,showTips:d,drawLayerSlot:w}=e,{imgIndex:r,imgList:a,stepList:_,step:m,toolInstance:g}=L,[l,$]=React.useState(),{setSelectedID:A,newAnswerListMap:I}=index(),[C,P]=React.useState([]),y=((t=l==null?void 0:l.dataType)==null?void 0:t.prompt)===index$4.ELLMDataType.Picture,q=((n=l==null?void 0:l.dataType)==null?void 0:n.response)===index$4.ELLMDataType.Picture,E=((o=l==null?void 0:l.dataType)==null?void 0:o.prompt)===index$4.ELLMDataType.Audio,j=((c=l==null?void 0:l.dataType)==null?void 0:c.response)===index$4.ELLMDataType.Audio,{t:W}=reactI18next.useTranslation(),[,F]=React.useState(0);return React.useEffect(()=>{var i,v,p;if(!a[r])return;const x=(i=a[r])!=null?i:{},f=(p=(v=x==null?void 0:x.questionList)==null?void 0:v.textList)!=null?p:[];P(f),(f==null?void 0:f.length)&&A(f[0].id)},[r]),React.useEffect(()=>{var i,v;if(!a[r])return;const p=(i=a[r])!=null?i:{},x=p==null?void 0:p.questionList,f=(v=p==null?void 0:p.llmFile)==null?void 0:v.textList,T=x==null?void 0:x.textList,N=T==null?void 0:T.map((s,b)=>{var h;return __spreadProps(__spreadValues({},s),{question:(y||E)&&getInfoFromLLMFile({type:"question",questionIndex:b,llmFile:f})||(s==null?void 0:s.question),answerList:(h=s==null?void 0:s.answerList)==null?void 0:h.map((M,D)=>{var V,O,S;const R=`${(V=s==null?void 0:s.id)!=null?V:""}-${(O=M==null?void 0:M.id)!=null?O:""}`,U=q||j?getInfoFromLLMFile({type:"answer",questionIndex:b,answerIndex:D,llmFile:f})||{}:{};return __spreadValues(__spreadProps(__spreadValues({},M),{answer:M.answer,newAnswer:(S=I[R])!=null?S:M.answer,order:D+1}),U)})})});P(N)},[I,y,E,q,j,a,r]),React.useEffect(()=>{var i;if(_&&m){const v=(i=reducer.getStepConfig(_,m))==null?void 0:i.config;$(index$5.jsonParser(v))}},[_,m]),React.useEffect(()=>{if(g)return g.on("validUpdated",()=>{F(i=>i+1)}),()=>{g.unbindAll("validUpdated")}},[g]),React__default.default.createElement(antd.Layout,{className:index$6.LLMViewCls},!(g==null?void 0:g.valid)&&React__default.default.createElement(index$7,{message:W("InvalidQuestionAndSkip")}),w==null?void 0:w({}),d===!0&&React__default.default.createElement(index$8,{tips:u}),React__default.default.createElement(LLMMultiWheelSourceView,{questionIsImg:y,answerIsImg:q,questionIsAudio:E,answerIsAudio:j,LLMConfig:l,dialogList:C}))},mapStateToProps=e=>({annotation:e.annotation});var LLMMultiWheelView$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(LLMMultiWheelView);exports.LLMMultiWheelSourceView=LLMMultiWheelSourceView,exports.default=LLMMultiWheelView$1;
@@ -1 +1 @@
1
- "use strict";var React=require("react"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),antd=require("antd"),index=require("../../constant/index.js"),es=require("antd/es"),index$4=require("./questionView/index.js"),reactI18next=require("react-i18next"),index$3=require("../../views/MainView/annotationTips/index.js"),data=require("./utils/data.js"),reducer=require("../../store/annotation/reducer.js"),index$1=require("../../utils/index.js"),index$2=require("../messageMaskLayer/index.js");function _interopDefaultLegacy(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var React__default=_interopDefaultLegacy(React);const LLMViewCls=`${index.prefix}-LLMView`,LLMToolView=n=>{var p;const{annotation:x,checkMode:m=!0,tips:T,showTips:y,drawLayerSlot:q}=n,{imgIndex:i,imgList:r,stepList:L,step:u,toolInstance:o}=x,{hoverKey:I,modelAPIResponse:_,setModelAPIResponse:g,newAnswerList:d}=React.useContext(ctx.LLMContext),[j,R]=React.useState([]),[C,S]=React.useState(""),[t,A]=React.useState(),{t:w}=reactI18next.useTranslation(),[,D]=React.useState(0);return React.useEffect(()=>{let e;if(!m)return e=setInterval(()=>{antd.message.info(w("EfficientListening"))},1e3*60),()=>{e&&clearInterval(e)}},[]),React.useEffect(()=>{if(o)return o.on("validUpdated",()=>{D(e=>e+1)}),()=>{o.unbindAll("validUpdated")}},[o]),React.useEffect(()=>{var e,s,a,l,M,E;if(!r[i])return;const P=((e=t==null?void 0:t.dataType)==null?void 0:e.prompt)===index.ELLMDataType.Picture,$=((s=t==null?void 0:t.dataType)==null?void 0:s.response)===index.ELLMDataType.Picture,c=(a=r[i])==null?void 0:a.questionList,v=(l=r[i])==null?void 0:l.llmFile,V=P?v==null?void 0:v.question:c==null?void 0:c.question;S(V);let f=(c==null?void 0:c.answerList)||[];$&&(f=(v==null?void 0:v.answerList)||[]),((M=t==null?void 0:t.dataType)==null?void 0:M.response)===index.ELLMDataType.None&&(f=[]),((E=t==null?void 0:t.dataType)==null?void 0:E.response)===index.ELLMDataType.Text&&(d==null?void 0:d.length)>0&&(f=d),R(f)},[i,d,t,(p=r[i])==null?void 0:p.id]),React.useEffect(()=>{var e;if(!r[i])return;const s=(e=r[i])!=null?e:{},a=data.getCurrentResultFromResultList(s==null?void 0:s.result,u),l=(a==null?void 0:a.length)>0?a[0]:a;g((l==null?void 0:l.modelAPIResponse)||[])},[i]),React.useEffect(()=>{var e;if(L&&u){const s=(e=reducer.getStepConfig(L,u))==null?void 0:e.config;A(index$1.jsonParser(s))}},[L,u]),React__default.default.createElement(es.Layout,{className:LLMViewCls},!(o==null?void 0:o.valid)&&React__default.default.createElement(index$2,{message:w("InvalidQuestionAndSkip")}),q==null?void 0:q({}),React__default.default.createElement("div",{className:`${LLMViewCls}-question`},y===!0&&React__default.default.createElement(index$3,{tips:T}),React__default.default.createElement(index$4.default,{hoverKey:I,question:C,answerList:j,modelAPIResponse:_,setModelAPIResponse:g,checkMode:m,annotation:x,LLMConfig:t})))},mapStateToProps=n=>({annotation:n.annotation});var LLMToolView$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(LLMToolView);module.exports=LLMToolView$1;
1
+ "use strict";var React=require("react"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),antd=require("antd"),index=require("../../constant/index.js"),es=require("antd/es"),index$4=require("./questionView/index.js"),reactI18next=require("react-i18next"),index$3=require("../../views/MainView/annotationTips/index.js"),data=require("./utils/data.js"),reducer=require("../../store/annotation/reducer.js"),index$1=require("../../utils/index.js"),index$2=require("../messageMaskLayer/index.js");function _interopDefaultLegacy(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var React__default=_interopDefaultLegacy(React);const LLMViewCls=`${index.prefix}-LLMView`,LLMToolView=n=>{var p;const{annotation:x,checkMode:m=!0,tips:I,showTips:_,drawLayerSlot:q}=n,{imgIndex:i,imgList:o,stepList:L,step:u,toolInstance:r}=x,{hoverKey:A,modelAPIResponse:j,setModelAPIResponse:g,newAnswerList:d}=React.useContext(ctx.LLMContext),[R,C]=React.useState([]),[D,S]=React.useState(""),[e,P]=React.useState(),{t:T}=reactI18next.useTranslation(),[,$]=React.useState(0);return React.useEffect(()=>{let t;if(!m)return t=setInterval(()=>{antd.message.info(T("EfficientListening"))},1e3*60),()=>{t&&clearInterval(t)}},[]),React.useEffect(()=>{if(r)return r.on("validUpdated",()=>{$(t=>t+1)}),()=>{r.unbindAll("validUpdated")}},[r]),React.useEffect(()=>{var t,a,s,l,y,M,w,E;if(!o[i])return;const h=((t=e==null?void 0:e.dataType)==null?void 0:t.prompt)===index.ELLMDataType.Picture,V=((a=e==null?void 0:e.dataType)==null?void 0:a.prompt)===index.ELLMDataType.Audio,b=((s=e==null?void 0:e.dataType)==null?void 0:s.response)===index.ELLMDataType.Picture,k=((l=e==null?void 0:e.dataType)==null?void 0:l.response)===index.ELLMDataType.Audio,c=(y=o[i])==null?void 0:y.questionList,v=(M=o[i])==null?void 0:M.llmFile,F=h||V?v==null?void 0:v.question:c==null?void 0:c.question;S(F);let f=(c==null?void 0:c.answerList)||[];(b||k)&&(f=(v==null?void 0:v.answerList)||[]),((w=e==null?void 0:e.dataType)==null?void 0:w.response)===index.ELLMDataType.None&&(f=[]),((E=e==null?void 0:e.dataType)==null?void 0:E.response)===index.ELLMDataType.Text&&(d==null?void 0:d.length)>0&&(f=d),C(f)},[i,d,e,(p=o[i])==null?void 0:p.id]),React.useEffect(()=>{var t;if(!o[i])return;const a=(t=o[i])!=null?t:{},s=data.getCurrentResultFromResultList(a==null?void 0:a.result,u),l=(s==null?void 0:s.length)>0?s[0]:s;g((l==null?void 0:l.modelAPIResponse)||[])},[i]),React.useEffect(()=>{var t;if(L&&u){const a=(t=reducer.getStepConfig(L,u))==null?void 0:t.config;P(index$1.jsonParser(a))}},[L,u]),React__default.default.createElement(es.Layout,{className:LLMViewCls},!(r==null?void 0:r.valid)&&React__default.default.createElement(index$2,{message:T("InvalidQuestionAndSkip")}),q==null?void 0:q({}),React__default.default.createElement("div",{className:`${LLMViewCls}-question`},_===!0&&React__default.default.createElement(index$3,{tips:I}),React__default.default.createElement(index$4.default,{hoverKey:A,question:D,answerList:R,modelAPIResponse:j,setModelAPIResponse:g,checkMode:m,annotation:x,LLMConfig:e})))},mapStateToProps=n=>({annotation:n.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("../../../../../constant/index.js"),classNames=require("classnames");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames);const LLMViewCls=`${index.prefix}-LLMView`,AudioPlayer=React__default.default.memo(({url:e})=>React__default.default.createElement("audio",{controls:!0},React__default.default.createElement("source",{src:e,type:"audio/mpeg"}))),AudioView=e=>{const{answerList:a,hoverKey:l}=e;return React__default.default.createElement("div",null,(a==null?void 0:a.length)>0&&a.map((t,r)=>React__default.default.createElement("div",{key:r,className:classNames__default.default({[`${LLMViewCls}__content`]:!0,[`${LLMViewCls}__contentActive`]:l===(t==null?void 0:t.order)})},React__default.default.createElement(antd.Tag,{className:`${LLMViewCls}-tag`},t==null?void 0:t.order),React__default.default.createElement("div",null,React__default.default.createElement(AudioPlayer,{key:t==null?void 0:t.url,url:t==null?void 0:t.url})))))};module.exports=AudioView;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactI18next=require("react-i18next"),reResizable=require("re-resizable"),antd=require("antd"),index=require("../../../../../constant/index.js"),icons=require("@ant-design/icons"),index$1=require("../../../../markdownView/index.js"),_=require("lodash"),lbUtils=require("@labelbee/lb-utils"),imgFail_cn=require("../../../../../assets/annotation/LLMTool/imgFail_cn.svg.js"),imgFail_en=require("../../../../../assets/annotation/LLMTool/imgFail_en.svg.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const LLMViewCls=`${index.prefix}-LLMView`,RenderQuestion=({question:e,dataFormatType:r,isImg:t})=>{const a=_.isString(e)?e:"",l=lbUtils.i18n.language==="en"?imgFail_en:imgFail_cn;if(t){const n=_.isObject(e)?e==null?void 0:e.url:"";return React__default.default.createElement(antd.Image,{src:n||l,fallback:l})}return React__default.default.createElement("div",{style:{whiteSpace:"pre-wrap"}},r===index.EDataFormatType.Markdown?React__default.default.createElement(index$1,{value:a}):a)},Header=e=>{const{question:r,dataFormatType:t,setDataFormatType:a,isImg:l}=e,n=300,{t:i}=reactI18next.useTranslation();return React__default.default.createElement(reResizable.Resizable,{defaultSize:{width:"100%",height:n},minHeight:n,enable:{bottom:!0},style:{padding:"26px 32px",borderBottom:"1px solid #EBEBEB",overflow:"hidden"}},React__default.default.createElement("div",{className:`${LLMViewCls}__title`,style:{display:"flex",justifyContent:"space-between"}},i("Title"),React__default.default.createElement(ToggleDataFormatType,{dataFormatType:t,setDataFormatType:a})),React__default.default.createElement("div",{className:`${LLMViewCls}__headerContent`},React__default.default.createElement(RenderQuestion,{question:r,dataFormatType:t,isImg:l})))},ToggleDataFormatType=e=>{const{dataFormatType:r,setDataFormatType:t}=e;return React__default.default.createElement("span",{style:{display:"flex"}},React__default.default.createElement(antd.Radio.Group,{value:r,onChange:a=>{t(a.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"}}))};exports.RenderQuestion=RenderQuestion,exports.ToggleDataFormatType=ToggleDataFormatType,exports.default=Header;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactI18next=require("react-i18next"),reResizable=require("re-resizable"),antd=require("antd"),index=require("../../../../../constant/index.js"),icons=require("@ant-design/icons"),index$1=require("../../../../markdownView/index.js"),_=require("lodash"),lbUtils=require("@labelbee/lb-utils"),imgFail_cn=require("../../../../../assets/annotation/LLMTool/imgFail_cn.svg.js"),imgFail_en=require("../../../../../assets/annotation/LLMTool/imgFail_en.svg.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const LLMViewCls=`${index.prefix}-LLMView`,RenderQuestion=({question:e,dataFormatType:r,isImg:a,isAudio:l})=>{const n=_.isString(e)?e:"",i=lbUtils.i18n.language==="en"?imgFail_en:imgFail_cn;if(a){const t=_.isObject(e)?e==null?void 0:e.url:"";return React__default.default.createElement(antd.Image,{src:t||i,fallback:i})}if(l){const t=_.isObject(e)?e==null?void 0:e.url:"";return t?React__default.default.createElement("audio",{controls:!0},React__default.default.createElement("source",{src:t,type:"audio/mpeg"})):React__default.default.createElement(antd.Empty,{image:antd.Empty.PRESENTED_IMAGE_SIMPLE})}return React__default.default.createElement("div",{style:{whiteSpace:"pre-wrap"}},r===index.EDataFormatType.Markdown?React__default.default.createElement(index$1,{value:n}):n)},Header=e=>{const{question:r,dataFormatType:a,setDataFormatType:l,isImg:n,isAudio:i}=e,t=300,{t:o}=reactI18next.useTranslation();return React__default.default.createElement(reResizable.Resizable,{defaultSize:{width:"100%",height:t},minHeight:t,enable:{bottom:!0},style:{padding:"26px 32px",borderBottom:"1px solid #EBEBEB",overflow:"hidden"}},React__default.default.createElement("div",{className:`${LLMViewCls}__title`,style:{display:"flex",justifyContent:"space-between"}},o("Title"),React__default.default.createElement(ToggleDataFormatType,{dataFormatType:a,setDataFormatType:l})),React__default.default.createElement("div",{className:`${LLMViewCls}__headerContent`},React__default.default.createElement(RenderQuestion,{question:r,dataFormatType:a,isImg:n,isAudio:i})))},ToggleDataFormatType=e=>{const{dataFormatType:r,setDataFormatType:a}=e;return React__default.default.createElement("span",{style:{display:"flex"}},React__default.default.createElement(antd.Radio.Group,{value:r,onChange:l=>{a(l.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"}}))};exports.RenderQuestion=RenderQuestion,exports.ToggleDataFormatType=ToggleDataFormatType,exports.default=Header;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),antd=require("antd"),index=require("../../../constant/index.js"),classNames=require("classnames"),reactI18next=require("react-i18next"),lbUtils=require("@labelbee/lb-utils"),index$4=require("../../markdownView/index.js"),index$1=require("../modelAPIView/index.js"),index$5=require("../../diffMatchPatchComponent/index.js"),index$2=require("./components/header/index.js"),index$3=require("./components/imgView/index.js"),_=require("lodash");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.prefix}-LLMView`,RenderAnswer=({i:e,dataFormatType:t,isTextControl:r})=>{var n;return t===index.EDataFormatType.Markdown?React__default.default.createElement(index$4,{value:(n=e==null?void 0:e.newAnswer)!=null?n:e==null?void 0:e.answer}):r?React__default.default.createElement("div",{style:{width:"100%",overflowWrap:"break-word"}},React__default.default.createElement(index$5,{originString:e==null?void 0:e.answer,currentString:e==null?void 0:e.newAnswer})):React__default.default.createElement("div",{style:{whiteSpace:"pre-wrap",overflowWrap:"break-word"}},(e==null?void 0:e.newAnswer)||(e==null?void 0:e.answer))},getTextControlByConfig=(e,t)=>{var r;return(t==null?void 0:t.isTextEdit)?!!((r=((t==null?void 0:t.textEdit)||[]).filter(l=>(l==null?void 0:l.title)===e.order)[0])==null?void 0:r.textControl):!1},QuestionView=e=>{var t,r;const{hoverKey:n,answerList:l,question:s,lang:d,modelAPIResponse:u,setModelAPIResponse:c,checkMode:v=!0,LLMConfig:o,answerHeaderSlot:f}=e,[i,m]=React.useState(index.EDataFormatType.Default),p=((t=o==null?void 0:o.dataType)==null?void 0:t.prompt)===index.ELLMDataType.Picture,w=((r=o==null?void 0:o.dataType)==null?void 0:r.response)===index.ELLMDataType.Picture,{t:x}=reactI18next.useTranslation();React.useEffect(()=>{var a;d&&((a=lbUtils.i18n)==null||a.changeLanguage(d))},[]);const E=React__default.default.createElement("div",null,l.map((a,y)=>{const g=getTextControlByConfig(a,o);return React__default.default.createElement("div",{className:classNames__default.default({[`${LLMViewCls}__content`]:!0,[`${LLMViewCls}__contentActive`]:n===(a==null?void 0:a.order)}),key:y},React__default.default.createElement(antd.Tag,{className:`${LLMViewCls}-tag`},a==null?void 0:a.order),React__default.default.createElement(RenderAnswer,{i:a,isTextControl:g,dataFormatType:i}))}),_.isString(s)&&React__default.default.createElement(index$1,{dataFormatType:i,modelAPIResponse:u,question:s,setModelAPIResponse:c,checkMode:v,annotation:e.annotation}));return React__default.default.createElement("div",{className:LLMViewCls},React__default.default.createElement(index$2.default,{question:s,dataFormatType:i,setDataFormatType:m,isImg:p}),React__default.default.createElement("div",{className:`${LLMViewCls}__textBox`},React__default.default.createElement("div",{className:`${LLMViewCls}__title`},x("Answer")," ",f),w?React__default.default.createElement(index$3,{hoverKey:n,answerList:l}):E))},WrapQuestionView=e=>React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(QuestionView,__spreadValues({},e)));exports.LLMViewCls=LLMViewCls,exports.RenderAnswer=RenderAnswer,exports.default=WrapQuestionView,exports.getTextControlByConfig=getTextControlByConfig;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),antd=require("antd"),index=require("../../../constant/index.js"),classNames=require("classnames"),reactI18next=require("react-i18next"),lbUtils=require("@labelbee/lb-utils"),index$3=require("../../markdownView/index.js"),index$1=require("../modelAPIView/index.js"),index$4=require("../../diffMatchPatchComponent/index.js"),index$2=require("./components/header/index.js"),index$6=require("./components/imgView/index.js"),_=require("lodash"),index$5=require("./components/audioView/index.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,__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.prefix}-LLMView`,RenderAnswer=({i:e,dataFormatType:t,isTextControl:r})=>{var l;return t===index.EDataFormatType.Markdown?React__default.default.createElement(index$3,{value:(l=e==null?void 0:e.newAnswer)!=null?l:e==null?void 0:e.answer}):r?React__default.default.createElement("div",{style:{width:"100%",overflowWrap:"break-word"}},React__default.default.createElement(index$4,{originString:e==null?void 0:e.answer,currentString:e==null?void 0:e.newAnswer})):React__default.default.createElement("div",{style:{whiteSpace:"pre-wrap",overflowWrap:"break-word"}},(e==null?void 0:e.newAnswer)||(e==null?void 0:e.answer))},getTextControlByConfig=(e,t)=>{var r;return(t==null?void 0:t.isTextEdit)?!!((r=((t==null?void 0:t.textEdit)||[]).filter(o=>(o==null?void 0:o.title)===e.order)[0])==null?void 0:r.textControl):!1},QuestionView=e=>{var t,r,l,o;const{hoverKey:i,answerList:s,question:d,lang:c,modelAPIResponse:v,setModelAPIResponse:f,checkMode:p=!0,LLMConfig:a,answerHeaderSlot:m}=e,[u,w]=React.useState(index.EDataFormatType.Default),x=((t=a==null?void 0:a.dataType)==null?void 0:t.prompt)===index.ELLMDataType.Picture,E=((r=a==null?void 0:a.dataType)==null?void 0:r.response)===index.ELLMDataType.Picture,y=((l=a==null?void 0:a.dataType)==null?void 0:l.prompt)===index.ELLMDataType.Audio,g=((o=a==null?void 0:a.dataType)==null?void 0:o.response)===index.ELLMDataType.Audio,{t:T}=reactI18next.useTranslation();React.useEffect(()=>{var n;c&&((n=lbUtils.i18n)==null||n.changeLanguage(c))},[]);const q=React__default.default.createElement("div",null,s.map((n,P)=>{const I=getTextControlByConfig(n,a);return React__default.default.createElement("div",{className:classNames__default.default({[`${LLMViewCls}__content`]:!0,[`${LLMViewCls}__contentActive`]:i===(n==null?void 0:n.order)}),key:P},React__default.default.createElement(antd.Tag,{className:`${LLMViewCls}-tag`},n==null?void 0:n.order),React__default.default.createElement(RenderAnswer,{i:n,isTextControl:I,dataFormatType:u}))}),_.isString(d)&&React__default.default.createElement(index$1,{dataFormatType:u,modelAPIResponse:v,question:d,setModelAPIResponse:f,checkMode:p,annotation:e.annotation})),A=()=>g?React__default.default.createElement(index$5,{hoverKey:i,answerList:s}):E?React__default.default.createElement(index$6,{hoverKey:i,answerList:s}):q;return React__default.default.createElement("div",{className:LLMViewCls},React__default.default.createElement(index$2.default,{question:d,dataFormatType:u,setDataFormatType:w,isImg:x,isAudio:y}),React__default.default.createElement("div",{className:`${LLMViewCls}__textBox`},React__default.default.createElement("div",{className:`${LLMViewCls}__title`},T("Answer")," ",m),A()))},WrapQuestionView=e=>React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(QuestionView,__spreadValues({},e)));exports.LLMViewCls=LLMViewCls,exports.RenderAnswer=RenderAnswer,exports.default=WrapQuestionView,exports.getTextControlByConfig=getTextControlByConfig;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EStepType=void 0,function(o){o[o.Check=0]="Check",o[o.ANNOTATION=1]="ANNOTATION",o[o.QUALITY_INSPECTION=2]="QUALITY_INSPECTION",o[o.PRE_ANNOTATION=3]="PRE_ANNOTATION",o[o.MANUAL_CORRECTION=4]="MANUAL_CORRECTION"}(exports.EStepType||(exports.EStepType={})),exports.ESubmitType=void 0,function(o){o[o.Backward=1]="Backward",o[o.Forward=2]="Forward",o[o.Jump=3]="Jump",o[o.Quit=4]="Quit",o[o.Export=5]="Export",o[o.StepChanged=6]="StepChanged",o[o.Save=7]="Save",o[o.BatchUpdateTrackID=8]="BatchUpdateTrackID",o[o.BatchUpdateImgList=9]="BatchUpdateImgList",o[o.SyncImgList=10001]="SyncImgList",o[o.SyncCurrentPageData=10002]="SyncCurrentPageData"}(exports.ESubmitType||(exports.ESubmitType={}));const prefix="bee",componentCls=`${prefix}-component`;exports.EDataFormatType=void 0,function(o){o.Default="default",o.Markdown="markdown"}(exports.EDataFormatType||(exports.EDataFormatType={})),exports.ELLMDataType=void 0,function(o){o.Picture="picture",o.Text="text",o.None="none"}(exports.ELLMDataType||(exports.ELLMDataType={})),exports.componentCls=componentCls,exports.prefix=prefix;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EStepType=void 0,function(o){o[o.Check=0]="Check",o[o.ANNOTATION=1]="ANNOTATION",o[o.QUALITY_INSPECTION=2]="QUALITY_INSPECTION",o[o.PRE_ANNOTATION=3]="PRE_ANNOTATION",o[o.MANUAL_CORRECTION=4]="MANUAL_CORRECTION"}(exports.EStepType||(exports.EStepType={})),exports.ESubmitType=void 0,function(o){o[o.Backward=1]="Backward",o[o.Forward=2]="Forward",o[o.Jump=3]="Jump",o[o.Quit=4]="Quit",o[o.Export=5]="Export",o[o.StepChanged=6]="StepChanged",o[o.Save=7]="Save",o[o.BatchUpdateTrackID=8]="BatchUpdateTrackID",o[o.BatchUpdateImgList=9]="BatchUpdateImgList",o[o.SyncImgList=10001]="SyncImgList",o[o.SyncCurrentPageData=10002]="SyncCurrentPageData"}(exports.ESubmitType||(exports.ESubmitType={}));const prefix="bee",componentCls=`${prefix}-component`;exports.EDataFormatType=void 0,function(o){o.Default="default",o.Markdown="markdown"}(exports.EDataFormatType||(exports.EDataFormatType={})),exports.ELLMDataType=void 0,function(o){o.Picture="picture",o.Text="text",o.None="none",o.Audio="audio"}(exports.ELLMDataType||(exports.ELLMDataType={})),exports.componentCls=componentCls,exports.prefix=prefix;
@@ -10,6 +10,8 @@ interface IDialogViewProps {
10
10
  answerIsImg: boolean;
11
11
  questionIsImg: boolean;
12
12
  LLMConfig?: ILLMMultiWheelToolConfig;
13
+ answerIsAudio?: boolean;
14
+ questionIsAudio?: boolean;
13
15
  }
14
16
  declare const DialogView: (props: IDialogViewProps) => React.JSX.Element;
15
17
  export default DialogView;
@@ -13,6 +13,8 @@ interface ILLMMultiWheelSourceViewProps {
13
13
  LLMConfig?: ILLMMultiWheelToolConfig;
14
14
  dialogList: any[];
15
15
  lang?: string;
16
+ questionIsAudio?: boolean;
17
+ answerIsAudio?: boolean;
16
18
  }
17
19
  export declare const LLMMultiWheelSourceView: React.FC<ILLMMultiWheelSourceViewProps>;
18
20
  declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { IAnswerList } from '@/components/LLMToolView/types';
3
+ interface IProps {
4
+ hoverKey?: number;
5
+ answerList: IAnswerList[];
6
+ }
7
+ declare const AudioView: (props: IProps) => React.JSX.Element;
8
+ export default AudioView;
@@ -11,8 +11,9 @@ interface IProps {
11
11
  dataFormatType: EDataFormatType;
12
12
  setDataFormatType: (v: EDataFormatType) => void;
13
13
  isImg?: boolean;
14
+ isAudio?: boolean;
14
15
  }
15
- export declare const RenderQuestion: ({ question, dataFormatType, isImg, }: {
16
+ export declare const RenderQuestion: ({ question, dataFormatType, isImg, isAudio, }: {
16
17
  question: string | {
17
18
  id: number;
18
19
  path: string;
@@ -22,6 +23,7 @@ export declare const RenderQuestion: ({ question, dataFormatType, isImg, }: {
22
23
  };
23
24
  dataFormatType: EDataFormatType;
24
25
  isImg?: boolean | undefined;
26
+ isAudio?: boolean | undefined;
25
27
  }) => React.JSX.Element;
26
28
  declare const Header: (props: IProps) => React.JSX.Element;
27
29
  export declare const ToggleDataFormatType: (props: {
@@ -1,2 +1 @@
1
- /// <reference types="lodash" />
2
1
  export declare const useUpdateRectList: (fn: () => void) => import("lodash").DebouncedFunc<() => void>;
@@ -1,9 +1,8 @@
1
- /// <reference types="lodash" />
2
1
  import { IAnnotationStateProps } from '@/store/annotation/map';
3
2
  /**
4
3
  * PointCloud Rotate Hook
5
4
  * @returns
6
5
  */
7
6
  export declare const useRotate: ({ currentData }: IAnnotationStateProps) => {
8
- updateRotate: import("lodash").DebouncedFunc<(angle: number) => void>;
7
+ updateRotate: import("lodash").DebouncedFuncLeading<(angle: number) => void>;
9
8
  };
@@ -1,9 +1,8 @@
1
- /// <reference types="lodash" />
2
1
  import { IAnnotationStateProps } from '@/store/annotation/map';
3
2
  /**
4
3
  * PointCloud Rotate Hook
5
4
  * @returns
6
5
  */
7
6
  export declare const useRotateEdge: ({ currentData }: IAnnotationStateProps) => {
8
- updateRotateEdge: import("lodash").DebouncedFunc<(angle: number) => void>;
7
+ updateRotateEdge: import("lodash").DebouncedFuncLeading<(angle: number) => void>;
9
8
  };
@@ -27,5 +27,6 @@ export declare enum EDataFormatType {
27
27
  export declare enum ELLMDataType {
28
28
  Picture = "picture",
29
29
  Text = "text",
30
- None = "none"
30
+ None = "none",
31
+ Audio = "audio"
31
32
  }
@@ -1 +1 @@
1
- import{getTextControlByConfig as I,RenderAnswer as N}from"../../LLMToolView/questionView/index.js";import{RenderQuestion as V}from"../../LLMToolView/questionView/components/header/index.js";import j from"../../LLMToolView/questionView/components/imgView/index.js";import x from"../../../store/LLMMultiWheel/index.js";import{classnames as h}from"../../../utils/index.js";import{Button as s}from"antd";import e from"react";import{useTranslation as M}from"react-i18next";var T=Object.defineProperty,q=Object.defineProperties,D=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,d=(o,t,r)=>t in o?T(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,S=(o,t)=>{for(var r in t||(t={}))F.call(t,r)&&d(o,r,t[r]);if(p)for(var r of p(t))C.call(t,r)&&d(o,r,t[r]);return o},b=(o,t)=>q(o,D(t));const A=o=>{const{id:t,answerList:r,question:u,index:f,name:w="",answerIsImg:v,questionIsImg:_,LLMConfig:g}=o,{t:n}=M(),{dataFormatType:i,selectedID:E,setSelectedID:y}=x(),a=f+1,L=w||`${n("Dialog")}${a}`;return e.createElement("div",{key:t,onClick:()=>y(t),className:h({dialog:!0,selected:t===E})},e.createElement("div",{className:"header"},e.createElement("span",{className:"order"},a),e.createElement("div",{className:"name"},e.createElement("div",{className:"show-name"},L),e.createElement("div",{className:"tips"},"\uFF08",n("SelectionOfAnnotation"),"\uFF09"))),e.createElement("div",{className:"dialog-question"},e.createElement(s,{type:"primary"},n("Title"),a),e.createElement("div",null,e.createElement(V,{question:u,dataFormatType:i,isImg:_}))),e.createElement("div",{className:"dialog-answer"},v?e.createElement(e.Fragment,null,e.createElement(s,{type:"primary"},n("Answer")),e.createElement(j,{answerList:r})):r==null?void 0:r.map((O,l)=>{const m=l+1,c=b(S({},O),{order:m}),P=I(c,g);return e.createElement("div",{key:l},e.createElement(s,{type:"primary"},n("Answer"),m),e.createElement(N,{i:c,isTextControl:P,dataFormatType:i}))})))};export{A as default};
1
+ import{getTextControlByConfig as x,RenderAnswer as A}from"../../LLMToolView/questionView/index.js";import N from"../../LLMToolView/questionView/components/audioView/index.js";import{RenderQuestion as M}from"../../LLMToolView/questionView/components/header/index.js";import T from"../../LLMToolView/questionView/components/imgView/index.js";import h from"../../../store/LLMMultiWheel/index.js";import{classnames as q}from"../../../utils/index.js";import{Button as a}from"antd";import e from"react";import{useTranslation as F}from"react-i18next";var D=Object.defineProperty,C=Object.defineProperties,S=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,p=(n,t,r)=>t in n?D(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,B=(n,t)=>{for(var r in t||(t={}))b.call(t,r)&&p(n,r,t[r]);if(d)for(var r of d(t))R.call(t,r)&&p(n,r,t[r]);return n},W=(n,t)=>C(n,S(t));const $=n=>{const{id:t,answerList:r,question:u,index:w,name:f="",answerIsImg:E,questionIsImg:g,questionIsAudio:v,answerIsAudio:_,LLMConfig:y}=n,{t:o}=F(),{dataFormatType:s,selectedID:L,setSelectedID:V}=h(),i=w+1,O=f||`${o("Dialog")}${i}`,I=()=>E?e.createElement(e.Fragment,null,e.createElement(a,{type:"primary"},o("Answer")),e.createElement(T,{answerList:r})):_?e.createElement(e.Fragment,null,e.createElement(a,{type:"primary"},o("Answer")),e.createElement(N,{answerList:r})):r==null?void 0:r.map((P,l)=>{const m=l+1,c=W(B({},P),{order:m}),j=x(c,y);return e.createElement("div",{key:l},e.createElement(a,{type:"primary"},o("Answer"),m),e.createElement(A,{i:c,isTextControl:j,dataFormatType:s}))});return e.createElement("div",{key:t,onClick:()=>V(t),className:q({dialog:!0,selected:t===L})},e.createElement("div",{className:"header"},e.createElement("span",{className:"order"},i),e.createElement("div",{className:"name"},e.createElement("div",{className:"show-name"},O),e.createElement("div",{className:"tips"},"\uFF08",o("SelectionOfAnnotation"),"\uFF09"))),e.createElement("div",{className:"dialog-question"},e.createElement(a,{type:"primary"},o("Title"),i),e.createElement("div",null,e.createElement(M,{question:u,dataFormatType:s,isImg:g,isAudio:v}))),e.createElement("div",{className:"dialog-answer"},I()))};export{$ as default};
@@ -1 +1 @@
1
- import i,{useEffect as M,useState as E}from"react";import{ELLMDataType as W}from"../../constant/index.js";import{getStepConfig as Y}from"../../store/annotation/reducer.js";import{LabelBeeContext as Z}from"../../store/ctx.js";import{jsonParser as ee}from"../../utils/index.js";import{connect as te}from"react-redux";import A from"../../store/LLMMultiWheel/index.js";import{LLMMultiWheelViewCls as $}from"../../views/MainView/LLMMultiWheelLayout/index.js";import{ToggleDataFormatType as ne}from"../LLMToolView/questionView/components/header/index.js";import oe from"./dialogView/index.js";import re from"../messageMaskLayer/index.js";import ie from"../../views/MainView/annotationTips/index.js";import{I18nextProvider as ae,useTranslation as se}from"react-i18next";import{LLMViewCls as le}from"../LLMToolView/questionView/index.js";import{Layout as ue}from"antd";import{i18n as F}from"@labelbee/lb-utils";var ce=Object.defineProperty,de=Object.defineProperties,pe=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,k=(t,e,n)=>e in t?ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,y=(t,e)=>{for(var n in e||(e={}))me.call(e,n)&&k(t,n,e[n]);if(N)for(var n of N(e))Le.call(e,n)&&k(t,n,e[n]);return t},h=(t,e)=>de(t,pe(e));const R=t=>{const{questionIsImg:e,answerIsImg:n,LLMConfig:l,dialogList:p,lang:u="cn"}=t,{dataFormatType:c,setDataFormatType:a}=A();return M(()=>{var o;u&&((o=F)==null||o.changeLanguage(u))},[u]),i.createElement(ae,{i18n:F},i.createElement("div",{className:`${$}`},i.createElement("div",{style:{display:"flex",justifyContent:"flex-end",margin:"10px"}},i.createElement(ne,{dataFormatType:c,setDataFormatType:a})),i.createElement("div",{className:`${$}-container`},p==null?void 0:p.map((o,d)=>i.createElement(oe,h(y({},o),{key:d,index:d,questionIsImg:e,answerIsImg:n,LLMConfig:l}))))))},U=({type:t,questionIndex:e,answerIndex:n,llmFile:l})=>{if(t==="question")return l==null?void 0:l.find((u,c)=>e===c);let p=null;return l==null||l.forEach((u,c)=>{var a;(a=u.answerList)==null||a.forEach((o,d)=>{c===e&&n===d&&(p=o)})}),p},fe=t=>{var e,n;const{annotation:l,tips:p,showTips:u,drawLayerSlot:c}=t,{imgIndex:a,imgList:o,stepList:d,step:x,toolInstance:v}=l,[g,B]=E(),{setSelectedID:Q,newAnswerListMap:I}=A(),[z,T]=E([]),j=((e=g==null?void 0:g.dataType)==null?void 0:e.prompt)===W.Picture,P=((n=g==null?void 0:g.dataType)==null?void 0:n.response)===W.Picture,{t:G}=se(),[,H]=E(0);return M(()=>{var r,m,L;if(!o[a])return;const w=(r=o[a])!=null?r:{},f=(L=(m=w==null?void 0:w.questionList)==null?void 0:m.textList)!=null?L:[];T(f),(f==null?void 0:f.length)&&Q(f[0].id)},[a]),M(()=>{var r,m;const L=(r=o[a])!=null?r:{},w=L==null?void 0:L.questionList,f=(m=L==null?void 0:L.llmFile)==null?void 0:m.textList,V=w==null?void 0:w.textList,J=V==null?void 0:V.map((s,b)=>{var D;return h(y({},s),{question:j&&U({type:"question",questionIndex:b,llmFile:f})||(s==null?void 0:s.question),answerList:(D=s==null?void 0:s.answerList)==null?void 0:D.map((_,O)=>{var S,q,C;const K=`${(S=s==null?void 0:s.id)!=null?S:""}-${(q=_==null?void 0:_.id)!=null?q:""}`,X=P?U({type:"answer",questionIndex:b,answerIndex:O,llmFile:f})||{}:{};return y(h(y({},_),{answer:_.answer,newAnswer:(C=I[K])!=null?C:_.answer,order:O+1}),X)})})});T(J)},[I,j,P]),M(()=>{var r;if(d&&x){const m=(r=Y(d,x))==null?void 0:r.config;B(ee(m))}},[d,x]),M(()=>{if(v)return v.on("validUpdated",()=>{H(r=>r+1)}),()=>{v.unbindAll("validUpdated")}},[v]),i.createElement(ue,{className:le},!(v==null?void 0:v.valid)&&i.createElement(re,{message:G("InvalidQuestionAndSkip")}),c==null?void 0:c({}),u===!0&&i.createElement(ie,{tips:p}),i.createElement(R,{questionIsImg:j,answerIsImg:P,LLMConfig:g,dialogList:z}))},ve=t=>({annotation:t.annotation});var ge=te(ve,null,null,{context:Z})(fe);export{R as LLMMultiWheelSourceView,ge as default};
1
+ import a,{useEffect as x,useState as b}from"react";import{ELLMDataType as I}from"../../constant/index.js";import{getStepConfig as ne}from"../../store/annotation/reducer.js";import{LabelBeeContext as oe}from"../../store/ctx.js";import{jsonParser as re}from"../../utils/index.js";import{connect as ie}from"react-redux";import k from"../../store/LLMMultiWheel/index.js";import{LLMMultiWheelViewCls as R}from"../../views/MainView/LLMMultiWheelLayout/index.js";import{ToggleDataFormatType as ae}from"../LLMToolView/questionView/components/header/index.js";import se from"./dialogView/index.js";import le from"../messageMaskLayer/index.js";import ue from"../../views/MainView/annotationTips/index.js";import{I18nextProvider as de,useTranslation as ce}from"react-i18next";import{LLMViewCls as pe}from"../LLMToolView/questionView/index.js";import{Layout as me}from"antd";import{i18n as U}from"@labelbee/lb-utils";var ve=Object.defineProperty,fe=Object.defineProperties,Le=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,Q=(t,e,n)=>e in t?ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,j=(t,e)=>{for(var n in e||(e={}))we.call(e,n)&&Q(t,n,e[n]);if(B)for(var n of B(e))ge.call(e,n)&&Q(t,n,e[n]);return t},q=(t,e)=>fe(t,Le(e));const z=t=>{const{questionIsImg:e,answerIsImg:n,questionIsAudio:s,answerIsAudio:p,LLMConfig:L,dialogList:d,lang:c="cn"}=t,{dataFormatType:w,setDataFormatType:o}=k();return x(()=>{var r;c&&((r=U)==null||r.changeLanguage(c))},[c]),a.createElement(de,{i18n:U},a.createElement("div",{className:`${R}`},a.createElement("div",{style:{display:"flex",justifyContent:"flex-end",margin:"10px"}},a.createElement(ae,{dataFormatType:w,setDataFormatType:o})),a.createElement("div",{className:`${R}-container`},d==null?void 0:d.map((r,g)=>a.createElement(se,q(j({},r),{key:g,index:g,questionIsImg:e,answerIsImg:n,questionIsAudio:s,answerIsAudio:p,LLMConfig:L}))))))},G=({type:t,questionIndex:e,answerIndex:n,llmFile:s})=>{if(t==="question")return s==null?void 0:s.find((L,d)=>e===d);let p=null;return s==null||s.forEach((L,d)=>{var c;(c=L.answerList)==null||c.forEach((w,o)=>{d===e&&n===o&&(p=w)})}),p},_e=t=>{var e,n,s,p;const{annotation:L,tips:d,showTips:c,drawLayerSlot:w}=t,{imgIndex:o,imgList:r,stepList:g,step:P,toolInstance:_}=L,[l,H]=b(),{setSelectedID:J,newAnswerListMap:D}=k(),[K,O]=b([]),E=((e=l==null?void 0:l.dataType)==null?void 0:e.prompt)===I.Picture,T=((n=l==null?void 0:l.dataType)==null?void 0:n.response)===I.Picture,h=((s=l==null?void 0:l.dataType)==null?void 0:s.prompt)===I.Audio,V=((p=l==null?void 0:l.dataType)==null?void 0:p.response)===I.Audio,{t:X}=ce(),[,Y]=b(0);return x(()=>{var i,m,v;if(!r[o])return;const M=(i=r[o])!=null?i:{},f=(v=(m=M==null?void 0:M.questionList)==null?void 0:m.textList)!=null?v:[];O(f),(f==null?void 0:f.length)&&J(f[0].id)},[o]),x(()=>{var i,m;if(!r[o])return;const v=(i=r[o])!=null?i:{},M=v==null?void 0:v.questionList,f=(m=v==null?void 0:v.llmFile)==null?void 0:m.textList,A=M==null?void 0:M.textList,Z=A==null?void 0:A.map((u,S)=>{var C;return q(j({},u),{question:(E||h)&&G({type:"question",questionIndex:S,llmFile:f})||(u==null?void 0:u.question),answerList:(C=u==null?void 0:u.answerList)==null?void 0:C.map((y,W)=>{var $,F,N;const ee=`${($=u==null?void 0:u.id)!=null?$:""}-${(F=y==null?void 0:y.id)!=null?F:""}`,te=T||V?G({type:"answer",questionIndex:S,answerIndex:W,llmFile:f})||{}:{};return j(q(j({},y),{answer:y.answer,newAnswer:(N=D[ee])!=null?N:y.answer,order:W+1}),te)})})});O(Z)},[D,E,h,T,V,r,o]),x(()=>{var i;if(g&&P){const m=(i=ne(g,P))==null?void 0:i.config;H(re(m))}},[g,P]),x(()=>{if(_)return _.on("validUpdated",()=>{Y(i=>i+1)}),()=>{_.unbindAll("validUpdated")}},[_]),a.createElement(me,{className:pe},!(_==null?void 0:_.valid)&&a.createElement(le,{message:X("InvalidQuestionAndSkip")}),w==null?void 0:w({}),c===!0&&a.createElement(ue,{tips:d}),a.createElement(z,{questionIsImg:E,answerIsImg:T,questionIsAudio:h,answerIsAudio:V,LLMConfig:l,dialogList:K}))},Me=t=>({annotation:t.annotation});var ye=ie(Me,null,null,{context:oe})(_e);export{z as LLMMultiWheelSourceView,ye as default};
@@ -1 +1 @@
1
- import a,{useContext as $,useState as v,useEffect as u}from"react";import{connect as U}from"react-redux";import{LabelBeeContext as B,LLMContext as K}from"../../store/ctx.js";import{message as W}from"antd";import{ELLMDataType as L,prefix as z}from"../../constant/index.js";import{Layout as G}from"antd/es";import H from"./questionView/index.js";import{useTranslation as J}from"react-i18next";import O from"../../views/MainView/annotationTips/index.js";import{getCurrentResultFromResultList as X}from"./utils/data.js";import{getStepConfig as Y}from"../../store/annotation/reducer.js";import{jsonParser as Z}from"../../utils/index.js";import ee from"../messageMaskLayer/index.js";const q=`${z}-LLMView`,te=g=>{var x;const{annotation:M,checkMode:T=!0,tips:A,showTips:E,drawLayerSlot:I}=g,{imgIndex:n,imgList:s,stepList:w,step:d,toolInstance:l}=M,{hoverKey:R,modelAPIResponse:P,setModelAPIResponse:_,newAnswerList:c}=$(K),[V,S]=v([]),[h,k]=v(""),[t,Q]=v(),{t:y}=J(),[,b]=v(0);return u(()=>{let e;if(!T)return e=setInterval(()=>{W.info(y("EfficientListening"))},1e3*60),()=>{e&&clearInterval(e)}},[]),u(()=>{if(l)return l.on("validUpdated",()=>{b(e=>e+1)}),()=>{l.unbindAll("validUpdated")}},[l]),u(()=>{var e,o,i,r,j,C;if(!s[n])return;const D=((e=t==null?void 0:t.dataType)==null?void 0:e.prompt)===L.Picture,F=((o=t==null?void 0:t.dataType)==null?void 0:o.response)===L.Picture,m=(i=s[n])==null?void 0:i.questionList,p=(r=s[n])==null?void 0:r.llmFile,N=D?p==null?void 0:p.question:m==null?void 0:m.question;k(N);let f=(m==null?void 0:m.answerList)||[];F&&(f=(p==null?void 0:p.answerList)||[]),((j=t==null?void 0:t.dataType)==null?void 0:j.response)===L.None&&(f=[]),((C=t==null?void 0:t.dataType)==null?void 0:C.response)===L.Text&&(c==null?void 0:c.length)>0&&(f=c),S(f)},[n,c,t,(x=s[n])==null?void 0:x.id]),u(()=>{var e;if(!s[n])return;const o=(e=s[n])!=null?e:{},i=X(o==null?void 0:o.result,d),r=(i==null?void 0:i.length)>0?i[0]:i;_((r==null?void 0:r.modelAPIResponse)||[])},[n]),u(()=>{var e;if(w&&d){const o=(e=Y(w,d))==null?void 0:e.config;Q(Z(o))}},[w,d]),a.createElement(G,{className:q},!(l==null?void 0:l.valid)&&a.createElement(ee,{message:y("InvalidQuestionAndSkip")}),I==null?void 0:I({}),a.createElement("div",{className:`${q}-question`},E===!0&&a.createElement(O,{tips:A}),a.createElement(H,{hoverKey:R,question:h,answerList:V,modelAPIResponse:P,setModelAPIResponse:_,checkMode:T,annotation:M,LLMConfig:t})))},ne=g=>({annotation:g.annotation});var oe=U(ne,null,null,{context:B})(te);export{oe as default};
1
+ import u,{useContext as W,useState as L,useEffect as d}from"react";import{connect as z}from"react-redux";import{LabelBeeContext as G,LLMContext as H}from"../../store/ctx.js";import{message as J}from"antd";import{ELLMDataType as r,prefix as O}from"../../constant/index.js";import{Layout as X}from"antd/es";import Y from"./questionView/index.js";import{useTranslation as Z}from"react-i18next";import ee from"../../views/MainView/annotationTips/index.js";import{getCurrentResultFromResultList as te}from"./utils/data.js";import{getStepConfig as ne}from"../../store/annotation/reducer.js";import{jsonParser as oe}from"../../utils/index.js";import ie from"../messageMaskLayer/index.js";const E=`${O}-LLMView`,se=g=>{var x;const{annotation:M,checkMode:T=!0,tips:R,showTips:P,drawLayerSlot:I}=g,{imgIndex:n,imgList:s,stepList:w,step:c,toolInstance:l}=M,{hoverKey:V,modelAPIResponse:h,setModelAPIResponse:_,newAnswerList:m}=W(H),[S,k]=L([]),[Q,b]=L(""),[e,D]=L(),{t:y}=Z(),[,F]=L(0);return d(()=>{let t;if(!T)return t=setInterval(()=>{J.info(y("EfficientListening"))},1e3*60),()=>{t&&clearInterval(t)}},[]),d(()=>{if(l)return l.on("validUpdated",()=>{F(t=>t+1)}),()=>{l.unbindAll("validUpdated")}},[l]),d(()=>{var t,o,i,a,A,j,q,C;if(!s[n])return;const N=((t=e==null?void 0:e.dataType)==null?void 0:t.prompt)===r.Picture,$=((o=e==null?void 0:e.dataType)==null?void 0:o.prompt)===r.Audio,U=((i=e==null?void 0:e.dataType)==null?void 0:i.response)===r.Picture,B=((a=e==null?void 0:e.dataType)==null?void 0:a.response)===r.Audio,p=(A=s[n])==null?void 0:A.questionList,v=(j=s[n])==null?void 0:j.llmFile,K=N||$?v==null?void 0:v.question:p==null?void 0:p.question;b(K);let f=(p==null?void 0:p.answerList)||[];(U||B)&&(f=(v==null?void 0:v.answerList)||[]),((q=e==null?void 0:e.dataType)==null?void 0:q.response)===r.None&&(f=[]),((C=e==null?void 0:e.dataType)==null?void 0:C.response)===r.Text&&(m==null?void 0:m.length)>0&&(f=m),k(f)},[n,m,e,(x=s[n])==null?void 0:x.id]),d(()=>{var t;if(!s[n])return;const o=(t=s[n])!=null?t:{},i=te(o==null?void 0:o.result,c),a=(i==null?void 0:i.length)>0?i[0]:i;_((a==null?void 0:a.modelAPIResponse)||[])},[n]),d(()=>{var t;if(w&&c){const o=(t=ne(w,c))==null?void 0:t.config;D(oe(o))}},[w,c]),u.createElement(X,{className:E},!(l==null?void 0:l.valid)&&u.createElement(ie,{message:y("InvalidQuestionAndSkip")}),I==null?void 0:I({}),u.createElement("div",{className:`${E}-question`},P===!0&&u.createElement(ee,{tips:R}),u.createElement(Y,{hoverKey:V,question:Q,answerList:S,modelAPIResponse:h,setModelAPIResponse:_,checkMode:T,annotation:M,LLMConfig:e})))},le=g=>({annotation:g.annotation});var re=z(le,null,null,{context:G})(se);export{re as default};
@@ -0,0 +1 @@
1
+ import t from"react";import{Tag as c}from"antd";import{prefix as m}from"../../../../../constant/index.js";import s from"classnames";const n=`${m}-LLMView`,u=t.memo(({url:r})=>t.createElement("audio",{controls:!0},t.createElement("source",{src:r,type:"audio/mpeg"}))),d=r=>{const{answerList:l,hoverKey:o}=r;return t.createElement("div",null,(l==null?void 0:l.length)>0&&l.map((e,a)=>t.createElement("div",{key:a,className:s({[`${n}__content`]:!0,[`${n}__contentActive`]:o===(e==null?void 0:e.order)})},t.createElement(c,{className:`${n}-tag`},e==null?void 0:e.order),t.createElement("div",null,t.createElement(u,{key:e==null?void 0:e.url,url:e==null?void 0:e.url})))))};export{d as default};
@@ -1 +1 @@
1
- import e from"react";import{useTranslation as u}from"react-i18next";import{Resizable as f}from"re-resizable";import{Radio as i,Image as g}from"antd";import{EDataFormatType as m,prefix as E}from"../../../../../constant/index.js";import{FileTextOutlined as x}from"@ant-design/icons";import w from"../../../../markdownView/index.js";import{isString as y,isObject as T}from"lodash";import{i18n as b}from"@labelbee/lb-utils";import h from"../../../../../assets/annotation/LLMTool/imgFail_cn.svg.js";import v from"../../../../../assets/annotation/LLMTool/imgFail_en.svg.js";const s=`${E}-LLMView`,c=({question:t,dataFormatType:n,isImg:a})=>{const r=y(t)?t:"",o=b.language==="en"?v:h;if(a){const l=T(t)?t==null?void 0:t.url:"";return e.createElement(g,{src:l||o,fallback:o})}return e.createElement("div",{style:{whiteSpace:"pre-wrap"}},n===m.Markdown?e.createElement(w,{value:r}):r)},F=t=>{const{question:n,dataFormatType:a,setDataFormatType:r,isImg:o}=t,l=300,{t:p}=u();return e.createElement(f,{defaultSize:{width:"100%",height:l},minHeight:l,enable:{bottom:!0},style:{padding:"26px 32px",borderBottom:"1px solid #EBEBEB",overflow:"hidden"}},e.createElement("div",{className:`${s}__title`,style:{display:"flex",justifyContent:"space-between"}},p("Title"),e.createElement(d,{dataFormatType:a,setDataFormatType:r})),e.createElement("div",{className:`${s}__headerContent`},e.createElement(c,{question:n,dataFormatType:a,isImg:o})))},d=t=>{const{dataFormatType:n,setDataFormatType:a}=t;return e.createElement("span",{style:{display:"flex"}},e.createElement(i.Group,{value:n,onChange:r=>{a(r.target.value)}},e.createElement(i.Button,{value:m.Default,style:{textAlign:"center",width:"52px"}},"</>"),e.createElement(i.Button,{value:m.Markdown,style:{textAlign:"center",width:"52px"}},e.createElement(x,null))),e.createElement("span",{style:{marginLeft:"8px",width:"4px",background:"#1890ff"}}))};export{c as RenderQuestion,d as ToggleDataFormatType,F as default};
1
+ import e from"react";import{useTranslation as g}from"react-i18next";import{Resizable as x}from"re-resizable";import{Radio as m,Image as y,Empty as c}from"antd";import{EDataFormatType as s,prefix as w}from"../../../../../constant/index.js";import{FileTextOutlined as T}from"@ant-design/icons";import v from"../../../../markdownView/index.js";import{isString as b,isObject as d}from"lodash";import{i18n as h}from"@labelbee/lb-utils";import F from"../../../../../assets/annotation/LLMTool/imgFail_cn.svg.js";import L from"../../../../../assets/annotation/LLMTool/imgFail_en.svg.js";const p=`${w}-LLMView`,u=({question:t,dataFormatType:n,isImg:r,isAudio:l})=>{const o=b(t)?t:"",i=h.language==="en"?L:F;if(r){const a=d(t)?t==null?void 0:t.url:"";return e.createElement(y,{src:a||i,fallback:i})}if(l){const a=d(t)?t==null?void 0:t.url:"";return a?e.createElement("audio",{controls:!0},e.createElement("source",{src:a,type:"audio/mpeg"})):e.createElement(c,{image:c.PRESENTED_IMAGE_SIMPLE})}return e.createElement("div",{style:{whiteSpace:"pre-wrap"}},n===s.Markdown?e.createElement(v,{value:o}):o)},_=t=>{const{question:n,dataFormatType:r,setDataFormatType:l,isImg:o,isAudio:i}=t,a=300,{t:f}=g();return e.createElement(x,{defaultSize:{width:"100%",height:a},minHeight:a,enable:{bottom:!0},style:{padding:"26px 32px",borderBottom:"1px solid #EBEBEB",overflow:"hidden"}},e.createElement("div",{className:`${p}__title`,style:{display:"flex",justifyContent:"space-between"}},f("Title"),e.createElement(E,{dataFormatType:r,setDataFormatType:l})),e.createElement("div",{className:`${p}__headerContent`},e.createElement(u,{question:n,dataFormatType:r,isImg:o,isAudio:i})))},E=t=>{const{dataFormatType:n,setDataFormatType:r}=t;return e.createElement("span",{style:{display:"flex"}},e.createElement(m.Group,{value:n,onChange:l=>{r(l.target.value)}},e.createElement(m.Button,{value:s.Default,style:{textAlign:"center",width:"52px"}},"</>"),e.createElement(m.Button,{value:s.Markdown,style:{textAlign:"center",width:"52px"}},e.createElement(T,null))),e.createElement("span",{style:{marginLeft:"8px",width:"4px",background:"#1890ff"}}))};export{u as RenderQuestion,E as ToggleDataFormatType,_ as default};
@@ -1 +1 @@
1
- import n,{useState as M,useEffect as O}from"react";import{Tag as S}from"antd";import{prefix as N,EDataFormatType as u,ELLMDataType as p}from"../../../constant/index.js";import $ from"classnames";import{I18nextProvider as k,useTranslation as C}from"react-i18next";import{i18n as v}from"@labelbee/lb-utils";import D from"../../markdownView/index.js";import L from"../modelAPIView/index.js";import R from"../../diffMatchPatchComponent/index.js";import F from"./components/header/index.js";import W from"./components/imgView/index.js";import{isString as q}from"lodash";var B=Object.defineProperty,w=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,f=(e,t,r)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,K=(e,t)=>{for(var r in t||(t={}))H.call(t,r)&&f(e,r,t[r]);if(w)for(var r of w(t))Q.call(t,r)&&f(e,r,t[r]);return e};const a=`${N}-LLMView`,_=({i:e,dataFormatType:t,isTextControl:r})=>{var l;return t===u.Markdown?n.createElement(D,{value:(l=e==null?void 0:e.newAnswer)!=null?l:e==null?void 0:e.answer}):r?n.createElement("div",{style:{width:"100%",overflowWrap:"break-word"}},n.createElement(R,{originString:e==null?void 0:e.answer,currentString:e==null?void 0:e.newAnswer})):n.createElement("div",{style:{whiteSpace:"pre-wrap",overflowWrap:"break-word"}},(e==null?void 0:e.newAnswer)||(e==null?void 0:e.answer))},E=(e,t)=>{var r;return(t==null?void 0:t.isTextEdit)?!!((r=((t==null?void 0:t.textEdit)||[]).filter(s=>(s==null?void 0:s.title)===e.order)[0])==null?void 0:r.textControl):!1},z=e=>{var t,r;const{hoverKey:l,answerList:s,question:m,lang:c,modelAPIResponse:x,setModelAPIResponse:g,checkMode:y=!0,LLMConfig:i,answerHeaderSlot:P}=e,[d,h]=M(u.Default),I=((t=i==null?void 0:i.dataType)==null?void 0:t.prompt)===p.Picture,A=((r=i==null?void 0:i.dataType)==null?void 0:r.response)===p.Picture,{t:T}=C();O(()=>{var o;c&&((o=v)==null||o.changeLanguage(c))},[]);const V=n.createElement("div",null,s.map((o,b)=>{const j=E(o,i);return n.createElement("div",{className:$({[`${a}__content`]:!0,[`${a}__contentActive`]:l===(o==null?void 0:o.order)}),key:b},n.createElement(S,{className:`${a}-tag`},o==null?void 0:o.order),n.createElement(_,{i:o,isTextControl:j,dataFormatType:d}))}),q(m)&&n.createElement(L,{dataFormatType:d,modelAPIResponse:x,question:m,setModelAPIResponse:g,checkMode:y,annotation:e.annotation}));return n.createElement("div",{className:a},n.createElement(F,{question:m,dataFormatType:d,setDataFormatType:h,isImg:I}),n.createElement("div",{className:`${a}__textBox`},n.createElement("div",{className:`${a}__title`},T("Answer")," ",P),A?n.createElement(W,{hoverKey:l,answerList:s}):V))},G=e=>n.createElement(k,{i18n:v},n.createElement(z,K({},e)));export{a as LLMViewCls,_ as RenderAnswer,G as default,E as getTextControlByConfig};
1
+ import n,{useState as $,useEffect as k}from"react";import{Tag as D}from"antd";import{prefix as L,EDataFormatType as w,ELLMDataType as d}from"../../../constant/index.js";import R from"classnames";import{I18nextProvider as q,useTranslation as F}from"react-i18next";import{i18n as f}from"@labelbee/lb-utils";import W from"../../markdownView/index.js";import B from"../modelAPIView/index.js";import H from"../../diffMatchPatchComponent/index.js";import Q from"./components/header/index.js";import K from"./components/imgView/index.js";import{isString as z}from"lodash";import G from"./components/audioView/index.js";var J=Object.defineProperty,_=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,E=(e,t,r)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Y=(e,t)=>{for(var r in t||(t={}))U.call(t,r)&&E(e,r,t[r]);if(_)for(var r of _(t))X.call(t,r)&&E(e,r,t[r]);return e};const l=`${L}-LLMView`,x=({i:e,dataFormatType:t,isTextControl:r})=>{var i;return t===w.Markdown?n.createElement(W,{value:(i=e==null?void 0:e.newAnswer)!=null?i:e==null?void 0:e.answer}):r?n.createElement("div",{style:{width:"100%",overflowWrap:"break-word"}},n.createElement(H,{originString:e==null?void 0:e.answer,currentString:e==null?void 0:e.newAnswer})):n.createElement("div",{style:{whiteSpace:"pre-wrap",overflowWrap:"break-word"}},(e==null?void 0:e.newAnswer)||(e==null?void 0:e.answer))},y=(e,t)=>{var r;return(t==null?void 0:t.isTextEdit)?!!((r=((t==null?void 0:t.textEdit)||[]).filter(s=>(s==null?void 0:s.title)===e.order)[0])==null?void 0:r.textControl):!1},Z=e=>{var t,r,i,s;const{hoverKey:m,answerList:c,question:u,lang:v,modelAPIResponse:g,setModelAPIResponse:A,checkMode:P=!0,LLMConfig:o,answerHeaderSlot:I}=e,[p,h]=$(w.Default),T=((t=o==null?void 0:o.dataType)==null?void 0:t.prompt)===d.Picture,V=((r=o==null?void 0:o.dataType)==null?void 0:r.response)===d.Picture,j=((i=o==null?void 0:o.dataType)==null?void 0:i.prompt)===d.Audio,b=((s=o==null?void 0:o.dataType)==null?void 0:s.response)===d.Audio,{t:M}=F();k(()=>{var a;v&&((a=f)==null||a.changeLanguage(v))},[]);const O=n.createElement("div",null,c.map((a,N)=>{const C=y(a,o);return n.createElement("div",{className:R({[`${l}__content`]:!0,[`${l}__contentActive`]:m===(a==null?void 0:a.order)}),key:N},n.createElement(D,{className:`${l}-tag`},a==null?void 0:a.order),n.createElement(x,{i:a,isTextControl:C,dataFormatType:p}))}),z(u)&&n.createElement(B,{dataFormatType:p,modelAPIResponse:g,question:u,setModelAPIResponse:A,checkMode:P,annotation:e.annotation})),S=()=>b?n.createElement(G,{hoverKey:m,answerList:c}):V?n.createElement(K,{hoverKey:m,answerList:c}):O;return n.createElement("div",{className:l},n.createElement(Q,{question:u,dataFormatType:p,setDataFormatType:h,isImg:T,isAudio:j}),n.createElement("div",{className:`${l}__textBox`},n.createElement("div",{className:`${l}__title`},M("Answer")," ",I),S()))},ee=e=>n.createElement(q,{i18n:f},n.createElement(Z,Y({},e)));export{l as LLMViewCls,x as RenderAnswer,ee as default,y as getTextControlByConfig};
@@ -1 +1 @@
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 o="bee",I=`${o}-component`;var r;(function(a){a.Default="default",a.Markdown="markdown"})(r||(r={}));var N;(function(a){a.Picture="picture",a.Text="text",a.None="none"})(N||(N={}));export{r as EDataFormatType,N as ELLMDataType,n as EStepType,c as ESubmitType,I as componentCls,o as prefix};
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={}));var o;(function(a){a.Picture="picture",a.Text="text",a.None="none",a.Audio="audio"})(o||(o={}));export{r as EDataFormatType,o as ELLMDataType,n as EStepType,c as ESubmitType,I as componentCls,N as prefix};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.24.0-alpha.16",
3
+ "version": "1.24.0-alpha.18",
4
4
  "description": "Provide a complete library of annotation components",
5
5
  "main": "./dist/index.js",
6
6
  "es": "./es/index.js",