@labelbee/lb-components 1.23.0-alpha.7 → 1.23.0-alpha.70

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 (208) hide show
  1. package/dist/App.js +1 -1
  2. package/dist/assets/annotation/icon_link.svg.js +1 -0
  3. package/dist/assets/annotation/icon_unlink.svg.js +1 -0
  4. package/dist/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
  5. package/dist/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
  6. package/dist/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
  7. package/dist/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
  8. package/dist/assets/icons/ad33251.svg +26 -0
  9. package/dist/components/AnnotationView/index.js +1 -1
  10. package/dist/components/LLMToolView/index.js +1 -1
  11. package/dist/components/LLMToolView/questionView/components/header/index.js +1 -1
  12. package/dist/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
  13. package/dist/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
  14. package/dist/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
  15. package/dist/components/LLMToolView/sidebar/index.js +1 -1
  16. package/dist/components/LLMToolView/utils/data.js +1 -1
  17. package/dist/components/NLPToolView/index.js +1 -1
  18. package/dist/components/audioAnnotate/audioContext/index.js +1 -1
  19. package/dist/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
  20. package/dist/components/audioAnnotate/index.js +1 -1
  21. package/dist/components/audioAnnotate/textInput/index.js +1 -1
  22. package/dist/components/audioAnnotate/textInput/index.module.scss.js +1 -1
  23. package/dist/components/audioAnnotate/utils/dataTransform.js +1 -0
  24. package/dist/components/audioPlayer/clipRegion/index.js +1 -1
  25. package/dist/components/audioPlayer/index.js +1 -1
  26. package/dist/components/audioPlayer/useAudioCombine/index.js +3 -2
  27. package/dist/components/audioPlayer/useAudioSegment/index.js +1 -1
  28. package/dist/components/longText/index.js +1 -1
  29. package/dist/components/pointCloud2DRectOperationView/index.js +1 -1
  30. package/dist/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
  31. package/dist/components/pointCloud2DRectOperationView/util.js +1 -0
  32. package/dist/components/pointCloudView/PointCloud2DSingleView.js +1 -1
  33. package/dist/components/pointCloudView/PointCloud2DView.js +1 -1
  34. package/dist/components/pointCloudView/PointCloud3DView.js +1 -1
  35. package/dist/components/pointCloudView/PointCloudContext.js +1 -1
  36. package/dist/components/pointCloudView/PointCloudInfos.js +1 -1
  37. package/dist/components/pointCloudView/PointCloudListener.js +1 -1
  38. package/dist/components/pointCloudView/PointCloudSegment2DView.js +1 -1
  39. package/dist/components/pointCloudView/PointCloudTopView.js +1 -1
  40. package/dist/components/pointCloudView/components/HighlightVisible/index.js +1 -1
  41. package/dist/components/pointCloudView/hooks/useBoxes.js +1 -1
  42. package/dist/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
  43. package/dist/components/pointCloudView/hooks/useHighlight.js +1 -1
  44. package/dist/components/pointCloudView/hooks/useHistory.js +1 -1
  45. package/dist/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  46. package/dist/components/pointCloudView/hooks/usePolygon.js +1 -1
  47. package/dist/components/pointCloudView/hooks/useRotate.js +1 -1
  48. package/dist/components/pointCloudView/hooks/useRotateEdge.js +1 -0
  49. package/dist/components/pointCloudView/hooks/useSingleBox.js +1 -1
  50. package/dist/components/pointCloudView/hooks/useStatus.js +1 -1
  51. package/dist/components/pointCloudView/hooks/useTimeoutFunc.js +1 -0
  52. package/dist/components/pointCloudView/hooks/useWindowKeydownListener.js +1 -0
  53. package/dist/components/pointCloudView/index.js +1 -1
  54. package/dist/components/pointCloudView/utils/event-polyfill.js +1 -0
  55. package/dist/components/pointCloudView/utils/map.js +1 -0
  56. package/dist/components/subAttributeList/index.js +1 -0
  57. package/dist/components/videoAnnotate/videoClipTool/index.js +1 -1
  58. package/dist/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
  59. package/dist/hooks/useToolStyle.js +1 -0
  60. package/dist/index.css +59 -17
  61. package/dist/index.js +1 -1
  62. package/dist/store/Actions.js +1 -1
  63. package/dist/store/annotatedBox/index.js +1 -1
  64. package/dist/store/annotation/actionCreators.js +1 -1
  65. package/dist/store/annotation/reducer.js +1 -1
  66. package/dist/types/App.d.ts +5 -1
  67. package/dist/types/components/AnnotationView/index.d.ts +1 -0
  68. package/dist/types/components/LLMToolView/utils/data.d.ts +1 -1
  69. package/dist/types/components/audioAnnotate/audioContext/index.d.ts +10 -2
  70. package/dist/types/components/audioAnnotate/textInput/index.d.ts +1 -0
  71. package/dist/types/components/audioAnnotate/utils/dataTransform.d.ts +9 -0
  72. package/dist/types/components/audioPlayer/index.d.ts +28 -21
  73. package/dist/types/components/longText/index.d.ts +1 -0
  74. package/dist/types/components/pointCloud2DRectOperationView/index.d.ts +1 -0
  75. package/dist/types/components/pointCloud2DRectOperationView/useUpdateRectList.d.ts +2 -0
  76. package/dist/types/components/pointCloud2DRectOperationView/util.d.ts +8 -0
  77. package/dist/types/components/pointCloudView/PointCloud2DView.d.ts +2 -1
  78. package/dist/types/components/pointCloudView/PointCloudContext.d.ts +28 -4
  79. package/dist/types/components/pointCloudView/components/HighlightVisible/index.d.ts +2 -1
  80. package/dist/types/components/pointCloudView/hooks/useDataLinkSwitch.d.ts +19 -0
  81. package/dist/types/components/pointCloudView/hooks/useHighlight.d.ts +1 -1
  82. package/dist/types/components/pointCloudView/hooks/usePointCloudViews.d.ts +8 -0
  83. package/dist/types/components/pointCloudView/hooks/useRotateEdge.d.ts +9 -0
  84. package/dist/types/components/pointCloudView/hooks/useSingleBox.d.ts +3 -2
  85. package/dist/types/components/pointCloudView/hooks/useTimeoutFunc.d.ts +6 -0
  86. package/dist/types/components/pointCloudView/hooks/useWindowKeydownListener.d.ts +16 -0
  87. package/dist/types/components/pointCloudView/utils/event-polyfill.d.ts +8 -0
  88. package/dist/types/components/pointCloudView/utils/map.d.ts +11 -0
  89. package/dist/types/components/subAttributeList/index.d.ts +10 -0
  90. package/dist/types/components/videoAnnotate/index.d.ts +2 -1
  91. package/dist/types/components/videoAnnotate/videoClipTool/index.d.ts +2 -1
  92. package/dist/types/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.d.ts +1 -1
  93. package/dist/types/hooks/useToolStyle.d.ts +30 -0
  94. package/dist/types/index.d.ts +7 -2
  95. package/dist/types/store/Actions.d.ts +1 -0
  96. package/dist/types/store/annotatedBox/index.d.ts +2 -0
  97. package/dist/types/store/annotation/actionCreators.d.ts +3 -2
  98. package/dist/types/store/annotation/reducer.d.ts +1 -0
  99. package/dist/types/store/annotation/types.d.ts +9 -2
  100. package/dist/types/utils/AnnotationDataUtils.d.ts +58 -1
  101. package/dist/types/utils/ToolPointCloudBoxRenderHelper.d.ts +23 -0
  102. package/dist/types/utils/index.d.ts +31 -1
  103. package/dist/types/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.d.ts +3 -0
  104. package/dist/types/views/MainView/sidebar/TextToolSidebar/index.d.ts +1 -1
  105. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.d.ts +9 -0
  106. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.d.ts +3 -0
  107. package/dist/types/views/MainView/toolFooter/BatchSwitchConnectIn2DView/index.d.ts +1 -0
  108. package/dist/types/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.d.ts +10 -2
  109. package/dist/types/views/MainView/toolFooter/index.d.ts +1 -1
  110. package/dist/types/views/MainView/toolHeader/StepSwitch/index.d.ts +1 -1
  111. package/dist/types/views/MainView/toolHeader/index.d.ts +1 -1
  112. package/dist/utils/AnnotationDataUtils.js +1 -1
  113. package/dist/utils/ToolPointCloudBoxRenderHelper.js +1 -0
  114. package/dist/utils/index.js +1 -1
  115. package/dist/views/MainView/index.js +1 -1
  116. package/dist/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
  117. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
  118. package/dist/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
  119. package/dist/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  120. package/dist/views/MainView/sidebar/TagSidebar/index.js +1 -1
  121. package/dist/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  122. package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
  123. package/dist/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
  124. package/dist/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
  125. package/dist/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
  126. package/dist/views/MainView/toolFooter/index.js +1 -1
  127. package/es/App.js +1 -1
  128. package/es/assets/annotation/icon_link.svg.js +1 -0
  129. package/es/assets/annotation/icon_unlink.svg.js +1 -0
  130. package/es/assets/annotation/pointCloudTool/Image2DBoxScale.svg.js +1 -0
  131. package/es/assets/annotation/pointCloudTool/leftArrow.svg.js +1 -1
  132. package/es/assets/annotation/pointCloudTool/rightArrow.svg.js +1 -1
  133. package/es/assets/annotation/pointCloudTool/rotate90_black.svg.js +1 -0
  134. package/es/components/AnnotationView/index.js +1 -1
  135. package/es/components/LLMToolView/index.js +1 -1
  136. package/es/components/LLMToolView/questionView/components/header/index.js +1 -1
  137. package/es/components/LLMToolView/sidebar/components/textEditor/index.js +2 -2
  138. package/es/components/LLMToolView/sidebar/components/textEditor/index.module.scss.js +1 -1
  139. package/es/components/LLMToolView/sidebar/components/textInputBox/index.js +2 -2
  140. package/es/components/LLMToolView/sidebar/index.js +1 -1
  141. package/es/components/LLMToolView/utils/data.js +1 -1
  142. package/es/components/NLPToolView/index.js +1 -1
  143. package/es/components/audioAnnotate/audioContext/index.js +1 -1
  144. package/es/components/audioAnnotate/audioSide/clipSidebar/index.js +1 -1
  145. package/es/components/audioAnnotate/index.js +1 -1
  146. package/es/components/audioAnnotate/textInput/index.js +1 -1
  147. package/es/components/audioAnnotate/textInput/index.module.scss.js +1 -1
  148. package/es/components/audioAnnotate/utils/dataTransform.js +1 -0
  149. package/es/components/audioPlayer/clipRegion/index.js +1 -1
  150. package/es/components/audioPlayer/index.js +1 -1
  151. package/es/components/audioPlayer/useAudioCombine/index.js +3 -2
  152. package/es/components/audioPlayer/useAudioSegment/index.js +1 -1
  153. package/es/components/longText/index.js +1 -1
  154. package/es/components/pointCloud2DRectOperationView/index.js +1 -1
  155. package/es/components/pointCloud2DRectOperationView/useUpdateRectList.js +1 -0
  156. package/es/components/pointCloud2DRectOperationView/util.js +1 -0
  157. package/es/components/pointCloudView/PointCloud2DSingleView.js +1 -1
  158. package/es/components/pointCloudView/PointCloud2DView.js +1 -1
  159. package/es/components/pointCloudView/PointCloud3DView.js +1 -1
  160. package/es/components/pointCloudView/PointCloudContext.js +1 -1
  161. package/es/components/pointCloudView/PointCloudInfos.js +1 -1
  162. package/es/components/pointCloudView/PointCloudListener.js +1 -1
  163. package/es/components/pointCloudView/PointCloudSegment2DView.js +1 -1
  164. package/es/components/pointCloudView/PointCloudTopView.js +1 -1
  165. package/es/components/pointCloudView/components/HighlightVisible/index.js +1 -1
  166. package/es/components/pointCloudView/hooks/useBoxes.js +1 -1
  167. package/es/components/pointCloudView/hooks/useDataLinkSwitch.js +1 -0
  168. package/es/components/pointCloudView/hooks/useHighlight.js +1 -1
  169. package/es/components/pointCloudView/hooks/useHistory.js +1 -1
  170. package/es/components/pointCloudView/hooks/usePointCloudViews.js +1 -1
  171. package/es/components/pointCloudView/hooks/usePolygon.js +1 -1
  172. package/es/components/pointCloudView/hooks/useRotate.js +1 -1
  173. package/es/components/pointCloudView/hooks/useRotateEdge.js +1 -0
  174. package/es/components/pointCloudView/hooks/useSingleBox.js +1 -1
  175. package/es/components/pointCloudView/hooks/useStatus.js +1 -1
  176. package/es/components/pointCloudView/hooks/useTimeoutFunc.js +1 -0
  177. package/es/components/pointCloudView/hooks/useWindowKeydownListener.js +1 -0
  178. package/es/components/pointCloudView/index.js +1 -1
  179. package/es/components/pointCloudView/utils/event-polyfill.js +1 -0
  180. package/es/components/pointCloudView/utils/map.js +1 -0
  181. package/es/components/subAttributeList/index.js +1 -0
  182. package/es/components/videoAnnotate/videoClipTool/index.js +1 -1
  183. package/es/components/videoAnnotate/videoTagTool/TagToolInstanceAdaptor.js +1 -1
  184. package/es/hooks/useToolStyle.js +1 -0
  185. package/es/index.css +59 -17
  186. package/es/index.js +1 -1
  187. package/es/store/Actions.js +1 -1
  188. package/es/store/annotatedBox/index.js +1 -1
  189. package/es/store/annotation/actionCreators.js +1 -1
  190. package/es/store/annotation/reducer.js +1 -1
  191. package/es/utils/AnnotationDataUtils.js +1 -1
  192. package/es/utils/ToolPointCloudBoxRenderHelper.js +1 -0
  193. package/es/utils/index.js +1 -1
  194. package/es/views/MainView/index.js +1 -1
  195. package/es/views/MainView/sidebar/NLPSidebar/NLPAnnotatedList.js +1 -1
  196. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.js +1 -0
  197. package/es/views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider/index.module.scss.js +1 -0
  198. package/es/views/MainView/sidebar/PointCloudToolSidebar/index.js +1 -1
  199. package/es/views/MainView/sidebar/TagSidebar/index.js +1 -1
  200. package/es/views/MainView/sidebar/TextToolSidebar/index.js +1 -1
  201. package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/BatchSwitchConnectIn2DView.js +1 -0
  202. package/es/views/MainView/toolFooter/BatchSwitchConnectIn2DView/Icons.js +1 -0
  203. package/es/views/MainView/toolFooter/FooterTips/ToolHotKey/pointCloud/index.js +1 -1
  204. package/es/views/MainView/toolFooter/SwitchCuboidBoxIn2DView/index.js +1 -1
  205. package/package.json +3 -3
  206. package/dist/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
  207. package/dist/assets/icons/9d70807.svg +0 -5
  208. package/es/assets/annotation/pointCloudTool/rotate180_black.svg.js +0 -1
