@docusaurus/theme-classic 0.0.0-4768 → 0.0.0-4771

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.
@@ -507,7 +507,7 @@ declare module '@theme/MDXComponents' {
507
507
  readonly h4: (props: ComponentProps<'h4'>) => JSX.Element;
508
508
  readonly h5: (props: ComponentProps<'h5'>) => JSX.Element;
509
509
  readonly h6: (props: ComponentProps<'h6'>) => JSX.Element;
510
- } & Record<string, ComponentType<unknown>>;
510
+ } & {[tagName: string]: ComponentType<unknown>};
511
511
 
512
512
  const MDXComponents: MDXComponentsObject;
513
513
  export default MDXComponents;
@@ -768,7 +768,7 @@ declare module '@theme/TabItem' {
768
768
  readonly label?: string;
769
769
  readonly hidden?: boolean;
770
770
  readonly className?: string;
771
- readonly attributes?: Record<string, unknown>;
771
+ readonly attributes?: {[key: string]: unknown};
772
772
  }
773
773
 
774
774
  export default function TabItem(props: Props): JSX.Element;
@@ -786,7 +786,7 @@ declare module '@theme/Tabs' {
786
786
  readonly values?: readonly {
787
787
  value: string;
788
788
  label?: string;
789
- attributes?: Record<string, unknown>;
789
+ attributes?: {[key: string]: unknown};
790
790
  }[];
791
791
  readonly groupId?: string;
792
792
  readonly className?: string;
@@ -13,6 +13,12 @@ function transformImgClassName(className) {
13
13
  }
14
14
 
15
15
  export default function MDXImg(props) {
16
- // eslint-disable-next-line jsx-a11y/alt-text
17
- return <img {...props} className={transformImgClassName(props.className)} />;
16
+ return (
17
+ // eslint-disable-next-line jsx-a11y/alt-text
18
+ <img
19
+ loading="lazy"
20
+ {...props}
21
+ className={transformImgClassName(props.className)}
22
+ />
23
+ );
18
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-4768",
3
+ "version": "0.0.0-4771",
4
4
  "description": "Classic theme for Docusaurus",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-classic.d.ts",
@@ -21,15 +21,15 @@
21
21
  "format:lib-next": "prettier --config ../../.prettierrc --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
22
22
  },
23
23
  "dependencies": {
24
- "@docusaurus/core": "0.0.0-4768",
25
- "@docusaurus/plugin-content-blog": "0.0.0-4768",
26
- "@docusaurus/plugin-content-docs": "0.0.0-4768",
27
- "@docusaurus/plugin-content-pages": "0.0.0-4768",
28
- "@docusaurus/theme-common": "0.0.0-4768",
29
- "@docusaurus/theme-translations": "0.0.0-4768",
30
- "@docusaurus/utils": "0.0.0-4768",
31
- "@docusaurus/utils-common": "0.0.0-4768",
32
- "@docusaurus/utils-validation": "0.0.0-4768",
24
+ "@docusaurus/core": "0.0.0-4771",
25
+ "@docusaurus/plugin-content-blog": "0.0.0-4771",
26
+ "@docusaurus/plugin-content-docs": "0.0.0-4771",
27
+ "@docusaurus/plugin-content-pages": "0.0.0-4771",
28
+ "@docusaurus/theme-common": "0.0.0-4771",
29
+ "@docusaurus/theme-translations": "0.0.0-4771",
30
+ "@docusaurus/utils": "0.0.0-4771",
31
+ "@docusaurus/utils-common": "0.0.0-4771",
32
+ "@docusaurus/utils-validation": "0.0.0-4771",
33
33
  "@mdx-js/react": "^1.6.22",
34
34
  "clsx": "^1.1.1",
35
35
  "copy-text-to-clipboard": "^3.0.1",
@@ -42,8 +42,8 @@
42
42
  "rtlcss": "^3.5.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@docusaurus/module-type-aliases": "0.0.0-4768",
46
- "@docusaurus/types": "0.0.0-4768",
45
+ "@docusaurus/module-type-aliases": "0.0.0-4771",
46
+ "@docusaurus/types": "0.0.0-4771",
47
47
  "@types/mdx-js__react": "^1.5.5",
48
48
  "@types/prismjs": "^1.26.0",
49
49
  "@types/rtlcss": "^3.1.2",
@@ -59,5 +59,5 @@
59
59
  "engines": {
60
60
  "node": ">=14"
61
61
  },
62
- "gitHead": "4a89ff667d4a8896c47c4f946796cf3f58d219dc"
62
+ "gitHead": "1b462b797e77b4a018e3c1ebb36ec87521ad4d07"
63
63
  }
@@ -70,10 +70,9 @@ function UnmaintainedVersionLabel({
70
70
  );
71
71
  }
72
72
 
73
- const BannerLabelComponents: Record<
74
- VersionBanner,
75
- ComponentType<BannerLabelComponentProps>
76
- > = {
73
+ const BannerLabelComponents: {
74
+ [banner in VersionBanner]: ComponentType<BannerLabelComponentProps>;
75
+ } = {
77
76
  unreleased: UnreleasedVersionLabel,
78
77
  unmaintained: UnmaintainedVersionLabel,
79
78
  };
@@ -15,6 +15,12 @@ function transformImgClassName(className?: string): string {
15
15
  }
16
16
 
17
17
  export default function MDXImg(props: Props): JSX.Element {
18
- // eslint-disable-next-line jsx-a11y/alt-text
19
- return <img {...props} className={transformImgClassName(props.className)} />;
18
+ return (
19
+ // eslint-disable-next-line jsx-a11y/alt-text
20
+ <img
21
+ loading="lazy"
22
+ {...props}
23
+ className={transformImgClassName(props.className)}
24
+ />
25
+ );
20
26
  }
@@ -7,8 +7,9 @@
7
7
 
8
8
  import React, {isValidElement} from 'react';
9
9
  import CodeBlock from '@theme/CodeBlock';
10
+ import type {Props} from '@theme/MDXComponents/Pre';
10
11
 
11
- export default function MDXPre(props: any) {
12
+ export default function MDXPre(props: Props): JSX.Element {
12
13
  return (
13
14
  <CodeBlock
14
15
  // If this pre is created by a ``` fenced codeblock, unwrap the children
@@ -14,12 +14,11 @@ import LocaleDropdownNavbarItem from '@theme/NavbarItem/LocaleDropdownNavbarItem
14
14
  import SearchNavbarItem from '@theme/NavbarItem/SearchNavbarItem';
15
15
  import type {Types, Props} from '@theme/NavbarItem';
16
16
 
17
- const NavbarItemComponents: Record<
18
- Exclude<Types, undefined>,
17
+ const NavbarItemComponents: {
19
18
  // Not really worth typing, as we pass all props down immediately
20
19
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
- () => (props: any) => JSX.Element
22
- > = {
20
+ [type in Exclude<Types, undefined>]: () => (props: any) => JSX.Element;
21
+ } = {
23
22
  default: () => DefaultNavbarItem,
24
23
  localeDropdown: () => LocaleDropdownNavbarItem,
25
24
  search: () => SearchNavbarItem,
@@ -507,7 +507,7 @@ declare module '@theme/MDXComponents' {
507
507
  readonly h4: (props: ComponentProps<'h4'>) => JSX.Element;
508
508
  readonly h5: (props: ComponentProps<'h5'>) => JSX.Element;
509
509
  readonly h6: (props: ComponentProps<'h6'>) => JSX.Element;
510
- } & Record<string, ComponentType<unknown>>;
510
+ } & {[tagName: string]: ComponentType<unknown>};
511
511
 
512
512
  const MDXComponents: MDXComponentsObject;
513
513
  export default MDXComponents;
@@ -768,7 +768,7 @@ declare module '@theme/TabItem' {
768
768
  readonly label?: string;
769
769
  readonly hidden?: boolean;
770
770
  readonly className?: string;
771
- readonly attributes?: Record<string, unknown>;
771
+ readonly attributes?: {[key: string]: unknown};
772
772
  }
773
773
 
774
774
  export default function TabItem(props: Props): JSX.Element;
@@ -786,7 +786,7 @@ declare module '@theme/Tabs' {
786
786
  readonly values?: readonly {
787
787
  value: string;
788
788
  label?: string;
789
- attributes?: Record<string, unknown>;
789
+ attributes?: {[key: string]: unknown};
790
790
  }[];
791
791
  readonly groupId?: string;
792
792
  readonly className?: string;
@@ -184,7 +184,7 @@ export function translateThemeConfig({
184
184
  themeConfig: ThemeConfig;
185
185
  translationFiles: TranslationFile[];
186
186
  }): ThemeConfig {
187
- const translationFilesMap: Record<string, TranslationFile> = _.keyBy(
187
+ const translationFilesMap: {[fileName: string]: TranslationFile} = _.keyBy(
188
188
  translationFiles,
189
189
  (f) => f.path,
190
190
  );