@labelbee/lb-components 1.22.0-beta.1 → 1.22.0-beta.3
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/NLPToolView/index.js +1 -0
- package/dist/components/NLPToolView/textContent/index.js +1 -0
- package/dist/components/NLPToolView/textContent/remarkMask.js +1 -0
- package/dist/components/NLPToolView/utils/index.js +1 -0
- package/dist/data/enums/ToolType.js +1 -1
- package/dist/hooks/annotation.js +1 -1
- package/dist/index.css +74 -0
- package/dist/index.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/store/ctx.js +1 -1
- package/dist/types/components/NLPToolView/index.d.ts +14 -0
- package/dist/types/components/NLPToolView/textContent/index.d.ts +17 -0
- package/dist/types/components/NLPToolView/textContent/remarkMask.d.ts +12 -0
- package/dist/types/components/NLPToolView/types.d.ts +75 -0
- package/dist/types/components/NLPToolView/utils/index.d.ts +2 -0
- package/dist/types/components/attributeList/index.d.ts +1 -1
- package/dist/types/data/enums/ToolType.d.ts +2 -1
- package/dist/types/hooks/annotation.d.ts +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/store/ctx.d.ts +5 -0
- package/dist/types/views/MainView/NLPLayout/index.d.ts +10 -0
- package/dist/types/views/MainView/sidebar/GeneralOperation/index.d.ts +1 -0
- package/dist/types/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.d.ts +13 -0
- package/dist/types/views/MainView/sidebar/NLPSidebar/index.d.ts +12 -0
- package/dist/types/views/MainView/sidebar/NLPSidebar/indicatorDetermine.d.ts +11 -0
- package/dist/types/views/MainView/sidebar/SwitchAttributeList/index.d.ts +3 -2
- package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/NLP/index.d.ts +6 -0
- package/dist/views/MainView/NLPLayout/index.js +1 -0
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/dist/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -0
- package/dist/views/MainView/sidebar/NLPSidebar/index.js +1 -0
- package/dist/views/MainView/sidebar/NLPSidebar/indicatorDetermine.js +1 -0
- package/dist/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/NLP/index.js +1 -0
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/es/components/NLPToolView/index.js +1 -0
- package/es/components/NLPToolView/textContent/index.js +1 -0
- package/es/components/NLPToolView/textContent/remarkMask.js +1 -0
- package/es/components/NLPToolView/utils/index.js +1 -0
- package/es/data/enums/ToolType.js +1 -1
- package/es/hooks/annotation.js +1 -1
- package/es/index.css +74 -0
- package/es/index.js +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/store/ctx.js +1 -1
- package/es/views/MainView/NLPLayout/index.js +1 -0
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/es/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -0
- package/es/views/MainView/sidebar/NLPSidebar/index.js +1 -0
- package/es/views/MainView/sidebar/NLPSidebar/indicatorDetermine.js +1 -0
- package/es/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
- package/es/views/MainView/sidebar/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/NLP/index.js +1 -0
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var React=require("react"),reactRedux=require("react-redux"),ctx=require("../../store/ctx.js"),index$3=require("../../constant/index.js"),index$2=require("./textContent/index.js"),reactI18next=require("react-i18next"),index$1=require("../../views/MainView/annotationTips/index.js"),reducer=require("../../store/annotation/reducer.js"),index=require("../../utils/index.js"),data=require("../LLMToolView/utils/data.js"),annotation=require("../../hooks/annotation.js"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,n,r)=>n in e?__defProp(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,__spreadValues=(e,n)=>{for(var r in n||(n={}))__hasOwnProp.call(n,r)&&__defNormalProp(e,r,n[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(n))__propIsEnum.call(n,r)&&__defNormalProp(e,r,n[r]);return e},__spreadProps=(e,n)=>__defProps(e,__getOwnPropDescs(n));const NLPViewCls=`${index$3.prefix}-NLPView`,NLPToolView=e=>{const{annotation:n,checkMode:r,tips:_,showTips:L,remarkLayer:b,remark:w}=e,{imgIndex:s,imgList:l,stepList:d,step:f}=n,{highlightKey:A,setHighlightKey:P}=React.useContext(ctx.NLPContext),{toolInstanceRef:a}=annotation.useCustomToolInstance(),[h,y]=React.useState(""),[x,S]=React.useState([]),[j,D]=React.useState([{content:""}]),[i,u]=React.useState({id:1,newText:"",indicatorDetermine:{},textAnnotation:[]}),O=React.useMemo(()=>(i==null?void 0:i.textAnnotation)?i.textAnnotation.filter(t=>x.length===0||x.includes(t.attribute)):[],[i,x]);reactI18next.useTranslation();const v=React.useMemo(()=>{var t;if(d&&f){const o=(t=reducer.getStepConfig(d,f))==null?void 0:t.config;return index.jsonParser(o)}},[d,f]);React.useEffect(()=>{var t;if(!l[s])return;const o=(t=l[s])==null?void 0:t.textData;D(o)},[s,v]),React.useEffect(()=>{var t;if(!l[s])return;const o=(t=l[s])!=null?t:{},c=data.getCurrentResultFromResultList(o==null?void 0:o.result);u(c)},[s]),React.useEffect(()=>{a.current.exportData=()=>[[i],{}],a.current.setResult=t=>u(t),a.current.clearResult=N,a.current.setDefaultAttribute=q,a.current.setHighlightKey=P,a.current.deleteTextAnnotation=C,a.current.setAttributeLockList=T,p()},[i]);const p=()=>{a.current.emit("changeAttributeSidebar"),a.current.emit("changeIndicatorDetermine")},q=t=>{a.current.defaultAttribute=t,y(t),p()},T=t=>{S(t)},N=()=>{u({id:1,newText:"",indicatorDetermine:{},textAnnotation:[]}),p()},C=t=>{u(o=>__spreadProps(__spreadValues({},o),{textAnnotation:o.textAnnotation.filter(c=>c.id!==t)}))},R=t=>{var o;if(t===""||r)return;let c=window.getSelection();const{anchorOffset:m=0,focusOffset:g=0,anchorNode:E,focusNode:I}=c||{};if(E===I){let M=Math.min(m,g),V=Math.max(m,g);u(__spreadProps(__spreadValues({},i),{textAnnotation:[...(i==null?void 0:i.textAnnotation)||[],{id:lbAnnotation.uuid(8,62),start:M,end:V,attribute:h,text:t}]})),(o=window.getSelection())==null||o.empty()}};return React__default.default.createElement("div",{className:NLPViewCls},React__default.default.createElement("div",{className:`${NLPViewCls}-question`},L===!0&&React__default.default.createElement(index$1,{tips:_}),React__default.default.createElement(index$2,{highlightKey:A,textData:j,checkMode:r,NLPConfig:v,textAnnotation:O,onSelectionChange:R,remarkLayer:b,remark:w})))},mapStateToProps=e=>({annotation:e.annotation});var NLPToolView$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(NLPToolView);module.exports=NLPToolView$1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var React=require("react"),reactI18next=require("react-i18next"),lbUtils=require("@labelbee/lb-utils"),index$2=require("../../../constant/index.js"),ahooks=require("ahooks"),_=require("lodash"),lbAnnotation=require("@labelbee/lb-annotation"),styleString=require("../../../constant/styleString.js"),index=require("../utils/index.js"),index$1=require("../../../utils/index.js"),remarkMask=require("./remarkMask.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,r,n)=>r in t?__defProp(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,__spreadValues=(t,r)=>{for(var n in r||(r={}))__hasOwnProp.call(r,n)&&__defNormalProp(t,n,r[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(r))__propIsEnum.call(r,n)&&__defNormalProp(t,n,r[n]);return t};const NLPViewCls=`${index$2.prefix}-NLPView`,renderRemarkModal=({remarkLayer:t,remarkStyle:r,setRemarkStyle:n,setRemarkResut:g,remarkResut:R})=>{if(t)return t({style:r,onClose:()=>{var p;n(void 0),g({}),(p=window.getSelection())==null||p.empty()},submitData:R})},TextContent=t=>{const{highlightKey:r,textData:n,lang:g,checkMode:R=!0,NLPConfig:p,onSelectionChange:b,textAnnotation:k,remark:i}=t,{enableRemark:q,displayRemarkList:f}=i||{},{t:I}=reactI18next.useTranslation(),s=React.useRef(null),y=ahooks.useTextSelection(s),[v,C]=React.useState({}),[w,h]=React.useState(void 0),m=React.useMemo(()=>{var e;return(e=n==null?void 0:n[0])==null?void 0:e.content},[n]),P=React.useMemo(()=>{const e=___default.default.clone(f);return(v==null?void 0:v.start)&&e.push(v),index.getIntervals(m,e!=null?e:[],"remarkAnnotations")},[f,v,m]),O=React.useMemo(()=>index.getIntervals(m,k!=null?k:[],"annotations"),[k,m]),j=(e="")=>{const l=lbAnnotation.CommonToolUtils.jsonParser(styleString);return lbUtils.toolStyleConverter.getColorByConfig({attribute:e,config:p,style:l})};React.useEffect(()=>{var e;g&&((e=lbUtils.i18n)==null||e.changeLanguage(g))},[]),React.useEffect(()=>{q?D(y.text):b==null||b(y.text)},[y.text]),React.useEffect(()=>{if(!(i==null?void 0:i.editAuditID))return;const e=f.filter(a=>a.auditID===i.editAuditID)[0],l=e==null?void 0:e.id,o=document.getElementById(l);if(o&&s.current){const a=o.getBoundingClientRect(),u=s.current.getBoundingClientRect(),c=a.right-u.left,d=a.bottom-u.top-o.offsetHeight;c&&d&&h({left:c,top:d})}},[i==null?void 0:i.editAuditID]);const D=e=>{var l;if(e==="")return;let o=window.getSelection();const{anchorOffset:a=0,focusOffset:u=0,anchorNode:c,focusNode:d}=o||{};if(c===d){let M=Math.min(a,u),N=Math.max(a,u);if(y&&(s==null?void 0:s.current)&&o){const E=(l=s.current)==null?void 0:l.getBoundingClientRect(),S=o.getRangeAt(0).getBoundingClientRect(),x={left:S.right-E.left,top:S.top-E.top};x.left&&x.left&&h(x)}const A={id:lbAnnotation.uuid(8,62),start:M,end:N,text:e};C(A)}};return React__default.default.createElement("div",null,React__default.default.createElement("div",{className:`${NLPViewCls}-question-title`},I("textTool")),React__default.default.createElement("div",{className:index$1.classnames({[`${NLPViewCls}-question-content`]:!0}),style:{position:"relative"},onDoubleClick:e=>{e.preventDefault()}},React__default.default.createElement("div",{style:{position:"relative"}},O.map((e,l)=>{var o;const a=___default.default.last(e.annotations);if(a){const u=j(a.attribute),c=(o=e==null?void 0:e.annotations)==null?void 0:o.find(d=>d.id===r);return React__default.default.createElement("span",{style:{backgroundColor:u.valid.stroke,color:c?"white":void 0,padding:"2px 0px"},key:l},e.text)}else return React__default.default.createElement("span",{key:l},e.text)}),(f==null?void 0:f.length)>0&&React__default.default.createElement(remarkMask,{remarkSplitIntervals:P,remark:i}),renderRemarkModal({remarkLayer:t==null?void 0:t.remarkLayer,setRemarkStyle:h,remarkStyle:w,remarkResut:v,setRemarkResut:C}),React__default.default.createElement("div",{className:`${NLPViewCls}-question-content-mask`,ref:s},m))))},WrapQuestionView=t=>React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(TextContent,__spreadValues({},t)));module.exports=WrapQuestionView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _=require("lodash"),React=require("react");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var ___default=_interopDefaultLegacy(_),React__default=_interopDefaultLegacy(React),RemarkMask=({remarkSplitIntervals:t,remark:l})=>React__default.default.createElement("div",{style:{position:"absolute",top:0,left:0,backgroundColor:"transparent",color:"transparent"}},t.map((e,r)=>{var o;const a=___default.default.last(e.remarkAnnotations),u=((o=e==null?void 0:e.remarkAnnotations)==null?void 0:o.find(n=>(n==null?void 0:n.auditID)===l.hoverAuditID))?"#ffc60a":"#fcdf7e";return a?React__default.default.createElement("span",{style:{borderBottom:`2px solid ${u}`,padding:"2px 0px"},id:a==null?void 0:a.id,key:r},e.text):React__default.default.createElement("span",{key:r},e.text)}));module.exports=RemarkMask;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _=require("lodash");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var ___default=_interopDefaultLegacy(_);const getIntervals=(t,u,o)=>{if(!(t==null?void 0:t.length))return[];const n=___default.default.uniq(___default.default.concat(0,...u.map(e=>[e.start,e.end]),t.length)).sort((e,s)=>e-s),a=[];for(let e=0;e<n.length-1;e++){const s=n[e],r=n[e+1],i=u.filter(l=>l.start>=s&&l.end<=r||s>=l.start&&r<=l.end);a.push({start:s,end:r,[o]:i,text:t.slice(s,r)})}return a};exports.getIntervals=getIntervals;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EScribblePattern=void 0,function(o){o[o.Scribble=1]="Scribble",o[o.Erase=2]="Erase"}(exports.EScribblePattern||(exports.EScribblePattern={})),exports.EToolName=void 0,function(o){o.Rect="rectTool",o.Tag="tagTool",o.Point="pointTool",o.PointMarker="pointMarkerTool",o.Segmentation="segmentationTool",o.Filter="filterTool",o.Text="textTool",o.Polygon="polygonTool",o.Line="lineTool",o.LineMarker="lineMarkerTool",o.Empty="emptyTool",o.FolderTag="folderTagTool",o.RectTrack="rectTrackTool",o.ScribbleTool="scribbleTool",o.Face="faceTool",o.ClientAttribute="clientAttributeTool",o.OCRRelation="OCRRelationTool",o.SegmentByRect="segmentByRectTool",o.Cuboid="cuboidTool",o.PointCloudPolygon="pointCloudPolygon",o.LLM="LLMTool"}(exports.EToolName||(exports.EToolName={})),exports.ETextType=void 0,function(o){o[o.AnyString=0]="AnyString",o[o.Order=1]="Order",o[o.EnglishOnly=2]="EnglishOnly",o[o.NumberOnly=3]="NumberOnly",o[o.CustomFormat=4]="CustomFormat"}(exports.ETextType||(exports.ETextType={}));const TEXT_ATTRIBUTE_MAX_LENGTH=1e3;exports.TEXT_ATTRIBUTE_MAX_LENGTH=TEXT_ATTRIBUTE_MAX_LENGTH;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EScribblePattern=void 0,function(o){o[o.Scribble=1]="Scribble",o[o.Erase=2]="Erase"}(exports.EScribblePattern||(exports.EScribblePattern={})),exports.EToolName=void 0,function(o){o.Rect="rectTool",o.Tag="tagTool",o.Point="pointTool",o.PointMarker="pointMarkerTool",o.Segmentation="segmentationTool",o.Filter="filterTool",o.Text="textTool",o.Polygon="polygonTool",o.Line="lineTool",o.LineMarker="lineMarkerTool",o.Empty="emptyTool",o.FolderTag="folderTagTool",o.RectTrack="rectTrackTool",o.ScribbleTool="scribbleTool",o.Face="faceTool",o.ClientAttribute="clientAttributeTool",o.OCRRelation="OCRRelationTool",o.SegmentByRect="segmentByRectTool",o.Cuboid="cuboidTool",o.PointCloudPolygon="pointCloudPolygon",o.LLM="LLMTool",o.NLP="NLPTool"}(exports.EToolName||(exports.EToolName={})),exports.ETextType=void 0,function(o){o[o.AnyString=0]="AnyString",o[o.Order=1]="Order",o[o.EnglishOnly=2]="EnglishOnly",o[o.NumberOnly=3]="NumberOnly",o[o.CustomFormat=4]="CustomFormat"}(exports.ETextType||(exports.ETextType={}));const TEXT_ATTRIBUTE_MAX_LENGTH=1e3;exports.TEXT_ATTRIBUTE_MAX_LENGTH=TEXT_ATTRIBUTE_MAX_LENGTH;
|
package/dist/hooks/annotation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),ctx=require("../store/ctx.js"),Actions=require("../store/Actions.js");const useCustomToolInstance=({basicInfo:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),ctx=require("../store/ctx.js"),Actions=require("../store/Actions.js");const useCustomToolInstance=({basicInfo:s}={})=>{var o;const u=ctx.useDispatch(),a={valid:(o=s==null?void 0:s.valid)!=null?o:!0,exportData:()=>[[],{}],exportCustomData:()=>({}),clearResult:()=>{},singleOn:()=>{},on:()=>{},unbind:()=>{},setResult:()=>{},history:{initRecord:()=>{},pushHistory:()=>{}},setDefaultAttribute:e=>{},setForbidOperation:()=>{},setShowDefaultCursor:()=>{},setSubAttribute:(e,n)=>{},setValid:()=>{},updateRotate:()=>{},redo:()=>{},undo:()=>{},setPointCloudGlobalPattern:e=>{}},t=React.useRef(a),i=e=>{u({type:Actions.ANNOTATION_ACTIONS.SET_TOOL,payload:{instance:e}})},l=()=>{u({type:Actions.ANNOTATION_ACTIONS.SET_TOOL,payload:{instance:void 0}})},d=()=>{Object.assign(t.current,a)},c=()=>{t.current.emit=e=>{const n=t.current.fns.get(e);n&&n.forEach(r=>{r&&(r==null||r())})},t.current.fns=new Map,t.current.singleOn=(e,n)=>{t.current.fns.set(e,[n])},t.current.on=(e,n)=>{t.current.singleOn(e,n)},t.current.unbindAll=e=>{t.current.fns.delete(e)}};return React.useEffect(()=>(c(),i(t.current),()=>{l()}),[]),{toolInstanceRef:t,clearToolInstance:d,initEventEmitter:c}};exports.useCustomToolInstance=useCustomToolInstance;
|
package/dist/index.css
CHANGED
|
@@ -2952,6 +2952,80 @@
|
|
|
2952
2952
|
background-color: #eeefff;
|
|
2953
2953
|
}
|
|
2954
2954
|
|
|
2955
|
+
/** NLP style */
|
|
2956
|
+
.bee-NLPLayout {
|
|
2957
|
+
overflow: hidden;
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
.bee-NLPView {
|
|
2961
|
+
height: 100%;
|
|
2962
|
+
background-color: #ffffff;
|
|
2963
|
+
overflow-y: auto;
|
|
2964
|
+
flex: auto;
|
|
2965
|
+
padding: 26px 32px;
|
|
2966
|
+
line-height: 26px;
|
|
2967
|
+
}
|
|
2968
|
+
|
|
2969
|
+
.bee-NLPView-question {
|
|
2970
|
+
flex: 1;
|
|
2971
|
+
overflow: hidden;
|
|
2972
|
+
}
|
|
2973
|
+
.bee-NLPView-question-title {
|
|
2974
|
+
font-weight: 500;
|
|
2975
|
+
font-size: 18px;
|
|
2976
|
+
margin-bottom: 24px;
|
|
2977
|
+
}
|
|
2978
|
+
.bee-NLPView-question-content {
|
|
2979
|
+
font-size: 14px;
|
|
2980
|
+
font-weight: 400;
|
|
2981
|
+
background-color: #f5f5f5;
|
|
2982
|
+
border-radius: 4px;
|
|
2983
|
+
padding: 8px;
|
|
2984
|
+
}
|
|
2985
|
+
.bee-NLPView-question-content-mask {
|
|
2986
|
+
position: absolute;
|
|
2987
|
+
left: 0px;
|
|
2988
|
+
top: 0px;
|
|
2989
|
+
background-color: transparent;
|
|
2990
|
+
color: transparent;
|
|
2991
|
+
z-index: 10;
|
|
2992
|
+
opacity: 1;
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
.bee-sidebar__content__NLPList {
|
|
2996
|
+
display: flex;
|
|
2997
|
+
flex-direction: column;
|
|
2998
|
+
}
|
|
2999
|
+
.bee-sidebar__content__NLPList__item {
|
|
3000
|
+
display: flex;
|
|
3001
|
+
align-items: center;
|
|
3002
|
+
cursor: pointer;
|
|
3003
|
+
}
|
|
3004
|
+
.bee-sidebar__content__NLPList__item .bee-sidebar-pop-remove {
|
|
3005
|
+
margin: 0px 16px;
|
|
3006
|
+
display: none;
|
|
3007
|
+
}
|
|
3008
|
+
.bee-sidebar__content__NLPList__item:hover .bee-sidebar-pop-remove {
|
|
3009
|
+
display: block;
|
|
3010
|
+
}
|
|
3011
|
+
.bee-sidebar__content__NLPList__item__text {
|
|
3012
|
+
flex: 1 1;
|
|
3013
|
+
padding: 16px;
|
|
3014
|
+
font-weight: 400;
|
|
3015
|
+
font-size: 12px;
|
|
3016
|
+
line-height: 20px;
|
|
3017
|
+
color: #666666;
|
|
3018
|
+
overflow: hidden;
|
|
3019
|
+
text-overflow: ellipsis;
|
|
3020
|
+
white-space: nowrap;
|
|
3021
|
+
}
|
|
3022
|
+
.bee-sidebar__content__NLPList__item__active {
|
|
3023
|
+
background-color: #eeefff;
|
|
3024
|
+
}
|
|
3025
|
+
.bee-sidebar__content__NLPList__item__active__text {
|
|
3026
|
+
color: #666fff;
|
|
3027
|
+
}
|
|
3028
|
+
|
|
2955
3029
|
/** longText style */
|
|
2956
3030
|
.bee-longText {
|
|
2957
3031
|
display: flex;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$1=require("./components/AnnotationView/index.js"),pointCloudAnnotationView=require("./components/AnnotationView/pointCloudAnnotationView.js"),index$2=require("./components/LLMToolView/questionView/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),App=require("./App.js"),configureStore=require("./configureStore.js"),actionCreators=require("./store/annotation/actionCreators.js"),TagToolInstanceAdaptorI18nProvider=require("./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js"),PointCloudContext=require("./components/pointCloudView/PointCloudContext.js"),ctx=require("./store/ctx.js"),index$
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$1=require("./components/AnnotationView/index.js"),pointCloudAnnotationView=require("./components/AnnotationView/pointCloudAnnotationView.js"),index$2=require("./components/LLMToolView/questionView/index.js"),index$3=require("./components/NLPToolView/textContent/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactI18next=require("react-i18next"),reactRedux=require("react-redux"),App=require("./App.js"),configureStore=require("./configureStore.js"),actionCreators=require("./store/annotation/actionCreators.js"),TagToolInstanceAdaptorI18nProvider=require("./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js"),PointCloudContext=require("./components/pointCloudView/PointCloudContext.js"),ctx=require("./store/ctx.js"),index$5=require("./components/predictTracking/predictTrackingIcon/index.js"),index$4=require("./components/LLMToolView/index.js"),index$6=require("./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js"),index$7=require("./components/measureCanvas/index.js"),index$8=require("./constant/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const store=configureStore(),OutputApp=(e,t)=>{const[r,a]=React.useState();return React.useImperativeHandle(t,()=>({toolInstance:r,annotationEngine:store.getState().annotation.annotationEngine,pageBackwardActions:()=>store.dispatch(actionCreators.PageBackward()),pageForwardActions:()=>store.dispatch(actionCreators.PageForward()),pageJump:o=>{const n=~~o-1;store.dispatch(actionCreators.PageJump(n))},hello:()=>alert("hello labelBee!!!")}),[r]),React__default.default.createElement(reactRedux.Provider,{store,context:ctx.LabelBeeContext},React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(PointCloudContext.PointCloudProvider,null,React__default.default.createElement(App,__spreadProps(__spreadValues({},e),{setToolInstance:o=>{var n;a(o),(n=e.onLoad)==null||n.call(e,{toolInstance:o})}})))))};var index=React__default.default.forwardRef(OutputApp);exports.AnnotationView=index$1,exports.PointCloudAnnotationView=pointCloudAnnotationView,exports.QuestionView=index$2.default,exports.TextContent=index$3,Object.defineProperty(exports,"i18n",{enumerable:!0,get:function(){return lbUtils.i18n}}),exports.VideoTagTool=TagToolInstanceAdaptorI18nProvider.VideoTagTool,exports.PredictTracking=index$5,exports.LLMToolView=index$4,exports.SwitchCuboidBoxIn2DView=index$6,exports.MeasureCanvas=index$7,Object.defineProperty(exports,"EDataFormatType",{enumerable:!0,get:function(){return index$8.EDataFormatType}}),Object.defineProperty(exports,"ELLMDataType",{enumerable:!0,get:function(){return index$8.ELLMDataType}}),Object.defineProperty(exports,"EStepType",{enumerable:!0,get:function(){return index$8.EStepType}}),Object.defineProperty(exports,"ESubmitType",{enumerable:!0,get:function(){return index$8.ESubmitType}}),exports.componentCls=index$8.componentCls,exports.prefix=index$8.prefix,exports.default=index,exports.store=store;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$2=require("../../components/customResizeHook/index.js"),index$1=require("../../constant/index.js"),styleString=require("../../constant/styleString.js"),Actions=require("../Actions.js"),index=require("../../utils/index.js"),AnnotationDataUtils=require("../../utils/AnnotationDataUtils.js"),ConfigUtils=require("../../utils/ConfigUtils.js"),data=require("../../utils/data.js"),StepUtils=require("../../utils/StepUtils.js"),ToolUtils=require("../../utils/ToolUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),antd=require("antd"),es=require("antd/es"),_=require("lodash"),actionCreators=require("./actionCreators.js"),ToolType=require("../../data/enums/ToolType.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,s)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,__spreadValues=(e,t)=>{for(var s in t||(t={}))__hasOwnProp.call(t,s)&&__defNormalProp(e,s,t[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(t))__propIsEnum.call(t,s)&&__defNormalProp(e,s,t[s]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,s)=>new Promise((O,a)=>{var A=I=>{try{S(s.next(I))}catch(m){a(m)}},g=I=>{try{S(s.throw(I))}catch(m){a(m)}},S=I=>I.done?O(I.value):Promise.resolve(I.value).then(A,g);S((s=s.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(s=>s.step===t),initialState={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},getTotalPage=e=>{const{imgList:t,imgPageSize:s}=e;return Math.ceil(t.length/s)},calcStepProgress=(e,t)=>e.reduce((s,O)=>{if(O){const a=O.result;if(index.jsonParser(a)[`step_${t}`])return s+1}return s},0)/e.length,updateToolInstance=(e,t)=>{const{step:s,stepList:O}=e,a=StepUtils.getCurrentStepInfo(s,O),A=ConfigUtils.ConfigUtils.jsonParser(a.config);if(ToolUtils.isVideoTool(a==null?void 0:a.tool)||ToolUtils.isAudioTool(a==null?void 0:a.tool)||ToolUtils.isPointCloudTool(a==null?void 0:a.tool)||ToolType.EToolName.LLM===(a==null?void 0:a.tool))return;const g=document.getElementById("toolContainer");if(!g)throw"Not exist dom named id-toolContainer";const S=index$2.getFormatSize({width:window.innerWidth,height:window.innerHeight}),I=new lbAnnotation.AnnotationEngine({container:g,toolName:a.tool,size:S,imgNode:t,config:A,style:JSON.parse(styleString)});return{toolInstance:I==null?void 0:I.toolInstance,annotationEngine:I}},LoadFileAndFileData=(e,t)=>(s,O)=>__async(void 0,null,function*(){var a;const{stepList:A,step:g}=O().annotation,S=StepUtils.currentToolIsVideo(g,A),I=StepUtils.currentToolIsPointCloud(g,A),m=((a=StepUtils.getCurrentStepInfo(g,A))==null?void 0:a.tool)===ToolType.EToolName.LLM,D=StepUtils.currentToolIsAudio(g,A);if(actionCreators.SetAnnotationLoading(s,!0),yield s(TryGetFileDataByAPI(e)),S){s(AfterVideoLoaded(e));return}if(I||m||D){s(AfterCommonLoaded(e));return}s(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,s)=>__async(void 0,null,function*(){const{getFileData:O,imgList:a}=s().annotation;if(O){const A=yield O(a[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:A,index:e}})}}),AfterVideoLoaded=e=>t=>{t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterCommonLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(s,O)=>{var a;const{toolInstance:A,imgList:g}=O().annotation,S=(a=g==null?void 0:g[e])==null?void 0:a.url;lbAnnotation.ImgUtils.load(S).then(I=>{actionCreators.SetAnnotationLoading(s,!1),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:I,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(s,!1),A==null||A.setErrorImg(),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},composeResultByToolInstance=({toolInstance:e,imgList:t,imgIndex:s,stepList:O,step:a=1})=>{var A,g,S,I;const m=((A=t[s])==null?void 0:A.result)||"",[D,b,U]=(g=e==null?void 0:e.exportData())!=null?g:[],x=(I=(S=e==null?void 0:e.exportCustomData)==null?void 0:S.call(e))!=null?I:{},B=data.composeResultWithBasicImgInfo(m,b),w=data.composeResult(B,{step:a,stepList:O},{rect:D},x);return t.map((R,F)=>F===s?__spreadValues(__spreadProps(__spreadValues({},R),{result:w}),U):__spreadValues({},R))},annotationReducer=(e=__spreadValues({},initialState),t)=>{var s,O,a,A,g,S,I,m,D,b,U,x,B,w,R,F,G,V,M,q,k,H,z,K,W;switch(t.type){case Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE:return __spreadValues(__spreadValues({},e),initialState);case Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE:return __spreadProps(__spreadValues({},e),{toolInstance:t.payload.toolInstance});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST:return __spreadProps(__spreadValues({},e),{imgList:t.payload.imgList});case Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS:{const{imgList:n,step:o}=e,i=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:i})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:i,stepList:l,toolInstance:u,onSubmit:r,resultList:N}=e;if(!u||!n[o])return e;const d=((s=n[o])==null?void 0:s.result)||"",[,c,T]=(O=u==null?void 0:u.exportData())!=null?O:[],p=(A=(a=u==null?void 0:u.exportCustomData)==null?void 0:a.call(u))!=null?A:{},f=data.composeResultWithBasicImgInfo(d,c),C=data.composeResult(f,{step:i,stepList:l},{rect:N},p),L=e.imgList.map((v,E)=>{if(E===o){const h=AnnotationDataUtils.dataCorrection(C,d,i,l);return __spreadValues(__spreadProps(__spreadValues({},v),{result:h}),T)}return v});if(((g=t.payload)==null?void 0:g.submitType)===index$1.ESubmitType.SyncImgList)return __spreadProps(__spreadValues({},e),{imgList:L});r&&r([L[o]],(S=t.payload)==null?void 0:S.submitType,o,L);const y=calcStepProgress(L,i);return __spreadProps(__spreadValues({},e),{stepProgress:y,imgList:L})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:i}=e;return i==null||i(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:i,toolInstance:l,basicResultList:u}=e;if(!l)return e;const[r]=(I=l==null?void 0:l.exportData())!=null?I:[];let N=r;if((u==null?void 0:u.length)>0){const d=(m=u[o])==null?void 0:m.id,c=r.map(T=>__spreadProps(__spreadValues({},T),{sourceID:d}));N=___default.default.cloneDeep(i).filter(T=>T.sourceID!==d),N.push(...c)}return __spreadProps(__spreadValues({},e),{resultList:N,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:i,imgIndex:l,stepList:u,annotationEngine:r,resultList:N,basicResultList:d}=e;if(!n||!r)return e;const c=t.payload.basicIndex,T=(D=d[c])==null?void 0:D.id,p=index.jsonParser((b=i[l])==null?void 0:b.result),f=(N||[]).filter(h=>h.sourceID===T),C=getStepConfig(u,o),{dataSourceStep:L,tool:y}=C,v=getStepConfig(u,L);let E=[];return L&&y&&(E=(U=p[`step_${L}`])==null?void 0:U.result,(E==null?void 0:E.length)>0?(r==null||r.setBasicInfo(v.tool,E[c]),r==null||r.launchOperation()):(r==null||r.setBasicInfo(v.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:c})}case Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=t.payload;return __spreadProps(__spreadValues({},e),{triggerEventAfterIndexChanged:!!n})}case Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA:{const{imgList:n,step:o,toolInstance:i,annotationEngine:l,stepList:u}=e;if(!i)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const r=StepUtils.getCurrentStepInfo(o,u),{nextIndex:N,imgNode:d,nextBasicIndex:c,imgError:T}=t.payload,p=c!=null?c:0,f=index.jsonParser((x=n[N])==null?void 0:x.result),C=f[`step_${r.step}`],L=!C,y={rotate:(B=f.rotate)!=null?B:0,valid:(w=f.valid)!=null?w:!0};d&&T!==!0?l==null||l.setImgNode(d,y):i==null||i.setValid(y.valid);const v=getStepConfig(u,r.step),{dataSourceStep:E,tool:h}=v,$=getStepConfig(u,E),Y=E&&h,P=(F=(R=f[`step_${E}`])==null?void 0:R.result)!=null?F:[],j=AnnotationDataUtils.getInitialResultList(C==null?void 0:C.result,i,v,P,L);if(l==null||l.launchOperation(),Y&&((P==null?void 0:P.length)>0?l==null||l.setBasicInfo($.tool,P[p]):(l==null||l.setBasicInfo($.tool),l==null||l.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),r.tool!=="check"){const J=(V=(G=P[p])==null?void 0:G.id)!=null?V:"",X=Y?j.filter(Z=>lbAnnotation.CommonToolUtils.isSameSourceID(Z.sourceID,J)):j;(M=i==null?void 0:i.history)==null||M.initRecord(j,!0),i==null||i.setResult(X)}return __spreadProps(__spreadValues({},e),{imgIndex:N,basicIndex:p,basicResultList:P,resultList:j})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(q=t.payload.config)!=null?q:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST:{const{stepList:n}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n})}case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:o}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:o})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,o=updateToolInstance(e,n);if(o){const{toolInstance:i,annotationEngine:l}=o;return __spreadProps(__spreadValues({},e),{toolInstance:i,annotationEngine:l})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(k=t.payload)==null?void 0:k.instance;return n?__spreadProps(__spreadValues({},e),{toolInstance:n}):__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT:return __spreadProps(__spreadValues({},e),{onSubmit:t.payload.onSubmit});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE:return __spreadProps(__spreadValues({},e),{onSave:t.payload.onSave});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE:return __spreadProps(__spreadValues({},e),{onPageChange:t.payload.onPageChange});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT:return __spreadProps(__spreadValues({},e),{predictionResult:t.payload.result});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE:return __spreadProps(__spreadValues({},e),{predictionResultVisible:t.payload.visible});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE:return __spreadProps(__spreadValues({},e),{onStepChange:t.payload.onStepChange});case Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA:return __spreadProps(__spreadValues({},e),{getFileData:t.payload.getFileData});case Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE:return __spreadProps(__spreadValues({},e),{pageSize:t.payload.pageSize});case Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST:return __spreadProps(__spreadValues({},e),{loadFileList:t.payload.loadFileList});case Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE:return __spreadProps(__spreadValues({},e),{beforeRotate:t.payload.beforeRotate});case Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS:return __spreadProps(__spreadValues({},e),{preDataProcess:t.payload.preDataProcess});case Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING:return __spreadProps(__spreadValues({},e),{skipBeforePageTurning:t.payload.skipBeforePageTurning});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:o}=t.payload,{imgList:i}=e,l=[...i];return l[o]=__spreadValues(__spreadValues({},l[o]),n),__spreadProps(__spreadValues({},e),{imgList:l})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:o}=e;return o&&o()===!1||(H=n==null?void 0:n.updateRotate)==null||H.call(n),e}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=e,o=(z=n==null?void 0:n.valid)!=null?z:!0;return antd.Modal.destroyAll(),antd.Modal.confirm({content:lbUtils.i18n.t(o?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!o)},okText:lbUtils.i18n.t("Confirm"),cancelText:lbUtils.i18n.t("Cancel")}),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:o,imgList:i,step:l}=e;if(!n)return e;if(o===0||o>=i.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const u=i[o-1].result;if(!u)return e;const r=AnnotationDataUtils.copyResultChange(u,l,(K=i[o].result)!=null?K:"");i[o]=__spreadProps(__spreadValues({},i[o]),{result:r});const d=index.jsonParser(r)[`step_${l}`],c=(d==null?void 0:d.result)||[];return n==null||n.setResult(c),n==null||n.history.pushHistory(c),(W=n==null?void 0:n.asyncData)==null||W.call(n,i[o]),__spreadProps(__spreadValues({},e),{imgList:[...i]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:o}=e,{toStep:i}=t.payload;if(!o)return e;const l=getStepConfig(n,i);return o==null||o.setToolName(l.tool,l.config),__spreadProps(__spreadValues({},e),{step:i,toolInstance:o==null?void 0:o.toolInstance})}case Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loadPCDFileLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{pointCloudLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE:{const{checkMode:n}=t.payload;return __spreadProps(__spreadValues({},e),{checkMode:!!n})}case Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=t.payload;return __spreadProps(__spreadValues({},e),{highlightAttribute:n})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:o,rangeIndex:i,imgList:l}=t.payload,{imgIndex:u,onSubmit:r}=e,N=[],d=l.map((c,T)=>{if(lbAnnotation.MathUtils.isInRange(T,i)){const p=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateTrackID({id:n,newID:o,result:c.result})});return N.push({imgIndex:T,newInfo:p}),p}return c});return r&&r([d[u]],index$1.ESubmitType.BatchUpdateTrackID,u,d,{updateImgList:N}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:o,rangeIndex:i}=t.payload,{imgList:l,imgIndex:u,onSubmit:r}=e,N=[],d=l.map((c,T)=>{if(lbAnnotation.MathUtils.isInRange(T,i)){const p=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateResultByTrackID({id:n,newData:o,result:c.result})});return N.push({imgIndex:T,newInfo:p}),p}return c});return r&&r([d[u]],index$1.ESubmitType.BatchUpdateTrackID,u,d,{updateImgList:N}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:o,stepList:i,step:l,predictionResult:u}=e,r={};u.forEach(T=>{const{index:p}=T;r[p]=___default.default.pick(T,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const N=`step_${l}`,d=[],c=o.map((T,p)=>{if(r[p]){const f=T.result==="{}"?index.jsonParser(data.composeResult("",{step:l,stepList:i},{rect:[]},{})):index.jsonParser(T.result);f[N].result.push(r[p]);const C=__spreadProps(__spreadValues({},T),{result:JSON.stringify(f)});return d.push({imgIndex:p,newInfo:C}),C}return T});return n==null||n(c,index$1.ESubmitType.BatchUpdateImgList,-1,c,{updateImgList:d}),__spreadProps(__spreadValues({},e),{imgList:c})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.composeResultByToolInstance=composeResultByToolInstance,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$2=require("../../components/customResizeHook/index.js"),index$1=require("../../constant/index.js"),styleString=require("../../constant/styleString.js"),Actions=require("../Actions.js"),index=require("../../utils/index.js"),AnnotationDataUtils=require("../../utils/AnnotationDataUtils.js"),ConfigUtils=require("../../utils/ConfigUtils.js"),data=require("../../utils/data.js"),StepUtils=require("../../utils/StepUtils.js"),ToolUtils=require("../../utils/ToolUtils.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),antd=require("antd"),es=require("antd/es"),_=require("lodash"),actionCreators=require("./actionCreators.js"),ToolType=require("../../data/enums/ToolType.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,s)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,__spreadValues=(e,t)=>{for(var s in t||(t={}))__hasOwnProp.call(t,s)&&__defNormalProp(e,s,t[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(t))__propIsEnum.call(t,s)&&__defNormalProp(e,s,t[s]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,s)=>new Promise((g,u)=>{var S=I=>{try{N(s.next(I))}catch(m){u(m)}},A=I=>{try{N(s.throw(I))}catch(m){u(m)}},N=I=>I.done?g(I.value):Promise.resolve(I.value).then(S,A);N((s=s.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(s=>s.step===t),initialState={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},getTotalPage=e=>{const{imgList:t,imgPageSize:s}=e;return Math.ceil(t.length/s)},calcStepProgress=(e,t)=>e.reduce((s,g)=>{if(g){const u=g.result;if(index.jsonParser(u)[`step_${t}`])return s+1}return s},0)/e.length,updateToolInstance=(e,t)=>{const{step:s,stepList:g}=e,u=StepUtils.getCurrentStepInfo(s,g),S=ConfigUtils.ConfigUtils.jsonParser(u.config);if(ToolUtils.isVideoTool(u==null?void 0:u.tool)||ToolUtils.isAudioTool(u==null?void 0:u.tool)||ToolUtils.isPointCloudTool(u==null?void 0:u.tool)||[ToolType.EToolName.LLM,ToolType.EToolName.NLP].includes(u==null?void 0:u.tool))return;const A=document.getElementById("toolContainer");if(!A)throw"Not exist dom named id-toolContainer";const N=index$2.getFormatSize({width:window.innerWidth,height:window.innerHeight}),I=new lbAnnotation.AnnotationEngine({container:A,toolName:u.tool,size:N,imgNode:t,config:S,style:JSON.parse(styleString)});return{toolInstance:I==null?void 0:I.toolInstance,annotationEngine:I}},LoadFileAndFileData=(e,t)=>(s,g)=>__async(void 0,null,function*(){var u,S;const{stepList:A,step:N}=g().annotation,I=StepUtils.currentToolIsVideo(N,A),m=StepUtils.currentToolIsPointCloud(N,A),D=((u=StepUtils.getCurrentStepInfo(N,A))==null?void 0:u.tool)===ToolType.EToolName.LLM,y=((S=StepUtils.getCurrentStepInfo(N,A))==null?void 0:S.tool)===ToolType.EToolName.NLP,P=StepUtils.currentToolIsAudio(N,A);if(actionCreators.SetAnnotationLoading(s,!0),yield s(TryGetFileDataByAPI(e)),I){s(AfterVideoLoaded(e));return}if(m||D||P||y){s(AfterCommonLoaded(e));return}s(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,s)=>__async(void 0,null,function*(){const{getFileData:g,imgList:u}=s().annotation;if(g){const S=yield g(u[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:S,index:e}})}}),AfterVideoLoaded=e=>t=>{t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterCommonLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(s,g)=>{var u;const{toolInstance:S,imgList:A}=g().annotation,N=(u=A==null?void 0:A[e])==null?void 0:u.url;lbAnnotation.ImgUtils.load(N).then(I=>{actionCreators.SetAnnotationLoading(s,!1),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:I,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(s,!1),S==null||S.setErrorImg(),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},composeResultByToolInstance=({toolInstance:e,imgList:t,imgIndex:s,stepList:g,step:u=1})=>{var S,A,N,I;const m=((S=t[s])==null?void 0:S.result)||"",[D,y,P]=(A=e==null?void 0:e.exportData())!=null?A:[],x=(I=(N=e==null?void 0:e.exportCustomData)==null?void 0:N.call(e))!=null?I:{},B=data.composeResultWithBasicImgInfo(m,y),w=data.composeResult(B,{step:u,stepList:g},{rect:D},x);return t.map((b,F)=>F===s?__spreadValues(__spreadProps(__spreadValues({},b),{result:w}),P):__spreadValues({},b))},annotationReducer=(e=__spreadValues({},initialState),t)=>{var s,g,u,S,A,N,I,m,D,y,P,x,B,w,b,F,G,V,M,q,k,H,z,K,W;switch(t.type){case Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE:return __spreadValues(__spreadValues({},e),initialState);case Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE:return __spreadProps(__spreadValues({},e),{toolInstance:t.payload.toolInstance});case Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST:return __spreadProps(__spreadValues({},e),{imgList:t.payload.imgList});case Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS:{const{imgList:n,step:o}=e,l=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:l})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:l,stepList:i,toolInstance:a,onSubmit:r,resultList:p}=e;if(!a||!n[o])return e;const d=((s=n[o])==null?void 0:s.result)||"",[,c,T]=(g=a==null?void 0:a.exportData())!=null?g:[],O=(S=(u=a==null?void 0:a.exportCustomData)==null?void 0:u.call(a))!=null?S:{},f=data.composeResultWithBasicImgInfo(d,c),C=data.composeResult(f,{step:l,stepList:i},{rect:p},O),L=e.imgList.map((v,E)=>{if(E===o){const U=AnnotationDataUtils.dataCorrection(C,d,l,i);return __spreadValues(__spreadProps(__spreadValues({},v),{result:U}),T)}return v});if(((A=t.payload)==null?void 0:A.submitType)===index$1.ESubmitType.SyncImgList)return __spreadProps(__spreadValues({},e),{imgList:L});r&&r([L[o]],(N=t.payload)==null?void 0:N.submitType,o,L);const R=calcStepProgress(L,l);return __spreadProps(__spreadValues({},e),{stepProgress:R,imgList:L})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:l}=e;return l==null||l(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:l,toolInstance:i,basicResultList:a}=e;if(!i)return e;const[r]=(I=i==null?void 0:i.exportData())!=null?I:[];let p=r;if((a==null?void 0:a.length)>0){const d=(m=a[o])==null?void 0:m.id,c=r.map(T=>__spreadProps(__spreadValues({},T),{sourceID:d}));p=___default.default.cloneDeep(l).filter(T=>T.sourceID!==d),p.push(...c)}return __spreadProps(__spreadValues({},e),{resultList:p,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:l,imgIndex:i,stepList:a,annotationEngine:r,resultList:p,basicResultList:d}=e;if(!n||!r)return e;const c=t.payload.basicIndex,T=(D=d[c])==null?void 0:D.id,O=index.jsonParser((y=l[i])==null?void 0:y.result),f=(p||[]).filter(U=>U.sourceID===T),C=getStepConfig(a,o),{dataSourceStep:L,tool:R}=C,v=getStepConfig(a,L);let E=[];return L&&R&&(E=(P=O[`step_${L}`])==null?void 0:P.result,(E==null?void 0:E.length)>0?(r==null||r.setBasicInfo(v.tool,E[c]),r==null||r.launchOperation()):(r==null||r.setBasicInfo(v.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:c})}case Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:n}=t.payload;return __spreadProps(__spreadValues({},e),{triggerEventAfterIndexChanged:!!n})}case Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA:{const{imgList:n,step:o,toolInstance:l,annotationEngine:i,stepList:a}=e;if(!l)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const r=StepUtils.getCurrentStepInfo(o,a),{nextIndex:p,imgNode:d,nextBasicIndex:c,imgError:T}=t.payload,O=c!=null?c:0,f=index.jsonParser((x=n[p])==null?void 0:x.result),C=f[`step_${r.step}`],L=!C,R={rotate:(B=f.rotate)!=null?B:0,valid:(w=f.valid)!=null?w:!0};d&&T!==!0?i==null||i.setImgNode(d,R):l==null||l.setValid(R.valid);const v=getStepConfig(a,r.step),{dataSourceStep:E,tool:U}=v,$=getStepConfig(a,E),Y=E&&U,h=(F=(b=f[`step_${E}`])==null?void 0:b.result)!=null?F:[],j=AnnotationDataUtils.getInitialResultList(C==null?void 0:C.result,l,v,h,L);if(i==null||i.launchOperation(),Y&&((h==null?void 0:h.length)>0?i==null||i.setBasicInfo($.tool,h[O]):(i==null||i.setBasicInfo($.tool),i==null||i.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),r.tool!=="check"){const J=(V=(G=h[O])==null?void 0:G.id)!=null?V:"",X=Y?j.filter(Z=>lbAnnotation.CommonToolUtils.isSameSourceID(Z.sourceID,J)):j;(M=l==null?void 0:l.history)==null||M.initRecord(j,!0),l==null||l.setResult(X)}return __spreadProps(__spreadValues({},e),{imgIndex:p,basicIndex:O,basicResultList:h,resultList:j})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(q=t.payload.config)!=null?q:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST:{const{stepList:n}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n})}case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:o}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:o})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,o=updateToolInstance(e,n);if(o){const{toolInstance:l,annotationEngine:i}=o;return __spreadProps(__spreadValues({},e),{toolInstance:l,annotationEngine:i})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(k=t.payload)==null?void 0:k.instance;return n?__spreadProps(__spreadValues({},e),{toolInstance:n}):__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT:return __spreadProps(__spreadValues({},e),{onSubmit:t.payload.onSubmit});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE:return __spreadProps(__spreadValues({},e),{onSave:t.payload.onSave});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE:return __spreadProps(__spreadValues({},e),{onPageChange:t.payload.onPageChange});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT:return __spreadProps(__spreadValues({},e),{predictionResult:t.payload.result});case Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE:return __spreadProps(__spreadValues({},e),{predictionResultVisible:t.payload.visible});case Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE:return __spreadProps(__spreadValues({},e),{onStepChange:t.payload.onStepChange});case Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA:return __spreadProps(__spreadValues({},e),{getFileData:t.payload.getFileData});case Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE:return __spreadProps(__spreadValues({},e),{pageSize:t.payload.pageSize});case Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST:return __spreadProps(__spreadValues({},e),{loadFileList:t.payload.loadFileList});case Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE:return __spreadProps(__spreadValues({},e),{beforeRotate:t.payload.beforeRotate});case Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS:return __spreadProps(__spreadValues({},e),{preDataProcess:t.payload.preDataProcess});case Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING:return __spreadProps(__spreadValues({},e),{skipBeforePageTurning:t.payload.skipBeforePageTurning});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:o}=t.payload,{imgList:l}=e,i=[...l];return i[o]=__spreadValues(__spreadValues({},i[o]),n),__spreadProps(__spreadValues({},e),{imgList:i})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n,beforeRotate:o}=e;return o&&o()===!1||(H=n==null?void 0:n.updateRotate)==null||H.call(n),e}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_VALID:{const{toolInstance:n}=e,o=(z=n==null?void 0:n.valid)!=null?z:!0;return antd.Modal.destroyAll(),antd.Modal.confirm({content:lbUtils.i18n.t(o?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{n==null||n.setValid(!o)},okText:lbUtils.i18n.t("Confirm"),cancelText:lbUtils.i18n.t("Cancel")}),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:o,imgList:l,step:i}=e;if(!n)return e;if(o===0||o>=l.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const a=l[o-1].result;if(!a)return e;const r=AnnotationDataUtils.copyResultChange(a,i,(K=l[o].result)!=null?K:"");l[o]=__spreadProps(__spreadValues({},l[o]),{result:r});const d=index.jsonParser(r)[`step_${i}`],c=(d==null?void 0:d.result)||[];return n==null||n.setResult(c),n==null||n.history.pushHistory(c),(W=n==null?void 0:n.asyncData)==null||W.call(n,l[o]),__spreadProps(__spreadValues({},e),{imgList:[...l]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:o}=e,{toStep:l}=t.payload;if(!o)return e;const i=getStepConfig(n,l);return o==null||o.setToolName(i.tool,i.config),__spreadProps(__spreadValues({},e),{step:l,toolInstance:o==null?void 0:o.toolInstance})}case Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loadPCDFileLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{pointCloudLoading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE:{const{checkMode:n}=t.payload;return __spreadProps(__spreadValues({},e),{checkMode:!!n})}case Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:n}=t.payload;return __spreadProps(__spreadValues({},e),{highlightAttribute:n})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID:{const{id:n,newID:o,rangeIndex:l,imgList:i}=t.payload,{imgIndex:a,onSubmit:r}=e,p=[],d=i.map((c,T)=>{if(lbAnnotation.MathUtils.isInRange(T,l)){const O=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateTrackID({id:n,newID:o,result:c.result})});return p.push({imgIndex:T,newInfo:O}),O}return c});return r&&r([d[a]],index$1.ESubmitType.BatchUpdateTrackID,a,d,{updateImgList:p}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:n,newData:o,rangeIndex:l}=t.payload,{imgList:i,imgIndex:a,onSubmit:r}=e,p=[],d=i.map((c,T)=>{if(lbAnnotation.MathUtils.isInRange(T,l)){const O=__spreadProps(__spreadValues({},c),{result:lbUtils.PointCloudUtils.batchUpdateResultByTrackID({id:n,newData:o,result:c.result})});return p.push({imgIndex:T,newInfo:O}),O}return c});return r&&r([d[a]],index$1.ESubmitType.BatchUpdateTrackID,a,d,{updateImgList:p}),__spreadProps(__spreadValues({},e),{imgList:d})}case Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:n,imgList:o,stepList:l,step:i,predictionResult:a}=e,r={};a.forEach(T=>{const{index:O}=T;r[O]=___default.default.pick(T,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const p=`step_${i}`,d=[],c=o.map((T,O)=>{if(r[O]){const f=T.result==="{}"?index.jsonParser(data.composeResult("",{step:i,stepList:l},{rect:[]},{})):index.jsonParser(T.result);f[p].result.push(r[O]);const C=__spreadProps(__spreadValues({},T),{result:JSON.stringify(f)});return d.push({imgIndex:O,newInfo:C}),C}return T});return n==null||n(c,index$1.ESubmitType.BatchUpdateImgList,-1,c,{updateImgList:d}),__spreadProps(__spreadValues({},e),{imgList:c})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.composeResultByToolInstance=composeResultByToolInstance,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
|
package/dist/store/ctx.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const LabelBeeContext=React__default.default.createContext(void 0),useDispatch=reactRedux.createDispatchHook(LabelBeeContext),useSelector=reactRedux.createSelectorHook(LabelBeeContext),LLMContext=React__default.default.createContext({hoverKey:-1,newAnswerList:[],setHoverKey:()=>{},modelAPIResponse:[],setModelAPIResponse:()=>{},setNewAnswerList:()=>{}});exports.LLMContext=LLMContext,exports.LabelBeeContext=LabelBeeContext,exports.useDispatch=useDispatch,exports.useSelector=useSelector;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const LabelBeeContext=React__default.default.createContext(void 0),useDispatch=reactRedux.createDispatchHook(LabelBeeContext),useSelector=reactRedux.createSelectorHook(LabelBeeContext),LLMContext=React__default.default.createContext({hoverKey:-1,newAnswerList:[],setHoverKey:()=>{},modelAPIResponse:[],setModelAPIResponse:()=>{},setNewAnswerList:()=>{}}),NLPContext=React__default.default.createContext({highlightKey:"",setHighlightKey:()=>{}});exports.LLMContext=LLMContext,exports.LabelBeeContext=LabelBeeContext,exports.NLPContext=NLPContext,exports.useDispatch=useDispatch,exports.useSelector=useSelector;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IRemarkLayer } from './types';
|
|
3
|
+
interface IProps {
|
|
4
|
+
checkMode?: boolean;
|
|
5
|
+
annotation?: any;
|
|
6
|
+
showTips?: boolean;
|
|
7
|
+
tips?: string;
|
|
8
|
+
remarkLayer?: (value: IRemarkLayer) => void;
|
|
9
|
+
remark: any;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}, "annotation">>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { INLPToolConfig, ITextData, INLPTextAnnotation, IRemarkLayer } from '../types';
|
|
3
|
+
interface IProps {
|
|
4
|
+
highlightKey?: string;
|
|
5
|
+
textData: ITextData[];
|
|
6
|
+
textAnnotation: INLPTextAnnotation[];
|
|
7
|
+
lang?: string;
|
|
8
|
+
checkMode?: boolean;
|
|
9
|
+
NLPConfig?: INLPToolConfig;
|
|
10
|
+
answerHeaderSlot?: React.ReactDOM | string;
|
|
11
|
+
onSelectionChange?: (text: string) => void;
|
|
12
|
+
remarkLayer?: (values: IRemarkLayer) => void;
|
|
13
|
+
remark?: any;
|
|
14
|
+
isSourceView?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const WrapQuestionView: (props: IProps) => React.JSX.Element;
|
|
17
|
+
export default WrapQuestionView;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file remark mask
|
|
3
|
+
* @author lixinghua <lixinghua_vendor@sensetime.com>
|
|
4
|
+
* @date 2024.01.30
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { IRemarkInterval } from '../types';
|
|
8
|
+
declare const _default: ({ remarkSplitIntervals, remark, }: {
|
|
9
|
+
remarkSplitIntervals: IRemarkInterval[];
|
|
10
|
+
remark?: any;
|
|
11
|
+
}) => React.JSX.Element;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { IInfoList } from '@labelbee/lb-utils';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface IndicatorDetermine {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export interface INLPToolConfig {
|
|
8
|
+
indicatorDetermine?: IndicatorDetermine[];
|
|
9
|
+
isTextEdit: boolean;
|
|
10
|
+
textEdit: ITextList[];
|
|
11
|
+
attributeConfigurable: boolean;
|
|
12
|
+
attributeList: IInfoList[];
|
|
13
|
+
}
|
|
14
|
+
export interface ITextList {
|
|
15
|
+
textId?: string;
|
|
16
|
+
title?: string | number;
|
|
17
|
+
tip?: string;
|
|
18
|
+
min?: number;
|
|
19
|
+
max?: number;
|
|
20
|
+
value?: string;
|
|
21
|
+
isFillAnswer?: boolean;
|
|
22
|
+
textControl?: boolean;
|
|
23
|
+
isLaText?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface ITextData {
|
|
26
|
+
content: string;
|
|
27
|
+
}
|
|
28
|
+
export interface INLPResult {
|
|
29
|
+
id: number;
|
|
30
|
+
newText: string;
|
|
31
|
+
indicatorDetermine: any;
|
|
32
|
+
textAnnotation: INLPTextAnnotation[];
|
|
33
|
+
}
|
|
34
|
+
export interface INLPTextAnnotation {
|
|
35
|
+
id: string;
|
|
36
|
+
start: number;
|
|
37
|
+
end: number;
|
|
38
|
+
attribute: string;
|
|
39
|
+
text: string;
|
|
40
|
+
}
|
|
41
|
+
export interface INLPInterval {
|
|
42
|
+
start: number;
|
|
43
|
+
end: number;
|
|
44
|
+
annotations?: INLPTextAnnotation[];
|
|
45
|
+
text: string;
|
|
46
|
+
attribute?: string;
|
|
47
|
+
id?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface ISelectText {
|
|
50
|
+
id?: string;
|
|
51
|
+
start?: number;
|
|
52
|
+
end?: number;
|
|
53
|
+
text?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface IRemarkLayer {
|
|
56
|
+
style: React.CSSProperties | undefined;
|
|
57
|
+
onClose: () => void;
|
|
58
|
+
submitData: ISelectText;
|
|
59
|
+
}
|
|
60
|
+
export interface IRemarkInterval {
|
|
61
|
+
start: number;
|
|
62
|
+
end: number;
|
|
63
|
+
remarkAnnotations?: IRemarkAnnotation[];
|
|
64
|
+
text: string;
|
|
65
|
+
attribute?: string;
|
|
66
|
+
id?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface IRemarkAnnotation {
|
|
69
|
+
auditID: number;
|
|
70
|
+
text: string;
|
|
71
|
+
id: string;
|
|
72
|
+
start: number;
|
|
73
|
+
end: number;
|
|
74
|
+
uuid: string;
|
|
75
|
+
}
|
|
@@ -18,7 +18,7 @@ interface IProps {
|
|
|
18
18
|
enableColorPicker?: boolean;
|
|
19
19
|
updateColorConfig?: (value: string, color: string) => void;
|
|
20
20
|
updateSize?: (size: IDefaultSize) => void;
|
|
21
|
-
attributeLockChange?: (list:
|
|
21
|
+
attributeLockChange?: (list: string[]) => void;
|
|
22
22
|
forbidShowLimitPopover?: boolean;
|
|
23
23
|
}
|
|
24
24
|
declare const AttributeList: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
|
|
@@ -36,5 +36,6 @@ export interface ICustomToolInstanceProps {
|
|
|
36
36
|
declare const useCustomToolInstance: ({ basicInfo }?: ICustomToolInstanceProps) => {
|
|
37
37
|
toolInstanceRef: import("react").MutableRefObject<ICustomToolInstance>;
|
|
38
38
|
clearToolInstance: () => void;
|
|
39
|
+
initEventEmitter: () => void;
|
|
39
40
|
};
|
|
40
41
|
export { useCustomToolInstance };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AppProps } from '@/App';
|
|
|
2
2
|
import AnnotationView from '@/components/AnnotationView';
|
|
3
3
|
import PointCloudAnnotationView from '@/components/AnnotationView/pointCloudAnnotationView';
|
|
4
4
|
import QuestionView from '@/components/LLMToolView/questionView';
|
|
5
|
+
import TextContent from '@/components/NLPToolView/textContent';
|
|
5
6
|
import { i18n } from '@labelbee/lb-utils';
|
|
6
7
|
import React from 'react';
|
|
7
8
|
import { VideoTagTool } from '@/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider';
|
|
@@ -15,6 +16,6 @@ export declare const store: import("redux").Store<{}, import("redux").Action<any
|
|
|
15
16
|
};
|
|
16
17
|
declare const _default: React.ForwardRefExoticComponent<AppProps & React.RefAttributes<unknown>>;
|
|
17
18
|
export default _default;
|
|
18
|
-
export { AnnotationView, PointCloudAnnotationView, QuestionView, LLMToolView, i18n, VideoTagTool, PredictTracking, SwitchCuboidBoxIn2DView, MeasureCanvas };
|
|
19
|
+
export { AnnotationView, PointCloudAnnotationView, QuestionView, TextContent, LLMToolView, i18n, VideoTagTool, PredictTracking, SwitchCuboidBoxIn2DView, MeasureCanvas };
|
|
19
20
|
export * from './constant';
|
|
20
21
|
export * from './typeTem';
|
|
@@ -9,8 +9,13 @@ interface ILLMContext {
|
|
|
9
9
|
setModelAPIResponse: React.Dispatch<React.SetStateAction<IModelAPIAnswer[]>>;
|
|
10
10
|
setNewAnswerList: (value: IAnswerList[]) => void;
|
|
11
11
|
}
|
|
12
|
+
interface INLPContext {
|
|
13
|
+
highlightKey: string;
|
|
14
|
+
setHighlightKey: (value: string) => void;
|
|
15
|
+
}
|
|
12
16
|
export declare const LabelBeeContext: any;
|
|
13
17
|
export declare const useDispatch: () => Dispatch<AnyAction | any>;
|
|
14
18
|
export declare const useSelector: <Selected extends unknown>(selector: (state: any) => Selected, equalityFn?: ((previous: Selected, next: Selected) => boolean) | undefined) => Selected;
|
|
15
19
|
export declare const LLMContext: React.Context<ILLMContext>;
|
|
20
|
+
export declare const NLPContext: React.Context<INLPContext>;
|
|
16
21
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IStepInfo } from '@/types/step';
|
|
3
|
+
import { ICustomToolInstance } from '@/hooks/annotation';
|
|
4
|
+
interface IProps {
|
|
5
|
+
toolInstance: ICustomToolInstance;
|
|
6
|
+
stepInfo: IStepInfo;
|
|
7
|
+
checkMode?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const sidebarCls: string;
|
|
10
|
+
declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}, "toolInstance" | "stepInfo">>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TagOperation } from '@labelbee/lb-annotation';
|
|
3
|
+
interface IProps {
|
|
4
|
+
imgIndex: number;
|
|
5
|
+
toolInstance: TagOperation;
|
|
6
|
+
checkMode?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const sidebarCls: string;
|
|
9
|
+
declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}, "imgIndex" | "toolInstance">>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IStepInfo } from '@/types/step';
|
|
3
|
+
import { ICustomToolInstance } from '@/hooks/annotation';
|
|
4
|
+
interface IProps {
|
|
5
|
+
toolInstance: ICustomToolInstance;
|
|
6
|
+
stepInfo: IStepInfo;
|
|
7
|
+
imgIndex: number;
|
|
8
|
+
checkMode?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: import("react-redux").ConnectedComponent<(props: IProps) => React.JSX.Element | null, import("react-redux").Omit<IProps, "imgIndex" | "toolInstance" | "stepInfo">>;
|
|
11
|
+
export default _default;
|
|
@@ -2,8 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { GraphToolInstance } from 'src/store/annotation/types';
|
|
3
3
|
import { IStepInfo } from '@/types/step';
|
|
4
4
|
interface IProps {
|
|
5
|
-
toolInstance
|
|
6
|
-
stepInfo
|
|
5
|
+
toolInstance?: GraphToolInstance;
|
|
6
|
+
stepInfo?: IStepInfo;
|
|
7
|
+
attributeLockChange?: (list: string[]) => void;
|
|
7
8
|
}
|
|
8
9
|
declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
|
|
9
10
|
children?: React.ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var index$1=require("../../../constant/index.js"),es=require("antd/es"),React=require("react"),index$4=require("../sidebar/index.js"),index$3=require("../toolFooter/index.js"),dom=require("../../../utils/dom.js"),index=require("../../../utils/index.js"),ctx=require("../../../store/ctx.js"),index$2=require("../../../components/NLPToolView/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const{Sider,Content}=es.Layout,layoutCls=`${index$1.prefix}-layout`,NLPLayout=e=>{var t,a;const[l,r]=React.useState("");return React__default.default.createElement(es.Layout,{className:dom.getClassName("layout","container")},React__default.default.createElement(ctx.NLPContext.Provider,{value:React.useMemo(()=>({highlightKey:l,setHighlightKey:r}),[l])},e==null?void 0:e.leftSider,React__default.default.createElement(Content,{className:index.classnames({[`${layoutCls}__content`]:!0,[`${index$1.prefix}-NLPLayout`]:!0})},React__default.default.createElement(index$2,{checkMode:e.checkMode,showTips:e.showTips,tips:e.tips,remarkLayer:e==null?void 0:e.remarkLayer,remark:e==null?void 0:e.remark}),React__default.default.createElement(index$3.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer})),React__default.default.createElement(Sider,{className:`${layoutCls}__side`,width:400,style:{position:"relative"}},React__default.default.createElement(index$4.default,{sider:e==null?void 0:e.sider,checkMode:e==null?void 0:e.checkMode}),(a=e.drawLayerSlot)==null?void 0:a.call(e,{}))))};module.exports=NLPLayout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var index$
|
|
1
|
+
"use strict";var index$7=require("../../components/customResizeHook/index.js"),index$5=require("../../constant/index.js"),antd=require("antd"),es=require("antd/es"),React=require("react"),index$b=require("./annotationOperation/index.js"),index$a=require("./annotationTips/index.js"),index$4=require("./sidebar/index.js"),index$c=require("./toolFooter/index.js"),index$9=require("./toolHeader/index.js"),reducer=require("../../store/annotation/reducer.js"),index$6=require("../../components/videoAnnotate/index.js"),reactRedux=require("react-redux"),ToolUtils=require("../../utils/ToolUtils.js"),index$d=require("../../components/pointCloudView/index.js"),dom=require("../../utils/dom.js"),index$8=require("../../utils/index.js"),index$3=require("../../components/predictTracking/previewResult/index.js"),ctx=require("../../store/ctx.js"),ToolType=require("../../data/enums/ToolType.js"),index=require("./LLMLayout/index.js"),index$1=require("./NLPLayout/index.js"),index$2=require("../../components/audioAnnotate/index.js"),icons=require("@ant-design/icons"),reactI18next=require("react-i18next"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e};const{Sider,Content}=es.Layout,layoutCls=`${index$5.prefix}-layout`,ImageAnnotate=e=>{var t;return React__default.default.createElement(React__default.default.Fragment,null,e.showTips===!0&&React__default.default.createElement(index$a,{path:e.path,tips:e.tips}),React__default.default.createElement(index$b,__spreadValues({},e)),React__default.default.createElement(index$c.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},PointCloudAnnotate=e=>{var t;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$d,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit,measureVisible:e.measureVisible}),React__default.default.createElement(index$c.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},AnnotatedArea=e=>{var t;const{stepList:a,step:l}=e,r=(t=reducer.getStepConfig(a,l))==null?void 0:t.tool,i=ToolUtils.isPointCloudTool(r),n=ToolUtils.isVideoTool(r);return i?React__default.default.createElement(PointCloudAnnotate,__spreadValues({},e)):n?React__default.default.createElement(index$6,{drawLayerSlot:e.drawLayerSlot,footer:e.footer}):React__default.default.createElement(ImageAnnotate,__spreadValues({},e))},ViewportProviderLayout=e=>{var t,a,l;const{t:r}=reactI18next.useTranslation(),{stepList:i,step:n}=e,o=(t=reducer.getStepConfig(i,n))==null?void 0:t.tool,d=![ToolType.EToolName.LLM,ToolType.EToolName.NLP].includes(o),u=![ToolType.EToolName.LLM,ToolType.EToolName.NLP].includes(o),c=[lbAnnotation.EPointCloudName.PointCloud].includes(o);return React__default.default.createElement(index$7.ViewportProvider,null,React__default.default.createElement(antd.Spin,{spinning:e.loading,indicator:React__default.default.createElement(icons.LoadingOutlined,null),tip:React__default.default.createElement("span",{style:{marginTop:200}},r("LoadingTips")),delay:500},React__default.default.createElement(es.Layout,{className:index$8.classnames([layoutCls,e.className]),style:(a=e.style)==null?void 0:a.layout},React__default.default.createElement("header",{className:`${layoutCls}__header`,style:(l=e.style)==null?void 0:l.header},React__default.default.createElement(index$9,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:d,hasHeaderOption:u,hasPredictTrackingIcon:c})),e.children)))},MainView=e=>{var t,a,l,r,i,n,o;const[d,u]=React.useState(void 0),c=(a=(t=e.style)==null?void 0:t.sider)==null?void 0:a.width,{stepList:m,step:f}=e,s=(l=reducer.getStepConfig(m,f))==null?void 0:l.tool,v=ToolType.EToolName.LLM===s,x=ToolType.EToolName.NLP===s,E=ToolUtils.isAudioTool(s);return v?React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(index,__spreadValues({},e))):x?React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(index$1,__spreadValues({},e))):E?React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(index$2,__spreadValues({},e))):React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(es.Layout,{className:dom.getClassName("layout","container")},e==null?void 0:e.leftSider,React__default.default.createElement(Content,{className:`${layoutCls}__content`},React__default.default.createElement(AnnotatedArea,__spreadValues({},e)),React__default.default.createElement(index$3,null)),React__default.default.createElement(Sider,{className:`${layoutCls}__side`,width:(r=d!=null?d:c)!=null?r:240,style:(i=e.style)==null?void 0:i.sider},React__default.default.createElement(index$4.default,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:u,propsSiderWidth:(o=(n=e.style)==null?void 0:n.sider)==null?void 0:o.width}))))},mapStateToProps=({annotation:e})=>{var t,a,l;const{imgList:r,loading:i}=e,n=(t=r[e.imgIndex])!=null?t:{};return{path:(l=(a=n==null?void 0:n.path)!=null?a:n==null?void 0:n.url)!=null?l:"",loading:i}};var MainView$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(MainView);module.exports=MainView$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux"),StepUtils=require("../../../../utils/StepUtils.js"),index=require("../../../../utils/index.js"),ActionsConfirm=require("./ActionsConfirm.js"),useOperationList=require("./useOperationList.js"),ctx=require("../../../../store/ctx.js"),unitAttribute=require("../../../../assets/annotation/pointCloudTool/unitAttribute.svg.js"),unitAttributeForbid=require("../../../../assets/annotation/pointCloudTool/unitAttributeForbid.svg.js"),unitAttributeHover=require("../../../../assets/annotation/pointCloudTool/unitAttributeHover.svg.js"),reactI18next=require("react-i18next"),index$1=require("../../../../components/pointCloudView/components/UnifyParamsModal/index.js"),useSingleBox=require("../../../../components/pointCloudView/hooks/useSingleBox.js"),reducer=require("../../../../store/annotation/reducer.js"),useStatus=require("../../../../components/pointCloudView/hooks/useStatus.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const mapStateToProps=t=>{var e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux"),StepUtils=require("../../../../utils/StepUtils.js"),index=require("../../../../utils/index.js"),ActionsConfirm=require("./ActionsConfirm.js"),useOperationList=require("./useOperationList.js"),ctx=require("../../../../store/ctx.js"),unitAttribute=require("../../../../assets/annotation/pointCloudTool/unitAttribute.svg.js"),unitAttributeForbid=require("../../../../assets/annotation/pointCloudTool/unitAttributeForbid.svg.js"),unitAttributeHover=require("../../../../assets/annotation/pointCloudTool/unitAttributeHover.svg.js"),reactI18next=require("react-i18next"),index$1=require("../../../../components/pointCloudView/components/UnifyParamsModal/index.js"),useSingleBox=require("../../../../components/pointCloudView/hooks/useSingleBox.js"),reducer=require("../../../../store/annotation/reducer.js"),useStatus=require("../../../../components/pointCloudView/hooks/useStatus.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const mapStateToProps=t=>{var e,n;const o=StepUtils.getCurrentStepInfo((e=t.annotation)==null?void 0:e.step,(n=t.annotation)==null?void 0:n.stepList);return{toolInstance:t.annotation.toolInstance,stepInfo:o,imgList:t.annotation.imgList,imgIndex:t.annotation.imgIndex,stepList:t.annotation.stepList}},GeneralOperation=({toolInstance:t,stepInfo:e,hideValidity:n})=>{const o=useOperationList(t),r=index.jsonParser(e==null?void 0:e.config),i=[o.empty];return(e==null?void 0:e.dataSourceStep)===0&&!n&&i.push(o.setValidity),(r==null?void 0:r.copyBackwardResult)&&i.push(o.copyPrevious),React__default.default.createElement(ActionsConfirm,{allOperation:i})},PointCloudOperation=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(({toolInstance:t,stepInfo:e,imgList:n,stepList:o,imgIndex:r})=>{const{t:i}=reactI18next.useTranslation(),{selectedBox:u}=useSingleBox.useSingleBox(),l=useOperationList(t),[v,c]=React.useState(!1),[f,m]=React.useState([]),{isPointCloudDetectionPattern:g,isPointCloudSegmentationPattern:x}=useStatus.useStatus(),d=index.jsonParser(e.config);let s=[l.copyPrevious,l.empty,l.setValidity];if(g&&d.trackConfigurable===!0){const a=!u,y={name:i("UnifyParams"),key:"UnifyParams",imgSvg:a?unitAttributeForbid:unitAttribute,hoverSvg:unitAttributeHover,onClick:()=>{m(reducer.composeResultByToolInstance({toolInstance:t,imgList:n,imgIndex:r,stepList:o})),c(!0)},forbidConfirm:!0,forbidOperation:a};s.unshift(y)}const C=React.useCallback(()=>{c(!1)},[]),p=u==null?void 0:u.info;return x&&(s=s.filter(a=>!["setValidity","copyPrevious"].includes(a.key))),React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(ActionsConfirm,{allOperation:s}),React__default.default.createElement(index$1,{id:p==null?void 0:p.trackID,visible:v,onCancel:C,config:d,imgList:f}))});var GeneralOperation$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(GeneralOperation);exports.PointCloudOperation=PointCloudOperation,exports.default=GeneralOperation$1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux"),StepUtils=require("../../../../utils/StepUtils.js"),reactI18next=require("react-i18next"),ctx=require("../../../../store/ctx.js"),index$1=require("../../../../constant/index.js"),index=require("../../../../utils/index.js"),antd=require("antd"),icons=require("@ant-design/icons");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const sidebarCls=`${index$1.prefix}-sidebar`,NLPAnnotatedList=t=>{var a,i;const[c,_]=React.useState(0),p=React.useRef(null),{toolInstance:n,checkMode:f}=t,{t:r}=reactI18next.useTranslation(),[u,x]=React.useState("");React.useEffect(()=>(n&&n.singleOn("changeAttributeSidebar",e=>{_(o=>o+1)}),()=>{n==null||n.unbindAll("changeAttributeSidebar")}),[n,p]);const[d]=n.exportData(),l=(i=(a=d==null?void 0:d[0])==null?void 0:a.textAnnotation)!=null?i:[],m=e=>{let o=e===u?"":e;n==null||n.setHighlightKey(o),x(o)},v=e=>{n==null||n.deleteTextAnnotation(e.id)};return(l==null?void 0:l.length)===0?null:React__default.default.createElement("div",{className:`${sidebarCls}__content__NLPList`},l.map((e,o)=>{const g=u===e.id;return React__default.default.createElement("div",{key:o,className:index.classnames({[`${sidebarCls}__content__NLPList__item`]:!0,[`${sidebarCls}__content__NLPList__item__active`]:g}),onClick:()=>m(e.id)},React__default.default.createElement(antd.Tooltip,{title:e.text},React__default.default.createElement("span",{className:`${sidebarCls}__content__NLPList__item__text`},`${e.attribute||r("NoAttribute")}\uFF0C${r("textTool")}\uFF1A${e.text}`)),!f&&React__default.default.createElement(antd.Popconfirm,{title:r("DeleteCommentConfirm"),placement:"topRight",okText:r("Confirm"),cancelText:r("Cancel"),getPopupContainer:s=>s.parentElement,onConfirm:()=>v(e),overlayClassName:`${index$1.prefix}-pop-confirm`},React__default.default.createElement(icons.CloseOutlined,{className:`${sidebarCls}-pop-remove`,onClick:s=>{s.stopPropagation()}})))}))},mapStateToProps=t=>{var a,i;const c=StepUtils.getCurrentStepInfo((a=t.annotation)==null?void 0:a.step,(i=t.annotation)==null?void 0:i.stepList);return{toolInstance:t.annotation.toolInstance,stepInfo:c}};var NLPAnnotatedList$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(NLPAnnotatedList);exports.default=NLPAnnotatedList$1,exports.sidebarCls=sidebarCls;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux"),ctx=require("../../../../store/ctx.js"),index$2=require("../../../../constant/index.js"),index$1=require("../SwitchAttributeList/index.js"),index=require("../GeneralOperation/index.js"),NLPAnnotatedList=require("./NLPAnnotatedList.js"),indicatorDetermine=require("./indicatorDetermine.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const NlpAttributeList=({setAttributeLockList:e,checkMode:t})=>t?null:React__default.default.createElement(index$1,{attributeLockChange:e}),sidebarCls=`${index$2.prefix}-sidebar`,NLPSidebar=({toolInstance:e,checkMode:t})=>{const r=a=>{e==null||e.setAttributeLockList(a)};return React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},React__default.default.createElement(indicatorDetermine,{checkMode:t}),React__default.default.createElement(NlpAttributeList,{setAttributeLockList:r,checkMode:t}),React__default.default.createElement(NLPAnnotatedList.default,{checkMode:t}),";"),!t&&React__default.default.createElement(index.default,{hideValidity:!0}))};function mapStateToProps(e){return{toolInstance:e.annotation.toolInstance,imgIndex:e.annotation.imgIndex}}var NLPToolSidebar=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(NLPSidebar);exports.default=NLPToolSidebar,exports.sidebarCls=sidebarCls;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var React=require("react"),reactRedux=require("react-redux"),StepUtils=require("../../../../utils/StepUtils.js"),reactI18next=require("react-i18next"),ctx=require("../../../../store/ctx.js"),index=require("../../../../utils/index.js"),index$1=require("../../../../components/LLMToolView/sidebar/components/determineGroup/index.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,n)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,__spreadValues=(t,e)=>{for(var n in e||(e={}))__hasOwnProp.call(e,n)&&__defNormalProp(t,n,e[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(e))__propIsEnum.call(e,n)&&__defNormalProp(t,n,e[n]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e));const IndicatorDetermineList=t=>{const{toolInstance:e,stepInfo:n,checkMode:s,imgIndex:f}=t,[v]=e.exportData(),o=v==null?void 0:v[0],{t:m}=reactI18next.useTranslation(),[I,_]=React.useState(0);React.useEffect(()=>(e&&e.on("changeIndicatorDetermine",i=>{_(r=>r+1)}),()=>{e==null||e.unbindAll("changeIndicatorDetermine")}),[e,f]);const x=index.jsonParser(n.config),{indicatorDetermine:c}=x,g=i=>{var r;const{value:u,key:a}=i;if(a){const d={[a]:u},l=(r=o==null?void 0:o.indicatorDetermine)!=null?r:{},p=__spreadProps(__spreadValues({},o),{indicatorDetermine:__spreadValues(__spreadValues({},l),d)});e.setResult(p)}};if((c==null?void 0:c.length)>0){const i=c.filter(r=>r==null?void 0:r.label);return React__default.default.createElement("div",{style:{padding:"12px",marginBottom:"12px"}},React__default.default.createElement("div",{style:{fontSize:"16px",fontWeight:500,lineHeight:"46px"}},m("IndicatorJudgment")),React__default.default.createElement("div",{style:{maxHeight:"400px",overflow:"auto"}},i.map((r,u)=>{var a;const{label:d,value:l}=r;return React__default.default.createElement(index$1,{selectValue:(a=o==null?void 0:o.indicatorDetermine)==null?void 0:a[l],title:d,updateValue:p=>{g({key:l,value:p})},key:u,isDisableAll:s})})))}return null},mapStateToProps=t=>{var e,n;const s=StepUtils.getCurrentStepInfo((e=t.annotation)==null?void 0:e.step,(n=t.annotation)==null?void 0:n.stepList);return{toolInstance:t.annotation.toolInstance,stepInfo:s,imgIndex:t.annotation.imgIndex}};var IndicatorDetermineList$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(IndicatorDetermineList);module.exports=IndicatorDetermineList$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),reactRedux=require("react-redux"),index$1=require("../../../../components/attributeList/index.js"),StepUtils=require("../../../../utils/StepUtils.js"),index=require("../../../../utils/index.js"),reactI18next=require("react-i18next"),ToolType=require("../../../../data/enums/ToolType.js"),ctx=require("../../../../store/ctx.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const SwitchAttributeList=t=>{var n;const[
|
|
1
|
+
"use strict";var React=require("react"),reactRedux=require("react-redux"),index$1=require("../../../../components/attributeList/index.js"),StepUtils=require("../../../../utils/StepUtils.js"),index=require("../../../../utils/index.js"),reactI18next=require("react-i18next"),ToolType=require("../../../../data/enums/ToolType.js"),ctx=require("../../../../store/ctx.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const SwitchAttributeList=t=>{var n;const[s,l]=React.useState(0),i=React.useRef(null),{toolInstance:e,attributeLockChange:f}=t,{t:b}=reactI18next.useTranslation();if(React.useEffect(()=>(e&&e.singleOn("changeAttributeSidebar",a=>{var c;l(r=>r+1),!!i.current&&((c=i.current.children[a])==null||c.scrollIntoView({block:"center"}))}),()=>{e==null||e.unbindAll("changeAttributeSidebar")}),[e,i]),!t.stepInfo)return null;const u=index.jsonParser(t.stepInfo.config),o=t.stepInfo.tool===ToolType.EToolName.ScribbleTool;if(u.attributeConfigurable!==!0&&!o)return null;if((u.attributeConfigurable===!0||o)&&(u==null?void 0:u.attributeList)){const a=u.attributeList.map(r=>({label:r.key,value:r.value,color:r==null?void 0:r.color}));o||a.unshift({label:b("NoAttribute"),value:""});const c=r=>{e&&(e.setDefaultAttribute(r),l(d=>d+1))};return React__default.default.createElement(index$1.default,{list:a,attributeChanged:c,selectedAttribute:(n=e==null?void 0:e.defaultAttribute)!=null?n:"",ref:i,forbidDefault:o,attributeLockChange:f})}return null},mapStateToProps=t=>{var n,s;const l=StepUtils.getCurrentStepInfo((n=t.annotation)==null?void 0:n.step,(s=t.annotation)==null?void 0:s.stepList);return{toolInstance:t.annotation.toolInstance,stepInfo:l}};var SwitchAttributeList$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(SwitchAttributeList);module.exports=SwitchAttributeList$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../../../constant/index.js"),ToolType=require("../../../data/enums/ToolType.js"),StepUtils=require("../../../utils/StepUtils.js"),es=require("antd/es"),React=require("react"),reactI18next=require("react-i18next"),index$9=require("./AnnotationText/index.js"),index$2=require("./ClearIcon/index.js"),index$7=require("./GeneralOperation/index.js"),index$3=require("./ImgAttributeInfo/index.js"),index$8=require("./SwitchAttributeList/index.js"),index$1=require("./TagSidebar/index.js"),index$4=require("./TextToolSidebar/index.js"),index$6=require("./PointCloudToolSidebar/index.js"),index$
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index=require("../../../constant/index.js"),ToolType=require("../../../data/enums/ToolType.js"),StepUtils=require("../../../utils/StepUtils.js"),es=require("antd/es"),React=require("react"),reactI18next=require("react-i18next"),index$9=require("./AnnotationText/index.js"),index$2=require("./ClearIcon/index.js"),index$7=require("./GeneralOperation/index.js"),index$3=require("./ImgAttributeInfo/index.js"),index$8=require("./SwitchAttributeList/index.js"),index$1=require("./TagSidebar/index.js"),index$4=require("./TextToolSidebar/index.js"),index$6=require("./PointCloudToolSidebar/index.js"),index$e=require("./ToolStyle/index.js"),lbAnnotation=require("@labelbee/lb-annotation"),index$a=require("./ScribbleSidebar/index.js"),ToolIcons=require("./ToolIcons.js"),ctx=require("../../../store/ctx.js"),antd=require("antd"),index$5=require("../../../utils/index.js"),icon_menu_fold=require("../../../assets/annotation/common/icon_menu_fold.svg.js"),index$c=require("../../../components/LLMToolView/sidebar/index.js"),index$d=require("./NLPSidebar/index.js"),index$b=require("../../../components/videoAnnotate/videoClipTool/components/annotatedList/index.js");function _interopDefaultLegacy(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var React__default=_interopDefaultLegacy(React);const{EVideoToolName,EPointCloudName}=lbAnnotation.cTool,{Panel}=es.Collapse,sidebarCls=`${index.prefix}-sidebar`,Sidebar=({sider:t,enableColorPicker:N,setSiderWidth:d,propsSiderWidth:q,checkMode:u})=>{const s=ctx.useSelector(a=>StepUtils.getCurrentStepInfo(a.annotation.step,a.annotation.stepList)),[o,$]=React.useState(!0),e=s==null?void 0:s.tool,{t:c}=reactI18next.useTranslation();if(!e)return null;const S=a=>{const r=React__default.default.createElement(index$e,null);return React__default.default.createElement(Panel,{header:c("Style"),className:"panel",key:a},r)},f=React__default.default.createElement(ToolIcons.ToolIcons,{toolName:e,onChange:()=>{}}),l=React__default.default.createElement(index$8,null),m=React__default.default.createElement(index$9,null),x=React__default.default.createElement(es.Collapse,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${sidebarCls}__content`,expandIcon:index$1.expandIconFuc},S("1")),p=React__default.default.createElement(es.Collapse,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${sidebarCls}__content`,expandIcon:index$1.expandIconFuc},React__default.default.createElement(Panel,{header:React__default.default.createElement("div",null,c("Adjust"),React__default.default.createElement(index$2,null)),className:"panel",key:"imgAttribute"},React__default.default.createElement(index$3,null))),n=React__default.default.createElement(index$7.default,null),g=React__default.default.createElement(index$1.default,null),_=a=>React__default.default.createElement(index$4.default,{disabled:a}),E=React__default.default.createElement(index$a,{onChange:(a,r)=>{}}),v=React__default.default.createElement(index$b,null),T=React__default.default.createElement(index$c,{checkMode:u}),b=React__default.default.createElement(index$d.default,{checkMode:u}),i=React__default.default.createElement("div",{className:`${sidebarCls}__horizontal`}),y=React__default.default.createElement(index$6.default,{enableColorPicker:N}),C=React__default.default.createElement(index$7.PointCloudOperation,null);if(t)return typeof t=="function"?React__default.default.createElement("div",{className:`${sidebarCls}`},t({toolIcon:f,attributeList:l,annotationText:m,toolStyle:x,imageAttributeInfo:p,operation:n,tagToolSideBar:g,textToolSideBar:_,horizontal:i,pointCloudToolSidebar:y,pointCloudOperation:C,scribbleSidebar:E,LLMSidebar:T,videoClipSidebar:v,NLPSidebar:b})):t;if([ToolType.EToolName.Rect,ToolType.EToolName.Point,ToolType.EToolName.Line,ToolType.EToolName.Rect,ToolType.EToolName.Polygon,ToolType.EToolName.Cuboid].includes(e))return React__default.default.createElement("div",{className:`${sidebarCls}`},f,i,l,m,i,React__default.default.createElement("div",{className:`${sidebarCls}__content`},x,p),n);if(e===ToolType.EToolName.Tag)return React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement(index$1.default,null));if(e===EVideoToolName.VideoClipTool)return React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},v,l),n);if(e===EVideoToolName.VideoTagTool)return React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},React__default.default.createElement(index$1.default,null)),n);if(e===EVideoToolName.VideoTextTool)return React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement(index$4.default,null));if(e===ToolType.EToolName.Text)return React__default.default.createElement("div",{className:`${sidebarCls}`},"s",React__default.default.createElement(index$4.default,null));if(e===EPointCloudName.PointCloud){const a=()=>{$(!o),d&&d(o?48:void 0)},r=React__default.default.createElement("div",{style:{width:"48px",height:"100%",display:"flex",justifyContent:"center",background:"#ffffff"}},React__default.default.createElement("span",{onClick:()=>a()},React__default.default.createElement("img",{style:{width:"16px",height:"16px",marginTop:"18px",cursor:"pointer",transform:"rotate(180deg)"},src:icon_menu_fold})));return o?React__default.default.createElement(antd.Tabs,{type:"card",activeKey:"1",className:index$5.classnames({[`${sidebarCls}`]:!0,[`${sidebarCls}__pointCloud`]:!0}),tabBarExtraContent:{left:React__default.default.createElement("span",{onClick:()=>a(),style:{padding:"0px 4px"}},React__default.default.createElement("img",{style:{width:"16px",height:"16px",marginLeft:"4px",cursor:"pointer"},src:icon_menu_fold}))}},React__default.default.createElement(antd.Tabs.TabPane,{tab:"\u5DE5\u5177\u9762\u677F",key:"1",style:{height:"100%",display:"flex",flexDirection:"column"}},React__default.default.createElement("div",{className:`${sidebarCls}__content`},React__default.default.createElement(index$6.default,null)),React__default.default.createElement(index$7.PointCloudOperation,null))):r}return e===ToolType.EToolName.ScribbleTool?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},E,l),n):e===ToolType.EToolName.LLM?T:e===ToolType.EToolName.NLP?b:null};exports.default=Sidebar,exports.sidebarCls=sidebarCls;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var index=require("../common/index.js");const NLPShortCutTable=[index.backward,index.forward];module.exports=NLPShortCutTable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),icon_kj1=require("../../../../../assets/annotation/toolHotKeyIcon/icon_kj1.svg.js"),icon_kj_h=require("../../../../../assets/annotation/toolHotKeyIcon/icon_kj_h.svg.js"),ToolType=require("../../../../../data/enums/ToolType.js"),index=require("./rectToolShortCutTable/index.js"),index$2=require("./point/index.js"),index$3=require("./polygon/index.js"),index$4=require("./line/index.js"),index$1=require("./tag/index.js"),index$5=require("./text/index.js"),index$6=require("./videoTag/index.js"),index$7=require("./pointCloud/index.js"),index$8=require("./scribble/index.js"),index$9=require("./cuboid/index.js"),index$a=require("./LLM/index.js"),index$b=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),icon_kj1=require("../../../../../assets/annotation/toolHotKeyIcon/icon_kj1.svg.js"),icon_kj_h=require("../../../../../assets/annotation/toolHotKeyIcon/icon_kj_h.svg.js"),ToolType=require("../../../../../data/enums/ToolType.js"),index=require("./rectToolShortCutTable/index.js"),index$2=require("./point/index.js"),index$3=require("./polygon/index.js"),index$4=require("./line/index.js"),index$1=require("./tag/index.js"),index$5=require("./text/index.js"),index$6=require("./videoTag/index.js"),index$7=require("./pointCloud/index.js"),index$8=require("./scribble/index.js"),index$9=require("./cuboid/index.js"),index$a=require("./LLM/index.js"),index$b=require("./NLP/index.js"),index$c=require("./audioText/index.js"),index$d=require("../../index.js"),reactI18next=require("react-i18next"),lbAnnotation=require("@labelbee/lb-annotation"),PointCloudContext=require("../../../../../components/pointCloudView/PointCloudContext.js"),FooterPopover=require("../../FooterPopover.js"),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,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,a,t)=>a in e?__defProp(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,__spreadValues=(e,a)=>{for(var t in a||(a={}))__hasOwnProp.call(a,t)&&__defNormalProp(e,t,a[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(a))__propIsEnum.call(a,t)&&__defNormalProp(e,t,a[t]);return e};const{EVideoToolName,EPointCloudName}=lbAnnotation.cTool,shortCutTable={[ToolType.EToolName.Rect]:index.default,[ToolType.EToolName.Tag]:index$1.default,[ToolType.EToolName.Point]:index$2.default,[ToolType.EToolName.Polygon]:index$3.default,[ToolType.EToolName.Line]:index$4.default,[ToolType.EToolName.Text]:index$5,[EVideoToolName.VideoTagTool]:index$6,[EPointCloudName.PointCloud]:index$7.default,[EPointCloudName.PointCloud+"_POLYGON"]:index$7.pointCloudShortCutTable_POLYGON,[EPointCloudName.PointCloud+"_SEGMENT"]:index$7.pointCloudShortCutTable_SEGMENT,[ToolType.EToolName.ScribbleTool]:index$8.default,[ToolType.EToolName.Cuboid]:index$9,[ToolType.EToolName.LLM]:index$a.default,[ToolType.EToolName.NLP]:index$b,[lbAnnotation.EAudioToolName.AudioTextTool]:index$c.default},ToolHotKeyIcon=({icon:e})=>typeof e=="string"?React__default.default.createElement("img",{width:16,height:16,src:e}):e||null,ToolHotKeyCom=({title:e,style:a,shortCutList:t})=>{const{t:i}=reactI18next.useTranslation(),d={width:320,display:"flex",justifyContent:"space-between",margin:16},l={display:"block",padding:"0 3px",minWidth:"20px",marginRight:"3px",border:"1px solid rgba(204,204,204,1)",verticalAlign:"middle",fontSize:"12px",textAlign:"center"},c=(n,s)=>React__default.default.createElement("div",{style:d,key:s},React__default.default.createElement("span",{style:{display:"flex",alignItems:"center"}},React__default.default.createElement(ToolHotKeyIcon,{icon:n.icon}),React__default.default.createElement("span",{style:{marginLeft:n.icon?16:0}},i(n.name))),React__default.default.createElement("span",{style:{display:"flex",alignItems:"center"}},n.noticeInfo&&React__default.default.createElement("span",{style:{marginRight:"5px",color:"#CCCCCC"}},i(n.noticeInfo)),m(n.shortCut,n.shortCutUseHtml,n.linkSymbol))),m=(n,s=!1,x="+")=>{if(!n)return null;const g=n.map((r,o)=>{var p,f;const u={display:"flex",alignItems:"center"};return s?React__default.default.createElement("span",{key:o,style:u},React__default.default.createElement("span",{style:l,dangerouslySetInnerHTML:{__html:r}})):o<n.length-1?typeof r=="number"?React__default.default.createElement("span",{key:o,style:u},React__default.default.createElement("span",{style:l},r),React__default.default.createElement("span",{style:{marginRight:"3px"}},"~")):((p=r==null?void 0:r.startsWith)==null?void 0:p.call(r,"data"))?React__default.default.createElement("span",{key:o,style:u},React__default.default.createElement("span",{className:"shortCutButton",style:{marginRight:"3px"}},React__default.default.createElement("img",{width:16,height:23,src:r})),React__default.default.createElement("span",{style:{marginRight:"3px"}},"+")):React__default.default.createElement("span",{key:o,style:u},React__default.default.createElement("span",{style:l},r),React__default.default.createElement("span",{style:{marginRight:"3px"}},x)):typeof r=="number"?React__default.default.createElement("span",{key:o,style:u},React__default.default.createElement("span",{style:l},r)):((f=r==null?void 0:r.startsWith)==null?void 0:f.call(r,"data"))?React__default.default.createElement("span",{className:"shortCutButton",key:o,style:{marginRight:"3px"}},React__default.default.createElement("img",{width:16,height:23,src:r})):React__default.default.createElement("span",{style:l,key:o},r)});return React__default.default.createElement("div",{style:{display:"flex",justifyContent:"space-around",alignItems:"center"}},g)},y=React__default.default.createElement("div",{className:`${index$d.footerCls}__hotkey-content`},t==null?void 0:t.map((n,s)=>c(n,s))),E=a||{};return React__default.default.createElement(FooterPopover,{hoverIcon:icon_kj_h,icon:icon_kj1,title:i("Hotkeys"),content:y,containerStyle:E})},ToolHotKey=({style:e,title:a,toolName:t})=>{const{pointCloudPattern:i,globalPattern:d}=React.useContext(PointCloudContext.PointCloudContext);if(!t||!shortCutTable[t])return null;let l=t;switch(d){case lbUtils.EPointCloudPattern.Detection:switch(i){case ToolType.EToolName.Polygon:l+="_POLYGON";break;case ToolType.EToolName.Line:l=ToolType.EToolName.Line;break;case ToolType.EToolName.Point:l=ToolType.EToolName.Point;break}break;case lbUtils.EPointCloudPattern.Segmentation:l=EPointCloudName.PointCloud+"_SEGMENT";break}const c={style:e,title:a,shortCutList:shortCutTable[l]};return React__default.default.createElement(ToolHotKeyCom,__spreadValues({},c))};exports.ToolHotKeyCom=ToolHotKeyCom,exports.default=ToolHotKey,exports.shortCutTable=shortCutTable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import m,{useContext as G,useState as f,useMemo as L,useEffect as g}from"react";import{connect as J}from"react-redux";import{LabelBeeContext as U,NLPContext as X}from"../../store/ctx.js";import{prefix as Y}from"../../constant/index.js";import Z from"./textContent/index.js";import{useTranslation as tt}from"react-i18next";import et from"../../views/MainView/annotationTips/index.js";import{getStepConfig as nt}from"../../store/annotation/reducer.js";import{jsonParser as ot}from"../../utils/index.js";import{getCurrentResultFromResultList as rt}from"../LLMToolView/utils/data.js";import{useCustomToolInstance as it}from"../../hooks/annotation.js";import{uuid as at}from"@labelbee/lb-annotation";var st=Object.defineProperty,ct=Object.defineProperties,lt=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,ut=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable,h=(n,e,o)=>e in n?st(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o,b=(n,e)=>{for(var o in e||(e={}))ut.call(e,o)&&h(n,o,e[o]);if(P)for(var o of P(e))mt.call(e,o)&&h(n,o,e[o]);return n},O=(n,e)=>ct(n,lt(e));const T=`${Y}-NLPView`,ft=n=>{const{annotation:e,checkMode:o,tips:j,showTips:y,remarkLayer:D,remark:N}=n,{imgIndex:s,imgList:u,stepList:p,step:d}=e,{highlightKey:S,setHighlightKey:C}=G(X),{toolInstanceRef:i}=it(),[R,V]=f(""),[x,E]=f([]),[k,I]=f([{content:""}]),[a,c]=f({id:1,newText:"",indicatorDetermine:{},textAnnotation:[]}),M=L(()=>(a==null?void 0:a.textAnnotation)?a.textAnnotation.filter(t=>x.length===0||x.includes(t.attribute)):[],[a,x]);tt();const w=L(()=>{var t;if(p&&d){const r=(t=nt(p,d))==null?void 0:t.config;return ot(r)}},[p,d]);g(()=>{var t;if(!u[s])return;const r=(t=u[s])==null?void 0:t.textData;I(r)},[s,w]),g(()=>{var t;if(!u[s])return;const r=(t=u[s])!=null?t:{},l=rt(r==null?void 0:r.result);c(l)},[s]),g(()=>{i.current.exportData=()=>[[a],{}],i.current.setResult=t=>c(t),i.current.clearResult=H,i.current.setDefaultAttribute=K,i.current.setHighlightKey=C,i.current.deleteTextAnnotation=q,i.current.setAttributeLockList=$,v()},[a]);const v=()=>{i.current.emit("changeAttributeSidebar"),i.current.emit("changeIndicatorDetermine")},K=t=>{i.current.defaultAttribute=t,V(t),v()},$=t=>{E(t)},H=()=>{c({id:1,newText:"",indicatorDetermine:{},textAnnotation:[]}),v()},q=t=>{c(r=>O(b({},r),{textAnnotation:r.textAnnotation.filter(l=>l.id!==t)}))},B=t=>{var r;if(t===""||o)return;let l=window.getSelection();const{anchorOffset:_=0,focusOffset:A=0,anchorNode:F,focusNode:Q}=l||{};if(F===Q){let W=Math.min(_,A),z=Math.max(_,A);c(O(b({},a),{textAnnotation:[...(a==null?void 0:a.textAnnotation)||[],{id:at(8,62),start:W,end:z,attribute:R,text:t}]})),(r=window.getSelection())==null||r.empty()}};return m.createElement("div",{className:T},m.createElement("div",{className:`${T}-question`},y===!0&&m.createElement(et,{tips:j}),m.createElement(Z,{highlightKey:S,textData:k,checkMode:o,NLPConfig:w,textAnnotation:M,onSelectionChange:B,remarkLayer:D,remark:N})))},pt=n=>({annotation:n.annotation});var dt=J(pt,null,null,{context:U})(ft);export{dt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import i,{useRef as W,useState as O,useMemo as _,useEffect as C}from"react";import{I18nextProvider as z,useTranslation as F}from"react-i18next";import{i18n as N,toolStyleConverter as G}from"@labelbee/lb-utils";import{prefix as J}from"../../../constant/index.js";import{useTextSelection as X}from"ahooks";import j from"lodash";import{uuid as Y,CommonToolUtils as Z}from"@labelbee/lb-annotation";import tt from"../../../constant/styleString.js";import{getIntervals as D}from"../utils/index.js";import{classnames as et}from"../../../utils/index.js";import nt from"./remarkMask.js";var ot=Object.defineProperty,A=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable,L=(e,o,n)=>o in e?ot(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,it=(e,o)=>{for(var n in o||(o={}))rt.call(o,n)&&L(e,n,o[n]);if(A)for(var n of A(o))lt.call(o,n)&&L(e,n,o[n]);return e};const S=`${J}-NLPView`,at=({remarkLayer:e,remarkStyle:o,setRemarkStyle:n,setRemarkResut:g,remarkResut:b})=>{if(e)return e({style:o,onClose:()=>{var k;n(void 0),g({}),(k=window.getSelection())==null||k.empty()},submitData:b})},st=e=>{const{highlightKey:o,textData:n,lang:g,checkMode:b=!0,NLPConfig:k,onSelectionChange:E,textAnnotation:h,remark:s}=e,{enableRemark:M,displayRemarkList:f}=s||{},{t:B}=F(),c=W(null),y=X(c),[p,w]=O({}),[T,R]=O(void 0),v=_(()=>{var t;return(t=n==null?void 0:n[0])==null?void 0:t.content},[n]),V=_(()=>{const t=j.clone(f);return(p==null?void 0:p.start)&&t.push(p),D(v,t!=null?t:[],"remarkAnnotations")},[f,p,v]),$=_(()=>D(v,h!=null?h:[],"annotations"),[h,v]),q=(t="")=>{const a=Z.jsonParser(tt);return G.getColorByConfig({attribute:t,config:k,style:a})};C(()=>{var t;g&&((t=N)==null||t.changeLanguage(g))},[]),C(()=>{M?H(y.text):E==null||E(y.text)},[y.text]),C(()=>{if(!(s==null?void 0:s.editAuditID))return;const t=f.filter(l=>l.auditID===s.editAuditID)[0],a=t==null?void 0:t.id,r=document.getElementById(a);if(r&&c.current){const l=r.getBoundingClientRect(),u=c.current.getBoundingClientRect(),m=l.right-u.left,d=l.bottom-u.top-r.offsetHeight;m&&d&&R({left:m,top:d})}},[s==null?void 0:s.editAuditID]);const H=t=>{var a;if(t==="")return;let r=window.getSelection();const{anchorOffset:l=0,focusOffset:u=0,anchorNode:m,focusNode:d}=r||{};if(m===d){let K=Math.min(l,u),Q=Math.max(l,u);if(y&&(c==null?void 0:c.current)&&r){const P=(a=c.current)==null?void 0:a.getBoundingClientRect(),I=r.getRangeAt(0).getBoundingClientRect(),x={left:I.right-P.left,top:I.top-P.top};x.left&&x.left&&R(x)}const U={id:Y(8,62),start:K,end:Q,text:t};w(U)}};return i.createElement("div",null,i.createElement("div",{className:`${S}-question-title`},B("textTool")),i.createElement("div",{className:et({[`${S}-question-content`]:!0}),style:{position:"relative"},onDoubleClick:t=>{t.preventDefault()}},i.createElement("div",{style:{position:"relative"}},$.map((t,a)=>{var r;const l=j.last(t.annotations);if(l){const u=q(l.attribute),m=(r=t==null?void 0:t.annotations)==null?void 0:r.find(d=>d.id===o);return i.createElement("span",{style:{backgroundColor:u.valid.stroke,color:m?"white":void 0,padding:"2px 0px"},key:a},t.text)}else return i.createElement("span",{key:a},t.text)}),(f==null?void 0:f.length)>0&&i.createElement(nt,{remarkSplitIntervals:V,remark:s}),at({remarkLayer:e==null?void 0:e.remarkLayer,setRemarkStyle:R,remarkStyle:T,remarkResut:p,setRemarkResut:w}),i.createElement("div",{className:`${S}-question-content-mask`,ref:c},v))))},ct=e=>i.createElement(z,{i18n:N},i.createElement(st,it({},e)));export{ct as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import d from"lodash";import e from"react";var p=({remarkSplitIntervals:l,remark:i})=>e.createElement("div",{style:{position:"absolute",top:0,left:0,backgroundColor:"transparent",color:"transparent"}},l.map((t,r)=>{var a;const o=d.last(t.remarkAnnotations),s=((a=t==null?void 0:t.remarkAnnotations)==null?void 0:a.find(n=>(n==null?void 0:n.auditID)===i.hoverAuditID))?"#ffc60a":"#fcdf7e";return o?e.createElement("span",{style:{borderBottom:`2px solid ${s}`,padding:"2px 0px"},id:o==null?void 0:o.id,key:r},t.text):e.createElement("span",{key:r},t.text)}));export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a from"lodash";const h=(l,i,c)=>{if(!(l==null?void 0:l.length))return[];const n=a.uniq(a.concat(0,...i.map(t=>[t.start,t.end]),l.length)).sort((t,s)=>t-s),e=[];for(let t=0;t<n.length-1;t++){const s=n[t],o=n[t+1],d=i.filter(r=>r.start>=s&&r.end<=o||s>=r.start&&o<=r.end);e.push({start:s,end:o,[c]:d,text:l.slice(s,o)})}return e};export{h as getIntervals};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var o;(function(n){n[n.Scribble=1]="Scribble",n[n.Erase=2]="Erase"})(o||(o={}));var t;(function(n){n.Rect="rectTool",n.Tag="tagTool",n.Point="pointTool",n.PointMarker="pointMarkerTool",n.Segmentation="segmentationTool",n.Filter="filterTool",n.Text="textTool",n.Polygon="polygonTool",n.Line="lineTool",n.LineMarker="lineMarkerTool",n.Empty="emptyTool",n.FolderTag="folderTagTool",n.RectTrack="rectTrackTool",n.ScribbleTool="scribbleTool",n.Face="faceTool",n.ClientAttribute="clientAttributeTool",n.OCRRelation="OCRRelationTool",n.SegmentByRect="segmentByRectTool",n.Cuboid="cuboidTool",n.PointCloudPolygon="pointCloudPolygon",n.LLM="LLMTool"})(t||(t={}));var r;(function(n){n[n.AnyString=0]="AnyString",n[n.Order=1]="Order",n[n.EnglishOnly=2]="EnglishOnly",n[n.NumberOnly=3]="NumberOnly",n[n.CustomFormat=4]="CustomFormat"})(r||(r={}));const i=1e3;export{o as EScribblePattern,r as ETextType,t as EToolName,i as TEXT_ATTRIBUTE_MAX_LENGTH};
|
|
1
|
+
var o;(function(n){n[n.Scribble=1]="Scribble",n[n.Erase=2]="Erase"})(o||(o={}));var t;(function(n){n.Rect="rectTool",n.Tag="tagTool",n.Point="pointTool",n.PointMarker="pointMarkerTool",n.Segmentation="segmentationTool",n.Filter="filterTool",n.Text="textTool",n.Polygon="polygonTool",n.Line="lineTool",n.LineMarker="lineMarkerTool",n.Empty="emptyTool",n.FolderTag="folderTagTool",n.RectTrack="rectTrackTool",n.ScribbleTool="scribbleTool",n.Face="faceTool",n.ClientAttribute="clientAttributeTool",n.OCRRelation="OCRRelationTool",n.SegmentByRect="segmentByRectTool",n.Cuboid="cuboidTool",n.PointCloudPolygon="pointCloudPolygon",n.LLM="LLMTool",n.NLP="NLPTool"})(t||(t={}));var r;(function(n){n[n.AnyString=0]="AnyString",n[n.Order=1]="Order",n[n.EnglishOnly=2]="EnglishOnly",n[n.NumberOnly=3]="NumberOnly",n[n.CustomFormat=4]="CustomFormat"})(r||(r={}));const i=1e3;export{o as EScribblePattern,r as ETextType,t as EToolName,i as TEXT_ATTRIBUTE_MAX_LENGTH};
|
package/es/hooks/annotation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRef as
|
|
1
|
+
import{useRef as f,useEffect as m}from"react";import{useDispatch as O}from"../store/ctx.js";import{ANNOTATION_ACTIONS as c}from"../store/Actions.js";const T=({basicInfo:o}={})=>{var s;const u=O(),i={valid:(s=o==null?void 0:o.valid)!=null?s:!0,exportData:()=>[[],{}],exportCustomData:()=>({}),clearResult:()=>{},singleOn:()=>{},on:()=>{},unbind:()=>{},setResult:()=>{},history:{initRecord:()=>{},pushHistory:()=>{}},setDefaultAttribute:e=>{},setForbidOperation:()=>{},setShowDefaultCursor:()=>{},setSubAttribute:(e,n)=>{},setValid:()=>{},updateRotate:()=>{},redo:()=>{},undo:()=>{},setPointCloudGlobalPattern:e=>{}},t=f(i),l=e=>{u({type:c.SET_TOOL,payload:{instance:e}})},d=()=>{u({type:c.SET_TOOL,payload:{instance:void 0}})},p=()=>{Object.assign(t.current,i)},a=()=>{t.current.emit=e=>{const n=t.current.fns.get(e);n&&n.forEach(r=>{r&&(r==null||r())})},t.current.fns=new Map,t.current.singleOn=(e,n)=>{t.current.fns.set(e,[n])},t.current.on=(e,n)=>{t.current.singleOn(e,n)},t.current.unbindAll=e=>{t.current.fns.delete(e)}};return m(()=>(a(),l(t.current),()=>{d()}),[]),{toolInstanceRef:t,clearToolInstance:p,initEventEmitter:a}};export{T as useCustomToolInstance};
|
package/es/index.css
CHANGED
|
@@ -2952,6 +2952,80 @@
|
|
|
2952
2952
|
background-color: #eeefff;
|
|
2953
2953
|
}
|
|
2954
2954
|
|
|
2955
|
+
/** NLP style */
|
|
2956
|
+
.bee-NLPLayout {
|
|
2957
|
+
overflow: hidden;
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
.bee-NLPView {
|
|
2961
|
+
height: 100%;
|
|
2962
|
+
background-color: #ffffff;
|
|
2963
|
+
overflow-y: auto;
|
|
2964
|
+
flex: auto;
|
|
2965
|
+
padding: 26px 32px;
|
|
2966
|
+
line-height: 26px;
|
|
2967
|
+
}
|
|
2968
|
+
|
|
2969
|
+
.bee-NLPView-question {
|
|
2970
|
+
flex: 1;
|
|
2971
|
+
overflow: hidden;
|
|
2972
|
+
}
|
|
2973
|
+
.bee-NLPView-question-title {
|
|
2974
|
+
font-weight: 500;
|
|
2975
|
+
font-size: 18px;
|
|
2976
|
+
margin-bottom: 24px;
|
|
2977
|
+
}
|
|
2978
|
+
.bee-NLPView-question-content {
|
|
2979
|
+
font-size: 14px;
|
|
2980
|
+
font-weight: 400;
|
|
2981
|
+
background-color: #f5f5f5;
|
|
2982
|
+
border-radius: 4px;
|
|
2983
|
+
padding: 8px;
|
|
2984
|
+
}
|
|
2985
|
+
.bee-NLPView-question-content-mask {
|
|
2986
|
+
position: absolute;
|
|
2987
|
+
left: 0px;
|
|
2988
|
+
top: 0px;
|
|
2989
|
+
background-color: transparent;
|
|
2990
|
+
color: transparent;
|
|
2991
|
+
z-index: 10;
|
|
2992
|
+
opacity: 1;
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
.bee-sidebar__content__NLPList {
|
|
2996
|
+
display: flex;
|
|
2997
|
+
flex-direction: column;
|
|
2998
|
+
}
|
|
2999
|
+
.bee-sidebar__content__NLPList__item {
|
|
3000
|
+
display: flex;
|
|
3001
|
+
align-items: center;
|
|
3002
|
+
cursor: pointer;
|
|
3003
|
+
}
|
|
3004
|
+
.bee-sidebar__content__NLPList__item .bee-sidebar-pop-remove {
|
|
3005
|
+
margin: 0px 16px;
|
|
3006
|
+
display: none;
|
|
3007
|
+
}
|
|
3008
|
+
.bee-sidebar__content__NLPList__item:hover .bee-sidebar-pop-remove {
|
|
3009
|
+
display: block;
|
|
3010
|
+
}
|
|
3011
|
+
.bee-sidebar__content__NLPList__item__text {
|
|
3012
|
+
flex: 1 1;
|
|
3013
|
+
padding: 16px;
|
|
3014
|
+
font-weight: 400;
|
|
3015
|
+
font-size: 12px;
|
|
3016
|
+
line-height: 20px;
|
|
3017
|
+
color: #666666;
|
|
3018
|
+
overflow: hidden;
|
|
3019
|
+
text-overflow: ellipsis;
|
|
3020
|
+
white-space: nowrap;
|
|
3021
|
+
}
|
|
3022
|
+
.bee-sidebar__content__NLPList__item__active {
|
|
3023
|
+
background-color: #eeefff;
|
|
3024
|
+
}
|
|
3025
|
+
.bee-sidebar__content__NLPList__item__active__text {
|
|
3026
|
+
color: #666fff;
|
|
3027
|
+
}
|
|
3028
|
+
|
|
2955
3029
|
/** longText style */
|
|
2956
3030
|
.bee-longText {
|
|
2957
3031
|
display: flex;
|
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as AnnotationView}from"./components/AnnotationView/index.js";export{default as PointCloudAnnotationView}from"./components/AnnotationView/pointCloudAnnotationView.js";export{default as QuestionView}from"./components/LLMToolView/questionView/index.js";import{i18n as c}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import n,{useState as d,useImperativeHandle as m}from"react";import{I18nextProvider as f}from"react-i18next";import{Provider as u}from"react-redux";import x from"./App.js";import w from"./configureStore.js";import{PageBackward as
|
|
1
|
+
export{default as AnnotationView}from"./components/AnnotationView/index.js";export{default as PointCloudAnnotationView}from"./components/AnnotationView/pointCloudAnnotationView.js";export{default as QuestionView}from"./components/LLMToolView/questionView/index.js";export{default as TextContent}from"./components/NLPToolView/textContent/index.js";import{i18n as c}from"@labelbee/lb-utils";export{i18n}from"@labelbee/lb-utils";import n,{useState as d,useImperativeHandle as m}from"react";import{I18nextProvider as f}from"react-i18next";import{Provider as u}from"react-redux";import x from"./App.js";import w from"./configureStore.js";import{PageBackward as P,PageForward as g,PageJump as v}from"./store/annotation/actionCreators.js";export{VideoTagTool}from"./components/videoAnnotate/videoTagTool/TagToolInstanceAdaptorI18nProvider.js";import{PointCloudProvider as T}from"./components/pointCloudView/PointCloudContext.js";import{LabelBeeContext as j}from"./store/ctx.js";export{default as PredictTracking}from"./components/predictTracking/predictTrackingIcon/index.js";export{default as LLMToolView}from"./components/LLMToolView/index.js";export{default as SwitchCuboidBoxIn2DView}from"./views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js";export{default as MeasureCanvas}from"./components/measureCanvas/index.js";export{EDataFormatType,ELLMDataType,EStepType,ESubmitType,componentCls,prefix}from"./constant/index.js";var _=Object.defineProperty,V=Object.defineProperties,b=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,p=(o,e,t)=>e in o?_(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,O=(o,e)=>{for(var t in e||(e={}))C.call(e,t)&&p(o,t,e[t]);if(s)for(var t of s(e))I.call(e,t)&&p(o,t,e[t]);return o},A=(o,e)=>V(o,b(e));const r=w(),E=(o,e)=>{const[t,l]=d();return m(e,()=>({toolInstance:t,annotationEngine:r.getState().annotation.annotationEngine,pageBackwardActions:()=>r.dispatch(P()),pageForwardActions:()=>r.dispatch(g()),pageJump:a=>{const i=~~a-1;r.dispatch(v(i))},hello:()=>alert("hello labelBee!!!")}),[t]),n.createElement(u,{store:r,context:j},n.createElement(f,{i18n:c},n.createElement(T,null,n.createElement(x,A(O({},o),{setToolInstance:a=>{var i;l(a),(i=o.onLoad)==null||i.call(o,{toolInstance:a})}})))))};var y=n.forwardRef(E);export{y as default,r as store};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFormatSize as St}from"../../components/customResizeHook/index.js";import{ESubmitType as K}from"../../constant/index.js";import Dt from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as l}from"../Actions.js";import{jsonParser as U}from"../../utils/index.js";import W from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as vt}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as rt,composeResult as Y}from"../../utils/data.js";import N from"../../utils/StepUtils.js";import J from"../../utils/ToolUtils.js";import{MathUtils as ut,CommonToolUtils as yt,AnnotationEngine as Rt,ImgUtils as Pt}from"@labelbee/lb-annotation";import{PointCloudUtils as at,i18n as F}from"@labelbee/lb-utils";import{Modal as ct}from"antd";import{message as dt}from"antd/es";import pt from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as _t}from"../../data/enums/ToolType.js";var Ct=Object.defineProperty,Ot=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable,It=(t,e,r)=>e in t?Ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n=(t,e)=>{for(var r in e||(e={}))bt.call(e,r)&&It(t,r,e[r]);if(gt)for(var r of gt(e))Ut.call(e,r)&&It(t,r,e[r]);return t},i=(t,e)=>Ot(t,ht(e)),mt=(t,e,r)=>new Promise((E,d)=>{var f=m=>{try{S(r.next(m))}catch(y){d(y)}},A=m=>{try{S(r.throw(m))}catch(y){d(y)}},S=m=>m.done?E(m.value):Promise.resolve(m.value).then(f,A);S((r=r.apply(t,e)).next())});const B=(t,e)=>t.find(r=>r.step===e),ft={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},Nt=t=>{const{imgList:e,imgPageSize:r}=t;return Math.ceil(e.length/r)},Tt=(t,e)=>t.reduce((r,E)=>{if(E){const d=E.result;if(U(d)[`step_${e}`])return r+1}return r},0)/t.length,Bt=(t,e)=>{const{step:r,stepList:E}=t,d=N.getCurrentStepInfo(r,E),f=vt.jsonParser(d.config);if(J.isVideoTool(d==null?void 0:d.tool)||J.isAudioTool(d==null?void 0:d.tool)||J.isPointCloudTool(d==null?void 0:d.tool)||_t.LLM===(d==null?void 0:d.tool))return;const A=document.getElementById("toolContainer");if(!A)throw"Not exist dom named id-toolContainer";const S=St({width:window.innerWidth,height:window.innerHeight}),m=new Rt({container:A,toolName:d.tool,size:S,imgNode:e,config:f,style:JSON.parse(Dt)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},wt=(t,e)=>(r,E)=>mt(void 0,null,function*(){var d;const{stepList:f,step:A}=E().annotation,S=N.currentToolIsVideo(A,f),m=N.currentToolIsPointCloud(A,f),y=((d=N.getCurrentStepInfo(A,f))==null?void 0:d.tool)===_t.LLM,O=N.currentToolIsAudio(A,f);if($(r,!0),yield r(xt(t)),S){r(Ft(t));return}if(m||y||O){r(jt(t));return}r(Gt(t,e))}),xt=t=>(e,r)=>mt(void 0,null,function*(){const{getFileData:E,imgList:d}=r().annotation;if(E){const f=yield E(d[t],t);e({type:l.SET_FILE_DATA,payload:{fileData:f,index:t}})}}),Ft=t=>e=>{e({type:l.LOAD_FILE_DATA,payload:{nextIndex:t}})},jt=t=>e=>{$(e,!1),e({type:l.LOAD_FILE_DATA,payload:{nextIndex:t}})},Gt=(t,e)=>(r,E)=>{var d;const{toolInstance:f,imgList:A}=E().annotation,S=(d=A==null?void 0:A[t])==null?void 0:d.url;Pt.load(S).then(m=>{$(r,!1),r({type:l.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(r,!1),f==null||f.setErrorImg(),r({type:l.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Vt=({toolInstance:t,imgList:e,imgIndex:r,stepList:E,step:d=1})=>{var f,A,S,m;const y=((f=e[r])==null?void 0:f.result)||"",[O,j,G]=(A=t==null?void 0:t.exportData())!=null?A:[],V=(m=(S=t==null?void 0:t.exportCustomData)==null?void 0:S.call(t))!=null?m:{},M=rt(y,j),k=Y(M,{step:d,stepList:E},{rect:O},V);return e.map((w,H)=>H===r?n(i(n({},w),{result:k}),G):n({},w))},Mt=(t=n({},ft),e)=>{var r,E,d,f,A,S,m,y,O,j,G,V,M,k,w,H,X,q,Z,Q,tt,et,ot,nt,st;switch(e.type){case l.INIT_ALL_STATE:return n(n({},t),ft);case l.UPDATE_TOOL_INSTANCE:return i(n({},t),{toolInstance:e.payload.toolInstance});case l.UPDATE_IMG_LIST:return i(n({},t),{imgList:e.payload.imgList});case l.CALC_STEP_PROGRESS:{const{imgList:o,step:s}=t,u=Tt(o,s);return i(n({},t),{stepProgress:u})}case l.SUBMIT_FILE_DATA:{const{imgList:o,imgIndex:s,step:u,stepList:a,toolInstance:p,onSubmit:c,resultList:T}=t;if(!p||!o[s])return t;const g=((r=o[s])==null?void 0:r.result)||"",[,_,I]=(E=p==null?void 0:p.exportData())!=null?E:[],L=(f=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?f:{},D=rt(g,_),R=Y(D,{step:u,stepList:a},{rect:T},L),v=t.imgList.map((C,P)=>{if(P===s){const x=W.dataCorrection(R,g,u,a);return n(i(n({},C),{result:x}),I)}return C});if(((A=e.payload)==null?void 0:A.submitType)===K.SyncImgList)return i(n({},t),{imgList:v});c&&c([v[s]],(S=e.payload)==null?void 0:S.submitType,s,v);const h=Tt(v,u);return i(n({},t),{stepProgress:h,imgList:v})}case l.SAVE_RESULT:{const{imgList:o,imgIndex:s,onSave:u}=t;return u==null||u(o[s],s,o),n({},t)}case l.SUBMIT_RESULT:{const{imgList:o,basicIndex:s,resultList:u,toolInstance:a,basicResultList:p}=t;if(!a)return t;const[c]=(m=a==null?void 0:a.exportData())!=null?m:[];let T=c;if((p==null?void 0:p.length)>0){const g=(y=p[s])==null?void 0:y.id,_=c.map(I=>i(n({},I),{sourceID:g}));T=pt.cloneDeep(u).filter(I=>I.sourceID!==g),T.push(..._)}return i(n({},t),{resultList:T,imgList:o})}case l.SET_BASIC_INDEX:{const{toolInstance:o,step:s,imgList:u,imgIndex:a,stepList:p,annotationEngine:c,resultList:T,basicResultList:g}=t;if(!o||!c)return t;const _=e.payload.basicIndex,I=(O=g[_])==null?void 0:O.id,L=U((j=u[a])==null?void 0:j.result),D=(T||[]).filter(x=>x.sourceID===I),R=B(p,s),{dataSourceStep:v,tool:h}=R,C=B(p,v);let P=[];return v&&h&&(P=(G=L[`step_${v}`])==null?void 0:G.result,(P==null?void 0:P.length)>0?(c==null||c.setBasicInfo(C.tool,P[_]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),dt.info(F.t("NoDependency")))),o==null||o.setResult(D),o==null||o.history.initRecord(D,!0),i(n({},t),{basicIndex:_})}case l.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:o}=e.payload;return i(n({},t),{triggerEventAfterIndexChanged:!!o})}case l.LOAD_FILE_DATA:{const{imgList:o,step:s,toolInstance:u,annotationEngine:a,stepList:p}=t;if(!u)return i(n({},t),{imgIndex:e.payload.nextIndex});const c=N.getCurrentStepInfo(s,p),{nextIndex:T,imgNode:g,nextBasicIndex:_,imgError:I}=e.payload,L=_!=null?_:0,D=U((V=o[T])==null?void 0:V.result),R=D[`step_${c.step}`],v=!R,h={rotate:(M=D.rotate)!=null?M:0,valid:(k=D.valid)!=null?k:!0};g&&I!==!0?a==null||a.setImgNode(g,h):u==null||u.setValid(h.valid);const C=B(p,c.step),{dataSourceStep:P,tool:x}=C,lt=B(p,P),it=P&&x,b=(H=(w=D[`step_${P}`])==null?void 0:w.result)!=null?H:[],z=W.getInitialResultList(R==null?void 0:R.result,u,C,b,v);if(a==null||a.launchOperation(),it&&((b==null?void 0:b.length)>0?a==null||a.setBasicInfo(lt.tool,b[L]):(a==null||a.setBasicInfo(lt.tool),a==null||a.forbidOperation(),dt.info(F.t("NoDependency")))),c.tool!=="check"){const Lt=(q=(X=b[L])==null?void 0:X.id)!=null?q:"",Et=it?z.filter(At=>yt.isSameSourceID(At.sourceID,Lt)):z;(Z=u==null?void 0:u.history)==null||Z.initRecord(z,!0),u==null||u.setResult(Et)}return i(n({},t),{imgIndex:T,basicIndex:L,basicResultList:b,resultList:z})}case l.UPDATE_ANNOTATION_CONFIG:return i(n({},t),{config:(Q=e.payload.config)!=null?Q:"{}"});case l.SET_TASK_STEP_LIST:{const{stepList:o}=e.payload;return i(n({},t),{stepList:o})}case l.SET_TASK_CONFIG:{const{stepList:o,step:s}=e.payload;return i(n({},t),{stepList:o,step:s})}case l.INIT_TOOL:{const{imgNode:o}=t,s=Bt(t,o);if(s){const{toolInstance:u,annotationEngine:a}=s;return i(n({},t),{toolInstance:u,annotationEngine:a})}return n({},t)}case l.SET_TOOL:{const o=(tt=e.payload)==null?void 0:tt.instance;return o?i(n({},t),{toolInstance:o}):n({},t)}case l.UPDATE_ON_SUBMIT:return i(n({},t),{onSubmit:e.payload.onSubmit});case l.UPDATE_ON_SAVE:return i(n({},t),{onSave:e.payload.onSave});case l.UPDATE_ON_PAGE_CHANGE:return i(n({},t),{onPageChange:e.payload.onPageChange});case l.SET_PREDICT_RESULT:return i(n({},t),{predictionResult:e.payload.result});case l.SET_PREDICT_RESULT_VISIBLE:return i(n({},t),{predictionResultVisible:e.payload.visible});case l.UPDATE_ON_STEP_CHANGE:return i(n({},t),{onStepChange:e.payload.onStepChange});case l.UPDATE_GET_FILE_DATA:return i(n({},t),{getFileData:e.payload.getFileData});case l.UPDATE_PAGE_SIZE:return i(n({},t),{pageSize:e.payload.pageSize});case l.UPDATE_LOAD_FILE_LIST:return i(n({},t),{loadFileList:e.payload.loadFileList});case l.UPDATE_BEFORE_ROTATE:return i(n({},t),{beforeRotate:e.payload.beforeRotate});case l.UPDATE_PRE_DATA_PROCESS:return i(n({},t),{preDataProcess:e.payload.preDataProcess});case l.SKIP_BEFORE_PAGE_TURNING:return i(n({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case l.SET_FILE_DATA:{const{fileData:o,index:s}=e.payload,{imgList:u}=t,a=[...u];return a[s]=n(n({},a[s]),o),i(n({},t),{imgList:a})}case l.UPDATE_ROTATE:{const{toolInstance:o,beforeRotate:s}=t;return s&&s()===!1||(et=o==null?void 0:o.updateRotate)==null||et.call(o),t}case l.UPDATE_ANNOTATION_VALID:{const{toolInstance:o}=t,s=(ot=o==null?void 0:o.valid)!=null?ot:!0;return ct.destroyAll(),ct.confirm({content:F.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{o==null||o.setValid(!s)},okText:F.t("Confirm"),cancelText:F.t("Cancel")}),t}case l.COPY_BACKWARD_RESULT:{const{toolInstance:o,imgIndex:s,imgList:u,step:a}=t;if(!o)return t;if(s===0||s>=u.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const p=u[s-1].result;if(!p)return t;const c=W.copyResultChange(p,a,(nt=u[s].result)!=null?nt:"");u[s]=i(n({},u[s]),{result:c});const g=U(c)[`step_${a}`],_=(g==null?void 0:g.result)||[];return o==null||o.setResult(_),o==null||o.history.pushHistory(_),(st=o==null?void 0:o.asyncData)==null||st.call(o,u[s]),i(n({},t),{imgList:[...u]})}case l.SET_STEP:{const{stepList:o,annotationEngine:s}=t,{toStep:u}=e.payload;if(!s)return t;const a=B(o,u);return s==null||s.setToolName(a.tool,a.config),i(n({},t),{step:u,toolInstance:s==null?void 0:s.toolInstance})}case l.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:o}=e.payload;return i(n({},t),{loadPCDFileLoading:!!o})}case l.SET_LOADING:{const{loading:o}=e.payload;return i(n({},t),{loading:!!o})}case l.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:o}=e.payload;return i(n({},t),{pointCloudLoading:!!o})}case l.SET_CHECK_MODE:{const{checkMode:o}=e.payload;return i(n({},t),{checkMode:!!o})}case l.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:o}=e.payload;return i(n({},t),{highlightAttribute:o})}case l.BATCH_UPDATE_TRACK_ID:{const{id:o,newID:s,rangeIndex:u,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,T=[],g=a.map((_,I)=>{if(ut.isInRange(I,u)){const L=i(n({},_),{result:at.batchUpdateTrackID({id:o,newID:s,result:_.result})});return T.push({imgIndex:I,newInfo:L}),L}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:T}),i(n({},t),{imgList:g})}case l.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:o,newData:s,rangeIndex:u}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,T=[],g=a.map((_,I)=>{if(ut.isInRange(I,u)){const L=i(n({},_),{result:at.batchUpdateResultByTrackID({id:o,newData:s,result:_.result})});return T.push({imgIndex:I,newInfo:L}),L}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:T}),i(n({},t),{imgList:g})}case l.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:o,imgList:s,stepList:u,step:a,predictionResult:p}=t,c={};p.forEach(I=>{const{index:L}=I;c[L]=pt.pick(I,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const T=`step_${a}`,g=[],_=s.map((I,L)=>{if(c[L]){const D=I.result==="{}"?U(Y("",{step:a,stepList:u},{rect:[]},{})):U(I.result);D[T].result.push(c[L]);const R=i(n({},I),{result:JSON.stringify(D)});return g.push({imgIndex:L,newInfo:R}),R}return I});return o==null||o(_,K.BatchUpdateImgList,-1,_,{updateImgList:g}),i(n({},t),{imgList:_})}default:return t}};export{wt as LoadFileAndFileData,Mt as annotationReducer,Vt as composeResultByToolInstance,B as getStepConfig,Nt as getTotalPage};
|
|
1
|
+
import{getFormatSize as At}from"../../components/customResizeHook/index.js";import{ESubmitType as K}from"../../constant/index.js";import Dt from"../../constant/styleString.js";import{ANNOTATION_ACTIONS as l}from"../Actions.js";import{jsonParser as w}from"../../utils/index.js";import Y from"../../utils/AnnotationDataUtils.js";import{ConfigUtils as vt}from"../../utils/ConfigUtils.js";import{composeResultWithBasicImgInfo as ut,composeResult as J}from"../../utils/data.js";import O from"../../utils/StepUtils.js";import X from"../../utils/ToolUtils.js";import{MathUtils as at,CommonToolUtils as yt,AnnotationEngine as Pt,ImgUtils as Rt}from"@labelbee/lb-annotation";import{PointCloudUtils as ct,i18n as G}from"@labelbee/lb-utils";import{Modal as dt}from"antd";import{message as pt}from"antd/es";import _t from"lodash";import{SetAnnotationLoading as $}from"./actionCreators.js";import{EToolName as W}from"../../data/enums/ToolType.js";var Ct=Object.defineProperty,Ot=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable,It=(t,e,r)=>e in t?Ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n=(t,e)=>{for(var r in e||(e={}))bt.call(e,r)&&It(t,r,e[r]);if(gt)for(var r of gt(e))Nt.call(e,r)&&It(t,r,e[r]);return t},i=(t,e)=>Ot(t,ht(e)),mt=(t,e,r)=>new Promise((S,d)=>{var A=m=>{try{T(r.next(m))}catch(y){d(y)}},f=m=>{try{T(r.throw(m))}catch(y){d(y)}},T=m=>m.done?S(m.value):Promise.resolve(m.value).then(A,f);T((r=r.apply(t,e)).next())});const x=(t,e)=>t.find(r=>r.step===e),ft={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,loadPCDFileLoading:!0,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1,checkMode:!1,predictionResult:[],predictionResultVisible:!1,highlightAttribute:""},Ut=t=>{const{imgList:e,imgPageSize:r}=t;return Math.ceil(e.length/r)},Tt=(t,e)=>t.reduce((r,S)=>{if(S){const d=S.result;if(w(d)[`step_${e}`])return r+1}return r},0)/t.length,Bt=(t,e)=>{const{step:r,stepList:S}=t,d=O.getCurrentStepInfo(r,S),A=vt.jsonParser(d.config);if(X.isVideoTool(d==null?void 0:d.tool)||X.isAudioTool(d==null?void 0:d.tool)||X.isPointCloudTool(d==null?void 0:d.tool)||[W.LLM,W.NLP].includes(d==null?void 0:d.tool))return;const f=document.getElementById("toolContainer");if(!f)throw"Not exist dom named id-toolContainer";const T=At({width:window.innerWidth,height:window.innerHeight}),m=new Pt({container:f,toolName:d.tool,size:T,imgNode:e,config:A,style:JSON.parse(Dt)});return{toolInstance:m==null?void 0:m.toolInstance,annotationEngine:m}},wt=(t,e)=>(r,S)=>mt(void 0,null,function*(){var d,A;const{stepList:f,step:T}=S().annotation,m=O.currentToolIsVideo(T,f),y=O.currentToolIsPointCloud(T,f),h=((d=O.getCurrentStepInfo(T,f))==null?void 0:d.tool)===W.LLM,b=((A=O.getCurrentStepInfo(T,f))==null?void 0:A.tool)===W.NLP,N=O.currentToolIsAudio(T,f);if($(r,!0),yield r(xt(t)),m){r(Ft(t));return}if(y||h||N||b){r(jt(t));return}r(Gt(t,e))}),xt=t=>(e,r)=>mt(void 0,null,function*(){const{getFileData:S,imgList:d}=r().annotation;if(S){const A=yield S(d[t],t);e({type:l.SET_FILE_DATA,payload:{fileData:A,index:t}})}}),Ft=t=>e=>{e({type:l.LOAD_FILE_DATA,payload:{nextIndex:t}})},jt=t=>e=>{$(e,!1),e({type:l.LOAD_FILE_DATA,payload:{nextIndex:t}})},Gt=(t,e)=>(r,S)=>{var d;const{toolInstance:A,imgList:f}=S().annotation,T=(d=f==null?void 0:f[t])==null?void 0:d.url;Rt.load(T).then(m=>{$(r,!1),r({type:l.LOAD_FILE_DATA,payload:{imgNode:m,nextIndex:t,nextBasicIndex:e}})}).catch(()=>{$(r,!1),A==null||A.setErrorImg(),r({type:l.LOAD_FILE_DATA,payload:{nextIndex:t,nextBasicIndex:e}})})},Vt=({toolInstance:t,imgList:e,imgIndex:r,stepList:S,step:d=1})=>{var A,f,T,m;const y=((A=e[r])==null?void 0:A.result)||"",[h,b,N]=(f=t==null?void 0:t.exportData())!=null?f:[],V=(m=(T=t==null?void 0:t.exportCustomData)==null?void 0:T.call(t))!=null?m:{},M=ut(y,b),k=J(M,{step:d,stepList:S},{rect:h},V);return e.map((F,H)=>H===r?n(i(n({},F),{result:k}),N):n({},F))},Mt=(t=n({},ft),e)=>{var r,S,d,A,f,T,m,y,h,b,N,V,M,k,F,H,q,Z,Q,tt,et,ot,nt,st,lt;switch(e.type){case l.INIT_ALL_STATE:return n(n({},t),ft);case l.UPDATE_TOOL_INSTANCE:return i(n({},t),{toolInstance:e.payload.toolInstance});case l.UPDATE_IMG_LIST:return i(n({},t),{imgList:e.payload.imgList});case l.CALC_STEP_PROGRESS:{const{imgList:o,step:s}=t,u=Tt(o,s);return i(n({},t),{stepProgress:u})}case l.SUBMIT_FILE_DATA:{const{imgList:o,imgIndex:s,step:u,stepList:a,toolInstance:p,onSubmit:c,resultList:L}=t;if(!p||!o[s])return t;const g=((r=o[s])==null?void 0:r.result)||"",[,_,I]=(S=p==null?void 0:p.exportData())!=null?S:[],E=(A=(d=p==null?void 0:p.exportCustomData)==null?void 0:d.call(p))!=null?A:{},D=ut(g,_),P=J(D,{step:u,stepList:a},{rect:L},E),v=t.imgList.map((C,R)=>{if(R===s){const j=Y.dataCorrection(P,g,u,a);return n(i(n({},C),{result:j}),I)}return C});if(((f=e.payload)==null?void 0:f.submitType)===K.SyncImgList)return i(n({},t),{imgList:v});c&&c([v[s]],(T=e.payload)==null?void 0:T.submitType,s,v);const U=Tt(v,u);return i(n({},t),{stepProgress:U,imgList:v})}case l.SAVE_RESULT:{const{imgList:o,imgIndex:s,onSave:u}=t;return u==null||u(o[s],s,o),n({},t)}case l.SUBMIT_RESULT:{const{imgList:o,basicIndex:s,resultList:u,toolInstance:a,basicResultList:p}=t;if(!a)return t;const[c]=(m=a==null?void 0:a.exportData())!=null?m:[];let L=c;if((p==null?void 0:p.length)>0){const g=(y=p[s])==null?void 0:y.id,_=c.map(I=>i(n({},I),{sourceID:g}));L=_t.cloneDeep(u).filter(I=>I.sourceID!==g),L.push(..._)}return i(n({},t),{resultList:L,imgList:o})}case l.SET_BASIC_INDEX:{const{toolInstance:o,step:s,imgList:u,imgIndex:a,stepList:p,annotationEngine:c,resultList:L,basicResultList:g}=t;if(!o||!c)return t;const _=e.payload.basicIndex,I=(h=g[_])==null?void 0:h.id,E=w((b=u[a])==null?void 0:b.result),D=(L||[]).filter(j=>j.sourceID===I),P=x(p,s),{dataSourceStep:v,tool:U}=P,C=x(p,v);let R=[];return v&&U&&(R=(N=E[`step_${v}`])==null?void 0:N.result,(R==null?void 0:R.length)>0?(c==null||c.setBasicInfo(C.tool,R[_]),c==null||c.launchOperation()):(c==null||c.setBasicInfo(C.tool),c==null||c.forbidOperation(),pt.info(G.t("NoDependency")))),o==null||o.setResult(D),o==null||o.history.initRecord(D,!0),i(n({},t),{basicIndex:_})}case l.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:{const{triggerEventAfterIndexChanged:o}=e.payload;return i(n({},t),{triggerEventAfterIndexChanged:!!o})}case l.LOAD_FILE_DATA:{const{imgList:o,step:s,toolInstance:u,annotationEngine:a,stepList:p}=t;if(!u)return i(n({},t),{imgIndex:e.payload.nextIndex});const c=O.getCurrentStepInfo(s,p),{nextIndex:L,imgNode:g,nextBasicIndex:_,imgError:I}=e.payload,E=_!=null?_:0,D=w((V=o[L])==null?void 0:V.result),P=D[`step_${c.step}`],v=!P,U={rotate:(M=D.rotate)!=null?M:0,valid:(k=D.valid)!=null?k:!0};g&&I!==!0?a==null||a.setImgNode(g,U):u==null||u.setValid(U.valid);const C=x(p,c.step),{dataSourceStep:R,tool:j}=C,it=x(p,R),rt=R&&j,B=(H=(F=D[`step_${R}`])==null?void 0:F.result)!=null?H:[],z=Y.getInitialResultList(P==null?void 0:P.result,u,C,B,v);if(a==null||a.launchOperation(),rt&&((B==null?void 0:B.length)>0?a==null||a.setBasicInfo(it.tool,B[E]):(a==null||a.setBasicInfo(it.tool),a==null||a.forbidOperation(),pt.info(G.t("NoDependency")))),c.tool!=="check"){const Lt=(Z=(q=B[E])==null?void 0:q.id)!=null?Z:"",Et=rt?z.filter(St=>yt.isSameSourceID(St.sourceID,Lt)):z;(Q=u==null?void 0:u.history)==null||Q.initRecord(z,!0),u==null||u.setResult(Et)}return i(n({},t),{imgIndex:L,basicIndex:E,basicResultList:B,resultList:z})}case l.UPDATE_ANNOTATION_CONFIG:return i(n({},t),{config:(tt=e.payload.config)!=null?tt:"{}"});case l.SET_TASK_STEP_LIST:{const{stepList:o}=e.payload;return i(n({},t),{stepList:o})}case l.SET_TASK_CONFIG:{const{stepList:o,step:s}=e.payload;return i(n({},t),{stepList:o,step:s})}case l.INIT_TOOL:{const{imgNode:o}=t,s=Bt(t,o);if(s){const{toolInstance:u,annotationEngine:a}=s;return i(n({},t),{toolInstance:u,annotationEngine:a})}return n({},t)}case l.SET_TOOL:{const o=(et=e.payload)==null?void 0:et.instance;return o?i(n({},t),{toolInstance:o}):n({},t)}case l.UPDATE_ON_SUBMIT:return i(n({},t),{onSubmit:e.payload.onSubmit});case l.UPDATE_ON_SAVE:return i(n({},t),{onSave:e.payload.onSave});case l.UPDATE_ON_PAGE_CHANGE:return i(n({},t),{onPageChange:e.payload.onPageChange});case l.SET_PREDICT_RESULT:return i(n({},t),{predictionResult:e.payload.result});case l.SET_PREDICT_RESULT_VISIBLE:return i(n({},t),{predictionResultVisible:e.payload.visible});case l.UPDATE_ON_STEP_CHANGE:return i(n({},t),{onStepChange:e.payload.onStepChange});case l.UPDATE_GET_FILE_DATA:return i(n({},t),{getFileData:e.payload.getFileData});case l.UPDATE_PAGE_SIZE:return i(n({},t),{pageSize:e.payload.pageSize});case l.UPDATE_LOAD_FILE_LIST:return i(n({},t),{loadFileList:e.payload.loadFileList});case l.UPDATE_BEFORE_ROTATE:return i(n({},t),{beforeRotate:e.payload.beforeRotate});case l.UPDATE_PRE_DATA_PROCESS:return i(n({},t),{preDataProcess:e.payload.preDataProcess});case l.SKIP_BEFORE_PAGE_TURNING:return i(n({},t),{skipBeforePageTurning:e.payload.skipBeforePageTurning});case l.SET_FILE_DATA:{const{fileData:o,index:s}=e.payload,{imgList:u}=t,a=[...u];return a[s]=n(n({},a[s]),o),i(n({},t),{imgList:a})}case l.UPDATE_ROTATE:{const{toolInstance:o,beforeRotate:s}=t;return s&&s()===!1||(ot=o==null?void 0:o.updateRotate)==null||ot.call(o),t}case l.UPDATE_ANNOTATION_VALID:{const{toolInstance:o}=t,s=(nt=o==null?void 0:o.valid)!=null?nt:!0;return dt.destroyAll(),dt.confirm({content:G.t(s?"updateValidFromValidToInValid":"updateValidFromInValidToValid"),onOk:()=>{o==null||o.setValid(!s)},okText:G.t("Confirm"),cancelText:G.t("Cancel")}),t}case l.COPY_BACKWARD_RESULT:{const{toolInstance:o,imgIndex:s,imgList:u,step:a}=t;if(!o)return t;if(s===0||s>=u.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),t;const p=u[s-1].result;if(!p)return t;const c=Y.copyResultChange(p,a,(st=u[s].result)!=null?st:"");u[s]=i(n({},u[s]),{result:c});const g=w(c)[`step_${a}`],_=(g==null?void 0:g.result)||[];return o==null||o.setResult(_),o==null||o.history.pushHistory(_),(lt=o==null?void 0:o.asyncData)==null||lt.call(o,u[s]),i(n({},t),{imgList:[...u]})}case l.SET_STEP:{const{stepList:o,annotationEngine:s}=t,{toStep:u}=e.payload;if(!s)return t;const a=x(o,u);return s==null||s.setToolName(a.tool,a.config),i(n({},t),{step:u,toolInstance:s==null?void 0:s.toolInstance})}case l.SET_LOADPCDFILE_LOADING:{const{loadPCDFileLoading:o}=e.payload;return i(n({},t),{loadPCDFileLoading:!!o})}case l.SET_LOADING:{const{loading:o}=e.payload;return i(n({},t),{loading:!!o})}case l.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:o}=e.payload;return i(n({},t),{pointCloudLoading:!!o})}case l.SET_CHECK_MODE:{const{checkMode:o}=e.payload;return i(n({},t),{checkMode:!!o})}case l.SET_HIGHLIGHT_ATTRIBUTE:{const{attribute:o}=e.payload;return i(n({},t),{highlightAttribute:o})}case l.BATCH_UPDATE_TRACK_ID:{const{id:o,newID:s,rangeIndex:u,imgList:a}=e.payload,{imgIndex:p,onSubmit:c}=t,L=[],g=a.map((_,I)=>{if(at.isInRange(I,u)){const E=i(n({},_),{result:ct.batchUpdateTrackID({id:o,newID:s,result:_.result})});return L.push({imgIndex:I,newInfo:E}),E}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:L}),i(n({},t),{imgList:g})}case l.BATCH_UPDATE_RESULT_BY_TRACK_ID:{const{id:o,newData:s,rangeIndex:u}=e.payload,{imgList:a,imgIndex:p,onSubmit:c}=t,L=[],g=a.map((_,I)=>{if(at.isInRange(I,u)){const E=i(n({},_),{result:ct.batchUpdateResultByTrackID({id:o,newData:s,result:_.result})});return L.push({imgIndex:I,newInfo:E}),E}return _});return c&&c([g[p]],K.BatchUpdateTrackID,p,g,{updateImgList:L}),i(n({},t),{imgList:g})}case l.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT:{const{onSubmit:o,imgList:s,stepList:u,step:a,predictionResult:p}=t,c={};p.forEach(I=>{const{index:E}=I;c[E]=_t.pick(I,["center","width","height","depth","rotation","id","attribute","valid","trackID"])});const L=`step_${a}`,g=[],_=s.map((I,E)=>{if(c[E]){const D=I.result==="{}"?w(J("",{step:a,stepList:u},{rect:[]},{})):w(I.result);D[L].result.push(c[E]);const P=i(n({},I),{result:JSON.stringify(D)});return g.push({imgIndex:E,newInfo:P}),P}return I});return o==null||o(_,K.BatchUpdateImgList,-1,_,{updateImgList:g}),i(n({},t),{imgList:_})}default:return t}};export{wt as LoadFileAndFileData,Mt as annotationReducer,Vt as composeResultByToolInstance,x as getStepConfig,Ut as getTotalPage};
|
package/es/store/ctx.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"react";import{createDispatchHook as o,createSelectorHook as s}from"react-redux";const t=e.createContext(void 0),r=o(t),c=s(t),n=e.createContext({hoverKey:-1,newAnswerList:[],setHoverKey:()=>{},modelAPIResponse:[],setModelAPIResponse:()=>{},setNewAnswerList:()=>{}}),a=e.createContext({highlightKey:"",setHighlightKey:()=>{}});export{n as LLMContext,t as LabelBeeContext,a as NLPContext,r as useDispatch,c as useSelector};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{prefix as a}from"../../../constant/index.js";import{Layout as r}from"antd/es";import t,{useState as d,useMemo as c}from"react";import s from"../sidebar/index.js";import u from"../toolFooter/index.js";import{getClassName as f}from"../../../utils/dom.js";import{classnames as y}from"../../../utils/index.js";import{NLPContext as h}from"../../../store/ctx.js";import v from"../../../components/NLPToolView/index.js";const{Sider:L,Content:x}=r,n=`${a}-layout`,N=e=>{var o,l;const[i,m]=d("");return t.createElement(r,{className:f("layout","container")},t.createElement(h.Provider,{value:c(()=>({highlightKey:i,setHighlightKey:m}),[i])},e==null?void 0:e.leftSider,t.createElement(x,{className:y({[`${n}__content`]:!0,[`${a}-NLPLayout`]:!0})},t.createElement(v,{checkMode:e.checkMode,showTips:e.showTips,tips:e.tips,remarkLayer:e==null?void 0:e.remarkLayer,remark:e==null?void 0:e.remark}),t.createElement(u,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer})),t.createElement(L,{className:`${n}__side`,width:400,style:{position:"relative"}},t.createElement(s,{sider:e==null?void 0:e.sider,checkMode:e==null?void 0:e.checkMode}),(l=e.drawLayerSlot)==null?void 0:l.call(e,{}))))};export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ViewportProvider as
|
|
1
|
+
import{ViewportProvider as b}from"../../components/customResizeHook/index.js";import{prefix as C}from"../../constant/index.js";import{Spin as A}from"antd";import{Layout as E}from"antd/es";import t,{useState as O}from"react";import V from"./annotationOperation/index.js";import M from"./annotationTips/index.js";import k from"./sidebar/index.js";import h from"./toolFooter/index.js";import F from"./toolHeader/index.js";import{getStepConfig as _}from"../../store/annotation/reducer.js";import I from"../../components/videoAnnotate/index.js";import{connect as $}from"react-redux";import g from"../../utils/ToolUtils.js";import H from"../../components/pointCloudView/index.js";import{getClassName as R}from"../../utils/dom.js";import{classnames as W}from"../../utils/index.js";import B from"../../components/predictTracking/previewResult/index.js";import{LabelBeeContext as D}from"../../store/ctx.js";import{EToolName as c}from"../../data/enums/ToolType.js";import U from"./LLMLayout/index.js";import z from"./NLPLayout/index.js";import q from"../../components/audioAnnotate/index.js";import{LoadingOutlined as G}from"@ant-design/icons";import{useTranslation as J}from"react-i18next";import{EPointCloudName as K}from"@labelbee/lb-annotation";var Q=Object.defineProperty,T=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,P=(e,o,n)=>o in e?Q(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,i=(e,o)=>{for(var n in o||(o={}))X.call(o,n)&&P(e,n,o[n]);if(T)for(var n of T(o))Y.call(o,n)&&P(e,n,o[n]);return e};const{Sider:Z,Content:p}=E,u=`${C}-layout`,ee=e=>{var o;return t.createElement(t.Fragment,null,e.showTips===!0&&t.createElement(M,{path:e.path,tips:e.tips}),t.createElement(V,i({},e)),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},te=e=>{var o;return t.createElement(t.Fragment,null,t.createElement(H,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit,measureVisible:e.measureVisible}),t.createElement(h,{style:(o=e.style)==null?void 0:o.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},oe=e=>{var o;const{stepList:n,step:r}=e,a=(o=_(n,r))==null?void 0:o.tool,m=g.isPointCloudTool(a),l=g.isVideoTool(a);return m?t.createElement(te,i({},e)):l?t.createElement(I,{drawLayerSlot:e.drawLayerSlot,footer:e.footer}):t.createElement(ee,i({},e))},f=e=>{var o,n,r;const{t:a}=J(),{stepList:m,step:l}=e,d=(o=_(m,l))==null?void 0:o.tool,s=![c.LLM,c.NLP].includes(d),v=![c.LLM,c.NLP].includes(d),L=[K.PointCloud].includes(d);return t.createElement(b,null,t.createElement(A,{spinning:e.loading,indicator:t.createElement(G,null),tip:t.createElement("span",{style:{marginTop:200}},a("LoadingTips")),delay:500},t.createElement(E,{className:W([u,e.className]),style:(n=e.style)==null?void 0:n.layout},t.createElement("header",{className:`${u}__header`,style:(r=e.style)==null?void 0:r.header},t.createElement(F,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:s,hasHeaderOption:v,hasPredictTrackingIcon:L})),e.children)))},ne=e=>{var o,n,r,a,m,l,d;const[s,v]=O(void 0),L=(n=(o=e.style)==null?void 0:o.sider)==null?void 0:n.width,{stepList:x,step:N}=e,y=(r=_(x,N))==null?void 0:r.tool,j=c.LLM===y,w=c.NLP===y,S=g.isAudioTool(y);return j?t.createElement(f,i({},e),t.createElement(U,i({},e))):w?t.createElement(f,i({},e),t.createElement(z,i({},e))):S?t.createElement(f,i({},e),t.createElement(q,i({},e))):t.createElement(f,i({},e),t.createElement(E,{className:R("layout","container")},e==null?void 0:e.leftSider,t.createElement(p,{className:`${u}__content`},t.createElement(oe,i({},e)),t.createElement(B,null)),t.createElement(Z,{className:`${u}__side`,width:(a=s!=null?s:L)!=null?a:240,style:(m=e.style)==null?void 0:m.sider},t.createElement(k,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:v,propsSiderWidth:(d=(l=e.style)==null?void 0:l.sider)==null?void 0:d.width}))))},le=({annotation:e})=>{var o,n,r;const{imgList:a,loading:m}=e,l=(o=a[e.imgIndex])!=null?o:{};return{path:(r=(n=l==null?void 0:l.path)!=null?n:l==null?void 0:l.url)!=null?r:"",loading:m}};var ie=$(le,null,null,{context:D})(ne);export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import s,{useState as
|
|
1
|
+
import s,{useState as d,useCallback as B}from"react";import{connect as g}from"react-redux";import I from"../../../../utils/StepUtils.js";import{jsonParser as v}from"../../../../utils/index.js";import C from"./ActionsConfirm.js";import y from"./useOperationList.js";import{LabelBeeContext as S}from"../../../../store/ctx.js";import U from"../../../../assets/annotation/pointCloudTool/unitAttribute.svg.js";import w from"../../../../assets/annotation/pointCloudTool/unitAttributeForbid.svg.js";import T from"../../../../assets/annotation/pointCloudTool/unitAttributeHover.svg.js";import{useTranslation as V}from"react-i18next";import A from"../../../../components/pointCloudView/components/UnifyParamsModal/index.js";import{useSingleBox as E}from"../../../../components/pointCloudView/hooks/useSingleBox.js";import{composeResultByToolInstance as M}from"../../../../store/annotation/reducer.js";import{useStatus as R}from"../../../../components/pointCloudView/hooks/useStatus.js";const x=o=>{var t,i;const n=I.getCurrentStepInfo((t=o.annotation)==null?void 0:t.step,(i=o.annotation)==null?void 0:i.stepList);return{toolInstance:o.annotation.toolInstance,stepInfo:n,imgList:o.annotation.imgList,imgIndex:o.annotation.imgIndex,stepList:o.annotation.stepList}},$=({toolInstance:o,stepInfo:t,hideValidity:i})=>{const n=y(o),r=v(t==null?void 0:t.config),e=[n.empty];return(t==null?void 0:t.dataSourceStep)===0&&!i&&e.push(n.setValidity),(r==null?void 0:r.copyBackwardResult)&&e.push(n.copyPrevious),s.createElement(C,{allOperation:e})},D=g(x,null,null,{context:S})(({toolInstance:o,stepInfo:t,imgList:i,stepList:n,imgIndex:r})=>{const{t:e}=V(),{selectedBox:m}=E(),c=y(o),[P,u]=d(!1),[j,L]=d([]),{isPointCloudDetectionPattern:b,isPointCloudSegmentationPattern:k}=R(),p=v(t.config);let a=[c.copyPrevious,c.empty,c.setValidity];if(b&&p.trackConfigurable===!0){const l=!m,O={name:e("UnifyParams"),key:"UnifyParams",imgSvg:l?w:U,hoverSvg:T,onClick:()=>{L(M({toolInstance:o,imgList:i,imgIndex:r,stepList:n})),u(!0)},forbidConfirm:!0,forbidOperation:l};a.unshift(O)}const h=B(()=>{u(!1)},[]),f=m==null?void 0:m.info;return k&&(a=a.filter(l=>!["setValidity","copyPrevious"].includes(l.key))),s.createElement(s.Fragment,null,s.createElement(C,{allOperation:a}),s.createElement(A,{id:f==null?void 0:f.trackID,visible:P,onCancel:h,config:p,imgList:j}))});var F=g(x,null,null,{context:S})($);export{D as PointCloudOperation,F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o,{useState as _,useRef as N,useEffect as $}from"react";import{connect as A}from"react-redux";import P from"../../../../utils/StepUtils.js";import{useTranslation as E}from"react-i18next";import{LabelBeeContext as T}from"../../../../store/ctx.js";import{prefix as f}from"../../../../constant/index.js";import{classnames as S}from"../../../../utils/index.js";import{Tooltip as I,Popconfirm as R}from"antd";import{CloseOutlined as j}from"@ant-design/icons";const i=`${f}-sidebar`,k=l=>{var a,r;const[u,x]=_(0),g=N(null),{toolInstance:e,checkMode:h}=l,{t:s}=E(),[p,L]=_("");$(()=>(e&&e.singleOn("changeAttributeSidebar",t=>{x(n=>n+1)}),()=>{e==null||e.unbindAll("changeAttributeSidebar")}),[e,g]);const[d]=e.exportData(),c=(r=(a=d==null?void 0:d[0])==null?void 0:a.textAnnotation)!=null?r:[],C=t=>{let n=t===p?"":t;e==null||e.setHighlightKey(n),L(n)},b=t=>{e==null||e.deleteTextAnnotation(t.id)};return(c==null?void 0:c.length)===0?null:o.createElement("div",{className:`${i}__content__NLPList`},c.map((t,n)=>{const v=p===t.id;return o.createElement("div",{key:n,className:S({[`${i}__content__NLPList__item`]:!0,[`${i}__content__NLPList__item__active`]:v}),onClick:()=>C(t.id)},o.createElement(I,{title:t.text},o.createElement("span",{className:`${i}__content__NLPList__item__text`},`${t.attribute||s("NoAttribute")}\uFF0C${s("textTool")}\uFF1A${t.text}`)),!h&&o.createElement(R,{title:s("DeleteCommentConfirm"),placement:"topRight",okText:s("Confirm"),cancelText:s("Cancel"),getPopupContainer:m=>m.parentElement,onConfirm:()=>b(t),overlayClassName:`${f}-pop-confirm`},o.createElement(j,{className:`${i}-pop-remove`,onClick:m=>{m.stopPropagation()}})))}))},y=l=>{var a,r;const u=P.getCurrentStepInfo((a=l.annotation)==null?void 0:a.step,(r=l.annotation)==null?void 0:r.stepList);return{toolInstance:l.annotation.toolInstance,stepInfo:u}};var F=A(y,null,null,{context:T})(k);export{F as default,i as sidebarCls};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{connect as a}from"react-redux";import{LabelBeeContext as s}from"../../../../store/ctx.js";import{prefix as m}from"../../../../constant/index.js";import l from"../SwitchAttributeList/index.js";import c from"../GeneralOperation/index.js";import u from"./NLPAnnotatedList.js";import d from"./indicatorDetermine.js";const L=({setAttributeLockList:t,checkMode:r})=>r?null:e.createElement(l,{attributeLockChange:t}),n=`${m}-sidebar`,p=({toolInstance:t,checkMode:r})=>{const i=o=>{t==null||t.setAttributeLockList(o)};return e.createElement("div",{className:`${n}`},e.createElement("div",{className:`${n}__content`},e.createElement(d,{checkMode:r}),e.createElement(L,{setAttributeLockList:i,checkMode:r}),e.createElement(u,{checkMode:r}),";"),!r&&e.createElement(c,{hideValidity:!0}))};function f(t){return{toolInstance:t.annotation.toolInstance,imgIndex:t.annotation.imgIndex}}var b=a(f,null,null,{context:s})(p);export{b as default,n as sidebarCls};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import s,{useState as O,useEffect as b}from"react";import{connect as w}from"react-redux";import h from"../../../../utils/StepUtils.js";import{useTranslation as j}from"react-i18next";import{LabelBeeContext as S}from"../../../../store/ctx.js";import{jsonParser as E}from"../../../../utils/index.js";import L from"../../../../components/LLMToolView/sidebar/components/determineGroup/index.js";var R=Object.defineProperty,V=Object.defineProperties,T=Object.getOwnPropertyDescriptors,_=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,g=(t,e,n)=>e in t?R(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,f=(t,e)=>{for(var n in e||(e={}))k.call(e,n)&&g(t,n,e[n]);if(_)for(var n of _(e))A.call(e,n)&&g(t,n,e[n]);return t},B=(t,e)=>V(t,T(e));const C=t=>{const{toolInstance:e,stepInfo:n,checkMode:c,imgIndex:x}=t,[v]=e.exportData(),o=v==null?void 0:v[0],{t:I}=j(),[M,D]=O(0);b(()=>(e&&e.on("changeIndicatorDetermine",a=>{D(r=>r+1)}),()=>{e==null||e.unbindAll("changeIndicatorDetermine")}),[e,x]);const y=E(n.config),{indicatorDetermine:p}=y,P=a=>{var r;const{value:u,key:i}=a;if(i){const d={[i]:u},l=(r=o==null?void 0:o.indicatorDetermine)!=null?r:{},m=B(f({},o),{indicatorDetermine:f(f({},l),d)});e.setResult(m)}};if((p==null?void 0:p.length)>0){const a=p.filter(r=>r==null?void 0:r.label);return s.createElement("div",{style:{padding:"12px",marginBottom:"12px"}},s.createElement("div",{style:{fontSize:"16px",fontWeight:500,lineHeight:"46px"}},I("IndicatorJudgment")),s.createElement("div",{style:{maxHeight:"400px",overflow:"auto"}},a.map((r,u)=>{var i;const{label:d,value:l}=r;return s.createElement(L,{selectValue:(i=o==null?void 0:o.indicatorDetermine)==null?void 0:i[l],title:d,updateValue:m=>{P({key:l,value:m})},key:u,isDisableAll:c})})))}return null},G=t=>{var e,n;const c=h.getCurrentStepInfo((e=t.annotation)==null?void 0:e.step,(n=t.annotation)==null?void 0:n.stepList);return{toolInstance:t.annotation.toolInstance,stepInfo:c,imgIndex:t.annotation.imgIndex}};var H=w(G,null,null,{context:S})(C);export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import d,{useState as p,useRef as v,useEffect as S}from"react";import{connect as g}from"react-redux";import A from"../../../../components/attributeList/index.js";import I from"../../../../utils/StepUtils.js";import{jsonParser as L}from"../../../../utils/index.js";import{useTranslation as h}from"react-i18next";import{EToolName as x}from"../../../../data/enums/ToolType.js";import{LabelBeeContext as T}from"../../../../store/ctx.js";const j=e=>{var o;const[c,i]=p(0),l=v(null),{toolInstance:t,attributeLockChange:f}=e,{t:b}=h();if(S(()=>(t&&t.singleOn("changeAttributeSidebar",a=>{var s;i(n=>n+1),!!l.current&&((s=l.current.children[a])==null||s.scrollIntoView({block:"center"}))}),()=>{t==null||t.unbindAll("changeAttributeSidebar")}),[t,l]),!e.stepInfo)return null;const r=L(e.stepInfo.config),u=e.stepInfo.tool===x.ScribbleTool;if(r.attributeConfigurable!==!0&&!u)return null;if((r.attributeConfigurable===!0||u)&&(r==null?void 0:r.attributeList)){const a=r.attributeList.map(n=>({label:n.key,value:n.value,color:n==null?void 0:n.color}));u||a.unshift({label:b("NoAttribute"),value:""});const s=n=>{t&&(t.setDefaultAttribute(n),i(m=>m+1))};return d.createElement(A,{list:a,attributeChanged:s,selectedAttribute:(o=t==null?void 0:t.defaultAttribute)!=null?o:"",ref:l,forbidDefault:u,attributeLockChange:f})}return null},C=e=>{var o,c;const i=I.getCurrentStepInfo((o=e.annotation)==null?void 0:o.step,(c=e.annotation)==null?void 0:c.stepList);return{toolInstance:e.annotation.toolInstance,stepInfo:i}};var _=g(C,null,null,{context:T})(j);export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{prefix as
|
|
1
|
+
import{prefix as M}from"../../../constant/index.js";import{EToolName as o}from"../../../data/enums/ToolType.js";import R from"../../../utils/StepUtils.js";import{Collapse as d}from"antd/es";import e,{useState as z}from"react";import{useTranslation as D}from"react-i18next";import G from"./AnnotationText/index.js";import U from"./ClearIcon/index.js";import q,{PointCloudOperation as L}from"./GeneralOperation/index.js";import H from"./ImgAttributeInfo/index.js";import J from"./SwitchAttributeList/index.js";import u,{expandIconFuc as _}from"./TagSidebar/index.js";import p from"./TextToolSidebar/index.js";import $ from"./PointCloudToolSidebar/index.js";import Q from"./ToolStyle/index.js";import{cTool as W}from"@labelbee/lb-annotation";import X from"./ScribbleSidebar/index.js";import{ToolIcons as Y}from"./ToolIcons.js";import{useSelector as Z}from"../../../store/ctx.js";import{Tabs as I}from"antd";import{classnames as ee}from"../../../utils/index.js";import P from"../../../assets/annotation/common/icon_menu_fold.svg.js";import te from"../../../components/LLMToolView/sidebar/index.js";import ne from"./NLPSidebar/index.js";import oe from"../../../components/videoAnnotate/videoClipTool/components/annotatedList/index.js";const{EVideoToolName:f,EPointCloudName:re}=W,{Panel:A}=d,t=`${M}-sidebar`,ie=({sider:l,enableColorPicker:w,setSiderWidth:E,propsSiderWidth:le,checkMode:b})=>{const x=Z(r=>R.getCurrentStepInfo(r.annotation.step,r.annotation.stepList)),[c,V]=z(!0),n=x==null?void 0:x.tool,{t:S}=D();if(!n)return null;const k=r=>{const s=e.createElement(Q,null);return e.createElement(A,{header:S("Style"),className:"panel",key:r},s)},T=e.createElement(Y,{toolName:n,onChange:()=>{}}),a=e.createElement(J,null),g=e.createElement(G,null),N=e.createElement(d,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:_},k("1")),v=e.createElement(d,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:_},e.createElement(A,{header:e.createElement("div",null,S("Adjust"),e.createElement(U,null)),className:"panel",key:"imgAttribute"},e.createElement(H,null))),i=e.createElement(q,null),B=e.createElement(u,null),O=r=>e.createElement(p,{disabled:r}),h=e.createElement(X,{onChange:(r,s)=>{}}),C=e.createElement(oe,null),y=e.createElement(te,{checkMode:b}),j=e.createElement(ne,{checkMode:b}),m=e.createElement("div",{className:`${t}__horizontal`}),F=e.createElement($,{enableColorPicker:w}),K=e.createElement(L,null);if(l)return typeof l=="function"?e.createElement("div",{className:`${t}`},l({toolIcon:T,attributeList:a,annotationText:g,toolStyle:N,imageAttributeInfo:v,operation:i,tagToolSideBar:B,textToolSideBar:O,horizontal:m,pointCloudToolSidebar:F,pointCloudOperation:K,scribbleSidebar:h,LLMSidebar:y,videoClipSidebar:C,NLPSidebar:j})):l;if([o.Rect,o.Point,o.Line,o.Rect,o.Polygon,o.Cuboid].includes(n))return e.createElement("div",{className:`${t}`},T,m,a,g,m,e.createElement("div",{className:`${t}__content`},N,v),i);if(n===o.Tag)return e.createElement("div",{className:`${t}`},e.createElement(u,null));if(n===f.VideoClipTool)return e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},C,a),i);if(n===f.VideoTagTool)return e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},e.createElement(u,null)),i);if(n===f.VideoTextTool)return e.createElement("div",{className:`${t}`},e.createElement(p,null));if(n===o.Text)return e.createElement("div",{className:`${t}`},"s",e.createElement(p,null));if(n===re.PointCloud){const r=()=>{V(!c),E&&E(c?48:void 0)},s=e.createElement("div",{style:{width:"48px",height:"100%",display:"flex",justifyContent:"center",background:"#ffffff"}},e.createElement("span",{onClick:()=>r()},e.createElement("img",{style:{width:"16px",height:"16px",marginTop:"18px",cursor:"pointer",transform:"rotate(180deg)"},src:P})));return c?e.createElement(I,{type:"card",activeKey:"1",className:ee({[`${t}`]:!0,[`${t}__pointCloud`]:!0}),tabBarExtraContent:{left:e.createElement("span",{onClick:()=>r(),style:{padding:"0px 4px"}},e.createElement("img",{style:{width:"16px",height:"16px",marginLeft:"4px",cursor:"pointer"},src:P}))}},e.createElement(I.TabPane,{tab:"\u5DE5\u5177\u9762\u677F",key:"1",style:{height:"100%",display:"flex",flexDirection:"column"}},e.createElement("div",{className:`${t}__content`},e.createElement($,null)),e.createElement(L,null))):s}return n===o.ScribbleTool?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},h,a),i):n===o.LLM?y:n===o.NLP?j:null};export{ie as default,t as sidebarCls};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{backward as o,forward as r}from"../common/index.js";const a=[o,r];export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useContext as v}from"react";import k from"../../../../../assets/annotation/toolHotKeyIcon/icon_kj1.svg.js";import
|
|
1
|
+
import e,{useContext as v}from"react";import k from"../../../../../assets/annotation/toolHotKeyIcon/icon_kj1.svg.js";import L from"../../../../../assets/annotation/toolHotKeyIcon/icon_kj_h.svg.js";import{EToolName as l}from"../../../../../data/enums/ToolType.js";import N from"./rectToolShortCutTable/index.js";import w from"./point/index.js";import O from"./polygon/index.js";import I from"./line/index.js";import H from"./tag/index.js";import R from"./text/index.js";import G from"./videoTag/index.js";import M,{pointCloudShortCutTable_POLYGON as K,pointCloudShortCutTable_SEGMENT as V}from"./pointCloud/index.js";import A from"./scribble/index.js";import W from"./cuboid/index.js";import Y from"./LLM/index.js";import $ from"./NLP/index.js";import B from"./audioText/index.js";import{footerCls as D}from"../../index.js";import{useTranslation as F}from"react-i18next";import{EAudioToolName as z,cTool as U}from"@labelbee/lb-annotation";import{PointCloudContext as q}from"../../../../../components/pointCloudView/PointCloudContext.js";import J from"../../FooterPopover.js";import{EPointCloudPattern as T}from"@labelbee/lb-utils";var Q=Object.defineProperty,C=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,b=(o,r,t)=>r in o?Q(o,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[r]=t,ee=(o,r)=>{for(var t in r||(r={}))X.call(r,t)&&b(o,t,r[t]);if(C)for(var t of C(r))Z.call(r,t)&&b(o,t,r[t]);return o};const{EVideoToolName:te,EPointCloudName:u}=U,f={[l.Rect]:N,[l.Tag]:H,[l.Point]:w,[l.Polygon]:O,[l.Line]:I,[l.Text]:R,[te.VideoTagTool]:G,[u.PointCloud]:M,[u.PointCloud+"_POLYGON"]:K,[u.PointCloud+"_SEGMENT"]:V,[l.ScribbleTool]:A,[l.Cuboid]:W,[l.LLM]:Y,[l.NLP]:$,[z.AudioTextTool]:B},oe=({icon:o})=>typeof o=="string"?e.createElement("img",{width:16,height:16,src:o}):o||null,E=({title:o,style:r,shortCutList:t})=>{const{t:m}=F(),d={width:320,display:"flex",justifyContent:"space-between",margin:16},s={display:"block",padding:"0 3px",minWidth:"20px",marginRight:"3px",border:"1px solid rgba(204,204,204,1)",verticalAlign:"middle",fontSize:"12px",textAlign:"center"},y=(a,c)=>e.createElement("div",{style:d,key:c},e.createElement("span",{style:{display:"flex",alignItems:"center"}},e.createElement(oe,{icon:a.icon}),e.createElement("span",{style:{marginLeft:a.icon?16:0}},m(a.name))),e.createElement("span",{style:{display:"flex",alignItems:"center"}},a.noticeInfo&&e.createElement("span",{style:{marginRight:"5px",color:"#CCCCCC"}},m(a.noticeInfo)),x(a.shortCut,a.shortCutUseHtml,a.linkSymbol))),x=(a,c=!1,_="+")=>{if(!a)return null;const j=a.map((n,i)=>{var g,h;const p={display:"flex",alignItems:"center"};return c?e.createElement("span",{key:i,style:p},e.createElement("span",{style:s,dangerouslySetInnerHTML:{__html:n}})):i<a.length-1?typeof n=="number"?e.createElement("span",{key:i,style:p},e.createElement("span",{style:s},n),e.createElement("span",{style:{marginRight:"3px"}},"~")):((g=n==null?void 0:n.startsWith)==null?void 0:g.call(n,"data"))?e.createElement("span",{key:i,style:p},e.createElement("span",{className:"shortCutButton",style:{marginRight:"3px"}},e.createElement("img",{width:16,height:23,src:n})),e.createElement("span",{style:{marginRight:"3px"}},"+")):e.createElement("span",{key:i,style:p},e.createElement("span",{style:s},n),e.createElement("span",{style:{marginRight:"3px"}},_)):typeof n=="number"?e.createElement("span",{key:i,style:p},e.createElement("span",{style:s},n)):((h=n==null?void 0:n.startsWith)==null?void 0:h.call(n,"data"))?e.createElement("span",{className:"shortCutButton",key:i,style:{marginRight:"3px"}},e.createElement("img",{width:16,height:23,src:n})):e.createElement("span",{style:s,key:i},n)});return e.createElement("div",{style:{display:"flex",justifyContent:"space-around",alignItems:"center"}},j)},S=e.createElement("div",{className:`${D}__hotkey-content`},t==null?void 0:t.map((a,c)=>y(a,c))),P=r||{};return e.createElement(J,{hoverIcon:L,icon:k,title:m("Hotkeys"),content:S,containerStyle:P})},re=({style:o,title:r,toolName:t})=>{const{pointCloudPattern:m,globalPattern:d}=v(q);if(!t||!f[t])return null;let s=t;switch(d){case T.Detection:switch(m){case l.Polygon:s+="_POLYGON";break;case l.Line:s=l.Line;break;case l.Point:s=l.Point;break}break;case T.Segmentation:s=u.PointCloud+"_SEGMENT";break}const y={style:o,title:r,shortCutList:f[s]};return e.createElement(E,ee({},y))};export{E as ToolHotKeyCom,re as default,f as shortCutTable};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.22.0-beta.
|
|
3
|
+
"version": "1.22.0-beta.3",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ant-design/icons": "^4.6.2",
|
|
46
|
-
"@labelbee/lb-annotation": "1.26.0-beta.
|
|
47
|
-
"@labelbee/lb-utils": "1.
|
|
46
|
+
"@labelbee/lb-annotation": "1.26.0-beta.3",
|
|
47
|
+
"@labelbee/lb-utils": "1.18.0-beta.2",
|
|
48
48
|
"@labelbee/wavesurfer": "1.0.0",
|
|
49
49
|
"@types/react-dom": "^18.2.7",
|
|
50
50
|
"@types/react-transition-group": "^4.4.9",
|