@rspress/core 2.0.0-beta.3 → 2.0.0-beta.30

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/package.json CHANGED
@@ -1,21 +1,19 @@
1
1
  {
2
2
  "name": "@rspress/core",
3
- "version": "2.0.0-beta.3",
3
+ "version": "2.0.0-beta.30",
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/cli/core"
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
- "default": "./theme.ts"
27
+ "types": "./dist/theme.d.ts",
28
+ "default": "./dist/theme.js"
30
29
  },
31
30
  "./runtime": {
32
- "default": "./runtime.ts"
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
- "index.html",
41
- "runtime.ts",
42
- "theme.ts"
48
+ "meta-json-schema.json",
49
+ "nav-json-schema.json",
50
+ "static",
51
+ "index.html"
43
52
  ],
44
53
  "dependencies": {
45
- "@dr.pogodin/react-helmet": "2.0.4",
46
- "@mdx-js/loader": "^3.1.0",
47
- "@mdx-js/mdx": "^3.1.0",
48
- "@mdx-js/react": "^3.1.0",
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
- "enhanced-resolve": "5.18.1",
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.0",
61
- "react-dom": "^19.1.0",
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.29.0",
64
- "react-syntax-highlighter": "^15.6.1",
75
+ "react-router-dom": "^6.30.1",
65
76
  "rehype-external-links": "^3.0.0",
66
- "remark": "^15.0.1",
77
+ "rehype-raw": "^7.0.0",
67
78
  "remark-gfm": "^4.0.1",
68
- "rspack-plugin-virtual-module": "0.1.13",
69
- "tinyglobby": "^0.2.13",
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/plugin-auto-nav-sidebar": "2.0.0-beta.3",
74
- "@rspress/plugin-container-syntax": "2.0.0-beta.3",
75
- "@rspress/plugin-last-updated": "2.0.0-beta.3",
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.30",
86
+ "@rspress/shared": "2.0.0-beta.30",
87
+ "@rspress/theme-default": "2.0.0-beta.30"
80
88
  },
81
89
  "devDependencies": {
82
- "@microsoft/api-extractor": "^7.52.5",
83
- "@rslib/core": "0.6.7",
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": "^18.11.17",
91
- "@types/react": "^18.3.20",
92
- "@types/react-dom": "^18.3.6",
93
- "memfs": "^4.17.0",
94
- "postcss": "8.5.3",
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-mdx": "^3.1.0",
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.1",
102
- "rsbuild-plugin-virtual-module": "0.1.1",
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,5 @@
1
+ /* https://github.com/francoischalifour/medium-zoom#debugging */
2
+ .medium-zoom-overlay,
3
+ .medium-zoom-image--opened {
4
+ z-index: 999;
5
+ }
@@ -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
+ }
@@ -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';