@scalar/blocks 0.7.3 → 0.8.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 (203) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/_virtual/_plugin-vue_export-helper.js +1 -2
  3. package/dist/code-example/components/AsyncApiCodeExample.vue.js +1 -2
  4. package/dist/code-example/components/AsyncApiCodeExample.vue.js.map +1 -1
  5. package/dist/code-example/components/AsyncApiCodeExample.vue_vue_type_script_setup_true_lang.js +1 -2
  6. package/dist/code-example/components/AsyncApiCodeExample.vue_vue_type_script_setup_true_lang.js.map +1 -1
  7. package/dist/code-example/components/CodeExample.vue.d.ts +2 -0
  8. package/dist/code-example/components/CodeExample.vue.d.ts.map +1 -1
  9. package/dist/code-example/components/CodeExample.vue.js +4 -5
  10. package/dist/code-example/components/CodeExample.vue.js.map +1 -1
  11. package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js +102 -100
  12. package/dist/code-example/components/CodeExample.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/code-example/components/ExamplePicker.vue.js +1 -2
  14. package/dist/code-example/components/ExamplePicker.vue.js.map +1 -1
  15. package/dist/code-example/components/ExamplePicker.vue_vue_type_script_setup_true_lang.js +1 -2
  16. package/dist/code-example/components/HttpMethod.vue.js +1 -2
  17. package/dist/code-example/components/HttpMethod.vue.js.map +1 -1
  18. package/dist/code-example/components/HttpMethod.vue_vue_type_script_setup_true_lang.js +1 -2
  19. package/dist/code-example/helpers/filter-clients-by-query.js +1 -2
  20. package/dist/code-example/helpers/find-client.js +1 -2
  21. package/dist/code-example/helpers/format-language.js +1 -2
  22. package/dist/code-example/helpers/generate-client-options.js +1 -2
  23. package/dist/code-example/helpers/generate-code-snippet.d.ts +2 -1
  24. package/dist/code-example/helpers/generate-code-snippet.d.ts.map +1 -1
  25. package/dist/code-example/helpers/generate-code-snippet.js +11 -11
  26. package/dist/code-example/helpers/generate-code-snippet.js.map +1 -1
  27. package/dist/code-example/helpers/get-asyncapi-example-context.js +1 -2
  28. package/dist/code-example/helpers/get-clients.js +8 -9
  29. package/dist/code-example/helpers/get-custom-code-samples.js +1 -2
  30. package/dist/code-example/helpers/get-generated-payload-example.js +1 -2
  31. package/dist/code-example/helpers/get-message-example-content.js +1 -2
  32. package/dist/code-example/helpers/get-secrets.js +1 -2
  33. package/dist/code-example/helpers/get-snippet.js +1 -2
  34. package/dist/code-example/helpers/operation-to-har/operation-to-har.d.ts +2 -1
  35. package/dist/code-example/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  36. package/dist/code-example/helpers/operation-to-har/operation-to-har.js +32 -31
  37. package/dist/code-example/helpers/operation-to-har/operation-to-har.js.map +1 -1
  38. package/dist/code-example/helpers/operation-to-har/process-body.d.ts +2 -2
  39. package/dist/code-example/helpers/operation-to-har/process-body.d.ts.map +1 -1
  40. package/dist/code-example/helpers/operation-to-har/process-body.js +80 -52
  41. package/dist/code-example/helpers/operation-to-har/process-body.js.map +1 -1
  42. package/dist/code-example/helpers/operation-to-har/process-parameters.d.ts +2 -1
  43. package/dist/code-example/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  44. package/dist/code-example/helpers/operation-to-har/process-parameters.js +65 -58
  45. package/dist/code-example/helpers/operation-to-har/process-parameters.js.map +1 -1
  46. package/dist/code-example/helpers/operation-to-har/process-security-schemes.d.ts.map +1 -1
  47. package/dist/code-example/helpers/operation-to-har/process-security-schemes.js +31 -28
  48. package/dist/code-example/helpers/operation-to-har/process-security-schemes.js.map +1 -1
  49. package/dist/code-example/helpers/operation-to-har/process-server-url.js +1 -2
  50. package/dist/code-example/index.js +10 -10
  51. package/dist/code-example/mount-asyncapi.js +7 -8
  52. package/dist/code-example/mount.js +5 -6
  53. package/dist/constants.js +2 -3
  54. package/dist/schema/LinkButton.vue.js +1 -2
  55. package/dist/schema/RenderString.vue.js +1 -2
  56. package/dist/schema/RenderString.vue.js.map +1 -1
  57. package/dist/schema/RenderString.vue_vue_type_script_setup_true_lang.js +1 -2
  58. package/dist/schema/Schema.vue.js +4 -5
  59. package/dist/schema/Schema.vue.js.map +1 -1
  60. package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js +67 -68
  61. package/dist/schema/Schema.vue_vue_type_script_setup_true_lang.js.map +1 -1
  62. package/dist/schema/SchemaCollapsedPreview.vue.js +1 -2
  63. package/dist/schema/SchemaCollapsedPreview.vue.js.map +1 -1
  64. package/dist/schema/SchemaCollapsedPreview.vue_vue_type_script_setup_true_lang.js +1 -2
  65. package/dist/schema/SchemaCollapsedPreview.vue_vue_type_script_setup_true_lang.js.map +1 -1
  66. package/dist/schema/SchemaComposition.vue.js +4 -5
  67. package/dist/schema/SchemaComposition.vue.js.map +1 -1
  68. package/dist/schema/SchemaComposition.vue_vue_type_script_setup_true_lang.js +26 -27
  69. package/dist/schema/SchemaComposition.vue_vue_type_script_setup_true_lang.js.map +1 -1
  70. package/dist/schema/SchemaEnumPropertyItem.vue.js +1 -2
  71. package/dist/schema/SchemaEnumPropertyItem.vue.js.map +1 -1
  72. package/dist/schema/SchemaEnumPropertyItem.vue_vue_type_script_setup_true_lang.js +1 -2
  73. package/dist/schema/SchemaEnumPropertyItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  74. package/dist/schema/SchemaEnums.vue.js +4 -5
  75. package/dist/schema/SchemaEnums.vue.js.map +1 -1
  76. package/dist/schema/SchemaEnums.vue_vue_type_script_setup_true_lang.js +12 -13
  77. package/dist/schema/SchemaEnums.vue_vue_type_script_setup_true_lang.js.map +1 -1
  78. package/dist/schema/SchemaGlyphPuck.vue.js +1 -2
  79. package/dist/schema/SchemaGlyphPuck.vue.js.map +1 -1
  80. package/dist/schema/SchemaGlyphPuck.vue_vue_type_script_setup_true_lang.js +1 -2
  81. package/dist/schema/SchemaGutterToggle.vue.js +1 -2
  82. package/dist/schema/SchemaGutterToggle.vue.js.map +1 -1
  83. package/dist/schema/SchemaGutterToggle.vue_vue_type_script_setup_true_lang.js +1 -2
  84. package/dist/schema/SchemaHeading.vue.js +4 -5
  85. package/dist/schema/SchemaHeading.vue.js.map +1 -1
  86. package/dist/schema/SchemaHeading.vue_vue_type_script_setup_true_lang.js +1 -2
  87. package/dist/schema/SchemaHeading.vue_vue_type_script_setup_true_lang.js.map +1 -1
  88. package/dist/schema/SchemaObjectExampleCodeBlock.vue.js +1 -2
  89. package/dist/schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -1
  90. package/dist/schema/SchemaObjectExampleCodeBlock.vue_vue_type_script_setup_true_lang.js +1 -2
  91. package/dist/schema/SchemaObjectExampleCodeBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
  92. package/dist/schema/SchemaObjectProperties.vue.js +1 -2
  93. package/dist/schema/SchemaObjectProperties.vue.js.map +1 -1
  94. package/dist/schema/SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js +1 -2
  95. package/dist/schema/SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js.map +1 -1
  96. package/dist/schema/SchemaProperty.vue.js +4 -5
  97. package/dist/schema/SchemaProperty.vue.js.map +1 -1
  98. package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js +48 -49
  99. package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js.map +1 -1
  100. package/dist/schema/SchemaPropertyDefault.vue.js +4 -5
  101. package/dist/schema/SchemaPropertyDefault.vue.js.map +1 -1
  102. package/dist/schema/SchemaPropertyDefault.vue_vue_type_script_setup_true_lang.js +9 -10
  103. package/dist/schema/SchemaPropertyDefault.vue_vue_type_script_setup_true_lang.js.map +1 -1
  104. package/dist/schema/SchemaPropertyDetail.vue.js +4 -5
  105. package/dist/schema/SchemaPropertyDetail.vue.js.map +1 -1
  106. package/dist/schema/SchemaPropertyDetail.vue_vue_type_script_setup_true_lang.js +1 -2
  107. package/dist/schema/SchemaPropertyDetail.vue_vue_type_script_setup_true_lang.js.map +1 -1
  108. package/dist/schema/SchemaPropertyExamples.vue.js +4 -5
  109. package/dist/schema/SchemaPropertyExamples.vue.js.map +1 -1
  110. package/dist/schema/SchemaPropertyExamples.vue_vue_type_script_setup_true_lang.js +18 -19
  111. package/dist/schema/SchemaPropertyExamples.vue_vue_type_script_setup_true_lang.js.map +1 -1
  112. package/dist/schema/SchemaPropertyHeading.vue.js +4 -5
  113. package/dist/schema/SchemaPropertyHeading.vue.js.map +1 -1
  114. package/dist/schema/SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js +101 -102
  115. package/dist/schema/SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js.map +1 -1
  116. package/dist/schema/SchemaPropertyPattern.vue.js +4 -5
  117. package/dist/schema/SchemaPropertyPattern.vue.js.map +1 -1
  118. package/dist/schema/SchemaPropertyPattern.vue_vue_type_script_setup_true_lang.js +1 -2
  119. package/dist/schema/SchemaRailPanel.vue.js +1 -2
  120. package/dist/schema/SchemaRailPanel.vue.js.map +1 -1
  121. package/dist/schema/SchemaRailPanel.vue_vue_type_script_setup_true_lang.js +1 -2
  122. package/dist/schema/SchemaRailPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  123. package/dist/schema/components/CopyLinkButton.vue.js +1 -2
  124. package/dist/schema/components/CopyLinkButton.vue.js.map +1 -1
  125. package/dist/schema/components/CopyLinkButton.vue_vue_type_script_setup_true_lang.js +1 -2
  126. package/dist/schema/components/WithBreadcrumb.vue.js +1 -2
  127. package/dist/schema/components/WithBreadcrumb.vue.js.map +1 -1
  128. package/dist/schema/components/WithBreadcrumb.vue_vue_type_script_setup_true_lang.js +1 -2
  129. package/dist/schema/discriminator-metadata.js +1 -2
  130. package/dist/schema/helpers/dynamic-scope.js +1 -2
  131. package/dist/schema/helpers/format-example.js +1 -2
  132. package/dist/schema/helpers/format-value.js +1 -2
  133. package/dist/schema/helpers/get-compositions-to-render.js +19 -20
  134. package/dist/schema/helpers/get-discriminator-values.js +1 -2
  135. package/dist/schema/helpers/get-enum-values.js +1 -2
  136. package/dist/schema/helpers/get-property-description.js +1 -2
  137. package/dist/schema/helpers/get-ref-name.js +1 -2
  138. package/dist/schema/helpers/get-rendered-example.js +1 -2
  139. package/dist/schema/helpers/get-schema-type.js +1 -2
  140. package/dist/schema/helpers/get-type-signature-tokens.d.ts +2 -2
  141. package/dist/schema/helpers/get-type-signature-tokens.d.ts.map +1 -1
  142. package/dist/schema/helpers/get-type-signature-tokens.js +3 -4
  143. package/dist/schema/helpers/get-type-signature-tokens.js.map +1 -1
  144. package/dist/schema/helpers/has-complex-array-items.js +1 -2
  145. package/dist/schema/helpers/index.js +13 -13
  146. package/dist/schema/helpers/is-empty-schema-object.js +1 -2
  147. package/dist/schema/helpers/is-model-linkable.js +1 -2
  148. package/dist/schema/helpers/is-on-schema-target-path.js +1 -2
  149. package/dist/schema/helpers/is-type-object.js +1 -2
  150. package/dist/schema/helpers/merge-all-of-schemas.js +1 -2
  151. package/dist/schema/helpers/normalize-object-composition.js +1 -2
  152. package/dist/schema/helpers/optimize-value-for-display.js +1 -2
  153. package/dist/schema/helpers/partition-all-of-compositions.js +1 -2
  154. package/dist/schema/helpers/schema-composition.js +1 -2
  155. package/dist/schema/helpers/schema-cycle.js +1 -2
  156. package/dist/schema/helpers/schema-expansion.js +1 -2
  157. package/dist/schema/helpers/schema-keyboard-nav.js +1 -2
  158. package/dist/schema/helpers/schema-name.js +2 -3
  159. package/dist/schema/helpers/schema-name.js.map +1 -1
  160. package/dist/schema/helpers/should-display-description.js +1 -2
  161. package/dist/schema/helpers/should-display-heading.js +1 -2
  162. package/dist/schema/helpers/should-render-array-item-composition.js +1 -2
  163. package/dist/schema/helpers/sort-property-names.js +1 -2
  164. package/dist/schema/helpers/unwrap-for-read.js +1 -2
  165. package/dist/schema/index.js +8 -8
  166. package/dist/schema/localization/index.js +1 -2
  167. package/dist/schema/localization/locales/ar.js +1 -2
  168. package/dist/schema/localization/locales/de.js +1 -2
  169. package/dist/schema/localization/locales/en.js +1 -2
  170. package/dist/schema/localization/locales/es.js +1 -2
  171. package/dist/schema/localization/locales/fr.js +1 -2
  172. package/dist/schema/localization/locales/pt.js +1 -2
  173. package/dist/schema/localization/locales/ru.js +1 -2
  174. package/dist/schema/localization/locales/zh-cn.js +1 -2
  175. package/dist/schema/localization/locales/zh-tw.js +1 -2
  176. package/dist/schema/localization/translations.js +1 -2
  177. package/dist/schema/protobuf-metadata.js +1 -2
  178. package/dist/schema/recursive-metadata.js +1 -2
  179. package/dist/schema/request-body-composition-index.js +1 -2
  180. package/dist/shared/Badge.vue.d.ts.map +1 -1
  181. package/dist/shared/Badge.vue.js +4 -5
  182. package/dist/shared/Badge.vue.js.map +1 -1
  183. package/dist/shared/Badge.vue_vue_type_script_setup_true_lang.js +2 -3
  184. package/dist/shared/Badge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  185. package/dist/shared/ExternalDocs.vue.js +1 -2
  186. package/dist/shared/ExternalDocs.vue.js.map +1 -1
  187. package/dist/shared/ExternalDocs.vue_vue_type_script_setup_true_lang.js +1 -2
  188. package/dist/shared/ExternalDocs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  189. package/dist/shared/ScreenReader.vue.js +1 -2
  190. package/dist/shared/ScreenReader.vue.js.map +1 -1
  191. package/dist/shared/ScreenReader.vue_vue_type_script_setup_true_lang.js +1 -2
  192. package/dist/shared/index.js +4 -4
  193. package/dist/specification-extensions/ExtensionValue.vue.js +1 -2
  194. package/dist/specification-extensions/ExtensionValue.vue.js.map +1 -1
  195. package/dist/specification-extensions/ExtensionValue.vue_vue_type_script_setup_true_lang.js +5 -6
  196. package/dist/specification-extensions/ExtensionValue.vue_vue_type_script_setup_true_lang.js.map +1 -1
  197. package/dist/specification-extensions/SpecificationExtensions.vue.js +1 -2
  198. package/dist/specification-extensions/SpecificationExtensions.vue.js.map +1 -1
  199. package/dist/specification-extensions/SpecificationExtensions.vue_vue_type_script_setup_true_lang.js +1 -2
  200. package/dist/specification-extensions/SpecificationExtensions.vue_vue_type_script_setup_true_lang.js.map +1 -1
  201. package/dist/style.css +42 -22
  202. package/dist/vue-styles.css +1 -1
  203. package/package.json +24 -24
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaRailPanel.vue.js","names":["_sfc_main","SchemaRailPanel_vue_vue_type_script_setup_true_lang_default","SchemaRailPanel_default"],"sources":["../../src/schema/SchemaRailPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, type Component } from 'vue'\n\n/**\n * The railed panel of the schema tree: an expanded row's children behind a rail\n * that fades with depth. See the indentation model in SchemaProperty.vue.\n *\n * `--schema-depth` must stay inline on the element itself: the `schema-rail`\n * utility reads it for the fade. No margins of its own, because each surface\n * that joins the tree spaces its panel differently.\n */\nconst {\n depth,\n closeOnRail = false,\n as = 'div',\n} = defineProps<{\n /** Nesting depth of the panel, driving how far the rail fades */\n depth: number\n /** Render the pointer strip over the rail that closes the panel on click */\n closeOnRail?: boolean\n /** Panel root element or component, so a headless-ui DisclosurePanel can keep the rail recipe */\n as?: string | Component\n}>()\n\nconst emit = defineEmits<{\n (e: 'close'): void\n}>()\n\n/**\n * A hovered strip colours this panel's rail and lights the puck of the control\n * that owns the panel. Both used to be `:has(... :hover)` selectors, which made\n * every railed row a `:has()` invalidation anchor, so each element inserted\n * under an open row restyled its whole subtree. The strip's pointer events now\n * write the same state as attributes that exist only while it is hovered:\n * `data-rail-hovered` on the panel root and `data-child-rail-hovered` on the\n * panel's parent, the element the tailwind.config.css variants look through to\n * the control. Read off DOM adjacency exactly like the selectors they replace,\n * so every surface that rails a panel is covered without wiring.\n */\nlet hovered: { panel: HTMLElement; row: HTMLElement | null } | null = null\n\nconst clearRailHover = (): void => {\n hovered?.panel.removeAttribute('data-rail-hovered')\n hovered?.row?.removeAttribute('data-child-rail-hovered')\n hovered = null\n}\n\nconst setRailHover = (event: Event, on: boolean): void => {\n clearRailHover()\n\n if (!on) {\n return\n }\n\n const panel =\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget.parentElement\n : null\n\n if (!panel) {\n return\n }\n\n const row = panel.parentElement\n panel.setAttribute('data-rail-hovered', '')\n row?.setAttribute('data-child-rail-hovered', '')\n hovered = { panel, row }\n}\n\n/**\n * Folding the panel hides the strip under the pointer, so no pointerleave ever\n * follows the click: the marks go before the close, or the puck stays lit.\n */\nconst onStripClick = (): void => {\n clearRailHover()\n emit('close')\n}\n\n/* The strip also disappears without a pointerleave when the panel unmounts,\n and the parent row it marked outlives it. */\nonBeforeUnmount(clearRailHover)\n</script>\n<template>\n <component\n :is=\"as\"\n class=\"schema-rail-panel schema-rail rail-hover:border-s-c-1 relative ps-[var(--schema-gutter,16px)]\"\n :style=\"{ '--schema-depth': depth }\">\n <!-- Pointer-only strip along the rail that folds the panel; hidden from\n assistive tech because the row's own toggle is the accessible control. -->\n <div\n v-if=\"closeOnRail\"\n aria-hidden=\"true\"\n class=\"rail-hit z-[1]\"\n data-rail-hit\n @click.stop=\"onStripClick\"\n @pointerenter=\"setRailHover($event, true)\"\n @pointerleave=\"setRailHover($event, false)\" />\n <slot />\n </component>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SchemaRailPanel.vue.js","names":["SchemaRailPanel_vue_vue_type_script_setup_true_lang_default","SchemaRailPanel_default"],"sources":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { createBlock as e, createCommentVNode as t, createElementBlock as n, defineComponent as r, normalizeStyle as i, onBeforeUnmount as a, openBlock as o, renderSlot as s, resolveDynamicComponent as c, withCtx as l, withModifiers as u } from "vue";
2
- //#region src/schema/SchemaRailPanel.vue?vue&type=script&setup=true&lang.ts
2
+ // src/schema/SchemaRailPanel.vue?vue&type=script&setup=true&lang.ts
3
3
  var d = /*@__PURE__*/ r({
4
4
  __name: "SchemaRailPanel",
5
5
  props: {
@@ -43,7 +43,6 @@ var d = /*@__PURE__*/ r({
43
43
  }, 8, ["style"]));
44
44
  }
45
45
  });
