@cloud-app-dev/vidc 2.1.0-alpha.7 → 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 (136) 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/Dict/hook.d.ts +0 -1
  11. package/es/Dict/hook.js +5 -21
  12. package/es/Dict/index.d.ts +1 -5
  13. package/es/Dict/index.js +2 -6
  14. package/es/Dict/utils.d.ts +0 -1
  15. package/es/Dict/utils.js +0 -7
  16. package/es/Drag/DragAndDropItem.js +2 -2
  17. package/es/Drag/DropItem.js +2 -2
  18. package/es/Drawer/Footer.d.ts +1 -0
  19. package/es/Drawer/index.d.ts +1 -0
  20. package/es/InitialConfig/index.js +0 -2
  21. package/es/InitialConfig/utils.d.ts +5 -5
  22. package/es/InitialConfig/utils.js +19 -19
  23. package/es/Input/index.d.ts +1 -0
  24. package/es/List/CheckExt.d.ts +1 -0
  25. package/es/List/DeviceList/index.js +1 -1
  26. package/es/List/DynamicDeviceList/Demo.d.ts +1 -0
  27. package/es/List/DynamicDeviceList/index.d.ts +1 -0
  28. package/es/List/VList/index.d.ts +1 -0
  29. package/es/List/index.d.ts +1 -0
  30. package/es/LoaderApp/index.js +26 -22
  31. package/es/LoaderApp/loader.js +2 -6
  32. package/es/LoaderApp/utils.d.ts +1 -0
  33. package/es/LoaderApp/utils.js +37 -0
  34. package/es/Modal/index.d.ts +1 -0
  35. package/es/Picture/component/DefaultRects/RectInfo.d.ts +1 -0
  36. package/es/Picture/component/DefaultRects/index.d.ts +2 -1
  37. package/es/Picture/component/DrawRect/index.d.ts +3 -4
  38. package/es/Picture/component/RectMenu/index.d.ts +2 -3
  39. package/es/Picture/component/WheelScale/index.d.ts +1 -0
  40. package/es/Picture/component/WheelScale/index.js +3 -3
  41. package/es/Picture/index.d.ts +1 -0
  42. package/es/Picture/index.js +4 -2
  43. package/es/Picture/interface.d.ts +4 -2
  44. package/es/Picture/utils.d.ts +1 -0
  45. package/es/Player/api/index.d.ts +71 -0
  46. package/es/Player/api/index.js +284 -0
  47. package/es/Player/contraller_bar/bar.d.ts +8 -0
  48. package/es/Player/contraller_bar/bar.js +21 -0
  49. package/es/Player/contraller_bar/contraller_event.d.ts +9 -0
  50. package/es/Player/contraller_bar/contraller_event.js +57 -0
  51. package/es/Player/contraller_bar/index.d.ts +19 -0
  52. package/es/Player/contraller_bar/index.js +37 -0
  53. package/es/Player/contraller_bar/left_bar.d.ts +15 -0
  54. package/es/Player/contraller_bar/left_bar.js +91 -0
  55. package/es/Player/contraller_bar/right_bar.d.ts +13 -0
  56. package/es/Player/contraller_bar/right_bar.js +55 -0
  57. package/es/Player/contraller_bar/useBarStatus.d.ts +3 -0
  58. package/es/Player/contraller_bar/useBarStatus.js +52 -0
  59. package/es/Player/demo.d.ts +2 -0
  60. package/es/Player/demo.js +269 -0
  61. package/es/Player/event/browserTabEvent.d.ts +9 -0
  62. package/es/Player/event/browserTabEvent.js +57 -0
  63. package/es/Player/event/errorEvent.d.ts +16 -0
  64. package/es/Player/event/errorEvent.js +120 -0
  65. package/es/Player/event/eventName.d.ts +3 -0
  66. package/es/Player/event/eventName.js +15 -0
  67. package/es/Player/event/index.d.ts +22 -0
  68. package/es/Player/event/index.js +175 -0
  69. package/es/Player/frontend_player.d.ts +15 -0
  70. package/es/Player/frontend_player.js +90 -0
  71. package/es/Player/frontend_timeline.d.ts +14 -0
  72. package/es/Player/frontend_timeline.js +141 -0
  73. package/es/Player/iconfont.d.ts +13 -0
  74. package/es/Player/iconfont.js +18 -0
  75. package/es/Player/index.d.ts +4 -0
  76. package/es/Player/index.js +4 -0
  77. package/es/Player/live_heart.d.ts +6 -0
  78. package/es/Player/live_heart.js +29 -0
  79. package/es/Player/message.d.ts +11 -0
  80. package/es/Player/message.js +150 -0
  81. package/es/Player/player.d.ts +75 -0
  82. package/es/Player/segment_player.d.ts +13 -0
  83. package/es/Player/segment_player.js +191 -0
  84. package/es/Player/segment_timeline.d.ts +16 -0
  85. package/es/Player/segment_timeline.js +154 -0
  86. package/es/Player/single_player.d.ts +5 -0
  87. package/es/Player/single_player.js +185 -0
  88. package/es/Player/style/bar.css +37 -0
  89. package/es/Player/style/iconfont.css +62 -0
  90. package/es/Player/style/index.css +22 -0
  91. package/es/Player/style/message.css +49 -0
  92. package/es/Player/style/slider.css +96 -0
  93. package/es/Player/style/timeline.css +92 -0
  94. package/es/Player/timeline.d.ts +11 -0
  95. package/es/Player/timeline.js +104 -0
  96. package/es/Player/util.d.ts +48 -0
  97. package/es/Player/util.js +172 -0
  98. package/es/Progress/index.d.ts +1 -0
  99. package/es/Tree/BaseTree/demo.d.ts +1 -0
  100. package/es/Tree/BaseTree/index.d.ts +2 -2
  101. package/es/Tree/demo.d.ts +1 -0
  102. package/es/Tree/index.js +1 -1
  103. package/es/UserSelect/demo.d.ts +1 -0
  104. package/es/WorkerFlow/Form/Approver.d.ts +1 -0
  105. package/es/WorkerFlow/Form/Condition.d.ts +1 -0
  106. package/es/WorkerFlow/Form/EmptyUserSet.d.ts +1 -0
  107. package/es/WorkerFlow/Form/FormAuth.d.ts +1 -0
  108. package/es/WorkerFlow/Form/GroupList.d.ts +1 -0
  109. package/es/WorkerFlow/Form/GroupSelect.d.ts +1 -0
  110. package/es/WorkerFlow/Form/Handle.d.ts +1 -0
  111. package/es/WorkerFlow/Form/LevelGroupSelect.d.ts +1 -0
  112. package/es/WorkerFlow/Form/Notifier.d.ts +1 -0
  113. package/es/WorkerFlow/Form/UserAndGroupSelect.d.ts +1 -0
  114. package/es/WorkerFlow/Form/UserSelect.d.ts +1 -0
  115. package/es/WorkerFlow/Form/UserSet.d.ts +1 -0
  116. package/es/WorkerFlow/Form/UsersHandleType.d.ts +1 -0
  117. package/es/WorkerFlow/Nodes/Add.d.ts +1 -0
  118. package/es/WorkerFlow/Nodes/Add.js +1 -1
  119. package/es/WorkerFlow/Nodes/AddOption.d.ts +1 -0
  120. package/es/WorkerFlow/Nodes/AddOptionList.d.ts +1 -0
  121. package/es/WorkerFlow/Nodes/Approver.d.ts +1 -0
  122. package/es/WorkerFlow/Nodes/Condition.d.ts +1 -0
  123. package/es/WorkerFlow/Nodes/End.d.ts +1 -0
  124. package/es/WorkerFlow/Nodes/Handle.d.ts +1 -0
  125. package/es/WorkerFlow/Nodes/Node.d.ts +1 -0
  126. package/es/WorkerFlow/Nodes/Notifier.d.ts +1 -0
  127. package/es/WorkerFlow/Nodes/Render.d.ts +1 -0
  128. package/es/WorkerFlow/Nodes/Start.d.ts +1 -0
  129. package/es/WorkerFlow/Nodes/TitleElement.d.ts +1 -0
  130. package/es/index.d.ts +3 -3
  131. package/es/index.js +4 -4
  132. package/package.json +13 -10
  133. package/es/AppRouter/index.d.ts +0 -8
  134. package/es/AppRouter/index.js +0 -17
  135. package/es/Dict/desc.d.ts +0 -64
  136. package/es/Dict/desc.js +0 -162
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) {
package/es/Dict/hook.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  import { DictItem } from './interface';
2
2
  export declare function useDict(typeCode: string | number): DictItem[];
3
- export declare function useTypeCodes(): DictItem[];
4
3
  export declare function useDicts(typeCodes?: any[], isWebVisible?: boolean): DictItem[][];
package/es/Dict/hook.js CHANGED
@@ -19,7 +19,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
19
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
20
 
21
21
  import { useMemo, useState, useEffect } from 'react';
22
- import { queryByTypeCode, queryByTypeCodes, queryTypeCodes, formartItemTextExt } from './utils';
22
+ import { queryByTypeCode, queryByTypeCodes, formartItemTextExt } from './utils';
23
23
  import LMDict from './cache';
24
24
  export function useDict(typeCode) {
25
25
  var _useState = useState(LMDict.data[typeCode] || []),
@@ -47,22 +47,6 @@ export function useDict(typeCode) {
47
47
  }, [typeCode]);
48
48
  return codes;
49
49
  }
