@docusaurus/theme-search-algolia 2.0.0-beta.21 → 2.0.0-beta.22

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.
@@ -11,10 +11,12 @@ import {useHistory} from '@docusaurus/router';
11
11
  import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
12
12
  import Link from '@docusaurus/Link';
13
13
  import Head from '@docusaurus/Head';
14
- import {isRegexpStringMatch, useSearchPage} from '@docusaurus/theme-common';
14
+ import {isRegexpStringMatch} from '@docusaurus/theme-common';
15
+ import {useSearchPage} from '@docusaurus/theme-common/internal';
15
16
  import {DocSearchButton, useDocSearchKeyboardEvents} from '@docsearch/react';
16
17
  import {useAlgoliaContextualFacetFilters} from '@docusaurus/theme-search-algolia/client';
17
- import Translate, {translate} from '@docusaurus/Translate';
18
+ import Translate from '@docusaurus/Translate';
19
+ import translations from '@theme/SearchTranslations';
18
20
  let DocSearchModal = null;
19
21
  function Hit({hit, children}) {
20
22
  return <Link to={hit.url}>{children}</Link>;
@@ -140,11 +142,6 @@ function DocSearch({contextualSearch, externalUrlRegex, ...props}) {
140
142
  onInput,
141
143
  searchButtonRef,
142
144
  });
143
- const translatedSearchLabel = translate({
144
- id: 'theme.SearchBar.label',
145
- message: 'Search',
146
- description: 'The ARIA label and placeholder for search button',
147
- });
148
145
  return (
149
146
  <>
150
147
  <Head>
@@ -164,10 +161,7 @@ function DocSearch({contextualSearch, externalUrlRegex, ...props}) {
164
161
  onMouseOver={importDocSearchModalIfNeeded}
165
162
  onClick={onOpen}
166
163
  ref={searchButtonRef}
167
- translations={{
168
- buttonText: translatedSearchLabel,
169
- buttonAriaLabel: translatedSearchLabel,
170
- }}
164
+ translations={translations.button}
171
165
  />
172
166
 
173
167
  {isOpen &&
@@ -187,6 +181,8 @@ function DocSearch({contextualSearch, externalUrlRegex, ...props}) {
187
181
  })}
188
182
  {...props}
189
183
  searchParameters={searchParameters}
184
+ placeholder={translations.placeholder}
185
+ translations={translations.modal}
190
186
  />,
191
187
  searchContainer.current,
192
188
  )}
@@ -14,12 +14,14 @@ import Link from '@docusaurus/Link';
14
14
  import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
15
15
  import {
16
16
  HtmlClassNameProvider,
17
- useTitleFormatter,
18
17
  usePluralForm,
19
18
  isRegexpStringMatch,
20
- useDynamicCallback,
21
- useSearchPage,
19
+ useEvent,
22
20
  } from '@docusaurus/theme-common';
21
+ import {
22
+ useTitleFormatter,
23
+ useSearchPage,
24
+ } from '@docusaurus/theme-common/internal';
23
25
  import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
24
26
  import {useAllDocsData} from '@docusaurus/plugin-content-docs/client';
25
27
  import Translate, {translate} from '@docusaurus/Translate';
@@ -254,7 +256,7 @@ function SearchPageContent() {
254
256
  message: 'Search the documentation',
255
257
  description: 'The search page title for empty query',
256
258
  });
