@scalar/blocks 0.5.4 → 0.6.2

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 (249) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +13 -29
  3. package/dist/code-example/components/AsyncApiCodeExample.vue.d.ts +19 -0
  4. package/dist/code-example/components/AsyncApiCodeExample.vue.d.ts.map +1 -0
  5. package/dist/code-example/components/AsyncApiCodeExample.vue.js +9 -0
  6. package/dist/code-example/components/AsyncApiCodeExample.vue.js.map +1 -0
  7. package/dist/code-example/components/AsyncApiCodeExample.vue_vue_type_script_setup_true_lang.js +114 -0
  8. package/dist/code-example/components/AsyncApiCodeExample.vue_vue_type_script_setup_true_lang.js.map +1 -0
  9. package/dist/code-example/components/CodeExample.vue.js +4 -4
  10. package/dist/code-example/components/CodeExample.vue.js.map +1 -1
  11. package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js +258 -0
  12. package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js.map +1 -0
  13. package/dist/code-example/components/ExamplePicker.vue.js +1 -1
  14. package/dist/code-example/components/ExamplePicker.vue.js.map +1 -1
  15. package/dist/code-example/components/{ExamplePicker.vue.script.js → ExamplePicker.vue_vue_type_script_setup_true_lang.js} +5 -5
  16. package/dist/code-example/components/ExamplePicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
  17. package/dist/code-example/components/HttpMethod.vue.js +1 -1
  18. package/dist/code-example/components/HttpMethod.vue.js.map +1 -1
  19. package/dist/code-example/components/{HttpMethod.vue.script.js → HttpMethod.vue_vue_type_script_setup_true_lang.js} +1 -1
  20. package/dist/code-example/components/HttpMethod.vue_vue_type_script_setup_true_lang.js.map +1 -0
  21. package/dist/code-example/helpers/filter-clients-by-query.js.map +1 -1
  22. package/dist/code-example/helpers/find-client.js.map +1 -1
  23. package/dist/code-example/helpers/format-language.js.map +1 -1
  24. package/dist/code-example/helpers/generate-client-options.js.map +1 -1
  25. package/dist/code-example/helpers/generate-code-snippet.js.map +1 -1
  26. package/dist/code-example/helpers/get-asyncapi-example-context.d.ts +12 -0
  27. package/dist/code-example/helpers/get-asyncapi-example-context.d.ts.map +1 -0
  28. package/dist/code-example/helpers/get-asyncapi-example-context.js +33 -0
  29. package/dist/code-example/helpers/get-asyncapi-example-context.js.map +1 -0
  30. package/dist/code-example/helpers/get-clients.js.map +1 -1
  31. package/dist/code-example/helpers/get-custom-code-samples.js.map +1 -1
  32. package/dist/code-example/helpers/get-generated-payload-example.d.ts +4 -0
  33. package/dist/code-example/helpers/get-generated-payload-example.d.ts.map +1 -0
  34. package/dist/code-example/helpers/get-generated-payload-example.js +25 -0
  35. package/dist/code-example/helpers/get-generated-payload-example.js.map +1 -0
  36. package/dist/code-example/helpers/get-message-example-content.d.ts +10 -0
  37. package/dist/code-example/helpers/get-message-example-content.d.ts.map +1 -0
  38. package/dist/code-example/helpers/get-message-example-content.js +29 -0
  39. package/dist/code-example/helpers/get-message-example-content.js.map +1 -0
  40. package/dist/code-example/helpers/get-secrets.js.map +1 -1
  41. package/dist/code-example/helpers/get-snippet.js.map +1 -1
  42. package/dist/code-example/helpers/operation-to-har/operation-to-har.js +32 -32
  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.js +41 -47
  45. package/dist/code-example/helpers/operation-to-har/process-body.js.map +1 -1
  46. package/dist/code-example/helpers/operation-to-har/process-parameters.js +51 -55
  47. package/dist/code-example/helpers/operation-to-har/process-parameters.js.map +1 -1
  48. package/dist/code-example/helpers/operation-to-har/process-security-schemes.js +30 -38
  49. package/dist/code-example/helpers/operation-to-har/process-security-schemes.js.map +1 -1
  50. package/dist/code-example/helpers/operation-to-har/process-server-url.js +5 -1
  51. package/dist/code-example/helpers/operation-to-har/process-server-url.js.map +1 -1
  52. package/dist/code-example/index.d.ts +4 -0
  53. package/dist/code-example/index.d.ts.map +1 -1
  54. package/dist/code-example/index.js +17 -14
  55. package/dist/code-example/mount-asyncapi.d.ts +14 -0
  56. package/dist/code-example/mount-asyncapi.d.ts.map +1 -0
  57. package/dist/code-example/mount-asyncapi.js +27 -0
  58. package/dist/code-example/mount-asyncapi.js.map +1 -0
  59. package/dist/code-example/mount.d.ts +4 -2
  60. package/dist/code-example/mount.d.ts.map +1 -1
  61. package/dist/code-example/mount.js +39 -37
  62. package/dist/code-example/mount.js.map +1 -1
  63. package/dist/constants.js +1 -1
  64. package/dist/constants.js.map +1 -1
  65. package/dist/schema/LinkButton.vue.js.map +1 -1
  66. package/dist/schema/RenderString.vue.js +1 -1
  67. package/dist/schema/RenderString.vue.js.map +1 -1
  68. package/dist/schema/{RenderString.vue.script.js → RenderString.vue_vue_type_script_setup_true_lang.js} +1 -1
  69. package/dist/schema/RenderString.vue_vue_type_script_setup_true_lang.js.map +1 -0
  70. package/dist/schema/Schema.vue.js +2 -2
  71. package/dist/schema/Schema.vue.js.map +1 -1
  72. package/dist/schema/{Schema.vue.script.js → Schema.vue_vue_type_script_setup_true_lang.js} +1 -1
  73. package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js.map +1 -0
  74. package/dist/schema/SchemaCollapsedPreview.vue.js +1 -1
  75. package/dist/schema/SchemaCollapsedPreview.vue.js.map +1 -1
  76. package/dist/schema/{SchemaCollapsedPreview.vue.script.js → SchemaCollapsedPreview.vue_vue_type_script_setup_true_lang.js} +1 -1
  77. package/dist/schema/SchemaCollapsedPreview.vue_vue_type_script_setup_true_lang.js.map +1 -0
  78. package/dist/schema/SchemaComposition.vue.js +2 -2
  79. package/dist/schema/SchemaComposition.vue.js.map +1 -1
  80. package/dist/schema/{SchemaComposition.vue.script.js → SchemaComposition.vue_vue_type_script_setup_true_lang.js} +5 -5
  81. package/dist/schema/SchemaComposition.vue_vue_type_script_setup_true_lang.js.map +1 -0
  82. package/dist/schema/SchemaEnumPropertyItem.vue.js +1 -1
  83. package/dist/schema/SchemaEnumPropertyItem.vue.js.map +1 -1
  84. package/dist/schema/{SchemaEnumPropertyItem.vue.script.js → SchemaEnumPropertyItem.vue_vue_type_script_setup_true_lang.js} +1 -1
  85. package/dist/schema/SchemaEnumPropertyItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
  86. package/dist/schema/SchemaEnums.vue.js +2 -2
  87. package/dist/schema/SchemaEnums.vue.js.map +1 -1
  88. package/dist/schema/{SchemaEnums.vue.script.js → SchemaEnums.vue_vue_type_script_setup_true_lang.js} +1 -1
  89. package/dist/schema/SchemaEnums.vue_vue_type_script_setup_true_lang.js.map +1 -0
  90. package/dist/schema/SchemaGlyphPuck.vue.js +1 -1
  91. package/dist/schema/SchemaGlyphPuck.vue.js.map +1 -1
  92. package/dist/schema/{SchemaGlyphPuck.vue.script.js → SchemaGlyphPuck.vue_vue_type_script_setup_true_lang.js} +1 -1
  93. package/dist/schema/SchemaGlyphPuck.vue_vue_type_script_setup_true_lang.js.map +1 -0
  94. package/dist/schema/SchemaGutterToggle.vue.js +1 -1
  95. package/dist/schema/SchemaGutterToggle.vue.js.map +1 -1
  96. package/dist/schema/{SchemaGutterToggle.vue.script.js → SchemaGutterToggle.vue_vue_type_script_setup_true_lang.js} +1 -1
  97. package/dist/schema/SchemaGutterToggle.vue_vue_type_script_setup_true_lang.js.map +1 -0
  98. package/dist/schema/SchemaHeading.vue.js +2 -2
  99. package/dist/schema/SchemaHeading.vue.js.map +1 -1
  100. package/dist/schema/{SchemaHeading.vue.script.js → SchemaHeading.vue_vue_type_script_setup_true_lang.js} +1 -1
  101. package/dist/schema/SchemaHeading.vue_vue_type_script_setup_true_lang.js.map +1 -0
  102. package/dist/schema/SchemaObjectExampleCodeBlock.vue.js +1 -1
  103. package/dist/schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -1
  104. package/dist/schema/{SchemaObjectExampleCodeBlock.vue.script.js → SchemaObjectExampleCodeBlock.vue_vue_type_script_setup_true_lang.js} +1 -1
  105. package/dist/schema/SchemaObjectExampleCodeBlock.vue_vue_type_script_setup_true_lang.js.map +1 -0
  106. package/dist/schema/SchemaObjectProperties.vue.js +1 -1
  107. package/dist/schema/SchemaObjectProperties.vue.js.map +1 -1
  108. package/dist/schema/{SchemaObjectProperties.vue.script.js → SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js} +3 -3
  109. package/dist/schema/{SchemaObjectProperties.vue.script.js.map → SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js.map} +1 -1
  110. package/dist/schema/SchemaProperty.vue.js +2 -2
  111. package/dist/schema/SchemaProperty.vue.js.map +1 -1
  112. package/dist/schema/{SchemaProperty.vue.script.js → SchemaProperty.vue_vue_type_script_setup_true_lang.js} +3 -7
  113. package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js.map +1 -0
  114. package/dist/schema/SchemaPropertyDefault.vue.js +2 -2
  115. package/dist/schema/SchemaPropertyDefault.vue.js.map +1 -1
  116. package/dist/schema/{SchemaPropertyDefault.vue.script.js → SchemaPropertyDefault.vue_vue_type_script_setup_true_lang.js} +1 -1
  117. package/dist/schema/SchemaPropertyDefault.vue_vue_type_script_setup_true_lang.js.map +1 -0
  118. package/dist/schema/SchemaPropertyDetail.vue.js +2 -2
  119. package/dist/schema/SchemaPropertyDetail.vue.js.map +1 -1
  120. package/dist/schema/{SchemaPropertyDetail.vue.script.js → SchemaPropertyDetail.vue_vue_type_script_setup_true_lang.js} +1 -1
  121. package/dist/schema/SchemaPropertyDetail.vue_vue_type_script_setup_true_lang.js.map +1 -0
  122. package/dist/schema/SchemaPropertyExamples.vue.d.ts +2 -0
  123. package/dist/schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
  124. package/dist/schema/SchemaPropertyExamples.vue.js +3 -3
  125. package/dist/schema/SchemaPropertyExamples.vue.js.map +1 -1
  126. package/dist/schema/{SchemaPropertyExamples.vue.script.js → SchemaPropertyExamples.vue_vue_type_script_setup_true_lang.js} +10 -3
  127. package/dist/schema/SchemaPropertyExamples.vue_vue_type_script_setup_true_lang.js.map +1 -0
  128. package/dist/schema/SchemaPropertyHeading.vue.js +2 -2
  129. package/dist/schema/SchemaPropertyHeading.vue.js.map +1 -1
  130. package/dist/schema/{SchemaPropertyHeading.vue.script.js → SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js} +1 -1
  131. package/dist/schema/SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js.map +1 -0
  132. package/dist/schema/SchemaPropertyPattern.vue.js +2 -2
  133. package/dist/schema/SchemaPropertyPattern.vue.js.map +1 -1
  134. package/dist/schema/{SchemaPropertyPattern.vue.script.js → SchemaPropertyPattern.vue_vue_type_script_setup_true_lang.js} +1 -1
  135. package/dist/schema/SchemaPropertyPattern.vue_vue_type_script_setup_true_lang.js.map +1 -0
  136. package/dist/schema/SchemaRailPanel.vue.js +1 -1
  137. package/dist/schema/SchemaRailPanel.vue.js.map +1 -1
  138. package/dist/schema/{SchemaRailPanel.vue.script.js → SchemaRailPanel.vue_vue_type_script_setup_true_lang.js} +1 -1
  139. package/dist/schema/SchemaRailPanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
  140. package/dist/schema/components/CopyLinkButton.vue.js +1 -1
  141. package/dist/schema/components/CopyLinkButton.vue.js.map +1 -1
  142. package/dist/schema/components/{CopyLinkButton.vue.script.js → CopyLinkButton.vue_vue_type_script_setup_true_lang.js} +1 -1
  143. package/dist/schema/components/CopyLinkButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
  144. package/dist/schema/components/WithBreadcrumb.vue.js +1 -1
  145. package/dist/schema/components/WithBreadcrumb.vue.js.map +1 -1
  146. package/dist/schema/components/{WithBreadcrumb.vue.script.js → WithBreadcrumb.vue_vue_type_script_setup_true_lang.js} +1 -1
  147. package/dist/schema/components/WithBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -0
  148. package/dist/schema/discriminator-metadata.js.map +1 -1
  149. package/dist/schema/expansion/index.js +1 -2
  150. package/dist/schema/helpers/dynamic-scope.js.map +1 -1
  151. package/dist/schema/helpers/format-example.js.map +1 -1
  152. package/dist/schema/helpers/format-value.js.map +1 -1
  153. package/dist/schema/helpers/get-compositions-to-render.js.map +1 -1
  154. package/dist/schema/helpers/get-discriminator-values.js.map +1 -1
  155. package/dist/schema/helpers/get-enum-values.js.map +1 -1
  156. package/dist/schema/helpers/get-property-description.js.map +1 -1
  157. package/dist/schema/helpers/get-ref-name.js.map +1 -1
  158. package/dist/schema/helpers/get-schema-type.js.map +1 -1
  159. package/dist/schema/helpers/get-type-signature-tokens.js.map +1 -1
  160. package/dist/schema/helpers/has-complex-array-items.js.map +1 -1
  161. package/dist/schema/helpers/is-empty-schema-object.js.map +1 -1
  162. package/dist/schema/helpers/is-model-linkable.js.map +1 -1
  163. package/dist/schema/helpers/is-on-schema-target-path.js.map +1 -1
  164. package/dist/schema/helpers/is-type-object.js.map +1 -1
  165. package/dist/schema/helpers/merge-all-of-schemas.js +24 -25
  166. package/dist/schema/helpers/merge-all-of-schemas.js.map +1 -1
  167. package/dist/schema/helpers/normalize-object-composition.js.map +1 -1
  168. package/dist/schema/helpers/optimize-value-for-display.js +5 -12
  169. package/dist/schema/helpers/optimize-value-for-display.js.map +1 -1
  170. package/dist/schema/helpers/partition-all-of-compositions.js.map +1 -1
  171. package/dist/schema/helpers/schema-composition.js.map +1 -1
  172. package/dist/schema/helpers/schema-cycle.js.map +1 -1
  173. package/dist/schema/helpers/schema-expansion.js +4 -5
  174. package/dist/schema/helpers/schema-expansion.js.map +1 -1
  175. package/dist/schema/helpers/schema-keyboard-nav.js.map +1 -1
  176. package/dist/schema/helpers/schema-name.js.map +1 -1
  177. package/dist/schema/helpers/should-display-description.js.map +1 -1
  178. package/dist/schema/helpers/should-display-heading.js.map +1 -1
  179. package/dist/schema/helpers/should-render-array-item-composition.js.map +1 -1
  180. package/dist/schema/helpers/sort-property-names.js.map +1 -1
  181. package/dist/schema/helpers/unwrap-for-read.js.map +1 -1
  182. package/dist/schema/index.d.ts +1 -0
  183. package/dist/schema/index.d.ts.map +1 -1
  184. package/dist/schema/index.js +6 -5
  185. package/dist/schema/localization/index.d.ts +1 -1
  186. package/dist/schema/localization/index.js.map +1 -1
  187. package/dist/schema/localization/locales/ar.js.map +1 -1
  188. package/dist/schema/localization/locales/de.js.map +1 -1
  189. package/dist/schema/localization/locales/en.js.map +1 -1
  190. package/dist/schema/localization/locales/es.js.map +1 -1
  191. package/dist/schema/localization/locales/fr.js.map +1 -1
  192. package/dist/schema/localization/locales/pt.js.map +1 -1
  193. package/dist/schema/localization/locales/ru.js.map +1 -1
  194. package/dist/schema/localization/locales/zh-cn.js.map +1 -1
  195. package/dist/schema/localization/locales/zh-tw.js.map +1 -1
  196. package/dist/schema/localization/translations.js.map +1 -1
  197. package/dist/schema/request-body-composition-index.js.map +1 -1
  198. package/dist/shared/Badge.vue.js +2 -2
  199. package/dist/shared/Badge.vue.js.map +1 -1
  200. package/dist/shared/{Badge.vue.script.js → Badge.vue_vue_type_script_setup_true_lang.js} +1 -1
  201. package/dist/shared/Badge.vue_vue_type_script_setup_true_lang.js.map +1 -0
  202. package/dist/shared/ExternalDocs.vue.js +1 -1
  203. package/dist/shared/ExternalDocs.vue.js.map +1 -1
  204. package/dist/shared/{ExternalDocs.vue.script.js → ExternalDocs.vue_vue_type_script_setup_true_lang.js} +1 -1
  205. package/dist/shared/ExternalDocs.vue_vue_type_script_setup_true_lang.js.map +1 -0
  206. package/dist/shared/ScreenReader.vue.js +1 -1
  207. package/dist/shared/ScreenReader.vue.js.map +1 -1
  208. package/dist/shared/{ScreenReader.vue.script.js → ScreenReader.vue_vue_type_script_setup_true_lang.js} +1 -1
  209. package/dist/shared/ScreenReader.vue_vue_type_script_setup_true_lang.js.map +1 -0
  210. package/dist/specification-extensions/ExtensionValue.vue.js +1 -1
  211. package/dist/specification-extensions/ExtensionValue.vue.js.map +1 -1
  212. package/dist/specification-extensions/{ExtensionValue.vue.script.js → ExtensionValue.vue_vue_type_script_setup_true_lang.js} +1 -1
  213. package/dist/specification-extensions/ExtensionValue.vue_vue_type_script_setup_true_lang.js.map +1 -0
  214. package/dist/specification-extensions/SpecificationExtensions.vue.js +1 -1
  215. package/dist/specification-extensions/SpecificationExtensions.vue.js.map +1 -1
  216. package/dist/specification-extensions/{SpecificationExtensions.vue.script.js → SpecificationExtensions.vue_vue_type_script_setup_true_lang.js} +1 -1
  217. package/dist/specification-extensions/SpecificationExtensions.vue_vue_type_script_setup_true_lang.js.map +1 -0
  218. package/dist/specification-extensions/index.js +1 -2
  219. package/dist/style.css +68 -31
  220. package/dist/vue-styles.css +1 -1
  221. package/package.json +23 -23
  222. package/dist/code-example/components/CodeExample.vue.script.js +0 -258
  223. package/dist/code-example/components/CodeExample.vue.script.js.map +0 -1
  224. package/dist/code-example/components/ExamplePicker.vue.script.js.map +0 -1
  225. package/dist/code-example/components/HttpMethod.vue.script.js.map +0 -1
  226. package/dist/schema/RenderString.vue.script.js.map +0 -1
  227. package/dist/schema/Schema.vue.script.js.map +0 -1
  228. package/dist/schema/SchemaCollapsedPreview.vue.script.js.map +0 -1
  229. package/dist/schema/SchemaComposition.vue.script.js.map +0 -1
  230. package/dist/schema/SchemaEnumPropertyItem.vue.script.js.map +0 -1
  231. package/dist/schema/SchemaEnums.vue.script.js.map +0 -1
  232. package/dist/schema/SchemaGlyphPuck.vue.script.js.map +0 -1
  233. package/dist/schema/SchemaGutterToggle.vue.script.js.map +0 -1
  234. package/dist/schema/SchemaHeading.vue.script.js.map +0 -1
  235. package/dist/schema/SchemaObjectExampleCodeBlock.vue.script.js.map +0 -1
  236. package/dist/schema/SchemaProperty.vue.script.js.map +0 -1
  237. package/dist/schema/SchemaPropertyDefault.vue.script.js.map +0 -1
  238. package/dist/schema/SchemaPropertyDetail.vue.script.js.map +0 -1
  239. package/dist/schema/SchemaPropertyExamples.vue.script.js.map +0 -1
  240. package/dist/schema/SchemaPropertyHeading.vue.script.js.map +0 -1
  241. package/dist/schema/SchemaPropertyPattern.vue.script.js.map +0 -1
  242. package/dist/schema/SchemaRailPanel.vue.script.js.map +0 -1
  243. package/dist/schema/components/CopyLinkButton.vue.script.js.map +0 -1
  244. package/dist/schema/components/WithBreadcrumb.vue.script.js.map +0 -1
  245. package/dist/shared/Badge.vue.script.js.map +0 -1
  246. package/dist/shared/ExternalDocs.vue.script.js.map +0 -1
  247. package/dist/shared/ScreenReader.vue.script.js.map +0 -1
  248. package/dist/specification-extensions/ExtensionValue.vue.script.js.map +0 -1
  249. package/dist/specification-extensions/SpecificationExtensions.vue.script.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createElementBlock","_normalizeClass","_renderSlot","_createCommentVNode","_toDisplayString","_unref","_Fragment","_createBlock","SchemaPropertyDetail","_withCtx","_createElementVNode","_renderList","_createTextVNode","_createSlots","_createVNode","Badge","RenderString","SchemaPropertyDefault","SchemaPropertyPattern","SchemaPropertyExamples","Badge_default","RenderString_default","SchemaPropertyDefault_default","SchemaPropertyDetail_default","SchemaPropertyExamples_default","SchemaPropertyPattern_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","SchemaPropertyHeading_vue_vue_type_script_setup_true_lang_default","props","__props","useLocalization","valueRef","toRef","constValue","computed","schema","isArraySchema","items","resolve","isDefined","getLeafConstraints","properties","isStringSchema","translate","isNumberSchema","validationProperties","modelLink","getModelNameWithArray","modelLinkable","isModelLinkable","signatureTokens","getDisplayTypeSignatureTokens","shouldShowType","propertyNamesDetail","parts","getSchemaType","detail","exampleValue","itemsSchema","hasExampleContent","examples","patternValue","openBlock","createElementBlock","_ctx","normalizeClass","renderSlot","createCommentVNode","toDisplayString","unref","Fragment","createBlock","withCtx","createElementVNode","_cache","renderList","index","createTextVNode","token","property","createSlots","createVNode"],"sources":["../../src/schema/SchemaPropertyHeading.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport {\n isArraySchema,\n isNumberSchema,\n isStringSchema,\n} from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\nimport { computed, toRef } from 'vue'\n\nimport Badge from '../shared/Badge.vue'\nimport { getSchemaType } from './helpers/get-schema-type'\nimport { getDisplayTypeSignatureTokens } from './helpers/get-type-signature-tokens'\nimport {\n isModelLinkable,\n type ModelLinkOptions,\n} from './helpers/is-model-linkable'\nimport { getModelNameWithArray } from './helpers/schema-name'\nimport { useLocalization } from './localization'\nimport RenderString from './RenderString.vue'\nimport SchemaPropertyDefault from './SchemaPropertyDefault.vue'\nimport SchemaPropertyDetail from './SchemaPropertyDetail.vue'\nimport SchemaPropertyExamples from './SchemaPropertyExamples.vue'\nimport SchemaPropertyPattern from './SchemaPropertyPattern.vue'\n\nconst props = withDefaults(\n defineProps<{\n value: SchemaObject | undefined\n enum?: boolean\n isDiscriminator?: boolean\n /** Effective AsyncAPI variant value, separate from const/enum constraints. */\n discriminatorValue?: string\n required?: boolean\n additional?: boolean\n withExamples?: boolean\n hideModelNames?: boolean\n /**\n * Config for deciding whether a model name links to the models section. When the section or\n * the referenced model is hidden there is nothing to scroll to, so the name renders as plain text.\n */\n modelLinkOptions?: ModelLinkOptions\n /** When the schema was resolved from a $ref, pass the ref name so it displays as e.g. \"Data\" instead of \"object\". */\n modelName?: string | null\n /** Resolved propertyNames schema, used to surface key constraints like `format` for additional properties. */\n propertyNames?: SchemaObject\n eventBus?: WorkspaceEventBus | null\n /**\n * The row's name is a stand-in for keys the caller chooses\n * (`additionalProperties`) or keys matching a regex (`patternProperties`),\n * not a literal property. The heading says so in the signature line, where\n * the tree already describes shapes, instead of styling the name itself.\n */\n keyKind?: 'additional' | 'pattern'\n /**\n * The name of the schema this row loops back to. A cut cycle is a leaf, so\n * the signature line says why it does not expand; the model link beside it\n * already names the schema the loop returns to.\n */\n recursiveTo?: string\n }>(),\n {\n isDiscriminator: false,\n required: false,\n withExamples: true,\n hideModelNames: false,\n eventBus: null,\n },\n)\nconst { translate } = useLocalization()\n\n// Convert to reactive refs for composables\nconst valueRef = toRef(props, 'value')\n\nconst constValue = computed(() => {\n if (!valueRef.value) {\n return undefined\n }\n\n const schema = valueRef.value\n\n // Direct const value\n if (schema.const !== undefined) {\n return schema.const\n }\n\n // Single-item enum acts as const\n if (schema.enum?.length === 1) {\n return schema.enum[0]\n }\n\n // Check items for const values (for arrays)\n if (isArraySchema(schema) && schema.items) {\n const items = resolve.schema(schema.items)\n\n if (isDefined(items.const)) {\n return items.const\n }\n\n if (items.enum?.length === 1) {\n return items.enum[0]\n }\n }\n\n return undefined\n})\n\ntype ValidationProperty = {\n key: string\n value: string | number\n prefix?: string\n code?: boolean\n truncate?: boolean\n}\n\n/**\n * Constraints that live on a leaf (string or number) schema: length, pattern,\n * format and numeric ranges. Extracted so they can be surfaced for a primitive\n * schema as well as for a primitive array's items, which are not rendered on\n * their own. See https://github.com/scalar/scalar/issues/9690\n */\nconst getLeafConstraints = (schema: SchemaObject) => {\n const properties: ValidationProperty[] = []\n\n if (isStringSchema(schema)) {\n if (schema.minLength) {\n properties.push({\n key: 'min-length',\n prefix: `${translate('schema.minLength')}: `,\n value: schema.minLength,\n })\n }\n\n if (schema.maxLength) {\n properties.push({\n key: 'max-length',\n prefix: `${translate('schema.maxLength')}: `,\n value: schema.maxLength,\n })\n }\n\n // pattern is rendered via SchemaPropertyPattern (hover dropdown), skip here\n }\n\n if ((isStringSchema(schema) || isNumberSchema(schema)) && schema.format) {\n properties.push({\n key: 'format',\n value: schema.format,\n truncate: true,\n })\n }\n\n if (isNumberSchema(schema)) {\n if (isDefined(schema.exclusiveMinimum)) {\n properties.push({\n key: 'exclusive-minimum',\n prefix: `${translate('schema.greaterThan')}: `,\n value: schema.exclusiveMinimum,\n })\n }\n\n if (isDefined(schema.minimum)) {\n properties.push({\n key: 'minimum',\n prefix: `${translate('schema.min')}: `,\n value: schema.minimum,\n })\n }\n\n if (isDefined(schema.exclusiveMaximum)) {\n properties.push({\n key: 'exclusive-maximum',\n prefix: `${translate('schema.lessThan')}: `,\n value: schema.exclusiveMaximum,\n })\n }\n\n if (isDefined(schema.maximum)) {\n properties.push({\n key: 'maximum',\n prefix: `${translate('schema.max')}: `,\n value: schema.maximum,\n })\n }\n\n if (isDefined(schema.multipleOf)) {\n properties.push({\n key: 'multiple-of',\n prefix: `${translate('schema.multipleOf')}: `,\n value: schema.multipleOf,\n })\n }\n }\n\n return properties\n}\n\nconst validationProperties = computed(() => {\n if (!valueRef.value) {\n return []\n }\n\n const schema = valueRef.value\n const properties: ValidationProperty[] = []\n\n // Array validation properties\n if (isArraySchema(schema)) {\n if (schema.minItems || schema.maxItems) {\n properties.push({\n key: 'array-range',\n value: `${schema.minItems || ''}…${schema.maxItems || ''}`,\n })\n }\n\n // Unique items\n if (schema.uniqueItems) {\n properties.push({\n key: 'unique-items',\n value: `${translate('schema.unique')}!`,\n })\n }\n }\n\n properties.push(...getLeafConstraints(schema))\n\n // Primitive array items carry their own constraints (e.g. an array of `uuid`\n // strings) but are not rendered separately, so surface them here.\n if (isArraySchema(schema) && schema.items) {\n properties.push(...getLeafConstraints(resolve.schema(schema.items)))\n }\n\n return properties\n})\n\n/** Link data for navigating to the referenced model in the sidebar. */\nconst modelLink = computed(() => {\n if (!props.value) {\n return null\n }\n\n if (props.hideModelNames) {\n return null\n }\n\n if (props.modelName) {\n return { schemaKey: props.modelName, label: props.modelName }\n }\n\n return getModelNameWithArray(props.value)\n})\n\n/** Whether the model name links to the models section, or renders as plain text. */\nconst modelLinkable = computed(() =>\n isModelLinkable(modelLink.value?.schemaKey, props.modelLinkOptions ?? {}),\n)\n\n/**\n * The type as a run of tokens rather than a single string — identifiers in\n * the code face, English words like `array of` in the sans face, and a muted\n * `|` so `string | null` reads as one type with an alternative.\n *\n * The token run and the screen-reader label are written straight into the\n * template instead of being their own components: the tree mounts one per\n * typed row, and a component instance costs more to create than the span it\n * renders. On a flat object the type cells would be most of the instance\n * count. The linked and the plain copy of the token markup below must stay\n * identical.\n */\nconst signatureTokens = computed(() =>\n getDisplayTypeSignatureTokens(props.value, {\n hideModelNames: props.hideModelNames,\n modelName: modelLink.value?.label,\n }),\n)\n\n/** Check if we should show the type information */\nconst shouldShowType = computed(() => {\n if (!props.value || !('type' in props.value)) {\n return false\n }\n\n // Always show type for arrays, even when items have const values\n if (props.value.type === 'array') {\n return true\n }\n\n // For non-arrays, only show if no const value at the schema level\n return !constValue.value\n})\n\n/**\n * Type and format of the property keys, derived from the propertyNames schema.\n *\n * For a map keyed by UUIDs this renders e.g. \"string · uuid\" so the key\n * constraints are not lost. Returns undefined when there is nothing to show.\n */\nconst propertyNamesDetail = computed(() => {\n const schema = props.propertyNames\n if (!schema) {\n return undefined\n }\n\n const parts = [getSchemaType(schema)]\n if ('format' in schema && typeof schema.format === 'string') {\n parts.push(schema.format)\n }\n\n const detail = parts.filter(Boolean).join(' · ')\n return detail.length > 0 ? detail : undefined\n})\n\nconst exampleValue = computed(() => {\n // Treat only `undefined` as \"not set\" — `null` is a valid example value on a nullable schema.\n if (\n props.value &&\n 'example' in props.value &&\n props.value.example !== undefined\n ) {\n return props.value.example\n }\n\n if (props.value && isArraySchema(props.value)) {\n const itemsSchema = resolve.schema(props.value.items)\n if (\n itemsSchema &&\n 'example' in itemsSchema &&\n itemsSchema.example !== undefined\n ) {\n return itemsSchema.example\n }\n }\n\n return undefined\n})\n\n/**\n * Whether the examples chip has anything to render.\n *\n * `SchemaPropertyExamples` already renders nothing without an example, but it\n * still mounts, and mounting is what installs its popup's window-level click\n * and keydown listeners. `withExamples` defaults to true, so without this gate\n * every property row on the page — including a plain `{ type: 'string' }` —\n * pays for a popup it never opens. Mirrors the component's own two branches.\n */\nconst hasExampleContent = computed((): boolean => {\n if (exampleValue.value !== undefined) {\n return true\n }\n\n const examples = props.value?.examples\n\n return (\n !!examples &&\n typeof examples === 'object' &&\n Object.keys(examples).length > 0\n )\n})\n\n/**\n * The regex `pattern` to surface via the hover dropdown. It lives on a string\n * schema, or on the items of a primitive array (which is not rendered on its\n * own, so its constraints are surfaced on the array heading — see\n * https://github.com/scalar/scalar/issues/9690).\n */\nconst patternValue = computed(() => {\n const schema = valueRef.value\n if (!schema) {\n return undefined\n }\n\n if (isStringSchema(schema) && schema.pattern) {\n return schema.pattern\n }\n\n if (isArraySchema(schema) && schema.items) {\n const items = resolve.schema(schema.items)\n if (isStringSchema(items) && items.pattern) {\n return items.pattern\n }\n }\n\n return undefined\n})\n</script>\n<template>\n <div\n class=\"property-heading [&>.property-detail:has(+.property-detail)]:mr-0\">\n <!-- `:has(+.property-detail)`: only a detail FOLLOWED BY another detail\n drops its right margin, because the `·` separator supplies the gap\n there. Not `:not(:last-of-type)`, which matches by element type: the\n collapsed preview and the trailing copy-link are spans as well, so it\n would strip the margin from the final detail and glue \"Addressrequired\"\n together on a collapsed row. -->\n <div\n v-if=\"$slots.name\"\n class=\"property-name\"\n :class=\"{ deprecated: props.value?.deprecated }\">\n <slot name=\"name\" />\n </div>\n <div\n v-if=\"props.isDiscriminator\"\n class=\"property-discriminator\">\n {{ translate('schema.discriminator') }}\n </div>\n <template v-if=\"props.value\">\n <!-- A map key reads `additionalProperty · string`: the keyword leads the\n detail list in the accent colour, like a type word, so the name\n above it can look like every other name. -->\n <SchemaPropertyDetail\n v-if=\"props.keyKind\"\n class=\"property-key-kind\">\n <span class=\"font-code text-c-accent\">{{\n props.keyKind === 'pattern' ? 'patternProperty' : 'additionalProperty'\n }}</span>\n </SchemaPropertyDetail>\n <!-- Type information -->\n <SchemaPropertyDetail\n v-if=\"shouldShowType\"\n truncate>\n <!-- The type is a token run (`array of Planet`) and a $ref link IS the\n type, not an appended `· Account` -->\n <!-- Written across lines on purpose: Vue drops whitespace-only text\n between two elements, so a single-line label would read\n `Type:string`. -->\n <span class=\"screenreader-only\"> {{ translate('schema.type') }}: </span>\n <button\n v-if=\"props.eventBus && modelLink?.schemaKey && modelLinkable\"\n class=\"text-c-2 hover:text-c-1 underline\"\n type=\"button\"\n @click=\"\n props.eventBus.emit('scroll-to:model-by-name', {\n name: modelLink.schemaKey,\n })\n \">\n <span\n v-if=\"signatureTokens.length\"\n class=\"property-type-signature text-c-2 text-(length:--scalar-mini)\">\n <template\n v-for=\"(token, index) in signatureTokens\"\n :key=\"index\">\n {{ index > 0 ? ' ' : ''\n }}<span\n class=\"property-type-token\"\n :class=\"[\n `property-type-token--${token.kind}`,\n token.kind === 'word' ? 'font-sans' : '',\n token.kind === 'ident' || token.kind === 'literal'\n ? 'font-code'\n : '',\n token.kind === 'punctuation' ? 'text-c-2' : '',\n ]\"\n >{{ token.text }}</span\n >\n </template>\n </span>\n </button>\n <span\n v-else-if=\"signatureTokens.length\"\n class=\"property-type-signature text-c-2 text-(length:--scalar-mini)\">\n <template\n v-for=\"(token, index) in signatureTokens\"\n :key=\"index\">\n {{ index > 0 ? ' ' : ''\n }}<span\n class=\"property-type-token\"\n :class=\"[\n `property-type-token--${token.kind}`,\n token.kind === 'word' ? 'font-sans' : '',\n token.kind === 'ident' || token.kind === 'literal'\n ? 'font-code'\n : '',\n token.kind === 'punctuation' ? 'text-c-2' : '',\n ]\"\n >{{ token.text }}</span\n >\n </template>\n </span>\n </SchemaPropertyDetail>\n\n <!-- A cycle reads `array of Satellite · recursive`, a modifier like\n `nullable`; the full sentence rides the tooltip. -->\n <SchemaPropertyDetail\n v-if=\"props.recursiveTo\"\n class=\"property-recursive\"\n :title=\"\n translate('schema.recursiveReference', { name: props.recursiveTo })\n \">\n {{ translate('schema.recursive') }}\n </SchemaPropertyDetail>\n\n <!-- Key constraints from propertyNames (e.g. \"keys: string · uuid\") -->\n <SchemaPropertyDetail\n v-if=\"propertyNamesDetail\"\n truncate>\n <template #prefix>{{ translate('schema.keys') }}:</template>\n {{ propertyNamesDetail }}\n </SchemaPropertyDetail>\n\n <!-- Dynamic validation properties from composable -->\n <SchemaPropertyDetail\n v-for=\"property in validationProperties\"\n :key=\"property.key\"\n :code=\"property.code\"\n :truncate=\"property.truncate\">\n <span\n v-if=\"property.key === 'format'\"\n class=\"screenreader-only\">\n {{ translate('schema.format') }}:\n </span>\n <template\n v-if=\"property.prefix\"\n #prefix>\n {{ property.prefix }}\n </template>\n {{ property.value }}\n </SchemaPropertyDetail>\n\n <!-- Enum indicator -->\n <SchemaPropertyDetail v-if=\"props.enum\">\n {{ translate('schema.enum') }}\n </SchemaPropertyDetail>\n </template>\n <div\n v-if=\"props.additional\"\n class=\"property-additional\">\n <template v-if=\"props.value?.['x-additionalPropertiesName']\">\n {{ props.value['x-additionalPropertiesName'] }}\n </template>\n <template v-else>{{ translate('schema.additionalProperties') }}</template>\n </div>\n <div\n v-if=\"props.value?.deprecated\"\n class=\"property-deprecated\">\n <Badge>{{ translate('schema.deprecated') }}</Badge>\n </div>\n <span\n v-if=\"discriminatorValue !== undefined\"\n class=\"text-c-2\">\n {{ translate('schema.discriminatorValue') }}:\n <RenderString :value=\"discriminatorValue\" />\n </span>\n <!-- Don't use `isDefined` here, we want to show `const` when the value is `null` -->\n <div\n v-if=\"constValue !== undefined\"\n class=\"property-const\">\n <SchemaPropertyDetail truncate>\n <template #prefix>{{ translate('schema.const') }}: </template>\n <RenderString :value=\"constValue\" />\n </SchemaPropertyDetail>\n </div>\n <template v-else>\n <!-- Shows only when a composition is used (so props.value?.type is undefined) -->\n <SchemaPropertyDetail v-if=\"(props.value as any)?.nullable === true\">\n {{ translate('schema.nullable') }}\n </SchemaPropertyDetail>\n </template>\n <div\n v-if=\"props.value?.writeOnly\"\n class=\"property-write-only\">\n {{ translate('schema.writeOnly') }}\n </div>\n <div\n v-else-if=\"props.value?.readOnly\"\n class=\"property-read-only\">\n {{ translate('schema.readOnly') }}\n </div>\n <div\n v-if=\"props.required\"\n class=\"property-required\">\n {{ translate('schema.required') }}\n </div>\n <!-- Gated here, not only inside the component: each popup instance installs\n window-level click and keydown listeners for its dismissal, so mounting\n one per row costs the page a listener per row it never shows anything\n for. Same reason `SchemaPropertyPattern` below is gated. -->\n <SchemaPropertyDefault\n v-if=\"props.value?.default !== undefined\"\n :value=\"props.value?.default\" />\n <!--\n Pattern is a hover dropdown chip like Examples, not an inline constraint,\n so it sits beside the example. This keeps the real constraints (length,\n nullable, …) together in the dotted list. See #9966.\n -->\n <SchemaPropertyPattern\n v-if=\"patternValue\"\n :pattern=\"patternValue\" />\n <SchemaPropertyExamples\n v-if=\"props.withExamples && hasExampleContent\"\n :example=\"exampleValue\"\n :examples=\"props.value?.examples\" />\n <!-- The collapsed preview rides the end of the heading line -->\n <slot name=\"preview\" />\n <!-- Last so the tab order matches the visual order: the trailing copy-link\n is painted at the row's right edge, after every control to its left -->\n <slot name=\"trailing\" />\n </div>\n</template>\n<style scoped>\n.property-heading {\n display: flex;\n flex-wrap: wrap;\n align-items: baseline;\n row-gap: 9px;\n white-space: nowrap;\n}\n\n.property-heading:has(+ .children),\n.property-heading:has(+ .property-rule) {\n margin-bottom: 9px;\n}\n\n.property-heading > * {\n margin-right: 9px;\n}\n\n.property-heading:last-child {\n margin-right: 0;\n}\n\n.property-name {\n max-width: 100%;\n font-family: var(--scalar-font-code);\n font-weight: var(--scalar-bold);\n font-size: var(--scalar-font-size-4);\n white-space: normal;\n overflow-wrap: break-word;\n}\n\n.property-additional {\n font-family: var(--scalar-font-code);\n}\n\n.property-required,\n.property-optional {\n color: var(--scalar-color-2);\n}\n\n.property-required {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-orange);\n}\n/*\n * Light-mode oranges are too bright on a light page for 13px text (the default\n * #ff5800 is 3.16:1), so blend the theme orange toward the text colour to reach\n * WCAG 1.4.3 (4.5:1) while keeping the hue and letting custom themes flow\n * through. Dark mode already passes (8.37:1) and keeps the plain token.\n */\n.light-mode .property-required {\n color: color-mix(\n in srgb,\n var(--scalar-color-orange),\n var(--scalar-color-1) 32%\n );\n}\n\n.property-read-only {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-blue);\n}\n\n.property-write-only {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-green);\n}\n\n.property-discriminator {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-purple);\n}\n\n.property-detail {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-2);\n display: flex;\n align-items: center;\n\n min-width: 0;\n}\n\n.property-const {\n color: var(--scalar-color-1);\n}\n\n.deprecated {\n text-decoration: line-through;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BA,IAAM2C,IAAQC,GA2CR,EAAE,iBAAcC,EAAgB,GAGhCC,IAAWC,GAAMJ,GAAO,OAAO,GAE/BK,IAAaC,QAAe;GAChC,IAAI,CAACH,EAAS,OACZ;GAGF,IAAMI,IAASJ,EAAS;GAGxB,IAAII,EAAO,UAAU,KAAA,GACnB,OAAOA,EAAO;GAIhB,IAAIA,EAAO,MAAM,WAAW,GAC1B,OAAOA,EAAO,KAAK;GAIrB,IAAIC,EAAcD,CAAM,KAAKA,EAAO,OAAO;IACzC,IAAME,IAAQC,EAAQ,OAAOH,EAAO,KAAK;IAEzC,IAAII,EAAUF,EAAM,KAAK,GACvB,OAAOA,EAAM;IAGf,IAAIA,EAAM,MAAM,WAAW,GACzB,OAAOA,EAAM,KAAK;GAEtB;EAGF,CAAC,GAgBKG,KAAsB,MAAyB;GACnD,IAAMC,IAAmC,CAAC;GAwE1C,OAtEIC,EAAeP,CAAM,MACnBA,EAAO,aACTM,EAAW,KAAK;IACd,KAAK;IACL,QAAQ,GAAGE,EAAU,kBAAkB,EAAE;IACzC,OAAOR,EAAO;GAChB,CAAC,GAGCA,EAAO,aACTM,EAAW,KAAK;IACd,KAAK;IACL,QAAQ,GAAGE,EAAU,kBAAkB,EAAE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ACnD,SAAA/C,QAAoC,CAApCK,EAAoCE,GAAA,EAArB,OAAO8B,EAAA,MAAU,GAAA,MAAA,GAAA,CAAA,OAAA,CAAA,C;;;GAU5BL,EAAM,OAAO,aADrB1C,EAAA,GAAAC,EAIM,OAJNqC,GAIMjC,EADDC,EAAAmD,CAAA,CAAS,CAAA,kBAAA,CAAA,GAAA,CAAA,KAGDf,EAAM,OAAO,YAD1B1C,EAAA,GAAAC,EAIM,OAJNsC,GAIMlC,EADDC,EAAAmD,CAAA,CAAS,CAAA,iBAAA,CAAA,GAAA,CAAA,K;GAGNf,EAAM,YADd1C,EAAA,GAAAC,EAIM,OAJNuC,GAIMnC,EADDC,EAAAmD,CAAA,CAAS,CAAA,iBAAA,CAAA,GAAA,CAAA,K;GAONf,EAAM,OAAO,YAAY,KAAA,I,aADjC1C,EAAA,GAAAQ,EAEkCU,IAAA;;IAA/B,OAAOwB,EAAM,OAAO;;GAOfiC,EAAA,SADR3E,EAAA,GAAAQ,EAE4BW,IAAA;;IAAzB,SAASwD,EAAA;;GAEJjC,EAAM,gBAAgB+B,GAAA,SAD9BzE,EAAA,GAAAQ,EAGsCY,GAAA;;IADnC,SAASmD,EAAA;IACT,UAAU7B,EAAM,OAAO;;GAE1BvC,EAAuB2E,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,EAAA;GAGvB3E,EAAwB2E,EAAA,QAAA,YAAA,CAAA,GAAA,KAAA,GAAA,EAAA"}
