@cloud-app-dev/vidc 2.0.0-alpha.12 → 2.0.0-alpha.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.
Files changed (93) hide show
  1. package/es/Api/index.js +7 -7
  2. package/es/AppContext/Sync.d.ts +1 -0
  3. package/es/AppRedirect/index.d.ts +1 -0
  4. package/es/AppRedirect/index.js +1 -2
  5. package/es/AppRoute/index.d.ts +2 -2
  6. package/es/AppRoute/index.js +41 -46
  7. package/es/AppRoute/interface.d.ts +1 -1
  8. package/es/AutoExit/index.js +11 -9
  9. package/es/CheckGroupFixed/index.d.ts +1 -0
  10. package/es/ConfigContext/index.d.ts +15 -2
  11. package/es/ConfigContext/index.js +25 -3
  12. package/es/DeviceSelect/TreeType.d.ts +1 -0
  13. package/es/DeviceSelect/demo.d.ts +1 -0
  14. package/es/DeviceSelect/index.d.ts +1 -0
  15. package/es/Dict/desc.js +3 -3
  16. package/es/Dict/utils.js +3 -3
  17. package/es/Drawer/Footer.d.ts +1 -0
  18. package/es/Drawer/index.d.ts +1 -0
  19. package/es/InitialConfig/utils.js +3 -3
  20. package/es/InitialRequest/utils.js +5 -5
  21. package/es/Input/index.d.ts +1 -0
  22. package/es/InstanceHistory/index.d.ts +3 -0
  23. package/es/InstanceHistory/index.js +9 -0
  24. package/es/List/CheckExt.d.ts +1 -0
  25. package/es/List/DynamicDeviceList/Demo.d.ts +1 -0
  26. package/es/List/DynamicDeviceList/index.d.ts +1 -0
  27. package/es/List/DynamicDeviceList/utils.js +1 -1
  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 +0 -1
  31. package/es/Modal/index.d.ts +7 -6
  32. package/es/Picture/component/DefaultRects/RectInfo.d.ts +1 -0
  33. package/es/Picture/component/DefaultRects/index.d.ts +1 -0
  34. package/es/Picture/component/DrawRect/index.d.ts +1 -0
  35. package/es/Picture/component/MoveContent/index.js +3 -3
  36. package/es/Picture/component/RectMenu/index.d.ts +1 -0
  37. package/es/Picture/component/WheelScale/index.d.ts +1 -0
  38. package/es/Picture/index.d.ts +1 -0
  39. package/es/Progress/index.d.ts +1 -0
  40. package/es/RefDrawer/index.js +1 -1
  41. package/es/RefModal/index.js +1 -1
  42. package/es/Service/http.d.ts +6 -4
  43. package/es/Service/http.js +18 -14
  44. package/es/Service/index.d.ts +3 -3
  45. package/es/Service/index.js +7 -11
  46. package/es/Service/interface.d.ts +4 -9
  47. package/es/Service/middleware.d.ts +1 -1
  48. package/es/Tree/BaseTree/demo.d.ts +1 -0
  49. package/es/Tree/demo.d.ts +1 -0
  50. package/es/UserSelect/demo.d.ts +1 -0
  51. package/es/WorkerFlow/Form/Approver.d.ts +1 -0
  52. package/es/WorkerFlow/Form/Condition.d.ts +1 -0
  53. package/es/WorkerFlow/Form/EmptyUserSet.d.ts +1 -0
  54. package/es/WorkerFlow/Form/FormAuth.d.ts +1 -0
  55. package/es/WorkerFlow/Form/GroupList.d.ts +1 -0
  56. package/es/WorkerFlow/Form/GroupSelect.d.ts +1 -0
  57. package/es/WorkerFlow/Form/Handle.d.ts +1 -0
  58. package/es/WorkerFlow/Form/LevelGroupSelect.d.ts +1 -0
  59. package/es/WorkerFlow/Form/LevelGroupSelect.js +1 -1
  60. package/es/WorkerFlow/Form/Notifier.d.ts +1 -0
  61. package/es/WorkerFlow/Form/UserAndGroupSelect.d.ts +1 -0
  62. package/es/WorkerFlow/Form/UserSelect.d.ts +1 -0
  63. package/es/WorkerFlow/Form/UserSet.d.ts +1 -0
  64. package/es/WorkerFlow/Form/UsersHandleType.d.ts +1 -0
  65. package/es/WorkerFlow/Nodes/Add.d.ts +1 -0
  66. package/es/WorkerFlow/Nodes/AddOption.d.ts +1 -0
  67. package/es/WorkerFlow/Nodes/AddOptionList.d.ts +1 -0
  68. package/es/WorkerFlow/Nodes/Approver.d.ts +1 -0
  69. package/es/WorkerFlow/Nodes/Condition.d.ts +1 -0
  70. package/es/WorkerFlow/Nodes/End.d.ts +1 -0
  71. package/es/WorkerFlow/Nodes/Handle.d.ts +1 -0
  72. package/es/WorkerFlow/Nodes/Node.d.ts +1 -0
  73. package/es/WorkerFlow/Nodes/Notifier.d.ts +1 -0
  74. package/es/WorkerFlow/Nodes/Render.d.ts +1 -0
  75. package/es/WorkerFlow/Nodes/Start.d.ts +1 -0
  76. package/es/WorkerFlow/Nodes/TitleElement.d.ts +1 -0
  77. package/es/WorkerFlow/index.js +10 -6
  78. package/es/index.d.ts +2 -1
  79. package/es/index.js +2 -1
  80. package/es/useDrawer/index.js +1 -1
  81. package/es/useHistory/index.d.ts +3 -0
  82. package/es/useHistory/index.js +11 -0
  83. package/es/useHttp/index.js +1 -1
  84. package/es/useModal/index.js +1 -1
  85. package/package.json +5 -3
  86. package/tsconfig.json +1 -1
  87. package/es/Service/logger.d.ts +0 -3
  88. package/es/Service/logger.js +0 -13
  89. package/es/Service/utils.d.ts +0 -3
  90. package/es/Service/utils.js +0 -11
  91. package/es/useNavigate/index.css +0 -0
  92. package/es/useNavigate/index.d.ts +0 -4
  93. package/es/useNavigate/index.js +0 -14
