@scalar/api-reference 1.64.0 → 1.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -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.js +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.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.script.js +1 -1
- 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-2lNB6wO-.js +27 -0
- package/dist/browser/chunks/ScalarTextInput.vue-DVmXRWbS.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-70ibkEHi.js +102 -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-BcTep96u.js +306 -0
- package/dist/browser/standalone.esm.js +22 -20
- package/dist/browser/standalone.js +256 -254
- 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 +55 -22
- package/dist/components/ApiReference.vue.script.js.map +1 -1
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/Badge/Badge.vue.script.js +1 -1
- 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.script.js +1 -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.js.map +1 -1
- 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/AsyncApi/index.d.ts +3 -0
- package/dist/components/Content/AsyncApi/index.d.ts.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.script.js +1 -1
- 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.script.js +1 -1
- 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 +9 -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 +6 -0
- 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 +6 -2
- 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.d.ts +16 -0
- package/dist/components/Content/Schema/helpers/get-ref-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/get-ref-name.js +28 -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-model-linkable.d.ts +15 -0
- package/dist/components/Content/Schema/helpers/is-model-linkable.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/is-model-linkable.js +22 -0
- package/dist/components/Content/Schema/helpers/is-model-linkable.js.map +1 -0
- 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.js.map +1 -1
- package/dist/components/Content/Schema/helpers/partition-all-of-compositions.js.map +1 -1
- 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.d.ts +6 -1
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js +5 -4
- 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/Schema/types.d.ts +7 -0
- package/dist/components/Content/Schema/types.d.ts.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.script.js +1 -1
- 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.script.js +1 -1
- 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.js +1 -1
- package/dist/components/Section/SectionHeader.vue.script.js +2 -2
- 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/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -1
- package/dist/features/Operation/Operation.vue.script.js +1 -1
- package/dist/features/Operation/Operation.vue.script.js.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.script.js +2 -2
- package/dist/features/Operation/components/ContentTypeSelect.vue.script.js.map +1 -1
- package/dist/features/Operation/components/Header.vue.d.ts +2 -0
- package/dist/features/Operation/components/Header.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/Header.vue.js.map +1 -1
- package/dist/features/Operation/components/Header.vue.script.js +4 -2
- package/dist/features/Operation/components/Header.vue.script.js.map +1 -1
- package/dist/features/Operation/components/Headers.vue.d.ts +2 -0
- package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/Headers.vue.js +1 -1
- package/dist/features/Operation/components/Headers.vue.js.map +1 -1
- package/dist/features/Operation/components/Headers.vue.script.js +5 -2
- package/dist/features/Operation/components/Headers.vue.script.js.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.script.js +4 -4
- 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.script.js +1 -1
- package/dist/features/Operation/components/OperationScopes.vue.script.js.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.script.js +4 -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.js.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.script.js +12 -3
- package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
- package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js +1 -1
- 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.js.map +1 -1
- package/dist/features/Operation/helpers/operation-stability.js.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +1 -1
- 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.script.js +1 -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.js.map +1 -1
- package/dist/features/Search/components/SearchResult.vue.script.js +3 -3
- 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.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 +1 -1
- 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 +25 -13
- 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 +10 -4
- 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 +17 -5
- 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 +11 -5
- 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 +10 -4
- package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -1
- package/dist/features/localization/locales/ar.js.map +1 -1
- package/dist/features/localization/locales/de.js.map +1 -1
- package/dist/features/localization/locales/en.js.map +1 -1
- package/dist/features/localization/locales/es.js.map +1 -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.js.map +1 -1
- package/dist/features/localization/locales/zh-cn.js.map +1 -1
- package/dist/features/localization/translations.d.ts +228 -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/build-models-index.d.ts +15 -0
- package/dist/helpers/build-models-index.d.ts.map +1 -0
- package/dist/helpers/build-models-index.js +28 -0
- package/dist/helpers/build-models-index.js.map +1 -0
- 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 +16 -0
- 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.js.map +1 -1
- package/dist/standalone/lib/load-plugins-from-urls.js.map +1 -1
- package/dist/style.css +1419 -1316
- package/dist/vue-styles.css +918 -831
- package/package.json +27 -27
- package/dist/browser/chunks/AgentScalarChatInterface-C8lX3RCo.js +0 -27
- package/dist/browser/chunks/ScalarTextInput.vue-Xf60Nwf-.js +0 -27
- package/dist/browser/chunks/browser-67K6wmG9.js +0 -129
- package/dist/browser/chunks/modal-B8Opb61-.js +0 -15
- package/dist/browser/chunks/modal-Dcl-Y2Zk.js +0 -99
- package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +0 -17
- package/dist/browser/chunks/vendor-CBP43oHJ.js +0 -306
- package/dist/features/Operation/helpers/should-ignore-entity.d.ts +0 -8
- package/dist/features/Operation/helpers/should-ignore-entity.d.ts.map +0 -1
- package/dist/features/Operation/helpers/should-ignore-entity.js +0 -9
- package/dist/features/Operation/helpers/should-ignore-entity.js.map +0 -1
|
@@ -35,11 +35,21 @@ var createPluginManager = ({ plugins = [], auth }) => {
|
|
|
35
35
|
registeredPlugins.set(pluginInstance.name, pluginInstance);
|
|
36
36
|
});
|
|
37
37
|
return {
|
|
38
|
+
/**
|
|
39
|
+
* Get all extensions with the given name from registered plugins
|
|
40
|
+
*/
|
|
38
41
|
getSpecificationExtensions: (name) => {
|
|
39
42
|
const extensions = [];
|
|
40
43
|
for (const plugin of registeredPlugins.values()) for (const extension of plugin.extensions) if (extension.name === name) extensions.push(extension);
|
|
41
44
|
return extensions;
|
|
42
45
|
},
|
|
46
|
+
/**
|
|
47
|
+
* Get all components for a specific view from registered plugins.
|
|
48
|
+
*
|
|
49
|
+
* Each component carries a stable `id` (scoped to the active document slug) so the rendered
|
|
50
|
+
* DOM element and the sidebar entry (see `getSidebarEntries`) share the same id and stay in
|
|
51
|
+
* sync for scroll navigation and deep-linking.
|
|
52
|
+
*/
|
|
43
53
|
getViewComponents: (viewName, documentSlug) => {
|
|
44
54
|
const components = [];
|
|
45
55
|
for (const plugin of registeredPlugins.values()) {
|
|
@@ -53,27 +63,52 @@ var createPluginManager = ({ plugins = [], auth }) => {
|
|
|
53
63
|
}
|
|
54
64
|
return components;
|
|
55
65
|
},
|
|
66
|
+
/**
|
|
67
|
+
* Notify all plugins that the API Reference has been initialized
|
|
68
|
+
*/
|
|
56
69
|
notifyInit: (config) => {
|
|
57
70
|
for (const plugin of registeredPlugins.values()) plugin.hooks?.onInit?.({
|
|
58
71
|
config,
|
|
59
72
|
auth: authState
|
|
60
73
|
});
|
|
61
74
|
},
|
|
75
|
+
/**
|
|
76
|
+
* Notify all plugins that the configuration has changed
|
|
77
|
+
*/
|
|
62
78
|
notifyConfigChange: (config) => {
|
|
63
79
|
for (const plugin of registeredPlugins.values()) plugin.hooks?.onConfigChange?.({
|
|
64
80
|
config,
|
|
65
81
|
auth: authState
|
|
66
82
|
});
|
|
67
83
|
},
|
|
84
|
+
/**
|
|
85
|
+
* Get the read-only accessor for the global authentication state.
|
|
86
|
+
*
|
|
87
|
+
* Plugin view components can call this (via `usePluginManager`) to read stored secrets and the
|
|
88
|
+
* selected security schemes. Returns an empty auth state when no accessor was provided.
|
|
89
|
+
*/
|
|
68
90
|
getAuthState: () => authState,
|
|
91
|
+
/**
|
|
92
|
+
* Notify all plugins that the API Reference is being destroyed
|
|
93
|
+
*/
|
|
69
94
|
notifyDestroy: () => {
|
|
70
95
|
for (const plugin of registeredPlugins.values()) plugin.hooks?.onDestroy?.();
|
|
71
96
|
},
|
|
97
|
+
/**
|
|
98
|
+
* Get all client plugins provided by registered plugins
|
|
99
|
+
*/
|
|
72
100
|
getApiClientPlugins: () => {
|
|
73
101
|
const apiClientPlugins = [];
|
|
74
102
|
for (const plugin of registeredPlugins.values()) if (plugin.apiClientPlugins) apiClientPlugins.push(...plugin.apiClientPlugins);
|
|
75
103
|
return apiClientPlugins;
|
|
76
104
|
},
|
|
105
|
+
/**
|
|
106
|
+
* Get all sidebar entries contributed by plugin views.
|
|
107
|
+
*
|
|
108
|
+
* Only views that opt in via `sidebar.show` are returned. Each entry's `id` matches the
|
|
109
|
+
* id of the rendered component (see `getViewComponents`), so the API Reference can add it
|
|
110
|
+
* to the sidebar navigation and scrolling/active-tracking work out of the box.
|
|
111
|
+
*/
|
|
77
112
|
getSidebarEntries: (documentSlug) => {
|
|
78
113
|
const entries = [];
|
|
79
114
|
for (const plugin of registeredPlugins.values()) for (const viewName of PLUGIN_VIEW_NAMES) (plugin.views?.[viewName])?.forEach((component, index) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-manager.js","names":[],"sources":["../../src/plugins/plugin-manager.ts"],"sourcesContent":["import type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type {\n ApiReferencePlugin as OriginalApiReferencePlugin,\n PluginAuthState,\n SpecificationExtension,\n ViewComponent,\n} from '@scalar/types/api-reference'\n\nexport type ApiReferencePlugin = OriginalApiReferencePlugin\n\nexport type { PluginAuthState }\n\ntype CreatePluginManagerParams = {\n plugins?: ApiReferencePlugin[]\n /**\n * Read-only accessor for the global authentication state.\n *\n * Passed through to plugin lifecycle hooks and exposed via `getAuthState`, letting plugins read\n * stored secrets and the selected security schemes without being able to mutate them.\n */\n auth?: PluginAuthState\n}\n\n/**\n * A no-op auth state used when no accessor is provided (e.g. in tests or a standalone manager).\n * It reports an empty authentication state so plugins can call the read methods unconditionally.\n */\nconst createEmptyAuthState = (): PluginAuthState => ({\n export: () => ({}),\n getAuthSecrets: () => undefined,\n getAuthSelectedSchemas: () => undefined,\n})\n\n/** Plugin view slots that can render custom components in the content area */\nconst PLUGIN_VIEW_NAMES = ['content.start', 'content.end'] as const\n\ntype PluginViewName = (typeof PLUGIN_VIEW_NAMES)[number]\n\n/** A plugin view component paired with the stable id used for the DOM and sidebar navigation */\nexport type PluginViewComponent = ViewComponent & { id: string }\n\n/** A sidebar entry contributed by a plugin view */\ntype PluginSidebarEntry = {\n id: string\n label: string\n viewName: PluginViewName\n}\n\n/**\n * Build a stable, unique id for a plugin view component.\n *\n * The same id is used as the DOM element id (so scroll navigation can find it) and as the\n * sidebar navigation entry id (so clicking it scrolls to the element). Keeping both in sync\n * is what lets plugin views participate in the existing scroll-spy and navigation logic.\n *\n * The id is prefixed with the document slug so it matches the navigation id convention. That is\n * what lets URL deep-linking work: `getIdFromUrl` re-prepends the document slug on initial load,\n * so a hash like `plugin-view/<plugin>/<view>/<index>` resolves back to this exact id.\n */\nconst getPluginViewId = (documentSlug: string, pluginName: string, viewName: PluginViewName, index: number): string =>\n `${documentSlug}/plugin-view/${pluginName}/${viewName}/${index}`\n\n/**\n * Create the plugin manager store\n *\n * This store manages all plugins registered with the API client\n */\nexport const createPluginManager = ({ plugins = [], auth }: CreatePluginManagerParams) => {\n const registeredPlugins = new Map<string, ReturnType<ApiReferencePlugin>>()\n\n // Fall back to an empty read-only auth state so hooks and `getAuthState` always have an accessor.\n const authState = auth ?? createEmptyAuthState()\n\n // Register initial plugins\n plugins.forEach((plugin) => {\n const pluginInstance = plugin()\n registeredPlugins.set(pluginInstance.name, pluginInstance)\n })\n\n return {\n /**\n * Get all extensions with the given name from registered plugins\n */\n getSpecificationExtensions: (name: `x-${string}`): SpecificationExtension[] => {\n const extensions: SpecificationExtension[] = []\n\n for (const plugin of registeredPlugins.values()) {\n for (const extension of plugin.extensions) {\n if (extension.name === name) {\n extensions.push(extension)\n }\n }\n }\n\n return extensions\n },\n\n /**\n * Get all components for a specific view from registered plugins.\n *\n * Each component carries a stable `id` (scoped to the active document slug) so the rendered\n * DOM element and the sidebar entry (see `getSidebarEntries`) share the same id and stay in\n * sync for scroll navigation and deep-linking.\n */\n getViewComponents: (viewName: PluginViewName, documentSlug: string): PluginViewComponent[] => {\n const components: PluginViewComponent[] = []\n\n for (const plugin of registeredPlugins.values()) {\n const viewComponents = plugin.views?.[viewName]\n if (viewComponents) {\n viewComponents.forEach((component: ViewComponent, index: number) => {\n components.push({ ...component, id: getPluginViewId(documentSlug, plugin.name, viewName, index) })\n })\n }\n }\n\n return components\n },\n\n /**\n * Notify all plugins that the API Reference has been initialized\n */\n notifyInit: (config: Record<string, unknown>): void => {\n for (const plugin of registeredPlugins.values()) {\n plugin.hooks?.onInit?.({ config, auth: authState })\n }\n },\n\n /**\n * Notify all plugins that the configuration has changed\n */\n notifyConfigChange: (config: Record<string, unknown>): void => {\n for (const plugin of registeredPlugins.values()) {\n plugin.hooks?.onConfigChange?.({ config, auth: authState })\n }\n },\n\n /**\n * Get the read-only accessor for the global authentication state.\n *\n * Plugin view components can call this (via `usePluginManager`) to read stored secrets and the\n * selected security schemes. Returns an empty auth state when no accessor was provided.\n */\n getAuthState: (): PluginAuthState => authState,\n\n /**\n * Notify all plugins that the API Reference is being destroyed\n */\n notifyDestroy: (): void => {\n for (const plugin of registeredPlugins.values()) {\n plugin.hooks?.onDestroy?.()\n }\n },\n\n /**\n * Get all client plugins provided by registered plugins\n */\n getApiClientPlugins: (): ClientPlugin[] => {\n const apiClientPlugins: ClientPlugin[] = []\n\n for (const plugin of registeredPlugins.values()) {\n if (plugin.apiClientPlugins) {\n apiClientPlugins.push(...(plugin.apiClientPlugins as ClientPlugin[]))\n }\n }\n\n return apiClientPlugins\n },\n\n /**\n * Get all sidebar entries contributed by plugin views.\n *\n * Only views that opt in via `sidebar.show` are returned. Each entry's `id` matches the\n * id of the rendered component (see `getViewComponents`), so the API Reference can add it\n * to the sidebar navigation and scrolling/active-tracking work out of the box.\n */\n getSidebarEntries: (documentSlug: string): PluginSidebarEntry[] => {\n const entries: PluginSidebarEntry[] = []\n\n for (const plugin of registeredPlugins.values()) {\n for (const viewName of PLUGIN_VIEW_NAMES) {\n const viewComponents = plugin.views?.[viewName]\n viewComponents?.forEach((component: ViewComponent, index: number) => {\n if (component.sidebar?.show && component.sidebar.label) {\n entries.push({\n id: getPluginViewId(documentSlug, plugin.name, viewName, index),\n label: component.sidebar.label,\n viewName,\n })\n }\n })\n }\n }\n\n return entries\n },\n }\n}\n\nexport type PluginManager = ReturnType<typeof createPluginManager>\n"],"mappings":";;;;;AA2BA,IAAM,8BAA+C;CACnD,eAAe,
|
|
1
|
+
{"version":3,"file":"plugin-manager.js","names":[],"sources":["../../src/plugins/plugin-manager.ts"],"sourcesContent":["import type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type {\n ApiReferencePlugin as OriginalApiReferencePlugin,\n PluginAuthState,\n SpecificationExtension,\n ViewComponent,\n} from '@scalar/types/api-reference'\n\nexport type ApiReferencePlugin = OriginalApiReferencePlugin\n\nexport type { PluginAuthState }\n\ntype CreatePluginManagerParams = {\n plugins?: ApiReferencePlugin[]\n /**\n * Read-only accessor for the global authentication state.\n *\n * Passed through to plugin lifecycle hooks and exposed via `getAuthState`, letting plugins read\n * stored secrets and the selected security schemes without being able to mutate them.\n */\n auth?: PluginAuthState\n}\n\n/**\n * A no-op auth state used when no accessor is provided (e.g. in tests or a standalone manager).\n * It reports an empty authentication state so plugins can call the read methods unconditionally.\n */\nconst createEmptyAuthState = (): PluginAuthState => ({\n export: () => ({}),\n getAuthSecrets: () => undefined,\n getAuthSelectedSchemas: () => undefined,\n})\n\n/** Plugin view slots that can render custom components in the content area */\nconst PLUGIN_VIEW_NAMES = ['content.start', 'content.end'] as const\n\ntype PluginViewName = (typeof PLUGIN_VIEW_NAMES)[number]\n\n/** A plugin view component paired with the stable id used for the DOM and sidebar navigation */\nexport type PluginViewComponent = ViewComponent & { id: string }\n\n/** A sidebar entry contributed by a plugin view */\ntype PluginSidebarEntry = {\n id: string\n label: string\n viewName: PluginViewName\n}\n\n/**\n * Build a stable, unique id for a plugin view component.\n *\n * The same id is used as the DOM element id (so scroll navigation can find it) and as the\n * sidebar navigation entry id (so clicking it scrolls to the element). Keeping both in sync\n * is what lets plugin views participate in the existing scroll-spy and navigation logic.\n *\n * The id is prefixed with the document slug so it matches the navigation id convention. That is\n * what lets URL deep-linking work: `getIdFromUrl` re-prepends the document slug on initial load,\n * so a hash like `plugin-view/<plugin>/<view>/<index>` resolves back to this exact id.\n */\nconst getPluginViewId = (documentSlug: string, pluginName: string, viewName: PluginViewName, index: number): string =>\n `${documentSlug}/plugin-view/${pluginName}/${viewName}/${index}`\n\n/**\n * Create the plugin manager store\n *\n * This store manages all plugins registered with the API client\n */\nexport const createPluginManager = ({ plugins = [], auth }: CreatePluginManagerParams) => {\n const registeredPlugins = new Map<string, ReturnType<ApiReferencePlugin>>()\n\n // Fall back to an empty read-only auth state so hooks and `getAuthState` always have an accessor.\n const authState = auth ?? createEmptyAuthState()\n\n // Register initial plugins\n plugins.forEach((plugin) => {\n const pluginInstance = plugin()\n registeredPlugins.set(pluginInstance.name, pluginInstance)\n })\n\n return {\n /**\n * Get all extensions with the given name from registered plugins\n */\n getSpecificationExtensions: (name: `x-${string}`): SpecificationExtension[] => {\n const extensions: SpecificationExtension[] = []\n\n for (const plugin of registeredPlugins.values()) {\n for (const extension of plugin.extensions) {\n if (extension.name === name) {\n extensions.push(extension)\n }\n }\n }\n\n return extensions\n },\n\n /**\n * Get all components for a specific view from registered plugins.\n *\n * Each component carries a stable `id` (scoped to the active document slug) so the rendered\n * DOM element and the sidebar entry (see `getSidebarEntries`) share the same id and stay in\n * sync for scroll navigation and deep-linking.\n */\n getViewComponents: (viewName: PluginViewName, documentSlug: string): PluginViewComponent[] => {\n const components: PluginViewComponent[] = []\n\n for (const plugin of registeredPlugins.values()) {\n const viewComponents = plugin.views?.[viewName]\n if (viewComponents) {\n viewComponents.forEach((component: ViewComponent, index: number) => {\n components.push({ ...component, id: getPluginViewId(documentSlug, plugin.name, viewName, index) })\n })\n }\n }\n\n return components\n },\n\n /**\n * Notify all plugins that the API Reference has been initialized\n */\n notifyInit: (config: Record<string, unknown>): void => {\n for (const plugin of registeredPlugins.values()) {\n plugin.hooks?.onInit?.({ config, auth: authState })\n }\n },\n\n /**\n * Notify all plugins that the configuration has changed\n */\n notifyConfigChange: (config: Record<string, unknown>): void => {\n for (const plugin of registeredPlugins.values()) {\n plugin.hooks?.onConfigChange?.({ config, auth: authState })\n }\n },\n\n /**\n * Get the read-only accessor for the global authentication state.\n *\n * Plugin view components can call this (via `usePluginManager`) to read stored secrets and the\n * selected security schemes. Returns an empty auth state when no accessor was provided.\n */\n getAuthState: (): PluginAuthState => authState,\n\n /**\n * Notify all plugins that the API Reference is being destroyed\n */\n notifyDestroy: (): void => {\n for (const plugin of registeredPlugins.values()) {\n plugin.hooks?.onDestroy?.()\n }\n },\n\n /**\n * Get all client plugins provided by registered plugins\n */\n getApiClientPlugins: (): ClientPlugin[] => {\n const apiClientPlugins: ClientPlugin[] = []\n\n for (const plugin of registeredPlugins.values()) {\n if (plugin.apiClientPlugins) {\n apiClientPlugins.push(...(plugin.apiClientPlugins as ClientPlugin[]))\n }\n }\n\n return apiClientPlugins\n },\n\n /**\n * Get all sidebar entries contributed by plugin views.\n *\n * Only views that opt in via `sidebar.show` are returned. Each entry's `id` matches the\n * id of the rendered component (see `getViewComponents`), so the API Reference can add it\n * to the sidebar navigation and scrolling/active-tracking work out of the box.\n */\n getSidebarEntries: (documentSlug: string): PluginSidebarEntry[] => {\n const entries: PluginSidebarEntry[] = []\n\n for (const plugin of registeredPlugins.values()) {\n for (const viewName of PLUGIN_VIEW_NAMES) {\n const viewComponents = plugin.views?.[viewName]\n viewComponents?.forEach((component: ViewComponent, index: number) => {\n if (component.sidebar?.show && component.sidebar.label) {\n entries.push({\n id: getPluginViewId(documentSlug, plugin.name, viewName, index),\n label: component.sidebar.label,\n viewName,\n })\n }\n })\n }\n }\n\n return entries\n },\n }\n}\n\nexport type PluginManager = ReturnType<typeof createPluginManager>\n"],"mappings":";;;;;AA2BA,IAAM,8BAA+C;CACnD,eAAe,CAAC;CAChB,sBAAsB,KAAA;CACtB,8BAA8B,KAAA;AAChC;;AAGA,IAAM,oBAAoB,CAAC,iBAAiB,aAAa;;;;;;;;;;;;AAyBzD,IAAM,mBAAmB,cAAsB,YAAoB,UAA0B,UAC3F,GAAG,aAAa,eAAe,WAAW,GAAG,SAAS,GAAG;;;;;;AAO3D,IAAa,uBAAuB,EAAE,UAAU,CAAC,GAAG,WAAsC;CACxF,MAAM,oCAAoB,IAAI,IAA4C;CAG1E,MAAM,YAAY,QAAQ,qBAAqB;CAG/C,QAAQ,SAAS,WAAW;EAC1B,MAAM,iBAAiB,OAAO;EAC9B,kBAAkB,IAAI,eAAe,MAAM,cAAc;CAC3D,CAAC;CAED,OAAO;;;;EAIL,6BAA6B,SAAkD;GAC7E,MAAM,aAAuC,CAAC;GAE9C,KAAK,MAAM,UAAU,kBAAkB,OAAO,GAC5C,KAAK,MAAM,aAAa,OAAO,YAC7B,IAAI,UAAU,SAAS,MACrB,WAAW,KAAK,SAAS;GAK/B,OAAO;EACT;;;;;;;;EASA,oBAAoB,UAA0B,iBAAgD;GAC5F,MAAM,aAAoC,CAAC;GAE3C,KAAK,MAAM,UAAU,kBAAkB,OAAO,GAAG;IAC/C,MAAM,iBAAiB,OAAO,QAAQ;IACtC,IAAI,gBACF,eAAe,SAAS,WAA0B,UAAkB;KAClE,WAAW,KAAK;MAAE,GAAG;MAAW,IAAI,gBAAgB,cAAc,OAAO,MAAM,UAAU,KAAK;KAAE,CAAC;IACnG,CAAC;GAEL;GAEA,OAAO;EACT;;;;EAKA,aAAa,WAA0C;GACrD,KAAK,MAAM,UAAU,kBAAkB,OAAO,GAC5C,OAAO,OAAO,SAAS;IAAE;IAAQ,MAAM;GAAU,CAAC;EAEtD;;;;EAKA,qBAAqB,WAA0C;GAC7D,KAAK,MAAM,UAAU,kBAAkB,OAAO,GAC5C,OAAO,OAAO,iBAAiB;IAAE;IAAQ,MAAM;GAAU,CAAC;EAE9D;;;;;;;EAQA,oBAAqC;;;;EAKrC,qBAA2B;GACzB,KAAK,MAAM,UAAU,kBAAkB,OAAO,GAC5C,OAAO,OAAO,YAAY;EAE9B;;;;EAKA,2BAA2C;GACzC,MAAM,mBAAmC,CAAC;GAE1C,KAAK,MAAM,UAAU,kBAAkB,OAAO,GAC5C,IAAI,OAAO,kBACT,iBAAiB,KAAK,GAAI,OAAO,gBAAmC;GAIxE,OAAO;EACT;;;;;;;;EASA,oBAAoB,iBAA+C;GACjE,MAAM,UAAgC,CAAC;GAEvC,KAAK,MAAM,UAAU,kBAAkB,OAAO,GAC5C,KAAK,MAAM,YAAY,mBAErB,CADuB,OAAO,QAAQ,UAAA,EACtB,SAAS,WAA0B,UAAkB;IACnE,IAAI,UAAU,SAAS,QAAQ,UAAU,QAAQ,OAC/C,QAAQ,KAAK;KACX,IAAI,gBAAgB,cAAc,OAAO,MAAM,UAAU,KAAK;KAC9D,OAAO,UAAU,QAAQ;KACzB;IACF,CAAC;GAEL,CAAC;GAIL,OAAO;EACT;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/plugins/posthog/index.ts"],"sourcesContent":["import { PostHogClientPlugin, type PostHogConfig } from '@scalar/api-client/plugins/posthog'\nimport type { PostHog } from 'posthog-js'\nimport ph from 'posthog-js'\n\nimport type { ApiReferencePlugin } from '../plugin-manager'\n\nexport type { PostHogConfig }\n\n/**\n * PostHog analytics plugin for the API Reference.\n *\n * Loading this plugin opts in to analytics for both the API Reference\n * and the embedded API Client (tracked as separate products).\n *\n * Respects the `telemetry` configuration option — when set to `false`,\n * capturing is disabled. Reacts dynamically to config changes at runtime.\n *\n * If the plugin is not loaded, no tracking occurs.\n */\nexport const PostHogPlugin = (config: PostHogConfig): ApiReferencePlugin => {\n let posthog: PostHog | null = null\n const clientPlugin = PostHogClientPlugin(config)\n\n return () => ({\n name: 'posthog',\n extensions: [],\n apiClientPlugins: [clientPlugin],\n hooks: {\n onInit({ config: referenceConfig }) {\n if (typeof window === 'undefined') {\n return\n }\n\n const instance = ph.init(\n config.apiKey,\n {\n api_host: config.apiHost,\n ...(config.uiHost ? { ui_host: config.uiHost } : {}),\n ...(config.defaults ? { defaults: config.defaults } : {}),\n opt_out_capturing_by_default: true,\n },\n 'scalar-api-reference',\n )\n\n if (instance) {\n posthog = instance\n posthog.register({ product: 'api-reference' })\n\n if (referenceConfig.telemetry !== false) {\n posthog.opt_in_capturing()\n }\n }\n\n clientPlugin.lifecycle?.onInit?.({ config: referenceConfig })\n },\n onConfigChange({ config: referenceConfig }) {\n if (posthog) {\n if (referenceConfig.telemetry === false) {\n posthog.opt_out_capturing()\n } else {\n posthog.opt_in_capturing()\n }\n }\n\n clientPlugin.lifecycle?.onConfigChange?.({ config: referenceConfig })\n },\n onDestroy() {\n posthog?.reset()\n posthog = null\n\n clientPlugin.lifecycle?.onDestroy?.()\n },\n },\n })\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,IAAa,iBAAiB,WAA8C;CAC1E,IAAI,UAA0B;CAC9B,MAAM,eAAe,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/plugins/posthog/index.ts"],"sourcesContent":["import { PostHogClientPlugin, type PostHogConfig } from '@scalar/api-client/plugins/posthog'\nimport type { PostHog } from 'posthog-js'\nimport ph from 'posthog-js'\n\nimport type { ApiReferencePlugin } from '../plugin-manager'\n\nexport type { PostHogConfig }\n\n/**\n * PostHog analytics plugin for the API Reference.\n *\n * Loading this plugin opts in to analytics for both the API Reference\n * and the embedded API Client (tracked as separate products).\n *\n * Respects the `telemetry` configuration option — when set to `false`,\n * capturing is disabled. Reacts dynamically to config changes at runtime.\n *\n * If the plugin is not loaded, no tracking occurs.\n */\nexport const PostHogPlugin = (config: PostHogConfig): ApiReferencePlugin => {\n let posthog: PostHog | null = null\n const clientPlugin = PostHogClientPlugin(config)\n\n return () => ({\n name: 'posthog',\n extensions: [],\n apiClientPlugins: [clientPlugin],\n hooks: {\n onInit({ config: referenceConfig }) {\n if (typeof window === 'undefined') {\n return\n }\n\n const instance = ph.init(\n config.apiKey,\n {\n api_host: config.apiHost,\n ...(config.uiHost ? { ui_host: config.uiHost } : {}),\n ...(config.defaults ? { defaults: config.defaults } : {}),\n opt_out_capturing_by_default: true,\n },\n 'scalar-api-reference',\n )\n\n if (instance) {\n posthog = instance\n posthog.register({ product: 'api-reference' })\n\n if (referenceConfig.telemetry !== false) {\n posthog.opt_in_capturing()\n }\n }\n\n clientPlugin.lifecycle?.onInit?.({ config: referenceConfig })\n },\n onConfigChange({ config: referenceConfig }) {\n if (posthog) {\n if (referenceConfig.telemetry === false) {\n posthog.opt_out_capturing()\n } else {\n posthog.opt_in_capturing()\n }\n }\n\n clientPlugin.lifecycle?.onConfigChange?.({ config: referenceConfig })\n },\n onDestroy() {\n posthog?.reset()\n posthog = null\n\n clientPlugin.lifecycle?.onDestroy?.()\n },\n },\n })\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,IAAa,iBAAiB,WAA8C;CAC1E,IAAI,UAA0B;CAC9B,MAAM,eAAe,oBAAoB,MAAM;CAE/C,cAAc;EACZ,MAAM;EACN,YAAY,CAAC;EACb,kBAAkB,CAAC,YAAY;EAC/B,OAAO;GACL,OAAO,EAAE,QAAQ,mBAAmB;IAClC,IAAI,OAAO,WAAW,aACpB;IAGF,MAAM,WAAW,GAAG,KAClB,OAAO,QACP;KACE,UAAU,OAAO;KACjB,GAAI,OAAO,SAAS,EAAE,SAAS,OAAO,OAAO,IAAI,CAAC;KAClD,GAAI,OAAO,WAAW,EAAE,UAAU,OAAO,SAAS,IAAI,CAAC;KACvD,8BAA8B;IAChC,GACA,sBACF;IAEA,IAAI,UAAU;KACZ,UAAU;KACV,QAAQ,SAAS,EAAE,SAAS,gBAAgB,CAAC;KAE7C,IAAI,gBAAgB,cAAc,OAChC,QAAQ,iBAAiB;IAE7B;IAEA,aAAa,WAAW,SAAS,EAAE,QAAQ,gBAAgB,CAAC;GAC9D;GACA,eAAe,EAAE,QAAQ,mBAAmB;IAC1C,IAAI,SACF,IAAI,gBAAgB,cAAc,OAChC,QAAQ,kBAAkB;SAE1B,QAAQ,iBAAiB;IAI7B,aAAa,WAAW,iBAAiB,EAAE,QAAQ,gBAAgB,CAAC;GACtE;GACA,YAAY;IACV,SAAS,MAAM;IACf,UAAU;IAEV,aAAa,WAAW,YAAY;GACtC;EACF;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-api.js","names":[],"sources":["../../../src/standalone/lib/html-api.ts"],"sourcesContent":["import { apiReferenceConfigurationWithSourceSchema } from '@scalar/schemas/api-reference'\nimport type {\n AnyApiReferenceConfiguration,\n ApiReferenceConfigurationWithSource,\n CreateApiReference,\n} from '@scalar/types/api-reference'\nimport { createHead } from '@unhead/vue/client'\nimport { createApp, createSSRApp, h, reactive } from 'vue'\n\nimport { default as ApiReference } from '@/components/ApiReference.vue'\nimport { hasPluginUrls, loadPluginsFromUrls } from '@/standalone/lib/load-plugins-from-urls'\n\nconst getSpecScriptTag = (doc: Document) => doc.getElementById('api-reference')\n\n/**\n * The id given to the standalone build's single injected `<style>` tag.\n * Keep in sync with `vite.standalone.config.ts` and `vite.standalone.esm.config.ts`.\n */\nconst STANDALONE_STYLE_ID = 'scalar-style'\n\n/**\n * Per-document bookkeeping for the standalone build's injected styles.\n *\n * The CDN build injects all of its CSS into one `<style>` tag in `<head>`. Under\n * SPA-style navigation (Turbo Drive, htmx boost, Astro view transitions) the host\n * swaps the DOM without reloading the window, so those document-level styles\n * (`@layer scalar-base`, the `:root` theme variables) would otherwise linger and\n * bleed into the host app's next page. We reference-count the live instances and\n * detach the styles when the last one is destroyed, re-attaching them when a new\n * instance mounts so navigating back to the reference is still styled.\n *\n * State is keyed by document so the counter survives navigations (the JS context\n * persists) while staying isolated per page.\n */\nconst standaloneStyleState = new WeakMap<Document, { count: number; detachedStyle: HTMLStyleElement | null }>()\n\nconst getStandaloneStyleState = (doc: Document): { count: number; detachedStyle: HTMLStyleElement | null } => {\n const existing = standaloneStyleState.get(doc)\n if (existing) {\n return existing\n }\n\n const state = { count: 0, detachedStyle: null }\n standaloneStyleState.set(doc, state)\n\n return state\n}\n\n/** Track a freshly mounted instance and restore previously detached styles. */\nconst retainStandaloneStyles = (doc: Document): void => {\n const state = getStandaloneStyleState(doc)\n state.count += 1\n\n if (state.detachedStyle && !doc.getElementById(STANDALONE_STYLE_ID)) {\n doc.head.appendChild(state.detachedStyle)\n state.detachedStyle = null\n }\n}\n\n/** Release an instance and detach the injected styles once the last one is gone. */\nconst releaseStandaloneStyles = (doc: Document): void => {\n const state = getStandaloneStyleState(doc)\n state.count = Math.max(0, state.count - 1)\n\n if (state.count > 0) {\n return\n }\n\n const styleElement = doc.getElementById(STANDALONE_STYLE_ID)\n if (styleElement instanceof HTMLStyleElement) {\n state.detachedStyle = styleElement\n styleElement.remove()\n }\n}\n\n/**\n * Reading the configuration from the data-attributes.\n */\nexport function getConfigurationFromDataAttributes(doc: Document): ApiReferenceConfigurationWithSource {\n const specElement = doc.querySelector('[data-spec]')\n const specUrlElement = doc.querySelector('[data-spec-url]')\n const configurationScriptElement = doc.querySelector('#api-reference[data-configuration]')\n\n const getConfiguration = () => {\n // <script data-configuration=\"{ … }\" />\n if (configurationScriptElement) {\n const configurationFromElement = configurationScriptElement.getAttribute('data-configuration')\n\n if (configurationFromElement) {\n return {\n _integration: 'html',\n ...JSON.parse(configurationFromElement.split('"').join('\"')),\n }\n }\n }\n\n return apiReferenceConfigurationWithSourceSchema({ _integration: 'html' })\n }\n\n const getUrl = () => {\n // Let's first check if the user passed a spec URL in the configuration.\n if (getConfiguration().url) {\n return getConfiguration().url\n }\n\n if (getConfiguration().spec?.url) {\n return getConfiguration().spec?.url\n }\n\n // <script id=\"api-reference\" data-url=\"/scalar.json\" />\n const specScriptTag = getSpecScriptTag(doc)\n if (specScriptTag) {\n const urlFromScriptTag = specScriptTag.getAttribute('data-url')?.trim()\n\n if (urlFromScriptTag) {\n return urlFromScriptTag\n }\n }\n\n // <div data-spec-url=\"/scalar.json\" />\n if (specUrlElement) {\n console.warn(\n '[@scalar/api-reference] The [data-spec-url] HTML API is deprecated. Use the new <script id=\"api-reference\" data-url=\"/scalar.json\" /> API instead.',\n )\n const urlFromSpecUrlElement = specUrlElement.getAttribute('data-spec-url')\n\n if (urlFromSpecUrlElement) {\n return urlFromSpecUrlElement\n }\n }\n\n return undefined\n }\n\n const getContent = (): string | undefined => {\n // <script id=\"api-reference\" type=\"application/json\">{\"openapi\":\"3.1.0\",\"info\":{\"title\":\"Example\"},\"paths\":{}}</script>\n const specScriptTag = getSpecScriptTag(doc)\n if (specScriptTag) {\n const specFromScriptTag = specScriptTag.innerHTML?.trim()\n\n if (specFromScriptTag) {\n return specFromScriptTag\n }\n }\n\n // <div data-spec='{\"openapi\":\"3.1.0\",\"info\":{\"title\":\"Example\"},\"paths\":{}}' />\n if (specElement) {\n console.warn(\n '[@scalar/api-reference] The [data-spec] HTML API is deprecated. Use the new <script id=\"api-reference\" type=\"application/json\">{\"openapi\":\"3.1.0\",\"info\":{\"title\":\"Example\"},\"paths\":{}}</script> API instead.',\n )\n const specFromSpecElement = specElement.getAttribute('data-spec')?.trim()\n\n if (specFromSpecElement) {\n return specFromSpecElement\n }\n }\n\n return undefined\n }\n\n const getProxyUrl = () => {\n // <script id=\"api-reference\" data-proxy-url=\"https://proxy.scalar.com\">…</script>\n const specScriptTag = getSpecScriptTag(doc)\n if (specScriptTag) {\n const proxyUrl = specScriptTag.getAttribute('data-proxy-url')\n\n if (proxyUrl) {\n return proxyUrl.trim()\n }\n }\n\n return undefined\n }\n\n // Ensure Reference Props are reactive\n if (!specUrlElement && !specElement && !getSpecScriptTag(doc)) {\n // Stay quiet.\n } else {\n const urlOrContent = getContent() ? { content: getContent() } : { url: getUrl() }\n\n return apiReferenceConfigurationWithSourceSchema({\n _integration: 'html',\n proxyUrl: getProxyUrl(),\n ...getConfiguration(),\n ...urlOrContent,\n })\n }\n\n return apiReferenceConfigurationWithSourceSchema({ _integration: 'html' })\n}\n\n/**\n * Mount the Scalar API Reference on a given document.\n * Read the HTML data-attributes for configuration.\n */\nexport function findDataAttributes(doc: Document, configuration: ApiReferenceConfigurationWithSource) {\n /** @deprecated Use the new <script id=\"api-reference\" data-url=\"/scalar.json\" /> API instead. */\n const specElement = doc.querySelector('[data-spec]')\n /** @deprecated Use the new <script id=\"api-reference\" data-url=\"/scalar.json\" /> API instead. */\n const specUrlElement = doc.querySelector('[data-spec-url]')\n\n if (configuration?.darkMode) {\n doc.body?.classList.add('dark-mode')\n } else {\n doc.body?.classList.add('light-mode')\n }\n\n const container = createContainer(doc, specElement || specUrlElement)\n\n if (container) {\n createApiReference(container, configuration)\n }\n}\n\n// If it's a script tag, we can't mount the Vue.js app inside that tag.\n// We need to add a new container element before the script tag.\nexport const createContainer = (doc: Document, element?: Element | null) => {\n let _container: Element | null = null\n\n const specScriptTag = getSpecScriptTag(doc)\n\n if (specScriptTag) {\n _container = doc.createElement('div')\n specScriptTag?.parentNode?.insertBefore(_container, specScriptTag)\n } else if (element) {\n _container = element\n }\n\n return _container\n}\n\n/**\n * Create (and mount) a new Scalar API Reference\n *\n * @example createApiReference({ url: '/scalar.json' }).mount('#app')\n * @example createApiReference('#app', { url: '/scalar.json' })\n * @example createApiReference(document.getElementById('app'), { url: '/scalar.json' })\n */\nexport const createApiReference: CreateApiReference = (\n elementOrSelectorOrConfig,\n optionalConfiguration?: AnyApiReferenceConfiguration,\n) => {\n // Create an id prefix for useId so we don't have collisions with other Vue apps\n const idPrefix = 'scalar-refs'\n\n const props = reactive<{ configuration: AnyApiReferenceConfiguration }>({\n // Either the configuration will be the second argument or it MUST be the first (configuration only)\n configuration: optionalConfiguration ?? (elementOrSelectorOrConfig as AnyApiReferenceConfiguration) ?? {},\n })\n\n const createReferenceApp = (isSsr = false) => {\n const referenceApp = isSsr ? createSSRApp(() => h(ApiReference, props)) : createApp(() => h(ApiReference, props))\n\n // Meta tags, etc.\n referenceApp.use(createHead())\n referenceApp.config.idPrefix = idPrefix\n\n return referenceApp\n }\n\n // If we have an optional config, then we must mount the element immediately (not sure why type is not narrowing)\n const mountElement = optionalConfiguration\n ? typeof elementOrSelectorOrConfig === 'string'\n ? document.querySelector(elementOrSelectorOrConfig)\n : (elementOrSelectorOrConfig as Element)\n : null\n\n // Detect server-rendered content and use createSSRApp for hydration\n const shouldHydrate = !!optionalConfiguration && !!mountElement && mountElement.children.length > 0\n let app = createReferenceApp(shouldHydrate)\n\n // Track whether this instance mounted so `destroy` only releases the shared\n // standalone styles for instances that actually retained them.\n let hasMounted = false\n\n if (optionalConfiguration) {\n if (mountElement) {\n const mount = () => {\n app.mount(mountElement)\n hasMounted = true\n retainStandaloneStyles(document)\n }\n\n if (hasPluginUrls(props.configuration)) {\n // Plugins referenced by URL must be resolved before the app mounts — plugin registration\n // happens once at first render and is not reactive, so a plugin that arrives later would\n // never be picked up.\n loadPluginsFromUrls(props.configuration).then(() => {\n // Skip mounting when the instance was destroyed while the plugins were loading.\n if (!abortController.signal.aborted) {\n mount()\n }\n })\n } else {\n mount()\n }\n } else {\n console.error('Could not find a mount point for API References:', elementOrSelectorOrConfig)\n }\n }\n\n // Tie the deprecated `document` listeners to an AbortController so `destroy`\n // can remove them all at once. Without this, every `createApiReference()`\n // call leaks three permanent listeners — visible during Astro view\n // transitions where each navigation creates a new instance.\n const abortController = new AbortController()\n const listenerOptions: AddEventListenerOptions = {\n capture: false,\n signal: abortController.signal,\n }\n\n /**\n * Reload the API Reference\n * @deprecated\n */\n document.addEventListener(\n 'scalar:reload-references',\n () => {\n console.warn(\n 'scalar:reload-references event has been deprecated, please use the scalarInstance.app.mount method instead.',\n )\n if (!props.configuration) {\n return\n }\n\n // Snag the current element\n const currentElement =\n typeof elementOrSelectorOrConfig === 'string'\n ? document.querySelector(elementOrSelectorOrConfig)\n : (elementOrSelectorOrConfig as Element)\n\n if (!currentElement) {\n return\n }\n\n // Ensure we re-attach the element if it was unmounted\n if (currentElement && !document.body.contains(currentElement)) {\n document.body.appendChild(currentElement)\n }\n\n // Create a new Vue app instance\n app.unmount()\n app = createReferenceApp()\n app.mount(currentElement)\n },\n listenerOptions,\n )\n\n /** Destroy the current API Reference instance */\n const destroy = () => {\n abortController.abort()\n props.configuration = {}\n\n // Only unmount an app that actually mounted. With `pluginUrls`, mounting is deferred until the\n // plugin modules resolve, so `destroy` can run first — unmounting then would just warn.\n if (hasMounted) {\n hasMounted = false\n app.unmount()\n releaseStandaloneStyles(document)\n }\n }\n\n /**\n * Allow user to destroy the API Reference\n * @deprecated\n */\n document.addEventListener(\n 'scalar:destroy-references',\n () => {\n console.warn('scalar:destroy-references event has been deprecated, please use scalarInstance.destroy instead.')\n destroy()\n },\n listenerOptions,\n )\n\n /**\n * Allow user to update configuration\n * @deprecated\n */\n document.addEventListener(\n 'scalar:update-references-config',\n (ev) => {\n console.warn(\n 'scalar:update-references-config event has been deprecated, please use scalarInstance.updateConfiguration instead.',\n )\n if ('detail' in ev) {\n Object.assign(props, ev.detail)\n }\n },\n listenerOptions,\n )\n\n const instance = {\n app,\n getConfiguration: () => props.configuration ?? {},\n updateConfiguration: (newConfig: AnyApiReferenceConfiguration) => {\n props.configuration = newConfig\n },\n destroy,\n }\n\n return instance\n}\n"],"mappings":";;;;;;;;;;AAkBA,IAAM,sBAAsB;;;;;;;;;;;;;;;AAgB5B,IAAM,uCAAuB,IAAI,SAA8E;AAE/G,IAAM,2BAA2B,QAA6E;CAC5G,MAAM,WAAW,qBAAqB,IAAI,IAAI;AAC9C,KAAI,SACF,QAAO;CAGT,MAAM,QAAQ;EAAE,OAAO;EAAG,eAAe;EAAM;AAC/C,sBAAqB,IAAI,KAAK,MAAM;AAEpC,QAAO;;;AAIT,IAAM,0BAA0B,QAAwB;CACtD,MAAM,QAAQ,wBAAwB,IAAI;AAC1C,OAAM,SAAS;AAEf,KAAI,MAAM,iBAAiB,CAAC,IAAI,eAAe,oBAAoB,EAAE;AACnE,MAAI,KAAK,YAAY,MAAM,cAAc;AACzC,QAAM,gBAAgB;;;;AAK1B,IAAM,2BAA2B,QAAwB;CACvD,MAAM,QAAQ,wBAAwB,IAAI;AAC1C,OAAM,QAAQ,KAAK,IAAI,GAAG,MAAM,QAAQ,EAAE;AAE1C,KAAI,MAAM,QAAQ,EAChB;CAGF,MAAM,eAAe,IAAI,eAAe,oBAAoB;AAC5D,KAAI,wBAAwB,kBAAkB;AAC5C,QAAM,gBAAgB;AACtB,eAAa,QAAQ;;;;;;;;;;AAuKzB,IAAa,sBACX,2BACA,0BACG;CAEH,MAAM,WAAW;CAEjB,MAAM,QAAQ,SAA0D,EAEtE,eAAe,yBAA0B,6BAA8D,EAAE,EAC1G,CAAC;CAEF,MAAM,sBAAsB,QAAQ,UAAU;EAC5C,MAAM,eAAe,QAAQ,mBAAmB,EAAE,sBAAc,MAAM,CAAC,GAAG,gBAAgB,EAAE,sBAAc,MAAM,CAAC;AAGjH,eAAa,IAAI,YAAY,CAAC;AAC9B,eAAa,OAAO,WAAW;AAE/B,SAAO;;CAIT,MAAM,eAAe,wBACjB,OAAO,8BAA8B,WACnC,SAAS,cAAc,0BAA0B,GAChD,4BACH;CAIJ,IAAI,MAAM,mBADY,CAAC,CAAC,yBAAyB,CAAC,CAAC,gBAAgB,aAAa,SAAS,SAAS,EACvD;CAI3C,IAAI,aAAa;AAEjB,KAAI,sBACF,KAAI,cAAc;EAChB,MAAM,cAAc;AAClB,OAAI,MAAM,aAAa;AACvB,gBAAa;AACb,0BAAuB,SAAS;;AAGlC,MAAI,cAAc,MAAM,cAAc,CAIpC,qBAAoB,MAAM,cAAc,CAAC,WAAW;AAElD,OAAI,CAAC,gBAAgB,OAAO,QAC1B,QAAO;IAET;MAEF,QAAO;OAGT,SAAQ,MAAM,oDAAoD,0BAA0B;CAQhG,MAAM,kBAAkB,IAAI,iBAAiB;CAC7C,MAAM,kBAA2C;EAC/C,SAAS;EACT,QAAQ,gBAAgB;EACzB;;;;;AAMD,UAAS,iBACP,kCACM;AACJ,UAAQ,KACN,8GACD;AACD,MAAI,CAAC,MAAM,cACT;EAIF,MAAM,iBACJ,OAAO,8BAA8B,WACjC,SAAS,cAAc,0BAA0B,GAChD;AAEP,MAAI,CAAC,eACH;AAIF,MAAI,kBAAkB,CAAC,SAAS,KAAK,SAAS,eAAe,CAC3D,UAAS,KAAK,YAAY,eAAe;AAI3C,MAAI,SAAS;AACb,QAAM,oBAAoB;AAC1B,MAAI,MAAM,eAAe;IAE3B,gBACD;;CAGD,MAAM,gBAAgB;AACpB,kBAAgB,OAAO;AACvB,QAAM,gBAAgB,EAAE;AAIxB,MAAI,YAAY;AACd,gBAAa;AACb,OAAI,SAAS;AACb,2BAAwB,SAAS;;;;;;;AAQrC,UAAS,iBACP,mCACM;AACJ,UAAQ,KAAK,kGAAkG;AAC/G,WAAS;IAEX,gBACD;;;;;AAMD,UAAS,iBACP,oCACC,OAAO;AACN,UAAQ,KACN,oHACD;AACD,MAAI,YAAY,GACd,QAAO,OAAO,OAAO,GAAG,OAAO;IAGnC,gBACD;AAWD,QATiB;EACf;EACA,wBAAwB,MAAM,iBAAiB,EAAE;EACjD,sBAAsB,cAA4C;AAChE,SAAM,gBAAgB;;EAExB;EACD"}
|
|
1
|
+
{"version":3,"file":"html-api.js","names":[],"sources":["../../../src/standalone/lib/html-api.ts"],"sourcesContent":["import { apiReferenceConfigurationWithSourceSchema } from '@scalar/schemas/api-reference'\nimport type {\n AnyApiReferenceConfiguration,\n ApiReferenceConfigurationWithSource,\n CreateApiReference,\n} from '@scalar/types/api-reference'\nimport { createHead } from '@unhead/vue/client'\nimport { createApp, createSSRApp, h, reactive } from 'vue'\n\nimport { default as ApiReference } from '@/components/ApiReference.vue'\nimport { hasPluginUrls, loadPluginsFromUrls } from '@/standalone/lib/load-plugins-from-urls'\n\nconst getSpecScriptTag = (doc: Document) => doc.getElementById('api-reference')\n\n/**\n * The id given to the standalone build's single injected `<style>` tag.\n * Keep in sync with `vite.standalone.config.ts` and `vite.standalone.esm.config.ts`.\n */\nconst STANDALONE_STYLE_ID = 'scalar-style'\n\n/**\n * Per-document bookkeeping for the standalone build's injected styles.\n *\n * The CDN build injects all of its CSS into one `<style>` tag in `<head>`. Under\n * SPA-style navigation (Turbo Drive, htmx boost, Astro view transitions) the host\n * swaps the DOM without reloading the window, so those document-level styles\n * (`@layer scalar-base`, the `:root` theme variables) would otherwise linger and\n * bleed into the host app's next page. We reference-count the live instances and\n * detach the styles when the last one is destroyed, re-attaching them when a new\n * instance mounts so navigating back to the reference is still styled.\n *\n * State is keyed by document so the counter survives navigations (the JS context\n * persists) while staying isolated per page.\n */\nconst standaloneStyleState = new WeakMap<Document, { count: number; detachedStyle: HTMLStyleElement | null }>()\n\nconst getStandaloneStyleState = (doc: Document): { count: number; detachedStyle: HTMLStyleElement | null } => {\n const existing = standaloneStyleState.get(doc)\n if (existing) {\n return existing\n }\n\n const state = { count: 0, detachedStyle: null }\n standaloneStyleState.set(doc, state)\n\n return state\n}\n\n/** Track a freshly mounted instance and restore previously detached styles. */\nconst retainStandaloneStyles = (doc: Document): void => {\n const state = getStandaloneStyleState(doc)\n state.count += 1\n\n if (state.detachedStyle && !doc.getElementById(STANDALONE_STYLE_ID)) {\n doc.head.appendChild(state.detachedStyle)\n state.detachedStyle = null\n }\n}\n\n/** Release an instance and detach the injected styles once the last one is gone. */\nconst releaseStandaloneStyles = (doc: Document): void => {\n const state = getStandaloneStyleState(doc)\n state.count = Math.max(0, state.count - 1)\n\n if (state.count > 0) {\n return\n }\n\n const styleElement = doc.getElementById(STANDALONE_STYLE_ID)\n if (styleElement instanceof HTMLStyleElement) {\n state.detachedStyle = styleElement\n styleElement.remove()\n }\n}\n\n/**\n * Reading the configuration from the data-attributes.\n */\nexport function getConfigurationFromDataAttributes(doc: Document): ApiReferenceConfigurationWithSource {\n const specElement = doc.querySelector('[data-spec]')\n const specUrlElement = doc.querySelector('[data-spec-url]')\n const configurationScriptElement = doc.querySelector('#api-reference[data-configuration]')\n\n const getConfiguration = () => {\n // <script data-configuration=\"{ … }\" />\n if (configurationScriptElement) {\n const configurationFromElement = configurationScriptElement.getAttribute('data-configuration')\n\n if (configurationFromElement) {\n return {\n _integration: 'html',\n ...JSON.parse(configurationFromElement.split('"').join('\"')),\n }\n }\n }\n\n return apiReferenceConfigurationWithSourceSchema({ _integration: 'html' })\n }\n\n const getUrl = () => {\n // Let's first check if the user passed a spec URL in the configuration.\n if (getConfiguration().url) {\n return getConfiguration().url\n }\n\n if (getConfiguration().spec?.url) {\n return getConfiguration().spec?.url\n }\n\n // <script id=\"api-reference\" data-url=\"/scalar.json\" />\n const specScriptTag = getSpecScriptTag(doc)\n if (specScriptTag) {\n const urlFromScriptTag = specScriptTag.getAttribute('data-url')?.trim()\n\n if (urlFromScriptTag) {\n return urlFromScriptTag\n }\n }\n\n // <div data-spec-url=\"/scalar.json\" />\n if (specUrlElement) {\n console.warn(\n '[@scalar/api-reference] The [data-spec-url] HTML API is deprecated. Use the new <script id=\"api-reference\" data-url=\"/scalar.json\" /> API instead.',\n )\n const urlFromSpecUrlElement = specUrlElement.getAttribute('data-spec-url')\n\n if (urlFromSpecUrlElement) {\n return urlFromSpecUrlElement\n }\n }\n\n return undefined\n }\n\n const getContent = (): string | undefined => {\n // <script id=\"api-reference\" type=\"application/json\">{\"openapi\":\"3.1.0\",\"info\":{\"title\":\"Example\"},\"paths\":{}}</script>\n const specScriptTag = getSpecScriptTag(doc)\n if (specScriptTag) {\n const specFromScriptTag = specScriptTag.innerHTML?.trim()\n\n if (specFromScriptTag) {\n return specFromScriptTag\n }\n }\n\n // <div data-spec='{\"openapi\":\"3.1.0\",\"info\":{\"title\":\"Example\"},\"paths\":{}}' />\n if (specElement) {\n console.warn(\n '[@scalar/api-reference] The [data-spec] HTML API is deprecated. Use the new <script id=\"api-reference\" type=\"application/json\">{\"openapi\":\"3.1.0\",\"info\":{\"title\":\"Example\"},\"paths\":{}}</script> API instead.',\n )\n const specFromSpecElement = specElement.getAttribute('data-spec')?.trim()\n\n if (specFromSpecElement) {\n return specFromSpecElement\n }\n }\n\n return undefined\n }\n\n const getProxyUrl = () => {\n // <script id=\"api-reference\" data-proxy-url=\"https://proxy.scalar.com\">…</script>\n const specScriptTag = getSpecScriptTag(doc)\n if (specScriptTag) {\n const proxyUrl = specScriptTag.getAttribute('data-proxy-url')\n\n if (proxyUrl) {\n return proxyUrl.trim()\n }\n }\n\n return undefined\n }\n\n // Ensure Reference Props are reactive\n if (!specUrlElement && !specElement && !getSpecScriptTag(doc)) {\n // Stay quiet.\n } else {\n const urlOrContent = getContent() ? { content: getContent() } : { url: getUrl() }\n\n return apiReferenceConfigurationWithSourceSchema({\n _integration: 'html',\n proxyUrl: getProxyUrl(),\n ...getConfiguration(),\n ...urlOrContent,\n })\n }\n\n return apiReferenceConfigurationWithSourceSchema({ _integration: 'html' })\n}\n\n/**\n * Mount the Scalar API Reference on a given document.\n * Read the HTML data-attributes for configuration.\n */\nexport function findDataAttributes(doc: Document, configuration: ApiReferenceConfigurationWithSource) {\n /** @deprecated Use the new <script id=\"api-reference\" data-url=\"/scalar.json\" /> API instead. */\n const specElement = doc.querySelector('[data-spec]')\n /** @deprecated Use the new <script id=\"api-reference\" data-url=\"/scalar.json\" /> API instead. */\n const specUrlElement = doc.querySelector('[data-spec-url]')\n\n if (configuration?.darkMode) {\n doc.body?.classList.add('dark-mode')\n } else {\n doc.body?.classList.add('light-mode')\n }\n\n const container = createContainer(doc, specElement || specUrlElement)\n\n if (container) {\n createApiReference(container, configuration)\n }\n}\n\n// If it's a script tag, we can't mount the Vue.js app inside that tag.\n// We need to add a new container element before the script tag.\nexport const createContainer = (doc: Document, element?: Element | null) => {\n let _container: Element | null = null\n\n const specScriptTag = getSpecScriptTag(doc)\n\n if (specScriptTag) {\n _container = doc.createElement('div')\n specScriptTag?.parentNode?.insertBefore(_container, specScriptTag)\n } else if (element) {\n _container = element\n }\n\n return _container\n}\n\n/**\n * Create (and mount) a new Scalar API Reference\n *\n * @example createApiReference({ url: '/scalar.json' }).mount('#app')\n * @example createApiReference('#app', { url: '/scalar.json' })\n * @example createApiReference(document.getElementById('app'), { url: '/scalar.json' })\n */\nexport const createApiReference: CreateApiReference = (\n elementOrSelectorOrConfig,\n optionalConfiguration?: AnyApiReferenceConfiguration,\n) => {\n // Create an id prefix for useId so we don't have collisions with other Vue apps\n const idPrefix = 'scalar-refs'\n\n const props = reactive<{ configuration: AnyApiReferenceConfiguration }>({\n // Either the configuration will be the second argument or it MUST be the first (configuration only)\n configuration: optionalConfiguration ?? (elementOrSelectorOrConfig as AnyApiReferenceConfiguration) ?? {},\n })\n\n const createReferenceApp = (isSsr = false) => {\n const referenceApp = isSsr ? createSSRApp(() => h(ApiReference, props)) : createApp(() => h(ApiReference, props))\n\n // Meta tags, etc.\n referenceApp.use(createHead())\n referenceApp.config.idPrefix = idPrefix\n\n return referenceApp\n }\n\n // If we have an optional config, then we must mount the element immediately (not sure why type is not narrowing)\n const mountElement = optionalConfiguration\n ? typeof elementOrSelectorOrConfig === 'string'\n ? document.querySelector(elementOrSelectorOrConfig)\n : (elementOrSelectorOrConfig as Element)\n : null\n\n // Detect server-rendered content and use createSSRApp for hydration\n const shouldHydrate = !!optionalConfiguration && !!mountElement && mountElement.children.length > 0\n let app = createReferenceApp(shouldHydrate)\n\n // Track whether this instance mounted so `destroy` only releases the shared\n // standalone styles for instances that actually retained them.\n let hasMounted = false\n\n if (optionalConfiguration) {\n if (mountElement) {\n const mount = () => {\n app.mount(mountElement)\n hasMounted = true\n retainStandaloneStyles(document)\n }\n\n if (hasPluginUrls(props.configuration)) {\n // Plugins referenced by URL must be resolved before the app mounts — plugin registration\n // happens once at first render and is not reactive, so a plugin that arrives later would\n // never be picked up.\n loadPluginsFromUrls(props.configuration).then(() => {\n // Skip mounting when the instance was destroyed while the plugins were loading.\n if (!abortController.signal.aborted) {\n mount()\n }\n })\n } else {\n mount()\n }\n } else {\n console.error('Could not find a mount point for API References:', elementOrSelectorOrConfig)\n }\n }\n\n // Tie the deprecated `document` listeners to an AbortController so `destroy`\n // can remove them all at once. Without this, every `createApiReference()`\n // call leaks three permanent listeners — visible during Astro view\n // transitions where each navigation creates a new instance.\n const abortController = new AbortController()\n const listenerOptions: AddEventListenerOptions = {\n capture: false,\n signal: abortController.signal,\n }\n\n /**\n * Reload the API Reference\n * @deprecated\n */\n document.addEventListener(\n 'scalar:reload-references',\n () => {\n console.warn(\n 'scalar:reload-references event has been deprecated, please use the scalarInstance.app.mount method instead.',\n )\n if (!props.configuration) {\n return\n }\n\n // Snag the current element\n const currentElement =\n typeof elementOrSelectorOrConfig === 'string'\n ? document.querySelector(elementOrSelectorOrConfig)\n : (elementOrSelectorOrConfig as Element)\n\n if (!currentElement) {\n return\n }\n\n // Ensure we re-attach the element if it was unmounted\n if (currentElement && !document.body.contains(currentElement)) {\n document.body.appendChild(currentElement)\n }\n\n // Create a new Vue app instance\n app.unmount()\n app = createReferenceApp()\n app.mount(currentElement)\n },\n listenerOptions,\n )\n\n /** Destroy the current API Reference instance */\n const destroy = () => {\n abortController.abort()\n props.configuration = {}\n\n // Only unmount an app that actually mounted. With `pluginUrls`, mounting is deferred until the\n // plugin modules resolve, so `destroy` can run first — unmounting then would just warn.\n if (hasMounted) {\n hasMounted = false\n app.unmount()\n releaseStandaloneStyles(document)\n }\n }\n\n /**\n * Allow user to destroy the API Reference\n * @deprecated\n */\n document.addEventListener(\n 'scalar:destroy-references',\n () => {\n console.warn('scalar:destroy-references event has been deprecated, please use scalarInstance.destroy instead.')\n destroy()\n },\n listenerOptions,\n )\n\n /**\n * Allow user to update configuration\n * @deprecated\n */\n document.addEventListener(\n 'scalar:update-references-config',\n (ev) => {\n console.warn(\n 'scalar:update-references-config event has been deprecated, please use scalarInstance.updateConfiguration instead.',\n )\n if ('detail' in ev) {\n Object.assign(props, ev.detail)\n }\n },\n listenerOptions,\n )\n\n const instance = {\n app,\n getConfiguration: () => props.configuration ?? {},\n updateConfiguration: (newConfig: AnyApiReferenceConfiguration) => {\n props.configuration = newConfig\n },\n destroy,\n }\n\n return instance\n}\n"],"mappings":";;;;;;;;;;AAkBA,IAAM,sBAAsB;;;;;;;;;;;;;;;AAgB5B,IAAM,uCAAuB,IAAI,QAA6E;AAE9G,IAAM,2BAA2B,QAA6E;CAC5G,MAAM,WAAW,qBAAqB,IAAI,GAAG;CAC7C,IAAI,UACF,OAAO;CAGT,MAAM,QAAQ;EAAE,OAAO;EAAG,eAAe;CAAK;CAC9C,qBAAqB,IAAI,KAAK,KAAK;CAEnC,OAAO;AACT;;AAGA,IAAM,0BAA0B,QAAwB;CACtD,MAAM,QAAQ,wBAAwB,GAAG;CACzC,MAAM,SAAS;CAEf,IAAI,MAAM,iBAAiB,CAAC,IAAI,eAAe,mBAAmB,GAAG;EACnE,IAAI,KAAK,YAAY,MAAM,aAAa;EACxC,MAAM,gBAAgB;CACxB;AACF;;AAGA,IAAM,2BAA2B,QAAwB;CACvD,MAAM,QAAQ,wBAAwB,GAAG;CACzC,MAAM,QAAQ,KAAK,IAAI,GAAG,MAAM,QAAQ,CAAC;CAEzC,IAAI,MAAM,QAAQ,GAChB;CAGF,MAAM,eAAe,IAAI,eAAe,mBAAmB;CAC3D,IAAI,wBAAwB,kBAAkB;EAC5C,MAAM,gBAAgB;EACtB,aAAa,OAAO;CACtB;AACF;;;;;;;;AAqKA,IAAa,sBACX,2BACA,0BACG;CAEH,MAAM,WAAW;CAEjB,MAAM,QAAQ,SAA0D,EAEtE,eAAe,yBAA0B,6BAA8D,CAAC,EAC1G,CAAC;CAED,MAAM,sBAAsB,QAAQ,UAAU;EAC5C,MAAM,eAAe,QAAQ,mBAAmB,EAAE,sBAAc,KAAK,CAAC,IAAI,gBAAgB,EAAE,sBAAc,KAAK,CAAC;EAGhH,aAAa,IAAI,WAAW,CAAC;EAC7B,aAAa,OAAO,WAAW;EAE/B,OAAO;CACT;CAGA,MAAM,eAAe,wBACjB,OAAO,8BAA8B,WACnC,SAAS,cAAc,yBAAyB,IAC/C,4BACH;CAIJ,IAAI,MAAM,mBADY,CAAC,CAAC,yBAAyB,CAAC,CAAC,gBAAgB,aAAa,SAAS,SAAS,CACxD;CAI1C,IAAI,aAAa;CAEjB,IAAI,uBACF,IAAI,cAAc;EAChB,MAAM,cAAc;GAClB,IAAI,MAAM,YAAY;GACtB,aAAa;GACb,uBAAuB,QAAQ;EACjC;EAEA,IAAI,cAAc,MAAM,aAAa,GAInC,oBAAoB,MAAM,aAAa,CAAC,CAAC,WAAW;GAElD,IAAI,CAAC,gBAAgB,OAAO,SAC1B,MAAM;EAEV,CAAC;OAED,MAAM;CAEV,OACE,QAAQ,MAAM,oDAAoD,yBAAyB;CAQ/F,MAAM,kBAAkB,IAAI,gBAAgB;CAC5C,MAAM,kBAA2C;EAC/C,SAAS;EACT,QAAQ,gBAAgB;CAC1B;;;;;CAMA,SAAS,iBACP,kCACM;EACJ,QAAQ,KACN,6GACF;EACA,IAAI,CAAC,MAAM,eACT;EAIF,MAAM,iBACJ,OAAO,8BAA8B,WACjC,SAAS,cAAc,yBAAyB,IAC/C;EAEP,IAAI,CAAC,gBACH;EAIF,IAAI,kBAAkB,CAAC,SAAS,KAAK,SAAS,cAAc,GAC1D,SAAS,KAAK,YAAY,cAAc;EAI1C,IAAI,QAAQ;EACZ,MAAM,mBAAmB;EACzB,IAAI,MAAM,cAAc;CAC1B,GACA,eACF;;CAGA,MAAM,gBAAgB;EACpB,gBAAgB,MAAM;EACtB,MAAM,gBAAgB,CAAC;EAIvB,IAAI,YAAY;GACd,aAAa;GACb,IAAI,QAAQ;GACZ,wBAAwB,QAAQ;EAClC;CACF;;;;;CAMA,SAAS,iBACP,mCACM;EACJ,QAAQ,KAAK,iGAAiG;EAC9G,QAAQ;CACV,GACA,eACF;;;;;CAMA,SAAS,iBACP,oCACC,OAAO;EACN,QAAQ,KACN,mHACF;EACA,IAAI,YAAY,IACd,OAAO,OAAO,OAAO,GAAG,MAAM;CAElC,GACA,eACF;CAWA,OAAO;EARL;EACA,wBAAwB,MAAM,iBAAiB,CAAC;EAChD,sBAAsB,cAA4C;GAChE,MAAM,gBAAgB;EACxB;EACA;CAGK;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-plugins-from-urls.js","names":[],"sources":["../../../src/standalone/lib/load-plugins-from-urls.ts"],"sourcesContent":["import type { AnyApiReferenceConfiguration, ApiReferencePlugin } from '@scalar/types/api-reference'\n\n/**\n * Import a plugin module with a browser-native dynamic `import()`.\n *\n * The specifier is fully dynamic, so bundlers can't analyze it and leave the `import()` call\n * as-is in the output (including the UMD standalone bundle) — the `@vite-ignore` comment just\n * silences the warning about that.\n */\nconst importModule = (url: string): Promise<Record<string, unknown>> => import(/* @vite-ignore */ url)\n\n/**\n * Load a single plugin module and return its default export.\n *\n * Failures (network errors, modules without a function default export) are logged and swallowed\n * so a broken plugin URL never prevents the API reference itself from mounting.\n */\nconst loadPluginFromUrl = async (url: string): Promise<ApiReferencePlugin | undefined> => {\n try {\n const pluginModule = await importModule(url)\n const plugin = pluginModule?.default\n\n if (typeof plugin !== 'function') {\n console.error(\n `[@scalar/api-reference] The module at ${url} does not export an API Reference plugin as its default export.`,\n )\n return undefined\n }\n\n return plugin as ApiReferencePlugin\n } catch (error) {\n console.error(`[@scalar/api-reference] Failed to load the plugin module at ${url}:`, error)\n return undefined\n }\n}\n\n/** Normalize the configuration input to a list of configuration objects */\nconst getConfigurations = (configuration: AnyApiReferenceConfiguration) =>\n Array.isArray(configuration) ? configuration : [configuration]\n\n/** Whether any of the passed configurations reference a plugin by URL */\nexport const hasPluginUrls = (configuration: AnyApiReferenceConfiguration): boolean =>\n getConfigurations(configuration).some((config) => Boolean(config.pluginUrls?.length))\n\n/**\n * Resolve the `pluginUrls` of all passed configurations and append the loaded plugins to the\n * respective configuration's `plugins`.\n *\n * Plugin registration is not reactive — plugins are read once when the API reference renders for\n * the first time — so this must complete before the app is mounted. Each URL is imported only\n * once, even when multiple configurations reference it.\n */\nexport const loadPluginsFromUrls = async (configuration: AnyApiReferenceConfiguration): Promise<void> => {\n const pendingImports = new Map<string, Promise<ApiReferencePlugin | undefined>>()\n\n const importOnce = (url: string) => {\n const pending = pendingImports.get(url) ?? loadPluginFromUrl(url)\n pendingImports.set(url, pending)\n return pending\n }\n\n await Promise.all(\n getConfigurations(configuration).map(async (config) => {\n if (!config.pluginUrls?.length) {\n return\n }\n\n const loadedPlugins = await Promise.all(config.pluginUrls.map(importOnce))\n const plugins = loadedPlugins.filter((plugin): plugin is ApiReferencePlugin => plugin !== undefined)\n\n if (plugins.length) {\n config.plugins = [...(config.plugins ?? []), ...plugins]\n }\n }),\n )\n}\n"],"mappings":";;;;;;;;AASA,IAAM,gBAAgB,QAAkD;;CAA0B;;;;;;;;AAQlG,IAAM,oBAAoB,OAAO,QAAyD;
|
|
1
|
+
{"version":3,"file":"load-plugins-from-urls.js","names":[],"sources":["../../../src/standalone/lib/load-plugins-from-urls.ts"],"sourcesContent":["import type { AnyApiReferenceConfiguration, ApiReferencePlugin } from '@scalar/types/api-reference'\n\n/**\n * Import a plugin module with a browser-native dynamic `import()`.\n *\n * The specifier is fully dynamic, so bundlers can't analyze it and leave the `import()` call\n * as-is in the output (including the UMD standalone bundle) — the `@vite-ignore` comment just\n * silences the warning about that.\n */\nconst importModule = (url: string): Promise<Record<string, unknown>> => import(/* @vite-ignore */ url)\n\n/**\n * Load a single plugin module and return its default export.\n *\n * Failures (network errors, modules without a function default export) are logged and swallowed\n * so a broken plugin URL never prevents the API reference itself from mounting.\n */\nconst loadPluginFromUrl = async (url: string): Promise<ApiReferencePlugin | undefined> => {\n try {\n const pluginModule = await importModule(url)\n const plugin = pluginModule?.default\n\n if (typeof plugin !== 'function') {\n console.error(\n `[@scalar/api-reference] The module at ${url} does not export an API Reference plugin as its default export.`,\n )\n return undefined\n }\n\n return plugin as ApiReferencePlugin\n } catch (error) {\n console.error(`[@scalar/api-reference] Failed to load the plugin module at ${url}:`, error)\n return undefined\n }\n}\n\n/** Normalize the configuration input to a list of configuration objects */\nconst getConfigurations = (configuration: AnyApiReferenceConfiguration) =>\n Array.isArray(configuration) ? configuration : [configuration]\n\n/** Whether any of the passed configurations reference a plugin by URL */\nexport const hasPluginUrls = (configuration: AnyApiReferenceConfiguration): boolean =>\n getConfigurations(configuration).some((config) => Boolean(config.pluginUrls?.length))\n\n/**\n * Resolve the `pluginUrls` of all passed configurations and append the loaded plugins to the\n * respective configuration's `plugins`.\n *\n * Plugin registration is not reactive — plugins are read once when the API reference renders for\n * the first time — so this must complete before the app is mounted. Each URL is imported only\n * once, even when multiple configurations reference it.\n */\nexport const loadPluginsFromUrls = async (configuration: AnyApiReferenceConfiguration): Promise<void> => {\n const pendingImports = new Map<string, Promise<ApiReferencePlugin | undefined>>()\n\n const importOnce = (url: string) => {\n const pending = pendingImports.get(url) ?? loadPluginFromUrl(url)\n pendingImports.set(url, pending)\n return pending\n }\n\n await Promise.all(\n getConfigurations(configuration).map(async (config) => {\n if (!config.pluginUrls?.length) {\n return\n }\n\n const loadedPlugins = await Promise.all(config.pluginUrls.map(importOnce))\n const plugins = loadedPlugins.filter((plugin): plugin is ApiReferencePlugin => plugin !== undefined)\n\n if (plugins.length) {\n config.plugins = [...(config.plugins ?? []), ...plugins]\n }\n }),\n )\n}\n"],"mappings":";;;;;;;;AASA,IAAM,gBAAgB,QAAkD;;CAA0B;;;;;;;;AAQlG,IAAM,oBAAoB,OAAO,QAAyD;CACxF,IAAI;EAEF,MAAM,UAAS,MADY,aAAa,GAAG,EAAA,EACd;EAE7B,IAAI,OAAO,WAAW,YAAY;GAChC,QAAQ,MACN,yCAAyC,IAAI,gEAC/C;GACA;EACF;EAEA,OAAO;CACT,SAAS,OAAO;EACd,QAAQ,MAAM,+DAA+D,IAAI,IAAI,KAAK;EAC1F;CACF;AACF;;AAGA,IAAM,qBAAqB,kBACzB,MAAM,QAAQ,aAAa,IAAI,gBAAgB,CAAC,aAAa;;AAG/D,IAAa,iBAAiB,kBAC5B,kBAAkB,aAAa,CAAC,CAAC,MAAM,WAAW,QAAQ,OAAO,YAAY,MAAM,CAAC;;;;;;;;;AAUtF,IAAa,sBAAsB,OAAO,kBAA+D;CACvG,MAAM,iCAAiB,IAAI,IAAqD;CAEhF,MAAM,cAAc,QAAgB;EAClC,MAAM,UAAU,eAAe,IAAI,GAAG,KAAK,kBAAkB,GAAG;EAChE,eAAe,IAAI,KAAK,OAAO;EAC/B,OAAO;CACT;CAEA,MAAM,QAAQ,IACZ,kBAAkB,aAAa,CAAC,CAAC,IAAI,OAAO,WAAW;EACrD,IAAI,CAAC,OAAO,YAAY,QACtB;EAIF,MAAM,WAAU,MADY,QAAQ,IAAI,OAAO,WAAW,IAAI,UAAU,CAAC,EAAA,CAC3C,QAAQ,WAAyC,WAAW,KAAA,CAAS;EAEnG,IAAI,QAAQ,QACV,OAAO,UAAU,CAAC,GAAI,OAAO,WAAW,CAAC,GAAI,GAAG,OAAO;CAE3D,CAAC,CACH;AACF"}
|