@scalar/api-reference 1.49.0 → 1.49.1

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 (365) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/AgentScalarChatInterface-MUbtSqMw.js +41 -0
  3. package/dist/AgentScalarChatInterface-MUbtSqMw.js.map +1 -0
  4. package/dist/ExternalDocs-phu7GxpZ.js +272 -0
  5. package/dist/ExternalDocs-phu7GxpZ.js.map +1 -0
  6. package/dist/MobileHeader-B71jYJdT.js +1373 -0
  7. package/dist/MobileHeader-B71jYJdT.js.map +1 -0
  8. package/dist/Operation-CixLVfKd.js +3827 -0
  9. package/dist/Operation-CixLVfKd.js.map +1 -0
  10. package/dist/SearchButton-xzhIpMCZ.js +621 -0
  11. package/dist/SearchButton-xzhIpMCZ.js.map +1 -0
  12. package/dist/ServerSelector-5y29y2BJ.js +852 -0
  13. package/dist/ServerSelector-5y29y2BJ.js.map +1 -0
  14. package/dist/blocks/index.js +3 -10
  15. package/dist/blocks/scalar-client-selector-block/index.d.ts +1 -1
  16. package/dist/blocks/scalar-info-block/index.d.ts +2 -2
  17. package/dist/blocks/scalar-server-selector-block/index.d.ts +1 -1
  18. package/dist/browser/standalone.js +40759 -34701
  19. package/dist/browser/webpack-stats.json +1 -1
  20. package/dist/components/AgentScalar/index.d.ts +3 -3
  21. package/dist/components/Anchor/index.d.ts +2 -2
  22. package/dist/components/Badge/index.d.ts +1 -1
  23. package/dist/components/Content/Auth/index.d.ts +1 -1
  24. package/dist/components/Content/Models/index.d.ts +2 -2
  25. package/dist/components/Content/Schema/Schema.vue.d.ts +1 -1
  26. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +2 -2
  27. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +1 -1
  28. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -1
  29. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
  30. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  31. package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts +1 -1
  32. package/dist/components/Content/Schema/index.d.ts +4 -4
  33. package/dist/components/Content/Tags/index.d.ts +1 -1
  34. package/dist/components/Content/index.d.ts +2 -2
  35. package/dist/components/HttpMethod/index.d.ts +1 -1
  36. package/dist/components/LinkList/index.d.ts +1 -1
  37. package/dist/components/OperationsList/index.d.ts +1 -1
  38. package/dist/components/RenderPlugins/index.d.ts +1 -1
  39. package/dist/components/Section/index.d.ts +10 -10
  40. package/dist/components/SectionFlare/index.d.ts +1 -1
  41. package/dist/components/index.d.ts +5 -5
  42. package/dist/components/index.js +102 -42
  43. package/dist/components/index.js.map +1 -0
  44. package/dist/features/Operation/components/OperationParameters.vue.d.ts +1 -1
  45. package/dist/features/Operation/components/OperationResponses.vue.d.ts +1 -1
  46. package/dist/features/Operation/components/ParameterList.vue.d.ts +1 -1
  47. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +1 -1
  48. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +1 -1
  49. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +1 -1
  50. package/dist/features/Operation/index.d.ts +1 -1
  51. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +1 -1
  52. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +1 -1
  53. package/dist/features/Search/components/SearchResult.vue.d.ts +1 -1
  54. package/dist/features/Search/helpers/create-fuse-instance.d.ts +1 -1
  55. package/dist/features/Search/helpers/create-search-index.d.ts +1 -1
  56. package/dist/features/Search/index.d.ts +2 -2
  57. package/dist/features/Search/types.d.ts +1 -1
  58. package/dist/features/developer-tools/index.d.ts +1 -1
  59. package/dist/features/example-responses/index.d.ts +1 -1
  60. package/dist/features/external-docs/index.d.ts +1 -1
  61. package/dist/features/index.d.ts +2 -2
  62. package/dist/features/index.js +4 -10
  63. package/dist/features/info-object/index.d.ts +3 -3
  64. package/dist/features/specification-extension/index.d.ts +2 -2
  65. package/dist/features/test-request-button/index.d.ts +1 -1
  66. package/dist/features/x-badges/index.d.ts +1 -1
  67. package/dist/helpers/download.d.ts +1 -1
  68. package/dist/helpers/download.d.ts.map +1 -1
  69. package/dist/helpers/index.d.ts +8 -8
  70. package/dist/helpers/index.js +3 -24
  71. package/dist/hooks/index.d.ts +2 -2
  72. package/dist/hooks/index.js +3 -8
  73. package/dist/index.d.ts +5 -5
  74. package/dist/index.js +7 -14
  75. package/dist/lazy-bus-CV8Ox5hD.js +333 -0
  76. package/dist/lazy-bus-CV8Ox5hD.js.map +1 -0
  77. package/dist/normalize-configurations-DcVpOEjD.js +232 -0
  78. package/dist/normalize-configurations-DcVpOEjD.js.map +1 -0
  79. package/dist/plugins/hooks/usePluginManager.d.ts +1 -1
  80. package/dist/plugins/index.d.ts +3 -3
  81. package/dist/plugins/index.js +2 -9
  82. package/dist/plugins-4EyiUD_A.js +80 -0
  83. package/dist/plugins-4EyiUD_A.js.map +1 -0
  84. package/dist/src-DqcYVBWI.js +1686 -0
  85. package/dist/src-DqcYVBWI.js.map +1 -0
  86. package/dist/ssr.d.ts +2 -2
  87. package/dist/ssr.js +7 -14
  88. package/dist/storage--3JuzjCI.js +42 -0
  89. package/dist/storage--3JuzjCI.js.map +1 -0
  90. package/dist/style.css +6773 -7332
  91. package/dist/urls-gPTXGgbj.js +17 -0
  92. package/dist/urls-gPTXGgbj.js.map +1 -0
  93. package/dist/use-agent-Bnm1de0n.js +60 -0
  94. package/dist/use-agent-Bnm1de0n.js.map +1 -0
  95. package/dist/use-intersection-8QqPi2O-.js +24 -0
  96. package/dist/use-intersection-8QqPi2O-.js.map +1 -0
  97. package/package.json +25 -27
  98. package/dist/_virtual/_plugin-vue_export-helper.js +0 -10
  99. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +0 -7
  100. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +0 -123
  101. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +0 -7
  102. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +0 -142
  103. package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js +0 -24
  104. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +0 -7
  105. package/dist/blocks/scalar-info-block/components/DownloadLink.vue2.js +0 -63
  106. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js +0 -59
  107. package/dist/blocks/scalar-info-block/components/InfoBlock.vue2.js +0 -4
  108. package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +0 -7
  109. package/dist/blocks/scalar-info-block/components/InfoDescription.vue2.js +0 -70
  110. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js +0 -38
  111. package/dist/blocks/scalar-info-block/components/InfoLinks.vue2.js +0 -4
  112. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js +0 -38
  113. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue2.js +0 -4
  114. package/dist/blocks/scalar-info-block/components/InfoVersion.vue.js +0 -28
  115. package/dist/blocks/scalar-info-block/components/InfoVersion.vue2.js +0 -4
  116. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js +0 -7
  117. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue2.js +0 -19
  118. package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +0 -14
  119. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +0 -7
  120. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue2.js +0 -112
  121. package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js +0 -21
  122. package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue2.js +0 -4
  123. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js +0 -76
  124. package/dist/blocks/scalar-server-selector-block/components/Selector.vue2.js +0 -4
  125. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +0 -72
  126. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue2.js +0 -4
  127. package/dist/components/AgentScalar/AgentScalarButton.vue.js +0 -22
  128. package/dist/components/AgentScalar/AgentScalarButton.vue2.js +0 -4
  129. package/dist/components/AgentScalar/AgentScalarChatInterface.vue.js +0 -4
  130. package/dist/components/AgentScalar/AgentScalarChatInterface.vue2.js +0 -29
  131. package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +0 -7
  132. package/dist/components/AgentScalar/AgentScalarDrawer.vue2.js +0 -78
  133. package/dist/components/AgentScalar/OpenMCPButton.vue.js +0 -7
  134. package/dist/components/AgentScalar/OpenMCPButton.vue2.js +0 -191
  135. package/dist/components/Anchor/Anchor.vue.js +0 -51
  136. package/dist/components/Anchor/Anchor.vue2.js +0 -4
  137. package/dist/components/Anchor/WithBreadcrumb.vue.js +0 -41
  138. package/dist/components/Anchor/WithBreadcrumb.vue2.js +0 -4
  139. package/dist/components/ApiReference.vue.js +0 -10
  140. package/dist/components/ApiReference.vue2.js +0 -742
  141. package/dist/components/Badge/Badge.vue.js +0 -7
  142. package/dist/components/Badge/Badge.vue2.js +0 -26
  143. package/dist/components/ClassicHeader.vue.js +0 -21
  144. package/dist/components/Content/Auth/Auth.vue.js +0 -77
  145. package/dist/components/Content/Auth/Auth.vue2.js +0 -4
  146. package/dist/components/Content/Auth/helpers/get-default-security.js +0 -55
  147. package/dist/components/Content/Content.vue.js +0 -171
  148. package/dist/components/Content/Content.vue3.js +0 -5
  149. package/dist/components/Content/Models/Model.vue.js +0 -47
  150. package/dist/components/Content/Models/Model.vue2.js +0 -4
  151. package/dist/components/Content/Models/ModelTag.vue.js +0 -76
  152. package/dist/components/Content/Models/ModelTag.vue2.js +0 -4
  153. package/dist/components/Content/Models/components/ClassicLayout.vue.js +0 -7
  154. package/dist/components/Content/Models/components/ClassicLayout.vue2.js +0 -78
  155. package/dist/components/Content/Models/components/ModernLayout.vue.js +0 -61
  156. package/dist/components/Content/Models/components/ModernLayout.vue2.js +0 -4
  157. package/dist/components/Content/Operations/TraversedEntry.vue.js +0 -146
  158. package/dist/components/Content/Operations/TraversedEntry.vue2.js +0 -4
  159. package/dist/components/Content/Schema/RenderString.vue.js +0 -27
  160. package/dist/components/Content/Schema/RenderString.vue2.js +0 -4
  161. package/dist/components/Content/Schema/Schema.vue.js +0 -7
  162. package/dist/components/Content/Schema/Schema.vue2.js +0 -193
  163. package/dist/components/Content/Schema/SchemaComposition.vue.js +0 -120
  164. package/dist/components/Content/Schema/SchemaComposition.vue2.js +0 -4
  165. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +0 -7
  166. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue2.js +0 -36
  167. package/dist/components/Content/Schema/SchemaEnums.vue.js +0 -7
  168. package/dist/components/Content/Schema/SchemaEnums.vue2.js +0 -112
  169. package/dist/components/Content/Schema/SchemaHeading.vue.js +0 -7
  170. package/dist/components/Content/Schema/SchemaHeading.vue2.js +0 -61
  171. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js +0 -66
  172. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue2.js +0 -4
  173. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +0 -120
  174. package/dist/components/Content/Schema/SchemaObjectProperties.vue2.js +0 -4
  175. package/dist/components/Content/Schema/SchemaProperty.vue.js +0 -7
  176. package/dist/components/Content/Schema/SchemaProperty.vue2.js +0 -236
  177. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +0 -7
  178. package/dist/components/Content/Schema/SchemaPropertyDefault.vue2.js +0 -45
  179. package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +0 -7
  180. package/dist/components/Content/Schema/SchemaPropertyDetail.vue2.js +0 -40
  181. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +0 -7
  182. package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +0 -80
  183. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +0 -7
  184. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +0 -318
  185. package/dist/components/Content/Schema/helpers/format-example.js +0 -41
  186. package/dist/components/Content/Schema/helpers/format-value.js +0 -35
  187. package/dist/components/Content/Schema/helpers/get-compositions-to-render.js +0 -31
  188. package/dist/components/Content/Schema/helpers/get-enum-values.js +0 -20
  189. package/dist/components/Content/Schema/helpers/get-property-description.js +0 -34
  190. package/dist/components/Content/Schema/helpers/get-ref-name.js +0 -14
  191. package/dist/components/Content/Schema/helpers/get-schema-type.js +0 -47
  192. package/dist/components/Content/Schema/helpers/has-complex-array-items.js +0 -48
  193. package/dist/components/Content/Schema/helpers/is-empty-schema-object.js +0 -13
  194. package/dist/components/Content/Schema/helpers/is-type-object.js +0 -27
  195. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +0 -215
  196. package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +0 -64
  197. package/dist/components/Content/Schema/helpers/schema-composition.js +0 -4
  198. package/dist/components/Content/Schema/helpers/schema-name.js +0 -24
  199. package/dist/components/Content/Schema/helpers/should-display-description.js +0 -12
  200. package/dist/components/Content/Schema/helpers/should-display-heading.js +0 -12
  201. package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js +0 -15
  202. package/dist/components/Content/Schema/helpers/sort-property-names.js +0 -71
  203. package/dist/components/Content/Tags/Tag.vue.js +0 -46
  204. package/dist/components/Content/Tags/Tag.vue2.js +0 -4
  205. package/dist/components/Content/Tags/components/ClassicLayout.vue.js +0 -7
  206. package/dist/components/Content/Tags/components/ClassicLayout.vue2.js +0 -57
  207. package/dist/components/Content/Tags/components/ModernLayout.vue.js +0 -7
  208. package/dist/components/Content/Tags/components/ModernLayout.vue2.js +0 -56
  209. package/dist/components/Content/Tags/components/TagSection.vue.js +0 -100
  210. package/dist/components/Content/Tags/components/TagSection.vue2.js +0 -4
  211. package/dist/components/GettingStarted.vue.js +0 -7
  212. package/dist/components/GettingStarted.vue2.js +0 -82
  213. package/dist/components/HttpMethod/HttpMethod.vue.js +0 -34
  214. package/dist/components/HttpMethod/HttpMethod.vue2.js +0 -4
  215. package/dist/components/IntersectionObserver.vue.js +0 -55
  216. package/dist/components/IntersectionObserver.vue2.js +0 -4
  217. package/dist/components/Lazy/Lazy.vue.js +0 -106
  218. package/dist/components/Lazy/Lazy.vue2.js +0 -4
  219. package/dist/components/LinkList/LinkList.vue.js +0 -7
  220. package/dist/components/LinkList/LinkList.vue2.js +0 -48
  221. package/dist/components/LoadingSkeleton.vue.js +0 -7
  222. package/dist/components/LoadingSkeleton.vue2.js +0 -20
  223. package/dist/components/MobileHeader.vue.js +0 -62
  224. package/dist/components/MobileHeader.vue2.js +0 -4
  225. package/dist/components/OperationPath.vue.js +0 -7
  226. package/dist/components/OperationPath.vue2.js +0 -30
  227. package/dist/components/OperationsList/OperationsList.vue.js +0 -7
  228. package/dist/components/OperationsList/OperationsList.vue2.js +0 -61
  229. package/dist/components/OperationsList/OperationsListItem.vue.js +0 -7
  230. package/dist/components/OperationsList/OperationsListItem.vue2.js +0 -68
  231. package/dist/components/RenderPlugins/RenderPlugins.vue.js +0 -43
  232. package/dist/components/RenderPlugins/RenderPlugins.vue2.js +0 -4
  233. package/dist/components/ScreenReader.vue.js +0 -7
  234. package/dist/components/ScreenReader.vue2.js +0 -21
  235. package/dist/components/Section/CompactSection.vue.js +0 -7
  236. package/dist/components/Section/CompactSection.vue2.js +0 -60
  237. package/dist/components/Section/Section.vue.js +0 -7
  238. package/dist/components/Section/Section.vue2.js +0 -23
  239. package/dist/components/Section/SectionAccordion.vue.js +0 -7
  240. package/dist/components/Section/SectionAccordion.vue2.js +0 -76
  241. package/dist/components/Section/SectionColumn.vue.js +0 -14
  242. package/dist/components/Section/SectionColumns.vue.js +0 -14
  243. package/dist/components/Section/SectionContainer.vue.js +0 -7
  244. package/dist/components/Section/SectionContainer.vue2.js +0 -21
  245. package/dist/components/Section/SectionContainerAccordion.vue.js +0 -7
  246. package/dist/components/Section/SectionContainerAccordion.vue2.js +0 -54
  247. package/dist/components/Section/SectionContent.vue.js +0 -7
  248. package/dist/components/Section/SectionContent.vue2.js +0 -22
  249. package/dist/components/Section/SectionHeader.vue.js +0 -7
  250. package/dist/components/Section/SectionHeader.vue2.js +0 -26
  251. package/dist/components/Section/SectionHeaderTag.vue.js +0 -7
  252. package/dist/components/Section/SectionHeaderTag.vue2.js +0 -20
  253. package/dist/components/SectionFlare/SectionFlare.vue.js +0 -14
  254. package/dist/components/ShowMoreButton.vue.js +0 -7
  255. package/dist/components/ShowMoreButton.vue2.js +0 -23
  256. package/dist/consts/urls.js +0 -16
  257. package/dist/features/Operation/Operation.vue.js +0 -100
  258. package/dist/features/Operation/Operation.vue2.js +0 -4
  259. package/dist/features/Operation/components/ContentTypeSelect.vue.js +0 -88
  260. package/dist/features/Operation/components/ContentTypeSelect.vue2.js +0 -4
  261. package/dist/features/Operation/components/Header.vue.js +0 -33
  262. package/dist/features/Operation/components/Header.vue2.js +0 -4
  263. package/dist/features/Operation/components/Headers.vue.js +0 -7
  264. package/dist/features/Operation/components/Headers.vue2.js +0 -71
  265. package/dist/features/Operation/components/OperationParameters.vue.js +0 -92
  266. package/dist/features/Operation/components/OperationParameters.vue2.js +0 -4
  267. package/dist/features/Operation/components/OperationResponses.vue.js +0 -44
  268. package/dist/features/Operation/components/OperationResponses.vue2.js +0 -4
  269. package/dist/features/Operation/components/ParameterList.vue.js +0 -50
  270. package/dist/features/Operation/components/ParameterList.vue2.js +0 -4
  271. package/dist/features/Operation/components/ParameterListItem.vue.js +0 -7
  272. package/dist/features/Operation/components/ParameterListItem.vue2.js +0 -163
  273. package/dist/features/Operation/components/RequestBody.vue.js +0 -7
  274. package/dist/features/Operation/components/RequestBody.vue2.js +0 -164
  275. package/dist/features/Operation/components/callbacks/Callback.vue.js +0 -7
  276. package/dist/features/Operation/components/callbacks/Callback.vue2.js +0 -60
  277. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +0 -63
  278. package/dist/features/Operation/components/callbacks/Callbacks.vue2.js +0 -4
  279. package/dist/features/Operation/helpers/filter-selected-security.js +0 -28
  280. package/dist/features/Operation/helpers/get-first-server.js +0 -25
  281. package/dist/features/Operation/layouts/ClassicLayout.vue.js +0 -7
  282. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +0 -243
  283. package/dist/features/Operation/layouts/ModernLayout.vue.js +0 -7
  284. package/dist/features/Operation/layouts/ModernLayout.vue2.js +0 -256
  285. package/dist/features/Search/components/SearchButton.vue.js +0 -88
  286. package/dist/features/Search/components/SearchButton.vue2.js +0 -4
  287. package/dist/features/Search/components/SearchModal.vue.js +0 -7
  288. package/dist/features/Search/components/SearchModal.vue2.js +0 -120
  289. package/dist/features/Search/components/SearchResult.vue.js +0 -84
  290. package/dist/features/Search/components/SearchResult.vue2.js +0 -4
  291. package/dist/features/Search/helpers/create-fuse-instance.js +0 -43
  292. package/dist/features/Search/helpers/create-search-index.js +0 -119
  293. package/dist/features/Search/hooks/useSearchIndex.js +0 -33
  294. package/dist/features/ask-agent-button/AskAgentButton.vue.js +0 -7
  295. package/dist/features/ask-agent-button/AskAgentButton.vue2.js +0 -51
  296. package/dist/features/developer-tools/DeveloperTools.vue.js +0 -60
  297. package/dist/features/developer-tools/DeveloperTools.vue2.js +0 -4
  298. package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js +0 -13
  299. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js +0 -33
  300. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue2.js +0 -4
  301. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js +0 -138
  302. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue2.js +0 -4
  303. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.js +0 -66
  304. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue2.js +0 -4
  305. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js +0 -54
  306. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue2.js +0 -4
  307. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js +0 -71
  308. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue2.js +0 -4
  309. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js +0 -63
  310. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue2.js +0 -4
  311. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js +0 -73
  312. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue2.js +0 -4
  313. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js +0 -57
  314. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue2.js +0 -4
  315. package/dist/features/developer-tools/components/DeployApiReference.vue.js +0 -35
  316. package/dist/features/developer-tools/components/DeployApiReference.vue2.js +0 -4
  317. package/dist/features/developer-tools/components/ModifyConfiguration.vue.js +0 -103
  318. package/dist/features/developer-tools/components/ModifyConfiguration.vue2.js +0 -4
  319. package/dist/features/developer-tools/components/ShareApiReference.vue.js +0 -35
  320. package/dist/features/developer-tools/components/ShareApiReference.vue2.js +0 -4
  321. package/dist/features/example-responses/ExampleResponse.vue.js +0 -7
  322. package/dist/features/example-responses/ExampleResponse.vue2.js +0 -61
  323. package/dist/features/example-responses/ExampleResponseTab.vue.js +0 -7
  324. package/dist/features/example-responses/ExampleResponseTab.vue2.js +0 -25
  325. package/dist/features/example-responses/ExampleResponseTabList.vue.js +0 -7
  326. package/dist/features/example-responses/ExampleResponseTabList.vue2.js +0 -37
  327. package/dist/features/example-responses/ExampleResponses.vue.js +0 -7
  328. package/dist/features/example-responses/ExampleResponses.vue2.js +0 -181
  329. package/dist/features/example-responses/ExampleSchema.vue.js +0 -42
  330. package/dist/features/example-responses/ExampleSchema.vue2.js +0 -4
  331. package/dist/features/example-responses/has-response-content.js +0 -28
  332. package/dist/features/external-docs/ExternalDocs.vue.js +0 -42
  333. package/dist/features/external-docs/ExternalDocs.vue2.js +0 -4
  334. package/dist/features/info-object/Contact.vue.js +0 -46
  335. package/dist/features/info-object/Contact.vue2.js +0 -4
  336. package/dist/features/info-object/License.vue.js +0 -40
  337. package/dist/features/info-object/License.vue2.js +0 -4
  338. package/dist/features/info-object/TermsOfService.vue.js +0 -34
  339. package/dist/features/info-object/TermsOfService.vue2.js +0 -4
  340. package/dist/features/multiple-documents/DocumentSelector.vue.js +0 -54
  341. package/dist/features/multiple-documents/DocumentSelector.vue2.js +0 -4
  342. package/dist/features/specification-extension/SpecificationExtension.vue.js +0 -4
  343. package/dist/features/specification-extension/SpecificationExtension.vue2.js +0 -52
  344. package/dist/features/specification-extension/helpers.js +0 -9
  345. package/dist/features/test-request-button/TestRequestButton.vue.js +0 -7
  346. package/dist/features/test-request-button/TestRequestButton.vue2.js +0 -46
  347. package/dist/features/x-badges/XBadges.vue.js +0 -35
  348. package/dist/features/x-badges/XBadges.vue2.js +0 -4
  349. package/dist/helpers/color-mode.js +0 -9
  350. package/dist/helpers/download.js +0 -45
  351. package/dist/helpers/id-routing.js +0 -109
  352. package/dist/helpers/lazy-bus.js +0 -195
  353. package/dist/helpers/load-from-perssistance.js +0 -17
  354. package/dist/helpers/map-config-plugins.js +0 -27
  355. package/dist/helpers/map-config-to-workspace-store.js +0 -45
  356. package/dist/helpers/normalize-configurations.js +0 -69
  357. package/dist/helpers/openapi.js +0 -135
  358. package/dist/helpers/storage.js +0 -47
  359. package/dist/helpers/upload-temp-document.js +0 -24
  360. package/dist/hooks/use-agent.js +0 -42
  361. package/dist/hooks/use-intersection.js +0 -32
  362. package/dist/plugins/hooks/usePluginManager.js +0 -14
  363. package/dist/plugins/persistance-plugin.js +0 -48
  364. package/dist/plugins/plugin-manager.js +0 -39
  365. package/dist/standalone/lib/html-api.js +0 -81
