@labelbee/lb-components 1.22.0-alpha.7 → 1.22.0-alpha.8
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";var React=require("react"),es=require("antd/es"),index=require("../TextAreaFormat/index.js"),TextUtils=require("../../../../utils/TextUtils.js"),reactRedux=require("react-redux"),ctx=require("../../../../store/ctx.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const AnnotationText=({toolInstance:e})=>{
|
|
1
|
+
"use strict";var React=require("react"),es=require("antd/es"),index=require("../TextAreaFormat/index.js"),TextUtils=require("../../../../utils/TextUtils.js"),reactRedux=require("react-redux"),ctx=require("../../../../store/ctx.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const AnnotationText=({toolInstance:e})=>{const[,n]=React.useState(0);if(React.useEffect(()=>{e&&(e.singleOn("selectedChange",()=>{n(r=>r+1)}),e.singleOn("updateTextAttribute",()=>{n(r=>r+1)}),e.singleOn("messageError",r=>{es.message.error(r)}))},[e]),!e)return null;const{config:t,selectedID:u}=e;return(t==null?void 0:t.textConfigurable)&&u?React__default.default.createElement(index,{onChange:e.textChange,textValue:e.selectedText,checkString:TextUtils.TextUtils.checkString(t==null?void 0:t.textCheckType,t==null?void 0:t.customFormat),textCheckType:t.textCheckType}):null};function mapStateToProps(e){return{toolInstance:e.annotation.toolInstance}}var AnnotationText$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(AnnotationText);module.exports=AnnotationText$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i,{useState as a,useEffect as l}from"react";import{message as u}from"antd/es";import c from"../TextAreaFormat/index.js";import{TextUtils as m}from"../../../../utils/TextUtils.js";import{connect as s}from"react-redux";import{LabelBeeContext as x}from"../../../../store/ctx.js";const f=({toolInstance:e})=>{const[,n]=a(0);if(l(()=>{e&&(e.singleOn("selectedChange",()=>{n(r=>r+1)}),e.singleOn("updateTextAttribute",()=>{n(r=>r+1)}),e.singleOn("messageError",r=>{u.error(r)}))},[e]),!e)return null;const{config:t,selectedID:o}=e;return(t==null?void 0:t.textConfigurable)&&o?i.createElement(c,{onChange:e.textChange,textValue:e.selectedText,checkString:m.checkString(t==null?void 0:t.textCheckType,t==null?void 0:t.customFormat),textCheckType:t.textCheckType}):null};function d(e){return{toolInstance:e.annotation.toolInstance}}var p=s(d,null,null,{context:x})(f);export{p as default};
|