@scalar/blocks 0.11.2 → 0.11.4

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 (292) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/code-example/components/AsyncApiCodeExample.vue.js +111 -6
  3. package/dist/code-example/components/AsyncApiCodeExample.vue.js.map +1 -1
  4. package/dist/code-example/components/AsyncApiCodeExample3.vue.js +8 -0
  5. package/dist/code-example/components/AsyncApiCodeExample3.vue.js.map +1 -0
  6. package/dist/code-example/components/CodeExample.vue.d.ts +10 -0
  7. package/dist/code-example/components/CodeExample.vue.d.ts.map +1 -1
  8. package/dist/code-example/components/CodeExample.vue.js +297 -6
  9. package/dist/code-example/components/CodeExample.vue.js.map +1 -1
  10. package/dist/code-example/components/CodeExample3.vue.js +8 -0
  11. package/dist/code-example/components/CodeExample3.vue.js.map +1 -0
  12. package/dist/code-example/components/ExamplePicker.vue.d.ts +2 -0
  13. package/dist/code-example/components/ExamplePicker.vue.d.ts.map +1 -1
  14. package/dist/code-example/components/ExamplePicker.vue.js +50 -4
  15. package/dist/code-example/components/ExamplePicker.vue.js.map +1 -1
  16. package/dist/code-example/components/ExamplePicker2.vue.js +6 -0
  17. package/dist/code-example/components/ExamplePicker2.vue.js.map +1 -0
  18. package/dist/code-example/components/HttpMethod.vue.js +32 -4
  19. package/dist/code-example/components/HttpMethod.vue.js.map +1 -1
  20. package/dist/code-example/components/HttpMethod2.vue.js +6 -0
  21. package/dist/code-example/components/HttpMethod2.vue.js.map +1 -0
  22. package/dist/code-example/helpers/filter-clients-by-query.js.map +1 -1
  23. package/dist/code-example/helpers/find-client.js.map +1 -1
  24. package/dist/code-example/helpers/format-language.js.map +1 -1
  25. package/dist/code-example/helpers/generate-client-options.js.map +1 -1
  26. package/dist/code-example/helpers/generate-code-snippet.d.ts +8 -2
  27. package/dist/code-example/helpers/generate-code-snippet.d.ts.map +1 -1
  28. package/dist/code-example/helpers/generate-code-snippet.js +57 -27
  29. package/dist/code-example/helpers/generate-code-snippet.js.map +1 -1
  30. package/dist/code-example/helpers/get-asyncapi-example-context.js.map +1 -1
  31. package/dist/code-example/helpers/get-clients.js.map +1 -1
  32. package/dist/code-example/helpers/get-custom-code-samples.js.map +1 -1
  33. package/dist/code-example/helpers/get-generated-payload-example.js.map +1 -1
  34. package/dist/code-example/helpers/get-message-example-content.js.map +1 -1
  35. package/dist/code-example/helpers/get-secrets.js.map +1 -1
  36. package/dist/code-example/helpers/get-snippet.d.ts +2 -2
  37. package/dist/code-example/helpers/get-snippet.d.ts.map +1 -1
  38. package/dist/code-example/helpers/get-snippet.js +7 -9
  39. package/dist/code-example/helpers/get-snippet.js.map +1 -1
  40. package/dist/code-example/helpers/operation-to-har/operation-to-har.d.ts +1 -1
  41. package/dist/code-example/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  42. package/dist/code-example/helpers/operation-to-har/operation-to-har.js +1 -1
  43. package/dist/code-example/helpers/operation-to-har/operation-to-har.js.map +1 -1
  44. package/dist/code-example/helpers/operation-to-har/process-body.d.ts +2 -2
  45. package/dist/code-example/helpers/operation-to-har/process-body.d.ts.map +1 -1
  46. package/dist/code-example/helpers/operation-to-har/process-body.js +102 -81
  47. package/dist/code-example/helpers/operation-to-har/process-body.js.map +1 -1
  48. package/dist/code-example/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  49. package/dist/code-example/helpers/operation-to-har/process-parameters.js +49 -47
  50. package/dist/code-example/helpers/operation-to-har/process-parameters.js.map +1 -1
  51. package/dist/code-example/helpers/operation-to-har/process-security-schemes.js +6 -6
  52. package/dist/code-example/helpers/operation-to-har/process-security-schemes.js.map +1 -1
  53. package/dist/code-example/helpers/operation-to-har/process-server-url.js.map +1 -1
  54. package/dist/code-example/index.d.ts +1 -1
  55. package/dist/code-example/index.d.ts.map +1 -1
  56. package/dist/code-example/index.js +14 -14
  57. package/dist/code-example/mount-asyncapi.js +1 -1
  58. package/dist/code-example/mount-asyncapi.js.map +1 -1
  59. package/dist/code-example/mount.js +1 -1
  60. package/dist/code-example/mount.js.map +1 -1
  61. package/dist/constants.js +1 -1
  62. package/dist/schema/LinkButton.vue.js.map +1 -1
  63. package/dist/schema/RenderString.vue.js +11 -4
  64. package/dist/schema/RenderString.vue.js.map +1 -1
  65. package/dist/schema/RenderString2.vue.js +6 -0
  66. package/dist/schema/RenderString2.vue.js.map +1 -0
  67. package/dist/schema/Schema.vue.d.ts.map +1 -1
  68. package/dist/schema/Schema.vue.js +235 -6
  69. package/dist/schema/Schema.vue.js.map +1 -1
  70. package/dist/schema/Schema3.vue.js +8 -0
  71. package/dist/schema/Schema3.vue.js.map +1 -0
  72. package/dist/schema/SchemaCollapsedPreview.vue.js +25 -4
  73. package/dist/schema/SchemaCollapsedPreview.vue.js.map +1 -1
  74. package/dist/schema/SchemaCollapsedPreview2.vue.js +6 -0
  75. package/dist/schema/SchemaCollapsedPreview2.vue.js.map +1 -0
  76. package/dist/schema/SchemaComposition.vue.js +232 -6
  77. package/dist/schema/SchemaComposition.vue.js.map +1 -1
  78. package/dist/schema/SchemaComposition3.vue.js +8 -0
  79. package/dist/schema/SchemaComposition3.vue.js.map +1 -0
  80. package/dist/schema/SchemaEnumPropertyItem.vue.d.ts +1 -0
  81. package/dist/schema/SchemaEnumPropertyItem.vue.d.ts.map +1 -1
  82. package/dist/schema/SchemaEnumPropertyItem.vue.js +23 -4
  83. package/dist/schema/SchemaEnumPropertyItem.vue.js.map +1 -1
  84. package/dist/schema/SchemaEnumPropertyItem2.vue.js +6 -0
  85. package/dist/schema/SchemaEnumPropertyItem2.vue.js.map +1 -0
  86. package/dist/schema/SchemaEnums.vue.d.ts.map +1 -1
  87. package/dist/schema/SchemaEnums.vue.js +74 -6
  88. package/dist/schema/SchemaEnums.vue.js.map +1 -1
  89. package/dist/schema/SchemaEnums3.vue.js +8 -0
  90. package/dist/schema/SchemaEnums3.vue.js.map +1 -0
  91. package/dist/schema/SchemaGlyphPuck.vue.js +27 -4
  92. package/dist/schema/SchemaGlyphPuck.vue.js.map +1 -1
  93. package/dist/schema/SchemaGlyphPuck2.vue.js +6 -0
  94. package/dist/schema/SchemaGlyphPuck2.vue.js.map +1 -0
  95. package/dist/schema/SchemaGutterToggle.vue.js +40 -4
  96. package/dist/schema/SchemaGutterToggle.vue.js.map +1 -1
  97. package/dist/schema/SchemaGutterToggle2.vue.js +6 -0
  98. package/dist/schema/SchemaGutterToggle2.vue.js.map +1 -0
  99. package/dist/schema/SchemaHeading.vue.js +32 -6
  100. package/dist/schema/SchemaHeading.vue.js.map +1 -1
  101. package/dist/schema/SchemaHeading3.vue.js +8 -0
  102. package/dist/schema/SchemaHeading3.vue.js.map +1 -0
  103. package/dist/schema/SchemaObjectExampleCodeBlock.vue.js +42 -4
  104. package/dist/schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -1
  105. package/dist/schema/SchemaObjectExampleCodeBlock2.vue.js +6 -0
  106. package/dist/schema/SchemaObjectExampleCodeBlock2.vue.js.map +1 -0
  107. package/dist/schema/SchemaObjectProperties.vue.js +213 -4
  108. package/dist/schema/SchemaObjectProperties.vue.js.map +1 -1
  109. package/dist/schema/SchemaObjectProperties2.vue.js +6 -0
  110. package/dist/schema/SchemaObjectProperties2.vue.js.map +1 -0
  111. package/dist/schema/SchemaProperty.vue.d.ts +7 -2
  112. package/dist/schema/SchemaProperty.vue.d.ts.map +1 -1
  113. package/dist/schema/SchemaProperty.vue.js +494 -6
  114. package/dist/schema/SchemaProperty.vue.js.map +1 -1
  115. package/dist/schema/SchemaProperty3.vue.js +8 -0
  116. package/dist/schema/SchemaProperty3.vue.js.map +1 -0
  117. package/dist/schema/SchemaPropertyDefault.vue.js +61 -6
  118. package/dist/schema/SchemaPropertyDefault.vue.js.map +1 -1
  119. package/dist/schema/SchemaPropertyDefault3.vue.js +8 -0
  120. package/dist/schema/SchemaPropertyDefault3.vue.js.map +1 -0
  121. package/dist/schema/SchemaPropertyDetail.vue.js +22 -6
  122. package/dist/schema/SchemaPropertyDetail.vue.js.map +1 -1
  123. package/dist/schema/SchemaPropertyDetail3.vue.js +8 -0
  124. package/dist/schema/SchemaPropertyDetail3.vue.js.map +1 -0
  125. package/dist/schema/SchemaPropertyExamples.vue.js +133 -6
  126. package/dist/schema/SchemaPropertyExamples.vue.js.map +1 -1
  127. package/dist/schema/SchemaPropertyExamples3.vue.js +8 -0
  128. package/dist/schema/SchemaPropertyExamples3.vue.js.map +1 -0
  129. package/dist/schema/SchemaPropertyHeading.vue.d.ts +4 -1
  130. package/dist/schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  131. package/dist/schema/SchemaPropertyHeading.vue.js +313 -6
  132. package/dist/schema/SchemaPropertyHeading.vue.js.map +1 -1
  133. package/dist/schema/SchemaPropertyHeading3.vue.js +8 -0
  134. package/dist/schema/SchemaPropertyHeading3.vue.js.map +1 -0
  135. package/dist/schema/SchemaPropertyPattern.vue.js +42 -6
  136. package/dist/schema/SchemaPropertyPattern.vue.js.map +1 -1
  137. package/dist/schema/SchemaPropertyPattern3.vue.js +8 -0
  138. package/dist/schema/SchemaPropertyPattern3.vue.js.map +1 -0
  139. package/dist/schema/SchemaRailPanel.vue.js +53 -4
  140. package/dist/schema/SchemaRailPanel.vue.js.map +1 -1
  141. package/dist/schema/SchemaRailPanel2.vue.js +6 -0
  142. package/dist/schema/SchemaRailPanel2.vue.js.map +1 -0
  143. package/dist/schema/components/CopyLinkButton.vue.js +24 -4
  144. package/dist/schema/components/CopyLinkButton.vue.js.map +1 -1
  145. package/dist/schema/components/CopyLinkButton2.vue.js +6 -0
  146. package/dist/schema/components/CopyLinkButton2.vue.js.map +1 -0
  147. package/dist/schema/components/WithBreadcrumb.vue.js +15 -4
  148. package/dist/schema/components/WithBreadcrumb.vue.js.map +1 -1
  149. package/dist/schema/components/WithBreadcrumb2.vue.js +6 -0
  150. package/dist/schema/components/WithBreadcrumb2.vue.js.map +1 -0
  151. package/dist/schema/helpers/dynamic-scope.js.map +1 -1
  152. package/dist/schema/helpers/format-example.js.map +1 -1
  153. package/dist/schema/helpers/format-structured-value.d.ts +3 -0
  154. package/dist/schema/helpers/format-structured-value.d.ts.map +1 -0
  155. package/dist/schema/helpers/format-structured-value.js +6 -0
  156. package/dist/schema/helpers/format-structured-value.js.map +1 -0
  157. package/dist/schema/helpers/format-value.js.map +1 -1
  158. package/dist/schema/helpers/get-compositions-to-render.d.ts.map +1 -1
  159. package/dist/schema/helpers/get-compositions-to-render.js +34 -31
  160. package/dist/schema/helpers/get-compositions-to-render.js.map +1 -1
  161. package/dist/schema/helpers/get-discriminator-values.js.map +1 -1
  162. package/dist/schema/helpers/get-enum-values.js.map +1 -1
  163. package/dist/schema/helpers/get-property-description.js.map +1 -1
  164. package/dist/schema/helpers/get-ref-name.d.ts +14 -5
  165. package/dist/schema/helpers/get-ref-name.d.ts.map +1 -1
  166. package/dist/schema/helpers/get-ref-name.js +8 -11
  167. package/dist/schema/helpers/get-ref-name.js.map +1 -1
  168. package/dist/schema/helpers/get-rendered-example.js.map +1 -1
  169. package/dist/schema/helpers/get-schema-type.js.map +1 -1
  170. package/dist/schema/helpers/get-type-signature-tokens.d.ts.map +1 -1
  171. package/dist/schema/helpers/get-type-signature-tokens.js +37 -36
  172. package/dist/schema/helpers/get-type-signature-tokens.js.map +1 -1
  173. package/dist/schema/helpers/has-complex-array-items.js.map +1 -1
  174. package/dist/schema/helpers/index.d.ts +1 -1
  175. package/dist/schema/helpers/index.d.ts.map +1 -1
  176. package/dist/schema/helpers/index.js +3 -3
  177. package/dist/schema/helpers/is-empty-schema-object.js.map +1 -1
  178. package/dist/schema/helpers/is-model-linkable.js.map +1 -1
  179. package/dist/schema/helpers/is-on-schema-target-path.js.map +1 -1
  180. package/dist/schema/helpers/is-type-object.js.map +1 -1
  181. package/dist/schema/helpers/merge-all-of-schemas.js.map +1 -1
  182. package/dist/schema/helpers/normalize-object-composition.js.map +1 -1
  183. package/dist/schema/helpers/optimize-value-for-display.js.map +1 -1
  184. package/dist/schema/helpers/partition-all-of-compositions.js.map +1 -1
  185. package/dist/schema/helpers/schema-cycle.js.map +1 -1
  186. package/dist/schema/helpers/schema-expansion.js.map +1 -1
  187. package/dist/schema/helpers/schema-keyboard-nav.js.map +1 -1
  188. package/dist/schema/helpers/schema-name.d.ts +7 -3
  189. package/dist/schema/helpers/schema-name.d.ts.map +1 -1
  190. package/dist/schema/helpers/schema-name.js +36 -26
  191. package/dist/schema/helpers/schema-name.js.map +1 -1
  192. package/dist/schema/helpers/should-display-description.js.map +1 -1
  193. package/dist/schema/helpers/should-display-heading.js.map +1 -1
  194. package/dist/schema/helpers/should-render-array-item-composition.js.map +1 -1
  195. package/dist/schema/helpers/sort-property-names.js.map +1 -1
  196. package/dist/schema/helpers/unwrap-for-read.js.map +1 -1
  197. package/dist/schema/index.js +8 -8
  198. package/dist/schema/localization/index.js.map +1 -1
  199. package/dist/schema/localization/translations.js.map +1 -1
  200. package/dist/shared/Badge.vue.js +13 -6
  201. package/dist/shared/Badge.vue.js.map +1 -1
  202. package/dist/shared/Badge3.vue.js +8 -0
  203. package/dist/shared/Badge3.vue.js.map +1 -0
  204. package/dist/shared/ExternalDocs.vue.d.ts +2 -0
  205. package/dist/shared/ExternalDocs.vue.d.ts.map +1 -1
  206. package/dist/shared/ExternalDocs.vue.js +50 -4
  207. package/dist/shared/ExternalDocs.vue.js.map +1 -1
  208. package/dist/shared/ExternalDocs2.vue.js +6 -0
  209. package/dist/shared/ExternalDocs2.vue.js.map +1 -0
  210. package/dist/shared/ExternalExampleStatus.vue.js +24 -4
  211. package/dist/shared/ExternalExampleStatus.vue.js.map +1 -1
  212. package/dist/shared/ExternalExampleStatus2.vue.js +6 -0
  213. package/dist/shared/ExternalExampleStatus2.vue.js.map +1 -0
  214. package/dist/shared/ScreenReader.vue.js +16 -4
  215. package/dist/shared/ScreenReader.vue.js.map +1 -1
  216. package/dist/shared/ScreenReader2.vue.js +6 -0
  217. package/dist/shared/ScreenReader2.vue.js.map +1 -0
  218. package/dist/shared/external-example-localization/index.js.map +1 -1
  219. package/dist/shared/external-example-localization/translations.js.map +1 -1
  220. package/dist/shared/index.js +4 -4
  221. package/dist/specification-extensions/ExtensionValue.vue.js +89 -4
  222. package/dist/specification-extensions/ExtensionValue.vue.js.map +1 -1
  223. package/dist/specification-extensions/ExtensionValue2.vue.js +6 -0
  224. package/dist/specification-extensions/ExtensionValue2.vue.js.map +1 -0
  225. package/dist/specification-extensions/SpecificationExtensions.vue.js +76 -4
  226. package/dist/specification-extensions/SpecificationExtensions.vue.js.map +1 -1
  227. package/dist/specification-extensions/SpecificationExtensions2.vue.js +6 -0
  228. package/dist/specification-extensions/SpecificationExtensions2.vue.js.map +1 -0
  229. package/dist/specification-extensions/index.js +1 -1
  230. package/dist/style.css +23 -19
  231. package/dist/vue-styles.css +1 -1
  232. package/package.json +19 -19
  233. package/dist/code-example/components/AsyncApiCodeExample.vue_vue_type_script_setup_true_lang.js +0 -113
  234. package/dist/code-example/components/AsyncApiCodeExample.vue_vue_type_script_setup_true_lang.js.map +0 -1
  235. package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js +0 -269
  236. package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js.map +0 -1
  237. package/dist/code-example/components/ExamplePicker.vue_vue_type_script_setup_true_lang.js +0 -48
  238. package/dist/code-example/components/ExamplePicker.vue_vue_type_script_setup_true_lang.js.map +0 -1
  239. package/dist/code-example/components/HttpMethod.vue_vue_type_script_setup_true_lang.js +0 -34
  240. package/dist/code-example/components/HttpMethod.vue_vue_type_script_setup_true_lang.js.map +0 -1
  241. package/dist/schema/RenderString.vue_vue_type_script_setup_true_lang.js +0 -13
  242. package/dist/schema/RenderString.vue_vue_type_script_setup_true_lang.js.map +0 -1
  243. package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js +0 -237
  244. package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js.map +0 -1
  245. package/dist/schema/SchemaCollapsedPreview.vue_vue_type_script_setup_true_lang.js +0 -27
  246. package/dist/schema/SchemaCollapsedPreview.vue_vue_type_script_setup_true_lang.js.map +0 -1
  247. package/dist/schema/SchemaComposition.vue_vue_type_script_setup_true_lang.js +0 -234
  248. package/dist/schema/SchemaComposition.vue_vue_type_script_setup_true_lang.js.map +0 -1
  249. package/dist/schema/SchemaEnumPropertyItem.vue_vue_type_script_setup_true_lang.js +0 -23
  250. package/dist/schema/SchemaEnumPropertyItem.vue_vue_type_script_setup_true_lang.js.map +0 -1
  251. package/dist/schema/SchemaEnums.vue_vue_type_script_setup_true_lang.js +0 -77
  252. package/dist/schema/SchemaEnums.vue_vue_type_script_setup_true_lang.js.map +0 -1
  253. package/dist/schema/SchemaGlyphPuck.vue_vue_type_script_setup_true_lang.js +0 -29
  254. package/dist/schema/SchemaGlyphPuck.vue_vue_type_script_setup_true_lang.js.map +0 -1
  255. package/dist/schema/SchemaGutterToggle.vue_vue_type_script_setup_true_lang.js +0 -42
  256. package/dist/schema/SchemaGutterToggle.vue_vue_type_script_setup_true_lang.js.map +0 -1
  257. package/dist/schema/SchemaHeading.vue_vue_type_script_setup_true_lang.js +0 -34
  258. package/dist/schema/SchemaHeading.vue_vue_type_script_setup_true_lang.js.map +0 -1
  259. package/dist/schema/SchemaObjectExampleCodeBlock.vue_vue_type_script_setup_true_lang.js +0 -44
  260. package/dist/schema/SchemaObjectExampleCodeBlock.vue_vue_type_script_setup_true_lang.js.map +0 -1
  261. package/dist/schema/SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js +0 -215
  262. package/dist/schema/SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js.map +0 -1
  263. package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js +0 -474
  264. package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js.map +0 -1
  265. package/dist/schema/SchemaPropertyDefault.vue_vue_type_script_setup_true_lang.js +0 -63
  266. package/dist/schema/SchemaPropertyDefault.vue_vue_type_script_setup_true_lang.js.map +0 -1
  267. package/dist/schema/SchemaPropertyDetail.vue_vue_type_script_setup_true_lang.js +0 -24
  268. package/dist/schema/SchemaPropertyDetail.vue_vue_type_script_setup_true_lang.js.map +0 -1
  269. package/dist/schema/SchemaPropertyExamples.vue_vue_type_script_setup_true_lang.js +0 -135
  270. package/dist/schema/SchemaPropertyExamples.vue_vue_type_script_setup_true_lang.js.map +0 -1
  271. package/dist/schema/SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js +0 -314
  272. package/dist/schema/SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js.map +0 -1
  273. package/dist/schema/SchemaPropertyPattern.vue_vue_type_script_setup_true_lang.js +0 -44
  274. package/dist/schema/SchemaPropertyPattern.vue_vue_type_script_setup_true_lang.js.map +0 -1
  275. package/dist/schema/SchemaRailPanel.vue_vue_type_script_setup_true_lang.js +0 -55
  276. package/dist/schema/SchemaRailPanel.vue_vue_type_script_setup_true_lang.js.map +0 -1
  277. package/dist/schema/components/CopyLinkButton.vue_vue_type_script_setup_true_lang.js +0 -26
  278. package/dist/schema/components/CopyLinkButton.vue_vue_type_script_setup_true_lang.js.map +0 -1
  279. package/dist/schema/components/WithBreadcrumb.vue_vue_type_script_setup_true_lang.js +0 -17
  280. package/dist/schema/components/WithBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +0 -1
  281. package/dist/shared/Badge.vue_vue_type_script_setup_true_lang.js +0 -15
  282. package/dist/shared/Badge.vue_vue_type_script_setup_true_lang.js.map +0 -1
  283. package/dist/shared/ExternalDocs.vue_vue_type_script_setup_true_lang.js +0 -45
  284. package/dist/shared/ExternalDocs.vue_vue_type_script_setup_true_lang.js.map +0 -1
  285. package/dist/shared/ExternalExampleStatus.vue_vue_type_script_setup_true_lang.js +0 -26
  286. package/dist/shared/ExternalExampleStatus.vue_vue_type_script_setup_true_lang.js.map +0 -1
  287. package/dist/shared/ScreenReader.vue_vue_type_script_setup_true_lang.js +0 -18
  288. package/dist/shared/ScreenReader.vue_vue_type_script_setup_true_lang.js.map +0 -1
  289. package/dist/specification-extensions/ExtensionValue.vue_vue_type_script_setup_true_lang.js +0 -91
  290. package/dist/specification-extensions/ExtensionValue.vue_vue_type_script_setup_true_lang.js.map +0 -1
  291. package/dist/specification-extensions/SpecificationExtensions.vue_vue_type_script_setup_true_lang.js +0 -78
  292. package/dist/specification-extensions/SpecificationExtensions.vue_vue_type_script_setup_true_lang.js.map +0 -1
