@cloud-app-dev/vidc 4.0.21 → 4.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/AppContext/index.js +1 -1
- package/es/CustomRenderSelect/index.js +0 -1
- package/es/Drag/DragAndDropItem.js +0 -1
- package/es/GridList/hook.d.ts +1 -1
- package/es/GridList/utils.d.ts +2 -2
- package/es/LoaderScript/utils.d.ts +1 -1
- package/es/Map/BasicMap/AMapInstance.js +2 -0
- package/es/Map/BasicMap/LeafletInstance.js +4 -2
- package/es/Map/ClusterLayer/hook.d.ts +1 -1
- package/es/Map/ClusterLayer/hook.js +6 -2
- package/es/Map/InfoWindow/MakerLikeWindow.js +21 -4
- package/es/Map/LevelCenter/DragMarker/index.js +1 -0
- package/es/Map/MouseTool/useMouseTools.js +2 -1
- package/es/Map/SinglePoint/index.js +1 -0
- package/es/Map/points.d.ts +24 -0
- package/es/Picture/component/DefaultRects/RectInfo.js +3 -1
- package/es/Picture/component/DefaultRects/utils.js +1 -1
- package/es/Picture/component/RectMenu/index.js +6 -0
- package/es/Picture/component/RectMenu/utils.d.ts +2 -2
- package/es/Picture/utils.d.ts +11 -11
- package/es/Player/api/index.d.ts +4 -4
- package/es/Player/contraller_bar/bar.d.ts +1 -1
- package/es/Player/contraller_bar/volume.js +1 -1
- package/es/Player/util.d.ts +1 -1
- package/es/ScreenPlayer/LiveTools.js +7 -7
- package/es/ScreenPlayer/RecordTools.d.ts +1 -1
- package/es/ScreenPlayer/RecordTools.js +24 -52
- package/es/ScreenPlayer/useTimeSlider.js +45 -40
- package/es/ScreenPlayer/utils.d.ts +1 -1
- package/es/recorder/index.d.ts +1 -1
- package/es/treeHelper/index.d.ts +3 -3
- package/es/utils.d.ts +1 -1
- package/es/uuid/index.d.ts +1 -5
- package/es/uuid/index.js +18 -5
- package/package.json +2 -4
- package/tsconfig.json +1 -1
package/es/AppContext/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import nextTick from "../nextTick";
|
|
|
17
17
|
import SocketEmitter from "../SocketEmitter";
|
|
18
18
|
import { _LOGIN_STATUS_EVENT_CHANGE_, _LOGIN_STATUS_SESSION_, _OPERATION_EVENT_CHANGE_, _OPERATION_SESSION_, _STORE_EVENT_CHANGE_, _STORE_SESSION_, _USER_EVENT_CHANGE_, _USER_SESSION_ } from "./static";
|
|
19
19
|
import Sync from "./Sync";
|
|
20
|
-
var Context = /*#__PURE__*/React.createContext(
|
|
20
|
+
var Context = /*#__PURE__*/React.createContext({});
|
|
21
21
|
function Provider(_ref) {
|
|
22
22
|
var children = _ref.children;
|
|
23
23
|
var _useState = useState({
|
|
@@ -23,7 +23,6 @@ function CustomRenderSelect(_ref) {
|
|
|
23
23
|
_ref$selectAotoClose = _ref.selectAotoClose,
|
|
24
24
|
selectAotoClose = _ref$selectAotoClose === void 0 ? true : _ref$selectAotoClose,
|
|
25
25
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
-
//@ts-ignore
|
|
27
26
|
var classname = useMemo(function () {
|
|
28
27
|
return "custom-render-select-dropdown-".concat(uuid());
|
|
29
28
|
}, []);
|
|
@@ -21,7 +21,6 @@ function DragAndDropItem(_ref) {
|
|
|
21
21
|
onDropEnd = _ref.onDropEnd,
|
|
22
22
|
_ref$disabledCopyElem = _ref.disabledCopyElement,
|
|
23
23
|
disabledCopyElement = _ref$disabledCopyElem === void 0 ? true : _ref$disabledCopyElem;
|
|
24
|
-
//@ts-ignore
|
|
25
24
|
var id = useMemo(function () {
|
|
26
25
|
return dragId || "dragId-".concat(uuid());
|
|
27
26
|
}, [dragId]);
|
package/es/GridList/hook.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare function useConstRef<T>(value: T): ConstRef<T>;
|
|
|
5
5
|
export declare function useWindowSize(): ElementSize;
|
|
6
6
|
export declare function useElementSize(ref: RefObject<Element>): ElementSize | null;
|
|
7
7
|
export declare function useWindowScroll(): ElementScroll;
|
|
8
|
-
export declare function useElementWindowOffset(ref: RefObject<HTMLElement>): number;
|
|
8
|
+
export declare function useElementWindowOffset(ref: RefObject<HTMLElement>): number | null;
|
|
9
9
|
export declare function useIntersecting(ref: RefObject<HTMLElement>, rootMargin: string): boolean;
|
|
10
10
|
export declare function useGridListContainerData(ref: RefObject<HTMLElement>): GridListContainerData;
|
|
11
11
|
export declare function useGridListConfigData<P>(containerData: GridListContainerData, props: GridListProps<P>): GridListConfigData<P> | null;
|
package/es/GridList/utils.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export declare function getElementSize(element: Element): ElementSize;
|
|
|
5
5
|
export declare function isSameElementScroll(a: ElementScroll, b: ElementScroll): boolean;
|
|
6
6
|
export declare function getWindowScroll(): ElementScroll;
|
|
7
7
|
export declare function getElementOffset(element: Element): number;
|
|
8
|
-
export declare function getColumnWidth(columnCount: number | null, gridGap: number | null, elementWidth: number | null): number;
|
|
9
|
-
export declare function getGridRowStart<P>(cell: GridListCell<P>, renderData: GridListRenderData<P> | null): string;
|
|
8
|
+
export declare function getColumnWidth(columnCount: number | null, gridGap: number | null, elementWidth: number | null): number | null;
|
|
9
|
+
export declare function getGridRowStart<P>(cell: GridListCell<P>, renderData: GridListRenderData<P> | null): string | undefined;
|
|
@@ -5,6 +5,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
8
9
|
/// <reference path="../AMap.d.ts" />
|
|
9
10
|
var AMapInstance = /*#__PURE__*/function () {
|
|
10
11
|
function AMapInstance(ele, config) {
|
|
@@ -55,6 +56,7 @@ var AMapInstance = /*#__PURE__*/function () {
|
|
|
55
56
|
}, {
|
|
56
57
|
key: "mapReset",
|
|
57
58
|
value: function mapReset() {
|
|
59
|
+
//@ts-ignore
|
|
58
60
|
this.setZoomAndCenter(this.config.zoom, this.config.center);
|
|
59
61
|
}
|
|
60
62
|
}, {
|
|
@@ -23,7 +23,8 @@ var LeafletInstance = /*#__PURE__*/function () {
|
|
|
23
23
|
maxZoom = _this$config.maxZoom,
|
|
24
24
|
minZoom = _this$config.minZoom,
|
|
25
25
|
crsStr = _this$config.crs,
|
|
26
|
-
url = _this$config.url,
|
|
26
|
+
_this$config$url = _this$config.url,
|
|
27
|
+
url = _this$config$url === void 0 ? '' : _this$config$url,
|
|
27
28
|
zoomOffset = _this$config.zoomOffset,
|
|
28
29
|
center = _this$config.center,
|
|
29
30
|
zoom = _this$config.zoom,
|
|
@@ -72,7 +73,8 @@ var LeafletInstance = /*#__PURE__*/function () {
|
|
|
72
73
|
value: function mapReset() {
|
|
73
74
|
var _this$config2 = this.config,
|
|
74
75
|
center = _this$config2.center,
|
|
75
|
-
zoom = _this$config2.zoom
|
|
76
|
+
_this$config2$zoom = _this$config2.zoom,
|
|
77
|
+
zoom = _this$config2$zoom === void 0 ? 1 : _this$config2$zoom;
|
|
76
78
|
this.setZoomAndCenter(zoom, center);
|
|
77
79
|
}
|
|
78
80
|
}, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference path="../AMap.d.ts" />
|
|
2
2
|
import { MapPoint, Marker, LClusterInterface } from '../interface';
|
|
3
3
|
import './index.less';
|
|
4
|
-
export declare function useMarkerCluster(onPointClick?: (point: MapPoint) => void): LClusterInterface & AMap.MarkerCluster;
|
|
4
|
+
export declare function useMarkerCluster(onPointClick?: (point: MapPoint) => void): (LClusterInterface & AMap.MarkerCluster) | null;
|
|
5
5
|
export declare function useMarkers(points?: MapPoint[]): Marker[];
|
|
@@ -10,6 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
13
14
|
/// <reference path="../AMap.d.ts" />
|
|
14
15
|
import { useContext, useEffect, useRef, useState } from 'react';
|
|
15
16
|
import useMapType from "../hook/useMapType";
|
|
@@ -36,6 +37,7 @@ export function useMarkerCluster(onPointClick) {
|
|
|
36
37
|
var L = window.L;
|
|
37
38
|
var clusterGroup = L.markerClusterGroup(clusterOptions);
|
|
38
39
|
clusterGroup.addTo(instance.map);
|
|
40
|
+
//@ts-ignore
|
|
39
41
|
clusterRef.current = clusterGroup;
|
|
40
42
|
}
|
|
41
43
|
if (type.AMap) {
|
|
@@ -48,7 +50,7 @@ export function useMarkerCluster(onPointClick) {
|
|
|
48
50
|
content: data.deviceName,
|
|
49
51
|
direction: 'top'
|
|
50
52
|
});
|
|
51
|
-
onPointClick
|
|
53
|
+
if (onPointClick) context.marker.on('click', function () {
|
|
52
54
|
return onPointClick(data);
|
|
53
55
|
});
|
|
54
56
|
}
|
|
@@ -58,8 +60,9 @@ export function useMarkerCluster(onPointClick) {
|
|
|
58
60
|
return;
|
|
59
61
|
}
|
|
60
62
|
var lnglat = e === null || e === void 0 ? void 0 : e.lnglat;
|
|
61
|
-
lnglat
|
|
63
|
+
if (lnglat) instance.setZoomAndCenter(instance.getZoom() + 1, lnglat);
|
|
62
64
|
});
|
|
65
|
+
//@ts-ignore
|
|
63
66
|
clusterRef.current = cluster;
|
|
64
67
|
});
|
|
65
68
|
}
|
|
@@ -68,6 +71,7 @@ export function useMarkerCluster(onPointClick) {
|
|
|
68
71
|
}, []);
|
|
69
72
|
useUnmount(function () {
|
|
70
73
|
try {
|
|
74
|
+
//@ts-ignore
|
|
71
75
|
instance.map.remove(clusterRef.current);
|
|
72
76
|
} catch (_) {}
|
|
73
77
|
});
|
|
@@ -7,13 +7,15 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
7
7
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
8
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
9
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
10
11
|
/// <reference path="../AMap.d.ts" />
|
|
11
12
|
|
|
12
13
|
import React, { useContext, useEffect, useRef } from 'react';
|
|
13
|
-
import ReactDOM from 'react-dom';
|
|
14
|
+
// import ReactDOM from 'react-dom';
|
|
14
15
|
import { mapContext } from "../Context";
|
|
15
16
|
import useMapType from "../hook/useMapType";
|
|
16
17
|
import { useUnmount, useEventListener } from 'ahooks';
|
|
18
|
+
import { createRoot } from 'react-dom/client';
|
|
17
19
|
var maxIndex = 20;
|
|
18
20
|
export default function MakerLikeWindow(_ref) {
|
|
19
21
|
var children = _ref.children,
|
|
@@ -33,6 +35,7 @@ export default function MakerLikeWindow(_ref) {
|
|
|
33
35
|
// leaflet下还未实现
|
|
34
36
|
|
|
35
37
|
if (type.AMap && !markerRef.current) {
|
|
38
|
+
//@ts-ignore
|
|
36
39
|
var marker = new AMap.Marker({
|
|
37
40
|
content: domref.current,
|
|
38
41
|
visible: false,
|
|
@@ -40,7 +43,8 @@ export default function MakerLikeWindow(_ref) {
|
|
|
40
43
|
map: instance.map,
|
|
41
44
|
offset: [-width * 0.5, -height - 32]
|
|
42
45
|
});
|
|
43
|
-
|
|
46
|
+
//@ts-ignore
|
|
47
|
+
markerRef.cFurrent = marker;
|
|
44
48
|
marker.on('click', function () {
|
|
45
49
|
maxIndex++;
|
|
46
50
|
if (marker.getzIndex() !== maxIndex) {
|
|
@@ -57,13 +61,25 @@ export default function MakerLikeWindow(_ref) {
|
|
|
57
61
|
if (type.AMap) {
|
|
58
62
|
var lnglat = _construct(AMap.LngLat, _toConsumableArray(center));
|
|
59
63
|
if (visible) {
|
|
64
|
+
//@ts-ignore
|
|
60
65
|
marker.setPosition(lnglat);
|
|
66
|
+
//@ts-ignore
|
|
61
67
|
marker.setContent(domref.current);
|
|
62
|
-
|
|
68
|
+
//@ts-ignore
|
|
69
|
+
if (domref.current) {
|
|
70
|
+
// 创建渲染器实例
|
|
71
|
+
var root = createRoot(domref.current);
|
|
72
|
+
// 使用渲染器实例进行渲染
|
|
73
|
+
root.render(children);
|
|
74
|
+
}
|
|
75
|
+
//@ts-ignore
|
|
63
76
|
marker.show();
|
|
64
77
|
} else {
|
|
78
|
+
//@ts-ignore
|
|
65
79
|
marker.hide();
|
|
66
|
-
|
|
80
|
+
// //@ts-ignore
|
|
81
|
+
// ReactDOM.unmountComponentAtNode(domref.current);
|
|
82
|
+
//@ts-ignore
|
|
67
83
|
instance.map.remove(markerRef.current);
|
|
68
84
|
markerRef.current = null;
|
|
69
85
|
}
|
|
@@ -72,6 +88,7 @@ export default function MakerLikeWindow(_ref) {
|
|
|
72
88
|
}, [visible, center, instance.map]);
|
|
73
89
|
useUnmount(function () {
|
|
74
90
|
try {
|
|
91
|
+
//@ts-ignore
|
|
75
92
|
instance.map.remove(markerRef.current);
|
|
76
93
|
markerRef.current = null;
|
|
77
94
|
} catch (_) {}
|
|
@@ -40,7 +40,8 @@ function useMouseTools(onDrawEnd) {
|
|
|
40
40
|
return undefined;
|
|
41
41
|
}
|
|
42
42
|
var fn = function fn(e) {
|
|
43
|
-
|
|
43
|
+
//@ts-ignore
|
|
44
|
+
overlayersRef.current.push(e === null || e === void 0 ? void 0 : e.obj);
|
|
44
45
|
onDrawEnd === null || onDrawEnd === void 0 || onDrawEnd(e.obj);
|
|
45
46
|
};
|
|
46
47
|
mouseRef.current.on('draw', fn);
|
|
@@ -16,6 +16,7 @@ function SinglePoint(_ref) {
|
|
|
16
16
|
children = _ref.children;
|
|
17
17
|
var _useContext = useContext(mapContext),
|
|
18
18
|
instance = _useContext.instance;
|
|
19
|
+
//@ts-ignore
|
|
19
20
|
var mapRest = useCallback(function () {
|
|
20
21
|
return instance.setZoomAndCenter(instance.config.zoom, center !== null && center !== void 0 ? center : instance.config.center);
|
|
21
22
|
}, [center, instance]);
|
package/es/Map/points.d.ts
CHANGED
|
@@ -46,5 +46,29 @@ declare const data: ({
|
|
|
46
46
|
villageLocationType: string;
|
|
47
47
|
placeTags: string[];
|
|
48
48
|
createTime: string;
|
|
49
|
+
} | {
|
|
50
|
+
cid: string;
|
|
51
|
+
deviceName: string;
|
|
52
|
+
deviceStatus: string;
|
|
53
|
+
deviceType: string;
|
|
54
|
+
id: string;
|
|
55
|
+
latitude: string;
|
|
56
|
+
longitude: string;
|
|
57
|
+
manufacturerDeviceId: string;
|
|
58
|
+
manufacturerDeviceType: string;
|
|
59
|
+
organizationIds: string[];
|
|
60
|
+
pathId: number[];
|
|
61
|
+
placeId: string;
|
|
62
|
+
sn: string;
|
|
63
|
+
boxNum: string;
|
|
64
|
+
cameraType: null;
|
|
65
|
+
hasFrontEnd: boolean;
|
|
66
|
+
hasStorage: boolean;
|
|
67
|
+
parentId: string;
|
|
68
|
+
accessType: string;
|
|
69
|
+
villageLocationType: string;
|
|
70
|
+
placeTags: string[];
|
|
71
|
+
createTime: string;
|
|
72
|
+
lygroupId?: undefined;
|
|
49
73
|
})[];
|
|
50
74
|
export default data;
|
|
@@ -18,6 +18,7 @@ function RectInfo(_ref) {
|
|
|
18
18
|
height = _containerDom$getBoun.height;
|
|
19
19
|
var _rectInfoWidth$rectIn = {
|
|
20
20
|
rectInfoWidth: RECT_INFO_WIDTH,
|
|
21
|
+
//@ts-ignore
|
|
21
22
|
rectInfoHeight: item.tags.length * RECT_INFO_HEIGHT + 6 + 30
|
|
22
23
|
},
|
|
23
24
|
rectInfoWidth = _rectInfoWidth$rectIn.rectInfoWidth,
|
|
@@ -44,6 +45,7 @@ function RectInfo(_ref) {
|
|
|
44
45
|
width: rectInfoWidth,
|
|
45
46
|
height: rectInfoHeight
|
|
46
47
|
};
|
|
48
|
+
//@ts-ignore
|
|
47
49
|
}, [containerDom, item.rect, item.tags.length]);
|
|
48
50
|
return /*#__PURE__*/React.createElement("div", {
|
|
49
51
|
className: "rect-info-list-wrapper",
|
|
@@ -65,7 +67,7 @@ function RectInfo(_ref) {
|
|
|
65
67
|
type: 'lm-player_Photo_repeatingdata'
|
|
66
68
|
}), "\u91CD\u590D")), /*#__PURE__*/React.createElement("ul", {
|
|
67
69
|
className: "rect-info-list"
|
|
68
|
-
}, item.tags.map(function (v, index) {
|
|
70
|
+
}, item.tags && item.tags.map(function (v, index) {
|
|
69
71
|
return /*#__PURE__*/React.createElement("li", {
|
|
70
72
|
className: "info-item",
|
|
71
73
|
key: index,
|
|
@@ -38,14 +38,20 @@ function RectMenu(_ref) {
|
|
|
38
38
|
useEffect(function () {
|
|
39
39
|
var dom = domRef.current;
|
|
40
40
|
if (dom) {
|
|
41
|
+
//@ts-ignore
|
|
41
42
|
dom.addEventListener('mousedown', handleCancelB, false);
|
|
43
|
+
//@ts-ignore
|
|
42
44
|
dom.addEventListener('mousemove', handleCancelB, false);
|
|
45
|
+
//@ts-ignore
|
|
43
46
|
dom.addEventListener('mouseup', handleCancelB, false);
|
|
44
47
|
}
|
|
45
48
|
return function () {
|
|
46
49
|
if (dom) {
|
|
50
|
+
//@ts-ignore
|
|
47
51
|
dom.removeEventListener('mousedown', handleCancelB, false);
|
|
52
|
+
//@ts-ignore
|
|
48
53
|
dom.removeEventListener('mousemove', handleCancelB, false);
|
|
54
|
+
//@ts-ignore
|
|
49
55
|
dom.removeEventListener('mouseup', handleCancelB, false);
|
|
50
56
|
}
|
|
51
57
|
};
|
package/es/Picture/utils.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { ImageType, RectType } from './interface';
|
|
2
2
|
export declare function customContextMenu(e: any): boolean;
|
|
3
3
|
export declare function cloneImageNode(image: HTMLImageElement): Promise<Node>;
|
|
4
|
-
export declare function getCaptureRect(rect: number[], type: ImageType):
|
|
4
|
+
export declare function getCaptureRect(rect: number[], type: ImageType): number[];
|
|
5
5
|
export declare function computedRectScale({ domImg, rects }: {
|
|
6
6
|
domImg: HTMLImageElement;
|
|
7
7
|
rects: RectType[];
|
|
8
8
|
}): {
|
|
9
|
-
rect:
|
|
9
|
+
rect: number[];
|
|
10
10
|
type: ImageType;
|
|
11
|
-
needExpand?: boolean;
|
|
12
|
-
imgId?: string;
|
|
13
|
-
area?: number;
|
|
14
|
-
tags?: import("./interface").TagItemType[];
|
|
15
|
-
imgUrl?: string;
|
|
16
|
-
isDefault?: boolean;
|
|
17
|
-
dupId?: string;
|
|
18
|
-
lowQuality?: boolean;
|
|
19
|
-
base64?: string;
|
|
11
|
+
needExpand?: boolean | undefined;
|
|
12
|
+
imgId?: string | undefined;
|
|
13
|
+
area?: number | undefined;
|
|
14
|
+
tags?: import("./interface").TagItemType[] | undefined;
|
|
15
|
+
imgUrl?: string | undefined;
|
|
16
|
+
isDefault?: boolean | undefined;
|
|
17
|
+
dupId?: string | undefined;
|
|
18
|
+
lowQuality?: boolean | undefined;
|
|
19
|
+
base64?: string | undefined;
|
|
20
20
|
}[];
|
|
21
21
|
export declare function getImgSize(dom: HTMLDivElement, img: HTMLImageElement): {
|
|
22
22
|
x: number;
|
package/es/Player/api/index.d.ts
CHANGED
|
@@ -4,18 +4,18 @@ import type { FlvPlayerConfig } from '../player';
|
|
|
4
4
|
declare class Api {
|
|
5
5
|
container: HTMLElement;
|
|
6
6
|
constructor(container: HTMLElement);
|
|
7
|
-
get video(): HTMLVideoElement;
|
|
7
|
+
get video(): HTMLVideoElement | null;
|
|
8
8
|
play: () => void;
|
|
9
9
|
pause: () => void;
|
|
10
|
-
get paused(): boolean;
|
|
11
|
-
get muted(): boolean;
|
|
10
|
+
get paused(): boolean | undefined;
|
|
11
|
+
get muted(): boolean | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* 设置currentTime实现seek
|
|
14
14
|
* @param {*} seconds
|
|
15
15
|
*/
|
|
16
16
|
seekTo: (seconds: number) => void;
|
|
17
17
|
setVolume: (fraction: number) => void;
|
|
18
|
-
getVolume: () => number;
|
|
18
|
+
getVolume: () => number | undefined;
|
|
19
19
|
mute: () => void;
|
|
20
20
|
unmute: () => void;
|
|
21
21
|
/**
|
|
@@ -4,5 +4,5 @@ interface IBarProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
}
|
|
7
|
-
declare function Bar({ visibel, className, children, ...props }: IBarProps): React.JSX.Element;
|
|
7
|
+
declare function Bar({ visibel, className, children, ...props }: IBarProps): React.JSX.Element | null;
|
|
8
8
|
export default Bar;
|
|
@@ -21,7 +21,7 @@ function Volume(_ref) {
|
|
|
21
21
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
22
22
|
var volume = useMemo(function () {
|
|
23
23
|
return api !== null && api !== void 0 && api.muted ? 0 : val;
|
|
24
|
-
},
|
|
24
|
+
}, []);
|
|
25
25
|
var onChange = function onChange(num) {
|
|
26
26
|
if (api !== null && api !== void 0 && api.muted) {
|
|
27
27
|
api === null || api === void 0 || api.unmute();
|
package/es/Player/util.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare const playUnload: (video?: HTMLVideoElement, flv?: Flvjs.Player,
|
|
|
30
30
|
* @param hls
|
|
31
31
|
* @param url
|
|
32
32
|
*/
|
|
33
|
-
export declare const playReload: (video?: HTMLVideoElement, event?: VideoEventInstance, flv?: Flvjs.Player, hls?: Hls, url?: string) =>
|
|
33
|
+
export declare const playReload: (video?: HTMLVideoElement, event?: VideoEventInstance, flv?: Flvjs.Player, hls?: Hls, url?: string) => undefined;
|
|
34
34
|
/**
|
|
35
35
|
* 获取播放文件类型
|
|
36
36
|
* @param {*} url
|
|
@@ -51,8 +51,8 @@ function LiveTools(_ref) {
|
|
|
51
51
|
};
|
|
52
52
|
var player = props.getPlayerItem();
|
|
53
53
|
|
|
54
|
-
/**
|
|
55
|
-
* 定时获取play状态
|
|
54
|
+
/**
|
|
55
|
+
* 定时获取play状态
|
|
56
56
|
*/
|
|
57
57
|
useInterval(function () {
|
|
58
58
|
return update();
|
|
@@ -122,10 +122,7 @@ function LiveTools(_ref) {
|
|
|
122
122
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
123
123
|
type: "lm-player-quanbuguanbi",
|
|
124
124
|
title: "\u5173\u95ED\u6240\u6709"
|
|
125
|
-
})), /*#__PURE__*/React.createElement(
|
|
126
|
-
screenNum: screenNum,
|
|
127
|
-
updateState: props.updateState
|
|
128
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
125
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
129
126
|
className: "player-tools-item",
|
|
130
127
|
onClick: props.toggleFit
|
|
131
128
|
}, fit === 'fill' ? /*#__PURE__*/React.createElement(IconFont, {
|
|
@@ -134,7 +131,10 @@ function LiveTools(_ref) {
|
|
|
134
131
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
135
132
|
type: "lm-player-huamianshiying",
|
|
136
133
|
title: "\u586B\u5145"
|
|
137
|
-
})), /*#__PURE__*/React.createElement(
|
|
134
|
+
})), /*#__PURE__*/React.createElement(ScreenSelect, {
|
|
135
|
+
screenNum: screenNum,
|
|
136
|
+
updateState: props.updateState
|
|
137
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
138
138
|
className: "player-tools-item",
|
|
139
139
|
onClick: toggleFullscreen,
|
|
140
140
|
style: {
|
|
@@ -34,5 +34,5 @@ interface IToolsProps {
|
|
|
34
34
|
allWinExtTools?: JSX.Element;
|
|
35
35
|
hasPlugin?: boolean;
|
|
36
36
|
}
|
|
37
|
-
declare function RecordTools({ containerRef, screenNum,
|
|
37
|
+
declare function RecordTools({ containerRef, screenNum, fit, time, oneWinExtTools, allWinExtTools, ...props }: IToolsProps): React.JSX.Element;
|
|
38
38
|
export default RecordTools;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
var _excluded = ["containerRef", "screenNum", "
|
|
1
|
+
var _excluded = ["containerRef", "screenNum", "fit", "time", "oneWinExtTools", "allWinExtTools"];
|
|
2
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
2
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -13,21 +14,17 @@ import React from 'react';
|
|
|
13
14
|
import Volume from "../Player/contraller_bar/volume";
|
|
14
15
|
import IconFont from "../Player/iconfont";
|
|
15
16
|
import useFullscreen from "../useFullscreen";
|
|
16
|
-
import RatePick from
|
|
17
|
+
// import RatePick from './RatePick';
|
|
17
18
|
import ScreenSelect from "./ScreenSelect";
|
|
18
19
|
import TimeSelect from "./TimeSelect";
|
|
19
20
|
function RecordTools(_ref) {
|
|
20
|
-
var _player$video
|
|
21
|
+
var _player$video;
|
|
21
22
|
var containerRef = _ref.containerRef,
|
|
22
23
|
screenNum = _ref.screenNum,
|
|
23
|
-
_ref$mode = _ref.mode,
|
|
24
|
-
mode = _ref$mode === void 0 ? 1 : _ref$mode,
|
|
25
24
|
fit = _ref.fit,
|
|
26
25
|
time = _ref.time,
|
|
27
26
|
oneWinExtTools = _ref.oneWinExtTools,
|
|
28
27
|
allWinExtTools = _ref.allWinExtTools,
|
|
29
|
-
hasPlugin = _ref.hasPlugin,
|
|
30
|
-
multipleList = _ref.multipleList,
|
|
31
28
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
32
29
|
var _useFullscreen = useFullscreen(containerRef),
|
|
33
30
|
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
@@ -35,8 +32,8 @@ function RecordTools(_ref) {
|
|
|
35
32
|
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
36
33
|
var _useToggle = useToggle(false),
|
|
37
34
|
_useToggle2 = _slicedToArray(_useToggle, 2),
|
|
38
|
-
isFpsPlay = _useToggle2[0]
|
|
39
|
-
|
|
35
|
+
isFpsPlay = _useToggle2[0];
|
|
36
|
+
_objectDestructuringEmpty(_useToggle2[1]);
|
|
40
37
|
var update = useUpdate();
|
|
41
38
|
// 播放状态控制
|
|
42
39
|
var playToggle = function playToggle() {
|
|
@@ -60,11 +57,13 @@ function RecordTools(_ref) {
|
|
|
60
57
|
(_props$snapshot = props.snapshot) === null || _props$snapshot === void 0 || _props$snapshot.call(props, base64);
|
|
61
58
|
}
|
|
62
59
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
|
|
61
|
+
// const ratechange = (value: number) => {
|
|
62
|
+
// const player = props.getPlayerItem();
|
|
63
|
+
// player?.api.setPlaybackRate(value);
|
|
64
|
+
// update();
|
|
65
|
+
// };
|
|
66
|
+
|
|
68
67
|
var player = props.getPlayerItem();
|
|
69
68
|
useUpdateEffect(function () {
|
|
70
69
|
var player = props.getPlayerItem();
|
|
@@ -73,8 +72,8 @@ function RecordTools(_ref) {
|
|
|
73
72
|
}
|
|
74
73
|
}, [isFpsPlay]);
|
|
75
74
|
|
|
76
|
-
/**
|
|
77
|
-
* 定时获取play状态
|
|
75
|
+
/**
|
|
76
|
+
* 定时获取play状态
|
|
78
77
|
*/
|
|
79
78
|
useRafInterval(function () {
|
|
80
79
|
return update();
|
|
@@ -105,45 +104,18 @@ function RecordTools(_ref) {
|
|
|
105
104
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
106
105
|
type: "lm-player-xiazai",
|
|
107
106
|
title: "\u4E0B\u8F7D\u5F53\u524D\u5F55\u50CF"
|
|
108
|
-
})),
|
|
107
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
109
108
|
className: "player-tools-item",
|
|
110
|
-
onClick:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
});
|
|
109
|
+
onClick: props.onClose,
|
|
110
|
+
style: {
|
|
111
|
+
marginRight: 6
|
|
114
112
|
}
|
|
115
113
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
116
|
-
type: "lm-player-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
} : undefined,
|
|
120
|
-
className: "icon-chajian",
|
|
121
|
-
title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
|
|
122
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
123
|
-
className: "player-tools-item",
|
|
124
|
-
onClick: toggle
|
|
125
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
126
|
-
type: "lm-player-zhuzhenplay",
|
|
127
|
-
style: isFpsPlay ? {
|
|
128
|
-
color: 'var(--primary)'
|
|
129
|
-
} : undefined,
|
|
130
|
-
title: "\u9010\u5E27\u64AD\u653E"
|
|
131
|
-
})), /*#__PURE__*/React.createElement(RatePick, {
|
|
132
|
-
onChange: ratechange,
|
|
133
|
-
multipleList: multipleList,
|
|
134
|
-
value: (_player$video$playbac = player === null || player === void 0 || (_player$video = player.video) === null || _player$video === void 0 ? void 0 : _player$video.playbackRate) !== null && _player$video$playbac !== void 0 ? _player$video$playbac : 1
|
|
135
|
-
}), oneWinExtTools), /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
type: "lm-player-close",
|
|
115
|
+
title: "\u5173\u95ED"
|
|
116
|
+
})), oneWinExtTools), /*#__PURE__*/React.createElement("div", {
|
|
136
117
|
className: "player-tools-mid"
|
|
137
|
-
}, /*#__PURE__*/React.createElement(
|
|
138
|
-
className: "player-tools-item",
|
|
139
|
-
onClick: props.onClose
|
|
140
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
141
|
-
type: "lm-player-tingzhi",
|
|
142
|
-
title: "\u505C\u6B62",
|
|
143
|
-
style: {
|
|
144
|
-
fontSize: 16
|
|
145
|
-
}
|
|
146
|
-
})), /*#__PURE__*/React.createElement(TimeSelect, {
|
|
118
|
+
}, /*#__PURE__*/React.createElement(TimeSelect, {
|
|
147
119
|
time: time,
|
|
148
120
|
onChange: function onChange(time) {
|
|
149
121
|
var _props$onTimeChange;
|
|
@@ -154,7 +126,7 @@ function RecordTools(_ref) {
|
|
|
154
126
|
}), /*#__PURE__*/React.createElement("div", {
|
|
155
127
|
className: "player-tools-item",
|
|
156
128
|
onClick: playToggle
|
|
157
|
-
}, player && !((_player$
|
|
129
|
+
}, player && !((_player$video = player.video) !== null && _player$video !== void 0 && _player$video.paused) ? /*#__PURE__*/React.createElement(IconFont, {
|
|
158
130
|
type: "lm-player-Pause_Main",
|
|
159
131
|
title: "\u6682\u505C",
|
|
160
132
|
style: {
|
|
@@ -22,24 +22,24 @@ var minPerStep = [1, 2, 5, 10, 15, 20, 30, 60, 120, 180, 240, 360, 720, 1440];
|
|
|
22
22
|
var minStepSize = 20;
|
|
23
23
|
var distance_between_gtitle = 80;
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
* 下一个刻度
|
|
25
|
+
/**
|
|
26
|
+
* 下一个刻度
|
|
27
27
|
*/
|
|
28
28
|
function ms_to_next_step(timestamp, step) {
|
|
29
29
|
var remainder = timestamp % step;
|
|
30
30
|
return remainder ? step - remainder : 0;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
* 返回 2018-01-01 10:00:00 格式时间
|
|
35
|
-
* @param {*} time
|
|
33
|
+
/**
|
|
34
|
+
* 返回 2018-01-01 10:00:00 格式时间
|
|
35
|
+
* @param {*} time
|
|
36
36
|
*/
|
|
37
37
|
function formartTimestemp(time) {
|
|
38
38
|
return moment(time).format('YYYY-MM-DD HH:mm:ss');
|
|
39
39
|
}
|
|
40
|
-
/**
|
|
41
|
-
* 返回时间轴上刻度的时间
|
|
42
|
-
* @param {*} datetime new Date 格式
|
|
40
|
+
/**
|
|
41
|
+
* 返回时间轴上刻度的时间
|
|
42
|
+
* @param {*} datetime new Date 格式
|
|
43
43
|
*/
|
|
44
44
|
function graduation_title(datetime) {
|
|
45
45
|
var mom = moment(datetime);
|
|
@@ -52,8 +52,8 @@ function graduation_title(datetime) {
|
|
|
52
52
|
return mom.format('HH:mm');
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
/**
|
|
56
|
-
* 绘制线条
|
|
55
|
+
/**
|
|
56
|
+
* 绘制线条
|
|
57
57
|
*/
|
|
58
58
|
function drawLine(ctx, beginX, beginY, endX, endY, color, width) {
|
|
59
59
|
ctx.beginPath();
|
|
@@ -118,8 +118,8 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
118
118
|
return ctx === null || ctx === void 0 ? void 0 : ctx.clearRect(0, 0, width, height);
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
-
/**
|
|
122
|
-
* 绘制覆盖时间刻度颜色,表示有录像的部分
|
|
121
|
+
/**
|
|
122
|
+
* 绘制覆盖时间刻度颜色,表示有录像的部分
|
|
123
123
|
*/
|
|
124
124
|
var drawOverlay = function drawOverlay() {
|
|
125
125
|
segments.forEach(function (item) {
|
|
@@ -134,8 +134,8 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
134
134
|
});
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
/**
|
|
138
|
-
* 绘制刻度相关的
|
|
137
|
+
/**
|
|
138
|
+
* 绘制刻度相关的
|
|
139
139
|
*/
|
|
140
140
|
var drawScale = function drawScale() {
|
|
141
141
|
var px_per_min = width / (state.hoursPer * 60); // px/min
|
|
@@ -197,9 +197,9 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
199
|
|
|
200
|
-
/**
|
|
201
|
-
* 绘制当前刻度
|
|
202
|
-
* @returns
|
|
200
|
+
/**
|
|
201
|
+
* 绘制当前刻度
|
|
202
|
+
* @returns
|
|
203
203
|
*/
|
|
204
204
|
var drawCurrentLine = function drawCurrentLine() {
|
|
205
205
|
var currentTime = state.currentTime,
|
|
@@ -223,8 +223,8 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
223
223
|
drawLine(ctx, left, 20, left, height, currentColor, 2); //中间当前点线
|
|
224
224
|
};
|
|
225
225
|
|
|
226
|
-
/**
|
|
227
|
-
* 绘制提示时间
|
|
226
|
+
/**
|
|
227
|
+
* 绘制提示时间
|
|
228
228
|
*/
|
|
229
229
|
var drawHoverLine = function drawHoverLine() {
|
|
230
230
|
var _state$hover$x, _state$hover$time, _state$hover$x2, _state$hover$x3;
|
|
@@ -238,16 +238,16 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
238
238
|
drawLine(ctx, (_state$hover$x2 = state.hover.x) !== null && _state$hover$x2 !== void 0 ? _state$hover$x2 : 0, 20, (_state$hover$x3 = state.hover.x) !== null && _state$hover$x3 !== void 0 ? _state$hover$x3 : 0, height, hoverLineColor, 1);
|
|
239
239
|
};
|
|
240
240
|
|
|
241
|
-
/**
|
|
242
|
-
* 获取鼠标posx
|
|
243
|
-
* @param {*} e
|
|
241
|
+
/**
|
|
242
|
+
* 获取鼠标posx
|
|
243
|
+
* @param {*} e
|
|
244
244
|
*/
|
|
245
245
|
var get_cursor_x_position = function get_cursor_x_position(e) {
|
|
246
246
|
return e.offsetX;
|
|
247
247
|
};
|
|
248
248
|
|
|
249
|
-
/**
|
|
250
|
-
* 更新画布大小
|
|
249
|
+
/**
|
|
250
|
+
* 更新画布大小
|
|
251
251
|
*/
|
|
252
252
|
useUpdateEffect(function () {
|
|
253
253
|
if (canvas) {
|
|
@@ -283,13 +283,16 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
283
283
|
});
|
|
284
284
|
}, [currentTime]);
|
|
285
285
|
|
|
286
|
-
/**
|
|
287
|
-
* 触发绘制范围单位(hour)
|
|
286
|
+
/**
|
|
287
|
+
* 触发绘制范围单位(hour)
|
|
288
288
|
*/
|
|
289
289
|
useEventListener('mousewheel', function (event) {
|
|
290
|
+
var _canvasRef$current, _canvasRef$current2, _canvasRef$current3;
|
|
291
|
+
if (!(canvasRef !== null && canvasRef !== void 0 && (_canvasRef$current = canvasRef.current) !== null && _canvasRef$current !== void 0 && _canvasRef$current.width)) return;
|
|
290
292
|
event.preventDefault();
|
|
291
293
|
var delta = Math.max(-1, Math.min(1, event.wheelDelta || -event.detail));
|
|
292
|
-
var
|
|
294
|
+
var event_time = state.begin + state.hoursPer * 3600 * 1000 * (event.offsetX / (canvasRef === null || canvasRef === void 0 || (_canvasRef$current2 = canvasRef.current) === null || _canvasRef$current2 === void 0 ? void 0 : _canvasRef$current2.width));
|
|
295
|
+
// const middle_time = state.begin + (state.hoursPer * 3600 * 1000) / 2; //ms 记住当前中间的时间
|
|
293
296
|
var new_hoursPer = state.hoursPer;
|
|
294
297
|
var index = hours.indexOf(new_hoursPer);
|
|
295
298
|
if (delta < 0) {
|
|
@@ -307,15 +310,17 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
307
310
|
new_hoursPer = hours[index - 1];
|
|
308
311
|
}
|
|
309
312
|
}
|
|
310
|
-
var
|
|
313
|
+
var new_event_begin = event_time - new_hoursPer * 3600 * 1000 * (event.offsetX / (canvasRef === null || canvasRef === void 0 || (_canvasRef$current3 = canvasRef.current) === null || _canvasRef$current3 === void 0 ? void 0 : _canvasRef$current3.width));
|
|
314
|
+
|
|
315
|
+
// const new_begin = middle_time - (state.hoursPer * 3600 * 1000) / 2; //new_begin = 当前中间的时间 - hoursPer/2
|
|
311
316
|
setState(function (old) {
|
|
312
317
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
313
|
-
begin:
|
|
318
|
+
begin: new_event_begin,
|
|
314
319
|
hoursPer: new_hoursPer
|
|
315
320
|
});
|
|
316
321
|
});
|
|
317
322
|
onTimeChange === null || onTimeChange === void 0 || onTimeChange({
|
|
318
|
-
begin:
|
|
323
|
+
begin: new_event_begin
|
|
319
324
|
});
|
|
320
325
|
nextTick(function () {
|
|
321
326
|
return onHoursPerChange === null || onHoursPerChange === void 0 ? void 0 : onHoursPerChange(new_hoursPer);
|
|
@@ -324,8 +329,8 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
324
329
|
target: canvasRef
|
|
325
330
|
});
|
|
326
331
|
|
|
327
|
-
/**
|
|
328
|
-
* 用于处理canvas移除hover效果
|
|
332
|
+
/**
|
|
333
|
+
* 用于处理canvas移除hover效果
|
|
329
334
|
*/
|
|
330
335
|
useEventListener('mouseout', function () {
|
|
331
336
|
return setState(function (old) {
|
|
@@ -340,8 +345,8 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
340
345
|
target: canvasRef
|
|
341
346
|
});
|
|
342
347
|
|
|
343
|
-
/**
|
|
344
|
-
* hover效果绘制
|
|
348
|
+
/**
|
|
349
|
+
* hover效果绘制
|
|
345
350
|
*/
|
|
346
351
|
useEventListener('mousemove', function (e) {
|
|
347
352
|
if (extRef.current.mousedownTime) {
|
|
@@ -371,8 +376,8 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
371
376
|
target: canvasRef
|
|
372
377
|
});
|
|
373
378
|
|
|
374
|
-
/**
|
|
375
|
-
* 标记点击、拖动的触发器
|
|
379
|
+
/**
|
|
380
|
+
* 标记点击、拖动的触发器
|
|
376
381
|
*/
|
|
377
382
|
useEventListener('mousedown', function (e) {
|
|
378
383
|
extRef.current.mousedownTime = Date.now();
|
|
@@ -381,8 +386,8 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
381
386
|
target: canvasRef
|
|
382
387
|
});
|
|
383
388
|
|
|
384
|
-
/**
|
|
385
|
-
* 处理点击、结束拖动的处理
|
|
389
|
+
/**
|
|
390
|
+
* 处理点击、结束拖动的处理
|
|
386
391
|
*/
|
|
387
392
|
useEventListener('mouseup', function (e) {
|
|
388
393
|
if (!extRef.current.mousedownTime) {
|
|
@@ -422,8 +427,8 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
422
427
|
});
|
|
423
428
|
var moveTimerRef = useRef();
|
|
424
429
|
|
|
425
|
-
/**
|
|
426
|
-
* 拖动处理
|
|
430
|
+
/**
|
|
431
|
+
* 拖动处理
|
|
427
432
|
*/
|
|
428
433
|
useEventListener('mousemove', function (e) {
|
|
429
434
|
if (!extRef.current.mousedownTime) {
|
|
@@ -6,7 +6,7 @@ export declare const ScreenType: {
|
|
|
6
6
|
export declare const TimeModeLibs: {
|
|
7
7
|
name: number;
|
|
8
8
|
}[];
|
|
9
|
-
export declare function mergeFill<T, S>(len: number, mergeArr: T[], fillItem: S): (T | S)[];
|
|
9
|
+
export declare function mergeFill<T, S>(len: number, mergeArr: T[] | undefined, fillItem: S): (T | S)[];
|
|
10
10
|
/**
|
|
11
11
|
* unix时间戳
|
|
12
12
|
* @param start
|
package/es/recorder/index.d.ts
CHANGED
package/es/treeHelper/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare function computPlaceTree<T>(lt: any[], isNoDeep?: boolean): any;
|
|
2
|
-
declare function computPlaceTreeHasUnknown<T>(lt: any[], isNoDeep?: boolean): any;
|
|
3
|
-
declare function computTreeList<T>(list: any[], id?: string, pid?: string, isNoDeep?: boolean): any;
|
|
1
|
+
declare function computPlaceTree<T>(lt: any[], isNoDeep?: boolean): any[];
|
|
2
|
+
declare function computPlaceTreeHasUnknown<T>(lt: any[], isNoDeep?: boolean): any[];
|
|
3
|
+
declare function computTreeList<T>(list: any[], id?: string, pid?: string, isNoDeep?: boolean): any[];
|
|
4
4
|
declare function computTreeList2<T>(list: T[], key?: string, pKey?: string): T[];
|
|
5
5
|
declare const _default: {
|
|
6
6
|
computPlaceTree: typeof computPlaceTree;
|
package/es/utils.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import likeGo from './likeGo';
|
|
|
3
3
|
type TargetValue<T> = T | undefined | null;
|
|
4
4
|
type TargetType = HTMLElement | Element | Window | Document;
|
|
5
5
|
export type BasicTarget<T extends TargetType = Element> = (() => TargetValue<T>) | TargetValue<T> | MutableRefObject<TargetValue<T>>;
|
|
6
|
-
export declare function getTargetElement<T extends TargetType>(target: BasicTarget<T>, defaultElement?: T): T
|
|
6
|
+
export declare function getTargetElement<T extends TargetType>(target: BasicTarget<T>, defaultElement?: T): TargetValue<T>;
|
|
7
7
|
declare const getScrollTop: (el: Document | Element) => number;
|
|
8
8
|
declare const getScrollHeight: (el: Document | Element) => number;
|
|
9
9
|
declare const getClientHeight: (el: Document | Element) => number;
|
package/es/uuid/index.d.ts
CHANGED
package/es/uuid/index.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import { v5 as uuid } from 'uuid';
|
|
1
|
+
// import { v5 as uuid } from 'uuid';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export default uuid;
|
|
3
|
+
// /**
|
|
4
|
+
// * 生成UUID
|
|
5
|
+
// */
|
|
6
|
+
// export default uuid;
|
|
7
|
+
|
|
8
|
+
export default function uuid() {
|
|
9
|
+
var s = [];
|
|
10
|
+
var hexDigits = '0123456789abcdef';
|
|
11
|
+
for (var i = 0; i < 36; i++) {
|
|
12
|
+
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
|
13
|
+
}
|
|
14
|
+
s[14] = '4';
|
|
15
|
+
s[19] = hexDigits.substr(s[19] & 0x3 | 0x8, 1);
|
|
16
|
+
s[8] = s[13] = s[18] = s[23] = '-';
|
|
17
|
+
var uuidStr = s.join('');
|
|
18
|
+
return uuidStr;
|
|
19
|
+
}
|
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": "4.0.
|
|
5
|
+
"version": "4.0.23",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"docs:deploy": "gh-pages -d docs-dist",
|
|
8
8
|
"build": "npm run entry && father build",
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"@turf/helpers": "^6.5.0",
|
|
51
51
|
"@turf/line-to-polygon": "^6.5.0",
|
|
52
52
|
"@types/js-cookie": "^3.0.3",
|
|
53
|
-
"@types/uuid": "^9.0.1",
|
|
54
53
|
"ahooks": "^3.7.7",
|
|
55
54
|
"axios": "^1.4.0",
|
|
56
55
|
"dayjs": "^1.11.8",
|
|
@@ -63,8 +62,7 @@
|
|
|
63
62
|
"react-error-boundary": "^3.1.4",
|
|
64
63
|
"react-hotkeys-hook": "^4.4.0",
|
|
65
64
|
"screenfull": "^6.0.2",
|
|
66
|
-
"socket.io-client": "2.5.0"
|
|
67
|
-
"uuid": "^9.0.0"
|
|
65
|
+
"socket.io-client": "2.5.0"
|
|
68
66
|
},
|
|
69
67
|
"devDependencies": {
|
|
70
68
|
"@commitlint/cli": "^17.6.5",
|