@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,40 +0,0 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, createVNode, createElementVNode, unref, toDisplayString, Fragment } from "vue";
|
|
2
|
-
import { ScalarIconGavel } from "@scalar/icons";
|
|
3
|
-
const _hoisted_1 = { class: "group flex h-fit items-center last:border-r-0 xl:border-r xl:first:ml-auto" };
|
|
4
|
-
const _hoisted_2 = ["href"];
|
|
5
|
-
const _hoisted_3 = { class: "ml-1 empty:hidden" };
|
|
6
|
-
const _hoisted_4 = { class: "ml-1 empty:hidden" };
|
|
7
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
-
__name: "License",
|
|
9
|
-
props: {
|
|
10
|
-
value: {}
|
|
11
|
-
},
|
|
12
|
-
setup(__props) {
|
|
13
|
-
return (_ctx, _cache) => {
|
|
14
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
15
|
-
__props.value?.url ? (openBlock(), createElementBlock("a", {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none",
|
|
18
|
-
href: __props.value.url,
|
|
19
|
-
target: "_blank",
|
|
20
|
-
rel: "noopener noreferrer"
|
|
21
|
-
}, [
|
|
22
|
-
createVNode(unref(ScalarIconGavel), {
|
|
23
|
-
weight: "bold",
|
|
24
|
-
class: "size-3 text-current"
|
|
25
|
-
}),
|
|
26
|
-
createElementVNode("span", _hoisted_3, toDisplayString(__props.value?.name || __props.value.identifier || __props.value.url), 1)
|
|
27
|
-
], 8, _hoisted_2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
28
|
-
createVNode(unref(ScalarIconGavel), {
|
|
29
|
-
weight: "bold",
|
|
30
|
-
class: "size-3 text-current"
|
|
31
|
-
}),
|
|
32
|
-
createElementVNode("span", _hoisted_4, toDisplayString(__props.value?.name), 1)
|
|
33
|
-
], 64))
|
|
34
|
-
]);
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
export {
|
|
39
|
-
_sfc_main as default
|
|
40
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, createCommentVNode, openBlock, createElementVNode, createVNode, unref } from "vue";
|
|
2
|
-
import { ScalarIconScroll } from "@scalar/icons";
|
|
3
|
-
const _hoisted_1 = {
|
|
4
|
-
key: 0,
|
|
5
|
-
class: "group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto"
|
|
6
|
-
};
|
|
7
|
-
const _hoisted_2 = ["href"];
|
|
8
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
-
__name: "TermsOfService",
|
|
10
|
-
props: {
|
|
11
|
-
value: {}
|
|
12
|
-
},
|
|
13
|
-
setup(__props) {
|
|
14
|
-
return (_ctx, _cache) => {
|
|
15
|
-
return __props.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
16
|
-
createElementVNode("a", {
|
|
17
|
-
class: "text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none",
|
|
18
|
-
href: __props.value,
|
|
19
|
-
target: "_blank",
|
|
20
|
-
rel: "noopener noreferrer"
|
|
21
|
-
}, [
|
|
22
|
-
createVNode(unref(ScalarIconScroll), {
|
|
23
|
-
weight: "bold",
|
|
24
|
-
class: "size-3 text-current"
|
|
25
|
-
}),
|
|
26
|
-
_cache[0] || (_cache[0] = createElementVNode("span", { class: "ml-1 empty:hidden" }, "Terms of Service", -1))
|
|
27
|
-
], 8, _hoisted_2)
|
|
28
|
-
])) : createCommentVNode("", true);
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
export {
|
|
33
|
-
_sfc_main as default
|
|
34
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, createElementBlock, createCommentVNode, openBlock, createVNode, unref, withCtx, createElementVNode, toDisplayString, normalizeClass } from "vue";
|
|
2
|
-
import { ScalarListbox } from "@scalar/components";
|
|
3
|
-
import { ScalarIconCaretDown } from "@scalar/icons";
|
|
4
|
-
const _hoisted_1 = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "document-selector p-3 pb-0"
|
|
7
|
-
};
|
|
8
|
-
const _hoisted_2 = {
|
|
9
|
-
class: "group/dropdown-label text-c-2 hover:text-c-1 flex w-full cursor-pointer items-center gap-1 font-medium",
|
|
10
|
-
type: "button"
|
|
11
|
-
};
|
|
12
|
-
const _hoisted_3 = { class: "overflow-hidden text-base text-ellipsis" };
|
|
13
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
-
__name: "DocumentSelector",
|
|
15
|
-
props: {
|
|
16
|
-
options: {},
|
|
17
|
-
modelValue: {}
|
|
18
|
-
},
|
|
19
|
-
emits: ["update:modelValue"],
|
|
20
|
-
setup(__props, { emit: __emit }) {
|
|
21
|
-
const props = __props;
|
|
22
|
-
const emit = __emit;
|
|
23
|
-
const formattedOptions = computed(
|
|
24
|
-
() => props.options.map((o) => ({ id: o.id, label: o.label }))
|
|
25
|
-
);
|
|
26
|
-
const selected = computed(
|
|
27
|
-
() => formattedOptions.value.find((o) => o.id === props.modelValue)
|
|
28
|
-
);
|
|
29
|
-
return (_ctx, _cache) => {
|
|
30
|
-
return __props.options.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
31
|
-
createVNode(unref(ScalarListbox), {
|
|
32
|
-
modelValue: selected.value,
|
|
33
|
-
options: formattedOptions.value,
|
|
34
|
-
resize: "",
|
|
35
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = (e) => emit("update:modelValue", e.id))
|
|
36
|
-
}, {
|
|
37
|
-
default: withCtx(({ open }) => [
|
|
38
|
-
createElementVNode("button", _hoisted_2, [
|
|
39
|
-
createElementVNode("span", _hoisted_3, toDisplayString(selected.value?.label || "Select API"), 1),
|
|
40
|
-
createVNode(unref(ScalarIconCaretDown), {
|
|
41
|
-
class: normalizeClass(["size-3 text-current transition-transform", { "rotate-180": open }]),
|
|
42
|
-
weight: "bold"
|
|
43
|
-
}, null, 8, ["class"])
|
|
44
|
-
])
|
|
45
|
-
]),
|
|
46
|
-
_: 1
|
|
47
|
-
}, 8, ["modelValue", "options"])
|
|
48
|
-
])) : createCommentVNode("", true);
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
export {
|
|
53
|
-
_sfc_main as default
|
|
54
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, createElementBlock, createCommentVNode, openBlock, Fragment, renderList, createBlock, unref, withCtx, resolveDynamicComponent, mergeProps } from "vue";
|
|
2
|
-
import { ScalarErrorBoundary } from "@scalar/components";
|
|
3
|
-
import { usePluginManager } from "../../plugins/hooks/usePluginManager.js";
|
|
4
|
-
const _hoisted_1 = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "text-base"
|
|
7
|
-
};
|
|
8
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
-
__name: "SpecificationExtension",
|
|
10
|
-
props: {
|
|
11
|
-
value: {}
|
|
12
|
-
},
|
|
13
|
-
setup(__props) {
|
|
14
|
-
const { getSpecificationExtensions } = usePluginManager();
|
|
15
|
-
function getCustomExtensionNames(value) {
|
|
16
|
-
return Object.keys(value ?? {}).filter(
|
|
17
|
-
(item) => item.startsWith("x-")
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
function getCustomOpenApiExtensionComponents(extensionNames) {
|
|
21
|
-
return extensionNames.flatMap((name) => getSpecificationExtensions(name)).filter((extension) => extension.component);
|
|
22
|
-
}
|
|
23
|
-
const customExtensionNames = computed(() => getCustomExtensionNames(__props.value));
|
|
24
|
-
const customExtensions = computed(
|
|
25
|
-
() => getCustomOpenApiExtensionComponents(customExtensionNames.value)
|
|
26
|
-
);
|
|
27
|
-
return (_ctx, _cache) => {
|
|
28
|
-
return typeof __props.value === "object" && customExtensions.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
29
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(customExtensions.value, (extension) => {
|
|
30
|
-
return openBlock(), createBlock(unref(ScalarErrorBoundary), null, {
|
|
31
|
-
default: withCtx(() => [
|
|
32
|
-
extension.renderer ? (openBlock(), createBlock(resolveDynamicComponent(extension.renderer), mergeProps({
|
|
33
|
-
key: 0,
|
|
34
|
-
ref_for: true
|
|
35
|
-
}, {
|
|
36
|
-
[extension.name]: __props.value?.[extension.name],
|
|
37
|
-
component: extension.component
|
|
38
|
-
}), null, 16)) : (openBlock(), createBlock(resolveDynamicComponent(extension.component), mergeProps({
|
|
39
|
-
key: 1,
|
|
40
|
-
ref_for: true
|
|
41
|
-
}, { [extension.name]: __props.value?.[extension.name] }), null, 16))
|
|
42
|
-
]),
|
|
43
|
-
_: 2
|
|
44
|
-
}, 1024);
|
|
45
|
-
}), 256))
|
|
46
|
-
])) : createCommentVNode("", true);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
export {
|
|
51
|
-
_sfc_main as default
|
|
52
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import _sfc_main from "./TestRequestButton.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const TestRequestButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-342ba62a"]]);
|
|
5
|
-
export {
|
|
6
|
-
TestRequestButton as default
|
|
7
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, withModifiers, createVNode, createElementVNode, unref, withCtx, createTextVNode, toDisplayString } from "vue";
|
|
2
|
-
import { ScalarIconPlay } from "@scalar/icons";
|
|
3
|
-
import ScreenReader from "../../components/ScreenReader.vue.js";
|
|
4
|
-
const _hoisted_1 = ["method"];
|
|
5
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
-
__name: "TestRequestButton",
|
|
7
|
-
props: {
|
|
8
|
-
id: {},
|
|
9
|
-
method: {},
|
|
10
|
-
path: {},
|
|
11
|
-
eventBus: {},
|
|
12
|
-
exampleName: {}
|
|
13
|
-
},
|
|
14
|
-
setup(__props) {
|
|
15
|
-
const handleClick = () => {
|
|
16
|
-
const payload = {
|
|
17
|
-
id: __props.id,
|
|
18
|
-
...__props.exampleName && { exampleName: __props.exampleName }
|
|
19
|
-
};
|
|
20
|
-
__props.eventBus.emit("ui:open:client-modal", payload);
|
|
21
|
-
};
|
|
22
|
-
return (_ctx, _cache) => {
|
|
23
|
-
return openBlock(), createElementBlock("button", {
|
|
24
|
-
class: "show-api-client-button",
|
|
25
|
-
method: __props.method,
|
|
26
|
-
type: "button",
|
|
27
|
-
onClick: withModifiers(handleClick, ["stop"])
|
|
28
|
-
}, [
|
|
29
|
-
createVNode(unref(ScalarIconPlay), {
|
|
30
|
-
class: "size-3",
|
|
31
|
-
weight: "fill"
|
|
32
|
-
}),
|
|
33
|
-
_cache[0] || (_cache[0] = createElementVNode("span", null, "Test Request", -1)),
|
|
34
|
-
createVNode(ScreenReader, null, {
|
|
35
|
-
default: withCtx(() => [
|
|
36
|
-
createTextVNode("(" + toDisplayString(__props.method) + " " + toDisplayString(__props.path) + ")", 1)
|
|
37
|
-
]),
|
|
38
|
-
_: 1
|
|
39
|
-
})
|
|
40
|
-
], 8, _hoisted_1);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
export {
|
|
45
|
-
_sfc_main as default
|
|
46
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, createElementBlock, createCommentVNode, openBlock, Fragment, renderList, createBlock, unref, withCtx, createTextVNode, toDisplayString } from "vue";
|
|
2
|
-
import Badge from "../../components/Badge/Badge.vue.js";
|
|
3
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
-
__name: "XBadges",
|
|
5
|
-
props: {
|
|
6
|
-
position: {},
|
|
7
|
-
badges: {}
|
|
8
|
-
},
|
|
9
|
-
setup(__props) {
|
|
10
|
-
const filteredBadges = computed(() => {
|
|
11
|
-
if (Array.isArray(__props.badges)) {
|
|
12
|
-
return __props.badges.filter(
|
|
13
|
-
(badge) => badge.position === __props.position || __props.position === "after" && !badge.position
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
return [];
|
|
17
|
-
});
|
|
18
|
-
return (_ctx, _cache) => {
|
|
19
|
-
return filteredBadges.value.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(filteredBadges.value, (badge) => {
|
|
20
|
-
return openBlock(), createBlock(unref(Badge), {
|
|
21
|
-
key: badge.name,
|
|
22
|
-
color: badge.color
|
|
23
|
-
}, {
|
|
24
|
-
default: withCtx(() => [
|
|
25
|
-
createTextVNode(toDisplayString(badge.name), 1)
|
|
26
|
-
]),
|
|
27
|
-
_: 2
|
|
28
|
-
}, 1032, ["color"]);
|
|
29
|
-
}), 128)) : createCommentVNode("", true);
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
export {
|
|
34
|
-
_sfc_main as default
|
|
35
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const getSystemModePreference = () => {
|
|
2
|
-
if (typeof window === "undefined" || typeof window?.matchMedia !== "function") {
|
|
3
|
-
return "light";
|
|
4
|
-
}
|
|
5
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
getSystemModePreference
|
|
9
|
-
};
|
package/dist/helpers/download.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { isDefined, isJsonString } from "@scalar/oas-utils/helpers";
|
|
2
|
-
import { toJson, normalize, toYaml } from "@scalar/openapi-parser";
|
|
3
|
-
function formatContent(content, isJson) {
|
|
4
|
-
if (isJson && !isJsonString(content)) {
|
|
5
|
-
return toJson(normalize(content));
|
|
6
|
-
}
|
|
7
|
-
if (!isJson && isJsonString(content)) {
|
|
8
|
-
return toYaml(normalize(content));
|
|
9
|
-
}
|
|
10
|
-
return content;
|
|
11
|
-
}
|
|
12
|
-
function createClickEvent() {
|
|
13
|
-
try {
|
|
14
|
-
return new MouseEvent("click", {
|
|
15
|
-
bubbles: true,
|
|
16
|
-
cancelable: true,
|
|
17
|
-
view: window
|
|
18
|
-
});
|
|
19
|
-
} catch {
|
|
20
|
-
return new MouseEvent("click", {
|
|
21
|
-
bubbles: true,
|
|
22
|
-
cancelable: true
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function downloadDocument(content, filename, format) {
|
|
27
|
-
const isJson = format === "json" || !isDefined(format) && isJsonString(content);
|
|
28
|
-
const formattedContent = formatContent(content, isJson);
|
|
29
|
-
const extension = isJson ? ".json" : ".yaml";
|
|
30
|
-
const mimeType = isJson ? "application/json" : "application/x-yaml";
|
|
31
|
-
const contentFilename = filename ? filename + extension : "openapi" + extension;
|
|
32
|
-
const blob = new Blob([formattedContent], { type: mimeType });
|
|
33
|
-
const data = URL.createObjectURL(blob);
|
|
34
|
-
const link = document.createElement("a");
|
|
35
|
-
link.href = data;
|
|
36
|
-
link.download = contentFilename;
|
|
37
|
-
link.dispatchEvent(createClickEvent());
|
|
38
|
-
setTimeout(() => {
|
|
39
|
-
window.URL.revokeObjectURL(data);
|
|
40
|
-
link.remove();
|
|
41
|
-
}, 100);
|
|
42
|
-
}
|
|
43
|
-
export {
|
|
44
|
-
downloadDocument
|
|
45
|
-
};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
const sanitizeBasePath = (basePath) => {
|
|
2
|
-
return basePath.replace(/^\/+|\/+$/g, "");
|
|
3
|
-
};
|
|
4
|
-
const isHashBasePath = (basePath) => basePath.startsWith("#");
|
|
5
|
-
const sanitizeHashBasePath = (basePath) => {
|
|
6
|
-
return basePath.replace(/^#+/, "").replace(/\/+$/g, "");
|
|
7
|
-
};
|
|
8
|
-
const applySlugPrefix = (base, slugPrefix) => {
|
|
9
|
-
return slugPrefix ? `${slugPrefix}${base ? "/" : ""}${base}` : base;
|
|
10
|
-
};
|
|
11
|
-
const stripBasePathPrefix = (value, basePath) => {
|
|
12
|
-
if (value === basePath) {
|
|
13
|
-
return "";
|
|
14
|
-
}
|
|
15
|
-
if (value.startsWith(`${basePath}/`)) {
|
|
16
|
-
return value.slice(basePath.length + 1);
|
|
17
|
-
}
|
|
18
|
-
return null;
|
|
19
|
-
};
|
|
20
|
-
const getIdFromHash = (location, slugPrefix) => {
|
|
21
|
-
const url = typeof location === "string" ? new URL(location) : location;
|
|
22
|
-
const base = decodeURIComponent(url.hash.slice(1));
|
|
23
|
-
return applySlugPrefix(base, slugPrefix);
|
|
24
|
-
};
|
|
25
|
-
const getIdFromPath = (location, basePath, slugPrefix) => {
|
|
26
|
-
const url = typeof location === "string" ? new URL(location) : location;
|
|
27
|
-
const sanitized = sanitizeBasePath(basePath);
|
|
28
|
-
const basePathWithSlash = sanitized ? `/${sanitized.split("/").map((segment) => encodeURIComponent(segment)).join("/")}` : "";
|
|
29
|
-
if (url.pathname.startsWith(basePathWithSlash)) {
|
|
30
|
-
const remainder = url.pathname.slice(basePathWithSlash.length);
|
|
31
|
-
const base = decodeURIComponent(remainder.startsWith("/") ? remainder.slice(1) : remainder);
|
|
32
|
-
return applySlugPrefix(base, slugPrefix);
|
|
33
|
-
}
|
|
34
|
-
return slugPrefix ?? "";
|
|
35
|
-
};
|
|
36
|
-
const getIdFromHashBasePath = (location, basePath, slugPrefix) => {
|
|
37
|
-
const url = typeof location === "string" ? new URL(location) : location;
|
|
38
|
-
const hash = decodeURIComponent(url.hash.slice(1));
|
|
39
|
-
const sanitized = sanitizeHashBasePath(basePath);
|
|
40
|
-
const remainder = stripBasePathPrefix(hash, sanitized);
|
|
41
|
-
if (remainder !== null) {
|
|
42
|
-
return applySlugPrefix(remainder, slugPrefix);
|
|
43
|
-
}
|
|
44
|
-
return slugPrefix ?? "";
|
|
45
|
-
};
|
|
46
|
-
const matchesBasePath = (location, basePath) => {
|
|
47
|
-
const url = typeof location === "string" ? new URL(location) : location;
|
|
48
|
-
if (isHashBasePath(basePath)) {
|
|
49
|
-
const hash = decodeURIComponent(url.hash);
|
|
50
|
-
return hash === basePath || hash.startsWith(`${basePath}/`);
|
|
51
|
-
}
|
|
52
|
-
const sanitized = sanitizeBasePath(basePath);
|
|
53
|
-
const basePathWithSlash = sanitized ? `/${sanitized.split("/").map((segment) => encodeURIComponent(segment)).join("/")}` : "";
|
|
54
|
-
return url.pathname === basePathWithSlash || url.pathname.startsWith(`${basePathWithSlash}/`);
|
|
55
|
-
};
|
|
56
|
-
const getIdFromUrl = (url, basePath, slugPrefix) => {
|
|
57
|
-
if (typeof basePath !== "string") {
|
|
58
|
-
return getIdFromHash(url, slugPrefix);
|
|
59
|
-
}
|
|
60
|
-
return isHashBasePath(basePath) ? getIdFromHashBasePath(url, basePath, slugPrefix) : getIdFromPath(url, basePath, slugPrefix);
|
|
61
|
-
};
|
|
62
|
-
const stripFirstSegment = (id) => {
|
|
63
|
-
const hasTrailingSlash = id.endsWith("/");
|
|
64
|
-
const segments = id.split("/").filter(Boolean).slice(1);
|
|
65
|
-
const result = segments.join("/");
|
|
66
|
-
return hasTrailingSlash && result ? `${result}/` : result;
|
|
67
|
-
};
|
|
68
|
-
const makeUrlFromId = (_id, basePath, isMultiDocument) => {
|
|
69
|
-
if (typeof window === "undefined") {
|
|
70
|
-
return void 0;
|
|
71
|
-
}
|
|
72
|
-
const id = isMultiDocument ? _id : stripFirstSegment(_id);
|
|
73
|
-
const url = new URL(window.location.href);
|
|
74
|
-
if (typeof basePath === "string") {
|
|
75
|
-
if (isHashBasePath(basePath)) {
|
|
76
|
-
const base = sanitizeHashBasePath(basePath);
|
|
77
|
-
url.hash = [base, id].filter(Boolean).join("/");
|
|
78
|
-
} else {
|
|
79
|
-
const base = sanitizeBasePath(basePath);
|
|
80
|
-
url.pathname = `${base}/${id}`;
|
|
81
|
-
}
|
|
82
|
-
} else {
|
|
83
|
-
url.hash = id;
|
|
84
|
-
}
|
|
85
|
-
return url;
|
|
86
|
-
};
|
|
87
|
-
const getSchemaParamsFromId = (id) => {
|
|
88
|
-
const matcher = id.match(/(.*)(\.body\.|\.path\.|\.query\.|\.header\.)(.*)/);
|
|
89
|
-
if (matcher && typeof matcher[1] === "string" && typeof matcher[2] === "string") {
|
|
90
|
-
return {
|
|
91
|
-
rawId: matcher[1],
|
|
92
|
-
params: matcher[2].slice(1) + matcher[3]
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
return {
|
|
96
|
-
rawId: id,
|
|
97
|
-
params: ""
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
export {
|
|
101
|
-
getIdFromHash,
|
|
102
|
-
getIdFromHashBasePath,
|
|
103
|
-
getIdFromPath,
|
|
104
|
-
getIdFromUrl,
|
|
105
|
-
getSchemaParamsFromId,
|
|
106
|
-
makeUrlFromId,
|
|
107
|
-
matchesBasePath,
|
|
108
|
-
sanitizeBasePath
|
|
109
|
-
};
|
package/dist/helpers/lazy-bus.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { watchDebounced } from "@vueuse/core";
|
|
2
|
-
import { nanoid } from "nanoid";
|
|
3
|
-
import { computed, reactive, ref, onBeforeUnmount, nextTick } from "vue";
|
|
4
|
-
import { getSchemaParamsFromId } from "./id-routing.js";
|
|
5
|
-
const priorityQueue = reactive(/* @__PURE__ */ new Set());
|
|
6
|
-
const pendingQueue = reactive(/* @__PURE__ */ new Set());
|
|
7
|
-
const readyQueue = reactive(/* @__PURE__ */ new Set());
|
|
8
|
-
const isRunning = ref(false);
|
|
9
|
-
const SCROLL_RETRY_MS = 3e3;
|
|
10
|
-
const firstLazyLoadComplete = ref(false);
|
|
11
|
-
const intersectionBlockers = reactive(/* @__PURE__ */ new Set());
|
|
12
|
-
const onRenderComplete = /* @__PURE__ */ new Set();
|
|
13
|
-
const lazyPlaceholderHeights = reactive(/* @__PURE__ */ new Map());
|
|
14
|
-
const getLazyPlaceholderHeight = (id) => lazyPlaceholderHeights.get(id);
|
|
15
|
-
const setLazyPlaceholderHeight = (id, height) => {
|
|
16
|
-
if (!Number.isFinite(height) || height <= 0) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
lazyPlaceholderHeights.set(id, Math.round(height));
|
|
20
|
-
};
|
|
21
|
-
const addLazyCompleteCallback = (callback) => {
|
|
22
|
-
if (callback) {
|
|
23
|
-
onRenderComplete.add(callback);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const blockIntersection = () => {
|
|
27
|
-
const blockId = nanoid();
|
|
28
|
-
intersectionBlockers.add(blockId);
|
|
29
|
-
return () => setTimeout(() => intersectionBlockers.delete(blockId), 100);
|
|
30
|
-
};
|
|
31
|
-
const intersectionEnabled = computed(() => intersectionBlockers.size === 0);
|
|
32
|
-
const runLazyBus = () => {
|
|
33
|
-
if (typeof window === "undefined") {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
if (isRunning.value) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
isRunning.value = true;
|
|
40
|
-
const processQueue = async () => {
|
|
41
|
-
const priorityIds = [...priorityQueue];
|
|
42
|
-
const pendingIds = [...pendingQueue];
|
|
43
|
-
if (priorityIds.length === 0 && pendingIds.length === 0) {
|
|
44
|
-
onRenderComplete.forEach((fn) => fn());
|
|
45
|
-
onRenderComplete.clear();
|
|
46
|
-
isRunning.value = false;
|
|
47
|
-
firstLazyLoadComplete.value = true;
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
for (const id of priorityIds) {
|
|
51
|
-
readyQueue.add(id);
|
|
52
|
-
priorityQueue.delete(id);
|
|
53
|
-
}
|
|
54
|
-
for (const id of pendingIds) {
|
|
55
|
-
readyQueue.add(id);
|
|
56
|
-
pendingQueue.delete(id);
|
|
57
|
-
}
|
|
58
|
-
await nextTick();
|
|
59
|
-
onRenderComplete.forEach((fn) => fn());
|
|
60
|
-
onRenderComplete.clear();
|
|
61
|
-
isRunning.value = false;
|
|
62
|
-
firstLazyLoadComplete.value = true;
|
|
63
|
-
};
|
|
64
|
-
if (window.requestIdleCallback) {
|
|
65
|
-
window.requestIdleCallback(processQueue, { timeout: 1500 });
|
|
66
|
-
} else {
|
|
67
|
-
nextTick(processQueue);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
watchDebounced(
|
|
71
|
-
[() => pendingQueue.size, () => priorityQueue.size, () => isRunning.value],
|
|
72
|
-
() => {
|
|
73
|
-
if ((pendingQueue.size > 0 || priorityQueue.size > 0) && !isRunning.value) {
|
|
74
|
-
runLazyBus();
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
{ debounce: 300, maxWait: 1500 }
|
|
78
|
-
);
|
|
79
|
-
const addToPendingQueue = (id) => {
|
|
80
|
-
if (id && !readyQueue.has(id) && !priorityQueue.has(id)) {
|
|
81
|
-
pendingQueue.add(id);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
const addToPriorityQueue = (id) => {
|
|
85
|
-
if (id && !priorityQueue.has(id)) {
|
|
86
|
-
priorityQueue.add(id);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
const requestLazyRender = (id, priority = false) => {
|
|
90
|
-
if (!id || readyQueue.has(id)) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
if (priority) {
|
|
94
|
-
addToPriorityQueue(id);
|
|
95
|
-
} else {
|
|
96
|
-
addToPendingQueue(id);
|
|
97
|
-
}
|
|
98
|
-
if (!isRunning.value) {
|
|
99
|
-
runLazyBus();
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
const scheduleInitialLoadComplete = () => {
|
|
103
|
-
if (typeof window === "undefined") {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
const delay = 400;
|
|
107
|
-
window.setTimeout(() => runLazyBus(), delay);
|
|
108
|
-
};
|
|
109
|
-
const resetLazyElement = (id) => {
|
|
110
|
-
priorityQueue.delete(id);
|
|
111
|
-
pendingQueue.delete(id);
|
|
112
|
-
readyQueue.delete(id);
|
|
113
|
-
lazyPlaceholderHeights.delete(id);
|
|
114
|
-
};
|
|
115
|
-
function useLazyBus(id) {
|
|
116
|
-
onBeforeUnmount(() => {
|
|
117
|
-
resetLazyElement(id);
|
|
118
|
-
});
|
|
119
|
-
return {
|
|
120
|
-
isReady: computed(() => typeof window === "undefined" || priorityQueue.has(id) || readyQueue.has(id))
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
const scrollToLazy = (id, setExpanded, getEntryById) => {
|
|
124
|
-
const item = getEntryById(id);
|
|
125
|
-
const isLazy = !readyQueue.has(id) || item?.children?.some((child) => !readyQueue.has(child.id));
|
|
126
|
-
const unfreeze = isLazy ? freeze(id) : void 0;
|
|
127
|
-
addLazyCompleteCallback(unfreeze);
|
|
128
|
-
const unblock = blockIntersection();
|
|
129
|
-
const { rawId } = getSchemaParamsFromId(id);
|
|
130
|
-
addToPriorityQueue(id);
|
|
131
|
-
addToPriorityQueue(rawId);
|
|
132
|
-
if (item?.children) {
|
|
133
|
-
item.children.slice(0, 2).forEach((child) => addToPriorityQueue(child.id));
|
|
134
|
-
}
|
|
135
|
-
if (item?.parent) {
|
|
136
|
-
const parent = getEntryById(item.parent.id);
|
|
137
|
-
const elementIdx = parent?.children?.findIndex((child) => child.id === id);
|
|
138
|
-
if (elementIdx !== void 0 && elementIdx >= 0) {
|
|
139
|
-
parent?.children?.slice(elementIdx, elementIdx + 2).forEach((child) => addToPriorityQueue(child.id));
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
setExpanded(rawId, true);
|
|
143
|
-
const addParents = (currentId) => {
|
|
144
|
-
const parent = getEntryById(currentId)?.parent;
|
|
145
|
-
if (parent) {
|
|
146
|
-
addToPriorityQueue(parent.id);
|
|
147
|
-
setExpanded(parent.id, true);
|
|
148
|
-
addParents(parent.id);
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
addParents(rawId);
|
|
152
|
-
void nextTick(() => {
|
|
153
|
-
tryScroll(id, Date.now() + SCROLL_RETRY_MS, unblock, unfreeze);
|
|
154
|
-
});
|
|
155
|
-
};
|
|
156
|
-
const tryScroll = (id, stopTime, onComplete, onFailure) => {
|
|
157
|
-
const element = document.getElementById(id);
|
|
158
|
-
if (element) {
|
|
159
|
-
element.scrollIntoView({ block: "start" });
|
|
160
|
-
onComplete();
|
|
161
|
-
} else if (Date.now() < stopTime) {
|
|
162
|
-
requestAnimationFrame(() => tryScroll(id, stopTime, onComplete, onFailure));
|
|
163
|
-
} else {
|
|
164
|
-
onComplete();
|
|
165
|
-
onFailure?.();
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
const freeze = (id) => {
|
|
169
|
-
let stop = false;
|
|
170
|
-
const runFrame = (stopAfterFrame) => {
|
|
171
|
-
const element = document.getElementById(id);
|
|
172
|
-
if (element) {
|
|
173
|
-
element.scrollIntoView({ block: "start" });
|
|
174
|
-
}
|
|
175
|
-
if (!stopAfterFrame) {
|
|
176
|
-
requestAnimationFrame(() => runFrame(stop));
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
runFrame(false);
|
|
180
|
-
return () => {
|
|
181
|
-
stop = true;
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
export {
|
|
185
|
-
addToPriorityQueue,
|
|
186
|
-
blockIntersection,
|
|
187
|
-
firstLazyLoadComplete,
|
|
188
|
-
getLazyPlaceholderHeight,
|
|
189
|
-
intersectionEnabled,
|
|
190
|
-
requestLazyRender,
|
|
191
|
-
scheduleInitialLoadComplete,
|
|
192
|
-
scrollToLazy,
|
|
193
|
-
setLazyPlaceholderHeight,
|
|
194
|
-
useLazyBus
|
|
195
|
-
};
|