@common-stack/client-react 0.5.9 → 0.5.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.
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { AbstractFeature, IModuleShape } from '@common-stack/client-core';
3
3
  import { IReactFeature, IReactModuleShape } from '../interfaces';
4
- declare type FeatureParam = IModuleShape & IReactModuleShape;
4
+ type FeatureParam = IModuleShape & IReactModuleShape;
5
5
  export declare abstract class BaseFeature extends AbstractFeature implements IReactFeature {
6
6
  componentFillPlugins: any;
7
7
  routerFactory: any;
@@ -2,8 +2,8 @@
2
2
  import { IReactFeature } from '../interfaces';
3
3
  import { BaseFeature } from './base-connector';
4
4
  export declare class Feature extends BaseFeature implements IReactFeature {
5
- protected renderRoutes: (routes: any, solidRoutes: any, extraProps?: {}, switchProps?: {}) => JSX.Element;
6
- protected renderRoutes2: (args: any) => JSX.Element;
5
+ protected renderRoutes: (routes: any, solidRoutes: any, extraProps?: {}, switchProps?: {}) => import("react").JSX.Element;
6
+ protected renderRoutes2: (args: any) => import("react").JSX.Element;
7
7
  protected getSortedRoutes: (path: string, routeData: import("../interfaces").IRouteData, authWrapper?: (ele: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, props: Record<string, any>) => void) => any;
8
8
  protected getSortedRoutes2: (path: string, routeData: import("../interfaces").IRouteData, authWrapper?: (ele: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, props: Record<string, any>) => void) => any;
9
9
  }
@@ -2,8 +2,8 @@
2
2
  import { IReactFeature } from '../interfaces';
3
3
  import { BaseFeature } from './base-connector';
4
4
  export declare class Feature extends BaseFeature implements IReactFeature {
5
- protected renderRoutes: (args: any) => JSX.Element;
6
- protected renderRoutes2: (arg1: any, arg2: any) => JSX.Element;
5
+ protected renderRoutes: (args: any) => import("react").JSX.Element;
6
+ protected renderRoutes2: (arg1: any, arg2: any) => import("react").JSX.Element;
7
7
  protected getSortedRoutes: (path: string, routeData: import("../interfaces").IRouteData, authWrapper?: (ele: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, props: Record<string, any>) => void) => any;
8
8
  protected getSortedRoutes2: (path: string, routeData: import("../interfaces").IRouteData, authWrapper?: (component: import("react").FC<{}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => any;
9
9
  }
@@ -8,7 +8,7 @@ export interface IPlugin {
8
8
  icon?: string | ComponentElement<any, any> | Function;
9
9
  render: React.FC<any>;
10
10
  }
11
- export declare type IReactFeature = IFeature & IReactModuleShape & {
11
+ export type IReactFeature = IFeature & IReactModuleShape & {
12
12
  readonly getRouter: any;
13
13
  /**
14
14
  * @returns client-side React route components list
@@ -29,7 +29,7 @@ export declare type IReactFeature = IFeature & IReactModuleShape & {
29
29
  */
30
30
  readonly authWrapper?: (ele: React.ReactElement, props: Record<string, any>) => void;
31
31
  };
32
- export declare type IReactModuleShape = {
32
+ export type IReactModuleShape = {
33
33
  /**
34
34
  * @param route Route list
35
35
  */
@@ -5,7 +5,7 @@ export declare const InversifyContext: React.Context<{
5
5
  container: interfaces.Container | null;
6
6
  modules: IFeature;
7
7
  }>;
8
- declare type Props = {
8
+ type Props = {
9
9
  container: interfaces.Container;
10
10
  modules: IFeature;
11
11
  children: React.ReactNode;
@@ -20,5 +20,5 @@ export declare class BasePluginArea extends React.Component<{}, {
20
20
  componentDidMount(): void;
21
21
  componentWillUnMount(): void;
22
22
  setPlugins(): void;
23
- render(): JSX.Element;
23
+ render(): React.JSX.Element;
24
24
  }
@@ -64,7 +64,13 @@ class BasePluginArea extends React.Component {
64
64
  this.setState(this.getCurrentPluginsState);
65
65
  }
66
66
  render() {
67
- return (React.createElement(React.Fragment, null, (0, lodash_1.map)(this.state.plugins, ({ context, Plugin }) => (React.createElement(plugin_context_1.PluginContextProvider, { key: context.name, value: context },
67
+ let { plugins } = this.state;
68
+ if (typeof window === 'undefined') {
69
+ // When server mode, setPlugins() will not be run, so should call manually.
70
+ const pluginsState = this.getCurrentPluginsState();
71
+ plugins = pluginsState.plugins;
72
+ }
73
+ return (React.createElement(React.Fragment, null, (0, lodash_1.map)(plugins, ({ context, Plugin }) => (React.createElement(plugin_context_1.PluginContextProvider, { key: context.name, value: context },
68
74
  React.createElement(Plugin, null))))));
69
75
  }
70
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"base-plugin-area.js","sourceRoot":"","sources":["../../src/plugin-area/base-plugin-area.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAA6B;AAC7B,6CAA+B;AAC/B,4CAA2D;AAC3D,qDAAyD;AACzD,6CAA0C;AAE1C;;GAEG;AAEH,MAAa,cAAe,SAAQ,KAAK,CAAC,SAAkD;IAE1F,YAAY,IAAI;QACd,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,CAAC;IAEM,sBAAsB;QAC3B,OAAO;YACL,OAAO,EAAE,IAAA,YAAG,EAAC,IAAA,uBAAU,GAAE,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;gBACpD,OAAO;oBACL,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE;wBACP,IAAI;wBACJ,IAAI;qBACL;iBACF,CAAC;YACJ,CAAC,CAAC;SACH,CAAC;IACJ,CAAC;IAEM,iBAAiB;QACtB,IAAA,iBAAS,EACP,0BAA0B,EAC1B,6CAA6C,EAC7C,IAAI,CAAC,UAAU,CAChB,CAAC;QACF,IAAA,iBAAS,EACP,4BAA4B,EAC5B,+CAA+C,EAC/C,IAAI,CAAC,UAAU,CAChB,CAAC;QACF,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAEM,oBAAoB;QACzB,IAAA,oBAAY,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;YACJ,CAAC,CAAC;SACH,CAAC;IACJ,CAAC;IAEM,iBAAiB;QACtB,IAAA,iBAAS,EACP,0BAA0B,EAC1B,6CAA6C,EAC7C,IAAI,CAAC,UAAU,CAChB,CAAC;QACF,IAAA,iBAAS,EACP,4BAA4B,EAC5B,+CAA+C,EAC/C,IAAI,CAAC,UAAU,CAChB,CAAC;QACF,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAEM,oBAAoB;QACzB,IAAA,oBAAY,EACV,0BAA0B,EAC1B,6CAA6C,CAC9C,CAAC;QACF,IAAA,oBAAY,EACV,4BAA4B,EAC5B,+CAA+C,CAChD,CAAC;IACJ,CAAC;IAEM,UAAU;QACf,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAC7C,CAAC;IAEM,MAAM;QACX,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,2EAA2E;YAC3E,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;YACnD,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC;SAChC;QACD,OAAO,CACL,0CACG,IAAA,YAAG,EAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACrC,oBAAC,sCAAqB,IACpB,GAAG,EAAE,OAAO,CAAC,IAAI,EACjB,KAAK,EAAE,OAAO;YAEd,oBAAC,MAAM,OAAG,CACY,CACzB,CAAC,CACD,CACJ,CAAC;IACJ,CAAC;CACF;AAvED,wCAuEC"}
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  export * from './plugin-api';
3
- export declare const PluginArea: () => JSX.Element;
3
+ export declare const PluginArea: () => React.JSX.Element;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  export * from './plugin-api';
3
- export declare const PluginArea: () => JSX.Element;
3
+ export declare const PluginArea: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const renderRoutes: (routes: any, solidRoutes: any, extraProps?: {}, switchProps?: {}) => JSX.Element;
1
+ import * as React from 'react';
2
+ export declare const renderRoutes: (routes: any, solidRoutes: any, extraProps?: {}, switchProps?: {}) => React.JSX.Element;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
- declare const resolveRootRoute: (rootRoute: any, rootRouteName: string) => JSX.Element;
1
+ import React from 'react';
2
+ declare const resolveRootRoute: (rootRoute: any, rootRouteName: string) => React.JSX.Element;
3
3
  export default resolveRootRoute;
@@ -8,8 +8,8 @@ interface Navigator<T extends (...args: any) => any> {
8
8
  name: string;
9
9
  })[];
10
10
  }
11
- export declare type TabNavigator = Navigator<typeof createBottomTabNavigator>;
12
- export declare type StackNavigationNavigator = Navigator<typeof createStackNavigator>;
11
+ export type TabNavigator = Navigator<typeof createBottomTabNavigator>;
12
+ export type StackNavigationNavigator = Navigator<typeof createStackNavigator>;
13
13
  interface StackNavigationScreen {
14
14
  props: Omit<ComponentProps<ReturnType<typeof createStackNavigator>['Screen']>, 'name'> & {
15
15
  component: any;
@@ -20,8 +20,8 @@ interface TabNavigationScreen {
20
20
  component: any;
21
21
  };
22
22
  }
23
- export declare type NavigatorItem = StackNavigationNavigator | StackNavigationScreen | TabNavigator | TabNavigationScreen;
24
- export declare type RootAppNavigators = {
23
+ export type NavigatorItem = StackNavigationNavigator | StackNavigationScreen | TabNavigator | TabNavigationScreen;
24
+ export type RootAppNavigators = {
25
25
  [routeName: string]: NavigatorItem;
26
26
  };
27
27
  export declare const isStackOrTab: (s: NavigatorItem) => s is Navigator<any>;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { IRouterRederOptions } from '../interfaces/new-router';
3
- declare function renderRoutes(opts: IRouterRederOptions): JSX.Element;
3
+ declare function renderRoutes(opts: IRouterRederOptions): React.JSX.Element;
4
4
  export { renderRoutes as renderRoutes2 };
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { IRouterRederOptions } from '../interfaces/new-router';
3
- declare function renderRoutes(opts: IRouterRederOptions): JSX.Element;
3
+ declare function renderRoutes(opts: IRouterRederOptions): React.JSX.Element;
4
4
  export { renderRoutes };
@@ -20,5 +20,5 @@ export declare class RouteBasedPluginArea extends React.Component<{}, {
20
20
  componentDidMount(): void;
21
21
  componentWillUnMount(): void;
22
22
  setPlugins(): void;
23
- render(): JSX.Element;
23
+ render(): React.JSX.Element;
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/client-react",
3
- "version": "0.5.9",
3
+ "version": "0.5.16",
4
4
  "description": "browser plugin for git",
5
5
  "homepage": "https://github.com/cdmbase/fullstack-pro#readme",
6
6
  "bugs": {
@@ -48,7 +48,7 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "31a6012ca134ef9efd247a07f545e50bbee41e90",
51
+ "gitHead": "85088275e6549961bccef799f9aa996bd44aa0ca",
52
52
  "typescript": {
53
53
  "definition": "lib/index.d.ts"
54
54
  }