@scalar/api-reference 1.49.3 → 1.49.4
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/CHANGELOG.md +9 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/blocks/index.js +4 -2
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +9 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js.map +1 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js +106 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js.map +1 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +9 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js.map +1 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js +121 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js.map +1 -0
- package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js +27 -0
- package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js.map +1 -0
- package/dist/blocks/scalar-client-selector-block/index.d.ts +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +9 -0
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js +55 -0
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js +7 -0
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js +69 -0
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +9 -0
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.script.js +68 -0
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js +7 -0
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js +40 -0
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js +7 -0
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js +35 -0
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.js +7 -0
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.script.js +25 -0
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js +9 -0
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js +15 -0
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +14 -0
- package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +9 -0
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js +92 -0
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js +7 -0
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.script.js +19 -0
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/index.d.ts +2 -2
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js +7 -0
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js.map +1 -0
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js +71 -0
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js.map +1 -0
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +7 -0
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js.map +1 -0
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js +69 -0
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js.map +1 -0
- package/dist/blocks/scalar-server-selector-block/index.d.ts +1 -1
- package/dist/browser/standalone.js +35377 -34973
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/AgentScalar/AgentScalarButton.vue.js +7 -0
- package/dist/components/AgentScalar/AgentScalarButton.vue.js.map +1 -0
- package/dist/components/AgentScalar/AgentScalarButton.vue.script.js +21 -0
- package/dist/components/AgentScalar/AgentScalarButton.vue.script.js.map +1 -0
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.js +7 -0
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.js.map +1 -0
- package/dist/{AgentScalarChatInterface-MUbtSqMw.js → components/AgentScalar/AgentScalarChatInterface.vue.script.js} +5 -6
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js.map +1 -0
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts +0 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +9 -0
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js.map +1 -0
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js +65 -0
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js.map +1 -0
- package/dist/components/AgentScalar/OpenMCPButton.vue.js +9 -0
- package/dist/components/AgentScalar/OpenMCPButton.vue.js.map +1 -0
- package/dist/components/AgentScalar/OpenMCPButton.vue.script.js +184 -0
- package/dist/components/AgentScalar/OpenMCPButton.vue.script.js.map +1 -0
- package/dist/components/AgentScalar/index.d.ts +3 -3
- package/dist/components/Anchor/Anchor.vue.js +7 -0
- package/dist/components/Anchor/Anchor.vue.js.map +1 -0
- package/dist/components/Anchor/Anchor.vue.script.js +40 -0
- package/dist/components/Anchor/Anchor.vue.script.js.map +1 -0
- package/dist/components/Anchor/WithBreadcrumb.vue.js +7 -0
- package/dist/components/Anchor/WithBreadcrumb.vue.js.map +1 -0
- package/dist/components/Anchor/WithBreadcrumb.vue.script.js +32 -0
- package/dist/components/Anchor/WithBreadcrumb.vue.script.js.map +1 -0
- package/dist/components/Anchor/index.d.ts +2 -2
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +12 -0
- package/dist/components/ApiReference.vue.js.map +1 -0
- package/dist/components/ApiReference.vue.script.js +662 -0
- package/dist/components/ApiReference.vue.script.js.map +1 -0
- package/dist/components/Badge/Badge.vue.js +9 -0
- package/dist/components/Badge/Badge.vue.js.map +1 -0
- package/dist/components/Badge/Badge.vue.script.js +22 -0
- package/dist/components/Badge/Badge.vue.script.js.map +1 -0
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/ClassicHeader.vue.js +16 -0
- package/dist/components/ClassicHeader.vue.js.map +1 -0
- package/dist/components/Content/Auth/Auth.vue.js +7 -0
- package/dist/components/Content/Auth/Auth.vue.js.map +1 -0
- package/dist/components/Content/Auth/Auth.vue.script.js +70 -0
- package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -0
- package/dist/components/Content/Auth/helpers/get-default-security.js +64 -0
- package/dist/components/Content/Auth/helpers/get-default-security.js.map +1 -0
- package/dist/components/Content/Auth/index.d.ts +1 -1
- package/dist/components/Content/Content.vue.js +8 -0
- package/dist/components/Content/Content.vue.js.map +1 -0
- package/dist/components/Content/Content.vue.script.js +192 -0
- package/dist/components/Content/Content.vue.script.js.map +1 -0
- package/dist/components/Content/Models/Model.vue.js +7 -0
- package/dist/components/Content/Models/Model.vue.js.map +1 -0
- package/dist/components/Content/Models/Model.vue.script.js +61 -0
- package/dist/components/Content/Models/Model.vue.script.js.map +1 -0
- package/dist/components/Content/Models/ModelTag.vue.js +7 -0
- package/dist/components/Content/Models/ModelTag.vue.js.map +1 -0
- package/dist/components/Content/Models/ModelTag.vue.script.js +69 -0
- package/dist/components/Content/Models/ModelTag.vue.script.js.map +1 -0
- package/dist/components/Content/Models/components/ClassicLayout.vue.js +9 -0
- package/dist/components/Content/Models/components/ClassicLayout.vue.js.map +1 -0
- package/dist/components/Content/Models/components/ClassicLayout.vue.script.js +81 -0
- package/dist/components/Content/Models/components/ClassicLayout.vue.script.js.map +1 -0
- package/dist/components/Content/Models/components/ModernLayout.vue.js +7 -0
- package/dist/components/Content/Models/components/ModernLayout.vue.js.map +1 -0
- package/dist/components/Content/Models/components/ModernLayout.vue.script.js +66 -0
- package/dist/components/Content/Models/components/ModernLayout.vue.script.js.map +1 -0
- package/dist/components/Content/Models/index.d.ts +2 -2
- package/dist/components/Content/Operations/TraversedEntry.vue.js +7 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.script.js +213 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/RenderString.vue.js +7 -0
- package/dist/components/Content/Schema/RenderString.vue.js.map +1 -0
- package/dist/components/Content/Schema/RenderString.vue.script.js +36 -0
- package/dist/components/Content/Schema/RenderString.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/Schema.vue.js +9 -0
- package/dist/components/Content/Schema/Schema.vue.js.map +1 -0
- package/dist/components/Content/Schema/Schema.vue.script.js +184 -0
- package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js +146 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js +29 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaEnums.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaEnums.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaEnums.vue.script.js +108 -0
- package/dist/components/Content/Schema/SchemaEnums.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaHeading.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaHeading.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaHeading.vue.script.js +45 -0
- package/dist/components/Content/Schema/SchemaHeading.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js +55 -0
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +161 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js +256 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js +35 -0
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.script.js +30 -0
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js +67 -0
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +251 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/helpers/format-example.js +26 -0
- package/dist/components/Content/Schema/helpers/format-example.js.map +1 -0
- package/dist/components/Content/Schema/helpers/format-value.js +22 -0
- package/dist/components/Content/Schema/helpers/format-value.js.map +1 -0
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts +1 -1
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.js +32 -0
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.js.map +1 -0
- package/dist/components/Content/Schema/helpers/get-enum-values.js +22 -0
- package/dist/components/Content/Schema/helpers/get-enum-values.js.map +1 -0
- package/dist/components/Content/Schema/helpers/get-property-description.js +36 -0
- package/dist/components/Content/Schema/helpers/get-property-description.js.map +1 -0
- package/dist/components/Content/Schema/helpers/get-ref-name.js +19 -0
- package/dist/components/Content/Schema/helpers/get-ref-name.js.map +1 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.js +49 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.js.map +1 -0
- package/dist/components/Content/Schema/helpers/has-complex-array-items.js +53 -0
- package/dist/components/Content/Schema/helpers/has-complex-array-items.js.map +1 -0
- package/dist/components/Content/Schema/helpers/is-empty-schema-object.js +18 -0
- package/dist/components/Content/Schema/helpers/is-empty-schema-object.js.map +1 -0
- package/dist/components/Content/Schema/helpers/is-type-object.js +18 -0
- package/dist/components/Content/Schema/helpers/is-type-object.js.map +1 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +175 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -0
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +68 -0
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js.map +1 -0
- package/dist/components/Content/Schema/helpers/schema-composition.js +11 -0
- package/dist/components/Content/Schema/helpers/schema-composition.js.map +1 -0
- package/dist/components/Content/Schema/helpers/schema-name.js +23 -0
- package/dist/components/Content/Schema/helpers/schema-name.js.map +1 -0
- package/dist/components/Content/Schema/helpers/should-display-description.js +17 -0
- package/dist/components/Content/Schema/helpers/should-display-description.js.map +1 -0
- package/dist/components/Content/Schema/helpers/should-display-heading.js +18 -0
- package/dist/components/Content/Schema/helpers/should-display-heading.js.map +1 -0
- package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js +20 -0
- package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js.map +1 -0
- package/dist/components/Content/Schema/helpers/sort-property-names.js +45 -0
- package/dist/components/Content/Schema/helpers/sort-property-names.js.map +1 -0
- package/dist/components/Content/Schema/index.d.ts +4 -4
- package/dist/components/Content/Tags/Tag.vue.js +7 -0
- package/dist/components/Content/Tags/Tag.vue.js.map +1 -0
- package/dist/components/Content/Tags/Tag.vue.script.js +56 -0
- package/dist/components/Content/Tags/Tag.vue.script.js.map +1 -0
- package/dist/components/Content/Tags/components/ClassicLayout.vue.js +9 -0
- package/dist/components/Content/Tags/components/ClassicLayout.vue.js.map +1 -0
- package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js +49 -0
- package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js.map +1 -0
- package/dist/components/Content/Tags/components/ModernLayout.vue.js +9 -0
- package/dist/components/Content/Tags/components/ModernLayout.vue.js.map +1 -0
- package/dist/components/Content/Tags/components/ModernLayout.vue.script.js +63 -0
- package/dist/components/Content/Tags/components/ModernLayout.vue.script.js.map +1 -0
- package/dist/components/Content/Tags/components/TagSection.vue.js +7 -0
- package/dist/components/Content/Tags/components/TagSection.vue.js.map +1 -0
- package/dist/components/Content/Tags/components/TagSection.vue.script.js +78 -0
- package/dist/components/Content/Tags/components/TagSection.vue.script.js.map +1 -0
- package/dist/components/Content/Tags/index.d.ts +1 -1
- package/dist/components/Content/index.d.ts +2 -2
- package/dist/components/GettingStarted.vue.js +9 -0
- package/dist/components/GettingStarted.vue.js.map +1 -0
- package/dist/components/GettingStarted.vue.script.js +71 -0
- package/dist/components/GettingStarted.vue.script.js.map +1 -0
- package/dist/components/HttpMethod/HttpMethod.vue.js +7 -0
- package/dist/components/HttpMethod/HttpMethod.vue.js.map +1 -0
- package/dist/components/HttpMethod/HttpMethod.vue.script.js +33 -0
- package/dist/components/HttpMethod/HttpMethod.vue.script.js.map +1 -0
- package/dist/components/HttpMethod/index.d.ts +1 -1
- package/dist/components/IntersectionObserver.vue.js +7 -0
- package/dist/components/IntersectionObserver.vue.js.map +1 -0
- package/dist/components/IntersectionObserver.vue.script.js +45 -0
- package/dist/components/IntersectionObserver.vue.script.js.map +1 -0
- package/dist/components/Lazy/Lazy.vue.js +7 -0
- package/dist/components/Lazy/Lazy.vue.js.map +1 -0
- package/dist/components/Lazy/Lazy.vue.script.js +101 -0
- package/dist/components/Lazy/Lazy.vue.script.js.map +1 -0
- package/dist/components/LinkList/LinkList.vue.js +9 -0
- package/dist/components/LinkList/LinkList.vue.js.map +1 -0
- package/dist/components/LinkList/LinkList.vue.script.js +53 -0
- package/dist/components/LinkList/LinkList.vue.script.js.map +1 -0
- package/dist/components/LinkList/index.d.ts +1 -1
- package/dist/components/LoadingSkeleton.vue.js +9 -0
- package/dist/components/LoadingSkeleton.vue.js.map +1 -0
- package/dist/components/LoadingSkeleton.vue.script.js +20 -0
- package/dist/components/LoadingSkeleton.vue.script.js.map +1 -0
- package/dist/components/MobileHeader.vue.d.ts.map +1 -1
- package/dist/components/MobileHeader.vue.js +7 -0
- package/dist/components/MobileHeader.vue.js.map +1 -0
- package/dist/components/MobileHeader.vue.script.js +43 -0
- package/dist/components/MobileHeader.vue.script.js.map +1 -0
- package/dist/components/OperationPath.vue.js +9 -0
- package/dist/components/OperationPath.vue.js.map +1 -0
- package/dist/components/OperationPath.vue.script.js +24 -0
- package/dist/components/OperationPath.vue.script.js.map +1 -0
- package/dist/components/OperationsList/OperationsList.vue.js +9 -0
- package/dist/components/OperationsList/OperationsList.vue.js.map +1 -0
- package/dist/components/OperationsList/OperationsList.vue.script.js +49 -0
- package/dist/components/OperationsList/OperationsList.vue.script.js.map +1 -0
- package/dist/components/OperationsList/OperationsListItem.vue.js +9 -0
- package/dist/components/OperationsList/OperationsListItem.vue.js.map +1 -0
- package/dist/components/OperationsList/OperationsListItem.vue.script.js +51 -0
- package/dist/components/OperationsList/OperationsListItem.vue.script.js.map +1 -0
- package/dist/components/OperationsList/index.d.ts +1 -1
- package/dist/components/RenderPlugins/RenderPlugins.vue.js +7 -0
- package/dist/components/RenderPlugins/RenderPlugins.vue.js.map +1 -0
- package/dist/components/RenderPlugins/RenderPlugins.vue.script.js +44 -0
- package/dist/components/RenderPlugins/RenderPlugins.vue.script.js.map +1 -0
- package/dist/components/RenderPlugins/index.d.ts +1 -1
- package/dist/components/ScreenReader.vue.js +9 -0
- package/dist/components/ScreenReader.vue.js.map +1 -0
- package/dist/components/ScreenReader.vue.script.js +22 -0
- package/dist/components/ScreenReader.vue.script.js.map +1 -0
- package/dist/components/Section/CompactSection.vue.js +9 -0
- package/dist/components/Section/CompactSection.vue.js.map +1 -0
- package/dist/components/Section/CompactSection.vue.script.js +56 -0
- package/dist/components/Section/CompactSection.vue.script.js.map +1 -0
- package/dist/components/Section/Section.vue.js +9 -0
- package/dist/components/Section/Section.vue.js.map +1 -0
- package/dist/components/Section/Section.vue.script.js +23 -0
- package/dist/components/Section/Section.vue.script.js.map +1 -0
- package/dist/components/Section/SectionAccordion.vue.js +9 -0
- package/dist/components/Section/SectionAccordion.vue.js.map +1 -0
- package/dist/components/Section/SectionAccordion.vue.script.js +60 -0
- package/dist/components/Section/SectionAccordion.vue.script.js.map +1 -0
- package/dist/components/Section/SectionColumn.vue.js +14 -0
- package/dist/components/Section/SectionColumn.vue.js.map +1 -0
- package/dist/components/Section/SectionColumns.vue.js +14 -0
- package/dist/components/Section/SectionColumns.vue.js.map +1 -0
- package/dist/components/Section/SectionContainer.vue.js +9 -0
- package/dist/components/Section/SectionContainer.vue.js.map +1 -0
- package/dist/components/Section/SectionContainer.vue.script.js +19 -0
- package/dist/components/Section/SectionContainer.vue.script.js.map +1 -0
- package/dist/components/Section/SectionContainerAccordion.vue.js +9 -0
- package/dist/components/Section/SectionContainerAccordion.vue.js.map +1 -0
- package/dist/components/Section/SectionContainerAccordion.vue.script.js +40 -0
- package/dist/components/Section/SectionContainerAccordion.vue.script.js.map +1 -0
- package/dist/components/Section/SectionContent.vue.js +9 -0
- package/dist/components/Section/SectionContent.vue.js.map +1 -0
- package/dist/components/Section/SectionContent.vue.script.js +23 -0
- package/dist/components/Section/SectionContent.vue.script.js.map +1 -0
- package/dist/components/Section/SectionHeader.vue.js +9 -0
- package/dist/components/Section/SectionHeader.vue.js.map +1 -0
- package/dist/components/Section/SectionHeader.vue.script.js +23 -0
- package/dist/components/Section/SectionHeader.vue.script.js.map +1 -0
- package/dist/components/Section/SectionHeaderTag.vue.js +9 -0
- package/dist/components/Section/SectionHeaderTag.vue.js.map +1 -0
- package/dist/components/Section/SectionHeaderTag.vue.script.js +18 -0
- package/dist/components/Section/SectionHeaderTag.vue.script.js.map +1 -0
- package/dist/components/Section/index.d.ts +10 -10
- package/dist/components/SectionFlare/SectionFlare.vue.js +14 -0
- package/dist/components/SectionFlare/SectionFlare.vue.js.map +1 -0
- package/dist/components/SectionFlare/index.d.ts +1 -1
- package/dist/components/ShowMoreButton.vue.js +9 -0
- package/dist/components/ShowMoreButton.vue.js.map +1 -0
- package/dist/components/ShowMoreButton.vue.script.js +22 -0
- package/dist/components/ShowMoreButton.vue.script.js.map +1 -0
- package/dist/components/index.d.ts +5 -5
- package/dist/components/index.js +20 -102
- package/dist/{urls-gPTXGgbj.js → consts/urls.js} +2 -2
- package/dist/consts/urls.js.map +1 -0
- package/dist/features/Operation/Operation.vue.js +7 -0
- package/dist/features/Operation/Operation.vue.js.map +1 -0
- package/dist/features/Operation/Operation.vue.script.js +115 -0
- package/dist/features/Operation/Operation.vue.script.js.map +1 -0
- package/dist/features/Operation/components/ContentTypeSelect.vue.js +7 -0
- package/dist/features/Operation/components/ContentTypeSelect.vue.js.map +1 -0
- package/dist/features/Operation/components/ContentTypeSelect.vue.script.js +75 -0
- package/dist/features/Operation/components/ContentTypeSelect.vue.script.js.map +1 -0
- package/dist/features/Operation/components/Header.vue.js +7 -0
- package/dist/features/Operation/components/Header.vue.js.map +1 -0
- package/dist/features/Operation/components/Header.vue.script.js +42 -0
- package/dist/features/Operation/components/Header.vue.script.js.map +1 -0
- package/dist/features/Operation/components/Headers.vue.js +9 -0
- package/dist/features/Operation/components/Headers.vue.js.map +1 -0
- package/dist/features/Operation/components/Headers.vue.script.js +58 -0
- package/dist/features/Operation/components/Headers.vue.script.js.map +1 -0
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +7 -0
- package/dist/features/Operation/components/OperationParameters.vue.js.map +1 -0
- package/dist/features/Operation/components/OperationParameters.vue.script.js +108 -0
- package/dist/features/Operation/components/OperationParameters.vue.script.js.map +1 -0
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.js +7 -0
- package/dist/features/Operation/components/OperationResponses.vue.js.map +1 -0
- package/dist/features/Operation/components/OperationResponses.vue.script.js +48 -0
- package/dist/features/Operation/components/OperationResponses.vue.script.js.map +1 -0
- package/dist/features/Operation/components/ParameterList.vue.d.ts +1 -1
- package/dist/features/Operation/components/ParameterList.vue.js +7 -0
- package/dist/features/Operation/components/ParameterList.vue.js.map +1 -0
- package/dist/features/Operation/components/ParameterList.vue.script.js +53 -0
- package/dist/features/Operation/components/ParameterList.vue.script.js.map +1 -0
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +9 -0
- package/dist/features/Operation/components/ParameterListItem.vue.js.map +1 -0
- package/dist/features/Operation/components/ParameterListItem.vue.script.js +161 -0
- package/dist/features/Operation/components/ParameterListItem.vue.script.js.map +1 -0
- package/dist/features/Operation/components/RequestBody.vue.js +9 -0
- package/dist/features/Operation/components/RequestBody.vue.js.map +1 -0
- package/dist/features/Operation/components/RequestBody.vue.script.js +154 -0
- package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +9 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.js.map +1 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.script.js +62 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.script.js.map +1 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js +7 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js.map +1 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js +67 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js.map +1 -0
- package/dist/features/Operation/helpers/filter-selected-security.js +30 -0
- package/dist/features/Operation/helpers/filter-selected-security.js.map +1 -0
- package/dist/features/Operation/helpers/get-first-server.js +27 -0
- package/dist/features/Operation/helpers/get-first-server.js.map +1 -0
- package/dist/features/Operation/index.d.ts +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +9 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue.js.map +1 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +243 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +9 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.js.map +1 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.script.js +243 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -0
- package/dist/features/Search/components/SearchButton.vue.js +7 -0
- package/dist/features/Search/components/SearchButton.vue.js.map +1 -0
- package/dist/features/Search/components/SearchButton.vue.script.js +77 -0
- package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -0
- package/dist/features/Search/components/SearchModal.vue.js +9 -0
- package/dist/features/Search/components/SearchModal.vue.js.map +1 -0
- package/dist/features/Search/components/SearchModal.vue.script.js +115 -0
- package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -0
- package/dist/features/Search/components/SearchResult.vue.js +7 -0
- package/dist/features/Search/components/SearchResult.vue.js.map +1 -0
- package/dist/features/Search/components/SearchResult.vue.script.js +69 -0
- package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -0
- package/dist/features/Search/helpers/create-fuse-instance.js +52 -0
- package/dist/features/Search/helpers/create-fuse-instance.js.map +1 -0
- package/dist/features/Search/helpers/create-search-index.js +127 -0
- package/dist/features/Search/helpers/create-search-index.js.map +1 -0
- package/dist/features/Search/hooks/useSearchIndex.js +31 -0
- package/dist/features/Search/hooks/useSearchIndex.js.map +1 -0
- package/dist/features/Search/index.d.ts +2 -2
- package/dist/features/Search/types.d.ts +1 -1
- package/dist/features/ask-agent-button/AskAgentButton.vue.js +9 -0
- package/dist/features/ask-agent-button/AskAgentButton.vue.js.map +1 -0
- package/dist/features/ask-agent-button/AskAgentButton.vue.script.js +49 -0
- package/dist/features/ask-agent-button/AskAgentButton.vue.script.js.map +1 -0
- package/dist/features/developer-tools/DeveloperTools.vue.js +7 -0
- package/dist/features/developer-tools/DeveloperTools.vue.js.map +1 -0
- package/dist/features/developer-tools/DeveloperTools.vue.script.js +49 -0
- package/dist/features/developer-tools/DeveloperTools.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js +13 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js +38 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js +112 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js +60 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js +35 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js +68 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js +80 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js +66 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js +44 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/DeployApiReference.vue.js +7 -0
- package/dist/features/developer-tools/components/DeployApiReference.vue.js.map +1 -0
- package/dist/features/developer-tools/components/DeployApiReference.vue.script.js +26 -0
- package/dist/features/developer-tools/components/DeployApiReference.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.js +7 -0
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js +86 -0
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ShareApiReference.vue.js +7 -0
- package/dist/features/developer-tools/components/ShareApiReference.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ShareApiReference.vue.script.js +26 -0
- package/dist/features/developer-tools/components/ShareApiReference.vue.script.js.map +1 -0
- package/dist/features/developer-tools/index.d.ts +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +9 -0
- package/dist/features/example-responses/ExampleResponse.vue.js.map +1 -0
- package/dist/features/example-responses/ExampleResponse.vue.script.js +56 -0
- package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -0
- package/dist/features/example-responses/ExampleResponseTab.vue.js +9 -0
- package/dist/features/example-responses/ExampleResponseTab.vue.js.map +1 -0
- package/dist/features/example-responses/ExampleResponseTab.vue.script.js +21 -0
- package/dist/features/example-responses/ExampleResponseTab.vue.script.js.map +1 -0
- package/dist/features/example-responses/ExampleResponseTabList.vue.js +9 -0
- package/dist/features/example-responses/ExampleResponseTabList.vue.js.map +1 -0
- package/dist/features/example-responses/ExampleResponseTabList.vue.script.js +31 -0
- package/dist/features/example-responses/ExampleResponseTabList.vue.script.js.map +1 -0
- package/dist/features/example-responses/ExampleResponses.vue.js +9 -0
- package/dist/features/example-responses/ExampleResponses.vue.js.map +1 -0
- package/dist/features/example-responses/ExampleResponses.vue.script.js +157 -0
- package/dist/features/example-responses/ExampleResponses.vue.script.js.map +1 -0
- package/dist/features/example-responses/ExampleSchema.vue.js +7 -0
- package/dist/features/example-responses/ExampleSchema.vue.js.map +1 -0
- package/dist/features/example-responses/ExampleSchema.vue.script.js +42 -0
- package/dist/features/example-responses/ExampleSchema.vue.script.js.map +1 -0
- package/dist/features/example-responses/has-response-content.js +37 -0
- package/dist/features/example-responses/has-response-content.js.map +1 -0
- package/dist/features/example-responses/index.d.ts +1 -1
- package/dist/features/external-docs/ExternalDocs.vue.js +7 -0
- package/dist/features/external-docs/ExternalDocs.vue.js.map +1 -0
- package/dist/features/external-docs/ExternalDocs.vue.script.js +37 -0
- package/dist/features/external-docs/ExternalDocs.vue.script.js.map +1 -0
- package/dist/features/external-docs/index.d.ts +1 -1
- package/dist/features/index.d.ts +2 -2
- package/dist/features/index.js +4 -3
- package/dist/features/info-object/Contact.vue.js +7 -0
- package/dist/features/info-object/Contact.vue.js.map +1 -0
- package/dist/features/info-object/Contact.vue.script.js +37 -0
- package/dist/features/info-object/Contact.vue.script.js.map +1 -0
- package/dist/features/info-object/License.vue.js +7 -0
- package/dist/features/info-object/License.vue.js.map +1 -0
- package/dist/features/info-object/License.vue.script.js +32 -0
- package/dist/features/info-object/License.vue.script.js.map +1 -0
- package/dist/features/info-object/TermsOfService.vue.js +7 -0
- package/dist/features/info-object/TermsOfService.vue.js.map +1 -0
- package/dist/features/info-object/TermsOfService.vue.script.js +29 -0
- package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -0
- package/dist/features/info-object/index.d.ts +3 -3
- package/dist/features/multiple-documents/DocumentSelector.vue.js +7 -0
- package/dist/features/multiple-documents/DocumentSelector.vue.js.map +1 -0
- package/dist/features/multiple-documents/DocumentSelector.vue.script.js +48 -0
- package/dist/features/multiple-documents/DocumentSelector.vue.script.js.map +1 -0
- package/dist/features/specification-extension/SpecificationExtension.vue.js +7 -0
- package/dist/features/specification-extension/SpecificationExtension.vue.js.map +1 -0
- package/dist/features/specification-extension/SpecificationExtension.vue.script.js +56 -0
- package/dist/features/specification-extension/SpecificationExtension.vue.script.js.map +1 -0
- package/dist/features/specification-extension/helpers.js +15 -0
- package/dist/features/specification-extension/helpers.js.map +1 -0
- package/dist/features/specification-extension/index.d.ts +2 -2
- package/dist/features/test-request-button/TestRequestButton.vue.js +9 -0
- package/dist/features/test-request-button/TestRequestButton.vue.js.map +1 -0
- package/dist/features/test-request-button/TestRequestButton.vue.script.js +47 -0
- package/dist/features/test-request-button/TestRequestButton.vue.script.js.map +1 -0
- package/dist/features/test-request-button/index.d.ts +1 -1
- package/dist/features/x-badges/XBadges.vue.js +7 -0
- package/dist/features/x-badges/XBadges.vue.js.map +1 -0
- package/dist/features/x-badges/XBadges.vue.script.js +31 -0
- package/dist/features/x-badges/XBadges.vue.script.js.map +1 -0
- package/dist/features/x-badges/index.d.ts +1 -1
- package/dist/helpers/color-mode.js +15 -0
- package/dist/helpers/color-mode.js.map +1 -0
- package/dist/helpers/download.js +77 -0
- package/dist/helpers/download.js.map +1 -0
- package/dist/helpers/id-routing.js +107 -0
- package/dist/helpers/id-routing.js.map +1 -0
- package/dist/helpers/index.d.ts +8 -8
- package/dist/helpers/index.js +8 -2
- package/dist/{lazy-bus-CV8Ox5hD.js → helpers/lazy-bus.js} +3 -106
- package/dist/helpers/lazy-bus.js.map +1 -0
- package/dist/helpers/load-from-perssistance.js +23 -0
- package/dist/helpers/load-from-perssistance.js.map +1 -0
- package/dist/helpers/map-config-plugins.js +44 -0
- package/dist/helpers/map-config-plugins.js.map +1 -0
- package/dist/helpers/map-config-to-workspace-store.js +24 -0
- package/dist/helpers/map-config-to-workspace-store.js.map +1 -0
- package/dist/helpers/normalize-configurations.js +66 -0
- package/dist/helpers/normalize-configurations.js.map +1 -0
- package/dist/helpers/openapi.js +132 -0
- package/dist/helpers/openapi.js.map +1 -0
- package/dist/{storage--3JuzjCI.js → helpers/storage.js} +2 -2
- package/dist/helpers/storage.js.map +1 -0
- package/dist/helpers/upload-temp-document.js +24 -0
- package/dist/helpers/upload-temp-document.js.map +1 -0
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +2 -2
- package/dist/{use-agent-Bnm1de0n.js → hooks/use-agent.js} +2 -2
- package/dist/hooks/use-agent.js.map +1 -0
- package/dist/{use-intersection-8QqPi2O-.js → hooks/use-intersection.js} +2 -2
- package/dist/hooks/use-intersection.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -6
- package/dist/plugins/hooks/usePluginManager.d.ts +1 -1
- package/dist/plugins/hooks/usePluginManager.js +16 -0
- package/dist/plugins/hooks/usePluginManager.js.map +1 -0
- package/dist/plugins/index.d.ts +3 -3
- package/dist/plugins/index.js +3 -1
- package/dist/plugins/persistance-plugin.js +39 -0
- package/dist/plugins/persistance-plugin.js.map +1 -0
- package/dist/plugins/plugin-manager.js +32 -0
- package/dist/plugins/plugin-manager.js.map +1 -0
- package/dist/ssr.js +6 -6
- package/dist/standalone/lib/html-api.js +73 -0
- package/dist/standalone/lib/html-api.js.map +1 -0
- package/dist/style.css +7878 -6432
- package/package.json +11 -11
- package/dist/AgentScalarChatInterface-MUbtSqMw.js.map +0 -1
- package/dist/ExternalDocs-phu7GxpZ.js +0 -272
- package/dist/ExternalDocs-phu7GxpZ.js.map +0 -1
- package/dist/MobileHeader-DAm6yQX0.js +0 -1373
- package/dist/MobileHeader-DAm6yQX0.js.map +0 -1
- package/dist/Operation-CvpVIkc3.js +0 -3829
- package/dist/Operation-CvpVIkc3.js.map +0 -1
- package/dist/SearchButton-xzhIpMCZ.js +0 -621
- package/dist/SearchButton-xzhIpMCZ.js.map +0 -1
- package/dist/ServerSelector-5y29y2BJ.js +0 -852
- package/dist/ServerSelector-5y29y2BJ.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/lazy-bus-CV8Ox5hD.js.map +0 -1
- package/dist/normalize-configurations-DcVpOEjD.js +0 -232
- package/dist/normalize-configurations-DcVpOEjD.js.map +0 -1
- package/dist/plugins-4EyiUD_A.js +0 -80
- package/dist/plugins-4EyiUD_A.js.map +0 -1
- package/dist/src-DJwsRvMU.js +0 -1686
- package/dist/src-DJwsRvMU.js.map +0 -1
- package/dist/storage--3JuzjCI.js.map +0 -1
- package/dist/urls-gPTXGgbj.js.map +0 -1
- package/dist/use-agent-Bnm1de0n.js.map +0 -1
- package/dist/use-intersection-8QqPi2O-.js.map +0 -1
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import SectionContainer_default from "../../Section/SectionContainer.vue.js";
|
|
2
|
+
import Model_default from "../Models/Model.vue.js";
|
|
3
|
+
import ModelTag_default from "../Models/ModelTag.vue.js";
|
|
4
|
+
import Tag_default from "../Tags/Tag.vue.js";
|
|
5
|
+
import Lazy_default from "../../Lazy/Lazy.vue.js";
|
|
6
|
+
import Operation_default from "../../../features/Operation/Operation.vue.js";
|
|
7
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, openBlock, renderList, resolveComponent, unref, withCtx } from "vue";
|
|
8
|
+
import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
9
|
+
//#region src/components/Content/Operations/TraversedEntry.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var TraversedEntry_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
11
|
+
__name: "TraversedEntry",
|
|
12
|
+
props: {
|
|
13
|
+
authStore: {},
|
|
14
|
+
level: { default: 0 },
|
|
15
|
+
entries: {},
|
|
16
|
+
document: {},
|
|
17
|
+
clientOptions: {},
|
|
18
|
+
options: {},
|
|
19
|
+
selectedServer: {},
|
|
20
|
+
securitySchemes: {},
|
|
21
|
+
selectedClient: {},
|
|
22
|
+
expandedItems: {},
|
|
23
|
+
eventBus: {}
|
|
24
|
+
},
|
|
25
|
+
setup(__props) {
|
|
26
|
+
/**
|
|
27
|
+
* Type guards for different entry types
|
|
28
|
+
*/
|
|
29
|
+
const isTagGroup = (entry) => entry["type"] === "tag" && entry.isGroup === true;
|
|
30
|
+
const isTag = (entry) => entry["type"] === "tag" && !isTagGroup(entry) && entry.id !== "models";
|
|
31
|
+
const isOperation = (entry) => entry["type"] === "operation";
|
|
32
|
+
const isWebhook = (entry) => entry["type"] === "webhook";
|
|
33
|
+
/** Models are special form of tag entry */
|
|
34
|
+
const isModelsTag = (entry) => entry["type"] === "models";
|
|
35
|
+
const isModel = (entry) => entry["type"] === "model";
|
|
36
|
+
function getPathValue(entry) {
|
|
37
|
+
return isWebhook(entry) ? __props.document.webhooks?.[entry.name] : __props.document.paths?.[entry.path];
|
|
38
|
+
}
|
|
39
|
+
return (_ctx, _cache) => {
|
|
40
|
+
const _component_TraversedEntry = resolveComponent("TraversedEntry", true);
|
|
41
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(__props.entries, (entry) => {
|
|
42
|
+
return openBlock(), createBlock(Lazy_default, {
|
|
43
|
+
id: entry.id,
|
|
44
|
+
key: `${entry.id}-${__props.options.layout}`,
|
|
45
|
+
expanded: !!__props.expandedItems[entry.id]
|
|
46
|
+
}, {
|
|
47
|
+
default: withCtx(() => [isOperation(entry) || isWebhook(entry) ? (openBlock(), createBlock(unref(SectionContainer_default), {
|
|
48
|
+
key: 0,
|
|
49
|
+
omit: __props.level !== 0
|
|
50
|
+
}, {
|
|
51
|
+
default: withCtx(() => [createVNode(unref(Operation_default), {
|
|
52
|
+
id: entry.id,
|
|
53
|
+
authStore: __props.authStore,
|
|
54
|
+
clientOptions: __props.clientOptions,
|
|
55
|
+
document: __props.document,
|
|
56
|
+
eventBus: __props.eventBus,
|
|
57
|
+
isCollapsed: !__props.expandedItems[entry.id],
|
|
58
|
+
isWebhook: isWebhook(entry),
|
|
59
|
+
method: entry.method,
|
|
60
|
+
options: __props.options,
|
|
61
|
+
path: isWebhook(entry) ? entry.name : entry.path,
|
|
62
|
+
pathValue: getPathValue(entry),
|
|
63
|
+
securitySchemes: __props.securitySchemes,
|
|
64
|
+
selectedClient: __props.selectedClient,
|
|
65
|
+
server: __props.selectedServer
|
|
66
|
+
}, null, 8, [
|
|
67
|
+
"id",
|
|
68
|
+
"authStore",
|
|
69
|
+
"clientOptions",
|
|
70
|
+
"document",
|
|
71
|
+
"eventBus",
|
|
72
|
+
"isCollapsed",
|
|
73
|
+
"isWebhook",
|
|
74
|
+
"method",
|
|
75
|
+
"options",
|
|
76
|
+
"path",
|
|
77
|
+
"pathValue",
|
|
78
|
+
"securitySchemes",
|
|
79
|
+
"selectedClient",
|
|
80
|
+
"server"
|
|
81
|
+
])]),
|
|
82
|
+
_: 2
|
|
83
|
+
}, 1032, ["omit"])) : isTag(entry) ? (openBlock(), createBlock(unref(Tag_default), {
|
|
84
|
+
key: 1,
|
|
85
|
+
eventBus: __props.eventBus,
|
|
86
|
+
isCollapsed: !__props.expandedItems[entry.id],
|
|
87
|
+
isLoading: false,
|
|
88
|
+
layout: __props.options.layout,
|
|
89
|
+
moreThanOneTag: __props.entries.filter(isTag).length > 1,
|
|
90
|
+
tag: entry
|
|
91
|
+
}, {
|
|
92
|
+
default: withCtx(() => ["children" in entry && entry.children?.length ? (openBlock(), createBlock(_component_TraversedEntry, {
|
|
93
|
+
key: 0,
|
|
94
|
+
authStore: __props.authStore,
|
|
95
|
+
clientOptions: __props.clientOptions,
|
|
96
|
+
document: __props.document,
|
|
97
|
+
entries: entry.children,
|
|
98
|
+
eventBus: __props.eventBus,
|
|
99
|
+
expandedItems: __props.expandedItems,
|
|
100
|
+
level: __props.level + 1,
|
|
101
|
+
options: __props.options,
|
|
102
|
+
securitySchemes: __props.securitySchemes,
|
|
103
|
+
selectedClient: __props.selectedClient,
|
|
104
|
+
selectedServer: __props.selectedServer
|
|
105
|
+
}, null, 8, [
|
|
106
|
+
"authStore",
|
|
107
|
+
"clientOptions",
|
|
108
|
+
"document",
|
|
109
|
+
"entries",
|
|
110
|
+
"eventBus",
|
|
111
|
+
"expandedItems",
|
|
112
|
+
"level",
|
|
113
|
+
"options",
|
|
114
|
+
"securitySchemes",
|
|
115
|
+
"selectedClient",
|
|
116
|
+
"selectedServer"
|
|
117
|
+
])) : createCommentVNode("", true)]),
|
|
118
|
+
_: 2
|
|
119
|
+
}, 1032, [
|
|
120
|
+
"eventBus",
|
|
121
|
+
"isCollapsed",
|
|
122
|
+
"layout",
|
|
123
|
+
"moreThanOneTag",
|
|
124
|
+
"tag"
|
|
125
|
+
])) : isTagGroup(entry) ? (openBlock(), createBlock(_component_TraversedEntry, {
|
|
126
|
+
key: 2,
|
|
127
|
+
authStore: __props.authStore,
|
|
128
|
+
clientOptions: __props.clientOptions,
|
|
129
|
+
document: __props.document,
|
|
130
|
+
entries: entry.children || [],
|
|
131
|
+
eventBus: __props.eventBus,
|
|
132
|
+
expandedItems: __props.expandedItems,
|
|
133
|
+
level: __props.level + 1,
|
|
134
|
+
options: __props.options,
|
|
135
|
+
securitySchemes: __props.securitySchemes,
|
|
136
|
+
selectedClient: __props.selectedClient,
|
|
137
|
+
selectedServer: __props.selectedServer
|
|
138
|
+
}, null, 8, [
|
|
139
|
+
"authStore",
|
|
140
|
+
"clientOptions",
|
|
141
|
+
"document",
|
|
142
|
+
"entries",
|
|
143
|
+
"eventBus",
|
|
144
|
+
"expandedItems",
|
|
145
|
+
"level",
|
|
146
|
+
"options",
|
|
147
|
+
"securitySchemes",
|
|
148
|
+
"selectedClient",
|
|
149
|
+
"selectedServer"
|
|
150
|
+
])) : isModelsTag(entry) && __props.document.components?.schemas ? (openBlock(), createBlock(ModelTag_default, {
|
|
151
|
+
key: 3,
|
|
152
|
+
id: entry.id,
|
|
153
|
+
eventBus: __props.eventBus,
|
|
154
|
+
isCollapsed: !__props.expandedItems[entry.id],
|
|
155
|
+
layout: __props.options.layout
|
|
156
|
+
}, {
|
|
157
|
+
default: withCtx(() => [createVNode(_component_TraversedEntry, {
|
|
158
|
+
authStore: __props.authStore,
|
|
159
|
+
clientOptions: __props.clientOptions,
|
|
160
|
+
document: __props.document,
|
|
161
|
+
entries: entry.children || [],
|
|
162
|
+
eventBus: __props.eventBus,
|
|
163
|
+
expandedItems: __props.expandedItems,
|
|
164
|
+
level: __props.level + 1,
|
|
165
|
+
options: __props.options,
|
|
166
|
+
securitySchemes: __props.securitySchemes,
|
|
167
|
+
selectedClient: __props.selectedClient,
|
|
168
|
+
selectedServer: __props.selectedServer
|
|
169
|
+
}, null, 8, [
|
|
170
|
+
"authStore",
|
|
171
|
+
"clientOptions",
|
|
172
|
+
"document",
|
|
173
|
+
"entries",
|
|
174
|
+
"eventBus",
|
|
175
|
+
"expandedItems",
|
|
176
|
+
"level",
|
|
177
|
+
"options",
|
|
178
|
+
"securitySchemes",
|
|
179
|
+
"selectedClient",
|
|
180
|
+
"selectedServer"
|
|
181
|
+
])]),
|
|
182
|
+
_: 2
|
|
183
|
+
}, 1032, [
|
|
184
|
+
"id",
|
|
185
|
+
"eventBus",
|
|
186
|
+
"isCollapsed",
|
|
187
|
+
"layout"
|
|
188
|
+
])) : isModel(entry) && __props.document.components?.schemas?.[entry.name] ? (openBlock(), createBlock(Model_default, {
|
|
189
|
+
key: 4,
|
|
190
|
+
id: entry.id,
|
|
191
|
+
eventBus: __props.eventBus,
|
|
192
|
+
isCollapsed: !__props.expandedItems[entry.id],
|
|
193
|
+
name: entry.name,
|
|
194
|
+
options: __props.options,
|
|
195
|
+
schema: unref(getResolvedRef)(__props.document.components.schemas[entry.name])
|
|
196
|
+
}, null, 8, [
|
|
197
|
+
"id",
|
|
198
|
+
"eventBus",
|
|
199
|
+
"isCollapsed",
|
|
200
|
+
"name",
|
|
201
|
+
"options",
|
|
202
|
+
"schema"
|
|
203
|
+
])) : createCommentVNode("", true)]),
|
|
204
|
+
_: 2
|
|
205
|
+
}, 1032, ["id", "expanded"]);
|
|
206
|
+
}), 128);
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
//#endregion
|
|
211
|
+
export { TraversedEntry_vue_vue_type_script_setup_true_lang_default as default };
|
|
212
|
+
|
|
213
|
+
//# sourceMappingURL=TraversedEntry.vue.script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TraversedEntry.vue.script.js","names":[],"sources":["../../../../src/components/Content/Operations/TraversedEntry.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ClientOptionGroup } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { MergedSecuritySchemes } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas'\nimport type {\n TraversedEntry,\n TraversedModels,\n TraversedOperation,\n TraversedSchema,\n TraversedTag,\n TraversedWebhook,\n} from '@scalar/workspace-store/schemas/navigation'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport Model from '@/components/Content/Models/Model.vue'\nimport ModelTag from '@/components/Content/Models/ModelTag.vue'\nimport { Tag } from '@/components/Content/Tags'\nimport Lazy from '@/components/Lazy/Lazy.vue'\nimport { SectionContainer } from '@/components/Section'\nimport { Operation } from '@/features/Operation'\n\nconst {\n level = 0,\n clientOptions,\n document,\n authStore,\n entries,\n} = defineProps<{\n /** The auth store */\n authStore: AuthStore\n /** The level of depth */\n level?: number\n /** Traversed entries to render */\n entries: TraversedEntry[]\n /** The document object */\n document: WorkspaceDocument\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n >\n /** Currently selected server for the document */\n selectedServer: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** Currently selected http client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Used to determine if an entry is collapsed */\n expandedItems: Record<string, boolean>\n /** The event bus for the handling all events. */\n eventBus: WorkspaceEventBus\n}>()\n\n/**\n * Type guards for different entry types\n */\nconst isTagGroup = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: true } =>\n entry['type'] === 'tag' && entry.isGroup === true\n\nconst isTag = (\n entry: TraversedEntry,\n): entry is TraversedTag & { isGroup: false } =>\n entry['type'] === 'tag' && !isTagGroup(entry) && entry.id !== 'models'\n\nconst isOperation = (entry: TraversedEntry): entry is TraversedOperation =>\n entry['type'] === 'operation'\n\nconst isWebhook = (entry: TraversedEntry): entry is TraversedWebhook =>\n entry['type'] === 'webhook'\n\n/** Models are special form of tag entry */\nconst isModelsTag = (entry: TraversedEntry): entry is TraversedModels =>\n entry['type'] === 'models'\n\nconst isModel = (entry: TraversedEntry): entry is TraversedSchema =>\n entry['type'] === 'model'\n\nfunction getPathValue(entry: TraversedOperation | TraversedWebhook) {\n return isWebhook(entry)\n ? document.webhooks?.[entry.name]\n : document.paths?.[entry.path]\n}\n</script>\n\n<template>\n <!-- The key must be joined with the layout to force a re-render when the layout changes -->\n <!-- Without this we get a timing issue where the lazy bus is reset and the element is not rendered -->\n <Lazy\n v-for=\"entry in entries\"\n :id=\"entry.id\"\n :key=\"`${entry.id}-${options.layout}`\"\n :expanded=\"!!expandedItems[entry.id]\">\n <!-- Operation or Webhook -->\n <SectionContainer\n v-if=\"isOperation(entry) || isWebhook(entry)\"\n :omit=\"level !== 0\">\n <Operation\n :id=\"entry.id\"\n :authStore\n :clientOptions\n :document\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isWebhook=\"isWebhook(entry)\"\n :method=\"entry.method\"\n :options=\"options\"\n :path=\"isWebhook(entry) ? entry.name : entry.path\"\n :pathValue=\"getPathValue(entry)\"\n :securitySchemes=\"securitySchemes\"\n :selectedClient=\"selectedClient\"\n :server=\"selectedServer\" />\n </SectionContainer>\n\n <!-- Webhook Group or Tag -->\n <Tag\n v-else-if=\"isTag(entry)\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :isLoading=\"false\"\n :layout=\"options.layout\"\n :moreThanOneTag=\"entries.filter(isTag).length > 1\"\n :tag=\"entry\">\n <template v-if=\"'children' in entry && entry.children?.length\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </template>\n </Tag>\n\n <!-- Tag Group -->\n <TraversedEntry\n v-else-if=\"isTagGroup(entry)\"\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n\n <!-- Models -->\n <ModelTag\n v-else-if=\"isModelsTag(entry) && document.components?.schemas\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :layout=\"options.layout\">\n <TraversedEntry\n :authStore\n :clientOptions\n :document\n :entries=\"entry.children || []\"\n :eventBus\n :expandedItems=\"expandedItems\"\n :level=\"level + 1\"\n :options\n :securitySchemes\n :selectedClient\n :selectedServer>\n </TraversedEntry>\n </ModelTag>\n\n <Model\n v-else-if=\"isModel(entry) && document.components?.schemas?.[entry.name]\"\n :id=\"entry.id\"\n :eventBus\n :isCollapsed=\"!expandedItems[entry.id]\"\n :name=\"entry.name\"\n :options\n :schema=\"getResolvedRef(document.components.schemas[entry.name])\">\n </Model>\n </Lazy>\n</template>\n"],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import RenderString_vue_vue_type_script_setup_true_lang_default from "./RenderString.vue.script.js";
|
|
2
|
+
//#region src/components/Content/Schema/RenderString.vue
|
|
3
|
+
var RenderString_default = RenderString_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { RenderString_default as default };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=RenderString.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderString.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/RenderString.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Give this component any data, and it tries to render a meaningful string.\n *\n * @example\n * <RenderString :value=\"1\" /> => \"1\"\n * <RenderString :value=\"true\" /> => \"true\"\n * <RenderString :value=\"false\" /> => \"false\"\n * <RenderString :value=\"null\" /> => \"null\"\n * <RenderString :value=\"undefined\" /> => \"undefined\"\n * <RenderString :value=\"{}\" /> => \"{}\"\n * <RenderString :value=\"[]\" /> => \"[]\"\n * <RenderString :value=\"['a', 'b', 'c']\" /> => \"['a', 'b', 'c']\"\n * <RenderString :value=\"() => 'hello'\" /> => \"() => 'hello'\"\n * <RenderString :value=\"Symbol('test')\" /> => \"Symbol(test)\"\n **/\nimport { computed } from 'vue'\n\nconst { value } = defineProps<{\n value: any\n}>()\n\nconst valueAsString = computed(() => {\n if (value === '') {\n return `''`\n }\n\n if (value === null) {\n return 'null'\n }\n\n if (value === undefined) {\n return 'undefined'\n }\n\n // We don't need to cover all cases, Vue does a good job of rendering objects, arrays and functions.\n return value\n})\n</script>\n\n<template>\n {{ valueAsString }}\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { computed, defineComponent, toDisplayString } from "vue";
|
|
2
|
+
//#region src/components/Content/Schema/RenderString.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var RenderString_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "RenderString",
|
|
5
|
+
props: { value: {} },
|
|
6
|
+
setup(__props) {
|
|
7
|
+
/**
|
|
8
|
+
* Give this component any data, and it tries to render a meaningful string.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <RenderString :value="1" /> => "1"
|
|
12
|
+
* <RenderString :value="true" /> => "true"
|
|
13
|
+
* <RenderString :value="false" /> => "false"
|
|
14
|
+
* <RenderString :value="null" /> => "null"
|
|
15
|
+
* <RenderString :value="undefined" /> => "undefined"
|
|
16
|
+
* <RenderString :value="{}" /> => "{}"
|
|
17
|
+
* <RenderString :value="[]" /> => "[]"
|
|
18
|
+
* <RenderString :value="['a', 'b', 'c']" /> => "['a', 'b', 'c']"
|
|
19
|
+
* <RenderString :value="() => 'hello'" /> => "() => 'hello'"
|
|
20
|
+
* <RenderString :value="Symbol('test')" /> => "Symbol(test)"
|
|
21
|
+
**/
|
|
22
|
+
const valueAsString = computed(() => {
|
|
23
|
+
if (__props.value === "") return `''`;
|
|
24
|
+
if (__props.value === null) return "null";
|
|
25
|
+
if (__props.value === void 0) return "undefined";
|
|
26
|
+
return __props.value;
|
|
27
|
+
});
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return toDisplayString(valueAsString.value);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
//#endregion
|
|
34
|
+
export { RenderString_vue_vue_type_script_setup_true_lang_default as default };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=RenderString.vue.script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderString.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/RenderString.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Give this component any data, and it tries to render a meaningful string.\n *\n * @example\n * <RenderString :value=\"1\" /> => \"1\"\n * <RenderString :value=\"true\" /> => \"true\"\n * <RenderString :value=\"false\" /> => \"false\"\n * <RenderString :value=\"null\" /> => \"null\"\n * <RenderString :value=\"undefined\" /> => \"undefined\"\n * <RenderString :value=\"{}\" /> => \"{}\"\n * <RenderString :value=\"[]\" /> => \"[]\"\n * <RenderString :value=\"['a', 'b', 'c']\" /> => \"['a', 'b', 'c']\"\n * <RenderString :value=\"() => 'hello'\" /> => \"() => 'hello'\"\n * <RenderString :value=\"Symbol('test')\" /> => \"Symbol(test)\"\n **/\nimport { computed } from 'vue'\n\nconst { value } = defineProps<{\n value: any\n}>()\n\nconst valueAsString = computed(() => {\n if (value === '') {\n return `''`\n }\n\n if (value === null) {\n return 'null'\n }\n\n if (value === undefined) {\n return 'undefined'\n }\n\n // We don't need to cover all cases, Vue does a good job of rendering objects, arrays and functions.\n return value\n})\n</script>\n\n<template>\n {{ valueAsString }}\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAsBA,MAAM,gBAAgB,eAAe;AACnC,OAAI,QAAA,UAAU,GACZ,QAAO;AAGT,OAAI,QAAA,UAAU,KACZ,QAAO;AAGT,OAAI,QAAA,UAAU,KAAA,EACZ,QAAO;AAIT,UAAO,QAAA;IACR;;0BAII,cAAA,MAAa"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import Schema_vue_vue_type_script_setup_true_lang_default from "./Schema.vue.script.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/Content/Schema/Schema.vue
|
|
5
|
+
var Schema_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Schema_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-d9bd8110"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Schema_default as default };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=Schema.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Schema.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon, ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n}>()\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => {\n return !noncollapsible && level > 0\n})\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n // For the request body we want to show the base description or the first allOf schema description\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return schema.description || schema.allOf[0]?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description if the schema has other composition keywords\n // This prevents duplicate descriptions when individual schemas are part of compositions\n if (schema.oneOf || schema.anyOf) {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => noncollapsible && e.stopPropagation()\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"noncollapsible\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n Empty object\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n Show additional properties\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n Hide {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <template v-else>\n Show {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n line-height: 1.5;\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":""}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import ScreenReader_default from "../../ScreenReader.vue.js";
|
|
2
|
+
import { isTypeObject } from "./helpers/is-type-object.js";
|
|
3
|
+
import { isEmptySchemaObject } from "./helpers/is-empty-schema-object.js";
|
|
4
|
+
import SchemaHeading_default from "./SchemaHeading.vue.js";
|
|
5
|
+
import SchemaProperty_default from "./SchemaProperty.vue.js";
|
|
6
|
+
import SchemaObjectProperties_default from "./SchemaObjectProperties.vue.js";
|
|
7
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, toDisplayString, unref, vShow, withCtx, withDirectives } from "vue";
|
|
8
|
+
import { Disclosure, DisclosureButton, DisclosurePanel } from "@headlessui/vue";
|
|
9
|
+
import { ScalarIcon, ScalarMarkdown } from "@scalar/components";
|
|
10
|
+
//#region src/components/Content/Schema/Schema.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
+
var _hoisted_1 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "schema-card-description"
|
|
14
|
+
};
|
|
15
|
+
var _hoisted_2 = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "pt-2"
|
|
18
|
+
};
|
|
19
|
+
var _hoisted_3 = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "schema-properties"
|
|
22
|
+
};
|
|
23
|
+
var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
24
|
+
__name: "Schema",
|
|
25
|
+
props: {
|
|
26
|
+
schema: {},
|
|
27
|
+
level: { default: 0 },
|
|
28
|
+
name: {},
|
|
29
|
+
compact: { type: Boolean },
|
|
30
|
+
noncollapsible: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
hideHeading: { type: Boolean },
|
|
35
|
+
additionalProperties: { type: Boolean },
|
|
36
|
+
hideModelNames: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
discriminator: {},
|
|
41
|
+
breadcrumb: {},
|
|
42
|
+
eventBus: {},
|
|
43
|
+
options: {}
|
|
44
|
+
},
|
|
45
|
+
setup(__props) {
|
|
46
|
+
/**
|
|
47
|
+
* Determines whether to show the collapse/expand toggle button.
|
|
48
|
+
* We hide the toggle for non-collapsible schemas and root-level schemas.
|
|
49
|
+
*/
|
|
50
|
+
const shouldShowToggle = computed(() => {
|
|
51
|
+
return !__props.noncollapsible && __props.level > 0;
|
|
52
|
+
});
|
|
53
|
+
/** Gets the description to show for the schema */
|
|
54
|
+
const schemaDescription = computed(() => {
|
|
55
|
+
if (__props.schema?.allOf && __props.schema.allOf.length > 0 && __props.name === "Request Body") return __props.schema.description || __props.schema.allOf[0]?.description || null;
|
|
56
|
+
if (!__props.schema?.description || typeof __props.schema.description !== "string") return null;
|
|
57
|
+
if (__props.schema.oneOf || __props.schema.anyOf) return null;
|
|
58
|
+
if (__props.schema.enum) return null;
|
|
59
|
+
if (!("properties" in __props.schema) && !("patternProperties" in __props.schema) && !("additionalProperties" in __props.schema)) return null;
|
|
60
|
+
return __props.schema.description;
|
|
61
|
+
});
|
|
62
|
+
const handleClick = (e) => __props.noncollapsible && e.stopPropagation();
|
|
63
|
+
return (_ctx, _cache) => {
|
|
64
|
+
return typeof __props.schema === "object" && Object.keys(__props.schema).length ? (openBlock(), createBlock(unref(Disclosure), {
|
|
65
|
+
key: 0,
|
|
66
|
+
defaultOpen: __props.noncollapsible
|
|
67
|
+
}, {
|
|
68
|
+
default: withCtx(({ open }) => [createElementVNode("div", { class: normalizeClass(["schema-card", [
|
|
69
|
+
`schema-card--level-${__props.level}`,
|
|
70
|
+
{
|
|
71
|
+
"schema-card--compact": __props.compact,
|
|
72
|
+
"schema-card--open": open
|
|
73
|
+
},
|
|
74
|
+
{ "border-t": __props.additionalProperties && open }
|
|
75
|
+
]]) }, [
|
|
76
|
+
schemaDescription.value ? (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(unref(ScalarMarkdown), { value: schemaDescription.value }, null, 8, ["value"])])) : createCommentVNode("", true),
|
|
77
|
+
unref(isEmptySchemaObject)(__props.schema) ? (openBlock(), createElementBlock("div", _hoisted_2, " Empty object ")) : createCommentVNode("", true),
|
|
78
|
+
createElementVNode("div", { class: normalizeClass(["schema-properties", { "schema-properties-open": open }]) }, [__props.additionalProperties ? withDirectives((openBlock(), createElementBlock("div", _hoisted_3, [createVNode(unref(DisclosureButton), {
|
|
79
|
+
as: "button",
|
|
80
|
+
class: "schema-card-title schema-card-title--compact",
|
|
81
|
+
onClickCapture: handleClick
|
|
82
|
+
}, {
|
|
83
|
+
default: withCtx(() => [
|
|
84
|
+
createVNode(unref(ScalarIcon), {
|
|
85
|
+
class: "schema-card-title-icon",
|
|
86
|
+
icon: "Add",
|
|
87
|
+
size: "sm"
|
|
88
|
+
}),
|
|
89
|
+
_cache[0] || (_cache[0] = createTextVNode(" Show additional properties ", -1)),
|
|
90
|
+
__props.name ? (openBlock(), createBlock(ScreenReader_default, { key: 0 }, {
|
|
91
|
+
default: withCtx(() => [createTextVNode("for " + toDisplayString(__props.name), 1)]),
|
|
92
|
+
_: 1
|
|
93
|
+
})) : createCommentVNode("", true)
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
})], 512)), [[vShow, !open]]) : shouldShowToggle.value ? withDirectives((openBlock(), createBlock(unref(DisclosureButton), {
|
|
97
|
+
key: 1,
|
|
98
|
+
as: __props.noncollapsible ? "div" : "button",
|
|
99
|
+
class: normalizeClass(["schema-card-title", { "schema-card-title--compact": __props.compact }]),
|
|
100
|
+
style: normalizeStyle({ top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${__props.level}))` }),
|
|
101
|
+
onClickCapture: handleClick
|
|
102
|
+
}, {
|
|
103
|
+
default: withCtx(() => [__props.compact ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
104
|
+
createVNode(unref(ScalarIcon), {
|
|
105
|
+
class: normalizeClass(["schema-card-title-icon", { "schema-card-title-icon--open": open }]),
|
|
106
|
+
icon: "Add",
|
|
107
|
+
size: "sm"
|
|
108
|
+
}, null, 8, ["class"]),
|
|
109
|
+
open ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" Hide " + toDisplayString(__props.schema?.title ?? "Child Attributes"), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(" Show " + toDisplayString(__props.schema?.title ?? "Child Attributes"), 1)], 64)),
|
|
110
|
+
__props.name ? (openBlock(), createBlock(ScreenReader_default, { key: 2 }, {
|
|
111
|
+
default: withCtx(() => [createTextVNode("for " + toDisplayString(__props.name), 1)]),
|
|
112
|
+
_: 1
|
|
113
|
+
})) : createCommentVNode("", true)
|
|
114
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(unref(ScalarIcon), {
|
|
115
|
+
class: normalizeClass(["schema-card-title-icon", { "schema-card-title-icon--open": open }]),
|
|
116
|
+
icon: "Add",
|
|
117
|
+
size: "sm"
|
|
118
|
+
}, null, 8, ["class"]), createVNode(SchemaHeading_default, {
|
|
119
|
+
name: __props.schema?.title ?? __props.name,
|
|
120
|
+
value: __props.schema
|
|
121
|
+
}, null, 8, ["name", "value"])], 64))]),
|
|
122
|
+
_: 2
|
|
123
|
+
}, 1032, [
|
|
124
|
+
"as",
|
|
125
|
+
"class",
|
|
126
|
+
"style"
|
|
127
|
+
])), [[vShow, !__props.hideHeading && !(__props.noncollapsible && __props.compact)]]) : createCommentVNode("", true), !__props.additionalProperties || open ? (openBlock(), createBlock(unref(DisclosurePanel), {
|
|
128
|
+
key: 2,
|
|
129
|
+
as: "ul",
|
|
130
|
+
static: !shouldShowToggle.value
|
|
131
|
+
}, {
|
|
132
|
+
default: withCtx(() => [unref(isTypeObject)(__props.schema) ? (openBlock(), createBlock(SchemaObjectProperties_default, {
|
|
133
|
+
key: 0,
|
|
134
|
+
breadcrumb: __props.breadcrumb,
|
|
135
|
+
compact: __props.compact,
|
|
136
|
+
discriminator: __props.discriminator,
|
|
137
|
+
eventBus: __props.eventBus,
|
|
138
|
+
hideHeading: __props.hideHeading,
|
|
139
|
+
hideModelNames: __props.hideModelNames,
|
|
140
|
+
level: __props.level + 1,
|
|
141
|
+
options: __props.options,
|
|
142
|
+
schema: __props.schema
|
|
143
|
+
}, null, 8, [
|
|
144
|
+
"breadcrumb",
|
|
145
|
+
"compact",
|
|
146
|
+
"discriminator",
|
|
147
|
+
"eventBus",
|
|
148
|
+
"hideHeading",
|
|
149
|
+
"hideModelNames",
|
|
150
|
+
"level",
|
|
151
|
+
"options",
|
|
152
|
+
"schema"
|
|
153
|
+
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [__props.schema ? (openBlock(), createBlock(SchemaProperty_default, {
|
|
154
|
+
key: 0,
|
|
155
|
+
breadcrumb: __props.breadcrumb,
|
|
156
|
+
compact: __props.compact,
|
|
157
|
+
eventBus: __props.eventBus,
|
|
158
|
+
hideHeading: __props.hideHeading,
|
|
159
|
+
hideModelNames: __props.hideModelNames,
|
|
160
|
+
level: __props.level,
|
|
161
|
+
options: __props.options,
|
|
162
|
+
schema: __props.schema
|
|
163
|
+
}, null, 8, [
|
|
164
|
+
"breadcrumb",
|
|
165
|
+
"compact",
|
|
166
|
+
"eventBus",
|
|
167
|
+
"hideHeading",
|
|
168
|
+
"hideModelNames",
|
|
169
|
+
"level",
|
|
170
|
+
"options",
|
|
171
|
+
"schema"
|
|
172
|
+
])) : createCommentVNode("", true)], 64))]),
|
|
173
|
+
_: 1
|
|
174
|
+
}, 8, ["static"])) : createCommentVNode("", true)], 2)
|
|
175
|
+
], 2)]),
|
|
176
|
+
_: 1
|
|
177
|
+
}, 8, ["defaultOpen"])) : createCommentVNode("", true);
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
//#endregion
|
|
182
|
+
export { Schema_vue_vue_type_script_setup_true_lang_default as default };
|
|
183
|
+
|
|
184
|
+
//# sourceMappingURL=Schema.vue.script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Schema.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon, ScalarMarkdown } from '@scalar/components'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n}>()\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => {\n return !noncollapsible && level > 0\n})\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n // For the request body we want to show the base description or the first allOf schema description\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return schema.description || schema.allOf[0]?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description if the schema has other composition keywords\n // This prevents duplicate descriptions when individual schemas are part of compositions\n if (schema.oneOf || schema.anyOf) {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => noncollapsible && e.stopPropagation()\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"noncollapsible\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n Empty object\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n Show additional properties\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n Hide {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <template v-else>\n Show {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n line-height: 1.5;\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":"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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
2
|
import type { DiscriminatorObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
3
3
|
import type { SchemaOptions } from '../../../components/Content/Schema/types';
|
|
4
|
-
import { type CompositionKeyword } from './helpers/schema-composition';
|
|
4
|
+
import { type CompositionKeyword } from './helpers/schema-composition.js';
|
|
5
5
|
type __VLS_Props = {
|
|
6
6
|
/** The composition keyword (oneOf, anyOf, allOf) */
|
|
7
7
|
composition: CompositionKeyword;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import SchemaComposition_vue_vue_type_script_setup_true_lang_default from "./SchemaComposition.vue.script.js";
|
|
2
|
+
//#region src/components/Content/Schema/SchemaComposition.vue
|
|
3
|
+
var SchemaComposition_default = SchemaComposition_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { SchemaComposition_default as default };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=SchemaComposition.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaComposition.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarListbox, type ScalarListboxOption } from '@scalar/components'\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { type CompositionKeyword } from './helpers/schema-composition'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport Schema from './Schema.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** The composition keyword (oneOf, anyOf, allOf) */\n composition: CompositionKeyword\n /** Optional discriminator object for polymorphic schemas */\n discriminator?: DiscriminatorObject\n /** Optional name for the schema */\n name?: string\n /** The schema value containing the composition */\n schema: SchemaObject\n /** Nesting level for proper indentation */\n level: number\n /** Whether to use compact layout */\n compact?: boolean\n /** Whether to hide the heading */\n hideHeading?: boolean\n /** Breadcrumb for navigation */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into single prop so they are easy to pass around */\n options: SchemaOptions\n }>(),\n {\n compact: false,\n hideHeading: false,\n },\n)\n\n/** The current composition */\nconst composition = computed(() =>\n [props.schema[props.composition]]\n .flat()\n .map((schema) => ({ value: resolve.schema(schema), original: schema }))\n .filter((it) => isDefined(it.value)),\n)\n\n/**\n * Generate listbox options for the composition selector.\n * Each option represents a schema in the composition with a human-readable label.\n * Prefers schema title/name over structural type when present.\n */\nconst listboxOptions = computed((): ScalarListboxOption[] =>\n composition.value.map((schema, index: number) => {\n const resolved = resolve.schema(schema.original!)\n const label =\n (getModelNameFromSchema(resolved) ?? getSchemaType(resolved)) || 'Schema'\n return { id: String(index), label }\n }),\n)\n\n/**\n * Two-way computed property for the selected option.\n * Handles conversion between the selected index and the listbox option format.\n */\nconst selectedOption = ref<ScalarListboxOption | undefined>(\n listboxOptions.value[0],\n)\n\n/**\n * Humanize composition keyword name for display.\n * Converts camelCase to Title Case (e.g., oneOf -> One of).\n */\nconst humanizeType = (type: CompositionKeyword): string =>\n type\n .replace(/([A-Z])/g, ' $1')\n .replace(/^./, (str) => str.toUpperCase())\n .toLowerCase()\n .replace(/^(\\w)/, (c) => c.toUpperCase())\n\n/** Inside the currently selected composition */\nconst selectedComposition = computed(\n () => composition.value[Number(selectedOption.value?.id ?? '0')]?.value,\n)\n\n/** Controls whether the nested schema is displayed */\nconst showNestedSchema = ref(false)\n</script>\n\n<template>\n <div class=\"property-rule\">\n <!-- We merge allOf schemas into a single schema -->\n <Schema\n v-if=\"props.composition === 'allOf'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"mergeAllOfSchemas(schema)\" />\n\n <template v-else>\n <!-- Composition selector and panel for nested compositions -->\n <ScalarListbox\n v-model=\"selectedOption\"\n :options=\"listboxOptions\"\n resize>\n <button\n class=\"composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border px-2.5 py-2.5 pr-3 text-left\"\n type=\"button\">\n <span class=\"text-c-2\">{{ humanizeType(props.composition) }}</span>\n <span\n class=\"composition-selector-label text-c-1\"\n :class=\"{\n 'line-through': selectedComposition?.deprecated,\n }\">\n {{ selectedOption?.label || 'Schema' }}\n </span>\n <div\n v-if=\"selectedComposition?.deprecated\"\n class=\"text-red\">\n deprecated\n </div>\n <ScalarIconCaretDown />\n </button>\n </ScalarListbox>\n\n <div class=\"composition-panel\">\n <!-- Button to toggle nested schema display -->\n <button\n v-if=\"!showNestedSchema && level > 2\"\n class=\"bg-b-1 hover:bg-b-2 text-c-1 flex w-full items-center justify-center gap-2 rounded-b-lg border border-t-0 px-2 py-2 text-sm font-medium transition-colors\"\n type=\"button\"\n @click=\"showNestedSchema = true\">\n Show Schema Details\n <ScalarIconCaretDown class=\"h-3 w-3\" />\n </button>\n\n <!-- Render the selected schema if it has content to display -->\n <Schema\n v-else\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"selectedComposition\" />\n </div>\n </template>\n </div>\n</template>\n"],"mappings":""}
|