@labelbee/lb-components 1.6.0-alpha.19 → 1.6.0-alpha.20

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/index.css CHANGED
@@ -1058,6 +1058,10 @@
1058
1058
  color: #cccccc;
1059
1059
  }
1060
1060
 
1061
+ .bee-pop-confirm .ant-popover-buttons {
1062
+ min-width: 116px;
1063
+ }
1064
+
1061
1065
  /** VideoPlayer样式 start */
1062
1066
  .bee-video-wrapper {
1063
1067
  width: 100%;
@@ -1 +1 @@
1
- "use strict";var React=require("react"),antd=require("antd"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const PopconfirmTitle=({info:e})=>{const{t:a}=reactI18next.useTranslation();return e.key.startsWith("sure")?React__default.default.createElement("div",{key:e.key},`${a("ConfirmTo")}${e.name.slice(0)}\uFF1F`):React__default.default.createElement("span",null,e.name)},ActionIcon=({icon:e})=>typeof e=="string"?React__default.default.createElement("img",{width:23,height:25,src:e}):e,ActionsConfirm=({allOperation:e})=>{const[a,r]=React.useState(null),{t:n}=reactI18next.useTranslation(),l=Math.floor(24/e.length);return React__default.default.createElement("div",{className:"generalOperation"},e.map((t,c)=>React__default.default.createElement(antd.Col,{span:l,key:c},React__default.default.createElement("div",{key:t.key,className:"item",onMouseEnter:()=>{r(t.key)},onMouseLeave:()=>{r(null)}},React__default.default.createElement(antd.Popconfirm,{title:React__default.default.createElement(PopconfirmTitle,{info:t}),okText:n("Confirm"),cancelText:n("Cancel"),onConfirm:t.onClick},React__default.default.createElement("div",{className:"icon"},React__default.default.createElement(ActionIcon,{icon:t.key===a?t.hoverSvg:t.imgSvg})),React__default.default.createElement("div",{className:"toolName",style:{color:t.key===a?"#666fff":""}},t.name))))))};module.exports=ActionsConfirm;
1
+ "use strict";var React=require("react"),antd=require("antd"),reactI18next=require("react-i18next"),index=require("../../../../constant/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const PopconfirmTitle=({info:e})=>{const{t:a}=reactI18next.useTranslation();return e.key.startsWith("sure")?React__default.default.createElement("div",{key:e.key},`${a("ConfirmTo")}${e.name.slice(0)}\uFF1F`):React__default.default.createElement("span",null,e.name)},ActionIcon=({icon:e})=>typeof e=="string"?React__default.default.createElement("img",{width:23,height:25,src:e}):e,ActionsConfirm=({allOperation:e})=>{const a=React.useRef(null),[r,n]=React.useState(null),{t:l}=reactI18next.useTranslation(),o=Math.floor(24/e.length);return React__default.default.createElement("div",{className:"generalOperation",ref:a},e.map((t,u)=>React__default.default.createElement(antd.Col,{span:o,key:u},React__default.default.createElement("div",{key:t.key,className:"item",onMouseEnter:()=>{n(t.key)},onMouseLeave:()=>{n(null)}},React__default.default.createElement(antd.Popconfirm,{title:React__default.default.createElement(PopconfirmTitle,{info:t}),placement:"topRight",okText:l("Confirm"),cancelText:l("Cancel"),getPopupContainer:()=>{var c;return(c=a.current)!=null?c:document.body},onConfirm:t.onClick,overlayClassName:`${index.prefix}-pop-confirm`},React__default.default.createElement("div",{className:"icon"},React__default.default.createElement(ActionIcon,{icon:t.key===r?t.hoverSvg:t.imgSvg})),React__default.default.createElement("div",{className:"toolName",style:{color:t.key===r?"#666fff":""}},t.name))))))};module.exports=ActionsConfirm;
@@ -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$6=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$5=require("./PointCloudToolSidebar/index.js"),index$7=require("./ToolStyle/index.js"),lbAnnotation=require("@labelbee/lb-annotation"),index$a=require("./ScribbleSidebar/index.js"),ToolIcons=require("./ToolIcons.js"),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{EVideoToolName,EPointCloudName}=lbAnnotation.cTool,{Panel}=es.Collapse,sidebarCls=`${index.prefix}-sidebar`,Sidebar=({sider:e})=>{const o=ctx.useSelector(a=>StepUtils.getCurrentStepInfo(a.annotation.step,a.annotation.stepList)),t=o==null?void 0:o.tool,{t:i}=reactI18next.useTranslation();if(!t)return null;const E=a=>{const m=React__default.default.createElement(index$7,null);return React__default.default.createElement(Panel,{header:i("Style"),className:"panel",key:a},m)},u=React__default.default.createElement(ToolIcons.ToolIcons,{toolName:t,onChange:()=>{}}),l=React__default.default.createElement(index$8,null),d=React__default.default.createElement(index$9,null),c=React__default.default.createElement(es.Collapse,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${sidebarCls}__content`,expandIcon:index$1.expandIconFuc},E("1")),s=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,i("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$6.default,null),x=React__default.default.createElement(index$1.default,null),v=React__default.default.createElement(index$4.default,null),f=React__default.default.createElement(index$a,{onChange:(a,m)=>{}}),r=React__default.default.createElement("div",{className:`${sidebarCls}__horizontal`}),p=React__default.default.createElement(index$5,null),T=React__default.default.createElement(index$6.PointCloudOperation,null);return e?typeof e=="function"?React__default.default.createElement("div",{className:`${sidebarCls}`},e({toolIcon:u,attributeList:l,annotationText:d,toolStyle:c,imageAttributeInfo:s,operation:n,tagToolSideBar:x,textToolSideBar:v,horizontal:r,pointCloudToolSidebar:p,pointCloudOperation:T,scribbleSidebar:f})):e:[ToolType.EToolName.Rect,ToolType.EToolName.Point,ToolType.EToolName.Line,ToolType.EToolName.Rect,ToolType.EToolName.Polygon].includes(t)?React__default.default.createElement("div",{className:`${sidebarCls}`},u,r,l,d,r,React__default.default.createElement("div",{className:`${sidebarCls}__content`},c,s),n):t===ToolType.EToolName.Tag?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement(index$1.default,null)):t===EVideoToolName.VideoTagTool?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},React__default.default.createElement(index$1.default,null)),n):t===ToolType.EToolName.Text?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement(index$4.default,null)):t===EPointCloudName.PointCloud?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},React__default.default.createElement(index$5,null)),React__default.default.createElement(index$6.PointCloudOperation,null)):t===ToolType.EToolName.ScribbleTool?React__default.default.createElement("div",{className:`${sidebarCls}`},f,l):null};exports.default=Sidebar,exports.sidebarCls=sidebarCls;
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$6=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$5=require("./PointCloudToolSidebar/index.js"),index$7=require("./ToolStyle/index.js"),lbAnnotation=require("@labelbee/lb-annotation"),index$a=require("./ScribbleSidebar/index.js"),ToolIcons=require("./ToolIcons.js"),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{EVideoToolName,EPointCloudName}=lbAnnotation.cTool,{Panel}=es.Collapse,sidebarCls=`${index.prefix}-sidebar`,Sidebar=({sider:e})=>{const o=ctx.useSelector(a=>StepUtils.getCurrentStepInfo(a.annotation.step,a.annotation.stepList)),t=o==null?void 0:o.tool,{t:i}=reactI18next.useTranslation();if(!t)return null;const E=a=>{const m=React__default.default.createElement(index$7,null);return React__default.default.createElement(Panel,{header:i("Style"),className:"panel",key:a},m)},u=React__default.default.createElement(ToolIcons.ToolIcons,{toolName:t,onChange:()=>{}}),n=React__default.default.createElement(index$8,null),d=React__default.default.createElement(index$9,null),c=React__default.default.createElement(es.Collapse,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${sidebarCls}__content`,expandIcon:index$1.expandIconFuc},E("1")),s=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,i("Adjust"),React__default.default.createElement(index$2,null)),className:"panel",key:"imgAttribute"},React__default.default.createElement(index$3,null))),l=React__default.default.createElement(index$6.default,null),x=React__default.default.createElement(index$1.default,null),v=React__default.default.createElement(index$4.default,null),f=React__default.default.createElement(index$a,{onChange:(a,m)=>{}}),r=React__default.default.createElement("div",{className:`${sidebarCls}__horizontal`}),p=React__default.default.createElement(index$5,null),T=React__default.default.createElement(index$6.PointCloudOperation,null);return e?typeof e=="function"?React__default.default.createElement("div",{className:`${sidebarCls}`},e({toolIcon:u,attributeList:n,annotationText:d,toolStyle:c,imageAttributeInfo:s,operation:l,tagToolSideBar:x,textToolSideBar:v,horizontal:r,pointCloudToolSidebar:p,pointCloudOperation:T,scribbleSidebar:f})):e:[ToolType.EToolName.Rect,ToolType.EToolName.Point,ToolType.EToolName.Line,ToolType.EToolName.Rect,ToolType.EToolName.Polygon].includes(t)?React__default.default.createElement("div",{className:`${sidebarCls}`},u,r,n,d,r,React__default.default.createElement("div",{className:`${sidebarCls}__content`},c,s),l):t===ToolType.EToolName.Tag?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement(index$1.default,null)):t===EVideoToolName.VideoTagTool?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},React__default.default.createElement(index$1.default,null)),l):t===ToolType.EToolName.Text?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement(index$4.default,null)):t===EPointCloudName.PointCloud?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},React__default.default.createElement(index$5,null)),React__default.default.createElement(index$6.PointCloudOperation,null)):t===ToolType.EToolName.ScribbleTool?React__default.default.createElement("div",{className:`${sidebarCls}`},React__default.default.createElement("div",{className:`${sidebarCls}__content`},f,n),l):null};exports.default=Sidebar,exports.sidebarCls=sidebarCls;
package/es/index.css CHANGED
@@ -1058,6 +1058,10 @@
1058
1058
  color: #cccccc;
