@cloud-app-dev/vidc 3.1.16 → 3.1.18
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/Api/index.js +0 -23
- package/es/AppContext/Sync.js +1 -15
- package/es/AppContext/index.js +21 -52
- package/es/AppContext/static.js +0 -7
- package/es/Auth/index.js +2 -5
- package/es/AutoExit/index.js +1 -5
- package/es/Box/BetweenBox/index.js +6 -8
- package/es/Box/InfoBox/index.js +6 -8
- package/es/Box/TwoColumnBox/index.js +8 -18
- package/es/Box/deps/grid-factory.js +0 -12
- package/es/Box/index.js +4 -6
- package/es/CheckGroupFixed/index.js +19 -34
- package/es/Config/index.js +0 -4
- package/es/Config/utils.js +3 -18
- package/es/ConfigContext/index.js +1 -3
- package/es/CustomRenderSelect/index.js +13 -29
- package/es/DisableMark/index.js +2 -2
- package/es/DomMove/index.js +24 -37
- package/es/DomMove/utils.js +3 -8
- package/es/Drag/DragAndDropItem.js +19 -37
- package/es/Drag/DropItem.js +5 -15
- package/es/Drawer/Demo.js +3 -17
- package/es/Drawer/Footer.js +3 -5
- package/es/Drawer/index.js +28 -50
- package/es/ErrorFallback/index.js +1 -3
- package/es/FullScreen/index.js +8 -18
- package/es/HightLevel/index.js +1 -5
- package/es/IconFont/index.js +5 -11
- package/es/ImageView/index.js +8 -20
- package/es/Input/index.js +14 -27
- package/es/InstanceHistory/index.js +0 -2
- package/es/LabelValue/index.js +8 -10
- package/es/List/DynamicGridList/Demo.js +0 -11
- package/es/List/DynamicGridList/index.js +16 -25
- package/es/List/DynamicList/index.js +23 -38
- package/es/List/GridList/Demo.js +3 -16
- package/es/List/GridList/hook.js +34 -65
- package/es/List/GridList/utils.js +0 -1
- package/es/List/VList/index.js +10 -20
- package/es/List/VList/utils.js +2 -3
- package/es/List/index.js +5 -7
- package/es/LoaderApp/index.js +5 -22
- package/es/LoaderApp/loader.js +5 -13
- package/es/LoaderApp/sandbox.back.js +16 -81
- package/es/LoaderApp/sandbox.js +8 -22
- package/es/LoaderApp/utils.js +20 -49
- package/es/LoaderScript/index.js +8 -19
- package/es/LoaderScript/utils.js +0 -51
- package/es/Map/BasicMap/AMapInstance.js +0 -10
- package/es/Map/BasicMap/LeafletInstance.js +11 -20
- package/es/Map/BasicMap/index.js +6 -28
- package/es/Map/ClusterLayer/hook.js +10 -32
- package/es/Map/ClusterLayer/index.js +2 -6
- package/es/Map/Config/index.js +8 -21
- package/es/Map/Config/utils.js +0 -6
- package/es/Map/Context/index.js +2 -22
- package/es/Map/FindPio/index.js +0 -2
- package/es/Map/InfoWindow/MakerLikeWindow.js +9 -28
- package/es/Map/InfoWindow/demo.js +5 -22
- package/es/Map/InfoWindow/index.js +13 -29
- package/es/Map/LevelCenter/DragMarker/index.js +5 -9
- package/es/Map/LevelCenter/demo.js +6 -16
- package/es/Map/LevelCenter/index.js +8 -15
- package/es/Map/LoaderMap/index.js +10 -10
- package/es/Map/MapDrawSelect/demo.js +12 -23
- package/es/Map/MapDrawSelect/index.js +14 -21
- package/es/Map/MouseTool/index.js +16 -26
- package/es/Map/MouseTool/useMouseTools.js +6 -29
- package/es/Map/ResetTools/index.js +4 -8
- package/es/Map/SinglePoint/index.js +6 -13
- package/es/Map/hook/useMapEvent.js +3 -7
- package/es/Map/hook/useMapType.js +1 -2
- package/es/Map/useMarker/index.js +10 -24
- package/es/Map/withMap/index.js +0 -2
- package/es/Modal/index.d.ts +1 -1
- package/es/Modal/index.js +29 -50
- package/es/Picture/component/DefaultRects/RectInfo.js +11 -25
- package/es/Picture/component/DefaultRects/index.js +3 -5
- package/es/Picture/component/DrawRect/index.js +6 -8
- package/es/Picture/component/RectMenu/index.js +10 -16
- package/es/Picture/component/RectMenu/utils.js +3 -6
- package/es/Picture/component/Tools/index.js +6 -8
- package/es/Picture/component/WheelScale/index.js +3 -6
- package/es/Picture/dragBound.js +4 -17
- package/es/Picture/index.js +46 -87
- package/es/Picture/loadCaptureRectImage.js +10 -26
- package/es/Picture/useDraw.js +20 -39
- package/es/Picture/utils.js +2 -11
- package/es/Player/api/index.js +14 -78
- package/es/Player/context.js +1 -2
- package/es/Player/contraller_bar/bar.js +5 -9
- package/es/Player/contraller_bar/contraller_event.js +5 -23
- package/es/Player/contraller_bar/index.js +7 -9
- package/es/Player/contraller_bar/left_bar.js +15 -27
- package/es/Player/contraller_bar/right_bar.js +7 -18
- package/es/Player/contraller_bar/time.js +6 -16
- package/es/Player/contraller_bar/useBarStatus.js +5 -16
- package/es/Player/contraller_bar/volume.js +6 -26
- package/es/Player/demo.js +59 -75
- package/es/Player/event/errorEvent.js +14 -39
- package/es/Player/event/eventName.js +1 -1
- package/es/Player/event/index.js +19 -53
- package/es/Player/fps_play.js +10 -27
- package/es/Player/frontend_player.js +10 -19
- package/es/Player/frontend_timeline.js +25 -47
- package/es/Player/iconfont.js +2 -5
- package/es/Player/live_heart.js +2 -14
- package/es/Player/message.js +9 -29
- package/es/Player/segment_player.js +39 -77
- package/es/Player/segment_timeline.js +42 -68
- package/es/Player/single_player.js +64 -87
- package/es/Player/style/iconfont.js +10 -17
- package/es/Player/timeline.js +11 -28
- package/es/Player/util.js +0 -21
- package/es/PlayerExt/demo.js +11 -21
- package/es/PlayerExt/index.js +18 -43
- package/es/Progress/index.js +3 -15
- package/es/ROI/demo.js +0 -2
- package/es/ROI/index.js +15 -22
- package/es/ScreenPlayer/Live.js +34 -67
- package/es/ScreenPlayer/LiveTools.js +21 -38
- package/es/ScreenPlayer/PlayerWithExt.js +43 -78
- package/es/ScreenPlayer/RatePick.js +1 -3
- package/es/ScreenPlayer/Record.js +50 -121
- package/es/ScreenPlayer/RecordTools.js +32 -54
- package/es/ScreenPlayer/ScreenSelect.js +1 -3
- package/es/ScreenPlayer/SegmentTimeLine.js +8 -12
- package/es/ScreenPlayer/TimeMode.js +1 -3
- package/es/ScreenPlayer/TimeSelect.js +11 -26
- package/es/ScreenPlayer/demo.js +3 -1
- package/es/ScreenPlayer/demo2.js +9 -24
- package/es/ScreenPlayer/useRecordList.js +7 -72
- package/es/ScreenPlayer/useTimeSlider.js +40 -132
- package/es/ScreenPlayer/useVideoFit.js +5 -18
- package/es/ScreenPlayer/utils.js +0 -8
- package/es/Service/fetch-adapter.js +2 -37
- package/es/Service/http.js +8 -27
- package/es/TableLayout/index.js +3 -7
- package/es/ThemeAntd/demo.js +0 -2
- package/es/ThemeAntd/index.css +15 -0
- package/es/ThemeAntd/style/select.css +15 -0
- package/es/Timeout/index.js +10 -26
- package/es/Tree/demo.js +0 -2
- package/es/Tree/index.js +14 -21
- package/es/useDrawROI/index.js +51 -105
- package/es/useEventEmitterHandle/index.js +2 -6
- package/es/useFullscreen/demo.js +6 -16
- package/es/useFullscreen/index.js +5 -25
- package/es/useHistory/index.js +0 -2
- package/es/useInfiniteScroll/index.js +14 -39
- package/es/useRafInterval/index.js +2 -26
- package/es/useSimpleState/index.js +5 -16
- package/es/useVirtualList/index.js +19 -57
- package/es/utils.js +0 -28
- package/package.json +14 -14
|
@@ -2,8 +2,7 @@ import { useContext, useMemo } from 'react';
|
|
|
2
2
|
import { mapContext } from '../Context';
|
|
3
3
|
export default function useMapType() {
|
|
4
4
|
var _useContext = useContext(mapContext),
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
glaobalKey = _useContext.glaobalKey;
|
|
7
6
|
return useMemo(function () {
|
|
8
7
|
return {
|
|
9
8
|
leaflet: glaobalKey === 'L',
|
|
@@ -1,44 +1,33 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
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
3
|
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
4
|
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
5
|
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
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
7
|
/// <reference path="../AMap.d.ts" />
|
|
14
8
|
import { useEffect, useRef, useState } from 'react';
|
|
15
9
|
import useMapType from '../hook/useMapType';
|
|
16
10
|
import "./index.css";
|
|
17
|
-
|
|
18
11
|
function useMarker(_ref) {
|
|
19
12
|
var map = _ref.map,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
center = _ref.center,
|
|
14
|
+
createIcon = _ref.createIcon,
|
|
15
|
+
options = _ref.options;
|
|
24
16
|
var _useState = useState({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
marker: null
|
|
18
|
+
}),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
state = _useState2[0],
|
|
21
|
+
setState = _useState2[1];
|
|
31
22
|
var inMap = useRef(false);
|
|
32
23
|
var type = useMapType();
|
|
33
24
|
useEffect(function () {
|
|
34
25
|
if (!(center && center.length === 2) || !map) {
|
|
35
26
|
return;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
if (type.leaflet) {
|
|
39
29
|
var L = window.L;
|
|
40
30
|
var latlng = L.latLng(center);
|
|
41
|
-
|
|
42
31
|
if (inMap.current) {
|
|
43
32
|
state.marker.setLatLng(latlng);
|
|
44
33
|
} else {
|
|
@@ -54,7 +43,6 @@ function useMarker(_ref) {
|
|
|
54
43
|
inMap.current = true;
|
|
55
44
|
}
|
|
56
45
|
}
|
|
57
|
-
|
|
58
46
|
if (type.AMap) {
|
|
59
47
|
if (inMap.current) {
|
|
60
48
|
state.marker.setPosition(center);
|
|
@@ -62,17 +50,15 @@ function useMarker(_ref) {
|
|
|
62
50
|
var _marker = new AMap.Marker(Object.assign({
|
|
63
51
|
position: center
|
|
64
52
|
}, options));
|
|
65
|
-
|
|
66
53
|
map.add(_marker);
|
|
67
54
|
setState({
|
|
68
55
|
marker: _marker
|
|
69
56
|
});
|
|
70
57
|
inMap.current = true;
|
|
71
58
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
59
|
+
}
|
|
60
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
74
61
|
}, [center, map, options]);
|
|
75
62
|
return state.marker;
|
|
76
63
|
}
|
|
77
|
-
|
|
78
64
|
export default useMarker;
|
package/es/Map/withMap/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Map from '../BasicMap';
|
|
3
|
-
|
|
4
3
|
function withMap(Component, className) {
|
|
5
4
|
return function withMapComponent(props) {
|
|
6
5
|
return /*#__PURE__*/React.createElement(Map, {
|
|
@@ -8,5 +7,4 @@ function withMap(Component, className) {
|
|
|
8
7
|
}, /*#__PURE__*/React.createElement(Component, Object.assign({}, props)));
|
|
9
8
|
};
|
|
10
9
|
}
|
|
11
|
-
|
|
12
10
|
export default withMap;
|
package/es/Modal/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ declare namespace Modal {
|
|
|
19
19
|
close: () => void;
|
|
20
20
|
};
|
|
21
21
|
var useAntdModal: typeof import("antd/lib/modal/useModal").default;
|
|
22
|
-
var RefModal: React.ForwardRefExoticComponent<
|
|
22
|
+
var RefModal: React.ForwardRefExoticComponent<IModalProps & React.RefAttributes<IRefModalMethodsProps>>;
|
|
23
23
|
}
|
|
24
24
|
export interface IUseModalHookState {
|
|
25
25
|
content?: React.ReactNode;
|
package/es/Modal/index.js
CHANGED
|
@@ -2,32 +2,23 @@ import "antd/lib/config-provider/style";
|
|
|
2
2
|
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
3
|
import "antd/lib/modal/style";
|
|
4
4
|
import _Modal from "antd/lib/modal";
|
|
5
|
-
|
|
6
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
|
-
|
|
8
6
|
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."); }
|
|
9
|
-
|
|
10
7
|
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); }
|
|
11
|
-
|
|
12
8
|
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; }
|
|
13
|
-
|
|
14
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; }
|
|
15
|
-
|
|
16
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
|
|
18
11
|
import { __rest } from "tslib";
|
|
19
12
|
import React, { useContext, useEffect, useImperativeHandle, useMemo, useState } from 'react';
|
|
20
13
|
import * as ReactDOMClient from 'react-dom/client';
|
|
21
14
|
import CC from '../ConfigContext';
|
|
22
15
|
import "./index.css";
|
|
23
|
-
|
|
24
16
|
function Modal(_a) {
|
|
25
17
|
var children = _a.children,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
className = _a.className,
|
|
19
|
+
style = _a.style,
|
|
20
|
+
getContainer = _a.getContainer,
|
|
21
|
+
props = __rest(_a, ["children", "className", "style", "getContainer"]);
|
|
31
22
|
return /*#__PURE__*/React.createElement(_Modal, Object.assign({
|
|
32
23
|
style: Object.assign(Object.assign({}, style), {
|
|
33
24
|
textAlign: 'left'
|
|
@@ -36,36 +27,31 @@ function Modal(_a) {
|
|
|
36
27
|
className: "lm-modal-container ".concat(className)
|
|
37
28
|
}, props), children);
|
|
38
29
|
}
|
|
39
|
-
|
|
40
30
|
Modal.defaultProps = {
|
|
41
31
|
className: '',
|
|
42
32
|
getContainer: false
|
|
43
33
|
};
|
|
44
|
-
|
|
45
34
|
function useModal() {
|
|
46
35
|
var prefixCls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cloudapp';
|
|
47
36
|
var context = useContext(CC.Context);
|
|
48
37
|
var container = useMemo(function () {
|
|
49
38
|
var _a;
|
|
50
|
-
|
|
51
39
|
return (_a = context === null || context === void 0 ? void 0 : context.root) !== null && _a !== void 0 ? _a : document.body;
|
|
52
40
|
}, [context === null || context === void 0 ? void 0 : context.root]);
|
|
53
41
|
var div = useMemo(function () {
|
|
54
42
|
return document.createElement('div');
|
|
55
43
|
}, []);
|
|
56
|
-
|
|
57
44
|
var _useState = useState({
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
45
|
+
content: null,
|
|
46
|
+
visible: false,
|
|
47
|
+
title: '',
|
|
48
|
+
onOk: undefined,
|
|
49
|
+
width: undefined,
|
|
50
|
+
className: undefined
|
|
51
|
+
}),
|
|
52
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
53
|
+
state = _useState2[0],
|
|
54
|
+
setState = _useState2[1];
|
|
69
55
|
var root = useMemo(function () {
|
|
70
56
|
return ReactDOMClient.createRoot(div);
|
|
71
57
|
}, [div]);
|
|
@@ -97,7 +83,6 @@ function useModal() {
|
|
|
97
83
|
getContainer: false
|
|
98
84
|
}, state.content)));
|
|
99
85
|
}, [state.content, state.visible, state.title, state.onOk, state.width, state.className, root, prefixCls, container]);
|
|
100
|
-
|
|
101
86
|
var open = function open(options) {
|
|
102
87
|
setState(function (old) {
|
|
103
88
|
return Object.assign(Object.assign(Object.assign({}, old), options), {
|
|
@@ -105,7 +90,6 @@ function useModal() {
|
|
|
105
90
|
});
|
|
106
91
|
});
|
|
107
92
|
};
|
|
108
|
-
|
|
109
93
|
var close = function close() {
|
|
110
94
|
setState(function (old) {
|
|
111
95
|
return Object.assign(Object.assign({}, old), {
|
|
@@ -113,26 +97,23 @@ function useModal() {
|
|
|
113
97
|
});
|
|
114
98
|
});
|
|
115
99
|
};
|
|
116
|
-
|
|
117
100
|
return {
|
|
118
101
|
open: open,
|
|
119
102
|
close: close
|
|
120
103
|
};
|
|
121
104
|
}
|
|
122
|
-
|
|
123
|
-
var RefModal = /*#__PURE__*/React.forwardRef(function RefModal(_, ref) {
|
|
105
|
+
var RefModal = /*#__PURE__*/React.forwardRef(function RefModal(props, ref) {
|
|
124
106
|
var _useState3 = useState({
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
107
|
+
content: null,
|
|
108
|
+
visible: false,
|
|
109
|
+
title: '',
|
|
110
|
+
onOk: undefined,
|
|
111
|
+
width: undefined,
|
|
112
|
+
className: undefined
|
|
113
|
+
}),
|
|
114
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
115
|
+
state = _useState4[0],
|
|
116
|
+
setState = _useState4[1];
|
|
136
117
|
var open = function open(options) {
|
|
137
118
|
setState(function (old) {
|
|
138
119
|
return Object.assign(Object.assign(Object.assign({}, old), options), {
|
|
@@ -140,23 +121,21 @@ var RefModal = /*#__PURE__*/React.forwardRef(function RefModal(_, ref) {
|
|
|
140
121
|
});
|
|
141
122
|
});
|
|
142
123
|
};
|
|
143
|
-
|
|
144
124
|
var close = function close() {
|
|
145
125
|
setState(function (old) {
|
|
146
126
|
return Object.assign(Object.assign({}, old), {
|
|
147
127
|
visible: false
|
|
148
128
|
});
|
|
149
129
|
});
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
|
|
130
|
+
};
|
|
131
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
153
132
|
useImperativeHandle(ref, function () {
|
|
154
133
|
return {
|
|
155
134
|
open: open,
|
|
156
135
|
close: close
|
|
157
136
|
};
|
|
158
137
|
}, [state]);
|
|
159
|
-
return /*#__PURE__*/React.createElement(Modal, {
|
|
138
|
+
return /*#__PURE__*/React.createElement(Modal, Object.assign({}, props, {
|
|
160
139
|
okText: "\u786E\u5B9A",
|
|
161
140
|
cancelText: "\u53D6\u6D88",
|
|
162
141
|
open: state.visible,
|
|
@@ -166,7 +145,7 @@ var RefModal = /*#__PURE__*/React.forwardRef(function RefModal(_, ref) {
|
|
|
166
145
|
title: state.title,
|
|
167
146
|
width: state.width,
|
|
168
147
|
className: state.className
|
|
169
|
-
}, state.content);
|
|
148
|
+
}), state.content);
|
|
170
149
|
});
|
|
171
150
|
Modal.info = _Modal.info;
|
|
172
151
|
Modal.success = _Modal.success;
|
|
@@ -1,56 +1,43 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
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
3
|
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
4
|
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
5
|
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
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
7
|
import React, { useMemo } from 'react';
|
|
14
8
|
import IconFont from '../../../IconFont';
|
|
15
9
|
var RECT_INFO_WIDTH = 150;
|
|
16
10
|
var RECT_INFO_HEIGHT = 24;
|
|
17
11
|
var RECT_WINDOW_MARGIN = 6;
|
|
18
|
-
|
|
19
12
|
function RectInfo(_ref) {
|
|
20
13
|
var item = _ref.item,
|
|
21
|
-
|
|
14
|
+
containerDom = _ref.containerDom;
|
|
22
15
|
var position = useMemo(function () {
|
|
23
16
|
var _containerDom$getBoun = containerDom.getBoundingClientRect(),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
width = _containerDom$getBoun.width,
|
|
18
|
+
height = _containerDom$getBoun.height;
|
|
27
19
|
var _rectInfoWidth$rectIn = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
rectInfoWidth: RECT_INFO_WIDTH,
|
|
21
|
+
rectInfoHeight: item.tags.length * RECT_INFO_HEIGHT + 6 + 30
|
|
22
|
+
},
|
|
23
|
+
rectInfoWidth = _rectInfoWidth$rectIn.rectInfoWidth,
|
|
24
|
+
rectInfoHeight = _rectInfoWidth$rectIn.rectInfoHeight;
|
|
34
25
|
var _item$rect = _slicedToArray(item.rect, 3),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
rectLeft = _item$rect[0],
|
|
27
|
+
rectTop = _item$rect[1],
|
|
28
|
+
rectWidth = _item$rect[2];
|
|
39
29
|
var x, y;
|
|
40
|
-
|
|
41
30
|
if (rectWidth + rectLeft + rectInfoWidth < width) {
|
|
42
31
|
x = rectWidth + rectLeft + RECT_WINDOW_MARGIN;
|
|
43
32
|
} else {
|
|
44
33
|
x = rectLeft - RECT_WINDOW_MARGIN - rectInfoWidth;
|
|
45
34
|
}
|
|
46
|
-
|
|
47
35
|
if (rectTop + rectInfoHeight < height) {
|
|
48
36
|
y = rectTop;
|
|
49
37
|
y = y < 0 ? RECT_WINDOW_MARGIN : y;
|
|
50
38
|
} else {
|
|
51
39
|
y = height - rectInfoHeight;
|
|
52
40
|
}
|
|
53
|
-
|
|
54
41
|
return {
|
|
55
42
|
x: x,
|
|
56
43
|
y: y,
|
|
@@ -90,5 +77,4 @@ function RectInfo(_ref) {
|
|
|
90
77
|
}, v.label));
|
|
91
78
|
})));
|
|
92
79
|
}
|
|
93
|
-
|
|
94
80
|
export default RectInfo;
|
|
@@ -2,12 +2,11 @@ import React, { useCallback, useMemo } from 'react';
|
|
|
2
2
|
import RectInfo from './RectInfo';
|
|
3
3
|
import { computedZIndex } from './utils';
|
|
4
4
|
import "./index.css";
|
|
5
|
-
|
|
6
5
|
function DefaultRects(_ref) {
|
|
7
6
|
var rects = _ref.rects,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
containerDom = _ref.containerDom,
|
|
8
|
+
onClickRect = _ref.onClickRect,
|
|
9
|
+
getRectImage = _ref.getRectImage;
|
|
11
10
|
var renderRects = useMemo(function () {
|
|
12
11
|
return computedZIndex(rects);
|
|
13
12
|
}, [rects]);
|
|
@@ -43,5 +42,4 @@ function DefaultRects(_ref) {
|
|
|
43
42
|
}));
|
|
44
43
|
}));
|
|
45
44
|
}
|
|
46
|
-
|
|
47
45
|
export default DefaultRects;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import RectMenu from '../RectMenu';
|
|
3
3
|
import "./index.css";
|
|
4
|
-
|
|
5
4
|
function DrawRect(_ref) {
|
|
6
5
|
var _ref$rect = _ref.rect,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
rect = _ref$rect === void 0 ? [] : _ref$rect,
|
|
7
|
+
canRenderMenu = _ref.canRenderMenu,
|
|
8
|
+
containerDom = _ref.containerDom,
|
|
9
|
+
onMenuClick = _ref.onMenuClick,
|
|
10
|
+
menus = _ref.menus,
|
|
11
|
+
getRectImage = _ref.getRectImage;
|
|
13
12
|
var x = useMemo(function () {
|
|
14
13
|
return rect[0] + rect[2];
|
|
15
14
|
}, [rect]);
|
|
@@ -37,5 +36,4 @@ function DrawRect(_ref) {
|
|
|
37
36
|
menus: menus
|
|
38
37
|
}));
|
|
39
38
|
}
|
|
40
|
-
|
|
41
39
|
export default DrawRect;
|
|
@@ -4,20 +4,17 @@ import { computedMenuPosition } from './utils';
|
|
|
4
4
|
import "./index.css";
|
|
5
5
|
var MENU_WIDTH = 110;
|
|
6
6
|
var MENU_HEIGHT = 30;
|
|
7
|
-
|
|
8
7
|
function RectMenu(_ref) {
|
|
9
8
|
var x = _ref.x,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
y = _ref.y,
|
|
10
|
+
menus = _ref.menus,
|
|
11
|
+
containerDom = _ref.containerDom,
|
|
12
|
+
onMenuClick = _ref.onMenuClick;
|
|
15
13
|
var _useMemo = useMemo(function () {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
return containerDom.getBoundingClientRect();
|
|
15
|
+
}, [containerDom]),
|
|
16
|
+
width = _useMemo.width,
|
|
17
|
+
height = _useMemo.height;
|
|
21
18
|
var size = useMemo(function () {
|
|
22
19
|
return {
|
|
23
20
|
w: MENU_WIDTH,
|
|
@@ -35,17 +32,15 @@ function RectMenu(_ref) {
|
|
|
35
32
|
var domRef = useRef(null);
|
|
36
33
|
var handleCancelB = useCallback(function (e) {
|
|
37
34
|
return e.stopPropagation();
|
|
38
|
-
}, []);
|
|
39
|
-
|
|
35
|
+
}, []);
|
|
36
|
+
//防止click事件冒泡到查看器
|
|
40
37
|
useEffect(function () {
|
|
41
38
|
var dom = domRef.current;
|
|
42
|
-
|
|
43
39
|
if (dom) {
|
|
44
40
|
dom.addEventListener('mousedown', handleCancelB, false);
|
|
45
41
|
dom.addEventListener('mousemove', handleCancelB, false);
|
|
46
42
|
dom.addEventListener('mouseup', handleCancelB, false);
|
|
47
43
|
}
|
|
48
|
-
|
|
49
44
|
return function () {
|
|
50
45
|
if (dom) {
|
|
51
46
|
dom.removeEventListener('mousedown', handleCancelB, false);
|
|
@@ -77,5 +72,4 @@ function RectMenu(_ref) {
|
|
|
77
72
|
}), v.title);
|
|
78
73
|
}));
|
|
79
74
|
}
|
|
80
|
-
|
|
81
75
|
export default RectMenu;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
export function computedMenuPosition(_ref) {
|
|
2
2
|
var width = _ref.width,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
height = _ref.height,
|
|
4
|
+
position = _ref.position,
|
|
5
|
+
size = _ref.size;
|
|
6
6
|
var x, y;
|
|
7
7
|
x = position[0];
|
|
8
8
|
y = position[1];
|
|
9
|
-
|
|
10
9
|
if (width - x < size.w) {
|
|
11
10
|
x = width - size.w;
|
|
12
11
|
}
|
|
13
|
-
|
|
14
12
|
if (height - y < size.h) {
|
|
15
13
|
y = height - size.h;
|
|
16
14
|
}
|
|
17
|
-
|
|
18
15
|
return {
|
|
19
16
|
x: x,
|
|
20
17
|
y: y
|
|
@@ -5,15 +5,14 @@ import IconFont from '../../../IconFont';
|
|
|
5
5
|
import FullScreen from '../../../FullScreen';
|
|
6
6
|
import "./index.css";
|
|
7
7
|
import '../../../Player/style/iconfont';
|
|
8
|
-
|
|
9
8
|
function Tools(_ref) {
|
|
10
9
|
var scale = _ref.scale,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
imgDownload = _ref.imgDownload,
|
|
11
|
+
setScale = _ref.setScale,
|
|
12
|
+
setRotate = _ref.setRotate,
|
|
13
|
+
containerEle = _ref.containerEle,
|
|
14
|
+
resetPicture = _ref.resetPicture,
|
|
15
|
+
fullScreenChange = _ref.fullScreenChange;
|
|
17
16
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
18
17
|
className: "picture-tools"
|
|
19
18
|
}, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
@@ -75,5 +74,4 @@ function Tools(_ref) {
|
|
|
75
74
|
fullScreenChange: fullScreenChange
|
|
76
75
|
}))));
|
|
77
76
|
}
|
|
78
|
-
|
|
79
77
|
export default Tools;
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from 'react';
|
|
2
|
-
|
|
3
2
|
function WheelScale(_ref) {
|
|
4
3
|
var dom = _ref.dom,
|
|
5
|
-
|
|
4
|
+
setScale = _ref.setScale;
|
|
6
5
|
var onWheel = useCallback(function (e) {
|
|
7
6
|
if (e.ctrlKey || e.metaKey) {
|
|
8
7
|
e.preventDefault();
|
|
9
8
|
e.stopPropagation();
|
|
10
9
|
setScale(e.deltaY > 0 ? -0.2 : 0.2);
|
|
11
10
|
}
|
|
12
|
-
}, [setScale]);
|
|
13
|
-
|
|
11
|
+
}, [setScale]);
|
|
12
|
+
//滚轮缩放
|
|
14
13
|
useEffect(function () {
|
|
15
14
|
if (!dom) {
|
|
16
15
|
return undefined;
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
dom.addEventListener('wheel', onWheel, {
|
|
20
18
|
passive: false
|
|
21
19
|
});
|
|
@@ -25,5 +23,4 @@ function WheelScale(_ref) {
|
|
|
25
23
|
}, [dom, onWheel]);
|
|
26
24
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
27
25
|
}
|
|
28
|
-
|
|
29
26
|
export default WheelScale;
|
package/es/Picture/dragBound.js
CHANGED
|
@@ -5,15 +5,13 @@ export function computedBound(ele, currentPosition, scale, rotate) {
|
|
|
5
5
|
var w = eleRect.width;
|
|
6
6
|
var h = eleRect.height;
|
|
7
7
|
var lx = 0,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
ly = 0;
|
|
10
9
|
if (scale === 1 && isHorizontal) {
|
|
11
10
|
return {
|
|
12
11
|
x: 0,
|
|
13
12
|
y: 0
|
|
14
13
|
};
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
if (scale === 1 && !isHorizontal) {
|
|
18
16
|
lx = 0;
|
|
19
17
|
ly = (w - h) / 2;
|
|
@@ -25,47 +23,36 @@ export function computedBound(ele, currentPosition, scale, rotate) {
|
|
|
25
23
|
} else {
|
|
26
24
|
//TODO 得到缩放后可移动区域 在减去误差 (w - h) / 2
|
|
27
25
|
lx = !isHorizontal ? Math.round(h * (scale - 1) / 2 - (w - h) / 2) : Math.round(w * (scale - 1) / 2);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
}
|
|
27
|
+
//TODO y的限制区域应该是原来宽度的限制区域计算后还要加上原始的(w-h)/2
|
|
31
28
|
ly = !isHorizontal ? Math.round(w * (scale - 1) / 2 + (w - h) / 2) : Math.round(h * (scale - 1) / 2);
|
|
32
29
|
}
|
|
33
|
-
|
|
34
30
|
var x = 0,
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
y = 0;
|
|
37
32
|
if (data.x >= 0 && data.x > lx) {
|
|
38
33
|
x = lx;
|
|
39
34
|
}
|
|
40
|
-
|
|
41
35
|
if (data.x >= 0 && data.x < lx) {
|
|
42
36
|
x = data.x;
|
|
43
37
|
}
|
|
44
|
-
|
|
45
38
|
if (data.x < 0 && data.x < -lx) {
|
|
46
39
|
x = -lx;
|
|
47
40
|
}
|
|
48
|
-
|
|
49
41
|
if (data.x < 0 && data.x > -lx) {
|
|
50
42
|
x = data.x;
|
|
51
43
|
}
|
|
52
|
-
|
|
53
44
|
if (data.y >= 0 && data.y > ly) {
|
|
54
45
|
y = ly;
|
|
55
46
|
}
|
|
56
|
-
|
|
57
47
|
if (data.y >= 0 && data.y < ly) {
|
|
58
48
|
y = data.y;
|
|
59
49
|
}
|
|
60
|
-
|
|
61
50
|
if (data.y < 0 && data.y < -ly) {
|
|
62
51
|
y = -ly;
|
|
63
52
|
}
|
|
64
|
-
|
|
65
53
|
if (data.y < 0 && data.y > -ly) {
|
|
66
54
|
y = data.y;
|
|
67
55
|
}
|
|
68
|
-
|
|
69
56
|
if (x !== data.x || y !== data.y) {
|
|
70
57
|
return {
|
|
71
58
|
x: x,
|