@docusaurus/core 0.0.0-4712 → 0.0.0-4713

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.
@@ -9,4 +9,4 @@ import { type ReactNode } from 'react';
9
9
  import type { InterpolateProps, InterpolateValues } from '@docusaurus/Interpolate';
10
10
  export declare function interpolate<Str extends string>(text: Str, values?: InterpolateValues<Str, string | number>): string;
11
11
  export declare function interpolate<Str extends string, Value extends ReactNode>(text: Str, values?: InterpolateValues<Str, Value>): ReactNode;
12
- export default function Interpolate<Str extends string>({ children, values, }: InterpolateProps<Str>): ReactNode;
12
+ export default function Interpolate<Str extends string>({ children, values, }: InterpolateProps<Str>): JSX.Element;
@@ -52,5 +52,5 @@ export default function Interpolate({ children, values, }) {
52
52
  console.warn('Illegal <Interpolate> children', children);
53
53
  throw new Error('The Docusaurus <Interpolate> component only accept simple string values');
54
54
  }
55
- return interpolate(children, values);
55
+ return <>{interpolate(children, values)}</>;
56
56
  }
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference types="@docusaurus/module-type-aliases" />
8
- import type { ReactNode } from 'react';
8
+ /// <reference types="react" />
9
9
  import { type InterpolateValues } from '@docusaurus/Interpolate';
10
10
  import type { TranslateParam, TranslateProps } from '@docusaurus/Translate';
11
11
  export declare function translate<Str extends string>({ message, id }: TranslateParam<Str>, values?: InterpolateValues<Str, string | number>): string;
12
- export default function Translate<Str extends string>({ children, id, values, }: TranslateProps<Str>): ReactNode;
12
+ export default function Translate<Str extends string>({ children, id, values, }: TranslateProps<Str>): JSX.Element;
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ import React from 'react';
7
8
  import { interpolate } from '@docusaurus/Interpolate';
8
9
  // Can't read it from context, due to exposing imperative API
9
10
  import codeTranslations from '@generated/codeTranslations';
@@ -29,5 +30,5 @@ export default function Translate({ children, id, values, }) {
29
30
  throw new Error('The Docusaurus <Translate> component only accept simple string values');
30
31
  }
31
32
  const localizedMessage = getLocalizedMessage({ message: children, id });
32
- return interpolate(localizedMessage, values);
33
+ return <>{interpolate(localizedMessage, values)}</>;
33
34
  }
@@ -13,11 +13,7 @@ export default function normalizeLocation(location) {
13
13
  pathname: pathnames[location.pathname],
14
14
  };
15
15
  }
16
- let pathname = location.pathname || '/';
17
- pathname = pathname.trim().replace(/\/index\.html$/, '');
18
- if (pathname === '') {
19
- pathname = '/';
20
- }
16
+ const pathname = location.pathname.trim().replace(/\/index\.html$/, '') || '/';
21
17
  pathnames[location.pathname] = pathname;
22
18
  return {
23
19
  ...location,
@@ -15,7 +15,7 @@ async function loadConfig(configPath) {
15
15
  throw new Error(`Config file at "${configPath}" not found.`);
16
16
  }
17
17
  const importedConfig = (0, import_fresh_1.default)(configPath);
18
- const loadedConfig = importedConfig instanceof Function
18
+ const loadedConfig = typeof importedConfig === 'function'
19
19
  ? await importedConfig()
20
20
  : await importedConfig;
21
21
  return (0, configValidation_1.validateConfig)(loadedConfig);
@@ -299,7 +299,7 @@ ${Object.entries(registry)
299
299
  return props;
300
300
  }
301
301
  exports.load = load;
302
- // We want all @docusaurus/* packages to have the exact same version!
302
+ // We want all @docusaurus/* packages to have the exact same version!
303
303
  // See https://github.com/facebook/docusaurus/issues/3371
304
304
  // See https://github.com/facebook/docusaurus/pull/3386
305
305
  function checkDocusaurusPackagesVersion(siteMetadata) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@docusaurus/core",
3
3
  "description": "Easy to Maintain Open Source Documentation Websites",
4
- "version": "0.0.0-4712",
4
+ "version": "0.0.0-4713",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -41,13 +41,13 @@
41
41
  "@babel/runtime": "^7.17.2",
42
42
  "@babel/runtime-corejs3": "^7.17.2",
43
43
  "@babel/traverse": "^7.17.3",
44
- "@docusaurus/cssnano-preset": "0.0.0-4712",
45
- "@docusaurus/logger": "0.0.0-4712",
46
- "@docusaurus/mdx-loader": "0.0.0-4712",
44
+ "@docusaurus/cssnano-preset": "0.0.0-4713",
45
+ "@docusaurus/logger": "0.0.0-4713",
46
+ "@docusaurus/mdx-loader": "0.0.0-4713",
47
47
  "@docusaurus/react-loadable": "5.5.2",
48
- "@docusaurus/utils": "0.0.0-4712",
49
- "@docusaurus/utils-common": "0.0.0-4712",
50
- "@docusaurus/utils-validation": "0.0.0-4712",
48
+ "@docusaurus/utils": "0.0.0-4713",
49
+ "@docusaurus/utils-common": "0.0.0-4713",
50
+ "@docusaurus/utils-validation": "0.0.0-4713",
51
51
  "@slorber/static-site-generator-webpack-plugin": "^4.0.1",
52
52
  "@svgr/webpack": "^6.2.1",
53
53
  "autoprefixer": "^10.4.2",
@@ -106,8 +106,8 @@
106
106
  "webpackbar": "^5.0.2"
107
107
  },
108
108
  "devDependencies": {
109
- "@docusaurus/module-type-aliases": "0.0.0-4712",
110
- "@docusaurus/types": "0.0.0-4712",
109
+ "@docusaurus/module-type-aliases": "0.0.0-4713",
110
+ "@docusaurus/types": "0.0.0-4713",
111
111
  "@types/detect-port": "^1.3.2",
112
112
  "@types/nprogress": "^0.2.0",
113
113
  "@types/react-dom": "^17.0.13",
@@ -128,5 +128,5 @@
128
128
  "engines": {
129
129
  "node": ">=14"
130
130
  },
131
- "gitHead": "1e5c296e7b7113dbb926e41da5aa7f326f0d60e9"
131
+ "gitHead": "43c65e82adb2329758821232b7157fceb9830980"
132
132
  }