docusaurus-theme-openapi-docs 3.0.0-beta.1 → 3.0.0-beta.10
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/markdown/utils.d.ts +3 -2
- package/lib/markdown/utils.js +1 -1
- package/lib/markdown/utils.test.d.ts +1 -0
- package/lib/markdown/utils.test.js +43 -0
- package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.d.ts +13 -0
- package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +199 -124
- package/lib/theme/ApiExplorer/Accept/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.d.ts +4 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +25 -19
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +4 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +27 -16
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +4 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +115 -96
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +115 -54
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +41 -30
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.d.ts +14 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +200 -120
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +36 -24
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +35 -28
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +72 -14
- package/lib/theme/ApiExplorer/Authorization/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/Authorization/slice.d.ts +1 -1
- package/lib/theme/ApiExplorer/Body/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/Body/index.js +8 -1
- package/lib/theme/ApiExplorer/Body/slice.d.ts +3 -3
- package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.d.ts +21 -0
- package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.js +8 -0
- package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +4 -14
- package/lib/theme/ApiExplorer/CodeSnippets/index.js +86 -8
- package/lib/theme/ApiExplorer/CodeSnippets/languages.d.ts +3 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.js +48 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.json +0 -96
- package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +18 -2
- package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.js +131 -76
- package/lib/theme/ApiExplorer/ContentType/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/Export/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +3 -1
- package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/FormItem/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/FormSelect/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +2 -2
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +2 -2
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +2 -2
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +4 -4
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +2 -2
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.d.ts +2 -2
- package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +2 -1
- package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +1 -1
- package/lib/theme/ApiExplorer/Request/_Request.scss +4 -2
- package/lib/theme/ApiExplorer/Request/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/Request/makeRequest.js +50 -1
- package/lib/theme/ApiExplorer/Response/_Response.scss +4 -2
- package/lib/theme/ApiExplorer/Response/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/Response/index.js +19 -19
- package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/Server/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +1 -1
- package/lib/theme/ApiExplorer/index.d.ts +2 -2
- package/lib/theme/ApiExplorer/index.js +1 -1
- package/lib/theme/ApiExplorer/storage-utils.d.ts +1 -1
- package/lib/theme/ApiItem/index.js +28 -3
- package/lib/theme/ApiItem/store.d.ts +6 -6
- package/lib/theme/ApiLogo/index.d.ts +2 -2
- package/lib/theme/ApiTabs/_ApiTabs.scss +3 -1
- package/lib/theme/ApiTabs/index.d.ts +7 -0
- package/lib/theme/ApiTabs/index.js +167 -103
- package/lib/theme/DiscriminatorTabs/index.d.ts +3 -0
- package/lib/theme/DiscriminatorTabs/index.js +152 -98
- package/lib/theme/Markdown/index.js +37 -0
- package/lib/theme/MimeTabs/index.d.ts +6 -0
- package/lib/theme/MimeTabs/index.js +169 -118
- package/lib/theme/OperationTabs/_OperationTabs.scss +71 -0
- package/lib/theme/OperationTabs/index.d.ts +3 -0
- package/lib/theme/OperationTabs/index.js +234 -0
- package/lib/theme/ParamsItem/index.d.ts +23 -0
- package/lib/theme/ParamsItem/index.js +170 -111
- package/lib/theme/ResponseSamples/index.d.ts +8 -0
- package/lib/theme/ResponseSamples/index.js +18 -13
- package/lib/theme/SchemaItem/index.d.ts +12 -0
- package/lib/theme/SchemaItem/index.js +121 -89
- package/lib/theme/SchemaTabs/_SchemaTabs.scss +0 -4
- package/lib/theme/SchemaTabs/index.d.ts +3 -0
- package/lib/theme/SchemaTabs/index.js +148 -95
- package/lib/theme/styles.scss +5 -0
- package/lib/types.d.ts +4 -4
- package/package.json +8 -7
- package/src/markdown/utils.test.ts +49 -0
- package/src/markdown/utils.ts +5 -3
- package/src/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/{index.js → index.tsx} +21 -8
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/{index.js → index.tsx} +6 -3
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/{Element.js → Element.tsx} +5 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/{String.js → String.tsx} +4 -4
- package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/{index.js → index.tsx} +8 -3
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/{index.js → index.tsx} +9 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/{index.js → index.tsx} +12 -2
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/{index.js → index.tsx} +2 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/{index.js → index.tsx} +11 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/{index.js → index.tsx} +10 -5
- package/src/theme/ApiExplorer/Body/index.tsx +3 -1
- package/src/theme/ApiExplorer/CodeSnippets/code-snippets-types.ts +55 -0
- package/src/theme/ApiExplorer/CodeSnippets/index.tsx +94 -21
- package/src/theme/ApiExplorer/CodeSnippets/languages.json +0 -96
- package/src/theme/ApiExplorer/CodeSnippets/languages.ts +53 -0
- package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +18 -2
- package/src/theme/ApiExplorer/CodeTabs/{index.js → index.tsx} +64 -25
- package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +3 -1
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +4 -4
- package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +2 -1
- package/src/theme/ApiExplorer/Request/_Request.scss +4 -2
- package/src/theme/ApiExplorer/Request/makeRequest.ts +59 -4
- package/src/theme/ApiExplorer/Response/_Response.scss +4 -2
- package/src/theme/ApiExplorer/Response/index.tsx +2 -2
- package/src/theme/ApiExplorer/index.tsx +1 -1
- package/src/theme/ApiItem/index.tsx +22 -3
- package/src/theme/ApiLogo/index.tsx +1 -1
- package/src/theme/ApiTabs/_ApiTabs.scss +3 -1
- package/src/theme/ApiTabs/{index.js → index.tsx} +75 -31
- package/src/theme/DiscriminatorTabs/{index.js → index.tsx} +63 -28
- package/src/theme/Markdown/index.js +37 -0
- package/src/theme/MimeTabs/{index.js → index.tsx} +64 -30
- package/src/theme/OperationTabs/_OperationTabs.scss +71 -0
- package/src/theme/OperationTabs/index.tsx +218 -0
- package/src/theme/ParamsItem/{index.js → index.tsx} +48 -17
- package/src/theme/ResponseSamples/{index.js → index.tsx} +10 -1
- package/src/theme/SchemaItem/{index.js → index.tsx} +24 -18
- package/src/theme/SchemaTabs/_SchemaTabs.scss +0 -4
- package/src/theme/SchemaTabs/{index.js → index.tsx} +62 -29
- package/src/theme/styles.scss +5 -0
- package/src/theme-classic.d.ts +69 -2
- package/src/theme-openapi.d.ts +6 -0
- package/tsconfig.json +4 -1
package/src/theme-classic.d.ts
CHANGED
|
@@ -8,6 +8,73 @@
|
|
|
8
8
|
/// <reference types="@docusaurus/theme-classic" />
|
|
9
9
|
|
|
10
10
|
declare module "@docusaurus/theme-common/internal" {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
import { CSSProperties, ReactNode, RefObject } from "react";
|
|
12
|
+
|
|
13
|
+
import type { PropDocContent } from "@docusaurus/plugin-content-docs";
|
|
14
|
+
import { MagicCommentConfig } from "@docusaurus/theme-common/lib/utils/codeBlockUtils";
|
|
15
|
+
import {
|
|
16
|
+
TabsProps as ITabsProps,
|
|
17
|
+
TabValue,
|
|
18
|
+
} from "@docusaurus/theme-common/lib/utils/tabsUtils";
|
|
19
|
+
import { Props as ICodeBlockProps } from "@theme/CodeBlock";
|
|
20
|
+
import { Props as ICopyButtonProps } from "@theme/CodeBlock/CopyButton";
|
|
21
|
+
import { Props as ILineProps } from "@theme/CodeBlock/Line";
|
|
22
|
+
import { PrismTheme } from "prism-react-renderer";
|
|
23
|
+
|
|
24
|
+
export interface TabProps extends ITabsProps {}
|
|
25
|
+
|
|
26
|
+
export interface CopyButtonProps extends ICopyButtonProps {}
|
|
27
|
+
export interface LineProps extends ILineProps {}
|
|
28
|
+
export interface CodeBlockProps extends ICodeBlockProps {}
|
|
29
|
+
|
|
30
|
+
export function useDoc();
|
|
31
|
+
|
|
32
|
+
export function usePrismTheme(): PrismTheme;
|
|
33
|
+
|
|
34
|
+
export function sanitizeTabsChildren(children: TabProps["children"]);
|
|
35
|
+
|
|
36
|
+
export function getPrismCssVariables(prismTheme: PrismTheme): CSSProperties;
|
|
37
|
+
|
|
38
|
+
export function parseCodeBlockTitle(metastring?: string): string;
|
|
39
|
+
|
|
40
|
+
export function parseLanguage(className: string): string | undefined;
|
|
41
|
+
|
|
42
|
+
export function containsLineNumbers(metastring?: string): boolean;
|
|
43
|
+
|
|
44
|
+
export function useScrollPositionBlocker(): {
|
|
45
|
+
blockElementScrollPositionUntilNextRender: (el: HTMLElement) => void;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export function DocProvider({
|
|
49
|
+
children,
|
|
50
|
+
content,
|
|
51
|
+
}: {
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
content: PropDocContent;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export function useTabs(props: TabProps): {
|
|
57
|
+
selectedValue: string;
|
|
58
|
+
selectValue: (value: string) => void;
|
|
59
|
+
tabValues: readonly TabValue[];
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export function parseLines(
|
|
63
|
+
content: string,
|
|
64
|
+
options: {
|
|
65
|
+
metastring: string | undefined;
|
|
66
|
+
language: string | undefined;
|
|
67
|
+
magicComments: MagicCommentConfig[];
|
|
68
|
+
}
|
|
69
|
+
): {
|
|
70
|
+
lineClassNames: { [lineIndex: number]: string[] };
|
|
71
|
+
code: string;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export function useCodeWordWrap(): {
|
|
75
|
+
readonly codeBlockRef: RefObject<HTMLPreElement>;
|
|
76
|
+
readonly isEnabled: boolean;
|
|
77
|
+
readonly isCodeScrollable: boolean;
|
|
78
|
+
readonly toggle: () => void;
|
|
79
|
+
};
|
|
13
80
|
}
|
package/src/theme-openapi.d.ts
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
/// <reference types="docusaurus-plugin-openapi-docs" />
|
|
9
9
|
|
|
10
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
11
|
+
|
|
10
12
|
declare module "@docusaurus/plugin-content-docs-types" {
|
|
11
13
|
// Makes all properties visible when hovering over the type
|
|
12
14
|
type Expand<T extends Record<string, unknown>> = { [P in keyof T]: T[P] };
|
|
@@ -63,6 +65,10 @@ declare module "@theme/SchemaTabs" {
|
|
|
63
65
|
export default function SchemaTabs(props: any): JSX.Element;
|
|
64
66
|
}
|
|
65
67
|
|
|
68
|
+
declare module "@theme/Markdown" {
|
|
69
|
+
export default function Markdown(props: any): JSX.Element;
|
|
70
|
+
}
|
|
71
|
+
|
|
66
72
|
declare module "@theme/ApiExplorer/Accept" {
|
|
67
73
|
export default function Accept(): JSX.Element;
|
|
68
74
|
}
|