@scalar/api-reference 1.61.0 → 1.62.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (508) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.d.ts.map +1 -1
  3. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.js.map +1 -1
  4. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.script.js +8 -5
  5. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.script.js.map +1 -1
  6. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.d.ts.map +1 -1
  7. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.js.map +1 -1
  8. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js +11 -7
  9. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js.map +1 -1
  10. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.d.ts +36 -0
  11. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.d.ts.map +1 -0
  12. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.js +7 -0
  13. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.js.map +1 -0
  14. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.script.js +69 -0
  15. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.script.js.map +1 -0
  16. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.d.ts +28 -0
  17. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.d.ts.map +1 -0
  18. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.js +7 -0
  19. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.js.map +1 -0
  20. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js +62 -0
  21. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js.map +1 -0
  22. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.d.ts +18 -0
  23. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.d.ts.map +1 -0
  24. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.js +59 -0
  25. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.js.map +1 -0
  26. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/index.d.ts +3 -0
  27. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/index.d.ts.map +1 -0
  28. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts +1 -1
  29. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
  30. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
  31. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js.map +1 -1
  32. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js +6 -3
  33. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js.map +1 -1
  34. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts +2 -2
  35. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts.map +1 -1
  36. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
  37. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js.map +1 -1
  38. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js +4 -2
  39. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js.map +1 -1
  40. package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.d.ts +1 -1
  41. package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.d.ts.map +1 -1
  42. package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js.map +1 -1
  43. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
  44. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
  45. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js.map +1 -1
  46. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js +3 -1
  47. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js.map +1 -1
  48. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.d.ts.map +1 -1
  49. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js.map +1 -1
  50. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js +17 -3
  51. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js.map +1 -1
  52. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts.map +1 -1
  53. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +1 -1
  54. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js.map +1 -1
  55. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js +4 -2
  56. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js.map +1 -1
  57. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.d.ts.map +1 -1
  58. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.js +1 -1
  59. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.js.map +1 -1
  60. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js +16 -12
  61. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js.map +1 -1
  62. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.d.ts.map +1 -1
  63. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js.map +1 -1
  64. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js +11 -7
  65. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js.map +1 -1
  66. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.d.ts.map +1 -1
  67. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js.map +1 -1
  68. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js +7 -4
  69. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js.map +1 -1
  70. package/dist/browser/chunks/AgentScalarChatInterface-D7J_MHKY.js +27 -0
  71. package/dist/browser/chunks/ScalarTextInput.vue-Fb0snAee.js +27 -0
  72. package/dist/browser/chunks/basic-shape-diamond.svg-BTEOT1FL.js +1 -1
  73. package/dist/browser/chunks/basic-shape-hexagon.svg-BSPzaCgF.js +1 -1
  74. package/dist/browser/chunks/basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js +1 -1
  75. package/dist/browser/chunks/basic-shape-primary-square-rectangle.svg-n2YRykHD.js +1 -1
  76. package/dist/browser/chunks/basic-shape-shield.svg-Bec9cJDA.js +1 -1
  77. package/dist/browser/chunks/browser-67K6wmG9.js +1 -1
  78. package/dist/browser/chunks/computer-device-desktop-monitor.svg-m6j893Hb.js +1 -1
  79. package/dist/browser/chunks/computer-device-desktop.svg-Dk1VVO7k.js +1 -1
  80. package/dist/browser/chunks/computer-device-laptop.svg-BNGVUCYS.js +1 -1
  81. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung-back.svg-CC4UUTFw.js +1 -1
  82. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js +1 -1
  83. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x-back.svg-CLm7sgMM.js +1 -1
  84. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x.svg-Xrttg6_7.js +1 -1
  85. package/dist/browser/chunks/computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js +1 -1
  86. package/dist/browser/chunks/computer-device-mobile-tablet.svg-DCr0XlRc.js +1 -1
  87. package/dist/browser/chunks/computer-device-network-ethernet-cat6.svg-AK9l0iOl.js +1 -1
  88. package/dist/browser/chunks/computer-device-network-lan-www.svg-gUIdFBlE.js +1 -1
  89. package/dist/browser/chunks/computer-device-network-wifi-connection.svg-Be-EMm4e.js +1 -1
  90. package/dist/browser/chunks/computer-device-network-wifi-router.svg-Dc2VzyqK.js +1 -1
  91. package/dist/browser/chunks/ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js +1 -1
  92. package/dist/browser/chunks/image-flash-lightning.svg-EETR_y1q.js +1 -1
  93. package/dist/browser/chunks/image-picture-flower.svg-DN1AYzJU.js +1 -1
  94. package/dist/browser/chunks/interface-alert-exclamation-diamond.svg-C5NozMV_.js +1 -1
  95. package/dist/browser/chunks/interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js +1 -1
  96. package/dist/browser/chunks/interface-alert-information-circle.svg-ckkkt9Mv.js +1 -1
  97. package/dist/browser/chunks/interface-award-crown.svg-pjvn9hY-.js +1 -1
  98. package/dist/browser/chunks/interface-bookmark-tag.svg-r2r-lQq4.js +1 -1
  99. package/dist/browser/chunks/interface-bookmark.svg-BK9HKQBT.js +1 -1
  100. package/dist/browser/chunks/interface-calendar-date-one.svg-DNnF0M1I.js +1 -1
  101. package/dist/browser/chunks/interface-content-book-open-pages.svg-CQj_w9Vp.js +1 -1
  102. package/dist/browser/chunks/interface-content-book-page.svg-DppoeJRe.js +1 -1
  103. package/dist/browser/chunks/interface-content-file.svg-CvcD7OiY.js +1 -1
  104. package/dist/browser/chunks/interface-content-folder.svg-BmtS5I9A.js +1 -1
  105. package/dist/browser/chunks/interface-copy-clipboard.svg-Be6EI50X.js +1 -1
  106. package/dist/browser/chunks/interface-edit-attachment.svg-G5TKzpWX.js +1 -1
  107. package/dist/browser/chunks/interface-edit-binocular.svg-jzL-DvGB.js +1 -1
  108. package/dist/browser/chunks/interface-edit-magic-wand.svg-BOTlymvp.js +1 -1
  109. package/dist/browser/chunks/interface-edit-tool-paint-roller.svg-s9dwryx7.js +1 -1
  110. package/dist/browser/chunks/interface-edit-tool-pencil.svg-C7v0dbB3.js +1 -1
  111. package/dist/browser/chunks/interface-favorite-award.svg-CYHUgUG0.js +1 -1
  112. package/dist/browser/chunks/interface-favorite-flag.svg-C10zlKOb.js +1 -1
  113. package/dist/browser/chunks/interface-favorite-heart.svg-eoduXxlz.js +1 -1
  114. package/dist/browser/chunks/interface-favorite-star.svg-BSmxJetr.js +1 -1
  115. package/dist/browser/chunks/interface-favorite-stars-sparkles.svg-JTFLj3Ls.js +1 -1
  116. package/dist/browser/chunks/interface-hierarchy-flowchart.svg-Cg_Wy0kN.js +1 -1
  117. package/dist/browser/chunks/interface-home-house.svg-DytoGRnv.js +1 -1
  118. package/dist/browser/chunks/interface-hyperlink.svg-CuEfmmQI.js +1 -1
  119. package/dist/browser/chunks/interface-lighting-brightness.svg-DSK0h_Pa.js +1 -1
  120. package/dist/browser/chunks/interface-lock-closed.svg-Cn6TaLYv.js +1 -1
  121. package/dist/browser/chunks/interface-lock-open-unlock.svg-CVkG5-9W.js +1 -1
  122. package/dist/browser/chunks/interface-login-key.svg-y-cwwXjN.js +1 -1
  123. package/dist/browser/chunks/interface-search.svg-S-puVFJB.js +1 -1
  124. package/dist/browser/chunks/interface-setting-cog.svg-CTH4_lLg.js +1 -1
  125. package/dist/browser/chunks/interface-share-megaphone-bullhorn.svg-Pbp39MyC.js +1 -1
  126. package/dist/browser/chunks/interface-share-rocket.svg-BgCsIRZO.js +1 -1
  127. package/dist/browser/chunks/interface-share-satellite.svg-DAMN9d5G.js +1 -1
  128. package/dist/browser/chunks/interface-share-space-ship.svg-Dt-Mejxk.js +1 -1
  129. package/dist/browser/chunks/interface-share.svg-vFYTXSti.js +1 -1
  130. package/dist/browser/chunks/interface-signal-square.svg-DNG4LpAe.js +1 -1
  131. package/dist/browser/chunks/interface-time-clock-circle.svg-Bpz-nLxo.js +1 -1
  132. package/dist/browser/chunks/interface-time-hour-glass.svg-D7agfKsH.js +1 -1
  133. package/dist/browser/chunks/interface-users-multiple.svg-CkPJBBnG.js +1 -1
  134. package/dist/browser/chunks/interface-weather-moon.svg-CaTZFMPO.js +1 -1
  135. package/dist/browser/chunks/mail-chat-bubble-square.svg-DC8RIihp.js +1 -1
  136. package/dist/browser/chunks/mail-send-email-paper-airplane.svg-D8OLs9jz.js +1 -1
  137. package/dist/browser/chunks/mail-send-envelope.svg-CV33h5Sx.js +1 -1
  138. package/dist/browser/chunks/{modal-CZI71Aau.js → modal-BLBi4S4R.js} +20 -20
  139. package/dist/browser/chunks/{modal-CKthJJWy.js → modal-BlpWsFBT.js} +2 -2
  140. package/dist/browser/chunks/money-cashier-receipt.svg-CJL8C2gs.js +1 -1
  141. package/dist/browser/chunks/money-currency-dollar-pay.svg-VdBplCTx.js +1 -1
  142. package/dist/browser/chunks/money-graph-arrow-increase.svg-DcRov3zk.js +1 -1
  143. package/dist/browser/chunks/money-graph-bar-chart-increase.svg-Cc7KxjX-.js +1 -1
  144. package/dist/browser/chunks/nature-ecology-leaf.svg-DR3cTZxt.js +1 -1
  145. package/dist/browser/chunks/phone-telephone.svg-DyY0gUlk.js +1 -1
  146. package/dist/browser/chunks/programming-bug.svg-BHLT-Qhp.js +1 -1
  147. package/dist/browser/chunks/programming-cloud.svg-B6YW33ba.js +1 -1
  148. package/dist/browser/chunks/programming-computer-database-server.svg-B6o5Sdn-.js +1 -1
  149. package/dist/browser/chunks/programming-computer-database.svg-Cl7OVtpJ.js +1 -1
  150. package/dist/browser/chunks/programming-module-four-layout.svg-BQrerL1x.js +1 -1
  151. package/dist/browser/chunks/programming-module-three.svg-B2KTQzBM.js +1 -1
  152. package/dist/browser/chunks/programming-module.svg-CiID7kPm.js +1 -1
  153. package/dist/browser/chunks/programming-script-code.svg-D1M5rtkN.js +1 -1
  154. package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +1 -1
  155. package/dist/browser/chunks/shopping-cart.svg-BEegiIR9.js +1 -1
  156. package/dist/browser/chunks/shopping-gift-present.svg-BUHwuLix.js +1 -1
  157. package/dist/browser/chunks/shopping-shipping-box-parcel-package.svg-D6fxWdYx.js +1 -1
  158. package/dist/browser/chunks/tag-new-circle.svg-jsg1bGs0.js +1 -1
  159. package/dist/browser/chunks/travel-map-earth-globe.svg-ClbMiU-f.js +1 -1
  160. package/dist/browser/chunks/vendor-DHN5fsxL.js +306 -0
  161. package/dist/browser/standalone.esm.js +20 -20
  162. package/dist/browser/standalone.js +293 -293
  163. package/dist/components/AgentScalar/AgentScalarButton.vue.d.ts.map +1 -1
  164. package/dist/components/AgentScalar/AgentScalarButton.vue.js.map +1 -1
  165. package/dist/components/AgentScalar/AgentScalarButton.vue.script.js +4 -2
  166. package/dist/components/AgentScalar/AgentScalarButton.vue.script.js.map +1 -1
  167. package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts.map +1 -1
  168. package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +1 -1
  169. package/dist/components/AgentScalar/AgentScalarDrawer.vue.js.map +1 -1
  170. package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js +4 -2
  171. package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js.map +1 -1
  172. package/dist/components/AgentScalar/OpenMCPButton.vue.d.ts.map +1 -1
  173. package/dist/components/AgentScalar/OpenMCPButton.vue.js +1 -1
  174. package/dist/components/AgentScalar/OpenMCPButton.vue.js.map +1 -1
  175. package/dist/components/AgentScalar/OpenMCPButton.vue.script.js +8 -6
  176. package/dist/components/AgentScalar/OpenMCPButton.vue.script.js.map +1 -1
  177. package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
  178. package/dist/components/Anchor/Anchor.vue.js.map +1 -1
  179. package/dist/components/Anchor/Anchor.vue.script.js +5 -3
  180. package/dist/components/Anchor/Anchor.vue.script.js.map +1 -1
  181. package/dist/components/Anchor/WithBreadcrumb.vue.d.ts +1 -3
  182. package/dist/components/Anchor/WithBreadcrumb.vue.d.ts.map +1 -1
  183. package/dist/components/Anchor/WithBreadcrumb.vue.js.map +1 -1
  184. package/dist/components/Anchor/WithBreadcrumb.vue.script.js +6 -2
  185. package/dist/components/Anchor/WithBreadcrumb.vue.script.js.map +1 -1
  186. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  187. package/dist/components/ApiReference.vue.js +1 -1
  188. package/dist/components/ApiReference.vue.js.map +1 -1
  189. package/dist/components/ApiReference.vue.script.js +172 -43
  190. package/dist/components/ApiReference.vue.script.js.map +1 -1
  191. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.d.ts.map +1 -1
  192. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js +1 -1
  193. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js.map +1 -1
  194. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js +6 -2
  195. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js.map +1 -1
  196. package/dist/components/Content/AsyncApi/Message.vue.script.js +1 -1
  197. package/dist/components/Content/Auth/Auth.vue.d.ts.map +1 -1
  198. package/dist/components/Content/Auth/Auth.vue.js.map +1 -1
  199. package/dist/components/Content/Auth/Auth.vue.script.js +5 -2
  200. package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -1
  201. package/dist/components/Content/Content.vue.d.ts +1 -0
  202. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  203. package/dist/components/Content/Content.vue.js.map +1 -1
  204. package/dist/components/Content/Content.vue.script.js +4 -1
  205. package/dist/components/Content/Content.vue.script.js.map +1 -1
  206. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +3 -1
  207. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  208. package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -1
  209. package/dist/components/Content/Operations/TraversedEntry.vue.script.js +9 -0
  210. package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
  211. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  212. package/dist/components/Content/Schema/Schema.vue.js +1 -1
  213. package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
  214. package/dist/components/Content/Schema/Schema.vue.script.js +100 -16
  215. package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
  216. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  217. package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
  218. package/dist/components/Content/Schema/SchemaComposition.vue.script.js +9 -11
  219. package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
  220. package/dist/components/Content/Schema/SchemaEnums.vue.d.ts.map +1 -1
  221. package/dist/components/Content/Schema/SchemaEnums.vue.js +1 -1
  222. package/dist/components/Content/Schema/SchemaEnums.vue.js.map +1 -1
  223. package/dist/components/Content/Schema/SchemaEnums.vue.script.js +4 -2
  224. package/dist/components/Content/Schema/SchemaEnums.vue.script.js.map +1 -1
  225. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
  226. package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
  227. package/dist/components/Content/Schema/SchemaHeading.vue.js.map +1 -1
  228. package/dist/components/Content/Schema/SchemaHeading.vue.script.js +5 -3
  229. package/dist/components/Content/Schema/SchemaHeading.vue.script.js.map +1 -1
  230. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -1
  231. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js +1 -1
  232. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js.map +1 -1
  233. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  234. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -1
  235. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +12 -0
  236. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
  237. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +3 -1
  238. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  239. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  240. package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
  241. package/dist/components/Content/Schema/SchemaProperty.vue.script.js +41 -9
  242. package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
  243. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.d.ts.map +1 -1
  244. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +1 -1
  245. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js.map +1 -1
  246. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js +8 -5
  247. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js.map +1 -1
  248. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
  249. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +1 -1
  250. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js.map +1 -1
  251. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js +5 -3
  252. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js.map +1 -1
  253. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +3 -1
  254. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  255. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  256. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js.map +1 -1
  257. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +48 -23
  258. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -1
  259. package/dist/components/Content/Schema/helpers/dynamic-scope.d.ts +27 -0
  260. package/dist/components/Content/Schema/helpers/dynamic-scope.d.ts.map +1 -0
  261. package/dist/components/Content/Schema/helpers/dynamic-scope.js +35 -0
  262. package/dist/components/Content/Schema/helpers/dynamic-scope.js.map +1 -0
  263. package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts +10 -0
  264. package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts.map +1 -1
  265. package/dist/components/Content/Schema/helpers/get-compositions-to-render.js +11 -2
  266. package/dist/components/Content/Schema/helpers/get-compositions-to-render.js.map +1 -1
  267. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +9 -2
  268. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
  269. package/dist/components/Content/Tags/components/ModernLayout.vue.d.ts.map +1 -1
  270. package/dist/components/Content/Tags/components/ModernLayout.vue.js +1 -1
  271. package/dist/components/Content/Tags/components/ModernLayout.vue.js.map +1 -1
  272. package/dist/components/Content/Tags/components/ModernLayout.vue.script.js +3 -1
  273. package/dist/components/Content/Tags/components/ModernLayout.vue.script.js.map +1 -1
  274. package/dist/components/Content/Tags/components/TagSection.vue.d.ts.map +1 -1
  275. package/dist/components/Content/Tags/components/TagSection.vue.js.map +1 -1
  276. package/dist/components/Content/Tags/components/TagSection.vue.script.js +3 -1
  277. package/dist/components/Content/Tags/components/TagSection.vue.script.js.map +1 -1
  278. package/dist/components/GettingStarted.vue.d.ts.map +1 -1
  279. package/dist/components/GettingStarted.vue.js +1 -1
  280. package/dist/components/GettingStarted.vue.js.map +1 -1
  281. package/dist/components/GettingStarted.vue.script.js +58 -21
  282. package/dist/components/GettingStarted.vue.script.js.map +1 -1
  283. package/dist/components/MobileHeader.vue.d.ts.map +1 -1
  284. package/dist/components/MobileHeader.vue.js.map +1 -1
  285. package/dist/components/MobileHeader.vue.script.js +3 -1
  286. package/dist/components/MobileHeader.vue.script.js.map +1 -1
  287. package/dist/components/OperationsList/OperationsList.vue.d.ts.map +1 -1
  288. package/dist/components/OperationsList/OperationsList.vue.js +1 -1
  289. package/dist/components/OperationsList/OperationsList.vue.js.map +1 -1
  290. package/dist/components/OperationsList/OperationsList.vue.script.js +4 -2
  291. package/dist/components/OperationsList/OperationsList.vue.script.js.map +1 -1
  292. package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
  293. package/dist/components/ShowMoreButton.vue.js +1 -1
  294. package/dist/components/ShowMoreButton.vue.js.map +1 -1
  295. package/dist/components/ShowMoreButton.vue.script.js +4 -2
  296. package/dist/components/ShowMoreButton.vue.script.js.map +1 -1
  297. package/dist/features/Operation/Operation.vue.d.ts +3 -1
  298. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  299. package/dist/features/Operation/Operation.vue.js.map +1 -1
  300. package/dist/features/Operation/Operation.vue.script.js +6 -1
  301. package/dist/features/Operation/Operation.vue.script.js.map +1 -1
  302. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
  303. package/dist/features/Operation/components/ContentTypeSelect.vue.js.map +1 -1
  304. package/dist/features/Operation/components/ContentTypeSelect.vue.script.js +4 -2
  305. package/dist/features/Operation/components/ContentTypeSelect.vue.script.js.map +1 -1
  306. package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
  307. package/dist/features/Operation/components/Headers.vue.js +1 -1
  308. package/dist/features/Operation/components/Headers.vue.js.map +1 -1
  309. package/dist/features/Operation/components/Headers.vue.script.js +8 -6
  310. package/dist/features/Operation/components/Headers.vue.script.js.map +1 -1
  311. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  312. package/dist/features/Operation/components/OperationParameters.vue.js.map +1 -1
  313. package/dist/features/Operation/components/OperationParameters.vue.script.js +8 -6
  314. package/dist/features/Operation/components/OperationParameters.vue.script.js.map +1 -1
  315. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  316. package/dist/features/Operation/components/OperationResponses.vue.js.map +1 -1
  317. package/dist/features/Operation/components/OperationResponses.vue.script.js +10 -7
  318. package/dist/features/Operation/components/OperationResponses.vue.script.js.map +1 -1
  319. package/dist/features/Operation/components/ParameterListItem.vue.script.js +1 -1
  320. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  321. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  322. package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
  323. package/dist/features/Operation/components/RequestBody.vue.script.js +21 -14
  324. package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
  325. package/dist/features/Operation/components/SecurityRequirementBadge.vue.d.ts.map +1 -1
  326. package/dist/features/Operation/components/SecurityRequirementBadge.vue.js.map +1 -1
  327. package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js +5 -3
  328. package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js.map +1 -1
  329. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
  330. package/dist/features/Operation/components/callbacks/Callbacks.vue.js.map +1 -1
  331. package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js +11 -8
  332. package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js.map +1 -1
  333. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  334. package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
  335. package/dist/features/Operation/layouts/ClassicLayout.vue.js.map +1 -1
  336. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +37 -17
  337. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -1
  338. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  339. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  340. package/dist/features/Operation/layouts/ModernLayout.vue.js.map +1 -1
  341. package/dist/features/Operation/layouts/ModernLayout.vue.script.js +22 -7
  342. package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
  343. package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
  344. package/dist/features/Search/components/SearchButton.vue.js.map +1 -1
  345. package/dist/features/Search/components/SearchButton.vue.script.js +15 -8
  346. package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -1
  347. package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
  348. package/dist/features/Search/components/SearchModal.vue.js +1 -1
  349. package/dist/features/Search/components/SearchModal.vue.js.map +1 -1
  350. package/dist/features/Search/components/SearchModal.vue.script.js +29 -10
  351. package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -1
  352. package/dist/features/Search/components/SearchResult.vue.d.ts.map +1 -1
  353. package/dist/features/Search/components/SearchResult.vue.js.map +1 -1
  354. package/dist/features/Search/components/SearchResult.vue.script.js +12 -8
  355. package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -1
  356. package/dist/features/Search/helpers/create-search-index.d.ts +8 -0
  357. package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
  358. package/dist/features/Search/helpers/create-search-index.js +18 -9
  359. package/dist/features/Search/helpers/create-search-index.js.map +1 -1
  360. package/dist/features/Search/hooks/useSearchIndex.d.ts +7 -1
  361. package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -1
  362. package/dist/features/Search/hooks/useSearchIndex.js +11 -2
  363. package/dist/features/Search/hooks/useSearchIndex.js.map +1 -1
  364. package/dist/features/ask-agent-button/AskAgentButton.vue.d.ts.map +1 -1
  365. package/dist/features/ask-agent-button/AskAgentButton.vue.js +1 -1
  366. package/dist/features/ask-agent-button/AskAgentButton.vue.js.map +1 -1
  367. package/dist/features/ask-agent-button/AskAgentButton.vue.script.js +10 -6
  368. package/dist/features/ask-agent-button/AskAgentButton.vue.script.js.map +1 -1
  369. package/dist/features/developer-tools/DeveloperTools.vue.d.ts.map +1 -1
  370. package/dist/features/developer-tools/DeveloperTools.vue.js.map +1 -1
  371. package/dist/features/developer-tools/DeveloperTools.vue.script.js +10 -8
  372. package/dist/features/developer-tools/DeveloperTools.vue.script.js.map +1 -1
  373. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.d.ts.map +1 -1
  374. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js.map +1 -1
  375. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js +11 -11
  376. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js.map +1 -1
  377. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +1 -1
  378. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js.map +1 -1
  379. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js +15 -11
  380. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -1
  381. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js +1 -1
  382. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.d.ts +1 -3
  383. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.d.ts.map +1 -1
  384. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js.map +1 -1
  385. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js +4 -6
  386. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js.map +1 -1
  387. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.d.ts.map +1 -1
  388. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js.map +1 -1
  389. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js +6 -4
  390. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js.map +1 -1
  391. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -1
  392. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js.map +1 -1
  393. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js +23 -22
  394. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js.map +1 -1
  395. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.d.ts.map +1 -1
  396. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js.map +1 -1
  397. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js +7 -5
  398. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js.map +1 -1
  399. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.d.ts.map +1 -1
  400. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js.map +1 -1
  401. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js +9 -7
  402. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js.map +1 -1
  403. package/dist/features/developer-tools/components/DeployApiReference.vue.d.ts.map +1 -1
  404. package/dist/features/developer-tools/components/DeployApiReference.vue.js.map +1 -1
  405. package/dist/features/developer-tools/components/DeployApiReference.vue.script.js +7 -4
  406. package/dist/features/developer-tools/components/DeployApiReference.vue.script.js.map +1 -1
  407. package/dist/features/developer-tools/components/ModifyConfiguration.vue.d.ts.map +1 -1
  408. package/dist/features/developer-tools/components/ModifyConfiguration.vue.js.map +1 -1
  409. package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js +8 -6
  410. package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js.map +1 -1
  411. package/dist/features/developer-tools/components/ShareApiReference.vue.d.ts.map +1 -1
  412. package/dist/features/developer-tools/components/ShareApiReference.vue.js.map +1 -1
  413. package/dist/features/developer-tools/components/ShareApiReference.vue.script.js +7 -4
  414. package/dist/features/developer-tools/components/ShareApiReference.vue.script.js.map +1 -1
  415. package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
  416. package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
  417. package/dist/features/example-responses/ExampleResponse.vue.js.map +1 -1
  418. package/dist/features/example-responses/ExampleResponse.vue.script.js +5 -3
  419. package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
  420. package/dist/features/example-responses/ExampleResponses.vue.d.ts +9 -0
  421. package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
  422. package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
  423. package/dist/features/example-responses/ExampleResponses.vue.js.map +1 -1
  424. package/dist/features/example-responses/ExampleResponses.vue.script.js +42 -23
  425. package/dist/features/example-responses/ExampleResponses.vue.script.js.map +1 -1
  426. package/dist/features/example-responses/ExampleSchema.vue.js.map +1 -1
  427. package/dist/features/example-responses/ExampleSchema.vue.script.js +1 -1
  428. package/dist/features/example-responses/ExampleSchema.vue.script.js.map +1 -1
  429. package/dist/features/info-object/Contact.vue.d.ts.map +1 -1
  430. package/dist/features/info-object/Contact.vue.js.map +1 -1
  431. package/dist/features/info-object/Contact.vue.script.js +14 -11
  432. package/dist/features/info-object/Contact.vue.script.js.map +1 -1
  433. package/dist/features/info-object/InfoLink.vue.d.ts +8 -0
  434. package/dist/features/info-object/InfoLink.vue.d.ts.map +1 -0
  435. package/dist/features/info-object/InfoLink.vue.js +7 -0
  436. package/dist/features/info-object/InfoLink.vue.js.map +1 -0
  437. package/dist/features/info-object/InfoLink.vue.script.js +30 -0
  438. package/dist/features/info-object/InfoLink.vue.script.js.map +1 -0
  439. package/dist/features/info-object/TermsOfService.vue.d.ts.map +1 -1
  440. package/dist/features/info-object/TermsOfService.vue.js.map +1 -1
  441. package/dist/features/info-object/TermsOfService.vue.script.js +9 -6
  442. package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -1
  443. package/dist/features/info-object/index.d.ts +1 -0
  444. package/dist/features/info-object/index.d.ts.map +1 -1
  445. package/dist/features/localization/index.d.ts +2 -0
  446. package/dist/features/localization/index.d.ts.map +1 -0
  447. package/dist/features/localization/locales/ar.d.ts +227 -0
  448. package/dist/features/localization/locales/ar.d.ts.map +1 -0
  449. package/dist/features/localization/locales/ar.js +225 -0
  450. package/dist/features/localization/locales/ar.js.map +1 -0
  451. package/dist/features/localization/locales/de.d.ts +227 -0
  452. package/dist/features/localization/locales/de.d.ts.map +1 -0
  453. package/dist/features/localization/locales/de.js +225 -0
  454. package/dist/features/localization/locales/de.js.map +1 -0
  455. package/dist/features/localization/locales/en.d.ts +227 -0
  456. package/dist/features/localization/locales/en.d.ts.map +1 -0
  457. package/dist/features/localization/locales/en.js +225 -0
  458. package/dist/features/localization/locales/en.js.map +1 -0
  459. package/dist/features/localization/locales/es.d.ts +227 -0
  460. package/dist/features/localization/locales/es.d.ts.map +1 -0
  461. package/dist/features/localization/locales/es.js +225 -0
  462. package/dist/features/localization/locales/es.js.map +1 -0
  463. package/dist/features/localization/locales/fr.d.ts +227 -0
  464. package/dist/features/localization/locales/fr.d.ts.map +1 -0
  465. package/dist/features/localization/locales/fr.js +225 -0
  466. package/dist/features/localization/locales/fr.js.map +1 -0
  467. package/dist/features/localization/locales/ru.d.ts +227 -0
  468. package/dist/features/localization/locales/ru.d.ts.map +1 -0
  469. package/dist/features/localization/locales/ru.js +225 -0
  470. package/dist/features/localization/locales/ru.js.map +1 -0
  471. package/dist/features/localization/locales/zh-cn.d.ts +227 -0
  472. package/dist/features/localization/locales/zh-cn.d.ts.map +1 -0
  473. package/dist/features/localization/locales/zh-cn.js +225 -0
  474. package/dist/features/localization/locales/zh-cn.js.map +1 -0
  475. package/dist/features/localization/translations.d.ts +1588 -0
  476. package/dist/features/localization/translations.d.ts.map +1 -0
  477. package/dist/features/localization/translations.js +27 -0
  478. package/dist/features/localization/translations.js.map +1 -0
  479. package/dist/features/localization/use-localization.d.ts +18 -0
  480. package/dist/features/localization/use-localization.d.ts.map +1 -0
  481. package/dist/features/localization/use-localization.js +58 -0
  482. package/dist/features/localization/use-localization.js.map +1 -0
  483. package/dist/features/multiple-documents/DocumentSelector.vue.script.js +1 -1
  484. package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -1
  485. package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
  486. package/dist/features/test-request-button/TestRequestButton.vue.js.map +1 -1
  487. package/dist/features/test-request-button/TestRequestButton.vue.script.js +3 -1
  488. package/dist/features/test-request-button/TestRequestButton.vue.script.js.map +1 -1
  489. package/dist/helpers/is-introduction-entry.d.ts +16 -0
  490. package/dist/helpers/is-introduction-entry.d.ts.map +1 -0
  491. package/dist/helpers/is-introduction-entry.js +17 -0
  492. package/dist/helpers/is-introduction-entry.js.map +1 -0
  493. package/dist/helpers/load-from-perssistance.js +1 -1
  494. package/dist/helpers/load-from-perssistance.js.map +1 -1
  495. package/dist/helpers/map-config-to-workspace-store.js +1 -1
  496. package/dist/helpers/map-config-to-workspace-store.js.map +1 -1
  497. package/dist/helpers/storage.d.ts +14 -14
  498. package/dist/style.css +446 -434
  499. package/dist/styles/tailwind.config.css +1 -0
  500. package/dist/vue-styles.css +383 -380
  501. package/package.json +17 -16
  502. package/dist/browser/chunks/AgentScalarChatInterface-BhUn0w1j.js +0 -27
  503. package/dist/browser/chunks/ScalarTextInput.vue-BUzf4Z_k.js +0 -27
  504. package/dist/browser/chunks/vendor-BeJNu9KM.js +0 -306
  505. package/dist/features/Operation/helpers/get-first-server.d.ts +0 -9
  506. package/dist/features/Operation/helpers/get-first-server.d.ts.map +0 -1
  507. package/dist/features/Operation/helpers/get-first-server.js +0 -27
  508. package/dist/features/Operation/helpers/get-first-server.js.map +0 -1
