@rspress/plugin-algolia 2.0.0-beta.0 → 2.0.0-beta.10

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,37 @@
1
1
  .DocSearch {
2
- --docsearch-searchbox-background: var(--rp-c-bg-mute);
3
2
  align-self: center;
4
3
  }
5
4
 
5
+ html:not(.rp-dark) {
6
+ & [class*="DocSearch"] {
7
+ --docsearch-searchbox-background: var(--rp-c-bg-mute);
8
+ --docsearch-primary-color: var(--rp-c-brand);
9
+ --docsearch-highlight-color: var(--docsearch-primary-color);
10
+ --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);
11
+ }
12
+ }
13
+
14
+ html.rp-dark [class*="DocSearch"] {
15
+ --docsearch-searchbox-background: var(--rp-c-bg-mute);
16
+ --docsearch-primary-color: var(--rp-c-brand);
17
+ --docsearch-highlight-color: var(--docsearch-primary-color);
18
+ --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);
19
+ --docsearch-searchbox-focus-background: var(--rp-c-bg-mute);
20
+ --docsearch-modal-shadow: none;
21
+ --docsearch-footer-shadow: none;
22
+ --docsearch-logo-color: var(--rp-c-text-2);
23
+ --docsearch-hit-background: var(--rp-c-dark-light-1);
24
+ --docsearch-hit-color: var(--rp-c-text-2);
25
+ --docsearch-hit-shadow: none;
26
+ --docsearch-modal-background: var(--rp-c-bg);
27
+ --docsearch-footer-background: var(--rp-c-bg);
28
+ --docsearch-key-gradient: var(--rp-c-bg);
29
+ --docsearch-key-shadow: var(--rp-c-bg-mute);
30
+ --docsearch-text-color: var(--rp-c-text-2);
31
+ --docsearch-muted-color: var(--rp-c-text-2);
32
+ --docsearch-key-pressed-shadow: none;
33
+ }
34
+
6
35
  @media (width <= 768px) {
7
36
  .DocSearch {
8
37
  --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,11 +1,11 @@
1
1
  {
2
2
  "name": "@rspress/plugin-algolia",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.10",
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": {
7
7
  "type": "git",
8
- "url": "https://github.com/web-infra-dev/rspress",
8
+ "url": "git+https://github.com/web-infra-dev/rspress.git",
9
9
  "directory": "packages/plugin-algolia"
10
10
  },
11
11
  "license": "MIT",
@@ -35,29 +35,26 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@docsearch/css": "^3.9.0",
38
- "@docsearch/react": "^3.9.0",
39
- "algoliasearch": "^5.23.4",
40
- "instantsearch.css": "^8.5.1",
41
- "instantsearch.js": "^4.78.1",
42
- "react-instantsearch": "^7.15.5"
38
+ "@docsearch/react": "^3.9.0"
43
39
  },
44
40
  "devDependencies": {
45
- "@microsoft/api-extractor": "^7.52.4",
46
- "@rsbuild/plugin-react": "~1.1.1",
47
- "@rslib/core": "0.6.5",
48
- "@types/node": "^18.11.17",
49
- "@types/react": "^18.3.20",
50
- "@types/react-dom": "^18.3.6",
41
+ "@microsoft/api-extractor": "^7.52.8",
42
+ "@rsbuild/plugin-react": "~1.3.1",
43
+ "@rslib/core": "0.8.0",
44
+ "@types/node": "^22.8.1",
45
+ "@types/react": "^18.3.22",
46
+ "@types/react-dom": "^18.3.7",
51
47
  "react": "^19.1.0",
48
+ "rsbuild-plugin-publint": "^0.3.2",
52
49
  "typescript": "^5.8.2",
53
- "@rspress/shared": "2.0.0-beta.0",
54
- "@rspress/config": "1.0.0"
50
+ "@rspress/config": "1.0.0",
51
+ "@rspress/shared": "2.0.0-beta.10"
55
52
  },
56
53
  "peerDependencies": {
57
- "@rspress/runtime": "^2.0.0-beta.0"
54
+ "@rspress/runtime": "^2.0.0-beta.10"
58
55
  },
59
56
  "engines": {
60
- "node": ">=14.17.6"
57
+ "node": ">=18.0.0"
61
58
  },
62
59
  "publishConfig": {
63
60
  "access": "public",