@@ -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;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface IProgressComponentProps {
3
4
  status: 'over' | 'error' | 'loading';
@@ -15,7 +15,7 @@ import Drawer from '../Drawer';
15
15
  import ConfigContext from '../ConfigContext';
16
16
 
17
17
  function RefDrawer(_, ref) {
18
- var context = useContext(ConfigContext);
18
+ var context = useContext(ConfigContext.Context);
19
19
  var root = useMemo(function () {
20
20
  return (context === null || context === void 0 ? void 0 : context.root) || document.body;
21
21
  }, [context === null || context === void 0 ? void 0 : context.root]);
@@ -15,7 +15,7 @@ import Modal from '../Modal';
15
15
  import ConfigContext from '../ConfigContext';
16
16
 
17
17
  function RefModal(_, ref) {
18
- var context = useContext(ConfigContext);
18
+ var context = useContext(ConfigContext.Context);
19
19
  var root = useMemo(function () {
20
20
  return (context === null || context === void 0 ? void 0 : context.root) || document.body;
21
21
  }, [context === null || context === void 0 ? void 0 : context.root]);
@@ -1,4 +1,6 @@
1
- import { RsponseType, XHRResponse } from './interface';
2
- export declare function $http(options: RsponseType): import("fetch-like-axios").AxiosPromise<any>;
3
- export declare const $httpMultiPartInstance: import("fetch-like-axios").AxiosInstance;
4
- export declare const $httpXMLInstance: ({ url, method, data, headers, cancelHttp, isAsync }: XHRResponse) => Promise<unknown>;
1
+ import { AxiosInstance } from 'fetch-like-axios';
2
+ import type { RsponseType, XHRResponse } from './interface';
3
+ declare function http({ cancelHttp, ...newOptions }: RsponseType): Promise<any>;
4
+ declare const httpMultiPartInstance: AxiosInstance;
5
+ declare function httpXMLInstance({ url, method, data, headers, cancelHttp, isAsync }: XHRResponse): Promise<any>;
6
+ export { http as default, http, httpMultiPartInstance, httpXMLInstance };
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
- import fetchAxios from 'fetch-like-axios';
2
+ import Axios from 'fetch-like-axios';
3
3
  import * as Middleware from './middleware';
4
- var CancelToken = fetchAxios.CancelToken;
4
+ var CancelToken = Axios.CancelToken;
5
5
  var config = {
6
6
  baseURL: '/',
7
7
  timeout: 60 * 1000,
@@ -11,7 +11,7 @@ var config = {
11
11
  'Content-Type': 'application/json; charset=utf-8'
12
12
  }
13
13
  };
14
- var httpInstance = fetchAxios.create(config);
14
+ var httpInstance = Axios.create(config);
15
15
  /**
16
16
  * 请求之前拦截动作
17
17
  */
@@ -49,36 +49,38 @@ httpInstance.interceptors.response.use(function (response) {
49
49
 
50
50
  return Promise.reject(error.response);
51
51
  });
52
- export function $http(options) {
52
+
53
+ function http(_a) {
54
+ var cancelHttp = _a.cancelHttp,
55
+ newOptions = __rest(_a, ["cancelHttp"]);
56
+
53
57
  var cancel;
54
58
  var cancelToken = new CancelToken(function (c) {
55
59
  cancel = c;
56
60
 
57
- if (options.cancelHttp) {
58
- options.cancelHttp(cancel);
61
+ if (cancelHttp) {
62
+ cancelHttp(cancel);
59
63
  }
60
64
  });
61
-
62
- var cancelHttp = options.cancelHttp,
63
- newOptions = __rest(options, ["cancelHttp"]);
64
-
65
65
  return httpInstance(Object.assign(Object.assign({}, newOptions), {
66
66
  cancelToken: cancelToken
67
67
  }));
68
68
  }
69
- export var $httpMultiPartInstance = fetchAxios.create({
69
+
70
+ var httpMultiPartInstance = Axios.create({
70
71
  xhrMode: 'fetch',
71
72
  timeout: 10 * 60 * 1000,
72
73
  headers: {
73
74
  'Content-Type': 'multipart/form-data'
74
75
  }
75
76
  });
76
- $httpMultiPartInstance.interceptors.response.use(function (response) {
77
+ httpMultiPartInstance.interceptors.response.use(function (response) {
77
78
  return Promise.resolve(response.data);
78
79
  }, function (error) {
79
80
  return Promise.reject(error);
80
81
  });
81
- export var $httpXMLInstance = function xhrRequest(_ref) {
82
+
83
+ function httpXMLInstance(_ref) {
82
84
  var url = _ref.url,
83
85
  _ref$method = _ref.method,
84
86
  method = _ref$method === void 0 ? 'GET' : _ref$method,
@@ -126,4 +128,6 @@ export var $httpXMLInstance = function xhrRequest(_ref) {
126
128
 
127
129
  xhr.send(data ? JSON.stringify(data) : null);
128
130
  });
129
- };
131
+ }
132
+
133
+ export { http as default, http, httpMultiPartInstance, httpXMLInstance };
@@ -1,3 +1,3 @@
1
- import { IServiceInterface } from './interface';
2
- declare let proxy: IServiceInterface;
3
- export default proxy;
1
+ import type { IServiceInterface } from './interface';
2
+ declare const Service: IServiceInterface;
3
+ export default Service;
@@ -1,14 +1,10 @@
1
- import { $http, $httpMultiPartInstance, $httpXMLInstance } from './http';
1
+ import { http, httpMultiPartInstance, httpXMLInstance } from './http';
2
2
  import { registerResponseMiddleware, registerResponseErrorMiddleware } from './middleware';
3
- import produce from 'immer';
4
- import * as logger from './logger';
5
- var ServiceInterface = {
6
- $http: $http,
7
- $httpXMLInstance: $httpXMLInstance,
8
- $httpMultiPartInstance: $httpMultiPartInstance,
3
+ var Service = {
4
+ http: http,
5
+ httpXMLInstance: httpXMLInstance,
6
+ httpMultiPartInstance: httpMultiPartInstance,
9
7
  registerResponseMiddleware: registerResponseMiddleware,
10
- registerResponseErrorMiddleware: registerResponseErrorMiddleware,
11
- logger: logger
8
+ registerResponseErrorMiddleware: registerResponseErrorMiddleware
12
9
  };
13
- var proxy = produce(ServiceInterface, function () {});
14
- export default proxy;
10
+ export default Service;
@@ -1,8 +1,4 @@
1
- import { AxiosRequestConfig } from 'fetch-like-axios';
2
-
3
- export type loggerType = {
4
- save(options: { description: string; module: string | number; function: string | number }, token?: string): Promise<any>;
5
- };
1
+ import type { AxiosInstance, AxiosRequestConfig } from 'fetch-like-axios';
6
2
 
7
3
  export type RsponseType = AxiosRequestConfig & { requestId?: string; cancelHttp?: (cancel: Function) => void; loggerIndex?: number };
8
4
 
@@ -19,10 +15,9 @@ export type XHRResponse = {
19
15
  export type MiddleWareType = (config: any) => any;
20
16
 
21
17
  export type IServiceInterface = {
22
- $http(options: RsponseType): Promise<any>;
23
- $httpXMLInstance(options: XHRResponse): Promise<any>;
24
- $httpMultiPartInstance(options: AxiosRequestConfig): Promise<any>;
18
+ http(options: RsponseType): Promise<any>;
19
+ httpXMLInstance(options: XHRResponse): Promise<any>;
20
+ httpMultiPartInstance: AxiosInstance;
25
21
  registerResponseMiddleware(fn: MiddleWareType): void;
26
22
  registerResponseErrorMiddleware(fn: MiddleWareType): void;
27
- logger: loggerType;
28
23
  };
@@ -1,4 +1,4 @@
1
- import { MiddleWareType } from './interface';
1
+ import type { MiddleWareType } from './interface';
2
2
  export declare const responseMiddleware: Array<any>;
3
3
  export declare const responseErrorMiddleware: Array<any>;
4
4
  export declare function registerResponseMiddleware(fn: MiddleWareType): void;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare function App(): JSX.Element;
2
3
  export default App;
package/es/Tree/demo.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare function App(): JSX.Element;
2
3
  export default App;
@@ -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 { NodeItem, WorkerFlowFormType } from '../interface';
2
3
  interface IApproverFormProps {
3
4
  form: WorkerFlowFormType[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ConditionItemType, NodeItem, WorkerFlowFormType } from '../interface';
2
3
  interface IConditionFormProps {
3
4
  form: WorkerFlowFormType[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeUserType } from '../interface';
2
3
  interface IUserSelectProps {
3
4
  userList: NodeUserType[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { WorkerFlowFormType } from '../interface';
2
3
  interface IFormAuthProps {
3
4
  form: WorkerFlowFormType[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeUserType } from '../interface';
2
3
  interface IGroupListProps {
3
4
  list: [string, NodeUserType[]][];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeUserType } from '../interface';
2
3
  interface IUserSelectProps {
3
4
  userList: NodeUserType[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem, WorkerFlowFormType } from '../interface';
2
3
  interface IHandleFormProps {
3
4
  form: WorkerFlowFormType[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeUserType } from '../interface';
2
3
  interface ILevelGroupSelectProps {
3
4
  userList: NodeUserType[];
@@ -99,7 +99,7 @@ function LevelGroupSelect(_ref) {
99
99
  users: state.userList,
100
100
  chargeLevel: state.chargeLevel
101
101
  });
102
- }, [state.userList, state.chargeLevel]);
102
+ }, [state.userList, state.chargeLevel, onChange]);
103
103
  var renderList = useMemo(function () {
104
104
  return formatRenderGroup(state.userList);
105
105
  }, [state.userList]);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem } from '../interface';
2
3
  interface INotifierFormProps {
3
4
  item?: NodeItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeUserType } from '../interface';
2
3
  interface IUserSelectProps {
3
4
  userList: NodeUserType[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeUserType } from '../interface';
2
3
  interface IUserSelectProps {
3
4
  userList: NodeUserType[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MutipleUserHandleType, NodeType, NodeUserType, UserSetType } from '../interface';
2
3
  interface IUserSetProps {
3
4
  userType?: UserSetType;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MutipleUserHandleType } from '../interface';
2
3
  declare function UsersHandleType({ usersHandType, onChange }: {
3
4
  usersHandType: MutipleUserHandleType;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem } from '../interface';
2
3
  interface IAddNodeProps {
3
4
  node: NodeItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface IAddNodeOptionProps {
2
3
  type: string;
3
4
  onClick: () => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AddNodeType, NodeType } from '../interface';
2
3
  interface IAddNodeListProps {
3
4
  onOptionClick: (type: NodeType) => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem } from '../interface';
2
3
  interface IApproverNodeProps {
3
4
  parentNode: NodeItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem } from '../interface';
2
3
  interface IConditionNodeProps {
3
4
  conditionNodes: NodeItem[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface IEndNodeProps {
2
3
  id: string;
3
4
  nodeName: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem } from '../interface';
2
3
  interface IHandleNodeProps {
3
4
  parentNode: NodeItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem } from '../interface';
2
3
  interface IMatchNodeProps {
3
4
  config: NodeItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem } from '../interface';
2
3
  interface INotifierNodeProps {
3
4
  parentNode: NodeItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem } from '../interface';
2
3
  interface IRenderProps {
3
4
  config: NodeItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem, NodeUserType } from '../interface';
2
3
  interface IStartNode {
3
4
  node: NodeItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface ITitleElementProps {
2
3
  placeholder: string;
3
4
  nodeName: string;
@@ -1,4 +1,5 @@
1
1
  import _useUpdateEffect from "ahooks/es/useUpdateEffect";
2
+ import _useCreation from "ahooks/es/useCreation";
2
3
  import "antd/lib/modal/style";
3
4
  import _Modal from "antd/lib/modal";
4
5
 
@@ -23,7 +24,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
23
24
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
25
 
25
26
  import { __awaiter } from "tslib";
26
- import React, { useCallback, useImperativeHandle, useMemo, useRef, useState } from 'react';
27
+ import React, { useCallback, useImperativeHandle, useRef, useState } from 'react';
27
28
  import { OptionTypes, NodeTemplates, NodeTypes, createVNodeApprover } from './Nodes/Constants';
28
29
  import { downloadBpmnFile, exportBpmnFile as _exportBpmnFile } from './XML';
29
30
  import { createId, getEndEventId } from './XML/utils';
@@ -260,15 +261,18 @@ function WorkerFlow(_ref, ref) {
260
261
  }
261
262
  }
262
263
 
263
- var endId = useMemo(function () {
264
+ var endId = _useCreation(function () {
264
265
  return getEndEventId(config);
265
266
  }, []);
266
- var id = useMemo(function () {
267
+
268
+ var id = _useCreation(function () {
267
269
  return (_data === null || _data === void 0 ? void 0 : _data.id) || createId('Process_001');
268
270
  }, []);
269
- var name = useMemo(function () {
271
+
272
+ var name = _useCreation(function () {
270
273
  return (_data === null || _data === void 0 ? void 0 : _data.name) || "\u5DE5\u4F5C\u6D41_".concat(id);
271
274
  }, [id]);
275
+
272
276
  var getConfig = useCallback(function () {
273
277
  var newConfig = filterNoticeNode(config);
274
278
 
@@ -286,7 +290,7 @@ function WorkerFlow(_ref, ref) {
286
290
  taskList: taskList,
287
291
  useFormKeys: useFormKeys
288
292
  };
289
- }, [config]);
293
+ }, [config, id, name]);
290
294
  /**
291
295
  * @description onChange传递数据
292
296
  */
@@ -303,7 +307,7 @@ function WorkerFlow(_ref, ref) {
303
307
  return {
304
308
  getConfig: getConfig
305
309
  };
306
- }, [config]);
310
+ }, [getConfig]);
307
311
  return /*#__PURE__*/React.createElement(WFC.Provider, {
308
312
  value: {
309
313
  config: config,
package/es/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export { default as ImageView } from './ImageView';
20
20
  export { default as InitialConfig } from './InitialConfig';
21
21
  export { default as InitialRequest } from './InitialRequest';
22
22
  export { default as Input } from './Input';
23
+ export { default as InstanceHistory } from './InstanceHistory';
23
24
  export { default as LabelValue } from './LabelValue';
24
25
  export { default as List } from './List';
25
26
  export { default as LoaderApp } from './LoaderApp';
@@ -35,8 +36,8 @@ export { default as ThemeAntd } from './ThemeAntd';
35
36
  export { default as Title } from './Title';
36
37
  export { default as Tree } from './Tree';
37
38
  export { default as useDrawer } from './useDrawer';
39
+ export { default as useHistory } from './useHistory';
38
40
  export { default as useHttp } from './useHttp';
39
41
  export { default as useModal } from './useModal';
40
- export { default as useNavigate } from './useNavigate';
41
42
  export { default as UserSelect } from './UserSelect';
42
43
  export { default as WorkerFlow } from './WorkerFlow';
package/es/index.js CHANGED
@@ -20,6 +20,7 @@ export { default as ImageView } from './ImageView';
20
20
  export { default as InitialConfig } from './InitialConfig';
21
21
  export { default as InitialRequest } from './InitialRequest';
22
22
  export { default as Input } from './Input';
23
+ export { default as InstanceHistory } from './InstanceHistory';
23
24
  export { default as LabelValue } from './LabelValue';
24
25
  export { default as List } from './List';
25
26
  export { default as LoaderApp } from './LoaderApp';
@@ -35,8 +36,8 @@ export { default as ThemeAntd } from './ThemeAntd';
35
36
  export { default as Title } from './Title';
36
37
  export { default as Tree } from './Tree';
37
38
  export { default as useDrawer } from './useDrawer';
39
+ export { default as useHistory } from './useHistory';
38
40
  export { default as useHttp } from './useHttp';
39
41
  export { default as useModal } from './useModal';
40
- export { default as useNavigate } from './useNavigate';
41
42
  export { default as UserSelect } from './UserSelect';
42
43
  export { default as WorkerFlow } from './WorkerFlow';
@@ -20,7 +20,7 @@ import CC from '../ConfigContext';
20
20
 
21
21
  function useDrawer() {
22
22
  var prefixCls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cloudapp';
23
- var context = useContext(CC);
23
+ var context = useContext(CC.Context);
24
24
  var root = useMemo(function () {
25
25
  return (context === null || context === void 0 ? void 0 : context.root) || document.body;
26
26
  }, [context === null || context === void 0 ? void 0 : context.root]);
@@ -0,0 +1,3 @@
1
+ import type { History } from 'history';
2
+ declare function useHistory(): History<unknown>;
3
+ export default useHistory;
@@ -0,0 +1,11 @@
1
+ import { useMemo } from 'react';
2
+ import InstanceHistory from '../InstanceHistory';
3
+
4
+ function useHistory() {
5
+ var history = useMemo(function () {
6
+ return InstanceHistory;
7
+ }, []);
8
+ return history;
9
+ }
10
+
11
+ export default useHistory;
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
10
10
 
11
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
13
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
14
14
 
15
15
  import { useCallback, useEffect, useMemo, useState } from 'react';
16
16
  var cacheMemory = {};
@@ -20,7 +20,7 @@ import CC from '../ConfigContext';
20
20
 
21
21
  function useModal() {
22
22
  var prefixCls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cloudapp';
23
- var context = useContext(CC);
23
+ var context = useContext(CC.Context);
24
24
  var root = useMemo(function () {
25
25
  return (context === null || context === void 0 ? void 0 : context.root) || document.body;
26
26
  }, [context === null || context === void 0 ? void 0 : context.root]);
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": "2.0.0-alpha.12",
5
+ "version": "2.0.0-alpha.16",
6
6
  "scripts": {
7
7
  "start": "dumi dev",
8
8
  "docs:build": "dumi build",
@@ -39,10 +39,11 @@
39
39
  "rc-queue-anim": "^2.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@cloud-app-dev/utils": "^3.0.2",
42
+ "@cloud-app-dev/utils": "^3.0.3",
43
43
  "@types/add-dom-event-listener": "^1.1.0",
44
44
  "@types/chroma-js": "^2.1.3",
45
45
  "@types/lodash-es": "^4.17.5",
46
+ "@types/node": "^12.0.0",
46
47
  "@umijs/test": "^3.0.5",
47
48
  "antd": "^4.17.0",
48
49
  "babel-plugin-import": "^1.13.3",
@@ -50,12 +51,13 @@
50
51
  "father-build": "^1.19.8",
51
52
  "gh-pages": "^3.0.0",
52
53
  "lint-staged": "^10.0.7",
53
- "mobx-react": "^7.2.0",
54
54
  "prettier": "^2.2.1",
55
55
  "react": "^17.0.2",
56
56
  "react-dom": "^17.0.2",
57
57
  "react-router-dom": "^6.2.1",
58
58
  "rollup-plugin-node-polyfills": "^0.2.1",
59
+ "tslib": "^2.3.1",
60
+ "typescript": "^4.5.4",
59
61
  "yorkie": "^2.0.0"
60
62
  },
61
63
  "repository": {
package/tsconfig.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "target": "es6",
5
5
  "module": "esnext",
6
- "lib": ["es2018", "dom"],
6
+ "lib": ["es2018", "dom", "es2019"],
7
7
  "rootDir": "./",
8
8
  "outDir": "es",
9
9
  "moduleResolution": "node",
@@ -1,3 +0,0 @@
1
- export declare function save(data: {
2
- [key: string]: any;
3
- }, token?: string): import("fetch-like-axios").AxiosPromise<any>;
@@ -1,13 +0,0 @@
1
- import _cache from "@cloud-app-dev/utils/es/cache";
2
- import { $http } from './http';
3
- export function save(data, token) {
4
- return $http({
5
- method: 'post',
6
- url: "/api/log/v1/addLog",
7
- data: data,
8
- requestId: 'addLog',
9
- headers: {
10
- Authorization: token || _cache.getCache('token', 'session')
11
- }
12
- });
13
- }
@@ -1,3 +0,0 @@
1
- export declare function formartDesc(desc: string, data: {
2
- [key: string]: any;
3
- }): string;
@@ -1,11 +0,0 @@
1
- export function formartDesc(desc, data) {
2
- try {
3
- Object.keys(data).forEach(function (key) {
4
- desc = desc.replace("<".concat(key, ">"), data[key]);
5
- });
6
- } catch (e) {
7
- console.warn('日志描述转换异常!', e);
8
- }
9
-
10
- return desc;
11
- }
File without changes
@@ -1,4 +0,0 @@
1
- import { NavigateFunction } from 'react-router-dom';
2
- import './index.less';
3
- declare function useNavigate(): NavigateFunction;
4
- export default useNavigate;
@@ -1,14 +0,0 @@
1
- import { useMemo } from 'react';
2
- import { useNavigate as useNativeNavigate } from 'react-router-dom';
3
- import "./index.css";
4
- var _global = window;
5
-
6
- function useNavigate() {
7
- var naticeNavigate = useNativeNavigate();
8
- var navigate = useMemo(function () {
9
- return _global.BasicNavigate || naticeNavigate;
10
- }, [naticeNavigate]);
11
- return navigate;
12
- }
13
-
14
- export default useNavigate;