@labelbee/lb-components 1.2.3-alpha.1 → 1.2.3-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux"),_=require("lodash"),index=require("../../../../utils/index.js"),es=require("antd/es"),lbAnnotation=require("@labelbee/lb-annotation"),actionCreators=require("../../../../store/annotation/actionCreators.js"),ConfigUtils=require("../../../../utils/ConfigUtils.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__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 EKeyCode=lbAnnotation.cKeyCode.default,syntheticEventStopPagination=e=>{e.stopPropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},TextareaWithFooter=e=>{const{textareaProps:t,footer:a}=e;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(es.Input.TextArea,__spreadValues({bordered:!1,rows:6,onKeyDown:syntheticEventStopPagination,onKeyUp:syntheticEventStopPagination},t)),React__default.default.createElement("div",{className:index.classnames({textAreaLength:!0})},a))},SingleTextInput=e=>{var t;const a=React.useRef(null),[p,i]=React.useState(!1),[y,m]=React.useState(!1),{t:u}=reactI18next.useTranslation(),{disabled:l,config:s,result:x,updateText:v,index:g,switchToNextTextarea:E,hasMultiple:b,onNext:c}=e,{maxLength:d}=s,f=x?x[s.key]:"",T=(t=f==null?void 0:f.length)!=null?t:0,C=n=>{v&&(v(n,s.key),s.required&&m(!n))},h=b&&E,r={id:`textInput-${g}`,ref:a,disabled:l,value:f,maxLength:d,autoSize:{minRows:2,maxRows:6},onChange:n=>{const P=n.target.value;C(P)},onFocus:()=>{i(!0)},onBlur:n=>{i(!1),s.required&&m(!n.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:n=>{n.ctrlKey&&n.keyCode===EKeyCode.Enter&&(c&&c(),n.preventDefault()),n.keyCode===EKeyCode.Tab&&h&&(n.preventDefault(),n.nativeEvent.stopImmediatePropagation(),E(g)),n.nativeEvent.stopPropagation()}},o=React__default.default.createElement("div",{className:"textAreaFooter"},React__default.default.createElement("div",{className:"hotkeyTip"},h&&React__default.default.createElement("span",null,`[${u("Switch")}]Tab`),React__default.default.createElement("span",null,`[${u("TurnPage")}]Ctrl+Enter`)),React__default.default.createElement("div",{className:"wordCount"},React__default.default.createElement("span",{className:T>=d?"warning":""},T),"/",React__default.default.createElement("span",null,d)));return React.useEffect(()=>{l&&i(!1)},[l]),React__default.default.createElement("div",{className:"textField"},React__default.default.createElement("div",{className:"label"},React__default.default.createElement("span",{className:index.classnames({required:s.required})},s.label),React__default.default.createElement("i",{className:index.classnames({clearText:!0,disabled:l}),onClick:()=>{l||C("")}})),React__default.default.createElement("div",{className:index.classnames({disabled:l,"textarea-outline":!0,"ant-input-focused":p,textareaContainer:!0,focus:p,invalid:y})},React__default.default.createElement(TextareaWithFooter,{footer:o,textareaProps:r})))},TextToolSidebar=({toolInstance:e,imgIndex:t,dispatch:a,triggerEventAfterIndexChanged:p,step:i,stepList:y,basicResultList:m})=>{var u,l;const[s,x]=React.useState([]),[v,g]=React.useState(0),[,E]=React.useState(0),b=r=>{const o=(r+1)%s.length;c(o)},c=r=>{setTimeout(()=>{const o=document.getElementById(`textInput-${r}`);o&&(g(r),o.focus(),o.select(),o.scrollIntoView({behavior:"smooth",block:"center"}))})};React.useEffect(()=>{e&&(x(_.cloneDeep(e.config.configList)),e.singleOn("valueUpdated",()=>{E(r=>r+1)}))},[e]);const d=(r,o)=>{e.updateTextValue(o,r)};React.useEffect(()=>{t>-1&&p&&c(0)},[t]);const f=(l=(u=e.textList[0])==null?void 0:u.value)!=null?l:{},T=()=>{a(actionCreators.PageForward(!0))},h=ConfigUtils.ConfigUtils.getStepConfig(y,i).dataSourceStep>0&&m.length===0;return React__default.default.createElement("div",{className:"textToolOperationMenu"},s.map((r,o)=>React__default.default.createElement(SingleTextInput,{config:r,key:r.key,index:o,result:f,updateText:d,switchToNextTextarea:b,hasMultiple:s.length>1,focus:v===o,onNext:T,disabled:h})))};function mapStateToProps(e){return{toolInstance:e.annotation.toolInstance,imgIndex:e.annotation.imgIndex,step:e.annotation.step,basicResultList:e.annotation.basicResultList,stepList:e.annotation.stepList,triggerEventAfterIndexChanged:e.annotation.triggerEventAfterIndexChanged}}var TextToolSidebar$1=reactRedux.connect(mapStateToProps)(TextToolSidebar);exports.SingleTextInput=SingleTextInput,exports.TextareaWithFooter=TextareaWithFooter,exports.default=TextToolSidebar$1;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux"),_=require("lodash"),index=require("../../../../utils/index.js"),es=require("antd/es"),lbAnnotation=require("@labelbee/lb-annotation"),actionCreators=require("../../../../store/annotation/actionCreators.js"),ConfigUtils=require("../../../../utils/ConfigUtils.js"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__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 EKeyCode=lbAnnotation.cKeyCode.default,syntheticEventStopPagination=e=>{e.stopPropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},TextareaWithFooter=e=>{const{textareaProps:t,footer:a}=e;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(es.Input.TextArea,__spreadValues({bordered:!1,rows:6,onKeyDown:syntheticEventStopPagination,onKeyUp:syntheticEventStopPagination},t)),React__default.default.createElement("div",{className:index.classnames({textAreaLength:!0})},a))},SingleTextInput=e=>{var t;const a=React.useRef(null),[p,i]=React.useState(!1),[y,m]=React.useState(!1),{t:u}=reactI18next.useTranslation(),{disabled:l,config:s,result:x,updateText:v,index:g,switchToNextTextarea:E,hasMultiple:b,onNext:c}=e,{maxLength:d}=s,f=x?x[s.key]:"",T=(t=f==null?void 0:f.length)!=null?t:0,C=n=>{v&&(v(n,s.key),s.required&&m(!n))},h=b&&E,r={id:`textInput-${g}`,ref:a,disabled:l,value:f,maxLength:d,autoSize:{minRows:2,maxRows:6},onChange:n=>{const w=n.target.value;C(w)},onFocus:()=>{i(!0)},onBlur:n=>{i(!1),s.required&&m(!n.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:n=>{n.ctrlKey&&n.keyCode===EKeyCode.Enter&&(c&&c(),n.preventDefault()),n.keyCode===EKeyCode.Tab&&h&&(n.preventDefault(),n.nativeEvent.stopImmediatePropagation(),E(g)),n.nativeEvent.stopPropagation()}},o=React__default.default.createElement("div",{className:"textAreaFooter"},React__default.default.createElement("div",{className:"hotkeyTip"},h&&React__default.default.createElement("span",null,`[${u("Switch")}]Tab`),React__default.default.createElement("span",null,`[${u("TurnPage")}]Ctrl+Enter`)),React__default.default.createElement("div",{className:"wordCount"},React__default.default.createElement("span",{className:T>=d?"warning":""},T),"/",React__default.default.createElement("span",null,d)));return React.useEffect(()=>{l&&i(!1)},[l]),React__default.default.createElement("div",{className:"textField"},React__default.default.createElement("div",{className:"label"},React__default.default.createElement("span",{className:index.classnames({required:s.required})},s.label),React__default.default.createElement("i",{className:index.classnames({clearText:!0,disabled:l}),onClick:()=>{l||C("")}})),React__default.default.createElement("div",{className:index.classnames({disabled:l,"textarea-outline":!0,"ant-input-focused":p,textareaContainer:!0,focus:p,invalid:y})},React__default.default.createElement(TextareaWithFooter,{footer:o,textareaProps:r})))},TextToolSidebar=({toolInstance:e,imgIndex:t,dispatch:a,triggerEventAfterIndexChanged:p,step:i,stepList:y,basicResultList:m})=>{var u,l;const[s,x]=React.useState([]),[v,g]=React.useState(0),[,E]=React.useState(0),b=r=>{const o=(r+1)%s.length;c(o)},c=r=>{!window||setTimeout(()=>{const o=document.getElementById(`textInput-${r}`);o&&(g(r),o.focus(),o.select(),o.scrollIntoView({behavior:"smooth",block:"center"}))})};React.useEffect(()=>{e&&(x(_.cloneDeep(e.config.configList)),e.singleOn("valueUpdated",()=>{E(r=>r+1)}))},[e]);const d=(r,o)=>{e.updateTextValue(o,r)};React.useEffect(()=>{t>-1&&p&&c(0)},[t]);const f=(l=(u=e.textList[0])==null?void 0:u.value)!=null?l:{},T=()=>{a(actionCreators.PageForward(!0))},h=ConfigUtils.ConfigUtils.getStepConfig(y,i).dataSourceStep>0&&m.length===0;return React__default.default.createElement("div",{className:"textToolOperationMenu"},s.map((r,o)=>React__default.default.createElement(SingleTextInput,{config:r,key:r.key,index:o,result:f,updateText:d,switchToNextTextarea:b,hasMultiple:s.length>1,focus:v===o,onNext:T,disabled:h})))};function mapStateToProps(e){return{toolInstance:e.annotation.toolInstance,imgIndex:e.annotation.imgIndex,step:e.annotation.step,basicResultList:e.annotation.basicResultList,stepList:e.annotation.stepList,triggerEventAfterIndexChanged:e.annotation.triggerEventAfterIndexChanged}}var TextToolSidebar$1=reactRedux.connect(mapStateToProps)(TextToolSidebar);exports.SingleTextInput=SingleTextInput,exports.TextareaWithFooter=TextareaWithFooter,exports.default=TextToolSidebar$1;
@@ -1 +1 @@
1
- import n,{useState as d,useEffect as _,useRef as K}from"react";import{connect as R}from"react-redux";import{cloneDeep as j}from"lodash";import{classnames as C}from"../../../../utils/index.js";import{Input as D}from"antd/es";import{cKeyCode as $}from"@labelbee/lb-annotation";import{PageForward as q}from"../../../../store/annotation/actionCreators.js";import{ConfigUtils as U}from"../../../../utils/ConfigUtils.js";import{useTranslation as B}from"react-i18next";var M=Object.defineProperty,I=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,S=(e,t,a)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,W=(e,t)=>{for(var a in t||(t={}))z.call(t,a)&&S(e,a,t[a]);if(I)for(var a of I(t))V.call(t,a)&&S(e,a,t[a]);return e};const F=$.default,L=e=>{e.stopPropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},O=e=>{const{textareaProps:t,footer:a}=e;return n.createElement(n.Fragment,null,n.createElement(D.TextArea,W({bordered:!1,rows:6,onKeyDown:L,onKeyUp:L},t)),n.createElement("div",{className:C({textAreaLength:!0})},a))},k=e=>{var t;const a=K(null),[g,c]=d(!1),[w,x]=d(!1),{t:u}=B(),{disabled:l,config:i,result:v,updateText:E,index:T,switchToNextTextarea:h,hasMultiple:P,onNext:p}=e,{maxLength:m}=i,f=v?v[i.key]:"",y=(t=f==null?void 0:f.length)!=null?t:0,N=o=>{E&&(E(o,i.key),i.required&&x(!o))},b=P&&h,r={id:`textInput-${T}`,ref:a,disabled:l,value:f,maxLength:m,autoSize:{minRows:2,maxRows:6},onChange:o=>{const A=o.target.value;N(A)},onFocus:()=>{c(!0)},onBlur:o=>{c(!1),i.required&&x(!o.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:o=>{o.ctrlKey&&o.keyCode===F.Enter&&(p&&p(),o.preventDefault()),o.keyCode===F.Tab&&b&&(o.preventDefault(),o.nativeEvent.stopImmediatePropagation(),h(T)),o.nativeEvent.stopPropagation()}},s=n.createElement("div",{className:"textAreaFooter"},n.createElement("div",{className:"hotkeyTip"},b&&n.createElement("span",null,`[${u("Switch")}]Tab`),n.createElement("span",null,`[${u("TurnPage")}]Ctrl+Enter`)),n.createElement("div",{className:"wordCount"},n.createElement("span",{className:y>=m?"warning":""},y),"/",n.createElement("span",null,m)));return _(()=>{l&&c(!1)},[l]),n.createElement("div",{className:"textField"},n.createElement("div",{className:"label"},n.createElement("span",{className:C({required:i.required})},i.label),n.createElement("i",{className:C({clearText:!0,disabled:l}),onClick:()=>{l||N("")}})),n.createElement("div",{className:C({disabled:l,"textarea-outline":!0,"ant-input-focused":g,textareaContainer:!0,focus:g,invalid:w})},n.createElement(O,{footer:s,textareaProps:r})))},G=({toolInstance:e,imgIndex:t,dispatch:a,triggerEventAfterIndexChanged:g,step:c,stepList:w,basicResultList:x})=>{var u,l;const[i,v]=d([]),[E,T]=d(0),[,h]=d(0),P=r=>{const s=(r+1)%i.length;p(s)},p=r=>{setTimeout(()=>{const s=document.getElementById(`textInput-${r}`);s&&(T(r),s.focus(),s.select(),s.scrollIntoView({behavior:"smooth",block:"center"}))})};_(()=>{e&&(v(j(e.config.configList)),e.singleOn("valueUpdated",()=>{h(r=>r+1)}))},[e]);const m=(r,s)=>{e.updateTextValue(s,r)};_(()=>{t>-1&&g&&p(0)},[t]);const f=(l=(u=e.textList[0])==null?void 0:u.value)!=null?l:{},y=()=>{a(q(!0))},b=U.getStepConfig(w,c).dataSourceStep>0&&x.length===0;return n.createElement("div",{className:"textToolOperationMenu"},i.map((r,s)=>n.createElement(k,{config:r,key:r.key,index:s,result:f,updateText:m,switchToNextTextarea:P,hasMultiple:i.length>1,focus:E===s,onNext:y,disabled:b})))};function H(e){return{toolInstance:e.annotation.toolInstance,imgIndex:e.annotation.imgIndex,step:e.annotation.step,basicResultList:e.annotation.basicResultList,stepList:e.annotation.stepList,triggerEventAfterIndexChanged:e.annotation.triggerEventAfterIndexChanged}}var J=R(H)(G);export{k as SingleTextInput,O as TextareaWithFooter,J as default};
1
+ import n,{useState as d,useEffect as _,useRef as K}from"react";import{connect as R}from"react-redux";import{cloneDeep as j}from"lodash";import{classnames as w}from"../../../../utils/index.js";import{Input as D}from"antd/es";import{cKeyCode as $}from"@labelbee/lb-annotation";import{PageForward as q}from"../../../../store/annotation/actionCreators.js";import{ConfigUtils as U}from"../../../../utils/ConfigUtils.js";import{useTranslation as B}from"react-i18next";var M=Object.defineProperty,I=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,S=(e,t,a)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,W=(e,t)=>{for(var a in t||(t={}))z.call(t,a)&&S(e,a,t[a]);if(I)for(var a of I(t))V.call(t,a)&&S(e,a,t[a]);return e};const F=$.default,L=e=>{e.stopPropagation(),e.nativeEvent.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},O=e=>{const{textareaProps:t,footer:a}=e;return n.createElement(n.Fragment,null,n.createElement(D.TextArea,W({bordered:!1,rows:6,onKeyDown:L,onKeyUp:L},t)),n.createElement("div",{className:w({textAreaLength:!0})},a))},k=e=>{var t;const a=K(null),[g,c]=d(!1),[C,x]=d(!1),{t:u}=B(),{disabled:l,config:i,result:v,updateText:E,index:T,switchToNextTextarea:h,hasMultiple:P,onNext:p}=e,{maxLength:m}=i,f=v?v[i.key]:"",y=(t=f==null?void 0:f.length)!=null?t:0,N=o=>{E&&(E(o,i.key),i.required&&x(!o))},b=P&&h,r={id:`textInput-${T}`,ref:a,disabled:l,value:f,maxLength:m,autoSize:{minRows:2,maxRows:6},onChange:o=>{const A=o.target.value;N(A)},onFocus:()=>{c(!0)},onBlur:o=>{c(!1),i.required&&x(!o.target.value)},style:{resize:"none",wordBreak:"break-all"},onKeyDownCapture:o=>{o.ctrlKey&&o.keyCode===F.Enter&&(p&&p(),o.preventDefault()),o.keyCode===F.Tab&&b&&(o.preventDefault(),o.nativeEvent.stopImmediatePropagation(),h(T)),o.nativeEvent.stopPropagation()}},s=n.createElement("div",{className:"textAreaFooter"},n.createElement("div",{className:"hotkeyTip"},b&&n.createElement("span",null,`[${u("Switch")}]Tab`),n.createElement("span",null,`[${u("TurnPage")}]Ctrl+Enter`)),n.createElement("div",{className:"wordCount"},n.createElement("span",{className:y>=m?"warning":""},y),"/",n.createElement("span",null,m)));return _(()=>{l&&c(!1)},[l]),n.createElement("div",{className:"textField"},n.createElement("div",{className:"label"},n.createElement("span",{className:w({required:i.required})},i.label),n.createElement("i",{className:w({clearText:!0,disabled:l}),onClick:()=>{l||N("")}})),n.createElement("div",{className:w({disabled:l,"textarea-outline":!0,"ant-input-focused":g,textareaContainer:!0,focus:g,invalid:C})},n.createElement(O,{footer:s,textareaProps:r})))},G=({toolInstance:e,imgIndex:t,dispatch:a,triggerEventAfterIndexChanged:g,step:c,stepList:C,basicResultList:x})=>{var u,l;const[i,v]=d([]),[E,T]=d(0),[,h]=d(0),P=r=>{const s=(r+1)%i.length;p(s)},p=r=>{!window||setTimeout(()=>{const s=document.getElementById(`textInput-${r}`);s&&(T(r),s.focus(),s.select(),s.scrollIntoView({behavior:"smooth",block:"center"}))})};_(()=>{e&&(v(j(e.config.configList)),e.singleOn("valueUpdated",()=>{h(r=>r+1)}))},[e]);const m=(r,s)=>{e.updateTextValue(s,r)};_(()=>{t>-1&&g&&p(0)},[t]);const f=(l=(u=e.textList[0])==null?void 0:u.value)!=null?l:{},y=()=>{a(q(!0))},b=U.getStepConfig(C,c).dataSourceStep>0&&x.length===0;return n.createElement("div",{className:"textToolOperationMenu"},i.map((r,s)=>n.createElement(k,{config:r,key:r.key,index:s,result:f,updateText:m,switchToNextTextarea:P,hasMultiple:i.length>1,focus:E===s,onNext:y,disabled:b})))};function H(e){return{toolInstance:e.annotation.toolInstance,imgIndex:e.annotation.imgIndex,step:e.annotation.step,basicResultList:e.annotation.basicResultList,stepList:e.annotation.stepList,triggerEventAfterIndexChanged:e.annotation.triggerEventAfterIndexChanged}}var J=R(H)(G);export{k as SingleTextInput,O as TextareaWithFooter,J as default};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/TextToolSidebar/index.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef, FocusEvent } from 'react';\nimport { connect } from 'react-redux';\nimport { AppState } from '@/store';\nimport { cloneDeep } from 'lodash';\nimport { classnames } from '@/utils';\nimport { Input } from 'antd/es';\nimport { cKeyCode } from '@labelbee/lb-annotation';\nimport { PageForward } from '@/store/annotation/actionCreators';\nimport { ConfigUtils } from '@/utils/ConfigUtils';\nimport { IStepInfo } from '@/types/step';\nimport TextToolOperation from '@labelbee/lb-annotation/dist/types/core/toolOperation/TextToolOperation';\nimport { useTranslation } from 'react-i18next';\n\nconst EKeyCode = cKeyCode.default;\n\nconst syntheticEventStopPagination = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n e.stopPropagation();\n e.nativeEvent.stopPropagation();\n e.nativeEvent.stopImmediatePropagation();\n};\n\ninterface ITextareaWithFooterProps {\n textareaProps?: any;\n footer?: any;\n}\n\nexport const TextareaWithFooter = (props: ITextareaWithFooterProps) => {\n const { textareaProps, footer } = props;\n\n return (\n <>\n <Input.TextArea\n bordered={false}\n rows={6}\n onKeyDown={syntheticEventStopPagination}\n onKeyUp={syntheticEventStopPagination}\n {...textareaProps}\n />\n <div\n className={classnames({\n textAreaLength: true,\n })}\n >\n {footer}\n </div>\n </>\n );\n};\n\ninterface IProps {\n dispatch: Function;\n toolInstance: TextToolOperation;\n imgIndex: number;\n triggerEventAfterIndexChanged: boolean;\n step: number;\n stepList: IStepInfo[];\n basicResultList: any[];\n}\n\ninterface IConfigListItem {\n label: string;\n key: string;\n required: boolean;\n default: string;\n maxLength: number;\n}\n\nexport const SingleTextInput = (props: any) => {\n const ref = useRef(null);\n const [textAreaFocus, setTextAreaFocus] = useState(false);\n const [invalid, setInvalid] = useState(false);\n const { t } = useTranslation();\n\n const { disabled, config, result, updateText, index, switchToNextTextarea, hasMultiple, onNext } =\n props;\n const { maxLength } = config;\n\n const value = result ? result[config.key] : '';\n const textLength = value?.length ?? 0;\n\n const updateTextWithKey = (newVal: string) => {\n if (updateText) {\n updateText(newVal, config.key);\n if (config.required) {\n setInvalid(!newVal);\n }\n }\n };\n\n const tabToSwitchEnabled = hasMultiple && switchToNextTextarea;\n\n const textareaProps = {\n id: `textInput-${index}`,\n ref,\n disabled,\n value,\n maxLength,\n autoSize: { minRows: 2, maxRows: 6 },\n onChange: (e: FocusEvent<HTMLTextAreaElement>) => {\n const value = e.target.value;\n updateTextWithKey(value);\n },\n onFocus: () => {\n setTextAreaFocus(true);\n },\n onBlur: (e: FocusEvent<HTMLTextAreaElement>) => {\n setTextAreaFocus(false);\n if (config.required) {\n setInvalid(!e.target.value);\n }\n },\n style: {\n resize: 'none',\n wordBreak: 'break-all',\n },\n onKeyDownCapture: (e: React.KeyboardEvent) => {\n if (e.ctrlKey && e.keyCode === EKeyCode.Enter) {\n if (onNext) {\n onNext();\n }\n e.preventDefault();\n }\n\n if (e.keyCode === EKeyCode.Tab && tabToSwitchEnabled) {\n e.preventDefault();\n e.nativeEvent.stopImmediatePropagation();\n switchToNextTextarea(index);\n }\n\n e.nativeEvent.stopPropagation();\n },\n };\n\n const TextareaFooter = (\n <div className='textAreaFooter'>\n <div className='hotkeyTip'>\n {tabToSwitchEnabled && <span>{`[${t('Switch')}]Tab`}</span>}\n <span>{`[${t('TurnPage')}]Ctrl+Enter`}</span>\n </div>\n <div className='wordCount'>\n <span className={textLength >= maxLength ? 'warning' : ''}>{textLength}</span>/\n <span>{maxLength}</span>\n </div>\n </div>\n );\n\n useEffect(() => {\n if (disabled) {\n setTextAreaFocus(false);\n }\n }, [disabled]);\n\n return (\n <div className='textField'>\n <div className='label'>\n <span className={classnames({ required: config.required })}>{config.label}</span>\n <i\n className={classnames({ clearText: true, disabled: disabled })}\n onClick={() => {\n if (disabled) {\n return;\n }\n updateTextWithKey('');\n }}\n />\n </div>\n <div\n className={classnames({\n disabled,\n 'textarea-outline': true,\n 'ant-input-focused': textAreaFocus,\n textareaContainer: true,\n focus: textAreaFocus,\n invalid: invalid,\n })}\n >\n <TextareaWithFooter footer={TextareaFooter} textareaProps={textareaProps} />\n </div>\n </div>\n );\n};\n\nconst TextToolSidebar: React.FC<IProps> = ({\n toolInstance,\n imgIndex,\n dispatch,\n triggerEventAfterIndexChanged,\n step,\n stepList,\n basicResultList,\n}) => {\n const [configList, setConfigList] = useState<IConfigListItem[]>([]);\n const [focusIndex, setFocusIndex] = useState(0);\n const [, forceRender] = useState(0);\n\n const switchToNextTextarea = (currentIndex: number) => {\n const nextIndex = (currentIndex + 1) % configList.length;\n textareaFocus(nextIndex);\n };\n\n const textareaFocus = (index: number) => {\n setTimeout(() => {\n const textarea = document.getElementById(`textInput-${index}`) as HTMLTextAreaElement;\n if (textarea) {\n setFocusIndex(index);\n textarea.focus();\n textarea.select();\n textarea.scrollIntoView({ behavior: 'smooth', block: 'center' });\n }\n });\n };\n\n useEffect(() => {\n if (toolInstance) {\n setConfigList(cloneDeep(toolInstance.config.configList));\n toolInstance.singleOn('valueUpdated', () => {\n forceRender((s) => s + 1);\n });\n }\n }, [toolInstance]);\n\n const updateText = (v: string, k: string) => {\n toolInstance.updateTextValue(k, v);\n };\n\n useEffect(() => {\n if (imgIndex > -1 && triggerEventAfterIndexChanged) {\n textareaFocus(0);\n }\n }, [imgIndex]);\n\n const result = toolInstance.textList[0]?.value ?? {};\n\n const onNext = () => {\n dispatch(PageForward(true));\n };\n\n const stepConfig = ConfigUtils.getStepConfig(stepList, step);\n const disabled = stepConfig.dataSourceStep > 0 && basicResultList.length === 0;\n\n return (\n <div className='textToolOperationMenu'>\n {configList.map((i, index) => (\n <SingleTextInput\n config={i}\n key={i.key}\n index={index}\n result={result}\n updateText={updateText}\n switchToNextTextarea={switchToNextTextarea}\n hasMultiple={configList.length > 1}\n focus={focusIndex === index}\n onNext={onNext}\n disabled={disabled}\n />\n ))}\n </div>\n );\n};\n\nfunction mapStateToProps(state: AppState) {\n return {\n toolInstance: state.annotation.toolInstance,\n imgIndex: state.annotation.imgIndex,\n step: state.annotation.step,\n basicResultList: state.annotation.basicResultList,\n stepList: state.annotation.stepList,\n triggerEventAfterIndexChanged: state.annotation.triggerEventAfterIndexChanged,\n };\n}\n\nexport default connect(mapStateToProps)(TextToolSidebar);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,WAAW,SAAS;AAE1B,MAAM,+BAA+B,CAAC,MAAgD;AACpF,IAAE;AACF,IAAE,YAAY;AACd,IAAE,YAAY;AAAA;MAQH,qBAAqB,CAAC,UAAoC;AACrE,QAAM,CAAE,eAAe,UAAW;AAElC,uGAEK,MAAM,UAAP;AAAA,IACE,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,IACX,SAAS;AAAA,KACL,qDAEL,OAAD;AAAA,IACE,WAAW,WAAW;AAAA,MACpB,gBAAgB;AAAA;AAAA,KAGjB;AAAA;MAwBI,kBAAkB,CAAC,UAAe;AAnE/C;AAoEE,QAAM,MAAM,OAAO;AACnB,QAAM,CAAC,eAAe,oBAAoB,SAAS;AACnD,QAAM,CAAC,SAAS,cAAc,SAAS;AACvC,QAAM,CAAE,KAAM;AAEd,QAAM,CAAE,UAAU,QAAQ,QAAQ,YAAY,OAAO,sBAAsB,aAAa,UACtF;AACF,QAAM,CAAE,aAAc;AAEtB,QAAM,QAAQ,SAAS,OAAO,OAAO,OAAO;AAC5C,QAAM,aAAa,qCAAO,WAAP,YAAiB;AAEpC,QAAM,oBAAoB,CAAC,WAAmB;AAC5C,QAAI,YAAY;AACd,iBAAW,QAAQ,OAAO;AAC1B,UAAI,OAAO,UAAU;AACnB,mBAAW,CAAC;AAAA;AAAA;AAAA;AAKlB,QAAM,qBAAqB,eAAe;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;AAElD,QAAM,SAAS,MAAM;AACnB,aAAS,YAAY;AAAA;AAGvB,QAAM,aAAa,YAAY,cAAc,UAAU;AACvD,QAAM,WAAW,WAAW,iBAAiB,KAAK,gBAAgB,WAAW;AAE7E,6CACG,OAAD;AAAA,IAAK,WAAU;AAAA,KACZ,WAAW,IAAI,CAAC,GAAG,8CACjB,iBAAD;AAAA,IACE,QAAQ;AAAA,IACR,KAAK,EAAE;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,WAAW,SAAS;AAAA,IACjC,OAAO,eAAe;AAAA,IACtB;AAAA,IACA;AAAA;AAAA;AAOV,yBAAyB,OAAiB;AACxC,SAAO;AAAA,IACL,cAAc,MAAM,WAAW;AAAA,IAC/B,UAAU,MAAM,WAAW;AAAA,IAC3B,MAAM,MAAM,WAAW;AAAA,IACvB,iBAAiB,MAAM,WAAW;AAAA,IAClC,UAAU,MAAM,WAAW;AAAA,IAC3B,+BAA+B,MAAM,WAAW;AAAA;AAAA;AAIpD,wBAAe,QAAQ,iBAAiB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/views/MainView/sidebar/TextToolSidebar/index.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef, FocusEvent } from 'react';\nimport { connect } from 'react-redux';\nimport { AppState } from '@/store';\nimport { cloneDeep } from 'lodash';\nimport { classnames } from '@/utils';\nimport { Input } from 'antd/es';\nimport { cKeyCode } from '@labelbee/lb-annotation';\nimport { PageForward } from '@/store/annotation/actionCreators';\nimport { ConfigUtils } from '@/utils/ConfigUtils';\nimport { IStepInfo } from '@/types/step';\nimport TextToolOperation from '@labelbee/lb-annotation/dist/types/core/toolOperation/TextToolOperation';\nimport { useTranslation } from 'react-i18next';\n\nconst EKeyCode = cKeyCode.default;\n\nconst syntheticEventStopPagination = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n e.stopPropagation();\n e.nativeEvent.stopPropagation();\n e.nativeEvent.stopImmediatePropagation();\n};\n\ninterface ITextareaWithFooterProps {\n textareaProps?: any;\n footer?: any;\n}\n\nexport const TextareaWithFooter = (props: ITextareaWithFooterProps) => {\n const { textareaProps, footer } = props;\n\n return (\n <>\n <Input.TextArea\n bordered={false}\n rows={6}\n onKeyDown={syntheticEventStopPagination}\n onKeyUp={syntheticEventStopPagination}\n {...textareaProps}\n />\n <div\n className={classnames({\n textAreaLength: true,\n })}\n >\n {footer}\n </div>\n </>\n );\n};\n\ninterface IProps {\n dispatch: Function;\n toolInstance: TextToolOperation;\n imgIndex: number;\n triggerEventAfterIndexChanged: boolean;\n step: number;\n stepList: IStepInfo[];\n basicResultList: any[];\n}\n\ninterface IConfigListItem {\n label: string;\n key: string;\n required: boolean;\n default: string;\n maxLength: number;\n}\n\nexport const SingleTextInput = (props: any) => {\n const ref = useRef(null);\n const [textAreaFocus, setTextAreaFocus] = useState(false);\n const [invalid, setInvalid] = useState(false);\n const { t } = useTranslation();\n\n const { disabled, config, result, updateText, index, switchToNextTextarea, hasMultiple, onNext } =\n props;\n const { maxLength } = config;\n\n const value = result ? result[config.key] : '';\n const textLength = value?.length ?? 0;\n\n const updateTextWithKey = (newVal: string) => {\n if (updateText) {\n updateText(newVal, config.key);\n if (config.required) {\n setInvalid(!newVal);\n }\n }\n };\n\n const tabToSwitchEnabled = hasMultiple && switchToNextTextarea;\n\n const textareaProps = {\n id: `textInput-${index}`,\n ref,\n disabled,\n value,\n maxLength,\n autoSize: { minRows: 2, maxRows: 6 },\n onChange: (e: FocusEvent<HTMLTextAreaElement>) => {\n const value = e.target.value;\n updateTextWithKey(value);\n },\n onFocus: () => {\n setTextAreaFocus(true);\n },\n onBlur: (e: FocusEvent<HTMLTextAreaElement>) => {\n setTextAreaFocus(false);\n if (config.required) {\n setInvalid(!e.target.value);\n }\n },\n style: {\n resize: 'none',\n wordBreak: 'break-all',\n },\n onKeyDownCapture: (e: React.KeyboardEvent) => {\n if (e.ctrlKey && e.keyCode === EKeyCode.Enter) {\n if (onNext) {\n onNext();\n }\n e.preventDefault();\n }\n\n if (e.keyCode === EKeyCode.Tab && tabToSwitchEnabled) {\n e.preventDefault();\n e.nativeEvent.stopImmediatePropagation();\n switchToNextTextarea(index);\n }\n\n e.nativeEvent.stopPropagation();\n },\n };\n\n const TextareaFooter = (\n <div className='textAreaFooter'>\n <div className='hotkeyTip'>\n {tabToSwitchEnabled && <span>{`[${t('Switch')}]Tab`}</span>}\n <span>{`[${t('TurnPage')}]Ctrl+Enter`}</span>\n </div>\n <div className='wordCount'>\n <span className={textLength >= maxLength ? 'warning' : ''}>{textLength}</span>/\n <span>{maxLength}</span>\n </div>\n </div>\n );\n\n useEffect(() => {\n if (disabled) {\n setTextAreaFocus(false);\n }\n }, [disabled]);\n\n return (\n <div className='textField'>\n <div className='label'>\n <span className={classnames({ required: config.required })}>{config.label}</span>\n <i\n className={classnames({ clearText: true, disabled: disabled })}\n onClick={() => {\n if (disabled) {\n return;\n }\n updateTextWithKey('');\n }}\n />\n </div>\n <div\n className={classnames({\n disabled,\n 'textarea-outline': true,\n 'ant-input-focused': textAreaFocus,\n textareaContainer: true,\n focus: textAreaFocus,\n invalid: invalid,\n })}\n >\n <TextareaWithFooter footer={TextareaFooter} textareaProps={textareaProps} />\n </div>\n </div>\n );\n};\n\nconst TextToolSidebar: React.FC<IProps> = ({\n toolInstance,\n imgIndex,\n dispatch,\n triggerEventAfterIndexChanged,\n step,\n stepList,\n basicResultList,\n}) => {\n const [configList, setConfigList] = useState<IConfigListItem[]>([]);\n const [focusIndex, setFocusIndex] = useState(0);\n const [, forceRender] = useState(0);\n\n const switchToNextTextarea = (currentIndex: number) => {\n const nextIndex = (currentIndex + 1) % configList.length;\n textareaFocus(nextIndex);\n };\n\n const textareaFocus = (index: number) => {\n if (!window) {\n return;\n }\n\n setTimeout(() => {\n const textarea = document.getElementById(`textInput-${index}`) as HTMLTextAreaElement;\n if (textarea) {\n setFocusIndex(index);\n textarea.focus();\n textarea.select();\n textarea.scrollIntoView({ behavior: 'smooth', block: 'center' });\n }\n });\n };\n\n useEffect(() => {\n if (toolInstance) {\n setConfigList(cloneDeep(toolInstance.config.configList));\n toolInstance.singleOn('valueUpdated', () => {\n forceRender((s) => s + 1);\n });\n }\n }, [toolInstance]);\n\n const updateText = (v: string, k: string) => {\n toolInstance.updateTextValue(k, v);\n };\n\n useEffect(() => {\n if (imgIndex > -1 && triggerEventAfterIndexChanged) {\n textareaFocus(0);\n }\n }, [imgIndex]);\n\n const result = toolInstance.textList[0]?.value ?? {};\n\n const onNext = () => {\n dispatch(PageForward(true));\n };\n\n const stepConfig = ConfigUtils.getStepConfig(stepList, step);\n const disabled = stepConfig.dataSourceStep > 0 && basicResultList.length === 0;\n\n return (\n <div className='textToolOperationMenu'>\n {configList.map((i, index) => (\n <SingleTextInput\n config={i}\n key={i.key}\n index={index}\n result={result}\n updateText={updateText}\n switchToNextTextarea={switchToNextTextarea}\n hasMultiple={configList.length > 1}\n focus={focusIndex === index}\n onNext={onNext}\n disabled={disabled}\n />\n ))}\n </div>\n );\n};\n\nfunction mapStateToProps(state: AppState) {\n return {\n toolInstance: state.annotation.toolInstance,\n imgIndex: state.annotation.imgIndex,\n step: state.annotation.step,\n basicResultList: state.annotation.basicResultList,\n stepList: state.annotation.stepList,\n triggerEventAfterIndexChanged: state.annotation.triggerEventAfterIndexChanged,\n };\n}\n\nexport default connect(mapStateToProps)(TextToolSidebar);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,WAAW,SAAS;AAE1B,MAAM,+BAA+B,CAAC,MAAgD;AACpF,IAAE;AACF,IAAE,YAAY;AACd,IAAE,YAAY;AAAA;MAQH,qBAAqB,CAAC,UAAoC;AACrE,QAAM,CAAE,eAAe,UAAW;AAElC,uGAEK,MAAM,UAAP;AAAA,IACE,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,IACX,SAAS;AAAA,KACL,qDAEL,OAAD;AAAA,IACE,WAAW,WAAW;AAAA,MACpB,gBA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AiB;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.2.3-alpha.1",
3
+ "version": "1.2.3-alpha.2",
4
4
  "description": "Provide a complete library of annotation components",
5
5
  "main": "./dist/index.js",
6
6
  "es": "./es/index.js",
@@ -42,7 +42,7 @@
42
42
  "email": "brady_luo.sz@foxmail.com"
43
43
  },
44
44
  "dependencies": {
45
- "@labelbee/lb-annotation": "1.5.4-alpha.1",
45
+ "@labelbee/lb-annotation": "1.5.4-alpha.2",
46
46
  "@ant-design/icons": "^4.6.2",
47
47
  "classnames": "^2.3.0",
48
48
  "@labelbee/lb-utils": "^1.0.3",