@@ -0,0 +1,621 @@
1
+ import { d as _plugin_vue_export_helper_default } from "./ExternalDocs-phu7GxpZ.js";
2
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, isRef, nextTick, normalizeClass, onBeforeUnmount, onMounted, openBlock, ref, renderList, toDisplayString, toValue, unref, watch, withCtx, withKeys, withModifiers } from "vue";
3
+ import { ScalarIconButton, ScalarListbox, ScalarModal, ScalarSearchInput, ScalarSearchResultItem, ScalarSearchResultList, ScalarSidebarSearchButton, useModal } from "@scalar/components";
4
+ import { HttpMethod } from "@scalar/sidebar";
5
+ import { ScalarIconBracketsCurly, ScalarIconCaretDown, ScalarIconMagnifyingGlass, ScalarIconTag, ScalarIconTerminalWindow, ScalarIconTextAlignLeft } from "@scalar/icons";
6
+ import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
7
+ import { isObjectSchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
8
+ import { nanoid } from "nanoid";
9
+ import { isMacOS } from "@scalar/helpers/general/is-mac-os";
10
+ import Fuse from "fuse.js";
11
+ import { isDereferenced } from "@scalar/openapi-types/helpers";
12
+ //#region src/features/multiple-documents/DocumentSelector.vue?vue&type=script&setup=true&lang.ts
13
+ var _hoisted_1$2 = {
14
+ key: 0,
15
+ class: "document-selector p-3 pb-0"
16
+ };
17
+ var _hoisted_2$1 = {
18
+ class: "group/dropdown-label text-c-2 hover:text-c-1 flex w-full cursor-pointer items-center gap-1 font-medium",
19
+ type: "button"
20
+ };
21
+ var _hoisted_3$1 = { class: "overflow-hidden text-base text-ellipsis" };
22
+ //#endregion
23
+ //#region src/features/multiple-documents/DocumentSelector.vue
24
+ var DocumentSelector_default = /* @__PURE__ */ defineComponent({
25
+ __name: "DocumentSelector",
26
+ props: {
27
+ options: {},
28
+ modelValue: {}
29
+ },
30
+ emits: ["update:modelValue"],
31
+ setup(__props, { emit: __emit }) {
32
+ const props = __props;
33
+ const emit = __emit;
34
+ const formattedOptions = computed(() => props.options.map((o) => ({
35
+ id: o.id,
36
+ label: o.label
37
+ })));
38
+ const selected = computed(() => formattedOptions.value.find((o) => o.id === props.modelValue));
39
+ return (_ctx, _cache) => {
40
+ return __props.options.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_1$2, [createVNode(unref(ScalarListbox), {
41
+ modelValue: selected.value,
42
+ options: formattedOptions.value,
43
+ resize: "",
44
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = (e) => emit("update:modelValue", e.id))
45
+ }, {
46
+ default: withCtx(({ open }) => [createElementVNode("button", _hoisted_2$1, [createElementVNode("span", _hoisted_3$1, toDisplayString(selected.value?.label || "Select API"), 1), createVNode(unref(ScalarIconCaretDown), {
47
+ class: normalizeClass(["size-3 text-current transition-transform", { "rotate-180": open }]),
48
+ weight: "bold"
49
+ }, null, 8, ["class"])])]),
50
+ _: 1
51
+ }, 8, ["modelValue", "options"])])) : createCommentVNode("", true);
52
+ };
53
+ }
54
+ });
55
+ //#endregion
56
+ //#region src/features/Search/helpers/create-fuse-instance.ts
57
+ /**
58
+ * Create a Fuse instance for searching the API reference.
59
+ *
60
+ * Doesn't have any data yet, so it's empty.
61
+ */
62
+ function createFuseInstance() {
63
+ return new Fuse([], {
64
+ keys: [
65
+ {
66
+ name: "title",
67
+ weight: .7
68
+ },
69
+ {
70
+ name: "description",
71
+ weight: .3
72
+ },
73
+ {
74
+ name: "body",
75
+ weight: .2
76
+ },
77
+ {
78
+ name: "operationId",
79
+ weight: .6
80
+ },
81
+ {
82
+ name: "path",
83
+ weight: .5
84
+ },
85
+ {
86
+ name: "tag",
87
+ weight: .4
88
+ },
89
+ {
90
+ name: "method",
91
+ weight: .3
92
+ }
93
+ ],
94
+ threshold: .3,
95
+ distance: 100,
96
+ includeScore: true,
97
+ includeMatches: true,
98
+ ignoreLocation: true,
99
+ useExtendedSearch: true,
100
+ findAllMatches: true
101
+ });
102
+ }
103
+ //#endregion
104
+ //#region src/helpers/openapi.ts
105
+ /**
106
+ * Resolves a schema reference from workspace-store to a SchemaObject.
107
+ * Bridges SchemaReferenceType (which uses '$ref-value': unknown) to NodeInput (which uses '$ref-value': SchemaObject).
108
+ */
109
+ function resolveSchemaRef(ref) {
110
+ return getResolvedRef(ref);
111
+ }
112
+ /**
113
+ * Formats a property object into a string.
114
+ */
115
+ function formatProperty(key, obj) {
116
+ let output = key;
117
+ const isRequired = obj.required?.includes(key);
118
+ output += isRequired ? " REQUIRED " : " optional ";
119
+ const propRef = obj.properties[key];
120
+ if (!propRef) return output;
121
+ const property = resolveSchemaRef(propRef);
122
+ if (property && typeof property === "object" && "type" in property) {
123
+ output += property.type ?? "";
124
+ if ("description" in property && typeof property.description === "string") output += " " + property.description;
125
+ }
126
+ return output;
127
+ }
128
+ /**
129
+ * Recursively logs the properties of an object.
130
+ */
131
+ function recursiveLogger(obj) {
132
+ const results = ["Body"];
133
+ const schema = getResolvedRef(obj?.schema);
134
+ if (!schema || !isObjectSchema(schema) || !schema.properties) return results;
135
+ const properties = schema.properties;
136
+ const schemaWithProps = {
137
+ properties,
138
+ required: schema.required
139
+ };
140
+ Object.keys(properties).forEach((key) => {
141
+ if (!obj.schema) return;
142
+ results.push(formatProperty(key, schemaWithProps));
143
+ const propRef = properties[key];
144
+ if (!propRef) return;
145
+ const property = resolveSchemaRef(propRef);
146
+ if (property && isObjectSchema(property) && property.properties) {
147
+ const nestedProperties = property.properties;
148
+ Object.keys(nestedProperties).forEach((subKey) => {
149
+ const ref = nestedProperties[subKey];
150
+ if (!ref) return;
151
+ const nested = resolveSchemaRef(ref);
152
+ const typeStr = nested && typeof nested === "object" && "type" in nested ? nested.type ?? "" : "";
153
+ results.push(`${subKey} ${typeStr}`);
154
+ });
155
+ }
156
+ });
157
+ return results;
158
+ }
159
+ /**
160
+ * Extracts the request body from an operation.
161
+ */
162
+ function extractRequestBody(operation) {
163
+ try {
164
+ const media = getResolvedRef(operation?.requestBody)?.content?.["application/json"];
165
+ if (!media) throw new Error("Body not found");
166
+ return recursiveLogger(media);
167
+ } catch (_error) {
168
+ return false;
169
+ }
170
+ }
171
+ /**
172
+ * Deep merge for objects
173
+ */
174
+ function deepMerge(source, target) {
175
+ for (const [key, val] of Object.entries(source)) if (val !== null && typeof val === "object") {
176
+ target[key] ??= new val.__proto__.constructor();
177
+ deepMerge(val, target[key]);
178
+ } else if (typeof val !== "undefined") target[key] = val;
179
+ return target;
180
+ }
181
+ /**
182
+ * Creates an empty specification object.
183
+ * The returning object has the same structure as a valid OpenAPI specification, but everything is empty.
184
+ */
185
+ function createEmptySpecification(partialSpecification) {
186
+ return deepMerge(partialSpecification ?? {}, {
187
+ info: {
188
+ title: "",
189
+ description: "",
190
+ termsOfService: "",
191
+ version: "",
192
+ license: {
193
+ name: "",
194
+ url: ""
195
+ },
196
+ contact: { email: "" }
197
+ },
198
+ servers: [],
199
+ tags: []
200
+ });
201
+ }
202
+ /**
203
+ * This function creates a parameter map from an Operation Object, that's easier to consume.
204
+ *
205
+ * TODO: Isn't it easier to just stick to the OpenAPI structure, without transforming it?
206
+ */
207
+ function createParameterMap(operation) {
208
+ const map = {
209
+ path: [],
210
+ query: [],
211
+ header: [],
212
+ cookie: [],
213
+ body: [],
214
+ formData: []
215
+ };
216
+ const parameters = operation.parameters ?? [];
217
+ if (parameters) parameters.forEach((parameter) => {
218
+ if (!isDereferenced(parameter)) return;
219
+ if (typeof parameter === "object" && parameter !== null && "$ref" in parameter) return;
220
+ if (parameter.in === "path") map.path.push(parameter);
221
+ else if (parameter.in === "query") map.query.push(parameter);
222
+ else if (parameter.in === "header") map.header.push(parameter);
223
+ else if (parameter.in === "cookie") map.cookie.push(parameter);
224
+ else if (parameter.in === "body") map.body.push(parameter);
225
+ else if (parameter.in === "formData") map.formData.push(parameter);
226
+ });
227
+ return map;
228
+ }
229
+ //#endregion
230
+ //#region src/features/Search/helpers/create-search-index.ts
231
+ /**
232
+ * Create a search index from a list of entries.
233
+ */
234
+ function createSearchIndex(document) {
235
+ const index = [];
236
+ /**
237
+ * Recursively processes entries and their children to build the search index.
238
+ */
239
+ function processEntries(entriesToProcess) {
240
+ entriesToProcess.forEach((entry) => {
241
+ addEntryToIndex(entry, index, document);
242
+ if ("children" in entry && entry.children) processEntries(entry.children);
243
+ });
244
+ }
245
+ processEntries(document?.["x-scalar-navigation"]?.children ?? []);
246
+ return index;
247
+ }
248
+ /**
249
+ * Adds a single entry to the search index, handling all entry types recursively.
250
+ */
251
+ function addEntryToIndex(entry, index, document) {
252
+ if (entry.type === "operation") {
253
+ const operation = getResolvedRef(document?.paths?.[entry.path]?.[entry.method]) ?? {};
254
+ const requestBodyOrParameterMap = extractRequestBody(operation) || createParameterMap(operation);
255
+ const body = typeof requestBodyOrParameterMap !== "boolean" ? requestBodyOrParameterMap : null;
256
+ index.push({
257
+ type: "operation",
258
+ title: entry.title,
259
+ id: entry.id,
260
+ description: operation.description || "",
261
+ method: entry.method,
262
+ path: entry.path,
263
+ body: body || "",
264
+ operationId: operation.operationId,
265
+ entry
266
+ });
267
+ return;
268
+ }
269
+ if (entry.type === "webhook") {
270
+ const webhook = getResolvedRef(document?.webhooks?.[entry.name]?.[entry.method]) ?? {};
271
+ index.push({
272
+ id: entry.id,
273
+ type: "webhook",
274
+ title: entry.title,
275
+ description: "Webhook",
276
+ method: entry.method,
277
+ body: webhook.description || "",
278
+ operationId: webhook.operationId,
279
+ entry
280
+ });
281
+ return;
282
+ }
283
+ if (entry.type === "model") {
284
+ const description = getResolvedRef(document?.components?.schemas?.[entry.name])?.description ?? "";
285
+ index.push({
286
+ type: "model",
287
+ title: entry.title,
288
+ description: "Model",
289
+ id: entry.id,
290
+ body: description,
291
+ entry
292
+ });
293
+ return;
294
+ }
295
+ if (entry.type === "models") {
296
+ index.push({
297
+ id: entry.id,
298
+ type: "heading",
299
+ title: "Models",
300
+ description: "Heading",
301
+ body: "",
302
+ entry
303
+ });
304
+ return;
305
+ }
306
+ if (entry.type === "tag" && entry.isWebhooks === true) {
307
+ index.push({
308
+ id: entry.id,
309
+ type: "heading",
310
+ title: "Webhooks",
311
+ description: "Heading",
312
+ body: "",
313
+ entry
314
+ });
315
+ return;
316
+ }
317
+ if (entry.type === "tag" && entry.isGroup === false) {
318
+ index.push({
319
+ id: entry.id,
320
+ title: entry.title,
321
+ description: entry.description || "",
322
+ type: "tag",
323
+ body: "",
324
+ entry
325
+ });
326
+ return;
327
+ }
328
+ if (entry.type === "tag" && entry.isGroup === true) {
329
+ index.push({
330
+ id: entry.id,
331
+ title: entry.title,
332
+ description: "Tag Group",
333
+ type: "tag",
334
+ body: "",
335
+ entry
336
+ });
337
+ return;
338
+ }
339
+ if (entry.type === "text") {
340
+ index.push({
341
+ id: entry.id,
342
+ type: "heading",
343
+ title: entry.title ?? "",
344
+ description: "Heading",
345
+ body: "",
346
+ entry
347
+ });
348
+ return;
349
+ }
350
+ }
351
+ //#endregion
352
+ //#region src/features/Search/hooks/useSearchIndex.ts
353
+ var MAX_SEARCH_RESULTS = 25;
354
+ /**
355
+ * Creates the search index from an OpenAPI document.
356
+ */
357
+ function useSearchIndex(document) {
358
+ /** When the document changes we replace the search index */
359
+ const fuse = computed(() => {
360
+ const instance = createFuseInstance();
361
+ instance.setCollection(createSearchIndex(toValue(document)));
362
+ return instance;
363
+ });
364
+ const query = ref("");
365
+ return {
366
+ results: computed(() => {
367
+ if (query.value.length !== 0) return fuse.value.search(query.value, { limit: MAX_SEARCH_RESULTS });
368
+ return fuse.value._docs.slice(0, MAX_SEARCH_RESULTS).map((item, index) => ({
369
+ item,
370
+ refIndex: index
371
+ }));
372
+ }),
373
+ query
374
+ };
375
+ }
376
+ //#endregion
377
+ //#region src/features/Search/components/SearchResult.vue?vue&type=script&setup=true&lang.ts
378
+ var _hoisted_1$1 = { class: "sr-only" };
379
+ var _hoisted_2 = { class: "inline-flex items-center gap-1" };
380
+ var _hoisted_3 = { class: "sr-only" };
381
+ //#endregion
382
+ //#region src/features/Search/components/SearchResult.vue
383
+ var SearchResult_default = /* @__PURE__ */ defineComponent({
384
+ __name: "SearchResult",
385
+ props: {
386
+ id: {},
387
+ isSelected: { type: Boolean },
388
+ result: {}
389
+ },
390
+ setup(__props) {
391
+ const ENTRY_ICONS = {
392
+ heading: ScalarIconTextAlignLeft,
393
+ model: ScalarIconBracketsCurly,
394
+ operation: ScalarIconTerminalWindow,
395
+ tag: ScalarIconTag,
396
+ webhook: ScalarIconTerminalWindow
397
+ };
398
+ const ENTRY_LABELS = {
399
+ heading: "Heading",
400
+ operation: "Operation",
401
+ tag: "Tag",
402
+ model: "Model",
403
+ webhook: "Webhook"
404
+ };
405
+ return (_ctx, _cache) => {
406
+ return openBlock(), createBlock(unref(ScalarSearchResultItem), {
407
+ id: __props.id,
408
+ icon: ENTRY_ICONS[__props.result.item.type],
409
+ selected: __props.isSelected
410
+ }, createSlots({
411
+ default: withCtx(() => [createElementVNode("span", { class: normalizeClass({ "text-decoration-line": __props.result.item.entry.type === "operation" && __props.result.item.entry.isDeprecated }) }, [
412
+ createElementVNode("span", _hoisted_1$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)]),
413
+ createTextVNode(" " + toDisplayString(__props.result.item.title) + " ", 1),
414
+ _cache[0] || (_cache[0] = createElementVNode("span", { class: "sr-only" }, ",", -1))
415
+ ], 2)]),
416
+ _: 2
417
+ }, [__props.result.item.type !== "webhook" && (__props.result.item.method || __props.result.item.path) && __props.result.item.path !== __props.result.item.title ? {
418
+ name: "description",
419
+ fn: withCtx(() => [createElementVNode("span", _hoisted_2, [
420
+ __props.result.item.type === "operation" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(unref(HttpMethod), {
421
+ "aria-hidden": "true",
422
+ method: __props.result.item.method ?? "get"
423
+ }, null, 8, ["method"]), createElementVNode("span", _hoisted_3, " HTTP Method: " + toDisplayString(__props.result.item.method ?? "get"), 1)], 64)) : createCommentVNode("", true),
424
+ _cache[1] || (_cache[1] = createElementVNode("span", { class: "sr-only" }, "Path:\xA0", -1)),
425
+ createTextVNode(" " + toDisplayString(__props.result.item.path), 1)
426
+ ])]),
427
+ key: "0"
428
+ } : __props.result.item.description ? {
429
+ name: "description",
430
+ fn: withCtx(() => [_cache[2] || (_cache[2] = createElementVNode("span", { class: "sr-only" }, "Description:\xA0", -1)), createTextVNode(" " + toDisplayString(__props.result.item.description), 1)]),
431
+ key: "1"
432
+ } : void 0]), 1032, [
433
+ "id",
434
+ "icon",
435
+ "selected"
436
+ ]);
437
+ };
438
+ }
439
+ });
440
+ //#endregion
441
+ //#region src/features/Search/components/SearchModal.vue?vue&type=script&setup=true&lang.ts
442
+ var _hoisted_1 = {
443
+ class: "mb-0 flex flex-col",
444
+ role: "search"
445
+ };
446
+ //#endregion
447
+ //#region src/features/Search/components/SearchModal.vue
448
+ var SearchModal_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
449
+ __name: "SearchModal",
450
+ props: {
451
+ modalState: {},
452
+ document: {},
453
+ eventBus: {}
454
+ },
455
+ setup(__props) {
456
+ const props = __props;
457
+ /** Base id for the search form */
458
+ const id = nanoid();
459
+ /** An id for the results listbox */
460
+ const listboxId = `${id}-search-result`;
461
+ /** An id for the results instructions */
462
+ const instructionsId = `${id}-search-instructions`;
463
+ const { query, results } = useSearchIndex(() => props.document);
464
+ const selectedIndex = ref(void 0);
465
+ /** Clear the query value when the modal is opened */
466
+ watch(() => props.modalState.open, (open) => {
467
+ if (open) query.value = "";
468
+ });
469
+ /** Keyboard navigation */
470
+ const navigateSearchResults = (direction) => {
471
+ const offset = direction === "up" ? -1 : 1;
472
+ const length = results.value.length;
473
+ if (typeof selectedIndex.value === "number") selectedIndex.value = (selectedIndex.value + offset + length) % length;
474
+ else selectedIndex.value = offset === -1 ? length - 1 : 0;
475
+ };
476
+ /** Handle the selection of a search result */
477
+ function handleSelect(idx) {
478
+ if (typeof idx !== "number" || !results.value[idx]) return;
479
+ const result = results.value[idx];
480
+ props.modalState.hide();
481
+ props.eventBus.emit("scroll-to:nav-item", { id: result.item.id });
482
+ }
483
+ /**
484
+ * Active descendant id for the search input
485
+ * NOTE: Result items MUST share this id for the aria-activedescendant attribute to work correctly
486
+ */
487
+ const activeDescendantId = computed(() => {
488
+ const selectedResult = results.value[selectedIndex.value ?? -1];
489
+ return selectedResult ? `search-result-${selectedResult.item.id}` : void 0;
490
+ });
491
+ return (_ctx, _cache) => {
492
+ return openBlock(), createBlock(unref(ScalarModal), {
493
+ "aria-label": "Reference Search",
494
+ state: __props.modalState,
495
+ variant: "search"
496
+ }, {
497
+ default: withCtx(() => [
498
+ createElementVNode("div", _hoisted_1, [createVNode(unref(ScalarSearchInput), {
499
+ modelValue: unref(query),
500
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(query) ? query.value = $event : null),
501
+ "aria-activedescendant": activeDescendantId.value,
502
+ "aria-autocomplete": "list",
503
+ "aria-controls": listboxId,
504
+ "aria-describedby": instructionsId,
505
+ role: "combobox",
506
+ onBlur: _cache[1] || (_cache[1] = ($event) => selectedIndex.value = void 0),
507
+ onKeydown: [
508
+ _cache[2] || (_cache[2] = withKeys(withModifiers(($event) => navigateSearchResults("down"), ["stop", "prevent"]), ["down"])),
509
+ _cache[3] || (_cache[3] = withKeys(withModifiers(() => handleSelect(selectedIndex.value), ["stop", "prevent"]), ["enter"])),
510
+ _cache[4] || (_cache[4] = withKeys(withModifiers(($event) => navigateSearchResults("up"), ["stop", "prevent"]), ["up"]))
511
+ ]
512
+ }, null, 8, ["modelValue", "aria-activedescendant"])]),
513
+ createVNode(unref(ScalarSearchResultList), {
514
+ id: listboxId,
515
+ "aria-label": "Reference Search Results",
516
+ class: "custom-scroll p-1 pt-0",
517
+ noResults: !unref(results).length
518
+ }, {
519
+ query: withCtx(() => [createTextVNode(toDisplayString(unref(query)), 1)]),
520
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(results), (result, idx) => {
521
+ return openBlock(), createBlock(SearchResult_default, {
522
+ id: `search-result-${result.item.id}`,
523
+ key: result.refIndex,
524
+ isSelected: selectedIndex.value === idx,
525
+ result,
526
+ onClick: withModifiers(() => handleSelect(idx), ["prevent"])
527
+ }, null, 8, [
528
+ "id",
529
+ "isSelected",
530
+ "result",
531
+ "onClick"
532
+ ]);
533
+ }), 128))]),
534
+ _: 1
535
+ }, 8, ["noResults"]),
536
+ createElementVNode("div", {
537
+ id: instructionsId,
538
+ class: "ref-search-meta"
539
+ }, [..._cache[5] || (_cache[5] = [createElementVNode("span", {
540
+ "aria-hidden": "true",
541
+ class: "contents"
542
+ }, [createElementVNode("span", null, "↑↓ Navigate"), createElementVNode("span", null, "⏎ Select")], -1), createElementVNode("span", { class: "sr-only" }, " Press up arrow / down arrow to navigate, enter to select, type to filter results ", -1)])])
543
+ ]),
544
+ _: 1
545
+ }, 8, ["state"]);
546
+ };
547
+ }
548
+ }), [["__scopeId", "data-v-c1c368f9"]]);
549
+ //#endregion
550
+ //#region src/features/Search/components/SearchButton.vue
551
+ var SearchButton_default = /* @__PURE__ */ defineComponent({
552
+ __name: "SearchButton",
553
+ props: {
554
+ forceIcon: { type: Boolean },
555
+ searchHotKey: { default: "k" },
556
+ hideModels: {
557
+ type: Boolean,
558
+ default: false
559
+ },
560
+ document: {},
561
+ eventBus: {}
562
+ },
563
+ setup(__props) {
564
+ const button = ref();
565
+ const modalState = useModal();
566
+ const handleHotKey = (e) => {
567
+ if ((isMacOS() ? e.metaKey : e.ctrlKey) && e.key === __props.searchHotKey) {
568
+ e.preventDefault();
569
+ e.stopPropagation();
570
+ if (modalState.open) modalState.hide();
571
+ else modalState.show();
572
+ }
573
+ };
574
+ watch(() => modalState.open, async (next, prev) => {
575
+ if (!next && prev) {
576
+ await nextTick();
577
+ button.value?.$el.focus();
578
+ }
579
+ });
580
+ onMounted(() => window.addEventListener("keydown", handleHotKey));
581
+ onBeforeUnmount(() => window.removeEventListener("keydown", handleHotKey));
582
+ function handleClick() {
583
+ modalState.show();
584
+ }
585
+ return (_ctx, _cache) => {
586
+ return openBlock(), createElementBlock(Fragment, null, [__props.forceIcon ? (openBlock(), createBlock(unref(ScalarIconButton), {
587
+ key: 0,
588
+ icon: unref(ScalarIconMagnifyingGlass),
589
+ label: "Search",
590
+ onClick: handleClick
591
+ }, null, 8, ["icon"])) : (openBlock(), createBlock(unref(ScalarSidebarSearchButton), {
592
+ key: 1,
593
+ ref_key: "button",
594
+ ref: button,
595
+ class: normalizeClass(["w-full", _ctx.$attrs.class]),
596
+ onClick: handleClick
597
+ }, {
598
+ shortcut: withCtx(() => [unref(isMacOS)() ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[0] || (_cache[0] = createElementVNode("span", { class: "sr-only" }, "Command", -1)), _cache[1] || (_cache[1] = createElementVNode("span", { "aria-hidden": "true" }, "⌘", -1))], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [_cache[2] || (_cache[2] = createElementVNode("span", { class: "sr-only" }, "CTRL", -1)), _cache[3] || (_cache[3] = createElementVNode("span", { "aria-hidden": "true" }, "⌃", -1))], 64)), createTextVNode(" " + toDisplayString(__props.searchHotKey), 1)]),
599
+ default: withCtx(() => [_cache[4] || (_cache[4] = createElementVNode("span", { class: "sr-only" }, "Open Search", -1)), _cache[5] || (_cache[5] = createElementVNode("span", {
600
+ "aria-hidden": "true",
601
+ class: "sidebar-search-placeholder"
602
+ }, " Search ", -1))]),
603
+ _: 1
604
+ }, 8, ["class"])), createVNode(SearchModal_default, {
605
+ document: __props.document,
606
+ eventBus: __props.eventBus,
607
+ hideModels: __props.hideModels,
608
+ modalState: unref(modalState)
609
+ }, null, 8, [
610
+ "document",
611
+ "eventBus",
612
+ "hideModels",
613
+ "modalState"
614
+ ])], 64);
615
+ };
616
+ }
617
+ });
618
+ //#endregion
619
+ export { DocumentSelector_default as i, SearchModal_default as n, createEmptySpecification as r, SearchButton_default as t };
620
+
621
+ //# sourceMappingURL=SearchButton-xzhIpMCZ.js.map