@@ -0,0 +1,11 @@
1
+ export type MapIndirectWeakSet<T extends object> = Map<string, Map<string, WeakSet<T>>>;
2
+ /**
3
+ * Update MapIndirectWeakSet
4
+ *
5
+ * @param map The map will be changed
6
+ * @param key0 The top key
7
+ * @param key1 The inner key
8
+ * @param value The target to be set
9
+ * @returns return map
10
+ */
11
+ export declare const addMapIndirectWeakSetItem: <T extends object>(map: MapIndirectWeakSet<T>, key0: string, key1: string, value: T) => MapIndirectWeakSet<T>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { IInputList } from '@labelbee/lb-utils';
3
+ interface IProps {
4
+ subAttributeList: IInputList[];
5
+ setSubAttribute: (value: string, subAttribute: string) => void;
6
+ getValue: (subAttribute: IInputList) => undefined | string;
7
+ lang?: string;
8
+ }
9
+ declare const WrapSubAttributeList: (props: IProps) => React.JSX.Element;
10
+ export default WrapSubAttributeList;
@@ -20,8 +20,9 @@ export interface IVideoAnnotateProps {
20
20
  drawLayerSlot?: DrawLayerSlot;
21
21
  footer?: any;
22
22
  skipBeforePageTurning?: (pageTurning: Function) => void;
23
+ annotationBefore?: (setAnnotationData: Function) => void;
23
24
  }
24
25
  declare const _default: import("react-redux").ConnectedComponent<React.FC<IVideoAnnotateProps>, import("react-redux").Omit<IVideoAnnotateProps & {
25
26
  children?: React.ReactNode;
26
- }, "stepList" | "step" | "imgIndex" | "imgList" | "config" | "skipBeforePageTurning" | "loading" | "path" | "stepInfo">>;
27
+ }, "step" | "stepList" | "imgIndex" | "imgList" | "config" | "skipBeforePageTurning" | "loading" | "path" | "stepInfo">>;
27
28
  export default _default;
@@ -49,7 +49,7 @@ declare class VideoClipTool extends React.Component<IVideoClipProps, IState> {
49
49
  videoPlayer?: any;
50
50
  videoNode?: HTMLVideoElement;
51
51
  videoRef?: HTMLVideoElement;
52
- throttledUpdateTime: _.DebouncedFunc<(newValue: number) => void>;
52
+ throttledUpdateTime: _.DebouncedFuncLeading<(newValue: number) => void>;
53
53
  constructor(props: IVideoClipProps);
54
54
  get valid(): boolean;
55
55
  get config(): any;
@@ -91,6 +91,7 @@ declare class VideoClipTool extends React.Component<IVideoClipProps, IState> {
91
91
  * @returns
92
92
  */
93
93
  toggleClipStatus: (curTime?: number) => void;
94
+ setClipResult: (curTime?: number) => void;
94
95
  /** 添加时间点 */
95
96
  addTime: () => void;
96
97
  /** 更新当前时间 */
@@ -65,7 +65,7 @@ export declare class TagToolInstanceAdaptor extends React.Component<IVideoTagIns
65
65
  value: string;
66
66
  };
67
67
  isMulti: boolean;
68
- }, existValue?: ObjectString) => _.Dictionary<string | undefined>;
68
+ }, existData?: ObjectString) => _.Dictionary<string | undefined>;
69
69
  setResult: (tagResult: any[]) => void;
70
70
  setLabel: (num1: number, num2: number) => void;
71
71
  /**
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The file is about `ToolStyle` context.
3
+ *
4
+ * What will provide:
5
+ * 1. give the explicit `toolStyle` config
6
+ * 2. give hook for reading context
7
+ *
8
+ * Who will use/consume:
9
+ * 1. `BasicToolOperation` class & its derived class
10
+ * 2. `DrawUtils`
11
+ *
12
+ */
13
+ import React, { FC, PropsWithChildren } from 'react';
14
+ import type { ToolStyle } from '../types/toolStyle';
15
+ declare const validFields: readonly ["hiddenText"];
16
+ type ValidField = typeof validFields[number];
17
+ type OptionalToolStyle = Pick<ToolStyle, ValidField>;
18
+ export declare const ToolStyleContext: React.Context<{
19
+ value: OptionalToolStyle;
20
+ updateValue: (value: Partial<OptionalToolStyle>) => void;
21
+ }>;
22
+ export declare const useToolStyleContext: () => {
23
+ value: OptionalToolStyle;
24
+ updateValue: (value: Partial<OptionalToolStyle>) => void;
25
+ };
26
+ interface ToolStyleProviderProps {
27
+ value?: OptionalToolStyle;
28
+ }
29
+ export declare const ToolStyleProvider: FC<PropsWithChildren<ToolStyleProviderProps>>;
30
+ export {};
@@ -9,15 +9,20 @@ import { VideoTagTool } from '@/components/videoAnnotate/videoTagTool/TagToolIns
9
9
  import './index.scss';
