@rspress/core 2.0.0-rc.0 → 2.0.0-rc.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.
Files changed (64) hide show
  1. package/dist/{3~395.js → 3~128.js} +2 -2
  2. package/dist/{3~101.js → 3~517.js} +2 -2
  3. package/dist/{3~335.js → 3~894.js} +2 -2
  4. package/dist/cli.js +1 -1
  5. package/dist/eject-theme/components/Button/index.scss +1 -6
  6. package/dist/eject-theme/components/DocContent/doc.scss +3 -2
  7. package/dist/eject-theme/components/DocContent/index.tsx +3 -0
  8. package/dist/eject-theme/components/HoverGroup/index.scss +5 -1
  9. package/dist/eject-theme/components/HoverGroup/index.tsx +5 -1
  10. package/dist/eject-theme/components/Link/index.tsx +30 -5
  11. package/dist/eject-theme/components/Link/useLinkNavigate.ts +32 -16
  12. package/dist/eject-theme/components/Nav/NavMenu.scss +1 -0
  13. package/dist/eject-theme/components/Nav/NavTitle.scss +11 -0
  14. package/dist/eject-theme/components/Nav/NavTitle.tsx +1 -0
  15. package/dist/eject-theme/components/Nav/index.scss +0 -8
  16. package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.scss +14 -0
  17. package/dist/eject-theme/components/Outline/index.scss +0 -1
  18. package/dist/eject-theme/components/Search/SearchPanel.tsx +2 -2
  19. package/dist/eject-theme/components/Sidebar/SidebarItem.scss +12 -8
  20. package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +5 -4
  21. package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.scss +1 -1
  22. package/dist/eject-theme/components/SourceCode/index.scss +2 -1
  23. package/dist/eject-theme/components/Toc/TocItem.scss +7 -3
  24. package/dist/index.js +4 -4
  25. package/dist/renderPageWorker.js +1 -1
  26. package/dist/theme/assets/moon.js +9 -26
  27. package/dist/theme/components/Button/index.css +1 -1
  28. package/dist/theme/components/DocContent/doc.css +2 -1
  29. package/dist/theme/components/DocContent/index.js +2 -0
  30. package/dist/theme/components/HoverGroup/index.css +5 -1
  31. package/dist/theme/components/HoverGroup/index.js +1 -0
  32. package/dist/theme/components/Link/index.d.ts +18 -1
  33. package/dist/theme/components/Link/index.js +6 -4
  34. package/dist/theme/components/Link/useLinkNavigate.d.ts +4 -1
  35. package/dist/theme/components/Link/useLinkNavigate.js +23 -17
  36. package/dist/theme/components/Nav/NavMenu.css +1 -0
  37. package/dist/theme/components/Nav/NavTitle.css +12 -0
  38. package/dist/theme/components/Nav/NavTitle.d.ts +1 -0
  39. package/dist/theme/components/Nav/NavTitle.js +1 -0
  40. package/dist/theme/components/Nav/index.css +0 -8
  41. package/dist/theme/components/NavScreen/NavScreenMenuItem.css +9 -0
  42. package/dist/theme/components/Outline/index.css +0 -1
  43. package/dist/theme/components/Search/SearchPanel.js +1 -1
  44. package/dist/theme/components/Sidebar/SidebarItem.css +11 -3
  45. package/dist/theme/components/Sidebar/SidebarItem.js +5 -3
  46. package/dist/theme/components/Sidebar/SidebarSectionHeader.css +1 -1
  47. package/dist/theme/components/SourceCode/index.css +5 -0
  48. package/dist/theme/components/Toc/TocItem.css +7 -3
  49. package/dist/theme/index.d.ts +3 -3
  50. package/dist/theme/index.js +1 -1
  51. package/dist/theme/layout/DocLayout/index.js +1 -4
  52. package/dist/theme/layout/Layout/index.d.ts +1 -1
  53. package/dist/theme/layout/Layout/index.js +3 -3
  54. package/dist/theme/logic/useScrollAfterNav.d.ts +5 -0
  55. package/dist/theme/logic/{sideEffects.js → useScrollAfterNav.js} +5 -6
  56. package/dist/theme/logic/useScrollReset.d.ts +5 -0
  57. package/dist/theme/logic/useScrollReset.js +12 -0
  58. package/dist/theme/logic/useSetup.js +2 -0
  59. package/dist/theme/styles/base.css +1 -10
  60. package/dist/theme/styles/index.d.ts +1 -1
  61. package/dist/theme/styles/index.js +1 -1
  62. package/dist/theme/styles/vars/home-vars.css +2 -1
  63. package/package.json +11 -11
  64. /package/dist/theme/logic/{sideEffects.d.ts → useSetup.d.ts} +0 -0
