@common-stack/client-react 0.5.6 → 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.
- package/lib/connector/base-connector.d.ts +1 -1
- package/lib/connector/connector.d.ts +2 -2
- package/lib/connector/connector.native.d.ts +2 -2
- package/lib/interfaces/extended-feature.d.ts +2 -2
- package/lib/inversify/InversifyContext.d.ts +1 -1
- package/lib/plugin-area/base-plugin-area.d.ts +1 -1
- package/lib/plugin-area/base-plugin-area.js +7 -1
- package/lib/plugin-area/base-plugin-area.js.map +1 -1
- package/lib/plugin-area/index.d.ts +2 -2
- package/lib/plugin-area/index.native.d.ts +2 -2
- package/lib/route/old/render.d.ts +2 -2
- package/lib/route/react-navigation/react-navigation-render.d.ts +2 -2
- package/lib/route/react-navigation/types.d.ts +4 -4
- package/lib/route/render-routes.d.ts +2 -2
- package/lib/route/render-routes.native.d.ts +2 -2
- package/lib/route-based-plugin-area/route-based-plugin-area.d.ts +1 -1
- package/package.json +4 -4
|
@@ -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
|
-
|
|
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
|
|
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
|
|
32
|
+
export type IReactModuleShape = {
|
|
33
33
|
/**
|
|
34
34
|
* @param route Route list
|
|
35
35
|
*/
|
|
@@ -64,7 +64,13 @@ class BasePluginArea extends React.Component {
|
|
|
64
64
|
this.setState(this.getCurrentPluginsState);
|
|
65
65
|
}
|
|
66
66
|
render() {
|
|
67
|
-
|
|
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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|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
12
|
-
export
|
|
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
|
|
24
|
-
export
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/client-react",
|
|
3
|
-
"version": "0.5.
|
|
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": {
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"watch": "npm run build:lib:watch"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@common-stack/client-core": "0.5.
|
|
32
|
-
"@common-stack/core": "0.5.
|
|
31
|
+
"@common-stack/client-core": "0.5.9",
|
|
32
|
+
"@common-stack/core": "0.5.9",
|
|
33
33
|
"@wordpress/hooks": "^2.10.0",
|
|
34
34
|
"browser-bunyan": "^1.6.3",
|
|
35
35
|
"history-with-query": "^4.10.4",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "85088275e6549961bccef799f9aa996bd44aa0ca",
|
|
52
52
|
"typescript": {
|
|
53
53
|
"definition": "lib/index.d.ts"
|
|
54
54
|
}
|