@cloud-app-dev/vidc 3.0.11 → 3.0.14
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/.prettierrc +1 -1
- package/es/CheckGroupFixed/index.js +1 -1
- package/es/DomMove/demo.d.ts +1 -1
- package/es/DomMove/demo.js +1 -1
- package/es/DomMove/index.js +4 -3
- package/es/FullScreen/index.js +5 -5
- package/es/Input/index.js +4 -4
- package/es/List/VList/index.d.ts +1 -1
- package/es/LoaderScript/index.js +3 -3
- package/es/LoaderScript/utils.js +4 -2
- package/es/Map/LevelCenter/DragMarker/index.js +2 -2
- package/es/Map/LoaderMap/index.js +3 -3
- package/es/Picture/component/DefaultRects/index.js +1 -1
- package/es/Picture/component/DrawRect/index.js +1 -1
- package/es/Picture/component/RectMenu/index.js +1 -1
- package/es/Picture/index.js +1 -2
- package/es/Player/contraller_bar/right_bar.js +2 -3
- package/es/Player/frontend_player.js +3 -2
- package/es/Player/frontend_timeline.js +1 -1
- package/es/Player/segment_player.js +1 -1
- package/es/Player/single_player.js +2 -2
- package/es/ScreenPlayer/Live.d.ts +6 -1
- package/es/ScreenPlayer/Live.js +8 -6
- package/es/ScreenPlayer/LiveTools.d.ts +1 -1
- package/es/ScreenPlayer/LiveTools.js +6 -7
- package/es/ScreenPlayer/PlayerWithExt.js +33 -19
- package/es/ScreenPlayer/Record.js +3 -3
- package/es/ScreenPlayer/RecordTools.js +3 -4
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +2 -2
- package/es/ScreenPlayer/SegmentTimeLine.js +17 -36
- package/es/ScreenPlayer/TimeSlider.d.ts +2 -2
- package/es/ScreenPlayer/TimeSlider.js +21 -17
- package/es/ScreenPlayer/demo.js +3 -3
- package/es/ScreenPlayer/index.css +1 -0
- package/es/ScreenPlayer/useTimeSlider.d.ts +22 -0
- package/es/ScreenPlayer/useTimeSlider.js +519 -0
- package/es/Tree/index.js +24 -21
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/useFullscreen/index.d.ts +12 -0
- package/es/useFullscreen/index.js +95 -0
- package/es/utils.js +1 -1
- package/package.json +3 -2
- package/es/List/renderItem.d.ts +0 -20
- package/es/List/renderItem.js +0 -71
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
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); }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
import { useState } from 'react';
|
|
14
|
+
import useLatest from 'ahooks/es/useLatest';
|
|
15
|
+
import useMemoizedFn from 'ahooks/es/useMemoizedFn';
|
|
16
|
+
import useUnmount from 'ahooks/es/useUnmount';
|
|
17
|
+
import { getTargetElement } from 'ahooks/es/utils/domTarget';
|
|
18
|
+
import screenfull from 'screenfull';
|
|
19
|
+
|
|
20
|
+
var useFullscreen = function useFullscreen(target, options) {
|
|
21
|
+
var _ref = options || {},
|
|
22
|
+
onExit = _ref.onExit,
|
|
23
|
+
onEnter = _ref.onEnter;
|
|
24
|
+
|
|
25
|
+
var onExitRef = useLatest(onExit);
|
|
26
|
+
var onEnterRef = useLatest(onEnter);
|
|
27
|
+
|
|
28
|
+
var _useState = useState(false),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
state = _useState2[0],
|
|
31
|
+
setState = _useState2[1];
|
|
32
|
+
|
|
33
|
+
var onChange = function onChange() {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
|
|
36
|
+
if (screenfull.isEnabled) {
|
|
37
|
+
var el = getTargetElement(target);
|
|
38
|
+
var isFullscreen = document.fullscreenElement === el;
|
|
39
|
+
|
|
40
|
+
if (isFullscreen) {
|
|
41
|
+
(_a = onEnterRef.current) === null || _a === void 0 ? void 0 : _a.call(onEnterRef);
|
|
42
|
+
} else {
|
|
43
|
+
screenfull.off('change', onChange);
|
|
44
|
+
(_b = onExitRef.current) === null || _b === void 0 ? void 0 : _b.call(onExitRef);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
setState(isFullscreen);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var enterFullscreen = function enterFullscreen() {
|
|
52
|
+
var el = getTargetElement(target);
|
|
53
|
+
|
|
54
|
+
if (!el) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (screenfull.isEnabled) {
|
|
59
|
+
try {
|
|
60
|
+
screenfull.request(el);
|
|
61
|
+
screenfull.on('change', onChange);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.error(error);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var exitFullscreen = function exitFullscreen() {
|
|
69
|
+
if (screenfull.isEnabled) {
|
|
70
|
+
screenfull.exit();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
var toggleFullscreen = function toggleFullscreen() {
|
|
75
|
+
if (state) {
|
|
76
|
+
exitFullscreen();
|
|
77
|
+
} else {
|
|
78
|
+
enterFullscreen();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
useUnmount(function () {
|
|
83
|
+
if (screenfull.isEnabled) {
|
|
84
|
+
screenfull.off('change', onChange);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return [state, {
|
|
88
|
+
enterFullscreen: useMemoizedFn(enterFullscreen),
|
|
89
|
+
exitFullscreen: useMemoizedFn(exitFullscreen),
|
|
90
|
+
toggleFullscreen: useMemoizedFn(toggleFullscreen),
|
|
91
|
+
isEnabled: screenfull.isEnabled
|
|
92
|
+
}];
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export default useFullscreen;
|
package/es/utils.js
CHANGED
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.
|
|
5
|
+
"version": "3.0.14",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "dumi dev",
|
|
8
8
|
"docs:build": "dumi build",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"hls.js": "^1.2.1",
|
|
37
37
|
"immer": "^9.0.15",
|
|
38
38
|
"lodash-es": "^4.17.21",
|
|
39
|
-
"moment": "^2.29.4"
|
|
39
|
+
"moment": "^2.29.4",
|
|
40
|
+
"screenfull": "^6.0.2"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@cloud-app-dev/utils": "^4.0.1",
|
package/es/List/renderItem.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CheckboxChangeEvent } from 'antd/lib/checkbox';
|
|
3
|
-
interface IRenderItempProps<T> {
|
|
4
|
-
item: T;
|
|
5
|
-
checkedKeys: any[];
|
|
6
|
-
activeKey: any;
|
|
7
|
-
style?: React.CSSProperties;
|
|
8
|
-
itemNameKey: string;
|
|
9
|
-
renderItemExt?: (item: T) => JSX.Element;
|
|
10
|
-
whatIcon?: (item: T) => JSX.Element;
|
|
11
|
-
itemKey?: string;
|
|
12
|
-
checkable?: boolean;
|
|
13
|
-
keywords?: string;
|
|
14
|
-
onChecked?: (e: CheckboxChangeEvent) => void;
|
|
15
|
-
onClickItem?: (item: T) => void;
|
|
16
|
-
onMouseOverItem?: (item: T) => void;
|
|
17
|
-
onMouseOutItem?: (item: T) => void;
|
|
18
|
-
}
|
|
19
|
-
export declare function RenderItem({ item, checkedKeys, activeKey, style, itemNameKey, itemKey, checkable, keywords, ...props }: IRenderItempProps<any>): JSX.Element;
|
|
20
|
-
export {};
|
package/es/List/renderItem.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import "antd/lib/checkbox/style";
|
|
2
|
-
import _Checkbox from "antd/lib/checkbox";
|
|
3
|
-
import { __rest } from "tslib";
|
|
4
|
-
import React, { useCallback, useMemo } from 'react';
|
|
5
|
-
import HightLevel from '../HightLevel';
|
|
6
|
-
export function RenderItem(_a) {
|
|
7
|
-
var item = _a.item,
|
|
8
|
-
checkedKeys = _a.checkedKeys,
|
|
9
|
-
activeKey = _a.activeKey,
|
|
10
|
-
style = _a.style,
|
|
11
|
-
itemNameKey = _a.itemNameKey,
|
|
12
|
-
itemKey = _a.itemKey,
|
|
13
|
-
checkable = _a.checkable,
|
|
14
|
-
keywords = _a.keywords,
|
|
15
|
-
props = __rest(_a, ["item", "checkedKeys", "activeKey", "style", "itemNameKey", "itemKey", "checkable", "keywords"]);
|
|
16
|
-
|
|
17
|
-
var renderItemExt = props.renderItemExt,
|
|
18
|
-
whatIcon = props.whatIcon,
|
|
19
|
-
onChecked = props.onChecked,
|
|
20
|
-
onClickItem = props.onClickItem,
|
|
21
|
-
onMouseOverItem = props.onMouseOverItem,
|
|
22
|
-
onMouseOutItem = props.onMouseOutItem;
|
|
23
|
-
var checked = checkedKeys ? checkedKeys.includes(item[itemKey]) : false;
|
|
24
|
-
var active = !activeKey ? false : Array.isArray(activeKey) ? activeKey.includes(item[itemKey]) : activeKey === item[itemKey];
|
|
25
|
-
var itemIcon = whatIcon ? whatIcon(item) : null;
|
|
26
|
-
var itemClick = useCallback(function (e) {
|
|
27
|
-
return e.stopPropagation();
|
|
28
|
-
}, []);
|
|
29
|
-
|
|
30
|
-
var _onMouseOver = useCallback(function (item) {
|
|
31
|
-
return onMouseOverItem && onMouseOverItem(item);
|
|
32
|
-
}, []);
|
|
33
|
-
|
|
34
|
-
var _onMouseOut = useCallback(function (item) {
|
|
35
|
-
return onMouseOutItem && onMouseOutItem(item);
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
|
-
var _onClick = useCallback(function (item) {
|
|
39
|
-
return onClickItem && onClickItem(item);
|
|
40
|
-
}, []);
|
|
41
|
-
|
|
42
|
-
var className = useMemo(function () {
|
|
43
|
-
return "list-item ".concat(checkable ? 'has-check-box' : '', " ").concat(active ? 'list-item-active' : '');
|
|
44
|
-
}, [checkable, active]);
|
|
45
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
46
|
-
style: style,
|
|
47
|
-
className: className,
|
|
48
|
-
onClick: function onClick() {
|
|
49
|
-
return _onClick(item);
|
|
50
|
-
},
|
|
51
|
-
onMouseOver: function onMouseOver() {
|
|
52
|
-
return _onMouseOver(item);
|
|
53
|
-
},
|
|
54
|
-
onMouseOut: function onMouseOut() {
|
|
55
|
-
return _onMouseOut(item);
|
|
56
|
-
}
|
|
57
|
-
}, /*#__PURE__*/React.createElement("label", null, checkable && /*#__PURE__*/React.createElement(_Checkbox, {
|
|
58
|
-
value: item[itemKey],
|
|
59
|
-
disabled: item.disabled,
|
|
60
|
-
onClick: itemClick,
|
|
61
|
-
checked: checked,
|
|
62
|
-
onChange: onChecked
|
|
63
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
className: "item-info"
|
|
65
|
-
}, itemIcon, keywords ? /*#__PURE__*/React.createElement(HightLevel, {
|
|
66
|
-
name: item[itemNameKey],
|
|
67
|
-
keyword: keywords
|
|
68
|
-
}) : /*#__PURE__*/React.createElement("span", {
|
|
69
|
-
title: item[itemNameKey]
|
|
70
|
-
}, item[itemNameKey])), renderItemExt && renderItemExt(item)));
|
|
71
|
-
}
|