@rspress/core 0.0.0-next-20230816082004 → 0.0.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.
@@ -492,9 +492,6 @@ video {
492
492
  .mb-6 {
493
493
  margin-bottom: 1.5rem;
494
494
  }
495
- .ml-1 {
496
- margin-left: 0.25rem;
497
- }
498
495
  .ml-2 {
499
496
  margin-left: 0.5rem;
500
497
  }
@@ -1118,8 +1115,8 @@ button:focus-visible {
1118
1115
  .sm\:max-h-60 {
1119
1116
  max-height: 15rem;
1120
1117
  }
1121
- .sm\:max-w-3xl {
1122
- max-width: 48rem;
1118
+ .sm\:max-w-4xl {
1119
+ max-width: 56rem;
1123
1120
  }
1124
1121
  .sm\:max-w-60 {
1125
1122
  max-width: 15rem;
@@ -1576,7 +1573,7 @@ button:focus-visible {
1576
1573
  transition: color 0.25s;
1577
1574
  }
1578
1575
 
1579
- /* src/theme-default/components/Sidebar/index.module.scss?css_virtual&hash=7e3e6dc29f1675a22ccfaea6330803a3 */
1576
+ /* src/theme-default/components/Sidebar/index.module.scss?css_virtual&hash=216ef40daf46085bca8564b5ed4873ec */
1580
1577
  .sidebar_74484 {
1581
1578
  position: fixed;
1582
1579
  top: 0;
@@ -1660,6 +1657,18 @@ button:focus-visible {
1660
1657
  color: var(--modern-c-brand);
1661
1658
  font-weight: bolder;
1662
1659
  }
1660
+ .modern-sidebar-group {
1661
+ position: relative;
1662
+ }
1663
+ .modern-sidebar-group::before {
1664
+ content: "";
1665
+ position: absolute;
1666
+ top: 0;
1667
+ left: 12px;
1668
+ width: 1px;
1669
+ height: 100%;
1670
+ background-color: var(--modern-c-gray-light-4);
1671
+ }
1663
1672
 
1664
1673
  /* src/theme-default/components/LocalSideBar/index.module.scss?css_virtual&hash=67f7f8e1a957b3ce3eda19e391dcbed9 */
1665
1674
  .localNav_dce60 {
@@ -936,10 +936,9 @@ function _object_spread_props4(target, source) {
936
936
  }
937
937
  return target;
938
938
  }
939
- var textEllipsisStyle = {
940
- whiteSpace: "nowrap",
941
- overflow: "hidden",
942
- textOverflow: "ellipsis"
939
+ var highlightTitleStyle = {
940
+ color: "var(--modern-c-text-1)",
941
+ fontSize: "14px"
943
942
  };
944
943
  function SidebarItemComp(props) {
945
944
  const { item, depth = 0, activeMatcher, id, setSidebarData } = props;
@@ -971,12 +970,12 @@ function SidebarItemComp(props) {
971
970
  children: /* @__PURE__ */ _jsxs5("div", {
972
971
  ref,
973
972
  onMouseEnter: () => props.preloadLink(item.link),
974
- className: `${active ? index_module_default4.menuItemActive : index_module_default4.menuItem} mt-1 py-1.5 px-3 rounded-xl font-medium flex`,
975
- style: _object_spread_props4(_object_spread5({}, textEllipsisStyle), {
973
+ className: `${active ? index_module_default4.menuItemActive : index_module_default4.menuItem} mt-1 py-1.5 px-2 rounded-xl font-medium flex`,
974
+ style: _object_spread5({
976
975
  // The first level menu item will have the same font size as the sidebar group
977
976
  fontSize: depth === 0 ? "14px" : "13px",
978
- marginLeft: depth === 0 ? 0 : "12px"
979
- }),
977
+ marginLeft: depth === 0 ? 0 : "20px"
978
+ }, depth === 0 ? highlightTitleStyle : {}),
980
979
  children: [
981
980
  /* @__PURE__ */ _jsx9(Tag, {
982
981
  tag: item.tag
@@ -1066,7 +1065,7 @@ function SidebarGroupComp(props) {
1066
1065
  return /* @__PURE__ */ _jsxs5("section", {
1067
1066
  className: "mt-1 block",
1068
1067
  style: {
1069
- marginLeft: depth === 0 ? 0 : "12px"
1068
+ marginLeft: depth === 0 ? 0 : "20px"
1070
1069
  },
1071
1070
  children: [
1072
1071
  /* @__PURE__ */ _jsxs5("div", {
@@ -1086,8 +1085,8 @@ function SidebarGroupComp(props) {
1086
1085
  },
1087
1086
  children: [
1088
1087
  /* @__PURE__ */ _jsxs5("h2", {
1089
- className: "py-1 px-2 text-sm font-medium ml-1 flex",
1090
- style: _object_spread5({}, textEllipsisStyle),
1088
+ className: "py-1 px-2 text-sm font-medium flex",
1089
+ style: _object_spread5({}, depth === 0 ? highlightTitleStyle : {}),
1091
1090
  children: [
1092
1091
  /* @__PURE__ */ _jsx9(Tag, {
1093
1092
  tag: item.tag
@@ -1111,7 +1110,7 @@ function SidebarGroupComp(props) {
1111
1110
  },
1112
1111
  children: /* @__PURE__ */ _jsx9("div", {
1113
1112
  ref: innerRef,
1114
- className: "transition-opacity duration-500 ease-in-out",
1113
+ className: "modern-sidebar-group transition-opacity duration-500 ease-in-out",
1115
1114
  style: {
1116
1115
  opacity: initialState.current ? 0 : 1
1117
1116
  },
@@ -1712,7 +1711,7 @@ var Layout = (props) => {
1712
1711
  }
1713
1712
  };
1714
1713
  useEffect6(() => {
1715
- if (!defaultLang) {
1714
+ if (!defaultLang || process.env.TEST === "1") {
1716
1715
  return;
1717
1716
  }
1718
1717
  const { pathname } = window.location;
@@ -1828,7 +1827,7 @@ function HomeHero({ frontmatter }) {
1828
1827
  className: "m-auto flex flex-col md:flex-row max-w-6xl",
1829
1828
  children: [
1830
1829
  /* @__PURE__ */ _jsxs10("div", {
1831
- className: "flex flex-col justify-center text-center max-w-xl sm:max-w-3xl m-auto order-2 md:order-1",
1830
+ className: "flex flex-col justify-center text-center max-w-xl sm:max-w-4xl m-auto order-2 md:order-1",
1832
1831
  children: [
1833
1832
  /* @__PURE__ */ _jsx15("h1", {
1834
1833
  className: "font-bold text-3xl sm:text-6xl md:text-7xl m-auto sm:m-4 md:m-0 md:pb-3 lg:pb-5 leading-tight z-10",
@@ -1841,7 +1840,7 @@ function HomeHero({ frontmatter }) {
1841
1840
  })
1842
1841
  }),
1843
1842
  ((_hero_text = hero.text) === null || _hero_text === void 0 ? void 0 : _hero_text.length) && /* @__PURE__ */ _jsx15("p", {
1844
- className: `mx-auto md:m-0 text-3xl sm:text-5xl md:text-6xl pb-2 font-bold z-10 max-w-392px ${hasImage ? "sm:max-w-xl" : "sm:max-w-3xl"}`,
1843
+ className: `mx-auto md:m-0 text-3xl sm:text-5xl md:text-6xl pb-2 font-bold z-10 max-w-392px ${hasImage ? "sm:max-w-xl" : "sm:max-w-4xl"}`,
1845
1844
  style: {
1846
1845
  lineHeight: "1.15"
1847
1846
  },
@@ -5423,12 +5422,16 @@ function Search2() {
5423
5422
  }
5424
5423
  break;
5425
5424
  case KEY_CODE.ARROW_DOWN:
5426
- e.preventDefault();
5427
- setCurrentSuggestionIndex((currentSuggestionIndex + 1) % suggestions.length);
5425
+ if (focused) {
5426
+ e.preventDefault();
5427
+ setCurrentSuggestionIndex((currentSuggestionIndex + 1) % suggestions.length);
5428
+ }
5428
5429
  break;
5429
5430
  case KEY_CODE.ARROW_UP:
5430
- e.preventDefault();
5431
- setCurrentSuggestionIndex((currentSuggestionIndex - 1 + suggestions.length) % suggestions.length);
5431
+ if (focused) {
5432
+ e.preventDefault();
5433
+ setCurrentSuggestionIndex((currentSuggestionIndex - 1 + suggestions.length) % suggestions.length);
5434
+ }
5432
5435
  break;
5433
5436
  case KEY_CODE.ENTER:
5434
5437
  if (currentSuggestionIndex >= 0) {
@@ -6061,9 +6064,13 @@ var A = (props) => {
6061
6064
  const defaultLang = pageData.siteData.lang;
6062
6065
  if (defaultLang && !isExternalUrl(href) && !href.startsWith("#")) {
6063
6066
  href = normalizeSlash2(href);
6064
- if (lang !== defaultLang && !removeBase3(href).startsWith(`/${lang}`)) {
6067
+ const startWithLang = removeBase3(href).startsWith(`/${lang}`);
6068
+ if (lang !== defaultLang && !startWithLang) {
6065
6069
  href = `/${lang}${href}`;
6066
6070
  }
6071
+ if (lang === defaultLang && startWithLang) {
6072
+ href = removeBase3(href).replace(`/${lang}`, "");
6073
+ }
6067
6074
  href = withBase8(href || "");
6068
6075
  }
6069
6076
  return /* @__PURE__ */ _jsx53("a", _object_spread_props30(_object_spread34({}, props), {