@scalar/blocks 0.4.2 → 0.5.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 (351) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +45 -0
  3. package/dist/code-example/components/CodeExample.vue.d.ts +5 -0
  4. package/dist/code-example/components/CodeExample.vue.d.ts.map +1 -1
  5. package/dist/code-example/components/CodeExample.vue.js +1 -1
  6. package/dist/code-example/components/CodeExample.vue.js.map +1 -1
  7. package/dist/code-example/components/CodeExample.vue.script.js +12 -9
  8. package/dist/code-example/components/CodeExample.vue.script.js.map +1 -1
  9. package/dist/code-example/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  10. package/dist/code-example/helpers/operation-to-har/operation-to-har.js +1 -0
  11. package/dist/code-example/helpers/operation-to-har/operation-to-har.js.map +1 -1
  12. package/dist/code-example/helpers/operation-to-har/process-body.d.ts.map +1 -1
  13. package/dist/code-example/helpers/operation-to-har/process-body.js +51 -45
  14. package/dist/code-example/helpers/operation-to-har/process-body.js.map +1 -1
  15. package/dist/code-example/mount.d.ts +2 -0
  16. package/dist/code-example/mount.d.ts.map +1 -1
  17. package/dist/code-example/mount.js +3 -0
  18. package/dist/code-example/mount.js.map +1 -1
  19. package/dist/constants.js +1 -1
  20. package/dist/schema/LinkButton.vue.d.ts +14 -0
  21. package/dist/schema/LinkButton.vue.d.ts.map +1 -0
  22. package/dist/schema/LinkButton.vue.js +15 -0
  23. package/dist/schema/LinkButton.vue.js.map +1 -0
  24. package/dist/schema/RenderString.vue.d.ts +7 -0
  25. package/dist/schema/RenderString.vue.d.ts.map +1 -0
  26. package/dist/schema/RenderString.vue.js +7 -0
  27. package/dist/schema/RenderString.vue.js.map +1 -0
  28. package/dist/schema/RenderString.vue.script.js +14 -0
  29. package/dist/schema/RenderString.vue.script.js.map +1 -0
  30. package/dist/schema/Schema.vue.d.ts +50 -0
  31. package/dist/schema/Schema.vue.d.ts.map +1 -0
  32. package/dist/schema/Schema.vue.js +9 -0
  33. package/dist/schema/Schema.vue.js.map +1 -0
  34. package/dist/schema/Schema.vue.script.js +234 -0
  35. package/dist/schema/Schema.vue.script.js.map +1 -0
  36. package/dist/schema/SchemaCollapsedPreview.vue.d.ts +17 -0
  37. package/dist/schema/SchemaCollapsedPreview.vue.d.ts.map +1 -0
  38. package/dist/schema/SchemaCollapsedPreview.vue.js +7 -0
  39. package/dist/schema/SchemaCollapsedPreview.vue.js.map +1 -0
  40. package/dist/schema/SchemaCollapsedPreview.vue.script.js +28 -0
  41. package/dist/schema/SchemaCollapsedPreview.vue.script.js.map +1 -0
  42. package/dist/schema/SchemaComposition.vue.d.ts +42 -0
  43. package/dist/schema/SchemaComposition.vue.d.ts.map +1 -0
  44. package/dist/schema/SchemaComposition.vue.js +9 -0
  45. package/dist/schema/SchemaComposition.vue.js.map +1 -0
  46. package/dist/schema/SchemaComposition.vue.script.js +231 -0
  47. package/dist/schema/SchemaComposition.vue.script.js.map +1 -0
  48. package/dist/schema/SchemaEnumPropertyItem.vue.d.ts +8 -0
  49. package/dist/schema/SchemaEnumPropertyItem.vue.d.ts.map +1 -0
  50. package/dist/schema/SchemaEnumPropertyItem.vue.js +7 -0
  51. package/dist/schema/SchemaEnumPropertyItem.vue.js.map +1 -0
  52. package/dist/schema/SchemaEnumPropertyItem.vue.script.js +24 -0
  53. package/dist/schema/SchemaEnumPropertyItem.vue.script.js.map +1 -0
  54. package/dist/schema/SchemaEnums.vue.d.ts +11 -0
  55. package/dist/schema/SchemaEnums.vue.d.ts.map +1 -0
  56. package/dist/schema/SchemaEnums.vue.js +9 -0
  57. package/dist/schema/SchemaEnums.vue.js.map +1 -0
  58. package/dist/schema/SchemaEnums.vue.script.js +78 -0
  59. package/dist/schema/SchemaEnums.vue.script.js.map +1 -0
  60. package/dist/schema/SchemaGlyphPuck.vue.d.ts +33 -0
  61. package/dist/schema/SchemaGlyphPuck.vue.d.ts.map +1 -0
  62. package/dist/schema/SchemaGlyphPuck.vue.js +7 -0
  63. package/dist/schema/SchemaGlyphPuck.vue.js.map +1 -0
  64. package/dist/schema/SchemaGlyphPuck.vue.script.js +30 -0
  65. package/dist/schema/SchemaGlyphPuck.vue.script.js.map +1 -0
  66. package/dist/schema/SchemaGutterToggle.vue.d.ts +32 -0
  67. package/dist/schema/SchemaGutterToggle.vue.d.ts.map +1 -0
  68. package/dist/schema/SchemaGutterToggle.vue.js +7 -0
  69. package/dist/schema/SchemaGutterToggle.vue.js.map +1 -0
  70. package/dist/schema/SchemaGutterToggle.vue.script.js +43 -0
  71. package/dist/schema/SchemaGutterToggle.vue.script.js.map +1 -0
  72. package/dist/schema/SchemaHeading.vue.d.ts +9 -0
  73. package/dist/schema/SchemaHeading.vue.d.ts.map +1 -0
  74. package/dist/schema/SchemaHeading.vue.js +9 -0
  75. package/dist/schema/SchemaHeading.vue.js.map +1 -0
  76. package/dist/schema/SchemaHeading.vue.script.js +35 -0
  77. package/dist/schema/SchemaHeading.vue.script.js.map +1 -0
  78. package/dist/schema/SchemaObjectExampleCodeBlock.vue.d.ts +8 -0
  79. package/dist/schema/SchemaObjectExampleCodeBlock.vue.d.ts.map +1 -0
  80. package/dist/schema/SchemaObjectExampleCodeBlock.vue.js +7 -0
  81. package/dist/schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -0
  82. package/dist/schema/SchemaObjectExampleCodeBlock.vue.script.js +48 -0
  83. package/dist/schema/SchemaObjectExampleCodeBlock.vue.script.js.map +1 -0
  84. package/dist/schema/SchemaObjectProperties.vue.d.ts +22 -0
  85. package/dist/schema/SchemaObjectProperties.vue.d.ts.map +1 -0
  86. package/dist/schema/SchemaObjectProperties.vue.js +7 -0
  87. package/dist/schema/SchemaObjectProperties.vue.js.map +1 -0
  88. package/dist/schema/SchemaObjectProperties.vue.script.js +207 -0
  89. package/dist/schema/SchemaObjectProperties.vue.script.js.map +1 -0
  90. package/dist/schema/SchemaProperty.vue.d.ts +88 -0
  91. package/dist/schema/SchemaProperty.vue.d.ts.map +1 -0
  92. package/dist/schema/SchemaProperty.vue.js +9 -0
  93. package/dist/schema/SchemaProperty.vue.js.map +1 -0
  94. package/dist/schema/SchemaProperty.vue.script.js +456 -0
  95. package/dist/schema/SchemaProperty.vue.script.js.map +1 -0
  96. package/dist/schema/SchemaPropertyDefault.vue.d.ts +7 -0
  97. package/dist/schema/SchemaPropertyDefault.vue.d.ts.map +1 -0
  98. package/dist/schema/SchemaPropertyDefault.vue.js +9 -0
  99. package/dist/schema/SchemaPropertyDefault.vue.js.map +1 -0
  100. package/dist/schema/SchemaPropertyDefault.vue.script.js +64 -0
  101. package/dist/schema/SchemaPropertyDefault.vue.script.js.map +1 -0
  102. package/dist/schema/SchemaPropertyDetail.vue.d.ts +22 -0
  103. package/dist/schema/SchemaPropertyDetail.vue.d.ts.map +1 -0
  104. package/dist/schema/SchemaPropertyDetail.vue.js +9 -0
  105. package/dist/schema/SchemaPropertyDetail.vue.js.map +1 -0
  106. package/dist/schema/SchemaPropertyDetail.vue.script.js +25 -0
  107. package/dist/schema/SchemaPropertyDetail.vue.script.js.map +1 -0
  108. package/dist/schema/SchemaPropertyExamples.vue.d.ts +8 -0
  109. package/dist/schema/SchemaPropertyExamples.vue.d.ts.map +1 -0
  110. package/dist/schema/SchemaPropertyExamples.vue.js +9 -0
  111. package/dist/schema/SchemaPropertyExamples.vue.js.map +1 -0
  112. package/dist/schema/SchemaPropertyExamples.vue.script.js +125 -0
  113. package/dist/schema/SchemaPropertyExamples.vue.script.js.map +1 -0
  114. package/dist/schema/SchemaPropertyHeading.vue.d.ts +59 -0
  115. package/dist/schema/SchemaPropertyHeading.vue.d.ts.map +1 -0
  116. package/dist/schema/SchemaPropertyHeading.vue.js +9 -0
  117. package/dist/schema/SchemaPropertyHeading.vue.js.map +1 -0
  118. package/dist/schema/SchemaPropertyHeading.vue.script.js +270 -0
  119. package/dist/schema/SchemaPropertyHeading.vue.script.js.map +1 -0
  120. package/dist/schema/SchemaPropertyPattern.vue.d.ts +7 -0
  121. package/dist/schema/SchemaPropertyPattern.vue.d.ts.map +1 -0
  122. package/dist/schema/SchemaPropertyPattern.vue.js +9 -0
  123. package/dist/schema/SchemaPropertyPattern.vue.js.map +1 -0
  124. package/dist/schema/SchemaPropertyPattern.vue.script.js +45 -0
  125. package/dist/schema/SchemaPropertyPattern.vue.script.js.map +1 -0
  126. package/dist/schema/SchemaRailPanel.vue.d.ts +35 -0
  127. package/dist/schema/SchemaRailPanel.vue.d.ts.map +1 -0
  128. package/dist/schema/SchemaRailPanel.vue.js +7 -0
  129. package/dist/schema/SchemaRailPanel.vue.js.map +1 -0
  130. package/dist/schema/SchemaRailPanel.vue.script.js +49 -0
  131. package/dist/schema/SchemaRailPanel.vue.script.js.map +1 -0
  132. package/dist/schema/components/CopyLinkButton.vue.d.ts +27 -0
  133. package/dist/schema/components/CopyLinkButton.vue.d.ts.map +1 -0
  134. package/dist/schema/components/CopyLinkButton.vue.js +7 -0
  135. package/dist/schema/components/CopyLinkButton.vue.js.map +1 -0
  136. package/dist/schema/components/CopyLinkButton.vue.script.js +26 -0
  137. package/dist/schema/components/CopyLinkButton.vue.script.js.map +1 -0
  138. package/dist/schema/components/WithBreadcrumb.vue.d.ts +19 -0
  139. package/dist/schema/components/WithBreadcrumb.vue.d.ts.map +1 -0
  140. package/dist/schema/components/WithBreadcrumb.vue.js +7 -0
  141. package/dist/schema/components/WithBreadcrumb.vue.js.map +1 -0
  142. package/dist/schema/components/WithBreadcrumb.vue.script.js +18 -0
  143. package/dist/schema/components/WithBreadcrumb.vue.script.js.map +1 -0
  144. package/dist/schema/expansion/index.d.ts +2 -0
  145. package/dist/schema/expansion/index.d.ts.map +1 -0
  146. package/dist/schema/expansion/index.js +2 -0
  147. package/dist/schema/helpers/dynamic-scope.d.ts +27 -0
  148. package/dist/schema/helpers/dynamic-scope.d.ts.map +1 -0
  149. package/dist/schema/helpers/dynamic-scope.js +8 -0
  150. package/dist/schema/helpers/dynamic-scope.js.map +1 -0
  151. package/dist/schema/helpers/format-example.d.ts +5 -0
  152. package/dist/schema/helpers/format-example.d.ts.map +1 -0
  153. package/dist/schema/helpers/format-example.js +12 -0
  154. package/dist/schema/helpers/format-example.js.map +1 -0
  155. package/dist/schema/helpers/format-value.d.ts +5 -0
  156. package/dist/schema/helpers/format-value.d.ts.map +1 -0
  157. package/dist/schema/helpers/format-value.js +8 -0
  158. package/dist/schema/helpers/format-value.js.map +1 -0
  159. package/dist/schema/helpers/get-compositions-to-render.d.ts +33 -0
  160. package/dist/schema/helpers/get-compositions-to-render.d.ts.map +1 -0
  161. package/dist/schema/helpers/get-compositions-to-render.js +39 -0
  162. package/dist/schema/helpers/get-compositions-to-render.js.map +1 -0
  163. package/dist/schema/helpers/get-discriminator-values.d.ts +4 -0
  164. package/dist/schema/helpers/get-discriminator-values.d.ts.map +1 -0
  165. package/dist/schema/helpers/get-discriminator-values.js +6 -0
  166. package/dist/schema/helpers/get-discriminator-values.js.map +1 -0
  167. package/dist/schema/helpers/get-enum-values.d.ts +9 -0
  168. package/dist/schema/helpers/get-enum-values.d.ts.map +1 -0
  169. package/dist/schema/helpers/get-enum-values.js +16 -0
  170. package/dist/schema/helpers/get-enum-values.js.map +1 -0
  171. package/dist/schema/helpers/get-property-description.d.ts +9 -0
  172. package/dist/schema/helpers/get-property-description.d.ts.map +1 -0
  173. package/dist/schema/helpers/get-property-description.js +27 -0
  174. package/dist/schema/helpers/get-property-description.js.map +1 -0
  175. package/dist/schema/helpers/get-ref-name.d.ts +24 -0
  176. package/dist/schema/helpers/get-ref-name.d.ts.map +1 -0
  177. package/dist/schema/helpers/get-ref-name.js +15 -0
  178. package/dist/schema/helpers/get-ref-name.js.map +1 -0
  179. package/dist/schema/helpers/get-schema-type.d.ts +13 -0
  180. package/dist/schema/helpers/get-schema-type.d.ts.map +1 -0
  181. package/dist/schema/helpers/get-schema-type.js +24 -0
  182. package/dist/schema/helpers/get-schema-type.js.map +1 -0
  183. package/dist/schema/helpers/get-type-signature-tokens.d.ts +48 -0
  184. package/dist/schema/helpers/get-type-signature-tokens.d.ts.map +1 -0
  185. package/dist/schema/helpers/get-type-signature-tokens.js +62 -0
  186. package/dist/schema/helpers/get-type-signature-tokens.js.map +1 -0
  187. package/dist/schema/helpers/has-complex-array-items.d.ts +10 -0
  188. package/dist/schema/helpers/has-complex-array-items.d.ts.map +1 -0
  189. package/dist/schema/helpers/has-complex-array-items.js +22 -0
  190. package/dist/schema/helpers/has-complex-array-items.js.map +1 -0
  191. package/dist/schema/helpers/index.d.ts +12 -0
  192. package/dist/schema/helpers/index.d.ts.map +1 -0
  193. package/dist/schema/helpers/index.js +12 -0
  194. package/dist/schema/helpers/is-empty-schema-object.d.ts +8 -0
  195. package/dist/schema/helpers/is-empty-schema-object.d.ts.map +1 -0
  196. package/dist/schema/helpers/is-empty-schema-object.js +11 -0
  197. package/dist/schema/helpers/is-empty-schema-object.js.map +1 -0
  198. package/dist/schema/helpers/is-model-linkable.d.ts +15 -0
  199. package/dist/schema/helpers/is-model-linkable.d.ts.map +1 -0
  200. package/dist/schema/helpers/is-model-linkable.js +13 -0
  201. package/dist/schema/helpers/is-model-linkable.js.map +1 -0
  202. package/dist/schema/helpers/is-on-schema-target-path.d.ts +3 -0
  203. package/dist/schema/helpers/is-on-schema-target-path.d.ts.map +1 -0
  204. package/dist/schema/helpers/is-on-schema-target-path.js +6 -0
  205. package/dist/schema/helpers/is-on-schema-target-path.js.map +1 -0
  206. package/dist/schema/helpers/is-type-object.d.ts +5 -0
  207. package/dist/schema/helpers/is-type-object.d.ts.map +1 -0
  208. package/dist/schema/helpers/is-type-object.js +15 -0
  209. package/dist/schema/helpers/is-type-object.js.map +1 -0
  210. package/dist/schema/helpers/merge-all-of-schemas.d.ts +12 -0
  211. package/dist/schema/helpers/merge-all-of-schemas.d.ts.map +1 -0
  212. package/dist/schema/helpers/merge-all-of-schemas.js +151 -0
  213. package/dist/schema/helpers/merge-all-of-schemas.js.map +1 -0
  214. package/dist/schema/helpers/normalize-object-composition.d.ts +9 -0
  215. package/dist/schema/helpers/normalize-object-composition.d.ts.map +1 -0
  216. package/dist/schema/helpers/normalize-object-composition.js +29 -0
  217. package/dist/schema/helpers/normalize-object-composition.js.map +1 -0
  218. package/dist/schema/helpers/optimize-value-for-display.d.ts +13 -0
  219. package/dist/schema/helpers/optimize-value-for-display.d.ts.map +1 -0
  220. package/dist/schema/helpers/optimize-value-for-display.js +64 -0
  221. package/dist/schema/helpers/optimize-value-for-display.js.map +1 -0
  222. package/dist/schema/helpers/partition-all-of-compositions.d.ts +32 -0
  223. package/dist/schema/helpers/partition-all-of-compositions.d.ts.map +1 -0
  224. package/dist/schema/helpers/partition-all-of-compositions.js +67 -0
  225. package/dist/schema/helpers/partition-all-of-compositions.js.map +1 -0
  226. package/dist/schema/helpers/schema-composition.d.ts +4 -0
  227. package/dist/schema/helpers/schema-composition.d.ts.map +1 -0
  228. package/dist/schema/helpers/schema-composition.js +11 -0
  229. package/dist/schema/helpers/schema-composition.js.map +1 -0
  230. package/dist/schema/helpers/schema-cycle.d.ts +31 -0
  231. package/dist/schema/helpers/schema-cycle.d.ts.map +1 -0
  232. package/dist/schema/helpers/schema-cycle.js +8 -0
  233. package/dist/schema/helpers/schema-cycle.js.map +1 -0
  234. package/dist/schema/helpers/schema-expansion.d.ts +89 -0
  235. package/dist/schema/helpers/schema-expansion.d.ts.map +1 -0
  236. package/dist/schema/helpers/schema-expansion.js +93 -0
  237. package/dist/schema/helpers/schema-expansion.js.map +1 -0
  238. package/dist/schema/helpers/schema-keyboard-nav.d.ts +23 -0
  239. package/dist/schema/helpers/schema-keyboard-nav.d.ts.map +1 -0
  240. package/dist/schema/helpers/schema-keyboard-nav.js +36 -0
  241. package/dist/schema/helpers/schema-keyboard-nav.js.map +1 -0
  242. package/dist/schema/helpers/schema-name.d.ts +27 -0
  243. package/dist/schema/helpers/schema-name.d.ts.map +1 -0
  244. package/dist/schema/helpers/schema-name.js +40 -0
  245. package/dist/schema/helpers/schema-name.js.map +1 -0
  246. package/dist/schema/helpers/should-display-description.d.ts +10 -0
  247. package/dist/schema/helpers/should-display-description.d.ts.map +1 -0
  248. package/dist/schema/helpers/should-display-description.js +6 -0
  249. package/dist/schema/helpers/should-display-description.js.map +1 -0
  250. package/dist/schema/helpers/should-display-heading.d.ts +11 -0
  251. package/dist/schema/helpers/should-display-heading.d.ts.map +1 -0
  252. package/dist/schema/helpers/should-display-heading.js +6 -0
  253. package/dist/schema/helpers/should-display-heading.js.map +1 -0
  254. package/dist/schema/helpers/should-render-array-item-composition.d.ts +10 -0
  255. package/dist/schema/helpers/should-render-array-item-composition.d.ts.map +1 -0
  256. package/dist/schema/helpers/should-render-array-item-composition.js +12 -0
  257. package/dist/schema/helpers/should-render-array-item-composition.js.map +1 -0
  258. package/dist/schema/helpers/sort-property-names.d.ts +23 -0
  259. package/dist/schema/helpers/sort-property-names.d.ts.map +1 -0
  260. package/dist/schema/helpers/sort-property-names.js +55 -0
  261. package/dist/schema/helpers/sort-property-names.js.map +1 -0
  262. package/dist/schema/helpers/unwrap-for-read.d.ts +48 -0
  263. package/dist/schema/helpers/unwrap-for-read.d.ts.map +1 -0
  264. package/dist/schema/helpers/unwrap-for-read.js +8 -0
  265. package/dist/schema/helpers/unwrap-for-read.js.map +1 -0
  266. package/dist/schema/index.d.ts +12 -0
  267. package/dist/schema/index.d.ts.map +1 -0
  268. package/dist/schema/index.js +11 -0
  269. package/dist/schema/localization/index.d.ts +59 -0
  270. package/dist/schema/localization/index.d.ts.map +1 -0
  271. package/dist/schema/localization/index.js +18 -0
  272. package/dist/schema/localization/index.js.map +1 -0
  273. package/dist/schema/localization/locales/ar.d.ts +58 -0
  274. package/dist/schema/localization/locales/ar.d.ts.map +1 -0
  275. package/dist/schema/localization/locales/ar.js +60 -0
  276. package/dist/schema/localization/locales/ar.js.map +1 -0
  277. package/dist/schema/localization/locales/de.d.ts +58 -0
  278. package/dist/schema/localization/locales/de.d.ts.map +1 -0
  279. package/dist/schema/localization/locales/de.js +60 -0
  280. package/dist/schema/localization/locales/de.js.map +1 -0
  281. package/dist/schema/localization/locales/en.d.ts +58 -0
  282. package/dist/schema/localization/locales/en.d.ts.map +1 -0
  283. package/dist/schema/localization/locales/en.js +60 -0
  284. package/dist/schema/localization/locales/en.js.map +1 -0
  285. package/dist/schema/localization/locales/es.d.ts +58 -0
  286. package/dist/schema/localization/locales/es.d.ts.map +1 -0
  287. package/dist/schema/localization/locales/es.js +60 -0
  288. package/dist/schema/localization/locales/es.js.map +1 -0
  289. package/dist/schema/localization/locales/fr.d.ts +58 -0
  290. package/dist/schema/localization/locales/fr.d.ts.map +1 -0
  291. package/dist/schema/localization/locales/fr.js +60 -0
  292. package/dist/schema/localization/locales/fr.js.map +1 -0
  293. package/dist/schema/localization/locales/pt.d.ts +58 -0
  294. package/dist/schema/localization/locales/pt.d.ts.map +1 -0
  295. package/dist/schema/localization/locales/pt.js +60 -0
  296. package/dist/schema/localization/locales/pt.js.map +1 -0
  297. package/dist/schema/localization/locales/ru.d.ts +58 -0
  298. package/dist/schema/localization/locales/ru.d.ts.map +1 -0
  299. package/dist/schema/localization/locales/ru.js +60 -0
  300. package/dist/schema/localization/locales/ru.js.map +1 -0
  301. package/dist/schema/localization/locales/zh-cn.d.ts +58 -0
  302. package/dist/schema/localization/locales/zh-cn.d.ts.map +1 -0
  303. package/dist/schema/localization/locales/zh-cn.js +60 -0
  304. package/dist/schema/localization/locales/zh-cn.js.map +1 -0
  305. package/dist/schema/localization/translations.d.ts +460 -0
  306. package/dist/schema/localization/translations.d.ts.map +1 -0
  307. package/dist/schema/localization/translations.js +23 -0
  308. package/dist/schema/localization/translations.js.map +1 -0
  309. package/dist/schema/request-body-composition-index.d.ts +8 -0
  310. package/dist/schema/request-body-composition-index.d.ts.map +1 -0
  311. package/dist/schema/request-body-composition-index.js +6 -0
  312. package/dist/schema/request-body-composition-index.js.map +1 -0
  313. package/dist/schema/schema-tree.bench.d.ts +2 -0
  314. package/dist/schema/schema-tree.bench.d.ts.map +1 -0
  315. package/dist/schema/types.d.ts +51 -0
  316. package/dist/schema/types.d.ts.map +1 -0
  317. package/dist/shared/Badge.vue.d.ts +17 -0
  318. package/dist/shared/Badge.vue.d.ts.map +1 -0
  319. package/dist/shared/Badge.vue.js +9 -0
  320. package/dist/shared/Badge.vue.js.map +1 -0
  321. package/dist/shared/Badge.vue.script.js +16 -0
  322. package/dist/shared/Badge.vue.script.js.map +1 -0
  323. package/dist/shared/ScreenReader.vue.d.ts +21 -0
  324. package/dist/shared/ScreenReader.vue.d.ts.map +1 -0
  325. package/dist/shared/ScreenReader.vue.js +7 -0
  326. package/dist/shared/ScreenReader.vue.js.map +1 -0
  327. package/dist/shared/ScreenReader.vue.script.js +19 -0
  328. package/dist/shared/ScreenReader.vue.script.js.map +1 -0
  329. package/dist/shared/index.d.ts +3 -0
  330. package/dist/shared/index.d.ts.map +1 -0
  331. package/dist/shared/index.js +3 -0
  332. package/dist/specification-extensions/ExtensionValue.vue.d.ts +13 -0
  333. package/dist/specification-extensions/ExtensionValue.vue.d.ts.map +1 -0
  334. package/dist/specification-extensions/ExtensionValue.vue.js +7 -0
  335. package/dist/specification-extensions/ExtensionValue.vue.js.map +1 -0
  336. package/dist/specification-extensions/ExtensionValue.vue.script.js +84 -0
  337. package/dist/specification-extensions/ExtensionValue.vue.script.js.map +1 -0
  338. package/dist/specification-extensions/SpecificationExtensions.vue.d.ts +9 -0
  339. package/dist/specification-extensions/SpecificationExtensions.vue.d.ts.map +1 -0
  340. package/dist/specification-extensions/SpecificationExtensions.vue.js +7 -0
  341. package/dist/specification-extensions/SpecificationExtensions.vue.js.map +1 -0
  342. package/dist/specification-extensions/SpecificationExtensions.vue.script.js +21 -0
  343. package/dist/specification-extensions/SpecificationExtensions.vue.script.js.map +1 -0
  344. package/dist/specification-extensions/index.d.ts +2 -0
  345. package/dist/specification-extensions/index.d.ts.map +1 -0
  346. package/dist/specification-extensions/index.js +2 -0
  347. package/dist/style.css +576 -15
  348. package/dist/styles/schema-tree.css +91 -0
  349. package/dist/styles/tailwind.config.css +22 -0
  350. package/dist/vue-styles.css +1 -1
  351. package/package.json +45 -7
