@labelbee/lb-components 1.3.0 → 1.5.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/LICENSE +203 -0
- 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 +138 -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 +7 -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/annotationTips/index.d.ts +5 -0
- package/dist/types/views/MainView/index.d.ts +8 -2
- 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/annotationTips/index.js +1 -0
- 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/annotationTips/index.js +1 -0
- package/es/views/MainView/annotationTips/index.js.map +1 -0
- 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 +7 -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/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"),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.onVideoStopped()},this.onVideoStopped=()=>{this.setState({isPlay:!1}),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,isPlay:!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:d}=this.state,{imgList:l,imgIndex:n,pageBackward:u,pageJump:h,pageForward:c,valid:f}=this.props,{playPause:o,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:o,updateNextPlaybackRate:v,playbackRate:e,currentTime:t,duration:a,buffered:s,setCurrentTime:P,imgIndex:n,imgList:l,pageBackward:u,pageJump:h,pageForward:c}},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%",onClick:o}),React__default.default.createElement(index,{fileType:"video",errorProps:{reloadImage:this.reload,backgroundColor:"#e2e2e2",ignoreOffsetY:!0,isError:d},invalidProps:{isValid:f}})),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,l)=>{const t=l.find(a=>a.value===e),n=t.subSelected.find(a=>a.value===r);return{keyLabel:t.key,valueLabel:n.key}},tagsSortThruInputList=(e,r)=>e.sort((l,t)=>{const n=r.findIndex(s=>l===s.value),a=r.findIndex(s=>t===s.value);return n-a}),result2LabelKey=(e,r)=>{var l;try{return(l=e==null?void 0:e.reduce((t,n)=>(tagsSortThruInputList(Object.keys(n.result),r).forEach(a=>{var s;const u=(s=n.result[a])==null?void 0:s.split(";");findLabelFromValuesArray(u,a,r,t)}),t),[]))!=null?l:[]}catch(t){return[]}},findLabelFromValuesArray=(e,r,l,t)=>{e.forEach(n=>{const{keyLabel:a,valueLabel:s}=findTagLabel(r,n,l),u=t.find(o=>o.keyLabel===a);u?u.valuesLabelArray.push(s):t.push({keyLabel:a,valuesLabelArray:[s]})})},getKeyCodeNumber=e=>e<=57&&e>=49?e-48:e<=105&&e>=97?e-96:0,decimalReserved=(e,r)=>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;
|
|
@@ -460,6 +461,22 @@
|
|
|
460
461
|
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%, black 80%, black 100%);
|
|
461
462
|
}
|
|
462
463
|
|
|
464
|
+
.bee-tips {
|
|
465
|
+
display: flex;
|
|
466
|
+
justify-content: flex-end;
|
|
467
|
+
background-color: #333;
|
|
468
|
+
color: rgba(255, 255, 255, 0.4);
|
|
469
|
+
line-height: 40px;
|
|
470
|
+
opacity: 0.8;
|
|
471
|
+
height: 40px;
|
|
472
|
+
padding: 0 30px;
|
|
473
|
+
width: 100%;
|
|
474
|
+
text-overflow: ellipsis;
|
|
475
|
+
overflow: hidden;
|
|
476
|
+
white-space: nowrap;
|
|
477
|
+
cursor: text;
|
|
478
|
+
}
|
|
479
|
+
|
|
463
480
|
.annotationOperation {
|
|
464
481
|
position: relative;
|
|
465
482
|
flex: 1;
|
|
@@ -993,4 +1010,125 @@
|
|
|
993
1010
|
color: #cccccc;
|
|
994
1011
|
}
|
|
995
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
|
+
|
|
996
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,q,G;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]=(c=u==null?void 0:u.exportData())!=null?c:[],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]],(a=t.payload)==null?void 0:a.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]=(A=r==null?void 0:r.exportData())!=null?A:[];let O=l;if((u==null?void 0:u.length)>0){const T=(N=u[s])==null?void 0:N.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=(p=T[I])==null?void 0:p.id,v=index.jsonParser((d=i[r])==null?void 0:d.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=(L=v[`step_${m}`])==null?void 0:L.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((b=n[O])==null?void 0:b.result),E=f[`step_${s}`],m=!E,P={rotate:(h=f.rotate)!=null?h:0,valid:(U=f.valid)!=null?U:!0};T&&g!==!0&&(r==null||r.setImgNode(T,P));const D=getStepConfig(u,s),{dataSourceStep:S,tool:R}=D,z=getStepConfig(u,S),V=S&&R,C=(j=(F=f[`step_${S}`])==null?void 0:F.result)!=null?j:[],y=AnnotationDataUtils.getInitialResultList(E==null?void 0:E.result,i,D,C,m);if(r==null||r.launchOperation(),V&&((C==null?void 0:C.length)>0?r==null||r.setBasicInfo(z.tool,C[v]):(r==null||r.setBasicInfo(z.tool),r==null||r.forbidOperation(),es.message.info(lbUtils.i18n.t("NoDependency")))),l.tool!=="check"){const H=(x=(w=C[v])==null?void 0:w.id)!=null?x:"",M=V?y.filter($=>lbAnnotation.CommonToolUtils.isSameSourceID($.sourceID,H)):y;i==null||i.setResult(M),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:(B=t.payload.config)!=null?B:"{}"});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=(q=t.payload)==null?void 0:q.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,(G=i[s].result)!=null?G:"");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;
|