@cloud-app-dev/vidc 3.0.31 → 3.0.33

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.
File without changes
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import RIO from './index';
2
+ import ROI from './index';
3
3
 
4
4
  var App = function App() {
5
5
  return /*#__PURE__*/React.createElement("div", {
@@ -8,7 +8,7 @@ var App = function App() {
8
8
  height: 400,
9
9
  background: '#999'
10
10
  }
11
- }, /*#__PURE__*/React.createElement(RIO, {
11
+ }, /*#__PURE__*/React.createElement(ROI, {
12
12
  debug: true,
13
13
  isOpen: true,
14
14
  onChange: console.log
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  import _useUpdateEffect from "ahooks/es/useUpdateEffect";
2
2
  import React, { useEffect, useRef } from 'react';
3
- import useDrawRIO from '../useDrawRIO';
3
+ import useDrawROI from '../useDrawROI';
4
4
  import "./index.css";
5
5
 
6
6
  function RIO(_ref) {
@@ -13,14 +13,14 @@ function RIO(_ref) {
13
13
  rowItems = _ref.rowItems;
14
14
  var ref = useRef(null);
15
15
 
16
- var _useDrawRIO = useDrawRIO(ref, {
16
+ var _useDrawROI = useDrawROI(ref, {
17
17
  row: row,
18
18
  rowItems: rowItems
19
19
  }),
20
- open = _useDrawRIO.open,
21
- close = _useDrawRIO.close,
22
- clear = _useDrawRIO.clear,
23
- rio = _useDrawRIO.rio; // eslint-disable-next-line react-hooks/exhaustive-deps
20
+ open = _useDrawROI.open,
21
+ close = _useDrawROI.close,
22
+ clear = _useDrawROI.clear,
23
+ rio = _useDrawROI.rio; // eslint-disable-next-line react-hooks/exhaustive-deps
24
24
 
25
25
 
26
26
  useEffect(function () {
File without changes
File without changes
@@ -442,7 +442,11 @@ function RecordPlayer(_a) {
442
442
  onClose: onClose,
443
443
  onCloseAll: onCloseAll,
444
444
  timeMode: state.timeMode,
445
- download: download,
445
+ download: download ? function () {
446
+ var _a;
447
+
448
+ return download((_a = segmentItem.segments) !== null && _a !== void 0 ? _a : []);
449
+ } : undefined,
446
450
  snapshot: snapshot,
447
451
  oneWinExtTools: oneWinExtTools,
448
452
  allWinExtTools: allWinExtTools
@@ -41,7 +41,7 @@ export interface IRecordPlayerProps {
41
41
  /**
42
42
  * 录像下载回调
43
43
  */
44
- download?: () => void;
44
+ download?: (segments: ISegmentType[]) => void;
45
45
 
46
46
  /**
47
47
  * 截图
package/es/index.d.ts CHANGED
@@ -29,7 +29,7 @@ export { default as Picture } from './Picture';
29
29
  export { default as Player } from './Player';
30
30
  export { default as PlayerExt } from './PlayerExt';
31
31
  export { default as Progress } from './Progress';
32
- export { default as RIO } from './RIO';
32
+ export { default as ROI } from './ROI';
33
33
  export { default as ScreenPlayer } from './ScreenPlayer';
34
34
  export { default as SegmentPlayer } from './SegmentPlayer';
35
35
  export { default as Service } from './Service';
@@ -37,7 +37,8 @@ export { default as TableLayout } from './TableLayout';
37
37
  export { default as ThemeAntd } from './ThemeAntd';
38
38
  export { default as Timeout } from './Timeout';
39
39
  export { default as Tree } from './Tree';
40
- export { default as useDrawRIO } from './useDrawRIO';
40
+ export { default as useDrawROI } from './useDrawROI';
41
+ export { default as useEventEmitterHandle } from './useEventEmitterHandle';
41
42
  export { default as useFullscreen } from './useFullscreen';
42
43
  export { default as useHistory } from './useHistory';
43
44
  export { default as useInfiniteScroll } from './useInfiniteScroll';
package/es/index.js CHANGED
@@ -29,7 +29,7 @@ export { default as Picture } from './Picture';
29
29
  export { default as Player } from './Player';
30
30
  export { default as PlayerExt } from './PlayerExt';
31
31
  export { default as Progress } from './Progress';
32
- export { default as RIO } from './RIO';
32
+ export { default as ROI } from './ROI';
33
33
  export { default as ScreenPlayer } from './ScreenPlayer';
34
34
  export { default as SegmentPlayer } from './SegmentPlayer';
35
35
  export { default as Service } from './Service';
@@ -37,7 +37,8 @@ export { default as TableLayout } from './TableLayout';
37
37
  export { default as ThemeAntd } from './ThemeAntd';
38
38
  export { default as Timeout } from './Timeout';
39
39
  export { default as Tree } from './Tree';
40
- export { default as useDrawRIO } from './useDrawRIO';
40
+ export { default as useDrawROI } from './useDrawROI';
41
+ export { default as useEventEmitterHandle } from './useEventEmitterHandle';
41
42
  export { default as useFullscreen } from './useFullscreen';
42
43
  export { default as useHistory } from './useHistory';
43
44
  export { default as useInfiniteScroll } from './useInfiniteScroll';
@@ -1,13 +1,13 @@
1
1
  import { BasicTarget } from 'ahooks/lib/utils/domTarget';
2
- interface RIOOptions {
2
+ interface ROIOptions {
3
3
  row: number;
4
4
  rowItems: number;
5
5
  }
6
- declare function useDrawRIO(target: BasicTarget<HTMLCanvasElement>, { row, rowItems }: RIOOptions): {
6
+ declare function useDrawROI(target: BasicTarget<HTMLCanvasElement>, { row, rowItems }: ROIOptions): {
7
7
  open: () => void;
8
8
  close: () => void;
9
9
  clear: () => void;
10
10
  rio: number[][];
11
11
  status: string;
12
12
  };
13
- export default useDrawRIO;
13
+ export default useDrawROI;
@@ -31,7 +31,7 @@ import lineToPolygon from '@turf/line-to-polygon';
31
31
  import booleanDisjoint from '@turf/boolean-disjoint';
32
32
  import { useHotkeys } from 'react-hotkeys-hook';
33
33
 
34
- function useDrawRIO(target, _ref) {
34
+ function useDrawROI(target, _ref) {
35
35
  var row = _ref.row,
36
36
  rowItems = _ref.rowItems;
37
37
 
@@ -319,4 +319,4 @@ function useDrawRIO(target, _ref) {
319
319
  };
320
320
  }
321
321
 
322
- export default useDrawRIO;
322
+ export default useDrawROI;
@@ -0,0 +1,2 @@
1
+ declare function useEventEmitterHandle<T>(eventName: string, handle: (options: T) => void): void;
2
+ export default useEventEmitterHandle;
@@ -0,0 +1,21 @@
1
+ import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
2
+ import _useLatest from "ahooks/es/useLatest";
3
+ import { useEffect } from 'react';
4
+
5
+ function useEventEmitterHandle(eventName, handle) {
6
+ var handlerRef = _useLatest(handle);
7
+
8
+ useEffect(function () {
9
+ var eventListener = function eventListener(event) {
10
+ return handlerRef.current(event);
11
+ };
12
+
13
+ _SocketEmitter.on(eventName, eventListener);
14
+
15
+ return function () {
16
+ return _SocketEmitter.off(eventName, eventListener);
17
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
18
+ }, [eventName]);
19
+ }
20
+
21
+ export default useEventEmitterHandle;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "name": "@cloud-app-dev/vidc",
4
4
  "description": "Video Image Data Componennts",
5
- "version": "3.0.31",
5
+ "version": "3.0.33",
6
6
  "scripts": {
7
7
  "start": "dumi dev",
8
8
  "docs:build": "dumi build",