@scalar/api-reference 1.63.0 → 1.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +90 -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.script.js +1 -1
- 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.script.js +1 -1
- 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.script.js +2 -2
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.script.js.map +1 -1
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js +1 -1
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js.map +1 -1
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.js.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts +1 -3
- 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 +13 -27
- 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.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 +37 -25
- 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.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 +10 -4
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.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.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.script.js +5 -5
- package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/SpecificationVersion.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 -9
- package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js.map +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/helpers/language-icon.js.map +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/helpers/renderable-sdks.js.map +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/helpers/visible-tab-count.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.script.js +1 -1
- 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.script.js +1 -1
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js.map +1 -1
- package/dist/browser/chunks/AgentScalarChatInterface-D1mzA447.js +27 -0
- package/dist/browser/chunks/ScalarTextInput.vue-OfiA6SHf.js +27 -0
- package/dist/browser/chunks/{basic-shape-diamond.svg-BTEOT1FL.js → basic-shape-diamond.svg-o5eiY2I7.js} +2 -2
- package/dist/browser/chunks/{basic-shape-hexagon.svg-BSPzaCgF.js → basic-shape-hexagon.svg-CGuS7mbd.js} +2 -2
- package/dist/browser/chunks/{basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js → basic-shape-primary-circle-ellipse-round.svg-DDIpXiBm.js} +2 -2
- package/dist/browser/chunks/{basic-shape-primary-square-rectangle.svg-n2YRykHD.js → basic-shape-primary-square-rectangle.svg-DzVEJHMB.js} +2 -2
- package/dist/browser/chunks/{basic-shape-shield.svg-Bec9cJDA.js → basic-shape-shield.svg-BZzapRqv.js} +2 -2
- package/dist/browser/chunks/browser-CTPPEMEL.js +129 -0
- package/dist/browser/chunks/{computer-device-desktop-monitor.svg-m6j893Hb.js → computer-device-desktop-monitor.svg-OSM05r1I.js} +2 -2
- package/dist/browser/chunks/{computer-device-desktop.svg-Dk1VVO7k.js → computer-device-desktop.svg-BMFzGZ27.js} +2 -2
- package/dist/browser/chunks/{computer-device-laptop.svg-BNGVUCYS.js → computer-device-laptop.svg-CMAjzuB-.js} +2 -2
- package/dist/browser/chunks/{computer-device-mobile-phone-android-samsung-back.svg-CC4UUTFw.js → computer-device-mobile-phone-android-samsung-back.svg-D4xBONmL.js} +2 -2
- package/dist/browser/chunks/{computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js → computer-device-mobile-phone-android-samsung.svg-gbMJLjJw.js} +2 -2
- package/dist/browser/chunks/{computer-device-mobile-phone-iphone-x-back.svg-CLm7sgMM.js → computer-device-mobile-phone-iphone-x-back.svg-Bl1rmdKA.js} +2 -2
- package/dist/browser/chunks/{computer-device-mobile-phone-iphone-x.svg-Xrttg6_7.js → computer-device-mobile-phone-iphone-x.svg-DVetP0aa.js} +2 -2
- package/dist/browser/chunks/{computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js → computer-device-mobile-tablet-touch.svg-Zi88BP4L.js} +2 -2
- package/dist/browser/chunks/{computer-device-mobile-tablet.svg-DCr0XlRc.js → computer-device-mobile-tablet.svg-C1ggisWP.js} +2 -2
- package/dist/browser/chunks/{computer-device-network-ethernet-cat6.svg-AK9l0iOl.js → computer-device-network-ethernet-cat6.svg-BIUymdC1.js} +2 -2
- package/dist/browser/chunks/{computer-device-network-lan-www.svg-gUIdFBlE.js → computer-device-network-lan-www.svg-CoFUlIVO.js} +2 -2
- package/dist/browser/chunks/{computer-device-network-wifi-connection.svg-Be-EMm4e.js → computer-device-network-wifi-connection.svg-DeWsacxI.js} +2 -2
- package/dist/browser/chunks/{computer-device-network-wifi-router.svg-Dc2VzyqK.js → computer-device-network-wifi-router.svg-BjpZEot4.js} +2 -2
- package/dist/browser/chunks/{ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js → ecology-science-erlenmeyer-flask.svg-ftjGGirE.js} +2 -2
- package/dist/browser/chunks/{image-flash-lightning.svg-EETR_y1q.js → image-flash-lightning.svg-DYQ0W4Fi.js} +2 -2
- package/dist/browser/chunks/{image-picture-flower.svg-DN1AYzJU.js → image-picture-flower.svg-Bfe5SVDf.js} +2 -2
- package/dist/browser/chunks/{interface-alert-exclamation-diamond.svg-C5NozMV_.js → interface-alert-exclamation-diamond.svg-D1HePDNM.js} +2 -2
- package/dist/browser/chunks/{interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js → interface-alert-exclamation-triangle-warning.svg-CILUsxBC.js} +2 -2
- package/dist/browser/chunks/{interface-alert-information-circle.svg-ckkkt9Mv.js → interface-alert-information-circle.svg-9LrbJM5J.js} +2 -2
- package/dist/browser/chunks/{interface-award-crown.svg-pjvn9hY-.js → interface-award-crown.svg-DllWgiU1.js} +2 -2
- package/dist/browser/chunks/{interface-bookmark.svg-BK9HKQBT.js → interface-bookmark-tag.svg-Dc-JL-Kc.js} +2 -2
- package/dist/browser/chunks/{interface-bookmark-tag.svg-r2r-lQq4.js → interface-bookmark.svg-Dc-JL-Kc.js} +2 -2
- package/dist/browser/chunks/{interface-calendar-date-one.svg-DNnF0M1I.js → interface-calendar-date-one.svg-DO2jelhF.js} +2 -2
- package/dist/browser/chunks/{interface-content-book-open-pages.svg-CQj_w9Vp.js → interface-content-book-open-pages.svg-BJjMjIgA.js} +2 -2
- package/dist/browser/chunks/{interface-content-book-page.svg-DppoeJRe.js → interface-content-book-page.svg-C6rKB2fs.js} +2 -2
- package/dist/browser/chunks/{interface-content-file.svg-CvcD7OiY.js → interface-content-file.svg-CS0q2FKx.js} +2 -2
- package/dist/browser/chunks/{interface-content-folder.svg-BmtS5I9A.js → interface-content-folder.svg-CThTWsJX.js} +2 -2
- package/dist/browser/chunks/{interface-copy-clipboard.svg-Be6EI50X.js → interface-copy-clipboard.svg-DdN67cLv.js} +2 -2
- package/dist/browser/chunks/{interface-edit-attachment.svg-G5TKzpWX.js → interface-edit-attachment.svg-Ciizphuh.js} +2 -2
- package/dist/browser/chunks/{interface-edit-binocular.svg-jzL-DvGB.js → interface-edit-binocular.svg-Dw1nDqmL.js} +2 -2
- package/dist/browser/chunks/{interface-edit-magic-wand.svg-BOTlymvp.js → interface-edit-magic-wand.svg-BYS0jm_E.js} +2 -2
- package/dist/browser/chunks/{interface-edit-tool-paint-roller.svg-s9dwryx7.js → interface-edit-tool-paint-roller.svg-NioSHZC2.js} +2 -2
- package/dist/browser/chunks/{interface-edit-tool-pencil.svg-C7v0dbB3.js → interface-edit-tool-pencil.svg-P87QFlat.js} +2 -2
- package/dist/browser/chunks/{interface-favorite-award.svg-CYHUgUG0.js → interface-favorite-award.svg-DBBAChSi.js} +2 -2
- package/dist/browser/chunks/{interface-favorite-flag.svg-C10zlKOb.js → interface-favorite-flag.svg-HlhPomHY.js} +2 -2
- package/dist/browser/chunks/{interface-favorite-heart.svg-eoduXxlz.js → interface-favorite-heart.svg-Cqu2GYDo.js} +2 -2
- package/dist/browser/chunks/{interface-favorite-star.svg-BSmxJetr.js → interface-favorite-star.svg-BD4JY_J2.js} +2 -2
- package/dist/browser/chunks/{interface-favorite-stars-sparkles.svg-JTFLj3Ls.js → interface-favorite-stars-sparkles.svg-BXi6aO8q.js} +2 -2
- package/dist/browser/chunks/{interface-hierarchy-flowchart.svg-Cg_Wy0kN.js → interface-hierarchy-flowchart.svg-CDEVSsD4.js} +2 -2
- package/dist/browser/chunks/{interface-home-house.svg-DytoGRnv.js → interface-home-house.svg-DJetUjwj.js} +2 -2
- package/dist/browser/chunks/{interface-hyperlink.svg-CuEfmmQI.js → interface-hyperlink.svg-DJ1LREmz.js} +2 -2
- package/dist/browser/chunks/{interface-lighting-brightness.svg-DSK0h_Pa.js → interface-lighting-brightness.svg-TGKAaHYV.js} +2 -2
- package/dist/browser/chunks/{interface-lock-closed.svg-Cn6TaLYv.js → interface-lock-closed.svg-3hehWr3i.js} +2 -2
- package/dist/browser/chunks/{interface-lock-open-unlock.svg-CVkG5-9W.js → interface-lock-open-unlock.svg-CuXKcv1m.js} +2 -2
- package/dist/browser/chunks/{interface-login-key.svg-y-cwwXjN.js → interface-login-key.svg-Chwvvywd.js} +2 -2
- package/dist/browser/chunks/{interface-search.svg-S-puVFJB.js → interface-search.svg-JDE3fk0u.js} +2 -2
- package/dist/browser/chunks/{interface-setting-cog.svg-CTH4_lLg.js → interface-setting-cog.svg-BBCkeh4K.js} +2 -2
- package/dist/browser/chunks/{interface-share-megaphone-bullhorn.svg-Pbp39MyC.js → interface-share-megaphone-bullhorn.svg-CDdxF-4y.js} +2 -2
- package/dist/browser/chunks/{interface-share-rocket.svg-BgCsIRZO.js → interface-share-rocket.svg-DSbdn_o7.js} +2 -2
- package/dist/browser/chunks/{interface-share-satellite.svg-DAMN9d5G.js → interface-share-satellite.svg-CefBVZvY.js} +2 -2
- package/dist/browser/chunks/{interface-share-space-ship.svg-Dt-Mejxk.js → interface-share-space-ship.svg-tFA2dsSU.js} +2 -2
- package/dist/browser/chunks/{interface-share.svg-vFYTXSti.js → interface-share.svg-BpOGopyv.js} +2 -2
- package/dist/browser/chunks/{interface-signal-square.svg-DNG4LpAe.js → interface-signal-square.svg-BcX_BoaC.js} +2 -2
- package/dist/browser/chunks/{interface-time-clock-circle.svg-Bpz-nLxo.js → interface-time-clock-circle.svg-C8B_L_RM.js} +2 -2
- package/dist/browser/chunks/{interface-time-hour-glass.svg-D7agfKsH.js → interface-time-hour-glass.svg-qw-oeoVn.js} +2 -2
- package/dist/browser/chunks/{interface-users-multiple.svg-CkPJBBnG.js → interface-users-multiple.svg-Cs13Eewq.js} +2 -2
- package/dist/browser/chunks/{interface-weather-moon.svg-CaTZFMPO.js → interface-weather-moon.svg-CV-oDTae.js} +2 -2
- package/dist/browser/chunks/{mail-chat-bubble-square.svg-DC8RIihp.js → mail-chat-bubble-square.svg-dpauJhin.js} +2 -2
- package/dist/browser/chunks/{mail-send-email-paper-airplane.svg-D8OLs9jz.js → mail-send-email-paper-airplane.svg-BBofxojL.js} +2 -2
- package/dist/browser/chunks/{mail-send-envelope.svg-CV33h5Sx.js → mail-send-envelope.svg-DyENgYOI.js} +2 -2
- package/dist/browser/chunks/modal-BS4e2gew.js +99 -0
- package/dist/browser/chunks/{money-cashier-receipt.svg-CJL8C2gs.js → money-cashier-receipt.svg-dNTr5aio.js} +2 -2
- package/dist/browser/chunks/{money-currency-dollar-pay.svg-VdBplCTx.js → money-currency-dollar-pay.svg-1ZESPtFY.js} +2 -2
- package/dist/browser/chunks/{money-graph-arrow-increase.svg-DcRov3zk.js → money-graph-arrow-increase.svg-kEZ2u2z2.js} +2 -2
- package/dist/browser/chunks/{money-graph-bar-chart-increase.svg-Cc7KxjX-.js → money-graph-bar-chart-increase.svg-B-t2UWB3.js} +2 -2
- package/dist/browser/chunks/{nature-ecology-leaf.svg-DR3cTZxt.js → nature-ecology-leaf.svg-DZ2GJV8m.js} +2 -2
- package/dist/browser/chunks/{phone-telephone.svg-DyY0gUlk.js → phone-telephone.svg-C12QjpN7.js} +2 -2
- package/dist/browser/chunks/{programming-bug.svg-BHLT-Qhp.js → programming-bug.svg-wLTsruN9.js} +2 -2
- package/dist/browser/chunks/{programming-cloud.svg-B6YW33ba.js → programming-cloud.svg-3XU6dNUg.js} +2 -2
- package/dist/browser/chunks/{programming-computer-database-server.svg-B6o5Sdn-.js → programming-computer-database-server.svg-B1JrHSPd.js} +2 -2
- package/dist/browser/chunks/{programming-computer-database.svg-Cl7OVtpJ.js → programming-computer-database.svg-BxHSuFl7.js} +2 -2
- package/dist/browser/chunks/{programming-module-four-layout.svg-BQrerL1x.js → programming-module-four-layout.svg-CeV35q45.js} +2 -2
- package/dist/browser/chunks/{programming-module-three.svg-B2KTQzBM.js → programming-module-three.svg-YIBpLt45.js} +2 -2
- package/dist/browser/chunks/{programming-module.svg-CiID7kPm.js → programming-module.svg-CU_pEibI.js} +2 -2
- package/dist/browser/chunks/{programming-script-code.svg-D1M5rtkN.js → programming-script-code.svg-CLzinmHT.js} +2 -2
- package/dist/browser/chunks/runtime-core.esm-bundler-CqqEw5ds.js +17 -0
- package/dist/browser/chunks/{shopping-cart.svg-BEegiIR9.js → shopping-cart.svg-Brzddu3K.js} +2 -2
- package/dist/browser/chunks/{shopping-gift-present.svg-BUHwuLix.js → shopping-gift-present.svg-l2K48g7L.js} +2 -2
- package/dist/browser/chunks/{shopping-shipping-box-parcel-package.svg-D6fxWdYx.js → shopping-shipping-box-parcel-package.svg-DesGopPo.js} +2 -2
- package/dist/browser/chunks/{tag-new-circle.svg-jsg1bGs0.js → tag-new-circle.svg-DE-VaLZU.js} +2 -2
- package/dist/browser/chunks/{travel-map-earth-globe.svg-ClbMiU-f.js → travel-map-earth-globe.svg-DLaOMzx6.js} +2 -2
- package/dist/browser/chunks/vendor-DWZAEyBy.js +306 -0
- package/dist/browser/standalone.esm.js +26 -24
- package/dist/browser/standalone.js +310 -311
- package/dist/components/AgentScalar/AgentScalarButton.vue.script.js +1 -1
- package/dist/components/AgentScalar/AgentScalarButton.vue.script.js.map +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.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.script.js +1 -1
- 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 +47 -32
- 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.script.js +1 -1
- package/dist/components/Anchor/Anchor.vue.script.js.map +1 -1
- package/dist/components/Anchor/WithBreadcrumb.vue.script.js +2 -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 +141 -33
- package/dist/components/ApiReference.vue.script.js.map +1 -1
- package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/Badge/Badge.vue.js.map +1 -1
- package/dist/components/Badge/Badge.vue.script.js +9 -9
- package/dist/components/Badge/Badge.vue.script.js.map +1 -1
- package/dist/components/ClassicHeader.vue.js +1 -1
- package/dist/components/ClassicHeader.vue.js.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -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.script.js +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/ChannelsList.vue.js +1 -1
- package/dist/components/Content/AsyncApi/ChannelsList.vue.script.js +1 -1
- package/dist/components/Content/AsyncApi/ChannelsList.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/Message.vue.d.ts.map +1 -1
- package/dist/components/Content/AsyncApi/Message.vue.js +1 -1
- package/dist/components/Content/AsyncApi/Message.vue.script.js +2 -2
- package/dist/components/Content/AsyncApi/Message.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/Operation.vue.d.ts.map +1 -1
- package/dist/components/Content/AsyncApi/Operation.vue.js +1 -1
- package/dist/components/Content/AsyncApi/Operation.vue.js.map +1 -1
- package/dist/components/Content/AsyncApi/Operation.vue.script.js +6 -1
- package/dist/components/Content/AsyncApi/Operation.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/adapt-async-api-parameters.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/async-api-render-options.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.d.ts +17 -0
- package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.d.ts.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.js +21 -0
- package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.js.map +1 -0
- package/dist/components/Content/AsyncApi/helpers/pick-heading.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.js.map +1 -1
- package/dist/components/Content/Auth/Auth.vue.script.js +1 -1
- package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -1
- package/dist/components/Content/Content.vue.script.js +1 -1
- package/dist/components/Content/Content.vue.script.js.map +1 -1
- package/dist/components/Content/Models/Model.vue.script.js +1 -1
- package/dist/components/Content/Models/Model.vue.script.js.map +1 -1
- package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModelTag.vue.script.js +2 -2
- package/dist/components/Content/Models/ModelTag.vue.script.js.map +1 -1
- package/dist/components/Content/Models/components/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/components/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Models/components/ClassicLayout.vue.script.js +1 -1
- package/dist/components/Content/Models/components/ClassicLayout.vue.script.js.map +1 -1
- package/dist/components/Content/Models/components/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/components/ModernLayout.vue.script.js +1 -1
- package/dist/components/Content/Models/components/ModernLayout.vue.script.js.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.script.js +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/LinkButton.vue.js +1 -1
- package/dist/components/Content/Schema/LinkButton.vue.js.map +1 -1
- package/dist/components/Content/Schema/RenderString.vue.script.js +1 -1
- package/dist/components/Content/Schema/RenderString.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 +5 -13
- 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 +69 -34
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.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 +16 -8
- package/dist/components/Content/Schema/SchemaEnums.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.script.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.script.js +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -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 +4 -3
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js.map +1 -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 +31 -21
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/helpers/dynamic-scope.js.map +1 -1
- package/dist/components/Content/Schema/helpers/format-example.js.map +1 -1
- package/dist/components/Content/Schema/helpers/format-value.js.map +1 -1
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.js.map +1 -1
- package/dist/components/Content/Schema/helpers/get-enum-values.js.map +1 -1
- package/dist/components/Content/Schema/helpers/get-property-description.js.map +1 -1
- package/dist/components/Content/Schema/helpers/get-ref-name.js.map +1 -1
- package/dist/components/Content/Schema/helpers/get-schema-type.js.map +1 -1
- package/dist/components/Content/Schema/helpers/has-complex-array-items.js.map +1 -1
- package/dist/components/Content/Schema/helpers/is-empty-schema-object.js.map +1 -1
- package/dist/components/Content/Schema/helpers/is-type-object.js.map +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +3 -3
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +1 -4
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js.map +1 -1
- package/dist/components/Content/Schema/helpers/partition-all-of-compositions.d.ts +32 -0
- package/dist/components/Content/Schema/helpers/partition-all-of-compositions.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/partition-all-of-compositions.js +97 -0
- package/dist/components/Content/Schema/helpers/partition-all-of-compositions.js.map +1 -0
- package/dist/components/Content/Schema/helpers/schema-composition.js.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-cycle.js.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js.map +1 -1
- package/dist/components/Content/Schema/helpers/should-display-description.js.map +1 -1
- package/dist/components/Content/Schema/helpers/should-display-heading.js.map +1 -1
- package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js.map +1 -1
- package/dist/components/Content/Schema/helpers/sort-property-names.js.map +1 -1
- package/dist/components/Content/Tags/Tag.vue.script.js +1 -1
- package/dist/components/Content/Tags/Tag.vue.script.js.map +1 -1
- package/dist/components/Content/Tags/components/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/components/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js +1 -1
- package/dist/components/Content/Tags/components/ClassicLayout.vue.script.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.script.js +1 -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.script.js +1 -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 +4 -3
- package/dist/components/GettingStarted.vue.script.js.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.script.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.script.js.map +1 -1
- package/dist/components/IntersectionObserver.vue.script.js +10 -7
- package/dist/components/IntersectionObserver.vue.script.js.map +1 -1
- package/dist/components/Lazy/Lazy.vue.script.js +2 -2
- package/dist/components/Lazy/Lazy.vue.script.js.map +1 -1
- package/dist/components/LinkList/LinkList.vue.js +1 -1
- package/dist/components/LinkList/LinkList.vue.js.map +1 -1
- package/dist/components/LinkList/LinkList.vue.script.js +2 -2
- package/dist/components/LinkList/LinkList.vue.script.js.map +1 -1
- package/dist/components/MobileHeader.vue.d.ts.map +1 -1
- package/dist/components/MobileHeader.vue.script.js +4 -4
- package/dist/components/MobileHeader.vue.script.js.map +1 -1
- package/dist/components/OperationPath.vue.d.ts.map +1 -1
- package/dist/components/OperationPath.vue.js +1 -1
- package/dist/components/OperationPath.vue.script.js +1 -1
- package/dist/components/OperationPath.vue.script.js.map +1 -1
- package/dist/components/OperationsList/OperationsList.vue.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue.script.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue.script.js.map +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.js +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.script.js +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.script.js.map +1 -1
- package/dist/components/RenderPlugins/RenderPluginView.vue.script.js +1 -1
- package/dist/components/RenderPlugins/RenderPluginView.vue.script.js.map +1 -1
- package/dist/components/RenderPlugins/RenderPlugins.vue.script.js +1 -1
- package/dist/components/RenderPlugins/RenderPlugins.vue.script.js.map +1 -1
- package/dist/components/ScreenReader.vue.js +1 -1
- package/dist/components/ScreenReader.vue.script.js +2 -2
- package/dist/components/ScreenReader.vue.script.js.map +1 -1
- package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
- package/dist/components/Section/CompactSection.vue.js +1 -1
- package/dist/components/Section/CompactSection.vue.js.map +1 -1
- package/dist/components/Section/CompactSection.vue.script.js +22 -6
- package/dist/components/Section/CompactSection.vue.script.js.map +1 -1
- package/dist/components/Section/Section.vue.js +1 -1
- package/dist/components/Section/Section.vue.script.js +1 -1
- package/dist/components/Section/Section.vue.script.js.map +1 -1
- package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionAccordion.vue.js +1 -1
- package/dist/components/Section/SectionAccordion.vue.script.js +1 -1
- package/dist/components/Section/SectionAccordion.vue.script.js.map +1 -1
- package/dist/components/Section/SectionColumn.vue.js +1 -1
- package/dist/components/Section/SectionColumn.vue.js.map +1 -1
- package/dist/components/Section/SectionColumns.vue.js +1 -1
- package/dist/components/Section/SectionColumns.vue.js.map +1 -1
- package/dist/components/Section/SectionContainer.vue.js +1 -1
- package/dist/components/Section/SectionContainer.vue.script.js +2 -2
- package/dist/components/Section/SectionContainer.vue.script.js.map +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.js +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.script.js +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.script.js.map +1 -1
- package/dist/components/Section/SectionContent.vue.js +1 -1
- package/dist/components/Section/SectionContent.vue.js.map +1 -1
- package/dist/components/Section/SectionHeader.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionHeader.vue.js +1 -1
- package/dist/components/Section/SectionHeader.vue.js.map +1 -1
- package/dist/components/Section/SectionHeader.vue.script.js +3 -3
- package/dist/components/Section/SectionHeader.vue.script.js.map +1 -1
- package/dist/components/Section/SectionHeaderTag.vue.js +1 -1
- package/dist/components/Section/SectionHeaderTag.vue.script.js +1 -1
- package/dist/components/Section/SectionHeaderTag.vue.script.js.map +1 -1
- package/dist/components/SectionFlare/SectionFlare.vue.js +1 -1
- package/dist/components/SectionFlare/SectionFlare.vue.js.map +1 -1
- package/dist/components/ShowMoreButton.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue.script.js +1 -1
- package/dist/components/ShowMoreButton.vue.script.js.map +1 -1
- package/dist/features/Operation/Operation.vue.script.js +2 -2
- 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.script.js +2 -2
- package/dist/features/Operation/components/ContentTypeSelect.vue.script.js.map +1 -1
- package/dist/features/Operation/components/Header.vue.script.js +1 -1
- package/dist/features/Operation/components/Header.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.script.js +1 -1
- package/dist/features/Operation/components/Headers.vue.script.js.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.script.js +2 -2
- package/dist/features/Operation/components/OperationParameters.vue.script.js.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.script.js +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.script.js.map +1 -1
- package/dist/features/Operation/components/OperationScopes.vue.d.ts +8 -0
- package/dist/features/Operation/components/OperationScopes.vue.d.ts.map +1 -0
- package/dist/features/Operation/components/OperationScopes.vue.js +7 -0
- package/dist/features/Operation/components/OperationScopes.vue.js.map +1 -0
- package/dist/features/Operation/components/OperationScopes.vue.script.js +60 -0
- package/dist/features/Operation/components/OperationScopes.vue.script.js.map +1 -0
- package/dist/features/Operation/components/ParameterList.vue.script.js +1 -1
- package/dist/features/Operation/components/ParameterList.vue.script.js.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.script.js +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.script.js.map +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.script.js +2 -2
- 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 +90 -17
- package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js.map +1 -1
- package/dist/features/Operation/components/SecurityRequirementBadgeScheme.vue.script.js +1 -1
- package/dist/features/Operation/components/SecurityRequirementBadgeScheme.vue.script.js.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.script.js +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.script.js.map +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js.map +1 -1
- package/dist/features/Operation/components/helpers/get-parameter-examples.js.map +1 -1
- package/dist/features/Operation/helpers/filter-selected-security.js.map +1 -1
- package/dist/features/Operation/helpers/flatten-deep-object-query-parameter.js.map +1 -1
- package/dist/features/Operation/helpers/get-required-security.d.ts +13 -0
- package/dist/features/Operation/helpers/get-required-security.d.ts.map +1 -1
- package/dist/features/Operation/helpers/get-required-security.js +22 -1
- package/dist/features/Operation/helpers/get-required-security.js.map +1 -1
- package/dist/features/Operation/helpers/operation-stability.js.map +1 -1
- package/dist/features/Operation/helpers/should-ignore-entity.js.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +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 +16 -7
- 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 +3 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
- package/dist/features/Operation/request-body-composition-index.js.map +1 -1
- package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchButton.vue.script.js +1 -1
- 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.script.js +1 -1
- 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.script.js +1 -1
- package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -1
- package/dist/features/Search/helpers/create-fuse-instance.js.map +1 -1
- package/dist/features/Search/helpers/create-search-index.js.map +1 -1
- package/dist/features/Search/hooks/useSearchIndex.js.map +1 -1
- package/dist/features/ask-agent-button/AskAgentButton.vue.js +1 -1
- package/dist/features/ask-agent-button/AskAgentButton.vue.script.js +1 -1
- package/dist/features/ask-agent-button/AskAgentButton.vue.script.js.map +1 -1
- package/dist/features/developer-tools/DeveloperTools.vue.script.js +2 -2
- package/dist/features/developer-tools/DeveloperTools.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js +1 -1
- 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 +3 -3
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.d.ts +2 -2
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js +2 -2
- 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.script.js +4 -3
- 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 +2 -1
- 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.script.js +4 -3
- 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.script.js +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/DeployApiReference.vue.script.js +1 -1
- package/dist/features/developer-tools/components/DeployApiReference.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js +2 -2
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ShareApiReference.vue.script.js +1 -1
- package/dist/features/developer-tools/components/ShareApiReference.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.script.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleResponseTab.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponseTab.vue.script.js +1 -1
- package/dist/features/example-responses/ExampleResponseTab.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleResponseTabList.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponseTabList.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponseTabList.vue.script.js +1 -1
- package/dist/features/example-responses/ExampleResponseTabList.vue.script.js.map +1 -1
- 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.script.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.script.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/example-responses/helpers/has-response-content.js.map +1 -1
- package/dist/features/example-responses/helpers/normalize-mime-type-object.js.map +1 -1
- package/dist/features/example-responses/helpers/normalize-mime-type.js.map +1 -1
- package/dist/features/external-docs/ExternalDocs.vue.d.ts.map +1 -1
- package/dist/features/external-docs/ExternalDocs.vue.js.map +1 -1
- package/dist/features/external-docs/ExternalDocs.vue.script.js +27 -15
- package/dist/features/external-docs/ExternalDocs.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 +18 -12
- package/dist/features/info-object/Contact.vue.script.js.map +1 -1
- package/dist/features/info-object/InfoLink.vue.d.ts.map +1 -1
- package/dist/features/info-object/InfoLink.vue.js.map +1 -1
- package/dist/features/info-object/InfoLink.vue.script.js +23 -11
- package/dist/features/info-object/InfoLink.vue.script.js.map +1 -1
- package/dist/features/info-object/License.vue.d.ts.map +1 -1
- package/dist/features/info-object/License.vue.js.map +1 -1
- package/dist/features/info-object/License.vue.script.js +13 -7
- package/dist/features/info-object/License.vue.script.js.map +1 -1
- 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 +12 -6
- package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -1
- package/dist/features/localization/locales/ar.d.ts +1 -0
- package/dist/features/localization/locales/ar.d.ts.map +1 -1
- package/dist/features/localization/locales/ar.js +2 -1
- package/dist/features/localization/locales/ar.js.map +1 -1
- package/dist/features/localization/locales/de.d.ts +1 -0
- package/dist/features/localization/locales/de.d.ts.map +1 -1
- package/dist/features/localization/locales/de.js +2 -1
- package/dist/features/localization/locales/de.js.map +1 -1
- package/dist/features/localization/locales/en.d.ts +1 -0
- package/dist/features/localization/locales/en.d.ts.map +1 -1
- package/dist/features/localization/locales/en.js +2 -1
- package/dist/features/localization/locales/en.js.map +1 -1
- package/dist/features/localization/locales/es.d.ts +1 -0
- package/dist/features/localization/locales/es.d.ts.map +1 -1
- package/dist/features/localization/locales/es.js +2 -1
- package/dist/features/localization/locales/es.js.map +1 -1
- package/dist/features/localization/locales/fr.d.ts +1 -0
- package/dist/features/localization/locales/fr.d.ts.map +1 -1
- package/dist/features/localization/locales/fr.js +2 -1
- package/dist/features/localization/locales/fr.js.map +1 -1
- package/dist/features/localization/locales/pt.d.ts +229 -0
- package/dist/features/localization/locales/pt.d.ts.map +1 -0
- package/dist/features/localization/locales/pt.js +227 -0
- package/dist/features/localization/locales/pt.js.map +1 -0
- package/dist/features/localization/locales/ru.d.ts +1 -0
- package/dist/features/localization/locales/ru.d.ts.map +1 -1
- package/dist/features/localization/locales/ru.js +2 -1
- package/dist/features/localization/locales/ru.js.map +1 -1
- package/dist/features/localization/locales/zh-cn.d.ts +1 -0
- package/dist/features/localization/locales/zh-cn.d.ts.map +1 -1
- package/dist/features/localization/locales/zh-cn.js +2 -1
- package/dist/features/localization/locales/zh-cn.js.map +1 -1
- package/dist/features/localization/translations.d.ts +235 -0
- package/dist/features/localization/translations.d.ts.map +1 -1
- package/dist/features/localization/translations.js +4 -2
- package/dist/features/localization/translations.js.map +1 -1
- package/dist/features/localization/use-localization.js.map +1 -1
- package/dist/features/multiple-documents/DocumentSelector.vue.d.ts.map +1 -1
- package/dist/features/multiple-documents/DocumentSelector.vue.script.js +1 -1
- package/dist/features/multiple-documents/DocumentSelector.vue.script.js.map +1 -1
- package/dist/features/specification-extension/SpecificationExtension.vue.script.js +1 -1
- package/dist/features/specification-extension/SpecificationExtension.vue.script.js.map +1 -1
- package/dist/features/specification-extension/helpers.js.map +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.script.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.script.js.map +1 -1
- package/dist/features/x-badges/XBadges.vue.d.ts.map +1 -1
- package/dist/features/x-badges/XBadges.vue.script.js +1 -1
- package/dist/features/x-badges/XBadges.vue.script.js.map +1 -1
- package/dist/helpers/color-mode.js.map +1 -1
- package/dist/helpers/download.js.map +1 -1
- package/dist/helpers/get-async-api-message-payload-schema.js.map +1 -1
- package/dist/helpers/get-async-api-model-schema.js.map +1 -1
- package/dist/helpers/id-routing.d.ts +18 -4
- package/dist/helpers/id-routing.d.ts.map +1 -1
- package/dist/helpers/id-routing.js +67 -20
- package/dist/helpers/id-routing.js.map +1 -1
- package/dist/helpers/is-introduction-entry.js.map +1 -1
- package/dist/helpers/lazy-bus.js.map +1 -1
- package/dist/helpers/load-from-perssistance.js.map +1 -1
- package/dist/helpers/map-config-plugins.js.map +1 -1
- package/dist/helpers/map-config-to-workspace-store.js.map +1 -1
- package/dist/helpers/normalize-configurations.js +1 -1
- package/dist/helpers/normalize-configurations.js.map +1 -1
- package/dist/helpers/openapi.d.ts +6 -1
- package/dist/helpers/openapi.d.ts.map +1 -1
- package/dist/helpers/openapi.js +37 -6
- package/dist/helpers/openapi.js.map +1 -1
- package/dist/helpers/safe-deep-clone.js.map +1 -1
- package/dist/helpers/storage.d.ts +21 -2
- package/dist/helpers/storage.d.ts.map +1 -1
- package/dist/helpers/storage.js +14 -0
- package/dist/helpers/storage.js.map +1 -1
- package/dist/helpers/upload-temp-document.js.map +1 -1
- package/dist/hooks/use-agent.js.map +1 -1
- package/dist/hooks/use-intersection.js.map +1 -1
- package/dist/plugins/hooks/usePluginManager.js.map +1 -1
- package/dist/plugins/persistence-plugin.js +6 -1
- package/dist/plugins/persistence-plugin.js.map +1 -1
- package/dist/plugins/plugin-manager.js +35 -0
- package/dist/plugins/plugin-manager.js.map +1 -1
- package/dist/plugins/posthog/index.js.map +1 -1
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/standalone/lib/html-api.js +11 -4
- package/dist/standalone/lib/html-api.js.map +1 -1
- package/dist/standalone/lib/load-plugins-from-urls.d.ts +13 -0
- package/dist/standalone/lib/load-plugins-from-urls.d.ts.map +1 -0
- package/dist/standalone/lib/load-plugins-from-urls.js +60 -0
- package/dist/standalone/lib/load-plugins-from-urls.js.map +1 -0
- package/dist/style.css +1637 -1505
- package/dist/styles/print.css +118 -0
- package/dist/styles/tailwind.config.css +16 -0
- package/dist/vue-styles.css +1102 -1050
- package/package.json +29 -29
- package/dist/browser/chunks/AgentScalarChatInterface-YU9KKgvZ.js +0 -27
- package/dist/browser/chunks/ScalarTextInput.vue-B-Nhpn0q.js +0 -27
- package/dist/browser/chunks/browser-67K6wmG9.js +0 -129
- package/dist/browser/chunks/modal-BVUfMpuv.js +0 -15
- package/dist/browser/chunks/modal-WJ4Gcv8N.js +0 -99
- package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +0 -17
- package/dist/browser/chunks/vendor-BqFs9NIb.js +0 -306
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { pushDynamicScope } from '@scalar/workspace-store/helpers/dynamic-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, provide } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\nimport { scrollTargetId } from '@/helpers/lazy-bus'\n\nimport {\n resolveDynamicSchema,\n SCHEMA_DYNAMIC_SCOPE_SYMBOL,\n useDynamicScope,\n} from './helpers/dynamic-scope'\nimport { inferDiscriminatorMappingComposition } from './helpers/get-compositions-to-render'\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport SchemaComposition from './SchemaComposition.vue'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n}>()\nconst { translate } = useLocalization()\n\n/**\n * The dynamic scope inherited from ancestor schema resources.\n *\n * Used to bind JSON Schema 2020-12 `$dynamicRef`s to the active `$dynamicAnchor` while walking the\n * tree. Empty at the root. See {@link useDynamicScope}.\n */\nconst dynamicScope = useDynamicScope()\n\n/**\n * The schema this node actually renders.\n *\n * Two normalizations happen here, both no-ops for ordinary schemas:\n * - A top-level `$dynamicRef` is bound to its concrete type via the inherited dynamic scope.\n * - A resource that extends a template through a root `$ref` (JSON Schema 2020-12 `$ref` alongside\n * `$defs`, e.g. a `PaginatedResponse` binding) is merged so its inherited properties render.\n */\nconst resolvedSchema = computed((): SchemaObject | undefined => {\n if (!schema || typeof schema !== 'object') {\n return schema\n }\n\n const bound = resolveDynamicSchema(schema, dynamicScope)\n return '$ref' in bound ? resolve.schema(bound) : bound\n})\n\n/**\n * Re-provide the dynamic scope grown with this resource so nested `$dynamicRef`s bind here.\n *\n * Built once at setup from the resource's stable identity (like the ancestor set below);\n * `pushDynamicScope` only grows the scope for schemas that can carry a `$dynamicAnchor`.\n *\n * The raw schema is pushed, not the merged {@link resolvedSchema}: merging through `resolve.schema`\n * coerces the node and drops the resolved `$ref-value` from entries inside `$defs`, which\n * `$dynamicAnchor` resolution relies on to dereference the bound type (e.g. `User`).\n */\nconst scopeSchema = schema\n ? resolveDynamicSchema(schema, dynamicScope)\n : undefined\nprovide(\n SCHEMA_DYNAMIC_SCOPE_SYMBOL,\n scopeSchema ? pushDynamicScope(dynamicScope, scopeSchema) : dynamicScope,\n)\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => !noncollapsible && level > 0)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnScrollTargetPath = computed((): boolean => {\n if (!breadcrumb?.length) {\n return false\n }\n const path = breadcrumb.join('.')\n const target = scrollTargetId.value\n return target === path || target.startsWith(`${path}.`)\n})\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * Note: the Disclosure only reads this at mount, so it expands collapsed\n * properties on a fresh navigation (the schema mounts after the target is set),\n * not when the target changes for an already-mounted disclosure.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value,\n)\n\nconst childAttributesLabel = computed(\n (): string => schema?.title ?? translate('schema.childAttributes'),\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n const value = resolvedSchema.value\n\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the description of the merged allOf schema.\n // Merging keeps the base description (when set) and otherwise lets the last allOf\n // member win, matching how the merged composition is rendered below. The nested\n // merged Schema in `SchemaComposition` hides its own description in this case so\n // the text is not rendered twice.\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return mergeAllOfSchemas(schema)?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!value?.description || typeof value.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (value.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in value) &&\n !('patternProperties' in value) &&\n !('additionalProperties' in value)\n ) {\n return null\n }\n\n // Return the schema's own description\n return value.description\n})\n\n/**\n * Some generators (for example NSwag) describe a polymorphic base type as a\n * plain object with a `discriminator.mapping` but no explicit `oneOf`. We infer\n * the variant composition from the mapping so the selector still renders.\n *\n * The `discriminator` prop is only set when this schema is already a variant\n * being rendered inside a `SchemaComposition`; skipping the inference in that\n * case avoids re-inferring (and recursing) on a self-referential mapping.\n *\n * The inference is restricted to plain object schemas (`isTypeObject`). A schema\n * carrying its own composition keyword (`allOf`/`not`) is rendered by the\n * `SchemaProperty` branch below; inferring a selector there would replace that\n * keyword's output with the variant dropdown instead of rendering both.\n */\nconst inferredDiscriminatorComposition = computed(() =>\n schema && !discriminator && isTypeObject(schema)\n ? inferDiscriminatorMappingComposition(schema, options.document)\n : null,\n)\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => {\n if (noncollapsible) {\n e.stopPropagation()\n }\n}\n</script>\n<template>\n <Disclosure\n v-if=\"resolvedSchema && Object.keys(resolvedSchema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"defaultOpen\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(resolvedSchema)\"\n class=\"pt-2\">\n {{ translate('schema.emptyObject') }}\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n {{ translate('schema.showAdditionalProperties') }}\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n {{\n translate('schema.hideChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <template v-else>\n {{\n translate('schema.showChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"resolvedSchema?.title ?? name\"\n :value=\"resolvedSchema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Variant selector inferred from a discriminator mapping -->\n <SchemaComposition\n v-if=\"inferredDiscriminatorComposition\"\n :breadcrumb\n :compact\n composition=\"oneOf\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"schema?.discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level\"\n :name=\"name\"\n :options\n :schema=\"inferredDiscriminatorComposition\"\n :schemaContext=\"schemaContext\" />\n <!-- Object properties -->\n <SchemaObjectProperties\n v-else-if=\"isTypeObject(resolvedSchema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema=\"resolvedSchema\"\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"resolvedSchema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema=\"resolvedSchema\"\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsFA,MAAM,EAAE,cAAc,iBAAgB;;;;;;;EAQtC,MAAM,eAAe,iBAAgB;;;;;;;;;EAUrC,MAAM,iBAAiB,eAAyC;AAC9D,OAAI,CAAC,QAAA,UAAU,OAAO,QAAA,WAAW,SAC/B,QAAO,QAAA;GAGT,MAAM,QAAQ,qBAAqB,QAAA,QAAQ,aAAY;AACvD,UAAO,UAAU,QAAQ,QAAQ,OAAO,MAAM,GAAG;IAClD;;;;;;;;;;;EAYD,MAAM,cAAc,QAAA,SAChB,qBAAqB,QAAA,QAAQ,aAAY,GACzC,KAAA;AACJ,UACE,6BACA,cAAc,i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.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { pushDynamicScope } from '@scalar/workspace-store/helpers/dynamic-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, provide } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\nimport { scrollTargetId } from '@/helpers/lazy-bus'\n\nimport {\n resolveDynamicSchema,\n SCHEMA_DYNAMIC_SCOPE_SYMBOL,\n useDynamicScope,\n} from './helpers/dynamic-scope'\nimport { inferDiscriminatorMappingComposition } from './helpers/get-compositions-to-render'\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport SchemaComposition from './SchemaComposition.vue'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n}>()\nconst { translate } = useLocalization()\n\n/**\n * The dynamic scope inherited from ancestor schema resources.\n *\n * Used to bind JSON Schema 2020-12 `$dynamicRef`s to the active `$dynamicAnchor` while walking the\n * tree. Empty at the root. See {@link useDynamicScope}.\n */\nconst dynamicScope = useDynamicScope()\n\n/**\n * The schema this node actually renders.\n *\n * Two normalizations happen here, both no-ops for ordinary schemas:\n * - A top-level `$dynamicRef` is bound to its concrete type via the inherited dynamic scope.\n * - A resource that extends a template through a root `$ref` (JSON Schema 2020-12 `$ref` alongside\n * `$defs`, e.g. a `PaginatedResponse` binding) is merged so its inherited properties render.\n */\nconst resolvedSchema = computed((): SchemaObject | undefined => {\n if (!schema || typeof schema !== 'object') {\n return schema\n }\n\n const bound = resolveDynamicSchema(schema, dynamicScope)\n return '$ref' in bound ? resolve.schema(bound) : bound\n})\n\n/**\n * Re-provide the dynamic scope grown with this resource so nested `$dynamicRef`s bind here.\n *\n * Built once at setup from the resource's stable identity (like the ancestor set below);\n * `pushDynamicScope` only grows the scope for schemas that can carry a `$dynamicAnchor`.\n *\n * The raw schema is pushed, not the merged {@link resolvedSchema}: merging through `resolve.schema`\n * coerces the node and drops the resolved `$ref-value` from entries inside `$defs`, which\n * `$dynamicAnchor` resolution relies on to dereference the bound type (e.g. `User`).\n */\nconst scopeSchema = schema\n ? resolveDynamicSchema(schema, dynamicScope)\n : undefined\nprovide(\n SCHEMA_DYNAMIC_SCOPE_SYMBOL,\n scopeSchema ? pushDynamicScope(dynamicScope, scopeSchema) : dynamicScope,\n)\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => !noncollapsible && level > 0)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnScrollTargetPath = computed((): boolean => {\n if (!breadcrumb?.length) {\n return false\n }\n const path = breadcrumb.join('.')\n const target = scrollTargetId.value\n return target === path || target.startsWith(`${path}.`)\n})\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * Note: the Disclosure only reads this at mount, so it expands collapsed\n * properties on a fresh navigation (the schema mounts after the target is set),\n * not when the target changes for an already-mounted disclosure.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value,\n)\n\nconst childAttributesLabel = computed(\n (): string => schema?.title ?? translate('schema.childAttributes'),\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n const value = resolvedSchema.value\n\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the description of the merged allOf schema.\n // Merging keeps the base description (when set) and otherwise lets the last allOf\n // member win, matching how the merged composition is rendered below. The nested\n // merged Schema in `SchemaComposition` hides its own description in this case so\n // the text is not rendered twice.\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return mergeAllOfSchemas(schema)?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!value?.description || typeof value.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (value.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in value) &&\n !('patternProperties' in value) &&\n !('additionalProperties' in value)\n ) {\n return null\n }\n\n // Return the schema's own description\n return value.description\n})\n\n/**\n * Infer a selector for mapped discriminators that do not declare `oneOf`.\n * Threaded discriminators skip inference to avoid recursive allOf variants.\n */\nconst inferredDiscriminatorComposition = computed(() =>\n schema && !discriminator && isTypeObject(schema)\n ? inferDiscriminatorMappingComposition(schema, options.document)\n : null,\n)\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => {\n if (noncollapsible) {\n e.stopPropagation()\n }\n}\n</script>\n<template>\n <Disclosure\n v-if=\"resolvedSchema && Object.keys(resolvedSchema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"defaultOpen\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(resolvedSchema)\"\n class=\"pt-2\">\n {{ translate('schema.emptyObject') }}\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n {{ translate('schema.showAdditionalProperties') }}\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n {{\n translate('schema.hideChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <template v-else>\n {{\n translate('schema.showChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"resolvedSchema?.title ?? name\"\n :value=\"resolvedSchema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Variant selector inferred from a discriminator mapping -->\n <SchemaComposition\n v-if=\"inferredDiscriminatorComposition\"\n :breadcrumb\n :compact\n composition=\"oneOf\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"schema?.discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level\"\n :name=\"name\"\n :options\n :schema=\"inferredDiscriminatorComposition\"\n :schemaContext=\"schemaContext\" />\n <!-- Object properties -->\n <SchemaObjectProperties\n v-else-if=\"isTypeObject(resolvedSchema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema=\"resolvedSchema\"\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"resolvedSchema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema=\"resolvedSchema\"\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsFA,MAAM,EAAE,cAAc,gBAAgB;;;;;;;EAQtC,MAAM,eAAe,gBAAgB;;;;;;;;;EAUrC,MAAM,iBAAiB,eAAyC;GAC9D,IAAI,CAAC,QAAA,UAAU,OAAO,QAAA,WAAW,UAC/B,OAAO,QAAA;GAGT,MAAM,QAAQ,qBAAqB,QAAA,QAAQ,YAAY;GACvD,OAAO,UAAU,QAAQ,QAAQ,OAAO,KAAK,IAAI;EACnD,CAAC;;;;;;;;;;;EAYD,MAAM,cAAc,QAAA,SAChB,qBAAqB,QAAA,QAAQ,YAAY,IACzC,KAAA;EACJ,QACE,6BACA,cAAc,iBAAiB,cAAc,WAAW,IAAI,YAC9D;;;;;;;;;;;EAYA,MAAM,YAAY,OAAO,yBAAyB,KAAA,CAAS;EAE3D,MAAM,WAAW,eACA,QAAA,YAAY,QAAQ,CAAC,CAAC,WAAW,IAAI,QAAA,QAAQ,CAC9D;EAIA,MAAM,iBAAiB,IAAI,IAAa,aAAa,CAAC,CAAC;EACvD,IAAI,QAAA,YAAY,MACd,eAAe,IAAI,QAAA,QAAQ;EAE7B,QAAQ,yBAAyB,cAAc;EAE/C,MAAM,oBAAoB,eACT,CAAC,CAAC,QAAA,QAAQ,6BAA6B,CAAC,SAAS,KAClE;;;;;EAMA,MAAM,mBAAmB,eAAwB,CAAC,QAAA,kBAAkB,QAAA,QAAQ,CAAC;;;;;;;;;EAU7E,MAAM,uBAAuB,eAAwB;GACnD,IAAI,CAAC,QAAA,YAAY,QACf,OAAO;GAET,MAAM,OAAO,QAAA,WA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U,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAO,QAAA;OACP,MAAM,QAAA;OACN,SAAA,QAAA;OACA,QAAQ,iCAAA;OACR,eAAe,QAAA;;;;;;;;;;;;;;YAGL,MAAA,YAAA,CAAY,CAAC,eAAA,KAAc,KAAA,UAAA,GADxC,YAYmC,gCAAA;;OAVhC,YAAA,QAAA;OACA,SAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,eAAA,QAAA;OACA,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAO,QAAA,QAAK;OACZ,SAAA,QAAA;OACA,QAAQ,eAAA;OACR,eAAe,QAAA;;;;;;;;;;;;;0BAElB,mBAcW,UAAA,EAAA,KAAA,EAAA,GAAA,CAZD,eAAA,SAAA,UAAA,GADR,YAYmC,wBAAA;;OAVhC,YAAA,QAAA;OACA,SAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,eAAA,QAAA;OACA,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAA,QAAA;OACA,SAAA,QAAA;OACA,QAAQ,eAAA;OACR,eAAe,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AA6UA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAStE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAKtE,KAAK,WAAW,GAAG;IACf,oDAAoD;IACpD,WAAW,EAAE,kBAAkB,CAAA;IAC/B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,MAAM,EAAE,YAAY,CAAA;IACpB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,iCAAiC;IACjC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,yEAAyE;IACzE,OAAO,EAAE,aAAa,CAAA;IACtB,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,CAAC;AAmbJ,QAAA,MAAM,YAAY;aAlcJ,OAAO;iBAEH,OAAO;6EAmcvB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaComposition.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, ref, watch } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport { useLocalization } from '@/features/localization'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { type CompositionKeyword } from './helpers/schema-composition'\nimport { getCycleKey } from './helpers/schema-cycle'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport Schema from './Schema.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** The composition keyword (oneOf, anyOf, allOf) */\n composition: CompositionKeyword\n /** Optional discriminator object for polymorphic schemas */\n discriminator?: DiscriminatorObject\n /** Optional name for the schema */\n name?: string\n /** The schema value containing the composition */\n schema: SchemaObject\n /** Nesting level for proper indentation */\n level: number\n /** Whether to use compact layout */\n compact?: boolean\n /** Whether to hide the heading */\n hideHeading?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Breadcrumb for navigation */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", sync selected index with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n }>(),\n {\n compact: false,\n hideHeading: false,\n },\n)\nconst { translate } = useLocalization()\n\n/** The current composition */\nconst composition = computed(() =>\n [props.schema[props.composition]]\n .flat()\n .map((schema) => ({ value: resolve.schema(schema), original: schema }))\n .filter((it) => isDefined(it.value)),\n)\n\n/**\n * Generate listbox options for the composition selector.\n * Each option represents a schema in the composition with a human-readable label.\n * Prefers schema title/name over structural type when present.\n */\nconst listboxOptions = computed((): ScalarListboxOption[] =>\n composition.value.map((schema, index: number) => {\n const resolved = resolve.schema(schema.original!)\n const label =\n (getModelNameFromSchema(resolved)?.label ?? getSchemaType(resolved)) ||\n translate('schema.schema')\n return { id: String(index), label }\n }),\n)\n\nconst compositionSelectionKey = computed(() =>\n props.compositionPath?.length\n ? [...props.compositionPath, props.composition].join('.')\n : '',\n)\n\n/** When this composition is in the request body, sync selection with the example snippet */\nconst requestBodyCompositionSelectionRef = inject(\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n undefined,\n)\n\nconst initialSelectedIndex = computed(() => {\n if (\n props.schemaContext !== 'requestBody' ||\n !requestBodyCompositionSelectionRef?.value ||\n !compositionSelectionKey.value\n ) {\n return 0\n }\n\n const selectedIndex =\n requestBodyCompositionSelectionRef.value[compositionSelectionKey.value]\n\n if (typeof selectedIndex !== 'number' || Number.isNaN(selectedIndex)) {\n return 0\n }\n\n return Math.max(0, Math.min(selectedIndex, listboxOptions.value.length - 1))\n})\n\n/**\n * Two-way computed property for the selected option.\n * Handles conversion between the selected index and the listbox option format.\n */\nconst selectedOption = ref<ScalarListboxOption | undefined>()\n\nwatch(\n [listboxOptions, initialSelectedIndex],\n ([options, selectedIndex]) => {\n if (\n !selectedOption.value ||\n !options.some((option) => option.id === selectedOption.value?.id)\n ) {\n selectedOption.value = options[selectedIndex] ?? options[0]\n }\n },\n { immediate: true },\n)\n\nconst compositionLabel = (type: CompositionKeyword): string =>\n translate(`schema.${type}`)\n\n/** Inside the currently selected composition */\nconst selectedComposition = computed(\n () => composition.value[Number(selectedOption.value?.id ?? '0')]?.value,\n)\n\n/**\n * The request body card renders the merged `allOf` description on its outer card\n * (see `Schema.vue`), but only for the top-level request body schema. For that\n * single composition we hide the nested merged `Schema`'s description so the text\n * is not shown twice. Nested request-body compositions (deeper properties) are\n * not shown on the outer card and would otherwise lose their description\n * entirely, because the property row already skips it when `allOf` is present.\n *\n * The top-level request body composition is the one whose `compositionPath` is\n * still the request body root (`['requestBody']`); nested compositions append\n * property segments and therefore have a longer path.\n */\nconst isRequestBodyRootComposition = computed(\n () =>\n props.schemaContext === 'requestBody' &&\n props.compositionPath?.length === 1,\n)\n\n/**\n * Cycle key for the selected composition member, derived from its raw\n * (unresolved) value so a member that references an ancestor is detected as a\n * cycle.\n */\nconst selectedCompositionCycleKey = computed(() =>\n getCycleKey(\n composition.value[Number(selectedOption.value?.id ?? '0')]?.original,\n ),\n)\n\n/**\n * Controls whether the nested schema is displayed. When expanding all schema\n * properties we open it by default; the nested Schema handles cycle detection,\n * so finite compositions render fully while recursive ones still stop.\n */\nconst showNestedSchema = ref(!!props.options.expandAllSchemaProperties)\n\nif (\n requestBodyCompositionSelectionRef &&\n props.schemaContext === 'requestBody' &&\n compositionSelectionKey.value\n) {\n watch(\n selectedOption,\n (option) => {\n const index = option ? Number(option.id) : 0\n if (!Number.isNaN(index)) {\n requestBodyCompositionSelectionRef.value = {\n ...requestBodyCompositionSelectionRef.value,\n [compositionSelectionKey.value]: index,\n } satisfies RequestBodyCompositionSelection\n }\n },\n { immediate: true },\n )\n}\n</script>\n\n<template>\n <div class=\"property-rule\">\n <!-- We merge allOf schemas into a single schema -->\n <Schema\n v-if=\"props.composition === 'allOf'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideDescription=\"isRequestBodyRootComposition\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"mergeAllOfSchemas(schema)\"\n :schemaContext=\"schemaContext\" />\n\n <template v-else>\n <!-- Composition selector and panel for nested compositions -->\n <ScalarListbox\n v-model=\"selectedOption\"\n :options=\"listboxOptions\"\n resize>\n <button\n class=\"composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border px-2.5 py-2.5 pr-3 text-left\"\n type=\"button\">\n <span class=\"text-c-2\">{{\n compositionLabel(props.composition)\n }}</span>\n <span\n class=\"composition-selector-label text-c-1\"\n :class=\"{\n 'line-through': selectedComposition?.deprecated,\n }\">\n {{ selectedOption?.label || translate('schema.schema') }}\n </span>\n <div\n v-if=\"selectedComposition?.deprecated\"\n class=\"text-red\">\n {{ translate('common.deprecated') }}\n </div>\n <ScalarIconCaretDown />\n </button>\n </ScalarListbox>\n\n <div class=\"composition-panel\">\n <!-- Button to toggle nested schema display -->\n <button\n v-if=\"!showNestedSchema && level > 2\"\n class=\"bg-b-1 hover:bg-b-2 text-c-1 flex w-full items-center justify-center gap-2 rounded-b-lg border border-t-0 px-2 py-2 text-sm font-medium transition-colors\"\n type=\"button\"\n @click=\"showNestedSchema = true\">\n {{ translate('schema.showSchemaDetails') }}\n <ScalarIconCaretDown class=\"h-3 w-3\" />\n </button>\n\n <!-- Render the selected schema if it has content to display -->\n <Schema\n v-else\n :key=\"selectedOption?.id ?? '0'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :cycleKey=\"selectedCompositionCycleKey\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"selectedComposition\"\n :schemaContext=\"schemaContext\" />\n </div>\n </template>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"SchemaComposition.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, ref, watch } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport { useLocalization } from '@/features/localization'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { partitionAllOfCompositions } from './helpers/partition-all-of-compositions'\nimport { type CompositionKeyword } from './helpers/schema-composition'\nimport { getCycleKey } from './helpers/schema-cycle'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport Schema from './Schema.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** The composition keyword (oneOf, anyOf, allOf) */\n composition: CompositionKeyword\n /** Optional discriminator object for polymorphic schemas */\n discriminator?: DiscriminatorObject\n /** Optional name for the schema */\n name?: string\n /** The schema value containing the composition */\n schema: SchemaObject\n /** Nesting level for proper indentation */\n level: number\n /** Whether to use compact layout */\n compact?: boolean\n /** Whether to hide the heading */\n hideHeading?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Breadcrumb for navigation */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", sync selected index with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n }>(),\n {\n compact: false,\n hideHeading: false,\n },\n)\nconst { translate } = useLocalization()\n\n/**\n * Split an `allOf` into an ordered list of segments (object chunks + choice\n * pickers) so multiple mutually-exclusive selections each render their own\n * picker, in the position they were declared, instead of all but the first\n * being dropped and the rest bubbling to the end.\n */\nconst allOfSegments = computed(() =>\n props.composition === 'allOf'\n ? partitionAllOfCompositions(props.schema).segments\n : [],\n)\n\n/** The current composition */\nconst composition = computed(() =>\n [props.schema[props.composition]]\n .flat()\n .map((schema) => ({ value: resolve.schema(schema), original: schema }))\n .filter((it) => isDefined(it.value)),\n)\n\n/**\n * Generate listbox options for the composition selector.\n * Each option represents a schema in the composition with a human-readable label.\n * Prefers schema title/name over structural type when present.\n */\nconst listboxOptions = computed((): ScalarListboxOption[] =>\n composition.value.map((schema, index: number) => {\n const resolved = resolve.schema(schema.original!)\n const label =\n (getModelNameFromSchema(resolved)?.label ?? getSchemaType(resolved)) ||\n translate('schema.schema')\n return { id: String(index), label }\n }),\n)\n\nconst compositionSelectionKey = computed(() =>\n props.compositionPath?.length\n ? [...props.compositionPath, props.composition].join('.')\n : '',\n)\n\n/** When this composition is in the request body, sync selection with the example snippet */\nconst requestBodyCompositionSelectionRef = inject(\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n undefined,\n)\n\nconst initialSelectedIndex = computed(() => {\n if (\n props.schemaContext !== 'requestBody' ||\n !requestBodyCompositionSelectionRef?.value ||\n !compositionSelectionKey.value\n ) {\n return 0\n }\n\n const selectedIndex =\n requestBodyCompositionSelectionRef.value[compositionSelectionKey.value]\n\n if (typeof selectedIndex !== 'number' || Number.isNaN(selectedIndex)) {\n return 0\n }\n\n return Math.max(0, Math.min(selectedIndex, listboxOptions.value.length - 1))\n})\n\n/**\n * Two-way computed property for the selected option.\n * Handles conversion between the selected index and the listbox option format.\n */\nconst selectedOption = ref<ScalarListboxOption | undefined>()\n\nwatch(\n [listboxOptions, initialSelectedIndex],\n ([options, selectedIndex]) => {\n if (\n !selectedOption.value ||\n !options.some((option) => option.id === selectedOption.value?.id)\n ) {\n selectedOption.value = options[selectedIndex] ?? options[0]\n }\n },\n { immediate: true },\n)\n\nconst compositionLabel = (type: CompositionKeyword): string =>\n translate(`schema.${type}`)\n\n/** Inside the currently selected composition */\nconst selectedComposition = computed(\n () => composition.value[Number(selectedOption.value?.id ?? '0')]?.value,\n)\n\n/**\n * The request body card renders the merged `allOf` description on its outer card\n * (see `Schema.vue`), but only for the top-level request body schema. For that\n * single composition we hide the nested merged `Schema`'s description so the text\n * is not shown twice. Nested request-body compositions (deeper properties) are\n * not shown on the outer card and would otherwise lose their description\n * entirely, because the property row already skips it when `allOf` is present.\n *\n * The top-level request body composition is the one whose `compositionPath` is\n * still the request body root (`['requestBody']`); nested compositions append\n * property segments and therefore have a longer path.\n */\nconst isRequestBodyRootComposition = computed(\n () =>\n props.schemaContext === 'requestBody' &&\n props.compositionPath?.length === 1,\n)\n\n/**\n * Cycle key for the selected composition member, derived from its raw\n * (unresolved) value so a member that references an ancestor is detected as a\n * cycle.\n */\nconst selectedCompositionCycleKey = computed(() =>\n getCycleKey(\n composition.value[Number(selectedOption.value?.id ?? '0')]?.original,\n ),\n)\n\n/**\n * Controls whether the nested schema is displayed. When expanding all schema\n * properties we open it by default; the nested Schema handles cycle detection,\n * so finite compositions render fully while recursive ones still stop.\n */\nconst showNestedSchema = ref(!!props.options.expandAllSchemaProperties)\n\nif (\n requestBodyCompositionSelectionRef &&\n props.schemaContext === 'requestBody' &&\n compositionSelectionKey.value\n) {\n watch(\n selectedOption,\n (option) => {\n const index = option ? Number(option.id) : 0\n if (!Number.isNaN(index)) {\n requestBodyCompositionSelectionRef.value = {\n ...requestBodyCompositionSelectionRef.value,\n [compositionSelectionKey.value]: index,\n } satisfies RequestBodyCompositionSelection\n }\n },\n { immediate: true },\n )\n}\n</script>\n\n<template>\n <div class=\"property-rule\">\n <!--\n allOf: render the members in source order — object chunks as fields, each\n oneOf/anyOf group as its own picker in place. Keeps every mutually-exclusive\n selection (mergeAllOfSchemas alone drops all but the first) and preserves the\n position of each choice group among the surrounding fields, flowing inline\n with them as one continuous list (no extra spacing or card).\n -->\n <template v-if=\"props.composition === 'allOf'\">\n <template\n v-for=\"(segment, segmentIndex) in allOfSegments\"\n :key=\"segmentIndex\">\n <Schema\n v-if=\"segment.kind === 'object'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideDescription=\"isRequestBodyRootComposition\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"segment.schema\"\n :schemaContext=\"schemaContext\" />\n <SchemaComposition\n v-else\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :composition=\"segment.composition\"\n :compositionPath=\"[\n ...(compositionPath ?? []),\n String(segment.choiceIndex),\n ]\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level\"\n :options=\"options\"\n :schema=\"segment.value\"\n :schemaContext=\"schemaContext\" />\n </template>\n </template>\n\n <template v-else>\n <!-- Composition selector + selected branch -->\n <ScalarListbox\n v-model=\"selectedOption\"\n :options=\"listboxOptions\"\n resize>\n <button\n class=\"composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border px-2.5 py-2.5 pr-3 text-left\"\n type=\"button\">\n <span class=\"text-c-2\">{{\n compositionLabel(props.composition)\n }}</span>\n <span\n class=\"composition-selector-label text-c-1\"\n :class=\"{\n 'line-through': selectedComposition?.deprecated,\n }\">\n {{ selectedOption?.label || translate('schema.schema') }}\n </span>\n <div\n v-if=\"selectedComposition?.deprecated\"\n class=\"text-red\">\n {{ translate('common.deprecated') }}\n </div>\n <ScalarIconCaretDown />\n </button>\n </ScalarListbox>\n\n <div class=\"composition-panel\">\n <!-- Button to toggle nested schema display -->\n <button\n v-if=\"!showNestedSchema && level > 2\"\n class=\"bg-b-1 hover:bg-b-2 text-c-1 flex w-full items-center justify-center gap-2 rounded-b-lg border border-t-0 px-2 py-2 text-sm font-medium transition-colors\"\n type=\"button\"\n @click=\"showNestedSchema = true\">\n {{ translate('schema.showSchemaDetails') }}\n <ScalarIconCaretDown class=\"h-3 w-3\" />\n </button>\n\n <!-- Render the selected schema if it has content to display -->\n <Schema\n v-else\n :key=\"selectedOption?.id ?? '0'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :cycleKey=\"selectedCompositionCycleKey\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"selectedComposition\"\n :schemaContext=\"schemaContext\" />\n </div>\n </template>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useLocalization } from "../../../features/localization/use-localization.js";
|
|
2
|
-
import { mergeAllOfSchemas } from "./helpers/merge-all-of-schemas.js";
|
|
3
2
|
import { getCycleKey } from "./helpers/schema-cycle.js";
|
|
4
3
|
import { REQUEST_BODY_COMPOSITION_INDEX_SYMBOL } from "../../../features/Operation/request-body-composition-index.js";
|
|
5
4
|
import { getSchemaType } from "./helpers/get-schema-type.js";
|
|
5
|
+
import { partitionAllOfCompositions } from "./helpers/partition-all-of-compositions.js";
|
|
6
6
|
import { getModelNameFromSchema } from "./helpers/schema-name.js";
|
|
7
7
|
import Schema_default from "./Schema.vue.js";
|
|
8
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, normalizeClass, openBlock, ref, toDisplayString, unref, watch, withCtx } from "vue";
|
|
8
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, normalizeClass, openBlock, ref, renderList, resolveComponent, toDisplayString, unref, watch, withCtx } from "vue";
|
|
9
9
|
import { ScalarListbox } from "@scalar/components/listbox";
|
|
10
10
|
import { ScalarIconCaretDown } from "@scalar/icons";
|
|
11
11
|
import { resolve } from "@scalar/workspace-store/resolve";
|
|
@@ -22,7 +22,7 @@ var _hoisted_4 = {
|
|
|
22
22
|
class: "text-red"
|
|
23
23
|
};
|
|
24
24
|
var _hoisted_5 = { class: "composition-panel" };
|
|
25
|
-
var SchemaComposition_vue_vue_type_script_setup_true_lang_default =
|
|
25
|
+
var SchemaComposition_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
26
26
|
__name: "SchemaComposition",
|
|
27
27
|
props: {
|
|
28
28
|
composition: {},
|
|
@@ -48,6 +48,13 @@ var SchemaComposition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
48
48
|
setup(__props) {
|
|
49
49
|
const props = __props;
|
|
50
50
|
const { translate } = useLocalization();
|
|
51
|
+
/**
|
|
52
|
+
* Split an `allOf` into an ordered list of segments (object chunks + choice
|
|
53
|
+
* pickers) so multiple mutually-exclusive selections each render their own
|
|
54
|
+
* picker, in the position they were declared, instead of all but the first
|
|
55
|
+
* being dropped and the rest bubbling to the end.
|
|
56
|
+
*/
|
|
57
|
+
const allOfSegments = computed(() => props.composition === "allOf" ? partitionAllOfCompositions(props.schema).segments : []);
|
|
51
58
|
/** The current composition */
|
|
52
59
|
const composition = computed(() => [props.schema[props.composition]].flat().map((schema) => ({
|
|
53
60
|
value: resolve.schema(schema),
|
|
@@ -119,37 +126,65 @@ var SchemaComposition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
119
126
|
};
|
|
120
127
|
}, { immediate: true });
|
|
121
128
|
return (_ctx, _cache) => {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
129
|
+
const _component_SchemaComposition = resolveComponent("SchemaComposition", true);
|
|
130
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [props.composition === "allOf" ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(allOfSegments.value, (segment, segmentIndex) => {
|
|
131
|
+
return openBlock(), createElementBlock(Fragment, { key: segmentIndex }, [segment.kind === "object" ? (openBlock(), createBlock(Schema_default, {
|
|
132
|
+
key: 0,
|
|
133
|
+
breadcrumb: __props.breadcrumb,
|
|
134
|
+
compact: __props.compact,
|
|
135
|
+
compositionPath: __props.compositionPath,
|
|
136
|
+
discriminator: __props.discriminator,
|
|
137
|
+
eventBus: __props.eventBus,
|
|
138
|
+
hideDescription: isRequestBodyRootComposition.value,
|
|
139
|
+
hideHeading: __props.hideHeading,
|
|
140
|
+
hideModelNames: __props.hideModelNames,
|
|
141
|
+
level: __props.level + 1,
|
|
142
|
+
name: __props.name,
|
|
143
|
+
noncollapsible: true,
|
|
144
|
+
options: __props.options,
|
|
145
|
+
schema: segment.schema,
|
|
146
|
+
schemaContext: __props.schemaContext
|
|
147
|
+
}, null, 8, [
|
|
148
|
+
"breadcrumb",
|
|
149
|
+
"compact",
|
|
150
|
+
"compositionPath",
|
|
151
|
+
"discriminator",
|
|
152
|
+
"eventBus",
|
|
153
|
+
"hideDescription",
|
|
154
|
+
"hideHeading",
|
|
155
|
+
"hideModelNames",
|
|
156
|
+
"level",
|
|
157
|
+
"name",
|
|
158
|
+
"options",
|
|
159
|
+
"schema",
|
|
160
|
+
"schemaContext"
|
|
161
|
+
])) : (openBlock(), createBlock(_component_SchemaComposition, {
|
|
162
|
+
key: 1,
|
|
163
|
+
breadcrumb: __props.breadcrumb,
|
|
164
|
+
compact: __props.compact,
|
|
165
|
+
composition: segment.composition,
|
|
166
|
+
compositionPath: [...__props.compositionPath ?? [], String(segment.choiceIndex)],
|
|
167
|
+
eventBus: __props.eventBus,
|
|
168
|
+
hideHeading: __props.hideHeading,
|
|
169
|
+
hideModelNames: __props.hideModelNames,
|
|
170
|
+
level: __props.level,
|
|
171
|
+
options: __props.options,
|
|
172
|
+
schema: segment.value,
|
|
173
|
+
schemaContext: __props.schemaContext
|
|
174
|
+
}, null, 8, [
|
|
175
|
+
"breadcrumb",
|
|
176
|
+
"compact",
|
|
177
|
+
"composition",
|
|
178
|
+
"compositionPath",
|
|
179
|
+
"eventBus",
|
|
180
|
+
"hideHeading",
|
|
181
|
+
"hideModelNames",
|
|
182
|
+
"level",
|
|
183
|
+
"options",
|
|
184
|
+
"schema",
|
|
185
|
+
"schemaContext"
|
|
186
|
+
]))], 64);
|
|
187
|
+
}), 128)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(unref(ScalarListbox), {
|
|
153
188
|
modelValue: selectedOption.value,
|
|
154
189
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedOption.value = $event),
|
|
155
190
|
options: listboxOptions.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaComposition.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, ref, watch } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport { useLocalization } from '@/features/localization'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { type CompositionKeyword } from './helpers/schema-composition'\nimport { getCycleKey } from './helpers/schema-cycle'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport Schema from './Schema.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** The composition keyword (oneOf, anyOf, allOf) */\n composition: CompositionKeyword\n /** Optional discriminator object for polymorphic schemas */\n discriminator?: DiscriminatorObject\n /** Optional name for the schema */\n name?: string\n /** The schema value containing the composition */\n schema: SchemaObject\n /** Nesting level for proper indentation */\n level: number\n /** Whether to use compact layout */\n compact?: boolean\n /** Whether to hide the heading */\n hideHeading?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Breadcrumb for navigation */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", sync selected index with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n }>(),\n {\n compact: false,\n hideHeading: false,\n },\n)\nconst { translate } = useLocalization()\n\n/** The current composition */\nconst composition = computed(() =>\n [props.schema[props.composition]]\n .flat()\n .map((schema) => ({ value: resolve.schema(schema), original: schema }))\n .filter((it) => isDefined(it.value)),\n)\n\n/**\n * Generate listbox options for the composition selector.\n * Each option represents a schema in the composition with a human-readable label.\n * Prefers schema title/name over structural type when present.\n */\nconst listboxOptions = computed((): ScalarListboxOption[] =>\n composition.value.map((schema, index: number) => {\n const resolved = resolve.schema(schema.original!)\n const label =\n (getModelNameFromSchema(resolved)?.label ?? getSchemaType(resolved)) ||\n translate('schema.schema')\n return { id: String(index), label }\n }),\n)\n\nconst compositionSelectionKey = computed(() =>\n props.compositionPath?.length\n ? [...props.compositionPath, props.composition].join('.')\n : '',\n)\n\n/** When this composition is in the request body, sync selection with the example snippet */\nconst requestBodyCompositionSelectionRef = inject(\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n undefined,\n)\n\nconst initialSelectedIndex = computed(() => {\n if (\n props.schemaContext !== 'requestBody' ||\n !requestBodyCompositionSelectionRef?.value ||\n !compositionSelectionKey.value\n ) {\n return 0\n }\n\n const selectedIndex =\n requestBodyCompositionSelectionRef.value[compositionSelectionKey.value]\n\n if (typeof selectedIndex !== 'number' || Number.isNaN(selectedIndex)) {\n return 0\n }\n\n return Math.max(0, Math.min(selectedIndex, listboxOptions.value.length - 1))\n})\n\n/**\n * Two-way computed property for the selected option.\n * Handles conversion between the selected index and the listbox option format.\n */\nconst selectedOption = ref<ScalarListboxOption | undefined>()\n\nwatch(\n [listboxOptions, initialSelectedIndex],\n ([options, selectedIndex]) => {\n if (\n !selectedOption.value ||\n !options.some((option) => option.id === selectedOption.value?.id)\n ) {\n selectedOption.value = options[selectedIndex] ?? options[0]\n }\n },\n { immediate: true },\n)\n\nconst compositionLabel = (type: CompositionKeyword): string =>\n translate(`schema.${type}`)\n\n/** Inside the currently selected composition */\nconst selectedComposition = computed(\n () => composition.value[Number(selectedOption.value?.id ?? '0')]?.value,\n)\n\n/**\n * The request body card renders the merged `allOf` description on its outer card\n * (see `Schema.vue`), but only for the top-level request body schema. For that\n * single composition we hide the nested merged `Schema`'s description so the text\n * is not shown twice. Nested request-body compositions (deeper properties) are\n * not shown on the outer card and would otherwise lose their description\n * entirely, because the property row already skips it when `allOf` is present.\n *\n * The top-level request body composition is the one whose `compositionPath` is\n * still the request body root (`['requestBody']`); nested compositions append\n * property segments and therefore have a longer path.\n */\nconst isRequestBodyRootComposition = computed(\n () =>\n props.schemaContext === 'requestBody' &&\n props.compositionPath?.length === 1,\n)\n\n/**\n * Cycle key for the selected composition member, derived from its raw\n * (unresolved) value so a member that references an ancestor is detected as a\n * cycle.\n */\nconst selectedCompositionCycleKey = computed(() =>\n getCycleKey(\n composition.value[Number(selectedOption.value?.id ?? '0')]?.original,\n ),\n)\n\n/**\n * Controls whether the nested schema is displayed. When expanding all schema\n * properties we open it by default; the nested Schema handles cycle detection,\n * so finite compositions render fully while recursive ones still stop.\n */\nconst showNestedSchema = ref(!!props.options.expandAllSchemaProperties)\n\nif (\n requestBodyCompositionSelectionRef &&\n props.schemaContext === 'requestBody' &&\n compositionSelectionKey.value\n) {\n watch(\n selectedOption,\n (option) => {\n const index = option ? Number(option.id) : 0\n if (!Number.isNaN(index)) {\n requestBodyCompositionSelectionRef.value = {\n ...requestBodyCompositionSelectionRef.value,\n [compositionSelectionKey.value]: index,\n } satisfies RequestBodyCompositionSelection\n }\n },\n { immediate: true },\n )\n}\n</script>\n\n<template>\n <div class=\"property-rule\">\n <!-- We merge allOf schemas into a single schema -->\n <Schema\n v-if=\"props.composition === 'allOf'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideDescription=\"isRequestBodyRootComposition\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"mergeAllOfSchemas(schema)\"\n :schemaContext=\"schemaContext\" />\n\n <template v-else>\n <!-- Composition selector and panel for nested compositions -->\n <ScalarListbox\n v-model=\"selectedOption\"\n :options=\"listboxOptions\"\n resize>\n <button\n class=\"composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border px-2.5 py-2.5 pr-3 text-left\"\n type=\"button\">\n <span class=\"text-c-2\">{{\n compositionLabel(props.composition)\n }}</span>\n <span\n class=\"composition-selector-label text-c-1\"\n :class=\"{\n 'line-through': selectedComposition?.deprecated,\n }\">\n {{ selectedOption?.label || translate('schema.schema') }}\n </span>\n <div\n v-if=\"selectedComposition?.deprecated\"\n class=\"text-red\">\n {{ translate('common.deprecated') }}\n </div>\n <ScalarIconCaretDown />\n </button>\n </ScalarListbox>\n\n <div class=\"composition-panel\">\n <!-- Button to toggle nested schema display -->\n <button\n v-if=\"!showNestedSchema && level > 2\"\n class=\"bg-b-1 hover:bg-b-2 text-c-1 flex w-full items-center justify-center gap-2 rounded-b-lg border border-t-0 px-2 py-2 text-sm font-medium transition-colors\"\n type=\"button\"\n @click=\"showNestedSchema = true\">\n {{ translate('schema.showSchemaDetails') }}\n <ScalarIconCaretDown class=\"h-3 w-3\" />\n </button>\n\n <!-- Render the selected schema if it has content to display -->\n <Schema\n v-else\n :key=\"selectedOption?.id ?? '0'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :cycleKey=\"selectedCompositionCycleKey\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"selectedComposition\"\n :schemaContext=\"schemaContext\" />\n </div>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,QAAQ;EAkCd,MAAM,EAAE,cAAc,iBAAgB;;EAGtC,MAAM,cAAc,eAClB,CAAC,MAAM,OAAO,MAAM,aAAY,CAC7B,MAAK,CACL,KAAK,YAAY;GAAE,OAAO,QAAQ,OAAO,OAAO;GAAE,UAAU;GAAQ,EAAC,CACrE,QAAQ,OAAO,UAAU,GAAG,MAAM,CAAC,CACxC;;;;;;EAOA,MAAM,iBAAiB,eACrB,YAAY,MAAM,KAAK,QAAQ,UAAkB;GAC/C,MAAM,WAAW,QAAQ,OAAO,OAAO,SAAS;GAChD,MAAM,SACH,uBAAuB,SAAS,EAAE,SAAS,cAAc,SAAS,KACnE,UAAU,gBAAe;AAC3B,UAAO;IAAE,IAAI,OAAO,MAAM;IAAE;IAAM;IAClC,CACJ;EAEA,MAAM,0BAA0B,eAC9B,MAAM,iBAAiB,SACnB,CAAC,GAAG,MAAM,iBAAiB,MAAM,YAAY,CAAC,KAAK,IAAG,GACtD,GACN;;EAGA,MAAM,qCAAqC,OACzC,uCACA,KAAA,EACF;EAEA,MAAM,uBAAuB,eAAe;AAC1C,OACE,MAAM,kBAAkB,iBACxB,CAAC,oCAAoC,SACrC,CAAC,wBAAwB,MAEzB,QAAO;GAGT,MAAM,gBACJ,mCAAmC,MAAM,wBAAwB;AAEnE,OAAI,OAAO,kBAAkB,YAAY,OAAO,MAAM,cAAc,CAClE,QA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,gBAAA,QAAA;IACA,OAAO,QAAA,QAAK;IACZ,MAAM,QAAA;IACN,gBAAgB;IAChB,SAAS,QAAA;IACT,QAAQ,oBAAA;IACR,eAAe,QAAA"}
|
|
1
|
+
{"version":3,"file":"SchemaComposition.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, ref, watch } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport { useLocalization } from '@/features/localization'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { partitionAllOfCompositions } from './helpers/partition-all-of-compositions'\nimport { type CompositionKeyword } from './helpers/schema-composition'\nimport { getCycleKey } from './helpers/schema-cycle'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport Schema from './Schema.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** The composition keyword (oneOf, anyOf, allOf) */\n composition: CompositionKeyword\n /** Optional discriminator object for polymorphic schemas */\n discriminator?: DiscriminatorObject\n /** Optional name for the schema */\n name?: string\n /** The schema value containing the composition */\n schema: SchemaObject\n /** Nesting level for proper indentation */\n level: number\n /** Whether to use compact layout */\n compact?: boolean\n /** Whether to hide the heading */\n hideHeading?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Breadcrumb for navigation */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", sync selected index with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n }>(),\n {\n compact: false,\n hideHeading: false,\n },\n)\nconst { translate } = useLocalization()\n\n/**\n * Split an `allOf` into an ordered list of segments (object chunks + choice\n * pickers) so multiple mutually-exclusive selections each render their own\n * picker, in the position they were declared, instead of all but the first\n * being dropped and the rest bubbling to the end.\n */\nconst allOfSegments = computed(() =>\n props.composition === 'allOf'\n ? partitionAllOfCompositions(props.schema).segments\n : [],\n)\n\n/** The current composition */\nconst composition = computed(() =>\n [props.schema[props.composition]]\n .flat()\n .map((schema) => ({ value: resolve.schema(schema), original: schema }))\n .filter((it) => isDefined(it.value)),\n)\n\n/**\n * Generate listbox options for the composition selector.\n * Each option represents a schema in the composition with a human-readable label.\n * Prefers schema title/name over structural type when present.\n */\nconst listboxOptions = computed((): ScalarListboxOption[] =>\n composition.value.map((schema, index: number) => {\n const resolved = resolve.schema(schema.original!)\n const label =\n (getModelNameFromSchema(resolved)?.label ?? getSchemaType(resolved)) ||\n translate('schema.schema')\n return { id: String(index), label }\n }),\n)\n\nconst compositionSelectionKey = computed(() =>\n props.compositionPath?.length\n ? [...props.compositionPath, props.composition].join('.')\n : '',\n)\n\n/** When this composition is in the request body, sync selection with the example snippet */\nconst requestBodyCompositionSelectionRef = inject(\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n undefined,\n)\n\nconst initialSelectedIndex = computed(() => {\n if (\n props.schemaContext !== 'requestBody' ||\n !requestBodyCompositionSelectionRef?.value ||\n !compositionSelectionKey.value\n ) {\n return 0\n }\n\n const selectedIndex =\n requestBodyCompositionSelectionRef.value[compositionSelectionKey.value]\n\n if (typeof selectedIndex !== 'number' || Number.isNaN(selectedIndex)) {\n return 0\n }\n\n return Math.max(0, Math.min(selectedIndex, listboxOptions.value.length - 1))\n})\n\n/**\n * Two-way computed property for the selected option.\n * Handles conversion between the selected index and the listbox option format.\n */\nconst selectedOption = ref<ScalarListboxOption | undefined>()\n\nwatch(\n [listboxOptions, initialSelectedIndex],\n ([options, selectedIndex]) => {\n if (\n !selectedOption.value ||\n !options.some((option) => option.id === selectedOption.value?.id)\n ) {\n selectedOption.value = options[selectedIndex] ?? options[0]\n }\n },\n { immediate: true },\n)\n\nconst compositionLabel = (type: CompositionKeyword): string =>\n translate(`schema.${type}`)\n\n/** Inside the currently selected composition */\nconst selectedComposition = computed(\n () => composition.value[Number(selectedOption.value?.id ?? '0')]?.value,\n)\n\n/**\n * The request body card renders the merged `allOf` description on its outer card\n * (see `Schema.vue`), but only for the top-level request body schema. For that\n * single composition we hide the nested merged `Schema`'s description so the text\n * is not shown twice. Nested request-body compositions (deeper properties) are\n * not shown on the outer card and would otherwise lose their description\n * entirely, because the property row already skips it when `allOf` is present.\n *\n * The top-level request body composition is the one whose `compositionPath` is\n * still the request body root (`['requestBody']`); nested compositions append\n * property segments and therefore have a longer path.\n */\nconst isRequestBodyRootComposition = computed(\n () =>\n props.schemaContext === 'requestBody' &&\n props.compositionPath?.length === 1,\n)\n\n/**\n * Cycle key for the selected composition member, derived from its raw\n * (unresolved) value so a member that references an ancestor is detected as a\n * cycle.\n */\nconst selectedCompositionCycleKey = computed(() =>\n getCycleKey(\n composition.value[Number(selectedOption.value?.id ?? '0')]?.original,\n ),\n)\n\n/**\n * Controls whether the nested schema is displayed. When expanding all schema\n * properties we open it by default; the nested Schema handles cycle detection,\n * so finite compositions render fully while recursive ones still stop.\n */\nconst showNestedSchema = ref(!!props.options.expandAllSchemaProperties)\n\nif (\n requestBodyCompositionSelectionRef &&\n props.schemaContext === 'requestBody' &&\n compositionSelectionKey.value\n) {\n watch(\n selectedOption,\n (option) => {\n const index = option ? Number(option.id) : 0\n if (!Number.isNaN(index)) {\n requestBodyCompositionSelectionRef.value = {\n ...requestBodyCompositionSelectionRef.value,\n [compositionSelectionKey.value]: index,\n } satisfies RequestBodyCompositionSelection\n }\n },\n { immediate: true },\n )\n}\n</script>\n\n<template>\n <div class=\"property-rule\">\n <!--\n allOf: render the members in source order — object chunks as fields, each\n oneOf/anyOf group as its own picker in place. Keeps every mutually-exclusive\n selection (mergeAllOfSchemas alone drops all but the first) and preserves the\n position of each choice group among the surrounding fields, flowing inline\n with them as one continuous list (no extra spacing or card).\n -->\n <template v-if=\"props.composition === 'allOf'\">\n <template\n v-for=\"(segment, segmentIndex) in allOfSegments\"\n :key=\"segmentIndex\">\n <Schema\n v-if=\"segment.kind === 'object'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideDescription=\"isRequestBodyRootComposition\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"segment.schema\"\n :schemaContext=\"schemaContext\" />\n <SchemaComposition\n v-else\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :composition=\"segment.composition\"\n :compositionPath=\"[\n ...(compositionPath ?? []),\n String(segment.choiceIndex),\n ]\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level\"\n :options=\"options\"\n :schema=\"segment.value\"\n :schemaContext=\"schemaContext\" />\n </template>\n </template>\n\n <template v-else>\n <!-- Composition selector + selected branch -->\n <ScalarListbox\n v-model=\"selectedOption\"\n :options=\"listboxOptions\"\n resize>\n <button\n class=\"composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border px-2.5 py-2.5 pr-3 text-left\"\n type=\"button\">\n <span class=\"text-c-2\">{{\n compositionLabel(props.composition)\n }}</span>\n <span\n class=\"composition-selector-label text-c-1\"\n :class=\"{\n 'line-through': selectedComposition?.deprecated,\n }\">\n {{ selectedOption?.label || translate('schema.schema') }}\n </span>\n <div\n v-if=\"selectedComposition?.deprecated\"\n class=\"text-red\">\n {{ translate('common.deprecated') }}\n </div>\n <ScalarIconCaretDown />\n </button>\n </ScalarListbox>\n\n <div class=\"composition-panel\">\n <!-- Button to toggle nested schema display -->\n <button\n v-if=\"!showNestedSchema && level > 2\"\n class=\"bg-b-1 hover:bg-b-2 text-c-1 flex w-full items-center justify-center gap-2 rounded-b-lg border border-t-0 px-2 py-2 text-sm font-medium transition-colors\"\n type=\"button\"\n @click=\"showNestedSchema = true\">\n {{ translate('schema.showSchemaDetails') }}\n <ScalarIconCaretDown class=\"h-3 w-3\" />\n </button>\n\n <!-- Render the selected schema if it has content to display -->\n <Schema\n v-else\n :key=\"selectedOption?.id ?? '0'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :cycleKey=\"selectedCompositionCycleKey\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"selectedComposition\"\n :schemaContext=\"schemaContext\" />\n </div>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,QAAQ;EAkCd,MAAM,EAAE,cAAc,gBAAgB;;;;;;;EAQtC,MAAM,gBAAgB,eACpB,MAAM,gBAAgB,UAClB,2BAA2B,MAAM,MAAM,CAAC,CAAC,WACzC,CAAC,CACP;;EAGA,MAAM,cAAc,eAClB,CAAC,MAAM,OAAO,MAAM,YAAY,CAAA,CAC7B,KAAK,CAAA,CACL,KAAK,YAAY;GAAE,OAAO,QAAQ,OAAO,MAAM;GAAG,UAAU;EAAO,EAAE,CAAA,CACrE,QAAQ,OAAO,UAAU,GAAG,KAAK,CAAC,CACvC;;;;;;EAOA,MAAM,iBAAiB,eACrB,YAAY,MAAM,KAAK,QAAQ,UAAkB;GAC/C,MAAM,WA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vue_vue_type_script_setup_true_lang_default from "./SchemaEnumPropertyItem.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/components/Content/Schema/SchemaEnumPropertyItem.vue
|
|
5
|
-
var SchemaEnumPropertyItem_default =
|
|
5
|
+
var SchemaEnumPropertyItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(SchemaEnumPropertyItem_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-4375ecfd"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SchemaEnumPropertyItem_default as default };
|
|
8
8
|
|
|
@@ -9,7 +9,7 @@ var _hoisted_4 = {
|
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "property-enum-value-description"
|
|
11
11
|
};
|
|
12
|
-
var SchemaEnumPropertyItem_vue_vue_type_script_setup_true_lang_default =
|
|
12
|
+
var SchemaEnumPropertyItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
13
13
|
__name: "SchemaEnumPropertyItem",
|
|
14
14
|
props: {
|
|
15
15
|
label: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaEnumPropertyItem.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaEnumPropertyItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\n\ndefineProps<{\n label: string\n description?: string\n}>()\n</script>\n\n<template>\n <li class=\"property-enum-value\">\n <div class=\"property-enum-value-content\">\n <span class=\"property-enum-value-label\">\n <ScalarWrappingText\n :text=\"label\"\n preset=\"property\" />\n </span>\n <span\n v-if=\"description\"\n class=\"property-enum-value-description\">\n <ScalarMarkdown :value=\"description\" />\n </span>\n </div>\n </li>\n</template>\n\n<style scoped>\n.property-enum-value {\n color: var(--scalar-color-3);\n line-height: 1.5;\n overflow-wrap: break-word;\n display: flex;\n align-items: stretch;\n position: relative;\n\n --decorator-width: 1px;\n --decorator-color: color-mix(\n in srgb,\n var(--scalar-background-1),\n var(--scalar-color-1) 25%\n );\n}\n\n.property-enum-value-content {\n display: flex;\n flex-direction: column;\n padding: 3px 0;\n}\n\n.property-enum-value-label {\n font-family: var(--scalar-font-code);\n color: var(--scalar-color-1);\n font-size: var(--scalar-font-size-4);\n position: relative;\n}\n\n.property-enum-value:last-of-type .property-enum-value-label {\n padding-bottom: 0;\n}\n\n.property-enum-value::before {\n content: '';\n margin-right: 12px;\n width: var(--decorator-width);\n display: block;\n background-color: var(--decorator-color);\n}\n\n.property-enum-value:last-of-type::before,\n.property-enum-values:has(.enum-toggle-button)\n .property-enum-value:nth-last-child(2)::before {\n height: calc(0.5lh + 4px);\n}\n\n.property-enum-value-label::after {\n content: '';\n position: absolute;\n top: calc(0.5lh);\n left: -12px;\n width: 8px;\n height: var(--decorator-width);\n background-color: var(--decorator-color);\n}\n\n.property-enum-value:last-of-type::after {\n bottom: 0;\n height: 50%;\n background: var(--scalar-background-1);\n border-top: var(--scalar-border-width) solid var(--decorator-color);\n}\n\n.property-enum-value-description {\n color: var(--scalar-color-3);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;uBAWE,mBAaK,MAbL,YAaK,CAZH,mBAWM,OAXN,YAWM,CAVJ,mBAIO,QAJP,YAIO,CAHL,YAEsB,MAAA,
|
|
1
|
+
{"version":3,"file":"SchemaEnumPropertyItem.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaEnumPropertyItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\n\ndefineProps<{\n label: string\n description?: string\n}>()\n</script>\n\n<template>\n <li class=\"property-enum-value\">\n <div class=\"property-enum-value-content\">\n <span class=\"property-enum-value-label\">\n <ScalarWrappingText\n :text=\"label\"\n preset=\"property\" />\n </span>\n <span\n v-if=\"description\"\n class=\"property-enum-value-description\">\n <ScalarMarkdown :value=\"description\" />\n </span>\n </div>\n </li>\n</template>\n\n<style scoped>\n.property-enum-value {\n color: var(--scalar-color-3);\n line-height: 1.5;\n overflow-wrap: break-word;\n display: flex;\n align-items: stretch;\n position: relative;\n\n --decorator-width: 1px;\n --decorator-color: color-mix(\n in srgb,\n var(--scalar-background-1),\n var(--scalar-color-1) 25%\n );\n}\n\n.property-enum-value-content {\n display: flex;\n flex-direction: column;\n padding: 3px 0;\n}\n\n.property-enum-value-label {\n font-family: var(--scalar-font-code);\n color: var(--scalar-color-1);\n font-size: var(--scalar-font-size-4);\n position: relative;\n}\n\n.property-enum-value:last-of-type .property-enum-value-label {\n padding-bottom: 0;\n}\n\n.property-enum-value::before {\n content: '';\n margin-right: 12px;\n width: var(--decorator-width);\n display: block;\n background-color: var(--decorator-color);\n}\n\n.property-enum-value:last-of-type::before,\n.property-enum-values:has(.enum-toggle-button)\n .property-enum-value:nth-last-child(2)::before {\n height: calc(0.5lh + 4px);\n}\n\n.property-enum-value-label::after {\n content: '';\n position: absolute;\n top: calc(0.5lh);\n left: -12px;\n width: 8px;\n height: var(--decorator-width);\n background-color: var(--decorator-color);\n}\n\n.property-enum-value:last-of-type::after {\n bottom: 0;\n height: 50%;\n background: var(--scalar-background-1);\n border-top: var(--scalar-border-width) solid var(--decorator-color);\n}\n\n.property-enum-value-description {\n color: var(--scalar-color-3);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;uBAWE,mBAaK,MAbL,YAaK,CAZH,mBAWM,OAXN,YAWM,CAVJ,mBAIO,QAJP,YAIO,CAHL,YAEsB,MAAA,kBAAA,GAAA;IADnB,MAAM,QAAA;IACP,QAAO;4BAGH,QAAA,eAAA,UAAA,GADR,mBAIO,QAJP,YAIO,CADL,YAAuC,MAAA,cAAA,GAAA,EAAtB,OAAO,QAAA,YAAW,GAAA,MAAA,GAAA,CAAA,OAAA,CAAA,CAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaEnums.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaEnums.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"names":[],"mappings":"AAqNA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAQhG,KAAK,WAAW,GAAG;IACjB,4DAA4D;IAC5D,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;IAC/B,qDAAqD;IACrD,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAC;AA0QF,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 SchemaEnums_vue_vue_type_script_setup_true_lang_default from "./SchemaEnums.vue.script.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region src/components/Content/Schema/SchemaEnums.vue
|
|
5
|
-
var SchemaEnums_default =
|
|
5
|
+
var SchemaEnums_default = /*#__PURE__*/ _plugin_vue_export_helper_default(SchemaEnums_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-602e2e26"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SchemaEnums_default as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaEnums.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, ref } from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nimport SchemaEnumPropertyItem from './SchemaEnumPropertyItem.vue'\n\nconst { value } = defineProps<{\n /** The schema object containing enum values and metadata */\n value: SchemaObject | undefined\n /** Whether to display the enum for property names */\n propertyNames?: boolean\n}>()\nconst { translate } = useLocalization()\n\nconst ENUM_DISPLAY_THRESHOLD = 9\nconst INITIAL_VISIBLE_COUNT = 5\nconst THIN_SPACE = '\\u2009'\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"SchemaEnums.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, ref } from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nimport SchemaEnumPropertyItem from './SchemaEnumPropertyItem.vue'\n\nconst { value } = defineProps<{\n /** The schema object containing enum values and metadata */\n value: SchemaObject | undefined\n /** Whether to display the enum for property names */\n propertyNames?: boolean\n}>()\nconst { translate } = useLocalization()\n\nconst ENUM_DISPLAY_THRESHOLD = 9\nconst INITIAL_VISIBLE_COUNT = 5\nconst THIN_SPACE = '\\u2009'\n\n/**\n * Resolves the schema that carries the enum values.\n * For arrays, the enum and its x-enum-* metadata live on the items schema, so\n * both the values and their varnames/descriptions have to be read from there.\n */\nconst enumSchema = computed(() => {\n if (!value) {\n return undefined\n }\n if (value.enum) {\n return value\n }\n return isArraySchema(value) ? resolve.schema(value.items) : undefined\n})\n\n/**\n * Extracts enum values from the schema object.\n * Handles both direct enum values and nested enum arrays.\n */\nconst enumValues = computed(() => enumSchema.value?.enum ?? [])\n\n/**\n * Determines if we should show the long enum list UI.\n * When there are many enum values, we initially show only a subset.\n */\nconst shouldUseLongListDisplay = computed(\n () => enumValues.value.length > ENUM_DISPLAY_THRESHOLD,\n)\n\nconst initialVisibleCount = computed(() =>\n shouldUseLongListDisplay.value\n ? INITIAL_VISIBLE_COUNT\n : enumValues.value.length,\n)\n\nconst visibleEnumValues = computed(() =>\n enumValues.value.slice(0, initialVisibleCount.value),\n)\n\nconst hiddenEnumValues = computed(() =>\n enumValues.value.slice(initialVisibleCount.value),\n)\n\n/**\n * Gets the description for an enum value.\n * Supports both array and object formats for x-enumDescriptions.\n */\nconst getEnumValueDescription = (\n enumValue: any,\n index: number,\n): string | undefined => {\n const schema = enumSchema.value\n const descriptions =\n schema?.['x-enumDescriptions'] ?? schema?.['x-enum-descriptions']\n\n if (!descriptions) {\n return undefined\n }\n\n if (Array.isArray(descriptions)) {\n return descriptions[index]\n }\n\n if (typeof descriptions === 'object' && descriptions !== null) {\n return (descriptions as Record<string, string>)[String(enumValue)]\n }\n\n return undefined\n}\n\n/**\n * Formats an enum value with its variable name if available.\n * This supports both x-enum-varnames and x-enumNames extensions.\n */\nconst formatEnumValueWithName = (enumValue: any, index: number): string => {\n const varNames =\n enumSchema.value?.['x-enum-varnames'] ?? enumSchema.value?.['x-enumNames']\n const varName = Array.isArray(varNames) ? varNames[index] : undefined\n return varName\n ? `${enumValue}${THIN_SPACE}=${THIN_SPACE}${varName}`\n : String(enumValue)\n}\n\n/**\n * Controls whether the hidden enum values are visible.\n */\nconst isExpanded = ref(false)\n\nconst toggleExpanded = () => {\n isExpanded.value = !isExpanded.value\n}\n</script>\n\n<template>\n <div\n v-if=\"enumValues.length > 0\"\n class=\"property-enum\">\n <div\n v-if=\"propertyNames\"\n class=\"property-enum-property-names\">\n {{ translate('common.propertyNames') }}\n </div>\n <div\n v-else\n class=\"property-enum-property-names\">\n {{ translate('common.values') }}\n </div>\n <ul class=\"property-enum-values\">\n <!-- Visible enum values -->\n <SchemaEnumPropertyItem\n v-for=\"(enumValue, index) in visibleEnumValues\"\n :key=\"String(enumValue)\"\n :description=\"getEnumValueDescription(enumValue, index)\"\n :label=\"formatEnumValueWithName(enumValue, index)\" />\n\n <!-- Hidden enum values (when expanded) -->\n <template v-if=\"shouldUseLongListDisplay && isExpanded\">\n <SchemaEnumPropertyItem\n v-for=\"(enumValue, index) in hiddenEnumValues\"\n :key=\"String(enumValue)\"\n :description=\"\n getEnumValueDescription(enumValue, initialVisibleCount + index)\n \"\n :label=\"\n formatEnumValueWithName(enumValue, initialVisibleCount + index)\n \" />\n </template>\n\n <!-- Toggle button for long lists -->\n <li v-if=\"shouldUseLongListDisplay\">\n <ScalarButton\n class=\"enum-toggle-button my-2 flex h-fit gap-1 rounded-full border py-1.5 pr-2.5 pl-2 leading-none\"\n variant=\"ghost\"\n @click=\"toggleExpanded\">\n <ScalarIconPlus\n :class=\"{ 'rotate-45': isExpanded }\"\n weight=\"bold\" />\n {{\n isExpanded\n ? translate('common.hideValues')\n : translate('common.showAllValues')\n }}\n </ScalarButton>\n </li>\n </ul>\n </div>\n</template>\n\n<style scoped>\n.property-heading:empty + .property-description:last-of-type,\n.property-description:first-of-type:last-of-type {\n margin-top: 0;\n}\n\n.property-list {\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius);\n margin-top: 10px;\n}\n\n.property-list .property:last-of-type {\n padding-bottom: 10px;\n}\n\n.property-enum-values {\n font-size: var(--scalar-font-size-3);\n list-style: none;\n margin-top: 8px;\n padding-left: 2px;\n}\n\n.enum-toggle-button:hover {\n color: var(--scalar-color-1);\n}\n\n.property-enum-property-names {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-2);\n display: inline-block;\n padding: 0 2px;\n margin-top: 8px;\n}\n</style>\n"],"mappings":""}
|
|
@@ -24,10 +24,11 @@ var ENUM_DISPLAY_THRESHOLD = 9;
|
|
|
24
24
|
var INITIAL_VISIBLE_COUNT = 5;
|
|
25
25
|
var THIN_SPACE = " ";
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* Resolves the schema that carries the enum values.
|
|
28
|
+
* For arrays, the enum and its x-enum-* metadata live on the items schema, so
|
|
29
|
+
* both the values and their varnames/descriptions have to be read from there.
|
|
29
30
|
*/
|
|
30
|
-
var SchemaEnums_vue_vue_type_script_setup_true_lang_default =
|
|
31
|
+
var SchemaEnums_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
31
32
|
__name: "SchemaEnums",
|
|
32
33
|
props: {
|
|
33
34
|
value: {},
|
|
@@ -35,11 +36,17 @@ var SchemaEnums_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
35
36
|
},
|
|
36
37
|
setup(__props) {
|
|
37
38
|
const { translate } = useLocalization();
|
|
38
|
-
const
|
|
39
|
-
if (!__props.value) return
|
|
40
|
-
|
|
39
|
+
const enumSchema = computed(() => {
|
|
40
|
+
if (!__props.value) return;
|
|
41
|
+
if (__props.value.enum) return __props.value;
|
|
42
|
+
return isArraySchema(__props.value) ? resolve.schema(__props.value.items) : void 0;
|
|
41
43
|
});
|
|
42
44
|
/**
|
|
45
|
+
* Extracts enum values from the schema object.
|
|
46
|
+
* Handles both direct enum values and nested enum arrays.
|
|
47
|
+
*/
|
|
48
|
+
const enumValues = computed(() => enumSchema.value?.enum ?? []);
|
|
49
|
+
/**
|
|
43
50
|
* Determines if we should show the long enum list UI.
|
|
44
51
|
* When there are many enum values, we initially show only a subset.
|
|
45
52
|
*/
|
|
@@ -52,7 +59,8 @@ var SchemaEnums_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
52
59
|
* Supports both array and object formats for x-enumDescriptions.
|
|
53
60
|
*/
|
|
54
61
|
const getEnumValueDescription = (enumValue, index) => {
|
|
55
|
-
const
|
|
62
|
+
const schema = enumSchema.value;
|
|
63
|
+
const descriptions = schema?.["x-enumDescriptions"] ?? schema?.["x-enum-descriptions"];
|
|
56
64
|
if (!descriptions) return;
|
|
57
65
|
if (Array.isArray(descriptions)) return descriptions[index];
|
|
58
66
|
if (typeof descriptions === "object" && descriptions !== null) return descriptions[String(enumValue)];
|
|
@@ -62,7 +70,7 @@ var SchemaEnums_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
62
70
|
* This supports both x-enum-varnames and x-enumNames extensions.
|
|
63
71
|
*/
|
|
64
72
|
const formatEnumValueWithName = (enumValue, index) => {
|
|
65
|
-
const varNames =
|
|
73
|
+
const varNames = enumSchema.value?.["x-enum-varnames"] ?? enumSchema.value?.["x-enumNames"];
|
|
66
74
|
const varName = Array.isArray(varNames) ? varNames[index] : void 0;
|
|
67
75
|
return varName ? `${enumValue}${THIN_SPACE}=${THIN_SPACE}${varName}` : String(enumValue);
|
|
68
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaEnums.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, ref } from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nimport SchemaEnumPropertyItem from './SchemaEnumPropertyItem.vue'\n\nconst { value } = defineProps<{\n /** The schema object containing enum values and metadata */\n value: SchemaObject | undefined\n /** Whether to display the enum for property names */\n propertyNames?: boolean\n}>()\nconst { translate } = useLocalization()\n\nconst ENUM_DISPLAY_THRESHOLD = 9\nconst INITIAL_VISIBLE_COUNT = 5\nconst THIN_SPACE = '\\u2009'\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"SchemaEnums.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, ref } from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nimport SchemaEnumPropertyItem from './SchemaEnumPropertyItem.vue'\n\nconst { value } = defineProps<{\n /** The schema object containing enum values and metadata */\n value: SchemaObject | undefined\n /** Whether to display the enum for property names */\n propertyNames?: boolean\n}>()\nconst { translate } = useLocalization()\n\nconst ENUM_DISPLAY_THRESHOLD = 9\nconst INITIAL_VISIBLE_COUNT = 5\nconst THIN_SPACE = '\\u2009'\n\n/**\n * Resolves the schema that carries the enum values.\n * For arrays, the enum and its x-enum-* metadata live on the items schema, so\n * both the values and their varnames/descriptions have to be read from there.\n */\nconst enumSchema = computed(() => {\n if (!value) {\n return undefined\n }\n if (value.enum) {\n return value\n }\n return isArraySchema(value) ? resolve.schema(value.items) : undefined\n})\n\n/**\n * Extracts enum values from the schema object.\n * Handles both direct enum values and nested enum arrays.\n */\nconst enumValues = computed(() => enumSchema.value?.enum ?? [])\n\n/**\n * Determines if we should show the long enum list UI.\n * When there are many enum values, we initially show only a subset.\n */\nconst shouldUseLongListDisplay = computed(\n () => enumValues.value.length > ENUM_DISPLAY_THRESHOLD,\n)\n\nconst initialVisibleCount = computed(() =>\n shouldUseLongListDisplay.value\n ? INITIAL_VISIBLE_COUNT\n : enumValues.value.length,\n)\n\nconst visibleEnumValues = computed(() =>\n enumValues.value.slice(0, initialVisibleCount.value),\n)\n\nconst hiddenEnumValues = computed(() =>\n enumValues.value.slice(initialVisibleCount.value),\n)\n\n/**\n * Gets the description for an enum value.\n * Supports both array and object formats for x-enumDescriptions.\n */\nconst getEnumValueDescription = (\n enumValue: any,\n index: number,\n): string | undefined => {\n const schema = enumSchema.value\n const descriptions =\n schema?.['x-enumDescriptions'] ?? schema?.['x-enum-descriptions']\n\n if (!descriptions) {\n return undefined\n }\n\n if (Array.isArray(descriptions)) {\n return descriptions[index]\n }\n\n if (typeof descriptions === 'object' && descriptions !== null) {\n return (descriptions as Record<string, string>)[String(enumValue)]\n }\n\n return undefined\n}\n\n/**\n * Formats an enum value with its variable name if available.\n * This supports both x-enum-varnames and x-enumNames extensions.\n */\nconst formatEnumValueWithName = (enumValue: any, index: number): string => {\n const varNames =\n enumSchema.value?.['x-enum-varnames'] ?? enumSchema.value?.['x-enumNames']\n const varName = Array.isArray(varNames) ? varNames[index] : undefined\n return varName\n ? `${enumValue}${THIN_SPACE}=${THIN_SPACE}${varName}`\n : String(enumValue)\n}\n\n/**\n * Controls whether the hidden enum values are visible.\n */\nconst isExpanded = ref(false)\n\nconst toggleExpanded = () => {\n isExpanded.value = !isExpanded.value\n}\n</script>\n\n<template>\n <div\n v-if=\"enumValues.length > 0\"\n class=\"property-enum\">\n <div\n v-if=\"propertyNames\"\n class=\"property-enum-property-names\">\n {{ translate('common.propertyNames') }}\n </div>\n <div\n v-else\n class=\"property-enum-property-names\">\n {{ translate('common.values') }}\n </div>\n <ul class=\"property-enum-values\">\n <!-- Visible enum values -->\n <SchemaEnumPropertyItem\n v-for=\"(enumValue, index) in visibleEnumValues\"\n :key=\"String(enumValue)\"\n :description=\"getEnumValueDescription(enumValue, index)\"\n :label=\"formatEnumValueWithName(enumValue, index)\" />\n\n <!-- Hidden enum values (when expanded) -->\n <template v-if=\"shouldUseLongListDisplay && isExpanded\">\n <SchemaEnumPropertyItem\n v-for=\"(enumValue, index) in hiddenEnumValues\"\n :key=\"String(enumValue)\"\n :description=\"\n getEnumValueDescription(enumValue, initialVisibleCount + index)\n \"\n :label=\"\n formatEnumValueWithName(enumValue, initialVisibleCount + index)\n \" />\n </template>\n\n <!-- Toggle button for long lists -->\n <li v-if=\"shouldUseLongListDisplay\">\n <ScalarButton\n class=\"enum-toggle-button my-2 flex h-fit gap-1 rounded-full border py-1.5 pr-2.5 pl-2 leading-none\"\n variant=\"ghost\"\n @click=\"toggleExpanded\">\n <ScalarIconPlus\n :class=\"{ 'rotate-45': isExpanded }\"\n weight=\"bold\" />\n {{\n isExpanded\n ? translate('common.hideValues')\n : translate('common.showAllValues')\n }}\n </ScalarButton>\n </li>\n </ul>\n </div>\n</template>\n\n<style scoped>\n.property-heading:empty + .property-description:last-of-type,\n.property-description:first-of-type:last-of-type {\n margin-top: 0;\n}\n\n.property-list {\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius);\n margin-top: 10px;\n}\n\n.property-list .property:last-of-type {\n padding-bottom: 10px;\n}\n\n.property-enum-values {\n font-size: var(--scalar-font-size-3);\n list-style: none;\n margin-top: 8px;\n padding-left: 2px;\n}\n\n.enum-toggle-button:hover {\n color: var(--scalar-color-1);\n}\n\n.property-enum-property-names {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-2);\n display: inline-block;\n padding: 0 2px;\n margin-top: 8px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAM,yBAAyB;AAC/B,IAAM,wBAAwB;AAC9B,IAAM,aAAa;;;;;;;;;;;;;EAJnB,MAAM,EAAE,cAAc,gBAAgB;EAWtC,MAAM,aAAa,eAAe;GAChC,IAAI,CAAC,QAAA,OACH;GAEF,IAAI,QAAA,MAAM,MACR,OAAO,QAAA;GAET,OAAO,cAAc,QAAA,KAAK,IAAI,QAAQ,OAAO,QAAA,MAAM,KAAK,IAAI,KAAA;EAC9D,CAAC;;;;;EAMD,MAAM,aAAa,eAAe,WAAW,OAAO,QAAQ,CAAC,CAAC;;;;;EAM9D,MAAM,2BAA2B,eACzB,WAAW,MAAM,SAAS,sBAClC;EAEA,MAAM,sBAAsB,eAC1B,yBAAyB,QACrB,wBACA,WAAW,MAAM,MACvB;EAEA,MAAM,oBAAoB,eACxB,WAAW,MAAM,MAAM,GAAG,oBAAoB,KAA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