@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,49 @@
1
+ import { createBlock as e, createCommentVNode as t, createElementBlock as n, defineComponent as r, normalizeStyle as i, onBeforeUnmount as a, openBlock as o, renderSlot as s, resolveDynamicComponent as c, withCtx as l, withModifiers as u } from "vue";
2
+ //#region src/schema/SchemaRailPanel.vue?vue&type=script&setup=true&lang.ts
3
+ var d = /*@__PURE__*/ r({
4
+ __name: "SchemaRailPanel",
5
+ props: {
6
+ depth: {},
7
+ closeOnRail: {
8
+ type: Boolean,
9
+ default: !1
10
+ },
11
+ as: { default: "div" }
12
+ },
13
+ emits: ["close"],
14
+ setup(r, { emit: d }) {
15
+ let f = d, p = null, m = () => {
16
+ p?.panel.removeAttribute("data-rail-hovered"), p?.row?.removeAttribute("data-child-rail-hovered"), p = null;
17
+ }, h = (e, t) => {
18
+ if (m(), !t) return;
19
+ let n = e.currentTarget instanceof HTMLElement ? e.currentTarget.parentElement : null;
20
+ if (!n) return;
21
+ let r = n.parentElement;
22
+ n.setAttribute("data-rail-hovered", ""), r?.setAttribute("data-child-rail-hovered", ""), p = {
23
+ panel: n,
24
+ row: r
25
+ };
26
+ }, g = () => {
27
+ m(), f("close");
28
+ };
29
+ return a(m), (a, d) => (o(), e(c(r.as), {
30
+ class: "schema-rail-panel schema-rail rail-hover:border-s-c-1 relative ps-[var(--schema-gutter,16px)]",
31
+ style: i({ "--schema-depth": r.depth })
32
+ }, {
33
+ default: l(() => [r.closeOnRail ? (o(), n("div", {
34
+ key: 0,
35
+ "aria-hidden": "true",
36
+ class: "rail-hit z-[1]",
37
+ "data-rail-hit": "",
38
+ onClick: u(g, ["stop"]),
39
+ onPointerenter: d[0] ||= (e) => h(e, !0),
40
+ onPointerleave: d[1] ||= (e) => h(e, !1)
41
+ }, null, 32)) : t("", !0), s(a.$slots, "default")]),
42
+ _: 3
43
+ }, 8, ["style"]));
44
+ }
45
+ });
46
+ //#endregion
47
+ export { d as default };
48
+
49
+ //# sourceMappingURL=SchemaRailPanel.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaRailPanel.vue.script.js","names":[],"sources":["../../src/schema/SchemaRailPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, type Component } from 'vue'\n\n/**\n * The railed panel of the schema tree: an expanded row's children behind a rail\n * that fades with depth. See the indentation model in SchemaProperty.vue.\n *\n * `--schema-depth` must stay inline on the element itself: the `schema-rail`\n * utility reads it for the fade. No margins of its own, because each surface\n * that joins the tree spaces its panel differently.\n */\nconst {\n depth,\n closeOnRail = false,\n as = 'div',\n} = defineProps<{\n /** Nesting depth of the panel, driving how far the rail fades */\n depth: number\n /** Render the pointer strip over the rail that closes the panel on click */\n closeOnRail?: boolean\n /** Panel root element or component, so a headless-ui DisclosurePanel can keep the rail recipe */\n as?: string | Component\n}>()\n\nconst emit = defineEmits<{\n (e: 'close'): void\n}>()\n\n/**\n * A hovered strip colours this panel's rail and lights the puck of the control\n * that owns the panel. Both used to be `:has(... :hover)` selectors, which made\n * every railed row a `:has()` invalidation anchor, so each element inserted\n * under an open row restyled its whole subtree. The strip's pointer events now\n * write the same state as attributes that exist only while it is hovered:\n * `data-rail-hovered` on the panel root and `data-child-rail-hovered` on the\n * panel's parent, the element the tailwind.config.css variants look through to\n * the control. Read off DOM adjacency exactly like the selectors they replace,\n * so every surface that rails a panel is covered without wiring.\n */\nlet hovered: { panel: HTMLElement; row: HTMLElement | null } | null = null\n\nconst clearRailHover = (): void => {\n hovered?.panel.removeAttribute('data-rail-hovered')\n hovered?.row?.removeAttribute('data-child-rail-hovered')\n hovered = null\n}\n\nconst setRailHover = (event: Event, on: boolean): void => {\n clearRailHover()\n\n if (!on) {\n return\n }\n\n const panel =\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget.parentElement\n : null\n\n if (!panel) {\n return\n }\n\n const row = panel.parentElement\n panel.setAttribute('data-rail-hovered', '')\n row?.setAttribute('data-child-rail-hovered', '')\n hovered = { panel, row }\n}\n\n/**\n * Folding the panel hides the strip under the pointer, so no pointerleave ever\n * follows the click: the marks go before the close, or the puck stays lit.\n */\nconst onStripClick = (): void => {\n clearRailHover()\n emit('close')\n}\n\n/* The strip also disappears without a pointerleave when the panel unmounts,\n and the parent row it marked outlives it. */\nonBeforeUnmount(clearRailHover)\n</script>\n<template>\n <component\n :is=\"as\"\n class=\"schema-rail-panel schema-rail rail-hover:border-s-c-1 relative ps-[var(--schema-gutter,16px)]\"\n :style=\"{ '--schema-depth': depth }\">\n <!-- Pointer-only strip along the rail that folds the panel; hidden from\n assistive tech because the row's own toggle is the accessible control. -->\n <div\n v-if=\"closeOnRail\"\n aria-hidden=\"true\"\n class=\"rail-hit z-[1]\"\n data-rail-hit\n @click.stop=\"onStripClick\"\n @pointerenter=\"setRailHover($event, true)\"\n @pointerleave=\"setRailHover($event, false)\" />\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAwBA,IAAM,IAAO,GAeT,IAAkE,MAEhE,UAA6B;GAGjC,AAFA,GAAS,MAAM,gBAAgB,mBAAmB,GAClD,GAAS,KAAK,gBAAgB,yBAAyB,GACvD,IAAU;EACZ,GAEM,KAAgB,GAAc,MAAsB;GAGxD,IAFA,EAAe,GAEX,CAAC,GACH;GAGF,IAAM,IACJ,EAAM,yBAAyB,cAC3B,EAAM,cAAc,gBACpB;GAEN,IAAI,CAAC,GACH;GAGF,IAAM,IAAM,EAAM;GAGlB,AAFA,EAAM,aAAa,qBAAqB,EAAE,GAC1C,GAAK,aAAa,2BAA2B,EAAE,GAC/C,IAAU;IAAE;IAAO;GAAI;EACzB,GAMM,UAA2B;GAE/B,AADA,EAAe,GACf,EAAK,OAAO;EACd;SAIA,EAAgB,CAAc,mBAG5B,EAeY,EAdL,EAAA,EAAE,GAAA;GACP,OAAM;GACL,OAAK,EAAA,EAAA,kBAAsB,EAAA,MAAK,CAAA;;oBAUe,CANxC,EAAA,eAAA,EAAA,GADR,EAOgD,OAAA;;IAL9C,eAAY;IACZ,OAAM;IACN,iBAAA;IACC,SAAK,EAAO,GAAY,CAAA,MAAA,CAAA;IACxB,gBAAY,AAAA,EAAA,QAAA,MAAE,EAAa,GAAM,EAAA;IACjC,gBAAY,AAAA,EAAA,QAAA,MAAE,EAAa,GAAM,EAAA;8BACpC,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA"}
@@ -0,0 +1,27 @@
1
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
+ /**
3
+ * A property row's deep-link affordance: the same hash the section headings
4
+ * and the models list show, trailing the row's text in the flow of the heading
5
+ * and revealed on hover or focus. It is a separate component so it can render
6
+ * as the LAST child of the heading: inside `WithBreadcrumb`, which wraps the
7
+ * name, it would come before the type in the tab order (WCAG 2.4.3).
8
+ */
9
+ type __VLS_Props = {
10
+ /** The anchor this button copies a link to */
11
+ anchorId: string;
12
+ eventBus: WorkspaceEventBus | null;
13
+ };
14
+ declare var __VLS_6: {};
15
+ type __VLS_Slots = {} & {
16
+ 'sr-label'?: (props: typeof __VLS_6) => any;
17
+ };
18
+ declare const __VLS_base: 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>;
19
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
22
+ type __VLS_WithSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
27
+ //# sourceMappingURL=CopyLinkButton.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyLinkButton.vue.d.ts","sourceRoot":"","sources":["../../../src/schema/components/CopyLinkButton.vue"],"names":[],"mappings":"AAiEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAKvE;;;;;;GAMG;AACH,KAAK,WAAW,GAAG;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACnC,CAAC;AA0EF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAKlD,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"}
@@ -0,0 +1,7 @@
1
+ import e from "./CopyLinkButton.vue.script.js";
2
+ //#region src/schema/components/CopyLinkButton.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
6
+
7
+ //# sourceMappingURL=CopyLinkButton.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyLinkButton.vue.js","names":[],"sources":["../../../src/schema/components/CopyLinkButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconHash } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed } from 'vue'\n\nimport { useLocalization } from '../localization'\n\n/**\n * A property row's deep-link affordance: the same hash the section headings\n * and the models list show, trailing the row's text in the flow of the heading\n * and revealed on hover or focus. It is a separate component so it can render\n * as the LAST child of the heading: inside `WithBreadcrumb`, which wraps the\n * name, it would come before the type in the tab order (WCAG 2.4.3).\n */\nconst { anchorId } = defineProps<{\n /** The anchor this button copies a link to */\n anchorId: string\n eventBus: WorkspaceEventBus | null\n}>()\n\nconst { translate } = useLocalization()\n\n/** Screen-reader label for the copy-link button, naming the deep-linked item. */\nconst copyLinkLabel = computed(() =>\n translate('actions.copyLinkTo', {\n name: anchorId.split('.').pop() ?? '',\n }),\n)\n</script>\n\n<template>\n <!-- A flex item of the heading, so it wraps with the text. Negative margins\n cancel the padding of the 24px hit area WCAG 2.5.8 asks for, so the box\n overhangs the line instead of taking room from it: vertically it never\n changes the line height, and horizontally the row gives up only the 10px\n gap and the 14px icon (5 + 24 - 5), which is what a collapsed preview\n before it truncates against.\n\n Both inline margins carry `!`: the heading's scoped `.property-heading > *`\n sets a 9px right margin, which is the end margin in LTR and the start\n margin in RTL, at the same specificity as the utility. Which one wins\n depends on whether the consumer's stylesheet puts the utilities before or\n after `vue-styles.css`.\n\n pointer-coarse drops it entirely rather than leaving it transparent: a\n touch pointer has no hover, so a still-laid-out button would be an\n invisible tap target AND would keep pushing long signature lines onto a\n second line just to show a control nobody can see. A deep link stays\n reachable there through the address bar. -->\n <button\n class=\"copy-link-trailing text-c-3 hover:text-c-1 -my-1.25 ms-1.25! -me-1.25! flex shrink-0 cursor-pointer items-center justify-center self-center p-1.25 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 pointer-coarse:hidden\"\n type=\"button\"\n @click=\"() => eventBus?.emit('copy-url:nav-item', { id: anchorId })\">\n <ScalarIconHash\n aria-hidden=\"true\"\n class=\"size-3.5\" />\n <span class=\"sr-only\">\n <slot name=\"sr-label\">{{ copyLinkLabel }}</slot>\n </span>\n </button>\n</template>\n"],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { useLocalization as e } from "../localization/index.js";
2
+ import { computed as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, openBlock as s, renderSlot as c, toDisplayString as l, unref as u } from "vue";
3
+ import { ScalarIconHash as d } from "@scalar/icons";
4
+ //#region src/schema/components/CopyLinkButton.vue?vue&type=script&setup=true&lang.ts
5
+ var f = { class: "sr-only" }, p = /*@__PURE__*/ o({
6
+ __name: "CopyLinkButton",
7
+ props: {
8
+ anchorId: {},
9
+ eventBus: {}
10
+ },
11
+ setup(o) {
12
+ let { translate: p } = e(), m = t(() => p("actions.copyLinkTo", { name: o.anchorId.split(".").pop() ?? "" }));
13
+ return (e, t) => (s(), n("button", {
14
+ class: "copy-link-trailing text-c-3 hover:text-c-1 -my-1.25 ms-1.25! -me-1.25! flex shrink-0 cursor-pointer items-center justify-center self-center p-1.25 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 pointer-coarse:hidden",
15
+ type: "button",
16
+ onClick: t[0] ||= () => o.eventBus?.emit("copy-url:nav-item", { id: o.anchorId })
17
+ }, [a(u(d), {
18
+ "aria-hidden": "true",
19
+ class: "size-3.5"
20
+ }), r("span", f, [c(e.$slots, "sr-label", {}, () => [i(l(m.value), 1)])])]));
21
+ }
22
+ });
23
+ //#endregion
24
+ export { p as default };
25
+
26
+ //# sourceMappingURL=CopyLinkButton.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyLinkButton.vue.script.js","names":[],"sources":["../../../src/schema/components/CopyLinkButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconHash } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed } from 'vue'\n\nimport { useLocalization } from '../localization'\n\n/**\n * A property row's deep-link affordance: the same hash the section headings\n * and the models list show, trailing the row's text in the flow of the heading\n * and revealed on hover or focus. It is a separate component so it can render\n * as the LAST child of the heading: inside `WithBreadcrumb`, which wraps the\n * name, it would come before the type in the tab order (WCAG 2.4.3).\n */\nconst { anchorId } = defineProps<{\n /** The anchor this button copies a link to */\n anchorId: string\n eventBus: WorkspaceEventBus | null\n}>()\n\nconst { translate } = useLocalization()\n\n/** Screen-reader label for the copy-link button, naming the deep-linked item. */\nconst copyLinkLabel = computed(() =>\n translate('actions.copyLinkTo', {\n name: anchorId.split('.').pop() ?? '',\n }),\n)\n</script>\n\n<template>\n <!-- A flex item of the heading, so it wraps with the text. Negative margins\n cancel the padding of the 24px hit area WCAG 2.5.8 asks for, so the box\n overhangs the line instead of taking room from it: vertically it never\n changes the line height, and horizontally the row gives up only the 10px\n gap and the 14px icon (5 + 24 - 5), which is what a collapsed preview\n before it truncates against.\n\n Both inline margins carry `!`: the heading's scoped `.property-heading > *`\n sets a 9px right margin, which is the end margin in LTR and the start\n margin in RTL, at the same specificity as the utility. Which one wins\n depends on whether the consumer's stylesheet puts the utilities before or\n after `vue-styles.css`.\n\n pointer-coarse drops it entirely rather than leaving it transparent: a\n touch pointer has no hover, so a still-laid-out button would be an\n invisible tap target AND would keep pushing long signature lines onto a\n second line just to show a control nobody can see. A deep link stays\n reachable there through the address bar. -->\n <button\n class=\"copy-link-trailing text-c-3 hover:text-c-1 -my-1.25 ms-1.25! -me-1.25! flex shrink-0 cursor-pointer items-center justify-center self-center p-1.25 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 pointer-coarse:hidden\"\n type=\"button\"\n @click=\"() => eventBus?.emit('copy-url:nav-item', { id: anchorId })\">\n <ScalarIconHash\n aria-hidden=\"true\"\n class=\"size-3.5\" />\n <span class=\"sr-only\">\n <slot name=\"sr-label\">{{ copyLinkLabel }}</slot>\n </span>\n </button>\n</template>\n"],"mappings":";;;;;;;;;;;EAoBA,IAAM,EAAE,iBAAc,EAAgB,GAGhC,IAAgB,QACpB,EAAU,sBAAsB,EAC9B,MAAM,EAAA,SAAS,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,GACrC,CAAC,CACH;yBAsBE,EAUS,UAAA;GATP,OAAM;GACN,MAAK;GACJ,SAAK,AAAA,EAAA,aAAQ,EAAA,UAAU,KAAI,qBAAA,EAAA,IAA4B,EAAA,SAAQ,CAAA;MAChE,EAEqB,EAAA,CAAA,GAAA;GADnB,eAAY;GACZ,OAAM;MACR,EAEO,QAFP,GAEO,CADL,EAAgD,EAAA,QAAA,YAAA,CAAA,SAAA,CAAA,EAAA,EAAvB,EAAA,KAAa,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -0,0 +1,19 @@
1
+ type __VLS_Props = {
2
+ breadcrumb?: string[];
3
+ };
4
+ declare var __VLS_1: {}, __VLS_3: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_1) => any;
7
+ } & {
8
+ default?: (props: typeof __VLS_3) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
19
+ //# sourceMappingURL=WithBreadcrumb.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithBreadcrumb.vue.d.ts","sourceRoot":"","sources":["../../../src/schema/components/WithBreadcrumb.vue"],"names":[],"mappings":"AA4BA,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;AAiCF,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,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAG/C,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"}
@@ -0,0 +1,7 @@
1
+ import e from "./WithBreadcrumb.vue.script.js";
2
+ //#region src/schema/components/WithBreadcrumb.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
6
+
7
+ //# sourceMappingURL=WithBreadcrumb.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithBreadcrumb.vue.js","names":[],"sources":["../../../src/schema/components/WithBreadcrumb.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst { breadcrumb } = defineProps<{\n breadcrumb?: string[]\n}>()\n</script>\n\n<template>\n <template v-if=\"breadcrumb && breadcrumb.length > 0\">\n <!-- `tabindex=\"-1\"`: focusable programmatically but out of the tab order,\n so a deep link can move focus to its target instead of leaving keyboard\n and screen-reader users at the top of the document -->\n <div\n :id=\"breadcrumb.join('.')\"\n class=\"static scroll-mt-24\"\n tabindex=\"-1\">\n <!-- Content -->\n <slot />\n <!-- No copy button here: the row's heading renders it as its last child\n so tab order matches visual order. See CopyLinkButton.vue -->\n </div>\n </template>\n <template v-else>\n <slot />\n </template>\n</template>\n"],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import { createElementBlock as e, defineComponent as t, openBlock as n, renderSlot as r } from "vue";
2
+ //#region src/schema/components/WithBreadcrumb.vue?vue&type=script&setup=true&lang.ts
3
+ var i = ["id"], a = /*@__PURE__*/ t({
4
+ __name: "WithBreadcrumb",
5
+ props: { breadcrumb: {} },
6
+ setup(t) {
7
+ return (a, o) => t.breadcrumb && t.breadcrumb.length > 0 ? (n(), e("div", {
8
+ key: 0,
9
+ id: t.breadcrumb.join("."),
10
+ class: "static scroll-mt-24",
11
+ tabindex: "-1"
12
+ }, [r(a.$slots, "default")], 8, i)) : r(a.$slots, "default", {}, void 0, void 0, 1);
13
+ }
14
+ });
15
+ //#endregion
16
+ export { a as default };
17
+
18
+ //# sourceMappingURL=WithBreadcrumb.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithBreadcrumb.vue.script.js","names":[],"sources":["../../../src/schema/components/WithBreadcrumb.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst { breadcrumb } = defineProps<{\n breadcrumb?: string[]\n}>()\n</script>\n\n<template>\n <template v-if=\"breadcrumb && breadcrumb.length > 0\">\n <!-- `tabindex=\"-1\"`: focusable programmatically but out of the tab order,\n so a deep link can move focus to its target instead of leaving keyboard\n and screen-reader users at the top of the document -->\n <div\n :id=\"breadcrumb.join('.')\"\n class=\"static scroll-mt-24\"\n tabindex=\"-1\">\n <!-- Content -->\n <slot />\n <!-- No copy button here: the row's heading renders it as its last child\n so tab order matches visual order. See CopyLinkButton.vue -->\n </div>\n </template>\n <template v-else>\n <slot />\n </template>\n</template>\n"],"mappings":";;;;;;mBAOkB,EAAA,cAAc,EAAA,WAAW,SAAM,KAAA,EAAA,GAI7C,EAQM,OAAA;;GAPH,IAAI,EAAA,WAAW,KAAI,GAAA;GACpB,OAAM;GACN,UAAS;MAET,EAAQ,EAAA,QAAA,SAAA,CAAA,GAAA,GAAA,CAAA,KAMV,EAAQ,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { type SchemaExpansionStore, createSchemaExpansionStore, toNodeKey, useSchemaExpansion, } from '../helpers/schema-expansion';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/expansion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,SAAS,EACT,kBAAkB,GACnB,MAAM,6BAA6B,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { createSchemaExpansionStore as e, toNodeKey as t, useSchemaExpansion as n } from "../helpers/schema-expansion.js";
2
+ export { e as createSchemaExpansionStore, t as toNodeKey, n as useSchemaExpansion };
@@ -0,0 +1,27 @@
1
+ import { type DynamicScope } from '@scalar/workspace-store/helpers/dynamic-ref';
2
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
3
+ import { type InjectionKey } from 'vue';
4
+ /**
5
+ * The dynamic scope — the outermost-first chain of schema resources on the current render path.
6
+ *
7
+ * JSON Schema 2020-12 `$dynamicRef` does not resolve to a fixed location. It binds to the active
8
+ * `$dynamicAnchor` in the chain of resources entered to reach it, so the same
9
+ * `{ "$dynamicRef": "#itemType" }` inside a shared generic template resolves to a different concrete
10
+ * type depending on the path taken (e.g. `User` via a user page, `Group` via a group page).
11
+ *
12
+ * Each object `Schema` node injects this scope, appends its own resource, and re-provides it to its
13
+ * descendants. `SchemaProperty` reads it to bind a `$dynamicRef` property or array item to the
14
+ * concrete schema while walking the tree. See https://github.com/scalar/scalar/issues/9414.
15
+ */
16
+ export declare const SCHEMA_DYNAMIC_SCOPE_SYMBOL: InjectionKey<DynamicScope>;
17
+ /** Read the dynamic scope provided by ancestor schema nodes (empty at the root of the tree). */
18
+ export declare const useDynamicScope: () => DynamicScope;
19
+ /**
20
+ * Resolve a schema that may be a `$dynamicRef` against the active dynamic scope.
21
+ *
22
+ * Returns the bound concrete schema when the reference matches a `$dynamicAnchor` in scope. When
23
+ * nothing matches (or the schema is not a `$dynamicRef`) the input is returned unchanged, so
24
+ * rendering falls back to its prior behavior with no regression.
25
+ */
26
+ export declare const resolveDynamicSchema: <T extends SchemaObject | undefined>(schema: T, scope: DynamicScope) => T;
27
+ //# sourceMappingURL=dynamic-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-scope.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/dynamic-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAmC,MAAM,6CAA6C,CAAA;AAChH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,EAAE,KAAK,YAAY,EAAU,MAAM,KAAK,CAAA;AAE/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,YAAY,CAAkC,CAAA;AAKrG,gGAAgG;AAChG,eAAO,MAAM,eAAe,QAAO,YAAgE,CAAA;AAEnG;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,YAAY,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,OAAO,YAAY,KAAG,CAMzG,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { inject as e } from "vue";
2
+ import { isDynamicRef as t, resolveDynamicRef as n } from "@scalar/workspace-store/helpers/dynamic-ref";
3
+ //#region src/schema/helpers/dynamic-scope.ts
4
+ var r = Symbol("schema-dynamic-scope"), i = [], a = () => e(r, i), o = (e, r) => t(e) ? n(e.$dynamicRef, r) ?? e : e;
5
+ //#endregion
6
+ export { r as SCHEMA_DYNAMIC_SCOPE_SYMBOL, o as resolveDynamicSchema, a as useDynamicScope };
7
+
8
+ //# sourceMappingURL=dynamic-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-scope.js","names":[],"sources":["../../../src/schema/helpers/dynamic-scope.ts"],"sourcesContent":["import { type DynamicScope, isDynamicRef, resolveDynamicRef } from '@scalar/workspace-store/helpers/dynamic-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { type InjectionKey, inject } from 'vue'\n\n/**\n * The dynamic scope — the outermost-first chain of schema resources on the current render path.\n *\n * JSON Schema 2020-12 `$dynamicRef` does not resolve to a fixed location. It binds to the active\n * `$dynamicAnchor` in the chain of resources entered to reach it, so the same\n * `{ \"$dynamicRef\": \"#itemType\" }` inside a shared generic template resolves to a different concrete\n * type depending on the path taken (e.g. `User` via a user page, `Group` via a group page).\n *\n * Each object `Schema` node injects this scope, appends its own resource, and re-provides it to its\n * descendants. `SchemaProperty` reads it to bind a `$dynamicRef` property or array item to the\n * concrete schema while walking the tree. See https://github.com/scalar/scalar/issues/9414.\n */\nexport const SCHEMA_DYNAMIC_SCOPE_SYMBOL: InjectionKey<DynamicScope> = Symbol('schema-dynamic-scope')\n\n/** Shared empty scope used as the inject default at the root, where nothing has been entered yet. */\nconst EMPTY_SCOPE: DynamicScope = []\n\n/** Read the dynamic scope provided by ancestor schema nodes (empty at the root of the tree). */\nexport const useDynamicScope = (): DynamicScope => inject(SCHEMA_DYNAMIC_SCOPE_SYMBOL, EMPTY_SCOPE)\n\n/**\n * Resolve a schema that may be a `$dynamicRef` against the active dynamic scope.\n *\n * Returns the bound concrete schema when the reference matches a `$dynamicAnchor` in scope. When\n * nothing matches (or the schema is not a `$dynamicRef`) the input is returned unchanged, so\n * rendering falls back to its prior behavior with no regression.\n */\nexport const resolveDynamicSchema = <T extends SchemaObject | undefined>(schema: T, scope: DynamicScope): T => {\n if (isDynamicRef(schema)) {\n return (resolveDynamicRef(schema.$dynamicRef, scope) as T) ?? schema\n }\n\n return schema\n}\n"],"mappings":";;;AAgBA,IAAa,IAA0D,OAAO,sBAAsB,GAG9F,IAA4B,CAAC,GAGtB,UAAsC,EAAO,GAA6B,CAAW,GASrF,KAA4D,GAAW,MAC9E,EAAa,CAAM,IACb,EAAkB,EAAO,aAAa,CAAK,KAAW,IAGzD"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Converts an example value to a string that can be displayed in the UI.
3
+ */
4
+ export declare function formatExample(example: unknown): string | number;
5
+ //# sourceMappingURL=format-example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-example.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/format-example.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CA0C/D"}
@@ -0,0 +1,12 @@
1
+ //#region src/schema/helpers/format-example.ts
2
+ function e(e) {
3
+ let t = e.trim();
4
+ return t === "" ? e : t;
5
+ }
6
+ function t(t) {
7
+ return Array.isArray(t) ? `[${t.map((t) => typeof t == "string" ? `"${e(t)}"` : typeof t == "object" ? JSON.stringify(t) : t === void 0 ? "undefined" : t === null ? "null" : t).join(", ")}]` : t === null ? "null" : typeof t == "object" ? JSON.stringify(t) : t === void 0 ? "undefined" : e(typeof t == "string" ? t : t.toString());
8
+ }
9
+ //#endregion
10
+ export { t as formatExample };
11
+
12
+ //# sourceMappingURL=format-example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-example.js","names":[],"sources":["../../../src/schema/helpers/format-example.ts"],"sourcesContent":["/**\n * Trims surrounding whitespace, but keeps the original string when trimming would empty it\n * (so an intentional \" \" example is not silently turned into \"\").\n */\nfunction preserveOrTrim(value: string): string {\n const trimmed = value.trim()\n return trimmed === '' ? value : trimmed\n}\n\n/**\n * Converts an example value to a string that can be displayed in the UI.\n */\nexport function formatExample(example: unknown): string | number {\n if (Array.isArray(example)) {\n return `[${example\n .map((item) => {\n if (typeof item === 'string') {\n return `\"${preserveOrTrim(item)}\"`\n }\n\n if (typeof item === 'object') {\n return JSON.stringify(item)\n }\n\n if (item === undefined) {\n return 'undefined'\n }\n\n if (item === null) {\n return 'null'\n }\n\n return item\n })\n .join(', ')}]`\n }\n\n if (example === null) {\n return 'null'\n }\n\n if (typeof example === 'object') {\n return JSON.stringify(example)\n }\n\n if (example === undefined) {\n return 'undefined'\n }\n\n if (typeof example === 'string') {\n return preserveOrTrim(example)\n }\n\n return preserveOrTrim(example.toString())\n}\n"],"mappings":";AAIA,SAAS,EAAe,GAAuB;CAC7C,IAAM,IAAU,EAAM,KAAK;CAC3B,OAAO,MAAY,KAAK,IAAQ;AAClC;AAKA,SAAgB,EAAc,GAAmC;CAyC/D,OAxCI,MAAM,QAAQ,CAAO,IAChB,IAAI,EACR,KAAK,MACA,OAAO,KAAS,WACX,IAAI,EAAe,CAAI,EAAE,KAG9B,OAAO,KAAS,WACX,KAAK,UAAU,CAAI,IAGxB,MAAS,KAAA,IACJ,cAGL,MAAS,OACJ,SAGF,CACR,CAAC,CACD,KAAK,IAAI,EAAE,KAGZ,MAAY,OACP,SAGL,OAAO,KAAY,WACd,KAAK,UAAU,CAAO,IAG3B,MAAY,KAAA,IACP,cAIA,EADL,OAAO,KAAY,WACC,IAGF,EAAQ,SAAS,CAHR;AAIjC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Converts a value to a string that can be displayed in the UI.
3
+ */
4
+ export declare function formatValue(value: unknown): string | number;
5
+ //# sourceMappingURL=format-value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-value.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/format-value.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CA0C3D"}
@@ -0,0 +1,8 @@
1
+ //#region src/schema/helpers/format-value.ts
2
+ function e(e) {
3
+ return Array.isArray(e) ? `[${e.map((e) => typeof e == "string" ? `"${e.toString().trim()}"` : typeof e == "object" ? JSON.stringify(e) : e === void 0 ? "undefined" : e === null ? "null" : e).join(", ")}]` : e === null ? "null" : typeof e == "object" ? JSON.stringify(e) : e === void 0 ? "undefined" : typeof e == "string" ? e.trim() : e.toString().trim();
4
+ }
5
+ //#endregion
6
+ export { e as formatValue };
7
+
8
+ //# sourceMappingURL=format-value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-value.js","names":[],"sources":["../../../src/schema/helpers/format-value.ts"],"sourcesContent":["/**\n * Converts a value to a string that can be displayed in the UI.\n */\nexport function formatValue(value: unknown): string | number {\n if (Array.isArray(value)) {\n return `[${value\n .map((item) => {\n if (typeof item === 'string') {\n return `\"${item.toString().trim()}\"`\n }\n\n if (typeof item === 'object') {\n return JSON.stringify(item)\n }\n\n if (item === undefined) {\n return 'undefined'\n }\n\n if (item === null) {\n return 'null'\n }\n\n return item\n })\n .join(', ')}]`\n }\n\n if (value === null) {\n return 'null'\n }\n\n if (typeof value === 'object') {\n return JSON.stringify(value)\n }\n\n if (value === undefined) {\n return 'undefined'\n }\n\n if (typeof value === 'string') {\n return value.trim()\n }\n\n return value.toString().trim()\n}\n"],"mappings":";AAGA,SAAgB,EAAY,GAAiC;CAyC3D,OAxCI,MAAM,QAAQ,CAAK,IACd,IAAI,EACR,KAAK,MACA,OAAO,KAAS,WACX,IAAI,EAAK,SAAS,CAAC,CAAC,KAAK,EAAE,KAGhC,OAAO,KAAS,WACX,KAAK,UAAU,CAAI,IAGxB,MAAS,KAAA,IACJ,cAGL,MAAS,OACJ,SAGF,CACR,CAAC,CACD,KAAK,IAAI,EAAE,KAGZ,MAAU,OACL,SAGL,OAAO,KAAU,WACZ,KAAK,UAAU,CAAK,IAGzB,MAAU,KAAA,IACL,cAGL,OAAO,KAAU,WACZ,EAAM,KAAK,IAGb,EAAM,SAAS,CAAC,CAAC,KAAK;AAC/B"}
@@ -0,0 +1,33 @@
1
+ import type { OpenApiDocument, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
+ import { type CompositionKeyword } from './schema-composition';
3
+ type CompositionToRender = {
4
+ composition: CompositionKeyword;
5
+ value: SchemaObject;
6
+ };
7
+ type DocumentSchemaLookup = Pick<OpenApiDocument, 'components'>;
8
+ /**
9
+ * Builds a synthetic `oneOf` composition from a `discriminator.mapping` when the
10
+ * schema declares a mapping but no explicit `oneOf`/`anyOf`. This is the shape
11
+ * NSwag emits for polymorphic types, where the base type is a plain object with
12
+ * a discriminator mapping pointing at the concrete variants.
13
+ *
14
+ * Returns `null` when there is nothing to infer (an explicit composition is
15
+ * already present, no document to resolve refs against, or no resolvable refs).
16
+ */
17
+ export declare const inferDiscriminatorMappingComposition: (value: SchemaObject, documentProp?: DocumentSchemaLookup) => SchemaObject | null;
18
+ /**
19
+ * Computes which compositions should be rendered and with which values
20
+ *
21
+ * @param value - The schema object to check for compositions
22
+ * @returns Array of compositions to render with their values
23
+ */
24
+ export declare const getCompositionsToRender: (value: SchemaObject | undefined, document?: DocumentSchemaLookup,
25
+ /**
26
+ * The `oneOf` inferred from a bare `discriminator.mapping`, when the caller has
27
+ * already computed it. `SchemaProperty` needs the same value to decide whether
28
+ * to suppress the duplicate base object block, so it passes it here to avoid
29
+ * inferring twice. Omit it and it is inferred from `value`.
30
+ */
31
+ inferredDiscriminatorComposition?: SchemaObject | null) => CompositionToRender[];
32
+ export {};
33
+ //# sourceMappingURL=get-compositions-to-render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-compositions-to-render.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/get-compositions-to-render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAIjH,OAAO,EAAE,KAAK,kBAAkB,EAAgB,MAAM,sBAAsB,CAAA;AAI5E,KAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,KAAK,EAAE,YAAY,CAAA;CACpB,CAAA;AAED,KAAK,oBAAoB,GAAG,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAAA;AAK/D;;;;;;;;GAQG;AACH,eAAO,MAAM,oCAAoC,GAC/C,OAAO,YAAY,EACnB,eAAe,oBAAoB,KAClC,YAAY,GAAG,IA+CjB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,YAAY,GAAG,SAAS,EAC/B,WAAW,oBAAoB;AAC/B;;;;;GAKG;AACH,mCAAkC,YAAY,GAAG,IAEzC,KACP,mBAAmB,EAuCrB,CAAA"}
@@ -0,0 +1,39 @@
1
+ import { getRefName as e } from "./get-ref-name.js";
2
+ import { compositions as t } from "./schema-composition.js";
3
+ import { shouldRenderArrayItemComposition as n } from "./should-render-array-item-composition.js";
4
+ import { unwrapForRead as r } from "./unwrap-for-read.js";
5
+ import { resolve as i } from "@scalar/workspace-store/resolve";
6
+ import { isDefined as a } from "@scalar/helpers/array/is-defined";
7
+ import { isArraySchema as o } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
8
+ //#region src/schema/helpers/get-compositions-to-render.ts
9
+ var s = (e) => e.startsWith("#/") || e.includes("/") ? e : `#/components/schemas/${e}`, c = (t, n) => {
10
+ if (t.oneOf || t.anyOf) return null;
11
+ let o = t.discriminator?.mapping;
12
+ if (!o) return null;
13
+ let c = r(n);
14
+ if (!c?.components?.schemas) return null;
15
+ let l = Object.values(o).filter((e) => typeof e == "string").map((t) => {
16
+ let n = s(t), r = e(n), a = r ? i.schema(c.components?.schemas?.[r]) : void 0;
17
+ if (a) return {
18
+ $ref: n,
19
+ "$ref-value": a
20
+ };
21
+ }).filter(a);
22
+ return l.length === 0 ? null : {
23
+ ...i.schema(t),
24
+ oneOf: l
25
+ };
26
+ }, l = (e, r, s = e ? c(e, r) : null) => e ? t.map((t) => t === "oneOf" && s ? {
27
+ composition: t,
28
+ value: s
29
+ } : n(e, t) && o(e) && e.items ? {
30
+ composition: t,
31
+ value: i.schema(e.items)
32
+ } : e[t] && !(o(e) && e.items && typeof e.items == "object" && t in e.items) ? {
33
+ composition: t,
34
+ value: i.schema(e)
35
+ } : null).filter(a) : [];
36
+ //#endregion
37
+ export { l as getCompositionsToRender, c as inferDiscriminatorMappingComposition };
38
+
39
+ //# sourceMappingURL=get-compositions-to-render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-compositions-to-render.js","names":[],"sources":["../../../src/schema/helpers/get-compositions-to-render.ts"],"sourcesContent":["import { isDefined } from '@scalar/helpers/array/is-defined'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { OpenApiDocument, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\nimport { getRefName } from './get-ref-name'\nimport { type CompositionKeyword, compositions } from './schema-composition'\nimport { shouldRenderArrayItemComposition } from './should-render-array-item-composition'\nimport { unwrapForRead } from './unwrap-for-read'\n\ntype CompositionToRender = {\n composition: CompositionKeyword\n value: SchemaObject\n}\n\ntype DocumentSchemaLookup = Pick<OpenApiDocument, 'components'>\n\nconst normalizeDiscriminatorMappingRef = (value: string) =>\n value.startsWith('#/') || value.includes('/') ? value : `#/components/schemas/${value}`\n\n/**\n * Builds a synthetic `oneOf` composition from a `discriminator.mapping` when the\n * schema declares a mapping but no explicit `oneOf`/`anyOf`. This is the shape\n * NSwag emits for polymorphic types, where the base type is a plain object with\n * a discriminator mapping pointing at the concrete variants.\n *\n * Returns `null` when there is nothing to infer (an explicit composition is\n * already present, no document to resolve refs against, or no resolvable refs).\n */\nexport const inferDiscriminatorMappingComposition = (\n value: SchemaObject,\n documentProp?: DocumentSchemaLookup,\n): SchemaObject | null => {\n if (value.oneOf || value.anyOf) {\n return null\n }\n\n // A schema without a mapping can never infer anything, so it is checked before the document is\n // touched at all: the document read below is by far the more expensive of the two.\n const mapping = value.discriminator?.mapping\n\n if (!mapping) {\n return null\n }\n\n // Reading `components.schemas` per row through the reactive and detect-changes layers is the\n // dominant cost of this helper, so the document is unwrapped once here. See `unwrapForRead`.\n const document = unwrapForRead(documentProp)\n\n if (!document?.components?.schemas) {\n return null\n }\n\n const refs = Object.values(mapping)\n .filter((mappingValue): mappingValue is string => typeof mappingValue === 'string')\n .map((mappingValue) => {\n const ref = normalizeDiscriminatorMappingRef(mappingValue)\n const refName = getRefName(ref)\n const refValue = refName ? resolve.schema(document.components?.schemas?.[refName]) : undefined\n\n if (!refValue) {\n return undefined\n }\n\n return {\n $ref: ref,\n '$ref-value': refValue,\n }\n })\n .filter(isDefined)\n\n if (refs.length === 0) {\n return null\n }\n\n return {\n ...resolve.schema(value),\n oneOf: refs,\n }\n}\n\n/**\n * Computes which compositions should be rendered and with which values\n *\n * @param value - The schema object to check for compositions\n * @returns Array of compositions to render with their values\n */\nexport const getCompositionsToRender = (\n value: SchemaObject | undefined,\n document?: DocumentSchemaLookup,\n /**\n * The `oneOf` inferred from a bare `discriminator.mapping`, when the caller has\n * already computed it. `SchemaProperty` needs the same value to decide whether\n * to suppress the duplicate base object block, so it passes it here to avoid\n * inferring twice. Omit it and it is inferred from `value`.\n */\n inferredDiscriminatorComposition: SchemaObject | null = value\n ? inferDiscriminatorMappingComposition(value, document)\n : null,\n): CompositionToRender[] => {\n if (!value) {\n return []\n }\n\n return compositions\n .map((composition) => {\n if (composition === 'oneOf' && inferredDiscriminatorComposition) {\n return {\n composition,\n value: inferredDiscriminatorComposition,\n }\n }\n\n // Check for array item-level composition first (more specific case)\n if (shouldRenderArrayItemComposition(value, composition) && isArraySchema(value) && value.items) {\n return {\n composition,\n value: resolve.schema(value.items),\n }\n }\n\n // Check for property-level composition\n if (value[composition]) {\n // Skip if array items have this composition (even if complex/not rendered)\n const hasArrayItemComposition =\n isArraySchema(value) && value.items && typeof value.items === 'object' && composition in value.items\n\n if (!hasArrayItemComposition) {\n return {\n composition,\n value: resolve.schema(value),\n }\n }\n }\n\n return null\n })\n .filter(isDefined)\n}\n"],"mappings":";;;;;;;;AAiBA,IAAM,KAAoC,MACxC,EAAM,WAAW,IAAI,KAAK,EAAM,SAAS,GAAG,IAAI,IAAQ,wBAAwB,KAWrE,KACX,GACA,MACwB;CACxB,IAAI,EAAM,SAAS,EAAM,OACvB,OAAO;CAKT,IAAM,IAAU,EAAM,eAAe;CAErC,IAAI,CAAC,GACH,OAAO;CAKT,IAAM,IAAW,EAAc,CAAY;CAE3C,IAAI,CAAC,GAAU,YAAY,SACzB,OAAO;CAGT,IAAM,IAAO,OAAO,OAAO,CAAO,CAAC,CAChC,QAAQ,MAAyC,OAAO,KAAiB,QAAQ,CAAC,CAClF,KAAK,MAAiB;EACrB,IAAM,IAAM,EAAiC,CAAY,GACnD,IAAU,EAAW,CAAG,GACxB,IAAW,IAAU,EAAQ,OAAO,EAAS,YAAY,UAAU,EAAQ,IAAI,KAAA;EAEhF,OAIL,OAAO;GACL,MAAM;GACN,cAAc;EAChB;CACF,CAAC,CAAC,CACD,OAAO,CAAS;CAMnB,OAJI,EAAK,WAAW,IACX,OAGF;EACL,GAAG,EAAQ,OAAO,CAAK;EACvB,OAAO;CACT;AACF,GAQa,KACX,GACA,GAOA,IAAwD,IACpD,EAAqC,GAAO,CAAQ,IACpD,SAEC,IAIE,EACJ,KAAK,MACA,MAAgB,WAAW,IACtB;CACL;CACA,OAAO;AACT,IAIE,EAAiC,GAAO,CAAW,KAAK,EAAc,CAAK,KAAK,EAAM,QACjF;CACL;CACA,OAAO,EAAQ,OAAO,EAAM,KAAK;AACnC,IAIE,EAAM,MAKJ,EAFF,EAAc,CAAK,KAAK,EAAM,SAAS,OAAO,EAAM,SAAU,YAAY,KAAe,EAAM,SAGxF;CACL;CACA,OAAO,EAAQ,OAAO,CAAK;AAC7B,IAIG,IACR,CAAC,CACD,OAAO,CAAS,IApCV,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DiscriminatorObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
+ /** Finds the payload values explicitly mapped to a referenced composition member. */
3
+ export declare const getDiscriminatorValues: (ref: string | undefined, mapping: DiscriminatorObject["mapping"]) => string[];
4
+ //# sourceMappingURL=get-discriminator-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-discriminator-values.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/get-discriminator-values.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;AAEvG,qFAAqF;AACrF,eAAO,MAAM,sBAAsB,GAAI,KAAK,MAAM,GAAG,SAAS,EAAE,SAAS,mBAAmB,CAAC,SAAS,CAAC,KAAG,MAAM,EAU/G,CAAA"}
@@ -0,0 +1,6 @@
1
+ //#region src/schema/helpers/get-discriminator-values.ts
2
+ var e = (e, t) => !e || !t ? [] : Object.entries(t).filter(([, t]) => t === e || `#/components/schemas/${t}` === e).map(([e]) => e);
3
+ //#endregion
4
+ export { e as getDiscriminatorValues };
5
+
6
+ //# sourceMappingURL=get-discriminator-values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-discriminator-values.js","names":[],"sources":["../../../src/schema/helpers/get-discriminator-values.ts"],"sourcesContent":["import type { DiscriminatorObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\n/** Finds the payload values explicitly mapped to a referenced composition member. */\nexport const getDiscriminatorValues = (ref: string | undefined, mapping: DiscriminatorObject['mapping']): string[] => {\n if (!ref || !mapping) {\n return []\n }\n\n // A mapping can use either a URI reference or a local component name. Match\n // the whole reference so external schemas with the same name stay distinct.\n return Object.entries(mapping)\n .filter(([, target]) => target === ref || `#/components/schemas/${target}` === ref)\n .map(([value]) => value)\n}\n"],"mappings":";AAGA,IAAa,KAA0B,GAAyB,MAC1D,CAAC,KAAO,CAAC,IACJ,CAAC,IAKH,OAAO,QAAQ,CAAO,CAAC,CAC3B,QAAQ,GAAG,OAAY,MAAW,KAAO,wBAAwB,QAAa,CAAG,CAAC,CAClF,KAAK,CAAC,OAAW,CAAK"}
@@ -0,0 +1,9 @@
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
+ /**
3
+ * Extract enum values from schema or array items
4
+ *
5
+ * @param value - The schema object to extract enum values from
6
+ * @returns Array of enum values, or empty array if no enum found
7
+ */
8
+ export declare const getEnumValues: (value: SchemaObject | undefined) => unknown[];
9
+ //# sourceMappingURL=get-enum-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-enum-values.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/get-enum-values.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,YAAY,GAAG,SAAS,KAAG,OAAO,EAmBtE,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { resolve as e } from "@scalar/workspace-store/resolve";
2
+ import { isArraySchema as t } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
3
+ //#region src/schema/helpers/get-enum-values.ts
4
+ var n = (n) => {
5
+ if (!n) return [];
6
+ if (n.enum) return n.enum;
7
+ if (t(n) && typeof n.items == "object") {
8
+ let t = e.schema(n.items);
9
+ if (t && "enum" in t && t.enum) return t.enum;
10
+ }
11
+ return [];
12
+ };
13
+ //#endregion
14
+ export { n as getEnumValues };
15
+
16
+ //# sourceMappingURL=get-enum-values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-enum-values.js","names":[],"sources":["../../../src/schema/helpers/get-enum-values.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\n/**\n * Extract enum values from schema or array items\n *\n * @param value - The schema object to extract enum values from\n * @returns Array of enum values, or empty array if no enum found\n */\nexport const getEnumValues = (value: SchemaObject | undefined): unknown[] => {\n if (!value) {\n return []\n }\n\n // Check for enum directly on the schema\n if (value.enum) {\n return value.enum\n }\n\n // Check for enum in array items (resolving $ref if present)\n if (isArraySchema(value) && typeof value.items === 'object') {\n const resolvedItems = resolve.schema(value.items)\n if (resolvedItems && 'enum' in resolvedItems && resolvedItems.enum) {\n return resolvedItems.enum\n }\n }\n\n return []\n}\n"],"mappings":";;;AAUA,IAAa,KAAiB,MAA+C;CAC3E,IAAI,CAAC,GACH,OAAO,CAAC;CAIV,IAAI,EAAM,MACR,OAAO,EAAM;CAIf,IAAI,EAAc,CAAK,KAAK,OAAO,EAAM,SAAU,UAAU;EAC3D,IAAM,IAAgB,EAAQ,OAAO,EAAM,KAAK;EAChD,IAAI,KAAiB,UAAU,KAAiB,EAAc,MAC5D,OAAO,EAAc;CAEzB;CAEA,OAAO,CAAC;AACV"}
@@ -0,0 +1,9 @@
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
+ /**
3
+ * Generate property description from type/format
4
+ *
5
+ * @param value - The schema object to generate description from
6
+ * @returns Description string or null if no description available
7
+ */
8
+ export declare const getPropertyDescription: (value: SchemaObject | undefined) => string | null;
9
+ //# sourceMappingURL=get-property-description.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-property-description.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/get-property-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAoBhG;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,YAAY,GAAG,SAAS,KAAG,MAAM,GAAG,IAkBjF,CAAA"}
@@ -0,0 +1,27 @@
1
+ import { isSchema as e } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
2
+ //#region src/schema/helpers/get-property-description.ts
3
+ var t = {
4
+ integer: {
5
+ _default: "Integer numbers.",
6
+ int32: "Signed 32-bit integers (commonly used integer type).",
7
+ int64: "Signed 64-bit integers (long type)."
8
+ },
9
+ string: {
10
+ date: "full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21",
11
+ "date-time": "the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z",
12
+ password: "a hint to UIs to mask the input",
13
+ base64: "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
14
+ byte: "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
15
+ binary: "binary data, used to describe files"
16
+ }
17
+ }, n = (n) => {
18
+ if (!e(n)) return null;
19
+ let r = Array.isArray(n.type) ? n.type[0] : n.type;
20
+ if (!r) return null;
21
+ let i = t[r];
22
+ return i ? i["format" in n && n.format || "contentEncoding" in n && n.contentEncoding || "_default"] ?? null : null;
23
+ };
24
+ //#endregion
25
+ export { n as getPropertyDescription };
26
+
27
+ //# sourceMappingURL=get-property-description.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-property-description.js","names":[],"sources":["../../../src/schema/helpers/get-property-description.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isSchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\n// Type descriptions for built-in types\nconst TYPE_DESCRIPTIONS: Record<string, Record<string, string>> = {\n integer: {\n _default: 'Integer numbers.',\n int32: 'Signed 32-bit integers (commonly used integer type).',\n int64: 'Signed 64-bit integers (long type).',\n },\n string: {\n 'date': 'full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21',\n 'date-time': 'the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z',\n 'password': 'a hint to UIs to mask the input',\n 'base64': 'base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==',\n 'byte': 'base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==',\n 'binary': 'binary data, used to describe files',\n },\n} as const\n\n/**\n * Generate property description from type/format\n *\n * @param value - The schema object to generate description from\n * @returns Description string or null if no description available\n */\nexport const getPropertyDescription = (value: SchemaObject | undefined): string | null => {\n if (!isSchema(value)) {\n return null\n }\n /** Just grab the first type from the array if it's an array */\n const type = Array.isArray(value.type) ? value.type[0] : value.type\n if (!type) {\n return null\n }\n\n const typeDescriptions = TYPE_DESCRIPTIONS[type]\n if (!typeDescriptions) {\n return null\n }\n\n const format =\n ('format' in value && value.format) || ('contentEncoding' in value && value.contentEncoding) || '_default'\n return typeDescriptions[format] ?? null\n}\n"],"mappings":";;AAIA,IAAM,IAA4D;CAChE,SAAS;EACP,UAAU;EACV,OAAO;EACP,OAAO;CACT;CACA,QAAQ;EACN,MAAQ;EACR,aAAa;EACb,UAAY;EACZ,QAAU;EACV,MAAQ;EACR,QAAU;CACZ;AACF,GAQa,KAA0B,MAAmD;CACxF,IAAI,CAAC,EAAS,CAAK,GACjB,OAAO;CAGT,IAAM,IAAO,MAAM,QAAQ,EAAM,IAAI,IAAI,EAAM,KAAK,KAAK,EAAM;CAC/D,IAAI,CAAC,GACH,OAAO;CAGT,IAAM,IAAmB,EAAkB;CAO3C,OANK,IAME,EADJ,YAAY,KAAS,EAAM,UAAY,qBAAqB,KAAS,EAAM,mBAAoB,eAC/D,OAL1B;AAMX"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Gets the final reference segment for display, including external references.
3
+ * Use getSchemaRefName when the name must link to a local model.
4
+ *
5
+ * @example SchemaName from #/components/schemas/SchemaName
6
+ */
7
+ export declare const getRefName: (ref: string) => string | null | undefined;
8
+ /**
9
+ * Gets the models-section key for a `$ref`, but only when the ref actually
10
+ * targets `#/components/schemas/`.
11
+ *
12
+ * The models index used for navigation is built exclusively from
13
+ * `components.schemas`, so a ref into any other bucket (`parameters`,
14
+ * `responses`, ...) or an external file (`./other.yaml#/Foo`) has no navigable
15
+ * target. Returning `null` for those keeps the name visible as plain text while
16
+ * avoiding a dead link.
17
+ *
18
+ * @example
19
+ * getSchemaRefName('#/components/schemas/Planet') // 'Planet'
20
+ * getSchemaRefName('#/components/parameters/Planet') // null
21
+ * getSchemaRefName('./planets.yaml#/Planet') // null
22
+ */
23
+ export declare const getSchemaRefName: (ref: string) => string | null;
24
+ //# sourceMappingURL=get-ref-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-ref-name.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/get-ref-name.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,8BAWrC,CAAA;AASD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,IAWvD,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { REGEX as e } from "@scalar/helpers/regex/regex-helpers";
2
+ //#region src/schema/helpers/get-ref-name.ts
3
+ var t = (t) => {
4
+ if (!t) return null;
5
+ let n = t.match(e.REF_NAME);
6
+ return n ? n[1] : null;
7
+ }, n = /^#\/components\/schemas\/([^/]+)$/, r = (e) => {
8
+ if (!e) return null;
9
+ let t = e.match(n);
10
+ return t?.[1] ? decodeURIComponent(t[1]) : null;
11
+ };
12
+ //#endregion
13
+ export { t as getRefName, r as getSchemaRefName };
14
+
15
+ //# sourceMappingURL=get-ref-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-ref-name.js","names":[],"sources":["../../../src/schema/helpers/get-ref-name.ts"],"sourcesContent":["import { REGEX } from '@scalar/helpers/regex/regex-helpers'\n\n/**\n * Gets the final reference segment for display, including external references.\n * Use getSchemaRefName when the name must link to a local model.\n *\n * @example SchemaName from #/components/schemas/SchemaName\n */\nexport const getRefName = (ref: string) => {\n if (!ref) {\n return null\n }\n\n const match = ref.match(REGEX.REF_NAME)\n if (match) {\n return match[1]\n }\n\n return null\n}\n\n/**\n * Matches a local reference that points at `#/components/schemas/<name>` and\n * captures the schema name. Intentionally strict: only refs that resolve to a\n * navigable model in `components.schemas` should be linkable.\n */\nconst COMPONENTS_SCHEMAS_REF = /^#\\/components\\/schemas\\/([^/]+)$/\n\n/**\n * Gets the models-section key for a `$ref`, but only when the ref actually\n * targets `#/components/schemas/`.\n *\n * The models index used for navigation is built exclusively from\n * `components.schemas`, so a ref into any other bucket (`parameters`,\n * `responses`, ...) or an external file (`./other.yaml#/Foo`) has no navigable\n * target. Returning `null` for those keeps the name visible as plain text while\n * avoiding a dead link.\n *\n * @example\n * getSchemaRefName('#/components/schemas/Planet') // 'Planet'\n * getSchemaRefName('#/components/parameters/Planet') // null\n * getSchemaRefName('./planets.yaml#/Planet') // null\n */\nexport const getSchemaRefName = (ref: string): string | null => {\n if (!ref) {\n return null\n }\n\n const match = ref.match(COMPONENTS_SCHEMAS_REF)\n if (match?.[1]) {\n return decodeURIComponent(match[1])\n }\n\n return null\n}\n"],"mappings":";;AAQA,IAAa,KAAc,MAAgB;CACzC,IAAI,CAAC,GACH,OAAO;CAGT,IAAM,IAAQ,EAAI,MAAM,EAAM,QAAQ;CAKtC,OAJI,IACK,EAAM,KAGR;AACT,GAOM,IAAyB,qCAiBlB,KAAoB,MAA+B;CAC9D,IAAI,CAAC,GACH,OAAO;CAGT,IAAM,IAAQ,EAAI,MAAM,CAAsB;CAK9C,OAJI,IAAQ,KACH,mBAAmB,EAAM,EAAE,IAG7B;AACT"}