@scalar/api-reference 1.57.4 → 1.58.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 (196) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/browser/chunks/AgentScalarChatInterface-DIIVMX31.js +27 -0
  3. package/dist/browser/chunks/ScalarTextInput.vue-DDsQgpOo.js +27 -0
  4. package/dist/browser/chunks/basic-shape-diamond.svg-BTEOT1FL.js +15 -0
  5. package/dist/browser/chunks/basic-shape-hexagon.svg-BSPzaCgF.js +15 -0
  6. package/dist/browser/chunks/basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js +15 -0
  7. package/dist/browser/chunks/basic-shape-primary-square-rectangle.svg-n2YRykHD.js +15 -0
  8. package/dist/browser/chunks/basic-shape-shield.svg-Bec9cJDA.js +15 -0
  9. package/dist/browser/chunks/browser-67K6wmG9.js +129 -0
  10. package/dist/browser/chunks/computer-device-desktop-monitor.svg-m6j893Hb.js +15 -0
  11. package/dist/browser/chunks/computer-device-desktop.svg-Dk1VVO7k.js +15 -0
  12. package/dist/browser/chunks/computer-device-laptop.svg-BNGVUCYS.js +15 -0
  13. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung-back.svg-CC4UUTFw.js +15 -0
  14. package/dist/browser/chunks/computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js +15 -0
  15. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x-back.svg-CLm7sgMM.js +15 -0
  16. package/dist/browser/chunks/computer-device-mobile-phone-iphone-x.svg-Xrttg6_7.js +15 -0
  17. package/dist/browser/chunks/computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js +15 -0
  18. package/dist/browser/chunks/computer-device-mobile-tablet.svg-DCr0XlRc.js +15 -0
  19. package/dist/browser/chunks/computer-device-network-ethernet-cat6.svg-AK9l0iOl.js +15 -0
  20. package/dist/browser/chunks/computer-device-network-lan-www.svg-gUIdFBlE.js +15 -0
  21. package/dist/browser/chunks/computer-device-network-wifi-connection.svg-Be-EMm4e.js +15 -0
  22. package/dist/browser/chunks/computer-device-network-wifi-router.svg-Dc2VzyqK.js +15 -0
  23. package/dist/browser/chunks/ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js +15 -0
  24. package/dist/browser/chunks/image-flash-lightning.svg-EETR_y1q.js +15 -0
  25. package/dist/browser/chunks/image-picture-flower.svg-DN1AYzJU.js +15 -0
  26. package/dist/browser/chunks/interface-alert-exclamation-diamond.svg-C5NozMV_.js +15 -0
  27. package/dist/browser/chunks/interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js +15 -0
  28. package/dist/browser/chunks/interface-alert-information-circle.svg-ckkkt9Mv.js +15 -0
  29. package/dist/browser/chunks/interface-award-crown.svg-pjvn9hY-.js +15 -0
  30. package/dist/browser/chunks/interface-bookmark-tag.svg-r2r-lQq4.js +15 -0
  31. package/dist/browser/chunks/interface-bookmark.svg-BK9HKQBT.js +15 -0
  32. package/dist/browser/chunks/interface-calendar-date-one.svg-DNnF0M1I.js +15 -0
  33. package/dist/browser/chunks/interface-content-book-open-pages.svg-CQj_w9Vp.js +15 -0
  34. package/dist/browser/chunks/interface-content-book-page.svg-DppoeJRe.js +15 -0
  35. package/dist/browser/chunks/interface-content-file.svg-CvcD7OiY.js +15 -0
  36. package/dist/browser/chunks/interface-content-folder.svg-BmtS5I9A.js +15 -0
  37. package/dist/browser/chunks/interface-copy-clipboard.svg-Be6EI50X.js +15 -0
  38. package/dist/browser/chunks/interface-edit-attachment.svg-G5TKzpWX.js +15 -0
  39. package/dist/browser/chunks/interface-edit-binocular.svg-jzL-DvGB.js +15 -0
  40. package/dist/browser/chunks/interface-edit-magic-wand.svg-BOTlymvp.js +15 -0
  41. package/dist/browser/chunks/interface-edit-tool-paint-roller.svg-s9dwryx7.js +15 -0
  42. package/dist/browser/chunks/interface-edit-tool-pencil.svg-C7v0dbB3.js +15 -0
  43. package/dist/browser/chunks/interface-favorite-award.svg-CYHUgUG0.js +15 -0
  44. package/dist/browser/chunks/interface-favorite-flag.svg-C10zlKOb.js +15 -0
  45. package/dist/browser/chunks/interface-favorite-heart.svg-eoduXxlz.js +15 -0
  46. package/dist/browser/chunks/interface-favorite-star.svg-BSmxJetr.js +15 -0
  47. package/dist/browser/chunks/interface-favorite-stars-sparkles.svg-JTFLj3Ls.js +15 -0
  48. package/dist/browser/chunks/interface-hierarchy-flowchart.svg-Cg_Wy0kN.js +15 -0
  49. package/dist/browser/chunks/interface-home-house.svg-DytoGRnv.js +15 -0
  50. package/dist/browser/chunks/interface-hyperlink.svg-CuEfmmQI.js +15 -0
  51. package/dist/browser/chunks/interface-lighting-brightness.svg-DSK0h_Pa.js +15 -0
  52. package/dist/browser/chunks/interface-lock-closed.svg-Cn6TaLYv.js +15 -0
  53. package/dist/browser/chunks/interface-lock-open-unlock.svg-CVkG5-9W.js +15 -0
  54. package/dist/browser/chunks/interface-login-key.svg-y-cwwXjN.js +15 -0
  55. package/dist/browser/chunks/interface-search.svg-S-puVFJB.js +15 -0
  56. package/dist/browser/chunks/interface-setting-cog.svg-CTH4_lLg.js +15 -0
  57. package/dist/browser/chunks/interface-share-megaphone-bullhorn.svg-Pbp39MyC.js +15 -0
  58. package/dist/browser/chunks/interface-share-rocket.svg-BgCsIRZO.js +15 -0
  59. package/dist/browser/chunks/interface-share-satellite.svg-DAMN9d5G.js +15 -0
  60. package/dist/browser/chunks/interface-share-space-ship.svg-Dt-Mejxk.js +15 -0
  61. package/dist/browser/chunks/interface-share.svg-vFYTXSti.js +15 -0
  62. package/dist/browser/chunks/interface-signal-square.svg-DNG4LpAe.js +15 -0
  63. package/dist/browser/chunks/interface-time-clock-circle.svg-Bpz-nLxo.js +15 -0
  64. package/dist/browser/chunks/interface-time-hour-glass.svg-D7agfKsH.js +15 -0
  65. package/dist/browser/chunks/interface-users-multiple.svg-CkPJBBnG.js +15 -0
  66. package/dist/browser/chunks/interface-weather-moon.svg-CaTZFMPO.js +15 -0
  67. package/dist/browser/chunks/mail-chat-bubble-square.svg-DC8RIihp.js +15 -0
  68. package/dist/browser/chunks/mail-send-email-paper-airplane.svg-D8OLs9jz.js +15 -0
  69. package/dist/browser/chunks/mail-send-envelope.svg-CV33h5Sx.js +15 -0
  70. package/dist/browser/chunks/modal-BA6EnLMO.js +15 -0
  71. package/dist/browser/chunks/modal-DW-P3H1k.js +66 -0
  72. package/dist/browser/chunks/money-cashier-receipt.svg-CJL8C2gs.js +15 -0
  73. package/dist/browser/chunks/money-currency-dollar-pay.svg-VdBplCTx.js +15 -0
  74. package/dist/browser/chunks/money-graph-arrow-increase.svg-DcRov3zk.js +15 -0
  75. package/dist/browser/chunks/money-graph-bar-chart-increase.svg-Cc7KxjX-.js +15 -0
  76. package/dist/browser/chunks/nature-ecology-leaf.svg-DR3cTZxt.js +15 -0
  77. package/dist/browser/chunks/phone-telephone.svg-DyY0gUlk.js +15 -0
  78. package/dist/browser/chunks/programming-bug.svg-BHLT-Qhp.js +15 -0
  79. package/dist/browser/chunks/programming-cloud.svg-B6YW33ba.js +15 -0
  80. package/dist/browser/chunks/programming-computer-database-server.svg-B6o5Sdn-.js +15 -0
  81. package/dist/browser/chunks/programming-computer-database.svg-Cl7OVtpJ.js +15 -0
  82. package/dist/browser/chunks/programming-module-four-layout.svg-BQrerL1x.js +15 -0
  83. package/dist/browser/chunks/programming-module-three.svg-B2KTQzBM.js +15 -0
  84. package/dist/browser/chunks/programming-module.svg-CiID7kPm.js +15 -0
  85. package/dist/browser/chunks/programming-script-code.svg-D1M5rtkN.js +15 -0
  86. package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +17 -0
  87. package/dist/browser/chunks/shopping-cart.svg-BEegiIR9.js +15 -0
  88. package/dist/browser/chunks/shopping-gift-present.svg-BUHwuLix.js +15 -0
  89. package/dist/browser/chunks/shopping-shipping-box-parcel-package.svg-D6fxWdYx.js +15 -0
  90. package/dist/browser/chunks/tag-new-circle.svg-jsg1bGs0.js +15 -0
  91. package/dist/browser/chunks/travel-map-earth-globe.svg-ClbMiU-f.js +15 -0
  92. package/dist/browser/chunks/vendor-Ad2vN5Ro.js +333 -0
  93. package/dist/browser/standalone.esm.js +1852 -0
  94. package/dist/browser/standalone.js +253 -255
  95. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  96. package/dist/components/ApiReference.vue.js +1 -1
  97. package/dist/components/ApiReference.vue.js.map +1 -1
  98. package/dist/components/ApiReference.vue.script.js +61 -26
  99. package/dist/components/ApiReference.vue.script.js.map +1 -1
  100. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts +16 -0
  101. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.d.ts.map +1 -0
  102. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.js +7 -0
  103. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.js.map +1 -0
  104. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +164 -0
  105. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -0
  106. package/dist/components/Content/AsyncApi/Channel.vue.d.ts +14 -0
  107. package/dist/components/Content/AsyncApi/Channel.vue.d.ts.map +1 -0
  108. package/dist/components/Content/AsyncApi/Channel.vue.js +9 -0
  109. package/dist/components/Content/AsyncApi/Channel.vue.js.map +1 -0
  110. package/dist/components/Content/AsyncApi/Channel.vue.script.js +108 -0
  111. package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -0
  112. package/dist/components/Content/AsyncApi/index.d.ts +2 -0
  113. package/dist/components/Content/AsyncApi/index.d.ts.map +1 -0
  114. package/dist/components/Content/Content.vue.d.ts +3 -3
  115. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  116. package/dist/components/Content/Content.vue.js.map +1 -1
  117. package/dist/components/Content/Content.vue.script.js +19 -3
  118. package/dist/components/Content/Content.vue.script.js.map +1 -1
  119. package/dist/components/Content/Models/ModelTag.vue.d.ts +2 -0
  120. package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
  121. package/dist/components/Content/Models/ModelTag.vue.js.map +1 -1
  122. package/dist/components/Content/Models/ModelTag.vue.script.js +11 -12
  123. package/dist/components/Content/Models/ModelTag.vue.script.js.map +1 -1
  124. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -1
  125. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  126. package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -1
  127. package/dist/components/Content/Operations/TraversedEntry.vue.script.js +4 -2
  128. package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
  129. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  130. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -1
  131. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +4 -6
  132. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
  133. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +2 -1
  134. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
  135. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +40 -25
  136. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
  137. package/dist/components/index.js +1 -1
  138. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  139. package/dist/features/Operation/components/ParameterListItem.vue.js.map +1 -1
  140. package/dist/features/Operation/components/ParameterListItem.vue.script.js +9 -9
  141. package/dist/features/Operation/components/ParameterListItem.vue.script.js.map +1 -1
  142. package/dist/features/Search/components/SearchButton.vue.d.ts +4 -1
  143. package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
  144. package/dist/features/Search/components/SearchButton.vue.js.map +1 -1
  145. package/dist/features/Search/components/SearchButton.vue.script.js +7 -8
  146. package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -1
  147. package/dist/features/Search/components/SearchModal.vue.d.ts +4 -1
  148. package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
  149. package/dist/features/Search/components/SearchModal.vue.js +1 -1
  150. package/dist/features/Search/components/SearchModal.vue.js.map +1 -1
  151. package/dist/features/Search/components/SearchModal.vue.script.js +5 -2
  152. package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -1
  153. package/dist/features/Search/components/SearchResult.vue.d.ts +2 -0
  154. package/dist/features/Search/components/SearchResult.vue.d.ts.map +1 -1
  155. package/dist/features/Search/components/SearchResult.vue.js.map +1 -1
  156. package/dist/features/Search/components/SearchResult.vue.script.js +8 -6
  157. package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -1
  158. package/dist/features/Search/helpers/create-search-index.d.ts +9 -1
  159. package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
  160. package/dist/features/Search/helpers/create-search-index.js +27 -8
  161. package/dist/features/Search/helpers/create-search-index.js.map +1 -1
  162. package/dist/features/Search/hooks/useSearchIndex.d.ts +4 -2
  163. package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -1
  164. package/dist/features/Search/hooks/useSearchIndex.js +4 -3
  165. package/dist/features/Search/hooks/useSearchIndex.js.map +1 -1
  166. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts +1 -1
  167. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +1 -1
  168. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js.map +1 -1
  169. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js +11 -9
  170. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -1
  171. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -1
  172. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js.map +1 -1
  173. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js +9 -1
  174. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js.map +1 -1
  175. package/dist/helpers/get-async-api-model-schema.d.ts +15 -0
  176. package/dist/helpers/get-async-api-model-schema.d.ts.map +1 -0
  177. package/dist/helpers/get-async-api-model-schema.js +32 -0
  178. package/dist/helpers/get-async-api-model-schema.js.map +1 -0
  179. package/dist/helpers/id-routing.d.ts +18 -0
  180. package/dist/helpers/id-routing.d.ts.map +1 -1
  181. package/dist/helpers/id-routing.js +41 -1
  182. package/dist/helpers/id-routing.js.map +1 -1
  183. package/dist/plugins/index.d.ts +1 -1
  184. package/dist/plugins/index.js +1 -1
  185. package/dist/plugins/{persistance-plugin.d.ts → persistence-plugin.d.ts} +2 -8
  186. package/dist/plugins/persistence-plugin.d.ts.map +1 -0
  187. package/dist/plugins/{persistance-plugin.js → persistence-plugin.js} +4 -13
  188. package/dist/plugins/persistence-plugin.js.map +1 -0
  189. package/dist/standalone.esm.d.ts +4 -0
  190. package/dist/standalone.esm.d.ts.map +1 -0
  191. package/dist/style.css +110 -98
  192. package/dist/vue-styles.css +104 -96
  193. package/package.json +20 -18
  194. package/dist/browser/webpack-stats.json +0 -1
  195. package/dist/plugins/persistance-plugin.d.ts.map +0 -1
  196. package/dist/plugins/persistance-plugin.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ParameterListItem.vue.script.js","names":[],"sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport {\n ScalarMarkdown,\n ScalarMarkdownSummary,\n} from '@scalar/components/markdown'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\nimport { ScalarIconCaretRight } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n ParameterObject,\n ResponseObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref } from 'vue'\n\nimport { getRefName } from '@/components/Content/Schema/helpers/get-ref-name'\nimport SchemaProperty from '@/components/Content/Schema/SchemaProperty.vue'\nimport type { OperationProps } from '@/features/Operation/Operation.vue'\n\nimport ContentTypeSelect from './ContentTypeSelect.vue'\nimport Headers from './Headers.vue'\nimport { getParameterExamples } from './helpers/get-parameter-examples'\n\nconst { name, parameter, options, collapsableItems } = defineProps<{\n parameter: ParameterObject | ResponseObject\n name: string\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n collapsableItems?: boolean\n options: Pick<\n OperationProps['options'],\n 'hideModels' | 'orderRequiredPropertiesFirst' | 'orderSchemaPropertiesBy'\n >\n}>()\n\n/** Whether the markdown summary is being truncated */\nconst truncated = ref(false)\n\n/** Responses and params may both have a schema */\nconst schema = computed<SchemaObject | null>(() =>\n 'schema' in parameter && parameter.schema\n ? getResolvedRef(parameter.schema)\n : null,\n)\n\n/** Response and params may both have content */\nconst content = computed(() => {\n if (!('content' in parameter) || !parameter.content) {\n return null\n }\n const keys = Object.keys(parameter.content)\n if (keys.length === 0) {\n return null\n }\n return parameter.content\n})\n\nconst selectedContentType = ref<string>(\n Object.keys(content.value || {})[0] ?? '',\n)\n\n/** Response headers */\nconst headers = computed<ResponseObject['headers'] | null>(() =>\n 'headers' in parameter && parameter.headers ? parameter.headers : null,\n)\n\n/** Raw schema (possibly with $ref) for the selected content type or param. */\nconst baseSchema = computed(() =>\n content.value\n ? content.value?.[selectedContentType.value]?.schema\n : 'schema' in parameter && parameter.schema\n ? parameter.schema\n : null,\n)\n\n/** When the schema is a $ref, preserve its name so the UI can show the ref name instead of just the type. */\nconst schemaModelName = computed(() => {\n const raw = baseSchema.value\n if (!raw) {\n return null\n }\n\n if ('$ref' in raw) {\n return getRefName(raw.$ref)\n }\n\n return null\n})\n\n/** Computed value from the combined schema param and content param */\nconst value = computed(() => {\n const base = baseSchema.value\n const resolvedBase = content.value ? getResolvedRef(base) : schema.value\n\n const deprecated =\n 'deprecated' in parameter ? parameter.deprecated : schema.value?.deprecated\n\n /** Combine param/content/schema examples while ignoring undefined values. */\n const examples = getParameterExamples({\n parameter,\n schemaExamples: schema.value?.examples,\n contentExamples: content.value?.[selectedContentType.value]?.examples,\n })\n\n return {\n ...resolvedBase,\n deprecated: deprecated,\n examples,\n } as SchemaObject\n})\n\n/**\n * Determines whether this parameter item should be rendered as a collapsible disclosure.\n * Only collapses when collapsableItems is enabled and the parameter has additional\n * content to display (content types, headers, or schema details).\n */\nconst shouldCollapse = computed<boolean>(() =>\n Boolean(content.value || headers.value || schema.value || truncated.value),\n)\n</script>\n<template>\n <li class=\"parameter-item group/parameter-item\">\n <Disclosure v-slot=\"{ open }\">\n <component\n :is=\"shouldCollapse ? DisclosureButton : 'div'\"\n v-if=\"collapsableItems\"\n class=\"parameter-item-trigger\"\n :class=\"{ 'parameter-item-trigger-open': open }\">\n <div class=\"parameter-item-name min-w-0\">\n <ScalarIconCaretRight\n v-if=\"shouldCollapse\"\n class=\"parameter-item-icon size-3 transition-transform duration-100\"\n :class=\"{ 'rotate-90': open }\"\n weight=\"bold\" />\n <div>\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </div>\n </div>\n <ScalarMarkdownSummary\n v-if=\"!open && parameter.description\"\n v-model:truncated=\"truncated\"\n class=\"parameter-item-description-summary min-w-0 flex-1\"\n controlled\n :value=\"parameter.description\" />\n <div\n v-else\n class=\"flex-1\" />\n </component>\n <div\n v-if=\"shouldCollapse && content\"\n class=\"absolute top-[calc(10px+0.5lh)] right-0 z-0 flex -translate-y-1/2 items-center text-base\"\n :class=\"{\n 'opacity-0 group-focus-within/parameter-item:opacity-100 group-hover/parameter-item:opacity-100':\n !open,\n }\">\n <div\n class=\"from-b-1 absolute inset-y-0 -left-6 -z-1 w-8 bg-linear-to-l from-40% to-transparent\" />\n <ContentTypeSelect\n v-model=\"selectedContentType\"\n :content=\"content\" />\n </div>\n <DisclosurePanel\n class=\"parameter-item-container parameter-item-container-markdown\"\n :static=\"!collapsableItems\">\n <ScalarMarkdown\n v-if=\"collapsableItems && parameter.description\"\n class=\"parameter-item-description\"\n :value=\"parameter.description\" />\n <!-- Headers -->\n <Headers\n v-if=\"headers\"\n :breadcrumb=\"breadcrumb\"\n :eventBus=\"eventBus\"\n :headers=\"headers\"\n :orderRequiredPropertiesFirst=\"options.orderRequiredPropertiesFirst\"\n :orderSchemaPropertiesBy=\"options.orderSchemaPropertiesBy\" />\n\n <!-- Schema -->\n <SchemaProperty\n is=\"div\"\n :breadcrumb=\"breadcrumb\"\n compact\n :description=\"collapsableItems ? '' : parameter.description\"\n :eventBus=\"eventBus\"\n :hideWriteOnly=\"true\"\n :modelName=\"schemaModelName\"\n :name=\"collapsableItems ? '' : name\"\n :noncollapsible=\"true\"\n :options=\"{\n hideWriteOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :required=\"'required' in parameter && parameter.required\"\n :schema=\"value\" />\n </DisclosurePanel>\n </Disclosure>\n </li>\n</template>\n\n<style scoped>\n.parameter-item {\n display: flex;\n flex-direction: column;\n position: relative;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.parameter-item:last-of-type .parameter-schema {\n padding-bottom: 0;\n}\n\n.parameter-item-container {\n padding: 0;\n}\n\n.parameter-item-headers {\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.parameter-item-name {\n position: relative;\n font-weight: var(--scalar-bold);\n font-size: var(--scalar-font-size-4);\n font-family: var(--scalar-font-code);\n color: var(--scalar-color-1);\n overflow-wrap: break-word;\n}\n\n.parameter-item-description,\n.parameter-item-description-summary {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-2);\n}\n\n.parameter-item-description-summary.parameter-item-description-summary > * {\n --markdown-line-height: var(--scalar-line-height-5);\n}\n\n/* Match font size of markdown for property-detail-value since first child within accordian is displayed as if it were in the markdown section */\n.parameter-item-trigger\n ~ .parameter-item-container\n :deep(.property--level-0 > .property-heading .property-detail-value) {\n font-size: var(--scalar-micro);\n}\n\n.parameter-item-required-optional {\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n margin-right: 6px;\n position: relative;\n}\n\n.parameter-item--required {\n text-transform: uppercase;\n font-size: var(--scalar-micro);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-orange);\n}\n\n.parameter-item-description {\n margin-top: 6px;\n font-size: var(--scalar-small);\n color: var(--scalar-color-2);\n line-height: 1.4;\n}\n\n.parameter-item-description :deep(p) {\n margin-top: 4px;\n font-size: var(--scalar-small);\n color: var(--scalar-color-2);\n}\n\n.parameter-schema {\n padding-bottom: 9px;\n margin-top: 3px;\n}\n\n.parameter-item-trigger {\n display: flex;\n align-items: baseline;\n line-height: var(--scalar-line-height-5);\n gap: 6px;\n flex-wrap: wrap;\n padding: 10px 0;\n outline: none;\n}\n\n.parameter-item-trigger-open {\n padding-bottom: 0;\n}\n\n.parameter-item-icon {\n color: var(--scalar-color-3);\n left: -19px;\n top: 0.5lh;\n translate: 0 -50%;\n position: absolute;\n}\n\n.parameter-item-trigger:hover .parameter-item-icon,\n.parameter-item-trigger:focus-visible .parameter-item-icon {\n color: var(--scalar-color-1);\n}\n\n.parameter-item-trigger:focus-visible .parameter-item-icon {\n outline: 1px solid var(--scalar-color-accent);\n outline-offset: 2px;\n border-radius: var(--scalar-radius);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCA,MAAM,YAAY,IAAI,MAAK;;EAG3B,MAAM,SAAS,eACb,YAAY,QAAA,aAAa,QAAA,UAAU,SAC/B,eAAe,QAAA,UAAU,OAAM,GAC/B,KACN;;EAGA,MAAM,UAAU,eAAe;AAC7B,OAAI,EAAE,aAAa,QAAA,cAAc,CAAC,QAAA,UAAU,QAC1C,QAAO;AAGT,OADa,OAAO,KAAK,QAAA,UAAU,QAAO,CACjC,WAAW,EAClB,QAAO;A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SAAO;;uCAA+E,QAAA,QAAQ;kCAAmE,QAAA,QAAQ;;QAKzK,UAAQ,cAAgB,QAAA,aAAa,QAAA,UAAU;QAC/C,QAAQ,MAAA"}
