@scalar/api-reference 1.62.9 → 1.64.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 (261) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +1 -1
  3. package/dist/blocks/index.d.ts +1 -0
  4. package/dist/blocks/index.d.ts.map +1 -1
  5. package/dist/blocks/index.js +3 -1
  6. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
  7. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
  8. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js.map +1 -1
  9. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js.map +1 -1
  10. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.d.ts.map +1 -1
  11. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js +1 -1
  12. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js.map +1 -1
  13. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js.map +1 -1
  14. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.d.ts.map +1 -1
  15. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.js +1 -1
  16. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.js.map +1 -1
  17. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.script.js +4 -4
  18. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.script.js.map +1 -1
  19. package/dist/browser/chunks/AgentScalarChatInterface-C8lX3RCo.js +27 -0
  20. package/dist/browser/chunks/ScalarTextInput.vue-Xf60Nwf-.js +27 -0
  21. package/dist/browser/chunks/basic-shape-diamond.svg-BTEOT1FL.js +1 -1
  22. package/dist/browser/chunks/basic-shape-hexagon.svg-BSPzaCgF.js +1 -1
  23. package/dist/browser/chunks/basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js +1 -1
  24. package/dist/browser/chunks/basic-shape-primary-square-rectangle.svg-n2YRykHD.js +1 -1
  25. package/dist/browser/chunks/basic-shape-shield.svg-Bec9cJDA.js +1 -1
  26. package/dist/browser/chunks/browser-67K6wmG9.js +1 -1
  27. package/dist/browser/chunks/computer-device-desktop-monitor.svg-m6j893Hb.js +1 -1
  28. package/dist/browser/chunks/computer-device-desktop.svg-Dk1VVO7k.js +1 -1
  29. package/dist/browser/chunks/computer-device-laptop.svg-BNGVUCYS.js +1 -1
  30. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung-back.svg-CC4UUTFw.js +1 -1
  31. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js +1 -1
  32. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x-back.svg-CLm7sgMM.js +1 -1
  33. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x.svg-Xrttg6_7.js +1 -1
  34. package/dist/browser/chunks/computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js +1 -1
  35. package/dist/browser/chunks/computer-device-mobile-tablet.svg-DCr0XlRc.js +1 -1
  36. package/dist/browser/chunks/computer-device-network-ethernet-cat6.svg-AK9l0iOl.js +1 -1
  37. package/dist/browser/chunks/computer-device-network-lan-www.svg-gUIdFBlE.js +1 -1
  38. package/dist/browser/chunks/computer-device-network-wifi-connection.svg-Be-EMm4e.js +1 -1
  39. package/dist/browser/chunks/computer-device-network-wifi-router.svg-Dc2VzyqK.js +1 -1
  40. package/dist/browser/chunks/ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js +1 -1
  41. package/dist/browser/chunks/image-flash-lightning.svg-EETR_y1q.js +1 -1
  42. package/dist/browser/chunks/image-picture-flower.svg-DN1AYzJU.js +1 -1
  43. package/dist/browser/chunks/interface-alert-exclamation-diamond.svg-C5NozMV_.js +1 -1
  44. package/dist/browser/chunks/interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js +1 -1
  45. package/dist/browser/chunks/interface-alert-information-circle.svg-ckkkt9Mv.js +1 -1
  46. package/dist/browser/chunks/interface-award-crown.svg-pjvn9hY-.js +1 -1
  47. package/dist/browser/chunks/interface-bookmark-tag.svg-r2r-lQq4.js +1 -1
  48. package/dist/browser/chunks/interface-bookmark.svg-BK9HKQBT.js +1 -1
  49. package/dist/browser/chunks/interface-calendar-date-one.svg-DNnF0M1I.js +1 -1
  50. package/dist/browser/chunks/interface-content-book-open-pages.svg-CQj_w9Vp.js +1 -1
  51. package/dist/browser/chunks/interface-content-book-page.svg-DppoeJRe.js +1 -1
  52. package/dist/browser/chunks/interface-content-file.svg-CvcD7OiY.js +1 -1
  53. package/dist/browser/chunks/interface-content-folder.svg-BmtS5I9A.js +1 -1
  54. package/dist/browser/chunks/interface-copy-clipboard.svg-Be6EI50X.js +1 -1
  55. package/dist/browser/chunks/interface-edit-attachment.svg-G5TKzpWX.js +1 -1
  56. package/dist/browser/chunks/interface-edit-binocular.svg-jzL-DvGB.js +1 -1
  57. package/dist/browser/chunks/interface-edit-magic-wand.svg-BOTlymvp.js +1 -1
  58. package/dist/browser/chunks/interface-edit-tool-paint-roller.svg-s9dwryx7.js +1 -1
  59. package/dist/browser/chunks/interface-edit-tool-pencil.svg-C7v0dbB3.js +1 -1
  60. package/dist/browser/chunks/interface-favorite-award.svg-CYHUgUG0.js +1 -1
  61. package/dist/browser/chunks/interface-favorite-flag.svg-C10zlKOb.js +1 -1
  62. package/dist/browser/chunks/interface-favorite-heart.svg-eoduXxlz.js +1 -1
  63. package/dist/browser/chunks/interface-favorite-star.svg-BSmxJetr.js +1 -1
  64. package/dist/browser/chunks/interface-favorite-stars-sparkles.svg-JTFLj3Ls.js +1 -1
  65. package/dist/browser/chunks/interface-hierarchy-flowchart.svg-Cg_Wy0kN.js +1 -1
  66. package/dist/browser/chunks/interface-home-house.svg-DytoGRnv.js +1 -1
  67. package/dist/browser/chunks/interface-hyperlink.svg-CuEfmmQI.js +1 -1
  68. package/dist/browser/chunks/interface-lighting-brightness.svg-DSK0h_Pa.js +1 -1
  69. package/dist/browser/chunks/interface-lock-closed.svg-Cn6TaLYv.js +1 -1
  70. package/dist/browser/chunks/interface-lock-open-unlock.svg-CVkG5-9W.js +1 -1
  71. package/dist/browser/chunks/interface-login-key.svg-y-cwwXjN.js +1 -1
  72. package/dist/browser/chunks/interface-search.svg-S-puVFJB.js +1 -1
  73. package/dist/browser/chunks/interface-setting-cog.svg-CTH4_lLg.js +1 -1
  74. package/dist/browser/chunks/interface-share-megaphone-bullhorn.svg-Pbp39MyC.js +1 -1
  75. package/dist/browser/chunks/interface-share-rocket.svg-BgCsIRZO.js +1 -1
  76. package/dist/browser/chunks/interface-share-satellite.svg-DAMN9d5G.js +1 -1
  77. package/dist/browser/chunks/interface-share-space-ship.svg-Dt-Mejxk.js +1 -1
  78. package/dist/browser/chunks/interface-share.svg-vFYTXSti.js +1 -1
  79. package/dist/browser/chunks/interface-signal-square.svg-DNG4LpAe.js +1 -1
  80. package/dist/browser/chunks/interface-time-clock-circle.svg-Bpz-nLxo.js +1 -1
  81. package/dist/browser/chunks/interface-time-hour-glass.svg-D7agfKsH.js +1 -1
  82. package/dist/browser/chunks/interface-users-multiple.svg-CkPJBBnG.js +1 -1
  83. package/dist/browser/chunks/interface-weather-moon.svg-CaTZFMPO.js +1 -1
  84. package/dist/browser/chunks/mail-chat-bubble-square.svg-DC8RIihp.js +1 -1
  85. package/dist/browser/chunks/mail-send-email-paper-airplane.svg-D8OLs9jz.js +1 -1
  86. package/dist/browser/chunks/mail-send-envelope.svg-CV33h5Sx.js +1 -1
  87. package/dist/browser/chunks/{modal-BVUfMpuv.js → modal-B8Opb61-.js} +2 -2
  88. package/dist/browser/chunks/modal-Dcl-Y2Zk.js +99 -0
  89. package/dist/browser/chunks/money-cashier-receipt.svg-CJL8C2gs.js +1 -1
  90. package/dist/browser/chunks/money-currency-dollar-pay.svg-VdBplCTx.js +1 -1
  91. package/dist/browser/chunks/money-graph-arrow-increase.svg-DcRov3zk.js +1 -1
  92. package/dist/browser/chunks/money-graph-bar-chart-increase.svg-Cc7KxjX-.js +1 -1
  93. package/dist/browser/chunks/nature-ecology-leaf.svg-DR3cTZxt.js +1 -1
  94. package/dist/browser/chunks/phone-telephone.svg-DyY0gUlk.js +1 -1
  95. package/dist/browser/chunks/programming-bug.svg-BHLT-Qhp.js +1 -1
  96. package/dist/browser/chunks/programming-cloud.svg-B6YW33ba.js +1 -1
  97. package/dist/browser/chunks/programming-computer-database-server.svg-B6o5Sdn-.js +1 -1
  98. package/dist/browser/chunks/programming-computer-database.svg-Cl7OVtpJ.js +1 -1
  99. package/dist/browser/chunks/programming-module-four-layout.svg-BQrerL1x.js +1 -1
  100. package/dist/browser/chunks/programming-module-three.svg-B2KTQzBM.js +1 -1
  101. package/dist/browser/chunks/programming-module.svg-CiID7kPm.js +1 -1
  102. package/dist/browser/chunks/programming-script-code.svg-D1M5rtkN.js +1 -1
  103. package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +1 -1
  104. package/dist/browser/chunks/shopping-cart.svg-BEegiIR9.js +1 -1
  105. package/dist/browser/chunks/shopping-gift-present.svg-BUHwuLix.js +1 -1
  106. package/dist/browser/chunks/shopping-shipping-box-parcel-package.svg-D6fxWdYx.js +1 -1
  107. package/dist/browser/chunks/tag-new-circle.svg-jsg1bGs0.js +1 -1
  108. package/dist/browser/chunks/travel-map-earth-globe.svg-ClbMiU-f.js +1 -1
  109. package/dist/browser/chunks/vendor-CBP43oHJ.js +306 -0
  110. package/dist/browser/standalone.esm.js +24 -24
  111. package/dist/browser/standalone.js +308 -308
  112. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  113. package/dist/components/ApiReference.vue.js +1 -1
  114. package/dist/components/ApiReference.vue.js.map +1 -1
  115. package/dist/components/ApiReference.vue.script.js +94 -19
  116. package/dist/components/ApiReference.vue.script.js.map +1 -1
  117. package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
  118. package/dist/components/Badge/Badge.vue.js +1 -1
  119. package/dist/components/Badge/Badge.vue.js.map +1 -1
  120. package/dist/components/Badge/Badge.vue.script.js +8 -8
  121. package/dist/components/Badge/Badge.vue.script.js.map +1 -1
  122. package/dist/components/Content/AsyncApi/Operation.vue.d.ts.map +1 -1
  123. package/dist/components/Content/AsyncApi/Operation.vue.js +1 -1
  124. package/dist/components/Content/AsyncApi/Operation.vue.js.map +1 -1
  125. package/dist/components/Content/AsyncApi/Operation.vue.script.js +5 -0
  126. package/dist/components/Content/AsyncApi/Operation.vue.script.js.map +1 -1
  127. package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.d.ts +17 -0
  128. package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.d.ts.map +1 -0
  129. package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.js +21 -0
  130. package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.js.map +1 -0
  131. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  132. package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
  133. package/dist/components/Content/Schema/SchemaComposition.vue.script.js +68 -33
  134. package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
  135. package/dist/components/Content/Schema/SchemaEnums.vue.d.ts.map +1 -1
  136. package/dist/components/Content/Schema/SchemaEnums.vue.js +1 -1
  137. package/dist/components/Content/Schema/SchemaEnums.vue.js.map +1 -1
  138. package/dist/components/Content/Schema/SchemaEnums.vue.script.js +15 -7
  139. package/dist/components/Content/Schema/SchemaEnums.vue.script.js.map +1 -1
  140. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  141. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  142. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js.map +1 -1
  143. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +30 -20
  144. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -1
  145. package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts.map +1 -1
  146. package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +1 -4
  147. package/dist/components/Content/Schema/helpers/optimize-value-for-display.js.map +1 -1
  148. package/dist/components/Content/Schema/helpers/partition-all-of-compositions.d.ts +32 -0
  149. package/dist/components/Content/Schema/helpers/partition-all-of-compositions.d.ts.map +1 -0
  150. package/dist/components/Content/Schema/helpers/partition-all-of-compositions.js +97 -0
  151. package/dist/components/Content/Schema/helpers/partition-all-of-compositions.js.map +1 -0
  152. package/dist/components/LinkList/LinkList.vue.js +1 -1
  153. package/dist/components/LinkList/LinkList.vue.js.map +1 -1
  154. package/dist/components/LinkList/LinkList.vue.script.js +1 -1
  155. package/dist/components/LinkList/LinkList.vue.script.js.map +1 -1
  156. package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
  157. package/dist/components/Section/CompactSection.vue.js +1 -1
  158. package/dist/components/Section/CompactSection.vue.js.map +1 -1
  159. package/dist/components/Section/CompactSection.vue.script.js +21 -5
  160. package/dist/components/Section/CompactSection.vue.script.js.map +1 -1
  161. package/dist/components/Section/SectionHeader.vue.d.ts.map +1 -1
  162. package/dist/components/Section/SectionHeader.vue.js +1 -1
  163. package/dist/components/Section/SectionHeader.vue.js.map +1 -1
  164. package/dist/components/Section/SectionHeader.vue.script.js +1 -1
  165. package/dist/components/Section/SectionHeader.vue.script.js.map +1 -1
  166. package/dist/features/Operation/Operation.vue.script.js +1 -1
  167. package/dist/features/Operation/components/OperationScopes.vue.d.ts +8 -0
  168. package/dist/features/Operation/components/OperationScopes.vue.d.ts.map +1 -0
  169. package/dist/features/Operation/components/OperationScopes.vue.js +7 -0
  170. package/dist/features/Operation/components/OperationScopes.vue.js.map +1 -0
  171. package/dist/features/Operation/components/OperationScopes.vue.script.js +60 -0
  172. package/dist/features/Operation/components/OperationScopes.vue.script.js.map +1 -0
  173. package/dist/features/Operation/components/SecurityRequirementBadge.vue.d.ts.map +1 -1
  174. package/dist/features/Operation/components/SecurityRequirementBadge.vue.js.map +1 -1
  175. package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js +89 -16
  176. package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js.map +1 -1
  177. package/dist/features/Operation/helpers/get-required-security.d.ts +13 -0
  178. package/dist/features/Operation/helpers/get-required-security.d.ts.map +1 -1
  179. package/dist/features/Operation/helpers/get-required-security.js +22 -1
  180. package/dist/features/Operation/helpers/get-required-security.js.map +1 -1
  181. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +1 -1
  182. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  183. package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
  184. package/dist/features/Operation/layouts/ClassicLayout.vue.js.map +1 -1
  185. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +15 -6
  186. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -1
  187. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  188. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  189. package/dist/features/Operation/layouts/ModernLayout.vue.js.map +1 -1
  190. package/dist/features/Operation/layouts/ModernLayout.vue.script.js +2 -0
  191. package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
  192. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.d.ts +2 -2
  193. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js +1 -1
  194. package/dist/features/external-docs/ExternalDocs.vue.d.ts.map +1 -1
  195. package/dist/features/external-docs/ExternalDocs.vue.js.map +1 -1
  196. package/dist/features/external-docs/ExternalDocs.vue.script.js +6 -6
  197. package/dist/features/external-docs/ExternalDocs.vue.script.js.map +1 -1
  198. package/dist/features/info-object/Contact.vue.d.ts.map +1 -1
  199. package/dist/features/info-object/Contact.vue.js.map +1 -1
  200. package/dist/features/info-object/Contact.vue.script.js +8 -8
  201. package/dist/features/info-object/Contact.vue.script.js.map +1 -1
  202. package/dist/features/info-object/InfoLink.vue.d.ts.map +1 -1
  203. package/dist/features/info-object/InfoLink.vue.js.map +1 -1
  204. package/dist/features/info-object/InfoLink.vue.script.js +6 -6
  205. package/dist/features/info-object/InfoLink.vue.script.js.map +1 -1
  206. package/dist/features/info-object/License.vue.d.ts.map +1 -1
  207. package/dist/features/info-object/License.vue.js.map +1 -1
  208. package/dist/features/info-object/License.vue.script.js +2 -2
  209. package/dist/features/info-object/License.vue.script.js.map +1 -1
  210. package/dist/features/info-object/TermsOfService.vue.d.ts.map +1 -1
  211. package/dist/features/info-object/TermsOfService.vue.js.map +1 -1
  212. package/dist/features/info-object/TermsOfService.vue.script.js +2 -2
  213. package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -1
  214. package/dist/features/localization/locales/ar.d.ts +1 -0
  215. package/dist/features/localization/locales/ar.d.ts.map +1 -1
  216. package/dist/features/localization/locales/ar.js +2 -1
  217. package/dist/features/localization/locales/ar.js.map +1 -1
  218. package/dist/features/localization/locales/de.d.ts +1 -0
  219. package/dist/features/localization/locales/de.d.ts.map +1 -1
  220. package/dist/features/localization/locales/de.js +2 -1
  221. package/dist/features/localization/locales/de.js.map +1 -1
  222. package/dist/features/localization/locales/en.d.ts +1 -0
  223. package/dist/features/localization/locales/en.d.ts.map +1 -1
  224. package/dist/features/localization/locales/en.js +2 -1
  225. package/dist/features/localization/locales/en.js.map +1 -1
  226. package/dist/features/localization/locales/es.d.ts +1 -0
  227. package/dist/features/localization/locales/es.d.ts.map +1 -1
  228. package/dist/features/localization/locales/es.js +2 -1
  229. package/dist/features/localization/locales/es.js.map +1 -1
  230. package/dist/features/localization/locales/fr.d.ts +1 -0
  231. package/dist/features/localization/locales/fr.d.ts.map +1 -1
  232. package/dist/features/localization/locales/fr.js +2 -1
  233. package/dist/features/localization/locales/fr.js.map +1 -1
  234. package/dist/features/localization/locales/ru.d.ts +1 -0
  235. package/dist/features/localization/locales/ru.d.ts.map +1 -1
  236. package/dist/features/localization/locales/ru.js +2 -1
  237. package/dist/features/localization/locales/ru.js.map +1 -1
  238. package/dist/features/localization/locales/zh-cn.d.ts +1 -0
  239. package/dist/features/localization/locales/zh-cn.d.ts.map +1 -1
  240. package/dist/features/localization/locales/zh-cn.js +2 -1
  241. package/dist/features/localization/locales/zh-cn.js.map +1 -1
  242. package/dist/features/localization/translations.d.ts +7 -0
  243. package/dist/features/localization/translations.d.ts.map +1 -1
  244. package/dist/helpers/storage.d.ts +21 -2
  245. package/dist/helpers/storage.d.ts.map +1 -1
  246. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  247. package/dist/standalone/lib/html-api.js +11 -4
  248. package/dist/standalone/lib/html-api.js.map +1 -1
  249. package/dist/standalone/lib/load-plugins-from-urls.d.ts +13 -0
  250. package/dist/standalone/lib/load-plugins-from-urls.d.ts.map +1 -0
  251. package/dist/standalone/lib/load-plugins-from-urls.js +60 -0
  252. package/dist/standalone/lib/load-plugins-from-urls.js.map +1 -0
  253. package/dist/style.css +389 -351
  254. package/dist/styles/print.css +118 -0
  255. package/dist/styles/tailwind.config.css +16 -0
  256. package/dist/vue-styles.css +198 -224
  257. package/package.json +15 -15
  258. package/dist/browser/chunks/AgentScalarChatInterface-YU9KKgvZ.js +0 -27
  259. package/dist/browser/chunks/ScalarTextInput.vue-B-Nhpn0q.js +0 -27
  260. package/dist/browser/chunks/modal-WJ4Gcv8N.js +0 -99
  261. package/dist/browser/chunks/vendor-BqFs9NIb.js +0 -306