46
- //#endregion
47
46
  export { d as default };
48
47
 
49
48
  //# sourceMappingURL=SchemaRailPanel.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaRailPanel.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_normalizeStyle","_withCtx","_createElementBlock","_withModifiers","_createCommentVNode","_renderSlot","SchemaRailPanel_vue_vue_type_script_setup_true_lang_default","__emit","emit","hovered","clearRailHover","setRailHover","on","panel","event","row","onStripClick","onBeforeUnmount","openBlock","createBlock","resolveDynamicComponent","__props","normalizeStyle","withCtx","createElementBlock","withModifiers","_cache","$event","createCommentVNode","renderSlot","_ctx"],"sources":["../../src/schema/SchemaRailPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, type Component } from 'vue'\n\n/**\n * The railed panel of the schema tree: an expanded row's children behind a rail\n * that fades with depth. See the indentation model in SchemaProperty.vue.\n *\n * `--schema-depth` must stay inline on the element itself: the `schema-rail`\n * utility reads it for the fade. No margins of its own, because each surface\n * that joins the tree spaces its panel differently.\n */\nconst {\n depth,\n closeOnRail = false,\n as = 'div',\n} = defineProps<{\n /** Nesting depth of the panel, driving how far the rail fades */\n depth: number\n /** Render the pointer strip over the rail that closes the panel on click */\n closeOnRail?: boolean\n /** Panel root element or component, so a headless-ui DisclosurePanel can keep the rail recipe */\n as?: string | Component\n}>()\n\nconst emit = defineEmits<{\n (e: 'close'): void\n}>()\n\n/**\n * A hovered strip colours this panel's rail and lights the puck of the control\n * that owns the panel. Both used to be `:has(... :hover)` selectors, which made\n * every railed row a `:has()` invalidation anchor, so each element inserted\n * under an open row restyled its whole subtree. The strip's pointer events now\n * write the same state as attributes that exist only while it is hovered:\n * `data-rail-hovered` on the panel root and `data-child-rail-hovered` on the\n * panel's parent, the element the tailwind.config.css variants look through to\n * the control. Read off DOM adjacency exactly like the selectors they replace,\n * so every surface that rails a panel is covered without wiring.\n */\nlet hovered: { panel: HTMLElement; row: HTMLElement | null } | null = null\n\nconst clearRailHover = (): void => {\n hovered?.panel.removeAttribute('data-rail-hovered')\n hovered?.row?.removeAttribute('data-child-rail-hovered')\n hovered = null\n}\n\nconst setRailHover = (event: Event, on: boolean): void => {\n clearRailHover()\n\n if (!on) {\n return\n }\n\n const panel =\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget.parentElement\n : null\n\n if (!panel) {\n return\n }\n\n const row = panel.parentElement\n panel.setAttribute('data-rail-hovered', '')\n row?.setAttribute('data-child-rail-hovered', '')\n hovered = { panel, row }\n}\n\n/**\n * Folding the panel hides the strip under the pointer, so no pointerleave ever\n * follows the click: the marks go before the close, or the puck stays lit.\n */\nconst onStripClick = (): void => {\n clearRailHover()\n emit('close')\n}\n\n/* The strip also disappears without a pointerleave when the panel unmounts,\n and the parent row it marked outlives it. */\nonBeforeUnmount(clearRailHover)\n</script>\n<template>\n <component\n :is=\"as\"\n class=\"schema-rail-panel schema-rail rail-hover:border-s-c-1 relative ps-[var(--schema-gutter,16px)]\"\n :style=\"{ '--schema-depth': depth }\">\n <!-- Pointer-only strip along the rail that folds the panel; hidden from\n assistive tech because the row's own toggle is the accessible control. -->\n <div\n v-if=\"closeOnRail\"\n aria-hidden=\"true\"\n class=\"rail-hit z-[1]\"\n data-rail-hit\n @click.stop=\"onStripClick\"\n @pointerenter=\"setRailHover($event, true)\"\n @pointerleave=\"setRailHover($event, false)\" />\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAwBA,IAAMW,IAAOD,GAeTE,IAAkE,MAEhEC,UAA6B;GAGjC,AAFAD,GAAS,MAAM,gBAAgB,mBAAmB,GAClDA,GAAS,KAAK,gBAAgB,yBAAyB,GACvD,IAAU;EACZ,GAEME,KAAgB,GAAc,MAAsB;GAGxD,IAFAD,EAAe,GAEX,CAACE,GACH;GAGF,IAAMC,IACJC,EAAM,yBAAyB,cAC3BA,EAAM,cAAc,gBACpB;GAEN,IAAI,CAACD,GACH;GAGF,IAAME,IAAMF,EAAM;GAGlB,AAFAA,EAAM,aAAa,qBAAqB,EAAE,GAC1CE,GAAK,aAAa,2BAA2B,EAAE,GAC/C,IAAU;IAAE;IAAO;GAAI;EACzB,GAMMC,UAA2B;GAE/B,AADAN,EAAe,GACfF,EAAK,OAAO;EACd;E,OAIAS,EAAgBP,CAAc,I,UAG5Bb,EAAA,GAAAC,EAeYC,EAdLsB,EAAA,EAAE,GAAA;GACP,OAAM;GACL,OAAKrB,EAAA,EAAA,kBAAsBqB,EAAA,MAAK,CAAA;;GAGjC,SAAApB,QAOgD,CANxCoB,EAAA,eADRxB,EAAA,GAAAK,EAOgD,OAAA;;IAL9C,eAAY;IACZ,OAAM;IACN,iBAAA;IACC,SAAKC,EAAOa,GAAY,CAAA,MAAA,CAAA;IACxB,gBAAY,AAAAU,EAAA,QAAA,MAAEf,EAAagB,GAAM,EAAA;IACjC,gBAAY,AAAAD,EAAA,QAAA,MAAEf,EAAagB,GAAM,EAAA;G,2BACpCtB,EAAQyB,EAAA,QAAA,SAAA,C"}
