@scalar/api-reference 1.60.0 → 1.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (555) hide show
  1. package/CHANGELOG.md +40 -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-C3QiXv0S.js +27 -0
  71. package/dist/browser/chunks/ScalarTextInput.vue-CysYmeeN.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-LBDjZSmM.js → modal-CMytT4BZ.js} +2 -2
  139. package/dist/browser/chunks/modal-wI0tG53V.js +99 -0
  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-BPQqqkn-.js +306 -0
  161. package/dist/browser/standalone.esm.js +20 -20
  162. package/dist/browser/standalone.js +294 -294
  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 +181 -46
  190. package/dist/components/ApiReference.vue.script.js.map +1 -1
  191. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.d.ts +10 -0
  192. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.d.ts.map +1 -0
  193. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js +9 -0
  194. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js.map +1 -0
  195. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js +47 -0
  196. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js.map +1 -0
  197. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts.map +1 -1
  198. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.js.map +1 -1
  199. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +2 -0
  200. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -1
  201. package/dist/components/Content/AsyncApi/Channel.vue.d.ts +4 -1
  202. package/dist/components/Content/AsyncApi/Channel.vue.d.ts.map +1 -1
  203. package/dist/components/Content/AsyncApi/Channel.vue.js +1 -1
  204. package/dist/components/Content/AsyncApi/Channel.vue.js.map +1 -1
  205. package/dist/components/Content/AsyncApi/Channel.vue.script.js +98 -44
  206. package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -1
  207. package/dist/components/Content/AsyncApi/Message.vue.d.ts +18 -0
  208. package/dist/components/Content/AsyncApi/Message.vue.d.ts.map +1 -0
  209. package/dist/components/Content/AsyncApi/Message.vue.js +9 -0
  210. package/dist/components/Content/AsyncApi/Message.vue.js.map +1 -0
  211. package/dist/components/Content/AsyncApi/Message.vue.script.js +159 -0
  212. package/dist/components/Content/AsyncApi/Message.vue.script.js.map +1 -0
  213. package/dist/components/Content/AsyncApi/Operation.vue.d.ts +18 -0
  214. package/dist/components/Content/AsyncApi/Operation.vue.d.ts.map +1 -0
  215. package/dist/components/Content/AsyncApi/Operation.vue.js +9 -0
  216. package/dist/components/Content/AsyncApi/Operation.vue.js.map +1 -0
  217. package/dist/components/Content/AsyncApi/Operation.vue.script.js +84 -0
  218. package/dist/components/Content/AsyncApi/Operation.vue.script.js.map +1 -0
  219. package/dist/components/Content/AsyncApi/helpers/async-api-render-options.d.ts +14 -0
  220. package/dist/components/Content/AsyncApi/helpers/async-api-render-options.d.ts.map +1 -0
  221. package/dist/components/Content/AsyncApi/helpers/async-api-render-options.js +14 -0
  222. package/dist/components/Content/AsyncApi/helpers/async-api-render-options.js.map +1 -0
  223. package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.d.ts +9 -0
  224. package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.d.ts.map +1 -0
  225. package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.js +12 -0
  226. package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.js.map +1 -0
  227. package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.d.ts +13 -0
  228. package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.d.ts.map +1 -0
  229. package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.js +23 -0
  230. package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.js.map +1 -0
  231. package/dist/components/Content/AsyncApi/helpers/pick-heading.d.ts +10 -0
  232. package/dist/components/Content/AsyncApi/helpers/pick-heading.d.ts.map +1 -0
  233. package/dist/components/Content/AsyncApi/helpers/pick-heading.js +20 -0
  234. package/dist/components/Content/AsyncApi/helpers/pick-heading.js.map +1 -0
  235. package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.d.ts +21 -0
  236. package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.d.ts.map +1 -0
  237. package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.js +35 -0
  238. package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.js.map +1 -0
  239. package/dist/components/Content/Auth/Auth.vue.d.ts.map +1 -1
  240. package/dist/components/Content/Auth/Auth.vue.js.map +1 -1
  241. package/dist/components/Content/Auth/Auth.vue.script.js +5 -2
  242. package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -1
  243. package/dist/components/Content/Content.vue.d.ts +1 -0
  244. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  245. package/dist/components/Content/Content.vue.js.map +1 -1
  246. package/dist/components/Content/Content.vue.script.js +4 -1
  247. package/dist/components/Content/Content.vue.script.js.map +1 -1
  248. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +3 -1
  249. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  250. package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -1
  251. package/dist/components/Content/Operations/TraversedEntry.vue.script.js +9 -0
  252. package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
  253. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  254. package/dist/components/Content/Schema/Schema.vue.js +1 -1
  255. package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
  256. package/dist/components/Content/Schema/Schema.vue.script.js +10 -6
  257. package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
  258. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  259. package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
  260. package/dist/components/Content/Schema/SchemaComposition.vue.script.js +25 -12
  261. package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
  262. package/dist/components/Content/Schema/SchemaEnums.vue.d.ts.map +1 -1
  263. package/dist/components/Content/Schema/SchemaEnums.vue.js +1 -1
  264. package/dist/components/Content/Schema/SchemaEnums.vue.js.map +1 -1
  265. package/dist/components/Content/Schema/SchemaEnums.vue.script.js +4 -2
  266. package/dist/components/Content/Schema/SchemaEnums.vue.script.js.map +1 -1
  267. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
  268. package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
  269. package/dist/components/Content/Schema/SchemaHeading.vue.js.map +1 -1
  270. package/dist/components/Content/Schema/SchemaHeading.vue.script.js +6 -4
  271. package/dist/components/Content/Schema/SchemaHeading.vue.script.js.map +1 -1
  272. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -1
  273. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js +1 -1
  274. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js.map +1 -1
  275. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  276. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -1
  277. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +12 -0
  278. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
  279. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +3 -1
  280. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  281. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  282. package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
  283. package/dist/components/Content/Schema/SchemaProperty.vue.script.js +24 -6
  284. package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
  285. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.d.ts.map +1 -1
  286. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +1 -1
  287. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js.map +1 -1
  288. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js +8 -5
  289. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js.map +1 -1
  290. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
  291. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +1 -1
  292. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js.map +1 -1
  293. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js +5 -3
  294. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js.map +1 -1
  295. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +3 -1
  296. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  297. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  298. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js.map +1 -1
  299. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +47 -22
  300. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -1
  301. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
  302. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +10 -9
  303. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
  304. package/dist/components/Content/Tags/components/ModernLayout.vue.d.ts.map +1 -1
  305. package/dist/components/Content/Tags/components/ModernLayout.vue.js +1 -1
  306. package/dist/components/Content/Tags/components/ModernLayout.vue.js.map +1 -1
  307. package/dist/components/Content/Tags/components/ModernLayout.vue.script.js +3 -1
  308. package/dist/components/Content/Tags/components/ModernLayout.vue.script.js.map +1 -1
  309. package/dist/components/Content/Tags/components/TagSection.vue.d.ts.map +1 -1
  310. package/dist/components/Content/Tags/components/TagSection.vue.js.map +1 -1
  311. package/dist/components/Content/Tags/components/TagSection.vue.script.js +3 -1
  312. package/dist/components/Content/Tags/components/TagSection.vue.script.js.map +1 -1
  313. package/dist/components/GettingStarted.vue.d.ts.map +1 -1
  314. package/dist/components/GettingStarted.vue.js +1 -1
  315. package/dist/components/GettingStarted.vue.js.map +1 -1
  316. package/dist/components/GettingStarted.vue.script.js +58 -21
  317. package/dist/components/GettingStarted.vue.script.js.map +1 -1
  318. package/dist/components/MobileHeader.vue.d.ts.map +1 -1
  319. package/dist/components/MobileHeader.vue.js.map +1 -1
  320. package/dist/components/MobileHeader.vue.script.js +3 -1
  321. package/dist/components/MobileHeader.vue.script.js.map +1 -1
  322. package/dist/components/OperationsList/OperationsList.vue.d.ts.map +1 -1
  323. package/dist/components/OperationsList/OperationsList.vue.js +1 -1
  324. package/dist/components/OperationsList/OperationsList.vue.js.map +1 -1
  325. package/dist/components/OperationsList/OperationsList.vue.script.js +4 -2
  326. package/dist/components/OperationsList/OperationsList.vue.script.js.map +1 -1
  327. package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
  328. package/dist/components/ShowMoreButton.vue.js +1 -1
  329. package/dist/components/ShowMoreButton.vue.js.map +1 -1
  330. package/dist/components/ShowMoreButton.vue.script.js +4 -2
  331. package/dist/components/ShowMoreButton.vue.script.js.map +1 -1
  332. package/dist/features/Operation/Operation.vue.d.ts +3 -1
  333. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  334. package/dist/features/Operation/Operation.vue.js.map +1 -1
  335. package/dist/features/Operation/Operation.vue.script.js +6 -1
  336. package/dist/features/Operation/Operation.vue.script.js.map +1 -1
  337. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
  338. package/dist/features/Operation/components/ContentTypeSelect.vue.js.map +1 -1
  339. package/dist/features/Operation/components/ContentTypeSelect.vue.script.js +4 -2
  340. package/dist/features/Operation/components/ContentTypeSelect.vue.script.js.map +1 -1
  341. package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
  342. package/dist/features/Operation/components/Headers.vue.js +1 -1
  343. package/dist/features/Operation/components/Headers.vue.js.map +1 -1
  344. package/dist/features/Operation/components/Headers.vue.script.js +8 -6
  345. package/dist/features/Operation/components/Headers.vue.script.js.map +1 -1
  346. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  347. package/dist/features/Operation/components/OperationParameters.vue.js.map +1 -1
  348. package/dist/features/Operation/components/OperationParameters.vue.script.js +8 -6
  349. package/dist/features/Operation/components/OperationParameters.vue.script.js.map +1 -1
  350. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  351. package/dist/features/Operation/components/OperationResponses.vue.js.map +1 -1
  352. package/dist/features/Operation/components/OperationResponses.vue.script.js +10 -7
  353. package/dist/features/Operation/components/OperationResponses.vue.script.js.map +1 -1
  354. package/dist/features/Operation/components/ParameterListItem.vue.script.js +1 -1
  355. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  356. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  357. package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
  358. package/dist/features/Operation/components/RequestBody.vue.script.js +18 -13
  359. package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
  360. package/dist/features/Operation/components/SecurityRequirementBadge.vue.d.ts.map +1 -1
  361. package/dist/features/Operation/components/SecurityRequirementBadge.vue.js.map +1 -1
  362. package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js +5 -3
  363. package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js.map +1 -1
  364. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
  365. package/dist/features/Operation/components/callbacks/Callbacks.vue.js.map +1 -1
  366. package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js +11 -8
  367. package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js.map +1 -1
  368. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  369. package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
  370. package/dist/features/Operation/layouts/ClassicLayout.vue.js.map +1 -1
  371. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +37 -17
  372. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -1
  373. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  374. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  375. package/dist/features/Operation/layouts/ModernLayout.vue.js.map +1 -1
  376. package/dist/features/Operation/layouts/ModernLayout.vue.script.js +22 -7
  377. package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
  378. package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
  379. package/dist/features/Search/components/SearchButton.vue.js.map +1 -1
  380. package/dist/features/Search/components/SearchButton.vue.script.js +15 -8
  381. package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -1
  382. package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
  383. package/dist/features/Search/components/SearchModal.vue.js +1 -1
  384. package/dist/features/Search/components/SearchModal.vue.js.map +1 -1
  385. package/dist/features/Search/components/SearchModal.vue.script.js +29 -10
  386. package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -1
  387. package/dist/features/Search/components/SearchResult.vue.d.ts.map +1 -1
  388. package/dist/features/Search/components/SearchResult.vue.js.map +1 -1
  389. package/dist/features/Search/components/SearchResult.vue.script.js +12 -8
  390. package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -1
  391. package/dist/features/Search/helpers/create-search-index.d.ts +8 -0
  392. package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
  393. package/dist/features/Search/helpers/create-search-index.js +18 -9
  394. package/dist/features/Search/helpers/create-search-index.js.map +1 -1
  395. package/dist/features/Search/hooks/useSearchIndex.d.ts +7 -1
  396. package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -1
  397. package/dist/features/Search/hooks/useSearchIndex.js +11 -2
  398. package/dist/features/Search/hooks/useSearchIndex.js.map +1 -1
  399. package/dist/features/ask-agent-button/AskAgentButton.vue.d.ts.map +1 -1
  400. package/dist/features/ask-agent-button/AskAgentButton.vue.js +1 -1
  401. package/dist/features/ask-agent-button/AskAgentButton.vue.js.map +1 -1
  402. package/dist/features/ask-agent-button/AskAgentButton.vue.script.js +10 -6
  403. package/dist/features/ask-agent-button/AskAgentButton.vue.script.js.map +1 -1
  404. package/dist/features/developer-tools/DeveloperTools.vue.d.ts.map +1 -1
  405. package/dist/features/developer-tools/DeveloperTools.vue.js.map +1 -1
  406. package/dist/features/developer-tools/DeveloperTools.vue.script.js +10 -8
  407. package/dist/features/developer-tools/DeveloperTools.vue.script.js.map +1 -1
  408. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.d.ts.map +1 -1
  409. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js.map +1 -1
  410. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js +11 -11
  411. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js.map +1 -1
  412. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +1 -1
  413. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js.map +1 -1
  414. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js +15 -11
  415. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -1
  416. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js +1 -1
  417. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.d.ts +1 -3
  418. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.d.ts.map +1 -1
  419. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js.map +1 -1
  420. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js +4 -6
  421. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js.map +1 -1
  422. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.d.ts.map +1 -1
  423. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js.map +1 -1
  424. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js +6 -4
  425. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js.map +1 -1
  426. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -1
  427. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js.map +1 -1
  428. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js +23 -22
  429. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js.map +1 -1
  430. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.d.ts.map +1 -1
  431. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js.map +1 -1
  432. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js +7 -5
  433. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js.map +1 -1
  434. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.d.ts.map +1 -1
  435. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js.map +1 -1
  436. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js +9 -7
  437. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js.map +1 -1
  438. package/dist/features/developer-tools/components/DeployApiReference.vue.d.ts.map +1 -1
  439. package/dist/features/developer-tools/components/DeployApiReference.vue.js.map +1 -1
  440. package/dist/features/developer-tools/components/DeployApiReference.vue.script.js +7 -4
  441. package/dist/features/developer-tools/components/DeployApiReference.vue.script.js.map +1 -1
  442. package/dist/features/developer-tools/components/ModifyConfiguration.vue.d.ts.map +1 -1
  443. package/dist/features/developer-tools/components/ModifyConfiguration.vue.js.map +1 -1
  444. package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js +8 -6
  445. package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js.map +1 -1
  446. package/dist/features/developer-tools/components/ShareApiReference.vue.d.ts.map +1 -1
  447. package/dist/features/developer-tools/components/ShareApiReference.vue.js.map +1 -1
  448. package/dist/features/developer-tools/components/ShareApiReference.vue.script.js +7 -4
  449. package/dist/features/developer-tools/components/ShareApiReference.vue.script.js.map +1 -1
  450. package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
  451. package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
  452. package/dist/features/example-responses/ExampleResponse.vue.js.map +1 -1
  453. package/dist/features/example-responses/ExampleResponse.vue.script.js +5 -3
  454. package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
  455. package/dist/features/example-responses/ExampleResponses.vue.d.ts +9 -0
  456. package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
  457. package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
  458. package/dist/features/example-responses/ExampleResponses.vue.js.map +1 -1
  459. package/dist/features/example-responses/ExampleResponses.vue.script.js +42 -23
  460. package/dist/features/example-responses/ExampleResponses.vue.script.js.map +1 -1
  461. package/dist/features/example-responses/ExampleSchema.vue.js.map +1 -1
  462. package/dist/features/example-responses/ExampleSchema.vue.script.js +1 -1
  463. package/dist/features/example-responses/ExampleSchema.vue.script.js.map +1 -1
  464. package/dist/features/info-object/Contact.vue.d.ts.map +1 -1
  465. package/dist/features/info-object/Contact.vue.js.map +1 -1
  466. package/dist/features/info-object/Contact.vue.script.js +14 -11
  467. package/dist/features/info-object/Contact.vue.script.js.map +1 -1
  468. package/dist/features/info-object/InfoLink.vue.d.ts +8 -0
  469. package/dist/features/info-object/InfoLink.vue.d.ts.map +1 -0
  470. package/dist/features/info-object/InfoLink.vue.js +7 -0
  471. package/dist/features/info-object/InfoLink.vue.js.map +1 -0
  472. package/dist/features/info-object/InfoLink.vue.script.js +30 -0
  473. package/dist/features/info-object/InfoLink.vue.script.js.map +1 -0
  474. package/dist/features/info-object/TermsOfService.vue.d.ts.map +1 -1
  475. package/dist/features/info-object/TermsOfService.vue.js.map +1 -1
  476. package/dist/features/info-object/TermsOfService.vue.script.js +9 -6
  477. package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -1
  478. package/dist/features/info-object/index.d.ts +1 -0
  479. package/dist/features/info-object/index.d.ts.map +1 -1
  480. package/dist/features/localization/index.d.ts +2 -0
  481. package/dist/features/localization/index.d.ts.map +1 -0
  482. package/dist/features/localization/locales/ar.d.ts +227 -0
  483. package/dist/features/localization/locales/ar.d.ts.map +1 -0
  484. package/dist/features/localization/locales/ar.js +225 -0
  485. package/dist/features/localization/locales/ar.js.map +1 -0
  486. package/dist/features/localization/locales/de.d.ts +227 -0
  487. package/dist/features/localization/locales/de.d.ts.map +1 -0
  488. package/dist/features/localization/locales/de.js +225 -0
  489. package/dist/features/localization/locales/de.js.map +1 -0
  490. package/dist/features/localization/locales/en.d.ts +227 -0
  491. package/dist/features/localization/locales/en.d.ts.map +1 -0
  492. package/dist/features/localization/locales/en.js +225 -0
  493. package/dist/features/localization/locales/en.js.map +1 -0
  494. package/dist/features/localization/locales/es.d.ts +227 -0
  495. package/dist/features/localization/locales/es.d.ts.map +1 -0
  496. package/dist/features/localization/locales/es.js +225 -0
  497. package/dist/features/localization/locales/es.js.map +1 -0
  498. package/dist/features/localization/locales/fr.d.ts +227 -0
  499. package/dist/features/localization/locales/fr.d.ts.map +1 -0
  500. package/dist/features/localization/locales/fr.js +225 -0
  501. package/dist/features/localization/locales/fr.js.map +1 -0
  502. package/dist/features/localization/locales/ru.d.ts +227 -0
  503. package/dist/features/localization/locales/ru.d.ts.map +1 -0
  504. package/dist/features/localization/locales/ru.js +225 -0
  505. package/dist/features/localization/locales/ru.js.map +1 -0
  506. package/dist/features/localization/locales/zh-cn.d.ts +227 -0
  507. package/dist/features/localization/locales/zh-cn.d.ts.map +1 -0
  508. package/dist/features/localization/locales/zh-cn.js +225 -0
  509. package/dist/features/localization/locales/zh-cn.js.map +1 -0
  510. package/dist/features/localization/translations.d.ts +1588 -0
  511. package/dist/features/localization/translations.d.ts.map +1 -0
  512. package/dist/features/localization/translations.js +27 -0
  513. package/dist/features/localization/translations.js.map +1 -0
  514. package/dist/features/localization/use-localization.d.ts +18 -0
  515. package/dist/features/localization/use-localization.d.ts.map +1 -0
  516. package/dist/features/localization/use-localization.js +58 -0
  517. package/dist/features/localization/use-localization.js.map +1 -0
  518. package/dist/features/multiple-documents/DocumentSelector.vue.script.js +1 -1
  519. package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -1
  520. package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
  521. package/dist/features/test-request-button/TestRequestButton.vue.js.map +1 -1
  522. package/dist/features/test-request-button/TestRequestButton.vue.script.js +3 -1
  523. package/dist/features/test-request-button/TestRequestButton.vue.script.js.map +1 -1
  524. package/dist/helpers/get-async-api-message-payload-schema.d.ts +18 -0
  525. package/dist/helpers/get-async-api-message-payload-schema.d.ts.map +1 -0
  526. package/dist/helpers/get-async-api-message-payload-schema.js +33 -0
  527. package/dist/helpers/get-async-api-message-payload-schema.js.map +1 -0
  528. package/dist/helpers/get-async-api-model-schema.d.ts.map +1 -1
  529. package/dist/helpers/get-async-api-model-schema.js +2 -11
  530. package/dist/helpers/get-async-api-model-schema.js.map +1 -1
  531. package/dist/helpers/is-introduction-entry.d.ts +16 -0
  532. package/dist/helpers/is-introduction-entry.d.ts.map +1 -0
  533. package/dist/helpers/is-introduction-entry.js +17 -0
  534. package/dist/helpers/is-introduction-entry.js.map +1 -0
  535. package/dist/helpers/load-from-perssistance.js +1 -1
  536. package/dist/helpers/load-from-perssistance.js.map +1 -1
  537. package/dist/helpers/map-config-plugins.d.ts +8 -3
  538. package/dist/helpers/map-config-plugins.d.ts.map +1 -1
  539. package/dist/helpers/map-config-plugins.js +22 -4
  540. package/dist/helpers/map-config-plugins.js.map +1 -1
  541. package/dist/helpers/map-config-to-workspace-store.js +1 -1
  542. package/dist/helpers/map-config-to-workspace-store.js.map +1 -1
  543. package/dist/helpers/storage.d.ts +14 -14
  544. package/dist/style.css +783 -666
  545. package/dist/styles/tailwind.config.css +1 -0
  546. package/dist/vue-styles.css +700 -597
  547. package/package.json +18 -17
  548. package/dist/browser/chunks/AgentScalarChatInterface-CesFQ_Ax.js +0 -27
  549. package/dist/browser/chunks/ScalarTextInput.vue-C14zmVNI.js +0 -27
  550. package/dist/browser/chunks/modal-BZzcBkVp.js +0 -99
  551. package/dist/browser/chunks/vendor-wW8jg8wN.js +0 -306
  552. package/dist/features/Operation/helpers/get-first-server.d.ts +0 -9
  553. package/dist/features/Operation/helpers/get-first-server.d.ts.map +0 -1
  554. package/dist/features/Operation/helpers/get-first-server.js +0 -27
  555. package/dist/features/Operation/helpers/get-first-server.js.map +0 -1
