@scalar/api-reference 1.49.0 → 1.49.2
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 +14 -0
- package/dist/AgentScalarChatInterface-MUbtSqMw.js +41 -0
- package/dist/AgentScalarChatInterface-MUbtSqMw.js.map +1 -0
- package/dist/ExternalDocs-phu7GxpZ.js +272 -0
- package/dist/ExternalDocs-phu7GxpZ.js.map +1 -0
- package/dist/MobileHeader-DAm6yQX0.js +1373 -0
- package/dist/MobileHeader-DAm6yQX0.js.map +1 -0
- package/dist/Operation-CvpVIkc3.js +3829 -0
- package/dist/Operation-CvpVIkc3.js.map +1 -0
- package/dist/SearchButton-xzhIpMCZ.js +621 -0
- package/dist/SearchButton-xzhIpMCZ.js.map +1 -0
- package/dist/ServerSelector-5y29y2BJ.js +852 -0
- package/dist/ServerSelector-5y29y2BJ.js.map +1 -0
- package/dist/blocks/index.js +3 -10
- package/dist/blocks/scalar-client-selector-block/index.d.ts +1 -1
- package/dist/blocks/scalar-info-block/index.d.ts +2 -2
- package/dist/blocks/scalar-server-selector-block/index.d.ts +1 -1
- package/dist/browser/standalone.js +40799 -34683
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/AgentScalar/index.d.ts +3 -3
- package/dist/components/Anchor/index.d.ts +2 -2
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Content/Auth/index.d.ts +1 -1
- package/dist/components/Content/Models/index.d.ts +2 -2
- package/dist/components/Content/Schema/Schema.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts +1 -1
- package/dist/components/Content/Schema/index.d.ts +4 -4
- package/dist/components/Content/Tags/index.d.ts +1 -1
- package/dist/components/Content/index.d.ts +2 -2
- package/dist/components/HttpMethod/index.d.ts +1 -1
- package/dist/components/LinkList/index.d.ts +1 -1
- package/dist/components/OperationsList/index.d.ts +1 -1
- package/dist/components/RenderPlugins/index.d.ts +1 -1
- package/dist/components/Section/index.d.ts +10 -10
- package/dist/components/SectionFlare/index.d.ts +1 -1
- package/dist/components/index.d.ts +5 -5
- package/dist/components/index.js +102 -42
- package/dist/components/index.js.map +1 -0
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +1 -1
- package/dist/features/Operation/components/ParameterList.vue.d.ts +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +1 -1
- 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/ModernLayout.vue.d.ts +1 -1
- package/dist/features/Search/components/SearchResult.vue.d.ts +1 -1
- package/dist/features/Search/helpers/create-fuse-instance.d.ts +1 -1
- package/dist/features/Search/helpers/create-search-index.d.ts +1 -1
- package/dist/features/Search/index.d.ts +2 -2
- package/dist/features/Search/types.d.ts +1 -1
- package/dist/features/developer-tools/index.d.ts +1 -1
- package/dist/features/example-responses/index.d.ts +1 -1
- package/dist/features/external-docs/index.d.ts +1 -1
- package/dist/features/index.d.ts +2 -2
- package/dist/features/index.js +4 -10
- package/dist/features/info-object/index.d.ts +3 -3
- package/dist/features/specification-extension/index.d.ts +2 -2
- package/dist/features/test-request-button/index.d.ts +1 -1
- package/dist/features/x-badges/index.d.ts +1 -1
- package/dist/helpers/download.d.ts +1 -1
- package/dist/helpers/download.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +8 -8
- package/dist/helpers/index.js +3 -24
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +3 -8
- package/dist/index.d.ts +5 -5
- package/dist/index.js +7 -14
- package/dist/lazy-bus-CV8Ox5hD.js +333 -0
- package/dist/lazy-bus-CV8Ox5hD.js.map +1 -0
- package/dist/normalize-configurations-DcVpOEjD.js +232 -0
- package/dist/normalize-configurations-DcVpOEjD.js.map +1 -0
- package/dist/plugins/hooks/usePluginManager.d.ts +1 -1
- package/dist/plugins/index.d.ts +3 -3
- package/dist/plugins/index.js +2 -9
- package/dist/plugins-4EyiUD_A.js +80 -0
- package/dist/plugins-4EyiUD_A.js.map +1 -0
- package/dist/src-DJwsRvMU.js +1686 -0
- package/dist/src-DJwsRvMU.js.map +1 -0
- package/dist/ssr.d.ts +2 -2
- package/dist/ssr.js +7 -14
- package/dist/storage--3JuzjCI.js +42 -0
- package/dist/storage--3JuzjCI.js.map +1 -0
- package/dist/style.css +6714 -7276
- package/dist/urls-gPTXGgbj.js +17 -0
- package/dist/urls-gPTXGgbj.js.map +1 -0
- package/dist/use-agent-Bnm1de0n.js +60 -0
- package/dist/use-agent-Bnm1de0n.js.map +1 -0
- package/dist/use-intersection-8QqPi2O-.js +24 -0
- package/dist/use-intersection-8QqPi2O-.js.map +1 -0
- package/package.json +25 -27
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -10
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +0 -7
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +0 -123
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +0 -7
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +0 -142
- package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js +0 -24
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +0 -7
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue2.js +0 -63
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js +0 -59
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue2.js +0 -4
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +0 -7
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue2.js +0 -70
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js +0 -38
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue2.js +0 -4
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js +0 -38
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue2.js +0 -4
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.js +0 -28
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue2.js +0 -4
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js +0 -7
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue2.js +0 -19
- package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +0 -14
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +0 -7
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue2.js +0 -112
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js +0 -21
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue2.js +0 -4
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js +0 -76
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue2.js +0 -4
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +0 -72
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue2.js +0 -4
- package/dist/components/AgentScalar/AgentScalarButton.vue.js +0 -22
- package/dist/components/AgentScalar/AgentScalarButton.vue2.js +0 -4
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.js +0 -4
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue2.js +0 -29
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +0 -7
- package/dist/components/AgentScalar/AgentScalarDrawer.vue2.js +0 -78
- package/dist/components/AgentScalar/OpenMCPButton.vue.js +0 -7
- package/dist/components/AgentScalar/OpenMCPButton.vue2.js +0 -191
- package/dist/components/Anchor/Anchor.vue.js +0 -51
- package/dist/components/Anchor/Anchor.vue2.js +0 -4
- package/dist/components/Anchor/WithBreadcrumb.vue.js +0 -41
- package/dist/components/Anchor/WithBreadcrumb.vue2.js +0 -4
- package/dist/components/ApiReference.vue.js +0 -10
- package/dist/components/ApiReference.vue2.js +0 -742
- package/dist/components/Badge/Badge.vue.js +0 -7
- package/dist/components/Badge/Badge.vue2.js +0 -26
- package/dist/components/ClassicHeader.vue.js +0 -21
- package/dist/components/Content/Auth/Auth.vue.js +0 -77
- package/dist/components/Content/Auth/Auth.vue2.js +0 -4
- package/dist/components/Content/Auth/helpers/get-default-security.js +0 -55
- package/dist/components/Content/Content.vue.js +0 -171
- package/dist/components/Content/Content.vue3.js +0 -5
- package/dist/components/Content/Models/Model.vue.js +0 -47
- package/dist/components/Content/Models/Model.vue2.js +0 -4
- package/dist/components/Content/Models/ModelTag.vue.js +0 -76
- package/dist/components/Content/Models/ModelTag.vue2.js +0 -4
- package/dist/components/Content/Models/components/ClassicLayout.vue.js +0 -7
- package/dist/components/Content/Models/components/ClassicLayout.vue2.js +0 -78
- package/dist/components/Content/Models/components/ModernLayout.vue.js +0 -61
- package/dist/components/Content/Models/components/ModernLayout.vue2.js +0 -4
- package/dist/components/Content/Operations/TraversedEntry.vue.js +0 -146
- package/dist/components/Content/Operations/TraversedEntry.vue2.js +0 -4
- package/dist/components/Content/Schema/RenderString.vue.js +0 -27
- package/dist/components/Content/Schema/RenderString.vue2.js +0 -4
- package/dist/components/Content/Schema/Schema.vue.js +0 -7
- package/dist/components/Content/Schema/Schema.vue2.js +0 -193
- package/dist/components/Content/Schema/SchemaComposition.vue.js +0 -120
- package/dist/components/Content/Schema/SchemaComposition.vue2.js +0 -4
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue2.js +0 -36
- package/dist/components/Content/Schema/SchemaEnums.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaEnums.vue2.js +0 -112
- package/dist/components/Content/Schema/SchemaHeading.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaHeading.vue2.js +0 -61
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js +0 -66
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue2.js +0 -4
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +0 -120
- package/dist/components/Content/Schema/SchemaObjectProperties.vue2.js +0 -4
- package/dist/components/Content/Schema/SchemaProperty.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +0 -236
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue2.js +0 -45
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue2.js +0 -40
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +0 -80
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +0 -318
- package/dist/components/Content/Schema/helpers/format-example.js +0 -41
- package/dist/components/Content/Schema/helpers/format-value.js +0 -35
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.js +0 -31
- package/dist/components/Content/Schema/helpers/get-enum-values.js +0 -20
- package/dist/components/Content/Schema/helpers/get-property-description.js +0 -34
- package/dist/components/Content/Schema/helpers/get-ref-name.js +0 -14
- package/dist/components/Content/Schema/helpers/get-schema-type.js +0 -47
- package/dist/components/Content/Schema/helpers/has-complex-array-items.js +0 -48
- package/dist/components/Content/Schema/helpers/is-empty-schema-object.js +0 -13
- package/dist/components/Content/Schema/helpers/is-type-object.js +0 -27
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +0 -215
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +0 -64
- package/dist/components/Content/Schema/helpers/schema-composition.js +0 -4
- package/dist/components/Content/Schema/helpers/schema-name.js +0 -24
- package/dist/components/Content/Schema/helpers/should-display-description.js +0 -12
- package/dist/components/Content/Schema/helpers/should-display-heading.js +0 -12
- package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js +0 -15
- package/dist/components/Content/Schema/helpers/sort-property-names.js +0 -71
- package/dist/components/Content/Tags/Tag.vue.js +0 -46
- package/dist/components/Content/Tags/Tag.vue2.js +0 -4
- package/dist/components/Content/Tags/components/ClassicLayout.vue.js +0 -7
- package/dist/components/Content/Tags/components/ClassicLayout.vue2.js +0 -57
- package/dist/components/Content/Tags/components/ModernLayout.vue.js +0 -7
- package/dist/components/Content/Tags/components/ModernLayout.vue2.js +0 -56
- package/dist/components/Content/Tags/components/TagSection.vue.js +0 -100
- package/dist/components/Content/Tags/components/TagSection.vue2.js +0 -4
- package/dist/components/GettingStarted.vue.js +0 -7
- package/dist/components/GettingStarted.vue2.js +0 -82
- package/dist/components/HttpMethod/HttpMethod.vue.js +0 -34
- package/dist/components/HttpMethod/HttpMethod.vue2.js +0 -4
- package/dist/components/IntersectionObserver.vue.js +0 -55
- package/dist/components/IntersectionObserver.vue2.js +0 -4
- package/dist/components/Lazy/Lazy.vue.js +0 -106
- package/dist/components/Lazy/Lazy.vue2.js +0 -4
- package/dist/components/LinkList/LinkList.vue.js +0 -7
- package/dist/components/LinkList/LinkList.vue2.js +0 -48
- package/dist/components/LoadingSkeleton.vue.js +0 -7
- package/dist/components/LoadingSkeleton.vue2.js +0 -20
- package/dist/components/MobileHeader.vue.js +0 -62
- package/dist/components/MobileHeader.vue2.js +0 -4
- package/dist/components/OperationPath.vue.js +0 -7
- package/dist/components/OperationPath.vue2.js +0 -30
- package/dist/components/OperationsList/OperationsList.vue.js +0 -7
- package/dist/components/OperationsList/OperationsList.vue2.js +0 -61
- package/dist/components/OperationsList/OperationsListItem.vue.js +0 -7
- package/dist/components/OperationsList/OperationsListItem.vue2.js +0 -68
- package/dist/components/RenderPlugins/RenderPlugins.vue.js +0 -43
- package/dist/components/RenderPlugins/RenderPlugins.vue2.js +0 -4
- package/dist/components/ScreenReader.vue.js +0 -7
- package/dist/components/ScreenReader.vue2.js +0 -21
- package/dist/components/Section/CompactSection.vue.js +0 -7
- package/dist/components/Section/CompactSection.vue2.js +0 -60
- package/dist/components/Section/Section.vue.js +0 -7
- package/dist/components/Section/Section.vue2.js +0 -23
- package/dist/components/Section/SectionAccordion.vue.js +0 -7
- package/dist/components/Section/SectionAccordion.vue2.js +0 -76
- package/dist/components/Section/SectionColumn.vue.js +0 -14
- package/dist/components/Section/SectionColumns.vue.js +0 -14
- package/dist/components/Section/SectionContainer.vue.js +0 -7
- package/dist/components/Section/SectionContainer.vue2.js +0 -21
- package/dist/components/Section/SectionContainerAccordion.vue.js +0 -7
- package/dist/components/Section/SectionContainerAccordion.vue2.js +0 -54
- package/dist/components/Section/SectionContent.vue.js +0 -7
- package/dist/components/Section/SectionContent.vue2.js +0 -22
- package/dist/components/Section/SectionHeader.vue.js +0 -7
- package/dist/components/Section/SectionHeader.vue2.js +0 -26
- package/dist/components/Section/SectionHeaderTag.vue.js +0 -7
- package/dist/components/Section/SectionHeaderTag.vue2.js +0 -20
- package/dist/components/SectionFlare/SectionFlare.vue.js +0 -14
- package/dist/components/ShowMoreButton.vue.js +0 -7
- package/dist/components/ShowMoreButton.vue2.js +0 -23
- package/dist/consts/urls.js +0 -16
- package/dist/features/Operation/Operation.vue.js +0 -100
- package/dist/features/Operation/Operation.vue2.js +0 -4
- package/dist/features/Operation/components/ContentTypeSelect.vue.js +0 -88
- package/dist/features/Operation/components/ContentTypeSelect.vue2.js +0 -4
- package/dist/features/Operation/components/Header.vue.js +0 -33
- package/dist/features/Operation/components/Header.vue2.js +0 -4
- package/dist/features/Operation/components/Headers.vue.js +0 -7
- package/dist/features/Operation/components/Headers.vue2.js +0 -71
- package/dist/features/Operation/components/OperationParameters.vue.js +0 -92
- package/dist/features/Operation/components/OperationParameters.vue2.js +0 -4
- package/dist/features/Operation/components/OperationResponses.vue.js +0 -44
- package/dist/features/Operation/components/OperationResponses.vue2.js +0 -4
- package/dist/features/Operation/components/ParameterList.vue.js +0 -50
- package/dist/features/Operation/components/ParameterList.vue2.js +0 -4
- package/dist/features/Operation/components/ParameterListItem.vue.js +0 -7
- package/dist/features/Operation/components/ParameterListItem.vue2.js +0 -163
- package/dist/features/Operation/components/RequestBody.vue.js +0 -7
- package/dist/features/Operation/components/RequestBody.vue2.js +0 -164
- package/dist/features/Operation/components/callbacks/Callback.vue.js +0 -7
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +0 -60
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js +0 -63
- package/dist/features/Operation/components/callbacks/Callbacks.vue2.js +0 -4
- package/dist/features/Operation/helpers/filter-selected-security.js +0 -28
- package/dist/features/Operation/helpers/get-first-server.js +0 -25
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +0 -7
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +0 -243
- package/dist/features/Operation/layouts/ModernLayout.vue.js +0 -7
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +0 -256
- package/dist/features/Search/components/SearchButton.vue.js +0 -88
- package/dist/features/Search/components/SearchButton.vue2.js +0 -4
- package/dist/features/Search/components/SearchModal.vue.js +0 -7
- package/dist/features/Search/components/SearchModal.vue2.js +0 -120
- package/dist/features/Search/components/SearchResult.vue.js +0 -84
- package/dist/features/Search/components/SearchResult.vue2.js +0 -4
- package/dist/features/Search/helpers/create-fuse-instance.js +0 -43
- package/dist/features/Search/helpers/create-search-index.js +0 -119
- package/dist/features/Search/hooks/useSearchIndex.js +0 -33
- package/dist/features/ask-agent-button/AskAgentButton.vue.js +0 -7
- package/dist/features/ask-agent-button/AskAgentButton.vue2.js +0 -51
- package/dist/features/developer-tools/DeveloperTools.vue.js +0 -60
- package/dist/features/developer-tools/DeveloperTools.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js +0 -13
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js +0 -33
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js +0 -138
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.js +0 -66
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js +0 -54
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js +0 -71
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js +0 -63
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js +0 -73
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js +0 -57
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue2.js +0 -4
- package/dist/features/developer-tools/components/DeployApiReference.vue.js +0 -35
- package/dist/features/developer-tools/components/DeployApiReference.vue2.js +0 -4
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.js +0 -103
- package/dist/features/developer-tools/components/ModifyConfiguration.vue2.js +0 -4
- package/dist/features/developer-tools/components/ShareApiReference.vue.js +0 -35
- package/dist/features/developer-tools/components/ShareApiReference.vue2.js +0 -4
- package/dist/features/example-responses/ExampleResponse.vue.js +0 -7
- package/dist/features/example-responses/ExampleResponse.vue2.js +0 -61
- package/dist/features/example-responses/ExampleResponseTab.vue.js +0 -7
- package/dist/features/example-responses/ExampleResponseTab.vue2.js +0 -25
- package/dist/features/example-responses/ExampleResponseTabList.vue.js +0 -7
- package/dist/features/example-responses/ExampleResponseTabList.vue2.js +0 -37
- package/dist/features/example-responses/ExampleResponses.vue.js +0 -7
- package/dist/features/example-responses/ExampleResponses.vue2.js +0 -181
- package/dist/features/example-responses/ExampleSchema.vue.js +0 -42
- package/dist/features/example-responses/ExampleSchema.vue2.js +0 -4
- package/dist/features/example-responses/has-response-content.js +0 -28
- package/dist/features/external-docs/ExternalDocs.vue.js +0 -42
- package/dist/features/external-docs/ExternalDocs.vue2.js +0 -4
- package/dist/features/info-object/Contact.vue.js +0 -46
- package/dist/features/info-object/Contact.vue2.js +0 -4
- package/dist/features/info-object/License.vue.js +0 -40
- package/dist/features/info-object/License.vue2.js +0 -4
- package/dist/features/info-object/TermsOfService.vue.js +0 -34
- package/dist/features/info-object/TermsOfService.vue2.js +0 -4
- package/dist/features/multiple-documents/DocumentSelector.vue.js +0 -54
- package/dist/features/multiple-documents/DocumentSelector.vue2.js +0 -4
- package/dist/features/specification-extension/SpecificationExtension.vue.js +0 -4
- package/dist/features/specification-extension/SpecificationExtension.vue2.js +0 -52
- package/dist/features/specification-extension/helpers.js +0 -9
- package/dist/features/test-request-button/TestRequestButton.vue.js +0 -7
- package/dist/features/test-request-button/TestRequestButton.vue2.js +0 -46
- package/dist/features/x-badges/XBadges.vue.js +0 -35
- package/dist/features/x-badges/XBadges.vue2.js +0 -4
- package/dist/helpers/color-mode.js +0 -9
- package/dist/helpers/download.js +0 -45
- package/dist/helpers/id-routing.js +0 -109
- package/dist/helpers/lazy-bus.js +0 -195
- package/dist/helpers/load-from-perssistance.js +0 -17
- package/dist/helpers/map-config-plugins.js +0 -27
- package/dist/helpers/map-config-to-workspace-store.js +0 -45
- package/dist/helpers/normalize-configurations.js +0 -69
- package/dist/helpers/openapi.js +0 -135
- package/dist/helpers/storage.js +0 -47
- package/dist/helpers/upload-temp-document.js +0 -24
- package/dist/hooks/use-agent.js +0 -42
- package/dist/hooks/use-intersection.js +0 -32
- package/dist/plugins/hooks/usePluginManager.js +0 -14
- package/dist/plugins/persistance-plugin.js +0 -48
- package/dist/plugins/plugin-manager.js +0 -39
- package/dist/standalone/lib/html-api.js +0 -81
|
@@ -0,0 +1,1686 @@
|
|
|
1
|
+
import { n as useAgent, r as useAgentContext, t as AGENT_CONTEXT_SYMBOL } from "./use-agent-Bnm1de0n.js";
|
|
2
|
+
import { d as _plugin_vue_export_helper_default } from "./ExternalDocs-phu7GxpZ.js";
|
|
3
|
+
import { a as REGISTRY_SHARE_URL, i as PROXY_URL, n as DASHBOARD_REGISTER_URL, s as UPLOAD_TEMP_API_URL } from "./urls-gPTXGgbj.js";
|
|
4
|
+
import { f as ClassicHeader_default, n as Content_default, t as MobileHeader_default } from "./MobileHeader-DAm6yQX0.js";
|
|
5
|
+
import { t as useIntersection } from "./use-intersection-8QqPi2O-.js";
|
|
6
|
+
import { i as createPluginManager, n as PLUGIN_MANAGER_SYMBOL, t as persistencePlugin } from "./plugins-4EyiUD_A.js";
|
|
7
|
+
import { a as intersectionEnabled, c as scrollToLazy, d as getIdFromUrl, f as makeUrlFromId, n as blockIntersection, p as matchesBasePath, t as addToPriorityQueue } from "./lazy-bus-CV8Ox5hD.js";
|
|
8
|
+
import { i as DocumentSelector_default, t as SearchButton_default } from "./SearchButton-xzhIpMCZ.js";
|
|
9
|
+
import { a as loadClientFromStorage, i as loadAuthFromStorage, n as mapConfigToWorkspaceStore, o as downloadDocument, r as mapConfigPlugins, s as getSystemModePreference, t as normalizeConfigurations } from "./normalize-configurations-DcVpOEjD.js";
|
|
10
|
+
import { Fragment, Transition, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, guardReactiveProps, h, mergeModels, nextTick, normalizeClass, normalizeProps, onBeforeMount, onBeforeUnmount, onMounted, onServerPrefetch, openBlock, provide, reactive, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useId, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives, withKeys } from "vue";
|
|
11
|
+
import { provideUseId } from "@headlessui/vue";
|
|
12
|
+
import { OpenApiClientButton } from "@scalar/api-client/components";
|
|
13
|
+
import { createApiClientModal } from "@scalar/api-client/v2/features/modal";
|
|
14
|
+
import { getActiveEnvironment, getServers } from "@scalar/api-client/v2/helpers";
|
|
15
|
+
import { ScalarButton, ScalarCheckboxRadioGroup, ScalarCodeBlock, ScalarColorModeToggleButton, ScalarColorModeToggleIcon, ScalarCombobox, ScalarFloatingBackdrop, ScalarFormField, ScalarFormInput, ScalarFormInputGroup, ScalarFormSection, ScalarIconButton, ScalarListboxCheckbox, ScalarPopover, ScalarSidebarFooter, ScalarTextInputCopy, ScalarThemeSwatches, ScalarToggleInput, addScalarClassesToHeadless, useLoadingState } from "@scalar/components";
|
|
16
|
+
import { isLocalUrl } from "@scalar/helpers/url/is-local-url";
|
|
17
|
+
import { ScalarSidebar, createSidebarState, scrollSidebarToTop } from "@scalar/sidebar";
|
|
18
|
+
import { getThemeStyles, hasObtrusiveScrollbars, presets, themeIds, themeLabels } from "@scalar/themes";
|
|
19
|
+
import { apiReferenceConfigurationSchema } from "@scalar/types/api-reference";
|
|
20
|
+
import { useBreakpoints } from "@scalar/use-hooks/useBreakpoints";
|
|
21
|
+
import { useClipboard } from "@scalar/use-hooks/useClipboard";
|
|
22
|
+
import { useColorMode } from "@scalar/use-hooks/useColorMode";
|
|
23
|
+
import { ScalarToasts, useToasts } from "@scalar/use-toasts";
|
|
24
|
+
import { createWorkspaceStore } from "@scalar/workspace-store/client";
|
|
25
|
+
import { createWorkspaceEventBus } from "@scalar/workspace-store/events";
|
|
26
|
+
import { useScrollLock } from "@vueuse/core";
|
|
27
|
+
import diff from "microdiff";
|
|
28
|
+
import { ScalarIconArrowUpRight, ScalarIconBookOpen, ScalarIconBracketsCurly, ScalarIconCaretDown, ScalarIconCloud, ScalarIconCopy, ScalarIconFileMd, ScalarIconGitBranch, ScalarIconGlobeSimple, ScalarIconInfo, ScalarIconLockSimple, ScalarIconSparkle, ScalarIconWarningOctagon, ScalarIconX } from "@scalar/icons";
|
|
29
|
+
import "@scalar/agent-chat/style.css";
|
|
30
|
+
import { isValidUrl } from "@scalar/oas-utils/helpers";
|
|
31
|
+
import { redirectToProxy } from "@scalar/helpers/url/redirect-to-proxy";
|
|
32
|
+
import { prettyPrintJson } from "@scalar/helpers/json/pretty-print-json";
|
|
33
|
+
import { createHead } from "@unhead/vue/client";
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/components/AgentScalar/AgentScalarButton.vue
|
|
36
|
+
var AgentScalarButton_default = /* @__PURE__ */ defineComponent({
|
|
37
|
+
__name: "AgentScalarButton",
|
|
38
|
+
setup(__props) {
|
|
39
|
+
const agentContext = useAgentContext();
|
|
40
|
+
return (_ctx, _cache) => {
|
|
41
|
+
return openBlock(), createElementBlock("button", {
|
|
42
|
+
class: "bg-sidebar-b-search text-sidebar-c-2 hover:text-sidebar-c-1 flex items-center gap-1.5 rounded border px-2 text-base whitespace-nowrap",
|
|
43
|
+
type: "button",
|
|
44
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(agentContext)?.toggleAgent())
|
|
45
|
+
}, [createVNode(unref(ScalarIconSparkle)), _cache[1] || (_cache[1] = createTextVNode(" Ask AI ", -1))]);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/components/AgentScalar/AgentScalarDrawer.vue?vue&type=script&setup=true&lang.ts
|
|
51
|
+
var _hoisted_1$10 = { class: "agent-scalar-container custom-scroll custom-scroll-self-contain-overflow overflow-auto px-6" };
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/AgentScalar/AgentScalarDrawer.vue
|
|
54
|
+
var AgentScalarDrawer_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
55
|
+
__name: "AgentScalarDrawer",
|
|
56
|
+
props: {
|
|
57
|
+
agentScalarConfiguration: {},
|
|
58
|
+
workspaceStore: {},
|
|
59
|
+
eventBus: {}
|
|
60
|
+
},
|
|
61
|
+
setup(__props) {
|
|
62
|
+
const agentContext = useAgentContext();
|
|
63
|
+
const AgentScalarChatInterface = defineAsyncComponent(async () => import("./AgentScalarChatInterface-MUbtSqMw.js"));
|
|
64
|
+
return (_ctx, _cache) => {
|
|
65
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(Transition, {
|
|
66
|
+
enterActiveClass: "transition-opacity duration-500",
|
|
67
|
+
enterFromClass: "opacity-0",
|
|
68
|
+
enterToClass: "opacity-100",
|
|
69
|
+
leaveActiveClass: "transition-opacity duration-200",
|
|
70
|
+
leaveFromClass: "opacity-100",
|
|
71
|
+
leaveToClass: "opacity-0"
|
|
72
|
+
}, {
|
|
73
|
+
default: withCtx(() => [withDirectives(createElementVNode("div", {
|
|
74
|
+
class: "agent-scalar-overlay bg-backdrop fixed inset-0 z-10 ease-[cubic-bezier(0.77,0,0.175,1)]",
|
|
75
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(agentContext)?.closeAgent())
|
|
76
|
+
}, null, 512), [[vShow, unref(agentContext)?.showAgent.value]])]),
|
|
77
|
+
_: 1
|
|
78
|
+
}), createVNode(Transition, {
|
|
79
|
+
enterActiveClass: "transition-transform duration-300",
|
|
80
|
+
enterFromClass: "-translate-x-full",
|
|
81
|
+
enterToClass: "translate-x-0",
|
|
82
|
+
leaveActiveClass: "transition-transform duration-200",
|
|
83
|
+
leaveFromClass: "translate-x-0",
|
|
84
|
+
leaveToClass: "-translate-x-full"
|
|
85
|
+
}, {
|
|
86
|
+
default: withCtx(() => [withDirectives(createElementVNode("div", {
|
|
87
|
+
class: "agent-scalar left-w-sidebar bg-b-1 fixed inset-y-0 right-12 z-10 grid border-r shadow-lg",
|
|
88
|
+
onKeydown: _cache[2] || (_cache[2] = withKeys(($event) => unref(agentContext)?.closeAgent(), ["escape"]))
|
|
89
|
+
}, [createElementVNode("div", _hoisted_1$10, [createVNode(unref(AgentScalarChatInterface), {
|
|
90
|
+
agentScalarConfiguration: __props.agentScalarConfiguration,
|
|
91
|
+
prefilledMessage: unref(agentContext)?.prefilledMessage,
|
|
92
|
+
workspaceStore: __props.workspaceStore
|
|
93
|
+
}, null, 8, [
|
|
94
|
+
"agentScalarConfiguration",
|
|
95
|
+
"prefilledMessage",
|
|
96
|
+
"workspaceStore"
|
|
97
|
+
])]), createVNode(unref(ScalarIconButton), {
|
|
98
|
+
class: "agent-scalar-exit-button absolute top-2 right-2",
|
|
99
|
+
icon: unref(ScalarIconX),
|
|
100
|
+
label: "Close Client",
|
|
101
|
+
weight: "bold",
|
|
102
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(agentContext)?.closeAgent())
|
|
103
|
+
}, null, 8, ["icon"])], 544), [[vShow, unref(agentContext)?.showAgent.value]])]),
|
|
104
|
+
_: 1
|
|
105
|
+
})], 64);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}), [["__scopeId", "data-v-b38821a2"]]);
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/helpers/upload-temp-document.ts
|
|
111
|
+
/** Type guard for the response body */
|
|
112
|
+
function isResponseBody(data) {
|
|
113
|
+
return !!data && typeof data === "object" && "url" in data && typeof data.url === "string";
|
|
114
|
+
}
|
|
115
|
+
/** Upload a document and return a temporary URL */
|
|
116
|
+
async function uploadTempDocument(document) {
|
|
117
|
+
const body = JSON.stringify({ document });
|
|
118
|
+
const response = await fetch(redirectToProxy(PROXY_URL, UPLOAD_TEMP_API_URL), {
|
|
119
|
+
method: "POST",
|
|
120
|
+
headers: { "Content-Type": "application/json" },
|
|
121
|
+
body
|
|
122
|
+
});
|
|
123
|
+
if (!response.ok) throw new Error(` Failed to generate temporary link, server responded with ${response.status}`);
|
|
124
|
+
const data = await response.json();
|
|
125
|
+
if (!isResponseBody(data)) throw new Error("Failed to generate temporary link, invalid response from server");
|
|
126
|
+
return data.url;
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/components/AgentScalar/OpenMCPButton.vue?vue&type=script&setup=true&lang.ts
|
|
130
|
+
var _hoisted_1$9 = { class: "scalar-mcp-layer" };
|
|
131
|
+
var _hoisted_2$6 = ["href", "target"];
|
|
132
|
+
var _hoisted_3$5 = ["href", "target"];
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/components/AgentScalar/OpenMCPButton.vue
|
|
135
|
+
var OpenMCPButton_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
136
|
+
__name: "OpenMCPButton",
|
|
137
|
+
props: /* @__PURE__ */ mergeModels({
|
|
138
|
+
config: {},
|
|
139
|
+
url: {},
|
|
140
|
+
workspace: {}
|
|
141
|
+
}, {
|
|
142
|
+
"url": {},
|
|
143
|
+
"urlModifiers": {}
|
|
144
|
+
}),
|
|
145
|
+
emits: ["update:url"],
|
|
146
|
+
setup(__props) {
|
|
147
|
+
const props = __props;
|
|
148
|
+
const { copyToClipboard } = useClipboard();
|
|
149
|
+
const { toast } = useToasts();
|
|
150
|
+
const loader = useLoadingState();
|
|
151
|
+
const hasConfig = props.config?.name || props.config?.url;
|
|
152
|
+
const encoded = btoa(JSON.stringify(props.config ?? {}));
|
|
153
|
+
const cursorLink = `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(props.config?.name ?? "")}&config=${encoded}`;
|
|
154
|
+
const vscodeLink = `vscode:mcp/install?${encodeURIComponent(JSON.stringify(props.config ?? {}))}`;
|
|
155
|
+
const docUrl = useModel(__props, "url");
|
|
156
|
+
/** Generate and open the registration link */
|
|
157
|
+
async function generateRegisterLink() {
|
|
158
|
+
if (loader.isLoading || !props.workspace) return;
|
|
159
|
+
if (docUrl.value && isValidUrl(docUrl.value)) {
|
|
160
|
+
openRegisterLink(docUrl.value);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
loader.start();
|
|
164
|
+
const document = props.workspace.exportActiveDocument("json");
|
|
165
|
+
if (!document) {
|
|
166
|
+
toast("Unable to export active document", "error");
|
|
167
|
+
await loader.invalidate();
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
try {
|
|
171
|
+
docUrl.value = await uploadTempDocument(document);
|
|
172
|
+
await loader.validate();
|
|
173
|
+
openRegisterLink(docUrl.value);
|
|
174
|
+
await nextTick();
|
|
175
|
+
await loader.clear();
|
|
176
|
+
} catch (error) {
|
|
177
|
+
toast(error instanceof Error ? error.message : "An unknown error occurred", "error");
|
|
178
|
+
await loader.invalidate();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/** Open the registration link in a new tab */
|
|
182
|
+
function openRegisterLink(docUrl) {
|
|
183
|
+
const url = new URL(DASHBOARD_REGISTER_URL);
|
|
184
|
+
url.searchParams.set("url", docUrl);
|
|
185
|
+
url.searchParams.set("createMcp", "true");
|
|
186
|
+
window.open(url.toString(), "_blank");
|
|
187
|
+
}
|
|
188
|
+
return (_ctx, _cache) => {
|
|
189
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
190
|
+
createElementVNode("a", {
|
|
191
|
+
class: "scalar-mcp-layer-link",
|
|
192
|
+
href: unref(hasConfig) ? vscodeLink : void 0,
|
|
193
|
+
target: unref(hasConfig) ? "_blank" : void 0,
|
|
194
|
+
onClick: _cache[0] || (_cache[0] = (e) => {
|
|
195
|
+
if (!unref(hasConfig)) {
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
generateRegisterLink();
|
|
198
|
+
}
|
|
199
|
+
})
|
|
200
|
+
}, [
|
|
201
|
+
_cache[3] || (_cache[3] = createElementVNode("svg", {
|
|
202
|
+
class: "mcp-logo",
|
|
203
|
+
fill: "currentColor",
|
|
204
|
+
height: "800",
|
|
205
|
+
viewBox: "0 0 32 32",
|
|
206
|
+
width: "800",
|
|
207
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
208
|
+
}, [createElementVNode("path", { d: "M30.865 3.448 24.282.281a1.99 1.99 0 0 0-2.276.385L9.397 12.171 3.902 8.004a1.33 1.33 0 0 0-1.703.073L.439 9.681a1.33 1.33 0 0 0-.005 1.969L5.2 15.999.434 20.348a1.33 1.33 0 0 0 .005 1.969l1.76 1.604a1.33 1.33 0 0 0 1.703.073l5.495-4.172 12.615 11.51a1.98 1.98 0 0 0 2.271.385l6.589-3.172a1.99 1.99 0 0 0 1.13-1.802V5.248c0-.766-.443-1.469-1.135-1.802zm-6.86 19.818L14.432 16l9.573-7.266z" })], -1)),
|
|
209
|
+
_cache[4] || (_cache[4] = createTextVNode(" VS Code ", -1)),
|
|
210
|
+
createVNode(unref(ScalarIconArrowUpRight), { class: "mcp-nav ml-auto size-4" })
|
|
211
|
+
], 8, _hoisted_2$6),
|
|
212
|
+
createElementVNode("a", {
|
|
213
|
+
class: "scalar-mcp-layer-link",
|
|
214
|
+
href: unref(hasConfig) ? cursorLink : void 0,
|
|
215
|
+
target: unref(hasConfig) ? "_blank" : void 0,
|
|
216
|
+
onClick: _cache[1] || (_cache[1] = (e) => {
|
|
217
|
+
if (!unref(hasConfig)) {
|
|
218
|
+
e.preventDefault();
|
|
219
|
+
generateRegisterLink();
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
}, [
|
|
223
|
+
_cache[5] || (_cache[5] = createElementVNode("svg", {
|
|
224
|
+
class: "mcp-logo",
|
|
225
|
+
viewBox: "0 0 466.73 532.09",
|
|
226
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
227
|
+
}, [createElementVNode("path", {
|
|
228
|
+
d: "M457.43 125.94 244.42 2.96a22.13 22.13 0 0 0-22.12 0L9.3 125.94C3.55 129.26 0 135.4 0 142.05v247.99c0 6.65 3.55 12.79 9.3 16.11l213.01 122.98a22.13 22.13 0 0 0 22.12 0l213.01-122.98c5.75-3.32 9.3-9.46 9.3-16.11V142.05c0-6.65-3.55-12.79-9.3-16.11zm-13.38 26.05L238.42 508.15c-1.39 2.4-5.06 1.42-5.06-1.36V273.58c0-4.66-2.49-8.97-6.53-11.31L24.87 145.67c-2.4-1.39-1.42-5.06 1.36-5.06h411.26c5.84 0 9.49 6.33 6.57 11.39h-.01Z",
|
|
229
|
+
style: { "fill": "currentColor" }
|
|
230
|
+
})], -1)),
|
|
231
|
+
_cache[6] || (_cache[6] = createTextVNode(" Cursor ", -1)),
|
|
232
|
+
createVNode(unref(ScalarIconArrowUpRight), { class: "mcp-nav ml-auto size-4" })
|
|
233
|
+
], 8, _hoisted_3$5),
|
|
234
|
+
!unref(hasConfig) ? (openBlock(), createElementBlock("div", {
|
|
235
|
+
key: 0,
|
|
236
|
+
class: "scalar-mcp-layer-link",
|
|
237
|
+
onClick: generateRegisterLink
|
|
238
|
+
}, [
|
|
239
|
+
_cache[7] || (_cache[7] = createElementVNode("svg", {
|
|
240
|
+
class: "mcp-logo",
|
|
241
|
+
fill: "none",
|
|
242
|
+
height: "173",
|
|
243
|
+
viewBox: "0 0 156 173",
|
|
244
|
+
width: "156",
|
|
245
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
246
|
+
}, [
|
|
247
|
+
createElementVNode("path", {
|
|
248
|
+
d: "m6 80.912 67.882-67.883c9.373-9.372 24.569-9.372 33.941 0s9.373 24.569 0 33.942L56.558 98.236",
|
|
249
|
+
stroke: "currentColor",
|
|
250
|
+
"stroke-linecap": "round",
|
|
251
|
+
"stroke-width": "12"
|
|
252
|
+
}),
|
|
253
|
+
createElementVNode("path", {
|
|
254
|
+
d: "m57.265 97.529 50.558-50.558c9.373-9.373 24.569-9.373 33.942 0l.353.353c9.373 9.373 9.373 24.569 0 33.941L80.725 142.66a8 8 0 0 0 0 11.313l12.606 12.607",
|
|
255
|
+
stroke: "currentColor",
|
|
256
|
+
"stroke-linecap": "round",
|
|
257
|
+
"stroke-width": "12"
|
|
258
|
+
}),
|
|
259
|
+
createElementVNode("path", {
|
|
260
|
+
d: "M90.853 30 40.648 80.205c-9.372 9.372-9.372 24.568 0 33.941 9.373 9.372 24.569 9.372 33.941 0l50.205-50.205",
|
|
261
|
+
stroke: "currentColor",
|
|
262
|
+
"stroke-linecap": "round",
|
|
263
|
+
"stroke-width": "12"
|
|
264
|
+
})
|
|
265
|
+
], -1)),
|
|
266
|
+
_cache[8] || (_cache[8] = createTextVNode(" Generate MCP ", -1)),
|
|
267
|
+
createVNode(unref(ScalarIconArrowUpRight), { class: "mcp-nav ml-auto size-4" })
|
|
268
|
+
])) : (openBlock(), createElementBlock("div", {
|
|
269
|
+
key: 1,
|
|
270
|
+
class: "scalar-mcp-layer-link",
|
|
271
|
+
onClick: _cache[2] || (_cache[2] = ($event) => unref(copyToClipboard)(__props.config?.url ?? ""))
|
|
272
|
+
}, [..._cache[9] || (_cache[9] = [createTextVNode(" Connect MCP ", -1), createElementVNode("svg", {
|
|
273
|
+
class: "mcp-logo ml-auto",
|
|
274
|
+
fill: "none",
|
|
275
|
+
height: "173",
|
|
276
|
+
viewBox: "0 0 156 173",
|
|
277
|
+
width: "156",
|
|
278
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
279
|
+
}, [
|
|
280
|
+
createElementVNode("path", {
|
|
281
|
+
d: "m6 80.912 67.882-67.883c9.373-9.372 24.569-9.372 33.941 0s9.373 24.569 0 33.942L56.558 98.236",
|
|
282
|
+
stroke: "currentColor",
|
|
283
|
+
"stroke-linecap": "round",
|
|
284
|
+
"stroke-width": "12"
|
|
285
|
+
}),
|
|
286
|
+
createElementVNode("path", {
|
|
287
|
+
d: "m57.265 97.529 50.558-50.558c9.373-9.373 24.569-9.373 33.942 0l.353.353c9.373 9.373 9.373 24.569 0 33.941L80.725 142.66a8 8 0 0 0 0 11.313l12.606 12.607",
|
|
288
|
+
stroke: "currentColor",
|
|
289
|
+
"stroke-linecap": "round",
|
|
290
|
+
"stroke-width": "12"
|
|
291
|
+
}),
|
|
292
|
+
createElementVNode("path", {
|
|
293
|
+
d: "M90.853 30 40.648 80.205c-9.372 9.372-9.372 24.568 0 33.941 9.373 9.372 24.569 9.372 33.941 0l50.205-50.205",
|
|
294
|
+
stroke: "currentColor",
|
|
295
|
+
"stroke-linecap": "round",
|
|
296
|
+
"stroke-width": "12"
|
|
297
|
+
})
|
|
298
|
+
], -1)])]))
|
|
299
|
+
]);
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
}), [["__scopeId", "data-v-d7102814"]]);
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarPopover.vue?vue&type=script&setup=true&lang.ts
|
|
305
|
+
var _hoisted_1$8 = {
|
|
306
|
+
class: "text-c-2 hover:text-c-1 hover:bg-b-2 flex items-center gap-1 rounded px-2 py-2.25 text-base leading-none",
|
|
307
|
+
type: "button"
|
|
308
|
+
};
|
|
309
|
+
var _hoisted_2$5 = { class: "custom-scroll bg-b-1 flex flex-col gap-7 rounded-lg p-7 pb-6" };
|
|
310
|
+
var _hoisted_3$4 = { class: "text-c-2 flex items-center justify-center gap-1 p-2 text-sm" };
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarPopover.vue
|
|
313
|
+
var ApiReferenceToolbarPopover_default = /* @__PURE__ */ defineComponent({
|
|
314
|
+
__name: "ApiReferenceToolbarPopover",
|
|
315
|
+
setup(__props) {
|
|
316
|
+
return (_ctx, _cache) => {
|
|
317
|
+
return openBlock(), createBlock(unref(ScalarPopover), {
|
|
318
|
+
class: "max-h-[inherit] max-w-[inherit] p-0 text-base",
|
|
319
|
+
placement: "bottom-end",
|
|
320
|
+
teleport: ""
|
|
321
|
+
}, {
|
|
322
|
+
default: withCtx(({ open }) => [renderSlot(_ctx.$slots, "button", { open }, () => [createElementVNode("button", _hoisted_1$8, [renderSlot(_ctx.$slots, "label"), createVNode(unref(ScalarIconCaretDown), { class: normalizeClass(["size-3", { "rotate-180": open }]) }, null, 8, ["class"])])])]),
|
|
323
|
+
popover: withCtx((props) => [createElementVNode("div", _hoisted_2$5, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(props)))]), createElementVNode("div", _hoisted_3$4, [createVNode(unref(ScalarIconInfo), { class: "size-3.5 shrink-0" }), createElementVNode("div", null, [renderSlot(_ctx.$slots, "info", {}, () => [
|
|
324
|
+
_cache[0] || (_cache[0] = createTextVNode(" \"", -1)),
|
|
325
|
+
renderSlot(_ctx.$slots, "label"),
|
|
326
|
+
_cache[1] || (_cache[1] = createTextVNode("\" will only appear when running on localhost. ", -1))
|
|
327
|
+
])])])]),
|
|
328
|
+
backdrop: withCtx(() => [createVNode(unref(ScalarFloatingBackdrop), { class: "bg-b-2 rounded-lg" })]),
|
|
329
|
+
_: 3
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarTitle.vue?vue&type=script&setup=true&lang.ts
|
|
336
|
+
var _hoisted_1$7 = {
|
|
337
|
+
class: "text-c-2 hover:text-c-1 hover:bg-b-2 ml-auto flex items-center gap-1 rounded px-2 py-2.25 text-base leading-none",
|
|
338
|
+
type: "button"
|
|
339
|
+
};
|
|
340
|
+
var _hoisted_2$4 = { class: "-m-2 flex flex-col gap-2 leading-relaxed" };
|
|
341
|
+
var _hoisted_3$3 = { class: "bg-b-2 inline-flex items-center gap-0.5 rounded border px-1 py-0.5 text-sm" };
|
|
342
|
+
var CONFIG_SETTING = "showDeveloperTools: \"never\"";
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarTitle.vue
|
|
345
|
+
var ApiReferenceToolbarTitle_default = /* @__PURE__ */ defineComponent({
|
|
346
|
+
__name: "ApiReferenceToolbarTitle",
|
|
347
|
+
setup(__props) {
|
|
348
|
+
const { copyToClipboard } = useClipboard();
|
|
349
|
+
return (_ctx, _cache) => {
|
|
350
|
+
return openBlock(), createBlock(ApiReferenceToolbarPopover_default, {
|
|
351
|
+
class: "w-120",
|
|
352
|
+
placement: "bottom-start"
|
|
353
|
+
}, {
|
|
354
|
+
button: withCtx(() => [createElementVNode("button", _hoisted_1$7, [createVNode(unref(ScalarIconInfo)), _cache[1] || (_cache[1] = createTextVNode(" Developer Tools ", -1))])]),
|
|
355
|
+
info: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode(" The developer tools will only appear when running on localhost. ", -1)])]),
|
|
356
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_2$4, [_cache[4] || (_cache[4] = createElementVNode("div", null, " The developer tools allow you to customize the appearance and behavior of your documentation. You can also share your documentation using the Scalar Registry. ", -1)), createElementVNode("div", null, [
|
|
357
|
+
_cache[2] || (_cache[2] = createTextVNode(" To disable the toolbar, set ", -1)),
|
|
358
|
+
createElementVNode("div", _hoisted_3$3, [createElementVNode("code", { class: "font-code" }, toDisplayString(CONFIG_SETTING)), createVNode(unref(ScalarIconButton), {
|
|
359
|
+
class: "-m-1 p-1.25",
|
|
360
|
+
icon: unref(ScalarIconCopy),
|
|
361
|
+
label: "Copy link to clipboard",
|
|
362
|
+
size: "sm",
|
|
363
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(copyToClipboard)(CONFIG_SETTING))
|
|
364
|
+
}, null, 8, ["icon"])]),
|
|
365
|
+
_cache[3] || (_cache[3] = createTextVNode(" in your configuration. ", -1))
|
|
366
|
+
])])]),
|
|
367
|
+
_: 1
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarBlurb.vue
|
|
374
|
+
var _sfc_main = {};
|
|
375
|
+
var _hoisted_1$6 = { class: "text-c-3 [&_code]:font-code [&_a:hover]:text-c-1 text-center leading-normal [&_a]:underline" };
|
|
376
|
+
function _sfc_render(_ctx, _cache) {
|
|
377
|
+
return openBlock(), createElementBlock("p", _hoisted_1$6, [renderSlot(_ctx.$slots, "default")]);
|
|
378
|
+
}
|
|
379
|
+
var ApiReferenceToolbarBlurb_default = /* @__PURE__ */ _plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render]]);
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue
|
|
382
|
+
var ApiReferenceToolbarRegisterButton_default = /* @__PURE__ */ defineComponent({
|
|
383
|
+
__name: "ApiReferenceToolbarRegisterButton",
|
|
384
|
+
props: /* @__PURE__ */ mergeModels({
|
|
385
|
+
workspace: {},
|
|
386
|
+
sdks: { default: () => [] }
|
|
387
|
+
}, {
|
|
388
|
+
"url": {},
|
|
389
|
+
"urlModifiers": {}
|
|
390
|
+
}),
|
|
391
|
+
emits: ["update:url"],
|
|
392
|
+
setup(__props) {
|
|
393
|
+
const tempDocUrl = useModel(__props, "url");
|
|
394
|
+
const { toast } = useToasts();
|
|
395
|
+
const loader = useLoadingState();
|
|
396
|
+
/** Open the registration link in a new tab */
|
|
397
|
+
function openRegisterLink(docUrl) {
|
|
398
|
+
const url = new URL(DASHBOARD_REGISTER_URL);
|
|
399
|
+
url.searchParams.set("url", docUrl);
|
|
400
|
+
__props.sdks.forEach((sdk) => url.searchParams.append("sdk", sdk));
|
|
401
|
+
window.open(url.toString(), "_blank");
|
|
402
|
+
}
|
|
403
|
+
/** Generate and open the registration link */
|
|
404
|
+
async function generateRegisterLink() {
|
|
405
|
+
if (loader.isLoading || !__props.workspace) return;
|
|
406
|
+
if (tempDocUrl.value) {
|
|
407
|
+
openRegisterLink(tempDocUrl.value);
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
loader.start();
|
|
411
|
+
const document = __props.workspace.exportActiveDocument("json");
|
|
412
|
+
if (!document) {
|
|
413
|
+
toast("Unable to export active document", "error");
|
|
414
|
+
await loader.invalidate();
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
try {
|
|
418
|
+
tempDocUrl.value = await uploadTempDocument(document);
|
|
419
|
+
await loader.validate();
|
|
420
|
+
openRegisterLink(tempDocUrl.value);
|
|
421
|
+
await nextTick();
|
|
422
|
+
await loader.clear();
|
|
423
|
+
} catch (error) {
|
|
424
|
+
toast(error instanceof Error ? error.message : "An unknown error occurred", "error");
|
|
425
|
+
await loader.invalidate();
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
return (_ctx, _cache) => {
|
|
429
|
+
return openBlock(), createBlock(unref(ScalarButton), {
|
|
430
|
+
class: "h-auto p-2.5",
|
|
431
|
+
loader: unref(loader),
|
|
432
|
+
onClick: generateRegisterLink
|
|
433
|
+
}, {
|
|
434
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createTextVNode("Generate", -1))])]),
|
|
435
|
+
_: 3
|
|
436
|
+
}, 8, ["loader"]);
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue?vue&type=script&setup=true&lang.ts
|
|
442
|
+
var _hoisted_1$5 = { class: "text-c-2 mb-2 grid grid-cols-2 gap-2.5 font-medium" };
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue
|
|
445
|
+
var ApiReferenceToolbarShareRegister_default = /* @__PURE__ */ defineComponent({
|
|
446
|
+
__name: "ApiReferenceToolbarShareRegister",
|
|
447
|
+
props: { workspace: {} },
|
|
448
|
+
setup(__props) {
|
|
449
|
+
const FEATURES = [
|
|
450
|
+
{
|
|
451
|
+
icon: ScalarIconLockSimple,
|
|
452
|
+
label: "Password Protection"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
icon: ScalarIconGlobeSimple,
|
|
456
|
+
label: "Custom Domains"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
icon: ScalarIconBookOpen,
|
|
460
|
+
label: "Free-form content"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
icon: ScalarIconCloud,
|
|
464
|
+
label: "CDN Infrastructure"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
icon: ScalarIconGitBranch,
|
|
468
|
+
label: "Pull from GitHub"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
icon: ScalarIconFileMd,
|
|
472
|
+
label: "Markdown/MDX"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
icon: ScalarIconWarningOctagon,
|
|
476
|
+
label: "Spectral Linting"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
icon: ScalarIconBracketsCurly,
|
|
480
|
+
label: "JSON Schema Hosting"
|
|
481
|
+
}
|
|
482
|
+
];
|
|
483
|
+
return (_ctx, _cache) => {
|
|
484
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
485
|
+
createElementVNode("ul", _hoisted_1$5, [(openBlock(), createElementBlock(Fragment, null, renderList(FEATURES, (feature) => {
|
|
486
|
+
return createElementVNode("li", {
|
|
487
|
+
key: feature.label,
|
|
488
|
+
class: "flex items-center gap-2"
|
|
489
|
+
}, [(openBlock(), createBlock(resolveDynamicComponent(feature.icon), {
|
|
490
|
+
class: "text-c-3 size-3.5",
|
|
491
|
+
weight: "bold"
|
|
492
|
+
})), createTextVNode(" " + toDisplayString(feature.label), 1)]);
|
|
493
|
+
}), 64))]),
|
|
494
|
+
createVNode(ApiReferenceToolbarRegisterButton_default, { workspace: __props.workspace }, {
|
|
495
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Deploy on Scalar ", -1)])]),
|
|
496
|
+
_: 1
|
|
497
|
+
}, 8, ["workspace"]),
|
|
498
|
+
createVNode(ApiReferenceToolbarBlurb_default, null, {
|
|
499
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
500
|
+
createTextVNode(" Deploy your documentation for free. ", -1),
|
|
501
|
+
createElementVNode("br", null, null, -1),
|
|
502
|
+
createTextVNode(" Additional features might require ", -1),
|
|
503
|
+
createElementVNode("a", {
|
|
504
|
+
href: "https://scalar.com/products/docs/getting-started",
|
|
505
|
+
target: "_blank"
|
|
506
|
+
}, "Scalar Pro", -1),
|
|
507
|
+
createTextVNode(". ", -1)
|
|
508
|
+
])]),
|
|
509
|
+
_: 1
|
|
510
|
+
})
|
|
511
|
+
], 64);
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
//#endregion
|
|
516
|
+
//#region src/features/developer-tools/components/DeployApiReference.vue
|
|
517
|
+
var DeployApiReference_default = /* @__PURE__ */ defineComponent({
|
|
518
|
+
__name: "DeployApiReference",
|
|
519
|
+
props: { workspace: {} },
|
|
520
|
+
setup(__props) {
|
|
521
|
+
return (_ctx, _cache) => {
|
|
522
|
+
return openBlock(), createBlock(ApiReferenceToolbarPopover_default, { class: "w-120" }, {
|
|
523
|
+
label: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("Deploy", -1)])]),
|
|
524
|
+
default: withCtx(() => [createVNode(unref(ScalarFormSection), null, {
|
|
525
|
+
label: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("Scalar Docs", -1)])]),
|
|
526
|
+
default: withCtx(() => [_cache[2] || (_cache[2] = createElementVNode("p", { class: "text-c-2 mb-2 leading-normal" }, " Deploy your documentation on Scalar, the modern documentation platform for your API and everything else. ", -1)), createVNode(ApiReferenceToolbarShareRegister_default, { workspace: __props.workspace }, null, 8, ["workspace"])]),
|
|
527
|
+
_: 1
|
|
528
|
+
})]),
|
|
529
|
+
_: 1
|
|
530
|
+
});
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
//#endregion
|
|
535
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue
|
|
536
|
+
var ApiReferenceToolbarConfigLayout_default = /* @__PURE__ */ defineComponent({
|
|
537
|
+
__name: "ApiReferenceToolbarConfigLayout",
|
|
538
|
+
props: {
|
|
539
|
+
"modelValue": {},
|
|
540
|
+
"modelModifiers": {}
|
|
541
|
+
},
|
|
542
|
+
emits: ["update:modelValue"],
|
|
543
|
+
setup(__props) {
|
|
544
|
+
const ModernOption = {
|
|
545
|
+
label: "Modern",
|
|
546
|
+
value: "modern"
|
|
547
|
+
};
|
|
548
|
+
const ClassicOption = {
|
|
549
|
+
label: "Classic",
|
|
550
|
+
value: "classic"
|
|
551
|
+
};
|
|
552
|
+
const options = [ModernOption, ClassicOption];
|
|
553
|
+
const model = useModel(__props, "modelValue");
|
|
554
|
+
const selected = computed({
|
|
555
|
+
get: () => model.value === "modern" ? ModernOption : ClassicOption,
|
|
556
|
+
set: (option) => model.value = option.value
|
|
557
|
+
});
|
|
558
|
+
return (_ctx, _cache) => {
|
|
559
|
+
return openBlock(), createBlock(unref(ScalarCheckboxRadioGroup), {
|
|
560
|
+
modelValue: selected.value,
|
|
561
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selected.value = $event),
|
|
562
|
+
options
|
|
563
|
+
}, null, 8, ["modelValue"]);
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue
|
|
569
|
+
var ApiReferenceToolbarConfigLayoutOptions_default = /* @__PURE__ */ defineComponent({
|
|
570
|
+
__name: "ApiReferenceToolbarConfigLayoutOptions",
|
|
571
|
+
props: /* @__PURE__ */ mergeModels({ configuration: {} }, {
|
|
572
|
+
"modelValue": { default: {} },
|
|
573
|
+
"modelModifiers": {}
|
|
574
|
+
}),
|
|
575
|
+
emits: ["update:modelValue"],
|
|
576
|
+
setup(__props) {
|
|
577
|
+
const model = useModel(__props, "modelValue");
|
|
578
|
+
function getValue(key, defaultValue = false) {
|
|
579
|
+
return model.value[key] ?? __props.configuration?.[key] ?? defaultValue;
|
|
580
|
+
}
|
|
581
|
+
function setValue(key, value, defaultValue = false) {
|
|
582
|
+
if (value !== defaultValue) model.value = {
|
|
583
|
+
...model.value,
|
|
584
|
+
[key]: value
|
|
585
|
+
};
|
|
586
|
+
else model.value = Object.fromEntries(Object.entries(model.value).filter(([k]) => key !== k));
|
|
587
|
+
}
|
|
588
|
+
return (_ctx, _cache) => {
|
|
589
|
+
return openBlock(), createBlock(unref(ScalarFormInputGroup), null, {
|
|
590
|
+
default: withCtx(() => [
|
|
591
|
+
createVNode(unref(ScalarToggleInput), {
|
|
592
|
+
modelValue: getValue("showSidebar", true),
|
|
593
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = (v) => setValue("showSidebar", !!v, true))
|
|
594
|
+
}, {
|
|
595
|
+
default: withCtx(() => [..._cache[11] || (_cache[11] = [createTextVNode(" Show Sidebar ", -1)])]),
|
|
596
|
+
_: 1
|
|
597
|
+
}, 8, ["modelValue"]),
|
|
598
|
+
createVNode(unref(ScalarToggleInput), {
|
|
599
|
+
modelValue: getValue("defaultOpenFirstTag", true),
|
|
600
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = (v) => setValue("defaultOpenFirstTag", !!v, true))
|
|
601
|
+
}, {
|
|
602
|
+
default: withCtx(() => [..._cache[12] || (_cache[12] = [createTextVNode(" Default Open First Tag ", -1)])]),
|
|
603
|
+
_: 1
|
|
604
|
+
}, 8, ["modelValue"]),
|
|
605
|
+
createVNode(unref(ScalarToggleInput), {
|
|
606
|
+
modelValue: getValue("defaultOpenAllTags"),
|
|
607
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = (v) => setValue("defaultOpenAllTags", !!v))
|
|
608
|
+
}, {
|
|
609
|
+
default: withCtx(() => [..._cache[13] || (_cache[13] = [createTextVNode(" Default Open All Tags ", -1)])]),
|
|
610
|
+
_: 1
|
|
611
|
+
}, 8, ["modelValue"]),
|
|
612
|
+
createVNode(unref(ScalarToggleInput), {
|
|
613
|
+
modelValue: getValue("expandAllModelSections"),
|
|
614
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = (v) => setValue("expandAllModelSections", !!v))
|
|
615
|
+
}, {
|
|
616
|
+
default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode(" Expand All Model Sections ", -1)])]),
|
|
617
|
+
_: 1
|
|
618
|
+
}, 8, ["modelValue"]),
|
|
619
|
+
createVNode(unref(ScalarToggleInput), {
|
|
620
|
+
modelValue: getValue("expandAllResponses"),
|
|
621
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = (v) => setValue("expandAllResponses", !!v))
|
|
622
|
+
}, {
|
|
623
|
+
default: withCtx(() => [..._cache[15] || (_cache[15] = [createTextVNode(" Expand All Responses ", -1)])]),
|
|
624
|
+
_: 1
|
|
625
|
+
}, 8, ["modelValue"]),
|
|
626
|
+
createVNode(unref(ScalarToggleInput), {
|
|
627
|
+
modelValue: getValue("hideClientButton"),
|
|
628
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = (v) => setValue("hideClientButton", !!v))
|
|
629
|
+
}, {
|
|
630
|
+
default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode(" Hide Client Button ", -1)])]),
|
|
631
|
+
_: 1
|
|
632
|
+
}, 8, ["modelValue"]),
|
|
633
|
+
createVNode(unref(ScalarToggleInput), {
|
|
634
|
+
modelValue: getValue("hideDarkModeToggle"),
|
|
635
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = (v) => setValue("hideDarkModeToggle", !!v))
|
|
636
|
+
}, {
|
|
637
|
+
default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode(" Hide Dark Mode Toggle ", -1)])]),
|
|
638
|
+
_: 1
|
|
639
|
+
}, 8, ["modelValue"]),
|
|
640
|
+
createVNode(unref(ScalarToggleInput), {
|
|
641
|
+
modelValue: getValue("hideModels"),
|
|
642
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = (v) => setValue("hideModels", !!v))
|
|
643
|
+
}, {
|
|
644
|
+
default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode(" Hide Models ", -1)])]),
|
|
645
|
+
_: 1
|
|
646
|
+
}, 8, ["modelValue"]),
|
|
647
|
+
createVNode(unref(ScalarToggleInput), {
|
|
648
|
+
modelValue: getValue("hideSearch"),
|
|
649
|
+
"onUpdate:modelValue": _cache[8] || (_cache[8] = (v) => setValue("hideSearch", !!v))
|
|
650
|
+
}, {
|
|
651
|
+
default: withCtx(() => [..._cache[19] || (_cache[19] = [createTextVNode(" Hide Search ", -1)])]),
|
|
652
|
+
_: 1
|
|
653
|
+
}, 8, ["modelValue"]),
|
|
654
|
+
createVNode(unref(ScalarToggleInput), {
|
|
655
|
+
modelValue: getValue("showOperationId"),
|
|
656
|
+
"onUpdate:modelValue": _cache[9] || (_cache[9] = (v) => setValue("showOperationId", !!v))
|
|
657
|
+
}, {
|
|
658
|
+
default: withCtx(() => [..._cache[20] || (_cache[20] = [createTextVNode(" Show Operation ID ", -1)])]),
|
|
659
|
+
_: 1
|
|
660
|
+
}, 8, ["modelValue"]),
|
|
661
|
+
createVNode(unref(ScalarToggleInput), {
|
|
662
|
+
modelValue: getValue("hideTestRequestButton"),
|
|
663
|
+
"onUpdate:modelValue": _cache[10] || (_cache[10] = (v) => setValue("hideTestRequestButton", !!v))
|
|
664
|
+
}, {
|
|
665
|
+
default: withCtx(() => [..._cache[21] || (_cache[21] = [createTextVNode(" Hide Test Request Button ", -1)])]),
|
|
666
|
+
_: 1
|
|
667
|
+
}, 8, ["modelValue"])
|
|
668
|
+
]),
|
|
669
|
+
_: 1
|
|
670
|
+
});
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
//#endregion
|
|
675
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue?vue&type=script&setup=true&lang.ts
|
|
676
|
+
var _hoisted_1$4 = { class: "min-w-0 flex-1 truncate text-left" };
|
|
677
|
+
var _hoisted_2$3 = { class: "text-c-1 inline-block min-w-0 flex-1 truncate" };
|
|
678
|
+
//#endregion
|
|
679
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue
|
|
680
|
+
var ApiReferenceToolbarConfigTheme_default = /* @__PURE__ */ defineComponent({
|
|
681
|
+
__name: "ApiReferenceToolbarConfigTheme",
|
|
682
|
+
props: {
|
|
683
|
+
"modelValue": {},
|
|
684
|
+
"modelModifiers": {}
|
|
685
|
+
},
|
|
686
|
+
emits: ["update:modelValue"],
|
|
687
|
+
setup(__props) {
|
|
688
|
+
const model = useModel(__props, "modelValue");
|
|
689
|
+
const options = computed(() => themeIds.filter((id) => id !== "none").map((id) => ({
|
|
690
|
+
id,
|
|
691
|
+
label: themeLabels[id],
|
|
692
|
+
css: presets[id].theme
|
|
693
|
+
})));
|
|
694
|
+
const selected = computed({
|
|
695
|
+
get: () => {
|
|
696
|
+
const theme = model.value ?? "default";
|
|
697
|
+
return options.value.find((o) => o.id === theme) ?? options.value[0];
|
|
698
|
+
},
|
|
699
|
+
set: (option) => model.value = option.id
|
|
700
|
+
});
|
|
701
|
+
return (_ctx, _cache) => {
|
|
702
|
+
return openBlock(), createBlock(unref(ScalarCombobox), {
|
|
703
|
+
modelValue: selected.value,
|
|
704
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selected.value = $event),
|
|
705
|
+
options: options.value,
|
|
706
|
+
resize: ""
|
|
707
|
+
}, {
|
|
708
|
+
default: withCtx(({ open }) => [createVNode(unref(ScalarFormInput), null, {
|
|
709
|
+
default: withCtx(() => [
|
|
710
|
+
createElementVNode("div", _hoisted_1$4, toDisplayString(selected.value.label), 1),
|
|
711
|
+
createVNode(unref(ScalarThemeSwatches), {
|
|
712
|
+
class: "mr-2",
|
|
713
|
+
css: selected.value.css
|
|
714
|
+
}, null, 8, ["css"]),
|
|
715
|
+
createVNode(unref(ScalarIconCaretDown), { class: normalizeClass(["size-3.5 transition-transform", { "rotate-180": open }]) }, null, 8, ["class"])
|
|
716
|
+
]),
|
|
717
|
+
_: 2
|
|
718
|
+
}, 1024)]),
|
|
719
|
+
option: withCtx(({ selected, option }) => [
|
|
720
|
+
createVNode(unref(ScalarListboxCheckbox), { selected }, null, 8, ["selected"]),
|
|
721
|
+
createElementVNode("span", _hoisted_2$3, toDisplayString(option.label), 1),
|
|
722
|
+
createVNode(unref(ScalarThemeSwatches), { css: option.css }, null, 8, ["css"])
|
|
723
|
+
]),
|
|
724
|
+
_: 1
|
|
725
|
+
}, 8, ["modelValue", "options"]);
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
//#endregion
|
|
730
|
+
//#region src/features/developer-tools/components/ModifyConfiguration.vue?vue&type=script&setup=true&lang.ts
|
|
731
|
+
var _hoisted_1$3 = { class: "flex flex-col gap-4" };
|
|
732
|
+
//#endregion
|
|
733
|
+
//#region src/features/developer-tools/components/ModifyConfiguration.vue
|
|
734
|
+
var ModifyConfiguration_default = /* @__PURE__ */ defineComponent({
|
|
735
|
+
__name: "ModifyConfiguration",
|
|
736
|
+
props: /* @__PURE__ */ mergeModels({ configuration: {} }, {
|
|
737
|
+
"overrides": {},
|
|
738
|
+
"overridesModifiers": {}
|
|
739
|
+
}),
|
|
740
|
+
emits: ["update:overrides"],
|
|
741
|
+
setup(__props) {
|
|
742
|
+
const overrides = useModel(__props, "overrides");
|
|
743
|
+
const snippet = computed(() => {
|
|
744
|
+
return prettyPrintJson({
|
|
745
|
+
...overrides.value,
|
|
746
|
+
...__props.configuration,
|
|
747
|
+
...overrides.value
|
|
748
|
+
});
|
|
749
|
+
});
|
|
750
|
+
const theme = computed({
|
|
751
|
+
get: () => overrides.value?.theme ?? __props.configuration?.theme ?? "default",
|
|
752
|
+
set: (t) => overrides.value = {
|
|
753
|
+
...overrides.value,
|
|
754
|
+
theme: t
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
const layout = computed({
|
|
758
|
+
get: () => overrides.value?.layout ?? __props.configuration?.layout ?? "modern",
|
|
759
|
+
set: (l) => overrides.value = {
|
|
760
|
+
...overrides.value,
|
|
761
|
+
layout: l
|
|
762
|
+
}
|
|
763
|
+
});
|
|
764
|
+
return (_ctx, _cache) => {
|
|
765
|
+
return openBlock(), createBlock(ApiReferenceToolbarPopover_default, { class: "w-120" }, {
|
|
766
|
+
label: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("Configure", -1)])]),
|
|
767
|
+
default: withCtx(() => [createVNode(unref(ScalarFormSection), null, {
|
|
768
|
+
label: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode("Scalar Configuration", -1)])]),
|
|
769
|
+
default: withCtx(() => [createVNode(unref(ScalarCodeBlock), {
|
|
770
|
+
class: "bg-b-1.5 flex max-h-40 flex-col rounded border text-sm",
|
|
771
|
+
content: snippet.value,
|
|
772
|
+
lang: "json"
|
|
773
|
+
}, null, 8, ["content"])]),
|
|
774
|
+
_: 1
|
|
775
|
+
}), createElementVNode("div", _hoisted_1$3, [
|
|
776
|
+
createVNode(unref(ScalarFormField), null, {
|
|
777
|
+
label: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("Theme", -1)])]),
|
|
778
|
+
default: withCtx(() => [createVNode(ApiReferenceToolbarConfigTheme_default, {
|
|
779
|
+
modelValue: theme.value,
|
|
780
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => theme.value = $event)
|
|
781
|
+
}, null, 8, ["modelValue"])]),
|
|
782
|
+
_: 1
|
|
783
|
+
}),
|
|
784
|
+
createVNode(unref(ScalarFormField), null, {
|
|
785
|
+
label: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode("Layout", -1)])]),
|
|
786
|
+
default: withCtx(() => [createVNode(ApiReferenceToolbarConfigLayout_default, {
|
|
787
|
+
modelValue: layout.value,
|
|
788
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => layout.value = $event)
|
|
789
|
+
}, null, 8, ["modelValue"])]),
|
|
790
|
+
_: 1
|
|
791
|
+
}),
|
|
792
|
+
createVNode(unref(ScalarFormField), { is: "div" }, {
|
|
793
|
+
label: withCtx(() => [..._cache[7] || (_cache[7] = [createTextVNode("Layout Options", -1)])]),
|
|
794
|
+
default: withCtx(() => [createVNode(ApiReferenceToolbarConfigLayoutOptions_default, {
|
|
795
|
+
modelValue: overrides.value,
|
|
796
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => overrides.value = $event),
|
|
797
|
+
configuration: __props.configuration
|
|
798
|
+
}, null, 8, ["modelValue", "configuration"])]),
|
|
799
|
+
_: 1
|
|
800
|
+
})
|
|
801
|
+
])]),
|
|
802
|
+
_: 1
|
|
803
|
+
});
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
});
|
|
807
|
+
//#endregion
|
|
808
|
+
//#region src/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue
|
|
809
|
+
var ApiReferenceToolbarShareTemporary_default = /* @__PURE__ */ defineComponent({
|
|
810
|
+
__name: "ApiReferenceToolbarShareTemporary",
|
|
811
|
+
props: /* @__PURE__ */ mergeModels({ workspace: {} }, {
|
|
812
|
+
"url": {},
|
|
813
|
+
"urlModifiers": {}
|
|
814
|
+
}),
|
|
815
|
+
emits: ["update:url"],
|
|
816
|
+
setup(__props) {
|
|
817
|
+
const { toast } = useToasts();
|
|
818
|
+
const loader = useLoadingState();
|
|
819
|
+
const tempDocUrl = useModel(__props, "url");
|
|
820
|
+
async function generateTemporaryLink() {
|
|
821
|
+
if (loader.isLoading || !__props.workspace || !!tempDocUrl.value) return;
|
|
822
|
+
loader.start();
|
|
823
|
+
const document = __props.workspace.exportActiveDocument("json");
|
|
824
|
+
if (!document) {
|
|
825
|
+
toast("Unable to export active document", "error");
|
|
826
|
+
await loader.invalidate();
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
try {
|
|
830
|
+
const url = await uploadTempDocument(document);
|
|
831
|
+
await loader.validate({
|
|
832
|
+
duration: 900,
|
|
833
|
+
persist: true
|
|
834
|
+
});
|
|
835
|
+
tempDocUrl.value = url;
|
|
836
|
+
} catch (error) {
|
|
837
|
+
toast(error instanceof Error ? error.message : "An unknown error occurred", "error");
|
|
838
|
+
await loader.invalidate();
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
return (_ctx, _cache) => {
|
|
842
|
+
return openBlock(), createElementBlock(Fragment, null, [tempDocUrl.value ? (openBlock(), createBlock(unref(ScalarTextInputCopy), {
|
|
843
|
+
key: 0,
|
|
844
|
+
immediate: "",
|
|
845
|
+
modelValue: tempDocUrl.value,
|
|
846
|
+
name: "temporary-link",
|
|
847
|
+
placeholder: `${unref(REGISTRY_SHARE_URL)}/apis/…`
|
|
848
|
+
}, null, 8, ["modelValue", "placeholder"])) : (openBlock(), createBlock(unref(ScalarButton), {
|
|
849
|
+
key: 1,
|
|
850
|
+
class: "h-auto p-2.5",
|
|
851
|
+
loader: unref(loader),
|
|
852
|
+
variant: "gradient",
|
|
853
|
+
onClick: generateTemporaryLink
|
|
854
|
+
}, {
|
|
855
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Upload Document ", -1)])]),
|
|
856
|
+
_: 1
|
|
857
|
+
}, 8, ["loader"])), createVNode(ApiReferenceToolbarBlurb_default, { class: "-mt-1" }, {
|
|
858
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" Your document will automatically be deleted after 7 days. ", -1)])]),
|
|
859
|
+
_: 1
|
|
860
|
+
})], 64);
|
|
861
|
+
};
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
//#endregion
|
|
865
|
+
//#region src/features/developer-tools/components/ShareApiReference.vue
|
|
866
|
+
var ShareApiReference_default = /* @__PURE__ */ defineComponent({
|
|
867
|
+
__name: "ShareApiReference",
|
|
868
|
+
props: { workspace: {} },
|
|
869
|
+
setup(__props) {
|
|
870
|
+
return (_ctx, _cache) => {
|
|
871
|
+
return openBlock(), createBlock(ApiReferenceToolbarPopover_default, { class: "w-120" }, {
|
|
872
|
+
label: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("Share", -1)])]),
|
|
873
|
+
default: withCtx(() => [createVNode(unref(ScalarFormSection), null, {
|
|
874
|
+
label: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("Share your API Reference", -1)])]),
|
|
875
|
+
default: withCtx(() => [_cache[2] || (_cache[2] = createElementVNode("p", { class: "text-c-2 mb-2 leading-normal" }, " Upload your OpenAPI document to share your API Reference with others. As easy as pressing a button. ", -1)), createVNode(ApiReferenceToolbarShareTemporary_default, { workspace: __props.workspace }, null, 8, ["workspace"])]),
|
|
876
|
+
_: 1
|
|
877
|
+
})]),
|
|
878
|
+
_: 1
|
|
879
|
+
});
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
//#endregion
|
|
884
|
+
//#region src/features/developer-tools/DeveloperTools.vue?vue&type=script&setup=true&lang.ts
|
|
885
|
+
var _hoisted_1$2 = {
|
|
886
|
+
key: 0,
|
|
887
|
+
"aria-label": "Developer Tools",
|
|
888
|
+
class: "api-reference-toolbar bg-b-1 relative z-1 flex h-10 justify-center border-b px-15"
|
|
889
|
+
};
|
|
890
|
+
var _hoisted_2$2 = { class: "-mx-2 flex max-w-(--refs-content-max-width) flex-1 items-center" };
|
|
891
|
+
var _hoisted_3$2 = { class: "flex flex-1 items-center" };
|
|
892
|
+
//#endregion
|
|
893
|
+
//#region src/features/developer-tools/DeveloperTools.vue
|
|
894
|
+
var DeveloperTools_default = /* @__PURE__ */ defineComponent({
|
|
895
|
+
__name: "DeveloperTools",
|
|
896
|
+
props: /* @__PURE__ */ mergeModels({
|
|
897
|
+
workspace: {},
|
|
898
|
+
configuration: {}
|
|
899
|
+
}, {
|
|
900
|
+
"overrides": {},
|
|
901
|
+
"overridesModifiers": {}
|
|
902
|
+
}),
|
|
903
|
+
emits: ["update:overrides"],
|
|
904
|
+
setup(__props) {
|
|
905
|
+
const overrides = useModel(__props, "overrides");
|
|
906
|
+
const showDeveloperTools = computed(() => {
|
|
907
|
+
if (__props.configuration?.showDeveloperTools === "always") return true;
|
|
908
|
+
if (__props.configuration?.showDeveloperTools === "never") return false;
|
|
909
|
+
if (typeof window === "undefined") return false;
|
|
910
|
+
return isLocalUrl(window.location.href);
|
|
911
|
+
});
|
|
912
|
+
return (_ctx, _cache) => {
|
|
913
|
+
return showDeveloperTools.value ? (openBlock(), createElementBlock("header", _hoisted_1$2, [createElementVNode("div", _hoisted_2$2, [
|
|
914
|
+
createElementVNode("div", _hoisted_3$2, [createVNode(ApiReferenceToolbarTitle_default)]),
|
|
915
|
+
createVNode(ModifyConfiguration_default, {
|
|
916
|
+
overrides: overrides.value,
|
|
917
|
+
"onUpdate:overrides": _cache[0] || (_cache[0] = ($event) => overrides.value = $event),
|
|
918
|
+
configuration: __props.configuration
|
|
919
|
+
}, null, 8, ["overrides", "configuration"]),
|
|
920
|
+
__props.workspace ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(ShareApiReference_default, { workspace: __props.workspace }, null, 8, ["workspace"]), createVNode(DeployApiReference_default, { workspace: __props.workspace }, null, 8, ["workspace"])], 64)) : createCommentVNode("", true)
|
|
921
|
+
])])) : createCommentVNode("", true);
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
});
|
|
925
|
+
//#endregion
|
|
926
|
+
//#region src/components/ApiReference.vue?vue&type=script&setup=true&lang.ts
|
|
927
|
+
var _hoisted_1$1 = {
|
|
928
|
+
key: 1,
|
|
929
|
+
class: "flex gap-1.5 px-3 pt-3"
|
|
930
|
+
};
|
|
931
|
+
var _hoisted_2$1 = { key: 1 };
|
|
932
|
+
var _hoisted_3$1 = ["aria-label", "inert"];
|
|
933
|
+
var _hoisted_4$1 = { class: "w-64 empty:hidden" };
|
|
934
|
+
var _hoisted_5$1 = {
|
|
935
|
+
key: 2,
|
|
936
|
+
class: "references-footer"
|
|
937
|
+
};
|
|
938
|
+
//#endregion
|
|
939
|
+
//#region src/components/ApiReference.vue
|
|
940
|
+
var ApiReference_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
941
|
+
__name: "ApiReference",
|
|
942
|
+
props: { configuration: {} },
|
|
943
|
+
setup(__props, { expose: __expose }) {
|
|
944
|
+
const props = __props;
|
|
945
|
+
const { mediaQueries } = useBreakpoints();
|
|
946
|
+
const { copyToClipboard } = useClipboard();
|
|
947
|
+
/**
|
|
948
|
+
* Used to inject the environment into built packages
|
|
949
|
+
*
|
|
950
|
+
* Primary use case is the open-in-client button
|
|
951
|
+
*/
|
|
952
|
+
const isDevelopment = false;
|
|
953
|
+
const obtrusiveScrollbars = computed(hasObtrusiveScrollbars);
|
|
954
|
+
const eventBus = createWorkspaceEventBus({ debug: isDevelopment });
|
|
955
|
+
const isSidebarOpen = ref(false);
|
|
956
|
+
watch(() => mediaQueries?.lg?.value, (newValue, oldValue) => {
|
|
957
|
+
if (oldValue && !newValue) isSidebarOpen.value = false;
|
|
958
|
+
});
|
|
959
|
+
/**
|
|
960
|
+
* Due to a bug in headless UI, we need to set an ID here that can be shared across server/client
|
|
961
|
+
* TODO remove this once the bug is fixed
|
|
962
|
+
*
|
|
963
|
+
* @see https://github.com/tailwindlabs/headlessui/issues/2979
|
|
964
|
+
*/
|
|
965
|
+
provideUseId(() => useId());
|
|
966
|
+
/**
|
|
967
|
+
* Configuration Handling
|
|
968
|
+
*
|
|
969
|
+
* We will normalize the configurations and store them in a computed property.
|
|
970
|
+
* The active configuration will be associated with the active document.
|
|
971
|
+
*/
|
|
972
|
+
const configList = computed(() => normalizeConfigurations(props.configuration));
|
|
973
|
+
const isMultiDocument = computed(() => Object.keys(configList.value).length > 1);
|
|
974
|
+
/** Search for the source with a default attribute or use the first one */
|
|
975
|
+
const activeSlug = ref(Object.values(configList.value).find((c) => c.default)?.slug ?? configList.value[Object.keys(configList.value)?.[0] ?? ""]?.slug ?? "");
|
|
976
|
+
/**
|
|
977
|
+
* On initial page load we need to determine if there is a valid document slug in the URL
|
|
978
|
+
*
|
|
979
|
+
* If there is we set the active slug to the document slug
|
|
980
|
+
*/
|
|
981
|
+
if (typeof window !== "undefined") {
|
|
982
|
+
const url = new URL(window.location.href);
|
|
983
|
+
const apiParam = url.searchParams.get("api");
|
|
984
|
+
if (apiParam && configList.value[apiParam]) {
|
|
985
|
+
activeSlug.value = apiParam;
|
|
986
|
+
const newUrl = makeUrlFromId(getIdFromUrl(url, configList.value[apiParam].config.pathRouting?.basePath, apiParam), configList.value[apiParam].config.pathRouting?.basePath, isMultiDocument.value);
|
|
987
|
+
if (newUrl) {
|
|
988
|
+
newUrl.searchParams.delete("api");
|
|
989
|
+
window.history.replaceState({}, "", newUrl.toString());
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
const documentSlug = getIdFromUrl(url, Object.values(configList.value).map((c) => c.config.pathRouting?.basePath).find((p) => p ? matchesBasePath(url, p) : false), isMultiDocument.value ? void 0 : activeSlug.value).split("/")[0];
|
|
993
|
+
if (documentSlug && configList.value[documentSlug]) activeSlug.value = documentSlug;
|
|
994
|
+
}
|
|
995
|
+
/** Computed document options list for the selector logic */
|
|
996
|
+
const documentOptionList = computed(() => Object.values(configList.value).map((c) => ({
|
|
997
|
+
label: c.title,
|
|
998
|
+
id: c.slug
|
|
999
|
+
})));
|
|
1000
|
+
/** Configuration overrides to apply to the selected document (from the localhost toolbar) */
|
|
1001
|
+
const configurationOverrides = ref({});
|
|
1002
|
+
/** Any dev toolbar modifications are merged with the active configuration */
|
|
1003
|
+
const mergedConfig = computed(() => ({
|
|
1004
|
+
...apiReferenceConfigurationSchema.parse({}),
|
|
1005
|
+
...configList.value[activeSlug.value]?.config,
|
|
1006
|
+
...configurationOverrides.value
|
|
1007
|
+
}));
|
|
1008
|
+
/** Convenience break out var to determine which routing mode we are using */
|
|
1009
|
+
const basePath = computed(() => mergedConfig.value.pathRouting?.basePath);
|
|
1010
|
+
const themeStyle = computed(() => getThemeStyles(mergedConfig.value.theme, { fonts: mergedConfig.value.withDefaultFonts }));
|
|
1011
|
+
/** Plugin injection is not reactive. All plugins must be provided at first render */
|
|
1012
|
+
provide(PLUGIN_MANAGER_SYMBOL, createPluginManager({ plugins: Object.values(configList.value).flatMap((c) => c.config.plugins ?? []) }));
|
|
1013
|
+
/** Navigation State Handling */
|
|
1014
|
+
if (mergedConfig.value.redirect && typeof window !== "undefined") {
|
|
1015
|
+
const newPath = mergedConfig.value.redirect((mergedConfig.value.pathRouting ? window.location.pathname : "") + window.location.hash);
|
|
1016
|
+
if (newPath) window.history.replaceState({}, "", newPath);
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Sets the active slug and updates the URL with the selected document slug
|
|
1020
|
+
*
|
|
1021
|
+
* If an element ID is passed in we will configure the path or hash routing
|
|
1022
|
+
*/
|
|
1023
|
+
function syncSlugAndUrlWithDocument(slug, elementId, config) {
|
|
1024
|
+
const url = makeUrlFromId(elementId || slug, config.pathRouting?.basePath, isMultiDocument.value);
|
|
1025
|
+
if (url) window.history.replaceState({}, "", url.toString());
|
|
1026
|
+
activeSlug.value = slug;
|
|
1027
|
+
}
|
|
1028
|
+
/** Workspace Store Initialization */
|
|
1029
|
+
/**
|
|
1030
|
+
* Initializes the new client workspace store.
|
|
1031
|
+
*/
|
|
1032
|
+
const workspaceStore = createWorkspaceStore({
|
|
1033
|
+
verbose: isDevelopment,
|
|
1034
|
+
plugins: [persistencePlugin({
|
|
1035
|
+
prefix: () => activeSlug.value,
|
|
1036
|
+
persistAuth: () => mergedConfig.value.persistAuth ?? false
|
|
1037
|
+
})]
|
|
1038
|
+
});
|
|
1039
|
+
const { toggleColorMode, isDarkMode } = useColorMode({
|
|
1040
|
+
initialColorMode: {
|
|
1041
|
+
true: "dark",
|
|
1042
|
+
false: "light",
|
|
1043
|
+
undefined: "system"
|
|
1044
|
+
}[String(mergedConfig.value.darkMode)],
|
|
1045
|
+
overrideColorMode: mergedConfig.value.forceDarkModeState
|
|
1046
|
+
});
|
|
1047
|
+
/** Initialize the sidebar */
|
|
1048
|
+
const sidebarState = createSidebarState(computed(() => {
|
|
1049
|
+
return Object.entries(workspaceStore.workspace.documents).map(([slug, document]) => ({
|
|
1050
|
+
id: slug,
|
|
1051
|
+
type: "document",
|
|
1052
|
+
description: document.info.description,
|
|
1053
|
+
name: document.info.title ?? slug,
|
|
1054
|
+
title: document.info.title ?? slug,
|
|
1055
|
+
children: document?.["x-scalar-navigation"]?.children ?? []
|
|
1056
|
+
}));
|
|
1057
|
+
}), { hooks: {} });
|
|
1058
|
+
/** Recursively set all children of the given items to open */
|
|
1059
|
+
const setChildrenOpen = (items) => {
|
|
1060
|
+
items.forEach((item) => {
|
|
1061
|
+
if (item.type === "tag" || item.type === "models") sidebarState.setExpanded(item.id, true);
|
|
1062
|
+
if ("children" in item && item.children) setChildrenOpen(item.children);
|
|
1063
|
+
});
|
|
1064
|
+
};
|
|
1065
|
+
/** We get the sub items for the sidebar based on the configuration/document slug */
|
|
1066
|
+
const sidebarItems = computed(() => {
|
|
1067
|
+
const config = mergedConfig.value;
|
|
1068
|
+
if (!config) return [];
|
|
1069
|
+
const docItems = sidebarState.items.value.find((item) => item.id === activeSlug.value)?.children ?? [];
|
|
1070
|
+
if (config.defaultOpenAllTags) setChildrenOpen(docItems);
|
|
1071
|
+
if (config.expandAllModelSections) {
|
|
1072
|
+
const models = docItems.find((item) => item.type === "models");
|
|
1073
|
+
if (models) {
|
|
1074
|
+
sidebarState.setExpanded(models.id, true);
|
|
1075
|
+
models.children?.forEach((child) => {
|
|
1076
|
+
sidebarState.setExpanded(child.id, true);
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
return docItems;
|
|
1081
|
+
});
|
|
1082
|
+
/** Find the sidebar entry that represents the introduction section */
|
|
1083
|
+
const infoSectionId = computed(() => sidebarItems.value.find((item) => item.type === "text" && item.title === "Introduction")?.id);
|
|
1084
|
+
/** User for mobile navigation */
|
|
1085
|
+
const breadcrumb = ref("");
|
|
1086
|
+
const slotProps = computed(() => ({ breadcrumb: breadcrumb.value }));
|
|
1087
|
+
const setBreadcrumb = (id) => {
|
|
1088
|
+
const item = sidebarState.getEntryById(id);
|
|
1089
|
+
if (!item || item.type === "document") breadcrumb.value = "";
|
|
1090
|
+
else breadcrumb.value = item.title;
|
|
1091
|
+
};
|
|
1092
|
+
const scrollToLazyElement = (id) => {
|
|
1093
|
+
setBreadcrumb(id);
|
|
1094
|
+
sidebarState.setSelected(id);
|
|
1095
|
+
scrollToLazy(id, sidebarState.setExpanded, sidebarState.getEntryById);
|
|
1096
|
+
};
|
|
1097
|
+
/** Maps some config values to the workspace store to keep it reactive */
|
|
1098
|
+
mapConfigToWorkspaceStore({
|
|
1099
|
+
config: () => mergedConfig.value,
|
|
1100
|
+
store: workspaceStore,
|
|
1101
|
+
isDarkMode
|
|
1102
|
+
});
|
|
1103
|
+
/** Merged environment variables from workspace and document levels */
|
|
1104
|
+
const environment = computed(() => getActiveEnvironment(workspaceStore, workspaceStore.workspace.activeDocument ?? null));
|
|
1105
|
+
if (typeof window !== "undefined") window.dataDumpWorkspace = () => workspaceStore;
|
|
1106
|
+
__expose({
|
|
1107
|
+
eventBus,
|
|
1108
|
+
workspaceStore,
|
|
1109
|
+
sidebarItems
|
|
1110
|
+
});
|
|
1111
|
+
/**
|
|
1112
|
+
* Handle changing the active document
|
|
1113
|
+
*
|
|
1114
|
+
* 1. If the document has not be loaded to the workspace store we set it to empty and asynchronously load it
|
|
1115
|
+
* 2. If the document has been loaded to the workspace store we just set it to active
|
|
1116
|
+
* 3. If the content from the configuration has changes we need to update the document in the workspace store
|
|
1117
|
+
*/
|
|
1118
|
+
const changeSelectedDocument = async (slug, elementId) => {
|
|
1119
|
+
const normalized = configList.value[slug];
|
|
1120
|
+
if (!normalized) {
|
|
1121
|
+
console.warn(`Document ${slug} not found in configList`);
|
|
1122
|
+
return;
|
|
1123
|
+
}
|
|
1124
|
+
const config = {
|
|
1125
|
+
...normalized.config,
|
|
1126
|
+
...configurationOverrides.value
|
|
1127
|
+
};
|
|
1128
|
+
const onDocumentSelectPromise = config.onDocumentSelect?.();
|
|
1129
|
+
syncSlugAndUrlWithDocument(slug, elementId, config);
|
|
1130
|
+
apiClient.value?.route({
|
|
1131
|
+
documentSlug: slug,
|
|
1132
|
+
method: "get",
|
|
1133
|
+
path: "/"
|
|
1134
|
+
});
|
|
1135
|
+
if (!workspaceStore.workspace.documents[slug]) {
|
|
1136
|
+
const result = await workspaceStore.addDocument(normalized.source.url ? {
|
|
1137
|
+
name: slug,
|
|
1138
|
+
url: normalized.source.url,
|
|
1139
|
+
fetch: config.fetch
|
|
1140
|
+
} : {
|
|
1141
|
+
name: slug,
|
|
1142
|
+
document: normalized.source.content ?? {}
|
|
1143
|
+
}, config);
|
|
1144
|
+
const document = workspaceStore.workspace.documents[slug];
|
|
1145
|
+
if (result === true && document !== void 0 && document["x-scalar-selected-server"] === void 0) {
|
|
1146
|
+
const servers = getServers(normalized.config.servers ?? document.servers, {
|
|
1147
|
+
baseServerUrl: mergedConfig.value.baseServerURL,
|
|
1148
|
+
documentUrl: normalized.source.url
|
|
1149
|
+
});
|
|
1150
|
+
if (servers.length > 0) workspaceStore.updateDocument(slug, "x-scalar-selected-server", servers[0].url);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
workspaceStore.update("x-scalar-active-document", slug);
|
|
1154
|
+
if (config.persistAuth) loadAuthFromStorage(workspaceStore, slug);
|
|
1155
|
+
(async () => {
|
|
1156
|
+
await onDocumentSelectPromise;
|
|
1157
|
+
config.onLoaded?.(slug);
|
|
1158
|
+
})();
|
|
1159
|
+
if (elementId && elementId !== slug) scrollToLazyElement(elementId);
|
|
1160
|
+
else if (config.defaultOpenFirstTag) {
|
|
1161
|
+
const firstTag = sidebarItems.value.find((item) => item.type === "tag");
|
|
1162
|
+
if (firstTag) sidebarState.setExpanded(firstTag.id, true);
|
|
1163
|
+
}
|
|
1164
|
+
};
|
|
1165
|
+
/**
|
|
1166
|
+
* TODO:Move this to a dedicated updateDocument function in the future and
|
|
1167
|
+
* away from vue-reactivity based updates
|
|
1168
|
+
*/
|
|
1169
|
+
watch(() => Object.values(configList.value), async (newConfigList, oldConfigList) => {
|
|
1170
|
+
/**
|
|
1171
|
+
* Handles replacing and updating documents within the workspace store
|
|
1172
|
+
* when we detect configuration changes.
|
|
1173
|
+
*/
|
|
1174
|
+
const updateSource = async (updated, previous) => {
|
|
1175
|
+
/** If we have not loaded the document previously we don't need to handle any updates to store */
|
|
1176
|
+
if (!workspaceStore.workspace.documents[updated.slug]) return;
|
|
1177
|
+
/** If the URL has changed we fetch and rebase */
|
|
1178
|
+
if (updated.source.url && updated.source.url !== previous?.source.url) {
|
|
1179
|
+
await workspaceStore.addDocument({
|
|
1180
|
+
name: updated.slug,
|
|
1181
|
+
url: updated.source.url,
|
|
1182
|
+
fetch: updated.config.fetch
|
|
1183
|
+
}, updated.config);
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1186
|
+
if (!updated.source.content) return;
|
|
1187
|
+
/**
|
|
1188
|
+
* We need to deeply check for document changes. Parse documents and then only rebase
|
|
1189
|
+
* if we detect deep changes in the two sources
|
|
1190
|
+
*/
|
|
1191
|
+
if (diff(updated.source.content, previous && "content" in previous.source ? previous.source.content ?? {} : {}).length) await workspaceStore.addDocument({
|
|
1192
|
+
name: updated.slug,
|
|
1193
|
+
document: updated.source.content
|
|
1194
|
+
}, updated.config);
|
|
1195
|
+
};
|
|
1196
|
+
newConfigList.forEach((newConfig, index) => updateSource(newConfig, oldConfigList[index]));
|
|
1197
|
+
const newSlugs = newConfigList.map((c) => c.slug);
|
|
1198
|
+
const oldSlugs = oldConfigList.map((c) => c.slug);
|
|
1199
|
+
if (newSlugs.length !== oldSlugs.length || !newSlugs.every((slug, index) => slug === oldSlugs[index])) await changeSelectedDocument(newSlugs[0] ?? "");
|
|
1200
|
+
}, { deep: true });
|
|
1201
|
+
/** Preload the first document during SSR */
|
|
1202
|
+
onServerPrefetch(() => changeSelectedDocument(activeSlug.value));
|
|
1203
|
+
/** Load the first document on page load */
|
|
1204
|
+
onBeforeMount(async () => {
|
|
1205
|
+
loadClientFromStorage(workspaceStore);
|
|
1206
|
+
await changeSelectedDocument(activeSlug.value, getIdFromUrl(window.location.href, configList.value[activeSlug.value]?.config.pathRouting?.basePath, isMultiDocument.value ? void 0 : activeSlug.value));
|
|
1207
|
+
});
|
|
1208
|
+
const documentUrl = computed(() => {
|
|
1209
|
+
return configList.value[activeSlug.value]?.source?.url;
|
|
1210
|
+
});
|
|
1211
|
+
/**
|
|
1212
|
+
* Determines if Agent Scalar should be enabled based on the configuration and the current URL
|
|
1213
|
+
*
|
|
1214
|
+
* - If the agent is disabled in the configuration, it should not be enabled
|
|
1215
|
+
* - If the current URL is a local URL, it should be enabled
|
|
1216
|
+
* - If the agent key is set, it should be enabled
|
|
1217
|
+
*/
|
|
1218
|
+
const agent = useAgent({ agentEnabled: computed(() => {
|
|
1219
|
+
if (configList.value[activeSlug.value]?.agent?.disabled) return false;
|
|
1220
|
+
if (typeof window !== "undefined" && isLocalUrl(window.location.href)) return true;
|
|
1221
|
+
return Boolean(configList.value[activeSlug.value]?.agent?.key);
|
|
1222
|
+
}) });
|
|
1223
|
+
provide(AGENT_CONTEXT_SYMBOL, agent);
|
|
1224
|
+
const modal = useTemplateRef("modal");
|
|
1225
|
+
const apiClient = ref(null);
|
|
1226
|
+
onMounted(() => {
|
|
1227
|
+
if (!modal.value) return;
|
|
1228
|
+
apiClient.value = createApiClientModal({
|
|
1229
|
+
el: modal.value,
|
|
1230
|
+
eventBus,
|
|
1231
|
+
workspaceStore,
|
|
1232
|
+
options: mergedConfig,
|
|
1233
|
+
plugins: mapConfigPlugins(mergedConfig)
|
|
1234
|
+
});
|
|
1235
|
+
});
|
|
1236
|
+
onBeforeUnmount(() => {
|
|
1237
|
+
apiClient.value?.app.unmount();
|
|
1238
|
+
});
|
|
1239
|
+
/** Ensure we call the onServerChange callback */
|
|
1240
|
+
eventBus.on("server:update:selected", ({ url }) => mergedConfig.value.onServerChange?.(url));
|
|
1241
|
+
/** Download the document from the store */
|
|
1242
|
+
eventBus.on("ui:download:document", async ({ format }) => {
|
|
1243
|
+
const document = await workspaceStore.exportActiveDocument(format);
|
|
1244
|
+
if (!document) {
|
|
1245
|
+
console.error("No document found to download");
|
|
1246
|
+
return;
|
|
1247
|
+
}
|
|
1248
|
+
downloadDocument(document, activeSlug.value ?? "openapi", format);
|
|
1249
|
+
});
|
|
1250
|
+
/**
|
|
1251
|
+
* Handler for a direct navigation event such as a sidebar or search click
|
|
1252
|
+
*
|
|
1253
|
+
* Depending on the item type we handle a selection event differently:
|
|
1254
|
+
*
|
|
1255
|
+
* - Tag: If a tag is closed we open it and all its parents and scroll to it
|
|
1256
|
+
* If a tag is open we just close the tag
|
|
1257
|
+
* - Operation:
|
|
1258
|
+
* Open all parents and scroll to the operation
|
|
1259
|
+
*/
|
|
1260
|
+
const handleSelectSidebarEntry = (id, caller) => {
|
|
1261
|
+
const item = sidebarState.getEntryById(id);
|
|
1262
|
+
if ((item?.type === "tag" || item?.type === "models" || item?.type === "text") && sidebarState.isExpanded(id) && sidebarState.selectedItem.value === id) {
|
|
1263
|
+
const unblock = blockIntersection();
|
|
1264
|
+
sidebarState.setExpanded(id, false);
|
|
1265
|
+
unblock();
|
|
1266
|
+
return;
|
|
1267
|
+
}
|
|
1268
|
+
if (item?.type !== "tag" && item?.type !== "models") isSidebarOpen.value = false;
|
|
1269
|
+
scrollToLazyElement(id);
|
|
1270
|
+
const url = makeUrlFromId(id, basePath.value, isMultiDocument.value);
|
|
1271
|
+
if (url) {
|
|
1272
|
+
window.history.pushState({}, "", url);
|
|
1273
|
+
if (caller === "sidebar") mergedConfig.value.onSidebarClick?.(url.toString());
|
|
1274
|
+
}
|
|
1275
|
+
if (agent.showAgent.value) agent.closeAgent();
|
|
1276
|
+
};
|
|
1277
|
+
/** Handle a navigation item selection event */
|
|
1278
|
+
eventBus.on("select:nav-item", ({ id }) => handleSelectSidebarEntry(id));
|
|
1279
|
+
/** Handle a scroll to navigation item event */
|
|
1280
|
+
eventBus.on("scroll-to:nav-item", ({ id }) => handleSelectSidebarEntry(id));
|
|
1281
|
+
/** Handle an intersecting navigation item event */
|
|
1282
|
+
eventBus.on("intersecting:nav-item", ({ id }) => {
|
|
1283
|
+
if (!intersectionEnabled.value) return;
|
|
1284
|
+
sidebarState.setSelected(id);
|
|
1285
|
+
setBreadcrumb(id);
|
|
1286
|
+
scrollSidebarToTop(id);
|
|
1287
|
+
const url = makeUrlFromId(id, basePath.value, isMultiDocument.value);
|
|
1288
|
+
if (url && workspaceStore.workspace.activeDocument) window.history.replaceState({}, "", url.toString());
|
|
1289
|
+
});
|
|
1290
|
+
eventBus.on("toggle:nav-item", ({ id, open }) => {
|
|
1291
|
+
if (open) {
|
|
1292
|
+
mergedConfig.value.onShowMore?.(id);
|
|
1293
|
+
const entry = sidebarState.getEntryById(id);
|
|
1294
|
+
if (entry && "children" in entry && entry.children) {
|
|
1295
|
+
const first = entry.children[0];
|
|
1296
|
+
if (first) addToPriorityQueue(first.id);
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
sidebarState.setExpanded(id, open ?? !sidebarState.isExpanded(id));
|
|
1300
|
+
});
|
|
1301
|
+
eventBus.on("copy-url:nav-item", ({ id }) => {
|
|
1302
|
+
const url = makeUrlFromId(id, basePath.value, isMultiDocument.value)?.toString();
|
|
1303
|
+
return url && copyToClipboard(url);
|
|
1304
|
+
});
|
|
1305
|
+
onBeforeMount(() => {
|
|
1306
|
+
window.history.scrollRestoration = "manual";
|
|
1307
|
+
addScalarClassesToHeadless();
|
|
1308
|
+
window.addEventListener("popstate", () => {
|
|
1309
|
+
const id = getIdFromUrl(window.location.href, mergedConfig.value.pathRouting?.basePath, isMultiDocument.value ? void 0 : activeSlug.value);
|
|
1310
|
+
if (id) scrollToLazyElement(id);
|
|
1311
|
+
});
|
|
1312
|
+
});
|
|
1313
|
+
const documentStartRef = useTemplateRef("documentStartRef");
|
|
1314
|
+
useIntersection(documentStartRef, () => {
|
|
1315
|
+
eventBus.emit("intersecting:nav-item", { id: activeSlug.value });
|
|
1316
|
+
});
|
|
1317
|
+
const colorMode = computed(() => {
|
|
1318
|
+
const mode = workspaceStore.workspace["x-scalar-color-mode"];
|
|
1319
|
+
if (mode === "system") return getSystemModePreference();
|
|
1320
|
+
return mode;
|
|
1321
|
+
});
|
|
1322
|
+
const bodyScrollLocked = useScrollLock(typeof document !== "undefined" ? document.body : null);
|
|
1323
|
+
watch(agent.showAgent, () => bodyScrollLocked.value = agent.showAgent.value);
|
|
1324
|
+
const showMCPButton = computed(() => {
|
|
1325
|
+
if (mergedConfig.value.mcp?.disabled) return false;
|
|
1326
|
+
if (typeof window !== "undefined" && isLocalUrl(window.location.href)) return true;
|
|
1327
|
+
if (mergedConfig.value.mcp) return true;
|
|
1328
|
+
return false;
|
|
1329
|
+
});
|
|
1330
|
+
return (_ctx, _cache) => {
|
|
1331
|
+
return openBlock(), createElementBlock("div", null, [
|
|
1332
|
+
(openBlock(), createBlock(resolveDynamicComponent("style"), null, {
|
|
1333
|
+
default: withCtx(() => [createTextVNode(toDisplayString(mergedConfig.value.customCss) + " " + toDisplayString(themeStyle.value), 1)]),
|
|
1334
|
+
_: 1
|
|
1335
|
+
})),
|
|
1336
|
+
createElementVNode("div", {
|
|
1337
|
+
ref: "documentEl",
|
|
1338
|
+
class: normalizeClass(["scalar-app scalar-api-reference references-layout", [{
|
|
1339
|
+
"scalar-api-references-standalone-mobile": mergedConfig.value.showSidebar,
|
|
1340
|
+
"scalar-scrollbars-obtrusive": obtrusiveScrollbars.value,
|
|
1341
|
+
"references-editable": mergedConfig.value.isEditable,
|
|
1342
|
+
"references-sidebar": mergedConfig.value.showSidebar,
|
|
1343
|
+
"references-sidebar-mobile-open": isSidebarOpen.value,
|
|
1344
|
+
"references-classic": mergedConfig.value.layout === "classic"
|
|
1345
|
+
}, _ctx.$attrs.class]])
|
|
1346
|
+
}, [
|
|
1347
|
+
unref(agent).agentEnabled.value ? (openBlock(), createBlock(unref(AgentScalarDrawer_default), {
|
|
1348
|
+
key: 0,
|
|
1349
|
+
agentScalarConfiguration: configList.value[activeSlug.value]?.agent,
|
|
1350
|
+
eventBus: unref(eventBus),
|
|
1351
|
+
workspaceStore: unref(workspaceStore)
|
|
1352
|
+
}, null, 8, [
|
|
1353
|
+
"agentScalarConfiguration",
|
|
1354
|
+
"eventBus",
|
|
1355
|
+
"workspaceStore"
|
|
1356
|
+
])) : createCommentVNode("", true),
|
|
1357
|
+
mergedConfig.value.layout === "modern" ? (openBlock(), createBlock(MobileHeader_default, {
|
|
1358
|
+
key: 1,
|
|
1359
|
+
breadcrumb: breadcrumb.value,
|
|
1360
|
+
isSidebarOpen: isSidebarOpen.value,
|
|
1361
|
+
showSidebar: mergedConfig.value.showSidebar,
|
|
1362
|
+
onToggleSidebar: _cache[3] || (_cache[3] = () => isSidebarOpen.value = !isSidebarOpen.value)
|
|
1363
|
+
}, {
|
|
1364
|
+
search: withCtx(() => [!mergedConfig.value.hideSearch ? (openBlock(), createBlock(SearchButton_default, {
|
|
1365
|
+
key: 0,
|
|
1366
|
+
class: "my-2",
|
|
1367
|
+
document: unref(workspaceStore).workspace.activeDocument,
|
|
1368
|
+
eventBus: unref(eventBus),
|
|
1369
|
+
hideModels: mergedConfig.value.hideModels,
|
|
1370
|
+
searchHotKey: mergedConfig.value.searchHotKey,
|
|
1371
|
+
showSidebar: mergedConfig.value.showSidebar
|
|
1372
|
+
}, null, 8, [
|
|
1373
|
+
"document",
|
|
1374
|
+
"eventBus",
|
|
1375
|
+
"hideModels",
|
|
1376
|
+
"searchHotKey",
|
|
1377
|
+
"showSidebar"
|
|
1378
|
+
])) : createCommentVNode("", true)]),
|
|
1379
|
+
sidebar: withCtx(({ sidebarClasses }) => [mergedConfig.value.showSidebar && mergedConfig.value.layout === "modern" ? (openBlock(), createBlock(unref(ScalarSidebar), {
|
|
1380
|
+
key: 0,
|
|
1381
|
+
"aria-label": `Sidebar for ${unref(workspaceStore).workspace.activeDocument?.info?.title}`,
|
|
1382
|
+
class: normalizeClass(["t-doc__sidebar", sidebarClasses]),
|
|
1383
|
+
isExpanded: unref(sidebarState).isExpanded,
|
|
1384
|
+
isSelected: unref(sidebarState).isSelected,
|
|
1385
|
+
items: sidebarItems.value,
|
|
1386
|
+
layout: "reference",
|
|
1387
|
+
options: mergedConfig.value,
|
|
1388
|
+
role: "navigation",
|
|
1389
|
+
onSelectItem: _cache[1] || (_cache[1] = (id) => handleSelectSidebarEntry(id, "sidebar")),
|
|
1390
|
+
onToggleGroup: _cache[2] || (_cache[2] = (id) => unref(sidebarState).setExpanded(id, !unref(sidebarState).isExpanded(id)))
|
|
1391
|
+
}, {
|
|
1392
|
+
header: withCtx(() => [
|
|
1393
|
+
documentOptionList.value.length > 1 ? (openBlock(), createBlock(DocumentSelector_default, {
|
|
1394
|
+
key: 0,
|
|
1395
|
+
class: "p-3 pb-0",
|
|
1396
|
+
modelValue: activeSlug.value,
|
|
1397
|
+
options: documentOptionList.value,
|
|
1398
|
+
"onUpdate:modelValue": changeSelectedDocument
|
|
1399
|
+
}, null, 8, ["modelValue", "options"])) : createCommentVNode("", true),
|
|
1400
|
+
!mergedConfig.value.hideSearch ? (openBlock(), createElementBlock("div", _hoisted_1$1, [createVNode(SearchButton_default, {
|
|
1401
|
+
document: unref(workspaceStore).workspace.activeDocument,
|
|
1402
|
+
eventBus: unref(eventBus),
|
|
1403
|
+
hideModels: mergedConfig.value.hideModels,
|
|
1404
|
+
searchHotKey: mergedConfig.value.searchHotKey
|
|
1405
|
+
}, null, 8, [
|
|
1406
|
+
"document",
|
|
1407
|
+
"eventBus",
|
|
1408
|
+
"hideModels",
|
|
1409
|
+
"searchHotKey"
|
|
1410
|
+
]), unref(agent).agentEnabled.value ? (openBlock(), createBlock(unref(AgentScalarButton_default), { key: 0 })) : createCommentVNode("", true)])) : createCommentVNode("", true),
|
|
1411
|
+
renderSlot(_ctx.$slots, "sidebar-start", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
|
|
1412
|
+
]),
|
|
1413
|
+
footer: withCtx(() => [renderSlot(_ctx.$slots, "sidebar-end", normalizeProps(guardReactiveProps(slotProps.value)), () => [createVNode(unref(ScalarSidebarFooter), { class: "darklight-reference" }, {
|
|
1414
|
+
toggle: withCtx(() => [!mergedConfig.value.hideDarkModeToggle && !mergedConfig.value.forceDarkModeState ? (openBlock(), createBlock(unref(ScalarColorModeToggleButton), {
|
|
1415
|
+
key: 0,
|
|
1416
|
+
modelValue: colorMode.value === "dark",
|
|
1417
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = () => unref(toggleColorMode)())
|
|
1418
|
+
}, null, 8, ["modelValue"])) : (openBlock(), createElementBlock("span", _hoisted_2$1))]),
|
|
1419
|
+
default: withCtx(() => [!mergedConfig.value.hideClientButton && !showMCPButton.value ? (openBlock(), createBlock(unref(OpenApiClientButton), {
|
|
1420
|
+
key: 0,
|
|
1421
|
+
buttonSource: "sidebar",
|
|
1422
|
+
integration: mergedConfig.value._integration,
|
|
1423
|
+
isDevelopment: unref(isDevelopment),
|
|
1424
|
+
url: documentUrl.value
|
|
1425
|
+
}, null, 8, [
|
|
1426
|
+
"integration",
|
|
1427
|
+
"isDevelopment",
|
|
1428
|
+
"url"
|
|
1429
|
+
])) : createCommentVNode("", true), showMCPButton.value ? (openBlock(), createBlock(unref(OpenMCPButton_default), {
|
|
1430
|
+
key: 1,
|
|
1431
|
+
config: mergedConfig.value.mcp,
|
|
1432
|
+
isDevelopment: unref(isDevelopment),
|
|
1433
|
+
url: documentUrl.value,
|
|
1434
|
+
workspace: unref(workspaceStore)
|
|
1435
|
+
}, null, 8, [
|
|
1436
|
+
"config",
|
|
1437
|
+
"isDevelopment",
|
|
1438
|
+
"url",
|
|
1439
|
+
"workspace"
|
|
1440
|
+
])) : createCommentVNode("", true)]),
|
|
1441
|
+
_: 1
|
|
1442
|
+
})], true)]),
|
|
1443
|
+
_: 3
|
|
1444
|
+
}, 8, [
|
|
1445
|
+
"aria-label",
|
|
1446
|
+
"class",
|
|
1447
|
+
"isExpanded",
|
|
1448
|
+
"isSelected",
|
|
1449
|
+
"items",
|
|
1450
|
+
"options"
|
|
1451
|
+
])) : createCommentVNode("", true)]),
|
|
1452
|
+
_: 3
|
|
1453
|
+
}, 8, [
|
|
1454
|
+
"breadcrumb",
|
|
1455
|
+
"isSidebarOpen",
|
|
1456
|
+
"showSidebar"
|
|
1457
|
+
])) : createCommentVNode("", true),
|
|
1458
|
+
createElementVNode("main", {
|
|
1459
|
+
"aria-label": `Open API Documentation for ${unref(workspaceStore).workspace.activeDocument?.info?.title}`,
|
|
1460
|
+
class: "references-rendered",
|
|
1461
|
+
inert: unref(agent).showAgent.value
|
|
1462
|
+
}, [createVNode(Content_default, {
|
|
1463
|
+
authStore: unref(workspaceStore).auth,
|
|
1464
|
+
document: unref(workspaceStore).workspace.activeDocument,
|
|
1465
|
+
environment: environment.value,
|
|
1466
|
+
eventBus: unref(eventBus),
|
|
1467
|
+
expandedItems: unref(sidebarState).expandedItems.value,
|
|
1468
|
+
headingSlugGenerator: mergedConfig.value.generateHeadingSlug ?? ((heading) => `${activeSlug.value}/description/${heading.slug}`),
|
|
1469
|
+
infoSectionId: infoSectionId.value ?? "description/introduction",
|
|
1470
|
+
items: sidebarItems.value,
|
|
1471
|
+
options: mergedConfig.value,
|
|
1472
|
+
xScalarDefaultClient: unref(workspaceStore).workspace["x-scalar-default-client"]
|
|
1473
|
+
}, createSlots({
|
|
1474
|
+
start: withCtx(() => [
|
|
1475
|
+
unref(workspaceStore).workspace.activeDocument && unref(mediaQueries).lg.value ? (openBlock(), createBlock(unref(DeveloperTools_default), {
|
|
1476
|
+
key: 0,
|
|
1477
|
+
overrides: configurationOverrides.value,
|
|
1478
|
+
"onUpdate:overrides": _cache[4] || (_cache[4] = ($event) => configurationOverrides.value = $event),
|
|
1479
|
+
configuration: mergedConfig.value,
|
|
1480
|
+
workspace: unref(workspaceStore)
|
|
1481
|
+
}, null, 8, [
|
|
1482
|
+
"overrides",
|
|
1483
|
+
"configuration",
|
|
1484
|
+
"workspace"
|
|
1485
|
+
])) : createCommentVNode("", true),
|
|
1486
|
+
createElementVNode("div", {
|
|
1487
|
+
ref_key: "documentStartRef",
|
|
1488
|
+
ref: documentStartRef
|
|
1489
|
+
}, null, 512),
|
|
1490
|
+
mergedConfig.value.layout === "classic" ? (openBlock(), createBlock(ClassicHeader_default, { key: 1 }, {
|
|
1491
|
+
"dark-mode-toggle": withCtx(() => [!mergedConfig.value.hideDarkModeToggle && !mergedConfig.value.forceDarkModeState ? (openBlock(), createBlock(unref(ScalarColorModeToggleIcon), {
|
|
1492
|
+
key: 0,
|
|
1493
|
+
class: "text-c-2 hover:text-c-1",
|
|
1494
|
+
mode: colorMode.value,
|
|
1495
|
+
style: { "transform": "scale(1.4)" },
|
|
1496
|
+
variant: "icon",
|
|
1497
|
+
onClick: _cache[5] || (_cache[5] = () => unref(toggleColorMode)())
|
|
1498
|
+
}, null, 8, ["mode"])) : createCommentVNode("", true)]),
|
|
1499
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_4$1, [documentOptionList.value.length > 1 ? (openBlock(), createBlock(DocumentSelector_default, {
|
|
1500
|
+
key: 0,
|
|
1501
|
+
modelValue: activeSlug.value,
|
|
1502
|
+
options: documentOptionList.value,
|
|
1503
|
+
"onUpdate:modelValue": changeSelectedDocument
|
|
1504
|
+
}, null, 8, ["modelValue", "options"])) : createCommentVNode("", true)]), !mergedConfig.value.hideSearch ? (openBlock(), createBlock(SearchButton_default, {
|
|
1505
|
+
key: 0,
|
|
1506
|
+
class: "t-doc__sidebar max-w-64",
|
|
1507
|
+
document: unref(workspaceStore).workspace.activeDocument,
|
|
1508
|
+
eventBus: unref(eventBus),
|
|
1509
|
+
hideModels: mergedConfig.value.hideModels,
|
|
1510
|
+
searchHotKey: mergedConfig.value.searchHotKey
|
|
1511
|
+
}, null, 8, [
|
|
1512
|
+
"document",
|
|
1513
|
+
"eventBus",
|
|
1514
|
+
"hideModels",
|
|
1515
|
+
"searchHotKey"
|
|
1516
|
+
])) : createCommentVNode("", true)]),
|
|
1517
|
+
_: 1
|
|
1518
|
+
})) : createCommentVNode("", true),
|
|
1519
|
+
renderSlot(_ctx.$slots, "content-start", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
|
|
1520
|
+
]),
|
|
1521
|
+
end: withCtx(() => [renderSlot(_ctx.$slots, "content-end", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)]),
|
|
1522
|
+
_: 2
|
|
1523
|
+
}, [mergedConfig.value.isEditable ? {
|
|
1524
|
+
name: "empty-state",
|
|
1525
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "editor-placeholder", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)]),
|
|
1526
|
+
key: "0"
|
|
1527
|
+
} : void 0]), 1032, [
|
|
1528
|
+
"authStore",
|
|
1529
|
+
"document",
|
|
1530
|
+
"environment",
|
|
1531
|
+
"eventBus",
|
|
1532
|
+
"expandedItems",
|
|
1533
|
+
"headingSlugGenerator",
|
|
1534
|
+
"infoSectionId",
|
|
1535
|
+
"items",
|
|
1536
|
+
"options",
|
|
1537
|
+
"xScalarDefaultClient"
|
|
1538
|
+
])], 8, _hoisted_3$1),
|
|
1539
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_5$1, [renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)])) : createCommentVNode("", true),
|
|
1540
|
+
createElementVNode("div", {
|
|
1541
|
+
ref_key: "modal",
|
|
1542
|
+
ref: modal
|
|
1543
|
+
}, null, 512)
|
|
1544
|
+
], 2),
|
|
1545
|
+
createVNode(unref(ScalarToasts))
|
|
1546
|
+
]);
|
|
1547
|
+
};
|
|
1548
|
+
}
|
|
1549
|
+
}), [["__scopeId", "data-v-f95a4f7c"]]);
|
|
1550
|
+
//#endregion
|
|
1551
|
+
//#region src/components/GettingStarted.vue?vue&type=script&setup=true&lang.ts
|
|
1552
|
+
var _hoisted_1 = { class: "custom-scroll start" };
|
|
1553
|
+
var _hoisted_2 = { class: "start-copy" };
|
|
1554
|
+
var _hoisted_3 = { class: "start-cta" };
|
|
1555
|
+
var _hoisted_4 = { class: "start-row" };
|
|
1556
|
+
var _hoisted_5 = { class: "start-section start-section-colors" };
|
|
1557
|
+
var _hoisted_6 = ["onClick"];
|
|
1558
|
+
//#endregion
|
|
1559
|
+
//#region src/components/GettingStarted.vue
|
|
1560
|
+
var GettingStarted_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1561
|
+
__name: "GettingStarted",
|
|
1562
|
+
props: { theme: {} },
|
|
1563
|
+
emits: [
|
|
1564
|
+
"changeTheme",
|
|
1565
|
+
"loadSwaggerFile",
|
|
1566
|
+
"linkSwaggerFile",
|
|
1567
|
+
"updateContent"
|
|
1568
|
+
],
|
|
1569
|
+
setup(__props, { emit: __emit }) {
|
|
1570
|
+
const emits = __emit;
|
|
1571
|
+
const themeIds = [
|
|
1572
|
+
"default",
|
|
1573
|
+
"alternate",
|
|
1574
|
+
"moon",
|
|
1575
|
+
"purple",
|
|
1576
|
+
"solarized",
|
|
1577
|
+
"bluePlanet",
|
|
1578
|
+
"saturn",
|
|
1579
|
+
"kepler",
|
|
1580
|
+
"mars",
|
|
1581
|
+
"deepSpace"
|
|
1582
|
+
];
|
|
1583
|
+
async function fetchExampleSpecification() {
|
|
1584
|
+
emits("updateContent", await (await fetch("https://registry.scalar.com/@scalar/apis/galaxy?format=yaml")).text());
|
|
1585
|
+
}
|
|
1586
|
+
return (_ctx, _cache) => {
|
|
1587
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1588
|
+
createElementVNode("div", _hoisted_2, [_cache[3] || (_cache[3] = createStaticVNode("<div class=\"start-logo\" data-v-8ab3de01><svg height=\"36\" viewBox=\"0 0 36 36\" width=\"36\" xmlns=\"http://www.w3.org/2000/svg\" data-v-8ab3de01><path d=\"M18 0a18 18 0 1 1 0 36 18 18 0 0 1 0-36Zm11.2 6.5c-3.3-3.3-11.1-1-17.4 5.3-6.2 6.3-8.6 14-5.3 17.4 3.3 3.3 11 .9 17.3-5.4 6.3-6.2 8.7-14 5.4-17.3ZM17.6 12a6.3 6.3 0 1 1 0 12.7 6.3 6.3 0 0 1 0-12.7Z\" fill=\"currentColor\" fill-rule=\"evenodd\" data-v-8ab3de01></path></svg></div><h1 class=\"start-h1\" data-v-8ab3de01>Swagger Editor</h1><p class=\"start-p\" data-v-8ab3de01> Welcome to the Scalar API References + Swagger Editor, a Free & Open-Source tool that takes your Swagger/OAS file and generates Beautiful API references. </p>", 3)), createElementVNode("div", _hoisted_3, [createVNode(unref(ScalarButton), {
|
|
1589
|
+
class: "w-full",
|
|
1590
|
+
onClick: fetchExampleSpecification
|
|
1591
|
+
}, {
|
|
1592
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" Show Example ", -1)])]),
|
|
1593
|
+
_: 1
|
|
1594
|
+
}), createVNode(unref(ScalarButton), {
|
|
1595
|
+
class: "w-full",
|
|
1596
|
+
variant: "outlined",
|
|
1597
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("loadSwaggerFile"))
|
|
1598
|
+
}, {
|
|
1599
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" Upload File ", -1)])]),
|
|
1600
|
+
_: 1
|
|
1601
|
+
})])]),
|
|
1602
|
+
createElementVNode("div", _hoisted_4, [_cache[5] || (_cache[5] = createStaticVNode("<div class=\"start-section start-section-integrations\" data-v-8ab3de01><div class=\"start-h2\" data-v-8ab3de01>INTEGRATIONS</div><a class=\"start-item\" href=\"https://github.com/scalar/scalar/tree/main/integrations/fastify#readme\" target=\"_blank\" data-v-8ab3de01><svg fill=\"currentColor\" height=\"16\" viewBox=\"0 0 19 16\" width=\"19\" xmlns=\"http://www.w3.org/2000/svg\" data-v-8ab3de01><path d=\"m18.2 3.1.8-2V.9l-4.7 1.3C15.2 1 15 0 15 0s-2.5 1.6-4.3 1.5c-2 0-3.6.8-4 1-1.8 1.2-2.5 3.3-3.2 3.8L0 8.9 2.3 8l-2 2.5c.2.3 1.2 1.6 2.1 1.3l.4-.1 1.6.5-.7-1 .2-.2.9.3-.1-.8.9.3-.1-.8.3-.1 1-3.5 3.7-2.6-.3.7A4 4 0 0 1 8 7l-.6.2c-.5.5-.7.7-.8 2.5a2 2 0 0 1 1 0c1.6.4 2.2 2.3 1.7 2.9l-.7.6H8v.6h-.7v.5l-.2.2c-.7 0-1.4-.6-1.4-.6 0 .5.4 1.3.4 1.3s1.7 1.1 2.7.7c1-.4.7-2.3 2.8-3.2l3.3-.9.8-2.2-1.7.5v-2l2.5-.6.9-2.2-3.4.9v-2l4.2-1.1Z\" fill=\"currentColor\" fill-rule=\"nonzero\" data-v-8ab3de01></path></svg><span data-v-8ab3de01>Fastify</span></a><a class=\"start-item\" href=\"https://github.com/scalar/scalar/blob/main/documentation/integrations/html-js.md#html\" target=\"_blank\" data-v-8ab3de01><svg fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" data-v-8ab3de01><g data-v-8ab3de01><path d=\"M22.5 1.5h-21A1.5 1.5 0 0 0 0 3v3a1.5 1.5 0 0 0 1.5 1.5h21A1.5 1.5 0 0 0 24 6V3a1.5 1.5 0 0 0-1.5-1.5Zm-19.25 3A1.25 1.25 0 1 1 4.5 5.75 1.25 1.25 0 0 1 3.25 4.5ZM8.5 5.75A1.25 1.25 0 1 1 9.75 4.5 1.25 1.25 0 0 1 8.5 5.75Z\" fill=\"currentColor\" data-v-8ab3de01></path><path d=\"M22.5 9h-21A1.5 1.5 0 0 0 0 10.5v3A1.5 1.5 0 0 0 1.5 15h21a1.5 1.5 0 0 0 1.5-1.5v-3A1.5 1.5 0 0 0 22.5 9ZM3.25 12a1.25 1.25 0 1 1 1.25 1.25A1.25 1.25 0 0 1 3.25 12Zm5.25 1.25A1.25 1.25 0 1 1 9.75 12a1.25 1.25 0 0 1-1.25 1.25Z\" fill=\"currentColor\" data-v-8ab3de01></path><path d=\"M22.5 16.5h-21A1.5 1.5 0 0 0 0 18v3a1.5 1.5 0 0 0 1.5 1.5h21A1.5 1.5 0 0 0 24 21v-3a1.5 1.5 0 0 0-1.5-1.5Zm-19.25 3a1.25 1.25 0 1 1 1.25 1.25 1.25 1.25 0 0 1-1.25-1.25Zm5.25 1.25a1.25 1.25 0 1 1 1.25-1.25 1.25 1.25 0 0 1-1.25 1.25Z\" fill=\"currentColor\" data-v-8ab3de01></path></g></svg><span data-v-8ab3de01>CDN</span></a><a class=\"start-item\" href=\"https://github.com/scalar/scalar/blob/main/packages/api-reference/README.md#vuejs\" target=\"_blank\" data-v-8ab3de01><svg height=\"170\" viewBox=\"0 0 196.3 170\" width=\"196.3\" xmlns=\"http://www.w3.org/2000/svg\" data-v-8ab3de01><g fill=\"currentColor\" fill-rule=\"nonzero\" data-v-8ab3de01><polygon points=\"39.23 0 0 0 2.9450761 5.1010782 98.16 170.02 196.32 0 157.06 0 98.16 102.01 42.175701 5.0991171\" data-v-8ab3de01></polygon><polygon points=\"75.5 2.009956e-14 0 2.009956e-14 2.94 5.1 78.44871 5.1 98.16 39.26 117.87937 5.1 193.38 5.1 196.325 0 120.82 7.8065636e-15 114.97322 2.009956e-14 98.16 29.037153 81.35 2.009956e-14\" data-v-8ab3de01></polygon></g></svg><span data-v-8ab3de01>Vue</span></a><a class=\"start-item\" href=\"https://github.com/scalar/scalar/blob/main/packages/api-reference-react/README.md#usage\" target=\"_blank\" data-v-8ab3de01><svg height=\"23.3\" viewBox=\"0 0 22 23.3\" width=\"22\" xmlns=\"http://www.w3.org/2000/svg\" data-v-8ab3de01><g fill=\"none\" fill-rule=\"evenodd\" data-v-8ab3de01><circle cx=\"11\" cy=\"11.6\" fill=\"currentColor\" fill-rule=\"nonzero\" r=\"2\" data-v-8ab3de01></circle><g stroke=\"currentColor\" data-v-8ab3de01><ellipse cx=\"11\" cy=\"11.6\" rx=\"11\" ry=\"4.2\" data-v-8ab3de01></ellipse><ellipse cx=\"11\" cy=\"11.6\" rx=\"11\" ry=\"4.2\" transform=\"rotate(60 11 11.6)\" data-v-8ab3de01></ellipse><ellipse cx=\"11\" cy=\"11.6\" rx=\"11\" ry=\"4.2\" transform=\"rotate(120 11 11.6)\" data-v-8ab3de01></ellipse></g></g></svg><span data-v-8ab3de01>React</span></a></div>", 1)), createElementVNode("div", _hoisted_5, [_cache[4] || (_cache[4] = createElementVNode("p", { class: "start-h2" }, "THEMING", -1)), (openBlock(), createElementBlock(Fragment, null, renderList(themeIds, (themeId) => {
|
|
1603
|
+
return createElementVNode("div", {
|
|
1604
|
+
key: themeId,
|
|
1605
|
+
class: normalizeClass(["start-item", { "start-item-active": themeId === __props.theme }]),
|
|
1606
|
+
onClick: ($event) => _ctx.$emit("changeTheme", {
|
|
1607
|
+
id: themeId,
|
|
1608
|
+
label: unref(themeLabels)[themeId]
|
|
1609
|
+
})
|
|
1610
|
+
}, toDisplayString(unref(themeLabels)[themeId]), 11, _hoisted_6);
|
|
1611
|
+
}), 64))])]),
|
|
1612
|
+
_cache[6] || (_cache[6] = createStaticVNode("<p class=\"start-h1\" data-v-8ab3de01>Features</p><ul class=\"start-ul\" data-v-8ab3de01><li data-v-8ab3de01><p class=\"start-h3\" data-v-8ab3de01>Customize</p> Bring your typography & color palettes, or use our themes! </li><li data-v-8ab3de01><p class=\"start-h3\" data-v-8ab3de01>Testing</p> A deeply integrated Rest API Client (Also Free & Open-Source) </li><li data-v-8ab3de01><p class=\"start-h3\" data-v-8ab3de01>Search</p> Fully integrated Search (Using fuse.js) </li><li data-v-8ab3de01><p class=\"start-h3\" data-v-8ab3de01>Hosting</p> Free subdomain hosting on https://apidocumentation.com </li><li data-v-8ab3de01><p class=\"start-h3\" data-v-8ab3de01>OpenAPI & Swagger</p> Support for OpenAPI 3.1, OpenAPI 3.0, and Swagger 2.0 </li><li data-v-8ab3de01><p class=\"start-h3\" data-v-8ab3de01>Code Samples</p> Code samples to show off your API in most popular languages </li></ul>", 2))
|
|
1613
|
+
]);
|
|
1614
|
+
};
|
|
1615
|
+
}
|
|
1616
|
+
}), [["__scopeId", "data-v-8ab3de01"]]);
|
|
1617
|
+
//#endregion
|
|
1618
|
+
//#region src/standalone/lib/html-api.ts
|
|
1619
|
+
/**
|
|
1620
|
+
* Create (and mount) a new Scalar API Reference
|
|
1621
|
+
*
|
|
1622
|
+
* @example createApiReference({ url: '/scalar.json' }).mount('#app')
|
|
1623
|
+
* @example createApiReference('#app', { url: '/scalar.json' })
|
|
1624
|
+
* @example createApiReference(document.getElementById('app'), { url: '/scalar.json' })
|
|
1625
|
+
*/
|
|
1626
|
+
var createApiReference = (elementOrSelectorOrConfig, optionalConfiguration) => {
|
|
1627
|
+
const idPrefix = "scalar-refs";
|
|
1628
|
+
const props = reactive({ configuration: optionalConfiguration ?? elementOrSelectorOrConfig ?? {} });
|
|
1629
|
+
let app = createApp(() => h(ApiReference_default, props));
|
|
1630
|
+
app.use(createHead());
|
|
1631
|
+
app.config.idPrefix = idPrefix;
|
|
1632
|
+
if (optionalConfiguration) {
|
|
1633
|
+
const element = typeof elementOrSelectorOrConfig === "string" ? document.querySelector(elementOrSelectorOrConfig) : elementOrSelectorOrConfig;
|
|
1634
|
+
if (element) app.mount(element);
|
|
1635
|
+
else console.error("Could not find a mount point for API References:", elementOrSelectorOrConfig);
|
|
1636
|
+
}
|
|
1637
|
+
/**
|
|
1638
|
+
* Reload the API Reference
|
|
1639
|
+
* @deprecated
|
|
1640
|
+
*/
|
|
1641
|
+
document.addEventListener("scalar:reload-references", () => {
|
|
1642
|
+
console.warn("scalar:reload-references event has been deprecated, please use the scalarInstance.app.mount method instead.");
|
|
1643
|
+
if (!props.configuration) return;
|
|
1644
|
+
const currentElement = typeof elementOrSelectorOrConfig === "string" ? document.querySelector(elementOrSelectorOrConfig) : elementOrSelectorOrConfig;
|
|
1645
|
+
if (!currentElement) return;
|
|
1646
|
+
if (currentElement && !document.body.contains(currentElement)) document.body.appendChild(currentElement);
|
|
1647
|
+
app.unmount();
|
|
1648
|
+
app = createApp(() => h(ApiReference_default, props));
|
|
1649
|
+
app.use(createHead());
|
|
1650
|
+
app.config.idPrefix = idPrefix;
|
|
1651
|
+
app.mount(currentElement);
|
|
1652
|
+
}, false);
|
|
1653
|
+
/** Destroy the current API Reference instance */
|
|
1654
|
+
const destroy = () => {
|
|
1655
|
+
props.configuration = {};
|
|
1656
|
+
app.unmount();
|
|
1657
|
+
};
|
|
1658
|
+
/**
|
|
1659
|
+
* Allow user to destroy the API Reference
|
|
1660
|
+
* @deprecated
|
|
1661
|
+
*/
|
|
1662
|
+
document.addEventListener("scalar:destroy-references", () => {
|
|
1663
|
+
console.warn("scalar:destroy-references event has been deprecated, please use scalarInstance.destroy instead.");
|
|
1664
|
+
destroy();
|
|
1665
|
+
}, false);
|
|
1666
|
+
/**
|
|
1667
|
+
* Allow user to update configuration
|
|
1668
|
+
* @deprecated
|
|
1669
|
+
*/
|
|
1670
|
+
document.addEventListener("scalar:update-references-config", (ev) => {
|
|
1671
|
+
console.warn("scalar:update-references-config event has been deprecated, please use scalarInstance.updateConfiguration instead.");
|
|
1672
|
+
if ("detail" in ev) Object.assign(props, ev.detail);
|
|
1673
|
+
}, false);
|
|
1674
|
+
return {
|
|
1675
|
+
app,
|
|
1676
|
+
getConfiguration: () => props.configuration ?? {},
|
|
1677
|
+
updateConfiguration: (newConfig) => {
|
|
1678
|
+
props.configuration = newConfig;
|
|
1679
|
+
},
|
|
1680
|
+
destroy
|
|
1681
|
+
};
|
|
1682
|
+
};
|
|
1683
|
+
//#endregion
|
|
1684
|
+
export { GettingStarted_default as n, ApiReference_default as r, createApiReference as t };
|
|
1685
|
+
|
|
1686
|
+
//# sourceMappingURL=src-DJwsRvMU.js.map
|