@molecule/app-routing-react-router 1.1.3 → 1.2.2
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/README.md +208 -118
- package/dist/dom.d.ts +50 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +37 -0
- package/dist/dom.js.map +1 -0
- package/dist/hooks.d.ts +42 -9
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +110 -14
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +25 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -7
- package/dist/index.js.map +1 -1
- package/dist/lazyPage.d.ts +57 -0
- package/dist/lazyPage.d.ts.map +1 -0
- package/dist/lazyPage.js +62 -0
- package/dist/lazyPage.js.map +1 -0
- package/dist/routers.d.ts +102 -0
- package/dist/routers.d.ts.map +1 -0
- package/dist/routers.js +86 -0
- package/dist/routers.js.map +1 -0
- package/package.json +27 -2
package/dist/routers.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { BrowserRouter as ReactRouterBrowserRouter, HashRouter as ReactRouterHashRouter, MemoryRouter as ReactRouterMemoryRouter, Router as ReactRouter, RouterProvider as ReactRouterProvider, unstable_HistoryRouter as ReactRouterHistoryRouter, } from 'react-router';
|
|
3
|
+
/**
|
|
4
|
+
* Browser router that commits the URL and rendered page together.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { BrowserRouter } from '@molecule/app-routing-react-router'
|
|
9
|
+
*
|
|
10
|
+
* const app = <BrowserRouter><Routes /></BrowserRouter>
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export function BrowserRouter(props) {
|
|
14
|
+
return _jsx(ReactRouterBrowserRouter, { ...props, useTransitions: false });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Hash router that commits the URL and rendered page together.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* import { HashRouter } from '@molecule/app-routing-react-router'
|
|
22
|
+
*
|
|
23
|
+
* const app = <HashRouter><Routes /></HashRouter>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export function HashRouter(props) {
|
|
27
|
+
return _jsx(ReactRouterHashRouter, { ...props, useTransitions: false });
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* In-memory router that commits its location and rendered page together.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* import { MemoryRouter } from '@molecule/app-routing-react-router'
|
|
35
|
+
*
|
|
36
|
+
* const app = <MemoryRouter initialEntries={['/']}><Routes /></MemoryRouter>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export function MemoryRouter(props) {
|
|
40
|
+
return _jsx(ReactRouterMemoryRouter, { ...props, useTransitions: false });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Low-level router that commits its location and rendered page together.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* import { Router } from '@molecule/app-routing-react-router'
|
|
48
|
+
*
|
|
49
|
+
* const app = <Router location={location} navigator={navigator}><Routes /></Router>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export function Router(props) {
|
|
53
|
+
return _jsx(ReactRouter, { ...props, useTransitions: false });
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Data-router provider that commits the URL and rendered page together.
|
|
57
|
+
*
|
|
58
|
+
* This is React Router's renderer-neutral provider. In a DOM app, import
|
|
59
|
+
* `RouterProvider` from `@molecule/app-routing-react-router/dom` instead, which
|
|
60
|
+
* supplies `react-dom`'s `flushSync` the way `react-router/dom` does.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```tsx
|
|
64
|
+
* import { RouterProvider } from '@molecule/app-routing-react-router'
|
|
65
|
+
*
|
|
66
|
+
* const app = <RouterProvider router={router} flushSync={flushSync} />
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export function RouterProvider(props) {
|
|
70
|
+
return _jsx(ReactRouterProvider, { ...props, useTransitions: false });
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* History router that commits the URL and rendered page together.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```tsx
|
|
77
|
+
* import { unstable_HistoryRouter } from '@molecule/app-routing-react-router'
|
|
78
|
+
*
|
|
79
|
+
* const app = <unstable_HistoryRouter history={history}><Routes /></unstable_HistoryRouter>
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
function HistoryRouter(props) {
|
|
83
|
+
return _jsx(ReactRouterHistoryRouter, { ...props, useTransitions: false });
|
|
84
|
+
}
|
|
85
|
+
export { HistoryRouter as unstable_HistoryRouter };
|
|
86
|
+
//# sourceMappingURL=routers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routers.js","sourceRoot":"","sources":["../src/routers.tsx"],"names":[],"mappings":";AAeA,OAAO,EACL,aAAa,IAAI,wBAAwB,EAEzC,UAAU,IAAI,qBAAqB,EAGnC,YAAY,IAAI,uBAAuB,EAEvC,MAAM,IAAI,WAAW,EAErB,cAAc,IAAI,mBAAmB,EAErC,sBAAsB,IAAI,wBAAwB,GACnD,MAAM,cAAc,CAAA;AAyBrB;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,OAAO,KAAC,wBAAwB,OAAK,KAAK,EAAE,cAAc,EAAE,KAAK,GAAI,CAAA;AACvE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,OAAO,KAAC,qBAAqB,OAAK,KAAK,EAAE,cAAc,EAAE,KAAK,GAAI,CAAA;AACpE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,OAAO,KAAC,uBAAuB,OAAK,KAAK,EAAE,cAAc,EAAE,KAAK,GAAI,CAAA;AACtE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,OAAO,KAAC,WAAW,OAAK,KAAK,EAAE,cAAc,EAAE,KAAK,GAAI,CAAA;AAC1D,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,OAAO,KAAC,mBAAmB,OAAK,KAAK,EAAE,cAAc,EAAE,KAAK,GAAI,CAAA;AAClE,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,aAAa,CAAC,KAAyB;IAC9C,OAAO,KAAC,wBAAwB,OAAK,KAAK,EAAE,cAAc,EAAE,KAAK,GAAI,CAAA;AACvE,CAAC;AAED,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-routing-react-router",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "React Router v7 provider for @molecule/app-routing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./dom": {
|
|
15
|
+
"types": "./dist/dom.d.ts",
|
|
16
|
+
"import": "./dist/dom.js",
|
|
17
|
+
"default": "./dist/dom.js"
|
|
18
|
+
},
|
|
19
|
+
"./dist": "./dist/index.js",
|
|
20
|
+
"./dist/*.d.ts.map": "./dist/*.d.ts.map",
|
|
21
|
+
"./dist/*.d.ts": "./dist/*.d.ts",
|
|
22
|
+
"./dist/*.js": "./dist/*.js",
|
|
23
|
+
"./dist/*": "./dist/*.js",
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
8
26
|
"files": [
|
|
9
27
|
"dist",
|
|
10
28
|
"README.md"
|
|
@@ -25,13 +43,20 @@
|
|
|
25
43
|
"@molecule/app-i18n": "^1.0.1",
|
|
26
44
|
"@molecule/app-routing": "^1.0.1",
|
|
27
45
|
"react": "^18.0.0 || ^19.0.0",
|
|
46
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
28
47
|
"react-router": "^7.0.0 || ^8.0.0"
|
|
29
48
|
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"react-dom": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
30
54
|
"devDependencies": {
|
|
31
|
-
"@molecule/app-i18n": "1.1.
|
|
55
|
+
"@molecule/app-i18n": "1.1.2",
|
|
32
56
|
"@types/node": "26.6.5",
|
|
33
57
|
"@types/react": "19.3.0",
|
|
34
58
|
"react": "19.3.1",
|
|
59
|
+
"react-dom": "19.3.1",
|
|
35
60
|
"react-router": "8.5.0",
|
|
36
61
|
"typescript": "6.0.3",
|
|
37
62
|
"vitest": "4.1.12"
|