1
+ {"version":3,"file":"ParameterListItem.vue.script.js","names":[],"sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue'\nimport {\n ScalarMarkdown,\n ScalarMarkdownSummary,\n} from '@scalar/components/markdown'\nimport { ScalarWrappingText } from '@scalar/components/wrapping-text'\nimport { ScalarIconCaretRight } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n ParameterObject,\n ResponseObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { computed, ref } from 'vue'\n\nimport { getRefName } from '@/components/Content/Schema/helpers/get-ref-name'\nimport SchemaProperty from '@/components/Content/Schema/SchemaProperty.vue'\nimport type { OperationProps } from '@/features/Operation/Operation.vue'\n\nimport ContentTypeSelect from './ContentTypeSelect.vue'\nimport Headers from './Headers.vue'\nimport { getParameterExamples } from './helpers/get-parameter-examples'\n\nconst { name, parameter, options, collapsableItems } = defineProps<{\n parameter: ParameterObject | ResponseObject\n name: string\n breadcrumb?: string[]\n eventBus: WorkspaceEventBus | null\n collapsableItems?: boolean\n options: Pick<\n OperationProps['options'],\n 'hideModels' | 'orderRequiredPropertiesFirst' | 'orderSchemaPropertiesBy'\n >\n}>()\n\n/** Whether the markdown summary is being truncated */\nconst truncated = ref(false)\n\n/** Responses and params may both have a schema */\nconst schema = computed<SchemaObject | null>(() =>\n 'schema' in parameter && parameter.schema\n ? getResolvedRef(parameter.schema)\n : null,\n)\n\n/** Response and params may both have content */\nconst content = computed(() => {\n if (!('content' in parameter) || !parameter.content) {\n return null\n }\n const keys = Object.keys(parameter.content)\n if (keys.length === 0) {\n return null\n }\n return parameter.content\n})\n\nconst selectedContentType = ref<string>(\n Object.keys(content.value || {})[0] ?? '',\n)\n\n/** Response headers */\nconst headers = computed<ResponseObject['headers'] | null>(() =>\n 'headers' in parameter && parameter.headers ? parameter.headers : null,\n)\n\n/** Raw schema (possibly with $ref) for the selected content type or param. */\nconst baseSchema = computed(() =>\n content.value\n ? content.value?.[selectedContentType.value]?.schema\n : 'schema' in parameter && parameter.schema\n ? parameter.schema\n : null,\n)\n\n/** When the schema is a $ref, preserve its name so the UI can show the ref name instead of just the type. */\nconst schemaModelName = computed(() => {\n const raw = baseSchema.value\n if (!raw) {\n return null\n }\n\n if ('$ref' in raw) {\n return getRefName(raw.$ref)\n }\n\n return null\n})\n\n/** Computed value from the combined schema param and content param */\nconst value = computed(() => {\n const base = baseSchema.value\n const resolvedBase = content.value ? getResolvedRef(base) : schema.value\n\n const deprecated =\n 'deprecated' in parameter ? parameter.deprecated : schema.value?.deprecated\n\n /** Combine param/content/schema examples while ignoring undefined values. */\n const examples = getParameterExamples({\n parameter,\n schemaExamples: schema.value?.examples,\n contentExamples: content.value?.[selectedContentType.value]?.examples,\n })\n\n return {\n ...resolvedBase,\n deprecated: deprecated,\n examples,\n } as SchemaObject\n})\n\n/**\n * Determines whether this parameter item should be rendered as a collapsible disclosure.\n * Only collapses when collapsableItems is enabled and the parameter has additional\n * content to display (content types, headers, or schema details).\n */\nconst shouldCollapse = computed<boolean>(() =>\n Boolean(content.value || headers.value || schema.value || truncated.value),\n)\n</script>\n<template>\n <li class=\"parameter-item group/parameter-item\">\n <Disclosure v-slot=\"{ open }\">\n <component\n :is=\"shouldCollapse ? DisclosureButton : 'div'\"\n v-if=\"collapsableItems\"\n class=\"parameter-item-trigger\"\n :class=\"{ 'parameter-item-trigger-open': open }\">\n <div class=\"parameter-item-name min-w-0\">\n <ScalarIconCaretRight\n v-if=\"shouldCollapse\"\n class=\"parameter-item-icon size-3 transition-transform duration-100\"\n :class=\"{ 'rotate-90': open }\"\n weight=\"bold\" />\n <div>\n <ScalarWrappingText\n preset=\"property\"\n :text=\"name\" />\n </div>\n </div>\n <ScalarMarkdownSummary\n v-if=\"!open && parameter.description\"\n v-model:truncated=\"truncated\"\n class=\"parameter-item-description-summary min-w-0 flex-1\"\n controlled\n :value=\"parameter.description\" />\n <div\n v-else\n class=\"flex-1\" />\n </component>\n <DisclosurePanel\n class=\"parameter-item-container parameter-item-container-markdown\"\n :static=\"!collapsableItems\">\n <ScalarMarkdown\n v-if=\"collapsableItems && parameter.description\"\n class=\"parameter-item-description\"\n :value=\"parameter.description\" />\n <!-- Headers -->\n <Headers\n v-if=\"headers\"\n :breadcrumb=\"breadcrumb\"\n :eventBus=\"eventBus\"\n :headers=\"headers\"\n :orderRequiredPropertiesFirst=\"options.orderRequiredPropertiesFirst\"\n :orderSchemaPropertiesBy=\"options.orderSchemaPropertiesBy\" />\n\n <!-- Schema -->\n <SchemaProperty\n is=\"div\"\n :breadcrumb=\"breadcrumb\"\n compact\n :description=\"collapsableItems ? '' : parameter.description\"\n :eventBus=\"eventBus\"\n :hideWriteOnly=\"true\"\n :modelName=\"schemaModelName\"\n :name=\"collapsableItems ? '' : name\"\n :noncollapsible=\"true\"\n :options=\"{\n hideWriteOnly: true,\n orderRequiredPropertiesFirst: options.orderRequiredPropertiesFirst,\n orderSchemaPropertiesBy: options.orderSchemaPropertiesBy,\n }\"\n :required=\"'required' in parameter && parameter.required\"\n :schema=\"value\" />\n </DisclosurePanel>\n <div\n v-if=\"shouldCollapse && content\"\n class=\"absolute top-[calc(10px+0.5lh)] right-0 z-0 flex -translate-y-1/2 items-center text-base\"\n :class=\"{\n 'opacity-0 group-focus-within/parameter-item:opacity-100 group-hover/parameter-item:opacity-100':\n !open,\n }\">\n <div\n class=\"from-b-1 absolute inset-y-0 -left-6 -z-1 w-8 bg-linear-to-l from-40% to-transparent\" />\n <ContentTypeSelect\n v-model=\"selectedContentType\"\n :content=\"content\" />\n </div>\n </Disclosure>\n </li>\n</template>\n\n<style scoped>\n.parameter-item {\n display: flex;\n flex-direction: column;\n position: relative;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.parameter-item:last-of-type .parameter-schema {\n padding-bottom: 0;\n}\n\n.parameter-item-container {\n padding: 0;\n}\n\n.parameter-item-headers {\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n\n.parameter-item-name {\n position: relative;\n font-weight: var(--scalar-bold);\n font-size: var(--scalar-font-size-4);\n font-family: var(--scalar-font-code);\n color: var(--scalar-color-1);\n overflow-wrap: break-word;\n}\n\n.parameter-item-description,\n.parameter-item-description-summary {\n font-size: var(--scalar-mini);\n color: var(--scalar-color-2);\n}\n\n.parameter-item-description-summary.parameter-item-description-summary > * {\n --markdown-line-height: var(--scalar-line-height-5);\n}\n\n/* Match font size of markdown for property-detail-value since first child within accordian is displayed as if it were in the markdown section */\n.parameter-item-trigger\n ~ .parameter-item-container\n :deep(.property--level-0 > .property-heading .property-detail-value) {\n font-size: var(--scalar-micro);\n}\n\n.parameter-item-required-optional {\n color: var(--scalar-color-2);\n font-weight: var(--scalar-semibold);\n margin-right: 6px;\n position: relative;\n}\n\n.parameter-item--required {\n text-transform: uppercase;\n font-size: var(--scalar-micro);\n font-weight: var(--scalar-semibold);\n color: var(--scalar-color-orange);\n}\n\n.parameter-item-description {\n margin-top: 6px;\n font-size: var(--scalar-small);\n color: var(--scalar-color-2);\n line-height: 1.4;\n}\n\n.parameter-item-description :deep(p) {\n margin-top: 4px;\n font-size: var(--scalar-small);\n color: var(--scalar-color-2);\n}\n\n.parameter-schema {\n padding-bottom: 9px;\n margin-top: 3px;\n}\n\n.parameter-item-trigger {\n display: flex;\n align-items: baseline;\n line-height: var(--scalar-line-height-5);\n gap: 6px;\n flex-wrap: wrap;\n padding: 10px 0;\n outline: none;\n}\n\n.parameter-item-trigger-open {\n padding-bottom: 0;\n}\n\n.parameter-item-icon {\n color: var(--scalar-color-3);\n left: -19px;\n top: 0.5lh;\n translate: 0 -50%;\n position: absolute;\n}\n\n.parameter-item-trigger:hover .parameter-item-icon,\n.parameter-item-trigger:focus-visible .parameter-item-icon {\n color: var(--scalar-color-1);\n}\n\n.parameter-item-trigger:focus-visible .parameter-item-icon {\n outline: 1px solid var(--scalar-color-accent);\n outline-offset: 2px;\n border-radius: var(--scalar-radius);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCA,MAAM,YAAY,IAAI,MAAK;;EAG3B,MAAM,SAAS,eACb,YAAY,QAAA,aAAa,QAAA,UAAU,SAC/B,eAAe,QAAA,UAAU,OAAM,GAC/B,KACN;;EAGA,MAAM,UAAU,eAAe;AAC7B,OAAI,EAAE,aAAa,QAAA,cAAc,CAAC,QAAA,UAAU,QAC1C,QAAO;AAGT,OADa,OAAO,KAAK,QAAA,UAAU,QAAO,CACjC,WAAW,EAClB,QAAO;AAET,UAAO,QAAA,UAAU;IAClB;EAED,MAAM,sBAAsB,IAC1B,OAAO,KAAK,QAAQ,SAAS,EAAE,CAAC,CAAC,MAAM,GACzC;;EAGA,MAAM,UAAU,eACd,aAAa,QAAA,aAAa,QAAA,UAAU,UAAU,QAAA,UAAU,UAAU,KACpE;;EAGA,MAAM,aAAa,eACjB,QAAQ,QACJ,QAAQ,QAAQ,oBAAoB,QAAQ,SAC5C,YAAY,QAAA,aAAa,QAAA,UAAU,SACjC,QAAA,UAAU,SACV,KACR;;EAGA,MAAM,kBAAkB,eAAe;GACrC,MAAM,MAAM,WAAW;AACvB,OAAI,CAAC,IACH,QAAO;AAGT,OAAI,UAAU,IACZ,QAAO,WAAW,IAAI,KAAI;AAG5B,UAAO;IACR;;EAGD,MAAM,QAAQ,eAAe;GAC3B,MAAM,OAAO,WAAW;GACxB,MAAM,eAAe,QAAQ,QAAQ,eAAe,KAAK,GAAG,OAAO;GAEnE,MAAM,aACJ,gBAAgB,QAAA,YAAY,QAAA,UAAU,aAAa,OAAO,OAAO;;GAGnE,MAAM,WAAW,qBA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QACV,SAAS,QAAA;QACT,8BAA8B,QAAA,QAAQ;QACtC,yBAAyB,QAAA,QAAQ;;;;;;;;OAGpC,YAgBoB,wBAAA;QAflB,IAAG;QACF,YAAY,QAAA;QACb,SAAA;QACC,aAAa,QAAA,mBAAgB,KAAQ,QAAA,UAAU;QAC/C,UAAU,QAAA;QACV,eAAe;QACf,WAAW,gBAAA;QACX,MAAM,QAAA,mBAAgB,KAAQ,QAAA;QAC9B,gBAAgB;QAChB,SAAO;;uCAA+E,QAAA,QAAQ;kCAAmE,QAAA,QAAQ;;QAKzK,UAAQ,cAAgB,QAAA,aAAa,QAAA,UAAU;QAC/C,QAAQ,MAAA;;;;;;;;;;;;;;KAGL,eAAA,SAAkB,QAAA,SAAA,WAAA,EAD1B,mBAYM,OAAA;;MAVJ,OAAK,eAAA,CAAC,4FAA0F,EAAA,kGAAA,CACmC,MAAA,CAAA,CAAA;mCAInI,mBACgG,OAAA,EAA9F,OAAM,uFAAqF,EAAA,MAAA,GAAA,GAC7F,YAEuB,2BAAA;kBADZ,oBAAA;uFAAmB,QAAA;MAC3B,SAAS,QAAA"}
@@ -1,10 +1,13 @@
1
+ import { type ModelsSectionLabel } from '@scalar/types/api-reference';
2
+ import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
1
3
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
4
  import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
