@cloud-app-dev/vidc 2.1.0-alpha.9 → 2.2.0-alpha.1

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.
Files changed (126) hide show
  1. package/.umirc.ts +1 -1
  2. package/es/AppContext/Sync.d.ts +1 -0
  3. package/es/AppContext/interface.d.ts +4 -1
  4. package/es/AppRedirect/index.d.ts +1 -0
  5. package/es/CheckGroupFixed/index.d.ts +1 -0
  6. package/es/DeviceSelect/TreeType.d.ts +1 -0
  7. package/es/DeviceSelect/demo.d.ts +1 -0
  8. package/es/DeviceSelect/index.d.ts +1 -0
  9. package/es/DeviceSelect/index.js +1 -1
  10. package/es/Drag/DragAndDropItem.js +2 -2
  11. package/es/Drag/DropItem.js +2 -2
  12. package/es/Drawer/Footer.d.ts +1 -0
  13. package/es/Drawer/index.d.ts +1 -0
  14. package/es/InitialConfig/utils.d.ts +5 -5
  15. package/es/InitialConfig/utils.js +19 -19
  16. package/es/Input/index.d.ts +1 -0
  17. package/es/List/CheckExt.d.ts +1 -0
  18. package/es/List/DeviceList/index.js +1 -1
  19. package/es/List/DynamicDeviceList/Demo.d.ts +1 -0
  20. package/es/List/DynamicDeviceList/index.d.ts +1 -0
  21. package/es/List/VList/index.d.ts +1 -0
  22. package/es/List/index.d.ts +1 -0
  23. package/es/LoaderApp/loader.js +2 -6
  24. package/es/LoaderApp/utils.d.ts +1 -0
  25. package/es/LoaderApp/utils.js +37 -0
  26. package/es/Modal/index.d.ts +1 -0
  27. package/es/Picture/component/DefaultRects/RectInfo.d.ts +1 -0
  28. package/es/Picture/component/DefaultRects/index.d.ts +2 -1
  29. package/es/Picture/component/DrawRect/index.d.ts +3 -4
  30. package/es/Picture/component/RectMenu/index.d.ts +2 -3
  31. package/es/Picture/component/WheelScale/index.d.ts +1 -0
  32. package/es/Picture/component/WheelScale/index.js +3 -3
  33. package/es/Picture/index.d.ts +1 -0
  34. package/es/Picture/index.js +4 -2
  35. package/es/Picture/interface.d.ts +4 -2
  36. package/es/Picture/utils.d.ts +1 -0
  37. package/es/Player/api/index.d.ts +71 -0
  38. package/es/Player/api/index.js +284 -0
  39. package/es/Player/contraller_bar/bar.d.ts +8 -0
  40. package/es/Player/contraller_bar/bar.js +21 -0
  41. package/es/Player/contraller_bar/contraller_event.d.ts +9 -0
  42. package/es/Player/contraller_bar/contraller_event.js +57 -0
  43. package/es/Player/contraller_bar/index.d.ts +19 -0
  44. package/es/Player/contraller_bar/index.js +37 -0
  45. package/es/Player/contraller_bar/left_bar.d.ts +15 -0
  46. package/es/Player/contraller_bar/left_bar.js +91 -0
  47. package/es/Player/contraller_bar/right_bar.d.ts +13 -0
  48. package/es/Player/contraller_bar/right_bar.js +55 -0
  49. package/es/Player/contraller_bar/useBarStatus.d.ts +3 -0
  50. package/es/Player/contraller_bar/useBarStatus.js +52 -0
  51. package/es/Player/demo.d.ts +2 -0
  52. package/es/Player/demo.js +269 -0
  53. package/es/Player/event/browserTabEvent.d.ts +9 -0
  54. package/es/Player/event/browserTabEvent.js +57 -0
  55. package/es/Player/event/errorEvent.d.ts +16 -0
  56. package/es/Player/event/errorEvent.js +120 -0
  57. package/es/Player/event/eventName.d.ts +3 -0
  58. package/es/Player/event/eventName.js +15 -0
  59. package/es/Player/event/index.d.ts +22 -0
  60. package/es/Player/event/index.js +175 -0
  61. package/es/Player/frontend_player.d.ts +15 -0
  62. package/es/Player/frontend_player.js +90 -0
  63. package/es/Player/frontend_timeline.d.ts +14 -0
  64. package/es/Player/frontend_timeline.js +141 -0
  65. package/es/Player/iconfont.d.ts +13 -0
  66. package/es/Player/iconfont.js +18 -0
  67. package/es/Player/index.d.ts +4 -0
  68. package/es/Player/index.js +4 -0
  69. package/es/Player/live_heart.d.ts +6 -0
  70. package/es/Player/live_heart.js +29 -0
  71. package/es/Player/message.d.ts +11 -0
  72. package/es/Player/message.js +150 -0
  73. package/es/Player/player.d.ts +75 -0
  74. package/es/Player/segment_player.d.ts +13 -0
  75. package/es/Player/segment_player.js +191 -0
  76. package/es/Player/segment_timeline.d.ts +16 -0
  77. package/es/Player/segment_timeline.js +154 -0
  78. package/es/Player/single_player.d.ts +5 -0
  79. package/es/Player/single_player.js +185 -0
  80. package/es/Player/style/bar.css +37 -0
  81. package/es/Player/style/iconfont.css +62 -0
  82. package/es/Player/style/index.css +22 -0
  83. package/es/Player/style/message.css +49 -0
  84. package/es/Player/style/slider.css +96 -0
  85. package/es/Player/style/timeline.css +92 -0
  86. package/es/Player/timeline.d.ts +11 -0
  87. package/es/Player/timeline.js +104 -0
  88. package/es/Player/util.d.ts +48 -0
  89. package/es/Player/util.js +172 -0
  90. package/es/Progress/index.d.ts +1 -0
  91. package/es/Tree/BaseTree/demo.d.ts +1 -0
  92. package/es/Tree/BaseTree/index.d.ts +2 -2
  93. package/es/Tree/demo.d.ts +1 -0
  94. package/es/Tree/index.js +1 -1
  95. package/es/UserSelect/demo.d.ts +1 -0
  96. package/es/WorkerFlow/Form/Approver.d.ts +1 -0
  97. package/es/WorkerFlow/Form/Condition.d.ts +1 -0
  98. package/es/WorkerFlow/Form/EmptyUserSet.d.ts +1 -0
  99. package/es/WorkerFlow/Form/FormAuth.d.ts +1 -0
  100. package/es/WorkerFlow/Form/GroupList.d.ts +1 -0
  101. package/es/WorkerFlow/Form/GroupSelect.d.ts +1 -0
  102. package/es/WorkerFlow/Form/Handle.d.ts +1 -0
  103. package/es/WorkerFlow/Form/LevelGroupSelect.d.ts +1 -0
  104. package/es/WorkerFlow/Form/Notifier.d.ts +1 -0
  105. package/es/WorkerFlow/Form/UserAndGroupSelect.d.ts +1 -0
  106. package/es/WorkerFlow/Form/UserSelect.d.ts +1 -0
  107. package/es/WorkerFlow/Form/UserSet.d.ts +1 -0
  108. package/es/WorkerFlow/Form/UsersHandleType.d.ts +1 -0
  109. package/es/WorkerFlow/Nodes/Add.d.ts +1 -0
  110. package/es/WorkerFlow/Nodes/Add.js +1 -1
  111. package/es/WorkerFlow/Nodes/AddOption.d.ts +1 -0
  112. package/es/WorkerFlow/Nodes/AddOptionList.d.ts +1 -0
  113. package/es/WorkerFlow/Nodes/Approver.d.ts +1 -0
  114. package/es/WorkerFlow/Nodes/Condition.d.ts +1 -0
  115. package/es/WorkerFlow/Nodes/End.d.ts +1 -0
  116. package/es/WorkerFlow/Nodes/Handle.d.ts +1 -0
  117. package/es/WorkerFlow/Nodes/Node.d.ts +1 -0
  118. package/es/WorkerFlow/Nodes/Notifier.d.ts +1 -0
  119. package/es/WorkerFlow/Nodes/Render.d.ts +1 -0
  120. package/es/WorkerFlow/Nodes/Start.d.ts +1 -0
  121. package/es/WorkerFlow/Nodes/TitleElement.d.ts +1 -0
  122. package/es/index.d.ts +3 -3
  123. package/es/index.js +4 -4
  124. package/package.json +13 -10
  125. package/es/AppRouter/index.d.ts +0 -8
  126. package/es/AppRouter/index.js +0 -17