@@ -1,5 +1,6 @@
1
- import type { SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
- type SchemaModelName = {
1
+ import type { OpenApiDocument, SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
2
+ /** Display label and optional navigation key for a named schema. */
3
+ export type SchemaModelName = {
3
4
  /**
4
5
  * The key in `components.schemas` (extracted from `$ref`), used for sidebar
5
6
  * navigation. Only set when the `$ref` actually targets
@@ -10,6 +11,10 @@ type SchemaModelName = {
10
11
  /** The human-readable name to display (schema.title, schema.name, or ref key). */
11
12
  label: string;
12
13
  };
14
+ /** Display the authored reference name and link it to a model when the target is local. */
15
+ export declare const getModelNameFromRef: (reference: Extract<SchemaReferenceType<SchemaObject>, {
16
+ $ref: string;
17
+ }>, document?: Pick<OpenApiDocument, "components">) => SchemaModelName | null;
13
18
  /**
14
19
  * Extract schema name from various schema formats
15
20
  *
@@ -23,5 +28,4 @@ export declare const getModelNameFromSchema: (schemaOrRef: SchemaObject | Schema
23
28
  * example an array of primitives), so callers can fall back to `getSchemaType`.
24
29
  */
25
30
  export declare const getModelNameWithArray: (schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>) => SchemaModelName | null;
26
- export {};
27
31
  //# sourceMappingURL=schema-name.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/schema-name.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,mBAAmB,EACpB,MAAM,8DAA8D,CAAA;AAWrE,oEAAoE;AACpE,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,2FAA2F;AAC3F,eAAO,MAAM,mBAAmB,GAC9B,WAAW,OAAO,CAAC,mBAAmB,CAAC,YAAY,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EACvE,WAAW,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,KAC7C,eAAe,GAAG,IA2BpB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAC,KAC5D,eAAe,GAAG,IAapB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAChC,aAAa,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAC,KAC5D,eAAe,GAAG,IAepB,CAAA"}
@@ -1,32 +1,42 @@
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";
1
+ import { getRefNameFromPointer as e, getRefPointer as t, getSchemaNameFromPointer as n, getSchemaRefName as r } from "./get-ref-name.js";
2
+ import { unpackProxyShallow as i } from "@scalar/workspace-store/helpers/unpack-proxy";
3
+ import { resolve as a } from "@scalar/workspace-store/resolve";
4
+ import { isArraySchema as o } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
4
5
  // src/schema/helpers/schema-name.ts
5
- var i = (r) => {
6
- if (!r || typeof r != "object") 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
6
+ var s = (r, a) => {
7
+ let o = r.$ref, s = t(o), c = e(o, s);
8
+ if (!c) return null;
9
+ let l = n(s), u = o.startsWith("#/components/schemas/") ? l : null;
10
+ if (!l || !a) return {
11
+ label: c,
12
+ schemaKey: u
11
13
  };
12
- if (i.name) return {
13
- schemaKey: a,
14
- label: i.name
14
+ let d = a.components?.schemas?.[l];
15
+ if (d === void 0) return {
16
+ label: c,
17
+ schemaKey: null
15
18
  };
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);
19
+ let f = r["$ref-value"];
20
+ return f === void 0 ? {
21
+ label: c,
22
+ schemaKey: u
23
+ } : {
24
+ label: c,
25
+ schemaKey: i(f) === i(d) ? l : null
26
+ };
27
+ }, c = (e) => {
28
+ if (!e || typeof e != "object") return null;
29
+ let t = a.schema(e), n = t.title || t.name;
30
+ return n ? {
31
+ schemaKey: "$ref" in e ? r(e.$ref) : null,
32
+ label: n
33
+ } : "$ref" in e ? s(e) : null;
34
+ }, l = (e) => {
35
+ let t = c(e);
26
36
  if (t) return t;
27
- let a = n.schema(e);
28
- if (r(a) && a.items && typeof a.items == "object") {
29
- let e = i(a.items);
37
+ let n = a.schema(e);
38
+ if (o(n) && n.items && typeof n.items == "object") {
39
+ let e = c(n.items);
30
40
  if (e) return {
31
41
  schemaKey: e.schemaKey,
32
42
  label: `${e.label}[]`
@@ -34,6 +44,6 @@ var i = (r) => {
34
44
  }
35
45
  return null;
36
46
  };
37
- export { i as getModelNameFromSchema, a as getModelNameWithArray };
47
+ export { s as getModelNameFromRef, c as getModelNameFromSchema, l as getModelNameWithArray };
38
48
 
39
49
  //# sourceMappingURL=schema-name.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-name.js","names":["getModelNameFromSchema","schemaOrRef","schema","resolve","schemaKey","getSchemaRefName","label","getRefName","getModelNameWithArray","direct","isArraySchema","itemName"],"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 || typeof schemaOrRef !== 'object') {\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 && typeof schema.items === 'object') {\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,IAAaA,KACX,MAC2B;CAC3B,IAAI,CAACC,KAAe,OAAOA,KAAgB,UACzC,OAAO;CAGT,IAAMC,IAASC,EAAQ,OAAOF,CAAW,GAGnCG,IAAY,UAAUH,IAAcI,EAAiBJ,EAAY,IAAI,IAAI;CAE/E,IAAIC,EAAO,OACT,OAAO;EAAE;EAAW,OAAOA,EAAO;CAAM;CAG1C,IAAIA,EAAO,MACT,OAAO;EAAE;EAAW,OAAOA,EAAO;CAAK;CAGzC,IAAI,UAAUD,GAAa;EAGzB,IAAMK,IAAQC,EAAWN,EAAY,IAAI;EACzC,IAAIK,GACF,OAAO;GAAE;GAAW;EAAM;CAE9B;CAEA,OAAO;AACT,GAQaE,KACX,MAC2B;CAC3B,IAAMC,IAAST,EAAuBC,CAAW;CACjD,IAAIQ,GACF,OAAOA;CAGT,IAAMP,IAASC,EAAQ,OAAOF,CAAW;CACzC,IAAIS,EAAcR,CAAM,KAAKA,EAAO,SAAS,OAAOA,EAAO,SAAU,UAAU;EAC7E,IAAMS,IAAWX,EAAuBE,EAAO,KAAK;EACpD,IAAIS,GACF,OAAO;GAAE,WAAWA,EAAS;GAAW,OAAO,GAAGA,EAAS,MAAM;EAAI;CAEzE;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"schema-name.js","names":["getRefNameFromPointer","getRefPointer","getSchemaNameFromPointer","getSchemaRefName","unpackProxyShallow","resolve","isArraySchema","getModelNameFromRef","reference","document","ref","pointer","label","schemaKey","fragmentKey","component","target","getModelNameFromSchema","schemaOrRef","schema","getModelNameWithArray","direct","itemName"],"sources":["../../../src/schema/helpers/schema-name.ts"],"sourcesContent":["import { unpackProxyShallow } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type {\n OpenApiDocument,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\nimport {\n COMPONENT_SCHEMAS_REF_PREFIX,\n getRefNameFromPointer,\n getRefPointer,\n getSchemaNameFromPointer,\n getSchemaRefName,\n} from './get-ref-name'\n\n/** Display label and optional navigation key for a named schema. */\nexport type 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/** Display the authored reference name and link it to a model when the target is local. */\nexport const getModelNameFromRef = (\n reference: Extract<SchemaReferenceType<SchemaObject>, { $ref: string }>,\n document?: Pick<OpenApiDocument, 'components'>,\n): SchemaModelName | null => {\n const ref = reference.$ref\n const pointer = getRefPointer(ref)\n const label = getRefNameFromPointer(ref, pointer)\n if (!label) {\n return null\n }\n\n const schemaKey = getSchemaNameFromPointer(pointer)\n const fragmentKey = ref.startsWith(COMPONENT_SCHEMAS_REF_PREFIX) ? schemaKey : null\n if (!schemaKey || !document) {\n return { label, schemaKey: fragmentKey }\n }\n\n const component = document.components?.schemas?.[schemaKey]\n if (component === undefined) {\n return { label, schemaKey: null }\n }\n\n const target = reference['$ref-value']\n if (target !== undefined) {\n // Distinct aliases can resolve to the same schema. Link only to the referenced component.\n return { label, schemaKey: unpackProxyShallow(target) === unpackProxyShallow(component) ? schemaKey : null }\n }\n\n // A direct fragment keeps its model link while the target is loaded on demand.\n return { label, schemaKey: fragmentKey }\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 || typeof schemaOrRef !== 'object') {\n return null\n }\n\n const schema = resolve.schema(schemaOrRef)\n const label = schema.title || schema.name\n if (label) {\n const schemaKey = '$ref' in schemaOrRef ? getSchemaRefName(schemaOrRef.$ref) : null\n return { schemaKey, label }\n }\n\n return '$ref' in schemaOrRef ? getModelNameFromRef(schemaOrRef) : 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 && typeof schema.items === 'object') {\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":";;;;;AA+BA,IAAaO,KACXC,GACAC,MAC2B;CAC3B,IAAMC,IAAMF,EAAU,MAChBG,IAAUV,EAAcS,CAAG,GAC3BE,IAAQZ,EAAsBU,GAAKC,CAAO;CAChD,IAAI,CAACC,GACH,OAAO;CAGT,IAAMC,IAAYX,EAAyBS,CAAO,GAC5CG,IAAcJ,EAAI,WAAA,uBAAuC,IAAIG,IAAY;CAC/E,IAAI,CAACA,KAAa,CAACJ,GACjB,OAAO;EAAEG;EAAO,WAAWE;CAAY;CAGzC,IAAMC,IAAYN,EAAS,YAAY,UAAUI;CACjD,IAAIE,MAAc,KAAA,GAChB,OAAO;EAAEH;EAAO,WAAW;CAAK;CAGlC,IAAMI,IAASR,EAAU;CAOzB,OANIQ,MAAW,KAAA,IAMR;EAAEJ;EAAO,WAAWE;CAAY,IAJ9B;EAAEF;EAAO,WAAWR,EAAmBY,CAAM,MAAMZ,EAAmBW,CAAS,IAAIF,IAAY;CAAK;AAK/G,GAOaI,KACXC,MAC2B;CAC3B,IAAI,CAACA,KAAe,OAAOA,KAAgB,UACzC,OAAO;CAGT,IAAMC,IAASd,EAAQ,OAAOa,CAAW,GACnCN,IAAQO,EAAO,SAASA,EAAO;CAMrC,OALIP,IAEK;EAAE,WADS,UAAUM,IAAcf,EAAiBe,EAAY,IAAI,IAAI;EAC3DN;CAAM,IAGrB,UAAUM,IAAcX,EAAoBW,CAAW,IAAI;AACpE,GAQaE,KACXF,MAC2B;CAC3B,IAAMG,IAASJ,EAAuBC,CAAW;CACjD,IAAIG,GACF,OAAOA;CAGT,IAAMF,IAASd,EAAQ,OAAOa,CAAW;CACzC,IAAIZ,EAAca,CAAM,KAAKA,EAAO,SAAS,OAAOA,EAAO,SAAU,UAAU;EAC7E,IAAMG,IAAWL,EAAuBE,EAAO,KAAK;EACpD,IAAIG,GACF,OAAO;GAAE,WAAWA,EAAS;GAAW,OAAO,GAAGA,EAAS,MAAM;EAAI;CAEzE;CAEA,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"should-display-description.js","names":["shouldDisplayDescription","schema","propDescription"],"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,IAAaA,KAA4B,GAAkC,MACrE,CAACC,KAKDA,EAAO,QACF,OAOLC,KAAmBD,EAAO,cACrBC,MAAoBD,EAAO,cAAcC,IAAkB,GAAGA,EAAgB,MAAMD,EAAO,gBAG7FC,KAAmBD,EAAO,eAAe"}
1
+ {"version":3,"file":"should-display-description.js","names":["shouldDisplayDescription","schema","propDescription"],"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,IAAaA,KAA4BC,GAAkCC,MACrE,CAACD,KAKDA,EAAO,QACF,OAOLC,KAAmBD,EAAO,cACrBC,MAAoBD,EAAO,cAAcC,IAAkB,GAAGA,EAAgB,MAAMD,EAAO,gBAG7FC,KAAmBD,EAAO,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"should-display-heading.js","names":["shouldDisplayHeading","name","required","schema"],"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,IAAaA,KAAwB,GAAkC,GAAe,IAAW,OAE3FC,KAAQC,IACH,KAIJC,IAMHA,EAAO,eAAe,MACtBA,EAAO,UAAU,KAAA,KACjBA,EAAO,MAAM,WAAW,KACvB,UAAUA,KAAUA,EAAO,SAAS,KAAA,KACpC,cAAcA,KAAUA,EAAO,aAAa,MAC7CA,EAAO,cAAc,MACrBA,EAAO,aAAa,KAXb"}
1
+ {"version":3,"file":"should-display-heading.js","names":["shouldDisplayHeading","schema","name","required"],"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,IAAaA,KAAwBC,GAAkCC,GAAeC,IAAW,OAE3FD,KAAQC,IACH,KAIJF,IAMHA,EAAO,eAAe,MACtBA,EAAO,UAAU,KAAA,KACjBA,EAAO,MAAM,WAAW,KACvB,UAAUA,KAAUA,EAAO,SAAS,KAAA,KACpC,cAAcA,KAAUA,EAAO,aAAa,MAC7CA,EAAO,cAAc,MACrBA,EAAO,aAAa,KAXb"}
@@ -1 +1 @@
1
- {"version":3,"file":"should-render-array-item-composition.js","names":["hasArrayItemComposition","schema","isArraySchema","composition","shouldRenderArrayItemComposition","hasComplexArrayItems"],"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/** Whether the array declares the composition on its item schema. */\nexport const hasArrayItemComposition = (schema: SchemaObject | undefined, composition: string): boolean =>\n Boolean(\n schema && isArraySchema(schema) && schema.items && typeof schema.items === 'object' && composition in schema.items,\n )\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 hasArrayItemComposition(schema, composition) && !hasComplexArrayItems(schema)\n"],"mappings":";;;AAMA,IAAaA,KAA2B,GAAkC,MACxE,GACEC,KAAUC,EAAcD,CAAM,KAAKA,EAAO,SAAS,OAAOA,EAAO,SAAU,YAAYE,KAAeF,EAAO,QAUpGG,KAAoC,GAAkC,MACjFJ,EAAwBC,GAAQE,CAAW,KAAK,CAACE,EAAqBJ,CAAM"}
1
+ {"version":3,"file":"should-render-array-item-composition.js","names":["hasComplexArrayItems","isArraySchema","hasArrayItemComposition","schema","composition","shouldRenderArrayItemComposition"],"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/** Whether the array declares the composition on its item schema. */\nexport const hasArrayItemComposition = (schema: SchemaObject | undefined, composition: string): boolean =>\n Boolean(\n schema && isArraySchema(schema) && schema.items && typeof schema.items === 'object' && composition in schema.items,\n )\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 hasArrayItemComposition(schema, composition) && !hasComplexArrayItems(schema)\n"],"mappings":";;;AAMA,IAAaE,KAA2BC,GAAkCC,MACxE,GACED,KAAUF,EAAcE,CAAM,KAAKA,EAAO,SAAS,OAAOA,EAAO,SAAU,YAAYC,KAAeD,EAAO,QAUpGE,KAAoCF,GAAkCC,MACjFF,EAAwBC,GAAQC,CAAW,KAAK,CAACJ,EAAqBG,CAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"sort-property-names.js","names":["reduceNamesToObject","names","prop","properties","name","acc","collator","sortCache","EMPTY_NAMES","sortPropertyNames","isTypeObject","schema","required","discriminatorName","discriminator","cacheKey","hideReadOnly","hideWriteOnly","orderSchemaPropertiesBy","orderRequiredPropertiesFirst","bucket","cached","requiredPropertiesSet","shouldFilter","records","propertySchema","resolved","resolve","a","b","record"],"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,IAAaA,KAAuB,GAAiB,MACnDC,EAAM,QAAoB,GAAK,MAAS;CACtC,IAAMC,IAAOC,IAAaC;CAI1B,OAHIF,MACF,EAAIE,KAAQF,IAEPG;AACT,GAAG,CAAC,CAAC,GAQDC,IAAW,IAAI,KAAK,SAAS,KAAA,CAAS,GA0CtCC,oBAAY,IAAI,QAA6C,GAG7DC,IAAiC,OAAO,OAAO,CAAC,CAAC,GAU1CC,KACX,GACA,GACA,EACE,kBAAe,IACf,mBAAgB,IAChB,6BAA0B,SAC1B,kCAA+B,OACpB,CAAC,MACQ;CACtB,IAAI,CAACC,EAAaC,CAAM,KAAK,CAACA,EAAO,YACnC,OAAOH;CAGT,IAAML,IAAaQ,EAAO,YACpBC,IAAWD,EAAO,UAClBE,IAAoBC,GAAe,cAInCC,IAAW;EACfF,MAAsB,KAAA,IAAY,KAAK,IAAIA;EAC3CG;EACAC;EACAC;EACAC;CACF,CAAC,CAAC,KAAK,GAAG,GAEJC,IAASb,EAAU,IAAIJ,CAAU,GACjCkB,IAASD,GAAQ,IAAIL,CAAQ;CACnC,IAAIM,KAAUA,EAAO,aAAaT,GAChC,OAAOS,EAAO;CAGhB,IAAMC,IAAwB,IAAI,IAAIV,KAAY,CAAC,CAAC,GAY9CW,IAAeP,KAAgBC,GAC/BO,IAA4B,CAAC;CAEnC,KAAK,IAAMpB,KAAQ,OAAO,KAAKD,CAAU,GAAG;EAC1C,IAAMsB,IAAiBtB,EAAWC;EAElC,IAAImB,GAAc;GAChB,IAAMG,IAAWC,EAAQ,OAAOF,CAAc;GAK9C,IAHIT,KAAgBU,GAAU,aAAa,MAGvCT,KAAiBS,GAAU,cAAc,IAC3C;EAEJ;EAEA,EAAQ,KAAK;GACX;GACA,OACED,KAAkB,OAAOA,KAAmB,YAAY,aAAaA,IACjEA,EAAe,aACf,KAAA;GACN,UAAUH,EAAsB,IAAIlB,CAAI;GACxC,eAAeA,MAASS;EAC1B,CAAC;CACH;CAEA,EAAQ,MAAM,GAAG,MAAM;EAErB,IAAIe,EAAE,iBAAiB,CAACC,EAAE,eACxB,OAAO;EAET,IAAI,CAACD,EAAE,iBAAiBC,EAAE,eACxB,OAAO;EAIT,IAAID,EAAE,UAAU,KAAA,KAAaC,EAAE,UAAU,KAAA,GACvC,OAAO,OAAOD,EAAE,KAAK,IAAI,OAAOC,EAAE,KAAK;EAEzC,IAAID,EAAE,UAAU,KAAA,KAAaC,EAAE,UAAU,KAAA,GACvC,OAAO;EAET,IAAID,EAAE,UAAU,KAAA,KAAaC,EAAE,UAAU,KAAA,GACvC,OAAO;EAIT,IAAIV,GAA8B;GAEhC,IAAIS,EAAE,YAAY,CAACC,EAAE,UACnB,OAAO;GAET,IAAI,CAACD,EAAE,YAAYC,EAAE,UACnB,OAAO;EAEX;EAOA,OAJIX,MAA4B,UACvBZ,EAAS,QAAQsB,EAAE,MAAMC,EAAE,IAAI,IAGjC;CACT,CAAC;CAID,IAAM5B,IAAQ,OAAO,OAAOuB,EAAQ,KAAK,MAAWM,EAAO,IAAI,CAAC;CAYhE,OARI,OAAO3B,KAAe,YAAYA,MAChCiB,IACFA,EAAO,IAAIL,GAAU;EAAE;EAAU;CAAM,CAAC,IAExCR,EAAU,IAAIJ,mBAAY,IAAI,IAAI,CAAC,CAACY,GAAU;EAAE;EAAU;CAAM,CAAC,CAAC,CAAC,CAAC,IAIjEd;AACT"}
1
+ {"version":3,"file":"sort-property-names.js","names":["isTypeObject","resolve","reduceNamesToObject","names","properties","acc","name","prop","collator","sortCache","EMPTY_NAMES","sortPropertyNames","schema","discriminator","hideReadOnly","hideWriteOnly","orderSchemaPropertiesBy","orderRequiredPropertiesFirst","required","discriminatorName","cacheKey","bucket","cached","requiredPropertiesSet","shouldFilter","records","propertySchema","resolved","a","b","record"],"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,IAAaE,KAAuBC,GAAiBC,MACnDD,EAAM,QAAoBE,GAAKC,MAAS;CACtC,IAAMC,IAAOH,IAAaE;CAI1B,OAHIC,MACFF,EAAIC,KAAQC,IAEPF;AACT,GAAG,CAAC,CAAC,GAQDG,IAAW,IAAI,KAAK,SAAS,KAAA,CAAS,GA0CtCC,oBAAY,IAAI,QAA6C,GAG7DC,IAAiC,OAAO,OAAO,CAAC,CAAC,GAU1CC,KACXC,GACAC,GACA,EACEC,kBAAe,IACfC,mBAAgB,IAChBC,6BAA0B,SAC1BC,kCAA+B,OACpB,CAAC,MACQ;CACtB,IAAI,CAACjB,EAAaY,CAAM,KAAK,CAACA,EAAO,YACnC,OAAOF;CAGT,IAAMN,IAAaQ,EAAO,YACpBM,IAAWN,EAAO,UAClBO,IAAoBN,GAAe,cAInCO,IAAW;EACfD,MAAsB,KAAA,IAAY,KAAK,IAAIA;EAC3CL;EACAC;EACAC;EACAC;CACF,CAAC,CAAC,KAAK,GAAG,GAEJI,IAASZ,EAAU,IAAIL,CAAU,GACjCkB,IAASD,GAAQ,IAAID,CAAQ;CACnC,IAAIE,KAAUA,EAAO,aAAaJ,GAChC,OAAOI,EAAO;CAGhB,IAAMC,IAAwB,IAAI,IAAIL,KAAY,CAAC,CAAC,GAY9CM,IAAeV,KAAgBC,GAC/BU,IAA4B,CAAC;CAEnC,KAAK,IAAMnB,KAAQ,OAAO,KAAKF,CAAU,GAAG;EAC1C,IAAMsB,IAAiBtB,EAAWE;EAElC,IAAIkB,GAAc;GAChB,IAAMG,IAAW1B,EAAQ,OAAOyB,CAAc;GAK9C,IAHIZ,KAAgBa,GAAU,aAAa,MAGvCZ,KAAiBY,GAAU,cAAc,IAC3C;EAEJ;EAEAF,EAAQ,KAAK;GACXnB;GACA,OACEoB,KAAkB,OAAOA,KAAmB,YAAY,aAAaA,IACjEA,EAAe,aACf,KAAA;GACN,UAAUH,EAAsB,IAAIjB,CAAI;GACxC,eAAeA,MAASa;EAC1B,CAAC;CACH;CAEAM,EAAQ,MAAMG,GAAGC,MAAM;EAErB,IAAID,EAAE,iBAAiB,CAACC,EAAE,eACxB,OAAO;EAET,IAAI,CAACD,EAAE,iBAAiBC,EAAE,eACxB,OAAO;EAIT,IAAID,EAAE,UAAU,KAAA,KAAaC,EAAE,UAAU,KAAA,GACvC,OAAO,OAAOD,EAAE,KAAK,IAAI,OAAOC,EAAE,KAAK;EAEzC,IAAID,EAAE,UAAU,KAAA,KAAaC,EAAE,UAAU,KAAA,GACvC,OAAO;EAET,IAAID,EAAE,UAAU,KAAA,KAAaC,EAAE,UAAU,KAAA,GACvC,OAAO;EAIT,IAAIZ,GAA8B;GAEhC,IAAIW,EAAE,YAAY,CAACC,EAAE,UACnB,OAAO;GAET,IAAI,CAACD,EAAE,YAAYC,EAAE,UACnB,OAAO;EAEX;EAOA,OAJIb,MAA4B,UACvBR,EAAS,QAAQoB,EAAE,MAAMC,EAAE,IAAI,IAGjC;CACT,CAAC;CAID,IAAM1B,IAAQ,OAAO,OAAOsB,EAAQ,KAAKK,MAAWA,EAAO,IAAI,CAAC;CAYhE,OARI,OAAO1B,KAAe,YAAYA,MAChCiB,IACFA,EAAO,IAAID,GAAU;EAAEF;EAAUf;CAAM,CAAC,IAExCM,EAAU,IAAIL,mBAAY,IAAI,IAAI,CAAC,CAACgB,GAAU;EAAEF;EAAUf;CAAM,CAAC,CAAC,CAAC,CAAC,IAIjEA;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"unwrap-for-read.js","names":["unwrapForRead","unpackDetectChangesProxy","toRaw","value"],"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,IAAaA,KAAoB,MAAgBC,EAAyBC,EAAMC,CAAK,CAAC"}
1
+ {"version":3,"file":"unwrap-for-read.js","names":["toRaw","unpackDetectChangesProxy","unwrapForRead","value"],"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,IAAaE,KAAoBC,MAAgBF,EAAyBD,EAAMG,CAAK,CAAC"}
@@ -5,12 +5,12 @@ import { schemaTranslations as r } from "./localization/translations.js";
5
5
  import { protobufFieldNumber as i, protobufPresence as a } from "./protobuf-metadata.js";
6
6
  import { schemaRecursiveTarget as o } from "./recursive-metadata.js";
7
7
  import { REQUEST_BODY_COMPOSITION_INDEX_SYMBOL as s } from "./request-body-composition-index.js";
8
- import c from "./Schema.vue.js";
9
- import l from "./SchemaGlyphPuck.vue.js";
10
- import u from "./SchemaGutterToggle.vue.js";
11
- import d from "./SchemaHeading.vue.js";
12
- import f from "./SchemaObjectExampleCodeBlock.vue.js";
13
- import p from "./SchemaProperty.vue.js";
14
- import m from "./SchemaPropertyExamples.vue.js";
15
- import h from "./SchemaRailPanel.vue.js";
8
+ import c from "./Schema3.vue.js";
9
+ import l from "./SchemaGlyphPuck2.vue.js";
10
+ import u from "./SchemaGutterToggle2.vue.js";
11
+ import d from "./SchemaHeading3.vue.js";
12
+ import f from "./SchemaObjectExampleCodeBlock2.vue.js";
13
+ import p from "./SchemaProperty3.vue.js";
14
+ import m from "./SchemaPropertyExamples3.vue.js";
15
+ import h from "./SchemaRailPanel2.vue.js";
16
16
  export { n as LinkButton, s as REQUEST_BODY_COMPOSITION_INDEX_SYMBOL, c as Schema, l as SchemaGlyphPuck, u as SchemaGutterToggle, d as SchemaHeading, f as SchemaObjectExampleCodeBlock, p as SchemaProperty, m as SchemaPropertyExamples, h as SchemaRailPanel, t as inferDiscriminatorMappingComposition, i as protobufFieldNumber, a as protobufPresence, e as schemaDiscriminator, o as schemaRecursiveTarget, r as schemaTranslations };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["createLocalization","schemaTranslations","useLocalization"],"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,uBAAoBA,EAMjC;CACA,oBAAoBC;CACpB,eAAe;CACf,4BAAY,IAAI,IAAI;EAAC;EAAM;EAAM;EAAM;CAAI,CAAC;CAC5C,WAAW;AACb,CAAC"}
1
+ {"version":3,"file":"index.js","names":["schemaTranslations","createLocalization","useLocalization"],"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,EAAEE,uBAAoBD,EAMjC;CACA,oBAAoBD;CACpB,eAAe;CACf,4BAAY,IAAI,IAAI;EAAC;EAAM;EAAM;EAAM;CAAI,CAAC;CAC5C,WAAW;AACb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"translations.js","names":["schemaTranslations","zhCn","zhTw"],"sources":["../../../src/schema/localization/translations.ts"],"sourcesContent":["import { ar } from './locales/ar'\nimport { de } from './locales/de'\nimport { en } from './locales/en'\nimport { es } from './locales/es'\nimport { fr } from './locales/fr'\nimport { pt } from './locales/pt'\nimport { ru } from './locales/ru'\nimport { zhCn } from './locales/zh-cn'\nimport { zhTw } from './locales/zh-tw'\n\n/** Built-in schema translations, also composed into API Reference's public dictionary. */\nexport const schemaTranslations = { en, de, es, fr, pt, ru, ar, 'zh-CN': zhCn, 'zh-TW': zhTw }\n"],"mappings":";;;;;;;;;;AAWA,IAAaA,IAAqB;CAAE;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI,SAASC;CAAM,SAASC;AAAK"}
1
+ {"version":3,"file":"translations.js","names":["ar","de","en","es","fr","pt","ru","zhCn","zhTw","schemaTranslations"],"sources":["../../../src/schema/localization/translations.ts"],"sourcesContent":["import { ar } from './locales/ar'\nimport { de } from './locales/de'\nimport { en } from './locales/en'\nimport { es } from './locales/es'\nimport { fr } from './locales/fr'\nimport { pt } from './locales/pt'\nimport { ru } from './locales/ru'\nimport { zhCn } from './locales/zh-cn'\nimport { zhTw } from './locales/zh-tw'\n\n/** Built-in schema translations, also composed into API Reference's public dictionary. */\nexport const schemaTranslations = { en, de, es, fr, pt, ru, ar, 'zh-CN': zhCn, 'zh-TW': zhTw }\n"],"mappings":";;;;;;;;;;AAWA,IAAaS,IAAqB;CAAEP;CAAID;CAAIE;CAAIC;CAAIC;CAAIC;CAAIN;CAAI,SAASO;CAAM,SAASC;AAAK"}
@@ -1,8 +1,15 @@
1
- import e from "./Badge.vue_vue_type_script_setup_true_lang.js";
2
- /* empty css */
3
- import t from "../_virtual/_plugin-vue_export-helper.js";
4
- // src/shared/Badge.vue
5
- var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-7a577ad4"]]);
6
- export { n as default };
1
+ import { computed as e, createElementBlock as t, defineComponent as n, mergeProps as r, openBlock as i, renderSlot as a, unref as o } from "vue";
2
+ import { useBindCx as s } from "@scalar/use-hooks/useBindCx";
3
+ // src/shared/Badge.vue?vue&type=script&setup=true&lang.ts
4
+ var c = /*@__PURE__*/ n({
5
+ inheritAttrs: !1,
6
+ __name: "Badge",
7
+ props: { color: {} },
8
+ setup(n) {
9
+ let { cx: c } = s(), l = e(() => n.color ? { "--badge-color": n.color } : void 0);
10
+ return (e, s) => (i(), t("div", r(o(c)("badge inline-block rounded-2xl border bg-b-2 px-1.5 py-0.5 text-c-2 text-sm", n.color && "bg-(--badge-color) text-auto-contrast-(--badge-color)"), { style: l.value }), [a(e.$slots, "default", {}, void 0, !0)], 16));
11
+ }
12
+ });
13
+ export { c as default };
7
14
 
8
15
  //# sourceMappingURL=Badge.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.vue.js","names":["Badge_vue_vue_type_script_setup_true_lang_default","_plugin_vue_export_helper_default","Badge_default"],"sources":[],"mappings":""}
1
+ {"version":3,"file":"Badge.vue.js","names":["_openBlock","_createElementBlock","_mergeProps","_unref","_renderSlot","computed","createElementBlock","defineComponent","mergeProps","openBlock","renderSlot","unref","useBindCx","Badge_vue_vue_type_script_setup_true_lang_default","__props","cx","badgeStyle","_ctx","_cache"],"sources":["../../src/shared/Badge.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport { computed } from 'vue'\n\nconst { color } = defineProps<{\n color?: string\n}>()\n\n// Merge fallthrough classes via `cx` so consumer classes can override the base styles.\ndefineOptions({ inheritAttrs: false })\n\nconst { cx } = useBindCx()\n\n// The color only goes in as a custom property; `text-auto-contrast-*` derives\n// readable text from it in CSS, where the browser can read any color format.\nconst badgeStyle = computed(() =>\n color ? { '--badge-color': color } : undefined,\n)\n</script>\n\n<template>\n <div\n v-bind=\"\n cx(\n 'badge inline-block rounded-2xl border bg-b-2 px-1.5 py-0.5 text-c-2 text-sm',\n color && 'bg-(--badge-color) text-auto-contrast-(--badge-color)',\n )\n \"\n :style=\"badgeStyle\">\n <slot />\n </div>\n</template>\n\n<style scoped>\n/* Colour variants are keyed on the `text-*` class a consumer passes in. */\n.badge.text-orange {\n background: color-mix(in srgb, var(--scalar-color-orange), transparent 90%);\n border: transparent;\n}\n.badge.text-yellow {\n background: color-mix(in srgb, var(--scalar-color-yellow), transparent 90%);\n border: transparent;\n}\n.badge.text-red {\n background: color-mix(in srgb, var(--scalar-color-red), transparent 90%);\n border: transparent;\n}\n.badge.text-purple {\n background: color-mix(in srgb, var(--scalar-color-purple), transparent 90%);\n border: transparent;\n}\n.badge.text-green {\n background: color-mix(in srgb, var(--scalar-color-green), transparent 90%);\n border: transparent;\n}\n</style>\n"],"mappings":";;;;;;;;EAWA,IAAM,EAAEe,UAAOH,EAAU,GAInBI,IAAaX,QACjBS,EAAA,QAAQ,EAAE,iBAAiBA,EAAA,MAAM,IAAI,KAAA,CACvC;E,kBAIEd,EAAA,GAAAC,EASM,OATNC,EACiBC,EAAAY,CAAA,CAAE,C,+EAAiGD,EAAA,SAAK,uD,GAMtH,EAAA,OAAOE,EAAA,MAAU,CAAA,GAAA,CAClBZ,EAAQa,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,EAAA,C"}
@@ -0,0 +1,8 @@
1
+ import e from "./Badge.vue.js";
2
+ /* empty css */
3
+ import t from "../_virtual/_plugin-vue_export-helper.js";
4
+ // src/shared/Badge.vue
5
+ var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-7a577ad4"]]);
6
+ export { n as default };
7
+
8
+ //# sourceMappingURL=Badge3.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge3.vue.js","names":["Badge_vue_vue_type_script_setup_true_lang_default","_plugin_vue_export_helper_default","Badge_default"],"sources":[],"mappings":""}
@@ -2,6 +2,8 @@ import { type NodeInput } from '@scalar/workspace-store/helpers/get-resolved-ref
2
2
  import type { ExternalDocumentationObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
3
3
  type __VLS_Props = {
4
4
  value?: NodeInput<ExternalDocumentationObject>;
5
+ /** Use the spacing of the surrounding schema row. */
6
+ inline?: boolean;
5
7
  };
6
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
9
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalDocs.vue.d.ts","sourceRoot":"","sources":["../../src/shared/ExternalDocs.vue"],"names":[],"mappings":"AA2DA,OAAO,EAEL,KAAK,SAAS,EACf,MAAM,kDAAkD,CAAA;AACzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8DAA8D,CAAA;AAG/G,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC,2BAA2B,CAAC,CAAA;CAC/C,CAAC;AAkHF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"ExternalDocs.vue.d.ts","sourceRoot":"","sources":["../../src/shared/ExternalDocs.vue"],"names":[],"mappings":"AAiEA,OAAO,EAEL,KAAK,SAAS,EACf,MAAM,kDAAkD,CAAA;AACzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8DAA8D,CAAA;AAG/G,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC,2BAA2B,CAAC,CAAA;IAC9C,qDAAqD;IACrD,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAgHF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,6 +1,52 @@
1
- import e from "./ExternalDocs.vue_vue_type_script_setup_true_lang.js";
2
- // src/shared/ExternalDocs.vue
3
- var t = e;
4
- export { t as default };
1
+ import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, resolveDynamicComponent as c, toDisplayString as l, unref as u, withCtx as d } from "vue";
2
+ import { ScalarIconBook as f } from "@scalar/icons";
3
+ import { getResolvedRef as p } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
+ import { getDocumentationUrl as m } from "@scalar/workspace-store/helpers/documentation-url";
5
+ // src/shared/ExternalDocs.vue?vue&type=script&setup=true&lang.ts
6
+ var h = {
7
+ key: 0,
8
+ class: "ml-1 empty:hidden"
9
+ }, g = {
10
+ key: 1,
11
+ class: "ml-1 empty:hidden"
12
+ }, _ = /*@__PURE__*/ a({
13
+ __name: "ExternalDocs",
14
+ props: {
15
+ value: {},
16
+ inline: {
17
+ type: Boolean,
18
+ default: !1
19
+ }
20
+ },
21
+ setup(a) {
22
+ let _ = e(() => {
23
+ let e = p(a.value);
24
+ return e && typeof e.url == "string" && e.url ? e : void 0;
25
+ }), v = e(() => m(_.value?.url, _.value));
26
+ return (e, p) => _.value ? (s(), r("div", {
27
+ key: 0,
28
+ class: o(["group flex items-center", a.inline ? "max-w-full" : "narrow:border-r-0 border-r last:border-r-0"])
29
+ }, [(s(), t(c(v.value ? "a" : "span"), {
30
+ "aria-label": _.value.description || _.value.url,
31
+ class: o(["text-c-1 hover:bg-b-2 flex min-h-7 min-w-7 items-center rounded-lg px-2 py-1 no-underline", a.inline ? "wrap-anywhere" : "narrow:border mr-2 group-last:mr-0"]),
32
+ href: v.value,
33
+ rel: v.value ? "noopener noreferrer" : void 0,
34
+ target: v.value ? "_blank" : void 0
35
+ }, {
36
+ default: d(() => [i(u(f), {
37
+ class: "size-3 shrink-0 text-current",
38
+ weight: "bold"
39
+ }), _.value.description ? (s(), r("span", h, l(_.value.description), 1)) : (s(), r("span", g, l(_.value.url), 1))]),
40
+ _: 1
41
+ }, 8, [
42
+ "aria-label",
43
+ "class",
44
+ "href",
45
+ "rel",
46
+ "target"
47
+ ]))], 2)) : n("", !0);
48
+ }
49
+ });
50
+ export { _ as default };
5
51
 
6
52
  //# sourceMappingURL=ExternalDocs.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalDocs.vue.js","names":["ExternalDocs_vue_vue_type_script_setup_true_lang_default","ExternalDocs_default"],"sources":[],"mappings":""}
1
+ {"version":3,"file":"ExternalDocs.vue.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createBlock","_resolveDynamicComponent","_withCtx","_createVNode","_unref","_toDisplayString","computed","createBlock","createCommentVNode","createElementBlock","createVNode","defineComponent","normalizeClass","openBlock","resolveDynamicComponent","toDisplayString","unref","withCtx","ScalarIconBook","getResolvedRef","getDocumentationUrl","_hoisted_1","_hoisted_2","ExternalDocs_vue_vue_type_script_setup_true_lang_default","__props","documentation","resolved","url","_ctx","_cache"],"sources":["../../src/shared/ExternalDocs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconBook } from '@scalar/icons'\nimport { getDocumentationUrl } from '@scalar/workspace-store/helpers/documentation-url'\nimport {\n getResolvedRef,\n type NodeInput,\n} from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { ExternalDocumentationObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nconst { value, inline = false } = defineProps<{\n value?: NodeInput<ExternalDocumentationObject>\n /** Use the spacing of the surrounding schema row. */\n inline?: boolean\n}>()\n\nconst documentation = computed<ExternalDocumentationObject | undefined>(() => {\n const resolved = getResolvedRef(value)\n return resolved && typeof resolved.url === 'string' && resolved.url\n ? resolved\n : undefined\n})\n/** Unsafe URL protocols fall back to a plain-text label. */\nconst url = computed<string | undefined>(() =>\n getDocumentationUrl(documentation.value?.url, documentation.value),\n)\n</script>\n\n<template>\n <template v-if=\"documentation\">\n <div\n class=\"group flex items-center\"\n :class=\"\n inline ? 'max-w-full' : 'narrow:border-r-0 border-r last:border-r-0'\n \">\n <component\n :is=\"url ? 'a' : 'span'\"\n :aria-label=\"documentation.description || documentation.url\"\n class=\"text-c-1 hover:bg-b-2 flex min-h-7 min-w-7 items-center rounded-lg px-2 py-1 no-underline\"\n :class=\"inline ? 'wrap-anywhere' : 'narrow:border mr-2 group-last:mr-0'\"\n :href=\"url\"\n :rel=\"url ? 'noopener noreferrer' : undefined\"\n :target=\"url ? '_blank' : undefined\">\n <ScalarIconBook\n class=\"size-3 shrink-0 text-current\"\n weight=\"bold\" />\n <span\n v-if=\"documentation.description\"\n class=\"ml-1 empty:hidden\">\n {{ documentation.description }}\n </span>\n <span\n v-else\n class=\"ml-1 empty:hidden\">\n {{ documentation.url }}\n </span>\n </component>\n </div>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAgBA,IAAM4B,IAAgBnB,QAAwD;GAC5E,IAAMoB,IAAWP,EAAeK,EAAA,KAAK;GACrC,OAAOE,KAAY,OAAOA,EAAS,OAAQ,YAAYA,EAAS,MAC5DA,IACA,KAAA;EACN,CAAC,GAEKC,IAAMrB,QACVc,EAAoBK,EAAc,OAAO,KAAKA,EAAc,KAAK,CACnE;E,iBAIkBA,EAAA,SACd5B,EAAA,GAAAC,EA2BM,OAAA;;GA1BJ,OAAKC,EAAA,CAAC,2BACWyB,EAAA,SAAM,eAAA,4C;E,KAGvB3B,EAAA,GAAAG,EAqBYC,EApBL0B,EAAA,QAAG,MAAA,MAAA,GAAA;GACP,cAAYF,EAAA,MAAc,eAAeA,EAAA,MAAc;GACxD,OAAK1B,EAAA,CAAC,6FACEyB,EAAA,SAAM,kBAAA,oCAAA,CAAA;GACb,MAAMG,EAAA;GACN,KAAKA,EAAA,QAAG,wBAA2B,KAAA;GACnC,QAAQA,EAAA,QAAG,WAAc,KAAA;;GAC1B,SAAAzB,QAEkB,CAFlBC,EAEkBC,EAAAc,CAAA,GAAA;IADhB,OAAM;IACN,QAAO;G,IAEDO,EAAA,MAAc,eADtB5B,EAAA,GAAAC,EAIO,QAJPuB,GAIOhB,EADFoB,EAAA,MAAc,WAAW,GAAA,CAAA,MAE9B5B,EAAA,GAAAC,EAIO,QAJPwB,GAIOjB,EADFoB,EAAA,MAAc,GAAG,GAAA,CAAA,E"}
@@ -0,0 +1,6 @@
1
+ import e from "./ExternalDocs.vue.js";
2
+ // src/shared/ExternalDocs.vue
3
+ var t = e;
4
+ export { t as default };
5
+
6
+ //# sourceMappingURL=ExternalDocs2.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalDocs2.vue.js","names":["ExternalDocs_vue_vue_type_script_setup_true_lang_default","ExternalDocs_default"],"sources":[],"mappings":""}
@@ -1,6 +1,26 @@
1
- import e from "./ExternalExampleStatus.vue_vue_type_script_setup_true_lang.js";
2
- // src/shared/ExternalExampleStatus.vue
3
- var t = e;
4
- export { t as default };
1
+ import { useExternalExampleLocalization as e } from "./external-example-localization/index.js";
2
+ import { Fragment as t, createElementBlock as n, createTextVNode as r, createVNode as i, defineComponent as a, openBlock as o, toDisplayString as s, unref as c, withCtx as l } from "vue";
3
+ import { ScalarButton as u } from "@scalar/components/button";
4
+ // src/shared/ExternalExampleStatus.vue?vue&type=script&setup=true&lang.ts
5
+ var d = {
6
+ class: "text-c-2 p-4",
7
+ role: "status"
8
+ }, f = /*@__PURE__*/ a({
9
+ __name: "ExternalExampleStatus",
10
+ props: { failed: { type: Boolean } },
11
+ emits: ["retry"],
12
+ setup(a, { emit: f }) {
13
+ let p = f, { translate: m } = e();
14
+ return (e, f) => (o(), n("div", d, [a.failed ? (o(), n(t, { key: 0 }, [r(s(c(m)("externalExample.loadFailed")) + " ", 1), i(c(u), {
15
+ size: "sm",
16
+ variant: "ghost",
17
+ onClick: f[0] ||= (e) => p("retry")
18
+ }, {
19
+ default: l(() => [r(s(c(m)("externalExample.retry")), 1)]),
20
+ _: 1
21
+ })], 64)) : (o(), n(t, { key: 1 }, [r(s(c(m)("externalExample.loading")), 1)], 64))]));
22
+ }
23
+ });
24
+ export { f as default };
5
25
 
6
26
  //# sourceMappingURL=ExternalExampleStatus.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalExampleStatus.vue.js","names":["ExternalExampleStatus_vue_vue_type_script_setup_true_lang_default","ExternalExampleStatus_default"],"sources":[],"mappings":""}
1
+ {"version":3,"file":"ExternalExampleStatus.vue.js","names":["_openBlock","_createElementBlock","_Fragment","_createTextVNode","_toDisplayString","_unref","_createVNode","_withCtx","useExternalExampleLocalization","Fragment","createElementBlock","createTextVNode","createVNode","defineComponent","openBlock","toDisplayString","unref","withCtx","ScalarButton","_hoisted_1","ExternalExampleStatus_vue_vue_type_script_setup_true_lang_default","__props","__emit","emit","translate","_ctx","_cache","$event"],"sources":["../../src/shared/ExternalExampleStatus.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\n\nimport { useExternalExampleLocalization } from './external-example-localization'\n\nconst { failed } = defineProps<{\n /** Show the error message and Retry button after the download fails. */\n failed: boolean\n}>()\nconst emit = defineEmits<{ retry: [] }>()\n\nconst { translate } = useExternalExampleLocalization()\n</script>\n<template>\n <div\n class=\"text-c-2 p-4\"\n role=\"status\">\n <template v-if=\"failed\">\n {{ translate('externalExample.loadFailed') }}\n <ScalarButton\n size=\"sm\"\n variant=\"ghost\"\n @click=\"emit('retry')\">\n {{ translate('externalExample.retry') }}\n </ScalarButton>\n </template>\n <template v-else>{{ translate('externalExample.loading') }}</template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;EASA,IAAMuB,IAAOD,GAEP,EAAEE,iBAAchB,EAA+B;E,kBAGnDR,EAAA,GAAAC,EAaM,OAbNkB,GAaM,CAVYE,EAAA,UAAhBrB,EAAA,GAAAC,EAQWC,GAAA,EAAA,KAAA,EAAA,GAAA,CAPNC,EAAAC,EAAAC,EAAAmB,CAAA,CAAS,CAAA,4BAAA,CAAA,IAAiC,KAC7C,CAAA,GAAAlB,EAKeD,EAAAa,CAAA,GAAA;GAJb,MAAK;GACL,SAAQ;GACP,SAAKQ,EAAA,QAAAC,MAAEJ,EAAI,OAAA;;GACZ,SAAAhB,QAAwC,CAArCJ,EAAAC,EAAAC,EAAAmB,CAAA,CAAS,CAAA,uBAAA,CAAA,GAAA,CAAA,C;;E,aAGhBxB,EAAA,GAAAC,EAAsEC,GAAA,EAAA,KAAA,EAAA,GAAA,CAAlDC,EAAAC,EAAAC,EAAAmB,CAAA,CAAS,CAAA,yBAAA,CAAA,GAAA,CAAA,C"}
@@ -0,0 +1,6 @@
1
+ import e from "./ExternalExampleStatus.vue.js";
2
+ // src/shared/ExternalExampleStatus.vue
3
+ var t = e;
4
+ export { t as default };
5
+
6
+ //# sourceMappingURL=ExternalExampleStatus2.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalExampleStatus2.vue.js","names":["ExternalExampleStatus_vue_vue_type_script_setup_true_lang_default","ExternalExampleStatus_default"],"sources":[],"mappings":""}
@@ -1,6 +1,18 @@
1
- import e from "./ScreenReader.vue_vue_type_script_setup_true_lang.js";
2
- // src/shared/ScreenReader.vue
3
- var t = e;
4
- export { t as default };
1
+ import { createElementBlock as e, defineComponent as t, openBlock as n, renderSlot as r } from "vue";
2
+ // src/shared/ScreenReader.vue?vue&type=script&setup=true&lang.ts
3
+ var i = {
4
+ key: 0,
5
+ class: "screenreader-only"
6
+ }, a = /*@__PURE__*/ t({
7
+ __name: "ScreenReader",
8
+ props: { if: {
9
+ type: Boolean,
10
+ default: !0
11
+ } },
12
+ setup(t) {
13
+ return (t, a) => t.$props.if ? (n(), e("span", i, [r(t.$slots, "default")])) : r(t.$slots, "default", {}, void 0, void 0, 1);
14
+ }
15
+ });
16
+ export { a as default };
5
17
 
6
18
  //# sourceMappingURL=ScreenReader.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScreenReader.vue.js","names":["ScreenReader_vue_vue_type_script_setup_true_lang_default","ScreenReader_default"],"sources":[],"mappings":""}
1
+ {"version":3,"file":"ScreenReader.vue.js","names":["$props","_openBlock","_createElementBlock","_renderSlot","createElementBlock","defineComponent","openBlock","renderSlot","_hoisted_1","ScreenReader_vue_vue_type_script_setup_true_lang_default","__props","_ctx","_cache"],"sources":["../../src/shared/ScreenReader.vue"],"sourcesContent":["<script setup lang=\"ts\">\nwithDefaults(\n defineProps<{\n if?: boolean\n }>(),\n {\n if: true,\n },\n)\n</script>\n<template>\n <span\n v-if=\"$props.if\"\n class=\"screenreader-only\">\n <slot />\n </span>\n <slot v-else />\n</template>\n<!--\n `.screenreader-only` is declared globally in styles/tailwind.config.css rather\n than scoped here, so other components can hide text without wrapping it in\n this component.\n-->\n"],"mappings":";;;;;;;;;;;;E,iBAYUA,EAAAA,OAAO,MADfC,EAAA,GAAAC,EAIO,QAJPM,GAIO,CADLL,EAAQQ,EAAA,QAAA,SAAA,C,MAEVR,EAAeQ,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA"}
@@ -0,0 +1,6 @@
1
+ import e from "./ScreenReader.vue.js";
2
+ // src/shared/ScreenReader.vue
3
+ var t = e;
4
+ export { t as default };
5
+
6
+ //# sourceMappingURL=ScreenReader2.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScreenReader2.vue.js","names":["ScreenReader_vue_vue_type_script_setup_true_lang_default","ScreenReader_default"],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useExternalExampleLocalization","createLocalization","externalExampleTranslations"],"sources":["../../../src/shared/external-example-localization/index.ts"],"sourcesContent":["import { createLocalization } from '@scalar/localization'\nimport type { ApiReferenceTranslationKey, ApiReferenceTranslations } from '@scalar/types/api-reference'\n\nimport { externalExampleTranslations } from './translations'\n\n/** Inherits the host locale and overrides, with an English fallback for standalone blocks. */\nexport const { useLocalization: useExternalExampleLocalization } = createLocalization<\n Pick<ApiReferenceTranslations, 'externalExample'>,\n Extract<ApiReferenceTranslationKey, `externalExample.${string}`>\n>({\n localeTranslations: externalExampleTranslations,\n defaultLocale: 'en',\n rtlLocales: new Set(['ar', 'fa', 'he', 'ur']),\n logPrefix: '[@scalar/blocks/external-example]',\n})\n"],"mappings":";;;AAMA,IAAa,EAAE,iBAAiBA,MAAmCC,EAGjE;CACA,oBAAoBC;CACpB,eAAe;CACf,4BAAY,IAAI,IAAI;EAAC;EAAM;EAAM;EAAM;CAAI,CAAC;CAC5C,WAAW;AACb,CAAC"}
1
+ {"version":3,"file":"index.js","names":["externalExampleTranslations","createLocalization","useExternalExampleLocalization"],"sources":["../../../src/shared/external-example-localization/index.ts"],"sourcesContent":["import { createLocalization } from '@scalar/localization'\nimport type { ApiReferenceTranslationKey, ApiReferenceTranslations } from '@scalar/types/api-reference'\n\nimport { externalExampleTranslations } from './translations'\n\n/** Inherits the host locale and overrides, with an English fallback for standalone blocks. */\nexport const { useLocalization: useExternalExampleLocalization } = createLocalization<\n Pick<ApiReferenceTranslations, 'externalExample'>,\n Extract<ApiReferenceTranslationKey, `externalExample.${string}`>\n>({\n localeTranslations: externalExampleTranslations,\n defaultLocale: 'en',\n rtlLocales: new Set(['ar', 'fa', 'he', 'ur']),\n logPrefix: '[@scalar/blocks/external-example]',\n})\n"],"mappings":";;;AAMA,IAAa,EAAE,iBAAiBE,MAAmCD,EAGjE;CACA,oBAAoBD;CACpB,eAAe;CACf,4BAAY,IAAI,IAAI;EAAC;EAAM;EAAM;EAAM;CAAI,CAAC;CAC5C,WAAW;AACb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"translations.js","names":["externalExampleTranslations","zhCn","zhTw"],"sources":["../../../src/shared/external-example-localization/translations.ts"],"sourcesContent":["import type { ApiReferenceBuiltInLocale, ApiReferenceTranslations } from '@scalar/types/api-reference'\n\nimport { ar } from './locales/ar'\nimport { de } from './locales/de'\nimport { en } from './locales/en'\nimport { es } from './locales/es'\nimport { fr } from './locales/fr'\nimport { pt } from './locales/pt'\nimport { ru } from './locales/ru'\nimport { zhCn } from './locales/zh-cn'\nimport { zhTw } from './locales/zh-tw'\n\n/** Built-in external example status translations, shared with the API Reference dictionary. */\nexport const externalExampleTranslations = {\n en,\n de,\n es,\n fr,\n pt,\n ru,\n ar,\n 'zh-CN': zhCn,\n 'zh-TW': zhTw,\n} satisfies Record<ApiReferenceBuiltInLocale, Pick<ApiReferenceTranslations, 'externalExample'>>\n"],"mappings":";;;;;;;;;;AAaA,IAAaA,IAA8B;CACzC;CACA;CACA;CACA;CACA;CACA;CACA;CACA,SAASC;CACT,SAASC;AACX"}
1
+ {"version":3,"file":"translations.js","names":["ar","de","en","es","fr","pt","ru","zhCn","zhTw","externalExampleTranslations"],"sources":["../../../src/shared/external-example-localization/translations.ts"],"sourcesContent":["import type { ApiReferenceBuiltInLocale, ApiReferenceTranslations } from '@scalar/types/api-reference'\n\nimport { ar } from './locales/ar'\nimport { de } from './locales/de'\nimport { en } from './locales/en'\nimport { es } from './locales/es'\nimport { fr } from './locales/fr'\nimport { pt } from './locales/pt'\nimport { ru } from './locales/ru'\nimport { zhCn } from './locales/zh-cn'\nimport { zhTw } from './locales/zh-tw'\n\n/** Built-in external example status translations, shared with the API Reference dictionary. */\nexport const externalExampleTranslations = {\n en,\n de,\n es,\n fr,\n pt,\n ru,\n ar,\n 'zh-CN': zhCn,\n 'zh-TW': zhTw,\n} satisfies Record<ApiReferenceBuiltInLocale, Pick<ApiReferenceTranslations, 'externalExample'>>\n"],"mappings":";;;;;;;;;;AAaA,IAAaS,IAA8B;CACzCP;CACAD;CACAE;CACAC;CACAC;CACAC;CACAN;CACA,SAASO;CACT,SAASC;AACX"}
@@ -1,6 +1,6 @@
1
- import e from "./Badge.vue.js";
2
- import t from "./ExternalDocs.vue.js";
3
- import n from "./ExternalExampleStatus.vue.js";
1
+ import e from "./Badge3.vue.js";
2
+ import t from "./ExternalDocs2.vue.js";
3
+ import n from "./ExternalExampleStatus2.vue.js";
4
4
  import { externalExampleTranslations as r } from "./external-example-localization/translations.js";
5
- import i from "./ScreenReader.vue.js";
5
+ import i from "./ScreenReader2.vue.js";
6
6
  export { e as Badge, t as ExternalDocs, n as ExternalExampleStatus, i as ScreenReader, r as externalExampleTranslations };