@labelbee/lb-components 1.23.0-alpha.123 → 1.23.0-alpha.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/2DViewWorker.js +1 -1
- package/dist/components/LLMMultiWheelView/dialogView/index.js +1 -1
- package/dist/components/LLMMultiWheelView/index.js +1 -1
- package/dist/components/LLMMultiWheelView/sidebar/index.js +1 -1
- package/dist/store/LLMMultiWheel/index.js +1 -1
- package/dist/types/components/LLMToolView/types.d.ts +1 -0
- package/dist/types/components/LLMToolView/utils/data.d.ts +1 -0
- package/dist/types/store/LLMMultiWheel/index.d.ts +5 -6
- package/es/_virtual/2DViewWorker.js +1 -1
- package/es/components/LLMMultiWheelView/dialogView/index.js +1 -1
- package/es/components/LLMMultiWheelView/index.js +1 -1
- package/es/components/LLMMultiWheelView/sidebar/index.js +1 -1
- package/es/store/LLMMultiWheel/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getTextControlByConfig as
|
|
1
|
+
import{getTextControlByConfig as P,RenderAnswer as I}from"../../LLMToolView/questionView/index.js";import{RenderQuestion as N}from"../../LLMToolView/questionView/components/header/index.js";import V from"../../LLMToolView/questionView/components/imgView/index.js";import j from"../../../store/LLMMultiWheel/index.js";import{classnames as h}from"../../../utils/index.js";import{Button as l}from"antd";import t from"react";var x=Object.defineProperty,D=Object.defineProperties,M=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,d=(o,e,r)=>e in o?x(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,F=(o,e)=>{for(var r in e||(e={}))q.call(e,r)&&d(o,r,e[r]);if(c)for(var r of c(e))C.call(e,r)&&d(o,r,e[r]);return o},T=(o,e)=>D(o,M(e));const B=o=>{const{id:e,answerList:r,question:p,index:u,name:f="",answerIsImg:w,questionIsImg:E,LLMConfig:_}=o,{dataFormatType:s,selectedID:v,setSelectedID:g}=j(),a=u+1,y=f||`\u5BF9\u8BDD${a}`;return t.createElement("div",{key:e,onClick:()=>g(e),className:h({dialog:!0,selected:e===v})},t.createElement("div",{className:"header"},t.createElement("span",{className:"order"},a),t.createElement("div",{className:"name"},t.createElement("div",{className:"show-name"},y),t.createElement("div",{className:"tips"},"\uFF08\u9009\u4E2D\u6807\u6CE8\uFF09"))),t.createElement("div",{className:"dialog-question"},t.createElement(l,{type:"primary"},"\u9898\u76EE",a),t.createElement("div",null,t.createElement(N,{question:p,dataFormatType:s,isImg:E}))),t.createElement("div",{className:"dialog-answer"},r.map((L,n)=>{const i=n+1,m=T(F({},L),{order:i}),O=P(m,_);return t.createElement("div",{key:n},t.createElement(l,{type:"primary"},"\u7B54\u6848",i),w?t.createElement(V,{answerList:r}):t.createElement(I,{i:m,isTextControl:O,dataFormatType:s}))})))};export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i,{useState as M,useEffect as f}from"react";import{ELLMDataType as E}from"../../constant/index.js";import{getStepConfig as k}from"../../store/annotation/reducer.js";import{LabelBeeContext as R}from"../../store/ctx.js";import{jsonParser as U}from"../../utils/index.js";import{connect as B}from"react-redux";import h from"../../store/LLMMultiWheel/index.js";import{LLMMultiWheelViewCls as O}from"../../views/MainView/LLMMultiWheelLayout/index.js";import{ToggleDataFormatType as Q}from"../LLMToolView/questionView/components/header/index.js";import z from"./dialogView/index.js";import G from"../messageMaskLayer/index.js";import H from"../../views/MainView/annotationTips/index.js";import{useTranslation as J}from"react-i18next";import{LLMViewCls as K}from"../LLMToolView/questionView/index.js";import{Layout as X}from"antd";var Y=Object.defineProperty,Z=Object.defineProperties,ee=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable,D=(t,e,o)=>e in t?Y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,y=(t,e)=>{for(var o in e||(e={}))te.call(e,o)&&D(t,o,e[o]);if(S)for(var o of S(e))oe.call(e,o)&&D(t,o,e[o]);return t},x=(t,e)=>Z(t,ee(e));const b=t=>{const{questionIsImg:e,answerIsImg:o,LLMConfig:v,dialogList:m}=t,{dataFormatType:g,setDataFormatType:L}=h();return i.createElement("div",{className:`${O}`},i.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},i.createElement(Q,{dataFormatType:g,setDataFormatType:L})),i.createElement("div",{className:`${O}-container`},m==null?void 0:m.map((u,d)=>i.createElement(z,x(y({},u),{key:d,index:d,questionIsImg:e,answerIsImg:o,LLMConfig:v})))))},ne=t=>{var e,o;const{annotation:v,tips:m,showTips:g,drawLayerSlot:L}=t,{imgIndex:u,imgList:d,stepList:w,step:_,toolInstance:l}=v,[p,C]=M(),{setSelectedID:W,newAnswerListMap:j}=h(),[P,I]=M([]),q=((e=p==null?void 0:p.dataType)==null?void 0:e.prompt)===E.Picture,A=((o=p==null?void 0:p.dataType)==null?void 0:o.response)===E.Picture,{t:$}=J(),[,N]=M(0);return f(()=>{var r,n,c;if(!d[u])return;const a=(r=d[u])!=null?r:{},s=(c=(n=a==null?void 0:a.questionList)==null?void 0:n.textList)!=null?c:[];I(s),(s==null?void 0:s.length)&&W(s[0].id)},[u]),f(()=>{const r=P.map(n=>{var c;return x(y({},n),{answerList:(c=n==null?void 0:n.answerList)==null?void 0:c.map(a=>{var s,T,V;const F=`${(s=n==null?void 0:n.id)!=null?s:""}-${(T=a==null?void 0:a.id)!=null?T:""}`;return x(y({},a),{newAnswer:(V=j[F])!=null?V:a.answer})})})});I(r)},[j]),f(()=>{var r;if(w&&_){const n=(r=k(w,_))==null?void 0:r.config;C(U(n))}},[w,_]),f(()=>{if(l)return l.on("validUpdated",()=>{N(r=>r+1)}),()=>{l.unbindAll("validUpdated")}},[l]),i.createElement(X,{className:K},!(l==null?void 0:l.valid)&&i.createElement(G,{message:$("InvalidQuestionAndSkip")}),L==null?void 0:L({}),g===!0&&i.createElement(H,{tips:m}),i.createElement(b,{questionIsImg:q,answerIsImg:A,LLMConfig:p,dialogList:P}))},re=t=>({annotation:t.annotation});var ie=B(re,null,null,{context:R})(ne);export{b as LLMMultiWheelSourceView,ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l,{useState as E,useRef as ut,useMemo as G,useEffect as V}from"react";import{LabelBeeContext as Dt}from"../../../store/ctx.js";import{connect as It}from"react-redux";import{prefix as Ot}from"../../../constant/index.js";import{getStepConfig as Vt}from"../../../store/annotation/reducer.js";import{jsonParser as dt}from"../../../utils/index.js";import Nt,{getSorts as ct}from"../../LLMToolView/sidebar/components/modelAnswerSort/index.js";import{useTranslation as Bt}from"react-i18next";import{useCustomToolInstance as $t}from"../../../hooks/annotation.js";import{isBoolean as Wt,isString as Ft,isNumber as qt,isObject as kt,isArray as Gt}from"lodash";import{PageForward as N}from"../../../store/annotation/actionCreators.js";import{cKeyCode as Kt,EToolName as zt}from"@labelbee/lb-annotation";import{getLLMIsNoConfig as Ut,EmptyConfig as Qt}from"../../LLMToolView/sidebar/index.js";import Jt from"../../LLMToolView/sidebar/components/textInputBox/index.js";import{Button as pt}from"antd";import Ht from"../../LLMToolView/sidebar/components/answerList/index.js";import Xt from"../../../store/LLMMultiWheel/index.js";import Yt from"../../../utils/StepUtils.js";import{getCurrentResultFromResultList as Zt,getRenderDataByResult as te}from"../../LLMToolView/utils/data.js";import{useMemoizedFn as K}from"ahooks";import ee from"../../LLMToolView/sidebar/components/answerSort/index.js";var ne=Object.defineProperty,oe=Object.defineProperties,re=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,ft=(c,s,p)=>s in c?ne(c,s,{enumerable:!0,configurable:!0,writable:!0,value:p}):c[s]=p,i=(c,s)=>{for(var p in s||(s={}))le.call(s,p)&&ft(c,p,s[p]);if(mt)for(var p of mt(s))ie.call(s,p)&&ft(c,p,s[p]);return c},a=(c,s)=>oe(c,re(s));const se=Kt.default,vt=`${Ot}-sidebar`,ae={sort:[],answerSort:{},textAttribute:[]},ue=c=>{var s,p,z,U,Q,J,H;const{annotation:Lt,dispatch:y,checkMode:xt}=c,{imgIndex:M,imgList:B,stepList:C,step:A,skipBeforePageTurning:h}=Lt,[m,gt]=E(),{t:j}=Bt(),r=(s=B[M])!=null?s:{},X=dt(r==null?void 0:r.result),{toolInstanceRef:v}=$t({basicInfo:X}),[$,wt]=E(!0),[T,Y]=E({}),[R,Z]=E(ae),W=ut();ut();const[x,F]=E({}),{selectedID:P,setNewAnswerListMap:tt,newAnswerListMap:et}=Xt(),g=G(()=>T[P],[P,T]),S=!v.current.valid||xt;V(()=>{var t;if(C&&A){const e=(t=Vt(C,A))==null?void 0:t.config;gt(dt(e))}},[A,JSON.stringify(C)]),V(()=>{!r||M===-1||(v.current.setValid=nt,v.current.clearResult=_t,nt(),ot())},[M,m,r==null?void 0:r.id]);const _t=()=>{var t,e,n,u,f;ot((t=r==null?void 0:r.questionList)==null?void 0:t.textList),((e=W.current)==null?void 0:e.clearValue)&&((n=W.current)==null||n.clearValue());const{waitSorts:o}=ct({selectedSort:(f=(u=D())==null?void 0:u.sort)!=null?f:[],initSelected:[],modelList:I?O!=null?O:[]:[]});F(a(i({},x),{waitSorts:o,newSort:[]}))},nt=t=>{var e;const n=t!=null?t:X.valid;Wt(n)&&(wt(n),v.current.valid=n,(e=v.current)==null||e.emit("validUpdated"))},D=()=>{const t=Yt.getCurrentStepInfo(A,C);return Zt(r==null?void 0:r.result,t.step)},ot=K(t=>{var e,n,u,f,o,L,b;const d=D();let w=(e=r==null?void 0:r.questionList)==null?void 0:e.textList;((n=d==null?void 0:d.modelData)==null?void 0:n.length)&&v.current.valid&&(w=d==null?void 0:d.modelData),t&&(w=t,d.sort=[],d.textAttribute=[],d.answerSort=[]);let st={};w==null||w.forEach((_,Tt)=>{var at;const Rt=te(m,a(i({},_),{answerList:(at=_==null?void 0:_.answerList)==null?void 0:at.map((k,Pt)=>(tt(a(i({},et),{[`${_.id}-${k.id}`]:k.answer})),a(i({},k),{order:Pt+1})))}));st[_.id]=a(i({},Rt),{order:Tt+1,id:_.id})});const{waitSorts:ht,newSort:jt}=ct({selectedSort:(f=(u=D())==null?void 0:u.sort)!=null?f:[],modelList:I?O!=null?O:[]:[]});F({waitSorts:ht,newSort:jt}),Z({sort:(o=d==null?void 0:d.sort)!=null?o:[],textAttribute:(L=d==null?void 0:d.textAttribute)!=null?L:[],answerSort:(b=d==null?void 0:d.answerSort)!=null?b:[]}),Y(st)});V(()=>{St()},[T,$,R]),V(()=>(window.addEventListener("keydown",rt),()=>{window.removeEventListener("keydown",rt)}),[]);const St=K(()=>{var t,e;const n=(e=(t=r==null?void 0:r.questionList)==null?void 0:t.textList)==null?void 0:e.map(f=>{var o;const L=(o=T[f.id])!=null?o:{};return{id:f.id,answerList:L.answerList}}),u=a(i({},R),{modelData:n});v.current.exportData=()=>[[u],{valid:$}],v.current.currentPageResult=a(i({},u),{toolName:zt.LLMMultiWheel,valid:$})}),rt=t=>{if(t.ctrlKey&&t.keyCode===se.Enter){if(h){h(()=>y(N()));return}y(N())}},bt=K(({order:t,value:e,key:n})=>{const{answerList:u}=g,f=u==null?void 0:u.map(o=>{var L,b;if((o==null?void 0:o.order)===t){if(n==="textEdit"&&Ft(e))return tt(a(i({},et),{[`${P}-${(L=o==null?void 0:o.id)!=null?L:""}`]:e})),a(i({},o),{newAnswer:e});if(qt(e))return a(i({},o),{score:e});if(kt(e)&&n){const d={[e==null?void 0:e.key]:e.value},w=(b=o[n])!=null?b:{};return a(i({},o),{[n]:i(i({},w),d)})}}return o});Y(o=>a(i({},o),{[P]:a(i({},g),{answerList:f})}))}),q=(t,e)=>{Z(n=>a(i({},n),{[t]:e}))},{indicatorScore:lt=[],indicatorDetermine:it=[],isTextEdit:Et,dialogSort:I=!1,inputList:yt=[],tagInputListConfigurable:Mt}=m||{},O=G(()=>{var t,e,n;return I?(n=(e=(t=r==null?void 0:r.questionList)==null?void 0:t.textList)==null?void 0:e.map((u,f)=>a(i({},u),{title:f+1})))!=null?n:[]:[]},[r,I]);if(G(()=>Ut(m),[m]))return l.createElement(Qt,null);const Ct=Mt&&((p=yt.filter(t=>!t.isOverall))==null?void 0:p.length)>0,At=(it==null?void 0:it.length)>0||(lt==null?void 0:lt.length)>0||Et||Ct;return l.createElement("div",{className:`${vt}`},l.createElement("div",{className:`${vt}__content`},l.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},j("GlobalAnnotation")),l.createElement(ee,{waitSortList:(x==null?void 0:x.waitSorts)||[],sortList:(x==null?void 0:x.newSort)||[],setSortList:t=>{const e=t.map(n=>n.map(u=>u.id));q("sort",e),F(a(i({},x),{newSort:t}))},disabeledAll:S,title:j("SortConversationQuality"),prefixId:"model"}),(m==null?void 0:m.text)&&l.createElement("div",{style:{padding:"0px 16px",marginTop:"16px"}},l.createElement(Jt,{textAttribute:(z=R==null?void 0:R.textAttribute)!=null?z:[],textConfig:(m==null?void 0:m.text)&&Gt(m.text)?m==null?void 0:m.text:[],setText:t=>q("textAttribute",t),disabeledAll:S})),l.createElement(Nt,{modelData:(Q=(U=r==null?void 0:r.questionList)==null?void 0:U.textList)!=null?Q:[],selectedAnswerSort:t=>q("answerSort",t),selectedSort:(H=(J=D())==null?void 0:J.answerSort)!=null?H:[],ref:W,disabeledAll:S}),g&&l.createElement(l.Fragment,null,l.createElement("div",{style:{fontSize:"18px",fontWeight:500,padding:"0px 16px",marginTop:"16px"}},j("QualifiedAnnotation")),l.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"}},l.createElement(pt,{type:"primary",danger:!0},"\u6B63\u5728\u6807\u6CE8"),l.createElement("div",{style:{padding:16}},"\u7EC4\uFF1A",g.order)),l.createElement("div",null,At&&l.createElement(Ht,{list:(g==null?void 0:g.answerList)||[],LLMConfig:m,updateValue:bt,disabeledAll:S})))),l.createElement("div",{style:{margin:"24px 16px",display:"flex"}},(B==null?void 0:B.length)-1!==M&&l.createElement(pt,{type:"primary",style:{marginLeft:"auto"},onClick:()=>{if(h){h(()=>y(N()));return}y(N())},disabled:S},j("Save"))))},de=c=>({annotation:c.annotation});var ce=It(de,null,null,{context:Dt})(ue);export{ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EDataFormatType as s}from"../../constant/index.js";import{create as
|
|
1
|
+
import{EDataFormatType as s}from"../../constant/index.js";import{create as r}from"zustand";const o=r(e=>({dataFormatType:s.Default,setDataFormatType:t=>e(a=>({dataFormatType:t})),selectedID:"",setSelectedID:t=>e(a=>({selectedID:t})),newAnswerListMap:{},setNewAnswerListMap:t=>e(a=>({newAnswerListMap:t}))}));export{o as default};
|