@rspress/core 2.0.0-rc.7 → 2.0.0-rc.8

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.
@@ -9,7 +9,7 @@ import { setTimeout as promises_setTimeout } from "node:timers/promises";
9
9
  import { debuglog } from "node:util";
10
10
  import { node_process, node_os, constants } from "./9348.1beb3e25.js";
11
11
  import { node_path } from "./6289.29817fb4.js";
12
- import { node_url } from "./5485.e8bfcd99.js";
12
+ import { node_url } from "./5485.8150163d.js";
13
13
  import { createWriteStream, createReadStream, readFileSync } from "./9446.421b464f.js";
14
14
  __webpack_require__.add({
15
15
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_rspack_exports, __webpack_require__) {
@@ -1,5 +1,5 @@
1
1
  var package_namespaceObject = {
2
- rE: "2.0.0-rc.7"
2
+ rE: "2.0.0-rc.8"
3
3
  };
4
4
  async function pMap(iterable, mapper, { concurrency = 1 / 0, stopOnError = true, signal } = {}) {
5
5
  return new Promise((resolve_, reject_)=>{
package/dist/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { node_path, logger, join, picocolors } from "../6289.29817fb4.js";
2
2
  import { chokidar, cac } from "./index.44f3184c.js";
3
- import { package_namespaceObject } from "../5485.e8bfcd99.js";
3
+ import { package_namespaceObject } from "../5485.8150163d.js";
4
4
  import { loadConfigFile, resolveDocRoot } from "../config/loadConfigFile.js";
5
5
  import { dev } from "../node/dev.js";
6
6
  import { PUBLIC_DIR } from "../node/constants.js";
@@ -17,12 +17,17 @@ const DEFAULT_HERO = {
17
17
  interface HomeHeroProps {
18
18
  beforeHeroActions?: React.ReactNode;
19
19
  afterHeroActions?: React.ReactNode;
20
+ image?: React.ReactNode;
20
21
  }
21
22
 
22
- function HomeHero({ beforeHeroActions, afterHeroActions }: HomeHeroProps) {
23
+ function HomeHero({
24
+ beforeHeroActions,
25
+ afterHeroActions,
26
+ image,
27
+ }: HomeHeroProps) {
23
28
  const { frontmatter } = useFrontmatter();
24
29
  const hero = frontmatter?.hero || DEFAULT_HERO;
25
- const hasImage = hero.image !== undefined;
30
+ const hasImage = hero.image !== undefined || image !== undefined;
26
31
  const multiHeroText = hero.text
27
32
  ? hero.text
28
33
  .toString()
@@ -90,7 +95,9 @@ function HomeHero({ beforeHeroActions, afterHeroActions }: HomeHeroProps) {
90
95
  {afterHeroActions}
91
96
  </>
92
97
  </div>
93
- {hasImage ? (
98
+ {image ? (
99
+ <div className="rp-home-hero__image">{image}</div>
100
+ ) : hero.image ? (
94
101
  <div className="rp-home-hero__image">
95
102
  <img
96
103
  src={normalizeImagePath(imageSrc.light)}
@@ -40,6 +40,10 @@
40
40
  &--hidden {
41
41
  visibility: hidden;
42
42
  opacity: 0;
43
+ pointer-events: none;
44
+ transition:
45
+ opacity 0.3s ease-in-out,
46
+ visibility 0s linear 0.3s;
43
47
  }
44
48
 
45
49
  &__item {
@@ -87,10 +87,6 @@ export function NavMenuItemWithLink({
87
87
  className={cls(
88
88
  'rp-nav-menu__item',
89
89
  isActive ? 'rp-nav-menu__item--active' : '',
90
-
91
- // For algolia crawler compatibility
92
- 'rspress-nav-menu-item',
93
- isActive ? 'rspress-nav-menu-item-active' : '',
94
90
  )}
95
91
  >
96
92
  <NavMenuItemInner menuItem={menuItem} />
@@ -1,4 +1,4 @@
1
- import { createRequire, package_namespaceObject } from "../5485.e8bfcd99.js";
1
+ import { createRequire, package_namespaceObject } from "../5485.8150163d.js";
2
2
  import { node_path } from "../6289.29817fb4.js";
3
3
  const constants_require = createRequire(import.meta.url);
4
4
  const RSPRESS_VERSION = package_namespaceObject.rE;
@@ -1,4 +1,4 @@
1
- import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.e8bfcd99.js";
1
+ import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.8150163d.js";
2
2
  import { node_path } from "../6289.29817fb4.js";
3
3
  import { removeTrailingSlash, MDX_OR_MD_REGEXP, cwd } from "../9348.1beb3e25.js";
4
4
  import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../9446.421b464f.js";
@@ -1,4 +1,4 @@
1
- import { createRequire } from "../../5485.e8bfcd99.js";
1
+ import { createRequire } from "../../5485.8150163d.js";
2
2
  import { picocolors, join, logger } from "../../6289.29817fb4.js";
3
3
  import { DEFAULT_I18N_TEXT } from "./DEFAULT_I18N_TEXT.js";
4
4
  import { createError } from "../utils/error.js";
@@ -1,4 +1,4 @@
1
- import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.e8bfcd99.js";
1
+ import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.8150163d.js";
2
2
  import { logger, picocolors } from "../../6289.29817fb4.js";
3
3
  import { hintSSGFailed } from "../logger/hint.js";
4
4
  import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
@@ -1,6 +1,6 @@
1
1
  import { workerData } from "./renderPageWorker.165b5d46.js";
2
2
  import { createError } from "../utils/error.js";
3
- import { pMap } from "../../5485.e8bfcd99.js";
3
+ import { pMap } from "../../5485.8150163d.js";
4
4
  import { renderPage } from "./renderPage.js";
5
5
  const params = workerData?.[1]?.params;
6
6
  if (!params) throw createError('SSG Worker Thread workerData params missing');
@@ -2,7 +2,7 @@
2
2
  import { logger, picocolors } from "../../6289.29817fb4.js";
3
3
  import { chunk } from "../../9446.421b464f.js";
4
4
  import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
5
- import { pMap } from "../../5485.e8bfcd99.js";
5
+ import { pMap } from "../../5485.8150163d.js";
6
6
  import { renderPage } from "./renderPage.js";
7
7
  import { hintSSGFailed } from "../logger/hint.js";
8
8
  import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
@@ -1,4 +1,4 @@
1
- import { pathToFileURL, createHead } from "../../5485.e8bfcd99.js";
1
+ import { pathToFileURL, createHead } from "../../5485.8150163d.js";
2
2
  import { logger, picocolors } from "../../6289.29817fb4.js";
3
3
  import { hintSSGFailed } from "../logger/hint.js";
4
4
  async function renderPage(route, ssrBundlePath) {
@@ -1,5 +1,5 @@
1
1
  import { logger, picocolors } from "../../6289.29817fb4.js";
2
- import { pMap } from "../../5485.e8bfcd99.js";
2
+ import { pMap } from "../../5485.8150163d.js";
3
3
  import { renderPage } from "./renderPage.js";
4
4
  import { SSGConcurrency } from "../ssg/ssgEnv.js";
5
5
  const routePage2MdFilename = (routePath)=>{
@@ -2,7 +2,8 @@ import './index.scss';
2
2
  interface HomeHeroProps {
3
3
  beforeHeroActions?: React.ReactNode;
4
4
  afterHeroActions?: React.ReactNode;
5
+ image?: React.ReactNode;
5
6
  }
6
- declare function HomeHero({ beforeHeroActions, afterHeroActions }: HomeHeroProps): import("react/jsx-runtime").JSX.Element;
7
+ declare function HomeHero({ beforeHeroActions, afterHeroActions, image, }: HomeHeroProps): import("react/jsx-runtime").JSX.Element;
7
8
  export { HomeHero };
8
9
  export type { HomeHeroProps };
@@ -11,10 +11,10 @@ const DEFAULT_HERO = {
11
11
  actions: [],
12
12
  image: void 0
13
13
  };
14
- function HomeHero({ beforeHeroActions, afterHeroActions }) {
14
+ function HomeHero({ beforeHeroActions, afterHeroActions, image }) {
15
15
  const { frontmatter } = useFrontmatter();
16
16
  const hero = frontmatter?.hero || DEFAULT_HERO;
17
- const hasImage = void 0 !== hero.image;
17
+ const hasImage = void 0 !== hero.image || void 0 !== image;
18
18
  const multiHeroText = hero.text ? hero.text.toString().split(/\n/g).filter((text)=>'' !== text) : [];
19
19
  const imageSrc = 'string' == typeof hero.image?.src ? {
20
20
  light: hero.image.src,
@@ -80,7 +80,10 @@ function HomeHero({ beforeHeroActions, afterHeroActions }) {
80
80
  })
81
81
  ]
82
82
  }),
83
- hasImage ? /*#__PURE__*/ jsxs("div", {
83
+ image ? /*#__PURE__*/ jsx("div", {
84
+ className: "rp-home-hero__image",
85
+ children: image
86
+ }) : hero.image ? /*#__PURE__*/ jsxs("div", {
84
87
  className: "rp-home-hero__image",
85
88
  children: [
86
89
  /*#__PURE__*/ jsx("img", {
@@ -34,6 +34,8 @@
34
34
  .rp-hover-group--hidden {
35
35
  visibility: hidden;
36
36
  opacity: 0;
37
+ pointer-events: none;
38
+ transition: opacity .3s ease-in-out, visibility 0s linear .3s;
37
39
  }
38
40
 
39
41
  .rp-hover-group__item {
@@ -62,7 +62,7 @@ function NavMenuItemWithLink({ menuItem }) {
62
62
  pathname
63
63
  ]);
64
64
  return /*#__PURE__*/ jsx("li", {
65
- className: clsx('rp-nav-menu__item', isActive ? 'rp-nav-menu__item--active' : '', 'rspress-nav-menu-item', isActive ? 'rspress-nav-menu-item-active' : ''),
65
+ className: clsx('rp-nav-menu__item', isActive ? 'rp-nav-menu__item--active' : ''),
66
66
  children: /*#__PURE__*/ jsx(NavMenuItemInner, {
67
67
  menuItem: menuItem
68
68
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/core",
3
- "version": "2.0.0-rc.7",
3
+ "version": "2.0.0-rc.8",
4
4
  "description": "The Rspress Documentation Framework",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -102,7 +102,7 @@
102
102
  "unist-util-remove": "^4.0.0",
103
103
  "unist-util-visit": "^5.0.0",
104
104
  "unist-util-visit-children": "^3.0.0",
105
- "@rspress/shared": "2.0.0-rc.7"
105
+ "@rspress/shared": "2.0.0-rc.8"
106
106
  },
107
107
  "devDependencies": {
108
108
  "@microsoft/api-extractor": "^7.55.2",