@teambit/react-router 0.0.554 → 0.0.555
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/dist/react-router-routing/react-router-routing.d.ts +3 -0
- package/dist/react-router.ui.runtime.d.ts +33 -1
- package/dist/route-context.d.ts +3 -0
- package/package-tar/teambit-react-router-0.0.555.tgz +0 -0
- package/package.json +10 -10
- package/tsconfig.json +0 -1
- package/package-tar/teambit-react-router-0.0.554.tgz +0 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { useLocation } from 'react-router-dom';
|
|
2
2
|
import { Link } from '@teambit/ui-foundation.ui.react-router.link';
|
|
3
3
|
import { NavLink } from '@teambit/ui-foundation.ui.react-router.nav-link';
|
|
4
|
+
/**
|
|
5
|
+
* defines react-router's routing components (link, useLocation, etc)
|
|
6
|
+
*/
|
|
4
7
|
export declare const reactRouterRouting: {
|
|
5
8
|
Link: typeof Link;
|
|
6
9
|
NavLink: typeof NavLink;
|
|
@@ -8,18 +8,50 @@ declare type RenderRoutesOptions = {
|
|
|
8
8
|
initialLocation?: string;
|
|
9
9
|
};
|
|
10
10
|
export declare class ReactRouterUI {
|
|
11
|
+
/**
|
|
12
|
+
* route slot.
|
|
13
|
+
*/
|
|
11
14
|
private routeSlot;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
12
18
|
private routeChangeListener;
|
|
13
19
|
private routerHistory?;
|
|
14
20
|
private routingMode;
|
|
15
|
-
constructor(
|
|
21
|
+
constructor(
|
|
22
|
+
/**
|
|
23
|
+
* route slot.
|
|
24
|
+
*/
|
|
25
|
+
routeSlot: RouteSlot,
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
routeChangeListener: RouteChangeSlot);
|
|
30
|
+
/**
|
|
31
|
+
* render all slot routes.
|
|
32
|
+
*/
|
|
16
33
|
renderRoutes(routes: RouteProps[], options?: RenderRoutesOptions): JSX.Element;
|
|
17
34
|
private unregisterListener?;
|
|
35
|
+
/** (internal method) sets the routing engine for navigation methods */
|
|
18
36
|
setRouter: (routerHistory: History) => void;
|
|
37
|
+
/** decides how navigation is stored and applied.
|
|
38
|
+
* Url - updates the `window.location.pathname`.
|
|
39
|
+
* Hash - updates `window.location.hash`.
|
|
40
|
+
* InMemory - store state internally and don't update the browser.
|
|
41
|
+
*/
|
|
19
42
|
setRoutingMode(routing: Routing): void;
|
|
43
|
+
/**
|
|
44
|
+
* register a new route.
|
|
45
|
+
*/
|
|
20
46
|
register(route: RouteProps): this;
|
|
21
47
|
registerListener(listener: LocationListener): void;
|
|
48
|
+
/**
|
|
49
|
+
* change browser location
|
|
50
|
+
*/
|
|
22
51
|
navigateTo: (path: LocationDescriptor, action?: Record<string, any> | Action | undefined) => void;
|
|
52
|
+
/**
|
|
53
|
+
* change browser location
|
|
54
|
+
*/
|
|
23
55
|
private legacyNavigateTo;
|
|
24
56
|
static slots: (((registerFn: () => string) => SlotRegistry<RouteProps<string, {
|
|
25
57
|
[x: string]: string | undefined;
|
package/dist/route-context.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ declare type RootRouteProps = {
|
|
|
14
14
|
rootRoutes: RouteProps[];
|
|
15
15
|
routeSlot: RouteSlot;
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Setup context needed for routing.
|
|
19
|
+
*/
|
|
17
20
|
export declare function RouteContext({ reactRouterUi, routing, children, location }: RouterContextProps): JSX.Element;
|
|
18
21
|
export declare function RootRoute({ rootRoutes, routeSlot }: RootRouteProps): JSX.Element;
|
|
19
22
|
export {};
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/react-router",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.555",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/ui-foundation/react-router",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.ui-foundation",
|
|
8
8
|
"name": "react-router",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.555"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.2.11",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"@teambit/base-ui.routing.link": "1.0.0",
|
|
18
18
|
"@teambit/base-ui.routing.nav-link": "1.0.0",
|
|
19
19
|
"@teambit/base-ui.routing.routing-provider": "1.0.0",
|
|
20
|
-
"@teambit/ui-foundation.ui.react-router.link-anchor": "0.0.
|
|
21
|
-
"@teambit/ui-foundation.ui.is-browser": "0.0.
|
|
22
|
-
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.
|
|
23
|
-
"@teambit/ui": "0.0.
|
|
24
|
-
"@teambit/ui-foundation.ui.react-router.link": "0.0.
|
|
25
|
-
"@teambit/ui-foundation.ui.react-router.nav-link": "0.0.
|
|
20
|
+
"@teambit/ui-foundation.ui.react-router.link-anchor": "0.0.100",
|
|
21
|
+
"@teambit/ui-foundation.ui.is-browser": "0.0.463",
|
|
22
|
+
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.465",
|
|
23
|
+
"@teambit/ui": "0.0.555",
|
|
24
|
+
"@teambit/ui-foundation.ui.react-router.link": "0.0.465",
|
|
25
|
+
"@teambit/ui-foundation.ui.react-router.nav-link": "0.0.465"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/history": "4.7.8",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@types/node": "12.20.4"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@teambit/legacy": "1.0.
|
|
38
|
+
"@teambit/legacy": "1.0.172",
|
|
39
39
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
40
40
|
"react": "^16.8.0 || ^17.0.0"
|
|
41
41
|
},
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react": "-"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@teambit/legacy": "1.0.
|
|
66
|
+
"@teambit/legacy": "1.0.172",
|
|
67
67
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
68
68
|
"react": "^16.8.0 || ^17.0.0"
|
|
69
69
|
}
|
package/tsconfig.json
CHANGED
|
Binary file
|