10
10
  import PredictTracking from '@/components/predictTracking';
11
11
  import LLMToolView from '@/components/LLMToolView';
12
- import SwitchCuboidBoxIn2DView from '@/views/MainView/toolFooter/SwitchCuboidBoxIn2DView';
12
+ import SwitchCuboidBoxIn2DView, { SwitchCuboidBoxIn2DViewStateMode } from '@/views/MainView/toolFooter/SwitchCuboidBoxIn2DView';
13
+ import BatchSwitchConnectIn2DView from '@/views/MainView/toolFooter/BatchSwitchConnectIn2DView';
13
14
  import MeasureCanvas from './components/measureCanvas';
14
15
  import AnnotatedBox from './views/MainView/sidebar/PointCloudToolSidebar/components/annotatedBox';
16
+ import RectRotateSensitivitySlider from './views/MainView/sidebar/PointCloudToolSidebar/components/rectRotateSensitivitySlider';
15
17
  import { FindTrackIDIndexInCheckMode as FindTrackIDIndex } from './views/MainView/sidebar/PointCloudToolSidebar/components/findTrackIDIndex';
18
+ import { WrapAudioPlayer as AudioPlayer } from './components/audioPlayer';
19
+ import { generatePointCloudBoxRects } from './utils';
20
+ import SubAttributeList from './components/subAttributeList';
16
21
  export declare const store: import("redux").Store<{}, import("redux").Action<any>> & {
17
22
  dispatch: unknown;
18
23
  };
19
24
  declare const _default: React.ForwardRefExoticComponent<AppProps & React.RefAttributes<unknown>>;
20
25
  export default _default;
21
- export { AnnotationView, PointCloudAnnotationView, QuestionView, TextContent, LLMToolView, i18n, VideoTagTool, PredictTracking, SwitchCuboidBoxIn2DView, MeasureCanvas, AnnotatedBox, FindTrackIDIndex, };
26
+ export { AnnotationView, PointCloudAnnotationView, QuestionView, TextContent, LLMToolView, i18n, VideoTagTool, PredictTracking, SwitchCuboidBoxIn2DView, SwitchCuboidBoxIn2DViewStateMode, BatchSwitchConnectIn2DView, MeasureCanvas, AnnotatedBox, RectRotateSensitivitySlider, FindTrackIDIndex, AudioPlayer, generatePointCloudBoxRects, SubAttributeList, };
22
27
  export * from './constant';
23
28
  export * from './typeTem';
@@ -40,6 +40,7 @@ export declare const ANNOTATION_ACTIONS: {
40
40
  SET_PREDICT_RESULT: string;
41
41
  SET_HIGHLIGHT_ATTRIBUTE: string;
42
42
  UPDATE_PRE_DATA_PROCESS: string;
43
+ UPDATE_IMG_INDEX_BY_EXTERNAL: string;
43
44
  };