@@ -42,6 +42,12 @@ var _hoisted_8 = {
42
42
  key: 9,
43
43
  class: "property-required"
44
44
  };
45
+ /**
46
+ * Constraints that live on a leaf (string or number) schema: length, pattern,
47
+ * format and numeric ranges. Extracted so they can be surfaced for a primitive
48
+ * schema as well as for a primitive array's items, which are not rendered on
49
+ * their own. See https://github.com/scalar/scalar/issues/9690
50
+ */
45
51
  var SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
46
52
  __name: "SchemaPropertyHeading",
47
53
  props: {
@@ -83,20 +89,8 @@ var SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default = /* @__PU
83
89
  if (items.enum?.length === 1) return items.enum[0];
84
90
  }
85
91
  });
86
- const validationProperties = computed(() => {
87
- if (!valueRef.value) return [];
88
- const schema = valueRef.value;
92
+ const getLeafConstraints = (schema) => {
89
93
  const properties = [];
90
- if (isArraySchema(schema)) {
91
- if (schema.minItems || schema.maxItems) properties.push({
92
- key: "array-range",
93
- value: `${schema.minItems || ""}…${schema.maxItems || ""}`
94
- });
95
- if (schema.uniqueItems) properties.push({
96
- key: "unique-items",
97
- value: `${translate("common.unique")}!`
98
- });
99
- }
100
94
  if (isStringSchema(schema)) {
101
95
  if (schema.minLength) properties.push({
102
96
  key: "min-length",
@@ -115,13 +109,11 @@ var SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default = /* @__PU
115
109
  truncate: true
116
110
  });
117
111
  }
118
- if (isStringSchema(schema) || isNumberSchema(schema)) {
119
- if (schema.format) properties.push({
120
- key: "format",
121
- value: schema.format,
122
- truncate: true
123
- });
124
- }
112
+ if ((isStringSchema(schema) || isNumberSchema(schema)) && schema.format) properties.push({
113
+ key: "format",
114
+ value: schema.format,
115
+ truncate: true
116
+ });
125
117
  if (isNumberSchema(schema)) {
126
118
  if (isDefined(schema.exclusiveMinimum)) properties.push({
127
119
  key: "exclusive-minimum",
@@ -150,6 +142,24 @@ var SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default = /* @__PU
150
142
  });
151
143
  }
152
144
  return properties;
145
+ };
146
+ const validationProperties = computed(() => {
147
+ if (!valueRef.value) return [];
148
+ const schema = valueRef.value;
149
+ const properties = [];
150
+ if (isArraySchema(schema)) {
151
+ if (schema.minItems || schema.maxItems) properties.push({
152
+ key: "array-range",
153
+ value: `${schema.minItems || ""}…${schema.maxItems || ""}`
154
+ });
155
+ if (schema.uniqueItems) properties.push({
156
+ key: "unique-items",
157
+ value: `${translate("common.unique")}!`
158
+ });
159
+ }
160
+ properties.push(...getLeafConstraints(schema));
161
+ if (isArraySchema(schema) && schema.items) properties.push(...getLeafConstraints(resolve.schema(schema.items)));
162
+ return properties;
153
163
  });
154
164
  /** Link data for navigating to the referenced model in the sidebar. */
155
165
  const modelLink = computed(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaPropertyHeading.vue.script.js","names":["$slots"],"sources":["../../../../src/components/Content/Schema/SchemaPropertyHeading.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport {\n isArraySchema,\n isNumberSchema,\n isStringSchema,\n} from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, toRef } from 'vue'\n\nimport { Badge } from '@/components/Badge'\nimport LinkButton from '@/components/Content/Schema/LinkButton.vue'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport RenderString from './RenderString.vue'\nimport SchemaPropertyDefault from './SchemaPropertyDefault.vue'\nimport SchemaPropertyDetail from './SchemaPropertyDetail.vue'\nimport SchemaPropertyExamples from './SchemaPropertyExamples.vue'\n\nconst props = withDefaults(\n defineProps<{\n value: SchemaObject | undefined\n enum?: boolean\n isDiscriminator?: boolean\n required?: boolean\n additional?: boolean\n withExamples?: boolean\n hideModelNames?: boolean\n /** When the schema was resolved from a $ref, pass the ref name so it displays as e.g. \"Data\" instead of \"object\". */\n modelName?: string | null\n /** Resolved propertyNames schema, used to surface key constraints like `format` for additional properties. */\n propertyNames?: SchemaObject\n eventBus?: WorkspaceEventBus | null\n }>(),\n {\n isDiscriminator: false,\n required: false,\n withExamples: true,\n hideModelNames: false,\n eventBus: null,\n },\n)\nconst { translate } = useLocalization()\n\n// Convert to reactive refs for composables\nconst valueRef = toRef(props, 'value')\n\nconst constValue = computed(() => {\n if (!valueRef.value) {\n return undefined\n }\n\n const schema = valueRef.value\n\n // Direct const value\n if (schema.const !== undefined) {\n return schema.const\n }\n\n // Single-item enum acts as const\n if (schema.enum?.length === 1) {\n return schema.enum[0]\n }\n\n // Check items for const values (for arrays)\n if (isArraySchema(schema) && schema.items) {\n const items = resolve.schema(schema.items)\n\n if (isDefined(items.const)) {\n return items.const\n }\n\n if (items.enum?.length === 1) {\n return items.enum[0]\n }\n }\n\n return undefined\n})\n\nconst validationProperties = computed(() => {\n if (!valueRef.value) {\n return []\n }\n\n const schema = valueRef.value\n const properties = []\n\n // Array validation properties\n if (isArraySchema(schema)) {\n if (schema.minItems || schema.maxItems) {\n properties.push({\n key: 'array-range',\n value: `${schema.minItems || ''}…${schema.maxItems || ''}`,\n })\n }\n\n // Unique items\n if (schema.uniqueItems) {\n properties.push({\n key: 'unique-items',\n value: `${translate('common.unique')}!`,\n })\n }\n }\n\n // String length properties\n if (isStringSchema(schema)) {\n if (schema.minLength) {\n properties.push({\n key: 'min-length',\n prefix: `${translate('common.minLength')}: `,\n value: schema.minLength,\n })\n }\n\n if (schema.maxLength) {\n properties.push({\n key: 'max-length',\n prefix: `${translate('common.maxLength')}: `,\n value: schema.maxLength,\n })\n }\n\n // Pattern\n if (schema.pattern) {\n properties.push({\n key: 'pattern',\n value: schema.pattern,\n code: true,\n truncate: true,\n })\n }\n }\n\n // Format\n if (isStringSchema(schema) || isNumberSchema(schema)) {\n if (schema.format) {\n properties.push({\n key: 'format',\n value: schema.format,\n truncate: true,\n })\n }\n }\n\n // Numeric validation properties\n if (isNumberSchema(schema)) {\n if (isDefined(schema.exclusiveMinimum)) {\n properties.push({\n key: 'exclusive-minimum',\n prefix: `${translate('common.greaterThan')}: `,\n value: schema.exclusiveMinimum,\n })\n }\n\n if (isDefined(schema.minimum)) {\n properties.push({\n key: 'minimum',\n prefix: `${translate('common.min')}: `,\n value: schema.minimum,\n })\n }\n\n if (isDefined(schema.exclusiveMaximum)) {\n properties.push({\n key: 'exclusive-maximum',\n prefix: `${translate('common.lessThan')}: `,\n value: schema.exclusiveMaximum,\n })\n }\n\n if (isDefined(schema.maximum)) {\n properties.push({\n key: 'maximum',\n prefix: `${translate('common.max')}: `,\n value: schema.maximum,\n })\n }\n\n if (isDefined(schema.multipleOf)) {\n properties.push({\n key: 'multiple-of',\n prefix: `${translate('common.multipleOf')}: `,\n value: schema.multipleOf,\n })\n }\n }\n\n return properties\n})\n\n/** Link data for navigating to the referenced model in the sidebar. */\nconst modelLink = computed(() => {\n if (!props.value) {\n return null\n }\n\n if (props.hideModelNames) {\n return null\n }\n\n if (props.modelName) {\n return { schemaKey: props.modelName, label: props.modelName }\n }\n\n const modelName = getModelNameFromSchema(props.value)\n if (modelName) {\n return { schemaKey: modelName.schemaKey, label: modelName.label }\n }\n\n if (isArraySchema(props.value) && props.value.items) {\n const itemName = getModelNameFromSchema(props.value.items)\n return itemName\n ? { schemaKey: itemName.schemaKey, label: `${itemName.label}[]` }\n : null\n }\n\n return null\n})\n\n/** Check if we should show the type information */\nconst shouldShowType = computed(() => {\n if (!props.value || !('type' in props.value)) {\n return false\n }\n\n // Always show type for arrays, even when items have const values\n if (props.value.type === 'array') {\n return true\n }\n\n // For non-arrays, only show if no const value at the schema level\n return !constValue.value\n})\n\n/** Get the display type */\nconst displayType = computed(() => {\n if (!props.value) {\n return ''\n }\n return getSchemaType(props.value)\n})\n\n/**\n * Type and format of the property keys, derived from the propertyNames schema.\n *\n * For a map keyed by UUIDs this renders e.g. \"string · uuid\" so the key\n * constraints are not lost. Returns undefined when there is nothing to show.\n */\nconst propertyNamesDetail = computed(() => {\n const schema = props.propertyNames\n if (!schema) {\n return undefined\n }\n\n const parts = [getSchemaType(schema)]\n if ('format' in schema && typeof schema.format === 'string') {\n parts.push(schema.format)\n }\n\n const detail = parts.filter(Boolean).join(' · ')\n return detail.length > 0 ? detail : undefined\n})\n\nconst exampleValue = computed(() => {\n // Treat only `undefined` as \"not set\" — `null` is a valid example value on a nullable schema.\n if (\n props.value &&\n 'example' in props.value &&\n props.value.example !== undefined\n ) {\n return props.value.example\n }\n\n if (props.value && isArraySchema(props.value)) {\n const itemsSchema = resolve.schema(props.value.items)\n if (\n itemsSchema &&\n 'example' in itemsSchema &&\n itemsSchema.example !== undefined\n ) {\n return itemsSchema.example\n }\n }\n\n return undefined\n})\n</script>\n<template>\n <div class=\"property-heading\">\n <div\n v-if=\"$slots.name\"\n class=\"property-name\"\n :class=\"{ deprecated: props.value?.deprecated }\">\n <slot name=\"name\" />\n </div>\n <div\n v-if=\"props.isDiscriminator\"\n class=\"property-discriminator\">\n {{ translate('common.discriminator') }}\n </div>\n <template v-if=\"props.value\">\n <!-- Type information -->\n <SchemaPropertyDetail\n v-if=\"shouldShowType\"\n truncate>\n <ScreenReader>{{ translate('common.type') }}:</ScreenReader>\n {{ displayType }}\n <template v-if=\"modelLink\">\n ·\n <LinkButton\n v-if=\"props.eventBus && modelLink.schemaKey\"\n @click=\"\n props.eventBus.emit('scroll-to:model-by-name', {\n name: modelLink.schemaKey,\n })\n \">\n {{ modelLink.label }}\n </LinkButton>\n <template v-else>{{ modelLink.label }}</template>\n </template>\n </SchemaPropertyDetail>\n\n <!-- Key constraints from propertyNames (e.g. \"keys: string · uuid\") -->\n <SchemaPropertyDetail\n v-if=\"propertyNamesDetail\"\n truncate>\n <template #prefix>{{ translate('common.keys') }}:</template>\n {{ propertyNamesDetail }}\n </SchemaPropertyDetail>\n\n <!-- Dynamic validation properties from composable -->\n <SchemaPropertyDetail\n v-for=\"property in validationProperties\"\n :key=\"property.key\"\n :code=\"property.code\"\n :truncate=\"property.truncate\">\n <ScreenReader v-if=\"property.key === 'format'\">\n {{ translate('common.format') }}:\n </ScreenReader>\n <ScreenReader v-else-if=\"property.key === 'pattern'\">\n {{ translate('common.pattern') }}:\n </ScreenReader>\n <template\n v-if=\"property.prefix\"\n #prefix>\n {{ property.prefix }}\n </template>\n {{ property.value }}\n </SchemaPropertyDetail>\n\n <!-- Enum indicator -->\n <SchemaPropertyDetail v-if=\"props.enum\">\n {{ translate('common.enum') }}\n </SchemaPropertyDetail>\n </template>\n <div\n v-if=\"props.additional\"\n class=\"property-additional\">\n <template v-if=\"props.value?.['x-additionalPropertiesName']\">\n {{ props.value['x-additionalPropertiesName'] }}\n </template>\n <template v-else>{{ translate('common.additionalProperties') }}</template>\n </div>\n <div\n v-if=\"props.value?.deprecated\"\n class=\"property-deprecated\">\n <Badge>{{ translate('common.deprecated') }}</Badge>\n </div>\n <!-- Don't use `isDefined` here, we want to show `const` when the value is `null` -->\n <div\n v-if=\"constValue !== undefined\"\n class=\"property-const\">\n <SchemaPropertyDetail truncate>\n <template #prefix>{{ translate('common.const') }}: </template>\n <RenderString :value=\"constValue\" />\n </SchemaPropertyDetail>\n </div>\n <template v-else>\n <!-- Shows only when a composition is used (so props.value?.type is undefined) -->\n <SchemaPropertyDetail v-if=\"(props.value as any)?.nullable === true\">\n {{ translate('common.nullable') }}\n </SchemaPropertyDetail>\n </template>\n <div\n v-if=\"props.value?.writeOnly\"\n class=\"property-write-only\">\n {{ translate('common.writeOnly') }}\n </div>\n <div\n v-else-if=\"props.value?.readOnly\"\n class=\"property-read-only\">\n {{ translate('common.readOnly') }}\n </div>\n <div\n v-if=\"props.required\"\n class=\"property-required\">\n {{ translate('common.required') }}\n </div>\n <SchemaPropertyDefault :value=\"props.value?.default\" />\n <SchemaPropertyExamples\n v-if=\"props.withExamples\"\n :example=\"exampleValue\"\n :examples=\"props.value?.examples\" />\n </div>\n</template>\n<style scoped>\n.property-heading {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n row-gap: 9px;\n white-space: nowrap;\n}\n\n.property-heading:has(+ .children),\n.property-heading:has(+ .property-rule) {\n margin-bottom: 9px;\n}\n\n.property-heading > * {\n margin-right: 9px;\n}\n\n.property-heading:last-child {\n margin-right: 0;\n}\n\n.property-heading > .property-detail:not(:last-of-type) {\n margin-right: 0;\n}\n\n.property-name {\n max-width: 100%;\n font-family: var(--scalar-font-code);\n font-weight: var(--scalar-bold);\n font-size: var(--scalar-font-size-4);\n white-space: normal;\n overflow-wrap: break-word;\n}\n\n.property-additional {\n font-family: var(--scalar-font-code);\n}\n\n.property-required,\n.property-optional {\n color: var(--scalar-color-2);\n}\n\n.property-required {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-orange);\n}\n\n.property-read-only {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-blue);\n}\n\n.property-write-only {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-green);\n}\n\n.property-discriminator {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-purple);\n}\n\n.property-detail {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-2);\n display: flex;\n align-items: center;\n\n min-width: 0;\n}\n\n.property-const {\n color: var(--scalar-color-1);\n}\n\n.deprecated {\n text-decoration: line-through;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBA,MAAM,QAAQ;EAuBd,MAAM,EAAE,cAAc,iBAAgB;EAGtC,MAAM,WAAW,MAAM,OAAO,QAAO;EAErC,MAAM,aAAa,eAAe;AAChC,OAAI,CAAC,SAAS,MACZ;GAGF,MAAM,SAAS,SAAS;AAGxB,OAAI,OAAO,UAAU,KAAA,EACnB,QAAO,OAAO;AAIhB,OAAI,OAAO,MAAM,WAAW,EAC1B,QAAO,OAAO,KAAK;AAIrB,OAAI,cAAc,OAAO,IAAI,OAAO,OAAO;IACzC,MAAM,QAAQ,QAAQ,OAAO,OAAO,MAAK;AAEzC,QAAI,UAAU,MAAM,MAAM,CACxB,QAAO,MAAM;AAGf,QAAI,MAAM,MAAM,WAAW,EACzB,QAAO,MAAM,KAAK;;IAKvB;EAED,MAAM,uBAAuB,eAAe;AAC1C,OAAI,CAAC,SAAS,MACZ,QAAO,EAAC;GAGV,MAAM,SAAS,SAAS;GACxB,MAAM,aAAa,EAAC;AAGpB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YAAA,WAAA,EAD1B,mBAIM,OAJN,YAIM,gBADD,MAAA,UAAS,CAAA,kBAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;IAGN,MAAM,YAAA,WAAA,EADd,mBAIM,OAJN,YAIM,gBADD,MAAA,UAAS,CAAA,kBAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;IAEd,YAAuD,+BAAA,EAA/B,OAAO,MAAM,OAAO,SAAA,EAAA,MAAA,GAAA,CAAA,QAAA,CAAA;IAEpC,MAAM,gBAAA,WAAA,EADd,YAGsC,gCAAA;;KADnC,SAAS,aAAA;KACT,UAAU,MAAM,OAAO"}
1
+ {"version":3,"file":"SchemaPropertyHeading.vue.script.js","names":["$slots"],"sources":["../../../../src/components/Content/Schema/SchemaPropertyHeading.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport {\n isArraySchema,\n isNumberSchema,\n isStringSchema,\n} from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\nimport { computed, toRef } from 'vue'\n\nimport { Badge } from '@/components/Badge'\nimport LinkButton from '@/components/Content/Schema/LinkButton.vue'\nimport ScreenReader from '@/components/ScreenReader.vue'\nimport { useLocalization } from '@/features/localization'\n\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { getModelNameFromSchema } from './helpers/schema-name'\nimport RenderString from './RenderString.vue'\nimport SchemaPropertyDefault from './SchemaPropertyDefault.vue'\nimport SchemaPropertyDetail from './SchemaPropertyDetail.vue'\nimport SchemaPropertyExamples from './SchemaPropertyExamples.vue'\n\nconst props = withDefaults(\n defineProps<{\n value: SchemaObject | undefined\n enum?: boolean\n isDiscriminator?: boolean\n required?: boolean\n additional?: boolean\n withExamples?: boolean\n hideModelNames?: boolean\n /** When the schema was resolved from a $ref, pass the ref name so it displays as e.g. \"Data\" instead of \"object\". */\n modelName?: string | null\n /** Resolved propertyNames schema, used to surface key constraints like `format` for additional properties. */\n propertyNames?: SchemaObject\n eventBus?: WorkspaceEventBus | null\n }>(),\n {\n isDiscriminator: false,\n required: false,\n withExamples: true,\n hideModelNames: false,\n eventBus: null,\n },\n)\nconst { translate } = useLocalization()\n\n// Convert to reactive refs for composables\nconst valueRef = toRef(props, 'value')\n\nconst constValue = computed(() => {\n if (!valueRef.value) {\n return undefined\n }\n\n const schema = valueRef.value\n\n // Direct const value\n if (schema.const !== undefined) {\n return schema.const\n }\n\n // Single-item enum acts as const\n if (schema.enum?.length === 1) {\n return schema.enum[0]\n }\n\n // Check items for const values (for arrays)\n if (isArraySchema(schema) && schema.items) {\n const items = resolve.schema(schema.items)\n\n if (isDefined(items.const)) {\n return items.const\n }\n\n if (items.enum?.length === 1) {\n return items.enum[0]\n }\n }\n\n return undefined\n})\n\ntype ValidationProperty = {\n key: string\n value: string | number\n prefix?: string\n code?: boolean\n truncate?: boolean\n}\n\n/**\n * Constraints that live on a leaf (string or number) schema: length, pattern,\n * format and numeric ranges. Extracted so they can be surfaced for a primitive\n * schema as well as for a primitive array's items, which are not rendered on\n * their own. See https://github.com/scalar/scalar/issues/9690\n */\nconst getLeafConstraints = (schema: SchemaObject) => {\n const properties: ValidationProperty[] = []\n\n if (isStringSchema(schema)) {\n if (schema.minLength) {\n properties.push({\n key: 'min-length',\n prefix: `${translate('common.minLength')}: `,\n value: schema.minLength,\n })\n }\n\n if (schema.maxLength) {\n properties.push({\n key: 'max-length',\n prefix: `${translate('common.maxLength')}: `,\n value: schema.maxLength,\n })\n }\n\n if (schema.pattern) {\n properties.push({\n key: 'pattern',\n value: schema.pattern,\n code: true,\n truncate: true,\n })\n }\n }\n\n if ((isStringSchema(schema) || isNumberSchema(schema)) && schema.format) {\n properties.push({\n key: 'format',\n value: schema.format,\n truncate: true,\n })\n }\n\n if (isNumberSchema(schema)) {\n if (isDefined(schema.exclusiveMinimum)) {\n properties.push({\n key: 'exclusive-minimum',\n prefix: `${translate('common.greaterThan')}: `,\n value: schema.exclusiveMinimum,\n })\n }\n\n if (isDefined(schema.minimum)) {\n properties.push({\n key: 'minimum',\n prefix: `${translate('common.min')}: `,\n value: schema.minimum,\n })\n }\n\n if (isDefined(schema.exclusiveMaximum)) {\n properties.push({\n key: 'exclusive-maximum',\n prefix: `${translate('common.lessThan')}: `,\n value: schema.exclusiveMaximum,\n })\n }\n\n if (isDefined(schema.maximum)) {\n properties.push({\n key: 'maximum',\n prefix: `${translate('common.max')}: `,\n value: schema.maximum,\n })\n }\n\n if (isDefined(schema.multipleOf)) {\n properties.push({\n key: 'multiple-of',\n prefix: `${translate('common.multipleOf')}: `,\n value: schema.multipleOf,\n })\n }\n }\n\n return properties\n}\n\nconst validationProperties = computed(() => {\n if (!valueRef.value) {\n return []\n }\n\n const schema = valueRef.value\n const properties: ValidationProperty[] = []\n\n // Array validation properties\n if (isArraySchema(schema)) {\n if (schema.minItems || schema.maxItems) {\n properties.push({\n key: 'array-range',\n value: `${schema.minItems || ''}…${schema.maxItems || ''}`,\n })\n }\n\n // Unique items\n if (schema.uniqueItems) {\n properties.push({\n key: 'unique-items',\n value: `${translate('common.unique')}!`,\n })\n }\n }\n\n properties.push(...getLeafConstraints(schema))\n\n // Primitive array items carry their own constraints (e.g. an array of `uuid`\n // strings) but are not rendered separately, so surface them here.\n if (isArraySchema(schema) && schema.items) {\n properties.push(...getLeafConstraints(resolve.schema(schema.items)))\n }\n\n return properties\n})\n\n/** Link data for navigating to the referenced model in the sidebar. */\nconst modelLink = computed(() => {\n if (!props.value) {\n return null\n }\n\n if (props.hideModelNames) {\n return null\n }\n\n if (props.modelName) {\n return { schemaKey: props.modelName, label: props.modelName }\n }\n\n const modelName = getModelNameFromSchema(props.value)\n if (modelName) {\n return { schemaKey: modelName.schemaKey, label: modelName.label }\n }\n\n if (isArraySchema(props.value) && props.value.items) {\n const itemName = getModelNameFromSchema(props.value.items)\n return itemName\n ? { schemaKey: itemName.schemaKey, label: `${itemName.label}[]` }\n : null\n }\n\n return null\n})\n\n/** Check if we should show the type information */\nconst shouldShowType = computed(() => {\n if (!props.value || !('type' in props.value)) {\n return false\n }\n\n // Always show type for arrays, even when items have const values\n if (props.value.type === 'array') {\n return true\n }\n\n // For non-arrays, only show if no const value at the schema level\n return !constValue.value\n})\n\n/** Get the display type */\nconst displayType = computed(() => {\n if (!props.value) {\n return ''\n }\n return getSchemaType(props.value)\n})\n\n/**\n * Type and format of the property keys, derived from the propertyNames schema.\n *\n * For a map keyed by UUIDs this renders e.g. \"string · uuid\" so the key\n * constraints are not lost. Returns undefined when there is nothing to show.\n */\nconst propertyNamesDetail = computed(() => {\n const schema = props.propertyNames\n if (!schema) {\n return undefined\n }\n\n const parts = [getSchemaType(schema)]\n if ('format' in schema && typeof schema.format === 'string') {\n parts.push(schema.format)\n }\n\n const detail = parts.filter(Boolean).join(' · ')\n return detail.length > 0 ? detail : undefined\n})\n\nconst exampleValue = computed(() => {\n // Treat only `undefined` as \"not set\" — `null` is a valid example value on a nullable schema.\n if (\n props.value &&\n 'example' in props.value &&\n props.value.example !== undefined\n ) {\n return props.value.example\n }\n\n if (props.value && isArraySchema(props.value)) {\n const itemsSchema = resolve.schema(props.value.items)\n if (\n itemsSchema &&\n 'example' in itemsSchema &&\n itemsSchema.example !== undefined\n ) {\n return itemsSchema.example\n }\n }\n\n return undefined\n})\n</script>\n<template>\n <div class=\"property-heading\">\n <div\n v-if=\"$slots.name\"\n class=\"property-name\"\n :class=\"{ deprecated: props.value?.deprecated }\">\n <slot name=\"name\" />\n </div>\n <div\n v-if=\"props.isDiscriminator\"\n class=\"property-discriminator\">\n {{ translate('common.discriminator') }}\n </div>\n <template v-if=\"props.value\">\n <!-- Type information -->\n <SchemaPropertyDetail\n v-if=\"shouldShowType\"\n truncate>\n <ScreenReader>{{ translate('common.type') }}:</ScreenReader>\n {{ displayType }}\n <template v-if=\"modelLink\">\n ·\n <LinkButton\n v-if=\"props.eventBus && modelLink.schemaKey\"\n @click=\"\n props.eventBus.emit('scroll-to:model-by-name', {\n name: modelLink.schemaKey,\n })\n \">\n {{ modelLink.label }}\n </LinkButton>\n <template v-else>{{ modelLink.label }}</template>\n </template>\n </SchemaPropertyDetail>\n\n <!-- Key constraints from propertyNames (e.g. \"keys: string · uuid\") -->\n <SchemaPropertyDetail\n v-if=\"propertyNamesDetail\"\n truncate>\n <template #prefix>{{ translate('common.keys') }}:</template>\n {{ propertyNamesDetail }}\n </SchemaPropertyDetail>\n\n <!-- Dynamic validation properties from composable -->\n <SchemaPropertyDetail\n v-for=\"property in validationProperties\"\n :key=\"property.key\"\n :code=\"property.code\"\n :truncate=\"property.truncate\">\n <ScreenReader v-if=\"property.key === 'format'\">\n {{ translate('common.format') }}:\n </ScreenReader>\n <ScreenReader v-else-if=\"property.key === 'pattern'\">\n {{ translate('common.pattern') }}:\n </ScreenReader>\n <template\n v-if=\"property.prefix\"\n #prefix>\n {{ property.prefix }}\n </template>\n {{ property.value }}\n </SchemaPropertyDetail>\n\n <!-- Enum indicator -->\n <SchemaPropertyDetail v-if=\"props.enum\">\n {{ translate('common.enum') }}\n </SchemaPropertyDetail>\n </template>\n <div\n v-if=\"props.additional\"\n class=\"property-additional\">\n <template v-if=\"props.value?.['x-additionalPropertiesName']\">\n {{ props.value['x-additionalPropertiesName'] }}\n </template>\n <template v-else>{{ translate('common.additionalProperties') }}</template>\n </div>\n <div\n v-if=\"props.value?.deprecated\"\n class=\"property-deprecated\">\n <Badge>{{ translate('common.deprecated') }}</Badge>\n </div>\n <!-- Don't use `isDefined` here, we want to show `const` when the value is `null` -->\n <div\n v-if=\"constValue !== undefined\"\n class=\"property-const\">\n <SchemaPropertyDetail truncate>\n <template #prefix>{{ translate('common.const') }}: </template>\n <RenderString :value=\"constValue\" />\n </SchemaPropertyDetail>\n </div>\n <template v-else>\n <!-- Shows only when a composition is used (so props.value?.type is undefined) -->\n <SchemaPropertyDetail v-if=\"(props.value as any)?.nullable === true\">\n {{ translate('common.nullable') }}\n </SchemaPropertyDetail>\n </template>\n <div\n v-if=\"props.value?.writeOnly\"\n class=\"property-write-only\">\n {{ translate('common.writeOnly') }}\n </div>\n <div\n v-else-if=\"props.value?.readOnly\"\n class=\"property-read-only\">\n {{ translate('common.readOnly') }}\n </div>\n <div\n v-if=\"props.required\"\n class=\"property-required\">\n {{ translate('common.required') }}\n </div>\n <SchemaPropertyDefault :value=\"props.value?.default\" />\n <SchemaPropertyExamples\n v-if=\"props.withExamples\"\n :example=\"exampleValue\"\n :examples=\"props.value?.examples\" />\n </div>\n</template>\n<style scoped>\n.property-heading {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n row-gap: 9px;\n white-space: nowrap;\n}\n\n.property-heading:has(+ .children),\n.property-heading:has(+ .property-rule) {\n margin-bottom: 9px;\n}\n\n.property-heading > * {\n margin-right: 9px;\n}\n\n.property-heading:last-child {\n margin-right: 0;\n}\n\n.property-heading > .property-detail:not(:last-of-type) {\n margin-right: 0;\n}\n\n.property-name {\n max-width: 100%;\n font-family: var(--scalar-font-code);\n font-weight: var(--scalar-bold);\n font-size: var(--scalar-font-size-4);\n white-space: normal;\n overflow-wrap: break-word;\n}\n\n.property-additional {\n font-family: var(--scalar-font-code);\n}\n\n.property-required,\n.property-optional {\n color: var(--scalar-color-2);\n}\n\n.property-required {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-orange);\n}\n\n.property-read-only {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-blue);\n}\n\n.property-write-only {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-green);\n}\n\n.property-discriminator {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-purple);\n}\n\n.property-detail {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-2);\n display: flex;\n align-items: center;\n\n min-width: 0;\n}\n\n.property-const {\n color: var(--scalar-color-1);\n}\n\n.deprecated {\n text-decoration: line-through;\n}\n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A,CAAA,QAAA,CAAA;IAEpC,MAAM,gBAAA,WAAA,EADd,YAGsC,gCAAA;;KADnC,SAAS,aAAA;KACT,UAAU,MAAM,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"optimize-value-for-display.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/optimize-value-for-display.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAqDhG;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAyFjG"}
1
+ {"version":3,"file":"optimize-value-for-display.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/optimize-value-for-display.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAqDhG;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CA+FjG"}
@@ -59,10 +59,7 @@ function optimizeValueForDisplay(value) {
59
59
  });
60
60
  const shouldBeNullable = hasNullSchema || originalNullable === true;
61
61
  if (filteredSchemas.length === 1) {
62
- const mergedSchema = {
63
- ...rootProperties,
64
- ...filteredSchemas[0]
65
- };
62
+ const mergedSchema = mergeSchemaProperties(filteredSchemas[0], rootProperties);
66
63
  if (shouldBeNullable) mergedSchema.nullable = true;
67
64
  return mergedSchema;
68
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"optimize-value-for-display.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/optimize-value-for-display.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { compositions } from './schema-composition'\n\n/**\n * Shallow-merges schema-like objects, but unions `properties` and `required`\n * instead of letting a later object's `properties`/`required` completely\n * overwrite an earlier one's. Without this, a variant schema (e.g. a `oneOf`\n * branch) that declares its own `properties`/`required` would wipe out the\n * shared base fields factored out at the root (or via a sibling `allOf`)\n * instead of being combined with them (#9657).\n */\nfunction mergeSchemaProperties(...objects: (Record<string, unknown> | undefined)[]): Record<string, unknown> {\n const merged: Record<string, unknown> = {}\n const properties: Record<string, unknown> = {}\n const required = new Set<string>()\n let hasProperties = false\n let hasRequired = false\n\n for (const object of objects) {\n if (!object) {\n continue\n }\n\n for (const [key, val] of Object.entries(object)) {\n if (key === 'properties' && val && typeof val === 'object') {\n Object.assign(properties, val)\n hasProperties = true\n continue\n }\n\n if (key === 'required' && Array.isArray(val)) {\n for (const name of val) {\n required.add(name)\n }\n hasRequired = true\n continue\n }\n\n merged[key] = val\n }\n }\n\n if (hasProperties) {\n merged.properties = properties\n }\n if (hasRequired) {\n merged.required = [...required]\n }\n\n return merged\n}\n\n/**\n * Optimize the value by removing nulls from compositions and merging root properties.\n *\n * TODO: figure out what this does\n */\nexport function optimizeValueForDisplay(value: SchemaObject | undefined): SchemaObject | undefined {\n if (!value || typeof value !== 'object') {\n return value\n }\n\n // Find the composition keyword early to avoid unnecessary work\n const composition = compositions.find((keyword) => keyword in value && keyword !== 'not')\n\n // If there's no relevant composition keyword, return a shallow copy\n if (!composition) {\n return { ...value }\n }\n\n const schemas = value[composition]\n if (!Array.isArray(schemas)) {\n return { ...value }\n }\n\n // Extract root properties efficiently (excluding composition and nullable)\n const { [composition]: _, nullable: originalNullable, ...rootProperties } = value as any\n const hasRootProperties = Object.keys(rootProperties).length > 0\n\n // Check for null schemas and filter them out in one pass\n const { filteredSchemas, hasNullSchema } = schemas.reduce(\n (acc, _schema) => {\n const schema = resolve.schema(_schema)\n\n if ('type' in schema && schema.type === 'null') {\n acc.hasNullSchema = true\n } else {\n acc.filteredSchemas.push(schema)\n }\n return acc\n },\n { filteredSchemas: [] as SchemaObject[], hasNullSchema: false },\n )\n\n // Determine if nullable should be set\n const shouldBeNullable = hasNullSchema || originalNullable === true\n\n // If only one schema remains after filtering, merge with root properties\n if (filteredSchemas.length === 1) {\n const mergedSchema = { ...rootProperties, ...filteredSchemas[0] }\n if (shouldBeNullable) {\n mergedSchema.nullable = true\n }\n return mergedSchema\n }\n\n // Check if root properties should be merged into schemas\n const shouldMergeRootProperties =\n (composition === 'oneOf' || composition === 'anyOf') &&\n (hasRootProperties || filteredSchemas.some((schema) => schema.allOf))\n\n if (shouldMergeRootProperties) {\n const mergedSchemas = filteredSchemas.map((_schema) => {\n const schema = resolve.schema(_schema)\n\n // Flatten single-item allOf and merge with root properties\n if (schema.allOf?.length === 1) {\n const { allOf, ...otherProps } = schema\n return mergeSchemaProperties(rootProperties, otherProps, resolve.schema(allOf[0]))\n }\n return mergeSchemaProperties(rootProperties, schema)\n })\n\n // @ts-expect-error - We avoid using coerceValue here as it may be dangerous, so we type cast\n const result = { [composition]: mergedSchemas } as SchemaObject\n if (typeof value.description === 'string') {\n result.description = value.description\n }\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n result.nullable = true\n }\n return result\n }\n\n // Return with filtered schemas if any nulls were removed\n if (filteredSchemas.length !== schemas.length) {\n const result: SchemaObject = { ...value, [composition]: filteredSchemas }\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n result.nullable = true\n }\n return result\n }\n\n return { ...value }\n}\n"],"mappings":";;;;;;;;;;;AAaA,SAAS,sBAAsB,GAAG,SAA2E;CAC3G,MAAM,SAAkC,EAAE;CAC1C,MAAM,aAAsC,EAAE;CAC9C,MAAM,2BAAW,IAAI,KAAa;CAClC,IAAI,gBAAgB;CACpB,IAAI,cAAc;AAElB,MAAK,MAAM,UAAU,SAAS;AAC5B,MAAI,CAAC,OACH;AAGF,OAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,OAAO,EAAE;AAC/C,OAAI,QAAQ,gBAAgB,OAAO,OAAO,QAAQ,UAAU;AAC1D,WAAO,OAAO,YAAY,IAAI;AAC9B,oBAAgB;AAChB;;AAGF,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OAAI,OAAO,OAAO,WAAW,GAAG;IAC9B,MAAM,EAAE,OAAO,GAAG,eAAe;AACjC,WAAO,sBAAsB,gBAAgB,YAAY,QAAQ,OAAO,MAAM,GAAG,CAAC;;AAEpF,UAAO,sBAAsB,gBAAgB,OAAO;IACpD;EAGF,MAAM,SAAS,GAAG,cAAc,eAAe;AAC/C,MAAI,OAAO,MAAM,gBAAgB,SAC/B,QAAO,cAAc,MAAM;AAE7B,MAAI,iBAEF,QAAO,WAAW;AAEpB,SAAO;;AAIT,KAAI,gBAAgB,WAAW,QAAQ,QAAQ;EAC7C,MAAM,SAAuB;GAAE,GAAG;IAAQ,cAAc;GAAiB;AACzE,MAAI,iBAEF,QAAO,WAAW;AAEpB,SAAO;;AAGT,QAAO,EAAE,GAAG,OAAO"}
1
+ {"version":3,"file":"optimize-value-for-display.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/optimize-value-for-display.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { compositions } from './schema-composition'\n\n/**\n * Shallow-merges schema-like objects, but unions `properties` and `required`\n * instead of letting a later object's `properties`/`required` completely\n * overwrite an earlier one's. Without this, a variant schema (e.g. a `oneOf`\n * branch) that declares its own `properties`/`required` would wipe out the\n * shared base fields factored out at the root (or via a sibling `allOf`)\n * instead of being combined with them (#9657).\n */\nfunction mergeSchemaProperties(...objects: (Record<string, unknown> | undefined)[]): Record<string, unknown> {\n const merged: Record<string, unknown> = {}\n const properties: Record<string, unknown> = {}\n const required = new Set<string>()\n let hasProperties = false\n let hasRequired = false\n\n for (const object of objects) {\n if (!object) {\n continue\n }\n\n for (const [key, val] of Object.entries(object)) {\n if (key === 'properties' && val && typeof val === 'object') {\n Object.assign(properties, val)\n hasProperties = true\n continue\n }\n\n if (key === 'required' && Array.isArray(val)) {\n for (const name of val) {\n required.add(name)\n }\n hasRequired = true\n continue\n }\n\n merged[key] = val\n }\n }\n\n if (hasProperties) {\n merged.properties = properties\n }\n if (hasRequired) {\n merged.required = [...required]\n }\n\n return merged\n}\n\n/**\n * Optimize the value by removing nulls from compositions and merging root properties.\n *\n * TODO: figure out what this does\n */\nexport function optimizeValueForDisplay(value: SchemaObject | undefined): SchemaObject | undefined {\n if (!value || typeof value !== 'object') {\n return value\n }\n\n // Find the composition keyword early to avoid unnecessary work\n const composition = compositions.find((keyword) => keyword in value && keyword !== 'not')\n\n // If there's no relevant composition keyword, return a shallow copy\n if (!composition) {\n return { ...value }\n }\n\n const schemas = value[composition]\n if (!Array.isArray(schemas)) {\n return { ...value }\n }\n\n // Extract root properties efficiently (excluding composition and nullable)\n const { [composition]: _, nullable: originalNullable, ...rootProperties } = value as any\n const hasRootProperties = Object.keys(rootProperties).length > 0\n\n // Check for null schemas and filter them out in one pass\n const { filteredSchemas, hasNullSchema } = schemas.reduce(\n (acc, _schema) => {\n const schema = resolve.schema(_schema)\n\n if ('type' in schema && schema.type === 'null') {\n acc.hasNullSchema = true\n } else {\n acc.filteredSchemas.push(schema)\n }\n return acc\n },\n { filteredSchemas: [] as SchemaObject[], hasNullSchema: false },\n )\n\n // Determine if nullable should be set\n const shouldBeNullable = hasNullSchema || originalNullable === true\n\n // If only one schema remains after filtering, merge with root properties.\n // `properties`/`required` are unioned so sibling properties declared next to\n // the composition (e.g. `properties` alongside a single-`$ref` `allOf`) are\n // kept instead of being overwritten by the member schema's own `properties`.\n // Root-level annotations (title, description, …) win over the member's: they\n // describe the combined schema, not the base it extends.\n if (filteredSchemas.length === 1) {\n const mergedSchema = mergeSchemaProperties(filteredSchemas[0], rootProperties) as SchemaObject\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n mergedSchema.nullable = true\n }\n return mergedSchema\n }\n\n // Check if root properties should be merged into schemas\n const shouldMergeRootProperties =\n (composition === 'oneOf' || composition === 'anyOf') &&\n (hasRootProperties || filteredSchemas.some((schema) => schema.allOf))\n\n if (shouldMergeRootProperties) {\n const mergedSchemas = filteredSchemas.map((_schema) => {\n const schema = resolve.schema(_schema)\n\n // Flatten single-item allOf and merge with root properties\n if (schema.allOf?.length === 1) {\n const { allOf, ...otherProps } = schema\n return mergeSchemaProperties(rootProperties, otherProps, resolve.schema(allOf[0]))\n }\n return mergeSchemaProperties(rootProperties, schema)\n })\n\n // @ts-expect-error - We avoid using coerceValue here as it may be dangerous, so we type cast\n const result = { [composition]: mergedSchemas } as SchemaObject\n if (typeof value.description === 'string') {\n result.description = value.description\n }\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n result.nullable = true\n }\n return result\n }\n\n // Return with filtered schemas if any nulls were removed\n if (filteredSchemas.length !== schemas.length) {\n const result: SchemaObject = { ...value, [composition]: filteredSchemas }\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n result.nullable = true\n }\n return result\n }\n\n return { ...value }\n}\n"],"mappings":";;;;;;;;;;;AAaA,SAAS,sBAAsB,GAAG,SAA2E;CAC3G,MAAM,SAAkC,EAAE;CAC1C,MAAM,aAAsC,EAAE;CAC9C,MAAM,2BAAW,IAAI,KAAa;CAClC,IAAI,gBAAgB;CACpB,IAAI,cAAc;AAElB,MAAK,MAAM,UAAU,SAAS;AAC5B,MAAI,CAAC,OACH;AAGF,OAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,OAAO,EAAE;AAC/C,OAAI,QAAQ,gBAAgB,OAAO,OAAO,QAAQ,UAAU;AAC1D,WAAO,OAAO,YAAY,IAAI;AAC9B,oBAAgB;AAChB;;AAGF,OAAI,QAAQ,cAAc,MAAM,QAAQ,IAAI,EAAE;AAC5C,SAAK,MAAM,QAAQ,IACjB,UAAS,IAAI,KAAK;AAEpB,kBAAc;AACd;;AAGF,UAAO,OAAO;;;AAIlB,KAAI,cACF,QAAO,aAAa;AAEtB,KAAI,YACF,QAAO,WAAW,CAAC,GAAG,SAAS;AAGjC,QAAO;;;;;;;AAQT,SAAgB,wBAAwB,OAA2D;AACjG,KAAI,CAAC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AEF,QAAO,WAAW;AAEpB,SAAO;;AAIT,KAAI,gBAAgB,WAAW,QAAQ,QAAQ;EAC7C,MAAM,SAAuB;GAAE,GAAG;IAAQ,cAAc;GAAiB;AACzE,MAAI,iBAEF,QAAO,WAAW;AAEpB,SAAO;;AAGT,QAAO,EAAE,GAAG,OAAO"}
@@ -0,0 +1,32 @@
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ import type { CompositionKeyword } from './schema-composition.js';
3
+ type ChoiceKeyword = Extract<CompositionKeyword, 'oneOf' | 'anyOf'>;
4
+ /** An ordered piece of an `allOf`: either a merged object or a choice picker. */
5
+ type AllOfSegment = {
6
+ kind: 'object';
7
+ schema: SchemaObject;
8
+ } | {
9
+ kind: 'choice';
10
+ composition: ChoiceKeyword;
11
+ /** A minimal schema carrying only this group's composition, for SchemaComposition */
12
+ value: SchemaObject;
13
+ /** Ordinal among choice members, matching the request-example composition key */
14
+ choiceIndex: number;
15
+ };
16
+ /**
17
+ * Splits an `allOf` schema into an ordered list of segments so the renderer can
18
+ * show each `oneOf`/`anyOf` group as its own picker **in the position it was
19
+ * declared**, with the surrounding plain fields around it.
20
+ *
21
+ * `mergeAllOfSchemas` alone keeps only the FIRST `oneOf`/`anyOf` (dropping the
22
+ * 2nd+ groups of an object with several independent mutually-exclusive
23
+ * selections) and, being a merge, also loses the ordering between fields and
24
+ * choices. Walking the members in order fixes both: runs of consecutive object
25
+ * members are merged into one object segment, and each choice member becomes its
26
+ * own picker segment in place.
27
+ */
28
+ export declare const partitionAllOfCompositions: (schema: SchemaObject | undefined) => {
29
+ segments: AllOfSegment[];
30
+ };
31
+ export {};
32
+ //# sourceMappingURL=partition-all-of-compositions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partition-all-of-compositions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/partition-all-of-compositions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAE9D,KAAK,aAAa,GAAG,OAAO,CAAC,kBAAkB,EAAE,OAAO,GAAG,OAAO,CAAC,CAAA;AAEnE,iFAAiF;AACjF,KAAK,YAAY,GACb;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACxC;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,WAAW,EAAE,aAAa,CAAA;IAC1B,qFAAqF;IACrF,KAAK,EAAE,YAAY,CAAA;IACnB,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAqEL;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,GAAI,QAAQ,YAAY,GAAG,SAAS,KAAG;IAAE,QAAQ,EAAE,YAAY,EAAE,CAAA;CA+EvG,CAAA"}
@@ -0,0 +1,97 @@
1
+ import { mergeAllOfSchemas } from "./merge-all-of-schemas.js";
2
+ import { resolve } from "@scalar/workspace-store/resolve";
3
+ //#region src/components/Content/Schema/helpers/partition-all-of-compositions.ts
4
+ var CHOICE_KEYWORDS = ["oneOf", "anyOf"];
5
+ /**
6
+ * Flattens a member's own (non-composition) properties and every `oneOf`/`anyOf`
7
+ * group it declares — recursing into nested `allOf` — into a flat, ordered list,
8
+ * preserving source order so choice groups stay where they were authored.
9
+ *
10
+ * Pure-constraint keywords (`not`, `if/then/else`) are dropped: they carry no
11
+ * visual variant and Scalar would otherwise render `not` as a bogus picker. The
12
+ * rule still lives in the schema (validation) and in field descriptions.
13
+ */
14
+ var collectMembers = (schema, out, seenRefs) => {
15
+ const { allOf, oneOf, anyOf, not: _not, if: _if, then: _then, else: _else, ...rest } = schema;
16
+ if (Object.keys(rest).length > 0) out.push({
17
+ kind: "object",
18
+ schema: rest
19
+ });
20
+ for (const keyword of CHOICE_KEYWORDS) {
21
+ const value = keyword === "oneOf" ? oneOf : anyOf;
22
+ if (Array.isArray(value) && value.length > 0) out.push({
23
+ kind: "choice",
24
+ composition: keyword,
25
+ value: { [keyword]: value }
26
+ });
27
+ }
28
+ if (Array.isArray(allOf)) {
29
+ for (const rawMember of allOf) if (rawMember && typeof rawMember === "object") {
30
+ const resolved = resolve.schema(rawMember);
31
+ const ref = resolved.$ref;
32
+ if (typeof ref === "string") {
33
+ if (seenRefs.has(ref)) continue;
34
+ collectMembers(resolved, out, new Set(seenRefs).add(ref));
35
+ } else collectMembers(resolved, out, seenRefs);
36
+ }
37
+ }
38
+ };
39
+ /**
40
+ * Splits an `allOf` schema into an ordered list of segments so the renderer can
41
+ * show each `oneOf`/`anyOf` group as its own picker **in the position it was
42
+ * declared**, with the surrounding plain fields around it.
43
+ *
44
+ * `mergeAllOfSchemas` alone keeps only the FIRST `oneOf`/`anyOf` (dropping the
45
+ * 2nd+ groups of an object with several independent mutually-exclusive
46
+ * selections) and, being a merge, also loses the ordering between fields and
47
+ * choices. Walking the members in order fixes both: runs of consecutive object
48
+ * members are merged into one object segment, and each choice member becomes its
49
+ * own picker segment in place.
50
+ */
51
+ var partitionAllOfCompositions = (schema) => {
52
+ if (!schema) return { segments: [] };
53
+ const { allOf, oneOf: _oneOf, anyOf: _anyOf, not: _not, if: _if, then: _then, else: _else, ...rest } = schema;
54
+ if (!Array.isArray(allOf)) return { segments: [{
55
+ kind: "object",
56
+ schema
57
+ }] };
58
+ const members = [];
59
+ if (Object.keys(rest).length > 0) members.push({
60
+ kind: "object",
61
+ schema: rest
62
+ });
63
+ const seenRefs = /* @__PURE__ */ new Set();
64
+ for (const rawMember of allOf) if (rawMember && typeof rawMember === "object") {
65
+ const resolved = resolve.schema(rawMember);
66
+ const ref = resolved.$ref;
67
+ collectMembers(resolved, members, typeof ref === "string" ? new Set(seenRefs).add(ref) : seenRefs);
68
+ }
69
+ const segments = [];
70
+ let objectRun = [];
71
+ let choiceIndex = 0;
72
+ const flushObjectRun = () => {
73
+ if (objectRun.length === 0) return;
74
+ const merged = objectRun.length === 1 ? objectRun[0] : mergeAllOfSchemas({ allOf: objectRun });
75
+ segments.push({
76
+ kind: "object",
77
+ schema: merged
78
+ });
79
+ objectRun = [];
80
+ };
81
+ for (const member of members) if (member.kind === "object") objectRun.push(member.schema);
82
+ else {
83
+ flushObjectRun();
84
+ segments.push({
85
+ kind: "choice",
86
+ composition: member.composition,
87
+ value: member.value,
88
+ choiceIndex: choiceIndex++
89
+ });
90
+ }
91
+ flushObjectRun();
92
+ return { segments };
93
+ };
94
+ //#endregion
95
+ export { partitionAllOfCompositions };
96
+
97
+ //# sourceMappingURL=partition-all-of-compositions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partition-all-of-compositions.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/partition-all-of-compositions.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { mergeAllOfSchemas } from './merge-all-of-schemas'\nimport type { CompositionKeyword } from './schema-composition'\n\ntype ChoiceKeyword = Extract<CompositionKeyword, 'oneOf' | 'anyOf'>\n\n/** An ordered piece of an `allOf`: either a merged object or a choice picker. */\ntype AllOfSegment =\n | { kind: 'object'; schema: SchemaObject }\n | {\n kind: 'choice'\n composition: ChoiceKeyword\n /** A minimal schema carrying only this group's composition, for SchemaComposition */\n value: SchemaObject\n /** Ordinal among choice members, matching the request-example composition key */\n choiceIndex: number\n }\n\nconst CHOICE_KEYWORDS: ChoiceKeyword[] = ['oneOf', 'anyOf']\n\ntype Member =\n | { kind: 'object'; schema: SchemaObject }\n | { kind: 'choice'; composition: ChoiceKeyword; value: SchemaObject }\n\n/**\n * Flattens a member's own (non-composition) properties and every `oneOf`/`anyOf`\n * group it declares — recursing into nested `allOf` — into a flat, ordered list,\n * preserving source order so choice groups stay where they were authored.\n *\n * Pure-constraint keywords (`not`, `if/then/else`) are dropped: they carry no\n * visual variant and Scalar would otherwise render `not` as a bogus picker. The\n * rule still lives in the schema (validation) and in field descriptions.\n */\nconst collectMembers = (schema: SchemaObject, out: Member[], seenRefs: Set<string>): void => {\n const {\n allOf,\n oneOf,\n anyOf,\n not: _not,\n if: _if,\n then: _then,\n else: _else,\n ...rest\n } = schema as SchemaObject & {\n allOf?: unknown[]\n oneOf?: unknown[]\n anyOf?: unknown[]\n not?: unknown\n if?: unknown\n then?: unknown\n else?: unknown\n }\n\n if (Object.keys(rest).length > 0) {\n out.push({ kind: 'object', schema: rest as SchemaObject })\n }\n\n for (const keyword of CHOICE_KEYWORDS) {\n const value = keyword === 'oneOf' ? oneOf : anyOf\n if (Array.isArray(value) && value.length > 0) {\n out.push({ kind: 'choice', composition: keyword, value: { [keyword]: value } as unknown as SchemaObject })\n }\n }\n\n if (Array.isArray(allOf)) {\n for (const rawMember of allOf) {\n if (rawMember && typeof rawMember === 'object') {\n const resolved = resolve.schema(rawMember) as SchemaObject & { $ref?: string }\n // Break `$ref` cycles reached through `allOf` (e.g. a member that\n // references an ancestor). Without this guard a recursive `allOf`\n // schema would recurse forever. `mergeAllOfSchemas` guards the same way.\n const ref = resolved.$ref\n if (typeof ref === 'string') {\n if (seenRefs.has(ref)) {\n continue\n }\n collectMembers(resolved, out, new Set(seenRefs).add(ref))\n } else {\n collectMembers(resolved, out, seenRefs)\n }\n }\n }\n }\n}\n\n/**\n * Splits an `allOf` schema into an ordered list of segments so the renderer can\n * show each `oneOf`/`anyOf` group as its own picker **in the position it was\n * declared**, with the surrounding plain fields around it.\n *\n * `mergeAllOfSchemas` alone keeps only the FIRST `oneOf`/`anyOf` (dropping the\n * 2nd+ groups of an object with several independent mutually-exclusive\n * selections) and, being a merge, also loses the ordering between fields and\n * choices. Walking the members in order fixes both: runs of consecutive object\n * members are merged into one object segment, and each choice member becomes its\n * own picker segment in place.\n */\nexport const partitionAllOfCompositions = (schema: SchemaObject | undefined): { segments: AllOfSegment[] } => {\n if (!schema) {\n return { segments: [] }\n }\n\n // The schema's own (non-composition) keys, minus its top-level `oneOf`/`anyOf`\n // — those are rendered as their own composition by the caller, not here.\n const {\n allOf,\n oneOf: _oneOf,\n anyOf: _anyOf,\n not: _not,\n if: _if,\n then: _then,\n else: _else,\n ...rest\n } = schema as SchemaObject & {\n allOf?: unknown[]\n oneOf?: unknown[]\n anyOf?: unknown[]\n not?: unknown\n if?: unknown\n then?: unknown\n else?: unknown\n }\n\n if (!Array.isArray(allOf)) {\n return { segments: [{ kind: 'object', schema: schema }] }\n }\n\n const members: Member[] = []\n if (Object.keys(rest).length > 0) {\n members.push({ kind: 'object', schema: rest as SchemaObject })\n }\n const seenRefs = new Set<string>()\n for (const rawMember of allOf) {\n if (rawMember && typeof rawMember === 'object') {\n const resolved = resolve.schema(rawMember) as SchemaObject & { $ref?: string }\n const ref = resolved.$ref\n collectMembers(resolved, members, typeof ref === 'string' ? new Set(seenRefs).add(ref) : seenRefs)\n }\n }\n\n // Coalesce consecutive object members into a single merged object segment,\n // keeping choice members as their own segments between them.\n const segments: AllOfSegment[] = []\n let objectRun: SchemaObject[] = []\n let choiceIndex = 0\n\n const flushObjectRun = () => {\n if (objectRun.length === 0) {\n return\n }\n const merged = objectRun.length === 1 ? objectRun[0]! : mergeAllOfSchemas({ allOf: objectRun } as SchemaObject)\n segments.push({ kind: 'object', schema: merged })\n objectRun = []\n }\n\n for (const member of members) {\n if (member.kind === 'object') {\n objectRun.push(member.schema)\n } else {\n flushObjectRun()\n // `choiceIndex` is the ordinal used to build the composition-selection key\n // that syncs each picker with the request example. It MUST stay aligned\n // with the ordinal computed while walking `allOf` in\n // `get-example-from-schema.ts` (`@scalar/workspace-store`), or a picker and\n // its generated example fall out of sync.\n segments.push({\n kind: 'choice',\n composition: member.composition,\n value: member.value,\n choiceIndex: choiceIndex++,\n })\n }\n }\n flushObjectRun()\n\n return { segments }\n}\n"],"mappings":";;;AAoBA,IAAM,kBAAmC,CAAC,SAAS,QAAQ;;;;;;;;;;AAe3D,IAAM,kBAAkB,QAAsB,KA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AAI,aAAa,OAAO,cAAc,UAAU;EAC9C,MAAM,WAAW,QAAQ,OAAO,UAAU;EAC1C,MAAM,MAAM,SAAS;AACrB,iBAAe,UAAU,SAAS,OAAO,QAAQ,WAAW,IAAI,IAAI,SAAS,CAAC,IAAI,IAAI,GAAG,SAAS;;CAMtG,MAAM,WAA2B,EAAE;CACnC,IAAI,YAA4B,EAAE;CAClC,IAAI,cAAc;CAElB,MAAM,uBAAuB;AAC3B,MAAI,UAAU,WAAW,EACvB;EAEF,MAAM,SAAS,UAAU,WAAW,IAAI,UAAU,KAAM,kBAAkB,EAAE,OAAO,WAAW,CAAiB;AAC/G,WAAS,KAAK;GAAE,MAAM;GAAU,QAAQ;GAAQ,CAAC;AACjD,cAAY,EAAE;;AAGhB,MAAK,MAAM,UAAU,QACnB,KAAI,OAAO,SAAS,SAClB,WAAU,KAAK,OAAO,OAAO;MACxB;AACL,kBAAgB;AAMhB,WAAS,KAAK;GACZ,MAAM;GACN,aAAa,OAAO;GACpB,OAAO,OAAO;GACd,aAAa;GACd,CAAC;;AAGN,iBAAgB;AAEhB,QAAO,EAAE,UAAU"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
2
2
  import LinkList_vue_vue_type_script_setup_true_lang_default from "./LinkList.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/components/LinkList/LinkList.vue