@@ -1,9 +1,13 @@
1
+ import { useLocalization } from "../../../features/localization/use-localization.js";
1
2
  import ScreenReader_default from "../../ScreenReader.vue.js";
2
3
  import { scrollTargetId } from "../../../helpers/lazy-bus.js";
4
+ import { SCHEMA_DYNAMIC_SCOPE_SYMBOL, resolveDynamicSchema, useDynamicScope } from "./helpers/dynamic-scope.js";
5
+ import { inferDiscriminatorMappingComposition } from "./helpers/get-compositions-to-render.js";
3
6
  import { isTypeObject } from "./helpers/is-type-object.js";
4
7
  import { isEmptySchemaObject } from "./helpers/is-empty-schema-object.js";
5
8
  import { mergeAllOfSchemas } from "./helpers/merge-all-of-schemas.js";
6
9
  import { SCHEMA_ANCESTORS_SYMBOL } from "./helpers/schema-cycle.js";
10
+ import SchemaComposition_default from "./SchemaComposition.vue.js";
7
11
  import SchemaHeading_default from "./SchemaHeading.vue.js";
8
12
  import SchemaProperty_default from "./SchemaProperty.vue.js";
9
13
  import SchemaObjectProperties_default from "./SchemaObjectProperties.vue.js";
@@ -11,6 +15,8 @@ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock
11
15
  import { Disclosure, DisclosureButton, DisclosurePanel } from "@headlessui/vue";