@@ -1,6 +1,6 @@
1
1
  import e from "../_virtual/_plugin-vue_export-helper.js";
2
- import t from "./SchemaPropertyPattern.vue.script.js";
3
- /* empty css */
2
+ import t from "./SchemaPropertyPattern.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
4
  //#region src/schema/SchemaPropertyPattern.vue
5
5
  var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-e8f7b07b"]]);
6
6
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaPropertyPattern.vue.js","names":[],"sources":["../../src/schema/SchemaPropertyPattern.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\nimport { onClickOutside, onKeyStroke } from '@vueuse/core'\nimport { ref } from 'vue'\n\nimport LinkButton from './LinkButton.vue'\nimport { useLocalization } from './localization'\n\nconst { pattern } = defineProps<{ pattern: string }>()\n\nconst { copyToClipboard } = useClipboard()\nconst { translate } = useLocalization()\n\n/**\n * The popup reveals on hover and keyboard focus purely via CSS. Touch devices\n * have no hover, so a click/tap also pins it open, and a second click, a click\n * outside, or Escape closes it again. Without this the full pattern was\n * unreachable on mobile — a regression from the old inline (truncated) text.\n */\nconst rootRef = ref<HTMLElement | null>(null)\nconst isOpen = ref(false)\n\nconst toggle = () => {\n isOpen.value = !isOpen.value\n}\n\nconst close = () => {\n isOpen.value = false\n}\n\nonClickOutside(rootRef, close)\nonKeyStroke('Escape', () => {\n if (isOpen.value) {\n close()\n }\n})\n</script>\n<template>\n <div\n ref=\"rootRef\"\n class=\"property-pattern\"\n :class=\"{ 'is-open': isOpen }\">\n <LinkButton\n class=\"decoration-dotted\"\n @click=\"toggle\">\n {{ translate('schema.pattern') }}\n </LinkButton>\n <div class=\"property-pattern-popup\">\n <button\n :aria-label=\"`${translate('schema.copyPattern')}: ${pattern}`\"\n class=\"property-pattern-value group\"\n type=\"button\"\n @click=\"copyToClipboard(pattern)\">\n <code>{{ pattern }}</code>\n <ScalarIcon\n aria-hidden=\"true\"\n class=\"group-hover:text-c-1 text-c-3 ml-auto min-h-3 min-w-3\"\n icon=\"Clipboard\"\n size=\"xs\" />\n </button>\n </div>\n </div>\n</template>\n<style scoped>\n@reference \"../style.css\";\n\n.property-pattern {\n display: flex;\n flex-direction: column;\n font-size: var(--scalar-mini);\n position: relative;\n}\n\n/*\n * Invisible bridge that fills the gap between the label and the popup, so the\n * pointer can travel down into the popup without dropping the `:hover` state.\n * Mirrors the same trick in SchemaPropertyExamples.vue.\n */\n.property-pattern:hover::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 20px;\n border-radius: var(--scalar-radius);\n}\n\n.property-pattern-popup {\n position: absolute;\n top: 18px;\n left: 50%;\n transform: translate3d(-50%, 0, 0);\n background-color: var(--scalar-background-1);\n box-shadow: var(--scalar-shadow-1);\n border-radius: var(--scalar-radius-lg);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n padding: 9px;\n min-width: 200px;\n /* Cap the width so the centered popup never overflows a narrow viewport\n * (mobile, modal). Long patterns wrap instead of widening it. */\n max-width: min(500px, calc(100vw - 32px));\n /* Cap the height too, so a very long multi-line regex scrolls inside the\n * popup instead of running off the bottom of the viewport. */\n max-height: min(400px, calc(100vh - 32px));\n overflow-y: auto;\n display: none;\n @apply z-context;\n}\n\n.property-pattern:hover .property-pattern-popup,\n.property-pattern:focus-within .property-pattern-popup,\n.property-pattern.is-open .property-pattern-popup {\n display: flex;\n}\n\n.property-pattern-value {\n font-family: var(--scalar-font-code);\n display: flex;\n gap: 8px;\n /* Top-align so the copy icon stays with the first line of a wrapped pattern. */\n align-items: flex-start;\n width: 100%;\n padding: 6px;\n background: var(--scalar-background-2);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius);\n}\n\n.property-pattern-value code {\n font-family: var(--scalar-font-code);\n font-size: var(--scalar-font-size-3);\n color: var(--scalar-color-2);\n /* Wrap long regex so the full pattern is readable, not just copyable. */\n white-space: pre-wrap;\n word-break: break-word;\n overflow-wrap: anywhere;\n flex: 1;\n text-align: left;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"SchemaPropertyPattern.vue.js","names":["_sfc_main","_plugin_vue_export_helper_default","SchemaPropertyPattern_vue_vue_type_script_setup_true_lang_default","SchemaPropertyPattern_default"],"sources":["../../src/schema/SchemaPropertyPattern.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\nimport { onClickOutside, onKeyStroke } from '@vueuse/core'\nimport { ref } from 'vue'\n\nimport LinkButton from './LinkButton.vue'\nimport { useLocalization } from './localization'\n\nconst { pattern } = defineProps<{ pattern: string }>()\n\nconst { copyToClipboard } = useClipboard()\nconst { translate } = useLocalization()\n\n/**\n * The popup reveals on hover and keyboard focus purely via CSS. Touch devices\n * have no hover, so a click/tap also pins it open, and a second click, a click\n * outside, or Escape closes it again. Without this the full pattern was\n * unreachable on mobile — a regression from the old inline (truncated) text.\n */\nconst rootRef = ref<HTMLElement | null>(null)\nconst isOpen = ref(false)\n\nconst toggle = () => {\n isOpen.value = !isOpen.value\n}\n\nconst close = () => {\n isOpen.value = false\n}\n\nonClickOutside(rootRef, close)\nonKeyStroke('Escape', () => {\n if (isOpen.value) {\n close()\n }\n})\n</script>\n<template>\n <div\n ref=\"rootRef\"\n class=\"property-pattern\"\n :class=\"{ 'is-open': isOpen }\">\n <LinkButton\n class=\"decoration-dotted\"\n @click=\"toggle\">\n {{ translate('schema.pattern') }}\n </LinkButton>\n <div class=\"property-pattern-popup\">\n <button\n :aria-label=\"`${translate('schema.copyPattern')}: ${pattern}`\"\n class=\"property-pattern-value group\"\n type=\"button\"\n @click=\"copyToClipboard(pattern)\">\n <code>{{ pattern }}</code>\n <ScalarIcon\n aria-hidden=\"true\"\n class=\"group-hover:text-c-1 text-c-3 ml-auto min-h-3 min-w-3\"\n icon=\"Clipboard\"\n size=\"xs\" />\n </button>\n </div>\n </div>\n</template>\n<style scoped>\n@reference \"../style.css\";\n\n.property-pattern {\n display: flex;\n flex-direction: column;\n font-size: var(--scalar-mini);\n position: relative;\n}\n\n/*\n * Invisible bridge that fills the gap between the label and the popup, so the\n * pointer can travel down into the popup without dropping the `:hover` state.\n * Mirrors the same trick in SchemaPropertyExamples.vue.\n */\n.property-pattern:hover::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 20px;\n border-radius: var(--scalar-radius);\n}\n\n.property-pattern-popup {\n position: absolute;\n top: 18px;\n left: 50%;\n transform: translate3d(-50%, 0, 0);\n background-color: var(--scalar-background-1);\n box-shadow: var(--scalar-shadow-1);\n border-radius: var(--scalar-radius-lg);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n padding: 9px;\n min-width: 200px;\n /* Cap the width so the centered popup never overflows a narrow viewport\n * (mobile, modal). Long patterns wrap instead of widening it. */\n max-width: min(500px, calc(100vw - 32px));\n /* Cap the height too, so a very long multi-line regex scrolls inside the\n * popup instead of running off the bottom of the viewport. */\n max-height: min(400px, calc(100vh - 32px));\n overflow-y: auto;\n display: none;\n @apply z-context;\n}\n\n.property-pattern:hover .property-pattern-popup,\n.property-pattern:focus-within .property-pattern-popup,\n.property-pattern.is-open .property-pattern-popup {\n display: flex;\n}\n\n.property-pattern-value {\n font-family: var(--scalar-font-code);\n display: flex;\n gap: 8px;\n /* Top-align so the copy icon stays with the first line of a wrapped pattern. */\n align-items: flex-start;\n width: 100%;\n padding: 6px;\n background: var(--scalar-background-2);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius);\n}\n\n.property-pattern-value code {\n font-family: var(--scalar-font-code);\n font-size: var(--scalar-font-size-3);\n color: var(--scalar-color-2);\n /* Wrap long regex so the full pattern is readable, not just copyable. */\n white-space: pre-wrap;\n word-break: break-word;\n overflow-wrap: anywhere;\n flex: 1;\n text-align: left;\n}\n</style>\n"],"mappings":""}
@@ -42,4 +42,4 @@ var _ = { class: "property-pattern-popup" }, v = ["aria-label"], y = /*@__PURE__
42
42
  //#endregion
43
43
  export { y as default };
44
44
 
45
- //# sourceMappingURL=SchemaPropertyPattern.vue.script.js.map
45
+ //# sourceMappingURL=SchemaPropertyPattern.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaPropertyPattern.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createVNode","LinkButton","_withCtx","_createTextVNode","_toDisplayString","_unref","_createElementVNode","LinkButton_default","_hoisted_1","_hoisted_2","SchemaPropertyPattern_vue_vue_type_script_setup_true_lang_default","useClipboard","useLocalization","rootRef","ref","isOpen","toggle","close","onClickOutside","onKeyStroke","openBlock","createElementBlock","normalizeClass","createVNode","withCtx","createTextVNode","toDisplayString","unref","translate","createElementVNode","__props","_cache","copyToClipboard","ScalarIcon"],"sources":["../../src/schema/SchemaPropertyPattern.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { useClipboard } from '@scalar/use-hooks/useClipboard'\nimport { onClickOutside, onKeyStroke } from '@vueuse/core'\nimport { ref } from 'vue'\n\nimport LinkButton from './LinkButton.vue'\nimport { useLocalization } from './localization'\n\nconst { pattern } = defineProps<{ pattern: string }>()\n\nconst { copyToClipboard } = useClipboard()\nconst { translate } = useLocalization()\n\n/**\n * The popup reveals on hover and keyboard focus purely via CSS. Touch devices\n * have no hover, so a click/tap also pins it open, and a second click, a click\n * outside, or Escape closes it again. Without this the full pattern was\n * unreachable on mobile — a regression from the old inline (truncated) text.\n */\nconst rootRef = ref<HTMLElement | null>(null)\nconst isOpen = ref(false)\n\nconst toggle = () => {\n isOpen.value = !isOpen.value\n}\n\nconst close = () => {\n isOpen.value = false\n}\n\nonClickOutside(rootRef, close)\nonKeyStroke('Escape', () => {\n if (isOpen.value) {\n close()\n }\n})\n</script>\n<template>\n <div\n ref=\"rootRef\"\n class=\"property-pattern\"\n :class=\"{ 'is-open': isOpen }\">\n <LinkButton\n class=\"decoration-dotted\"\n @click=\"toggle\">\n {{ translate('schema.pattern') }}\n </LinkButton>\n <div class=\"property-pattern-popup\">\n <button\n :aria-label=\"`${translate('schema.copyPattern')}: ${pattern}`\"\n class=\"property-pattern-value group\"\n type=\"button\"\n @click=\"copyToClipboard(pattern)\">\n <code>{{ pattern }}</code>\n <ScalarIcon\n aria-hidden=\"true\"\n class=\"group-hover:text-c-1 text-c-3 ml-auto min-h-3 min-w-3\"\n icon=\"Clipboard\"\n size=\"xs\" />\n </button>\n </div>\n </div>\n</template>\n<style scoped>\n@reference \"../style.css\";\n\n.property-pattern {\n display: flex;\n flex-direction: column;\n font-size: var(--scalar-mini);\n position: relative;\n}\n\n/*\n * Invisible bridge that fills the gap between the label and the popup, so the\n * pointer can travel down into the popup without dropping the `:hover` state.\n * Mirrors the same trick in SchemaPropertyExamples.vue.\n */\n.property-pattern:hover::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 20px;\n border-radius: var(--scalar-radius);\n}\n\n.property-pattern-popup {\n position: absolute;\n top: 18px;\n left: 50%;\n transform: translate3d(-50%, 0, 0);\n background-color: var(--scalar-background-1);\n box-shadow: var(--scalar-shadow-1);\n border-radius: var(--scalar-radius-lg);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n padding: 9px;\n min-width: 200px;\n /* Cap the width so the centered popup never overflows a narrow viewport\n * (mobile, modal). Long patterns wrap instead of widening it. */\n max-width: min(500px, calc(100vw - 32px));\n /* Cap the height too, so a very long multi-line regex scrolls inside the\n * popup instead of running off the bottom of the viewport. */\n max-height: min(400px, calc(100vh - 32px));\n overflow-y: auto;\n display: none;\n @apply z-context;\n}\n\n.property-pattern:hover .property-pattern-popup,\n.property-pattern:focus-within .property-pattern-popup,\n.property-pattern.is-open .property-pattern-popup {\n display: flex;\n}\n\n.property-pattern-value {\n font-family: var(--scalar-font-code);\n display: flex;\n gap: 8px;\n /* Top-align so the copy icon stays with the first line of a wrapped pattern. */\n align-items: flex-start;\n width: 100%;\n padding: 6px;\n background: var(--scalar-background-2);\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n border-radius: var(--scalar-radius);\n}\n\n.property-pattern-value code {\n font-family: var(--scalar-font-code);\n font-size: var(--scalar-font-size-3);\n color: var(--scalar-color-2);\n /* Wrap long regex so the full pattern is readable, not just copyable. */\n white-space: pre-wrap;\n word-break: break-word;\n overflow-wrap: anywhere;\n flex: 1;\n text-align: left;\n}\n</style>\n"],"mappings":";;;;;;;;;;;EAWA,IAAM,EAAE,uBAAoBc,EAAa,GACnC,EAAE,iBAAcC,EAAgB,GAQhCC,IAAUC,EAAwB,IAAI,GACtCC,IAASD,EAAI,EAAK,GAElBE,UAAe;GACnB,EAAO,QAAQ,CAACD,EAAO;EACzB,GAEME,UAAc;GAClB,EAAO,QAAQ;EACjB;E,OAEAC,EAAeL,GAASI,CAAK,GAC7BE,EAAY,gBAAgB;GAC1B,AAAIJ,EAAO,SACTE,EAAM;EAEV,CAAC,I,UAGCpB,EAAA,GAAAC,EAuBM,OAAA;GAtBA,SAAA;GAAJ,KAAIe;GACJ,OAAKd,EAAA,CAAC,oBAAkB,EAAA,WACHgB,EAAA,MAAM,CAAA,CAAA;E,IAC3Bf,EAIaC,GAAA;GAHX,OAAM;GACL,SAAOe;;GACR,SAAAd,QAAiC,CAA9BC,EAAAC,EAAAC,EAAAuB,CAAA,CAAS,CAAA,gBAAA,CAAA,GAAA,CAAA,C;;E,IAEdtB,EAaM,OAbNE,GAaM,CAZJF,EAWS,UAAA;GAVN,cAAU,GAAKD,EAAAuB,CAAA,CAAS,CAAA,oBAAA,EAAA,IAA2BE,EAAA;GACpD,OAAM;GACN,MAAK;GACJ,SAAK,AAAAC,EAAA,QAAA,MAAE1B,EAAA2B,CAAA,CAAe,CAACF,EAAA,OAAO;E,IAC/BxB,EAA0B,QAAA,MAAAF,EAAjB0B,EAAA,OAAO,GAAA,CAAA,GAChB9B,EAIcK,EAAA4B,CAAA,GAAA;GAHZ,eAAY;GACZ,OAAM;GACN,MAAK;GACL,MAAK"}
@@ -1,4 +1,4 @@
1
- import e from "./SchemaRailPanel.vue.script.js";
1
+ import e from "./SchemaRailPanel.vue_vue_type_script_setup_true_lang.js";
2
2
  //#region src/schema/SchemaRailPanel.vue