5
- var LinkList_default = /* @__PURE__ */ _plugin_vue_export_helper_default(LinkList_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-b59b0acf"]]);
5
+ var LinkList_default = /* @__PURE__ */ _plugin_vue_export_helper_default(LinkList_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-dc833d99"]]);
6
6
  //#endregion
7
7
  export { LinkList_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"LinkList.vue.js","names":[],"sources":["../../../src/components/LinkList/LinkList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onMounted, onUnmounted, ref } from 'vue'\n\nconst containerRef = ref<HTMLDivElement>()\n\n/** Whether the container needs to scroll */\nconst needsScroll = ref(false)\n\n/** Check if the container can scroll in either direction */\nconst checkScrollability = () => {\n if (!containerRef.value) {\n return\n }\n\n const { scrollWidth, clientWidth } = containerRef.value\n needsScroll.value = scrollWidth > clientWidth\n}\n\n/** MutationObserver to watch for changes in child elements */\nlet mutationObserver: MutationObserver | null = null\n\n/**\n * We use the mutation observer to watch for changes and check if we need to scroll,\n * if we do need to scroll we apply the icons-only class to the container\n */\nonMounted(() => {\n checkScrollability()\n\n // Re-check on window resize\n window.addEventListener('resize', checkScrollability)\n\n // Watch for changes in child elements\n if (containerRef.value) {\n mutationObserver = new MutationObserver(() => {\n checkScrollability()\n })\n\n mutationObserver.observe(containerRef.value, {\n childList: true,\n subtree: true,\n })\n }\n})\n\nonUnmounted(() => {\n // Clean up event listeners and observer\n window.removeEventListener('resize', checkScrollability)\n\n if (mutationObserver) {\n mutationObserver.disconnect()\n mutationObserver = null\n }\n})\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n :class=\"{ 'icons-only': needsScroll }\"\n class=\"custom-scroll mb-3 flex h-auto min-h-8 max-w-full items-center gap-2 overflow-x-auto text-base whitespace-nowrap xl:mb-1.5\">\n <slot />\n </div>\n</template>\n\n<style scoped>\n.icons-only :deep(span) {\n display: none;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"LinkList.vue.js","names":[],"sources":["../../../src/components/LinkList/LinkList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onMounted, onUnmounted, ref } from 'vue'\n\nconst containerRef = ref<HTMLDivElement>()\n\n/** Whether the container needs to scroll */\nconst needsScroll = ref(false)\n\n/** Check if the container can scroll in either direction */\nconst checkScrollability = () => {\n if (!containerRef.value) {\n return\n }\n\n const { scrollWidth, clientWidth } = containerRef.value\n needsScroll.value = scrollWidth > clientWidth\n}\n\n/** MutationObserver to watch for changes in child elements */\nlet mutationObserver: MutationObserver | null = null\n\n/**\n * We use the mutation observer to watch for changes and check if we need to scroll,\n * if we do need to scroll we apply the icons-only class to the container\n */\nonMounted(() => {\n checkScrollability()\n\n // Re-check on window resize\n window.addEventListener('resize', checkScrollability)\n\n // Watch for changes in child elements\n if (containerRef.value) {\n mutationObserver = new MutationObserver(() => {\n checkScrollability()\n })\n\n mutationObserver.observe(containerRef.value, {\n childList: true,\n subtree: true,\n })\n }\n})\n\nonUnmounted(() => {\n // Clean up event listeners and observer\n window.removeEventListener('resize', checkScrollability)\n\n if (mutationObserver) {\n mutationObserver.disconnect()\n mutationObserver = null\n }\n})\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"custom-scroll narrow:mb-3 mb-1.5 flex h-auto min-h-8 max-w-full items-center gap-2 overflow-x-auto text-base whitespace-nowrap\"\n :class=\"{ 'icons-only': needsScroll }\">\n <slot />\n </div>\n</template>\n\n<style scoped>\n.icons-only :deep(span) {\n display: none;\n}\n</style>\n"],"mappings":""}
@@ -42,7 +42,7 @@ var LinkList_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
42
42
  return openBlock(), createElementBlock("div", {
43
43
  ref_key: "containerRef",
44
44
  ref: containerRef,
45
- class: normalizeClass([{ "icons-only": needsScroll.value }, "custom-scroll mb-3 flex h-auto min-h-8 max-w-full items-center gap-2 overflow-x-auto text-base whitespace-nowrap xl:mb-1.5"])
45
+ class: normalizeClass(["custom-scroll narrow:mb-3 mb-1.5 flex h-auto min-h-8 max-w-full items-center gap-2 overflow-x-auto text-base whitespace-nowrap", { "icons-only": needsScroll.value }])
46
46
  }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2);
47
47
  };
48
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LinkList.vue.script.js","names":[],"sources":["../../../src/components/LinkList/LinkList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onMounted, onUnmounted, ref } from 'vue'\n\nconst containerRef = ref<HTMLDivElement>()\n\n/** Whether the container needs to scroll */\nconst needsScroll = ref(false)\n\n/** Check if the container can scroll in either direction */\nconst checkScrollability = () => {\n if (!containerRef.value) {\n return\n }\n\n const { scrollWidth, clientWidth } = containerRef.value\n needsScroll.value = scrollWidth > clientWidth\n}\n\n/** MutationObserver to watch for changes in child elements */\nlet mutationObserver: MutationObserver | null = null\n\n/**\n * We use the mutation observer to watch for changes and check if we need to scroll,\n * if we do need to scroll we apply the icons-only class to the container\n */\nonMounted(() => {\n checkScrollability()\n\n // Re-check on window resize\n window.addEventListener('resize', checkScrollability)\n\n // Watch for changes in child elements\n if (containerRef.value) {\n mutationObserver = new MutationObserver(() => {\n checkScrollability()\n })\n\n mutationObserver.observe(containerRef.value, {\n childList: true,\n subtree: true,\n })\n }\n})\n\nonUnmounted(() => {\n // Clean up event listeners and observer\n window.removeEventListener('resize', checkScrollability)\n\n if (mutationObserver) {\n mutationObserver.disconnect()\n mutationObserver = null\n }\n})\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n :class=\"{ 'icons-only': needsScroll }\"\n class=\"custom-scroll mb-3 flex h-auto min-h-8 max-w-full items-center gap-2 overflow-x-auto text-base whitespace-nowrap xl:mb-1.5\">\n <slot />\n </div>\n</template>\n\n<style scoped>\n.icons-only :deep(span) {\n display: none;\n}\n</style>\n"],"mappings":";;;;;EAGA,MAAM,eAAe,KAAoB;;EAGzC,MAAM,cAAc,IAAI,MAAK;;EAG7B,MAAM,2BAA2B;AAC/B,OAAI,CAAC,aAAa,MAChB;GAGF,MAAM,EAAE,aAAa,gBAAgB,aAAa;AAClD,eAAY,QAAQ,cAAc;;;EAIpC,IAAI,mBAA4C;;;;;AAMhD,kBAAgB;AACd,uBAAmB;AAGnB,UAAO,iBAAiB,UAAU,mBAAkB;AAGpD,OAAI,aAAa,OAAO;AACtB,uBAAmB,IAAI,uBAAuB;AAC5C,yBAAmB;MACpB;AAED,qBAAiB,QAAQ,aAAa,OAAO;KAC3C,WAAW;KACX,SAAS;KACV,CAAA;;IAEJ;AAED,oBAAkB;AAEhB,UAAO,oBAAoB,UAAU,mBAAkB;AAEvD,OAAI,kBAAkB;AACpB,qBAAiB,YAAW;AAC5B,uBAAmB;;IAEtB;;uBAIC,mBAKM,OAAA;aAJA;IAAJ,KAAI;IACH,OAAK,eAAA,CAAA,EAAA,cAAkB,YAAA,OAAW,EAC7B,6HAA4H,CAAA;OAClI,WAAQ,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,EAAA,EAAA"}
1
+ {"version":3,"file":"LinkList.vue.script.js","names":[],"sources":["../../../src/components/LinkList/LinkList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onMounted, onUnmounted, ref } from 'vue'\n\nconst containerRef = ref<HTMLDivElement>()\n\n/** Whether the container needs to scroll */\nconst needsScroll = ref(false)\n\n/** Check if the container can scroll in either direction */\nconst checkScrollability = () => {\n if (!containerRef.value) {\n return\n }\n\n const { scrollWidth, clientWidth } = containerRef.value\n needsScroll.value = scrollWidth > clientWidth\n}\n\n/** MutationObserver to watch for changes in child elements */\nlet mutationObserver: MutationObserver | null = null\n\n/**\n * We use the mutation observer to watch for changes and check if we need to scroll,\n * if we do need to scroll we apply the icons-only class to the container\n */\nonMounted(() => {\n checkScrollability()\n\n // Re-check on window resize\n window.addEventListener('resize', checkScrollability)\n\n // Watch for changes in child elements\n if (containerRef.value) {\n mutationObserver = new MutationObserver(() => {\n checkScrollability()\n })\n\n mutationObserver.observe(containerRef.value, {\n childList: true,\n subtree: true,\n })\n }\n})\n\nonUnmounted(() => {\n // Clean up event listeners and observer\n window.removeEventListener('resize', checkScrollability)\n\n if (mutationObserver) {\n mutationObserver.disconnect()\n mutationObserver = null\n }\n})\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"custom-scroll narrow:mb-3 mb-1.5 flex h-auto min-h-8 max-w-full items-center gap-2 overflow-x-auto text-base whitespace-nowrap\"\n :class=\"{ 'icons-only': needsScroll }\">\n <slot />\n </div>\n</template>\n\n<style scoped>\n.icons-only :deep(span) {\n display: none;\n}\n</style>\n"],"mappings":";;;;;EAGA,MAAM,eAAe,KAAoB;;EAGzC,MAAM,cAAc,IAAI,MAAK;;EAG7B,MAAM,2BAA2B;AAC/B,OAAI,CAAC,aAAa,MAChB;GAGF,MAAM,EAAE,aAAa,gBAAgB,aAAa;AAClD,eAAY,QAAQ,cAAc;;;EAIpC,IAAI,mBAA4C;;;;;AAMhD,kBAAgB;AACd,uBAAmB;AAGnB,UAAO,iBAAiB,UAAU,mBAAkB;AAGpD,OAAI,aAAa,OAAO;AACtB,uBAAmB,IAAI,uBAAuB;AAC5C,yBAAmB;MACpB;AAED,qBAAiB,QAAQ,aAAa,OAAO;KAC3C,WAAW;KACX,SAAS;KACV,CAAA;;IAEJ;AAED,oBAAkB;AAEhB,UAAO,oBAAoB,UAAU,mBAAkB;AAEvD,OAAI,kBAAkB;AACpB,qBAAiB,YAAW;AAC5B,uBAAmB;;IAEtB;;uBAIC,mBAKM,OAAA;aAJA;IAAJ,KAAI;IACJ,OAAK,eAAA,CAAC,kIAAgI,EAAA,cAC9G,YAAA,OAAW,CAAA,CAAA;OACnC,WAAQ,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,EAAA,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"CompactSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Section/CompactSection.vue"],"names":[],"mappings":"AA4FA,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;AA6HF,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AAC/C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CompactSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Section/CompactSection.vue"],"names":[],"mappings":"AAiHA,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;AAkJF,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AAC/C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
2
2
  import CompactSection_vue_vue_type_script_setup_true_lang_default from "./CompactSection.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/components/Section/CompactSection.vue
5
- var CompactSection_default = /* @__PURE__ */ _plugin_vue_export_helper_default(CompactSection_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-999a158a"]]);
5
+ var CompactSection_default = /* @__PURE__ */ _plugin_vue_export_helper_default(CompactSection_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ea5f870d"]]);
6
6
  //#endregion
7
7
  export { CompactSection_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"CompactSection.vue.js","names":[],"sources":["../../../src/components/Section/CompactSection.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconCaretRight } from '@scalar/icons'\n\nimport { Anchor } from '@/components/Anchor'\n\nimport Section from './Section.vue'\n\nconst { id } = defineProps<{\n id: string\n label?: string\n modelValue: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'copyAnchorUrl'): void\n}>()\n</script>\n<template>\n <section\n :aria-label=\"label\"\n class=\"collapsible-section\">\n <button\n :id=\"id\"\n :aria-controls=\"id\"\n :aria-expanded=\"modelValue\"\n class=\"collapsible-section-trigger\"\n :class=\"{ 'collapsible-section-trigger-open': modelValue }\"\n type=\"button\"\n @click=\"emit('update:modelValue', !modelValue)\">\n <ScalarIconCaretRight\n class=\"size-3 transition-transform duration-100\"\n :class=\"{ 'rotate-90': modelValue }\"\n weight=\"bold\" />\n <Anchor\n class=\"collapsible-section-header\"\n @copyAnchorUrl=\"() => emit('copyAnchorUrl')\">\n <slot name=\"heading\" />\n </Anchor>\n </button>\n <Section\n v-if=\"modelValue\"\n class=\"collapsible-section-content\"\n :label=\"label\">\n <slot />\n </Section>\n </section>\n</template>\n<style scoped>\n.collapsible-section {\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n position: relative;\n}\n.collapsible-section-header {\n color: var(--scalar-color-1);\n}\n.collapsible-section .collapsible-section-trigger {\n display: flex;\n align-items: center;\n cursor: pointer;\n padding: 10px 0;\n font-size: var(--scalar-font-size-3);\n z-index: 1;\n position: relative;\n}\n.collapsible-section-trigger svg {\n color: var(--scalar-color-3);\n position: absolute;\n left: -19px;\n}\n.collapsible-section:hover .collapsible-section-trigger svg {\n color: var(--scalar-color-1);\n}\n.collapsible-section .collapsible-section-trigger :deep(.anchor-copy) {\n line-height: 18.5px;\n}\n.collapsible-section-content {\n padding: 0;\n margin: 0;\n margin-bottom: 10px;\n scroll-margin-top: 140px;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"CompactSection.vue.js","names":[],"sources":["../../../src/components/Section/CompactSection.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconCaretRight } from '@scalar/icons'\nimport { computed, useId } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\n\nimport Section from './Section.vue'\n\nconst { id } = defineProps<{\n id: string\n label?: string\n modelValue: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'copyAnchorUrl'): void\n}>()\n\n/** The trigger owns `id` as its deep link target, so the region it controls needs one of its own */\nconst contentId = computed<string>(() => `${id}-content`)\n\n/**\n * Name the trigger after the heading it renders by pointing `aria-labelledby` at it,\n * rather than copying the text into an `aria-label`. Referencing the visible node keeps\n * the accessible name in sync with what is on screen, so it can never drift into a\n * WCAG 2.5.3 (Label in Name) failure the way a duplicated string can.\n */\nconst labelId = useId()\n</script>\n<template>\n <section\n :aria-label=\"label\"\n class=\"collapsible-section\">\n <button\n :id=\"id\"\n :aria-controls=\"modelValue ? contentId : undefined\"\n :aria-expanded=\"modelValue\"\n :aria-labelledby=\"labelId\"\n class=\"collapsible-section-trigger\"\n :class=\"{ 'collapsible-section-trigger-open': modelValue }\"\n type=\"button\"\n @click=\"emit('update:modelValue', !modelValue)\">\n <ScalarIconCaretRight\n class=\"size-3 transition-transform duration-100\"\n :class=\"{ 'rotate-90': modelValue }\"\n weight=\"bold\" />\n <Anchor\n class=\"collapsible-section-header\"\n @copyAnchorUrl=\"() => emit('copyAnchorUrl')\">\n <!-- Wrap only the heading so `aria-labelledby` names the trigger after the\n visible text alone, excluding the caret and the nested copy-link button -->\n <span\n :id=\"labelId\"\n class=\"contents\">\n <slot name=\"heading\" />\n </span>\n </Anchor>\n </button>\n <Section\n v-if=\"modelValue\"\n :id=\"contentId\"\n class=\"collapsible-section-content\"\n :label=\"label\">\n <slot />\n </Section>\n </section>\n</template>\n<style scoped>\n.collapsible-section {\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n position: relative;\n}\n.collapsible-section-header {\n color: var(--scalar-color-1);\n}\n.collapsible-section .collapsible-section-trigger {\n display: flex;\n align-items: center;\n cursor: pointer;\n padding: 10px 0;\n font-size: var(--scalar-font-size-3);\n z-index: 1;\n position: relative;\n}\n.collapsible-section-trigger svg {\n color: var(--scalar-color-3);\n position: absolute;\n left: -19px;\n}\n.collapsible-section:hover .collapsible-section-trigger svg {\n color: var(--scalar-color-1);\n}\n.collapsible-section .collapsible-section-trigger :deep(.anchor-copy) {\n line-height: 18.5px;\n}\n.collapsible-section-content {\n padding: 0;\n margin: 0;\n margin-bottom: 10px;\n scroll-margin-top: 140px;\n}\n</style>\n"],"mappings":""}
@@ -1,14 +1,16 @@
1
1
  import Section_default from "./Section.vue.js";
2
2
  import Anchor_default from "../Anchor/Anchor.vue.js";
3
- import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, unref, withCtx } from "vue";
3
+ import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, unref, useId, withCtx } from "vue";
4
4
  import { ScalarIconCaretRight } from "@scalar/icons";
5
5
  //#region src/components/Section/CompactSection.vue?vue&type=script&setup=true&lang.ts
6
6
  var _hoisted_1 = ["aria-label"];
7
7
  var _hoisted_2 = [
8
8
  "id",
9
9
  "aria-controls",
10
- "aria-expanded"
10
+ "aria-expanded",
11
+ "aria-labelledby"
11
12
  ];
13
+ var _hoisted_3 = ["id"];
12
14
  var CompactSection_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
13
15
  __name: "CompactSection",
14
16
  props: {
@@ -19,14 +21,24 @@ var CompactSection_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
19
21
  emits: ["update:modelValue", "copyAnchorUrl"],
20
22
  setup(__props, { emit: __emit }) {
21
23
  const emit = __emit;
24
+ /** The trigger owns `id` as its deep link target, so the region it controls needs one of its own */
25
+ const contentId = computed(() => `${__props.id}-content`);
26
+ /**
27
+ * Name the trigger after the heading it renders by pointing `aria-labelledby` at it,
28
+ * rather than copying the text into an `aria-label`. Referencing the visible node keeps
29
+ * the accessible name in sync with what is on screen, so it can never drift into a
30
+ * WCAG 2.5.3 (Label in Name) failure the way a duplicated string can.
31
+ */
32
+ const labelId = useId();
22
33
  return (_ctx, _cache) => {
23
34
  return openBlock(), createElementBlock("section", {
24
35
  "aria-label": __props.label,
25
36
  class: "collapsible-section"
26
37
  }, [createElementVNode("button", {
27
38
  id: __props.id,
28
- "aria-controls": __props.id,
39
+ "aria-controls": __props.modelValue ? contentId.value : void 0,
29
40
  "aria-expanded": __props.modelValue,
41
+ "aria-labelledby": unref(labelId),
30
42
  class: normalizeClass(["collapsible-section-trigger", { "collapsible-section-trigger-open": __props.modelValue }]),
31
43
  type: "button",
32
44
  onClick: _cache[1] || (_cache[1] = ($event) => emit("update:modelValue", !__props.modelValue))
@@ -37,16 +49,20 @@ var CompactSection_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
37
49
  class: "collapsible-section-header",
38
50
  onCopyAnchorUrl: _cache[0] || (_cache[0] = () => emit("copyAnchorUrl"))
39
51
  }, {
40
- default: withCtx(() => [renderSlot(_ctx.$slots, "heading", {}, void 0, true)]),
52
+ default: withCtx(() => [createElementVNode("span", {
53
+ id: unref(labelId),
54
+ class: "contents"
55
+ }, [renderSlot(_ctx.$slots, "heading", {}, void 0, true)], 8, _hoisted_3)]),
41
56
  _: 3
42
57
  })], 10, _hoisted_2), __props.modelValue ? (openBlock(), createBlock(Section_default, {
43
58
  key: 0,
59
+ id: contentId.value,
44
60
  class: "collapsible-section-content",
45
61
  label: __props.label
46
62
  }, {
47
63
  default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
48
64
  _: 3
49
- }, 8, ["label"])) : createCommentVNode("", true)], 8, _hoisted_1);
65
+ }, 8, ["id", "label"])) : createCommentVNode("", true)], 8, _hoisted_1);
50
66
  };