12
16
  import { ScalarMarkdown } from "@scalar/components/markdown";
13
17
  import { ScalarIcon } from "@scalar/components/icon";
18
+ import { resolve } from "@scalar/workspace-store/resolve";
19
+ import { pushDynamicScope } from "@scalar/workspace-store/helpers/dynamic-ref";
14
20
  //#region src/components/Content/Schema/Schema.vue?vue&type=script&setup=true&lang.ts
15
21
  var _hoisted_1 = {
16
22
  key: 0,
@@ -54,6 +60,39 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
54
60
  cycleKey: {}
55
61
  },
56
62
  setup(__props) {
63
+ const { translate } = useLocalization();
64
+ /**
65
+ * The dynamic scope inherited from ancestor schema resources.
66
+ *
67
+ * Used to bind JSON Schema 2020-12 `$dynamicRef`s to the active `$dynamicAnchor` while walking the
68
+ * tree. Empty at the root. See {@link useDynamicScope}.
69
+ */
70
+ const dynamicScope = useDynamicScope();
71
+ /**
72
+ * The schema this node actually renders.
73
+ *
74
+ * Two normalizations happen here, both no-ops for ordinary schemas:
75
+ * - A top-level `$dynamicRef` is bound to its concrete type via the inherited dynamic scope.
76
+ * - A resource that extends a template through a root `$ref` (JSON Schema 2020-12 `$ref` alongside
77
+ * `$defs`, e.g. a `PaginatedResponse` binding) is merged so its inherited properties render.
78
+ */
79
+ const resolvedSchema = computed(() => {
80
+ if (!__props.schema || typeof __props.schema !== "object") return __props.schema;
81
+ const bound = resolveDynamicSchema(__props.schema, dynamicScope);
82
+ return "$ref" in bound ? resolve.schema(bound) : bound;
83
+ });
84
+ /**
85
+ * Re-provide the dynamic scope grown with this resource so nested `$dynamicRef`s bind here.
86
+ *
87
+ * Built once at setup from the resource's stable identity (like the ancestor set below);
88
+ * `pushDynamicScope` only grows the scope for schemas that can carry a `$dynamicAnchor`.
89
+ *
90
+ * The raw schema is pushed, not the merged {@link resolvedSchema}: merging through `resolve.schema`
91
+ * coerces the node and drops the resolved `$ref-value` from entries inside `$defs`, which
92
+ * `$dynamicAnchor` resolution relies on to dereference the bound type (e.g. `User`).
93
+ */
94
+ const scopeSchema = __props.schema ? resolveDynamicSchema(__props.schema, dynamicScope) : void 0;
95
+ provide(SCHEMA_DYNAMIC_SCOPE_SYMBOL, scopeSchema ? pushDynamicScope(dynamicScope, scopeSchema) : dynamicScope);
57
96
  /**
58
97
  * Cycle-safe `expandAllSchemaProperties`.
59
98
  *
@@ -101,20 +140,37 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
101
140
  * not when the target changes for an already-mounted disclosure.
102
141
  */
103
142
  const defaultOpen = computed(() => __props.noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value);
143
+ const childAttributesLabel = computed(() => __props.schema?.title ?? translate("schema.childAttributes"));
104
144
  /** Gets the description to show for the schema */
105
145
  const schemaDescription = computed(() => {
146
+ const value = resolvedSchema.value;
106
147
  if (__props.hideDescription) return null;
107
148
  if (__props.schema?.allOf && __props.schema.allOf.length > 0 && __props.name === "Request Body") return mergeAllOfSchemas(__props.schema)?.description || null;
108
- if (!__props.schema?.description || typeof __props.schema.description !== "string") return null;
109
- if (__props.schema.enum) return null;
110
- if (!("properties" in __props.schema) && !("patternProperties" in __props.schema) && !("additionalProperties" in __props.schema)) return null;
111
- return __props.schema.description;
149
+ if (!value?.description || typeof value.description !== "string") return null;
150
+ if (value.enum) return null;
151
+ if (!("properties" in value) && !("patternProperties" in value) && !("additionalProperties" in value)) return null;
152
+ return value.description;
112
153
  });
154
+ /**
155
+ * Some generators (for example NSwag) describe a polymorphic base type as a
156
+ * plain object with a `discriminator.mapping` but no explicit `oneOf`. We infer
157
+ * the variant composition from the mapping so the selector still renders.
158
+ *
159
+ * The `discriminator` prop is only set when this schema is already a variant
160
+ * being rendered inside a `SchemaComposition`; skipping the inference in that
161
+ * case avoids re-inferring (and recursing) on a self-referential mapping.
162
+ *
163
+ * The inference is restricted to plain object schemas (`isTypeObject`). A schema
164
+ * carrying its own composition keyword (`allOf`/`not`) is rendered by the
165
+ * `SchemaProperty` branch below; inferring a selector there would replace that
166
+ * keyword's output with the variant dropdown instead of rendering both.
167
+ */
168
+ const inferredDiscriminatorComposition = computed(() => __props.schema && !__props.discriminator && isTypeObject(__props.schema) ? inferDiscriminatorMappingComposition(__props.schema, __props.options.document) : null);
113
169
  const handleClick = (e) => {
114
170
  if (__props.noncollapsible) e.stopPropagation();
115
171
  };
116
172
  return (_ctx, _cache) => {
117
- return typeof __props.schema === "object" && Object.keys(__props.schema).length ? (openBlock(), createBlock(unref(Disclosure), {
173
+ return resolvedSchema.value && Object.keys(resolvedSchema.value).length ? (openBlock(), createBlock(unref(Disclosure), {
118
174
  key: 0,
119
175
  defaultOpen: defaultOpen.value
120
176
  }, {
@@ -127,7 +183,7 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
127
183
  { "border-t": __props.additionalProperties && open }
128
184
  ]]) }, [
129
185
  schemaDescription.value ? (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(unref(ScalarMarkdown), { value: schemaDescription.value }, null, 8, ["value"])])) : createCommentVNode("", true),
130
- unref(isEmptySchemaObject)(__props.schema) ? (openBlock(), createElementBlock("div", _hoisted_2, " Empty object ")) : createCommentVNode("", true),
186
+ unref(isEmptySchemaObject)(resolvedSchema.value) ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(unref(translate)("schema.emptyObject")), 1)) : createCommentVNode("", true),
131
187
  createElementVNode("div", { class: normalizeClass(["schema-properties", { "schema-properties-open": open }]) }, [__props.additionalProperties ? withDirectives((openBlock(), createElementBlock("div", _hoisted_3, [createVNode(unref(DisclosureButton), {
132
188
  as: "button",
133
189
  class: "schema-card-title schema-card-title--compact",
@@ -139,9 +195,9 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
139
195
  icon: "Add",
140
196
  size: "sm"
141
197
  }),
142
- _cache[0] || (_cache[0] = createTextVNode(" Show additional properties ", -1)),
198
+ createTextVNode(" " + toDisplayString(unref(translate)("schema.showAdditionalProperties")) + " ", 1),
143
199
  __props.name ? (openBlock(), createBlock(ScreenReader_default, { key: 0 }, {
144
- default: withCtx(() => [createTextVNode("for " + toDisplayString(__props.name), 1)]),
200
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("schema.forName", { name: __props.name })), 1)]),
145
201
  _: 1
146
202
  })) : createCommentVNode("", true)
147
203
  ]),
@@ -159,9 +215,9 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
159
215
  icon: "Add",
160
216
  size: "sm"
161
217
  }, null, 8, ["class"]),
162
- open ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" Hide " + toDisplayString(__props.schema?.title ?? "Child Attributes"), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(" Show " + toDisplayString(__props.schema?.title ?? "Child Attributes"), 1)], 64)),
218
+ open ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(unref(translate)("schema.hideChildAttributes", { name: childAttributesLabel.value })), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(unref(translate)("schema.showChildAttributes", { name: childAttributesLabel.value })), 1)], 64)),
163
219
  __props.name ? (openBlock(), createBlock(ScreenReader_default, { key: 2 }, {
164
- default: withCtx(() => [createTextVNode("for " + toDisplayString(__props.name), 1)]),
220
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("schema.forName", { name: __props.name })), 1)]),
165
221
  _: 1