package/.umirc.ts CHANGED
@@ -5,7 +5,7 @@ const token =
5
5
  'eyJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NiIsImV4dCI6MTY0MDQwOTc4NjQ3OCwidWlkIjoiMTAxMDAwMDAwMjQ5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTAzODddLCJ2YWxpZFRpbWUiOm51bGwsIm9wdENlbnRlcklkIjoiMTAwMTAwMDAwMjMzIiwidXNlclR5cGUiOjEwMDcwMiwiaWF0IjoxNjQwMTUwNTg2NDc4fQ.9a8me82dxS_DJ52Ac8eBu1Y2Gigs7mZ6Cm3Rd-tj5Vk';
6
6
 
7
7
  export default defineConfig({
8
- title: '云应用-业务组件库',
8
+ title: 'CloudApp VIDC',
9
9
  favicon: 'https://user-images.githubusercontent.com/9554297/83762004-a0761b00-a6a9-11ea-83b4-9c8ff721d4b8.png',
10
10
  logo: 'https://user-images.githubusercontent.com/9554297/83762004-a0761b00-a6a9-11ea-83b4-9c8ff721d4b8.png',
11
11
  outputPath: 'docs-dist',
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AppContextInterface } from './interface';
2
3
  interface ISyncProps {
3
4
  stateChange: (options: AppContextInterface) => void;
@@ -15,9 +15,12 @@ export type UserInfoType = {
15
15
  userSource: string;
16
16
  userType: string;
17
17
  validState: string;
18
+ [key: string]: any;
18
19
  };
19
20
 
20
- export type OperationInfoType = {};
21
+ export type OperationInfoType = {
22
+ [key: string]: any;
23
+ };
21
24
 
22
25
  export interface AppContextInterface {
23
26
  user: UserInfoType;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as H from 'history';
2
3
  import './index.less';
3
4
  interface AppRedirectProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  export interface SourceDictType {
3
4
  value?: string | number;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface ITreeTypeProps {
2
3
  mode: string;
3
4
  onChange: (mode: string) => void;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare function App(): JSX.Element;
2
3
  export default App;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DeviceItemType } from '../core';
2
3
  import './index.less';
3
4
  interface IDeviceSelectProps {
@@ -51,7 +51,7 @@ function DeviceSelect(_ref) {
51
51
 
52
52
  useEffect(function () {
53
53
  if (state.selectDevices || !selectDevices) {
54
- return null;
54
+ return;
55
55
  }
56
56
 
57
57
  var ids = selectDevices === null || selectDevices === void 0 ? void 0 : selectDevices.map(function (v) {
@@ -59,8 +59,8 @@ function DragAndDropItem(_ref) {
59
59
  return [old[0], 'dragleave'];
60
60
  });
61
61
  }, []);
62
- var allowDrop = useCallback(function (e) {
63
- e.preventDefault();
62
+ var allowDrop = useCallback(function (event) {
63
+ return event.preventDefault();
64
64
  }, []);
65
65
  var onDragStart = useCallback(function (event) {
66
66
  if (!domRef.current) {
@@ -38,8 +38,8 @@ function DropItem(_ref) {
38
38
  event.stopPropagation();
39
39
  setStatus('dragleave');
40
40
  }, []);
41
- var allowDrop = useCallback(function (e) {
42
- e.preventDefault();
41
+ var allowDrop = useCallback(function (event) {
42
+ return event.preventDefault();
43
43
  }, []);
44
44
  return /*#__PURE__*/React.cloneElement(children, {
45
45
  ref: domRef,
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { IFooterProps } from './interface';
2
3
  import './index.less';
3
4
  declare function Footer({ onClose, cancelText, okText, onOk }: IFooterProps): JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DrawerProps } from './interface';
2
3
  import './index.less';
3
4
  declare function ZVDrawer({ style, getContainer, onClose, className, onOk, cancelText, okText, children, ...props }: DrawerProps): JSX.Element;
@@ -3,11 +3,6 @@
3
3
  * @description 获取系统配置
4
4
  */
5
5
  export declare function queryBSConfig(): Promise<any>;
6
- /**
7
- *
8
- * @description 获取所有微应用配置
9
- */
10
- export declare function queryMicroApplicationList(): Promise<any>;
11
6
  /**
12
7
  *
13
8
  * @description 获取平台升级状态
@@ -18,3 +13,8 @@ export declare function querySystemUpdate(): Promise<any>;
18
13
  * @description 获取平台配色
19
14
  */
20
15
  export declare function queryDefaultTheme(): Promise<any>;
16
+ /**
17
+ *
18
+ * @description 获取所有微应用
19
+ */
20
+ export declare function queryMicroApplicationList(): Promise<any>;
@@ -29,24 +29,20 @@ export function queryBSConfig() {
29
29
  }
30
30
  /**
31
31
  *
32
- * @description 获取所有微应用配置
32
+ * @description 获取平台升级状态
33
33
  */
34
34
 
35
- export function queryMicroApplicationList() {
35
+ export function querySystemUpdate() {
36
36
  return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
37
37
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
38
38
  while (1) {
39
39
  switch (_context2.prev = _context2.next) {
40
40
  case 0:
41
- _context2.next = 2;
42
- return Service.http({
43
- url: "/statics/config/app.conf.json?".concat(Date.now())
44
- });
45
-
46
- case 2:
47
- return _context2.abrupt("return", _context2.sent.data);
41
+ return _context2.abrupt("return", Service.http({
42
+ url: "/statics/config/update.status.conf.json?".concat(Date.now())
43
+ }));
48
44
 
49
- case 3:
45
+ case 1:
50
46
  case "end":
51
47
  return _context2.stop();
52
48
  }
@@ -56,20 +52,24 @@ export function queryMicroApplicationList() {
56
52
  }
57
53
  /**
58
54
  *
59
- * @description 获取平台升级状态
55
+ * @description 获取平台配色
60
56
  */
61
57
 
62
- export function querySystemUpdate() {
58
+ export function queryDefaultTheme() {
63
59
  return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
64
60
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
65
61
  while (1) {
66
62
  switch (_context3.prev = _context3.next) {
67
63
  case 0:
68
- return _context3.abrupt("return", Service.http({
69
- url: "/statics/config/update.status.conf.json?".concat(Date.now())
70
- }));
64
+ _context3.next = 2;
65
+ return Service.http({
66
+ url: "/statics/config/theme.info.json?".concat(Date.now())
67
+ });
71
68
 
72
- case 1:
69
+ case 2:
70
+ return _context3.abrupt("return", _context3.sent.data);
71
+
72
+ case 3:
73
73
  case "end":
74
74
  return _context3.stop();
75
75
  }
@@ -79,10 +79,10 @@ export function querySystemUpdate() {
79
79
  }
80
80
  /**
81
81
  *
82
- * @description 获取平台配色
82
+ * @description 获取所有微应用
83
83
  */
84
84
 
85
- export function queryDefaultTheme() {
85
+ export function queryMicroApplicationList() {
86
86
  return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
87
87
  return regeneratorRuntime.wrap(function _callee4$(_context4) {
88
88
  while (1) {
@@ -90,7 +90,7 @@ export function queryDefaultTheme() {
90
90
  case 0:
91
91
  _context4.next = 2;
92
92
  return Service.http({
93
- url: "/statics/config/theme.info.json?".concat(Date.now())
93
+ url: '/api/micro-app-service/app/v1/allList'
94
94
  });
95
95
 
96
96
  case 2:
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { InputProps } from 'antd';
2
3
  import './index.less';
3
4
  interface IInputProps extends Omit<InputProps, 'onChange'> {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface ICheckExtProps {
2
3
  selectCount: number;
3
4
  count: number;
@@ -21,7 +21,7 @@ function DeviceList(_a) {
21
21
  });
22
22
  }, [getIconStyle]);
23
23
  var deleteItemAction = useCallback(function (item, e) {
24
- e.stopPropagation(e);
24
+ e.stopPropagation();
25
25
  e.preventDefault();
26
26
  deleteItem && deleteItem(item);
27
27
  }, []);
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare function App(): JSX.Element;
2
3
  export default App;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { IDynamicDeviceListProps } from './interface';
2
3
  import './index.less';
3
4
  declare function DynamicDeviceList({ onClick, checkedKeys, defaultCheckedIds, onChecked, params, title, onKeywordChange, limit, itemHeight }: IDynamicDeviceListProps): JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface IVListProps<T> {
3
4
  data?: Array<T>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CheckListProps } from './interface';
2
3
  import './index.less';
3
4
  declare function List(props: CheckListProps<any>): JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { __awaiter } from "tslib";
2
- import { arrayify, rewrite } from './utils';
2
+ import { arrayify, fetchStyle, rewrite } from './utils';
3
3
  var _global = window;
4
4
  export function createScopedCssText(_ref) {
5
5
  var styleNode = _ref.styleNode,
@@ -27,11 +27,7 @@ export function LoaderStyle(_ref2) {
27
27
  }
28
28
 
29
29
  _context.next = 3;
30
- return fetch(style).then(function (r) {
31
- return r.text();
32
- }).catch(function () {
33
- return '';
34
- });
30
+ return fetchStyle(style);
35
31
 
36
32
  case 3:
37
33
  cssText = _context.sent;
@@ -10,5 +10,6 @@ export declare const getMicroConfig: (appConfig: AppItemType, appProps: any, con
10
10
  html: string;
11
11
  };
12
12
  };
13
+ export declare function fetchStyle(style: string): Promise<string>;
13
14
  export declare const arrayify: <T>(list: CSSRuleList | any[]) => T[];
14
15
  export declare function rewrite(rules: CSSRule[], prefix?: string): string;
@@ -1,3 +1,4 @@
1
+ import { __awaiter } from "tslib";
1
2
  export var getMicroConfig = function getMicroConfig() {
2
3
  var appConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3
4
  var appProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -18,6 +19,42 @@ export var getMicroConfig = function getMicroConfig() {
18
19
  entry: microAppEntry
19
20
  };
20
21
  };
22
+ var styleCache = {};
23
+ export function fetchStyle(style) {
24
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
25
+ var cssText;
26
+ return regeneratorRuntime.wrap(function _callee$(_context) {
27
+ while (1) {
28
+ switch (_context.prev = _context.next) {
29
+ case 0:
30
+ if (!styleCache[style]) {
31
+ _context.next = 2;
32
+ break;
33
+ }
34
+
35
+ return _context.abrupt("return", styleCache[style]);
36
+
37
+ case 2:
38
+ _context.next = 4;
39
+ return fetch(style).then(function (r) {
40
+ return r.text();
41
+ }).catch(function () {
42
+ return '';
43
+ });
44
+
45
+ case 4:
46
+ cssText = _context.sent;
47
+ styleCache[style] = cssText;
48
+ return _context.abrupt("return", cssText);
49
+
50
+ case 7:
51
+ case "end":
52
+ return _context.stop();
53
+ }
54
+ }
55
+ }, _callee);
56
+ }));
57
+ }
21
58
  var RuleType = {
22
59
  // type: rule will be rewrote
23
60
  STYLE: 1,
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ModalProps } from './interface';
2
3
  import './index.less';
3
4
  declare function Modal({ children, className, style, getContainer, ...props }: ModalProps): JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { RectType } from '../../interface';
2
3
  interface IRectInfoProps {
3
4
  item: RectType;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { RectType } from '../../interface';
2
3
  import './index.less';
3
4
  interface IDefaultRectsProps {
@@ -6,7 +7,7 @@ interface IDefaultRectsProps {
6
7
  onClickRect?: (item: RectType & {
7
8
  base64: string;
8
9
  }) => void;
9
- getRectImage: (rect: number[]) => void;
10
+ getRectImage: (rect: number[]) => string;
10
11
  }
11
12
  declare function DefaultRects({ rects, containerDom, onClickRect, getRectImage }: IDefaultRectsProps): JSX.Element;
12
13
  export default DefaultRects;
@@ -1,14 +1,13 @@
1
+ /// <reference types="react" />
1
2
  import { MenuRectType } from '../../interface';
2
3
  import './index.less';
3
4
  interface IDrawRectProps {
4
5
  rect: number[];
5
6
  canRenderMenu?: boolean;
6
7
  containerDom: HTMLDivElement;
7
- onMenuClick: (options: MenuRectType & {
8
- base64: string;
9
- }) => void;
8
+ onMenuClick: (options: MenuRectType) => void;
10
9
  menus: MenuRectType[];
11
- getRectImage: (rect: number[]) => void;
10
+ getRectImage: (rect: number[]) => string;
12
11
  }
13
12
  declare function DrawRect({ rect, canRenderMenu, containerDom, onMenuClick, menus, getRectImage }: IDrawRectProps): JSX.Element;
14
13
  export default DrawRect;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  import { MenuRectType } from 'src/Picture/interface';
3
4
  interface IRectMenuProps {
@@ -5,9 +6,7 @@ interface IRectMenuProps {
5
6
  y: number;
6
7
  menus: MenuRectType[];
7
8
  containerDom: HTMLDivElement;
8
- onMenuClick: (options: MenuRectType & {
9
- base64: string;
10
- }) => void;
9
+ onMenuClick: (options: MenuRectType) => void;
11
10
  }
12
11
  declare function RectMenu({ x, y, menus, containerDom, onMenuClick }: IRectMenuProps): JSX.Element;
13
12
  export default RectMenu;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface IWheelScaleProps {
2
3
  dom: HTMLElement;
3
4
  setScale: (scale: number) => void;
@@ -13,14 +13,14 @@ function WheelScale(_ref) {
13
13
 
14
14
  useEffect(function () {
15
15
  if (!dom) {
16
- return null;
16
+ return undefined;
17
17
  }
18
18
 
19
- dom.addEventListener('mousewheel', onWheel, {
19
+ dom.addEventListener('wheel', onWheel, {
20
20
  passive: false
21
21
  });
22
22
  return function () {
23
- return dom.removeEventListener('mousewheel', onWheel);
23
+ return dom.removeEventListener('wheel', onWheel);
24
24
  };
25
25
  }, [dom, onWheel]);
26
26
  return /*#__PURE__*/React.createElement(React.Fragment, null);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { IPictureProps } from './interface';
2
3
  import './index.less';
3
4
  declare function Picture({ className, width, height, minHeight, disabledDrag, imagePath, rects, isOpenSelect, disabledDrawMenu, menus, hasTool, fullScreenEle, ...props }: IPictureProps): JSX.Element;
@@ -152,7 +152,7 @@ function Picture(_a) {
152
152
  */
153
153
 
154
154
  var resetPicture = useCallback(function (event) {
155
- event.stopPropagation(event);
155
+ event.stopPropagation();
156
156
  setState(function (old) {
157
157
  return Object.assign(Object.assign({}, old), {
158
158
  scale: 1,
@@ -304,7 +304,9 @@ function Picture(_a) {
304
304
  draggable: false,
305
305
  src: imagePath,
306
306
  key: imagePath,
307
- onLoad: loadImageSuccess
307
+ onLoad: function onLoad() {
308
+ return loadImageSuccess();
309
+ }
308
310
  }), !isEmpty ? /*#__PURE__*/React.createElement(DrawRect, {
309
311
  rect: selectArea,
310
312
  onMenuClick: onMenuClick,
@@ -4,6 +4,7 @@ export type MenuRectType = {
4
4
  pathname: string;
5
5
  title: string;
6
6
  icon: string;
7
+ base64?: string;
7
8
  };
8
9
 
9
10
  export type TagItemType = {
@@ -28,6 +29,7 @@ export type RectType = {
28
29
  feature?: string;
29
30
  dupId?: string;
30
31
  lowQuality?: boolean;
32
+ base64?: string;
31
33
  };
32
34
 
33
35
  export type PositionType = {
@@ -59,8 +61,8 @@ export interface IPictureProps {
59
61
  disabledDrawMenu?: false;
60
62
  menus?: MenuRectType[];
61
63
  imgDownload?: () => void;
62
- onClickRect?: (item: RectType & { base64: string }) => void;
63
- onMenuClick?: (item: MenuRectType & { base64: string }) => void;
64
+ onClickRect?: (item: RectType) => void;
65
+ onMenuClick?: (item: MenuRectType) => void;
64
66
  children?: (option: any) => void;
65
67
  hasTool?: boolean;
66
68
  fullScreenEle?: Element;
@@ -18,5 +18,6 @@ export declare function computedRectScale({ imageSource, domImg, rects }: {
18
18
  feature?: string;
19
19
  dupId?: string;
20
20
  lowQuality?: boolean;
21
+ base64?: string;
21
22
  }[];
22
23
  export declare function getCaptureRect(rect: number[], type: ImageType): number[];
@@ -0,0 +1,71 @@
1
+ import flvjs from 'flv.zv.js';
2
+ import Hls, { HlsConfig } from 'hls.js';
3
+ import type { FlvPlayerConfig } from '../player';
4
+ declare class Api {
5
+ container: HTMLElement;
6
+ constructor(container: HTMLElement);
7
+ get video(): HTMLVideoElement;
8
+ /**
9
+ * 全屏
10
+ */
11
+ requestFullScreen: () => void;
12
+ /**
13
+ * 退出全屏
14
+ */
15
+ cancelFullScreen: () => void;
16
+ play: () => void;
17
+ pause: () => void;
18
+ /**
19
+ * 设置currentTime实现seek
20
+ * @param {*} seconds
21
+ * @param {*} noEmit
22
+ */
23
+ seekTo: (seconds: number) => void;
24
+ setVolume: (fraction: number) => void;
25
+ mute: () => void;
26
+ unmute: () => void;
27
+ /**
28
+ * 开启画中画功能
29
+ */
30
+ requestPictureInPicture: () => void;
31
+ /**
32
+ * 关闭画中画功能
33
+ */
34
+ exitPictureInPicture: () => void;
35
+ /**
36
+ * 设置播放速率
37
+ * @param {*} rate
38
+ */
39
+ setPlaybackRate: (rate: number) => void;
40
+ /**
41
+ * 获取视频总时长
42
+ */
43
+ getDuration: () => number;
44
+ /**
45
+ * 获取当前播放时间
46
+ */
47
+ getCurrentTime: () => number;
48
+ /**
49
+ * 获取缓存时间
50
+ */
51
+ getSecondsLoaded: () => any;
52
+ /**
53
+ * 获取当前视频缓存的起止时间
54
+ */
55
+ getBufferedTime: () => number | number[];
56
+ /**
57
+ * 视频截屏方法
58
+ */
59
+ snapshot: () => string;
60
+ unload: () => void;
61
+ reload: () => void;
62
+ destroy: () => void;
63
+ }
64
+ export declare type TypeAndPlay = {
65
+ type?: string;
66
+ flv?: flvjs.Player;
67
+ hls?: Hls;
68
+ };
69
+ export declare function useTypeAndPlay(url?: string, type?: string, isLive?: boolean, container?: HTMLElement, segments?: flvjs.MediaSegment[], flvConfig?: FlvPlayerConfig, hlsConfig?: HlsConfig): [string, flvjs.Player, Hls];
70
+ export declare function usePlayerApi(url?: string, type?: string, isLive?: boolean, container?: HTMLElement, segments?: flvjs.MediaSegment[], flvConfig?: FlvPlayerConfig, hlsConfig?: HlsConfig): [Api, [string, flvjs.Player, Hls]];
71
+ export default Api;