51
67
  }
52
68
  });
@@ -1 +1 @@
1
- {"version":3,"file":"CompactSection.vue.script.js","names":[],"sources":["../../../src/components/Section/CompactSection.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconCaretRight } from '@scalar/icons'\n\nimport { Anchor } from '@/components/Anchor'\n\nimport Section from './Section.vue'\n\nconst { id } = defineProps<{\n id: string\n label?: string\n modelValue: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'copyAnchorUrl'): void\n}>()\n</script>\n<template>\n <section\n :aria-label=\"label\"\n class=\"collapsible-section\">\n <button\n :id=\"id\"\n :aria-controls=\"id\"\n :aria-expanded=\"modelValue\"\n class=\"collapsible-section-trigger\"\n :class=\"{ 'collapsible-section-trigger-open': modelValue }\"\n type=\"button\"\n @click=\"emit('update:modelValue', !modelValue)\">\n <ScalarIconCaretRight\n class=\"size-3 transition-transform duration-100\"\n :class=\"{ 'rotate-90': modelValue }\"\n weight=\"bold\" />\n <Anchor\n class=\"collapsible-section-header\"\n @copyAnchorUrl=\"() => emit('copyAnchorUrl')\">\n <slot name=\"heading\" />\n </Anchor>\n </button>\n <Section\n v-if=\"modelValue\"\n class=\"collapsible-section-content\"\n :label=\"label\">\n <slot />\n </Section>\n </section>\n</template>\n<style scoped>\n.collapsible-section {\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n position: relative;\n}\n.collapsible-section-header {\n color: var(--scalar-color-1);\n}\n.collapsible-section .collapsible-section-trigger {\n display: flex;\n align-items: center;\n cursor: pointer;\n padding: 10px 0;\n font-size: var(--scalar-font-size-3);\n z-index: 1;\n position: relative;\n}\n.collapsible-section-trigger svg {\n color: var(--scalar-color-3);\n position: absolute;\n left: -19px;\n}\n.collapsible-section:hover .collapsible-section-trigger svg {\n color: var(--scalar-color-1);\n}\n.collapsible-section .collapsible-section-trigger :deep(.anchor-copy) {\n line-height: 18.5px;\n}\n.collapsible-section-content {\n padding: 0;\n margin: 0;\n margin-bottom: 10px;\n scroll-margin-top: 140px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAaA,MAAM,OAAO;;uBAMX,mBA2BU,WAAA;IA1BP,cAAY,QAAA;IACb,OAAM;OACN,mBAiBS,UAAA;IAhBN,IAAI,QAAA;IACJ,iBAAe,QAAA;IACf,iBAAe,QAAA;IAChB,OAAK,eAAA,CAAC,+BAA6B,EAAA,oCACW,QAAA,YAAU,CAAA,CAAA;IACxD,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,qBAAA,CAAuB,QAAA,WAAU;OAC7C,YAGkB,MAAA,qBAAA,EAAA;IAFhB,OAAK,eAAA,CAAC,4CAA0C,EAAA,aACzB,QAAA,YAAU,CAAA,CAAA;IACjC,QAAO;2BACT,YAIS,MAAA,eAAA,EAAA;IAHP,OAAM;IACL,iBAAa,OAAA,OAAA,OAAA,WAAQ,KAAI,gBAAA;;2BACH,CAAvB,WAAuB,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA;;yBAInB,QAAA,cAAA,WAAA,EADR,YAKU,iBAAA;;IAHR,OAAM;IACL,OAAO,QAAA;;2BACA,CAAR,WAAQ,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"CompactSection.vue.script.js","names":[],"sources":["../../../src/components/Section/CompactSection.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconCaretRight } from '@scalar/icons'\nimport { computed, useId } from 'vue'\n\nimport { Anchor } from '@/components/Anchor'\n\nimport Section from './Section.vue'\n\nconst { id } = defineProps<{\n id: string\n label?: string\n modelValue: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'copyAnchorUrl'): void\n}>()\n\n/** The trigger owns `id` as its deep link target, so the region it controls needs one of its own */\nconst contentId = computed<string>(() => `${id}-content`)\n\n/**\n * Name the trigger after the heading it renders by pointing `aria-labelledby` at it,\n * rather than copying the text into an `aria-label`. Referencing the visible node keeps\n * the accessible name in sync with what is on screen, so it can never drift into a\n * WCAG 2.5.3 (Label in Name) failure the way a duplicated string can.\n */\nconst labelId = useId()\n</script>\n<template>\n <section\n :aria-label=\"label\"\n class=\"collapsible-section\">\n <button\n :id=\"id\"\n :aria-controls=\"modelValue ? contentId : undefined\"\n :aria-expanded=\"modelValue\"\n :aria-labelledby=\"labelId\"\n class=\"collapsible-section-trigger\"\n :class=\"{ 'collapsible-section-trigger-open': modelValue }\"\n type=\"button\"\n @click=\"emit('update:modelValue', !modelValue)\">\n <ScalarIconCaretRight\n class=\"size-3 transition-transform duration-100\"\n :class=\"{ 'rotate-90': modelValue }\"\n weight=\"bold\" />\n <Anchor\n class=\"collapsible-section-header\"\n @copyAnchorUrl=\"() => emit('copyAnchorUrl')\">\n <!-- Wrap only the heading so `aria-labelledby` names the trigger after the\n visible text alone, excluding the caret and the nested copy-link button -->\n <span\n :id=\"labelId\"\n class=\"contents\">\n <slot name=\"heading\" />\n </span>\n </Anchor>\n </button>\n <Section\n v-if=\"modelValue\"\n :id=\"contentId\"\n class=\"collapsible-section-content\"\n :label=\"label\">\n <slot />\n </Section>\n </section>\n</template>\n<style scoped>\n.collapsible-section {\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n position: relative;\n}\n.collapsible-section-header {\n color: var(--scalar-color-1);\n}\n.collapsible-section .collapsible-section-trigger {\n display: flex;\n align-items: center;\n cursor: pointer;\n padding: 10px 0;\n font-size: var(--scalar-font-size-3);\n z-index: 1;\n position: relative;\n}\n.collapsible-section-trigger svg {\n color: var(--scalar-color-3);\n position: absolute;\n left: -19px;\n}\n.collapsible-section:hover .collapsible-section-trigger svg {\n color: var(--scalar-color-1);\n}\n.collapsible-section .collapsible-section-trigger :deep(.anchor-copy) {\n line-height: 18.5px;\n}\n.collapsible-section-content {\n padding: 0;\n margin: 0;\n margin-bottom: 10px;\n scroll-margin-top: 140px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAcA,MAAM,OAAO;;EAMb,MAAM,YAAY,eAAuB,GAAG,QAAA,GAAG,UAAS;;;;;;;EAQxD,MAAM,UAAU,OAAM;;uBAGpB,mBAmCU,WAAA;IAlCP,cAAY,QAAA;IACb,OAAM;OACN,mBAwBS,UAAA;IAvBN,IAAI,QAAA;IACJ,iBAAe,QAAA,aAAa,UAAA,QAAY,KAAA;IACxC,iBAAe,QAAA;IACf,mBAAiB,MAAA,QAAO;IACzB,OAAK,eAAA,CAAC,+BAA6B,EAAA,oCACW,QAAA,YAAU,CAAA,CAAA;IACxD,MAAK;IACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,qBAAA,CAAuB,QAAA,WAAU;OAC7C,YAGkB,MAAA,qBAAA,EAAA;IAFhB,OAAK,eAAA,CAAC,4CAA0C,EAAA,aACzB,QAAA,YAAU,CAAA,CAAA;IACjC,QAAO;2BACT,YAUS,MAAA,eAAA,EAAA;IATP,OAAM;IACL,iBAAa,OAAA,OAAA,OAAA,WAAQ,KAAI,gBAAA;;2BAOnB,CAJP,mBAIO,QAAA;KAHJ,IAAI,MAAA,QAAO;KACZ,OAAM;QACN,WAAuB,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,EAAA,GAAA,WAAA,CAAA,CAAA;;yBAKrB,QAAA,cAAA,WAAA,EADR,YAMU,iBAAA;;IAJP,IAAI,UAAA;IACL,OAAM;IACL,OAAO,QAAA;;2BACA,CAAR,WAAQ,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Section/SectionHeader.vue"],"names":[],"mappings":"AAmDA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC;AA0CF,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAW,CAAE;AAC3C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK7C,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SectionHeader.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Section/SectionHeader.vue"],"names":[],"mappings":"AA6CA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC;AA4CF,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAW,CAAE;AAC3C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK7C,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export
2
2
  import SectionHeader_vue_vue_type_script_setup_true_lang_default from "./SectionHeader.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/components/Section/SectionHeader.vue