1
+ {"version":3,"file":"SchemaRailPanel.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_normalizeStyle","_withCtx","_createElementBlock","_withModifiers","_renderSlot","SchemaRailPanel_vue_vue_type_script_setup_true_lang_default","__emit","emit","hovered","clearRailHover","setRailHover","on","panel","event","row","onStripClick","onBeforeUnmount","openBlock","createBlock","resolveDynamicComponent","__props","normalizeStyle","withCtx","createElementBlock","withModifiers","_cache","$event","createCommentVNode","renderSlot","_ctx"],"sources":["../../src/schema/SchemaRailPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, type Component } from 'vue'\n\n/**\n * The railed panel of the schema tree: an expanded row's children behind a rail\n * that fades with depth. See the indentation model in SchemaProperty.vue.\n *\n * `--schema-depth` must stay inline on the element itself: the `schema-rail`\n * utility reads it for the fade. No margins of its own, because each surface\n * that joins the tree spaces its panel differently.\n */\nconst {\n depth,\n closeOnRail = false,\n as = 'div',\n} = defineProps<{\n /** Nesting depth of the panel, driving how far the rail fades */\n depth: number\n /** Render the pointer strip over the rail that closes the panel on click */\n closeOnRail?: boolean\n /** Panel root element or component, so a headless-ui DisclosurePanel can keep the rail recipe */\n as?: string | Component\n}>()\n\nconst emit = defineEmits<{\n (e: 'close'): void\n}>()\n\n/**\n * A hovered strip colours this panel's rail and lights the puck of the control\n * that owns the panel. Both used to be `:has(... :hover)` selectors, which made\n * every railed row a `:has()` invalidation anchor, so each element inserted\n * under an open row restyled its whole subtree. The strip's pointer events now\n * write the same state as attributes that exist only while it is hovered:\n * `data-rail-hovered` on the panel root and `data-child-rail-hovered` on the\n * panel's parent, the element the tailwind.config.css variants look through to\n * the control. Read off DOM adjacency exactly like the selectors they replace,\n * so every surface that rails a panel is covered without wiring.\n */\nlet hovered: { panel: HTMLElement; row: HTMLElement | null } | null = null\n\nconst clearRailHover = (): void => {\n hovered?.panel.removeAttribute('data-rail-hovered')\n hovered?.row?.removeAttribute('data-child-rail-hovered')\n hovered = null\n}\n\nconst setRailHover = (event: Event, on: boolean): void => {\n clearRailHover()\n\n if (!on) {\n return\n }\n\n const panel =\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget.parentElement\n : null\n\n if (!panel) {\n return\n }\n\n const row = panel.parentElement\n panel.setAttribute('data-rail-hovered', '')\n row?.setAttribute('data-child-rail-hovered', '')\n hovered = { panel, row }\n}\n\n/**\n * Folding the panel hides the strip under the pointer, so no pointerleave ever\n * follows the click: the marks go before the close, or the puck stays lit.\n */\nconst onStripClick = (): void => {\n clearRailHover()\n emit('close')\n}\n\n/* The strip also disappears without a pointerleave when the panel unmounts,\n and the parent row it marked outlives it. */\nonBeforeUnmount(clearRailHover)\n</script>\n<template>\n <component\n :is=\"as\"\n class=\"schema-rail-panel schema-rail rail-hover:border-s-c-1 relative ps-[var(--schema-gutter,16px)]\"\n :style=\"{ '--schema-depth': depth }\">\n <!-- Pointer-only strip along the rail that folds the panel; hidden from\n assistive tech because the row's own toggle is the accessible control. -->\n <div\n v-if=\"closeOnRail\"\n aria-hidden=\"true\"\n class=\"rail-hit z-[1]\"\n data-rail-hit\n @click.stop=\"onStripClick\"\n @pointerenter=\"setRailHover($event, true)\"\n @pointerleave=\"setRailHover($event, false)\" />\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAwBA,IAAMU,IAAOD,GAeTE,IAAkE,MAEhEC,UAA6B;GAGjC,AAFAD,GAAS,MAAM,gBAAgB,mBAAmB,GAClDA,GAAS,KAAK,gBAAgB,yBAAyB,GACvD,IAAU;EACZ,GAEME,KAAgB,GAAc,MAAsB;GAGxD,IAFAD,EAAe,GAEX,CAACE,GACH;GAGF,IAAMC,IACJC,EAAM,yBAAyB,cAC3BA,EAAM,cAAc,gBACpB;GAEN,IAAI,CAACD,GACH;GAGF,IAAME,IAAMF,EAAM;GAGlB,AAFAA,EAAM,aAAa,qBAAqB,EAAE,GAC1CE,GAAK,aAAa,2BAA2B,EAAE,GAC/C,IAAU;IAAE;IAAO;GAAI;EACzB,GAMMC,UAA2B;GAE/B,AADAN,EAAe,GACfF,EAAK,OAAO;EACd;E,OAIAS,EAAgBP,CAAc,I,UAG5BZ,EAAA,GAAAC,EAeYC,EAdLqB,EAAA,EAAE,GAAA;GACP,OAAM;GACL,OAAKpB,EAAA,EAAA,kBAAsBoB,EAAA,MAAK,CAAA;;GAGjC,SAAAnB,QAOgD,CANxCmB,EAAA,eADRvB,EAAA,GAAAK,EAOgD,OAAA;;IAL9C,eAAY;IACZ,OAAM;IACN,iBAAA;IACC,SAAKC,EAAOY,GAAY,CAAA,MAAA,CAAA;IACxB,gBAAY,AAAAU,EAAA,QAAA,MAAEf,EAAagB,GAAM,EAAA;IACjC,gBAAY,AAAAD,EAAA,QAAA,MAAEf,EAAagB,GAAM,EAAA;G,2BACpCtB,EAAQyB,EAAA,QAAA,SAAA,C"}
@@ -1,7 +1,6 @@
1
1
  import e from "./CopyLinkButton.vue_vue_type_script_setup_true_lang.js";