@@ -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 * 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 :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,12 +1,13 @@
1
+ import { useLocalization } from "../../../features/localization/use-localization.js";
2
+ import { mergeAllOfSchemas } from "./helpers/merge-all-of-schemas.js";
1
3
  import { getCycleKey } from "./helpers/schema-cycle.js";
2
4
  import { REQUEST_BODY_COMPOSITION_INDEX_SYMBOL } from "../../../features/Operation/request-body-composition-index.js";
3
5
  import { getSchemaType } from "./helpers/get-schema-type.js";
4
- import { mergeAllOfSchemas } from "./helpers/merge-all-of-schemas.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,14 +83,23 @@ 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
  /**
90
+ * The request body card renders the merged `allOf` description on its outer card
91
+ * (see `Schema.vue`), but only for the top-level request body schema. For that
92
+ * single composition we hide the nested merged `Schema`'s description so the text
93
+ * is not shown twice. Nested request-body compositions (deeper properties) are
94
+ * not shown on the outer card and would otherwise lose their description
95
+ * entirely, because the property row already skips it when `allOf` is present.
96
+ *
97
+ * The top-level request body composition is the one whose `compositionPath` is
98
+ * still the request body root (`['requestBody']`); nested compositions append
99
+ * property segments and therefore have a longer path.
100
+ */
101
+ const isRequestBodyRootComposition = computed(() => props.schemaContext === "requestBody" && props.compositionPath?.length === 1);
102
+ /**
92
103
  * Cycle key for the selected composition member, derived from its raw
93
104
  * (unresolved) value so a member that references an ancestor is detected as a
94
105
  * cycle.
@@ -115,6 +126,7 @@ var SchemaComposition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
115
126
  compositionPath: __props.compositionPath,
116
127
  discriminator: __props.discriminator,
117
128
  eventBus: __props.eventBus,
129
+ hideDescription: isRequestBodyRootComposition.value,
118
130
  hideHeading: __props.hideHeading,
119
131
  hideModelNames: __props.hideModelNames,
120
132
  level: __props.level + 1,
@@ -129,6 +141,7 @@ var SchemaComposition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
129
141
  "compositionPath",
130
142
  "discriminator",
131
143
  "eventBus",
144
+ "hideDescription",
132
145
  "hideHeading",
133
146
  "hideModelNames",
134
147
  "level",
@@ -143,9 +156,9 @@ var SchemaComposition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
143
156
  resize: ""
144
157
  }, {
145
158
  default: withCtx(() => [createElementVNode("button", _hoisted_2, [
146
- createElementVNode("span", _hoisted_3, toDisplayString(humanizeType(props.composition)), 1),
147
- createElementVNode("span", { class: normalizeClass(["composition-selector-label text-c-1", { "line-through": selectedComposition.value?.deprecated }]) }, toDisplayString(selectedOption.value?.label || "Schema"), 3),
148
- 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),
149
162
  createVNode(unref(ScalarIconCaretDown))
150
163
  ])]),
151
164
  _: 1
@@ -154,7 +167,7 @@ var SchemaComposition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
154
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",
155
168
  type: "button",
156
169
  onClick: _cache[1] || (_cache[1] = ($event) => showNestedSchema.value = true)
157
- }, [_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, {
158
171
  key: selectedOption.value?.id ?? "0",
159
172
  breadcrumb: __props.breadcrumb,
160
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 * 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 :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,cAAc,SAAS,KACnE;AACF,UAAO;IAAE,IAAI,OAAO,MAAM;IAAE;IAAM;IAClC,CACJ;EAEA,MAAM,0BAA0B,eAC9B,MAAM,iBAAiB,SACnB,CAAC,GAAG,MAAM,iBAAiB,MAAM,YAAY,CAAC,KAAK,IAAG,GACtD,GACN;;EAGA,MAAM,qCAAqC,OACzC,uCACA,KAAA,EACF;EAEA,MAAM,uBAAuB,eAAe;AAC1C,OACE,MAAM,kBAAkB,iBACxB,CAAC,oCAAoC,SACrC,CAAC,wBAAwB,MAEzB,QAAO;GAGT,MAAM,gBACJ,mCAAmC,MAAM,wBAAwB;AAEnE,OAAI,OAAO,kBAAkB,YAAY,OAAO,MAAM,cAAc,CAClE,QAAO;AAGT,UAAO,KAAK,IAAI,GAAG,KAAK,IAAI,eAAe,eAAe,MAAM,SAAS,EAAE,CAAA;IAC5E;;;;;EAMD,MAAM,iBAAiB,KAAqC;AAE5D,QACE,CAAC,gBAAgB,qBAAqB,GACrC,CAAC,SAAS,mBAAmB;AAC5B,OACE,CAAC,eAAe,SAChB,CAAC,QAAQ,MAAM,WAAW,OAAO,OAAO,eAAe,OAAO,GAAE,CAEhE,gBAAe,QAAQ,QAAQ,kBAAkB,QAAQ;KAG7D,EAAE,WAAW,MAAM,CACrB;;;;;EAMA,MAAM,gBAAgB,SACpB,KACG,QAAQ,YAAY,MAAK,CACzB,QAAQ,OAAO,QAAQ,IAAI,aAAa,CAAA,CACxC,aAAY,CACZ,QAAQ,UAAU,MAAM,EAAE,aAAa,CAAA;;EAG5C,MAAM,sBAAsB,eACpB,YAAY,MAAM,OAAO,eAAe,OAAO,MAAM,IAAI,GAAG,MACpE;;;;;;EAOA,MAAM,8BAA8B,eAClC,YACE,YAAY,MAAM,OAAO,eAAe,OAAO,MAAM,IAAI,GAAG,SAC7D,CACH;;;;;;EAOA,MAAM,mBAAmB,IAAI,CAAC,CAAC,MAAM,QAAQ,0BAAyB;AAEtE,MACE,sCACA,MAAM,kBAAkB,iBACxB,wBAAwB,MAExB,OACE,iBACC,WAAW;GACV,MAAM,QAAQ,SAAS,OAAO,OAAO,GAAG,GAAG;AAC3C,OAAI,CAAC,OAAO,MAAM,MAAM,CACtB,oCAAmC,QAAQ;IACzC,GAAG,mCAAmC;KACrC,wBAAwB,QAAQ;IAClC;KAGL,EAAE,WAAW,MAAM,CACrB;;uBAKA,mBA2EM,OA3EN,YA2EM,CAxEI,MAAM,gBAAW,WAAA,WAAA,EADzB,YAcmC,gBAAA;;IAZhC,YAAY,QAAA;IACZ,SAAS,QAAA;IACT,iBAAiB,QAAA;IACjB,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,MAAA,kBAAiB,CAAC,QAAA,OAAM;IAChC,eAAe,QAAA;;;;;;;;;;;;;;uBAElB,mBAwDW,UAAA,EAAA,KAAA,GAAA,EAAA,CAtDT,YAsBgB,MAAA,cAAA,EAAA;gBArBL,eAAA;gFAAc,QAAA;IACtB,SAAS,eAAA;IACV,QAAA;;2BAkBS,CAjBT,mBAiBS,UAjBT,YAiBS;KAdP,mBAAmE,QAAnE,YAAmE,gBAAzC,aAAa,MAAM,YAAW,CAAA,EAAA,EAAA;KACxD,mBAMO,QAAA,EALL,OAAK,eAAA,CAAC,uCAAqC,EAAA,gBACH,oBAAA,OAAqB,YAAA,CAAA,CAAA,EAAA,EAAA,gBAG1D,eAAA,OAAgB,SAAK,SAAA,EAAA,EAAA;KAGlB,oBAAA,OAAqB,cAAA,WAAA,EAD7B,mBAIM,OAJN,YAEmB,eAEnB,IAAA,mBAAA,IAAA,KAAA;KACA,YAAuB,MAAA,oBAAA,CAAA;;;qCAI3B,mBA6BM,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,MAAM,uBAAuB,eAAe;AAC1C,OACE,MAAM,kBAAkB,iBACxB,CAAC,oCAAoC,SACrC,CAAC,wBAAwB,MAEzB,QAAO;GAGT,MAAM,gBACJ,mCAAmC,MAAM,wBAAwB;AAEnE,OAAI,OAAO,kBAAkB,YAAY,OAAO,MAAM,cAAc,CAClE,QAAO;AAGT,UAAO,KAAK,IAAI,GAAG,KAAK,IAAI,eAAe,eAAe,MAAM,SAAS,EAAE,CAAA;IAC5E;;;;;EAMD,MAAM,iBAAiB,KAAqC;AAE5D,QACE,CAAC,gBAAgB,qBAAqB,GACrC,CAAC,SAAS,mBAAmB;AAC5B,OACE,CAAC,eAAe,SAChB,CAAC,QAAQ,MAAM,WAAW,OAAO,OAAO,eAAe,OAAO,GAAE,CAEhE,gBAAe,QAAQ,QAAQ,kBAAkB,QAAQ;KAG7D,EAAE,WAAW,MAAM,CACrB;EAEA,MAAM,oBAAoB,SACxB,UAAU,UAAU,OAAM;;EAG5B,MAAM,sBAAsB,eACpB,YAAY,MAAM,OAAO,eAAe,OAAO,MAAM,IAAI,GAAG,MACpE;;;;;;;;;;;;;EAcA,MAAM,+BAA+B,eAEjC,MAAM,kBAAkB,iBACxB,MAAM,iBAAiB,WAAW,EACtC;;;;;;EAOA,MAAM,8BAA8B,eAClC,YACE,YAAY,MAAM,OAAO,eAAe,OAAO,MAAM,IAAI,GAAG,SAC7D,CACH;;;;;;EAOA,MAAM,mBAAmB,IAAI,CAAC,CAAC,MAAM,QAAQ,0BAAyB;AAEtE,MACE,sCACA,MAAM,kBAAkB,iBACxB,wBAAwB,MAExB,OACE,iBACC,WAAW;GACV,MAAM,QAAQ,SAAS,OAAO,OAAO,GAAG,GAAG;AAC3C,OAAI,CAAC,OAAO,MAAM,MAAM,CACtB,oCAAmC,QAAQ;IACzC,GAAG,mCAAmC;KACrC,wBAAwB,QAAQ;IAClC;KAGL,EAAE,WAAW,MAAM,CACrB;;uBAKA,mBA8EM,OA9EN,YA8EM,CA3EI,MAAM,gBAAW,WAAA,WAAA,EADzB,YAemC,gBAAA;;IAbhC,YAAY,QAAA;IACZ,SAAS,QAAA;IACT,iBAAiB,QAAA;IACjB,eAAe,QAAA;IACf,UAAU,QAAA;IACV,iBAAiB,6BAAA;IACjB,aAAa,QAAA;IACb,gBAAA,QAAA;IACA,OAAO,QAAA,QAAK;IACZ,MAAM,QAAA;IACN,gBAAgB;IAChB,SAAS,QAAA;IACT,QAAQ,MAAA,kBAAiB,CAAC,QAAA,OAAM;IAChC,eAAe,QAAA;;;;;;;;;;;;;;;uBAElB,mBA0DW,UAAA,EAAA,KAAA,GAAA,EAAA,CAxDT,YAwBgB,MAAA,cAAA,EAAA;gBAvBL,eAAA;gFAAc,QAAA;IACtB,SAAS,eAAA;IACV,QAAA;;2BAoBS,CAnBT,mBAmBS,UAnBT,YAmBS;KAhBP,mBAES,QAFT,YAES,gBADP,iBAAiB,MAAM,YAAW,CAAA,EAAA,EAAA;KAEpC,mBAMO,QAAA,EALL,OAAK,eAAA,CAAC,uCAAqC,EAAA,gBACH,oBAAA,OAAqB,YAAA,CAAA,CAAA,EAAA,EAAA,gBAG1D,eAAA,OAAgB,SAAS,MAAA,UAAS,CAAA,gBAAA,CAAA,EAAA,EAAA;KAG/B,oBAAA,OAAqB,cAAA,WAAA,EAD7B,mBAIM,OAJN,YAIM,gBADD,MAAA,UAAS,CAAA,oBAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;KAEd,YAAuB,MAAA,oBAAA,CAAA;;;qCAI3B,mBA6BM,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;uCACrB,MAAA,UAAS,CAAA,2BAAA,CAAA,GAA+B,KAC3C,EAAA,EAAA,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 +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);
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaEnums.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, ref } from 'vue'\n\nimport 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":";;;;;;;;;;;;;;;;;;;;;AAiBA,IAAM,yBAAyB;AAC/B,IAAM,wBAAwB;AAC9B,IAAM,aAAa;;;;;;;;;;;;EAMnB,MAAM,aAAa,eAAe;AAChC,OAAI,CAAC,QAAA,MACH,QAAO,EAAC;AAEV,UACE,QAAA,MAAM,QACL,cAAc,QAAA,MAAM,IAAI,QAAQ,OAAO,QAAA,MAAM,MAAM,EAAE,QACtD,EAAC;IAEJ;;;;;EAMD,MAAM,2BAA2B,eACzB,WAAW,MAAM,SAAS,uBAClC;EAEA,MAAM,sBAAsB,eAC1B,yBAAyB,QACrB,wBACA,WAAW,MAAM,OACvB;EAEA,MAAM,oBAAoB,eACxB,WAAW,MAAM,MAAM,GAAG,oBAAoB,MAAM,CACtD;EAEA,MAAM,mBAAmB,eACvB,WAAW,MAAM,MAAM,oBAAoB,MAAM,CACnD;;;;;EAMA,MAAM,2BACJ,WACA,UACuB;GACvB,MAAM,eACJ,QAAA,QAAQ,yBAAyB,QAAA,QAAQ;AAE3C,OAAI,CAAC,aACH;AAGF,OAAI,MAAM,QAAQ,aAAa,CAC7B,QAAO,aAAa;AAGtB,OAAI,OAAO,iBAAiB,YAAY,iBAAiB,KACvD,QAAQ,aAAwC,OAAO,UAAU;;;;;;EAUrE,MAAM,2BAA2B,WAAgB,UAA0B;GACzE,MAAM,WAAW,QAAA,QAAQ,sBAAsB,QAAA,QAAQ;GACvD,MAAM,UAAU,MAAM,QAAQ,SAAS,GAAG,SAAS,SAAS,KAAA;AAC5D,UAAO,UACH,GAAG,YAAY,WAAW,GAAG,aAAa,YAC1C,OAAO,UAAS;;;;;EAMtB,MAAM,aAAa,IAAI,MAAK;EAE5B,MAAM,uBAAuB;AAC3B,cAAW,QAAQ,CAAC,WAAW;;;UAMvB,WAAA,MAAW,SAAM,KAAA,WAAA,EADzB,mBA+CM,OA/CN,YA+CM,CA3CI,QAAA,iBAAA,WAAA,EADR,mBAIM,OAJN,YAEuC,mBAEvC,KAAA,WAAA,EACA,mBAIM,OAJN,YAEuC,WAEvC,GACA,mBAiCK,MAjCL,YAiCK;sBA/BH,mBAIuD,UAAA,MAAA,WAHxB,kBAAA,QAArB,WAAW,UAAK;yBAD1B,YAIuD,gCAAA;MAFpD,KAAK,OAAO,UAAS;MACrB,aAAa,wBAAwB,WAAW,MAAK;MACrD,OAAO,wBAAwB,WAAW,MAAK;;;IAGlC,yBAAA,SAA4B,WAAA,SAAA,UAAA,KAAA,EAC1C,mBAQM,UAAA,EAAA,KAAA,GAAA,EAAA,WAPyB,iBAAA,QAArB,WAAW,UAAK;yBAD1B,YAQM,gCAAA;MANH,KAAK,OAAO,UAAS;MACrB,aAA0B,wBAAwB,WAAW,oBAAA,QAAsB,MAAK;MAGxF,OAAoB,wBAAwB,WAAW,oBAAA,QAAsB,MAAK;;;IAM7E,yBAAA,SAAA,WAAA,EAAV,mBAUK,MAAA,YAAA,CATH,YAQe,MAAA,aAAA,EAAA;KAPb,OAAM;KACN,SAAQ;KACP,SAAO;;4BAGU,CAFlB,YAEkB,MAAA,eAAA,EAAA;MADf,OAAK,eAAA,EAAA,aAAiB,WAAA,OAAU,CAAA;MACjC,QAAO;6CAAS,MAClB,gBAAG,WAAA,QAAU,gBAAA,kBAAA,EAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"SchemaEnums.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaEnums.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIconPlus } from '@scalar/icons'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, ref } from 'vue'\n\nimport { useLocalization } from '@/features/localization'\n\nimport SchemaEnumPropertyItem from './SchemaEnumPropertyItem.vue'\n\nconst { value } = defineProps<{\n /** The schema object containing enum values and metadata */\n value: SchemaObject | undefined\n /** Whether to display the enum for property names */\n propertyNames?: boolean\n}>()\nconst { translate } = useLocalization()\n\nconst ENUM_DISPLAY_THRESHOLD = 9\nconst INITIAL_VISIBLE_COUNT = 5\nconst THIN_SPACE = '\\u2009'\n\n/**\n * 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":";;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAM,yBAAyB;AAC/B,IAAM,wBAAwB;AAC9B,IAAM,aAAa;;;;;;;;;;;;EAJnB,MAAM,EAAE,cAAc,iBAAgB;EAUtC,MAAM,aAAa,eAAe;AAChC,OAAI,CAAC,QAAA,MACH,QAAO,EAAC;AAEV,UACE,QAAA,MAAM,QACL,cAAc,QAAA,MAAM,IAAI,QAAQ,OAAO,QAAA,MAAM,MAAM,EAAE,QACtD,EAAC;IAEJ;;;;;EAMD,MAAM,2BAA2B,eACzB,WAAW,MAAM,SAAS,uBAClC;EAEA,MAAM,sBAAsB,eAC1B,yBAAyB,QACrB,wBACA,WAAW,MAAM,OACvB;EAEA,MAAM,oBAAoB,eACxB,WAAW,MAAM,MAAM,GAAG,oBAAoB,MAAM,CACtD;EAEA,MAAM,mBAAmB,eACvB,WAAW,MAAM,MAAM,oBAAoB,MAAM,CACnD;;;;;EAMA,MAAM,2BACJ,WACA,UACuB;GACvB,MAAM,eACJ,QAAA,QAAQ,yBAAyB,QAAA,QAAQ;AAE3C,OAAI,CAAC,aACH;AAGF,OAAI,MAAM,QAAQ,aAAa,CAC7B,QAAO,aAAa;AAGtB,OAAI,OAAO,iBAAiB,YAAY,iBAAiB,KACvD,QAAQ,aAAwC,OAAO,UAAU;;;;;;EAUrE,MAAM,2BAA2B,WAAgB,UAA0B;GACzE,MAAM,WAAW,QAAA,QAAQ,sBAAsB,QAAA,QAAQ;GACvD,MAAM,UAAU,MAAM,QAAQ,SAAS,GAAG,SAAS,SAAS,KAAA;AAC5D,UAAO,UACH,GAAG,YAAY,WAAW,GAAG,aAAa,YAC1C,OAAO,UAAS;;;;;EAMtB,MAAM,aAAa,IAAI,MAAK;EAE5B,MAAM,uBAAuB;AAC3B,cAAW,QAAQ,CAAC,WAAW;;;UAMvB,WAAA,MAAW,SAAM,KAAA,WAAA,EADzB,mBAmDM,OAnDN,YAmDM,CA/CI,QAAA,iBAAA,WAAA,EADR,mBAIM,OAJN,YAIM,gBADD,MAAA,UAAS,CAAA,uBAAA,CAAA,EAAA,EAAA,KAAA,WAAA,EAEd,mBAIM,OAJN,YAIM,gBADD,MAAA,UAAS,CAAA,gBAAA,CAAA,EAAA,EAAA,GAEd,mBAqCK,MArCL,YAqCK;sBAnCH,mBAIuD,UAAA,MAAA,WAHxB,kBAAA,QAArB,WAAW,UAAK;yBAD1B,YAIuD,gCAAA;MAFpD,KAAK,OAAO,UAAS;MACrB,aAAa,wBAAwB,WAAW,MAAK;MACrD,OAAO,wBAAwB,WAAW,MAAK;;;IAGlC,yBAAA,SAA4B,WAAA,SAAA,UAAA,KAAA,EAC1C,mBAQM,UAAA,EAAA,KAAA,GAAA,EAAA,WAPyB,iBAAA,QAArB,WAAW,UAAK;yBAD1B,YAQM,gCAAA;MANH,KAAK,OAAO,UAAS;MACrB,aAA0B,wBAAwB,WAAW,oBAAA,QAAsB,MAAK;MAGxF,OAAoB,wBAAwB,WAAW,oBAAA,QAAsB,MAAK;;;IAM7E,yBAAA,SAAA,WAAA,EAAV,mBAcK,MAAA,YAAA,CAbH,YAYe,MAAA,aAAA,EAAA;KAXb,OAAM;KACN,SAAQ;KACP,SAAO;;4BAGU,CAFlB,YAEkB,MAAA,eAAA,EAAA;MADf,OAAK,eAAA,EAAA,aAAiB,WAAA,OAAU,CAAA;MACjC,QAAO;6CAAS,MAClB,gBACE,WAAA,QAA2B,MAAA,UAAS,CAAA,oBAAA,GAAsC,MAAA,UAAS,CAAA,uBAAA,CAAA,EAAA,EAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"names":[],"mappings":"AA6EA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,YAAY,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;AA4FF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SchemaHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"names":[],"mappings":"AA+EA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAOhG,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,YAAY,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;AA8FF,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 SchemaHeading_vue_vue_type_script_setup_true_lang_default from "./SchemaHeading.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/components/Content/Schema/SchemaHeading.vue
5
- var SchemaHeading_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SchemaHeading_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-78e7c684"]]);
5
+ var SchemaHeading_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SchemaHeading_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-e2018ca6"]]);
6
6
  //#endregion
7
7
  export { SchemaHeading_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaHeading.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\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 } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\n\nconst { value } = defineProps<{\n value: SchemaObject\n name?: string\n}>()\n\n/** Generate a failsafe type from the properties when we don't have one */\nconst failsafeType = computed(() => {\n if ('type' in value) {\n return value.type\n }\n\n if (value.enum) {\n return 'enum'\n }\n\n if (isArraySchema(value) && value.items) {\n return 'array'\n }\n\n if (isTypeObject(value) && (value.properties || value.additionalProperties)) {\n return 'object'\n }\n\n return 'unknown'\n})\n</script>\n\n<template>\n <span\n v-if=\"typeof value === 'object'\"\n class=\"schema-type\">\n <span\n class=\"schema-type-icon\"\n :title=\"\n 'type' in value && typeof value.type === 'string'\n ? value.type\n : 'type' in value && Array.isArray(value.type)\n ? value.type.join(' | ')\n : 'unknown type'\n \">\n <template v-if=\"isTypeObject(value)\"> {} </template>\n <template v-if=\"isArraySchema(value)\"> [] </template>\n <template v-if=\"value.enum\"> enum </template>\n </span>\n <template v-if=\"name\">\n <ScalarWrappingText\n :text=\"name\"\n preset=\"property\" />\n </template>\n <template v-else>\n {{ failsafeType }}\n </template>\n </span>\n</template>\n<style scoped>\n/* Style the \"icon\" */\n.schema-type-icon {\n color: var(--scalar-color-1);\n display: none;\n}\n.schema-type {\n font-family: var(--scalar-font-code);\n color: var(--scalar-color-1);\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"SchemaHeading.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\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 } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { useLocalization } from '@/features/localization'\n\nconst { value } = defineProps<{\n value: SchemaObject\n name?: string\n}>()\nconst { translate } = useLocalization()\n\n/** Generate a failsafe type from the properties when we don't have one */\nconst failsafeType = computed(() => {\n if ('type' in value) {\n return value.type\n }\n\n if (value.enum) {\n return 'enum'\n }\n\n if (isArraySchema(value) && value.items) {\n return 'array'\n }\n\n if (isTypeObject(value) && (value.properties || value.additionalProperties)) {\n return 'object'\n }\n\n return 'unknown'\n})\n</script>\n\n<template>\n <span\n v-if=\"typeof value === 'object'\"\n class=\"schema-type\">\n <span\n class=\"schema-type-icon\"\n :title=\"\n 'type' in value && typeof value.type === 'string'\n ? value.type\n : 'type' in value && Array.isArray(value.type)\n ? value.type.join(' | ')\n : translate('schema.unknownType')\n \">\n <template v-if=\"isTypeObject(value)\"> {} </template>\n <template v-if=\"isArraySchema(value)\"> [] </template>\n <template v-if=\"value.enum\"> enum </template>\n </span>\n <template v-if=\"name\">\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </template>\n <template v-else>\n {{ failsafeType }}\n </template>\n </span>\n</template>\n<style scoped>\n/* Style the \"icon\" */\n.schema-type-icon {\n color: var(--scalar-color-1);\n display: none;\n}\n.schema-type {\n font-family: var(--scalar-font-code);\n color: var(--scalar-color-1);\n}\n</style>\n"],"mappings":""}