5
- var SectionHeader_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SectionHeader_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-09a18ec6"]]);
5
+ var SectionHeader_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SectionHeader_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-7607c44e"]]);
6
6
  //#endregion
7
7
  export { SectionHeader_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.vue.js","names":[],"sources":["../../../src/components/Section/SectionHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst { tight, removeMargin = false } = defineProps<{\n tight?: boolean\n removeMargin?: boolean\n}>()\n</script>\n\n<template>\n <div class=\"section-header-wrapper xl:gap-12\">\n <div\n class=\"section-header\"\n :class=\"{ tight, 'mb-3': !removeMargin }\">\n <slot />\n </div>\n <slot\n v-if=\"$slots.links\"\n name=\"links\" />\n </div>\n</template>\n\n<style scoped>\n@reference \"@/style.css\";\n\n.section-header-wrapper {\n display: grid;\n grid-template-columns: 1fr;\n}\n\n@variant xl {\n .section-header-wrapper {\n grid-template-columns: repeat(2, 1fr);\n }\n}\n\n.section-header {\n font-size: var(--font-size, var(--scalar-heading-1));\n font-weight: var(--font-weight, var(--scalar-bold));\n /* prettier-ignore */\n color: var(--scalar-color-1);\n word-wrap: break-word;\n line-height: 1.45;\n margin-top: 0;\n}\n\n.section-header.tight {\n margin-bottom: 6px;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"SectionHeader.vue.js","names":[],"sources":["../../../src/components/Section/SectionHeader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst { tight, removeMargin = false } = defineProps<{\n tight?: boolean\n removeMargin?: boolean\n}>()\n</script>\n\n<!--\n The reference is an embeddable widget, so the header collapses based on the\n rendered width of the reference (the narrow: variant), not the viewport.\n The section-header-wrapper class stays as a styling hook for\n SectionContainerAccordion.\n-->\n<template>\n <div\n class=\"section-header-wrapper narrow:grid-cols-1 narrow:gap-0 grid grid-cols-2 gap-12\">\n <div\n class=\"section-header\"\n :class=\"{ tight, 'mb-3': !removeMargin }\">\n <slot />\n </div>\n <slot\n v-if=\"$slots.links\"\n name=\"links\" />\n </div>\n</template>\n\n<style scoped>\n.section-header {\n font-size: var(--font-size, var(--scalar-heading-1));\n font-weight: var(--font-weight, var(--scalar-bold));\n /* prettier-ignore */\n color: var(--scalar-color-1);\n word-wrap: break-word;\n line-height: 1.45;\n margin-top: 0;\n}\n\n.section-header.tight {\n margin-bottom: 6px;\n}\n</style>\n"],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, normalizeClass, openBlock, renderSlot } from "vue";
2
2
  //#region src/components/Section/SectionHeader.vue?vue&type=script&setup=true&lang.ts
3
- var _hoisted_1 = { class: "section-header-wrapper xl:gap-12" };
3
+ var _hoisted_1 = { class: "section-header-wrapper narrow:grid-cols-1 narrow:gap-0 grid grid-cols-2 gap-12" };
4
4
  var SectionHeader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
5
5
  __name: "SectionHeader",
6
6
  props: {