166
222
  })) : createCommentVNode("", true)
167
223
  ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(unref(ScalarIcon), {
@@ -169,8 +225,8 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
169
225
  icon: "Add",
170
226
  size: "sm"
171
227
  }, null, 8, ["class"]), createVNode(SchemaHeading_default, {
172
- name: __props.schema?.title ?? __props.name,
173
- value: __props.schema
228
+ name: resolvedSchema.value?.title ?? __props.name,
229
+ value: resolvedSchema.value
174
230
  }, null, 8, ["name", "value"])], 64))]),
175
231
  _: 2
176
232
  }, 1032, [
@@ -182,10 +238,38 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
182
238
  as: "ul",
183
239
  static: !shouldShowToggle.value
184
240
  }, {
185
- default: withCtx(() => [unref(isTypeObject)(__props.schema) ? (openBlock(), createBlock(SchemaObjectProperties_default, {
241
+ default: withCtx(() => [inferredDiscriminatorComposition.value ? (openBlock(), createBlock(SchemaComposition_default, {
186
242
  key: 0,
187
243
  breadcrumb: __props.breadcrumb,
188
244
  compact: __props.compact,
245
+ composition: "oneOf",
246
+ compositionPath: __props.compositionPath,
247
+ discriminator: __props.schema?.discriminator,
248
+ eventBus: __props.eventBus,
249
+ hideHeading: __props.hideHeading,
250
+ hideModelNames: __props.hideModelNames,
251
+ level: __props.level,
252
+ name: __props.name,
253
+ options: __props.options,
254
+ schema: inferredDiscriminatorComposition.value,
255
+ schemaContext: __props.schemaContext
256
+ }, null, 8, [
257
+ "breadcrumb",
258
+ "compact",
259
+ "compositionPath",
260
+ "discriminator",
261
+ "eventBus",
262
+ "hideHeading",
263
+ "hideModelNames",
264
+ "level",
265
+ "name",
266
+ "options",
267
+ "schema",
268
+ "schemaContext"
269
+ ])) : unref(isTypeObject)(resolvedSchema.value) ? (openBlock(), createBlock(SchemaObjectProperties_default, {
270
+ key: 1,
271
+ breadcrumb: __props.breadcrumb,
272
+ compact: __props.compact,
189
273
  compositionPath: __props.compositionPath,
190
274
  discriminator: __props.discriminator,
191
275
  eventBus: __props.eventBus,
@@ -193,7 +277,7 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
193
277
  hideModelNames: __props.hideModelNames,
194
278
  level: __props.level + 1,
195
279
  options: __props.options,
196
- schema: __props.schema,
280
+ schema: resolvedSchema.value,
197
281
  schemaContext: __props.schemaContext
198
282
  }, null, 8, [
199
283
  "breadcrumb",
@@ -207,7 +291,7 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
207
291
  "options",
208
292
  "schema",
209
293
  "schemaContext"
210
- ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [__props.schema ? (openBlock(), createBlock(SchemaProperty_default, {
294
+ ])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [resolvedSchema.value ? (openBlock(), createBlock(SchemaProperty_default, {
211
295
  key: 0,
212
296
  breadcrumb: __props.breadcrumb,
213
297
  compact: __props.compact,
@@ -217,7 +301,7 @@ var Schema_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
217
301
  hideModelNames: __props.hideModelNames,
218
302
  level: __props.level,
219
303
  options: __props.options,
220
- schema: __props.schema,
304
+ schema: resolvedSchema.value,
221
305
  schemaContext: __props.schemaContext
222
306
  }, null, 8, [
223
307
  "breadcrumb",
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, provide } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { scrollTargetId } from '@/helpers/lazy-bus'\n\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n}>()\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => !noncollapsible && level > 0)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnScrollTargetPath = computed((): boolean => {\n if (!breadcrumb?.length) {\n return false\n }\n const path = breadcrumb.join('.')\n const target = scrollTargetId.value\n return target === path || target.startsWith(`${path}.`)\n})\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * Note: the Disclosure only reads this at mount, so it expands collapsed\n * properties on a fresh navigation (the schema mounts after the target is set),\n * not when the target changes for an already-mounted disclosure.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value,\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the description of the merged allOf schema.\n // Merging keeps the base description (when set) and otherwise lets the last allOf\n // member win, matching how the merged composition is rendered below. The nested\n // merged Schema in `SchemaComposition` hides its own description in this case so\n // the text is not rendered twice.\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return mergeAllOfSchemas(schema)?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!schema?.description || typeof schema.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (schema.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in schema) &&\n !('patternProperties' in schema) &&\n !('additionalProperties' in schema)\n ) {\n return null\n }\n\n // Return the schema's own description\n return schema.description\n})\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => {\n if (noncollapsible) {\n e.stopPropagation()\n }\n}\n</script>\n<template>\n <Disclosure\n v-if=\"typeof schema === 'object' && Object.keys(schema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"defaultOpen\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(schema)\"\n class=\"pt-2\">\n Empty object\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n Show additional properties\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n Hide {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <template v-else>\n Show {{ schema?.title ?? 'Child Attributes' }}\n </template>\n <ScreenReader v-if=\"name\">for {{ name }}</ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"schema?.title ?? name\"\n :value=\"schema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Object properties -->\n <SchemaObjectProperties\n v-if=\"isTypeObject(schema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"schema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuFA,MAAM,YAAY,OAAO,yBAAyB,KAAA,EAAS;EAE3D,MAAM,WAAW,eACA,QAAA,YAAY,QAAQ,CAAC,CAAC,WAAW,IAAI,QAAA,SAAS,CAC/D;EAIA,MAAM,iBAAiB,IAAI,IAAa,aAAa,EAAE,CAAA;AACvD,MAAI,QAAA,YAAY,KACd,gBAAe,IAAI,QAAA,SAAQ;AAE7B,UAAQ,yBAAyB,eAAc;EAE/C,MAAM,oBAAoB,eACT,CAAC,CAAC,QAAA,QAAQ,6BAA6B,CAAC,SAAS,MAClE;;;;;EAMA,MAAM,mBAAmB,eAAwB,CAAC,QAAA,kBAAkB,QAAA,QAAQ,EAAC;;;;;;;;;EAU7E,MAAM,uBAAuB,eAAwB;AACnD,OAAI,CAAC,QAAA,YAAY,OACf,QAAO;GAET,MAAM,OAAO,QAAA,WAAW,KAAK,IAAG;GAChC,MAAM,SAAS,eAAe;AAC9B,UAAO,WAAW,QAAQ,OAAO,WAAW,GAAG,KAAK,GAAE;IACvD;;;;;;;;;;;;EAaD,MAAM,cAAc,eAEhB,QAAA,kBAAkB,kBAAkB,SAAS,qBAAqB,MACtE;;EAGA,MAAM,oBAAoB,eAAe;AACvC,OAAI,QAAA,gBACF,QAAO;AAQT,OAAI,QAAA,QAAQ,SAAS,QAAA,OAA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EoB,uBAAA;OADjB,MAAM,QAAA,QAAQ,SAAS,QAAA;OACvB,OAAO,QAAA;;;;;;;oBA9BH,QAAA,eAAW,EAAM,QAAA,kBAAkB,QAAA,SAAO,CAAA,CAAA,GAAA,mBAAA,IAAA,KAAA,EAAA,CAkC5C,QAAA,wBAAwB,QAAA,WAAA,EADjC,YAiCkB,MAAA,gBAAA,EAAA;;MA/BhB,IAAG;MACF,QAAM,CAAG,iBAAA;;6BAcyB,CAX3B,MAAA,aAAY,CAAC,QAAA,OAAM,IAAA,WAAA,EAD3B,YAYmC,gCAAA;;OAVhC,YAAA,QAAA;OACA,SAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,eAAA,QAAA;OACA,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAO,QAAA,QAAK;OACZ,SAAA,QAAA;OACA,QAAA,QAAA;OACA,eAAe,QAAA;;;;;;;;;;;;;0BAElB,mBAaW,UAAA,EAAA,KAAA,GAAA,EAAA,CAXD,QAAA,UAAA,WAAA,EADR,YAWmC,wBAAA;;OAThC,YAAA,QAAA;OACA,SAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAA,QAAA;OACA,SAAA,QAAA;OACA,QAAA,QAAA;OACA,eAAe,QAAA"}
1
+ {"version":3,"file":"Schema.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { pushDynamicScope } from '@scalar/workspace-store/helpers/dynamic-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, provide } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\nimport { scrollTargetId } from '@/helpers/lazy-bus'\n\nimport {\n resolveDynamicSchema,\n SCHEMA_DYNAMIC_SCOPE_SYMBOL,\n useDynamicScope,\n} from './helpers/dynamic-scope'\nimport { inferDiscriminatorMappingComposition } from './helpers/get-compositions-to-render'\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport SchemaComposition from './SchemaComposition.vue'\nimport SchemaHeading from './SchemaHeading.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst {\n schema,\n level = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n discriminator,\n breadcrumb,\n hideModelNames = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<{\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n}>()\nconst { translate } = useLocalization()\n\n/**\n * The dynamic scope inherited from ancestor schema resources.\n *\n * Used to bind JSON Schema 2020-12 `$dynamicRef`s to the active `$dynamicAnchor` while walking the\n * tree. Empty at the root. See {@link useDynamicScope}.\n */\nconst dynamicScope = useDynamicScope()\n\n/**\n * The schema this node actually renders.\n *\n * Two normalizations happen here, both no-ops for ordinary schemas:\n * - A top-level `$dynamicRef` is bound to its concrete type via the inherited dynamic scope.\n * - A resource that extends a template through a root `$ref` (JSON Schema 2020-12 `$ref` alongside\n * `$defs`, e.g. a `PaginatedResponse` binding) is merged so its inherited properties render.\n */\nconst resolvedSchema = computed((): SchemaObject | undefined => {\n if (!schema || typeof schema !== 'object') {\n return schema\n }\n\n const bound = resolveDynamicSchema(schema, dynamicScope)\n return '$ref' in bound ? resolve.schema(bound) : bound\n})\n\n/**\n * Re-provide the dynamic scope grown with this resource so nested `$dynamicRef`s bind here.\n *\n * Built once at setup from the resource's stable identity (like the ancestor set below);\n * `pushDynamicScope` only grows the scope for schemas that can carry a `$dynamicAnchor`.\n *\n * The raw schema is pushed, not the merged {@link resolvedSchema}: merging through `resolve.schema`\n * coerces the node and drops the resolved `$ref-value` from entries inside `$defs`, which\n * `$dynamicAnchor` resolution relies on to dereference the bound type (e.g. `User`).\n */\nconst scopeSchema = schema\n ? resolveDynamicSchema(schema, dynamicScope)\n : undefined\nprovide(\n SCHEMA_DYNAMIC_SCOPE_SYMBOL,\n scopeSchema ? pushDynamicScope(dynamicScope, scopeSchema) : dynamicScope,\n)\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Determines whether to show the collapse/expand toggle button.\n * We hide the toggle for non-collapsible schemas and root-level schemas.\n */\nconst shouldShowToggle = computed((): boolean => !noncollapsible && level > 0)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnScrollTargetPath = computed((): boolean => {\n if (!breadcrumb?.length) {\n return false\n }\n const path = breadcrumb.join('.')\n const target = scrollTargetId.value\n return target === path || target.startsWith(`${path}.`)\n})\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * Note: the Disclosure only reads this at mount, so it expands collapsed\n * properties on a fresh navigation (the schema mounts after the target is set),\n * not when the target changes for an already-mounted disclosure.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnScrollTargetPath.value,\n)\n\nconst childAttributesLabel = computed(\n (): string => schema?.title ?? translate('schema.childAttributes'),\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n const value = resolvedSchema.value\n\n if (hideDescription) {\n return null\n }\n\n // For the request body we want to show the description of the merged allOf schema.\n // Merging keeps the base description (when set) and otherwise lets the last allOf\n // member win, matching how the merged composition is rendered below. The nested\n // merged Schema in `SchemaComposition` hides its own description in this case so\n // the text is not rendered twice.\n if (schema?.allOf && schema.allOf.length > 0 && name === 'Request Body') {\n return mergeAllOfSchemas(schema)?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!value?.description || typeof value.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (value.enum) {\n return null\n }\n\n // Will be shown in the properties anyway\n if (\n !('properties' in value) &&\n !('patternProperties' in value) &&\n !('additionalProperties' in value)\n ) {\n return null\n }\n\n // Return the schema's own description\n return value.description\n})\n\n/**\n * Some generators (for example NSwag) describe a polymorphic base type as a\n * plain object with a `discriminator.mapping` but no explicit `oneOf`. We infer\n * the variant composition from the mapping so the selector still renders.\n *\n * The `discriminator` prop is only set when this schema is already a variant\n * being rendered inside a `SchemaComposition`; skipping the inference in that\n * case avoids re-inferring (and recursing) on a self-referential mapping.\n *\n * The inference is restricted to plain object schemas (`isTypeObject`). A schema\n * carrying its own composition keyword (`allOf`/`not`) is rendered by the\n * `SchemaProperty` branch below; inferring a selector there would replace that\n * keyword's output with the variant dropdown instead of rendering both.\n */\nconst inferredDiscriminatorComposition = computed(() =>\n schema && !discriminator && isTypeObject(schema)\n ? inferDiscriminatorMappingComposition(schema, options.document)\n : null,\n)\n\n// Prevent click action if noncollapsible\nconst handleClick = (e: MouseEvent) => {\n if (noncollapsible) {\n e.stopPropagation()\n }\n}\n</script>\n<template>\n <Disclosure\n v-if=\"resolvedSchema && Object.keys(resolvedSchema).length\"\n v-slot=\"{ open }\"\n :defaultOpen=\"defaultOpen\">\n <div\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n { 'border-t': additionalProperties && open },\n ]\">\n <!-- Schema description -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(resolvedSchema)\"\n class=\"pt-2\">\n {{ translate('schema.emptyObject') }}\n </div>\n <div\n class=\"schema-properties\"\n :class=\"{\n 'schema-properties-open': open,\n }\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties\">\n <DisclosureButton\n as=\"button\"\n class=\"schema-card-title schema-card-title--compact\"\n @click.capture=\"handleClick\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n icon=\"Add\"\n size=\"sm\" />\n {{ translate('schema.showAdditionalProperties') }}\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </DisclosureButton>\n </div>\n\n <DisclosureButton\n v-else-if=\"shouldShowToggle\"\n v-show=\"!hideHeading && !(noncollapsible && compact)\"\n :as=\"noncollapsible ? 'div' : 'button'\"\n class=\"schema-card-title\"\n :class=\"{ 'schema-card-title--compact': compact }\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${level}))`,\n }\"\n @click.capture=\"handleClick\">\n <template v-if=\"compact\">\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\">\n {{\n translate('schema.hideChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <template v-else>\n {{\n translate('schema.showChildAttributes', {\n name: childAttributesLabel,\n })\n }}\n </template>\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </template>\n <template v-else>\n <ScalarIcon\n class=\"schema-card-title-icon\"\n :class=\"{ 'schema-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <SchemaHeading\n :name=\"resolvedSchema?.title ?? name\"\n :value=\"resolvedSchema\" />\n </template>\n </DisclosureButton>\n <DisclosurePanel\n v-if=\"!additionalProperties || open\"\n as=\"ul\"\n :static=\"!shouldShowToggle\">\n <!-- Variant selector inferred from a discriminator mapping -->\n <SchemaComposition\n v-if=\"inferredDiscriminatorComposition\"\n :breadcrumb\n :compact\n composition=\"oneOf\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"schema?.discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level\"\n :name=\"name\"\n :options\n :schema=\"inferredDiscriminatorComposition\"\n :schemaContext=\"schemaContext\" />\n <!-- Object properties -->\n <SchemaObjectProperties\n v-else-if=\"isTypeObject(resolvedSchema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema=\"resolvedSchema\"\n :schemaContext=\"schemaContext\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"resolvedSchema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema=\"resolvedSchema\"\n :schemaContext=\"schemaContext\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-card-title--compact > .schema-card-title-icon {\n margin: 0;\n}\n.schema-card-title--compact > .schema-card-title-icon--open {\n transform: rotate(45deg);\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-b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Ac,IAAA,WAAA,EADxC,YAYmC,gCAAA;;OAVhC,YAAA,QAAA;OACA,SAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,eAAA,QAAA;OACA,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAO,QAAA,QAAK;OACZ,SAAA,QAAA;OACA,QAAQ,eAAA;OACR,eAAe,QAAA;;;;;;;;;;;;;0BAElB,mBAaW,UAAA,EAAA,KAAA,GAAA,EAAA,CAXD,eAAA,SAAA,WAAA,EADR,YAWmC,wBAAA;;OAThC,YAAA,QAAA;OACA,SAAA,QAAA;OACA,iBAAiB,QAAA;OACjB,UAAU,QAAA;OACV,aAAA,QAAA;OACA,gBAAA,QAAA;OACA,OAAA,QAAA;OACA,SAAA,QAAA;OACA,QAAQ,eAAA;OACR,eAAe,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAySA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAQtE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAKtE,KAAK,WAAW,GAAG;IACf,oDAAoD;IACpD,WAAW,EAAE,kBAAkB,CAAA;IAC/B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,MAAM,EAAE,YAAY,CAAA;IACpB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,iCAAiC;IACjC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,yEAAyE;IACzE,OAAO,EAAE,aAAa,CAAA;IACtB,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,CAAC;AA0XJ,QAAA,MAAM,YAAY;aAzYJ,OAAO;iBAEH,OAAO;6EA0YvB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAqSA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAStE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAKtE,KAAK,WAAW,GAAG;IACf,oDAAoD;IACpD,WAAW,EAAE,kBAAkB,CAAA;IAC/B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,MAAM,EAAE,YAAY,CAAA;IACpB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,iCAAiC;IACjC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,yEAAyE;IACzE,OAAO,EAAE,aAAa,CAAA;IACtB,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,CAAC;AAwXJ,QAAA,MAAM,YAAY;aAvYJ,OAAO;iBAEH,OAAO;6EAwYvB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaComposition.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, ref, watch } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { type CompositionKeyword } from './helpers/schema-composition'\nimport { getCycleKey } from './helpers/schema-cycle'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport Schema from './Schema.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** The composition keyword (oneOf, anyOf, allOf) */\n composition: CompositionKeyword\n /** Optional discriminator object for polymorphic schemas */\n discriminator?: DiscriminatorObject\n /** Optional name for the schema */\n name?: string\n /** The schema value containing the composition */\n schema: SchemaObject\n /** Nesting level for proper indentation */\n level: number\n /** Whether to use compact layout */\n compact?: boolean\n /** Whether to hide the heading */\n hideHeading?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Breadcrumb for navigation */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", sync selected index with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n }>(),\n {\n compact: false,\n hideHeading: false,\n },\n)\n\n/** The current composition */\nconst composition = computed(() =>\n [props.schema[props.composition]]\n .flat()\n .map((schema) => ({ value: resolve.schema(schema), original: schema }))\n .filter((it) => isDefined(it.value)),\n)\n\n/**\n * Generate listbox options for the composition selector.\n * Each option represents a schema in the composition with a human-readable label.\n * Prefers schema title/name over structural type when present.\n */\nconst listboxOptions = computed((): ScalarListboxOption[] =>\n composition.value.map((schema, index: number) => {\n const resolved = resolve.schema(schema.original!)\n const label =\n (getModelNameFromSchema(resolved)?.label ?? getSchemaType(resolved)) ||\n 'Schema'\n return { id: String(index), label }\n }),\n)\n\nconst compositionSelectionKey = computed(() =>\n props.compositionPath?.length\n ? [...props.compositionPath, props.composition].join('.')\n : '',\n)\n\n/** When this composition is in the request body, sync selection with the example snippet */\nconst requestBodyCompositionSelectionRef = inject(\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n undefined,\n)\n\nconst initialSelectedIndex = computed(() => {\n if (\n props.schemaContext !== 'requestBody' ||\n !requestBodyCompositionSelectionRef?.value ||\n !compositionSelectionKey.value\n ) {\n return 0\n }\n\n const selectedIndex =\n requestBodyCompositionSelectionRef.value[compositionSelectionKey.value]\n\n if (typeof selectedIndex !== 'number' || Number.isNaN(selectedIndex)) {\n return 0\n }\n\n return Math.max(0, Math.min(selectedIndex, listboxOptions.value.length - 1))\n})\n\n/**\n * Two-way computed property for the selected option.\n * Handles conversion between the selected index and the listbox option format.\n */\nconst selectedOption = ref<ScalarListboxOption | undefined>()\n\nwatch(\n [listboxOptions, initialSelectedIndex],\n ([options, selectedIndex]) => {\n if (\n !selectedOption.value ||\n !options.some((option) => option.id === selectedOption.value?.id)\n ) {\n selectedOption.value = options[selectedIndex] ?? options[0]\n }\n },\n { immediate: true },\n)\n\n/**\n * Humanize composition keyword name for display.\n * Converts camelCase to Title Case (e.g., oneOf -> One of).\n */\nconst humanizeType = (type: CompositionKeyword): string =>\n type\n .replace(/([A-Z])/g, ' $1')\n .replace(/^./, (str) => str.toUpperCase())\n .toLowerCase()\n .replace(/^(\\w)/, (c) => c.toUpperCase())\n\n/** Inside the currently selected composition */\nconst selectedComposition = computed(\n () => composition.value[Number(selectedOption.value?.id ?? '0')]?.value,\n)\n\n/**\n * The request body card renders the merged `allOf` description on its outer card\n * (see `Schema.vue`), but only for the top-level request body schema. For that\n * single composition we hide the nested merged `Schema`'s description so the text\n * is not shown twice. Nested request-body compositions (deeper properties) are\n * not shown on the outer card and would otherwise lose their description\n * entirely, because the property row already skips it when `allOf` is present.\n *\n * The top-level request body composition is the one whose `compositionPath` is\n * still the request body root (`['requestBody']`); nested compositions append\n * property segments and therefore have a longer path.\n */\nconst isRequestBodyRootComposition = computed(\n () =>\n props.schemaContext === 'requestBody' &&\n props.compositionPath?.length === 1,\n)\n\n/**\n * Cycle key for the selected composition member, derived from its raw\n * (unresolved) value so a member that references an ancestor is detected as a\n * cycle.\n */\nconst selectedCompositionCycleKey = computed(() =>\n getCycleKey(\n composition.value[Number(selectedOption.value?.id ?? '0')]?.original,\n ),\n)\n\n/**\n * Controls whether the nested schema is displayed. When expanding all schema\n * properties we open it by default; the nested Schema handles cycle detection,\n * so finite compositions render fully while recursive ones still stop.\n */\nconst showNestedSchema = ref(!!props.options.expandAllSchemaProperties)\n\nif (\n requestBodyCompositionSelectionRef &&\n props.schemaContext === 'requestBody' &&\n compositionSelectionKey.value\n) {\n watch(\n selectedOption,\n (option) => {\n const index = option ? Number(option.id) : 0\n if (!Number.isNaN(index)) {\n requestBodyCompositionSelectionRef.value = {\n ...requestBodyCompositionSelectionRef.value,\n [compositionSelectionKey.value]: index,\n } satisfies RequestBodyCompositionSelection\n }\n },\n { immediate: true },\n )\n}\n</script>\n\n<template>\n <div class=\"property-rule\">\n <!-- We merge allOf schemas into a single schema -->\n <Schema\n v-if=\"props.composition === 'allOf'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideDescription=\"isRequestBodyRootComposition\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"mergeAllOfSchemas(schema)\"\n :schemaContext=\"schemaContext\" />\n\n <template v-else>\n <!-- Composition selector and panel for nested compositions -->\n <ScalarListbox\n v-model=\"selectedOption\"\n :options=\"listboxOptions\"\n resize>\n <button\n class=\"composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border px-2.5 py-2.5 pr-3 text-left\"\n type=\"button\">\n <span class=\"text-c-2\">{{ humanizeType(props.composition) }}</span>\n <span\n class=\"composition-selector-label text-c-1\"\n :class=\"{\n 'line-through': selectedComposition?.deprecated,\n }\">\n {{ selectedOption?.label || 'Schema' }}\n </span>\n <div\n v-if=\"selectedComposition?.deprecated\"\n class=\"text-red\">\n deprecated\n </div>\n <ScalarIconCaretDown />\n </button>\n </ScalarListbox>\n\n <div class=\"composition-panel\">\n <!-- Button to toggle nested schema display -->\n <button\n v-if=\"!showNestedSchema && level > 2\"\n class=\"bg-b-1 hover:bg-b-2 text-c-1 flex w-full items-center justify-center gap-2 rounded-b-lg border border-t-0 px-2 py-2 text-sm font-medium transition-colors\"\n type=\"button\"\n @click=\"showNestedSchema = true\">\n Show Schema Details\n <ScalarIconCaretDown class=\"h-3 w-3\" />\n </button>\n\n <!-- Render the selected schema if it has content to display -->\n <Schema\n v-else\n :key=\"selectedOption?.id ?? '0'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :cycleKey=\"selectedCompositionCycleKey\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"selectedComposition\"\n :schemaContext=\"schemaContext\" />\n </div>\n </template>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SchemaComposition.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, ref, watch } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport { useLocalization } from '@/features/localization'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { type CompositionKeyword } from './helpers/schema-composition'\nimport { getCycleKey } from './helpers/schema-cycle'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport Schema from './Schema.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** The composition keyword (oneOf, anyOf, allOf) */\n composition: CompositionKeyword\n /** Optional discriminator object for polymorphic schemas */\n discriminator?: DiscriminatorObject\n /** Optional name for the schema */\n name?: string\n /** The schema value containing the composition */\n schema: SchemaObject\n /** Nesting level for proper indentation */\n level: number\n /** Whether to use compact layout */\n compact?: boolean\n /** Whether to hide the heading */\n hideHeading?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Breadcrumb for navigation */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", sync selected index with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n }>(),\n {\n compact: false,\n hideHeading: false,\n },\n)\nconst { translate } = useLocalization()\n\n/** The current composition */\nconst composition = computed(() =>\n [props.schema[props.composition]]\n .flat()\n .map((schema) => ({ value: resolve.schema(schema), original: schema }))\n .filter((it) => isDefined(it.value)),\n)\n\n/**\n * Generate listbox options for the composition selector.\n * Each option represents a schema in the composition with a human-readable label.\n * Prefers schema title/name over structural type when present.\n */\nconst listboxOptions = computed((): ScalarListboxOption[] =>\n composition.value.map((schema, index: number) => {\n const resolved = resolve.schema(schema.original!)\n const label =\n (getModelNameFromSchema(resolved)?.label ?? getSchemaType(resolved)) ||\n translate('schema.schema')\n return { id: String(index), label }\n }),\n)\n\nconst compositionSelectionKey = computed(() =>\n props.compositionPath?.length\n ? [...props.compositionPath, props.composition].join('.')\n : '',\n)\n\n/** When this composition is in the request body, sync selection with the example snippet */\nconst requestBodyCompositionSelectionRef = inject(\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n undefined,\n)\n\nconst initialSelectedIndex = computed(() => {\n if (\n props.schemaContext !== 'requestBody' ||\n !requestBodyCompositionSelectionRef?.value ||\n !compositionSelectionKey.value\n ) {\n return 0\n }\n\n const selectedIndex =\n requestBodyCompositionSelectionRef.value[compositionSelectionKey.value]\n\n if (typeof selectedIndex !== 'number' || Number.isNaN(selectedIndex)) {\n return 0\n }\n\n return Math.max(0, Math.min(selectedIndex, listboxOptions.value.length - 1))\n})\n\n/**\n * Two-way computed property for the selected option.\n * Handles conversion between the selected index and the listbox option format.\n */\nconst selectedOption = ref<ScalarListboxOption | undefined>()\n\nwatch(\n [listboxOptions, initialSelectedIndex],\n ([options, selectedIndex]) => {\n if (\n !selectedOption.value ||\n !options.some((option) => option.id === selectedOption.value?.id)\n ) {\n selectedOption.value = options[selectedIndex] ?? options[0]\n }\n },\n { immediate: true },\n)\n\nconst compositionLabel = (type: CompositionKeyword): string =>\n translate(`schema.${type}`)\n\n/** Inside the currently selected composition */\nconst selectedComposition = computed(\n () => composition.value[Number(selectedOption.value?.id ?? '0')]?.value,\n)\n\n/**\n * The request body card renders the merged `allOf` description on its outer card\n * (see `Schema.vue`), but only for the top-level request body schema. For that\n * single composition we hide the nested merged `Schema`'s description so the text\n * is not shown twice. Nested request-body compositions (deeper properties) are\n * not shown on the outer card and would otherwise lose their description\n * entirely, because the property row already skips it when `allOf` is present.\n *\n * The top-level request body composition is the one whose `compositionPath` is\n * still the request body root (`['requestBody']`); nested compositions append\n * property segments and therefore have a longer path.\n */\nconst isRequestBodyRootComposition = computed(\n () =>\n props.schemaContext === 'requestBody' &&\n props.compositionPath?.length === 1,\n)\n\n/**\n * Cycle key for the selected composition member, derived from its raw\n * (unresolved) value so a member that references an ancestor is detected as a\n * cycle.\n */\nconst selectedCompositionCycleKey = computed(() =>\n getCycleKey(\n composition.value[Number(selectedOption.value?.id ?? '0')]?.original,\n ),\n)\n\n/**\n * Controls whether the nested schema is displayed. When expanding all schema\n * properties we open it by default; the nested Schema handles cycle detection,\n * so finite compositions render fully while recursive ones still stop.\n */\nconst showNestedSchema = ref(!!props.options.expandAllSchemaProperties)\n\nif (\n requestBodyCompositionSelectionRef &&\n props.schemaContext === 'requestBody' &&\n compositionSelectionKey.value\n) {\n watch(\n selectedOption,\n (option) => {\n const index = option ? Number(option.id) : 0\n if (!Number.isNaN(index)) {\n requestBodyCompositionSelectionRef.value = {\n ...requestBodyCompositionSelectionRef.value,\n [compositionSelectionKey.value]: index,\n } satisfies RequestBodyCompositionSelection\n }\n },\n { immediate: true },\n )\n}\n</script>\n\n<template>\n <div class=\"property-rule\">\n <!-- We merge allOf schemas into a single schema -->\n <Schema\n v-if=\"props.composition === 'allOf'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideDescription=\"isRequestBodyRootComposition\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"mergeAllOfSchemas(schema)\"\n :schemaContext=\"schemaContext\" />\n\n <template v-else>\n <!-- Composition selector and panel for nested compositions -->\n <ScalarListbox\n v-model=\"selectedOption\"\n :options=\"listboxOptions\"\n resize>\n <button\n class=\"composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border px-2.5 py-2.5 pr-3 text-left\"\n type=\"button\">\n <span class=\"text-c-2\">{{\n compositionLabel(props.composition)\n }}</span>\n <span\n class=\"composition-selector-label text-c-1\"\n :class=\"{\n 'line-through': selectedComposition?.deprecated,\n }\">\n {{ selectedOption?.label || translate('schema.schema') }}\n </span>\n <div\n v-if=\"selectedComposition?.deprecated\"\n class=\"text-red\">\n {{ translate('common.deprecated') }}\n </div>\n <ScalarIconCaretDown />\n </button>\n </ScalarListbox>\n\n <div class=\"composition-panel\">\n <!-- Button to toggle nested schema display -->\n <button\n v-if=\"!showNestedSchema && level > 2\"\n class=\"bg-b-1 hover:bg-b-2 text-c-1 flex w-full items-center justify-center gap-2 rounded-b-lg border border-t-0 px-2 py-2 text-sm font-medium transition-colors\"\n type=\"button\"\n @click=\"showNestedSchema = true\">\n {{ translate('schema.showSchemaDetails') }}\n <ScalarIconCaretDown class=\"h-3 w-3\" />\n </button>\n\n <!-- Render the selected schema if it has content to display -->\n <Schema\n v-else\n :key=\"selectedOption?.id ?? '0'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :cycleKey=\"selectedCompositionCycleKey\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"selectedComposition\"\n :schemaContext=\"schemaContext\" />\n </div>\n </template>\n </div>\n</template>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../../features/localization/use-localization.js";
1
2
  import { mergeAllOfSchemas } from "./helpers/merge-all-of-schemas.js";
2
3
  import { getCycleKey } from "./helpers/schema-cycle.js";
3
4
  import { REQUEST_BODY_COMPOSITION_INDEX_SYMBOL } from "../../../features/Operation/request-body-composition-index.js";
@@ -5,8 +6,8 @@ import { getSchemaType } from "./helpers/get-schema-type.js";
5
6
  import { getModelNameFromSchema } from "./helpers/schema-name.js";
6
7
  import Schema_default from "./Schema.vue.js";
7
8
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, normalizeClass, openBlock, ref, toDisplayString, unref, watch, withCtx } from "vue";
8
- import { ScalarIconCaretDown } from "@scalar/icons";
9
9
  import { ScalarListbox } from "@scalar/components/listbox";
10
+ import { ScalarIconCaretDown } from "@scalar/icons";
10
11
  import { resolve } from "@scalar/workspace-store/resolve";
11
12
  import { isDefined } from "@scalar/helpers/array/is-defined";
12
13
  //#region src/components/Content/Schema/SchemaComposition.vue?vue&type=script&setup=true&lang.ts
@@ -46,6 +47,7 @@ var SchemaComposition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
46
47
  },
47
48
  setup(__props) {
48
49
  const props = __props;
50
+ const { translate } = useLocalization();
49
51
  /** The current composition */
50
52
  const composition = computed(() => [props.schema[props.composition]].flat().map((schema) => ({
51
53
  value: resolve.schema(schema),
@@ -58,7 +60,7 @@ var SchemaComposition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
58
60
  */
59
61
  const listboxOptions = computed(() => composition.value.map((schema, index) => {
60
62
  const resolved = resolve.schema(schema.original);
61
- const label = (getModelNameFromSchema(resolved)?.label ?? getSchemaType(resolved)) || "Schema";
63
+ const label = (getModelNameFromSchema(resolved)?.label ?? getSchemaType(resolved)) || translate("schema.schema");
62
64
  return {
63
65
  id: String(index),
64
66
  label
@@ -81,11 +83,7 @@ var SchemaComposition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
81
83
  watch([listboxOptions, initialSelectedIndex], ([options, selectedIndex]) => {
82
84
  if (!selectedOption.value || !options.some((option) => option.id === selectedOption.value?.id)) selectedOption.value = options[selectedIndex] ?? options[0];
83
85
  }, { immediate: true });
84
- /**
85
- * Humanize composition keyword name for display.
86
- * Converts camelCase to Title Case (e.g., oneOf -> One of).
87
- */
88
- const humanizeType = (type) => type.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).toLowerCase().replace(/^(\w)/, (c) => c.toUpperCase());
86
+ const compositionLabel = (type) => translate(`schema.${type}`);
89
87
  /** Inside the currently selected composition */
90
88
  const selectedComposition = computed(() => composition.value[Number(selectedOption.value?.id ?? "0")]?.value);
91
89
  /**
@@ -158,9 +156,9 @@ var SchemaComposition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
158
156
  resize: ""
159
157
  }, {
160
158
  default: withCtx(() => [createElementVNode("button", _hoisted_2, [
161
- createElementVNode("span", _hoisted_3, toDisplayString(humanizeType(props.composition)), 1),
162
- createElementVNode("span", { class: normalizeClass(["composition-selector-label text-c-1", { "line-through": selectedComposition.value?.deprecated }]) }, toDisplayString(selectedOption.value?.label || "Schema"), 3),
163
- selectedComposition.value?.deprecated ? (openBlock(), createElementBlock("div", _hoisted_4, " deprecated ")) : createCommentVNode("", true),
159
+ createElementVNode("span", _hoisted_3, toDisplayString(compositionLabel(props.composition)), 1),
160
+ createElementVNode("span", { class: normalizeClass(["composition-selector-label text-c-1", { "line-through": selectedComposition.value?.deprecated }]) }, toDisplayString(selectedOption.value?.label || unref(translate)("schema.schema")), 3),
161
+ selectedComposition.value?.deprecated ? (openBlock(), createElementBlock("div", _hoisted_4, toDisplayString(unref(translate)("common.deprecated")), 1)) : createCommentVNode("", true),
164
162
  createVNode(unref(ScalarIconCaretDown))
165
163
  ])]),
166
164
  _: 1
@@ -169,7 +167,7 @@ var SchemaComposition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
169
167
  class: "bg-b-1 hover:bg-b-2 text-c-1 flex w-full items-center justify-center gap-2 rounded-b-lg border border-t-0 px-2 py-2 text-sm font-medium transition-colors",
170
168
  type: "button",
171
169
  onClick: _cache[1] || (_cache[1] = ($event) => showNestedSchema.value = true)
172
- }, [_cache[2] || (_cache[2] = createTextVNode(" Show Schema Details ", -1)), createVNode(unref(ScalarIconCaretDown), { class: "h-3 w-3" })])) : (openBlock(), createBlock(Schema_default, {
170
+ }, [createTextVNode(toDisplayString(unref(translate)("schema.showSchemaDetails")) + " ", 1), createVNode(unref(ScalarIconCaretDown), { class: "h-3 w-3" })])) : (openBlock(), createBlock(Schema_default, {
173
171
  key: selectedOption.value?.id ?? "0",
174
172
  breadcrumb: __props.breadcrumb,
175
173
  compact: __props.compact,
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaComposition.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, ref, watch } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { type CompositionKeyword } from './helpers/schema-composition'\nimport { getCycleKey } from './helpers/schema-cycle'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport Schema from './Schema.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** The composition keyword (oneOf, anyOf, allOf) */\n composition: CompositionKeyword\n /** Optional discriminator object for polymorphic schemas */\n discriminator?: DiscriminatorObject\n /** Optional name for the schema */\n name?: string\n /** The schema value containing the composition */\n schema: SchemaObject\n /** Nesting level for proper indentation */\n level: number\n /** Whether to use compact layout */\n compact?: boolean\n /** Whether to hide the heading */\n hideHeading?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Breadcrumb for navigation */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", sync selected index with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n }>(),\n {\n compact: false,\n hideHeading: false,\n },\n)\n\n/** The current composition */\nconst composition = computed(() =>\n [props.schema[props.composition]]\n .flat()\n .map((schema) => ({ value: resolve.schema(schema), original: schema }))\n .filter((it) => isDefined(it.value)),\n)\n\n/**\n * Generate listbox options for the composition selector.\n * Each option represents a schema in the composition with a human-readable label.\n * Prefers schema title/name over structural type when present.\n */\nconst listboxOptions = computed((): ScalarListboxOption[] =>\n composition.value.map((schema, index: number) => {\n const resolved = resolve.schema(schema.original!)\n const label =\n (getModelNameFromSchema(resolved)?.label ?? getSchemaType(resolved)) ||\n 'Schema'\n return { id: String(index), label }\n }),\n)\n\nconst compositionSelectionKey = computed(() =>\n props.compositionPath?.length\n ? [...props.compositionPath, props.composition].join('.')\n : '',\n)\n\n/** When this composition is in the request body, sync selection with the example snippet */\nconst requestBodyCompositionSelectionRef = inject(\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n undefined,\n)\n\nconst initialSelectedIndex = computed(() => {\n if (\n props.schemaContext !== 'requestBody' ||\n !requestBodyCompositionSelectionRef?.value ||\n !compositionSelectionKey.value\n ) {\n return 0\n }\n\n const selectedIndex =\n requestBodyCompositionSelectionRef.value[compositionSelectionKey.value]\n\n if (typeof selectedIndex !== 'number' || Number.isNaN(selectedIndex)) {\n return 0\n }\n\n return Math.max(0, Math.min(selectedIndex, listboxOptions.value.length - 1))\n})\n\n/**\n * Two-way computed property for the selected option.\n * Handles conversion between the selected index and the listbox option format.\n */\nconst selectedOption = ref<ScalarListboxOption | undefined>()\n\nwatch(\n [listboxOptions, initialSelectedIndex],\n ([options, selectedIndex]) => {\n if (\n !selectedOption.value ||\n !options.some((option) => option.id === selectedOption.value?.id)\n ) {\n selectedOption.value = options[selectedIndex] ?? options[0]\n }\n },\n { immediate: true },\n)\n\n/**\n * Humanize composition keyword name for display.\n * Converts camelCase to Title Case (e.g., oneOf -> One of).\n */\nconst humanizeType = (type: CompositionKeyword): string =>\n type\n .replace(/([A-Z])/g, ' $1')\n .replace(/^./, (str) => str.toUpperCase())\n .toLowerCase()\n .replace(/^(\\w)/, (c) => c.toUpperCase())\n\n/** Inside the currently selected composition */\nconst selectedComposition = computed(\n () => composition.value[Number(selectedOption.value?.id ?? '0')]?.value,\n)\n\n/**\n * The request body card renders the merged `allOf` description on its outer card\n * (see `Schema.vue`), but only for the top-level request body schema. For that\n * single composition we hide the nested merged `Schema`'s description so the text\n * is not shown twice. Nested request-body compositions (deeper properties) are\n * not shown on the outer card and would otherwise lose their description\n * entirely, because the property row already skips it when `allOf` is present.\n *\n * The top-level request body composition is the one whose `compositionPath` is\n * still the request body root (`['requestBody']`); nested compositions append\n * property segments and therefore have a longer path.\n */\nconst isRequestBodyRootComposition = computed(\n () =>\n props.schemaContext === 'requestBody' &&\n props.compositionPath?.length === 1,\n)\n\n/**\n * Cycle key for the selected composition member, derived from its raw\n * (unresolved) value so a member that references an ancestor is detected as a\n * cycle.\n */\nconst selectedCompositionCycleKey = computed(() =>\n getCycleKey(\n composition.value[Number(selectedOption.value?.id ?? '0')]?.original,\n ),\n)\n\n/**\n * Controls whether the nested schema is displayed. When expanding all schema\n * properties we open it by default; the nested Schema handles cycle detection,\n * so finite compositions render fully while recursive ones still stop.\n */\nconst showNestedSchema = ref(!!props.options.expandAllSchemaProperties)\n\nif (\n requestBodyCompositionSelectionRef &&\n props.schemaContext === 'requestBody' &&\n compositionSelectionKey.value\n) {\n watch(\n selectedOption,\n (option) => {\n const index = option ? Number(option.id) : 0\n if (!Number.isNaN(index)) {\n requestBodyCompositionSelectionRef.value = {\n ...requestBodyCompositionSelectionRef.value,\n [compositionSelectionKey.value]: index,\n } satisfies RequestBodyCompositionSelection\n }\n },\n { immediate: true },\n )\n}\n</script>\n\n<template>\n <div class=\"property-rule\">\n <!-- We merge allOf schemas into a single schema -->\n <Schema\n v-if=\"props.composition === 'allOf'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideDescription=\"isRequestBodyRootComposition\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"mergeAllOfSchemas(schema)\"\n :schemaContext=\"schemaContext\" />\n\n <template v-else>\n <!-- Composition selector and panel for nested compositions -->\n <ScalarListbox\n v-model=\"selectedOption\"\n :options=\"listboxOptions\"\n resize>\n <button\n class=\"composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border px-2.5 py-2.5 pr-3 text-left\"\n type=\"button\">\n <span class=\"text-c-2\">{{ humanizeType(props.composition) }}</span>\n <span\n class=\"composition-selector-label text-c-1\"\n :class=\"{\n 'line-through': selectedComposition?.deprecated,\n }\">\n {{ selectedOption?.label || 'Schema' }}\n </span>\n <div\n v-if=\"selectedComposition?.deprecated\"\n class=\"text-red\">\n deprecated\n </div>\n <ScalarIconCaretDown />\n </button>\n </ScalarListbox>\n\n <div class=\"composition-panel\">\n <!-- Button to toggle nested schema display -->\n <button\n v-if=\"!showNestedSchema && level > 2\"\n class=\"bg-b-1 hover:bg-b-2 text-c-1 flex w-full items-center justify-center gap-2 rounded-b-lg border border-t-0 px-2 py-2 text-sm font-medium transition-colors\"\n type=\"button\"\n @click=\"showNestedSchema = true\">\n Show Schema Details\n <ScalarIconCaretDown class=\"h-3 w-3\" />\n </button>\n\n <!-- Render the selected schema if it has content to display -->\n <Schema\n v-else\n :key=\"selectedOption?.id ?? '0'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :cycleKey=\"selectedCompositionCycleKey\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"selectedComposition\"\n :schemaContext=\"schemaContext\" />\n </div>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BA,MAAM,QAAQ;;EAoCd,MAAM,cAAc,eAClB,CAAC,MAAM,OAAO,MAAM,aAAY,CAC7B,MAAK,CACL,KAAK,YAAY;GAAE,OAAO,QAAQ,OAAO,OAAO;GAAE,UAAU;GAAQ,EAAC,CACrE,QAAQ,OAAO,UAAU,GAAG,MAAM,CAAC,CACxC;;;;;;EAOA,MAAM,iBAAiB,eACrB,YAAY,MAAM,KAAK,QAAQ,UAAkB;GAC/C,MAAM,WAAW,QAAQ,OAAO,OAAO,SAAS;GAChD,MAAM,SACH,uBAAuB,SAAS,EAAE,SAAS,c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BM,OA7BN,YA6BM,CAAA,CA1BK,iBAAA,SAAoB,QAAA,QAAK,KAAA,WAAA,EADlC,mBAOS,UAAA;;IALP,OAAM;IACN,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,iBAAA,QAAgB;iDAAS,yBAEjC,GAAA,GAAA,YAAuC,MAAA,oBAAA,EAAA,EAAlB,OAAM,WAAS,CAAA,CAAA,CAAA,KAAA,WAAA,EAItC,YAgBmC,gBAAA;IAdhC,KAAK,eAAA,OAAgB,MAAE;IACvB,YAAY,QAAA;IACZ,SAAS,QAAA;IACT,iBAAiB,QAAA;IACjB,UAAU,4BAAA;IACV,eAAe,QAAA;IACf,UAAU,QAAA;IACV,aAAa,QAAA;IACb,gBAAA,QAAA;IACA,OAAO,QAAA,QAAK;IACZ,MAAM,QAAA;IACN,gBAAgB;IAChB,SAAS,QAAA;IACT,QAAQ,oBAAA;IACR,eAAe,QAAA"}
1
+ {"version":3,"file":"SchemaComposition.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { ScalarIconCaretDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, inject, ref, watch } from 'vue'\n\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport { useLocalization } from '@/features/localization'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from '@/features/Operation/request-body-composition-index'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { type CompositionKeyword } from './helpers/schema-composition'\nimport { getCycleKey } from './helpers/schema-cycle'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport Schema from './Schema.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** The composition keyword (oneOf, anyOf, allOf) */\n composition: CompositionKeyword\n /** Optional discriminator object for polymorphic schemas */\n discriminator?: DiscriminatorObject\n /** Optional name for the schema */\n name?: string\n /** The schema value containing the composition */\n schema: SchemaObject\n /** Nesting level for proper indentation */\n level: number\n /** Whether to use compact layout */\n compact?: boolean\n /** Whether to hide the heading */\n hideHeading?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Breadcrumb for navigation */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", sync selected index with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n }>(),\n {\n compact: false,\n hideHeading: false,\n },\n)\nconst { translate } = useLocalization()\n\n/** The current composition */\nconst composition = computed(() =>\n [props.schema[props.composition]]\n .flat()\n .map((schema) => ({ value: resolve.schema(schema), original: schema }))\n .filter((it) => isDefined(it.value)),\n)\n\n/**\n * Generate listbox options for the composition selector.\n * Each option represents a schema in the composition with a human-readable label.\n * Prefers schema title/name over structural type when present.\n */\nconst listboxOptions = computed((): ScalarListboxOption[] =>\n composition.value.map((schema, index: number) => {\n const resolved = resolve.schema(schema.original!)\n const label =\n (getModelNameFromSchema(resolved)?.label ?? getSchemaType(resolved)) ||\n translate('schema.schema')\n return { id: String(index), label }\n }),\n)\n\nconst compositionSelectionKey = computed(() =>\n props.compositionPath?.length\n ? [...props.compositionPath, props.composition].join('.')\n : '',\n)\n\n/** When this composition is in the request body, sync selection with the example snippet */\nconst requestBodyCompositionSelectionRef = inject(\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n undefined,\n)\n\nconst initialSelectedIndex = computed(() => {\n if (\n props.schemaContext !== 'requestBody' ||\n !requestBodyCompositionSelectionRef?.value ||\n !compositionSelectionKey.value\n ) {\n return 0\n }\n\n const selectedIndex =\n requestBodyCompositionSelectionRef.value[compositionSelectionKey.value]\n\n if (typeof selectedIndex !== 'number' || Number.isNaN(selectedIndex)) {\n return 0\n }\n\n return Math.max(0, Math.min(selectedIndex, listboxOptions.value.length - 1))\n})\n\n/**\n * Two-way computed property for the selected option.\n * Handles conversion between the selected index and the listbox option format.\n */\nconst selectedOption = ref<ScalarListboxOption | undefined>()\n\nwatch(\n [listboxOptions, initialSelectedIndex],\n ([options, selectedIndex]) => {\n if (\n !selectedOption.value ||\n !options.some((option) => option.id === selectedOption.value?.id)\n ) {\n selectedOption.value = options[selectedIndex] ?? options[0]\n }\n },\n { immediate: true },\n)\n\nconst compositionLabel = (type: CompositionKeyword): string =>\n translate(`schema.${type}`)\n\n/** Inside the currently selected composition */\nconst selectedComposition = computed(\n () => composition.value[Number(selectedOption.value?.id ?? '0')]?.value,\n)\n\n/**\n * The request body card renders the merged `allOf` description on its outer card\n * (see `Schema.vue`), but only for the top-level request body schema. For that\n * single composition we hide the nested merged `Schema`'s description so the text\n * is not shown twice. Nested request-body compositions (deeper properties) are\n * not shown on the outer card and would otherwise lose their description\n * entirely, because the property row already skips it when `allOf` is present.\n *\n * The top-level request body composition is the one whose `compositionPath` is\n * still the request body root (`['requestBody']`); nested compositions append\n * property segments and therefore have a longer path.\n */\nconst isRequestBodyRootComposition = computed(\n () =>\n props.schemaContext === 'requestBody' &&\n props.compositionPath?.length === 1,\n)\n\n/**\n * Cycle key for the selected composition member, derived from its raw\n * (unresolved) value so a member that references an ancestor is detected as a\n * cycle.\n */\nconst selectedCompositionCycleKey = computed(() =>\n getCycleKey(\n composition.value[Number(selectedOption.value?.id ?? '0')]?.original,\n ),\n)\n\n/**\n * Controls whether the nested schema is displayed. When expanding all schema\n * properties we open it by default; the nested Schema handles cycle detection,\n * so finite compositions render fully while recursive ones still stop.\n */\nconst showNestedSchema = ref(!!props.options.expandAllSchemaProperties)\n\nif (\n requestBodyCompositionSelectionRef &&\n props.schemaContext === 'requestBody' &&\n compositionSelectionKey.value\n) {\n watch(\n selectedOption,\n (option) => {\n const index = option ? Number(option.id) : 0\n if (!Number.isNaN(index)) {\n requestBodyCompositionSelectionRef.value = {\n ...requestBodyCompositionSelectionRef.value,\n [compositionSelectionKey.value]: index,\n } satisfies RequestBodyCompositionSelection\n }\n },\n { immediate: true },\n )\n}\n</script>\n\n<template>\n <div class=\"property-rule\">\n <!-- We merge allOf schemas into a single schema -->\n <Schema\n v-if=\"props.composition === 'allOf'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideDescription=\"isRequestBodyRootComposition\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"mergeAllOfSchemas(schema)\"\n :schemaContext=\"schemaContext\" />\n\n <template v-else>\n <!-- Composition selector and panel for nested compositions -->\n <ScalarListbox\n v-model=\"selectedOption\"\n :options=\"listboxOptions\"\n resize>\n <button\n class=\"composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border px-2.5 py-2.5 pr-3 text-left\"\n type=\"button\">\n <span class=\"text-c-2\">{{\n compositionLabel(props.composition)\n }}</span>\n <span\n class=\"composition-selector-label text-c-1\"\n :class=\"{\n 'line-through': selectedComposition?.deprecated,\n }\">\n {{ selectedOption?.label || translate('schema.schema') }}\n </span>\n <div\n v-if=\"selectedComposition?.deprecated\"\n class=\"text-red\">\n {{ translate('common.deprecated') }}\n </div>\n <ScalarIconCaretDown />\n </button>\n </ScalarListbox>\n\n <div class=\"composition-panel\">\n <!-- Button to toggle nested schema display -->\n <button\n v-if=\"!showNestedSchema && level > 2\"\n class=\"bg-b-1 hover:bg-b-2 text-c-1 flex w-full items-center justify-center gap-2 rounded-b-lg border border-t-0 px-2 py-2 text-sm font-medium transition-colors\"\n type=\"button\"\n @click=\"showNestedSchema = true\">\n {{ translate('schema.showSchemaDetails') }}\n <ScalarIconCaretDown class=\"h-3 w-3\" />\n </button>\n\n <!-- Render the selected schema if it has content to display -->\n <Schema\n v-else\n :key=\"selectedOption?.id ?? '0'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :cycleKey=\"selectedCompositionCycleKey\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"selectedComposition\"\n :schemaContext=\"schemaContext\" />\n </div>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,QAAQ;EAkCd,MAAM,EAAE,cAAc,iBAAgB;;EAGtC,MAAM,cAAc,eAClB,CAAC,MAAM,OAAO,MAAM,aAAY,CAC7B,MAAK,CACL,KAAK,YAAY;GAAE,OAAO,QAAQ,OAAO,OAAO;GAAE,UAAU;GAAQ,EAAC,CACrE,QAAQ,OAAO,UAAU,GAAG,MAAM,CAAC,CACxC;;;;;;EAOA,MAAM,iBAAiB,eACrB,YAAY,MAAM,KAAK,QAAQ,UAAkB;GAC/C,MAAM,WAAW,QAAQ,OAAO,OAAO,SAAS;GAChD,MAAM,SACH,uBAAuB,SAAS,EAAE,SAAS,cAAc,SAAS,KACnE,UAAU,gBAAe;AAC3B,UAAO;IAAE,IAAI,OAAO,MAAM;IAAE;IAAM;IAClC,CACJ;EAEA,MAAM,0BAA0B,eAC9B,MAAM,iBAAiB,SACnB,CAAC,GAAG,MAAM,iBAAiB,MAAM,YAAY,CAAC,KAAK,IAAG,GACtD,GACN;;EAGA,MAAM,qCAAqC,OACzC,uCACA,KAAA,EACF;EAEA,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AA,CAAA,KAAA,WAAA,EAItC,YAgBmC,gBAAA;IAdhC,KAAK,eAAA,OAAgB,MAAE;IACvB,YAAY,QAAA;IACZ,SAAS,QAAA;IACT,iBAAiB,QAAA;IACjB,UAAU,4BAAA;IACV,eAAe,QAAA;IACf,UAAU,QAAA;IACV,aAAa,QAAA;IACb,gBAAA,QAAA;IACA,OAAO,QAAA,QAAK;IACZ,MAAM,QAAA;IACN,gBAAgB;IAChB,SAAS,QAAA;IACT,QAAQ,oBAAA;IACR,eAAe,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaEnums.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"names":[],"mappings":"AAsMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,WAAW,GAAG;IACjB,4DAA4D;IAC5D,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;IAC/B,qDAAqD;IACrD,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAC;AAyPF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SchemaEnums.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"names":[],"mappings":"AA6MA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAQhG,KAAK,WAAW,GAAG;IACjB,4DAA4D;IAC5D,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;IAC/B,qDAAqD;IACrD,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAC;AAiQF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
2
2
  import SchemaEnums_vue_vue_type_script_setup_true_lang_default from "./SchemaEnums.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/components/Content/Schema/SchemaEnums.vue
5
- var SchemaEnums_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SchemaEnums_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-fa093e1b"]]);
5
+ var SchemaEnums_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SchemaEnums_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-bf1bfd02"]]);
6
6
  //#endregion
7
7
  export { SchemaEnums_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaEnums.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, ref } from 'vue'\n\nimport SchemaEnumPropertyItem from './SchemaEnumPropertyItem.vue'\n\nconst { value } = defineProps<{\n /** The schema object containing enum values and metadata */\n value: SchemaObject | undefined\n /** Whether to display the enum for property names */\n propertyNames?: boolean\n}>()\n\nconst ENUM_DISPLAY_THRESHOLD = 9\nconst INITIAL_VISIBLE_COUNT = 5\nconst THIN_SPACE = '\\u2009'\n\n/**\n * Extracts enum values from the schema object.\n * Handles both direct enum values and nested enum arrays.\n */\nconst enumValues = computed(() => {\n if (!value) {\n return []\n }\n return (\n value.enum ||\n (isArraySchema(value) && resolve.schema(value.items)?.enum) ||\n []\n )\n})\n\n/**\n * Determines if we should show the long enum list UI.\n * When there are many enum values, we initially show only a subset.\n */\nconst shouldUseLongListDisplay = computed(\n () => enumValues.value.length > ENUM_DISPLAY_THRESHOLD,\n)\n\nconst initialVisibleCount = computed(() =>\n shouldUseLongListDisplay.value\n ? INITIAL_VISIBLE_COUNT\n : enumValues.value.length,\n)\n\nconst visibleEnumValues = computed(() =>\n enumValues.value.slice(0, initialVisibleCount.value),\n)\n\nconst hiddenEnumValues = computed(() =>\n enumValues.value.slice(initialVisibleCount.value),\n)\n\n/**\n * Gets the description for an enum value.\n * Supports both array and object formats for x-enumDescriptions.\n */\nconst getEnumValueDescription = (\n enumValue: any,\n index: number,\n): string | undefined => {\n const descriptions =\n value?.['x-enumDescriptions'] ?? value?.['x-enum-descriptions']\n\n if (!descriptions) {\n return undefined\n }\n\n if (Array.isArray(descriptions)) {\n return descriptions[index]\n }\n\n if (typeof descriptions === 'object' && descriptions !== null) {\n return (descriptions as Record<string, string>)[String(enumValue)]\n }\n\n return undefined\n}\n\n/**\n * Formats an enum value with its variable name if available.\n * This supports both x-enum-varnames and x-enumNames extensions.\n */\nconst formatEnumValueWithName = (enumValue: any, index: number): string => {\n const varNames = value?.['x-enum-varnames'] ?? value?.['x-enumNames']\n const varName = Array.isArray(varNames) ? varNames[index] : undefined\n return varName\n ? `${enumValue}${THIN_SPACE}=${THIN_SPACE}${varName}`\n : String(enumValue)\n}\n\n/**\n * Controls whether the hidden enum values are visible.\n */\nconst isExpanded = ref(false)\n\nconst toggleExpanded = () => {\n isExpanded.value = !isExpanded.value\n}\n</script>\n\n<template>\n <div\n v-if=\"enumValues.length > 0\"\n class=\"property-enum\">\n <div\n v-if=\"propertyNames\"\n class=\"property-enum-property-names\">\n property names\n </div>\n <div\n v-else\n class=\"property-enum-property-names\">\n values\n </div>\n <ul class=\"property-enum-values\">\n <!-- Visible enum values -->\n <SchemaEnumPropertyItem\n v-for=\"(enumValue, index) in visibleEnumValues\"\n :key=\"String(enumValue)\"\n :description=\"getEnumValueDescription(enumValue, index)\"\n :label=\"formatEnumValueWithName(enumValue, index)\" />\n\n <!-- Hidden enum values (when expanded) -->\n <template v-if=\"shouldUseLongListDisplay && isExpanded\">\n <SchemaEnumPropertyItem\n v-for=\"(enumValue, index) in hiddenEnumValues\"\n :key=\"String(enumValue)\"\n :description=\"\n getEnumValueDescription(enumValue, initialVisibleCount + index)\n \"\n :label=\"\n formatEnumValueWithName(enumValue, initialVisibleCount + index)\n \" />\n </template>\n\n <!-- Toggle button for long lists -->\n <li v-if=\"shouldUseLongListDisplay\">\n <ScalarButton\n class=\"enum-toggle-button my-2 flex h-fit gap-1 rounded-full border py-1.5 pr-2.5 pl-2 leading-none\"\n variant=\"ghost\"\n @click=\"toggleExpanded\">\n <ScalarIconPlus\n :class=\"{ 'rotate-45': isExpanded }\"\n weight=\"bold\" />\n {{ isExpanded ? 'Hide values' : 'Show all values' }}\n </ScalarButton>\n </li>\n </ul>\n </div>\n</template>\n\n<style scoped>\n.property-heading:empty + .property-description:last-of-type,\n.property-description:first-of-type:last-of-type {\n margin-top: 0;\n}\n\n.property-list {\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius);\n margin-top: 10px;\n}\n\n.property-list .property:last-of-type {\n padding-bottom: 10px;\n}\n\n.property-enum-values {\n font-size: var(--scalar-font-size-3);\n list-style: none;\n margin-top: 8px;\n padding-left: 2px;\n}\n\n.enum-toggle-button:hover {\n color: var(--scalar-color-1);\n}\n\n.property-enum-property-names {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-2);\n display: inline-block;\n padding: 0 2px;\n margin-top: 8px;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"SchemaEnums.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, ref } from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nimport SchemaEnumPropertyItem from './SchemaEnumPropertyItem.vue'\n\nconst { value } = defineProps<{\n /** The schema object containing enum values and metadata */\n value: SchemaObject | undefined\n /** Whether to display the enum for property names */\n propertyNames?: boolean\n}>()\nconst { translate } = useLocalization()\n\nconst ENUM_DISPLAY_THRESHOLD = 9\nconst INITIAL_VISIBLE_COUNT = 5\nconst THIN_SPACE = '\\u2009'\n\n/**\n * Extracts enum values from the schema object.\n * Handles both direct enum values and nested enum arrays.\n */\nconst enumValues = computed(() => {\n if (!value) {\n return []\n }\n return (\n value.enum ||\n (isArraySchema(value) && resolve.schema(value.items)?.enum) ||\n []\n )\n})\n\n/**\n * Determines if we should show the long enum list UI.\n * When there are many enum values, we initially show only a subset.\n */\nconst shouldUseLongListDisplay = computed(\n () => enumValues.value.length > ENUM_DISPLAY_THRESHOLD,\n)\n\nconst initialVisibleCount = computed(() =>\n shouldUseLongListDisplay.value\n ? INITIAL_VISIBLE_COUNT\n : enumValues.value.length,\n)\n\nconst visibleEnumValues = computed(() =>\n enumValues.value.slice(0, initialVisibleCount.value),\n)\n\nconst hiddenEnumValues = computed(() =>\n enumValues.value.slice(initialVisibleCount.value),\n)\n\n/**\n * Gets the description for an enum value.\n * Supports both array and object formats for x-enumDescriptions.\n */\nconst getEnumValueDescription = (\n enumValue: any,\n index: number,\n): string | undefined => {\n const descriptions =\n value?.['x-enumDescriptions'] ?? value?.['x-enum-descriptions']\n\n if (!descriptions) {\n return undefined\n }\n\n if (Array.isArray(descriptions)) {\n return descriptions[index]\n }\n\n if (typeof descriptions === 'object' && descriptions !== null) {\n return (descriptions as Record<string, string>)[String(enumValue)]\n }\n\n return undefined\n}\n\n/**\n * Formats an enum value with its variable name if available.\n * This supports both x-enum-varnames and x-enumNames extensions.\n */\nconst formatEnumValueWithName = (enumValue: any, index: number): string => {\n const varNames = value?.['x-enum-varnames'] ?? value?.['x-enumNames']\n const varName = Array.isArray(varNames) ? varNames[index] : undefined\n return varName\n ? `${enumValue}${THIN_SPACE}=${THIN_SPACE}${varName}`\n : String(enumValue)\n}\n\n/**\n * Controls whether the hidden enum values are visible.\n */\nconst isExpanded = ref(false)\n\nconst toggleExpanded = () => {\n isExpanded.value = !isExpanded.value\n}\n</script>\n\n<template>\n <div\n v-if=\"enumValues.length > 0\"\n class=\"property-enum\">\n <div\n v-if=\"propertyNames\"\n class=\"property-enum-property-names\">\n {{ translate('common.propertyNames') }}\n </div>\n <div\n v-else\n class=\"property-enum-property-names\">\n {{ translate('common.values') }}\n </div>\n <ul class=\"property-enum-values\">\n <!-- Visible enum values -->\n <SchemaEnumPropertyItem\n v-for=\"(enumValue, index) in visibleEnumValues\"\n :key=\"String(enumValue)\"\n :description=\"getEnumValueDescription(enumValue, index)\"\n :label=\"formatEnumValueWithName(enumValue, index)\" />\n\n <!-- Hidden enum values (when expanded) -->\n <template v-if=\"shouldUseLongListDisplay && isExpanded\">\n <SchemaEnumPropertyItem\n v-for=\"(enumValue, index) in hiddenEnumValues\"\n :key=\"String(enumValue)\"\n :description=\"\n getEnumValueDescription(enumValue, initialVisibleCount + index)\n \"\n :label=\"\n formatEnumValueWithName(enumValue, initialVisibleCount + index)\n \" />\n </template>\n\n <!-- Toggle button for long lists -->\n <li v-if=\"shouldUseLongListDisplay\">\n <ScalarButton\n class=\"enum-toggle-button my-2 flex h-fit gap-1 rounded-full border py-1.5 pr-2.5 pl-2 leading-none\"\n variant=\"ghost\"\n @click=\"toggleExpanded\">\n <ScalarIconPlus\n :class=\"{ 'rotate-45': isExpanded }\"\n weight=\"bold\" />\n {{\n isExpanded\n ? translate('common.hideValues')\n : translate('common.showAllValues')\n }}\n </ScalarButton>\n </li>\n </ul>\n </div>\n</template>\n\n<style scoped>\n.property-heading:empty + .property-description:last-of-type,\n.property-description:first-of-type:last-of-type {\n margin-top: 0;\n}\n\n.property-list {\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius);\n margin-top: 10px;\n}\n\n.property-list .property:last-of-type {\n padding-bottom: 10px;\n}\n\n.property-enum-values {\n font-size: var(--scalar-font-size-3);\n list-style: none;\n margin-top: 8px;\n padding-left: 2px;\n}\n\n.enum-toggle-button:hover {\n color: var(--scalar-color-1);\n}\n\n.property-enum-property-names {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-2);\n display: inline-block;\n padding: 0 2px;\n margin-top: 8px;\n}\n</style>\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { useLocalization } from "../../../features/localization/use-localization.js";
1
2
  import SchemaEnumPropertyItem_default from "./SchemaEnumPropertyItem.vue.js";
2
3
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, withCtx } from "vue";
3
4
  import { ScalarIconPlus } from "@scalar/icons";
@@ -33,6 +34,7 @@ var SchemaEnums_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
33
34
  propertyNames: { type: Boolean }
34
35
  },
35
36
  setup(__props) {
37
+ const { translate } = useLocalization();
36
38
  const enumValues = computed(() => {
37
39
  if (!__props.value) return [];
38
40
  return __props.value.enum || isArraySchema(__props.value) && resolve.schema(__props.value.items)?.enum || [];
@@ -72,7 +74,7 @@ var SchemaEnums_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
72
74
  isExpanded.value = !isExpanded.value;
73
75
  };
74
76
  return (_ctx, _cache) => {
75
- return enumValues.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1, [__props.propertyNames ? (openBlock(), createElementBlock("div", _hoisted_2, " property names ")) : (openBlock(), createElementBlock("div", _hoisted_3, " values ")), createElementVNode("ul", _hoisted_4, [
77
+ return enumValues.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1, [__props.propertyNames ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(unref(translate)("common.propertyNames")), 1)) : (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(unref(translate)("common.values")), 1)), createElementVNode("ul", _hoisted_4, [
76
78
  (openBlock(true), createElementBlock(Fragment, null, renderList(visibleEnumValues.value, (enumValue, index) => {
77
79
  return openBlock(), createBlock(SchemaEnumPropertyItem_default, {
78
80
  key: String(enumValue),
@@ -95,7 +97,7 @@ var SchemaEnums_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
95
97
  default: withCtx(() => [createVNode(unref(ScalarIconPlus), {
96
98
  class: normalizeClass({ "rotate-45": isExpanded.value }),
97
99
  weight: "bold"
98
- }, null, 8, ["class"]), createTextVNode(" " + toDisplayString(isExpanded.value ? "Hide values" : "Show all values"), 1)]),
100
+ }, null, 8, ["class"]), createTextVNode(" " + toDisplayString(isExpanded.value ? unref(translate)("common.hideValues") : unref(translate)("common.showAllValues")), 1)]),
99
101
  _: 1
100
102
  })])) : createCommentVNode("", true)
101
103
  ])])) : createCommentVNode("", true);