@@ -1,7 +1,8 @@
1
+ import { useLocalization } from "../../../features/localization/use-localization.js";
1
2
  import { isTypeObject } from "./helpers/is-type-object.js";
2
3
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, openBlock, toDisplayString, unref } from "vue";
3
- import { ScalarWrappingText } from "@scalar/components/wrapping-text";
4
4
  import { isArraySchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
5
+ import { ScalarWrappingText } from "@scalar/components/wrapping-text";
5
6
  //#region src/components/Content/Schema/SchemaHeading.vue?vue&type=script&setup=true&lang.ts
6
7
  var _hoisted_1 = {
7
8
  key: 0,
@@ -15,6 +16,7 @@ var SchemaHeading_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
15
16
  name: {}
16
17
  },
17
18
  setup(__props) {
19
+ const { translate } = useLocalization();
18
20
  /** Generate a failsafe type from the properties when we don't have one */
19
21
  const failsafeType = computed(() => {
20
22
  if ("type" in __props.value) return __props.value.type;
@@ -26,15 +28,15 @@ var SchemaHeading_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
26
28
  return (_ctx, _cache) => {
27
29
  return typeof __props.value === "object" ? (openBlock(), createElementBlock("span", _hoisted_1, [createElementVNode("span", {
28
30
  class: "schema-type-icon",
29
- title: "type" in __props.value && typeof __props.value.type === "string" ? __props.value.type : "type" in __props.value && Array.isArray(__props.value.type) ? __props.value.type.join(" | ") : "unknown type"
31
+ title: "type" in __props.value && typeof __props.value.type === "string" ? __props.value.type : "type" in __props.value && Array.isArray(__props.value.type) ? __props.value.type.join(" | ") : unref(translate)("schema.unknownType")
30
32
  }, [
31
33
  unref(isTypeObject)(__props.value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" {} ")], 64)) : createCommentVNode("", true),
32
34
  unref(isArraySchema)(__props.value) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(" [] ")], 64)) : createCommentVNode("", true),
33
35
  __props.value.enum ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(" enum ")], 64)) : createCommentVNode("", true)
34
36
  ], 8, _hoisted_2), __props.name ? (openBlock(), createBlock(unref(ScalarWrappingText), {
35
37
  key: 0,
36
- text: __props.name,
37
- preset: "property"
38
+ preset: "property",
39
+ text: __props.name
38
40
  }, null, 8, ["text"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(failsafeType.value), 1)], 64))])) : createCommentVNode("", true);
