@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
@@ -1,742 +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, matchesBasePath } 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((p) => p ? matchesBasePath(url, p) : false),
106
- isMultiDocument.value ? void 0 : activeSlug.value
107
- );
108
- const documentSlug = initialId.split("/")[0];
109
- if (documentSlug && configList.value[documentSlug]) {
110
- activeSlug.value = documentSlug;
111
- }
112
- }
113
- const documentOptionList = computed(
114
- () => Object.values(configList.value).map((c) => ({
115
- label: c.title,
116
- id: c.slug
117
- }))
118
- );
119
- const configurationOverrides = ref({});
120
- const mergedConfig = computed(() => ({
121
- // Provides a default set of values when the lookup fails
122
- ...apiReferenceConfigurationSchema.parse({}),
123
- // The active configuration based on the slug
124
- ...configList.value[activeSlug.value]?.config,
125
- // Any overrides from the localhost toolbar
126
- ...configurationOverrides.value
127
- }));
128
- const basePath = computed(() => mergedConfig.value.pathRouting?.basePath);
129
- const themeStyle = computed(
130
- () => getThemeStyles(mergedConfig.value.theme, {
131
- fonts: mergedConfig.value.withDefaultFonts
132
- })
133
- );
134
- provide(
135
- PLUGIN_MANAGER_SYMBOL,
136
- createPluginManager({
137
- plugins: Object.values(configList.value).flatMap(
138
- (c) => c.config.plugins ?? []
139
- )
140
- })
141
- );
142
- if (mergedConfig.value.redirect && typeof window !== "undefined") {
143
- const newPath = mergedConfig.value.redirect(
144
- (mergedConfig.value.pathRouting ? window.location.pathname : "") + window.location.hash
145
- );
146
- if (newPath) {
147
- window.history.replaceState({}, "", newPath);
148
- }
149
- }
150
- function syncSlugAndUrlWithDocument(slug, elementId, config) {
151
- const url = makeUrlFromId(
152
- elementId || slug,
153
- config.pathRouting?.basePath,
154
- isMultiDocument.value
155
- );
156
- if (url) {
157
- window.history.replaceState({}, "", url.toString());
158
- }
159
- activeSlug.value = slug;
160
- }
161
- const workspaceStore = createWorkspaceStore({
162
- verbose: isDevelopment,
163
- plugins: [
164
- persistencePlugin({
165
- prefix: () => activeSlug.value,
166
- persistAuth: () => mergedConfig.value.persistAuth ?? false
167
- })
168
- ]
169
- });
170
- const { toggleColorMode, isDarkMode } = useColorMode({
171
- initialColorMode: {
172
- true: "dark",
173
- false: "light",
174
- undefined: "system"
175
- }[String(mergedConfig.value.darkMode)],
176
- overrideColorMode: mergedConfig.value.forceDarkModeState
177
- });
178
- const itemsFromWorkspace = computed(() => {
179
- return Object.entries(workspaceStore.workspace.documents).map(
180
- ([slug, document2]) => ({
181
- id: slug,
182
- type: "document",
183
- description: document2.info.description,
184
- name: document2.info.title ?? slug,
185
- title: document2.info.title ?? slug,
186
- children: document2?.["x-scalar-navigation"]?.children ?? []
187
- })
188
- );
189
- });
190
- const sidebarState = createSidebarState(itemsFromWorkspace, {
191
- hooks: {}
192
- });
193
- const setChildrenOpen = (items) => {
194
- items.forEach((item) => {
195
- if (item.type === "tag" || item.type === "models") {
196
- sidebarState.setExpanded(item.id, true);
197
- }
198
- if ("children" in item && item.children) {
199
- setChildrenOpen(item.children);
200
- }
201
- });
202
- };
203
- const sidebarItems = computed(() => {
204
- const config = mergedConfig.value;
205
- if (!config) {
206
- return [];
207
- }
208
- const docItems = sidebarState.items.value.find(
209
- (item) => item.id === activeSlug.value
210
- )?.children ?? [];
211
- if (config.defaultOpenAllTags) {
212
- setChildrenOpen(docItems);
213
- }
214
- if (config.expandAllModelSections) {
215
- const models = docItems.find(
216
- (item) => item.type === "models"
217
- );
218
- if (models) {
219
- sidebarState.setExpanded(models.id, true);
220
- models.children?.forEach((child) => {
221
- sidebarState.setExpanded(child.id, true);
222
- });
223
- }
224
- }
225
- return docItems;
226
- });
227
- const infoSectionId = computed(
228
- () => sidebarItems.value.find(
229
- (item) => item.type === "text" && item.title === "Introduction"
230
- )?.id
231
- );
232
- const breadcrumb = ref("");
233
- const slotProps = computed(() => ({
234
- breadcrumb: breadcrumb.value
235
- }));
236
- const setBreadcrumb = (id) => {
237
- const item = sidebarState.getEntryById(id);
238
- if (!item || item.type === "document") {
239
- breadcrumb.value = "";
240
- } else {
241
- breadcrumb.value = item.title;
242
- }
243
- };
244
- const scrollToLazyElement = (id) => {
245
- setBreadcrumb(id);
246
- sidebarState.setSelected(id);
247
- scrollToLazy(id, sidebarState.setExpanded, sidebarState.getEntryById);
248
- };
249
- mapConfigToWorkspaceStore({
250
- config: () => mergedConfig.value,
251
- store: workspaceStore,
252
- isDarkMode
253
- });
254
- const environment = computed(
255
- () => getActiveEnvironment(
256
- workspaceStore,
257
- workspaceStore.workspace.activeDocument ?? null
258
- )
259
- );
260
- if (typeof window !== "undefined") {
261
- window.dataDumpWorkspace = () => workspaceStore;
262
- }
263
- __expose({
264
- eventBus,
265
- workspaceStore,
266
- sidebarItems
267
- });
268
- const changeSelectedDocument = async (slug, elementId) => {
269
- const normalized = configList.value[slug];
270
- if (!normalized) {
271
- console.warn(`Document ${slug} not found in configList`);
272
- return;
273
- }
274
- const config = {
275
- ...normalized.config,
276
- ...configurationOverrides.value
277
- };
278
- const onDocumentSelectPromise = config.onDocumentSelect?.();
279
- syncSlugAndUrlWithDocument(slug, elementId, config);
280
- apiClient.value?.route({
281
- documentSlug: slug,
282
- method: "get",
283
- path: "/"
284
- });
285
- const isFirstLoad = !workspaceStore.workspace.documents[slug];
286
- if (isFirstLoad) {
287
- const result = await workspaceStore.addDocument(
288
- normalized.source.url ? {
289
- name: slug,
290
- url: normalized.source.url,
291
- fetch: config.fetch
292
- } : {
293
- name: slug,
294
- document: normalized.source.content ?? {}
295
- },
296
- config
297
- );
298
- const document2 = workspaceStore.workspace.documents[slug];
299
- if (result === true && document2 !== void 0 && document2["x-scalar-selected-server"] === void 0) {
300
- const servers = getServers(
301
- normalized.config.servers ?? document2.servers,
302
- {
303
- baseServerUrl: mergedConfig.value.baseServerURL,
304
- documentUrl: normalized.source.url
305
- }
306
- );
307
- if (servers.length > 0) {
308
- workspaceStore.updateDocument(
309
- slug,
310
- "x-scalar-selected-server",
311
- servers[0].url
312
- );
313
- }
314
- }
315
- }
316
- workspaceStore.update("x-scalar-active-document", slug);
317
- if (config.persistAuth) {
318
- loadAuthFromStorage(workspaceStore, slug);
319
- }
320
- void (async () => {
321
- await onDocumentSelectPromise;
322
- void config.onLoaded?.(slug);
323
- })();
324
- if (elementId && elementId !== slug) {
325
- scrollToLazyElement(elementId);
326
- } else if (config.defaultOpenFirstTag) {
327
- const firstTag = sidebarItems.value.find((item) => item.type === "tag");
328
- if (firstTag) {
329
- sidebarState.setExpanded(firstTag.id, true);
330
- }
331
- }
332
- };
333
- watch(
334
- () => Object.values(configList.value),
335
- async (newConfigList, oldConfigList) => {
336
- const updateSource = async (updated, previous) => {
337
- if (!workspaceStore.workspace.documents[updated.slug]) {
338
- return;
339
- }
340
- if (updated.source.url && updated.source.url !== previous?.source.url) {
341
- await workspaceStore.addDocument(
342
- {
343
- name: updated.slug,
344
- url: updated.source.url,
345
- fetch: updated.config.fetch
346
- },
347
- updated.config
348
- );
349
- return;
350
- }
351
- if (!updated.source.content) {
352
- return;
353
- }
354
- if (diff(
355
- updated.source.content,
356
- previous && "content" in previous.source ? previous.source.content ?? {} : {}
357
- ).length) {
358
- await workspaceStore.addDocument(
359
- {
360
- name: updated.slug,
361
- document: updated.source.content
362
- },
363
- updated.config
364
- );
365
- }
366
- };
367
- newConfigList.forEach(
368
- (newConfig, index) => updateSource(newConfig, oldConfigList[index])
369
- );
370
- const newSlugs = newConfigList.map((c) => c.slug);
371
- const oldSlugs = oldConfigList.map((c) => c.slug);
372
- if (newSlugs.length !== oldSlugs.length || !newSlugs.every((slug, index) => slug === oldSlugs[index])) {
373
- await changeSelectedDocument(newSlugs[0] ?? "");
374
- }
375
- },
376
- {
377
- deep: true
378
- }
379
- );
380
- onServerPrefetch(() => changeSelectedDocument(activeSlug.value));
381
- onBeforeMount(async () => {
382
- loadClientFromStorage(workspaceStore);
383
- await changeSelectedDocument(
384
- activeSlug.value,
385
- getIdFromUrl(
386
- window.location.href,
387
- configList.value[activeSlug.value]?.config.pathRouting?.basePath,
388
- isMultiDocument.value ? void 0 : activeSlug.value
389
- )
390
- );
391
- });
392
- const documentUrl = computed(() => {
393
- return configList.value[activeSlug.value]?.source?.url;
394
- });
395
- const agent = useAgent({
396
- agentEnabled: computed(() => {
397
- const currentConfiguration = configList.value[activeSlug.value];
398
- if (currentConfiguration?.agent?.disabled) {
399
- return false;
400
- }
401
- if (typeof window !== "undefined" && isLocalUrl(window.location.href)) {
402
- return true;
403
- }
404
- return Boolean(configList.value[activeSlug.value]?.agent?.key);
405
- })
406
- });
407
- provide(AGENT_CONTEXT_SYMBOL, agent);
408
- const modal = useTemplateRef("modal");
409
- const apiClient = ref(null);
410
- onMounted(() => {
411
- if (!modal.value) {
412
- return;
413
- }
414
- apiClient.value = createApiClientModal({
415
- el: modal.value,
416
- eventBus,
417
- workspaceStore,
418
- options: mergedConfig,
419
- plugins: mapConfigPlugins(mergedConfig)
420
- });
421
- });
422
- onBeforeUnmount(() => {
423
- apiClient.value?.app.unmount();
424
- });
425
- eventBus.on(
426
- "server:update:selected",
427
- ({ url }) => mergedConfig.value.onServerChange?.(url)
428
- );
429
- eventBus.on("ui:download:document", async ({ format }) => {
430
- const document2 = await workspaceStore.exportActiveDocument(format);
431
- if (!document2) {
432
- console.error("No document found to download");
433
- return;
434
- }
435
- downloadDocument(document2, activeSlug.value ?? "openapi", format);
436
- });
437
- const handleSelectSidebarEntry = (id, caller) => {
438
- const item = sidebarState.getEntryById(id);
439
- if ((item?.type === "tag" || item?.type === "models" || item?.type === "text") && sidebarState.isExpanded(id) && // Only close if the item is expanded
440
- sidebarState.selectedItem.value === id) {
441
- const unblock = blockIntersection();
442
- sidebarState.setExpanded(id, false);
443
- unblock();
444
- return;
445
- }
446
- if (item?.type !== "tag" && item?.type !== "models") {
447
- isSidebarOpen.value = false;
448
- }
449
- scrollToLazyElement(id);
450
- const url = makeUrlFromId(id, basePath.value, isMultiDocument.value);
451
- if (url) {
452
- window.history.pushState({}, "", url);
453
- if (caller === "sidebar") {
454
- mergedConfig.value.onSidebarClick?.(url.toString());
455
- }
456
- }
457
- if (agent.showAgent.value) {
458
- agent.closeAgent();
459
- }
460
- };
461
- eventBus.on("select:nav-item", ({ id }) => handleSelectSidebarEntry(id));
462
- eventBus.on("scroll-to:nav-item", ({ id }) => handleSelectSidebarEntry(id));
463
- eventBus.on("intersecting:nav-item", ({ id }) => {
464
- if (!intersectionEnabled.value) {
465
- return;
466
- }
467
- sidebarState.setSelected(id);
468
- setBreadcrumb(id);
469
- scrollSidebarToTop(id);
470
- const url = makeUrlFromId(id, basePath.value, isMultiDocument.value);
471
- if (url && workspaceStore.workspace.activeDocument) {
472
- window.history.replaceState({}, "", url.toString());
473
- }
474
- });
475
- eventBus.on("toggle:nav-item", ({ id, open }) => {
476
- if (open) {
477
- mergedConfig.value.onShowMore?.(id);
478
- const entry = sidebarState.getEntryById(id);
479
- if (entry && "children" in entry && entry.children) {
480
- const first = entry.children[0];
481
- if (first) {
482
- addToPriorityQueue(first.id);
483
- }
484
- }
485
- }
486
- sidebarState.setExpanded(id, open ?? !sidebarState.isExpanded(id));
487
- });
488
- eventBus.on("copy-url:nav-item", ({ id }) => {
489
- const url = makeUrlFromId(
490
- id,
491
- basePath.value,
492
- isMultiDocument.value
493
- )?.toString();
494
- return url && copyToClipboard(url);
495
- });
496
- onBeforeMount(() => {
497
- window.history.scrollRestoration = "manual";
498
- addScalarClassesToHeadless();
499
- window.addEventListener("popstate", () => {
500
- const id = getIdFromUrl(
501
- window.location.href,
502
- mergedConfig.value.pathRouting?.basePath,
503
- isMultiDocument.value ? void 0 : activeSlug.value
504
- );
505
- if (id) {
506
- scrollToLazyElement(id);
507
- }
508
- });
509
- });
510
- const documentStartRef = useTemplateRef("documentStartRef");
511
- useIntersection(documentStartRef, () => {
512
- eventBus.emit("intersecting:nav-item", { id: activeSlug.value });
513
- });
514
- const colorMode = computed(() => {
515
- const mode = workspaceStore.workspace["x-scalar-color-mode"];
516
- if (mode === "system") {
517
- return getSystemModePreference();
518
- }
519
- return mode;
520
- });
521
- const bodyScrollLocked = useScrollLock(
522
- typeof document !== "undefined" ? document.body : null
523
- );
524
- watch(agent.showAgent, () => bodyScrollLocked.value = agent.showAgent.value);
525
- const showMCPButton = computed(() => {
526
- if (mergedConfig.value.mcp?.disabled) {
527
- return false;
528
- }
529
- if (typeof window !== "undefined" && isLocalUrl(window.location.href)) {
530
- return true;
531
- }
532
- if (mergedConfig.value.mcp) {
533
- return true;
534
- }
535
- return false;
536
- });
537
- return (_ctx, _cache) => {
538
- return openBlock(), createElementBlock("div", null, [
539
- (openBlock(), createBlock(resolveDynamicComponent("style"), null, {
540
- default: withCtx(() => [
541
- createTextVNode(toDisplayString(mergedConfig.value.customCss) + " " + toDisplayString(themeStyle.value), 1)
542
- ]),
543
- _: 1
544
- })),
545
- createElementVNode("div", {
546
- ref: "documentEl",
547
- class: normalizeClass(["scalar-app scalar-api-reference references-layout", [
548
- {
549
- "scalar-api-references-standalone-mobile": mergedConfig.value.showSidebar,
550
- "scalar-scrollbars-obtrusive": obtrusiveScrollbars.value,
551
- "references-editable": mergedConfig.value.isEditable,
552
- "references-sidebar": mergedConfig.value.showSidebar,
553
- "references-sidebar-mobile-open": isSidebarOpen.value,
554
- "references-classic": mergedConfig.value.layout === "classic"
555
- },
556
- _ctx.$attrs.class
557
- ]])
558
- }, [
559
- unref(agent).agentEnabled.value ? (openBlock(), createBlock(unref(AgentScalarDrawer), {
560
- key: 0,
561
- agentScalarConfiguration: configList.value[activeSlug.value]?.agent,
562
- eventBus: unref(eventBus),
563
- workspaceStore: unref(workspaceStore)
564
- }, null, 8, ["agentScalarConfiguration", "eventBus", "workspaceStore"])) : createCommentVNode("", true),
565
- mergedConfig.value.layout === "modern" ? (openBlock(), createBlock(_sfc_main$1, {
566
- key: 1,
567
- breadcrumb: breadcrumb.value,
568
- isSidebarOpen: isSidebarOpen.value,
569
- showSidebar: mergedConfig.value.showSidebar,
570
- onToggleSidebar: _cache[3] || (_cache[3] = () => isSidebarOpen.value = !isSidebarOpen.value)
571
- }, {
572
- search: withCtx(() => [
573
- !mergedConfig.value.hideSearch ? (openBlock(), createBlock(_sfc_main$3, {
574
- key: 0,
575
- class: "my-2",
576
- document: unref(workspaceStore).workspace.activeDocument,
577
- eventBus: unref(eventBus),
578
- hideModels: mergedConfig.value.hideModels,
579
- searchHotKey: mergedConfig.value.searchHotKey,
580
- showSidebar: mergedConfig.value.showSidebar
581
- }, null, 8, ["document", "eventBus", "hideModels", "searchHotKey", "showSidebar"])) : createCommentVNode("", true)
582
- ]),
583
- sidebar: withCtx(({ sidebarClasses }) => [
584
- mergedConfig.value.showSidebar && mergedConfig.value.layout === "modern" ? (openBlock(), createBlock(unref(ScalarSidebar), {
585
- key: 0,
586
- "aria-label": `Sidebar for ${unref(workspaceStore).workspace.activeDocument?.info?.title}`,
587
- class: normalizeClass(["t-doc__sidebar", sidebarClasses]),
588
- isExpanded: unref(sidebarState).isExpanded,
589
- isSelected: unref(sidebarState).isSelected,
590
- items: sidebarItems.value,
591
- layout: "reference",
592
- options: mergedConfig.value,
593
- role: "navigation",
594
- onSelectItem: _cache[1] || (_cache[1] = (id) => handleSelectSidebarEntry(id, "sidebar")),
595
- onToggleGroup: _cache[2] || (_cache[2] = (id) => unref(sidebarState).setExpanded(id, !unref(sidebarState).isExpanded(id)))
596
- }, {
597
- header: withCtx(() => [
598
- documentOptionList.value.length > 1 ? (openBlock(), createBlock(_sfc_main$2, {
599
- key: 0,
600
- class: "p-3 pb-0",
601
- modelValue: activeSlug.value,
602
- options: documentOptionList.value,
603
- "onUpdate:modelValue": changeSelectedDocument
604
- }, null, 8, ["modelValue", "options"])) : createCommentVNode("", true),
605
- !mergedConfig.value.hideSearch ? (openBlock(), createElementBlock("div", _hoisted_1, [
606
- createVNode(_sfc_main$3, {
607
- document: unref(workspaceStore).workspace.activeDocument,
608
- eventBus: unref(eventBus),
609
- hideModels: mergedConfig.value.hideModels,
610
- searchHotKey: mergedConfig.value.searchHotKey
611
- }, null, 8, ["document", "eventBus", "hideModels", "searchHotKey"]),
612
- unref(agent).agentEnabled.value ? (openBlock(), createBlock(unref(_sfc_main$4), { key: 0 })) : createCommentVNode("", true)
613
- ])) : createCommentVNode("", true),
614
- renderSlot(_ctx.$slots, "sidebar-start", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
615
- ]),
616
- footer: withCtx(() => [
617
- renderSlot(_ctx.$slots, "sidebar-end", normalizeProps(guardReactiveProps(slotProps.value)), () => [
618
- createVNode(unref(ScalarSidebarFooter), { class: "darklight-reference" }, {
619
- toggle: withCtx(() => [
620
- !mergedConfig.value.hideDarkModeToggle && !mergedConfig.value.forceDarkModeState ? (openBlock(), createBlock(unref(ScalarColorModeToggleButton), {
621
- key: 0,
622
- modelValue: colorMode.value === "dark",
623
- "onUpdate:modelValue": _cache[0] || (_cache[0] = () => unref(toggleColorMode)())
624
- }, null, 8, ["modelValue"])) : (openBlock(), createElementBlock("span", _hoisted_2))
625
- ]),
626
- default: withCtx(() => [
627
- !mergedConfig.value.hideClientButton && !showMCPButton.value ? (openBlock(), createBlock(unref(OpenApiClientButton), {
628
- key: 0,
629
- buttonSource: "sidebar",
630
- integration: mergedConfig.value._integration,
631
- isDevelopment: unref(isDevelopment),
632
- url: documentUrl.value
633
- }, null, 8, ["integration", "isDevelopment", "url"])) : createCommentVNode("", true),
634
- showMCPButton.value ? (openBlock(), createBlock(unref(OpenMCPButton), {
635
- key: 1,
636
- config: mergedConfig.value.mcp,
637
- isDevelopment: unref(isDevelopment),
638
- url: documentUrl.value,
639
- workspace: unref(workspaceStore)
640
- }, null, 8, ["config", "isDevelopment", "url", "workspace"])) : createCommentVNode("", true)
641
- ]),
642
- _: 1
643
- })
644
- ], true)
645
- ]),
646
- _: 3
647
- }, 8, ["aria-label", "class", "isExpanded", "isSelected", "items", "options"])) : createCommentVNode("", true)
648
- ]),
649
- _: 3
650
- }, 8, ["breadcrumb", "isSidebarOpen", "showSidebar"])) : createCommentVNode("", true),
651
- createElementVNode("main", {
652
- "aria-label": `Open API Documentation for ${unref(workspaceStore).workspace.activeDocument?.info?.title}`,
653
- class: "references-rendered",
654
- inert: unref(agent).showAgent.value
655
- }, [
656
- createVNode(_sfc_main$5, {
657
- authStore: unref(workspaceStore).auth,
658
- document: unref(workspaceStore).workspace.activeDocument,
659
- environment: environment.value,
660
- eventBus: unref(eventBus),
661
- expandedItems: unref(sidebarState).expandedItems.value,
662
- headingSlugGenerator: mergedConfig.value.generateHeadingSlug ?? ((heading) => `${activeSlug.value}/description/${heading.slug}`),
663
- infoSectionId: infoSectionId.value ?? "description/introduction",
664
- items: sidebarItems.value,
665
- options: mergedConfig.value,
666
- xScalarDefaultClient: unref(workspaceStore).workspace["x-scalar-default-client"]
667
- }, createSlots({
668
- start: withCtx(() => [
669
- unref(workspaceStore).workspace.activeDocument && unref(mediaQueries).lg.value ? (openBlock(), createBlock(unref(_sfc_main$6), {
670
- key: 0,
671
- overrides: configurationOverrides.value,
672
- "onUpdate:overrides": _cache[4] || (_cache[4] = ($event) => configurationOverrides.value = $event),
673
- configuration: mergedConfig.value,
674
- workspace: unref(workspaceStore)
675
- }, null, 8, ["overrides", "configuration", "workspace"])) : createCommentVNode("", true),
676
- createElementVNode("div", {
677
- ref_key: "documentStartRef",
678
- ref: documentStartRef
679
- }, null, 512),
680
- mergedConfig.value.layout === "classic" ? (openBlock(), createBlock(ClassicHeader, { key: 1 }, {
681
- "dark-mode-toggle": withCtx(() => [
682
- !mergedConfig.value.hideDarkModeToggle && !mergedConfig.value.forceDarkModeState ? (openBlock(), createBlock(unref(ScalarColorModeToggleIcon), {
683
- key: 0,
684
- class: "text-c-2 hover:text-c-1",
685
- mode: colorMode.value,
686
- style: { "transform": "scale(1.4)" },
687
- variant: "icon",
688
- onClick: _cache[5] || (_cache[5] = () => unref(toggleColorMode)())
689
- }, null, 8, ["mode"])) : createCommentVNode("", true)
690
- ]),
691
- default: withCtx(() => [
692
- createElementVNode("div", _hoisted_4, [
693
- documentOptionList.value.length > 1 ? (openBlock(), createBlock(_sfc_main$2, {
694
- key: 0,
695
- modelValue: activeSlug.value,
696
- options: documentOptionList.value,
697
- "onUpdate:modelValue": changeSelectedDocument
698
- }, null, 8, ["modelValue", "options"])) : createCommentVNode("", true)
699
- ]),
700
- !mergedConfig.value.hideSearch ? (openBlock(), createBlock(_sfc_main$3, {
701
- key: 0,
702
- class: "t-doc__sidebar max-w-64",
703
- document: unref(workspaceStore).workspace.activeDocument,
704
- eventBus: unref(eventBus),
705
- hideModels: mergedConfig.value.hideModels,
706
- searchHotKey: mergedConfig.value.searchHotKey
707
- }, null, 8, ["document", "eventBus", "hideModels", "searchHotKey"])) : createCommentVNode("", true)
708
- ]),
709
- _: 1
710
- })) : createCommentVNode("", true),
711
- renderSlot(_ctx.$slots, "content-start", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
712
- ]),
713
- end: withCtx(() => [
714
- renderSlot(_ctx.$slots, "content-end", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
715
- ]),
716
- _: 2
717
- }, [
718
- mergedConfig.value.isEditable ? {
719
- name: "empty-state",
720
- fn: withCtx(() => [
721
- renderSlot(_ctx.$slots, "editor-placeholder", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
722
- ]),
723
- key: "0"
724
- } : void 0
725
- ]), 1032, ["authStore", "document", "environment", "eventBus", "expandedItems", "headingSlugGenerator", "infoSectionId", "items", "options", "xScalarDefaultClient"])
726
- ], 8, _hoisted_3),
727
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_5, [
728
- renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps(slotProps.value)), void 0, true)
729
- ])) : createCommentVNode("", true),
730
- createElementVNode("div", {
731
- ref_key: "modal",
732
- ref: modal
733
- }, null, 512)
734
- ], 2),
735
- createVNode(unref(ScalarToasts))
736
- ]);
737
- };
738
- }
739
- });
740
- export {
741
- _sfc_main as default
742
- };