2
- //#region src/schema/components/CopyLinkButton.vue
2
+ // src/schema/components/CopyLinkButton.vue
3
3
  var t = e;
4
- //#endregion
5
4
  export { t as default };
6
5
 
7
6
  //# sourceMappingURL=CopyLinkButton.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CopyLinkButton.vue.js","names":["_sfc_main","CopyLinkButton_vue_vue_type_script_setup_true_lang_default","CopyLinkButton_default"],"sources":["../../../src/schema/components/CopyLinkButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconHash } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { computed } from 'vue'\n\nimport { useLocalization } from '../localization'\n\n/**\n * A property row's deep-link affordance: the same hash the section headings\n * and the models list show, trailing the row's text in the flow of the heading\n * and revealed on hover or focus. It is a separate component so it can render\n * as the LAST child of the heading: inside `WithBreadcrumb`, which wraps the\n * name, it would come before the type in the tab order (WCAG 2.4.3).\n */\nconst { anchorId } = defineProps<{\n /** The anchor this button copies a link to */\n anchorId: string\n eventBus: WorkspaceEventBus | null\n}>()\n\nconst { translate } = useLocalization()\n\n/** Screen-reader label for the copy-link button, naming the deep-linked item. */\nconst copyLinkLabel = computed(() =>\n translate('actions.copyLinkTo', {\n name: anchorId.split('.').pop() ?? '',\n }),\n)\n</script>\n\n<template>\n <!-- A flex item of the heading, so it wraps with the text. Negative margins\n cancel the padding of the 24px hit area WCAG 2.5.8 asks for, so the box\n overhangs the line instead of taking room from it: vertically it never\n changes the line height, and horizontally the row gives up only the 10px\n gap and the 14px icon (5 + 24 - 5), which is what a collapsed preview\n before it truncates against.\n\n Both inline margins carry `!`: the heading's scoped `.property-heading > *`\n sets a 9px right margin, which is the end margin in LTR and the start\n margin in RTL, at the same specificity as the utility. Which one wins\n depends on whether the consumer's stylesheet puts the utilities before or\n after `vue-styles.css`.\n\n pointer-coarse drops it entirely rather than leaving it transparent: a\n touch pointer has no hover, so a still-laid-out button would be an\n invisible tap target AND would keep pushing long signature lines onto a\n second line just to show a control nobody can see. A deep link stays\n reachable there through the address bar. -->\n <button\n class=\"copy-link-trailing text-c-3 hover:text-c-1 -my-1.25 ms-1.25! -me-1.25! flex shrink-0 cursor-pointer items-center justify-center self-center p-1.25 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 pointer-coarse:hidden\"\n type=\"button\"\n @click=\"() => eventBus?.emit('copy-url:nav-item', { id: anchorId })\">\n <ScalarIconHash\n aria-hidden=\"true\"\n class=\"size-3.5\" />\n <span class=\"sr-only\">\n <slot name=\"sr-label\">{{ copyLinkLabel }}</slot>\n </span>\n </button>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"CopyLinkButton.vue.js","names":["CopyLinkButton_vue_vue_type_script_setup_true_lang_default","CopyLinkButton_default"],"sources":[],"mappings":""}
@@ -1,7 +1,7 @@
1
1
  import { useLocalization as e } from "../localization/index.js";
2
2
  import { computed as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, openBlock as s, renderSlot as c, toDisplayString as l, unref as u } from "vue";
3
3
  import { ScalarIconHash as d } from "@scalar/icons";
4
- //#region src/schema/components/CopyLinkButton.vue?vue&type=script&setup=true&lang.ts
4
+ // src/schema/components/CopyLinkButton.vue?vue&type=script&setup=true&lang.ts
5
5
  var f = { class: "sr-only" }, p = /*@__PURE__*/ o({
6
6
  __name: "CopyLinkButton",
7
7
  props: {
@@ -20,7 +20,6 @@ var f = { class: "sr-only" }, p = /*@__PURE__*/ o({
20
20
  }), r("span", f, [c(e.$slots, "sr-label", {}, () => [i(l(m.value), 1)])])]));
21
21
  }
22
22
  });
23
- //#endregion
24
23
  export { p as default };
25
24
 
26
25
  //# sourceMappingURL=CopyLinkButton.vue_vue_type_script_setup_true_lang.js.map
@@ -1,7 +1,6 @@
1
1
  import e from "./WithBreadcrumb.vue_vue_type_script_setup_true_lang.js";
2
- //#region src/schema/components/WithBreadcrumb.vue
2
+ // src/schema/components/WithBreadcrumb.vue
3
3
  var t = e;
4
- //#endregion
5
4
  export { t as default };
6
5
 
7
6
  //# sourceMappingURL=WithBreadcrumb.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WithBreadcrumb.vue.js","names":["_sfc_main","WithBreadcrumb_vue_vue_type_script_setup_true_lang_default","WithBreadcrumb_default"],"sources":["../../../src/schema/components/WithBreadcrumb.vue"],"sourcesContent":["<script setup lang=\"ts\">\nconst { breadcrumb } = defineProps<{\n breadcrumb?: string[]\n}>()\n</script>\n\n<template>\n <template v-if=\"breadcrumb && breadcrumb.length > 0\">\n <!-- `tabindex=\"-1\"`: focusable programmatically but out of the tab order,\n so a deep link can move focus to its target instead of leaving keyboard\n and screen-reader users at the top of the document -->\n <div\n :id=\"breadcrumb.join('.')\"\n class=\"static scroll-mt-24\"\n tabindex=\"-1\">\n <!-- Content -->\n <slot />\n <!-- No copy button here: the row's heading renders it as its last child\n so tab order matches visual order. See CopyLinkButton.vue -->\n </div>\n </template>\n <template v-else>\n <slot />\n </template>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"WithBreadcrumb.vue.js","names":["WithBreadcrumb_vue_vue_type_script_setup_true_lang_default","WithBreadcrumb_default"],"sources":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, defineComponent as t, openBlock as n, renderSlot as r } from "vue";
2
- //#region src/schema/components/WithBreadcrumb.vue?vue&type=script&setup=true&lang.ts
2
+ // src/schema/components/WithBreadcrumb.vue?vue&type=script&setup=true&lang.ts
3
3
  var i = ["id"], a = /*@__PURE__*/ t({
4
4
  __name: "WithBreadcrumb",
5
5
  props: { breadcrumb: {} },
@@ -12,7 +12,6 @@ var i = ["id"], a = /*@__PURE__*/ t({
12
12
  }, [r(a.$slots, "default")], 8, i)) : r(a.$slots, "default", {}, void 0, void 0, 1);
13
13
  }
14
14
  });
15
- //#endregion
16
15
  export { a as default };
17
16
 
18
17
  //# sourceMappingURL=WithBreadcrumb.vue_vue_type_script_setup_true_lang.js.map
@@ -1,6 +1,5 @@
1
- //#region src/schema/discriminator-metadata.ts
1
+ // src/schema/discriminator-metadata.ts
2
2
  var e = Symbol("schema-discriminator");
3
- //#endregion
4
3
  export { e as schemaDiscriminator };
5
4
 
6
5
  //# sourceMappingURL=discriminator-metadata.js.map
@@ -1,8 +1,7 @@
1
1
  import { inject as e } from "vue";
2
2
  import { isDynamicRef as t, resolveDynamicRef as n } from "@scalar/workspace-store/helpers/dynamic-ref";
3
- //#region src/schema/helpers/dynamic-scope.ts
3
+ // src/schema/helpers/dynamic-scope.ts
4
4
  var r = Symbol("schema-dynamic-scope"), i = [], a = () => e(r, i), o = (e, r) => t(e) ? n(e.$dynamicRef, r) ?? e : e;
5
- //#endregion
6
5
  export { r as SCHEMA_DYNAMIC_SCOPE_SYMBOL, o as resolveDynamicSchema, a as useDynamicScope };
7
6
 
8
7
  //# sourceMappingURL=dynamic-scope.js.map
