@camunda8/docusaurus-theme-openapi-docs 4.5.1
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/babel.config.js +35 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +81 -0
- package/lib/markdown/createDescription.d.ts +1 -0
- package/lib/markdown/createDescription.js +15 -0
- package/lib/markdown/schema.d.ts +3 -0
- package/lib/markdown/schema.js +154 -0
- package/lib/markdown/utils.d.ts +10 -0
- package/lib/markdown/utils.js +49 -0
- package/lib/markdown/utils.test.d.ts +1 -0
- package/lib/markdown/utils.test.js +43 -0
- package/lib/theme/ApiExplorer/Accept/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Accept/index.js +38 -0
- package/lib/theme/ApiExplorer/Accept/slice.d.ts +11 -0
- package/lib/theme/ApiExplorer/Accept/slice.js +22 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.d.ts +4 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +35 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +41 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +153 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +147 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +58 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.d.ts +14 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +248 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +59 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +51 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +110 -0
- package/lib/theme/ApiExplorer/Authorization/auth-types.d.ts +3 -0
- package/lib/theme/ApiExplorer/Authorization/auth-types.js +28 -0
- package/lib/theme/ApiExplorer/Authorization/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Authorization/index.js +201 -0
- package/lib/theme/ApiExplorer/Authorization/slice.d.ts +40 -0
- package/lib/theme/ApiExplorer/Authorization/slice.js +102 -0
- package/lib/theme/ApiExplorer/Body/index.d.ts +10 -0
- package/lib/theme/ApiExplorer/Body/index.js +394 -0
- package/lib/theme/ApiExplorer/Body/json2xml.js +43 -0
- package/lib/theme/ApiExplorer/Body/slice.d.ts +82 -0
- package/lib/theme/ApiExplorer/Body/slice.js +97 -0
- 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 +11 -0
- package/lib/theme/ApiExplorer/CodeSnippets/index.js +435 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.d.ts +5 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.js +133 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
- package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +505 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.js +283 -0
- package/lib/theme/ApiExplorer/ContentType/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ContentType/index.js +40 -0
- package/lib/theme/ApiExplorer/ContentType/slice.d.ts +11 -0
- package/lib/theme/ApiExplorer/ContentType/slice.js +22 -0
- package/lib/theme/ApiExplorer/Export/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Export/index.js +57 -0
- package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
- package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/FloatingButton/index.js +28 -0
- package/lib/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
- package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/FormFileUpload/index.js +178 -0
- package/lib/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
- package/lib/theme/ApiExplorer/FormItem/index.d.ts +10 -0
- package/lib/theme/ApiExplorer/FormItem/index.js +49 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +9 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/index.js +51 -0
- package/lib/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
- package/lib/theme/ApiExplorer/FormSelect/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/FormSelect/index.js +35 -0
- package/lib/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
- package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +11 -0
- package/lib/theme/ApiExplorer/FormTextInput/index.js +80 -0
- package/lib/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
- package/lib/theme/ApiExplorer/LiveEditor/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/LiveEditor/index.js +176 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/index.js +86 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +230 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +71 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +97 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +72 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.js +38 -0
- package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
- package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/ParamOptions/index.js +233 -0
- package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +17 -0
- package/lib/theme/ApiExplorer/ParamOptions/slice.js +25 -0
- package/lib/theme/ApiExplorer/Request/_Request.scss +129 -0
- package/lib/theme/ApiExplorer/Request/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/Request/index.js +443 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.js +223 -0
- package/lib/theme/ApiExplorer/Response/_Response.scss +121 -0
- package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/Response/index.js +207 -0
- package/lib/theme/ApiExplorer/Response/slice.d.ts +17 -0
- package/lib/theme/ApiExplorer/Response/slice.js +51 -0
- package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/SecuritySchemes/index.js +519 -0
- package/lib/theme/ApiExplorer/Server/_Server.scss +26 -0
- package/lib/theme/ApiExplorer/Server/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Server/index.js +213 -0
- package/lib/theme/ApiExplorer/Server/slice.d.ts +13 -0
- package/lib/theme/ApiExplorer/Server/slice.js +33 -0
- package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +20 -0
- package/lib/theme/ApiExplorer/buildPostmanRequest.js +511 -0
- package/lib/theme/ApiExplorer/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/index.js +107 -0
- package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +19 -0
- package/lib/theme/ApiExplorer/persistanceMiddleware.js +54 -0
- package/lib/theme/ApiExplorer/storage-utils.d.ts +4 -0
- package/lib/theme/ApiExplorer/storage-utils.js +41 -0
- package/lib/theme/ApiItem/Layout/index.d.ts +3 -0
- package/lib/theme/ApiItem/Layout/index.js +121 -0
- package/lib/theme/ApiItem/Layout/styles.module.css +17 -0
- package/lib/theme/ApiItem/hooks.d.ts +12 -0
- package/lib/theme/ApiItem/hooks.js +13 -0
- package/lib/theme/ApiItem/index.d.ts +2 -0
- package/lib/theme/ApiItem/index.js +238 -0
- package/lib/theme/ApiItem/store.d.ts +58 -0
- package/lib/theme/ApiItem/store.js +53 -0
- package/lib/theme/ApiLogo/index.d.ts +2 -0
- package/lib/theme/ApiLogo/index.js +51 -0
- package/lib/theme/ApiTabs/_ApiTabs.scss +142 -0
- package/lib/theme/ApiTabs/index.d.ts +7 -0
- package/lib/theme/ApiTabs/index.js +275 -0
- package/lib/theme/ArrayBrackets/index.d.ts +3 -0
- package/lib/theme/ArrayBrackets/index.js +50 -0
- package/lib/theme/CodeSamples/_CodeSamples.scss +3 -0
- package/lib/theme/CodeSamples/index.d.ts +8 -0
- package/lib/theme/CodeSamples/index.js +27 -0
- package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
- package/lib/theme/DiscriminatorTabs/index.d.ts +3 -0
- package/lib/theme/DiscriminatorTabs/index.js +258 -0
- package/lib/theme/Markdown/Details/_Details.scss +122 -0
- package/lib/theme/Markdown/index.js +179 -0
- package/lib/theme/MimeTabs/_MimeTabs.scss +70 -0
- package/lib/theme/MimeTabs/index.d.ts +6 -0
- package/lib/theme/MimeTabs/index.js +286 -0
- package/lib/theme/OperationTabs/_OperationTabs.scss +72 -0
- package/lib/theme/OperationTabs/index.d.ts +3 -0
- package/lib/theme/OperationTabs/index.js +248 -0
- package/lib/theme/ParamsDetails/index.d.ts +6 -0
- package/lib/theme/ParamsDetails/index.js +93 -0
- package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/lib/theme/ParamsItem/index.d.ts +22 -0
- package/lib/theme/ParamsItem/index.js +281 -0
- package/lib/theme/RequestSchema/index.d.ts +15 -0
- package/lib/theme/RequestSchema/index.js +208 -0
- package/lib/theme/ResponseExamples/index.d.ts +18 -0
- package/lib/theme/ResponseExamples/index.js +213 -0
- package/lib/theme/ResponseHeaders/index.d.ts +13 -0
- package/lib/theme/ResponseHeaders/index.js +39 -0
- package/lib/theme/ResponseSchema/index.d.ts +15 -0
- package/lib/theme/ResponseSchema/index.js +165 -0
- package/lib/theme/Schema/index.d.ts +8 -0
- package/lib/theme/Schema/index.js +853 -0
- package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/lib/theme/SchemaItem/index.d.ts +12 -0
- package/lib/theme/SchemaItem/index.js +314 -0
- package/lib/theme/SchemaTabs/_SchemaTabs.scss +61 -0
- package/lib/theme/SchemaTabs/index.d.ts +3 -0
- package/lib/theme/SchemaTabs/index.js +255 -0
- package/lib/theme/SkeletonLoader/index.d.ts +6 -0
- package/lib/theme/SkeletonLoader/index.js +20 -0
- package/lib/theme/StatusCodes/index.d.ts +9 -0
- package/lib/theme/StatusCodes/index.js +90 -0
- package/lib/theme/styles.scss +215 -0
- package/lib/theme/translationIds.d.ts +83 -0
- package/lib/theme/translationIds.js +106 -0
- package/lib/types.d.ts +46 -0
- package/lib/types.js +8 -0
- package/package.json +85 -0
- package/src/index.ts +85 -0
- package/src/markdown/createDescription.ts +13 -0
- package/src/markdown/schema.ts +186 -0
- package/src/markdown/utils.test.ts +49 -0
- package/src/markdown/utils.ts +59 -0
- package/src/plugin-content-docs.d.ts +20 -0
- package/src/postman-code-generators.d.ts +9 -0
- package/src/react-magic-dropzone.d.ts +9 -0
- package/src/theme/ApiExplorer/Accept/index.tsx +36 -0
- package/src/theme/ApiExplorer/Accept/slice.ts +29 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.tsx +32 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.tsx +34 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.tsx +134 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.tsx +83 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.tsx +55 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.tsx +166 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.tsx +48 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.tsx +54 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/index.tsx +45 -0
- package/src/theme/ApiExplorer/Authorization/auth-types.ts +30 -0
- package/src/theme/ApiExplorer/Authorization/index.tsx +199 -0
- package/src/theme/ApiExplorer/Authorization/slice.ts +146 -0
- package/src/theme/ApiExplorer/Body/index.tsx +388 -0
- package/src/theme/ApiExplorer/Body/json2xml.d.ts +8 -0
- package/src/theme/ApiExplorer/Body/json2xml.js +43 -0
- package/src/theme/ApiExplorer/Body/slice.ts +133 -0
- package/src/theme/ApiExplorer/CodeSnippets/code-snippets-types.ts +57 -0
- package/src/theme/ApiExplorer/CodeSnippets/index.tsx +383 -0
- package/src/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
- package/src/theme/ApiExplorer/CodeSnippets/languages.ts +139 -0
- package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +505 -0
- package/src/theme/ApiExplorer/CodeTabs/index.tsx +261 -0
- package/src/theme/ApiExplorer/ContentType/index.tsx +38 -0
- package/src/theme/ApiExplorer/ContentType/slice.ts +29 -0
- package/src/theme/ApiExplorer/Export/index.tsx +47 -0
- package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
- package/src/theme/ApiExplorer/FloatingButton/index.tsx +29 -0
- package/src/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
- package/src/theme/ApiExplorer/FormFileUpload/index.tsx +124 -0
- package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
- package/src/theme/ApiExplorer/FormItem/index.tsx +40 -0
- package/src/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
- package/src/theme/ApiExplorer/FormMultiSelect/index.tsx +57 -0
- package/src/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
- package/src/theme/ApiExplorer/FormSelect/index.tsx +38 -0
- package/src/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
- package/src/theme/ApiExplorer/FormTextInput/index.tsx +89 -0
- package/src/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
- package/src/theme/ApiExplorer/LiveEditor/index.tsx +122 -0
- package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
- package/src/theme/ApiExplorer/MethodEndpoint/index.tsx +91 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +185 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +72 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +94 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +74 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx +38 -0
- package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
- package/src/theme/ApiExplorer/ParamOptions/index.tsx +154 -0
- package/src/theme/ApiExplorer/ParamOptions/slice.ts +37 -0
- package/src/theme/ApiExplorer/Request/_Request.scss +129 -0
- package/src/theme/ApiExplorer/Request/index.tsx +352 -0
- package/src/theme/ApiExplorer/Request/makeRequest.ts +255 -0
- package/src/theme/ApiExplorer/Response/_Response.scss +121 -0
- package/src/theme/ApiExplorer/Response/index.tsx +173 -0
- package/src/theme/ApiExplorer/Response/slice.ts +52 -0
- package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +375 -0
- package/src/theme/ApiExplorer/Server/_Server.scss +26 -0
- package/src/theme/ApiExplorer/Server/index.tsx +138 -0
- package/src/theme/ApiExplorer/Server/slice.ts +39 -0
- package/src/theme/ApiExplorer/buildPostmanRequest.ts +524 -0
- package/src/theme/ApiExplorer/index.tsx +52 -0
- package/src/theme/ApiExplorer/persistanceMiddleware.ts +73 -0
- package/src/theme/ApiExplorer/storage-utils.ts +39 -0
- package/src/theme/ApiItem/Layout/index.tsx +85 -0
- package/src/theme/ApiItem/Layout/styles.module.css +17 -0
- package/src/theme/ApiItem/hooks.ts +13 -0
- package/src/theme/ApiItem/index.tsx +222 -0
- package/src/theme/ApiItem/store.ts +51 -0
- package/src/theme/ApiLogo/index.tsx +52 -0
- package/src/theme/ApiTabs/_ApiTabs.scss +142 -0
- package/src/theme/ApiTabs/index.tsx +243 -0
- package/src/theme/ArrayBrackets/index.tsx +37 -0
- package/src/theme/CodeSamples/_CodeSamples.scss +3 -0
- package/src/theme/CodeSamples/index.tsx +26 -0
- package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
- package/src/theme/DiscriminatorTabs/index.tsx +229 -0
- package/src/theme/Markdown/Details/_Details.scss +122 -0
- package/src/theme/Markdown/index.d.ts +8 -0
- package/src/theme/Markdown/index.js +179 -0
- package/src/theme/MimeTabs/_MimeTabs.scss +70 -0
- package/src/theme/MimeTabs/index.tsx +257 -0
- package/src/theme/OperationTabs/_OperationTabs.scss +72 -0
- package/src/theme/OperationTabs/index.tsx +220 -0
- package/src/theme/ParamsDetails/index.tsx +90 -0
- package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/src/theme/ParamsItem/index.tsx +246 -0
- package/src/theme/RequestSchema/index.tsx +172 -0
- package/src/theme/ResponseExamples/index.tsx +209 -0
- package/src/theme/ResponseHeaders/index.tsx +49 -0
- package/src/theme/ResponseSchema/index.tsx +150 -0
- package/src/theme/Schema/index.tsx +938 -0
- package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/src/theme/SchemaItem/index.tsx +273 -0
- package/src/theme/SchemaTabs/_SchemaTabs.scss +61 -0
- package/src/theme/SchemaTabs/index.tsx +224 -0
- package/src/theme/SkeletonLoader/index.tsx +18 -0
- package/src/theme/StatusCodes/index.tsx +83 -0
- package/src/theme/styles.scss +215 -0
- package/src/theme/translationIds.ts +103 -0
- package/src/theme-classic.d.ts +80 -0
- package/src/theme-openapi.d.ts +20 -0
- package/src/types.ts +72 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Copyright (c) Palo Alto Networks
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
|
9
|
+
|
|
10
|
+
export interface FileContent {
|
|
11
|
+
type: "file";
|
|
12
|
+
value: {
|
|
13
|
+
src: string;
|
|
14
|
+
content: Blob;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface StringContent {
|
|
19
|
+
type: "string";
|
|
20
|
+
value?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type Content = FileContent | StringContent | undefined;
|
|
24
|
+
|
|
25
|
+
export interface FormBody {
|
|
26
|
+
type: "form";
|
|
27
|
+
content: {
|
|
28
|
+
[key: string]: Content;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface RawBody {
|
|
33
|
+
type: "raw";
|
|
34
|
+
content: Content;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface EmptyBody {
|
|
38
|
+
type: "empty";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type Body = EmptyBody | FormBody | RawBody;
|
|
42
|
+
|
|
43
|
+
export type State = Body;
|
|
44
|
+
|
|
45
|
+
const initialState: State = {} as any;
|
|
46
|
+
|
|
47
|
+
export const slice = createSlice({
|
|
48
|
+
name: "body",
|
|
49
|
+
initialState,
|
|
50
|
+
reducers: {
|
|
51
|
+
clearRawBody: (_state) => {
|
|
52
|
+
return {
|
|
53
|
+
type: "empty",
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
setStringRawBody: (_state, action: PayloadAction<string>) => {
|
|
57
|
+
return {
|
|
58
|
+
type: "raw",
|
|
59
|
+
content: {
|
|
60
|
+
type: "string",
|
|
61
|
+
value: action.payload,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
setFileRawBody: (_state, action: PayloadAction<FileContent["value"]>) => {
|
|
66
|
+
return {
|
|
67
|
+
type: "raw",
|
|
68
|
+
content: {
|
|
69
|
+
type: "file",
|
|
70
|
+
value: action.payload,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
clearFormBodyKey: (state, action: PayloadAction<string>) => {
|
|
75
|
+
if (state?.type === "form") {
|
|
76
|
+
delete state.content[action.payload];
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
setStringFormBody: (
|
|
80
|
+
state,
|
|
81
|
+
action: PayloadAction<{ key: string; value: string }>
|
|
82
|
+
) => {
|
|
83
|
+
if (state?.type !== "form") {
|
|
84
|
+
return {
|
|
85
|
+
type: "form",
|
|
86
|
+
content: {
|
|
87
|
+
[action.payload.key]: {
|
|
88
|
+
type: "string",
|
|
89
|
+
value: action.payload.value,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
state.content[action.payload.key] = {
|
|
95
|
+
type: "string",
|
|
96
|
+
value: action.payload.value,
|
|
97
|
+
};
|
|
98
|
+
return state;
|
|
99
|
+
},
|
|
100
|
+
setFileFormBody: (
|
|
101
|
+
state,
|
|
102
|
+
action: PayloadAction<{ key: string; value: FileContent["value"] }>
|
|
103
|
+
) => {
|
|
104
|
+
if (state?.type !== "form") {
|
|
105
|
+
return {
|
|
106
|
+
type: "form",
|
|
107
|
+
content: {
|
|
108
|
+
[action.payload.key]: {
|
|
109
|
+
type: "file",
|
|
110
|
+
value: action.payload.value,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
state.content[action.payload.key] = {
|
|
116
|
+
type: "file",
|
|
117
|
+
value: action.payload.value,
|
|
118
|
+
};
|
|
119
|
+
return state;
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export const {
|
|
125
|
+
clearRawBody,
|
|
126
|
+
setStringRawBody,
|
|
127
|
+
setFileRawBody,
|
|
128
|
+
clearFormBodyKey,
|
|
129
|
+
setStringFormBody,
|
|
130
|
+
setFileFormBody,
|
|
131
|
+
} = slice.actions;
|
|
132
|
+
|
|
133
|
+
export default slice.reducer;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Copyright (c) Palo Alto Networks
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
// https://github.com/github-linguist/linguist/blob/master/lib/linguist/popular.yml
|
|
9
|
+
export type CodeSampleLanguage =
|
|
10
|
+
| "C"
|
|
11
|
+
| "C#"
|
|
12
|
+
| "C++"
|
|
13
|
+
| "CoffeeScript"
|
|
14
|
+
| "CSS"
|
|
15
|
+
| "Dart"
|
|
16
|
+
| "DM"
|
|
17
|
+
| "Elixir"
|
|
18
|
+
| "Go"
|
|
19
|
+
| "Groovy"
|
|
20
|
+
| "HTML"
|
|
21
|
+
| "Java"
|
|
22
|
+
| "JavaScript"
|
|
23
|
+
| "Kotlin"
|
|
24
|
+
| "Objective-C"
|
|
25
|
+
| "OCaml"
|
|
26
|
+
| "Perl"
|
|
27
|
+
| "PHP"
|
|
28
|
+
| "PowerShell"
|
|
29
|
+
| "Python"
|
|
30
|
+
| "R"
|
|
31
|
+
| "Ruby"
|
|
32
|
+
| "Rust"
|
|
33
|
+
| "Scala"
|
|
34
|
+
| "Shell"
|
|
35
|
+
| "Swift"
|
|
36
|
+
| "TypeScript";
|
|
37
|
+
|
|
38
|
+
export interface Language {
|
|
39
|
+
highlight: string;
|
|
40
|
+
language: string;
|
|
41
|
+
codeSampleLanguage: CodeSampleLanguage;
|
|
42
|
+
logoClass: string;
|
|
43
|
+
variant: string;
|
|
44
|
+
variants: string[];
|
|
45
|
+
options?: { [key: string]: boolean };
|
|
46
|
+
sample?: string;
|
|
47
|
+
samples?: string[];
|
|
48
|
+
samplesSources?: string[];
|
|
49
|
+
samplesLabels?: string[];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// https://redocly.com/docs/api-reference-docs/specification-extensions/x-code-samples
|
|
53
|
+
export interface CodeSample {
|
|
54
|
+
source: string;
|
|
55
|
+
lang: CodeSampleLanguage;
|
|
56
|
+
label?: string;
|
|
57
|
+
}
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Copyright (c) Palo Alto Networks
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import React, { useState, useEffect } from "react";
|
|
9
|
+
|
|
10
|
+
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
|
|
11
|
+
import ApiCodeBlock from "@theme/ApiExplorer/ApiCodeBlock";
|
|
12
|
+
import buildPostmanRequest from "@theme/ApiExplorer/buildPostmanRequest";
|
|
13
|
+
import CodeTabs from "@theme/ApiExplorer/CodeTabs";
|
|
14
|
+
import { useTypedSelector } from "@theme/ApiItem/hooks";
|
|
15
|
+
import cloneDeep from "lodash/cloneDeep";
|
|
16
|
+
import codegen from "postman-code-generators";
|
|
17
|
+
import * as sdk from "postman-collection";
|
|
18
|
+
|
|
19
|
+
import { CodeSample, Language } from "./code-snippets-types";
|
|
20
|
+
import {
|
|
21
|
+
getCodeSampleSourceFromLanguage,
|
|
22
|
+
mergeArraysbyLanguage,
|
|
23
|
+
mergeCodeSampleLanguage,
|
|
24
|
+
generateLanguageSet,
|
|
25
|
+
} from "./languages";
|
|
26
|
+
|
|
27
|
+
export const languageSet: Language[] = generateLanguageSet();
|
|
28
|
+
|
|
29
|
+
export interface Props {
|
|
30
|
+
postman: sdk.Request;
|
|
31
|
+
codeSamples: CodeSample[];
|
|
32
|
+
maskCredentials?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function CodeTab({ children, hidden, className }: any): React.JSX.Element {
|
|
36
|
+
return (
|
|
37
|
+
<div role="tabpanel" className={className} {...{ hidden }}>
|
|
38
|
+
{children}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function CodeSnippets({
|
|
44
|
+
postman,
|
|
45
|
+
codeSamples,
|
|
46
|
+
maskCredentials: propMaskCredentials,
|
|
47
|
+
}: Props) {
|
|
48
|
+
const { siteConfig } = useDocusaurusContext();
|
|
49
|
+
|
|
50
|
+
const contentType = useTypedSelector((state: any) => state.contentType.value);
|
|
51
|
+
const accept = useTypedSelector((state: any) => state.accept.value);
|
|
52
|
+
const server = useTypedSelector((state: any) => state.server.value);
|
|
53
|
+
const body = useTypedSelector((state: any) => state.body);
|
|
54
|
+
|
|
55
|
+
const pathParams = useTypedSelector((state: any) => state.params.path);
|
|
56
|
+
const queryParams = useTypedSelector((state: any) => state.params.query);
|
|
57
|
+
const cookieParams = useTypedSelector((state: any) => state.params.cookie);
|
|
58
|
+
const headerParams = useTypedSelector((state: any) => state.params.header);
|
|
59
|
+
|
|
60
|
+
const auth = useTypedSelector((state: any) => state.auth);
|
|
61
|
+
|
|
62
|
+
// Check if credential masking is enabled (default: true)
|
|
63
|
+
const maskCredentials = propMaskCredentials ?? true;
|
|
64
|
+
|
|
65
|
+
// Clone Auth if maskCredentials is not false
|
|
66
|
+
const cleanedAuth = maskCredentials
|
|
67
|
+
? (() => {
|
|
68
|
+
const clonedAuth = cloneDeep(auth);
|
|
69
|
+
let placeholder: string;
|
|
70
|
+
|
|
71
|
+
function cleanCredentials(obj: any) {
|
|
72
|
+
for (const key in obj) {
|
|
73
|
+
if (typeof obj[key] === "object" && obj[key] !== null) {
|
|
74
|
+
// use name as placeholder if exists
|
|
75
|
+
const comboAuthId = Object.keys(obj).join(" and ");
|
|
76
|
+
const authOptions =
|
|
77
|
+
clonedAuth?.options?.[key] ??
|
|
78
|
+
clonedAuth?.options?.[comboAuthId];
|
|
79
|
+
placeholder = authOptions?.[0]?.name;
|
|
80
|
+
obj[key] = cleanCredentials(obj[key]);
|
|
81
|
+
} else {
|
|
82
|
+
obj[key] = `<${placeholder ?? key}>`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return obj;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
...clonedAuth,
|
|
91
|
+
data: cleanCredentials(clonedAuth.data),
|
|
92
|
+
};
|
|
93
|
+
})()
|
|
94
|
+
: auth;
|
|
95
|
+
|
|
96
|
+
// Create a Postman request object using cleanedAuth or original auth
|
|
97
|
+
const cleanedPostmanRequest = buildPostmanRequest(postman, {
|
|
98
|
+
queryParams,
|
|
99
|
+
pathParams,
|
|
100
|
+
cookieParams,
|
|
101
|
+
contentType,
|
|
102
|
+
accept,
|
|
103
|
+
headerParams,
|
|
104
|
+
body,
|
|
105
|
+
server,
|
|
106
|
+
auth: cleanedAuth,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// User-defined languages array
|
|
110
|
+
// Can override languageSet, change order of langs, override options and variants
|
|
111
|
+
const userDefinedLanguageSet =
|
|
112
|
+
(siteConfig?.themeConfig?.languageTabs as Language[] | undefined) ??
|
|
113
|
+
languageSet;
|
|
114
|
+
|
|
115
|
+
// Filter languageSet by user-defined langs
|
|
116
|
+
const filteredLanguageSet = languageSet.filter((ls) => {
|
|
117
|
+
return userDefinedLanguageSet?.some((lang) => {
|
|
118
|
+
return lang.language === ls.language;
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// Merge user-defined langs into languageSet
|
|
123
|
+
const mergedLangs = mergeCodeSampleLanguage(
|
|
124
|
+
mergeArraysbyLanguage(userDefinedLanguageSet, filteredLanguageSet),
|
|
125
|
+
codeSamples
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
// Read defaultLang from localStorage
|
|
129
|
+
const defaultLang: Language[] = mergedLangs.filter(
|
|
130
|
+
(lang) =>
|
|
131
|
+
lang.language === localStorage.getItem("docusaurus.tab.code-samples")
|
|
132
|
+
);
|
|
133
|
+
const [selectedVariant, setSelectedVariant] = useState<string | undefined>();
|
|
134
|
+
const [selectedSample, setSelectedSample] = useState<string | undefined>();
|
|
135
|
+
const [language, setLanguage] = useState(() => {
|
|
136
|
+
// Return first index if only 1 user-defined language exists
|
|
137
|
+
if (mergedLangs.length === 1) {
|
|
138
|
+
return mergedLangs[0];
|
|
139
|
+
}
|
|
140
|
+
// Fall back to language in localStorage or first user-defined language
|
|
141
|
+
return defaultLang[0] ?? mergedLangs[0];
|
|
142
|
+
});
|
|
143
|
+
const [codeText, setCodeText] = useState<string>("");
|
|
144
|
+
const [codeSampleCodeText, setCodeSampleCodeText] = useState<string>(() =>
|
|
145
|
+
getCodeSampleSourceFromLanguage(language)
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
useEffect(() => {
|
|
149
|
+
if (language && !!language.sample) {
|
|
150
|
+
setCodeSampleCodeText(getCodeSampleSourceFromLanguage(language));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (language && !!language.options) {
|
|
154
|
+
codegen.convert(
|
|
155
|
+
language.language,
|
|
156
|
+
language.variant,
|
|
157
|
+
cleanedPostmanRequest,
|
|
158
|
+
language.options,
|
|
159
|
+
(error: any, snippet: string) => {
|
|
160
|
+
if (error) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
setCodeText(snippet);
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
} else if (language && !language.options) {
|
|
167
|
+
const langSource = mergedLangs.filter(
|
|
168
|
+
(lang) => lang.language === language.language
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
// Merges user-defined language with default languageSet
|
|
172
|
+
// This allows users to define only the minimal properties necessary in languageTabs
|
|
173
|
+
// User-defined properties should override languageSet properties
|
|
174
|
+
const mergedLanguage = { ...langSource[0], ...language };
|
|
175
|
+
codegen.convert(
|
|
176
|
+
mergedLanguage.language,
|
|
177
|
+
mergedLanguage.variant,
|
|
178
|
+
cleanedPostmanRequest,
|
|
179
|
+
mergedLanguage.options,
|
|
180
|
+
(error: any, snippet: string) => {
|
|
181
|
+
if (error) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
setCodeText(snippet);
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
} else {
|
|
188
|
+
setCodeText("");
|
|
189
|
+
}
|
|
190
|
+
}, [
|
|
191
|
+
accept,
|
|
192
|
+
body,
|
|
193
|
+
contentType,
|
|
194
|
+
cookieParams,
|
|
195
|
+
headerParams,
|
|
196
|
+
language,
|
|
197
|
+
pathParams,
|
|
198
|
+
postman,
|
|
199
|
+
queryParams,
|
|
200
|
+
server,
|
|
201
|
+
cleanedPostmanRequest,
|
|
202
|
+
mergedLangs,
|
|
203
|
+
]);
|
|
204
|
+
// no dependencies was intentionally set for this particular hook. it's safe as long as if conditions are set
|
|
205
|
+
useEffect(function onSelectedVariantUpdate() {
|
|
206
|
+
if (selectedVariant && selectedVariant !== language?.variant) {
|
|
207
|
+
codegen.convert(
|
|
208
|
+
language.language,
|
|
209
|
+
selectedVariant,
|
|
210
|
+
cleanedPostmanRequest,
|
|
211
|
+
language.options,
|
|
212
|
+
(error: any, snippet: string) => {
|
|
213
|
+
if (error) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
setCodeText(snippet);
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// no dependencies was intentionally set for this particular hook. it's safe as long as if conditions are set
|
|
223
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
224
|
+
useEffect(function onSelectedSampleUpdate() {
|
|
225
|
+
if (
|
|
226
|
+
language &&
|
|
227
|
+
language.samples &&
|
|
228
|
+
language.samplesSources &&
|
|
229
|
+
selectedSample &&
|
|
230
|
+
selectedSample !== language.sample
|
|
231
|
+
) {
|
|
232
|
+
const sampleIndex = language.samples.findIndex(
|
|
233
|
+
(smp) => smp === selectedSample
|
|
234
|
+
);
|
|
235
|
+
setCodeSampleCodeText(language.samplesSources[sampleIndex]);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
if (language === undefined) {
|
|
240
|
+
return null;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return (
|
|
244
|
+
<>
|
|
245
|
+
{/* Outer language tabs */}
|
|
246
|
+
<CodeTabs
|
|
247
|
+
groupId="code-samples"
|
|
248
|
+
action={{
|
|
249
|
+
setLanguage: setLanguage,
|
|
250
|
+
setSelectedVariant: setSelectedVariant,
|
|
251
|
+
setSelectedSample: setSelectedSample,
|
|
252
|
+
}}
|
|
253
|
+
languageSet={mergedLangs}
|
|
254
|
+
defaultValue={defaultLang[0]?.language ?? mergedLangs[0].language}
|
|
255
|
+
lazy
|
|
256
|
+
>
|
|
257
|
+
{mergedLangs.map((lang) => {
|
|
258
|
+
return (
|
|
259
|
+
<CodeTab
|
|
260
|
+
value={lang.language}
|
|
261
|
+
label={lang.language}
|
|
262
|
+
key={lang.language}
|
|
263
|
+
attributes={{
|
|
264
|
+
className: `openapi-tabs__code-item--${lang.logoClass}`,
|
|
265
|
+
}}
|
|
266
|
+
>
|
|
267
|
+
{/* Combined inner tabs: samples + variants in one row */}
|
|
268
|
+
{lang.samples ? (
|
|
269
|
+
<CodeTabs
|
|
270
|
+
className="openapi-tabs__code-container-inner"
|
|
271
|
+
action={{
|
|
272
|
+
setLanguage: setLanguage,
|
|
273
|
+
setSelectedSample: setSelectedSample,
|
|
274
|
+
setSelectedVariant: setSelectedVariant,
|
|
275
|
+
}}
|
|
276
|
+
includeSample={true}
|
|
277
|
+
includeVariant={
|
|
278
|
+
!(
|
|
279
|
+
lang.variants.length === 1 &&
|
|
280
|
+
lang.variants[0] === lang.language
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
currentLanguage={lang}
|
|
284
|
+
defaultValue={lang.samples[0]}
|
|
285
|
+
languageSet={mergedLangs}
|
|
286
|
+
lazy
|
|
287
|
+
>
|
|
288
|
+
{[
|
|
289
|
+
...lang.samples.map((sample, index) => (
|
|
290
|
+
<CodeTab
|
|
291
|
+
value={sample}
|
|
292
|
+
label={
|
|
293
|
+
lang.samplesLabels
|
|
294
|
+
? lang.samplesLabels[index]
|
|
295
|
+
: sample
|
|
296
|
+
}
|
|
297
|
+
key={`${lang.language}-sample-${index}`}
|
|
298
|
+
attributes={{
|
|
299
|
+
className: `openapi-tabs__code-item--sample`,
|
|
300
|
+
}}
|
|
301
|
+
>
|
|
302
|
+
{/* @ts-ignore */}
|
|
303
|
+
<ApiCodeBlock
|
|
304
|
+
language={lang.highlight}
|
|
305
|
+
className="openapi-explorer__code-block"
|
|
306
|
+
showLineNumbers={true}
|
|
307
|
+
>
|
|
308
|
+
{codeSampleCodeText}
|
|
309
|
+
</ApiCodeBlock>
|
|
310
|
+
</CodeTab>
|
|
311
|
+
)),
|
|
312
|
+
...(!(
|
|
313
|
+
lang.variants.length === 1 &&
|
|
314
|
+
lang.variants[0] === lang.language
|
|
315
|
+
)
|
|
316
|
+
? lang.variants.map((variant, index) => (
|
|
317
|
+
<CodeTab
|
|
318
|
+
value={variant.toLowerCase()}
|
|
319
|
+
label={variant.toUpperCase()}
|
|
320
|
+
key={`${lang.language}-variant-${index}`}
|
|
321
|
+
attributes={{
|
|
322
|
+
className: `openapi-tabs__code-item--variant`,
|
|
323
|
+
}}
|
|
324
|
+
>
|
|
325
|
+
{/* @ts-ignore */}
|
|
326
|
+
<ApiCodeBlock
|
|
327
|
+
language={lang.highlight}
|
|
328
|
+
className="openapi-explorer__code-block"
|
|
329
|
+
showLineNumbers={true}
|
|
330
|
+
>
|
|
331
|
+
{codeText}
|
|
332
|
+
</ApiCodeBlock>
|
|
333
|
+
</CodeTab>
|
|
334
|
+
))
|
|
335
|
+
: []),
|
|
336
|
+
]}
|
|
337
|
+
</CodeTabs>
|
|
338
|
+
) : (
|
|
339
|
+
/* Variant-only inner tabs */
|
|
340
|
+
<CodeTabs
|
|
341
|
+
className="openapi-tabs__code-container-inner"
|
|
342
|
+
action={{
|
|
343
|
+
setLanguage: setLanguage,
|
|
344
|
+
setSelectedVariant: setSelectedVariant,
|
|
345
|
+
}}
|
|
346
|
+
includeVariant={true}
|
|
347
|
+
currentLanguage={lang}
|
|
348
|
+
defaultValue={selectedVariant}
|
|
349
|
+
languageSet={mergedLangs}
|
|
350
|
+
lazy
|
|
351
|
+
>
|
|
352
|
+
{lang.variants.map((variant, index) => {
|
|
353
|
+
return (
|
|
354
|
+
<CodeTab
|
|
355
|
+
value={variant.toLowerCase()}
|
|
356
|
+
label={variant.toUpperCase()}
|
|
357
|
+
key={`${lang.language}-${lang.variant}`}
|
|
358
|
+
attributes={{
|
|
359
|
+
className: `openapi-tabs__code-item--variant`,
|
|
360
|
+
}}
|
|
361
|
+
>
|
|
362
|
+
{/* @ts-ignore */}
|
|
363
|
+
<ApiCodeBlock
|
|
364
|
+
language={lang.highlight}
|
|
365
|
+
className="openapi-explorer__code-block"
|
|
366
|
+
showLineNumbers={true}
|
|
367
|
+
>
|
|
368
|
+
{codeText}
|
|
369
|
+
</ApiCodeBlock>
|
|
370
|
+
</CodeTab>
|
|
371
|
+
);
|
|
372
|
+
})}
|
|
373
|
+
</CodeTabs>
|
|
374
|
+
)}
|
|
375
|
+
</CodeTab>
|
|
376
|
+
);
|
|
377
|
+
})}
|
|
378
|
+
</CodeTabs>
|
|
379
|
+
</>
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export default CodeSnippets;
|