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,272 +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, {
|
|
9
|
-
Children,
|
|
10
|
-
cloneElement,
|
|
11
|
-
isValidElement,
|
|
12
|
-
useEffect,
|
|
13
|
-
useRef,
|
|
14
|
-
useState,
|
|
15
|
-
} from "react";
|
|
16
|
-
|
|
17
|
-
import { duplicates } from "@docusaurus/theme-common";
|
|
18
|
-
import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
19
|
-
import clsx from "clsx";
|
|
20
|
-
|
|
21
|
-
import styles from "./styles.module.css"; // A very rough duck type, but good enough to guard against mistakes while
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
useScrollPositionBlocker,
|
|
25
|
-
useTabGroupChoice,
|
|
26
|
-
} = require("@docusaurus/theme-common/internal");
|
|
27
|
-
|
|
28
|
-
// allowing customization
|
|
29
|
-
|
|
30
|
-
function isTabItem(comp) {
|
|
31
|
-
return typeof comp.props.value !== "undefined";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function DiscriminatorTabsComponent(props) {
|
|
35
|
-
const {
|
|
36
|
-
lazy,
|
|
37
|
-
block,
|
|
38
|
-
defaultValue: defaultValueProp,
|
|
39
|
-
values: valuesProp,
|
|
40
|
-
groupId,
|
|
41
|
-
className,
|
|
42
|
-
} = props;
|
|
43
|
-
const children = Children.map(props.children, (child) => {
|
|
44
|
-
if (isValidElement(child) && isTabItem(child)) {
|
|
45
|
-
return child;
|
|
46
|
-
} // child.type.name will give non-sensical values in prod because of
|
|
47
|
-
// minification, but we assume it won't throw in prod.
|
|
48
|
-
|
|
49
|
-
throw new Error(
|
|
50
|
-
`Docusaurus error: Bad <Tabs> child <${
|
|
51
|
-
// @ts-expect-error: guarding against unexpected cases
|
|
52
|
-
typeof child.type === "string" ? child.type : child.type.name
|
|
53
|
-
}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`
|
|
54
|
-
);
|
|
55
|
-
});
|
|
56
|
-
const values =
|
|
57
|
-
valuesProp ?? // We only pick keys that we recognize. MDX would inject some keys by default
|
|
58
|
-
children.map(({ props: { value, label, attributes } }) => ({
|
|
59
|
-
value,
|
|
60
|
-
label,
|
|
61
|
-
attributes,
|
|
62
|
-
}));
|
|
63
|
-
const dup = duplicates(values, (a, b) => a.value === b.value);
|
|
64
|
-
|
|
65
|
-
if (dup.length > 0) {
|
|
66
|
-
throw new Error(
|
|
67
|
-
`Docusaurus error: Duplicate values "${dup
|
|
68
|
-
.map((a) => a.value)
|
|
69
|
-
.join(", ")}" found in <Tabs>. Every value needs to be unique.`
|
|
70
|
-
);
|
|
71
|
-
} // When defaultValueProp is null, don't show a default tab
|
|
72
|
-
|
|
73
|
-
const defaultValue =
|
|
74
|
-
defaultValueProp === null
|
|
75
|
-
? defaultValueProp
|
|
76
|
-
: defaultValueProp ??
|
|
77
|
-
children.find((child) => child.props.default)?.props.value ??
|
|
78
|
-
children[0]?.props.value;
|
|
79
|
-
|
|
80
|
-
if (defaultValue !== null && !values.some((a) => a.value === defaultValue)) {
|
|
81
|
-
throw new Error(
|
|
82
|
-
`Docusaurus error: The <Tabs> has a defaultValue "${defaultValue}" but none of its children has the corresponding value. Available values are: ${values
|
|
83
|
-
.map((a) => a.value)
|
|
84
|
-
.join(
|
|
85
|
-
", "
|
|
86
|
-
)}. If you intend to show no default tab, use defaultValue={null} instead.`
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const { tabGroupChoices, setTabGroupChoices } = useTabGroupChoice();
|
|
91
|
-
const [selectedValue, setSelectedValue] = useState(defaultValue);
|
|
92
|
-
const tabRefs = [];
|
|
93
|
-
const { blockElementScrollPositionUntilNextRender } =
|
|
94
|
-
useScrollPositionBlocker();
|
|
95
|
-
|
|
96
|
-
if (groupId != null) {
|
|
97
|
-
const relevantTabGroupChoice = tabGroupChoices[groupId];
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
relevantTabGroupChoice != null &&
|
|
101
|
-
relevantTabGroupChoice !== selectedValue &&
|
|
102
|
-
values.some((value) => value.value === relevantTabGroupChoice)
|
|
103
|
-
) {
|
|
104
|
-
setSelectedValue(relevantTabGroupChoice);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const handleTabChange = (event) => {
|
|
109
|
-
const newTab = event.currentTarget;
|
|
110
|
-
const newTabIndex = tabRefs.indexOf(newTab);
|
|
111
|
-
const newTabValue = values[newTabIndex].value;
|
|
112
|
-
|
|
113
|
-
if (newTabValue !== selectedValue) {
|
|
114
|
-
blockElementScrollPositionUntilNextRender(newTab);
|
|
115
|
-
setSelectedValue(newTabValue);
|
|
116
|
-
|
|
117
|
-
if (groupId != null) {
|
|
118
|
-
setTabGroupChoices(groupId, newTabValue);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const handleKeydown = (event) => {
|
|
124
|
-
let focusElement = null;
|
|
125
|
-
|
|
126
|
-
switch (event.key) {
|
|
127
|
-
case "ArrowRight": {
|
|
128
|
-
const nextTab = tabRefs.indexOf(event.currentTarget) + 1;
|
|
129
|
-
focusElement = tabRefs[nextTab] || tabRefs[0];
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
case "ArrowLeft": {
|
|
134
|
-
const prevTab = tabRefs.indexOf(event.currentTarget) - 1;
|
|
135
|
-
focusElement = tabRefs[prevTab] || tabRefs[tabRefs.length - 1];
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
default:
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
focusElement?.focus();
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const tabItemListContainerRef = useRef(null);
|
|
147
|
-
const [showTabArrows, setShowTabArrows] = useState(false);
|
|
148
|
-
|
|
149
|
-
useEffect(() => {
|
|
150
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
151
|
-
for (let entry of entries) {
|
|
152
|
-
if (entry.target.offsetWidth < entry.target.scrollWidth) {
|
|
153
|
-
setShowTabArrows(true);
|
|
154
|
-
} else {
|
|
155
|
-
setShowTabArrows(false);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
resizeObserver.observe(tabItemListContainerRef.current);
|
|
161
|
-
|
|
162
|
-
return () => {
|
|
163
|
-
resizeObserver.disconnect();
|
|
164
|
-
};
|
|
165
|
-
}, []);
|
|
166
|
-
|
|
167
|
-
const handleRightClick = () => {
|
|
168
|
-
tabItemListContainerRef.current.scrollLeft += 90;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
const handleLeftClick = () => {
|
|
172
|
-
tabItemListContainerRef.current.scrollLeft -= 90;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
return (
|
|
176
|
-
<div className={clsx("tabs__container", "discriminatorTabs")}>
|
|
177
|
-
<div className={styles.discriminatorTabsTopSection}>
|
|
178
|
-
<div className={clsx(styles.discriminatorTabsContainer)}>
|
|
179
|
-
{showTabArrows && (
|
|
180
|
-
<button
|
|
181
|
-
className={clsx(styles.tabArrow, styles.tabArrowLeft)}
|
|
182
|
-
onClick={handleLeftClick}
|
|
183
|
-
/>
|
|
184
|
-
)}
|
|
185
|
-
<ul
|
|
186
|
-
ref={tabItemListContainerRef}
|
|
187
|
-
role="tablist"
|
|
188
|
-
aria-orientation="horizontal"
|
|
189
|
-
className={clsx(
|
|
190
|
-
styles.discriminatorTabsListContainer,
|
|
191
|
-
"tabs",
|
|
192
|
-
{
|
|
193
|
-
"tabs--block": block,
|
|
194
|
-
},
|
|
195
|
-
className
|
|
196
|
-
)}
|
|
197
|
-
>
|
|
198
|
-
{values.map(({ value, label, attributes }) => {
|
|
199
|
-
return (
|
|
200
|
-
<li
|
|
201
|
-
role="tab"
|
|
202
|
-
tabIndex={selectedValue === value ? 0 : -1}
|
|
203
|
-
aria-selected={selectedValue === value}
|
|
204
|
-
key={value}
|
|
205
|
-
ref={(tabControl) => tabRefs.push(tabControl)}
|
|
206
|
-
onKeyDown={handleKeydown}
|
|
207
|
-
onFocus={handleTabChange}
|
|
208
|
-
onClick={handleTabChange}
|
|
209
|
-
{...attributes}
|
|
210
|
-
className={clsx(
|
|
211
|
-
"tabs__item",
|
|
212
|
-
styles.tabItem,
|
|
213
|
-
attributes?.className,
|
|
214
|
-
{
|
|
215
|
-
[styles.discriminatorTabActive]: selectedValue === value,
|
|
216
|
-
}
|
|
217
|
-
)}
|
|
218
|
-
>
|
|
219
|
-
<span className={styles.discriminatorTabLabel}>
|
|
220
|
-
{label ?? value}
|
|
221
|
-
</span>
|
|
222
|
-
</li>
|
|
223
|
-
);
|
|
224
|
-
})}
|
|
225
|
-
</ul>
|
|
226
|
-
{showTabArrows && (
|
|
227
|
-
<button
|
|
228
|
-
className={clsx(styles.tabArrow, styles.tabArrowRight)}
|
|
229
|
-
onClick={handleRightClick}
|
|
230
|
-
/>
|
|
231
|
-
)}
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
<hr />
|
|
235
|
-
{lazy ? (
|
|
236
|
-
cloneElement(
|
|
237
|
-
children.filter(
|
|
238
|
-
(tabItem) => tabItem.props.value === selectedValue
|
|
239
|
-
)[0],
|
|
240
|
-
{
|
|
241
|
-
className: clsx(
|
|
242
|
-
"margin-vert--md",
|
|
243
|
-
styles.discriminatorTabsContainer
|
|
244
|
-
),
|
|
245
|
-
}
|
|
246
|
-
)
|
|
247
|
-
) : (
|
|
248
|
-
<div
|
|
249
|
-
className={clsx("margin-vert--md", styles.discriminatorTabsContainer)}
|
|
250
|
-
>
|
|
251
|
-
{children.map((tabItem, i) =>
|
|
252
|
-
cloneElement(tabItem, {
|
|
253
|
-
key: i,
|
|
254
|
-
hidden: tabItem.props.value !== selectedValue,
|
|
255
|
-
})
|
|
256
|
-
)}
|
|
257
|
-
</div>
|
|
258
|
-
)}
|
|
259
|
-
</div>
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
export default function DiscriminatorTabs(props) {
|
|
264
|
-
const isBrowser = useIsBrowser();
|
|
265
|
-
return (
|
|
266
|
-
<DiscriminatorTabsComponent // Remount tabs after hydration
|
|
267
|
-
// Temporary fix for https://github.com/facebook/docusaurus/issues/5653
|
|
268
|
-
key={String(isBrowser)}
|
|
269
|
-
{...props}
|
|
270
|
-
/>
|
|
271
|
-
);
|
|
272
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
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
|
-
.tabItem {
|
|
9
|
-
display: flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
height: 1.8rem;
|
|
13
|
-
margin-top: 0 !important;
|
|
14
|
-
margin-right: 0.5rem;
|
|
15
|
-
border: 1px solid var(--ifm-color-primary);
|
|
16
|
-
border-radius: var(--ifm-global-radius);
|
|
17
|
-
color: var(--ifm-color-primary);
|
|
18
|
-
font-size: 12px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.tabItem:not(.discriminatorTabActive) {
|
|
22
|
-
opacity: 0.65;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.tabItem:hover {
|
|
26
|
-
opacity: 1;
|
|
27
|
-
background-color: var(--ifm-color-emphasis-100);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.tabItem:last-child {
|
|
31
|
-
margin-right: 0 !important;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/* Open API Schema Tabs */
|
|
35
|
-
.discriminatorTabs {
|
|
36
|
-
margin-left: -20px !important;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.discriminatorTabsTopSection {
|
|
40
|
-
margin-top: 1rem;
|
|
41
|
-
margin-left: 1rem;
|
|
42
|
-
display: flex;
|
|
43
|
-
justify-content: space-between;
|
|
44
|
-
align-items: center;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.discriminatorTabsTopSection + hr {
|
|
48
|
-
display: none;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.discriminatorTabsContainer {
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
max-width: 390px;
|
|
55
|
-
padding-left: 3px;
|
|
56
|
-
overflow: hidden;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.discriminatorTabsListContainer {
|
|
60
|
-
padding: 0 0.25rem;
|
|
61
|
-
overflow-y: hidden;
|
|
62
|
-
overflow-x: scroll;
|
|
63
|
-
scroll-behavior: smooth;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.discriminatorTabsListContainer::-webkit-scrollbar {
|
|
67
|
-
display: none;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.tabItem.discriminatorTabActive {
|
|
71
|
-
background-color: var(--ifm-color-emphasis-100);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.discriminatorTabLabel {
|
|
75
|
-
white-space: nowrap;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.discriminatorTabsContainer {
|
|
79
|
-
max-width: 600px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/* Tab Arrows */
|
|
83
|
-
.tabArrow {
|
|
84
|
-
content: "";
|
|
85
|
-
height: 1.25rem;
|
|
86
|
-
width: 1.25rem;
|
|
87
|
-
padding: 0 0.75rem;
|
|
88
|
-
border: none;
|
|
89
|
-
min-width: 1.25rem;
|
|
90
|
-
background: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem;
|
|
91
|
-
filter: var(--ifm-menu-link-sublist-icon-filter);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.tabArrow:hover {
|
|
95
|
-
cursor: pointer;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.tabArrowLeft {
|
|
99
|
-
transform: rotate(270deg);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.tabArrowRight {
|
|
103
|
-
transform: rotate(90deg);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@media screen and (max-width: 500px) {
|
|
107
|
-
.discriminatorTabsTopSection {
|
|
108
|
-
flex-direction: column;
|
|
109
|
-
align-items: flex-start;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.discriminatorTabsContainer {
|
|
113
|
-
width: 100%;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.tabItem {
|
|
117
|
-
height: 100%;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
@@ -1,295 +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, {
|
|
9
|
-
Children,
|
|
10
|
-
cloneElement,
|
|
11
|
-
isValidElement,
|
|
12
|
-
useEffect,
|
|
13
|
-
useRef,
|
|
14
|
-
useState,
|
|
15
|
-
} from "react";
|
|
16
|
-
|
|
17
|
-
import { duplicates } from "@docusaurus/theme-common";
|
|
18
|
-
import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
19
|
-
import { setAccept } from "@theme/ApiDemoPanel/Accept/slice";
|
|
20
|
-
import { setContentType } from "@theme/ApiDemoPanel/ContentType/slice";
|
|
21
|
-
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
22
|
-
import clsx from "clsx";
|
|
23
|
-
|
|
24
|
-
import styles from "./styles.module.css";
|
|
25
|
-
|
|
26
|
-
const {
|
|
27
|
-
useScrollPositionBlocker,
|
|
28
|
-
useTabGroupChoice,
|
|
29
|
-
} = require("@docusaurus/theme-common/internal");
|
|
30
|
-
|
|
31
|
-
function isTabItem(comp) {
|
|
32
|
-
return typeof comp.props.value !== "undefined";
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function MimeTabsComponent(props) {
|
|
36
|
-
const {
|
|
37
|
-
lazy,
|
|
38
|
-
block,
|
|
39
|
-
defaultValue: defaultValueProp,
|
|
40
|
-
values: valuesProp,
|
|
41
|
-
groupId,
|
|
42
|
-
className,
|
|
43
|
-
schemaType,
|
|
44
|
-
} = props;
|
|
45
|
-
const children = Children.map(props.children, (child) => {
|
|
46
|
-
if (isValidElement(child) && isTabItem(child)) {
|
|
47
|
-
return child;
|
|
48
|
-
} // child.type.name will give non-sensical values in prod because of
|
|
49
|
-
// minification, but we assume it won't throw in prod.
|
|
50
|
-
|
|
51
|
-
throw new Error(
|
|
52
|
-
`Docusaurus error: Bad <Tabs> child <${
|
|
53
|
-
// @ts-expect-error: guarding against unexpected cases
|
|
54
|
-
typeof child.type === "string" ? child.type : child.type.name
|
|
55
|
-
}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`
|
|
56
|
-
);
|
|
57
|
-
});
|
|
58
|
-
const values =
|
|
59
|
-
valuesProp ?? // We only pick keys that we recognize. MDX would inject some keys by default
|
|
60
|
-
children.map(({ props: { value, label, attributes } }) => ({
|
|
61
|
-
value,
|
|
62
|
-
label,
|
|
63
|
-
attributes,
|
|
64
|
-
}));
|
|
65
|
-
const dup = duplicates(values, (a, b) => a.value === b.value);
|
|
66
|
-
|
|
67
|
-
if (dup.length > 0) {
|
|
68
|
-
throw new Error(
|
|
69
|
-
`Docusaurus error: Duplicate values "${dup
|
|
70
|
-
.map((a) => a.value)
|
|
71
|
-
.join(", ")}" found in <Tabs>. Every value needs to be unique.`
|
|
72
|
-
);
|
|
73
|
-
} // When defaultValueProp is null, don't show a default tab
|
|
74
|
-
|
|
75
|
-
const defaultValue =
|
|
76
|
-
defaultValueProp === null
|
|
77
|
-
? defaultValueProp
|
|
78
|
-
: defaultValueProp ??
|
|
79
|
-
children.find((child) => child.props.default)?.props.value ??
|
|
80
|
-
children[0]?.props.value;
|
|
81
|
-
|
|
82
|
-
if (defaultValue !== null && !values.some((a) => a.value === defaultValue)) {
|
|
83
|
-
throw new Error(
|
|
84
|
-
`Docusaurus error: The <Tabs> has a defaultValue "${defaultValue}" but none of its children has the corresponding value. Available values are: ${values
|
|
85
|
-
.map((a) => a.value)
|
|
86
|
-
.join(
|
|
87
|
-
", "
|
|
88
|
-
)}. If you intend to show no default tab, use defaultValue={null} instead.`
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const { tabGroupChoices, setTabGroupChoices } = useTabGroupChoice();
|
|
93
|
-
const [selectedValue, setSelectedValue] = useState(defaultValue);
|
|
94
|
-
const tabRefs = [];
|
|
95
|
-
const { blockElementScrollPositionUntilNextRender } =
|
|
96
|
-
useScrollPositionBlocker();
|
|
97
|
-
|
|
98
|
-
if (groupId != null) {
|
|
99
|
-
const relevantTabGroupChoice = tabGroupChoices[groupId];
|
|
100
|
-
|
|
101
|
-
if (
|
|
102
|
-
relevantTabGroupChoice != null &&
|
|
103
|
-
relevantTabGroupChoice !== selectedValue &&
|
|
104
|
-
values.some((value) => value.value === relevantTabGroupChoice)
|
|
105
|
-
) {
|
|
106
|
-
setSelectedValue(relevantTabGroupChoice);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const dispatch = useTypedDispatch();
|
|
111
|
-
const isRequestSchema = schemaType?.toLowerCase() === "request";
|
|
112
|
-
|
|
113
|
-
const handleTabChange = (event) => {
|
|
114
|
-
event.preventDefault();
|
|
115
|
-
const newTab = event.currentTarget;
|
|
116
|
-
const newTabIndex = tabRefs.indexOf(newTab);
|
|
117
|
-
const newTabValue = values[newTabIndex].value;
|
|
118
|
-
|
|
119
|
-
if (newTabValue !== selectedValue) {
|
|
120
|
-
if (isRequestSchema) {
|
|
121
|
-
dispatch(setContentType(newTabValue));
|
|
122
|
-
} else {
|
|
123
|
-
dispatch(setAccept(newTabValue));
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
blockElementScrollPositionUntilNextRender(newTab);
|
|
127
|
-
setSelectedValue(newTabValue);
|
|
128
|
-
|
|
129
|
-
if (groupId != null) {
|
|
130
|
-
setTabGroupChoices(groupId, newTabValue);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const contentTypeVal = useTypedSelector((state) => state.contentType.value);
|
|
136
|
-
const acceptTypeVal = useTypedSelector((state) => state.accept.value);
|
|
137
|
-
|
|
138
|
-
useEffect(() => {
|
|
139
|
-
if (tabRefs.length > 1) {
|
|
140
|
-
if (isRequestSchema) {
|
|
141
|
-
setSelectedValue(contentTypeVal);
|
|
142
|
-
} else {
|
|
143
|
-
setSelectedValue(acceptTypeVal);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
147
|
-
}, [contentTypeVal, acceptTypeVal]);
|
|
148
|
-
|
|
149
|
-
const handleKeydown = (event) => {
|
|
150
|
-
let focusElement = null;
|
|
151
|
-
|
|
152
|
-
switch (event.key) {
|
|
153
|
-
case "ArrowRight": {
|
|
154
|
-
const nextTab = tabRefs.indexOf(event.currentTarget) + 1;
|
|
155
|
-
focusElement = tabRefs[nextTab] || tabRefs[0];
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
case "ArrowLeft": {
|
|
160
|
-
const prevTab = tabRefs.indexOf(event.currentTarget) - 1;
|
|
161
|
-
focusElement = tabRefs[prevTab] || tabRefs[tabRefs.length - 1];
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
default:
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
focusElement?.focus();
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const tabItemListContainerRef = useRef(null);
|
|
173
|
-
const [showTabArrows, setShowTabArrows] = useState(false);
|
|
174
|
-
|
|
175
|
-
useEffect(() => {
|
|
176
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
177
|
-
for (let entry of entries) {
|
|
178
|
-
if (entry.target.offsetWidth < entry.target.scrollWidth) {
|
|
179
|
-
setShowTabArrows(true);
|
|
180
|
-
} else {
|
|
181
|
-
setShowTabArrows(false);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
resizeObserver.observe(tabItemListContainerRef.current);
|
|
187
|
-
|
|
188
|
-
return () => {
|
|
189
|
-
resizeObserver.disconnect();
|
|
190
|
-
};
|
|
191
|
-
}, []);
|
|
192
|
-
|
|
193
|
-
const handleRightClick = () => {
|
|
194
|
-
tabItemListContainerRef.current.scrollLeft += 90;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
const handleLeftClick = () => {
|
|
198
|
-
tabItemListContainerRef.current.scrollLeft -= 90;
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
return (
|
|
202
|
-
<div className="tabs__container">
|
|
203
|
-
<div className={styles.mimeTabsTopSection}>
|
|
204
|
-
{/* <strong>MIME Type</strong> */}
|
|
205
|
-
<div className={styles.mimeTabsContainer}>
|
|
206
|
-
{showTabArrows && (
|
|
207
|
-
<button
|
|
208
|
-
className={clsx(styles.tabArrow, styles.tabArrowLeft)}
|
|
209
|
-
onClick={handleLeftClick}
|
|
210
|
-
/>
|
|
211
|
-
)}
|
|
212
|
-
<div
|
|
213
|
-
ref={tabItemListContainerRef}
|
|
214
|
-
role="tablist"
|
|
215
|
-
aria-orientation="horizontal"
|
|
216
|
-
className={clsx(
|
|
217
|
-
styles.mimeTabsListContainer,
|
|
218
|
-
"tabs",
|
|
219
|
-
{
|
|
220
|
-
"tabs--block": block,
|
|
221
|
-
},
|
|
222
|
-
className
|
|
223
|
-
)}
|
|
224
|
-
>
|
|
225
|
-
{values.map(({ value, label, attributes }) => {
|
|
226
|
-
return (
|
|
227
|
-
<div
|
|
228
|
-
role="tab"
|
|
229
|
-
tabIndex={selectedValue === value ? 0 : -1}
|
|
230
|
-
aria-selected={selectedValue === value}
|
|
231
|
-
key={value}
|
|
232
|
-
ref={(tabControl) => tabRefs.push(tabControl)}
|
|
233
|
-
onKeyDown={handleKeydown}
|
|
234
|
-
onFocus={handleTabChange}
|
|
235
|
-
onClick={(e) => handleTabChange(e)}
|
|
236
|
-
{...attributes}
|
|
237
|
-
className={clsx(
|
|
238
|
-
"tabs__item",
|
|
239
|
-
styles.tabItem,
|
|
240
|
-
attributes?.className,
|
|
241
|
-
{
|
|
242
|
-
[styles.mimeTabActive]: selectedValue === value,
|
|
243
|
-
}
|
|
244
|
-
)}
|
|
245
|
-
>
|
|
246
|
-
{/* <div
|
|
247
|
-
className={clsx(styles.mimeTabDot, mimeTabDotStyle)}
|
|
248
|
-
/> */}
|
|
249
|
-
{label ?? value}
|
|
250
|
-
</div>
|
|
251
|
-
);
|
|
252
|
-
})}
|
|
253
|
-
</div>
|
|
254
|
-
{showTabArrows && (
|
|
255
|
-
<button
|
|
256
|
-
className={clsx(styles.tabArrow, styles.tabArrowRight)}
|
|
257
|
-
onClick={handleRightClick}
|
|
258
|
-
/>
|
|
259
|
-
)}
|
|
260
|
-
</div>
|
|
261
|
-
</div>
|
|
262
|
-
{/* <hr /> */}
|
|
263
|
-
{lazy ? (
|
|
264
|
-
cloneElement(
|
|
265
|
-
children.filter(
|
|
266
|
-
(tabItem) => tabItem.props.value === selectedValue
|
|
267
|
-
)[0],
|
|
268
|
-
{
|
|
269
|
-
className: clsx("margin-vert--md", styles.mimeSchemaContainer),
|
|
270
|
-
}
|
|
271
|
-
)
|
|
272
|
-
) : (
|
|
273
|
-
<div className={clsx("margin-vert--md", styles.mimeSchemaContainer)}>
|
|
274
|
-
{children.map((tabItem, i) =>
|
|
275
|
-
cloneElement(tabItem, {
|
|
276
|
-
key: i,
|
|
277
|
-
hidden: tabItem.props.value !== selectedValue,
|
|
278
|
-
})
|
|
279
|
-
)}
|
|
280
|
-
</div>
|
|
281
|
-
)}
|
|
282
|
-
</div>
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
export default function MimeTabs(props) {
|
|
287
|
-
const isBrowser = useIsBrowser();
|
|
288
|
-
return (
|
|
289
|
-
<MimeTabsComponent // Remount tabs after hydration
|
|
290
|
-
// Temporary fix for https://github.com/facebook/docusaurus/issues/5653
|
|
291
|
-
key={String(isBrowser)}
|
|
292
|
-
{...props}
|
|
293
|
-
/>
|
|
294
|
-
);
|
|
295
|
-
}
|