@@ -1,4 +1,4 @@
1
- //#region src/schema/helpers/format-example.ts
1
+ // src/schema/helpers/format-example.ts
2
2
  function e(e) {
3
3
  let t = e.trim();
4
4
  return t === "" ? e : t;
@@ -6,7 +6,6 @@ function e(e) {
6
6
  function t(t) {
7
7
  return Array.isArray(t) ? `[${t.map((t) => typeof t == "string" ? `"${e(t)}"` : typeof t == "object" ? JSON.stringify(t) : t === void 0 ? "undefined" : t === null ? "null" : t).join(", ")}]` : t === null ? "null" : typeof t == "object" ? JSON.stringify(t) : t === void 0 ? "undefined" : e(typeof t == "string" ? t : t.toString());
8
8
  }
9
- //#endregion
10
9
  export { t as formatExample };
11
10
 
12
11
  //# sourceMappingURL=format-example.js.map
@@ -1,8 +1,7 @@
1
- //#region src/schema/helpers/format-value.ts
1
+ // src/schema/helpers/format-value.ts
2
2
  function e(e) {
3
3
  return Array.isArray(e) ? `[${e.map((e) => typeof e == "string" ? `"${e.toString().trim()}"` : typeof e == "object" ? JSON.stringify(e) : e === void 0 ? "undefined" : e === null ? "null" : e).join(", ")}]` : e === null ? "null" : typeof e == "object" ? JSON.stringify(e) : e === void 0 ? "undefined" : typeof e == "string" ? e.trim() : e.toString().trim();
4
4
  }
5
- //#endregion
6
5
  export { e as formatValue };
7
6
 
8
7
  //# sourceMappingURL=format-value.js.map
@@ -2,39 +2,38 @@ import { getRefName as e } from "./get-ref-name.js";
2
2
  import { compositions as t } from "./schema-composition.js";
3
3
  import { shouldRenderArrayItemComposition as n } from "./should-render-array-item-composition.js";
4
4
  import { unwrapForRead as r } from "./unwrap-for-read.js";
5
- import { isDefined as i } from "@scalar/helpers/array/is-defined";
6
- import { unescapeJsonPointerSegment as a } from "@scalar/helpers/json/unescape-json-pointer-segment";
7
- import { resolve as o } from "@scalar/workspace-store/resolve";
8
- import { isArraySchema as s } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
9
- //#region src/schema/helpers/get-compositions-to-render.ts
10
- var c = (e) => e.startsWith("#/") || e.includes("/") ? e : `#/components/schemas/${e}`, l = (t, n, s) => {
5
+ import { resolve as i } from "@scalar/workspace-store/resolve";
6
+ import { isArraySchema as a } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
7
+ import { isDefined as o } from "@scalar/helpers/array/is-defined";
8
+ import { unescapeJsonPointerSegment as s } from "@scalar/helpers/json/unescape-json-pointer-segment";
9
+ // src/schema/helpers/get-compositions-to-render.ts
10
+ var c = (e) => e.startsWith("#/") || e.includes("/") ? e : `#/components/schemas/${e}`, l = (t, n, a) => {
11
11
  if (t.oneOf || t.anyOf) return null;
12
12
  let l = t.discriminator?.mapping;
13
13
  if (!l) return null;
14
14
  let u = r(n);
15
15
  if (!u?.components?.schemas) return null;
16
- let d = (s ?? Object.values(l)).filter((e) => typeof e == "string").map((t) => {
17
- let n = c(t), r = e(n), i = r ? o.schema(u.components?.schemas?.[a(r)]) : void 0;
18
- if (i) return {
16
+ let d = (a ?? Object.values(l)).filter((e) => typeof e == "string").map((t) => {
17
+ let n = c(t), r = e(n), a = r ? i.schema(u.components?.schemas?.[s(r)]) : void 0;
18
+ if (a) return {
19
19
  $ref: n,
20
- "$ref-value": i
20
+ "$ref-value": a
21
21
  };
22
- }).filter(i);
22
+ }).filter(o);
23
23
  return d.length === 0 ? null : {
24
- ...o.schema(t),
24
+ ...i.schema(t),
25
25
  oneOf: d
26
26
  };
27
- }, u = (e, r, a = e ? l(e, r) : null) => e ? t.map((t) => t === "oneOf" && a ? {
27
+ }, u = (e, r, s = e ? l(e, r) : null) => e ? t.map((t) => t === "oneOf" && s ? {
28
28
  composition: t,
29
- value: a
30
- } : n(e, t) && s(e) && e.items ? {
29
+ value: s
30
+ } : n(e, t) && a(e) && e.items ? {
31
31
  composition: t,
32
- value: o.schema(e.items)
33
- } : e[t] && !(s(e) && e.items && typeof e.items == "object" && t in e.items) ? {
32
+ value: i.schema(e.items)
33
+ } : e[t] && !(a(e) && e.items && typeof e.items == "object" && t in e.items) ? {
34
34
  composition: t,
35
- value: o.schema(e)
36
- } : null).filter(i) : [];
37
- //#endregion
35
+ value: i.schema(e)
36
+ } : null).filter(o) : [];
38
37
  export { u as getCompositionsToRender, l as inferDiscriminatorMappingComposition };
39
38
 
40
39
  //# sourceMappingURL=get-compositions-to-render.js.map
@@ -1,6 +1,5 @@
1
- //#region src/schema/helpers/get-discriminator-values.ts
1
+ // src/schema/helpers/get-discriminator-values.ts
2
2
  var e = (e, t) => !e || !t ? [] : Object.entries(t).filter(([, t]) => t === e || `#/components/schemas/${t}` === e).map(([e]) => e);
3
- //#endregion
4
3
  export { e as getDiscriminatorValues };
5
4
 
6
5
  //# sourceMappingURL=get-discriminator-values.js.map
@@ -1,6 +1,6 @@
1
1
  import { resolve as e } from "@scalar/workspace-store/resolve";
2
2
  import { isArraySchema as t } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
3
- //#region src/schema/helpers/get-enum-values.ts
3
+ // src/schema/helpers/get-enum-values.ts
4
4
  var n = (n) => {
5
5
  if (!n) return [];
6
6
  if (n.enum) return n.enum;
@@ -10,7 +10,6 @@ var n = (n) => {
10
10
  }
11
11
  return [];
12
12
  };
13
- //#endregion
14
13
  export { n as getEnumValues };
15
14
 
16
15
  //# sourceMappingURL=get-enum-values.js.map
@@ -1,5 +1,5 @@
1
1
  import { isSchema as e } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
2
- //#region src/schema/helpers/get-property-description.ts
2
+ // src/schema/helpers/get-property-description.ts
3
3
  var t = {
4
4
  integer: {
5
5
  _default: "schema.typeInteger",
@@ -21,7 +21,6 @@ var t = {
21
21
  let i = t[r];
22
22
  return i ? i["format" in n && n.format || "contentEncoding" in n && n.contentEncoding || "_default"] ?? null : null;
23
23
  };
24
- //#endregion
25
24
  export { n as getPropertyDescriptionKey };
26
25
 
27
26
  //# sourceMappingURL=get-property-description.js.map
@@ -1,5 +1,5 @@
1
1
  import { REGEX as e } from "@scalar/helpers/regex/regex-helpers";
2
- //#region src/schema/helpers/get-ref-name.ts
2
+ // src/schema/helpers/get-ref-name.ts
3
3
  var t = (t) => {
4
4
  if (!t) return null;
5
5
  let n = t.match(e.REF_NAME);
@@ -9,7 +9,6 @@ var t = (t) => {
9
9
  let t = e.match(n);
10
10
  return t?.[1] ? decodeURIComponent(t[1]) : null;
11
11
  };
12
- //#endregion
13
12
  export { t as getRefName, r as getSchemaRefName };
14
13
 
15
14
  //# sourceMappingURL=get-ref-name.js.map
@@ -1,7 +1,7 @@
1
1
  import { isObjectLike as e } from "@scalar/helpers/object/is-object";
2
2
  import { getExampleValue as t } from "@scalar/workspace-store/helpers/get-example-value";
3
3
  import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
- //#region src/schema/helpers/get-rendered-example.ts
4
+ // src/schema/helpers/get-rendered-example.ts
5
5
  var r = Symbol("rendered-example"), i = (t) => {
6
6
  let r = /* @__PURE__ */ new Set(), i = t;
7
7
  for (; e(i) && !r.has(i);) {
@@ -39,7 +39,6 @@ var r = Symbol("rendered-example"), i = (t) => {
39
39
  value: i
40
40
  }] : [];
41
41
  }) : [];
42
- //#endregion
43
42
  export { i as getExampleSummary, a as getRenderedExample, o as normalizeRenderedExamples };
44
43
 
45
44
  //# sourceMappingURL=get-rendered-example.js.map
@@ -1,6 +1,6 @@
1
1
  import { resolve as e } from "@scalar/workspace-store/resolve";
2
2
  import { isArraySchema as t } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
3
- //#region src/schema/helpers/get-schema-type.ts
3
+ // src/schema/helpers/get-schema-type.ts
4
4
  var n = (e) => e ? `array ${e.includes(" | ") ? `(${e})` : e}[]` : "array", r = (t, r = !1) => {
5
5
  if (!t.items) return "array";
6
6
  let a = n(i(e.schema(t.items)));
@@ -18,7 +18,6 @@ var n = (e) => e ? `array ${e.includes(" | ") ? `(${e})` : e}[]` : "array", r =
18
18
  }
19
19
  return t(i) ? r(i, !1) : "type" in i && i.type && i.contentEncoding ? `${i.type} • ${i.contentEncoding}` : "type" in i ? i.type : "";
20
20
  };
21
- //#endregion
22
21
  export { i as getSchemaType };
23
22
 
24
23
  //# sourceMappingURL=get-schema-type.js.map
@@ -37,8 +37,8 @@ export declare const getTypeSignatureTokens: (valueOrRef: SchemaObject | Referen
37
37
  *
38
38
  * A `$ref` renders as the raw component key while the heading link and the
39
39
  * models section show the target's `title`; the caller's name keeps them in
40
- * agreement. Only a `$ref` may be renamed: an inline schema's
41
- * single token is its real type (`integer`), not its `title`.
40
+ * agreement. Inline object titles can name array items too; inline primitive
41
+ * tokens keep their real type (`integer`), rather than their `title`.
42
42
  */
43
43
  export declare const getDisplayTypeSignatureTokens: (valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined, options?: {
44
44
  hideModelNames?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"get-type-signature-tokens.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/get-type-signature-tokens.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAI/G;;;;;GAKG;AACH,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,CAAA;IAClD,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AA+BD;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,YAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,GAAG,SAAS,EAClE,UAAS;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO;AAC1C,mFAAmF;AACnF,iBAAe,KACd,OA2DF,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,YAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,GAAG,SAAS,EAClE,UAAS;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,EAC1C,cAAS,KACR,kBAAkB,EA8DpB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,GACxC,YAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,GAAG,SAAS,EAClE,UAAS;IAAE,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,KACpE,kBAAkB,EA+CpB,CAAA"}
1
+ {"version":3,"file":"get-type-signature-tokens.d.ts","sourceRoot":"","sources":["../../../src/schema/helpers/get-type-signature-tokens.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAI/G;;;;;GAKG;AACH,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,CAAA;IAClD,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AA+BD;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,YAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,GAAG,SAAS,EAClE,UAAS;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO;AAC1C,mFAAmF;AACnF,iBAAe,KACd,OA2DF,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,YAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,GAAG,SAAS,EAClE,UAAS;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,EAC1C,cAAS,KACR,kBAAkB,EA8DpB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,GACxC,YAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,GAAG,SAAS,EAClE,UAAS;IAAE,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,KACpE,kBAAkB,EA2DpB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { getRefName as e } from "./get-ref-name.js";
2
2
  import { getResolvedRef as t } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
3
  import { resolve as n } from "@scalar/workspace-store/resolve";
4
- //#region src/schema/helpers/get-type-signature-tokens.ts
4
+ // src/schema/helpers/get-type-signature-tokens.ts
5
5
  var r = 3, i = [
6
6
  "x-enumDescriptions",
7
7
  "x-enum-descriptions",
@@ -44,8 +44,8 @@ var r = 3, i = [
44
44
  if (t.hideModelNames || !r) return n;
45
45
  let i = (e) => !!e && typeof e == "object" && "$ref" in e;
46
46
  if (n.length === 0 || n.length === 1 && n[0]?.text === "object" || i(e) && n.length === 1 && n[0]?.kind === "ident" && n[0]?.text !== r) return [s(r)];
47
- let a = e && typeof e == "object" && "items" in e ? e.items : void 0, o = n[0], c = n[1];
48
- if (i(a) && n.length === 2 && o?.kind === "word" && c?.kind === "ident" && r.endsWith("[]")) {
47
+ let a = e && typeof e == "object" && "items" in e ? e.items : void 0, o = n[0], c = n[1], l = a && typeof a == "object" && "type" in a && a.type === "object" && "title" in a && typeof a.title == "string";
48
+ if ((i(a) || l) && n.length === 2 && o?.kind === "word" && c?.kind === "ident" && r.endsWith("[]")) {
49
49
  let e = r.slice(0, -2);
50
50
  if (e && e !== c.text) return [o, s(e)];
51
51
  }
@@ -56,7 +56,6 @@ var r = 3, i = [
56
56
  let i = f(r, t, n + 1);
57
57
  return i.length === 0 ? [s("array")] : [o("array of"), ...i];
58
58
  };
59
- //#endregion
60
59
  export { p as getDisplayTypeSignatureTokens, f as getTypeSignatureTokens, d as typeSignatureInlinesEnum };
61
60
 
62
61
  //# sourceMappingURL=get-type-signature-tokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-type-signature-tokens.js","names":["INLINE_ENUM_LIMIT","ENUM_ANNOTATION_KEYS","formatLiteral","value","word","ident","literal","pipe","joinTokens","lists","index","tokens","separator","typeSignatureInlinesEnum","valueOrRef","options","getRefName","resolve","getResolvedRef","key","isItems","type","isArrayType","items","getTypeSignatureTokens","refName","entry","arrayTokens","depth","getDisplayTypeSignatureTokens","computedTokens","modelName","isRef","arrayWord","itemToken","itemName","MAX_ARRAY_DEPTH","itemTokens"],"sources":["../../../src/schema/helpers/get-type-signature-tokens.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport { getRefName } from './get-ref-name'\n\n/**\n * One run of a type signature. `word` is English describing a shape (`array of`,\n * `or`) in the sans face; `ident` is something the reader would type (a model\n * name, a type keyword) in the code face; `literal` is an enum or const value\n * quoted as JSON; `punctuation` is the muted `|` between union members.\n */\ntype TypeSignatureToken = {\n kind: 'word' | 'ident' | 'literal' | 'punctuation'\n text: string\n}\n\n/** Enums up to this many values render inline in the type position. */\nconst INLINE_ENUM_LIMIT = 3\n\n/** Extensions that attach meaning to individual enum values. */\nconst ENUM_ANNOTATION_KEYS = ['x-enumDescriptions', 'x-enum-descriptions', 'x-enum-varnames', 'x-enumNames'] as const\n\n/** Quote an enum or const value the way JSON would. */\nconst formatLiteral = (value: unknown): string => {\n // Objects and arrays have no meaningful String() form (`[object Object]`), so\n // serialize them the way JSON would; primitives keep their existing rendering.\n if (value !== null && typeof value === 'object') {\n return JSON.stringify(value)\n }\n\n return typeof value === 'string' ? `\"${value}\"` : String(value)\n}\n\nconst word = (text: string): TypeSignatureToken => ({ kind: 'word', text })\nconst ident = (text: string): TypeSignatureToken => ({ kind: 'ident', text })\nconst literal = (text: string): TypeSignatureToken => ({\n kind: 'literal',\n text,\n})\nconst pipe = (): TypeSignatureToken => ({ kind: 'punctuation', text: '|' })\n\n/** Join token lists with a separator token, like Array.prototype.join. */\nconst joinTokens = (lists: TypeSignatureToken[][], separator: () => TypeSignatureToken[]): TypeSignatureToken[] =>\n lists.flatMap((tokens, index) => (index === 0 ? tokens : [...separator(), ...tokens]))\n\n/**\n * Whether the signature will actually render this schema's enum values inline.\n * SchemaProperty drops the separate value list for short enums on that\n * assumption, so it must be checked: a `$ref` renders as the model name before\n * reaching the enum branch, and a schema with no `type` renders no type detail,\n * so in both cases the values would otherwise be shown nowhere.\n */\nexport const typeSignatureInlinesEnum = (\n valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined,\n options: { hideModelNames?: boolean } = {},\n /** Set when recursing into an array's items, which need no `type` of their own. */\n isItems = false,\n): boolean => {\n if (!valueOrRef || typeof valueOrRef !== 'object') {\n return false\n }\n\n // A named $ref returns the model name before ever reaching the enum branch.\n if (\n '$ref' in valueOrRef &&\n typeof valueOrRef.$ref === 'string' &&\n !options.hideModelNames &&\n getRefName(valueOrRef.$ref)\n ) {\n return false\n }\n\n // Display normalization can retain $ref alongside its resolved fields without\n // $ref-value. The structural view keeps those fields when names are hidden.\n const value = options.hideModelNames ? resolve.schema(valueOrRef) : getResolvedRef(valueOrRef)\n\n if (!value || typeof value !== 'object' || value.const !== undefined) {\n return false\n }\n\n // Bare literals cannot carry `x-enumDescriptions` or `x-enum-varnames`, so an\n // annotated enum keeps its value list (SchemaEnums' chip branch does the same).\n const annotated = ENUM_ANNOTATION_KEYS.some((key) => value[key])\n\n // getTypeSignatureTokens checks the schema's own enum right after const —\n // before any `type` handling — so a short, unannotated enum inlines whether or\n // not the schema has a `type`, and even when the type is `array` (e.g. a\n // schema carrying both `enum` and `type: array`). Mirror that order here, or\n // the value list renders a second copy of the same values.\n if (!annotated && Array.isArray(value.enum) && value.enum.length > 0 && value.enum.length <= INLINE_ENUM_LIMIT) {\n return true\n }\n\n // Past the enum branch, a schema with no `type` renders no signature to carry\n // the values. Items are exempt: the array signature's enum branch needs no\n // `type` of its own.\n if (!isItems && !('type' in value)) {\n return false\n }\n\n const type = 'type' in value ? value.type : undefined\n\n // `type: ['array', 'null']` takes the union branch, which still recurses into\n // items, so it inlines the item enum exactly like a plain array.\n const isArrayType = type === 'array' || (Array.isArray(type) && type.includes('array'))\n\n // An array with no own enum inlines its ITEMS' enum, resolved the same way\n // getEnumValues does, so the items must be tested here or the values render\n // twice.\n const items = 'items' in value ? value.items : undefined\n\n if (isArrayType && items && typeof items === 'object') {\n return typeSignatureInlinesEnum(items as SchemaObject, options, true)\n }\n\n return false\n}\n\n/**\n * Compute the type signature of a schema as token runs: `array Planet[]` becomes\n * `array of Planet`, where \"array of\" is English and `Planet` stays an\n * identifier. Short enums render inline (`\"standard\" or \"enterprise\"`) because\n * two values are a type, not a list worth its own rows. A `$ref` to a named\n * model renders as the model name itself.\n */\nexport const getTypeSignatureTokens = (\n valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined,\n options: { hideModelNames?: boolean } = {},\n depth = 0,\n): TypeSignatureToken[] => {\n if (!valueOrRef || typeof valueOrRef !== 'object') {\n return []\n }\n\n // A $ref to a named model: the name is the type.\n if ('$ref' in valueOrRef && typeof valueOrRef.$ref === 'string') {\n const refName = options.hideModelNames ? null : getRefName(valueOrRef.$ref)\n\n if (refName) {\n return [ident(refName)]\n }\n }\n\n // Display normalization can retain $ref alongside its resolved fields without\n // $ref-value. The structural view keeps those fields when names are hidden.\n const value = options.hideModelNames ? resolve.schema(valueOrRef) : getResolvedRef(valueOrRef)\n\n if (!value || typeof value !== 'object') {\n return []\n }\n\n // const renders as its value, not as the word \"const\".\n if (value.const !== undefined) {\n return [literal(formatLiteral(value.const))]\n }\n\n // A short enum is the type, inline, unless its values carry descriptions or\n // names, which only the value list can show.\n if (\n Array.isArray(value.enum) &&\n value.enum.length > 0 &&\n value.enum.length <= INLINE_ENUM_LIMIT &&\n !ENUM_ANNOTATION_KEYS.some((key) => value[key])\n ) {\n return joinTokens(\n value.enum.map((entry) => [literal(formatLiteral(entry))]),\n () => [word('or')],\n )\n }\n\n // Union types: string | null with the pipe muted.\n if ('type' in value && Array.isArray(value.type)) {\n return joinTokens(\n value.type.map((entry) => (entry === 'array' ? arrayTokens(value, options, depth) : [ident(String(entry))])),\n () => [pipe()],\n )\n }\n\n if ('type' in value && value.type === 'array') {\n return arrayTokens(value, options, depth)\n }\n\n if ('type' in value && value.type && value.contentEncoding) {\n return [ident(String(value.type)), word('•'), ident(value.contentEncoding)]\n }\n\n if ('type' in value && value.type) {\n return [ident(String(value.type))]\n }\n\n return []\n}\n\n/**\n * The tokens a row shows: the raw signature, renamed to the caller's resolved\n * model name where the two would disagree.\n *\n * A `$ref` renders as the raw component key while the heading link and the\n * models section show the target's `title`; the caller's name keeps them in\n * agreement. Only a `$ref` may be renamed: an inline schema's\n * single token is its real type (`integer`), not its `title`.\n */\nexport const getDisplayTypeSignatureTokens = (\n valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined,\n options: { hideModelNames?: boolean; modelName?: string | null } = {},\n): TypeSignatureToken[] => {\n const computedTokens = getTypeSignatureTokens(valueOrRef, { hideModelNames: options.hideModelNames })\n const modelName = options.modelName\n\n if (options.hideModelNames || !modelName) {\n return computedTokens\n }\n\n const isRef = (value: unknown): boolean => !!value && typeof value === 'object' && '$ref' in value\n\n // Nothing to render, or a bare `object` that the name describes better.\n if (computedTokens.length === 0 || (computedTokens.length === 1 && computedTokens[0]?.text === 'object')) {\n return [ident(modelName)]\n }\n\n // A direct `$ref`: the single identifier IS the raw key.\n if (\n isRef(valueOrRef) &&\n computedTokens.length === 1 &&\n computedTokens[0]?.kind === 'ident' &&\n computedTokens[0]?.text !== modelName\n ) {\n return [ident(modelName)]\n }\n\n /*\n * An array of a `$ref` keeps its \"array of\" word and renames only the item.\n * Only a caller name with a trailing `[]` describes the ITEM; the caller also\n * reports the array's OWN name here (a `$ref` to `FilterList`, an inline\n * `title` of `Planets`), and using that would claim each element is one.\n */\n const items = valueOrRef && typeof valueOrRef === 'object' && 'items' in valueOrRef ? valueOrRef.items : undefined\n\n const arrayWord = computedTokens[0]\n const itemToken = computedTokens[1]\n\n if (isRef(items) && computedTokens.length === 2 && arrayWord?.kind === 'word' && itemToken?.kind === 'ident') {\n if (modelName.endsWith('[]')) {\n const itemName = modelName.slice(0, -2)\n\n if (itemName && itemName !== itemToken.text) {\n return [arrayWord, ident(itemName)]\n }\n }\n }\n\n return computedTokens\n}\n\n/** Guard against a pathological items chain; deeper than this reads as noise anyway. */\nconst MAX_ARRAY_DEPTH = 8\n\nconst arrayTokens = (\n value: SchemaObject,\n options: { hideModelNames?: boolean },\n depth: number,\n): TypeSignatureToken[] => {\n const items = 'items' in value ? value.items : undefined\n\n if (!items || depth >= MAX_ARRAY_DEPTH) {\n return [ident('array')]\n }\n\n const itemTokens = getTypeSignatureTokens(items as SchemaObject | ReferenceType<SchemaObject>, options, depth + 1)\n\n if (itemTokens.length === 0) {\n return [ident('array')]\n }\n\n return [word('array of'), ...itemTokens]\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"get-type-signature-tokens.js","names":["INLINE_ENUM_LIMIT","ENUM_ANNOTATION_KEYS","formatLiteral","value","word","ident","literal","pipe","joinTokens","lists","index","tokens","separator","typeSignatureInlinesEnum","valueOrRef","options","getRefName","resolve","getResolvedRef","key","isItems","type","isArrayType","items","getTypeSignatureTokens","refName","entry","arrayTokens","depth","getDisplayTypeSignatureTokens","computedTokens","modelName","isRef","arrayWord","itemToken","namedObjectItems","itemName","MAX_ARRAY_DEPTH","itemTokens"],"sources":["../../../src/schema/helpers/get-type-signature-tokens.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\n\nimport { getRefName } from './get-ref-name'\n\n/**\n * One run of a type signature. `word` is English describing a shape (`array of`,\n * `or`) in the sans face; `ident` is something the reader would type (a model\n * name, a type keyword) in the code face; `literal` is an enum or const value\n * quoted as JSON; `punctuation` is the muted `|` between union members.\n */\ntype TypeSignatureToken = {\n kind: 'word' | 'ident' | 'literal' | 'punctuation'\n text: string\n}\n\n/** Enums up to this many values render inline in the type position. */\nconst INLINE_ENUM_LIMIT = 3\n\n/** Extensions that attach meaning to individual enum values. */\nconst ENUM_ANNOTATION_KEYS = ['x-enumDescriptions', 'x-enum-descriptions', 'x-enum-varnames', 'x-enumNames'] as const\n\n/** Quote an enum or const value the way JSON would. */\nconst formatLiteral = (value: unknown): string => {\n // Objects and arrays have no meaningful String() form (`[object Object]`), so\n // serialize them the way JSON would; primitives keep their existing rendering.\n if (value !== null && typeof value === 'object') {\n return JSON.stringify(value)\n }\n\n return typeof value === 'string' ? `\"${value}\"` : String(value)\n}\n\nconst word = (text: string): TypeSignatureToken => ({ kind: 'word', text })\nconst ident = (text: string): TypeSignatureToken => ({ kind: 'ident', text })\nconst literal = (text: string): TypeSignatureToken => ({\n kind: 'literal',\n text,\n})\nconst pipe = (): TypeSignatureToken => ({ kind: 'punctuation', text: '|' })\n\n/** Join token lists with a separator token, like Array.prototype.join. */\nconst joinTokens = (lists: TypeSignatureToken[][], separator: () => TypeSignatureToken[]): TypeSignatureToken[] =>\n lists.flatMap((tokens, index) => (index === 0 ? tokens : [...separator(), ...tokens]))\n\n/**\n * Whether the signature will actually render this schema's enum values inline.\n * SchemaProperty drops the separate value list for short enums on that\n * assumption, so it must be checked: a `$ref` renders as the model name before\n * reaching the enum branch, and a schema with no `type` renders no type detail,\n * so in both cases the values would otherwise be shown nowhere.\n */\nexport const typeSignatureInlinesEnum = (\n valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined,\n options: { hideModelNames?: boolean } = {},\n /** Set when recursing into an array's items, which need no `type` of their own. */\n isItems = false,\n): boolean => {\n if (!valueOrRef || typeof valueOrRef !== 'object') {\n return false\n }\n\n // A named $ref returns the model name before ever reaching the enum branch.\n if (\n '$ref' in valueOrRef &&\n typeof valueOrRef.$ref === 'string' &&\n !options.hideModelNames &&\n getRefName(valueOrRef.$ref)\n ) {\n return false\n }\n\n // Display normalization can retain $ref alongside its resolved fields without\n // $ref-value. The structural view keeps those fields when names are hidden.\n const value = options.hideModelNames ? resolve.schema(valueOrRef) : getResolvedRef(valueOrRef)\n\n if (!value || typeof value !== 'object' || value.const !== undefined) {\n return false\n }\n\n // Bare literals cannot carry `x-enumDescriptions` or `x-enum-varnames`, so an\n // annotated enum keeps its value list (SchemaEnums' chip branch does the same).\n const annotated = ENUM_ANNOTATION_KEYS.some((key) => value[key])\n\n // getTypeSignatureTokens checks the schema's own enum right after const —\n // before any `type` handling — so a short, unannotated enum inlines whether or\n // not the schema has a `type`, and even when the type is `array` (e.g. a\n // schema carrying both `enum` and `type: array`). Mirror that order here, or\n // the value list renders a second copy of the same values.\n if (!annotated && Array.isArray(value.enum) && value.enum.length > 0 && value.enum.length <= INLINE_ENUM_LIMIT) {\n return true\n }\n\n // Past the enum branch, a schema with no `type` renders no signature to carry\n // the values. Items are exempt: the array signature's enum branch needs no\n // `type` of its own.\n if (!isItems && !('type' in value)) {\n return false\n }\n\n const type = 'type' in value ? value.type : undefined\n\n // `type: ['array', 'null']` takes the union branch, which still recurses into\n // items, so it inlines the item enum exactly like a plain array.\n const isArrayType = type === 'array' || (Array.isArray(type) && type.includes('array'))\n\n // An array with no own enum inlines its ITEMS' enum, resolved the same way\n // getEnumValues does, so the items must be tested here or the values render\n // twice.\n const items = 'items' in value ? value.items : undefined\n\n if (isArrayType && items && typeof items === 'object') {\n return typeSignatureInlinesEnum(items as SchemaObject, options, true)\n }\n\n return false\n}\n\n/**\n * Compute the type signature of a schema as token runs: `array Planet[]` becomes\n * `array of Planet`, where \"array of\" is English and `Planet` stays an\n * identifier. Short enums render inline (`\"standard\" or \"enterprise\"`) because\n * two values are a type, not a list worth its own rows. A `$ref` to a named\n * model renders as the model name itself.\n */\nexport const getTypeSignatureTokens = (\n valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined,\n options: { hideModelNames?: boolean } = {},\n depth = 0,\n): TypeSignatureToken[] => {\n if (!valueOrRef || typeof valueOrRef !== 'object') {\n return []\n }\n\n // A $ref to a named model: the name is the type.\n if ('$ref' in valueOrRef && typeof valueOrRef.$ref === 'string') {\n const refName = options.hideModelNames ? null : getRefName(valueOrRef.$ref)\n\n if (refName) {\n return [ident(refName)]\n }\n }\n\n // Display normalization can retain $ref alongside its resolved fields without\n // $ref-value. The structural view keeps those fields when names are hidden.\n const value = options.hideModelNames ? resolve.schema(valueOrRef) : getResolvedRef(valueOrRef)\n\n if (!value || typeof value !== 'object') {\n return []\n }\n\n // const renders as its value, not as the word \"const\".\n if (value.const !== undefined) {\n return [literal(formatLiteral(value.const))]\n }\n\n // A short enum is the type, inline, unless its values carry descriptions or\n // names, which only the value list can show.\n if (\n Array.isArray(value.enum) &&\n value.enum.length > 0 &&\n value.enum.length <= INLINE_ENUM_LIMIT &&\n !ENUM_ANNOTATION_KEYS.some((key) => value[key])\n ) {\n return joinTokens(\n value.enum.map((entry) => [literal(formatLiteral(entry))]),\n () => [word('or')],\n )\n }\n\n // Union types: string | null with the pipe muted.\n if ('type' in value && Array.isArray(value.type)) {\n return joinTokens(\n value.type.map((entry) => (entry === 'array' ? arrayTokens(value, options, depth) : [ident(String(entry))])),\n () => [pipe()],\n )\n }\n\n if ('type' in value && value.type === 'array') {\n return arrayTokens(value, options, depth)\n }\n\n if ('type' in value && value.type && value.contentEncoding) {\n return [ident(String(value.type)), word('•'), ident(value.contentEncoding)]\n }\n\n if ('type' in value && value.type) {\n return [ident(String(value.type))]\n }\n\n return []\n}\n\n/**\n * The tokens a row shows: the raw signature, renamed to the caller's resolved\n * model name where the two would disagree.\n *\n * A `$ref` renders as the raw component key while the heading link and the\n * models section show the target's `title`; the caller's name keeps them in\n * agreement. Inline object titles can name array items too; inline primitive\n * tokens keep their real type (`integer`), rather than their `title`.\n */\nexport const getDisplayTypeSignatureTokens = (\n valueOrRef: SchemaObject | ReferenceType<SchemaObject> | undefined,\n options: { hideModelNames?: boolean; modelName?: string | null } = {},\n): TypeSignatureToken[] => {\n const computedTokens = getTypeSignatureTokens(valueOrRef, { hideModelNames: options.hideModelNames })\n const modelName = options.modelName\n\n if (options.hideModelNames || !modelName) {\n return computedTokens\n }\n\n const isRef = (value: unknown): boolean => !!value && typeof value === 'object' && '$ref' in value\n\n // Nothing to render, or a bare `object` that the name describes better.\n if (computedTokens.length === 0 || (computedTokens.length === 1 && computedTokens[0]?.text === 'object')) {\n return [ident(modelName)]\n }\n\n // A direct `$ref`: the single identifier IS the raw key.\n if (\n isRef(valueOrRef) &&\n computedTokens.length === 1 &&\n computedTokens[0]?.kind === 'ident' &&\n computedTokens[0]?.text !== modelName\n ) {\n return [ident(modelName)]\n }\n\n /*\n * An array of a named object keeps its \"array of\" word and renames only the item.\n * Only a caller name with a trailing `[]` describes the ITEM; the caller also\n * reports the array's OWN name here (a `$ref` to `FilterList`, an inline\n * `title` of `Planets`), and using that would claim each element is one.\n */\n const items = valueOrRef && typeof valueOrRef === 'object' && 'items' in valueOrRef ? valueOrRef.items : undefined\n\n const arrayWord = computedTokens[0]\n const itemToken = computedTokens[1]\n\n const namedObjectItems =\n items &&\n typeof items === 'object' &&\n 'type' in items &&\n items.type === 'object' &&\n 'title' in items &&\n typeof items.title === 'string'\n if (\n (isRef(items) || namedObjectItems) &&\n computedTokens.length === 2 &&\n arrayWord?.kind === 'word' &&\n itemToken?.kind === 'ident'\n ) {\n if (modelName.endsWith('[]')) {\n const itemName = modelName.slice(0, -2)\n\n if (itemName && itemName !== itemToken.text) {\n return [arrayWord, ident(itemName)]\n }\n }\n }\n\n return computedTokens\n}\n\n/** Guard against a pathological items chain; deeper than this reads as noise anyway. */\nconst MAX_ARRAY_DEPTH = 8\n\nconst arrayTokens = (\n value: SchemaObject,\n options: { hideModelNames?: boolean },\n depth: number,\n): TypeSignatureToken[] => {\n const items = 'items' in value ? value.items : undefined\n\n if (!items || depth >= MAX_ARRAY_DEPTH) {\n return [ident('array')]\n }\n\n const itemTokens = getTypeSignatureTokens(items as SchemaObject | ReferenceType<SchemaObject>, options, depth + 1)\n\n if (itemTokens.length === 0) {\n return [ident('array')]\n }\n\n return [word('array of'), ...itemTokens]\n}\n"],"mappings":"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"}
@@ -1,6 +1,6 @@
1
1
  import { getResolvedRef as e } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
2
  import { isArraySchema as t } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
3
- //#region src/schema/helpers/has-complex-array-items.ts
3
+ // src/schema/helpers/has-complex-array-items.ts
4
4
  var n = [
5
5
  "allOf",
6
6
  "oneOf",
@@ -20,7 +20,6 @@ var n = [
20
20
  let o = e(n.items);
21
21
  return o ? i(o) || r(o) ? !0 : a(o) : !1;
22
22
  };
23
- //#endregion
24
23
  export { o as hasComplexArrayItems };
25
24
 
26
25
  //# sourceMappingURL=has-complex-array-items.js.map
@@ -1,13 +1,13 @@
1
- import { getRenderedExample as e, normalizeRenderedExamples as t } from "./get-rendered-example.js";
2
- import { getRefName as n } from "./get-ref-name.js";
3
- import { hasComplexArrayItems as r } from "./has-complex-array-items.js";
4
- import { inferDiscriminatorMappingComposition as i } from "./get-compositions-to-render.js";
5
- import { isTypeObject as a } from "./is-type-object.js";
6
- import { handleTreeKeydown as o } from "./schema-keyboard-nav.js";
7
- import { getSchemaType as s } from "./get-schema-type.js";
8
- import { getModelNameFromSchema as c, getModelNameWithArray as l } from "./schema-name.js";
9
- import { reduceNamesToObject as u, sortPropertyNames as d } from "./sort-property-names.js";
10
- import { getTypeSignatureTokens as f } from "./get-type-signature-tokens.js";
11
- import { optimizeValueForDisplay as p } from "./optimize-value-for-display.js";
12
- import { isModelLinkable as m } from "./is-model-linkable.js";
13
- export { c as getModelNameFromSchema, l as getModelNameWithArray, n as getRefName, e as getRenderedExample, s as getSchemaType, f as getTypeSignatureTokens, o as handleTreeKeydown, r as hasComplexArrayItems, i as inferDiscriminatorMappingComposition, m as isModelLinkable, a as isTypeObject, t as normalizeRenderedExamples, p as optimizeValueForDisplay, u as reduceNamesToObject, d as sortPropertyNames };
1
+ import { inferDiscriminatorMappingComposition as e } from "./get-compositions-to-render.js";
2
+ import { getRefName as t } from "./get-ref-name.js";
3
+ import { getRenderedExample as n, normalizeRenderedExamples as r } from "./get-rendered-example.js";
4
+ import { getSchemaType as i } from "./get-schema-type.js";
5
+ import { getTypeSignatureTokens as a } from "./get-type-signature-tokens.js";
6
+ import { hasComplexArrayItems as o } from "./has-complex-array-items.js";
7
+ import { isModelLinkable as s } from "./is-model-linkable.js";
8
+ import { isTypeObject as c } from "./is-type-object.js";
9
+ import { optimizeValueForDisplay as l } from "./optimize-value-for-display.js";
10
+ import { handleTreeKeydown as u } from "./schema-keyboard-nav.js";
11
+ import { getModelNameFromSchema as d, getModelNameWithArray as f } from "./schema-name.js";
12
+ import { reduceNamesToObject as p, sortPropertyNames as m } from "./sort-property-names.js";
13
+ export { d as getModelNameFromSchema, f as getModelNameWithArray, t as getRefName, n as getRenderedExample, i as getSchemaType, a as getTypeSignatureTokens, u as handleTreeKeydown, o as hasComplexArrayItems, e as inferDiscriminatorMappingComposition, s as isModelLinkable, c as isTypeObject, r as normalizeRenderedExamples, l as optimizeValueForDisplay, p as reduceNamesToObject, m as sortPropertyNames };
@@ -1,11 +1,10 @@
1
1
  import { isTypeObject as e } from "./is-type-object.js";
2
- //#region src/schema/helpers/is-empty-schema-object.ts
2
+ // src/schema/helpers/is-empty-schema-object.ts
3
3
  var t = (t) => {
4
4
  if (!e(t)) return !1;
5
5
  let n = Object.keys(t.properties ?? {}).length === 0, r = t.additionalProperties === void 0 || t.additionalProperties === !1, i = Object.keys(t.patternProperties ?? {}).length === 0;
6
6
  return n && r && i;
7
7
  };
8
- //#endregion
9
8
  export { t as isEmptySchemaObject };
10
9
 
11
10
  //# sourceMappingURL=is-empty-schema-object.js.map
@@ -1,13 +1,12 @@
1
1
  import { unwrapForRead as e } from "./unwrap-for-read.js";
2
2
  import { getResolvedRef as t, mergeSiblingReferences as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
3
  import { isHidden as r } from "@scalar/workspace-store/helpers/is-hidden";
4
- //#region src/schema/helpers/is-model-linkable.ts
4
+ // src/schema/helpers/is-model-linkable.ts
5
5
  var i = (i, { hideModels: a, document: o }) => {
6
6
  if (!i || a) return !1;
7
7
  let s = e(o)?.components?.schemas?.[i];
8
8
  return !r(t(s, n));
9
9
  };
10
- //#endregion
11
10
  export { i as isModelLinkable };
12
11
 
13
12
  //# sourceMappingURL=is-model-linkable.js.map
@@ -1,6 +1,5 @@
1
- //#region src/schema/helpers/is-on-schema-target-path.ts
1
+ // src/schema/helpers/is-on-schema-target-path.ts
2
2
  var e = (e, t) => !!(e && t && (t === e || t.startsWith(`${e}.`)));
3
- //#endregion
4
3
  export { e as isOnSchemaTargetPath };
5
4
 
6
5
  //# sourceMappingURL=is-on-schema-target-path.js.map
@@ -1,4 +1,4 @@
1
- //#region src/schema/helpers/is-type-object.ts
1
+ // src/schema/helpers/is-type-object.ts
2
2
  var e = (e) => {
3
3
  if (typeof e != "object" || !e || Array.isArray(e) || "oneOf" in e || "anyOf" in e || "allOf" in e || "not" in e) return !1;
4
4
  let t = "type" in e;
@@ -9,7 +9,6 @@ var e = (e) => {
9
9
  let r = "properties" in e, i = "additionalProperties" in e, a = "patternProperties" in e;
10
10
  return r || i || a;
11
11
  };
12
- //#endregion
13
12
  export { e as isTypeObject };
14
13
 
15
14
  //# sourceMappingURL=is-type-object.js.map
@@ -3,7 +3,7 @@ import { resolve as t } from "@scalar/workspace-store/resolve";
3
3
  import { isArraySchema as n } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
4
4
  import { isObjectEqual as r } from "@scalar/helpers/object/is-object-equal";
5
5
  import { objectKeys as i } from "@scalar/helpers/object/object-keys";
6
- //#region src/schema/helpers/merge-all-of-schemas.ts
6
+ // src/schema/helpers/merge-all-of-schemas.ts
7
7
  var a = /* @__PURE__ */ new Set(["description", "title"]), o = [
8
8
  "x-enum-varnames",
9
9
  "x-enumNames",
@@ -144,7 +144,6 @@ var a = /* @__PURE__ */ new Set(["description", "title"]), o = [
144
144
  ...n
145
145
  };
146
146
  };
147
- //#endregion
148
147
  export { c as mergeAllOfSchemas };
149
148
 
150
149
  //# sourceMappingURL=merge-all-of-schemas.js.map
@@ -1,6 +1,6 @@
1
1
  import { isTypeObject as e } from "./is-type-object.js";
2
2
  import { partitionAllOfCompositions as t } from "./partition-all-of-compositions.js";
3
- //#region src/schema/helpers/normalize-object-composition.ts
3
+ // src/schema/helpers/normalize-object-composition.ts
4
4
  var n = (n, r) => {
5
5
  if (!r || !n?.allOf || n.oneOf || n.anyOf || n.not) return n;
6
6
  let { segments: i } = t(n), a = i[0];
@@ -23,7 +23,6 @@ var n = (n, r) => {
23
23
  ..."$ref" in n && typeof n.$ref == "string" ? { $ref: n.$ref } : {}
24
24
  };
25
25
  };
26
- //#endregion
27
26
  export { n as normalizeObjectComposition };
28
27
 
29
28
  //# sourceMappingURL=normalize-object-composition.js.map