@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.
- package/.umirc.ts +1 -1
- package/es/AppContext/Sync.d.ts +1 -0
- package/es/AppContext/interface.d.ts +4 -1
- package/es/AppRedirect/index.d.ts +1 -0
- package/es/CheckGroupFixed/index.d.ts +1 -0
- package/es/DeviceSelect/TreeType.d.ts +1 -0
- package/es/DeviceSelect/demo.d.ts +1 -0
- package/es/DeviceSelect/index.d.ts +1 -0
- package/es/DeviceSelect/index.js +1 -1
- package/es/Dict/hook.d.ts +0 -1
- package/es/Dict/hook.js +5 -21
- package/es/Dict/index.d.ts +1 -5
- package/es/Dict/index.js +2 -6
- package/es/Dict/utils.d.ts +0 -1
- package/es/Dict/utils.js +0 -7
- package/es/Drag/DragAndDropItem.js +2 -2
- package/es/Drag/DropItem.js +2 -2
- package/es/Drawer/Footer.d.ts +1 -0
- package/es/Drawer/index.d.ts +1 -0
- package/es/InitialConfig/index.js +0 -2
- package/es/InitialConfig/utils.d.ts +5 -5
- package/es/InitialConfig/utils.js +19 -19
- package/es/Input/index.d.ts +1 -0
- package/es/List/CheckExt.d.ts +1 -0
- package/es/List/DeviceList/index.js +1 -1
- package/es/List/DynamicDeviceList/Demo.d.ts +1 -0
- package/es/List/DynamicDeviceList/index.d.ts +1 -0
- package/es/List/VList/index.d.ts +1 -0
- package/es/List/index.d.ts +1 -0
- package/es/LoaderApp/index.js +26 -22
- package/es/LoaderApp/loader.js +2 -6
- package/es/LoaderApp/utils.d.ts +1 -0
- package/es/LoaderApp/utils.js +37 -0
- package/es/Modal/index.d.ts +1 -0
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +1 -0
- package/es/Picture/component/DefaultRects/index.d.ts +2 -1
- package/es/Picture/component/DrawRect/index.d.ts +3 -4
- package/es/Picture/component/RectMenu/index.d.ts +2 -3
- package/es/Picture/component/WheelScale/index.d.ts +1 -0
- package/es/Picture/component/WheelScale/index.js +3 -3
- package/es/Picture/index.d.ts +1 -0
- package/es/Picture/index.js +4 -2
- package/es/Picture/interface.d.ts +4 -2
- package/es/Picture/utils.d.ts +1 -0
- package/es/Player/api/index.d.ts +71 -0
- package/es/Player/api/index.js +284 -0
- package/es/Player/contraller_bar/bar.d.ts +8 -0
- package/es/Player/contraller_bar/bar.js +21 -0
- package/es/Player/contraller_bar/contraller_event.d.ts +9 -0
- package/es/Player/contraller_bar/contraller_event.js +57 -0
- package/es/Player/contraller_bar/index.d.ts +19 -0
- package/es/Player/contraller_bar/index.js +37 -0
- package/es/Player/contraller_bar/left_bar.d.ts +15 -0
- package/es/Player/contraller_bar/left_bar.js +91 -0
- package/es/Player/contraller_bar/right_bar.d.ts +13 -0
- package/es/Player/contraller_bar/right_bar.js +55 -0
- package/es/Player/contraller_bar/useBarStatus.d.ts +3 -0
- package/es/Player/contraller_bar/useBarStatus.js +52 -0
- package/es/Player/demo.d.ts +2 -0
- package/es/Player/demo.js +269 -0
- package/es/Player/event/browserTabEvent.d.ts +9 -0
- package/es/Player/event/browserTabEvent.js +57 -0
- package/es/Player/event/errorEvent.d.ts +16 -0
- package/es/Player/event/errorEvent.js +120 -0
- package/es/Player/event/eventName.d.ts +3 -0
- package/es/Player/event/eventName.js +15 -0
- package/es/Player/event/index.d.ts +22 -0
- package/es/Player/event/index.js +175 -0
- package/es/Player/frontend_player.d.ts +15 -0
- package/es/Player/frontend_player.js +90 -0
- package/es/Player/frontend_timeline.d.ts +14 -0
- package/es/Player/frontend_timeline.js +141 -0
- package/es/Player/iconfont.d.ts +13 -0
- package/es/Player/iconfont.js +18 -0
- package/es/Player/index.d.ts +4 -0
- package/es/Player/index.js +4 -0
- package/es/Player/live_heart.d.ts +6 -0
- package/es/Player/live_heart.js +29 -0
- package/es/Player/message.d.ts +11 -0
- package/es/Player/message.js +150 -0
- package/es/Player/player.d.ts +75 -0
- package/es/Player/segment_player.d.ts +13 -0
- package/es/Player/segment_player.js +191 -0
- package/es/Player/segment_timeline.d.ts +16 -0
- package/es/Player/segment_timeline.js +154 -0
- package/es/Player/single_player.d.ts +5 -0
- package/es/Player/single_player.js +185 -0
- package/es/Player/style/bar.css +37 -0
- package/es/Player/style/iconfont.css +62 -0
- package/es/Player/style/index.css +22 -0
- package/es/Player/style/message.css +49 -0
- package/es/Player/style/slider.css +96 -0
- package/es/Player/style/timeline.css +92 -0
- package/es/Player/timeline.d.ts +11 -0
- package/es/Player/timeline.js +104 -0
- package/es/Player/util.d.ts +48 -0
- package/es/Player/util.js +172 -0
- package/es/Progress/index.d.ts +1 -0
- package/es/Tree/BaseTree/demo.d.ts +1 -0
- package/es/Tree/BaseTree/index.d.ts +2 -2
- package/es/Tree/demo.d.ts +1 -0
- package/es/Tree/index.js +1 -1
- package/es/UserSelect/demo.d.ts +1 -0
- package/es/WorkerFlow/Form/Approver.d.ts +1 -0
- package/es/WorkerFlow/Form/Condition.d.ts +1 -0
- package/es/WorkerFlow/Form/EmptyUserSet.d.ts +1 -0
- package/es/WorkerFlow/Form/FormAuth.d.ts +1 -0
- package/es/WorkerFlow/Form/GroupList.d.ts +1 -0
- package/es/WorkerFlow/Form/GroupSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/Handle.d.ts +1 -0
- package/es/WorkerFlow/Form/LevelGroupSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/Notifier.d.ts +1 -0
- package/es/WorkerFlow/Form/UserAndGroupSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/UserSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/UserSet.d.ts +1 -0
- package/es/WorkerFlow/Form/UsersHandleType.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Add.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Add.js +1 -1
- package/es/WorkerFlow/Nodes/AddOption.d.ts +1 -0
- package/es/WorkerFlow/Nodes/AddOptionList.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Approver.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Condition.d.ts +1 -0
- package/es/WorkerFlow/Nodes/End.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Handle.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Node.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Notifier.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Render.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Start.d.ts +1 -0
- package/es/WorkerFlow/Nodes/TitleElement.d.ts +1 -0
- package/es/index.d.ts +3 -3
- package/es/index.js +4 -4
- package/package.json +13 -10
- package/es/AppRouter/index.d.ts +0 -8
- package/es/AppRouter/index.js +0 -17
- package/es/Dict/desc.d.ts +0 -64
- 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',
|
package/es/AppContext/Sync.d.ts
CHANGED
|
@@ -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;
|
package/es/DeviceSelect/index.js
CHANGED
package/es/Dict/hook.d.ts
CHANGED
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,
|
|
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
|
|
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
|
-
|
|
79
|
-
dicts =
|
|
80
|
-
setDicts =
|
|
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) {
|
package/es/Dict/index.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import * as device from './device';
|
|
2
|
-
import { useDict, useDicts
|
|
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
|
|
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;
|
package/es/Dict/utils.d.ts
CHANGED
|
@@ -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 (
|
|
63
|
-
|
|
62
|
+
var allowDrop = useCallback(function (event) {
|
|
63
|
+
return event.preventDefault();
|
|
64
64
|
}, []);
|
|
65
65
|
var onDragStart = useCallback(function (event) {
|
|
66
66
|
if (!domRef.current) {
|
package/es/Drag/DropItem.js
CHANGED
|
@@ -38,8 +38,8 @@ function DropItem(_ref) {
|
|
|
38
38
|
event.stopPropagation();
|
|
39
39
|
setStatus('dragleave');
|
|
40
40
|
}, []);
|
|
41
|
-
var allowDrop = useCallback(function (
|
|
42
|
-
|
|
41
|
+
var allowDrop = useCallback(function (event) {
|
|
42
|
+
return event.preventDefault();
|
|
43
43
|
}, []);
|
|
44
44
|
return /*#__PURE__*/React.cloneElement(children, {
|
|
45
45
|
ref: domRef,
|
package/es/Drawer/Footer.d.ts
CHANGED
package/es/Drawer/index.d.ts
CHANGED
|
@@ -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
|
|
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.
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
_context3.next = 2;
|
|
65
|
+
return Service.http({
|
|
66
|
+
url: "/statics/config/theme.info.json?".concat(Date.now())
|
|
67
|
+
});
|
|
71
68
|
|
|
72
|
-
case
|
|
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
|
|
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:
|
|
93
|
+
url: '/api/micro-app-service/app/v1/allList'
|
|
94
94
|
});
|
|
95
95
|
|
|
96
96
|
case 2:
|
package/es/Input/index.d.ts
CHANGED
package/es/List/CheckExt.d.ts
CHANGED
|
@@ -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;
|
package/es/List/VList/index.d.ts
CHANGED
package/es/List/index.d.ts
CHANGED
package/es/LoaderApp/index.js
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
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 =
|
|
79
|
+
_context.next = 4;
|
|
80
80
|
break;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
_context.next =
|
|
84
|
-
return
|
|
83
|
+
_context.next = 4;
|
|
84
|
+
return mod.bootstrap(props);
|
|
85
85
|
|
|
86
|
-
case
|
|
86
|
+
case 4:
|
|
87
87
|
setStatus('bootstrap');
|
|
88
|
-
_context.next =
|
|
89
|
-
return
|
|
88
|
+
_context.next = 7;
|
|
89
|
+
return mod.mount(props);
|
|
90
90
|
|
|
91
|
-
case
|
|
91
|
+
case 7:
|
|
92
92
|
setStatus('mount');
|
|
93
93
|
|
|
94
|
-
case
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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),
|
package/es/LoaderApp/loader.js
CHANGED
|
@@ -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
|
|
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;
|
package/es/LoaderApp/utils.d.ts
CHANGED
|
@@ -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;
|
package/es/LoaderApp/utils.js
CHANGED
|
@@ -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,
|
package/es/Modal/index.d.ts
CHANGED
|
@@ -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[]) =>
|
|
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[]) =>
|
|
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;
|
|
@@ -13,14 +13,14 @@ function WheelScale(_ref) {
|
|
|
13
13
|
|
|
14
14
|
useEffect(function () {
|
|
15
15
|
if (!dom) {
|
|
16
|
-
return
|
|
16
|
+
return undefined;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
dom.addEventListener('
|
|
19
|
+
dom.addEventListener('wheel', onWheel, {
|
|
20
20
|
passive: false
|
|
21
21
|
});
|
|
22
22
|
return function () {
|
|
23
|
-
return dom.removeEventListener('
|
|
23
|
+
return dom.removeEventListener('wheel', onWheel);
|
|
24
24
|
};
|
|
25
25
|
}, [dom, onWheel]);
|
|
26
26
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
package/es/Picture/index.d.ts
CHANGED
|
@@ -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;
|