3
3
  var t = e;
4
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaRailPanel.vue.js","names":[],"sources":["../../src/schema/SchemaRailPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, type Component } from 'vue'\n\n/**\n * The railed panel of the schema tree: an expanded row's children behind a rail\n * that fades with depth. See the indentation model in SchemaProperty.vue.\n *\n * `--schema-depth` must stay inline on the element itself: the `schema-rail`\n * utility reads it for the fade. No margins of its own, because each surface\n * that joins the tree spaces its panel differently.\n */\nconst {\n depth,\n closeOnRail = false,\n as = 'div',\n} = defineProps<{\n /** Nesting depth of the panel, driving how far the rail fades */\n depth: number\n /** Render the pointer strip over the rail that closes the panel on click */\n closeOnRail?: boolean\n /** Panel root element or component, so a headless-ui DisclosurePanel can keep the rail recipe */\n as?: string | Component\n}>()\n\nconst emit = defineEmits<{\n (e: 'close'): void\n}>()\n\n/**\n * A hovered strip colours this panel's rail and lights the puck of the control\n * that owns the panel. Both used to be `:has(... :hover)` selectors, which made\n * every railed row a `:has()` invalidation anchor, so each element inserted\n * under an open row restyled its whole subtree. The strip's pointer events now\n * write the same state as attributes that exist only while it is hovered:\n * `data-rail-hovered` on the panel root and `data-child-rail-hovered` on the\n * panel's parent, the element the tailwind.config.css variants look through to\n * the control. Read off DOM adjacency exactly like the selectors they replace,\n * so every surface that rails a panel is covered without wiring.\n */\nlet hovered: { panel: HTMLElement; row: HTMLElement | null } | null = null\n\nconst clearRailHover = (): void => {\n hovered?.panel.removeAttribute('data-rail-hovered')\n hovered?.row?.removeAttribute('data-child-rail-hovered')\n hovered = null\n}\n\nconst setRailHover = (event: Event, on: boolean): void => {\n clearRailHover()\n\n if (!on) {\n return\n }\n\n const panel =\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget.parentElement\n : null\n\n if (!panel) {\n return\n }\n\n const row = panel.parentElement\n panel.setAttribute('data-rail-hovered', '')\n row?.setAttribute('data-child-rail-hovered', '')\n hovered = { panel, row }\n}\n\n/**\n * Folding the panel hides the strip under the pointer, so no pointerleave ever\n * follows the click: the marks go before the close, or the puck stays lit.\n */\nconst onStripClick = (): void => {\n clearRailHover()\n emit('close')\n}\n\n/* The strip also disappears without a pointerleave when the panel unmounts,\n and the parent row it marked outlives it. */\nonBeforeUnmount(clearRailHover)\n</script>\n<template>\n <component\n :is=\"as\"\n class=\"schema-rail-panel schema-rail rail-hover:border-s-c-1 relative ps-[var(--schema-gutter,16px)]\"\n :style=\"{ '--schema-depth': depth }\">\n <!-- Pointer-only strip along the rail that folds the panel; hidden from\n assistive tech because the row's own toggle is the accessible control. -->\n <div\n v-if=\"closeOnRail\"\n aria-hidden=\"true\"\n class=\"rail-hit z-[1]\"\n data-rail-hit\n @click.stop=\"onStripClick\"\n @pointerenter=\"setRailHover($event, true)\"\n @pointerleave=\"setRailHover($event, false)\" />\n <slot />\n </component>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SchemaRailPanel.vue.js","names":["_sfc_main","SchemaRailPanel_vue_vue_type_script_setup_true_lang_default","SchemaRailPanel_default"],"sources":["../../src/schema/SchemaRailPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, type Component } from 'vue'\n\n/**\n * The railed panel of the schema tree: an expanded row's children behind a rail\n * that fades with depth. See the indentation model in SchemaProperty.vue.\n *\n * `--schema-depth` must stay inline on the element itself: the `schema-rail`\n * utility reads it for the fade. No margins of its own, because each surface\n * that joins the tree spaces its panel differently.\n */\nconst {\n depth,\n closeOnRail = false,\n as = 'div',\n} = defineProps<{\n /** Nesting depth of the panel, driving how far the rail fades */\n depth: number\n /** Render the pointer strip over the rail that closes the panel on click */\n closeOnRail?: boolean\n /** Panel root element or component, so a headless-ui DisclosurePanel can keep the rail recipe */\n as?: string | Component\n}>()\n\nconst emit = defineEmits<{\n (e: 'close'): void\n}>()\n\n/**\n * A hovered strip colours this panel's rail and lights the puck of the control\n * that owns the panel. Both used to be `:has(... :hover)` selectors, which made\n * every railed row a `:has()` invalidation anchor, so each element inserted\n * under an open row restyled its whole subtree. The strip's pointer events now\n * write the same state as attributes that exist only while it is hovered:\n * `data-rail-hovered` on the panel root and `data-child-rail-hovered` on the\n * panel's parent, the element the tailwind.config.css variants look through to\n * the control. Read off DOM adjacency exactly like the selectors they replace,\n * so every surface that rails a panel is covered without wiring.\n */\nlet hovered: { panel: HTMLElement; row: HTMLElement | null } | null = null\n\nconst clearRailHover = (): void => {\n hovered?.panel.removeAttribute('data-rail-hovered')\n hovered?.row?.removeAttribute('data-child-rail-hovered')\n hovered = null\n}\n\nconst setRailHover = (event: Event, on: boolean): void => {\n clearRailHover()\n\n if (!on) {\n return\n }\n\n const panel =\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget.parentElement\n : null\n\n if (!panel) {\n return\n }\n\n const row = panel.parentElement\n panel.setAttribute('data-rail-hovered', '')\n row?.setAttribute('data-child-rail-hovered', '')\n hovered = { panel, row }\n}\n\n/**\n * Folding the panel hides the strip under the pointer, so no pointerleave ever\n * follows the click: the marks go before the close, or the puck stays lit.\n */\nconst onStripClick = (): void => {\n clearRailHover()\n emit('close')\n}\n\n/* The strip also disappears without a pointerleave when the panel unmounts,\n and the parent row it marked outlives it. */\nonBeforeUnmount(clearRailHover)\n</script>\n<template>\n <component\n :is=\"as\"\n class=\"schema-rail-panel schema-rail rail-hover:border-s-c-1 relative ps-[var(--schema-gutter,16px)]\"\n :style=\"{ '--schema-depth': depth }\">\n <!-- Pointer-only strip along the rail that folds the panel; hidden from\n assistive tech because the row's own toggle is the accessible control. -->\n <div\n v-if=\"closeOnRail\"\n aria-hidden=\"true\"\n class=\"rail-hit z-[1]\"\n data-rail-hit\n @click.stop=\"onStripClick\"\n @pointerenter=\"setRailHover($event, true)\"\n @pointerleave=\"setRailHover($event, false)\" />\n <slot />\n </component>\n</template>\n"],"mappings":""}
@@ -46,4 +46,4 @@ var d = /*@__PURE__*/ r({
46
46
  //#endregion
47
47
  export { d as default };
48
48
 
49
- //# sourceMappingURL=SchemaRailPanel.vue.script.js.map
49
+ //# sourceMappingURL=SchemaRailPanel.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaRailPanel.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_normalizeStyle","_withCtx","_createElementBlock","_withModifiers","_createCommentVNode","_renderSlot","SchemaRailPanel_vue_vue_type_script_setup_true_lang_default","__emit","emit","hovered","clearRailHover","setRailHover","on","panel","event","row","onStripClick","onBeforeUnmount","openBlock","createBlock","resolveDynamicComponent","__props","normalizeStyle","withCtx","createElementBlock","withModifiers","_cache","$event","createCommentVNode","renderSlot","_ctx"],"sources":["../../src/schema/SchemaRailPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, type Component } from 'vue'\n\n/**\n * The railed panel of the schema tree: an expanded row's children behind a rail\n * that fades with depth. See the indentation model in SchemaProperty.vue.\n *\n * `--schema-depth` must stay inline on the element itself: the `schema-rail`\n * utility reads it for the fade. No margins of its own, because each surface\n * that joins the tree spaces its panel differently.\n */\nconst {\n depth,\n closeOnRail = false,\n as = 'div',\n} = defineProps<{\n /** Nesting depth of the panel, driving how far the rail fades */\n depth: number\n /** Render the pointer strip over the rail that closes the panel on click */\n closeOnRail?: boolean\n /** Panel root element or component, so a headless-ui DisclosurePanel can keep the rail recipe */\n as?: string | Component\n}>()\n\nconst emit = defineEmits<{\n (e: 'close'): void\n}>()\n\n/**\n * A hovered strip colours this panel's rail and lights the puck of the control\n * that owns the panel. Both used to be `:has(... :hover)` selectors, which made\n * every railed row a `:has()` invalidation anchor, so each element inserted\n * under an open row restyled its whole subtree. The strip's pointer events now\n * write the same state as attributes that exist only while it is hovered:\n * `data-rail-hovered` on the panel root and `data-child-rail-hovered` on the\n * panel's parent, the element the tailwind.config.css variants look through to\n * the control. Read off DOM adjacency exactly like the selectors they replace,\n * so every surface that rails a panel is covered without wiring.\n */\nlet hovered: { panel: HTMLElement; row: HTMLElement | null } | null = null\n\nconst clearRailHover = (): void => {\n hovered?.panel.removeAttribute('data-rail-hovered')\n hovered?.row?.removeAttribute('data-child-rail-hovered')\n hovered = null\n}\n\nconst setRailHover = (event: Event, on: boolean): void => {\n clearRailHover()\n\n if (!on) {\n return\n }\n\n const panel =\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget.parentElement\n : null\n\n if (!panel) {\n return\n }\n\n const row = panel.parentElement\n panel.setAttribute('data-rail-hovered', '')\n row?.setAttribute('data-child-rail-hovered', '')\n hovered = { panel, row }\n}\n\n/**\n * Folding the panel hides the strip under the pointer, so no pointerleave ever\n * follows the click: the marks go before the close, or the puck stays lit.\n */\nconst onStripClick = (): void => {\n clearRailHover()\n emit('close')\n}\n\n/* The strip also disappears without a pointerleave when the panel unmounts,\n and the parent row it marked outlives it. */\nonBeforeUnmount(clearRailHover)\n</script>\n<template>\n <component\n :is=\"as\"\n class=\"schema-rail-panel schema-rail rail-hover:border-s-c-1 relative ps-[var(--schema-gutter,16px)]\"\n :style=\"{ '--schema-depth': depth }\">\n <!-- Pointer-only strip along the rail that folds the panel; hidden from\n assistive tech because the row's own toggle is the accessible control. -->\n <div\n v-if=\"closeOnRail\"\n aria-hidden=\"true\"\n class=\"rail-hit z-[1]\"\n data-rail-hit\n @click.stop=\"onStripClick\"\n @pointerenter=\"setRailHover($event, true)\"\n @pointerleave=\"setRailHover($event, false)\" />\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAwBA,IAAMW,IAAOD,GAeTE,IAAkE,MAEhEC,UAA6B;GAGjC,AAFAD,GAAS,MAAM,gBAAgB,mBAAmB,GAClDA,GAAS,KAAK,gBAAgB,yBAAyB,GACvD,IAAU;EACZ,GAEME,KAAgB,GAAc,MAAsB;GAGxD,IAFAD,EAAe,GAEX,CAACE,GACH;GAGF,IAAMC,IACJC,EAAM,yBAAyB,cAC3BA,EAAM,cAAc,gBACpB;GAEN,IAAI,CAACD,GACH;GAGF,IAAME,IAAMF,EAAM;GAGlB,AAFAA,EAAM,aAAa,qBAAqB,EAAE,GAC1CE,GAAK,aAAa,2BAA2B,EAAE,GAC/C,IAAU;IAAE;IAAO;GAAI;EACzB,GAMMC,UAA2B;GAE/B,AADAN,EAAe,GACfF,EAAK,OAAO;EACd;E,OAIAS,EAAgBP,CAAc,I,UAG5Bb,EAAA,GAAAC,EAeYC,EAdLsB,EAAA,EAAE,GAAA;GACP,OAAM;GACL,OAAKrB,EAAA,EAAA,kBAAsBqB,EAAA,MAAK,CAAA;;GAGjC,SAAApB,QAOgD,CANxCoB,EAAA,eADRxB,EAAA,GAAAK,EAOgD,OAAA;;IAL9C,eAAY;IACZ,OAAM;IACN,iBAAA;IACC,SAAKC,EAAOa,GAAY,CAAA,MAAA,CAAA;IACxB,gBAAY,AAAAU,EAAA,QAAA,MAAEf,EAAagB,GAAM,EAAA;IACjC,gBAAY,AAAAD,EAAA,QAAA,MAAEf,EAAagB,GAAM,EAAA;G,2BACpCtB,EAAQyB,EAAA,QAAA,SAAA,C"}
@@ -1,4 +1,4 @@
1
- import e from "./CopyLinkButton.vue.script.js";
1
+ import e from "./CopyLinkButton.vue_vue_type_script_setup_true_lang.js";
2
2
  //#region src/schema/components/CopyLinkButton.vue
3
3
  var t = e;
4
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"CopyLinkButton.vue.js","names":[],"sources":["../../../src/schema/components/CopyLinkButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconHash } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed } from 'vue'\n\nimport { useLocalization } from '../localization'\n\n/**\n * A property row's deep-link affordance: the same hash the section headings\n * and the models list show, trailing the row's text in the flow of the heading\n * and revealed on hover or focus. It is a separate component so it can render\n * as the LAST child of the heading: inside `WithBreadcrumb`, which wraps the\n * name, it would come before the type in the tab order (WCAG 2.4.3).\n */\nconst { anchorId } = defineProps<{\n /** The anchor this button copies a link to */\n anchorId: string\n eventBus: WorkspaceEventBus | null\n}>()\n\nconst { translate } = useLocalization()\n\n/** Screen-reader label for the copy-link button, naming the deep-linked item. */\nconst copyLinkLabel = computed(() =>\n translate('actions.copyLinkTo', {\n name: anchorId.split('.').pop() ?? '',\n }),\n)\n</script>\n\n<template>\n <!-- A flex item of the heading, so it wraps with the text. Negative margins\n cancel the padding of the 24px hit area WCAG 2.5.8 asks for, so the box\n overhangs the line instead of taking room from it: vertically it never\n changes the line height, and horizontally the row gives up only the 10px\n gap and the 14px icon (5 + 24 - 5), which is what a collapsed preview\n before it truncates against.\n\n Both inline margins carry `!`: the heading's scoped `.property-heading > *`\n sets a 9px right margin, which is the end margin in LTR and the start\n margin in RTL, at the same specificity as the utility. Which one wins\n depends on whether the consumer's stylesheet puts the utilities before or\n after `vue-styles.css`.\n\n pointer-coarse drops it entirely rather than leaving it transparent: a\n touch pointer has no hover, so a still-laid-out button would be an\n invisible tap target AND would keep pushing long signature lines onto a\n second line just to show a control nobody can see. A deep link stays\n reachable there through the address bar. -->\n <button\n class=\"copy-link-trailing text-c-3 hover:text-c-1 -my-1.25 ms-1.25! -me-1.25! flex shrink-0 cursor-pointer items-center justify-center self-center p-1.25 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 pointer-coarse:hidden\"\n type=\"button\"\n @click=\"() => eventBus?.emit('copy-url:nav-item', { id: anchorId })\">\n <ScalarIconHash\n aria-hidden=\"true\"\n class=\"size-3.5\" />\n <span class=\"sr-only\">\n <slot name=\"sr-label\">{{ copyLinkLabel }}</slot>\n </span>\n </button>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"CopyLinkButton.vue.js","names":["_sfc_main","CopyLinkButton_vue_vue_type_script_setup_true_lang_default","CopyLinkButton_default"],"sources":["../../../src/schema/components/CopyLinkButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconHash } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed } from 'vue'\n\nimport { useLocalization } from '../localization'\n\n/**\n * A property row's deep-link affordance: the same hash the section headings\n * and the models list show, trailing the row's text in the flow of the heading\n * and revealed on hover or focus. It is a separate component so it can render\n * as the LAST child of the heading: inside `WithBreadcrumb`, which wraps the\n * name, it would come before the type in the tab order (WCAG 2.4.3).\n */\nconst { anchorId } = defineProps<{\n /** The anchor this button copies a link to */\n anchorId: string\n eventBus: WorkspaceEventBus | null\n}>()\n\nconst { translate } = useLocalization()\n\n/** Screen-reader label for the copy-link button, naming the deep-linked item. */\nconst copyLinkLabel = computed(() =>\n translate('actions.copyLinkTo', {\n name: anchorId.split('.').pop() ?? '',\n }),\n)\n</script>\n\n<template>\n <!-- A flex item of the heading, so it wraps with the text. Negative margins\n cancel the padding of the 24px hit area WCAG 2.5.8 asks for, so the box\n overhangs the line instead of taking room from it: vertically it never\n changes the line height, and horizontally the row gives up only the 10px\n gap and the 14px icon (5 + 24 - 5), which is what a collapsed preview\n before it truncates against.\n\n Both inline margins carry `!`: the heading's scoped `.property-heading > *`\n sets a 9px right margin, which is the end margin in LTR and the start\n margin in RTL, at the same specificity as the utility. Which one wins\n depends on whether the consumer's stylesheet puts the utilities before or\n after `vue-styles.css`.\n\n pointer-coarse drops it entirely rather than leaving it transparent: a\n touch pointer has no hover, so a still-laid-out button would be an\n invisible tap target AND would keep pushing long signature lines onto a\n second line just to show a control nobody can see. A deep link stays\n reachable there through the address bar. -->\n <button\n class=\"copy-link-trailing text-c-3 hover:text-c-1 -my-1.25 ms-1.25! -me-1.25! flex shrink-0 cursor-pointer items-center justify-center self-center p-1.25 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 pointer-coarse:hidden\"\n type=\"button\"\n @click=\"() => eventBus?.emit('copy-url:nav-item', { id: anchorId })\">\n <ScalarIconHash\n aria-hidden=\"true\"\n class=\"size-3.5\" />\n <span class=\"sr-only\">\n <slot name=\"sr-label\">{{ copyLinkLabel }}</slot>\n </span>\n </button>\n</template>\n"],"mappings":""}
@@ -23,4 +23,4 @@ var f = { class: "sr-only" }, p = /*@__PURE__*/ o({
23
23
  //#endregion
24
24
  export { p as default };
25
25
 
26
- //# sourceMappingURL=CopyLinkButton.vue.script.js.map
26
+ //# sourceMappingURL=CopyLinkButton.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyLinkButton.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createVNode","_unref","_createElementVNode","_renderSlot","_createTextVNode","_toDisplayString","_hoisted_1","CopyLinkButton_vue_vue_type_script_setup_true_lang_default","useLocalization","copyLinkLabel","computed","translate","__props","openBlock","createElementBlock","_cache","createVNode","unref","ScalarIconHash","createElementVNode","renderSlot","_ctx","createTextVNode","toDisplayString"],"sources":["../../../src/schema/components/CopyLinkButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconHash } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed } from 'vue'\n\nimport { useLocalization } from '../localization'\n\n/**\n * A property row's deep-link affordance: the same hash the section headings\n * and the models list show, trailing the row's text in the flow of the heading\n * and revealed on hover or focus. It is a separate component so it can render\n * as the LAST child of the heading: inside `WithBreadcrumb`, which wraps the\n * name, it would come before the type in the tab order (WCAG 2.4.3).\n */\nconst { anchorId } = defineProps<{\n /** The anchor this button copies a link to */\n anchorId: string\n eventBus: WorkspaceEventBus | null\n}>()\n\nconst { translate } = useLocalization()\n\n/** Screen-reader label for the copy-link button, naming the deep-linked item. */\nconst copyLinkLabel = computed(() =>\n translate('actions.copyLinkTo', {\n name: anchorId.split('.').pop() ?? '',\n }),\n)\n</script>\n\n<template>\n <!-- A flex item of the heading, so it wraps with the text. Negative margins\n cancel the padding of the 24px hit area WCAG 2.5.8 asks for, so the box\n overhangs the line instead of taking room from it: vertically it never\n changes the line height, and horizontally the row gives up only the 10px\n gap and the 14px icon (5 + 24 - 5), which is what a collapsed preview\n before it truncates against.\n\n Both inline margins carry `!`: the heading's scoped `.property-heading > *`\n sets a 9px right margin, which is the end margin in LTR and the start\n margin in RTL, at the same specificity as the utility. Which one wins\n depends on whether the consumer's stylesheet puts the utilities before or\n after `vue-styles.css`.\n\n pointer-coarse drops it entirely rather than leaving it transparent: a\n touch pointer has no hover, so a still-laid-out button would be an\n invisible tap target AND would keep pushing long signature lines onto a\n second line just to show a control nobody can see. A deep link stays\n reachable there through the address bar. -->\n <button\n class=\"copy-link-trailing text-c-3 hover:text-c-1 -my-1.25 ms-1.25! -me-1.25! flex shrink-0 cursor-pointer items-center justify-center self-center p-1.25 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 pointer-coarse:hidden\"\n type=\"button\"\n @click=\"() => eventBus?.emit('copy-url:nav-item', { id: anchorId })\">\n <ScalarIconHash\n aria-hidden=\"true\"\n class=\"size-3.5\" />\n <span class=\"sr-only\">\n <slot name=\"sr-label\">{{ copyLinkLabel }}</slot>\n </span>\n </button>\n</template>\n"],"mappings":";;;;;;;;;;;EAoBA,IAAM,EAAE,iBAAcU,EAAgB,GAGhCC,IAAgBC,QACpBC,EAAU,sBAAsB,EAC9B,MAAMC,EAAA,SAAS,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,GACrC,CAAC,CACH;E,kBAsBEd,EAAA,GAAAC,EAUS,UAAA;GATP,OAAM;GACN,MAAK;GACJ,SAAK,AAAAgB,EAAA,aAAQH,EAAA,UAAU,KAAI,qBAAA,EAAA,IAA4BA,EAAA,SAAQ,CAAA;E,IAChEZ,EAEqBC,EAAAiB,CAAA,GAAA;GADnB,eAAY;GACZ,OAAM;E,IACRhB,EAEO,QAFPI,GAEO,CADLH,EAAgDkB,EAAA,QAAA,YAAA,CAAA,SAAA,CAAvBjB,EAAAC,EAAAI,EAAA,KAAa,GAAA,CAAA,C"}
@@ -1,4 +1,4 @@
1
- import e from "./WithBreadcrumb.vue.script.js";
1
+ import e from "./WithBreadcrumb.vue_vue_type_script_setup_true_lang.js";
2
2
  //#region src/schema/components/WithBreadcrumb.vue
3
3
  var t = e;
4
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"WithBreadcrumb.vue.js","names":[],"sources":["../../../src/schema/components/WithBreadcrumb.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst { breadcrumb } = defineProps<{\n breadcrumb?: string[]\n}>()\n</script>\n\n<template>\n <template v-if=\"breadcrumb && breadcrumb.length > 0\">\n <!-- `tabindex=\"-1\"`: focusable programmatically but out of the tab order,\n so a deep link can move focus to its target instead of leaving keyboard\n and screen-reader users at the top of the document -->\n <div\n :id=\"breadcrumb.join('.')\"\n class=\"static scroll-mt-24\"\n tabindex=\"-1\">\n <!-- Content -->\n <slot />\n <!-- No copy button here: the row's heading renders it as its last child\n so tab order matches visual order. See CopyLinkButton.vue -->\n </div>\n </template>\n <template v-else>\n <slot />\n </template>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"WithBreadcrumb.vue.js","names":["_sfc_main","WithBreadcrumb_vue_vue_type_script_setup_true_lang_default","WithBreadcrumb_default"],"sources":["../../../src/schema/components/WithBreadcrumb.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst { breadcrumb } = defineProps<{\n breadcrumb?: string[]\n}>()\n</script>\n\n<template>\n <template v-if=\"breadcrumb && breadcrumb.length > 0\">\n <!-- `tabindex=\"-1\"`: focusable programmatically but out of the tab order,\n so a deep link can move focus to its target instead of leaving keyboard\n and screen-reader users at the top of the document -->\n <div\n :id=\"breadcrumb.join('.')\"\n class=\"static scroll-mt-24\"\n tabindex=\"-1\">\n <!-- Content -->\n <slot />\n <!-- No copy button here: the row's heading renders it as its last child\n so tab order matches visual order. See CopyLinkButton.vue -->\n </div>\n </template>\n <template v-else>\n <slot />\n </template>\n</template>\n"],"mappings":""}
@@ -15,4 +15,4 @@ var i = ["id"], a = /*@__PURE__*/ t({
15
15
  //#endregion
16
16
  export { a as default };
17
17
 
18
- //# sourceMappingURL=WithBreadcrumb.vue.script.js.map
18
+ //# sourceMappingURL=WithBreadcrumb.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithBreadcrumb.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_renderSlot","_hoisted_1","WithBreadcrumb_vue_vue_type_script_setup_true_lang_default","__props","openBlock","createElementBlock","renderSlot","_ctx"],"sources":["../../../src/schema/components/WithBreadcrumb.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst { breadcrumb } = defineProps<{\n breadcrumb?: string[]\n}>()\n</script>\n\n<template>\n <template v-if=\"breadcrumb && breadcrumb.length > 0\">\n <!-- `tabindex=\"-1\"`: focusable programmatically but out of the tab order,\n so a deep link can move focus to its target instead of leaving keyboard\n and screen-reader users at the top of the document -->\n <div\n :id=\"breadcrumb.join('.')\"\n class=\"static scroll-mt-24\"\n tabindex=\"-1\">\n <!-- Content -->\n <slot />\n <!-- No copy button here: the row's heading renders it as its last child\n so tab order matches visual order. See CopyLinkButton.vue -->\n </div>\n </template>\n <template v-else>\n <slot />\n </template>\n</template>\n"],"mappings":";;;;;;E,iBAOkBK,EAAA,cAAcA,EAAA,WAAW,SAAM,KAI7CL,EAAA,GAAAC,EAQM,OAAA;;GAPH,IAAII,EAAA,WAAW,KAAI,GAAA;GACpB,OAAM;GACN,UAAS;E,IAETH,EAAQO,EAAA,QAAA,SAAA,C,YAMVP,EAAQO,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"discriminator-metadata.js","names":[],"sources":["../../src/schema/discriminator-metadata.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\n/** Display-only discriminator information; symbols never enter exported API descriptions. */\nexport const schemaDiscriminator = Symbol('schema-discriminator')\n\n/** A schema view can explain inferred values without adding validation constraints. */\nexport type DiscriminatorMetadata = {\n [schemaDiscriminator]?: {\n value?: string\n inheritedVariants?: boolean\n }\n}\n\n/** Schema carrying renderer-only discriminator metadata. */\nexport type DiscriminatorSchema = SchemaObject & DiscriminatorMetadata\n"],"mappings":";AAGA,IAAa,IAAsB,OAAO,sBAAsB"}
1
+ {"version":3,"file":"discriminator-metadata.js","names":["schemaDiscriminator"],"sources":["../../src/schema/discriminator-metadata.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\n/** Display-only discriminator information; symbols never enter exported API descriptions. */\nexport const schemaDiscriminator = Symbol('schema-discriminator')\n\n/** A schema view can explain inferred values without adding validation constraints. */\nexport type DiscriminatorMetadata = {\n [schemaDiscriminator]?: {\n value?: string\n inheritedVariants?: boolean\n }\n}\n\n/** Schema carrying renderer-only discriminator metadata. */\nexport type DiscriminatorSchema = SchemaObject & DiscriminatorMetadata\n"],"mappings":";AAGA,IAAaA,IAAsB,OAAO,sBAAsB"}
@@ -1,2 +1 @@
1
- import { createSchemaExpansionStore as e, toNodeKey as t, useSchemaExpansion as n } from "../helpers/schema-expansion.js";
2
- export { e as createSchemaExpansionStore, t as toNodeKey, n as useSchemaExpansion };
1
+ export { createSchemaExpansionStore, toNodeKey, useSchemaExpansion } from "../helpers/schema-expansion.js";
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-scope.js","names":[],"sources":["../../../src/schema/helpers/dynamic-scope.ts"],"sourcesContent":["import { type DynamicScope, isDynamicRef, resolveDynamicRef } from '@scalar/workspace-store/helpers/dynamic-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { type InjectionKey, inject } from 'vue'\n\n/**\n * The dynamic scope — the outermost-first chain of schema resources on the current render path.\n *\n * JSON Schema 2020-12 `$dynamicRef` does not resolve to a fixed location. It binds to the active\n * `$dynamicAnchor` in the chain of resources entered to reach it, so the same\n * `{ \"$dynamicRef\": \"#itemType\" }` inside a shared generic template resolves to a different concrete\n * type depending on the path taken (e.g. `User` via a user page, `Group` via a group page).\n *\n * Each object `Schema` node injects this scope, appends its own resource, and re-provides it to its\n * descendants. `SchemaProperty` reads it to bind a `$dynamicRef` property or array item to the\n * concrete schema while walking the tree. See https://github.com/scalar/scalar/issues/9414.\n */\nexport const SCHEMA_DYNAMIC_SCOPE_SYMBOL: InjectionKey<DynamicScope> = Symbol('schema-dynamic-scope')\n\n/** Shared empty scope used as the inject default at the root, where nothing has been entered yet. */\nconst EMPTY_SCOPE: DynamicScope = []\n\n/** Read the dynamic scope provided by ancestor schema nodes (empty at the root of the tree). */\nexport const useDynamicScope = (): DynamicScope => inject(SCHEMA_DYNAMIC_SCOPE_SYMBOL, EMPTY_SCOPE)\n\n/**\n * Resolve a schema that may be a `$dynamicRef` against the active dynamic scope.\n *\n * Returns the bound concrete schema when the reference matches a `$dynamicAnchor` in scope. When\n * nothing matches (or the schema is not a `$dynamicRef`) the input is returned unchanged, so\n * rendering falls back to its prior behavior with no regression.\n */\nexport const resolveDynamicSchema = <T extends SchemaObject | undefined>(schema: T, scope: DynamicScope): T => {\n if (isDynamicRef(schema)) {\n return (resolveDynamicRef(schema.$dynamicRef, scope) as T) ?? schema\n }\n\n return schema\n}\n"],"mappings":";;;AAgBA,IAAa,IAA0D,OAAO,sBAAsB,GAG9F,IAA4B,CAAC,GAGtB,UAAsC,EAAO,GAA6B,CAAW,GASrF,KAA4D,GAAW,MAC9E,EAAa,CAAM,IACb,EAAkB,EAAO,aAAa,CAAK,KAAW,IAGzD"}
1
+ {"version":3,"file":"dynamic-scope.js","names":["SCHEMA_DYNAMIC_SCOPE_SYMBOL","EMPTY_SCOPE","useDynamicScope","inject","resolveDynamicSchema","isDynamicRef","schema","resolveDynamicRef","scope"],"sources":["../../../src/schema/helpers/dynamic-scope.ts"],"sourcesContent":["import { type DynamicScope, isDynamicRef, resolveDynamicRef } from '@scalar/workspace-store/helpers/dynamic-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { type InjectionKey, inject } from 'vue'\n\n/**\n * The dynamic scope — the outermost-first chain of schema resources on the current render path.\n *\n * JSON Schema 2020-12 `$dynamicRef` does not resolve to a fixed location. It binds to the active\n * `$dynamicAnchor` in the chain of resources entered to reach it, so the same\n * `{ \"$dynamicRef\": \"#itemType\" }` inside a shared generic template resolves to a different concrete\n * type depending on the path taken (e.g. `User` via a user page, `Group` via a group page).\n *\n * Each object `Schema` node injects this scope, appends its own resource, and re-provides it to its\n * descendants. `SchemaProperty` reads it to bind a `$dynamicRef` property or array item to the\n * concrete schema while walking the tree. See https://github.com/scalar/scalar/issues/9414.\n */\nexport const SCHEMA_DYNAMIC_SCOPE_SYMBOL: InjectionKey<DynamicScope> = Symbol('schema-dynamic-scope')\n\n/** Shared empty scope used as the inject default at the root, where nothing has been entered yet. */\nconst EMPTY_SCOPE: DynamicScope = []\n\n/** Read the dynamic scope provided by ancestor schema nodes (empty at the root of the tree). */\nexport const useDynamicScope = (): DynamicScope => inject(SCHEMA_DYNAMIC_SCOPE_SYMBOL, EMPTY_SCOPE)\n\n/**\n * Resolve a schema that may be a `$dynamicRef` against the active dynamic scope.\n *\n * Returns the bound concrete schema when the reference matches a `$dynamicAnchor` in scope. When\n * nothing matches (or the schema is not a `$dynamicRef`) the input is returned unchanged, so\n * rendering falls back to its prior behavior with no regression.\n */\nexport const resolveDynamicSchema = <T extends SchemaObject | undefined>(schema: T, scope: DynamicScope): T => {\n if (isDynamicRef(schema)) {\n return (resolveDynamicRef(schema.$dynamicRef, scope) as T) ?? schema\n }\n\n return schema\n}\n"],"mappings":";;;AAgBA,IAAaA,IAA0D,OAAO,sBAAsB,GAG9FC,IAA4B,CAAC,GAGtBC,UAAsCC,EAAOH,GAA6BC,CAAW,GASrFG,KAA4D,GAAW,MAC9EC,EAAaC,CAAM,IACbC,EAAkBD,EAAO,aAAaE,CAAK,KAAWF,IAGzDA"}
@@ -1 +1 @@
1
- {"version":3,"file":"format-example.js","names":[],"sources":["../../../src/schema/helpers/format-example.ts"],"sourcesContent":["/**\n * Trims surrounding whitespace, but keeps the original string when trimming would empty it\n * (so an intentional \" \" example is not silently turned into \"\").\n */\nfunction preserveOrTrim(value: string): string {\n const trimmed = value.trim()\n return trimmed === '' ? value : trimmed\n}\n\n/**\n * Converts an example value to a string that can be displayed in the UI.\n */\nexport function formatExample(example: unknown): string | number {\n if (Array.isArray(example)) {\n return `[${example\n .map((item) => {\n if (typeof item === 'string') {\n return `\"${preserveOrTrim(item)}\"`\n }\n\n if (typeof item === 'object') {\n return JSON.stringify(item)\n }\n\n if (item === undefined) {\n return 'undefined'\n }\n\n if (item === null) {\n return 'null'\n }\n\n return item\n })\n .join(', ')}]`\n }\n\n if (example === null) {\n return 'null'\n }\n\n if (typeof example === 'object') {\n return JSON.stringify(example)\n }\n\n if (example === undefined) {\n return 'undefined'\n }\n\n if (typeof example === 'string') {\n return preserveOrTrim(example)\n }\n\n return preserveOrTrim(example.toString())\n}\n"],"mappings":";AAIA,SAAS,EAAe,GAAuB;CAC7C,IAAM,IAAU,EAAM,KAAK;CAC3B,OAAO,MAAY,KAAK,IAAQ;AAClC;AAKA,SAAgB,EAAc,GAAmC;CAyC/D,OAxCI,MAAM,QAAQ,CAAO,IAChB,IAAI,EACR,KAAK,MACA,OAAO,KAAS,WACX,IAAI,EAAe,CAAI,EAAE,KAG9B,OAAO,KAAS,WACX,KAAK,UAAU,CAAI,IAGxB,MAAS,KAAA,IACJ,cAGL,MAAS,OACJ,SAGF,CACR,CAAC,CACD,KAAK,IAAI,EAAE,KAGZ,MAAY,OACP,SAGL,OAAO,KAAY,WACd,KAAK,UAAU,CAAO,IAG3B,MAAY,KAAA,IACP,cAIA,EADL,OAAO,KAAY,WACC,IAGF,EAAQ,SAAS,CAHR;AAIjC"}
1
+ {"version":3,"file":"format-example.js","names":["preserveOrTrim","trimmed","value","formatExample","example","item"],"sources":["../../../src/schema/helpers/format-example.ts"],"sourcesContent":["/**\n * Trims surrounding whitespace, but keeps the original string when trimming would empty it\n * (so an intentional \" \" example is not silently turned into \"\").\n */\nfunction preserveOrTrim(value: string): string {\n const trimmed = value.trim()\n return trimmed === '' ? value : trimmed\n}\n\n/**\n * Converts an example value to a string that can be displayed in the UI.\n */\nexport function formatExample(example: unknown): string | number {\n if (Array.isArray(example)) {\n return `[${example\n .map((item) => {\n if (typeof item === 'string') {\n return `\"${preserveOrTrim(item)}\"`\n }\n\n if (typeof item === 'object') {\n return JSON.stringify(item)\n }\n\n if (item === undefined) {\n return 'undefined'\n }\n\n if (item === null) {\n return 'null'\n }\n\n return item\n })\n .join(', ')}]`\n }\n\n if (example === null) {\n return 'null'\n }\n\n if (typeof example === 'object') {\n return JSON.stringify(example)\n }\n\n if (example === undefined) {\n return 'undefined'\n }\n\n if (typeof example === 'string') {\n return preserveOrTrim(example)\n }\n\n return preserveOrTrim(example.toString())\n}\n"],"mappings":";AAIA,SAASA,EAAe,GAAuB;CAC7C,IAAMC,IAAUC,EAAM,KAAK;CAC3B,OAAOD,MAAY,KAAKC,IAAQD;AAClC;AAKA,SAAgBE,EAAc,GAAmC;CAyC/D,OAxCI,MAAM,QAAQC,CAAO,IAChB,IAAIA,EACR,KAAK,MACA,OAAOC,KAAS,WACX,IAAIL,EAAeK,CAAI,EAAE,KAG9B,OAAOA,KAAS,WACX,KAAK,UAAUA,CAAI,IAGxBA,MAAS,KAAA,IACJ,cAGLA,MAAS,OACJ,SAGFA,CACR,CAAC,CACD,KAAK,IAAI,EAAE,KAGZD,MAAY,OACP,SAGL,OAAOA,KAAY,WACd,KAAK,UAAUA,CAAO,IAG3BA,MAAY,KAAA,IACP,cAIAJ,EADL,OAAOI,KAAY,WACCA,IAGFA,EAAQ,SAAS,CAHR;AAIjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"format-value.js","names":[],"sources":["../../../src/schema/helpers/format-value.ts"],"sourcesContent":["/**\n * Converts a value to a string that can be displayed in the UI.\n */\nexport function formatValue(value: unknown): string | number {\n if (Array.isArray(value)) {\n return `[${value\n .map((item) => {\n if (typeof item === 'string') {\n return `\"${item.toString().trim()}\"`\n }\n\n if (typeof item === 'object') {\n return JSON.stringify(item)\n }\n\n if (item === undefined) {\n return 'undefined'\n }\n\n if (item === null) {\n return 'null'\n }\n\n return item\n })\n .join(', ')}]`\n }\n\n if (value === null) {\n return 'null'\n }\n\n if (typeof value === 'object') {\n return JSON.stringify(value)\n }\n\n if (value === undefined) {\n return 'undefined'\n }\n\n if (typeof value === 'string') {\n return value.trim()\n }\n\n return value.toString().trim()\n}\n"],"mappings":";AAGA,SAAgB,EAAY,GAAiC;CAyC3D,OAxCI,MAAM,QAAQ,CAAK,IACd,IAAI,EACR,KAAK,MACA,OAAO,KAAS,WACX,IAAI,EAAK,SAAS,CAAC,CAAC,KAAK,EAAE,KAGhC,OAAO,KAAS,WACX,KAAK,UAAU,CAAI,IAGxB,MAAS,KAAA,IACJ,cAGL,MAAS,OACJ,SAGF,CACR,CAAC,CACD,KAAK,IAAI,EAAE,KAGZ,MAAU,OACL,SAGL,OAAO,KAAU,WACZ,KAAK,UAAU,CAAK,IAGzB,MAAU,KAAA,IACL,cAGL,OAAO,KAAU,WACZ,EAAM,KAAK,IAGb,EAAM,SAAS,CAAC,CAAC,KAAK;AAC/B"}
1
+ {"version":3,"file":"format-value.js","names":["formatValue","value","item"],"sources":["../../../src/schema/helpers/format-value.ts"],"sourcesContent":["/**\n * Converts a value to a string that can be displayed in the UI.\n */\nexport function formatValue(value: unknown): string | number {\n if (Array.isArray(value)) {\n return `[${value\n .map((item) => {\n if (typeof item === 'string') {\n return `\"${item.toString().trim()}\"`\n }\n\n if (typeof item === 'object') {\n return JSON.stringify(item)\n }\n\n if (item === undefined) {\n return 'undefined'\n }\n\n if (item === null) {\n return 'null'\n }\n\n return item\n })\n .join(', ')}]`\n }\n\n if (value === null) {\n return 'null'\n }\n\n if (typeof value === 'object') {\n return JSON.stringify(value)\n }\n\n if (value === undefined) {\n return 'undefined'\n }\n\n if (typeof value === 'string') {\n return value.trim()\n }\n\n return value.toString().trim()\n}\n"],"mappings":";AAGA,SAAgBA,EAAY,GAAiC;CAyC3D,OAxCI,MAAM,QAAQC,CAAK,IACd,IAAIA,EACR,KAAK,MACA,OAAOC,KAAS,WACX,IAAIA,EAAK,SAAS,CAAC,CAAC,KAAK,EAAE,KAGhC,OAAOA,KAAS,WACX,KAAK,UAAUA,CAAI,IAGxBA,MAAS,KAAA,IACJ,cAGLA,MAAS,OACJ,SAGFA,CACR,CAAC,CACD,KAAK,IAAI,EAAE,KAGZD,MAAU,OACL,SAGL,OAAOA,KAAU,WACZ,KAAK,UAAUA,CAAK,IAGzBA,MAAU,KAAA,IACL,cAGL,OAAOA,KAAU,WACZA,EAAM,KAAK,IAGbA,EAAM,SAAS,CAAC,CAAC,KAAK;AAC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-compositions-to-render.js","names":[],"sources":["../../../src/schema/helpers/get-compositions-to-render.ts"],"sourcesContent":["import { isDefined } from '@scalar/helpers/array/is-defined'\nimport { unescapeJsonPointerSegment } from '@scalar/helpers/json/unescape-json-pointer-segment'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { OpenApiDocument, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\nimport { getRefName } from './get-ref-name'\nimport { type CompositionKeyword, compositions } from './schema-composition'\nimport { shouldRenderArrayItemComposition } from './should-render-array-item-composition'\nimport { unwrapForRead } from './unwrap-for-read'\n\ntype CompositionToRender = {\n composition: CompositionKeyword\n value: SchemaObject\n}\n\ntype DocumentSchemaLookup = Pick<OpenApiDocument, 'components'>\n\nconst normalizeDiscriminatorMappingRef = (value: string) =>\n value.startsWith('#/') || value.includes('/') ? value : `#/components/schemas/${value}`\n\n/**\n * Builds a synthetic `oneOf` composition from a `discriminator.mapping` when the\n * schema declares a mapping but no explicit `oneOf`/`anyOf`. This is the shape\n * NSwag emits for polymorphic types, where the base type is a plain object with\n * a discriminator mapping pointing at the concrete variants.\n *\n * Returns `null` when there is nothing to infer (an explicit composition is\n * already present, no document to resolve refs against, or no resolvable refs).\n */\nexport const inferDiscriminatorMappingComposition = (\n value: SchemaObject,\n documentProp?: DocumentSchemaLookup,\n /** Inheritance can supply ordered variants, including schemas that share a mapped value. */\n variantRefs?: readonly string[],\n): SchemaObject | null => {\n if (value.oneOf || value.anyOf) {\n return null\n }\n\n // A schema without a mapping can never infer anything, so it is checked before the document is\n // touched at all: the document read below is by far the more expensive of the two.\n const mapping = value.discriminator?.mapping\n\n if (!mapping) {\n return null\n }\n\n // Reading `components.schemas` per row through the reactive and detect-changes layers is the\n // dominant cost of this helper, so the document is unwrapped once here. See `unwrapForRead`.\n const document = unwrapForRead(documentProp)\n\n if (!document?.components?.schemas) {\n return null\n }\n\n const refs = (variantRefs ?? Object.values(mapping))\n .filter((mappingValue): mappingValue is string => typeof mappingValue === 'string')\n .map((mappingValue) => {\n const ref = normalizeDiscriminatorMappingRef(mappingValue)\n const refName = getRefName(ref)\n const refValue = refName\n ? resolve.schema(document.components?.schemas?.[unescapeJsonPointerSegment(refName)])\n : undefined\n\n if (!refValue) {\n return undefined\n }\n\n return {\n $ref: ref,\n '$ref-value': refValue,\n }\n })\n .filter(isDefined)\n\n if (refs.length === 0) {\n return null\n }\n\n return {\n ...resolve.schema(value),\n oneOf: refs,\n }\n}\n\n/**\n * Computes which compositions should be rendered and with which values\n *\n * @param value - The schema object to check for compositions\n * @returns Array of compositions to render with their values\n */\nexport const getCompositionsToRender = (\n value: SchemaObject | undefined,\n document?: DocumentSchemaLookup,\n /**\n * The `oneOf` inferred from a bare `discriminator.mapping`, when the caller has\n * already computed it. `SchemaProperty` needs the same value to decide whether\n * to suppress the duplicate base object block, so it passes it here to avoid\n * inferring twice. Omit it and it is inferred from `value`.\n */\n inferredDiscriminatorComposition: SchemaObject | null = value\n ? inferDiscriminatorMappingComposition(value, document)\n : null,\n): CompositionToRender[] => {\n if (!value) {\n return []\n }\n\n return compositions\n .map((composition) => {\n if (composition === 'oneOf' && inferredDiscriminatorComposition) {\n return {\n composition,\n value: inferredDiscriminatorComposition,\n }\n }\n\n // Check for array item-level composition first (more specific case)\n if (shouldRenderArrayItemComposition(value, composition) && isArraySchema(value) && value.items) {\n return {\n composition,\n value: resolve.schema(value.items),\n }\n }\n\n // Check for property-level composition\n if (value[composition]) {\n // Skip if array items have this composition (even if complex/not rendered)\n const hasArrayItemComposition =\n isArraySchema(value) && value.items && typeof value.items === 'object' && composition in value.items\n\n if (!hasArrayItemComposition) {\n return {\n composition,\n value: resolve.schema(value),\n }\n }\n }\n\n return null\n })\n .filter(isDefined)\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAM,KAAoC,MACxC,EAAM,WAAW,IAAI,KAAK,EAAM,SAAS,GAAG,IAAI,IAAQ,wBAAwB,KAWrE,KACX,GACA,GAEA,MACwB;CACxB,IAAI,EAAM,SAAS,EAAM,OACvB,OAAO;CAKT,IAAM,IAAU,EAAM,eAAe;CAErC,IAAI,CAAC,GACH,OAAO;CAKT,IAAM,IAAW,EAAc,CAAY;CAE3C,IAAI,CAAC,GAAU,YAAY,SACzB,OAAO;CAGT,IAAM,KAAQ,KAAe,OAAO,OAAO,CAAO,EAAA,CAC/C,QAAQ,MAAyC,OAAO,KAAiB,QAAQ,CAAC,CAClF,KAAK,MAAiB;EACrB,IAAM,IAAM,EAAiC,CAAY,GACnD,IAAU,EAAW,CAAG,GACxB,IAAW,IACb,EAAQ,OAAO,EAAS,YAAY,UAAU,EAA2B,CAAO,EAAE,IAClF,KAAA;EAEC,OAIL,OAAO;GACL,MAAM;GACN,cAAc;EAChB;CACF,CAAC,CAAC,CACD,OAAO,CAAS;CAMnB,OAJI,EAAK,WAAW,IACX,OAGF;EACL,GAAG,EAAQ,OAAO,CAAK;EACvB,OAAO;CACT;AACF,GAQa,KACX,GACA,GAOA,IAAwD,IACpD,EAAqC,GAAO,CAAQ,IACpD,SAEC,IAIE,EACJ,KAAK,MACA,MAAgB,WAAW,IACtB;CACL;CACA,OAAO;AACT,IAIE,EAAiC,GAAO,CAAW,KAAK,EAAc,CAAK,KAAK,EAAM,QACjF;CACL;CACA,OAAO,EAAQ,OAAO,EAAM,KAAK;AACnC,IAIE,EAAM,MAKJ,EAFF,EAAc,CAAK,KAAK,EAAM,SAAS,OAAO,EAAM,SAAU,YAAY,KAAe,EAAM,SAGxF;CACL;CACA,OAAO,EAAQ,OAAO,CAAK;AAC7B,IAIG,IACR,CAAC,CACD,OAAO,CAAS,IApCV,CAAC"}
1
+ {"version":3,"file":"get-compositions-to-render.js","names":["normalizeDiscriminatorMappingRef","value","inferDiscriminatorMappingComposition","mapping","document","unwrapForRead","documentProp","refs","variantRefs","mappingValue","ref","refName","getRefName","refValue","resolve","unescapeJsonPointerSegment","isDefined","getCompositionsToRender","compositions","composition","inferredDiscriminatorComposition","shouldRenderArrayItemComposition","isArraySchema"],"sources":["../../../src/schema/helpers/get-compositions-to-render.ts"],"sourcesContent":["import { isDefined } from '@scalar/helpers/array/is-defined'\nimport { unescapeJsonPointerSegment } from '@scalar/helpers/json/unescape-json-pointer-segment'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { OpenApiDocument, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\nimport { getRefName } from './get-ref-name'\nimport { type CompositionKeyword, compositions } from './schema-composition'\nimport { shouldRenderArrayItemComposition } from './should-render-array-item-composition'\nimport { unwrapForRead } from './unwrap-for-read'\n\ntype CompositionToRender = {\n composition: CompositionKeyword\n value: SchemaObject\n}\n\ntype DocumentSchemaLookup = Pick<OpenApiDocument, 'components'>\n\nconst normalizeDiscriminatorMappingRef = (value: string) =>\n value.startsWith('#/') || value.includes('/') ? value : `#/components/schemas/${value}`\n\n/**\n * Builds a synthetic `oneOf` composition from a `discriminator.mapping` when the\n * schema declares a mapping but no explicit `oneOf`/`anyOf`. This is the shape\n * NSwag emits for polymorphic types, where the base type is a plain object with\n * a discriminator mapping pointing at the concrete variants.\n *\n * Returns `null` when there is nothing to infer (an explicit composition is\n * already present, no document to resolve refs against, or no resolvable refs).\n */\nexport const inferDiscriminatorMappingComposition = (\n value: SchemaObject,\n documentProp?: DocumentSchemaLookup,\n /** Inheritance can supply ordered variants, including schemas that share a mapped value. */\n variantRefs?: readonly string[],\n): SchemaObject | null => {\n if (value.oneOf || value.anyOf) {\n return null\n }\n\n // A schema without a mapping can never infer anything, so it is checked before the document is\n // touched at all: the document read below is by far the more expensive of the two.\n const mapping = value.discriminator?.mapping\n\n if (!mapping) {\n return null\n }\n\n // Reading `components.schemas` per row through the reactive and detect-changes layers is the\n // dominant cost of this helper, so the document is unwrapped once here. See `unwrapForRead`.\n const document = unwrapForRead(documentProp)\n\n if (!document?.components?.schemas) {\n return null\n }\n\n const refs = (variantRefs ?? Object.values(mapping))\n .filter((mappingValue): mappingValue is string => typeof mappingValue === 'string')\n .map((mappingValue) => {\n const ref = normalizeDiscriminatorMappingRef(mappingValue)\n const refName = getRefName(ref)\n const refValue = refName\n ? resolve.schema(document.components?.schemas?.[unescapeJsonPointerSegment(refName)])\n : undefined\n\n if (!refValue) {\n return undefined\n }\n\n return {\n $ref: ref,\n '$ref-value': refValue,\n }\n })\n .filter(isDefined)\n\n if (refs.length === 0) {\n return null\n }\n\n return {\n ...resolve.schema(value),\n oneOf: refs,\n }\n}\n\n/**\n * Computes which compositions should be rendered and with which values\n *\n * @param value - The schema object to check for compositions\n * @returns Array of compositions to render with their values\n */\nexport const getCompositionsToRender = (\n value: SchemaObject | undefined,\n document?: DocumentSchemaLookup,\n /**\n * The `oneOf` inferred from a bare `discriminator.mapping`, when the caller has\n * already computed it. `SchemaProperty` needs the same value to decide whether\n * to suppress the duplicate base object block, so it passes it here to avoid\n * inferring twice. Omit it and it is inferred from `value`.\n */\n inferredDiscriminatorComposition: SchemaObject | null = value\n ? inferDiscriminatorMappingComposition(value, document)\n : null,\n): CompositionToRender[] => {\n if (!value) {\n return []\n }\n\n return compositions\n .map((composition) => {\n if (composition === 'oneOf' && inferredDiscriminatorComposition) {\n return {\n composition,\n value: inferredDiscriminatorComposition,\n }\n }\n\n // Check for array item-level composition first (more specific case)\n if (shouldRenderArrayItemComposition(value, composition) && isArraySchema(value) && value.items) {\n return {\n composition,\n value: resolve.schema(value.items),\n }\n }\n\n // Check for property-level composition\n if (value[composition]) {\n // Skip if array items have this composition (even if complex/not rendered)\n const hasArrayItemComposition =\n isArraySchema(value) && value.items && typeof value.items === 'object' && composition in value.items\n\n if (!hasArrayItemComposition) {\n return {\n composition,\n value: resolve.schema(value),\n }\n }\n }\n\n return null\n })\n .filter(isDefined)\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAMA,KAAoC,MACxCC,EAAM,WAAW,IAAI,KAAKA,EAAM,SAAS,GAAG,IAAIA,IAAQ,wBAAwBA,KAWrEC,KACX,GACA,GAEA,MACwB;CACxB,IAAID,EAAM,SAASA,EAAM,OACvB,OAAO;CAKT,IAAME,IAAUF,EAAM,eAAe;CAErC,IAAI,CAACE,GACH,OAAO;CAKT,IAAMC,IAAWC,EAAcC,CAAY;CAE3C,IAAI,CAACF,GAAU,YAAY,SACzB,OAAO;CAGT,IAAMG,KAAQC,KAAe,OAAO,OAAOL,CAAO,EAAA,CAC/C,QAAQ,MAAyC,OAAOM,KAAiB,QAAQ,CAAC,CAClF,KAAK,MAAiB;EACrB,IAAMC,IAAMV,EAAiCS,CAAY,GACnDE,IAAUC,EAAWF,CAAG,GACxBG,IAAWF,IACbG,EAAQ,OAAOV,EAAS,YAAY,UAAUW,EAA2BJ,CAAO,EAAE,IAClF,KAAA;EAEJ,IAAKE,GAIL,OAAO;GACL,MAAMH;GACN,cAAcG;EAChB;CACF,CAAC,CAAC,CACD,OAAOG,CAAS;CAMnB,OAJIT,EAAK,WAAW,IACX,OAGF;EACL,GAAGO,EAAQ,OAAOb,CAAK;EACvB,OAAOM;CACT;AACF,GAQaU,KACX,GACA,GAOA,IAAwDhB,IACpDC,EAAqCD,GAAOG,CAAQ,IACpD,SAECH,IAIEiB,EACJ,KAAK,MACAC,MAAgB,WAAWC,IACtB;CACL;CACA,OAAOA;AACT,IAIEC,EAAiCpB,GAAOkB,CAAW,KAAKG,EAAcrB,CAAK,KAAKA,EAAM,QACjF;CACL;CACA,OAAOa,EAAQ,OAAOb,EAAM,KAAK;AACnC,IAIEA,EAAMkB,MAKJ,EAFFG,EAAcrB,CAAK,KAAKA,EAAM,SAAS,OAAOA,EAAM,SAAU,YAAYkB,KAAelB,EAAM,SAGxF;CACL;CACA,OAAOa,EAAQ,OAAOb,CAAK;AAC7B,IAIG,IACR,CAAC,CACD,OAAOe,CAAS,IApCV,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-discriminator-values.js","names":[],"sources":["../../../src/schema/helpers/get-discriminator-values.ts"],"sourcesContent":["import type { DiscriminatorObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\n/** Finds the payload values explicitly mapped to a referenced composition member. */\nexport const getDiscriminatorValues = (ref: string | undefined, mapping: DiscriminatorObject['mapping']): string[] => {\n if (!ref || !mapping) {\n return []\n }\n\n // A mapping can use either a URI reference or a local component name. Match\n // the whole reference so external schemas with the same name stay distinct.\n return Object.entries(mapping)\n .filter(([, target]) => target === ref || `#/components/schemas/${target}` === ref)\n .map(([value]) => value)\n}\n"],"mappings":";AAGA,IAAa,KAA0B,GAAyB,MAC1D,CAAC,KAAO,CAAC,IACJ,CAAC,IAKH,OAAO,QAAQ,CAAO,CAAC,CAC3B,QAAQ,GAAG,OAAY,MAAW,KAAO,wBAAwB,QAAa,CAAG,CAAC,CAClF,KAAK,CAAC,OAAW,CAAK"}
1
+ {"version":3,"file":"get-discriminator-values.js","names":["getDiscriminatorValues","ref","mapping","target","value"],"sources":["../../../src/schema/helpers/get-discriminator-values.ts"],"sourcesContent":["import type { DiscriminatorObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\n/** Finds the payload values explicitly mapped to a referenced composition member. */\nexport const getDiscriminatorValues = (ref: string | undefined, mapping: DiscriminatorObject['mapping']): string[] => {\n if (!ref || !mapping) {\n return []\n }\n\n // A mapping can use either a URI reference or a local component name. Match\n // the whole reference so external schemas with the same name stay distinct.\n return Object.entries(mapping)\n .filter(([, target]) => target === ref || `#/components/schemas/${target}` === ref)\n .map(([value]) => value)\n}\n"],"mappings":";AAGA,IAAaA,KAA0B,GAAyB,MAC1D,CAACC,KAAO,CAACC,IACJ,CAAC,IAKH,OAAO,QAAQA,CAAO,CAAC,CAC3B,QAAQ,GAAGC,OAAYA,MAAWF,KAAO,wBAAwBE,QAAaF,CAAG,CAAC,CAClF,KAAK,CAACG,OAAWA,CAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-enum-values.js","names":[],"sources":["../../../src/schema/helpers/get-enum-values.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\n/**\n * Extract enum values from schema or array items\n *\n * @param value - The schema object to extract enum values from\n * @returns Array of enum values, or empty array if no enum found\n */\nexport const getEnumValues = (value: SchemaObject | undefined): unknown[] => {\n if (!value) {\n return []\n }\n\n // Check for enum directly on the schema\n if (value.enum) {\n return value.enum\n }\n\n // Check for enum in array items (resolving $ref if present)\n if (isArraySchema(value) && typeof value.items === 'object') {\n const resolvedItems = resolve.schema(value.items)\n if (resolvedItems && 'enum' in resolvedItems && resolvedItems.enum) {\n return resolvedItems.enum\n }\n }\n\n return []\n}\n"],"mappings":";;;AAUA,IAAa,KAAiB,MAA+C;CAC3E,IAAI,CAAC,GACH,OAAO,CAAC;CAIV,IAAI,EAAM,MACR,OAAO,EAAM;CAIf,IAAI,EAAc,CAAK,KAAK,OAAO,EAAM,SAAU,UAAU;EAC3D,IAAM,IAAgB,EAAQ,OAAO,EAAM,KAAK;EAChD,IAAI,KAAiB,UAAU,KAAiB,EAAc,MAC5D,OAAO,EAAc;CAEzB;CAEA,OAAO,CAAC;AACV"}
1
+ {"version":3,"file":"get-enum-values.js","names":["getEnumValues","value","isArraySchema","resolvedItems","resolve"],"sources":["../../../src/schema/helpers/get-enum-values.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\n/**\n * Extract enum values from schema or array items\n *\n * @param value - The schema object to extract enum values from\n * @returns Array of enum values, or empty array if no enum found\n */\nexport const getEnumValues = (value: SchemaObject | undefined): unknown[] => {\n if (!value) {\n return []\n }\n\n // Check for enum directly on the schema\n if (value.enum) {\n return value.enum\n }\n\n // Check for enum in array items (resolving $ref if present)\n if (isArraySchema(value) && typeof value.items === 'object') {\n const resolvedItems = resolve.schema(value.items)\n if (resolvedItems && 'enum' in resolvedItems && resolvedItems.enum) {\n return resolvedItems.enum\n }\n }\n\n return []\n}\n"],"mappings":";;;AAUA,IAAaA,KAAiB,MAA+C;CAC3E,IAAI,CAACC,GACH,OAAO,CAAC;CAIV,IAAIA,EAAM,MACR,OAAOA,EAAM;CAIf,IAAIC,EAAcD,CAAK,KAAK,OAAOA,EAAM,SAAU,UAAU;EAC3D,IAAME,IAAgBC,EAAQ,OAAOH,EAAM,KAAK;EAChD,IAAIE,KAAiB,UAAUA,KAAiBA,EAAc,MAC5D,OAAOA,EAAc;CAEzB;CAEA,OAAO,CAAC;AACV"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-property-description.js","names":[],"sources":["../../../src/schema/helpers/get-property-description.ts"],"sourcesContent":["import type { ApiReferenceTranslationKey } from '@scalar/types/api-reference'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isSchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\ntype SchemaTranslationKey = Extract<ApiReferenceTranslationKey, `schema.${string}`>\n\n// Type descriptions for built-in types\nconst TYPE_DESCRIPTIONS: Record<string, Record<string, SchemaTranslationKey>> = {\n integer: {\n _default: 'schema.typeInteger',\n int32: 'schema.formatInt32',\n int64: 'schema.formatInt64',\n },\n string: {\n 'date': 'schema.formatDate',\n 'date-time': 'schema.formatDateTime',\n 'password': 'schema.formatPassword',\n 'base64': 'schema.formatBase64',\n 'byte': 'schema.formatBase64',\n 'binary': 'schema.formatBinary',\n },\n} as const\n\n/**\n * Get the translation key of the property description from type/format\n *\n * @param value - The schema object to generate description from\n * @returns Translation key or null if no description available\n */\nexport const getPropertyDescriptionKey = (value: SchemaObject | undefined): SchemaTranslationKey | null => {\n if (!isSchema(value)) {\n return null\n }\n /** Just grab the first type from the array if it's an array */\n const type = Array.isArray(value.type) ? value.type[0] : value.type\n if (!type) {\n return null\n }\n\n const typeDescriptions = TYPE_DESCRIPTIONS[type]\n if (!typeDescriptions) {\n return null\n }\n\n const format =\n ('format' in value && value.format) || ('contentEncoding' in value && value.contentEncoding) || '_default'\n return typeDescriptions[format] ?? null\n}\n"],"mappings":";;AAOA,IAAM,IAA0E;CAC9E,SAAS;EACP,UAAU;EACV,OAAO;EACP,OAAO;CACT;CACA,QAAQ;EACN,MAAQ;EACR,aAAa;EACb,UAAY;EACZ,QAAU;EACV,MAAQ;EACR,QAAU;CACZ;AACF,GAQa,KAA6B,MAAiE;CACzG,IAAI,CAAC,EAAS,CAAK,GACjB,OAAO;CAGT,IAAM,IAAO,MAAM,QAAQ,EAAM,IAAI,IAAI,EAAM,KAAK,KAAK,EAAM;CAC/D,IAAI,CAAC,GACH,OAAO;CAGT,IAAM,IAAmB,EAAkB;CAO3C,OANK,IAME,EADJ,YAAY,KAAS,EAAM,UAAY,qBAAqB,KAAS,EAAM,mBAAoB,eAC/D,OAL1B;AAMX"}
1
+ {"version":3,"file":"get-property-description.js","names":["TYPE_DESCRIPTIONS","\"date\"","\"password\"","\"base64\"","\"byte\"","\"binary\"","getPropertyDescriptionKey","isSchema","value","type","typeDescriptions"],"sources":["../../../src/schema/helpers/get-property-description.ts"],"sourcesContent":["import type { ApiReferenceTranslationKey } from '@scalar/types/api-reference'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isSchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\ntype SchemaTranslationKey = Extract<ApiReferenceTranslationKey, `schema.${string}`>\n\n// Type descriptions for built-in types\nconst TYPE_DESCRIPTIONS: Record<string, Record<string, SchemaTranslationKey>> = {\n integer: {\n _default: 'schema.typeInteger',\n int32: 'schema.formatInt32',\n int64: 'schema.formatInt64',\n },\n string: {\n 'date': 'schema.formatDate',\n 'date-time': 'schema.formatDateTime',\n 'password': 'schema.formatPassword',\n 'base64': 'schema.formatBase64',\n 'byte': 'schema.formatBase64',\n 'binary': 'schema.formatBinary',\n },\n} as const\n\n/**\n * Get the translation key of the property description from type/format\n *\n * @param value - The schema object to generate description from\n * @returns Translation key or null if no description available\n */\nexport const getPropertyDescriptionKey = (value: SchemaObject | undefined): SchemaTranslationKey | null => {\n if (!isSchema(value)) {\n return null\n }\n /** Just grab the first type from the array if it's an array */\n const type = Array.isArray(value.type) ? value.type[0] : value.type\n if (!type) {\n return null\n }\n\n const typeDescriptions = TYPE_DESCRIPTIONS[type]\n if (!typeDescriptions) {\n return null\n }\n\n const format =\n ('format' in value && value.format) || ('contentEncoding' in value && value.contentEncoding) || '_default'\n return typeDescriptions[format] ?? null\n}\n"],"mappings":";;AAOA,IAAMA,IAA0E;CAC9E,SAAS;EACP,UAAU;EACV,OAAO;EACP,OAAO;CACT;CACA,QAAQ;EACNC,MAAQ;EACR,aAAa;EACbC,UAAY;EACZC,QAAU;EACVC,MAAQ;EACRC,QAAU;CACZ;AACF,GAQaC,KAA6B,MAAiE;CACzG,IAAI,CAACC,EAASC,CAAK,GACjB,OAAO;CAGT,IAAMC,IAAO,MAAM,QAAQD,EAAM,IAAI,IAAIA,EAAM,KAAK,KAAKA,EAAM;CAC/D,IAAI,CAACC,GACH,OAAO;CAGT,IAAMC,IAAmBV,EAAkBS;CAO3C,OANKC,IAMEA,EADJ,YAAYF,KAASA,EAAM,UAAY,qBAAqBA,KAASA,EAAM,mBAAoB,eAC/D,OAL1B;AAMX"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-ref-name.js","names":[],"sources":["../../../src/schema/helpers/get-ref-name.ts"],"sourcesContent":["import { REGEX } from '@scalar/helpers/regex/regex-helpers'\n\n/**\n * Gets the final reference segment for display, including external references.\n * Use getSchemaRefName when the name must link to a local model.\n *\n * @example SchemaName from #/components/schemas/SchemaName\n */\nexport const getRefName = (ref: string) => {\n if (!ref) {\n return null\n }\n\n const match = ref.match(REGEX.REF_NAME)\n if (match) {\n return match[1]\n }\n\n return null\n}\n\n/**\n * Matches a local reference that points at `#/components/schemas/<name>` and\n * captures the schema name. Intentionally strict: only refs that resolve to a\n * navigable model in `components.schemas` should be linkable.\n */\nconst COMPONENTS_SCHEMAS_REF = /^#\\/components\\/schemas\\/([^/]+)$/\n\n/**\n * Gets the models-section key for a `$ref`, but only when the ref actually\n * targets `#/components/schemas/`.\n *\n * The models index used for navigation is built exclusively from\n * `components.schemas`, so a ref into any other bucket (`parameters`,\n * `responses`, ...) or an external file (`./other.yaml#/Foo`) has no navigable\n * target. Returning `null` for those keeps the name visible as plain text while\n * avoiding a dead link.\n *\n * @example\n * getSchemaRefName('#/components/schemas/Planet') // 'Planet'\n * getSchemaRefName('#/components/parameters/Planet') // null\n * getSchemaRefName('./planets.yaml#/Planet') // null\n */\nexport const getSchemaRefName = (ref: string): string | null => {\n if (!ref) {\n return null\n }\n\n const match = ref.match(COMPONENTS_SCHEMAS_REF)\n if (match?.[1]) {\n return decodeURIComponent(match[1])\n }\n\n return null\n}\n"],"mappings":";;AAQA,IAAa,KAAc,MAAgB;CACzC,IAAI,CAAC,GACH,OAAO;CAGT,IAAM,IAAQ,EAAI,MAAM,EAAM,QAAQ;CAKtC,OAJI,IACK,EAAM,KAGR;AACT,GAOM,IAAyB,qCAiBlB,KAAoB,MAA+B;CAC9D,IAAI,CAAC,GACH,OAAO;CAGT,IAAM,IAAQ,EAAI,MAAM,CAAsB;CAK9C,OAJI,IAAQ,KACH,mBAAmB,EAAM,EAAE,IAG7B;AACT"}
1
+ {"version":3,"file":"get-ref-name.js","names":["getRefName","ref","match","REGEX","COMPONENTS_SCHEMAS_REF","getSchemaRefName"],"sources":["../../../src/schema/helpers/get-ref-name.ts"],"sourcesContent":["import { REGEX } from '@scalar/helpers/regex/regex-helpers'\n\n/**\n * Gets the final reference segment for display, including external references.\n * Use getSchemaRefName when the name must link to a local model.\n *\n * @example SchemaName from #/components/schemas/SchemaName\n */\nexport const getRefName = (ref: string) => {\n if (!ref) {\n return null\n }\n\n const match = ref.match(REGEX.REF_NAME)\n if (match) {\n return match[1]\n }\n\n return null\n}\n\n/**\n * Matches a local reference that points at `#/components/schemas/<name>` and\n * captures the schema name. Intentionally strict: only refs that resolve to a\n * navigable model in `components.schemas` should be linkable.\n */\nconst COMPONENTS_SCHEMAS_REF = /^#\\/components\\/schemas\\/([^/]+)$/\n\n/**\n * Gets the models-section key for a `$ref`, but only when the ref actually\n * targets `#/components/schemas/`.\n *\n * The models index used for navigation is built exclusively from\n * `components.schemas`, so a ref into any other bucket (`parameters`,\n * `responses`, ...) or an external file (`./other.yaml#/Foo`) has no navigable\n * target. Returning `null` for those keeps the name visible as plain text while\n * avoiding a dead link.\n *\n * @example\n * getSchemaRefName('#/components/schemas/Planet') // 'Planet'\n * getSchemaRefName('#/components/parameters/Planet') // null\n * getSchemaRefName('./planets.yaml#/Planet') // null\n */\nexport const getSchemaRefName = (ref: string): string | null => {\n if (!ref) {\n return null\n }\n\n const match = ref.match(COMPONENTS_SCHEMAS_REF)\n if (match?.[1]) {\n return decodeURIComponent(match[1])\n }\n\n return null\n}\n"],"mappings":";;AAQA,IAAaA,KAAc,MAAgB;CACzC,IAAI,CAACC,GACH,OAAO;CAGT,IAAMC,IAAQD,EAAI,MAAME,EAAM,QAAQ;CAKtC,OAJID,IACKA,EAAM,KAGR;AACT,GAOME,IAAyB,qCAiBlBC,KAAoB,MAA+B;CAC9D,IAAI,CAACJ,GACH,OAAO;CAGT,IAAMC,IAAQD,EAAI,MAAMG,CAAsB;CAK9C,OAJIF,IAAQ,KACH,mBAAmBA,EAAM,EAAE,IAG7B;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-schema-type.js","names":[],"sources":["../../../src/schema/helpers/get-schema-type.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\n/**\n * Formats an array type string with proper wrapping for union types.\n */\nconst formatArrayType = (itemType: string): string => {\n if (!itemType) {\n return 'array'\n }\n\n const wrappedItemType = itemType.includes(' | ') ? `(${itemType})` : itemType\n return `array ${wrappedItemType}[]`\n}\n\n/**\n * Handles array type processing for both single array types and union types containing array.\n */\nconst processArrayType = (value: Extract<SchemaObject, { type: 'array' }>, isUnionType: boolean = false): string => {\n if (!value.items) {\n return 'array'\n }\n\n const itemType = getSchemaType(resolve.schema(value.items))\n const baseType = formatArrayType(itemType)\n\n if (isUnionType) {\n return baseType\n }\n\n // Handle nullable arrays for non-union types\n return (value as any).nullable ? `${baseType} | null` : baseType\n}\n\n/**\n * Computes the structural type for a schema.\n * This helper always returns type information, never schema titles or ref names.\n *\n * Priority order:\n * 1. const values\n * 2. Array types (with special handling for items)\n * 3. type with contentEncoding\n * 4. raw type\n */\nexport const getSchemaType = (valueOrRef: SchemaObject | ReferenceType<SchemaObject>): string => {\n // Early return for falsy values\n if (!valueOrRef) {\n return ''\n }\n\n const value = resolve.schema(valueOrRef)\n\n // Handle const values first (highest priority)\n if (value.const !== undefined) {\n return 'const'\n }\n\n // Handle union types (array of types)\n if ('type' in value && Array.isArray(value.type)) {\n // Special case: union types containing 'array'\n // TODO: Correctly type array of types in SchemaObject\n if (value.type.includes('array') && (value as Extract<SchemaObject, { type: 'array' }>).items) {\n const arrayType = processArrayType(value as Extract<SchemaObject, { type: 'array' }>, true)\n const otherTypes = value.type.filter((t) => t !== 'array')\n\n return otherTypes.length > 0 ? `${arrayType} | ${otherTypes.join(' | ')}` : arrayType\n }\n\n // Regular union types\n return value.type.join(' | ')\n }\n\n // Handle single array type\n if (isArraySchema(value)) {\n return processArrayType(value, false)\n }\n\n // Handle type with content encoding\n if ('type' in value && value.type && value.contentEncoding) {\n return `${value.type} • ${value.contentEncoding}`\n }\n\n // Fallback to raw type\n return 'type' in value ? (value.type as string) : ''\n}\n"],"mappings":";;;AAOA,IAAM,KAAmB,MAClB,IAKE,SADiB,EAAS,SAAS,KAAK,IAAI,IAAI,EAAS,KAAK,EACrC,MAJvB,SAUL,KAAoB,GAAiD,IAAuB,OAAkB;CAClH,IAAI,CAAC,EAAM,OACT,OAAO;CAIT,IAAM,IAAW,EADA,EAAc,EAAQ,OAAO,EAAM,KAAK,CACxB,CAAQ;CAOzC,OALI,IACK,IAID,EAAc,WAAW,GAAG,EAAS,WAAW;AAC1D,GAYa,KAAiB,MAAmE;CAE/F,IAAI,CAAC,GACH,OAAO;CAGT,IAAM,IAAQ,EAAQ,OAAO,CAAU;CAGvC,IAAI,EAAM,UAAU,KAAA,GAClB,OAAO;CAIT,IAAI,UAAU,KAAS,MAAM,QAAQ,EAAM,IAAI,GAAG;EAGhD,IAAI,EAAM,KAAK,SAAS,OAAO,KAAM,EAAmD,OAAO;GAC7F,IAAM,IAAY,EAAiB,GAAmD,EAAI,GACpF,IAAa,EAAM,KAAK,QAAQ,MAAM,MAAM,OAAO;GAEzD,OAAO,EAAW,SAAS,IAAI,GAAG,EAAU,KAAK,EAAW,KAAK,KAAK,MAAM;EAC9E;EAGA,OAAO,EAAM,KAAK,KAAK,KAAK;CAC9B;CAaA,OAVI,EAAc,CAAK,IACd,EAAiB,GAAO,EAAK,IAIlC,UAAU,KAAS,EAAM,QAAQ,EAAM,kBAClC,GAAG,EAAM,KAAK,KAAK,EAAM,oBAI3B,UAAU,IAAS,EAAM,OAAkB;AACpD"}
1
+ {"version":3,"file":"get-schema-type.js","names":["formatArrayType","itemType","processArrayType","value","baseType","getSchemaType","resolve","isUnionType","valueOrRef","arrayType","otherTypes","t","isArraySchema"],"sources":["../../../src/schema/helpers/get-schema-type.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\n/**\n * Formats an array type string with proper wrapping for union types.\n */\nconst formatArrayType = (itemType: string): string => {\n if (!itemType) {\n return 'array'\n }\n\n const wrappedItemType = itemType.includes(' | ') ? `(${itemType})` : itemType\n return `array ${wrappedItemType}[]`\n}\n\n/**\n * Handles array type processing for both single array types and union types containing array.\n */\nconst processArrayType = (value: Extract<SchemaObject, { type: 'array' }>, isUnionType: boolean = false): string => {\n if (!value.items) {\n return 'array'\n }\n\n const itemType = getSchemaType(resolve.schema(value.items))\n const baseType = formatArrayType(itemType)\n\n if (isUnionType) {\n return baseType\n }\n\n // Handle nullable arrays for non-union types\n return (value as any).nullable ? `${baseType} | null` : baseType\n}\n\n/**\n * Computes the structural type for a schema.\n * This helper always returns type information, never schema titles or ref names.\n *\n * Priority order:\n * 1. const values\n * 2. Array types (with special handling for items)\n * 3. type with contentEncoding\n * 4. raw type\n */\nexport const getSchemaType = (valueOrRef: SchemaObject | ReferenceType<SchemaObject>): string => {\n // Early return for falsy values\n if (!valueOrRef) {\n return ''\n }\n\n const value = resolve.schema(valueOrRef)\n\n // Handle const values first (highest priority)\n if (value.const !== undefined) {\n return 'const'\n }\n\n // Handle union types (array of types)\n if ('type' in value && Array.isArray(value.type)) {\n // Special case: union types containing 'array'\n // TODO: Correctly type array of types in SchemaObject\n if (value.type.includes('array') && (value as Extract<SchemaObject, { type: 'array' }>).items) {\n const arrayType = processArrayType(value as Extract<SchemaObject, { type: 'array' }>, true)\n const otherTypes = value.type.filter((t) => t !== 'array')\n\n return otherTypes.length > 0 ? `${arrayType} | ${otherTypes.join(' | ')}` : arrayType\n }\n\n // Regular union types\n return value.type.join(' | ')\n }\n\n // Handle single array type\n if (isArraySchema(value)) {\n return processArrayType(value, false)\n }\n\n // Handle type with content encoding\n if ('type' in value && value.type && value.contentEncoding) {\n return `${value.type} • ${value.contentEncoding}`\n }\n\n // Fallback to raw type\n return 'type' in value ? (value.type as string) : ''\n}\n"],"mappings":";;;AAOA,IAAMA,KAAmB,MAClBC,IAKE,SADiBA,EAAS,SAAS,KAAK,IAAI,IAAIA,EAAS,KAAKA,EACrC,MAJvB,SAULC,KAAoB,GAAiD,IAAuB,OAAkB;CAClH,IAAI,CAACC,EAAM,OACT,OAAO;CAIT,IAAMC,IAAWJ,EADAK,EAAcC,EAAQ,OAAOH,EAAM,KAAK,CACxB,CAAQ;CAOzC,OALII,IACKH,IAIDD,EAAc,WAAW,GAAGC,EAAS,WAAWA;AAC1D,GAYaC,KAAiB,MAAmE;CAE/F,IAAI,CAACG,GACH,OAAO;CAGT,IAAML,IAAQG,EAAQ,OAAOE,CAAU;CAGvC,IAAIL,EAAM,UAAU,KAAA,GAClB,OAAO;CAIT,IAAI,UAAUA,KAAS,MAAM,QAAQA,EAAM,IAAI,GAAG;EAGhD,IAAIA,EAAM,KAAK,SAAS,OAAO,KAAMA,EAAmD,OAAO;GAC7F,IAAMM,IAAYP,EAAiBC,GAAmD,EAAI,GACpFO,IAAaP,EAAM,KAAK,QAAQ,MAAMQ,MAAM,OAAO;GAEzD,OAAOD,EAAW,SAAS,IAAI,GAAGD,EAAU,KAAKC,EAAW,KAAK,KAAK,MAAMD;EAC9E;EAGA,OAAON,EAAM,KAAK,KAAK,KAAK;CAC9B;CAaA,OAVIS,EAAcT,CAAK,IACdD,EAAiBC,GAAO,EAAK,IAIlC,UAAUA,KAASA,EAAM,QAAQA,EAAM,kBAClC,GAAGA,EAAM,KAAK,KAAKA,EAAM,oBAI3B,UAAUA,IAASA,EAAM,OAAkB;AACpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-type-signature-tokens.js","names":[],"sources":["../../../src/schema/helpers/get-type-signature-tokens.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport { getRefName } from './get-ref-name'\n\n/**\n * One run of a type signature. `word` is English describing a shape (`array of`,\n * `or`) in the sans face; `ident` is something the reader would type (a model\n * name, a type keyword) in the code face; `literal` is an enum or const value\n * quoted as JSON; `punctuation` is the muted `|` between union members.\n */\ntype TypeSignatureToken = {\n kind: 'word' | 'ident' | 'literal' | 'punctuation'\n text: string\n}\n\n/** Enums up to this many values render inline in the type position. */\nconst INLINE_ENUM_LIMIT = 3\n\n/** Extensions that attach meaning to individual enum values. */\nconst ENUM_ANNOTATION_KEYS = ['x-enumDescriptions', 'x-enum-descriptions', 'x-enum-varnames', 'x-enumNames'] as const\n\n/** Quote an enum or const value the way JSON would. */\nconst formatLiteral = (value: unknown): string => {\n // Objects and arrays have no meaningful String() form (`[object Object]`), so\n // serialize them the way JSON would; primitives keep their existing rendering.\n if (value !== null && typeof value === 'object') {\n return JSON.stringify(value)\n }\n\n return typeof value === 'string' ? `\"${value}\"` : String(value)\n}\n\nconst word = (text: string): TypeSignatureToken => ({ kind: 'word', text })\nconst ident = (text: string): TypeSignatureToken => ({ kind: 'ident', text })\nconst literal = (text: string): TypeSignatureToken => ({\n kind: 'literal',\n text,\n})\nconst pipe = (): TypeSignatureToken => ({ kind: 'punctuation', text: '|' })\n\n/** Join token lists with a separator token, like Array.prototype.join. */\nconst joinTokens = (lists: TypeSignatureToken[][], separator: () => TypeSignatureToken[]): TypeSignatureToken[] =>\n lists.flatMap((tokens, index) => (index === 0 ? tokens : [...separator(), ...tokens]))\n\n/**\n * Whether the signature will actually render this schema's enum values inline.\n * SchemaProperty drops the separate value list for short enums on that\n * assumption, so it must be checked: a `$ref` renders as the model name before\n * reaching the enum branch, and a schema with no `type` renders no type detail,\n * so in both cases the values would otherwise be shown nowhere.\n */\nexport const typeSignatureInlinesEnum = (\n valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined,\n options: { hideModelNames?: boolean } = {},\n /** Set when recursing into an array's items, which need no `type` of their own. */\n isItems = false,\n): boolean => {\n if (!valueOrRef || typeof valueOrRef !== 'object') {\n return false\n }\n\n // A named $ref returns the model name before ever reaching the enum branch.\n if (\n '$ref' in valueOrRef &&\n typeof valueOrRef.$ref === 'string' &&\n !options.hideModelNames &&\n getRefName(valueOrRef.$ref)\n ) {\n return false\n }\n\n // Display normalization can retain $ref alongside its resolved fields without\n // $ref-value. The structural view keeps those fields when names are hidden.\n const value = options.hideModelNames ? resolve.schema(valueOrRef) : getResolvedRef(valueOrRef)\n\n if (!value || typeof value !== 'object' || value.const !== undefined) {\n return false\n }\n\n // Bare literals cannot carry `x-enumDescriptions` or `x-enum-varnames`, so an\n // annotated enum keeps its value list (SchemaEnums' chip branch does the same).\n const annotated = ENUM_ANNOTATION_KEYS.some((key) => value[key])\n\n // getTypeSignatureTokens checks the schema's own enum right after const —\n // before any `type` handling — so a short, unannotated enum inlines whether or\n // not the schema has a `type`, and even when the type is `array` (e.g. a\n // schema carrying both `enum` and `type: array`). Mirror that order here, or\n // the value list renders a second copy of the same values.\n if (!annotated && Array.isArray(value.enum) && value.enum.length > 0 && value.enum.length <= INLINE_ENUM_LIMIT) {\n return true\n }\n\n // Past the enum branch, a schema with no `type` renders no signature to carry\n // the values. Items are exempt: the array signature's enum branch needs no\n // `type` of its own.\n if (!isItems && !('type' in value)) {\n return false\n }\n\n const type = 'type' in value ? value.type : undefined\n\n // `type: ['array', 'null']` takes the union branch, which still recurses into\n // items, so it inlines the item enum exactly like a plain array.\n const isArrayType = type === 'array' || (Array.isArray(type) && type.includes('array'))\n\n // An array with no own enum inlines its ITEMS' enum, resolved the same way\n // getEnumValues does, so the items must be tested here or the values render\n // twice.\n const items = 'items' in value ? value.items : undefined\n\n if (isArrayType && items && typeof items === 'object') {\n return typeSignatureInlinesEnum(items as SchemaObject, options, true)\n }\n\n return false\n}\n\n/**\n * Compute the type signature of a schema as token runs: `array Planet[]` becomes\n * `array of Planet`, where \"array of\" is English and `Planet` stays an\n * identifier. Short enums render inline (`\"standard\" or \"enterprise\"`) because\n * two values are a type, not a list worth its own rows. A `$ref` to a named\n * model renders as the model name itself.\n */\nexport const getTypeSignatureTokens = (\n valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined,\n options: { hideModelNames?: boolean } = {},\n depth = 0,\n): TypeSignatureToken[] => {\n if (!valueOrRef || typeof valueOrRef !== 'object') {\n return []\n }\n\n // A $ref to a named model: the name is the type.\n if ('$ref' in valueOrRef && typeof valueOrRef.$ref === 'string') {\n const refName = options.hideModelNames ? null : getRefName(valueOrRef.$ref)\n\n if (refName) {\n return [ident(refName)]\n }\n }\n\n // Display normalization can retain $ref alongside its resolved fields without\n // $ref-value. The structural view keeps those fields when names are hidden.\n const value = options.hideModelNames ? resolve.schema(valueOrRef) : getResolvedRef(valueOrRef)\n\n if (!value || typeof value !== 'object') {\n return []\n }\n\n // const renders as its value, not as the word \"const\".\n if (value.const !== undefined) {\n return [literal(formatLiteral(value.const))]\n }\n\n // A short enum is the type, inline, unless its values carry descriptions or\n // names, which only the value list can show.\n if (\n Array.isArray(value.enum) &&\n value.enum.length > 0 &&\n value.enum.length <= INLINE_ENUM_LIMIT &&\n !ENUM_ANNOTATION_KEYS.some((key) => value[key])\n ) {\n return joinTokens(\n value.enum.map((entry) => [literal(formatLiteral(entry))]),\n () => [word('or')],\n )\n }\n\n // Union types: string | null with the pipe muted.\n if ('type' in value && Array.isArray(value.type)) {\n return joinTokens(\n value.type.map((entry) => (entry === 'array' ? arrayTokens(value, options, depth) : [ident(String(entry))])),\n () => [pipe()],\n )\n }\n\n if ('type' in value && value.type === 'array') {\n return arrayTokens(value, options, depth)\n }\n\n if ('type' in value && value.type && value.contentEncoding) {\n return [ident(String(value.type)), word('•'), ident(value.contentEncoding)]\n }\n\n if ('type' in value && value.type) {\n return [ident(String(value.type))]\n }\n\n return []\n}\n\n/**\n * The tokens a row shows: the raw signature, renamed to the caller's resolved\n * model name where the two would disagree.\n *\n * A `$ref` renders as the raw component key while the heading link and the\n * models section show the target's `title`; the caller's name keeps them in\n * agreement. Only a `$ref` may be renamed: an inline schema's\n * single token is its real type (`integer`), not its `title`.\n */\nexport const getDisplayTypeSignatureTokens = (\n valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined,\n options: { hideModelNames?: boolean; modelName?: string | null } = {},\n): TypeSignatureToken[] => {\n const computedTokens = getTypeSignatureTokens(valueOrRef, { hideModelNames: options.hideModelNames })\n const modelName = options.modelName\n\n if (options.hideModelNames || !modelName) {\n return computedTokens\n }\n\n const isRef = (value: unknown): boolean => !!value && typeof value === 'object' && '$ref' in value\n\n // Nothing to render, or a bare `object` that the name describes better.\n if (computedTokens.length === 0 || (computedTokens.length === 1 && computedTokens[0]?.text === 'object')) {\n return [ident(modelName)]\n }\n\n // A direct `$ref`: the single identifier IS the raw key.\n if (\n isRef(valueOrRef) &&\n computedTokens.length === 1 &&\n computedTokens[0]?.kind === 'ident' &&\n computedTokens[0]?.text !== modelName\n ) {\n return [ident(modelName)]\n }\n\n /*\n * An array of a `$ref` keeps its \"array of\" word and renames only the item.\n * Only a caller name with a trailing `[]` describes the ITEM; the caller also\n * reports the array's OWN name here (a `$ref` to `FilterList`, an inline\n * `title` of `Planets`), and using that would claim each element is one.\n */\n const items = valueOrRef && typeof valueOrRef === 'object' && 'items' in valueOrRef ? valueOrRef.items : undefined\n\n const arrayWord = computedTokens[0]\n const itemToken = computedTokens[1]\n\n if (isRef(items) && computedTokens.length === 2 && arrayWord?.kind === 'word' && itemToken?.kind === 'ident') {\n if (modelName.endsWith('[]')) {\n const itemName = modelName.slice(0, -2)\n\n if (itemName && itemName !== itemToken.text) {\n return [arrayWord, ident(itemName)]\n }\n }\n }\n\n return computedTokens\n}\n\n/** Guard against a pathological items chain; deeper than this reads as noise anyway. */\nconst MAX_ARRAY_DEPTH = 8\n\nconst arrayTokens = (\n value: SchemaObject,\n options: { hideModelNames?: boolean },\n depth: number,\n): TypeSignatureToken[] => {\n const items = 'items' in value ? value.items : undefined\n\n if (!items || depth >= MAX_ARRAY_DEPTH) {\n return [ident('array')]\n }\n\n const itemTokens = getTypeSignatureTokens(items as SchemaObject | ReferenceType<SchemaObject>, options, depth + 1)\n\n if (itemTokens.length === 0) {\n return [ident('array')]\n }\n\n return [word('array of'), ...itemTokens]\n}\n"],"mappings":";;;;AAkBA,IAAM,IAAoB,GAGpB,IAAuB;CAAC;CAAsB;CAAuB;CAAmB;AAAa,GAGrG,KAAiB,MAGC,OAAO,KAAU,YAAnC,IACK,KAAK,UAAU,CAAK,IAGtB,OAAO,KAAU,WAAW,IAAI,EAAM,KAAK,OAAO,CAAK,GAG1D,KAAQ,OAAsC;CAAE,MAAM;CAAQ;AAAK,IACnE,KAAS,OAAsC;CAAE,MAAM;CAAS;AAAK,IACrE,KAAW,OAAsC;CACrD,MAAM;CACN;AACF,IACM,WAAkC;CAAE,MAAM;CAAe,MAAM;AAAI,IAGnE,KAAc,GAA+B,MACjD,EAAM,SAAS,GAAQ,MAAW,MAAU,IAAI,IAAS,CAAC,GAAG,EAAU,GAAG,GAAG,CAAM,CAAE,GAS1E,KACX,GACA,IAAwC,CAAC,GAEzC,IAAU,OACE;CAMZ,IALI,CAAC,KAAc,OAAO,KAAe,YAMvC,UAAU,KACV,OAAO,EAAW,QAAS,YAC3B,CAAC,EAAQ,kBACT,EAAW,EAAW,IAAI,GAE1B,OAAO;CAKT,IAAM,IAAQ,EAAQ,iBAAiB,EAAQ,OAAO,CAAU,IAAI,EAAe,CAAU;CAE7F,IAAI,CAAC,KAAS,OAAO,KAAU,YAAY,EAAM,UAAU,KAAA,GACzD,OAAO;CAYT,IAAI,CAPc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IAAM,IAAQ,WAAW,IAAQ,EAAM,QAAQ,KAAA;CAE/C,IAAI,CAAC,KAAS,KAAS,GACrB,OAAO,CAAC,EAAM,OAAO,CAAC;CAGxB,IAAM,IAAa,EAAuB,GAAqD,GAAS,IAAQ,CAAC;CAMjH,OAJI,EAAW,WAAW,IACjB,CAAC,EAAM,OAAO,CAAC,IAGjB,CAAC,EAAK,UAAU,GAAG,GAAG,CAAU;AACzC"}
1
+ {"version":3,"file":"get-type-signature-tokens.js","names":["INLINE_ENUM_LIMIT","ENUM_ANNOTATION_KEYS","formatLiteral","value","word","ident","literal","pipe","joinTokens","lists","index","tokens","separator","typeSignatureInlinesEnum","valueOrRef","options","getRefName","resolve","getResolvedRef","key","isItems","type","isArrayType","items","getTypeSignatureTokens","refName","entry","arrayTokens","depth","getDisplayTypeSignatureTokens","computedTokens","modelName","isRef","arrayWord","itemToken","itemName","MAX_ARRAY_DEPTH","itemTokens"],"sources":["../../../src/schema/helpers/get-type-signature-tokens.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport { getRefName } from './get-ref-name'\n\n/**\n * One run of a type signature. `word` is English describing a shape (`array of`,\n * `or`) in the sans face; `ident` is something the reader would type (a model\n * name, a type keyword) in the code face; `literal` is an enum or const value\n * quoted as JSON; `punctuation` is the muted `|` between union members.\n */\ntype TypeSignatureToken = {\n kind: 'word' | 'ident' | 'literal' | 'punctuation'\n text: string\n}\n\n/** Enums up to this many values render inline in the type position. */\nconst INLINE_ENUM_LIMIT = 3\n\n/** Extensions that attach meaning to individual enum values. */\nconst ENUM_ANNOTATION_KEYS = ['x-enumDescriptions', 'x-enum-descriptions', 'x-enum-varnames', 'x-enumNames'] as const\n\n/** Quote an enum or const value the way JSON would. */\nconst formatLiteral = (value: unknown): string => {\n // Objects and arrays have no meaningful String() form (`[object Object]`), so\n // serialize them the way JSON would; primitives keep their existing rendering.\n if (value !== null && typeof value === 'object') {\n return JSON.stringify(value)\n }\n\n return typeof value === 'string' ? `\"${value}\"` : String(value)\n}\n\nconst word = (text: string): TypeSignatureToken => ({ kind: 'word', text })\nconst ident = (text: string): TypeSignatureToken => ({ kind: 'ident', text })\nconst literal = (text: string): TypeSignatureToken => ({\n kind: 'literal',\n text,\n})\nconst pipe = (): TypeSignatureToken => ({ kind: 'punctuation', text: '|' })\n\n/** Join token lists with a separator token, like Array.prototype.join. */\nconst joinTokens = (lists: TypeSignatureToken[][], separator: () => TypeSignatureToken[]): TypeSignatureToken[] =>\n lists.flatMap((tokens, index) => (index === 0 ? tokens : [...separator(), ...tokens]))\n\n/**\n * Whether the signature will actually render this schema's enum values inline.\n * SchemaProperty drops the separate value list for short enums on that\n * assumption, so it must be checked: a `$ref` renders as the model name before\n * reaching the enum branch, and a schema with no `type` renders no type detail,\n * so in both cases the values would otherwise be shown nowhere.\n */\nexport const typeSignatureInlinesEnum = (\n valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined,\n options: { hideModelNames?: boolean } = {},\n /** Set when recursing into an array's items, which need no `type` of their own. */\n isItems = false,\n): boolean => {\n if (!valueOrRef || typeof valueOrRef !== 'object') {\n return false\n }\n\n // A named $ref returns the model name before ever reaching the enum branch.\n if (\n '$ref' in valueOrRef &&\n typeof valueOrRef.$ref === 'string' &&\n !options.hideModelNames &&\n getRefName(valueOrRef.$ref)\n ) {\n return false\n }\n\n // Display normalization can retain $ref alongside its resolved fields without\n // $ref-value. The structural view keeps those fields when names are hidden.\n const value = options.hideModelNames ? resolve.schema(valueOrRef) : getResolvedRef(valueOrRef)\n\n if (!value || typeof value !== 'object' || value.const !== undefined) {\n return false\n }\n\n // Bare literals cannot carry `x-enumDescriptions` or `x-enum-varnames`, so an\n // annotated enum keeps its value list (SchemaEnums' chip branch does the same).\n const annotated = ENUM_ANNOTATION_KEYS.some((key) => value[key])\n\n // getTypeSignatureTokens checks the schema's own enum right after const —\n // before any `type` handling — so a short, unannotated enum inlines whether or\n // not the schema has a `type`, and even when the type is `array` (e.g. a\n // schema carrying both `enum` and `type: array`). Mirror that order here, or\n // the value list renders a second copy of the same values.\n if (!annotated && Array.isArray(value.enum) && value.enum.length > 0 && value.enum.length <= INLINE_ENUM_LIMIT) {\n return true\n }\n\n // Past the enum branch, a schema with no `type` renders no signature to carry\n // the values. Items are exempt: the array signature's enum branch needs no\n // `type` of its own.\n if (!isItems && !('type' in value)) {\n return false\n }\n\n const type = 'type' in value ? value.type : undefined\n\n // `type: ['array', 'null']` takes the union branch, which still recurses into\n // items, so it inlines the item enum exactly like a plain array.\n const isArrayType = type === 'array' || (Array.isArray(type) && type.includes('array'))\n\n // An array with no own enum inlines its ITEMS' enum, resolved the same way\n // getEnumValues does, so the items must be tested here or the values render\n // twice.\n const items = 'items' in value ? value.items : undefined\n\n if (isArrayType && items && typeof items === 'object') {\n return typeSignatureInlinesEnum(items as SchemaObject, options, true)\n }\n\n return false\n}\n\n/**\n * Compute the type signature of a schema as token runs: `array Planet[]` becomes\n * `array of Planet`, where \"array of\" is English and `Planet` stays an\n * identifier. Short enums render inline (`\"standard\" or \"enterprise\"`) because\n * two values are a type, not a list worth its own rows. A `$ref` to a named\n * model renders as the model name itself.\n */\nexport const getTypeSignatureTokens = (\n valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined,\n options: { hideModelNames?: boolean } = {},\n depth = 0,\n): TypeSignatureToken[] => {\n if (!valueOrRef || typeof valueOrRef !== 'object') {\n return []\n }\n\n // A $ref to a named model: the name is the type.\n if ('$ref' in valueOrRef && typeof valueOrRef.$ref === 'string') {\n const refName = options.hideModelNames ? null : getRefName(valueOrRef.$ref)\n\n if (refName) {\n return [ident(refName)]\n }\n }\n\n // Display normalization can retain $ref alongside its resolved fields without\n // $ref-value. The structural view keeps those fields when names are hidden.\n const value = options.hideModelNames ? resolve.schema(valueOrRef) : getResolvedRef(valueOrRef)\n\n if (!value || typeof value !== 'object') {\n return []\n }\n\n // const renders as its value, not as the word \"const\".\n if (value.const !== undefined) {\n return [literal(formatLiteral(value.const))]\n }\n\n // A short enum is the type, inline, unless its values carry descriptions or\n // names, which only the value list can show.\n if (\n Array.isArray(value.enum) &&\n value.enum.length > 0 &&\n value.enum.length <= INLINE_ENUM_LIMIT &&\n !ENUM_ANNOTATION_KEYS.some((key) => value[key])\n ) {\n return joinTokens(\n value.enum.map((entry) => [literal(formatLiteral(entry))]),\n () => [word('or')],\n )\n }\n\n // Union types: string | null with the pipe muted.\n if ('type' in value && Array.isArray(value.type)) {\n return joinTokens(\n value.type.map((entry) => (entry === 'array' ? arrayTokens(value, options, depth) : [ident(String(entry))])),\n () => [pipe()],\n )\n }\n\n if ('type' in value && value.type === 'array') {\n return arrayTokens(value, options, depth)\n }\n\n if ('type' in value && value.type && value.contentEncoding) {\n return [ident(String(value.type)), word('•'), ident(value.contentEncoding)]\n }\n\n if ('type' in value && value.type) {\n return [ident(String(value.type))]\n }\n\n return []\n}\n\n/**\n * The tokens a row shows: the raw signature, renamed to the caller's resolved\n * model name where the two would disagree.\n *\n * A `$ref` renders as the raw component key while the heading link and the\n * models section show the target's `title`; the caller's name keeps them in\n * agreement. Only a `$ref` may be renamed: an inline schema's\n * single token is its real type (`integer`), not its `title`.\n */\nexport const getDisplayTypeSignatureTokens = (\n valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined,\n options: { hideModelNames?: boolean; modelName?: string | null } = {},\n): TypeSignatureToken[] => {\n const computedTokens = getTypeSignatureTokens(valueOrRef, { hideModelNames: options.hideModelNames })\n const modelName = options.modelName\n\n if (options.hideModelNames || !modelName) {\n return computedTokens\n }\n\n const isRef = (value: unknown): boolean => !!value && typeof value === 'object' && '$ref' in value\n\n // Nothing to render, or a bare `object` that the name describes better.\n if (computedTokens.length === 0 || (computedTokens.length === 1 && computedTokens[0]?.text === 'object')) {\n return [ident(modelName)]\n }\n\n // A direct `$ref`: the single identifier IS the raw key.\n if (\n isRef(valueOrRef) &&\n computedTokens.length === 1 &&\n computedTokens[0]?.kind === 'ident' &&\n computedTokens[0]?.text !== modelName\n ) {\n return [ident(modelName)]\n }\n\n /*\n * An array of a `$ref` keeps its \"array of\" word and renames only the item.\n * Only a caller name with a trailing `[]` describes the ITEM; the caller also\n * reports the array's OWN name here (a `$ref` to `FilterList`, an inline\n * `title` of `Planets`), and using that would claim each element is one.\n */\n const items = valueOrRef && typeof valueOrRef === 'object' && 'items' in valueOrRef ? valueOrRef.items : undefined\n\n const arrayWord = computedTokens[0]\n const itemToken = computedTokens[1]\n\n if (isRef(items) && computedTokens.length === 2 && arrayWord?.kind === 'word' && itemToken?.kind === 'ident') {\n if (modelName.endsWith('[]')) {\n const itemName = modelName.slice(0, -2)\n\n if (itemName && itemName !== itemToken.text) {\n return [arrayWord, ident(itemName)]\n }\n }\n }\n\n return computedTokens\n}\n\n/** Guard against a pathological items chain; deeper than this reads as noise anyway. */\nconst MAX_ARRAY_DEPTH = 8\n\nconst arrayTokens = (\n value: SchemaObject,\n options: { hideModelNames?: boolean },\n depth: number,\n): TypeSignatureToken[] => {\n const items = 'items' in value ? value.items : undefined\n\n if (!items || depth >= MAX_ARRAY_DEPTH) {\n return [ident('array')]\n }\n\n const itemTokens = getTypeSignatureTokens(items as SchemaObject | ReferenceType<SchemaObject>, options, depth + 1)\n\n if (itemTokens.length === 0) {\n return [ident('array')]\n }\n\n return [word('array of'), ...itemTokens]\n}\n"],"mappings":";;;;AAkBA,IAAMA,IAAoB,GAGpBC,IAAuB;CAAC;CAAsB;CAAuB;CAAmB;AAAa,GAGrGC,KAAiB,MAGC,OAAOC,KAAU,YAAnCA,IACK,KAAK,UAAUA,CAAK,IAGtB,OAAOA,KAAU,WAAW,IAAIA,EAAM,KAAK,OAAOA,CAAK,GAG1DC,KAAQ,OAAsC;CAAE,MAAM;CAAQ;AAAK,IACnEC,KAAS,OAAsC;CAAE,MAAM;CAAS;AAAK,IACrEC,KAAW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B,CAAC,CAAC7B,KAAS,OAAOA,KAAU,YAAY,UAAUA;CAQ7F,IALI2B,EAAe,WAAW,KAAMA,EAAe,WAAW,KAAKA,EAAe,EAAE,EAAE,SAAS,YAM7FE,EAAMlB,CAAU,KAChBgB,EAAe,WAAW,KAC1BA,EAAe,EAAE,EAAE,SAAS,WAC5BA,EAAe,EAAE,EAAE,SAASC,GAE5B,OAAO,CAAC1B,EAAM0B,CAAS,CAAC;CAS1B,IAAMR,IAAQT,KAAc,OAAOA,KAAe,YAAY,WAAWA,IAAaA,EAAW,QAAQ,KAAA,GAEnGmB,IAAYH,EAAe,IAC3BI,IAAYJ,EAAe;CAEjC,IAAIE,EAAMT,CAAK,KAAKO,EAAe,WAAW,KAAKG,GAAW,SAAS,UAAUC,GAAW,SAAS,WAC/FH,EAAU,SAAS,IAAI,GAAG;EAC5B,IAAMI,IAAWJ,EAAU,MAAM,GAAG,EAAE;EAEtC,IAAII,KAAYA,MAAaD,EAAU,MACrC,OAAO,CAACD,GAAW5B,EAAM8B,CAAQ,CAAC;CAEtC;CAGF,OAAOL;AACT,GAGMM,IAAkB,GAElBT,KACJ,GACA,GACA,MACyB;CACzB,IAAMJ,IAAQ,WAAWpB,IAAQA,EAAM,QAAQ,KAAA;CAE/C,IAAI,CAACoB,KAASK,KAASQ,GACrB,OAAO,CAAC/B,EAAM,OAAO,CAAC;CAGxB,IAAMgC,IAAab,EAAuBD,GAAqDR,GAASa,IAAQ,CAAC;CAMjH,OAJIS,EAAW,WAAW,IACjB,CAAChC,EAAM,OAAO,CAAC,IAGjB,CAACD,EAAK,UAAU,GAAG,GAAGiC,CAAU;AACzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"has-complex-array-items.js","names":[],"sources":["../../../src/schema/helpers/has-complex-array-items.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\n/** Composition keywords that indicate complex schema structure */\nconst COMPOSITION_KEYWORDS = ['allOf', 'oneOf', 'anyOf'] as const\n\n/**\n * Checks if a schema has object type (either explicit type: 'object' or has properties)\n */\nconst isObjectType = (schema: SchemaObject): boolean => {\n // Check for explicit object type\n if ('type' in schema && schema.type) {\n if (Array.isArray(schema.type)) {\n return schema.type.includes('object')\n }\n return schema.type === 'object'\n }\n\n // Check for properties (implicit object type)\n return 'properties' in schema\n}\n\n/**\n * Checks if a schema has complex features (refs, compositions, discriminators)\n */\nconst hasComplexFeatures = (schema: SchemaObject): boolean =>\n '$ref' in schema || 'discriminator' in schema || COMPOSITION_KEYWORDS.some((keyword) => keyword in schema)\n\n/**\n * Checks if nested array items are complex\n */\nconst hasComplexNestedArrayItems = (items: SchemaObject): boolean => {\n if (!isArraySchema(items)) {\n return false\n }\n\n if (typeof items.items === 'boolean') {\n return true\n }\n\n if (typeof items.items !== 'object') {\n return false\n }\n\n // Check for $ref in original nested items before resolving\n if ('$ref' in items.items) {\n return true\n }\n\n const nestedItems = getResolvedRef(items.items)\n if (!nestedItems) {\n return false\n }\n\n // Check if nested items are complex (objects, refs, compositions, or further nested arrays)\n return isObjectType(nestedItems) || hasComplexFeatures(nestedItems) || isArraySchema(nestedItems)\n}\n\n/**\n * Checks if array items have complex structure\n * like: objects, references, discriminators, compositions, or nested arrays with complex items\n *\n * @param value - The schema object to check\n * @returns true if the array has complex items, false otherwise\n */\nexport const hasComplexArrayItems = (value: SchemaObject | undefined): boolean => {\n // Early return for invalid inputs\n if (!value || !isArraySchema(value)) {\n return false\n }\n\n // Boolean item constraints need a child row to explain their validation meaning.\n if (typeof value.items === 'boolean') {\n return true\n }\n\n if (typeof value.items !== 'object') {\n return false\n }\n\n // Check for $ref in original items before resolving (in case ref can't be resolved)\n if ('$ref' in value.items) {\n return true\n }\n\n const items = getResolvedRef(value.items)\n if (!items) {\n return false\n }\n\n // Check for complex features (refs, compositions, discriminators)\n if (hasComplexFeatures(items)) {\n return true\n }\n\n // Check if items are objects\n if (isObjectType(items)) {\n return true\n }\n\n // Check if items are nested arrays with complex items\n return hasComplexNestedArrayItems(items)\n}\n"],"mappings":";;;AAKA,IAAM,IAAuB;CAAC;CAAS;CAAS;AAAO,GAKjD,KAAgB,MAEhB,UAAU,KAAU,EAAO,OACzB,MAAM,QAAQ,EAAO,IAAI,IACpB,EAAO,KAAK,SAAS,QAAQ,IAE/B,EAAO,SAAS,WAIlB,gBAAgB,GAMnB,KAAsB,MAC1B,UAAU,KAAU,mBAAmB,KAAU,EAAqB,MAAM,MAAY,KAAW,CAAM,GAKrG,KAA8B,MAAiC;CACnE,IAAI,CAAC,EAAc,CAAK,GACtB,OAAO;CAGT,IAAI,OAAO,EAAM,SAAU,WACzB,OAAO;CAGT,IAAI,OAAO,EAAM,SAAU,UACzB,OAAO;CAIT,IAAI,UAAU,EAAM,OAClB,OAAO;CAGT,IAAM,IAAc,EAAe,EAAM,KAAK;CAM9C,OALK,IAKE,EAAa,CAAW,KAAK,EAAmB,CAAW,KAAK,EAAc,CAAW,IAJvF;AAKX,GASa,KAAwB,MAA6C;CAEhF,IAAI,CAAC,KAAS,CAAC,EAAc,CAAK,GAChC,OAAO;CAIT,IAAI,OAAO,EAAM,SAAU,WACzB,OAAO;CAGT,IAAI,OAAO,EAAM,SAAU,UACzB,OAAO;CAIT,IAAI,UAAU,EAAM,OAClB,OAAO;CAGT,IAAM,IAAQ,EAAe,EAAM,KAAK;CAgBxC,OAfK,IAKD,EAAmB,CAAK,KAKxB,EAAa,CAAK,IACb,KAIF,EAA2B,CAAK,IAd9B;AAeX"}
1
+ {"version":3,"file":"has-complex-array-items.js","names":["COMPOSITION_KEYWORDS","isObjectType","schema","hasComplexFeatures","keyword","hasComplexNestedArrayItems","isArraySchema","items","nestedItems","getResolvedRef","hasComplexArrayItems","value"],"sources":["../../../src/schema/helpers/has-complex-array-items.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\n/** Composition keywords that indicate complex schema structure */\nconst COMPOSITION_KEYWORDS = ['allOf', 'oneOf', 'anyOf'] as const\n\n/**\n * Checks if a schema has object type (either explicit type: 'object' or has properties)\n */\nconst isObjectType = (schema: SchemaObject): boolean => {\n // Check for explicit object type\n if ('type' in schema && schema.type) {\n if (Array.isArray(schema.type)) {\n return schema.type.includes('object')\n }\n return schema.type === 'object'\n }\n\n // Check for properties (implicit object type)\n return 'properties' in schema\n}\n\n/**\n * Checks if a schema has complex features (refs, compositions, discriminators)\n */\nconst hasComplexFeatures = (schema: SchemaObject): boolean =>\n '$ref' in schema || 'discriminator' in schema || COMPOSITION_KEYWORDS.some((keyword) => keyword in schema)\n\n/**\n * Checks if nested array items are complex\n */\nconst hasComplexNestedArrayItems = (items: SchemaObject): boolean => {\n if (!isArraySchema(items)) {\n return false\n }\n\n if (typeof items.items === 'boolean') {\n return true\n }\n\n if (typeof items.items !== 'object') {\n return false\n }\n\n // Check for $ref in original nested items before resolving\n if ('$ref' in items.items) {\n return true\n }\n\n const nestedItems = getResolvedRef(items.items)\n if (!nestedItems) {\n return false\n }\n\n // Check if nested items are complex (objects, refs, compositions, or further nested arrays)\n return isObjectType(nestedItems) || hasComplexFeatures(nestedItems) || isArraySchema(nestedItems)\n}\n\n/**\n * Checks if array items have complex structure\n * like: objects, references, discriminators, compositions, or nested arrays with complex items\n *\n * @param value - The schema object to check\n * @returns true if the array has complex items, false otherwise\n */\nexport const hasComplexArrayItems = (value: SchemaObject | undefined): boolean => {\n // Early return for invalid inputs\n if (!value || !isArraySchema(value)) {\n return false\n }\n\n // Boolean item constraints need a child row to explain their validation meaning.\n if (typeof value.items === 'boolean') {\n return true\n }\n\n if (typeof value.items !== 'object') {\n return false\n }\n\n // Check for $ref in original items before resolving (in case ref can't be resolved)\n if ('$ref' in value.items) {\n return true\n }\n\n const items = getResolvedRef(value.items)\n if (!items) {\n return false\n }\n\n // Check for complex features (refs, compositions, discriminators)\n if (hasComplexFeatures(items)) {\n return true\n }\n\n // Check if items are objects\n if (isObjectType(items)) {\n return true\n }\n\n // Check if items are nested arrays with complex items\n return hasComplexNestedArrayItems(items)\n}\n"],"mappings":";;;AAKA,IAAMA,IAAuB;CAAC;CAAS;CAAS;AAAO,GAKjDC,KAAgB,MAEhB,UAAUC,KAAUA,EAAO,OACzB,MAAM,QAAQA,EAAO,IAAI,IACpBA,EAAO,KAAK,SAAS,QAAQ,IAE/BA,EAAO,SAAS,WAIlB,gBAAgBA,GAMnBC,KAAsB,MAC1B,UAAUD,KAAU,mBAAmBA,KAAUF,EAAqB,MAAM,MAAYI,KAAWF,CAAM,GAKrGG,KAA8B,MAAiC;CACnE,IAAI,CAACC,EAAcC,CAAK,GACtB,OAAO;CAGT,IAAI,OAAOA,EAAM,SAAU,WACzB,OAAO;CAGT,IAAI,OAAOA,EAAM,SAAU,UACzB,OAAO;CAIT,IAAI,UAAUA,EAAM,OAClB,OAAO;CAGT,IAAMC,IAAcC,EAAeF,EAAM,KAAK;CAM9C,OALKC,IAKEP,EAAaO,CAAW,KAAKL,EAAmBK,CAAW,KAAKF,EAAcE,CAAW,IAJvF;AAKX,GASaE,KAAwB,MAA6C;CAEhF,IAAI,CAACC,KAAS,CAACL,EAAcK,CAAK,GAChC,OAAO;CAIT,IAAI,OAAOA,EAAM,SAAU,WACzB,OAAO;CAGT,IAAI,OAAOA,EAAM,SAAU,UACzB,OAAO;CAIT,IAAI,UAAUA,EAAM,OAClB,OAAO;CAGT,IAAMJ,IAAQE,EAAeE,EAAM,KAAK;CAgBxC,OAfKJ,IAKDJ,EAAmBI,CAAK,KAKxBN,EAAaM,CAAK,IACb,KAIFF,EAA2BE,CAAK,IAd9B;AAeX"}
@@ -1 +1 @@
1
- {"version":3,"file":"is-empty-schema-object.js","names":[],"sources":["../../../src/schema/helpers/is-empty-schema-object.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport { isTypeObject } from './is-type-object'\n\n/**\n * Determines if the given schema is an empty object schema.\n * An empty object schema is defined as a schema with type 'object'\n * and no defined properties, no additionalProperties (or set to false), and no patternProperties.\n */\nexport const isEmptySchemaObject = (schema: SchemaObject | undefined): boolean => {\n if (!isTypeObject(schema)) {\n return false\n }\n\n const hasNoProperties = Object.keys(schema.properties ?? {}).length === 0\n const hasNoAdditionalProperties = schema.additionalProperties === undefined || schema.additionalProperties === false\n const hasNoPatternProperties = Object.keys(schema.patternProperties ?? {}).length === 0\n\n return hasNoProperties && hasNoAdditionalProperties && hasNoPatternProperties\n}\n"],"mappings":";;AASA,IAAa,KAAuB,MAA8C;CAChF,IAAI,CAAC,EAAa,CAAM,GACtB,OAAO;CAGT,IAAM,IAAkB,OAAO,KAAK,EAAO,cAAc,CAAC,CAAC,CAAC,CAAC,WAAW,GAClE,IAA4B,EAAO,yBAAyB,KAAA,KAAa,EAAO,yBAAyB,IACzG,IAAyB,OAAO,KAAK,EAAO,qBAAqB,CAAC,CAAC,CAAC,CAAC,WAAW;CAEtF,OAAO,KAAmB,KAA6B;AACzD"}
1
+ {"version":3,"file":"is-empty-schema-object.js","names":["isEmptySchemaObject","isTypeObject","schema","hasNoProperties","hasNoAdditionalProperties","hasNoPatternProperties"],"sources":["../../../src/schema/helpers/is-empty-schema-object.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport { isTypeObject } from './is-type-object'\n\n/**\n * Determines if the given schema is an empty object schema.\n * An empty object schema is defined as a schema with type 'object'\n * and no defined properties, no additionalProperties (or set to false), and no patternProperties.\n */\nexport const isEmptySchemaObject = (schema: SchemaObject | undefined): boolean => {\n if (!isTypeObject(schema)) {\n return false\n }\n\n const hasNoProperties = Object.keys(schema.properties ?? {}).length === 0\n const hasNoAdditionalProperties = schema.additionalProperties === undefined || schema.additionalProperties === false\n const hasNoPatternProperties = Object.keys(schema.patternProperties ?? {}).length === 0\n\n return hasNoProperties && hasNoAdditionalProperties && hasNoPatternProperties\n}\n"],"mappings":";;AASA,IAAaA,KAAuB,MAA8C;CAChF,IAAI,CAACC,EAAaC,CAAM,GACtB,OAAO;CAGT,IAAMC,IAAkB,OAAO,KAAKD,EAAO,cAAc,CAAC,CAAC,CAAC,CAAC,WAAW,GAClEE,IAA4BF,EAAO,yBAAyB,KAAA,KAAaA,EAAO,yBAAyB,IACzGG,IAAyB,OAAO,KAAKH,EAAO,qBAAqB,CAAC,CAAC,CAAC,CAAC,WAAW;CAEtF,OAAOC,KAAmBC,KAA6BC;AACzD"}