@rspress-theme-anatole/theme-default 0.2.2 → 0.2.4

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 (2) hide show
  1. package/dist/bundle.js +34 -16
  2. package/package.json +3 -3
package/dist/bundle.js CHANGED
@@ -3128,9 +3128,10 @@ function NavMenuSingleItem(item) {
3128
3128
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("i", {
3129
3129
  className: item.rightIcon,
3130
3130
  style: {
3131
- marginLeft: '8px',
3131
+ marginLeft: item.text && item.rightIcon ? '8px' : '0',
3132
3132
  fontSize: '12px',
3133
- verticalAlign: 'middle'
3133
+ verticalAlign: 'middle',
3134
+ marginTop: '2.5px'
3134
3135
  }
3135
3136
  })
3136
3137
  ]
@@ -3847,22 +3848,39 @@ function Nav(props) {
3847
3848
  }, []);
3848
3849
  const NavMenu = ({ menuItems }) => (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
3849
3850
  className: "rspress-nav-menu menu h-14",
3850
- children: menuItems.map((item) => 'items' in item || Array.isArray(item) ? (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
3851
- className: "mx-3 last:mr-0",
3852
- children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(NavMenuGroup, {
3853
- ...item,
3851
+ children: [
3852
+ ((pathname !== '/index.html' && pathname !== '/') ? (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(NavMenuSingleItem, {
3853
+ link: pathname,
3854
+ onClick: () => {
3855
+ document.querySelector('.rspress-nav-search-button').click();
3856
+ },
3857
+ activeMatch: '/search',
3858
+ rightIcon: 'fa-solid fa-magnifying-glass',
3854
3859
  base: base,
3855
3860
  pathname: pathname,
3856
- langs: langs,
3857
- items: 'items' in item ? item.items : item
3858
- })
3859
- }, item.text) : (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(NavMenuSingleItem, {
3860
- pathname: pathname,
3861
- langs: langs,
3862
- base: base,
3863
- compact: menuItems.length > 5,
3864
- ...item
3865
- }, item.link))
3861
+ compact: menuItems.length > 5,
3862
+ }, "rspress-nav-search") : null),
3863
+ menuItems.map((item) =>
3864
+ 'items' in item || Array.isArray(item) ?
3865
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
3866
+ className: "mx-3 last:mr-0",
3867
+ children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(NavMenuGroup, {
3868
+ ...item,
3869
+ base: base,
3870
+ pathname: pathname,
3871
+ langs: langs,
3872
+ items: 'items' in item ? item.items : item
3873
+ })
3874
+ }, item.text)
3875
+ :
3876
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(NavMenuSingleItem, {
3877
+ pathname: pathname,
3878
+ langs: langs,
3879
+ base: base,
3880
+ compact: menuItems.length > 5,
3881
+ ...item
3882
+ }, item.link))
3883
+ ]
3866
3884
  });
3867
3885
  const menuItems = useNavData();
3868
3886
  const getPosition = (menuItem) => menuItem.position ?? DEFAULT_NAV_POSITION;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rspress-theme-anatole/theme-default",
3
3
  "author": "Anatole Tong",
4
- "version": "0.2.2",
4
+ "version": "0.2.4",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
7
7
  "*.css",
@@ -21,7 +21,7 @@
21
21
  "types": "./dist/bundle.d.ts",
22
22
  "dependencies": {
23
23
  "@mdx-js/react": "2.3.0",
24
- "@rspress-theme-anatole/shared": "0.2.2",
24
+ "@rspress-theme-anatole/shared": "0.2.4",
25
25
  "@rspress/runtime": "1.43.8",
26
26
  "body-scroll-lock": "4.0.0-beta.0",
27
27
  "copy-to-clipboard": "^3.3.3",
@@ -35,7 +35,7 @@
35
35
  "react-helmet-async": "^1.3.0",
36
36
  "react-router-dom": "6.29.0",
37
37
  "react-syntax-highlighter": "^15.6.1",
38
- "@rspress-theme-anatole/rspress-plugin-mermaid": "0.2.2"
38
+ "@rspress-theme-anatole/rspress-plugin-mermaid": "0.2.4"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@microsoft/api-extractor": "^7.49.2",