@@ -0,0 +1,234 @@
1
+ import e from "../shared/ScreenReader.vue.js";
2
+ import { SCHEMA_DYNAMIC_SCOPE_SYMBOL as t, resolveDynamicSchema as n, useDynamicScope as ee } from "./helpers/dynamic-scope.js";
3
+ import { unwrapForRead as r } from "./helpers/unwrap-for-read.js";
4
+ import { inferDiscriminatorMappingComposition as te } from "./helpers/get-compositions-to-render.js";
5
+ import { isTypeObject as i } from "./helpers/is-type-object.js";
6
+ import { isEmptySchemaObject as a } from "./helpers/is-empty-schema-object.js";
7
+ import { isOnSchemaTargetPath as o } from "./helpers/is-on-schema-target-path.js";
8
+ import { mergeAllOfSchemas as s } from "./helpers/merge-all-of-schemas.js";
9
+ import { partitionAllOfCompositions as c } from "./helpers/partition-all-of-compositions.js";
10
+ import { SCHEMA_ANCESTORS_SYMBOL as l } from "./helpers/schema-cycle.js";
11
+ import { SCHEMA_TREE_ROOT_SYMBOL as u, toNodeKey as d, useSchemaExpansion as ne } from "./helpers/schema-expansion.js";
12
+ import { handleTreeKeydown as re } from "./helpers/schema-keyboard-nav.js";
13
+ import { useLocalization as ie } from "./localization/index.js";
14
+ import ae from "./SchemaGlyphPuck.vue.js";
15
+ import oe from "./SchemaComposition.vue.js";
16
+ import se from "./SchemaProperty.vue.js";
17
+ import ce from "./SchemaObjectProperties.vue.js";
18
+ import { Fragment as le, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createTextVNode as _, createVNode as v, defineComponent as y, inject as b, normalizeClass as x, openBlock as S, provide as C, toDisplayString as w, toRef as ue, unref as T, useId as E, vShow as de, withCtx as fe, withDirectives as pe } from "vue";
19
+ import { ScalarMarkdown as D } from "@scalar/components/markdown";
20
+ import { pushDynamicScope as O } from "@scalar/workspace-store/helpers/dynamic-ref";
21
+ import { resolve as k } from "@scalar/workspace-store/resolve";
22
+ //#region src/schema/Schema.vue?vue&type=script&setup=true&lang.ts
23
+ var A = {
24
+ key: 0,
25
+ class: "schema-card-description [.schema-card--level-0:nth-of-type(1)>&]:has-[+.schema-properties]:mb-0! [.schema-card--level-0:nth-of-type(1)>&]:has-[+.schema-properties]:border-b-0! [.schema-card--level-0:nth-of-type(1)>&]:has-[+.schema-properties]:pb-0!"
26
+ }, j = {
27
+ key: 1,
28
+ class: "text-c-2 py-1.5"
29
+ }, M = {
30
+ key: 0,
31
+ class: "schema-properties w-full! rounded-none! border-0!"
32
+ }, N = [
33
+ "id",
34
+ "aria-controls",
35
+ "aria-expanded"
36
+ ], P = { class: "additional-toggle-label" }, F = ["id", "role"], I = /*@__PURE__*/ y({
37
+ __name: "Schema",
38
+ props: {
39
+ schema: {},
40
+ level: { default: 0 },
41
+ depth: { default: 0 },
42
+ name: {},
43
+ compact: { type: Boolean },
44
+ noncollapsible: {
45
+ type: Boolean,
46
+ default: !1
47
+ },
48
+ hideHeading: { type: Boolean },
49
+ hideDescription: {
50
+ type: Boolean,
51
+ default: !1
52
+ },
53
+ additionalProperties: { type: Boolean },
54
+ additionalPropertyCount: {},
55
+ hideModelNames: {
56
+ type: Boolean,
57
+ default: !1
58
+ },
59
+ discriminator: {},
60
+ breadcrumb: {},
61
+ eventBus: {},
62
+ options: {},
63
+ schemaContext: {},
64
+ compositionPath: {},
65
+ cycleKey: {},
66
+ scrollTargetId: {},
67
+ specificationExtension: {},
68
+ expansion: {}
69
+ },
70
+ setup(y) {
71
+ let { translate: I } = ie(), L = f(() => y.additionalPropertyCount === void 0 ? I("schema.showAdditionalProperties") : I(y.additionalPropertyCount === 1 ? "schema.showOneMoreProperty" : "schema.showMoreProperties", { count: y.additionalPropertyCount })), R = f(() => y.hideModelNames || !!y.options.hideModelNames), z = ee(), B = f(() => r(y.schema)), V = f(() => {
72
+ let e = B.value;
73
+ if (!e || typeof e != "object") return e;
74
+ let t = n(e, z);
75
+ return "$ref" in t ? k.schema(t) : t;
76
+ }), H = B.value ? n(B.value, z) : void 0;
77
+ C(t, H ? O(z, H) : z);
78
+ let U = b(l, void 0), W = f(() => y.cycleKey != null && !!U?.has(y.cycleKey)), G = new Set(U ?? []);
79
+ y.cycleKey != null && G.add(y.cycleKey), C(l, G);
80
+ let me = f(() => !!y.options.expandAllSchemaProperties && !W.value), he = f(() => o(d(y.breadcrumb), y.scrollTargetId ?? "")), ge = f(() => y.noncollapsible || me.value || he.value), K = f(() => {
81
+ let e = V.value;
82
+ if (y.hideDescription) return null;
83
+ let t = B.value;
84
+ return t?.allOf && t.allOf.length > 0 && y.name === "Request Body" ? s(t)?.description || null : !e?.description || typeof e.description != "string" || e.enum || !("properties" in e) && !("patternProperties" in e) && !("additionalProperties" in e) && !("allOf" in e) || t?.allOf && c(t).segments.some((t) => t.kind === "object" && t.schema.description === e.description && ("properties" in t.schema || "patternProperties" in t.schema || "additionalProperties" in t.schema) && !t.schema.enum) ? null : e.description;
85
+ }), q = f(() => B.value && !y.discriminator && i(B.value) ? te(B.value, y.options.document) : null), _e = f(() => !q.value && i(V.value)), ve = b(u, !1), J = f(() => y.depth === 0 && !ve);
86
+ C(u, !0);
87
+ let ye = (e) => {
88
+ J.value && y.options.schemaKeyboardNav && re(e);
89
+ }, Y = y.expansion ?? ne(ue(() => y.scrollTargetId ?? "")), be = E(), X = f(() => d(y.breadcrumb) || `~anonymous-${be}`), Z = f(() => y.noncollapsible || Y.isExpanded(X.value, {
90
+ cyclic: W.value,
91
+ defaultOpen: ge.value
92
+ })), Q = f(() => !y.additionalProperties || Z.value), xe = E(), $ = E(), Se = () => {
93
+ y.noncollapsible || Y.setExpanded(X.value, !Z.value);
94
+ };
95
+ return (t, n) => V.value && Object.keys(V.value).length ? (S(), h("div", {
96
+ key: 0,
97
+ class: x(["schema-card", [
98
+ `schema-card--level-${y.level}`,
99
+ {
100
+ "schema-card--compact": y.compact,
101
+ "schema-card--open": Z.value
102
+ },
103
+ { "additional-card--tree": y.additionalProperties },
104
+ "schema-card--tree",
105
+ { "schema-tree [--schema-glyph-background:var(--scalar-background-1)] [--schema-glyph-color:var(--scalar-color-2)]": J.value }
106
+ ]]),
107
+ onKeydown: ye
108
+ }, [
109
+ K.value ? (S(), h("div", A, [v(T(D), { value: K.value }, null, 8, ["value"])])) : m("", !0),
110
+ T(a)(V.value) ? (S(), h("div", j, w(T(I)("schema.emptyObject")), 1)) : m("", !0),
111
+ g("div", { class: x(["schema-properties", [{ "schema-properties-open": Z.value }, "w-full! rounded-none! border-0! [.schema-card--level-0:nth-of-type(1)>.schema-card-description+&]:mt-0! [.schema-card-description+&]:mt-1.5!"]]) }, [y.additionalProperties ? pe((S(), h("div", M, [g("button", {
112
+ id: T(xe),
113
+ "aria-controls": Q.value ? T($) : void 0,
114
+ "aria-expanded": Z.value,
115
+ class: "schema-card-title schema-card-title--compact group/tree-control additional-toggle--tree font-code text-c-1! relative flex h-auto min-h-8 items-center gap-0! px-0! py-[var(--schema-row-pad,6px)]! text-sm! font-bold!",
116
+ type: "button",
117
+ onClick: Se
118
+ }, [v(ae, { class: "additional-toggle-glyph" }), g("span", P, [_(w(L.value) + " ", 1), y.name ? (S(), p(e, { key: 0 }, {
119
+ default: fe(() => [_(w(T(I)("schema.forName", { name: y.name })), 1)]),
120
+ _: 1
121
+ })) : m("", !0)])], 8, N)], 512)), [[de, !Z.value]]) : m("", !0), Q.value ? (S(), h("ul", {
122
+ key: 1,
123
+ id: T($),
124
+ role: _e.value ? "list" : "presentation"
125
+ }, [q.value ? (S(), p(oe, {
126
+ key: 0,
127
+ breadcrumb: y.breadcrumb,
128
+ compact: y.compact,
129
+ composition: "oneOf",
130
+ compositionPath: y.compositionPath,
131
+ depth: y.depth,
132
+ discriminator: B.value?.discriminator,
133
+ eventBus: y.eventBus,
134
+ expansion: T(Y),
135
+ hideHeading: y.hideHeading,
136
+ hideModelNames: R.value,
137
+ level: y.level,
138
+ name: y.name,
139
+ options: y.options,
140
+ schema: q.value,
141
+ schemaContext: y.schemaContext,
142
+ scrollTargetId: y.scrollTargetId,
143
+ specificationExtension: y.specificationExtension
144
+ }, null, 8, [
145
+ "breadcrumb",
146
+ "compact",
147
+ "compositionPath",
148
+ "depth",
149
+ "discriminator",
150
+ "eventBus",
151
+ "expansion",
152
+ "hideHeading",
153
+ "hideModelNames",
154
+ "level",
155
+ "name",
156
+ "options",
157
+ "schema",
158
+ "schemaContext",
159
+ "scrollTargetId",
160
+ "specificationExtension"
161
+ ])) : T(i)(V.value) ? (S(), p(ce, {
162
+ key: 1,
163
+ breadcrumb: y.breadcrumb,
164
+ compact: y.compact,
165
+ compositionPath: y.compositionPath,
166
+ depth: y.depth,
167
+ discriminator: y.discriminator,
168
+ eventBus: y.eventBus,
169
+ expansion: T(Y),
170
+ hideHeading: y.hideHeading,
171
+ hideModelNames: R.value,
172
+ level: y.level + 1,
173
+ options: y.options,
174
+ schema: V.value,
175
+ schemaContext: y.schemaContext,
176
+ scrollTargetId: y.scrollTargetId,
177
+ specificationExtension: y.specificationExtension
178
+ }, null, 8, [
179
+ "breadcrumb",
180
+ "compact",
181
+ "compositionPath",
182
+ "depth",
183
+ "discriminator",
184
+ "eventBus",
185
+ "expansion",
186
+ "hideHeading",
187
+ "hideModelNames",
188
+ "level",
189
+ "options",
190
+ "schema",
191
+ "schemaContext",
192
+ "scrollTargetId",
193
+ "specificationExtension"
194
+ ])) : (S(), h(le, { key: 2 }, [V.value ? (S(), p(se, {
195
+ key: 0,
196
+ breadcrumb: y.breadcrumb,
197
+ compact: y.compact,
198
+ compositionPath: y.compositionPath,
199
+ depth: y.depth,
200
+ discriminator: y.discriminator,
201
+ eventBus: y.eventBus,
202
+ expansion: T(Y),
203
+ hideHeading: y.hideHeading,
204
+ hideModelNames: R.value,
205
+ level: y.level,
206
+ options: y.options,
207
+ schema: V.value,
208
+ schemaContext: y.schemaContext,
209
+ scrollTargetId: y.scrollTargetId,
210
+ specificationExtension: y.specificationExtension
211
+ }, null, 8, [
212
+ "breadcrumb",
213
+ "compact",
214
+ "compositionPath",
215
+ "depth",
216
+ "discriminator",
217
+ "eventBus",
218
+ "expansion",
219
+ "hideHeading",
220
+ "hideModelNames",
221
+ "level",
222
+ "options",
223
+ "schema",
224
+ "schemaContext",
225
+ "scrollTargetId",
226
+ "specificationExtension"
227
+ ])) : m("", !0)], 64))], 8, F)) : m("", !0)], 2)
228
+ ], 34)) : m("", !0);
229
+ }
230
+ });
231
+ //#endregion
232
+ export { I as default };
233
+
234
+ //# sourceMappingURL=Schema.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.vue.script.js","names":[],"sources":["../../src/schema/Schema.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { pushDynamicScope } from '@scalar/workspace-store/helpers/dynamic-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, inject, provide, toRef, useId } from 'vue'\n\nimport ScreenReader from '../shared/ScreenReader.vue'\nimport {\n resolveDynamicSchema,\n SCHEMA_DYNAMIC_SCOPE_SYMBOL,\n useDynamicScope,\n} from './helpers/dynamic-scope'\nimport { inferDiscriminatorMappingComposition } from './helpers/get-compositions-to-render'\nimport { isEmptySchemaObject } from './helpers/is-empty-schema-object'\nimport { isOnSchemaTargetPath } from './helpers/is-on-schema-target-path'\nimport { isTypeObject } from './helpers/is-type-object'\nimport { mergeAllOfSchemas } from './helpers/merge-all-of-schemas'\nimport { partitionAllOfCompositions } from './helpers/partition-all-of-compositions'\nimport { SCHEMA_ANCESTORS_SYMBOL } from './helpers/schema-cycle'\nimport {\n SCHEMA_TREE_ROOT_SYMBOL,\n toNodeKey,\n useSchemaExpansion,\n} from './helpers/schema-expansion'\nimport { handleTreeKeydown } from './helpers/schema-keyboard-nav'\nimport { unwrapForRead } from './helpers/unwrap-for-read'\nimport { useLocalization } from './localization'\nimport SchemaComposition from './SchemaComposition.vue'\nimport SchemaGlyphPuck from './SchemaGlyphPuck.vue'\nimport SchemaObjectProperties from './SchemaObjectProperties.vue'\nimport SchemaProperty from './SchemaProperty.vue'\nimport type { SchemaOptions, SchemaRenderingProps } from './types'\n\nconst {\n scrollTargetId,\n expansion: expansionProp,\n schema: schemaProp,\n level = 0,\n depth = 0,\n name,\n compact,\n noncollapsible = false,\n hideHeading,\n hideDescription = false,\n additionalProperties,\n additionalPropertyCount,\n discriminator,\n breadcrumb,\n hideModelNames: hideModelNamesProp = false,\n options,\n schemaContext,\n compositionPath,\n cycleKey,\n} = defineProps<\n {\n schema?: SchemaObject\n /** Track how deep we've gone */\n level?: number\n /**\n * Real nesting depth. Not derived from `level`, whose stride differs per\n * edge (object +2, composition +1, non-object root +0).\n */\n depth?: number\n /* Show as a heading */\n name?: string\n /** A tighter layout with less borders and without a heading */\n compact?: boolean\n /** Shows a toggle to hide/show children */\n noncollapsible?: boolean\n /** Hide the heading */\n hideHeading?: boolean\n /** Hide the schema description */\n hideDescription?: boolean\n /** Show a special one way toggle for additional properties, also has a top border when open */\n additionalProperties?: boolean\n /** Number of request body properties hidden behind the overflow control. */\n additionalPropertyCount?: number\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Discriminator object */\n discriminator?: DiscriminatorObject\n /** Breadcrumb for the schema */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into a single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", composition dropdown selection is synced with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n /**\n * Stable identity of this schema node, derived from its raw (unresolved)\n * value by the parent. Used to detect self-referential cycles. See\n * {@link getCycleKey}.\n */\n cycleKey?: unknown\n } & SchemaRenderingProps\n>()\nconst { translate } = useLocalization()\n\nconst additionalPropertiesLabel = computed((): string => {\n if (additionalPropertyCount === undefined) {\n return translate('schema.showAdditionalProperties')\n }\n return translate(\n additionalPropertyCount === 1\n ? 'schema.showOneMoreProperty'\n : 'schema.showMoreProperties',\n { count: additionalPropertyCount },\n )\n})\n\nconst hideModelNames = computed(\n (): boolean => hideModelNamesProp || !!options.hideModelNames,\n)\n\n/**\n * The dynamic scope inherited from ancestor schema resources.\n *\n * Used to bind JSON Schema 2020-12 `$dynamicRef`s to the active `$dynamicAnchor` while walking the\n * tree. Empty at the root. See {@link useDynamicScope}.\n */\nconst dynamicScope = useDynamicScope()\n\n/**\n * The schema subtree, read through the magic and overrides proxies only.\n *\n * Everything below this point walks the subtree read-only, so the Vue reactive and\n * detect-changes layers are peeled off once here instead of being paid for on every nested\n * property access. See {@link unwrapForRead} for why that is safe and why the other two\n * layers stay. Reactivity on the prop itself is kept: the computed tracks the `schema` prop,\n * so replacing or switching the document still re-renders.\n */\nconst schema = computed((): SchemaObject | undefined =>\n unwrapForRead(schemaProp),\n)\n\n/**\n * The schema this node actually renders.\n *\n * Two normalizations happen here, both no-ops for ordinary schemas:\n * - A top-level `$dynamicRef` is bound to its concrete type via the inherited dynamic scope.\n * - A resource that extends a template through a root `$ref` (JSON Schema 2020-12 `$ref` alongside\n * `$defs`, e.g. a `PaginatedResponse` binding) is merged so its inherited properties render.\n */\nconst resolvedSchema = computed((): SchemaObject | undefined => {\n const value = schema.value\n\n if (!value || typeof value !== 'object') {\n return value\n }\n\n const bound = resolveDynamicSchema(value, dynamicScope)\n return '$ref' in bound ? resolve.schema(bound) : bound\n})\n\n/**\n * Re-provide the dynamic scope grown with this resource so nested `$dynamicRef`s bind here.\n *\n * Built once at setup from the resource's stable identity (like the ancestor set below);\n * `pushDynamicScope` only grows the scope for schemas that can carry a `$dynamicAnchor`.\n *\n * The raw schema is pushed, not the merged {@link resolvedSchema}: merging through `resolve.schema`\n * coerces the node and drops the resolved `$ref-value` from entries inside `$defs`, which\n * `$dynamicAnchor` resolution relies on to dereference the bound type (e.g. `User`).\n */\nconst scopeSchema = schema.value\n ? resolveDynamicSchema(schema.value, dynamicScope)\n : undefined\nprovide(\n SCHEMA_DYNAMIC_SCOPE_SYMBOL,\n scopeSchema ? pushDynamicScope(dynamicScope, scopeSchema) : dynamicScope,\n)\n\n/**\n * Cycle-safe `expandAllSchemaProperties`.\n *\n * We track ancestor schema keys along the current render path. A node is\n * treated as cyclic when its key is already present in the ancestor set, which\n * indicates that rendering has looped back onto a self-referential schema.\n *\n * This lets us default-expand finite branches while stopping automatic\n * expansion only at cycle boundaries, preventing infinite recursion.\n */\nconst ancestors = inject(SCHEMA_ANCESTORS_SYMBOL, undefined)\n\nconst isCyclic = computed(\n (): boolean => cycleKey != null && !!ancestors?.has(cycleKey),\n)\n\n// Re-provide the ancestor set augmented with this node so descendants can\n// detect cycles back to it. Built once at setup; a node's key is stable.\nconst childAncestors = new Set<unknown>(ancestors ?? [])\nif (cycleKey != null) {\n childAncestors.add(cycleKey)\n}\nprovide(SCHEMA_ANCESTORS_SYMBOL, childAncestors)\n\nconst shouldForceExpand = computed(\n (): boolean => !!options.expandAllSchemaProperties && !isCyclic.value,\n)\n\n/**\n * Whether this schema sits on the path to the current anchor/scroll target.\n *\n * Property anchors are dot-joined breadcrumbs, so every disclosure that wraps\n * the target has a breadcrumb that is a prefix of the target id. Opening those\n * disclosures is what makes deep links to collapsed (hidden) properties work\n * without forcing every schema open via `expandAllSchemaProperties`.\n */\nconst isOnTargetPath = computed((): boolean =>\n isOnSchemaTargetPath(toNodeKey(breadcrumb), scrollTargetId ?? ''),\n)\n\n/**\n * Whether the disclosure starts expanded. Non-collapsible schemas are always\n * open. When `expandAllSchemaProperties` is enabled, finite branches start\n * expanded by default while cyclic branches remain collapsed to avoid recursion\n * loops. We also open any disclosure on the path to the current scroll target so\n * deep links resolve even when the property is collapsed.\n *\n * This is only the last step of the store's resolution order: it applies when\n * nobody has touched this node and no bulk action or baseline covers it.\n */\nconst defaultOpen = computed(\n (): boolean =>\n noncollapsible || shouldForceExpand.value || isOnTargetPath.value,\n)\n\n/** Gets the description to show for the schema */\nconst schemaDescription = computed(() => {\n const value = resolvedSchema.value\n\n if (hideDescription) {\n return null\n }\n\n const rawSchema = schema.value\n\n // For the request body we want to show the description of the merged allOf schema.\n // Merging keeps the base description (when set) and otherwise lets the last allOf\n // member win, matching how the merged composition is rendered below. The nested\n // merged Schema in `SchemaComposition` hides its own description in this case so\n // the text is not rendered twice.\n if (\n rawSchema?.allOf &&\n rawSchema.allOf.length > 0 &&\n name === 'Request Body'\n ) {\n return mergeAllOfSchemas(rawSchema)?.description || null\n }\n\n // Don't show description if there's no description or it's not a string\n if (!value?.description || typeof value.description !== 'string') {\n return null\n }\n\n // Don't show description for enum schemas (they have special handling)\n if (value.enum) {\n return null\n }\n\n // Will be shown in the properties anyway. A composed schema is the exception:\n // its members render as their own cards with their own descriptions, so the\n // schema's own description has nowhere else to go.\n if (\n !('properties' in value) &&\n !('patternProperties' in value) &&\n !('additionalProperties' in value) &&\n !('allOf' in value)\n ) {\n return null\n }\n\n // An allOf object segment already displays the merged description. Keep a\n // distinct outer description, but do not repeat text carried by that segment.\n if (\n rawSchema?.allOf &&\n partitionAllOfCompositions(rawSchema).segments.some(\n (segment) =>\n segment.kind === 'object' &&\n segment.schema.description === value.description &&\n ('properties' in segment.schema ||\n 'patternProperties' in segment.schema ||\n 'additionalProperties' in segment.schema) &&\n !segment.schema.enum,\n )\n ) {\n return null\n }\n\n // Return the schema's own description\n return value.description\n})\n\n/**\n * Infer a selector for mapped discriminators that do not declare `oneOf`.\n * Threaded discriminators skip inference to avoid recursive allOf variants.\n */\nconst inferredDiscriminatorComposition = computed(() =>\n schema.value && !discriminator && isTypeObject(schema.value)\n ? inferDiscriminatorMappingComposition(schema.value, options.document)\n : null,\n)\n\n/**\n * Whether the panel holds the schema's property rows. Mirrors the branches in\n * the panel below: any other root (a composition, a primitive, an array)\n * renders a single nameless passthrough row that carries the real property\n * list inside it, and a list of one row is structure the eye never sees.\n * Announcing it makes assistive tech read \"list with 1 item\" before the list\n * the reader actually wanted, so that wrapper is presentational instead.\n */\nconst rendersPropertyRows = computed(\n (): boolean =>\n !inferredDiscriminatorComposition.value &&\n isTypeObject(resolvedSchema.value),\n)\n\n/**\n * Whether an enclosing Schema already established a tree root. `depth === 0`\n * alone is not enough: a nested Schema can mount at depth 0 (an `allOf`\n * member, or a caller that omits `depth`), and a second root would mount a\n * second sticky strip and keydown root, firing every arrow key twice.\n */\nconst hasTreeRootAbove = inject(SCHEMA_TREE_ROOT_SYMBOL, false)\n\n/** The root-only features (glyph tokens, keyboard navigation) live on the outermost tree root only */\nconst isTreeRoot = computed((): boolean => depth === 0 && !hasTreeRootAbove)\n\n// Descendants must know a root exists above them, whatever depth they mount at.\nprovide(SCHEMA_TREE_ROOT_SYMBOL, true)\n\n/** Delegated arrow-key navigation, active only when the flag is on */\nconst onTreeKeydown = (event: KeyboardEvent): void => {\n if (isTreeRoot.value && options.schemaKeyboardNav) {\n handleTreeKeydown(event)\n }\n}\n\nconst expansion =\n expansionProp ?? useSchemaExpansion(toRef(() => scrollTargetId ?? ''))\n\n/**\n * Fallback identity for nodes mounted without a breadcrumb (models, AsyncAPI\n * messages, the classic layouts). Until those surfaces pass real breadcrumbs,\n * this keeps them from all resolving to the empty key and toggling as one node.\n */\nconst anonymousKey = useId()\n\nconst nodeKey = computed(\n (): string => toNodeKey(breadcrumb) || `~anonymous-${anonymousKey}`,\n)\n\n/**\n * Whether this disclosure is open. Resolved from the store on every read, not\n * latched at mount, so a second deep link into an already-rendered operation\n * works and expansion survives the composition variant remount.\n */\nconst open = computed(\n (): boolean =>\n noncollapsible ||\n expansion.isExpanded(nodeKey.value, {\n cyclic: isCyclic.value,\n defaultOpen: defaultOpen.value,\n }),\n)\n\n/** Additional-property panels hide until opened; every other panel always renders */\nconst panelRendered = computed(\n (): boolean => !additionalProperties || open.value,\n)\n\nconst toggleId = useId()\nconst panelId = useId()\n\n/**\n * The reveal is one-way: its button hides once the panel opens, so nothing\n * here can collapse a subtree that holds focus. The rows inside handle that\n * themselves (see `toggleTree` in SchemaProperty.vue).\n */\nconst toggle = (): void => {\n if (noncollapsible) {\n return\n }\n\n expansion.setExpanded(nodeKey.value, !open.value)\n}\n</script>\n<template>\n <!--\n Not a Headless UI `<Disclosure>`: it has no controlled mode, and expansion\n is driven from the store, so the button and the panel are owned directly.\n -->\n <div\n v-if=\"resolvedSchema && Object.keys(resolvedSchema).length\"\n class=\"schema-card\"\n :class=\"[\n `schema-card--level-${level}`,\n { 'schema-card--compact': compact, 'schema-card--open': open },\n /*\n * No margin of its own: the row above already ends with its own 6px pad,\n * so the reveal keeps the tree's row-to-row rhythm exactly.\n */\n { 'additional-card--tree': additionalProperties },\n 'schema-card--tree',\n /*\n * Tree-local tokens, namespaced --schema-* so no preset or user theme\n * breaks. WCAG 1.4.11 wants 3:1 for the glyph; --scalar-color-3 measures\n * 3.28:1 only before opacity, so the glyph reads color-2. The narrow\n * container tightens the indent and the control sizes, but that lives at\n * app scope (styles/tailwind.config.css) with the other rail tokens: the\n * surfaces above a tree root draw rails too, and they must tighten with\n * it or their glyphs land on a different line.\n */\n {\n 'schema-tree [--schema-glyph-background:var(--scalar-background-1)] [--schema-glyph-color:var(--scalar-color-2)]':\n isTreeRoot,\n },\n ]\"\n @keydown=\"onTreeKeydown\">\n <!-- Schema description -->\n <!-- Without a card box the level-0 divider (and its negative-margin tuck)\n would be a stray line, so the whole treatment is switched off -->\n <div\n v-if=\"schemaDescription\"\n class=\"schema-card-description [.schema-card--level-0:nth-of-type(1)>&]:has-[+.schema-properties]:mb-0! [.schema-card--level-0:nth-of-type(1)>&]:has-[+.schema-properties]:border-b-0! [.schema-card--level-0:nth-of-type(1)>&]:has-[+.schema-properties]:pb-0!\">\n <ScalarMarkdown :value=\"schemaDescription\" />\n </div>\n <div\n v-if=\"isEmptySchemaObject(resolvedSchema)\"\n class=\"text-c-2 py-1.5\">\n {{ translate('schema.emptyObject') }}\n </div>\n <!-- A rail per depth instead of a bordered box per level, so the card\n chrome is switched off. 6px under a description keeps the 12px row\n rhythm; at level 0 the divider is gone, so even that 6px would double\n up with the first row's own padding. -->\n <div\n class=\"schema-properties\"\n :class=\"[\n { 'schema-properties-open': open },\n 'w-full! rounded-none! border-0! [.schema-card--level-0:nth-of-type(1)>.schema-card-description+&]:mt-0! [.schema-card-description+&]:mt-1.5!',\n ]\">\n <!-- Toggle to collapse/expand long lists of properties -->\n <div\n v-if=\"additionalProperties\"\n v-show=\"!open\"\n class=\"schema-properties w-full! rounded-none! border-0!\">\n <!-- The reveal reads as one more row — mono label flush with the\n sibling rows' text, a plus puck centred on the sibling toggles'\n line. `min-h-8` is the row's own 32px: the label then centres in\n the same 20px slot a heading gets, so the first revealed property\n lands exactly where the label was instead of 2.5px below it. -->\n <button\n :id=\"toggleId\"\n :aria-controls=\"panelRendered ? panelId : undefined\"\n :aria-expanded=\"open\"\n class=\"schema-card-title schema-card-title--compact group/tree-control additional-toggle--tree font-code text-c-1! relative flex h-auto min-h-8 items-center gap-0! px-0! py-[var(--schema-row-pad,6px)]! text-sm! font-bold!\"\n type=\"button\"\n @click=\"toggle\">\n <!-- The reveal is one more row of the tree, so its plus is the same\n puck the row toggles draw, on the same gutter line -->\n <SchemaGlyphPuck class=\"additional-toggle-glyph\" />\n <span class=\"additional-toggle-label\">\n {{ additionalPropertiesLabel }}\n <ScreenReader v-if=\"name\">\n {{ translate('schema.forName', { name }) }}\n </ScreenReader>\n </span>\n </button>\n </div>\n\n <!-- The theme reset strips list-style, which makes Safari and VoiceOver\n drop list semantics; an explicit role restores them. When the panel\n holds a single passthrough row instead of property rows, the wrapper\n is presentational so only the real list nested inside it is\n announced. -->\n <ul\n v-if=\"panelRendered\"\n :id=\"panelId\"\n :role=\"rendersPropertyRows ? 'list' : 'presentation'\">\n <!-- Variant selector inferred from a discriminator mapping -->\n <SchemaComposition\n v-if=\"inferredDiscriminatorComposition\"\n :breadcrumb\n :compact\n composition=\"oneOf\"\n :compositionPath=\"compositionPath\"\n :depth=\"depth\"\n :discriminator=\"schema?.discriminator\"\n :eventBus=\"eventBus\"\n :expansion=\"expansion\"\n :hideHeading\n :hideModelNames\n :level=\"level\"\n :name=\"name\"\n :options\n :schema=\"inferredDiscriminatorComposition\"\n :schemaContext=\"schemaContext\"\n :scrollTargetId=\"scrollTargetId\"\n :specificationExtension=\"specificationExtension\" />\n <!-- Object properties -->\n <SchemaObjectProperties\n v-else-if=\"isTypeObject(resolvedSchema)\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :depth=\"depth\"\n :discriminator\n :eventBus=\"eventBus\"\n :expansion=\"expansion\"\n :hideHeading\n :hideModelNames\n :level=\"level + 1\"\n :options\n :schema=\"resolvedSchema\"\n :schemaContext=\"schemaContext\"\n :scrollTargetId=\"scrollTargetId\"\n :specificationExtension=\"specificationExtension\" />\n <!-- Not an object -->\n <template v-else>\n <SchemaProperty\n v-if=\"resolvedSchema\"\n :breadcrumb\n :compact\n :compositionPath=\"compositionPath\"\n :depth=\"depth\"\n :discriminator\n :eventBus=\"eventBus\"\n :expansion=\"expansion\"\n :hideHeading\n :hideModelNames\n :level\n :options\n :schema=\"resolvedSchema\"\n :schemaContext=\"schemaContext\"\n :scrollTargetId=\"scrollTargetId\"\n :specificationExtension=\"specificationExtension\" />\n </template>\n </ul>\n </div>\n </div>\n</template>\n<style scoped>\n.error {\n background-color: var(--scalar-color-red);\n}\n.schema-card {\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-1);\n}\n.schema-card-title {\n height: var(--schema-title-height);\n\n padding: 6px 8px;\n\n display: flex;\n align-items: center;\n gap: 4px;\n\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n font-size: var(--scalar-mini);\n border-bottom: var(--scalar-border-width) solid transparent;\n}\nbutton.schema-card-title {\n cursor: pointer;\n}\nbutton.schema-card-title:hover {\n color: var(--scalar-color-1);\n}\n.schema-properties-open > .schema-card-title {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-properties-open > .schema-properties {\n width: fit-content;\n}\n.schema-card-description {\n color: var(--scalar-color-2);\n}\n.schema-card-description + .schema-properties {\n width: fit-content;\n}\n.schema-card-description + .schema-properties {\n margin-top: 8px;\n}\n.schema-card--level-0:nth-of-type(1)\n > .schema-card-description:has(+ .schema-properties) {\n margin-bottom: -8px;\n padding-bottom: 8px;\n border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n.schema-card--level-0\n ~ .schema-card--level-0\n > .schema-card-description:has(+ .schema-properties) {\n padding-top: 8px;\n}\n\n.schema-properties-open.schema-properties,\n.schema-properties-open > .schema-card--open {\n width: 100%;\n}\n.schema-properties {\n display: flex;\n flex-direction: column;\n\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius-lg);\n width: fit-content;\n}\n.schema-properties-name {\n width: 100%;\n}\n.schema-properties .schema-properties {\n border-radius: 13.5px;\n}\n.schema-properties .schema-properties.schema-properties-open {\n border-radius: var(--scalar-radius-lg);\n}\n.schema-properties-open {\n width: 100%;\n}\n.schema-card--compact {\n align-self: flex-start;\n}\n.schema-card--compact.schema-card--open {\n align-self: initial;\n}\n.schema-card-title--compact {\n color: var(--scalar-color-2);\n padding: 6px 10px 6px 8px;\n height: auto;\n border-bottom: none;\n}\n.schema-properties-open > .schema-card-title--compact {\n position: static;\n}\n.property--level-0\n > .schema-properties\n > .schema-card--level-0\n > .schema-properties {\n border: none;\n}\n.property--level-0\n .schema-card--level-0:not(.schema-card--compact)\n .property--level-1 {\n padding: 0 0 8px;\n}\n:not(.composition-panel)\n > .schema-card--compact.schema-card--level-0\n > .schema-properties {\n border: none;\n}\n:deep(.schema-card-description) p {\n font-size: var(--scalar-small, var(--scalar-paragraph));\n color: var(--scalar-color-2);\n margin-bottom: 0;\n display: block;\n margin-bottom: 6px;\n}\n.children .schema-card-description:first-of-type {\n padding-top: 0;\n}\n</style>\n"],"mappings":"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"}
@@ -0,0 +1,17 @@
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
+ /**
3
+ * A hint at what a collapsed object holds: `{ code, message, source, +1 }`.
4
+ * Marked `aria-hidden` by the parent: the child count already rides the
5
+ * toggle's `aria-describedby`, and reading names before every row is noise.
6
+ */
7
+ type __VLS_Props = {
8
+ schema?: SchemaObject;
9
+ /** The names the panel will render, already filtered; defaults to the schema's keys */
10
+ propertyNames?: readonly string[];
11
+ /** How many property names to show before eliding the rest */
12
+ limit?: number;
13
+ };
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
17
+ //# sourceMappingURL=SchemaCollapsedPreview.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaCollapsedPreview.vue.d.ts","sourceRoot":"","sources":["../../src/schema/SchemaCollapsedPreview.vue"],"names":[],"mappings":"AAgEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG;;;;GAIG;AACH,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,uFAAuF;IACvF,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AA2EF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,7 @@
1
+ import e from "./SchemaCollapsedPreview.vue.script.js";
2
+ //#region src/schema/SchemaCollapsedPreview.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
6
+
7
+ //# sourceMappingURL=SchemaCollapsedPreview.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaCollapsedPreview.vue.js","names":[],"sources":["../../src/schema/SchemaCollapsedPreview.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\n/**\n * A hint at what a collapsed object holds: `{ code, message, source, +1 }`.\n * Marked `aria-hidden` by the parent: the child count already rides the\n * toggle's `aria-describedby`, and reading names before every row is noise.\n */\nconst {\n schema,\n propertyNames,\n limit = 3,\n} = defineProps<{\n schema?: SchemaObject\n /** The names the panel will render, already filtered; defaults to the schema's keys */\n propertyNames?: readonly string[]\n /** How many property names to show before eliding the rest */\n limit?: number\n}>()\n\nconst preview = computed((): string | null => {\n if (!schema || typeof schema !== 'object') {\n return null\n }\n\n /*\n * The caller passes the names the panel will render, filtered by\n * hideReadOnly / hideWriteOnly; deriving them here let the preview advertise\n * fields the panel drops. The fallback (stories, tests) reads `properties`\n * directly: `resolve.schema` keeps `$ref` but drops `$ref-value`, so resolving\n * again returned undefined for a `$ref` property and nothing rendered.\n */\n const resolved =\n 'properties' in schema ? schema : (getResolvedRef(schema) ?? schema)\n const properties =\n propertyNames ??\n (resolved && 'properties' in resolved && resolved.properties\n ? Object.keys(resolved.properties)\n : [])\n\n if (properties.length === 0) {\n return null\n }\n\n const shown = properties.slice(0, limit)\n const rest = properties.length - shown.length\n const parts = rest > 0 ? [...shown, `+${rest}`] : shown\n\n return `{ ${parts.join(', ')} }`\n})\n</script>\n<template>\n <span\n v-if=\"preview\"\n class=\"property-collapsed-preview font-code text-c-1 max-w-max min-w-0 flex-1 basis-0 truncate text-(length:--scalar-mini)\"\n >{{ preview }}</span\n >\n</template>\n"],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, defineComponent as r, openBlock as i, toDisplayString as a } from "vue";
2
+ import { getResolvedRef as o } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
+ //#region src/schema/SchemaCollapsedPreview.vue?vue&type=script&setup=true&lang.ts
4
+ var s = {
5
+ key: 0,
6
+ class: "property-collapsed-preview font-code text-c-1 max-w-max min-w-0 flex-1 basis-0 truncate text-(length:--scalar-mini)"
7
+ }, c = /*@__PURE__*/ r({
8
+ __name: "SchemaCollapsedPreview",
9
+ props: {
10
+ schema: {},
11
+ propertyNames: {},
12
+ limit: { default: 3 }
13
+ },
14
+ setup(r) {
15
+ let c = e(() => {
16
+ if (!r.schema || typeof r.schema != "object") return null;
17
+ let e = "properties" in r.schema ? r.schema : o(r.schema) ?? r.schema, t = r.propertyNames ?? (e && "properties" in e && e.properties ? Object.keys(e.properties) : []);
18
+ if (t.length === 0) return null;
19
+ let n = t.slice(0, r.limit), i = t.length - n.length;
20
+ return `{ ${(i > 0 ? [...n, `+${i}`] : n).join(", ")} }`;
21
+ });
22
+ return (e, r) => c.value ? (i(), n("span", s, a(c.value), 1)) : t("", !0);
23
+ }
24
+ });
25
+ //#endregion
26
+ export { c as default };
27
+
28
+ //# sourceMappingURL=SchemaCollapsedPreview.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaCollapsedPreview.vue.script.js","names":[],"sources":["../../src/schema/SchemaCollapsedPreview.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\n/**\n * A hint at what a collapsed object holds: `{ code, message, source, +1 }`.\n * Marked `aria-hidden` by the parent: the child count already rides the\n * toggle's `aria-describedby`, and reading names before every row is noise.\n */\nconst {\n schema,\n propertyNames,\n limit = 3,\n} = defineProps<{\n schema?: SchemaObject\n /** The names the panel will render, already filtered; defaults to the schema's keys */\n propertyNames?: readonly string[]\n /** How many property names to show before eliding the rest */\n limit?: number\n}>()\n\nconst preview = computed((): string | null => {\n if (!schema || typeof schema !== 'object') {\n return null\n }\n\n /*\n * The caller passes the names the panel will render, filtered by\n * hideReadOnly / hideWriteOnly; deriving them here let the preview advertise\n * fields the panel drops. The fallback (stories, tests) reads `properties`\n * directly: `resolve.schema` keeps `$ref` but drops `$ref-value`, so resolving\n * again returned undefined for a `$ref` property and nothing rendered.\n */\n const resolved =\n 'properties' in schema ? schema : (getResolvedRef(schema) ?? schema)\n const properties =\n propertyNames ??\n (resolved && 'properties' in resolved && resolved.properties\n ? Object.keys(resolved.properties)\n : [])\n\n if (properties.length === 0) {\n return null\n }\n\n const shown = properties.slice(0, limit)\n const rest = properties.length - shown.length\n const parts = rest > 0 ? [...shown, `+${rest}`] : shown\n\n return `{ ${parts.join(', ')} }`\n})\n</script>\n<template>\n <span\n v-if=\"preview\"\n class=\"property-collapsed-preview font-code text-c-1 max-w-max min-w-0 flex-1 basis-0 truncate text-(length:--scalar-mini)\"\n >{{ preview }}</span\n >\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAsBA,IAAM,IAAU,QAA8B;GAC5C,IAAI,CAAC,EAAA,UAAU,OAAO,EAAA,UAAW,UAC/B,OAAO;GAUT,IAAM,IACJ,gBAAgB,EAAA,SAAS,EAAA,SAAU,EAAe,EAAA,MAAM,KAAK,EAAA,QACzD,IACJ,EAAA,kBACC,KAAY,gBAAgB,KAAY,EAAS,aAC9C,OAAO,KAAK,EAAS,UAAU,IAC/B,CAAC;GAEP,IAAI,EAAW,WAAW,GACxB,OAAO;GAGT,IAAM,IAAQ,EAAW,MAAM,GAAG,EAAA,KAAK,GACjC,IAAO,EAAW,SAAS,EAAM;GAGvC,OAAO,MAFO,IAAO,IAAI,CAAC,GAAG,GAAO,IAAI,GAAM,IAAI,EAAA,CAEhC,KAAK,IAAI,EAAE;EAC/B,CAAC;mBAIS,EAAA,SAAA,EAAA,GADR,EAIC,QAJD,GAIC,EADK,EAAA,KAAO,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA"}
@@ -0,0 +1,42 @@
1
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
+ import type { DiscriminatorObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
3
+ import { type CompositionKeyword } from './helpers/schema-composition';
4
+ import type { SchemaOptions, SchemaRenderingProps } from './types';
5
+ type __VLS_Props = {
6
+ /** The composition keyword (oneOf, anyOf, allOf) */
7
+ composition: CompositionKeyword;
8
+ /** Optional discriminator object for polymorphic schemas */
9
+ discriminator?: DiscriminatorObject;
10
+ /** Optional name for the schema */
11
+ name?: string;
12
+ /** The schema value containing the composition */
13
+ schema: SchemaObject;
14
+ /** Nesting level for proper indentation */
15
+ level: number;
16
+ /** Real nesting depth (see SchemaProperty) */
17
+ depth?: number;
18
+ /** Whether to use compact layout */
19
+ compact?: boolean;
20
+ /** Whether to hide the heading */
21
+ hideHeading?: boolean;
22
+ /** Hide model names in type display */
23
+ hideModelNames?: boolean;
24
+ /** Breadcrumb for navigation */
25
+ breadcrumb?: string[];
26
+ /** Event bus emitting actions */
27
+ eventBus: WorkspaceEventBus | null;
28
+ /** Move the options into single prop so they are easy to pass around */
29
+ options: SchemaOptions;
30
+ /** When "requestBody", sync selected index with the example snippet */
31
+ schemaContext?: string;
32
+ /** Internal path used to sync nested request body compositions with the code sample */
33
+ compositionPath?: string[];
34
+ } & SchemaRenderingProps;
35
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
36
+ depth: number;
37
+ compact: boolean;
38
+ hideHeading: boolean;
39
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
40
+ declare const _default: typeof __VLS_export;
41
+ export default _default;
42
+ //# sourceMappingURL=SchemaComposition.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../src/schema/SchemaComposition.vue"],"names":[],"mappings":"AA8ZA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAMrE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAWtE,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAElE,KAAK,WAAW,GAAG;IACb,oDAAoD;IACpD,WAAW,EAAE,kBAAkB,CAAA;IAC/B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,MAAM,EAAE,YAAY,CAAA;IACpB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,iCAAiC;IACjC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,yEAAyE;IACzE,OAAO,EAAE,aAAa,CAAA;IACtB,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC3B,GAAG,oBAAoB,CAAC;AA8f7B,QAAA,MAAM,YAAY;WA/gBJ,MAAM;aAEJ,OAAO;iBAEH,OAAO;6EA8gBzB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,9 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./SchemaComposition.vue.script.js";
3
+ /* empty css */
4
+ //#region src/schema/SchemaComposition.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-c738e9ab"]]);
6
+ //#endregion
7
+ export { n as default };
8
+
9
+ //# sourceMappingURL=SchemaComposition.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaComposition.vue.js","names":[],"sources":["../../src/schema/SchemaComposition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ScalarListbox,\n type ScalarListboxOption,\n} from '@scalar/components/listbox'\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { ScalarIconCaretUpDown } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n DiscriminatorObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, inject, ref, watch } from 'vue'\n\nimport { getDiscriminatorValues } from './helpers/get-discriminator-values'\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { partitionAllOfCompositions } from './helpers/partition-all-of-compositions'\nimport { type CompositionKeyword } from './helpers/schema-composition'\nimport { getCycleKey } from './helpers/schema-cycle'\nimport { getModelNameWithArray } from './helpers/schema-name'\nimport { useLocalization } from './localization'\nimport {\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n type RequestBodyCompositionSelection,\n} from './request-body-composition-index'\nimport Schema from './Schema.vue'\nimport SchemaGlyphPuck from './SchemaGlyphPuck.vue'\nimport SchemaRailPanel from './SchemaRailPanel.vue'\nimport type { SchemaOptions, SchemaRenderingProps } from './types'\n\nconst props = withDefaults(\n defineProps<\n {\n /** The composition keyword (oneOf, anyOf, allOf) */\n composition: CompositionKeyword\n /** Optional discriminator object for polymorphic schemas */\n discriminator?: DiscriminatorObject\n /** Optional name for the schema */\n name?: string\n /** The schema value containing the composition */\n schema: SchemaObject\n /** Nesting level for proper indentation */\n level: number\n /** Real nesting depth (see SchemaProperty) */\n depth?: number\n /** Whether to use compact layout */\n compact?: boolean\n /** Whether to hide the heading */\n hideHeading?: boolean\n /** Hide model names in type display */\n hideModelNames?: boolean\n /** Breadcrumb for navigation */\n breadcrumb?: string[]\n /** Event bus emitting actions */\n eventBus: WorkspaceEventBus | null\n /** Move the options into single prop so they are easy to pass around */\n options: SchemaOptions\n /** When \"requestBody\", sync selected index with the example snippet */\n schemaContext?: string\n /** Internal path used to sync nested request body compositions with the code sample */\n compositionPath?: string[]\n } & SchemaRenderingProps\n >(),\n {\n depth: 0,\n compact: false,\n hideHeading: false,\n },\n)\nconst { translate } = useLocalization()\n\n/**\n * Split an `allOf` into an ordered list of segments (object chunks + choice\n * pickers) so multiple mutually-exclusive selections each render their own\n * picker, in the position they were declared, instead of all but the first\n * being dropped and the rest bubbling to the end.\n */\nconst allOfSegments = computed(() =>\n props.composition === 'allOf'\n ? partitionAllOfCompositions(props.schema).segments\n : [],\n)\n\n/** The current composition */\nconst composition = computed(() =>\n [props.schema[props.composition]]\n .flat()\n .map((schema) => ({ value: resolve.schema(schema), original: schema }))\n .filter((it) => isDefined(it.value)),\n)\n\n/**\n * Generate listbox options for the composition selector.\n * Each option represents a schema in the composition with a human-readable label.\n * Prefers schema title/name (including array item models, e.g. `Model[]`) over\n * structural type when present.\n */\nconst listboxOptions = computed((): ScalarListboxOption[] =>\n composition.value.map((schema, index: number) => {\n const resolved = resolve.schema(schema.original!)\n const label =\n (getModelNameWithArray(resolved)?.label ?? getSchemaType(resolved)) ||\n translate('schema.schema')\n const mapping = (props.schema.discriminator ?? props.discriminator)?.mapping\n const values = getDiscriminatorValues(resolved.$ref, mapping)\n return {\n id: String(index),\n label: values.length ? `${values.join(', ')} · ${label}` : label,\n }\n }),\n)\n\nconst compositionSelectionKey = computed(() =>\n props.compositionPath?.length\n ? [...props.compositionPath, props.composition].join('.')\n : '',\n)\n\n/** When this composition is in the request body, sync selection with the example snippet */\nconst requestBodyCompositionSelectionRef = inject(\n REQUEST_BODY_COMPOSITION_INDEX_SYMBOL,\n undefined,\n)\n\nconst initialSelectedIndex = computed(() => {\n if (\n props.schemaContext !== 'requestBody' ||\n !requestBodyCompositionSelectionRef?.value ||\n !compositionSelectionKey.value\n ) {\n return 0\n }\n\n const selectedIndex =\n requestBodyCompositionSelectionRef.value[compositionSelectionKey.value]\n\n if (typeof selectedIndex !== 'number' || Number.isNaN(selectedIndex)) {\n return 0\n }\n\n return Math.max(0, Math.min(selectedIndex, listboxOptions.value.length - 1))\n})\n\n/**\n * Two-way computed property for the selected option.\n * Handles conversion between the selected index and the listbox option format.\n */\nconst selectedOption = ref<ScalarListboxOption | undefined>()\n\nwatch(\n [listboxOptions, initialSelectedIndex],\n ([options, selectedIndex]) => {\n if (\n !selectedOption.value ||\n !options.some((option) => option.id === selectedOption.value?.id)\n ) {\n selectedOption.value = options[selectedIndex] ?? options[0]\n }\n },\n { immediate: true },\n)\n\nconst compositionLabel = (type: CompositionKeyword): string =>\n translate(`schema.${type}`)\n\n/** Inside the currently selected composition */\nconst selectedComposition = computed(\n () => composition.value[Number(selectedOption.value?.id ?? '0')]?.value,\n)\n\n/**\n * The request body card renders the merged `allOf` description on its outer card\n * (see `Schema.vue`), but only for the top-level request body schema. For that\n * single composition we hide the nested merged `Schema`'s description so the text\n * is not shown twice. Nested request-body compositions (deeper properties) are\n * not shown on the outer card and would otherwise lose their description\n * entirely, because the property row already skips it when `allOf` is present.\n *\n * The top-level request body composition is the one whose `compositionPath` is\n * still the request body root (`['requestBody']`); nested compositions append\n * property segments and therefore have a longer path.\n */\nconst isRequestBodyRootComposition = computed(\n () =>\n props.schemaContext === 'requestBody' &&\n props.compositionPath?.length === 1,\n)\n\n/**\n * Cycle key for the selected composition member, derived from its raw\n * (unresolved) value so a member that references an ancestor is detected as a\n * cycle.\n */\nconst selectedCompositionCycleKey = computed(() =>\n getCycleKey(\n composition.value[Number(selectedOption.value?.id ?? '0')]?.original,\n ),\n)\n\n/**\n * Controls whether the nested schema is displayed. When expanding all schema\n * properties we open it by default; the nested Schema handles cycle detection,\n * so finite compositions render fully while recursive ones still stop.\n */\nconst showNestedSchema = ref(!!props.options.expandAllSchemaProperties)\n\nif (\n requestBodyCompositionSelectionRef &&\n props.schemaContext === 'requestBody' &&\n compositionSelectionKey.value\n) {\n watch(\n selectedOption,\n (option) => {\n const index = option ? Number(option.id) : 0\n if (!Number.isNaN(index)) {\n requestBodyCompositionSelectionRef.value = {\n ...requestBodyCompositionSelectionRef.value,\n [compositionSelectionKey.value]: index,\n } satisfies RequestBodyCompositionSelection\n }\n },\n { immediate: true },\n )\n}\n</script>\n\n<template>\n <!-- 6px after a container's children keeps the 12px row rhythm -->\n <div class=\"property-rule [.children+&]:mt-1.5!\">\n <!--\n allOf: render the members in source order — object chunks as fields, each\n oneOf/anyOf group as its own picker in place. Keeps every mutually-exclusive\n selection (mergeAllOfSchemas alone drops all but the first) and preserves the\n position of each choice group among the surrounding fields, flowing inline\n with them as one continuous list (no extra spacing or card).\n -->\n <template v-if=\"props.composition === 'allOf'\">\n <template\n v-for=\"(segment, segmentIndex) in allOfSegments\"\n :key=\"segmentIndex\">\n <Schema\n v-if=\"segment.kind === 'object'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :depth=\"depth\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :expansion=\"expansion\"\n :hideDescription=\"isRequestBodyRootComposition\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"segment.schema\"\n :schemaContext=\"schemaContext\"\n :scrollTargetId=\"scrollTargetId\"\n :specificationExtension=\"specificationExtension\" />\n <SchemaComposition\n v-else\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :composition=\"segment.composition\"\n :compositionPath=\"[\n ...(compositionPath ?? []),\n String(segment.choiceIndex),\n ]\"\n :depth=\"depth\"\n :eventBus=\"eventBus\"\n :expansion=\"expansion\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level\"\n :options=\"options\"\n :schema=\"segment.value\"\n :schemaContext=\"schemaContext\"\n :scrollTargetId=\"scrollTargetId\"\n :specificationExtension=\"specificationExtension\" />\n </template>\n </template>\n\n <!-- The picker sits on the rail behind a circled icon, like the toggle\n pucks; the chosen variant hangs below in the same panel -->\n <SchemaRailPanel\n v-else\n class=\"composition-panel composition-panel--tree mt-1 mb-0.5\"\n :depth=\"depth + 1\">\n <!-- No `resize`: it would pin the popup to this compact trigger's width.\n The listbox slot must hold exactly ONE node: Headless UI renders its\n button as a fragment and passes props through to the slot root, so\n even an HTML comment in here breaks the picker. The puck is the\n picker's whole affordance: an up/down caret on the rail, like the\n plus on a row, so no trailing caret. -->\n <ScalarListbox\n v-model=\"selectedOption\"\n class=\"w-fit max-w-full min-w-40\"\n :options=\"listboxOptions\">\n <button\n class=\"composition-selector composition-selector--tree group/tree-control font-code relative flex w-fit max-w-full cursor-pointer items-start gap-1.5 py-1 text-sm\"\n type=\"button\">\n <SchemaGlyphPuck\n anchor=\"line\"\n class=\"composition-selector-icon mt-1\">\n <!-- No size of its own: the puck sizes the icons it holds, so this\n one shrinks with the others in a narrow container -->\n <ScalarIconCaretUpDown />\n </SchemaGlyphPuck>\n <!-- Keyword and choice read as one bold name, split by the same `·`\n the tree uses between details -->\n <span\n class=\"text-c-1 shrink-0 [font-weight:var(--scalar-bold)] whitespace-nowrap\"\n >{{ compositionLabel(props.composition) }}</span\n >\n <span\n aria-hidden=\"true\"\n class=\"text-c-3 shrink-0\"\n >·</span\n >\n <span\n class=\"composition-selector-label text-c-1 min-w-0 truncate [font-weight:var(--scalar-bold)]\"\n :class=\"{\n 'line-through': selectedComposition?.deprecated,\n }\"\n :title=\"selectedOption?.label || translate('schema.schema')\">\n {{ selectedOption?.label || translate('schema.schema') }}\n </span>\n <div\n v-if=\"selectedComposition?.deprecated\"\n class=\"text-red\">\n {{ translate('schema.deprecated') }}\n </div>\n </button>\n </ScalarListbox>\n\n <!-- The reveal is one more row of the tree: a plus puck on the rail -->\n <button\n v-if=\"!showNestedSchema && level > 2\"\n class=\"composition-details-toggle group/tree-control font-code text-c-1 relative flex w-fit cursor-pointer items-center py-1.5 text-sm font-normal\"\n type=\"button\"\n @click=\"showNestedSchema = true\">\n <SchemaGlyphPuck />\n {{ translate('schema.showSchemaDetails') }}\n </button>\n\n <!-- Render the selected schema if it has content to display -->\n <Schema\n v-else\n :key=\"selectedOption?.id ?? '0'\"\n :breadcrumb=\"breadcrumb\"\n :compact=\"compact\"\n :compositionPath=\"compositionPath\"\n :cycleKey=\"selectedCompositionCycleKey\"\n :depth=\"depth + 1\"\n :discriminator=\"discriminator\"\n :eventBus=\"eventBus\"\n :expansion=\"expansion\"\n :hideHeading=\"hideHeading\"\n :hideModelNames\n :level=\"level + 1\"\n :name=\"name\"\n :noncollapsible=\"true\"\n :options=\"options\"\n :schema=\"selectedComposition\"\n :schemaContext=\"schemaContext\"\n :scrollTargetId=\"scrollTargetId\"\n :specificationExtension=\"specificationExtension\" />\n </SchemaRailPanel>\n </div>\n</template>\n\n<style scoped>\n/*\n * A `oneOf`/`anyOf` whose chosen variant `allOf`s back to a shared base — most\n * commonly a discriminator-inferred `oneOf` sitting directly on the request body\n * — renders the merged variant one level deeper than a plain object variant:\n * `Schema.vue` cannot flatten the `allOf`, so it hands the merged object to\n * `SchemaProperty`, which wraps it in a headless passthrough row\n * (`.property--tree-container`). That wrapper carries a row's own\n * `--schema-row-pad`, opening a gap between the selector and the first field\n * that a plain `oneOf` does not have, so the variant reads as detached from its\n * picker. Drop that leading row pad for the panel's own variant card so the\n * field sits flush under the selector, matching a plain `oneOf`. Only the top\n * pad goes: the wrapper's trailing pad is what closes the card under the last\n * field, exactly as a plain variant's last row does.\n *\n * The rule lives here rather than in `SchemaProperty` because a body-level\n * discriminator `oneOf` is rendered straight from `Schema.vue` and never passes\n * through `SchemaProperty`, so a rule scoped there would never reach it.\n * See https://github.com/scalar/scalar/issues/9861\n */\n.property-rule\n :deep(\n .composition-panel\n > .schema-card\n > .schema-properties\n > ul\n > li.property.property--tree-container\n ) {\n padding-top: 0 !important;\n}\n</style>\n"],"mappings":""}