@scalar/api-reference 1.60.0 → 1.62.0
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 +40 -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-C3QiXv0S.js +27 -0
- package/dist/browser/chunks/ScalarTextInput.vue-CysYmeeN.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-LBDjZSmM.js → modal-CMytT4BZ.js} +2 -2
- package/dist/browser/chunks/modal-wI0tG53V.js +99 -0
- 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-BPQqqkn-.js +306 -0
- package/dist/browser/standalone.esm.js +20 -20
- package/dist/browser/standalone.js +294 -294
- 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 +181 -46
- package/dist/components/ApiReference.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.d.ts +10 -0
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js +9 -0
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js.map +1 -0
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js +47 -0
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js.map +1 -0
- package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.js.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +2 -0
- package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.d.ts +4 -1
- package/dist/components/Content/AsyncApi/Channel.vue.d.ts.map +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.js +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.js.map +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.script.js +98 -44
- package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/Message.vue.d.ts +18 -0
- package/dist/components/Content/AsyncApi/Message.vue.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/Message.vue.js +9 -0
- package/dist/components/Content/AsyncApi/Message.vue.js.map +1 -0
- package/dist/components/Content/AsyncApi/Message.vue.script.js +159 -0
- package/dist/components/Content/AsyncApi/Message.vue.script.js.map +1 -0
- package/dist/components/Content/AsyncApi/Operation.vue.d.ts +18 -0
- package/dist/components/Content/AsyncApi/Operation.vue.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/Operation.vue.js +9 -0
- package/dist/components/Content/AsyncApi/Operation.vue.js.map +1 -0
- package/dist/components/Content/AsyncApi/Operation.vue.script.js +84 -0
- package/dist/components/Content/AsyncApi/Operation.vue.script.js.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/async-api-render-options.d.ts +14 -0
- package/dist/components/Content/AsyncApi/helpers/async-api-render-options.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/async-api-render-options.js +14 -0
- package/dist/components/Content/AsyncApi/helpers/async-api-render-options.js.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.d.ts +9 -0
- package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.js +12 -0
- package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.js.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.d.ts +13 -0
- package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.js +23 -0
- package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.js.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/pick-heading.d.ts +10 -0
- package/dist/components/Content/AsyncApi/helpers/pick-heading.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/pick-heading.js +20 -0
- package/dist/components/Content/AsyncApi/helpers/pick-heading.js.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.d.ts +21 -0
- package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.js +35 -0
- package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.js.map +1 -0
- 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 +10 -6
- 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 +25 -12
- 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 +6 -4
- 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 +24 -6
- 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 +47 -22
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +10 -9
- 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 +18 -13
- 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/get-async-api-message-payload-schema.d.ts +18 -0
- package/dist/helpers/get-async-api-message-payload-schema.d.ts.map +1 -0
- package/dist/helpers/get-async-api-message-payload-schema.js +33 -0
- package/dist/helpers/get-async-api-message-payload-schema.js.map +1 -0
- package/dist/helpers/get-async-api-model-schema.d.ts.map +1 -1
- package/dist/helpers/get-async-api-model-schema.js +2 -11
- package/dist/helpers/get-async-api-model-schema.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-plugins.d.ts +8 -3
- package/dist/helpers/map-config-plugins.d.ts.map +1 -1
- package/dist/helpers/map-config-plugins.js +22 -4
- package/dist/helpers/map-config-plugins.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 +783 -666
- package/dist/styles/tailwind.config.css +1 -0
- package/dist/vue-styles.css +700 -597
- package/package.json +18 -17
- package/dist/browser/chunks/AgentScalarChatInterface-CesFQ_Ax.js +0 -27
- package/dist/browser/chunks/ScalarTextInput.vue-C14zmVNI.js +0 -27
- package/dist/browser/chunks/modal-BZzcBkVp.js +0 -99
- package/dist/browser/chunks/vendor-wW8jg8wN.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntroductionLayout.vue.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/IntroductionLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { AsyncApiInfoObject } from '@scalar/types/asyncapi/3.1'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n ExternalDocumentationObject,\n InfoObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContainer,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport { SpecificationExtension } from '@/features/specification-extension'\n\nimport InfoDescription from './InfoDescription.vue'\nimport InfoLinks from './InfoLinks.vue'\nimport InfoVersion from './InfoVersion.vue'\nimport IntroductionLoading from './IntroductionLoading.vue'\nimport SpecificationVersion from './SpecificationVersion.vue'\n\ndefineProps<{\n id: string | undefined\n documentType?: 'openapi' | 'asyncapi'\n specificationVersion: string | undefined\n info: InfoObject | AsyncApiInfoObject | undefined\n externalDocs?: ExternalDocumentationObject\n documentExtensions?: Record<string, unknown>\n infoExtensions?: Record<string, unknown>\n headingSlugGenerator: (heading: Heading) => string\n eventBus: WorkspaceEventBus | null\n}>()\n</script>\n\n<template>\n <SectionContainer>\n <!-- If the #after slot is used, we need to add a gap to the section. -->\n <Section\n :id=\"id\"\n aria-label=\"
|
|
1
|
+
{"version":3,"file":"IntroductionLayout.vue.js","names":[],"sources":["../../../../src/blocks/scalar-info-block/components/IntroductionLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { AsyncApiInfoObject } from '@scalar/types/asyncapi/3.1'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n ExternalDocumentationObject,\n InfoObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContainer,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport { useLocalization } from '@/features/localization'\nimport { SpecificationExtension } from '@/features/specification-extension'\n\nimport InfoDescription from './InfoDescription.vue'\nimport InfoLinks from './InfoLinks.vue'\nimport InfoVersion from './InfoVersion.vue'\nimport IntroductionLoading from './IntroductionLoading.vue'\nimport SpecificationVersion from './SpecificationVersion.vue'\n\ndefineProps<{\n id: string | undefined\n documentType?: 'openapi' | 'asyncapi'\n specificationVersion: string | undefined\n info: InfoObject | AsyncApiInfoObject | undefined\n externalDocs?: ExternalDocumentationObject\n documentExtensions?: Record<string, unknown>\n infoExtensions?: Record<string, unknown>\n headingSlugGenerator: (heading: Heading) => string\n eventBus: WorkspaceEventBus | null\n}>()\n\nconst { translate } = useLocalization()\n</script>\n\n<template>\n <SectionContainer>\n <!-- If the #after slot is used, we need to add a gap to the section. -->\n <Section\n :id=\"id\"\n :aria-label=\"translate('navigation.introduction')\"\n class=\"introduction-section z-1 gap-12\"\n @intersecting=\"\n () => id && eventBus?.emit('intersecting:nav-item', { id })\n \">\n <SectionContent>\n <!-- While the document loads we show a skeleton that mirrors this layout. -->\n <IntroductionLoading\n v-if=\"!info\"\n :hasAside=\"Boolean($slots.aside)\" />\n\n <template v-else>\n <div class=\"flex gap-1.5\">\n <InfoVersion :version=\"info?.version\" />\n <SpecificationVersion\n :documentType\n :version=\"specificationVersion\" />\n </div>\n <SectionHeader tight>\n <SectionHeaderTag :level=\"1\">\n {{ info?.title }}\n </SectionHeaderTag>\n <template #links>\n <InfoLinks\n :externalDocs=\"externalDocs\"\n :info=\"info\" />\n </template>\n </SectionHeader>\n <SectionColumns>\n <SectionColumn>\n <slot name=\"download-link\" />\n <InfoDescription\n :description=\"info?.description\"\n :eventBus=\"eventBus\"\n :headingSlugGenerator=\"headingSlugGenerator\" />\n </SectionColumn>\n <SectionColumn v-if=\"$slots.aside\">\n <div class=\"sticky-cards\">\n <slot name=\"aside\" />\n </div>\n </SectionColumn>\n </SectionColumns>\n <SpecificationExtension :value=\"documentExtensions\" />\n <SpecificationExtension :value=\"infoExtensions\" />\n </template>\n </SectionContent>\n <slot name=\"after\" />\n </Section>\n </SectionContainer>\n</template>\n\n<style scoped>\n.sticky-cards {\n display: flex;\n flex-direction: column;\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n}\n</style>\n"],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useLocalization } from "../../../features/localization/use-localization.js";
|
|
1
2
|
import Section_default from "../../../components/Section/Section.vue.js";
|
|
2
3
|
import SectionColumn_default from "../../../components/Section/SectionColumn.vue.js";
|
|
3
4
|
import SectionColumns_default from "../../../components/Section/SectionColumns.vue.js";
|
|
@@ -29,11 +30,12 @@ var IntroductionLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
|
|
|
29
30
|
eventBus: {}
|
|
30
31
|
},
|
|
31
32
|
setup(__props) {
|
|
33
|
+
const { translate } = useLocalization();
|
|
32
34
|
return (_ctx, _cache) => {
|
|
33
35
|
return openBlock(), createBlock(unref(SectionContainer_default), null, {
|
|
34
36
|
default: withCtx(() => [createVNode(unref(Section_default), {
|
|
35
37
|
id: __props.id,
|
|
36
|
-
"aria-label": "
|
|
38
|
+
"aria-label": unref(translate)("navigation.introduction"),
|
|
37
39
|
class: "introduction-section z-1 gap-12",
|
|
38
40
|
onIntersecting: _cache[0] || (_cache[0] = () => __props.id && __props.eventBus?.emit("intersecting:nav-item", { id: __props.id }))
|
|
39
41
|
}, {
|
|
@@ -81,7 +83,7 @@ var IntroductionLayout_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
|
|
|
81
83
|
_: 3
|
|
82
84
|
}), renderSlot(_ctx.$slots, "after", {}, void 0, true)]),
|
|
83
85
|
_: 3
|
|
84
|
-
}, 8, ["id"])]),
|
|
86
|
+
}, 8, ["id", "aria-label"])]),
|
|
85
87
|
_: 3
|
|
86
88
|
});
|
|
87
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntroductionLayout.vue.script.js","names":["$slots"],"sources":["../../../../src/blocks/scalar-info-block/components/IntroductionLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { AsyncApiInfoObject } from '@scalar/types/asyncapi/3.1'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n ExternalDocumentationObject,\n InfoObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContainer,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport { SpecificationExtension } from '@/features/specification-extension'\n\nimport InfoDescription from './InfoDescription.vue'\nimport InfoLinks from './InfoLinks.vue'\nimport InfoVersion from './InfoVersion.vue'\nimport IntroductionLoading from './IntroductionLoading.vue'\nimport SpecificationVersion from './SpecificationVersion.vue'\n\ndefineProps<{\n id: string | undefined\n documentType?: 'openapi' | 'asyncapi'\n specificationVersion: string | undefined\n info: InfoObject | AsyncApiInfoObject | undefined\n externalDocs?: ExternalDocumentationObject\n documentExtensions?: Record<string, unknown>\n infoExtensions?: Record<string, unknown>\n headingSlugGenerator: (heading: Heading) => string\n eventBus: WorkspaceEventBus | null\n}>()\n</script>\n\n<template>\n <SectionContainer>\n <!-- If the #after slot is used, we need to add a gap to the section. -->\n <Section\n :id=\"id\"\n aria-label=\"
|
|
1
|
+
{"version":3,"file":"IntroductionLayout.vue.script.js","names":["$slots"],"sources":["../../../../src/blocks/scalar-info-block/components/IntroductionLayout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { AsyncApiInfoObject } from '@scalar/types/asyncapi/3.1'\nimport type { Heading } from '@scalar/types/legacy'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n ExternalDocumentationObject,\n InfoObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport {\n Section,\n SectionColumn,\n SectionColumns,\n SectionContainer,\n SectionContent,\n SectionHeader,\n SectionHeaderTag,\n} from '@/components/Section'\nimport { useLocalization } from '@/features/localization'\nimport { SpecificationExtension } from '@/features/specification-extension'\n\nimport InfoDescription from './InfoDescription.vue'\nimport InfoLinks from './InfoLinks.vue'\nimport InfoVersion from './InfoVersion.vue'\nimport IntroductionLoading from './IntroductionLoading.vue'\nimport SpecificationVersion from './SpecificationVersion.vue'\n\ndefineProps<{\n id: string | undefined\n documentType?: 'openapi' | 'asyncapi'\n specificationVersion: string | undefined\n info: InfoObject | AsyncApiInfoObject | undefined\n externalDocs?: ExternalDocumentationObject\n documentExtensions?: Record<string, unknown>\n infoExtensions?: Record<string, unknown>\n headingSlugGenerator: (heading: Heading) => string\n eventBus: WorkspaceEventBus | null\n}>()\n\nconst { translate } = useLocalization()\n</script>\n\n<template>\n <SectionContainer>\n <!-- If the #after slot is used, we need to add a gap to the section. -->\n <Section\n :id=\"id\"\n :aria-label=\"translate('navigation.introduction')\"\n class=\"introduction-section z-1 gap-12\"\n @intersecting=\"\n () => id && eventBus?.emit('intersecting:nav-item', { id })\n \">\n <SectionContent>\n <!-- While the document loads we show a skeleton that mirrors this layout. -->\n <IntroductionLoading\n v-if=\"!info\"\n :hasAside=\"Boolean($slots.aside)\" />\n\n <template v-else>\n <div class=\"flex gap-1.5\">\n <InfoVersion :version=\"info?.version\" />\n <SpecificationVersion\n :documentType\n :version=\"specificationVersion\" />\n </div>\n <SectionHeader tight>\n <SectionHeaderTag :level=\"1\">\n {{ info?.title }}\n </SectionHeaderTag>\n <template #links>\n <InfoLinks\n :externalDocs=\"externalDocs\"\n :info=\"info\" />\n </template>\n </SectionHeader>\n <SectionColumns>\n <SectionColumn>\n <slot name=\"download-link\" />\n <InfoDescription\n :description=\"info?.description\"\n :eventBus=\"eventBus\"\n :headingSlugGenerator=\"headingSlugGenerator\" />\n </SectionColumn>\n <SectionColumn v-if=\"$slots.aside\">\n <div class=\"sticky-cards\">\n <slot name=\"aside\" />\n </div>\n </SectionColumn>\n </SectionColumns>\n <SpecificationExtension :value=\"documentExtensions\" />\n <SpecificationExtension :value=\"infoExtensions\" />\n </template>\n </SectionContent>\n <slot name=\"after\" />\n </Section>\n </SectionContainer>\n</template>\n\n<style scoped>\n.sticky-cards {\n display: flex;\n flex-direction: column;\n position: sticky;\n top: calc(var(--refs-viewport-offset) + 24px);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCA,MAAM,EAAE,cAAc,iBAAgB;;uBAIpC,YAoDmB,MAAA,yBAAA,EAAA,MAAA;2BADP,CAjDV,YAiDU,MAAA,gBAAA,EAAA;KAhDP,IAAI,QAAA;KACJ,cAAY,MAAA,UAAS,CAAA,0BAAA;KACtB,OAAM;KACL,gBAAY,OAAA,OAAA,OAAA,WAAiB,QAAA,MAAM,QAAA,UAAU,KAAI,yBAAA,EAAA,IAA4B,QAAA,IAAE,CAAA;;4BA2C/D,CAxCjB,YAwCiB,MAAA,uBAAA,EAAA,MAAA;6BApCuB,CAAA,CAD7B,QAAA,QAAA,WAAA,EADT,YAEsC,6BAAA;;OAAnC,UAAU,QAAQA,KAAAA,OAAO,MAAK;iDAEjC,mBAiCW,UAAA,EAAA,KAAA,GAAA,EAAA;OAhCT,mBAKM,OALN,YAKM,CAJJ,YAAwC,qBAAA,EAA1B,SA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kInstallationInstructions.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SdkInstallationInstructions.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue"],"names":[],"mappings":"AAqgBA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+EAA+E,CAAA;AAiB3H,KAAK,WAAW,GAAG;IACjB,4EAA4E;IAC5E,sBAAsB,CAAC,EAAE,sBAAsB,CAAC,2BAA2B,CAAC,CAAA;IAC5E;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAA;CAC7B,CAAC;AA0fF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
|
|
|
2
2
|
import SdkInstallationInstructions_vue_vue_type_script_setup_true_lang_default from "./SdkInstallationInstructions.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue
|
|
5
|
-
var SdkInstallationInstructions_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SdkInstallationInstructions_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var SdkInstallationInstructions_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SdkInstallationInstructions_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-9cbb007b"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SdkInstallationInstructions_default as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkInstallationInstructions.vue.js","names":[],"sources":["../../../../src/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getCustomClientIds } from '@scalar/api-client/blocks/operation-code-sample'\nimport {\n ScalarCombobox,\n type ScalarComboboxOption,\n} from '@scalar/components/combobox'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarSdkInstallation } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-sdk-installation'\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n useId,\n watch,\n} from 'vue'\n\nimport { getLanguageIcon } from '../helpers/language-icon'\nimport { getRenderableSdks } from '../helpers/renderable-sdks'\nimport { getVisibleTabCount } from '../helpers/visible-tab-count'\n\nconst { xScalarSdkInstallation, selectedClient, eventBus } = defineProps<{\n /** Custom SDK installation instructions from `x-scalar-sdk-installation` */\n xScalarSdkInstallation?: XScalarSdkInstallation['x-scalar-sdk-installation']\n /**\n * The globally selected client id. When it matches one of the SDK languages\n * (as a `custom/<lang>` id) the matching tab is shown as active, keeping the\n * tabs in sync with the operation code samples.\n */\n selectedClient?: string\n /**\n * Event bus used to broadcast the selected client. Picking a language here\n * switches the operation code samples to that language's custom example, the\n * same channel the generic client selector uses.\n */\n eventBus?: WorkspaceEventBus\n}>()\n\nconst headingId = useId()\n/** Base id used to associate each tab with the shared panel for assistive tech */\nconst baseId = useId()\nconst panelId = `${baseId}-panel`\n\n/** Only the SDKs that actually have something to show, with their resolved icon */\nconst sdks = computed(() =>\n getRenderableSdks(xScalarSdkInstallation).map((sdk) => ({\n ...sdk,\n icon: getLanguageIcon(sdk.lang),\n })),\n)\n\n/** Index of the currently selected SDK */\nconst selectedIndex = ref(0)\n\n/** The currently selected SDK */\nconst selected = computed(() => sdks.value[selectedIndex.value])\n\n/**\n * The `custom/<lang>` client id for each SDK, aligned by index with `sdks`.\n *\n * We reuse the exact id scheme the operation code samples use for their custom\n * examples, so selecting a language here resolves to the same id those samples\n * are keyed by — that shared id is what keeps the two surfaces in sync.\n */\nconst sdkClientIds = computed(() =>\n getCustomClientIds(sdks.value.map((sdk) => ({ lang: sdk.lang, source: '' }))),\n)\n\n/** Select an SDK by index and broadcast it so the operation code samples follow */\nconst select = (index: number) => {\n selectedIndex.value = index\n\n const id = sdkClientIds.value[index]\n if (id) {\n eventBus?.emit('workspace:update:selected-client', id)\n }\n}\n\n// Keep the active tab aligned with the global selection, re-evaluating whenever\n// either the selection or the available SDKs change. Watching `sdkClientIds`\n// (not just `selectedClient`) is what stops the intro tab and the operation\n// samples from disagreeing after the SDK list is reordered or resized: the tab\n// follows the selected language to its new position. When the selection is a\n// built-in client (or a language this document has no install entry for) we keep\n// the current tab, only clamping it back into range if the list shrank past it.\nwatch(\n [() => selectedClient, sdkClientIds],\n ([client, ids]) => {\n const matched = client ? ids.findIndex((id) => id === client) : -1\n\n if (matched >= 0) {\n selectedIndex.value = matched\n } else if (selectedIndex.value > ids.length - 1) {\n selectedIndex.value = 0\n }\n },\n { immediate: true },\n)\n\n// Re-measure whenever the set of SDKs changes. Keying on the languages (not just\n// the count) also catches documents that swap in a different set of the same\n// size, which would otherwise leave the cached tab widths — and the \"More\"\n// overflow logic — stale.\nwatch(\n () => sdks.value.map((sdk) => sdk.lang).join('\\n'),\n () => void nextTick(measure),\n)\n\nconst tabsRef = ref<HTMLElement>()\nconst measureRef = ref<HTMLElement>()\n\n/** The width available to render the tabs in */\nconst availableWidth = ref(0)\n/** The natural width of each tab */\nconst tabWidths = ref<number[]>([])\n/** The width of the \"More\" dropdown trigger */\nconst moreWidth = ref(0)\n\n/** Measure the available width and the natural width of each tab */\nconst measure = () => {\n const measureEl = measureRef.value\n const tabsEl = tabsRef.value\n\n if (!measureEl || !tabsEl) {\n return\n }\n\n // The measuring row renders every tab followed by the \"More\" trigger\n const widths = Array.from(measureEl.children).map(\n (child) => (child as HTMLElement).offsetWidth,\n )\n\n tabWidths.value = widths.slice(0, sdks.value.length)\n moreWidth.value = widths[sdks.value.length] ?? 0\n availableWidth.value = tabsEl.clientWidth\n}\n\n/** How many tabs fit inline before we need the \"More\" dropdown */\nconst visibleCount = computed(() => {\n // Until we have measured, render everything (also the server-rendered state)\n if (!tabWidths.value.length || availableWidth.value <= 0) {\n return sdks.value.length\n }\n\n return getVisibleTabCount(\n tabWidths.value,\n availableWidth.value,\n moreWidth.value,\n )\n})\n\n/** The SDKs shown as inline tabs */\nconst visibleSdks = computed(() => sdks.value.slice(0, visibleCount.value))\n\n/** Whether the selected SDK lives in the \"More\" dropdown */\nconst isMoreActive = computed(() => selectedIndex.value >= visibleCount.value)\n\n/** The overflowing SDKs as combobox options, keyed by their original index */\nconst moreOptions = computed<ScalarComboboxOption[]>(() =>\n sdks.value.slice(visibleCount.value).map((sdk, index) => ({\n id: String(visibleCount.value + index),\n label: sdk.lang,\n })),\n)\n\n/** The selected option within the \"More\" dropdown, if any */\nconst selectedMoreOption = computed(() =>\n moreOptions.value.find((option) => option.id === String(selectedIndex.value)),\n)\n\nconst selectMore = (option: ScalarComboboxOption | undefined) => {\n if (option) {\n select(Number(option.id))\n }\n}\n\n/** The id of the tab that labels the panel (falls back to the heading when the selection lives in \"More\") */\nconst activeTabId = computed(() =>\n isMoreActive.value ? headingId : `${baseId}-tab-${selectedIndex.value}`,\n)\n\n/**\n * The visible tab that holds the roving tabindex. When the selection lives in\n * the \"More\" dropdown, that trigger is the tab stop instead, so no inline tab\n * should be focusable.\n */\nconst tabStopIndex = computed(() =>\n isMoreActive.value ? -1 : selectedIndex.value,\n)\n\n/** Focus a visible tab by index after the DOM has settled */\nconst focusTab = (index: number) => {\n void nextTick(() => {\n tabsRef.value\n ?.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]')\n [index]?.focus()\n })\n}\n\n/** Arrow / Home / End keyboard navigation across the visible tabs (WAI-ARIA tabs pattern) */\nconst onTabKeydown = (event: KeyboardEvent, index: number) => {\n const lastVisible = visibleCount.value - 1\n\n let next = index\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n next = index >= lastVisible ? 0 : index + 1\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n next = index <= 0 ? lastVisible : index - 1\n break\n case 'Home':\n next = 0\n break\n case 'End':\n next = lastVisible\n break\n default:\n return\n }\n\n event.preventDefault()\n select(next)\n focusTab(next)\n}\n\nlet observer: ResizeObserver | undefined\nlet frame = 0\n\n/** Coalesce resize bursts into a single measure before the next paint */\nconst scheduleMeasure = () => {\n if (typeof requestAnimationFrame === 'undefined') {\n measure()\n return\n }\n cancelAnimationFrame(frame)\n frame = requestAnimationFrame(measure)\n}\n\nonMounted(() => {\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(scheduleMeasure)\n // Observe the visible row for the available width, and the hidden measure\n // row for the natural tab widths. The latter catches changes the container\n // never sees — web fonts loading, or labels changing without the count\n // changing — which would otherwise leave the overflow logic stale.\n if (tabsRef.value) {\n observer.observe(tabsRef.value)\n }\n if (measureRef.value) {\n observer.observe(measureRef.value)\n }\n }\n measure()\n})\n\nonBeforeUnmount(() => {\n observer?.disconnect()\n if (typeof cancelAnimationFrame !== 'undefined') {\n cancelAnimationFrame(frame)\n }\n})\n</script>\n<template>\n <div v-if=\"sdks.length\">\n <div\n :id=\"headingId\"\n class=\"client-libraries-heading\">\n Client Libraries\n </div>\n\n <!-- Tabs -->\n <div class=\"client-libraries-content\">\n <div\n ref=\"tabsRef\"\n :aria-labelledby=\"headingId\"\n class=\"client-libraries-row\"\n role=\"tablist\">\n <button\n v-for=\"(sdk, index) in visibleSdks\"\n :id=\"`${baseId}-tab-${index}`\"\n :key=\"index\"\n :aria-controls=\"panelId\"\n :aria-selected=\"index === selectedIndex\"\n class=\"client-libraries\"\n :class=\"{ 'client-libraries__active': index === selectedIndex }\"\n role=\"tab\"\n :tabindex=\"index === tabStopIndex ? 0 : -1\"\n type=\"button\"\n @click=\"select(index)\"\n @keydown=\"onTabKeydown($event, index)\">\n <ScalarIcon\n v-if=\"sdk.icon\"\n class=\"client-libraries-icon\"\n :icon=\"sdk.icon\" />\n <span class=\"client-libraries-text\">{{ sdk.lang }}</span>\n </button>\n\n <!-- More dropdown -->\n <ScalarCombobox\n v-if=\"visibleCount < sdks.length\"\n :modelValue=\"selectedMoreOption\"\n :options=\"moreOptions\"\n placement=\"bottom-end\"\n teleport\n @update:modelValue=\"selectMore\">\n <button\n class=\"client-libraries client-libraries-more\"\n :class=\"{ 'client-libraries__active': isMoreActive }\"\n type=\"button\">\n <ScalarIcon\n class=\"client-libraries-icon\"\n :icon=\"\n isMoreActive && selected?.icon ? selected.icon : 'Ellipses'\n \" />\n <span class=\"client-libraries-text\">More</span>\n </button>\n </ScalarCombobox>\n </div>\n\n <!-- Hidden row used to measure the natural width of every tab. It is\n clipped to a zero-size box so it never contributes to the scrollable\n width of the (horizontally scrollable) row above. -->\n <div\n aria-hidden=\"true\"\n class=\"client-libraries-measure-clip\">\n <div\n ref=\"measureRef\"\n class=\"client-libraries-row client-libraries-row--measure\">\n <span\n v-for=\"(sdk, index) in sdks\"\n :key=\"index\"\n class=\"client-libraries\">\n <ScalarIcon\n v-if=\"sdk.icon\"\n class=\"client-libraries-icon\"\n :icon=\"sdk.icon\" />\n <span class=\"client-libraries-text\">{{ sdk.lang }}</span>\n </span>\n <span class=\"client-libraries\">\n <ScalarIcon\n class=\"client-libraries-icon\"\n icon=\"Ellipses\" />\n <span class=\"client-libraries-text\">More</span>\n </span>\n </div>\n </div>\n </div>\n\n <!-- Content: Markdown installation instructions (supports code blocks) -->\n <div\n v-if=\"selected?.description\"\n :id=\"panelId\"\n :aria-labelledby=\"activeTabId\"\n class=\"selected-client\"\n role=\"tabpanel\"\n tabindex=\"0\">\n <ScalarMarkdown :value=\"selected.description\" />\n </div>\n </div>\n</template>\n<style scoped>\n/* One panel holds the Markdown installation instructions */\n.selected-client {\n display: flex;\n flex-direction: column;\n gap: 9px;\n color: var(--scalar-color-1);\n font-size: var(--scalar-small);\n padding: 9px 12px;\n background: var(--scalar-background-1);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-top: none;\n border-bottom-left-radius: var(--scalar-radius-xl);\n border-bottom-right-radius: var(--scalar-radius-xl);\n}\n.client-libraries-heading {\n font-size: var(--scalar-small);\n font-weight: var(--scalar-font-medium);\n color: var(--scalar-color-1);\n padding: 9px 12px;\n background-color: var(--scalar-background-2);\n display: flex;\n align-items: center;\n max-height: 32px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-top-left-radius: var(--scalar-radius-xl);\n border-top-right-radius: var(--scalar-radius-xl);\n}\n.client-libraries-content {\n position: relative;\n /*\n * Scroll horizontally rather than clip: before JS measures the tab widths\n * (and without JS at all) every tab is rendered, so overflowing tabs must\n * stay reachable. Once measured, the \"More\" dropdown absorbs the overflow and\n * no scrollbar is shown. The bar itself is hidden — keyboard focus and touch\n * still scroll clipped tabs into view.\n */\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n padding: 0 12px;\n background-color: var(--scalar-background-1);\n border-left: var(--scalar-border-width) solid var(--scalar-border-color);\n border-right: var(--scalar-border-width) solid var(--scalar-border-color);\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.client-libraries-content::-webkit-scrollbar {\n display: none;\n}\n.client-libraries-row {\n display: flex;\n justify-content: flex-start;\n}\n/* Zero-size clip so the measure row never adds to the scrollable width */\n.client-libraries-measure-clip {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n overflow: hidden;\n}\n/* Off-screen row used only to measure natural tab widths */\n.client-libraries-row--measure {\n width: max-content;\n visibility: hidden;\n pointer-events: none;\n}\n.client-libraries {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n cursor: pointer;\n white-space: nowrap;\n /* Keep tabs at their natural (measured) width so they scroll rather than squish */\n flex-shrink: 0;\n padding: 8px 12px;\n gap: 6px;\n color: var(--scalar-color-3);\n border-bottom: 1px solid transparent;\n background: transparent;\n user-select: none;\n}\n.client-libraries:not(.client-libraries__active):hover:before {\n content: '';\n position: absolute;\n width: calc(100% - 4px);\n height: calc(100% - 4px);\n background: var(--scalar-background-2);\n left: 2px;\n top: 2px;\n z-index: 0;\n border-radius: var(--scalar-radius);\n}\n.client-libraries:active {\n color: var(--scalar-color-1);\n}\n.client-libraries:focus-visible {\n outline: none;\n box-shadow: inset 0 0 0 1px var(--scalar-color-accent);\n}\n.client-libraries__active {\n color: var(--scalar-color-1);\n border-bottom: 1px solid var(--scalar-color-1);\n}\n/* Always pin the \"More\" dropdown to the right edge */\n.client-libraries-more {\n margin-left: auto;\n}\n.client-libraries-icon {\n max-width: 14px;\n max-height: 14px;\n min-width: 14px;\n width: 100%;\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n box-sizing: border-box;\n color: currentColor;\n}\n.client-libraries .client-libraries-text {\n font-size: var(--scalar-small);\n position: relative;\n display: flex;\n align-items: center;\n}\n.client-libraries__active .client-libraries-text {\n color: var(--scalar-color-1);\n font-weight: var(--scalar-semibold);\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"SdkInstallationInstructions.vue.js","names":[],"sources":["../../../../src/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getCustomClientIds } from '@scalar/blocks/code-example'\nimport {\n ScalarCombobox,\n type ScalarComboboxOption,\n} from '@scalar/components/combobox'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarSdkInstallation } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-sdk-installation'\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n useId,\n watch,\n} from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nimport { getLanguageIcon } from '../helpers/language-icon'\nimport { getRenderableSdks } from '../helpers/renderable-sdks'\nimport { getVisibleTabCount } from '../helpers/visible-tab-count'\n\nconst { xScalarSdkInstallation, selectedClient, eventBus } = defineProps<{\n /** Custom SDK installation instructions from `x-scalar-sdk-installation` */\n xScalarSdkInstallation?: XScalarSdkInstallation['x-scalar-sdk-installation']\n /**\n * The globally selected client id. When it matches one of the SDK languages\n * (as a `custom/<lang>` id) the matching tab is shown as active, keeping the\n * tabs in sync with the operation code samples.\n */\n selectedClient?: string\n /**\n * Event bus used to broadcast the selected client. Picking a language here\n * switches the operation code samples to that language's custom example, the\n * same channel the generic client selector uses.\n */\n eventBus?: WorkspaceEventBus\n}>()\n\nconst headingId = useId()\n/** Base id used to associate each tab with the shared panel for assistive tech */\nconst baseId = useId()\nconst panelId = `${baseId}-panel`\nconst { translate } = useLocalization()\n\n/** Only the SDKs that actually have something to show, with their resolved icon */\nconst sdks = computed(() =>\n getRenderableSdks(xScalarSdkInstallation).map((sdk) => ({\n ...sdk,\n icon: getLanguageIcon(sdk.lang),\n })),\n)\n\n/** Index of the currently selected SDK */\nconst selectedIndex = ref(0)\n\n/** The currently selected SDK */\nconst selected = computed(() => sdks.value[selectedIndex.value])\n\n/**\n * The `custom/<lang>` client id for each SDK, aligned by index with `sdks`.\n *\n * We reuse the exact id scheme the operation code samples use for their custom\n * examples, so selecting a language here resolves to the same id those samples\n * are keyed by — that shared id is what keeps the two surfaces in sync.\n */\nconst sdkClientIds = computed(() =>\n getCustomClientIds(sdks.value.map((sdk) => ({ lang: sdk.lang, source: '' }))),\n)\n\n/** Select an SDK by index and broadcast it so the operation code samples follow */\nconst select = (index: number) => {\n selectedIndex.value = index\n\n const id = sdkClientIds.value[index]\n if (id) {\n eventBus?.emit('workspace:update:selected-client', id)\n }\n}\n\n// Keep the active tab aligned with the global selection, re-evaluating whenever\n// either the selection or the available SDKs change. Watching `sdkClientIds`\n// (not just `selectedClient`) is what stops the intro tab and the operation\n// samples from disagreeing after the SDK list is reordered or resized: the tab\n// follows the selected language to its new position. When the selection is a\n// built-in client (or a language this document has no install entry for) we keep\n// the current tab, only clamping it back into range if the list shrank past it.\nwatch(\n [() => selectedClient, sdkClientIds],\n ([client, ids]) => {\n const matched = client ? ids.findIndex((id) => id === client) : -1\n\n if (matched >= 0) {\n selectedIndex.value = matched\n } else if (selectedIndex.value > ids.length - 1) {\n selectedIndex.value = 0\n }\n },\n { immediate: true },\n)\n\n// Re-measure whenever the set of SDKs changes. Keying on the languages (not just\n// the count) also catches documents that swap in a different set of the same\n// size, which would otherwise leave the cached tab widths — and the \"More\"\n// overflow logic — stale.\nwatch(\n () => sdks.value.map((sdk) => sdk.lang).join('\\n'),\n () => void nextTick(measure),\n)\n\nconst tabsRef = ref<HTMLElement>()\nconst measureRef = ref<HTMLElement>()\n\n/** The width available to render the tabs in */\nconst availableWidth = ref(0)\n/** The natural width of each tab */\nconst tabWidths = ref<number[]>([])\n/** The width of the \"More\" dropdown trigger */\nconst moreWidth = ref(0)\n\n/** Measure the available width and the natural width of each tab */\nconst measure = () => {\n const measureEl = measureRef.value\n const tabsEl = tabsRef.value\n\n if (!measureEl || !tabsEl) {\n return\n }\n\n // The measuring row renders every tab followed by the \"More\" trigger\n const widths = Array.from(measureEl.children).map(\n (child) => (child as HTMLElement).offsetWidth,\n )\n\n tabWidths.value = widths.slice(0, sdks.value.length)\n moreWidth.value = widths[sdks.value.length] ?? 0\n availableWidth.value = tabsEl.clientWidth\n}\n\n/** How many tabs fit inline before we need the \"More\" dropdown */\nconst visibleCount = computed(() => {\n // Until we have measured, render everything (also the server-rendered state)\n if (!tabWidths.value.length || availableWidth.value <= 0) {\n return sdks.value.length\n }\n\n return getVisibleTabCount(\n tabWidths.value,\n availableWidth.value,\n moreWidth.value,\n )\n})\n\n/** The SDKs shown as inline tabs */\nconst visibleSdks = computed(() => sdks.value.slice(0, visibleCount.value))\n\n/** Whether the selected SDK lives in the \"More\" dropdown */\nconst isMoreActive = computed(() => selectedIndex.value >= visibleCount.value)\n\n/** The overflowing SDKs as combobox options, keyed by their original index */\nconst moreOptions = computed<ScalarComboboxOption[]>(() =>\n sdks.value.slice(visibleCount.value).map((sdk, index) => ({\n id: String(visibleCount.value + index),\n label: sdk.lang,\n })),\n)\n\n/** The selected option within the \"More\" dropdown, if any */\nconst selectedMoreOption = computed(() =>\n moreOptions.value.find((option) => option.id === String(selectedIndex.value)),\n)\n\nconst selectMore = (option: ScalarComboboxOption | undefined) => {\n if (option) {\n select(Number(option.id))\n }\n}\n\n/** The id of the tab that labels the panel (falls back to the heading when the selection lives in \"More\") */\nconst activeTabId = computed(() =>\n isMoreActive.value ? headingId : `${baseId}-tab-${selectedIndex.value}`,\n)\n\n/**\n * The visible tab that holds the roving tabindex. When the selection lives in\n * the \"More\" dropdown, that trigger is the tab stop instead, so no inline tab\n * should be focusable.\n */\nconst tabStopIndex = computed(() =>\n isMoreActive.value ? -1 : selectedIndex.value,\n)\n\n/** Focus a visible tab by index after the DOM has settled */\nconst focusTab = (index: number) => {\n void nextTick(() => {\n tabsRef.value\n ?.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]')\n [index]?.focus()\n })\n}\n\n/** Arrow / Home / End keyboard navigation across the visible tabs (WAI-ARIA tabs pattern) */\nconst onTabKeydown = (event: KeyboardEvent, index: number) => {\n const lastVisible = visibleCount.value - 1\n\n let next = index\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n next = index >= lastVisible ? 0 : index + 1\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n next = index <= 0 ? lastVisible : index - 1\n break\n case 'Home':\n next = 0\n break\n case 'End':\n next = lastVisible\n break\n default:\n return\n }\n\n event.preventDefault()\n select(next)\n focusTab(next)\n}\n\nlet observer: ResizeObserver | undefined\nlet frame = 0\n\n/** Coalesce resize bursts into a single measure before the next paint */\nconst scheduleMeasure = () => {\n if (typeof requestAnimationFrame === 'undefined') {\n measure()\n return\n }\n cancelAnimationFrame(frame)\n frame = requestAnimationFrame(measure)\n}\n\nonMounted(() => {\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(scheduleMeasure)\n // Observe the visible row for the available width, and the hidden measure\n // row for the natural tab widths. The latter catches changes the container\n // never sees — web fonts loading, or labels changing without the count\n // changing — which would otherwise leave the overflow logic stale.\n if (tabsRef.value) {\n observer.observe(tabsRef.value)\n }\n if (measureRef.value) {\n observer.observe(measureRef.value)\n }\n }\n measure()\n})\n\nonBeforeUnmount(() => {\n observer?.disconnect()\n if (typeof cancelAnimationFrame !== 'undefined') {\n cancelAnimationFrame(frame)\n }\n})\n</script>\n<template>\n <div v-if=\"sdks.length\">\n <div\n :id=\"headingId\"\n class=\"client-libraries-heading\">\n {{ translate('clientLibraries.heading') }}\n </div>\n\n <!-- Tabs -->\n <div class=\"client-libraries-content\">\n <div\n ref=\"tabsRef\"\n :aria-labelledby=\"headingId\"\n class=\"client-libraries-row\"\n role=\"tablist\">\n <button\n v-for=\"(sdk, index) in visibleSdks\"\n :id=\"`${baseId}-tab-${index}`\"\n :key=\"index\"\n :aria-controls=\"panelId\"\n :aria-selected=\"index === selectedIndex\"\n class=\"client-libraries\"\n :class=\"{ 'client-libraries__active': index === selectedIndex }\"\n role=\"tab\"\n :tabindex=\"index === tabStopIndex ? 0 : -1\"\n type=\"button\"\n @click=\"select(index)\"\n @keydown=\"onTabKeydown($event, index)\">\n <ScalarIcon\n v-if=\"sdk.icon\"\n class=\"client-libraries-icon\"\n :icon=\"sdk.icon\" />\n <span class=\"client-libraries-text\">{{ sdk.lang }}</span>\n </button>\n\n <!-- More dropdown -->\n <ScalarCombobox\n v-if=\"visibleCount < sdks.length\"\n :modelValue=\"selectedMoreOption\"\n :options=\"moreOptions\"\n placement=\"bottom-end\"\n teleport\n @update:modelValue=\"selectMore\">\n <button\n class=\"client-libraries client-libraries-more\"\n :class=\"{ 'client-libraries__active': isMoreActive }\"\n type=\"button\">\n <ScalarIcon\n class=\"client-libraries-icon\"\n :icon=\"\n isMoreActive && selected?.icon ? selected.icon : 'Ellipses'\n \" />\n <span class=\"client-libraries-text\">\n {{ translate('clientLibraries.more') }}\n </span>\n </button>\n </ScalarCombobox>\n </div>\n\n <!-- Hidden row used to measure the natural width of every tab. It is\n clipped to a zero-size box so it never contributes to the scrollable\n width of the (horizontally scrollable) row above. -->\n <div\n aria-hidden=\"true\"\n class=\"client-libraries-measure-clip\">\n <div\n ref=\"measureRef\"\n class=\"client-libraries-row client-libraries-row--measure\">\n <span\n v-for=\"(sdk, index) in sdks\"\n :key=\"index\"\n class=\"client-libraries\">\n <ScalarIcon\n v-if=\"sdk.icon\"\n class=\"client-libraries-icon\"\n :icon=\"sdk.icon\" />\n <span class=\"client-libraries-text\">{{ sdk.lang }}</span>\n </span>\n <span class=\"client-libraries\">\n <ScalarIcon\n class=\"client-libraries-icon\"\n icon=\"Ellipses\" />\n <span class=\"client-libraries-text\">\n {{ translate('clientLibraries.more') }}\n </span>\n </span>\n </div>\n </div>\n </div>\n\n <!-- Content: Markdown installation instructions (supports code blocks) -->\n <div\n v-if=\"selected?.description\"\n :id=\"panelId\"\n :aria-labelledby=\"activeTabId\"\n class=\"selected-client\"\n role=\"tabpanel\"\n tabindex=\"0\">\n <ScalarMarkdown :value=\"selected.description\" />\n </div>\n </div>\n</template>\n<style scoped>\n/* One panel holds the Markdown installation instructions */\n.selected-client {\n display: flex;\n flex-direction: column;\n gap: 9px;\n color: var(--scalar-color-1);\n font-size: var(--scalar-small);\n padding: 9px 12px;\n background: var(--scalar-background-1);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-top: none;\n border-bottom-left-radius: var(--scalar-radius-xl);\n border-bottom-right-radius: var(--scalar-radius-xl);\n}\n.client-libraries-heading {\n font-size: var(--scalar-small);\n font-weight: var(--scalar-font-medium);\n color: var(--scalar-color-1);\n padding: 9px 12px;\n background-color: var(--scalar-background-2);\n display: flex;\n align-items: center;\n max-height: 32px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-top-left-radius: var(--scalar-radius-xl);\n border-top-right-radius: var(--scalar-radius-xl);\n}\n.client-libraries-content {\n position: relative;\n /*\n * Scroll horizontally rather than clip: before JS measures the tab widths\n * (and without JS at all) every tab is rendered, so overflowing tabs must\n * stay reachable. Once measured, the \"More\" dropdown absorbs the overflow and\n * no scrollbar is shown. The bar itself is hidden — keyboard focus and touch\n * still scroll clipped tabs into view.\n */\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n padding: 0 12px;\n background-color: var(--scalar-background-1);\n border-left: var(--scalar-border-width) solid var(--scalar-border-color);\n border-right: var(--scalar-border-width) solid var(--scalar-border-color);\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.client-libraries-content::-webkit-scrollbar {\n display: none;\n}\n.client-libraries-row {\n display: flex;\n justify-content: flex-start;\n}\n/* Zero-size clip so the measure row never adds to the scrollable width */\n.client-libraries-measure-clip {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n overflow: hidden;\n}\n/* Off-screen row used only to measure natural tab widths */\n.client-libraries-row--measure {\n width: max-content;\n visibility: hidden;\n pointer-events: none;\n}\n.client-libraries {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n cursor: pointer;\n white-space: nowrap;\n /* Keep tabs at their natural (measured) width so they scroll rather than squish */\n flex-shrink: 0;\n padding: 8px 12px;\n gap: 6px;\n color: var(--scalar-color-3);\n border-bottom: 1px solid transparent;\n background: transparent;\n user-select: none;\n}\n.client-libraries:not(.client-libraries__active):hover:before {\n content: '';\n position: absolute;\n width: calc(100% - 4px);\n height: calc(100% - 4px);\n background: var(--scalar-background-2);\n left: 2px;\n top: 2px;\n z-index: 0;\n border-radius: var(--scalar-radius);\n}\n.client-libraries:active {\n color: var(--scalar-color-1);\n}\n.client-libraries:focus-visible {\n outline: none;\n box-shadow: inset 0 0 0 1px var(--scalar-color-accent);\n}\n.client-libraries__active {\n color: var(--scalar-color-1);\n border-bottom: 1px solid var(--scalar-color-1);\n}\n/* Always pin the \"More\" dropdown to the right edge */\n.client-libraries-more {\n margin-left: auto;\n}\n.client-libraries-icon {\n max-width: 14px;\n max-height: 14px;\n min-width: 14px;\n width: 100%;\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n box-sizing: border-box;\n color: currentColor;\n}\n.client-libraries .client-libraries-text {\n font-size: var(--scalar-small);\n position: relative;\n display: flex;\n align-items: center;\n}\n.client-libraries__active .client-libraries-text {\n color: var(--scalar-color-1);\n font-weight: var(--scalar-semibold);\n}\n</style>\n"],"mappings":""}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { useLocalization } from "../../../features/localization/use-localization.js";
|
|
1
2
|
import { getLanguageIcon } from "../helpers/language-icon.js";
|
|
2
3
|
import { getRenderableSdks } from "../helpers/renderable-sdks.js";
|
|
3
4
|
import { getVisibleTabCount } from "../helpers/visible-tab-count.js";
|
|
4
5
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, normalizeClass, onBeforeUnmount, onMounted, openBlock, ref, renderList, toDisplayString, unref, useId, watch, withCtx } from "vue";
|
|
5
|
-
import { getCustomClientIds } from "@scalar/
|
|
6
|
+
import { getCustomClientIds } from "@scalar/blocks/code-example";
|
|
6
7
|
import { ScalarMarkdown } from "@scalar/components/markdown";
|
|
7
8
|
import { ScalarCombobox } from "@scalar/components/combobox";
|
|
8
9
|
import { ScalarIcon } from "@scalar/components/icon";
|
|
@@ -19,13 +20,15 @@ var _hoisted_5 = [
|
|
|
19
20
|
"onKeydown"
|
|
20
21
|
];
|
|
21
22
|
var _hoisted_6 = { class: "client-libraries-text" };
|
|
22
|
-
var _hoisted_7 = {
|
|
23
|
+
var _hoisted_7 = { class: "client-libraries-text" };
|
|
24
|
+
var _hoisted_8 = {
|
|
23
25
|
"aria-hidden": "true",
|
|
24
26
|
class: "client-libraries-measure-clip"
|
|
25
27
|
};
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
28
|
+
var _hoisted_9 = { class: "client-libraries-text" };
|
|
29
|
+
var _hoisted_10 = { class: "client-libraries" };
|
|
30
|
+
var _hoisted_11 = { class: "client-libraries-text" };
|
|
31
|
+
var _hoisted_12 = ["aria-labelledby"];
|
|
29
32
|
var SdkInstallationInstructions_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
30
33
|
__name: "SdkInstallationInstructions",
|
|
31
34
|
props: {
|
|
@@ -38,6 +41,7 @@ var SdkInstallationInstructions_vue_vue_type_script_setup_true_lang_default = /*
|
|
|
38
41
|
/** Base id used to associate each tab with the shared panel for assistive tech */
|
|
39
42
|
const baseId = useId();
|
|
40
43
|
const panelId = `${baseId}-panel`;
|
|
44
|
+
const { translate } = useLocalization();
|
|
41
45
|
/** Only the SDKs that actually have something to show, with their resolved icon */
|
|
42
46
|
const sdks = computed(() => getRenderableSdks(__props.xScalarSdkInstallation).map((sdk) => ({
|
|
43
47
|
...sdk,
|
|
@@ -174,7 +178,7 @@ var SdkInstallationInstructions_vue_vue_type_script_setup_true_lang_default = /*
|
|
|
174
178
|
createElementVNode("div", {
|
|
175
179
|
id: unref(headingId),
|
|
176
180
|
class: "client-libraries-heading"
|
|
177
|
-
}, "
|
|
181
|
+
}, toDisplayString(unref(translate)("clientLibraries.heading")), 9, _hoisted_2),
|
|
178
182
|
createElementVNode("div", _hoisted_3, [createElementVNode("div", {
|
|
179
183
|
ref_key: "tabsRef",
|
|
180
184
|
ref: tabsRef,
|
|
@@ -212,9 +216,9 @@ var SdkInstallationInstructions_vue_vue_type_script_setup_true_lang_default = /*
|
|
|
212
216
|
}, [createVNode(unref(ScalarIcon), {
|
|
213
217
|
class: "client-libraries-icon",
|
|
214
218
|
icon: isMoreActive.value && selected.value?.icon ? selected.value.icon : "Ellipses"
|
|
215
|
-
}, null, 8, ["icon"]),
|
|
219
|
+
}, null, 8, ["icon"]), createElementVNode("span", _hoisted_7, toDisplayString(unref(translate)("clientLibraries.more")), 1)], 2)]),
|
|
216
220
|
_: 1
|
|
217
|
-
}, 8, ["modelValue", "options"])) : createCommentVNode("", true)], 8, _hoisted_4), createElementVNode("div",
|
|
221
|
+
}, 8, ["modelValue", "options"])) : createCommentVNode("", true)], 8, _hoisted_4), createElementVNode("div", _hoisted_8, [createElementVNode("div", {
|
|
218
222
|
ref_key: "measureRef",
|
|
219
223
|
ref: measureRef,
|
|
220
224
|
class: "client-libraries-row client-libraries-row--measure"
|
|
@@ -226,11 +230,11 @@ var SdkInstallationInstructions_vue_vue_type_script_setup_true_lang_default = /*
|
|
|
226
230
|
key: 0,
|
|
227
231
|
class: "client-libraries-icon",
|
|
228
232
|
icon: sdk.icon
|
|
229
|
-
}, null, 8, ["icon"])) : createCommentVNode("", true), createElementVNode("span",
|
|
230
|
-
}), 128)), createElementVNode("span",
|
|
233
|
+
}, null, 8, ["icon"])) : createCommentVNode("", true), createElementVNode("span", _hoisted_9, toDisplayString(sdk.lang), 1)]);
|
|
234
|
+
}), 128)), createElementVNode("span", _hoisted_10, [createVNode(unref(ScalarIcon), {
|
|
231
235
|
class: "client-libraries-icon",
|
|
232
236
|
icon: "Ellipses"
|
|
233
|
-
}),
|
|
237
|
+
}), createElementVNode("span", _hoisted_11, toDisplayString(unref(translate)("clientLibraries.more")), 1)])], 512)])]),
|
|
234
238
|
selected.value?.description ? (openBlock(), createElementBlock("div", {
|
|
235
239
|
key: 0,
|
|
236
240
|
id: panelId,
|
|
@@ -238,7 +242,7 @@ var SdkInstallationInstructions_vue_vue_type_script_setup_true_lang_default = /*
|
|
|
238
242
|
class: "selected-client",
|
|
239
243
|
role: "tabpanel",
|
|
240
244
|
tabindex: "0"
|
|
241
|
-
}, [createVNode(unref(ScalarMarkdown), { value: selected.value.description }, null, 8, ["value"])], 8,
|
|
245
|
+
}, [createVNode(unref(ScalarMarkdown), { value: selected.value.description }, null, 8, ["value"])], 8, _hoisted_12)) : createCommentVNode("", true)
|
|
242
246
|
])) : createCommentVNode("", true);
|
|
243
247
|
};
|
|
244
248
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkInstallationInstructions.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getCustomClientIds } from '@scalar/api-client/blocks/operation-code-sample'\nimport {\n ScalarCombobox,\n type ScalarComboboxOption,\n} from '@scalar/components/combobox'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarSdkInstallation } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-sdk-installation'\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n useId,\n watch,\n} from 'vue'\n\nimport { getLanguageIcon } from '../helpers/language-icon'\nimport { getRenderableSdks } from '../helpers/renderable-sdks'\nimport { getVisibleTabCount } from '../helpers/visible-tab-count'\n\nconst { xScalarSdkInstallation, selectedClient, eventBus } = defineProps<{\n /** Custom SDK installation instructions from `x-scalar-sdk-installation` */\n xScalarSdkInstallation?: XScalarSdkInstallation['x-scalar-sdk-installation']\n /**\n * The globally selected client id. When it matches one of the SDK languages\n * (as a `custom/<lang>` id) the matching tab is shown as active, keeping the\n * tabs in sync with the operation code samples.\n */\n selectedClient?: string\n /**\n * Event bus used to broadcast the selected client. Picking a language here\n * switches the operation code samples to that language's custom example, the\n * same channel the generic client selector uses.\n */\n eventBus?: WorkspaceEventBus\n}>()\n\nconst headingId = useId()\n/** Base id used to associate each tab with the shared panel for assistive tech */\nconst baseId = useId()\nconst panelId = `${baseId}-panel`\n\n/** Only the SDKs that actually have something to show, with their resolved icon */\nconst sdks = computed(() =>\n getRenderableSdks(xScalarSdkInstallation).map((sdk) => ({\n ...sdk,\n icon: getLanguageIcon(sdk.lang),\n })),\n)\n\n/** Index of the currently selected SDK */\nconst selectedIndex = ref(0)\n\n/** The currently selected SDK */\nconst selected = computed(() => sdks.value[selectedIndex.value])\n\n/**\n * The `custom/<lang>` client id for each SDK, aligned by index with `sdks`.\n *\n * We reuse the exact id scheme the operation code samples use for their custom\n * examples, so selecting a language here resolves to the same id those samples\n * are keyed by — that shared id is what keeps the two surfaces in sync.\n */\nconst sdkClientIds = computed(() =>\n getCustomClientIds(sdks.value.map((sdk) => ({ lang: sdk.lang, source: '' }))),\n)\n\n/** Select an SDK by index and broadcast it so the operation code samples follow */\nconst select = (index: number) => {\n selectedIndex.value = index\n\n const id = sdkClientIds.value[index]\n if (id) {\n eventBus?.emit('workspace:update:selected-client', id)\n }\n}\n\n// Keep the active tab aligned with the global selection, re-evaluating whenever\n// either the selection or the available SDKs change. Watching `sdkClientIds`\n// (not just `selectedClient`) is what stops the intro tab and the operation\n// samples from disagreeing after the SDK list is reordered or resized: the tab\n// follows the selected language to its new position. When the selection is a\n// built-in client (or a language this document has no install entry for) we keep\n// the current tab, only clamping it back into range if the list shrank past it.\nwatch(\n [() => selectedClient, sdkClientIds],\n ([client, ids]) => {\n const matched = client ? ids.findIndex((id) => id === client) : -1\n\n if (matched >= 0) {\n selectedIndex.value = matched\n } else if (selectedIndex.value > ids.length - 1) {\n selectedIndex.value = 0\n }\n },\n { immediate: true },\n)\n\n// Re-measure whenever the set of SDKs changes. Keying on the languages (not just\n// the count) also catches documents that swap in a different set of the same\n// size, which would otherwise leave the cached tab widths — and the \"More\"\n// overflow logic — stale.\nwatch(\n () => sdks.value.map((sdk) => sdk.lang).join('\\n'),\n () => void nextTick(measure),\n)\n\nconst tabsRef = ref<HTMLElement>()\nconst measureRef = ref<HTMLElement>()\n\n/** The width available to render the tabs in */\nconst availableWidth = ref(0)\n/** The natural width of each tab */\nconst tabWidths = ref<number[]>([])\n/** The width of the \"More\" dropdown trigger */\nconst moreWidth = ref(0)\n\n/** Measure the available width and the natural width of each tab */\nconst measure = () => {\n const measureEl = measureRef.value\n const tabsEl = tabsRef.value\n\n if (!measureEl || !tabsEl) {\n return\n }\n\n // The measuring row renders every tab followed by the \"More\" trigger\n const widths = Array.from(measureEl.children).map(\n (child) => (child as HTMLElement).offsetWidth,\n )\n\n tabWidths.value = widths.slice(0, sdks.value.length)\n moreWidth.value = widths[sdks.value.length] ?? 0\n availableWidth.value = tabsEl.clientWidth\n}\n\n/** How many tabs fit inline before we need the \"More\" dropdown */\nconst visibleCount = computed(() => {\n // Until we have measured, render everything (also the server-rendered state)\n if (!tabWidths.value.length || availableWidth.value <= 0) {\n return sdks.value.length\n }\n\n return getVisibleTabCount(\n tabWidths.value,\n availableWidth.value,\n moreWidth.value,\n )\n})\n\n/** The SDKs shown as inline tabs */\nconst visibleSdks = computed(() => sdks.value.slice(0, visibleCount.value))\n\n/** Whether the selected SDK lives in the \"More\" dropdown */\nconst isMoreActive = computed(() => selectedIndex.value >= visibleCount.value)\n\n/** The overflowing SDKs as combobox options, keyed by their original index */\nconst moreOptions = computed<ScalarComboboxOption[]>(() =>\n sdks.value.slice(visibleCount.value).map((sdk, index) => ({\n id: String(visibleCount.value + index),\n label: sdk.lang,\n })),\n)\n\n/** The selected option within the \"More\" dropdown, if any */\nconst selectedMoreOption = computed(() =>\n moreOptions.value.find((option) => option.id === String(selectedIndex.value)),\n)\n\nconst selectMore = (option: ScalarComboboxOption | undefined) => {\n if (option) {\n select(Number(option.id))\n }\n}\n\n/** The id of the tab that labels the panel (falls back to the heading when the selection lives in \"More\") */\nconst activeTabId = computed(() =>\n isMoreActive.value ? headingId : `${baseId}-tab-${selectedIndex.value}`,\n)\n\n/**\n * The visible tab that holds the roving tabindex. When the selection lives in\n * the \"More\" dropdown, that trigger is the tab stop instead, so no inline tab\n * should be focusable.\n */\nconst tabStopIndex = computed(() =>\n isMoreActive.value ? -1 : selectedIndex.value,\n)\n\n/** Focus a visible tab by index after the DOM has settled */\nconst focusTab = (index: number) => {\n void nextTick(() => {\n tabsRef.value\n ?.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]')\n [index]?.focus()\n })\n}\n\n/** Arrow / Home / End keyboard navigation across the visible tabs (WAI-ARIA tabs pattern) */\nconst onTabKeydown = (event: KeyboardEvent, index: number) => {\n const lastVisible = visibleCount.value - 1\n\n let next = index\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n next = index >= lastVisible ? 0 : index + 1\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n next = index <= 0 ? lastVisible : index - 1\n break\n case 'Home':\n next = 0\n break\n case 'End':\n next = lastVisible\n break\n default:\n return\n }\n\n event.preventDefault()\n select(next)\n focusTab(next)\n}\n\nlet observer: ResizeObserver | undefined\nlet frame = 0\n\n/** Coalesce resize bursts into a single measure before the next paint */\nconst scheduleMeasure = () => {\n if (typeof requestAnimationFrame === 'undefined') {\n measure()\n return\n }\n cancelAnimationFrame(frame)\n frame = requestAnimationFrame(measure)\n}\n\nonMounted(() => {\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(scheduleMeasure)\n // Observe the visible row for the available width, and the hidden measure\n // row for the natural tab widths. The latter catches changes the container\n // never sees — web fonts loading, or labels changing without the count\n // changing — which would otherwise leave the overflow logic stale.\n if (tabsRef.value) {\n observer.observe(tabsRef.value)\n }\n if (measureRef.value) {\n observer.observe(measureRef.value)\n }\n }\n measure()\n})\n\nonBeforeUnmount(() => {\n observer?.disconnect()\n if (typeof cancelAnimationFrame !== 'undefined') {\n cancelAnimationFrame(frame)\n }\n})\n</script>\n<template>\n <div v-if=\"sdks.length\">\n <div\n :id=\"headingId\"\n class=\"client-libraries-heading\">\n Client Libraries\n </div>\n\n <!-- Tabs -->\n <div class=\"client-libraries-content\">\n <div\n ref=\"tabsRef\"\n :aria-labelledby=\"headingId\"\n class=\"client-libraries-row\"\n role=\"tablist\">\n <button\n v-for=\"(sdk, index) in visibleSdks\"\n :id=\"`${baseId}-tab-${index}`\"\n :key=\"index\"\n :aria-controls=\"panelId\"\n :aria-selected=\"index === selectedIndex\"\n class=\"client-libraries\"\n :class=\"{ 'client-libraries__active': index === selectedIndex }\"\n role=\"tab\"\n :tabindex=\"index === tabStopIndex ? 0 : -1\"\n type=\"button\"\n @click=\"select(index)\"\n @keydown=\"onTabKeydown($event, index)\">\n <ScalarIcon\n v-if=\"sdk.icon\"\n class=\"client-libraries-icon\"\n :icon=\"sdk.icon\" />\n <span class=\"client-libraries-text\">{{ sdk.lang }}</span>\n </button>\n\n <!-- More dropdown -->\n <ScalarCombobox\n v-if=\"visibleCount < sdks.length\"\n :modelValue=\"selectedMoreOption\"\n :options=\"moreOptions\"\n placement=\"bottom-end\"\n teleport\n @update:modelValue=\"selectMore\">\n <button\n class=\"client-libraries client-libraries-more\"\n :class=\"{ 'client-libraries__active': isMoreActive }\"\n type=\"button\">\n <ScalarIcon\n class=\"client-libraries-icon\"\n :icon=\"\n isMoreActive && selected?.icon ? selected.icon : 'Ellipses'\n \" />\n <span class=\"client-libraries-text\">More</span>\n </button>\n </ScalarCombobox>\n </div>\n\n <!-- Hidden row used to measure the natural width of every tab. It is\n clipped to a zero-size box so it never contributes to the scrollable\n width of the (horizontally scrollable) row above. -->\n <div\n aria-hidden=\"true\"\n class=\"client-libraries-measure-clip\">\n <div\n ref=\"measureRef\"\n class=\"client-libraries-row client-libraries-row--measure\">\n <span\n v-for=\"(sdk, index) in sdks\"\n :key=\"index\"\n class=\"client-libraries\">\n <ScalarIcon\n v-if=\"sdk.icon\"\n class=\"client-libraries-icon\"\n :icon=\"sdk.icon\" />\n <span class=\"client-libraries-text\">{{ sdk.lang }}</span>\n </span>\n <span class=\"client-libraries\">\n <ScalarIcon\n class=\"client-libraries-icon\"\n icon=\"Ellipses\" />\n <span class=\"client-libraries-text\">More</span>\n </span>\n </div>\n </div>\n </div>\n\n <!-- Content: Markdown installation instructions (supports code blocks) -->\n <div\n v-if=\"selected?.description\"\n :id=\"panelId\"\n :aria-labelledby=\"activeTabId\"\n class=\"selected-client\"\n role=\"tabpanel\"\n tabindex=\"0\">\n <ScalarMarkdown :value=\"selected.description\" />\n </div>\n </div>\n</template>\n<style scoped>\n/* One panel holds the Markdown installation instructions */\n.selected-client {\n display: flex;\n flex-direction: column;\n gap: 9px;\n color: var(--scalar-color-1);\n font-size: var(--scalar-small);\n padding: 9px 12px;\n background: var(--scalar-background-1);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-top: none;\n border-bottom-left-radius: var(--scalar-radius-xl);\n border-bottom-right-radius: var(--scalar-radius-xl);\n}\n.client-libraries-heading {\n font-size: var(--scalar-small);\n font-weight: var(--scalar-font-medium);\n color: var(--scalar-color-1);\n padding: 9px 12px;\n background-color: var(--scalar-background-2);\n display: flex;\n align-items: center;\n max-height: 32px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-top-left-radius: var(--scalar-radius-xl);\n border-top-right-radius: var(--scalar-radius-xl);\n}\n.client-libraries-content {\n position: relative;\n /*\n * Scroll horizontally rather than clip: before JS measures the tab widths\n * (and without JS at all) every tab is rendered, so overflowing tabs must\n * stay reachable. Once measured, the \"More\" dropdown absorbs the overflow and\n * no scrollbar is shown. The bar itself is hidden — keyboard focus and touch\n * still scroll clipped tabs into view.\n */\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n padding: 0 12px;\n background-color: var(--scalar-background-1);\n border-left: var(--scalar-border-width) solid var(--scalar-border-color);\n border-right: var(--scalar-border-width) solid var(--scalar-border-color);\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.client-libraries-content::-webkit-scrollbar {\n display: none;\n}\n.client-libraries-row {\n display: flex;\n justify-content: flex-start;\n}\n/* Zero-size clip so the measure row never adds to the scrollable width */\n.client-libraries-measure-clip {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n overflow: hidden;\n}\n/* Off-screen row used only to measure natural tab widths */\n.client-libraries-row--measure {\n width: max-content;\n visibility: hidden;\n pointer-events: none;\n}\n.client-libraries {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n cursor: pointer;\n white-space: nowrap;\n /* Keep tabs at their natural (measured) width so they scroll rather than squish */\n flex-shrink: 0;\n padding: 8px 12px;\n gap: 6px;\n color: var(--scalar-color-3);\n border-bottom: 1px solid transparent;\n background: transparent;\n user-select: none;\n}\n.client-libraries:not(.client-libraries__active):hover:before {\n content: '';\n position: absolute;\n width: calc(100% - 4px);\n height: calc(100% - 4px);\n background: var(--scalar-background-2);\n left: 2px;\n top: 2px;\n z-index: 0;\n border-radius: var(--scalar-radius);\n}\n.client-libraries:active {\n color: var(--scalar-color-1);\n}\n.client-libraries:focus-visible {\n outline: none;\n box-shadow: inset 0 0 0 1px var(--scalar-color-accent);\n}\n.client-libraries__active {\n color: var(--scalar-color-1);\n border-bottom: 1px solid var(--scalar-color-1);\n}\n/* Always pin the \"More\" dropdown to the right edge */\n.client-libraries-more {\n margin-left: auto;\n}\n.client-libraries-icon {\n max-width: 14px;\n max-height: 14px;\n min-width: 14px;\n width: 100%;\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n box-sizing: border-box;\n color: currentColor;\n}\n.client-libraries .client-libraries-text {\n font-size: var(--scalar-small);\n position: relative;\n display: flex;\n align-items: center;\n}\n.client-libraries__active .client-libraries-text {\n color: var(--scalar-color-1);\n font-weight: var(--scalar-semibold);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,YAAY,OAAM;;EAExB,MAAM,SAAS,OAAM;EACrB,MAAM,UAAU,GAAG,OAAO;;EAG1B,MAAM,OAAO,eACX,kBAAkB,QAAA,uBAAuB,CAAC,KAAK,SAAS;GACtD,GAAG;GACH,MAAM,gBAAgB,IAAI,KAAK;GAChC,EAAE,CACL;;EAGA,MAAM,gBAAgB,IAAI,EAAC;;EAG3B,MAAM,WAAW,eAAe,KAAK,MAAM,cAAc,OAAM;;;;;;;;EAS/D,MAAM,eAAe,eACnB,mBAAmB,KAAK,MAAM,KAAK,SAAS;GAAE,MAAM,IAAI;GAAM,QAAQ;GAAI,EAAE,CAAC,CAC/E;;EAGA,MAAM,UAAU,UAAkB;AACh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AAA,OAAU,OAAO,SAAA,MAAS,OAAI;sDAGxE,mBAA+C,QAAA,EAAzC,OAAM,yBAAuB,EAAC,QAAI,GAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;uFAQ9C,mBAuBM,OAvBN,YAuBM,CApBJ,mBAmBM,OAAA;cAlBA;KAAJ,KAAI;KACJ,OAAM;0BACN,mBASO,UAAA,MAAA,WARkB,KAAA,QAAf,KAAK,UAAK;yBADpB,mBASO,QAAA;MAPJ,KAAK;MACN,OAAM;SAEE,IAAI,QAAA,WAAA,EADZ,YAGqB,MAAA,WAAA,EAAA;;MADnB,OAAM;MACL,MAAM,IAAI;4DACb,mBAAyD,QAAzD,YAAyD,gBAAlB,IAAI,KAAI,EAAA,EAAA,CAAA,CAAA;eAEjD,mBAKO,QALP,YAKO,CAJL,YAEoB,MAAA,WAAA,EAAA;KADlB,OAAM;KACN,MAAK;kCACP,mBAA+C,QAAA,EAAzC,OAAM,yBAAuB,EAAC,QAAI,GAAA,EAAA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;IAQxC,SAAA,OAAU,eAAA,WAAA,EADlB,mBAQM,OAAA;;KANH,IAAI;KACJ,mBAAiB,YAAA;KAClB,OAAM;KACN,MAAK;KACL,UAAS;QACT,YAAgD,MAAA,eAAA,EAAA,EAA/B,OAAO,SAAA,MAAS,aAAA,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA,CAAA,EAAA,GAAA,YAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"SdkInstallationInstructions.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getCustomClientIds } from '@scalar/blocks/code-example'\nimport {\n ScalarCombobox,\n type ScalarComboboxOption,\n} from '@scalar/components/combobox'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { type WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarSdkInstallation } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-sdk-installation'\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n useId,\n watch,\n} from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nimport { getLanguageIcon } from '../helpers/language-icon'\nimport { getRenderableSdks } from '../helpers/renderable-sdks'\nimport { getVisibleTabCount } from '../helpers/visible-tab-count'\n\nconst { xScalarSdkInstallation, selectedClient, eventBus } = defineProps<{\n /** Custom SDK installation instructions from `x-scalar-sdk-installation` */\n xScalarSdkInstallation?: XScalarSdkInstallation['x-scalar-sdk-installation']\n /**\n * The globally selected client id. When it matches one of the SDK languages\n * (as a `custom/<lang>` id) the matching tab is shown as active, keeping the\n * tabs in sync with the operation code samples.\n */\n selectedClient?: string\n /**\n * Event bus used to broadcast the selected client. Picking a language here\n * switches the operation code samples to that language's custom example, the\n * same channel the generic client selector uses.\n */\n eventBus?: WorkspaceEventBus\n}>()\n\nconst headingId = useId()\n/** Base id used to associate each tab with the shared panel for assistive tech */\nconst baseId = useId()\nconst panelId = `${baseId}-panel`\nconst { translate } = useLocalization()\n\n/** Only the SDKs that actually have something to show, with their resolved icon */\nconst sdks = computed(() =>\n getRenderableSdks(xScalarSdkInstallation).map((sdk) => ({\n ...sdk,\n icon: getLanguageIcon(sdk.lang),\n })),\n)\n\n/** Index of the currently selected SDK */\nconst selectedIndex = ref(0)\n\n/** The currently selected SDK */\nconst selected = computed(() => sdks.value[selectedIndex.value])\n\n/**\n * The `custom/<lang>` client id for each SDK, aligned by index with `sdks`.\n *\n * We reuse the exact id scheme the operation code samples use for their custom\n * examples, so selecting a language here resolves to the same id those samples\n * are keyed by — that shared id is what keeps the two surfaces in sync.\n */\nconst sdkClientIds = computed(() =>\n getCustomClientIds(sdks.value.map((sdk) => ({ lang: sdk.lang, source: '' }))),\n)\n\n/** Select an SDK by index and broadcast it so the operation code samples follow */\nconst select = (index: number) => {\n selectedIndex.value = index\n\n const id = sdkClientIds.value[index]\n if (id) {\n eventBus?.emit('workspace:update:selected-client', id)\n }\n}\n\n// Keep the active tab aligned with the global selection, re-evaluating whenever\n// either the selection or the available SDKs change. Watching `sdkClientIds`\n// (not just `selectedClient`) is what stops the intro tab and the operation\n// samples from disagreeing after the SDK list is reordered or resized: the tab\n// follows the selected language to its new position. When the selection is a\n// built-in client (or a language this document has no install entry for) we keep\n// the current tab, only clamping it back into range if the list shrank past it.\nwatch(\n [() => selectedClient, sdkClientIds],\n ([client, ids]) => {\n const matched = client ? ids.findIndex((id) => id === client) : -1\n\n if (matched >= 0) {\n selectedIndex.value = matched\n } else if (selectedIndex.value > ids.length - 1) {\n selectedIndex.value = 0\n }\n },\n { immediate: true },\n)\n\n// Re-measure whenever the set of SDKs changes. Keying on the languages (not just\n// the count) also catches documents that swap in a different set of the same\n// size, which would otherwise leave the cached tab widths — and the \"More\"\n// overflow logic — stale.\nwatch(\n () => sdks.value.map((sdk) => sdk.lang).join('\\n'),\n () => void nextTick(measure),\n)\n\nconst tabsRef = ref<HTMLElement>()\nconst measureRef = ref<HTMLElement>()\n\n/** The width available to render the tabs in */\nconst availableWidth = ref(0)\n/** The natural width of each tab */\nconst tabWidths = ref<number[]>([])\n/** The width of the \"More\" dropdown trigger */\nconst moreWidth = ref(0)\n\n/** Measure the available width and the natural width of each tab */\nconst measure = () => {\n const measureEl = measureRef.value\n const tabsEl = tabsRef.value\n\n if (!measureEl || !tabsEl) {\n return\n }\n\n // The measuring row renders every tab followed by the \"More\" trigger\n const widths = Array.from(measureEl.children).map(\n (child) => (child as HTMLElement).offsetWidth,\n )\n\n tabWidths.value = widths.slice(0, sdks.value.length)\n moreWidth.value = widths[sdks.value.length] ?? 0\n availableWidth.value = tabsEl.clientWidth\n}\n\n/** How many tabs fit inline before we need the \"More\" dropdown */\nconst visibleCount = computed(() => {\n // Until we have measured, render everything (also the server-rendered state)\n if (!tabWidths.value.length || availableWidth.value <= 0) {\n return sdks.value.length\n }\n\n return getVisibleTabCount(\n tabWidths.value,\n availableWidth.value,\n moreWidth.value,\n )\n})\n\n/** The SDKs shown as inline tabs */\nconst visibleSdks = computed(() => sdks.value.slice(0, visibleCount.value))\n\n/** Whether the selected SDK lives in the \"More\" dropdown */\nconst isMoreActive = computed(() => selectedIndex.value >= visibleCount.value)\n\n/** The overflowing SDKs as combobox options, keyed by their original index */\nconst moreOptions = computed<ScalarComboboxOption[]>(() =>\n sdks.value.slice(visibleCount.value).map((sdk, index) => ({\n id: String(visibleCount.value + index),\n label: sdk.lang,\n })),\n)\n\n/** The selected option within the \"More\" dropdown, if any */\nconst selectedMoreOption = computed(() =>\n moreOptions.value.find((option) => option.id === String(selectedIndex.value)),\n)\n\nconst selectMore = (option: ScalarComboboxOption | undefined) => {\n if (option) {\n select(Number(option.id))\n }\n}\n\n/** The id of the tab that labels the panel (falls back to the heading when the selection lives in \"More\") */\nconst activeTabId = computed(() =>\n isMoreActive.value ? headingId : `${baseId}-tab-${selectedIndex.value}`,\n)\n\n/**\n * The visible tab that holds the roving tabindex. When the selection lives in\n * the \"More\" dropdown, that trigger is the tab stop instead, so no inline tab\n * should be focusable.\n */\nconst tabStopIndex = computed(() =>\n isMoreActive.value ? -1 : selectedIndex.value,\n)\n\n/** Focus a visible tab by index after the DOM has settled */\nconst focusTab = (index: number) => {\n void nextTick(() => {\n tabsRef.value\n ?.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]')\n [index]?.focus()\n })\n}\n\n/** Arrow / Home / End keyboard navigation across the visible tabs (WAI-ARIA tabs pattern) */\nconst onTabKeydown = (event: KeyboardEvent, index: number) => {\n const lastVisible = visibleCount.value - 1\n\n let next = index\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n next = index >= lastVisible ? 0 : index + 1\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n next = index <= 0 ? lastVisible : index - 1\n break\n case 'Home':\n next = 0\n break\n case 'End':\n next = lastVisible\n break\n default:\n return\n }\n\n event.preventDefault()\n select(next)\n focusTab(next)\n}\n\nlet observer: ResizeObserver | undefined\nlet frame = 0\n\n/** Coalesce resize bursts into a single measure before the next paint */\nconst scheduleMeasure = () => {\n if (typeof requestAnimationFrame === 'undefined') {\n measure()\n return\n }\n cancelAnimationFrame(frame)\n frame = requestAnimationFrame(measure)\n}\n\nonMounted(() => {\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(scheduleMeasure)\n // Observe the visible row for the available width, and the hidden measure\n // row for the natural tab widths. The latter catches changes the container\n // never sees — web fonts loading, or labels changing without the count\n // changing — which would otherwise leave the overflow logic stale.\n if (tabsRef.value) {\n observer.observe(tabsRef.value)\n }\n if (measureRef.value) {\n observer.observe(measureRef.value)\n }\n }\n measure()\n})\n\nonBeforeUnmount(() => {\n observer?.disconnect()\n if (typeof cancelAnimationFrame !== 'undefined') {\n cancelAnimationFrame(frame)\n }\n})\n</script>\n<template>\n <div v-if=\"sdks.length\">\n <div\n :id=\"headingId\"\n class=\"client-libraries-heading\">\n {{ translate('clientLibraries.heading') }}\n </div>\n\n <!-- Tabs -->\n <div class=\"client-libraries-content\">\n <div\n ref=\"tabsRef\"\n :aria-labelledby=\"headingId\"\n class=\"client-libraries-row\"\n role=\"tablist\">\n <button\n v-for=\"(sdk, index) in visibleSdks\"\n :id=\"`${baseId}-tab-${index}`\"\n :key=\"index\"\n :aria-controls=\"panelId\"\n :aria-selected=\"index === selectedIndex\"\n class=\"client-libraries\"\n :class=\"{ 'client-libraries__active': index === selectedIndex }\"\n role=\"tab\"\n :tabindex=\"index === tabStopIndex ? 0 : -1\"\n type=\"button\"\n @click=\"select(index)\"\n @keydown=\"onTabKeydown($event, index)\">\n <ScalarIcon\n v-if=\"sdk.icon\"\n class=\"client-libraries-icon\"\n :icon=\"sdk.icon\" />\n <span class=\"client-libraries-text\">{{ sdk.lang }}</span>\n </button>\n\n <!-- More dropdown -->\n <ScalarCombobox\n v-if=\"visibleCount < sdks.length\"\n :modelValue=\"selectedMoreOption\"\n :options=\"moreOptions\"\n placement=\"bottom-end\"\n teleport\n @update:modelValue=\"selectMore\">\n <button\n class=\"client-libraries client-libraries-more\"\n :class=\"{ 'client-libraries__active': isMoreActive }\"\n type=\"button\">\n <ScalarIcon\n class=\"client-libraries-icon\"\n :icon=\"\n isMoreActive && selected?.icon ? selected.icon : 'Ellipses'\n \" />\n <span class=\"client-libraries-text\">\n {{ translate('clientLibraries.more') }}\n </span>\n </button>\n </ScalarCombobox>\n </div>\n\n <!-- Hidden row used to measure the natural width of every tab. It is\n clipped to a zero-size box so it never contributes to the scrollable\n width of the (horizontally scrollable) row above. -->\n <div\n aria-hidden=\"true\"\n class=\"client-libraries-measure-clip\">\n <div\n ref=\"measureRef\"\n class=\"client-libraries-row client-libraries-row--measure\">\n <span\n v-for=\"(sdk, index) in sdks\"\n :key=\"index\"\n class=\"client-libraries\">\n <ScalarIcon\n v-if=\"sdk.icon\"\n class=\"client-libraries-icon\"\n :icon=\"sdk.icon\" />\n <span class=\"client-libraries-text\">{{ sdk.lang }}</span>\n </span>\n <span class=\"client-libraries\">\n <ScalarIcon\n class=\"client-libraries-icon\"\n icon=\"Ellipses\" />\n <span class=\"client-libraries-text\">\n {{ translate('clientLibraries.more') }}\n </span>\n </span>\n </div>\n </div>\n </div>\n\n <!-- Content: Markdown installation instructions (supports code blocks) -->\n <div\n v-if=\"selected?.description\"\n :id=\"panelId\"\n :aria-labelledby=\"activeTabId\"\n class=\"selected-client\"\n role=\"tabpanel\"\n tabindex=\"0\">\n <ScalarMarkdown :value=\"selected.description\" />\n </div>\n </div>\n</template>\n<style scoped>\n/* One panel holds the Markdown installation instructions */\n.selected-client {\n display: flex;\n flex-direction: column;\n gap: 9px;\n color: var(--scalar-color-1);\n font-size: var(--scalar-small);\n padding: 9px 12px;\n background: var(--scalar-background-1);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-top: none;\n border-bottom-left-radius: var(--scalar-radius-xl);\n border-bottom-right-radius: var(--scalar-radius-xl);\n}\n.client-libraries-heading {\n font-size: var(--scalar-small);\n font-weight: var(--scalar-font-medium);\n color: var(--scalar-color-1);\n padding: 9px 12px;\n background-color: var(--scalar-background-2);\n display: flex;\n align-items: center;\n max-height: 32px;\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-top-left-radius: var(--scalar-radius-xl);\n border-top-right-radius: var(--scalar-radius-xl);\n}\n.client-libraries-content {\n position: relative;\n /*\n * Scroll horizontally rather than clip: before JS measures the tab widths\n * (and without JS at all) every tab is rendered, so overflowing tabs must\n * stay reachable. Once measured, the \"More\" dropdown absorbs the overflow and\n * no scrollbar is shown. The bar itself is hidden — keyboard focus and touch\n * still scroll clipped tabs into view.\n */\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n padding: 0 12px;\n background-color: var(--scalar-background-1);\n border-left: var(--scalar-border-width) solid var(--scalar-border-color);\n border-right: var(--scalar-border-width) solid var(--scalar-border-color);\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.client-libraries-content::-webkit-scrollbar {\n display: none;\n}\n.client-libraries-row {\n display: flex;\n justify-content: flex-start;\n}\n/* Zero-size clip so the measure row never adds to the scrollable width */\n.client-libraries-measure-clip {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n overflow: hidden;\n}\n/* Off-screen row used only to measure natural tab widths */\n.client-libraries-row--measure {\n width: max-content;\n visibility: hidden;\n pointer-events: none;\n}\n.client-libraries {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n cursor: pointer;\n white-space: nowrap;\n /* Keep tabs at their natural (measured) width so they scroll rather than squish */\n flex-shrink: 0;\n padding: 8px 12px;\n gap: 6px;\n color: var(--scalar-color-3);\n border-bottom: 1px solid transparent;\n background: transparent;\n user-select: none;\n}\n.client-libraries:not(.client-libraries__active):hover:before {\n content: '';\n position: absolute;\n width: calc(100% - 4px);\n height: calc(100% - 4px);\n background: var(--scalar-background-2);\n left: 2px;\n top: 2px;\n z-index: 0;\n border-radius: var(--scalar-radius);\n}\n.client-libraries:active {\n color: var(--scalar-color-1);\n}\n.client-libraries:focus-visible {\n outline: none;\n box-shadow: inset 0 0 0 1px var(--scalar-color-accent);\n}\n.client-libraries__active {\n color: var(--scalar-color-1);\n border-bottom: 1px solid var(--scalar-color-1);\n}\n/* Always pin the \"More\" dropdown to the right edge */\n.client-libraries-more {\n margin-left: auto;\n}\n.client-libraries-icon {\n max-width: 14px;\n max-height: 14px;\n min-width: 14px;\n width: 100%;\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n box-sizing: border-box;\n color: currentColor;\n}\n.client-libraries .client-libraries-text {\n font-size: var(--scalar-small);\n position: relative;\n display: flex;\n align-items: center;\n}\n.client-libraries__active .client-libraries-text {\n color: var(--scalar-color-1);\n font-weight: var(--scalar-semibold);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,MAAM,YAAY,OAAM;;EAExB,MAAM,SAAS,OAAM;EACrB,MAAM,UAAU,GAAG,OAAO;EAC1B,MAAM,EAAE,cAAc,iBAAgB;;EAGtC,MAAM,OAAO,eACX,kBAAkB,QAAA,uBAAuB,CAAC,KAAK,SAAS;GACtD,GAAG;GACH,MAAM,gBAAgB,IAAI,KAAK;GAChC,EAAE,CACL;;EAGA,MAAM,gBAAgB,IAAI,EAAC;;EAG3B,MAAM,WAAW,eAAe,KAAK,MAAM,cAAc,OAAM;;;;;;;;EAS/D,MAAM,eAAe,eACnB,mBAAmB,KAAK,MAAM,KAAK,SAAS;GAAE,MAAM,IAAI;GAAM,QAAQ;GAAI,EAAE,CAAC,CAC/E;;EAGA,MAAM,UAAU,UAAkB;AAChC,iBAAc,QAAQ;GAEtB,MAAM,KAAK,aAAa,MAAM;AAC9B,OAAI,GACF,SAAA,UAAU,KAAK,oCAAoC,GAAE;;AAWzD,QACE,OAAO,QAAA,gBAAgB,aAAa,GACnC,CAAC,QAAQ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A,CAAA,CAAA;;uFASpB,mBAyBM,OAzBN,YAyBM,CAtBJ,mBAqBM,OAAA;cApBA;KAAJ,KAAI;KACJ,OAAM;0BACN,mBASO,UAAA,MAAA,WARkB,KAAA,QAAf,KAAK,UAAK;yBADpB,mBASO,QAAA;MAPJ,KAAK;MACN,OAAM;SAEE,IAAI,QAAA,WAAA,EADZ,YAGqB,MAAA,WAAA,EAAA;;MADnB,OAAM;MACL,MAAM,IAAI;4DACb,mBAAyD,QAAzD,YAAyD,gBAAlB,IAAI,KAAI,EAAA,EAAA,CAAA,CAAA;eAEjD,mBAOO,QAPP,aAOO,CANL,YAEoB,MAAA,WAAA,EAAA;KADlB,OAAM;KACN,MAAK;QACP,mBAEO,QAFP,aAEO,gBADF,MAAA,UAAS,CAAA,uBAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;IASd,SAAA,OAAU,eAAA,WAAA,EADlB,mBAQM,OAAA;;KANH,IAAI;KACJ,mBAAiB,YAAA;KAClB,OAAM;KACN,MAAK;KACL,UAAS;QACT,YAAgD,MAAA,eAAA,EAAA,EAA/B,OAAO,SAAA,MAAS,aAAA,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA,CAAA,EAAA,GAAA,YAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-server-selector-block/components/Selector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Selector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-server-selector-block/components/Selector.vue"],"names":[],"mappings":"AAoFA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAKhG,KAAK,WAAW,GAAG;IACjB,8BAA8B;IAC9B,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wBAAwB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;AAkMF,QAAA,MAAM,YAAY;;;;;;;;;;;;kFAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.vue.js","names":[],"sources":["../../../../src/blocks/scalar-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 { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nconst { target, servers, selectedServer } = defineProps<{\n /** The selected server URL */\n selectedServer: ServerObject | null\n /** Available servers */\n servers: ServerObject[]\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 when the selected server changes */\n (e: 'update:modelValue', value: string): void\n}>()\n\nconst serverOptions = computed(() =>\n servers.map((server) => ({\n id: server.url,\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?.url),\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-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 { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nconst { target, servers, selectedServer } = defineProps<{\n /** The selected server URL */\n selectedServer: ServerObject | null\n /** Available servers */\n servers: ServerObject[]\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 when the selected server changes */\n (e: 'update:modelValue', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst serverOptions = computed(() =>\n servers.map((server) => ({\n id: server.url,\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?.url),\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-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
|
const serverOptions = computed(() => __props.servers.map((server) => ({
|
|
23
27
|
id: server.url,
|
|
24
28
|
label: server.url
|
|
@@ -48,8 +52,8 @@ var Selector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
48
52
|
variant: "ghost"
|
|
49
53
|
}, {
|
|
50
54
|
default: withCtx(() => [
|
|
51
|
-
|
|
52
|
-
createElementVNode("span",
|
|
55
|
+
createElementVNode("span", _hoisted_1, toDisplayString(unref(translate)("server.label")) + ":", 1),
|
|
56
|
+
createElementVNode("span", _hoisted_2, toDisplayString(serverUrlWithoutTrailingSlash.value || unref(translate)("server.select")), 1),
|
|
53
57
|
createVNode(unref(ScalarIconCaretDown), {
|
|
54
58
|
class: "text-c-2 ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100",
|
|
55
59
|
weight: "bold"
|
|
@@ -62,7 +66,7 @@ var Selector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
62
66
|
"modelValue",
|
|
63
67
|
"options",
|
|
64
68
|
"target"
|
|
65
|
-
])) : (openBlock(), createElementBlock("div",
|
|
69
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_3, [createElementVNode("span", _hoisted_4, toDisplayString(unref(translate)("server.label")) + ":", 1), createElementVNode("span", _hoisted_5, toDisplayString(serverUrlWithoutTrailingSlash.value), 1)]));
|
|
66
70
|
};
|
|
67
71
|
}
|
|
68
72
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selector.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-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 { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nconst { target, servers, selectedServer } = defineProps<{\n /** The selected server URL */\n selectedServer: ServerObject | null\n /** Available servers */\n servers: ServerObject[]\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 when the selected server changes */\n (e: 'update:modelValue', value: string): void\n}>()\n\nconst serverOptions = computed(() =>\n servers.map((server) => ({\n id: server.url,\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?.url),\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-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 { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nconst { target, servers, selectedServer } = defineProps<{\n /** The selected server URL */\n selectedServer: ServerObject | null\n /** Available servers */\n servers: ServerObject[]\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 when the selected server changes */\n (e: 'update:modelValue', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst serverOptions = computed(() =>\n servers.map((server) => ({\n id: server.url,\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?.url),\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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Selector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-server-selector-block/components/ServerSelector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ServerSelector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-server-selector-block/components/ServerSelector.vue"],"names":[],"mappings":"AAsGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAQhG,KAAK,aAAa,GAAG;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,2BAA2B;IAC3B,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wBAAwB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB,CAAA;AAED;;;;;;;;GAQG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY,sSAqJd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerSelector.vue.js","names":[],"sources":["../../../../src/blocks/scalar-server-selector-block/components/ServerSelector.vue"],"sourcesContent":["<script lang=\"ts\">\ntype SelectorProps = {\n /** The event bus to use for emitting events */\n eventBus: WorkspaceEventBus\n /** The selected server */\n selectedServer: ServerObject | null\n /** Available servers */\n servers: ServerObject[]\n}\n\n/**\n * ServerSelector\n *\n * Core component for rendering a server selector block.\n * Handles server selection and emits a 'server:update:selected' event when the selected server changes.\n *\n * @event server:update:selected - Emitted when the selected server changes\n * @event 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 { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { useId } from 'vue'\n\nimport Selector from './Selector.vue'\n\nconst { eventBus, servers, selectedServer } = defineProps<SelectorProps>()\n\nconst id = useId()\n\n/** Update the selected server */\nconst updateServer = (newServer: string) => {\n eventBus.emit('server:update:selected', {\n url: selectedServer?.url === newServer ? '' : newServer,\n meta: {\n type: 'document',\n },\n })\n}\n\n/** Update the server variable */\nconst updateServerVariable = (key: string, value: string) => {\n /** Find the index of the selected server */\n const index = servers.findIndex((s) => s.url === selectedServer?.url)\n if (index === -1) {\n return\n }\n\n eventBus.emit('server:update:variables', {\n index,\n key,\n value,\n meta: {\n type: 'document',\n },\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":"ServerSelector.vue.js","names":[],"sources":["../../../../src/blocks/scalar-server-selector-block/components/ServerSelector.vue"],"sourcesContent":["<script lang=\"ts\">\ntype SelectorProps = {\n /** The event bus to use for emitting events */\n eventBus: WorkspaceEventBus\n /** The selected server */\n selectedServer: ServerObject | null\n /** Available servers */\n servers: ServerObject[]\n}\n\n/**\n * ServerSelector\n *\n * Core component for rendering a server selector block.\n * Handles server selection and emits a 'server:update:selected' event when the selected server changes.\n *\n * @event server:update:selected - Emitted when the selected server changes\n * @event 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 { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { 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/** Update the selected server */\nconst updateServer = (newServer: string) => {\n eventBus.emit('server:update:selected', {\n url: selectedServer?.url === newServer ? '' : newServer,\n meta: {\n type: 'document',\n },\n })\n}\n\n/** Update the server variable */\nconst updateServerVariable = (key: string, value: string) => {\n /** Find the index of the selected server */\n const index = servers.findIndex((s) => s.url === selectedServer?.url)\n if (index === -1) {\n return\n }\n\n eventBus.emit('server:update:variables', {\n index,\n key,\n value,\n meta: {\n type: 'document',\n },\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':\n !selectedServer?.description && !selectedServer?.variables,\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=\"selectedServer?.variables\"\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,9 +1,11 @@
|
|
|
1
|
+
import { useLocalization } from "../../../features/localization/use-localization.js";
|
|
1
2
|
import Selector_default from "./Selector.vue.js";
|
|
2
|
-
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, unref, useId } from "vue";
|
|
3
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, useId } from "vue";
|
|
3
4
|
import { ServerVariablesForm } from "@scalar/api-client/components/Server";
|
|
4
5
|
import { ScalarMarkdown } from "@scalar/components/markdown";
|
|
5
6
|
//#region src/blocks/scalar-server-selector-block/components/ServerSelector.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var _hoisted_1 =
|
|
7
|
+
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" };
|
|
8
|
+
var _hoisted_2 = ["id"];
|
|
7
9
|
var ServerSelector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
10
|
__name: "ServerSelector",
|
|
9
11
|
props: {
|
|
@@ -13,6 +15,7 @@ var ServerSelector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
13
15
|
},
|
|
14
16
|
setup(__props) {
|
|
15
17
|
const id = useId();
|
|
18
|
+
const { translate } = useLocalization();
|
|
16
19
|
/** Update the selected server */
|
|
17
20
|
const updateServer = (newServer) => {
|
|
18
21
|
__props.eventBus.emit("server:update:selected", {
|
|
@@ -34,7 +37,7 @@ var ServerSelector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
34
37
|
};
|
|
35
38
|
return (_ctx, _cache) => {
|
|
36
39
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
37
|
-
|
|
40
|
+
createElementVNode("label", _hoisted_1, toDisplayString(unref(translate)("server.label")), 1),
|
|
38
41
|
createElementVNode("div", {
|
|
39
42
|
id: unref(id),
|
|
40
43
|
class: normalizeClass(["border", { "rounded-b-xl": !__props.selectedServer?.description && !__props.selectedServer?.variables }])
|
|
@@ -48,7 +51,7 @@ var ServerSelector_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
48
51
|
"selectedServer",
|
|
49
52
|
"servers",
|
|
50
53
|
"target"
|
|
51
|
-
])) : createCommentVNode("", true)], 10,
|
|
54
|
+
])) : createCommentVNode("", true)], 10, _hoisted_2),
|
|
52
55
|
createVNode(unref(ServerVariablesForm), {
|
|
53
56
|
layout: "reference",
|
|
54
57
|
variables: __props.selectedServer?.variables,
|
package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerSelector.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-server-selector-block/components/ServerSelector.vue"],"sourcesContent":["<script lang=\"ts\">\ntype SelectorProps = {\n /** The event bus to use for emitting events */\n eventBus: WorkspaceEventBus\n /** The selected server */\n selectedServer: ServerObject | null\n /** Available servers */\n servers: ServerObject[]\n}\n\n/**\n * ServerSelector\n *\n * Core component for rendering a server selector block.\n * Handles server selection and emits a 'server:update:selected' event when the selected server changes.\n *\n * @event server:update:selected - Emitted when the selected server changes\n * @event 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 { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { useId } from 'vue'\n\nimport Selector from './Selector.vue'\n\nconst { eventBus, servers, selectedServer } = defineProps<SelectorProps>()\n\nconst id = useId()\n\n/** Update the selected server */\nconst updateServer = (newServer: string) => {\n eventBus.emit('server:update:selected', {\n url: selectedServer?.url === newServer ? '' : newServer,\n meta: {\n type: 'document',\n },\n })\n}\n\n/** Update the server variable */\nconst updateServerVariable = (key: string, value: string) => {\n /** Find the index of the selected server */\n const index = servers.findIndex((s) => s.url === selectedServer?.url)\n if (index === -1) {\n return\n }\n\n eventBus.emit('server:update:variables', {\n index,\n key,\n value,\n meta: {\n type: 'document',\n },\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":"ServerSelector.vue.script.js","names":[],"sources":["../../../../src/blocks/scalar-server-selector-block/components/ServerSelector.vue"],"sourcesContent":["<script lang=\"ts\">\ntype SelectorProps = {\n /** The event bus to use for emitting events */\n eventBus: WorkspaceEventBus\n /** The selected server */\n selectedServer: ServerObject | null\n /** Available servers */\n servers: ServerObject[]\n}\n\n/**\n * ServerSelector\n *\n * Core component for rendering a server selector block.\n * Handles server selection and emits a 'server:update:selected' event when the selected server changes.\n *\n * @event server:update:selected - Emitted when the selected server changes\n * @event 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 { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { 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/** Update the selected server */\nconst updateServer = (newServer: string) => {\n eventBus.emit('server:update:selected', {\n url: selectedServer?.url === newServer ? '' : newServer,\n meta: {\n type: 'document',\n },\n })\n}\n\n/** Update the server variable */\nconst updateServerVariable = (key: string, value: string) => {\n /** Find the index of the selected server */\n const index = servers.findIndex((s) => s.url === selectedServer?.url)\n if (index === -1) {\n return\n }\n\n eventBus.emit('server:update:variables', {\n index,\n key,\n value,\n meta: {\n type: 'document',\n },\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':\n !selectedServer?.description && !selectedServer?.variables,\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=\"selectedServer?.variables\"\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":";;;;;;;;;;;;;;;;EAmCA,MAAM,KAAK,OAAM;EACjB,MAAM,EAAE,cAAc,iBAAgB;;EAGtC,MAAM,gBAAgB,cAAsB;AAC1C,WAAA,SAAS,KAAK,0BAA0B;IACtC,KAAK,QAAA,gBAAgB,QAAQ,YAAY,KAAK;IAC9C,MAAM,EACJ,MAAM,YACP;IACF,CAAA;;;EAIH,MAAM,wBAAwB,KAAa,UAAkB;;GAE3D,MAAM,QAAQ,QAAA,QAAQ,WAAW,MAAM,EAAE,QAAQ,QAAA,gBAAgB,IAAG;AACpE,OAAI,UAAU,GACZ;AAGF,WAAA,SAAS,KAAK,2BAA2B;IACvC;IACA;IACA;IACA,MAAM,EACJ,MAAM,YACP;IACF,CAAA;;;;IAKD,mBAGQ,SAHR,YAGQ,gBADH,MAAA,UAAS,CAAA,eAAA,CAAA,EAAA,EAAA;IAEd,mBAaM,OAAA;KAZH,IAAI,MAAA,GAAE;KACP,OAAK,eAAA,CAAC,UAAQ,EAAA,gBAAA,CAC2B,QAAA,gBAAgB,eAAW,CAAK,QAAA,gBAAgB,WAAA,CAAA,CAAA;QAKjF,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,QAAA,gBAAgB;KAC3B,qBAAiB;;IAIZ,QAAA,gBAAgB,eAAA,WAAA,EADxB,YAGwC,MAAA,eAAA,EAAA;;KADtC,OAAM;KACL,OAAO,QAAA,eAAe"}
|