@docusaurus/theme-search-algolia 3.10.1-canary-6655 → 3.10.1-canary-6803

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/lib/opensearch.js CHANGED
@@ -16,10 +16,11 @@ const lodash_1 = tslib_1.__importDefault(require("lodash"));
16
16
  const eta_1 = require("eta");
17
17
  const utils_1 = require("@docusaurus/utils");
18
18
  const opensearch_1 = tslib_1.__importDefault(require("./templates/opensearch"));
19
- const getCompiledOpenSearchTemplate = lodash_1.default.memoize(() => (0, eta_1.compile)(opensearch_1.default.trim()));
19
+ const eta = new eta_1.Eta();
20
+ const getCompiledOpenSearchTemplate = lodash_1.default.memoize(() => eta.compile(opensearch_1.default.trim()));
20
21
  function renderOpenSearchTemplate(data) {
21
22
  const compiled = getCompiledOpenSearchTemplate();
22
- return compiled(data, eta_1.defaultConfig);
23
+ return eta.render(compiled, data);
23
24
  }
24
25
  const OPEN_SEARCH_FILENAME = 'opensearch.xml';
25
26
  function shouldCreateOpenSearchFile({ context, }) {
@@ -8,7 +8,6 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.Schema = exports.DEFAULT_CONFIG = void 0;
10
10
  exports.validateThemeConfig = validateThemeConfig;
11
- const utils_1 = require("@docusaurus/utils");
12
11
  const utils_validation_1 = require("@docusaurus/utils-validation");
13
12
  const docSearchVersion_1 = require("./docSearchVersion");
14
13
  exports.DEFAULT_CONFIG = {
@@ -42,7 +41,7 @@ exports.Schema = utils_validation_1.Joi.object({
42
41
  replaceSearchResultPathname: utils_validation_1.Joi.object({
43
42
  from: utils_validation_1.Joi.custom((from) => {
44
43
  if (typeof from === 'string') {
45
- return (0, utils_1.escapeRegexp)(from);
44
+ return RegExp.escape(from);
46
45
  }
47
46
  else if (from instanceof RegExp) {
48
47
  return from.source;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-search-algolia",
3
- "version": "3.10.1-canary-6655",
3
+ "version": "3.10.1-canary-6803",
4
4
  "description": "Algolia search component for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "sideEffects": [
@@ -35,24 +35,26 @@
35
35
  "dependencies": {
36
36
  "@algolia/autocomplete-core": "^1.19.8",
37
37
  "@docsearch/react": "^4.6.3",
38
- "@docusaurus/core": "3.10.1-canary-6655",
39
- "@docusaurus/logger": "3.10.1-canary-6655",
40
- "@docusaurus/plugin-content-docs": "3.10.1-canary-6655",
41
- "@docusaurus/theme-common": "3.10.1-canary-6655",
42
- "@docusaurus/theme-translations": "3.10.1-canary-6655",
43
- "@docusaurus/utils": "3.10.1-canary-6655",
44
- "@docusaurus/utils-validation": "3.10.1-canary-6655",
38
+ "@docusaurus/core": "3.10.1-canary-6803",
39
+ "@docusaurus/logger": "3.10.1-canary-6803",
40
+ "@docusaurus/plugin-content-docs": "3.10.1-canary-6803",
41
+ "@docusaurus/theme-classic": "3.10.1-canary-6803",
42
+ "@docusaurus/theme-common": "3.10.1-canary-6803",
43
+ "@docusaurus/theme-translations": "3.10.1-canary-6803",
44
+ "@docusaurus/utils": "3.10.1-canary-6803",
45
+ "@docusaurus/utils-validation": "3.10.1-canary-6803",
45
46
  "algoliasearch": "^5.51.0",
46
47
  "algoliasearch-helper": "^3.28.2",
47
48
  "clsx": "^2.0.0",
48
- "eta": "^2.2.0",
49
+ "eta": "^4.0.1",
49
50
  "fs-extra": "^11.2.0",
50
51
  "lodash": "^4.17.21",
51
52
  "tslib": "^2.6.0",
52
53
  "utility-types": "^3.10.0"
53
54
  },
54
55
  "devDependencies": {
55
- "@docusaurus/module-type-aliases": "3.10.1-canary-6655"
56
+ "@docusaurus/module-type-aliases": "3.10.1-canary-6803",
57
+ "@docusaurus/types": "3.10.1-canary-6803"
56
58
  },
57
59
  "peerDependencies": {
58
60
  "react": "^19.2.5",
@@ -61,5 +63,5 @@
61
63
  "engines": {
62
64
  "node": ">=24.14"
63
65
  },
64
- "gitHead": "6e93a3055178dd0af922ba627f787229dcdf948b"
66
+ "gitHead": "d2c7b381512bd4e7e90e33f56649e68d618eaa92"
65
67
  }
package/src/deps.d.ts CHANGED
@@ -8,13 +8,3 @@
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
- }
package/src/opensearch.ts CHANGED
@@ -8,15 +8,17 @@
8
8
  import path from 'path';
9
9
  import fs from 'fs-extra';
10
10
  import _ from 'lodash';
11
- import {defaultConfig, compile} from 'eta';
11
+ import {Eta} from 'eta';
12
12
  import {normalizeUrl} from '@docusaurus/utils';
13
13
  import openSearchTemplate from './templates/opensearch';
14
14
 
15
15
  import type {HtmlTags, LoadContext} from '@docusaurus/types';
16
16
  import type {ThemeConfig} from '@docusaurus/theme-search-algolia';
17
17
 
18
+ const eta = new Eta();
19
+
18
20
  const getCompiledOpenSearchTemplate = _.memoize(() =>
19
- compile(openSearchTemplate.trim()),
21
+ eta.compile(openSearchTemplate.trim()),
20
22
  );
21
23
 
22
24
  function renderOpenSearchTemplate(data: {
@@ -26,7 +28,7 @@ function renderOpenSearchTemplate(data: {
26
28
  faviconUrl: string | null;
27
29
  }) {
28
30
  const compiled = getCompiledOpenSearchTemplate();
29
- return compiled(data, defaultConfig);
31
+ return eta.render(compiled, data);
30
32
  }
31
33
 
32
34
  const OPEN_SEARCH_FILENAME = 'opensearch.xml';
@@ -5,7 +5,6 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import {escapeRegexp} from '@docusaurus/utils';
9
8
  import {Joi} from '@docusaurus/utils-validation';
10
9
  import {docSearchV3} from './docSearchVersion';
11
10
  import type {ThemeConfigValidationContext} from '@docusaurus/types';
@@ -50,7 +49,7 @@ export const Schema = Joi.object<ThemeConfig>({
50
49
  replaceSearchResultPathname: Joi.object({
51
50
  from: Joi.custom((from) => {
52
51
  if (typeof from === 'string') {
53
- return escapeRegexp(from);
52
+ return RegExp.escape(from);
54
53
  } else if (from instanceof RegExp) {
55
54
  return from.source;
56
55
  }