39
41
  };
40
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaHeading.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\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 } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\n\nconst { value } = defineProps<{\n value: SchemaObject\n name?: string\n}>()\n\n/** Generate a failsafe type from the properties when we don't have one */\nconst failsafeType = computed(() => {\n if ('type' in value) {\n return value.type\n }\n\n if (value.enum) {\n return 'enum'\n }\n\n if (isArraySchema(value) && value.items) {\n return 'array'\n }\n\n if (isTypeObject(value) && (value.properties || value.additionalProperties)) {\n return 'object'\n }\n\n return 'unknown'\n})\n</script>\n\n<template>\n <span\n v-if=\"typeof value === 'object'\"\n class=\"schema-type\">\n <span\n class=\"schema-type-icon\"\n :title=\"\n 'type' in value && typeof value.type === 'string'\n ? value.type\n : 'type' in value && Array.isArray(value.type)\n ? value.type.join(' | ')\n : 'unknown type'\n \">\n <template v-if=\"isTypeObject(value)\"> {} </template>\n <template v-if=\"isArraySchema(value)\"> [] </template>\n <template v-if=\"value.enum\"> enum </template>\n </span>\n <template v-if=\"name\">\n <ScalarWrappingText\n :text=\"name\"\n preset=\"property\" />\n </template>\n <template v-else>\n {{ failsafeType }}\n </template>\n </span>\n</template>\n<style scoped>\n/* Style the \"icon\" */\n.schema-type-icon {\n color: var(--scalar-color-1);\n display: none;\n}\n.schema-type {\n font-family: var(--scalar-font-code);\n color: var(--scalar-color-1);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAcA,MAAM,eAAe,eAAe;AAClC,OAAI,UAAU,QAAA,MACZ,QAAO,QAAA,MAAM;AAGf,OAAI,QAAA,MAAM,KACR,QAAO;AAGT,OAAI,cAAc,QAAA,MAAM,IAAI,QAAA,MAAM,MAChC,QAAO;AAGT,OAAI,aAAa,QAAA,MAAM,KAAK,QAAA,MAAM,cAAc,QAAA,MAAM,sBACpD,QAAO;AAGT,UAAO;IACR;;iBAKgB,QAAA,UAAK,YAAA,WAAA,EADpB,mBAwBO,QAxBP,YAwBO,CArBL,mBAYO,QAAA;IAXL,OAAM;IACL,OAAA,UAA0B,QAAA,SAAK,OAAW,QAAA,MAAM,SAAI,WAA0B,QAAA,MAAM,OAAA,UAA2B,QAAA,SAAS,MAAM,QAAQ,QAAA,MAAM,KAAI,GAAgB,QAAA,MAAM,KAAK,KAAI,MAAA,GAAA;;IAOhK,MAAA,aAAY,CAAC,QAAA,MAAK,IAAA,WAAA,EAAlC,mBAAoD,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAf,OAAI,CAAA,EAAA,GAAA,IAAA,mBAAA,IAAA,KAAA;IACzB,MAAA,cAAa,CAAC,QAAA,MAAK,IAAA,WAAA,EAAnC,mBAAqD,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAf,OAAI,CAAA,EAAA,GAAA,IAAA,mBAAA,IAAA,KAAA;IAC1B,QAAA,MAAM,QAAA,WAAA,EAAtB,mBAA6C,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAjB,SAAM,CAAA,EAAA,GAAA,IAAA,mBAAA,IAAA,KAAA;sBAEpB,QAAA,QAAA,WAAA,EACd,YAEsB,MAAA,mBAAA,EAAA;;IADnB,MAAM,QAAA;IACP,QAAO;0CAEX,mBAEW,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAA,gBADN,aAAA,MAAY,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
1
+ {"version":3,"file":"SchemaHeading.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\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 } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { useLocalization } from '@/features/localization'\n\nconst { value } = defineProps<{\n value: SchemaObject\n name?: string\n}>()\nconst { translate } = useLocalization()\n\n/** Generate a failsafe type from the properties when we don't have one */\nconst failsafeType = computed(() => {\n if ('type' in value) {\n return value.type\n }\n\n if (value.enum) {\n return 'enum'\n }\n\n if (isArraySchema(value) && value.items) {\n return 'array'\n }\n\n if (isTypeObject(value) && (value.properties || value.additionalProperties)) {\n return 'object'\n }\n\n return 'unknown'\n})\n</script>\n\n<template>\n <span\n v-if=\"typeof value === 'object'\"\n class=\"schema-type\">\n <span\n class=\"schema-type-icon\"\n :title=\"\n 'type' in value && typeof value.type === 'string'\n ? value.type\n : 'type' in value && Array.isArray(value.type)\n ? value.type.join(' | ')\n : translate('schema.unknownType')\n \">\n <template v-if=\"isTypeObject(value)\"> {} </template>\n <template v-if=\"isArraySchema(value)\"> [] </template>\n <template v-if=\"value.enum\"> enum </template>\n </span>\n <template v-if=\"name\">\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </template>\n <template v-else>\n {{ failsafeType }}\n </template>\n </span>\n</template>\n<style scoped>\n/* Style the \"icon\" */\n.schema-type-icon {\n color: var(--scalar-color-1);\n display: none;\n}\n.schema-type {\n font-family: var(--scalar-font-code);\n color: var(--scalar-color-1);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAaA,MAAM,EAAE,cAAc,iBAAgB;;EAGtC,MAAM,eAAe,eAAe;AAClC,OAAI,UAAU,QAAA,MACZ,QAAO,QAAA,MAAM;AAGf,OAAI,QAAA,MAAM,KACR,QAAO;AAGT,OAAI,cAAc,QAAA,MAAM,IAAI,QAAA,MAAM,MAChC,QAAO;AAGT,OAAI,aAAa,QAAA,MAAM,KAAK,QAAA,MAAM,cAAc,QAAA,MAAM,sBACpD,QAAO;AAGT,UAAO;IACR;;iBAKgB,QAAA,UAAK,YAAA,WAAA,EADpB,mBAwBO,QAxBP,YAwBO,CArBL,mBAYO,QAAA;IAXL,OAAM;IACL,OAAA,UAA0B,QAAA,SAAK,OAAW,QAAA,MAAM,SAAI,WAA0B,QAAA,MAAM,OAAA,UAA2B,QAAA,SAAS,MAAM,QAAQ,QAAA,MAAM,KAAI,GAAgB,QAAA,MAAM,KAAK,KAAI,MAAA,GAAsB,MAAA,UAAS,CAAA,qBAAA;;IAO/L,MAAA,aAAY,CAAC,QAAA,MAAK,IAAA,WAAA,EAAlC,mBAAoD,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAf,OAAI,CAAA,EAAA,GAAA,IAAA,mBAAA,IAAA,KAAA;IACzB,MAAA,cAAa,CAAC,QAAA,MAAK,IAAA,WAAA,EAAnC,mBAAqD,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAf,OAAI,CAAA,EAAA,GAAA,IAAA,mBAAA,IAAA,KAAA;IAC1B,QAAA,MAAM,QAAA,WAAA,EAAtB,mBAA6C,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAjB,SAAM,CAAA,EAAA,GAAA,IAAA,mBAAA,IAAA,KAAA;sBAEpB,QAAA,QAAA,WAAA,EACd,YAEiB,MAAA,mBAAA,EAAA;;IADf,QAAO;IACN,MAAM,QAAA;0CAEX,mBAEW,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAA,gBADN,aAAA,MAAY,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaObjectExampleCodeBlock.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectExampleCodeBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ExamplePicker } from '@scalar/api-client/blocks/operation-code-sample'\nimport {\n ScalarCard,\n ScalarCardFooter,\n ScalarCardSection,\n} from '@scalar/components/card'\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref } from 'vue'\n\nconst { schema } = defineProps<{ schema: SchemaObject }>()\n\n/** Grab the examples for the schema object */\nconst examples = computed<Record<string, string>>(() => {\n const base: Record<string, string> = {}\n\n // x-examples extension\n if (schema['x-examples']) {\n Object.entries(schema['x-examples']).forEach(([key, value]) => {\n base[key] =\n typeof value === 'object'\n ? JSON.stringify(value, null, 2)\n : String(value)\n })\n }\n\n // Regular schema examples array\n if (schema.examples) {\n schema.examples.forEach((value, index) => {\n base[`Example ${index + 1}`] =\n typeof value === 'object'\n ? JSON.stringify(value, null, 2)\n : String(value)\n })\n }\n\n return base\n})\n\n/** The currently selected example key */\nconst selectedExampleKey = ref<string>(Object.keys(examples.value)[0] ?? '')\n</script>\n<template>\n <ScalarCard\n v-if=\"Object.keys(examples).length > 0\"\n class=\"dark-mode\">\n <!-- Code snippet -->\n <ScalarCardSection>\n <div class=\"code-snippet\">\n <ScalarCodeBlock\n class=\"bg-b-2\"\n lang=\"json\"\n lineNumbers\n :prettyPrintedContent=\"\n examples[selectedExampleKey] ??\n 'There was an error loading the example'\n \" />\n </div>\n </ScalarCardSection>\n\n <!-- Example picker -->\n <ScalarCardFooter\n v-if=\"Object.keys(examples).length > 1\"\n class=\"bg-b-3\">\n <ExamplePicker\n v-model=\"selectedExampleKey\"\n :examples />\n </ScalarCardFooter>\n </ScalarCard>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SchemaObjectExampleCodeBlock.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectExampleCodeBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ExamplePicker } from '@scalar/blocks/code-example'\nimport {\n ScalarCard,\n ScalarCardFooter,\n ScalarCardSection,\n} from '@scalar/components/card'\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref } from 'vue'\n\nconst { schema } = defineProps<{ schema: SchemaObject }>()\n\n/** Grab the examples for the schema object */\nconst examples = computed<Record<string, string>>(() => {\n const base: Record<string, string> = {}\n\n // x-examples extension\n if (schema['x-examples']) {\n Object.entries(schema['x-examples']).forEach(([key, value]) => {\n base[key] =\n typeof value === 'object'\n ? JSON.stringify(value, null, 2)\n : String(value)\n })\n }\n\n // Regular schema examples array\n if (schema.examples) {\n schema.examples.forEach((value, index) => {\n base[`Example ${index + 1}`] =\n typeof value === 'object'\n ? JSON.stringify(value, null, 2)\n : String(value)\n })\n }\n\n return base\n})\n\n/** The currently selected example key */\nconst selectedExampleKey = ref<string>(Object.keys(examples.value)[0] ?? '')\n</script>\n<template>\n <ScalarCard\n v-if=\"Object.keys(examples).length > 0\"\n class=\"dark-mode\">\n <!-- Code snippet -->\n <ScalarCardSection>\n <div class=\"code-snippet\">\n <ScalarCodeBlock\n class=\"bg-b-2\"\n lang=\"json\"\n lineNumbers\n :prettyPrintedContent=\"\n examples[selectedExampleKey] ??\n 'There was an error loading the example'\n \" />\n </div>\n </ScalarCardSection>\n\n <!-- Example picker -->\n <ScalarCardFooter\n v-if=\"Object.keys(examples).length > 1\"\n class=\"bg-b-3\">\n <ExamplePicker\n v-model=\"selectedExampleKey\"\n :examples />\n </ScalarCardFooter>\n </ScalarCard>\n</template>\n"],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { computed, createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, openBlock, ref, unref, withCtx } from "vue";
2
- import { ExamplePicker } from "@scalar/api-client/blocks/operation-code-sample";
2
+ import { ExamplePicker } from "@scalar/blocks/code-example";
3
3
  import { ScalarCard, ScalarCardFooter, ScalarCardSection } from "@scalar/components/card";
