@rspress/runtime 2.0.0-beta.0 → 2.0.0-beta.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.
- package/dist/Content.js +1 -2
- package/dist/index.d.ts +1 -1
- package/dist/route.js +1 -2
- package/dist/utils.js +1 -2
- package/package.json +6 -5
- package/server.d.ts +1 -0
- package/server.js +1 -0
package/dist/Content.js
CHANGED
@@ -5,9 +5,8 @@ import * as __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__ from "virtual
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE__hooks_js_5a9aefb7__ from "./hooks.js";
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE__route_js_d0361f8a__ from "./route.js";
|
7
7
|
function TransitionContentImpl(props) {
|
8
|
-
var _siteData_themeConfig;
|
9
8
|
let element = props.el;
|
10
|
-
if (
|
9
|
+
if (__WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"]?.themeConfig?.enableContentAnimation) element = (0, __WEBPACK_EXTERNAL_MODULE__hooks_js_5a9aefb7__.useViewTransition)(props.el);
|
11
10
|
return element;
|
12
11
|
}
|
13
12
|
const TransitionContent = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.memo)(TransitionContentImpl, (prevProps, nextProps)=>prevProps.el === nextProps.el);
|
package/dist/index.d.ts
CHANGED
@@ -3,6 +3,6 @@ export { Content } from './Content';
|
|
3
3
|
export { normalizeHrefInRuntime, normalizeImagePath, withBase, removeBase, addLeadingSlash, removeTrailingSlash, normalizeSlash, isProduction, isEqualPath, } from './utils';
|
4
4
|
export { useLocation, useNavigate, matchRoutes, BrowserRouter, useSearchParams, matchPath, } from 'react-router-dom';
|
5
5
|
export { createPortal, flushSync, } from 'react-dom';
|
6
|
-
export { pathnameToRouteService, normalizeRoutePath } from './route';
|
6
|
+
export { pathnameToRouteService, normalizeRoutePath, } from './route';
|
7
7
|
export { Helmet } from 'react-helmet-async';
|
8
8
|
export { NoSSR } from './NoSSR';
|
package/dist/route.js
CHANGED
@@ -5,11 +5,10 @@ function normalizeRoutePath(routePath) {
|
|
5
5
|
}
|
6
6
|
const cache = new Map();
|
7
7
|
function pathnameToRouteService(pathname) {
|
8
|
-
var _matched_;
|
9
8
|
const cacheItem = cache.get(pathname);
|
10
9
|
if (cacheItem) return cacheItem;
|
11
10
|
const matched = (0, __WEBPACK_EXTERNAL_MODULE_react_router_dom_5358f3fe__.matchRoutes)(__WEBPACK_EXTERNAL_MODULE__VIRTUAL_ROUTES__3c8bd3e0__.routes, normalizeRoutePath(pathname));
|
12
|
-
const route =
|
11
|
+
const route = matched?.[0]?.route;
|
13
12
|
if (route) cache.set(pathname, route);
|
14
13
|
return route;
|
15
14
|
}
|
package/dist/utils.js
CHANGED
@@ -10,8 +10,7 @@ function isEqualPath(a, b) {
|
|
10
10
|
return withBase(normalizeHrefInRuntime((0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.removeHash)(a))) === withBase(normalizeHrefInRuntime((0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.removeHash)(b)));
|
11
11
|
}
|
12
12
|
function normalizeHrefInRuntime(a) {
|
13
|
-
|
14
|
-
const cleanUrls = Boolean(null === __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"] || void 0 === __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"] ? void 0 : null == (_siteData_route = __WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"].route) ? void 0 : _siteData_route.cleanUrls);
|
13
|
+
const cleanUrls = Boolean(__WEBPACK_EXTERNAL_MODULE_virtual_site_data_fa42d4c0__["default"]?.route?.cleanUrls);
|
15
14
|
return (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.normalizeHref)(a, cleanUrls);
|
16
15
|
}
|
17
16
|
function normalizeImagePath(imagePath) {
|
package/package.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspress/runtime",
|
3
|
-
"version": "2.0.0-beta.
|
3
|
+
"version": "2.0.0-beta.1",
|
4
4
|
"description": "The Runtime of Rspress Documentation Framework",
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
6
6
|
"repository": {
|
7
7
|
"type": "git",
|
8
|
-
"url": "https://github.com/web-infra-dev/rspress",
|
8
|
+
"url": "git+https://github.com/web-infra-dev/rspress.git",
|
9
9
|
"directory": "packages/runtime"
|
10
10
|
},
|
11
11
|
"license": "MIT",
|
@@ -18,6 +18,7 @@
|
|
18
18
|
"virtual-global-styles",
|
19
19
|
"./src/theme-default/styles/index.ts"
|
20
20
|
],
|
21
|
+
"type": "module",
|
21
22
|
"exports": {
|
22
23
|
".": {
|
23
24
|
"types": "./dist/index.d.ts",
|
@@ -28,7 +29,6 @@
|
|
28
29
|
"default": "./server.js"
|
29
30
|
}
|
30
31
|
},
|
31
|
-
"main": "./dist/index.js",
|
32
32
|
"types": "./dist/index.d.ts",
|
33
33
|
"files": [
|
34
34
|
"dist",
|
@@ -40,7 +40,7 @@
|
|
40
40
|
"react-dom": "^19.1.0",
|
41
41
|
"react-helmet-async": "^2.0.5",
|
42
42
|
"react-router-dom": "^6.29.0",
|
43
|
-
"@rspress/shared": "2.0.0-beta.
|
43
|
+
"@rspress/shared": "2.0.0-beta.1"
|
44
44
|
},
|
45
45
|
"devDependencies": {
|
46
46
|
"@rsbuild/plugin-react": "~1.1.1",
|
@@ -48,11 +48,12 @@
|
|
48
48
|
"@types/jest": "~29.5.14",
|
49
49
|
"@types/react": "^18.3.20",
|
50
50
|
"@types/react-dom": "^18.3.6",
|
51
|
+
"rsbuild-plugin-publint": "^0.3.0",
|
51
52
|
"typescript": "^5.8.2",
|
52
53
|
"@rspress/config": "1.0.0"
|
53
54
|
},
|
54
55
|
"engines": {
|
55
|
-
"node": ">=
|
56
|
+
"node": ">=18.0.0"
|
56
57
|
},
|
57
58
|
"publishConfig": {
|
58
59
|
"access": "public",
|
package/server.d.ts
CHANGED
package/server.js
CHANGED