@@ -7,9 +7,9 @@ import * as __WEBPACK_EXTERNAL_MODULE_node_timers_promises_aedbf14c__ from "node
7
7
  import * as __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__ from "node:util";
8
8
  import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
9
9
  import * as __WEBPACK_EXTERNAL_MODULE_stream__ from "stream";
10
- export const __webpack_id__ = "395";
10
+ export const __webpack_id__ = "128";
11
11
  export const __webpack_ids__ = [
12
- "395"
12
+ "128"
13
13
  ];
14
14
  export const __webpack_modules__ = {
15
15
  "./src/node/last-updated/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -1,6 +1,6 @@
1
- export const __webpack_id__ = "101";
1
+ export const __webpack_id__ = "517";
2
2
  export const __webpack_ids__ = [
3
- "101"
3
+ "517"
4
4
  ];
5
5
  export const __webpack_modules__ = {
6
6
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
@@ -1,6 +1,6 @@
1
- export const __webpack_id__ = "335";
1
+ export const __webpack_id__ = "894";
2
2
  export const __webpack_ids__ = [
3
- "335"
3
+ "894"
4
4
  ];
5
5
  export const __webpack_modules__ = {
6
6
  "./src/node/medium-zoom/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
package/dist/cli.js CHANGED
@@ -9,7 +9,7 @@ import { build, dev, serve } from "./index.js";
9
9
  import node_fs from "node:fs";
10
10
  import { DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "@rspress/shared/constants";
11
11
  var package_namespaceObject = {
12
- rE: "2.0.0-rc.0"
12
+ rE: "2.0.0-rc.1"
13
13
  };
14
14
  const eject_filename = fileURLToPath(import.meta.url);
15
15
  const eject_dirname = node_path.dirname(eject_filename);
@@ -36,12 +36,7 @@
36
36
  opacity: 1;
37
37
  color: #fff;
38
38
  transition: all 0.3s ease;
39
- background: linear-gradient(
40
- 90deg,
41
- var(--rp-c-brand-dark) 0%,
42
- var(--rp-c-brand-dark) 30%,
43
- #a673ff 100%
44
- );
39
+ background: var(--rp-home-hero-title-bg);
45
40
 
46
41
  &:hover {
47
42
  opacity: 0.8;
@@ -7,7 +7,8 @@
7
7
  /* #region */
8
8
  &:where(p) {
9
9
  margin-top: 1.25rem; /* 20px */
10
- margin-bottom: 1.25rem;
10
+ margin-bottom: 1.25rem; /* 20px */
11
+ line-height: 1.75rem; /* 28px */
11
12
  }
12
13
  &:where(strong, b) {
13
14
  font-weight: 600;
@@ -96,7 +97,7 @@
96
97
  &:where(h2) {
97
98
  font-size: 1.75rem; // 28px
98
99
  margin-top: 3rem; // 48px
99
- margin-bottom: 2rem;
100
+ margin-bottom: 1.25rem; // 20px
100
101
  }
101
102
  &:where(h2:first-of-type)::before {
102
103
  content: '';
@@ -2,6 +2,7 @@ import { MDXProvider } from '@mdx-js/react';
2
2
  import { Content, usePage, useSite } from '@rspress/core/runtime';
3
3
  import { Callout, getCustomMDXComponent } from '@theme';
4
4
  import './doc.scss';
5
+ import { useScrollAfterNav } from '../../logic/useScrollAfterNav';
5
6
  import { FallbackHeading } from './FallbackHeading';
6
7
 
7
8
  export function FallbackTitle() {
@@ -22,6 +23,8 @@ export function DocContent({
22
23
  components: Record<string, React.FC<any>> | undefined;
23
24
  isOverviewPage?: boolean;
24
25
  }) {
26
+ useScrollAfterNav();
27
+
25
28
  const mdxComponents = {
26
29
  ...getCustomMDXComponent(),
27
30
  ...components,
@@ -63,7 +63,11 @@
63
63
  font-weight: 500;
64
64
  line-height: 32px;
65
65
 
66
- cursor: pointer;
66
+ &__link {
67
+ // For click area
68
+ display: block;
69
+ height: 100%;
70
+ }
67
71
 
68
72
  &--active {
69
73
  font-weight: 600;
@@ -45,7 +45,11 @@ function HoverGroup({
45
45
  'rp-hover-group__item--active': isActiveItem,
46
46
  })}
47
47
  >
48
- <Link href={link} aria-label={text}>
48
+ <Link
49
+ href={link}
50
+ aria-label={text}
51
+ className="rp-hover-group__item__link"
52
+ >
49
53
  {text}
50
54
  </Link>
51
55
  </li>
@@ -1,10 +1,10 @@
1
1
  import { preloadLink } from '@rspress/core/runtime';
2
+ import clsx from 'clsx';
2
3
  import nprogress from 'nprogress';
3
4
  import type React from 'react';
4
- import type { ComponentProps } from 'react';
5
- import { getHref, useLinkNavigate } from './useLinkNavigate';
5
+ import type { ComponentProps, TransitionStartFunction } from 'react';
6
6
  import './index.scss';
7
- import clsx from 'clsx';
7
+ import { getHref, useLinkNavigate } from './useLinkNavigate';
8
8
 
9
9
  export interface LinkProps extends ComponentProps<'a'> {
10
10
  href?: string;
@@ -13,6 +13,24 @@ export interface LinkProps extends ComponentProps<'a'> {
13
13
  onMouseEnter?: (
14
14
  event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
15
15
  ) => void;
16
+
17
+ /**
18
+ * Get isPending state of Link navigation
19
+ *
20
+ * ```tsx
21
+ * const [isPending, startTransition] = useTransition();
22
+ * <Link
23
+ * href="/some-path"
24
+ * startTransition={startTransition}
25
+ * >
26
+ * Some Link
27
+ * </Link>
28
+ * ```
29
+ *
30
+ * @private
31
+ * @unstable
32
+ */
33
+ startTransition?: TransitionStartFunction;
16
34
  }
17
35
 
18
36
  nprogress.configure({ showSpinner: false });
@@ -26,10 +44,17 @@ nprogress.configure({ showSpinner: false });
26
44
  * 4. Link is styled.
27
45
  */
28
46
  export function Link(props: LinkProps) {
29
- const { href = '/', children, className = '', onClick, onMouseEnter } = props;
47
+ const {
48
+ href = '/',
49
+ children,
50
+ className = '',
51
+ onClick,
52
+ onMouseEnter,
53
+ startTransition,
54
+ } = props;
30
55
 
31
56
  const { linkType, removeBaseHref, withBaseHref } = getHref(href);
32
- const navigate = useLinkNavigate();
57
+ const navigate = useLinkNavigate({ startTransition });
33
58
 
34
59
  if (linkType === 'external') {
35
60
  return (
@@ -9,7 +9,11 @@ import {
9
9
  withBase,
10
10
  } from '@rspress/core/runtime';
11
11
  import nprogress from 'nprogress';
12
- import { useCallback } from 'react';
12
+ import {
13
+ startTransition as reactStartTransition,
14
+ type TransitionStartFunction,
15
+ useCallback,
16
+ } from 'react';
13
17
 
14
18
  nprogress.configure({ showSpinner: false });
15
19
 
@@ -60,7 +64,11 @@ export function getHref(href: string): {
60
64
  * For import { Link } from '@theme';
61
65
  * useNavigate with preload logic
62
66
  */
63
- export function useLinkNavigate(): (href: string) => Promise<void> {
67
+ export function useLinkNavigate(
68
+ { startTransition }: { startTransition?: TransitionStartFunction } = {
69
+ startTransition: reactStartTransition,
70
+ },
71
+ ): (href: string) => Promise<void> {
64
72
  const { pathname: currPagePathname } = useLocation();
65
73
  const navigate = useNavigateInner();
66
74
 
@@ -72,22 +80,30 @@ export function useLinkNavigate(): (href: string) => Promise<void> {
72
80
  return;
73
81
  }
74
82
 
75
- const inCurrPage = isActive(removeBaseHref, currPagePathname);
76
- if (!process.env.__SSR__ && !inCurrPage) {
77
- const matchedRoute = pathnameToRouteService(removeBaseHref);
78
- if (matchedRoute) {
79
- const timer = setTimeout(() => {
80
- nprogress.start();
81
- }, 200);
82
- await matchedRoute.preload();
83
- clearTimeout(timer);
84
- nprogress.done();
85
- } else {
86
- window.location.assign(withBaseHref);
87
- return;
83
+ const preloadChunkThenNavigate = async () => {
84
+ const inCurrPage = isActive(removeBaseHref, currPagePathname);
85
+ if (!process.env.__SSR__ && !inCurrPage) {
86
+ const matchedRoute = pathnameToRouteService(removeBaseHref);
87
+ if (matchedRoute) {
88
+ const timer = setTimeout(() => {
89
+ nprogress.start();
90
+ }, 200);
91
+ await matchedRoute.preload();
92
+ clearTimeout(timer);
93
+ nprogress.done();
94
+ } else {
95
+ window.location.assign(withBaseHref);
96
+ return;
97
+ }
88
98
  }
99
+ navigate(removeBaseHref, { replace: false });
100
+ };
101
+
102
+ if (startTransition) {
103
+ startTransition(preloadChunkThenNavigate);
104
+ } else {
105
+ preloadChunkThenNavigate();
89
106
  }
90
- navigate(removeBaseHref, { replace: false });
91
107
  },
92
108
  [currPagePathname, navigate],
93
109
  );
@@ -24,6 +24,7 @@
24
24
  cursor: pointer;
25
25
  justify-content: center;
26
26
  align-items: center;
27
+ height: 100%;
27
28
  gap: 6px;
28
29
 
29
30
  // text
@@ -0,0 +1,11 @@
1
+ .rspress-logo {
2
+ height: 1.6rem;
3
+ }
4
+
5
+ .dark .rp-nav__title__logo-image--light {
6
+ display: none;
7
+ }
8
+
9
+ .dark .rp-nav__title__logo-image--dark {
10
+ display: block;
11
+ }
@@ -6,6 +6,7 @@ import {
6
6
  } from '@rspress/core/runtime';
7
7
  import { Link } from '@theme';
8
8
  import { useMemo } from 'react';
9
+ import './NavTitle.scss';
9
10
 
10
11
  export const NavTitle = () => {
11
12
  const { site } = useSite();
@@ -91,11 +91,3 @@
91
91
  }
92
92
  }
93
93
  }
94
-
95
- .dark .rp-nav__title__logo-image--light {
96
- display: none;
97
- }
98
-
99
- .dark .rp-nav__title__logo-image--dark {
100
- display: block;
101
- }
@@ -56,4 +56,18 @@
56
56
  gap: 2px;
57
57
  margin-left: 8px;
58
58
  }
59
+
60
+ // external link
61
+ &.rp-link[target='_blank'] {
62
+ .rp-nav-screen-menu-item__left {
63
+ &::after {
64
+ content: '↗';
65
+ font-weight: 400;
66
+ color: var(--rp-c-text-3);
67
+ transform: translate(0, -0.2em);
68
+ margin-left: 0.2em;
69
+ margin-right: 0.1em;
70
+ }
71
+ }
72
+ }
59
73
  }
@@ -43,7 +43,6 @@
43
43
  display: flex;
44
44
  flex-direction: column;
45
45
  flex: 1;
46
- gap: 6px;
47
46
 
48
47
  // allow scroll when there are too many toc items
49
48
  @media (max-width: 1280px) {
@@ -232,8 +232,8 @@ export function SearchPanel({ focused, setFocused }: SearchPanelProps) {
232
232
  currentRenderType === RenderType.Default
233
233
  ) {
234
234
  // the ResultItem has been normalized to display
235
- const flatSuggestions = Object.values(
236
- normalizeSuggestions(currentSuggestions),
235
+ const flatSuggestions = Array.from(
236
+ normalizeSuggestions(currentSuggestions).values(),
237
237
  ).flat();
238
238
  const suggestion = flatSuggestions[currentSuggestionIndex];
239
239
  navigate(suggestion.link);
@@ -3,11 +3,11 @@
3
3
  display: flex;
4
4
  justify-content: space-between;
5
5
  align-items: center;
6
- padding: 2px 12px 2px 12px;
6
+ padding: 6px 12px;
7
7
  margin-top: 2px;
8
8
  position: relative;
9
9
  border-radius: 8px;
10
- line-height: 32px;
10
+ line-height: 24px;
11
11
  font-size: 14px;
12
12
  font-weight: 400;
13
13
  color: var(--rp-c-text-2);
@@ -15,11 +15,20 @@
15
15
  color 0.15s,
16
16
  background-color 0.15s;
17
17
 
18
- &:hover {
18
+ &:first-child {
19
+ margin-top: 0;
20
+ }
21
+
22
+ &:hover,
23
+ &--pending {
19
24
  color: var(--rp-c-text-1);
20
25
  background-color: var(--rp-c-bg-mute);
21
26
  }
22
27
 
28
+ &--pending {
29
+ opacity: 0.8;
30
+ }
31
+
23
32
  // external link
24
33
  &.rp-link[target='_blank'] {
25
34
  &::after {
@@ -32,11 +41,6 @@
32
41
  margin-left: 0.2em;
33
42
  margin-right: 0.1em;
34
43
  }
35
-
36
- // TODO: discussion
37
- // &:hover::after {
38
- // transform: translate(0.1em, -0.4em);
39
- // }
40
44
  }
41
45
 
42
46
  &--active {
@@ -6,7 +6,7 @@ import { useActiveMatcher } from '@rspress/core/runtime';
6
6
  import { Link, renderInlineMarkdown, Tag } from '@theme';
7
7
  import clsx from 'clsx';
8
8
  import type React from 'react';
9
- import { useEffect, useRef } from 'react';
9
+ import { useEffect, useRef, useTransition } from 'react';
10
10
  import './SidebarItem.scss';
11
11
  import scrollIntoView from 'scroll-into-view-if-needed';
12
12
 
@@ -35,6 +35,8 @@ export function SidebarItemRaw({
35
35
  }) {
36
36
  const ref = useRef<HTMLDivElement>(null);
37
37
 
38
+ const [isPending, startTransition] = useTransition();
39
+
38
40
  useEffect(() => {
39
41
  if (active && ref.current) {
40
42
  scrollIntoView(ref.current, {
@@ -60,16 +62,16 @@ export function SidebarItemRaw({
60
62
  return (
61
63
  <Link
62
64
  href={link}
63
- onClick={onClick}
65
+ startTransition={startTransition}
64
66
  className={clsx(
65
67
  'rp-sidebar-item',
66
68
  {
67
69
  'rp-sidebar-item--active': active,
70
+ 'rp-sidebar-item--pending': isPending,
68
71
  },
69
72
  className,
70
73
  )}
71
74
  style={{
72
- // paddingLeft: depth <= 1 ? '12px' : `calc(12px * ${depth - 1} + 12px)`, // TODO: discussion
73
75
  paddingLeft: depth === 0 ? '12px' : `calc(12px * ${depth} + 12px)`,
74
76
  }}
75
77
  {...{ 'data-depth': depth }}
@@ -92,7 +94,6 @@ export function SidebarItemRaw({
92
94
  )}
93
95
  style={{
94
96
  paddingLeft: depth === 0 ? '12px' : `calc(12px * ${depth} + 12px)`,
95
- // paddingLeft: depth <= 1 ? '12px' : `calc(12px * ${depth - 1} + 12px)`, // TODO: discussion
96
97
  }}
97
98
  {...{ 'data-depth': depth }}
98
99
  {...(context ? { 'data-context': context } : {})}
@@ -5,7 +5,7 @@
5
5
  padding: 4px 12px;
6
6
  margin-top: 16px;
7
7
 
8
- &:first-of-type {
8
+ &:first-child {
9
9
  margin-top: 0;
10
10
  }
11
11
 
@@ -29,6 +29,7 @@
29
29
  }
30
30
 
31
31
  &__text {
32
- // Text styling if needed
32
+ font-weight: 600;
33
+ line-height: 1.5em;
33
34
  }
34
35
  }
@@ -4,20 +4,24 @@
4
4
  align-items: flex-start;
5
5
  gap: 10px;
6
6
  align-self: stretch;
7
- border-radius: 6px;
8
7
  position: relative;
8
+ margin-top: 6px;
9
+
10
+ &:first-child {
11
+ margin-top: 0;
12
+ }
9
13
 
10
14
  &__text {
11
15
  font-weight: 400;
12
16
  font-size: 14px;
13
- line-height: 24px;
17
+ line-height: 1;
14
18
  color: var(--rp-c-text-2);
15
19
  overflow-wrap: break-word;
16
20
  }
17
21
 
18
22
  &--active {
19
23
  .rp-toc-item__text,
20
- .rp-toc-item__text * {
24
+ .rp-toc-item__text code {
21
25
  color: var(--rp-c-link);
22
26
  }
23
27
 
package/dist/index.js CHANGED
@@ -212,7 +212,7 @@ function normalizePath(id) {
212
212
  }
213
213
  var external_node_url_ = __webpack_require__("node:url");
214
214
  var package_namespaceObject = {
215
- rE: "2.0.0-rc.0"
215
+ rE: "2.0.0-rc.1"
216
216
  };
217
217
  const RSPRESS_VERSION = package_namespaceObject.rE;
218
218
  const APPEARANCE_KEY = 'rspress-theme-appearance';
@@ -2728,13 +2728,13 @@ class PluginDriver {
2728
2728
  const mediumZoomConfig = config?.mediumZoom ?? true;
2729
2729
  if (enableLastUpdated) {
2730
2730
  const { pluginLastUpdated } = await Promise.all([
2731
- __webpack_require__.e("101"),
2732
- __webpack_require__.e("395")
2731
+ __webpack_require__.e("517"),
2732
+ __webpack_require__.e("128")
2733
2733
  ]).then(__webpack_require__.bind(__webpack_require__, "./src/node/last-updated/index.ts"));
2734
2734
  this.addPlugin(pluginLastUpdated());
2735
2735
  }
2736
2736
  if (mediumZoomConfig) {
2737
- const { pluginMediumZoom } = await __webpack_require__.e("335").then(__webpack_require__.bind(__webpack_require__, "./src/node/medium-zoom/index.ts"));
2737
+ const { pluginMediumZoom } = await __webpack_require__.e("894").then(__webpack_require__.bind(__webpack_require__, "./src/node/medium-zoom/index.ts"));
2738
2738
  this.addPlugin(pluginMediumZoom('object' == typeof mediumZoomConfig ? mediumZoomConfig : void 0));
2739
2739
  }
2740
2740
  (config.plugins || []).forEach((plugin)=>{
@@ -102,7 +102,7 @@ function hintSSGFailed() {
102
102
  2. Set \`ssg: false\` if the code in node_modules may be difficult to fix, but the SSG feature will be lost.`);
103
103
  }
104
104
  var package_namespaceObject = {
105
- rE: "2.0.0-rc.0"
105
+ rE: "2.0.0-rc.1"
106
106
  };
107
107
  const RSPRESS_VERSION = package_namespaceObject.rE;
108
108
  const APPEARANCE_KEY = 'rspress-theme-appearance';
@@ -1,33 +1,16 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
- const SvgMoon = (props)=>/*#__PURE__*/ jsxs("svg", {
3
+ const SvgMoon = (props)=>/*#__PURE__*/ jsx("svg", {
4
4
  xmlns: "http://www.w3.org/2000/svg",
5
- width: 20,
6
- height: 20,
5
+ width: 19,
6
+ height: 19,
7
7
  fill: "none",
8
- viewBox: "0 0 20 20",
8
+ viewBox: "0 0 19 19",
9
9
  ...props,
10
- children: [
11
- /*#__PURE__*/ jsx("g", {
12
- clipPath: "url(#moon_svg__a)",
13
- children: /*#__PURE__*/ jsx("path", {
14
- fill: "currentColor",
15
- stroke: "currentColor",
16
- strokeLinejoin: "round",
17
- strokeWidth: 1.667,
18
- d: "M11.688 1.838a5.303 5.303 0 1 0 6.474 6.474q.169.82.17 1.688a8.333 8.333 0 1 1-6.644-8.162Z"
19
- })
20
- }),
21
- /*#__PURE__*/ jsx("defs", {
22
- children: /*#__PURE__*/ jsx("clipPath", {
23
- id: "moon_svg__a",
24
- children: /*#__PURE__*/ jsx("path", {
25
- fill: "currentColor",
26
- d: "M0 0h20v20H0z"
27
- })
28
- })
29
- })
30
- ]
10
+ children: /*#__PURE__*/ jsx("path", {
11
+ fill: "currentColor",
12
+ d: "M9.166 0a9.2 9.2 0 0 1 1.857.188.834.834 0 0 1 .042 1.623 4.47 4.47 0 1 0 5.457 5.457l.048-.135a.834.834 0 0 1 1.575.177q.186.902.188 1.856A9.168 9.168 0 1 1 9.166 0"
13
+ })
31
14
  });
32
15
  var moon = SvgMoon;
33
16
  export { moon as default };
@@ -35,7 +35,7 @@
35
35
  .rp-button--brand {
36
36
  opacity: 1;
37
37
  color: #fff;
38
- background: linear-gradient(90deg, var(--rp-c-brand-dark) 0%, var(--rp-c-brand-dark) 30%, #a673ff 100%);
38
+ background: var(--rp-home-hero-title-bg);
39
39
  transition: all .3s;
40
40
  }
41
41
 
@@ -1,6 +1,7 @@
1
1
  .rp-doc :not(:where(.rp-not-doc, .rp-not-doc *)):where(p) {
2
2
  margin-top: 1.25rem;
3
3
  margin-bottom: 1.25rem;
4
+ line-height: 1.75rem;
4
5
  }
5
6
 
6
7
  .rp-doc :not(:where(.rp-not-doc, .rp-not-doc *)):where(strong, b) {
@@ -77,7 +78,7 @@
77
78
 
78
79
  .rp-doc :not(:where(.rp-not-doc, .rp-not-doc *)):where(h2) {
79
80
  margin-top: 3rem;
80
- margin-bottom: 2rem;
81
+ margin-bottom: 1.25rem;
81
82
  font-size: 1.75rem;
82
83
  }
83
84
 
@@ -3,6 +3,7 @@ import { MDXProvider } from "@mdx-js/react";
3
3
  import { Content, usePage, useSite } from "@rspress/core/runtime";
4
4
  import { Callout, getCustomMDXComponent } from "@theme";
5
5
  import "./doc.css";
6
+ import { useScrollAfterNav } from "../../logic/useScrollAfterNav.js";
6
7
  import { FallbackHeading } from "./FallbackHeading.js";
7
8
  function FallbackTitle() {
8
9
  const { site } = useSite();
@@ -14,6 +15,7 @@ function FallbackTitle() {
14
15
  });
15
16
  }
16
17
  function DocContent({ components, isOverviewPage = false }) {
18
+ useScrollAfterNav();
17
19
  const mdxComponents = {
18
20
  ...getCustomMDXComponent(),
19
21
  ...components,
@@ -40,7 +40,6 @@
40
40
  white-space: nowrap;
41
41
  height: 32px;
42
42
  color: var(--rp-c-text-1);
43
- cursor: pointer;
44
43
  border-radius: 8px;
45
44
  flex: 1;
46
45
  align-self: stretch;
@@ -54,6 +53,11 @@
54
53
  display: block;
55
54
  }
56
55
 
56
+ .rp-hover-group__item__link {
57
+ height: 100%;
58
+ display: block;
59
+ }
60
+
57
61
  .rp-hover-group__item--active {
58
62
  color: var(--rp-c-brand);
59
63
  cursor: auto;
@@ -20,6 +20,7 @@ function HoverGroup({ items, customChildren, isOpen, position = 'center', active
20
20
  children: /*#__PURE__*/ jsx(Link, {
21
21
  href: link,
22
22
  "aria-label": text,
23
+ className: "rp-hover-group__item__link",
23
24
  children: text
24
25
  })
25
26
  }, text + link);
@@ -1,11 +1,28 @@
1
1
  import type React from 'react';
2
- import type { ComponentProps } from 'react';
2
+ import type { ComponentProps, TransitionStartFunction } from 'react';
3
3
  import './index.scss';
4
4
  export interface LinkProps extends ComponentProps<'a'> {
5
5
  href?: string;
6
6
  children?: React.ReactNode;
7
7
  className?: string;
8
8
  onMouseEnter?: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
9
+ /**
10
+ * Get isPending state of Link navigation
11
+ *
12
+ * ```tsx
13
+ * const [isPending, startTransition] = useTransition();
14
+ * <Link
15
+ * href="/some-path"
16
+ * startTransition={startTransition}
17
+ * >
18
+ * Some Link
19
+ * </Link>
20
+ * ```
21
+ *
22
+ * @private
23
+ * @unstable
24
+ */
25
+ startTransition?: TransitionStartFunction;
9
26
  }
10
27
  /**
11
28
  * What's the difference between <Link> and <a>?