@docusaurus/theme-search-algolia 2.0.0-beta.ff31de0ff → 2.0.1

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.
Files changed (37) hide show
  1. package/lib/client/index.d.ts +7 -0
  2. package/lib/client/index.js +7 -0
  3. package/lib/client/useAlgoliaContextualFacetFilters.d.ts +7 -0
  4. package/lib/client/useAlgoliaContextualFacetFilters.js +15 -0
  5. package/lib/index.d.ts +9 -0
  6. package/lib/index.js +90 -0
  7. package/lib/templates/opensearch.d.ts +8 -0
  8. package/lib/templates/opensearch.js +23 -0
  9. package/lib/theme/SearchBar/index.d.ts +8 -0
  10. package/{src → lib}/theme/SearchBar/index.js +51 -60
  11. package/lib/theme/SearchBar/styles.css +21 -0
  12. package/lib/theme/SearchPage/index.d.ts +8 -0
  13. package/{src → lib}/theme/SearchPage/index.js +100 -131
  14. package/lib/theme/SearchPage/styles.module.css +119 -0
  15. package/lib/theme/SearchTranslations/index.d.ts +11 -0
  16. package/lib/theme/SearchTranslations/index.js +167 -0
  17. package/lib/validateThemeConfig.d.ts +15 -0
  18. package/lib/validateThemeConfig.js +44 -0
  19. package/package.json +43 -14
  20. package/src/client/index.ts +8 -0
  21. package/src/{theme/hooks/useAlgoliaContextualFacetFilters.js → client/useAlgoliaContextualFacetFilters.ts} +3 -3
  22. package/src/deps.d.ts +20 -0
  23. package/src/index.ts +116 -0
  24. package/src/templates/{opensearch.js → opensearch.ts} +7 -5
  25. package/src/theme/SearchBar/index.tsx +271 -0
  26. package/src/theme/SearchBar/styles.css +1 -0
  27. package/src/theme/SearchPage/index.tsx +535 -0
  28. package/src/theme/SearchPage/styles.module.css +15 -34
  29. package/src/theme/SearchTranslations/index.ts +172 -0
  30. package/src/theme-search-algolia.d.ts +42 -0
  31. package/src/types.d.ts +10 -0
  32. package/src/validateThemeConfig.ts +53 -0
  33. package/src/__tests__/validateThemeConfig.test.js +0 -121
  34. package/src/index.js +0 -92
  35. package/src/theme/SearchMetadatas/index.js +0 -25
  36. package/src/theme/hooks/useSearchQuery.js +0 -44
  37. package/src/validateThemeConfig.js +0 -45
