@scalar/api-reference 1.36.2 → 1.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/dist/browser/standalone.js +28796 -26431
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceContent.vue.d.ts +34 -0
  5. package/dist/components/ApiReferenceContent.vue.d.ts.map +1 -0
  6. package/dist/components/ApiReferenceContent.vue.js +8 -0
  7. package/dist/components/ApiReferenceContent.vue2.js +148 -0
  8. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  9. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  10. package/dist/components/ApiReferenceLayout.vue2.js +239 -219
  11. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts +2 -2
  12. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  13. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts +1 -1
  14. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
  15. package/dist/components/Content/ClientLibraries/featured-clients.d.ts +1 -1
  16. package/dist/components/Content/ClientLibraries/featured-clients.d.ts.map +1 -1
  17. package/dist/components/Content/Content.vue.d.ts +21 -3
  18. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  19. package/dist/components/Content/Content.vue.js +132 -95
  20. package/dist/components/Content/Models/ClassicLayout.vue.d.ts +4 -2
  21. package/dist/components/Content/Models/ClassicLayout.vue.d.ts.map +1 -1
  22. package/dist/components/Content/Models/ClassicLayout.vue.js +2 -2
  23. package/dist/components/Content/Models/ClassicLayout.vue2.js +28 -28
  24. package/dist/components/Content/Models/Models.vue.d.ts +10 -2
  25. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  26. package/dist/components/Content/Models/Models.vue.js +25 -27
  27. package/dist/components/Content/Models/ModernLayout.vue.d.ts +6 -2
  28. package/dist/components/Content/Models/ModernLayout.vue.d.ts.map +1 -1
  29. package/dist/components/Content/Models/ModernLayout.vue.js +1 -1
  30. package/dist/components/Content/Models/ModernLayout.vue2.js +30 -29
  31. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +20 -6
  32. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  33. package/dist/components/Content/Operations/TraversedEntry.vue.js +58 -46
  34. package/dist/components/Content/Operations/get-current-index.d.ts +1 -1
  35. package/dist/components/Content/Operations/get-current-index.d.ts.map +1 -1
  36. package/dist/components/Content/Schema/helpers/get-ref-name.d.ts.map +1 -1
  37. package/dist/components/Content/Schema/helpers/get-ref-name.js +9 -7
  38. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +1 -1
  39. package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
  40. package/dist/components/Content/Schema/helpers/schema-name.js +15 -14
  41. package/dist/components/Content/Tags/ClassicLayout.vue.d.ts +1 -1
  42. package/dist/components/Content/Tags/ClassicLayout.vue.d.ts.map +1 -1
  43. package/dist/components/Content/Tags/ClassicLayout.vue.js +2 -2
  44. package/dist/components/Content/Tags/ModernLayout.vue.d.ts +3 -1
  45. package/dist/components/Content/Tags/ModernLayout.vue.d.ts.map +1 -1
  46. package/dist/components/Content/Tags/ModernLayout.vue.js +1 -1
  47. package/dist/components/Content/Tags/ModernLayout.vue2.js +34 -30
  48. package/dist/components/Content/Tags/Tag.vue.d.ts +3 -1
  49. package/dist/components/Content/Tags/Tag.vue.d.ts.map +1 -1
  50. package/dist/components/Content/Tags/Tag.vue.js +14 -12
  51. package/dist/components/Content/Tags/TagSection.vue.d.ts +2 -1
  52. package/dist/components/Content/Tags/TagSection.vue.d.ts.map +1 -1
  53. package/dist/components/Content/Tags/TagSection.vue.js +49 -52
  54. package/dist/components/GettingStarted.vue.d.ts.map +1 -1
  55. package/dist/components/GettingStarted.vue.js +2 -2
  56. package/dist/components/GettingStarted.vue2.js +22 -22
  57. package/dist/components/OperationsList/OperationsList.vue.d.ts +1 -1
  58. package/dist/components/OperationsList/OperationsList.vue.d.ts.map +1 -1
  59. package/dist/components/OperationsList/OperationsList.vue.js +2 -2
  60. package/dist/components/OperationsList/OperationsListItem.vue.d.ts +1 -1
  61. package/dist/components/OperationsList/OperationsListItem.vue.d.ts.map +1 -1
  62. package/dist/components/OperationsList/OperationsListItem.vue.js +2 -2
  63. package/dist/components/ShowMoreButton.vue.d.ts +1 -0
  64. package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
  65. package/dist/components/ShowMoreButton.vue.js +2 -2
  66. package/dist/components/ShowMoreButton.vue2.js +12 -12
  67. package/dist/esm.d.ts +2 -2
  68. package/dist/esm.d.ts.map +1 -1
  69. package/dist/features/Operation/Operation.vue.d.ts +21 -9
  70. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  71. package/dist/features/Operation/Operation.vue.js +42 -53
  72. package/dist/features/Operation/components/Header.vue.d.ts +2 -2
  73. package/dist/features/Operation/components/Header.vue.d.ts.map +1 -1
  74. package/dist/features/Operation/components/Header.vue.js +9 -8
  75. package/dist/features/Operation/components/Headers.vue.d.ts +2 -2
  76. package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
  77. package/dist/features/Operation/components/Headers.vue.js +2 -2
  78. package/dist/features/Operation/components/Headers.vue2.js +31 -29
  79. package/dist/features/Operation/components/OperationParameters.vue.d.ts +4 -0
  80. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  81. package/dist/features/Operation/components/OperationParameters.vue.js +37 -31
  82. package/dist/features/Operation/components/OperationResponses.vue.d.ts +5 -1
  83. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  84. package/dist/features/Operation/components/OperationResponses.vue.js +16 -17
  85. package/dist/features/Operation/components/ParameterList.vue.d.ts +6 -2
  86. package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
  87. package/dist/features/Operation/components/ParameterList.vue.js +17 -19
  88. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +6 -2
  89. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  90. package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
  91. package/dist/features/Operation/components/ParameterListItem.vue2.js +64 -65
  92. package/dist/features/Operation/components/RequestBody.vue.d.ts +4 -0
  93. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  94. package/dist/features/Operation/components/RequestBody.vue.js +2 -2
  95. package/dist/features/Operation/components/RequestBody.vue2.js +65 -65
  96. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +4 -0
  97. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
  98. package/dist/features/Operation/components/callbacks/Callback.vue.js +3 -3
  99. package/dist/features/Operation/components/callbacks/Callback.vue2.js +29 -22
  100. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +6 -0
  101. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
  102. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +18 -16
  103. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +11 -5
  104. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  105. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  106. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +99 -90
  107. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +12 -5
  108. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  109. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  110. package/dist/features/Operation/layouts/ModernLayout.vue2.js +99 -87
  111. package/dist/features/Search/helpers/create-search-index.d.ts +2 -1
  112. package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
  113. package/dist/features/Search/types.d.ts +1 -1
  114. package/dist/features/Search/types.d.ts.map +1 -1
  115. package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
  116. package/dist/features/api-client-modal/ApiClientModal.vue.js +23 -26
  117. package/dist/features/api-client-modal/useApiClient.d.ts +3039 -2895
  118. package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
  119. package/dist/features/document-source/hooks/useDocumentFetcher.d.ts +2 -2
  120. package/dist/features/document-source/hooks/useDocumentFetcher.d.ts.map +1 -1
  121. package/dist/features/document-source/hooks/useDocumentFetcher.js +13 -11
  122. package/dist/features/document-source/hooks/useDocumentSource.d.ts +2 -2
  123. package/dist/features/document-source/hooks/useDocumentSource.d.ts.map +1 -1
  124. package/dist/features/document-source/hooks/useDocumentSource.js +38 -34
  125. package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
  126. package/dist/features/example-responses/ExampleResponse.vue.js +3 -3
  127. package/dist/features/example-responses/ExampleResponse.vue2.js +26 -18
  128. package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
  129. package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
  130. package/dist/features/example-responses/ExampleResponses.vue2.js +53 -53
  131. package/dist/features/multiple-documents/DocumentSelector.vue.d.ts +2 -2
  132. package/dist/features/multiple-documents/DocumentSelector.vue.d.ts.map +1 -1
  133. package/dist/features/multiple-documents/useMultipleDocuments.d.ts +10 -7
  134. package/dist/features/multiple-documents/useMultipleDocuments.d.ts.map +1 -1
  135. package/dist/features/multiple-documents/useMultipleDocuments.js +47 -44
  136. package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -1
  137. package/dist/features/test-request-button/TestRequestButton.vue.js +2 -2
  138. package/dist/features/test-request-button/TestRequestButton.vue2.js +15 -21
  139. package/dist/features/toolbar/ApiReferenceToolbar.vue.js +18 -18
  140. package/dist/features/toolbar/ApiReferenceToolbarConfig.vue.js +1 -1
  141. package/dist/features/toolbar/ApiReferenceToolbarConfigTheme.vue.d.ts +2 -2
  142. package/dist/features/toolbar/ApiReferenceToolbarPopover.vue.js +1 -1
  143. package/dist/features/toolbar/ApiReferenceToolbarSdks.vue.js +1 -1
  144. package/dist/features/toolbar/ApiReferenceToolbarShare.vue.js +8 -8
  145. package/dist/features/toolbar/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -1
  146. package/dist/features/toolbar/ApiReferenceToolbarShareRegister.vue.js +34 -28
  147. package/dist/features/toolbar/ApiReferenceToolbarTitle.vue.js +27 -27
  148. package/dist/helpers/test-utils.d.ts +3 -365
  149. package/dist/helpers/test-utils.d.ts.map +1 -1
  150. package/dist/hooks/useNavState.d.ts +4 -2
  151. package/dist/hooks/useNavState.d.ts.map +1 -1
  152. package/dist/hooks/useNavState.js +31 -27
  153. package/dist/index.d.ts +1 -0
  154. package/dist/index.d.ts.map +1 -1
  155. package/dist/index.js +21 -19
  156. package/dist/standalone/lib/html-api.d.ts +3 -3
  157. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  158. package/dist/standalone/lib/register-globals.d.ts.map +1 -1
  159. package/dist/style.css +1 -1
  160. package/dist/types.d.ts +2 -2
  161. package/dist/types.d.ts.map +1 -1
  162. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
  163. package/dist/v2/ApiReferenceWorkspace.vue.js +46 -40
  164. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  165. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +1 -1
  166. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +18 -19
  167. package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts +1 -1
  168. package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
  169. package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +2 -2
  170. package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +11 -11
  171. package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts +2 -2
  172. package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts.map +1 -1
  173. package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +2 -2
  174. package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +10 -10
  175. package/dist/v2/blocks/scalar-client-selector-block/helpers/featured-clients.d.ts +1 -1
  176. package/dist/v2/blocks/scalar-client-selector-block/helpers/featured-clients.d.ts.map +1 -1
  177. package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue.d.ts +3 -0
  178. package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
  179. package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue.js +2 -2
  180. package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue2.js +32 -31
  181. package/dist/v2/blocks/scalar-info-block/components/InfoBlock.vue.d.ts +15 -8
  182. package/dist/v2/blocks/scalar-info-block/components/InfoBlock.vue.d.ts.map +1 -1
  183. package/dist/v2/blocks/scalar-info-block/components/InfoBlock.vue.js +25 -20
  184. package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts +8 -7
  185. package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts.map +1 -1
  186. package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue.js +2 -2
  187. package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue2.js +27 -32
  188. package/dist/v2/blocks/scalar-server-selector-block/components/Selector.vue.d.ts +2 -22
  189. package/dist/v2/blocks/scalar-server-selector-block/components/Selector.vue.d.ts.map +1 -1
  190. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts +8 -0
  191. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts.map +1 -1
  192. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.js +2 -2
  193. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue2.js +70 -65
  194. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.d.ts +9 -1
  195. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.d.ts.map +1 -1
  196. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.js +2 -2
  197. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue2.js +60 -57
  198. package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts +3 -365
  199. package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts.map +1 -1
  200. package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts +3 -183
  201. package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts.map +1 -1
  202. package/dist/v2/helpers/map-configuration.d.ts +24 -24
  203. package/dist/v2/helpers/map-configuration.d.ts.map +1 -1
  204. package/package.json +20 -17
  205. package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts +0 -13
  206. package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts.map +0 -1
  207. package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +0 -52
  208. package/dist/components/Content/Operations/TraversedEntryContainer.vue2.js +0 -4
  209. package/dist/components/Content/Operations/index.d.ts +0 -2
  210. package/dist/components/Content/Operations/index.d.ts.map +0 -1
  211. package/dist/hooks/useConfig.d.ts +0 -9
  212. package/dist/hooks/useConfig.d.ts.map +0 -1
  213. package/dist/hooks/useConfig.js +0 -10
  214. package/dist/legacy/stores/index.d.ts +0 -2
  215. package/dist/legacy/stores/index.d.ts.map +0 -1
  216. package/dist/legacy/stores/useExampleStore.d.ts +0 -5
  217. package/dist/legacy/stores/useExampleStore.d.ts.map +0 -1
  218. package/dist/legacy/stores/useExampleStore.js +0 -8
  219. package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts +0 -14
  220. package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts.map +0 -1
  221. package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.js +0 -4
  222. package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue2.js +0 -55
  223. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +0 -79
  224. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +0 -1
  225. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.js +0 -7
  226. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue2.js +0 -236
  227. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts +0 -41
  228. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts.map +0 -1
  229. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +0 -22
  230. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.d.ts +0 -20
  231. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.d.ts.map +0 -1
  232. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.js +0 -33
  233. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.d.ts +0 -17
  234. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.d.ts.map +0 -1
  235. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.js +0 -26
  236. package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts +0 -4
  237. package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts.map +0 -1
  238. package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.js +0 -10
  239. package/dist/v2/blocks/scalar-request-example-block/index.d.ts +0 -3
  240. package/dist/v2/blocks/scalar-request-example-block/index.d.ts.map +0 -1
  241. package/dist/v2/blocks/scalar-request-example-block/types.d.ts +0 -29
  242. package/dist/v2/blocks/scalar-request-example-block/types.d.ts.map +0 -1
