@scalar/blocks 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +45 -0
  3. package/dist/code-example/components/CodeExample.vue.d.ts +5 -0
  4. package/dist/code-example/components/CodeExample.vue.d.ts.map +1 -1
  5. package/dist/code-example/components/CodeExample.vue.js +1 -1
  6. package/dist/code-example/components/CodeExample.vue.js.map +1 -1
  7. package/dist/code-example/components/CodeExample.vue.script.js +12 -9
  8. package/dist/code-example/components/CodeExample.vue.script.js.map +1 -1
  9. package/dist/code-example/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  10. package/dist/code-example/helpers/operation-to-har/operation-to-har.js +1 -0
  11. package/dist/code-example/helpers/operation-to-har/operation-to-har.js.map +1 -1
  12. package/dist/code-example/helpers/operation-to-har/process-body.d.ts.map +1 -1
  13. package/dist/code-example/helpers/operation-to-har/process-body.js +51 -45
  14. package/dist/code-example/helpers/operation-to-har/process-body.js.map +1 -1
  15. package/dist/code-example/mount.d.ts +2 -0
  16. package/dist/code-example/mount.d.ts.map +1 -1
  17. package/dist/code-example/mount.js +3 -0
  18. package/dist/code-example/mount.js.map +1 -1
  19. package/dist/constants.js +1 -1
  20. package/dist/schema/LinkButton.vue.d.ts +14 -0
  21. package/dist/schema/LinkButton.vue.d.ts.map +1 -0
  22. package/dist/schema/LinkButton.vue.js +15 -0
  23. package/dist/schema/LinkButton.vue.js.map +1 -0
  24. package/dist/schema/RenderString.vue.d.ts +7 -0
  25. package/dist/schema/RenderString.vue.d.ts.map +1 -0
  26. package/dist/schema/RenderString.vue.js +7 -0
  27. package/dist/schema/RenderString.vue.js.map +1 -0
  28. package/dist/schema/RenderString.vue.script.js +14 -0
  29. package/dist/schema/RenderString.vue.script.js.map +1 -0
  30. package/dist/schema/Schema.vue.d.ts +50 -0
  31. package/dist/schema/Schema.vue.d.ts.map +1 -0
  32. package/dist/schema/Schema.vue.js +9 -0
  33. package/dist/schema/Schema.vue.js.map +1 -0
  34. package/dist/schema/Schema.vue.script.js +234 -0
  35. package/dist/schema/Schema.vue.script.js.map +1 -0
  36. package/dist/schema/SchemaCollapsedPreview.vue.d.ts +17 -0
  37. package/dist/schema/SchemaCollapsedPreview.vue.d.ts.map +1 -0
  38. package/dist/schema/SchemaCollapsedPreview.vue.js +7 -0
  39. package/dist/schema/SchemaCollapsedPreview.vue.js.map +1 -0
  40. package/dist/schema/SchemaCollapsedPreview.vue.script.js +28 -0
  41. package/dist/schema/SchemaCollapsedPreview.vue.script.js.map +1 -0
  42. package/dist/schema/SchemaComposition.vue.d.ts +42 -0
  43. package/dist/schema/SchemaComposition.vue.d.ts.map +1 -0
  44. package/dist/schema/SchemaComposition.vue.js +9 -0
  45. package/dist/schema/SchemaComposition.vue.js.map +1 -0
  46. package/dist/schema/SchemaComposition.vue.script.js +231 -0
  47. package/dist/schema/SchemaComposition.vue.script.js.map +1 -0
  48. package/dist/schema/SchemaEnumPropertyItem.vue.d.ts +8 -0
  49. package/dist/schema/SchemaEnumPropertyItem.vue.d.ts.map +1 -0
  50. package/dist/schema/SchemaEnumPropertyItem.vue.js +7 -0
  51. package/dist/schema/SchemaEnumPropertyItem.vue.js.map +1 -0
  52. package/dist/schema/SchemaEnumPropertyItem.vue.script.js +24 -0
  53. package/dist/schema/SchemaEnumPropertyItem.vue.script.js.map +1 -0
  54. package/dist/schema/SchemaEnums.vue.d.ts +11 -0
  55. package/dist/schema/SchemaEnums.vue.d.ts.map +1 -0
  56. package/dist/schema/SchemaEnums.vue.js +9 -0
  57. package/dist/schema/SchemaEnums.vue.js.map +1 -0
  58. package/dist/schema/SchemaEnums.vue.script.js +78 -0
  59. package/dist/schema/SchemaEnums.vue.script.js.map +1 -0
  60. package/dist/schema/SchemaGlyphPuck.vue.d.ts +33 -0
  61. package/dist/schema/SchemaGlyphPuck.vue.d.ts.map +1 -0
  62. package/dist/schema/SchemaGlyphPuck.vue.js +7 -0
  63. package/dist/schema/SchemaGlyphPuck.vue.js.map +1 -0
  64. package/dist/schema/SchemaGlyphPuck.vue.script.js +30 -0
  65. package/dist/schema/SchemaGlyphPuck.vue.script.js.map +1 -0
  66. package/dist/schema/SchemaGutterToggle.vue.d.ts +32 -0
  67. package/dist/schema/SchemaGutterToggle.vue.d.ts.map +1 -0
  68. package/dist/schema/SchemaGutterToggle.vue.js +7 -0
  69. package/dist/schema/SchemaGutterToggle.vue.js.map +1 -0
  70. package/dist/schema/SchemaGutterToggle.vue.script.js +43 -0
  71. package/dist/schema/SchemaGutterToggle.vue.script.js.map +1 -0
  72. package/dist/schema/SchemaHeading.vue.d.ts +9 -0
  73. package/dist/schema/SchemaHeading.vue.d.ts.map +1 -0
  74. package/dist/schema/SchemaHeading.vue.js +9 -0
  75. package/dist/schema/SchemaHeading.vue.js.map +1 -0
  76. package/dist/schema/SchemaHeading.vue.script.js +35 -0
  77. package/dist/schema/SchemaHeading.vue.script.js.map +1 -0
  78. package/dist/schema/SchemaObjectExampleCodeBlock.vue.d.ts +8 -0
  79. package/dist/schema/SchemaObjectExampleCodeBlock.vue.d.ts.map +1 -0
  80. package/dist/schema/SchemaObjectExampleCodeBlock.vue.js +7 -0
  81. package/dist/schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -0
  82. package/dist/schema/SchemaObjectExampleCodeBlock.vue.script.js +48 -0
  83. package/dist/schema/SchemaObjectExampleCodeBlock.vue.script.js.map +1 -0
  84. package/dist/schema/SchemaObjectProperties.vue.d.ts +22 -0
  85. package/dist/schema/SchemaObjectProperties.vue.d.ts.map +1 -0
  86. package/dist/schema/SchemaObjectProperties.vue.js +7 -0
  87. package/dist/schema/SchemaObjectProperties.vue.js.map +1 -0
  88. package/dist/schema/SchemaObjectProperties.vue.script.js +207 -0
  89. package/dist/schema/SchemaObjectProperties.vue.script.js.map +1 -0
  90. package/dist/schema/SchemaProperty.vue.d.ts +88 -0
  91. package/dist/schema/SchemaProperty.vue.d.ts.map +1 -0
  92. package/dist/schema/SchemaProperty.vue.js +9 -0
  93. package/dist/schema/SchemaProperty.vue.js.map +1 -0
  94. package/dist/schema/SchemaProperty.vue.script.js +456 -0
  95. package/dist/schema/SchemaProperty.vue.script.js.map +1 -0
  96. package/dist/schema/SchemaPropertyDefault.vue.d.ts +7 -0
  97. package/dist/schema/SchemaPropertyDefault.vue.d.ts.map +1 -0
  98. package/dist/schema/SchemaPropertyDefault.vue.js +9 -0
  99. package/dist/schema/SchemaPropertyDefault.vue.js.map +1 -0
  100. package/dist/schema/SchemaPropertyDefault.vue.script.js +64 -0
  101. package/dist/schema/SchemaPropertyDefault.vue.script.js.map +1 -0
  102. package/dist/schema/SchemaPropertyDetail.vue.d.ts +22 -0
  103. package/dist/schema/SchemaPropertyDetail.vue.d.ts.map +1 -0
  104. package/dist/schema/SchemaPropertyDetail.vue.js +9 -0
  105. package/dist/schema/SchemaPropertyDetail.vue.js.map +1 -0
  106. package/dist/schema/SchemaPropertyDetail.vue.script.js +25 -0
  107. package/dist/schema/SchemaPropertyDetail.vue.script.js.map +1 -0
  108. package/dist/schema/SchemaPropertyExamples.vue.d.ts +8 -0
  109. package/dist/schema/SchemaPropertyExamples.vue.d.ts.map +1 -0
  110. package/dist/schema/SchemaPropertyExamples.vue.js +9 -0
  111. package/dist/schema/SchemaPropertyExamples.vue.js.map +1 -0
  112. package/dist/schema/SchemaPropertyExamples.vue.script.js +125 -0
  113. package/dist/schema/SchemaPropertyExamples.vue.script.js.map +1 -0
  114. package/dist/schema/SchemaPropertyHeading.vue.d.ts +59 -0
  115. package/dist/schema/SchemaPropertyHeading.vue.d.ts.map +1 -0
  116. package/dist/schema/SchemaPropertyHeading.vue.js +9 -0
  117. package/dist/schema/SchemaPropertyHeading.vue.js.map +1 -0
  118. package/dist/schema/SchemaPropertyHeading.vue.script.js +270 -0
  119. package/dist/schema/SchemaPropertyHeading.vue.script.js.map +1 -0
  120. package/dist/schema/SchemaPropertyPattern.vue.d.ts +7 -0
  121. package/dist/schema/SchemaPropertyPattern.vue.d.ts.map +1 -0
  122. package/dist/schema/SchemaPropertyPattern.vue.js +9 -0
  123. package/dist/schema/SchemaPropertyPattern.vue.js.map +1 -0
  124. package/dist/schema/SchemaPropertyPattern.vue.script.js +45 -0
  125. package/dist/schema/SchemaPropertyPattern.vue.script.js.map +1 -0
  126. package/dist/schema/SchemaRailPanel.vue.d.ts +35 -0
  127. package/dist/schema/SchemaRailPanel.vue.d.ts.map +1 -0
  128. package/dist/schema/SchemaRailPanel.vue.js +7 -0
  129. package/dist/schema/SchemaRailPanel.vue.js.map +1 -0
  130. package/dist/schema/SchemaRailPanel.vue.script.js +49 -0
  131. package/dist/schema/SchemaRailPanel.vue.script.js.map +1 -0
  132. package/dist/schema/components/CopyLinkButton.vue.d.ts +27 -0
  133. package/dist/schema/components/CopyLinkButton.vue.d.ts.map +1 -0
  134. package/dist/schema/components/CopyLinkButton.vue.js +7 -0
  135. package/dist/schema/components/CopyLinkButton.vue.js.map +1 -0
  136. package/dist/schema/components/CopyLinkButton.vue.script.js +26 -0
  137. package/dist/schema/components/CopyLinkButton.vue.script.js.map +1 -0
  138. package/dist/schema/components/WithBreadcrumb.vue.d.ts +19 -0
  139. package/dist/schema/components/WithBreadcrumb.vue.d.ts.map +1 -0
  140. package/dist/schema/components/WithBreadcrumb.vue.js +7 -0
  141. package/dist/schema/components/WithBreadcrumb.vue.js.map +1 -0
  142. package/dist/schema/components/WithBreadcrumb.vue.script.js +18 -0
  143. package/dist/schema/components/WithBreadcrumb.vue.script.js.map +1 -0
  144. package/dist/schema/expansion/index.d.ts +2 -0
  145. package/dist/schema/expansion/index.d.ts.map +1 -0
  146. package/dist/schema/expansion/index.js +2 -0
  147. package/dist/schema/helpers/dynamic-scope.d.ts +27 -0
  148. package/dist/schema/helpers/dynamic-scope.d.ts.map +1 -0
  149. package/dist/schema/helpers/dynamic-scope.js +8 -0
  150. package/dist/schema/helpers/dynamic-scope.js.map +1 -0
  151. package/dist/schema/helpers/format-example.d.ts +5 -0
  152. package/dist/schema/helpers/format-example.d.ts.map +1 -0
  153. package/dist/schema/helpers/format-example.js +12 -0
  154. package/dist/schema/helpers/format-example.js.map +1 -0
  155. package/dist/schema/helpers/format-value.d.ts +5 -0
  156. package/dist/schema/helpers/format-value.d.ts.map +1 -0
  157. package/dist/schema/helpers/format-value.js +8 -0
  158. package/dist/schema/helpers/format-value.js.map +1 -0
  159. package/dist/schema/helpers/get-compositions-to-render.d.ts +33 -0
  160. package/dist/schema/helpers/get-compositions-to-render.d.ts.map +1 -0
  161. package/dist/schema/helpers/get-compositions-to-render.js +39 -0
  162. package/dist/schema/helpers/get-compositions-to-render.js.map +1 -0
  163. package/dist/schema/helpers/get-discriminator-values.d.ts +4 -0
  164. package/dist/schema/helpers/get-discriminator-values.d.ts.map +1 -0
  165. package/dist/schema/helpers/get-discriminator-values.js +6 -0
  166. package/dist/schema/helpers/get-discriminator-values.js.map +1 -0
  167. package/dist/schema/helpers/get-enum-values.d.ts +9 -0
  168. package/dist/schema/helpers/get-enum-values.d.ts.map +1 -0
  169. package/dist/schema/helpers/get-enum-values.js +16 -0
  170. package/dist/schema/helpers/get-enum-values.js.map +1 -0
  171. package/dist/schema/helpers/get-property-description.d.ts +9 -0
  172. package/dist/schema/helpers/get-property-description.d.ts.map +1 -0
  173. package/dist/schema/helpers/get-property-description.js +27 -0
  174. package/dist/schema/helpers/get-property-description.js.map +1 -0
  175. package/dist/schema/helpers/get-ref-name.d.ts +24 -0
  176. package/dist/schema/helpers/get-ref-name.d.ts.map +1 -0
  177. package/dist/schema/helpers/get-ref-name.js +15 -0
  178. package/dist/schema/helpers/get-ref-name.js.map +1 -0
  179. package/dist/schema/helpers/get-schema-type.d.ts +13 -0
  180. package/dist/schema/helpers/get-schema-type.d.ts.map +1 -0
  181. package/dist/schema/helpers/get-schema-type.js +24 -0
  182. package/dist/schema/helpers/get-schema-type.js.map +1 -0
  183. package/dist/schema/helpers/get-type-signature-tokens.d.ts +48 -0
  184. package/dist/schema/helpers/get-type-signature-tokens.d.ts.map +1 -0
  185. package/dist/schema/helpers/get-type-signature-tokens.js +62 -0
  186. package/dist/schema/helpers/get-type-signature-tokens.js.map +1 -0
  187. package/dist/schema/helpers/has-complex-array-items.d.ts +10 -0
  188. package/dist/schema/helpers/has-complex-array-items.d.ts.map +1 -0
  189. package/dist/schema/helpers/has-complex-array-items.js +22 -0
  190. package/dist/schema/helpers/has-complex-array-items.js.map +1 -0
  191. package/dist/schema/helpers/index.d.ts +12 -0
  192. package/dist/schema/helpers/index.d.ts.map +1 -0
  193. package/dist/schema/helpers/index.js +12 -0
  194. package/dist/schema/helpers/is-empty-schema-object.d.ts +8 -0
  195. package/dist/schema/helpers/is-empty-schema-object.d.ts.map +1 -0
  196. package/dist/schema/helpers/is-empty-schema-object.js +11 -0
  197. package/dist/schema/helpers/is-empty-schema-object.js.map +1 -0
  198. package/dist/schema/helpers/is-model-linkable.d.ts +15 -0
  199. package/dist/schema/helpers/is-model-linkable.d.ts.map +1 -0
  200. package/dist/schema/helpers/is-model-linkable.js +13 -0
  201. package/dist/schema/helpers/is-model-linkable.js.map +1 -0
  202. package/dist/schema/helpers/is-on-schema-target-path.d.ts +3 -0
  203. package/dist/schema/helpers/is-on-schema-target-path.d.ts.map +1 -0
  204. package/dist/schema/helpers/is-on-schema-target-path.js +6 -0
  205. package/dist/schema/helpers/is-on-schema-target-path.js.map +1 -0
  206. package/dist/schema/helpers/is-type-object.d.ts +5 -0
  207. package/dist/schema/helpers/is-type-object.d.ts.map +1 -0
  208. package/dist/schema/helpers/is-type-object.js +15 -0
  209. package/dist/schema/helpers/is-type-object.js.map +1 -0
  210. package/dist/schema/helpers/merge-all-of-schemas.d.ts +12 -0
  211. package/dist/schema/helpers/merge-all-of-schemas.d.ts.map +1 -0
  212. package/dist/schema/helpers/merge-all-of-schemas.js +151 -0
  213. package/dist/schema/helpers/merge-all-of-schemas.js.map +1 -0
  214. package/dist/schema/helpers/normalize-object-composition.d.ts +9 -0
  215. package/dist/schema/helpers/normalize-object-composition.d.ts.map +1 -0
  216. package/dist/schema/helpers/normalize-object-composition.js +29 -0
  217. package/dist/schema/helpers/normalize-object-composition.js.map +1 -0
  218. package/dist/schema/helpers/optimize-value-for-display.d.ts +13 -0
  219. package/dist/schema/helpers/optimize-value-for-display.d.ts.map +1 -0
  220. package/dist/schema/helpers/optimize-value-for-display.js +64 -0
  221. package/dist/schema/helpers/optimize-value-for-display.js.map +1 -0
  222. package/dist/schema/helpers/partition-all-of-compositions.d.ts +32 -0
  223. package/dist/schema/helpers/partition-all-of-compositions.d.ts.map +1 -0
  224. package/dist/schema/helpers/partition-all-of-compositions.js +67 -0
  225. package/dist/schema/helpers/partition-all-of-compositions.js.map +1 -0
  226. package/dist/schema/helpers/schema-composition.d.ts +4 -0
  227. package/dist/schema/helpers/schema-composition.d.ts.map +1 -0
  228. package/dist/schema/helpers/schema-composition.js +11 -0
  229. package/dist/schema/helpers/schema-composition.js.map +1 -0
  230. package/dist/schema/helpers/schema-cycle.d.ts +31 -0
  231. package/dist/schema/helpers/schema-cycle.d.ts.map +1 -0
  232. package/dist/schema/helpers/schema-cycle.js +8 -0
  233. package/dist/schema/helpers/schema-cycle.js.map +1 -0
  234. package/dist/schema/helpers/schema-expansion.d.ts +89 -0
  235. package/dist/schema/helpers/schema-expansion.d.ts.map +1 -0
  236. package/dist/schema/helpers/schema-expansion.js +93 -0
  237. package/dist/schema/helpers/schema-expansion.js.map +1 -0
  238. package/dist/schema/helpers/schema-keyboard-nav.d.ts +23 -0
  239. package/dist/schema/helpers/schema-keyboard-nav.d.ts.map +1 -0
  240. package/dist/schema/helpers/schema-keyboard-nav.js +36 -0
  241. package/dist/schema/helpers/schema-keyboard-nav.js.map +1 -0
  242. package/dist/schema/helpers/schema-name.d.ts +27 -0
  243. package/dist/schema/helpers/schema-name.d.ts.map +1 -0
  244. package/dist/schema/helpers/schema-name.js +40 -0
  245. package/dist/schema/helpers/schema-name.js.map +1 -0
  246. package/dist/schema/helpers/should-display-description.d.ts +10 -0
  247. package/dist/schema/helpers/should-display-description.d.ts.map +1 -0
  248. package/dist/schema/helpers/should-display-description.js +6 -0
  249. package/dist/schema/helpers/should-display-description.js.map +1 -0
  250. package/dist/schema/helpers/should-display-heading.d.ts +11 -0
  251. package/dist/schema/helpers/should-display-heading.d.ts.map +1 -0
  252. package/dist/schema/helpers/should-display-heading.js +6 -0
  253. package/dist/schema/helpers/should-display-heading.js.map +1 -0
  254. package/dist/schema/helpers/should-render-array-item-composition.d.ts +10 -0
  255. package/dist/schema/helpers/should-render-array-item-composition.d.ts.map +1 -0
  256. package/dist/schema/helpers/should-render-array-item-composition.js +12 -0
  257. package/dist/schema/helpers/should-render-array-item-composition.js.map +1 -0
  258. package/dist/schema/helpers/sort-property-names.d.ts +23 -0
  259. package/dist/schema/helpers/sort-property-names.d.ts.map +1 -0
  260. package/dist/schema/helpers/sort-property-names.js +55 -0
  261. package/dist/schema/helpers/sort-property-names.js.map +1 -0
  262. package/dist/schema/helpers/unwrap-for-read.d.ts +48 -0
  263. package/dist/schema/helpers/unwrap-for-read.d.ts.map +1 -0
  264. package/dist/schema/helpers/unwrap-for-read.js +8 -0
  265. package/dist/schema/helpers/unwrap-for-read.js.map +1 -0
  266. package/dist/schema/index.d.ts +12 -0
  267. package/dist/schema/index.d.ts.map +1 -0
  268. package/dist/schema/index.js +11 -0
  269. package/dist/schema/localization/index.d.ts +59 -0
  270. package/dist/schema/localization/index.d.ts.map +1 -0
  271. package/dist/schema/localization/index.js +18 -0
  272. package/dist/schema/localization/index.js.map +1 -0
  273. package/dist/schema/localization/locales/ar.d.ts +58 -0
  274. package/dist/schema/localization/locales/ar.d.ts.map +1 -0
  275. package/dist/schema/localization/locales/ar.js +60 -0
  276. package/dist/schema/localization/locales/ar.js.map +1 -0
  277. package/dist/schema/localization/locales/de.d.ts +58 -0
  278. package/dist/schema/localization/locales/de.d.ts.map +1 -0
  279. package/dist/schema/localization/locales/de.js +60 -0
  280. package/dist/schema/localization/locales/de.js.map +1 -0
  281. package/dist/schema/localization/locales/en.d.ts +58 -0
  282. package/dist/schema/localization/locales/en.d.ts.map +1 -0
  283. package/dist/schema/localization/locales/en.js +60 -0
  284. package/dist/schema/localization/locales/en.js.map +1 -0
  285. package/dist/schema/localization/locales/es.d.ts +58 -0
  286. package/dist/schema/localization/locales/es.d.ts.map +1 -0
  287. package/dist/schema/localization/locales/es.js +60 -0
  288. package/dist/schema/localization/locales/es.js.map +1 -0
  289. package/dist/schema/localization/locales/fr.d.ts +58 -0
  290. package/dist/schema/localization/locales/fr.d.ts.map +1 -0
  291. package/dist/schema/localization/locales/fr.js +60 -0
  292. package/dist/schema/localization/locales/fr.js.map +1 -0
  293. package/dist/schema/localization/locales/pt.d.ts +58 -0
  294. package/dist/schema/localization/locales/pt.d.ts.map +1 -0
  295. package/dist/schema/localization/locales/pt.js +60 -0
  296. package/dist/schema/localization/locales/pt.js.map +1 -0
  297. package/dist/schema/localization/locales/ru.d.ts +58 -0
  298. package/dist/schema/localization/locales/ru.d.ts.map +1 -0
  299. package/dist/schema/localization/locales/ru.js +60 -0
  300. package/dist/schema/localization/locales/ru.js.map +1 -0
  301. package/dist/schema/localization/locales/zh-cn.d.ts +58 -0
  302. package/dist/schema/localization/locales/zh-cn.d.ts.map +1 -0
  303. package/dist/schema/localization/locales/zh-cn.js +60 -0
  304. package/dist/schema/localization/locales/zh-cn.js.map +1 -0
  305. package/dist/schema/localization/translations.d.ts +460 -0
  306. package/dist/schema/localization/translations.d.ts.map +1 -0
  307. package/dist/schema/localization/translations.js +23 -0
  308. package/dist/schema/localization/translations.js.map +1 -0
  309. package/dist/schema/request-body-composition-index.d.ts +8 -0
  310. package/dist/schema/request-body-composition-index.d.ts.map +1 -0
  311. package/dist/schema/request-body-composition-index.js +6 -0
  312. package/dist/schema/request-body-composition-index.js.map +1 -0
  313. package/dist/schema/schema-tree.bench.d.ts +2 -0
  314. package/dist/schema/schema-tree.bench.d.ts.map +1 -0
  315. package/dist/schema/types.d.ts +51 -0
  316. package/dist/schema/types.d.ts.map +1 -0
  317. package/dist/shared/Badge.vue.d.ts +17 -0
  318. package/dist/shared/Badge.vue.d.ts.map +1 -0
  319. package/dist/shared/Badge.vue.js +9 -0
  320. package/dist/shared/Badge.vue.js.map +1 -0
  321. package/dist/shared/Badge.vue.script.js +16 -0
  322. package/dist/shared/Badge.vue.script.js.map +1 -0
  323. package/dist/shared/ScreenReader.vue.d.ts +21 -0
  324. package/dist/shared/ScreenReader.vue.d.ts.map +1 -0
  325. package/dist/shared/ScreenReader.vue.js +7 -0
  326. package/dist/shared/ScreenReader.vue.js.map +1 -0
  327. package/dist/shared/ScreenReader.vue.script.js +19 -0
  328. package/dist/shared/ScreenReader.vue.script.js.map +1 -0
  329. package/dist/shared/index.d.ts +3 -0
  330. package/dist/shared/index.d.ts.map +1 -0
  331. package/dist/shared/index.js +3 -0
  332. package/dist/specification-extensions/ExtensionValue.vue.d.ts +13 -0
  333. package/dist/specification-extensions/ExtensionValue.vue.d.ts.map +1 -0
  334. package/dist/specification-extensions/ExtensionValue.vue.js +7 -0
  335. package/dist/specification-extensions/ExtensionValue.vue.js.map +1 -0
  336. package/dist/specification-extensions/ExtensionValue.vue.script.js +84 -0
  337. package/dist/specification-extensions/ExtensionValue.vue.script.js.map +1 -0
  338. package/dist/specification-extensions/SpecificationExtensions.vue.d.ts +9 -0
  339. package/dist/specification-extensions/SpecificationExtensions.vue.d.ts.map +1 -0
  340. package/dist/specification-extensions/SpecificationExtensions.vue.js +7 -0
  341. package/dist/specification-extensions/SpecificationExtensions.vue.js.map +1 -0
  342. package/dist/specification-extensions/SpecificationExtensions.vue.script.js +21 -0
  343. package/dist/specification-extensions/SpecificationExtensions.vue.script.js.map +1 -0
  344. package/dist/specification-extensions/index.d.ts +2 -0
  345. package/dist/specification-extensions/index.d.ts.map +1 -0
  346. package/dist/specification-extensions/index.js +2 -0
  347. package/dist/style.css +576 -15
  348. package/dist/styles/schema-tree.css +91 -0
  349. package/dist/styles/tailwind.config.css +22 -0
  350. package/dist/vue-styles.css +1 -1
  351. package/package.json +45 -7
