docusaurus-theme-openapi-docs 0.0.0-618 → 0.0.0-684
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/index.d.ts +2 -0
- package/lib/index.js +53 -27
- package/lib/markdown/createDescription.d.ts +1 -0
- package/lib/markdown/createDescription.js +8 -11
- package/lib/markdown/schema.d.ts +3 -0
- package/lib/markdown/schema.js +138 -139
- package/lib/markdown/utils.d.ts +8 -0
- package/lib/markdown/utils.js +36 -42
- package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +165 -0
- package/lib/theme/ApiDemoPanel/ApiCodeBlock/Line/_Line.scss +46 -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-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Accept/slice.js +7 -5
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +29 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +30 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +134 -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.js +74 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +47 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +156 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +46 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +47 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +44 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +40 -0
- package/lib/theme/ApiExplorer/Authorization/auth-types.d.ts +3 -0
- package/lib/theme/{ApiDemoPanel → ApiExplorer}/Authorization/auth-types.js +4 -10
- package/lib/theme/ApiExplorer/Authorization/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Authorization/index.js +157 -0
- package/lib/theme/ApiExplorer/Authorization/slice.d.ts +40 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Authorization/slice.js +23 -16
- package/lib/theme/ApiExplorer/Body/index.d.ts +10 -0
- package/lib/theme/ApiExplorer/Body/index.js +363 -0
- package/lib/theme/ApiExplorer/Body/slice.d.ts +82 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Body/slice.js +21 -12
- package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +20 -0
- package/lib/theme/ApiExplorer/CodeSnippets/index.js +406 -0
- package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +291 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.js +174 -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-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/ContentType/slice.js +7 -5
- 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 +25 -0
- package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/FloatingButton/index.js +28 -0
- package/{lib-next/theme/ApiDemoPanel/FormFileUpload/styles.module.css → lib/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss} +32 -35
- package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/FormFileUpload/index.js +161 -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/{src/theme/ApiDemoPanel/FormSelect/styles.module.css → lib/theme/ApiExplorer/FormSelect/_FormSelect.scss} +15 -23
- 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 +154 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/index.js +83 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +194 -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/{src/theme/ApiDemoPanel/ParamOptions/styles.module.css → lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss} +38 -92
- package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/ParamOptions/index.js +210 -0
- package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +17 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/ParamOptions/slice.js +7 -5
- package/lib/theme/ApiExplorer/Request/_Request.scss +122 -0
- package/lib/theme/ApiExplorer/Request/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/Request/index.js +365 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
- package/{lib-next/theme/ApiDemoPanel/Execute → lib/theme/ApiExplorer/Request}/makeRequest.js +10 -9
- package/lib/theme/ApiExplorer/Response/_Response.scss +119 -0
- package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/Response/index.js +190 -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/{src/theme/ApiDemoPanel/Request/styles.module.css → lib/theme/ApiExplorer/Server/_Server.scss} +15 -7
- package/lib/theme/ApiExplorer/Server/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Server/index.js +187 -0
- package/lib/theme/ApiExplorer/Server/slice.d.ts +13 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Server/slice.js +10 -5
- package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +20 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/buildPostmanRequest.js +27 -40
- package/lib/theme/ApiExplorer/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/index.js +37 -0
- package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +3 -0
- package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/persistanceMiddleware.js +11 -14
- package/lib/theme/ApiExplorer/storage-utils.d.ts +4 -0
- package/lib/theme/{ApiDemoPanel → ApiExplorer}/storage-utils.js +14 -13
- package/lib/theme/ApiItem/Layout/index.d.ts +4 -0
- package/lib/theme/ApiItem/Layout/index.js +78 -56
- package/lib/theme/ApiItem/hooks.d.ts +12 -0
- package/lib/theme/ApiItem/hooks.js +5 -10
- package/lib/theme/ApiItem/index.d.ts +4 -0
- package/lib/theme/ApiItem/index.js +141 -118
- package/lib/theme/ApiItem/store.d.ts +46 -0
- package/lib/theme/ApiItem/store.js +44 -34
- package/lib/theme/ApiLogo/index.d.ts +2 -0
- package/lib/theme/ApiLogo/index.js +34 -32
- package/lib/theme/ApiTabs/_ApiTabs.scss +140 -0
- package/lib/theme/ApiTabs/index.js +105 -190
- package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +97 -0
- package/lib/theme/DiscriminatorTabs/index.js +102 -189
- package/lib/theme/Markdown/Details/_Details.scss +119 -0
- package/lib/theme/MimeTabs/_MimeTabs.scss +69 -0
- package/lib/theme/MimeTabs/index.js +125 -199
- package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/lib/theme/ParamsItem/index.js +9 -8
- package/lib/theme/ResponseSamples/_ResponseSamples.scss +3 -0
- package/lib/theme/ResponseSamples/index.js +2 -7
- package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/lib/theme/SchemaItem/index.js +31 -22
- package/lib/theme/SchemaTabs/_SchemaTabs.scss +64 -0
- package/lib/theme/SchemaTabs/index.js +97 -185
- package/lib/theme/styles.scss +160 -0
- package/lib/types.d.ts +157 -0
- package/lib/types.js +8 -1
- package/package.json +17 -23
- package/src/index.ts +33 -3
- package/src/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +165 -0
- package/src/theme/ApiDemoPanel/ApiCodeBlock/Line/_Line.scss +46 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Accept/index.tsx +2 -2
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.js +29 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +30 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.js +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.js +74 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +47 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +156 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +46 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.js +47 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +44 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/index.js +40 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Authorization/index.tsx +3 -3
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Authorization/slice.ts +1 -1
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Body/index.tsx +64 -41
- package/src/theme/{ApiDemoPanel/Curl → ApiExplorer/CodeSnippets}/index.tsx +94 -34
- package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +291 -0
- package/src/theme/ApiExplorer/CodeTabs/index.js +174 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/ContentType/index.tsx +2 -2
- package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +25 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FloatingButton/index.tsx +1 -3
- package/src/theme/{ApiDemoPanel/FormFileUpload/styles.module.css → ApiExplorer/FormFileUpload/_FormFileUpload.scss} +32 -35
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormFileUpload/index.tsx +10 -6
- package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormItem/index.tsx +8 -12
- package/src/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormMultiSelect/index.tsx +6 -3
- package/{lib/theme/ApiDemoPanel/FormSelect/styles.module.css → src/theme/ApiExplorer/FormSelect/_FormSelect.scss} +15 -23
- package/src/theme/{ApiDemoPanel → ApiExplorer}/FormSelect/index.tsx +5 -3
- 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 +112 -0
- package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
- package/src/theme/ApiExplorer/MethodEndpoint/index.tsx +87 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +156 -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/{lib-next/theme/ApiDemoPanel/ParamOptions/styles.module.css → src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss} +38 -92
- package/src/theme/ApiExplorer/ParamOptions/index.tsx +145 -0
- package/src/theme/ApiExplorer/Request/_Request.scss +122 -0
- package/src/theme/ApiExplorer/Request/index.tsx +286 -0
- package/src/theme/{ApiDemoPanel/Execute → ApiExplorer/Request}/makeRequest.ts +9 -6
- package/src/theme/ApiExplorer/Response/_Response.scss +119 -0
- package/src/theme/ApiExplorer/Response/index.tsx +154 -0
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Response/slice.ts +22 -1
- package/src/theme/{ApiDemoPanel → ApiExplorer}/SecuritySchemes/index.tsx +5 -3
- package/{lib/theme/ApiDemoPanel/Request/styles.module.css → src/theme/ApiExplorer/Server/_Server.scss} +15 -7
- package/src/theme/{ApiDemoPanel → ApiExplorer}/Server/index.tsx +13 -17
- package/src/theme/{ApiDemoPanel → ApiExplorer}/buildPostmanRequest.ts +2 -2
- package/src/theme/{ApiDemoPanel → ApiExplorer}/index.tsx +14 -17
- package/src/theme/{ApiDemoPanel → ApiExplorer}/persistanceMiddleware.ts +1 -1
- package/src/theme/ApiItem/index.tsx +7 -7
- package/src/theme/ApiItem/store.ts +7 -7
- package/src/theme/ApiTabs/_ApiTabs.scss +140 -0
- package/src/theme/ApiTabs/index.js +105 -190
- package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +97 -0
- package/src/theme/DiscriminatorTabs/index.js +102 -189
- package/src/theme/Markdown/Details/_Details.scss +119 -0
- package/src/theme/MimeTabs/_MimeTabs.scss +69 -0
- package/src/theme/MimeTabs/index.js +125 -199
- package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/src/theme/ParamsItem/index.js +9 -8
- package/src/theme/ResponseSamples/_ResponseSamples.scss +3 -0
- package/src/theme/ResponseSamples/index.js +2 -7
- package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/src/theme/SchemaItem/index.js +31 -22
- package/src/theme/SchemaTabs/_SchemaTabs.scss +64 -0
- package/src/theme/SchemaTabs/index.js +97 -185
- package/src/theme/styles.scss +160 -0
- package/src/theme-openapi.d.ts +90 -47
- package/tsconfig.json +6 -3
- package/lib/postman-code-generators.d.ts +0 -9
- package/lib/react-magic-dropzone.d.ts +0 -9
- package/lib/theme/ApiDemoPanel/Accept/index.js +0 -32
- package/lib/theme/ApiDemoPanel/Accept/slice.js +0 -31
- package/lib/theme/ApiDemoPanel/Authorization/index.js +0 -107
- package/lib/theme/ApiDemoPanel/Authorization/slice.js +0 -123
- package/lib/theme/ApiDemoPanel/Body/index.js +0 -256
- package/lib/theme/ApiDemoPanel/Body/slice.js +0 -102
- package/lib/theme/ApiDemoPanel/CodeTabs/index.js +0 -161
- package/lib/theme/ApiDemoPanel/CodeTabs/styles.module.css +0 -17
- package/lib/theme/ApiDemoPanel/ContentType/index.js +0 -32
- package/lib/theme/ApiDemoPanel/ContentType/slice.js +0 -31
- package/lib/theme/ApiDemoPanel/Curl/index.js +0 -240
- package/lib/theme/ApiDemoPanel/Curl/styles.module.css +0 -84
- package/lib/theme/ApiDemoPanel/Execute/index.js +0 -151
- package/lib/theme/ApiDemoPanel/Execute/makeRequest.js +0 -181
- package/lib/theme/ApiDemoPanel/Export/index.js +0 -47
- package/lib/theme/ApiDemoPanel/FloatingButton/index.js +0 -30
- package/lib/theme/ApiDemoPanel/FloatingButton/styles.module.css +0 -26
- package/lib/theme/ApiDemoPanel/FormFileUpload/index.js +0 -83
- package/lib/theme/ApiDemoPanel/FormFileUpload/styles.module.css +0 -75
- package/lib/theme/ApiDemoPanel/FormItem/index.js +0 -38
- package/lib/theme/ApiDemoPanel/FormItem/styles.module.css +0 -12
- package/lib/theme/ApiDemoPanel/FormMultiSelect/index.js +0 -45
- package/lib/theme/ApiDemoPanel/FormMultiSelect/styles.module.css +0 -38
- package/lib/theme/ApiDemoPanel/FormSelect/index.js +0 -34
- package/lib/theme/ApiDemoPanel/FormTextInput/index.js +0 -28
- package/lib/theme/ApiDemoPanel/FormTextInput/styles.module.css +0 -21
- package/lib/theme/ApiDemoPanel/LiveEditor/index.js +0 -62
- package/lib/theme/ApiDemoPanel/LiveEditor/styles.module.css +0 -35
- package/lib/theme/ApiDemoPanel/MethodEndpoint/index.js +0 -56
- package/lib/theme/ApiDemoPanel/ParamOptions/index.js +0 -216
- package/lib/theme/ApiDemoPanel/ParamOptions/slice.js +0 -34
- package/lib/theme/ApiDemoPanel/ParamOptions/styles.module.css +0 -176
- package/lib/theme/ApiDemoPanel/Request/index.js +0 -67
- package/lib/theme/ApiDemoPanel/Response/index.js +0 -66
- package/lib/theme/ApiDemoPanel/Response/slice.js +0 -36
- package/lib/theme/ApiDemoPanel/SecuritySchemes/index.js +0 -257
- package/lib/theme/ApiDemoPanel/Server/index.js +0 -104
- package/lib/theme/ApiDemoPanel/Server/slice.js +0 -40
- package/lib/theme/ApiDemoPanel/Server/styles.module.css +0 -56
- package/lib/theme/ApiDemoPanel/buildPostmanRequest.js +0 -303
- package/lib/theme/ApiDemoPanel/index.js +0 -41
- package/lib/theme/ApiDemoPanel/persistanceMiddleware.js +0 -59
- package/lib/theme/ApiDemoPanel/postman-collection.d.ts +0 -10
- package/lib/theme/ApiDemoPanel/react-modal.d.ts +0 -8
- package/lib/theme/ApiTabs/styles.module.css +0 -120
- package/lib/theme/DiscriminatorTabs/styles.module.css +0 -119
- package/lib/theme/MimeTabs/styles.module.css +0 -126
- package/lib/theme/ParamsItem/styles.module.css +0 -24
- package/lib/theme/ResponseSamples/styles.module.css +0 -7
- package/lib/theme/SchemaItem/styles.module.css +0 -38
- package/lib/theme/SchemaTabs/styles.module.css +0 -110
- package/lib/theme/styles.css +0 -520
- package/lib/theme-classic.d.ts +0 -13
- package/lib/theme-openapi.d.ts +0 -234
- package/lib/theme-translations.d.ts +0 -9
- package/lib-next/index.js +0 -29
- package/lib-next/markdown/createDescription.js +0 -13
- package/lib-next/markdown/schema.js +0 -153
- package/lib-next/markdown/utils.js +0 -44
- package/lib-next/postman-code-generators.d.ts +0 -9
- package/lib-next/react-magic-dropzone.d.ts +0 -9
- package/lib-next/theme/ApiDemoPanel/Accept/index.js +0 -30
- package/lib-next/theme/ApiDemoPanel/Authorization/auth-types.js +0 -29
- package/lib-next/theme/ApiDemoPanel/Authorization/index.js +0 -142
- package/lib-next/theme/ApiDemoPanel/Body/index.js +0 -324
- package/lib-next/theme/ApiDemoPanel/CodeTabs/index.js +0 -201
- package/lib-next/theme/ApiDemoPanel/CodeTabs/styles.module.css +0 -17
- package/lib-next/theme/ApiDemoPanel/ContentType/index.js +0 -30
- package/lib-next/theme/ApiDemoPanel/Curl/index.js +0 -283
- package/lib-next/theme/ApiDemoPanel/Curl/styles.module.css +0 -84
- package/lib-next/theme/ApiDemoPanel/Execute/index.js +0 -167
- package/lib-next/theme/ApiDemoPanel/Export/index.js +0 -45
- package/lib-next/theme/ApiDemoPanel/FloatingButton/index.js +0 -22
- package/lib-next/theme/ApiDemoPanel/FloatingButton/styles.module.css +0 -26
- package/lib-next/theme/ApiDemoPanel/FormFileUpload/index.js +0 -106
- package/lib-next/theme/ApiDemoPanel/FormItem/index.js +0 -36
- package/lib-next/theme/ApiDemoPanel/FormItem/styles.module.css +0 -12
- package/lib-next/theme/ApiDemoPanel/FormMultiSelect/index.js +0 -45
- package/lib-next/theme/ApiDemoPanel/FormMultiSelect/styles.module.css +0 -38
- package/lib-next/theme/ApiDemoPanel/FormSelect/index.js +0 -26
- package/lib-next/theme/ApiDemoPanel/FormSelect/styles.module.css +0 -51
- package/lib-next/theme/ApiDemoPanel/FormTextInput/index.js +0 -24
- package/lib-next/theme/ApiDemoPanel/FormTextInput/styles.module.css +0 -21
- package/lib-next/theme/ApiDemoPanel/LiveEditor/index.js +0 -59
- package/lib-next/theme/ApiDemoPanel/LiveEditor/styles.module.css +0 -35
- package/lib-next/theme/ApiDemoPanel/MethodEndpoint/index.js +0 -53
- package/lib-next/theme/ApiDemoPanel/ParamOptions/index.js +0 -292
- package/lib-next/theme/ApiDemoPanel/Request/index.js +0 -60
- package/lib-next/theme/ApiDemoPanel/Request/styles.module.css +0 -18
- package/lib-next/theme/ApiDemoPanel/Response/index.js +0 -67
- package/lib-next/theme/ApiDemoPanel/Response/slice.js +0 -23
- package/lib-next/theme/ApiDemoPanel/SecuritySchemes/index.js +0 -274
- package/lib-next/theme/ApiDemoPanel/Server/index.js +0 -132
- package/lib-next/theme/ApiDemoPanel/Server/styles.module.css +0 -56
- package/lib-next/theme/ApiDemoPanel/index.js +0 -28
- package/lib-next/theme/ApiDemoPanel/storage-utils.js +0 -33
- package/lib-next/theme/ApiItem/Layout/index.js +0 -68
- package/lib-next/theme/ApiItem/Layout/styles.module.css +0 -17
- package/lib-next/theme/ApiItem/hooks.js +0 -10
- package/lib-next/theme/ApiItem/index.js +0 -155
- package/lib-next/theme/ApiItem/store.js +0 -38
- package/lib-next/theme/ApiLogo/index.js +0 -48
- package/lib-next/theme/ApiTabs/index.js +0 -277
- package/lib-next/theme/ApiTabs/styles.module.css +0 -120
- package/lib-next/theme/DiscriminatorTabs/index.js +0 -272
- package/lib-next/theme/DiscriminatorTabs/styles.module.css +0 -119
- package/lib-next/theme/MimeTabs/index.js +0 -295
- package/lib-next/theme/MimeTabs/styles.module.css +0 -126
- package/lib-next/theme/ParamsItem/index.js +0 -135
- package/lib-next/theme/ParamsItem/styles.module.css +0 -24
- package/lib-next/theme/ResponseSamples/index.js +0 -27
- package/lib-next/theme/ResponseSamples/styles.module.css +0 -7
- package/lib-next/theme/SchemaItem/index.js +0 -114
- package/lib-next/theme/SchemaItem/styles.module.css +0 -38
- package/lib-next/theme/SchemaTabs/index.js +0 -270
- package/lib-next/theme/SchemaTabs/styles.module.css +0 -110
- package/lib-next/theme/styles.css +0 -520
- package/lib-next/theme-classic.d.ts +0 -13
- package/lib-next/theme-openapi.d.ts +0 -234
- package/lib-next/theme-translations.d.ts +0 -9
- package/lib-next/types.js +0 -1
- package/src/theme/ApiDemoPanel/Body/json2xml.js +0 -43
- package/src/theme/ApiDemoPanel/CodeTabs/index.tsx +0 -239
- package/src/theme/ApiDemoPanel/CodeTabs/styles.module.css +0 -17
- package/src/theme/ApiDemoPanel/Curl/languages.json +0 -1386
- package/src/theme/ApiDemoPanel/Curl/styles.module.css +0 -84
- package/src/theme/ApiDemoPanel/Execute/index.tsx +0 -189
- package/src/theme/ApiDemoPanel/FloatingButton/styles.module.css +0 -26
- package/src/theme/ApiDemoPanel/FormItem/styles.module.css +0 -12
- package/src/theme/ApiDemoPanel/FormMultiSelect/styles.module.css +0 -38
- package/src/theme/ApiDemoPanel/FormTextInput/index.tsx +0 -34
- package/src/theme/ApiDemoPanel/FormTextInput/styles.module.css +0 -21
- package/src/theme/ApiDemoPanel/LiveEditor/index.tsx +0 -75
- package/src/theme/ApiDemoPanel/LiveEditor/styles.module.css +0 -35
- package/src/theme/ApiDemoPanel/MethodEndpoint/index.tsx +0 -62
- package/src/theme/ApiDemoPanel/ParamOptions/index.tsx +0 -326
- package/src/theme/ApiDemoPanel/Request/index.tsx +0 -71
- package/src/theme/ApiDemoPanel/Response/index.tsx +0 -75
- package/src/theme/ApiDemoPanel/Server/styles.module.css +0 -56
- package/src/theme/ApiDemoPanel/postman-collection.d.ts +0 -10
- package/src/theme/ApiDemoPanel/react-modal.d.ts +0 -8
- package/src/theme/ApiTabs/styles.module.css +0 -120
- package/src/theme/DiscriminatorTabs/styles.module.css +0 -119
- package/src/theme/MimeTabs/styles.module.css +0 -126
- package/src/theme/ParamsItem/styles.module.css +0 -24
- package/src/theme/ResponseSamples/styles.module.css +0 -7
- package/src/theme/SchemaItem/styles.module.css +0 -38
- package/src/theme/SchemaTabs/styles.module.css +0 -110
- package/src/theme/styles.css +0 -520
- /package/{lib-next/theme/ApiDemoPanel → lib/theme/ApiExplorer}/Body/json2xml.js +0 -0
- /package/{lib-next/theme/ApiDemoPanel/Curl → lib/theme/ApiExplorer/CodeSnippets}/languages.json +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/Accept/slice.ts +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/Authorization/auth-types.ts +0 -0
- /package/{lib/theme/ApiDemoPanel → src/theme/ApiExplorer}/Body/json2xml.js +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/Body/slice.ts +0 -0
- /package/{lib/theme/ApiDemoPanel/Curl → src/theme/ApiExplorer/CodeSnippets}/languages.json +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/ContentType/slice.ts +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/Export/index.tsx +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/ParamOptions/slice.ts +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/Server/slice.ts +0 -0
- /package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/postman-collection.d.ts +0 -0
- /package/{lib-next/theme/ApiDemoPanel → src/theme/ApiExplorer}/react-modal.d.ts +0 -0
- /package/src/theme/{ApiDemoPanel → ApiExplorer}/storage-utils.ts +0 -0
|
@@ -1,142 +0,0 @@
|
|
|
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 from "react";
|
|
9
|
-
import FormItem from "@theme/ApiDemoPanel/FormItem";
|
|
10
|
-
import FormSelect from "@theme/ApiDemoPanel/FormSelect";
|
|
11
|
-
import FormTextInput from "@theme/ApiDemoPanel/FormTextInput";
|
|
12
|
-
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
13
|
-
import { setAuthData, setSelectedAuth } from "./slice";
|
|
14
|
-
function Authorization() {
|
|
15
|
-
const data = useTypedSelector((state) => state.auth.data);
|
|
16
|
-
const options = useTypedSelector((state) => state.auth.options);
|
|
17
|
-
const selected = useTypedSelector((state) => state.auth.selected);
|
|
18
|
-
const dispatch = useTypedDispatch();
|
|
19
|
-
if (selected === undefined) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
const selectedAuth = options[selected];
|
|
23
|
-
const optionKeys = Object.keys(options);
|
|
24
|
-
return (
|
|
25
|
-
<div>
|
|
26
|
-
{optionKeys.length > 1 && (
|
|
27
|
-
<FormItem label="Security Scheme">
|
|
28
|
-
<FormSelect
|
|
29
|
-
options={optionKeys}
|
|
30
|
-
value={selected}
|
|
31
|
-
onChange={(e) => {
|
|
32
|
-
dispatch(setSelectedAuth(e.target.value));
|
|
33
|
-
}}
|
|
34
|
-
/>
|
|
35
|
-
</FormItem>
|
|
36
|
-
)}
|
|
37
|
-
{selectedAuth.map((a) => {
|
|
38
|
-
if (a.type === "http" && a.scheme === "bearer") {
|
|
39
|
-
return (
|
|
40
|
-
<FormItem label="Bearer Token" key={a.key + "-bearer"}>
|
|
41
|
-
<FormTextInput
|
|
42
|
-
placeholder="Bearer Token"
|
|
43
|
-
value={data[a.key].token ?? ""}
|
|
44
|
-
onChange={(e) => {
|
|
45
|
-
const value = e.target.value;
|
|
46
|
-
dispatch(
|
|
47
|
-
setAuthData({
|
|
48
|
-
scheme: a.key,
|
|
49
|
-
key: "token",
|
|
50
|
-
value: value ? value : undefined,
|
|
51
|
-
})
|
|
52
|
-
);
|
|
53
|
-
}}
|
|
54
|
-
/>
|
|
55
|
-
</FormItem>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
if (a.type === "oauth2") {
|
|
59
|
-
return (
|
|
60
|
-
<FormItem label="Bearer Token" key={a.key + "-oauth2"}>
|
|
61
|
-
<FormTextInput
|
|
62
|
-
placeholder="Bearer Token"
|
|
63
|
-
value={data[a.key].token ?? ""}
|
|
64
|
-
onChange={(e) => {
|
|
65
|
-
const value = e.target.value;
|
|
66
|
-
dispatch(
|
|
67
|
-
setAuthData({
|
|
68
|
-
scheme: a.key,
|
|
69
|
-
key: "token",
|
|
70
|
-
value: value ? value : undefined,
|
|
71
|
-
})
|
|
72
|
-
);
|
|
73
|
-
}}
|
|
74
|
-
/>
|
|
75
|
-
</FormItem>
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
if (a.type === "http" && a.scheme === "basic") {
|
|
79
|
-
return (
|
|
80
|
-
<React.Fragment key={a.key + "-basic"}>
|
|
81
|
-
<FormItem label="Username">
|
|
82
|
-
<FormTextInput
|
|
83
|
-
placeholder="Username"
|
|
84
|
-
value={data[a.key].username ?? ""}
|
|
85
|
-
onChange={(e) => {
|
|
86
|
-
const value = e.target.value;
|
|
87
|
-
dispatch(
|
|
88
|
-
setAuthData({
|
|
89
|
-
scheme: a.key,
|
|
90
|
-
key: "username",
|
|
91
|
-
value: value ? value : undefined,
|
|
92
|
-
})
|
|
93
|
-
);
|
|
94
|
-
}}
|
|
95
|
-
/>
|
|
96
|
-
</FormItem>
|
|
97
|
-
<FormItem label="Password">
|
|
98
|
-
<FormTextInput
|
|
99
|
-
placeholder="Password"
|
|
100
|
-
password
|
|
101
|
-
value={data[a.key].password ?? ""}
|
|
102
|
-
onChange={(e) => {
|
|
103
|
-
const value = e.target.value;
|
|
104
|
-
dispatch(
|
|
105
|
-
setAuthData({
|
|
106
|
-
scheme: a.key,
|
|
107
|
-
key: "password",
|
|
108
|
-
value: value ? value : undefined,
|
|
109
|
-
})
|
|
110
|
-
);
|
|
111
|
-
}}
|
|
112
|
-
/>
|
|
113
|
-
</FormItem>
|
|
114
|
-
</React.Fragment>
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
if (a.type === "apiKey") {
|
|
118
|
-
return (
|
|
119
|
-
<FormItem label={`${a.key}`} key={a.key + "-apikey"}>
|
|
120
|
-
<FormTextInput
|
|
121
|
-
placeholder={`${a.key}`}
|
|
122
|
-
value={data[a.key].apiKey ?? ""}
|
|
123
|
-
onChange={(e) => {
|
|
124
|
-
const value = e.target.value;
|
|
125
|
-
dispatch(
|
|
126
|
-
setAuthData({
|
|
127
|
-
scheme: a.key,
|
|
128
|
-
key: "apiKey",
|
|
129
|
-
value: value ? value : undefined,
|
|
130
|
-
})
|
|
131
|
-
);
|
|
132
|
-
}}
|
|
133
|
-
/>
|
|
134
|
-
</FormItem>
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
return null;
|
|
138
|
-
})}
|
|
139
|
-
</div>
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
export default Authorization;
|
|
@@ -1,324 +0,0 @@
|
|
|
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 from "react";
|
|
9
|
-
import json2xml from "@theme/ApiDemoPanel/Body/json2xml";
|
|
10
|
-
import ContentType from "@theme/ApiDemoPanel/ContentType";
|
|
11
|
-
import FormFileUpload from "@theme/ApiDemoPanel/FormFileUpload";
|
|
12
|
-
import FormItem from "@theme/ApiDemoPanel/FormItem";
|
|
13
|
-
import FormSelect from "@theme/ApiDemoPanel/FormSelect";
|
|
14
|
-
import FormTextInput from "@theme/ApiDemoPanel/FormTextInput";
|
|
15
|
-
import LiveApp from "@theme/ApiDemoPanel/LiveEditor";
|
|
16
|
-
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
17
|
-
import SchemaTabs from "@theme/SchemaTabs";
|
|
18
|
-
import TabItem from "@theme/TabItem";
|
|
19
|
-
import format from "xml-formatter";
|
|
20
|
-
import {
|
|
21
|
-
clearFormBodyKey,
|
|
22
|
-
clearRawBody,
|
|
23
|
-
setFileFormBody,
|
|
24
|
-
setFileRawBody,
|
|
25
|
-
setStringFormBody,
|
|
26
|
-
} from "./slice";
|
|
27
|
-
function BodyWrap({ requestBodyMetadata, jsonRequestBodyExample }) {
|
|
28
|
-
const contentType = useTypedSelector((state) => state.contentType.value);
|
|
29
|
-
|
|
30
|
-
// NOTE: We used to check if body was required, but opted to always show the request body
|
|
31
|
-
// to reduce confusion, see: https://github.com/cloud-annotations/docusaurus-openapi/issues/145
|
|
32
|
-
|
|
33
|
-
// No body
|
|
34
|
-
if (contentType === undefined) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
return (
|
|
38
|
-
<>
|
|
39
|
-
<ContentType />
|
|
40
|
-
<Body
|
|
41
|
-
requestBodyMetadata={requestBodyMetadata}
|
|
42
|
-
jsonRequestBodyExample={jsonRequestBodyExample}
|
|
43
|
-
/>
|
|
44
|
-
</>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
function Body({ requestBodyMetadata, jsonRequestBodyExample }) {
|
|
48
|
-
const contentType = useTypedSelector((state) => state.contentType.value);
|
|
49
|
-
const required = requestBodyMetadata?.required;
|
|
50
|
-
const dispatch = useTypedDispatch();
|
|
51
|
-
|
|
52
|
-
// Lot's of possible content-types:
|
|
53
|
-
// - application/json
|
|
54
|
-
// - application/xml
|
|
55
|
-
// - text/plain
|
|
56
|
-
// - text/css
|
|
57
|
-
// - text/html
|
|
58
|
-
// - text/javascript
|
|
59
|
-
// - application/javascript
|
|
60
|
-
// - multipart/form-data
|
|
61
|
-
// - application/x-www-form-urlencoded
|
|
62
|
-
// - image/svg+xml;charset=US-ASCII
|
|
63
|
-
|
|
64
|
-
// Show editor:
|
|
65
|
-
// - application/json
|
|
66
|
-
// - application/xml
|
|
67
|
-
// - */*
|
|
68
|
-
|
|
69
|
-
// Show form:
|
|
70
|
-
// - multipart/form-data
|
|
71
|
-
// - application/x-www-form-urlencoded
|
|
72
|
-
|
|
73
|
-
const schema = requestBodyMetadata?.content?.[contentType]?.schema;
|
|
74
|
-
const example = requestBodyMetadata?.content?.[contentType]?.example;
|
|
75
|
-
const examples = requestBodyMetadata?.content?.[contentType]?.examples;
|
|
76
|
-
if (schema?.format === "binary") {
|
|
77
|
-
return (
|
|
78
|
-
<FormItem label="Body" required={required}>
|
|
79
|
-
<FormFileUpload
|
|
80
|
-
placeholder={schema.description || "Body"}
|
|
81
|
-
onChange={(file) => {
|
|
82
|
-
if (file === undefined) {
|
|
83
|
-
dispatch(clearRawBody());
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
dispatch(
|
|
87
|
-
setFileRawBody({
|
|
88
|
-
src: `/path/to/${file.name}`,
|
|
89
|
-
content: file,
|
|
90
|
-
})
|
|
91
|
-
);
|
|
92
|
-
}}
|
|
93
|
-
/>
|
|
94
|
-
</FormItem>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
if (
|
|
98
|
-
(contentType === "multipart/form-data" ||
|
|
99
|
-
contentType === "application/x-www-form-urlencoded") &&
|
|
100
|
-
schema?.type === "object"
|
|
101
|
-
) {
|
|
102
|
-
return (
|
|
103
|
-
<FormItem label="Body" required={required}>
|
|
104
|
-
<div
|
|
105
|
-
style={{
|
|
106
|
-
marginTop: "calc(var(--ifm-pre-padding) / 2)",
|
|
107
|
-
borderRadius: "4px",
|
|
108
|
-
padding: "var(--ifm-pre-padding)",
|
|
109
|
-
border: "1px solid var(--openapi-monaco-border-color)",
|
|
110
|
-
}}
|
|
111
|
-
>
|
|
112
|
-
{Object.entries(schema.properties ?? {}).map(([key, val]) => {
|
|
113
|
-
if (val.format === "binary") {
|
|
114
|
-
return (
|
|
115
|
-
<FormItem
|
|
116
|
-
key={key}
|
|
117
|
-
label={key}
|
|
118
|
-
required={
|
|
119
|
-
Array.isArray(schema.required) &&
|
|
120
|
-
schema.required.includes(key)
|
|
121
|
-
}
|
|
122
|
-
>
|
|
123
|
-
<FormFileUpload
|
|
124
|
-
placeholder={val.description || key}
|
|
125
|
-
onChange={(file) => {
|
|
126
|
-
if (file === undefined) {
|
|
127
|
-
dispatch(clearFormBodyKey(key));
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
dispatch(
|
|
131
|
-
setFileFormBody({
|
|
132
|
-
key: key,
|
|
133
|
-
value: {
|
|
134
|
-
src: `/path/to/${file.name}`,
|
|
135
|
-
content: file,
|
|
136
|
-
},
|
|
137
|
-
})
|
|
138
|
-
);
|
|
139
|
-
}}
|
|
140
|
-
/>
|
|
141
|
-
</FormItem>
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
if (val.enum) {
|
|
145
|
-
return (
|
|
146
|
-
<FormItem
|
|
147
|
-
key={key}
|
|
148
|
-
label={key}
|
|
149
|
-
required={
|
|
150
|
-
Array.isArray(schema.required) &&
|
|
151
|
-
schema.required.includes(key)
|
|
152
|
-
}
|
|
153
|
-
>
|
|
154
|
-
<FormSelect
|
|
155
|
-
options={["---", ...val.enum]}
|
|
156
|
-
onChange={(e) => {
|
|
157
|
-
const val = e.target.value;
|
|
158
|
-
if (val === "---") {
|
|
159
|
-
dispatch(clearFormBodyKey(key));
|
|
160
|
-
} else {
|
|
161
|
-
dispatch(
|
|
162
|
-
setStringFormBody({
|
|
163
|
-
key: key,
|
|
164
|
-
value: val,
|
|
165
|
-
})
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
}}
|
|
169
|
-
/>
|
|
170
|
-
</FormItem>
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
// TODO: support all the other types.
|
|
174
|
-
return (
|
|
175
|
-
<FormItem
|
|
176
|
-
key={key}
|
|
177
|
-
label={key}
|
|
178
|
-
required={
|
|
179
|
-
Array.isArray(schema.required) &&
|
|
180
|
-
schema.required.includes(key)
|
|
181
|
-
}
|
|
182
|
-
>
|
|
183
|
-
<FormTextInput
|
|
184
|
-
placeholder={val.description || key}
|
|
185
|
-
onChange={(e) => {
|
|
186
|
-
dispatch(
|
|
187
|
-
setStringFormBody({
|
|
188
|
-
key: key,
|
|
189
|
-
value: e.target.value,
|
|
190
|
-
})
|
|
191
|
-
);
|
|
192
|
-
}}
|
|
193
|
-
/>
|
|
194
|
-
</FormItem>
|
|
195
|
-
);
|
|
196
|
-
})}
|
|
197
|
-
</div>
|
|
198
|
-
</FormItem>
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
let language = "plaintext";
|
|
202
|
-
let defaultBody = ""; //"body content";
|
|
203
|
-
let exampleBody;
|
|
204
|
-
let examplesBodies = [];
|
|
205
|
-
if (contentType === "application/json" || contentType.endsWith("+json")) {
|
|
206
|
-
if (jsonRequestBodyExample) {
|
|
207
|
-
defaultBody = JSON.stringify(jsonRequestBodyExample, null, 2);
|
|
208
|
-
}
|
|
209
|
-
if (example) {
|
|
210
|
-
exampleBody = JSON.stringify(example, null, 2);
|
|
211
|
-
}
|
|
212
|
-
if (examples) {
|
|
213
|
-
for (const [key, example] of Object.entries(examples)) {
|
|
214
|
-
examplesBodies.push({
|
|
215
|
-
label: key,
|
|
216
|
-
body: JSON.stringify(example.value, null, 2),
|
|
217
|
-
summary: example.summary,
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
language = "json";
|
|
222
|
-
}
|
|
223
|
-
if (contentType === "application/xml" || contentType.endsWith("+xml")) {
|
|
224
|
-
if (jsonRequestBodyExample) {
|
|
225
|
-
try {
|
|
226
|
-
defaultBody = format(json2xml(jsonRequestBodyExample, ""), {
|
|
227
|
-
indentation: " ",
|
|
228
|
-
lineSeparator: "\n",
|
|
229
|
-
collapseContent: true,
|
|
230
|
-
});
|
|
231
|
-
} catch {
|
|
232
|
-
defaultBody = json2xml(jsonRequestBodyExample);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
if (example) {
|
|
236
|
-
try {
|
|
237
|
-
exampleBody = format(json2xml(example, ""), {
|
|
238
|
-
indentation: " ",
|
|
239
|
-
lineSeparator: "\n",
|
|
240
|
-
collapseContent: true,
|
|
241
|
-
});
|
|
242
|
-
} catch {
|
|
243
|
-
exampleBody = json2xml(example);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
if (examples) {
|
|
247
|
-
for (const [key, example] of Object.entries(examples)) {
|
|
248
|
-
let formattedXmlBody;
|
|
249
|
-
try {
|
|
250
|
-
formattedXmlBody = format(example.value, {
|
|
251
|
-
indentation: " ",
|
|
252
|
-
lineSeparator: "\n",
|
|
253
|
-
collapseContent: true,
|
|
254
|
-
});
|
|
255
|
-
} catch {
|
|
256
|
-
formattedXmlBody = example.value;
|
|
257
|
-
}
|
|
258
|
-
examplesBodies.push({
|
|
259
|
-
label: key,
|
|
260
|
-
body: formattedXmlBody,
|
|
261
|
-
summary: example.summary,
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
language = "xml";
|
|
266
|
-
}
|
|
267
|
-
if (exampleBody) {
|
|
268
|
-
return (
|
|
269
|
-
<FormItem label="Body" required={required}>
|
|
270
|
-
<SchemaTabs lazy>
|
|
271
|
-
<TabItem label="Default" value="default" default>
|
|
272
|
-
<LiveApp action={dispatch} language={language}>
|
|
273
|
-
{defaultBody}
|
|
274
|
-
</LiveApp>
|
|
275
|
-
</TabItem>
|
|
276
|
-
<TabItem label="Example" value="example">
|
|
277
|
-
{exampleBody && (
|
|
278
|
-
<LiveApp action={dispatch} language={language}>
|
|
279
|
-
{exampleBody}
|
|
280
|
-
</LiveApp>
|
|
281
|
-
)}
|
|
282
|
-
</TabItem>
|
|
283
|
-
</SchemaTabs>
|
|
284
|
-
</FormItem>
|
|
285
|
-
);
|
|
286
|
-
}
|
|
287
|
-
if (examplesBodies && examplesBodies.length > 0) {
|
|
288
|
-
return (
|
|
289
|
-
<FormItem label="Body" required={required}>
|
|
290
|
-
<SchemaTabs lazy>
|
|
291
|
-
<TabItem label="Default" value="default" default>
|
|
292
|
-
<LiveApp action={dispatch} language={language}>
|
|
293
|
-
{defaultBody}
|
|
294
|
-
</LiveApp>
|
|
295
|
-
</TabItem>
|
|
296
|
-
{examplesBodies.map((example) => {
|
|
297
|
-
return (
|
|
298
|
-
<TabItem
|
|
299
|
-
label={example.label}
|
|
300
|
-
value={example.label}
|
|
301
|
-
key={example.label}
|
|
302
|
-
>
|
|
303
|
-
{example.summary && <p>{example.summary}</p>}
|
|
304
|
-
{example.body && (
|
|
305
|
-
<LiveApp action={dispatch} language={language}>
|
|
306
|
-
{example.body}
|
|
307
|
-
</LiveApp>
|
|
308
|
-
)}
|
|
309
|
-
</TabItem>
|
|
310
|
-
);
|
|
311
|
-
})}
|
|
312
|
-
</SchemaTabs>
|
|
313
|
-
</FormItem>
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
return (
|
|
317
|
-
<FormItem label="Body" required={required}>
|
|
318
|
-
<LiveApp action={dispatch} language={language}>
|
|
319
|
-
{defaultBody}
|
|
320
|
-
</LiveApp>
|
|
321
|
-
</FormItem>
|
|
322
|
-
);
|
|
323
|
-
}
|
|
324
|
-
export default BodyWrap;
|
|
@@ -1,201 +0,0 @@
|
|
|
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, cloneElement, isValidElement } from "react";
|
|
9
|
-
import { duplicates } from "@docusaurus/theme-common";
|
|
10
|
-
import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
11
|
-
import { languageSet } from "@theme/ApiDemoPanel/Curl";
|
|
12
|
-
import clsx from "clsx";
|
|
13
|
-
import styles from "./styles.module.css";
|
|
14
|
-
const {
|
|
15
|
-
useScrollPositionBlocker,
|
|
16
|
-
useTabGroupChoice,
|
|
17
|
-
} = require("@docusaurus/theme-common/internal");
|
|
18
|
-
|
|
19
|
-
// A very rough duck type, but good enough to guard against mistakes while
|
|
20
|
-
// allowing customization
|
|
21
|
-
function isTabItem(comp) {
|
|
22
|
-
return "value" in comp.props;
|
|
23
|
-
}
|
|
24
|
-
function TabsComponent(props) {
|
|
25
|
-
const {
|
|
26
|
-
lazy,
|
|
27
|
-
block,
|
|
28
|
-
defaultValue: defaultValueProp,
|
|
29
|
-
values: valuesProp,
|
|
30
|
-
groupId,
|
|
31
|
-
className,
|
|
32
|
-
action,
|
|
33
|
-
} = props;
|
|
34
|
-
const children = React.Children.map(props.children, (child) => {
|
|
35
|
-
if (isValidElement(child) && isTabItem(child)) {
|
|
36
|
-
return child;
|
|
37
|
-
}
|
|
38
|
-
// child.type.name will give non-sensical values in prod because of
|
|
39
|
-
// minification, but we assume it won't throw in prod.
|
|
40
|
-
throw new Error(
|
|
41
|
-
`Docusaurus error: Bad <Tabs> child <${
|
|
42
|
-
// @ts-expect-error: guarding against unexpected cases
|
|
43
|
-
typeof child.type === "string" ? child.type : child.type.name
|
|
44
|
-
}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`
|
|
45
|
-
);
|
|
46
|
-
});
|
|
47
|
-
const values =
|
|
48
|
-
valuesProp ??
|
|
49
|
-
// Only pick keys that we recognize. MDX would inject some keys by default
|
|
50
|
-
children.map(({ props: { value, label, attributes } }) => ({
|
|
51
|
-
value,
|
|
52
|
-
label,
|
|
53
|
-
attributes,
|
|
54
|
-
}));
|
|
55
|
-
const dup = duplicates(values, (a, b) => a.value === b.value);
|
|
56
|
-
if (dup.length > 0) {
|
|
57
|
-
throw new Error(
|
|
58
|
-
`Docusaurus error: Duplicate values "${dup
|
|
59
|
-
.map((a) => a.value)
|
|
60
|
-
.join(", ")}" found in <Tabs>. Every value needs to be unique.`
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
// When defaultValueProp is null, don't show a default tab
|
|
64
|
-
const defaultValue =
|
|
65
|
-
defaultValueProp === null
|
|
66
|
-
? defaultValueProp
|
|
67
|
-
: defaultValueProp ??
|
|
68
|
-
children.find((child) => child.props.default)?.props.value ??
|
|
69
|
-
children[0].props.value;
|
|
70
|
-
if (defaultValue !== null && !values.some((a) => a.value === defaultValue)) {
|
|
71
|
-
throw new Error(
|
|
72
|
-
`Docusaurus error: The <Tabs> has a defaultValue "${defaultValue}" but none of its children has the corresponding value. Available values are: ${values
|
|
73
|
-
.map((a) => a.value)
|
|
74
|
-
.join(
|
|
75
|
-
", "
|
|
76
|
-
)}. If you intend to show no default tab, use defaultValue={null} instead.`
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
const { tabGroupChoices, setTabGroupChoices } = useTabGroupChoice();
|
|
80
|
-
const [selectedValue, setSelectedValue] = useState(defaultValue);
|
|
81
|
-
const tabRefs = [];
|
|
82
|
-
const { blockElementScrollPositionUntilNextRender } =
|
|
83
|
-
useScrollPositionBlocker();
|
|
84
|
-
if (groupId != null) {
|
|
85
|
-
const relevantTabGroupChoice = tabGroupChoices[groupId];
|
|
86
|
-
if (
|
|
87
|
-
relevantTabGroupChoice != null &&
|
|
88
|
-
relevantTabGroupChoice !== selectedValue &&
|
|
89
|
-
values.some((value) => value.value === relevantTabGroupChoice)
|
|
90
|
-
) {
|
|
91
|
-
setSelectedValue(relevantTabGroupChoice);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
const handleTabChange = (event) => {
|
|
95
|
-
const newTab = event.currentTarget;
|
|
96
|
-
const newTabIndex = tabRefs.indexOf(newTab);
|
|
97
|
-
const newTabValue = values[newTabIndex].value;
|
|
98
|
-
if (newTabValue !== selectedValue) {
|
|
99
|
-
blockElementScrollPositionUntilNextRender(newTab);
|
|
100
|
-
setSelectedValue(newTabValue);
|
|
101
|
-
if (action) {
|
|
102
|
-
const newLanguage = languageSet.filter(
|
|
103
|
-
(lang) => lang.language === newTabValue
|
|
104
|
-
);
|
|
105
|
-
action(newLanguage[0]);
|
|
106
|
-
}
|
|
107
|
-
if (groupId != null) {
|
|
108
|
-
setTabGroupChoices(groupId, String(newTabValue));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
const handleKeydown = (event) => {
|
|
113
|
-
let focusElement = null;
|
|
114
|
-
switch (event.key) {
|
|
115
|
-
case "ArrowRight": {
|
|
116
|
-
const nextTab = tabRefs.indexOf(event.currentTarget) + 1;
|
|
117
|
-
focusElement = tabRefs[nextTab] ?? tabRefs[0];
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
case "ArrowLeft": {
|
|
121
|
-
const prevTab = tabRefs.indexOf(event.currentTarget) - 1;
|
|
122
|
-
focusElement = tabRefs[prevTab] ?? tabRefs[tabRefs.length - 1];
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
default:
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
focusElement?.focus();
|
|
129
|
-
};
|
|
130
|
-
return (
|
|
131
|
-
<div className={clsx("tabs-container", styles.tabList)}>
|
|
132
|
-
<ul
|
|
133
|
-
role="tablist"
|
|
134
|
-
aria-orientation="horizontal"
|
|
135
|
-
className={clsx(
|
|
136
|
-
"tabs",
|
|
137
|
-
{
|
|
138
|
-
"tabs--block": block,
|
|
139
|
-
},
|
|
140
|
-
styles.code__tabs,
|
|
141
|
-
className
|
|
142
|
-
)}
|
|
143
|
-
>
|
|
144
|
-
{values.map(({ value, label, attributes }) => (
|
|
145
|
-
<li
|
|
146
|
-
role="tab"
|
|
147
|
-
tabIndex={selectedValue === value ? 0 : -1}
|
|
148
|
-
aria-selected={selectedValue === value}
|
|
149
|
-
key={value}
|
|
150
|
-
ref={(tabControl) => tabRefs.push(tabControl)}
|
|
151
|
-
onKeyDown={handleKeydown}
|
|
152
|
-
onFocus={handleTabChange}
|
|
153
|
-
onClick={handleTabChange}
|
|
154
|
-
{...attributes}
|
|
155
|
-
className={clsx(
|
|
156
|
-
"tabs__item",
|
|
157
|
-
styles.tabItem,
|
|
158
|
-
attributes?.className,
|
|
159
|
-
{
|
|
160
|
-
"tabs__item--active": selectedValue === value,
|
|
161
|
-
}
|
|
162
|
-
)}
|
|
163
|
-
>
|
|
164
|
-
{label ?? value}
|
|
165
|
-
</li>
|
|
166
|
-
))}
|
|
167
|
-
</ul>
|
|
168
|
-
|
|
169
|
-
{lazy ? (
|
|
170
|
-
cloneElement(
|
|
171
|
-
children.filter(
|
|
172
|
-
(tabItem) => tabItem.props.value === selectedValue
|
|
173
|
-
)[0],
|
|
174
|
-
{
|
|
175
|
-
className: "margin-top--md",
|
|
176
|
-
}
|
|
177
|
-
)
|
|
178
|
-
) : (
|
|
179
|
-
<div className="margin-top--md">
|
|
180
|
-
{children.map((tabItem, i) =>
|
|
181
|
-
cloneElement(tabItem, {
|
|
182
|
-
key: i,
|
|
183
|
-
hidden: tabItem.props.value !== selectedValue,
|
|
184
|
-
})
|
|
185
|
-
)}
|
|
186
|
-
</div>
|
|
187
|
-
)}
|
|
188
|
-
</div>
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
export default function CodeTabs(props) {
|
|
192
|
-
const isBrowser = useIsBrowser();
|
|
193
|
-
return (
|
|
194
|
-
<TabsComponent
|
|
195
|
-
// Remount tabs after hydration
|
|
196
|
-
// Temporary fix for https://github.com/facebook/docusaurus/issues/5653
|
|
197
|
-
key={String(isBrowser)}
|
|
198
|
-
{...props}
|
|
199
|
-
/>
|
|
200
|
-
);
|
|
201
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
.tabList {
|
|
2
|
-
margin-bottom: var(--ifm-leading);
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.tabItem {
|
|
6
|
-
margin-top: 0 !important;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.code__tabs {
|
|
10
|
-
display: table-row-group;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@media only screen and (min-width: 768px) and (max-width: 996px) {
|
|
14
|
-
.code__tabs {
|
|
15
|
-
justify-content: space-around;
|
|
16
|
-
}
|
|
17
|
-
}
|