@@ -1,126 +1,131 @@
1
- import { defineComponent as O, ref as y, watch as N, onMounted as L, onUnmounted as F, createElementBlock as n, openBlock as i, renderSlot as T, createElementVNode as C, createVNode as G, withCtx as v, Fragment as d, renderList as m, unref as a, createBlock as u, toDisplayString as V, createCommentVNode as A } from "vue";
1
+ import { defineComponent as O, ref as y, watch as N, onMounted as L, onUnmounted as F, createElementBlock as r, openBlock as i, renderSlot as T, createElementVNode as C, createVNode as G, withCtx as f, Fragment as d, renderList as m, unref as l, createBlock as u, toDisplayString as V, createCommentVNode as A } from "vue";
2
2
  import { sleep as $ } from "@scalar/helpers/testing/sleep";
3
3
  import { useNavState as M } from "../../../../hooks/useNavState.js";
4
- import { useSidebar as x } from "../hooks/useSidebar.js";
4
+ import { useSidebar as D } from "../hooks/useSidebar.js";
5
5
  import h from "./SidebarElement.vue.js";
6
- import _ from "./SidebarGroup.vue.js";
7
- const D = { class: "sidebar" }, H = ["aria-label"], R = { class: "sidebar-group-title" }, U = -160, W = /* @__PURE__ */ O({
6
+ import g from "./SidebarGroup.vue.js";
7
+ const H = { class: "sidebar" }, R = ["aria-label"], U = { class: "sidebar-group-title" }, j = -160, X = /* @__PURE__ */ O({
8
8
  __name: "SidebarBlock",
9
9
  props: {
10
- title: {}
10
+ title: {},
11
+ options: {}
11
12
  },
12
- setup(j) {
13
- const { hash: o, isIntersectionEnabled: w } = M(), { items: B, toggleCollapsedSidebarItem: g, collapsedSidebarItems: E } = x(), c = y(null), l = y(!0);
14
- N(o, (t) => {
15
- !w.value || l.value || typeof window > "u" || S(t);
13
+ setup(q) {
14
+ const { hash: a, isIntersectionEnabled: w } = M(), { items: B, toggleCollapsedSidebarItem: _, collapsedSidebarItems: E } = D(), c = y(null), n = y(!0);
15
+ N(a, (e) => {
16
+ !w.value || n.value || typeof window > "u" || S(e);
16
17
  });
17
- const S = (t) => {
18
- const s = document.getElementById(`sidebar-${t}`);
18
+ const S = (e) => {
19
+ const s = document.getElementById(`sidebar-${e}`);
19
20
  if (!s || !c.value)
20
21
  return;
21
- let e = U;
22
- s.getAttribute("data-sidebar-type") === "heading" ? e += s.offsetTop + (s.getElementsByClassName("sidebar-heading")?.[0]).offsetHeight : e += s.offsetTop + (s.parentElement?.offsetTop ?? 0) + (s.parentElement?.parentElement?.offsetTop ?? 0), c.value.scrollTo({ top: e, behavior: "smooth" });
23
- }, I = (t) => {
22
+ let t = j;
23
+ s.getAttribute("data-sidebar-type") === "heading" ? t += s.offsetTop + (s.getElementsByClassName("sidebar-heading")?.[0]).offsetHeight : t += s.offsetTop + (s.parentElement?.offsetTop ?? 0) + (s.parentElement?.parentElement?.offsetTop ?? 0), c.value.scrollTo({ top: t, behavior: "smooth" });
24
+ }, I = (e) => {
24
25
  if (!c.value)
25
26
  return;
26
- const s = new MutationObserver((e, r) => {
27
- document.getElementById(`sidebar-${t}`) && (S(t), l.value = !1, r.disconnect());
27
+ const s = new MutationObserver((t, o) => {
28
+ document.getElementById(`sidebar-${e}`) && (S(e), n.value = !1, o.disconnect());
28
29
  });
29
30
  return s.observe(c.value, {
30
31
  childList: !0,
31
32
  subtree: !0
32
33
  }), s;
33
- }, p = (t) => o.value === t ? !0 : o.value.includes("/description/") ? o.value.split("/description/")[0] === t : !1, k = y(void 0);
34
+ }, v = (e) => a.value === e ? !0 : a.value.includes("/description/") ? a.value.split("/description/")[0] === e : !1, k = y(void 0);
34
35
  L(() => {
35
- k.value = I(o.value), o.value || setTimeout(() => l.value = !1, 300);
36
+ k.value = I(a.value), a.value || setTimeout(() => n.value = !1, 300);
36
37
  }), F(() => {
37
38
  k.value?.disconnect();
38
39
  });
39
- const b = (t) => (t.type === "tag" || t.type === "text") && (t.children?.length ?? 0) > 0;
40
- return (t, s) => (i(), n("div", D, [
41
- T(t.$slots, "sidebar-start", {}, void 0, !0),
40
+ const b = (e) => (e.type === "tag" || e.type === "text") && (e.children?.length ?? 0) > 0;
41
+ return (e, s) => (i(), r("div", H, [
42
+ T(e.$slots, "sidebar-start", {}, void 0, !0),
42
43
  C("nav", {
43
44
  ref_key: "scrollerEl",
44
45
  ref: c,
45
- "aria-label": `Table of contents for ${t.title}`,
46
+ "aria-label": `Table of contents for ${e.title}`,
46
47
  class: "sidebar-pages custom-scroll custom-scroll-self-contain-overflow"
47
48
  }, [
48
- G(_, { level: 0 }, {
49
- default: v(() => [
50
- (i(!0), n(d, null, m(a(B).entries, (e) => (i(), n(d, {
51
- key: e.id
49
+ G(g, { level: 0 }, {
50
+ default: f(() => [
51
+ (i(!0), r(d, null, m(l(B).entries, (t) => (i(), r(d, {
52
+ key: t.id
52
53
  }, [
53
- "isGroup" in e && e.isGroup ? (i(), n(d, { key: 0 }, [
54
- C("li", R, V(e.title), 1),
55
- (i(!0), n(d, null, m(e.children, (r) => (i(), u(h, {
56
- key: r.id,
57
- id: `sidebar-${r.id}`,
54
+ "isGroup" in t && t.isGroup ? (i(), r(d, { key: 0 }, [
55
+ C("li", U, V(t.title), 1),
56
+ (i(!0), r(d, null, m(t.children, (o) => (i(), u(h, {
57
+ key: o.id,
58
+ id: `sidebar-${o.id}`,
58
59
  "data-sidebar-type": "heading",
59
- hasChildren: b(r),
60
- isActive: p(r.id),
61
- item: r,
62
- open: a(E)[r.id] ?? !1,
60
+ hasChildren: b(o),
61
+ isActive: v(o.id),
62
+ item: o,
63
+ open: l(E)[o.id] ?? !1,
64
+ options: e.options,
63
65
  onToggleOpen: async () => {
64
- l.value = !0, a(g)(r.id), await a($)(100), l.value = !1;
66
+ n.value = !0, l(_)(o.id), await l($)(100), n.value = !1;
65
67
  }
66
68
  }, {
67
- default: v(() => [
68
- b(r) ? (i(), u(_, {
69
+ default: f(() => [
70
+ b(o) ? (i(), u(g, {
69
71
  key: 0,
70
72
  level: 1
71
73
  }, {
72
- default: v(() => [
73
- (i(!0), n(d, null, m(r.children, (f) => (i(), u(h, {
74
- key: f.id,
75
- id: `sidebar-${f.id}`,
76
- isActive: p(f.id),
77
- item: f
78
- }, null, 8, ["id", "isActive", "item"]))), 128))
74
+ default: f(() => [
75
+ (i(!0), r(d, null, m(o.children, (p) => (i(), u(h, {
76
+ key: p.id,
77
+ id: `sidebar-${p.id}`,
78
+ isActive: v(p.id),
79
+ item: p,
80
+ options: e.options
81
+ }, null, 8, ["id", "isActive", "item", "options"]))), 128))
79
82
  ]),
80
83
  _: 2
81
84
  }, 1024)) : A("", !0)
82
85
  ]),
83
86
  _: 2
84
- }, 1032, ["id", "hasChildren", "isActive", "item", "open", "onToggleOpen"]))), 128))
87
+ }, 1032, ["id", "hasChildren", "isActive", "item", "open", "options", "onToggleOpen"]))), 128))
85
88
  ], 64)) : (i(), u(h, {
86
89
  key: 1,
87
- id: `sidebar-${e.id}`,
90
+ id: `sidebar-${t.id}`,
88
91
  "data-sidebar-type": "heading",
89
- hasChildren: b(e),
90
- isActive: p(e.id),
91
- item: e,
92
- open: a(E)[e.id] ?? !1,
92
+ hasChildren: b(t),
93
+ isActive: v(t.id),
94
+ item: t,
95
+ open: l(E)[t.id] ?? !1,
96
+ options: e.options,
93
97
  onToggleOpen: async () => {
94
- l.value = !0, a(g)(e.id), await a($)(100), l.value = !1;
98
+ n.value = !0, l(_)(t.id), await l($)(100), n.value = !1;
95
99
  }
96
100
  }, {
97
- default: v(() => [
98
- b(e) ? (i(), u(_, {
101
+ default: f(() => [
102
+ b(t) ? (i(), u(g, {
99
103
  key: 0,
100
104
  level: 1
101
105
  }, {
102
- default: v(() => [
103
- (i(!0), n(d, null, m(e.children, (r) => (i(), u(h, {
104
- key: r.id,
105
- id: `sidebar-${r.id}`,
106
- isActive: p(r.id),
107
- item: r
108
- }, null, 8, ["id", "isActive", "item"]))), 128))
106
+ default: f(() => [
107
+ (i(!0), r(d, null, m(t.children, (o) => (i(), u(h, {
108
+ key: o.id,
109
+ id: `sidebar-${o.id}`,
110
+ isActive: v(o.id),
111
+ item: o,
112
+ options: e.options
113
+ }, null, 8, ["id", "isActive", "item", "options"]))), 128))
109
114
  ]),
110
115
  _: 2
111
116
  }, 1024)) : A("", !0)
112
117
  ]),
113
118
  _: 2
114
- }, 1032, ["id", "hasChildren", "isActive", "item", "open", "onToggleOpen"]))
119
+ }, 1032, ["id", "hasChildren", "isActive", "item", "open", "options", "onToggleOpen"]))
115
120
  ], 64))), 128))
116
121
  ]),
117
122
  _: 1
118
123
  })
119
- ], 8, H),
120
- T(t.$slots, "sidebar-end", {}, void 0, !0)
124
+ ], 8, R),
125
+ T(e.$slots, "sidebar-end", {}, void 0, !0)
121
126
  ]));
122
127
  }
123
128
  });
124
129
  export {
125
- W as default
130
+ X as default
126
131
  };
@@ -1,10 +1,18 @@
1
- import type { TraversedEntry } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
1
+ import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
2
2
  type __VLS_Props = {
3
3
  id: string;
4
4
  item: TraversedEntry;
5
5
  isActive?: boolean;
6
6
  hasChildren?: boolean;
7
7
  open?: boolean;
8
+ options: {
9
+ pathRouting?: {
10
+ basePath?: string;
11
+ };
12
+ onSidebarClick: ((id: string) => void) | undefined;
13
+ operationTitleSource: 'path' | 'summary' | undefined;
14
+ defaultOpenAllTags: boolean | undefined;
15
+ };
8
16
  };
9
17
  declare var __VLS_12: {}, __VLS_14: {};
10
18
  type __VLS_Slots = {} & {
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue"],"names":[],"mappings":"AAyXA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAA;AAOlG,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AA4RF,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AAC/C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AA6BtD,QAAA,MAAM,eAAe;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue"],"names":[],"mappings":"AAgYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAMhF,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,OAAO,EAAE;QACP,WAAW,CAAC,EAAE;YACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;SAClB,CAAA;QACD,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;QAClD,oBAAoB,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;QACpD,kBAAkB,EAAE,OAAO,GAAG,SAAS,CAAA;KACxC,CAAA;CACF,CAAC;AA4RF,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AAC/C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AA4BtD,QAAA,MAAM,eAAe;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SidebarElement.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b9da5e03"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-43553cbe"]]);
5
5
  export {
6
- m as default
6
+ a as default
7
7
  };
@@ -1,99 +1,102 @@
1
- import { defineComponent as B, createElementBlock as a, openBlock as o, createElementVNode as r, renderSlot as g, createCommentVNode as s, normalizeClass as A, unref as l, createTextVNode as h, withModifiers as O, createVNode as f, withCtx as b, toDisplayString as p, createBlock as $, normalizeStyle as E } from "vue";
2
- import { ScalarSidebarGroupToggle as N } from "@scalar/components";
3
- import { scrollToId as V } from "@scalar/helpers/dom/scroll-to-id";
4
- import { getHttpMethodInfo as H } from "@scalar/helpers/http/http-info";
5
- import { sleep as k } from "@scalar/helpers/testing/sleep";
6
- import { ScalarIconWebhooksLogo as I } from "@scalar/icons";
7
- import { combineUrlAndPath as P } from "@scalar/oas-utils/helpers";
8
- import { useConfig as R } from "../../../../hooks/useConfig.js";
9
- import { useNavState as U } from "../../../../hooks/useNavState.js";
10
- import D from "./SidebarHttpBadge.vue.js";
11
- const L = ["id"], M = {
1
+ import { defineComponent as T, createElementBlock as n, openBlock as o, createElementVNode as a, renderSlot as c, createCommentVNode as s, normalizeClass as B, createTextVNode as p, withModifiers as A, createVNode as g, unref as h, withCtx as f, toDisplayString as l, createBlock as O, normalizeStyle as $ } from "vue";
2
+ import { ScalarSidebarGroupToggle as E } from "@scalar/components";
3
+ import { scrollToId as N } from "@scalar/helpers/dom/scroll-to-id";
4
+ import { getHttpMethodInfo as V } from "@scalar/helpers/http/http-info";
5
+ import { sleep as b } from "@scalar/helpers/testing/sleep";
6
+ import { ScalarIconWebhooksLogo as H } from "@scalar/icons";
7
+ import { combineUrlAndPath as I } from "@scalar/oas-utils/helpers";
8
+ import { useNavState as P } from "../../../../hooks/useNavState.js";
9
+ import R from "./SidebarHttpBadge.vue.js";
10
+ const U = ["id"], D = {
12
11
  key: 0,
13
12
  class: "sidebar-heading-chevron"
14
- }, z = ["aria-expanded"], j = ["href", "tabindex"], F = { class: "sidebar-heading-link-title" }, G = {
13
+ }, L = ["aria-expanded"], M = ["href", "tabindex"], z = { class: "sidebar-heading-link-title" }, j = {
15
14
  key: 0,
16
15
  class: "hanging-indent"
17
- }, W = { key: 1 }, q = {
16
+ }, F = { key: 1 }, G = {
18
17
  key: 0,
19
18
  class: "sidebar-heading-link-method"
20
- }, J = {
19
+ }, W = {
21
20
  key: 1,
22
21
  class: "action-menu"
23
- }, ie = /* @__PURE__ */ B({
22
+ }, ee = /* @__PURE__ */ T({
24
23
  __name: "SidebarElement",
25
24
  props: {
26
25
  id: {},
27
26
  item: {},
28
27
  isActive: { type: Boolean },
29
28
  hasChildren: { type: Boolean },
30
- open: { type: Boolean }
29
+ open: { type: Boolean },
30
+ options: {}
31
31
  },
32
32
  emits: ["toggleOpen"],
33
- setup(y, { emit: v }) {
34
- const t = y, m = v, { getFullHash: u, isIntersectionEnabled: d, replaceUrlState: C } = U(), i = R(), w = (e) => "path" in e ? e.path.replace(/\//g, "/​") : e.title, c = async () => {
35
- d.value = !1, t.hasChildren && m("toggleOpen"), await k(100), d.value = !0;
36
- }, S = () => {
37
- if (i.value.pathRouting)
38
- return P(i.value.pathRouting.basePath, t.item.id);
33
+ setup(k, { emit: y }) {
34
+ const t = k, d = y, { getFullHash: m, isIntersectionEnabled: r, replaceUrlState: C } = P(), v = (e) => "path" in e ? e.path.replace(/\//g, "/​") : e.title, u = async () => {
35
+ r.value = !1, t.hasChildren && d("toggleOpen"), await b(100), r.value = !0;
36
+ }, w = () => {
37
+ if (t.options.pathRouting)
38
+ return I(
39
+ t.options.pathRouting?.basePath ?? "",
40
+ t.item.id
41
+ );
39
42
  if (typeof window < "u") {
40
43
  const e = new URL(window.location.href);
41
- return e.hash = u(t.item.id), `${e.search}${e.hash}`;
44
+ return e.hash = m(t.item.id), `${e.search}${e.hash}`;
42
45
  }
43
- return `#${u(t.item.id)}`;
44
- }, T = async (e) => {
45
- i.value.onSidebarClick?.(t.item.id), i.value.pathRouting && (e.preventDefault(), t.hasChildren && m("toggleOpen"), m("toggleOpen"), d.value = !1, C(t.item.id), V(t.item.id), await k(100), d.value = !0);
46
+ return `#${m(t.item.id)}`;
47
+ }, S = async (e) => {
48
+ t.options.onSidebarClick?.(t.item.id), t.options.pathRouting && (e.preventDefault(), t.hasChildren && d("toggleOpen"), d("toggleOpen"), r.value = !1, C(t.item.id), N(t.item.id), await b(100), r.value = !0);
46
49
  };
47
- return (e, n) => (o(), a("li", {
50
+ return (e, i) => (o(), n("li", {
48
51
  id: e.id,
49
52
  class: "sidebar-group-item"
50
53
  }, [
51
- r("div", {
52
- class: A(["sidebar-heading", {
54
+ a("div", {
55
+ class: B(["sidebar-heading", {
53
56
  "sidebar-group-item__folder": e.hasChildren,
54
57
  active_page: e.isActive,
55
58
  deprecated: e.item.type === "operation" && e.item.isDeprecated
56
59
  }]),
57
- onClick: c
60
+ onClick: u
58
61
  }, [
59
- e.hasChildren && !l(i).defaultOpenAllTags ? (o(), a("p", M, [
60
- r("button", {
62
+ e.hasChildren && !e.options.defaultOpenAllTags ? (o(), n("p", D, [
63
+ a("button", {
61
64
  "aria-expanded": e.open,
62
65
  class: "toggle-nested-icon",
63
66
  type: "button",
64
- onClick: O(c, ["stop"])
67
+ onClick: A(u, ["stop"])
65
68
  }, [
66
- f(l(N), { open: e.open }, {
67
- label: b(() => [
68
- h(p(e.open ? "Collapse" : "Expand") + " " + p(e.item.title), 1)
69
+ g(h(E), { open: e.open }, {
70
+ label: f(() => [
71
+ p(l(e.open ? "Collapse" : "Expand") + " " + l(e.item.title), 1)
69
72
  ]),
70
73
  _: 1
71
74
  }, 8, ["open"])
72
- ], 8, z),
73
- n[0] || (n[0] = h("   "))
75
+ ], 8, L),
76
+ i[0] || (i[0] = p("   "))
74
77
  ])) : s("", !0),
75
- r("a", {
78
+ a("a", {
76
79
  class: "sidebar-heading-link",
77
- href: S(),
80
+ href: w(),
78
81
  tabindex: e.hasChildren ? -1 : 0,
79
- onClick: T
82
+ onClick: S
80
83
  }, [
81
- r("p", F, [
82
- l(i).operationTitleSource === "path" ? (o(), a("span", G, p(w(e.item)), 1)) : (o(), a("span", W, p(e.item.title), 1))
84
+ a("p", z, [
85
+ e.options.operationTitleSource === "path" ? (o(), n("span", j, l(v(e.item)), 1)) : (o(), n("span", F, l(e.item.title), 1))
83
86
  ]),
84
- "method" in e.item && !e.hasChildren ? (o(), a("p", q, [
85
- n[1] || (n[1] = h("   ")),
86
- n[2] || (n[2] = r("span", { class: "sr-only" }, "HTTP Method: ", -1)),
87
- f(D, {
87
+ "method" in e.item && !e.hasChildren ? (o(), n("p", G, [
88
+ i[1] || (i[1] = p("   ")),
89
+ i[2] || (i[2] = a("span", { class: "sr-only" }, "HTTP Method: ", -1)),
90
+ g(R, {
88
91
  active: e.isActive,
89
92
  class: "min-w-9.75 justify-end text-right",
90
93
  method: e.item.method
91
94
  }, {
92
- default: b(() => [
93
- e.item.type === "webhook" ? (o(), $(l(I), {
95
+ default: f(() => [
96
+ e.item.type === "webhook" ? (o(), O(h(H), {
94
97
  key: 0,
95
- style: E({
96
- color: l(H)(e.item.method).colorVar
98
+ style: $({
99
+ color: h(V)(e.item.method).colorVar
97
100
  }),
98
101
  weight: "bold"
99
102
  }, null, 8, ["style"])) : s("", !0)
@@ -101,15 +104,15 @@ const L = ["id"], M = {
101
104
  _: 1
102
105
  }, 8, ["active", "method"])
103
106
  ])) : s("", !0)
104
- ], 8, j)
107
+ ], 8, M)
105
108
  ], 2),
106
- e.open ? g(e.$slots, "default", { key: 0 }, void 0, !0) : s("", !0),
107
- e.$slots["action-menu"] ? (o(), a("div", J, [
108
- g(e.$slots, "action-menu", {}, void 0, !0)
109
+ e.open ? c(e.$slots, "default", { key: 0 }, void 0, !0) : s("", !0),
110
+ e.$slots["action-menu"] ? (o(), n("div", W, [
111
+ c(e.$slots, "action-menu", {}, void 0, !0)
109
112
  ])) : s("", !0)
110
- ], 8, L));
113
+ ], 8, U));
111
114
  }
112
115
  });
113
116
  export {
114
- ie as default
117
+ ee as default
115
118
  };