50
- export function useTypeCodes() {
51
- var _useState3 = useState(LMDict.data['typeCodes'] || []),
52
- _useState4 = _slicedToArray(_useState3, 2),
53
- typeCodes = _useState4[0],
54
- setTypeCodes = _useState4[1];
55
-
56
- useEffect(function () {
57
- if (!LMDict.data['typeCodes']) {
58
- queryTypeCodes().then(function (res) {
59
- setTypeCodes(res);
60
- LMDict.updateDictMap('typeCode', res);
61
- });
62
- }
63
- }, []);
64
- return typeCodes;
65
- }
66
50
  export function useDicts() {
67
51
  var typeCodes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
68
52
  var isWebVisible = arguments.length > 1 ? arguments[1] : undefined;
@@ -70,14 +54,14 @@ export function useDicts() {
70
54
  return typeCodes.toString();
71
55
  }, [typeCodes]);
72
56
 
73
- var _useState5 = useState(function () {
57
+ var _useState3 = useState(function () {
74
58
  return typeCodes.map(function (v) {
75
59
  return LMDict.data[v] ? LMDict.data[v] : [];
76
60
  });
77
61
  }),
78
- _useState6 = _slicedToArray(_useState5, 2),
79
- dicts = _useState6[0],
80
- setDicts = _useState6[1];
62
+ _useState4 = _slicedToArray(_useState3, 2),
63
+ dicts = _useState4[0],
64
+ setDicts = _useState4[1];
81
65
 
82
66
  useEffect(function () {
83
67
  var codes = typeCodes.filter(function (v) {
@@ -1,13 +1,9 @@
1
1
  import * as device from './device';
2
- import { useDict, useDicts, useTypeCodes } from './hook';
3
- import { withDict, withTypeCodes } from './desc';
2
+ import { useDict, useDicts } from './hook';
4
3
  declare const Dict: {
5
4
  useDict: typeof useDict;
6
5
  useDicts: typeof useDicts;
7
6
  device: typeof device;
8
7
  cacheMap: import("./interface").CacheDictType;
9
- withDict: typeof withDict;
10
- useTypeCodes: typeof useTypeCodes;
11
- withTypeCodes: typeof withTypeCodes;
12
8
  };
13
9
  export default Dict;
package/es/Dict/index.js CHANGED
@@ -1,14 +1,10 @@
1
1
  import LMDict from './cache';
2
2
  import * as device from './device';
3
- import { useDict, useDicts, useTypeCodes } from './hook';
4
- import { withDict, withTypeCodes } from './desc';
3
+ import { useDict, useDicts } from './hook';
5
4
  var Dict = {
6
5
  useDict: useDict,
7
6
  useDicts: useDicts,
8
7
  device: device,
9
- cacheMap: LMDict,
10
- withDict: withDict,
11
- useTypeCodes: useTypeCodes,
12
- withTypeCodes: withTypeCodes
8
+ cacheMap: LMDict
13
9
  };
14
10
  export default Dict;
@@ -5,7 +5,6 @@ export declare function queryByTypeCode(typeCode: any): Promise<{
5
5
  export declare function queryByTypeCodes(typeCodes?: any[], isWebVisible?: boolean): Promise<{
6
6
  data: DictItem[];
7
7
  }>;
8
- export declare function queryTypeCodes(): Promise<DictItem[]>;
9
8
  export declare function formartItemTextExt(text: string): {
10
9
  [key: string]: any;
11
10
  };
package/es/Dict/utils.js CHANGED
@@ -29,13 +29,6 @@ export function queryByTypeCodes() {
29
29
  }
30
30
  });
31
31
  }
32
- export function queryTypeCodes() {
33
- return Service.http({
34
- url: "/micro-apps/micro-dep-librarys/config/typeCodes.json",
35
- method: 'get',
36
- requestId: 'queryTypeCodes'
37
- });
38
- }
39
32
  export function formartItemTextExt(text) {
40
33
  var ext = {};
41
34
 
@@ -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;
@@ -11,7 +11,6 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
11
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
13
  import React, { useState, useEffect } from 'react';
14
- import Dict from '../Dict';
15
14
  import Config from '../Config';
16
15
  import { queryBSConfig, queryMicroApplicationList, querySystemUpdate, queryDefaultTheme } from './utils';
17
16
 
@@ -28,7 +27,6 @@ function InitialConfig(_ref) {
28
27
  state = _useState2[0],
29
28
  setState = _useState2[1];
30
29
 
31
- Dict.useTypeCodes();
32
30
  useEffect(function () {
33
31
  var arr = [queryBSConfig(), queryMicroApplicationList(), querySystemUpdate(), queryDefaultTheme()];
34
32
  Promise.all(arr).then(function (_ref2) {
@@ -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,3 +1,5 @@
1
+ import _useUnmount from "ahooks/es/useUnmount";
2
+ import _useMount from "ahooks/es/useMount";
1
3
  import _uuid from "@cloud-app-dev/utils/es/uuid";
2
4
 
3
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -13,7 +15,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
13
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
16
 
15
17
  import { __awaiter } from "tslib";
16
- import React, { useRef, useEffect, useState, useMemo } from 'react';
18
+ import React, { useRef, useState, useMemo } from 'react';
17
19
  import { getMicroConfig } from './utils';
18
20
  import LoaderModule from './loader';
19
21
  import "./index.css";
@@ -36,8 +38,7 @@ function LoaderApp(_ref) {
36
38
  status = _useState2[0],
37
39
  setStatus = _useState2[1];
38
40
 
39
- useEffect(function () {
40
- var app;
41
+ _useMount(function () {
41
42
  var config = getMicroConfig(appConfig, appProps, domRef.current);
42
43
 
43
44
  if (!config) {
@@ -72,26 +73,25 @@ function LoaderApp(_ref) {
72
73
  while (1) {
73
74
  switch (_context.prev = _context.next) {
74
75
  case 0:
75
- app = mod;
76
76
  loadedAppRef.current = mod;
77
77
 
78
78
  if (!status) {
79
- _context.next = 5;
79
+ _context.next = 4;
80
80
  break;
81
81
  }
82
82
 
83
- _context.next = 5;
84
- return app.bootstrap(props);
83
+ _context.next = 4;
84
+ return mod.bootstrap(props);
85
85
 
86
- case 5:
86
+ case 4:
87
87
  setStatus('bootstrap');
88
- _context.next = 8;
89
- return app.mount(props);
88
+ _context.next = 7;
89
+ return mod.mount(props);
90
90
 
91
- case 8:
91
+ case 7:
92
92
  setStatus('mount');
93
93
 
94
- case 9:
94
+ case 8:
95
95
  case "end":
96
96
  return _context.stop();
97
97
  }
@@ -99,16 +99,20 @@ function LoaderApp(_ref) {
99
99
  }, _callee);
100
100
  }));
101
101
  });
102
- return function () {
103
- try {
104
- app.unmount(props);
105
- setStatus('unmount');
106
- app = null;
107
- } catch (error) {
108
- console.error(error);
109
- }
110
- };
111
- }, []);
102
+ });
103
+
104
+ _useUnmount(function () {
105
+ if (loadedAppRef.current) {
106
+ var app = loadedAppRef.current;
107
+ var props = Object.assign(Object.assign({}, appProps), {
108
+ container: domRef.current
109
+ });
110
+ app.unmount(props);
111
+ setStatus('unmount');
112
+ loadedAppRef.current = null;
113
+ }
114
+ });
115
+
112
116
  return /*#__PURE__*/React.createElement("main", {
113
117
  ref: domRef,
114
118
  className: "loaded-app-layout ".concat(appConfig.routerPrefix, "-").concat(id),
@@ -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;