@common-stack/client-react 0.6.1-alpha.4 → 1.0.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/lib/__tests__/fill-register-test.js +16 -41
  2. package/lib/__tests__/fill-register-test.js.map +1 -1
  3. package/lib/__tests__/helpers/sample-menu.js +1 -4
  4. package/lib/__tests__/helpers/sample-menu.js.map +1 -1
  5. package/lib/__tests__/integrated-routes.test.js +17 -44
  6. package/lib/__tests__/integrated-routes.test.js.map +1 -1
  7. package/lib/__tests__/router-render.test.js +14 -57
  8. package/lib/__tests__/router-render.test.js.map +1 -1
  9. package/lib/connector/base-connector.d.ts +53 -0
  10. package/lib/connector/base-connector.js +129 -0
  11. package/lib/connector/base-connector.js.map +1 -0
  12. package/lib/connector/connector.d.ts +9 -0
  13. package/lib/connector/connector.js +14 -0
  14. package/lib/connector/connector.js.map +1 -0
  15. package/lib/connector/connector.native.d.ts +9 -0
  16. package/lib/connector/connector.native.js +15 -0
  17. package/lib/connector/connector.native.js.map +1 -0
  18. package/lib/connector/connector.test.js +11 -0
  19. package/lib/connector/connector.test.js.map +1 -0
  20. package/lib/connector/index.d.ts +1 -0
  21. package/lib/connector/index.js +2 -0
  22. package/lib/connector/index.js.map +1 -0
  23. package/lib/index.d.ts +1 -2
  24. package/lib/index.js +10 -29
  25. package/lib/index.js.map +1 -1
  26. package/lib/index.native.d.ts +1 -1
  27. package/lib/index.native.js +10 -28
  28. package/lib/index.native.js.map +1 -1
  29. package/lib/interfaces/extended-feature.d.ts +50 -0
  30. package/lib/interfaces/extended-feature.js +1 -56
  31. package/lib/interfaces/extended-feature.js.map +1 -1
  32. package/lib/interfaces/feature.d.ts +13 -0
  33. package/lib/interfaces/feature.js +2 -0
  34. package/lib/interfaces/feature.js.map +1 -0
  35. package/lib/interfaces/index.d.ts +2 -0
  36. package/lib/interfaces/index.js +5 -20
  37. package/lib/interfaces/index.js.map +1 -1
  38. package/lib/interfaces/menu.js +2 -5
  39. package/lib/interfaces/menu.js.map +1 -1
  40. package/lib/interfaces/new-router.js +1 -2
  41. package/lib/interfaces/router.js +1 -2
  42. package/lib/inversify/InversifyContext.d.ts +3 -3
  43. package/lib/inversify/InversifyContext.js +6 -34
  44. package/lib/inversify/InversifyContext.js.map +1 -1
  45. package/lib/inversify/index.js +1 -17
  46. package/lib/inversify/index.js.map +1 -1
  47. package/lib/plugin-area/__tests__/higher-order-component-util.test.js +13 -38
  48. package/lib/plugin-area/__tests__/higher-order-component-util.test.js.map +1 -1
  49. package/lib/plugin-area/__tests__/plugin-api.test.js +11 -13
  50. package/lib/plugin-area/__tests__/plugin-api.test.js.map +1 -1
  51. package/lib/plugin-area/base-plugin-area.js +18 -39
  52. package/lib/plugin-area/base-plugin-area.js.map +1 -1
  53. package/lib/plugin-area/higher-order-component-util.js +3 -7
  54. package/lib/plugin-area/higher-order-component-util.js.map +1 -1
  55. package/lib/plugin-area/index.js +5 -35
  56. package/lib/plugin-area/index.js.map +1 -1
  57. package/lib/plugin-area/index.native.js +7 -37
  58. package/lib/plugin-area/index.native.js.map +1 -1
  59. package/lib/plugin-area/plugin-api.js +15 -18
  60. package/lib/plugin-area/plugin-api.js.map +1 -1
  61. package/lib/plugin-area/plugin-context.js +5 -32
  62. package/lib/plugin-area/plugin-context.js.map +1 -1
  63. package/lib/route/__tests__/admin-new-routes.test.js +11 -45
  64. package/lib/route/__tests__/admin-new-routes.test.js.map +1 -1
  65. package/lib/route/__tests__/getFlatMenus.test.js +5 -7
  66. package/lib/route/__tests__/getFlatMenus.test.js.map +1 -1
  67. package/lib/route/__tests__/render-routes-config.test.js +6 -18
  68. package/lib/route/__tests__/render-routes-config.test.js.map +1 -1
  69. package/lib/route/__tests__/route-type.test.js +1 -2
  70. package/lib/route/__tests__/route-type.test.js.map +1 -1
  71. package/lib/route/get-routes.js +22 -29
  72. package/lib/route/get-routes.js.map +1 -1
  73. package/lib/route/get-routes.test.js +6 -17
  74. package/lib/route/get-routes.test.js.map +1 -1
  75. package/lib/route/index.js +2 -18
  76. package/lib/route/index.js.map +1 -1
  77. package/lib/route/index.native.js +1 -17
  78. package/lib/route/index.native.js.map +1 -1
  79. package/lib/route/old/__tests__/config-sidebar-menu.test.d.ts +1 -0
  80. package/lib/route/old/__tests__/config-sidebar-menu.test.js +199 -198
  81. package/lib/route/old/__tests__/config-sidebar-menu.test.js.map +1 -1
  82. package/lib/route/old/get-menus.js +14 -21
  83. package/lib/route/old/get-menus.js.map +1 -1
  84. package/lib/route/old/get-routes-notused.js +14 -12
  85. package/lib/route/old/get-routes-notused.js.map +1 -1
  86. package/lib/route/old/render.js +4 -31
  87. package/lib/route/old/render.js.map +1 -1
  88. package/lib/route/react-navigation/get-navigation-utils.js +35 -40
  89. package/lib/route/react-navigation/get-navigation-utils.js.map +1 -1
  90. package/lib/route/react-navigation/get-navigation-utils.test.js +19 -21
  91. package/lib/route/react-navigation/get-navigation-utils.test.js.map +1 -1
  92. package/lib/route/react-navigation/index.js +2 -18
  93. package/lib/route/react-navigation/index.js.map +1 -1
  94. package/lib/route/react-navigation/react-native.sample.test.js +8 -22
  95. package/lib/route/react-navigation/react-native.sample.test.js.map +1 -1
  96. package/lib/route/react-navigation/react-native.sample1.test.js +14 -48
  97. package/lib/route/react-navigation/react-native.sample1.test.js.map +1 -1
  98. package/lib/route/react-navigation/react-navigation-render.js +16 -31
  99. package/lib/route/react-navigation/react-navigation-render.js.map +1 -1
  100. package/lib/route/react-navigation/react-navigation-render.test.js +23 -37
  101. package/lib/route/react-navigation/react-navigation-render.test.js.map +1 -1
  102. package/lib/route/react-navigation/root-navigation.js +5 -9
  103. package/lib/route/react-navigation/root-navigation.js.map +1 -1
  104. package/lib/route/react-navigation/routes.js +1 -2
  105. package/lib/route/react-navigation/types.js +1 -5
  106. package/lib/route/react-navigation/types.js.map +1 -1
  107. package/lib/route/render-routes.js +33 -66
  108. package/lib/route/render-routes.js.map +1 -1
  109. package/lib/route/render-routes.native.js +33 -66
  110. package/lib/route/render-routes.native.js.map +1 -1
  111. package/lib/route/render-routes.test.js +112 -126
  112. package/lib/route/render-routes.test.js.map +1 -1
  113. package/lib/route/root-navigation.js +3 -7
  114. package/lib/route/root-navigation.js.map +1 -1
  115. package/lib/route-based-plugin-area/__tests__/higher-order-component-util.test.js +13 -38
  116. package/lib/route-based-plugin-area/__tests__/higher-order-component-util.test.js.map +1 -1
  117. package/lib/route-based-plugin-area/__tests__/plugin-api.test.js +11 -13
  118. package/lib/route-based-plugin-area/__tests__/plugin-api.test.js.map +1 -1
  119. package/lib/route-based-plugin-area/higher-order-component-util.js +3 -7
  120. package/lib/route-based-plugin-area/higher-order-component-util.js.map +1 -1
  121. package/lib/route-based-plugin-area/index.js +2 -18
  122. package/lib/route-based-plugin-area/index.js.map +1 -1
  123. package/lib/route-based-plugin-area/plugin-api.js +15 -18
  124. package/lib/route-based-plugin-area/plugin-api.js.map +1 -1
  125. package/lib/route-based-plugin-area/plugin-context.js +5 -32
  126. package/lib/route-based-plugin-area/plugin-context.js.map +1 -1
  127. package/lib/route-based-plugin-area/route-based-plugin-area.js +12 -39
  128. package/lib/route-based-plugin-area/route-based-plugin-area.js.map +1 -1
  129. package/lib/router-factory/index.d.ts +1 -1
  130. package/lib/router-factory/index.js +6 -32
  131. package/lib/router-factory/index.js.map +1 -1
  132. package/lib/router-factory/index.native.d.ts +1 -1
  133. package/lib/router-factory/index.native.js +6 -32
  134. package/lib/router-factory/index.native.js.map +1 -1
  135. package/lib/utils/before-ssr.d.ts +5 -0
  136. package/lib/utils/before-ssr.js +9 -0
  137. package/lib/utils/before-ssr.js.map +1 -0
  138. package/lib/utils/combine.d.ts +1 -0
  139. package/lib/utils/combine.js +3 -0
  140. package/lib/utils/combine.js.map +1 -0
  141. package/lib/utils/hydrate.d.ts +4 -0
  142. package/lib/utils/hydrate.js +14 -0
  143. package/lib/utils/hydrate.js.map +1 -0
  144. package/lib/utils/index.d.ts +3 -0
  145. package/lib/utils/index.js +5 -18
  146. package/lib/utils/index.js.map +1 -1
  147. package/lib/utils/sort-keys.js +3 -10
  148. package/lib/utils/sort-keys.js.map +1 -1
  149. package/lib/utils/sort-keys.test.js +2 -4
  150. package/lib/utils/sort-keys.test.js.map +1 -1
  151. package/lib/utils/utils.js +1 -5
  152. package/lib/utils/utils.js.map +1 -1
  153. package/package.json +6 -5
  154. package/lib/application/__tests__/react-client.test.d.ts +0 -1
  155. package/lib/application/__tests__/react-client.test.js +0 -23
  156. package/lib/application/__tests__/react-client.test.js.map +0 -1
  157. package/lib/application/base-apollo-client.d.ts +0 -21
  158. package/lib/application/base-apollo-client.js +0 -161
  159. package/lib/application/base-apollo-client.js.map +0 -1
  160. package/lib/application/base-redux-config.d.ts +0 -22
  161. package/lib/application/base-redux-config.js +0 -58
  162. package/lib/application/base-redux-config.js.map +0 -1
  163. package/lib/application/config.d.ts +0 -4
  164. package/lib/application/config.js +0 -38
  165. package/lib/application/config.js.map +0 -1
  166. package/lib/application/react-client.d.ts +0 -7
  167. package/lib/application/react-client.js +0 -152
  168. package/lib/application/react-client.js.map +0 -1
  169. package/lib/connector/base-react-client-feature.d.ts +0 -31
  170. package/lib/connector/base-react-client-feature.js +0 -102
  171. package/lib/connector/base-react-client-feature.js.map +0 -1
  172. package/lib/connector/monaco-connector.d.ts +0 -19
  173. package/lib/connector/monaco-connector.js +0 -76
  174. package/lib/connector/monaco-connector.js.map +0 -1
  175. package/lib/connector/react-client-feature.d.ts +0 -7
  176. package/lib/connector/react-client-feature.js +0 -15
  177. package/lib/connector/react-client-feature.js.map +0 -1
  178. package/lib/connector/react-client-feature.native.d.ts +0 -7
  179. package/lib/connector/react-client-feature.native.js +0 -18
  180. package/lib/connector/react-client-feature.native.js.map +0 -1
  181. package/lib/connector/react-client-feature.test.js +0 -10
  182. package/lib/connector/react-client-feature.test.js.map +0 -1
  183. package/lib/interfaces/monaco-feature.d.ts +0 -46
  184. package/lib/interfaces/monaco-feature.js +0 -3
  185. package/lib/interfaces/monaco-feature.js.map +0 -1
  186. package/lib/interfaces/react-client-feature.d.ts +0 -77
  187. package/lib/interfaces/react-client-feature.js +0 -3
  188. package/lib/interfaces/react-client-feature.js.map +0 -1
  189. /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
