@umijs/plugin-docs 4.0.0-rc.17 → 4.0.0-rc.18

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.
@@ -95,9 +95,19 @@ export default () => {
95
95
  className={cx(
96
96
  'absolute transition-all duration-500 top-12 w-96 rounded-lg',
97
97
  'cursor-pointer shadow overflow-hidden',
98
- result.length > 0 && isFocused ? 'max-h-80' : 'max-h-0',
98
+ keyword && isFocused ? 'max-h-80' : 'max-h-0',
99
99
  )}
100
100
  >
101
+ {keyword && result.length === 0 && (
102
+ <div>
103
+ <p
104
+ className="p-2 bg-white hover:bg-gray-50 transition
105
+ duration-300 group-focus:bg-blue-200 dark:bg-gray-700"
106
+ >
107
+ {render('No result for')} "{keyword}"
108
+ </p>
109
+ </div>
110
+ )}
101
111
  {result.map((r, i) => (
102
112
  <components.Link
103
113
  to={(isFromPath ? currentLanguage?.locale : '') + r.href}
@@ -63,7 +63,8 @@ export default (props: SidebarProps) => {
63
63
  return (
64
64
  <components.Link
65
65
  key={route.path}
66
- to={route.path}
66
+ to={to.startsWith('/') ? to : `/${to}`}
67
+ prefetch
67
68
  onClick={() =>
68
69
  props.setMenuOpened && props.setMenuOpened((o) => !o)
69
70
  }
package/dist/index.js CHANGED
@@ -143,7 +143,7 @@ export default () => {
143
143
  </Layout>
144
144
  );
145
145
  };
146
- `,
146
+ `,
147
147
  });
148
148
  });
149
149
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugin-docs",
3
- "version": "4.0.0-rc.17",
3
+ "version": "4.0.0-rc.18",
4
4
  "description": "@umijs/plugin-docs",
5
5
  "homepage": "https://github.com/umijs/umi-next/tree/master/packages/plugin-docs#readme",
6
6
  "bugs": "https://github.com/umijs/umi-next/issues",
@@ -20,7 +20,7 @@
20
20
  "build": "pnpm tsc",
21
21
  "build:css": "tailwindcss -i ./client/theme-doc/tailwind.css -o ./client/theme-doc/tailwind.out.css",
22
22
  "build:deps": "umi-scripts bundleDeps",
23
- "build:extra": "pnpm build:css && pnpm build:deps",
23
+ "build:extra": "pnpm build:css",
24
24
  "dev": "pnpm build -- --watch",
25
25
  "dev:css": "pnpm build:css -- --watch",
26
26
  "test": "umi-scripts jest-turbo"
@@ -39,7 +39,7 @@
39
39
  "rehype-slug": "5.0.1",
40
40
  "remark-gfm": "^3.0.1",
41
41
  "tailwindcss": "^3.0.24",
42
- "umi": "4.0.0-rc.17"
42
+ "umi": "4.0.0-rc.18"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"