@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 @@
1
+ {"version":3,"file":"schema-expansion.js","names":[],"sources":["../../../src/schema/helpers/schema-expansion.ts"],"sourcesContent":["import {\n type InjectionKey,\n type Ref,\n nextTick,\n onBeforeUnmount,\n onMounted,\n shallowReactive,\n shallowRef,\n watch,\n} from 'vue'\n\nimport { isOnSchemaTargetPath } from './is-on-schema-target-path'\n\n/**\n * What a node does when nobody has expressed an opinion about it: its own\n * `defaultOpen`, or whatever expand-all / collapse-all last set.\n */\ntype ExpansionBaseline = 'default' | 'expanded' | 'collapsed'\n\n/** What the store cannot work out about a node on its own. */\ntype ExpansionContext = {\n /**\n * Whether this node sits on a `$ref` cycle. Bulk expansion and the baseline\n * skip cyclic nodes; without that, `expandAll()` on a self-referential schema\n * never terminates, because the cycle guard only suppresses auto-expansion.\n */\n cyclic?: boolean\n /** What the node would do with no store at all (its `defaultOpen`). */\n defaultOpen?: boolean\n /**\n * The public anchor path this node covers, when it differs from its key. A\n * key carrying a structural marker (`~headers`) must still open for a deep\n * link written against the anchor path (`…headers.X-Rate`).\n */\n anchorPath?: string\n}\n\n/** Shared expansion controls for a host and its schema trees. */\nexport type SchemaExpansionStore = {\n /** Resolve whether a node is open. See the resolution order below. */\n isExpanded: (key: string, ctx?: ExpansionContext) => boolean\n /** Record an explicit user decision about one node. */\n setExpanded: (key: string, value: boolean) => void\n /** Flip one node, resolving its current state first. */\n toggle: (key: string, ctx?: ExpansionContext) => void\n /** Expand everything, or everything beneath `root`. */\n expandAll: (root?: string) => void\n /** Collapse everything, or everything beneath `root`. */\n collapseAll: (root?: string) => void\n /** Make a deep link's expansion permanent by opening every ancestor of `path`. */\n commitPath: (path: string) => void\n /** The standing baseline, exposed so a print hook can flip it and put it back. */\n baseline: Ref<ExpansionBaseline>\n /**\n * The budget for closed panels kept in the DOM as `hidden=\"until-found\"`. It\n * lives on the store, so it is shared by every schema tree under one reference.\n * Kept panels stay searchable with find-in-page but grow the DOM, so a closing\n * row asks `acquire()` first and simply unmounts past the cap. Deliberately\n * not reactive: it only matters at the moment a panel closes.\n */\n untilFound: {\n acquire: () => boolean\n release: () => void\n }\n /**\n * Run a bulk transition with slot retention paused. A collapse-all or the\n * afterprint restore closes many rows in one flush; letting each one\n * `acquire()` would drain the budget in a single gesture and pin hundreds of\n * hidden subtrees. Releases still run, so reopened rows hand slots back.\n */\n pauseRetentionFor: (mutate: () => void) => void\n}\n\n/**\n * Whether `key` is `root` or sits beneath it. A literal `.` is the separator\n * even though property names may contain one (`a.b` + `c` collides with `a` +\n * `b.c`); the key is deliberately the same string as the public anchor used by\n * the sidebar, `scrollTargetId` and shared URLs, so it cannot be re-encoded alone.\n */\nconst isUnder = (key: string, root: string): boolean => root === '' || key === root || key.startsWith(`${root}.`)\n\n/**\n * Build the node key for a breadcrumb: the dot-joined anchor path, so store keys\n * and public anchors are the same string. Callers append `~`-marked structural\n * segments (`~headers`, `~anonymous-…`) for nodes the anchor cannot name.\n */\nexport const toNodeKey = (breadcrumb: readonly string[] | undefined): string => breadcrumb?.join('.') ?? ''\n\n/**\n * How many closed panels one store keeps mounted as `hidden=\"until-found\"` —\n * one `<ApiReference>`, not one tree, since every tree under it shares a store.\n */\nconst UNTIL_FOUND_CAP = 300\n\n/**\n * A per-reference store of which schema properties are open. Sparse by\n * construction: only what somebody touched, typically under twenty keys, where\n * a dense map over a large document would be tens of thousands. The maps are\n * `shallowReactive` because a Map inside a `shallowRef` does not track `.set()`\n * (clicks would do nothing) and replacing the Map wholesale would invalidate\n * every mounted row on every toggle.\n */\nexport const createSchemaExpansionStore = (scrollTargetId: Ref<string> = shallowRef('')): SchemaExpansionStore => {\n /** Only what the user explicitly opened or closed. */\n const overrides = shallowReactive(new Map<string, boolean>())\n /** Per-subtree expand-all / collapse-all roots. */\n const bulkRoots = shallowReactive(new Map<string, boolean>())\n const baseline = shallowRef<ExpansionBaseline>('default')\n\n /** The nearest bulk root at or above `key`, if any. */\n const nearestBulkRoot = (key: string): boolean | undefined => {\n if (bulkRoots.size === 0) {\n return undefined\n }\n\n let candidate = key\n\n while (true) {\n const value = bulkRoots.get(candidate)\n\n if (value !== undefined) {\n return value\n }\n\n const cut = candidate.lastIndexOf('.')\n\n if (cut === -1) {\n return bulkRoots.get('')\n }\n\n candidate = candidate.slice(0, cut)\n }\n }\n\n /**\n * Newest intent wins: a bulk write drops the overrides beneath its root, so\n * \"an explicit override always wins\" never becomes \"Expand all silently skips\n * every node the user has ever touched\". O(overrides), which stays small.\n */\n const clearOverridesUnder = (root: string): void => {\n for (const key of [...overrides.keys()]) {\n if (isUnder(key, root)) {\n overrides.delete(key)\n }\n }\n }\n\n /** While true, closing rows must not take until-found slots. */\n let retentionPaused = false\n\n const pauseRetentionFor = (mutate: () => void): void => {\n retentionPaused = true\n mutate()\n\n // The closes land in the same pre-render flush as the write, so the pause can lift after it.\n void nextTick(() => {\n retentionPaused = false\n })\n }\n\n const setBulk = (root: string, value: boolean): void => {\n clearOverridesUnder(root)\n\n if (root === '') {\n // A document-wide bulk action supersedes every narrower one.\n bulkRoots.clear()\n baseline.value = value ? 'expanded' : 'collapsed'\n return\n }\n\n for (const existing of [...bulkRoots.keys()]) {\n if (isUnder(existing, root)) {\n bulkRoots.delete(existing)\n }\n }\n\n bulkRoots.set(root, value)\n }\n\n const isExpanded = (key: string, ctx: ExpansionContext = {}): boolean => {\n // 1. An explicit decision by the user, O(1).\n const override = overrides.get(key)\n\n if (override !== undefined) {\n return override\n }\n\n // 2 and 3 are skipped for cyclic nodes, so bulk expansion terminates.\n if (!ctx.cyclic) {\n // 2. The nearest enclosing bulk action.\n const bulk = nearestBulkRoot(key)\n\n if (bulk !== undefined) {\n return bulk\n }\n\n // 3. The standing baseline.\n if (baseline.value === 'expanded') {\n return true\n }\n\n if (baseline.value === 'collapsed') {\n return false\n }\n }\n\n // 4. A live deep link, read here rather than at mount so a second deep link\n // into an already-rendered operation still works.\n if (isOnSchemaTargetPath(ctx.anchorPath ?? key, scrollTargetId.value)) {\n return true\n }\n\n // 5. Whatever the node would have done on its own.\n return ctx.defaultOpen ?? false\n }\n\n const setExpanded = (key: string, value: boolean): void => {\n overrides.set(key, value)\n }\n\n return {\n isExpanded,\n setExpanded,\n toggle: (key, ctx) => setExpanded(key, !isExpanded(key, ctx)),\n expandAll: (root = '') => setBulk(root, true),\n collapseAll: (root = '') => pauseRetentionFor(() => setBulk(root, false)),\n commitPath: (path: string): void => {\n if (!path) {\n return\n }\n\n // Open every ancestor and the target itself as overrides, so the expansion\n // outlives `clearScrollTarget` and stays user-collapsible.\n const segments = path.split('.')\n\n for (let index = 1; index <= segments.length; index++) {\n const prefix = segments.slice(0, index).join('.')\n overrides.set(prefix, true)\n\n /*\n * Also commit the marked form (`~headers`) of this segment: it is not a\n * literal prefix of the anchor, so it would re-collapse, and unmount the\n * landed-on row, once the scroll target cleared. Derived rather than\n * registered, because operations mount lazily and would register too\n * late. An override for a key nothing uses is inert.\n */\n const cut = prefix.lastIndexOf('.')\n\n if (cut !== -1) {\n overrides.set(`${prefix.slice(0, cut)}.~${prefix.slice(cut + 1)}`, true)\n }\n }\n },\n baseline,\n pauseRetentionFor,\n untilFound: (() => {\n let used = 0\n\n return {\n acquire: (): boolean => {\n if (retentionPaused || used >= UNTIL_FOUND_CAP) {\n return false\n }\n\n used += 1\n return true\n },\n release: (): void => {\n used = Math.max(0, used - 1)\n },\n }\n })(),\n }\n}\n\n/**\n * Marks that an enclosing Schema already owns the tree root. Nesting depth\n * cannot identify the outermost tree, because a nested Schema may mount at depth\n * 0 (an `allOf` member, or a caller that omits `depth`), and the root-only\n * features (sticky ancestor strip, keyboard navigation) must not install twice.\n */\nexport const SCHEMA_TREE_ROOT_SYMBOL: InjectionKey<boolean> = Symbol('schema-tree-root')\n\n/**\n * Create the expansion store for one `<ApiReference>` and wire up deep links.\n * The scroll target is read only after mount: it comes from a URL fragment the\n * server never sees, so committing it during SSR would make every ancestor\n * panel on a deep-linked path a hydration mismatch.\n */\nexport const useSchemaExpansion = (scrollTargetId: Ref<string> = shallowRef('')): SchemaExpansionStore => {\n const store = createSchemaExpansionStore(scrollTargetId)\n\n onMounted(() => {\n watch(\n scrollTargetId,\n (target) => {\n if (target) {\n store.commitPath(target)\n }\n },\n { immediate: true },\n )\n\n /** Print with everything expanded, then put the reader's state back. */\n let baselineBeforePrint: ExpansionBaseline | null = null\n\n const handleBeforePrint = (): void => {\n baselineBeforePrint = store.baseline.value\n store.baseline.value = 'expanded'\n }\n\n const handleAfterPrint = (): void => {\n if (baselineBeforePrint !== null) {\n // Restoring the baseline closes every row the print flip opened; none may claim a slot.\n const previous = baselineBeforePrint\n store.pauseRetentionFor(() => {\n store.baseline.value = previous\n })\n baselineBeforePrint = null\n }\n }\n\n window.addEventListener('beforeprint', handleBeforePrint)\n window.addEventListener('afterprint', handleAfterPrint)\n\n onBeforeUnmount(() => {\n window.removeEventListener('beforeprint', handleBeforePrint)\n window.removeEventListener('afterprint', handleAfterPrint)\n })\n })\n\n return store\n}\n"],"mappings":";;;AA+EA,IAAM,KAAW,GAAa,MAA0B,MAAS,MAAM,MAAQ,KAAQ,EAAI,WAAW,GAAG,EAAK,EAAE,GAOnG,KAAa,MAAsD,GAAY,KAAK,GAAG,KAAK,IAMnG,IAAkB,KAUX,KAA8B,IAA8B,EAAW,EAAE,MAA4B;CAEhH,IAAM,IAAY,kBAAgB,IAAI,IAAqB,CAAC,GAEtD,IAAY,kBAAgB,IAAI,IAAqB,CAAC,GACtD,IAAW,EAA8B,SAAS,GAGlD,KAAmB,MAAqC;EAC5D,IAAI,EAAU,SAAS,GACrB;EAGF,IAAI,IAAY;EAEhB,SAAa;GACX,IAAM,IAAQ,EAAU,IAAI,CAAS;GAErC,IAAI,MAAU,KAAA,GACZ,OAAO;GAGT,IAAM,IAAM,EAAU,YAAY,GAAG;GAErC,IAAI,MAAQ,IACV,OAAO,EAAU,IAAI,EAAE;GAGzB,IAAY,EAAU,MAAM,GAAG,CAAG;EACpC;CACF,GAOM,KAAuB,MAAuB;EAClD,KAAK,IAAM,KAAO,CAAC,GAAG,EAAU,KAAK,CAAC,GACpC,AAAI,EAAQ,GAAK,CAAI,KACnB,EAAU,OAAO,CAAG;CAG1B,GAGI,IAAkB,IAEhB,KAAqB,MAA6B;EAKtD,AAJA,IAAkB,IAClB,EAAO,GAGP,QAAoB;GAClB,IAAkB;EACpB,CAAC;CACH,GAEM,KAAW,GAAc,MAAyB;EAGtD,IAFA,EAAoB,CAAI,GAEpB,MAAS,IAAI;GAGf,AADA,EAAU,MAAM,GAChB,EAAS,QAAQ,IAAQ,aAAa;GACtC;EACF;EAEA,KAAK,IAAM,KAAY,CAAC,GAAG,EAAU,KAAK,CAAC,GACzC,AAAI,EAAQ,GAAU,CAAI,KACxB,EAAU,OAAO,CAAQ;EAI7B,EAAU,IAAI,GAAM,CAAK;CAC3B,GAEM,KAAc,GAAa,IAAwB,CAAC,MAAe;EAEvE,IAAM,IAAW,EAAU,IAAI,CAAG;EAElC,IAAI,MAAa,KAAA,GACf,OAAO;EAIT,IAAI,CAAC,EAAI,QAAQ;GAEf,IAAM,IAAO,EAAgB,CAAG;GAEhC,IAAI,MAAS,KAAA,GACX,OAAO;GAIT,IAAI,EAAS,UAAU,YACrB,OAAO;GAGT,IAAI,EAAS,UAAU,aACrB,OAAO;EAEX;EASA,OALI,EAAqB,EAAI,cAAc,GAAK,EAAe,KAAK,IAC3D,KAIF,EAAI,eAAe;CAC5B,GAEM,KAAe,GAAa,MAAyB;EACzD,EAAU,IAAI,GAAK,CAAK;CAC1B;CAEA,OAAO;EACL;EACA;EACA,SAAS,GAAK,MAAQ,EAAY,GAAK,CAAC,EAAW,GAAK,CAAG,CAAC;EAC5D,YAAY,IAAO,OAAO,EAAQ,GAAM,EAAI;EAC5C,cAAc,IAAO,OAAO,QAAwB,EAAQ,GAAM,EAAK,CAAC;EACxE,aAAa,MAAuB;GAClC,IAAI,CAAC,GACH;GAKF,IAAM,IAAW,EAAK,MAAM,GAAG;GAE/B,KAAK,IAAI,IAAQ,GAAG,KAAS,EAAS,QAAQ,KAAS;IACrD,IAAM,IAAS,EAAS,MAAM,GAAG,CAAK,CAAC,CAAC,KAAK,GAAG;IAChD,EAAU,IAAI,GAAQ,EAAI;IAS1B,IAAM,IAAM,EAAO,YAAY,GAAG;IAElC,AAAI,MAAQ,MACV,EAAU,IAAI,GAAG,EAAO,MAAM,GAAG,CAAG,EAAE,IAAI,EAAO,MAAM,IAAM,CAAC,KAAK,EAAI;GAE3E;EACF;EACA;EACA;EACA,mBAAmB;GACjB,IAAI,IAAO;GAEX,OAAO;IACL,eACM,KAAmB,KAAQ,IACtB,MAGT,KAAQ,GACD;IAET,eAAqB;KACnB,IAAO,KAAK,IAAI,GAAG,IAAO,CAAC;IAC7B;GACF;EACF,EAAA,CAAG;CACL;AACF,GAQa,IAAiD,OAAO,kBAAkB,GAQ1E,KAAsB,IAA8B,EAAW,EAAE,MAA4B;CACxG,IAAM,IAAQ,EAA2B,CAAc;CAyCvD,OAvCA,QAAgB;EACd,EACE,IACC,MAAW;GACV,AAAI,KACF,EAAM,WAAW,CAAM;EAE3B,GACA,EAAE,WAAW,GAAK,CACpB;EAGA,IAAI,IAAgD,MAE9C,UAAgC;GAEpC,AADA,IAAsB,EAAM,SAAS,OACrC,EAAM,SAAS,QAAQ;EACzB,GAEM,UAA+B;GACnC,IAAI,MAAwB,MAAM;IAEhC,IAAM,IAAW;IAIjB,AAHA,EAAM,wBAAwB;KAC5B,EAAM,SAAS,QAAQ;IACzB,CAAC,GACD,IAAsB;GACxB;EACF;EAKA,AAHA,OAAO,iBAAiB,eAAe,CAAiB,GACxD,OAAO,iBAAiB,cAAc,CAAgB,GAEtD,QAAsB;GAEpB,AADA,OAAO,oBAAoB,eAAe,CAAiB,GAC3D,OAAO,oBAAoB,cAAc,CAAgB;EAC3D,CAAC;CACH,CAAC,GAEM;AACT"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Arrow-key navigation over the schema tree's disclosure toggles, behind
3
+ * `schemaKeyboardNav`. One delegated keydown per tree root, only for a
4
+ * `[data-schema-toggle]` target with no modifier held. The bindings follow the
5
+ * APG tree pattern, but nothing announces them, so Tab order must stand alone.
6
+ */
7
+ /**
8
+ * Move focus between tree toggles in response to one keydown.
9
+ *
10
+ * Bind this as a keydown listener on any element that owns tree rows — the
11
+ * schema tree itself, or the response headers group that sits beside one. The
12
+ * listener is delegated, so the element it is bound to defines the set of rows
13
+ * it navigates: `event.currentTarget` is the root, and only the toggles under
14
+ * that root are reachable.
15
+ *
16
+ * It acts only when the event target is a `[data-schema-toggle]` element and no
17
+ * modifier key is held, so typing and browser shortcuts pass through untouched.
18
+ * When it does handle a key it calls `preventDefault`, which doubles as the
19
+ * handoff between nested roots: an inner root marks the event, and any outer
20
+ * delegate the event bubbles to leaves focus where the inner one put it.
21
+ */
22
+ export declare const handleTreeKeydown: (event: KeyboardEvent) => void;
23
+ //# sourceMappingURL=schema-keyboard-nav.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-keyboard-nav.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/schema-keyboard-nav.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwBH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,aAAa,KAAG,IAsExD,CAAA"}
@@ -0,0 +1,36 @@
1
+ //#region src/schema/helpers/schema-keyboard-nav.ts
2
+ var e = (e) => [...e.querySelectorAll("[data-schema-toggle]")].filter((e) => e.offsetParent !== null && !e.closest("[hidden]")), t = (e) => e.closest(".property-children")?.closest(".property--tree")?.querySelector(":scope > [data-schema-toggle]") ?? null, n = (e) => e.closest(".property--tree")?.querySelector(":scope > .property-children [data-schema-toggle]") ?? null, r = (r) => {
3
+ let i = r.target;
4
+ if (r.defaultPrevented || !(i instanceof HTMLElement) || !i.hasAttribute("data-schema-toggle") || r.altKey || r.ctrlKey || r.metaKey || r.shiftKey) return;
5
+ let a = r.currentTarget instanceof HTMLElement ? r.currentTarget : null;
6
+ if (!a) return;
7
+ let o = e(a), s = o.indexOf(i);
8
+ if (s === -1) return;
9
+ let c = i.getAttribute("aria-expanded") === "true";
10
+ switch (r.key) {
11
+ case "ArrowDown":
12
+ o[s + 1]?.focus();
13
+ break;
14
+ case "ArrowUp":
15
+ o[s - 1]?.focus();
16
+ break;
17
+ case "ArrowRight":
18
+ c ? n(i)?.focus() : i.click();
19
+ break;
20
+ case "ArrowLeft":
21
+ c ? i.click() : t(i)?.focus();
22
+ break;
23
+ case "Home":
24
+ o[0]?.focus();
25
+ break;
26
+ case "End":
27
+ o[o.length - 1]?.focus();
28
+ break;
29
+ default: return;
30
+ }
31
+ r.preventDefault();
32
+ };
33
+ //#endregion
34
+ export { r as handleTreeKeydown };
35
+
36
+ //# sourceMappingURL=schema-keyboard-nav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-keyboard-nav.js","names":[],"sources":["../../../src/schema/helpers/schema-keyboard-nav.ts"],"sourcesContent":["/**\n * Arrow-key navigation over the schema tree's disclosure toggles, behind\n * `schemaKeyboardNav`. One delegated keydown per tree root, only for a\n * `[data-schema-toggle]` target with no modifier held. The bindings follow the\n * APG tree pattern, but nothing announces them, so Tab order must stand alone.\n */\n\n/**\n * All toggles under the root that are visible right now. `offsetParent` alone\n * is not enough: a panel kept as `hidden=\"until-found\"` retains its descendants'\n * layout boxes, so their toggles pass that test while `focus()` does nothing.\n */\nconst visibleToggles = (root: HTMLElement): HTMLElement[] =>\n [...root.querySelectorAll<HTMLElement>('[data-schema-toggle]')].filter(\n (toggle) => toggle.offsetParent !== null && !toggle.closest('[hidden]'),\n )\n\n/** The toggle of the row that owns the panel this toggle's row sits inside. */\nconst parentToggle = (toggle: HTMLElement): HTMLElement | null =>\n toggle\n .closest('.property-children')\n ?.closest('.property--tree')\n ?.querySelector<HTMLElement>(':scope > [data-schema-toggle]') ?? null\n\n/** The first toggle inside this row's own panel, when one is open. */\nconst firstChildToggle = (toggle: HTMLElement): HTMLElement | null =>\n toggle.closest('.property--tree')?.querySelector<HTMLElement>(':scope > .property-children [data-schema-toggle]') ??\n null\n\n/**\n * Move focus between tree toggles in response to one keydown.\n *\n * Bind this as a keydown listener on any element that owns tree rows — the\n * schema tree itself, or the response headers group that sits beside one. The\n * listener is delegated, so the element it is bound to defines the set of rows\n * it navigates: `event.currentTarget` is the root, and only the toggles under\n * that root are reachable.\n *\n * It acts only when the event target is a `[data-schema-toggle]` element and no\n * modifier key is held, so typing and browser shortcuts pass through untouched.\n * When it does handle a key it calls `preventDefault`, which doubles as the\n * handoff between nested roots: an inner root marks the event, and any outer\n * delegate the event bubbles to leaves focus where the inner one put it.\n */\nexport const handleTreeKeydown = (event: KeyboardEvent): void => {\n const target = event.target\n\n if (\n // A nested tree root already moved focus for this key; the event keeps\n // bubbling to any outer delegate, which must not move it a second time.\n event.defaultPrevented ||\n !(target instanceof HTMLElement) ||\n !target.hasAttribute('data-schema-toggle') ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.shiftKey\n ) {\n return\n }\n\n /*\n * The root is whatever element the listener was bound to, so any surface that\n * owns tree rows can delegate here — the schema tree itself, and the response\n * headers group, which sits beside a tree rather than inside one.\n */\n const root = event.currentTarget instanceof HTMLElement ? event.currentTarget : null\n\n if (!root) {\n return\n }\n\n const toggles = visibleToggles(root)\n const index = toggles.indexOf(target)\n\n if (index === -1) {\n return\n }\n\n const isExpanded = target.getAttribute('aria-expanded') === 'true'\n\n switch (event.key) {\n case 'ArrowDown':\n toggles[index + 1]?.focus()\n break\n case 'ArrowUp':\n toggles[index - 1]?.focus()\n break\n case 'ArrowRight':\n if (!isExpanded) {\n target.click()\n } else {\n // Expanded with only leaf children — the majority case — is a no-op.\n firstChildToggle(target)?.focus()\n }\n break\n case 'ArrowLeft':\n if (isExpanded) {\n target.click()\n } else {\n parentToggle(target)?.focus()\n }\n break\n case 'Home':\n toggles[0]?.focus()\n break\n case 'End':\n toggles[toggles.length - 1]?.focus()\n break\n default:\n return\n }\n\n event.preventDefault()\n}\n"],"mappings":";AAYA,IAAM,KAAkB,MACtB,CAAC,GAAG,EAAK,iBAA8B,sBAAsB,CAAC,CAAC,CAAC,QAC7D,MAAW,EAAO,iBAAiB,QAAQ,CAAC,EAAO,QAAQ,UAAU,CACxE,GAGI,KAAgB,MACpB,EACG,QAAQ,oBAAoB,CAAC,EAC5B,QAAQ,iBAAiB,CAAC,EAC1B,cAA2B,+BAA+B,KAAK,MAG/D,KAAoB,MACxB,EAAO,QAAQ,iBAAiB,CAAC,EAAE,cAA2B,kDAAkD,KAChH,MAiBW,KAAqB,MAA+B;CAC/D,IAAM,IAAS,EAAM;CAErB,IAGE,EAAM,oBACN,EAAE,aAAkB,gBACpB,CAAC,EAAO,aAAa,oBAAoB,KACzC,EAAM,UACN,EAAM,WACN,EAAM,WACN,EAAM,UAEN;CAQF,IAAM,IAAO,EAAM,yBAAyB,cAAc,EAAM,gBAAgB;CAEhF,IAAI,CAAC,GACH;CAGF,IAAM,IAAU,EAAe,CAAI,GAC7B,IAAQ,EAAQ,QAAQ,CAAM;CAEpC,IAAI,MAAU,IACZ;CAGF,IAAM,IAAa,EAAO,aAAa,eAAe,MAAM;CAE5D,QAAQ,EAAM,KAAd;EACE,KAAK;GACH,EAAQ,IAAQ,EAAE,EAAE,MAAM;GAC1B;EACF,KAAK;GACH,EAAQ,IAAQ,EAAE,EAAE,MAAM;GAC1B;EACF,KAAK;GACH,AAAK,IAIH,EAAiB,CAAM,CAAC,EAAE,MAAM,IAHhC,EAAO,MAAM;GAKf;EACF,KAAK;GACH,AAAI,IACF,EAAO,MAAM,IAEb,EAAa,CAAM,CAAC,EAAE,MAAM;GAE9B;EACF,KAAK;GACH,EAAQ,EAAE,EAAE,MAAM;GAClB;EACF,KAAK;GACH,EAAQ,EAAQ,SAAS,EAAE,EAAE,MAAM;GACnC;EACF,SACE;CACJ;CAEA,EAAM,eAAe;AACvB"}
@@ -0,0 +1,27 @@
1
+ import type { SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
+ type SchemaModelName = {
3
+ /**
4
+ * The key in `components.schemas` (extracted from `$ref`), used for sidebar
5
+ * navigation. Only set when the `$ref` actually targets
6
+ * `#/components/schemas/`; `null` for refs into other component buckets or
7
+ * external files, so those never render a dead link.
8
+ */
9
+ schemaKey: string | null;
10
+ /** The human-readable name to display (schema.title, schema.name, or ref key). */
11
+ label: string;
12
+ };
13
+ /**
14
+ * Extract schema name from various schema formats
15
+ *
16
+ * Handles $ref, title, name, type, and schema dictionary lookup
17
+ */
18
+ export declare const getModelNameFromSchema: (schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>) => SchemaModelName | null;
19
+ /**
20
+ * Model name for a schema, resolving array branches too: an inline
21
+ * `{ type: 'array', items: { $ref: Model } }` becomes `Model[]` instead of the
22
+ * structural `array object[]`. Returns `null` when no model name applies (for
23
+ * example an array of primitives), so callers can fall back to `getSchemaType`.
24
+ */
25
+ export declare const getModelNameWithArray: (schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>) => SchemaModelName | null;
26
+ export {};
27
+ //# sourceMappingURL=schema-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/schema-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;AAKrH,KAAK,eAAe,GAAG;IACrB;;;;;OAKG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAC,KAC5D,eAAe,GAAG,IA4BpB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAChC,aAAa,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAC,KAC5D,eAAe,GAAG,IAepB,CAAA"}
@@ -0,0 +1,40 @@
1
+ import { getRefName as e, getSchemaRefName as t } from "./get-ref-name.js";
2
+ import { resolve as n } from "@scalar/workspace-store/resolve";
3
+ import { isArraySchema as r } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
4
+ //#region src/schema/helpers/schema-name.ts
5
+ var i = (r) => {
6
+ if (!r) return null;
7
+ let i = n.schema(r), a = "$ref" in r ? t(r.$ref) : null;
8
+ if (i.title) return {
9
+ schemaKey: a,
10
+ label: i.title
11
+ };
12
+ if (i.name) return {
13
+ schemaKey: a,
14
+ label: i.name
15
+ };
16
+ if ("$ref" in r) {
17
+ let t = e(r.$ref);
18
+ if (t) return {
19
+ schemaKey: a,
20
+ label: t
21
+ };
22
+ }
23
+ return null;
24
+ }, a = (e) => {
25
+ let t = i(e);
26
+ if (t) return t;
27
+ let a = n.schema(e);
28
+ if (r(a) && a.items) {
29
+ let e = i(a.items);
30
+ if (e) return {
31
+ schemaKey: e.schemaKey,
32
+ label: `${e.label}[]`
33
+ };
34
+ }
35
+ return null;
36
+ };
37
+ //#endregion
38
+ export { i as getModelNameFromSchema, a as getModelNameWithArray };
39
+
40
+ //# sourceMappingURL=schema-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-name.js","names":[],"sources":["../../../src/schema/helpers/schema-name.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject, SchemaReferenceType } 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, getSchemaRefName } from './get-ref-name'\n\ntype SchemaModelName = {\n /**\n * The key in `components.schemas` (extracted from `$ref`), used for sidebar\n * navigation. Only set when the `$ref` actually targets\n * `#/components/schemas/`; `null` for refs into other component buckets or\n * external files, so those never render a dead link.\n */\n schemaKey: string | null\n /** The human-readable name to display (schema.title, schema.name, or ref key). */\n label: string\n}\n\n/**\n * Extract schema name from various schema formats\n *\n * Handles $ref, title, name, type, and schema dictionary lookup\n */\nexport const getModelNameFromSchema = (\n schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>,\n): SchemaModelName | null => {\n if (!schemaOrRef) {\n return null\n }\n\n const schema = resolve.schema(schemaOrRef)\n\n // Only refs into `#/components/schemas/` are navigable in the models section.\n const schemaKey = '$ref' in schemaOrRef ? getSchemaRefName(schemaOrRef.$ref) : null\n\n if (schema.title) {\n return { schemaKey, label: schema.title }\n }\n\n if (schema.name) {\n return { schemaKey, label: schema.name }\n }\n\n if ('$ref' in schemaOrRef) {\n // Fall back to the last ref segment as a display label, even for\n // non-schema refs. The name still shows, it just is not a link.\n const label = getRefName(schemaOrRef.$ref)\n if (label) {\n return { schemaKey, label }\n }\n }\n\n return null\n}\n\n/**\n * Model name for a schema, resolving array branches too: an inline\n * `{ type: 'array', items: { $ref: Model } }` becomes `Model[]` instead of the\n * structural `array object[]`. Returns `null` when no model name applies (for\n * example an array of primitives), so callers can fall back to `getSchemaType`.\n */\nexport const getModelNameWithArray = (\n schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>,\n): SchemaModelName | null => {\n const direct = getModelNameFromSchema(schemaOrRef)\n if (direct) {\n return direct\n }\n\n const schema = resolve.schema(schemaOrRef)\n if (isArraySchema(schema) && schema.items) {\n const itemName = getModelNameFromSchema(schema.items)\n if (itemName) {\n return { schemaKey: itemName.schemaKey, label: `${itemName.label}[]` }\n }\n }\n\n return null\n}\n"],"mappings":";;;;AAuBA,IAAa,KACX,MAC2B;CAC3B,IAAI,CAAC,GACH,OAAO;CAGT,IAAM,IAAS,EAAQ,OAAO,CAAW,GAGnC,IAAY,UAAU,IAAc,EAAiB,EAAY,IAAI,IAAI;CAE/E,IAAI,EAAO,OACT,OAAO;EAAE;EAAW,OAAO,EAAO;CAAM;CAG1C,IAAI,EAAO,MACT,OAAO;EAAE;EAAW,OAAO,EAAO;CAAK;CAGzC,IAAI,UAAU,GAAa;EAGzB,IAAM,IAAQ,EAAW,EAAY,IAAI;EACzC,IAAI,GACF,OAAO;GAAE;GAAW;EAAM;CAE9B;CAEA,OAAO;AACT,GAQa,KACX,MAC2B;CAC3B,IAAM,IAAS,EAAuB,CAAW;CACjD,IAAI,GACF,OAAO;CAGT,IAAM,IAAS,EAAQ,OAAO,CAAW;CACzC,IAAI,EAAc,CAAM,KAAK,EAAO,OAAO;EACzC,IAAM,IAAW,EAAuB,EAAO,KAAK;EACpD,IAAI,GACF,OAAO;GAAE,WAAW,EAAS;GAAW,OAAO,GAAG,EAAS,MAAM;EAAI;CAEzE;CAEA,OAAO;AACT"}
@@ -0,0 +1,10 @@
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
+ /**
3
+ * Determine if description should be displayed
4
+ *
5
+ * @param schema - The schema object to check
6
+ * @param propDescription - Optional description from props
7
+ * @returns Description string to display, or null if should not be displayed
8
+ */
9
+ export declare const shouldDisplayDescription: (schema: SchemaObject | undefined, propDescription?: string) => string | null;
10
+ //# sourceMappingURL=should-display-description.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"should-display-description.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/should-display-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAEhG;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,QAAQ,YAAY,GAAG,SAAS,EAAE,kBAAkB,MAAM,KAAG,MAAM,GAAG,IAmB9G,CAAA"}
@@ -0,0 +1,6 @@
1
+ //#region src/schema/helpers/should-display-description.ts
2
+ var e = (e, t) => !e || e.allOf ? null : t && e.description ? t === e.description ? t : `${t}\n\n${e.description}` : t || e.description || null;
3
+ //#endregion
4
+ export { e as shouldDisplayDescription };
5
+
6
+ //# sourceMappingURL=should-display-description.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"should-display-description.js","names":[],"sources":["../../../src/schema/helpers/should-display-description.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\n/**\n * Determine if description should be displayed\n *\n * @param schema - The schema object to check\n * @param propDescription - Optional description from props\n * @returns Description string to display, or null if should not be displayed\n */\nexport const shouldDisplayDescription = (schema: SchemaObject | undefined, propDescription?: string): string | null => {\n if (!schema) {\n return null\n }\n\n // Don't show description for schemas with compositions to avoid duplicate descriptions\n if (schema.allOf) {\n return null\n }\n\n // When both an external description (e.g. a response or parameter description) and the\n // schema's own description are present, show both so neither is lost. This matters for\n // responses with multiple content types where each media type schema carries its own\n // description (see expandAllResponses). Identical descriptions are shown only once.\n if (propDescription && schema.description) {\n return propDescription === schema.description ? propDescription : `${propDescription}\\n\\n${schema.description}`\n }\n\n return propDescription || schema.description || null\n}\n"],"mappings":";AASA,IAAa,KAA4B,GAAkC,MACrE,CAAC,KAKD,EAAO,QACF,OAOL,KAAmB,EAAO,cACrB,MAAoB,EAAO,cAAc,IAAkB,GAAG,EAAgB,MAAM,EAAO,gBAG7F,KAAmB,EAAO,eAAe"}
@@ -0,0 +1,11 @@
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
+ /**
3
+ * Determine if property heading should be displayed
4
+ *
5
+ * @param schema - The schema object to check
6
+ * @param name - Optional property name
7
+ * @param required - Whether the property is required
8
+ * @returns true if heading should be displayed, false otherwise
9
+ */
10
+ export declare const shouldDisplayHeading: (schema: SchemaObject | undefined, name?: string, required?: boolean) => boolean;
11
+ //# sourceMappingURL=should-display-heading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"should-display-heading.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/should-display-heading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAEhG;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,YAAY,GAAG,SAAS,EAAE,OAAO,MAAM,EAAE,kBAAgB,KAAG,OAqBxG,CAAA"}
@@ -0,0 +1,6 @@
1
+ //#region src/schema/helpers/should-display-heading.ts
2
+ var e = (e, t, n = !1) => t || n ? !0 : e ? e.deprecated === !0 || e.const !== void 0 || e.enum?.length === 1 || "type" in e && e.type !== void 0 || "nullable" in e && e.nullable === !0 || e.writeOnly === !0 || e.readOnly === !0 : !1;
3
+ //#endregion
4
+ export { e as shouldDisplayHeading };
5
+
6
+ //# sourceMappingURL=should-display-heading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"should-display-heading.js","names":[],"sources":["../../../src/schema/helpers/should-display-heading.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\n/**\n * Determine if property heading should be displayed\n *\n * @param schema - The schema object to check\n * @param name - Optional property name\n * @param required - Whether the property is required\n * @returns true if heading should be displayed, false otherwise\n */\nexport const shouldDisplayHeading = (schema: SchemaObject | undefined, name?: string, required = false): boolean => {\n // Early return for simple cases\n if (name || required) {\n return true\n }\n\n // If schema is undefined, return false\n if (!schema) {\n return false\n }\n\n // Check schema properties that warrant a heading\n return (\n schema.deprecated === true ||\n schema.const !== undefined ||\n schema.enum?.length === 1 ||\n ('type' in schema && schema.type !== undefined) ||\n ('nullable' in schema && schema.nullable === true) ||\n schema.writeOnly === true ||\n schema.readOnly === true\n )\n}\n"],"mappings":";AAUA,IAAa,KAAwB,GAAkC,GAAe,IAAW,OAE3F,KAAQ,IACH,KAIJ,IAMH,EAAO,eAAe,MACtB,EAAO,UAAU,KAAA,KACjB,EAAO,MAAM,WAAW,KACvB,UAAU,KAAU,EAAO,SAAS,KAAA,KACpC,cAAc,KAAU,EAAO,aAAa,MAC7C,EAAO,cAAc,MACrB,EAAO,aAAa,KAXb"}
@@ -0,0 +1,10 @@
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
+ /**
3
+ * Check if array item composition should be rendered
4
+ *
5
+ * @param schema - The schema object to check
6
+ * @param composition - The composition keyword to check for
7
+ * @returns true if array item composition should be rendered, false otherwise
8
+ */
9
+ export declare const shouldRenderArrayItemComposition: (schema: SchemaObject | undefined, composition: string) => boolean;
10
+ //# sourceMappingURL=should-render-array-item-composition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"should-render-array-item-composition.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/should-render-array-item-composition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAKhG;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,GAAI,QAAQ,YAAY,GAAG,SAAS,EAAE,aAAa,MAAM,KAAG,OAcxG,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { hasComplexArrayItems as e } from "./has-complex-array-items.js";
2
+ import { isArraySchema as t } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
3
+ //#region src/schema/helpers/should-render-array-item-composition.ts
4
+ var n = (n, r) => {
5
+ if (!n || !t(n)) return !1;
6
+ let i = n.items;
7
+ return !i || typeof i != "object" || !(r in i) ? !1 : !e(n);
8
+ };
9
+ //#endregion
10
+ export { n as shouldRenderArrayItemComposition };
11
+
12
+ //# sourceMappingURL=should-render-array-item-composition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"should-render-array-item-composition.js","names":[],"sources":["../../../src/schema/helpers/should-render-array-item-composition.ts"],"sourcesContent":["import 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\nimport { hasComplexArrayItems } from './has-complex-array-items'\n\n/**\n * Check if array item composition should be rendered\n *\n * @param schema - The schema object to check\n * @param composition - The composition keyword to check for\n * @returns true if array item composition should be rendered, false otherwise\n */\nexport const shouldRenderArrayItemComposition = (schema: SchemaObject | undefined, composition: string): boolean => {\n // Early return if schema is invalid or not an array\n if (!schema || !isArraySchema(schema)) {\n return false\n }\n\n // Check if items exist and have the composition keyword\n const items = schema.items\n if (!items || typeof items !== 'object' || !(composition in items)) {\n return false\n }\n\n // Only render if items are not complex (complex items are handled differently)\n return !hasComplexArrayItems(schema)\n}\n"],"mappings":";;;AAYA,IAAa,KAAoC,GAAkC,MAAiC;CAElH,IAAI,CAAC,KAAU,CAAC,EAAc,CAAM,GAClC,OAAO;CAIT,IAAM,IAAQ,EAAO;CAMrB,OALI,CAAC,KAAS,OAAO,KAAU,YAAY,EAAE,KAAe,KACnD,KAIF,CAAC,EAAqB,CAAM;AACrC"}
@@ -0,0 +1,23 @@
1
+ import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
2
+ import type { DiscriminatorObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
3
+ /** Extract the type of properties */
4
+ type Properties = NonNullable<Extract<SchemaObject, {
5
+ type: 'object';
6
+ }>['properties']>;
7
+ type Options = Partial<Pick<ApiReferenceConfiguration, 'orderSchemaPropertiesBy' | 'orderRequiredPropertiesFirst'> & {
8
+ hideReadOnly: boolean;
9
+ hideWriteOnly: boolean;
10
+ }>;
11
+ /** Take a list of property names and reduce it back into an object */
12
+ export declare const reduceNamesToObject: (names: string[], properties: Properties) => Properties;
13
+ /**
14
+ * Sort property names in an object schema.
15
+ *
16
+ * The returned array is shared with later calls for the same schema and options,
17
+ * so it is frozen: an in-place `sort` / `reverse` / `splice` by one caller would
18
+ * otherwise silently reorder every other consumer of the same schema. Callers
19
+ * that need a mutable list copy it first (`slice`).
20
+ */
21
+ export declare const sortPropertyNames: (schema: SchemaObject, discriminator?: DiscriminatorObject, { hideReadOnly, hideWriteOnly, orderSchemaPropertiesBy, orderRequiredPropertiesFirst, }?: Options) => readonly string[];
22
+ export {};
23
+ //# sourceMappingURL=sort-property-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort-property-names.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/sort-property-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAE5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAIrH,qCAAqC;AACrC,KAAK,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAA;AAEtF,KAAK,OAAO,GAAG,OAAO,CACpB,IAAI,CAAC,yBAAyB,EAAE,yBAAyB,GAAG,8BAA8B,CAAC,GAAG;IAC5F,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,EAAE,OAAO,CAAA;CACvB,CACF,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,EAAE,EAAE,YAAY,UAAU,KAAG,UAOtE,CAAA;AAuDR;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,YAAY,EACpB,gBAAgB,mBAAmB,EACnC,0FAKG,OAAY,KACd,SAAS,MAAM,EAuHjB,CAAA"}
@@ -0,0 +1,55 @@
1
+ import { isTypeObject as e } from "./is-type-object.js";
2
+ import { resolve as t } from "@scalar/workspace-store/resolve";
3
+ //#region src/schema/helpers/sort-property-names.ts
4
+ var n = (e, t) => e.reduce((e, n) => {
5
+ let r = t?.[n];
6
+ return r && (e[n] = r), e;
7
+ }, {}), r = new Intl.Collator(void 0), i = /* @__PURE__ */ new WeakMap(), a = Object.freeze([]), o = (n, o, { hideReadOnly: s = !1, hideWriteOnly: c = !1, orderSchemaPropertiesBy: l = "alpha", orderRequiredPropertiesFirst: u = !0 } = {}) => {
8
+ if (!e(n) || !n.properties) return a;
9
+ let d = n.properties, f = n.required, p = o?.propertyName, m = [
10
+ p === void 0 ? "" : `!${p}`,
11
+ s,
12
+ c,
13
+ l,
14
+ u
15
+ ].join("|"), h = i.get(d), g = h?.get(m);
16
+ if (g && g.required === f) return g.names;
17
+ let _ = new Set(f || []), v = s || c, y = [];
18
+ for (let e of Object.keys(d)) {
19
+ let n = d[e];
20
+ if (v) {
21
+ let e = t.schema(n);
22
+ if (s && e?.readOnly === !0 || c && e?.writeOnly === !0) continue;
23
+ }
24
+ y.push({
25
+ name: e,
26
+ order: n && typeof n == "object" && "x-order" in n ? n["x-order"] : void 0,
27
+ required: _.has(e),
28
+ discriminator: e === p
29
+ });
30
+ }
31
+ y.sort((e, t) => {
32
+ if (e.discriminator && !t.discriminator) return -1;
33
+ if (!e.discriminator && t.discriminator) return 1;
34
+ if (e.order !== void 0 && t.order !== void 0) return Number(e.order) - Number(t.order);
35
+ if (e.order !== void 0 && t.order === void 0) return -1;
36
+ if (e.order === void 0 && t.order !== void 0) return 1;
37
+ if (u) {
38
+ if (e.required && !t.required) return -1;
39
+ if (!e.required && t.required) return 1;
40
+ }
41
+ return l === "alpha" ? r.compare(e.name, t.name) : 0;
42
+ });
43
+ let b = Object.freeze(y.map((e) => e.name));
44
+ return typeof d == "object" && d && (h ? h.set(m, {
45
+ required: f,
46
+ names: b
47
+ }) : i.set(d, /* @__PURE__ */ new Map([[m, {
48
+ required: f,
49
+ names: b
50
+ }]]))), b;
51
+ };
52
+ //#endregion
53
+ export { n as reduceNamesToObject, o as sortPropertyNames };
54
+
55
+ //# sourceMappingURL=sort-property-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort-property-names.js","names":[],"sources":["../../../src/schema/helpers/sort-property-names.ts"],"sourcesContent":["import type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { DiscriminatorObject, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport { isTypeObject } from './is-type-object'\n\n/** Extract the type of properties */\ntype Properties = NonNullable<Extract<SchemaObject, { type: 'object' }>['properties']>\n\ntype Options = Partial<\n Pick<ApiReferenceConfiguration, 'orderSchemaPropertiesBy' | 'orderRequiredPropertiesFirst'> & {\n hideReadOnly: boolean\n hideWriteOnly: boolean\n }\n>\n\n/** Take a list of property names and reduce it back into an object */\nexport const reduceNamesToObject = (names: string[], properties: Properties): Properties =>\n names.reduce<Properties>((acc, name) => {\n const prop = properties?.[name]\n if (prop) {\n acc[name] = prop\n }\n return acc\n }, {})\n\n/**\n * One collator for every sort, rather than a fresh locale lookup per comparison.\n * `String.localeCompare` builds its collator on each call, which dominates the\n * comparator on schemas with many properties; `Intl.Collator` is the same\n * ordering with the setup hoisted out of the loop.\n */\nconst collator = new Intl.Collator(undefined)\n\n/**\n * Everything the comparator needs to know about one property, read once.\n *\n * The comparator used to fetch `schema.properties[name]` and probe it for\n * `x-order` on every comparison. In the app the document is a stack of proxies\n * (reactive, change detection, overrides, `$ref` magic), so each of those reads\n * costs microseconds and a sort makes `n log n` of them: a 60-property object\n * took milliseconds per sort. With the inputs hoisted the comparator only reads\n * plain fields. It makes the same decisions in the same order on the same\n * values, and `Array.prototype.sort` is stable, so the result is identical.\n */\ntype PropertyRecord = {\n name: string\n /** The `x-order` extension value, `undefined` when the property does not carry one */\n order: unknown\n required: boolean\n discriminator: boolean\n}\n\n/**\n * Sorted names, memoised per `properties` object.\n *\n * A row sorts its children while it is collapsed (for the preview) and again\n * when it opens (for the panel), and every row that `$ref`s the same schema\n * sorts the same `properties` object over again. That object's identity\n * survives each copy on the render path (the display-time spreads keep the\n * reference, and every proxy layer caches its child proxies per target), so it\n * is a stable key, and a `WeakMap` lets the entries die with the document.\n *\n * An entry is valid only while `schema.required` is the same array: the\n * composition path builds a fresh `properties` AND a fresh `required` when it\n * merges variants, so a merged schema never hits a stale entry. Every option\n * that affects the order is part of the inner key. Nothing else the sort reads\n * changes while a document is rendered: api-reference never rewrites a schema\n * subtree in place, it swaps whole documents.\n */\ntype SortCacheEntry = {\n required: unknown\n names: readonly string[]\n}\nconst sortCache = new WeakMap<object, Map<string, SortCacheEntry>>()\n\n/** The one array every \"nothing to sort\" answer returns, frozen like the sorted ones. */\nconst EMPTY_NAMES: readonly string[] = Object.freeze([])\n\n/**\n * Sort property names in an object schema.\n *\n * The returned array is shared with later calls for the same schema and options,\n * so it is frozen: an in-place `sort` / `reverse` / `splice` by one caller would\n * otherwise silently reorder every other consumer of the same schema. Callers\n * that need a mutable list copy it first (`slice`).\n */\nexport const sortPropertyNames = (\n schema: SchemaObject,\n discriminator?: DiscriminatorObject,\n {\n hideReadOnly = false,\n hideWriteOnly = false,\n orderSchemaPropertiesBy = 'alpha',\n orderRequiredPropertiesFirst = true,\n }: Options = {},\n): readonly string[] => {\n if (!isTypeObject(schema) || !schema.properties) {\n return EMPTY_NAMES\n }\n\n const properties = schema.properties\n const required = schema.required\n const discriminatorName = discriminator?.propertyName\n\n // A `!` marks a present discriminator so an absent one can never collide with\n // a property literally named like the placeholder.\n const cacheKey = [\n discriminatorName === undefined ? '' : `!${discriminatorName}`,\n hideReadOnly,\n hideWriteOnly,\n orderSchemaPropertiesBy,\n orderRequiredPropertiesFirst,\n ].join('|')\n\n const bucket = sortCache.get(properties)\n const cached = bucket?.get(cacheKey)\n if (cached && cached.required === required) {\n return cached.names\n }\n\n const requiredPropertiesSet = new Set(required || [])\n\n /*\n * Filter BEFORE sorting, and only when something is actually hidden.\n *\n * The filter resolves every property through `resolve.schema` to read\n * `readOnly`/`writeOnly`; with neither flag set that is a full resolve pass\n * per schema whose result is always \"keep\". Skipping it there, and shrinking\n * the array the comparator runs over when it does apply, leaves the ordering\n * identical — the filter is order-preserving and independent of the compare.\n * It shares the single read of each property with the record below.\n */\n const shouldFilter = hideReadOnly || hideWriteOnly\n const records: PropertyRecord[] = []\n\n for (const name of Object.keys(properties)) {\n const propertySchema = properties[name]\n\n if (shouldFilter) {\n const resolved = resolve.schema(propertySchema)\n\n if (hideReadOnly && resolved?.readOnly === true) {\n continue\n }\n if (hideWriteOnly && resolved?.writeOnly === true) {\n continue\n }\n }\n\n records.push({\n name,\n order:\n propertySchema && typeof propertySchema === 'object' && 'x-order' in propertySchema\n ? propertySchema['x-order']\n : undefined,\n required: requiredPropertiesSet.has(name),\n discriminator: name === discriminatorName,\n })\n }\n\n records.sort((a, b) => {\n // Discriminator comes first always\n if (a.discriminator && !b.discriminator) {\n return -1\n }\n if (!a.discriminator && b.discriminator) {\n return 1\n }\n\n // Sort by x-order specification extension when present\n if (a.order !== undefined && b.order !== undefined) {\n return Number(a.order) - Number(b.order)\n }\n if (a.order !== undefined && b.order === undefined) {\n return -1\n }\n if (a.order === undefined && b.order !== undefined) {\n return 1\n }\n\n // Order required properties first\n if (orderRequiredPropertiesFirst) {\n // If one is required and the other isn't, required comes first\n if (a.required && !b.required) {\n return -1\n }\n if (!a.required && b.required) {\n return 1\n }\n }\n\n // If both have the same required status, sort alphabetically\n if (orderSchemaPropertiesBy === 'alpha') {\n return collator.compare(a.name, b.name)\n }\n\n return 0\n })\n\n // Frozen before it is shared, so a caller that sorts or splices it in place\n // fails loudly here instead of corrupting every other reader of this schema.\n const names = Object.freeze(records.map((record) => record.name))\n\n // A malformed document can carry a non-object `properties`; that cannot key\n // a WeakMap, so it simply goes uncached.\n if (typeof properties === 'object' && properties !== null) {\n if (bucket) {\n bucket.set(cacheKey, { required, names })\n } else {\n sortCache.set(properties, new Map([[cacheKey, { required, names }]]))\n }\n }\n\n return names\n}\n"],"mappings":";;;AAiBA,IAAa,KAAuB,GAAiB,MACnD,EAAM,QAAoB,GAAK,MAAS;CACtC,IAAM,IAAO,IAAa;CAI1B,OAHI,MACF,EAAI,KAAQ,IAEP;AACT,GAAG,CAAC,CAAC,GAQD,IAAW,IAAI,KAAK,SAAS,KAAA,CAAS,GA0CtC,oBAAY,IAAI,QAA6C,GAG7D,IAAiC,OAAO,OAAO,CAAC,CAAC,GAU1C,KACX,GACA,GACA,EACE,kBAAe,IACf,mBAAgB,IAChB,6BAA0B,SAC1B,kCAA+B,OACpB,CAAC,MACQ;CACtB,IAAI,CAAC,EAAa,CAAM,KAAK,CAAC,EAAO,YACnC,OAAO;CAGT,IAAM,IAAa,EAAO,YACpB,IAAW,EAAO,UAClB,IAAoB,GAAe,cAInC,IAAW;EACf,MAAsB,KAAA,IAAY,KAAK,IAAI;EAC3C;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG,GAEJ,IAAS,EAAU,IAAI,CAAU,GACjC,IAAS,GAAQ,IAAI,CAAQ;CACnC,IAAI,KAAU,EAAO,aAAa,GAChC,OAAO,EAAO;CAGhB,IAAM,IAAwB,IAAI,IAAI,KAAY,CAAC,CAAC,GAY9C,IAAe,KAAgB,GAC/B,IAA4B,CAAC;CAEnC,KAAK,IAAM,KAAQ,OAAO,KAAK,CAAU,GAAG;EAC1C,IAAM,IAAiB,EAAW;EAElC,IAAI,GAAc;GAChB,IAAM,IAAW,EAAQ,OAAO,CAAc;GAK9C,IAHI,KAAgB,GAAU,aAAa,MAGvC,KAAiB,GAAU,cAAc,IAC3C;EAEJ;EAEA,EAAQ,KAAK;GACX;GACA,OACE,KAAkB,OAAO,KAAmB,YAAY,aAAa,IACjE,EAAe,aACf,KAAA;GACN,UAAU,EAAsB,IAAI,CAAI;GACxC,eAAe,MAAS;EAC1B,CAAC;CACH;CAEA,EAAQ,MAAM,GAAG,MAAM;EAErB,IAAI,EAAE,iBAAiB,CAAC,EAAE,eACxB,OAAO;EAET,IAAI,CAAC,EAAE,iBAAiB,EAAE,eACxB,OAAO;EAIT,IAAI,EAAE,UAAU,KAAA,KAAa,EAAE,UAAU,KAAA,GACvC,OAAO,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,KAAK;EAEzC,IAAI,EAAE,UAAU,KAAA,KAAa,EAAE,UAAU,KAAA,GACvC,OAAO;EAET,IAAI,EAAE,UAAU,KAAA,KAAa,EAAE,UAAU,KAAA,GACvC,OAAO;EAIT,IAAI,GAA8B;GAEhC,IAAI,EAAE,YAAY,CAAC,EAAE,UACnB,OAAO;GAET,IAAI,CAAC,EAAE,YAAY,EAAE,UACnB,OAAO;EAEX;EAOA,OAJI,MAA4B,UACvB,EAAS,QAAQ,EAAE,MAAM,EAAE,IAAI,IAGjC;CACT,CAAC;CAID,IAAM,IAAQ,OAAO,OAAO,EAAQ,KAAK,MAAW,EAAO,IAAI,CAAC;CAYhE,OARI,OAAO,KAAe,YAAY,MAChC,IACF,EAAO,IAAI,GAAU;EAAE;EAAU;CAAM,CAAC,IAExC,EAAU,IAAI,mBAAY,IAAI,IAAI,CAAC,CAAC,GAAU;EAAE;EAAU;CAAM,CAAC,CAAC,CAAC,CAAC,IAIjE;AACT"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Peel the two write-oriented layers off a workspace value so the schema tree reads it
3
+ * through the magic and overrides proxies only.
4
+ *
5
+ * In the app a document sits under four proxies: Vue's `reactive` wraps a detect-changes
6
+ * proxy (see `createWorkspaceStore`), which wraps `createOverridesProxy(createMagicProxy(raw))`.
7
+ * Rendering a schema is read-only, but every property access still pays for all four: the
8
+ * reactive layer tracks a dependency and lazily wraps the child, and the detect-changes `get`
9
+ * allocates a fresh `{ ...args, path: [...args.path, prop] }` for every object-valued read.
10
+ * Together they make a nested read roughly sixteen times more expensive than the same read
11
+ * through the magic layer alone.
12
+ *
13
+ * Only the outer two layers are removed. The magic layer must stay, because every resolver in
14
+ * this directory reads the virtual `$ref-value` property it synthesises, and the overrides
15
+ * layer must stay so `x-scalar-*` overrides keep resolving. That rules out the store's own
16
+ * `getRaw` / `unpackProxyObject` helpers (they strip the magic layer, and `unpackProxyObject`
17
+ * writes unpacked children back onto the raw document) as well as `markRaw` (it would write
18
+ * `__v_skip` through the detect-changes set hooks).
19
+ *
20
+ * What this gives up is Vue dependency tracking on reads *inside* a schema subtree. That is
21
+ * safe here because the API reference never mutates a schema node in place: documents are
22
+ * added or replaced whole and switched by name, so a `Schema` root always receives a new
23
+ * object and re-renders from the prop identity, and the in-place writes that do exist
24
+ * (`x-scalar-active-document`, `x-scalar-is-dirty`) are document-level keys no schema
25
+ * component reads.
26
+ *
27
+ * That invariant is the precondition, so here is what would break it. Anything that fills an
28
+ * existing schema node in place, rather than handing the tree a new object, becomes invisible
29
+ * to every component below a `Schema` root and the stale subtree stays on screen:
30
+ *
31
+ * - `store.resolve(path)` in `@scalar/workspace-store` (see `client.ts`) bundles lazily and
32
+ * populates the node already at `path`. The API reference does not call it today. Wiring up
33
+ * lazy `$ref` bundling means this unwrap has to go, or the resolved subtree has to arrive as
34
+ * a new object the `Schema` prop can be swapped to.
35
+ * - `merge-all-of-schemas.ts` reaches one in-place write of its own: when a merged `items` was
36
+ * itself taken from the document (`result.items = items`), a later pass `Object.assign`s onto
37
+ * that document node. It is idempotent and runs while the same render is still computing, so
38
+ * nothing re-reads it afterwards, but it is the shape to watch for.
39
+ *
40
+ * There is deliberately no runtime guard. Catching these writes would mean proxying the whole
41
+ * subtree again — the exact per-read cost this removes — and the writes above happen on nodes
42
+ * reached through `resolve.schema`, not through the value returned here, so a shallow proxy on
43
+ * the root would catch none of them.
44
+ *
45
+ * Idempotent: a plain object (unit tests, stories, static documents) is returned unchanged.
46
+ */
47
+ export declare const unwrapForRead: <T>(value: T) => T;
48
+ //# sourceMappingURL=unwrap-for-read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unwrap-for-read.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/unwrap-for-read.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,OAAO,CAAC,KAAG,CAA2C,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { toRaw as e } from "vue";
2
+ import { unpackDetectChangesProxy as t } from "@scalar/workspace-store/helpers/detect-changes-proxy";
3
+ //#region src/schema/helpers/unwrap-for-read.ts
4
+ var n = (n) => t(e(n));
5
+ //#endregion
6
+ export { n as unwrapForRead };
7
+
8
+ //# sourceMappingURL=unwrap-for-read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unwrap-for-read.js","names":[],"sources":["../../../src/schema/helpers/unwrap-for-read.ts"],"sourcesContent":["import { unpackDetectChangesProxy } from '@scalar/workspace-store/helpers/detect-changes-proxy'\nimport { toRaw } from 'vue'\n\n/**\n * Peel the two write-oriented layers off a workspace value so the schema tree reads it\n * through the magic and overrides proxies only.\n *\n * In the app a document sits under four proxies: Vue's `reactive` wraps a detect-changes\n * proxy (see `createWorkspaceStore`), which wraps `createOverridesProxy(createMagicProxy(raw))`.\n * Rendering a schema is read-only, but every property access still pays for all four: the\n * reactive layer tracks a dependency and lazily wraps the child, and the detect-changes `get`\n * allocates a fresh `{ ...args, path: [...args.path, prop] }` for every object-valued read.\n * Together they make a nested read roughly sixteen times more expensive than the same read\n * through the magic layer alone.\n *\n * Only the outer two layers are removed. The magic layer must stay, because every resolver in\n * this directory reads the virtual `$ref-value` property it synthesises, and the overrides\n * layer must stay so `x-scalar-*` overrides keep resolving. That rules out the store's own\n * `getRaw` / `unpackProxyObject` helpers (they strip the magic layer, and `unpackProxyObject`\n * writes unpacked children back onto the raw document) as well as `markRaw` (it would write\n * `__v_skip` through the detect-changes set hooks).\n *\n * What this gives up is Vue dependency tracking on reads *inside* a schema subtree. That is\n * safe here because the API reference never mutates a schema node in place: documents are\n * added or replaced whole and switched by name, so a `Schema` root always receives a new\n * object and re-renders from the prop identity, and the in-place writes that do exist\n * (`x-scalar-active-document`, `x-scalar-is-dirty`) are document-level keys no schema\n * component reads.\n *\n * That invariant is the precondition, so here is what would break it. Anything that fills an\n * existing schema node in place, rather than handing the tree a new object, becomes invisible\n * to every component below a `Schema` root and the stale subtree stays on screen:\n *\n * - `store.resolve(path)` in `@scalar/workspace-store` (see `client.ts`) bundles lazily and\n * populates the node already at `path`. The API reference does not call it today. Wiring up\n * lazy `$ref` bundling means this unwrap has to go, or the resolved subtree has to arrive as\n * a new object the `Schema` prop can be swapped to.\n * - `merge-all-of-schemas.ts` reaches one in-place write of its own: when a merged `items` was\n * itself taken from the document (`result.items = items`), a later pass `Object.assign`s onto\n * that document node. It is idempotent and runs while the same render is still computing, so\n * nothing re-reads it afterwards, but it is the shape to watch for.\n *\n * There is deliberately no runtime guard. Catching these writes would mean proxying the whole\n * subtree again — the exact per-read cost this removes — and the writes above happen on nodes\n * reached through `resolve.schema`, not through the value returned here, so a shallow proxy on\n * the root would catch none of them.\n *\n * Idempotent: a plain object (unit tests, stories, static documents) is returned unchanged.\n */\nexport const unwrapForRead = <T>(value: T): T => unpackDetectChangesProxy(toRaw(value))\n"],"mappings":";;;AAiDA,IAAa,KAAoB,MAAgB,EAAyB,EAAM,CAAK,CAAC"}
@@ -0,0 +1,12 @@
1
+ export { default as LinkButton } from './LinkButton.vue';
2
+ export { schemaTranslations } from './localization/translations';
3
+ export { REQUEST_BODY_COMPOSITION_INDEX_SYMBOL, type RequestBodyCompositionSelection, } from './request-body-composition-index';
4
+ export { default as Schema } from './Schema.vue';
5
+ export { default as SchemaGlyphPuck } from './SchemaGlyphPuck.vue';
6
+ export { default as SchemaGutterToggle } from './SchemaGutterToggle.vue';
7
+ export { default as SchemaHeading } from './SchemaHeading.vue';
8
+ export { default as SchemaObjectExampleCodeBlock } from './SchemaObjectExampleCodeBlock.vue';
9
+ export { default as SchemaProperty } from './SchemaProperty.vue';
10
+ export { default as SchemaRailPanel } from './SchemaRailPanel.vue';
11
+ export type { SchemaOptions, SchemaRenderingProps } from './types';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,EACL,qCAAqC,EACrC,KAAK,+BAA+B,GACrC,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,oCAAoC,CAAA;AAC5F,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAClE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,11 @@
1
+ import e from "./LinkButton.vue.js";
2
+ import { schemaTranslations as t } from "./localization/translations.js";
3
+ import { REQUEST_BODY_COMPOSITION_INDEX_SYMBOL as n } from "./request-body-composition-index.js";
4
+ import r from "./SchemaGlyphPuck.vue.js";
5
+ import i from "./SchemaRailPanel.vue.js";
6
+ import a from "./SchemaGutterToggle.vue.js";
7
+ import o from "./SchemaProperty.vue.js";
8
+ import s from "./Schema.vue.js";
9
+ import c from "./SchemaHeading.vue.js";
10
+ import l from "./SchemaObjectExampleCodeBlock.vue.js";
11
+ export { e as LinkButton, n as REQUEST_BODY_COMPOSITION_INDEX_SYMBOL, s as Schema, r as SchemaGlyphPuck, a as SchemaGutterToggle, c as SchemaHeading, l as SchemaObjectExampleCodeBlock, o as SchemaProperty, i as SchemaRailPanel, t as schemaTranslations };
@@ -0,0 +1,59 @@
1
+ /** Schema translations inherit the host locale and custom overrides through the shared context. */
2
+ export declare const useLocalization: () => import("@scalar/localization").LocalizationContext<{
3
+ schema: {
4
+ noAllowedValues: string;
5
+ example: string;
6
+ examples: string;
7
+ default: string;
8
+ schema: string;
9
+ emptyObject: string;
10
+ showAdditionalProperties: string;
11
+ showOneMoreProperty: string;
12
+ showMoreProperties: string;
13
+ forName: string;
14
+ showSchemaDetails: string;
15
+ oneOf: string;
16
+ anyOf: string;
17
+ allOf: string;
18
+ not: string;
19
+ unknownType: string;
20
+ propertyCount: string;
21
+ headerCount: string;
22
+ recursiveReference: string;
23
+ recursive: string;
24
+ additionalProperties: string;
25
+ const: string;
26
+ deprecated: string;
27
+ discriminator: string;
28
+ enum: string;
29
+ format: string;
30
+ greaterThan: string;
31
+ keys: string;
32
+ lessThan: string;
33
+ max: string;
34
+ min: string;
35
+ maxLength: string;
36
+ minLength: string;
37
+ multipleOf: string;
38
+ nullable: string;
39
+ propertyNames: string;
40
+ pattern: string;
41
+ copyPattern: string;
42
+ readOnly: string;
43
+ required: string;
44
+ hideValues: string;
45
+ showAllValues: string;
46
+ type: string;
47
+ unique: string;
48
+ values: string;
49
+ writeOnly: string;
50
+ };
51
+ common: {
52
+ copyDefault: string;
53
+ copyExample: string;
54
+ };
55
+ actions: {
56
+ copyLinkTo: string;
57
+ };
58
+ }, ("schema.keys" | "schema.values" | "schema.example" | "schema.type" | "schema.format" | "schema.default" | "schema.enum" | "schema.const" | "schema.deprecated" | "schema.discriminator" | "schema.readOnly" | "schema.writeOnly" | "schema.examples" | "schema.allOf" | "schema.oneOf" | "schema.anyOf" | "schema.not" | "schema.multipleOf" | "schema.maxLength" | "schema.minLength" | "schema.pattern" | "schema.required" | "schema.additionalProperties" | "schema.propertyNames" | "schema.schema" | "schema.nullable" | "schema.recursive" | "schema.max" | "schema.min" | "schema.unique" | "schema.noAllowedValues" | "schema.emptyObject" | "schema.showAdditionalProperties" | "schema.showOneMoreProperty" | "schema.showMoreProperties" | "schema.forName" | "schema.showSchemaDetails" | "schema.unknownType" | "schema.propertyCount" | "schema.headerCount" | "schema.recursiveReference" | "schema.greaterThan" | "schema.lessThan" | "schema.copyPattern" | "schema.hideValues" | "schema.showAllValues") | "actions.copyLinkTo" | "common.copyDefault" | "common.copyExample">;
59
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/localization/index.ts"],"names":[],"mappings":"AAKA,mGAAmG;AACnG,eAAO,MAAQ,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qiCAW5B,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { schemaTranslations as e } from "./translations.js";
2
+ import { createLocalization as t } from "@scalar/localization";
3
+ //#region src/schema/localization/index.ts
4
+ var { useLocalization: n } = t({
5
+ localeTranslations: e,
6
+ defaultLocale: "en",
7
+ rtlLocales: /* @__PURE__ */ new Set([
8
+ "ar",
9
+ "fa",
10
+ "he",
11
+ "ur"
12
+ ]),
13
+ logPrefix: "[@scalar/blocks/schema]"
14
+ });
15
+ //#endregion
16
+ export { n as useLocalization };
17
+
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/schema/localization/index.ts"],"sourcesContent":["import { createLocalization } from '@scalar/localization'\nimport type { ApiReferenceTranslationKey } from '@scalar/types/api-reference'\n\nimport { schemaTranslations } from './translations'\n\n/** Schema translations inherit the host locale and custom overrides through the shared context. */\nexport const { useLocalization } = createLocalization<\n typeof schemaTranslations.en,\n Extract<\n ApiReferenceTranslationKey,\n `schema.${string}` | 'common.copyDefault' | 'common.copyExample' | 'actions.copyLinkTo'\n >\n>({\n localeTranslations: schemaTranslations,\n defaultLocale: 'en',\n rtlLocales: new Set(['ar', 'fa', 'he', 'ur']),\n logPrefix: '[@scalar/blocks/schema]',\n})\n"],"mappings":";;;AAMA,IAAa,EAAE,uBAAoB,EAMjC;CACA,oBAAoB;CACpB,eAAe;CACf,4BAAY,IAAI,IAAI;EAAC;EAAM;EAAM;EAAM;CAAI,CAAC;CAC5C,WAAW;AACb,CAAC"}