5
  type __VLS_Props = {
4
6
  forceIcon?: boolean;
5
7
  searchHotKey?: string;
6
8
  hideModels?: boolean;
7
- document?: OpenApiDocument;
9
+ modelsSectionLabel?: ModelsSectionLabel;
10
+ document?: OpenApiDocument | AsyncApiDocument;
8
11
  eventBus: WorkspaceEventBus;
9
12
  };
10
13
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/components/SearchButton.vue"],"names":[],"mappings":"AAsGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAKnG,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;AAuKF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/components/SearchButton.vue"],"names":[],"mappings":"AA+GA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAKnG,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;IACvC,QAAQ,CAAC,EAAE,eAAe,GAAG,gBAAgB,CAAA;IAC7C,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;AA0KF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchButton.vue.js","names":[],"sources":["../../../../src/features/Search/components/SearchButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarSidebarSearchButton } from '@scalar/components/sidebar'\nimport { isMacOS } from '@scalar/helpers/general/is-mac-os'\nimport { ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'\n\nimport SearchModal from './SearchModal.vue'\n\nconst { searchHotKey = 'k', hideModels = false } = defineProps<{\n forceIcon?: boolean\n searchHotKey?: string\n hideModels?: boolean\n document?: OpenApiDocument\n eventBus: WorkspaceEventBus\n}>()\n\nconst button = ref<InstanceType<typeof ScalarSidebarSearchButton>>()\nconst modalState = useModal()\n\nconst handleHotKey = (e: KeyboardEvent) => {\n if ((isMacOS() ? e.metaKey : e.ctrlKey) && e.key === searchHotKey) {\n e.preventDefault()\n e.stopPropagation()\n\n if (modalState.open) {\n modalState.hide()\n } else {\n modalState.show()\n }\n }\n}\n\nwatch(\n () => modalState.open,\n async (next, prev) => {\n // Return focus to the button when the modal is closed\n if (!next && prev) {\n await nextTick()\n button.value?.$el.focus()\n }\n },\n)\n\n// Handle keyboard shortcuts\n// TODO: we can move this to the hotkey event bus but we would need to set up a custom key from the searchHotKey config\n// and make sure it works correctly inside the references first\nonMounted(() => window.addEventListener('keydown', handleHotKey))\nonBeforeUnmount(() => window.removeEventListener('keydown', handleHotKey))\n\nfunction handleClick() {\n modalState.show()\n}\n</script>\n<template>\n <ScalarIconButton\n v-if=\"forceIcon\"\n :icon=\"ScalarIconMagnifyingGlass\"\n label=\"Search\"\n @click=\"handleClick\" />\n <ScalarSidebarSearchButton\n v-else\n ref=\"button\"\n class=\"w-full\"\n :class=\"$attrs.class\"\n @click=\"handleClick\">\n <span class=\"sr-only\">Open Search</span>\n <span\n aria-hidden=\"true\"\n class=\"sidebar-search-placeholder\">\n Search\n </span>\n <template #shortcut>\n <template v-if=\"isMacOS()\">\n <span class=\"sr-only\">Command</span>\n <span aria-hidden=\"true\">⌘</span>\n </template>\n <template v-else>\n <span class=\"sr-only\">CTRL</span>\n <span aria-hidden=\"true\">⌃</span>\n </template>\n {{ searchHotKey }}\n </template>\n </ScalarSidebarSearchButton>\n\n <SearchModal\n :document\n :eventBus=\"eventBus\"\n :hideModels=\"hideModels\"\n :modalState=\"modalState\" />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SearchButton.vue.js","names":[],"sources":["../../../../src/features/Search/components/SearchButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarSidebarSearchButton } from '@scalar/components/sidebar'\nimport { isMacOS } from '@scalar/helpers/general/is-mac-os'\nimport { ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport {\n DEFAULT_MODELS_SECTION_LABEL,\n type ModelsSectionLabel,\n} from '@scalar/types/api-reference'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'\n\nimport SearchModal from './SearchModal.vue'\n\nconst {\n searchHotKey = 'k',\n modelsSectionLabel = DEFAULT_MODELS_SECTION_LABEL,\n} = defineProps<{\n forceIcon?: boolean\n searchHotKey?: string\n hideModels?: boolean\n modelsSectionLabel?: ModelsSectionLabel\n document?: OpenApiDocument | AsyncApiDocument\n eventBus: WorkspaceEventBus\n}>()\n\nconst button = ref<InstanceType<typeof ScalarSidebarSearchButton>>()\nconst modalState = useModal()\n\nconst handleHotKey = (e: KeyboardEvent) => {\n if ((isMacOS() ? e.metaKey : e.ctrlKey) && e.key === searchHotKey) {\n e.preventDefault()\n e.stopPropagation()\n\n if (modalState.open) {\n modalState.hide()\n } else {\n modalState.show()\n }\n }\n}\n\nwatch(\n () => modalState.open,\n async (next, prev) => {\n // Return focus to the button when the modal is closed\n if (!next && prev) {\n await nextTick()\n button.value?.$el.focus()\n }\n },\n)\n\n// Handle keyboard shortcuts\n// TODO: we can move this to the hotkey event bus but we would need to set up a custom key from the searchHotKey config\n// and make sure it works correctly inside the references first\nonMounted(() => window.addEventListener('keydown', handleHotKey))\nonBeforeUnmount(() => window.removeEventListener('keydown', handleHotKey))\n\nfunction handleClick() {\n modalState.show()\n}\n</script>\n<template>\n <ScalarIconButton\n v-if=\"forceIcon\"\n :icon=\"ScalarIconMagnifyingGlass\"\n label=\"Search\"\n @click=\"handleClick\" />\n <ScalarSidebarSearchButton\n v-else\n ref=\"button\"\n class=\"w-full\"\n :class=\"$attrs.class\"\n @click=\"handleClick\">\n <span class=\"sr-only\">Open Search</span>\n <span\n aria-hidden=\"true\"\n class=\"sidebar-search-placeholder\">\n Search\n </span>\n <template #shortcut>\n <template v-if=\"isMacOS()\">\n <span class=\"sr-only\">Command</span>\n <span aria-hidden=\"true\">⌘</span>\n </template>\n <template v-else>\n <span class=\"sr-only\">CTRL</span>\n <span aria-hidden=\"true\">⌃</span>\n </template>\n {{ searchHotKey }}\n </template>\n </ScalarSidebarSearchButton>\n\n <SearchModal\n :document\n :eventBus=\"eventBus\"\n :modalState=\"modalState\"\n :modelsSectionLabel=\"modelsSectionLabel\" />\n</template>\n"],"mappings":""}
@@ -1,6 +1,7 @@
1
1
  import SearchModal_default from "./SearchModal.vue.js";
2
2
  import { Fragment, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, normalizeClass, onBeforeUnmount, onMounted, openBlock, ref, toDisplayString, unref, watch, withCtx } from "vue";
3
3
  import { ScalarSidebarSearchButton } from "@scalar/components/sidebar";
4
+ import { DEFAULT_MODELS_SECTION_LABEL } from "@scalar/types/api-reference";
4
5
  import { ScalarIconMagnifyingGlass } from "@scalar/icons";
5
6
  import { ScalarIconButton } from "@scalar/components/icon-button";
6
7
  import { useModal } from "@scalar/components/modal";
@@ -11,10 +12,8 @@ var SearchButton_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
11
12
  props: {
12
13
  forceIcon: { type: Boolean },
13
14
  searchHotKey: { default: "k" },
14
- hideModels: {
15
- type: Boolean,
16
- default: false
17
- },
15
+ hideModels: { type: Boolean },
16
+ modelsSectionLabel: { default: () => DEFAULT_MODELS_SECTION_LABEL },
18
17
  document: {},
19
18
  eventBus: {}
20
19
  },
@@ -62,13 +61,13 @@ var SearchButton_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
62
61
  }, 8, ["class"])), createVNode(SearchModal_default, {
63
62
  document: __props.document,
64
63
  eventBus: __props.eventBus,
65
- hideModels: __props.hideModels,
66
- modalState: unref(modalState)
64
+ modalState: unref(modalState),
65
+ modelsSectionLabel: __props.modelsSectionLabel
67
66
  }, null, 8, [
68
67
  "document",
69
68
  "eventBus",
70
- "hideModels",
71
- "modalState"
69
+ "modalState",
70
+ "modelsSectionLabel"
72
71
  ])], 64);