257
- const makeSearch = useDynamicCallback((page = 0) => {
259
+ const makeSearch = useEvent((page = 0) => {
258
260
  algoliaHelper.addDisjunctiveFacetRefinement('docusaurus_tag', 'default');
259
261
  algoliaHelper.addDisjunctiveFacetRefinement('language', currentLocale);
260
262
  Object.entries(docsSearchVersionsHelpers.searchVersions).forEach(
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import type { DocSearchTranslations } from '@docsearch/react';
8
+ declare const translations: DocSearchTranslations & {
9
+ placeholder: string;
10
+ };
11
+ export default translations;
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import {translate} from '@docusaurus/Translate';
8
+ const translations = {
9
+ button: {
10
+ buttonText: translate({
11
+ id: 'theme.SearchBar.label',
12
+ message: 'Search',
13
+ description: 'The ARIA label and placeholder for search button',
14
+ }),
15
+ buttonAriaLabel: translate({
16
+ id: 'theme.SearchBar.label',
17
+ message: 'Search',
18
+ description: 'The ARIA label and placeholder for search button',
19
+ }),
20
+ },
21
+ modal: {
22
+ searchBox: {
23
+ resetButtonTitle: translate({
24
+ id: 'theme.SearchModal.searchBox.resetButtonTitle',
25
+ message: 'Clear the query',
26
+ description: 'The label and ARIA label for search box reset button',
27
+ }),
28
+ resetButtonAriaLabel: translate({
29
+ id: 'theme.SearchModal.searchBox.resetButtonTitle',
30
+ message: 'Clear the query',
31
+ description: 'The label and ARIA label for search box reset button',
32
+ }),
33
+ cancelButtonText: translate({
34
+ id: 'theme.SearchModal.searchBox.cancelButtonText',
35
+ message: 'Cancel',
36
+ description: 'The label and ARIA label for search box cancel button',
37
+ }),
38
+ cancelButtonAriaLabel: translate({
39
+ id: 'theme.SearchModal.searchBox.cancelButtonText',
40
+ message: 'Cancel',
41
+ description: 'The label and ARIA label for search box cancel button',
42
+ }),
43
+ },
44
+ startScreen: {
45
+ recentSearchesTitle: translate({
46
+ id: 'theme.SearchModal.startScreen.recentSearchesTitle',
47
+ message: 'Recent',
48
+ description: 'The title for recent searches',
49
+ }),
50
+ noRecentSearchesText: translate({
51
+ id: 'theme.SearchModal.startScreen.noRecentSearchesText',
52
+ message: 'No recent searches',
53
+ description: 'The text when no recent searches',
54
+ }),
55
+ saveRecentSearchButtonTitle: translate({
56
+ id: 'theme.SearchModal.startScreen.saveRecentSearchButtonTitle',
57
+ message: 'Save this search',
58
+ description: 'The label for save recent search button',
59
+ }),
60
+ removeRecentSearchButtonTitle: translate({
61
+ id: 'theme.SearchModal.startScreen.removeRecentSearchButtonTitle',
62
+ message: 'Remove this search from history',
63
+ description: 'The label for remove recent search button',
64
+ }),
65
+ favoriteSearchesTitle: translate({
66
+ id: 'theme.SearchModal.startScreen.favoriteSearchesTitle',
67
+ message: 'Favorite',
68
+ description: 'The title for favorite searches',
69
+ }),
70
+ removeFavoriteSearchButtonTitle: translate({
71
+ id: 'theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle',
72
+ message: 'Remove this search from favorites',
73
+ description: 'The label for remove favorite search button',
74
+ }),
75
+ },
76
+ errorScreen: {
77
+ titleText: translate({
78
+ id: 'theme.SearchModal.errorScreen.titleText',
79
+ message: 'Unable to fetch results',
80
+ description: 'The title for error screen of search modal',
81
+ }),
82
+ helpText: translate({
83
+ id: 'theme.SearchModal.errorScreen.helpText',
84
+ message: 'You might want to check your network connection.',
85
+ description: 'The help text for error screen of search modal',
86
+ }),
87
+ },
88
+ footer: {
89
+ selectText: translate({
90
+ id: 'theme.SearchModal.footer.selectText',
91
+ message: 'to select',
92
+ description: 'The explanatory text of the action for the enter key',
93
+ }),
94
+ selectKeyAriaLabel: translate({
95
+ id: 'theme.SearchModal.footer.selectKeyAriaLabel',
96
+ message: 'Enter key',
97
+ description:
98
+ 'The ARIA label for the Enter key button that makes the selection',
99
+ }),
100
+ navigateText: translate({
101
+ id: 'theme.SearchModal.footer.navigateText',
102
+ message: 'to navigate',
103
+ description:
104
+ 'The explanatory text of the action for the Arrow up and Arrow down key',
105
+ }),
106
+ navigateUpKeyAriaLabel: translate({
107
+ id: 'theme.SearchModal.footer.navigateUpKeyAriaLabel',
108
+ message: 'Arrow up',
109
+ description:
110
+ 'The ARIA label for the Arrow up key button that makes the navigation',
111
+ }),
112
+ navigateDownKeyAriaLabel: translate({
113
+ id: 'theme.SearchModal.footer.navigateDownKeyAriaLabel',
114
+ message: 'Arrow down',
115
+ description:
116
+ 'The ARIA label for the Arrow down key button that makes the navigation',
117
+ }),
118
+ closeText: translate({
119
+ id: 'theme.SearchModal.footer.closeText',
120
+ message: 'to close',
121
+ description: 'The explanatory text of the action for Escape key',
122
+ }),
123
+ closeKeyAriaLabel: translate({
124
+ id: 'theme.SearchModal.footer.closeKeyAriaLabel',
125
+ message: 'Escape key',
126
+ description:
127
+ 'The ARIA label for the Escape key button that close the modal',
128
+ }),
129
+ searchByText: translate({
130
+ id: 'theme.SearchModal.footer.searchByText',
131
+ message: 'Search by',
132
+ description: 'The text explain that the search is making by Algolia',
133
+ }),
134
+ },
135
+ noResultsScreen: {
136
+ noResultsText: translate({
137
+ id: 'theme.SearchModal.noResultsScreen.noResultsText',
138
+ message: 'No results for',
139
+ description:
140
+ 'The text explains that there are no results for the following search',
141
+ }),
142
+ suggestedQueryText: translate({
143
+ id: 'theme.SearchModal.noResultsScreen.suggestedQueryText',
144
+ message: 'Try searching for',
145
+ description:
146
+ 'The text for the suggested query when no results are found for the following search',
147
+ }),
148
+ reportMissingResultsText: translate({
149
+ id: 'theme.SearchModal.noResultsScreen.reportMissingResultsText',
150
+ message: 'Believe this query should return results?',
151
+ description:
152
+ 'The text for the question where the user thinks there are missing results',
153
+ }),
154
+ reportMissingResultsLinkText: translate({
155
+ id: 'theme.SearchModal.noResultsScreen.reportMissingResultsLinkText',
156
+ message: 'Let us know.',
157
+ description: 'The text for the link to report missing results',
158
+ }),
159
+ },
160
+ },
161
+ placeholder: translate({
162
+ id: 'theme.SearchModal.placeholder',
163
+ message: 'Search docs',
164
+ description: 'The placeholder of the input of the DocSearch pop-up modal',
165
+ }),
166
+ };
167
+ export default translations;
package/package.json CHANGED
@@ -1,14 +1,20 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-search-algolia",
3
- "version": "2.0.0-beta.21",
3
+ "version": "2.0.0-beta.22",
4
4
  "description": "Algolia search component for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "sideEffects": [
7
7
  "*.css"
8
8
  ],
9
9
  "exports": {
10
- "./client": "./lib/client/index.js",
11
- ".": "./lib/index.js"
10
+ "./client": {
11
+ "types": "./lib/client/index.d.ts",
12
+ "default": "./lib/client/index.js"
13
+ },
14
+ ".": {
15
+ "types": "./src/theme-search-algolia.d.ts",
16
+ "default": "./lib/index.js"
17
+ }
12
18
  },
13
19
  "types": "src/theme-search-algolia.d.ts",
14
20
  "publishConfig": {
@@ -27,17 +33,17 @@
27
33
  "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
28
34
  },
29
35
  "dependencies": {
30
- "@docsearch/react": "^3.1.0",
31
- "@docusaurus/core": "2.0.0-beta.21",
32
- "@docusaurus/logger": "2.0.0-beta.21",
33
- "@docusaurus/plugin-content-docs": "2.0.0-beta.21",
34
- "@docusaurus/theme-common": "2.0.0-beta.21",
35
- "@docusaurus/theme-translations": "2.0.0-beta.21",
36
- "@docusaurus/utils": "2.0.0-beta.21",
37
- "@docusaurus/utils-validation": "2.0.0-beta.21",
36
+ "@docsearch/react": "^3.1.1",
37
+ "@docusaurus/core": "2.0.0-beta.22",
38
+ "@docusaurus/logger": "2.0.0-beta.22",
39
+ "@docusaurus/plugin-content-docs": "2.0.0-beta.22",
40
+ "@docusaurus/theme-common": "2.0.0-beta.22",
41
+ "@docusaurus/theme-translations": "2.0.0-beta.22",
42
+ "@docusaurus/utils": "2.0.0-beta.22",
43
+ "@docusaurus/utils-validation": "2.0.0-beta.22",
38
44
  "algoliasearch": "^4.13.1",
39
- "algoliasearch-helper": "^3.8.2",
40
- "clsx": "^1.1.1",
45
+ "algoliasearch-helper": "^3.10.0",
46
+ "clsx": "^1.2.0",
41
47
  "eta": "^1.12.3",
42
48
  "fs-extra": "^10.1.0",
43
49
  "lodash": "^4.17.21",
@@ -45,7 +51,7 @@
45
51
  "utility-types": "^3.10.0"
46
52
  },
47
53
  "devDependencies": {
48
- "@docusaurus/module-type-aliases": "2.0.0-beta.21"
54
+ "@docusaurus/module-type-aliases": "2.0.0-beta.22"
49
55
  },
50
56
  "peerDependencies": {
51
57
  "react": "^16.8.4 || ^17.0.0",
@@ -54,5 +60,5 @@
54
60
  "engines": {
55
61
  "node": ">=16.14"
56
62
  },
57
- "gitHead": "69ac49fc6909517f13615ee40290c4bd00c39df4"
63
+ "gitHead": "daf9e462c4eebb7ac26a940932311f987e768f87"
58
64
  }
package/src/deps.d.ts CHANGED
@@ -8,3 +8,13 @@
8
8
  declare module '@docsearch/react/modal';
9
9
 
10
10
  declare module '@docsearch/react/style';
11
+
12
+ // TODO incompatible declaration file
13
+ declare module 'eta' {
14
+ export const defaultConfig: object;
15
+
16
+ export function compile(
17
+ template: string,
18
+ options?: object,
19
+ ): (data: object, config: object) => string;
20
+ }
@@ -12,10 +12,12 @@ import {useHistory} from '@docusaurus/router';
12
12
  import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
13
13
  import Link from '@docusaurus/Link';
14
14
  import Head from '@docusaurus/Head';
15
- import {isRegexpStringMatch, useSearchPage} from '@docusaurus/theme-common';
15
+ import {isRegexpStringMatch} from '@docusaurus/theme-common';
16
+ import {useSearchPage} from '@docusaurus/theme-common/internal';
16
17
  import {DocSearchButton, useDocSearchKeyboardEvents} from '@docsearch/react';
17
18
  import {useAlgoliaContextualFacetFilters} from '@docusaurus/theme-search-algolia/client';
18
- import Translate, {translate} from '@docusaurus/Translate';
19
+ import Translate from '@docusaurus/Translate';
20
+ import translations from '@theme/SearchTranslations';
19
21
 
20
22
  import type {
21
23
  DocSearchModal as DocSearchModalType,
@@ -215,12 +217,6 @@ function DocSearch({
215
217
  searchButtonRef,
216
218
  });
217
219
 
218
- const translatedSearchLabel = translate({
219
- id: 'theme.SearchBar.label',
220
- message: 'Search',
221
- description: 'The ARIA label and placeholder for search button',
222
- });
223
-
224
220
  return (
225
221
  <>
226
222
  <Head>
@@ -240,10 +236,7 @@ function DocSearch({
240
236
  onMouseOver={importDocSearchModalIfNeeded}
241
237
  onClick={onOpen}
242
238
  ref={searchButtonRef}
243
- translations={{
244
- buttonText: translatedSearchLabel,
245
- buttonAriaLabel: translatedSearchLabel,
246
- }}
239
+ translations={translations.button}
247
240
  />
248
241
 
249
242
  {isOpen &&
@@ -263,6 +256,8 @@ function DocSearch({
263
256
  })}
264
257
  {...props}
265
258
  searchParameters={searchParameters}
259
+ placeholder={translations.placeholder}
260
+ translations={translations.modal}
266
261
  />,
267
262
  searchContainer.current,
268
263
  )}
@@ -18,12 +18,14 @@ import Link from '@docusaurus/Link';
18
18
  import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
19
19
  import {
20
20
  HtmlClassNameProvider,
21
- useTitleFormatter,
22
21
  usePluralForm,
23
22
  isRegexpStringMatch,
24
- useDynamicCallback,
25
- useSearchPage,
23
+ useEvent,
26
24
  } from '@docusaurus/theme-common';
25
+ import {
26
+ useTitleFormatter,
27
+ useSearchPage,
28
+ } from '@docusaurus/theme-common/internal';
27
29
  import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
28
30
  import {useAllDocsData} from '@docusaurus/plugin-content-docs/client';
29
31
  import Translate, {translate} from '@docusaurus/Translate';
@@ -314,7 +316,7 @@ function SearchPageContent(): JSX.Element {
314
316
  description: 'The search page title for empty query',
315
317
  });
316
318
 
317
- const makeSearch = useDynamicCallback((page: number = 0) => {
319
+ const makeSearch = useEvent((page: number = 0) => {
318
320
  algoliaHelper.addDisjunctiveFacetRefinement('docusaurus_tag', 'default');
319
321
  algoliaHelper.addDisjunctiveFacetRefinement('language', currentLocale);
320
322
 
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import {translate} from '@docusaurus/Translate';
9
+
10
+ import type {DocSearchTranslations} from '@docsearch/react';
11
+
12
+ const translations: DocSearchTranslations & {placeholder: string} = {
13
+ button: {
14
+ buttonText: translate({
15
+ id: 'theme.SearchBar.label',
16
+ message: 'Search',
17
+ description: 'The ARIA label and placeholder for search button',
18
+ }),
19
+ buttonAriaLabel: translate({
20
+ id: 'theme.SearchBar.label',
21
+ message: 'Search',
22
+ description: 'The ARIA label and placeholder for search button',
23
+ }),
24
+ },
25
+ modal: {
26
+ searchBox: {
27
+ resetButtonTitle: translate({
28
+ id: 'theme.SearchModal.searchBox.resetButtonTitle',
29
+ message: 'Clear the query',
30
+ description: 'The label and ARIA label for search box reset button',
31
+ }),
32
+ resetButtonAriaLabel: translate({
33
+ id: 'theme.SearchModal.searchBox.resetButtonTitle',
34
+ message: 'Clear the query',
35
+ description: 'The label and ARIA label for search box reset button',
36
+ }),
37
+ cancelButtonText: translate({
38
+ id: 'theme.SearchModal.searchBox.cancelButtonText',
39
+ message: 'Cancel',
40
+ description: 'The label and ARIA label for search box cancel button',
41
+ }),
42
+ cancelButtonAriaLabel: translate({
43
+ id: 'theme.SearchModal.searchBox.cancelButtonText',
44
+ message: 'Cancel',
45
+ description: 'The label and ARIA label for search box cancel button',
46
+ }),
47
+ },
48
+ startScreen: {
49
+ recentSearchesTitle: translate({
50
+ id: 'theme.SearchModal.startScreen.recentSearchesTitle',
51
+ message: 'Recent',
52
+ description: 'The title for recent searches',
53
+ }),
54
+ noRecentSearchesText: translate({
55
+ id: 'theme.SearchModal.startScreen.noRecentSearchesText',
56
+ message: 'No recent searches',
57
+ description: 'The text when no recent searches',
58
+ }),
59
+ saveRecentSearchButtonTitle: translate({
60
+ id: 'theme.SearchModal.startScreen.saveRecentSearchButtonTitle',
61
+ message: 'Save this search',
62
+ description: 'The label for save recent search button',
63
+ }),
64
+ removeRecentSearchButtonTitle: translate({
65
+ id: 'theme.SearchModal.startScreen.removeRecentSearchButtonTitle',
66
+ message: 'Remove this search from history',
67
+ description: 'The label for remove recent search button',
68
+ }),
69
+ favoriteSearchesTitle: translate({
70
+ id: 'theme.SearchModal.startScreen.favoriteSearchesTitle',
71
+ message: 'Favorite',
72
+ description: 'The title for favorite searches',
73
+ }),
74
+ removeFavoriteSearchButtonTitle: translate({
75
+ id: 'theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle',
76
+ message: 'Remove this search from favorites',
77
+ description: 'The label for remove favorite search button',
78
+ }),
79
+ },
80
+ errorScreen: {
81
+ titleText: translate({
82
+ id: 'theme.SearchModal.errorScreen.titleText',
83
+ message: 'Unable to fetch results',
84
+ description: 'The title for error screen of search modal',
85
+ }),
86
+ helpText: translate({
87
+ id: 'theme.SearchModal.errorScreen.helpText',
88
+ message: 'You might want to check your network connection.',
89
+ description: 'The help text for error screen of search modal',
90
+ }),
91
+ },
92
+ footer: {
93
+ selectText: translate({
94
+ id: 'theme.SearchModal.footer.selectText',
95
+ message: 'to select',
96
+ description: 'The explanatory text of the action for the enter key',
97
+ }),
98
+ selectKeyAriaLabel: translate({
99
+ id: 'theme.SearchModal.footer.selectKeyAriaLabel',
100
+ message: 'Enter key',
101
+ description:
102
+ 'The ARIA label for the Enter key button that makes the selection',
103
+ }),
104
+ navigateText: translate({
105
+ id: 'theme.SearchModal.footer.navigateText',
106
+ message: 'to navigate',
107
+ description:
108
+ 'The explanatory text of the action for the Arrow up and Arrow down key',
109
+ }),
110
+ navigateUpKeyAriaLabel: translate({
111
+ id: 'theme.SearchModal.footer.navigateUpKeyAriaLabel',
112
+ message: 'Arrow up',
113
+ description:
114
+ 'The ARIA label for the Arrow up key button that makes the navigation',
115
+ }),
116
+ navigateDownKeyAriaLabel: translate({
117
+ id: 'theme.SearchModal.footer.navigateDownKeyAriaLabel',
118
+ message: 'Arrow down',
119
+ description:
120
+ 'The ARIA label for the Arrow down key button that makes the navigation',
121
+ }),
122
+ closeText: translate({
123
+ id: 'theme.SearchModal.footer.closeText',
124
+ message: 'to close',
125
+ description: 'The explanatory text of the action for Escape key',
126
+ }),
127
+ closeKeyAriaLabel: translate({
128
+ id: 'theme.SearchModal.footer.closeKeyAriaLabel',
129
+ message: 'Escape key',
130
+ description:
131
+ 'The ARIA label for the Escape key button that close the modal',
132
+ }),
133
+ searchByText: translate({
134
+ id: 'theme.SearchModal.footer.searchByText',
135
+ message: 'Search by',
136
+ description: 'The text explain that the search is making by Algolia',
137
+ }),
138
+ },
139
+ noResultsScreen: {
140
+ noResultsText: translate({
141
+ id: 'theme.SearchModal.noResultsScreen.noResultsText',
142
+ message: 'No results for',
143
+ description:
144
+ 'The text explains that there are no results for the following search',
145
+ }),
146
+ suggestedQueryText: translate({
147
+ id: 'theme.SearchModal.noResultsScreen.suggestedQueryText',
148
+ message: 'Try searching for',
149
+ description:
150
+ 'The text for the suggested query when no results are found for the following search',
151
+ }),
152
+ reportMissingResultsText: translate({
153
+ id: 'theme.SearchModal.noResultsScreen.reportMissingResultsText',
154
+ message: 'Believe this query should return results?',
155
+ description:
156
+ 'The text for the question where the user thinks there are missing results',
157
+ }),
158
+ reportMissingResultsLinkText: translate({
159
+ id: 'theme.SearchModal.noResultsScreen.reportMissingResultsLinkText',
160
+ message: 'Let us know.',
161
+ description: 'The text for the link to report missing results',
162
+ }),
163
+ },
164
+ },
165
+ placeholder: translate({
166
+ id: 'theme.SearchModal.placeholder',
167
+ message: 'Search docs',
168
+ description: 'The placeholder of the input of the DocSearch pop-up modal',
169
+ }),
170
+ };
171
+
172
+ export default translations;
@@ -33,3 +33,10 @@ declare module '@theme/SearchPage' {
33
33
  declare module '@theme/SearchBar' {
34
34
  export default function SearchBar(): JSX.Element;
35
35
  }
36
+
37
+ declare module '@theme/SearchTranslations' {
38
+ import type {DocSearchTranslations} from '@docsearch/react';
39
+
40
+ const translations: DocSearchTranslations & {placeholder: string};
41
+ export default translations;
42
+ }