@@ -0,0 +1,59 @@
1
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
3
+ import { type ModelLinkOptions } from './helpers/is-model-linkable';
4
+ type __VLS_Props = {
5
+ value: SchemaObject | undefined;
6
+ enum?: boolean;
7
+ isDiscriminator?: boolean;
8
+ required?: boolean;
9
+ additional?: boolean;
10
+ withExamples?: boolean;
11
+ hideModelNames?: boolean;
12
+ /**
13
+ * Config for deciding whether a model name links to the models section. When the section or
14
+ * the referenced model is hidden there is nothing to scroll to, so the name renders as plain text.
15
+ */
16
+ modelLinkOptions?: ModelLinkOptions;
17
+ /** When the schema was resolved from a $ref, pass the ref name so it displays as e.g. "Data" instead of "object". */
18
+ modelName?: string | null;
19
+ /** Resolved propertyNames schema, used to surface key constraints like `format` for additional properties. */
20
+ propertyNames?: SchemaObject;
21
+ eventBus?: WorkspaceEventBus | null;
22
+ /**
23
+ * The row's name is a stand-in for keys the caller chooses
24
+ * (`additionalProperties`) or keys matching a regex (`patternProperties`),
25
+ * not a literal property. The heading says so in the signature line, where
26
+ * the tree already describes shapes, instead of styling the name itself.
27
+ */
28
+ keyKind?: 'additional' | 'pattern';
29
+ /**
30
+ * The name of the schema this row loops back to. A cut cycle is a leaf, so
31
+ * the signature line says why it does not expand; the model link beside it
32
+ * already names the schema the loop returns to.
33
+ */
34
+ recursiveTo?: string;
35
+ };
36
+ declare var __VLS_1: {}, __VLS_80: {}, __VLS_82: {};
37
+ type __VLS_Slots = {} & {
38
+ name?: (props: typeof __VLS_1) => any;
39
+ } & {
40
+ preview?: (props: typeof __VLS_80) => any;
41
+ } & {
42
+ trailing?: (props: typeof __VLS_82) => any;
43
+ };
44
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
45
+ required: boolean;
46
+ eventBus: WorkspaceEventBus | null;
47
+ hideModelNames: boolean;
48
+ isDiscriminator: boolean;
49
+ withExamples: boolean;
50
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
51
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
52
+ declare const _default: typeof __VLS_export;
53
+ export default _default;
54
+ type __VLS_WithSlots<T, S> = T & {
55
+ new (): {
56
+ $slots: S;
57
+ };
58
+ };
59
+ //# sourceMappingURL=SchemaPropertyHeading.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaPropertyHeading.vue.d.ts","sourceRoot":"","sources":["../../src/schema/SchemaPropertyHeading.vue"],"names":[],"mappings":"AA4qBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAWhG,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,6BAA6B,CAAA;AASpC,KAAK,WAAW,GAAG;IACf,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,qHAAqH;IACrH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,8GAA8G;IAC9G,aAAa,CAAC,EAAE,YAAY,CAAA;IAC5B,QAAQ,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;IACnC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AAkvBJ,QAAA,IAAI,OAAO,IAAU,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AAClE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACzC;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKjD,QAAA,MAAM,UAAU;cAtxBD,OAAO;cAaP,iBAAiB,GAAG,IAAI;oBAVlB,OAAO;qBAJN,OAAO;kBAGV,OAAO;6EAuxBxB,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./SchemaPropertyHeading.vue.script.js";
3
+ /* empty css */
4
+ //#region src/schema/SchemaPropertyHeading.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-266fd7fb"]]);
6
+ //#endregion
7
+ export { n as default };
8
+
9
+ //# sourceMappingURL=SchemaPropertyHeading.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaPropertyHeading.vue.js","names":[],"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 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 <!-- 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":""}
@@ -0,0 +1,270 @@
1
+ import { useLocalization as e } from "./localization/index.js";
2
+ import { getSchemaType as t } from "./helpers/get-schema-type.js";
3
+ import { getModelNameWithArray as n } from "./helpers/schema-name.js";
4
+ import { getDisplayTypeSignatureTokens as r } from "./helpers/get-type-signature-tokens.js";
5
+ import i from "../shared/Badge.vue.js";
6
+ import { isModelLinkable as ee } from "./helpers/is-model-linkable.js";
7
+ import te from "./RenderString.vue.js";
8
+ import a from "./SchemaPropertyDefault.vue.js";
9
+ import o from "./SchemaPropertyDetail.vue.js";
10
+ import s from "./SchemaPropertyExamples.vue.js";
11
+ import c from "./SchemaPropertyPattern.vue.js";
12
+ import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as h, createTextVNode as g, createVNode as _, defineComponent as v, normalizeClass as y, openBlock as b, renderList as x, renderSlot as S, toDisplayString as C, toRef as w, unref as T, withCtx as E } from "vue";
13
+ import { resolve as D } from "@scalar/workspace-store/resolve";
14
+ import { isDefined as O } from "@scalar/helpers/array/is-defined";
15
+ import { isArraySchema as k, isNumberSchema as A, isStringSchema as j } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
16
+ //#region src/schema/SchemaPropertyHeading.vue?vue&type=script&setup=true&lang.ts
17
+ var ne = { class: "property-heading [&>.property-detail:has(+.property-detail)]:mr-0" }, re = {
18
+ key: 1,
19
+ class: "property-discriminator"
20
+ }, ie = { class: "font-code text-c-accent" }, M = { class: "screenreader-only" }, N = {
21
+ key: 0,
22
+ class: "property-type-signature text-c-2 text-(length:--scalar-mini)"
23
+ }, P = {
24
+ key: 1,
25
+ class: "property-type-signature text-c-2 text-(length:--scalar-mini)"
26
+ }, F = {
27
+ key: 0,
28
+ class: "screenreader-only"
29
+ }, I = {
30
+ key: 3,
31
+ class: "property-additional"
32
+ }, L = {
33
+ key: 4,
34
+ class: "property-deprecated"
35
+ }, R = {
36
+ key: 5,
37
+ class: "property-const"
38
+ }, z = {
39
+ key: 7,
40
+ class: "property-write-only"
41
+ }, B = {
42
+ key: 8,
43
+ class: "property-read-only"
44
+ }, V = {
45
+ key: 9,
46
+ class: "property-required"
47
+ }, H = /*@__PURE__*/ v({
48
+ __name: "SchemaPropertyHeading",
49
+ props: {
50
+ value: {},
51
+ enum: { type: Boolean },
52
+ isDiscriminator: {
53
+ type: Boolean,
54
+ default: !1
55
+ },
56
+ required: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ additional: { type: Boolean },
61
+ withExamples: {
62
+ type: Boolean,
63
+ default: !0
64
+ },
65
+ hideModelNames: {
66
+ type: Boolean,
67
+ default: !1
68
+ },
69
+ modelLinkOptions: {},
70
+ modelName: {},
71
+ propertyNames: {},
72
+ eventBus: { default: null },
73
+ keyKind: {},
74
+ recursiveTo: {}
75
+ },
76
+ setup(v) {
77
+ let H = v, { translate: U } = e(), W = w(H, "value"), G = u(() => {
78
+ if (!W.value) return;
79
+ let e = W.value;
80
+ if (e.const !== void 0) return e.const;
81
+ if (e.enum?.length === 1) return e.enum[0];
82
+ if (k(e) && e.items) {
83
+ let t = D.schema(e.items);
84
+ if (O(t.const)) return t.const;
85
+ if (t.enum?.length === 1) return t.enum[0];
86
+ }
87
+ }), K = (e) => {
88
+ let t = [];
89
+ return j(e) && (e.minLength && t.push({
90
+ key: "min-length",
91
+ prefix: `${U("schema.minLength")}: `,
92
+ value: e.minLength
93
+ }), e.maxLength && t.push({
94
+ key: "max-length",
95
+ prefix: `${U("schema.maxLength")}: `,
96
+ value: e.maxLength
97
+ })), (j(e) || A(e)) && e.format && t.push({
98
+ key: "format",
99
+ value: e.format,
100
+ truncate: !0
101
+ }), A(e) && (O(e.exclusiveMinimum) && t.push({
102
+ key: "exclusive-minimum",
103
+ prefix: `${U("schema.greaterThan")}: `,
104
+ value: e.exclusiveMinimum
105
+ }), O(e.minimum) && t.push({
106
+ key: "minimum",
107
+ prefix: `${U("schema.min")}: `,
108
+ value: e.minimum
109
+ }), O(e.exclusiveMaximum) && t.push({
110
+ key: "exclusive-maximum",
111
+ prefix: `${U("schema.lessThan")}: `,
112
+ value: e.exclusiveMaximum
113
+ }), O(e.maximum) && t.push({
114
+ key: "maximum",
115
+ prefix: `${U("schema.max")}: `,
116
+ value: e.maximum
117
+ }), O(e.multipleOf) && t.push({
118
+ key: "multiple-of",
119
+ prefix: `${U("schema.multipleOf")}: `,
120
+ value: e.multipleOf
121
+ })), t;
122
+ }, q = u(() => {
123
+ if (!W.value) return [];
124
+ let e = W.value, t = [];
125
+ return k(e) && ((e.minItems || e.maxItems) && t.push({
126
+ key: "array-range",
127
+ value: `${e.minItems || ""}…${e.maxItems || ""}`
128
+ }), e.uniqueItems && t.push({
129
+ key: "unique-items",
130
+ value: `${U("schema.unique")}!`
131
+ })), t.push(...K(e)), k(e) && e.items && t.push(...K(D.schema(e.items))), t;
132
+ }), J = u(() => !H.value || H.hideModelNames ? null : H.modelName ? {
133
+ schemaKey: H.modelName,
134
+ label: H.modelName
135
+ } : n(H.value)), Y = u(() => ee(J.value?.schemaKey, H.modelLinkOptions ?? {})), X = u(() => r(H.value, {
136
+ hideModelNames: H.hideModelNames,
137
+ modelName: J.value?.label
138
+ })), ae = u(() => !H.value || !("type" in H.value) ? !1 : H.value.type === "array" || !G.value), Z = u(() => {
139
+ let e = H.propertyNames;
140
+ if (!e) return;
141
+ let n = [t(e)];
142
+ "format" in e && typeof e.format == "string" && n.push(e.format);
143
+ let r = n.filter(Boolean).join(" · ");
144
+ return r.length > 0 ? r : void 0;
145
+ }), Q = u(() => {
146
+ if (H.value && "example" in H.value && H.value.example !== void 0) return H.value.example;
147
+ if (H.value && k(H.value)) {
148
+ let e = D.schema(H.value.items);
149
+ if (e && "example" in e && e.example !== void 0) return e.example;
150
+ }
151
+ }), oe = u(() => {
152
+ if (Q.value !== void 0) return !0;
153
+ let e = H.value?.examples;
154
+ return !!e && typeof e == "object" && Object.keys(e).length > 0;
155
+ }), $ = u(() => {
156
+ let e = W.value;
157
+ if (e) {
158
+ if (j(e) && e.pattern) return e.pattern;
159
+ if (k(e) && e.items) {
160
+ let t = D.schema(e.items);
161
+ if (j(t) && t.pattern) return t.pattern;
162
+ }
163
+ }
164
+ });
165
+ return (e, t) => (b(), p("div", ne, [
166
+ e.$slots.name ? (b(), p("div", {
167
+ key: 0,
168
+ class: y(["property-name", { deprecated: H.value?.deprecated }])
169
+ }, [S(e.$slots, "name", {}, void 0, !0)], 2)) : f("", !0),
170
+ H.isDiscriminator ? (b(), p("div", re, C(T(U)("schema.discriminator")), 1)) : f("", !0),
171
+ H.value ? (b(), p(l, { key: 2 }, [
172
+ H.keyKind ? (b(), d(o, {
173
+ key: 0,
174
+ class: "property-key-kind"
175
+ }, {
176
+ default: E(() => [m("span", ie, C(H.keyKind === "pattern" ? "patternProperty" : "additionalProperty"), 1)]),
177
+ _: 1
178
+ })) : f("", !0),
179
+ ae.value ? (b(), d(o, {
180
+ key: 1,
181
+ truncate: ""
182
+ }, {
183
+ default: E(() => [m("span", M, C(T(U)("schema.type")) + ": ", 1), H.eventBus && J.value?.schemaKey && Y.value ? (b(), p("button", {
184
+ key: 0,
185
+ class: "text-c-2 hover:text-c-1 underline",
186
+ type: "button",
187
+ onClick: t[0] ||= (e) => H.eventBus.emit("scroll-to:model-by-name", { name: J.value.schemaKey })
188
+ }, [X.value.length ? (b(), p("span", N, [(b(!0), p(l, null, x(X.value, (e, t) => (b(), p(l, { key: t }, [g(C(t > 0 ? " " : ""), 1), m("span", { class: y(["property-type-token", [
189
+ `property-type-token--${e.kind}`,
190
+ e.kind === "word" ? "font-sans" : "",
191
+ e.kind === "ident" || e.kind === "literal" ? "font-code" : "",
192
+ e.kind === "punctuation" ? "text-c-2" : ""
193
+ ]]) }, C(e.text), 3)], 64))), 128))])) : f("", !0)])) : X.value.length ? (b(), p("span", P, [(b(!0), p(l, null, x(X.value, (e, t) => (b(), p(l, { key: t }, [g(C(t > 0 ? " " : ""), 1), m("span", { class: y(["property-type-token", [
194
+ `property-type-token--${e.kind}`,
195
+ e.kind === "word" ? "font-sans" : "",
196
+ e.kind === "ident" || e.kind === "literal" ? "font-code" : "",
197
+ e.kind === "punctuation" ? "text-c-2" : ""
198
+ ]]) }, C(e.text), 3)], 64))), 128))])) : f("", !0)]),
199
+ _: 1
200
+ })) : f("", !0),
201
+ H.recursiveTo ? (b(), d(o, {
202
+ key: 2,
203
+ class: "property-recursive",
204
+ title: T(U)("schema.recursiveReference", { name: H.recursiveTo })
205
+ }, {
206
+ default: E(() => [g(C(T(U)("schema.recursive")), 1)]),
207
+ _: 1
208
+ }, 8, ["title"])) : f("", !0),
209
+ Z.value ? (b(), d(o, {
210
+ key: 3,
211
+ truncate: ""
212
+ }, {
213
+ prefix: E(() => [g(C(T(U)("schema.keys")) + ":", 1)]),
214
+ default: E(() => [g(" " + C(Z.value), 1)]),
215
+ _: 1
216
+ })) : f("", !0),
217
+ (b(!0), p(l, null, x(q.value, (e) => (b(), d(o, {
218
+ key: e.key,
219
+ code: e.code,
220
+ truncate: e.truncate
221
+ }, h({
222
+ default: E(() => [e.key === "format" ? (b(), p("span", F, C(T(U)("schema.format")) + ": ", 1)) : f("", !0), g(" " + C(e.value), 1)]),
223
+ _: 2
224
+ }, [e.prefix ? {
225
+ name: "prefix",
226
+ fn: E(() => [g(C(e.prefix), 1)]),
227
+ key: "0"
228
+ } : void 0]), 1032, ["code", "truncate"]))), 128)),
229
+ H.enum ? (b(), d(o, { key: 4 }, {
230
+ default: E(() => [g(C(T(U)("schema.enum")), 1)]),
231
+ _: 1
232
+ })) : f("", !0)
233
+ ], 64)) : f("", !0),
234
+ H.additional ? (b(), p("div", I, [H.value?.["x-additionalPropertiesName"] ? (b(), p(l, { key: 0 }, [g(C(H.value["x-additionalPropertiesName"]), 1)], 64)) : (b(), p(l, { key: 1 }, [g(C(T(U)("schema.additionalProperties")), 1)], 64))])) : f("", !0),
235
+ H.value?.deprecated ? (b(), p("div", L, [_(i, null, {
236
+ default: E(() => [g(C(T(U)("schema.deprecated")), 1)]),
237
+ _: 1
238
+ })])) : f("", !0),
239
+ G.value === void 0 ? (b(), p(l, { key: 6 }, [H.value?.nullable === !0 ? (b(), d(o, { key: 0 }, {
240
+ default: E(() => [g(C(T(U)("schema.nullable")), 1)]),
241
+ _: 1
242
+ })) : f("", !0)], 64)) : (b(), p("div", R, [_(o, { truncate: "" }, {
243
+ prefix: E(() => [g(C(T(U)("schema.const")) + ": ", 1)]),
244
+ default: E(() => [_(te, { value: G.value }, null, 8, ["value"])]),
245
+ _: 1
246
+ })])),
247
+ H.value?.writeOnly ? (b(), p("div", z, C(T(U)("schema.writeOnly")), 1)) : H.value?.readOnly ? (b(), p("div", B, C(T(U)("schema.readOnly")), 1)) : f("", !0),
248
+ H.required ? (b(), p("div", V, C(T(U)("schema.required")), 1)) : f("", !0),
249
+ H.value?.default === void 0 ? f("", !0) : (b(), d(a, {
250
+ key: 10,
251
+ value: H.value?.default
252
+ }, null, 8, ["value"])),
253
+ $.value ? (b(), d(c, {
254
+ key: 11,
255
+ pattern: $.value
256
+ }, null, 8, ["pattern"])) : f("", !0),
257
+ H.withExamples && oe.value ? (b(), d(s, {
258
+ key: 12,
259
+ example: Q.value,
260
+ examples: H.value?.examples
261
+ }, null, 8, ["example", "examples"])) : f("", !0),
262
+ S(e.$slots, "preview", {}, void 0, !0),
263
+ S(e.$slots, "trailing", {}, void 0, !0)
264
+ ]));
265
+ }
266
+ });
267
+ //#endregion
268
+ export { H as default };
269
+
270
+ //# sourceMappingURL=SchemaPropertyHeading.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaPropertyHeading.vue.script.js","names":["$slots"],"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 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 <!-- 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,IAAM,IAAQ,GAyCR,EAAE,iBAAc,EAAgB,GAGhC,IAAW,EAAM,GAAO,OAAO,GAE/B,IAAa,QAAe;GAChC,IAAI,CAAC,EAAS,OACZ;GAGF,IAAM,IAAS,EAAS;GAGxB,IAAI,EAAO,UAAU,KAAA,GACnB,OAAO,EAAO;GAIhB,IAAI,EAAO,MAAM,WAAW,GAC1B,OAAO,EAAO,KAAK;GAIrB,IAAI,EAAc,CAAM,KAAK,EAAO,OAAO;IACzC,IAAM,IAAQ,EAAQ,OAAO,EAAO,KAAK;IAEzC,IAAI,EAAU,EAAM,KAAK,GACvB,OAAO,EAAM;IAGf,IAAI,EAAM,MAAM,WAAW,GACzB,OAAO,EAAM,KAAK;GAEtB;EAGF,CAAC,GAgBK,KAAsB,MAAyB;GACnD,IAAM,IAAmC,CAAC;GAwE1C,OAtEI,EAAe,CAAM,MACnB,EAAO,aACT,EAAW,KAAK;IACd,KAAK;IACL,QAAQ,GAAG,EAAU,kBAAkB,EAAE;IACzC,OAAO,EAAO;GAChB,CAAC,GAGC,EAAO,aACT,EAAW,KAAK;IACd,KAAK;IACL,QAAQ,GAAG,EAAU,kBAAkB,EAAE;IACzC,OAAO,EAAO;GAChB,CAAC,KAMA,EAAe,CAAM,KAAK,EAAe,CAAM,MAAM,EAAO,UAC/D,EAAW,KAAK;IACd,KAAK;IACL,OAAO,EAAO;IACd,UAAU;GACZ,CAAC,GAGC,EAAe,CAAM,MACnB,E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Mixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
7
+ //# sourceMappingURL=SchemaPropertyPattern.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaPropertyPattern.vue.d.ts","sourceRoot":"","sources":["../../src/schema/SchemaPropertyPattern.vue"],"names":[],"mappings":"AAyJA,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AA4IvC,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,9 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./SchemaPropertyPattern.vue.script.js";
3
+ /* empty css */
4
+ //#region src/schema/SchemaPropertyPattern.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-db399b2d"]]);
6
+ //#endregion
7
+ export { n as default };
8
+
9
+ //# sourceMappingURL=SchemaPropertyPattern.vue.js.map
@@ -0,0 +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 class=\"property-pattern-value group\"\n type=\"button\"\n :aria-label=\"`${translate('schema.copyPattern')}: ${pattern}`\"\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":""}
@@ -0,0 +1,45 @@
1
+ import e from "./LinkButton.vue.js";
2
+ import { useLocalization as t } from "./localization/index.js";
3
+ import { createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, ref as l, toDisplayString as u, unref as d, withCtx as f } from "vue";
4
+ import { ScalarIcon as p } from "@scalar/components/icon";
5
+ import { useClipboard as m } from "@scalar/use-hooks/useClipboard";
6
+ import { onClickOutside as h, onKeyStroke as g } from "@vueuse/core";
7
+ //#region src/schema/SchemaPropertyPattern.vue?vue&type=script&setup=true&lang.ts
8
+ var _ = { class: "property-pattern-popup" }, v = ["aria-label"], y = /*@__PURE__*/ o({
9
+ __name: "SchemaPropertyPattern",
10
+ props: { pattern: {} },
11
+ setup(o) {
12
+ let { copyToClipboard: y } = m(), { translate: b } = t(), x = l(null), S = l(!1), C = () => {
13
+ S.value = !S.value;
14
+ }, w = () => {
15
+ S.value = !1;
16
+ };
17
+ return h(x, w), g("Escape", () => {
18
+ S.value && w();
19
+ }), (t, l) => (c(), n("div", {
20
+ ref_key: "rootRef",
21
+ ref: x,
22
+ class: s(["property-pattern", { "is-open": S.value }])
23
+ }, [a(e, {
24
+ class: "decoration-dotted",
25
+ onClick: C
26
+ }, {
27
+ default: f(() => [i(u(d(b)("schema.pattern")), 1)]),
28
+ _: 1
29
+ }), r("div", _, [r("button", {
30
+ class: "property-pattern-value group",
31
+ type: "button",
32
+ "aria-label": `${d(b)("schema.copyPattern")}: ${o.pattern}`,
33
+ onClick: l[0] ||= (e) => d(y)(o.pattern)
34
+ }, [r("code", null, u(o.pattern), 1), a(d(p), {
35
+ "aria-hidden": "true",
36
+ class: "group-hover:text-c-1 text-c-3 ml-auto min-h-3 min-w-3",
37
+ icon: "Clipboard",
38
+ size: "xs"
39
+ })], 8, v)])], 2));
40
+ }
41
+ });
42
+ //#endregion
43
+ export { y as default };
44
+
45
+ //# sourceMappingURL=SchemaPropertyPattern.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaPropertyPattern.vue.script.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 class=\"property-pattern-value group\"\n type=\"button\"\n :aria-label=\"`${translate('schema.copyPattern')}: ${pattern}`\"\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,uBAAoB,EAAa,GACnC,EAAE,iBAAc,EAAgB,GAQhC,IAAU,EAAwB,IAAI,GACtC,IAAS,EAAI,EAAK,GAElB,UAAe;GACnB,EAAO,QAAQ,CAAC,EAAO;EACzB,GAEM,UAAc;GAClB,EAAO,QAAQ;EACjB;SAEA,EAAe,GAAS,CAAK,GAC7B,EAAY,gBAAgB;GAC1B,AAAI,EAAO,SACT,EAAM;EAEV,CAAC,mBAGC,EAuBM,OAAA;YAtBA;GAAJ,KAAI;GACJ,OAAK,EAAA,CAAC,oBAAkB,EAAA,WACH,EAAA,MAAM,CAAA,CAAA;MAC3B,EAIa,GAAA;GAHX,OAAM;GACL,SAAO;;oBACyB,CAAA,EAAA,EAA9B,EAAA,CAAA,CAAS,CAAA,gBAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;MAEd,EAaM,OAbN,GAaM,CAZJ,EAWS,UAAA;GAVP,OAAM;GACN,MAAK;GACJ,cAAU,GAAK,EAAA,CAAA,CAAS,CAAA,oBAAA,EAAA,IAA2B,EAAA;GACnD,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,CAAA,CAAe,CAAC,EAAA,OAAO;MAC/B,EAA0B,QAAA,MAAA,EAAjB,EAAA,OAAO,GAAA,CAAA,GAChB,EAIc,EAAA,CAAA,GAAA;GAHZ,eAAY;GACZ,OAAM;GACN,MAAK;GACL,MAAK"}
@@ -0,0 +1,35 @@
1
+ import { type Component } from 'vue';
2
+ /**
3
+ * The railed panel of the schema tree: an expanded row's children behind a rail
4
+ * that fades with depth. See the indentation model in SchemaProperty.vue.
5
+ *
6
+ * `--schema-depth` must stay inline on the element itself: the `schema-rail`
7
+ * utility reads it for the fade. No margins of its own, because each surface
8
+ * that joins the tree spaces its panel differently.
9
+ */
10
+ type __VLS_Props = {
11
+ /** Nesting depth of the panel, driving how far the rail fades */
12
+ depth: number;
13
+ /** Render the pointer strip over the rail that closes the panel on click */
14
+ closeOnRail?: boolean;
15
+ /** Panel root element or component, so a headless-ui DisclosurePanel can keep the rail recipe */
16
+ as?: string | Component;
17
+ };
18
+ declare var __VLS_8: {};
19
+ type __VLS_Slots = {} & {
20
+ default?: (props: typeof __VLS_8) => any;
21
+ };
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
23
+ close: () => any;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ onClose?: (() => any) | undefined;
26
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
35
+ //# sourceMappingURL=SchemaRailPanel.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaRailPanel.vue.d.ts","sourceRoot":"","sources":["../../src/schema/SchemaRailPanel.vue"],"names":[],"mappings":"AAAA,OAuGO,EAAmB,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAErD;;;;;;;GAOG;AACH,KAAK,WAAW,GAAG;IACjB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAA;IACb,4EAA4E;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,iGAAiG;IACjG,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACxB,CAAC;AAoIF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import e from "./SchemaRailPanel.vue.script.js";
2
+ //#region src/schema/SchemaRailPanel.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
6
+
7
+ //# sourceMappingURL=SchemaRailPanel.vue.js.map
@@ -0,0 +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":""}