@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
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { isClient } from "@scalar/api-client/v2/blocks/operation-code-sample";
|
|
2
|
-
import { clientStorage, authStorage } from "./storage.js";
|
|
3
|
-
const loadClientFromStorage = (store) => {
|
|
4
|
-
const storedClient = clientStorage().get();
|
|
5
|
-
if (isClient(storedClient) && !store.workspace["x-scalar-default-client"]) {
|
|
6
|
-
store.update("x-scalar-default-client", storedClient);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
const loadAuthFromStorage = (store, slug) => {
|
|
10
|
-
const authPersistence = authStorage();
|
|
11
|
-
const auth = authPersistence.getAuth(slug);
|
|
12
|
-
store.auth.load({ [slug]: auth });
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
loadAuthFromStorage,
|
|
16
|
-
loadClientFromStorage
|
|
17
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { watch } from "vue";
|
|
2
|
-
const mapConfigPlugins = (config) => {
|
|
3
|
-
const plugin = { hooks: {} };
|
|
4
|
-
watch(
|
|
5
|
-
[() => config.value.onBeforeRequest, () => config.value.onRequestSent],
|
|
6
|
-
([onBeforeRequest, onRequestSent]) => {
|
|
7
|
-
if (!plugin.hooks) {
|
|
8
|
-
plugin.hooks = {};
|
|
9
|
-
}
|
|
10
|
-
plugin.hooks.beforeRequest = onBeforeRequest ? async (payload) => {
|
|
11
|
-
const result = await onBeforeRequest(payload);
|
|
12
|
-
if (result === void 0) {
|
|
13
|
-
return payload;
|
|
14
|
-
}
|
|
15
|
-
return result;
|
|
16
|
-
} : void 0;
|
|
17
|
-
plugin.hooks.responseReceived = onRequestSent ? (payload) => {
|
|
18
|
-
onRequestSent(payload.request.url);
|
|
19
|
-
} : void 0;
|
|
20
|
-
},
|
|
21
|
-
{ immediate: true }
|
|
22
|
-
);
|
|
23
|
-
return [plugin];
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
mapConfigPlugins
|
|
27
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { isClient } from "@scalar/api-client/v2/blocks/operation-code-sample";
|
|
2
|
-
import { useSeoMeta } from "@unhead/vue";
|
|
3
|
-
import { useFavicon } from "@vueuse/core";
|
|
4
|
-
import { watch, toValue, computed } from "vue";
|
|
5
|
-
const mapConfigToWorkspaceStore = ({
|
|
6
|
-
config,
|
|
7
|
-
store,
|
|
8
|
-
isDarkMode
|
|
9
|
-
}) => {
|
|
10
|
-
watch(
|
|
11
|
-
() => toValue(config).defaultHttpClient,
|
|
12
|
-
(newValue) => {
|
|
13
|
-
if (newValue) {
|
|
14
|
-
const { targetKey, clientKey } = newValue;
|
|
15
|
-
const clientId = `${targetKey}/${clientKey}`;
|
|
16
|
-
if (isClient(clientId)) {
|
|
17
|
-
store.update("x-scalar-default-client", clientId);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
{ immediate: true }
|
|
22
|
-
);
|
|
23
|
-
watch(
|
|
24
|
-
() => toValue(config).darkMode,
|
|
25
|
-
(isDark) => store.update("x-scalar-color-mode", isDark ? "dark" : "light")
|
|
26
|
-
);
|
|
27
|
-
watch(
|
|
28
|
-
() => isDarkMode.value,
|
|
29
|
-
(newIsDark) => store.update("x-scalar-color-mode", newIsDark ? "dark" : "light"),
|
|
30
|
-
{ immediate: true }
|
|
31
|
-
);
|
|
32
|
-
if (toValue(config).metaData) {
|
|
33
|
-
useSeoMeta(toValue(config).metaData);
|
|
34
|
-
}
|
|
35
|
-
watch(
|
|
36
|
-
() => toValue(config).proxyUrl,
|
|
37
|
-
(newProxyUrl) => store.update("x-scalar-active-proxy", newProxyUrl),
|
|
38
|
-
{ immediate: true }
|
|
39
|
-
);
|
|
40
|
-
const favicon = computed(() => toValue(config).favicon);
|
|
41
|
-
useFavicon(favicon);
|
|
42
|
-
};
|
|
43
|
-
export {
|
|
44
|
-
mapConfigToWorkspaceStore
|
|
45
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { parseJsonOrYaml } from "@scalar/oas-utils/helpers";
|
|
2
|
-
import { isConfigurationWithSources, apiReferenceConfigurationWithSourceSchema } from "@scalar/types/api-reference";
|
|
3
|
-
import GitHubSlugger from "github-slugger";
|
|
4
|
-
const normalizeConfigurations = (configuration) => {
|
|
5
|
-
const slugger = new GitHubSlugger();
|
|
6
|
-
const normalized = {};
|
|
7
|
-
if (!configuration) {
|
|
8
|
-
return normalized;
|
|
9
|
-
}
|
|
10
|
-
const configList = Array.isArray(configuration) ? configuration : [configuration];
|
|
11
|
-
configList.flatMap((c) => {
|
|
12
|
-
if (isConfigurationWithSources(c)) {
|
|
13
|
-
const { sources: configSources, ...rest } = c;
|
|
14
|
-
return configSources?.map((source) => ({ ...rest, ...source })) ?? [];
|
|
15
|
-
}
|
|
16
|
-
return [c];
|
|
17
|
-
}).map((source) => {
|
|
18
|
-
const validated = apiReferenceConfigurationWithSourceSchema.safeParse(source);
|
|
19
|
-
return validated.success ? validated.data : null;
|
|
20
|
-
}).filter((c) => !!c && (!!c.url || !!c.content)).map((source, index) => addSlugAndTitle(source, index, slugger)).forEach((c) => {
|
|
21
|
-
const { url, content, ...config } = c;
|
|
22
|
-
normalized[c.slug] = {
|
|
23
|
-
config,
|
|
24
|
-
title: c.title,
|
|
25
|
-
slug: c.slug,
|
|
26
|
-
default: !!c?.default,
|
|
27
|
-
agent: c.agent,
|
|
28
|
-
source: content ? { content: normalizeContent(content) ?? {} } : { url }
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
return normalized;
|
|
32
|
-
};
|
|
33
|
-
const normalizeContent = (content) => {
|
|
34
|
-
if (!content) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
if (typeof content === "function") {
|
|
38
|
-
return normalizeContent(content());
|
|
39
|
-
}
|
|
40
|
-
if (typeof content === "string") {
|
|
41
|
-
return parseJsonOrYaml(content);
|
|
42
|
-
}
|
|
43
|
-
return content;
|
|
44
|
-
};
|
|
45
|
-
const addSlugAndTitle = (source, index = 0, slugger) => {
|
|
46
|
-
if (source.title) {
|
|
47
|
-
return {
|
|
48
|
-
...source,
|
|
49
|
-
slug: source.slug || slugger.slug(source.title),
|
|
50
|
-
title: source.title
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
if (source.slug) {
|
|
54
|
-
return {
|
|
55
|
-
...source,
|
|
56
|
-
slug: slugger.slug(source.slug),
|
|
57
|
-
title: source.slug
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
...source,
|
|
62
|
-
slug: `api-${index + 1}`,
|
|
63
|
-
title: `API #${index + 1}`
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
export {
|
|
67
|
-
normalizeConfigurations,
|
|
68
|
-
normalizeContent
|
|
69
|
-
};
|
package/dist/helpers/openapi.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { isDereferenced } from "@scalar/openapi-types/helpers";
|
|
2
|
-
import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
-
import { isObjectSchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
4
|
-
function resolveSchemaRef(ref) {
|
|
5
|
-
return getResolvedRef(ref);
|
|
6
|
-
}
|
|
7
|
-
function formatProperty(key, obj) {
|
|
8
|
-
let output = key;
|
|
9
|
-
const isRequired = obj.required?.includes(key);
|
|
10
|
-
output += isRequired ? " REQUIRED " : " optional ";
|
|
11
|
-
const propRef = obj.properties[key];
|
|
12
|
-
if (!propRef) return output;
|
|
13
|
-
const property = resolveSchemaRef(propRef);
|
|
14
|
-
if (property && typeof property === "object" && "type" in property) {
|
|
15
|
-
output += property.type ?? "";
|
|
16
|
-
if ("description" in property && typeof property.description === "string") {
|
|
17
|
-
output += " " + property.description;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return output;
|
|
21
|
-
}
|
|
22
|
-
function recursiveLogger(obj) {
|
|
23
|
-
const results = ["Body"];
|
|
24
|
-
const schema = getResolvedRef(obj?.schema);
|
|
25
|
-
if (!schema || !isObjectSchema(schema) || !schema.properties) {
|
|
26
|
-
return results;
|
|
27
|
-
}
|
|
28
|
-
const properties = schema.properties;
|
|
29
|
-
const schemaWithProps = {
|
|
30
|
-
properties,
|
|
31
|
-
required: schema.required
|
|
32
|
-
};
|
|
33
|
-
Object.keys(properties).forEach((key) => {
|
|
34
|
-
if (!obj.schema) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
results.push(formatProperty(key, schemaWithProps));
|
|
38
|
-
const propRef = properties[key];
|
|
39
|
-
if (!propRef) return;
|
|
40
|
-
const property = resolveSchemaRef(propRef);
|
|
41
|
-
if (property && isObjectSchema(property) && property.properties) {
|
|
42
|
-
const nestedProperties = property.properties;
|
|
43
|
-
Object.keys(nestedProperties).forEach((subKey) => {
|
|
44
|
-
const ref = nestedProperties[subKey];
|
|
45
|
-
if (!ref) return;
|
|
46
|
-
const nested = resolveSchemaRef(ref);
|
|
47
|
-
const typeStr = nested && typeof nested === "object" && "type" in nested ? nested.type ?? "" : "";
|
|
48
|
-
results.push(`${subKey} ${typeStr}`);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
return results;
|
|
53
|
-
}
|
|
54
|
-
function extractRequestBody(operation) {
|
|
55
|
-
try {
|
|
56
|
-
const media = getResolvedRef(operation?.requestBody)?.content?.["application/json"];
|
|
57
|
-
if (!media) {
|
|
58
|
-
throw new Error("Body not found");
|
|
59
|
-
}
|
|
60
|
-
return recursiveLogger(media);
|
|
61
|
-
} catch (_error) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function deepMerge(source, target) {
|
|
66
|
-
for (const [key, val] of Object.entries(source)) {
|
|
67
|
-
if (val !== null && typeof val === "object") {
|
|
68
|
-
target[key] ??= new val.__proto__.constructor();
|
|
69
|
-
deepMerge(val, target[key]);
|
|
70
|
-
} else if (typeof val !== "undefined") {
|
|
71
|
-
target[key] = val;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return target;
|
|
75
|
-
}
|
|
76
|
-
function createEmptySpecification(partialSpecification) {
|
|
77
|
-
return deepMerge(partialSpecification ?? {}, {
|
|
78
|
-
info: {
|
|
79
|
-
title: "",
|
|
80
|
-
description: "",
|
|
81
|
-
termsOfService: "",
|
|
82
|
-
version: "",
|
|
83
|
-
license: {
|
|
84
|
-
name: "",
|
|
85
|
-
url: ""
|
|
86
|
-
},
|
|
87
|
-
contact: {
|
|
88
|
-
email: ""
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
servers: [],
|
|
92
|
-
tags: []
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
function createParameterMap(operation) {
|
|
96
|
-
const map = {
|
|
97
|
-
path: [],
|
|
98
|
-
query: [],
|
|
99
|
-
header: [],
|
|
100
|
-
cookie: [],
|
|
101
|
-
body: [],
|
|
102
|
-
formData: []
|
|
103
|
-
};
|
|
104
|
-
const parameters = operation.parameters ?? [];
|
|
105
|
-
if (parameters) {
|
|
106
|
-
parameters.forEach((parameter) => {
|
|
107
|
-
if (!isDereferenced(parameter)) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
if (typeof parameter === "object" && parameter !== null && "$ref" in parameter) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
if (parameter.in === "path") {
|
|
114
|
-
map.path.push(parameter);
|
|
115
|
-
} else if (parameter.in === "query") {
|
|
116
|
-
map.query.push(parameter);
|
|
117
|
-
} else if (parameter.in === "header") {
|
|
118
|
-
map.header.push(parameter);
|
|
119
|
-
} else if (parameter.in === "cookie") {
|
|
120
|
-
map.cookie.push(parameter);
|
|
121
|
-
} else if (parameter.in === "body") {
|
|
122
|
-
map.body.push(parameter);
|
|
123
|
-
} else if (parameter.in === "formData") {
|
|
124
|
-
map.formData.push(parameter);
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
return map;
|
|
129
|
-
}
|
|
130
|
-
export {
|
|
131
|
-
createEmptySpecification,
|
|
132
|
-
createParameterMap,
|
|
133
|
-
deepMerge,
|
|
134
|
-
extractRequestBody
|
|
135
|
-
};
|
package/dist/helpers/storage.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { REFERENCE_LS_KEYS, safeLocalStorage } from "@scalar/helpers/object/local-storage";
|
|
2
|
-
import { AuthSchema } from "@scalar/workspace-store/entities/auth";
|
|
3
|
-
import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
|
|
4
|
-
const storage = safeLocalStorage();
|
|
5
|
-
const clientStorage = () => {
|
|
6
|
-
const key = REFERENCE_LS_KEYS.SELECTED_CLIENT;
|
|
7
|
-
return {
|
|
8
|
-
/**
|
|
9
|
-
* Gets the stored selected client from local storage.
|
|
10
|
-
*/
|
|
11
|
-
get: () => {
|
|
12
|
-
return storage.getItem(key);
|
|
13
|
-
},
|
|
14
|
-
/**
|
|
15
|
-
* Stores the selected client value in local storage.
|
|
16
|
-
* @param value The value to store
|
|
17
|
-
*/
|
|
18
|
-
set: (value) => {
|
|
19
|
-
storage.setItem(key, value);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
const authStorage = () => {
|
|
24
|
-
const getKey = (slug) => {
|
|
25
|
-
return `${REFERENCE_LS_KEYS.AUTH}-${slug}`;
|
|
26
|
-
};
|
|
27
|
-
return {
|
|
28
|
-
/**
|
|
29
|
-
* Retrieves and coerces the authentication schemes stored in local storage.
|
|
30
|
-
*/
|
|
31
|
-
getAuth: (slug) => {
|
|
32
|
-
const parsed = JSON.parse(storage.getItem(getKey(slug)) ?? "{}");
|
|
33
|
-
return coerceValue(AuthSchema, parsed);
|
|
34
|
-
},
|
|
35
|
-
/**
|
|
36
|
-
* Stores the authentication schemes in local storage.
|
|
37
|
-
* @param value The Auth object to stringify and store.
|
|
38
|
-
*/
|
|
39
|
-
setAuth: (slug, value) => {
|
|
40
|
-
storage.setItem(getKey(slug), JSON.stringify(value));
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export {
|
|
45
|
-
authStorage,
|
|
46
|
-
clientStorage
|
|
47
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { redirectToProxy } from "@scalar/helpers/url/redirect-to-proxy";
|
|
2
|
-
import { PROXY_URL, UPLOAD_TEMP_API_URL } from "../consts/urls.js";
|
|
3
|
-
function isResponseBody(data) {
|
|
4
|
-
return !!data && typeof data === "object" && "url" in data && typeof data.url === "string";
|
|
5
|
-
}
|
|
6
|
-
async function uploadTempDocument(document) {
|
|
7
|
-
const body = JSON.stringify({ document });
|
|
8
|
-
const response = await fetch(redirectToProxy(PROXY_URL, UPLOAD_TEMP_API_URL), {
|
|
9
|
-
method: "POST",
|
|
10
|
-
headers: { "Content-Type": "application/json" },
|
|
11
|
-
body
|
|
12
|
-
});
|
|
13
|
-
if (!response.ok) {
|
|
14
|
-
throw new Error(` Failed to generate temporary link, server responded with ${response.status}`);
|
|
15
|
-
}
|
|
16
|
-
const data = await response.json();
|
|
17
|
-
if (!isResponseBody(data)) {
|
|
18
|
-
throw new Error("Failed to generate temporary link, invalid response from server");
|
|
19
|
-
}
|
|
20
|
-
return data.url;
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
uploadTempDocument
|
|
24
|
-
};
|
package/dist/hooks/use-agent.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { isLocalUrl } from "@scalar/helpers/url/is-local-url";
|
|
2
|
-
import { ref, computed, inject } from "vue";
|
|
3
|
-
const AGENT_CONTEXT_SYMBOL = /* @__PURE__ */ Symbol();
|
|
4
|
-
const agentStateRef = ref(null);
|
|
5
|
-
function useAgent(options) {
|
|
6
|
-
const showAgent = ref(false);
|
|
7
|
-
const prefilledMessage = ref("");
|
|
8
|
-
const agentEnabled = options.agentEnabled ?? computed(() => isLocalUrl(window.location.href));
|
|
9
|
-
const openAgent = (message) => {
|
|
10
|
-
prefilledMessage.value = message ?? "";
|
|
11
|
-
showAgent.value = true;
|
|
12
|
-
};
|
|
13
|
-
const closeAgent = () => {
|
|
14
|
-
showAgent.value = false;
|
|
15
|
-
prefilledMessage.value = "";
|
|
16
|
-
};
|
|
17
|
-
const toggleAgent = () => {
|
|
18
|
-
showAgent.value = !showAgent.value;
|
|
19
|
-
if (!showAgent.value) {
|
|
20
|
-
prefilledMessage.value = "";
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const state = {
|
|
24
|
-
showAgent,
|
|
25
|
-
agentEnabled,
|
|
26
|
-
prefilledMessage,
|
|
27
|
-
openAgent,
|
|
28
|
-
closeAgent,
|
|
29
|
-
toggleAgent
|
|
30
|
-
};
|
|
31
|
-
agentStateRef.value = state;
|
|
32
|
-
return state;
|
|
33
|
-
}
|
|
34
|
-
function useAgentContext() {
|
|
35
|
-
const injected = inject(AGENT_CONTEXT_SYMBOL, void 0);
|
|
36
|
-
return computed(() => injected ?? agentStateRef.value ?? void 0);
|
|
37
|
-
}
|
|
38
|
-
export {
|
|
39
|
-
AGENT_CONTEXT_SYMBOL,
|
|
40
|
-
useAgent,
|
|
41
|
-
useAgentContext
|
|
42
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { useIntersectionObserver } from "@vueuse/core";
|
|
2
|
-
import { onMounted } from "vue";
|
|
3
|
-
const useIntersection = (el, onIntersect) => {
|
|
4
|
-
const calculateRootMargin = (element) => {
|
|
5
|
-
const height = element.offsetHeight;
|
|
6
|
-
return `${height / 2}px 0px ${height / 2}px 0px`;
|
|
7
|
-
};
|
|
8
|
-
const calculateThreshold = (element) => {
|
|
9
|
-
const height = element.offsetHeight;
|
|
10
|
-
return height < window.innerHeight ? 0.8 : 0.5;
|
|
11
|
-
};
|
|
12
|
-
onMounted(() => {
|
|
13
|
-
if (el.value) {
|
|
14
|
-
const options = {
|
|
15
|
-
rootMargin: calculateRootMargin(el.value),
|
|
16
|
-
threshold: calculateThreshold(el.value)
|
|
17
|
-
};
|
|
18
|
-
useIntersectionObserver(
|
|
19
|
-
el,
|
|
20
|
-
([entry]) => {
|
|
21
|
-
if (entry?.isIntersecting) {
|
|
22
|
-
onIntersect();
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
options
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
export {
|
|
31
|
-
useIntersection
|
|
32
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createPluginManager } from "../plugin-manager.js";
|
|
2
|
-
import { inject } from "vue";
|
|
3
|
-
const PLUGIN_MANAGER_SYMBOL = /* @__PURE__ */ Symbol();
|
|
4
|
-
const usePluginManager = () => {
|
|
5
|
-
const manager = inject(PLUGIN_MANAGER_SYMBOL);
|
|
6
|
-
if (!manager) {
|
|
7
|
-
return createPluginManager({});
|
|
8
|
-
}
|
|
9
|
-
return manager;
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
PLUGIN_MANAGER_SYMBOL,
|
|
13
|
-
usePluginManager
|
|
14
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { debounce } from "@scalar/helpers/general/debounce";
|
|
2
|
-
import { clientStorage, authStorage } from "../helpers/storage.js";
|
|
3
|
-
const persistencePlugin = ({
|
|
4
|
-
debounceDelay = 500,
|
|
5
|
-
maxWait = 1e4,
|
|
6
|
-
prefix = "",
|
|
7
|
-
persistAuth = false
|
|
8
|
-
}) => {
|
|
9
|
-
const { execute } = debounce({ delay: debounceDelay, maxWait });
|
|
10
|
-
const authPersistence = authStorage();
|
|
11
|
-
const clientPersistence = clientStorage();
|
|
12
|
-
const getPrefix = () => {
|
|
13
|
-
if (typeof prefix === "string") {
|
|
14
|
-
return prefix;
|
|
15
|
-
}
|
|
16
|
-
return prefix();
|
|
17
|
-
};
|
|
18
|
-
const getPersistAuth = () => {
|
|
19
|
-
if (typeof persistAuth === "function") {
|
|
20
|
-
return persistAuth();
|
|
21
|
-
}
|
|
22
|
-
return persistAuth;
|
|
23
|
-
};
|
|
24
|
-
return {
|
|
25
|
-
hooks: {
|
|
26
|
-
/**
|
|
27
|
-
* Handles all workspace state change events.
|
|
28
|
-
* Each write is debounced by a key to prevent frequent writes for the same entity.
|
|
29
|
-
*/
|
|
30
|
-
onWorkspaceStateChanges(event) {
|
|
31
|
-
if (event.type === "meta") {
|
|
32
|
-
const defaultClient = event.value["x-scalar-default-client"];
|
|
33
|
-
if (defaultClient !== void 0) {
|
|
34
|
-
execute("x-scalar-default-client", () => clientPersistence.set(defaultClient));
|
|
35
|
-
}
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (getPersistAuth() && event.type === "auth") {
|
|
39
|
-
execute("auth", () => authPersistence.setAuth(getPrefix(), event.value));
|
|
40
|
-
}
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
persistencePlugin
|
|
48
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const createPluginManager = ({ plugins = [] }) => {
|
|
2
|
-
const registeredPlugins = /* @__PURE__ */ new Map();
|
|
3
|
-
plugins.forEach((plugin) => {
|
|
4
|
-
const pluginInstance = plugin();
|
|
5
|
-
registeredPlugins.set(pluginInstance.name, pluginInstance);
|
|
6
|
-
});
|
|
7
|
-
return {
|
|
8
|
-
/**
|
|
9
|
-
* Get all extensions with the given name from registered plugins
|
|
10
|
-
*/
|
|
11
|
-
getSpecificationExtensions: (name) => {
|
|
12
|
-
const extensions = [];
|
|
13
|
-
for (const plugin of registeredPlugins.values()) {
|
|
14
|
-
for (const extension of plugin.extensions) {
|
|
15
|
-
if (extension.name === name) {
|
|
16
|
-
extensions.push(extension);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return extensions;
|
|
21
|
-
},
|
|
22
|
-
/**
|
|
23
|
-
* Get all components for a specific view from registered plugins
|
|
24
|
-
*/
|
|
25
|
-
getViewComponents: (viewName) => {
|
|
26
|
-
const components = [];
|
|
27
|
-
for (const plugin of registeredPlugins.values()) {
|
|
28
|
-
const viewComponents = plugin.views?.[viewName];
|
|
29
|
-
if (viewComponents) {
|
|
30
|
-
components.push(...viewComponents);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return components;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export {
|
|
38
|
-
createPluginManager
|
|
39
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { createHead } from "@unhead/vue/client";
|
|
2
|
-
import { reactive, createApp, h } from "vue";
|
|
3
|
-
import ApiReference from "../../components/ApiReference.vue.js";
|
|
4
|
-
const createApiReference = (elementOrSelectorOrConfig, optionalConfiguration) => {
|
|
5
|
-
const idPrefix = "scalar-refs";
|
|
6
|
-
const props = reactive({
|
|
7
|
-
// Either the configuration will be the second argument or it MUST be the first (configuration only)
|
|
8
|
-
configuration: optionalConfiguration ?? elementOrSelectorOrConfig ?? {}
|
|
9
|
-
});
|
|
10
|
-
let app = createApp(() => h(ApiReference, props));
|
|
11
|
-
app.use(createHead());
|
|
12
|
-
app.config.idPrefix = idPrefix;
|
|
13
|
-
if (optionalConfiguration) {
|
|
14
|
-
const element = typeof elementOrSelectorOrConfig === "string" ? document.querySelector(elementOrSelectorOrConfig) : elementOrSelectorOrConfig;
|
|
15
|
-
if (element) {
|
|
16
|
-
app.mount(element);
|
|
17
|
-
} else {
|
|
18
|
-
console.error("Could not find a mount point for API References:", elementOrSelectorOrConfig);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
document.addEventListener(
|
|
22
|
-
"scalar:reload-references",
|
|
23
|
-
() => {
|
|
24
|
-
console.warn(
|
|
25
|
-
"scalar:reload-references event has been deprecated, please use the scalarInstance.app.mount method instead."
|
|
26
|
-
);
|
|
27
|
-
if (!props.configuration) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const currentElement = typeof elementOrSelectorOrConfig === "string" ? document.querySelector(elementOrSelectorOrConfig) : elementOrSelectorOrConfig;
|
|
31
|
-
if (!currentElement) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (currentElement && !document.body.contains(currentElement)) {
|
|
35
|
-
document.body.appendChild(currentElement);
|
|
36
|
-
}
|
|
37
|
-
app.unmount();
|
|
38
|
-
app = createApp(() => h(ApiReference, props));
|
|
39
|
-
app.use(createHead());
|
|
40
|
-
app.config.idPrefix = idPrefix;
|
|
41
|
-
app.mount(currentElement);
|
|
42
|
-
},
|
|
43
|
-
false
|
|
44
|
-
);
|
|
45
|
-
const destroy = () => {
|
|
46
|
-
props.configuration = {};
|
|
47
|
-
app.unmount();
|
|
48
|
-
};
|
|
49
|
-
document.addEventListener(
|
|
50
|
-
"scalar:destroy-references",
|
|
51
|
-
() => {
|
|
52
|
-
console.warn("scalar:destroy-references event has been deprecated, please use scalarInstance.destroy instead.");
|
|
53
|
-
destroy();
|
|
54
|
-
},
|
|
55
|
-
false
|
|
56
|
-
);
|
|
57
|
-
document.addEventListener(
|
|
58
|
-
"scalar:update-references-config",
|
|
59
|
-
(ev) => {
|
|
60
|
-
console.warn(
|
|
61
|
-
"scalar:update-references-config event has been deprecated, please use scalarInstance.updateConfiguration instead."
|
|
62
|
-
);
|
|
63
|
-
if ("detail" in ev) {
|
|
64
|
-
Object.assign(props, ev.detail);
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
false
|
|
68
|
-
);
|
|
69
|
-
const instance = {
|
|
70
|
-
app,
|
|
71
|
-
getConfiguration: () => props.configuration ?? {},
|
|
72
|
-
updateConfiguration: (newConfig) => {
|
|
73
|
-
props.configuration = newConfig;
|
|
74
|
-
},
|
|
75
|
-
destroy
|
|
76
|
-
};
|
|
77
|
-
return instance;
|
|
78
|
-
};
|
|
79
|
-
export {
|
|
80
|
-
createApiReference
|
|
81
|
-
};
|