@scalar/api-reference 1.61.0 → 1.62.1
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 +31 -0
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.js.map +1 -1
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.script.js +8 -5
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.script.js.map +1 -1
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.js.map +1 -1
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js +11 -7
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js.map +1 -1
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.d.ts +36 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.d.ts.map +1 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.js +7 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.js.map +1 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.script.js +69 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.script.js.map +1 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.d.ts +28 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.d.ts.map +1 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.js +7 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.js.map +1 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js +62 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js.map +1 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.d.ts +18 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.d.ts.map +1 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.js +59 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.js.map +1 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/index.d.ts +3 -0
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/index.d.ts.map +1 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js +6 -3
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts +2 -2
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js +4 -2
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js.map +1 -1
- package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.d.ts +1 -1
- package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.d.ts.map +1 -1
- package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js +3 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js +17 -3
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js +4 -2
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js.map +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.js +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.js.map +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js +16 -12
- package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js +11 -7
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js +7 -4
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js.map +1 -1
- package/dist/browser/chunks/AgentScalarChatInterface-D7J_MHKY.js +27 -0
- package/dist/browser/chunks/ScalarTextInput.vue-Fb0snAee.js +27 -0
- package/dist/browser/chunks/basic-shape-diamond.svg-BTEOT1FL.js +1 -1
- package/dist/browser/chunks/basic-shape-hexagon.svg-BSPzaCgF.js +1 -1
- package/dist/browser/chunks/basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js +1 -1
- package/dist/browser/chunks/basic-shape-primary-square-rectangle.svg-n2YRykHD.js +1 -1
- package/dist/browser/chunks/basic-shape-shield.svg-Bec9cJDA.js +1 -1
- package/dist/browser/chunks/browser-67K6wmG9.js +1 -1
- package/dist/browser/chunks/computer-device-desktop-monitor.svg-m6j893Hb.js +1 -1
- package/dist/browser/chunks/computer-device-desktop.svg-Dk1VVO7k.js +1 -1
- package/dist/browser/chunks/computer-device-laptop.svg-BNGVUCYS.js +1 -1
- package/dist/browser/chunks/computer-device-mobile-phone-android-samsung-back.svg-CC4UUTFw.js +1 -1
- package/dist/browser/chunks/computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js +1 -1
- package/dist/browser/chunks/computer-device-mobile-phone-iphone-x-back.svg-CLm7sgMM.js +1 -1
- package/dist/browser/chunks/computer-device-mobile-phone-iphone-x.svg-Xrttg6_7.js +1 -1
- package/dist/browser/chunks/computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js +1 -1
- package/dist/browser/chunks/computer-device-mobile-tablet.svg-DCr0XlRc.js +1 -1
- package/dist/browser/chunks/computer-device-network-ethernet-cat6.svg-AK9l0iOl.js +1 -1
- package/dist/browser/chunks/computer-device-network-lan-www.svg-gUIdFBlE.js +1 -1
- package/dist/browser/chunks/computer-device-network-wifi-connection.svg-Be-EMm4e.js +1 -1
- package/dist/browser/chunks/computer-device-network-wifi-router.svg-Dc2VzyqK.js +1 -1
- package/dist/browser/chunks/ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js +1 -1
- package/dist/browser/chunks/image-flash-lightning.svg-EETR_y1q.js +1 -1
- package/dist/browser/chunks/image-picture-flower.svg-DN1AYzJU.js +1 -1
- package/dist/browser/chunks/interface-alert-exclamation-diamond.svg-C5NozMV_.js +1 -1
- package/dist/browser/chunks/interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js +1 -1
- package/dist/browser/chunks/interface-alert-information-circle.svg-ckkkt9Mv.js +1 -1
- package/dist/browser/chunks/interface-award-crown.svg-pjvn9hY-.js +1 -1
- package/dist/browser/chunks/interface-bookmark-tag.svg-r2r-lQq4.js +1 -1
- package/dist/browser/chunks/interface-bookmark.svg-BK9HKQBT.js +1 -1
- package/dist/browser/chunks/interface-calendar-date-one.svg-DNnF0M1I.js +1 -1
- package/dist/browser/chunks/interface-content-book-open-pages.svg-CQj_w9Vp.js +1 -1
- package/dist/browser/chunks/interface-content-book-page.svg-DppoeJRe.js +1 -1
- package/dist/browser/chunks/interface-content-file.svg-CvcD7OiY.js +1 -1
- package/dist/browser/chunks/interface-content-folder.svg-BmtS5I9A.js +1 -1
- package/dist/browser/chunks/interface-copy-clipboard.svg-Be6EI50X.js +1 -1
- package/dist/browser/chunks/interface-edit-attachment.svg-G5TKzpWX.js +1 -1
- package/dist/browser/chunks/interface-edit-binocular.svg-jzL-DvGB.js +1 -1
- package/dist/browser/chunks/interface-edit-magic-wand.svg-BOTlymvp.js +1 -1
- package/dist/browser/chunks/interface-edit-tool-paint-roller.svg-s9dwryx7.js +1 -1
- package/dist/browser/chunks/interface-edit-tool-pencil.svg-C7v0dbB3.js +1 -1
- package/dist/browser/chunks/interface-favorite-award.svg-CYHUgUG0.js +1 -1
- package/dist/browser/chunks/interface-favorite-flag.svg-C10zlKOb.js +1 -1
- package/dist/browser/chunks/interface-favorite-heart.svg-eoduXxlz.js +1 -1
- package/dist/browser/chunks/interface-favorite-star.svg-BSmxJetr.js +1 -1
- package/dist/browser/chunks/interface-favorite-stars-sparkles.svg-JTFLj3Ls.js +1 -1
- package/dist/browser/chunks/interface-hierarchy-flowchart.svg-Cg_Wy0kN.js +1 -1
- package/dist/browser/chunks/interface-home-house.svg-DytoGRnv.js +1 -1
- package/dist/browser/chunks/interface-hyperlink.svg-CuEfmmQI.js +1 -1
- package/dist/browser/chunks/interface-lighting-brightness.svg-DSK0h_Pa.js +1 -1
- package/dist/browser/chunks/interface-lock-closed.svg-Cn6TaLYv.js +1 -1
- package/dist/browser/chunks/interface-lock-open-unlock.svg-CVkG5-9W.js +1 -1
- package/dist/browser/chunks/interface-login-key.svg-y-cwwXjN.js +1 -1
- package/dist/browser/chunks/interface-search.svg-S-puVFJB.js +1 -1
- package/dist/browser/chunks/interface-setting-cog.svg-CTH4_lLg.js +1 -1
- package/dist/browser/chunks/interface-share-megaphone-bullhorn.svg-Pbp39MyC.js +1 -1
- package/dist/browser/chunks/interface-share-rocket.svg-BgCsIRZO.js +1 -1
- package/dist/browser/chunks/interface-share-satellite.svg-DAMN9d5G.js +1 -1
- package/dist/browser/chunks/interface-share-space-ship.svg-Dt-Mejxk.js +1 -1
- package/dist/browser/chunks/interface-share.svg-vFYTXSti.js +1 -1
- package/dist/browser/chunks/interface-signal-square.svg-DNG4LpAe.js +1 -1
- package/dist/browser/chunks/interface-time-clock-circle.svg-Bpz-nLxo.js +1 -1
- package/dist/browser/chunks/interface-time-hour-glass.svg-D7agfKsH.js +1 -1
- package/dist/browser/chunks/interface-users-multiple.svg-CkPJBBnG.js +1 -1
- package/dist/browser/chunks/interface-weather-moon.svg-CaTZFMPO.js +1 -1
- package/dist/browser/chunks/mail-chat-bubble-square.svg-DC8RIihp.js +1 -1
- package/dist/browser/chunks/mail-send-email-paper-airplane.svg-D8OLs9jz.js +1 -1
- package/dist/browser/chunks/mail-send-envelope.svg-CV33h5Sx.js +1 -1
- package/dist/browser/chunks/{modal-CZI71Aau.js → modal-BLBi4S4R.js} +20 -20
- package/dist/browser/chunks/{modal-CKthJJWy.js → modal-BlpWsFBT.js} +2 -2
- package/dist/browser/chunks/money-cashier-receipt.svg-CJL8C2gs.js +1 -1
- package/dist/browser/chunks/money-currency-dollar-pay.svg-VdBplCTx.js +1 -1
- package/dist/browser/chunks/money-graph-arrow-increase.svg-DcRov3zk.js +1 -1
- package/dist/browser/chunks/money-graph-bar-chart-increase.svg-Cc7KxjX-.js +1 -1
- package/dist/browser/chunks/nature-ecology-leaf.svg-DR3cTZxt.js +1 -1
- package/dist/browser/chunks/phone-telephone.svg-DyY0gUlk.js +1 -1
- package/dist/browser/chunks/programming-bug.svg-BHLT-Qhp.js +1 -1
- package/dist/browser/chunks/programming-cloud.svg-B6YW33ba.js +1 -1
- package/dist/browser/chunks/programming-computer-database-server.svg-B6o5Sdn-.js +1 -1
- package/dist/browser/chunks/programming-computer-database.svg-Cl7OVtpJ.js +1 -1
- package/dist/browser/chunks/programming-module-four-layout.svg-BQrerL1x.js +1 -1
- package/dist/browser/chunks/programming-module-three.svg-B2KTQzBM.js +1 -1
- package/dist/browser/chunks/programming-module.svg-CiID7kPm.js +1 -1
- package/dist/browser/chunks/programming-script-code.svg-D1M5rtkN.js +1 -1
- package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +1 -1
- package/dist/browser/chunks/shopping-cart.svg-BEegiIR9.js +1 -1
- package/dist/browser/chunks/shopping-gift-present.svg-BUHwuLix.js +1 -1
- package/dist/browser/chunks/shopping-shipping-box-parcel-package.svg-D6fxWdYx.js +1 -1
- package/dist/browser/chunks/tag-new-circle.svg-jsg1bGs0.js +1 -1
- package/dist/browser/chunks/travel-map-earth-globe.svg-ClbMiU-f.js +1 -1
- package/dist/browser/chunks/vendor-DHN5fsxL.js +306 -0
- package/dist/browser/standalone.esm.js +20 -20
- package/dist/browser/standalone.js +293 -293
- package/dist/components/AgentScalar/AgentScalarButton.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/AgentScalarButton.vue.js.map +1 -1
- package/dist/components/AgentScalar/AgentScalarButton.vue.script.js +4 -2
- package/dist/components/AgentScalar/AgentScalarButton.vue.script.js.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js +4 -2
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js.map +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.js +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.js.map +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.script.js +8 -6
- package/dist/components/AgentScalar/OpenMCPButton.vue.script.js.map +1 -1
- package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
- package/dist/components/Anchor/Anchor.vue.js.map +1 -1
- package/dist/components/Anchor/Anchor.vue.script.js +5 -3
- package/dist/components/Anchor/Anchor.vue.script.js.map +1 -1
- package/dist/components/Anchor/WithBreadcrumb.vue.d.ts +1 -3
- package/dist/components/Anchor/WithBreadcrumb.vue.d.ts.map +1 -1
- package/dist/components/Anchor/WithBreadcrumb.vue.js.map +1 -1
- package/dist/components/Anchor/WithBreadcrumb.vue.script.js +6 -2
- package/dist/components/Anchor/WithBreadcrumb.vue.script.js.map +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReference.vue.js.map +1 -1
- package/dist/components/ApiReference.vue.script.js +172 -43
- package/dist/components/ApiReference.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.d.ts.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js +6 -2
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/Message.vue.script.js +1 -1
- package/dist/components/Content/Auth/Auth.vue.d.ts.map +1 -1
- package/dist/components/Content/Auth/Auth.vue.js.map +1 -1
- package/dist/components/Content/Auth/Auth.vue.script.js +5 -2
- package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -1
- package/dist/components/Content/Content.vue.d.ts +1 -0
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js.map +1 -1
- package/dist/components/Content/Content.vue.script.js +4 -1
- package/dist/components/Content/Content.vue.script.js.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +3 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.script.js +9 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.script.js +100 -16
- package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js +9 -11
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaEnums.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaEnums.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnums.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaEnums.vue.script.js +4 -2
- package/dist/components/Content/Schema/SchemaEnums.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.script.js +5 -3
- package/dist/components/Content/Schema/SchemaHeading.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +12 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +3 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js +41 -9
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js +8 -5
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js +5 -3
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +3 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +48 -23
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/helpers/dynamic-scope.d.ts +27 -0
- package/dist/components/Content/Schema/helpers/dynamic-scope.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/dynamic-scope.js +35 -0
- package/dist/components/Content/Schema/helpers/dynamic-scope.js.map +1 -0
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts +10 -0
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.js +11 -2
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.js.map +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +9 -2
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
- package/dist/components/Content/Tags/components/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/components/ModernLayout.vue.js +1 -1
- package/dist/components/Content/Tags/components/ModernLayout.vue.js.map +1 -1
- package/dist/components/Content/Tags/components/ModernLayout.vue.script.js +3 -1
- package/dist/components/Content/Tags/components/ModernLayout.vue.script.js.map +1 -1
- package/dist/components/Content/Tags/components/TagSection.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/components/TagSection.vue.js.map +1 -1
- package/dist/components/Content/Tags/components/TagSection.vue.script.js +3 -1
- package/dist/components/Content/Tags/components/TagSection.vue.script.js.map +1 -1
- package/dist/components/GettingStarted.vue.d.ts.map +1 -1
- package/dist/components/GettingStarted.vue.js +1 -1
- package/dist/components/GettingStarted.vue.js.map +1 -1
- package/dist/components/GettingStarted.vue.script.js +58 -21
- package/dist/components/GettingStarted.vue.script.js.map +1 -1
- package/dist/components/MobileHeader.vue.d.ts.map +1 -1
- package/dist/components/MobileHeader.vue.js.map +1 -1
- package/dist/components/MobileHeader.vue.script.js +3 -1
- package/dist/components/MobileHeader.vue.script.js.map +1 -1
- package/dist/components/OperationsList/OperationsList.vue.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsList.vue.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue.js.map +1 -1
- package/dist/components/OperationsList/OperationsList.vue.script.js +4 -2
- package/dist/components/OperationsList/OperationsList.vue.script.js.map +1 -1
- package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
- package/dist/components/ShowMoreButton.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue.js.map +1 -1
- package/dist/components/ShowMoreButton.vue.script.js +4 -2
- package/dist/components/ShowMoreButton.vue.script.js.map +1 -1
- package/dist/features/Operation/Operation.vue.d.ts +3 -1
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js.map +1 -1
- package/dist/features/Operation/Operation.vue.script.js +6 -1
- package/dist/features/Operation/Operation.vue.script.js.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.js.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.script.js +4 -2
- package/dist/features/Operation/components/ContentTypeSelect.vue.script.js.map +1 -1
- package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/Headers.vue.js +1 -1
- package/dist/features/Operation/components/Headers.vue.js.map +1 -1
- package/dist/features/Operation/components/Headers.vue.script.js +8 -6
- package/dist/features/Operation/components/Headers.vue.script.js.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.script.js +8 -6
- package/dist/features/Operation/components/OperationParameters.vue.script.js.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.js.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.script.js +10 -7
- package/dist/features/Operation/components/OperationResponses.vue.script.js.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.script.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.script.js +21 -14
- package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
- package/dist/features/Operation/components/SecurityRequirementBadge.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/SecurityRequirementBadge.vue.js.map +1 -1
- package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js +5 -3
- package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js.map +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js.map +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js +11 -8
- package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +37 -17
- package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.script.js +22 -7
- package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
- package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchButton.vue.js.map +1 -1
- package/dist/features/Search/components/SearchButton.vue.script.js +15 -8
- package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -1
- package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchModal.vue.js +1 -1
- package/dist/features/Search/components/SearchModal.vue.js.map +1 -1
- package/dist/features/Search/components/SearchModal.vue.script.js +29 -10
- package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -1
- package/dist/features/Search/components/SearchResult.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchResult.vue.js.map +1 -1
- package/dist/features/Search/components/SearchResult.vue.script.js +12 -8
- package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -1
- package/dist/features/Search/helpers/create-search-index.d.ts +8 -0
- package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
- package/dist/features/Search/helpers/create-search-index.js +18 -9
- package/dist/features/Search/helpers/create-search-index.js.map +1 -1
- package/dist/features/Search/hooks/useSearchIndex.d.ts +7 -1
- package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/hooks/useSearchIndex.js +11 -2
- package/dist/features/Search/hooks/useSearchIndex.js.map +1 -1
- package/dist/features/ask-agent-button/AskAgentButton.vue.d.ts.map +1 -1
- package/dist/features/ask-agent-button/AskAgentButton.vue.js +1 -1
- package/dist/features/ask-agent-button/AskAgentButton.vue.js.map +1 -1
- package/dist/features/ask-agent-button/AskAgentButton.vue.script.js +10 -6
- package/dist/features/ask-agent-button/AskAgentButton.vue.script.js.map +1 -1
- package/dist/features/developer-tools/DeveloperTools.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/DeveloperTools.vue.js.map +1 -1
- package/dist/features/developer-tools/DeveloperTools.vue.script.js +10 -8
- package/dist/features/developer-tools/DeveloperTools.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js +11 -11
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js +15 -11
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.d.ts +1 -3
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js +4 -6
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js +6 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js +23 -22
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js +7 -5
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js +9 -7
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/DeployApiReference.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/DeployApiReference.vue.js.map +1 -1
- package/dist/features/developer-tools/components/DeployApiReference.vue.script.js +7 -4
- package/dist/features/developer-tools/components/DeployApiReference.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js +8 -6
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ShareApiReference.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ShareApiReference.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ShareApiReference.vue.script.js +7 -4
- package/dist/features/developer-tools/components/ShareApiReference.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.script.js +5 -3
- package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.d.ts +9 -0
- package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.script.js +42 -23
- package/dist/features/example-responses/ExampleResponses.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleSchema.vue.js.map +1 -1
- package/dist/features/example-responses/ExampleSchema.vue.script.js +1 -1
- package/dist/features/example-responses/ExampleSchema.vue.script.js.map +1 -1
- package/dist/features/info-object/Contact.vue.d.ts.map +1 -1
- package/dist/features/info-object/Contact.vue.js.map +1 -1
- package/dist/features/info-object/Contact.vue.script.js +14 -11
- package/dist/features/info-object/Contact.vue.script.js.map +1 -1
- package/dist/features/info-object/InfoLink.vue.d.ts +8 -0
- package/dist/features/info-object/InfoLink.vue.d.ts.map +1 -0
- package/dist/features/info-object/InfoLink.vue.js +7 -0
- package/dist/features/info-object/InfoLink.vue.js.map +1 -0
- package/dist/features/info-object/InfoLink.vue.script.js +30 -0
- package/dist/features/info-object/InfoLink.vue.script.js.map +1 -0
- package/dist/features/info-object/TermsOfService.vue.d.ts.map +1 -1
- package/dist/features/info-object/TermsOfService.vue.js.map +1 -1
- package/dist/features/info-object/TermsOfService.vue.script.js +9 -6
- package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -1
- package/dist/features/info-object/index.d.ts +1 -0
- package/dist/features/info-object/index.d.ts.map +1 -1
- package/dist/features/localization/index.d.ts +2 -0
- package/dist/features/localization/index.d.ts.map +1 -0
- package/dist/features/localization/locales/ar.d.ts +227 -0
- package/dist/features/localization/locales/ar.d.ts.map +1 -0
- package/dist/features/localization/locales/ar.js +225 -0
- package/dist/features/localization/locales/ar.js.map +1 -0
- package/dist/features/localization/locales/de.d.ts +227 -0
- package/dist/features/localization/locales/de.d.ts.map +1 -0
- package/dist/features/localization/locales/de.js +225 -0
- package/dist/features/localization/locales/de.js.map +1 -0
- package/dist/features/localization/locales/en.d.ts +227 -0
- package/dist/features/localization/locales/en.d.ts.map +1 -0
- package/dist/features/localization/locales/en.js +225 -0
- package/dist/features/localization/locales/en.js.map +1 -0
- package/dist/features/localization/locales/es.d.ts +227 -0
- package/dist/features/localization/locales/es.d.ts.map +1 -0
- package/dist/features/localization/locales/es.js +225 -0
- package/dist/features/localization/locales/es.js.map +1 -0
- package/dist/features/localization/locales/fr.d.ts +227 -0
- package/dist/features/localization/locales/fr.d.ts.map +1 -0
- package/dist/features/localization/locales/fr.js +225 -0
- package/dist/features/localization/locales/fr.js.map +1 -0
- package/dist/features/localization/locales/ru.d.ts +227 -0
- package/dist/features/localization/locales/ru.d.ts.map +1 -0
- package/dist/features/localization/locales/ru.js +225 -0
- package/dist/features/localization/locales/ru.js.map +1 -0
- package/dist/features/localization/locales/zh-cn.d.ts +227 -0
- package/dist/features/localization/locales/zh-cn.d.ts.map +1 -0
- package/dist/features/localization/locales/zh-cn.js +225 -0
- package/dist/features/localization/locales/zh-cn.js.map +1 -0
- package/dist/features/localization/translations.d.ts +1588 -0
- package/dist/features/localization/translations.d.ts.map +1 -0
- package/dist/features/localization/translations.js +27 -0
- package/dist/features/localization/translations.js.map +1 -0
- package/dist/features/localization/use-localization.d.ts +18 -0
- package/dist/features/localization/use-localization.d.ts.map +1 -0
- package/dist/features/localization/use-localization.js +58 -0
- package/dist/features/localization/use-localization.js.map +1 -0
- package/dist/features/multiple-documents/DocumentSelector.vue.script.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.js.map +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.script.js +3 -1
- package/dist/features/test-request-button/TestRequestButton.vue.script.js.map +1 -1
- package/dist/helpers/is-introduction-entry.d.ts +16 -0
- package/dist/helpers/is-introduction-entry.d.ts.map +1 -0
- package/dist/helpers/is-introduction-entry.js +17 -0
- package/dist/helpers/is-introduction-entry.js.map +1 -0
- package/dist/helpers/load-from-perssistance.js +1 -1
- package/dist/helpers/load-from-perssistance.js.map +1 -1
- package/dist/helpers/map-config-to-workspace-store.js +1 -1
- package/dist/helpers/map-config-to-workspace-store.js.map +1 -1
- package/dist/helpers/storage.d.ts +14 -14
- package/dist/style.css +446 -434
- package/dist/styles/tailwind.config.css +1 -0
- package/dist/vue-styles.css +383 -380
- package/package.json +17 -16
- package/dist/browser/chunks/AgentScalarChatInterface-BhUn0w1j.js +0 -27
- package/dist/browser/chunks/ScalarTextInput.vue-BUzf4Z_k.js +0 -27
- package/dist/browser/chunks/vendor-BeJNu9KM.js +0 -306
- package/dist/features/Operation/helpers/get-first-server.d.ts +0 -9
- package/dist/features/Operation/helpers/get-first-server.d.ts.map +0 -1
- package/dist/features/Operation/helpers/get-first-server.js +0 -27
- package/dist/features/Operation/helpers/get-first-server.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @scalar/api-reference
|
|
2
2
|
|
|
3
|
+
## 1.62.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#9575](https://github.com/scalar/scalar/pull/9575): Render the discriminator variant dropdown for object schemas that only declare a `discriminator.mapping` (no explicit `oneOf`/`anyOf`), which is the shape NSwag emits for polymorphic types
|
|
8
|
+
- [#9483](https://github.com/scalar/scalar/pull/9483): Render JSON Schema 2020-12 `$dynamicRef` in schemas, so generic patterns like `PaginatedResponse<T>` show their concrete bound item type (for example `User[]`) instead of an empty shape. The reference threads the active dynamic scope through the schema tree and binds each `$dynamicRef` to the matching `$dynamicAnchor`.
|
|
9
|
+
- [#9587](https://github.com/scalar/scalar/pull/9587): Fix `Maximum call stack size exceeded` crash when rendering a schema whose self-reference is reached through an `allOf` branch
|
|
10
|
+
|
|
11
|
+
## 1.62.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#9597](https://github.com/scalar/scalar/pull/9597): Add API Reference UI localization configuration with built-in English, Russian, Spanish, French, German, Simplified Chinese and Arabic translations, including automatic RTL direction for Arabic locales.
|
|
16
|
+
|
|
17
|
+
Update the shared theme reset so text inputs align to the logical start by default for RTL documents.
|
|
18
|
+
|
|
19
|
+
Add a `mergeObjects` deep-merge helper to `@scalar/helpers`, used by the localization layer to merge translation overrides onto the built-in locale.
|
|
20
|
+
|
|
21
|
+
- [#9568](https://github.com/scalar/scalar/pull/9568): Add AsyncAPI protocol and server pickers to the sidebar (like the multi-document picker) that filter the navigation down to the operations reachable over the selected protocol/server
|
|
22
|
+
- [#9543](https://github.com/scalar/scalar/pull/9543): Add the `x-scalar-links` OpenAPI extension to render extra named links (like a privacy policy or imprint) next to the contact, license and terms of service links in the introduction.
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- [#9545](https://github.com/scalar/scalar/pull/9545): Render the divider between the contact email and url links in the introduction, so they are separated like the other info links.
|
|
27
|
+
- [#8519](https://github.com/scalar/scalar/pull/8519): refactor: extract the code example block into `@scalar/blocks/code-example`. `api-client`, `api-client-react`, and `api-reference` now import `CodeExample`, `findClient`, `generateClientOptions`, and the related helpers from the new package. `workspace-store` exports `isParamDisabled` with an optional `defaultDisabled` argument.
|
|
28
|
+
|
|
29
|
+
**Breaking (`@scalar/api-client`):** the `@scalar/api-client/blocks/operation-code-sample` and `@scalar/api-client/v2/blocks/operation-code-sample` export paths have been removed. Import from `@scalar/blocks/code-example` instead, and use the renamed `CodeExample` / `CodeExampleProps` (previously `OperationCodeSample` / `OperationCodeSampleProps`).
|
|
30
|
+
|
|
31
|
+
- [#9578](https://github.com/scalar/scalar/pull/9578): Show the `propertyNames` type and format (e.g. `string · uuid`) for a map of additional properties, so key constraints are no longer dropped from the rendered schema
|
|
32
|
+
- [#9548](https://github.com/scalar/scalar/pull/9548): Keep request and response example pickers in sync across operations. Selecting an example (e.g. "Use case 1") now selects the example with the same key on every other operation that defines it, mirroring how the programming-language selection already syncs. Operations that do not have a matching example keep their current selection.
|
|
33
|
+
|
|
3
34
|
## 1.61.0
|
|
4
35
|
|
|
5
36
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncApiServerSelector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AsyncApiServerSelector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue"],"names":[],"mappings":"AAsHA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AASvE,KAAK,aAAa,GAAG;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,oCAAoC;IACpC,cAAc,EAAE,mBAAmB,GAAG,IAAI,CAAA;IAC1C,wBAAwB;IACxB,OAAO,EAAE,mBAAmB,EAAE,CAAA;CAC/B,CAAA;AAED;;;;;;;;;GASG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY,sSAoKd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncApiServerSelector.vue.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue"],"sourcesContent":["<script lang=\"ts\">\ntype SelectorProps = {\n /** The event bus to use for emitting events */\n eventBus: WorkspaceEventBus\n /** The currently selected server */\n selectedServer: AsyncApiServerEntry | null\n /** Available servers */\n servers: AsyncApiServerEntry[]\n}\n\n/**\n * AsyncApiServerSelector\n *\n * Core component for rendering an AsyncAPI server selector block. It mirrors the\n * OpenAPI ServerSelector, but works with the AsyncAPI server shape (a named map\n * of `host`/`protocol`/`pathname` rather than an array of `url`).\n *\n * @event asyncapi-server:update:selected - Emitted when the selected server changes\n * @event asyncapi-server:update:variables - Emitted when a server variable changes\n */\nexport default {}\n</script>\n\n<script lang=\"ts\" setup>\nimport { ServerVariablesForm } from '@scalar/api-client/components/Server'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { AsyncApiServerEntry } from '@scalar/workspace-store/channel-example'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { computed, useId } from 'vue'\n\nimport Selector from './Selector.vue'\n\nconst { eventBus, servers, selectedServer } = defineProps<SelectorProps>()\n\nconst id = useId()\n\n/**\n * Normalize AsyncAPI server variables into the shape the shared\n * ServerVariablesForm expects (resolving references and defaulting `default`).\n */\nconst serverVariables = computed(() => {\n const variables = selectedServer?.server.variables\n if (!variables) {\n return undefined\n }\n\n return Object.fromEntries(\n Object.entries(variables).map(([name, variable]) => {\n const resolved = getResolvedRef(variable)\n return [\n name,\n {\n default: resolved.default ?? '',\n enum: resolved.enum,\n description: resolved.description,\n },\n ]\n }),\n )\n})\n\n/** Update the selected server */\nconst updateServer = (name: string) => {\n eventBus.emit('asyncapi-server:update:selected', { name })\n}\n\n/** Update a server variable on the selected server */\nconst updateServerVariable = (key: string, value: string) => {\n if (!selectedServer) {\n return\n }\n\n eventBus.emit('asyncapi-server:update:variables', {\n name: selectedServer.name,\n key,\n value,\n })\n}\n</script>\n\n<template>\n <label\n class=\"bg-b-2 flex h-8 items-center rounded-t-xl border-x border-t px-3 py-2.5 font-medium\">\n
|
|
1
|
+
{"version":3,"file":"AsyncApiServerSelector.vue.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue"],"sourcesContent":["<script lang=\"ts\">\ntype SelectorProps = {\n /** The event bus to use for emitting events */\n eventBus: WorkspaceEventBus\n /** The currently selected server */\n selectedServer: AsyncApiServerEntry | null\n /** Available servers */\n servers: AsyncApiServerEntry[]\n}\n\n/**\n * AsyncApiServerSelector\n *\n * Core component for rendering an AsyncAPI server selector block. It mirrors the\n * OpenAPI ServerSelector, but works with the AsyncAPI server shape (a named map\n * of `host`/`protocol`/`pathname` rather than an array of `url`).\n *\n * @event asyncapi-server:update:selected - Emitted when the selected server changes\n * @event asyncapi-server:update:variables - Emitted when a server variable changes\n */\nexport default {}\n</script>\n\n<script lang=\"ts\" setup>\nimport { ServerVariablesForm } from '@scalar/api-client/components/Server'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { AsyncApiServerEntry } from '@scalar/workspace-store/channel-example'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { computed, useId } from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nimport Selector from './Selector.vue'\n\nconst { eventBus, servers, selectedServer } = defineProps<SelectorProps>()\n\nconst id = useId()\nconst { translate } = useLocalization()\n\n/**\n * Normalize AsyncAPI server variables into the shape the shared\n * ServerVariablesForm expects (resolving references and defaulting `default`).\n */\nconst serverVariables = computed(() => {\n const variables = selectedServer?.server.variables\n if (!variables) {\n return undefined\n }\n\n return Object.fromEntries(\n Object.entries(variables).map(([name, variable]) => {\n const resolved = getResolvedRef(variable)\n return [\n name,\n {\n default: resolved.default ?? '',\n enum: resolved.enum,\n description: resolved.description,\n },\n ]\n }),\n )\n})\n\n/** Update the selected server */\nconst updateServer = (name: string) => {\n eventBus.emit('asyncapi-server:update:selected', { name })\n}\n\n/** Update a server variable on the selected server */\nconst updateServerVariable = (key: string, value: string) => {\n if (!selectedServer) {\n return\n }\n\n eventBus.emit('asyncapi-server:update:variables', {\n name: selectedServer.name,\n key,\n value,\n })\n}\n</script>\n\n<template>\n <label\n class=\"bg-b-2 flex h-8 items-center rounded-t-xl border-x border-t px-3 py-2.5 font-medium\">\n {{ translate('server.label') }}\n </label>\n <div\n :id=\"id\"\n class=\"border\"\n :class=\"{\n 'rounded-b-xl': !selectedServer?.description && !serverVariables,\n }\">\n <Selector\n v-if=\"servers.length\"\n :selectedServer\n :servers=\"servers\"\n :target=\"id\"\n @update:modelValue=\"updateServer\" />\n </div>\n <ServerVariablesForm\n layout=\"reference\"\n :variables=\"serverVariables\"\n @update:variable=\"updateServerVariable\" />\n\n <!-- Description -->\n <ScalarMarkdown\n v-if=\"selectedServer?.description\"\n class=\"text-c-3 rounded-b-xl border-x border-b px-3 py-1.5\"\n :value=\"selectedServer.description\" />\n</template>\n"],"mappings":""}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { useLocalization } from "../../../features/localization/use-localization.js";
|
|
1
2
|
import Selector_default from "./Selector.vue.js";
|
|
2
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, unref, useId } from "vue";
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, useId } from "vue";
|
|
4
|
+
import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
5
|
import { ServerVariablesForm } from "@scalar/api-client/components/Server";
|
|
4
6
|
import { ScalarMarkdown } from "@scalar/components/markdown";
|
|
5
|
-
import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
6
7
|
//#region src/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var _hoisted_1 =
|
|
8
|
+
var _hoisted_1 = { class: "bg-b-2 flex h-8 items-center rounded-t-xl border-x border-t px-3 py-2.5 font-medium" };
|
|
9
|
+
var _hoisted_2 = ["id"];
|
|
8
10
|
var AsyncApiServerSelector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
9
11
|
__name: "AsyncApiServerSelector",
|
|
10
12
|
props: {
|
|
@@ -14,6 +16,7 @@ var AsyncApiServerSelector_vue_vue_type_script_setup_true_lang_default = /* @__P
|
|
|
14
16
|
},
|
|
15
17
|
setup(__props) {
|
|
16
18
|
const id = useId();
|
|
19
|
+
const { translate } = useLocalization();
|
|
17
20
|
/**
|
|
18
21
|
* Normalize AsyncAPI server variables into the shape the shared
|
|
19
22
|
* ServerVariablesForm expects (resolving references and defaulting `default`).
|
|
@@ -45,7 +48,7 @@ var AsyncApiServerSelector_vue_vue_type_script_setup_true_lang_default = /* @__P
|
|
|
45
48
|
};
|
|
46
49
|
return (_ctx, _cache) => {
|
|
47
50
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
48
|
-
|
|
51
|
+
createElementVNode("label", _hoisted_1, toDisplayString(unref(translate)("server.label")), 1),
|
|
49
52
|
createElementVNode("div", {
|
|
50
53
|
id: unref(id),
|
|
51
54
|
class: normalizeClass(["border", { "rounded-b-xl": !__props.selectedServer?.description && !serverVariables.value }])
|
|
@@ -59,7 +62,7 @@ var AsyncApiServerSelector_vue_vue_type_script_setup_true_lang_default = /* @__P
|
|
|
59
62
|
"selectedServer",
|
|
60
63
|
"servers",
|
|
61
64
|
"target"
|
|
62
|
-
])) : createCommentVNode("", true)], 10,
|
|
65
|
+
])) : createCommentVNode("", true)], 10, _hoisted_2),
|
|
63
66
|
createVNode(unref(ServerVariablesForm), {
|
|
64
67
|
layout: "reference",
|
|
65
68
|
variables: serverVariables.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncApiServerSelector.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue"],"sourcesContent":["<script lang=\"ts\">\ntype SelectorProps = {\n /** The event bus to use for emitting events */\n eventBus: WorkspaceEventBus\n /** The currently selected server */\n selectedServer: AsyncApiServerEntry | null\n /** Available servers */\n servers: AsyncApiServerEntry[]\n}\n\n/**\n * AsyncApiServerSelector\n *\n * Core component for rendering an AsyncAPI server selector block. It mirrors the\n * OpenAPI ServerSelector, but works with the AsyncAPI server shape (a named map\n * of `host`/`protocol`/`pathname` rather than an array of `url`).\n *\n * @event asyncapi-server:update:selected - Emitted when the selected server changes\n * @event asyncapi-server:update:variables - Emitted when a server variable changes\n */\nexport default {}\n</script>\n\n<script lang=\"ts\" setup>\nimport { ServerVariablesForm } from '@scalar/api-client/components/Server'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { AsyncApiServerEntry } from '@scalar/workspace-store/channel-example'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { computed, useId } from 'vue'\n\nimport Selector from './Selector.vue'\n\nconst { eventBus, servers, selectedServer } = defineProps<SelectorProps>()\n\nconst id = useId()\n\n/**\n * Normalize AsyncAPI server variables into the shape the shared\n * ServerVariablesForm expects (resolving references and defaulting `default`).\n */\nconst serverVariables = computed(() => {\n const variables = selectedServer?.server.variables\n if (!variables) {\n return undefined\n }\n\n return Object.fromEntries(\n Object.entries(variables).map(([name, variable]) => {\n const resolved = getResolvedRef(variable)\n return [\n name,\n {\n default: resolved.default ?? '',\n enum: resolved.enum,\n description: resolved.description,\n },\n ]\n }),\n )\n})\n\n/** Update the selected server */\nconst updateServer = (name: string) => {\n eventBus.emit('asyncapi-server:update:selected', { name })\n}\n\n/** Update a server variable on the selected server */\nconst updateServerVariable = (key: string, value: string) => {\n if (!selectedServer) {\n return\n }\n\n eventBus.emit('asyncapi-server:update:variables', {\n name: selectedServer.name,\n key,\n value,\n })\n}\n</script>\n\n<template>\n <label\n class=\"bg-b-2 flex h-8 items-center rounded-t-xl border-x border-t px-3 py-2.5 font-medium\">\n
|
|
1
|
+
{"version":3,"file":"AsyncApiServerSelector.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue"],"sourcesContent":["<script lang=\"ts\">\ntype SelectorProps = {\n /** The event bus to use for emitting events */\n eventBus: WorkspaceEventBus\n /** The currently selected server */\n selectedServer: AsyncApiServerEntry | null\n /** Available servers */\n servers: AsyncApiServerEntry[]\n}\n\n/**\n * AsyncApiServerSelector\n *\n * Core component for rendering an AsyncAPI server selector block. It mirrors the\n * OpenAPI ServerSelector, but works with the AsyncAPI server shape (a named map\n * of `host`/`protocol`/`pathname` rather than an array of `url`).\n *\n * @event asyncapi-server:update:selected - Emitted when the selected server changes\n * @event asyncapi-server:update:variables - Emitted when a server variable changes\n */\nexport default {}\n</script>\n\n<script lang=\"ts\" setup>\nimport { ServerVariablesForm } from '@scalar/api-client/components/Server'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { AsyncApiServerEntry } from '@scalar/workspace-store/channel-example'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { computed, useId } from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nimport Selector from './Selector.vue'\n\nconst { eventBus, servers, selectedServer } = defineProps<SelectorProps>()\n\nconst id = useId()\nconst { translate } = useLocalization()\n\n/**\n * Normalize AsyncAPI server variables into the shape the shared\n * ServerVariablesForm expects (resolving references and defaulting `default`).\n */\nconst serverVariables = computed(() => {\n const variables = selectedServer?.server.variables\n if (!variables) {\n return undefined\n }\n\n return Object.fromEntries(\n Object.entries(variables).map(([name, variable]) => {\n const resolved = getResolvedRef(variable)\n return [\n name,\n {\n default: resolved.default ?? '',\n enum: resolved.enum,\n description: resolved.description,\n },\n ]\n }),\n )\n})\n\n/** Update the selected server */\nconst updateServer = (name: string) => {\n eventBus.emit('asyncapi-server:update:selected', { name })\n}\n\n/** Update a server variable on the selected server */\nconst updateServerVariable = (key: string, value: string) => {\n if (!selectedServer) {\n return\n }\n\n eventBus.emit('asyncapi-server:update:variables', {\n name: selectedServer.name,\n key,\n value,\n })\n}\n</script>\n\n<template>\n <label\n class=\"bg-b-2 flex h-8 items-center rounded-t-xl border-x border-t px-3 py-2.5 font-medium\">\n {{ translate('server.label') }}\n </label>\n <div\n :id=\"id\"\n class=\"border\"\n :class=\"{\n 'rounded-b-xl': !selectedServer?.description && !serverVariables,\n }\">\n <Selector\n v-if=\"servers.length\"\n :selectedServer\n :servers=\"servers\"\n :target=\"id\"\n @update:modelValue=\"updateServer\" />\n </div>\n <ServerVariablesForm\n layout=\"reference\"\n :variables=\"serverVariables\"\n @update:variable=\"updateServerVariable\" />\n\n <!-- Description -->\n <ScalarMarkdown\n v-if=\"selectedServer?.description\"\n class=\"text-c-3 rounded-b-xl border-x border-b px-3 py-1.5\"\n :value=\"selectedServer.description\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAqCA,MAAM,KAAK,OAAM;EACjB,MAAM,EAAE,cAAc,iBAAgB;;;;;EAMtC,MAAM,kBAAkB,eAAe;GACrC,MAAM,YAAY,QAAA,gBAAgB,OAAO;AACzC,OAAI,CAAC,UACH;AAGF,UAAO,OAAO,YACZ,OAAO,QAAQ,UAAU,CAAC,KAAK,CAAC,MAAM,cAAc;IAClD,MAAM,WAAW,eAAe,SAAQ;AACxC,WAAO,CACL,MACA;KACE,SAAS,SAAS,WAAW;KAC7B,MAAM,SAAS;KACf,aAAa,SAAS;KACvB,CACH;KACA,CACJ;IACD;;EAGD,MAAM,gBAAgB,SAAiB;AACrC,WAAA,SAAS,KAAK,mCAAmC,EAAE,MAAM,CAAA;;;EAI3D,MAAM,wBAAwB,KAAa,UAAkB;AAC3D,OAAI,CAAC,QAAA,eACH;AAGF,WAAA,SAAS,KAAK,oCAAoC;IAChD,MAAM,QAAA,eAAe;IACrB;IACA;IACD,CAAA;;;;IAKD,mBAGQ,SAHR,YAGQ,gBADH,MAAA,UAAS,CAAA,eAAA,CAAA,EAAA,EAAA;IAEd,mBAYM,OAAA;KAXH,IAAI,MAAA,GAAE;KACP,OAAK,eAAA,CAAC,UAAQ,EAAA,gBAAA,CACmB,QAAA,gBAAgB,eAAW,CAAK,gBAAA,OAAA,CAAA,CAAA;QAIzD,QAAA,QAAQ,UAAA,WAAA,EADhB,YAKsC,kBAAA;;KAHnC,gBAAA,QAAA;KACA,SAAS,QAAA;KACT,QAAQ,MAAA,GAAE;KACV,uBAAmB;;;;;;IAExB,YAG4C,MAAA,oBAAA,EAAA;KAF1C,QAAO;KACN,WAAW,gBAAA;KACX,qBAAiB;;IAIZ,QAAA,gBAAgB,eAAA,WAAA,EADxB,YAGwC,MAAA,eAAA,EAAA;;KADtC,OAAM;KACL,OAAO,QAAA,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Selector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue"],"names":[],"mappings":"AAwFA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAKlF,KAAK,WAAW,GAAG;IACjB,0BAA0B;IAC1B,cAAc,EAAE,mBAAmB,GAAG,IAAI,CAAA;IAC1C,wBAAwB;IACxB,OAAO,EAAE,mBAAmB,EAAE,CAAA;IAC9B,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;AAsMF,QAAA,MAAM,YAAY;;;;;;;;;;;;kFAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.vue.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarListbox } from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { AsyncApiServerEntry } from '@scalar/workspace-store/channel-example'\nimport { computed } from 'vue'\n\nconst { target, servers, selectedServer } = defineProps<{\n /** The selected server */\n selectedServer: AsyncApiServerEntry | null\n /** Available servers */\n servers: AsyncApiServerEntry[]\n /** The id of the target to use for the popover (e.g. address bar) */\n target: string\n}>()\n\nconst emit = defineEmits<{\n /** Emitted with the server name when the selected server changes */\n (e: 'update:modelValue', value: string): void\n}>()\n\n/**\n * AsyncAPI servers are a named map without a single `url`, so we key options by\n * the server name and label them with the constructed connection URL.\n */\nconst serverOptions = computed(() =>\n servers.map((server) => ({\n id: server.name,\n label: server.url,\n })),\n)\n\nconst serverUrlWithoutTrailingSlash = computed(\n () => selectedServer?.url?.replace(/\\/$/, '') || '',\n)\n\nconst selectedServerOption = computed(() =>\n serverOptions.value.find((opt) => opt.id === selectedServer?.name),\n)\n\n// For testing\ndefineExpose({\n servers,\n serverUrlWithoutTrailingSlash,\n serverOptions,\n selectedServer,\n})\n</script>\n<template>\n <ScalarListbox\n v-if=\"serverOptions.length > 1\"\n ref=\"elem\"\n class=\"group\"\n :modelValue=\"selectedServerOption\"\n :options=\"serverOptions\"\n placement=\"bottom-start\"\n resize\n :target=\"target\"\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <ScalarButton\n class=\"bg-b-1 text-c-1 h-auto w-full justify-start gap-1.5 overflow-x-auto rounded-t-none !rounded-b-xl px-3 py-1.5 text-base/5.25 font-normal whitespace-nowrap -outline-offset-1\"\n variant=\"ghost\">\n <span class=\"sr-only\">
|
|
1
|
+
{"version":3,"file":"Selector.vue.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarListbox } from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { AsyncApiServerEntry } from '@scalar/workspace-store/channel-example'\nimport { computed } from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nconst { target, servers, selectedServer } = defineProps<{\n /** The selected server */\n selectedServer: AsyncApiServerEntry | null\n /** Available servers */\n servers: AsyncApiServerEntry[]\n /** The id of the target to use for the popover (e.g. address bar) */\n target: string\n}>()\n\nconst emit = defineEmits<{\n /** Emitted with the server name when the selected server changes */\n (e: 'update:modelValue', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\n/**\n * AsyncAPI servers are a named map without a single `url`, so we key options by\n * the server name and label them with the constructed connection URL.\n */\nconst serverOptions = computed(() =>\n servers.map((server) => ({\n id: server.name,\n label: server.url,\n })),\n)\n\nconst serverUrlWithoutTrailingSlash = computed(\n () => selectedServer?.url?.replace(/\\/$/, '') || '',\n)\n\nconst selectedServerOption = computed(() =>\n serverOptions.value.find((opt) => opt.id === selectedServer?.name),\n)\n\n// For testing\ndefineExpose({\n servers,\n serverUrlWithoutTrailingSlash,\n serverOptions,\n selectedServer,\n})\n</script>\n<template>\n <ScalarListbox\n v-if=\"serverOptions.length > 1\"\n ref=\"elem\"\n class=\"group\"\n :modelValue=\"selectedServerOption\"\n :options=\"serverOptions\"\n placement=\"bottom-start\"\n resize\n :target=\"target\"\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <ScalarButton\n class=\"bg-b-1 text-c-1 h-auto w-full justify-start gap-1.5 overflow-x-auto rounded-t-none !rounded-b-xl px-3 py-1.5 text-base/5.25 font-normal whitespace-nowrap -outline-offset-1\"\n variant=\"ghost\">\n <span class=\"sr-only\">{{ translate('server.label') }}:</span>\n <span class=\"overflow-x-auto\">\n {{ serverUrlWithoutTrailingSlash || translate('server.select') }}\n </span>\n <ScalarIconCaretDown\n class=\"text-c-2 ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100\"\n weight=\"bold\" />\n </ScalarButton>\n </ScalarListbox>\n <div\n v-else\n class=\"text-c-1 flex h-auto w-full items-center gap-0.75 !rounded-b-xl px-3 py-1.5 text-base leading-[20px] whitespace-nowrap\">\n <span class=\"sr-only\">{{ translate('server.label') }}:</span>\n <span class=\"overflow-x-auto\">{{ serverUrlWithoutTrailingSlash }}</span>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
import { useLocalization } from "../../../features/localization/use-localization.js";
|
|
1
2
|
import { computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
3
|
+
import { ScalarListbox } from "@scalar/components/listbox";
|
|
2
4
|
import { ScalarIconCaretDown } from "@scalar/icons";
|
|
3
5
|
import { ScalarButton } from "@scalar/components/button";
|
|
4
|
-
import { ScalarListbox } from "@scalar/components/listbox";
|
|
5
6
|
//#region src/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var _hoisted_1 = { class: "
|
|
7
|
-
var _hoisted_2 = {
|
|
7
|
+
var _hoisted_1 = { class: "sr-only" };
|
|
8
|
+
var _hoisted_2 = { class: "overflow-x-auto" };
|
|
9
|
+
var _hoisted_3 = {
|
|
8
10
|
key: 1,
|
|
9
11
|
class: "text-c-1 flex h-auto w-full items-center gap-0.75 !rounded-b-xl px-3 py-1.5 text-base leading-[20px] whitespace-nowrap"
|
|
10
12
|
};
|
|
11
|
-
var
|
|
13
|
+
var _hoisted_4 = { class: "sr-only" };
|
|
14
|
+
var _hoisted_5 = { class: "overflow-x-auto" };
|
|
12
15
|
var Selector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
13
16
|
__name: "Selector",
|
|
14
17
|
props: {
|
|
@@ -19,6 +22,7 @@ var Selector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
19
22
|
emits: ["update:modelValue"],
|
|
20
23
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
21
24
|
const emit = __emit;
|
|
25
|
+
const { translate } = useLocalization();
|
|
22
26
|
/**
|
|
23
27
|
* AsyncAPI servers are a named map without a single `url`, so we key options by
|
|
24
28
|
* the server name and label them with the constructed connection URL.
|
|
@@ -52,8 +56,8 @@ var Selector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
52
56
|
variant: "ghost"
|
|
53
57
|
}, {
|
|
54
58
|
default: withCtx(() => [
|
|
55
|
-
|
|
56
|
-
createElementVNode("span",
|
|
59
|
+
createElementVNode("span", _hoisted_1, toDisplayString(unref(translate)("server.label")) + ":", 1),
|
|
60
|
+
createElementVNode("span", _hoisted_2, toDisplayString(serverUrlWithoutTrailingSlash.value || unref(translate)("server.select")), 1),
|
|
57
61
|
createVNode(unref(ScalarIconCaretDown), {
|
|
58
62
|
class: "text-c-2 ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100",
|
|
59
63
|
weight: "bold"
|
|
@@ -66,7 +70,7 @@ var Selector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
66
70
|
"modelValue",
|
|
67
71
|
"options",
|
|
68
72
|
"target"
|
|
69
|
-
])) : (openBlock(), createElementBlock("div",
|
|
73
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_3, [createElementVNode("span", _hoisted_4, toDisplayString(unref(translate)("server.label")) + ":", 1), createElementVNode("span", _hoisted_5, toDisplayString(serverUrlWithoutTrailingSlash.value), 1)]));
|
|
70
74
|
};
|
|
71
75
|
}
|
|
72
76
|
});
|
package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarListbox } from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { AsyncApiServerEntry } from '@scalar/workspace-store/channel-example'\nimport { computed } from 'vue'\n\nconst { target, servers, selectedServer } = defineProps<{\n /** The selected server */\n selectedServer: AsyncApiServerEntry | null\n /** Available servers */\n servers: AsyncApiServerEntry[]\n /** The id of the target to use for the popover (e.g. address bar) */\n target: string\n}>()\n\nconst emit = defineEmits<{\n /** Emitted with the server name when the selected server changes */\n (e: 'update:modelValue', value: string): void\n}>()\n\n/**\n * AsyncAPI servers are a named map without a single `url`, so we key options by\n * the server name and label them with the constructed connection URL.\n */\nconst serverOptions = computed(() =>\n servers.map((server) => ({\n id: server.name,\n label: server.url,\n })),\n)\n\nconst serverUrlWithoutTrailingSlash = computed(\n () => selectedServer?.url?.replace(/\\/$/, '') || '',\n)\n\nconst selectedServerOption = computed(() =>\n serverOptions.value.find((opt) => opt.id === selectedServer?.name),\n)\n\n// For testing\ndefineExpose({\n servers,\n serverUrlWithoutTrailingSlash,\n serverOptions,\n selectedServer,\n})\n</script>\n<template>\n <ScalarListbox\n v-if=\"serverOptions.length > 1\"\n ref=\"elem\"\n class=\"group\"\n :modelValue=\"selectedServerOption\"\n :options=\"serverOptions\"\n placement=\"bottom-start\"\n resize\n :target=\"target\"\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <ScalarButton\n class=\"bg-b-1 text-c-1 h-auto w-full justify-start gap-1.5 overflow-x-auto rounded-t-none !rounded-b-xl px-3 py-1.5 text-base/5.25 font-normal whitespace-nowrap -outline-offset-1\"\n variant=\"ghost\">\n <span class=\"sr-only\">
|
|
1
|
+
{"version":3,"file":"Selector.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarListbox } from '@scalar/components/listbox'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { AsyncApiServerEntry } from '@scalar/workspace-store/channel-example'\nimport { computed } from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nconst { target, servers, selectedServer } = defineProps<{\n /** The selected server */\n selectedServer: AsyncApiServerEntry | null\n /** Available servers */\n servers: AsyncApiServerEntry[]\n /** The id of the target to use for the popover (e.g. address bar) */\n target: string\n}>()\n\nconst emit = defineEmits<{\n /** Emitted with the server name when the selected server changes */\n (e: 'update:modelValue', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\n/**\n * AsyncAPI servers are a named map without a single `url`, so we key options by\n * the server name and label them with the constructed connection URL.\n */\nconst serverOptions = computed(() =>\n servers.map((server) => ({\n id: server.name,\n label: server.url,\n })),\n)\n\nconst serverUrlWithoutTrailingSlash = computed(\n () => selectedServer?.url?.replace(/\\/$/, '') || '',\n)\n\nconst selectedServerOption = computed(() =>\n serverOptions.value.find((opt) => opt.id === selectedServer?.name),\n)\n\n// For testing\ndefineExpose({\n servers,\n serverUrlWithoutTrailingSlash,\n serverOptions,\n selectedServer,\n})\n</script>\n<template>\n <ScalarListbox\n v-if=\"serverOptions.length > 1\"\n ref=\"elem\"\n class=\"group\"\n :modelValue=\"selectedServerOption\"\n :options=\"serverOptions\"\n placement=\"bottom-start\"\n resize\n :target=\"target\"\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <ScalarButton\n class=\"bg-b-1 text-c-1 h-auto w-full justify-start gap-1.5 overflow-x-auto rounded-t-none !rounded-b-xl px-3 py-1.5 text-base/5.25 font-normal whitespace-nowrap -outline-offset-1\"\n variant=\"ghost\">\n <span class=\"sr-only\">{{ translate('server.label') }}:</span>\n <span class=\"overflow-x-auto\">\n {{ serverUrlWithoutTrailingSlash || translate('server.select') }}\n </span>\n <ScalarIconCaretDown\n class=\"text-c-2 ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100\"\n weight=\"bold\" />\n </ScalarButton>\n </ScalarListbox>\n <div\n v-else\n class=\"text-c-1 flex h-auto w-full items-center gap-0.75 !rounded-b-xl px-3 py-1.5 text-base leading-[20px] whitespace-nowrap\">\n <span class=\"sr-only\">{{ translate('server.label') }}:</span>\n <span class=\"overflow-x-auto\">{{ serverUrlWithoutTrailingSlash }}</span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAkBA,MAAM,OAAO;EAKb,MAAM,EAAE,cAAc,iBAAgB;;;;;EAMtC,MAAM,gBAAgB,eACpB,QAAA,QAAQ,KAAK,YAAY;GACvB,IAAI,OAAO;GACX,OAAO,OAAO;GACf,EAAE,CACL;EAEA,MAAM,gCAAgC,eAC9B,QAAA,gBAAgB,KAAK,QAAQ,OAAO,GAAG,IAAI,GACnD;EAEA,MAAM,uBAAuB,eAC3B,cAAc,MAAM,MAAM,QAAQ,IAAI,OAAO,QAAA,gBAAgB,KAAK,CACpE;AAGA,WAAa;GACX,SAAM,QAAA;GACN;GACA;GACA,gBAAa,QAAA;GACd,CAAA;;UAIS,cAAA,MAAc,SAAM,KAAA,WAAA,EAD5B,YAqBgB,MAAA,cAAA,EAAA;;IAnBd,KAAI;IACJ,OAAM;IACL,YAAY,qBAAA;IACZ,SAAS,cAAA;IACV,WAAU;IACV,QAAA;IACC,QAAQ,QAAA;IACR,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAM,KAAI,qBAAsB,EAAE,GAAE;;2BAW1C,CAVf,YAUe,MAAA,aAAA,EAAA;KATb,OAAM;KACN,SAAQ;;4BACqD;MAA7D,mBAA6D,QAA7D,YAA6D,gBAApC,MAAA,UAAS,CAAA,eAAA,CAAA,GAAmB,KAAC,EAAA;MACtD,mBAEO,QAFP,YAEO,gBADF,8BAAA,SAAiC,MAAA,UAAS,CAAA,gBAAA,CAAA,EAAA,EAAA;MAE/C,YAEkB,MAAA,oBAAA,EAAA;OADhB,OAAM;OACN,QAAO;;;;;;;;;;uBAGb,mBAKM,OALN,YAKM,CAFJ,mBAA6D,QAA7D,YAA6D,gBAApC,MAAA,UAAS,CAAA,eAAA,CAAA,GAAmB,KAAC,EAAA,EACtD,mBAAwE,QAAxE,YAAwE,gBAAvC,8BAAA,MAA6B,EAAA,EAAA,CAAA,CAAA"}
|
package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
|
|
2
|
+
import { type Component } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* AsyncApiSidebarFilters
|
|
5
|
+
*
|
|
6
|
+
* The "Filters" sidebar section shown for AsyncAPI documents. Bundling the
|
|
7
|
+
* native sidebar title and picker pair here keeps the two sidebar layouts
|
|
8
|
+
* (modern and classic) from each repeating the option-building logic.
|
|
9
|
+
*
|
|
10
|
+
* Each picker hides itself when there is nothing to choose from, and the whole
|
|
11
|
+
* section hides when neither picker has a real choice — so passing an OpenAPI
|
|
12
|
+
* document (or `null`) renders nothing.
|
|
13
|
+
*/
|
|
14
|
+
type __VLS_Props = {
|
|
15
|
+
/** The active document, or `null` for OpenAPI documents (renders nothing). */
|
|
16
|
+
document: AsyncApiDocument | null;
|
|
17
|
+
/** Render element for the sidebar section wrapper. */
|
|
18
|
+
is?: Component | string;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_ModelProps = {
|
|
21
|
+
/** Selected protocol id; empty string clears the filter. */
|
|
22
|
+
'protocol'?: string;
|
|
23
|
+
/** Selected server name; empty string clears the filter. */
|
|
24
|
+
'server'?: string;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
27
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
"update:protocol": (value: string) => any;
|
|
29
|
+
"update:server": (value: string) => any;
|
|
30
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
31
|
+
"onUpdate:protocol"?: ((value: string) => any) | undefined;
|
|
32
|
+
"onUpdate:server"?: ((value: string) => any) | undefined;
|
|
33
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
export default _default;
|
|
36
|
+
//# sourceMappingURL=AsyncApiSidebarFilters.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncApiSidebarFilters.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue"],"names":[],"mappings":"AA0EA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAKlE,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAI9C;;;;;;;;;;GAUG;AACH,KAAK,WAAW,GAAG;IACjB,8EAA8E;IAC9E,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;IACjC,sDAAsD;IACtD,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CACxB,CAAC;AA6BF,KAAK,gBAAgB,GAAG;IACxB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAMF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAiFxD,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import AsyncApiSidebarFilters_vue_vue_type_script_setup_true_lang_default from "./AsyncApiSidebarFilters.vue.script.js";
|
|
2
|
+
//#region src/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue
|
|
3
|
+
var AsyncApiSidebarFilters_default = AsyncApiSidebarFilters_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { AsyncApiSidebarFilters_default as default };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=AsyncApiSidebarFilters.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncApiSidebarFilters.vue.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarSidebarSection } from '@scalar/components/sidebar'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport {\n getAsyncApiProtocols,\n getAsyncApiServerOptions,\n} from '@scalar/workspace-store/channel-example'\nimport { computed, type Component } from 'vue'\n\nimport SidebarFilter from './SidebarFilter.vue'\n\n/**\n * AsyncApiSidebarFilters\n *\n * The \"Filters\" sidebar section shown for AsyncAPI documents. Bundling the\n * native sidebar title and picker pair here keeps the two sidebar layouts\n * (modern and classic) from each repeating the option-building logic.\n *\n * Each picker hides itself when there is nothing to choose from, and the whole\n * section hides when neither picker has a real choice — so passing an OpenAPI\n * document (or `null`) renders nothing.\n */\nconst { document, is = 'li' } = defineProps<{\n /** The active document, or `null` for OpenAPI documents (renders nothing). */\n document: AsyncApiDocument | null\n /** Render element for the sidebar section wrapper. */\n is?: Component | string\n}>()\n\n/** Selected protocol id; empty string clears the filter. */\nconst protocol = defineModel<string>('protocol', { default: '' })\n\n/** Selected server name; empty string clears the filter. */\nconst server = defineModel<string>('server', { default: '' })\n\n/** Protocol picker options, including the leading \"All protocols\" entry. */\nconst protocolOptions = computed(() =>\n document ? getAsyncApiProtocols(document) : [],\n)\n\n/** Server picker options, including the leading \"All servers\" entry. */\nconst serverOptions = computed(() =>\n document ? getAsyncApiServerOptions(document) : [],\n)\n\n/** Each picker is only worth showing when there is a choice beyond \"All …\". */\nconst showProtocol = computed(() => protocolOptions.value.length > 2)\nconst showServer = computed(() => serverOptions.value.length > 2)\n</script>\n\n<template>\n <ScalarSidebarSection\n :is\n v-if=\"showProtocol || showServer\"\n class=\"asyncapi-sidebar-filters\">\n Filters\n <template #items>\n <SidebarFilter\n v-if=\"showProtocol\"\n v-model=\"protocol\"\n label=\"Protocol\"\n :options=\"protocolOptions\" />\n <SidebarFilter\n v-if=\"showServer\"\n v-model=\"server\"\n label=\"Server\"\n :options=\"serverOptions\" />\n </template>\n </ScalarSidebarSection>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import SidebarFilter_default from "./SidebarFilter.vue.js";
|
|
2
|
+
import { computed, createBlock, createCommentVNode, createTextVNode, defineComponent, mergeModels, openBlock, unref, useModel, withCtx } from "vue";
|
|
3
|
+
import { ScalarSidebarSection } from "@scalar/components/sidebar";
|
|
4
|
+
import { getAsyncApiProtocols, getAsyncApiServerOptions } from "@scalar/workspace-store/channel-example";
|
|
5
|
+
//#region src/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
/**
|
|
7
|
+
* AsyncApiSidebarFilters
|
|
8
|
+
*
|
|
9
|
+
* The "Filters" sidebar section shown for AsyncAPI documents. Bundling the
|
|
10
|
+
* native sidebar title and picker pair here keeps the two sidebar layouts
|
|
11
|
+
* (modern and classic) from each repeating the option-building logic.
|
|
12
|
+
*
|
|
13
|
+
* Each picker hides itself when there is nothing to choose from, and the whole
|
|
14
|
+
* section hides when neither picker has a real choice — so passing an OpenAPI
|
|
15
|
+
* document (or `null`) renders nothing.
|
|
16
|
+
*/
|
|
17
|
+
var AsyncApiSidebarFilters_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
18
|
+
__name: "AsyncApiSidebarFilters",
|
|
19
|
+
props: /* @__PURE__ */ mergeModels({
|
|
20
|
+
document: {},
|
|
21
|
+
is: { default: "li" }
|
|
22
|
+
}, {
|
|
23
|
+
"protocol": { default: "" },
|
|
24
|
+
"protocolModifiers": {},
|
|
25
|
+
"server": { default: "" },
|
|
26
|
+
"serverModifiers": {}
|
|
27
|
+
}),
|
|
28
|
+
emits: ["update:protocol", "update:server"],
|
|
29
|
+
setup(__props) {
|
|
30
|
+
/** Selected protocol id; empty string clears the filter. */
|
|
31
|
+
const protocol = useModel(__props, "protocol");
|
|
32
|
+
/** Selected server name; empty string clears the filter. */
|
|
33
|
+
const server = useModel(__props, "server");
|
|
34
|
+
/** Protocol picker options, including the leading "All protocols" entry. */
|
|
35
|
+
const protocolOptions = computed(() => __props.document ? getAsyncApiProtocols(__props.document) : []);
|
|
36
|
+
/** Server picker options, including the leading "All servers" entry. */
|
|
37
|
+
const serverOptions = computed(() => __props.document ? getAsyncApiServerOptions(__props.document) : []);
|
|
38
|
+
/** Each picker is only worth showing when there is a choice beyond "All …". */
|
|
39
|
+
const showProtocol = computed(() => protocolOptions.value.length > 2);
|
|
40
|
+
const showServer = computed(() => serverOptions.value.length > 2);
|
|
41
|
+
return (_ctx, _cache) => {
|
|
42
|
+
return showProtocol.value || showServer.value ? (openBlock(), createBlock(unref(ScalarSidebarSection), {
|
|
43
|
+
key: 0,
|
|
44
|
+
is: __props.is,
|
|
45
|
+
class: "asyncapi-sidebar-filters"
|
|
46
|
+
}, {
|
|
47
|
+
items: withCtx(() => [showProtocol.value ? (openBlock(), createBlock(SidebarFilter_default, {
|
|
48
|
+
key: 0,
|
|
49
|
+
modelValue: protocol.value,
|
|
50
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => protocol.value = $event),
|
|
51
|
+
label: "Protocol",
|
|
52
|
+
options: protocolOptions.value
|
|
53
|
+
}, null, 8, ["modelValue", "options"])) : createCommentVNode("", true), showServer.value ? (openBlock(), createBlock(SidebarFilter_default, {
|
|
54
|
+
key: 1,
|
|
55
|
+
modelValue: server.value,
|
|
56
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => server.value = $event),
|
|
57
|
+
label: "Server",
|
|
58
|
+
options: serverOptions.value
|
|
59
|
+
}, null, 8, ["modelValue", "options"])) : createCommentVNode("", true)]),
|
|
60
|
+
default: withCtx(() => [_cache[2] || (_cache[2] = createTextVNode(" Filters ", -1))]),
|
|
61
|
+
_: 1
|
|
62
|
+
}, 8, ["is"])) : createCommentVNode("", true);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
//#endregion
|
|
67
|
+
export { AsyncApiSidebarFilters_vue_vue_type_script_setup_true_lang_default as default };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=AsyncApiSidebarFilters.vue.script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncApiSidebarFilters.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarSidebarSection } from '@scalar/components/sidebar'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport {\n getAsyncApiProtocols,\n getAsyncApiServerOptions,\n} from '@scalar/workspace-store/channel-example'\nimport { computed, type Component } from 'vue'\n\nimport SidebarFilter from './SidebarFilter.vue'\n\n/**\n * AsyncApiSidebarFilters\n *\n * The \"Filters\" sidebar section shown for AsyncAPI documents. Bundling the\n * native sidebar title and picker pair here keeps the two sidebar layouts\n * (modern and classic) from each repeating the option-building logic.\n *\n * Each picker hides itself when there is nothing to choose from, and the whole\n * section hides when neither picker has a real choice — so passing an OpenAPI\n * document (or `null`) renders nothing.\n */\nconst { document, is = 'li' } = defineProps<{\n /** The active document, or `null` for OpenAPI documents (renders nothing). */\n document: AsyncApiDocument | null\n /** Render element for the sidebar section wrapper. */\n is?: Component | string\n}>()\n\n/** Selected protocol id; empty string clears the filter. */\nconst protocol = defineModel<string>('protocol', { default: '' })\n\n/** Selected server name; empty string clears the filter. */\nconst server = defineModel<string>('server', { default: '' })\n\n/** Protocol picker options, including the leading \"All protocols\" entry. */\nconst protocolOptions = computed(() =>\n document ? getAsyncApiProtocols(document) : [],\n)\n\n/** Server picker options, including the leading \"All servers\" entry. */\nconst serverOptions = computed(() =>\n document ? getAsyncApiServerOptions(document) : [],\n)\n\n/** Each picker is only worth showing when there is a choice beyond \"All …\". */\nconst showProtocol = computed(() => protocolOptions.value.length > 2)\nconst showServer = computed(() => serverOptions.value.length > 2)\n</script>\n\n<template>\n <ScalarSidebarSection\n :is\n v-if=\"showProtocol || showServer\"\n class=\"asyncapi-sidebar-filters\">\n Filters\n <template #items>\n <SidebarFilter\n v-if=\"showProtocol\"\n v-model=\"protocol\"\n label=\"Protocol\"\n :options=\"protocolOptions\" />\n <SidebarFilter\n v-if=\"showServer\"\n v-model=\"server\"\n label=\"Server\"\n :options=\"serverOptions\" />\n </template>\n </ScalarSidebarSection>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BA,MAAM,WAAW,SAAmB,SAAC,WAA2B;;EAGhE,MAAM,SAAS,SAAmB,SAAC,SAAyB;;EAG5D,MAAM,kBAAkB,eACtB,QAAA,WAAW,qBAAqB,QAAA,SAAS,GAAG,EAAE,CAChD;;EAGA,MAAM,gBAAgB,eACpB,QAAA,WAAW,yBAAyB,QAAA,SAAS,GAAG,EAAE,CACpD;;EAGA,MAAM,eAAe,eAAe,gBAAgB,MAAM,SAAS,EAAC;EACpE,MAAM,aAAa,eAAe,cAAc,MAAM,SAAS,EAAC;;UAMtD,aAAA,SAAgB,WAAA,SAAA,WAAA,EAFxB,YAiBuB,MAAA,qBAAA,EAAA;;IAhBpB,IAAA,QAAA;IAED,OAAM;;IAEK,OAAK,cAKiB,CAHvB,aAAA,SAAA,WAAA,EADR,YAI+B,uBAAA;;iBAFpB,SAAA;2EAAQ,QAAA;KACjB,OAAM;KACL,SAAS,gBAAA;4EAEJ,WAAA,SAAA,WAAA,EADR,YAI6B,uBAAA;;iBAFlB,OAAA;yEAAM,QAAA;KACf,OAAM;KACL,SAAS,cAAA;;2BAVd,CAAA,OAAA,OAAA,OAAA,KAAA,gBAFiC,aAEjC,GAAA,EAAA,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SidebarFilter
|
|
3
|
+
*
|
|
4
|
+
* A compact picker inside the AsyncAPI sidebar filters section. Reused for the
|
|
5
|
+
* stacked protocol and server filters.
|
|
6
|
+
*
|
|
7
|
+
* `options` is expected to lead with an "All …" entry, which is also used as the
|
|
8
|
+
* fallback selection — so the first option doubles as the cleared state.
|
|
9
|
+
*/
|
|
10
|
+
type __VLS_Props = {
|
|
11
|
+
/** Row label shown to the left of the dropdown (e.g. "Protocol"). */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Filter options, leading with the "All …" entry that clears the filter. */
|
|
14
|
+
options: {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
}[];
|
|
18
|
+
/** The currently selected option id. */
|
|
19
|
+
modelValue?: string;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
22
|
+
"update:modelValue": (id: string) => any;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
24
|
+
"onUpdate:modelValue"?: ((id: string) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
28
|
+
//# sourceMappingURL=SidebarFilter.vue.d.ts.map
|
package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarFilter.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue"],"names":[],"mappings":"AAmEA;;;;;;;;GAQG;AACH,KAAK,WAAW,GAAG;IACjB,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAA;IACb,6EAA6E;IAC7E,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACxC,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;AA0HF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import SidebarFilter_vue_vue_type_script_setup_true_lang_default from "./SidebarFilter.vue.script.js";
|
|
2
|
+
//#region src/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue
|
|
3
|
+
var SidebarFilter_default = SidebarFilter_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { SidebarFilter_default as default };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=SidebarFilter.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarFilter.vue.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarListbox } from '@scalar/components/listbox'\nimport { ScalarSidebarButton } from '@scalar/components/sidebar'\nimport { ScalarIconCaretUpDown } from '@scalar/icons'\nimport { computed } from 'vue'\n\n/**\n * SidebarFilter\n *\n * A compact picker inside the AsyncAPI sidebar filters section. Reused for the\n * stacked protocol and server filters.\n *\n * `options` is expected to lead with an \"All …\" entry, which is also used as the\n * fallback selection — so the first option doubles as the cleared state.\n */\nconst props = defineProps<{\n /** Row label shown to the left of the dropdown (e.g. \"Protocol\"). */\n label: string\n /** Filter options, leading with the \"All …\" entry that clears the filter. */\n options: { id: string; label: string }[]\n /** The currently selected option id. */\n modelValue?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', id: string): void\n}>()\n\n/** Falls back to the first (\"All …\") option when nothing matches. */\nconst selected = computed(\n () =>\n props.options.find((o) => o.id === props.modelValue) ?? props.options[0],\n)\n</script>\n\n<template>\n <li class=\"asyncapi-sidebar-filter min-w-0\">\n <ScalarListbox\n :label=\"label\"\n :modelValue=\"selected\"\n :options=\"options\"\n resize\n teleport\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <ScalarSidebarButton\n is=\"button\"\n class=\"w-full items-center text-left\">\n <span class=\"text-c-1 truncate\">\n {{ selected?.label }}\n </span>\n <template #aside>\n <ScalarIconCaretUpDown\n class=\"text-c-1 ml-1 size-3 shrink-0 self-center\"\n weight=\"bold\" />\n </template>\n </ScalarSidebarButton>\n </ScalarListbox>\n </li>\n</template>\n"],"mappings":""}
|
package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { computed, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
2
|
+
import { ScalarSidebarButton } from "@scalar/components/sidebar";
|
|
3
|
+
import { ScalarListbox } from "@scalar/components/listbox";
|
|
4
|
+
import { ScalarIconCaretUpDown } from "@scalar/icons";
|
|
5
|
+
//#region src/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var _hoisted_1 = { class: "asyncapi-sidebar-filter min-w-0" };
|
|
7
|
+
var _hoisted_2 = { class: "text-c-1 truncate" };
|
|
8
|
+
/**
|
|
9
|
+
* SidebarFilter
|
|
10
|
+
*
|
|
11
|
+
* A compact picker inside the AsyncAPI sidebar filters section. Reused for the
|
|
12
|
+
* stacked protocol and server filters.
|
|
13
|
+
*
|
|
14
|
+
* `options` is expected to lead with an "All …" entry, which is also used as the
|
|
15
|
+
* fallback selection — so the first option doubles as the cleared state.
|
|
16
|
+
*/
|
|
17
|
+
var SidebarFilter_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
18
|
+
__name: "SidebarFilter",
|
|
19
|
+
props: {
|
|
20
|
+
label: {},
|
|
21
|
+
options: {},
|
|
22
|
+
modelValue: {}
|
|
23
|
+
},
|
|
24
|
+
emits: ["update:modelValue"],
|
|
25
|
+
setup(__props, { emit: __emit }) {
|
|
26
|
+
const props = __props;
|
|
27
|
+
const emit = __emit;
|
|
28
|
+
/** Falls back to the first ("All …") option when nothing matches. */
|
|
29
|
+
const selected = computed(() => props.options.find((o) => o.id === props.modelValue) ?? props.options[0]);
|
|
30
|
+
return (_ctx, _cache) => {
|
|
31
|
+
return openBlock(), createElementBlock("li", _hoisted_1, [createVNode(unref(ScalarListbox), {
|
|
32
|
+
label: __props.label,
|
|
33
|
+
modelValue: selected.value,
|
|
34
|
+
options: __props.options,
|
|
35
|
+
resize: "",
|
|
36
|
+
teleport: "",
|
|
37
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = (e) => emit("update:modelValue", e.id))
|
|
38
|
+
}, {
|
|
39
|
+
default: withCtx(() => [createVNode(unref(ScalarSidebarButton), {
|
|
40
|
+
is: "button",
|
|
41
|
+
class: "w-full items-center text-left"
|
|
42
|
+
}, {
|
|
43
|
+
aside: withCtx(() => [createVNode(unref(ScalarIconCaretUpDown), {
|
|
44
|
+
class: "text-c-1 ml-1 size-3 shrink-0 self-center",
|
|
45
|
+
weight: "bold"
|
|
46
|
+
})]),
|
|
47
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_2, toDisplayString(selected.value?.label), 1)]),
|
|
48
|
+
_: 1
|
|
49
|
+
})]),
|
|
50
|
+
_: 1
|
|
51
|
+
}, 8, [
|
|
52
|
+
"label",
|
|
53
|
+
"modelValue",
|
|
54
|
+
"options"
|
|
55
|
+
])]);
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
//#endregion
|
|
60
|
+
export { SidebarFilter_vue_vue_type_script_setup_true_lang_default as default };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=SidebarFilter.vue.script.js.map
|
package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarFilter.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarListbox } from '@scalar/components/listbox'\nimport { ScalarSidebarButton } from '@scalar/components/sidebar'\nimport { ScalarIconCaretUpDown } from '@scalar/icons'\nimport { computed } from 'vue'\n\n/**\n * SidebarFilter\n *\n * A compact picker inside the AsyncAPI sidebar filters section. Reused for the\n * stacked protocol and server filters.\n *\n * `options` is expected to lead with an \"All …\" entry, which is also used as the\n * fallback selection — so the first option doubles as the cleared state.\n */\nconst props = defineProps<{\n /** Row label shown to the left of the dropdown (e.g. \"Protocol\"). */\n label: string\n /** Filter options, leading with the \"All …\" entry that clears the filter. */\n options: { id: string; label: string }[]\n /** The currently selected option id. */\n modelValue?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', id: string): void\n}>()\n\n/** Falls back to the first (\"All …\") option when nothing matches. */\nconst selected = computed(\n () =>\n props.options.find((o) => o.id === props.modelValue) ?? props.options[0],\n)\n</script>\n\n<template>\n <li class=\"asyncapi-sidebar-filter min-w-0\">\n <ScalarListbox\n :label=\"label\"\n :modelValue=\"selected\"\n :options=\"options\"\n resize\n teleport\n @update:modelValue=\"(e) => emit('update:modelValue', e.id)\">\n <ScalarSidebarButton\n is=\"button\"\n class=\"w-full items-center text-left\">\n <span class=\"text-c-1 truncate\">\n {{ selected?.label }}\n </span>\n <template #aside>\n <ScalarIconCaretUpDown\n class=\"text-c-1 ml-1 size-3 shrink-0 self-center\"\n weight=\"bold\" />\n </template>\n </ScalarSidebarButton>\n </ScalarListbox>\n </li>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,QAAQ;EASd,MAAM,OAAO;;EAKb,MAAM,WAAW,eAEb,MAAM,QAAQ,MAAM,MAAM,EAAE,OAAO,MAAM,WAAW,IAAI,MAAM,QAAQ,GAC1E;;uBAIE,mBAqBK,MArBL,YAqBK,CApBH,YAmBgB,MAAA,cAAA,EAAA;IAlBb,OAAO,QAAA;IACP,YAAY,SAAA;IACZ,SAAS,QAAA;IACV,QAAA;IACA,UAAA;IACC,uBAAiB,OAAA,OAAA,OAAA,MAAG,MAAM,KAAI,qBAAsB,EAAE,GAAE;;2BAYnC,CAXtB,YAWsB,MAAA,oBAAA,EAAA;KAVpB,IAAG;KACH,OAAM;;KAIK,OAAK,cAGI,CAFlB,YAEkB,MAAA,sBAAA,EAAA;MADhB,OAAM;MACN,QAAO;;4BAJJ,CAFP,mBAEO,QAFP,YAEO,gBADF,SAAA,OAAU,MAAK,EAAA,EAAA,CAAA,CAAA"}
|
package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
|
|
2
|
+
import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
|
|
3
|
+
/** The currently selected sidebar filters. Empty / sentinel values disable a filter. */
|
|
4
|
+
type AsyncApiNavigationFilter = {
|
|
5
|
+
/** Selected protocol id, or {@link ALL} / undefined for no protocol filter. */
|
|
6
|
+
protocol?: string;
|
|
7
|
+
/** Selected server name, or {@link ALL} / undefined for no server filter. */
|
|
8
|
+
server?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Filters the AsyncAPI sidebar tree by the selected protocol and/or server.
|
|
12
|
+
*
|
|
13
|
+
* Returns the original entries untouched when no filter is active, so OpenAPI
|
|
14
|
+
* documents and the unfiltered AsyncAPI case pay no cost.
|
|
15
|
+
*/
|
|
16
|
+
export declare const filterAsyncApiNavigation: (entries: TraversedEntry[], document: AsyncApiDocument, filter: AsyncApiNavigationFilter) => TraversedEntry[];
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=filter-async-api-navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-async-api-navigation.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAQlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAEhF,wFAAwF;AACxF,KAAK,wBAAwB,GAAG;IAC9B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAiED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS,cAAc,EAAE,EACzB,UAAU,gBAAgB,EAC1B,QAAQ,wBAAwB,KAC/B,cAAc,EAYhB,CAAA"}
|
package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ALL, createReachabilityContext, getOperationReachability } from "@scalar/workspace-store/channel-example";
|
|
2
|
+
import { getResolvedRef, mergeSiblingReferences } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
+
//#region src/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.ts
|
|
4
|
+
/** Whether the filter would keep every entry, so the tree can be returned untouched. */
|
|
5
|
+
var isNoopFilter = ({ protocol, server }) => (!protocol || protocol === ALL) && (!server || server === ALL);
|
|
6
|
+
/** Whether a selection (protocol or server) keeps an operation, given the set it is reachable through. */
|
|
7
|
+
var selectionMatches = (reachable, selected) => !selected || selected === ALL || reachable.has(selected);
|
|
8
|
+
/**
|
|
9
|
+
* Filters one navigation entry against the selected protocol/server.
|
|
10
|
+
*
|
|
11
|
+
* - `asyncapi-operation` — kept only when the operation matches both filters.
|
|
12
|
+
* - `asyncapi-channel` / `tag` — recursed into, then dropped when they have no
|
|
13
|
+
* children left (so empty channels and tags disappear from the sidebar).
|
|
14
|
+
* - Everything else (description, models, schemas) passes through unchanged.
|
|
15
|
+
*
|
|
16
|
+
* `context` carries the document-level lookups so they are built once per filter
|
|
17
|
+
* pass rather than recomputed for every operation.
|
|
18
|
+
*
|
|
19
|
+
* Returns `null` when the entry should be removed.
|
|
20
|
+
*/
|
|
21
|
+
var filterEntry = (entry, document, filter, context) => {
|
|
22
|
+
if (entry.type === "asyncapi-operation") {
|
|
23
|
+
const operationNode = document.operations?.[entry.operationName];
|
|
24
|
+
if (!operationNode) return entry;
|
|
25
|
+
const { protocols, serverNames } = getOperationReachability(document, getResolvedRef(operationNode, mergeSiblingReferences), context);
|
|
26
|
+
return selectionMatches(protocols, filter.protocol) && selectionMatches(serverNames, filter.server) ? entry : null;
|
|
27
|
+
}
|
|
28
|
+
if (entry.type === "asyncapi-channel" || entry.type === "tag") {
|
|
29
|
+
const originalChildren = entry.children ?? [];
|
|
30
|
+
const children = originalChildren.flatMap((child) => {
|
|
31
|
+
const filtered = filterEntry(child, document, filter, context);
|
|
32
|
+
return filtered ? [filtered] : [];
|
|
33
|
+
});
|
|
34
|
+
if (originalChildren.length > 0 && children.length === 0) return null;
|
|
35
|
+
return {
|
|
36
|
+
...entry,
|
|
37
|
+
children
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return entry;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Filters the AsyncAPI sidebar tree by the selected protocol and/or server.
|
|
44
|
+
*
|
|
45
|
+
* Returns the original entries untouched when no filter is active, so OpenAPI
|
|
46
|
+
* documents and the unfiltered AsyncAPI case pay no cost.
|
|
47
|
+
*/
|
|
48
|
+
var filterAsyncApiNavigation = (entries, document, filter) => {
|
|
49
|
+
if (isNoopFilter(filter)) return entries;
|
|
50
|
+
const context = createReachabilityContext(document);
|
|
51
|
+
return entries.flatMap((entry) => {
|
|
52
|
+
const filtered = filterEntry(entry, document, filter, context);
|
|
53
|
+
return filtered ? [filtered] : [];
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { filterAsyncApiNavigation };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=filter-async-api-navigation.js.map
|
package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-async-api-navigation.js","names":[],"sources":["../../../../src/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.ts"],"sourcesContent":["import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport {\n ALL,\n type AsyncApiReachabilityContext,\n createReachabilityContext,\n getOperationReachability,\n} from '@scalar/workspace-store/channel-example'\nimport { getResolvedRef, mergeSiblingReferences } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\n\n/** The currently selected sidebar filters. Empty / sentinel values disable a filter. */\ntype AsyncApiNavigationFilter = {\n /** Selected protocol id, or {@link ALL} / undefined for no protocol filter. */\n protocol?: string\n /** Selected server name, or {@link ALL} / undefined for no server filter. */\n server?: string\n}\n\n/** Whether the filter would keep every entry, so the tree can be returned untouched. */\nconst isNoopFilter = ({ protocol, server }: AsyncApiNavigationFilter): boolean =>\n (!protocol || protocol === ALL) && (!server || server === ALL)\n\n/** Whether a selection (protocol or server) keeps an operation, given the set it is reachable through. */\nconst selectionMatches = (reachable: Set<string>, selected: string | undefined): boolean =>\n !selected || selected === ALL || reachable.has(selected)\n\n/**\n * Filters one navigation entry against the selected protocol/server.\n *\n * - `asyncapi-operation` — kept only when the operation matches both filters.\n * - `asyncapi-channel` / `tag` — recursed into, then dropped when they have no\n * children left (so empty channels and tags disappear from the sidebar).\n * - Everything else (description, models, schemas) passes through unchanged.\n *\n * `context` carries the document-level lookups so they are built once per filter\n * pass rather than recomputed for every operation.\n *\n * Returns `null` when the entry should be removed.\n */\nconst filterEntry = (\n entry: TraversedEntry,\n document: AsyncApiDocument,\n filter: AsyncApiNavigationFilter,\n context: AsyncApiReachabilityContext,\n): TraversedEntry | null => {\n if (entry.type === 'asyncapi-operation') {\n const operationNode = document.operations?.[entry.operationName]\n // If the operation can't be resolved we keep it rather than hide it by accident.\n if (!operationNode) {\n return entry\n }\n\n // Resolve the same way the navigation traversal did, so sibling overrides\n // (e.g. an inline `channel` alongside a `$ref`) are honored consistently.\n const operation = getResolvedRef(operationNode, mergeSiblingReferences)\n\n // Resolve the operation's reachability once, then test both selections against it.\n const { protocols, serverNames } = getOperationReachability(document, operation, context)\n const keep = selectionMatches(protocols, filter.protocol) && selectionMatches(serverNames, filter.server)\n\n return keep ? entry : null\n }\n\n if (entry.type === 'asyncapi-channel' || entry.type === 'tag') {\n const originalChildren = entry.children ?? []\n const children = originalChildren.flatMap((child) => {\n const filtered = filterEntry(child, document, filter, context)\n return filtered ? [filtered] : []\n })\n\n // Drop a container that had children but lost them all to the filter.\n if (originalChildren.length > 0 && children.length === 0) {\n return null\n }\n\n return { ...entry, children }\n }\n\n return entry\n}\n\n/**\n * Filters the AsyncAPI sidebar tree by the selected protocol and/or server.\n *\n * Returns the original entries untouched when no filter is active, so OpenAPI\n * documents and the unfiltered AsyncAPI case pay no cost.\n */\nexport const filterAsyncApiNavigation = (\n entries: TraversedEntry[],\n document: AsyncApiDocument,\n filter: AsyncApiNavigationFilter,\n): TraversedEntry[] => {\n if (isNoopFilter(filter)) {\n return entries\n }\n\n // Build the document-level reachability lookups once for the whole pass.\n const context = createReachabilityContext(document)\n\n return entries.flatMap((entry) => {\n const filtered = filterEntry(entry, document, filter, context)\n return filtered ? [filtered] : []\n })\n}\n"],"mappings":";;;;AAmBA,IAAM,gBAAgB,EAAE,UAAU,cAC/B,CAAC,YAAY,aAAa,SAAS,CAAC,UAAU,WAAW;;AAG5D,IAAM,oBAAoB,WAAwB,aAChD,CAAC,YAAY,aAAa,OAAO,UAAU,IAAI,SAAS;;;;;;;;;;;;;;AAe1D,IAAM,eACJ,OACA,UACA,QACA,YAC0B;AAC1B,KAAI,MAAM,SAAS,sBAAsB;EACvC,MAAM,gBAAgB,SAAS,aAAa,MAAM;AAElD,MAAI,CAAC,cACH,QAAO;EAQT,MAAM,EAAE,WAAW,gBAAgB,yBAAyB,UAH1C,eAAe,eAAe,uBAAuB,EAGU,QAAQ;AAGzF,SAFa,iBAAiB,WAAW,OAAO,SAAS,IAAI,iBAAiB,aAAa,OAAO,OAAO,GAE3F,QAAQ;;AAGxB,KAAI,MAAM,SAAS,sBAAsB,MAAM,SAAS,OAAO;EAC7D,MAAM,mBAAmB,MAAM,YAAY,EAAE;EAC7C,MAAM,WAAW,iBAAiB,SAAS,UAAU;GACnD,MAAM,WAAW,YAAY,OAAO,UAAU,QAAQ,QAAQ;AAC9D,UAAO,WAAW,CAAC,SAAS,GAAG,EAAE;IACjC;AAGF,MAAI,iBAAiB,SAAS,KAAK,SAAS,WAAW,EACrD,QAAO;AAGT,SAAO;GAAE,GAAG;GAAO;GAAU;;AAG/B,QAAO;;;;;;;;AAST,IAAa,4BACX,SACA,UACA,WACqB;AACrB,KAAI,aAAa,OAAO,CACtB,QAAO;CAIT,MAAM,UAAU,0BAA0B,SAAS;AAEnD,QAAO,QAAQ,SAAS,UAAU;EAChC,MAAM,WAAW,YAAY,OAAO,UAAU,QAAQ,QAAQ;AAC9D,SAAO,WAAW,CAAC,SAAS,GAAG,EAAE;GACjC"}
|