@scalar/api-reference 1.48.8 → 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 (381) hide show
  1. package/CHANGELOG.md +40 -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 +40748 -34662
  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/ApiReference.vue.d.ts.map +1 -1
  23. package/dist/components/Badge/index.d.ts +1 -1
  24. package/dist/components/Content/Auth/index.d.ts +1 -1
  25. package/dist/components/Content/Content.vue.d.ts +2 -4
  26. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  27. package/dist/components/Content/Models/ModelTag.vue.d.ts +3 -3
  28. package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
  29. package/dist/components/Content/Models/index.d.ts +2 -2
  30. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  31. package/dist/components/Content/Schema/Schema.vue.d.ts +1 -1
  32. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +2 -2
  33. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +1 -1
  34. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -1
  35. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  36. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
  37. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  38. package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts +1 -1
  39. package/dist/components/Content/Schema/index.d.ts +4 -4
  40. package/dist/components/Content/Tags/components/ModernLayout.vue.d.ts +2 -2
  41. package/dist/components/Content/Tags/components/ModernLayout.vue.d.ts.map +1 -1
  42. package/dist/components/Content/Tags/index.d.ts +1 -1
  43. package/dist/components/Content/index.d.ts +2 -2
  44. package/dist/components/HttpMethod/index.d.ts +1 -1
  45. package/dist/components/Lazy/Lazy.vue.d.ts +3 -0
  46. package/dist/components/Lazy/Lazy.vue.d.ts.map +1 -1
  47. package/dist/components/LinkList/index.d.ts +1 -1
  48. package/dist/components/OperationsList/index.d.ts +1 -1
  49. package/dist/components/RenderPlugins/index.d.ts +1 -1
  50. package/dist/components/Section/index.d.ts +10 -10
  51. package/dist/components/SectionFlare/index.d.ts +1 -1
  52. package/dist/components/index.d.ts +5 -5
  53. package/dist/components/index.js +102 -42
  54. package/dist/components/index.js.map +1 -0
  55. package/dist/features/Operation/components/OperationParameters.vue.d.ts +1 -1
  56. package/dist/features/Operation/components/OperationResponses.vue.d.ts +1 -1
  57. package/dist/features/Operation/components/ParameterList.vue.d.ts +1 -1
  58. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +1 -1
  59. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +1 -1
  60. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +1 -1
  61. package/dist/features/Operation/index.d.ts +1 -1
  62. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +1 -1
  63. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +1 -1
  64. package/dist/features/Search/components/SearchResult.vue.d.ts +1 -1
  65. package/dist/features/Search/helpers/create-fuse-instance.d.ts +1 -1
  66. package/dist/features/Search/helpers/create-search-index.d.ts +1 -1
  67. package/dist/features/Search/index.d.ts +2 -2
  68. package/dist/features/Search/types.d.ts +1 -1
  69. package/dist/features/ask-agent-button/AskAgentButton.vue.d.ts.map +1 -1
  70. package/dist/features/developer-tools/index.d.ts +1 -1
  71. package/dist/features/example-responses/index.d.ts +1 -1
  72. package/dist/features/external-docs/index.d.ts +1 -1
  73. package/dist/features/index.d.ts +2 -2
  74. package/dist/features/index.js +4 -10
  75. package/dist/features/info-object/index.d.ts +3 -3
  76. package/dist/features/specification-extension/index.d.ts +2 -2
  77. package/dist/features/test-request-button/index.d.ts +1 -1
  78. package/dist/features/x-badges/index.d.ts +1 -1
  79. package/dist/helpers/download.d.ts +1 -1
  80. package/dist/helpers/download.d.ts.map +1 -1
  81. package/dist/helpers/id-routing.d.ts +4 -0
  82. package/dist/helpers/id-routing.d.ts.map +1 -1
  83. package/dist/helpers/index.d.ts +8 -8
  84. package/dist/helpers/index.js +3 -24
  85. package/dist/helpers/lazy-bus.d.ts +19 -19
  86. package/dist/helpers/lazy-bus.d.ts.map +1 -1
  87. package/dist/hooks/index.d.ts +2 -2
  88. package/dist/hooks/index.js +3 -8
  89. package/dist/index.d.ts +5 -5
  90. package/dist/index.js +7 -14
  91. package/dist/lazy-bus-CV8Ox5hD.js +333 -0
  92. package/dist/lazy-bus-CV8Ox5hD.js.map +1 -0
  93. package/dist/normalize-configurations-DcVpOEjD.js +232 -0
  94. package/dist/normalize-configurations-DcVpOEjD.js.map +1 -0
  95. package/dist/plugins/hooks/usePluginManager.d.ts +1 -1
  96. package/dist/plugins/index.d.ts +3 -3
  97. package/dist/plugins/index.js +2 -9
  98. package/dist/plugins-4EyiUD_A.js +80 -0
  99. package/dist/plugins-4EyiUD_A.js.map +1 -0
  100. package/dist/src-DqcYVBWI.js +1686 -0
  101. package/dist/src-DqcYVBWI.js.map +1 -0
  102. package/dist/ssr.d.ts +2 -2
  103. package/dist/ssr.js +7 -14
  104. package/dist/storage--3JuzjCI.js +42 -0
  105. package/dist/storage--3JuzjCI.js.map +1 -0
  106. package/dist/style.css +6840 -7397
  107. package/dist/urls-gPTXGgbj.js +17 -0
  108. package/dist/urls-gPTXGgbj.js.map +1 -0
  109. package/dist/use-agent-Bnm1de0n.js +60 -0
  110. package/dist/use-agent-Bnm1de0n.js.map +1 -0
  111. package/dist/use-intersection-8QqPi2O-.js +24 -0
  112. package/dist/use-intersection-8QqPi2O-.js.map +1 -0
  113. package/package.json +25 -27
  114. package/dist/_virtual/_plugin-vue_export-helper.js +0 -10
  115. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +0 -7
  116. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +0 -123
  117. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +0 -7
  118. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +0 -142
  119. package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js +0 -24
  120. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +0 -7
  121. package/dist/blocks/scalar-info-block/components/DownloadLink.vue2.js +0 -63
  122. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js +0 -59
  123. package/dist/blocks/scalar-info-block/components/InfoBlock.vue2.js +0 -4
  124. package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +0 -7
  125. package/dist/blocks/scalar-info-block/components/InfoDescription.vue2.js +0 -70
  126. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js +0 -38
  127. package/dist/blocks/scalar-info-block/components/InfoLinks.vue2.js +0 -4
  128. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js +0 -38
  129. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue2.js +0 -4
  130. package/dist/blocks/scalar-info-block/components/InfoVersion.vue.js +0 -28
  131. package/dist/blocks/scalar-info-block/components/InfoVersion.vue2.js +0 -4
  132. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js +0 -7
  133. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue2.js +0 -19
  134. package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +0 -14
  135. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +0 -7
  136. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue2.js +0 -112
  137. package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js +0 -21
  138. package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue2.js +0 -4
  139. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js +0 -76
  140. package/dist/blocks/scalar-server-selector-block/components/Selector.vue2.js +0 -4
  141. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +0 -72
  142. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue2.js +0 -4
  143. package/dist/components/AgentScalar/AgentScalarButton.vue.js +0 -22
  144. package/dist/components/AgentScalar/AgentScalarButton.vue2.js +0 -4
  145. package/dist/components/AgentScalar/AgentScalarChatInterface.vue.js +0 -4
  146. package/dist/components/AgentScalar/AgentScalarChatInterface.vue2.js +0 -29
  147. package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +0 -7
  148. package/dist/components/AgentScalar/AgentScalarDrawer.vue2.js +0 -78
  149. package/dist/components/AgentScalar/OpenMCPButton.vue.js +0 -7
  150. package/dist/components/AgentScalar/OpenMCPButton.vue2.js +0 -191
  151. package/dist/components/Anchor/Anchor.vue.js +0 -51
  152. package/dist/components/Anchor/Anchor.vue2.js +0 -4
  153. package/dist/components/Anchor/WithBreadcrumb.vue.js +0 -41
  154. package/dist/components/Anchor/WithBreadcrumb.vue2.js +0 -4
  155. package/dist/components/ApiReference.vue.js +0 -10
  156. package/dist/components/ApiReference.vue2.js +0 -744
  157. package/dist/components/Badge/Badge.vue.js +0 -7
  158. package/dist/components/Badge/Badge.vue2.js +0 -26
  159. package/dist/components/ClassicHeader.vue.js +0 -21
  160. package/dist/components/Content/Auth/Auth.vue.js +0 -77
  161. package/dist/components/Content/Auth/Auth.vue2.js +0 -4
  162. package/dist/components/Content/Auth/helpers/get-default-security.js +0 -55
  163. package/dist/components/Content/Content.vue.js +0 -177
  164. package/dist/components/Content/Content.vue3.js +0 -5
  165. package/dist/components/Content/Models/Model.vue.js +0 -47
  166. package/dist/components/Content/Models/Model.vue2.js +0 -4
  167. package/dist/components/Content/Models/ModelTag.vue.js +0 -82
  168. package/dist/components/Content/Models/ModelTag.vue2.js +0 -4
  169. package/dist/components/Content/Models/components/ClassicLayout.vue.js +0 -7
  170. package/dist/components/Content/Models/components/ClassicLayout.vue2.js +0 -78
  171. package/dist/components/Content/Models/components/ModernLayout.vue.js +0 -61
  172. package/dist/components/Content/Models/components/ModernLayout.vue2.js +0 -4
  173. package/dist/components/Content/Operations/TraversedEntry.vue.js +0 -145
  174. package/dist/components/Content/Operations/TraversedEntry.vue2.js +0 -4
  175. package/dist/components/Content/Schema/RenderString.vue.js +0 -27
  176. package/dist/components/Content/Schema/RenderString.vue2.js +0 -4
  177. package/dist/components/Content/Schema/Schema.vue.js +0 -7
  178. package/dist/components/Content/Schema/Schema.vue2.js +0 -193
  179. package/dist/components/Content/Schema/SchemaComposition.vue.js +0 -120
  180. package/dist/components/Content/Schema/SchemaComposition.vue2.js +0 -4
  181. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +0 -7
  182. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue2.js +0 -36
  183. package/dist/components/Content/Schema/SchemaEnums.vue.js +0 -7
  184. package/dist/components/Content/Schema/SchemaEnums.vue2.js +0 -112
  185. package/dist/components/Content/Schema/SchemaHeading.vue.js +0 -7
  186. package/dist/components/Content/Schema/SchemaHeading.vue2.js +0 -61
  187. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js +0 -66
  188. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue2.js +0 -4
  189. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +0 -120
  190. package/dist/components/Content/Schema/SchemaObjectProperties.vue2.js +0 -4
  191. package/dist/components/Content/Schema/SchemaProperty.vue.js +0 -7
  192. package/dist/components/Content/Schema/SchemaProperty.vue2.js +0 -228
  193. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +0 -7
  194. package/dist/components/Content/Schema/SchemaPropertyDefault.vue2.js +0 -45
  195. package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +0 -7
  196. package/dist/components/Content/Schema/SchemaPropertyDetail.vue2.js +0 -40
  197. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +0 -7
  198. package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +0 -80
  199. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +0 -7
  200. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +0 -318
  201. package/dist/components/Content/Schema/helpers/format-example.js +0 -41
  202. package/dist/components/Content/Schema/helpers/format-value.js +0 -35
  203. package/dist/components/Content/Schema/helpers/get-compositions-to-render.js +0 -31
  204. package/dist/components/Content/Schema/helpers/get-enum-values.js +0 -20
  205. package/dist/components/Content/Schema/helpers/get-property-description.js +0 -34
  206. package/dist/components/Content/Schema/helpers/get-ref-name.js +0 -14
  207. package/dist/components/Content/Schema/helpers/get-schema-type.js +0 -47
  208. package/dist/components/Content/Schema/helpers/has-complex-array-items.js +0 -48
  209. package/dist/components/Content/Schema/helpers/is-empty-schema-object.js +0 -13
  210. package/dist/components/Content/Schema/helpers/is-type-object.js +0 -27
  211. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +0 -215
  212. package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +0 -64
  213. package/dist/components/Content/Schema/helpers/schema-composition.js +0 -4
  214. package/dist/components/Content/Schema/helpers/schema-name.js +0 -24
  215. package/dist/components/Content/Schema/helpers/should-display-description.js +0 -12
  216. package/dist/components/Content/Schema/helpers/should-display-heading.js +0 -12
  217. package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js +0 -15
  218. package/dist/components/Content/Schema/helpers/sort-property-names.js +0 -71
  219. package/dist/components/Content/Tags/Tag.vue.js +0 -46
  220. package/dist/components/Content/Tags/Tag.vue2.js +0 -4
  221. package/dist/components/Content/Tags/components/ClassicLayout.vue.js +0 -7
  222. package/dist/components/Content/Tags/components/ClassicLayout.vue2.js +0 -57
  223. package/dist/components/Content/Tags/components/ModernLayout.vue.js +0 -7
  224. package/dist/components/Content/Tags/components/ModernLayout.vue2.js +0 -64
  225. package/dist/components/Content/Tags/components/TagSection.vue.js +0 -100
  226. package/dist/components/Content/Tags/components/TagSection.vue2.js +0 -4
  227. package/dist/components/GettingStarted.vue.js +0 -7
  228. package/dist/components/GettingStarted.vue2.js +0 -82
  229. package/dist/components/HttpMethod/HttpMethod.vue.js +0 -34
  230. package/dist/components/HttpMethod/HttpMethod.vue2.js +0 -4
  231. package/dist/components/IntersectionObserver.vue.js +0 -55
  232. package/dist/components/IntersectionObserver.vue2.js +0 -4
  233. package/dist/components/Lazy/Lazy.vue.js +0 -17
  234. package/dist/components/Lazy/Lazy.vue2.js +0 -4
  235. package/dist/components/LinkList/LinkList.vue.js +0 -7
  236. package/dist/components/LinkList/LinkList.vue2.js +0 -48
  237. package/dist/components/LoadingSkeleton.vue.js +0 -7
  238. package/dist/components/LoadingSkeleton.vue2.js +0 -20
  239. package/dist/components/MobileHeader.vue.js +0 -62
  240. package/dist/components/MobileHeader.vue2.js +0 -4
  241. package/dist/components/OperationPath.vue.js +0 -7
  242. package/dist/components/OperationPath.vue2.js +0 -30
  243. package/dist/components/OperationsList/OperationsList.vue.js +0 -7
  244. package/dist/components/OperationsList/OperationsList.vue2.js +0 -61
  245. package/dist/components/OperationsList/OperationsListItem.vue.js +0 -7
  246. package/dist/components/OperationsList/OperationsListItem.vue2.js +0 -68
  247. package/dist/components/RenderPlugins/RenderPlugins.vue.js +0 -43
  248. package/dist/components/RenderPlugins/RenderPlugins.vue2.js +0 -4
  249. package/dist/components/ScreenReader.vue.js +0 -7
  250. package/dist/components/ScreenReader.vue2.js +0 -21
  251. package/dist/components/Section/CompactSection.vue.js +0 -7
  252. package/dist/components/Section/CompactSection.vue2.js +0 -60
  253. package/dist/components/Section/Section.vue.js +0 -7
  254. package/dist/components/Section/Section.vue2.js +0 -23
  255. package/dist/components/Section/SectionAccordion.vue.js +0 -7
  256. package/dist/components/Section/SectionAccordion.vue2.js +0 -76
  257. package/dist/components/Section/SectionColumn.vue.js +0 -14
  258. package/dist/components/Section/SectionColumns.vue.js +0 -14
  259. package/dist/components/Section/SectionContainer.vue.js +0 -7
  260. package/dist/components/Section/SectionContainer.vue2.js +0 -21
  261. package/dist/components/Section/SectionContainerAccordion.vue.js +0 -7
  262. package/dist/components/Section/SectionContainerAccordion.vue2.js +0 -54
  263. package/dist/components/Section/SectionContent.vue.js +0 -7
  264. package/dist/components/Section/SectionContent.vue2.js +0 -22
  265. package/dist/components/Section/SectionHeader.vue.js +0 -7
  266. package/dist/components/Section/SectionHeader.vue2.js +0 -26
  267. package/dist/components/Section/SectionHeaderTag.vue.js +0 -7
  268. package/dist/components/Section/SectionHeaderTag.vue2.js +0 -20
  269. package/dist/components/SectionFlare/SectionFlare.vue.js +0 -14
  270. package/dist/components/ShowMoreButton.vue.js +0 -7
  271. package/dist/components/ShowMoreButton.vue2.js +0 -23
  272. package/dist/consts/urls.js +0 -16
  273. package/dist/features/Operation/Operation.vue.js +0 -100
  274. package/dist/features/Operation/Operation.vue2.js +0 -4
  275. package/dist/features/Operation/components/ContentTypeSelect.vue.js +0 -88
  276. package/dist/features/Operation/components/ContentTypeSelect.vue2.js +0 -4
  277. package/dist/features/Operation/components/Header.vue.js +0 -33
  278. package/dist/features/Operation/components/Header.vue2.js +0 -4
  279. package/dist/features/Operation/components/Headers.vue.js +0 -7
  280. package/dist/features/Operation/components/Headers.vue2.js +0 -71
  281. package/dist/features/Operation/components/OperationParameters.vue.js +0 -92
  282. package/dist/features/Operation/components/OperationParameters.vue2.js +0 -4
  283. package/dist/features/Operation/components/OperationResponses.vue.js +0 -44
  284. package/dist/features/Operation/components/OperationResponses.vue2.js +0 -4
  285. package/dist/features/Operation/components/ParameterList.vue.js +0 -50
  286. package/dist/features/Operation/components/ParameterList.vue2.js +0 -4
  287. package/dist/features/Operation/components/ParameterListItem.vue.js +0 -7
  288. package/dist/features/Operation/components/ParameterListItem.vue2.js +0 -163
  289. package/dist/features/Operation/components/RequestBody.vue.js +0 -7
  290. package/dist/features/Operation/components/RequestBody.vue2.js +0 -164
  291. package/dist/features/Operation/components/callbacks/Callback.vue.js +0 -7
  292. package/dist/features/Operation/components/callbacks/Callback.vue2.js +0 -60
  293. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +0 -63
  294. package/dist/features/Operation/components/callbacks/Callbacks.vue2.js +0 -4
  295. package/dist/features/Operation/helpers/filter-selected-security.js +0 -28
  296. package/dist/features/Operation/helpers/get-first-server.js +0 -25
  297. package/dist/features/Operation/layouts/ClassicLayout.vue.js +0 -7
  298. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +0 -243
  299. package/dist/features/Operation/layouts/ModernLayout.vue.js +0 -7
  300. package/dist/features/Operation/layouts/ModernLayout.vue2.js +0 -256
  301. package/dist/features/Search/components/SearchButton.vue.js +0 -88
  302. package/dist/features/Search/components/SearchButton.vue2.js +0 -4
  303. package/dist/features/Search/components/SearchModal.vue.js +0 -7
  304. package/dist/features/Search/components/SearchModal.vue2.js +0 -120
  305. package/dist/features/Search/components/SearchResult.vue.js +0 -84
  306. package/dist/features/Search/components/SearchResult.vue2.js +0 -4
  307. package/dist/features/Search/helpers/create-fuse-instance.js +0 -43
  308. package/dist/features/Search/helpers/create-search-index.js +0 -119
  309. package/dist/features/Search/hooks/useSearchIndex.js +0 -33
  310. package/dist/features/ask-agent-button/AskAgentButton.vue.js +0 -7
  311. package/dist/features/ask-agent-button/AskAgentButton.vue2.js +0 -47
  312. package/dist/features/developer-tools/DeveloperTools.vue.js +0 -60
  313. package/dist/features/developer-tools/DeveloperTools.vue2.js +0 -4
  314. package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js +0 -13
  315. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js +0 -33
  316. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue2.js +0 -4
  317. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js +0 -138
  318. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue2.js +0 -4
  319. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.js +0 -66
  320. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue2.js +0 -4
  321. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js +0 -54
  322. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue2.js +0 -4
  323. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js +0 -71
  324. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue2.js +0 -4
  325. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js +0 -63
  326. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue2.js +0 -4
  327. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js +0 -73
  328. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue2.js +0 -4
  329. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js +0 -57
  330. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue2.js +0 -4
  331. package/dist/features/developer-tools/components/DeployApiReference.vue.js +0 -35
  332. package/dist/features/developer-tools/components/DeployApiReference.vue2.js +0 -4
  333. package/dist/features/developer-tools/components/ModifyConfiguration.vue.js +0 -103
  334. package/dist/features/developer-tools/components/ModifyConfiguration.vue2.js +0 -4
  335. package/dist/features/developer-tools/components/ShareApiReference.vue.js +0 -35
  336. package/dist/features/developer-tools/components/ShareApiReference.vue2.js +0 -4
  337. package/dist/features/example-responses/ExampleResponse.vue.js +0 -7
  338. package/dist/features/example-responses/ExampleResponse.vue2.js +0 -61
  339. package/dist/features/example-responses/ExampleResponseTab.vue.js +0 -7
  340. package/dist/features/example-responses/ExampleResponseTab.vue2.js +0 -25
  341. package/dist/features/example-responses/ExampleResponseTabList.vue.js +0 -7
  342. package/dist/features/example-responses/ExampleResponseTabList.vue2.js +0 -37
  343. package/dist/features/example-responses/ExampleResponses.vue.js +0 -7
  344. package/dist/features/example-responses/ExampleResponses.vue2.js +0 -181
  345. package/dist/features/example-responses/ExampleSchema.vue.js +0 -42
  346. package/dist/features/example-responses/ExampleSchema.vue2.js +0 -4
  347. package/dist/features/example-responses/has-response-content.js +0 -28
  348. package/dist/features/external-docs/ExternalDocs.vue.js +0 -42
  349. package/dist/features/external-docs/ExternalDocs.vue2.js +0 -4
  350. package/dist/features/info-object/Contact.vue.js +0 -46
  351. package/dist/features/info-object/Contact.vue2.js +0 -4
  352. package/dist/features/info-object/License.vue.js +0 -40
  353. package/dist/features/info-object/License.vue2.js +0 -4
  354. package/dist/features/info-object/TermsOfService.vue.js +0 -34
  355. package/dist/features/info-object/TermsOfService.vue2.js +0 -4
  356. package/dist/features/multiple-documents/DocumentSelector.vue.js +0 -54
  357. package/dist/features/multiple-documents/DocumentSelector.vue2.js +0 -4
  358. package/dist/features/specification-extension/SpecificationExtension.vue.js +0 -4
  359. package/dist/features/specification-extension/SpecificationExtension.vue2.js +0 -52
  360. package/dist/features/specification-extension/helpers.js +0 -9
  361. package/dist/features/test-request-button/TestRequestButton.vue.js +0 -7
  362. package/dist/features/test-request-button/TestRequestButton.vue2.js +0 -46
  363. package/dist/features/x-badges/XBadges.vue.js +0 -35
  364. package/dist/features/x-badges/XBadges.vue2.js +0 -4
  365. package/dist/helpers/color-mode.js +0 -9
  366. package/dist/helpers/download.js +0 -45
  367. package/dist/helpers/id-routing.js +0 -63
  368. package/dist/helpers/lazy-bus.js +0 -160
  369. package/dist/helpers/load-from-perssistance.js +0 -17
  370. package/dist/helpers/map-config-plugins.js +0 -27
  371. package/dist/helpers/map-config-to-workspace-store.js +0 -45
  372. package/dist/helpers/normalize-configurations.js +0 -69
  373. package/dist/helpers/openapi.js +0 -135
  374. package/dist/helpers/storage.js +0 -47
  375. package/dist/helpers/upload-temp-document.js +0 -24
  376. package/dist/hooks/use-agent.js +0 -42
  377. package/dist/hooks/use-intersection.js +0 -32
  378. package/dist/plugins/hooks/usePluginManager.js +0 -14
  379. package/dist/plugins/persistance-plugin.js +0 -48
  380. package/dist/plugins/plugin-manager.js +0 -39
  381. package/dist/standalone/lib/html-api.js +0 -81