73
72
  };
74
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SearchButton.vue.script.js","names":["$attrs"],"sources":["../../../../src/features/Search/components/SearchButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarSidebarSearchButton } from '@scalar/components/sidebar'\nimport { isMacOS } from '@scalar/helpers/general/is-mac-os'\nimport { ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'\n\nimport SearchModal from './SearchModal.vue'\n\nconst { searchHotKey = 'k', hideModels = false } = defineProps<{\n forceIcon?: boolean\n searchHotKey?: string\n hideModels?: boolean\n document?: OpenApiDocument\n eventBus: WorkspaceEventBus\n}>()\n\nconst button = ref<InstanceType<typeof ScalarSidebarSearchButton>>()\nconst modalState = useModal()\n\nconst handleHotKey = (e: KeyboardEvent) => {\n if ((isMacOS() ? e.metaKey : e.ctrlKey) && e.key === searchHotKey) {\n e.preventDefault()\n e.stopPropagation()\n\n if (modalState.open) {\n modalState.hide()\n } else {\n modalState.show()\n }\n }\n}\n\nwatch(\n () => modalState.open,\n async (next, prev) => {\n // Return focus to the button when the modal is closed\n if (!next && prev) {\n await nextTick()\n button.value?.$el.focus()\n }\n },\n)\n\n// Handle keyboard shortcuts\n// TODO: we can move this to the hotkey event bus but we would need to set up a custom key from the searchHotKey config\n// and make sure it works correctly inside the references first\nonMounted(() => window.addEventListener('keydown', handleHotKey))\nonBeforeUnmount(() => window.removeEventListener('keydown', handleHotKey))\n\nfunction handleClick() {\n modalState.show()\n}\n</script>\n<template>\n <ScalarIconButton\n v-if=\"forceIcon\"\n :icon=\"ScalarIconMagnifyingGlass\"\n label=\"Search\"\n @click=\"handleClick\" />\n <ScalarSidebarSearchButton\n v-else\n ref=\"button\"\n class=\"w-full\"\n :class=\"$attrs.class\"\n @click=\"handleClick\">\n <span class=\"sr-only\">Open Search</span>\n <span\n aria-hidden=\"true\"\n class=\"sidebar-search-placeholder\">\n Search\n </span>\n <template #shortcut>\n <template v-if=\"isMacOS()\">\n <span class=\"sr-only\">Command</span>\n <span aria-hidden=\"true\">⌘</span>\n </template>\n <template v-else>\n <span class=\"sr-only\">CTRL</span>\n <span aria-hidden=\"true\">⌃</span>\n </template>\n {{ searchHotKey }}\n </template>\n </ScalarSidebarSearchButton>\n\n <SearchModal\n :document\n :eventBus=\"eventBus\"\n :hideModels=\"hideModels\"\n :modalState=\"modalState\" />\n</template>\n"],"mappings":";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AAA,EAA3B,eAAY,QAAM,EAAC,KAAC,GAAA,EAAA,EAAA,GAAA,GAAA,gBACjB,MACX,gBAAG,QAAA,aAAY,EAAA,EAAA,CAAA,CAAA;2BAfuB,CAAA,OAAA,OAAA,OAAA,KAAxC,mBAAwC,QAAA,EAAlC,OAAM,WAAS,EAAC,eAAW,GAAA,GAAA,OAAA,OAAA,OAAA,KACjC,mBAIO,QAAA;KAHL,eAAY;KACZ,OAAM;OAA6B,YAErC,GAAA,EAAA,CAAA;;sBAcF,YAI6B,qBAAA;IAH1B,UAAA,QAAA;IACA,UAAU,QAAA;IACV,YAAY,QAAA;IACZ,YAAY,MAAA,WAAU"}
1
+ {"version":3,"file":"SearchButton.vue.script.js","names":["$attrs"],"sources":["../../../../src/features/Search/components/SearchButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { useModal } from '@scalar/components/modal'\nimport { ScalarSidebarSearchButton } from '@scalar/components/sidebar'\nimport { isMacOS } from '@scalar/helpers/general/is-mac-os'\nimport { ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport {\n DEFAULT_MODELS_SECTION_LABEL,\n type ModelsSectionLabel,\n} from '@scalar/types/api-reference'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'\n\nimport SearchModal from './SearchModal.vue'\n\nconst {\n searchHotKey = 'k',\n modelsSectionLabel = DEFAULT_MODELS_SECTION_LABEL,\n} = defineProps<{\n forceIcon?: boolean\n searchHotKey?: string\n hideModels?: boolean\n modelsSectionLabel?: ModelsSectionLabel\n document?: OpenApiDocument | AsyncApiDocument\n eventBus: WorkspaceEventBus\n}>()\n\nconst button = ref<InstanceType<typeof ScalarSidebarSearchButton>>()\nconst modalState = useModal()\n\nconst handleHotKey = (e: KeyboardEvent) => {\n if ((isMacOS() ? e.metaKey : e.ctrlKey) && e.key === searchHotKey) {\n e.preventDefault()\n e.stopPropagation()\n\n if (modalState.open) {\n modalState.hide()\n } else {\n modalState.show()\n }\n }\n}\n\nwatch(\n () => modalState.open,\n async (next, prev) => {\n // Return focus to the button when the modal is closed\n if (!next && prev) {\n await nextTick()\n button.value?.$el.focus()\n }\n },\n)\n\n// Handle keyboard shortcuts\n// TODO: we can move this to the hotkey event bus but we would need to set up a custom key from the searchHotKey config\n// and make sure it works correctly inside the references first\nonMounted(() => window.addEventListener('keydown', handleHotKey))\nonBeforeUnmount(() => window.removeEventListener('keydown', handleHotKey))\n\nfunction handleClick() {\n modalState.show()\n}\n</script>\n<template>\n <ScalarIconButton\n v-if=\"forceIcon\"\n :icon=\"ScalarIconMagnifyingGlass\"\n label=\"Search\"\n @click=\"handleClick\" />\n <ScalarSidebarSearchButton\n v-else\n ref=\"button\"\n class=\"w-full\"\n :class=\"$attrs.class\"\n @click=\"handleClick\">\n <span class=\"sr-only\">Open Search</span>\n <span\n aria-hidden=\"true\"\n class=\"sidebar-search-placeholder\">\n Search\n </span>\n <template #shortcut>\n <template v-if=\"isMacOS()\">\n <span class=\"sr-only\">Command</span>\n <span aria-hidden=\"true\">⌘</span>\n </template>\n <template v-else>\n <span class=\"sr-only\">CTRL</span>\n <span aria-hidden=\"true\">⌃</span>\n </template>\n {{ searchHotKey }}\n </template>\n </ScalarSidebarSearchButton>\n\n <SearchModal\n :document\n :eventBus=\"eventBus\"\n :modalState=\"modalState\"\n :modelsSectionLabel=\"modelsSectionLabel\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,SAAS,KAAoD;EACnE,MAAM,aAAa,UAAS;EAE5B,MAAM,gBAAgB,MAAqB;AACzC,QAAK,SAAS,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,QAAA,cAAc;AACjE,MAAE,gBAAe;AACjB,MAAE,iB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A,GAAA,OAAA,OAAA,OAAA,KACjC,mBAIO,QAAA;KAHL,eAAY;KACZ,OAAM;OAA6B,YAErC,GAAA,EAAA,CAAA;;sBAcF,YAI6C,qBAAA;IAH1C,UAAA,QAAA;IACA,UAAU,QAAA;IACV,YAAY,MAAA,WAAU;IACtB,oBAAoB,QAAA"}
@@ -1,10 +1,13 @@
1
1
  import { type ModalState } from '@scalar/components/modal';
2
+ import type { ModelsSectionLabel } from '@scalar/types/api-reference';
3
+ import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
2
4
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
5
  import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
6
  type __VLS_Props = {
5
7
  modalState: ModalState;
6
- document: OpenApiDocument | undefined;
8
+ document: OpenApiDocument | AsyncApiDocument | undefined;
7
9
  eventBus: WorkspaceEventBus;
10
+ modelsSectionLabel?: ModelsSectionLabel;
8
11
  };
9
12
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
13
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/components/SearchModal.vue"],"names":[],"mappings":"AAiJA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAGvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAQnG,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAA;IACrC,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;AAuPF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/components/SearchModal.vue"],"names":[],"mappings":"AAwJA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAGvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAQnG,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,eAAe,GAAG,gBAAgB,GAAG,SAAS,CAAA;IACxD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;CACxC,CAAC;AA4PF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -2,7 +2,7 @@ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_exp
2
2
  import SearchModal_vue_vue_type_script_setup_true_lang_default from "./SearchModal.vue.script.js";
3
3
  /* empty css */
4
4
  //#region src/features/Search/components/SearchModal.vue
5
- var SearchModal_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SearchModal_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-11a4bb2c"]]);
5
+ var SearchModal_default = /* @__PURE__ */ _plugin_vue_export_helper_default(SearchModal_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-c66e857d"]]);
6
6
  //#endregion
7
7
  export { SearchModal_default as default };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"SearchModal.vue.js","names":[],"sources":["../../../../src/features/Search/components/SearchModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\nimport { ScalarSearchInput } from '@scalar/components/search-input'\nimport { ScalarSearchResultList } from '@scalar/components/search-results'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { nanoid } from 'nanoid'\nimport { computed, ref, watch } from 'vue'\n\nimport { useSearchIndex } from '@/features/Search/hooks/useSearchIndex'\n\nimport SearchResult from './SearchResult.vue'\n\nconst props = defineProps<{\n modalState: ModalState\n document: OpenApiDocument | undefined\n eventBus: WorkspaceEventBus\n}>()\n\n/** Base id for the search form */\nconst id = nanoid()\n/** An id for the results listbox */\nconst listboxId = `${id}-search-result`\n/** An id for the results instructions */\nconst instructionsId = `${id}-search-instructions`\n\nconst { query, results } = useSearchIndex(() => props.document)\n\nconst selectedIndex = ref<number | undefined>(undefined)\n\n/** Clear the query value when the modal is opened */\nwatch(\n () => props.modalState.open,\n (open) => {\n if (open) {\n query.value = ''\n }\n },\n)\n\n/** Keyboard navigation */\nconst navigateSearchResults = (direction: 'up' | 'down') => {\n const offset = direction === 'up' ? -1 : 1\n const length = results.value.length\n\n if (typeof selectedIndex.value === 'number') {\n // Ensures we loop around the array by using the remainder\n selectedIndex.value = (selectedIndex.value + offset + length) % length\n } else {\n // If no index is selected, we select the first or last item depending on the direction\n\n selectedIndex.value = offset === -1 ? length - 1 : 0\n }\n}\n\n/** Handle the selection of a search result */\nfunction handleSelect(idx: number | undefined) {\n if (typeof idx !== 'number' || !results.value[idx]) {\n return\n }\n\n const result = results.value[idx]\n props.modalState.hide()\n props.eventBus.emit('scroll-to:nav-item', { id: result.item.id })\n}\n\n/**\n * Active descendant id for the search input\n * NOTE: Result items MUST share this id for the aria-activedescendant attribute to work correctly\n */\nconst activeDescendantId = computed(() => {\n const selectedResult = results.value[selectedIndex.value ?? -1]\n\n return selectedResult ? `search-result-${selectedResult.item.id}` : undefined\n})\n</script>\n<template>\n <ScalarModal\n aria-label=\"Reference Search\"\n :state=\"modalState\"\n variant=\"search\">\n <div\n class=\"mb-0 flex flex-col\"\n role=\"search\">\n <ScalarSearchInput\n v-model=\"query\"\n :aria-activedescendant=\"activeDescendantId\"\n aria-autocomplete=\"list\"\n :aria-controls=\"listboxId\"\n :aria-describedby=\"instructionsId\"\n role=\"combobox\"\n @blur=\"selectedIndex = undefined\"\n @keydown.down.stop.prevent=\"navigateSearchResults('down')\"\n @keydown.enter.stop.prevent=\"() => handleSelect(selectedIndex)\"\n @keydown.up.stop.prevent=\"navigateSearchResults('up')\" />\n </div>\n <ScalarSearchResultList\n :id=\"listboxId\"\n aria-label=\"Reference Search Results\"\n class=\"custom-scroll px-1 pb-1\"\n :noResults=\"!results.length\">\n <template #query>\n {{ query }}\n </template>\n <SearchResult\n v-for=\"(result, idx) in results\"\n :id=\"`search-result-${result.item.id}`\"\n :key=\"result.refIndex\"\n :isSelected=\"selectedIndex === idx\"\n :result=\"result\"\n @click.prevent=\"() => handleSelect(idx)\" />\n </ScalarSearchResultList>\n <div\n :id=\"instructionsId\"\n class=\"ref-search-meta\">\n <span\n aria-hidden=\"true\"\n class=\"contents\">\n <span>↑↓ Navigate</span>\n <span>⏎ Select</span>\n </span>\n <span class=\"sr-only\">\n Press up arrow / down arrow to navigate, enter to select, type to filter\n results\n </span>\n </div>\n </ScalarModal>\n</template>\n<style scoped>\n.ref-search-meta {\n background: var(--scalar-background-1);\n border-bottom-left-radius: var(--scalar-radius-lg);\n border-bottom-right-radius: var(--scalar-radius-lg);\n padding: 6px 12px;\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-3);\n font-weight: var(--scalar-semibold);\n display: flex;\n gap: 12px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"SearchModal.vue.js","names":[],"sources":["../../../../src/features/Search/components/SearchModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\nimport { ScalarSearchInput } from '@scalar/components/search-input'\nimport { ScalarSearchResultList } from '@scalar/components/search-results'\nimport type { ModelsSectionLabel } from '@scalar/types/api-reference'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { nanoid } from 'nanoid'\nimport { computed, ref, watch } from 'vue'\n\nimport { useSearchIndex } from '@/features/Search/hooks/useSearchIndex'\n\nimport SearchResult from './SearchResult.vue'\n\nconst props = defineProps<{\n modalState: ModalState\n document: OpenApiDocument | AsyncApiDocument | undefined\n eventBus: WorkspaceEventBus\n modelsSectionLabel?: ModelsSectionLabel\n}>()\n\n/** Base id for the search form */\nconst id = nanoid()\n/** An id for the results listbox */\nconst listboxId = `${id}-search-result`\n/** An id for the results instructions */\nconst instructionsId = `${id}-search-instructions`\n\nconst { query, results } = useSearchIndex(\n () => props.document,\n () => props.modelsSectionLabel,\n)\n\nconst selectedIndex = ref<number | undefined>(undefined)\n\n/** Clear the query value when the modal is opened */\nwatch(\n () => props.modalState.open,\n (open) => {\n if (open) {\n query.value = ''\n }\n },\n)\n\n/** Keyboard navigation */\nconst navigateSearchResults = (direction: 'up' | 'down') => {\n const offset = direction === 'up' ? -1 : 1\n const length = results.value.length\n\n if (typeof selectedIndex.value === 'number') {\n // Ensures we loop around the array by using the remainder\n selectedIndex.value = (selectedIndex.value + offset + length) % length\n } else {\n // If no index is selected, we select the first or last item depending on the direction\n\n selectedIndex.value = offset === -1 ? length - 1 : 0\n }\n}\n\n/** Handle the selection of a search result */\nfunction handleSelect(idx: number | undefined) {\n if (typeof idx !== 'number' || !results.value[idx]) {\n return\n }\n\n const result = results.value[idx]\n props.modalState.hide()\n props.eventBus.emit('scroll-to:nav-item', { id: result.item.id })\n}\n\n/**\n * Active descendant id for the search input\n * NOTE: Result items MUST share this id for the aria-activedescendant attribute to work correctly\n */\nconst activeDescendantId = computed(() => {\n const selectedResult = results.value[selectedIndex.value ?? -1]\n\n return selectedResult ? `search-result-${selectedResult.item.id}` : undefined\n})\n</script>\n<template>\n <ScalarModal\n aria-label=\"Reference Search\"\n :state=\"modalState\"\n variant=\"search\">\n <div\n class=\"mb-0 flex flex-col\"\n role=\"search\">\n <ScalarSearchInput\n v-model=\"query\"\n :aria-activedescendant=\"activeDescendantId\"\n aria-autocomplete=\"list\"\n :aria-controls=\"listboxId\"\n :aria-describedby=\"instructionsId\"\n role=\"combobox\"\n @blur=\"selectedIndex = undefined\"\n @keydown.down.stop.prevent=\"navigateSearchResults('down')\"\n @keydown.enter.stop.prevent=\"() => handleSelect(selectedIndex)\"\n @keydown.up.stop.prevent=\"navigateSearchResults('up')\" />\n </div>\n <ScalarSearchResultList\n :id=\"listboxId\"\n aria-label=\"Reference Search Results\"\n class=\"custom-scroll px-1 pb-1\"\n :noResults=\"!results.length\">\n <template #query>\n {{ query }}\n </template>\n <SearchResult\n v-for=\"(result, idx) in results\"\n :id=\"`search-result-${result.item.id}`\"\n :key=\"result.refIndex\"\n :isSelected=\"selectedIndex === idx\"\n :modelsSectionLabel=\"props.modelsSectionLabel\"\n :result=\"result\"\n @click.prevent=\"() => handleSelect(idx)\" />\n </ScalarSearchResultList>\n <div\n :id=\"instructionsId\"\n class=\"ref-search-meta\">\n <span\n aria-hidden=\"true\"\n class=\"contents\">\n <span>↑↓ Navigate</span>\n <span>⏎ Select</span>\n </span>\n <span class=\"sr-only\">\n Press up arrow / down arrow to navigate, enter to select, type to filter\n results\n </span>\n </div>\n </ScalarModal>\n</template>\n<style scoped>\n.ref-search-meta {\n background: var(--scalar-background-1);\n border-bottom-left-radius: var(--scalar-radius-lg);\n border-bottom-right-radius: var(--scalar-radius-lg);\n padding: 6px 12px;\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-3);\n font-weight: var(--scalar-semibold);\n display: flex;\n gap: 12px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n</style>\n"],"mappings":""}
@@ -15,7 +15,8 @@ var SearchModal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
15
15
  props: {
16
16
  modalState: {},
17
17
  document: {},
18
- eventBus: {}
18
+ eventBus: {},
19
+ modelsSectionLabel: {}
19
20
  },
20
21
  setup(__props) {
21
22
  const props = __props;
@@ -25,7 +26,7 @@ var SearchModal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
25
26
  const listboxId = `${id}-search-result`;
26
27
  /** An id for the results instructions */
27
28
  const instructionsId = `${id}-search-instructions`;
28
- const { query, results } = useSearchIndex(() => props.document);
29
+ const { query, results } = useSearchIndex(() => props.document, () => props.modelsSectionLabel);
29
30
  const selectedIndex = ref(void 0);
30
31
  /** Clear the query value when the modal is opened */
31
32
  watch(() => props.modalState.open, (open) => {
@@ -87,11 +88,13 @@ var SearchModal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
87
88
  id: `search-result-${result.item.id}`,
88
89
  key: result.refIndex,
89
90
  isSelected: selectedIndex.value === idx,
91
+ modelsSectionLabel: props.modelsSectionLabel,
90
92
  result,
91
93
  onClick: withModifiers(() => handleSelect(idx), ["prevent"])
92
94
  }, null, 8, [
93
95
  "id",
94
96
  "isSelected",
97
+ "modelsSectionLabel",
95
98
  "result",
96
99
  "onClick"
97
100
  ]);
@@ -1 +1 @@
1
- {"version":3,"file":"SearchModal.vue.script.js","names":[],"sources":["../../../../src/features/Search/components/SearchModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\nimport { ScalarSearchInput } from '@scalar/components/search-input'\nimport { ScalarSearchResultList } from '@scalar/components/search-results'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { nanoid } from 'nanoid'\nimport { computed, ref, watch } from 'vue'\n\nimport { useSearchIndex } from '@/features/Search/hooks/useSearchIndex'\n\nimport SearchResult from './SearchResult.vue'\n\nconst props = defineProps<{\n modalState: ModalState\n document: OpenApiDocument | undefined\n eventBus: WorkspaceEventBus\n}>()\n\n/** Base id for the search form */\nconst id = nanoid()\n/** An id for the results listbox */\nconst listboxId = `${id}-search-result`\n/** An id for the results instructions */\nconst instructionsId = `${id}-search-instructions`\n\nconst { query, results } = useSearchIndex(() => props.document)\n\nconst selectedIndex = ref<number | undefined>(undefined)\n\n/** Clear the query value when the modal is opened */\nwatch(\n () => props.modalState.open,\n (open) => {\n if (open) {\n query.value = ''\n }\n },\n)\n\n/** Keyboard navigation */\nconst navigateSearchResults = (direction: 'up' | 'down') => {\n const offset = direction === 'up' ? -1 : 1\n const length = results.value.length\n\n if (typeof selectedIndex.value === 'number') {\n // Ensures we loop around the array by using the remainder\n selectedIndex.value = (selectedIndex.value + offset + length) % length\n } else {\n // If no index is selected, we select the first or last item depending on the direction\n\n selectedIndex.value = offset === -1 ? length - 1 : 0\n }\n}\n\n/** Handle the selection of a search result */\nfunction handleSelect(idx: number | undefined) {\n if (typeof idx !== 'number' || !results.value[idx]) {\n return\n }\n\n const result = results.value[idx]\n props.modalState.hide()\n props.eventBus.emit('scroll-to:nav-item', { id: result.item.id })\n}\n\n/**\n * Active descendant id for the search input\n * NOTE: Result items MUST share this id for the aria-activedescendant attribute to work correctly\n */\nconst activeDescendantId = computed(() => {\n const selectedResult = results.value[selectedIndex.value ?? -1]\n\n return selectedResult ? `search-result-${selectedResult.item.id}` : undefined\n})\n</script>\n<template>\n <ScalarModal\n aria-label=\"Reference Search\"\n :state=\"modalState\"\n variant=\"search\">\n <div\n class=\"mb-0 flex flex-col\"\n role=\"search\">\n <ScalarSearchInput\n v-model=\"query\"\n :aria-activedescendant=\"activeDescendantId\"\n aria-autocomplete=\"list\"\n :aria-controls=\"listboxId\"\n :aria-describedby=\"instructionsId\"\n role=\"combobox\"\n @blur=\"selectedIndex = undefined\"\n @keydown.down.stop.prevent=\"navigateSearchResults('down')\"\n @keydown.enter.stop.prevent=\"() => handleSelect(selectedIndex)\"\n @keydown.up.stop.prevent=\"navigateSearchResults('up')\" />\n </div>\n <ScalarSearchResultList\n :id=\"listboxId\"\n aria-label=\"Reference Search Results\"\n class=\"custom-scroll px-1 pb-1\"\n :noResults=\"!results.length\">\n <template #query>\n {{ query }}\n </template>\n <SearchResult\n v-for=\"(result, idx) in results\"\n :id=\"`search-result-${result.item.id}`\"\n :key=\"result.refIndex\"\n :isSelected=\"selectedIndex === idx\"\n :result=\"result\"\n @click.prevent=\"() => handleSelect(idx)\" />\n </ScalarSearchResultList>\n <div\n :id=\"instructionsId\"\n class=\"ref-search-meta\">\n <span\n aria-hidden=\"true\"\n class=\"contents\">\n <span>↑↓ Navigate</span>\n <span>⏎ Select</span>\n </span>\n <span class=\"sr-only\">\n Press up arrow / down arrow to navigate, enter to select, type to filter\n results\n </span>\n </div>\n </ScalarModal>\n</template>\n<style scoped>\n.ref-search-meta {\n background: var(--scalar-background-1);\n border-bottom-left-radius: var(--scalar-radius-lg);\n border-bottom-right-radius: var(--scalar-radius-lg);\n padding: 6px 12px;\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-3);\n font-weight: var(--scalar-semibold);\n display: flex;\n gap: 12px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAaA,MAAM,QAAQ;;EAOd,MAAM,KAAK,QAAO;;EAElB,MAAM,YAAY,GAAG,GAAG;;EAExB,MAAM,iBAAiB,GAAG,GAAG;EAE7B,MAAM,EAAE,OAAO,YAAY,qBAAqB,MAAM,SAAQ;EAE9D,MAAM,gBAAgB,IAAwB,KAAA,EAAS;;AAGvD,cACQ,MAAM,WAAW,OACtB,SAAS;AACR,OAAI,KACF,OAAM,QAAQ;IAGpB;;EAGA,MAAM,yBAAyB,cAA6B;GAC1D,MAAM,SAAS,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MAAK,CAAA,EAAA,EAAA,CAAA,CAAA;6BAGwB,EAAA,UAAA,KAAA,EADlC,mBAM6C,UAAA,MAAA,WALnB,MAAA,QAAO,GAAvB,QAAQ,QAAG;2BADrB,YAM6C,sBAAA;QAJ1C,IAAE,iBAAmB,OAAO,KAAK;QACjC,KAAK,OAAO;QACZ,YAAY,cAAA,UAAkB;QACtB;QACR,SAAK,oBAAgB,aAAa,IAAG,EAAA,CAAA,UAAA,CAAA;;;;;;;;;;KAE1C,mBAaM,OAAA;MAZH,IAAI;MACL,OAAM;uCACN,mBAKO,QAAA;MAJL,eAAY;MACZ,OAAM;SACN,mBAAwB,QAAA,MAAlB,cAAW,EACjB,mBAAqB,QAAA,MAAf,WAAQ,CAAA,EAAA,GAAA,EAEhB,mBAGO,QAAA,EAHD,OAAM,WAAS,EAAC,sFAGtB,GAAA,CAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"SearchModal.vue.script.js","names":[],"sources":["../../../../src/features/Search/components/SearchModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarModal, type ModalState } from '@scalar/components/modal'\nimport { ScalarSearchInput } from '@scalar/components/search-input'\nimport { ScalarSearchResultList } from '@scalar/components/search-results'\nimport type { ModelsSectionLabel } from '@scalar/types/api-reference'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { nanoid } from 'nanoid'\nimport { computed, ref, watch } from 'vue'\n\nimport { useSearchIndex } from '@/features/Search/hooks/useSearchIndex'\n\nimport SearchResult from './SearchResult.vue'\n\nconst props = defineProps<{\n modalState: ModalState\n document: OpenApiDocument | AsyncApiDocument | undefined\n eventBus: WorkspaceEventBus\n modelsSectionLabel?: ModelsSectionLabel\n}>()\n\n/** Base id for the search form */\nconst id = nanoid()\n/** An id for the results listbox */\nconst listboxId = `${id}-search-result`\n/** An id for the results instructions */\nconst instructionsId = `${id}-search-instructions`\n\nconst { query, results } = useSearchIndex(\n () => props.document,\n () => props.modelsSectionLabel,\n)\n\nconst selectedIndex = ref<number | undefined>(undefined)\n\n/** Clear the query value when the modal is opened */\nwatch(\n () => props.modalState.open,\n (open) => {\n if (open) {\n query.value = ''\n }\n },\n)\n\n/** Keyboard navigation */\nconst navigateSearchResults = (direction: 'up' | 'down') => {\n const offset = direction === 'up' ? -1 : 1\n const length = results.value.length\n\n if (typeof selectedIndex.value === 'number') {\n // Ensures we loop around the array by using the remainder\n selectedIndex.value = (selectedIndex.value + offset + length) % length\n } else {\n // If no index is selected, we select the first or last item depending on the direction\n\n selectedIndex.value = offset === -1 ? length - 1 : 0\n }\n}\n\n/** Handle the selection of a search result */\nfunction handleSelect(idx: number | undefined) {\n if (typeof idx !== 'number' || !results.value[idx]) {\n return\n }\n\n const result = results.value[idx]\n props.modalState.hide()\n props.eventBus.emit('scroll-to:nav-item', { id: result.item.id })\n}\n\n/**\n * Active descendant id for the search input\n * NOTE: Result items MUST share this id for the aria-activedescendant attribute to work correctly\n */\nconst activeDescendantId = computed(() => {\n const selectedResult = results.value[selectedIndex.value ?? -1]\n\n return selectedResult ? `search-result-${selectedResult.item.id}` : undefined\n})\n</script>\n<template>\n <ScalarModal\n aria-label=\"Reference Search\"\n :state=\"modalState\"\n variant=\"search\">\n <div\n class=\"mb-0 flex flex-col\"\n role=\"search\">\n <ScalarSearchInput\n v-model=\"query\"\n :aria-activedescendant=\"activeDescendantId\"\n aria-autocomplete=\"list\"\n :aria-controls=\"listboxId\"\n :aria-describedby=\"instructionsId\"\n role=\"combobox\"\n @blur=\"selectedIndex = undefined\"\n @keydown.down.stop.prevent=\"navigateSearchResults('down')\"\n @keydown.enter.stop.prevent=\"() => handleSelect(selectedIndex)\"\n @keydown.up.stop.prevent=\"navigateSearchResults('up')\" />\n </div>\n <ScalarSearchResultList\n :id=\"listboxId\"\n aria-label=\"Reference Search Results\"\n class=\"custom-scroll px-1 pb-1\"\n :noResults=\"!results.length\">\n <template #query>\n {{ query }}\n </template>\n <SearchResult\n v-for=\"(result, idx) in results\"\n :id=\"`search-result-${result.item.id}`\"\n :key=\"result.refIndex\"\n :isSelected=\"selectedIndex === idx\"\n :modelsSectionLabel=\"props.modelsSectionLabel\"\n :result=\"result\"\n @click.prevent=\"() => handleSelect(idx)\" />\n </ScalarSearchResultList>\n <div\n :id=\"instructionsId\"\n class=\"ref-search-meta\">\n <span\n aria-hidden=\"true\"\n class=\"contents\">\n <span>↑↓ Navigate</span>\n <span>⏎ Select</span>\n </span>\n <span class=\"sr-only\">\n Press up arrow / down arrow to navigate, enter to select, type to filter\n results\n </span>\n </div>\n </ScalarModal>\n</template>\n<style scoped>\n.ref-search-meta {\n background: var(--scalar-background-1);\n border-bottom-left-radius: var(--scalar-radius-lg);\n border-bottom-right-radius: var(--scalar-radius-lg);\n padding: 6px 12px;\n font-size: var(--scalar-font-size-4);\n color: var(--scalar-color-3);\n font-weight: var(--scalar-semibold);\n display: flex;\n gap: 12px;\n border-top: var(--scalar-border-width) solid var(--scalar-border-color);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,QAAQ;;EAQd,MAAM,KAAK,QAAO;;EAElB,MAAM,YAAY,GAAG,GAAG;;EAExB,MAAM,iBAAiB,GAAG,GAAG;EAE7B,MAAM,EAAE,OAAO,YAAY,qBACnB,MAAM,gBACN,MAAM,mBACd;EAEA,MAAM,gBAAgB,IAAwB,KAAA,EAAS;;AAGvD,cACQ,MAAM,WAAW,OACtB,SAAS;AACR,OAAI,KACF,OAAM,QAAQ;IAGpB;;EAGA,MAAM,yBAAyB,cAA6B;GAC1D,MAAM,SAAS,cAAc,OAAO,KAAK;GACzC,MAAM,SAAS,QAAQ,MAAM;AAE7B,OAAI,OAAO,cAAc,UAAU,SAEjC,eAAc,SAAS,cAAc,QAAQ,SAAS,UAAU;OAIhE,eAAc,QAAQ,WAAW,KAAK,SAAS,IAAI;;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AAO,KAAK;QACjC,KAAK,OAAO;QACZ,YAAY,cAAA,UAAkB;QAC9B,oBAAoB,MAAM;QAClB;QACR,SAAK,oBAAgB,aAAa,IAAG,EAAA,CAAA,UAAA,CAAA;;;;;;;;;;;KAE1C,mBAaM,OAAA;MAZH,IAAI;MACL,OAAM;uCACN,mBAKO,QAAA;MAJL,eAAY;MACZ,OAAM;SACN,mBAAwB,QAAA,MAAlB,cAAW,EACjB,mBAAqB,QAAA,MAAf,WAAQ,CAAA,EAAA,GAAA,EAEhB,mBAGO,QAAA,EAHD,OAAM,WAAS,EAAC,sFAGtB,GAAA,CAAA,EAAA,CAAA"}
@@ -1,9 +1,11 @@
1
+ import { type ModelsSectionLabel } from '@scalar/types/api-reference';
1
2
  import type { FuseResult } from 'fuse.js';
2
3
  import type { FuseData } from '../../../features/Search/types';
3
4
  type __VLS_Props = {
4
5
  id: string;
5
6
  isSelected: boolean;
6
7
  result: FuseResult<FuseData>;
8
+ modelsSectionLabel?: ModelsSectionLabel;
7
9
  };
8
10
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
11
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchResult.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/components/SearchResult.vue"],"names":[],"mappings":"AAqGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,OAAO,KAAK,EAAa,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAElE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,OAAO,CAAA;IACnB,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;CAC7B,CAAC;AAqIF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SearchResult.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/components/SearchResult.vue"],"names":[],"mappings":"AA2GA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGzC,OAAO,KAAK,EAAa,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAElE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,OAAO,CAAA;IACnB,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;IAC5B,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;CACxC,CAAC;AAsIF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchResult.vue.js","names":[],"sources":["../../../../src/features/Search/components/SearchResult.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarSearchResultItem } from '@scalar/components/search-results'\nimport {\n ScalarIconBracketsCurly,\n ScalarIconTag,\n ScalarIconTerminalWindow,\n ScalarIconTextAlignLeft,\n} from '@scalar/icons'\nimport type { ScalarIconComponent } from '@scalar/icons/types'\nimport { HttpMethod } from '@scalar/sidebar'\nimport type { FuseResult } from 'fuse.js'\n\nimport type { EntryType, FuseData } from '@/features/Search/types'\n\ndefineProps<{\n id: string\n isSelected: boolean\n result: FuseResult<FuseData>\n}>()\n\nconst ENTRY_ICONS: { [x in EntryType]: ScalarIconComponent } = {\n heading: ScalarIconTextAlignLeft,\n model: ScalarIconBracketsCurly,\n operation: ScalarIconTerminalWindow,\n tag: ScalarIconTag,\n webhook: ScalarIconTerminalWindow,\n}\n\nconst ENTRY_LABELS: { [x in EntryType]: string } = {\n heading: 'Heading',\n operation: 'Operation',\n tag: 'Tag',\n model: 'Model',\n webhook: 'Webhook',\n}\n</script>\n\n<template>\n <ScalarSearchResultItem\n :id=\"id\"\n :icon=\"ENTRY_ICONS[result.item.type]\"\n :selected=\"isSelected\">\n <span\n :class=\"{\n 'text-decoration-line':\n result.item.entry.type === 'operation' &&\n result.item.entry.isDeprecated,\n }\">\n <span class=\"sr-only\">\n {{ ENTRY_LABELS[result.item.type] }}:&nbsp;\n <template\n v-if=\"\n result.item.entry.type === 'operation' &&\n result.item.entry.isDeprecated\n \">\n (Deprecated)&nbsp;\n </template>\n </span>\n {{ result.item.title }}\n <span class=\"sr-only\">,</span>\n </span>\n <template\n v-if=\"\n result.item.type !== 'webhook' &&\n (result.item.method || result.item.path) &&\n result.item.path !== result.item.title\n \"\n #description>\n <span class=\"inline-flex items-center gap-1\">\n <template v-if=\"result.item.type === 'operation'\">\n <HttpMethod\n aria-hidden=\"true\"\n :method=\"result.item.method ?? 'get'\" />\n <span class=\"sr-only\">\n HTTP Method: {{ result.item.method ?? 'get' }}\n </span>\n </template>\n <span class=\"sr-only\">Path:&nbsp;</span>\n {{ result.item.path }}\n </span>\n </template>\n <template\n v-else-if=\"result.item.description\"\n #description>\n <span class=\"sr-only\">Description:&nbsp;</span>\n {{ result.item.description }}\n </template>\n </ScalarSearchResultItem>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SearchResult.vue.js","names":[],"sources":["../../../../src/features/Search/components/SearchResult.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarSearchResultItem } from '@scalar/components/search-results'\nimport {\n ScalarIconBracketsCurly,\n ScalarIconTag,\n ScalarIconTerminalWindow,\n ScalarIconTextAlignLeft,\n} from '@scalar/icons'\nimport type { ScalarIconComponent } from '@scalar/icons/types'\nimport { HttpMethod } from '@scalar/sidebar'\nimport {\n DEFAULT_MODELS_SECTION_LABEL,\n type ModelsSectionLabel,\n} from '@scalar/types/api-reference'\nimport type { FuseResult } from 'fuse.js'\nimport { computed } from 'vue'\n\nimport type { EntryType, FuseData } from '@/features/Search/types'\n\nconst { modelsSectionLabel = DEFAULT_MODELS_SECTION_LABEL } = defineProps<{\n id: string\n isSelected: boolean\n result: FuseResult<FuseData>\n modelsSectionLabel?: ModelsSectionLabel\n}>()\n\nconst ENTRY_ICONS: { [x in EntryType]: ScalarIconComponent } = {\n heading: ScalarIconTextAlignLeft,\n model: ScalarIconBracketsCurly,\n operation: ScalarIconTerminalWindow,\n tag: ScalarIconTag,\n webhook: ScalarIconTerminalWindow,\n}\n\nconst entryLabels = computed((): { [x in EntryType]: string } => ({\n heading: 'Heading',\n operation: 'Operation',\n tag: 'Tag',\n model: modelsSectionLabel,\n webhook: 'Webhook',\n}))\n</script>\n\n<template>\n <ScalarSearchResultItem\n :id=\"id\"\n :icon=\"ENTRY_ICONS[result.item.type]\"\n :selected=\"isSelected\">\n <span\n :class=\"{\n 'text-decoration-line':\n result.item.entry.type === 'operation' &&\n result.item.entry.isDeprecated,\n }\">\n <span class=\"sr-only\">\n {{ entryLabels[result.item.type] }}:&nbsp;\n <template\n v-if=\"\n result.item.entry.type === 'operation' &&\n result.item.entry.isDeprecated\n \">\n (Deprecated)&nbsp;\n </template>\n </span>\n {{ result.item.title }}\n <span class=\"sr-only\">,</span>\n </span>\n <template\n v-if=\"\n result.item.type !== 'webhook' &&\n (result.item.method || result.item.path) &&\n result.item.path !== result.item.title\n \"\n #description>\n <span class=\"inline-flex items-center gap-1\">\n <template v-if=\"result.item.type === 'operation'\">\n <HttpMethod\n aria-hidden=\"true\"\n :method=\"result.item.method ?? 'get'\" />\n <span class=\"sr-only\">\n HTTP Method: {{ result.item.method ?? 'get' }}\n </span>\n </template>\n <span class=\"sr-only\">Path:&nbsp;</span>\n {{ result.item.path }}\n </span>\n </template>\n <template\n v-else-if=\"result.item.description\"\n #description>\n <span class=\"sr-only\">Description:&nbsp;</span>\n {{ result.item.description }}\n </template>\n </ScalarSearchResultItem>\n</template>\n"],"mappings":""}
@@ -1,5 +1,6 @@
1
- import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, withCtx } from "vue";
1
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, withCtx } from "vue";
2
2
  import { HttpMethod } from "@scalar/sidebar";
3
+ import { DEFAULT_MODELS_SECTION_LABEL } from "@scalar/types/api-reference";
3
4
  import { ScalarIconBracketsCurly, ScalarIconTag, ScalarIconTerminalWindow, ScalarIconTextAlignLeft } from "@scalar/icons";
4
5
  import { ScalarSearchResultItem } from "@scalar/components/search-results";
5
6
  //#region src/features/Search/components/SearchResult.vue?vue&type=script&setup=true&lang.ts
@@ -11,7 +12,8 @@ var SearchResult_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
11
12
  props: {
12
13
  id: {},
13
14
  isSelected: { type: Boolean },
14
- result: {}
15
+ result: {},
16
+ modelsSectionLabel: { default: () => DEFAULT_MODELS_SECTION_LABEL }
15
17
  },
16
18
  setup(__props) {
17
19
  const ENTRY_ICONS = {
@@ -21,13 +23,13 @@ var SearchResult_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
21
23
  tag: ScalarIconTag,
22
24
  webhook: ScalarIconTerminalWindow
23
25
  };
24
- const ENTRY_LABELS = {
26
+ const entryLabels = computed(() => ({
25
27
  heading: "Heading",
26
28
  operation: "Operation",
27
29
  tag: "Tag",
28
- model: "Model",
30
+ model: __props.modelsSectionLabel,
29
31
  webhook: "Webhook"
30
- };
32
+ }));
31
33
  return (_ctx, _cache) => {
32
34
  return openBlock(), createBlock(unref(ScalarSearchResultItem), {
33
35
  id: __props.id,
@@ -35,7 +37,7 @@ var SearchResult_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
35
37
  selected: __props.isSelected
36
38
  }, createSlots({
37
39
  default: withCtx(() => [createElementVNode("span", { class: normalizeClass({ "text-decoration-line": __props.result.item.entry.type === "operation" && __props.result.item.entry.isDeprecated }) }, [
38
- createElementVNode("span", _hoisted_1, [createTextVNode(toDisplayString(ENTRY_LABELS[__props.result.item.type]) + ":\xA0 ", 1), __props.result.item.entry.type === "operation" && __props.result.item.entry.isDeprecated ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" (Deprecated)\xA0 ")], 64)) : createCommentVNode("", true)]),
40
+ createElementVNode("span", _hoisted_1, [createTextVNode(toDisplayString(entryLabels.value[__props.result.item.type]) + ":\xA0 ", 1), __props.result.item.entry.type === "operation" && __props.result.item.entry.isDeprecated ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" (Deprecated)\xA0 ")], 64)) : createCommentVNode("", true)]),
39
41
  createTextVNode(" " + toDisplayString(__props.result.item.title) + " ", 1),
40
42
  _cache[0] || (_cache[0] = createElementVNode("span", { class: "sr-only" }, ",", -1))
41
43
  ], 2)]),
@@ -1 +1 @@
1
- {"version":3,"file":"SearchResult.vue.script.js","names":[],"sources":["../../../../src/features/Search/components/SearchResult.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarSearchResultItem } from '@scalar/components/search-results'\nimport {\n ScalarIconBracketsCurly,\n ScalarIconTag,\n ScalarIconTerminalWindow,\n ScalarIconTextAlignLeft,\n} from '@scalar/icons'\nimport type { ScalarIconComponent } from '@scalar/icons/types'\nimport { HttpMethod } from '@scalar/sidebar'\nimport type { FuseResult } from 'fuse.js'\n\nimport type { EntryType, FuseData } from '@/features/Search/types'\n\ndefineProps<{\n id: string\n isSelected: boolean\n result: FuseResult<FuseData>\n}>()\n\nconst ENTRY_ICONS: { [x in EntryType]: ScalarIconComponent } = {\n heading: ScalarIconTextAlignLeft,\n model: ScalarIconBracketsCurly,\n operation: ScalarIconTerminalWindow,\n tag: ScalarIconTag,\n webhook: ScalarIconTerminalWindow,\n}\n\nconst ENTRY_LABELS: { [x in EntryType]: string } = {\n heading: 'Heading',\n operation: 'Operation',\n tag: 'Tag',\n model: 'Model',\n webhook: 'Webhook',\n}\n</script>\n\n<template>\n <ScalarSearchResultItem\n :id=\"id\"\n :icon=\"ENTRY_ICONS[result.item.type]\"\n :selected=\"isSelected\">\n <span\n :class=\"{\n 'text-decoration-line':\n result.item.entry.type === 'operation' &&\n result.item.entry.isDeprecated,\n }\">\n <span class=\"sr-only\">\n {{ ENTRY_LABELS[result.item.type] }}:&nbsp;\n <template\n v-if=\"\n result.item.entry.type === 'operation' &&\n result.item.entry.isDeprecated\n \">\n (Deprecated)&nbsp;\n </template>\n </span>\n {{ result.item.title }}\n <span class=\"sr-only\">,</span>\n </span>\n <template\n v-if=\"\n result.item.type !== 'webhook' &&\n (result.item.method || result.item.path) &&\n result.item.path !== result.item.title\n \"\n #description>\n <span class=\"inline-flex items-center gap-1\">\n <template v-if=\"result.item.type === 'operation'\">\n <HttpMethod\n aria-hidden=\"true\"\n :method=\"result.item.method ?? 'get'\" />\n <span class=\"sr-only\">\n HTTP Method: {{ result.item.method ?? 'get' }}\n </span>\n </template>\n <span class=\"sr-only\">Path:&nbsp;</span>\n {{ result.item.path }}\n </span>\n </template>\n <template\n v-else-if=\"result.item.description\"\n #description>\n <span class=\"sr-only\">Description:&nbsp;</span>\n {{ result.item.description }}\n </template>\n </ScalarSearchResultItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAoBA,MAAM,cAAyD;GAC7D,SAAS;GACT,OAAO;GACP,WAAW;GACX,KAAK;GACL,SAAS;GACX;EAEA,MAAM,eAA6C;GACjD,SAAS;GACT,WAAW;GACX,KAAK;GACL,OAAO;GACP,SAAS;GACX;;uBAIE,YAiDyB,MAAA,uBAAA,EAAA;IAhDtB,IAAI,QAAA;IACJ,MAAM,YAAY,QAAA,OAAO,KAAK;IAC9B,UAAU,QAAA;;2BAmBJ,CAlBP,mBAkBO,QAAA,EAjBJ,OAAK,eAAA,EAAA,wBAA8C,QAAA,OAAO,KAAK,MAAM,SAAI,eAA8B,QAAA,OAAO,KA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,CAAA"}
1
+ {"version":3,"file":"SearchResult.vue.script.js","names":[],"sources":["../../../../src/features/Search/components/SearchResult.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarSearchResultItem } from '@scalar/components/search-results'\nimport {\n ScalarIconBracketsCurly,\n ScalarIconTag,\n ScalarIconTerminalWindow,\n ScalarIconTextAlignLeft,\n} from '@scalar/icons'\nimport type { ScalarIconComponent } from '@scalar/icons/types'\nimport { HttpMethod } from '@scalar/sidebar'\nimport {\n DEFAULT_MODELS_SECTION_LABEL,\n type ModelsSectionLabel,\n} from '@scalar/types/api-reference'\nimport type { FuseResult } from 'fuse.js'\nimport { computed } from 'vue'\n\nimport type { EntryType, FuseData } from '@/features/Search/types'\n\nconst { modelsSectionLabel = DEFAULT_MODELS_SECTION_LABEL } = defineProps<{\n id: string\n isSelected: boolean\n result: FuseResult<FuseData>\n modelsSectionLabel?: ModelsSectionLabel\n}>()\n\nconst ENTRY_ICONS: { [x in EntryType]: ScalarIconComponent } = {\n heading: ScalarIconTextAlignLeft,\n model: ScalarIconBracketsCurly,\n operation: ScalarIconTerminalWindow,\n tag: ScalarIconTag,\n webhook: ScalarIconTerminalWindow,\n}\n\nconst entryLabels = computed((): { [x in EntryType]: string } => ({\n heading: 'Heading',\n operation: 'Operation',\n tag: 'Tag',\n model: modelsSectionLabel,\n webhook: 'Webhook',\n}))\n</script>\n\n<template>\n <ScalarSearchResultItem\n :id=\"id\"\n :icon=\"ENTRY_ICONS[result.item.type]\"\n :selected=\"isSelected\">\n <span\n :class=\"{\n 'text-decoration-line':\n result.item.entry.type === 'operation' &&\n result.item.entry.isDeprecated,\n }\">\n <span class=\"sr-only\">\n {{ entryLabels[result.item.type] }}:&nbsp;\n <template\n v-if=\"\n result.item.entry.type === 'operation' &&\n result.item.entry.isDeprecated\n \">\n (Deprecated)&nbsp;\n </template>\n </span>\n {{ result.item.title }}\n <span class=\"sr-only\">,</span>\n </span>\n <template\n v-if=\"\n result.item.type !== 'webhook' &&\n (result.item.method || result.item.path) &&\n result.item.path !== result.item.title\n \"\n #description>\n <span class=\"inline-flex items-center gap-1\">\n <template v-if=\"result.item.type === 'operation'\">\n <HttpMethod\n aria-hidden=\"true\"\n :method=\"result.item.method ?? 'get'\" />\n <span class=\"sr-only\">\n HTTP Method: {{ result.item.method ?? 'get' }}\n </span>\n </template>\n <span class=\"sr-only\">Path:&nbsp;</span>\n {{ result.item.path }}\n </span>\n </template>\n <template\n v-else-if=\"result.item.description\"\n #description>\n <span class=\"sr-only\">Description:&nbsp;</span>\n {{ result.item.description }}\n </template>\n </ScalarSearchResultItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EA0BA,MAAM,cAAyD;GAC7D,SAAS;GACT,OAAO;GACP,WAAW;GACX,KAAK;GACL,SAAS;GACX;EAEA,MAAM,cAAc,gBAA8C;GAChE,SAAS;GACT,WAAW;GACX,KAAK;GACL,OAAO,QAAA;GACP,SAAS;GACV,EAAC;;uBAIA,YAiDyB,MAAA,uBAAA,EAAA;IAhDtB,IAAI,QAAA;IACJ,MAAM,YAAY,QAAA,OAAO,KAAK;IAC9B,UAAU,QAAA;;2BAmBJ,CAlBP,mBAkBO,QAAA,EAjBJ,OAAK,eAAA,EAAA,wBAA8C,QAAA,OAAO,KAAK,MAAM,SAAI,eAA8B,QAAA,OAAO,KAAK,MAAM,cAAA,CAAA,EAAA,EAAA;KAK1H,mBASO,QATP,YASO,CAAA,gBAAA,gBARF,YAAA,MAAY,QAAA,OAAO,KAAK,MAAI,GAAI,UACnC,EAAA,EACqB,QAAA,OAAO,KAAK,MAAM,SAAI,eAAgC,QAAA,OAAO,KAAK,MAAM,gBAAA,WAAA,EAD7F,mBAMW,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAFP,qBAEJ,CAAA,EAAA,GAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA;qBACK,MACP,gBAAG,QAAA,OAAO,KAAK,MAAK,GAAG,KACvB,EAAA;+BAAA,mBAA8B,QAAA,EAAxB,OAAM,WAAS,EAAC,KAAC,GAAA;;;OAGR,QAAA,OAAO,KAAK,SAAI,cAA2B,QAAA,OAAO,KAAK,UAAU,QAAA,OAAO,KAAK,SAAiB,QAAA,OAAO,KAAK,SAAS,QAAA,OAAO,KAAK,QAAA;UAK7I;sBAYM,CAXP,mBAWO,QAXP,YAWO;KAVW,QAAA,OAAO,KAAK,SAAI,eAAA,WAAA,EAAhC,mBAOW,UAAA,EAAA,KAAA,GAAA,EAAA,CANT,YAE0C,MAAA,WAAA,EAAA;MADxC,eAAY;MACX,QAAQ,QAAA,OAAO,KAAK,UAAM;8BAC7B,mBAEO,QAFP,YAAsB,mBACP,gBAAG,QAAA,OAAO,KAAK,UAAM,MAAA,EAAA,EAAA,CAAA,EAAA,GAAA,IAAA,mBAAA,IAAA,KAAA;+BAGtC,mBAAwC,QAAA,EAAlC,OAAM,WAAS,EAAC,aAAW,GAAA;qBAAO,MACxC,gBAAG,QAAA,OAAO,KAAK,KAAI,EAAA,EAAA;;;OAIV,QAAA,OAAO,KAAK,cAAA;UACtB;sBAC8C,CAAA,OAAA,OAAA,OAAA,KAA/C,mBAA+C,QAAA,EAAzC,OAAM,WAAS,EAAC,oBAAkB,GAAA,GAAA,gBAAO,MAC/C,gBAAG,QAAA,OAAO,KAAK,YAAW,EAAA,EAAA,CAAA,CAAA"}
@@ -1,7 +1,15 @@
1
+ import { type ModelsSectionLabel } from '@scalar/types/api-reference';
2
+ import type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1';
1
3
  import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
4
  import type { FuseData } from '../../../features/Search/types';
5
+ /** Documents the search index can ingest. AsyncAPI is supported for headings, tags, and models; channels/operations/messages are not indexed yet. */
6
+ type SearchableDocument = OpenApiDocument | AsyncApiDocument;
7
+ type CreateSearchIndexOptions = {
8
+ modelsSectionLabel?: ModelsSectionLabel;
9
+ };
3
10
  /**
4
11
  * Create a search index from a list of entries.
5
12
  */
6
- export declare function createSearchIndex(document: OpenApiDocument | undefined): FuseData[];
13
+ export declare function createSearchIndex(document: SearchableDocument | undefined, options?: CreateSearchIndexOptions): FuseData[];
14
+ export {};
7
15
  //# sourceMappingURL=create-search-index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-search-index.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/helpers/create-search-index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,eAAe,EAGhB,MAAM,8DAA8D,CAAA;AAErE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAiEvD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,GAAG,QAAQ,EAAE,CAoBnF"}
1
+ {"version":3,"file":"create-search-index.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/helpers/create-search-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AACnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAKlE,OAAO,KAAK,EAEV,eAAe,EAIhB,MAAM,8DAA8D,CAAA;AAErE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAWvD,qJAAqJ;AACrJ,KAAK,kBAAkB,GAAG,eAAe,GAAG,gBAAgB,CAAA;AA4E5D,KAAK,wBAAwB,GAAG;IAC9B,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;CACxC,CAAA;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,kBAAkB,GAAG,SAAS,EACxC,OAAO,CAAC,EAAE,wBAAwB,GACjC,QAAQ,EAAE,CAqBZ"}
@@ -1,7 +1,21 @@
1
+ import { getAsyncApiModelSchema } from "../../../helpers/get-async-api-model-schema.js";
1
2
  import { extractBodyDescriptions, extractBodyFieldNames, extractParameterDescriptions, extractParameterNames, extractSchemaDescriptions, extractSchemaFieldNames } from "../../../helpers/openapi.js";
3
+ import { DEFAULT_MODELS_SECTION_LABEL } from "@scalar/types/api-reference";
2
4
  import { combineParams } from "@scalar/workspace-store/request-example";
5
+ import { isAsyncApiDocument, isOpenApiDocument } from "@scalar/workspace-store/schemas/type-guards";
3
6
  import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
7
  //#region src/features/Search/helpers/create-search-index.ts
8
+ /**
9
+ * Resolves a schema from `components.schemas` for either document type.
10
+ *
11
+ * OpenAPI and AsyncAPI keep reusable schemas in the same place, so model search entries can read
12
+ * property names and descriptions from both. AsyncAPI entries need extra handling (ref siblings,
13
+ * multi-format wrappers, boolean schemas), which lives in {@link getAsyncApiModelSchema}.
14
+ */
15
+ function getModelSchema(document, name) {
16
+ if (isOpenApiDocument(document)) return getResolvedRef(document.components?.schemas?.[name]);
17
+ if (isAsyncApiDocument(document)) return getAsyncApiModelSchema(document, name);
18
+ }
5
19
  function responseExampleValueToString(value) {
6
20
  if (typeof value === "string") return value;
7
21
  try {
@@ -34,14 +48,15 @@ function extractResponseExamples(responses) {
34
48
  /**
35
49
  * Create a search index from a list of entries.
36
50
  */
37
- function createSearchIndex(document) {
51
+ function createSearchIndex(document, options) {
38
52
  const index = [];
53
+ const modelsSectionTitle = options?.modelsSectionLabel ?? DEFAULT_MODELS_SECTION_LABEL;
39
54
  /**
40
55
  * Recursively processes entries and their children to build the search index.
41
56
  */
42
57
  function processEntries(entriesToProcess) {
43
58
  entriesToProcess.forEach((entry) => {
44
- addEntryToIndex(entry, index, document);
59
+ addEntryToIndex(entry, index, document, modelsSectionTitle);
45
60
  if ("children" in entry && entry.children) processEntries(entry.children);
46
61
  });
47
62
  }
@@ -50,10 +65,14 @@ function createSearchIndex(document) {
50
65
  }
51
66
  /**
52
67
  * Adds a single entry to the search index, handling all entry types recursively.
68
+ *
69
+ * AsyncAPI documents contribute heading, tag, and model entries here. Their
70
+ * channels, operations, and messages are not indexed yet.
53
71
  */
54
- function addEntryToIndex(entry, index, document) {
72
+ function addEntryToIndex(entry, index, document, modelsSectionTitle) {
73
+ const openApiDocument = isOpenApiDocument(document) ? document : void 0;
55
74
  if (entry.type === "operation") {
56
- const pathItem = getResolvedRef(document?.paths?.[entry.path]);
75
+ const pathItem = getResolvedRef(openApiDocument?.paths?.[entry.path]);
57
76
  const operation = getResolvedRef(pathItem?.[entry.method]) ?? {};
58
77
  const operationWithPathParams = {
59
78
  ...operation,
@@ -82,7 +101,7 @@ function addEntryToIndex(entry, index, document) {
82
101
  return;
83
102
  }
84
103
  if (entry.type === "webhook") {
85
- const webhook = getResolvedRef(document?.webhooks?.[entry.name]?.[entry.method]) ?? {};
104
+ const webhook = getResolvedRef(openApiDocument?.webhooks?.[entry.name]?.[entry.method]) ?? {};
86
105
  const webhookDescription = webhook.description || "";
87
106
  index.push({
88
107
  id: entry.id,
@@ -98,14 +117,14 @@ function addEntryToIndex(entry, index, document) {
98
117
  return;
99
118
  }
100
119
  if (entry.type === "model") {
101
- const schema = getResolvedRef(document?.components?.schemas?.[entry.name]);
120
+ const schema = getModelSchema(document, entry.name);
102
121
  const schemaDescription = schema?.description ?? "";
103
122
  const propertyNames = extractSchemaFieldNames(schema);
104
123
  const propertyDescriptions = extractSchemaDescriptions(schema);
105
124
  index.push({
106
125
  type: "model",
107
126
  title: entry.title,
108
- description: "Model",
127
+ description: modelsSectionTitle,
109
128
  id: entry.id,
110
129
  body: propertyNames,
111
130
  bodyDescriptions: schemaDescription ? [schemaDescription, ...propertyDescriptions] : propertyDescriptions,
@@ -117,7 +136,7 @@ function addEntryToIndex(entry, index, document) {
117
136
  index.push({
118
137
  id: entry.id,
119
138
  type: "heading",
120
- title: "Models",
139
+ title: entry.title,
121
140
  description: "Heading",
122
141
  body: "",
123
142
  entry
@@ -1 +1 @@
1
- {"version":3,"file":"create-search-index.js","names":[],"sources":["../../../../src/features/Search/helpers/create-search-index.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { combineParams } from '@scalar/workspace-store/request-example'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport type {\n MediaTypeObject,\n OpenApiDocument,\n OperationObject,\n ResponsesObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport type { FuseData } from '@/features/Search/types'\nimport {\n extractBodyDescriptions,\n extractBodyFieldNames,\n extractParameterDescriptions,\n extractParameterNames,\n extractSchemaDescriptions,\n extractSchemaFieldNames,\n} from '@/helpers/openapi'\n\nfunction responseExampleValueToString(value: unknown): string {\n if (typeof value === 'string') {\n return value\n }\n\n try {\n return JSON.stringify(value)\n } catch (_error) {\n return ''\n }\n}\n\nfunction mediaTypeExamplesToStrings(mediaType: MediaTypeObject): string[] {\n const examplesFromNamedMap = Object.values(mediaType.examples ?? {})\n .flatMap((example) => {\n const resolvedExample = getResolvedRef(example)\n\n if (!resolvedExample || !('value' in resolvedExample)) {\n return []\n }\n\n return responseExampleValueToString(resolvedExample.value)\n })\n .filter((value) => value.length > 0)\n\n const mediaTypeExample =\n 'example' in mediaType && mediaType.example !== undefined ? responseExampleValueToString(mediaType.example) : ''\n\n return mediaTypeExample ? [mediaTypeExample, ...examplesFromNamedMap] : examplesFromNamedMap\n}\n\nfunction extractResponseExamples(responses: ResponsesObject | undefined): string[] {\n if (!responses) {\n return []\n }\n\n return Object.values(responses)\n .flatMap((response) => {\n const resolvedResponse = getResolvedRef(response)\n if (!resolvedResponse?.content) {\n return []\n }\n\n return Object.values(resolvedResponse.content).flatMap((mediaType) => {\n const resolvedMediaType = getResolvedRef(mediaType)\n if (!resolvedMediaType) {\n return []\n }\n\n return mediaTypeExamplesToStrings(resolvedMediaType)\n })\n })\n .filter((value) => value.length > 0)\n}\n\n/**\n * Create a search index from a list of entries.\n */\nexport function createSearchIndex(document: OpenApiDocument | undefined): FuseData[] {\n const index: FuseData[] = []\n\n /**\n * Recursively processes entries and their children to build the search index.\n */\n function processEntries(entriesToProcess: TraversedEntry[]): void {\n entriesToProcess.forEach((entry) => {\n addEntryToIndex(entry, index, document)\n\n // Recursively process children if they exist\n if ('children' in entry && entry.children) {\n processEntries(entry.children)\n }\n })\n }\n\n processEntries(document?.['x-scalar-navigation']?.children ?? [])\n\n return index\n}\n\n/**\n * Adds a single entry to the search index, handling all entry types recursively.\n */\nfunction addEntryToIndex(entry: TraversedEntry, index: FuseData[], document?: OpenApiDocument): void {\n // Operation\n if (entry.type === 'operation') {\n const pathItem = getResolvedRef(document?.paths?.[entry.path])\n const operation = (getResolvedRef(pathItem?.[entry.method]) ?? {}) as OperationObject\n const operationWithPathParams = {\n ...operation,\n parameters: combineParams(pathItem?.parameters, operation.parameters),\n }\n\n const parameters = extractParameterNames(operationWithPathParams.parameters ?? [])\n const parameterDescriptions = extractParameterDescriptions(operationWithPathParams.parameters ?? [])\n const body = extractBodyFieldNames(operationWithPathParams)\n const bodyDescriptions = extractBodyDescriptions(operationWithPathParams)\n const responseExamples = extractResponseExamples(operationWithPathParams.responses)\n\n index.push({\n type: 'operation',\n title: entry.title,\n id: entry.id,\n description: operationWithPathParams.description || '',\n method: entry.method,\n path: entry.path,\n body,\n bodyDescriptions,\n parameters,\n parameterDescriptions,\n responseExamples,\n operationId: operationWithPathParams.operationId,\n entry,\n })\n\n return\n }\n\n // Webhook\n if (entry.type === 'webhook') {\n const webhook = getResolvedRef(document?.webhooks?.[entry.name]?.[entry.method]) ?? {}\n const webhookDescription = webhook.description || ''\n\n index.push({\n id: entry.id,\n type: 'webhook',\n title: entry.title,\n description: 'Webhook',\n method: entry.method,\n body: '',\n bodyDescriptions: webhookDescription ? [webhookDescription] : [],\n operationId: webhook.operationId,\n entry,\n })\n\n return\n }\n\n // Model\n if (entry.type === 'model') {\n const schema = getResolvedRef(document?.components?.schemas?.[entry.name])\n const schemaDescription = schema?.description ?? ''\n const propertyNames = extractSchemaFieldNames(schema)\n const propertyDescriptions = extractSchemaDescriptions(schema)\n\n index.push({\n type: 'model',\n title: entry.title,\n description: 'Model',\n id: entry.id,\n body: propertyNames,\n bodyDescriptions: schemaDescription ? [schemaDescription, ...propertyDescriptions] : propertyDescriptions,\n entry,\n })\n\n return\n }\n\n // Models heading\n if (entry.type === 'models') {\n index.push({\n id: entry.id,\n type: 'heading',\n title: 'Models',\n description: 'Heading',\n body: '',\n entry,\n })\n\n return\n }\n\n // Tag\n if (entry.type === 'tag' && entry.isWebhooks === true) {\n index.push({\n id: entry.id,\n type: 'heading',\n title: 'Webhooks',\n description: 'Heading',\n body: '',\n entry,\n })\n\n return\n }\n\n if (entry.type === 'tag' && entry.isGroup === false) {\n index.push({\n id: entry.id,\n title: entry.title,\n description: entry.description || '',\n type: 'tag',\n body: '',\n entry,\n })\n\n return\n }\n\n // Tag group\n if (entry.type === 'tag' && entry.isGroup === true) {\n index.push({\n id: entry.id,\n title: entry.title,\n description: 'Tag Group',\n type: 'tag',\n body: '',\n entry,\n })\n\n return\n }\n\n // Headings from info.description\n if (entry.type === 'text') {\n index.push({\n id: entry.id,\n type: 'heading',\n title: entry.title ?? '',\n description: 'Heading',\n body: '',\n entry,\n })\n\n return\n }\n}\n"],"mappings":";;;;AAoBA,SAAS,6BAA6B,OAAwB;AAC5D,KAAI,OAAO,UAAU,SACnB,QAAO;AAGT,KAAI;AACF,SAAO,KAAK,UAAU,MAAM;UACrB,QAAQ;AACf,SAAO;;;AAIX,SAAS,2BAA2B,WAAsC;CACxE,MAAM,uBAAuB,OAAO,OAAO,UAAU,YAAY,EAAE,CAAC,CACjE,SAAS,YAAY;EACpB,MAAM,kBAAkB,eAAe,QAAQ;AAE/C,MAAI,CAAC,mBAAmB,EAAE,WAAW,iBACnC,QAAO,EAAE;AAGX,SAAO,6BAA6B,gBAAgB,MAAM;GAC1D,CACD,QAAQ,UAAU,MAAM,SAAS,EAAE;CAEtC,MAAM,mBACJ,aAAa,aAAa,UAAU,YAAY,KAAA,IAAY,6BAA6B,UAAU,QAAQ,GAAG;AAEhH,QAAO,mBAA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ACb,aAAa,MAAM,eAAe;GAClC,MAAM;GACN,MAAM;GACN;GACD,CAAC;AAEF;;AAIF,KAAI,MAAM,SAAS,SAAS,MAAM,YAAY,MAAM;AAClD,QAAM,KAAK;GACT,IAAI,MAAM;GACV,OAAO,MAAM;GACb,aAAa;GACb,MAAM;GACN,MAAM;GACN;GACD,CAAC;AAEF;;AAIF,KAAI,MAAM,SAAS,QAAQ;AACzB,QAAM,KAAK;GACT,IAAI,MAAM;GACV,MAAM;GACN,OAAO,MAAM,SAAS;GACtB,aAAa;GACb,MAAM;GACN;GACD,CAAC;AAEF"}
1
+ {"version":3,"file":"create-search-index.js","names":[],"sources":["../../../../src/features/Search/helpers/create-search-index.ts"],"sourcesContent":["import { DEFAULT_MODELS_SECTION_LABEL, type ModelsSectionLabel } from '@scalar/types/api-reference'\nimport type { AsyncApiDocument } from '@scalar/types/asyncapi/3.1'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { combineParams } from '@scalar/workspace-store/request-example'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isAsyncApiDocument, isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport type {\n MediaTypeObject,\n OpenApiDocument,\n OperationObject,\n ResponsesObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport type { FuseData } from '@/features/Search/types'\nimport { getAsyncApiModelSchema } from '@/helpers/get-async-api-model-schema'\nimport {\n extractBodyDescriptions,\n extractBodyFieldNames,\n extractParameterDescriptions,\n extractParameterNames,\n extractSchemaDescriptions,\n extractSchemaFieldNames,\n} from '@/helpers/openapi'\n\n/** Documents the search index can ingest. AsyncAPI is supported for headings, tags, and models; channels/operations/messages are not indexed yet. */\ntype SearchableDocument = OpenApiDocument | AsyncApiDocument\n\n/**\n * Resolves a schema from `components.schemas` for either document type.\n *\n * OpenAPI and AsyncAPI keep reusable schemas in the same place, so model search entries can read\n * property names and descriptions from both. AsyncAPI entries need extra handling (ref siblings,\n * multi-format wrappers, boolean schemas), which lives in {@link getAsyncApiModelSchema}.\n */\nfunction getModelSchema(document: SearchableDocument | undefined, name: string): SchemaObject | undefined {\n if (isOpenApiDocument(document)) {\n return getResolvedRef(document.components?.schemas?.[name])\n }\n\n if (isAsyncApiDocument(document)) {\n return getAsyncApiModelSchema(document, name)\n }\n\n return undefined\n}\n\nfunction responseExampleValueToString(value: unknown): string {\n if (typeof value === 'string') {\n return value\n }\n\n try {\n return JSON.stringify(value)\n } catch (_error) {\n return ''\n }\n}\n\nfunction mediaTypeExamplesToStrings(mediaType: MediaTypeObject): string[] {\n const examplesFromNamedMap = Object.values(mediaType.examples ?? {})\n .flatMap((example) => {\n const resolvedExample = getResolvedRef(example)\n\n if (!resolvedExample || !('value' in resolvedExample)) {\n return []\n }\n\n return responseExampleValueToString(resolvedExample.value)\n })\n .filter((value) => value.length > 0)\n\n const mediaTypeExample =\n 'example' in mediaType && mediaType.example !== undefined ? responseExampleValueToString(mediaType.example) : ''\n\n return mediaTypeExample ? [mediaTypeExample, ...examplesFromNamedMap] : examplesFromNamedMap\n}\n\nfunction extractResponseExamples(responses: ResponsesObject | undefined): string[] {\n if (!responses) {\n return []\n }\n\n return Object.values(responses)\n .flatMap((response) => {\n const resolvedResponse = getResolvedRef(response)\n if (!resolvedResponse?.content) {\n return []\n }\n\n return Object.values(resolvedResponse.content).flatMap((mediaType) => {\n const resolvedMediaType = getResolvedRef(mediaType)\n if (!resolvedMediaType) {\n return []\n }\n\n return mediaTypeExamplesToStrings(resolvedMediaType)\n })\n })\n .filter((value) => value.length > 0)\n}\n\ntype CreateSearchIndexOptions = {\n modelsSectionLabel?: ModelsSectionLabel\n}\n\n/**\n * Create a search index from a list of entries.\n */\nexport function createSearchIndex(\n document: SearchableDocument | undefined,\n options?: CreateSearchIndexOptions,\n): FuseData[] {\n const index: FuseData[] = []\n const modelsSectionTitle = options?.modelsSectionLabel ?? DEFAULT_MODELS_SECTION_LABEL\n\n /**\n * Recursively processes entries and their children to build the search index.\n */\n function processEntries(entriesToProcess: TraversedEntry[]): void {\n entriesToProcess.forEach((entry) => {\n addEntryToIndex(entry, index, document, modelsSectionTitle)\n\n // Recursively process children if they exist\n if ('children' in entry && entry.children) {\n processEntries(entry.children)\n }\n })\n }\n\n processEntries(document?.['x-scalar-navigation']?.children ?? [])\n\n return index\n}\n\n/**\n * Adds a single entry to the search index, handling all entry types recursively.\n *\n * AsyncAPI documents contribute heading, tag, and model entries here. Their\n * channels, operations, and messages are not indexed yet.\n */\nfunction addEntryToIndex(\n entry: TraversedEntry,\n index: FuseData[],\n document: SearchableDocument | undefined,\n modelsSectionTitle: string,\n): void {\n // OpenAPI-only branches read fields that do not exist on AsyncAPI documents (paths, webhooks,\n // components.schemas). Narrow once here so each branch can dereference safely.\n const openApiDocument = isOpenApiDocument(document) ? document : undefined\n\n // Operation\n if (entry.type === 'operation') {\n const pathItem = getResolvedRef(openApiDocument?.paths?.[entry.path])\n const operation = (getResolvedRef(pathItem?.[entry.method]) ?? {}) as OperationObject\n const operationWithPathParams = {\n ...operation,\n parameters: combineParams(pathItem?.parameters, operation.parameters),\n }\n\n const parameters = extractParameterNames(operationWithPathParams.parameters ?? [])\n const parameterDescriptions = extractParameterDescriptions(operationWithPathParams.parameters ?? [])\n const body = extractBodyFieldNames(operationWithPathParams)\n const bodyDescriptions = extractBodyDescriptions(operationWithPathParams)\n const responseExamples = extractResponseExamples(operationWithPathParams.responses)\n\n index.push({\n type: 'operation',\n title: entry.title,\n id: entry.id,\n description: operationWithPathParams.description || '',\n method: entry.method,\n path: entry.path,\n body,\n bodyDescriptions,\n parameters,\n parameterDescriptions,\n responseExamples,\n operationId: operationWithPathParams.operationId,\n entry,\n })\n\n return\n }\n\n // Webhook\n if (entry.type === 'webhook') {\n const webhook = getResolvedRef(openApiDocument?.webhooks?.[entry.name]?.[entry.method]) ?? {}\n const webhookDescription = webhook.description || ''\n\n index.push({\n id: entry.id,\n type: 'webhook',\n title: entry.title,\n description: 'Webhook',\n method: entry.method,\n body: '',\n bodyDescriptions: webhookDescription ? [webhookDescription] : [],\n operationId: webhook.operationId,\n entry,\n })\n\n return\n }\n\n // Model\n if (entry.type === 'model') {\n const schema = getModelSchema(document, entry.name)\n const schemaDescription = schema?.description ?? ''\n const propertyNames = extractSchemaFieldNames(schema)\n const propertyDescriptions = extractSchemaDescriptions(schema)\n\n index.push({\n type: 'model',\n title: entry.title,\n description: modelsSectionTitle,\n id: entry.id,\n body: propertyNames,\n bodyDescriptions: schemaDescription ? [schemaDescription, ...propertyDescriptions] : propertyDescriptions,\n entry,\n })\n\n return\n }\n\n // Models heading\n if (entry.type === 'models') {\n index.push({\n id: entry.id,\n type: 'heading',\n title: entry.title,\n description: 'Heading',\n body: '',\n entry,\n })\n\n return\n }\n\n // Tag\n if (entry.type === 'tag' && entry.isWebhooks === true) {\n index.push({\n id: entry.id,\n type: 'heading',\n title: 'Webhooks',\n description: 'Heading',\n body: '',\n entry,\n })\n\n return\n }\n\n if (entry.type === 'tag' && entry.isGroup === false) {\n index.push({\n id: entry.id,\n title: entry.title,\n description: entry.description || '',\n type: 'tag',\n body: '',\n entry,\n })\n\n return\n }\n\n // Tag group\n if (entry.type === 'tag' && entry.isGroup === true) {\n index.push({\n id: entry.id,\n title: entry.title,\n description: 'Tag Group',\n type: 'tag',\n body: '',\n entry,\n })\n\n return\n }\n\n // Headings from info.description\n if (entry.type === 'text') {\n index.push({\n id: entry.id,\n type: 'heading',\n title: entry.title ?? '',\n description: 'Heading',\n body: '',\n entry,\n })\n\n return\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAmCA,SAAS,eAAe,UAA0C,MAAwC;AACxG,KAAI,kBAAkB,SAAS,CAC7B,QAAO,eAAe,SAAS,YAAY,UAAU,MAAM;AAG7D,KAAI,mBAAmB,SAAS,CAC9B,QAAO,uBAAuB,UAAU,KAAK;;AAMjD,SAAS,6BAA6B,OAAwB;AAC5D,KAAI,OAAO,UAAU,SACnB,QA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