@rspress/core 2.0.0-beta.3 → 2.0.0-beta.31
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 +17 -1
- package/bin/rspress.js +15 -0
- package/dist/101.js +1786 -0
- package/dist/335.js +26 -0
- package/dist/395.js +74 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +142 -0
- package/dist/index.d.ts +118 -26
- package/dist/index.js +1815 -1091
- package/dist/index.js.LICENSE.txt +10 -0
- package/dist/loader.d.ts +43 -42
- package/dist/loader.js +29 -444
- package/dist/processor.d.ts +93 -0
- package/dist/processor.js +777 -0
- package/dist/renderPageWorker.js +193 -0
- package/dist/runtime/App.d.ts +1 -4
- package/dist/runtime/App.js +18 -21
- package/dist/runtime/ClientApp.d.ts +2 -2
- package/dist/runtime/ClientApp.js +23 -13
- package/dist/runtime/csrClientEntry.js +5 -13
- package/dist/runtime/initPageData.d.ts +3 -3
- package/dist/runtime/initPageData.js +33 -39
- package/dist/runtime/ssrClientEntry.js +15 -14
- package/dist/runtime/ssrServerEntry.d.ts +3 -4
- package/dist/runtime/ssrServerEntry.js +41 -19
- package/dist/runtime.d.ts +11 -0
- package/dist/runtime.js +3 -0
- package/dist/shiki-transformers.d.ts +38 -0
- package/dist/shiki-transformers.js +77 -0
- package/dist/shiki-transformers.js.LICENSE.txt +5 -0
- package/dist/theme.d.ts +4 -0
- package/dist/theme.js +1 -0
- package/meta-json-schema.json +382 -0
- package/nav-json-schema.json +118 -0
- package/package.json +56 -44
- package/static/MediumZoom.css +5 -0
- package/static/MediumZoom.tsx +29 -0
- package/dist/runtime/tsconfig.js +0 -4
- package/runtime.ts +0 -1
- package/theme.ts +0 -1
package/package.json
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/core",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.31",
|
|
4
4
|
"description": "The Rspress Documentation Framework",
|
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/web-infra-dev/rspress.git",
|
|
9
|
-
"directory": "packages/
|
|
9
|
+
"directory": "packages/core"
|
|
10
10
|
},
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"sideEffects": [
|
|
13
13
|
"*.css",
|
|
14
14
|
"*.less",
|
|
15
15
|
"*.sass",
|
|
16
|
-
"*.scss"
|
|
17
|
-
"**/virtual-global-styles.js",
|
|
18
|
-
"virtual-global-styles"
|
|
16
|
+
"*.scss"
|
|
19
17
|
],
|
|
20
18
|
"type": "module",
|
|
21
19
|
"exports": {
|
|
@@ -26,81 +24,96 @@
|
|
|
26
24
|
"./dist/*": "./dist/*",
|
|
27
25
|
"./package.json": "./package.json",
|
|
28
26
|
"./theme": {
|
|
29
|
-
"
|
|
27
|
+
"types": "./dist/theme.d.ts",
|
|
28
|
+
"default": "./dist/theme.js"
|
|
30
29
|
},
|
|
31
30
|
"./runtime": {
|
|
32
|
-
"
|
|
31
|
+
"types": "./dist/runtime.d.ts",
|
|
32
|
+
"default": "./dist/runtime.js"
|
|
33
|
+
},
|
|
34
|
+
"./shiki-transformers": {
|
|
35
|
+
"types": "./dist/shiki-transformers.d.ts",
|
|
36
|
+
"default": "./dist/shiki-transformers.js"
|
|
33
37
|
}
|
|
34
38
|
},
|
|
35
39
|
"main": "./dist/index.js",
|
|
36
40
|
"module": "./dist/index.js",
|
|
37
41
|
"types": "./dist/index.d.ts",
|
|
42
|
+
"bin": {
|
|
43
|
+
"rspress": "./bin/rspress.js"
|
|
44
|
+
},
|
|
38
45
|
"files": [
|
|
46
|
+
"bin",
|
|
39
47
|
"dist",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
48
|
+
"meta-json-schema.json",
|
|
49
|
+
"nav-json-schema.json",
|
|
50
|
+
"static",
|
|
51
|
+
"index.html"
|
|
43
52
|
],
|
|
44
53
|
"dependencies": {
|
|
45
|
-
"@
|
|
46
|
-
"@mdx-js/
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@rsbuild/core": "1.3.13",
|
|
50
|
-
"@rsbuild/plugin-react": "~1.1.1",
|
|
54
|
+
"@mdx-js/mdx": "^3.1.1",
|
|
55
|
+
"@mdx-js/react": "^3.1.1",
|
|
56
|
+
"@rsbuild/core": "~1.5.3",
|
|
57
|
+
"@rsbuild/plugin-react": "~1.4.0",
|
|
51
58
|
"@rspress/mdx-rs": "0.6.6",
|
|
52
|
-
"
|
|
59
|
+
"@shikijs/rehype": "^3.12.0",
|
|
60
|
+
"@types/unist": "^3.0.3",
|
|
61
|
+
"@unhead/react": "^2.0.14",
|
|
62
|
+
"cac": "^6.7.14",
|
|
63
|
+
"chokidar": "^3.6.0",
|
|
64
|
+
"enhanced-resolve": "5.18.3",
|
|
53
65
|
"github-slugger": "^2.0.0",
|
|
54
|
-
"hast-util-from-html": "^2.0.3",
|
|
55
66
|
"hast-util-heading-rank": "^3.0.0",
|
|
56
67
|
"html-to-text": "^9.0.5",
|
|
57
68
|
"lodash-es": "^4.17.21",
|
|
58
69
|
"mdast-util-mdxjs-esm": "^2.0.1",
|
|
70
|
+
"medium-zoom": "1.1.0",
|
|
59
71
|
"picocolors": "^1.1.1",
|
|
60
|
-
"react": "^19.1.
|
|
61
|
-
"react-dom": "^19.1.
|
|
72
|
+
"react": "^19.1.1",
|
|
73
|
+
"react-dom": "^19.1.1",
|
|
62
74
|
"react-lazy-with-preload": "^2.2.1",
|
|
63
|
-
"react-router-dom": "^6.
|
|
64
|
-
"react-syntax-highlighter": "^15.6.1",
|
|
75
|
+
"react-router-dom": "^6.30.1",
|
|
65
76
|
"rehype-external-links": "^3.0.0",
|
|
66
|
-
"
|
|
77
|
+
"rehype-raw": "^7.0.0",
|
|
67
78
|
"remark-gfm": "^4.0.1",
|
|
68
|
-
"
|
|
69
|
-
"tinyglobby": "^0.2.
|
|
79
|
+
"shiki": "^3.12.0",
|
|
80
|
+
"tinyglobby": "^0.2.14",
|
|
81
|
+
"tinypool": "^1.1.1",
|
|
70
82
|
"unified": "^11.0.5",
|
|
71
83
|
"unist-util-visit": "^5.0.0",
|
|
72
84
|
"unist-util-visit-children": "^3.0.0",
|
|
73
|
-
"@rspress/
|
|
74
|
-
"@rspress/
|
|
75
|
-
"@rspress/
|
|
76
|
-
"@rspress/plugin-medium-zoom": "2.0.0-beta.3",
|
|
77
|
-
"@rspress/runtime": "2.0.0-beta.3",
|
|
78
|
-
"@rspress/theme-default": "2.0.0-beta.3",
|
|
79
|
-
"@rspress/shared": "2.0.0-beta.3"
|
|
85
|
+
"@rspress/runtime": "2.0.0-beta.31",
|
|
86
|
+
"@rspress/shared": "2.0.0-beta.31",
|
|
87
|
+
"@rspress/theme-default": "2.0.0-beta.31"
|
|
80
88
|
},
|
|
81
89
|
"devDependencies": {
|
|
82
|
-
"@microsoft/api-extractor": "^7.52.
|
|
83
|
-
"@rslib/core": "0.
|
|
84
|
-
"@rspress-dev/plugin-preview": "link:../plugin-preview",
|
|
90
|
+
"@microsoft/api-extractor": "^7.52.11",
|
|
91
|
+
"@rslib/core": "0.12.4",
|
|
85
92
|
"@types/hast": "^3.0.4",
|
|
86
93
|
"@types/html-to-text": "^9.0.4",
|
|
87
94
|
"@types/jest": "~29.5.14",
|
|
88
95
|
"@types/lodash-es": "^4.17.12",
|
|
89
96
|
"@types/mdast": "^4.0.4",
|
|
90
|
-
"@types/node": "^
|
|
91
|
-
"@types/react": "^
|
|
92
|
-
"@types/react-dom": "^
|
|
93
|
-
"
|
|
94
|
-
"
|
|
97
|
+
"@types/node": "^22.8.1",
|
|
98
|
+
"@types/react": "^19.1.12",
|
|
99
|
+
"@types/react-dom": "^19.1.9",
|
|
100
|
+
"execa": "8.0.1",
|
|
101
|
+
"mdast-util-directive": "^3.1.0",
|
|
102
|
+
"mdast-util-mdx-expression": "^2.0.1",
|
|
103
|
+
"memfs": "^4.38.2",
|
|
104
|
+
"p-map": "^7.0.3",
|
|
105
|
+
"postcss": "8.5.6",
|
|
95
106
|
"rehype-stringify": "^10.0.1",
|
|
96
|
-
"remark-
|
|
107
|
+
"remark-directive": "^4.0.0",
|
|
108
|
+
"remark-mdx": "^3.1.1",
|
|
97
109
|
"remark-parse": "^11.0.0",
|
|
98
110
|
"remark-rehype": "^11.1.2",
|
|
99
111
|
"remark-stringify": "^11.0.0",
|
|
100
112
|
"rimraf": "^6.0.1",
|
|
101
|
-
"rsbuild-plugin-publint": "^0.3.
|
|
102
|
-
"rsbuild-plugin-virtual-module": "0.
|
|
113
|
+
"rsbuild-plugin-publint": "^0.3.3",
|
|
114
|
+
"rsbuild-plugin-virtual-module": "0.3.1",
|
|
103
115
|
"tailwindcss": "^3.4.17",
|
|
116
|
+
"ts-json-schema-generator": "^2.4.0",
|
|
104
117
|
"typescript": "^5.8.2",
|
|
105
118
|
"vfile": "^6.0.3",
|
|
106
119
|
"@rspress/config": "1.0.0"
|
|
@@ -110,7 +123,6 @@
|
|
|
110
123
|
},
|
|
111
124
|
"publishConfig": {
|
|
112
125
|
"access": "public",
|
|
113
|
-
"provenance": true,
|
|
114
126
|
"registry": "https://registry.npmjs.org/"
|
|
115
127
|
},
|
|
116
128
|
"scripts": {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useLocation } from '@rspress/runtime';
|
|
2
|
+
import mediumZoom, { type Zoom, type ZoomOptions } from 'medium-zoom';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import './MediumZoom.css';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
selector?: string;
|
|
8
|
+
options?: ZoomOptions;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default function MediumZoom(props: Props) {
|
|
12
|
+
const { pathname } = useLocation();
|
|
13
|
+
const { selector = '.rspress-doc img', options = {} } = props;
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
let zoom: Zoom | undefined;
|
|
17
|
+
const timeout = setTimeout(() => {
|
|
18
|
+
const images = document.querySelectorAll(selector);
|
|
19
|
+
zoom = mediumZoom(images, { ...options, background: 'var(--rp-c-bg)' });
|
|
20
|
+
}, 100);
|
|
21
|
+
return () => {
|
|
22
|
+
clearTimeout(timeout);
|
|
23
|
+
zoom?.detach();
|
|
24
|
+
zoom?.close();
|
|
25
|
+
};
|
|
26
|
+
}, [pathname]);
|
|
27
|
+
|
|
28
|
+
return null;
|
|
29
|
+
}
|
package/dist/runtime/tsconfig.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var tsconfig_namespaceObject = JSON.parse('{"compilerOptions":{"rootDir":".","baseUrl":".","skipLibCheck":true,"jsx":"react-jsx","esModuleInterop":true},"include":["./**/*"]}');
|
|
2
|
-
var __webpack_exports__compilerOptions = tsconfig_namespaceObject.compilerOptions;
|
|
3
|
-
var __webpack_exports__include = tsconfig_namespaceObject.include;
|
|
4
|
-
export { __webpack_exports__compilerOptions as compilerOptions, __webpack_exports__include as include };
|
package/runtime.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@rspress/runtime';
|
package/theme.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@rspress/theme-default';
|