- "use strict";
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
- 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":";;;;;;;;;;;;;;;;;AAAA,yDAAwD;AAA/C,0GAAA,WAAW,OAAA;AACpB,mEAAiD;AACjD,+DAA6C;AAC7C,mDAAiC;AACjC,0CAAwB;AACxB,0DAAwC;AACxC,0CAAwB;AACxB,+CAA6B;AAC7B,gDAA8B;AAC9B,4DAA0C;AAC1C,8CAA4B"}
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"}
@@ -1,5 +1,5 @@
1
1
  export { ClientTypes } from '@common-stack/client-core';
2
- export * from './connector/react-client-feature.native';
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';
@@ -1,29 +1,11 @@
1
- "use strict";
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
- 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
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAwD;AAA/C,0GAAA,WAAW,OAAA;AACpB,0EAAwD;AACxD,gEAA8C;AAC9C,uDAAqC;AACrC,2EAAyD;AACzD,0CAAwB;AACxB,+CAA6B;AAC7B,6DAA2C;AAC3C,4DAA0C;AAC1C,8CAA4B"}
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
- // 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;
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":"AAAA,kCAAkC;AAClC,wDAAwD;AACxD,sDAAsD;AACtD,sCAAsC;AACtC,4CAA4C;AAE5C,6BAA6B;AAC7B,oBAAoB;AACpB,6DAA6D;AAC7D,6BAA6B;AAC7B,IAAI;AAEJ,+DAA+D;AAE/D,0BAA0B;AAC1B,UAAU;AACV,0DAA0D;AAC1D,UAAU;AACV,0BAA0B;AAC1B,oCAAoC;AAEpC,yBAAyB;AACzB,mCAAmC;AAEnC,wCAAwC;AACxC,wCAAwC;AAExC,oCAAoC;AACpC,uCAAuC;AACvC,UAAU;AACV,qDAAqD;AACrD,UAAU;AACV,4CAA4C;AAE5C,UAAU;AACV,mDAAmD;AACnD,UAAU;AACV,+BAA+B;AAC/B,mCAAmC;AACnC,8CAA8C;AAC9C,KAAK;AAEL,oCAAoC;AACpC,UAAU;AACV,iCAAiC;AACjC,UAAU;AACV,4BAA4B;AAC5B,UAAU;AACV,sEAAsE;AACtE,UAAU;AACV,wDAAwD;AAExD,UAAU;AACV,yDAAyD;AACzD,UAAU;AACV,qDAAqD;AACrD,oCAAoC;AACpC,iDAAiD;AAEjD,UAAU;AACV,mDAAmD;AACnD,UAAU;AACV,+BAA+B;AAC/B,mCAAmC;AACnC,8CAA8C;AAE9C,KAAK"}
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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature.js","sourceRoot":"","sources":["../../src/interfaces/feature.ts"],"names":[],"mappings":""}
@@ -1,3 +1,5 @@
1
1
  export * from './router';