@@ -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;
@@ -0,0 +1,42 @@
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
+ declare module '@docusaurus/theme-search-algolia' {
9
+ import type {DeepPartial} from 'utility-types';
10
+
11
+ export type ThemeConfig = {
12
+ algolia: {
13
+ contextualSearch: boolean;
14
+ externalUrlRegex?: string;
15
+ appId: string;
16
+ apiKey: string;
17
+ indexName: string;
18
+ searchParameters: {[key: string]: unknown};
19
+ searchPagePath: string | false | null;
20
+ };
21
+ };
22
+ export type UserThemeConfig = DeepPartial<ThemeConfig>;
23
+ }
24
+
25
+ declare module '@docusaurus/theme-search-algolia/client' {
26
+ export function useAlgoliaContextualFacetFilters(): [string, string[]];
27
+ }
28
+
29
+ declare module '@theme/SearchPage' {
30
+ export default function SearchPage(): JSX.Element;
31
+ }
32
+
33
+ declare module '@theme/SearchBar' {
34
+ export default function SearchBar(): JSX.Element;
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
+ }
package/src/types.d.ts ADDED
@@ -0,0 +1,10 @@
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
+ /// <reference types="@docusaurus/module-type-aliases" />
9
+ /// <reference types="@docusaurus/theme-common" />
10
+ /// <reference types="@docusaurus/theme-classic" />
@@ -0,0 +1,53 @@
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 {Joi} from '@docusaurus/utils-validation';
9
+ import type {
10
+ ThemeConfig,
11
+ ThemeConfigValidationContext,
12
+ } from '@docusaurus/types';
13
+
14
+ export const DEFAULT_CONFIG = {
15
+ // Enabled by default, as it makes sense in most cases
16
+ // see also https://github.com/facebook/docusaurus/issues/5880
17
+ contextualSearch: true,
18
+
19
+ searchParameters: {},
20
+ searchPagePath: 'search',
21
+ };
22
+
23
+ export const Schema = Joi.object<ThemeConfig>({
24
+ algolia: Joi.object({
25
+ // Docusaurus attributes
26
+ contextualSearch: Joi.boolean().default(DEFAULT_CONFIG.contextualSearch),
27
+ externalUrlRegex: Joi.string().optional(),
28
+ // Algolia attributes
29
+ appId: Joi.string().required().messages({
30
+ 'any.required':
31
+ '"algolia.appId" is required. If you haven\'t migrated to the new DocSearch infra, please refer to the blog post for instructions: https://docusaurus.io/blog/2021/11/21/algolia-docsearch-migration',
32
+ }),
33
+ apiKey: Joi.string().required(),
34
+ indexName: Joi.string().required(),
35
+ searchParameters: Joi.object()
36
+ .default(DEFAULT_CONFIG.searchParameters)
37
+ .unknown(),
38
+ searchPagePath: Joi.alternatives()
39
+ .try(Joi.boolean().invalid(true), Joi.string())
40
+ .allow(null)
41
+ .default(DEFAULT_CONFIG.searchPagePath),
42
+ })
43
+ .label('themeConfig.algolia')
44
+ .required()
45
+ .unknown(), // DocSearch 3 is still alpha: don't validate the rest for now
46
+ });
47
+
48
+ export function validateThemeConfig({
49
+ validate,
50
+ themeConfig,
51
+ }: ThemeConfigValidationContext<ThemeConfig>): ThemeConfig {
52
+ return validate(Schema, themeConfig);
53
+ }
@@ -1,121 +0,0 @@
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
- const {validateThemeConfig, DEFAULT_CONFIG} = require('../validateThemeConfig');
9
-
10
- function testValidateThemeConfig(themeConfig) {
11
- function validate(schema, cfg) {
12
- const {value, error} = schema.validate(cfg, {
13
- convert: false,
14
- });
15
- if (error) {
16
- throw error;
17
- }
18
- return value;
19
- }
20
-
21
- return validateThemeConfig({themeConfig, validate});
22
- }
23
-
24
- describe('validateThemeConfig', () => {
25
- test('minimal config', () => {
26
- const algolia = {
27
- indexName: 'index',
28
- apiKey: 'apiKey',
29
- };
30
- expect(testValidateThemeConfig({algolia})).toEqual({
31
- algolia: {
32
- ...DEFAULT_CONFIG,
33
- ...algolia,
34
- },
35
- });
36
- });
37
-
38
- test('unknown attributes', () => {
39
- const algolia = {
40
- indexName: 'index',
41
- apiKey: 'apiKey',
42
- unknownKey: 'unknownKey',
43
- };
44
- expect(testValidateThemeConfig({algolia})).toEqual({
45
- algolia: {
46
- ...DEFAULT_CONFIG,
47
- ...algolia,
48
- },
49
- });
50
- });
51
-
52
- test('undefined config', () => {
53
- const algolia = undefined;
54
- expect(() =>
55
- testValidateThemeConfig({algolia}),
56
- ).toThrowErrorMatchingInlineSnapshot(
57
- `"\\"themeConfig.algolia\\" is required"`,
58
- );
59
- });
60
-
61
- test('undefined config 2', () => {
62
- expect(() =>
63
- testValidateThemeConfig({}),
64
- ).toThrowErrorMatchingInlineSnapshot(
65
- `"\\"themeConfig.algolia\\" is required"`,
66
- );
67
- });
68
-
69
- test('empty config', () => {
70
- const algolia = {};
71
- expect(() =>
72
- testValidateThemeConfig({algolia}),
73
- ).toThrowErrorMatchingInlineSnapshot(`"\\"algolia.apiKey\\" is required"`);
74
- });
75
-
76
- test('missing indexName config', () => {
77
- const algolia = {apiKey: 'apiKey'};
78
- expect(() =>
79
- testValidateThemeConfig({algolia}),
80
- ).toThrowErrorMatchingInlineSnapshot(
81
- `"\\"algolia.indexName\\" is required"`,
82
- );
83
- });
84
-
85
- test('missing apiKey config', () => {
86
- const algolia = {indexName: 'indexName'};
87
- expect(() =>
88
- testValidateThemeConfig({algolia}),
89
- ).toThrowErrorMatchingInlineSnapshot(`"\\"algolia.apiKey\\" is required"`);
90
- });
91
-
92
- test('contextualSearch config', () => {
93
- const algolia = {
94
- indexName: 'index',
95
- apiKey: 'apiKey',
96
- contextualSearch: true,
97
- };
98
- expect(testValidateThemeConfig({algolia})).toEqual({
99
- algolia: {
100
- ...DEFAULT_CONFIG,
101
- ...algolia,
102
- },
103
- });
104
- });
105
-
106
- test('searchParameters.facetFilters search config', () => {
107
- const algolia = {
108
- indexName: 'index',
109
- apiKey: 'apiKey',
110
- searchParameters: {
111
- facetFilters: ['version:1.0'],
112
- },
113
- };
114
- expect(testValidateThemeConfig({algolia})).toEqual({
115
- algolia: {
116
- ...DEFAULT_CONFIG,
117
- ...algolia,
118
- },
119
- });
120
- });
121
- });
package/src/index.js DELETED
@@ -1,92 +0,0 @@
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
- const path = require('path');
9
- const fs = require('fs');
10
- const eta = require('eta');
11
- const {normalizeUrl, getSwizzledComponent} = require('@docusaurus/utils');
12
- const openSearchTemplate = require('./templates/opensearch');
13
- const {validateThemeConfig} = require('./validateThemeConfig');
14
- const {memoize} = require('lodash');
15
-
16
- const getCompiledOpenSearchTemplate = memoize(() => {
17
- return eta.compile(openSearchTemplate.trim());
18
- });
19
-
20
- function renderOpenSearchTemplate(data) {
21
- const compiled = getCompiledOpenSearchTemplate();
22
- return compiled(data, eta.defaultConfig);
23
- }
24
-
25
- const OPEN_SEARCH_FILENAME = 'opensearch.xml';
26
-
27
- function theme(context) {
28
- const {
29
- baseUrl,
30
- siteConfig: {title, url, favicon},
31
- } = context;
32
- const pageComponent = './theme/SearchPage/index.js';
33
- const pagePath =
34
- getSwizzledComponent(pageComponent) ||
35
- path.resolve(__dirname, pageComponent);
36
-
37
- return {
38
- name: 'docusaurus-theme-search-algolia',
39
-
40
- getThemePath() {
41
- return path.resolve(__dirname, './theme');
42
- },
43
-
44
- getPathsToWatch() {
45
- return [pagePath];
46
- },
47
-
48
- async contentLoaded({actions: {addRoute}}) {
49
- addRoute({
50
- path: normalizeUrl([baseUrl, 'search']),
51
- component: pagePath,
52
- exact: true,
53
- });
54
- },
55
-
56
- async postBuild({outDir}) {
57
- try {
58
- fs.writeFileSync(
59
- path.join(outDir, OPEN_SEARCH_FILENAME),
60
- renderOpenSearchTemplate({
61
- title,
62
- url: url + baseUrl,
63
- favicon: normalizeUrl([url, baseUrl, favicon]),
64
- }),
65
- );
66
- } catch (err) {
67
- console.error(err);
68
- throw new Error(`Generating OpenSearch file failed: ${err}`);
69
- }
70
- },
71
-
72
- injectHtmlTags() {
73
- return {
74
- headTags: [
75
- {
76
- tagName: 'link',
77
- attributes: {
78
- rel: 'search',
79
- type: 'application/opensearchdescription+xml',
80
- title,
81
- href: normalizeUrl([baseUrl, OPEN_SEARCH_FILENAME]),
82
- },
83
- },
84
- ],
85
- };
86
- },
87
- };
88
- }
89
-
90
- module.exports = theme;
91
-
92
- theme.validateThemeConfig = validateThemeConfig;
@@ -1,25 +0,0 @@
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 React from 'react';
9
-
10
- import Head from '@docusaurus/Head';
11
-
12
- // Override default/agnostic SearchMetas to use Algolia-specific metadatas
13
- export default function AlgoliaSearchMetadatas({locale, version, tag}) {
14
- // Seems safe to consider here the locale is the language,
15
- // as the existing docsearch:language filter is afaik a regular string-based filter
16
- const language = locale;
17
-
18
- return (
19
- <Head>
20
- {language && <meta name="docsearch:language" content={language} />}
21
- {version && <meta name="docsearch:version" content={version} />}
22
- {tag && <meta name="docsearch:docusaurus_tag" content={tag} />}
23
- </Head>
24
- );
25
- }
@@ -1,44 +0,0 @@
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 {useHistory, useLocation} from '@docusaurus/router';
9
- import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
10
- import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
11
-
12
- const SEARCH_PARAM_QUERY = 'q';
13
-
14
- function useSearchQuery() {
15
- const history = useHistory();
16
- const location = useLocation();
17
- const {siteConfig: {baseUrl} = {}} = useDocusaurusContext();
18
-
19
- return {
20
- searchValue:
21
- (ExecutionEnvironment.canUseDOM &&
22
- new URLSearchParams(location.search).get(SEARCH_PARAM_QUERY)) ||
23
- '',
24
- updateSearchPath: (searchValue) => {
25
- const searchParams = new URLSearchParams(location.search);
26
-
27
- if (searchValue) {
28
- searchParams.set(SEARCH_PARAM_QUERY, searchValue);
29
- } else {
30
- searchParams.delete(SEARCH_PARAM_QUERY);
31
- }
32
-
33
- history.replace({
34
- search: searchParams.toString(),
35
- });
36
- },
37
- generateSearchPageLink: (searchValue) => {
38
- // Refer to https://github.com/facebook/docusaurus/pull/2838
39
- return `${baseUrl}search?q=${encodeURIComponent(searchValue)}`;
40
- },
41
- };
42
- }
43
-
44
- export default useSearchQuery;
@@ -1,45 +0,0 @@
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
- const {Joi} = require('@docusaurus/utils-validation');
9
-
10
- const DEFAULT_CONFIG = {
11
- contextualSearch: false, // future: maybe we want to enable this by default
12
-
13
- // By default, all Docusaurus sites are using the same AppId
14
- // This has been designed on purpose with Algolia.
15
- appId: 'BH4D9OD16A',
16
-
17
- searchParameters: {},
18
- };
19
- exports.DEFAULT_CONFIG = DEFAULT_CONFIG;
20
-
21
- const Schema = Joi.object({
22
- algolia: Joi.object({
23
- // Docusaurus attributes
24
- contextualSearch: Joi.boolean().default(DEFAULT_CONFIG.contextualSearch),
25
-
26
- // Algolia attributes
27
- appId: Joi.string().default(DEFAULT_CONFIG.appId),
28
- apiKey: Joi.string().required(),
29
- indexName: Joi.string().required(),
30
- searchParameters: Joi.object()
31
- .default(DEFAULT_CONFIG.searchParameters)
32
- .unknown(),
33
- })
34
- .label('themeConfig.algolia')
35
- .required()
36
- .unknown(), // DocSearch 3 is still alpha: don't validate the rest for now
37
- });
38
- exports.Schema = Schema;
39
-
40
- exports.validateThemeConfig = function validateThemeConfig({
41
- validate,
42
- themeConfig,
43
- }) {
44
- return validate(Schema, themeConfig);
45
- };