redoc 2.1.4 → 2.2.0

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 (85) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +2 -1
  3. package/bundles/756674defce81e90acea.worker.js.LICENSE.txt +1 -1
  4. package/bundles/redoc.browser.lib.js +5 -5
  5. package/bundles/redoc.browser.lib.js.LICENSE.txt +1 -1
  6. package/bundles/redoc.browser.lib.js.map +1 -1
  7. package/bundles/redoc.lib.js +5 -5
  8. package/bundles/redoc.lib.js.LICENSE.txt +1 -1
  9. package/bundles/redoc.lib.js.map +1 -1
  10. package/bundles/redoc.standalone.js +132 -132
  11. package/bundles/redoc.standalone.js.LICENSE.txt +28 -21
  12. package/bundles/redoc.standalone.js.map +1 -1
  13. package/package.json +15 -17
  14. package/typings/common-elements/Tooltip.d.ts +2 -2
  15. package/typings/common-elements/linkify.d.ts +3 -3
  16. package/typings/common-elements/perfect-scrollbar.d.ts +3 -3
  17. package/typings/common-elements/shelfs.d.ts +1 -0
  18. package/typings/components/ApiInfo/ApiInfo.d.ts +1 -1
  19. package/typings/components/ApiLogo/ApiLogo.d.ts +1 -1
  20. package/typings/components/ApiLogo/styled.elements.d.ts +2 -2
  21. package/typings/components/CallbackSamples/CallbackReqSamples.d.ts +1 -1
  22. package/typings/components/CallbackSamples/CallbackSamples.d.ts +1 -1
  23. package/typings/components/Callbacks/CallbackDetails.d.ts +1 -1
  24. package/typings/components/Callbacks/CallbackOperation.d.ts +1 -1
  25. package/typings/components/Callbacks/CallbackTitle.d.ts +2 -2
  26. package/typings/components/Callbacks/CallbacksList.d.ts +1 -1
  27. package/typings/components/Callbacks/styled.elements.d.ts +1 -1
  28. package/typings/components/ContentItems/ContentItems.d.ts +4 -4
  29. package/typings/components/Endpoint/Endpoint.d.ts +1 -1
  30. package/typings/components/ErrorBoundary.d.ts +1 -1
  31. package/typings/components/ExternalDocumentation/ExternalDocumentation.d.ts +1 -1
  32. package/typings/components/Fields/ArrayItemDetails.d.ts +2 -2
  33. package/typings/components/Fields/EnumValues.d.ts +1 -1
  34. package/typings/components/Fields/Examples.d.ts +2 -2
  35. package/typings/components/Fields/Extensions.d.ts +1 -1
  36. package/typings/components/Fields/Field.d.ts +1 -1
  37. package/typings/components/Fields/FieldConstraints.d.ts +1 -1
  38. package/typings/components/Fields/FieldDetails.d.ts +1 -1
  39. package/typings/components/Fields/Pattern.d.ts +2 -2
  40. package/typings/components/GenericChildrenSwitcher/GenericChildrenSwitcher.d.ts +1 -1
  41. package/typings/components/JsonViewer/JsonViewer.d.ts +2 -2
  42. package/typings/components/Loading/Loading.d.ts +1 -1
  43. package/typings/components/Loading/Spinner.svg.d.ts +2 -2
  44. package/typings/components/Markdown/AdvancedMarkdown.d.ts +2 -2
  45. package/typings/components/Markdown/Markdown.d.ts +1 -1
  46. package/typings/components/Markdown/SanitizedMdBlock.d.ts +2 -2
  47. package/typings/components/MediaTypeSwitch/MediaTypesSwitch.d.ts +1 -1
  48. package/typings/components/Parameters/Parameters.d.ts +1 -1
  49. package/typings/components/Parameters/ParametersGroup.d.ts +1 -1
  50. package/typings/components/PayloadSamples/Example.d.ts +3 -3
  51. package/typings/components/PayloadSamples/ExampleValue.d.ts +2 -2
  52. package/typings/components/PayloadSamples/MediaTypeSamples.d.ts +1 -1
  53. package/typings/components/PayloadSamples/PayloadSamples.d.ts +1 -1
  54. package/typings/components/Redoc/Redoc.d.ts +1 -1
  55. package/typings/components/RedocStandalone.d.ts +2 -2
  56. package/typings/components/RequestSamples/RequestSamples.d.ts +1 -1
  57. package/typings/components/ResponseSamples/ResponseSamples.d.ts +1 -1
  58. package/typings/components/Responses/ResponseDetails.d.ts +1 -1
  59. package/typings/components/Responses/ResponseHeaders.d.ts +1 -1
  60. package/typings/components/Responses/ResponsesList.d.ts +1 -1
  61. package/typings/components/Schema/ArraySchema.d.ts +1 -1
  62. package/typings/components/Schema/DiscriminatorDropdown.d.ts +1 -1
  63. package/typings/components/Schema/ObjectSchema.d.ts +2 -2
  64. package/typings/components/Schema/OneOfSchema.d.ts +2 -2
  65. package/typings/components/Schema/RecursiveSchema.d.ts +2 -2
  66. package/typings/components/Schema/Schema.d.ts +1 -1
  67. package/typings/components/SchemaDefinition/SchemaDefinition.d.ts +1 -1
  68. package/typings/components/SearchBox/SearchBox.d.ts +3 -1
  69. package/typings/components/SearchBox/styled.elements.d.ts +2 -2
  70. package/typings/components/SecurityRequirement/OAuthFlow.d.ts +1 -1
  71. package/typings/components/SecurityRequirement/SecurityDetails.d.ts +2 -2
  72. package/typings/components/SecurityRequirement/SecurityHeader.d.ts +2 -2
  73. package/typings/components/SecurityRequirement/SecurityRequirement.d.ts +2 -2
  74. package/typings/components/SecuritySchemes/SecuritySchemes.d.ts +1 -1
  75. package/typings/components/SelectOnClick/SelectOnClick.d.ts +2 -2
  76. package/typings/components/SideMenu/MenuItem.d.ts +2 -2
  77. package/typings/components/SideMenu/MenuItems.d.ts +1 -1
  78. package/typings/components/SideMenu/SideMenu.d.ts +3 -1
  79. package/typings/components/SideMenu/styled.elements.d.ts +1 -0
  80. package/typings/components/SourceCode/SourceCode.d.ts +3 -3
  81. package/typings/components/StickySidebar/ChevronSvg.d.ts +2 -2
  82. package/typings/components/StickySidebar/StickyResponsiveSidebar.d.ts +2 -2
  83. package/typings/services/models/Operation.d.ts +2 -1
  84. package/typings/types/open-api.d.ts +6 -0
  85. package/typings/types/open-api.ts +7 -0
