@scalar/api-reference 1.31.17 → 1.32.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 (223) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/blocks/helpers/getPointer.d.ts +1 -1
  3. package/dist/blocks/helpers/getPointer.d.ts.map +1 -1
  4. package/dist/blocks/hooks/useBlockProps.js +10 -10
  5. package/dist/browser/standalone.js +15959 -15866
  6. package/dist/browser/webpack-stats.json +1 -1
  7. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  8. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  9. package/dist/components/ApiReferenceLayout.vue2.js +124 -126
  10. package/dist/components/ClassicHeader.vue.d.ts.map +1 -1
  11. package/dist/components/ClassicHeader.vue.js +11 -9
  12. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  13. package/dist/components/Content/Content.vue.js +2 -2
  14. package/dist/components/Content/Content.vue2.js +93 -92
  15. package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
  16. package/dist/components/Content/Introduction/Introduction.vue2.js +3 -3
  17. package/dist/components/Content/Lazy/Loading.vue.d.ts +3 -0
  18. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  19. package/dist/components/Content/Lazy/Loading.vue.js +93 -93
  20. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  22. package/dist/components/Content/Schema/SchemaProperty.vue2.js +1 -1
  23. package/dist/components/Content/Tag/Tag.vue.js +1 -1
  24. package/dist/components/Content/Tag/TagList.vue.d.ts +7 -1
  25. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  26. package/dist/components/Content/Tag/TagList.vue.js +41 -38
  27. package/dist/features/Operation/Operation.vue.d.ts +8 -3
  28. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  29. package/dist/features/Operation/Operation.vue.js +67 -51
  30. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  31. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  32. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
  33. package/dist/features/Operation/components/callbacks/Callback.vue.js +2 -2
  34. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +9 -2
  35. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  36. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  37. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +92 -84
  38. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +10 -3
  39. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  40. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  41. package/dist/features/Operation/layouts/ModernLayout.vue2.js +132 -117
  42. package/dist/features/Search/SearchButton.vue.d.ts +1 -3
  43. package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
  44. package/dist/features/Search/SearchButton.vue.js +17 -16
  45. package/dist/features/Search/SearchModal.vue.js +2 -2
  46. package/dist/features/Search/SearchModal.vue2.js +4 -4
  47. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  48. package/dist/features/Search/useSearchIndex.js +15 -15
  49. package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -0
  50. package/dist/features/api-client-modal/index.d.ts.map +1 -0
  51. package/dist/features/{ApiClientModal → api-client-modal}/useApiClient.d.ts +118 -118
  52. package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -0
  53. package/dist/features/base-url/BaseUrl.vue.d.ts.map +1 -0
  54. package/dist/features/base-url/index.d.ts.map +1 -0
  55. package/dist/features/document-source/hooks/useDocumentFetcher.d.ts.map +1 -0
  56. package/dist/features/document-source/hooks/useDocumentSource.d.ts.map +1 -0
  57. package/dist/features/document-source/hooks/useDocumentSource.js +71 -0
  58. package/dist/features/document-source/index.d.ts.map +1 -0
  59. package/dist/features/download-link/DownloadLink.vue.d.ts.map +1 -0
  60. package/dist/features/{DownloadLink → download-link}/DownloadLink.vue.js +2 -2
  61. package/dist/features/download-link/DownloadLink.vue2.js +59 -0
  62. package/dist/features/download-link/index.d.ts.map +1 -0
  63. package/dist/features/download-link/openapi-version-symbol.d.ts.map +1 -0
  64. package/dist/features/example-request/ExamplePicker.vue.d.ts +13 -0
  65. package/dist/features/example-request/ExamplePicker.vue.d.ts.map +1 -0
  66. package/dist/features/example-request/ExamplePicker.vue.js +7 -0
  67. package/dist/features/example-request/ExamplePicker.vue2.js +56 -0
  68. package/dist/features/example-request/ExampleRequest.vue.d.ts.map +1 -0
  69. package/dist/features/{ExampleRequest → example-request}/ExampleRequest.vue.js +2 -2
  70. package/dist/features/{ExampleRequest → example-request}/ExampleRequest.vue2.js +93 -93
  71. package/dist/features/example-request/TextSelect.vue.d.ts.map +1 -0
  72. package/dist/features/example-request/index.d.ts.map +1 -0
  73. package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -0
  74. package/dist/features/example-responses/ExampleResponse.vue.js +7 -0
  75. package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -0
  76. package/dist/features/example-responses/ExampleResponses.vue.js +7 -0
  77. package/dist/features/{ExampleResponses → example-responses}/ExampleResponses.vue2.js +1 -1
  78. package/dist/features/example-responses/index.d.ts.map +1 -0
  79. package/dist/{components/DocumentSelector → features/multiple-documents}/DocumentSelector.vue.d.ts.map +1 -1
  80. package/dist/{components/DocumentSelector → features/multiple-documents}/DocumentSelector.vue.js +15 -15
  81. package/dist/features/multiple-documents/index.d.ts +3 -0
  82. package/dist/features/multiple-documents/index.d.ts.map +1 -0
  83. package/dist/{hooks → features/multiple-documents}/useMultipleDocuments.d.ts +1 -1
  84. package/dist/features/multiple-documents/useMultipleDocuments.d.ts.map +1 -0
  85. package/dist/features/sidebar/components/Sidebar.vue.d.ts.map +1 -0
  86. package/dist/features/sidebar/components/Sidebar.vue.js +7 -0
  87. package/dist/{components/Sidebar → features/sidebar/components}/Sidebar.vue2.js +2 -2
  88. package/dist/{components/Sidebar → features/sidebar/components}/SidebarElement.vue.d.ts +1 -1
  89. package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -0
  90. package/dist/features/sidebar/components/SidebarElement.vue.js +7 -0
  91. package/dist/{components/Sidebar → features/sidebar/components}/SidebarElement.vue2.js +2 -2
  92. package/dist/features/sidebar/components/SidebarGroup.vue.d.ts.map +1 -0
  93. package/dist/features/sidebar/components/SidebarGroup.vue.js +7 -0
  94. package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +1 -0
  95. package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +7 -0
  96. package/dist/{components/Sidebar → features/sidebar/components}/SidebarHttpBadge.vue2.js +1 -1
  97. package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +1 -1
  98. package/dist/features/sidebar/helpers/create-sidebar.js +8 -8
  99. package/dist/features/sidebar/index.d.ts +1 -0
  100. package/dist/features/sidebar/index.d.ts.map +1 -1
  101. package/dist/features/specification-extension/SpecificationExtension.vue.d.ts.map +1 -0
  102. package/dist/features/specification-extension/index.d.ts.map +1 -0
  103. package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -0
  104. package/dist/features/{TestRequestButton → test-request-button}/TestRequestButton.vue.js +2 -2
  105. package/dist/features/{TestRequestButton → test-request-button}/TestRequestButton.vue2.js +1 -1
  106. package/dist/features/test-request-button/index.d.ts.map +1 -0
  107. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -1
  108. package/dist/features/traverse-schema/helpers/traverse-paths.js +21 -20
  109. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -1
  110. package/dist/features/traverse-schema/helpers/traverse-schemas.js +14 -14
  111. package/dist/helpers/parse.js +7 -7
  112. package/dist/hooks/useOperationDiscriminator.d.ts +2 -2
  113. package/dist/hooks/useOperationDiscriminator.d.ts.map +1 -1
  114. package/dist/hooks/useOperationDiscriminator.js +28 -28
  115. package/dist/index.d.ts +1 -2
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +5 -5
  118. package/dist/libs/openapi.d.ts +5 -6
  119. package/dist/libs/openapi.d.ts.map +1 -1
  120. package/dist/libs/openapi.js +44 -46
  121. package/dist/style.css +1 -1
  122. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
  123. package/dist/v2/ApiReferenceWorkspace.vue.js +110 -65
  124. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +141 -0
  125. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +1 -0
  126. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts +38 -0
  127. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts.map +1 -0
  128. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.d.ts +21 -0
  129. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.d.ts.map +1 -0
  130. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.d.ts +20 -0
  131. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.d.ts.map +1 -0
  132. package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts +4 -0
  133. package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts.map +1 -0
  134. package/dist/v2/blocks/scalar-request-example-block/index.d.ts +2 -0
  135. package/dist/v2/blocks/scalar-request-example-block/index.d.ts.map +1 -0
  136. package/dist/v2/blocks/scalar-request-example-block/types.d.ts +21 -0
  137. package/dist/v2/blocks/scalar-request-example-block/types.d.ts.map +1 -0
  138. package/package.json +14 -14
  139. package/dist/components/DocumentSelector/index.d.ts +0 -2
  140. package/dist/components/DocumentSelector/index.d.ts.map +0 -1
  141. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +0 -1
  142. package/dist/components/Sidebar/Sidebar.vue.js +0 -7
  143. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +0 -1
  144. package/dist/components/Sidebar/SidebarElement.vue.js +0 -7
  145. package/dist/components/Sidebar/SidebarGroup.vue.d.ts.map +0 -1
  146. package/dist/components/Sidebar/SidebarGroup.vue.js +0 -7
  147. package/dist/components/Sidebar/SidebarHttpBadge.vue.d.ts.map +0 -1
  148. package/dist/components/Sidebar/SidebarHttpBadge.vue.js +0 -7
  149. package/dist/components/Sidebar/index.d.ts +0 -2
  150. package/dist/components/Sidebar/index.d.ts.map +0 -1
  151. package/dist/components/SpecificationExtension/SpecificationExtension.vue.d.ts.map +0 -1
  152. package/dist/components/SpecificationExtension/index.d.ts.map +0 -1
  153. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +0 -1
  154. package/dist/features/ApiClientModal/index.d.ts.map +0 -1
  155. package/dist/features/ApiClientModal/useApiClient.d.ts.map +0 -1
  156. package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +0 -1
  157. package/dist/features/BaseUrl/index.d.ts.map +0 -1
  158. package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts.map +0 -1
  159. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +0 -1
  160. package/dist/features/DocumentSource/hooks/useDocumentSource.js +0 -67
  161. package/dist/features/DocumentSource/index.d.ts.map +0 -1
  162. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +0 -1
  163. package/dist/features/DownloadLink/DownloadLink.vue2.js +0 -55
  164. package/dist/features/DownloadLink/index.d.ts.map +0 -1
  165. package/dist/features/DownloadLink/openapi-version-symbol.d.ts.map +0 -1
  166. package/dist/features/ExampleRequest/ExamplePicker.vue.d.ts +0 -10
  167. package/dist/features/ExampleRequest/ExamplePicker.vue.d.ts.map +0 -1
  168. package/dist/features/ExampleRequest/ExamplePicker.vue.js +0 -7
  169. package/dist/features/ExampleRequest/ExamplePicker.vue2.js +0 -59
  170. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +0 -1
  171. package/dist/features/ExampleRequest/TextSelect.vue.d.ts.map +0 -1
  172. package/dist/features/ExampleRequest/index.d.ts.map +0 -1
  173. package/dist/features/ExampleResponses/ExampleResponse.vue.d.ts.map +0 -1
  174. package/dist/features/ExampleResponses/ExampleResponse.vue.js +0 -7
  175. package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts.map +0 -1
  176. package/dist/features/ExampleResponses/ExampleResponses.vue.js +0 -7
  177. package/dist/features/ExampleResponses/index.d.ts.map +0 -1
  178. package/dist/features/TestRequestButton/TestRequestButton.vue.d.ts.map +0 -1
  179. package/dist/features/TestRequestButton/index.d.ts.map +0 -1
  180. package/dist/hooks/useMultipleDocuments.d.ts.map +0 -1
  181. package/dist/legacy/fixtures/httpRequestMethods.d.ts +0 -10
  182. package/dist/legacy/fixtures/httpRequestMethods.d.ts.map +0 -1
  183. package/dist/legacy/fixtures/index.d.ts +0 -2
  184. package/dist/legacy/fixtures/index.d.ts.map +0 -1
  185. /package/dist/features/{ApiClientModal → api-client-modal}/ApiClientModal.vue.d.ts +0 -0
  186. /package/dist/features/{ApiClientModal → api-client-modal}/ApiClientModal.vue.js +0 -0
  187. /package/dist/features/{ApiClientModal → api-client-modal}/ApiClientModal.vue2.js +0 -0
  188. /package/dist/features/{ApiClientModal → api-client-modal}/index.d.ts +0 -0
  189. /package/dist/features/{ApiClientModal → api-client-modal}/useApiClient.js +0 -0
  190. /package/dist/features/{BaseUrl → base-url}/BaseUrl.vue.d.ts +0 -0
  191. /package/dist/features/{BaseUrl → base-url}/BaseUrl.vue.js +0 -0
  192. /package/dist/features/{BaseUrl → base-url}/BaseUrl.vue2.js +0 -0
  193. /package/dist/features/{BaseUrl → base-url}/index.d.ts +0 -0
  194. /package/dist/features/{DocumentSource → document-source}/hooks/useDocumentFetcher.d.ts +0 -0
  195. /package/dist/features/{DocumentSource → document-source}/hooks/useDocumentFetcher.js +0 -0
  196. /package/dist/features/{DocumentSource → document-source}/hooks/useDocumentSource.d.ts +0 -0
  197. /package/dist/features/{DocumentSource → document-source}/index.d.ts +0 -0
  198. /package/dist/features/{DownloadLink → download-link}/DownloadLink.vue.d.ts +0 -0
  199. /package/dist/features/{DownloadLink → download-link}/index.d.ts +0 -0
  200. /package/dist/features/{DownloadLink → download-link}/openapi-version-symbol.d.ts +0 -0
  201. /package/dist/features/{DownloadLink → download-link}/openapi-version-symbol.js +0 -0
  202. /package/dist/features/{ExampleRequest → example-request}/ExampleRequest.vue.d.ts +0 -0
  203. /package/dist/features/{ExampleRequest → example-request}/TextSelect.vue.d.ts +0 -0
  204. /package/dist/features/{ExampleRequest → example-request}/TextSelect.vue.js +0 -0
  205. /package/dist/features/{ExampleRequest → example-request}/TextSelect.vue3.js +0 -0
  206. /package/dist/features/{ExampleRequest → example-request}/index.d.ts +0 -0
  207. /package/dist/features/{ExampleResponses → example-responses}/ExampleResponse.vue.d.ts +0 -0
  208. /package/dist/features/{ExampleResponses → example-responses}/ExampleResponse.vue2.js +0 -0
  209. /package/dist/features/{ExampleResponses → example-responses}/ExampleResponses.vue.d.ts +0 -0
  210. /package/dist/features/{ExampleResponses → example-responses}/index.d.ts +0 -0
  211. /package/dist/{components/DocumentSelector → features/multiple-documents}/DocumentSelector.vue.d.ts +0 -0
  212. /package/dist/{components/DocumentSelector → features/multiple-documents}/DocumentSelector.vue2.js +0 -0
  213. /package/dist/{hooks → features/multiple-documents}/useMultipleDocuments.js +0 -0
  214. /package/dist/{components/Sidebar → features/sidebar/components}/Sidebar.vue.d.ts +0 -0
  215. /package/dist/{components/Sidebar → features/sidebar/components}/SidebarGroup.vue.d.ts +0 -0
  216. /package/dist/{components/Sidebar → features/sidebar/components}/SidebarGroup.vue2.js +0 -0
  217. /package/dist/{components/Sidebar → features/sidebar/components}/SidebarHttpBadge.vue.d.ts +0 -0
  218. /package/dist/{components/SpecificationExtension → features/specification-extension}/SpecificationExtension.vue.d.ts +0 -0
  219. /package/dist/{components/SpecificationExtension → features/specification-extension}/SpecificationExtension.vue.js +0 -0
  220. /package/dist/{components/SpecificationExtension → features/specification-extension}/SpecificationExtension.vue2.js +0 -0
  221. /package/dist/{components/SpecificationExtension → features/specification-extension}/index.d.ts +0 -0
  222. /package/dist/features/{TestRequestButton → test-request-button}/TestRequestButton.vue.d.ts +0 -0
  223. /package/dist/features/{TestRequestButton → test-request-button}/index.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReferenceWorkspace.vue.d.ts","sourceRoot":"","sources":["../../src/v2/ApiReferenceWorkspace.vue"],"names":[],"mappings":"AAmOA,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAuBpE,KAAK,WAAW,GAAG;IACjB,aAAa,CAAC,EAAE,4BAA4B,CAAA;IAC5C,iBAAiB,EAAE,MAAM,cAAc,CAAA;CACxC,CAAC;AAsIF,iBAAS,cAAc;WA0GT,OAAO,IAA6B;;wBAVrB,GAAG;wBACH,GAAG;iCACM,GAAG;;;;EAaxC;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ApiReferenceWorkspace.vue.d.ts","sourceRoot":"","sources":["../../src/v2/ApiReferenceWorkspace.vue"],"names":[],"mappings":"AA8SA,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAyBpE,KAAK,WAAW,GAAG;IACjB,aAAa,CAAC,EAAE,4BAA4B,CAAA;IAC5C,iBAAiB,EAAE,MAAM,cAAc,CAAA;CACxC,CAAC;AAyMF,iBAAS,cAAc;WA0GT,OAAO,IAA6B;;wBAVrB,GAAG;wBACH,GAAG;iCACM,GAAG;;;;EAaxC;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,82 +1,127 @@
