@common-stack/client-react 0.6.1-alpha.4 → 1.0.1-alpha.0
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/lib/__tests__/fill-register-test.js +16 -41
- package/lib/__tests__/fill-register-test.js.map +1 -1
- package/lib/__tests__/helpers/sample-menu.js +1 -4
- package/lib/__tests__/helpers/sample-menu.js.map +1 -1
- package/lib/__tests__/integrated-routes.test.js +17 -44
- package/lib/__tests__/integrated-routes.test.js.map +1 -1
- package/lib/__tests__/router-render.test.js +14 -57
- package/lib/__tests__/router-render.test.js.map +1 -1
- package/lib/connector/base-connector.d.ts +53 -0
- package/lib/connector/base-connector.js +129 -0
- package/lib/connector/base-connector.js.map +1 -0
- package/lib/connector/connector.d.ts +9 -0
- package/lib/connector/connector.js +14 -0
- package/lib/connector/connector.js.map +1 -0
- package/lib/connector/connector.native.d.ts +9 -0
- package/lib/connector/connector.native.js +15 -0
- package/lib/connector/connector.native.js.map +1 -0
- package/lib/connector/connector.test.js +11 -0
- package/lib/connector/connector.test.js.map +1 -0
- package/lib/connector/index.d.ts +1 -0
- package/lib/connector/index.js +2 -0
- package/lib/connector/index.js.map +1 -0
- package/lib/index.d.ts +1 -2
- package/lib/index.js +10 -29
- package/lib/index.js.map +1 -1
- package/lib/index.native.d.ts +1 -1
- package/lib/index.native.js +10 -28
- package/lib/index.native.js.map +1 -1
- package/lib/interfaces/extended-feature.d.ts +50 -0
- package/lib/interfaces/extended-feature.js +1 -56
- package/lib/interfaces/extended-feature.js.map +1 -1
- package/lib/interfaces/feature.d.ts +13 -0
- package/lib/interfaces/feature.js +2 -0
- package/lib/interfaces/feature.js.map +1 -0
- package/lib/interfaces/index.d.ts +2 -0
- package/lib/interfaces/index.js +5 -20
- package/lib/interfaces/index.js.map +1 -1
- package/lib/interfaces/menu.js +2 -5
- package/lib/interfaces/menu.js.map +1 -1
- package/lib/interfaces/new-router.js +1 -2
- package/lib/interfaces/router.js +1 -2
- package/lib/inversify/InversifyContext.d.ts +3 -3
- package/lib/inversify/InversifyContext.js +6 -34
- package/lib/inversify/InversifyContext.js.map +1 -1
- package/lib/inversify/index.js +1 -17
- package/lib/inversify/index.js.map +1 -1
- package/lib/plugin-area/__tests__/higher-order-component-util.test.js +13 -38
- package/lib/plugin-area/__tests__/higher-order-component-util.test.js.map +1 -1
- package/lib/plugin-area/__tests__/plugin-api.test.js +11 -13
- package/lib/plugin-area/__tests__/plugin-api.test.js.map +1 -1
- package/lib/plugin-area/base-plugin-area.js +18 -39
- package/lib/plugin-area/base-plugin-area.js.map +1 -1
- package/lib/plugin-area/higher-order-component-util.js +3 -7
- package/lib/plugin-area/higher-order-component-util.js.map +1 -1
- package/lib/plugin-area/index.js +5 -35
- package/lib/plugin-area/index.js.map +1 -1
- package/lib/plugin-area/index.native.js +7 -37
- package/lib/plugin-area/index.native.js.map +1 -1
- package/lib/plugin-area/plugin-api.js +15 -18
- package/lib/plugin-area/plugin-api.js.map +1 -1
- package/lib/plugin-area/plugin-context.js +5 -32
- package/lib/plugin-area/plugin-context.js.map +1 -1
- package/lib/route/__tests__/admin-new-routes.test.js +11 -45
- package/lib/route/__tests__/admin-new-routes.test.js.map +1 -1
- package/lib/route/__tests__/getFlatMenus.test.js +5 -7
- package/lib/route/__tests__/getFlatMenus.test.js.map +1 -1
- package/lib/route/__tests__/render-routes-config.test.js +6 -18
- package/lib/route/__tests__/render-routes-config.test.js.map +1 -1
- package/lib/route/__tests__/route-type.test.js +1 -2
- package/lib/route/__tests__/route-type.test.js.map +1 -1
- package/lib/route/get-routes.js +22 -29
- package/lib/route/get-routes.js.map +1 -1
- package/lib/route/get-routes.test.js +6 -17
- package/lib/route/get-routes.test.js.map +1 -1
- package/lib/route/index.js +2 -18
- package/lib/route/index.js.map +1 -1
- package/lib/route/index.native.js +1 -17
- package/lib/route/index.native.js.map +1 -1
- package/lib/route/old/__tests__/config-sidebar-menu.test.d.ts +1 -0
- package/lib/route/old/__tests__/config-sidebar-menu.test.js +199 -198
- package/lib/route/old/__tests__/config-sidebar-menu.test.js.map +1 -1
- package/lib/route/old/get-menus.js +14 -21
- package/lib/route/old/get-menus.js.map +1 -1
- package/lib/route/old/get-routes-notused.js +14 -12
- package/lib/route/old/get-routes-notused.js.map +1 -1
- package/lib/route/old/render.js +4 -31
- package/lib/route/old/render.js.map +1 -1
- package/lib/route/react-navigation/get-navigation-utils.js +35 -40
- package/lib/route/react-navigation/get-navigation-utils.js.map +1 -1
- package/lib/route/react-navigation/get-navigation-utils.test.js +19 -21
- package/lib/route/react-navigation/get-navigation-utils.test.js.map +1 -1
- package/lib/route/react-navigation/index.js +2 -18
- package/lib/route/react-navigation/index.js.map +1 -1
- package/lib/route/react-navigation/react-native.sample.test.js +8 -22
- package/lib/route/react-navigation/react-native.sample.test.js.map +1 -1
- package/lib/route/react-navigation/react-native.sample1.test.js +14 -48
- package/lib/route/react-navigation/react-native.sample1.test.js.map +1 -1
- package/lib/route/react-navigation/react-navigation-render.js +16 -31
- package/lib/route/react-navigation/react-navigation-render.js.map +1 -1
- package/lib/route/react-navigation/react-navigation-render.test.js +23 -37
- package/lib/route/react-navigation/react-navigation-render.test.js.map +1 -1
- package/lib/route/react-navigation/root-navigation.js +5 -9
- package/lib/route/react-navigation/root-navigation.js.map +1 -1
- package/lib/route/react-navigation/routes.js +1 -2
- package/lib/route/react-navigation/types.js +1 -5
- package/lib/route/react-navigation/types.js.map +1 -1
- package/lib/route/render-routes.js +33 -66
- package/lib/route/render-routes.js.map +1 -1
- package/lib/route/render-routes.native.js +33 -66
- package/lib/route/render-routes.native.js.map +1 -1
- package/lib/route/render-routes.test.js +112 -126
- package/lib/route/render-routes.test.js.map +1 -1
- package/lib/route/root-navigation.js +3 -7
- package/lib/route/root-navigation.js.map +1 -1
- package/lib/route-based-plugin-area/__tests__/higher-order-component-util.test.js +13 -38
- package/lib/route-based-plugin-area/__tests__/higher-order-component-util.test.js.map +1 -1
- package/lib/route-based-plugin-area/__tests__/plugin-api.test.js +11 -13
- package/lib/route-based-plugin-area/__tests__/plugin-api.test.js.map +1 -1
- package/lib/route-based-plugin-area/higher-order-component-util.js +3 -7
- package/lib/route-based-plugin-area/higher-order-component-util.js.map +1 -1
- package/lib/route-based-plugin-area/index.js +2 -18
- package/lib/route-based-plugin-area/index.js.map +1 -1
- package/lib/route-based-plugin-area/plugin-api.js +15 -18
- package/lib/route-based-plugin-area/plugin-api.js.map +1 -1
- package/lib/route-based-plugin-area/plugin-context.js +5 -32
- package/lib/route-based-plugin-area/plugin-context.js.map +1 -1
- package/lib/route-based-plugin-area/route-based-plugin-area.js +12 -39
- package/lib/route-based-plugin-area/route-based-plugin-area.js.map +1 -1
- package/lib/router-factory/index.d.ts +1 -1
- package/lib/router-factory/index.js +6 -32
- package/lib/router-factory/index.js.map +1 -1
- package/lib/router-factory/index.native.d.ts +1 -1
- package/lib/router-factory/index.native.js +6 -32
- package/lib/router-factory/index.native.js.map +1 -1
- package/lib/utils/before-ssr.d.ts +5 -0
- package/lib/utils/before-ssr.js +9 -0
- package/lib/utils/before-ssr.js.map +1 -0
- package/lib/utils/combine.d.ts +1 -0
- package/lib/utils/combine.js +3 -0
- package/lib/utils/combine.js.map +1 -0
- package/lib/utils/hydrate.d.ts +4 -0
- package/lib/utils/hydrate.js +14 -0
- package/lib/utils/hydrate.js.map +1 -0
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/index.js +5 -18
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/sort-keys.js +3 -10
- package/lib/utils/sort-keys.js.map +1 -1
- package/lib/utils/sort-keys.test.js +2 -4
- package/lib/utils/sort-keys.test.js.map +1 -1
- package/lib/utils/utils.js +1 -5
- package/lib/utils/utils.js.map +1 -1
- package/package.json +6 -5
- package/lib/application/__tests__/react-client.test.d.ts +0 -1
- package/lib/application/__tests__/react-client.test.js +0 -23
- package/lib/application/__tests__/react-client.test.js.map +0 -1
- package/lib/application/base-apollo-client.d.ts +0 -21
- package/lib/application/base-apollo-client.js +0 -161
- package/lib/application/base-apollo-client.js.map +0 -1
- package/lib/application/base-redux-config.d.ts +0 -22
- package/lib/application/base-redux-config.js +0 -58
- package/lib/application/base-redux-config.js.map +0 -1
- package/lib/application/config.d.ts +0 -4
- package/lib/application/config.js +0 -38
- package/lib/application/config.js.map +0 -1
- package/lib/application/react-client.d.ts +0 -7
- package/lib/application/react-client.js +0 -152
- package/lib/application/react-client.js.map +0 -1
- package/lib/connector/base-react-client-feature.d.ts +0 -31
- package/lib/connector/base-react-client-feature.js +0 -102
- package/lib/connector/base-react-client-feature.js.map +0 -1
- package/lib/connector/monaco-connector.d.ts +0 -19
- package/lib/connector/monaco-connector.js +0 -76
- package/lib/connector/monaco-connector.js.map +0 -1
- package/lib/connector/react-client-feature.d.ts +0 -7
- package/lib/connector/react-client-feature.js +0 -15
- package/lib/connector/react-client-feature.js.map +0 -1
- package/lib/connector/react-client-feature.native.d.ts +0 -7
- package/lib/connector/react-client-feature.native.js +0 -18
- package/lib/connector/react-client-feature.native.js.map +0 -1
- package/lib/connector/react-client-feature.test.js +0 -10
- package/lib/connector/react-client-feature.test.js.map +0 -1
- package/lib/interfaces/monaco-feature.d.ts +0 -46
- package/lib/interfaces/monaco-feature.js +0 -3
- package/lib/interfaces/monaco-feature.js.map +0 -1
- package/lib/interfaces/react-client-feature.d.ts +0 -77
- package/lib/interfaces/react-client-feature.js +0 -3
- package/lib/interfaces/react-client-feature.js.map +0 -1
- /package/lib/connector/{react-client-feature.test.d.ts → connector.test.d.ts} +0 -0
package/lib/index.js
CHANGED
|
@@ -1,30 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ClientTypes = void 0;
|
|
18
|
-
var client_core_1 = require("@common-stack/client-core");
|
|
19
|
-
Object.defineProperty(exports, "ClientTypes", { enumerable: true, get: function () { return client_core_1.ClientTypes; } });
|
|
20
|
-
__exportStar(require("./connector/react-client-feature"), exports);
|
|
21
|
-
__exportStar(require("./connector/monaco-connector"), exports);
|
|
22
|
-
__exportStar(require("./router-factory"), exports);
|
|
23
|
-
__exportStar(require("./route"), exports);
|
|
24
|
-
__exportStar(require("./route/root-navigation"), exports);
|
|
25
|
-
__exportStar(require("./utils"), exports);
|
|
26
|
-
__exportStar(require("./interfaces"), exports);
|
|
27
|
-
__exportStar(require("./plugin-area"), exports);
|
|
28
|
-
__exportStar(require("./route-based-plugin-area"), exports);
|
|
29
|
-
__exportStar(require("./inversify"), exports);
|
|
1
|
+
export { ClientTypes } from '@common-stack/client-core';
|
|
2
|
+
export * from './connector';
|
|
3
|
+
export * from './router-factory';
|
|
4
|
+
export * from './route';
|
|
5
|
+
export * from './route/root-navigation';
|
|
6
|
+
export * from './utils';
|
|
7
|
+
export * from './interfaces';
|
|
8
|
+
export * from './plugin-area';
|
|
9
|
+
export * from './route-based-plugin-area';
|
|
10
|
+
export * from './inversify';
|
|
30
11
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC"}
|
package/lib/index.native.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ClientTypes } from '@common-stack/client-core';
|
|
2
|
-
export * from './connector/
|
|
2
|
+
export * from './connector/connector.native';
|
|
3
3
|
export * from './router-factory/index.native';
|
|
4
4
|
export * from './route/index.native';
|
|
5
5
|
export * from './route/react-navigation/root-navigation';
|
package/lib/index.native.js
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ClientTypes = void 0;
|
|
18
|
-
var client_core_1 = require("@common-stack/client-core");
|
|
19
|
-
Object.defineProperty(exports, "ClientTypes", { enumerable: true, get: function () { return client_core_1.ClientTypes; } });
|
|
20
|
-
__exportStar(require("./connector/react-client-feature.native"), exports);
|
|
21
|
-
__exportStar(require("./router-factory/index.native"), exports);
|
|
22
|
-
__exportStar(require("./route/index.native"), exports);
|
|
23
|
-
__exportStar(require("./route/react-navigation/root-navigation"), exports);
|
|
24
|
-
__exportStar(require("./utils"), exports);
|
|
25
|
-
__exportStar(require("./interfaces"), exports);
|
|
26
|
-
__exportStar(require("./plugin-area/index.native"), exports);
|
|
27
|
-
__exportStar(require("./route-based-plugin-area"), exports);
|
|
28
|
-
__exportStar(require("./inversify"), exports);
|
|
1
|
+
export { ClientTypes } from '@common-stack/client-core';
|
|
2
|
+
export * from './connector/connector.native';
|
|
3
|
+
export * from './router-factory/index.native';
|
|
4
|
+
export * from './route/index.native';
|
|
5
|
+
export * from './route/react-navigation/root-navigation';
|
|
6
|
+
export * from './utils';
|
|
7
|
+
export * from './interfaces';
|
|
8
|
+
export * from './plugin-area/index.native';
|
|
9
|
+
export * from './route-based-plugin-area';
|
|
10
|
+
export * from './inversify';
|
|
29
11
|
//# sourceMappingURL=index.native.js.map
|
package/lib/index.native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0CAA0C,CAAC;AACzD,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IFeature } from '@common-stack/client-core';
|
|
3
|
+
import { IMappedData, IRouteData } from './router';
|
|
4
|
+
import { IMenuData } from './menu';
|
|
5
|
+
import { ComponentElement } from 'react';
|
|
6
|
+
export interface IPlugin {
|
|
7
|
+
name: string;
|
|
8
|
+
icon?: string | ComponentElement<any, any> | Function;
|
|
9
|
+
render: React.FC<any>;
|
|
10
|
+
}
|
|
11
|
+
export type IReactFeature = IFeature & IReactModuleShape & {
|
|
12
|
+
readonly getRouter: any;
|
|
13
|
+
/**
|
|
14
|
+
* @returns client-side React route components list
|
|
15
|
+
*/
|
|
16
|
+
readonly getRoutes: any;
|
|
17
|
+
readonly getConfiguredRoutes: any;
|
|
18
|
+
readonly getMenus: any;
|
|
19
|
+
readonly getConfiguredMenus: any;
|
|
20
|
+
readonly routeConfig: IRouteData;
|
|
21
|
+
readonly menuConfig: IMappedData;
|
|
22
|
+
componentFillPlugins: IPlugin[];
|
|
23
|
+
/**
|
|
24
|
+
* React component of all fill of each plugin.
|
|
25
|
+
*/
|
|
26
|
+
getComponentFillPlugins(): IPlugin[];
|
|
27
|
+
/**
|
|
28
|
+
* Authentication Wrapper for secured routes
|
|
29
|
+
*/
|
|
30
|
+
readonly authWrapper?: (ele: React.ReactElement, props: Record<string, any>) => void;
|
|
31
|
+
};
|
|
32
|
+
export type IReactModuleShape = {
|
|
33
|
+
/**
|
|
34
|
+
* @param route Route list
|
|
35
|
+
*/
|
|
36
|
+
readonly route?: any;
|
|
37
|
+
/**
|
|
38
|
+
* @param routeConfig Custom route data to create React Routers
|
|
39
|
+
*/
|
|
40
|
+
readonly routeConfig?: IRouteData | IRouteData[];
|
|
41
|
+
/**
|
|
42
|
+
* @param menuConfig Menu data to create side menu
|
|
43
|
+
*/
|
|
44
|
+
readonly menuConfig?: IMenuData | IMenuData[];
|
|
45
|
+
readonly componentFillPlugins?: IPlugin[];
|
|
46
|
+
/**
|
|
47
|
+
* Authentication Wrapper for secured routes
|
|
48
|
+
*/
|
|
49
|
+
readonly authWrapper?: (ele: React.ReactElement, props: Record<string, any>) => void;
|
|
50
|
+
};
|
|
@@ -1,57 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
// import { IFeature } from '@common-stack/client-core';
|
|
3
|
-
// import { IMappedData, IRouteData } from './router';
|
|
4
|
-
// import { IMenuData } from './menu';
|
|
5
|
-
// import { ComponentElement } from 'react';
|
|
6
|
-
// export interface IPlugin {
|
|
7
|
-
// name: string;
|
|
8
|
-
// icon?: string | ComponentElement<any, any> | Function;
|
|
9
|
-
// render: React.FC<any>;
|
|
10
|
-
// }
|
|
11
|
-
// export type IReactFeature = IFeature & IReactModuleShape & {
|
|
12
|
-
// readonly getRouter;
|
|
13
|
-
// /**
|
|
14
|
-
// * @returns client-side React route components list
|
|
15
|
-
// */
|
|
16
|
-
// readonly getRoutes;
|
|
17
|
-
// readonly getConfiguredRoutes;
|
|
18
|
-
// readonly getMenus;
|
|
19
|
-
// readonly getConfiguredMenus;
|
|
20
|
-
// readonly routeConfig: IRouteData;
|
|
21
|
-
// readonly menuConfig: IMappedData;
|
|
22
|
-
// // Related to React Slot Fill
|
|
23
|
-
// componentFillPlugins: IPlugin[];
|
|
24
|
-
// /**
|
|
25
|
-
// * React component of all fill of each plugin.
|
|
26
|
-
// */
|
|
27
|
-
// getComponentFillPlugins(): IPlugin[];
|
|
28
|
-
// /**
|
|
29
|
-
// * Authentication Wrapper for secured routes
|
|
30
|
-
// */
|
|
31
|
-
// readonly authWrapper?: (
|
|
32
|
-
// ele: React.ReactElement,
|
|
33
|
-
// props: Record<string, any>) => void
|
|
34
|
-
// };
|
|
35
|
-
// export type IReactModuleShape = {
|
|
36
|
-
// /**
|
|
37
|
-
// * @param route Route list
|
|
38
|
-
// */
|
|
39
|
-
// readonly route?: any;
|
|
40
|
-
// /**
|
|
41
|
-
// * @param routeConfig Custom route data to create React Routers
|
|
42
|
-
// */
|
|
43
|
-
// readonly routeConfig?: IRouteData | IRouteData[];
|
|
44
|
-
// /**
|
|
45
|
-
// * @param menuConfig Menu data to create side menu
|
|
46
|
-
// */
|
|
47
|
-
// readonly menuConfig?: IMenuData | IMenuData[];
|
|
48
|
-
// // Related to React Slot Fill
|
|
49
|
-
// readonly componentFillPlugins?: IPlugin[];
|
|
50
|
-
// /**
|
|
51
|
-
// * Authentication Wrapper for secured routes
|
|
52
|
-
// */
|
|
53
|
-
// readonly authWrapper?: (
|
|
54
|
-
// ele: React.ReactElement,
|
|
55
|
-
// props: Record<string, any>) => void
|
|
56
|
-
// };
|
|
1
|
+
export {};
|
|
57
2
|
//# sourceMappingURL=extended-feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extended-feature.js","sourceRoot":"","sources":["../../src/interfaces/extended-feature.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extended-feature.js","sourceRoot":"","sources":["../../src/interfaces/extended-feature.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IModuleShape } from '@common-stack/client-core';
|
|
2
|
+
import { Container } from 'inversify';
|
|
3
|
+
import { IReactModuleShape } from './extended-feature';
|
|
4
|
+
import { Feature } from '../connector';
|
|
5
|
+
type SSRFeatureOptions = {
|
|
6
|
+
readonly hydrate?: (container: Container, state: never) => void;
|
|
7
|
+
readonly beforeSSR?: (options: {
|
|
8
|
+
request: any;
|
|
9
|
+
module: Feature;
|
|
10
|
+
}) => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export type FeatureParam = IModuleShape & IReactModuleShape & SSRFeatureOptions;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.js","sourceRoot":"","sources":["../../src/interfaces/feature.ts"],"names":[],"mappings":""}
|
package/lib/interfaces/index.js
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./router"), exports);
|
|
18
|
-
// export * from './extended-feature';
|
|
19
|
-
__exportStar(require("./menu"), exports);
|
|
20
|
-
__exportStar(require("./new-router"), exports);
|
|
1
|
+
export * from './router';
|
|
2
|
+
export * from './extended-feature';
|
|
3
|
+
export * from './menu';
|
|
4
|
+
export * from './new-router';
|
|
5
|
+
export * from './feature';
|
|
21
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
package/lib/interfaces/menu.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IMenuPosition = void 0;
|
|
4
|
-
var IMenuPosition;
|
|
1
|
+
export var IMenuPosition;
|
|
5
2
|
(function (IMenuPosition) {
|
|
6
3
|
IMenuPosition["LOGO"] = "LOGO";
|
|
7
4
|
IMenuPosition["UPPER"] = "UPPER";
|
|
@@ -13,5 +10,5 @@ var IMenuPosition;
|
|
|
13
10
|
IMenuPosition["Middle"] = "MIDDLE";
|
|
14
11
|
IMenuPosition["Lower"] = "LOWER";
|
|
15
12
|
IMenuPosition["Bottom"] = "BOTTOM";
|
|
16
|
-
})(IMenuPosition
|
|
13
|
+
})(IMenuPosition || (IMenuPosition = {}));
|
|
17
14
|
//# sourceMappingURL=menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../src/interfaces/menu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../src/interfaces/menu.tsx"],"names":[],"mappings":"AAsGA,MAAM,CAAN,IAAY,aAWX;AAXD,WAAY,aAAa;IACrB,8BAAa,CAAA;IACb,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,8BAAa,CAAA;IACb,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,gCAAe,CAAA;IACf,kCAAiB,CAAA;AACrB,CAAC,EAXW,aAAa,KAAb,aAAa,QAWxB"}
|
package/lib/interfaces/router.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { interfaces } from 'inversify';
|
|
3
|
-
import {
|
|
3
|
+
import { IFeature } from '@common-stack/client-core';
|
|
4
4
|
export declare const InversifyContext: React.Context<{
|
|
5
5
|
container: interfaces.Container | null;
|
|
6
|
-
modules:
|
|
6
|
+
modules: IFeature;
|
|
7
7
|
}>;
|
|
8
8
|
type Props = {
|
|
9
9
|
container: interfaces.Container;
|
|
10
|
-
modules:
|
|
10
|
+
modules: IFeature;
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
};
|
|
13
13
|
export declare const InversifyProvider: React.FC<Props>;
|
|
@@ -1,41 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.useInjection = exports.InversifyProvider = exports.InversifyContext = void 0;
|
|
27
|
-
const React = __importStar(require("react"));
|
|
28
|
-
exports.InversifyContext = React.createContext({ container: null, modules: null });
|
|
29
|
-
const InversifyProvider = (props) => {
|
|
30
|
-
return (React.createElement(exports.InversifyContext.Provider, { value: { container: props.container, modules: props.modules } }, props.children));
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export const InversifyContext = React.createContext({ container: null, modules: null });
|
|
3
|
+
export const InversifyProvider = (props) => {
|
|
4
|
+
return (React.createElement(InversifyContext.Provider, { value: { container: props.container, modules: props.modules } }, props.children));
|
|
31
5
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const { container } = React.useContext(exports.InversifyContext);
|
|
6
|
+
export function useInjection(identifier) {
|
|
7
|
+
const { container } = React.useContext(InversifyContext);
|
|
35
8
|
if (!container) {
|
|
36
9
|
throw new Error('Container is null');
|
|
37
10
|
}
|
|
38
11
|
return container.get(identifier);
|
|
39
12
|
}
|
|
40
|
-
exports.useInjection = useInjection;
|
|
41
13
|
//# sourceMappingURL=InversifyContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InversifyContext.js","sourceRoot":"","sources":["../../src/inversify/InversifyContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InversifyContext.js","sourceRoot":"","sources":["../../src/inversify/InversifyContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAA+D,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAStJ,MAAM,CAAC,MAAM,iBAAiB,GAAoB,CAAC,KAAK,EAAE,EAAE;IACxD,OAAO,CACH,oBAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAClF,KAAK,CAAC,QAAQ,CACS,CAC/B,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,UAAU,YAAY,CAAI,UAA2C;IACvE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IACzD,IAAI,CAAC,SAAS,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;KACxC;IACD,OAAO,SAAS,CAAC,GAAG,CAAI,UAAU,CAAC,CAAC;AACxC,CAAC"}
|
package/lib/inversify/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./InversifyContext"), exports);
|
|
1
|
+
export * from './InversifyContext';
|
|
18
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inversify/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inversify/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,63 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const react_1 = __importStar(require("react"));
|
|
27
|
-
const higher_order_component_util_1 = require("../higher-order-component-util");
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { createHigherOrderComponent } from '../higher-order-component-util';
|
|
28
3
|
describe('createHigherOrderComponent', () => {
|
|
29
4
|
it('should use default name for anonymous function', () => {
|
|
30
|
-
const TestComponent =
|
|
31
|
-
expect(TestComponent.displayName).toBe('WithTest(Component
|
|
5
|
+
const TestComponent = createHigherOrderComponent((OriginalComponent) => OriginalComponent, 'withTest')(() => React.createElement("div", null));
|
|
6
|
+
expect(TestComponent.displayName).toBe('WithTest(Component');
|
|
32
7
|
});
|
|
33
8
|
it('should use camel case starting with upper for wrapper prefix ', () => {
|
|
34
|
-
const TestComponent =
|
|
9
|
+
const TestComponent = createHigherOrderComponent((OriginalComponent) => OriginalComponent, 'with-one-two_threeFOUR')(() => React.createElement("div", null));
|
|
35
10
|
expect(TestComponent.displayName).toBe('WithOneTwoThreeFour(Component)');
|
|
36
11
|
});
|
|
37
12
|
it('should use function name', () => {
|
|
38
13
|
function SomeComponent() {
|
|
39
|
-
return
|
|
14
|
+
return React.createElement("div", null);
|
|
40
15
|
}
|
|
41
|
-
const TestComponent =
|
|
16
|
+
const TestComponent = createHigherOrderComponent((OriginalComponent) => OriginalComponent, 'withTest')(SomeComponent);
|
|
42
17
|
expect(TestComponent.displayName).toBe('WithTest(SomeComponent)');
|
|
43
18
|
});
|
|
44
19
|
it('should use component class name', () => {
|
|
45
|
-
class SomeAnotherComponent extends
|
|
20
|
+
class SomeAnotherComponent extends Component {
|
|
46
21
|
render() {
|
|
47
|
-
return
|
|
22
|
+
return React.createElement("div", null);
|
|
48
23
|
}
|
|
49
24
|
}
|
|
50
|
-
const TestComponent =
|
|
25
|
+
const TestComponent = createHigherOrderComponent((OriginalComponent) => OriginalComponent, 'withTest')(SomeAnotherComponent);
|
|
51
26
|
expect(TestComponent.displayName).toBe('WithTest(SomeAnotherComponent)');
|
|
52
27
|
});
|
|
53
28
|
it('should use displayName property', () => {
|
|
54
|
-
class SomeYetAnotherComponent extends
|
|
29
|
+
class SomeYetAnotherComponent extends Component {
|
|
55
30
|
render() {
|
|
56
|
-
return
|
|
31
|
+
return React.createElement("div", null);
|
|
57
32
|
}
|
|
58
33
|
}
|
|
59
34
|
SomeYetAnotherComponent.displayName = 'CustomDisplayName';
|
|
60
|
-
const TestComponent =
|
|
35
|
+
const TestComponent = createHigherOrderComponent((OriginalComponent) => OriginalComponent, 'withTest')(SomeYetAnotherComponent);
|
|
61
36
|
expect(TestComponent.displayName).toBe('WithTest(CustomDisplayName)');
|
|
62
37
|
});
|
|
63
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"higher-order-component-util.test.js","sourceRoot":"","sources":["../../../src/plugin-area/__tests__/higher-order-component-util.test.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"higher-order-component-util.test.js","sourceRoot":"","sources":["../../../src/plugin-area/__tests__/higher-order-component-util.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE5E,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACtD,MAAM,aAAa,GAAG,0BAA0B,CAC5C,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,EACxC,UAAU,CACb,CAAE,GAAG,EAAE,CAAC,gCAAO,CAAE,CAAC;QAEnB,MAAM,CAAE,aAAa,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAE,+DAA+D,EAAE,GAAG,EAAE;QAC5E,MAAM,aAAa,GAAG,0BAA0B,CAC/C,CAAE,iBAAiB,EAAG,EAAE,CAAC,iBAAiB,EAC1C,wBAAwB,CACxB,CAAE,GAAG,EAAE,CAAC,gCAAO,CAAE,CAAC;QAEnB,MAAM,CAAE,aAAa,CAAC,WAAW,CAAE,CAAC,IAAI,CACvC,gCAAgC,CAChC,CAAC;IACH,CAAC,CAAE,CAAC;IAEJ,EAAE,CAAE,0BAA0B,EAAE,GAAG,EAAE;QACpC,SAAS,aAAa;YACrB,OAAO,gCAAO,CAAC;QAChB,CAAC;QACD,MAAM,aAAa,GAAG,0BAA0B,CAC/C,CAAE,iBAAiB,EAAG,EAAE,CAAC,iBAAiB,EAC1C,UAAU,CACV,CAAE,aAAa,CAAE,CAAC;QAEnB,MAAM,CAAE,aAAa,CAAC,WAAW,CAAE,CAAC,IAAI,CAAE,yBAAyB,CAAE,CAAC;IACvE,CAAC,CAAE,CAAC;IAEJ,EAAE,CAAE,iCAAiC,EAAE,GAAG,EAAE;QAC3C,MAAM,oBAAqB,SAAQ,SAAS;YAC3C,MAAM;gBACL,OAAO,gCAAO,CAAC;YAChB,CAAC;SACD;QACD,MAAM,aAAa,GAAG,0BAA0B,CAC/C,CAAE,iBAAiB,EAAG,EAAE,CAAC,iBAAiB,EAC1C,UAAU,CACV,CAAE,oBAAoB,CAAE,CAAC;QAE1B,MAAM,CAAE,aAAa,CAAC,WAAW,CAAE,CAAC,IAAI,CACvC,gCAAgC,CAChC,CAAC;IACH,CAAC,CAAE,CAAC;IAEJ,EAAE,CAAE,iCAAiC,EAAE,GAAG,EAAE;QAC3C,MAAM,uBAAwB,SAAQ,SAAS;YAC9C,MAAM;gBACL,OAAO,gCAAO,CAAC;YAChB,CAAC;SACD;QACA,uBAA+B,CAAC,WAAW,GAAG,mBAAmB,CAAC;QACnE,MAAM,aAAa,GAAG,0BAA0B,CAC/C,CAAE,iBAAiB,EAAG,EAAE,CAAC,iBAAiB,EAC1C,UAAU,CACV,CAAE,uBAAuB,CAAE,CAAC;QAE7B,MAAM,CAAE,aAAa,CAAC,WAAW,CAAE,CAAC,IAAI,CACvC,6BAA6B,CAC7B,CAAC;IACH,CAAC,CAAE,CAAC;AACL,CAAC,CAAC,CAAA"}
|
|
@@ -1,51 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const plugin_api_1 = require("../plugin-api");
|
|
1
|
+
import { registerPlugin, unregisterPlugin, getPlugin, getPlugins } from '../plugin-api';
|
|
4
2
|
describe('registerPlugin', () => {
|
|
5
3
|
afterEach(() => {
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
getPlugins().forEach((plugin) => {
|
|
5
|
+
unregisterPlugin(plugin.name);
|
|
8
6
|
});
|
|
9
7
|
});
|
|
10
8
|
it('successfully registers a plugin', () => {
|
|
11
9
|
const name = 'plugin';
|
|
12
10
|
const icon = 'smiley';
|
|
13
11
|
const Component = () => 'plugin content';
|
|
14
|
-
|
|
12
|
+
registerPlugin(name, {
|
|
15
13
|
render: Component,
|
|
16
14
|
icon,
|
|
17
15
|
});
|
|
18
|
-
expect(
|
|
16
|
+
expect(getPlugin(name)).toEqual({
|
|
19
17
|
name,
|
|
20
18
|
render: Component,
|
|
21
19
|
icon,
|
|
22
20
|
});
|
|
23
21
|
});
|
|
24
22
|
it('fails to register a plugin without a settings object', () => {
|
|
25
|
-
|
|
23
|
+
registerPlugin();
|
|
26
24
|
expect(console).toThrowError('No settings object provided!');
|
|
27
25
|
});
|
|
28
26
|
it('fails to register a plugin with special character in the name', () => {
|
|
29
|
-
|
|
27
|
+
registerPlugin('plugin/with/special/characters', {
|
|
30
28
|
render: () => { },
|
|
31
29
|
});
|
|
32
30
|
expect(console).toThrowError('Plugin names must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".');
|
|
33
31
|
});
|
|
34
32
|
it('fails to register a plugin with a non-string name', () => {
|
|
35
|
-
|
|
33
|
+
registerPlugin({}, {
|
|
36
34
|
render: () => { },
|
|
37
35
|
});
|
|
38
36
|
expect(console).toThrowError('Plugin names must be strings.');
|
|
39
37
|
});
|
|
40
38
|
it('fails to register a plugin without a render function', () => {
|
|
41
|
-
|
|
39
|
+
registerPlugin('another-plugin', {});
|
|
42
40
|
expect(console).toThrowError('The "render" property must be specified and must be a valid function.');
|
|
43
41
|
});
|
|
44
42
|
it('fails to register a plugin that was already been registered', () => {
|
|
45
|
-
|
|
43
|
+
registerPlugin('plugin', {
|
|
46
44
|
render: () => 'plugin content',
|
|
47
45
|
});
|
|
48
|
-
|
|
46
|
+
registerPlugin('plugin', {
|
|
49
47
|
render: () => 'plugin content',
|
|
50
48
|
});
|
|
51
49
|
expect(console).toThrowError('Plugin "plugin" is already registered.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-api.test.js","sourceRoot":"","sources":["../../../src/plugin-area/__tests__/plugin-api.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin-api.test.js","sourceRoot":"","sources":["../../../src/plugin-area/__tests__/plugin-api.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGvF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,SAAS,CAAC,GAAG,EAAE;QACX,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC5B,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACvC,MAAM,IAAI,GAAG,QAAQ,CAAC;QACtB,MAAM,IAAI,GAAG,QAAQ,CAAC;QACtB,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC;QAEzC,cAAc,CAAC,IAAI,EAAE;YACjB,MAAM,EAAE,SAAS;YACjB,IAAI;SACP,CAAC,CAAC;QAEH,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;YAC5B,IAAI;YACJ,MAAM,EAAE,SAAS;YACjB,IAAI;SACP,CAAC,CAAA;IACN,CAAC,CAAC,CAAC;IAEN,EAAE,CAAE,sDAAsD,EAAE,GAAG,EAAE;QAC1D,cAAe,EAAE,CAAC;QACxB,MAAM,CAAE,OAAO,CAAE,CAAC,YAAY,CAAE,8BAA8B,CAAE,CAAC;IAClE,CAAC,CAAE,CAAC;IAEJ,EAAE,CAAE,+DAA+D,EAAE,GAAG,EAAE;QACzE,cAAc,CAAE,gCAAgC,EAAE;YACjD,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;SAChB,CAAE,CAAC;QACJ,MAAM,CAAE,OAAO,CAAE,CAAC,YAAY,CAC7B,4HAA4H,CAC5H,CAAC;IACH,CAAC,CAAE,CAAC;IAEJ,EAAE,CAAE,mDAAmD,EAAE,GAAG,EAAE;QAC7D,cAAc,CACb,EAAE,EACF;YACC,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;SAChB,CACD,CAAC;QACF,MAAM,CAAE,OAAO,CAAE,CAAC,YAAY,CAAE,+BAA+B,CAAE,CAAC;IACnE,CAAC,CAAE,CAAC;IAEJ,EAAE,CAAE,sDAAsD,EAAE,GAAG,EAAE;QAChE,cAAc,CAAE,gBAAgB,EAAE,EAAE,CAAE,CAAC;QACvC,MAAM,CAAE,OAAO,CAAE,CAAC,YAAY,CAC7B,uEAAuE,CACvE,CAAC;IACH,CAAC,CAAE,CAAC;IAEJ,EAAE,CAAE,6DAA6D,EAAE,GAAG,EAAE;QACvE,cAAc,CAAE,QAAQ,EAAE;YACzB,MAAM,EAAE,GAAG,EAAE,CAAC,gBAAgB;SAC9B,CAAE,CAAC;QACJ,cAAc,CAAE,QAAQ,EAAE;YACzB,MAAM,EAAE,GAAG,EAAE,CAAC,gBAAgB;SAC9B,CAAE,CAAC;QACJ,MAAM,CAAE,OAAO,CAAE,CAAC,YAAY,CAC7B,wCAAwC,CACxC,CAAC;IACH,CAAC,CAAE,CAAC;AACL,CAAC,CAAC,CAAA"}
|