@cloud-app-dev/vidc 3.0.13 → 3.0.16
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/.eslintrc +3 -2
- package/.hintrc +9 -0
- 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/ErrorFallback/index.d.ts +9 -0
- package/es/ErrorFallback/index.js +36 -0
- package/es/ErrorFallback/inerface.d.ts +48 -0
- package/es/FullScreen/index.js +5 -5
- package/es/IconFont/index.d.ts +2 -2
- 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/BasicMap/index.js +3 -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/api/index.d.ts +0 -1
- package/es/Player/api/index.js +0 -1
- package/es/Player/contraller_bar/right_bar.js +2 -3
- package/es/Player/frontend_player.js +2 -2
- package/es/Player/frontend_timeline.js +1 -1
- package/es/Player/iconfont.d.ts +4 -12
- package/es/Player/iconfont.js +7 -9
- package/es/Player/segment_player.js +1 -1
- package/es/Player/single_player.js +2 -2
- package/es/Player/style/iconfont.js +51 -0
- package/es/PlayerExt/index.css +1 -1
- package/es/ScreenPlayer/Live.d.ts +1 -1
- package/es/ScreenPlayer/Live.js +36 -22
- package/es/ScreenPlayer/LiveTools.js +15 -7
- package/es/ScreenPlayer/PlayerWithExt.js +31 -17
- package/es/ScreenPlayer/Record.d.ts +1 -1
- package/es/ScreenPlayer/Record.js +40 -23
- package/es/ScreenPlayer/RecordTools.js +12 -4
- package/es/ScreenPlayer/TimeSlider.js +6 -2
- package/es/ScreenPlayer/demo.js +6 -12
- package/es/ScreenPlayer/index.css +1 -0
- package/es/ScreenPlayer/index.js +4 -3
- package/es/ScreenPlayer/interface.d.ts +4 -0
- package/es/ScreenPlayer/useTimeSlider.js +2 -2
- package/es/Tree/index.js +24 -21
- package/es/index.d.ts +2 -2
- package/es/index.js +3 -3
- package/es/useFullscreen/demo.d.ts +2 -0
- package/es/useFullscreen/demo.js +51 -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 +6 -2
- package/test.html +16 -0
- package/test.js +93 -45
- package/es/ErrorBoundary/index.d.ts +0 -18
- package/es/ErrorBoundary/index.js +0 -79
- package/es/List/renderItem.d.ts +0 -20
- package/es/List/renderItem.js +0 -71
- package/es/Player/style/iconfont.css +0 -179
- package/es/Player/style/iconfont.ttf +0 -0
- package/es/Player/style/iconfont.woff +0 -0
- package/es/Player/style/iconfont.woff2 +0 -0
- package/es/withErrorBoundary/index.d.ts +0 -9
- package/es/withErrorBoundary/index.js +0 -45
package/es/ScreenPlayer/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import withErrorBoundary from '
|
|
1
|
+
import { withErrorBoundary } from 'react-error-boundary';
|
|
2
2
|
import LivePlayer from './Live';
|
|
3
3
|
import RecordPlayer from './Record';
|
|
4
|
+
import { errorBoundaryOptions } from '../ErrorFallback';
|
|
4
5
|
var Sceenplayer = {
|
|
5
|
-
LivePlayer: withErrorBoundary(LivePlayer),
|
|
6
|
-
RecordPlayer: withErrorBoundary(RecordPlayer)
|
|
6
|
+
LivePlayer: withErrorBoundary(LivePlayer, errorBoundaryOptions),
|
|
7
|
+
RecordPlayer: withErrorBoundary(RecordPlayer, errorBoundaryOptions)
|
|
7
8
|
};
|
|
8
9
|
export default Sceenplayer;
|
|
@@ -46,6 +46,8 @@ export interface IRecordPlayerProps {
|
|
|
46
46
|
|
|
47
47
|
defaultScreen?: 1 | 4 | 6 | 9 | 16;
|
|
48
48
|
|
|
49
|
+
screenNum?: 1 | 4 | 6 | 9 | 16;
|
|
50
|
+
|
|
49
51
|
defaultSelectIndex?: number;
|
|
50
52
|
}
|
|
51
53
|
|
|
@@ -122,6 +124,8 @@ export interface ILivePlayerProps {
|
|
|
122
124
|
|
|
123
125
|
defaultScreen?: 1 | 4 | 6 | 9 | 16;
|
|
124
126
|
|
|
127
|
+
screenNum?: 1 | 4 | 6 | 9 | 16;
|
|
128
|
+
|
|
125
129
|
defaultSelectIndex?: number;
|
|
126
130
|
}
|
|
127
131
|
|
|
@@ -381,7 +381,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
381
381
|
});
|
|
382
382
|
|
|
383
383
|
_nextTick(function () {
|
|
384
|
-
return onHoursPerChange
|
|
384
|
+
return onHoursPerChange === null || onHoursPerChange === void 0 ? void 0 : onHoursPerChange(new_hoursPer);
|
|
385
385
|
});
|
|
386
386
|
}, {
|
|
387
387
|
target: canvasRef
|
|
@@ -481,7 +481,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
481
481
|
});
|
|
482
482
|
|
|
483
483
|
_nextTick(function () {
|
|
484
|
-
return onTimeChange
|
|
484
|
+
return onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(new_current, outTimeline);
|
|
485
485
|
});
|
|
486
486
|
} // 清楚拖拽关联信息
|
|
487
487
|
|
package/es/Tree/index.js
CHANGED
|
@@ -18,18 +18,14 @@ function BaseTree(_a, ref) {
|
|
|
18
18
|
icon = _a.icon,
|
|
19
19
|
props = __rest(_a, ["treeData", "className", "showIcon", "treeNodeProps", "icon"]);
|
|
20
20
|
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
_useMemo$nameKey = _useMemo.nameKey,
|
|
30
|
-
nameKey = _useMemo$nameKey === void 0 ? 'name' : _useMemo$nameKey,
|
|
31
|
-
RenderTreeTitle = _useMemo.RenderTreeTitle;
|
|
32
|
-
|
|
21
|
+
var prefix = treeNodeProps.prefix,
|
|
22
|
+
suffix = treeNodeProps.suffix,
|
|
23
|
+
keyword = treeNodeProps.keyword,
|
|
24
|
+
_treeNodeProps$key = treeNodeProps.key,
|
|
25
|
+
key = _treeNodeProps$key === void 0 ? 'id' : _treeNodeProps$key,
|
|
26
|
+
_treeNodeProps$nameKe = treeNodeProps.nameKey,
|
|
27
|
+
nameKey = _treeNodeProps$nameKe === void 0 ? 'name' : _treeNodeProps$nameKe,
|
|
28
|
+
RenderTreeTitle = treeNodeProps.RenderTreeTitle;
|
|
33
29
|
var treeRef = useRef(null);
|
|
34
30
|
useImperativeHandle(ref, function () {
|
|
35
31
|
return {
|
|
@@ -42,6 +38,21 @@ function BaseTree(_a, ref) {
|
|
|
42
38
|
}
|
|
43
39
|
};
|
|
44
40
|
}, [props.checkable]);
|
|
41
|
+
|
|
42
|
+
function defaultRenderTitle(node) {
|
|
43
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
44
|
+
title: node[nameKey],
|
|
45
|
+
className: "tree-item-title"
|
|
46
|
+
}, /*#__PURE__*/React.createElement("span", null, showIcon && (icon === null || icon === void 0 ? void 0 : icon(node)), prefix === null || prefix === void 0 ? void 0 : prefix(node), /*#__PURE__*/React.createElement(HightLevel, {
|
|
47
|
+
keyword: keyword,
|
|
48
|
+
name: node[nameKey]
|
|
49
|
+
})), suffix === null || suffix === void 0 ? void 0 : suffix(node));
|
|
50
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
var titleRender = useMemo(function () {
|
|
54
|
+
return RenderTreeTitle !== null && RenderTreeTitle !== void 0 ? RenderTreeTitle : defaultRenderTitle;
|
|
55
|
+
}, []);
|
|
45
56
|
return /*#__PURE__*/React.createElement(_Tree, Object.assign({
|
|
46
57
|
className: "cloudapp-c-base-tree-component ".concat(className),
|
|
47
58
|
ref: treeRef,
|
|
@@ -59,15 +70,7 @@ function BaseTree(_a, ref) {
|
|
|
59
70
|
title: nameKey
|
|
60
71
|
},
|
|
61
72
|
key: keyword,
|
|
62
|
-
titleRender:
|
|
63
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
64
|
-
title: node[nameKey],
|
|
65
|
-
className: "tree-item-title"
|
|
66
|
-
}, /*#__PURE__*/React.createElement("span", null, showIcon && icon && icon(node), prefix && prefix(node), /*#__PURE__*/React.createElement(HightLevel, {
|
|
67
|
-
keyword: keyword,
|
|
68
|
-
name: node[nameKey]
|
|
69
|
-
})), suffix && suffix(node));
|
|
70
|
-
}
|
|
73
|
+
titleRender: titleRender
|
|
71
74
|
}, props));
|
|
72
75
|
}
|
|
73
76
|
|
package/es/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { default as DisableMark } from './DisableMark';
|
|
|
11
11
|
export { default as DomMove } from './DomMove';
|
|
12
12
|
export { default as Drag } from './Drag';
|
|
13
13
|
export { default as Drawer } from './Drawer';
|
|
14
|
-
export { default as
|
|
14
|
+
export { default as ErrorFallback } from './ErrorFallback';
|
|
15
15
|
export { default as FrontendPlayer } from './FrontendPlayer';
|
|
16
16
|
export { default as FullScreen } from './FullScreen';
|
|
17
17
|
export { default as HightLevel } from './HightLevel';
|
|
@@ -36,7 +36,7 @@ export { default as TableLayout } from './TableLayout';
|
|
|
36
36
|
export { default as ThemeAntd } from './ThemeAntd';
|
|
37
37
|
export { default as Timeout } from './Timeout';
|
|
38
38
|
export { default as Tree } from './Tree';
|
|
39
|
+
export { default as useFullscreen } from './useFullscreen';
|
|
39
40
|
export { default as useHistory } from './useHistory';
|
|
40
41
|
export { default as useInfiniteScroll } from './useInfiniteScroll';
|
|
41
42
|
export { default as useVirtualList } from './useVirtualList';
|
|
42
|
-
export { default as withErrorBoundary } from './withErrorBoundary';
|
package/es/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { default as DisableMark } from './DisableMark';
|
|
|
11
11
|
export { default as DomMove } from './DomMove';
|
|
12
12
|
export { default as Drag } from './Drag';
|
|
13
13
|
export { default as Drawer } from './Drawer';
|
|
14
|
-
export { default as
|
|
14
|
+
export { default as ErrorFallback } from './ErrorFallback';
|
|
15
15
|
export { default as FrontendPlayer } from './FrontendPlayer';
|
|
16
16
|
export { default as FullScreen } from './FullScreen';
|
|
17
17
|
export { default as HightLevel } from './HightLevel';
|
|
@@ -36,7 +36,7 @@ export { default as TableLayout } from './TableLayout';
|
|
|
36
36
|
export { default as ThemeAntd } from './ThemeAntd';
|
|
37
37
|
export { default as Timeout } from './Timeout';
|
|
38
38
|
export { default as Tree } from './Tree';
|
|
39
|
+
export { default as useFullscreen } from './useFullscreen';
|
|
39
40
|
export { default as useHistory } from './useHistory';
|
|
40
41
|
export { default as useInfiniteScroll } from './useInfiniteScroll';
|
|
41
|
-
export { default as useVirtualList } from './useVirtualList';
|
|
42
|
-
export { default as withErrorBoundary } from './withErrorBoundary';
|
|
42
|
+
export { default as useVirtualList } from './useVirtualList';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _useFullscreen3 from "ahooks/es/useFullscreen";
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
5
|
+
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."); }
|
|
6
|
+
|
|
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); }
|
|
8
|
+
|
|
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
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
|
|
15
|
+
import React, { useRef } from 'react';
|
|
16
|
+
export default function App() {
|
|
17
|
+
var ref1 = useRef();
|
|
18
|
+
var ref2 = useRef();
|
|
19
|
+
|
|
20
|
+
var _useFullscreen = _useFullscreen3(ref1),
|
|
21
|
+
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
22
|
+
fullscreen1 = _useFullscreen2[0],
|
|
23
|
+
options1 = _useFullscreen2[1];
|
|
24
|
+
|
|
25
|
+
var _useFullscreen4 = _useFullscreen3(ref2),
|
|
26
|
+
_useFullscreen5 = _slicedToArray(_useFullscreen4, 2),
|
|
27
|
+
fullscreen2 = _useFullscreen5[0],
|
|
28
|
+
options2 = _useFullscreen5[1];
|
|
29
|
+
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: "App"
|
|
32
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
style: {
|
|
34
|
+
width: 400,
|
|
35
|
+
height: 400,
|
|
36
|
+
background: 'blue'
|
|
37
|
+
},
|
|
38
|
+
ref: ref1
|
|
39
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
40
|
+
onClick: options1.toggleFullscreen
|
|
41
|
+
}, "\u7236\u5143\u7D20", fullscreen1 ? '退出全屏' : '全屏'), /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
style: {
|
|
43
|
+
width: 200,
|
|
44
|
+
height: 200,
|
|
45
|
+
background: 'red'
|
|
46
|
+
},
|
|
47
|
+
ref: ref2
|
|
48
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
49
|
+
onClick: options2.toggleFullscreen
|
|
50
|
+
}, "\u5B50\u5143\u7D20", fullscreen2 ? '退出全屏' : '全屏'))), /*#__PURE__*/React.createElement("div", null));
|
|
51
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BasicTarget } from 'ahooks/es/utils/domTarget';
|
|
2
|
+
export interface Options {
|
|
3
|
+
onExit?: () => void;
|
|
4
|
+
onEnter?: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const useFullscreen: (target: BasicTarget, options?: Options) => readonly [boolean, {
|
|
7
|
+
readonly enterFullscreen: () => void;
|
|
8
|
+
readonly exitFullscreen: () => void;
|
|
9
|
+
readonly toggleFullscreen: () => void;
|
|
10
|
+
readonly isEnabled: boolean;
|
|
11
|
+
}];
|
|
12
|
+
export default useFullscreen;
|
|
@@ -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.16",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "dumi dev",
|
|
8
8
|
"docs:build": "dumi build",
|
|
@@ -36,10 +36,14 @@
|
|
|
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
|
+
"react-error-boundary": "^3.1.4",
|
|
41
|
+
"screenfull": "^6.0.2"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
44
|
"@cloud-app-dev/utils": "^4.0.1",
|
|
45
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
46
|
+
"@types/jest": "^29.0.1",
|
|
43
47
|
"@types/leaflet": "^1.7.11",
|
|
44
48
|
"@types/lodash-es": "^4.17.6",
|
|
45
49
|
"@types/node": "^18.7.6",
|
package/test.html
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Document</title>
|
|
8
|
+
<script src="./test.js"></script>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<script>
|
|
12
|
+
const html = `<p class=MsoNormal ><span ><font face="仿宋_GB2312" >涉案服装合格证上带有</font><font face="仿宋_GB2312" >“售后服务热线:18928955232”等信息;购物小票显示该店地址为“芙蓉中路一段88号天健芙蓉盛,汇名仓外贸服装店(小门东1门旁)”,并且带有“合作热线:188-1184-0024、13360003040”等信息;店内宣传有“DHC二维码”等信息。涉案服装合格证上带有“‘</font></span><img width="720" height="720" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2671.png" ><span ><font face="仿宋_GB2312" >’商标、</font></span><span><a href="http://www.dhcfs.com" ><u><span class="16" ><font face="仿宋_GB2312" >www.dhcfs.com</font></span></u></a></span><span ><font face="仿宋_GB2312" >网址</font><font face="仿宋_GB2312" >”等信息,下方显示地址为“开平市幕沙路70号益华广场B幢131室”;购物小票上显示官网网址为“</font></span><span><a href="http://www.dhcfs.com" ><u><span class="16" ><font face="仿宋_GB2312" >www.dhcfs.com</font></span></u></a></span><span ><font face="仿宋_GB2312" >”;购物塑料袋上带有“‘</font></span><img width="720" height="720" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2672.png" ><a href="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2672.png">11111</a><span ><font face="仿宋_GB2312" >’商标、</font></span><span><a href="http://www.dhcfs.com" ><u><span class="16" ><font face="仿宋_GB2312" >www.dhcfs.com</font></span></u></a></span><span ><font face="仿宋_GB2312" >网址</font><font face="仿宋_GB2312" >”等信息。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >被</font><font face="仿宋_GB2312" >1:同其他实物证据意见一致。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >被</font><font face="仿宋_GB2312" >2、4:同上意见。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >原:出示证据</font><font face="仿宋_GB2312" >12封存实物。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >?:各被告确认被控侵权产品封存是否完好。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >被</font><font face="仿宋_GB2312" >1:完好。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >被</font><font face="仿宋_GB2312" >2、4:完好。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >?:当庭开启,发表比对意见。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >原:(</font><font face="仿宋_GB2312" >1)1件蓝色棒球运动服,正面带有“</font></span><img width="1576" height="1440" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2673.jpg" ><span ><font face="仿宋_GB2312" >” “YANKEES”标识,与原告第4336076号、第4336075号注册商标相同,背面带有“YANKEES”标识,与原告第4336075号注册商标相同,衣袖带有“</font></span><img width="2560" height="1390" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2674.jpg" ><span ><font face="仿宋_GB2312" >”标识,与原告第1800888号注册商标相同,纽扣使用“MLB”标识,与原告第4336063号注册商标相同,水洗标带有“</font></span><img width="1249" height="720" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2675.jpg" ><span ><font face="仿宋_GB2312" >” “MLB”标识,与原告第506821号、第4336063号注册商标相同;</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >(</font><font face="仿宋_GB2312" >2)1条紫色裤子,正面带有“</font></span><img width="1440" height="1932" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2676.jpg" ><span ><font face="仿宋_GB2312" >” “</font></span><img width="1280" height="652" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2677.jpg" ><span ><font face="仿宋_GB2312" >”标识,与原告第506820号、第4336084号注册商标相同,裤子的背面带有“</font></span><img width="2560" height="1390" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2678.jpg" ><span ><font face="仿宋_GB2312" >”标识,与原告第1800888号注册商标相同,水洗标带有“</font></span><img width="1249" height="720" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2679.jpg" ><span ><font face="仿宋_GB2312" >” “MLB”标识,与原告第506821号、第4336063号注册商标相同。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >被</font><font face="仿宋_GB2312" >1:真实性、合法性无异议,关联性不认可。该商品并非被告1销售,也没有证据证明该商品属于侵权商品,销售方有可能是从合法途径进货销售的。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >被</font><font face="仿宋_GB2312" >2、4:同被告1意见。关于购物袋和卡牌的意见与证据8一致。被告胡拔庆与</font></span><span ><font face="仿宋_GB2312" >大汇仓设计室旗下店铺</font><font face="仿宋_GB2312" >“汇名仓 外贸出口成衣工厂店”(长沙华创店)有其他自有品牌合作,没有授权其在该被控侵权产品上使用,该商品来源我方也不清楚,应当由该店铺经营者自行陈述。涉案产品也不是我方销售给涉案店铺的。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >原:出示证据</font><font face="仿宋_GB2312" >14封存实物。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >?:各被告确认被控侵权产品封存是否完好。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >被</font><font face="仿宋_GB2312" >1:完好。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >被</font><font face="仿宋_GB2312" >2、4:完好。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >?:当庭开启,发表比对意见。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >原:(</font><font face="仿宋_GB2312" >1)1件深蓝色棒球服,正面带有“</font></span><img width="1576" height="1440" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2680.jpg" ><span ><font face="仿宋_GB2312" >” “YANKEES”标识,与原告第4336076号、第4336075号注册商标相同,背面带有“</font></span><img width="2560" height="1386" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2681.jpg" ><span ><font face="仿宋_GB2312" >”标识,与原告第</font></span><span >1800888</span><span ><font face="仿宋_GB2312" >号注册商标相同,纽扣使用</font><font face="仿宋_GB2312" >“MLB”标识,与原告第4336063号注册商标相同,水洗标带有“</font></span><img width="1241" height="720" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2682.jpg" ><span ><font face="仿宋_GB2312" >” “MLB”标识,与原告第</font></span><span >506821</span><span ><font face="仿宋_GB2312" >号、第</font><font face="仿宋_GB2312" >4336063号注册商标相同;</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >(</font><font face="仿宋_GB2312" >2)1件蓝色卫衣,正面带有“</font></span><img width="1440" height="1540" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2683.jpg" ><span ><font face="仿宋_GB2312" >” “YANKEES”标识,与原告第</font></span><span >506836</span><span ><font face="仿宋_GB2312" >号、第</font><font face="仿宋_GB2312" >4336075号注册商标相同,水洗标带有“</font></span><img width="1241" height="720" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2684.jpg" ><span ><font face="仿宋_GB2312" >” “MLB”标识,与原告第</font></span><span >506821</span><span ><font face="仿宋_GB2312" >号、第</font><font face="仿宋_GB2312" >4336063号注册商标相同。蓝色卫衣吊牌“大汇仓”商标以及网站与其他被控侵权产品实物一致,但是吊牌上售后服务热线为4008088140,经销商为南京庆创服饰有限公司。</font></span><span ><o:p></o:p></span></p><table class=MsoTableGrid border=1 cellspacing=0 ><tr><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td></tr><tr><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td></tr><tr><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td></tr><tr><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td></tr><tr><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td></tr><tr><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td><td width=66 valign=top ><p class=MsoNormal ><span ><o:p> </o:p></span></p></td></tr></table><p class=MsoNormal ><span ><o:p> </o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >被</font><font face="仿宋_GB2312" >1:与其他侵权实物证据质证意见一致。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >被</font><font face="仿宋_GB2312" >2、4:公证书、实物真实性、合法性无异议,认可蓝色棒球服上的卡牌是被告、4提供,但是蓝色卫衣该吊牌上所显示公司并不存在,该卡牌长的与被告2、4提供的卡牌有部分相似之处,但并不是被告提供,不清楚来源,细看发现字体和颜色是有差异的。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >原:从蓝色卫衣上的大汇仓商标和网站信息可以将商品来源指向被告</font><font face="仿宋_GB2312" >2、4。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >原:出示证据</font><font face="仿宋_GB2312" >16封存实物。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >?:各被告确认被控侵权产品封存是否完好。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >被</font><font face="仿宋_GB2312" >1:完好。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >被</font><font face="仿宋_GB2312" >2、4:完好。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >?:当庭开启,发表比对意见。</font></span><span ><o:p></o:p></span></p><p class=MsoNormal ><span ><font face="仿宋_GB2312" >原:</font><font face="仿宋_GB2312" >1件蓝色棒球运动服,正面带有“</font></span><img width="1576" height="1440" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2685.jpg" ><span ><font face="仿宋_GB2312" >” “YANKEES”标识,与原告第4336076号、第4336075号注册商标相同,背面带有“</font></span><img width="2560" height="1390" src="file:////private/var/folders/51/wvlmktvs2r3__qp4bg2q5nbm0000gn/T/com.kingsoft.wpsoffice.mac/wps-huang/ksohtml//wps2686.jpg" ><span ><font face="仿宋_GB2312" >”标识,与原告第1800888号注册商标相同,纽扣带有“MLB”标识,与原告第4336063号注册商标相同,水</font></span></p>`
|
|
13
|
+
document.body.innerHTML = parseHtml(html)
|
|
14
|
+
</script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
package/test.js
CHANGED
|
@@ -1,48 +1,96 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
const igrone_tag = ['table', 'ul', 'ol', 'img'];
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {string} html
|
|
6
|
+
* @returns {HTMLElement}
|
|
7
|
+
*/
|
|
8
|
+
function parseHtml(html) {
|
|
9
|
+
let htmlstr = '';
|
|
10
|
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
|
11
|
+
Array.from(doc.body.childNodes).forEach((item) => {
|
|
12
|
+
const tag = item.tagName ? item.tagName.toLowerCase() : '';
|
|
13
|
+
const html_str = getNodeHTML(item);
|
|
14
|
+
htmlstr += igrone_tag.includes(tag) ? html_str : `<p class="parse-html-p">${html_str}</p>`;
|
|
15
|
+
});
|
|
16
|
+
return htmlstr;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const filter_map = {
|
|
20
|
+
img: filterImgAttr,
|
|
21
|
+
table: filterTableAttr,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param {HTMLElement} node HTML
|
|
27
|
+
* @returns {string}
|
|
28
|
+
*/
|
|
29
|
+
function getNodeHTML(node, html = '') {
|
|
30
|
+
if (node.nodeType === 3) {
|
|
31
|
+
html += node.textContent.replace(/\s/, '');
|
|
32
|
+
return html;
|
|
30
33
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
|
|
35
|
+
// 过滤其他
|
|
36
|
+
if (node.nodeType !== 1) {
|
|
37
|
+
return html;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const tag = node.tagName.toLowerCase();
|
|
41
|
+
|
|
42
|
+
switch (tag) {
|
|
43
|
+
case 'img':
|
|
44
|
+
case 'table':
|
|
45
|
+
filter_map[tag](node);
|
|
46
|
+
html += node.outerHTML;
|
|
47
|
+
break;
|
|
48
|
+
default:
|
|
49
|
+
const childNodes = node.childNodes;
|
|
50
|
+
if (childNodes.length > 0) {
|
|
51
|
+
Array.from(childNodes).forEach((item) => {
|
|
52
|
+
html += getNodeHTML(item); // 合并标签处理,并且递归处理子元素
|
|
53
|
+
});
|
|
54
|
+
} else {
|
|
55
|
+
html += node.innerText.replace(/\s/, '');
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
45
58
|
}
|
|
46
|
-
return
|
|
59
|
+
return html;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param {HTMLElement} node
|
|
65
|
+
*/
|
|
66
|
+
function filterImgAttr(node) {
|
|
67
|
+
node.removeAttribute('width');
|
|
68
|
+
node.removeAttribute('height');
|
|
69
|
+
|
|
70
|
+
// 非顶层的img定义成行内元素,顶层定义为块元素
|
|
71
|
+
if (node.parentNode !== document.body) {
|
|
72
|
+
node.setAttribute('width', 40);
|
|
73
|
+
node.setAttribute('class', 'parse-html-img-inline');
|
|
74
|
+
} else {
|
|
75
|
+
node.style.display = 'block';
|
|
76
|
+
node.setAttribute('class', 'parse-html-img-block');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* @param {HTMLTableElement} node
|
|
83
|
+
*/
|
|
84
|
+
function filterTableAttr(node) {
|
|
85
|
+
// 表格自适应
|
|
86
|
+
node.setAttribute('width', '100%');
|
|
87
|
+
node.setAttribute('class', 'parse-html-table');
|
|
88
|
+
const tds = node.querySelectorAll('td');
|
|
89
|
+
Array.from(tds).forEach((item_td) => {
|
|
90
|
+
//td 自适应
|
|
91
|
+
item_td.removeAttribute('width');
|
|
92
|
+
|
|
93
|
+
//格式化td内容
|
|
94
|
+
item_td.innerHTML = parseHtml(item_td.innerHTML);
|
|
95
|
+
});
|
|
47
96
|
}
|
|
48
|
-
console.log(completionSegments(1660492800000, 1660579199000, data))
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React, { Component, ErrorInfo } from 'react';
|
|
2
|
-
export declare type IErrorBoundaryProps = {
|
|
3
|
-
fallback?: React.ReactNode;
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
};
|
|
6
|
-
declare type State = {
|
|
7
|
-
error: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare class ErrorBoundary extends Component<IErrorBoundaryProps, State> {
|
|
10
|
-
state: State;
|
|
11
|
-
static defaultProps: {
|
|
12
|
-
fallback: () => JSX.Element;
|
|
13
|
-
};
|
|
14
|
-
static getDerivedStateFromError(error: Error): State;
|
|
15
|
-
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
16
|
-
render(): React.ReactNode;
|
|
17
|
-
}
|
|
18
|
-
export default ErrorBoundary;
|