@labelbee/lb-components 1.4.0 → 1.5.0-alpha.0
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/App.js +1 -1
- package/dist/assets/annotation/toolHotKeyIcon/icon_back_kj.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_forward_kj.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_playPause.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_polygonMerge_kj.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_segment.svg.js +1 -0
- package/dist/assets/annotation/toolHotKeyIcon/icon_speed_kj.svg.js +1 -0
- package/dist/assets/annotation/video/icon_keyboard_h.svg.js +1 -0
- package/dist/components/fileException/FileError.js +1 -0
- package/dist/components/fileException/FileInvalid.js +1 -0
- package/dist/components/fileException/index.js +1 -0
- package/dist/components/videoAnnotate/index.js +1 -0
- package/dist/components/videoPlayer/TagToolInstanceAdaptor.js +1 -0
- package/dist/components/videoPlayer/TagToolInstanceAdaptorI18nProvider.js +1 -0
- package/dist/components/videoPlayer/VideoTagLayer.js +1 -0
- package/dist/components/videoPlayer/components/controller/index.js +1 -0
- package/dist/components/videoPlayer/index.js +1 -0
- package/dist/components/videoPlayer/utils.js +1 -0
- package/dist/index.css +122 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -1
- package/dist/store/Actions.js +1 -1
- package/dist/store/annotation/actionCreators.js +1 -1
- package/dist/store/annotation/reducer.js +1 -1
- package/dist/types/App.d.ts +6 -2
- package/dist/types/components/{ImageError/index.d.ts → fileException/FileError.d.ts} +5 -4
- package/dist/types/components/fileException/FileInvalid.d.ts +12 -0
- package/dist/types/components/fileException/index.d.ts +17 -0
- package/dist/types/components/videoAnnotate/index.d.ts +15 -0
- package/dist/types/components/videoPlayer/TagToolInstanceAdaptor.d.ts +90 -0
- package/dist/types/components/videoPlayer/TagToolInstanceAdaptorI18nProvider.d.ts +8 -0
- package/dist/types/components/videoPlayer/VideoTagLayer.d.ts +12 -0
- package/dist/types/components/videoPlayer/components/controller/index.d.ts +2 -0
- package/dist/types/components/videoPlayer/index.d.ts +73 -0
- package/dist/types/components/videoPlayer/types.d.ts +8 -0
- package/dist/types/components/videoPlayer/utils.d.ts +36 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/store/Actions.d.ts +5 -0
- package/dist/types/store/annotation/actionCreators.d.ts +20 -8
- package/dist/types/store/annotation/reducer.d.ts +1 -1
- package/dist/types/store/annotation/types.d.ts +30 -2
- package/dist/types/utils/PageOperator.d.ts +1 -1
- package/dist/types/utils/StepUtils.d.ts +7 -0
- package/dist/types/utils/TextUtils.d.ts +1 -1
- package/dist/types/utils/dom.d.ts +6 -0
- package/dist/types/views/MainView/index.d.ts +2 -1
- package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.d.ts +23 -0
- package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/index.d.ts +2 -7
- package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/polygon/index.d.ts +7 -1
- package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/videoTag/index.d.ts +3 -0
- package/dist/types/views/MainView/toolFooter/Pagination.d.ts +12 -0
- package/dist/utils/StepUtils.js +1 -1
- package/dist/utils/TextUtils.js +1 -1
- package/dist/utils/dom.js +1 -1
- package/dist/views/MainView/annotationOperation/index.js +1 -1
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/polygon/index.js +1 -1
- package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/videoTag/index.js +1 -0
- package/dist/views/MainView/toolFooter/FooterTips/index.js +1 -1
- package/dist/views/MainView/toolFooter/Pagination.js +1 -0
- package/dist/views/MainView/toolFooter/index.js +1 -1
- package/dist/views/MainView/toolHeader/headerOption/index.js +1 -1
- package/dist/views/MainView/toolHeader/index.js +1 -1
- package/es/App.js +1 -1
- package/es/App.js.map +1 -1
- package/es/assets/annotation/toolHotKeyIcon/icon_back_kj.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_back_kj.svg.js.map +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_forward_kj.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_forward_kj.svg.js.map +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_playPause.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_playPause.svg.js.map +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_polygonMerge_kj.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_polygonMerge_kj.svg.js.map +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_segment.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_segment.svg.js.map +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_speed_kj.svg.js +1 -0
- package/es/assets/annotation/toolHotKeyIcon/icon_speed_kj.svg.js.map +1 -0
- package/es/assets/annotation/video/icon_keyboard_h.svg.js +1 -0
- package/es/assets/annotation/video/icon_keyboard_h.svg.js.map +1 -0
- package/es/components/ImageError/index.js +53 -1
- package/es/components/fileException/FileError.js +1 -0
- package/es/components/fileException/FileError.js.map +1 -0
- package/es/components/fileException/FileInvalid.js +1 -0
- package/es/components/fileException/FileInvalid.js.map +1 -0
- package/es/components/fileException/index.js +1 -0
- package/es/components/fileException/index.js.map +1 -0
- package/es/components/videoAnnotate/index.js +1 -0
- package/es/components/videoAnnotate/index.js.map +1 -0
- package/es/components/videoPlayer/TagToolInstanceAdaptor.js +1 -0
- package/es/components/videoPlayer/TagToolInstanceAdaptor.js.map +1 -0
- package/es/components/videoPlayer/TagToolInstanceAdaptorI18nProvider.js +1 -0
- package/es/components/videoPlayer/TagToolInstanceAdaptorI18nProvider.js.map +1 -0
- package/es/components/videoPlayer/VideoTagLayer.js +1 -0
- package/es/components/videoPlayer/VideoTagLayer.js.map +1 -0
- package/es/components/videoPlayer/components/controller/index.js +1 -0
- package/es/components/videoPlayer/components/controller/index.js.map +1 -0
- package/es/components/videoPlayer/index.js +1 -0
- package/es/components/videoPlayer/index.js.map +1 -0
- package/es/components/videoPlayer/utils.js +1 -0
- package/es/components/videoPlayer/utils.js.map +1 -0
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/store/Actions.js +1 -1
- package/es/store/Actions.js.map +1 -1
- package/es/store/annotation/actionCreators.js +1 -1
- package/es/store/annotation/actionCreators.js.map +1 -1
- package/es/store/annotation/reducer.js +1 -1
- package/es/store/annotation/reducer.js.map +1 -1
- package/es/utils/StepUtils.js +1 -1
- package/es/utils/StepUtils.js.map +1 -1
- package/es/utils/TextUtils.js +1 -1
- package/es/utils/TextUtils.js.map +1 -1
- package/es/utils/dom.js +1 -1
- package/es/utils/dom.js.map +1 -1
- package/es/views/MainView/annotationOperation/index.js +1 -1
- package/es/views/MainView/annotationOperation/index.js.map +1 -1
- package/es/views/MainView/index.js +1 -1
- package/es/views/MainView/index.js.map +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/index.js +1 -1
- package/es/views/MainView/sidebar/GeneralOperation/index.js.map +1 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
- package/es/views/MainView/sidebar/TagSidebar/index.js.map +1 -1
- package/es/views/MainView/sidebar/index.js +1 -1
- package/es/views/MainView/sidebar/index.js.map +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js.map +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js.map +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/polygon/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/polygon/index.js.map +1 -1
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/videoTag/index.js +1 -0
- package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/videoTag/index.js.map +1 -0
- package/es/views/MainView/toolFooter/FooterTips/index.js +1 -1
- package/es/views/MainView/toolFooter/FooterTips/index.js.map +1 -1
- package/es/views/MainView/toolFooter/Pagination.js +1 -0
- package/es/views/MainView/toolFooter/Pagination.js.map +1 -0
- package/es/views/MainView/toolFooter/index.js +1 -1
- package/es/views/MainView/toolFooter/index.js.map +1 -1
- package/es/views/MainView/toolHeader/headerOption/index.js +1 -1
- package/es/views/MainView/toolHeader/headerOption/index.js.map +1 -1
- package/es/views/MainView/toolHeader/index.js +1 -1
- package/es/views/MainView/toolHeader/index.js.map +1 -1
- package/package.json +6 -5
- package/dist/components/ImageError/index.js +0 -1
- package/es/assets/annotation/polygonTool/icon_rectangle_a.svg.js +0 -1
- package/es/assets/annotation/polygonTool/icon_rectangle_a.svg.js.map +0 -1
package/dist/App.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var index$1=require("./views/MainView/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactRedux=require("react-redux"),index=require("./index.js"),actionCreators=require("./store/annotation/actionCreators.js");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,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};const App=e=>{const{imgList:t,step:r,stepList:
|
|
1
|
+
"use strict";var index$1=require("./views/MainView/index.js"),lbUtils=require("@labelbee/lb-utils"),React=require("react"),reactRedux=require("react-redux"),index=require("./index.js"),Actions=require("./store/Actions.js"),actionCreators=require("./store/annotation/actionCreators.js"),reducer=require("./store/annotation/reducer.js");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,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};const App=e=>{const{imgList:t,step:r=1,stepList:s,onSubmit:l,onSave:c,onPageChange:u,onStepChange:d,initialIndex:a=0,toolInstance:n,setToolInstance:o,getFileData:p,pageSize:f=10,loadFileList:i,defaultLang:v="cn"}=e;React.useEffect(()=>{index.store.dispatch(actionCreators.InitTaskData({onSubmit:l,stepList:s,step:r,getFileData:p,pageSize:f,loadFileList:i,onSave:c,onPageChange:u,onStepChange:d})),g(),lbUtils.i18n.changeLanguage(v)},[]),React.useEffect(()=>{o==null||o(n)},[n]);const g=()=>{i?actionCreators.loadImgList(index.store.dispatch,index.store.getState,a,!0).then(_=>{_&&index.store.dispatch(reducer.LoadFileAndFileData(a))}):t&&t.length>0&&(index.store.dispatch({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:t}}),index.store.dispatch(reducer.LoadFileAndFileData(a)))};return React__default.default.createElement("div",null,React__default.default.createElement(index$1,__spreadValues({},e)))},mapStateToProps=e=>({toolInstance:e.annotation.toolInstance});var App$1=reactRedux.connect(mapStateToProps)(App);module.exports=App$1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var img="data:image/svg+xml,%3csvg id='icon_back_kj' xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e %3cdefs%3e %3cstyle%3e .cls-1 %7b fill: none%3b %7d .cls-2 %7b fill: %23666%3b %7d %3c/style%3e %3c/defs%3e %3crect id='%e7%9f%a9%e5%bd%a2%e5%a4%87%e4%bb%bd_10' data-name='%e7%9f%a9%e5%bd%a2%e5%a4%87%e4%bb%bd 10' class='cls-1' width='16' height='16'/%3e %3cg id='%e7%bb%84_1224' data-name='%e7%bb%84 1224' transform='translate(-0.347 0.145)'%3e %3cpath id='%e8%b7%af%e5%be%84' class='cls-2' d='M.118%2c3.807%2c5.615.058A.318.318%2c0%2c0%2c1%2c6.12.27v7.5a.318.318%2c0%2c0%2c1-.505.211L.118%2c4.229A.248.248%2c0%2c0%2c1%2c.118%2c3.807Z' transform='translate(7.824 3.855)'/%3e %3cpath id='%e8%b7%af%e5%be%84-2' data-name='%e8%b7%af%e5%be%84' class='cls-2' d='M.118%2c3.807%2c5.615.058A.318.318%2c0%2c0%2c1%2c6.12.27v7.5a.318.318%2c0%2c0%2c1-.505.211L.118%2c4.229A.248.248%2c0%2c0%2c1%2c.118%2c3.807Z' transform='translate(2.348 3.855)'/%3e %3c/g%3e%3c/svg%3e";module.exports=img;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var img="data:image/svg+xml,%3csvg id='icon_forward_kj' xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e %3cdefs%3e %3cstyle%3e .cls-1 %7b fill: none%3b %7d .cls-2 %7b fill: %23666%3b %7d %3c/style%3e %3c/defs%3e %3crect id='%e7%9f%a9%e5%bd%a2%e5%a4%87%e4%bb%bd_10' data-name='%e7%9f%a9%e5%bd%a2%e5%a4%87%e4%bb%bd 10' class='cls-1' width='16' height='16'/%3e %3cg id='%e7%bb%84_1225' data-name='%e7%bb%84 1225' transform='translate(-0.347 0.145)'%3e %3cpath id='%e8%b7%af%e5%be%84' class='cls-2' d='M6%2c3.807.505.058A.318.318%2c0%2c0%2c0%2c0%2c.27v7.5a.318.318%2c0%2c0%2c0%2c.505.211L6%2c4.229A.248.248%2c0%2c0%2c0%2c6%2c3.807Z' transform='translate(2.348 3.855)'/%3e %3cpath id='%e8%b7%af%e5%be%84-2' data-name='%e8%b7%af%e5%be%84' class='cls-2' d='M6%2c3.807.505.058A.318.318%2c0%2c0%2c0%2c0%2c.27v7.5a.318.318%2c0%2c0%2c0%2c.505.211L6%2c4.229A.248.248%2c0%2c0%2c0%2c6%2c3.807Z' transform='translate(7.824 3.855)'/%3e %3c/g%3e%3c/svg%3e";module.exports=img;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var img="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e %3cdefs%3e %3cstyle%3e .cls-1 %7b fill: white%3b opacity: 0%3b %7d .cls-2 %7b fill: %23666%3b %7d %3c/style%3e %3c/defs%3e %3cg id='icon_playPause' transform='translate(0.16 0.16)'%3e %3crect id='%e7%9f%a9%e5%bd%a2' class='cls-1' width='16' height='16' transform='translate(-0.16 -0.16)'/%3e %3cg id='%e7%bb%84_1221' data-name='%e7%bb%84 1221' transform='translate(1.84 3.671)'%3e %3cpath id='%e8%b7%af%e5%be%84' class='cls-2' d='M6.038%2c3.829.508.059A.32.32%2c0%2c0%2c0%2c0%2c.271V7.813a.32.32%2c0%2c0%2c0%2c.508.212l5.53-3.771A.249.249%2c0%2c0%2c0%2c6.038%2c3.829Z' transform='translate(1 0)'/%3e %3crect id='%e7%9f%a9%e5%bd%a2_400' data-name='%e7%9f%a9%e5%bd%a2 400' class='cls-2' width='1.524' height='7.618' rx='0.762' transform='translate(6.828 0.233)'/%3e %3crect id='%e7%9f%a9%e5%bd%a2_401' data-name='%e7%9f%a9%e5%bd%a2 401' class='cls-2' width='1.524' height='7.618' rx='0.762' transform='translate(9.718 0.233)'/%3e %3c/g%3e %3c/g%3e%3c/svg%3e";module.exports=img;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var img="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect opacity='0.01' width='16' height='16' fill='black'/%3e%3cpath d='M10.002 9.52532H9.50201V10.0253V13.5406L2.50202 13.5406L2.50202 6.51493L6.00397 6.51493H6.50397V6.01493L6.50397 2.49963L13.5001 2.49963L13.5001 9.52532H10.002Z' fill='%23CCCCCC' stroke='%23666666'/%3e%3c/svg%3e";module.exports=img;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var img="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect opacity='0.01' width='16' height='16' fill='black'/%3e%3crect x='13.5' y='9.49963' width='7' height='7' transform='rotate(180 13.5 9.49963)' fill='%23CCCCCC' stroke='%23666666'/%3e%3crect x='9.5' y='13.4996' width='7' height='7' transform='rotate(180 9.5 13.4996)' fill='%23CCCCCC' stroke='%23666666'/%3e%3c/svg%3e";module.exports=img;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var img="data:image/svg+xml,%3csvg id='icon_speed_kj' xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e %3cdefs%3e %3cstyle%3e .cls-1 %7b fill: none%3b %7d .cls-2 %7b fill: %23666%3b %7d %3c/style%3e %3c/defs%3e %3crect id='%e7%9f%a9%e5%bd%a2%e5%a4%87%e4%bb%bd_10' data-name='%e7%9f%a9%e5%bd%a2%e5%a4%87%e4%bb%bd 10' class='cls-1' width='16' height='16'/%3e %3cg id='%e7%bb%84_1223' data-name='%e7%bb%84 1223' transform='translate(-0.118 0.286)'%3e %3crect id='%e7%9f%a9%e5%bd%a2_402' data-name='%e7%9f%a9%e5%bd%a2 402' class='cls-2' width='1.5' height='6' rx='0.75' transform='translate(8.118 12.043) rotate(90)'/%3e %3crect id='%e7%9f%a9%e5%bd%a2_403' data-name='%e7%9f%a9%e5%bd%a2 403' class='cls-2' width='1.5' height='4' rx='0.75' transform='translate(6.118 9.043) rotate(90)'/%3e %3crect id='%e7%9f%a9%e5%bd%a2_404' data-name='%e7%9f%a9%e5%bd%a2 404' class='cls-2' width='1.5' height='3' rx='0.75' transform='translate(5.118 6.043) rotate(90)'/%3e %3cpath id='%e5%80%8d%e9%80%9f' class='cls-2' d='M219.687%2c4.153H217.4L218.806.2a.267.267%2c0%2c0%2c0%2c.017-.084.278.278%2c0%2c0%2c0-.289-.269h-2.872a.28.28%2c0%2c0%2c0-.269.186l-2.312%2c6.454a.267.267%2c0%2c0%2c0-.017.084.278.278%2c0%2c0%2c0%2c.289.269h2.552l-.541%2c4.539c0%2c.008-.008.02-.008.029a.278.278%2c0%2c0%2c0%2c.289.269.285.285%2c0%2c0%2c0%2c.253-.157l4.042-6.986a.248.248%2c0%2c0%2c0%2c.029-.111.272.272%2c0%2c0%2c0-.281-.273Z' transform='translate(-206.065 1.862)'/%3e %3c/g%3e%3c/svg%3e";module.exports=img;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var img="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='15' height='13' viewBox='0 0 15 13'%3e %3cdefs%3e %3cstyle%3e .cls-1 %7b opacity: 0.8%3b %7d .cls-2 %7b fill: white%3b %7d %3c/style%3e %3c/defs%3e %3cg id='icon_keyboard_h' class='cls-1'%3e %3cg id='%e5%9b%be%e6%a0%87_%e8%ae%be%e7%bd%ae_%e5%bf%ab%e6%8d%b7%e9%94%ae'%3e %3cpath id='%e5%bd%a2%e7%8a%b6' class='cls-2' d='M2.142%2c13a2.205%2c2.205%2c0%2c0%2c1-1.513-.585A1.949%2c1.949%2c0%2c0%2c1%2c0%2c11V2A2.083%2c2.083%2c0%2c0%2c1%2c2.149%2c0h10.7A2.083%2c2.083%2c0%2c0%2c1%2c15%2c2V11a1.927%2c1.927%2c0%2c0%2c1-.63%2c1.417A2.209%2c2.209%2c0%2c0%2c1%2c12.855%2c13H2.142ZM3.209%2c9a1%2c1%2c0%2c1%2c0%2c0%2c2h8.582a1%2c1%2c0%2c1%2c0%2c0-2ZM11%2c5c-.069%2c0-.287.058-.287.194V6.739c0%2c.085%2c0%2c.261.287.261h1.639c.217%2c0%2c.217-.156.217-.23V5.23A.243.243%2c0%2c0%2c0%2c12.6%2c5ZM6.716%2c5c-.069%2c0-.287.058-.287.194V6.739c0%2c.085%2c0%2c.261.287.261H8.355c.217%2c0%2c.217-.156.217-.23V5.23A.243.243%2c0%2c0%2c0%2c8.319%2c5ZM2.43%2c5c-.069%2c0-.287.058-.287.194V6.739c0%2c.085%2c0%2c.261.287.261H4.069c.217%2c0%2c.217-.156.217-.23V5.23A.243.243%2c0%2c0%2c0%2c4.033%2c5ZM11%2c2c-.069%2c0-.287.059-.287.2V3.739c0%2c.085%2c0%2c.261.287.261h1.639c.217%2c0%2c.217-.155.217-.23V2.23A.243.243%2c0%2c0%2c0%2c12.6%2c2ZM6.716%2c2c-.069%2c0-.287.059-.287.2V3.739c0%2c.085%2c0%2c.261.287.261H8.355c.217%2c0%2c.217-.155.217-.23V2.23A.243.243%2c0%2c0%2c0%2c8.319%2c2ZM2.43%2c2c-.069%2c0-.287.059-.287.2V3.739c0%2c.085%2c0%2c.261.287.261H4.069c.217%2c0%2c.217-.155.217-.23V2.23A.243.243%2c0%2c0%2c0%2c4.033%2c2Z'/%3e %3c/g%3e %3c/g%3e%3c/svg%3e";module.exports=img;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var icons=require("@ant-design/icons"),es=require("antd/es"),React=require("react"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const FileError=e=>{const{width:a,height:r,reloadImage:i,hideSetInvalidTips:o,ignoreOffsetY:s,backgroundColor:n,fileType:c="image"}=e,{t:l}=reactI18next.useTranslation(),u=s?0:40,t=e.layerStyle||{position:"absolute",left:0,top:u,cursor:"initial",zIndex:20,fontSize:12};a&&r?Object.assign(t,{width:a,height:r}):Object.assign(t,{bottom:0,right:0}),n&&Object.assign(t,{backgroundColor:n});const d={position:"absolute",top:"30%",left:"50%",transform:"translate(-50%, -50%)"};return React__default.default.createElement("div",{style:t},React__default.default.createElement("div",{style:d},React__default.default.createElement("div",{style:{textAlign:"center",marginBottom:10}},React__default.default.createElement(es.Button,{type:"primary",shape:"circle",icon:React__default.default.createElement(icons.ReloadOutlined,null),onClick:i})),React__default.default.createElement("div",null,`${l(`${c}ErrorAndReload`)}${o?"":l("orMaskAsInvalid")}`)))};module.exports=FileError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var React=require("react"),reactI18next=require("react-i18next");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const FileInvalid=({fileType:e="image",isValid:t})=>{const{t:n}=reactI18next.useTranslation();return t?null:React__default.default.createElement("div",{style:{position:"absolute",inset:0,color:"white",display:"flex",alignItems:"center",fontSize:30,opacity:.7,background:"rgba(255, 87, 34, 1)",justifyContent:"center"}},n(`${e}InvalidAndSkip`))};module.exports=FileInvalid;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var React=require("react"),FileError=require("./FileError.js"),FileInvalid=require("./FileInvalid.js");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,e,t)=>e in r?__defProp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,__spreadValues=(r,e)=>{for(var t in e||(e={}))__hasOwnProp.call(e,t)&&__defNormalProp(r,t,e[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))__propIsEnum.call(e,t)&&__defNormalProp(r,t,e[t]);return r};const FileException=({invalidProps:r,errorProps:e,fileType:t})=>r.isValid?e.isError?React__default.default.createElement(FileError,__spreadValues({},__spreadValues({fileType:t},e))):null:React__default.default.createElement(FileInvalid,__spreadValues({},__spreadValues({fileType:t},r)));module.exports=FileException;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var React=require("react"),reactRedux=require("react-redux"),Actions=require("../../store/Actions.js"),actionCreators=require("../../store/annotation/actionCreators.js"),TagToolInstanceAdaptor=require("../videoPlayer/TagToolInstanceAdaptor.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const VideoAnnotate=e=>{const{imgList:o,imgIndex:r,stepList:n,step:c}=e.annotation,t=reactRedux.useDispatch(),s=a=>{t({type:Actions.ANNOTATION_ACTIONS.SET_TOOL,payload:{instance:a}})},i=()=>{t({type:Actions.ANNOTATION_ACTIONS.SET_TOOL,payload:{instance:void 0}})};return React__default.default.createElement(TagToolInstanceAdaptor.TagToolInstanceAdaptor,{imgIndex:r,imgList:o,pageBackward:()=>t(actionCreators.PageBackward()),pageForward:()=>t(actionCreators.PageForward()),pageJump:a=>t(actionCreators.PageJump(~~a)),onMounted:s,onUnmounted:i,stepList:n,step:c})};var VideoAnnotate$1=reactRedux.connect(({annotation:e})=>({annotation:e}))(VideoAnnotate);module.exports=VideoAnnotate$1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),lbAnnotation=require("@labelbee/lb-annotation"),StepUtils=require("../../utils/StepUtils.js"),index=require("../../utils/index.js"),index$1=require("./index.js"),VideoTagLayer=require("./VideoTagLayer.js"),_=require("lodash"),utils=require("./utils.js");function _interopDefaultLegacy(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}var React__default=_interopDefaultLegacy(React),___default=_interopDefaultLegacy(_);class TagToolInstanceAdaptor extends React__default.default.Component{constructor(i){super(i);this.fns={},this.labelSelectedList=[],this.clearResult=(t=!0,e)=>{const s=e?this.state.tagResult.map(l=>((l==null?void 0:l.result[e])&&delete l.result[e],l)):[];this.setState({tagResult:s},()=>this.emitEvent("render"))},this.exportData=()=>{var t,e,s,l,o,n,r;const a=(e=(t=this.videoRef)==null?void 0:t.duration)!=null?e:0,d=(s=this.videoRef)==null?void 0:s.getVideoPlaybackQuality(),u=d==null?void 0:d.totalVideoFrames,c=(o=(l=this.videoRef)==null?void 0:l.videoWidth)!=null?o:0,v=(r=(n=this.videoRef)==null?void 0:n.videoHeight)!=null?r:0;return[this.state.tagResult,{valid:this.state.valid,duration:a,frames:u,videoWidth:c,videoHeight:v}]},this.emitEvent=t=>{this.fns[t]&&this.fns[t]()},this.combineResult=(t,e={})=>{var s,l;const{isMulti:o}=t,{key:n,value:r}=t.value;if(o){let a=(l=(s=e[n])==null?void 0:s.split(";"))!=null?l:[];a.includes(r)?a=a.filter(u=>u!==r):a.push(r);const d=new Set(a);return e[n]=Array.from(d).join(";"),___default.default.pickBy(e,u=>u)}return e[n]=e[n]===r?void 0:r,___default.default.pickBy(e,a=>a)},this.setResult=t=>{this.setState({tagResult:t}),this.fns.render&&this.fns.render()},this.setLabel=(t,e)=>{this.setLabelBySelectedList(t,e)},this.keydown=t=>{const e=utils.getKeyCodeNumber(t.keyCode);if(e){const s=e-1;if(this.config.inputList.length===1){this.labelSelectedList=[0,s],this.setLabel(0,s),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500);return}this.labelSelectedList.length===1?(this.labelSelectedList=[this.labelSelectedList[0],s],this.setLabel(this.labelSelectedList[0],s),setTimeout(()=>{this.labelSelectedList=[],this.emitEvent("render")},500)):(this.labelSelectedList=[s],this.emitEvent("expend"))}},this.setValid=t=>{this.setState({valid:t}),t===!1&&this.setState({tagResult:[]}),this.emitEvent("render")},this.setResultFromImgList=t=>{var e;const{imgList:s,imgIndex:l,step:o}=t;if(!s[l])return;const n=index.jsonParser(s[l].result),r=n[`step_${o}`];this.setState({tagResult:(e=r==null?void 0:r.result)!=null?e:[],valid:(n==null?void 0:n.valid)===void 0?!0:n.valid})},this.state={tagResult:[],labelSelectedList:[],valid:!0}}get config(){const i=StepUtils.getCurrentStepInfo(this.props.step,this.props.stepList);return index.jsonParser(i==null?void 0:i.config)}get history(){return{initRecord:()=>{},pushHistory:()=>{}}}get currentTagResult(){var i;return(i=this.state.tagResult[0])!=null?i:{}}get valid(){return this.state.valid}singleOn(i,t){this.fns[i]=t}on(i,t){this.singleOn(i,t)}getTagResultByCode(i,t){var e,s,l;try{const o=(s=(e=this.config)==null?void 0:e.inputList)!=null?s:[],n=o.length>1,r=t!==void 0?i:0,a=t!==void 0?t:i,d=n?o[r]:o[0],u=((l=d.subSelected)!=null?l:[])[a];if(d&&u)return{value:{key:d.value,value:u.value},isMulti:d.isMulti}}catch(o){return}}setLabelBySelectedList(i,t){var e,s,l,o;const n=this.getTagResultByCode(i,t);if(n){const r=this.combineResult(n,(s=(e=this.state.tagResult[0])==null?void 0:e.result)!=null?s:{}),a=[{sourceID:lbAnnotation.CommonToolUtils.getSourceID(),id:(o=(l=this.currentTagResult)==null?void 0:l.id)!=null?o:lbAnnotation.uuid(8,62),result:r}];this.setState({tagResult:a},()=>this.emitEvent("render"))}}componentDidMount(){document.addEventListener("keydown",this.keydown),this.props.onMounted(this),this.setResultFromImgList(this.props)}componentWillUnmount(){document.addEventListener("keydown",this.keydown),this.props.onUnmounted()}shouldComponentUpdate(i){return i.imgIndex!==this.props.imgIndex&&this.setResultFromImgList(i),!0}render(){var i;const{imgIndex:t,imgList:e,pageForward:s,pageJump:l,pageBackward:o}=this.props,{tagResult:n,valid:r}=this.state;return React__default.default.createElement("div",{style:{height:"100%",width:"100%",position:"relative"}},React__default.default.createElement(index$1.VideoPlayer,{imgIndex:t,imgList:e,pageBackward:o,pageForward:s,pageJump:l,valid:r,setVideoRef:a=>{this.videoRef=a}}),React__default.default.createElement(VideoTagLayer.VideoTagLayer,{result:n,inputList:(i=this.config)==null?void 0:i.inputList}))}}exports.TagToolInstanceAdaptor=TagToolInstanceAdaptor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),lbUtils=require("@labelbee/lb-utils"),reactI18next=require("react-i18next"),TagToolInstanceAdaptor=require("./TagToolInstanceAdaptor.js");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,r,t)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r||(r={}))__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e};const VideoTagTool=e=>(React.useEffect(()=>{lbUtils.i18n.changeLanguage(e.lang)},[e.lang]),React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(TagToolInstanceAdaptor.TagToolInstanceAdaptor,__spreadValues({},e))));exports.VideoTagTool=VideoTagTool;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),utils=require("./utils.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const tagLayerCSSProperty={position:"absolute",zIndex:20,padding:"0 20px",color:"white",fontSize:15,lineHeight:"32px",background:"rgba(0, 255, 255, 0.32)",top:0,right:0,maxHeight:"calc(100% - 80px)",overflowY:"scroll"},VideoTagLayer=({result:e,inputList:a})=>{const l=utils.result2LabelKey(e,a);return React__default.default.createElement("div",{style:tagLayerCSSProperty},React__default.default.createElement("table",null,React__default.default.createElement("tbody",null,l.map(({keyLabel:t,valuesLabelArray:r})=>React__default.default.createElement("tr",{key:t},React__default.default.createElement("td",{style:{paddingRight:8}},`${t}:`),React__default.default.createElement("td",null,`${r.join("\u3001")}`))))))};exports.VideoTagLayer=VideoTagLayer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var React=require("react"),dom=require("../../../../utils/dom.js"),icons=require("@ant-design/icons"),index=require("../../index.js"),Pagination=require("../../../../views/MainView/toolFooter/Pagination.js"),icon_keyboard_h=require("../../../../assets/annotation/video/icon_keyboard_h.svg.js"),index$1=require("../../../../views/MainView/toolFooter/FooterTips/ToolHotKey/index.js"),reactI18next=require("react-i18next"),utils=require("../../utils.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);const{EVideoToolName}=lbAnnotation.cTool,videoTimeFormat=e=>{const t=Math.floor(e/60),a=~~(e%60).toFixed(),o=(e*10).toString().split("").pop(),l=r=>r<10?`0${r}`:r;return`${l(t)}:${l(a)}:${o}`},VideoProgress=()=>{const{currentTime:e,duration:t,buffered:a,setCurrentTime:o}=React__default.default.useContext(index.VideoPlayerCtx),l=React__default.default.useRef(null),r=`${utils.decimalReserved(a/t*100,1)}%`,n=`${utils.decimalReserved(e/t*100,1)}%`,i=s=>{if(l.current){const d=s.clientX,c=l.current.clientWidth,u=utils.decimalReserved(d/c*t,1);o(u)}};return React__default.default.createElement("div",{className:dom.getClassName("video-progress"),ref:l,onClick:s=>{s.stopPropagation(),s.nativeEvent.stopImmediatePropagation(),i(s)}},React__default.default.createElement("div",{className:dom.getClassName("video-slider")},React__default.default.createElement("div",{className:dom.getClassName("video-slider","played"),style:{width:n}}),React__default.default.createElement("div",{className:dom.getClassName("video-slider","loaded"),style:{width:r}}),React__default.default.createElement("div",{className:dom.getClassName("video-slider","played"),style:{width:n}})),React__default.default.createElement("div",{className:dom.getClassName("video-slider-bar"),style:{left:n}}))},VideoSpeedButton=()=>{const{updateNextPlaybackRate:e,playbackRate:t}=React__default.default.useContext(index.VideoPlayerCtx),{t:a}=reactI18next.useTranslation();return React__default.default.createElement("span",{className:dom.getClassName("video-controller","speed")},React__default.default.createElement("span",null,a("Speed")),React__default.default.createElement("span",{className:dom.getClassName("video-controller","speedNum")},`${t}x`),React__default.default.createElement("span",{className:dom.getClassName("video-controller","speedButton")},React__default.default.createElement(icons.CaretUpOutlined,{onClick:()=>{e()}}),React__default.default.createElement(icons.CaretDownOutlined,{onClick:()=>{e(!1)}})))},VideoHotKeys=()=>{const{t:e}=reactI18next.useTranslation();return React__default.default.createElement(index$1,{title:React__default.default.createElement("span",{className:dom.getClassName("video-controller","hotkey")},React__default.default.createElement("img",{src:icon_keyboard_h}),e("Hotkeys")),style:{},toolName:EVideoToolName.VideoTagTool})},VideoPageChange=()=>{const{imgIndex:e,imgList:t,pageBackward:a,pageJump:o,pageForward:l}=React__default.default.useContext(index.VideoPlayerCtx);return React__default.default.createElement(Pagination.Pagination,{isVideo:!0,pageBackward:a,imgIndex:e,pageJump:o,totalPage:t.length,pageForward:l,footerCls:dom.getClassName("video-controller")})},VideoTime=()=>{const{currentTime:e,duration:t}=React__default.default.useContext(index.VideoPlayerCtx),a=(t*10-e*10)/10;return React__default.default.createElement("div",{className:dom.getClassName("video-controller","time")},`${videoTimeFormat(e)} / -${videoTimeFormat(a)}`)},VideoController=()=>{const{playPause:e,isPlay:t}=React__default.default.useContext(index.VideoPlayerCtx);return React__default.default.createElement("div",{className:dom.getClassName("video-controller","wrapper")},React__default.default.createElement(VideoProgress,null),React__default.default.createElement("div",{className:dom.getClassName("video-controller")},React__default.default.createElement("span",{onClick:()=>{e()},className:dom.getClassName("video-controller","playButton")},t?React__default.default.createElement(icons.PauseOutlined,null):React__default.default.createElement(icons.CaretRightOutlined,null)),React__default.default.createElement(VideoTime,null),React__default.default.createElement(VideoSpeedButton,null),React__default.default.createElement("div",{className:dom.getClassName("video-controller","holder")}),React__default.default.createElement(VideoPageChange,null),React__default.default.createElement(VideoHotKeys,null)))};module.exports=VideoController;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),index$1=require("./components/controller/index.js"),dom=require("../../utils/dom.js"),lbAnnotation=require("@labelbee/lb-annotation"),utils=require("./utils.js"),index=require("../fileException/index.js");function _interopDefaultLegacy(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var React__default=_interopDefaultLegacy(React);const EKeyCode=lbAnnotation.cKeyCode.default,VideoPlayerCtx=React__default.default.createContext({isPlay:!1,playPause:()=>{},updateNextPlaybackRate:()=>{},playbackRate:1,currentTime:0,duration:0,buffered:0,setCurrentTime:()=>{},imgList:[],imgIndex:-1,pageBackward:()=>{},pageJump:r=>{},pageForward:()=>{}}),PER_INTERVAL=50,PER_FORWARD=.1,PLAYBACK_RATES=[.5,1,1.5,2,4,6,8,16];class VideoPlayer extends React__default.default.Component{constructor(i){super(i);this.changePlaybackPate=e=>{this.videoElm&&(this.videoElm.playbackRate=e,this.setState({playbackRate:e}))},this.playPause=()=>{var e,t,a;((e=this.videoElm)==null?void 0:e.paused)?(t=this.videoElm)==null||t.play():(a=this.videoElm)==null||a.pause()},this.updateNextPlaybackRate=(e=!0)=>{const t=PLAYBACK_RATES.findIndex(s=>s===this.state.playbackRate);let a=e?Math.min(t+1,PLAYBACK_RATES.length-1):Math.max(t-1,0);this.changePlaybackPate(PLAYBACK_RATES[a])},this.fastForward=()=>{this.videoElm&&this.setCurrentTime(this.videoElm.currentTime+PER_FORWARD)},this.rewind=()=>{this.videoElm&&this.setCurrentTime(this.videoElm.currentTime-PER_FORWARD)},this.keydown=e=>{e.keyCode===EKeyCode.Space&&(e.preventDefault(),this.playPause()),e.keyCode===EKeyCode.Up&&(e.preventDefault(),this.updateNextPlaybackRate()),e.keyCode===EKeyCode.Down&&(e.preventDefault(),this.updateNextPlaybackRate(!1)),e.keyCode===EKeyCode.Left&&(e.preventDefault(),this.rewind()),e.keyCode===EKeyCode.Right&&(e.preventDefault(),this.fastForward())},this.onPlay=()=>{this.setState({isPlay:!0},this.onVideoStart)},this.onPause=()=>{this.setState({isPlay:!1},this.onVideoStopped)},this.onVideoStopped=()=>{this.timeInterval&&(clearInterval(this.timeInterval),this.timeInterval=void 0)},this.onVideoStart=()=>{this.timeInterval=window.setInterval(()=>{var e,t,a;if(this.videoElm)try{if(((e=this.videoElm)==null?void 0:e.buffered.length)>0){const s=(t=this.videoElm)==null?void 0:t.buffered.end(0);this.setState({currentTime:utils.decimalReserved((a=this.videoElm)==null?void 0:a.currentTime,1),buffered:s})}}catch(s){console.error(s)}},PER_INTERVAL)},this.resetVideoData=()=>{this.setState({currentTime:0,buffered:0,error:!1}),this.onVideoStopped()},this.setDuration=()=>{var e;if(this.videoElm){const t=utils.decimalReserved((e=this.videoElm)==null?void 0:e.duration,1);this.setState({duration:t})}},this.setCurrentTime=e=>{this.videoElm&&(this.videoElm.currentTime=e,this.setState({currentTime:e}))},this.reload=()=>{var e;(e=this.videoElm)==null||e.load()},this.onError=()=>{this.resetVideoData(),this.setState({error:!0})},this.state={playbackRate:1,currentTime:0,isPlay:!1,duration:0,buffered:0,error:!1},this.videoRef=React__default.default.createRef()}get videoElm(){var i;return(i=this.videoRef)==null?void 0:i.current}get videoSrc(){var i,e;const{imgIndex:t,imgList:a}=this.props;return t>-1&&(e=(i=a[t])==null?void 0:i.url)!=null?e:""}componentDidMount(){var i,e;window.addEventListener("keydown",this.keydown),((i=this.videoRef)==null?void 0:i.current)&&this.props.setVideoRef&&this.props.setVideoRef((e=this.videoRef)==null?void 0:e.current)}componentWillUnmount(){window.removeEventListener("keydown",this.keydown)}render(){const{isPlay:i,playbackRate:e,currentTime:t,duration:a,buffered:s,error:o}=this.state,{imgList:d,imgIndex:l,pageBackward:n,pageJump:u,pageForward:h,valid:c}=this.props,{playPause:f,updateNextPlaybackRate:v,onPause:m,onPlay:p,resetVideoData:y,setDuration:E,setCurrentTime:P,onError:R,videoRef:b,videoSrc:g}=this;return React__default.default.createElement(VideoPlayerCtx.Provider,{value:{videoRef:this.videoRef,isPlay:i,playPause:f,updateNextPlaybackRate:v,playbackRate:e,currentTime:t,duration:a,buffered:s,setCurrentTime:P,imgIndex:l,imgList:d,pageBackward:n,pageJump:u,pageForward:h}},React__default.default.createElement("div",{className:dom.getClassName("video-wrapper")},React__default.default.createElement("div",{className:dom.getClassName("video-container")},React__default.default.createElement("video",{ref:b,className:dom.getClassName("video"),src:g,onPause:m,onPlay:p,onLoadedMetadata:y,onError:R,onDurationChange:E,width:"100%",height:"100%"}),React__default.default.createElement(index,{fileType:"video",errorProps:{reloadImage:this.reload,backgroundColor:"#e2e2e2",ignoreOffsetY:!0,isError:o},invalidProps:{isValid:c}})),React__default.default.createElement(index$1,null)))}}exports.VideoPlayer=VideoPlayer,exports.VideoPlayerCtx=VideoPlayerCtx,exports.default=VideoPlayer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const findTagLabel=(e,r,s)=>{const t=s.find(a=>a.value===e),l=t.subSelected.find(a=>a.value===r);return{keyLabel:t.key,valueLabel:l.key}},tagsSortThruInputList=(e,r)=>e.sort((s,t)=>{const l=r.findIndex(n=>s===n.value),a=r.findIndex(n=>t===n.value);return l-a}),result2LabelKey=(e,r)=>{var s;try{return(s=e==null?void 0:e.reduce((t,l)=>(tagsSortThruInputList(Object.keys(l.result),r).forEach(a=>{l.result[a].split(";").forEach(d=>{const{keyLabel:u,valueLabel:o}=findTagLabel(a,d,r),c=t.find(b=>b.keyLabel===u);c?c.valuesLabelArray.push(o):t.push({keyLabel:u,valuesLabelArray:[o]})})}),t),[]))!=null?s:[]}catch(t){return[]}},getKeyCodeNumber=e=>e<=57&&e>=49?e-48:e<=105&&e>=97?e-96:0,decimalReserved=(e,r=2)=>typeof e=="number"?parseFloat(e.toFixed(r)):e;exports.decimalReserved=decimalReserved,exports.findTagLabel=findTagLabel,exports.getKeyCodeNumber=getKeyCodeNumber,exports.result2LabelKey=result2LabelKey,exports.tagsSortThruInputList=tagsSortThruInputList;
|
package/dist/index.css
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
1
2
|
.bee-layout {
|
|
2
3
|
position: relative;
|
|
3
4
|
overflow: hidden;
|
|
@@ -1009,4 +1010,125 @@
|
|
|
1009
1010
|
color: #cccccc;
|
|
1010
1011
|
}
|
|
1011
1012
|
|
|
1013
|
+
/** VideoPlayer样式 start */
|
|
1014
|
+
.bee-video-wrapper {
|
|
1015
|
+
width: 100%;
|
|
1016
|
+
height: 100%;
|
|
1017
|
+
display: flex;
|
|
1018
|
+
flex-direction: column;
|
|
1019
|
+
background-color: black;
|
|
1020
|
+
overflow: hidden;
|
|
1021
|
+
}
|
|
1022
|
+
.bee-video-wrapper .bee-video-container {
|
|
1023
|
+
flex: 1;
|
|
1024
|
+
overflow: hidden;
|
|
1025
|
+
position: relative;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
.bee-video-progress {
|
|
1029
|
+
position: absolute;
|
|
1030
|
+
width: 100%;
|
|
1031
|
+
height: 10px;
|
|
1032
|
+
top: -3px;
|
|
1033
|
+
align-items: center;
|
|
1034
|
+
display: flex;
|
|
1035
|
+
cursor: pointer;
|
|
1036
|
+
}
|
|
1037
|
+
.bee-video-progress:hover .bee-video-slider-bar {
|
|
1038
|
+
height: 15px;
|
|
1039
|
+
width: 15px;
|
|
1040
|
+
}
|
|
1041
|
+
.bee-video-progress .bee-video-slider {
|
|
1042
|
+
background-color: rgba(115, 133, 159, 0.5);
|
|
1043
|
+
height: 4px;
|
|
1044
|
+
width: 100%;
|
|
1045
|
+
position: relative;
|
|
1046
|
+
}
|
|
1047
|
+
.bee-video-progress .bee-video-slider__loaded, .bee-video-progress .bee-video-slider__played, .bee-video-progress .bee-video-slider__holder {
|
|
1048
|
+
position: absolute;
|
|
1049
|
+
left: 0;
|
|
1050
|
+
height: 100%;
|
|
1051
|
+
}
|
|
1052
|
+
.bee-video-progress .bee-video-slider__loaded {
|
|
1053
|
+
background-color: #73859f;
|
|
1054
|
+
}
|
|
1055
|
+
.bee-video-progress .bee-video-slider__played {
|
|
1056
|
+
background-color: #fff;
|
|
1057
|
+
}
|
|
1058
|
+
.bee-video-progress .bee-video-slider-bar {
|
|
1059
|
+
cursor: pointer;
|
|
1060
|
+
content: "";
|
|
1061
|
+
height: 9px;
|
|
1062
|
+
width: 9px;
|
|
1063
|
+
background-color: #fff;
|
|
1064
|
+
display: inline-block;
|
|
1065
|
+
border-radius: 50%;
|
|
1066
|
+
position: absolute;
|
|
1067
|
+
top: 50%;
|
|
1068
|
+
transform: translate(-50%, -50%);
|
|
1069
|
+
left: 0;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
.bee-video-controller__wrapper {
|
|
1073
|
+
position: relative;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
.bee-video-controller {
|
|
1077
|
+
height: 80px;
|
|
1078
|
+
background-color: #222;
|
|
1079
|
+
color: white;
|
|
1080
|
+
display: flex;
|
|
1081
|
+
align-items: center;
|
|
1082
|
+
padding: 8px 16px;
|
|
1083
|
+
}
|
|
1084
|
+
.bee-video-controller .anticon {
|
|
1085
|
+
cursor: pointer;
|
|
1086
|
+
}
|
|
1087
|
+
.bee-video-controller__holder {
|
|
1088
|
+
flex: 1;
|
|
1089
|
+
}
|
|
1090
|
+
.bee-video-controller__playButton {
|
|
1091
|
+
font-size: 32px;
|
|
1092
|
+
}
|
|
1093
|
+
.bee-video-controller__time {
|
|
1094
|
+
font-size: 16px;
|
|
1095
|
+
}
|
|
1096
|
+
.bee-video-controller__speed {
|
|
1097
|
+
display: flex;
|
|
1098
|
+
align-items: center;
|
|
1099
|
+
}
|
|
1100
|
+
.bee-video-controller__speedNum {
|
|
1101
|
+
display: inline-block;
|
|
1102
|
+
width: 32px;
|
|
1103
|
+
text-align: center;
|
|
1104
|
+
}
|
|
1105
|
+
.bee-video-controller__speedButton {
|
|
1106
|
+
display: inline-flex;
|
|
1107
|
+
flex-direction: column;
|
|
1108
|
+
justify-content: space-between;
|
|
1109
|
+
}
|
|
1110
|
+
.bee-video-controller__pagination {
|
|
1111
|
+
display: flex;
|
|
1112
|
+
align-items: center;
|
|
1113
|
+
}
|
|
1114
|
+
.bee-video-controller__pagination .anticon {
|
|
1115
|
+
font-size: 20px;
|
|
1116
|
+
}
|
|
1117
|
+
.bee-video-controller__pageAll {
|
|
1118
|
+
margin: 0 5px;
|
|
1119
|
+
}
|
|
1120
|
+
.bee-video-controller__pagination, .bee-video-controller__time, .bee-video-controller__playButton {
|
|
1121
|
+
margin-right: 16px;
|
|
1122
|
+
}
|
|
1123
|
+
.bee-video-controller__hotkey {
|
|
1124
|
+
display: inline-flex;
|
|
1125
|
+
align-items: center;
|
|
1126
|
+
cursor: pointer;
|
|
1127
|
+
}
|
|
1128
|
+
.bee-video-controller__hotkey img {
|
|
1129
|
+
margin-right: 4px;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
/** VideoPlayer样式 end */
|
|
1133
|
+
|
|
1012
1134
|
/*# sourceMappingURL=index.css.map */
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../src/index.scss"],"names":[],"mappings":"AAMA;EACE;EACA;EACA;;AAEA;EAEE;EACA;EACA;EACA;EACA;EACA,YAlBW;;AAqBb;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAIA;EACE;;AAGF;EACE;;AAKN;EACE;EACA;EACA;;AAGF;EACE;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAGF;EACE;;;AAOF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;;AAEA;AAAA;EAEE;;AAEA;AAAA;EACE;;AAKN;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAIJ;EACE;;;AAMN;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;;AAON;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAEA;EACE;;AAII;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAKN;EACE;;AAGF;EACE;;AAGF;EACE;;AAMR;EACE;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAGF;AAAA;EAEE;EAEA;EACA;EACA;EACA;;AAEA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;AAAA;EACE;;AAGF;AAAA;EACE;;AAGF;AAAA;EACE;EACA;EACA;EACA;EACA;;AAGF;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;AAAA;EACE;EACA;EACA;;AAcF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EAEA;EACA;EACA;EACA;EACA;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGE;EACA;;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAQF;AAAA;EACE;EACA;EACA;EACA;;AAGF;AAAA;EACE;;AAGF;AAAA;EACE;;AAGF;AAAA;EACE;;AAGF;AAAA;EACE;;AAGF;AAAA;EACE;;AAKF;AAAA;EACE;;AAMJ;EACE;;
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../src/index.scss"],"names":[],"mappings":";AAMA;EACE;EACA;EACA;;AAEA;EAEE;EACA;EACA;EACA;EACA;EACA,YAlBW;;AAqBb;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAIA;EACE;;AAGF;EACE;;AAKN;EACE;EACA;EACA;;AAGF;EACE;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAGF;EACE;;;AAOF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;;AAEA;AAAA;EAEE;;AAEA;AAAA;EACE;;AAKN;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAIJ;EACE;;;AAMN;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;;AAON;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAEA;EACE;;AAII;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAKN;EACE;;AAGF;EACE;;AAGF;EACE;;AAMR;EACE;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAGF;AAAA;EAEE;EAEA;EACA;EACA;EACA;;AAEA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;AAAA;EACE;;AAGF;AAAA;EACE;;AAGF;AAAA;EACE;EACA;EACA;EACA;EACA;;AAGF;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;AAAA;EACE;EACA;EACA;;AAcF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EAEA;EACA;EACA;EACA;EACA;;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGE;EACA;;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAQF;AAAA;EACE;EACA;EACA;EACA;;AAGF;AAAA;EACE;;AAGF;AAAA;EACE;;AAGF;AAAA;EACE;;AAGF;AAAA;EACE;;AAGF;AAAA;EACE;;AAKF;AAAA;EACE;;AAMJ;EACE;;AAkBF;AAAA;EACE;;;AAiBN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAIF;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;;AAKJ;EACE;;AAEA;EACE;;AAEA;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAMA;EACE;;AAKN;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAIJ;AAAA;EAEE;EACA;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;AAGF;EACE;;AAIJ;EACE;;AAmBJ;EACE;EACA;EACA;;AAGF;EACE;EACA;;;AAQJ;EACE;EACA;;AAGE;EACE;EACA;;AAIJ;AAAA;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;;AAMN;EACE;EACA;EACA;;AAGE;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;;;AAMN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;;AAKF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;;AAGF;EACE;EACA;;AAIJ;EACE;;AAGF;EAIE;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;;;AAIJ;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;;AAKN;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAKN;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAKN;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAIJ;EACE;;AAGE;EACE;;AAKN;EACE;;AAEA;EACE;;AAIJ;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;;AAIJ;EACE;EACA;;AAEA;EACE;EACA;EACA;;;AAOF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;;AAEA;EACE;;AAIJ;EACE;EAEA;;AAGF;EACE;;AAGF;EACE;;AAIJ;EACE;EACA;;AAEA;EACE;;AAEA;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EAEA;;AAGF;EACE;;AAGF;EACE;;AAIJ;EACE;;AAEA;EACE;;;AAMR;AACA;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;;AAKJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGE;EACE;EACA;;AAIJ;EACE;EACA;EACA;EACA;;AACA;EAGE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAKJ;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;;AACA;EACE;;AAGJ;EACE;;AAGF;EAGE;;AAGF;EACE;EACA;EACA;;AACA;EACE;;;AAKN","file":"index.css"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$1=require("./components/AnnotationView/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");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,r,t)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r||(r={}))__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e},__spreadProps=(e,r)=>__defProps(e,__getOwnPropDescs(r));const store=configureStore(),OutputApp=(e,r)=>{const[t,a]=React.useState();return React.useImperativeHandle(r,()=>({toolInstance:t,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!!!")}),[t]),React__default.default.createElement(reactRedux.Provider,{store},React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(App,__spreadProps(__spreadValues({},e),{setToolInstance:a}))))};var index=React__default.default.forwardRef(OutputApp);exports.AnnotationView=index$1,Object.defineProperty(exports,"i18n",{enumerable:!0,get:function(){return lbUtils.i18n}}),exports.default=index,exports.store=store;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$1=require("./components/AnnotationView/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/videoPlayer/TagToolInstanceAdaptorI18nProvider.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,r,t)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r||(r={}))__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e},__spreadProps=(e,r)=>__defProps(e,__getOwnPropDescs(r));const store=configureStore(),OutputApp=(e,r)=>{const[t,a]=React.useState();return React.useImperativeHandle(r,()=>({toolInstance:t,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!!!")}),[t]),React__default.default.createElement(reactRedux.Provider,{store},React__default.default.createElement(reactI18next.I18nextProvider,{i18n:lbUtils.i18n},React__default.default.createElement(App,__spreadProps(__spreadValues({},e),{setToolInstance:a}))))};var index=React__default.default.forwardRef(OutputApp);exports.AnnotationView=index$1,Object.defineProperty(exports,"i18n",{enumerable:!0,get:function(){return lbUtils.i18n}}),exports.VideoTagTool=TagToolInstanceAdaptorI18nProvider.VideoTagTool,exports.default=index,exports.store=store;
|
package/dist/store/Actions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const ANNOTATION_ACTIONS={UPDATE_TOOL_INSTANCE:"@@UPDATE_TOOL_INSTANCE",UPDATE_IMG_LIST:"@@UPDATE_IMG_LIST",UPDATE_ANNOTATION_CONFIG:"@@UPDATE_ANNOTATION_CONFIG",LOAD_FILE_DATA:"@@LOAD_FILE_DATA",SUBMIT_FILE_DATA:"@@SUBMIT_FILE_DATA",SET_TASK_CONFIG:"@@SET_TASK_CONFIG",INIT_TOOL:"@@INIT_TOOL",UPDATE_ON_SUBMIT:"@@UPDATE_ON_SUBMIT",UPDATE_ON_SAVE:"@@UPDATE_ON_SAVE",UPDATE_ROTATE:"@@UPDATE_ROTATE",UPDATE_GET_FILE_DATA:"@@UPDATE_GET_FILE_DATA",GET_FILE_DATA:"@@GET_FILE_DATA",SET_FILE_DATA:"@@SET_FILE_DATA",COPY_BACKWARD_RESULT:"@@COPY_BACKWARD_RESULT",SET_STEP:"@@SET_STEP",SUBMIT_RESULT:"@@SUBMIT_RESULT",SAVE_RESULT:"@@SAVE_RESULT",SET_BASIC_INDEX:"@@SET_BASIC_INDEX",CALC_STEP_PROGRESS:"@@CALC_STEP_PROGRESS",SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:"@@SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED",SET_LOADING:"@@SET_LOADING"},IMAGE_ATTRIBUTE_ACTIONS={UPDATE_IMG_ATTRIBUTE:"@@UPDATE_IMG_ATTRIBUTE",INIT_IMG_ATTRIBUTE:"@@INIT_IMG_ATTRIBUTE"},TOOL_STYLE_ACTIONS={INIT_TOOL_STYLE_CONFIG:"@@INIT_TOOL_STYLE_CONFIG",UPDATE_TOOL_STYLE_CONFIG:"@@UPDATE_TOOL_STYLE_CONFIG"};exports.ANNOTATION_ACTIONS=ANNOTATION_ACTIONS,exports.IMAGE_ATTRIBUTE_ACTIONS=IMAGE_ATTRIBUTE_ACTIONS,exports.TOOL_STYLE_ACTIONS=TOOL_STYLE_ACTIONS;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const ANNOTATION_ACTIONS={UPDATE_TOOL_INSTANCE:"@@UPDATE_TOOL_INSTANCE",UPDATE_IMG_LIST:"@@UPDATE_IMG_LIST",UPDATE_ANNOTATION_CONFIG:"@@UPDATE_ANNOTATION_CONFIG",LOAD_FILE_DATA:"@@LOAD_FILE_DATA",SUBMIT_FILE_DATA:"@@SUBMIT_FILE_DATA",SET_TASK_CONFIG:"@@SET_TASK_CONFIG",INIT_TOOL:"@@INIT_TOOL",SET_TOOL:"@@SET_TOOL",UPDATE_ON_SUBMIT:"@@UPDATE_ON_SUBMIT",UPDATE_ON_SAVE:"@@UPDATE_ON_SAVE",UPDATE_ON_PAGE_CHANGE:"@@UPDATE_ON_PAGE_CHANGE",UPDATE_ON_STEP_CHANGE:"@@UPDATE_ON_STEP_CHANGE",UPDATE_ROTATE:"@@UPDATE_ROTATE",UPDATE_GET_FILE_DATA:"@@UPDATE_GET_FILE_DATA",UPDATE_PAGE_SIZE:"@@UPDATE_PAGE_SIZE",UPDATE_LOAD_FILE_LIST:"@@UPDATE_LOAD_FILE_LIST",GET_FILE_DATA:"@@GET_FILE_DATA",SET_FILE_DATA:"@@SET_FILE_DATA",COPY_BACKWARD_RESULT:"@@COPY_BACKWARD_RESULT",SET_STEP:"@@SET_STEP",SUBMIT_RESULT:"@@SUBMIT_RESULT",SAVE_RESULT:"@@SAVE_RESULT",SET_BASIC_INDEX:"@@SET_BASIC_INDEX",CALC_STEP_PROGRESS:"@@CALC_STEP_PROGRESS",SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED:"@@SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED",SET_LOADING:"@@SET_LOADING"},IMAGE_ATTRIBUTE_ACTIONS={UPDATE_IMG_ATTRIBUTE:"@@UPDATE_IMG_ATTRIBUTE",INIT_IMG_ATTRIBUTE:"@@INIT_IMG_ATTRIBUTE"},TOOL_STYLE_ACTIONS={INIT_TOOL_STYLE_CONFIG:"@@INIT_TOOL_STYLE_CONFIG",UPDATE_TOOL_STYLE_CONFIG:"@@UPDATE_TOOL_STYLE_CONFIG"};exports.ANNOTATION_ACTIONS=ANNOTATION_ACTIONS,exports.IMAGE_ATTRIBUTE_ACTIONS=IMAGE_ATTRIBUTE_ACTIONS,exports.TOOL_STYLE_ACTIONS=TOOL_STYLE_ACTIONS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Actions=require("../Actions.js"),reducer=require("./reducer.js"),index=require("../../constant/index.js"),AnnotationSize=require("../../data/enums/AnnotationSize.js"),PageOperator=require("../../utils/PageOperator.js"),index$1=require("../../utils/index.js");const dispatchTasks=(e,t)=>t.map(n=>e(n)),getSubmitByPageOperation=e=>e===AnnotationSize.EPageTurningOperation.Forward?index.ESubmitType.Forward:e===AnnotationSize.EPageTurningOperation.Backward?index.ESubmitType.Backward:e===AnnotationSize.EPageTurningOperation.Jump?index.ESubmitType.Jump:index.ESubmitType.Forward,getBasicIndex=(e,t)=>{var n,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Actions=require("../Actions.js"),reducer=require("./reducer.js"),index=require("../../constant/index.js"),AnnotationSize=require("../../data/enums/AnnotationSize.js"),PageOperator=require("../../utils/PageOperator.js"),index$1=require("../../utils/index.js"),__async=(e,t,n)=>new Promise((r,i)=>{var s=T=>{try{u(n.next(T))}catch(a){i(a)}},o=T=>{try{u(n.throw(T))}catch(a){i(a)}},u=T=>T.done?r(T.value):Promise.resolve(T.value).then(s,o);u((n=n.apply(e,t)).next())});const dispatchTasks=(e,t)=>t.map(n=>e(n)),getSubmitByPageOperation=e=>e===AnnotationSize.EPageTurningOperation.Forward?index.ESubmitType.Forward:e===AnnotationSize.EPageTurningOperation.Backward?index.ESubmitType.Backward:e===AnnotationSize.EPageTurningOperation.Jump?index.ESubmitType.Jump:index.ESubmitType.Forward,getBasicIndex=(e,t)=>{var n,r;const{imgList:i,imgIndex:s}=e,{dataSourceStep:o}=reducer.getStepConfig(e.stepList,e.step);return((r=(n=index$1.jsonParser(i[s-1].result)[`step_${o}`])==null?void 0:n.result)==null?void 0:r.length)-1||t};function SetTaskConfig({stepList:e,step:t}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG,payload:{stepList:e,step:t}}}function UpdateOnSubmit(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT,payload:{onSubmit:e}}}function UpdateOnSave(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE,payload:{onSave:e}}}function UpdateOnPageChange(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE,payload:{onPageChange:e}}}function UpdateOnStepChange(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE,payload:{onStepChange:e}}}function UpdateGetFileData(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA,payload:{getFileData:e}}}function UpdatePageSize(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE,payload:{pageSize:e}}}function UpdateGetFileList(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST,payload:{loadFileList:e}}}function UpdateRotate(){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE}}function CopyBackWordResult(){return{type:Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT}}function InitTaskData({onSubmit:e,onSave:t,onPageChange:n,onStepChange:r,getFileData:i,pageSize:s,loadFileList:o,step:u,stepList:T}){const a=[];return e&&a.push(UpdateOnSubmit(e)),t&&a.push(UpdateOnSave(t)),n&&a.push(UpdateOnPageChange(n)),r&&a.push(UpdateOnStepChange(r)),i&&a.push(UpdateGetFileData(i)),o&&a.push(UpdateGetFileList(o)),s&&a.push(UpdatePageSize(s)),a.push(SetTaskConfig({stepList:T,step:u})),a.push({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),a.push({type:Actions.ANNOTATION_ACTIONS.INIT_TOOL}),p=>dispatchTasks(p,a)}const getNextStep=(e,t)=>{var n;const r=t==null?void 0:t.findIndex(i=>(i==null?void 0:i.step)===e);return(n=t[r+1])==null?void 0:n.step},ToNextStep=e=>(t,n)=>{const{annotation:r}=n(),{step:i,stepList:s}=r,o=getNextStep(i,s);return[t(UpdateProcessingStep(o,e))]},UpdateProcessingStep=(e,t)=>(n,r)=>{var i,s;const{annotation:o}=r();(i=o==null?void 0:o.onStepChange)==null||i.call(o,e);const u=(s=o==null?void 0:o.imgIndex)!=null?s:0;return[n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:index.ESubmitType.StepChanged}}),n({type:Actions.ANNOTATION_ACTIONS.SET_STEP,payload:{toStep:e}}),n({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),n(reducer.LoadFileAndFileData(t!=null?t:u,0))]},ToSubmitFileData=e=>t=>[t({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),t({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:e}})],SubmitAndChangeFileIndex=(e,t,n,r)=>[e(ToSubmitFileData(n)),e(reducer.LoadFileAndFileData(t,r))],ChangeBasicIndex=(e,t)=>[e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),e({type:Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX,payload:{basicIndex:t}})],ChangeTriggerEventAfterIndexChanged=(e,t)=>{e({type:Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED,payload:{triggerEventAfterIndexChanged:t}})},PageBackward=(e=!1)=>(t,n)=>DispatcherTurning(t,n,AnnotationSize.EPageTurningOperation.Backward,e),PageForward=(e=!1)=>(t,n)=>DispatcherTurning(t,n,AnnotationSize.EPageTurningOperation.Forward,e),PageJump=(e,t=!1)=>(n,r)=>{if(e!==r().imgIndex)return DispatcherTurning(n,r,AnnotationSize.EPageTurningOperation.Jump,t,e)},loadImgList=(e,t,n,r)=>__async(void 0,null,function*(){var i;const{loadFileList:s,imgList:o,pageSize:u}=t().annotation,T=Math.floor(n/u);SetAnnotationLoading(e,!0);try{const a=yield s(T,u);if(SetAnnotationLoading(e,!1),!((i=a==null?void 0:a.fileList)==null?void 0:i.length)||!(a==null?void 0:a.total))throw new Error("fileList and total are required");const p=r?new Array(a.total):[...o];return p.splice(T*u,u,...a.fileList),e({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:p}}),!0}catch(a){SetAnnotationLoading(e,!1),console.error(a)}}),DispatcherTurning=(e,t,n,r=!1,i)=>__async(void 0,null,function*(){var s;const o=t().annotation,{fileIndexChanged:u,fileIndex:T,basicIndexChanged:a,basicIndex:p}=PageOperator.getNextPageInfo(n,o,i),A=getSubmitByPageOperation(n);if(ChangeTriggerEventAfterIndexChanged(e,r),u){if(o.loading||!o.imgList[T]&&!(yield loadImgList(e,t,T)))return;(s=o.onPageChange)==null||s.call(o,T);const N=A===index.ESubmitType.Backward?getBasicIndex(t().annotation,p):p;return SubmitAndChangeFileIndex(e,T,A,N)}return a?ChangeBasicIndex(e,p):e(ToSubmitFileData(A))}),ChangeSave=e=>{e(ToSubmitFileData(index.ESubmitType.Save)),e({type:Actions.ANNOTATION_ACTIONS.SAVE_RESULT})},SetAnnotationLoading=(e,t)=>{e({type:Actions.ANNOTATION_ACTIONS.SET_LOADING,payload:{loading:t}})};exports.ChangeSave=ChangeSave,exports.CopyBackWordResult=CopyBackWordResult,exports.DispatcherTurning=DispatcherTurning,exports.InitTaskData=InitTaskData,exports.PageBackward=PageBackward,exports.PageForward=PageForward,exports.PageJump=PageJump,exports.SetAnnotationLoading=SetAnnotationLoading,exports.SetTaskConfig=SetTaskConfig,exports.ToNextStep=ToNextStep,exports.ToSubmitFileData=ToSubmitFileData,exports.UpdateGetFileData=UpdateGetFileData,exports.UpdateGetFileList=UpdateGetFileList,exports.UpdateOnPageChange=UpdateOnPageChange,exports.UpdateOnSave=UpdateOnSave,exports.UpdateOnStepChange=UpdateOnStepChange,exports.UpdateOnSubmit=UpdateOnSubmit,exports.UpdatePageSize=UpdatePageSize,exports.UpdateProcessingStep=UpdateProcessingStep,exports.UpdateRotate=UpdateRotate,exports.loadImgList=loadImgList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$1=require("../../components/customResizeHook/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"),lbAnnotation=require("@labelbee/lb-annotation"),es=require("antd/es"),_=require("lodash"),actionCreators=require("./actionCreators.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,o)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,__spreadValues=(e,t)=>{for(var o in t||(t={}))__hasOwnProp.call(t,o)&&__defNormalProp(e,o,t[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(t))__propIsEnum.call(t,o)&&__defNormalProp(e,o,t[o]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,o)=>new Promise((T,c)=>{var p=l=>{try{N(o.next(l))}catch(E){c(E)}},g=l=>{try{N(o.throw(l))}catch(E){c(E)}},N=l=>l.done?T(l.value):Promise.resolve(l.value).then(p,g);N((o=o.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(o=>o.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,triggerEventAfterIndexChanged:!1},getTotalPage=e=>{const{imgList:t,imgPageSize:o}=e;return Math.ceil(t.length/o)},calcStepProgress=(e,t)=>e.reduce((o,T)=>{const c=T.result;return index.jsonParser(c)[`step_${t}`]?o+1:o},0)/e.length,updateToolInstance=(e,t)=>{const{step:o,stepList:T}=e,c=StepUtils.getCurrentStepInfo(o,T),p=ConfigUtils.ConfigUtils.jsonParser(c.config),g=document.getElementById("toolContainer");if(!g)throw"Not exist dom named id-toolContainer";const N=index$1.getFormatSize({width:window.innerWidth,height:window.innerHeight}),l=new lbAnnotation.AnnotationEngine({container:g,toolName:c.tool,size:N,imgNode:t,config:p,style:JSON.parse(styleString)});return{toolInstance:l.toolInstance,annotationEngine:l}},LoadImageAndFileData=(e,t)=>(o,T)=>__async(void 0,null,function*(){const{getFileData:c,imgList:p,toolInstance:g}=T().annotation;if(actionCreators.SetAnnotationLoading(o,!0),c){const l=yield c(p[e],e);o({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:l,index:e}})}const{url:N}=p[e];return lbAnnotation.ImgUtils.load(N).then(l=>{actionCreators.SetAnnotationLoading(o,!1),o({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:l,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(o,!1),g.setErrorImg(),o({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})}),annotationReducer=(e=initialState,t)=>{var o,T,c,p,g,N,l,E,h,b,x,F,j,w,U;switch(t.type){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:s}=e,r=calcStepProgress(n,s);return __spreadProps(__spreadValues({},e),{stepProgress:r})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:s,step:r,stepList:i,toolInstance:a,onSubmit:u,resultList:A}=e;if(!a)return e;const I=((o=n[s])==null?void 0:o.result)||"",[,d]=a.exportData(),O=data.composeResultWithBasicImgInfo(I,d),m=data.composeResult(O,{step:r,stepList:i},{rect:A});n[s].result=AnnotationDataUtils.dataCorrection(m,I,r,i),u&&u([n[s]],(T=t.payload)==null?void 0:T.submitType,s);const f=calcStepProgress(n,r);return __spreadProps(__spreadValues({},e),{stepProgress:f,imgList:n})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:s,onSave:r}=e;return r==null||r(n[s],s,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:s,resultList:r,annotationEngine:i,basicResultList:a}=e;if(!i)return e;const[u]=i.toolInstance.exportData();let A=u;if((a==null?void 0:a.length)>0){const I=(c=a[s])==null?void 0:c.id,d=u.map(O=>__spreadProps(__spreadValues({},O),{sourceID:I}));A=___default.default.cloneDeep(r).filter(O=>O.sourceID!==I),A.push(...d)}return __spreadProps(__spreadValues({},e),{resultList:A,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:s,imgList:r,imgIndex:i,stepList:a,annotationEngine:u,resultList:A,basicResultList:I}=e;if(!n||!u)return e;const d=t.payload.basicIndex,O=(p=I[d])==null?void 0:p.id,m=index.jsonParser((g=r[i])==null?void 0:g.result),f=(A||[]).filter(P=>P.sourceID===O),L=getStepConfig(a,s),{dataSourceStep:C,tool:R}=L,D=getStepConfig(a,C);let S=[];return C&&R&&(S=(N=m[`step_${C}`])==null?void 0:N.result,(S==null?void 0:S.length)>0?(u.setBasicInfo(D.tool,S[d]),u.launchOperation()):(u.setBasicInfo(D.tool),u.forbidOperation(),es.message.info("\u5F53\u524D\u6587\u4EF6\u4E0D\u5B58\u5728\u4F9D\u8D56\u6570\u636E"))),n.setResult(f),n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:d})}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:s,toolInstance:r,annotationEngine:i,stepList:a}=e;if(!r||!i)return e;const u=StepUtils.getCurrentStepInfo(s,a),{nextIndex:A,imgNode:I,nextBasicIndex:d,imgError:O}=t.payload,m=d!=null?d:0,f=index.jsonParser((l=n[A])==null?void 0:l.result),L=f[`step_${s}`],C=!L,R={rotate:(E=f.rotate)!=null?E:0,valid:(h=f.valid)!=null?h:!0};I&&O!==!0&&i.setImgNode(I,R);const D=getStepConfig(a,s),{dataSourceStep:S,tool:P}=D,B=getStepConfig(a,S),q=S&&P,v=(x=(b=f[`step_${S}`])==null?void 0:b.result)!=null?x:[],y=AnnotationDataUtils.getInitialResultList(L==null?void 0:L.result,r,D,v,C);if(i.launchOperation(),q&&((v==null?void 0:v.length)>0?i.setBasicInfo(B.tool,v[m]):(i.setBasicInfo(B.tool),i.forbidOperation(),es.message.info("\u5F53\u524D\u6587\u4EF6\u4E0D\u5B58\u5728\u4F9D\u8D56\u6570\u636E"))),u.tool!=="check"){const G=(j=(F=v[m])==null?void 0:F.id)!=null?j:"",z=q?y.filter(M=>lbAnnotation.CommonToolUtils.isSameSourceID(M.sourceID,G)):y;r.setResult(z),r.history.initRecord(y,!0)}return __spreadProps(__spreadValues({},e),{imgIndex:A,basicIndex:m,basicResultList:v,resultList:y})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(w=t.payload.config)!=null?w:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:s}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:s})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,{toolInstance:s,annotationEngine:r}=updateToolInstance(e,n);return __spreadProps(__spreadValues({},e),{toolInstance:s,annotationEngine:r})}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_GET_FILE_DATA:return __spreadProps(__spreadValues({},e),{getFileData:t.payload.getFileData});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:s}=t.payload,{imgList:r}=e;return r[s]=__spreadValues(__spreadValues({},r[s]),n),__spreadProps(__spreadValues({},e),{imgList:r})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n}=e;return n==null||n.updateRotate(),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:s,imgList:r,step:i}=e;if(!n)return e;if(s===0||s>=r.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const a=r[s-1].result;if(!a)return e;const u=AnnotationDataUtils.copyResultChange(a,i,(U=r[s].result)!=null?U:"");r[s].result=u;const I=index.jsonParser(u)[`step_${i}`],d=(I==null?void 0:I.result)||[];return n.setResult(d),n.history.pushHistory(d),__spreadProps(__spreadValues({},e),{imgList:[...r]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:s}=e,{toStep:r}=t.payload;if(!s)return e;const i=getStepConfig(n,r);return s.setToolName(i.tool,i.config),__spreadProps(__spreadValues({},e),{step:r,toolInstance:s.toolInstance})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}default:return e}};exports.LoadImageAndFileData=LoadImageAndFileData,exports.annotationReducer=annotationReducer,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var index$1=require("../../components/customResizeHook/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"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),es=require("antd/es"),_=require("lodash"),actionCreators=require("./actionCreators.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,o)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,__spreadValues=(e,t)=>{for(var o in t||(t={}))__hasOwnProp.call(t,o)&&__defNormalProp(e,o,t[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(t))__propIsEnum.call(t,o)&&__defNormalProp(e,o,t[o]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,o)=>new Promise((c,a)=>{var A=d=>{try{p(o.next(d))}catch(L){a(L)}},N=d=>{try{p(o.throw(d))}catch(L){a(L)}},p=d=>d.done?c(d.value):Promise.resolve(d.value).then(A,N);p((o=o.apply(e,t)).next())});const{EVideoToolName}=lbAnnotation.cTool,getStepConfig=(e,t)=>e.find(o=>o.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,triggerEventAfterIndexChanged:!1},getTotalPage=e=>{const{imgList:t,imgPageSize:o}=e;return Math.ceil(t.length/o)},calcStepProgress=(e,t)=>e.reduce((o,c)=>{if(c){const a=c.result;if(index.jsonParser(a)[`step_${t}`])return o+1}return o},0)/e.length,updateToolInstance=(e,t)=>{const{step:o,stepList:c}=e,a=StepUtils.getCurrentStepInfo(o,c),A=ConfigUtils.ConfigUtils.jsonParser(a.config);if(Object.values(EVideoToolName).includes(a.tool))return;const N=document.getElementById("toolContainer");if(!N)throw"Not exist dom named id-toolContainer";const p=index$1.getFormatSize({width:window.innerWidth,height:window.innerHeight}),d=new lbAnnotation.AnnotationEngine({container:N,toolName:a.tool,size:p,imgNode:t,config:A,style:JSON.parse(styleString)});return{toolInstance:d==null?void 0:d.toolInstance,annotationEngine:d}},LoadFileAndFileData=(e,t)=>(o,c)=>__async(void 0,null,function*(){const{stepList:a,step:A}=c().annotation,N=StepUtils.currentToolIsVideo(A,a);if(actionCreators.SetAnnotationLoading(o,!0),o(TryGetFileDataByAPI(e)),N){o(AfterVideoLoaded(e));return}o(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,o)=>__async(void 0,null,function*(){const{getFileData:c,imgList:a}=o().annotation;if(c){const A=yield c(a[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:A,index:e}})}}),AfterVideoLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(o,c)=>{var a;const{toolInstance:A,imgList:N}=c().annotation,p=(a=N==null?void 0:N[e])==null?void 0:a.url;lbAnnotation.ImgUtils.load(p).then(d=>{actionCreators.SetAnnotationLoading(o,!1),o({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:d,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(o,!1),A==null||A.setErrorImg(),o({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},annotationReducer=(e=initialState,t)=>{var o,c,a,A,N,p,d,L,b,h,U,F,j,w,x,B;switch(t.type){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:s}=e,i=calcStepProgress(n,s);return __spreadProps(__spreadValues({},e),{stepProgress:i})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:s,step:i,stepList:r,toolInstance:u,onSubmit:l,resultList:O}=e;if(!u||!n[s])return e;const T=((o=n[s])==null?void 0:o.result)||"",[,I]=u==null?void 0:u.exportData(),g=data.composeResultWithBasicImgInfo(T,I),v=data.composeResult(g,{step:i,stepList:r},{rect:O});n[s].result=AnnotationDataUtils.dataCorrection(v,T,i,r),l&&l([n[s]],(c=t.payload)==null?void 0:c.submitType,s);const f=calcStepProgress(n,i);return __spreadProps(__spreadValues({},e),{stepProgress:f,imgList:n})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:s,onSave:i}=e;return i==null||i(n[s],s,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:s,resultList:i,toolInstance:r,basicResultList:u}=e;if(!r)return e;const[l]=r==null?void 0:r.exportData();let O=l;if((u==null?void 0:u.length)>0){const T=(a=u[s])==null?void 0:a.id,I=l.map(g=>__spreadProps(__spreadValues({},g),{sourceID:T}));O=___default.default.cloneDeep(i).filter(g=>g.sourceID!==T),O.push(...I)}return __spreadProps(__spreadValues({},e),{resultList:O,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:s,imgList:i,imgIndex:r,stepList:u,annotationEngine:l,resultList:O,basicResultList:T}=e;if(!n||!l)return e;const I=t.payload.basicIndex,g=(A=T[I])==null?void 0:A.id,v=index.jsonParser((N=i[r])==null?void 0:N.result),f=(O||[]).filter(R=>R.sourceID===g),E=getStepConfig(u,s),{dataSourceStep:m,tool:P}=E,D=getStepConfig(u,m);let S=[];return m&&P&&(S=(p=v[`step_${m}`])==null?void 0:p.result,(S==null?void 0:S.length)>0?(l==null||l.setBasicInfo(D.tool,S[I]),l==null||l.launchOperation()):(l==null||l.setBasicInfo(D.tool),l==null||l.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(f),n==null||n.history.initRecord(f,!0),__spreadProps(__spreadValues({},e),{basicIndex:I})}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:s,toolInstance:i,annotationEngine:r,stepList:u}=e;if(!i)return e;const l=StepUtils.getCurrentStepInfo(s,u),{nextIndex:O,imgNode:T,nextBasicIndex:I,imgError:g}=t.payload,v=I!=null?I:0,f=index.jsonParser((d=n[O])==null?void 0:d.result),E=f[`step_${s}`],m=!E,P={rotate:(L=f.rotate)!=null?L:0,valid:(b=f.valid)!=null?b:!0};T&&g!==!0&&(r==null||r.setImgNode(T,P));const D=getStepConfig(u,s),{dataSourceStep:S,tool:R}=D,G=getStepConfig(u,S),q=S&&R,C=(U=(h=f[`step_${S}`])==null?void 0:h.result)!=null?U:[],y=AnnotationDataUtils.getInitialResultList(E==null?void 0:E.result,i,D,C,m);if(r==null||r.launchOperation(),q&&((C==null?void 0:C.length)>0?r==null||r.setBasicInfo(G.tool,C[v]):(r==null||r.setBasicInfo(G.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),l.tool!=="check"){const z=(j=(F=C[v])==null?void 0:F.id)!=null?j:"",V=q?y.filter(H=>lbAnnotation.CommonToolUtils.isSameSourceID(H.sourceID,z)):y;i==null||i.setResult(V),i==null||i.history.initRecord(y,!0)}return __spreadProps(__spreadValues({},e),{imgIndex:O,basicIndex:v,basicResultList:C,resultList:y})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(w=t.payload.config)!=null?w:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:s}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:s})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,s=updateToolInstance(e,n);if(s){const{toolInstance:i,annotationEngine:r}=s;return __spreadProps(__spreadValues({},e),{toolInstance:i,annotationEngine:r})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(x=t.payload)==null?void 0:x.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.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.SET_FILE_DATA:{const{fileData:n,index:s}=t.payload,{imgList:i}=e;return i[s]=__spreadValues(__spreadValues({},i[s]),n),__spreadProps(__spreadValues({},e),{imgList:i})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n}=e;return n==null||n.updateRotate(),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:s,imgList:i,step:r}=e;if(!n)return e;if(s===0||s>=i.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const u=i[s-1].result;if(!u)return e;const l=AnnotationDataUtils.copyResultChange(u,r,(B=i[s].result)!=null?B:"");i[s].result=l;const T=index.jsonParser(l)[`step_${r}`],I=(T==null?void 0:T.result)||[];return n==null||n.setResult(I),n==null||n.history.pushHistory(I),__spreadProps(__spreadValues({},e),{imgList:[...i]})}case Actions.ANNOTATION_ACTIONS.SET_STEP:{const{stepList:n,annotationEngine:s}=e,{toStep:i}=t.payload;if(!s)return e;const r=getStepConfig(n,i);return s==null||s.setToolName(r.tool,r.config),__spreadProps(__spreadValues({},e),{step:i,toolInstance:s==null?void 0:s.toolInstance})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
|
package/dist/types/App.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ToolInstance } from './store/annotation/types';
|
|
3
|
-
import { GetFileData, OnSave, OnSubmit, IFileItem } from './types/data';
|
|
3
|
+
import { GetFileData, OnSave, OnSubmit, IFileItem, OnPageChange, OnStepChange, LoadFileList } from './types/data';
|
|
4
4
|
import { Footer, Header, Sider } from './types/main';
|
|
5
5
|
import { IStepInfo } from './types/step';
|
|
6
6
|
interface IAnnotationStyle {
|
|
@@ -12,13 +12,17 @@ interface IAnnotationStyle {
|
|
|
12
12
|
export interface AppProps {
|
|
13
13
|
exportData?: (data: any[]) => void;
|
|
14
14
|
goBack?: () => void;
|
|
15
|
-
imgList
|
|
15
|
+
imgList?: IFileItem[];
|
|
16
16
|
config: string;
|
|
17
17
|
stepList: IStepInfo[];
|
|
18
18
|
step: number;
|
|
19
19
|
onSubmit?: OnSubmit;
|
|
20
20
|
onSave?: OnSave;
|
|
21
|
+
onPageChange?: OnPageChange;
|
|
22
|
+
onStepChange?: OnStepChange;
|
|
21
23
|
getFileData?: GetFileData;
|
|
24
|
+
pageSize: number;
|
|
25
|
+
loadFileList?: LoadFileList;
|
|
22
26
|
headerName?: string;
|
|
23
27
|
initialIndex?: number;
|
|
24
28
|
className?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface
|
|
2
|
+
export interface IFileErrorProps {
|
|
3
3
|
width?: number;
|
|
4
4
|
height?: number;
|
|
5
5
|
reloadImage: () => void;
|
|
@@ -8,7 +8,8 @@ interface IProps {
|
|
|
8
8
|
ignoreOffsetY?: boolean;
|
|
9
9
|
layerStyle?: React.CSSProperties;
|
|
10
10
|
backgroundColor: string;
|
|
11
|
-
|
|
11
|
+
fileType?: string;
|
|
12
|
+
isError?: boolean;
|
|
12
13
|
}
|
|
13
|
-
declare const
|
|
14
|
-
export default
|
|
14
|
+
declare const FileError: (props: IFileErrorProps) => JSX.Element;
|
|
15
|
+
export default FileError;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Glenfiddish <edwinlee0927@hotmail.com>
|
|
3
|
+
* @file File invalid layer, display while isValid equal false
|
|
4
|
+
* @date 2022-06-07
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
export interface IFileInvalidProps {
|
|
8
|
+
fileType?: string;
|
|
9
|
+
isValid: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const FileInvalid: React.FC<IFileInvalidProps>;
|
|
12
|
+
export default FileInvalid;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Glenfiddish <edwinlee0927@hotmail.com>
|
|
3
|
+
* @file File exception layer, determine whether to render FileInvalid or FileError
|
|
4
|
+
* @date 2022-06-07
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { IFileErrorProps } from './FileError';
|
|
8
|
+
import { IFileInvalidProps } from './FileInvalid';
|
|
9
|
+
interface IFileExceptionProps {
|
|
10
|
+
errorProps: IFileErrorProps & {
|
|
11
|
+
isError: boolean;
|
|
12
|
+
};
|
|
13
|
+
invalidProps: IFileInvalidProps;
|
|
14
|
+
fileType: string;
|
|
15
|
+
}
|
|
16
|
+
declare const FileException: React.FC<IFileExceptionProps>;
|
|
17
|
+
export default FileException;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Glenfiddish <edwinlee0927@hotmail.com>
|
|
3
|
+
* @file connect store & TagToolInstanceAdaptor
|
|
4
|
+
* @date 2022-06-02
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { AnnotationState } from '@/store/annotation/types';
|
|
8
|
+
declare const _default: import("react-redux").ConnectedComponent<React.FC<{
|
|
9
|
+
annotation: AnnotationState;
|
|
10
|
+
}>, import("react-redux").Omit<{
|
|
11
|
+
annotation: AnnotationState;
|
|
12
|
+
} & {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}, "annotation">>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Implement TagTool interaction through class components.
|
|
3
|
+
* Refer to: packages/lb-annotation/src/core/toolOperation/tagOperation.ts
|
|
4
|
+
* @author Glenfiddish <edwinlee0927@hotmail.com>
|
|
5
|
+
* @date 2022-05-31
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { IStepInfo } from '@/types/step';
|
|
9
|
+
import _ from 'lodash';
|
|
10
|
+
import type { ObjectString } from './types';
|
|
11
|
+
import { IFileItem } from '@/types/data';
|
|
12
|
+
export interface IVideoTagInstanceAdaptorProps {
|
|
13
|
+
imgIndex: number;
|
|
14
|
+
imgList: IFileItem[];
|
|
15
|
+
pageForward: () => void;
|
|
16
|
+
pageJump: (page: string) => void;
|
|
17
|
+
pageBackward: () => void;
|
|
18
|
+
onMounted: (instance: TagToolInstanceAdaptor) => void;
|
|
19
|
+
onUnmounted: () => void;
|
|
20
|
+
step: number;
|
|
21
|
+
stepList: IStepInfo[];
|
|
22
|
+
}
|
|
23
|
+
interface IVideoTagInstanceAdaptorState {
|
|
24
|
+
tagResult: any[];
|
|
25
|
+
labelSelectedList: number[];
|
|
26
|
+
valid: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare class TagToolInstanceAdaptor extends React.Component<IVideoTagInstanceAdaptorProps, IVideoTagInstanceAdaptorState> {
|
|
29
|
+
fns: {
|
|
30
|
+
[key: string]: () => void;
|
|
31
|
+
};
|
|
32
|
+
videoRef?: HTMLVideoElement;
|
|
33
|
+
labelSelectedList: number[];
|
|
34
|
+
constructor(props: IVideoTagInstanceAdaptorProps);
|
|
35
|
+
get config(): any;
|
|
36
|
+
/** Just implementation, no actual logic */
|
|
37
|
+
get history(): {
|
|
38
|
+
initRecord: () => void;
|
|
39
|
+
pushHistory: () => void;
|
|
40
|
+
};
|
|
41
|
+
get currentTagResult(): any;
|
|
42
|
+
get valid(): boolean;
|
|
43
|
+
clearResult: (sendMsg?: boolean, value?: string) => void;
|
|
44
|
+
exportData: () => (any[] | {
|
|
45
|
+
valid: boolean;
|
|
46
|
+
duration: number;
|
|
47
|
+
frames: number | undefined;
|
|
48
|
+
videoWidth: number;
|
|
49
|
+
videoHeight: number;
|
|
50
|
+
})[];
|
|
51
|
+
singleOn(event: string, func: () => void): void;
|
|
52
|
+
on(event: string, func: () => void): void;
|
|
53
|
+
getTagResultByCode(num1: number, num2?: number): {
|
|
54
|
+
value: {
|
|
55
|
+
key: any;
|
|
56
|
+
value: any;
|
|
57
|
+
};
|
|
58
|
+
isMulti: any;
|
|
59
|
+
} | undefined;
|
|
60
|
+
setLabelBySelectedList(num1: number, num2?: number): void;
|
|
61
|
+
emitEvent: (event: string) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Combine result with inputValue and existValue
|
|
64
|
+
* @param inputValue
|
|
65
|
+
* @param existValue
|
|
66
|
+
* @returns newValue
|
|
67
|
+
*/
|
|
68
|
+
combineResult: (inputValue: {
|
|
69
|
+
value: {
|
|
70
|
+
key: string;
|
|
71
|
+
value: string;
|
|
72
|
+
};
|
|
73
|
+
isMulti: boolean;
|
|
74
|
+
}, existValue?: ObjectString) => _.Dictionary<string | undefined>;
|
|
75
|
+
setResult: (tagResult: any[]) => void;
|
|
76
|
+
setLabel: (num1: number, num2: number) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Keydown event for recording keycode input(numeric only)
|
|
79
|
+
* @param event
|
|
80
|
+
*/
|
|
81
|
+
keydown: (event: KeyboardEvent) => void;
|
|
82
|
+
setValid: (valid: boolean) => void;
|
|
83
|
+
componentDidMount(): void;
|
|
84
|
+
componentWillUnmount(): void;
|
|
85
|
+
setResultFromImgList: (props: IVideoTagInstanceAdaptorProps) => void;
|
|
86
|
+
/** Observer imgIndex and set tagResult */
|
|
87
|
+
shouldComponentUpdate(props: IVideoTagInstanceAdaptorProps): boolean;
|
|
88
|
+
render(): JSX.Element;
|
|
89
|
+
}
|
|
90
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IVideoTagInstanceAdaptorProps } from './TagToolInstanceAdaptor';
|
|
2
|
+
/**
|
|
3
|
+
* I18n provider for InstanceAdaptorI18nProvider
|
|
4
|
+
* @param props
|
|
5
|
+
*/
|
|
6
|
+
export declare const VideoTagTool: (props: IVideoTagInstanceAdaptorProps & {
|
|
7
|
+
lang?: string;
|
|
8
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IInputList } from '@/types/main';
|
|
3
|
+
interface IVideoTagLayerProps {
|
|
4
|
+
result: Array<{
|
|
5
|
+
result: {
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
};
|
|
8
|
+
}>;
|
|
9
|
+
inputList: IInputList[];
|
|
10
|
+
}
|
|
11
|
+
export declare const VideoTagLayer: React.FC<IVideoTagLayerProps>;
|
|
12
|
+
export {};
|