@rspress/plugin-algolia 2.0.16 → 2.0.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.
package/dist/runtime/Search.js
CHANGED
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { DocSearch } from "@docsearch/react";
|
|
3
|
-
import { removeBase, useLang
|
|
4
|
-
import { Link } from "@rspress/core/theme";
|
|
3
|
+
import { removeBase, useLang } from "@rspress/core/runtime";
|
|
4
|
+
import { Link, useLinkNavigate } from "@rspress/core/theme";
|
|
5
5
|
import "@docsearch/css";
|
|
6
6
|
import "./Search.css";
|
|
7
7
|
import { useEffect } from "react";
|
|
8
|
-
import * as
|
|
8
|
+
import * as __rspack_external_react_dom_20ef40a6 from "react-dom";
|
|
9
9
|
const Hit = ({ hit, children })=>/*#__PURE__*/ jsx(Link, {
|
|
10
10
|
href: hit.url,
|
|
11
11
|
children: children
|
|
12
12
|
});
|
|
13
|
-
const safePreconnect =
|
|
13
|
+
const safePreconnect = __rspack_external_react_dom_20ef40a6.preconnect;
|
|
14
14
|
function Search({ locales = {}, docSearchProps }) {
|
|
15
|
-
const navigate =
|
|
15
|
+
const navigate = useLinkNavigate();
|
|
16
16
|
const lang = useLang();
|
|
17
17
|
const { translations, placeholder } = locales?.[lang] ?? {};
|
|
18
18
|
const appId = docSearchProps.appId;
|
|
19
19
|
if (appId) {
|
|
20
|
-
|
|
21
|
-
if ('function' == typeof safePreconnect) safePreconnect(algoliaUrl, {
|
|
20
|
+
if ('function' == typeof safePreconnect) safePreconnect(`https://${appId}-dsn.algolia.net`, {
|
|
22
21
|
crossOrigin: ''
|
|
23
22
|
});
|
|
24
23
|
}
|
|
25
24
|
useEffect(()=>{
|
|
26
25
|
if (!appId || 'function' == typeof safePreconnect) return;
|
|
27
|
-
const algoliaUrl = `https://${appId}-dsn.algolia.net`;
|
|
28
26
|
const preconnect = document.createElement('link');
|
|
29
27
|
preconnect.id = appId;
|
|
30
28
|
preconnect.rel = 'preconnect';
|
|
31
|
-
preconnect.href =
|
|
29
|
+
preconnect.href = `https://${appId}-dsn.algolia.net`;
|
|
32
30
|
preconnect.crossOrigin = '';
|
|
33
31
|
document.head.appendChild(preconnect);
|
|
34
32
|
return ()=>{
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type Locales, RU_LOCALES, ZH_LOCALES } from './locales.js';
|
|
1
|
+
export { type Locales, RU_LOCALES, ZH_LOCALES, TA_LOCALES } from './locales.js';
|
|
2
2
|
export { Search, type SearchProps } from './Search.js';
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RU_LOCALES, ZH_LOCALES } from "./locales.js";
|
|
1
|
+
export { RU_LOCALES, TA_LOCALES, ZH_LOCALES } from "./locales.js";
|
|
2
2
|
export { Search } from "./Search.js";
|
package/dist/runtime/locales.js
CHANGED
|
@@ -84,4 +84,47 @@ const RU_LOCALES = {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
const TA_LOCALES = {
|
|
88
|
+
ta: {
|
|
89
|
+
placeholder: 'ஆவணங்களைத் தேடுக...',
|
|
90
|
+
translations: {
|
|
91
|
+
button: {
|
|
92
|
+
buttonText: 'தேடுக',
|
|
93
|
+
buttonAriaLabel: 'தேடுக'
|
|
94
|
+
},
|
|
95
|
+
modal: {
|
|
96
|
+
searchBox: {
|
|
97
|
+
clearButtonTitle: 'தேடலை நீக்கவும்',
|
|
98
|
+
clearButtonAriaLabel: 'தேடலை நீக்கவும்',
|
|
99
|
+
closeButtonText: 'இரத்து செய்',
|
|
100
|
+
closeButtonAriaLabel: 'இரத்து செய்'
|
|
101
|
+
},
|
|
102
|
+
startScreen: {
|
|
103
|
+
recentSearchesTitle: 'சமீபத்திய தேடல்கள்',
|
|
104
|
+
noRecentSearchesText: 'சமீபத்திய தேடல்கள் எதுவும் இல்லை',
|
|
105
|
+
saveRecentSearchButtonTitle: 'தேடல் வரலாற்றில் சேர்க்கவும்',
|
|
106
|
+
removeRecentSearchButtonTitle: 'தேடல் வரலாற்றிலிருந்து நீக்கவும்',
|
|
107
|
+
favoriteSearchesTitle: 'பிடித்தவை',
|
|
108
|
+
removeFavoriteSearchButtonTitle: 'பிடித்தவையிலிருந்து நீக்கவும்'
|
|
109
|
+
},
|
|
110
|
+
errorScreen: {
|
|
111
|
+
titleText: 'முடிவுகளைப் பெற முடியவில்லை',
|
|
112
|
+
helpText: 'உங்கள் இணைய இணைப்பைச் சரிபார்க்கவும்'
|
|
113
|
+
},
|
|
114
|
+
footer: {
|
|
115
|
+
selectText: 'தேர்ந்தெடுக்க',
|
|
116
|
+
navigateText: 'நகர்த்த',
|
|
117
|
+
closeText: 'மூட',
|
|
118
|
+
poweredByText: 'வழங்குபவர்'
|
|
119
|
+
},
|
|
120
|
+
noResultsScreen: {
|
|
121
|
+
noResultsText: 'முடிவுகள் கிடைக்கவில்லை',
|
|
122
|
+
suggestedQueryText: 'இவற்றைத் தேட முயற்சிக்கவும்',
|
|
123
|
+
reportMissingResultsText: 'இதற்கு முடிவுகள் கிடைத்திருக்க வேண்டும் என நினைக்கிறீர்களா?',
|
|
124
|
+
reportMissingResultsLinkText: 'எங்களுக்குத் தெரியப்படுத்துங்கள்'
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
export { RU_LOCALES, TA_LOCALES, ZH_LOCALES };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/plugin-algolia",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.18",
|
|
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": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@microsoft/api-extractor": "^7.58.9",
|
|
42
|
-
"@rsbuild/plugin-react": "~2.0
|
|
43
|
-
"@rslib/core": "0.23.
|
|
42
|
+
"@rsbuild/plugin-react": "~2.1.0",
|
|
43
|
+
"@rslib/core": "0.23.2",
|
|
44
44
|
"@types/node": "^22.8.1",
|
|
45
45
|
"@types/react": "^19.2.17",
|
|
46
46
|
"@types/react-dom": "^19.2.3",
|