2
+ export * from './extended-feature';
2
3
  export * from './menu';
3
4
  export * from './new-router';
5
+ export * from './feature';
@@ -1,21 +1,6 @@
1
- "use strict";
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("./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":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,sCAAsC;AACtC,yCAAuB;AACvB,+CAA6B"}
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"}
@@ -1,7 +1,4 @@
1
- "use strict";
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 = exports.IMenuPosition || (exports.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":";;;AAsGA,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,GAAb,qBAAa,KAAb,qBAAa,QAWxB"}
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"}
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=new-router.js.map
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=router.js.map
@@ -1,13 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { interfaces } from 'inversify';
3
- import { IBaseClientFeature } from '@common-stack/client-core';
3
+ import { IFeature } from '@common-stack/client-core';
4
4
  export declare const InversifyContext: React.Context<{
5
5
  container: interfaces.Container | null;
6
- modules: IBaseClientFeature;
6
+ modules: IFeature;
7
7
  }>;
8
8
  type Props = {
9
9
  container: interfaces.Container;
10
- modules: IBaseClientFeature;
10
+ modules: IFeature;
11
11
  children: React.ReactNode;
12
12
  };
13
13
  export declare const InversifyProvider: React.FC<Props>;
@@ -1,41 +1,13 @@
1
- "use strict";
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 __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
- exports.InversifyProvider = InversifyProvider;
33
- function useInjection(identifier) {
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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAIlB,QAAA,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAyE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AASzJ,MAAM,iBAAiB,GAAoB,CAAC,KAAK,EAAE,EAAE;IACxD,OAAO,CACH,oBAAC,wBAAgB,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;AANW,QAAA,iBAAiB,qBAM5B;AAEF,SAAgB,YAAY,CAAI,UAA2C;IACvE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,wBAAgB,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;AAND,oCAMC"}
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"}
@@ -1,18 +1,2 @@
1
- "use strict";
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":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inversify/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -1,63 +1,38 @@
1
- "use strict";
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 __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 = (0, higher_order_component_util_1.createHigherOrderComponent)((OriginalComponent) => OriginalComponent, 'withTest')(() => react_1.default.createElement("div", null));
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 = (0, higher_order_component_util_1.createHigherOrderComponent)((OriginalComponent) => OriginalComponent, 'with-one-two_threeFOUR')(() => react_1.default.createElement("div", null));
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 react_1.default.createElement("div", null);
14
+ return React.createElement("div", null);
40
15
  }
41
- const TestComponent = (0, higher_order_component_util_1.createHigherOrderComponent)((OriginalComponent) => OriginalComponent, 'withTest')(SomeComponent);
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 react_1.Component {
20
+ class SomeAnotherComponent extends Component {
46
21
  render() {
47
- return react_1.default.createElement("div", null);
22
+ return React.createElement("div", null);
48
23
  }
49
24
  }
50
- const TestComponent = (0, higher_order_component_util_1.createHigherOrderComponent)((OriginalComponent) => OriginalComponent, 'withTest')(SomeAnotherComponent);
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 react_1.Component {
29
+ class SomeYetAnotherComponent extends Component {
55
30
  render() {
56
- return react_1.default.createElement("div", null);
31
+ return React.createElement("div", null);
57
32
  }
58
33
  }
59
34
  SomeYetAnotherComponent.displayName = 'CustomDisplayName';
60
- const TestComponent = (0, higher_order_component_util_1.createHigherOrderComponent)((OriginalComponent) => OriginalComponent, 'withTest')(SomeYetAnotherComponent);
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":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AAGzC,gFAA4E;AAE5E,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACtD,MAAM,aAAa,GAAG,IAAA,wDAA0B,EAC5C,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,EACxC,UAAU,CACb,CAAE,GAAG,EAAE,CAAC,0CAAO,CAAE,CAAC;QAEnB,MAAM,CAAE,aAAa,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAE,+DAA+D,EAAE,GAAG,EAAE;QAC5E,MAAM,aAAa,GAAG,IAAA,wDAA0B,EAC/C,CAAE,iBAAiB,EAAG,EAAE,CAAC,iBAAiB,EAC1C,wBAAwB,CACxB,CAAE,GAAG,EAAE,CAAC,0CAAO,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,0CAAO,CAAC;QAChB,CAAC;QACD,MAAM,aAAa,GAAG,IAAA,wDAA0B,EAC/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,iBAAS;YAC3C,MAAM;gBACL,OAAO,0CAAO,CAAC;YAChB,CAAC;SACD;QACD,MAAM,aAAa,GAAG,IAAA,wDAA0B,EAC/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,iBAAS;YAC9C,MAAM;gBACL,OAAO,0CAAO,CAAC;YAChB,CAAC;SACD;QACA,uBAA+B,CAAC,WAAW,GAAG,mBAAmB,CAAC;QACnE,MAAM,aAAa,GAAG,IAAA,wDAA0B,EAC/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
+ {"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,EA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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
- "use strict";
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
- (0, plugin_api_1.getPlugins)().forEach((plugin) => {
7
- (0, plugin_api_1.unregisterPlugin)(plugin.name);
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
- (0, plugin_api_1.registerPlugin)(name, {
12
+ registerPlugin(name, {
15
13
  render: Component,
16
14
  icon,
17
15
  });
18
- expect((0, plugin_api_1.getPlugin)(name)).toEqual({
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
- plugin_api_1.registerPlugin();
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
- (0, plugin_api_1.registerPlugin)('plugin/with/special/characters', {
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
- (0, plugin_api_1.registerPlugin)({}, {
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
- (0, plugin_api_1.registerPlugin)('another-plugin', {});
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
- (0, plugin_api_1.registerPlugin)('plugin', {
43
+ registerPlugin('plugin', {
46
44
  render: () => 'plugin content',
47
45
  });
48
- (0, plugin_api_1.registerPlugin)('plugin', {
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":";;AAAA,8CAAuF;AAGvF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,SAAS,CAAC,GAAG,EAAE;QACX,IAAA,uBAAU,GAAE,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC5B,IAAA,6BAAgB,EAAC,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,IAAA,2BAAc,EAAC,IAAI,EAAE;YACjB,MAAM,EAAE,SAAS;YACjB,IAAI;SACP,CAAC,CAAC;Q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