@scalar/api-reference 1.58.0 → 1.59.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 (332) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/dist/blocks/index.d.ts +1 -0
  3. package/dist/blocks/index.d.ts.map +1 -1
  4. package/dist/blocks/index.js +2 -1
  5. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.d.ts +24 -0
  6. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.d.ts.map +1 -0
  7. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.js +7 -0
  8. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.js.map +1 -0
  9. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.script.js +80 -0
  10. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.script.js.map +1 -0
  11. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.d.ts +25 -0
  12. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.d.ts.map +1 -0
  13. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.js +7 -0
  14. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.js.map +1 -0
  15. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js +76 -0
  16. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js.map +1 -0
  17. package/dist/blocks/scalar-asyncapi-server-selector-block/index.d.ts +2 -0
  18. package/dist/blocks/scalar-asyncapi-server-selector-block/index.d.ts.map +1 -0
  19. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts +2 -3
  20. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
  21. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
  22. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js.map +1 -1
  23. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js.map +1 -1
  24. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts +2 -6
  25. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts.map +1 -1
  26. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
  27. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js.map +1 -1
  28. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js +26 -36
  29. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js.map +1 -1
  30. package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.d.ts +1 -1
  31. package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.d.ts.map +1 -1
  32. package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js.map +1 -1
  33. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.d.ts +9 -0
  34. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.d.ts.map +1 -0
  35. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.js +9 -0
  36. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.js.map +1 -0
  37. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js +225 -0
  38. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js.map +1 -0
  39. package/dist/blocks/scalar-sdk-installation-instructions/helpers/language-icon.d.ts +4 -0
  40. package/dist/blocks/scalar-sdk-installation-instructions/helpers/language-icon.d.ts.map +1 -0
  41. package/dist/blocks/scalar-sdk-installation-instructions/helpers/language-icon.js +59 -0
  42. package/dist/blocks/scalar-sdk-installation-instructions/helpers/language-icon.js.map +1 -0
  43. package/dist/blocks/scalar-sdk-installation-instructions/helpers/renderable-sdks.d.ts +19 -0
  44. package/dist/blocks/scalar-sdk-installation-instructions/helpers/renderable-sdks.d.ts.map +1 -0
  45. package/dist/blocks/scalar-sdk-installation-instructions/helpers/renderable-sdks.js +19 -0
  46. package/dist/blocks/scalar-sdk-installation-instructions/helpers/renderable-sdks.js.map +1 -0
  47. package/dist/blocks/scalar-sdk-installation-instructions/helpers/visible-tab-count.d.ts +16 -0
  48. package/dist/blocks/scalar-sdk-installation-instructions/helpers/visible-tab-count.d.ts.map +1 -0
  49. package/dist/blocks/scalar-sdk-installation-instructions/helpers/visible-tab-count.js +29 -0
  50. package/dist/blocks/scalar-sdk-installation-instructions/helpers/visible-tab-count.js.map +1 -0
  51. package/dist/blocks/scalar-sdk-installation-instructions/index.d.ts +3 -0
  52. package/dist/blocks/scalar-sdk-installation-instructions/index.d.ts.map +1 -0
  53. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js +1 -1
  54. package/dist/browser/chunks/{AgentScalarChatInterface-DIIVMX31.js → AgentScalarChatInterface-BXB1nZKJ.js} +4 -4
  55. package/dist/browser/chunks/ScalarTextInput.vue-XkIzhvc0.js +27 -0
  56. package/dist/browser/chunks/basic-shape-diamond.svg-BTEOT1FL.js +1 -1
  57. package/dist/browser/chunks/basic-shape-hexagon.svg-BSPzaCgF.js +1 -1
  58. package/dist/browser/chunks/basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js +1 -1
  59. package/dist/browser/chunks/basic-shape-primary-square-rectangle.svg-n2YRykHD.js +1 -1
  60. package/dist/browser/chunks/basic-shape-shield.svg-Bec9cJDA.js +1 -1
  61. package/dist/browser/chunks/browser-67K6wmG9.js +1 -1
  62. package/dist/browser/chunks/computer-device-desktop-monitor.svg-m6j893Hb.js +1 -1
  63. package/dist/browser/chunks/computer-device-desktop.svg-Dk1VVO7k.js +1 -1
  64. package/dist/browser/chunks/computer-device-laptop.svg-BNGVUCYS.js +1 -1
  65. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung-back.svg-CC4UUTFw.js +1 -1
  66. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js +1 -1
  67. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x-back.svg-CLm7sgMM.js +1 -1
  68. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x.svg-Xrttg6_7.js +1 -1
  69. package/dist/browser/chunks/computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js +1 -1
  70. package/dist/browser/chunks/computer-device-mobile-tablet.svg-DCr0XlRc.js +1 -1
  71. package/dist/browser/chunks/computer-device-network-ethernet-cat6.svg-AK9l0iOl.js +1 -1
  72. package/dist/browser/chunks/computer-device-network-lan-www.svg-gUIdFBlE.js +1 -1
  73. package/dist/browser/chunks/computer-device-network-wifi-connection.svg-Be-EMm4e.js +1 -1
  74. package/dist/browser/chunks/computer-device-network-wifi-router.svg-Dc2VzyqK.js +1 -1
  75. package/dist/browser/chunks/ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js +1 -1
  76. package/dist/browser/chunks/image-flash-lightning.svg-EETR_y1q.js +1 -1
  77. package/dist/browser/chunks/image-picture-flower.svg-DN1AYzJU.js +1 -1
  78. package/dist/browser/chunks/interface-alert-exclamation-diamond.svg-C5NozMV_.js +1 -1
  79. package/dist/browser/chunks/interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js +1 -1
  80. package/dist/browser/chunks/interface-alert-information-circle.svg-ckkkt9Mv.js +1 -1
  81. package/dist/browser/chunks/interface-award-crown.svg-pjvn9hY-.js +1 -1
  82. package/dist/browser/chunks/interface-bookmark-tag.svg-r2r-lQq4.js +1 -1
  83. package/dist/browser/chunks/interface-bookmark.svg-BK9HKQBT.js +1 -1
  84. package/dist/browser/chunks/interface-calendar-date-one.svg-DNnF0M1I.js +1 -1
  85. package/dist/browser/chunks/interface-content-book-open-pages.svg-CQj_w9Vp.js +1 -1
  86. package/dist/browser/chunks/interface-content-book-page.svg-DppoeJRe.js +1 -1
  87. package/dist/browser/chunks/interface-content-file.svg-CvcD7OiY.js +1 -1
  88. package/dist/browser/chunks/interface-content-folder.svg-BmtS5I9A.js +1 -1
  89. package/dist/browser/chunks/interface-copy-clipboard.svg-Be6EI50X.js +1 -1
  90. package/dist/browser/chunks/interface-edit-attachment.svg-G5TKzpWX.js +1 -1
  91. package/dist/browser/chunks/interface-edit-binocular.svg-jzL-DvGB.js +1 -1
  92. package/dist/browser/chunks/interface-edit-magic-wand.svg-BOTlymvp.js +1 -1
  93. package/dist/browser/chunks/interface-edit-tool-paint-roller.svg-s9dwryx7.js +1 -1
  94. package/dist/browser/chunks/interface-edit-tool-pencil.svg-C7v0dbB3.js +1 -1
  95. package/dist/browser/chunks/interface-favorite-award.svg-CYHUgUG0.js +1 -1
  96. package/dist/browser/chunks/interface-favorite-flag.svg-C10zlKOb.js +1 -1
  97. package/dist/browser/chunks/interface-favorite-heart.svg-eoduXxlz.js +1 -1
  98. package/dist/browser/chunks/interface-favorite-star.svg-BSmxJetr.js +1 -1
  99. package/dist/browser/chunks/interface-favorite-stars-sparkles.svg-JTFLj3Ls.js +1 -1
  100. package/dist/browser/chunks/interface-hierarchy-flowchart.svg-Cg_Wy0kN.js +1 -1
  101. package/dist/browser/chunks/interface-home-house.svg-DytoGRnv.js +1 -1
  102. package/dist/browser/chunks/interface-hyperlink.svg-CuEfmmQI.js +1 -1
  103. package/dist/browser/chunks/interface-lighting-brightness.svg-DSK0h_Pa.js +1 -1
  104. package/dist/browser/chunks/interface-lock-closed.svg-Cn6TaLYv.js +1 -1
  105. package/dist/browser/chunks/interface-lock-open-unlock.svg-CVkG5-9W.js +1 -1
  106. package/dist/browser/chunks/interface-login-key.svg-y-cwwXjN.js +1 -1
  107. package/dist/browser/chunks/interface-search.svg-S-puVFJB.js +1 -1
  108. package/dist/browser/chunks/interface-setting-cog.svg-CTH4_lLg.js +1 -1
  109. package/dist/browser/chunks/interface-share-megaphone-bullhorn.svg-Pbp39MyC.js +1 -1
  110. package/dist/browser/chunks/interface-share-rocket.svg-BgCsIRZO.js +1 -1
  111. package/dist/browser/chunks/interface-share-satellite.svg-DAMN9d5G.js +1 -1
  112. package/dist/browser/chunks/interface-share-space-ship.svg-Dt-Mejxk.js +1 -1
  113. package/dist/browser/chunks/interface-share.svg-vFYTXSti.js +1 -1
  114. package/dist/browser/chunks/interface-signal-square.svg-DNG4LpAe.js +1 -1
  115. package/dist/browser/chunks/interface-time-clock-circle.svg-Bpz-nLxo.js +1 -1
  116. package/dist/browser/chunks/interface-time-hour-glass.svg-D7agfKsH.js +1 -1
  117. package/dist/browser/chunks/interface-users-multiple.svg-CkPJBBnG.js +1 -1
  118. package/dist/browser/chunks/interface-weather-moon.svg-CaTZFMPO.js +1 -1
  119. package/dist/browser/chunks/mail-chat-bubble-square.svg-DC8RIihp.js +1 -1
  120. package/dist/browser/chunks/mail-send-email-paper-airplane.svg-D8OLs9jz.js +1 -1
  121. package/dist/browser/chunks/mail-send-envelope.svg-CV33h5Sx.js +1 -1
  122. package/dist/browser/chunks/modal-Bp9V4D2s.js +66 -0
  123. package/dist/browser/chunks/{modal-BA6EnLMO.js → modal-CtAiwzwH.js} +2 -2
  124. package/dist/browser/chunks/money-cashier-receipt.svg-CJL8C2gs.js +1 -1
  125. package/dist/browser/chunks/money-currency-dollar-pay.svg-VdBplCTx.js +1 -1
  126. package/dist/browser/chunks/money-graph-arrow-increase.svg-DcRov3zk.js +1 -1
  127. package/dist/browser/chunks/money-graph-bar-chart-increase.svg-Cc7KxjX-.js +1 -1
  128. package/dist/browser/chunks/nature-ecology-leaf.svg-DR3cTZxt.js +1 -1
  129. package/dist/browser/chunks/phone-telephone.svg-DyY0gUlk.js +1 -1
  130. package/dist/browser/chunks/programming-bug.svg-BHLT-Qhp.js +1 -1
  131. package/dist/browser/chunks/programming-cloud.svg-B6YW33ba.js +1 -1
  132. package/dist/browser/chunks/programming-computer-database-server.svg-B6o5Sdn-.js +1 -1
  133. package/dist/browser/chunks/programming-computer-database.svg-Cl7OVtpJ.js +1 -1
  134. package/dist/browser/chunks/programming-module-four-layout.svg-BQrerL1x.js +1 -1
  135. package/dist/browser/chunks/programming-module-three.svg-B2KTQzBM.js +1 -1
  136. package/dist/browser/chunks/programming-module.svg-CiID7kPm.js +1 -1
  137. package/dist/browser/chunks/programming-script-code.svg-D1M5rtkN.js +1 -1
  138. package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +1 -1
  139. package/dist/browser/chunks/shopping-cart.svg-BEegiIR9.js +1 -1
  140. package/dist/browser/chunks/shopping-gift-present.svg-BUHwuLix.js +1 -1
  141. package/dist/browser/chunks/shopping-shipping-box-parcel-package.svg-D6fxWdYx.js +1 -1
  142. package/dist/browser/chunks/tag-new-circle.svg-jsg1bGs0.js +1 -1
  143. package/dist/browser/chunks/travel-map-earth-globe.svg-ClbMiU-f.js +1 -1
  144. package/dist/browser/chunks/vendor-nugWm4eq.js +337 -0
  145. package/dist/browser/standalone.esm.js +19 -18
  146. package/dist/browser/standalone.js +245 -240
  147. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  148. package/dist/components/ApiReference.vue.js +1 -1
  149. package/dist/components/ApiReference.vue.js.map +1 -1
  150. package/dist/components/ApiReference.vue.script.js +19 -3
  151. package/dist/components/ApiReference.vue.script.js.map +1 -1
  152. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts +1 -1
  153. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts.map +1 -1
  154. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.js.map +1 -1
  155. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +4 -2
  156. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -1
  157. package/dist/components/Content/AsyncApi/Channel.vue.d.ts +4 -0
  158. package/dist/components/Content/AsyncApi/Channel.vue.d.ts.map +1 -1
  159. package/dist/components/Content/AsyncApi/Channel.vue.js +1 -1
  160. package/dist/components/Content/AsyncApi/Channel.vue.js.map +1 -1
  161. package/dist/components/Content/AsyncApi/Channel.vue.script.js +43 -3
  162. package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -1
  163. package/dist/components/Content/AsyncApi/helpers/adapt-async-api-parameters.d.ts +14 -0
  164. package/dist/components/Content/AsyncApi/helpers/adapt-async-api-parameters.d.ts.map +1 -0
  165. package/dist/components/Content/AsyncApi/helpers/adapt-async-api-parameters.js +34 -0
  166. package/dist/components/Content/AsyncApi/helpers/adapt-async-api-parameters.js.map +1 -0
  167. package/dist/components/Content/Auth/Auth.vue.d.ts +1 -1
  168. package/dist/components/Content/Auth/Auth.vue.d.ts.map +1 -1
  169. package/dist/components/Content/Auth/Auth.vue.js.map +1 -1
  170. package/dist/components/Content/Auth/Auth.vue.script.js +2 -0
  171. package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -1
  172. package/dist/components/Content/Content.vue.d.ts +3 -3
  173. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  174. package/dist/components/Content/Content.vue.js.map +1 -1
  175. package/dist/components/Content/Content.vue.script.js +50 -6
  176. package/dist/components/Content/Content.vue.script.js.map +1 -1
  177. package/dist/components/Content/Models/Model.vue.d.ts +4 -2
  178. package/dist/components/Content/Models/Model.vue.d.ts.map +1 -1
  179. package/dist/components/Content/Models/Model.vue.js.map +1 -1
  180. package/dist/components/Content/Models/Model.vue.script.js +6 -1
  181. package/dist/components/Content/Models/Model.vue.script.js.map +1 -1
  182. package/dist/components/Content/Models/components/ClassicLayout.vue.d.ts +4 -2
  183. package/dist/components/Content/Models/components/ClassicLayout.vue.d.ts.map +1 -1
  184. package/dist/components/Content/Models/components/ClassicLayout.vue.js +1 -1
  185. package/dist/components/Content/Models/components/ClassicLayout.vue.js.map +1 -1
  186. package/dist/components/Content/Models/components/ClassicLayout.vue.script.js +9 -2
  187. package/dist/components/Content/Models/components/ClassicLayout.vue.script.js.map +1 -1
  188. package/dist/components/Content/Models/components/ModernLayout.vue.d.ts +4 -1
  189. package/dist/components/Content/Models/components/ModernLayout.vue.d.ts.map +1 -1
  190. package/dist/components/Content/Models/components/ModernLayout.vue.js.map +1 -1
  191. package/dist/components/Content/Models/components/ModernLayout.vue.script.js +5 -1
  192. package/dist/components/Content/Models/components/ModernLayout.vue.script.js.map +1 -1
  193. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -1
  194. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  195. package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -1
  196. package/dist/components/Content/Operations/TraversedEntry.vue.script.js +7 -2
  197. package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
  198. package/dist/components/Content/Schema/Schema.vue.d.ts +6 -0
  199. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  200. package/dist/components/Content/Schema/Schema.vue.js +1 -1
  201. package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
  202. package/dist/components/Content/Schema/Schema.vue.script.js +32 -7
  203. package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
  204. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  205. package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
  206. package/dist/components/Content/Schema/SchemaComposition.vue.script.js +16 -3
  207. package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
  208. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js +1 -1
  209. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  210. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -1
  211. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +7 -0
  212. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
  213. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +2 -0
  214. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  215. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  216. package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
  217. package/dist/components/Content/Schema/SchemaProperty.vue.script.js +17 -2
  218. package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
  219. package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts +3 -2
  220. package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts.map +1 -1
  221. package/dist/components/Content/Schema/helpers/get-compositions-to-render.js +26 -1
  222. package/dist/components/Content/Schema/helpers/get-compositions-to-render.js.map +1 -1
  223. package/dist/components/Content/Schema/helpers/schema-cycle.d.ts +31 -0
  224. package/dist/components/Content/Schema/helpers/schema-cycle.d.ts.map +1 -0
  225. package/dist/components/Content/Schema/helpers/schema-cycle.js +39 -0
  226. package/dist/components/Content/Schema/helpers/schema-cycle.js.map +1 -0
  227. package/dist/components/Content/Schema/types.d.ts +10 -0
  228. package/dist/components/Content/Schema/types.d.ts.map +1 -1
  229. package/dist/features/Operation/Operation.vue.d.ts +1 -1
  230. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  231. package/dist/features/Operation/Operation.vue.js.map +1 -1
  232. package/dist/features/Operation/Operation.vue.script.js +4 -0
  233. package/dist/features/Operation/Operation.vue.script.js.map +1 -1
  234. package/dist/features/Operation/components/ContentTypeSelect.vue.script.js +1 -1
  235. package/dist/features/Operation/components/Header.vue.d.ts +4 -1
  236. package/dist/features/Operation/components/Header.vue.d.ts.map +1 -1
  237. package/dist/features/Operation/components/Header.vue.js.map +1 -1
  238. package/dist/features/Operation/components/Header.vue.script.js +6 -2
  239. package/dist/features/Operation/components/Header.vue.script.js.map +1 -1
  240. package/dist/features/Operation/components/Headers.vue.d.ts +4 -1
  241. package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
  242. package/dist/features/Operation/components/Headers.vue.js +1 -1
  243. package/dist/features/Operation/components/Headers.vue.js.map +1 -1
  244. package/dist/features/Operation/components/Headers.vue.script.js +10 -4
  245. package/dist/features/Operation/components/Headers.vue.script.js.map +1 -1
  246. package/dist/features/Operation/components/OperationParameters.vue.d.ts +4 -2
  247. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  248. package/dist/features/Operation/components/OperationParameters.vue.js.map +1 -1
  249. package/dist/features/Operation/components/OperationParameters.vue.script.js +12 -1
  250. package/dist/features/Operation/components/OperationParameters.vue.script.js.map +1 -1
  251. package/dist/features/Operation/components/OperationResponses.vue.d.ts +4 -2
  252. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  253. package/dist/features/Operation/components/OperationResponses.vue.js.map +1 -1
  254. package/dist/features/Operation/components/OperationResponses.vue.script.js +3 -0
  255. package/dist/features/Operation/components/OperationResponses.vue.script.js.map +1 -1
  256. package/dist/features/Operation/components/ParameterList.vue.d.ts +4 -2
  257. package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
  258. package/dist/features/Operation/components/ParameterList.vue.js.map +1 -1
  259. package/dist/features/Operation/components/ParameterList.vue.script.js +3 -0
  260. package/dist/features/Operation/components/ParameterList.vue.script.js.map +1 -1
  261. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +4 -2
  262. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  263. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  264. package/dist/features/Operation/components/ParameterListItem.vue.js.map +1 -1
  265. package/dist/features/Operation/components/ParameterListItem.vue.script.js +8 -1
  266. package/dist/features/Operation/components/ParameterListItem.vue.script.js.map +1 -1
  267. package/dist/features/Operation/components/RequestBody.vue.d.ts +4 -1
  268. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  269. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  270. package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
  271. package/dist/features/Operation/components/RequestBody.vue.script.js +10 -3
  272. package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
  273. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +4 -2
  274. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
  275. package/dist/features/Operation/components/callbacks/Callback.vue.js +1 -1
  276. package/dist/features/Operation/components/callbacks/Callback.vue.js.map +1 -1
  277. package/dist/features/Operation/components/callbacks/Callback.vue.script.js +5 -0
  278. package/dist/features/Operation/components/callbacks/Callback.vue.script.js.map +1 -1
  279. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +4 -2
  280. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
  281. package/dist/features/Operation/components/callbacks/Callbacks.vue.js.map +1 -1
  282. package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js +3 -0
  283. package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js.map +1 -1
  284. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +3 -1
  285. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  286. package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
  287. package/dist/features/Operation/layouts/ClassicLayout.vue.js.map +1 -1
  288. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +8 -1
  289. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -1
  290. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +3 -1
  291. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  292. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  293. package/dist/features/Operation/layouts/ModernLayout.vue.js.map +1 -1
  294. package/dist/features/Operation/layouts/ModernLayout.vue.script.js +170 -176
  295. package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
  296. package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
  297. package/dist/features/Search/components/SearchButton.vue.js.map +1 -1
  298. package/dist/features/Search/components/SearchButton.vue.script.js +13 -1
  299. package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -1
  300. package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
  301. package/dist/features/Search/components/SearchModal.vue.js +1 -1
  302. package/dist/features/Search/components/SearchModal.vue.js.map +1 -1
  303. package/dist/features/Search/components/SearchModal.vue.script.js +2 -3
  304. package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -1
  305. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js +1 -1
  306. package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
  307. package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
  308. package/dist/features/example-responses/ExampleResponse.vue.js.map +1 -1
  309. package/dist/features/example-responses/ExampleResponse.vue.script.js +6 -7
  310. package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
  311. package/dist/features/example-responses/ExampleResponses.vue.script.js +1 -1
  312. package/dist/features/example-responses/ExampleSchema.vue.d.ts.map +1 -1
  313. package/dist/features/example-responses/ExampleSchema.vue.js.map +1 -1
  314. package/dist/features/example-responses/ExampleSchema.vue.script.js +6 -7
  315. package/dist/features/example-responses/ExampleSchema.vue.script.js.map +1 -1
  316. package/dist/features/info-object/Contact.vue.d.ts.map +1 -1
  317. package/dist/features/info-object/Contact.vue.js.map +1 -1
  318. package/dist/features/info-object/Contact.vue.script.js +15 -4
  319. package/dist/features/info-object/Contact.vue.script.js.map +1 -1
  320. package/dist/helpers/load-from-perssistance.d.ts +2 -1
  321. package/dist/helpers/load-from-perssistance.d.ts.map +1 -1
  322. package/dist/helpers/load-from-perssistance.js +4 -3
  323. package/dist/helpers/load-from-perssistance.js.map +1 -1
  324. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  325. package/dist/standalone/lib/html-api.js +60 -2
  326. package/dist/standalone/lib/html-api.js.map +1 -1
  327. package/dist/style.css +557 -374
  328. package/dist/vue-styles.css +547 -357
  329. package/package.json +16 -16
  330. package/dist/browser/chunks/ScalarTextInput.vue-DDsQgpOo.js +0 -27
  331. package/dist/browser/chunks/modal-DW-P3H1k.js +0 -66
  332. package/dist/browser/chunks/vendor-Ad2vN5Ro.js +0 -333
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaProperty.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\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 { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, type Component } from 'vue'\n\nimport { WithBreadcrumb } from '@/components/Anchor'\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport { SpecificationExtension } from '@/features/specification-extension'\n\nimport { getCompositionsToRender } from './helpers/get-compositions-to-render'\nimport { getEnumValues } from './helpers/get-enum-values'\nimport { getPropertyDescription } from './helpers/get-property-description'\nimport { hasComplexArrayItems } from './helpers/has-complex-array-items'\nimport { optimizeValueForDisplay } from './helpers/optimize-value-for-display'\nimport { shouldDisplayDescription } from './helpers/should-display-description'\nimport { shouldDisplayHeading } from './helpers/should-display-heading'\nimport Schema from './Schema.vue'\nimport SchemaComposition from './SchemaComposition.vue'\nimport SchemaEnums from './SchemaEnums.vue'\nimport SchemaPropertyHeading from './SchemaPropertyHeading.vue'\n\n/**\n * Note: We're taking in a prop called `value` which should be a JSON Schema.\n *\n * We're using `optimizeValueForDisplay` to merge null types in compositions (anyOf, allOf, oneOf, not).\n * So you should basically use the optimizedValue everywhere in the component.\n */\n\nconst props = withDefaults(\n defineProps<{\n is?: string | Component\n schema: SchemaObject | undefined\n noncollapsible?: boolean\n level?: number\n name?: string\n required?: boolean\n compact?: boolean\n discriminator?: DiscriminatorObject\n description?: string\n hideModelNames?: boolean\n hideHeading?: boolean\n /** When the root schema was resolved from a $ref, pass the ref name for display (e.g. \"Data\"). */\n modelName?: string | null\n variant?: 'additionalProperties' | 'patternProperties'\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n /** Enum values for property names (from JSON Schema propertyNames keyword). */\n propertyNamesEnum?: string[]\n /** When \"requestBody\", composition selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /** Internal path segment for this property when building nested composition keys */\n compositionPathSegment?: string\n }>(),\n {\n level: 0,\n required: false,\n compact: false,\n hideModelNames: false,\n },\n)\n\n/** Simplified composition with `null` type. */\nconst optimizedValue = computed(() => optimizeValueForDisplay(props.schema))\n\nconst childBreadcrumb = computed<string[] | undefined>(() =>\n props.breadcrumb && props.name\n ? [...props.breadcrumb, props.name]\n : undefined,\n)\n\nconst currentCompositionPath = computed<string[]>(() =>\n props.compositionPathSegment\n ? [...(props.compositionPath ?? []), props.compositionPathSegment]\n : (props.compositionPath ?? []),\n)\n\nconst arrayItemsCompositionPath = computed<string[]>(() => [\n ...currentCompositionPath.value,\n 'items',\n])\n\nconst shouldHaveLink = computed(() => props.level <= 2)\n\n/** Checks if array items have complex structure */\nconst hasComplexArrayItemsComputed = computed(() =>\n hasComplexArrayItems(optimizedValue.value),\n)\n\n/** Check if enum should be displayed (from value schema or from propertyNames) */\nconst hasEnum = computed(() => enumValues.value.length > 0)\n\n/** Determine if object properties should be displayed */\nconst shouldRenderObjectProperties = computed(() => {\n const value = optimizedValue.value\n if (!value) {\n return false\n }\n\n return (\n isTypeObject(value) &&\n ('properties' in value || 'additionalProperties' in value)\n )\n})\n\n/** Determine if array of objects should be rendered */\nconst shouldRenderArrayOfObjects = computed(() => {\n const value = optimizedValue.value\n if (!value || !isArraySchema(value) || typeof value.items !== 'object') {\n return false\n }\n\n return hasComplexArrayItemsComputed.value\n})\n\n/** Extract enum values from schema or array items */\nconst enumValues = computed(() => getEnumValues(optimizedValue.value))\n\n/** Generate property description from type/format */\nconst propertyDescription = computed(() =>\n getPropertyDescription(optimizedValue.value),\n)\n\n/** Determine if description should be displayed */\nconst displayDescription = computed(() =>\n shouldDisplayDescription(optimizedValue.value, props.description),\n)\n\n/**\n * When the property already renders the description, avoid repeating it in the nested object schema card.\n */\nconst objectSchemaForChildren = computed(() => {\n const value = optimizedValue.value\n if (!value || !displayDescription.value || !('description' in value)) {\n return value\n }\n\n const { description: _description, ...schemaWithoutDescription } = value\n return schemaWithoutDescription as SchemaObject\n})\n\n/** Determine if property heading should be displayed */\nconst shouldDisplayHeadingComputed = computed(() =>\n shouldDisplayHeading(optimizedValue.value, props.name, props.required),\n)\n\n/** Computes which compositions should be rendered and with which values */\nconst compositionsToRender = computed(() =>\n getCompositionsToRender(optimizedValue.value),\n)\n\n/** Get resolved array items for rendering */\nconst resolvedArrayItems = computed(() => {\n const value = optimizedValue.value\n if (!value || !isArraySchema(value) || typeof value.items !== 'object') {\n return undefined\n }\n return resolve.schema(value.items)\n})\n\n/** Check if discriminator matches current property */\nconst isDiscriminatorProperty = computed(() =>\n Boolean(props.name && props.discriminator?.propertyName === props.name),\n)\n</script>\n<template>\n <component\n :is=\"is ?? 'li'\"\n class=\"property\"\n :class=\"[\n `property--level-${level}`,\n {\n 'property--compact': compact,\n 'property--deprecated': optimizedValue?.deprecated,\n },\n ]\">\n <SchemaPropertyHeading\n v-if=\"shouldDisplayHeadingComputed\"\n class=\"group\"\n :enum=\"hasEnum\"\n :eventBus=\"eventBus\"\n :hideModelNames\n :isDiscriminator=\"isDiscriminatorProperty\"\n :modelName=\"modelName\"\n :required\n :value=\"optimizedValue\">\n <template\n v-if=\"name\"\n #name>\n <WithBreadcrumb\n :breadcrumb=\"shouldHaveLink ? childBreadcrumb : undefined\"\n :eventBus=\"eventBus\">\n <span\n v-if=\"variant === 'patternProperties'\"\n class=\"property-name-pattern-properties\">\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </span>\n <span\n v-else-if=\"variant === 'additionalProperties'\"\n class=\"property-name-additional-properties\">\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </span>\n <ScalarWrappingText\n v-else\n preset=\"property\"\n :text=\"name\" />\n </WithBreadcrumb>\n </template>\n <template\n v-if=\"optimizedValue?.example !== undefined\"\n #example>\n Example:\n {{ optimizedValue.example }}\n </template>\n </SchemaPropertyHeading>\n\n <!-- Description -->\n <div\n v-if=\"displayDescription || propertyDescription\"\n class=\"property-description\">\n <ScalarMarkdown\n :value=\"displayDescription || propertyDescription || ''\" />\n </div>\n\n <!-- Enum for property names -->\n <SchemaEnums\n v-if=\"propertyNamesEnum && propertyNamesEnum.length > 0\"\n propertyNames\n :value=\"{ enum: propertyNamesEnum } as SchemaObject\" />\n\n <!-- Enum values -->\n <SchemaEnums\n v-if=\"enumValues.length > 0\"\n :value=\"optimizedValue\" />\n\n <!-- Object -->\n <div\n v-if=\"shouldRenderObjectProperties\"\n class=\"children\">\n <Schema\n :breadcrumb=\"childBreadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"currentCompositionPath\"\n :eventBus=\"eventBus\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"noncollapsible\"\n :options=\"options\"\n :schema=\"objectSchemaForChildren\"\n :schemaContext=\"schemaContext\" />\n </div>\n\n <!-- Array of objects or nested arrays -->\n <div\n v-if=\"shouldRenderArrayOfObjects && resolvedArrayItems\"\n class=\"children\">\n <Schema\n :compact=\"compact\"\n :compositionPath=\"arrayItemsCompositionPath\"\n :eventBus=\"eventBus\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"noncollapsible\"\n :options=\"options\"\n :schema=\"resolve.schema(resolvedArrayItems)\"\n :schemaContext=\"schemaContext\" />\n </div>\n\n <!-- Compositions -->\n <SchemaComposition\n v-for=\"compositionData in compositionsToRender\"\n :key=\"compositionData.composition\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :composition=\"compositionData.composition\"\n :compositionPath=\"currentCompositionPath\"\n :discriminator=\"schema?.discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level\"\n :name=\"name\"\n :noncollapsible=\"noncollapsible\"\n :options=\"options\"\n :schema=\"compositionData.value\"\n :schemaContext=\"schemaContext\" />\n <SpecificationExtension :value=\"optimizedValue\" />\n </component>\n</template>\n\n<style scoped>\n.property {\n color: var(--scalar-color-1);\n display: flex;\n flex-direction: column;\n padding: 10px;\n font-size: var(--scalar-small);\n position: relative;\n}\n\n/** Remove top padding for top level schema card */\n.property.property--level-0:has(\n > .property-rule\n > .schema-card\n > .schema-properties.schema-properties-open\n > ul\n > li.property\n ) {\n padding-top: 0;\n}\n\n.property--compact.property--level-0,\n.property--compact.property--level-1 {\n padding: 10px 0;\n}\n\n.composition-panel .property.property.property.property--level-0 {\n padding: 0px;\n}\n\n.property--compact.property--level-0\n .composition-panel\n .property--compact.property--level-1 {\n padding: 8px;\n}\n\n/* if a property doesn't have a heading, remove the top padding */\n.property:has(> .property-rule:nth-of-type(1)):not(.property--compact) {\n padding-top: 8px;\n padding-bottom: 8px;\n}\n\n.property--deprecated {\n background: repeating-linear-gradient(\n -45deg,\n var(--scalar-background-2) 0,\n var(--scalar-background-2) 2px,\n transparent 2px,\n transparent 5px\n );\n background-size: 100%;\n}\n\n.property--deprecated > * {\n opacity: 0.75;\n}\n\n.property-description {\n margin-top: 6px;\n line-height: 1.4;\n font-size: var(--scalar-small);\n}\n\n.property-description:has(+ .property-rule) {\n margin-bottom: 9px;\n}\n\n:deep(.property-description) * {\n color: var(--scalar-color-2) !important;\n}\n\n.property:not(:last-of-type) {\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.property-description + .children,\n.children + .property-rule {\n margin-top: 9px;\n}\n\n.children {\n display: flex;\n flex-direction: column;\n}\n\n.children .property--compact.property--level-1 {\n padding: 12px;\n}\n\n.property-example-value {\n all: unset;\n font-family: var(--scalar-font-code);\n padding: 6px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.property-rule {\n border-radius: var(--scalar-radius-lg);\n display: flex;\n flex-direction: column;\n}\n\n.property--level-2 :deep(.relative > button) {\n left: -2rem;\n}\n\n.property-rule\n :deep(\n .composition-panel\n .schema-card--level-1\n > .schema-properties.schema-properties-open\n ) {\n border-radius: 0 0 var(--scalar-radius-lg) var(--scalar-radius-lg);\n}\n\n.property-rule\n :deep(.composition-panel > .schema-card > .schema-card-description) {\n padding: 10px;\n border-left: var(--scalar-border-width) solid var(--scalar-border-color);\n border-right: var(--scalar-border-width) solid var(--scalar-border-color);\n\n & + .schema-properties {\n margin-top: 0;\n }\n}\n\n.property-example {\n background: transparent;\n border: none;\n display: flex;\n flex-direction: row;\n gap: 8px;\n}\n\n.property-example-label,\n.property-example-value {\n padding: 3px 0 0 0;\n}\n\n.property-example-value {\n background: var(--scalar-background-2);\n border-top: 0;\n border-radius: var(--scalar-radius);\n padding: 3px 4px;\n}\n\n.property-name {\n font-family: var(--scalar-font-code);\n font-weight: var(--scalar-semibold);\n}\n\n.property-name-additional-properties::before,\n.property-name-pattern-properties::before {\n text-transform: uppercase;\n font-size: var(--scalar-micro);\n display: inline-block;\n padding: 2px 4px;\n border-radius: var(--scalar-radius);\n color: var(--scalar-color-1);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n background-color: var(--scalar-background-2);\n margin-right: 4px;\n}\n\n.property-name-pattern-properties::before {\n content: 'regex';\n}\n\n.property-name-additional-properties,\n.property-name-pattern-properties {\n border: 1px dashed var(--scalar-border-color);\n color: var(--scalar-color-accent);\n display: inline-block;\n padding: 2px;\n border-radius: var(--scalar-radius);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCA,MAAM,QAAQ;;EAqCd,MAAM,iBAAiB,eAAe,wBAAwB,MAAM,OAAO,CAAA;EAE3E,M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gBAAA,QAAA;OACA,OAAO,QAAA;OACP,MAAM,QAAA;OACN,gBAAgB,QAAA;OAChB,SAAS,QAAA;OACT,QAAQ,gBAAgB;OACxB,eAAe,QAAA;;;;;;;;;;;;;;;;;;KAClB,YAAkD,MAAA,+BAAA,EAAA,EAAzB,OAAO,eAAA,OAAc,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA"}
1
+ {"version":3,"file":"SchemaProperty.vue.script.js","names":[],"sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\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 { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, type Component } from 'vue'\n\nimport { WithBreadcrumb } from '@/components/Anchor'\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\nimport { getCycleKey } from '@/components/Content/Schema/helpers/schema-cycle'\nimport type { SchemaOptions } from '@/components/Content/Schema/types'\nimport { SpecificationExtension } from '@/features/specification-extension'\n\nimport { getCompositionsToRender } from './helpers/get-compositions-to-render'\nimport { getEnumValues } from './helpers/get-enum-values'\nimport { getPropertyDescription } from './helpers/get-property-description'\nimport { hasComplexArrayItems } from './helpers/has-complex-array-items'\nimport { optimizeValueForDisplay } from './helpers/optimize-value-for-display'\nimport { shouldDisplayDescription } from './helpers/should-display-description'\nimport { shouldDisplayHeading } from './helpers/should-display-heading'\nimport Schema from './Schema.vue'\nimport SchemaComposition from './SchemaComposition.vue'\nimport SchemaEnums from './SchemaEnums.vue'\nimport SchemaPropertyHeading from './SchemaPropertyHeading.vue'\n\n/**\n * Note: We're taking in a prop called `value` which should be a JSON Schema.\n *\n * We're using `optimizeValueForDisplay` to merge null types in compositions (anyOf, allOf, oneOf, not).\n * So you should basically use the optimizedValue everywhere in the component.\n */\n\nconst props = withDefaults(\n defineProps<{\n is?: string | Component\n schema: SchemaObject | undefined\n noncollapsible?: boolean\n level?: number\n name?: string\n required?: boolean\n compact?: boolean\n discriminator?: DiscriminatorObject\n description?: string\n hideModelNames?: boolean\n hideHeading?: boolean\n /** When the root schema was resolved from a $ref, pass the ref name for display (e.g. \"Data\"). */\n modelName?: string | null\n variant?: 'additionalProperties' | 'patternProperties'\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n options: SchemaOptions\n /** Enum values for property names (from JSON Schema propertyNames keyword). */\n propertyNamesEnum?: string[]\n /** When \"requestBody\", composition selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /** Internal path segment for this property when building nested composition keys */\n compositionPathSegment?: string\n /** Stable identity of this property's schema, used for cycle detection. */\n cycleKey?: unknown\n }>(),\n {\n level: 0,\n required: false,\n compact: false,\n hideModelNames: false,\n },\n)\n\n/** Simplified composition with `null` type. */\nconst optimizedValue = computed(() => optimizeValueForDisplay(props.schema))\n\nconst childBreadcrumb = computed<string[] | undefined>(() =>\n props.breadcrumb && props.name\n ? [...props.breadcrumb, props.name]\n : undefined,\n)\n\nconst currentCompositionPath = computed<string[]>(() =>\n props.compositionPathSegment\n ? [...(props.compositionPath ?? []), props.compositionPathSegment]\n : (props.compositionPath ?? []),\n)\n\nconst arrayItemsCompositionPath = computed<string[]>(() => [\n ...currentCompositionPath.value,\n 'items',\n])\n\nconst shouldHaveLink = computed(() => props.level <= 2)\n\n/** Checks if array items have complex structure */\nconst hasComplexArrayItemsComputed = computed(() =>\n hasComplexArrayItems(optimizedValue.value),\n)\n\n/** Check if enum should be displayed (from value schema or from propertyNames) */\nconst hasEnum = computed(() => enumValues.value.length > 0)\n\n/** Determine if object properties should be displayed */\nconst shouldRenderObjectProperties = computed(() => {\n const value = optimizedValue.value\n if (!value) {\n return false\n }\n\n return (\n isTypeObject(value) &&\n ('properties' in value || 'additionalProperties' in value)\n )\n})\n\n/** Determine if array of objects should be rendered */\nconst shouldRenderArrayOfObjects = computed(() => {\n const value = optimizedValue.value\n if (!value || !isArraySchema(value) || typeof value.items !== 'object') {\n return false\n }\n\n return hasComplexArrayItemsComputed.value\n})\n\n/** Extract enum values from schema or array items */\nconst enumValues = computed(() => getEnumValues(optimizedValue.value))\n\n/** Generate property description from type/format */\nconst propertyDescription = computed(() =>\n getPropertyDescription(optimizedValue.value),\n)\n\n/** Determine if description should be displayed */\nconst displayDescription = computed(() =>\n shouldDisplayDescription(optimizedValue.value, props.description),\n)\n\n/**\n * When the property already renders the description, avoid repeating it in the nested object schema card.\n */\nconst objectSchemaForChildren = computed(() => {\n const value = optimizedValue.value\n if (!value || !displayDescription.value || !('description' in value)) {\n return value\n }\n\n const { description: _description, ...schemaWithoutDescription } = value\n return schemaWithoutDescription as SchemaObject\n})\n\n/** Determine if property heading should be displayed */\nconst shouldDisplayHeadingComputed = computed(() =>\n shouldDisplayHeading(optimizedValue.value, props.name, props.required),\n)\n\n/** Computes which compositions should be rendered and with which values */\nconst compositionsToRender = computed(() =>\n getCompositionsToRender(optimizedValue.value, props.options.document),\n)\n\n/** Get resolved array items for rendering */\nconst resolvedArrayItems = computed(() => {\n const value = optimizedValue.value\n if (!value || !isArraySchema(value) || typeof value.items !== 'object') {\n return undefined\n }\n return resolve.schema(value.items)\n})\n\n/**\n * Cycle key for the array items schema, derived from the raw (unresolved) items\n * so a self-referential array element is detected as a cycle.\n */\nconst arrayItemsCycleKey = computed(() => {\n const value = optimizedValue.value\n if (!value || !isArraySchema(value)) {\n return undefined\n }\n return getCycleKey(value.items)\n})\n\n/** Check if discriminator matches current property */\nconst isDiscriminatorProperty = computed(() =>\n Boolean(props.name && props.discriminator?.propertyName === props.name),\n)\n</script>\n<template>\n <component\n :is=\"is ?? 'li'\"\n class=\"property\"\n :class=\"[\n `property--level-${level}`,\n {\n 'property--compact': compact,\n 'property--deprecated': optimizedValue?.deprecated,\n },\n ]\">\n <SchemaPropertyHeading\n v-if=\"shouldDisplayHeadingComputed\"\n class=\"group\"\n :enum=\"hasEnum\"\n :eventBus=\"eventBus\"\n :hideModelNames\n :isDiscriminator=\"isDiscriminatorProperty\"\n :modelName=\"modelName\"\n :required\n :value=\"optimizedValue\">\n <template\n v-if=\"name\"\n #name>\n <WithBreadcrumb\n :breadcrumb=\"shouldHaveLink ? childBreadcrumb : undefined\"\n :eventBus=\"eventBus\">\n <span\n v-if=\"variant === 'patternProperties'\"\n class=\"property-name-pattern-properties\">\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </span>\n <span\n v-else-if=\"variant === 'additionalProperties'\"\n class=\"property-name-additional-properties\">\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </span>\n <ScalarWrappingText\n v-else\n preset=\"property\"\n :text=\"name\" />\n </WithBreadcrumb>\n </template>\n <template\n v-if=\"optimizedValue?.example !== undefined\"\n #example>\n Example:\n {{ optimizedValue.example }}\n </template>\n </SchemaPropertyHeading>\n\n <!-- Description -->\n <div\n v-if=\"displayDescription || propertyDescription\"\n class=\"property-description\">\n <ScalarMarkdown\n :value=\"displayDescription || propertyDescription || ''\" />\n </div>\n\n <!-- Enum for property names -->\n <SchemaEnums\n v-if=\"propertyNamesEnum && propertyNamesEnum.length > 0\"\n propertyNames\n :value=\"{ enum: propertyNamesEnum } as SchemaObject\" />\n\n <!-- Enum values -->\n <SchemaEnums\n v-if=\"enumValues.length > 0\"\n :value=\"optimizedValue\" />\n\n <!-- Object -->\n <div\n v-if=\"shouldRenderObjectProperties\"\n class=\"children\">\n <Schema\n :breadcrumb=\"childBreadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"currentCompositionPath\"\n :cycleKey=\"cycleKey\"\n :eventBus=\"eventBus\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"noncollapsible\"\n :options=\"options\"\n :schema=\"objectSchemaForChildren\"\n :schemaContext=\"schemaContext\" />\n </div>\n\n <!-- Array of objects or nested arrays -->\n <div\n v-if=\"shouldRenderArrayOfObjects && resolvedArrayItems\"\n class=\"children\">\n <Schema\n :compact=\"compact\"\n :compositionPath=\"arrayItemsCompositionPath\"\n :cycleKey=\"arrayItemsCycleKey\"\n :eventBus=\"eventBus\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"noncollapsible\"\n :options=\"options\"\n :schema=\"resolve.schema(resolvedArrayItems)\"\n :schemaContext=\"schemaContext\" />\n </div>\n\n <!-- Compositions -->\n <SchemaComposition\n v-for=\"compositionData in compositionsToRender\"\n :key=\"compositionData.composition\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :composition=\"compositionData.composition\"\n :compositionPath=\"currentCompositionPath\"\n :discriminator=\"schema?.discriminator\"\n :eventBus=\"eventBus\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level\"\n :name=\"name\"\n :noncollapsible=\"noncollapsible\"\n :options=\"options\"\n :schema=\"compositionData.value\"\n :schemaContext=\"schemaContext\" />\n <SpecificationExtension :value=\"optimizedValue\" />\n </component>\n</template>\n\n<style scoped>\n.property {\n color: var(--scalar-color-1);\n display: flex;\n flex-direction: column;\n padding: 10px;\n font-size: var(--scalar-small);\n position: relative;\n}\n\n/** Remove top padding for top level schema card */\n.property.property--level-0:has(\n > .property-rule\n > .schema-card\n > .schema-properties.schema-properties-open\n > ul\n > li.property\n ) {\n padding-top: 0;\n}\n\n.property--compact.property--level-0,\n.property--compact.property--level-1 {\n padding: 10px 0;\n}\n\n.composition-panel .property.property.property.property--level-0 {\n padding: 0px;\n}\n\n.property--compact.property--level-0\n .composition-panel\n .property--compact.property--level-1 {\n padding: 8px;\n}\n\n/* if a property doesn't have a heading, remove the top padding */\n.property:has(> .property-rule:nth-of-type(1)):not(.property--compact) {\n padding-top: 8px;\n padding-bottom: 8px;\n}\n\n.property--deprecated {\n background: repeating-linear-gradient(\n -45deg,\n var(--scalar-background-2) 0,\n var(--scalar-background-2) 2px,\n transparent 2px,\n transparent 5px\n );\n background-size: 100%;\n}\n\n.property--deprecated > * {\n opacity: 0.75;\n}\n\n.property-description {\n margin-top: 6px;\n line-height: 1.4;\n font-size: var(--scalar-small);\n}\n\n.property-description:has(+ .property-rule) {\n margin-bottom: 9px;\n}\n\n:deep(.property-description) * {\n color: var(--scalar-color-2) !important;\n}\n\n.property:not(:last-of-type) {\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.property-description + .children,\n.children + .property-rule {\n margin-top: 9px;\n}\n\n.children {\n display: flex;\n flex-direction: column;\n}\n\n.children .property--compact.property--level-1 {\n padding: 12px;\n}\n\n.property-example-value {\n all: unset;\n font-family: var(--scalar-font-code);\n padding: 6px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.property-rule {\n border-radius: var(--scalar-radius-lg);\n display: flex;\n flex-direction: column;\n}\n\n.property--level-2 :deep(.relative > button) {\n left: -2rem;\n}\n\n.property-rule\n :deep(\n .composition-panel\n .schema-card--level-1\n > .schema-properties.schema-properties-open\n ) {\n border-radius: 0 0 var(--scalar-radius-lg) var(--scalar-radius-lg);\n}\n\n.property-rule\n :deep(.composition-panel > .schema-card > .schema-card-description) {\n padding: 10px;\n border-left: var(--scalar-border-width) solid var(--scalar-border-color);\n border-right: var(--scalar-border-width) solid var(--scalar-border-color);\n\n & + .schema-properties {\n margin-top: 0;\n }\n}\n\n.property-example {\n background: transparent;\n border: none;\n display: flex;\n flex-direction: row;\n gap: 8px;\n}\n\n.property-example-label,\n.property-example-value {\n padding: 3px 0 0 0;\n}\n\n.property-example-value {\n background: var(--scalar-background-2);\n border-top: 0;\n border-radius: var(--scalar-radius);\n padding: 3px 4px;\n}\n\n.property-name {\n font-family: var(--scalar-font-code);\n font-weight: var(--scalar-semibold);\n}\n\n.property-name-additional-properties::before,\n.property-name-pattern-properties::before {\n text-transform: uppercase;\n font-size: var(--scalar-micro);\n display: inline-block;\n padding: 2px 4px;\n border-radius: var(--scalar-radius);\n color: var(--scalar-color-1);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n background-color: var(--scalar-background-2);\n margin-right: 4px;\n}\n\n.property-name-pattern-properties::before {\n content: 'regex';\n}\n\n.property-name-additional-properties,\n.property-name-pattern-properties {\n border: 1px dashed var(--scalar-border-color);\n color: var(--scalar-color-accent);\n display: inline-block;\n padding: 2px;\n border-radius: var(--scalar-radius);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCA,MAAM,QAAQ;;EAuCd,MAAM,iBAAiB,eAAe,wBAAwB,MAAM,OAAO,CAAA;EAE3E,MAAM,kBAAkB,eACtB,MAAM,cAAc,MAAM,OACtB,CAAC,GAAG,MAAM,YAAY,MAAM,KAAI,GAChC,KAAA,EACN;EAEA,MAAM,yBAAyB,eAC7B,MAAM,yBACF,CAAC,GAAI,MAAM,mBAAmB,EAAE,EAAG,MAAM,uBAAsB,GAC9D,MAAM,mBAAmB,EAAE,CAClC;EAEA,MAAM,4BAA4B,eAAyB,CACzD,GAAG,uBAAuB,OAC1B,QACD,CAAA;EAED,MAAM,iBAAiB,eAAe,MAAM,SAAS,EAAC;;EAGtD,MAAM,+BAA+B,eACnC,qBAAqB,eAAe,MAAM,CAC5C;;EAGA,MAAM,UAAU,eAAe,WAAW,MAAM,SAAS,EAAC;;EAG1D,MAAM,+BAA+B,eAAe;GAClD,MAAM,QAAQ,eAAe;AAC7B,OAAI,CAAC,MACH,QAAO;AAGT,UACE,aAAa,MAAM,KAClB,gBAAgB,SAAS,0BAA0B;IAEvD;;EAGD,MAAM,6BAA6B,eAAe;GAChD,MAAM,QAAQ,eAAe;AAC7B,OAAI,CAAC,SAAS,CAAC,cAAc,MAAM,IAAI,OAAO,MAAM,UAAU,SA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AAA,QAAA;MACA,OAAO,QAAA,QAAK;MACZ,MAAM,QAAA;MACN,gBAAgB,QAAA;MAChB,SAAS,QAAA;MACT,QAAQ,wBAAA;MACR,eAAe,QAAA;;;;;;;;;;;;;;;KAKZ,2BAAA,SAA8B,mBAAA,SAAA,WAAA,EADtC,mBAeM,OAfN,YAeM,CAZJ,YAWmC,gBAAA;MAVhC,SAAS,QAAA;MACT,iBAAiB,0BAAA;MACjB,UAAU,mBAAA;MACV,UAAU,QAAA;MACV,gBAAA,QAAA;MACA,OAAO,QAAA,QAAK;MACZ,MAAM,QAAA;MACN,gBAAgB,QAAA;MAChB,SAAS,QAAA;MACT,QAAQ,MAAA,QAAO,CAAC,OAAO,mBAAA,MAAkB;MACzC,eAAe,QAAA;;;;;;;;;;;;;;uBAIpB,mBAgBmC,UAAA,MAAA,WAfP,qBAAA,QAAnB,oBAAe;0BADxB,YAgBmC,2BAAA;OAdhC,KAAK,gBAAgB;OACrB,YAAY,QAAA;OACZ,SAAS,QAAA;OACT,aAAa,gBAAgB;OAC7B,iBAAiB,uBAAA;OACjB,eAAe,QAAA,QAAQ;OACvB,UAAU,QAAA;OACV,aAAa,QAAA;OACb,gBAAA,QAAA;OACA,OAAO,QAAA;OACP,MAAM,QAAA;OACN,gBAAgB,QAAA;OAChB,SAAS,QAAA;OACT,QAAQ,gBAAgB;OACxB,eAAe,QAAA;;;;;;;;;;;;;;;;;;KAClB,YAAkD,MAAA,+BAAA,EAAA,EAAzB,OAAO,eAAA,OAAc,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA"}
@@ -1,15 +1,16 @@
1
- import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
1
+ import type { OpenApiDocument, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
2
  import { type CompositionKeyword } from './schema-composition.js';
3
3
  type CompositionToRender = {
4
4
  composition: CompositionKeyword;
5
5
  value: SchemaObject;
6
6
  };
7
+ type DocumentSchemaLookup = Pick<OpenApiDocument, 'components'>;
7
8
  /**
8
9
  * Computes which compositions should be rendered and with which values
9
10
  *
10
11
  * @param value - The schema object to check for compositions
11
12
  * @returns Array of compositions to render with their values
12
13
  */
13
- export declare const getCompositionsToRender: (value: SchemaObject | undefined) => CompositionToRender[];
14
+ export declare const getCompositionsToRender: (value: SchemaObject | undefined, document?: DocumentSchemaLookup) => CompositionToRender[];
14
15
  export {};
15
16
  //# sourceMappingURL=get-compositions-to-render.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-compositions-to-render.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-compositions-to-render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,EAAE,KAAK,kBAAkB,EAAgB,MAAM,sBAAsB,CAAA;AAG5E,KAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,KAAK,EAAE,YAAY,CAAA;CACpB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,YAAY,GAAG,SAAS,KAAG,mBAAmB,EAgC5F,CAAA"}
1
+ {"version":3,"file":"get-compositions-to-render.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-compositions-to-render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAIjH,OAAO,EAAE,KAAK,kBAAkB,EAAgB,MAAM,sBAAsB,CAAA;AAG5E,KAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,KAAK,EAAE,YAAY,CAAA;CACpB,CAAA;AAED,KAAK,oBAAoB,GAAG,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAAA;AAyC/D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,YAAY,GAAG,SAAS,EAC/B,WAAW,oBAAoB,KAC9B,mBAAmB,EAyCrB,CAAA"}
@@ -1,18 +1,43 @@
1
+ import { getRefName } from "./get-ref-name.js";
1
2
  import { compositions } from "./schema-composition.js";
2
3
  import { shouldRenderArrayItemComposition } from "./should-render-array-item-composition.js";
3
4
  import { resolve } from "@scalar/workspace-store/resolve";
4
5
  import { isArraySchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
5
6
  import { isDefined } from "@scalar/helpers/array/is-defined";
6
7
  //#region src/components/Content/Schema/helpers/get-compositions-to-render.ts
8
+ var normalizeDiscriminatorMappingRef = (value) => value.startsWith("#/") || value.includes("/") ? value : `#/components/schemas/${value}`;
9
+ var inferDiscriminatorMappingComposition = (value, document) => {
10
+ if (value.oneOf || value.anyOf || !document?.components?.schemas) return null;
11
+ const refs = Object.values(value.discriminator?.mapping ?? {}).filter((mappingValue) => typeof mappingValue === "string").map((mappingValue) => {
12
+ const ref = normalizeDiscriminatorMappingRef(mappingValue);
13
+ const refName = getRefName(ref);
14
+ const refValue = refName ? resolve.schema(document.components?.schemas?.[refName]) : void 0;
15
+ if (!refValue) return;
16
+ return {
17
+ $ref: ref,
18
+ "$ref-value": refValue
19
+ };
20
+ }).filter(isDefined);
21
+ if (refs.length === 0) return null;
22
+ return {
23
+ ...resolve.schema(value),
24
+ oneOf: refs
25
+ };
26
+ };
7
27
  /**
8
28
  * Computes which compositions should be rendered and with which values
9
29
  *
10
30
  * @param value - The schema object to check for compositions
11
31
  * @returns Array of compositions to render with their values
12
32
  */
13
- var getCompositionsToRender = (value) => {
33
+ var getCompositionsToRender = (value, document) => {
14
34
  if (!value) return [];
35
+ const inferredDiscriminatorComposition = inferDiscriminatorMappingComposition(value, document);
15
36
  return compositions.map((composition) => {
37
+ if (composition === "oneOf" && inferredDiscriminatorComposition) return {
38
+ composition,
39
+ value: inferredDiscriminatorComposition
40
+ };
16
41
  if (shouldRenderArrayItemComposition(value, composition) && isArraySchema(value) && value.items) return {
17
42
  composition,
18
43
  value: resolve.schema(value.items)
@@ -1 +1 @@
1
- {"version":3,"file":"get-compositions-to-render.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-compositions-to-render.ts"],"sourcesContent":["import { isDefined } from '@scalar/helpers/array/is-defined'\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'\n\nimport { type CompositionKeyword, compositions } from './schema-composition'\nimport { shouldRenderArrayItemComposition } from './should-render-array-item-composition'\n\ntype CompositionToRender = {\n composition: CompositionKeyword\n value: SchemaObject\n}\n\n/**\n * Computes which compositions should be rendered and with which values\n *\n * @param value - The schema object to check for compositions\n * @returns Array of compositions to render with their values\n */\nexport const getCompositionsToRender = (value: SchemaObject | undefined): CompositionToRender[] => {\n if (!value) {\n return []\n }\n\n return compositions\n .map((composition) => {\n // Check for array item-level composition first (more specific case)\n if (shouldRenderArrayItemComposition(value, composition) && isArraySchema(value) && value.items) {\n return {\n composition,\n value: resolve.schema(value.items),\n }\n }\n\n // Check for property-level composition\n if (value[composition]) {\n // Skip if array items have this composition (even if complex/not rendered)\n const hasArrayItemComposition =\n isArraySchema(value) && value.items && typeof value.items === 'object' && composition in value.items\n\n if (!hasArrayItemComposition) {\n return {\n composition,\n value: resolve.schema(value),\n }\n }\n }\n\n return null\n })\n .filter(isDefined)\n}\n"],"mappings":";;;;;;;;;;;;AAmBA,IAAa,2BAA2B,UAA2D;AACjG,KAAI,CAAC,MACH,QAAO,EAAE;AAGX,QAAO,aACJ,KAAK,gBAAgB;AAEpB,MAAI,iCAAiC,OAAO,YAAY,IAAI,cAAc,MAAM,IAAI,MAAM,MACxF,QAAO;GACL;GACA,OAAO,QAAQ,OAAO,MAAM,MAAM;GACnC;AAIH,MAAI,MAAM;OAKJ,EAFF,cAAc,MAAM,IAAI,MAAM,SAAS,OAAO,MAAM,UAAU,YAAY,eAAe,MAAM,OAG/F,QAAO;IACL;IACA,OAAO,QAAQ,OAAO,MAAM;IAC7B;;AAIL,SAAO;GACP,CACD,OAAO,UAAU"}
1
+ {"version":3,"file":"get-compositions-to-render.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-compositions-to-render.ts"],"sourcesContent":["import { isDefined } from '@scalar/helpers/array/is-defined'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { OpenApiDocument, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\nimport { getRefName } from './get-ref-name'\nimport { type CompositionKeyword, compositions } from './schema-composition'\nimport { shouldRenderArrayItemComposition } from './should-render-array-item-composition'\n\ntype CompositionToRender = {\n composition: CompositionKeyword\n value: SchemaObject\n}\n\ntype DocumentSchemaLookup = Pick<OpenApiDocument, 'components'>\n\nconst normalizeDiscriminatorMappingRef = (value: string) =>\n value.startsWith('#/') || value.includes('/') ? value : `#/components/schemas/${value}`\n\nconst inferDiscriminatorMappingComposition = (\n value: SchemaObject,\n document?: DocumentSchemaLookup,\n): SchemaObject | null => {\n if (value.oneOf || value.anyOf || !document?.components?.schemas) {\n return null\n }\n\n const refs = Object.values(value.discriminator?.mapping ?? {})\n .filter((mappingValue): mappingValue is string => typeof mappingValue === 'string')\n .map((mappingValue) => {\n const ref = normalizeDiscriminatorMappingRef(mappingValue)\n const refName = getRefName(ref)\n const refValue = refName ? resolve.schema(document.components?.schemas?.[refName]) : undefined\n\n if (!refValue) {\n return undefined\n }\n\n return {\n $ref: ref,\n '$ref-value': refValue,\n }\n })\n .filter(isDefined)\n\n if (refs.length === 0) {\n return null\n }\n\n return {\n ...resolve.schema(value),\n oneOf: refs as NonNullable<SchemaObject['oneOf']>,\n }\n}\n\n/**\n * Computes which compositions should be rendered and with which values\n *\n * @param value - The schema object to check for compositions\n * @returns Array of compositions to render with their values\n */\nexport const getCompositionsToRender = (\n value: SchemaObject | undefined,\n document?: DocumentSchemaLookup,\n): CompositionToRender[] => {\n if (!value) {\n return []\n }\n\n const inferredDiscriminatorComposition = inferDiscriminatorMappingComposition(value, document)\n\n return compositions\n .map((composition) => {\n if (composition === 'oneOf' && inferredDiscriminatorComposition) {\n return {\n composition,\n value: inferredDiscriminatorComposition,\n }\n }\n\n // Check for array item-level composition first (more specific case)\n if (shouldRenderArrayItemComposition(value, composition) && isArraySchema(value) && value.items) {\n return {\n composition,\n value: resolve.schema(value.items),\n }\n }\n\n // Check for property-level composition\n if (value[composition]) {\n // Skip if array items have this composition (even if complex/not rendered)\n const hasArrayItemComposition =\n isArraySchema(value) && value.items && typeof value.items === 'object' && composition in value.items\n\n if (!hasArrayItemComposition) {\n return {\n composition,\n value: resolve.schema(value),\n }\n }\n }\n\n return null\n })\n .filter(isDefined)\n}\n"],"mappings":";;;;;;;AAgBA,IAAM,oCAAoC,UACxC,MAAM,WAAW,KAAK,IAAI,MAAM,SAAS,IAAI,GAAG,QAAQ,wBAAwB;AAElF,IAAM,wCACJ,OACA,aACwB;AACxB,KAAI,MAAM,SAAS,MAAM,SAAS,CAAC,UAAU,YAAY,QACvD,QAAO;CAGT,MAAM,OAAO,OAAO,OAAO,MAAM,eAAe,WAAW,EAAE,CAAC,CAC3D,QAAQ,iBAAyC,OAAO,iBAAiB,SAAS,CAClF,KAAK,iBAAiB;EACrB,MAAM,MAAM,iCAAiC,aAAa;EAC1D,MAAM,UAAU,WAAW,IAAI;EAC/B,MAAM,WAAW,UAAU,QAAQ,OAAO,SAAS,YAAY,UAAU,SAAS,GAAG,KAAA;AAErF,MAAI,CAAC,SACH;AAGF,SAAO;GACL,MAAM;GACN,cAAc;GACf;GACD,CACD,OAAO,UAAU;AAEpB,KAAI,KAAK,WAAW,EAClB,QAAO;AAGT,QAAO;EACL,GAAG,QAAQ,OAAO,MAAM;EACxB,OAAO;EACR;;;;;;;;AASH,IAAa,2BACX,OACA,aAC0B;AAC1B,KAAI,CAAC,MACH,QAAO,EAAE;CAGX,MAAM,mCAAmC,qCAAqC,OAAO,SAAS;AAE9F,QAAO,aACJ,KAAK,gBAAgB;AACpB,MAAI,gBAAgB,WAAW,iCAC7B,QAAO;GACL;GACA,OAAO;GACR;AAIH,MAAI,iCAAiC,OAAO,YAAY,IAAI,cAAc,MAAM,IAAI,MAAM,MACxF,QAAO;GACL;GACA,OAAO,QAAQ,OAAO,MAAM,MAAM;GACnC;AAIH,MAAI,MAAM;OAKJ,EAFF,cAAc,MAAM,IAAI,MAAM,SAAS,OAAO,MAAM,UAAU,YAAY,eAAe,MAAM,OAG/F,QAAO;IACL;IACA,OAAO,QAAQ,OAAO,MAAM;IAC7B;;AAIL,SAAO;GACP,CACD,OAAO,UAAU"}
@@ -0,0 +1,31 @@
1
+ import type { InjectionKey } from 'vue';
2
+ /**
3
+ * The set of schema "cycle keys" for every ancestor on the current render path.
4
+ *
5
+ * Each `Schema` component injects this set, adds its own key, and re-provides
6
+ * it to its descendants. When a node's key is already present in the ancestor
7
+ * set we've hit a cycle (a self-referential schema) and must stop force
8
+ * expanding to avoid rendering forever.
9
+ *
10
+ * See {@link getCycleKey} for how a node's key is derived.
11
+ */
12
+ export declare const SCHEMA_ANCESTORS_SYMBOL: InjectionKey<ReadonlySet<unknown>>;
13
+ /**
14
+ * Derive a stable identity for a schema node from its *raw* (unresolved) value.
15
+ *
16
+ * Cycle detection needs a key that is identical every time the same schema is
17
+ * reached along a path, and that survives the shallow copies/merges performed
18
+ * while rendering (which break object identity of the resolved schema).
19
+ *
20
+ * - For `$ref` nodes we use the ref string. Two branches that reference the
21
+ * same component share the string, so a schema that (transitively) references
22
+ * itself is detected as a cycle, while sibling references are not.
23
+ * - For inline schemas there is no ref, so we fall back to the raw object
24
+ * reference. A self-referential inline schema reuses the same object, so
25
+ * object identity catches the cycle.
26
+ *
27
+ * Returns `undefined` for primitives/booleans (e.g. `additionalProperties: true`)
28
+ * which can never form a cycle.
29
+ */
30
+ export declare const getCycleKey: (raw: unknown) => unknown;
31
+ //# sourceMappingURL=schema-cycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-cycle.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-cycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAA;AAEvC;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAA8B,CAAA;AAErG;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,OAAO,KAAG,OAS1C,CAAA"}
@@ -0,0 +1,39 @@
1
+ //#region src/components/Content/Schema/helpers/schema-cycle.ts
2
+ /**
3
+ * The set of schema "cycle keys" for every ancestor on the current render path.
4
+ *
5
+ * Each `Schema` component injects this set, adds its own key, and re-provides
6
+ * it to its descendants. When a node's key is already present in the ancestor
7
+ * set we've hit a cycle (a self-referential schema) and must stop force
8
+ * expanding to avoid rendering forever.
9
+ *
10
+ * See {@link getCycleKey} for how a node's key is derived.
11
+ */
12
+ var SCHEMA_ANCESTORS_SYMBOL = Symbol("schema-ancestors");
13
+ /**
14
+ * Derive a stable identity for a schema node from its *raw* (unresolved) value.
15
+ *
16
+ * Cycle detection needs a key that is identical every time the same schema is
17
+ * reached along a path, and that survives the shallow copies/merges performed
18
+ * while rendering (which break object identity of the resolved schema).
19
+ *
20
+ * - For `$ref` nodes we use the ref string. Two branches that reference the
21
+ * same component share the string, so a schema that (transitively) references
22
+ * itself is detected as a cycle, while sibling references are not.
23
+ * - For inline schemas there is no ref, so we fall back to the raw object
24
+ * reference. A self-referential inline schema reuses the same object, so
25
+ * object identity catches the cycle.
26
+ *
27
+ * Returns `undefined` for primitives/booleans (e.g. `additionalProperties: true`)
28
+ * which can never form a cycle.
29
+ */
30
+ var getCycleKey = (raw) => {
31
+ if (raw && typeof raw === "object") {
32
+ if ("$ref" in raw && typeof raw.$ref === "string") return raw.$ref;
33
+ return raw;
34
+ }
35
+ };
36
+ //#endregion
37
+ export { SCHEMA_ANCESTORS_SYMBOL, getCycleKey };
38
+
39
+ //# sourceMappingURL=schema-cycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-cycle.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/schema-cycle.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\n\n/**\n * The set of schema \"cycle keys\" for every ancestor on the current render path.\n *\n * Each `Schema` component injects this set, adds its own key, and re-provides\n * it to its descendants. When a node's key is already present in the ancestor\n * set we've hit a cycle (a self-referential schema) and must stop force\n * expanding to avoid rendering forever.\n *\n * See {@link getCycleKey} for how a node's key is derived.\n */\nexport const SCHEMA_ANCESTORS_SYMBOL: InjectionKey<ReadonlySet<unknown>> = Symbol('schema-ancestors')\n\n/**\n * Derive a stable identity for a schema node from its *raw* (unresolved) value.\n *\n * Cycle detection needs a key that is identical every time the same schema is\n * reached along a path, and that survives the shallow copies/merges performed\n * while rendering (which break object identity of the resolved schema).\n *\n * - For `$ref` nodes we use the ref string. Two branches that reference the\n * same component share the string, so a schema that (transitively) references\n * itself is detected as a cycle, while sibling references are not.\n * - For inline schemas there is no ref, so we fall back to the raw object\n * reference. A self-referential inline schema reuses the same object, so\n * object identity catches the cycle.\n *\n * Returns `undefined` for primitives/booleans (e.g. `additionalProperties: true`)\n * which can never form a cycle.\n */\nexport const getCycleKey = (raw: unknown): unknown => {\n if (raw && typeof raw === 'object') {\n if ('$ref' in raw && typeof (raw as { $ref?: unknown }).$ref === 'string') {\n return (raw as { $ref: string }).$ref\n }\n return raw\n }\n\n return undefined\n}\n"],"mappings":";;;;;;;;;;;AAYA,IAAa,0BAA8D,OAAO,mBAAmB;;;;;;;;;;;;;;;;;;AAmBrG,IAAa,eAAe,QAA0B;AACpD,KAAI,OAAO,OAAO,QAAQ,UAAU;AAClC,MAAI,UAAU,OAAO,OAAQ,IAA2B,SAAS,SAC/D,QAAQ,IAAyB;AAEnC,SAAO"}
@@ -1,4 +1,5 @@
1
1
  import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
2
+ import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
3
  /**
3
4
  * Options for the schema component tree
4
5
  *
@@ -13,5 +14,14 @@ export type SchemaOptions = {
13
14
  orderSchemaPropertiesBy?: ApiReferenceConfiguration['orderSchemaPropertiesBy'];
14
15
  /** Order required properties first */
15
16
  orderRequiredPropertiesFirst?: ApiReferenceConfiguration['orderRequiredPropertiesFirst'];
17
+ /** Expand all nested schema properties by default while keeping the toggle available */
18
+ expandAllSchemaProperties?: ApiReferenceConfiguration['expandAllSchemaProperties'];
19
+ /**
20
+ * The document the schema belongs to.
21
+ *
22
+ * Used purely for display, e.g. to resolve discriminator `mapping` references into
23
+ * their component schemas when inferring composition variants.
24
+ */
25
+ document?: OpenApiDocument;
16
26
  };
17
27
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,gCAAgC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,mDAAmD;IACnD,uBAAuB,CAAC,EAAE,yBAAyB,CAAC,yBAAyB,CAAC,CAAA;IAC9E,sCAAsC;IACtC,4BAA4B,CAAC,EAAE,yBAAyB,CAAC,8BAA8B,CAAC,CAAA;CACzF,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAEnG;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,gCAAgC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iCAAiC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,mDAAmD;IACnD,uBAAuB,CAAC,EAAE,yBAAyB,CAAC,yBAAyB,CAAC,CAAA;IAC9E,sCAAsC;IACtC,4BAA4B,CAAC,EAAE,yBAAyB,CAAC,8BAA8B,CAAC,CAAA;IACxF,wFAAwF;IACxF,yBAAyB,CAAC,EAAE,yBAAyB,CAAC,2BAA2B,CAAC,CAAA;IAClF;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC3B,CAAA"}
@@ -15,7 +15,7 @@ export type OperationProps = {
15
15
  id: string;
16
16
  method: HttpMethod;
17
17
  /** The subset of the configuration object required for the operation component */
18
- options: Pick<ApiReferenceConfigurationRaw, 'expandAllResponses' | 'hideModels' | 'hideTestRequestButton' | 'layout' | 'orderRequiredPropertiesFirst' | 'orderSchemaPropertiesBy' | 'showOperationId'>;
18
+ options: Pick<ApiReferenceConfigurationRaw, 'expandAllResponses' | 'hideModels' | 'hideTestRequestButton' | 'layout' | 'orderRequiredPropertiesFirst' | 'orderSchemaPropertiesBy' | 'expandAllSchemaProperties' | 'showOperationId'>;
19
19
  /** Document object */
20
20
  document: OpenApiDocument;
21
21
  /** Key of the operations path in the document.paths object */
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/Operation.vue"],"names":[],"mappings":"AAoLA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AACxF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OA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DAAqD;IACrD,cAAc,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC,CAAA;IACtE,oBAAoB;IACpB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,qBAAqB;IACrB,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AACD,QAAA,MAAM,YAAY,wSAgLd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../src/features/Operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * References Operation \"block\"\n */\nexport default {}\n\nexport type OperationProps = {\n id: string\n method: HttpMethod\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideModels'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n >\n /** Document object */\n document: OpenApiDocument\n /** Key of the operations path in the document.paths object */\n path: string\n /** OpenAPI path object that will include the operation */\n pathValue: PathItemObject | undefined\n /** Currently selected server for the document */\n server: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** Whether the Classic layout operation is collapsed */\n isCollapsed: boolean\n /** Whether the operation is a webhook */\n isWebhook: boolean\n /** The currently selected client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** The event bus */\n eventBus: WorkspaceEventBus\n /** The auth store */\n authStore: AuthStore\n}\n</script>\n\n<script lang=\"ts\" setup>\nimport type { ClientOptionGroup } from '@scalar/api-client/blocks/operation-code-sample'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport {\n combineParams,\n type MergedSecuritySchemes,\n} from '@scalar/workspace-store/request-example'\nimport type {\n OpenApiDocument,\n PathItemObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { filterSelectedSecurity } from '@/features/Operation/helpers/filter-selected-security'\n\nimport { getFirstServer } from './helpers/get-first-server'\nimport {\n getRequiredSecurity,\n type RequiredSecurity,\n} from './helpers/get-required-security'\nimport ClassicLayout from './layouts/ClassicLayout.vue'\nimport ModernLayout from './layouts/ModernLayout.vue'\n\nconst {\n authStore,\n clientOptions,\n document,\n eventBus,\n isCollapsed,\n isWebhook,\n method,\n options,\n path,\n pathValue,\n securitySchemes,\n server,\n} = defineProps<OperationProps>()\n\n/**\n * Operation from the new workspace store, ensure we are de-reference\n *\n * Also adds in params from the pathItemObject\n */\nconst operation = computed(() => {\n const entity = getResolvedRef(pathValue?.[method])\n\n if (!entity) {\n return null\n }\n\n // Combine params from the pathItem and the operation\n const parameters = combineParams(pathValue?.parameters, entity.parameters)\n return { ...entity, parameters }\n})\n\n/**\n * Determine the effective server for the code examples.\n */\nconst selectedServer = computed<ServerObject | null>(() =>\n getFirstServer(\n // 1) Operation\n operation.value?.servers ?? null,\n // 2) Path Item\n pathValue?.servers ?? null,\n // 3) Document\n server,\n ),\n)\n\nconst requiredSecurity = computed<RequiredSecurity>(() =>\n getRequiredSecurity(operation.value, document),\n)\n\n/** We must ensure the selected security schemes are required on this operation */\nconst selectedSecuritySchemes = computed(() =>\n filterSelectedSecurity(\n document,\n operation.value,\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n }),\n authStore.getAuthSelectedSchemas({\n type: 'operation',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n path,\n method,\n }),\n securitySchemes,\n ),\n)\n</script>\n\n<template>\n <template v-if=\"operation\">\n <ClassicLayout\n v-if=\"options.layout === 'classic'\"\n :id\n :clientOptions\n :eventBus\n :isCollapsed\n :isWebhook\n :method\n :operation\n :options\n :path\n :requiredSecurity\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n <ModernLayout\n v-else\n :id\n :clientOptions\n :eventBus\n :isWebhook\n :method\n :operation\n :options\n :path\n :requiredSecurity\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n </template>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../src/features/Operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * References Operation \"block\"\n */\nexport default {}\n\nexport type OperationProps = {\n id: string\n method: HttpMethod\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideModels'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'expandAllSchemaProperties'\n | 'showOperationId'\n >\n /** Document object */\n document: OpenApiDocument\n /** Key of the operations path in the document.paths object */\n path: string\n /** OpenAPI path object that will include the operation */\n pathValue: PathItemObject | undefined\n /** Currently selected server for the document */\n server: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** Whether the Classic layout operation is collapsed */\n isCollapsed: boolean\n /** Whether the operation is a webhook */\n isWebhook: boolean\n /** The currently selected client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** The event bus */\n eventBus: WorkspaceEventBus\n /** The auth store */\n authStore: AuthStore\n}\n</script>\n\n<script lang=\"ts\" setup>\nimport type { ClientOptionGroup } from '@scalar/api-client/blocks/operation-code-sample'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport {\n combineParams,\n type MergedSecuritySchemes,\n} from '@scalar/workspace-store/request-example'\nimport type {\n OpenApiDocument,\n PathItemObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { filterSelectedSecurity } from '@/features/Operation/helpers/filter-selected-security'\n\nimport { getFirstServer } from './helpers/get-first-server'\nimport {\n getRequiredSecurity,\n type RequiredSecurity,\n} from './helpers/get-required-security'\nimport ClassicLayout from './layouts/ClassicLayout.vue'\nimport ModernLayout from './layouts/ModernLayout.vue'\n\nconst {\n authStore,\n clientOptions,\n document,\n eventBus,\n isCollapsed,\n isWebhook,\n method,\n options,\n path,\n pathValue,\n securitySchemes,\n server,\n} = defineProps<OperationProps>()\n\n/**\n * Operation from the new workspace store, ensure we are de-reference\n *\n * Also adds in params from the pathItemObject\n */\nconst operation = computed(() => {\n const entity = getResolvedRef(pathValue?.[method])\n\n if (!entity) {\n return null\n }\n\n // Combine params from the pathItem and the operation\n const parameters = combineParams(pathValue?.parameters, entity.parameters)\n return { ...entity, parameters }\n})\n\n/**\n * Determine the effective server for the code examples.\n */\nconst selectedServer = computed<ServerObject | null>(() =>\n getFirstServer(\n // 1) Operation\n operation.value?.servers ?? null,\n // 2) Path Item\n pathValue?.servers ?? null,\n // 3) Document\n server,\n ),\n)\n\nconst requiredSecurity = computed<RequiredSecurity>(() =>\n getRequiredSecurity(operation.value, document),\n)\n\n/** We must ensure the selected security schemes are required on this operation */\nconst selectedSecuritySchemes = computed(() =>\n filterSelectedSecurity(\n document,\n operation.value,\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n }),\n authStore.getAuthSelectedSchemas({\n type: 'operation',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n path,\n method,\n }),\n securitySchemes,\n ),\n)\n</script>\n\n<template>\n <template v-if=\"operation\">\n <ClassicLayout\n v-if=\"options.layout === 'classic'\"\n :id\n :clientOptions\n :document\n :eventBus\n :isCollapsed\n :isWebhook\n :method\n :operation\n :options\n :path\n :requiredSecurity\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n <ModernLayout\n v-else\n :id\n :clientOptions\n :document\n :eventBus\n :isWebhook\n :method\n :operation\n :options\n :path\n :requiredSecurity\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n </template>\n</template>\n"],"mappings":""}
@@ -59,6 +59,7 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
59
59
  key: 0,
60
60
  id: __props.id,
61
61
  clientOptions: __props.clientOptions,
62
+ document: __props.document,
62
63
  eventBus: __props.eventBus,
63
64
  isCollapsed: __props.isCollapsed,
64
65
  isWebhook: __props.isWebhook,
@@ -73,6 +74,7 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
73
74
  }, null, 8, [
74
75
  "id",
75
76
  "clientOptions",
77
+ "document",
76
78
  "eventBus",
77
79
  "isCollapsed",
78
80
  "isWebhook",
@@ -88,6 +90,7 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
88
90
  key: 1,
89
91
  id: __props.id,
90
92
  clientOptions: __props.clientOptions,
93
+ document: __props.document,
91
94
  eventBus: __props.eventBus,
92
95
  isWebhook: __props.isWebhook,
93
96
  method: __props.method,
@@ -101,6 +104,7 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
101
104
  }, null, 8, [
102
105
  "id",
103
106
  "clientOptions",
107
+ "document",
104
108
  "eventBus",
105
109
  "isWebhook",
106
110
  "method",
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../src/features/Operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * References Operation \"block\"\n */\nexport default {}\n\nexport type OperationProps = {\n id: string\n method: HttpMethod\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideModels'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'showOperationId'\n >\n /** Document object */\n document: OpenApiDocument\n /** Key of the operations path in the document.paths object */\n path: string\n /** OpenAPI path object that will include the operation */\n pathValue: PathItemObject | undefined\n /** Currently selected server for the document */\n server: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** Whether the Classic layout operation is collapsed */\n isCollapsed: boolean\n /** Whether the operation is a webhook */\n isWebhook: boolean\n /** The currently selected client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** The event bus */\n eventBus: WorkspaceEventBus\n /** The auth store */\n authStore: AuthStore\n}\n</script>\n\n<script lang=\"ts\" setup>\nimport type { ClientOptionGroup } from '@scalar/api-client/blocks/operation-code-sample'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport {\n combineParams,\n type MergedSecuritySchemes,\n} from '@scalar/workspace-store/request-example'\nimport type {\n OpenApiDocument,\n PathItemObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { filterSelectedSecurity } from '@/features/Operation/helpers/filter-selected-security'\n\nimport { getFirstServer } from './helpers/get-first-server'\nimport {\n getRequiredSecurity,\n type RequiredSecurity,\n} from './helpers/get-required-security'\nimport ClassicLayout from './layouts/ClassicLayout.vue'\nimport ModernLayout from './layouts/ModernLayout.vue'\n\nconst {\n authStore,\n clientOptions,\n document,\n eventBus,\n isCollapsed,\n isWebhook,\n method,\n options,\n path,\n pathValue,\n securitySchemes,\n server,\n} = defineProps<OperationProps>()\n\n/**\n * Operation from the new workspace store, ensure we are de-reference\n *\n * Also adds in params from the pathItemObject\n */\nconst operation = computed(() => {\n const entity = getResolvedRef(pathValue?.[method])\n\n if (!entity) {\n return null\n }\n\n // Combine params from the pathItem and the operation\n const parameters = combineParams(pathValue?.parameters, entity.parameters)\n return { ...entity, parameters }\n})\n\n/**\n * Determine the effective server for the code examples.\n */\nconst selectedServer = computed<ServerObject | null>(() =>\n getFirstServer(\n // 1) Operation\n operation.value?.servers ?? null,\n // 2) Path Item\n pathValue?.servers ?? null,\n // 3) Document\n server,\n ),\n)\n\nconst requiredSecurity = computed<RequiredSecurity>(() =>\n getRequiredSecurity(operation.value, document),\n)\n\n/** We must ensure the selected security schemes are required on this operation */\nconst selectedSecuritySchemes = computed(() =>\n filterSelectedSecurity(\n document,\n operation.value,\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n }),\n authStore.getAuthSelectedSchemas({\n type: 'operation',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n path,\n method,\n }),\n securitySchemes,\n ),\n)\n</script>\n\n<template>\n <template v-if=\"operation\">\n <ClassicLayout\n v-if=\"options.layout === 'classic'\"\n :id\n :clientOptions\n :eventBus\n :isCollapsed\n :isWebhook\n :method\n :operation\n :options\n :path\n :requiredSecurity\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n <ModernLayout\n v-else\n :id\n :clientOptions\n :eventBus\n :isWebhook\n :method\n :operation\n :options\n :path\n :requiredSecurity\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8FA,MAAM,YAAY,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A,gBAAA,eAAA"}
1
+ {"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../src/features/Operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * References Operation \"block\"\n */\nexport default {}\n\nexport type OperationProps = {\n id: string\n method: HttpMethod\n /** The subset of the configuration object required for the operation component */\n options: Pick<\n ApiReferenceConfigurationRaw,\n | 'expandAllResponses'\n | 'hideModels'\n | 'hideTestRequestButton'\n | 'layout'\n | 'orderRequiredPropertiesFirst'\n | 'orderSchemaPropertiesBy'\n | 'expandAllSchemaProperties'\n | 'showOperationId'\n >\n /** Document object */\n document: OpenApiDocument\n /** Key of the operations path in the document.paths object */\n path: string\n /** OpenAPI path object that will include the operation */\n pathValue: PathItemObject | undefined\n /** Currently selected server for the document */\n server: ServerObject | null\n /** The merged security schemes for the document and the authentication configuration */\n securitySchemes: MergedSecuritySchemes\n /** The http client options for the dropdown */\n clientOptions: ClientOptionGroup[]\n /** Whether the Classic layout operation is collapsed */\n isCollapsed: boolean\n /** Whether the operation is a webhook */\n isWebhook: boolean\n /** The currently selected client for the document */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** The event bus */\n eventBus: WorkspaceEventBus\n /** The auth store */\n authStore: AuthStore\n}\n</script>\n\n<script lang=\"ts\" setup>\nimport type { ClientOptionGroup } from '@scalar/api-client/blocks/operation-code-sample'\nimport type { HttpMethod } from '@scalar/helpers/http/http-methods'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { AuthStore } from '@scalar/workspace-store/entities/auth'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport {\n combineParams,\n type MergedSecuritySchemes,\n} from '@scalar/workspace-store/request-example'\nimport type {\n OpenApiDocument,\n PathItemObject,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { filterSelectedSecurity } from '@/features/Operation/helpers/filter-selected-security'\n\nimport { getFirstServer } from './helpers/get-first-server'\nimport {\n getRequiredSecurity,\n type RequiredSecurity,\n} from './helpers/get-required-security'\nimport ClassicLayout from './layouts/ClassicLayout.vue'\nimport ModernLayout from './layouts/ModernLayout.vue'\n\nconst {\n authStore,\n clientOptions,\n document,\n eventBus,\n isCollapsed,\n isWebhook,\n method,\n options,\n path,\n pathValue,\n securitySchemes,\n server,\n} = defineProps<OperationProps>()\n\n/**\n * Operation from the new workspace store, ensure we are de-reference\n *\n * Also adds in params from the pathItemObject\n */\nconst operation = computed(() => {\n const entity = getResolvedRef(pathValue?.[method])\n\n if (!entity) {\n return null\n }\n\n // Combine params from the pathItem and the operation\n const parameters = combineParams(pathValue?.parameters, entity.parameters)\n return { ...entity, parameters }\n})\n\n/**\n * Determine the effective server for the code examples.\n */\nconst selectedServer = computed<ServerObject | null>(() =>\n getFirstServer(\n // 1) Operation\n operation.value?.servers ?? null,\n // 2) Path Item\n pathValue?.servers ?? null,\n // 3) Document\n server,\n ),\n)\n\nconst requiredSecurity = computed<RequiredSecurity>(() =>\n getRequiredSecurity(operation.value, document),\n)\n\n/** We must ensure the selected security schemes are required on this operation */\nconst selectedSecuritySchemes = computed(() =>\n filterSelectedSecurity(\n document,\n operation.value,\n authStore.getAuthSelectedSchemas({\n type: 'document',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n }),\n authStore.getAuthSelectedSchemas({\n type: 'operation',\n documentName: document?.['x-scalar-navigation']?.name ?? '',\n path,\n method,\n }),\n securitySchemes,\n ),\n)\n</script>\n\n<template>\n <template v-if=\"operation\">\n <ClassicLayout\n v-if=\"options.layout === 'classic'\"\n :id\n :clientOptions\n :document\n :eventBus\n :isCollapsed\n :isWebhook\n :method\n :operation\n :options\n :path\n :requiredSecurity\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n <ModernLayout\n v-else\n :id\n :clientOptions\n :document\n :eventBus\n :isWebhook\n :method\n :operation\n :options\n :path\n :requiredSecurity\n :selectedClient\n :selectedSecuritySchemes\n :selectedServer />\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+FA,MAAM,YAAY,eAAe;GAC/B,MAAM,SAAS,eAAe,QAAA,YAAY,QAAA,QAAO;AAEjD,OAAI,CAAC,OACH,QAAO;GAIT,MAAM,aAAa,cAAc,QAAA,WAAW,YAAY,OAAO,WAAU;AACzE,UAAO;IAAE,GAAG;IAAQ;IAAW;IAChC;;;;EAKD,MAAM,iBAAiB,eACrB,eAEE,UAAU,OAAO,WAAW,MAE5B,QAAA,WAAW,WAAW,MAEtB,QAAA,OACD,CACH;EAEA,MAAM,mBAAmB,eACvB,oBAAoB,UAAU,OAAO,QAAA,SAAS,CAChD;;EAGA,MAAM,0BAA0B,eAC9B,uBACE,QAAA,UACA,UAAU,OACV,QAAA,UAAU,uBAAuB;GAC/B,MAAM;GACN,cAAc,QAAA,WAAW,wBAAwB,QAAQ;GAC1D,CAAC,EACF,QAAA,UAAU,uBAAuB;GAC/B,MAAM;GACN,cAAc,QAAA,WAAW,wBAAwB,QAAQ;GACzD,MAAG,QAAA;GACH,QAAK,QAAA;GACN,CAAC,EACF,QAAA,gBACD,CACH;;UAIkB,UAAA,SAAA,WAAA,EAAhB,mBAgCW,UAAA,EAAA,KAAA,GAAA,EAAA,CA9BD,QAAA,QAAQ,WAAM,aAAA,WAAA,EADtB,YAeoB,uBAAA;;IAbjB,IAAA,QAAA;IACA,eAAA,QAAA;IACA,UAAA,QAAA;IACA,UAAA,QAAA;IACA,aAAA,QAAA;IACA,WAAA,QAAA;IACA,QAAA,QAAA;IACA,WAAA,UAAA;IACA,SAAA,QAAA;IACA,MAAA,QAAA;IACA,kBAAA,iBAAA;IACA,gBAAA,QAAA;IACA,yBAAA,wBAAA;IACA,gBAAA,eAAA;;;;;;;;;;;;;;;;uBACH,YAcoB,sBAAA;;IAZjB,IAAA,QAAA;IACA,eAAA,QAAA;IACA,UAAA,QAAA;IACA,UAAA,QAAA;IACA,WAAA,QAAA;IACA,QAAA,QAAA;IACA,WAAA,UAAA;IACA,SAAA,QAAA;IACA,MAAA,QAAA;IACA,kBAAA,iBAAA;IACA,gBAAA,QAAA;IACA,yBAAA,wBAAA;IACA,gBAAA,eAAA"}
@@ -2,8 +2,8 @@ import ScreenReader_default from "../../../components/ScreenReader.vue.js";
2
2
  import { computed, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, openBlock, toDisplayString, unref, useModel, withCtx, withModifiers } from "vue";
3
3
  import { ScalarIconCaretDown } from "@scalar/icons";
4
4
  import { ScalarButton } from "@scalar/components/button";
5
- import { cva } from "@scalar/use-hooks/useBindCx";
6
5
  import { ScalarListbox } from "@scalar/components/listbox";
6
+ import { cva } from "@scalar/use-hooks/useBindCx";
7
7
  //#region src/features/Operation/components/ContentTypeSelect.vue?vue&type=script&setup=true&lang.ts
8
8
  var ContentTypeSelect_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
9
9
  inheritAttrs: false,
@@ -1,12 +1,15 @@
1
1
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
- import type { HeaderObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ import type { HeaderObject, OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
3
  type __VLS_Props = {
4
4
  header: HeaderObject;
5
5
  name: string;
6
6
  breadcrumb?: string[];
7
7
  eventBus: WorkspaceEventBus | null;
8
+ /** The document the header belongs to, used to resolve schema references for display */
9
+ document?: OpenApiDocument;
8
10
  orderSchemaPropertiesBy: 'alpha' | 'preserve' | undefined;
9
11
  orderRequiredPropertiesFirst: boolean | undefined;
12
+ expandAllSchemaProperties: boolean | undefined;
10
13
  };
11
14
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
15
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"Header.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/Header.vue"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAIhG,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,uBAAuB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;IACzD,4BAA4B,EAAE,OAAO,GAAG,SAAS,CAAA;CAClD,CAAC;AAqDF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Header.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/Header.vue"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAChB,MAAM,8DAA8D,CAAA;AAIrE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,wFAAwF;IACxF,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B,uBAAuB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;IACzD,4BAA4B,EAAE,OAAO,GAAG,SAAS,CAAA;IACjD,yBAAyB,EAAE,OAAO,GAAG,SAAS,CAAA;CAC/C,CAAC;AAiEF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Header.vue.js","names":[],"sources":["../../../../src/features/Operation/components/Header.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { HeaderObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport SchemaProperty from '@/components/Content/Schema/SchemaProperty.vue'\n\nconst { name, header, breadcrumb } = defineProps<{\n header: HeaderObject\n name: string\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n orderSchemaPropertiesBy: 'alpha' | 'preserve' | undefined\n orderRequiredPropertiesFirst: boolean | undefined\n}>()\n</script>\n<template>\n <SchemaProperty\n v-if=\"'schema' in header && header.schema\"\n :breadcrumb=\"breadcrumb ? [...breadcrumb, 'headers'] : undefined\"\n :description=\"header.description\"\n :eventBus=\"eventBus\"\n :name=\"name\"\n :options=\"{\n orderRequiredPropertiesFirst: orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: orderSchemaPropertiesBy,\n }\"\n :schema=\"getResolvedRef(header.schema)\" />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Header.vue.js","names":[],"sources":["../../../../src/features/Operation/components/Header.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n HeaderObject,\n OpenApiDocument,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport SchemaProperty from '@/components/Content/Schema/SchemaProperty.vue'\n\nconst {\n name,\n header,\n breadcrumb,\n document,\n orderSchemaPropertiesBy,\n orderRequiredPropertiesFirst,\n expandAllSchemaProperties,\n} = defineProps<{\n header: HeaderObject\n name: string\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n /** The document the header belongs to, used to resolve schema references for display */\n document?: OpenApiDocument\n orderSchemaPropertiesBy: 'alpha' | 'preserve' | undefined\n orderRequiredPropertiesFirst: boolean | undefined\n expandAllSchemaProperties: boolean | undefined\n}>()\n</script>\n<template>\n <SchemaProperty\n v-if=\"'schema' in header && header.schema\"\n :breadcrumb=\"breadcrumb ? [...breadcrumb, 'headers'] : undefined\"\n :description=\"header.description\"\n :eventBus=\"eventBus\"\n :name=\"name\"\n :options=\"{\n orderRequiredPropertiesFirst: orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: orderSchemaPropertiesBy,\n expandAllSchemaProperties: expandAllSchemaProperties,\n document,\n }\"\n :schema=\"getResolvedRef(header.schema)\" />\n</template>\n"],"mappings":""}
@@ -9,8 +9,10 @@ var Header_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
9
9
  name: {},
10
10
  breadcrumb: {},
11
11
  eventBus: {},
12
+ document: {},
12
13
  orderSchemaPropertiesBy: {},
13
- orderRequiredPropertiesFirst: { type: Boolean }
14
+ orderRequiredPropertiesFirst: { type: Boolean },
15
+ expandAllSchemaProperties: { type: Boolean }
14
16
  },
15
17
  setup(__props) {
16
18
  return (_ctx, _cache) => {
@@ -22,7 +24,9 @@ var Header_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
22
24
  name: __props.name,
23
25
  options: {
24
26
  orderRequiredPropertiesFirst: __props.orderRequiredPropertiesFirst,
25
- orderSchemaPropertiesBy: __props.orderSchemaPropertiesBy
27
+ orderSchemaPropertiesBy: __props.orderSchemaPropertiesBy,
28
+ expandAllSchemaProperties: __props.expandAllSchemaProperties,
29
+ document: __props.document
26
30
  },
27
31
  schema: unref(getResolvedRef)(__props.header.schema)
28
32
  }, null, 8, [
@@ -1 +1 @@
1
- {"version":3,"file":"Header.vue.script.js","names":[],"sources":["../../../../src/features/Operation/components/Header.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { HeaderObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport SchemaProperty from '@/components/Content/Schema/SchemaProperty.vue'\n\nconst { name, header, breadcrumb } = defineProps<{\n header: HeaderObject\n name: string\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n orderSchemaPropertiesBy: 'alpha' | 'preserve' | undefined\n orderRequiredPropertiesFirst: boolean | undefined\n}>()\n</script>\n<template>\n <SchemaProperty\n v-if=\"'schema' in header && header.schema\"\n :breadcrumb=\"breadcrumb ? [...breadcrumb, 'headers'] : undefined\"\n :description=\"header.description\"\n :eventBus=\"eventBus\"\n :name=\"name\"\n :options=\"{\n orderRequiredPropertiesFirst: orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: orderSchemaPropertiesBy,\n }\"\n :schema=\"getResolvedRef(header.schema)\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;sBAkBsB,QAAA,UAAU,QAAA,OAAO,UAAA,WAAA,EADrC,YAU4C,wBAAA;;IARzC,YAAY,QAAA,aAAU,CAAA,GAAO,QAAA,YAAU,UAAA,GAAe,KAAA;IACtD,aAAa,QAAA,OAAO;IACpB,UAAU,QAAA;IACV,MAAM,QAAA;IACN,SAAO;mCAAwC,QAAA;8BAA6D,QAAA;;IAI5G,QAAQ,MAAA,eAAc,CAAC,QAAA,OAAO,OAAM"}
1
+ {"version":3,"file":"Header.vue.script.js","names":[],"sources":["../../../../src/features/Operation/components/Header.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n HeaderObject,\n OpenApiDocument,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport SchemaProperty from '@/components/Content/Schema/SchemaProperty.vue'\n\nconst {\n name,\n header,\n breadcrumb,\n document,\n orderSchemaPropertiesBy,\n orderRequiredPropertiesFirst,\n expandAllSchemaProperties,\n} = defineProps<{\n header: HeaderObject\n name: string\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n /** The document the header belongs to, used to resolve schema references for display */\n document?: OpenApiDocument\n orderSchemaPropertiesBy: 'alpha' | 'preserve' | undefined\n orderRequiredPropertiesFirst: boolean | undefined\n expandAllSchemaProperties: boolean | undefined\n}>()\n</script>\n<template>\n <SchemaProperty\n v-if=\"'schema' in header && header.schema\"\n :breadcrumb=\"breadcrumb ? [...breadcrumb, 'headers'] : undefined\"\n :description=\"header.description\"\n :eventBus=\"eventBus\"\n :name=\"name\"\n :options=\"{\n orderRequiredPropertiesFirst: orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: orderSchemaPropertiesBy,\n expandAllSchemaProperties: expandAllSchemaProperties,\n document,\n }\"\n :schema=\"getResolvedRef(header.schema)\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;sBAgCsB,QAAA,UAAU,QAAA,OAAO,UAAA,WAAA,EADrC,YAY4C,wBAAA;;IAVzC,YAAY,QAAA,aAAU,CAAA,GAAO,QAAA,YAAU,UAAA,GAAe,KAAA;IACtD,aAAa,QAAA,OAAO;IACpB,UAAU,QAAA;IACV,MAAM,QAAA;IACN,SAAO;mCAAwC,QAAA;8BAA6D,QAAA;gCAA0D,QAAA;eAAiC,QAAA;;IAMvM,QAAQ,MAAA,eAAc,CAAC,QAAA,OAAO,OAAM"}
@@ -1,11 +1,14 @@
1
1
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
- import type { HeaderObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ import type { HeaderObject, OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
3
  type __VLS_Props = {
4
4
  headers: Record<string, HeaderObject>;
5
5
  breadcrumb?: string[];
6
6
  eventBus: WorkspaceEventBus | null;
7
+ /** The document the headers belong to, used to resolve schema references for display */
8
+ document?: OpenApiDocument;
7
9
  orderRequiredPropertiesFirst: boolean | undefined;
8
10
  orderSchemaPropertiesBy: 'alpha' | 'preserve' | undefined;
11
+ expandAllSchemaProperties: boolean | undefined;
9
12
  };
10
13
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
14
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"Headers.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/Headers.vue"],"names":[],"mappings":"AA8HA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAIhG,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACrC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,4BAA4B,EAAE,OAAO,GAAG,SAAS,CAAA;IACjD,uBAAuB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;CAC1D,CAAC;AA2JF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Headers.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/Headers.vue"],"names":[],"mappings":"AAsIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAChB,MAAM,8DAA8D,CAAA;AAIrE,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACrC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,wFAAwF;IACxF,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B,4BAA4B,EAAE,OAAO,GAAG,SAAS,CAAA;IACjD,uBAAuB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;IACzD,yBAAyB,EAAE,OAAO,GAAG,SAAS,CAAA;CAC/C,CAAC;AA+JF,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 Headers_vue_vue_type_script_setup_true_lang_default from "./Headers.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/features/Operation/components/Headers.vue
5
- var Headers_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Headers_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-c4fe6aa2"]]);
5
+ var Headers_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Headers_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-4a9699e9"]]);
6
6
  //#endregion
7
7
  export { Headers_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"Headers.vue.js","names":[],"sources":["../../../../src/features/Operation/components/Headers.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { HeaderObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport Header from './Header.vue'\n\nconst { headers, breadcrumb } = defineProps<{\n headers: Record<string, HeaderObject>\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n orderRequiredPropertiesFirst: boolean | undefined\n orderSchemaPropertiesBy: 'alpha' | 'preserve' | undefined\n}>()\n</script>\n<template>\n <Disclosure v-slot=\"{ open }\">\n <div\n class=\"headers-card headers-card--compact\"\n :class=\"[{ 'headers-card--open': open }]\">\n <div\n class=\"headers-properties\"\n :class=\"{ 'headers-properties-open': open }\">\n <DisclosureButton\n class=\"headers-card-title headers-card-title--compact\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset)))`,\n }\">\n <ScalarIcon\n class=\"headers-card-title-icon\"\n :class=\"{ 'headers-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\"> Hide Headers </template>\n <template v-else> Show Headers </template>\n </DisclosureButton>\n <DisclosurePanel>\n <template\n v-for=\"(header, key) in headers\"\n :key=\"key\">\n <Header\n :breadcrumb=\"breadcrumb ? [...breadcrumb, 'headers'] : undefined\"\n :eventBus=\"eventBus\"\n :header=\"getResolvedRef(header)\"\n :name=\"key\"\n :orderRequiredPropertiesFirst=\"orderRequiredPropertiesFirst\"\n :orderSchemaPropertiesBy=\"orderSchemaPropertiesBy\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.headers-card {\n z-index: 0;\n margin-top: 12px;\n margin-bottom: 6px;\n position: relative;\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n\n align-self: flex-start;\n}\n.headers-card.headers-card--open {\n align-self: initial;\n}\n.headers-card-title {\n padding: 6px 10px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-3);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-micro);\n\n border-radius: 13.5px;\n}\nbutton.headers-card-title {\n cursor: pointer;\n}\nbutton.headers-card-title:hover {\n color: var(--scalar-color-1);\n}\n.headers-card-title-icon--open {\n transform: rotate(45deg);\n}\n.headers-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n\n border-radius: 13.5px;\n width: fit-content;\n}\n.headers-properties-open > .headers-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.headers-properties-open {\n border-radius: var(--scalar-radius-lg);\n width: 100%;\n}\n.headers-card .property:last-of-type {\n padding-bottom: 10px;\n}\n.headers-card-title > .headers-card-title-icon {\n width: 14px;\n height: 14px;\n margin: 0;\n}\n.headers-card-title > .headers-card-title-icon--open {\n transform: rotate(45deg);\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"Headers.vue.js","names":[],"sources":["../../../../src/features/Operation/components/Headers.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n HeaderObject,\n OpenApiDocument,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport Header from './Header.vue'\n\nconst { headers, breadcrumb } = defineProps<{\n headers: Record<string, HeaderObject>\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n /** The document the headers belong to, used to resolve schema references for display */\n document?: OpenApiDocument\n orderRequiredPropertiesFirst: boolean | undefined\n orderSchemaPropertiesBy: 'alpha' | 'preserve' | undefined\n expandAllSchemaProperties: boolean | undefined\n}>()\n</script>\n<template>\n <Disclosure v-slot=\"{ open }\">\n <div\n class=\"headers-card headers-card--compact\"\n :class=\"[{ 'headers-card--open': open }]\">\n <div\n class=\"headers-properties\"\n :class=\"{ 'headers-properties-open': open }\">\n <DisclosureButton\n class=\"headers-card-title headers-card-title--compact\"\n :style=\"{\n top: `calc(var(--refs-viewport-offset)))`,\n }\">\n <ScalarIcon\n class=\"headers-card-title-icon\"\n :class=\"{ 'headers-card-title-icon--open': open }\"\n icon=\"Add\"\n size=\"sm\" />\n <template v-if=\"open\"> Hide Headers </template>\n <template v-else> Show Headers </template>\n </DisclosureButton>\n <DisclosurePanel>\n <template\n v-for=\"(header, key) in headers\"\n :key=\"key\">\n <Header\n :breadcrumb=\"breadcrumb ? [...breadcrumb, 'headers'] : undefined\"\n :document=\"document\"\n :eventBus=\"eventBus\"\n :header=\"getResolvedRef(header)\"\n :name=\"key\"\n :orderRequiredPropertiesFirst=\"orderRequiredPropertiesFirst\"\n :orderSchemaPropertiesBy=\"orderSchemaPropertiesBy\"\n :expandAllSchemaProperties=\"expandAllSchemaProperties\" />\n </template>\n </DisclosurePanel>\n </div>\n </div>\n </Disclosure>\n</template>\n<style scoped>\n.headers-card {\n z-index: 0;\n margin-top: 12px;\n margin-bottom: 6px;\n position: relative;\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n\n align-self: flex-start;\n}\n.headers-card.headers-card--open {\n align-self: initial;\n}\n.headers-card-title {\n padding: 6px 10px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-3);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-micro);\n\n border-radius: 13.5px;\n}\nbutton.headers-card-title {\n cursor: pointer;\n}\nbutton.headers-card-title:hover {\n color: var(--scalar-color-1);\n}\n.headers-card-title-icon--open {\n transform: rotate(45deg);\n}\n.headers-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n\n border-radius: 13.5px;\n width: fit-content;\n}\n.headers-properties-open > .headers-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.headers-properties-open {\n border-radius: var(--scalar-radius-lg);\n width: 100%;\n}\n.headers-card .property:last-of-type {\n padding-bottom: 10px;\n}\n.headers-card-title > .headers-card-title-icon {\n width: 14px;\n height: 14px;\n margin: 0;\n}\n.headers-card-title > .headers-card-title-icon--open {\n transform: rotate(45deg);\n}\n</style>\n"],"mappings":""}