1
- import { defineComponent as V, ref as l, toRef as y, provide as b, shallowRef as E, onServerPrefetch as R, onMounted as $, watch as c, computed as w, createElementBlock as A, openBlock as f, Fragment as B, createBlock as N, createCommentVNode as T, createVNode as p, unref as t, resolveDynamicComponent as F, withCtx as a, createTextVNode as I, toDisplayString as P, renderSlot as d, isRef as W } from "vue";
2
- import { useColorMode as L } from "@scalar/use-hooks/useColorMode";
3
- import { useSeoMeta as U } from "@unhead/vue";
4
- import { useFavicon as _ } from "@vueuse/core";
5
- import O from "../components/ApiReferenceLayout.vue.js";
6
- import { useMultipleDocuments as Y } from "../hooks/useMultipleDocuments.js";
7
- import { NAV_STATE_SYMBOL as j } from "../hooks/useNavState.js";
8
- import { onCustomEvent as q } from "./events/listeners.js";
9
- import z from "../components/DocumentSelector/DocumentSelector.vue.js";
10
- const te = /* @__PURE__ */ V({
1
+ import { defineComponent as w, ref as m, toRef as R, provide as T, shallowRef as $, onServerPrefetch as A, onMounted as B, watch as d, computed as N, createElementBlock as P, openBlock as D, Fragment as F, createBlock as I, createCommentVNode as U, createVNode as C, unref as r, resolveDynamicComponent as W, withCtx as n, createTextVNode as L, toDisplayString as O, renderSlot as p, isRef as Y } from "vue";
2
+ import { parseJsonOrYaml as _, redirectToProxy as j } from "@scalar/oas-utils/helpers";
3
+ import { useColorMode as J } from "@scalar/use-hooks/useColorMode";
4
+ import { useSeoMeta as q } from "@unhead/vue";
5
+ import { useFavicon as z } from "@vueuse/core";
6
+ import G from "../components/ApiReferenceLayout.vue.js";
7
+ import { NAV_STATE_SYMBOL as H } from "../hooks/useNavState.js";
8
+ import { useMultipleDocuments as K } from "../features/multiple-documents/useMultipleDocuments.js";
9
+ import { onCustomEvent as h } from "./events/listeners.js";
10
+ import Q from "../features/multiple-documents/DocumentSelector.vue.js";
11
+ const se = /* @__PURE__ */ w({
11
12
  __name: "ApiReferenceWorkspace",
12
13
  props: {
13
14
  configuration: {},
14
15
  getWorkspaceStore: { type: Function }
15
16
  },
16
- setup(k) {
17
- const u = k, {
18
- availableDocuments: v,
19
- selectedConfiguration: o,
20
- selectedDocumentIndex: s,
21
- isIntersectionEnabled: g,
22
- hash: C,
23
- hashPrefix: M
24
- } = Y({
25
- configuration: y(u, "configuration"),
26
- isIntersectionEnabled: l(!1),
27
- hash: l(""),
28
- hashPrefix: l("")
29
- });
30
- b(j, { isIntersectionEnabled: g, hash: C, hashPrefix: M });
31
- const D = E(null), n = u.getWorkspaceStore();
32
- R(() => {
33
- }), $(() => {
34
- }), q(D, "scalar-update-dark-mode", (e) => {
35
- n.update("x-scalar-dark-mode", e.data.value);
17
+ setup(M) {
18
+ const f = M, {
19
+ availableDocuments: u,
20
+ selectedConfiguration: t,
21
+ selectedDocumentIndex: l,
22
+ isIntersectionEnabled: x,
23
+ hash: y,
24
+ hashPrefix: S
25
+ } = K({
26
+ configuration: R(f, "configuration"),
27
+ isIntersectionEnabled: m(!1),
28
+ hash: m(""),
29
+ hashPrefix: m("")
30
+ }), g = (e, o) => fetch(
31
+ j(t.value.proxyUrl, e.toString()),
32
+ o
33
+ );
34
+ T(H, { isIntersectionEnabled: x, hash: y, hashPrefix: S });
35
+ const v = $(null), a = f.getWorkspaceStore(), i = u, s = (e) => {
36
+ if (a.workspace.documents[e.slug ?? "default"] === void 0) {
37
+ if (e.content) {
38
+ const o = typeof e.content == "string" ? _(e.content) : e.content;
39
+ return a.addDocumentSync({
40
+ name: e.slug ?? "default",
41
+ document: typeof o == "function" ? o() : o
42
+ });
43
+ }
44
+ if (e.url)
45
+ return a.addDocument({
46
+ name: e.slug ?? "default",
47
+ url: e.url,
48
+ fetch: g
49
+ });
50
+ }
51
+ };
52
+ i.value.forEach((e) => {
53
+ e.content && s(e);
54
+ }), A(() => {
55
+ i.value.forEach((e) => {
56
+ e.url && s(e);
57
+ });
58
+ }), B(() => {
59
+ i.value.forEach((e) => {
60
+ e.url && s(e);
61
+ });
62
+ }), h(v, "scalar-update-dark-mode", (e) => {
63
+ a.update("x-scalar-dark-mode", e.data.value);
64
+ }), h(v, "scalar-update-active-document", (e) => {
65
+ a.update("x-scalar-active-document", e.data.value);
36
66
  });
37
- const { toggleColorMode: S, isDarkMode: h } = L({
38
- initialColorMode: o.value.darkMode ? "dark" : void 0,
39
- overrideColorMode: o.value.forceDarkModeState
67
+ const { toggleColorMode: E, isDarkMode: V } = J({
68
+ initialColorMode: t.value.darkMode ? "dark" : void 0,
69
+ overrideColorMode: t.value.forceDarkModeState
40
70
  });
41
- c(
42
- () => o.value.darkMode,
43
- (e) => n.update("x-scalar-dark-mode", !!e)
44
- ), c(
45
- () => h.value,
46
- (e) => n.update("x-scalar-dark-mode", e),
71
+ d(
72
+ () => t.value.darkMode,
73
+ (e) => a.update("x-scalar-dark-mode", !!e)
74
+ ), d(
75
+ () => V.value,
76
+ (e) => a.update("x-scalar-dark-mode", e),
77
+ { immediate: !0 }
78
+ ), d(
79
+ () => l.value,
80
+ (e) => {
81
+ var o;
82
+ return a.update(
83
+ "x-scalar-active-document",
84
+ (o = u.value[e]) == null ? void 0 : o.slug
85
+ );
86
+ },
47
87
  { immediate: !0 }
48
- ), o.value.metaData && U(o.value.metaData);
49
- const x = w(() => o.value.favicon);
50
- return _(x), (e, r) => {
51
- var m;
52
- return f(), A(B, null, [
53
- (m = t(o)) != null && m.customCss ? (f(), N(F("style"), { key: 0 }, {
54
- default: a(() => [
55
- I(P(t(o).customCss), 1)
88
+ ), d(
89
+ () => u.value,
90
+ (e) => {
91
+ e.forEach(s);
92
+ }
93
+ ), t.value.metaData && q(t.value.metaData);
94
+ const b = N(() => t.value.favicon);
95
+ return z(b), (e, o) => {
96
+ var k;
97
+ return D(), P(F, null, [
98
+ (k = r(t)) != null && k.customCss ? (D(), I(W("style"), { key: 0 }, {
99
+ default: n(() => [
100
+ L(O(r(t).customCss), 1)
56
101
  ]),
57
102
  _: 1
58
- })) : T("", !0),
59
- p(O, {
60
- configuration: t(o),
61
- isDark: !!t(n).workspace["x-scalar-dark-mode"],
62
- onToggleDarkMode: r[1] || (r[1] = () => t(S)()),
63
- onUpdateContent: r[2] || (r[2] = (i) => e.$emit("updateContent", i))
103
+ })) : U("", !0),
104
+ C(G, {
105
+ configuration: r(t),
106
+ isDark: !!r(a).workspace["x-scalar-dark-mode"],
107
+ onToggleDarkMode: o[1] || (o[1] = () => r(E)()),
108
+ onUpdateContent: o[2] || (o[2] = (c) => e.$emit("updateContent", c))
64
109
  }, {
65
- footer: a(() => [
66
- d(e.$slots, "footer")
110
+ footer: n(() => [
111
+ p(e.$slots, "footer")
67
112
  ]),
68
- "content-end": a(() => [
69
- d(e.$slots, "footer")
113
+ "content-end": n(() => [
114
+ p(e.$slots, "footer")
70
115
  ]),
71
- "document-selector": a(() => [
72
- p(t(z), {
73
- modelValue: t(s),
74
- "onUpdate:modelValue": r[0] || (r[0] = (i) => W(s) ? s.value = i : null),
75
- options: t(v)
116
+ "document-selector": n(() => [
117
+ C(r(Q), {
118
+ modelValue: r(l),
119
+ "onUpdate:modelValue": o[0] || (o[0] = (c) => Y(l) ? l.value = c : null),
120
+ options: r(u)
76
121
  }, null, 8, ["modelValue", "options"])
77
122
  ]),
78
- "sidebar-start": a(() => [
79
- d(e.$slots, "sidebar-start")
123
+ "sidebar-start": n(() => [
124
+ p(e.$slots, "sidebar-start")
80
125
  ]),
81
126
  _: 3
82
127
  }, 8, ["configuration", "isDark"])
@@ -85,5 +130,5 @@ const te = /* @__PURE__ */ V({
85
130
  }
86
131
  });
87
132
  export {
88
- te as default
133
+ se as default
89
134
  };
@@ -0,0 +1,141 @@
1
+ import type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods';
2
+ import { type AvailableClients } from '@scalar/snippetz';
3
+ import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/path-operations';
4
+ import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/security-scheme';
5
+ import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/server';
6
+ import { type Dereference } from '@scalar/workspace-store/schemas/v3.1/type-guard';
7
+ import { type ComponentPublicInstance } from 'vue';
8
+ type Props = {
9
+ /**
10
+ * List of all allowed clients, this will determine which clients are available in the dropdown
11
+ *
12
+ * For the complete list:
13
+ * @see https://github.com/scalar/scalar/blob/main/packages/types/src/snippetz/snippetz.ts#L8
14
+ *
15
+ * @defaults to all available clients + any included custom code examples
16
+ */
17
+ allowedClients?: AvailableClients[number][];
18
+ /**
19
+ * Pre-selected client, this will determine which client is initially selected in the dropdown
20
+ *
21
+ * @defaults to js/fetch or a custom sample if one is available
22
+ */
23
+ selectedClient?: AvailableClients[number];
24
+ /**
25
+ * Which server from the spec to use for the code example
26
+ */
27
+ selectedServer?: ServerObject;
28
+ /**
29
+ * The selected content type from the requestBody.content, this will determine which examples are available
30
+ * as well as the content type of the code example
31
+ *
32
+ * @defaults to the first content type
33
+ */
34
+ selectedContentType?: string;
35
+ /**
36
+ * In case you wish to pre-select an example from the requestBody.content.examples
37
+ */
38
+ selectedExample?: string;
39
+ /**
40
+ * The security schemes which are applicable to this operation
41
+ */
42
+ securitySchemes?: SecuritySchemeObject[];
43
+ /**
44
+ * HTTP method of the operation
45
+ */
46
+ method: HttpMethodType;
47
+ /**
48
+ * Path of the operation
49
+ */
50
+ path: string;
51
+ /**
52
+ * De-referenced OpenAPI Operation object
53
+ */
54
+ operation: Dereference<OperationObject>;
55
+ /**
56
+ * If true and there's no example, we will display a small card with the method and path only
57
+ */
58
+ fallback?: boolean;
59
+ /**
60
+ * A method to generate the label of the block, should return an html string
61
+ */
62
+ generateLabel?: () => string;
63
+ /**
64
+ * Config options for the block
65
+ */
66
+ config?: {
67
+ hideClientSelector?: boolean;
68
+ };
69
+ };
70
+ declare function __VLS_template(): {
71
+ attrs: Partial<{}>;
72
+ slots: Readonly<{
73
+ header: () => unknown;
74
+ footer: () => unknown;
75
+ }> & {
76
+ header: () => unknown;
77
+ footer: () => unknown;
78
+ };
79
+ refs: {
80
+ elem: ({
81
+ $: import("vue").ComponentInternalInstance;
82
+ $data: {};
83
+ $props: Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
84
+ $attrs: {
85
+ [x: string]: unknown;
86
+ };
87
+ $refs: {
88
+ [x: string]: unknown;
89
+ };
90
+ $slots: Readonly<{
91
+ [name: string]: import("vue").Slot<any> | undefined;
92
+ }>;
93
+ $root: ComponentPublicInstance | null;
94
+ $parent: ComponentPublicInstance | null;
95
+ $host: Element | null;
96
+ $emit: (event: string, ...args: any[]) => void;
97
+ $el: HTMLDivElement;
98
+ $options: import("vue").ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
99
+ beforeCreate?: (() => void) | (() => void)[];
100
+ created?: (() => void) | (() => void)[];
101
+ beforeMount?: (() => void) | (() => void)[];
102
+ mounted?: (() => void) | (() => void)[];
103
+ beforeUpdate?: (() => void) | (() => void)[];
104
+ updated?: (() => void) | (() => void)[];
105
+ activated?: (() => void) | (() => void)[];
106
+ deactivated?: (() => void) | (() => void)[];
107
+ beforeDestroy?: (() => void) | (() => void)[];
108
+ beforeUnmount?: (() => void) | (() => void)[];
109
+ destroyed?: (() => void) | (() => void)[];
110
+ unmounted?: (() => void) | (() => void)[];
111
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
112
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
113
+ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
114
+ };
115
+ $forceUpdate: () => void;
116
+ $nextTick: typeof import("vue").nextTick;
117
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
118
+ } & Readonly<{}> & Omit<Readonly<{}> & Readonly<{}>, never> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
119
+ $slots: {
120
+ default?(_: {}): any;
121
+ };
122
+ }) | null;
123
+ };
124
+ rootEl: any;
125
+ };
126
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
127
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
128
+ "update:selectedClient": (id: "c/libcurl" | "clojure/clj_http" | "csharp/httpclient" | "csharp/restsharp" | "go/native" | "http/http1.1" | "java/asynchttp" | "java/nethttp" | "java/okhttp" | "java/unirest" | "js/axios" | "js/fetch" | "js/jquery" | "js/ofetch" | "js/xhr" | "kotlin/okhttp" | "node/axios" | "node/fetch" | "node/ofetch" | "node/undici" | "objc/nsurlsession" | "ocaml/cohttp" | "php/curl" | "php/guzzle" | "powershell/restmethod" | "powershell/webrequest" | "python/python3" | "python/requests" | "python/httpx_sync" | "python/httpx_async" | "r/httr" | "ruby/native" | "shell/curl" | "shell/httpie" | "shell/wget" | "swift/nsurlsession" | "dart/http") => any;
129
+ "update:selectedExample": (name: string) => any;
130
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
131
+ "onUpdate:selectedClient"?: ((id: "c/libcurl" | "clojure/clj_http" | "csharp/httpclient" | "csharp/restsharp" | "go/native" | "http/http1.1" | "java/asynchttp" | "java/nethttp" | "java/okhttp" | "java/unirest" | "js/axios" | "js/fetch" | "js/jquery" | "js/ofetch" | "js/xhr" | "kotlin/okhttp" | "node/axios" | "node/fetch" | "node/ofetch" | "node/undici" | "objc/nsurlsession" | "ocaml/cohttp" | "php/curl" | "php/guzzle" | "powershell/restmethod" | "powershell/webrequest" | "python/python3" | "python/requests" | "python/httpx_sync" | "python/httpx_async" | "r/httr" | "ruby/native" | "shell/curl" | "shell/httpie" | "shell/wget" | "swift/nsurlsession" | "dart/http") => any) | undefined;
132
+ "onUpdate:selectedExample"?: ((name: string) => any) | undefined;
133
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
134
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
135
+ export default _default;
136
+ type __VLS_WithTemplateSlots<T, S> = T & {
137
+ new (): {
138
+ $slots: S;
139
+ };
140
+ };
141
+ //# sourceMappingURL=RequestExample.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequestExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/components/RequestExample.vue"],"names":[],"mappings":"AA4XA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAGrF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAA;AAClG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AACvG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AACtF,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iDAAiD,CAAA;AACxD,OAAO,EAA+B,KAAK,uBAAuB,EAAE,MAAM,KAAK,CAAA;AAiB/E,KAAK,KAAK,GAAG;IACX;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAA;IAC3C;;;;OAIG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACzC;;OAEG;IACH,cAAc,CAAC,EAAE,YAAY,CAAA;IAC7B;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;IACxC;;OAEG;IACH,MAAM,EAAE,cAAc,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IACvC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAA;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE;QACP,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAC7B,CAAA;CACF,CAAA;AA+ID,iBAAS,cAAc;WAuNT,OAAO,IAA6B;;gBA3UxC,MAAM,OAAO;gBACb,MAAM,OAAO;;gBADb,MAAM,OAAO;gBACb,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAmPM,GAAG,8CAE7B,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;EA0FvE;AA6BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { ClientOption, ClientOptionGroup } from '../../../../v2/blocks/scalar-request-example-block/types';
2
+ import type { AvailableClients } from '@scalar/snippetz';
3
+ /**
4
+ * Finds and returns the appropriate client option from a list of client option groups.
5
+ *
6
+ * This function is used to determine which client should be initially selected in the
7
+ * request example block. It prioritizes a specific client ID if provided, otherwise
8
+ * falls back to the first available option.
9
+ *
10
+ * @param options - Array of client option groups, each containing a label and array of client options
11
+ * @param id - Optional client identifier to search for (e.g., 'js/fetch', 'python/requests')
12
+ *
13
+ * @returns The selected client option. If a specific ID is provided and found, returns that client.
14
+ * If the ID is not found or not provided, returns the first available client option.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const clientGroups = [
19
+ * {
20
+ * label: 'JavaScript',
21
+ * options: [
22
+ * { id: 'js/fetch', label: 'Fetch API', lang: 'js' },
23
+ * { id: 'js/axios', label: 'Axios', lang: 'js' }
24
+ * ]
25
+ * }
26
+ * ]
27
+ *
28
+ * // Find specific client
29
+ * const client = findClient(clientGroups, 'js/fetch')
30
+ * // Returns: { id: 'js/fetch', label: 'Fetch API', lang: 'js' }
31
+ *
32
+ * // Find first available client
33
+ * const firstClient = findClient(clientGroups)
34
+ * // Returns: { id: 'js/fetch', label: 'Fetch API', lang: 'js' }
35
+ * ```
36
+ */
37
+ export declare const findClient: (clientGroups: ClientOptionGroup[], clientId?: AvailableClients[number] | undefined) => ClientOption;
38
+ //# sourceMappingURL=find-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-client.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/find-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AACrG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,UAAU,iBACP,iBAAiB,EAAE,aACtB,gBAAgB,CAAC,MAAM,CAAC,GAAG,SAAS,KAC9C,YAcF,CAAA"}
@@ -0,0 +1,21 @@
1
+ import type { ClientOptionGroup } from '../../../../v2/blocks/scalar-request-example-block/types';
2
+ import type { XCodeSample } from '@scalar/openapi-types/schemas/extensions';
3
+ import { type AvailableClients } from '@scalar/snippetz';
4
+ /** Helper to generate an ID for custom code samples */
5
+ export declare const generateCustomId: (example: XCodeSample) => string;
6
+ /**
7
+ * Generates client options for the request example block by combining built-in snippets
8
+ * with custom code samples. This function creates a structured list of available
9
+ * client options that can be used to generate code examples for different programming
10
+ * languages and frameworks.
11
+ *
12
+ * The function filters built-in clients based on the allowedClients parameter and
13
+ * groups them by their category (e.g., JavaScript, Python, etc.). Custom code samples
14
+ * are added as a separate "Code Examples" group at the top of the list.
15
+ *
16
+ * @param customRequestExamples - Array of custom code samples to include in the options
17
+ * @param allowedClients - Optional array of allowed client IDs to filter built-in clients
18
+ * @returns Array of client option groups, each containing a label and array of client options
19
+ */
20
+ export declare const generateClientOptions: (customRequestExamples: XCodeSample[], allowedClients?: AvailableClients[number][]) => ClientOptionGroup[];
21
+ //# sourceMappingURL=generate-client-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-client-options.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/generate-client-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AACvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AAC3E,OAAO,EAAY,KAAK,gBAAgB,EAAiB,MAAM,kBAAkB,CAAA;AAGjF,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,YAAa,WAAW,WAA6B,CAAA;AAElF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,0BACT,WAAW,EAAE,mBACnB,gBAAgB,CAAC,MAAM,CAAC,EAAE,KAC1C,iBAAiB,EAqDnB,CAAA"}
@@ -0,0 +1,20 @@
1
+ import type { AvailableClients } from '@scalar/snippetz';
2
+ import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/path-operations';
3
+ import { type Dereference } from '@scalar/workspace-store/schemas/v3.1/type-guard';
4
+ import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/server';
5
+ import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/security-scheme';
6
+ import type { HttpMethod } from '@scalar/helpers/http/http-methods';
7
+ type Props = {
8
+ clientId: AvailableClients[number];
9
+ operation: Dereference<OperationObject>;
10
+ example: unknown;
11
+ method: HttpMethod;
12
+ path: string;
13
+ contentType?: string | undefined;
14
+ server?: ServerObject | undefined;
15
+ securitySchemes?: SecuritySchemeObject[] | undefined;
16
+ };
17
+ /** Generate the code snippet for the selected example OR operation */
18
+ export declare const generateCodeSnippet: ({ clientId, operation, method, path, example, contentType, server, securitySchemes, }: Props) => string;
19
+ export {};
20
+ //# sourceMappingURL=generate-code-snippet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-code-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,kBAAkB,CAAA;AAE5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAA;AAClG,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AAEtF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AACvG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAClC,SAAS,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,UAAU,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACjC,eAAe,CAAC,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAAA;CACrD,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,0FAS7B,KAAK,KAAG,MAuBV,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/security-scheme';
2
+ /** Extract secrets from security schemes */
3
+ export declare const getSecrets: (securitySchemes: SecuritySchemeObject[]) => string[];
4
+ //# sourceMappingURL=get-secrets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/get-secrets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AAEvG,4CAA4C;AAC5C,eAAO,MAAM,UAAU,oBAAqB,oBAAoB,EAAE,KAqBxC,MAAM,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { default as RequestExample } from './components/RequestExample.vue';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/scalar-request-example-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA"}
@@ -0,0 +1,21 @@
1
+ import type { ScalarComboboxOption, ScalarComboboxOptionGroup } from '@scalar/components';
2
+ import type { TargetId } from '@scalar/snippetz';
3
+ /**
4
+ * Represents a client option in the request example block.
5
+ * Extends the base combobox option with language-specific information
6
+ * for generating code examples in different programming languages.
7
+ */
8
+ export type ClientOption = ScalarComboboxOption & {
9
+ /** The programming language or tool for code generation (e.g., 'javascript', 'python', 'curl') */
10
+ lang: TargetId | 'curl' | 'plaintext';
11
+ /** The title shows when the client is selected in the dropdown */
12
+ title: string;
13
+ };
14
+ /**
15
+ * Augments the base combobox option group with ClientOptions
16
+ */
17
+ export type ClientOptionGroup = Omit<ScalarComboboxOptionGroup, 'options'> & {
18
+ /** Array of client options that belong to this group */
19
+ options: ClientOption[];
20
+ };
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/scalar-request-example-block/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AACzF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEhD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,oBAAoB,GAAG;IAChD,kGAAkG;IAClG,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;IACrC,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,yBAAyB,EAAE,SAAS,CAAC,GAAG;IAC3E,wDAAwD;IACxD,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB,CAAA"}
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "vue",
21
21
  "vue3"
22
22
  ],
23
- "version": "1.31.17",
23
+ "version": "1.32.0",
24
24
  "engines": {
25
25
  "node": ">=20"
26
26
  },
@@ -51,23 +51,23 @@
51
51
  "fuse.js": "^7.0.0",
52
52
  "github-slugger": "^2.0.0",
53
53
  "microdiff": "^1.4.0",
54
- "nanoid": "^5.1.5",
54
+ "nanoid": "5.1.5",
55
55
  "vue": "^3.5.12",
56
56
  "zod": "3.24.1",
57
- "@scalar/api-client": "2.5.11",
57
+ "@scalar/api-client": "2.5.13",
58
58
  "@scalar/code-highlight": "0.1.4",
59
- "@scalar/components": "0.14.12",
60
- "@scalar/icons": "0.4.4",
61
- "@scalar/helpers": "0.0.4",
62
- "@scalar/oas-utils": "0.4.7",
63
- "@scalar/openapi-types": "0.3.3",
64
- "@scalar/themes": "0.13.4",
59
+ "@scalar/components": "0.14.14",
60
+ "@scalar/helpers": "0.0.5",
61
+ "@scalar/icons": "0.4.5",
62
+ "@scalar/oas-utils": "0.4.9",
65
63
  "@scalar/openapi-parser": "0.18.0",
64
+ "@scalar/openapi-types": "0.3.4",
66
65
  "@scalar/snippetz": "0.3.1",
67
- "@scalar/types": "0.2.3",
68
- "@scalar/use-hooks": "0.2.2",
66
+ "@scalar/types": "0.2.5",
67
+ "@scalar/themes": "0.13.6",
68
+ "@scalar/use-hooks": "0.2.3",
69
69
  "@scalar/use-toasts": "0.8.0",
70
- "@scalar/workspace-store": "0.5.2"
70
+ "@scalar/workspace-store": "0.7.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@tailwindcss/vite": "^4.1.7",
@@ -85,8 +85,8 @@
85
85
  "vite-plugin-css-injected-by-js": "^3.4.0",
86
86
  "vitest": "^1.6.0",
87
87
  "@scalar/galaxy": "0.5.1",
88
- "@scalar/react-renderer": "0.2.0",
89
- "@scalar/build-tooling": "0.2.3"
88
+ "@scalar/build-tooling": "0.2.3",
89
+ "@scalar/react-renderer": "0.2.0"
90
90
  },
91
91
  "scripts": {
92
92
  "build": "pnpm build:default && pnpm build:standalone && pnpm types:build && tsc-alias -p tsconfig.build.json",
@@ -1,2 +0,0 @@
1
- export { default as DocumentSelector } from './DocumentSelector.vue.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentSelector/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.vue"],"names":[],"mappings":"AA+QA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;AAmHF,iBAAS,cAAc;WAoKT,OAAO,IAA6B;;iCAVb,GAAG;+BACJ,GAAG;;;;;;EActC;AAkBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,6SAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +0,0 @@
1
- import o from "./Sidebar.vue2.js";
2
- /* empty css */
3
- import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fbdf40e7"]]);
5
- export {
6
- e as default
7
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarElement.vue"],"names":[],"mappings":"AAiWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAQhE,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;AAuEF,iBAAS,cAAc;WA+KT,OAAO,IAA6B;;yBATpB,GAAG;+BACG,GAAG;;;;EAatC;AAiBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;4FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +0,0 @@
1
- import o from "./SidebarElement.vue2.js";
2
- /* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9ab41262"]]);
5
- export {
6
- m as default
7
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"SidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarGroup.vue"],"names":[],"mappings":"AA8CA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;AAQF,iBAAS,cAAc;WAiDT,OAAO,IAA6B;;yBARrB,GAAG;;;;EAa/B;AAQD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,+SAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +0,0 @@
1
- import o from "./SidebarGroup.vue2.js";
2
- /* empty css */
3
- import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-5d54b401"]]);
5
- export {
6
- m as default
7
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"SidebarHttpBadge.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarHttpBadge.vue"],"names":[],"mappings":"AAmDA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAQF,iBAAS,cAAc;WA6DT,OAAO,IAA6B;;yBARrB,GAAG;;;;EAa/B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +0,0 @@
1
- import t from "./SidebarHttpBadge.vue2.js";
2
- /* empty css */
3
- import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const d = /* @__PURE__ */ o(t, [["__scopeId", "data-v-43724d28"]]);
5
- export {
6
- d as default
7
- };
@@ -1,2 +0,0 @@
1
- export { default as Sidebar } from './Sidebar.vue.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpecificationExtension.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SpecificationExtension/SpecificationExtension.vue"],"names":[],"mappings":"AAkFA,KAAK,WAAW,GAAG;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;CAC3C,CAAC;;AAyHF,wBAMG"}