1059
1059
  }
1060
1060
 
1061
+ .bee-pop-confirm .ant-popover-buttons {
1062
+ min-width: 116px;
1063
+ }
1064
+
1061
1065
  /** VideoPlayer样式 start */
1062
1066
  .bee-video-wrapper {
1063
1067
  width: 100%;
@@ -1 +1 @@
1
- import t,{useState as s}from"react";import{Col as i,Popconfirm as u}from"antd";import{useTranslation as o}from"react-i18next";const E=({info:e})=>{const{t:n}=o();return e.key.startsWith("sure")?t.createElement("div",{key:e.key},`${n("ConfirmTo")}${e.name.slice(0)}\uFF1F`):t.createElement("span",null,e.name)},k=({icon:e})=>typeof e=="string"?t.createElement("img",{width:23,height:25,src:e}):e,v=({allOperation:e})=>{const[n,a]=s(null),{t:c}=o(),m=Math.floor(24/e.length);return t.createElement("div",{className:"generalOperation"},e.map((r,l)=>t.createElement(i,{span:m,key:l},t.createElement("div",{key:r.key,className:"item",onMouseEnter:()=>{a(r.key)},onMouseLeave:()=>{a(null)}},t.createElement(u,{title:t.createElement(E,{info:r}),okText:c("Confirm"),cancelText:c("Cancel"),onConfirm:r.onClick},t.createElement("div",{className:"icon"},t.createElement(k,{icon:r.key===n?r.hoverSvg:r.imgSvg})),t.createElement("div",{className:"toolName",style:{color:r.key===n?"#666fff":""}},r.name))))))};export{v as default};
1
+ import t,{useRef as u,useState as p}from"react";import{Col as v,Popconfirm as y}from"antd";import{useTranslation as m}from"react-i18next";import{prefix as E}from"../../../../constant/index.js";const d=({info:e})=>{const{t:r}=m();return e.key.startsWith("sure")?t.createElement("div",{key:e.key},`${r("ConfirmTo")}${e.name.slice(0)}\uFF1F`):t.createElement("span",null,e.name)},f=({icon:e})=>typeof e=="string"?t.createElement("img",{width:23,height:25,src:e}):e,g=({allOperation:e})=>{const r=u(null),[a,o]=p(null),{t:c}=m(),s=Math.floor(24/e.length);return t.createElement("div",{className:"generalOperation",ref:r},e.map((n,i)=>t.createElement(v,{span:s,key:i},t.createElement("div",{key:n.key,className:"item",onMouseEnter:()=>{o(n.key)},onMouseLeave:()=>{o(null)}},t.createElement(y,{title:t.createElement(d,{info:n}),placement:"topRight",okText:c("Confirm"),cancelText:c("Cancel"),getPopupContainer:()=>{var l;return(l=r.current)!=null?l:document.body},onConfirm:n.onClick,overlayClassName:`${E}-pop-confirm`},t.createElement("div",{className:"icon"},t.createElement(f,{icon:n.key===a?n.hoverSvg:n.imgSvg})),t.createElement("div",{className:"toolName",style:{color:n.key===a?"#666fff":""}},n.name))))))};export{g as default};
@@ -1 +1 @@
1
- {"version":3,"file":"ActionsConfirm.js","sources":["../../../../../src/views/MainView/sidebar/GeneralOperation/ActionsConfirm.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Col, Popconfirm } from 'antd';\nimport { useTranslation } from 'react-i18next';\n\nexport interface IOperationConfig {\n name: string;\n key: string;\n imgSvg: string | React.ReactElement;\n hoverSvg: string | React.ReactElement;\n onClick: () => void;\n}\n\nconst PopconfirmTitle = ({ info }: { info: IOperationConfig }) => {\n const { t } = useTranslation();\n if (info.key.startsWith('sure')) {\n return <div key={info.key}>{`${t('ConfirmTo')}${info.name.slice(0)}?`}</div>;\n }\n\n return <span>{info.name}</span>;\n};\n\nconst ActionIcon = ({ icon }: { icon: React.ReactElement | string }) => {\n if (typeof icon === 'string') {\n return <img width={23} height={25} src={icon} />;\n }\n return icon;\n};\n\nconst ActionsConfirm: React.FC<{ allOperation: IOperationConfig[] }> = ({ allOperation }) => {\n const [isHover, setHover] = useState<string | null>(null);\n const { t } = useTranslation();\n const annotationLength = Math.floor(24 / allOperation.length);\n\n return (\n <div className='generalOperation'>\n {allOperation.map((info, index) => (\n <Col span={annotationLength} key={index}>\n <div\n key={info.key}\n className='item'\n onMouseEnter={() => {\n setHover(info.key);\n }}\n onMouseLeave={() => {\n setHover(null);\n }}\n >\n <Popconfirm\n title={<PopconfirmTitle info={info} />}\n okText={t('Confirm')}\n cancelText={t('Cancel')}\n onConfirm={info.onClick}\n >\n <div className='icon'>\n <ActionIcon icon={info.key === isHover ? info.hoverSvg : info.imgSvg} />\n </div>\n <div className='toolName' style={{ color: info.key === isHover ? '#666fff' : '' }}>\n {info.name}\n </div>\n </Popconfirm>\n </div>\n </Col>\n ))}\n </div>\n );\n};\n\nexport default ActionsConfirm;\n"],"names":[],"mappings":";;;;AAYA,MAAM,eAAA,GAAkB,CAAC,CAAE,IAAuC,CAAA,KAAA;AAChE,EAAA,MAAM,CAAE,CAAM,CAAA,GAAA,cAAA,EAAA,CAAA;AACd,EAAI,IAAA,IAAA,CAAK,GAAI,CAAA,UAAA,CAAW,MAAS,CAAA,EAAA;AAC/B,IAAA,2CAAQ,KAAD,EAAA;AAAA,MAAK,KAAK,IAAK,CAAA,GAAA;AAAA,KAAA,EAAM,CAAG,EAAA,CAAA,CAAE,WAAe,CAAA,CAAA,EAAA,IAAA,CAAK,KAAK,KAAM,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,CAAA;AAAA,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;AAAA,IACE,KAAA,sCAAQ,eAAD,EAAA;AAAA,MAAiB,IAAA;AAAA,KAAA,CAAA;AAAA,IACxB,QAAQ,CAAE,CAAA,SAAA,CAAA;AAAA,IACV,YAAY,CAAE,CAAA,QAAA,CAAA;AAAA,IACd,WAAW,IAAK,CAAA,OAAA;AAAA,GAAA,sCAEf,KAAD,EAAA;AAAA,IAAK,SAAU,EAAA,MAAA;AAAA,GAAA,sCACZ,UAAD,EAAA;AAAA,IAAY,MAAM,IAAK,CAAA,GAAA,KAAQ,OAAU,GAAA,IAAA,CAAK,WAAW,IAAK,CAAA,MAAA;AAAA,GAAA,CAAA,CAAA,sCAE/D,KAAD,EAAA;AAAA,IAAK,SAAU,EAAA,UAAA;AAAA,IAAW,OAAO,CAAE,KAAA,EAAO,IAAK,CAAA,GAAA,KAAQ,UAAU,SAAY,GAAA,EAAA,CAAA;AAAA,GAAA,EAC1E,IAAK,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA;;;;"}
1
+ {"version":3,"file":"ActionsConfirm.js","sources":["../../../../../src/views/MainView/sidebar/GeneralOperation/ActionsConfirm.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { Col, Popconfirm } from 'antd';\nimport { useTranslation } from 'react-i18next';\nimport { prefix } from '@/constant';\n\nexport interface IOperationConfig {\n name: string;\n key: string;\n imgSvg: string | React.ReactElement;\n hoverSvg: string | React.ReactElement;\n onClick: () => void;\n}\n\nconst PopconfirmTitle = ({ info }: { info: IOperationConfig }) => {\n const { t } = useTranslation();\n if (info.key.startsWith('sure')) {\n return <div key={info.key}>{`${t('ConfirmTo')}${info.name.slice(0)}?`}</div>;\n }\n\n return <span>{info.name}</span>;\n};\n\nconst ActionIcon = ({ icon }: { icon: React.ReactElement | string }) => {\n if (typeof icon === 'string') {\n return <img width={23} height={25} src={icon} />;\n }\n return icon;\n};\n\nconst ActionsConfirm: React.FC<{ allOperation: IOperationConfig[] }> = ({ allOperation }) => {\n const ref = useRef<HTMLDivElement>(null);\n const [isHover, setHover] = useState<string | null>(null);\n const { t } = useTranslation();\n const annotationLength = Math.floor(24 / allOperation.length);\n\n return (\n <div className='generalOperation' ref={ref}>\n {allOperation.map((info, index) => (\n <Col span={annotationLength} key={index}>\n <div\n key={info.key}\n className='item'\n onMouseEnter={() => {\n setHover(info.key);\n }}\n onMouseLeave={() => {\n setHover(null);\n }}\n >\n <Popconfirm\n title={<PopconfirmTitle info={info} />}\n placement='topRight'\n okText={t('Confirm')}\n cancelText={t('Cancel')}\n getPopupContainer={() => ref.current ?? document.body}\n onConfirm={info.onClick}\n overlayClassName={`${prefix}-pop-confirm`}\n >\n <div className='icon'>\n <ActionIcon icon={info.key === isHover ? info.hoverSvg : info.imgSvg} />\n </div>\n <div className='toolName' style={{ color: info.key === isHover ? '#666fff' : '' }}>\n {info.name}\n </div>\n </Popconfirm>\n </div>\n </Col>\n ))}\n </div>\n );\n};\n\nexport default ActionsConfirm;\n"],"names":[],"mappings":";;;;;AAaA,MAAM,eAAA,GAAkB,CAAC,CAAE,IAAuC,CAAA,KAAA;AAChE,EAAA,MAAM,CAAE,CAAM,CAAA,GAAA,cAAA,EAAA,CAAA;AACd,EAAI,IAAA,IAAA,CAAK,GAAI,CAAA,UAAA,CAAW,MAAS,CAAA,EAAA;AAC/B,IAAA,2CAAQ,KAAD,EAAA;AAAA,MAAK,KAAK,IAAK,CAAA,GAAA;AAAA,KAAA,EAAM,CAAG,EAAA,CAAA,CAAE,WAAe,CAAA,CAAA,EAAA,IAAA,CAAK,KAAK,KAAM,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAGlE,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,MAAD,EAAA,IAAA,EAAO,IAAK,CAAA,IAAA,CAAA,CAAA;AAAA,CAAA,CAAA;AAGrB,MAAM,UAAA,GAAa,CAAC,CAAE,IAAkD,CAAA,KAAA;AACtE,EAAI,IAAA,OAA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AAE,CAAA,SAAA,CAAA;AAAA,IACV,YAAY,CAAE,CAAA,QAAA,CAAA;AAAA,IACd,mBAAmB,MAAG;AAtDpC,MAAA,IAAA,EAAA,CAAA;AAsDuC,MAAI,OAAA,CAAA,EAAA,GAAA,GAAA,CAAA,OAAA,KAAJ,YAAe,QAAS,CAAA,IAAA,CAAA;AAAA,KAAA;AAAA,IACjD,WAAW,IAAK,CAAA,OAAA;AAAA,IAChB,kBAAkB,CAAG,EAAA,MAAA,CAAA,YAAA,CAAA;AAAA,GAAA,sCAEpB,KAAD,EAAA;AAAA,IAAK,SAAU,EAAA,MAAA;AAAA,GAAA,sCACZ,UAAD,EAAA;AAAA,IAAY,MAAM,IAAK,CAAA,GAAA,KAAQ,OAAU,GAAA,IAAA,CAAK,WAAW,IAAK,CAAA,MAAA;AAAA,GAAA,CAAA,CAAA,sCAE/D,KAAD,EAAA;AAAA,IAAK,SAAU,EAAA,UAAA;AAAA,IAAW,OAAO,CAAE,KAAA,EAAO,IAAK,CAAA,GAAA,KAAQ,UAAU,SAAY,GAAA,EAAA,CAAA;AAAA,GAAA,EAC1E,IAAK,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA;;;;"}
@@ -1 +1 @@
1
- import{prefix as _}from"../../../constant/index.js";import{EToolName as o}from"../../../data/enums/ToolType.js";import P from"../../../utils/StepUtils.js";import{Collapse as m}from"antd/es";import e from"react";import{useTranslation as h}from"react-i18next";import L from"./AnnotationText/index.js";import O from"./ClearIcon/index.js";import R,{PointCloudOperation as x}from"./GeneralOperation/index.js";import w from"./ImgAttributeInfo/index.js";import z from"./SwitchAttributeList/index.js";import s,{expandIconFuc as N}from"./TagSidebar/index.js";import g from"./TextToolSidebar/index.js";import I from"./PointCloudToolSidebar/index.js";import B from"./ToolStyle/index.js";import{cTool as G}from"@labelbee/lb-annotation";import K from"./ScribbleSidebar/index.js";import{ToolIcons as U}from"./ToolIcons.js";import{useSelector as V}from"../../../store/ctx.js";const{EVideoToolName:k,EPointCloudName:F}=G,{Panel:j}=m,t=`${_}-sidebar`,q=({sider:r})=>{const d=V(l=>P.getCurrentStepInfo(l.annotation.step,l.annotation.stepList)),n=d==null?void 0:d.tool,{t:u}=h();if(!n)return null;const v=l=>{const S=e.createElement(B,null);return e.createElement(j,{header:u("Style"),className:"panel",key:l},S)},p=e.createElement(U,{toolName:n,onChange:()=>{}}),a=e.createElement(z,null),f=e.createElement(L,null),E=e.createElement(m,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:N},v("1")),b=e.createElement(m,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:N},e.createElement(j,{header:e.createElement("div",null,u("Adjust"),e.createElement(O,null)),className:"panel",key:"imgAttribute"},e.createElement(w,null))),i=e.createElement(R,null),C=e.createElement(s,null),$=e.createElement(g,null),T=e.createElement(K,{onChange:(l,S)=>{}}),c=e.createElement("div",{className:`${t}__horizontal`}),A=e.createElement(I,null),y=e.createElement(x,null);return r?typeof r=="function"?e.createElement("div",{className:`${t}`},r({toolIcon:p,attributeList:a,annotationText:f,toolStyle:E,imageAttributeInfo:b,operation:i,tagToolSideBar:C,textToolSideBar:$,horizontal:c,pointCloudToolSidebar:A,pointCloudOperation:y,scribbleSidebar:T})):r:[o.Rect,o.Point,o.Line,o.Rect,o.Polygon].includes(n)?e.createElement("div",{className:`${t}`},p,c,a,f,c,e.createElement("div",{className:`${t}__content`},E,b),i):n===o.Tag?e.createElement("div",{className:`${t}`},e.createElement(s,null)):n===k.VideoTagTool?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},e.createElement(s,null)),i):n===o.Text?e.createElement("div",{className:`${t}`},e.createElement(g,null)):n===F.PointCloud?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},e.createElement(I,null)),e.createElement(x,null)):n===o.ScribbleTool?e.createElement("div",{className:`${t}`},T,a):null};export{q as default,t as sidebarCls};
1
+ import{prefix as y}from"../../../constant/index.js";import{EToolName as o}from"../../../data/enums/ToolType.js";import P from"../../../utils/StepUtils.js";import{Collapse as m}from"antd/es";import e from"react";import{useTranslation as h}from"react-i18next";import L from"./AnnotationText/index.js";import O from"./ClearIcon/index.js";import R,{PointCloudOperation as x}from"./GeneralOperation/index.js";import w from"./ImgAttributeInfo/index.js";import z from"./SwitchAttributeList/index.js";import s,{expandIconFuc as N}from"./TagSidebar/index.js";import g from"./TextToolSidebar/index.js";import I from"./PointCloudToolSidebar/index.js";import B from"./ToolStyle/index.js";import{cTool as G}from"@labelbee/lb-annotation";import K from"./ScribbleSidebar/index.js";import{ToolIcons as U}from"./ToolIcons.js";import{useSelector as V}from"../../../store/ctx.js";const{EVideoToolName:k,EPointCloudName:F}=G,{Panel:j}=m,t=`${y}-sidebar`,q=({sider:r})=>{const d=V(l=>P.getCurrentStepInfo(l.annotation.step,l.annotation.stepList)),n=d==null?void 0:d.tool,{t:u}=h();if(!n)return null;const v=l=>{const S=e.createElement(B,null);return e.createElement(j,{header:u("Style"),className:"panel",key:l},S)},p=e.createElement(U,{toolName:n,onChange:()=>{}}),i=e.createElement(z,null),f=e.createElement(L,null),E=e.createElement(m,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:N},v("1")),b=e.createElement(m,{defaultActiveKey:["1","imgAttribute"],bordered:!1,expandIconPosition:"right",className:`${t}__content`,expandIcon:N},e.createElement(j,{header:e.createElement("div",null,u("Adjust"),e.createElement(O,null)),className:"panel",key:"imgAttribute"},e.createElement(w,null))),a=e.createElement(R,null),$=e.createElement(s,null),C=e.createElement(g,null),T=e.createElement(K,{onChange:(l,S)=>{}}),c=e.createElement("div",{className:`${t}__horizontal`}),_=e.createElement(I,null),A=e.createElement(x,null);return r?typeof r=="function"?e.createElement("div",{className:`${t}`},r({toolIcon:p,attributeList:i,annotationText:f,toolStyle:E,imageAttributeInfo:b,operation:a,tagToolSideBar:$,textToolSideBar:C,horizontal:c,pointCloudToolSidebar:_,pointCloudOperation:A,scribbleSidebar:T})):r:[o.Rect,o.Point,o.Line,o.Rect,o.Polygon].includes(n)?e.createElement("div",{className:`${t}`},p,c,i,f,c,e.createElement("div",{className:`${t}__content`},E,b),a):n===o.Tag?e.createElement("div",{className:`${t}`},e.createElement(s,null)):n===k.VideoTagTool?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},e.createElement(s,null)),a):n===o.Text?e.createElement("div",{className:`${t}`},e.createElement(g,null)):n===F.PointCloud?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},e.createElement(I,null)),e.createElement(x,null)):n===o.ScribbleTool?e.createElement("div",{className:`${t}`},e.createElement("div",{className:`${t}__content`},T,i),a):null};export{q as default,t as sidebarCls};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/views/MainView/sidebar/index.tsx"],"sourcesContent":["import { prefix } from '@/constant';\nimport { EToolName } from '@/data/enums/ToolType';\nimport { AppState } from '@/store';\nimport { Sider } from '@/types/main';\nimport StepUtils from '@/utils/StepUtils';\nimport { Collapse } from 'antd/es';\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport AnnotationText from './AnnotationText';\nimport ClearIcon from './ClearIcon';\nimport GeneralOperation, { PointCloudOperation } from './GeneralOperation';\nimport ImgAttributeInfo from './ImgAttributeInfo';\nimport SwitchAttributeList from './SwitchAttributeList';\nimport TagSidebar, { expandIconFuc } from './TagSidebar';\nimport TextToolSidebar from './TextToolSidebar';\nimport PointCloudToolSidebar from './PointCloudToolSidebar';\nimport ToolStyle from './ToolStyle';\nimport { cTool } from '@labelbee/lb-annotation';\nimport ScribbleSidebar from './ScribbleSidebar';\nimport { ToolIcons } from './ToolIcons';\nimport { useSelector } from '@/store/ctx';\n\nconst { EVideoToolName, EPointCloudName } = cTool;\n\nconst { Panel } = Collapse;\n\ninterface IProps {\n toolName?: EToolName;\n sider?: Sider;\n}\n\nexport const sidebarCls = `${prefix}-sidebar`;\nconst Sidebar: React.FC<IProps> = ({ sider }) => {\n const stepInfo = useSelector((state: AppState) =>\n StepUtils.getCurrentStepInfo(state.annotation.step, state.annotation.stepList),\n );\n const toolName = stepInfo?.tool;\n const { t } = useTranslation();\n\n if (!toolName) {\n return null;\n }\n\n /**\n * 样式面板, 包含透明度、线框、颜色\n * @param key 虚拟dom的key\n */\n const renderStylePanel = (key: string) => {\n const ToolStyleComponent = <ToolStyle />;\n return (\n <Panel header={t('Style')} className='panel' key={key}>\n {ToolStyleComponent}\n </Panel>\n );\n };\n\n // onChange is empty by default.\n const toolIcon = <ToolIcons toolName={toolName} onChange={() => {}} />;\n const attributeList = <SwitchAttributeList />;\n\n const annotationText = <AnnotationText />;\n\n const toolStyle = (\n <Collapse\n defaultActiveKey={['1', 'imgAttribute']}\n bordered={false}\n expandIconPosition='right'\n className={`${sidebarCls}__content`}\n expandIcon={expandIconFuc}\n >\n {renderStylePanel('1')}\n </Collapse>\n );\n\n const imageAttributeInfo = (\n <Collapse\n defaultActiveKey={['1', 'imgAttribute']}\n bordered={false}\n expandIconPosition='right'\n className={`${sidebarCls}__content`}\n expandIcon={expandIconFuc}\n >\n <Panel\n header={\n <div>\n {t('Adjust')}\n\n <ClearIcon />\n </div>\n }\n className='panel'\n key='imgAttribute'\n >\n <ImgAttributeInfo />\n </Panel>\n </Collapse>\n );\n\n const operation = <GeneralOperation />;\n\n const tagToolSideBar = <TagSidebar />;\n\n const textToolSideBar = <TextToolSidebar />;\n\n const scribbleSidebar = (\n <ScribbleSidebar\n onChange={(t, i) => {\n // 接收\n }}\n />\n );\n\n const horizontal = <div className={`${sidebarCls}__horizontal`} />;\n\n const pointCloudToolSidebar = <PointCloudToolSidebar />;\n\n const pointCloudOperation = <PointCloudOperation />;\n\n if (sider) {\n if (typeof sider === 'function') {\n return (\n <div className={`${sidebarCls}`}>\n {sider({\n toolIcon,\n attributeList,\n annotationText,\n toolStyle,\n imageAttributeInfo,\n operation,\n tagToolSideBar,\n textToolSideBar,\n horizontal,\n\n pointCloudToolSidebar,\n pointCloudOperation,\n scribbleSidebar,\n })}\n </div>\n );\n } else {\n return sider;\n }\n }\n\n if (\n (\n [\n EToolName.Rect,\n EToolName.Point,\n EToolName.Line,\n EToolName.Rect,\n EToolName.Polygon,\n ] as string[]\n ).includes(toolName)\n ) {\n return (\n <div className={`${sidebarCls}`}>\n {toolIcon}\n {horizontal}\n {attributeList}\n {annotationText}\n {horizontal}\n <div className={`${sidebarCls}__content`}>\n {toolStyle}\n {imageAttributeInfo}\n </div>\n {operation}\n </div>\n );\n }\n\n if (toolName === EToolName.Tag) {\n return (\n <div className={`${sidebarCls}`}>\n <TagSidebar />\n </div>\n );\n }\n\n if (toolName === EVideoToolName.VideoTagTool) {\n return (\n <div className={`${sidebarCls}`}>\n <div className={`${sidebarCls}__content`}>\n <TagSidebar />\n </div>\n {operation}\n </div>\n );\n }\n\n if (toolName === EToolName.Text) {\n return (\n <div className={`${sidebarCls}`}>\n <TextToolSidebar />\n </div>\n );\n }\n\n if (toolName === EPointCloudName.PointCloud) {\n return (\n <div className={`${sidebarCls}`}>\n <div className={`${sidebarCls}__content`}>\n <PointCloudToolSidebar />\n </div>\n <PointCloudOperation />\n </div>\n );\n }\n\n if (toolName === EToolName.ScribbleTool) {\n return (\n <div className={`${sidebarCls}`}>\n {scribbleSidebar}\n {attributeList}\n </div>\n );\n }\n\n return null;\n};\n\nexport default Sidebar;\n"],"names":["ClearIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,CAAE,gBAAgB,eAAoB,CAAA,GAAA,KAAA,CAAA;AAE5C,MAAM,CAAE,KAAU,CAAA,GAAA,QAAA,CAAA;AAOX,MAAM,aAAa,CAAG,EAAA,MAAA,CAAA,QAAA,EAAA;AACvB,MAAA,OAAA,GAA4B,CAAC,CAAE,KAAY,CAAA,KAAA;AAC/C,EAAM,MAAA,QAAA,GAAW,WAAY,CAAA,CAAC,KAC5B,K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A,CAAC,YAAD,IAED,CAAA,CAAA,EAAA,SAAA,CAAA,CAAA;AAAA,GAAA;AAKP,EAAI,IAAA,QAAA,KAAa,UAAU,IAAM,EAAA;AAC/B,IAAA,2CACG,KAAD,EAAA;AAAA,MAAK,WAAW,CAAG,EAAA,UAAA,CAAA,CAAA;AAAA,KAAA,sCAChB,eAAD,EAAA,IAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAKN,EAAI,IAAA,QAAA,KAAa,gBAAgB,UAAY,EAAA;AAC3C,IAAA,2CACG,KAAD,EAAA;AAAA,MAAK,WAAW,CAAG,EAAA,UAAA,CAAA,CAAA;AAAA,KAAA,sCAChB,KAAD,EAAA;AAAA,MAAK,WAAW,CAAG,EAAA,UAAA,CAAA,SAAA,CAAA;AAAA,KAAA,kBAChB,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAD,IAEF,CAAA,CAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,mBAAD,EAAA,IAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAKN,EAAI,IAAA,QAAA,KAAa,UAAU,YAAc,EAAA;AACvC,IAAA,2CACG,KAAD,EAAA;AAAA,MAAK,WAAW,CAAG,EAAA,UAAA,CAAA,CAAA;AAAA,KAAA,EAChB,eACA,EAAA,aAAA,CAAA,CAAA;AAAA,GAAA;AAKP,EAAO,OAAA,IAAA,CAAA;AAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/views/MainView/sidebar/index.tsx"],"sourcesContent":["import { prefix } from '@/constant';\nimport { EToolName } from '@/data/enums/ToolType';\nimport { AppState } from '@/store';\nimport { Sider } from '@/types/main';\nimport StepUtils from '@/utils/StepUtils';\nimport { Collapse } from 'antd/es';\nimport React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport AnnotationText from './AnnotationText';\nimport ClearIcon from './ClearIcon';\nimport GeneralOperation, { PointCloudOperation } from './GeneralOperation';\nimport ImgAttributeInfo from './ImgAttributeInfo';\nimport SwitchAttributeList from './SwitchAttributeList';\nimport TagSidebar, { expandIconFuc } from './TagSidebar';\nimport TextToolSidebar from './TextToolSidebar';\nimport PointCloudToolSidebar from './PointCloudToolSidebar';\nimport ToolStyle from './ToolStyle';\nimport { cTool } from '@labelbee/lb-annotation';\nimport ScribbleSidebar from './ScribbleSidebar';\nimport { ToolIcons } from './ToolIcons';\nimport { useSelector } from '@/store/ctx';\n\nconst { EVideoToolName, EPointCloudName } = cTool;\n\nconst { Panel } = Collapse;\n\ninterface IProps {\n toolName?: EToolName;\n sider?: Sider;\n}\n\nexport const sidebarCls = `${prefix}-sidebar`;\nconst Sidebar: React.FC<IProps> = ({ sider }) => {\n const stepInfo = useSelector((state: AppState) =>\n StepUtils.getCurrentStepInfo(state.annotation.step, state.annotation.stepList),\n );\n const toolName = stepInfo?.tool;\n const { t } = useTranslation();\n\n if (!toolName) {\n return null;\n }\n\n /**\n * 样式面板, 包含透明度、线框、颜色\n * @param key 虚拟dom的key\n */\n const renderStylePanel = (key: string) => {\n const ToolStyleComponent = <ToolStyle />;\n return (\n <Panel header={t('Style')} className='panel' key={key}>\n {ToolStyleComponent}\n </Panel>\n );\n };\n\n // onChange is empty by default.\n const toolIcon = <ToolIcons toolName={toolName} onChange={() => {}} />;\n const attributeList = <SwitchAttributeList />;\n\n const annotationText = <AnnotationText />;\n\n const toolStyle = (\n <Collapse\n defaultActiveKey={['1', 'imgAttribute']}\n bordered={false}\n expandIconPosition='right'\n className={`${sidebarCls}__content`}\n expandIcon={expandIconFuc}\n >\n {renderStylePanel('1')}\n </Collapse>\n );\n\n const imageAttributeInfo = (\n <Collapse\n defaultActiveKey={['1', 'imgAttribute']}\n bordered={false}\n expandIconPosition='right'\n className={`${sidebarCls}__content`}\n expandIcon={expandIconFuc}\n >\n <Panel\n header={\n <div>\n {t('Adjust')}\n\n <ClearIcon />\n </div>\n }\n className='panel'\n key='imgAttribute'\n >\n <ImgAttributeInfo />\n </Panel>\n </Collapse>\n );\n\n const operation = <GeneralOperation />;\n\n const tagToolSideBar = <TagSidebar />;\n\n const textToolSideBar = <TextToolSidebar />;\n\n const scribbleSidebar = (\n <ScribbleSidebar\n onChange={(t, i) => {\n // 接收\n }}\n />\n );\n\n const horizontal = <div className={`${sidebarCls}__horizontal`} />;\n\n const pointCloudToolSidebar = <PointCloudToolSidebar />;\n\n const pointCloudOperation = <PointCloudOperation />;\n\n if (sider) {\n if (typeof sider === 'function') {\n return (\n <div className={`${sidebarCls}`}>\n {sider({\n toolIcon,\n attributeList,\n annotationText,\n toolStyle,\n imageAttributeInfo,\n operation,\n tagToolSideBar,\n textToolSideBar,\n horizontal,\n\n pointCloudToolSidebar,\n pointCloudOperation,\n scribbleSidebar,\n })}\n </div>\n );\n } else {\n return sider;\n }\n }\n\n if (\n (\n [\n EToolName.Rect,\n EToolName.Point,\n EToolName.Line,\n EToolName.Rect,\n EToolName.Polygon,\n ] as string[]\n ).includes(toolName)\n ) {\n return (\n <div className={`${sidebarCls}`}>\n {toolIcon}\n {horizontal}\n {attributeList}\n {annotationText}\n {horizontal}\n <div className={`${sidebarCls}__content`}>\n {toolStyle}\n {imageAttributeInfo}\n </div>\n {operation}\n </div>\n );\n }\n\n if (toolName === EToolName.Tag) {\n return (\n <div className={`${sidebarCls}`}>\n <TagSidebar />\n </div>\n );\n }\n\n if (toolName === EVideoToolName.VideoTagTool) {\n return (\n <div className={`${sidebarCls}`}>\n <div className={`${sidebarCls}__content`}>\n <TagSidebar />\n </div>\n {operation}\n </div>\n );\n }\n\n if (toolName === EToolName.Text) {\n return (\n <div className={`${sidebarCls}`}>\n <TextToolSidebar />\n </div>\n );\n }\n\n if (toolName === EPointCloudName.PointCloud) {\n return (\n <div className={`${sidebarCls}`}>\n <div className={`${sidebarCls}__content`}>\n <PointCloudToolSidebar />\n </div>\n <PointCloudOperation />\n </div>\n );\n }\n\n if (toolName === EToolName.ScribbleTool) {\n return (\n <div className={`${sidebarCls}`}>\n <div className={`${sidebarCls}__content`}>\n {scribbleSidebar}\n {attributeList}\n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,EAChB,iBACA,aAEF,CAAA,EAAA,SAAA,CAAA,CAAA;AAAA,GAAA;AAKP,EAAO,OAAA,IAAA,CAAA;AAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.6.0-alpha.19",
3
+ "version": "1.6.0-alpha.20",
4
4
  "description": "Provide a complete library of annotation components",
5
5
  "main": "./dist/index.js",
6
6
  "es": "./es/index.js",