@@ -1,744 +0,0 @@
1
- import { defineComponent, computed, ref, watch, useId, provide, onServerPrefetch, onBeforeMount, useTemplateRef, onMounted, onBeforeUnmount, createElementBlock, openBlock, createBlock, createElementVNode, createVNode, resolveDynamicComponent, withCtx, createTextVNode, toDisplayString, normalizeClass, createCommentVNode, unref, renderSlot, normalizeProps, guardReactiveProps, createSlots } from "vue";
2
- import { provideUseId } from "@headlessui/vue";
3
- import { OpenApiClientButton } from "@scalar/api-client/components";
4
- import { createApiClientModal } from "@scalar/api-client/v2/features/modal";
5
- import { getActiveEnvironment, getServers } from "@scalar/api-client/v2/helpers";
6
- import { addScalarClassesToHeadless, ScalarSidebarFooter, ScalarColorModeToggleButton, ScalarColorModeToggleIcon } from "@scalar/components";
7
- import { isLocalUrl } from "@scalar/helpers/url/is-local-url";
8
- import { createSidebarState, scrollSidebarToTop, ScalarSidebar } from "@scalar/sidebar";
9
- import { hasObtrusiveScrollbars, getThemeStyles } from "@scalar/themes";
10
- import { apiReferenceConfigurationSchema } from "@scalar/types/api-reference";
11
- import { useBreakpoints } from "@scalar/use-hooks/useBreakpoints";
12
- import { useClipboard } from "@scalar/use-hooks/useClipboard";
13
- import { useColorMode } from "@scalar/use-hooks/useColorMode";
14
- import { ScalarToasts } from "@scalar/use-toasts";
15
- import { createWorkspaceStore } from "@scalar/workspace-store/client";
16
- import { createWorkspaceEventBus } from "@scalar/workspace-store/events";
17
- import { useScrollLock } from "@vueuse/core";
18
- import diff from "microdiff";
19
- import ClassicHeader from "./ClassicHeader.vue.js";
20
- import _sfc_main$5 from "./Content/Content.vue.js";
21
- /* empty css */
22
- import _sfc_main$1 from "./MobileHeader.vue.js";
23
- import _sfc_main$2 from "../features/multiple-documents/DocumentSelector.vue.js";
24
- import _sfc_main$3 from "../features/Search/components/SearchButton.vue.js";
25
- import { getSystemModePreference } from "../helpers/color-mode.js";
26
- import { downloadDocument } from "../helpers/download.js";
27
- import { getIdFromUrl, makeUrlFromId } from "../helpers/id-routing.js";
28
- import { intersectionEnabled, addToPriorityQueue, scrollToLazy, blockIntersection } from "../helpers/lazy-bus.js";
29
- import { loadClientFromStorage, loadAuthFromStorage } from "../helpers/load-from-perssistance.js";
30
- import { mapConfigPlugins } from "../helpers/map-config-plugins.js";
31
- import { mapConfigToWorkspaceStore } from "../helpers/map-config-to-workspace-store.js";
32
- import { normalizeConfigurations } from "../helpers/normalize-configurations.js";
33
- import { useAgent, AGENT_CONTEXT_SYMBOL } from "../hooks/use-agent.js";
34
- import { useIntersection } from "../hooks/use-intersection.js";
35
- import { persistencePlugin } from "../plugins/persistance-plugin.js";
36
- import { PLUGIN_MANAGER_SYMBOL } from "../plugins/hooks/usePluginManager.js";
37
- import { createPluginManager } from "../plugins/plugin-manager.js";
38
- import AgentScalarDrawer from "./AgentScalar/AgentScalarDrawer.vue.js";
39
- import OpenMCPButton from "./AgentScalar/OpenMCPButton.vue.js";
40
- import _sfc_main$4 from "./AgentScalar/AgentScalarButton.vue.js";
41
- import _sfc_main$6 from "../features/developer-tools/DeveloperTools.vue.js";
42
- const _hoisted_1 = {
43
- key: 1,
44
- class: "flex gap-1.5 px-3 pt-3"
45
- };
46
- const _hoisted_2 = { key: 1 };
47
- const _hoisted_3 = ["aria-label", "inert"];
48
- const _hoisted_4 = { class: "w-64 empty:hidden" };
49
- const _hoisted_5 = {
50
- key: 2,
51
- class: "references-footer"
52
- };
53
- const _sfc_main = /* @__PURE__ */ defineComponent({
54
- __name: "ApiReference",
55
- props: {
56
- configuration: {}
57
- },
58
- setup(__props, { expose: __expose }) {
59
- const props = __props;
60
- const { mediaQueries } = useBreakpoints();
61
- const { copyToClipboard } = useClipboard();
62
- const isDevelopment = false;
63
- const obtrusiveScrollbars = computed(hasObtrusiveScrollbars);
64
- const eventBus = createWorkspaceEventBus({ debug: isDevelopment });
65
- const isSidebarOpen = ref(false);
66
- watch(
67
- () => mediaQueries?.lg?.value,
68
- (newValue, oldValue) => {
69
- if (oldValue && !newValue) {
70
- isSidebarOpen.value = false;
71
- }
72
- }
73
- );
74
- provideUseId(() => useId());
75
- const configList = computed(() => normalizeConfigurations(props.configuration));
76
- const isMultiDocument = computed(() => Object.keys(configList.value).length > 1);
77
- const activeSlug = ref(
78
- Object.values(configList.value).find((c) => c.default)?.slug ?? configList.value[Object.keys(configList.value)?.[0] ?? ""]?.slug ?? ""
79
- );
80
- if (typeof window !== "undefined") {
81
- const url = new URL(window.location.href);
82
- const apiParam = url.searchParams.get("api");
83
- if (apiParam && configList.value[apiParam]) {
84
- activeSlug.value = apiParam;
85
- const idFromUrl = getIdFromUrl(
86
- url,
87
- configList.value[apiParam].config.pathRouting?.basePath,
88
- apiParam
89
- );
90
- const newUrl = makeUrlFromId(
91
- idFromUrl,
92
- configList.value[apiParam].config.pathRouting?.basePath,
93
- isMultiDocument.value
94
- );
95
- if (newUrl) {
96
- newUrl.searchParams.delete("api");
97
- window.history.replaceState({}, "", newUrl.toString());
98
- }
99
- }
100
- const basePaths = Object.values(configList.value).map(
101
- (c) => c.config.pathRouting?.basePath
102
- );
103
- const initialId = getIdFromUrl(
104
- url,
105
- basePaths.find(
106
- (p) => p && url.pathname.startsWith(p.startsWith("/") ? p : `/${p}`)
107
- ),
108
- isMultiDocument.value ? void 0 : activeSlug.value
109
- );
110
- const documentSlug = initialId.split("/")[0];
111
- if (documentSlug && configList.value[documentSlug]) {
112
- activeSlug.value = documentSlug;
113
- }
114
- }
115
- const documentOptionList = computed(
116
- () => Object.values(configList.value).map((c) => ({
117
- label: c.title,
118
- id: c.slug
119
- }))
120
- );
121
- const configurationOverrides = ref({});
122
- const mergedConfig = computed(() => ({
123
- // Provides a default set of values when the lookup fails
124
- ...apiReferenceConfigurationSchema.parse({}),
125
- // The active configuration based on the slug
126
- ...configList.value[activeSlug.value]?.config,
127
- // Any overrides from the localhost toolbar
128
- ...configurationOverrides.value
129
- }));
130
- const basePath = computed(() => mergedConfig.value.pathRouting?.basePath);
131
- const themeStyle = computed(
132
- () => getThemeStyles(mergedConfig.value.theme, {
133
- fonts: mergedConfig.value.withDefaultFonts
134
- })
135
- );
136
- provide(
137
- PLUGIN_MANAGER_SYMBOL,
138
- createPluginManager({
139
- plugins: Object.values(configList.value).flatMap(
140
- (c) => c.config.plugins ?? []
141
- )
142
- })
143
- );
144
- if (mergedConfig.value.redirect && typeof window !== "undefined") {
145
- const newPath = mergedConfig.value.redirect(
146
- (mergedConfig.value.pathRouting ? window.location.pathname : "") + window.location.hash
147
- );
148
- if (newPath) {
149
- window.history.replaceState({}, "", newPath);
150
- }
151
- }
152
- function syncSlugAndUrlWithDocument(slug, elementId, config) {
153
- const url = makeUrlFromId(
154
- elementId || slug,
155
- config.pathRouting?.basePath,
156
- isMultiDocument.value
157
- );
158
- if (url) {
159
- window.history.replaceState({}, "", url.toString());
160
- }
161
- activeSlug.value = slug;
162
- }
163
- const workspaceStore = createWorkspaceStore({
164
- verbose: isDevelopment,
165
- plugins: [
166
- persistencePlugin({
167
- prefix: () => activeSlug.value,
168
- persistAuth: () => mergedConfig.value.persistAuth ?? false
169
- })
170
- ]
171
- });
172
- const { toggleColorMode, isDarkMode } = useColorMode({
173
- initialColorMode: {
174
- true: "dark",
175
- false: "light",
176
- undefined: "system"
177
- }[String(mergedConfig.value.darkMode)],
178
- overrideColorMode: mergedConfig.value.forceDarkModeState
179
- });
180
- const itemsFromWorkspace = computed(() => {
181
- return Object.entries(workspaceStore.workspace.documents).map(
182
- ([slug, document2]) => ({
183
- id: slug,
184
- type: "document",
185
- description: document2.info.description,
186
- name: document2.info.title ?? slug,
187
- title: document2.info.title ?? slug,
188
- children: document2?.["x-scalar-navigation"]?.children ?? []
189
- })
190
- );
191
- });
192
- const sidebarState = createSidebarState(itemsFromWorkspace, {
193
- hooks: {}
194
- });
195
- const setChildrenOpen = (items) => {
196
- items.forEach((item) => {
197
- if (item.type === "tag" || item.type === "models") {
198
- sidebarState.setExpanded(item.id, true);
199
- }
200
- if ("children" in item && item.children) {
201
- setChildrenOpen(item.children);
202
- }
203
- });
204
- };
205
- const sidebarItems = computed(() => {
206
- const config = mergedConfig.value;
207
- if (!config) {
208
- return [];
209
- }
210
- const docItems = sidebarState.items.value.find(
211
- (item) => item.id === activeSlug.value
212
- )?.children ?? [];
213
- if (config.defaultOpenAllTags) {
214
- setChildrenOpen(docItems);
215
- }
216
- if (config.expandAllModelSections) {
217
- const models = docItems.find(
218
- (item) => item.type === "models"
219
- );
220
- if (models) {
221
- sidebarState.setExpanded(models.id, true);
222
- models.children?.forEach((child) => {
223
- sidebarState.setExpanded(child.id, true);
224
- });
225
- }
226
- }
227
- return docItems;
228
- });
229
- const infoSectionId = computed(
230
- () => sidebarItems.value.find(
231
- (item) => item.type === "text" && item.title === "Introduction"
232
- )?.id
233
- );
234
- const breadcrumb = ref("");
235
- const slotProps = computed(() => ({
236
- breadcrumb: breadcrumb.value
237
- }));
238
- const setBreadcrumb = (id) => {
239
- const item = sidebarState.getEntryById(id);
240
- if (!item || item.type === "document") {
241
- breadcrumb.value = "";
242
- } else {
243
- breadcrumb.value = item.title;
244
- }
245
- };
246
- const scrollToLazyElement = (id) => {
247
- setBreadcrumb(id);
248
- sidebarState.setSelected(id);
249
- scrollToLazy(id, sidebarState.setExpanded, sidebarState.getEntryById);
250
- };
251
- mapConfigToWorkspaceStore({
252
- config: () => mergedConfig.value,
253
- store: workspaceStore,
254
- isDarkMode
255
- });
256
- const environment = computed(
257
- () => getActiveEnvironment(
258
- workspaceStore,
259
- workspaceStore.workspace.activeDocument ?? null
260
- )
261
- );
262
- if (typeof window !== "undefined") {
263
- window.dataDumpWorkspace = () => workspaceStore;
264
- }
265
- __expose({
266
- eventBus,
267
- workspaceStore,
268
- sidebarItems
269
- });
270
- const changeSelectedDocument = async (slug, elementId) => {
271
- const normalized = configList.value[slug];
272
- if (!normalized) {
273
- console.warn(`Document ${slug} not found in configList`);
274
- return;
275
- }
276
- const config = {
277
- ...normalized.config,
278
- ...configurationOverrides.value
279
- };
280
- const onDocumentSelectPromise = config.onDocumentSelect?.();
281
- syncSlugAndUrlWithDocument(slug, elementId, config);
282
- apiClient.value?.route({
283
- documentSlug: slug,
284
- method: "get",
285
- path: "/"
286
- });
287
- const isFirstLoad = !workspaceStore.workspace.documents[slug];
288
- if (isFirstLoad) {
289
- const result = await workspaceStore.addDocument(
290
- normalized.source.url ? {
291
- name: slug,
292
- url: normalized.source.url,
293
- fetch: config.fetch
294
- } : {
295
- name: slug,
296
- document: normalized.source.content ?? {}
297
- },
298
- config
299
- );
300
- const document2 = workspaceStore.workspace.documents[slug];
301
- if (result === true && document2 !== void 0 && document2["x-scalar-selected-server"] === void 0) {
302
- const servers = getServers(
303
- normalized.config.servers ?? document2.servers,
304
- {
305
- baseServerUrl: mergedConfig.value.baseServerURL,
306
- documentUrl: normalized.source.url
307
- }
308
- );
309
- if (servers.length > 0) {
310
- workspaceStore.updateDocument(
311
- slug,
312
- "x-scalar-selected-server",
313
- servers[0].url
314
- );
315
- }
316
- }
317
- }
318
- workspaceStore.update("x-scalar-active-document", slug);
319
- if (config.persistAuth) {
320
- loadAuthFromStorage(workspaceStore, slug);
321
- }
322
- void (async () => {
323
- await onDocumentSelectPromise;
324
- void config.onLoaded?.(slug);
325
- })();
326
- if (elementId && elementId !== slug) {
327
- scrollToLazyElement(elementId);
328
- } else if (config.defaultOpenFirstTag) {
329
- const firstTag = sidebarItems.value.find((item) => item.type === "tag");
330
- if (firstTag) {
331
- sidebarState.setExpanded(firstTag.id, true);
332
- }
333
- }
334
- };
335
- watch(
336
- () => Object.values(configList.value),
337
- async (newConfigList, oldConfigList) => {
338
- const updateSource = async (updated, previous) => {
339
- if (!workspaceStore.workspace.documents[updated.slug]) {
340
- return;
341
- }
342
- if (updated.source.url && updated.source.url !== previous?.source.url) {
343
- await workspaceStore.addDocument(
344
- {
345
- name: updated.slug,
346
- url: updated.source.url,
347
- fetch: updated.config.fetch
348
- },
349
- updated.config
350
- );
351
- return;
352
- }
353
- if (!updated.source.content) {
354
- return;
355
- }
356
- if (diff(
357
- updated.source.content,
358
- previous && "content" in previous.source ? previous.source.content ?? {} : {}
359
- ).length) {
360
- await workspaceStore.addDocument(
361
- {
362
- name: updated.slug,
363
- document: updated.source.content
364
- },
365
- updated.config
366
- );
367
- }
368
- };
369
- newConfigList.forEach(
370
- (newConfig, index) => updateSource(newConfig, oldConfigList[index])
371
- );
372
- const newSlugs = newConfigList.map((c) => c.slug);
373
- const oldSlugs = oldConfigList.map((c) => c.slug);
374
- if (newSlugs.length !== oldSlugs.length || !newSlugs.every((slug, index) => slug === oldSlugs[index])) {
375
- await changeSelectedDocument(newSlugs[0] ?? "");
376
- }
377
- },
378
- {
379
- deep: true
380
- }
381
- );
382
- onServerPrefetch(() => changeSelectedDocument(activeSlug.value));
383
- onBeforeMount(async () => {
384
- loadClientFromStorage(workspaceStore);
385
- await changeSelectedDocument(
386
- activeSlug.value,
387
- getIdFromUrl(
388
- window.location.href,
389
- configList.value[activeSlug.value]?.config.pathRouting?.basePath,
390
- isMultiDocument.value ? void 0 : activeSlug.value
391
- )
392
- );
393
- });
394
- const documentUrl = computed(() => {
395
- return configList.value[activeSlug.value]?.source?.url;
396
- });
397
- const agent = useAgent({
398
- agentEnabled: computed(() => {
399
- const currentConfiguration = configList.value[activeSlug.value];
400
- if (currentConfiguration?.agent?.disabled) {
401
- return false;
402
- }
403
- if (typeof window !== "undefined" && isLocalUrl(window.location.href)) {
404
- return true;
405
- }
406
- return Boolean(configList.value[activeSlug.value]?.agent?.key);
407
- })
408
- });
409
- provide(AGENT_CONTEXT_SYMBOL, agent);
410
- const modal = useTemplateRef("modal");
411
- const apiClient = ref(null);
412
- onMounted(() => {
413
- if (!modal.value) {
414
- return;
415
- }
416
- apiClient.value = createApiClientModal({
417
- el: modal.value,
418
- eventBus,
419
- workspaceStore,
420
- options: mergedConfig,
421
- plugins: mapConfigPlugins(mergedConfig)
422
- });
423
- });
424
- onBeforeUnmount(() => {
425
- apiClient.value?.app.unmount();
426
- });
427
- eventBus.on(
428
- "server:update:selected",
429
- ({ url }) => mergedConfig.value.onServerChange?.(url)
430
- );
431
- eventBus.on("ui:download:document", async ({ format }) => {
432
- const document2 = await workspaceStore.exportActiveDocument(format);
433
- if (!document2) {
434
- console.error("No document found to download");
435
- return;
436
- }
437
- downloadDocument(document2, activeSlug.value ?? "openapi", format);
438
- });
439
- const handleSelectSidebarEntry = (id, caller) => {
440
- const item = sidebarState.getEntryById(id);
441
- if ((item?.type === "tag" || item?.type === "models" || item?.type === "text") && sidebarState.isExpanded(id) && // Only close if the item is expanded
442
- sidebarState.selectedItem.value === id) {
443
- const unblock = blockIntersection();
444
- sidebarState.setExpanded(id, false);
445
- unblock();
446
- return;
447
- }
448
- if (item?.type !== "tag" && item?.type !== "models") {
449
- isSidebarOpen.value = false;
450
- }
451
- scrollToLazyElement(id);
452
- const url = makeUrlFromId(id, basePath.value, isMultiDocument.value);
453
- if (url) {
454
- window.history.pushState({}, "", url);
455
- if (caller === "sidebar") {
456
- mergedConfig.value.onSidebarClick?.(url.toString());
457
- }
458
- }
459
- if (agent.showAgent.value) {
460
- agent.closeAgent();
461
- }
462
- };
463
- eventBus.on("select:nav-item", ({ id }) => handleSelectSidebarEntry(id));
464
- eventBus.on("scroll-to:nav-item", ({ id }) => handleSelectSidebarEntry(id));
465
- eventBus.on("intersecting:nav-item", ({ id }) => {
466
- if (!intersectionEnabled.value) {
467
- return;
468
- }
469
- sidebarState.setSelected(id);
470
- setBreadcrumb(id);
471
- scrollSidebarToTop(id);
472
- const url = makeUrlFromId(id, basePath.value, isMultiDocument.value);
473
- if (url && workspaceStore.workspace.activeDocument) {
474
- window.history.replaceState({}, "", url.toString());
475
- }
476
- });
477
- eventBus.on("toggle:nav-item", ({ id, open }) => {
478
- if (open) {
479
- mergedConfig.value.onShowMore?.(id);
480
- const entry = sidebarState.getEntryById(id);
481
- if (entry && "children" in entry && entry.children) {
482
- const first = entry.children[0];
483
- if (first) {
484
- addToPriorityQueue(first.id);
485
- }
486
- }
487
- }
488
- sidebarState.setExpanded(id, open ?? !sidebarState.isExpanded(id));
489
- });
490
- eventBus.on("copy-url:nav-item", ({ id }) => {
491
- const url = makeUrlFromId(
492
- id,
493
- basePath.value,
494
- isMultiDocument.value
495
- )?.toString();
496
- return url && copyToClipboard(url);
497
- });
498
- onBeforeMount(() => {
499
- window.history.scrollRestoration = "manual";
500
- addScalarClassesToHeadless();
501
- window.addEventListener("popstate", () => {
502
- const id = getIdFromUrl(
503
- window.location.href,
504
- mergedConfig.value.pathRouting?.basePath,
505
- isMultiDocument.value ? void 0 : activeSlug.value
506
- );
507
- if (id) {
508
- scrollToLazyElement(id);
509
- }
510
- });
511
- });
512
- const documentStartRef = useTemplateRef("documentStartRef");
513
- useIntersection(documentStartRef, () => {
514
- eventBus.emit("intersecting:nav-item", { id: activeSlug.value });
515
- });
516
- const colorMode = computed(() => {
517
- const mode = workspaceStore.workspace["x-scalar-color-mode"];
518
- if (mode === "system") {
519
- return getSystemModePreference();
520
- }
521
- return mode;
522
- });
523
- const bodyScrollLocked = useScrollLock(
524
- typeof document !== "undefined" ? document.body : null
525
- );
526
- watch(agent.showAgent, () => bodyScrollLocked.value = agent.showAgent.value);
527
- const showMCPButton = computed(() => {
528
- if (mergedConfig.value.mcp?.disabled) {
529
- return false;
530
- }
531
- if (typeof window !== "undefined" && isLocalUrl(window.location.href)) {
532
- return true;
533
- }
534
- if (mergedConfig.value.mcp) {
535
- return true;
536
- }
537
- return false;
538
- });
539
- return (_ctx, _cache) => {
540
- return openBlock(), createElementBlock("div", null, [
541
- (openBlock(), createBlock(resolveDynamicComponent("style"), null, {
542
- default: withCtx(() => [
543
- createTextVNode(toDisplayString(mergedConfig.value.customCss) + " " + toDisplayString(themeStyle.value), 1)
544
- ]),
545
- _: 1
546
- })),
547
- createElementVNode("div", {
548
- ref: "documentEl",
549
- class: normalizeClass(["scalar-app scalar-api-reference references-layout", [
550
- {
551
- "scalar-api-references-standalone-mobile": mergedConfig.value.showSidebar,
552
- "scalar-scrollbars-obtrusive": obtrusiveScrollbars.value,
553
- "references-editable": mergedConfig.value.isEditable,
554
- "references-sidebar": mergedConfig.value.showSidebar,
555
- "references-sidebar-mobile-open": isSidebarOpen.value,
556
- "references-classic": mergedConfig.value.layout === "classic"
557
- },
558
- _ctx.$attrs.class
559
- ]])
560
- }, [
561
- unref(agent).agentEnabled.value ? (openBlock(), createBlock(unref(AgentScalarDrawer), {
562
- key: 0,
563
- agentScalarConfiguration: configList.value[activeSlug.value]?.agent,
564
- eventBus: unref(eventBus),
565
- workspaceStore: unref(workspaceStore)
566
- }, null, 8, ["agentScalarConfiguration", "eventBus", "workspaceStore"])) : createCommentVNode("", true),
567
- mergedConfig.value.layout === "modern" ? (openBlock(), createBlock(_sfc_main$1, {
568
- key: 1,
569
- breadcrumb: breadcrumb.value,
570
- isSidebarOpen: isSidebarOpen.value,
571
- showSidebar: mergedConfig.value.showSidebar,
572
- onToggleSidebar: _cache[3] || (_cache[3] = () => isSidebarOpen.value = !isSidebarOpen.value)
573
- }, {
574
- search: withCtx(() => [
575
- !mergedConfig.value.hideSearch ? (openBlock(), createBlock(_sfc_main$3, {
576
- key: 0,
577
- class: "my-2",
578
- document: unref(workspaceStore).workspace.activeDocument,
579
- eventBus: unref(eventBus),
580
- hideModels: mergedConfig.value.hideModels,
581
- searchHotKey: mergedConfig.value.searchHotKey,
582
- showSidebar: mergedConfig.value.showSidebar
583
- }, null, 8, ["document", "eventBus", "hideModels", "searchHotKey", "showSidebar"])) : createCommentVNode("", true)
584
- ]),
585
- sidebar: withCtx(({ sidebarClasses }) => [
586
- mergedConfig.value.showSidebar && mergedConfig.value.layout === "modern" ? (openBlock(), createBlock(unref(ScalarSidebar), {
587
- key: 0,
588
- "aria-label": `Sidebar for ${unref(workspaceStore).workspace.activeDocument?.info?.title}`,
589
- class: normalizeClass(["t-doc__sidebar", sidebarClasses]),
590
- isExpanded: unref(sidebarState).isExpanded,
591
- isSelected: unref(sidebarState).isSelected,
592
- items: sidebarItems.value,
593
- layout: "reference",
594
- options: mergedConfig.value,
595
- role: "navigation",
596
- onSelectItem: _cache[1] || (_cache[1] = (id) => handleSelectSidebarEntry(id, "sidebar")),
597
- onToggleGroup: _cache[2] || (_cache[2] = (id) => unref(sidebarState).setExpanded(id, !unref(sidebarState).isExpanded(id)))
598
- }, {
599
- header: withCtx(() => [
600
- documentOptionList.value.length > 1 ? (openBlock(), createBlock(_sfc_main$2, {
601
- key: 0,
602
- class: "p-3 pb-0",
603
- modelValue: activeSlug.value,
604
- options: documentOptionList.value,
605
- "onUpdate:modelValue": changeSelectedDocument
606
- }, null, 8, ["modelValue", "options"])) : createCommentVNode("", true),
607
- !mergedConfig.value.hideSearch ? (openBlock(), createElementBlock("div", _hoisted_1, [
608
- createVNode(_sfc_main$3, {
609
- document: unref(workspaceStore).workspace.activeDocument,
610
- eventBus: unref(eventBus),
611
- hideModels: mergedConfig.value.hideModels,
612
- searchHotKey: mergedConfig.value.searchHotKey
613
- }, null, 8, ["document", "eventBus", "hideModels", "searchHotKey"]),
614
- unref(agent).agentEnabled.value ? (openBlock(), createBlock(unref(_sfc_main$4), { key: 0 })) : createCommentVNode("", true)
615
- ])) : createCommentVNode("", true),
616
- renderSlot(_ctx.$slots, "sidebar-start", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
617
- ]),
618
- footer: withCtx(() => [
619
- renderSlot(_ctx.$slots, "sidebar-end", normalizeProps(guardReactiveProps(slotProps.value)), () => [
620
- createVNode(unref(ScalarSidebarFooter), { class: "darklight-reference" }, {
621
- toggle: withCtx(() => [
622
- !mergedConfig.value.hideDarkModeToggle && !mergedConfig.value.forceDarkModeState ? (openBlock(), createBlock(unref(ScalarColorModeToggleButton), {
623
- key: 0,
624
- modelValue: colorMode.value === "dark",
625
- "onUpdate:modelValue": _cache[0] || (_cache[0] = () => unref(toggleColorMode)())
626
- }, null, 8, ["modelValue"])) : (openBlock(), createElementBlock("span", _hoisted_2))
627
- ]),
628
- default: withCtx(() => [
629
- !mergedConfig.value.hideClientButton && !showMCPButton.value ? (openBlock(), createBlock(unref(OpenApiClientButton), {
630
- key: 0,
631
- buttonSource: "sidebar",
632
- integration: mergedConfig.value._integration,
633
- isDevelopment: unref(isDevelopment),
634
- url: documentUrl.value
635
- }, null, 8, ["integration", "isDevelopment", "url"])) : createCommentVNode("", true),
636
- showMCPButton.value ? (openBlock(), createBlock(unref(OpenMCPButton), {
637
- key: 1,
638
- config: mergedConfig.value.mcp,
639
- isDevelopment: unref(isDevelopment),
640
- url: documentUrl.value,
641
- workspace: unref(workspaceStore)
642
- }, null, 8, ["config", "isDevelopment", "url", "workspace"])) : createCommentVNode("", true)
643
- ]),
644
- _: 1
645
- })
646
- ], true)
647
- ]),
648
- _: 3
649
- }, 8, ["aria-label", "class", "isExpanded", "isSelected", "items", "options"])) : createCommentVNode("", true)
650
- ]),
651
- _: 3
652
- }, 8, ["breadcrumb", "isSidebarOpen", "showSidebar"])) : createCommentVNode("", true),
653
- createElementVNode("main", {
654
- "aria-label": `Open API Documentation for ${unref(workspaceStore).workspace.activeDocument?.info?.title}`,
655
- class: "references-rendered",
656
- inert: unref(agent).showAgent.value
657
- }, [
658
- createVNode(_sfc_main$5, {
659
- authStore: unref(workspaceStore).auth,
660
- document: unref(workspaceStore).workspace.activeDocument,
661
- environment: environment.value,
662
- eventBus: unref(eventBus),
663
- expandedItems: unref(sidebarState).expandedItems.value,
664
- headingSlugGenerator: mergedConfig.value.generateHeadingSlug ?? ((heading) => `${activeSlug.value}/description/${heading.slug}`),
665
- infoSectionId: infoSectionId.value ?? "description/introduction",
666
- items: sidebarItems.value,
667
- options: mergedConfig.value,
668
- xScalarDefaultClient: unref(workspaceStore).workspace["x-scalar-default-client"]
669
- }, createSlots({
670
- start: withCtx(() => [
671
- unref(workspaceStore).workspace.activeDocument && unref(mediaQueries).lg.value ? (openBlock(), createBlock(unref(_sfc_main$6), {
672
- key: 0,
673
- overrides: configurationOverrides.value,
674
- "onUpdate:overrides": _cache[4] || (_cache[4] = ($event) => configurationOverrides.value = $event),
675
- configuration: mergedConfig.value,
676
- workspace: unref(workspaceStore)
677
- }, null, 8, ["overrides", "configuration", "workspace"])) : createCommentVNode("", true),
678
- createElementVNode("div", {
679
- ref_key: "documentStartRef",
680
- ref: documentStartRef
681
- }, null, 512),
682
- mergedConfig.value.layout === "classic" ? (openBlock(), createBlock(ClassicHeader, { key: 1 }, {
683
- "dark-mode-toggle": withCtx(() => [
684
- !mergedConfig.value.hideDarkModeToggle && !mergedConfig.value.forceDarkModeState ? (openBlock(), createBlock(unref(ScalarColorModeToggleIcon), {
685
- key: 0,
686
- class: "text-c-2 hover:text-c-1",
687
- mode: colorMode.value,
688
- style: { "transform": "scale(1.4)" },
689
- variant: "icon",
690
- onClick: _cache[5] || (_cache[5] = () => unref(toggleColorMode)())
691
- }, null, 8, ["mode"])) : createCommentVNode("", true)
692
- ]),
693
- default: withCtx(() => [
694
- createElementVNode("div", _hoisted_4, [
695
- documentOptionList.value.length > 1 ? (openBlock(), createBlock(_sfc_main$2, {
696
- key: 0,
697
- modelValue: activeSlug.value,
698
- options: documentOptionList.value,
699
- "onUpdate:modelValue": changeSelectedDocument
700
- }, null, 8, ["modelValue", "options"])) : createCommentVNode("", true)
701
- ]),
702
- !mergedConfig.value.hideSearch ? (openBlock(), createBlock(_sfc_main$3, {
703
- key: 0,
704
- class: "t-doc__sidebar max-w-64",
705
- document: unref(workspaceStore).workspace.activeDocument,
706
- eventBus: unref(eventBus),
707
- hideModels: mergedConfig.value.hideModels,
708
- searchHotKey: mergedConfig.value.searchHotKey
709
- }, null, 8, ["document", "eventBus", "hideModels", "searchHotKey"])) : createCommentVNode("", true)
710
- ]),
711
- _: 1
712
- })) : createCommentVNode("", true),
713
- renderSlot(_ctx.$slots, "content-start", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
714
- ]),
715
- end: withCtx(() => [
716
- renderSlot(_ctx.$slots, "content-end", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
717
- ]),
718
- _: 2
719
- }, [
720
- mergedConfig.value.isEditable ? {
721
- name: "empty-state",
722
- fn: withCtx(() => [
723
- renderSlot(_ctx.$slots, "editor-placeholder", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
724
- ]),
725
- key: "0"
726
- } : void 0
727
- ]), 1032, ["authStore", "document", "environment", "eventBus", "expandedItems", "headingSlugGenerator", "infoSectionId", "items", "options", "xScalarDefaultClient"])
728
- ], 8, _hoisted_3),
729
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_5, [
730
- renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
731
- ])) : createCommentVNode("", true),
732
- createElementVNode("div", {
733
- ref_key: "modal",
734
- ref: modal
735
- }, null, 512)
736
- ], 2),
737
- createVNode(unref(ScalarToasts))
738
- ]);
739
- };
740
- }
741
- });
742
- export {
743
- _sfc_main as default
744
- };