@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.
Files changed (156) hide show
  1. package/LICENSE +203 -0
  2. package/dist/App.js +1 -1
  3. package/dist/assets/annotation/toolHotKeyIcon/icon_back_kj.svg.js +1 -0
  4. package/dist/assets/annotation/toolHotKeyIcon/icon_forward_kj.svg.js +1 -0
  5. package/dist/assets/annotation/toolHotKeyIcon/icon_playPause.svg.js +1 -0
  6. package/dist/assets/annotation/toolHotKeyIcon/icon_polygonMerge_kj.svg.js +1 -0
  7. package/dist/assets/annotation/toolHotKeyIcon/icon_segment.svg.js +1 -0
  8. package/dist/assets/annotation/toolHotKeyIcon/icon_speed_kj.svg.js +1 -0
  9. package/dist/assets/annotation/video/icon_keyboard_h.svg.js +1 -0
  10. package/dist/components/fileException/FileError.js +1 -0
  11. package/dist/components/fileException/FileInvalid.js +1 -0
  12. package/dist/components/fileException/index.js +1 -0
  13. package/dist/components/videoAnnotate/index.js +1 -0
  14. package/dist/components/videoPlayer/TagToolInstanceAdaptor.js +1 -0
  15. package/dist/components/videoPlayer/TagToolInstanceAdaptorI18nProvider.js +1 -0
  16. package/dist/components/videoPlayer/VideoTagLayer.js +1 -0
  17. package/dist/components/videoPlayer/components/controller/index.js +1 -0
  18. package/dist/components/videoPlayer/index.js +1 -0
  19. package/dist/components/videoPlayer/utils.js +1 -0
  20. package/dist/index.css +138 -0
  21. package/dist/index.css.map +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/store/Actions.js +1 -1
  24. package/dist/store/annotation/actionCreators.js +1 -1
  25. package/dist/store/annotation/reducer.js +1 -1
  26. package/dist/types/App.d.ts +7 -2
  27. package/dist/types/components/{ImageError/index.d.ts → fileException/FileError.d.ts} +5 -4
  28. package/dist/types/components/fileException/FileInvalid.d.ts +12 -0
  29. package/dist/types/components/fileException/index.d.ts +17 -0
  30. package/dist/types/components/videoAnnotate/index.d.ts +15 -0
  31. package/dist/types/components/videoPlayer/TagToolInstanceAdaptor.d.ts +90 -0
  32. package/dist/types/components/videoPlayer/TagToolInstanceAdaptorI18nProvider.d.ts +8 -0
  33. package/dist/types/components/videoPlayer/VideoTagLayer.d.ts +12 -0
  34. package/dist/types/components/videoPlayer/components/controller/index.d.ts +2 -0
  35. package/dist/types/components/videoPlayer/index.d.ts +73 -0
  36. package/dist/types/components/videoPlayer/types.d.ts +8 -0
  37. package/dist/types/components/videoPlayer/utils.d.ts +36 -0
  38. package/dist/types/index.d.ts +2 -1
  39. package/dist/types/store/Actions.d.ts +5 -0
  40. package/dist/types/store/annotation/actionCreators.d.ts +20 -8
  41. package/dist/types/store/annotation/reducer.d.ts +1 -1
  42. package/dist/types/store/annotation/types.d.ts +30 -2
  43. package/dist/types/utils/PageOperator.d.ts +1 -1
  44. package/dist/types/utils/StepUtils.d.ts +7 -0
  45. package/dist/types/utils/TextUtils.d.ts +1 -1
  46. package/dist/types/utils/dom.d.ts +6 -0
  47. package/dist/types/views/MainView/annotationTips/index.d.ts +5 -0
  48. package/dist/types/views/MainView/index.d.ts +8 -2
  49. package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.d.ts +23 -0
  50. package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/index.d.ts +2 -7
  51. package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/polygon/index.d.ts +7 -1
  52. package/dist/types/views/MainView/toolFooter/FooterTips/ToolHotKey/videoTag/index.d.ts +3 -0
  53. package/dist/types/views/MainView/toolFooter/Pagination.d.ts +12 -0
  54. package/dist/utils/StepUtils.js +1 -1
  55. package/dist/utils/TextUtils.js +1 -1
  56. package/dist/utils/dom.js +1 -1
  57. package/dist/views/MainView/annotationOperation/index.js +1 -1
  58. package/dist/views/MainView/annotationTips/index.js +1 -0
  59. package/dist/views/MainView/index.js +1 -1
  60. package/dist/views/MainView/sidebar/GeneralOperation/index.js +1 -1
  61. package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
  62. package/dist/views/MainView/sidebar/index.js +1 -1
  63. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js +1 -1
  64. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  65. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/polygon/index.js +1 -1
  66. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/videoTag/index.js +1 -0
  67. package/dist/views/MainView/toolFooter/FooterTips/index.js +1 -1
  68. package/dist/views/MainView/toolFooter/Pagination.js +1 -0
  69. package/dist/views/MainView/toolFooter/index.js +1 -1
  70. package/dist/views/MainView/toolHeader/headerOption/index.js +1 -1
  71. package/dist/views/MainView/toolHeader/index.js +1 -1
  72. package/es/App.js +1 -1
  73. package/es/App.js.map +1 -1
  74. package/es/assets/annotation/toolHotKeyIcon/icon_back_kj.svg.js +1 -0
  75. package/es/assets/annotation/toolHotKeyIcon/icon_back_kj.svg.js.map +1 -0
  76. package/es/assets/annotation/toolHotKeyIcon/icon_forward_kj.svg.js +1 -0
  77. package/es/assets/annotation/toolHotKeyIcon/icon_forward_kj.svg.js.map +1 -0
  78. package/es/assets/annotation/toolHotKeyIcon/icon_playPause.svg.js +1 -0
  79. package/es/assets/annotation/toolHotKeyIcon/icon_playPause.svg.js.map +1 -0
  80. package/es/assets/annotation/toolHotKeyIcon/icon_polygonMerge_kj.svg.js +1 -0
  81. package/es/assets/annotation/toolHotKeyIcon/icon_polygonMerge_kj.svg.js.map +1 -0
  82. package/es/assets/annotation/toolHotKeyIcon/icon_segment.svg.js +1 -0
  83. package/es/assets/annotation/toolHotKeyIcon/icon_segment.svg.js.map +1 -0
  84. package/es/assets/annotation/toolHotKeyIcon/icon_speed_kj.svg.js +1 -0
  85. package/es/assets/annotation/toolHotKeyIcon/icon_speed_kj.svg.js.map +1 -0
  86. package/es/assets/annotation/video/icon_keyboard_h.svg.js +1 -0
  87. package/es/assets/annotation/video/icon_keyboard_h.svg.js.map +1 -0
  88. package/es/components/ImageError/index.js +53 -1
  89. package/es/components/fileException/FileError.js +1 -0
  90. package/es/components/fileException/FileError.js.map +1 -0
  91. package/es/components/fileException/FileInvalid.js +1 -0
  92. package/es/components/fileException/FileInvalid.js.map +1 -0
  93. package/es/components/fileException/index.js +1 -0
  94. package/es/components/fileException/index.js.map +1 -0
  95. package/es/components/videoAnnotate/index.js +1 -0
  96. package/es/components/videoAnnotate/index.js.map +1 -0
  97. package/es/components/videoPlayer/TagToolInstanceAdaptor.js +1 -0
  98. package/es/components/videoPlayer/TagToolInstanceAdaptor.js.map +1 -0
  99. package/es/components/videoPlayer/TagToolInstanceAdaptorI18nProvider.js +1 -0
  100. package/es/components/videoPlayer/TagToolInstanceAdaptorI18nProvider.js.map +1 -0
  101. package/es/components/videoPlayer/VideoTagLayer.js +1 -0
  102. package/es/components/videoPlayer/VideoTagLayer.js.map +1 -0
  103. package/es/components/videoPlayer/components/controller/index.js +1 -0
  104. package/es/components/videoPlayer/components/controller/index.js.map +1 -0
  105. package/es/components/videoPlayer/index.js +1 -0
  106. package/es/components/videoPlayer/index.js.map +1 -0
  107. package/es/components/videoPlayer/utils.js +1 -0
  108. package/es/components/videoPlayer/utils.js.map +1 -0
  109. package/es/index.js +1 -1
  110. package/es/index.js.map +1 -1
  111. package/es/store/Actions.js +1 -1
  112. package/es/store/Actions.js.map +1 -1
  113. package/es/store/annotation/actionCreators.js +1 -1
  114. package/es/store/annotation/actionCreators.js.map +1 -1
  115. package/es/store/annotation/reducer.js +1 -1
  116. package/es/store/annotation/reducer.js.map +1 -1
  117. package/es/utils/StepUtils.js +1 -1
  118. package/es/utils/StepUtils.js.map +1 -1
  119. package/es/utils/TextUtils.js +1 -1
  120. package/es/utils/TextUtils.js.map +1 -1
  121. package/es/utils/dom.js +1 -1
  122. package/es/utils/dom.js.map +1 -1
  123. package/es/views/MainView/annotationOperation/index.js +1 -1
  124. package/es/views/MainView/annotationOperation/index.js.map +1 -1
  125. package/es/views/MainView/annotationTips/index.js +1 -0
  126. package/es/views/MainView/annotationTips/index.js.map +1 -0
  127. package/es/views/MainView/index.js +1 -1
  128. package/es/views/MainView/index.js.map +1 -1
  129. package/es/views/MainView/sidebar/GeneralOperation/index.js +1 -1
  130. package/es/views/MainView/sidebar/GeneralOperation/index.js.map +1 -1
  131. package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
  132. package/es/views/MainView/sidebar/TagSidebar/index.js.map +1 -1
  133. package/es/views/MainView/sidebar/index.js +1 -1
  134. package/es/views/MainView/sidebar/index.js.map +1 -1
  135. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js +1 -1
  136. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/common/index.js.map +1 -1
  137. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js +1 -1
  138. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/index.js.map +1 -1
  139. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/polygon/index.js +1 -1
  140. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/polygon/index.js.map +1 -1
  141. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/videoTag/index.js +1 -0
  142. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/videoTag/index.js.map +1 -0
  143. package/es/views/MainView/toolFooter/FooterTips/index.js +1 -1
  144. package/es/views/MainView/toolFooter/FooterTips/index.js.map +1 -1
  145. package/es/views/MainView/toolFooter/Pagination.js +1 -0
  146. package/es/views/MainView/toolFooter/Pagination.js.map +1 -0
  147. package/es/views/MainView/toolFooter/index.js +1 -1
  148. package/es/views/MainView/toolFooter/index.js.map +1 -1
  149. package/es/views/MainView/toolHeader/headerOption/index.js +1 -1
  150. package/es/views/MainView/toolHeader/headerOption/index.js.map +1 -1
  151. package/es/views/MainView/toolHeader/index.js +1 -1
  152. package/es/views/MainView/toolHeader/index.js.map +1 -1
  153. package/package.json +7 -5
  154. package/dist/components/ImageError/index.js +0 -1
  155. package/es/assets/annotation/polygonTool/icon_rectangle_a.svg.js +0 -1
  156. package/es/assets/annotation/polygonTool/icon_rectangle_a.svg.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ToolInstance } from './store/annotation/types';