4
4
  import { ScalarCodeBlock } from "@scalar/components/code-block";
5
5
  //#region src/components/Content/Schema/SchemaObjectExampleCodeBlock.vue?vue&type=script&setup=true&lang.ts
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaObjectExampleCodeBlock.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectExampleCodeBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ExamplePicker } from '@scalar/api-client/blocks/operation-code-sample'\nimport {\n ScalarCard,\n ScalarCardFooter,\n ScalarCardSection,\n} from '@scalar/components/card'\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref } from 'vue'\n\nconst { schema } = defineProps<{ schema: SchemaObject }>()\n\n/** Grab the examples for the schema object */\nconst examples = computed<Record<string, string>>(() => {\n const base: Record<string, string> = {}\n\n // x-examples extension\n if (schema['x-examples']) {\n Object.entries(schema['x-examples']).forEach(([key, value]) => {\n base[key] =\n typeof value === 'object'\n ? JSON.stringify(value, null, 2)\n : String(value)\n })\n }\n\n // Regular schema examples array\n if (schema.examples) {\n schema.examples.forEach((value, index) => {\n base[`Example ${index + 1}`] =\n typeof value === 'object'\n ? JSON.stringify(value, null, 2)\n : String(value)\n })\n }\n\n return base\n})\n\n/** The currently selected example key */\nconst selectedExampleKey = ref<string>(Object.keys(examples.value)[0] ?? '')\n</script>\n<template>\n <ScalarCard\n v-if=\"Object.keys(examples).length > 0\"\n class=\"dark-mode\">\n <!-- Code snippet -->\n <ScalarCardSection>\n <div class=\"code-snippet\">\n <ScalarCodeBlock\n class=\"bg-b-2\"\n lang=\"json\"\n lineNumbers\n :prettyPrintedContent=\"\n examples[selectedExampleKey] ??\n 'There was an error loading the example'\n \" />\n </div>\n </ScalarCardSection>\n\n <!-- Example picker -->\n <ScalarCardFooter\n v-if=\"Object.keys(examples).length > 1\"\n class=\"bg-b-3\">\n <ExamplePicker\n v-model=\"selectedExampleKey\"\n :examples />\n </ScalarCardFooter>\n </ScalarCard>\n</template>\n"],"mappings":";;;;;;;;;;;EAcA,MAAM,WAAW,eAAuC;GACtD,MAAM,OAA+B,EAAC;AAGtC,OAAI,QAAA,OAAO,cACT,QAAO,QAAQ,QAAA,OAAO,cAAc,CAAC,SAAS,CAAC,KAAK,WAAW;AAC7D,SAAK,OACH,OAAO,UAAU,WACb,KAAK,UAAU,OAAO,MAAM,EAAC,GAC7B,OAAO,MAAK;KACnB;AAIH,OAAI,QAAA,OAAO,SACT,SAAA,OAAO,SAAS,SAAS,OAAO,UAAU;AACxC,SAAK,WAAW,QAAQ,OACtB,OAAO,UAAU,WACb,KAAK,UAAU,OAAO,MAAM,EAAC,GAC7B,OAAO,MAAK;KACnB;AAGH,UAAO;IACR;;EAGD,MAAM,qBAAqB,IAAY,OAAO,KAAK,SAAS,MAAM,CAAC,MAAM,GAAE;;UAIjE,OAAO,KAAK,SAAA,MAAQ,CAAE,SAAM,KAAA,WAAA,EADpC,YAyBa,MAAA,WAAA,EAAA;;IAvBX,OAAM;;2BAac,CAXpB,YAWoB,MAAA,kBAAA,EAAA,MAAA;4BADZ,CATN,mBASM,OATN,YASM,CARJ,YAOM,MAAA,gBAAA,EAAA;MANJ,OAAM;MACN,MAAK;MACL,aAAA;MACC,sBAAmC,SAAA,MAAS,mBAAA,UAAA;;;QAS3C,OAAO,KAAK,SAAA,MAAQ,CAAE,SAAM,KAAA,WAAA,EADpC,YAMmB,MAAA,iBAAA,EAAA;;KAJjB,OAAM;;4BAGQ,CAFd,YAEc,MAAA,cAAA,EAAA;kBADH,mBAAA;sFAAkB,QAAA;MAC1B,UAAA,SAAA"}
1
+ {"version":3,"file":"SchemaObjectExampleCodeBlock.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectExampleCodeBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ExamplePicker } from '@scalar/blocks/code-example'\nimport {\n ScalarCard,\n ScalarCardFooter,\n ScalarCardSection,\n} from '@scalar/components/card'\nimport { ScalarCodeBlock } from '@scalar/components/code-block'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref } from 'vue'\n\nconst { schema } = defineProps<{ schema: SchemaObject }>()\n\n/** Grab the examples for the schema object */\nconst examples = computed<Record<string, string>>(() => {\n const base: Record<string, string> = {}\n\n // x-examples extension\n if (schema['x-examples']) {\n Object.entries(schema['x-examples']).forEach(([key, value]) => {\n base[key] =\n typeof value === 'object'\n ? JSON.stringify(value, null, 2)\n : String(value)\n })\n }\n\n // Regular schema examples array\n if (schema.examples) {\n schema.examples.forEach((value, index) => {\n base[`Example ${index + 1}`] =\n typeof value === 'object'\n ? JSON.stringify(value, null, 2)\n : String(value)\n })\n }\n\n return base\n})\n\n/** The currently selected example key */\nconst selectedExampleKey = ref<string>(Object.keys(examples.value)[0] ?? '')\n</script>\n<template>\n <ScalarCard\n v-if=\"Object.keys(examples).length > 0\"\n class=\"dark-mode\">\n <!-- Code snippet -->\n <ScalarCardSection>\n <div class=\"code-snippet\">\n <ScalarCodeBlock\n class=\"bg-b-2\"\n lang=\"json\"\n lineNumbers\n :prettyPrintedContent=\"\n examples[selectedExampleKey] ??\n 'There was an error loading the example'\n \" />\n </div>\n </ScalarCardSection>\n\n <!-- Example picker -->\n <ScalarCardFooter\n v-if=\"Object.keys(examples).length > 1\"\n class=\"bg-b-3\">\n <ExamplePicker\n v-model=\"selectedExampleKey\"\n :examples />\n </ScalarCardFooter>\n </ScalarCard>\n</template>\n"],"mappings":";;;;;;;;;;;EAcA,MAAM,WAAW,eAAuC;GACtD,MAAM,OAA+B,EAAC;AAGtC,OAAI,QAAA,OAAO,cACT,QAAO,QAAQ,QAAA,OAAO,cAAc,CAAC,SAAS,CAAC,KAAK,WAAW;AAC7D,SAAK,OACH,OAAO,UAAU,WACb,KAAK,UAAU,OAAO,MAAM,EAAC,GAC7B,OAAO,MAAK;KACnB;AAIH,OAAI,QAAA,OAAO,SACT,SAAA,OAAO,SAAS,SAAS,OAAO,UAAU;AACxC,SAAK,WAAW,QAAQ,OACtB,OAAO,UAAU,WACb,KAAK,UAAU,OAAO,MAAM,EAAC,GAC7B,OAAO,MAAK;KACnB;AAGH,UAAO;IACR;;EAGD,MAAM,qBAAqB,IAAY,OAAO,KAAK,SAAS,MAAM,CAAC,MAAM,GAAE;;UAIjE,OAAO,KAAK,SAAA,MAAQ,CAAE,SAAM,KAAA,WAAA,EADpC,YAyBa,MAAA,WAAA,EAAA;;IAvBX,OAAM;;2BAac,CAXpB,YAWoB,MAAA,kBAAA,EAAA,MAAA;4BADZ,CATN,mBASM,OATN,YASM,CARJ,YAOM,MAAA,gBAAA,EAAA;MANJ,OAAM;MACN,MAAK;MACL,aAAA;MACC,sBAAmC,SAAA,MAAS,mBAAA,UAAA;;;QAS3C,OAAO,KAAK,SAAA,MAAQ,CAAE,SAAM,KAAA,WAAA,EADpC,YAMmB,MAAA,iBAAA,EAAA;;KAJjB,OAAM;;4BAGQ,CAFd,YAEc,MAAA,cAAA,EAAA;kBADH,mBAAA;sFAAkB,QAAA;MAC1B,UAAA,SAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AAgQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EAEb,MAAM,8DAA8D,CAAA;AAMrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAItE,KAAK,WAAW,GAAG;IACf,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,CAAC;AAqUJ,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AA8QA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EAEb,MAAM,8DAA8D,CAAA;AAMrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAA;AAItE,KAAK,WAAW,GAAG;IACf,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,CAAC;AAqVJ,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaObjectProperties.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { getCycleKey } from '@/components/Content/Schema/helpers/schema-cycle'\nimport { sortPropertyNames } from '@/components/Content/Schema/helpers/sort-property-names'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\n\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst { schema, discriminator, options, schemaContext, compositionPath } =\n defineProps<{\n schema: SchemaObject\n discriminator?: DiscriminatorObject\n compact?: boolean\n hideHeading?: boolean\n level?: number\n hideModelNames?: boolean\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n schemaContext?: string\n compositionPath?: string[]\n }>()\n\n/**\n * Sorts properties by required status first, then alphabetically.\n * Required properties appear first, followed by optional properties.\n */\nconst sortedProperties = computed(() =>\n sortPropertyNames(schema, discriminator, options),\n)\n\n/**\n * Get the display name for additional properties.\n *\n * Checks x-additionalPropertiesName extension first, then falls back to the\n * propertyNames schema title if available.\n */\nconst getAdditionalPropertiesName = (\n _additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n) => {\n const additionalProperties =\n typeof _additionalProperties === 'boolean'\n ? _additionalProperties\n : resolve.schema(_additionalProperties)\n\n if (\n typeof additionalProperties === 'object' &&\n typeof additionalProperties['x-additionalPropertiesName'] === 'string' &&\n additionalProperties['x-additionalPropertiesName'].trim().length > 0\n ) {\n return `${additionalProperties['x-additionalPropertiesName'].trim()}`\n }\n\n // Fall back to the propertyNames title when available\n if (_propertyNames) {\n const resolved = resolve.schema(_propertyNames)\n if (resolved?.title) {\n return resolved.title\n }\n }\n\n return 'propertyName'\n}\n\n/**\n * Extract enum values from the propertyNames schema.\n *\n * JSON Schema's propertyNames keyword constrains which keys are valid\n * in an object with additionalProperties. When it contains an enum,\n * these are the allowed key names.\n */\nconst getPropertyNamesEnum = (\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n): string[] | undefined => {\n if (!_propertyNames) {\n return undefined\n }\n\n const resolved = resolve.schema(_propertyNames)\n if (\n resolved &&\n 'enum' in resolved &&\n Array.isArray(resolved.enum) &&\n resolved.enum.length > 0\n ) {\n return resolved.enum as string[]\n }\n\n return undefined\n}\n\n/** Enum values for the property keys, derived from propertyNames if present. */\nconst additionalPropertiesEnum = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return getPropertyNamesEnum(schema.propertyNames)\n})\n\n/**\n * Keep sibling property descriptions separate from the referenced schema.\n *\n * This allows us to render both:\n * - the property-specific description written next to the $ref, and\n * - the referenced schema's own description (for example discriminator parent docs)\n */\nconst getPropertySchema = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): SchemaObject | undefined => {\n if (!property) {\n return undefined\n }\n return resolve.schema(property)\n}\n\nconst getPropertyDescription = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): string | undefined => {\n if (!property) {\n return undefined\n }\n\n return typeof property.description === 'string'\n ? property.description\n : undefined\n}\n\n/**\n * Get the value for additional properties.\n *\n * When additionalProperties is true or an empty object, it should render as { type: 'anything' }.\n * $ref values are resolved before the type check so the referenced schema is rendered correctly.\n */\nconst getAdditionalPropertiesValue = (\n additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n): SchemaObject => {\n // Resolve $ref first so the type check below works on the actual schema\n const resolved =\n typeof additionalProperties === 'boolean'\n ? additionalProperties\n : resolve.schema(additionalProperties)\n\n if (\n resolved === true ||\n (typeof resolved === 'object' && Object.keys(resolved).length === 0) ||\n typeof resolved !== 'object' ||\n !('type' in resolved)\n ) {\n return {\n // @ts-expect-error - ask hans\n type: 'anything',\n ...(typeof resolved === 'object' ? resolved : {}),\n }\n }\n\n return resolved\n}\n</script>\n\n<template>\n <!-- Properties -->\n <template v-if=\"isTypeObject(schema) && schema.properties\">\n <SchemaProperty\n v-for=\"property in sortedProperties\"\n :key=\"property\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"property\"\n :cycleKey=\"getCycleKey(schema.properties[property])\"\n :description=\"getPropertyDescription(schema.properties[property])\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"property\"\n :options=\"options\"\n :required=\"schema.required?.includes(property)\"\n :schema=\"getPropertySchema(schema.properties[property])\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- patternProperties -->\n <template v-if=\"isTypeObject(schema) && schema.patternProperties\">\n <SchemaProperty\n v-for=\"[key, property] in Object.entries(schema.patternProperties)\"\n :key=\"key\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"key\"\n :cycleKey=\"getCycleKey(property)\"\n :description=\"getPropertyDescription(property)\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames=\"hideModelNames\"\n :level\n :name=\"key\"\n :options=\"options\"\n :schema=\"getPropertySchema(property)\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- additionalProperties -->\n <template v-if=\"isTypeObject(schema) && schema.additionalProperties\">\n <SchemaProperty\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n :cycleKey=\"getCycleKey(schema.additionalProperties)\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n noncollapsible\n :options=\"options\"\n :propertyNamesEnum=\"additionalPropertiesEnum\"\n :schema=\"getAdditionalPropertiesValue(schema.additionalProperties)\"\n :schemaContext=\"schemaContext\"\n variant=\"additionalProperties\" />\n </template>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SchemaObjectProperties.vue.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { getCycleKey } from '@/components/Content/Schema/helpers/schema-cycle'\nimport { sortPropertyNames } from '@/components/Content/Schema/helpers/sort-property-names'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\n\nimport SchemaProperty from './SchemaProperty.vue'\n\nconst { schema, discriminator, options, schemaContext, compositionPath } =\n defineProps<{\n schema: SchemaObject\n discriminator?: DiscriminatorObject\n compact?: boolean\n hideHeading?: boolean\n level?: number\n hideModelNames?: boolean\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n schemaContext?: string\n compositionPath?: string[]\n }>()\n\n/**\n * Sorts properties by required status first, then alphabetically.\n * Required properties appear first, followed by optional properties.\n */\nconst sortedProperties = computed(() =>\n sortPropertyNames(schema, discriminator, options),\n)\n\n/**\n * Get the display name for additional properties.\n *\n * Checks x-additionalPropertiesName extension first, then falls back to the\n * propertyNames schema title if available.\n */\nconst getAdditionalPropertiesName = (\n _additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n) => {\n const additionalProperties =\n typeof _additionalProperties === 'boolean'\n ? _additionalProperties\n : resolve.schema(_additionalProperties)\n\n if (\n typeof additionalProperties === 'object' &&\n typeof additionalProperties['x-additionalPropertiesName'] === 'string' &&\n additionalProperties['x-additionalPropertiesName'].trim().length > 0\n ) {\n return `${additionalProperties['x-additionalPropertiesName'].trim()}`\n }\n\n // Fall back to the propertyNames title when available\n if (_propertyNames) {\n const resolved = resolve.schema(_propertyNames)\n if (resolved?.title) {\n return resolved.title\n }\n }\n\n return 'propertyName'\n}\n\n/**\n * Extract enum values from the propertyNames schema.\n *\n * JSON Schema's propertyNames keyword constrains which keys are valid\n * in an object with additionalProperties. When it contains an enum,\n * these are the allowed key names.\n */\nconst getPropertyNamesEnum = (\n _propertyNames?: Extract<SchemaObject, { type: 'object' }>['propertyNames'],\n): string[] | undefined => {\n if (!_propertyNames) {\n return undefined\n }\n\n const resolved = resolve.schema(_propertyNames)\n if (\n resolved &&\n 'enum' in resolved &&\n Array.isArray(resolved.enum) &&\n resolved.enum.length > 0\n ) {\n return resolved.enum as string[]\n }\n\n return undefined\n}\n\n/** Enum values for the property keys, derived from propertyNames if present. */\nconst additionalPropertiesEnum = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return getPropertyNamesEnum(schema.propertyNames)\n})\n\n/**\n * The resolved propertyNames schema for the property keys.\n *\n * Surfaces key constraints such as `format` (for example `uuid`) so they are\n * not lost when rendering a map of additional properties.\n */\nconst additionalPropertiesKeySchema = computed(() => {\n if (!isTypeObject(schema) || !schema.additionalProperties) {\n return undefined\n }\n return schema.propertyNames ? resolve.schema(schema.propertyNames) : undefined\n})\n\n/**\n * Keep sibling property descriptions separate from the referenced schema.\n *\n * This allows us to render both:\n * - the property-specific description written next to the $ref, and\n * - the referenced schema's own description (for example discriminator parent docs)\n */\nconst getPropertySchema = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): SchemaObject | undefined => {\n if (!property) {\n return undefined\n }\n return resolve.schema(property)\n}\n\nconst getPropertyDescription = (\n property: SchemaReferenceType<SchemaObject> | undefined,\n): string | undefined => {\n if (!property) {\n return undefined\n }\n\n return typeof property.description === 'string'\n ? property.description\n : undefined\n}\n\n/**\n * Get the value for additional properties.\n *\n * When additionalProperties is true or an empty object, it should render as { type: 'anything' }.\n * $ref values are resolved before the type check so the referenced schema is rendered correctly.\n */\nconst getAdditionalPropertiesValue = (\n additionalProperties: Extract<\n SchemaObject,\n { type: 'object' }\n >['additionalProperties'],\n): SchemaObject => {\n // Resolve $ref first so the type check below works on the actual schema\n const resolved =\n typeof additionalProperties === 'boolean'\n ? additionalProperties\n : resolve.schema(additionalProperties)\n\n if (\n resolved === true ||\n (typeof resolved === 'object' && Object.keys(resolved).length === 0) ||\n typeof resolved !== 'object' ||\n !('type' in resolved)\n ) {\n return {\n // @ts-expect-error - ask hans\n type: 'anything',\n ...(typeof resolved === 'object' ? resolved : {}),\n }\n }\n\n return resolved\n}\n</script>\n\n<template>\n <!-- Properties -->\n <template v-if=\"isTypeObject(schema) && schema.properties\">\n <SchemaProperty\n v-for=\"property in sortedProperties\"\n :key=\"property\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"property\"\n :cycleKey=\"getCycleKey(schema.properties[property])\"\n :description=\"getPropertyDescription(schema.properties[property])\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"property\"\n :options=\"options\"\n :required=\"schema.required?.includes(property)\"\n :schema=\"getPropertySchema(schema.properties[property])\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- patternProperties -->\n <template v-if=\"isTypeObject(schema) && schema.patternProperties\">\n <SchemaProperty\n v-for=\"[key, property] in Object.entries(schema.patternProperties)\"\n :key=\"key\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"key\"\n :cycleKey=\"getCycleKey(property)\"\n :description=\"getPropertyDescription(property)\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames=\"hideModelNames\"\n :level\n :name=\"key\"\n :options=\"options\"\n :schema=\"getPropertySchema(property)\"\n :schemaContext=\"schemaContext\" />\n </template>\n\n <!-- additionalProperties -->\n <template v-if=\"isTypeObject(schema) && schema.additionalProperties\">\n <SchemaProperty\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :compositionPathSegment=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n :cycleKey=\"getCycleKey(schema.additionalProperties)\"\n :discriminator\n :eventBus=\"eventBus\"\n :hideHeading\n :hideModelNames\n :level\n :name=\"\n getAdditionalPropertiesName(\n schema.additionalProperties,\n schema.propertyNames,\n )\n \"\n noncollapsible\n :options=\"options\"\n :propertyNamesEnum=\"additionalPropertiesEnum\"\n :propertyNamesSchema=\"additionalPropertiesKeySchema\"\n :schema=\"getAdditionalPropertiesValue(schema.additionalProperties)\"\n :schemaContext=\"schemaContext\"\n variant=\"additionalProperties\" />\n </template>\n</template>\n"],"mappings":""}
@@ -59,6 +59,16 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
59
59
  return getPropertyNamesEnum(__props.schema.propertyNames);
