docusaurus-theme-openapi-docs 0.0.0-1000
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/LICENSE +21 -0
- 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 +149 -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 +3 -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 +160 -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 +381 -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 +10 -0
- package/lib/theme/ApiExplorer/CodeSnippets/index.js +389 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.d.ts +5 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.js +95 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
- package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +501 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.js +271 -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 +173 -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 +44 -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 +9 -0
- package/lib/theme/ApiExplorer/FormTextInput/index.js +73 -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 +168 -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 +220 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +63 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +89 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +63 -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 +223 -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 +396 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.js +222 -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 +193 -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 +380 -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 +199 -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 +465 -0
- package/lib/theme/ApiExplorer/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/index.js +41 -0
- package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +3 -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 +46 -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 +270 -0
- package/lib/theme/ArrayBrackets/index.d.ts +3 -0
- package/lib/theme/ArrayBrackets/index.js +50 -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 +85 -0
- package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/lib/theme/ParamsItem/index.d.ts +25 -0
- package/lib/theme/ParamsItem/index.js +218 -0
- package/lib/theme/RequestSchema/index.d.ts +15 -0
- package/lib/theme/RequestSchema/index.js +194 -0
- package/lib/theme/ResponseExamples/index.d.ts +18 -0
- package/lib/theme/ResponseExamples/index.js +193 -0
- package/lib/theme/ResponseHeaders/index.d.ts +13 -0
- package/lib/theme/ResponseHeaders/index.js +39 -0
- package/lib/theme/ResponseSamples/_ResponseSamples.scss +3 -0
- package/lib/theme/ResponseSamples/index.d.ts +8 -0
- package/lib/theme/ResponseSamples/index.js +27 -0
- package/lib/theme/ResponseSchema/index.d.ts +15 -0
- package/lib/theme/ResponseSchema/index.js +159 -0
- package/lib/theme/Schema/index.d.ts +8 -0
- package/lib/theme/Schema/index.js +885 -0
- package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/lib/theme/SchemaItem/index.d.ts +12 -0
- package/lib/theme/SchemaItem/index.js +213 -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 +81 -0
- package/lib/theme/styles.scss +212 -0
- package/lib/types.d.ts +157 -0
- package/lib/types.js +8 -0
- package/package.json +83 -0
- package/src/index.ts +85 -0
- package/src/markdown/createDescription.ts +13 -0
- package/src/markdown/schema.ts +181 -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 +79 -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 +158 -0
- package/src/theme/ApiExplorer/Authorization/slice.ts +146 -0
- package/src/theme/ApiExplorer/Body/index.tsx +376 -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 +338 -0
- package/src/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
- package/src/theme/ApiExplorer/CodeSnippets/languages.ts +96 -0
- package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +501 -0
- package/src/theme/ApiExplorer/CodeTabs/index.tsx +248 -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 +119 -0
- package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
- package/src/theme/ApiExplorer/FormItem/index.tsx +33 -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 +80 -0
- package/src/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
- package/src/theme/ApiExplorer/LiveEditor/index.tsx +114 -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 +175 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +64 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +86 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +65 -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 +146 -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 +309 -0
- package/src/theme/ApiExplorer/Request/makeRequest.ts +254 -0
- package/src/theme/ApiExplorer/Response/_Response.scss +121 -0
- package/src/theme/ApiExplorer/Response/index.tsx +157 -0
- package/src/theme/ApiExplorer/Response/slice.ts +52 -0
- package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +287 -0
- package/src/theme/ApiExplorer/Server/_Server.scss +26 -0
- package/src/theme/ApiExplorer/Server/index.tsx +130 -0
- package/src/theme/ApiExplorer/Server/slice.ts +39 -0
- package/src/theme/ApiExplorer/buildPostmanRequest.ts +526 -0
- package/src/theme/ApiExplorer/index.tsx +41 -0
- package/src/theme/ApiExplorer/persistanceMiddleware.ts +71 -0
- package/src/theme/ApiExplorer/postman-collection.d.ts +10 -0
- package/src/theme/ApiExplorer/react-modal.d.ts +8 -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 +238 -0
- package/src/theme/ArrayBrackets/index.tsx +37 -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.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 +81 -0
- package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/src/theme/ParamsItem/index.tsx +205 -0
- package/src/theme/RequestSchema/index.tsx +157 -0
- package/src/theme/ResponseExamples/index.tsx +192 -0
- package/src/theme/ResponseHeaders/index.tsx +49 -0
- package/src/theme/ResponseSamples/_ResponseSamples.scss +3 -0
- package/src/theme/ResponseSamples/index.tsx +31 -0
- package/src/theme/ResponseSchema/index.tsx +144 -0
- package/src/theme/Schema/index.tsx +939 -0
- package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/src/theme/SchemaItem/index.tsx +198 -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 +72 -0
- package/src/theme/styles.scss +212 -0
- package/src/theme-classic.d.ts +80 -0
- package/src/theme-openapi.d.ts +288 -0
- package/src/theme-translations.d.ts +9 -0
- package/src/types.ts +182 -0
- package/tsconfig.json +16 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
.openapi-schema__container {
|
|
2
|
+
&:hover {
|
|
3
|
+
.openapi-schema__property {
|
|
4
|
+
color: var(--ifm-color-primary);
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.openapi-schema__list-item {
|
|
10
|
+
list-style: none;
|
|
11
|
+
position: relative;
|
|
12
|
+
margin: 0 !important;
|
|
13
|
+
padding: 5px 0 5px 1rem;
|
|
14
|
+
border-left: thin solid var(--openapi-tree-line-color) !important;
|
|
15
|
+
|
|
16
|
+
// Horizontal line styling for schema properties
|
|
17
|
+
&::before {
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 10px;
|
|
20
|
+
left: 0;
|
|
21
|
+
width: 0.7rem;
|
|
22
|
+
/* width of horizontal line */
|
|
23
|
+
height: 0.5rem;
|
|
24
|
+
/* vertical position of line */
|
|
25
|
+
vertical-align: top;
|
|
26
|
+
border-bottom: thin solid var(--openapi-tree-line-color);
|
|
27
|
+
content: "";
|
|
28
|
+
display: inline-block;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.openapi-schema__name {
|
|
33
|
+
opacity: 0.6;
|
|
34
|
+
padding-left: 0.3rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.openapi-schema__required {
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
font-size: 10.5px;
|
|
41
|
+
font-weight: bold;
|
|
42
|
+
text-transform: uppercase;
|
|
43
|
+
color: var(--openapi-required);
|
|
44
|
+
margin-left: 1%;
|
|
45
|
+
background-color: transparent;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.openapi-schema__deprecated {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
font-size: 10.5px;
|
|
52
|
+
font-weight: bold;
|
|
53
|
+
text-transform: uppercase;
|
|
54
|
+
color: var(--openapi-deprecated);
|
|
55
|
+
margin-left: 1%;
|
|
56
|
+
background-color: transparent;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.openapi-schema__nullable {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
font-size: 10.5px;
|
|
63
|
+
font-weight: bold;
|
|
64
|
+
text-transform: uppercase;
|
|
65
|
+
color: var(--openapi-nullable);
|
|
66
|
+
margin-left: 1%;
|
|
67
|
+
background-color: transparent;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.openapi-schema__strikethrough {
|
|
71
|
+
text-decoration: line-through;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.openapi-schema__property {
|
|
75
|
+
margin-top: 1.25px;
|
|
76
|
+
font-family: var(--ifm-font-family-monospace);
|
|
77
|
+
transition: 300ms;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.openapi-schema__divider {
|
|
81
|
+
flex-grow: 1;
|
|
82
|
+
border-bottom: thin solid var(--ifm-toc-border-color);
|
|
83
|
+
margin: 10px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.openapi-schema__container {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export interface Props {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
collapsible?: boolean;
|
|
5
|
+
name?: string;
|
|
6
|
+
qualifierMessage?: string | undefined;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
schemaName?: string;
|
|
9
|
+
schema?: any;
|
|
10
|
+
discriminator?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export default function SchemaItem(props: Props): React.JSX.Element;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* Copyright (c) Palo Alto Networks
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
* ========================================================================== */
|
|
8
|
+
var __importDefault =
|
|
9
|
+
(this && this.__importDefault) ||
|
|
10
|
+
function (mod) {
|
|
11
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.default = SchemaItem;
|
|
15
|
+
const react_1 = __importDefault(require("react"));
|
|
16
|
+
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
17
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
18
|
+
const utils_1 = require("../../markdown/utils");
|
|
19
|
+
const transformEnumDescriptions = (enumDescriptions) => {
|
|
20
|
+
if (enumDescriptions) {
|
|
21
|
+
return Object.entries(enumDescriptions);
|
|
22
|
+
}
|
|
23
|
+
return [];
|
|
24
|
+
};
|
|
25
|
+
const getEnumDescriptionMarkdown = (enumDescriptions) => {
|
|
26
|
+
if (enumDescriptions?.length) {
|
|
27
|
+
return `| Enum Value | Description |
|
|
28
|
+
| ---- | ----- |
|
|
29
|
+
${enumDescriptions
|
|
30
|
+
.map((desc) => {
|
|
31
|
+
return `| ${desc[0]} | ${desc[1]} | `.replaceAll("\n", "<br/>");
|
|
32
|
+
})
|
|
33
|
+
.join("\n")}
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
return "";
|
|
37
|
+
};
|
|
38
|
+
function SchemaItem(props) {
|
|
39
|
+
const {
|
|
40
|
+
children: collapsibleSchemaContent,
|
|
41
|
+
collapsible,
|
|
42
|
+
name,
|
|
43
|
+
qualifierMessage,
|
|
44
|
+
required,
|
|
45
|
+
schemaName,
|
|
46
|
+
schema,
|
|
47
|
+
} = props;
|
|
48
|
+
let deprecated;
|
|
49
|
+
let schemaDescription;
|
|
50
|
+
let defaultValue;
|
|
51
|
+
let example;
|
|
52
|
+
let nullable;
|
|
53
|
+
let enumDescriptions = [];
|
|
54
|
+
if (schema) {
|
|
55
|
+
deprecated = schema.deprecated;
|
|
56
|
+
schemaDescription = schema.description;
|
|
57
|
+
enumDescriptions = transformEnumDescriptions(schema["x-enumDescriptions"]);
|
|
58
|
+
defaultValue = schema.default;
|
|
59
|
+
example = schema.example;
|
|
60
|
+
nullable =
|
|
61
|
+
schema.nullable ||
|
|
62
|
+
(Array.isArray(schema.type) && schema.type.includes("null")); // support JSON Schema nullable
|
|
63
|
+
}
|
|
64
|
+
const renderRequired = (0, utils_1.guard)(
|
|
65
|
+
Array.isArray(required) ? required.includes(name) : required,
|
|
66
|
+
() =>
|
|
67
|
+
react_1.default.createElement(
|
|
68
|
+
"span",
|
|
69
|
+
{ className: "openapi-schema__required" },
|
|
70
|
+
"required"
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
const renderDeprecated = (0, utils_1.guard)(deprecated, () =>
|
|
74
|
+
react_1.default.createElement(
|
|
75
|
+
"span",
|
|
76
|
+
{ className: "openapi-schema__deprecated" },
|
|
77
|
+
"deprecated"
|
|
78
|
+
)
|
|
79
|
+
);
|
|
80
|
+
const renderNullable = (0, utils_1.guard)(nullable, () =>
|
|
81
|
+
react_1.default.createElement(
|
|
82
|
+
"span",
|
|
83
|
+
{ className: "openapi-schema__nullable" },
|
|
84
|
+
"nullable"
|
|
85
|
+
)
|
|
86
|
+
);
|
|
87
|
+
const renderEnumDescriptions = (0, utils_1.guard)(
|
|
88
|
+
getEnumDescriptionMarkdown(enumDescriptions),
|
|
89
|
+
(value) => {
|
|
90
|
+
return react_1.default.createElement(
|
|
91
|
+
"div",
|
|
92
|
+
{ style: { marginTop: ".5rem" } },
|
|
93
|
+
react_1.default.createElement(Markdown_1.default, null, value)
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
const renderSchemaDescription = (0, utils_1.guard)(
|
|
98
|
+
schemaDescription,
|
|
99
|
+
(description) =>
|
|
100
|
+
react_1.default.createElement(
|
|
101
|
+
react_1.default.Fragment,
|
|
102
|
+
null,
|
|
103
|
+
react_1.default.createElement(Markdown_1.default, null, description)
|
|
104
|
+
)
|
|
105
|
+
);
|
|
106
|
+
const renderQualifierMessage = (0, utils_1.guard)(
|
|
107
|
+
qualifierMessage,
|
|
108
|
+
(message) =>
|
|
109
|
+
react_1.default.createElement(
|
|
110
|
+
react_1.default.Fragment,
|
|
111
|
+
null,
|
|
112
|
+
react_1.default.createElement(Markdown_1.default, null, message)
|
|
113
|
+
)
|
|
114
|
+
);
|
|
115
|
+
function renderDefaultValue() {
|
|
116
|
+
if (defaultValue !== undefined) {
|
|
117
|
+
if (typeof defaultValue === "string") {
|
|
118
|
+
return react_1.default.createElement(
|
|
119
|
+
"div",
|
|
120
|
+
null,
|
|
121
|
+
react_1.default.createElement("strong", null, "Default value: "),
|
|
122
|
+
react_1.default.createElement(
|
|
123
|
+
"span",
|
|
124
|
+
null,
|
|
125
|
+
react_1.default.createElement("code", null, defaultValue)
|
|
126
|
+
)
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
return react_1.default.createElement(
|
|
130
|
+
"div",
|
|
131
|
+
null,
|
|
132
|
+
react_1.default.createElement("strong", null, "Default value: "),
|
|
133
|
+
react_1.default.createElement(
|
|
134
|
+
"span",
|
|
135
|
+
null,
|
|
136
|
+
react_1.default.createElement(
|
|
137
|
+
"code",
|
|
138
|
+
null,
|
|
139
|
+
JSON.stringify(defaultValue)
|
|
140
|
+
)
|
|
141
|
+
)
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
function renderExample() {
|
|
147
|
+
if (example !== undefined) {
|
|
148
|
+
if (typeof example === "string") {
|
|
149
|
+
return react_1.default.createElement(
|
|
150
|
+
"div",
|
|
151
|
+
null,
|
|
152
|
+
react_1.default.createElement("strong", null, "Example: "),
|
|
153
|
+
react_1.default.createElement(
|
|
154
|
+
"span",
|
|
155
|
+
null,
|
|
156
|
+
react_1.default.createElement("code", null, example)
|
|
157
|
+
)
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
return react_1.default.createElement(
|
|
161
|
+
"div",
|
|
162
|
+
null,
|
|
163
|
+
react_1.default.createElement("strong", null, "Example: "),
|
|
164
|
+
react_1.default.createElement(
|
|
165
|
+
"span",
|
|
166
|
+
null,
|
|
167
|
+
react_1.default.createElement("code", null, JSON.stringify(example))
|
|
168
|
+
)
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
return undefined;
|
|
172
|
+
}
|
|
173
|
+
const schemaContent = react_1.default.createElement(
|
|
174
|
+
"div",
|
|
175
|
+
null,
|
|
176
|
+
react_1.default.createElement(
|
|
177
|
+
"span",
|
|
178
|
+
{ className: "openapi-schema__container" },
|
|
179
|
+
react_1.default.createElement(
|
|
180
|
+
"strong",
|
|
181
|
+
{
|
|
182
|
+
className: (0, clsx_1.default)("openapi-schema__property", {
|
|
183
|
+
"openapi-schema__strikethrough": deprecated,
|
|
184
|
+
}),
|
|
185
|
+
},
|
|
186
|
+
name
|
|
187
|
+
),
|
|
188
|
+
react_1.default.createElement(
|
|
189
|
+
"span",
|
|
190
|
+
{ className: "openapi-schema__name" },
|
|
191
|
+
Array.isArray(schemaName) ? schemaName.join(" | ") : schemaName
|
|
192
|
+
),
|
|
193
|
+
(nullable || required || deprecated) &&
|
|
194
|
+
react_1.default.createElement("span", {
|
|
195
|
+
className: "openapi-schema__divider",
|
|
196
|
+
}),
|
|
197
|
+
renderNullable,
|
|
198
|
+
renderRequired,
|
|
199
|
+
renderDeprecated
|
|
200
|
+
),
|
|
201
|
+
renderSchemaDescription,
|
|
202
|
+
renderEnumDescriptions,
|
|
203
|
+
renderQualifierMessage,
|
|
204
|
+
renderDefaultValue(),
|
|
205
|
+
renderExample(),
|
|
206
|
+
collapsibleSchemaContent ?? collapsibleSchemaContent
|
|
207
|
+
);
|
|
208
|
+
return react_1.default.createElement(
|
|
209
|
+
"div",
|
|
210
|
+
{ className: "openapi-schema__list-item" },
|
|
211
|
+
collapsible ? collapsibleSchemaContent : schemaContent
|
|
212
|
+
);
|
|
213
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
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
|
+
.openapi-tabs__schema-item {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
padding: 0.35rem 0.7rem;
|
|
13
|
+
border: 1px solid transparent;
|
|
14
|
+
margin-top: 0 !important;
|
|
15
|
+
margin-right: 0.5rem;
|
|
16
|
+
font-weight: var(--ifm-font-weight-bold);
|
|
17
|
+
font-family: var(--ifm-font-family-monospace);
|
|
18
|
+
font-size: 10px;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
transition: 300ms;
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
background-color: transparent;
|
|
24
|
+
border: 1px solid var(--ifm-toc-border-color);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.active {
|
|
28
|
+
border: 1px solid var(--ifm-color-primary);
|
|
29
|
+
color: var(--ifm-color-primary);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:last-child {
|
|
33
|
+
margin-right: 0 !important;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.openapi-tabs__schema-list-container {
|
|
38
|
+
overflow-y: hidden;
|
|
39
|
+
overflow-x: scroll;
|
|
40
|
+
scroll-behavior: smooth;
|
|
41
|
+
scrollbar-width: none;
|
|
42
|
+
|
|
43
|
+
&::-webkit-scrollbar {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&.active {
|
|
48
|
+
background-color: var(--ifm-color-emphasis-100);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.openapi-tabs__schema-label {
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.openapi-tabs__schema-tabs-container {
|
|
57
|
+
width: 100%;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* Copyright (c) Palo Alto Networks
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
* ========================================================================== */
|
|
8
|
+
var __createBinding =
|
|
9
|
+
(this && this.__createBinding) ||
|
|
10
|
+
(Object.create
|
|
11
|
+
? function (o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (
|
|
15
|
+
!desc ||
|
|
16
|
+
("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
|
|
17
|
+
) {
|
|
18
|
+
desc = {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return m[k];
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
Object.defineProperty(o, k2, desc);
|
|
26
|
+
}
|
|
27
|
+
: function (o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
});
|
|
31
|
+
var __setModuleDefault =
|
|
32
|
+
(this && this.__setModuleDefault) ||
|
|
33
|
+
(Object.create
|
|
34
|
+
? function (o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}
|
|
37
|
+
: function (o, v) {
|
|
38
|
+
o["default"] = v;
|
|
39
|
+
});
|
|
40
|
+
var __importStar =
|
|
41
|
+
(this && this.__importStar) ||
|
|
42
|
+
(function () {
|
|
43
|
+
var ownKeys = function (o) {
|
|
44
|
+
ownKeys =
|
|
45
|
+
Object.getOwnPropertyNames ||
|
|
46
|
+
function (o) {
|
|
47
|
+
var ar = [];
|
|
48
|
+
for (var k in o)
|
|
49
|
+
if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
50
|
+
return ar;
|
|
51
|
+
};
|
|
52
|
+
return ownKeys(o);
|
|
53
|
+
};
|
|
54
|
+
return function (mod) {
|
|
55
|
+
if (mod && mod.__esModule) return mod;
|
|
56
|
+
var result = {};
|
|
57
|
+
if (mod != null)
|
|
58
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
59
|
+
if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
60
|
+
__setModuleDefault(result, mod);
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
})();
|
|
64
|
+
var __importDefault =
|
|
65
|
+
(this && this.__importDefault) ||
|
|
66
|
+
function (mod) {
|
|
67
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
68
|
+
};
|
|
69
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
|
+
exports.default = SchemaTabs;
|
|
71
|
+
const react_1 = __importStar(require("react"));
|
|
72
|
+
const internal_1 = require("@docusaurus/theme-common/internal");
|
|
73
|
+
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
74
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
75
|
+
const flatten_1 = __importDefault(require("lodash/flatten"));
|
|
76
|
+
function TabList({ className, block, selectedValue, selectValue, tabValues }) {
|
|
77
|
+
const tabRefs = [];
|
|
78
|
+
const { blockElementScrollPositionUntilNextRender } = (0,
|
|
79
|
+
internal_1.useScrollPositionBlocker)();
|
|
80
|
+
const handleTabChange = (event) => {
|
|
81
|
+
const newTab = event.currentTarget;
|
|
82
|
+
const newTabIndex = tabRefs.indexOf(newTab);
|
|
83
|
+
const newTabValue = tabValues[newTabIndex].value;
|
|
84
|
+
if (newTabValue !== selectedValue) {
|
|
85
|
+
blockElementScrollPositionUntilNextRender(newTab);
|
|
86
|
+
selectValue(newTabValue);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const handleKeydown = (event) => {
|
|
90
|
+
let focusElement = null;
|
|
91
|
+
switch (event.key) {
|
|
92
|
+
case "Enter": {
|
|
93
|
+
handleTabChange(event);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
case "ArrowRight": {
|
|
97
|
+
const nextTab = tabRefs.indexOf(event.currentTarget) + 1;
|
|
98
|
+
focusElement = tabRefs[nextTab] ?? tabRefs[0];
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case "ArrowLeft": {
|
|
102
|
+
const prevTab = tabRefs.indexOf(event.currentTarget) - 1;
|
|
103
|
+
focusElement = tabRefs[prevTab] ?? tabRefs[tabRefs.length - 1];
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
default:
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
focusElement?.focus();
|
|
110
|
+
};
|
|
111
|
+
const tabItemListContainerRef = (0, react_1.useRef)(null);
|
|
112
|
+
const [showTabArrows, setShowTabArrows] = (0, react_1.useState)(false);
|
|
113
|
+
(0, react_1.useEffect)(() => {
|
|
114
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
115
|
+
for (let entry of entries) {
|
|
116
|
+
requestAnimationFrame(() => {
|
|
117
|
+
if (entry.target.clientWidth < entry.target.scrollWidth) {
|
|
118
|
+
setShowTabArrows(true);
|
|
119
|
+
} else {
|
|
120
|
+
setShowTabArrows(false);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
resizeObserver.observe(tabItemListContainerRef.current);
|
|
126
|
+
return () => {
|
|
127
|
+
resizeObserver.disconnect();
|
|
128
|
+
};
|
|
129
|
+
}, []);
|
|
130
|
+
const handleRightClick = (e) => {
|
|
131
|
+
e.preventDefault();
|
|
132
|
+
if (tabItemListContainerRef.current) {
|
|
133
|
+
tabItemListContainerRef.current.scrollLeft += 90;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const handleLeftClick = (e) => {
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
if (tabItemListContainerRef.current) {
|
|
139
|
+
tabItemListContainerRef.current.scrollLeft -= 90;
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
return react_1.default.createElement(
|
|
143
|
+
"div",
|
|
144
|
+
{ className: "openapi-tabs__schema-tabs-container" },
|
|
145
|
+
showTabArrows &&
|
|
146
|
+
react_1.default.createElement("button", {
|
|
147
|
+
className: "openapi-tabs__arrow left",
|
|
148
|
+
onClick: handleLeftClick,
|
|
149
|
+
}),
|
|
150
|
+
react_1.default.createElement(
|
|
151
|
+
"ul",
|
|
152
|
+
{
|
|
153
|
+
ref: tabItemListContainerRef,
|
|
154
|
+
role: "tablist",
|
|
155
|
+
"aria-orientation": "horizontal",
|
|
156
|
+
className: (0, clsx_1.default)(
|
|
157
|
+
"openapi-tabs__schema-list-container",
|
|
158
|
+
"tabs",
|
|
159
|
+
{
|
|
160
|
+
"tabs--block": block,
|
|
161
|
+
},
|
|
162
|
+
className
|
|
163
|
+
),
|
|
164
|
+
},
|
|
165
|
+
tabValues.map(({ value, label, attributes }) =>
|
|
166
|
+
react_1.default.createElement(
|
|
167
|
+
"li",
|
|
168
|
+
{
|
|
169
|
+
// TODO extract TabListItem
|
|
170
|
+
role: "tab",
|
|
171
|
+
tabIndex: selectedValue === value ? 0 : -1,
|
|
172
|
+
"aria-selected": selectedValue === value,
|
|
173
|
+
key: value,
|
|
174
|
+
ref: (tabControl) => {
|
|
175
|
+
tabRefs.push(tabControl);
|
|
176
|
+
},
|
|
177
|
+
onKeyDown: handleKeydown,
|
|
178
|
+
onClick: handleTabChange,
|
|
179
|
+
...attributes,
|
|
180
|
+
className: (0, clsx_1.default)(
|
|
181
|
+
"tabs__item",
|
|
182
|
+
"openapi-tabs__schema-item",
|
|
183
|
+
attributes?.className,
|
|
184
|
+
{
|
|
185
|
+
active: selectedValue === value,
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
},
|
|
189
|
+
react_1.default.createElement(
|
|
190
|
+
"span",
|
|
191
|
+
{ className: "openapi-tabs__schema-label" },
|
|
192
|
+
label ?? value
|
|
193
|
+
)
|
|
194
|
+
)
|
|
195
|
+
)
|
|
196
|
+
),
|
|
197
|
+
showTabArrows &&
|
|
198
|
+
react_1.default.createElement("button", {
|
|
199
|
+
className: "openapi-tabs__arrow right",
|
|
200
|
+
onClick: handleRightClick,
|
|
201
|
+
})
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
function TabContent({ lazy, children, selectedValue }) {
|
|
205
|
+
const childTabs = (Array.isArray(children) ? children : [children]).filter(
|
|
206
|
+
Boolean
|
|
207
|
+
);
|
|
208
|
+
const flattenedChildTabs = (0, flatten_1.default)(childTabs);
|
|
209
|
+
if (lazy) {
|
|
210
|
+
const selectedTabItem = flattenedChildTabs.find(
|
|
211
|
+
(tabItem) => tabItem.props.value === selectedValue
|
|
212
|
+
);
|
|
213
|
+
if (!selectedTabItem) {
|
|
214
|
+
// fail-safe or fail-fast? not sure what's best here
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
return (0, react_1.cloneElement)(selectedTabItem, {
|
|
218
|
+
className: "margin-top--md",
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
return react_1.default.createElement(
|
|
222
|
+
"div",
|
|
223
|
+
{ className: "margin-top--md" },
|
|
224
|
+
childTabs.map((tabItem, i) =>
|
|
225
|
+
(0, react_1.cloneElement)(tabItem, {
|
|
226
|
+
key: i,
|
|
227
|
+
hidden: tabItem.props.value !== selectedValue,
|
|
228
|
+
})
|
|
229
|
+
)
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
function TabsComponent(props) {
|
|
233
|
+
const tabs = (0, internal_1.useTabs)(props);
|
|
234
|
+
return react_1.default.createElement(
|
|
235
|
+
"div",
|
|
236
|
+
{ className: "openapi-tabs__schema-container" },
|
|
237
|
+
react_1.default.createElement(TabList, { ...props, ...tabs }),
|
|
238
|
+
react_1.default.createElement(TabContent, { ...props, ...tabs })
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
function SchemaTabs(props) {
|
|
242
|
+
const isBrowser = (0, useIsBrowser_1.default)();
|
|
243
|
+
return react_1.default.createElement(
|
|
244
|
+
TabsComponent,
|
|
245
|
+
// Remount tabs after hydration
|
|
246
|
+
// Temporary fix for https://github.com/facebook/docusaurus/issues/5653
|
|
247
|
+
{
|
|
248
|
+
// Remount tabs after hydration
|
|
249
|
+
// Temporary fix for https://github.com/facebook/docusaurus/issues/5653
|
|
250
|
+
key: String(isBrowser),
|
|
251
|
+
...props,
|
|
252
|
+
},
|
|
253
|
+
(0, internal_1.sanitizeTabsChildren)(props.children)
|
|
254
|
+
);
|
|
255
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* Copyright (c) Palo Alto Networks
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
* ========================================================================== */
|
|
8
|
+
var __importDefault =
|
|
9
|
+
(this && this.__importDefault) ||
|
|
10
|
+
function (mod) {
|
|
11
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const react_1 = __importDefault(require("react"));
|
|
15
|
+
const SkeletonLoader = (props) => {
|
|
16
|
+
return react_1.default.createElement("div", {
|
|
17
|
+
className: `openapi-skeleton ${props.size ?? "md"}`,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
exports.default = SkeletonLoader;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ApiItem } from "docusaurus-plugin-openapi-docs/lib/types";
|
|
3
|
+
interface Props {
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
responses: ApiItem["responses"];
|
|
7
|
+
}
|
|
8
|
+
declare const StatusCodes: React.FC<Props>;
|
|
9
|
+
export default StatusCodes;
|