@labelbee/lb-components 1.24.0-alpha.17 → 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.
- package/dist/components/LLMMultiWheelView/index.js +1 -1
- package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +0 -1
- package/dist/types/components/pointCloudView/hooks/useRotate.d.ts +1 -2
- package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +1 -2
- package/es/components/LLMMultiWheelView/index.js +1 -1
- package/package.json +1 -1
|
@@ -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,questionIsAudio:
|
|
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,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").
|
|
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").
|
|
7
|
+
updateRotateEdge: import("lodash").DebouncedFuncLeading<(angle: number) => void>;
|
|
9
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
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};
|