@labelbee/lb-components 1.6.0-alpha.7 → 1.6.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +203 -0
- package/dist/App.js +1 -1
- package/dist/assets/attributeIcon/eraser.svg.js +1 -0
- package/dist/assets/attributeIcon/eraser_a.svg.js +1 -0
- package/dist/assets/attributeIcon/pen.svg.js +1 -0
- package/dist/assets/attributeIcon/pen_a.svg.js +1 -0
- package/dist/components/attributeList/index.js +1 -1
- package/dist/data/enums/ToolType.js +1 -1
- package/dist/index.css +32 -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 +7 -0
- package/dist/types/components/attributeList/index.d.ts +1 -0
- package/dist/types/data/enums/ToolType.d.ts +14 -8
- package/dist/types/store/Actions.d.ts +1 -0
- package/dist/types/store/annotation/actionCreators.d.ts +8 -0
- package/dist/types/views/MainView/annotationOperation/index.d.ts +3 -0
- package/dist/types/views/MainView/sidebar/ScribbleSidebar/index.d.ts +6 -0
- package/dist/views/MainView/annotationOperation/index.js +1 -1
- package/dist/views/MainView/annotationTips/index.js +1 -1
- package/dist/views/MainView/index.js +1 -1
- package/dist/views/MainView/sidebar/ScribbleSidebar/index.js +1 -0
- package/dist/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
- package/dist/views/MainView/sidebar/index.js +1 -1
- package/dist/views/MainView/toolFooter/ZoomController/ZoomLevel/index.js +1 -1
- package/es/App.js +1 -1
- package/es/App.js.map +1 -1
- package/es/assets/attributeIcon/eraser.svg.js +1 -4
- package/es/assets/attributeIcon/eraser_a.svg.js +1 -4
- package/es/assets/attributeIcon/pen.svg.js +1 -4
- package/es/assets/attributeIcon/pen_a.svg.js +1 -4
- package/es/components/attributeList/index.js +1 -1
- package/es/components/attributeList/index.js.map +1 -1
- package/es/components/customResizeHook/index.js.map +1 -1
- package/es/data/enums/ToolType.js +1 -1
- package/es/data/enums/ToolType.js.map +1 -1
- package/es/index.css +32 -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/views/MainView/annotationOperation/index.js +1 -1
- package/es/views/MainView/annotationOperation/index.js.map +1 -1
- package/es/views/MainView/annotationTips/index.js +1 -1
- package/es/views/MainView/annotationTips/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/ScribbleSidebar/index.js +1 -60
- package/es/views/MainView/sidebar/ScribbleSidebar/index.js.map +1 -1
- package/es/views/MainView/sidebar/SwitchAttributeList/index.js +1 -1
- package/es/views/MainView/sidebar/SwitchAttributeList/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/ZoomController/ZoomLevel/index.js +1 -1
- package/es/views/MainView/toolFooter/ZoomController/ZoomLevel/index.js.map +1 -1
- package/package.json +5 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
Copyright 2018-2023 OpenMMLab. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Apache License
|
|
4
|
+
Version 2.0, January 2004
|
|
5
|
+
http://www.apache.org/licenses/
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
12
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
13
|
+
|
|
14
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
15
|
+
the copyright owner that is granting the License.
|
|
16
|
+
|
|
17
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
18
|
+
other entities that control, are controlled by, or are under common
|
|
19
|
+
control with that entity. For the purposes of this definition,
|
|
20
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
21
|
+
direction or management of such entity, whether by contract or
|
|
22
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
23
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
24
|
+
|
|
25
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
26
|
+
exercising permissions granted by this License.
|
|
27
|
+
|
|
28
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
29
|
+
including but not limited to software source code, documentation
|
|
30
|
+
source, and configuration files.
|
|
31
|
+
|
|
32
|
+
"Object" form shall mean any form resulting from mechanical
|
|
33
|
+
transformation or translation of a Source form, including but
|
|
34
|
+
not limited to compiled object code, generated documentation,
|
|
35
|
+
and conversions to other media types.
|
|
36
|
+
|
|
37
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
38
|
+
Object form, made available under the License, as indicated by a
|
|
39
|
+
copyright notice that is included in or attached to the work
|
|
40
|
+
(an example is provided in the Appendix below).
|
|
41
|
+
|
|
42
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
43
|
+
form, that is based on (or derived from) the Work and for which the
|
|
44
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
45
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
46
|
+
of this License, Derivative Works shall not include works that remain
|
|
47
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
48
|
+
the Work and Derivative Works thereof.
|
|
49
|
+
|
|
50
|
+
"Contribution" shall mean any work of authorship, including
|
|
51
|
+
the original version of the Work and any modifications or additions
|
|
52
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
53
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
54
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
55
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
56
|
+
means any form of electronic, verbal, or written communication sent
|
|
57
|
+
to the Licensor or its representatives, including but not limited to
|
|
58
|
+
communication on electronic mailing lists, source code control systems,
|
|
59
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
60
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
61
|
+
excluding communication that is conspicuously marked or otherwise
|
|
62
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
63
|
+
|
|
64
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
65
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
66
|
+
subsequently incorporated within the Work.
|
|
67
|
+
|
|
68
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
69
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
70
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
71
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
72
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
73
|
+
Work and such Derivative Works in Source or Object form.
|
|
74
|
+
|
|
75
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
76
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
77
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
78
|
+
(except as stated in this section) patent license to make, have made,
|
|
79
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
80
|
+
where such license applies only to those patent claims licensable
|
|
81
|
+
by such Contributor that are necessarily infringed by their
|
|
82
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
83
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
84
|
+
institute patent litigation against any entity (including a
|
|
85
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
86
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
87
|
+
or contributory patent infringement, then any patent licenses
|
|
88
|
+
granted to You under this License for that Work shall terminate
|
|
89
|
+
as of the date such litigation is filed.
|
|
90
|
+
|
|
91
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
92
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
93
|
+
modifications, and in Source or Object form, provided that You
|
|
94
|
+
meet the following conditions:
|
|
95
|
+
|
|
96
|
+
(a) You must give any other recipients of the Work or
|
|
97
|
+
Derivative Works a copy of this License; and
|
|
98
|
+
|
|
99
|
+
(b) You must cause any modified files to carry prominent notices
|
|
100
|
+
stating that You changed the files; and
|
|
101
|
+
|
|
102
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
103
|
+
that You distribute, all copyright, patent, trademark, and
|
|
104
|
+
attribution notices from the Source form of the Work,
|
|
105
|
+
excluding those notices that do not pertain to any part of
|
|
106
|
+
the Derivative Works; and
|
|
107
|
+
|
|
108
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
109
|
+
distribution, then any Derivative Works that You distribute must
|
|
110
|
+
include a readable copy of the attribution notices contained
|
|
111
|
+
within such NOTICE file, excluding those notices that do not
|
|
112
|
+
pertain to any part of the Derivative Works, in at least one
|
|
113
|
+
of the following places: within a NOTICE text file distributed
|
|
114
|
+
as part of the Derivative Works; within the Source form or
|
|
115
|
+
documentation, if provided along with the Derivative Works; or,
|
|
116
|
+
within a display generated by the Derivative Works, if and
|
|
117
|
+
wherever such third-party notices normally appear. The contents
|
|
118
|
+
of the NOTICE file are for informational purposes only and
|
|
119
|
+
do not modify the License. You may add Your own attribution
|
|
120
|
+
notices within Derivative Works that You distribute, alongside
|
|
121
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
122
|
+
that such additional attribution notices cannot be construed
|
|
123
|
+
as modifying the License.
|
|
124
|
+
|
|
125
|
+
You may add Your own copyright statement to Your modifications and
|
|
126
|
+
may provide additional or different license terms and conditions
|
|
127
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
128
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
129
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
130
|
+
the conditions stated in this License.
|
|
131
|
+
|
|
132
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
133
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
134
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
135
|
+
this License, without any additional terms or conditions.
|
|
136
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
137
|
+
the terms of any separate license agreement you may have executed
|
|
138
|
+
with Licensor regarding such Contributions.
|
|
139
|
+
|
|
140
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
141
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
142
|
+
except as required for reasonable and customary use in describing the
|
|
143
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
144
|
+
|
|
145
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
146
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
147
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
148
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
149
|
+
implied, including, without limitation, any warranties or conditions
|
|
150
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
151
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
152
|
+
appropriateness of using or redistributing the Work and assume any
|
|
153
|
+
risks associated with Your exercise of permissions under this License.
|
|
154
|
+
|
|
155
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
156
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
157
|
+
unless required by applicable law (such as deliberate and grossly
|
|
158
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
159
|
+
liable to You for damages, including any direct, indirect, special,
|
|
160
|
+
incidental, or consequential damages of any character arising as a
|
|
161
|
+
result of this License or out of the use or inability to use the
|
|
162
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
163
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
164
|
+
other commercial damages or losses), even if such Contributor
|
|
165
|
+
has been advised of the possibility of such damages.
|
|
166
|
+
|
|
167
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
168
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
169
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
170
|
+
or other liability obligations and/or rights consistent with this
|
|
171
|
+
License. However, in accepting such obligations, You may act only
|
|
172
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
173
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
174
|
+
defend, and hold each Contributor harmless for any liability
|
|
175
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
176
|
+
of your accepting any such warranty or additional liability.
|
|
177
|
+
|
|
178
|
+
END OF TERMS AND CONDITIONS
|
|
179
|
+
|
|
180
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
181
|
+
|
|
182
|
+
To apply the Apache License to your work, attach the following
|
|
183
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
184
|
+
replaced with your own identifying information. (Don't include
|
|
185
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
186
|
+
comment syntax for the file format. We also recommend that a
|
|
187
|
+
file or class name and description of purpose be included on the
|
|
188
|
+
same "printed page" as the copyright notice for easier
|
|
189
|
+
identification within third-party archives.
|
|
190
|
+
|
|
191
|
+
Copyright 2018-2023 OpenMMLab.
|
|
192
|
+
|
|
193
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
+
you may not use this file except in compliance with the License.
|
|
195
|
+
You may obtain a copy of the License at
|
|
196
|
+
|
|
197
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
+
|
|
199
|
+
Unless required by applicable law or agreed to in writing, software
|
|
200
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
+
See the License for the specific language governing permissions and
|
|
203
|
+
limitations under the License.
|
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"),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,
|
|
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,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e};const App=e=>{const{imgList:t,step:a=1,stepList:n,onSubmit:i,onSave:o,onPageChange:s,onStepChange:c,initialIndex:l=0,toolInstance:f,setToolInstance:g,getFileData:u,pageSize:d=10,loadFileList:r,defaultLang:p="cn",skipBeforePageTurning:v}=e;React.useEffect(()=>{index.store.dispatch(actionCreators.InitTaskData({onSubmit:i,stepList:n,step:a,getFileData:u,pageSize:d,loadFileList:r,onSave:o,onPageChange:s,onStepChange:c,skipBeforePageTurning:v})),_(),lbUtils.i18n.changeLanguage(p)},[]),React.useEffect(()=>{index.store.dispatch(actionCreators.UpdateInjectFunc({onSubmit:i,stepList:n,getFileData:u,pageSize:d,loadFileList:r,onSave:o,onPageChange:s,onStepChange:c})),lbUtils.i18n.changeLanguage(p)},[i,n,u,d,r,o,s,c,p]),React.useEffect(()=>{g==null||g(f)},[f]);const _=()=>{r?actionCreators.loadImgList(index.store.dispatch,index.store.getState,l,!0).then(I=>{I&&index.store.dispatch(reducer.LoadFileAndFileData(l))}):t&&t.length>0&&(index.store.dispatch({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:t}}),index.store.dispatch(reducer.LoadFileAndFileData(l)))};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 width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='6.34875' y='0.353553' width='4.5' height='8.47848' rx='2.25' transform='rotate(45 6.34875 0.353553)' fill='%23E6E6E6' stroke='%23BAB8B8' stroke-width='0.5' /%3e %3cline x1='1.74547' y1='4.60767' x2='4.92401' y2='8.46733' stroke='%23BAB8B8' stroke-width='0.5' /%3e %3cline x1='2.00061' y1='9.75' x2='10.0006' y2='9.75' stroke='%23BAB8B8' stroke-width='0.5' /%3e%3c/svg%3e";module.exports=img;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var img="data:image/svg+xml,%3csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='6.34875' y='0.353553' width='4.5' height='8.47848' rx='2.25' transform='rotate(45 6.34875 0.353553)' fill='%236272FB' stroke='%23BAB8B8' stroke-width='0.5' /%3e %3cline x1='1.74547' y1='4.60767' x2='4.92401' y2='8.46733' stroke='%23BAB8B8' stroke-width='0.5' /%3e %3cline x1='2.00061' y1='9.75' x2='10.0006' y2='9.75' stroke='%236272FB' stroke-width='0.5' /%3e%3c/svg%3e";module.exports=img;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var img="data:image/svg+xml,%3csvg width='12' height='13' viewBox='0 0 12 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='9.07153' y='1' width='3' height='10' rx='1' transform='rotate(45 9.07153 1)' fill='%23BAB8B8' /%3e %3cpath d='M1.06068 11.182L1.73311 8.67247L3.57023 10.5096L1.06068 11.182Z' fill='%23BAB8B8' /%3e %3ccircle cx='11.0002' cy='1' r='1' fill='%23BAB8B8' /%3e%3c/svg%3e";module.exports=img;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var img="data:image/svg+xml,%3csvg width='12' height='13' viewBox='0 0 12 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3crect x='9.07153' y='1' width='3' height='10' rx='1' transform='rotate(45 9.07153 1)' fill='%236272FB' /%3e %3cpath d='M1.06068 11.182L1.73311 8.67247L3.57023 10.5096L1.06068 11.182Z' fill='%236272FB' /%3e %3ccircle cx='11.0002' cy='1' r='1' fill='%236272FB' /%3e%3c/svg%3e";module.exports=img;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Style=require("../../data/Style.js"),index=require("../colorTag/index.js"),es=require("antd/es"),React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const ATTRIBUTE_COLORS=[Style.NULL_COLOR].concat(Style.COLORS_ARRAY),AttributeList=React__default.default.forwardRef((e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Style=require("../../data/Style.js"),index=require("../colorTag/index.js"),es=require("antd/es"),React=require("react");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const ATTRIBUTE_COLORS=[Style.NULL_COLOR].concat(Style.COLORS_ARRAY),AttributeList=React__default.default.forwardRef((e,o)=>{const d=React__default.default.useRef(),f=e.list||[];let r=[...ATTRIBUTE_COLORS];e.forbidDefault===!0&&(r=r.slice(1));let u="sensebee-radio-group";return e.noHeightLimit&&(u="sensebee-radio-group-no-limit-height"),React__default.default.createElement("div",{className:u},React__default.default.createElement(es.Radio.Group,{name:"radiogroup",defaultValue:e==null?void 0:e.selectedAttribute,value:e==null?void 0:e.selectedAttribute,onChange:t=>e.attributeChanged(t.target.value),ref:o},f.map((t,l)=>{var i;let a=(i=e==null?void 0:e.num)!=null?i:l;e.forbidDefault===!0&&a++,typeof a=="number"&&a<=9&&a>=0||(a="-");let n=l>8&&!e.forbidDefault?Style.COLORS_ARRAY[(l-1)%Style.COLORS_ARRAY.length]:r[l%r.length];return(t==null?void 0:t.color)&&(n=t.color),React__default.default.createElement(es.Radio,{value:t.value,ref:d,key:l},React__default.default.createElement("span",{className:"sensebee-radio-label",title:t.label},!(e==null?void 0:e.forbidColor)&&React__default.default.createElement(index.ColorTag,{color:n,style:{marginRight:"8px"}}),t.label),React__default.default.createElement("span",{className:"sensebee-radio-num"},a))})))});exports.ATTRIBUTE_COLORS=ATTRIBUTE_COLORS,exports.default=AttributeList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EScribblePattern=void 0,function(t){t[t.Scribble=1]="Scribble",t[t.Erase=2]="Erase"}(exports.EScribblePattern||(exports.EScribblePattern={})),exports.EToolName=void 0,function(t){t.Rect="rectTool",t.Tag="tagTool",t.Point="pointTool",t.PointMarker="pointMarkerTool",t.Segmentation="segmentationTool",t.Filter="filterTool",t.Text="textTool",t.Polygon="polygonTool",t.Line="lineTool",t.LineMarker="lineMarkerTool",t.Empty="emptyTool",t.FolderTag="folderTagTool",t.RectTrack="rectTrackTool",t.ScribbleTool="scribbleTool",t.Face="faceTool",t.ClientAttribute="clientAttributeTool",t.OCRRelation="OCRRelationTool",t.SegmentByRect="segmentByRectTool"}(exports.EToolName||(exports.EToolName={})),exports.ETextType=void 0,function(t){t[t.AnyString=0]="AnyString",t[t.Order=1]="Order",t[t.EnglishOnly=2]="EnglishOnly",t[t.NumberOnly=3]="NumberOnly",t[t.CustomFormat=4]="CustomFormat"}(exports.ETextType||(exports.ETextType={}));const TEXT_ATTRIBUTE_MAX_LENGTH=1e3;exports.TEXT_ATTRIBUTE_MAX_LENGTH=TEXT_ATTRIBUTE_MAX_LENGTH;
|
package/dist/index.css
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
border-bottom: 1px solid #eee;
|
|
27
27
|
}
|
|
28
28
|
.bee-layout__content {
|
|
29
|
+
position: relative;
|
|
29
30
|
display: flex;
|
|
30
31
|
flex-direction: column;
|
|
31
32
|
flex: 1;
|
|
@@ -469,6 +470,31 @@
|
|
|
469
470
|
.bee-sidebar #style-borderOpacity .ant-slider-rail {
|
|
470
471
|
background: linear-gradient(to right, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.2) 20%, rgba(0, 0, 0, 0.4) 20%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0.8) 60%, rgba(0, 0, 0, 0.8) 80%, rgb(0, 0, 0) 80%, rgb(0, 0, 0) 100%);
|
|
471
472
|
}
|
|
473
|
+
.bee-sidebar .bee-scribble {
|
|
474
|
+
padding: 20px;
|
|
475
|
+
width: 100%;
|
|
476
|
+
}
|
|
477
|
+
.bee-sidebar .bee-scribble__select {
|
|
478
|
+
display: flex;
|
|
479
|
+
justify-content: center;
|
|
480
|
+
cursor: pointer;
|
|
481
|
+
}
|
|
482
|
+
.bee-sidebar .bee-scribble__select img {
|
|
483
|
+
width: 12px;
|
|
484
|
+
margin: 0px 10px;
|
|
485
|
+
}
|
|
486
|
+
.bee-sidebar .bee-scribble__silder {
|
|
487
|
+
display: flex;
|
|
488
|
+
align-items: center;
|
|
489
|
+
justify-content: center;
|
|
490
|
+
}
|
|
491
|
+
.bee-sidebar .bee-scribble__circle {
|
|
492
|
+
display: block;
|
|
493
|
+
width: 5px;
|
|
494
|
+
height: 5px;
|
|
495
|
+
background: #d9d9d9;
|
|
496
|
+
border-radius: 50%;
|
|
497
|
+
}
|
|
472
498
|
|
|
473
499
|
.bee-tips {
|
|
474
500
|
display: flex;
|
|
@@ -480,10 +506,15 @@
|
|
|
480
506
|
height: 40px;
|
|
481
507
|
padding: 0 30px;
|
|
482
508
|
width: 100%;
|
|
509
|
+
overflow: hidden;
|
|
510
|
+
white-space: nowrap;
|
|
511
|
+
}
|
|
512
|
+
.bee-tips .bee-tips__path {
|
|
513
|
+
max-width: 40%;
|
|
514
|
+
margin-left: 20px;
|
|
483
515
|
text-overflow: ellipsis;
|
|
484
516
|
overflow: hidden;
|
|
485
517
|
white-space: nowrap;
|
|
486
|
-
cursor: text;
|
|
487
518
|
}
|
|
488
519
|
|
|
489
520
|
.annotationOperation {
|
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",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",SKIP_BEFORE_PAGE_TURNING:"@@SKIP_BEFORE_PAGE_TURNING",SET_LOADING:"@@SET_LOADING",SET_POINT_CLOUD_LOADING:"@@SET_POINT_CLOUD_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",SKIP_BEFORE_PAGE_TURNING:"@@SKIP_BEFORE_PAGE_TURNING",SET_LOADING:"@@SET_LOADING",SET_POINT_CLOUD_LOADING:"@@SET_POINT_CLOUD_LOADING",SET_TASK_STEP_LIST:"@@SET_TASK_STEP_LIST"},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"),__async=(e,t,n)=>new Promise((
|
|
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,T)=>{var i=a=>{try{u(n.next(a))}catch(s){T(s)}},o=a=>{try{u(n.throw(a))}catch(s){T(s)}},u=a=>a.done?r(a.value):Promise.resolve(a.value).then(i,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:T,imgIndex:i}=e,{dataSourceStep:o}=reducer.getStepConfig(e.stepList,e.step);return((r=(n=index$1.jsonParser(T[i-1].result)[`step_${o}`])==null?void 0:n.result)==null?void 0:r.length)-1||t};function UpdateToolInstance(e){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE,payload:{toolInstance:e}}}function SetTaskStepList({stepList:e}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST,payload:{stepList:e}}}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 UpdateSkipBeforePageTurning(e){return{type:Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING,payload:{skipBeforePageTurning:e}}}function CopyBackWordResult(){return{type:Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT}}function InitTaskData({onSubmit:e,onSave:t,onPageChange:n,onStepChange:r,getFileData:T,pageSize:i,loadFileList:o,step:u,stepList:a,skipBeforePageTurning:s}){const p=[];return e&&p.push(UpdateOnSubmit(e)),t&&p.push(UpdateOnSave(t)),n&&p.push(UpdateOnPageChange(n)),r&&p.push(UpdateOnStepChange(r)),T&&p.push(UpdateGetFileData(T)),o&&p.push(UpdateGetFileList(o)),i&&p.push(UpdatePageSize(i)),s&&p.push(UpdateSkipBeforePageTurning(s)),p.push(SetTaskConfig({stepList:a,step:u})),p.push({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),p.push({type:Actions.ANNOTATION_ACTIONS.INIT_TOOL}),N=>dispatchTasks(N,p)}function UpdateInjectFunc({onSubmit:e,onSave:t,onPageChange:n,onStepChange:r,getFileData:T,pageSize:i,loadFileList:o,stepList:u}){const a=[];return e&&a.push(UpdateOnSubmit(e)),t&&a.push(UpdateOnSave(t)),n&&a.push(UpdateOnPageChange(n)),r&&a.push(UpdateOnStepChange(r)),T&&a.push(UpdateGetFileData(T)),o&&a.push(UpdateGetFileList(o)),i&&a.push(UpdatePageSize(i)),a.push(SetTaskStepList({stepList:u})),s=>dispatchTasks(s,a)}const getNextStep=(e,t)=>{var n;const r=t==null?void 0:t.findIndex(T=>(T==null?void 0:T.step)===e);return(n=t[r+1])==null?void 0:n.step},ToNextStep=e=>(t,n)=>{const{annotation:r}=n(),{step:T,stepList:i}=r,o=getNextStep(T,i);return[t(UpdateProcessingStep(o,e))]},UpdateProcessingStep=(e,t)=>(n,r)=>{var T,i;const{annotation:o}=r();(T=o==null?void 0:o.onStepChange)==null||T.call(o,e);const u=(i=o==null?void 0:o.imgIndex)!=null?i: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 T;const{loadFileList:i,imgList:o,pageSize:u}=t().annotation,a=Math.floor(n/u);SetAnnotationLoading(e,!0);try{const s=yield i(a,u);if(SetAnnotationLoading(e,!1),!((T=s==null?void 0:s.fileList)==null?void 0:T.length)||!(s==null?void 0:s.total))throw new Error("fileList and total are required");const p=r?new Array(s.total):[...o];return p.splice(a*u,u,...s.fileList),e({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:p}}),!0}catch(s){SetAnnotationLoading(e,!1),console.error(s)}}),DispatcherTurning=(e,t,n,r=!1,T)=>__async(void 0,null,function*(){var i;const o=t().annotation,{fileIndexChanged:u,fileIndex:a,basicIndexChanged:s,basicIndex:p}=PageOperator.getNextPageInfo(n,o,T),N=getSubmitByPageOperation(n);if(ChangeTriggerEventAfterIndexChanged(e,r),u){if(o.loading||!o.imgList[a]&&!(yield loadImgList(e,t,a)))return;(i=o.onPageChange)==null||i.call(o,a);const A=N===index.ESubmitType.Backward?getBasicIndex(t().annotation,p):p;return SubmitAndChangeFileIndex(e,a,N,A)}return s?ChangeBasicIndex(e,p):e(ToSubmitFileData(N))}),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}})},SetPointCloudLoading=(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.SetPointCloudLoading=SetPointCloudLoading,exports.SetTaskConfig=SetTaskConfig,exports.SetTaskStepList=SetTaskStepList,exports.ToNextStep=ToNextStep,exports.ToSubmitFileData=ToSubmitFileData,exports.UpdateGetFileData=UpdateGetFileData,exports.UpdateGetFileList=UpdateGetFileList,exports.UpdateInjectFunc=UpdateInjectFunc,exports.UpdateOnPageChange=UpdateOnPageChange,exports.UpdateOnSave=UpdateOnSave,exports.UpdateOnStepChange=UpdateOnStepChange,exports.UpdateOnSubmit=UpdateOnSubmit,exports.UpdatePageSize=UpdatePageSize,exports.UpdateProcessingStep=UpdateProcessingStep,exports.UpdateRotate=UpdateRotate,exports.UpdateSkipBeforePageTurning=UpdateSkipBeforePageTurning,exports.UpdateToolInstance=UpdateToolInstance,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"),ToolUtils=require("../../utils/ToolUtils.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,r)=>{var A=d=>{try{O(o.next(d))}catch(L){r(L)}},N=d=>{try{O(o.throw(d))}catch(L){r(L)}},O=d=>d.done?c(d.value):Promise.resolve(d.value).then(A,N);O((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,pointCloudLoading:!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 r=c.result;if(index.jsonParser(r)[`step_${t}`])return o+1}return o},0)/e.length,updateToolInstance=(e,t)=>{const{step:o,stepList:c}=e,r=StepUtils.getCurrentStepInfo(o,c),A=ConfigUtils.ConfigUtils.jsonParser(r.config);if(ToolUtils.isVideoTool(r==null?void 0:r.tool)||ToolUtils.isPointCloudTool(r==null?void 0:r.tool))return;const N=document.getElementById("toolContainer");if(!N)throw"Not exist dom named id-toolContainer";const O=index$1.getFormatSize({width:window.innerWidth,height:window.innerHeight}),d=new lbAnnotation.AnnotationEngine({container:N,toolName:r.tool,size:O,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:r,step:A}=c().annotation,N=StepUtils.currentToolIsVideo(A,r),O=StepUtils.currentToolIsPointCloud(A,r);if(actionCreators.SetAnnotationLoading(o,!0),o(TryGetFileDataByAPI(e)),N||O){o(AfterVideoLoaded(e));return}o(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,o)=>__async(void 0,null,function*(){const{getFileData:c,imgList:r}=o().annotation;if(c){const A=yield c(r[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 r;const{toolInstance:A,imgList:N}=c().annotation,O=(r=N==null?void 0:N[e])==null?void 0:r.url;lbAnnotation.ImgUtils.load(O).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,r,A,N,O,d,L,b,h,U,x,F,j,w,B,G,q,V,z;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:l,toolInstance:a,onSubmit:u,resultList:p}=e;if(!a||!n[s])return e;const T=((o=n[s])==null?void 0:o.result)||"",[,I]=(c=a==null?void 0:a.exportData())!=null?c:[],g=(A=(r=a==null?void 0:a.exportCustomData)==null?void 0:r.call(a))!=null?A:{},v=data.composeResultWithBasicImgInfo(T,I),f=data.composeResult(v,{step:i,stepList:l},{rect:p},g);n[s].result=AnnotationDataUtils.dataCorrection(f,T,i,l),u&&u([n[s]],(N=t.payload)==null?void 0:N.submitType,s);const C=calcStepProgress(n,i);return __spreadProps(__spreadValues({},e),{stepProgress:C,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:l,basicResultList:a}=e;if(!l)return e;const[u]=(O=l==null?void 0:l.exportData())!=null?O:[];let p=u;if((a==null?void 0:a.length)>0){const T=(d=a[s])==null?void 0:d.id,I=u.map(g=>__spreadProps(__spreadValues({},g),{sourceID:T}));p=___default.default.cloneDeep(i).filter(g=>g.sourceID!==T),p.push(...I)}return __spreadProps(__spreadValues({},e),{resultList:p,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:s,imgList:i,imgIndex:l,stepList:a,annotationEngine:u,resultList:p,basicResultList:T}=e;if(!n||!u)return e;const I=t.payload.basicIndex,g=(L=T[I])==null?void 0:L.id,v=index.jsonParser((b=i[l])==null?void 0:b.result),f=(p||[]).filter(R=>R.sourceID===g),C=getStepConfig(a,s),{dataSourceStep:m,tool:y}=C,D=getStepConfig(a,m);let S=[];return m&&y&&(S=(h=v[`step_${m}`])==null?void 0:h.result,(S==null?void 0:S.length)>0?(u==null||u.setBasicInfo(D.tool,S[I]),u==null||u.launchOperation()):(u==null||u.setBasicInfo(D.tool),u==null||u.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:l,stepList:a}=e;if(!i)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const u=StepUtils.getCurrentStepInfo(s,a),{nextIndex:p,imgNode:T,nextBasicIndex:I,imgError:g}=t.payload,v=I!=null?I:0,f=index.jsonParser((U=n[p])==null?void 0:U.result),C=f[`step_${s}`],m=!C,y={rotate:(x=f.rotate)!=null?x:0,valid:(F=f.valid)!=null?F:!0};T&&g!==!0?l==null||l.setImgNode(T,y):i==null||i.setValid(y.valid);const D=getStepConfig(a,s),{dataSourceStep:S,tool:R}=D,H=getStepConfig(a,S),M=S&&R,E=(w=(j=f[`step_${S}`])==null?void 0:j.result)!=null?w:[],P=AnnotationDataUtils.getInitialResultList(C==null?void 0:C.result,i,D,E,m);if(l==null||l.launchOperation(),M&&((E==null?void 0:E.length)>0?l==null||l.setBasicInfo(H.tool,E[v]):(l==null||l.setBasicInfo(H.tool),l==null||l.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),u.tool!=="check"){const $=(G=(B=E[v])==null?void 0:B.id)!=null?G:"",k=M?P.filter(W=>lbAnnotation.CommonToolUtils.isSameSourceID(W.sourceID,$)):P;i==null||i.setResult(k),i==null||i.history.initRecord(P,!0)}return __spreadProps(__spreadValues({},e),{imgIndex:p,basicIndex:v,basicResultList:E,resultList:P})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(q=t.payload.config)!=null?q:"{}"});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:l}=s;return __spreadProps(__spreadValues({},e),{toolInstance:i,annotationEngine:l})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(V=t.payload)==null?void 0:V.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.SKIP_BEFORE_PAGE_TURNING:return __spreadProps(__spreadValues({},e),{skipBeforePageTurning:t.payload.skipBeforePageTurning});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:s}=t.payload,{imgList:i}=e,l=[...i];return l[s]=__spreadValues(__spreadValues({},l[s]),n),__spreadProps(__spreadValues({},e),{imgList:l})}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:l}=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 a=i[s-1].result;if(!a)return e;const u=AnnotationDataUtils.copyResultChange(a,l,(z=i[s].result)!=null?z:"");i[s]=__spreadProps(__spreadValues({},i[s]),{result:u});const T=index.jsonParser(u)[`step_${l}`],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 l=getStepConfig(n,i);return s==null||s.setToolName(l.tool,l.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})}case Actions.ANNOTATION_ACTIONS.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{pointCloudLoading:!!n})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,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"),ToolUtils=require("../../utils/ToolUtils.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,s)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,__spreadValues=(e,t)=>{for(var s in t||(t={}))__hasOwnProp.call(t,s)&&__defNormalProp(e,s,t[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(t))__propIsEnum.call(t,s)&&__defNormalProp(e,s,t[s]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__async=(e,t,s)=>new Promise((c,r)=>{var T=d=>{try{O(s.next(d))}catch(E){r(E)}},N=d=>{try{O(s.throw(d))}catch(E){r(E)}},O=d=>d.done?c(d.value):Promise.resolve(d.value).then(T,N);O((s=s.apply(e,t)).next())});const getStepConfig=(e,t)=>e.find(s=>s.step===t),initialState={annotationEngine:null,toolInstance:null,imgList:[],config:"{}",imgIndex:-1,basicIndex:0,imgPageSize:1,step:1,stepList:[],imgNode:new Image,basicResultList:[],resultList:[],stepProgress:0,loading:!1,triggerEventAfterIndexChanged:!1,pointCloudLoading:!1},getTotalPage=e=>{const{imgList:t,imgPageSize:s}=e;return Math.ceil(t.length/s)},calcStepProgress=(e,t)=>e.reduce((s,c)=>{if(c){const r=c.result;if(index.jsonParser(r)[`step_${t}`])return s+1}return s},0)/e.length,updateToolInstance=(e,t)=>{const{step:s,stepList:c}=e,r=StepUtils.getCurrentStepInfo(s,c),T=ConfigUtils.ConfigUtils.jsonParser(r.config);if(ToolUtils.isVideoTool(r==null?void 0:r.tool)||ToolUtils.isPointCloudTool(r==null?void 0:r.tool))return;const N=document.getElementById("toolContainer");if(!N)throw"Not exist dom named id-toolContainer";const O=index$1.getFormatSize({width:window.innerWidth,height:window.innerHeight}),d=new lbAnnotation.AnnotationEngine({container:N,toolName:r.tool,size:O,imgNode:t,config:T,style:JSON.parse(styleString)});return{toolInstance:d==null?void 0:d.toolInstance,annotationEngine:d}},LoadFileAndFileData=(e,t)=>(s,c)=>__async(void 0,null,function*(){const{stepList:r,step:T}=c().annotation,N=StepUtils.currentToolIsVideo(T,r),O=StepUtils.currentToolIsPointCloud(T,r);if(actionCreators.SetAnnotationLoading(s,!0),yield s(TryGetFileDataByAPI(e)),N||O){s(AfterVideoLoaded(e));return}s(AfterImageLoaded(e,t))}),TryGetFileDataByAPI=e=>(t,s)=>__async(void 0,null,function*(){const{getFileData:c,imgList:r}=s().annotation;if(c){const T=yield c(r[e],e);t({type:Actions.ANNOTATION_ACTIONS.SET_FILE_DATA,payload:{fileData:T,index:e}})}}),AfterVideoLoaded=e=>t=>{actionCreators.SetAnnotationLoading(t,!1),t({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e}})},AfterImageLoaded=(e,t)=>(s,c)=>{var r;const{toolInstance:T,imgList:N}=c().annotation,O=(r=N==null?void 0:N[e])==null?void 0:r.url;lbAnnotation.ImgUtils.load(O).then(d=>{actionCreators.SetAnnotationLoading(s,!1),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{imgNode:d,nextIndex:e,nextBasicIndex:t}})}).catch(()=>{actionCreators.SetAnnotationLoading(s,!1),T==null||T.setErrorImg(),s({type:Actions.ANNOTATION_ACTIONS.LOAD_FILE_DATA,payload:{nextIndex:e,nextBasicIndex:t}})})},annotationReducer=(e=initialState,t)=>{var s,c,r,T,N,O,d,E,b,h,U,x,F,j,w,B,G,q,V,z;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:o}=e,i=calcStepProgress(n,o);return __spreadProps(__spreadValues({},e),{stepProgress:i})}case Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA:{const{imgList:n,imgIndex:o,step:i,stepList:l,toolInstance:a,onSubmit:u,resultList:p}=e;if(!a||!n[o])return e;const A=((s=n[o])==null?void 0:s.result)||"",[,I,g]=(c=a==null?void 0:a.exportData())!=null?c:[],v=(T=(r=a==null?void 0:a.exportCustomData)==null?void 0:r.call(a))!=null?T:{},S=data.composeResultWithBasicImgInfo(A,I),C=data.composeResult(S,{step:i,stepList:l},{rect:p},v);n[o].result=AnnotationDataUtils.dataCorrection(C,A,i,l),g&&(n[o]=__spreadValues(__spreadValues({},n[o]),g)),u&&u([n[o]],(N=t.payload)==null?void 0:N.submitType,o);const L=calcStepProgress(n,i);return __spreadProps(__spreadValues({},e),{stepProgress:L,imgList:n})}case Actions.ANNOTATION_ACTIONS.SAVE_RESULT:{const{imgList:n,imgIndex:o,onSave:i}=e;return i==null||i(n[o],o,n),__spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT:{const{imgList:n,basicIndex:o,resultList:i,toolInstance:l,basicResultList:a}=e;if(!l)return e;const[u]=(O=l==null?void 0:l.exportData())!=null?O:[];let p=u;if((a==null?void 0:a.length)>0){const A=(d=a[o])==null?void 0:d.id,I=u.map(g=>__spreadProps(__spreadValues({},g),{sourceID:A}));p=___default.default.cloneDeep(i).filter(g=>g.sourceID!==A),p.push(...I)}return __spreadProps(__spreadValues({},e),{resultList:p,imgList:n})}case Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX:{const{toolInstance:n,step:o,imgList:i,imgIndex:l,stepList:a,annotationEngine:u,resultList:p,basicResultList:A}=e;if(!n||!u)return e;const I=t.payload.basicIndex,g=(E=A[I])==null?void 0:E.id,v=index.jsonParser((b=i[l])==null?void 0:b.result),S=(p||[]).filter(R=>R.sourceID===g),C=getStepConfig(a,o),{dataSourceStep:L,tool:y}=C,D=getStepConfig(a,L);let f=[];return L&&y&&(f=(h=v[`step_${L}`])==null?void 0:h.result,(f==null?void 0:f.length)>0?(u==null||u.setBasicInfo(D.tool,f[I]),u==null||u.launchOperation()):(u==null||u.setBasicInfo(D.tool),u==null||u.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),n==null||n.setResult(S),n==null||n.history.initRecord(S,!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:o,toolInstance:i,annotationEngine:l,stepList:a}=e;if(!i)return __spreadProps(__spreadValues({},e),{imgIndex:t.payload.nextIndex});const u=StepUtils.getCurrentStepInfo(o,a),{nextIndex:p,imgNode:A,nextBasicIndex:I,imgError:g}=t.payload,v=I!=null?I:0,S=index.jsonParser((U=n[p])==null?void 0:U.result),C=S[`step_${o}`],L=!C,y={rotate:(x=S.rotate)!=null?x:0,valid:(F=S.valid)!=null?F:!0};A&&g!==!0?l==null||l.setImgNode(A,y):i==null||i.setValid(y.valid);const D=getStepConfig(a,o),{dataSourceStep:f,tool:R}=D,H=getStepConfig(a,f),M=f&&R,m=(w=(j=S[`step_${f}`])==null?void 0:j.result)!=null?w:[],P=AnnotationDataUtils.getInitialResultList(C==null?void 0:C.result,i,D,m,L);if(l==null||l.launchOperation(),M&&((m==null?void 0:m.length)>0?l==null||l.setBasicInfo(H.tool,m[v]):(l==null||l.setBasicInfo(H.tool),l==null||l.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),u.tool!=="check"){const $=(G=(B=m[v])==null?void 0:B.id)!=null?G:"",k=M?P.filter(K=>lbAnnotation.CommonToolUtils.isSameSourceID(K.sourceID,$)):P;i==null||i.setResult(k),i==null||i.history.initRecord(P,!0)}return __spreadProps(__spreadValues({},e),{imgIndex:p,basicIndex:v,basicResultList:m,resultList:P})}case Actions.ANNOTATION_ACTIONS.UPDATE_ANNOTATION_CONFIG:return __spreadProps(__spreadValues({},e),{config:(q=t.payload.config)!=null?q:"{}"});case Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST:{const{stepList:n}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n})}case Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG:{const{stepList:n,step:o}=t.payload;return __spreadProps(__spreadValues({},e),{stepList:n,step:o})}case Actions.ANNOTATION_ACTIONS.INIT_TOOL:{const{imgNode:n}=e,o=updateToolInstance(e,n);if(o){const{toolInstance:i,annotationEngine:l}=o;return __spreadProps(__spreadValues({},e),{toolInstance:i,annotationEngine:l})}return __spreadValues({},e)}case Actions.ANNOTATION_ACTIONS.SET_TOOL:{const n=(V=t.payload)==null?void 0:V.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.SKIP_BEFORE_PAGE_TURNING:return __spreadProps(__spreadValues({},e),{skipBeforePageTurning:t.payload.skipBeforePageTurning});case Actions.ANNOTATION_ACTIONS.SET_FILE_DATA:{const{fileData:n,index:o}=t.payload,{imgList:i}=e,l=[...i];return l[o]=__spreadValues(__spreadValues({},l[o]),n),__spreadProps(__spreadValues({},e),{imgList:l})}case Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE:{const{toolInstance:n}=e;return n==null||n.updateRotate(),e}case Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT:{const{toolInstance:n,imgIndex:o,imgList:i,step:l}=e;if(!n)return e;if(o===0||o>=i.length)return console.error("\u65E0\u6CD5\u590D\u5236\u8FB9\u754C\u5916\u7684\u5185\u5BB9"),e;const a=i[o-1].result;if(!a)return e;const u=AnnotationDataUtils.copyResultChange(a,l,(z=i[o].result)!=null?z:"");i[o]=__spreadProps(__spreadValues({},i[o]),{result:u});const A=index.jsonParser(u)[`step_${l}`],I=(A==null?void 0:A.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:o}=e,{toStep:i}=t.payload;if(!o)return e;const l=getStepConfig(n,i);return o==null||o.setToolName(l.tool,l.config),__spreadProps(__spreadValues({},e),{step:i,toolInstance:o==null?void 0:o.toolInstance})}case Actions.ANNOTATION_ACTIONS.SET_LOADING:{const{loading:n}=t.payload;return __spreadProps(__spreadValues({},e),{loading:!!n})}case Actions.ANNOTATION_ACTIONS.SET_POINT_CLOUD_LOADING:{const{pointCloudLoading:n}=t.payload;return __spreadProps(__spreadValues({},e),{pointCloudLoading:!!n})}default:return e}};exports.LoadFileAndFileData=LoadFileAndFileData,exports.annotationReducer=annotationReducer,exports.getStepConfig=getStepConfig,exports.getTotalPage=getTotalPage;
|
package/dist/types/App.d.ts
CHANGED
|
@@ -50,6 +50,13 @@ export interface AppProps {
|
|
|
50
50
|
defaultLang: 'en' | 'cn';
|
|
51
51
|
leftSider?: () => React.ReactNode | React.ReactNode;
|
|
52
52
|
skipBeforePageTurning?: (pageTurning: Function) => void;
|
|
53
|
+
drawLayerSlot?: (props: {
|
|
54
|
+
zoom: number;
|
|
55
|
+
currentPos: {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
};
|
|
59
|
+
}) => React.ReactNode;
|
|
53
60
|
dataInjectionAtCreation: (annotationData: any) => {};
|
|
54
61
|
renderEnhance: {
|
|
55
62
|
staticRender?: (canvas: HTMLCanvasElement, data: any, style: IAnnotationStyle) => void;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
export declare enum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
EnglishOnly = 2,
|
|
5
|
-
NumberOnly = 3,
|
|
6
|
-
CustomFormat = 4
|
|
1
|
+
export declare enum EScribblePattern {
|
|
2
|
+
Scribble = 1,
|
|
3
|
+
Erase = 2
|
|
7
4
|
}
|
|
8
|
-
/** 文本标注字数上限 */
|
|
9
|
-
export declare const TEXT_ATTRIBUTE_MAX_LENGTH = 1000;
|
|
10
5
|
export declare enum EToolName {
|
|
11
6
|
/** 拉框工具 */
|
|
12
7
|
Rect = "rectTool",
|
|
@@ -34,6 +29,8 @@ export declare enum EToolName {
|
|
|
34
29
|
FolderTag = "folderTagTool",
|
|
35
30
|
/** 拉框跟踪工具 */
|
|
36
31
|
RectTrack = "rectTrackTool",
|
|
32
|
+
/** 涂抹工具 */
|
|
33
|
+
ScribbleTool = "scribbleTool",
|
|
37
34
|
/** 人脸106工具 */
|
|
38
35
|
Face = "faceTool",
|
|
39
36
|
/** 客户端属性工具 */
|
|
@@ -43,3 +40,12 @@ export declare enum EToolName {
|
|
|
43
40
|
/** 算法分割辅助工具 */
|
|
44
41
|
SegmentByRect = "segmentByRectTool"
|
|
45
42
|
}
|
|
43
|
+
export declare enum ETextType {
|
|
44
|
+
AnyString = 0,
|
|
45
|
+
Order = 1,
|
|
46
|
+
EnglishOnly = 2,
|
|
47
|
+
NumberOnly = 3,
|
|
48
|
+
CustomFormat = 4
|
|
49
|
+
}
|
|
50
|
+
/** 文本标注字数上限 */
|
|
51
|
+
export declare const TEXT_ATTRIBUTE_MAX_LENGTH = 1000;
|
|
@@ -6,6 +6,9 @@ import { EPageTurningOperation } from '@/data/enums/AnnotationSize';
|
|
|
6
6
|
export declare function UpdateToolInstance(toolInstance: ToolInstance): AnnotationActionTypes;
|
|
7
7
|
export declare function UpdateImgList(imgList: IFileItem[]): AnnotationActionTypes;
|
|
8
8
|
export declare function UpdateAnnotationConfig(config: string): AnnotationActionTypes;
|
|
9
|
+
export declare function SetTaskStepList({ stepList }: {
|
|
10
|
+
stepList: IStepInfo[];
|
|
11
|
+
}): AnnotationActionTypes;
|
|
9
12
|
export declare function SetTaskConfig({ stepList, step, }: {
|
|
10
13
|
stepList: IStepInfo[];
|
|
11
14
|
step: number;
|
|
@@ -25,6 +28,11 @@ export declare function CopyBackWordResult(): AnnotationActionTypes;
|
|
|
25
28
|
* @param param0
|
|
26
29
|
*/
|
|
27
30
|
export declare function InitTaskData({ onSubmit, onSave, onPageChange, onStepChange, getFileData, pageSize, loadFileList, step, stepList, skipBeforePageTurning }: any): any;
|
|
31
|
+
/**
|
|
32
|
+
* 初始化任务数据
|
|
33
|
+
* @param param0
|
|
34
|
+
*/
|
|
35
|
+
export declare function UpdateInjectFunc({ onSubmit, onSave, onPageChange, onStepChange, getFileData, pageSize, loadFileList, stepList, }: any): any;
|
|
28
36
|
/** 切换到下一步 */
|
|
29
37
|
export declare const ToNextStep: (pageNumber?: number | undefined) => (dispatch: any, getState: any) => any[];
|
|
30
38
|
/**
|
|
@@ -3,11 +3,14 @@ import { AppState } from 'src/store';
|
|
|
3
3
|
import { ImgAttributeState } from 'src/store/imgAttribute/types';
|
|
4
4
|
import { AppProps } from '@/App';
|
|
5
5
|
import { AnnotationEngine } from '@labelbee/lb-annotation';
|
|
6
|
+
import { IStepInfo } from '@/types/step';
|
|
6
7
|
interface IProps extends AppState, AppProps {
|
|
7
8
|
imgAttribute: ImgAttributeState;
|
|
8
9
|
imgIndex: number;
|
|
9
10
|
annotationEngine: AnnotationEngine;
|
|
10
11
|
loading: boolean;
|
|
12
|
+
stepList: IStepInfo[];
|
|
13
|
+
step: number;
|
|
11
14
|
}
|
|
12
15
|
declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
|
|
13
16
|
children?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var index=require("../../../index.js"),es=require("antd/es"),_=require("lodash"),React=require("react"),reactRedux=require("react-redux"),FileError=require("../../../components/fileException/FileError.js"),useSize=require("../../../hooks/useSize.js"),actionCreators=require("../../../store/toolStyle/actionCreators.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),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,
|
|
1
|
+
"use strict";var index=require("../../../index.js"),es=require("antd/es"),_=require("lodash"),React=require("react"),reactRedux=require("react-redux"),FileError=require("../../../components/fileException/FileError.js"),useSize=require("../../../hooks/useSize.js"),actionCreators=require("../../../store/toolStyle/actionCreators.js"),lbAnnotation=require("@labelbee/lb-annotation"),lbUtils=require("@labelbee/lb-utils"),StepUtils=require("../../../utils/StepUtils.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ___default=_interopDefaultLegacy(_),React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,n,r)=>n in e?__defProp(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,__spreadValues=(e,n)=>{for(var r in n||(n={}))__hasOwnProp.call(n,r)&&__defNormalProp(e,r,n[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(n))__propIsEnum.call(n,r)&&__defNormalProp(e,r,n[r]);return e},__spreadProps=(e,n)=>__defProps(e,__getOwnPropDescs(n));const AnnotationOperation=e=>{const[,n]=React.useState(0),{imgAttribute:r,toolStyle:s,toolInstance:t,annotationEngine:o,imgList:f,imgIndex:y,dataInjectionAtCreation:d,renderEnhance:g,customRenderStyle:c,stepList:p,step:b,drawLayerSlot:v}=e,[E,m]=React.useState({zoom:1,currentPos:{x:0,y:0}}),S=React.useRef(null),I=React.useRef(null),l=useSize(S);React.useEffect(()=>{index.store.dispatch(actionCreators.InitToolStyleConfig())},[]),React.useEffect(()=>{if(!!o){switch(lbUtils.i18n.language){case"cn":case"en":o.setLang(lbUtils.i18n.language);break}o==null||o.setDataInjectionAtCreation(d),o==null||o.setRenderEnhance(g),c&&(o==null||o.setCustomRenderStyle(c))}},[o,d,g,c]),React.useEffect(()=>{const i=(a,P)=>{m({zoom:a,currentPos:P})},u=a=>{m(a)};return t&&(t.singleOn("messageError",a=>{es.message.error(a)}),t.singleOn("messageInfo",a=>{es.message.info(a)}),t.singleOn("changeAnnotationShow",()=>{n(a=>a+1)}),t.on("renderZoom",i),t.on("dragMove",u)),()=>{t&&(t.unbind("renderZoom",i),t.unbind("dragMove",u))}},[t]),React.useEffect(()=>{t&&t.setImgAttribute(r)},[r]),React.useEffect(()=>{t&&t.setStyle(s),o&&o.setStyle(s)},[s]),React.useEffect(()=>{(t==null?void 0:t.setSize)&&t.setSize(l),o&&o.setSize(l)},[l]),React.useEffect(()=>{const i=StepUtils.getCurrentStepInfo(b,p);t==null||t.setConfig(i.config)},[p]);const O=()=>{const i=f==null?void 0:f[y];!(i==null?void 0:i.url)||lbAnnotation.ImgUtils.load(i.url).then(u=>{o.setImgNode(u)})};return React__default.default.createElement("div",{ref:S,className:"annotationOperation"},React__default.default.createElement("div",{className:"canvas",ref:I,style:l,id:"toolContainer"},v==null?void 0:v(E)),(t==null?void 0:t.isImgError)===!0&&React__default.default.createElement(FileError,__spreadProps(__spreadValues({},l),{reloadImage:O,backgroundColor:"#e2e2e2",ignoreOffsetY:!0})))},mapStateToProps=e=>{const n=___default.default.pickBy(e.annotation,(r,s)=>["imgList","imgIndex","stepList","step","toolInstance","annotationEngine","loading"].includes(s));return __spreadValues({imgAttribute:e.imgAttribute,toolStyle:e.toolStyle},n)};var AnnotationOperation$1=reactRedux.connect(mapStateToProps)(AnnotationOperation);module.exports=AnnotationOperation$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),antd=require("antd"),index=require("../../../constant/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const AnnotationTips=({tips:e})=>e?React__default.default.createElement("div",{className:`${index.prefix}-tips`},React__default.default.createElement(
|
|
1
|
+
"use strict";var React=require("react"),antd=require("antd"),index=require("../../../constant/index.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const AnnotationTips=({tips:e})=>e?React__default.default.createElement("div",{className:`${index.prefix}-tips`},React__default.default.createElement(antd.Tooltip,{placement:"bottomRight",title:e},React__default.default.createElement("span",{className:`${index.prefix}-tips__path`},e))):null;module.exports=AnnotationTips;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var index=require("../../components/customResizeHook/index.js"),index$4=require("../../constant/index.js"),antd=require("antd"),es=require("antd/es"),React=require("react"),index$7=require("./annotationOperation/index.js"),index$6=require("./annotationTips/index.js"),index$3=require("./sidebar/index.js"),index$8=require("./toolFooter/index.js"),index$2=require("./toolHeader/index.js"),reducer=require("../../store/annotation/reducer.js"),index$5=require("../../components/videoAnnotate/index.js"),reactRedux=require("react-redux"),ToolUtils=require("../../utils/ToolUtils.js"),index$9=require("../../components/pointCloudView/index.js"),dom=require("../../utils/dom.js"),index$1=require("../../utils/index.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,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e};const{Sider,Content}=es.Layout,layoutCls=`${index$4.prefix}-layout`,ImageAnnotate=e=>{var t;return React__default.default.createElement(React__default.default.Fragment,null,e.showTips===!0&&React__default.default.createElement(index$6,{tips:e.path}),React__default.default.createElement(index$7,__spreadValues({},e)),React__default.default.createElement(index$8.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},PointCloudAnnotate=e=>{var t;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$9,null),React__default.default.createElement(index$8.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},AnnotatedArea=e=>{var t;const{stepList:a,step:r}=e,l=(t=reducer.getStepConfig(a,r))==null?void 0:t.tool,i=ToolUtils.isVideoTool(l),n=ToolUtils.isPointCloudTool(l);return i?React__default.default.createElement(index$5,__spreadValues({},e)):n?React__default.default.createElement(PointCloudAnnotate,__spreadValues({},e)):React__default.default.createElement(ImageAnnotate,__spreadValues({},e))},MainView=e=>{var t,a,r,l,i;const n=(a=(t=e.style)==null?void 0:t.sider)==null?void 0:a.width;return React__default.default.createElement(index.ViewportProvider,null,React__default.default.createElement(antd.Spin,{spinning:e.loading},React__default.default.createElement(es.Layout,{className:index$1.classnames([layoutCls,e.className]),style:(r=e.style)==null?void 0:r.layout},React__default.default.createElement("header",{className:`${layoutCls}__header`,style:(l=e.style)==null?void 0:l.header},React__default.default.createElement(index$2,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData})),React__default.default.createElement(es.Layout,{className:dom.getClassName("layout","container")},e==null?void 0:e.leftSider,React__default.default.createElement(Content,{className:`${layoutCls}__content`},React__default.default.createElement(AnnotatedArea,__spreadValues({},e))),React__default.default.createElement(Sider,{className:`${layoutCls}__side`,width:n||240,style:(i=e.style)==null?void 0:i.sider},React__default.default.createElement(index$3.default,{sider:e==null?void 0:e.sider}))))))},mapStateToProps=({annotation:e})=>{var t,a,r;const{imgList:l,loading:i}=e,n=(t=l[e.imgIndex])!=null?t:{};return{path:(r=(a=n==null?void 0:n.
|
|
1
|
+
"use strict";var index=require("../../components/customResizeHook/index.js"),index$4=require("../../constant/index.js"),antd=require("antd"),es=require("antd/es"),React=require("react"),index$7=require("./annotationOperation/index.js"),index$6=require("./annotationTips/index.js"),index$3=require("./sidebar/index.js"),index$8=require("./toolFooter/index.js"),index$2=require("./toolHeader/index.js"),reducer=require("../../store/annotation/reducer.js"),index$5=require("../../components/videoAnnotate/index.js"),reactRedux=require("react-redux"),ToolUtils=require("../../utils/ToolUtils.js"),index$9=require("../../components/pointCloudView/index.js"),dom=require("../../utils/dom.js"),index$1=require("../../utils/index.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,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e};const{Sider,Content}=es.Layout,layoutCls=`${index$4.prefix}-layout`,ImageAnnotate=e=>{var t;return React__default.default.createElement(React__default.default.Fragment,null,e.showTips===!0&&React__default.default.createElement(index$6,{tips:e.path}),React__default.default.createElement(index$7,__spreadValues({},e)),React__default.default.createElement(index$8.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},PointCloudAnnotate=e=>{var t;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$9,null),React__default.default.createElement(index$8.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},AnnotatedArea=e=>{var t;const{stepList:a,step:r}=e,l=(t=reducer.getStepConfig(a,r))==null?void 0:t.tool,i=ToolUtils.isVideoTool(l),n=ToolUtils.isPointCloudTool(l);return i?React__default.default.createElement(index$5,__spreadValues({},e)):n?React__default.default.createElement(PointCloudAnnotate,__spreadValues({},e)):React__default.default.createElement(ImageAnnotate,__spreadValues({},e))},MainView=e=>{var t,a,r,l,i;const n=(a=(t=e.style)==null?void 0:t.sider)==null?void 0:a.width;return React__default.default.createElement(index.ViewportProvider,null,React__default.default.createElement(antd.Spin,{spinning:e.loading},React__default.default.createElement(es.Layout,{className:index$1.classnames([layoutCls,e.className]),style:(r=e.style)==null?void 0:r.layout},React__default.default.createElement("header",{className:`${layoutCls}__header`,style:(l=e.style)==null?void 0:l.header},React__default.default.createElement(index$2,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData})),React__default.default.createElement(es.Layout,{className:dom.getClassName("layout","container")},e==null?void 0:e.leftSider,React__default.default.createElement(Content,{className:`${layoutCls}__content`},React__default.default.createElement(AnnotatedArea,__spreadValues({},e))),React__default.default.createElement(Sider,{className:`${layoutCls}__side`,width:n||240,style:(i=e.style)==null?void 0:i.sider},React__default.default.createElement(index$3.default,{sider:e==null?void 0:e.sider}))))))},mapStateToProps=({annotation:e})=>{var t,a,r;const{imgList:l,loading:i}=e,n=(t=l[e.imgIndex])!=null?t:{};return{path:(r=(a=n==null?void 0:n.path)!=null?a:n==null?void 0:n.url)!=null?r:"",loading:i}};var MainView$1=reactRedux.connect(mapStateToProps)(MainView);module.exports=MainView$1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var React=require("react"),antd=require("antd"),pen_a=require("../../../../assets/attributeIcon/pen_a.svg.js"),pen=require("../../../../assets/attributeIcon/pen.svg.js"),eraser_a=require("../../../../assets/attributeIcon/eraser_a.svg.js"),eraser=require("../../../../assets/attributeIcon/eraser.svg.js"),dom=require("../../../../utils/dom.js"),reactRedux=require("react-redux"),ToolType=require("../../../../data/enums/ToolType.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const ScribbleSidebar=e=>{const{onChange:i}=e,t=reactRedux.useSelector(a=>a.annotation.toolInstance),[c,r]=React.useState(20),[s,n]=React.useState(ToolType.EScribblePattern.Scribble),l=()=>{i(s,c)};return React__default.default.createElement("div",{className:dom.getClassName("scribble")},React__default.default.createElement("div",{className:dom.getClassName("scribble","select")},React__default.default.createElement("img",{src:s===ToolType.EScribblePattern.Scribble?pen_a:pen,onClick:()=>{r(20),n(ToolType.EScribblePattern.Scribble),t==null||t.setPattern(ToolType.EScribblePattern.Scribble),l()}}),React__default.default.createElement("img",{src:s===ToolType.EScribblePattern.Erase?eraser_a:eraser,onClick:()=>{r(20),n(ToolType.EScribblePattern.Erase),t==null||t.setPattern(ToolType.EScribblePattern.Erase),l()}})),React__default.default.createElement("div",{className:dom.getClassName("scribble","silder")},React__default.default.createElement("span",{className:dom.getClassName("scribble","circle")}),React__default.default.createElement(antd.Slider,{onChange:a=>{r(a),l(),t==null||t.setPenSize(a)},min:1,max:50,style:{width:"60%"},value:c}),React__default.default.createElement("span",{className:dom.getClassName("scribble","circle"),style:{width:"10px",height:"10px"}})))};module.exports=ScribbleSidebar;
|