60
60
  });
61
61
  /**
62
+ * The resolved propertyNames schema for the property keys.
63
+ *
64
+ * Surfaces key constraints such as `format` (for example `uuid`) so they are
65
+ * not lost when rendering a map of additional properties.
66
+ */
67
+ const additionalPropertiesKeySchema = computed(() => {
68
+ if (!isTypeObject(__props.schema) || !__props.schema.additionalProperties) return;
69
+ return __props.schema.propertyNames ? resolve.schema(__props.schema.propertyNames) : void 0;
70
+ });
71
+ /**
62
72
  * Keep sibling property descriptions separate from the referenced schema.
63
73
  *
64
74
  * This allows us to render both:
@@ -179,6 +189,7 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
179
189
  noncollapsible: "",
180
190
  options: __props.options,
181
191
  propertyNamesEnum: additionalPropertiesEnum.value,
192
+ propertyNamesSchema: additionalPropertiesKeySchema.value,
182
193
  schema: getAdditionalPropertiesValue(__props.schema.additionalProperties),
183
194
  schemaContext: __props.schemaContext,
184
195
  variant: "additionalProperties"
@@ -196,6 +207,7 @@ var SchemaObjectProperties_vue_vue_type_script_setup_true_lang_default = /* @__P
196
207
  "name",
197
208
  "options",
198
209
  "propertyNamesEnum",
210
+ "propertyNamesSchema",
199
211
  "schema",
200
212
  "schemaContext"
201
213
  ])) : createCommentVNode("", true)