@rspress/plugin-algolia 2.0.0-beta.3 → 2.0.0-beta.5

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.
@@ -1,8 +1,32 @@
1
1
  .DocSearch {
2
- --docsearch-searchbox-background: var(--rp-c-bg-mute);
3
2
  align-self: center;
4
3
  }
5
4
 
5
+ :not(:has(.rp-dark)) {
6
+ & [class*="DocSearch"] {
7
+ --docsearch-searchbox-background: var(--rp-c-bg-mute);
8
+ --docsearch-primary-color: var(--rp-c-brand);
9
+ }
10
+ }
11
+
12
+ .rp-dark [class*="DocSearch"] {
13
+ --docsearch-searchbox-background: var(--rp-c-bg-mute);
14
+ --docsearch-searchbox-focus-background: var(--rp-c-bg-mute);
15
+ --docsearch-modal-shadow: none;
16
+ --docsearch-footer-shadow: none;
17
+ --docsearch-logo-color: var(--rp-c-text-2);
18
+ --docsearch-hit-background: var(--rp-c-dark-light-1);
19
+ --docsearch-hit-color: var(--rp-c-text-2);
20
+ --docsearch-hit-shadow: none;
21
+ --docsearch-modal-background: var(--rp-c-bg);
22
+ --docsearch-footer-background: var(--rp-c-bg);
23
+ --docsearch-key-gradient: var(--rp-c-bg);
24
+ --docsearch-key-shadow: var(--rp-c-bg-mute);
25
+ --docsearch-text-color: var(--rp-c-text-2);
26
+ --docsearch-muted-color: var(--rp-c-text-2);
27
+ --docsearch-key-pressed-shadow: none;
28
+ }
29
+
6
30
  @media (width <= 768px) {
7
31
  .DocSearch {
8
32
  --docsearch-searchbox-background: transparent;
@@ -1,7 +1,7 @@
1
1
  import type { DocSearchProps } from '@docsearch/react';
2
2
  import '@docsearch/css';
3
3
  import './Search.css';
4
- import type { Locales } from './locales';
4
+ import type { Locales } from './locales.js';
5
5
  type SearchProps = {
6
6
  /**
7
7
  * @link https://docsearch.algolia.com/docs/api
@@ -1,2 +1,2 @@
1
- export { Search, type SearchProps } from './Search';
2
- export { type Locales, ZH_LOCALES } from './locales';
1
+ export { Search, type SearchProps } from './Search.js';
2
+ export { type Locales, ZH_LOCALES } from './locales.js';
@@ -1,41 +1,41 @@
1
1
  const ZH_LOCALES = {
2
2
  zh: {
3
- placeholder: '搜索文档',
3
+ placeholder: "\u641C\u7D22\u6587\u6863",
4
4
  translations: {
5
5
  button: {
6
- buttonText: '搜索',
7
- buttonAriaLabel: '搜索'
6
+ buttonText: "\u641C\u7D22",
7
+ buttonAriaLabel: "\u641C\u7D22"
8
8
  },
9
9
  modal: {
10
10
  searchBox: {
11
- resetButtonTitle: '清除查询条件',
12
- resetButtonAriaLabel: '清除查询条件',
13
- cancelButtonText: '取消',
14
- cancelButtonAriaLabel: '取消'
11
+ resetButtonTitle: "\u6E05\u9664\u67E5\u8BE2\u6761\u4EF6",
12
+ resetButtonAriaLabel: "\u6E05\u9664\u67E5\u8BE2\u6761\u4EF6",
13
+ cancelButtonText: "\u53D6\u6D88",
14
+ cancelButtonAriaLabel: "\u53D6\u6D88"
15
15
  },
16
16
  startScreen: {
17
- recentSearchesTitle: '搜索历史',
18
- noRecentSearchesText: '没有搜索历史',
19
- saveRecentSearchButtonTitle: '保存至搜索历史',
20
- removeRecentSearchButtonTitle: '从搜索历史中移除',
21
- favoriteSearchesTitle: '收藏',
22
- removeFavoriteSearchButtonTitle: '从收藏中移除'
17
+ recentSearchesTitle: "\u641C\u7D22\u5386\u53F2",
18
+ noRecentSearchesText: "\u6CA1\u6709\u641C\u7D22\u5386\u53F2",
19
+ saveRecentSearchButtonTitle: "\u4FDD\u5B58\u81F3\u641C\u7D22\u5386\u53F2",
20
+ removeRecentSearchButtonTitle: "\u4ECE\u641C\u7D22\u5386\u53F2\u4E2D\u79FB\u9664",
21
+ favoriteSearchesTitle: "\u6536\u85CF",
22
+ removeFavoriteSearchButtonTitle: "\u4ECE\u6536\u85CF\u4E2D\u79FB\u9664"
23
23
  },
24
24
  errorScreen: {
25
- titleText: '无法获取结果',
26
- helpText: '你可能需要检查你的网络连接'
25
+ titleText: "\u65E0\u6CD5\u83B7\u53D6\u7ED3\u679C",
26
+ helpText: "\u4F60\u53EF\u80FD\u9700\u8981\u68C0\u67E5\u4F60\u7684\u7F51\u7EDC\u8FDE\u63A5"
27
27
  },
28
28
  footer: {
29
- selectText: '选择',
30
- navigateText: '切换',
31
- closeText: '关闭',
32
- searchByText: '搜索提供者'
29
+ selectText: "\u9009\u62E9",
30
+ navigateText: "\u5207\u6362",
31
+ closeText: "\u5173\u95ED",
32
+ searchByText: "\u641C\u7D22\u63D0\u4F9B\u8005"
33
33
  },
34
34
  noResultsScreen: {
35
- noResultsText: '无法找到相关结果',
36
- suggestedQueryText: '你可以尝试查询',
37
- reportMissingResultsText: '你认为该查询应该有结果?',
38
- reportMissingResultsLinkText: '点击反馈'
35
+ noResultsText: "\u65E0\u6CD5\u627E\u5230\u76F8\u5173\u7ED3\u679C",
36
+ suggestedQueryText: "\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u67E5\u8BE2",
37
+ reportMissingResultsText: "\u4F60\u8BA4\u4E3A\u8BE5\u67E5\u8BE2\u5E94\u8BE5\u6709\u7ED3\u679C\uFF1F",
38
+ reportMissingResultsLinkText: "\u70B9\u51FB\u53CD\u9988"
39
39
  }
40
40
  }
41
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/plugin-algolia",
3
- "version": "2.0.0-beta.3",
3
+ "version": "2.0.0-beta.5",
4
4
  "description": "A plugin for rspress to search with algolia in docs.",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -38,20 +38,20 @@
38
38
  "@docsearch/react": "^3.9.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@microsoft/api-extractor": "^7.52.5",
42
- "@rsbuild/plugin-react": "~1.1.1",
43
- "@rslib/core": "0.6.7",
41
+ "@microsoft/api-extractor": "^7.52.7",
42
+ "@rsbuild/plugin-react": "~1.3.0",
43
+ "@rslib/core": "0.6.8",
44
44
  "@types/node": "^18.11.17",
45
- "@types/react": "^18.3.20",
46
- "@types/react-dom": "^18.3.6",
45
+ "@types/react": "^18.3.21",
46
+ "@types/react-dom": "^18.3.7",
47
47
  "react": "^19.1.0",
48
48
  "rsbuild-plugin-publint": "^0.3.1",
49
49
  "typescript": "^5.8.2",
50
50
  "@rspress/config": "1.0.0",
51
- "@rspress/shared": "2.0.0-beta.3"
51
+ "@rspress/shared": "2.0.0-beta.5"
52
52
  },
53
53
  "peerDependencies": {
54
- "@rspress/runtime": "^2.0.0-beta.3"
54
+ "@rspress/runtime": "^2.0.0-beta.5"
55
55
  },
56
56
  "engines": {
57
57
  "node": ">=18.0.0"