44
45
  export declare const IMAGE_ATTRIBUTE_ACTIONS: {
45
46
  UPDATE_IMG_ATTRIBUTE: string;
@@ -8,6 +8,8 @@ interface Store {
8
8
  setHighlightIDs: (highlightIDs: number[]) => void;
9
9
  selectedIDs: string[];
10
10
  setSelectedIDs: (selectedIDs: string[]) => void;
11
+ rectRotateSensitivity: number;
12
+ setRectRotateSensitivity: (sensitivity: number) => void;
11
13
  setPtCtx: (ptCtx: IPointCloudContext) => void;
12
14
  }
13
15
  declare const useAnnotatedBoxStore: import("zustand").UseBoundStore<import("zustand").StoreApi<Store>>;
@@ -1,5 +1,5 @@
1
1
  import { IStepInfo } from '@/types/step';
2
- import { GetFileData, LoadFileList, IFileItem, OnPageChange, OnSave, OnStepChange, OnSubmit } from '@/types/data';
2
+ import { GetFileData, LoadFileList, IFileItem, OnPageChange, OnSave, OnStepChange, OnSubmit, GetImgIndexByExternal } from '@/types/data';
3
3
  import { AnnotationActionTypes, ToolInstance } from './types';
4
4
  import { ESubmitType } from '@/constant';
5
5
  import { EPageTurningOperation } from '@/data/enums/AnnotationSize';
@@ -28,6 +28,7 @@ export declare function UpdateSkipBeforePageTurning(skipBeforePageTurning: (page
28
28
  export declare function UpdateBeforeRotate(beforeRotate: () => {}): AnnotationActionTypes;
29
29
  export declare function UpdatePreDataProcess(preDataProcess: () => {}): AnnotationActionTypes;
30
30
  export declare function CopyBackWordResult(): AnnotationActionTypes;
31
+ export declare function UpdateImgIndexByExternal(getImgIndexByExternal: GetImgIndexByExternal): AnnotationActionTypes;
31
32
  export declare function BatchUpdateTrackID({ id, newID, rangeIndex, imgList, }: {
32
33
  id: number;
33
34
  newID: number;
@@ -43,7 +44,7 @@ export declare const UpdateHighlightAttribute: (attribute: string) => Annotation
43
44
  * 初始化任务数据
44
45
  * @param param0
45
46
  */
46
- export declare function InitTaskData({ onSubmit, onSave, onPageChange, onStepChange, getFileData, pageSize, loadFileList, step, stepList, skipBeforePageTurning, beforeRotate, checkMode, highlightAttribute, preDataProcess, }: any): any;
47
+ export declare function InitTaskData({ onSubmit, onSave, onPageChange, onStepChange, getFileData, pageSize, loadFileList, step, stepList, skipBeforePageTurning, beforeRotate, checkMode, highlightAttribute, preDataProcess, getImgIndexByExternal, }: any): any;
47
48
  /**
48
49
  * 初始化任务数据
49
50
  * @param param0
@@ -54,4 +54,5 @@ export declare const annotationReducer: (state: {
54
54
  predictionResultVisible: boolean;
55
55
  highlightAttribute: string;
56
56
  preDataProcess?: ((params: import("../../App").IPreDataProcessParams) => IPointCloudBox[]) | undefined;
57
+ getImgIndexByExternal?: import("@/types/data").GetImgIndexByExternal | undefined;
57
58
  } | 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, OnPageChange, OnStepChange, LoadFileList } from '@/types/data';
4
+ import { OnSubmit, IFileItem, GetFileData, OnSave, OnPageChange, OnStepChange, LoadFileList, GetImgIndexByExternal } from '@/types/data';
5
5
  import { ESubmitType } from '@/constant';
6
6
  import { IPointCloudBox } from '@labelbee/lb-utils';
7
7
  import { IPreDataProcessParams } from '@/App';
@@ -47,6 +47,7 @@ export interface AnnotationState {
47
47
  predictionResultVisible: boolean;
48
48
  highlightAttribute: string;
49
49
  preDataProcess?: (params: IPreDataProcessParams) => IPointCloudBox[];
50
+ getImgIndexByExternal?: GetImgIndexByExternal;
50
51
  }
51
52
  interface UpdateToolInstance {
52
53
  type: typeof ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE;
@@ -135,6 +136,12 @@ interface UpdateGetFileList {
135
136
  getFileData: LoadFileList;
136
137
  };
137
138
  }
139
+ interface UpdataImgIndexByExternal {
140
+ type: typeof ANNOTATION_ACTIONS.UPDATE_IMG_INDEX_BY_EXTERNAL;
141
+ payload: {
142
+ getImgIndexByExternal: GetImgIndexByExternal;
143
+ };
144
+ }
138
145
  interface CopyBackWordResult extends CommonActions {
139
146
  type: typeof ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT;
140
147
  }
@@ -158,5 +165,5 @@ interface BatchUpdateResultByTrackID {
158
165
  range: [number, number];
159
166
  };
160
167
  }
161
- export type AnnotationActionTypes = UpdateToolInstance | UpdateImgList | UpdateAnnotationConfig | SubmitFileData | LoadFileData | SetTaskConfig | InitTool | UpdateOnSubmit | UpdateOnPageChange | UpdateOnStepChange | UpdateGetFileData | UpdatePageSize | UpdateGetFileList | CopyBackWordResult | UpdateOnSave | BatchUpdateTrackID | BatchUpdateResultByTrackID | InitAnnotationState;
168
+ export type AnnotationActionTypes = UpdateToolInstance | UpdateImgList | UpdateAnnotationConfig | SubmitFileData | LoadFileData | SetTaskConfig | InitTool | UpdateOnSubmit | UpdateOnPageChange | UpdateOnStepChange | UpdateGetFileData | UpdatePageSize | UpdateGetFileList | CopyBackWordResult | UpdateOnSave | BatchUpdateTrackID | BatchUpdateResultByTrackID | UpdataImgIndexByExternal | InitAnnotationState;
162
169
  export {};
@@ -1,5 +1,61 @@
1
1
  import { IStepInfo } from '@/types/step';
2
+ import { IMappingImg } from '@/types/data';
3
+ interface ICopyResultChangeParams {
4
+ copyResult: string;
5
+ step: number;
6
+ currentResult: string;
7
+ mappingImgList: IMappingImg[];
8
+ preMappingImgList: IMappingImg[];
9
+ valid: boolean;
10
+ }
11
+ interface IGetNextPath {
12
+ prePath: string;
13
+ preMappingImgList: IMappingImg[];
14
+ nextMappingImgList: IMappingImg[];
15
+ }
16
+ interface ICopyResultItemHandlerParams {
17
+ item: any;
18
+ key?: string | number;
19
+ parent: any;
20
+ mappingImgList: IMappingImg[];
21
+ preMappingImgList: IMappingImg[];
22
+ }
2
23
  export default class AnnotationDataUtils {
24
+ /**
25
+ * Performs a depth-first traversal of an object or array, executing a callback function on each element.
26
+ *
27
+ * @param {any} objOrArr - The object or array to be traversed.
28
+ * @param {Function} callback - The callback function to be executed on each element.
29
+ * The callback function takes three parameters: element, key, and parent.
30
+ * @param {string | number} [key] - The key or index of the current element in its parent (optional).
31
+ * @param {any} [parent] - The parent of the current element (optional).
32
+ */
33
+ static traverseDF(objOrArr: any, callback: (element: any, key?: string | number, parent?: any) => void, key?: string | number, parent?: any): void;
34
+ /**
35
+ * Calculates the next path based on the provided parameters.
36
+ *
37
+ * @param {IGetNextPath} params - The object containing necessary information.
38
+ * @param {string} params.prePath - The current path.
39
+ * @param {IImgList} params.preMappingImgList - The list of current mapping images.
40
+ * @param {IImgList} params.nextMappingImgList - The list of next mapping images.
41
+ * @returns {string} The next path, returns an empty string if not found.
42
+ */
43
+ static getNextPath(params: IGetNextPath): string | undefined;
44
+ /**
45
+ * Handles the processing of individual items during the traversal of results or resultRect.
46
+ * This function updates specific properties of the parent object based on the key of the current item.
47
+ *
48
+ * @param {ICopyResultItemHandlerParams} params - Parameters containing the current item, its key, parent object, and image lists.
49
+ * @param {ICopyResultItemHandlerParams.item} item - The current item being processed.
50
+ * @param {ICopyResultItemHandlerParams.key} key - The key associated with the current item.
51
+ * @param {ICopyResultItemHandlerParams.parent} parent - The parent object of the current item.
52
+ * @param {ICopyResultItemHandlerParams.mappingImgList} mappingImgList - The list of images for mapping.
53
+ * @param {ICopyResultItemHandlerParams.preMappingImgList} preMappingImgList - The list of images before mapping.
54
+ */
55
+ static copyResultItemHandler(params: ICopyResultItemHandlerParams): {
56
+ value: any;
57
+ oldValue: any;
58
+ };
3
59
  /**
4
60
  * 复制上一张图片结果
5
61
  * @param copyResult 复制的结果
@@ -7,7 +63,7 @@ export default class AnnotationDataUtils {
7
63
  * @param currentResult 当前的步骤
8
64
  * @returns
9
65
  */
10
- static copyResultChange(copyResult: string, step: number, currentResult: string): string;
66
+ static copyResultChange(params: ICopyResultChangeParams): string | undefined;
11
67
  /**
12
68
  * 判断结果sourceID与依赖数据的id是否能对应
13
69
  * @param result
@@ -75,3 +131,4 @@ export default class AnnotationDataUtils {
75
131
  */
76
132
  static deleteRes(resData: any, dataSourceStep: number, deletedIds: string[], stepKeys: number[]): void;
77
133
  }
134
+ export {};
@@ -0,0 +1,23 @@
1
+ import { ICoordinate, IPointCloudBox } from '@labelbee/lb-utils';
2
+ export declare enum EPointCloudBoxRenderTrigger {
3
+ Default = "Default",
4
+ UndoRedo = "UndoRedo",
5
+ ClearAll = "ClearAll",
6
+ Single = "Single",
7
+ SingleDelete = "SingleDelete",
8
+ SingleToggleValid = "SingleToggleValid",
9
+ SingleRotate = "SingleRotate",
10
+ MultiPaste = "MultiPaste",
11
+ MultiMove = "MultiMove"
12
+ }
13
+ export declare enum EPointCloudBoxSingleModifiedType {
14
+ ChangeAttribute = "ChangeAttribute",
15
+ Move = "Move",
16
+ ChangeDepth = "ChangeDepth",
17
+ ChangeSize = "ChangeSize",
18
+ ToggleValid = "ToggleValid"
19
+ }
20
+ export declare const calcResetAreasAndBoxIds: (trigger: EPointCloudBoxRenderTrigger, newList: IPointCloudBox[], oldList: IPointCloudBox[]) => {
21
+ modifiedBoxIds: string[];
22
+ resetAreas: ICoordinate[][];
23
+ };
@@ -1,4 +1,4 @@
1
- import { ICoordinate, IPointCloudBox, ISize } from '@labelbee/lb-utils';
1
+ import { IBasicRect, ICoordinate, IPointCloudBox, ISize } from '@labelbee/lb-utils';
2
2
  import { IMappingImg } from '@/types/data';
3
3
  export declare const jsonParser: (content: any, defaultValue?: any) => any;
4
4
  export declare const getNewNode: <T>(newNode: T, oldNode: T) => T;
@@ -11,6 +11,9 @@ export declare const getBoundingRect: (points: ICoordinate[]) => {
11
11
  width: number;
12
12
  height: number;
13
13
  };
14
+ export declare const isBoundingRectInImage: (boundingRect: Omit<IBasicRect, "id">, path: string, imageSizes: {
15
+ [key: string]: ISize;
16
+ }) => boolean;
14
17
  interface IGetRectPointCloudBoxParams {
15
18
  pointCloudBox: IPointCloudBox;
16
19
  mappingData: IMappingImg;
@@ -25,4 +28,31 @@ export declare const getRectPointCloudBox: (params: IGetRectPointCloudBoxParams)
25
28
  width: number;
26
29
  height: number;
27
30
  } | undefined;
31
+ export interface GeneratePointCloudBoxRectsOptions {
32
+ prepareRectsFn?: (rects: Array<ReturnType<typeof getRectPointCloudBox>>, pointCloudBox: IPointCloudBox) => Array<ReturnType<typeof getRectPointCloudBox>>;
33
+ }
34
+ /**
35
+ * Updates the given point cloud box with rectangles derived from the mapping image list and image sizes.
36
+ *
37
+ * @param {Object} params - The parameters for the function.
38
+ * @param {IPointCloudBox} params.pointCloudBox - The point cloud box object to be updated.
39
+ * @param {IMappingImg[]} params.mappingImgList - The list of mapping images to process.
40
+ * @param {Object.<string, ISize>} params.imageSizes - An object containing image sizes keyed by image paths.
41
+ *
42
+ * @param {Object=} options - The options
43
+ * @param {Function=} options.prepareRectsFn - The prepare func for rects
44
+ *
45
+ * @returns {void}
46
+ *
47
+ * @description This function processes a list of mapping images to generate rectangles for the provided point cloud box.
48
+ * It filters out undefined rectangles and updates the point cloud box with the valid rectangles. Note that this function
49
+ * modifies the `pointCloudBox` parameter by adding a `rects` property.
50
+ */
51
+ export declare const generatePointCloudBoxRects: (params: {
52
+ pointCloudBox: IPointCloudBox;
53
+ mappingImgList: IMappingImg[];
54
+ imageSizes: {
55
+ [key: string]: ISize;
56
+ };
57
+ }, options?: GeneratePointCloudBoxRectsOptions) => void;
28
58
  export {};
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const RectRotateSensitivitySlider: () => React.JSX.Element;
3
+ export default RectRotateSensitivitySlider;
@@ -20,5 +20,5 @@ interface IProps {
20
20
  export declare const SingleTextInput: (props: any) => React.JSX.Element;
21
21
  declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
22
22
  children?: React.ReactNode;
23
- }, "stepList" | "step" | "imgIndex" | "basicResultList" | "toolInstance" | "triggerEventAfterIndexChanged" | "dispatch">>;
23
+ }, "step" | "stepList" | "imgIndex" | "basicResultList" | "toolInstance" | "triggerEventAfterIndexChanged" | "dispatch">>;
24
24
  export default _default;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The component which provides the batch operation for connection/disconnection
3
+ */
4
+ import { FC } from 'react';
5
+ export declare enum EventBusEvent {
6
+ switchConnect = "batch:switch-connect"
7
+ }
8
+ declare const BatchSwitchConnectIn2DView: FC;
9
+ export default BatchSwitchConnectIn2DView;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const IconBatchConnect: () => React.JSX.Element;
3
+ export declare const IconBatchDisconnect: () => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export { default, EventBusEvent as BatchSwitchConnectionEventBusEvent } from './BatchSwitchConnectIn2DView';
@@ -1,3 +1,11 @@
1
- import React from 'react';
2
- declare const SwitchCuboidBoxIn2DView: () => React.JSX.Element | null;
1
+ import { FC } from 'react';
2
+ export declare enum SwitchCuboidBoxIn2DViewStateMode {
3
+ isHidden = 0,
4
+ is2d = 1,
5
+ is3d = 2
6
+ }
7
+ interface SwitchCuboidBoxIn2DViewProps {
8
+ onChange?: (stateMode: SwitchCuboidBoxIn2DViewStateMode) => void;
9
+ }
10
+ declare const SwitchCuboidBoxIn2DView: FC<SwitchCuboidBoxIn2DViewProps>;
3
11
  export default SwitchCuboidBoxIn2DView;
@@ -20,5 +20,5 @@ export declare const footerCls: string;
20
20
  export declare const FooterDivider: () => React.JSX.Element;
21
21
  declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
22
22
  children?: React.ReactNode;
23
- }, "stepList" | "step" | "imgIndex" | "basicResultList" | "basicIndex" | "skipBeforePageTurning" | "totalPage">>;
23
+ }, "step" | "stepList" | "imgIndex" | "basicResultList" | "basicIndex" | "skipBeforePageTurning" | "totalPage">>;
24
24
  export default _default;
@@ -10,5 +10,5 @@ interface IProps {
10
10
  }
11
11
  declare const _default: import("react-redux").ConnectedComponent<React.FC<IProps>, import("react-redux").Omit<IProps & {
12
12
  children?: React.ReactNode;
13
- }, "stepList" | "step">>;
13
+ }, "step" | "stepList">>;
14
14
  export default _default;