@@ -10,5 +10,5 @@ export interface SchemaProps extends SchemaOptions {
10
10
  schema: SchemaModel;
11
11
  }
12
12
  export declare class Schema extends React.Component<Partial<SchemaProps>> {
13
- render(): JSX.Element | null;
13
+ render(): React.JSX.Element | null;
14
14
  }
@@ -13,6 +13,6 @@ export declare class SchemaDefinition extends React.PureComponent<ObjectDescript
13
13
  private static getMediaType;
14
14
  private _mediaModel;
15
15
  private get mediaModel();
16
- render(): JSX.Element;
16
+ render(): React.JSX.Element;
17
17
  private renderDropdown;
18
18
  }
@@ -3,6 +3,7 @@ import type { IMenuItem, SearchResult } from '../../services/types';
3
3
  import type { SearchStore } from '../../services/SearchStore';
4
4
  import type { MarkerService } from '../../services/MarkerService';
5
5
  import { MenuItem } from '../SideMenu/MenuItem';
6
+ import { OptionsContext } from '../OptionsProvider';
6
7
  export interface SearchBoxProps {
7
8
  search: SearchStore<string>;
8
9
  marker: MarkerService;
@@ -19,6 +20,7 @@ export interface SearchBoxState {
19
20
  export declare class SearchBox extends React.PureComponent<SearchBoxProps, SearchBoxState> {
20
21
  activeItemRef: MenuItem | null;
21
22
  static contextType: React.Context<import("../..").RedocNormalizedOptions>;
23
+ context: React.ContextType<typeof OptionsContext>;
22
24
  constructor(props: any);
23
25
  clearResults(term: string): void;
24
26
  clear: () => void;
@@ -26,5 +28,5 @@ export declare class SearchBox extends React.PureComponent<SearchBoxProps, Searc
26
28
  setResults(results: SearchResult[], term: string): void;
27
29
  searchCallback(searchTerm: string): void;
28
30
  search: (event: React.ChangeEvent<HTMLInputElement>) => void;
29
- render(): JSX.Element;
31
+ render(): React.JSX.Element;
30
32
  }
@@ -1,11 +1,11 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  export declare const SearchWrap: import("styled-components").StyledComponent<"div", import("../../theme").ResolvedThemeInterface, {}, never>;
3
3
  export declare const SearchInput: import("styled-components").StyledComponent<"input", import("../../theme").ResolvedThemeInterface, {
4
4
  className: "search-input";
5
5
  }, "className">;
6
6
  export declare const SearchIcon: import("styled-components").StyledComponent<(props: {
7
7
  className?: string;
8
- }) => JSX.Element, import("../../theme").ResolvedThemeInterface, {
8
+ }) => React.JSX.Element, import("../../theme").ResolvedThemeInterface, {
9
9
  className: "search-icon";
10
10
  }, "className">;
11
11
  export declare const SearchResultsBox: import("styled-components").StyledComponent<"div", import("../../theme").ResolvedThemeInterface, {}, never>;
@@ -5,5 +5,5 @@ export interface OAuthFlowProps {
5
5
  flow: OpenAPISecurityScheme['flows'][keyof OpenAPISecurityScheme['flows']];
6
6
  RequiredScopes?: JSX.Element;
7
7
  }
8
- export declare function OAuthFlowComponent(props: OAuthFlowProps): JSX.Element;
8
+ export declare function OAuthFlowComponent(props: OAuthFlowProps): React.JSX.Element;
9
9
  export declare const OAuthFlow: React.NamedExoticComponent<OAuthFlowProps>;
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { SecuritySchemeModel } from '../../services';
3
3
  interface SecuritySchemaProps {
4
4
  RequiredScopes?: JSX.Element;
5
5
  scheme: SecuritySchemeModel;
6
6
  }
7
- export declare function SecurityDetails(props: SecuritySchemaProps): JSX.Element;
7
+ export declare function SecurityDetails(props: SecuritySchemaProps): React.JSX.Element;
8
8
  export {};
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
2
1
  import { SecurityRequirementModel } from '../../services/models/SecurityRequirement';
2
+ import * as React from 'react';
3
3
  export interface SecurityRequirementProps {
4
4
  security: SecurityRequirementModel;
5
5
  showSecuritySchemeType?: boolean;
6
6
  expanded: boolean;
7
7
  }
8
- export declare function SecurityHeader(props: SecurityRequirementProps): JSX.Element;
8
+ export declare function SecurityHeader(props: SecurityRequirementProps): React.JSX.Element;
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import { SecurityRequirementModel } from '../../services/models/SecurityRequirement';
3
3
  export interface SecurityRequirementsProps {
4
4
  securities: SecurityRequirementModel[];
5
5
  }
6
- export declare function SecurityRequirements(props: SecurityRequirementsProps): JSX.Element | null;
6
+ export declare function SecurityRequirements(props: SecurityRequirementsProps): React.JSX.Element | null;
@@ -10,5 +10,5 @@ export interface SecurityDefsProps {
10
10
  securitySchemes: SecuritySchemesModel;
11
11
  }
12
12
  export declare class SecurityDefs extends React.PureComponent<SecurityDefsProps> {
13
- render(): JSX.Element[];
13
+ render(): React.JSX.Element[];
14
14
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- export declare class SelectOnClick extends React.PureComponent {
2
+ export declare class SelectOnClick extends React.PureComponent<React.PropsWithChildren<any>> {
3
3
  private child;
4
4
  selectElement: () => void;
5
- render(): JSX.Element;
5
+ render(): React.JSX.Element;
6
6
  }
@@ -13,10 +13,10 @@ export declare class MenuItem extends React.Component<MenuItemProps> {
13
13
  componentDidMount(): void;
14
14
  componentDidUpdate(): void;
15
15
  scrollIntoViewIfActive(): void;
16
- render(): JSX.Element;
16
+ render(): React.JSX.Element;
17
17
  }
18
18
  export interface OperationMenuItemContentProps {
19
19
  item: OperationModel;
20
20
  children?: React.ReactChild;
21
21
  }
22
- export declare const OperationMenuItemContent: (props: OperationMenuItemContentProps) => JSX.Element;
22
+ export declare const OperationMenuItemContent: (props: OperationMenuItemContentProps) => React.JSX.Element;
@@ -9,5 +9,5 @@ export interface MenuItemsProps {
9
9
  className?: string;
10
10
  }
11
11
  export declare class MenuItems extends React.Component<MenuItemsProps> {
12
- render(): JSX.Element;
12
+ render(): React.JSX.Element;
13
13
  }
@@ -1,13 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import { MenuStore } from '../../services';
3
3
  import type { IMenuItem } from '../../services';
4
+ import { OptionsContext } from '../OptionsProvider';
4
5
  export declare class SideMenu extends React.Component<{
5
6
  menu: MenuStore;
6
7
  className?: string;
7
8
  }> {
8
9
  static contextType: React.Context<import("../../services").RedocNormalizedOptions>;
10
+ context: React.ContextType<typeof OptionsContext>;
9
11
  private _updateScroll?;
10
- render(): JSX.Element;
12
+ render(): React.JSX.Element;
11
13
  activate: (item: IMenuItem) => void;
12
14
  private saveScrollUpdate;
13
15
  }
@@ -3,6 +3,7 @@ export declare const OperationBadge: import("styled-components").StyledComponent
3
3
  className: `operation-type ${string}`;
4
4
  } & {
5
5
  type: string;
6
+ color?: string | undefined;
6
7
  }, "className">;
7
8
  export declare const MenuItemUl: import("styled-components").StyledComponent<"ul", ResolvedThemeInterface, {
8
9
  $expanded: boolean;
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  export interface SourceCodeProps {
3
3
  source: string;
4
4
  lang: string;
5
5
  }
6
- export declare const SourceCode: (props: SourceCodeProps) => JSX.Element;
7
- export declare const SourceCodeWithCopy: (props: SourceCodeProps) => JSX.Element;
6
+ export declare const SourceCode: (props: SourceCodeProps) => React.JSX.Element;
7
+ export declare const SourceCodeWithCopy: (props: SourceCodeProps) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  export declare const AnimatedChevronButton: ({ open }: {
3
3
  open: boolean;
4
- }) => JSX.Element;
4
+ }) => React.JSX.Element;
@@ -10,7 +10,7 @@ export interface StickySidebarProps {
10
10
  export interface StickySidebarState {
11
11
  offsetTop?: string;
12
12
  }
13
- export declare class StickyResponsiveSidebar extends React.Component<StickySidebarProps, StickySidebarState> {
13
+ export declare class StickyResponsiveSidebar extends React.Component<React.PropsWithChildren<StickySidebarProps>, StickySidebarState> {
14
14
  static contextType: React.Context<RedocNormalizedOptions>;
15
15
  context: React.ContextType<typeof OptionsContext>;
16
16
  state: StickySidebarState;
@@ -18,6 +18,6 @@ export declare class StickyResponsiveSidebar extends React.Component<StickySideb
18
18
  componentDidMount(): void;
19
19
  componentWillUnmount(): void;
20
20
  getScrollYOffset(options: RedocNormalizedOptions): string;
21
- render(): JSX.Element;
21
+ render(): React.JSX.Element;
22
22
  private toggleNavMenu;
23
23
  }
@@ -4,7 +4,7 @@ import { CallbackModel } from './Callback';
4
4
  import { FieldModel } from './Field';
5
5
  import { RequestBodyModel } from './RequestBody';
6
6
  import { ResponseModel } from './Response';
7
- import type { OpenAPIExternalDocumentation, OpenAPIServer, OpenAPIXCodeSample } from '../../types';
7
+ import type { OpenAPIExternalDocumentation, OpenAPIServer, OpenAPIXBadges, OpenAPIXCodeSample } from '../../types';
8
8
  import type { OpenAPIParser } from '../OpenAPIParser';
9
9
  import type { RedocNormalizedOptions } from '../RedocNormalizedOptions';
10
10
  import type { MediaContentModel } from './MediaContent';
@@ -40,6 +40,7 @@ export declare class OperationModel implements IMenuItem {
40
40
  operationId?: string;
41
41
  operationHash?: string;
42
42
  httpVerb: string;
43
+ badges: OpenAPIXBadges[];
43
44
  deprecated: boolean;
44
45
  path: string;
45
46
  servers: OpenAPIServer[];
@@ -62,6 +62,11 @@ export interface OpenAPIXCodeSample {
62
62
  label?: string;
63
63
  source: string;
64
64
  }
65
+ export interface OpenAPIXBadges {
66
+ name: string;
67
+ color?: string;
68
+ position?: 'before' | 'after';
69
+ }
65
70
  export interface OpenAPIOperation {
66
71
  tags?: string[];
67
72
  summary?: string;
@@ -79,6 +84,7 @@ export interface OpenAPIOperation {
79
84
  servers?: OpenAPIServer[];
80
85
  'x-codeSamples'?: OpenAPIXCodeSample[];
81
86
  'x-code-samples'?: OpenAPIXCodeSample[];
87
+ 'x-badges'?: OpenAPIXBadges[];
82
88
  }
83
89
  export interface OpenAPIParameter {
84
90
  name: string;
@@ -70,6 +70,12 @@ export interface OpenAPIXCodeSample {
70
70
  source: string;
71
71
  }
72
72
 
73
+ export interface OpenAPIXBadges {
74
+ name: string;
75
+ color?: string;
76
+ position?: 'before' | 'after';
77
+ }
78
+
73
79
  export interface OpenAPIOperation {
74
80
  tags?: string[];
75
81
  summary?: string;
@@ -85,6 +91,7 @@ export interface OpenAPIOperation {
85
91
  servers?: OpenAPIServer[];
86
92
  'x-codeSamples'?: OpenAPIXCodeSample[];
87
93
  'x-code-samples'?: OpenAPIXCodeSample[]; // deprecated
94
+ 'x-badges'?: OpenAPIXBadges[];
88
95
  }
89
96
 
90
97
  export interface OpenAPIParameter {