3
- import { GetFileData, OnSave, OnSubmit, IFileItem } from './types/data';
3
+ import { GetFileData, OnSave, OnSubmit, IFileItem, OnPageChange, OnStepChange, LoadFileList } from './types/data';
4
4
  import { Footer, Header, Sider } from './types/main';
5
5
  import { IStepInfo } from './types/step';
6
6
  interface IAnnotationStyle {
@@ -12,13 +12,17 @@ interface IAnnotationStyle {
12
12
  export interface AppProps {
13
13
  exportData?: (data: any[]) => void;
14
14
  goBack?: () => void;
15
- imgList: IFileItem[];
15
+ imgList?: IFileItem[];
16
16
  config: string;
17
17
  stepList: IStepInfo[];
18
18
  step: number;
19
19
  onSubmit?: OnSubmit;
20
20
  onSave?: OnSave;
21
+ onPageChange?: OnPageChange;
22
+ onStepChange?: OnStepChange;
21
23
  getFileData?: GetFileData;
24
+ pageSize: number;
25
+ loadFileList?: LoadFileList;
22
26
  headerName?: string;
23
27
  initialIndex?: number;
24
28
  className?: string;
@@ -42,6 +46,7 @@ export interface AppProps {
42
46
  };
43
47
  setToolInstance?: (tool: ToolInstance) => void;
44
48
  mode?: 'light' | 'dark';
49
+ showTips?: boolean;
45
50
  defaultLang: 'en' | 'cn';
46
51
  leftSider?: () => React.ReactNode | React.ReactNode;
47
52
  dataInjectionAtCreation: (annotationData: any) => {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- interface IProps {
2
+ export interface IFileErrorProps {
3
3
  width?: number;
4
4
  height?: number;
5
5
  reloadImage: () => void;
@@ -8,7 +8,8 @@ interface IProps {
8
8
  ignoreOffsetY?: boolean;
9
9
  layerStyle?: React.CSSProperties;
10
10
  backgroundColor: string;
11
- fileTypeName?: string;
11
+ fileType?: string;
12
+ isError?: boolean;
12
13
  }
13
- declare const ImageError: (props: IProps) => JSX.Element;
14
- export default ImageError;
14
+ declare const FileError: (props: IFileErrorProps) => JSX.Element;
15
+ export default FileError;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author Glenfiddish <edwinlee0927@hotmail.com>
3
+ * @file File invalid layer, display while isValid equal false
4
+ * @date 2022-06-07
5
+ */
6
+ import React from 'react';
7
+ export interface IFileInvalidProps {
8
+ fileType?: string;
9
+ isValid: boolean;
10
+ }
11
+ declare const FileInvalid: React.FC<IFileInvalidProps>;
12
+ export default FileInvalid;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @author Glenfiddish <edwinlee0927@hotmail.com>
3
+ * @file File exception layer, determine whether to render FileInvalid or FileError
4
+ * @date 2022-06-07
5
+ */
6
+ import React from 'react';
7
+ import { IFileErrorProps } from './FileError';
8
+ import { IFileInvalidProps } from './FileInvalid';
9
+ interface IFileExceptionProps {
10
+ errorProps: IFileErrorProps & {
11
+ isError: boolean;
12
+ };
13
+ invalidProps: IFileInvalidProps;
14
+ fileType: string;
15
+ }
16
+ declare const FileException: React.FC<IFileExceptionProps>;
17
+ export default FileException;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @author Glenfiddish <edwinlee0927@hotmail.com>
3
+ * @file connect store & TagToolInstanceAdaptor
4
+ * @date 2022-06-02
5
+ */
6
+ import React from 'react';
7
+ import { AnnotationState } from '@/store/annotation/types';
8
+ declare const _default: import("react-redux").ConnectedComponent<React.FC<{
9
+ annotation: AnnotationState;
10
+ }>, import("react-redux").Omit<{
11
+ annotation: AnnotationState;
12
+ } & {
13
+ children?: React.ReactNode;
14
+ }, "annotation">>;
15
+ export default _default;
@@ -0,0 +1,90 @@
1
+ /**
2
+ * @file Implement TagTool interaction through class components.
3
+ * Refer to: packages/lb-annotation/src/core/toolOperation/tagOperation.ts
4
+ * @author Glenfiddish <edwinlee0927@hotmail.com>
5
+ * @date 2022-05-31
6
+ */
7
+ import React from 'react';
8
+ import { IStepInfo } from '@/types/step';
9
+ import _ from 'lodash';
10
+ import type { ObjectString } from './types';
11
+ import { IFileItem } from '@/types/data';
12
+ export interface IVideoTagInstanceAdaptorProps {
13
+ imgIndex: number;
14
+ imgList: IFileItem[];
15
+ pageForward: () => void;
16
+ pageJump: (page: string) => void;
17
+ pageBackward: () => void;
18
+ onMounted: (instance: TagToolInstanceAdaptor) => void;
19
+ onUnmounted: () => void;
20
+ step: number;
21
+ stepList: IStepInfo[];
22
+ }
23
+ interface IVideoTagInstanceAdaptorState {
24
+ tagResult: any[];
25
+ labelSelectedList: number[];
26
+ valid: boolean;
27
+ }
28
+ export declare class TagToolInstanceAdaptor extends React.Component<IVideoTagInstanceAdaptorProps, IVideoTagInstanceAdaptorState> {
29
+ fns: {
30
+ [key: string]: () => void;
31
+ };
32
+ videoRef?: HTMLVideoElement;
33
+ labelSelectedList: number[];
34
+ constructor(props: IVideoTagInstanceAdaptorProps);
35
+ get config(): any;
36
+ /** Just implementation, no actual logic */
37
+ get history(): {
38
+ initRecord: () => void;
39
+ pushHistory: () => void;
40
+ };
41
+ get currentTagResult(): any;
42
+ get valid(): boolean;
43
+ clearResult: (sendMsg?: boolean, value?: string) => void;
44
+ exportData: () => (any[] | {
45
+ valid: boolean;
46
+ duration: number;
47
+ frames: number | undefined;
48
+ videoWidth: number;
49
+ videoHeight: number;
50
+ })[];
51
+ singleOn(event: string, func: () => void): void;
52
+ on(event: string, func: () => void): void;
53
+ getTagResultByCode(num1: number, num2?: number): {
54
+ value: {
55
+ key: any;
56
+ value: any;
57
+ };
58
+ isMulti: any;
59
+ } | undefined;
60
+ setLabelBySelectedList(num1: number, num2?: number): void;
61
+ emitEvent: (event: string) => void;
62
+ /**
63
+ * Combine result with inputValue and existValue
64
+ * @param inputValue
65
+ * @param existValue
66
+ * @returns newValue
67
+ */
68
+ combineResult: (inputValue: {
69
+ value: {
70
+ key: string;
71
+ value: string;
72
+ };
73
+ isMulti: boolean;
74
+ }, existValue?: ObjectString) => _.Dictionary<string | undefined>;
75
+ setResult: (tagResult: any[]) => void;
76
+ setLabel: (num1: number, num2: number) => void;
77
+ /**
78
+ * Keydown event for recording keycode input(numeric only)
79
+ * @param event
80
+ */
81
+ keydown: (event: KeyboardEvent) => void;
82
+ setValid: (valid: boolean) => void;
83
+ componentDidMount(): void;
84
+ componentWillUnmount(): void;
85
+ setResultFromImgList: (props: IVideoTagInstanceAdaptorProps) => void;
86
+ /** Observer imgIndex and set tagResult */
87
+ shouldComponentUpdate(props: IVideoTagInstanceAdaptorProps): boolean;
88
+ render(): JSX.Element;
89
+ }
90
+ export {};
@@ -0,0 +1,8 @@
1
+ import { IVideoTagInstanceAdaptorProps } from './TagToolInstanceAdaptor';
2
+ /**
3
+ * I18n provider for InstanceAdaptorI18nProvider
4
+ * @param props
5
+ */
6
+ export declare const VideoTagTool: (props: IVideoTagInstanceAdaptorProps & {
7
+ lang?: string;
8
+ }) => JSX.Element;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { IInputList } from '@/types/main';
3
+ interface IVideoTagLayerProps {
4
+ result: Array<{
5
+ result: {
6
+ [key: string]: string;
7
+ };
8
+ }>;
9
+ inputList: IInputList[];
10
+ }
11
+ export declare const VideoTagLayer: React.FC<IVideoTagLayerProps>;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const VideoController: () => JSX.Element;
2
+ export default VideoController;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @author Glenfiddish <edwinlee0927@hotmail.com>
3
+ * @file Implement video player, including mouse and keyboard event
4
+ * @date 2022-06-02
5
+ */
6
+ import React from 'react';
7
+ import { IFileItem } from '@/types/data';
8
+ export declare const VideoPlayerCtx: React.Context<{
9
+ videoRef?: React.RefObject<HTMLVideoElement> | null | undefined;
10
+ isPlay: boolean;
11
+ playPause: () => void;
12
+ updateNextPlaybackRate: (isForward?: boolean) => void;
13
+ setCurrentTime: (time: number) => void;
14
+ playbackRate: number;
15
+ currentTime: number;
16
+ duration: number;
17
+ buffered: number;
18
+ imgList: IFileItem[];
19
+ imgIndex: number;
20
+ pageBackward: () => void;
21
+ pageJump: (page: string) => void;
22
+ pageForward: () => void;
23
+ }>;
24
+ interface IVideoPlayerProps {
25
+ imgList: IFileItem[];
26
+ imgIndex: number;
27
+ pageBackward: () => void;
28
+ pageJump: (page: string) => void;
29
+ pageForward: () => void;
30
+ valid: boolean;
31
+ setVideoRef?: (video: HTMLVideoElement) => void;
32
+ }
33
+ interface IVideoPlayerState {
34
+ playbackRate: number;
35
+ currentTime: number;
36
+ isPlay: boolean;
37
+ duration: number;
38
+ buffered: number;
39
+ error: boolean;
40
+ }
41
+ export declare class VideoPlayer extends React.Component<IVideoPlayerProps, IVideoPlayerState> {
42
+ videoRef?: React.RefObject<HTMLVideoElement>;
43
+ timeInterval?: number;
44
+ constructor(props: IVideoPlayerProps);
45
+ get videoElm(): HTMLVideoElement | null | undefined;
46
+ get videoSrc(): string;
47
+ changePlaybackPate: (playbackRate: number) => void;
48
+ playPause: () => void;
49
+ updateNextPlaybackRate: (isForward?: boolean) => void;
50
+ fastForward: () => void;
51
+ rewind: () => void;
52
+ /**
53
+ * Implement Video's keydown
54
+ * Play / Pause - Space
55
+ * Rewind / FastForward - ⬅️ / ➡️
56
+ * Speed - ⬆️ / ⬇
57
+ * @param event
58
+ */
59
+ keydown: (event: KeyboardEvent) => void;
60
+ onPlay: () => void;
61
+ onPause: () => void;
62
+ onVideoStopped: () => void;
63
+ onVideoStart: () => void;
64
+ resetVideoData: () => void;
65
+ setDuration: () => void;
66
+ setCurrentTime: (currentTime: number) => void;
67
+ reload: () => void;
68
+ onError: () => void;
69
+ componentDidMount(): void;
70
+ componentWillUnmount(): void;
71
+ render(): JSX.Element;
72
+ }
73
+ export default VideoPlayer;
@@ -0,0 +1,8 @@
1
+ export interface ITagLabelItem {
2
+ keyLabel: string;
3
+ valuesLabelArray: string[];
4
+ }
5
+ export declare type ITagLabelsArray = ITagLabelItem[];
6
+ export interface ObjectString {
7
+ [key: string]: string | undefined;
8
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Find key and value to display label through inputList
3
+ * @param key
4
+ * @param value
5
+ * @param inputList
6
+ */
7
+ export declare const findTagLabel: (key: string, value: string, inputList: any[]) => {
8
+ keyLabel: any;
9
+ valueLabel: any;
10
+ };
11
+ /**
12
+ * Sort tags through inputList
13
+ * @param tagsKeys
14
+ * @param inputList
15
+ */
16
+ export declare const tagsSortThruInputList: (tagsKeys: string[], inputList: any[]) => string[];
17
+ /**
18
+ * Convent result's array to array of showing the labels
19
+ * @param result
20
+ * @param inputList
21
+ * @returns {ITagLabelsArray}
22
+ */
23
+ export declare const result2LabelKey: (result: any[], inputList: any[]) => any;
24
+ /**
25
+ * Get key number through keyCode, Such as 49(keycode) => 1(number)
26
+ * @param {Number} keyCode
27
+ * @returns {Number} keyCode in scope if it greater than 0
28
+ */
29
+ export declare const getKeyCodeNumber: (keyCode: number) => number;
30
+ /**
31
+ * Preserve decimals for number
32
+ * @param num
33
+ * @param places
34
+ * @returns {Number}
35
+ */
36
+ export declare const decimalReserved: (num: number, places?: number) => number;
@@ -2,9 +2,10 @@ import { AppProps } from '@/App';
2
2
  import AnnotationView from '@/components/AnnotationView';
3
3
  import { i18n } from '@labelbee/lb-utils';
4
4
  import React from 'react';
5
+ import { VideoTagTool } from '@/components/videoPlayer/TagToolInstanceAdaptorI18nProvider';
5
6
  export declare const store: import("redux").Store<{}, import("redux").Action<any>> & {
6
7
  dispatch: unknown;
7
8
  };
8
9
  declare const _default: React.ForwardRefExoticComponent<AppProps & React.RefAttributes<unknown>>;
9
10
  export default _default;
10
- export { AnnotationView, i18n };
11
+ export { AnnotationView, i18n, VideoTagTool };
@@ -6,10 +6,15 @@ export declare const ANNOTATION_ACTIONS: {
6
6
  SUBMIT_FILE_DATA: string;
7
7
  SET_TASK_CONFIG: string;
8
8
  INIT_TOOL: string;
9
+ SET_TOOL: string;
9
10
  UPDATE_ON_SUBMIT: string;
10
11
  UPDATE_ON_SAVE: string;
12
+ UPDATE_ON_PAGE_CHANGE: string;
13
+ UPDATE_ON_STEP_CHANGE: string;
11
14
  UPDATE_ROTATE: string;
12
15
  UPDATE_GET_FILE_DATA: string;
16
+ UPDATE_PAGE_SIZE: string;
17
+ UPDATE_LOAD_FILE_LIST: string;
13
18
  GET_FILE_DATA: string;
14
19
  SET_FILE_DATA: string;
15
20
  COPY_BACKWARD_RESULT: string;
@@ -1,5 +1,5 @@
1
1
  import { IStepInfo } from '@/types/step';
2
- import { GetFileData, IFileItem, OnSave, OnSubmit } from '@/types/data';
2
+ import { GetFileData, LoadFileList, IFileItem, OnPageChange, OnSave, OnStepChange, OnSubmit } from '@/types/data';
3
3
  import { AnnotationActionTypes, ToolInstance } from './types';
4
4
  import { ESubmitType } from '@/constant';
5
5
  import { EPageTurningOperation } from '@/data/enums/AnnotationSize';
@@ -12,35 +12,47 @@ export declare function SetTaskConfig({ stepList, step, }: {
12
12
  }): AnnotationActionTypes;
13
13
  export declare function UpdateOnSubmit(onSubmit: OnSubmit): AnnotationActionTypes;
14
14
  export declare function UpdateOnSave(onSave: OnSave): AnnotationActionTypes;
15
+ export declare function UpdateOnPageChange(onPageChange: OnPageChange): AnnotationActionTypes;
16
+ export declare function UpdateOnStepChange(onStepChange: OnStepChange): AnnotationActionTypes;
15
17
  export declare function UpdateGetFileData(getFileData: GetFileData): AnnotationActionTypes;
18
+ export declare function UpdatePageSize(pageSize: number): AnnotationActionTypes;
19
+ export declare function UpdateGetFileList(loadFileList: LoadFileList): AnnotationActionTypes;
16
20
  export declare function UpdateRotate(): AnnotationActionTypes;
17
21
  export declare function CopyBackWordResult(): AnnotationActionTypes;
18
22
  /**
19
23
  * 初始化任务数据
20
24
  * @param param0
21
25
  */
22
- export declare function InitTaskData({ onSubmit, onSave, getFileData, imgList, step, stepList, initialIndex, }: any): any;
26
+ export declare function InitTaskData({ onSubmit, onSave, onPageChange, onStepChange, getFileData, pageSize, loadFileList, step, stepList, }: any): any;
23
27
  /** 切换到下一步 */
24
- export declare const ToNextStep: (pageNumber?: number | undefined) => (dispatch: any, getState: any) => any[];
28
+ export declare const ToNextStep: (pageNumber?: number) => (dispatch: any, getState: any) => any[];
25
29
  /**
26
30
  * 更新当前操作的步骤
27
31
  * @param {number} toStep
28
32
  */
29
- export declare const UpdateProcessingStep: (toStep: number, index?: number | undefined) => (dispatch: any, state: any) => any[];
33
+ export declare const UpdateProcessingStep: (toStep: number, index?: number) => (dispatch: any, getState: any) => any[];
30
34
  /**
31
35
  * 提交当前的文件数据
32
36
  * @param submitType
33
37
  */
34
38
  export declare const ToSubmitFileData: (submitType: ESubmitType) => (dispatch: any) => any[];
35
39
  /** 向前翻页 */
36
- export declare const PageBackward: (triggerEventAfterIndexChanged?: boolean) => (dispatch: any, getState: any) => any;
40
+ export declare const PageBackward: (triggerEventAfterIndexChanged?: boolean) => (dispatch: any, getState: any) => Promise<any>;
37
41
  /** 向后翻页 */
38
- export declare const PageForward: (triggerEventAfterIndexChanged?: boolean) => (dispatch: any, getState: any) => any;
42
+ export declare const PageForward: (triggerEventAfterIndexChanged?: boolean) => (dispatch: any, getState: any) => Promise<any>;
39
43
  /**
40
44
  * 跳到指定文件索引
41
45
  * @param toIndex
42
46
  */
43
- export declare const PageJump: (toIndex: number, triggerEventAfterIndexChanged?: boolean) => (dispatch: any, getState: any) => any;
47
+ export declare const PageJump: (toIndex: number, triggerEventAfterIndexChanged?: boolean) => (dispatch: any, getState: any) => Promise<any> | undefined;
48
+ /**
49
+ * 加载文件列表
50
+ * @param dispatch
51
+ * @param getState
52
+ * @param nextIndex 需要加载的图片index
53
+ * @param isInitial // 是否为初始化加载
54
+ */
55
+ export declare const loadImgList: (dispatch: any, getState: any, nextIndex: number, isInitial?: boolean) => Promise<true | undefined>;
44
56
  /**
45
57
  * 判断翻页还是切换依赖数据
46
58
  * @param dispatch
@@ -48,7 +60,7 @@ export declare const PageJump: (toIndex: number, triggerEventAfterIndexChanged?:
48
60
  * @param pageTurningOperation
49
61
  * @param toIndex
50
62
  */
51
- export declare const DispatcherTurning: (dispatch: any, getState: any, pageTurningOperation: EPageTurningOperation, triggerEventAfterIndexChanged?: boolean, toIndex?: number | undefined) => any;
63
+ export declare const DispatcherTurning: (dispatch: any, getState: any, pageTurningOperation: EPageTurningOperation, triggerEventAfterIndexChanged?: boolean, toIndex?: number) => Promise<any>;
52
64
  /**
53
65
  * 保存当前页数据
54
66
  * */
@@ -10,5 +10,5 @@ export declare const getTotalPage: (state: AnnotationState) => number;
10
10
  * @param nextIndex
11
11
  * @param nextBasicIndex
12
12
  */
13
- export declare const LoadImageAndFileData: (nextIndex: number, nextBasicIndex?: number | undefined) => (dispatch: any, getState: any) => Promise<void>;
13
+ export declare const LoadFileAndFileData: (nextIndex: number, nextBasicIndex?: number) => any;
14
14
  export declare const annotationReducer: (state: AnnotationState | undefined, action: AnnotationActionTypes) => AnnotationState;
@@ -1,7 +1,7 @@
1
1
  import { AnnotationEngine, RectOperation, TagOperation, TextToolOperation, PointOperation, PolygonOperation, LineToolOperation } from '@labelbee/lb-annotation';
2
2
  import { ANNOTATION_ACTIONS } from '@/store/Actions';
3
3
  import { IStepInfo } from '@/types/step';
4
- import { OnSubmit, IFileItem, GetFileData, OnSave } from '@/types/data';
4
+ import { OnSubmit, IFileItem, GetFileData, OnSave, OnPageChange, OnStepChange, LoadFileList } from '@/types/data';
5
5
  import { ESubmitType } from '@/constant';
6
6
  export declare type GraphToolInstance = RectOperation | PointOperation | PolygonOperation | LineToolOperation;
7
7
  export declare type ToolInstance = GraphToolInstance | TagOperation | TextToolOperation;
@@ -21,7 +21,11 @@ export interface AnnotationState {
21
21
  imgNode: HTMLImageElement;
22
22
  onSubmit?: OnSubmit;
23
23
  onSave?: OnSave;
24
+ onPageChange?: OnPageChange;
25
+ onStepChange?: OnStepChange;
24
26
  getFileData?: GetFileData;
27
+ loadFileList?: LoadFileList;
28
+ pageSize?: number;
25
29
  basicIndex: number;
26
30
  basicResultList: any[];
27
31
  resultList: any[];
@@ -87,14 +91,38 @@ interface UpdateOnSave {
87
91
  onSave: OnSave;
88
92
  };
89
93
  }
94
+ interface UpdateOnPageChange {
95
+ type: typeof ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE;
96
+ payload: {
97
+ getFileData: OnPageChange;
98
+ };
99
+ }
100
+ interface UpdateOnStepChange {
101
+ type: typeof ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE;
102
+ payload: {
103
+ getFileData: OnStepChange;
104
+ };
105
+ }
90
106
  interface UpdateGetFileData {
91
107
  type: typeof ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA;
92
108
  payload: {
93
109
  getFileData: GetFileData;
94
110
  };
95
111
  }
112
+ interface UpdatePageSize {
113
+ type: typeof ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE;
114
+ payload: {
115
+ pageSize: number;
116
+ };
117
+ }
118
+ interface UpdateGetFileList {
119
+ type: typeof ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST;
120
+ payload: {
121
+ getFileData: LoadFileList;
122
+ };
123
+ }
96
124
  interface CopyBackWordResult extends CommonActions {
97
125
  type: typeof ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT;
98
126
  }
99
- export declare type AnnotationActionTypes = UpdateToolInstance | UpdateImgList | UpdateAnnotationConfig | SubmitFileData | LoadFileData | SetTaskConfig | InitTool | UpdateOnSubmit | UpdateGetFileData | CopyBackWordResult | UpdateOnSave;
127
+ export declare type AnnotationActionTypes = UpdateToolInstance | UpdateImgList | UpdateAnnotationConfig | SubmitFileData | LoadFileData | SetTaskConfig | InitTool | UpdateOnSubmit | UpdateOnPageChange | UpdateOnStepChange | UpdateGetFileData | UpdatePageSize | UpdateGetFileList | CopyBackWordResult | UpdateOnSave;
100
128
  export {};
@@ -43,6 +43,6 @@ declare class PageOperator {
43
43
  * @param pageTurningOperation
44
44
  * @param fileIndex
45
45
  */
46
- static getNextFileIndex: (pageTurningOperation: EPageTurningOperation, pageInfo: IPageInfo, fileIndex?: number | undefined) => number;
46
+ static getNextFileIndex: (pageTurningOperation: EPageTurningOperation, pageInfo: IPageInfo, fileIndex?: number) => number;
47
47
  }
48
48
  export default PageOperator;
@@ -15,4 +15,11 @@ export default class StepUtils {
15
15
  * @returns 步骤配置
16
16
  */
17
17
  static getStepInfo(step: number, stepList: IStepInfo[]): IStepInfo;
18
+ /**
19
+ * 根据toolName判断当前步骤是否为视频工具
20
+ * @param step 步骤
21
+ * @param stepList 步骤列表
22
+ * @returns {Number} 是否为视频工具
23
+ */
24
+ static currentToolIsVideo(step: number, stepList: IStepInfo[]): boolean;
18
25
  }
@@ -3,5 +3,5 @@ export declare const REGEXP_NUMBER = "^[0-9]+$";
3
3
  export declare const REGEXP_ENGLISH = "^[A-Za-z]+$";
4
4
  export declare class TextUtils {
5
5
  static checkString(textCheckType: ETextType, customFormat: string): string;
6
- static getErrorNotice(textCheckType: ETextType): "" | "请按仅数字的格式输入" | "请按仅英文的格式输入" | "请按要求的格式输入";
6
+ static getErrorNotice(textCheckType: ETextType): string;
7
7
  }
@@ -2,4 +2,10 @@ import { MutableRefObject } from 'react';
2
2
  export declare type BasicTarget<T = HTMLElement> = (() => T | null) | T | null | MutableRefObject<T | null | undefined>;
3
3
  declare type TargetElement = HTMLElement | Element | Document | Window;
4
4
  export declare function getTargetElement(target?: BasicTarget<TargetElement>, defaultElement?: TargetElement): TargetElement | undefined | null;
5
+ /**
6
+ * Get class like BEM
7
+ * @param elm
8
+ * @param modify
9
+ */
10
+ export declare const getClassName: (elm: string, modify?: string) => string;
5
11
  export {};
@@ -0,0 +1,5 @@
1
+ interface IProps {
2
+ tips: string;
3
+ }
4
+ declare const AnnotationTips: ({ tips }: IProps) => JSX.Element | null;
5
+ export default AnnotationTips;
@@ -1,4 +1,10 @@
1
1
  import { AppProps } from '@/App';
2
2
  import React from 'react';
3
- declare const MainView: React.FC<AppProps>;
4
- export default MainView;
3
+ interface IProps {
4
+ path: string;
5
+ loading: boolean;
6
+ }
7
+ declare const _default: import("react-redux").ConnectedComponent<React.FC<AppProps & IProps>, import("react-redux").Omit<AppProps & IProps & {
8
+ children?: React.ReactNode;
9
+ }, "loading" | "path">>;
10
+ export default _default;
@@ -107,3 +107,26 @@ export declare const saveResult: {
107
107
  icon: any;
108
108
  shortCut: string[];
109
109
  };
110
+ export declare const speed: {
111
+ name: string;
112
+ icon: any;
113
+ shortCut: string[];
114
+ shortCutUseHtml: boolean;
115
+ };
116
+ export declare const playPause: {
117
+ name: string;
118
+ icon: any;
119
+ shortCut: string[];
120
+ };
121
+ export declare const forwardForward: {
122
+ name: string;
123
+ icon: any;
124
+ shortCut: string[];
125
+ shortCutUseHtml: boolean;
126
+ };
127
+ export declare const rewind: {
128
+ name: string;
129
+ icon: any;
130
+ shortCut: string[];
131
+ shortCutUseHtml: boolean;
132
+ };
@@ -1,13 +1,8 @@
1
1
  import React from 'react';
2
2
  interface IProps {
3
- isSingleImg?: boolean;
4
3
  style?: any;
5
- }
6
- export interface IShortcuts {
7
- name: string;
8
- icon: any;
9
- shortCut: string[];
10
- noticeInfo?: string;
4
+ title?: React.ReactElement<any>;
5
+ toolName?: string;
11
6
  }
12
7
  declare const ToolHotKey: React.FC<IProps>;
13
8
  export default ToolHotKey;
@@ -53,7 +53,13 @@ export declare const suspendAbsorption: {
53
53
  noticeInfo: string;
54
54
  shortCut: string[];
55
55
  };
56
- export declare const segment: {
56
+ export declare const splitPolygon: {
57
+ name: string;
58
+ icon: any;
59
+ noticeInfo: string;
60
+ shortCut: string[];
61
+ };
62
+ export declare const combinePolygon: {
57
63
  name: string;
58
64
  icon: any;
59
65
  noticeInfo: string;
@@ -0,0 +1,3 @@
1
+ import { IShortcut } from '@/types/tool';
2
+ declare const videoTagToolShortCurTable: IShortcut[];
3
+ export default videoTagToolShortCurTable;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ interface IPagination {
3
+ imgIndex: number;
4
+ totalPage: number;
5
+ pageJump: (page: string) => void;
6
+ pageForward: () => void;
7
+ pageBackward: () => void;
8
+ footerCls: string;
9
+ isVideo?: boolean;
10
+ }
11
+ export declare const Pagination: React.FC<IPagination>;
12
+ export {};
@@ -1 +1 @@
1
- "use strict";var index=require("../constant/index.js");class StepUtils{static getCurrentStepInfo(n,t){const e=this.getStepInfo(n,t);return[index.EStepType.QUALITY_INSPECTION,index.EStepType.MANUAL_CORRECTION].includes(e==null?void 0:e.type)?this.getStepInfo(e.dataSourceStep,t):e}static getStepInfo(n,t){return t==null?void 0:t.filter(e=>e.step===n)[0]}}module.exports=StepUtils;
1
+ "use strict";var index=require("../constant/index.js"),lbAnnotation=require("@labelbee/lb-annotation");const{EVideoToolName}=lbAnnotation.cTool;class StepUtils{static getCurrentStepInfo(n,t){const e=this.getStepInfo(n,t);return[index.EStepType.QUALITY_INSPECTION,index.EStepType.MANUAL_CORRECTION].includes(e==null?void 0:e.type)?this.getStepInfo(e.dataSourceStep,t):e}static getStepInfo(n,t){return t==null?void 0:t.filter(e=>e.step===n)[0]}static currentToolIsVideo(n,t){const e=StepUtils.getCurrentStepInfo(n,t);return Object.values(EVideoToolName).includes(e==null?void 0:e.tool)}}module.exports=StepUtils;