@@ -22,5 +22,5 @@ interface IToolHeaderProps {
22
22
  }
23
23
  declare const _default: import("react-redux").ConnectedComponent<React.FC<IToolHeaderProps>, import("react-redux").Omit<IToolHeaderProps & {
24
24
  children?: React.ReactNode;
25
- }, "stepList" | "step" | "imgList" | "annotationEngine" | "toolName" | "stepInfo" | "stepProgress">>;
25
+ }, "step" | "stepList" | "imgList" | "annotationEngine" | "toolName" | "stepInfo" | "stepProgress">>;
26
26
  export default _default;
@@ -1 +1 @@
1
- "use strict";var lbAnnotation=require("@labelbee/lb-annotation"),index=require("./index.js"),ToolType=require("../data/enums/ToolType.js"),_=require("lodash"),StepUtils=require("./StepUtils.js");function _interopDefaultLegacy(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(i,e,t)=>e in i?__defProp(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,__spreadValues=(i,e)=>{for(var t in e||(e={}))__hasOwnProp.call(e,t)&&__defNormalProp(i,t,e[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(e))__propIsEnum.call(e,t)&&__defNormalProp(i,t,e[t]);return i},__spreadProps=(i,e)=>__defProps(i,__getOwnPropDescs(e));class AnnotationDataUtils{static copyResultChange(e,t,r){try{const s=index.jsonParser(e),n=index.jsonParser(r),o=`step_${t}`;if(s[o]){const a=s[o];if(a.result)return a.result=a.result.map(u=>__spreadProps(__spreadValues({},u),{id:lbAnnotation.uuid(8,62)})),n[o]=a,JSON.stringify(n)}return e}catch(s){return e}}static isResultSourceMatchedDependence(e,t){const r=e==null?void 0:e.map(n=>n.sourceID).sort(),s=t==null?void 0:t.map(n=>n.id).sort();return ___default.default.isEqual(r,s)}static deltaUpdateBasicResultList(e,t){const r=e==null?void 0:e.map(s=>s.sourceID).sort();return t.filter(s=>!r.includes(s.id))}static getInitialResultList(e,t,r,s,n){const o=e!=null?e:[];switch(r.tool){case ToolType.EToolName.Tag:case ToolType.EToolName.Text:{if(r.dataSourceStep>0){const a=this.deltaUpdateBasicResultList(o,s);if(a.length>0)return o.concat(t.getInitResultList(r.dataSourceStep,a))}return n!==!0?o:t.getInitResultList(r.dataSourceStep,s)}default:return o}}static dataCorrection(e,t,r,s){var n,o;try{const u=`step_${StepUtils.getStepInfo(r,s).step}`,l=index.jsonParser(e),f=index.jsonParser(t),d=(n=l[u])==null?void 0:n.result,c=(o=f[u])==null?void 0:o.result;if(!c||___default.default.isEqual(d.sort(this.idCmp),c.sort(this.idCmp)))return e;const p=this.findDeletedIds(d,c);if(p.length===0)return e;const m=r,h=this.getStepKeys(l).sort();return this.deleteRes(l,m,p,h),JSON.stringify(l)}catch(a){return console.error(a),e}}static idCmp(e,t){const r=e.id,s=t.id;return r<s?-1:r>s?1:0}static findDeletedIds(e,t){return this.findDeletedItems(t,e).map(r=>r.id)}static findDeletedItems(e,t){const r=[];return e.forEach(s=>{t.some(o=>o.id===s.id)||r.push(s)}),r}static getStepKeys(e){return Object.keys(e).map(t=>parseInt(t.replace("step_",""),10)).filter(t=>!isNaN(t))}static deleteRes(e,t,r,s){s.forEach(n=>{if(n>t){const o=e[`step_${n}`];if([ToolType.EToolName.FolderTag,ToolType.EToolName.Segmentation].includes(o.tool))return;if(o.dataSourceStep===t){const a=[];o.result=o.result.filter(u=>r.includes(u.sourceID)?(a.push(u.id),!1):!0),this.deleteRes(e,n,a,s)}else o.result=o.result.filter(a=>!r.includes(a.sourceID))}})}}module.exports=AnnotationDataUtils;
1
+ "use strict";var lbAnnotation=require("@labelbee/lb-annotation"),index=require("./index.js"),ToolType=require("../data/enums/ToolType.js"),_=require("lodash"),StepUtils=require("./StepUtils.js"),antd=require("antd"),lbUtils=require("@labelbee/lb-utils");function _interopDefaultLegacy(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}var ___default=_interopDefaultLegacy(_);class AnnotationDataUtils{static traverseDF(t,s,e,i){s(t,e,i),typeof t=="object"&&t!==null&&(Array.isArray(t)?t.forEach((a,r)=>{this.traverseDF(a,s,r,t)}):Object.keys(t).forEach(a=>{this.traverseDF(t[a],s,a,t)}))}static getNextPath(t){var s,e,i;const{prePath:a,preMappingImgList:r,nextMappingImgList:n}=t,o=(e=(s=r==null?void 0:r.find(c=>c.path===a))==null?void 0:s.calib)==null?void 0:e.calName;return(i=n.find(c=>{var l;return((l=c.calib)==null?void 0:l.calName)===o}))==null?void 0:i.path}static copyResultItemHandler(t){const{item:s,key:e,parent:i,mappingImgList:a,preMappingImgList:r}=t,n=e===void 0?void 0:i[e];return e==="id"&&(i.id=lbAnnotation.uuid(8,62)),e==="imageName"&&(i.imageName=this.getNextPath({prePath:s,preMappingImgList:r,nextMappingImgList:a})),{value:e===void 0?void 0:i[e],oldValue:n}}static copyResultChange(t){const{copyResult:s,step:e,currentResult:i,mappingImgList:a,preMappingImgList:r,valid:n}=t;try{const o=index.jsonParser(s),u=index.jsonParser(i);u.valid=n;const c=`step_${e}`;if(o[c]){const l=o[c],g=["result","resultRect"],v=new Map;if(g.forEach(d=>{l[d]&&this.traverseDF(l[d],(p,f,m)=>{const{value:D,oldValue:R}=this.copyResultItemHandler({item:p,key:f,parent:m,mappingImgList:a,preMappingImgList:r});d==="result"&&f==="id"&&D!==void 0&&R!==void 0&&v.set(R,D)})}),v.size){const d=l.resultRect;Array.isArray(d)&&d.forEach(p=>{const f=p.extId,m=v.get(f);f!==void 0&&m!==void 0&&(p.extId=m)})}const y=["resultRect","rects"],I=[];return this.traverseDF(l,(d,p,f)=>{___default.default.isString(p)&&y.includes(p)&&Array.isArray(d)&&(f[p]=d.filter(m=>m.imageName?!0:(I.push(m),!1)))}),I.length&&(console.log(I),antd.message.info(lbUtils.i18n.t("PartialResultsReplicationFailure"))),u[c]=l,JSON.stringify(u)}return s}catch(o){antd.message.info(lbUtils.i18n.t("FailedToCopyResults"))}}static isResultSourceMatchedDependence(t,s){const e=t==null?void 0:t.map(a=>a.sourceID).sort(),i=s==null?void 0:s.map(a=>a.id).sort();return ___default.default.isEqual(e,i)}static deltaUpdateBasicResultList(t,s){const e=t==null?void 0:t.map(i=>i.sourceID).sort();return s.filter(i=>!e.includes(i.id))}static getInitialResultList(t,s,e,i,a){const r=t!=null?t:[];switch(e.tool){case ToolType.EToolName.Tag:case ToolType.EToolName.Text:{if(e.dataSourceStep>0){const n=this.deltaUpdateBasicResultList(r,i);if(n.length>0)return r.concat(s.getInitResultList(e.dataSourceStep,n))}return a!==!0?r:s.getInitResultList(e.dataSourceStep,i)}default:return r}}static dataCorrection(t,s,e,i){var a,r;try{const o=`step_${StepUtils.getStepInfo(e,i).step}`,u=index.jsonParser(t),c=index.jsonParser(s),l=(a=u[o])==null?void 0:a.result,g=(r=c[o])==null?void 0:r.result;if(!g||___default.default.isEqual(l.sort(this.idCmp),g.sort(this.idCmp)))return t;const v=this.findDeletedIds(l,g);if(v.length===0)return t;const y=e,I=this.getStepKeys(u).sort();return this.deleteRes(u,y,v,I),JSON.stringify(u)}catch(n){return console.error(n),t}}static idCmp(t,s){const e=t.id,i=s.id;return e<i?-1:e>i?1:0}static findDeletedIds(t,s){return this.findDeletedItems(s,t).map(e=>e.id)}static findDeletedItems(t,s){const e=[];return t.forEach(i=>{s.some(r=>r.id===i.id)||e.push(i)}),e}static getStepKeys(t){return Object.keys(t).map(s=>parseInt(s.replace("step_",""),10)).filter(s=>!isNaN(s))}static deleteRes(t,s,e,i){i.forEach(a=>{if(a>s){const r=t[`step_${a}`];if([ToolType.EToolName.FolderTag,ToolType.EToolName.Segmentation].includes(r.tool))return;if(r.dataSourceStep===s){const n=[];r.result=r.result.filter(o=>e.includes(o.sourceID)?(n.push(o.id),!1):!0),this.deleteRes(t,a,n,i)}else r.result=r.result.filter(n=>!e.includes(n.sourceID))}})}}module.exports=AnnotationDataUtils;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var lbAnnotation=require("@labelbee/lb-annotation");exports.EPointCloudBoxRenderTrigger=void 0,function(t){t.Default="Default",t.UndoRedo="UndoRedo",t.ClearAll="ClearAll",t.Single="Single",t.SingleDelete="SingleDelete",t.SingleToggleValid="SingleToggleValid",t.SingleRotate="SingleRotate",t.MultiPaste="MultiPaste",t.MultiMove="MultiMove"}(exports.EPointCloudBoxRenderTrigger||(exports.EPointCloudBoxRenderTrigger={})),exports.EPointCloudBoxSingleModifiedType=void 0,function(t){t.ChangeAttribute="ChangeAttribute",t.Move="Move",t.ChangeDepth="ChangeDepth",t.ChangeSize="ChangeSize",t.ToggleValid="ToggleValid"}(exports.EPointCloudBoxSingleModifiedType||(exports.EPointCloudBoxSingleModifiedType={}));const checkRectanglesIntersect=(t,n)=>{const i=getAxes(t).concat(getAxes(n));for(const e of i){const o=projectRectangle(t,e),r=projectRectangle(n,e);if(!projectionsOverlap(o,r))return!1}return!0},getAxes=t=>{const n=[];for(let i=0;i<t.length;i++){const e=t[i],o=t[(i+1)%t.length],r={x:o.x-e.x,y:o.y-e.y},d={x:-r.y,y:r.x};n.push(d)}return n},projectRectangle=(t,n)=>{let i=dotProduct(t[0],n),e=i;for(const o of t){const r=dotProduct(o,n);r<i&&(i=r),r>e&&(e=r)}return{min:i,max:e}},projectionsOverlap=(t,n)=>!(t.max<n.min||n.max<t.min),dotProduct=(t,n)=>t.x*n.x+t.y*n.y,getIntersectingBoxIds=(t,n)=>{const i=[];return n.forEach(e=>{const{polygonPointList:o}=lbAnnotation.getCuboidFromPointCloudBox(e);checkRectanglesIntersect(t,o)&&i.push(e.id)}),i},getAddBoxId=(t,n)=>{const i=t.map(o=>o.id),e=n.map(o=>o.id);return i.find(o=>!e.includes(o))||""},getDeletedBox=(t,n)=>{const i=t.map(e=>e.id);return n.find(e=>!i.includes(e.id))},getValidChangedBox=(t,n)=>t.find(e=>{const o=n.find(r=>r.id===e.id);return o&&o.valid!==e.valid}),getRotationChangedBox=(t,n)=>t.find(e=>{const o=n.find(r=>r.id===e.id);return o&&o.rotation!==e.rotation}),getIntersectingBoxIdsOfBox=(t,n)=>{const{polygonPointList:i}=lbAnnotation.getCuboidFromPointCloudBox(t);return{ids:getIntersectingBoxIds(i,n.filter(o=>o.id!==t.id)),rect:i}},getModifiedBox=(t,n)=>{const i=(e,o)=>e.attribute===o.attribute&&e.center.x===o.center.x&&e.center.y===o.center.y&&e.depth===o.depth&&e.width===o.width&&e.height===o.height;for(const e of t){const o=n.find(r=>r.id===e.id);if(o&&!i(e,o)){let r;if(o.attribute!==e.attribute?r=exports.EPointCloudBoxSingleModifiedType.ChangeAttribute:o.center.x!==e.center.x||o.center.y!==e.center.y?r=exports.EPointCloudBoxSingleModifiedType.Move:o.depth!==e.depth?r=exports.EPointCloudBoxSingleModifiedType.ChangeDepth:(o.width!==e.width||o.height!==e.height)&&(r=exports.EPointCloudBoxSingleModifiedType.ChangeSize),r!==void 0)return{modifiedType:r,box:e}}}},calcResetAreasAndBoxIds=(t,n,i)=>{try{switch(t){case exports.EPointCloudBoxRenderTrigger.Single:if(n.length>i.length){const e=getAddBoxId(n,i);return e?{modifiedBoxIds:[e],resetAreas:[]}:{modifiedBoxIds:[],resetAreas:[]}}else{const e=[],o=[],r=getModifiedBox(n,i);if(r&&(e.push(r.box.id),r.modifiedType===exports.EPointCloudBoxSingleModifiedType.ChangeSize||r.modifiedType===exports.EPointCloudBoxSingleModifiedType.Move)){const d=i.find(l=>l.id===r.box.id),{ids:s,rect:c}=getIntersectingBoxIdsOfBox(d,n);e.push(...s),o.push(c)}return{modifiedBoxIds:e,resetAreas:o}}case exports.EPointCloudBoxRenderTrigger.SingleDelete:if(n.length<i.length){const e=getDeletedBox(n,i);if(e){const r=[lbAnnotation.getCuboidFromPointCloudBox(e).polygonPointList],d=[];if(n.length>1){const{ids:s}=getIntersectingBoxIdsOfBox(e,n);s.length&&d.push(...s)}return{modifiedBoxIds:d,resetAreas:r}}return{modifiedBoxIds:[],resetAreas:[]}}return{modifiedBoxIds:[],resetAreas:[]};case exports.EPointCloudBoxRenderTrigger.SingleRotate:if(getRotationChangedBox(n,i)){const e=getRotationChangedBox(n,i);if(e){const o=i.find(s=>s.id===e.id),{ids:r,rect:d}=getIntersectingBoxIdsOfBox(o,n);return{modifiedBoxIds:[e.id,...r],resetAreas:[d]}}}return{modifiedBoxIds:[],resetAreas:[]};case exports.EPointCloudBoxRenderTrigger.SingleToggleValid:if(getValidChangedBox(n,i)){const e=getValidChangedBox(n,i);return e?{modifiedBoxIds:[e.id],resetAreas:[]}:{modifiedBoxIds:[],resetAreas:[]}}return{modifiedBoxIds:[],resetAreas:[]};case exports.EPointCloudBoxRenderTrigger.MultiPaste:case exports.EPointCloudBoxRenderTrigger.MultiMove:case exports.EPointCloudBoxRenderTrigger.Default:case exports.EPointCloudBoxRenderTrigger.UndoRedo:case exports.EPointCloudBoxRenderTrigger.ClearAll:default:return{modifiedBoxIds:[],resetAreas:[]}}}catch(e){return console.error("calcResetAreasAndBoxIds error:",e),{modifiedBoxIds:[],resetAreas:[]}}};exports.calcResetAreasAndBoxIds=calcResetAreasAndBoxIds;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _=require("lodash"),lbAnnotation=require("@labelbee/lb-annotation");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,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},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const jsonParser=(e,t={})=>{try{return typeof e=="string"?JSON.parse(e):___default.default.isObject(e)?e:t}catch(r){return t}},classnames=e=>{if(Array.isArray(e))return e.filter(t=>t).join(" ");if(___default.default.isObject(e)){const t=[];return Object.keys(e).forEach(r=>{e[r]&&t.push(r)}),t.join(" ")}return""},getBoundingRect=e=>{let t=Infinity,r=Infinity,n=-Infinity,o=-Infinity;for(const i of e)t=Math.min(t,i.x),r=Math.min(r,i.y),n=Math.max(n,i.x),o=Math.max(o,i.y);return{x:t,y:r,width:n-t,height:o-r}},isBoundingRectInImage=(()=>{const e=(t,r)=>{const n=Math.max(t.x,r.x),o=Math.max(t.y,r.y),i=Math.min(t.x+t.width,r.x+r.width),s=Math.min(t.y+t.height,r.y+r.height),a=i-n,u=s-o;return a>=0&&u>=0?{x:n,y:o,width:a,height:u}:null};return(t,r,n)=>{if(n[r]){const o=n[r].width,i=n[r].height;return e(t,{x:0,y:0,width:o,height:i})!==null}return!1}})(),getRectPointCloudBox=e=>{var t;const{pointCloudBox:r,mappingData:n,imageSizes:o}=e,{transferViewData:i}=(t=lbAnnotation.pointCloudLidar2image(r,n.calib))!=null?t:{};if(!i)return;const s=i.reduce((c,p)=>p.type==="line"?[...c,...p.pointList]:c,[]),a=__spreadProps(__spreadValues({},getBoundingRect(s)),{imageName:n.path});if(isBoundingRectInImage(a,n.path,o))return a};exports.classnames=classnames,exports.getBoundingRect=getBoundingRect,exports.getRectPointCloudBox=getRectPointCloudBox,exports.jsonParser=jsonParser;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _=require("lodash"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var ___default=_interopDefaultLegacy(_),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(n,t,e)=>t in n?__defProp(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,__spreadValues=(n,t)=>{for(var e in t||(t={}))__hasOwnProp.call(t,e)&&__defNormalProp(n,e,t[e]);if(__getOwnPropSymbols)for(var e of __getOwnPropSymbols(t))__propIsEnum.call(t,e)&&__defNormalProp(n,e,t[e]);return n},__spreadProps=(n,t)=>__defProps(n,__getOwnPropDescs(t));const jsonParser=(n,t={})=>{try{return typeof n=="string"?JSON.parse(n):___default.default.isObject(n)?n:t}catch(e){return t}},classnames=n=>{if(Array.isArray(n))return n.filter(t=>t).join(" ");if(___default.default.isObject(n)){const t=[];return Object.keys(n).forEach(e=>{n[e]&&t.push(e)}),t.join(" ")}return""},getBoundingRect=n=>{let t=Infinity,e=Infinity,r=-Infinity,o=-Infinity;for(const i of n)t=Math.min(t,i.x),e=Math.min(e,i.y),r=Math.max(r,i.x),o=Math.max(o,i.y);return{x:t,y:e,width:r-t,height:o-e}},isBoundingRectInImage=(()=>{const n=(t,e)=>{const r=Math.max(t.x,e.x),o=Math.max(t.y,e.y),i=Math.min(t.x+t.width,e.x+e.width),c=Math.min(t.y+t.height,e.y+e.height),s=i-r,a=c-o;return s>=0&&a>=0?{x:r,y:o,width:s,height:a}:null};return(t,e,r)=>{if(r[e]){const o=r[e].width,i=r[e].height;return n(t,{x:0,y:0,width:o,height:i})!==null}return!1}})(),getRectPointCloudBox=n=>{var t;const{pointCloudBox:e,mappingData:r,imageSizes:o}=n,{transferViewData:i}=(t=lbAnnotation.pointCloudLidar2image(e,r.calib))!=null?t:{};if(!i)return;const c=i.reduce((u,p)=>p.type==="line"?[...u,...p.pointList]:u,[]),s=__spreadProps(__spreadValues({},getBoundingRect(c)),{imageName:r.path});if(isBoundingRectInImage(s,r.path,o))return s},generatePointCloudBoxRects=(n,t)=>{var e;const{pointCloudBox:r,mappingImgList:o,imageSizes:i}=n,s=o.map(a=>getRectPointCloudBox({pointCloudBox:r,mappingData:a,imageSizes:i})).filter(a=>a!==void 0);if(s.length>0){const a=(e=t==null?void 0:t.prepareRectsFn)!=null?e:void 0,u=a?a(s,r):s;u.length>0&&Object.assign(r,{rects:u})}};exports.classnames=classnames,exports.generatePointCloudBoxRects=generatePointCloudBoxRects,exports.getBoundingRect=getBoundingRect,exports.getRectPointCloudBox=getRectPointCloudBox,exports.isBoundingRectInImage=isBoundingRectInImage,exports.jsonParser=jsonParser;
@@ -1 +1 @@
1
- "use strict";var index$7=require("../../components/customResizeHook/index.js"),index$5=require("../../constant/index.js"),antd=require("antd"),es=require("antd/es"),React=require("react"),index$b=require("./annotationOperation/index.js"),index$a=require("./annotationTips/index.js"),index$4=require("./sidebar/index.js"),index$c=require("./toolFooter/index.js"),index$9=require("./toolHeader/index.js"),reducer=require("../../store/annotation/reducer.js"),index$6=require("../../components/videoAnnotate/index.js"),reactRedux=require("react-redux"),ToolUtils=require("../../utils/ToolUtils.js"),index$d=require("../../components/pointCloudView/index.js"),dom=require("../../utils/dom.js"),index$8=require("../../utils/index.js"),index$3=require("../../components/predictTracking/previewResult/index.js"),ctx=require("../../store/ctx.js"),ToolType=require("../../data/enums/ToolType.js"),index=require("./LLMLayout/index.js"),index$1=require("./NLPLayout/index.js"),index$2=require("../../components/audioAnnotate/index.js"),icons=require("@ant-design/icons"),reactI18next=require("react-i18next"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e};const{Sider,Content}=es.Layout,layoutCls=`${index$5.prefix}-layout`,ImageAnnotate=e=>{var t;return React__default.default.createElement(React__default.default.Fragment,null,e.showTips===!0&&React__default.default.createElement(index$a,{path:e.path,tips:e.tips}),React__default.default.createElement(index$b,__spreadValues({},e)),React__default.default.createElement(index$c.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},PointCloudAnnotate=e=>{var t;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$d,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit,measureVisible:e.measureVisible}),React__default.default.createElement(index$c.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},AnnotatedArea=e=>{var t;const{stepList:a,step:l}=e,r=(t=reducer.getStepConfig(a,l))==null?void 0:t.tool,i=ToolUtils.isPointCloudTool(r),n=ToolUtils.isVideoTool(r);return i?React__default.default.createElement(PointCloudAnnotate,__spreadValues({},e)):n?React__default.default.createElement(index$6,{drawLayerSlot:e.drawLayerSlot,footer:e.footer}):React__default.default.createElement(ImageAnnotate,__spreadValues({},e))},ViewportProviderLayout=e=>{var t,a,l;const{t:r}=reactI18next.useTranslation(),{stepList:i,step:n}=e,o=(t=reducer.getStepConfig(i,n))==null?void 0:t.tool,d=![ToolType.EToolName.LLM,ToolType.EToolName.NLP].includes(o),u=![ToolType.EToolName.LLM,ToolType.EToolName.NLP].includes(o),c=[lbAnnotation.EPointCloudName.PointCloud].includes(o);return React__default.default.createElement(index$7.ViewportProvider,null,React__default.default.createElement(antd.Spin,{spinning:e.loading,indicator:React__default.default.createElement(icons.LoadingOutlined,null),tip:React__default.default.createElement("span",{style:{marginTop:200}},r("LoadingTips")),delay:500},React__default.default.createElement(es.Layout,{className:index$8.classnames([layoutCls,e.className]),style:(a=e.style)==null?void 0:a.layout},React__default.default.createElement("header",{className:`${layoutCls}__header`,style:(l=e.style)==null?void 0:l.header},React__default.default.createElement(index$9,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:d,hasHeaderOption:u,hasPredictTrackingIcon:c})),e.children)))},MainView=e=>{var t,a,l,r,i,n,o;const[d,u]=React.useState(void 0),c=(a=(t=e.style)==null?void 0:t.sider)==null?void 0:a.width,{stepList:m,step:f}=e,s=(l=reducer.getStepConfig(m,f))==null?void 0:l.tool,v=ToolType.EToolName.LLM===s,x=ToolType.EToolName.NLP===s,E=ToolUtils.isAudioTool(s);return v?React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(index,__spreadValues({},e))):x?React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(index$1,__spreadValues({},e))):E?React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(index$2,__spreadValues({},e))):React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(es.Layout,{className:dom.getClassName("layout","container")},e==null?void 0:e.leftSider,React__default.default.createElement(Content,{className:`${layoutCls}__content`},React__default.default.createElement(AnnotatedArea,__spreadValues({},e)),React__default.default.createElement(index$3,null)),React__default.default.createElement(Sider,{className:`${layoutCls}__side`,width:(r=d!=null?d:c)!=null?r:240,style:(i=e.style)==null?void 0:i.sider},React__default.default.createElement(index$4.default,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:u,propsSiderWidth:(o=(n=e.style)==null?void 0:n.sider)==null?void 0:o.width}))))},mapStateToProps=({annotation:e})=>{var t,a,l;const{imgList:r,loading:i}=e,n=(t=r[e.imgIndex])!=null?t:{};return{path:(l=(a=n==null?void 0:n.path)!=null?a:n==null?void 0:n.url)!=null?l:"",loading:i}};var MainView$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(MainView);module.exports=MainView$1;
1
+ "use strict";var index$7=require("../../components/customResizeHook/index.js"),index$5=require("../../constant/index.js"),antd=require("antd"),es=require("antd/es"),React=require("react"),index$b=require("./annotationOperation/index.js"),index$a=require("./annotationTips/index.js"),index$4=require("./sidebar/index.js"),index$c=require("./toolFooter/index.js"),index$9=require("./toolHeader/index.js"),reducer=require("../../store/annotation/reducer.js"),index$6=require("../../components/videoAnnotate/index.js"),reactRedux=require("react-redux"),ToolUtils=require("../../utils/ToolUtils.js"),index$d=require("../../components/pointCloudView/index.js"),dom=require("../../utils/dom.js"),index$8=require("../../utils/index.js"),index$3=require("../../components/predictTracking/previewResult/index.js"),ctx=require("../../store/ctx.js"),ToolType=require("../../data/enums/ToolType.js"),index=require("./LLMLayout/index.js"),index$1=require("./NLPLayout/index.js"),index$2=require("../../components/audioAnnotate/index.js"),icons=require("@ant-design/icons"),reactI18next=require("react-i18next"),lbAnnotation=require("@labelbee/lb-annotation");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React),__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e};const{Sider,Content}=es.Layout,layoutCls=`${index$5.prefix}-layout`,ImageAnnotate=e=>{var t;return React__default.default.createElement(React__default.default.Fragment,null,e.showTips===!0&&React__default.default.createElement(index$a,{path:e.path,tips:e.tips}),React__default.default.createElement(index$b,__spreadValues({},e)),React__default.default.createElement(index$c.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},PointCloudAnnotate=e=>{var t;return React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(index$d,{drawLayerSlot:e.drawLayerSlot,checkMode:e.checkMode,intelligentFit:e.intelligentFit,measureVisible:e.measureVisible}),React__default.default.createElement(index$c.default,{style:(t=e.style)==null?void 0:t.footer,mode:e.mode,footer:e==null?void 0:e.footer}))},AnnotatedArea=e=>{var t;const{stepList:a,step:l}=e,r=(t=reducer.getStepConfig(a,l))==null?void 0:t.tool,i=ToolUtils.isPointCloudTool(r),n=ToolUtils.isVideoTool(r);return i?React__default.default.createElement(PointCloudAnnotate,__spreadValues({},e)):n?React__default.default.createElement(index$6,{drawLayerSlot:e.drawLayerSlot,footer:e.footer,annotationBefore:e==null?void 0:e.annotationBefore}):React__default.default.createElement(ImageAnnotate,__spreadValues({},e))},ViewportProviderLayout=e=>{var t,a,l;const{t:r}=reactI18next.useTranslation(),{stepList:i,step:n}=e,o=(t=reducer.getStepConfig(i,n))==null?void 0:t.tool,d=![ToolType.EToolName.LLM,ToolType.EToolName.NLP].includes(o),u=![ToolType.EToolName.LLM,ToolType.EToolName.NLP].includes(o),c=[lbAnnotation.EPointCloudName.PointCloud].includes(o);return React__default.default.createElement(index$7.ViewportProvider,null,React__default.default.createElement(antd.Spin,{spinning:e.loading,indicator:React__default.default.createElement(icons.LoadingOutlined,null),tip:React__default.default.createElement("span",{style:{marginTop:200}},r("LoadingTips")),delay:500},React__default.default.createElement(es.Layout,{className:index$8.classnames([layoutCls,e.className]),style:(a=e.style)==null?void 0:a.layout},React__default.default.createElement("header",{className:`${layoutCls}__header`,style:(l=e.style)==null?void 0:l.header},React__default.default.createElement(index$9,{header:e==null?void 0:e.header,headerName:e.headerName,goBack:e.goBack,exportData:e.exportData,hasLangNode:d,hasHeaderOption:u,hasPredictTrackingIcon:c})),e.children)))},MainView=e=>{var t,a,l,r,i,n,o;const[d,u]=React.useState(void 0),c=(a=(t=e.style)==null?void 0:t.sider)==null?void 0:a.width,{stepList:m,step:f}=e,s=(l=reducer.getStepConfig(m,f))==null?void 0:l.tool,v=ToolType.EToolName.LLM===s,x=ToolType.EToolName.NLP===s,E=ToolUtils.isAudioTool(s);return v?React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(index,__spreadValues({},e))):x?React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(index$1,__spreadValues({},e))):E?React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(index$2,__spreadValues({},e))):React__default.default.createElement(ViewportProviderLayout,__spreadValues({},e),React__default.default.createElement(es.Layout,{className:dom.getClassName("layout","container")},e==null?void 0:e.leftSider,React__default.default.createElement(Content,{className:`${layoutCls}__content`},React__default.default.createElement(AnnotatedArea,__spreadValues({},e)),React__default.default.createElement(index$3,null)),React__default.default.createElement(Sider,{className:`${layoutCls}__side`,width:(r=d!=null?d:c)!=null?r:240,style:(i=e.style)==null?void 0:i.sider},React__default.default.createElement(index$4.default,{sider:e==null?void 0:e.sider,enableColorPicker:e==null?void 0:e.enableColorPicker,setSiderWidth:u,propsSiderWidth:(o=(n=e.style)==null?void 0:n.sider)==null?void 0:o.width}))))},mapStateToProps=({annotation:e})=>{var t,a,l;const{imgList:r,loading:i}=e,n=(t=r[e.imgIndex])!=null?t:{};return{path:(l=(a=n==null?void 0:n.path)!=null?a:n==null?void 0:n.url)!=null?l:"",loading:i}};var MainView$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(MainView);module.exports=MainView$1;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux"),StepUtils=require("../../../../utils/StepUtils.js"),reactI18next=require("react-i18next"),ctx=require("../../../../store/ctx.js"),index$1=require("../../../../constant/index.js"),index=require("../../../../utils/index.js"),antd=require("antd"),icons=require("@ant-design/icons");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,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const sidebarCls=`${index$1.prefix}-sidebar`,getAnnotatedList=(e,t)=>{const n=(e==null?void 0:e.attributeList)||[];return t.map(i=>{var s,c;const r=((c=(s=n.filter(u=>u.value===i.attribute))==null?void 0:s[0])==null?void 0:c.key)||"";return __spreadProps(__spreadValues({},i),{label:r})})},NLPAnnotatedList=e=>{var t,n;const[i,s]=React.useState(0),c=React.useRef(null),{toolInstance:r,checkMode:u,stepInfo:v}=e,{t:l}=reactI18next.useTranslation(),m=index.jsonParser(v.config),[_,x]=React.useState("");React.useEffect(()=>(r&&r.on("changeAttributeSidebar",o=>{s(a=>a+1)}),()=>{r==null||r.unbindAll("changeAttributeSidebar")}),[r,c]);const[f]=r.exportData(),g=(n=(t=f==null?void 0:f[0])==null?void 0:t.textAnnotation)!=null?n:[],d=getAnnotatedList(m,g),b=o=>{let a=o===_?"":o;r==null||r.setHighlightKey(a),x(a)},P=o=>{r==null||r.deleteTextAnnotation(o.id)};return(d==null?void 0:d.length)===0?null:React__default.default.createElement("div",{className:`${sidebarCls}__content__NLPList`},d.map((o,a)=>{const L=_===o.id;return React__default.default.createElement("div",{key:a,className:index.classnames({[`${sidebarCls}__content__NLPList__item`]:!0,[`${sidebarCls}__content__NLPList__item__active`]:L}),onClick:()=>b(o.id)},React__default.default.createElement("span",{className:`${sidebarCls}__content__NLPList__item__text`},React__default.default.createElement(antd.Tooltip,{title:o.text,overlayInnerStyle:{maxHeight:"400px",overflow:"auto"}},React__default.default.createElement("span",null,`${o.label||l("NoAttribute")}\uFF0C${l("textTool")}\uFF1A${o.text}`))),!u&&React__default.default.createElement(antd.Popconfirm,{title:l("DeleteCommentConfirm"),placement:"topRight",okText:l("Confirm"),cancelText:l("Cancel"),getPopupContainer:p=>p.parentElement,onConfirm:()=>P(o),overlayClassName:`${index$1.prefix}-pop-confirm`},React__default.default.createElement(icons.CloseOutlined,{className:`${sidebarCls}-pop-remove`,onClick:p=>{p.stopPropagation()}})))}))},mapStateToProps=e=>{var t,n;const i=StepUtils.getCurrentStepInfo((t=e.annotation)==null?void 0:t.step,(n=e.annotation)==null?void 0:n.stepList);return{toolInstance:e.annotation.toolInstance,stepInfo:i}};var NLPAnnotatedList$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(NLPAnnotatedList);exports.default=NLPAnnotatedList$1,exports.sidebarCls=sidebarCls;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),reactRedux=require("react-redux"),StepUtils=require("../../../../utils/StepUtils.js"),reactI18next=require("react-i18next"),ctx=require("../../../../store/ctx.js"),index$2=require("../../../../constant/index.js"),index=require("../../../../utils/index.js"),antd=require("antd"),icons=require("@ant-design/icons"),index$1=require("../../../../components/longText/index.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,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));const sidebarCls=`${index$2.prefix}-sidebar`,getAnnotatedList=(e,t,n)=>{const a=(e==null?void 0:e.attributeList)||[],u=t.map(l=>{var s,r;const d=((r=(s=a.filter(p=>p.value===l.attribute))==null?void 0:s[0])==null?void 0:r.key)||"";return __spreadProps(__spreadValues({},l),{label:d})});return(n==null?void 0:n.length)>0?u.filter(l=>n.includes(l.attribute)):u},NLPAnnotatedList=e=>{var t,n,a;const[u,l]=React.useState(0),s=React.useRef(null),{toolInstance:r,checkMode:d,stepInfo:p}=e,{t:c}=reactI18next.useTranslation(),x=index.jsonParser(p.config),[v,g]=React.useState("");React.useEffect(()=>(r&&r.on("changeAttributeSidebar",o=>{l(i=>i+1)}),()=>{r==null||r.unbindAll("changeAttributeSidebar")}),[r,s]);const[m]=r.exportData(),P=(n=(t=m==null?void 0:m[0])==null?void 0:t.textAnnotation)!=null?n:[],_=getAnnotatedList(x,P,(a=r==null?void 0:r.attributeLockList)!=null?a:[]),b=o=>{let i=o===v?"":o;r==null||r.setHighlightKey(i),g(i)},h=o=>{r==null||r.deleteTextAnnotation(o.id)};return(_==null?void 0:_.length)===0?null:React__default.default.createElement("div",{className:`${sidebarCls}__content__NLPList`},_.map((o,i)=>{const y=v===o.id;return React__default.default.createElement("div",{key:i,className:index.classnames({[`${sidebarCls}__content__NLPList__item`]:!0,[`${sidebarCls}__content__NLPList__item__active`]:y}),onClick:()=>b(o.id)},React__default.default.createElement(antd.Row,{className:`${sidebarCls}__content__NLPList__item__text`},React__default.default.createElement(antd.Col,{span:7},React__default.default.createElement(index$1,{text:`${o.label}\uFF0C${c("textTool")}: `,openByText:!0,isToolTips:!0})),React__default.default.createElement(antd.Col,{span:16,offset:1},React__default.default.createElement(index$1,{text:o.text,openByText:!0,isToolTips:!0}))),!d&&React__default.default.createElement(antd.Popconfirm,{title:c("DeleteCommentConfirm"),placement:"topRight",okText:c("Confirm"),cancelText:c("Cancel"),getPopupContainer:f=>f.parentElement,onConfirm:()=>h(o),overlayClassName:`${index$2.prefix}-pop-confirm`},React__default.default.createElement(icons.CloseOutlined,{className:`${sidebarCls}-pop-remove`,onClick:f=>{f.stopPropagation()}})))}))},mapStateToProps=e=>{var t,n;const a=StepUtils.getCurrentStepInfo((t=e.annotation)==null?void 0:t.step,(n=e.annotation)==null?void 0:n.stepList);return{toolInstance:e.annotation.toolInstance,stepInfo:a}};var NLPAnnotatedList$1=reactRedux.connect(mapStateToProps,null,null,{context:ctx.LabelBeeContext})(NLPAnnotatedList);exports.default=NLPAnnotatedList$1,exports.sidebarCls=sidebarCls;
@@ -0,0 +1 @@
1
+ "use strict";var React=require("react"),antd=require("antd"),PointCloudContext=require("../../../../../../components/pointCloudView/PointCloudContext.js"),lbUtils=require("@labelbee/lb-utils"),index_module=require("./index.module.scss.js");function _interopDefaultLegacy(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var React__default=_interopDefaultLegacy(React);const marks={.5:.5,1:1,2:2,3:3,4:4},RectRotateSensitivitySlider=()=>{const e=React__default.default.useContext(PointCloudContext.PointCloudContext),t=i=>{e.setRectRotateSensitivity(i)};return React__default.default.createElement("div",{className:index_module.rectRotateSensitivitySlider},React__default.default.createElement("div",{className:index_module.title},lbUtils.i18n.t("RotationAngleSensitivity")),React__default.default.createElement("div",{className:"toolStyle"},React__default.default.createElement("div",{id:"style-rectRotateSensitivity"},React__default.default.createElement(antd.Slider,{min:.5,max:4,step:null,value:e.rectRotateSensitivity,onChange:t,marks}))))};module.exports=RectRotateSensitivitySlider;
@@ -0,0 +1 @@
1
+ "use strict";var styles={rectRotateSensitivitySlider:"index-module_rectRotateSensitivitySlider__tGjUn",title:"index-module_title__aAJW6"};module.exports=styles;